{"version":3,"sources":["vendor/ember-cli/vendor-prefix.js","vendor/loader/loader.js","vendor/jquery/jquery.js","license.js","loader.js","@ember/-internals/browser-environment/index.js","@ember/-internals/console/index.js","@ember/-internals/container/index.js","@ember/-internals/environment/index.js","@ember/-internals/error-handling/index.js","@ember/-internals/extension-support/index.js","@ember/-internals/extension-support/lib/container_debug_adapter.js","@ember/-internals/extension-support/lib/data_adapter.js","@ember/-internals/glimmer/index.js","@ember/-internals/meta/index.js","@ember/-internals/meta/lib/meta.js","@ember/-internals/metal/index.js","@ember/-internals/owner/index.js","@ember/-internals/routing/index.js","@ember/-internals/routing/lib/ext/controller.js","@ember/-internals/routing/lib/location/api.js","@ember/-internals/routing/lib/location/auto_location.js","@ember/-internals/routing/lib/location/hash_location.js","@ember/-internals/routing/lib/location/history_location.js","@ember/-internals/routing/lib/location/none_location.js","@ember/-internals/routing/lib/location/util.js","@ember/-internals/routing/lib/services/router.js","@ember/-internals/routing/lib/services/routing.js","@ember/-internals/routing/lib/system/cache.js","@ember/-internals/routing/lib/system/controller_for.js","@ember/-internals/routing/lib/system/dsl.js","@ember/-internals/routing/lib/system/engines.js","@ember/-internals/routing/lib/system/generate_controller.js","@ember/-internals/routing/lib/system/query_params.js","@ember/-internals/routing/lib/system/route-info.js","@ember/-internals/routing/lib/system/route.js","@ember/-internals/routing/lib/system/router.js","@ember/-internals/routing/lib/system/router_state.js","@ember/-internals/routing/lib/system/transition.js","@ember/-internals/routing/lib/utils.js","@ember/-internals/runtime/index.js","@ember/-internals/runtime/lib/compare.js","@ember/-internals/runtime/lib/copy.js","@ember/-internals/runtime/lib/ext/function.js","@ember/-internals/runtime/lib/ext/rsvp.js","@ember/-internals/runtime/lib/is-equal.js","@ember/-internals/runtime/lib/mixins/-proxy.js","@ember/-internals/runtime/lib/mixins/action_handler.js","@ember/-internals/runtime/lib/mixins/array.js","@ember/-internals/runtime/lib/mixins/comparable.js","@ember/-internals/runtime/lib/mixins/container_proxy.js","@ember/-internals/runtime/lib/mixins/copyable.js","@ember/-internals/runtime/lib/mixins/enumerable.js","@ember/-internals/runtime/lib/mixins/evented.js","@ember/-internals/runtime/lib/mixins/mutable_enumerable.js","@ember/-internals/runtime/lib/mixins/observable.js","@ember/-internals/runtime/lib/mixins/promise_proxy.js","@ember/-internals/runtime/lib/mixins/registry_proxy.js","@ember/-internals/runtime/lib/mixins/target_action_support.js","@ember/-internals/runtime/lib/system/array_proxy.js","@ember/-internals/runtime/lib/system/core_object.js","@ember/-internals/runtime/lib/system/namespace.js","@ember/-internals/runtime/lib/system/object.js","@ember/-internals/runtime/lib/system/object_proxy.js","@ember/-internals/runtime/lib/type-of.js","@ember/-internals/utils/index.js","@ember/-internals/views/index.js","@ember/-internals/views/lib/compat/attrs.js","@ember/-internals/views/lib/compat/fallback-view-registry.js","@ember/-internals/views/lib/component_lookup.js","@ember/-internals/views/lib/mixins/action_support.js","@ember/-internals/views/lib/mixins/child_views_support.js","@ember/-internals/views/lib/mixins/class_names_support.js","@ember/-internals/views/lib/mixins/text_support.js","@ember/-internals/views/lib/mixins/view_state_support.js","@ember/-internals/views/lib/mixins/view_support.js","@ember/-internals/views/lib/system/action_manager.js","@ember/-internals/views/lib/system/event_dispatcher.js","@ember/-internals/views/lib/system/jquery.js","@ember/-internals/views/lib/system/jquery_event_deprecation.js","@ember/-internals/views/lib/system/utils.js","@ember/-internals/views/lib/views/core_view.js","@ember/-internals/views/lib/views/states.js","@ember/-internals/views/lib/views/states/default.js","@ember/-internals/views/lib/views/states/destroying.js","@ember/-internals/views/lib/views/states/has_element.js","@ember/-internals/views/lib/views/states/in_dom.js","@ember/-internals/views/lib/views/states/pre_render.js","@ember/application/globals-resolver.js","@ember/application/index.js","@ember/application/instance.js","@ember/application/lib/application.js","@ember/application/lib/lazy_load.js","@ember/canary-features/index.js","@ember/component/index.js","@ember/component/template-only.js","@ember/controller/index.js","@ember/controller/lib/controller_mixin.js","@ember/debug/index.js","@ember/debug/lib/capture-render-tree.js","@ember/debug/lib/deprecate.js","@ember/debug/lib/handlers.js","@ember/debug/lib/testing.js","@ember/debug/lib/warn.js","@ember/deprecated-features/index.js","@ember/engine/index.js","@ember/engine/instance.js","@ember/engine/lib/engine-parent.js","@ember/error/index.js","@ember/instrumentation/index.js","@ember/modifier/index.js","@ember/object/compat.js","@ember/object/computed.js","@ember/object/index.js","@ember/object/lib/computed/computed_macros.js","@ember/object/lib/computed/reduce_computed_macros.js","@ember/polyfills/index.js","@ember/polyfills/lib/assign.js","@ember/polyfills/lib/merge.js","@ember/polyfills/lib/weak_set.js","@ember/runloop/index.js","@ember/service/index.js","@ember/string/index.js","@ember/string/lib/string_registry.js","@glimmer/encoder.js","@glimmer/low-level.js","@glimmer/node.js","@glimmer/opcode-compiler.js","@glimmer/program.js","@glimmer/reference.js","@glimmer/runtime.js","@glimmer/util.js","@glimmer/vm.js","@glimmer/wire-format.js","backburner.js","dag-map.js","ember-babel.js","ember-testing/index.js","ember-testing/lib/adapters/adapter.js","ember-testing/lib/adapters/qunit.js","ember-testing/lib/events.js","ember-testing/lib/ext/application.js","ember-testing/lib/ext/rsvp.js","ember-testing/lib/helpers.js","ember-testing/lib/helpers/-is-form-control.js","ember-testing/lib/helpers/and_then.js","ember-testing/lib/helpers/click.js","ember-testing/lib/helpers/current_path.js","ember-testing/lib/helpers/current_route_name.js","ember-testing/lib/helpers/current_url.js","ember-testing/lib/helpers/fill_in.js","ember-testing/lib/helpers/find.js","ember-testing/lib/helpers/find_with_assert.js","ember-testing/lib/helpers/key_event.js","ember-testing/lib/helpers/pause_test.js","ember-testing/lib/helpers/trigger_event.js","ember-testing/lib/helpers/visit.js","ember-testing/lib/helpers/wait.js","ember-testing/lib/initializers.js","ember-testing/lib/setup_for_testing.js","ember-testing/lib/support.js","ember-testing/lib/test.js","ember-testing/lib/test/adapter.js","ember-testing/lib/test/helpers.js","ember-testing/lib/test/on_inject_helpers.js","ember-testing/lib/test/pending_requests.js","ember-testing/lib/test/promise.js","ember-testing/lib/test/run.js","ember-testing/lib/test/waiters.js","ember/index.js","ember/version.js","node-module/index.js","route-recognizer.js","router_js.js","rsvp.js","vendor/shims/jquery.js","vendor/jquery/component.dollar.js","vendor/ember-cli-jstree/jstree.js","vendor/ember-cli-jstree/register-version.js","vendor/ember-fetch.js","vendor/ember-model-validator/register-version.js","vendor/jquery.min.js","vendor/x3dom-1.8.1/x3dom-full.js","vendor/x3dom-1.8.1/x3dom-full.debug.js","vendor/viewpointmanagement/vpmanagement.js","vendor/bootstrap/dist/js/bootstrap.js","vendor/treetools.js","addon-tree-output/@ember-data/adapter/-private.js","addon-tree-output/@ember-data/adapter/error.js","addon-tree-output/@ember-data/adapter/index.js","addon-tree-output/@ember-data/adapter/json-api.js","addon-tree-output/@ember-data/adapter/rest.js","addon-tree-output/@ember-data/canary-features/default-features.js","addon-tree-output/@ember-data/canary-features/index.js","addon-tree-output/@ember-data/debug/index.js","addon-tree-output/@ember-data/debug/setup.js","addon-tree-output/@ember-data/model/-private.js","addon-tree-output/@ember-data/model/index.js","addon-tree-output/@ember-data/record-data/-private.js","addon-tree-output/@ember-data/serializer/-private.js","addon-tree-output/@ember-data/serializer/index.js","addon-tree-output/@ember-data/serializer/json-api.js","addon-tree-output/@ember-data/serializer/json.js","addon-tree-output/@ember-data/serializer/rest.js","addon-tree-output/@ember-data/serializer/transform.js","addon-tree-output/@ember-data/store/-debug/index.js","addon-tree-output/@ember-data/store/-private.js","addon-tree-output/@ember-data/store/index.js","addon-tree-output/@ember-decorators/utils/-private/class-field-descriptor.js","addon-tree-output/@ember-decorators/utils/collapse-proto.js","addon-tree-output/@ember-decorators/utils/decorator.js","addon-tree-output/@ember-intl/decorators/index.js","addon-tree-output/@ember-intl/decorators/intl.js","addon-tree-output/@ember-intl/decorators/t.js","addon-tree-output/@ember/ordered-set/index.js","addon-tree-output/@glimmer/component/-private/base-component-manager.js","addon-tree-output/@glimmer/component/-private/component.js","addon-tree-output/@glimmer/component/-private/ember-component-manager.js","addon-tree-output/@glimmer/component/-private/owner.js","addon-tree-output/@glimmer/component/index.js","addon-tree-output/ember-cli-app-version/initializer-factory.js","addon-tree-output/ember-cli-app-version/utils/regexp.js","addon-tree-output/ember-cli-file-picker/components/file-picker.js","addon-tree-output/ember-cli-file-picker/lib/helpers.js","addon-tree-output/ember-cli-jstree/components/ember-jstree.js","addon-tree-output/ember-cli-jstree/mixins/ember-jstree-actions.js","addon-tree-output/ember-component-inbound-actions/action-proxy.js","addon-tree-output/ember-component-inbound-actions/helpers/send.js","addon-tree-output/ember-component-inbound-actions/inbound-actions.js","addon-tree-output/ember-data/-private.js","addon-tree-output/ember-data/adapter.js","addon-tree-output/ember-data/adapters/errors.js","addon-tree-output/ember-data/adapters/json-api.js","addon-tree-output/ember-data/adapters/rest.js","addon-tree-output/ember-data/attr.js","addon-tree-output/ember-data/index.js","addon-tree-output/ember-data/initialize-store-service.js","addon-tree-output/ember-data/model.js","addon-tree-output/ember-data/relationships.js","addon-tree-output/ember-data/serializer.js","addon-tree-output/ember-data/serializers/embedded-records-mixin.js","addon-tree-output/ember-data/serializers/json-api.js","addon-tree-output/ember-data/serializers/json.js","addon-tree-output/ember-data/serializers/rest.js","addon-tree-output/ember-data/setup-container.js","addon-tree-output/ember-data/store.js","addon-tree-output/ember-data/transform.js","addon-tree-output/ember-data/version.js","addon-tree-output/ember-fetch/ajax.js","addon-tree-output/ember-fetch/errors.js","addon-tree-output/ember-fetch/mixins/adapter-fetch.js","addon-tree-output/ember-fetch/types.js","addon-tree-output/ember-fetch/utils/determine-body-promise.js","addon-tree-output/ember-fetch/utils/mung-options-for-fetch.js","addon-tree-output/ember-fetch/utils/serialize-query-params.js","addon-tree-output/ember-inflector/index.js","addon-tree-output/ember-inflector/lib/ext/string.js","addon-tree-output/ember-inflector/lib/helpers/pluralize.js","addon-tree-output/ember-inflector/lib/helpers/singularize.js","addon-tree-output/ember-inflector/lib/system.js","addon-tree-output/ember-inflector/lib/system/inflections.js","addon-tree-output/ember-inflector/lib/system/inflector.js","addon-tree-output/ember-inflector/lib/system/string.js","addon-tree-output/ember-inflector/lib/utils/make-helper.js","addon-tree-output/ember-intl/-private/empty-object.js","addon-tree-output/ember-intl/-private/formatters/-base.js","addon-tree-output/ember-intl/-private/formatters/format-date.js","addon-tree-output/ember-intl/-private/formatters/format-message.js","addon-tree-output/ember-intl/-private/formatters/format-number.js","addon-tree-output/ember-intl/-private/formatters/format-relative.js","addon-tree-output/ember-intl/-private/formatters/format-time.js","addon-tree-output/ember-intl/-private/formatters/index.js","addon-tree-output/ember-intl/-private/is-array-equal.js","addon-tree-output/ember-intl/-private/normalize-locale.js","addon-tree-output/ember-intl/adapters/default.js","addon-tree-output/ember-intl/helpers/-format-base.js","addon-tree-output/ember-intl/helpers/format-date.js","addon-tree-output/ember-intl/helpers/format-message.js","addon-tree-output/ember-intl/helpers/format-number.js","addon-tree-output/ember-intl/helpers/format-relative.js","addon-tree-output/ember-intl/helpers/format-time.js","addon-tree-output/ember-intl/helpers/t.js","addon-tree-output/ember-intl/hydrate.js","addon-tree-output/ember-intl/index.js","addon-tree-output/ember-intl/macros/index.js","addon-tree-output/ember-intl/macros/intl.js","addon-tree-output/ember-intl/macros/t.js","addon-tree-output/ember-intl/models/translation.js","addon-tree-output/ember-intl/services/intl.js","addon-tree-output/ember-intl/utils/get-dom.js","addon-tree-output/ember-intl/utils/links.js","addon-tree-output/ember-intl/utils/missing-message.js","addon-tree-output/ember-load-initializers/index.js","addon-tree-output/ember-model-validator/initializers/model-locale.js","addon-tree-output/ember-model-validator/messages/ar.js","addon-tree-output/ember-model-validator/messages/en.js","addon-tree-output/ember-model-validator/messages/es.js","addon-tree-output/ember-model-validator/messages/fr.js","addon-tree-output/ember-model-validator/messages/pt-br.js","addon-tree-output/ember-model-validator/mixins/model-validator.js","addon-tree-output/ember-model-validator/mixins/object-validator.js","addon-tree-output/ember-model-validator/postal-codes-regex.js","addon-tree-output/ember-resolver/features.js","addon-tree-output/ember-resolver/index.js","addon-tree-output/ember-resolver/resolver.js","addon-tree-output/ember-resolver/resolvers/classic/container-debug-adapter.js","addon-tree-output/ember-resolver/resolvers/classic/index.js","addon-tree-output/ember-resolver/utils/class-factory.js","addon-tree-output/ember-simple-tree/components/x-tree-branch.js","addon-tree-output/ember-simple-tree/components/x-tree-checkbox.js","addon-tree-output/ember-simple-tree/components/x-tree-children.js","addon-tree-output/ember-simple-tree/components/x-tree-collapsed-icon.js","addon-tree-output/ember-simple-tree/components/x-tree-expanded-icon.js","addon-tree-output/ember-simple-tree/components/x-tree-node.js","addon-tree-output/ember-simple-tree/components/x-tree-toggle.js","addon-tree-output/ember-simple-tree/components/x-tree.js","addon-tree-output/ember-simple-tree/templates/components/x-tree-branch.js","addon-tree-output/ember-simple-tree/templates/components/x-tree-checkbox.js","addon-tree-output/ember-simple-tree/templates/components/x-tree-children.js","addon-tree-output/ember-simple-tree/templates/components/x-tree-collapsed-icon.js","addon-tree-output/ember-simple-tree/templates/components/x-tree-expanded-icon.js","addon-tree-output/ember-simple-tree/templates/components/x-tree-node.js","addon-tree-output/ember-simple-tree/templates/components/x-tree-toggle.js","addon-tree-output/ember-simple-tree/templates/components/x-tree.js","addon-tree-output/ember-simple-tree/utils/tree.js","addon-tree-output/ember-test-waiters/build-waiter.js","addon-tree-output/ember-test-waiters/index.js","addon-tree-output/ember-test-waiters/noop-test-waiter.js","addon-tree-output/ember-test-waiters/test-waiter.js","addon-tree-output/ember-test-waiters/types/index.js","addon-tree-output/ember-test-waiters/wait-for-promise.js","addon-tree-output/ember-test-waiters/waiter-manager.js","addon-tree-output/ember-welcome-page/components/welcome-page.js","addon-tree-output/ember-welcome-page/templates/components/welcome-page.js","vendor/ember-cli/vendor-suffix.js"],"sourcesContent":["window.EmberENV = (function(EmberENV, extra) {\n  for (var key in extra) {\n    EmberENV[key] = extra[key];\n  }\n\n  return EmberENV;\n})(window.EmberENV || {}, {\"FEATURES\":{},\"EXTEND_PROTOTYPES\":{\"Date\":false},\"_APPLICATION_TEMPLATE_WRAPPER\":false,\"_DEFAULT_ASYNC_OBSERVERS\":true,\"_JQUERY_INTEGRATION\":true,\"_TEMPLATE_ONLY_GLIMMER_COMPONENTS\":true});\n\nvar runningTests = false;\n\n\n","var loader, define, requireModule, require, requirejs;\n\n(function (global) {\n  'use strict';\n\n  function dict() {\n    var obj = Object.create(null);\n    obj['__'] = undefined;\n    delete obj['__'];\n    return obj;\n  }\n\n  // Save off the original values of these globals, so we can restore them if someone asks us to\n  var oldGlobals = {\n    loader: loader,\n    define: define,\n    requireModule: requireModule,\n    require: require,\n    requirejs: requirejs\n  };\n\n  requirejs = require = requireModule = function (id) {\n    var pending = [];\n    var mod = findModule(id, '(require)', pending);\n\n    for (var i = pending.length - 1; i >= 0; i--) {\n      pending[i].exports();\n    }\n\n    return mod.module.exports;\n  };\n\n  loader = {\n    noConflict: function (aliases) {\n      var oldName, newName;\n\n      for (oldName in aliases) {\n        if (aliases.hasOwnProperty(oldName)) {\n          if (oldGlobals.hasOwnProperty(oldName)) {\n            newName = aliases[oldName];\n\n            global[newName] = global[oldName];\n            global[oldName] = oldGlobals[oldName];\n          }\n        }\n      }\n    },\n    // Option to enable or disable the generation of default exports\n    makeDefaultExport: true\n  };\n\n  var registry = dict();\n  var seen = dict();\n\n  var uuid = 0;\n\n  function unsupportedModule(length) {\n    throw new Error('an unsupported module was defined, expected `define(id, deps, module)` instead got: `' + length + '` arguments to define`');\n  }\n\n  var defaultDeps = ['require', 'exports', 'module'];\n\n  function Module(id, deps, callback, alias) {\n    this.uuid = uuid++;\n    this.id = id;\n    this.deps = !deps.length && callback.length ? defaultDeps : deps;\n    this.module = { exports: {} };\n    this.callback = callback;\n    this.hasExportsAsDep = false;\n    this.isAlias = alias;\n    this.reified = new Array(deps.length);\n\n    /*\n       Each module normally passes through these states, in order:\n         new       : initial state\n         pending   : this module is scheduled to be executed\n         reifying  : this module's dependencies are being executed\n         reified   : this module's dependencies finished executing successfully\n         errored   : this module's dependencies failed to execute\n         finalized : this module executed successfully\n     */\n    this.state = 'new';\n  }\n\n  Module.prototype.makeDefaultExport = function () {\n    var exports = this.module.exports;\n    if (exports !== null && (typeof exports === 'object' || typeof exports === 'function') && exports['default'] === undefined && Object.isExtensible(exports)) {\n      exports['default'] = exports;\n    }\n  };\n\n  Module.prototype.exports = function () {\n    // if finalized, there is no work to do. If reifying, there is a\n    // circular dependency so we must return our (partial) exports.\n    if (this.state === 'finalized' || this.state === 'reifying') {\n      return this.module.exports;\n    }\n\n\n    if (loader.wrapModules) {\n      this.callback = loader.wrapModules(this.id, this.callback);\n    }\n\n    this.reify();\n\n    var result = this.callback.apply(this, this.reified);\n    this.reified.length = 0;\n    this.state = 'finalized';\n\n    if (!(this.hasExportsAsDep && result === undefined)) {\n      this.module.exports = result;\n    }\n    if (loader.makeDefaultExport) {\n      this.makeDefaultExport();\n    }\n    return this.module.exports;\n  };\n\n  Module.prototype.unsee = function () {\n    this.state = 'new';\n    this.module = { exports: {} };\n  };\n\n  Module.prototype.reify = function () {\n    if (this.state === 'reified') {\n      return;\n    }\n    this.state = 'reifying';\n    try {\n      this.reified = this._reify();\n      this.state = 'reified';\n    } finally {\n      if (this.state === 'reifying') {\n        this.state = 'errored';\n      }\n    }\n  };\n\n  Module.prototype._reify = function () {\n    var reified = this.reified.slice();\n    for (var i = 0; i < reified.length; i++) {\n      var mod = reified[i];\n      reified[i] = mod.exports ? mod.exports : mod.module.exports();\n    }\n    return reified;\n  };\n\n  Module.prototype.findDeps = function (pending) {\n    if (this.state !== 'new') {\n      return;\n    }\n\n    this.state = 'pending';\n\n    var deps = this.deps;\n\n    for (var i = 0; i < deps.length; i++) {\n      var dep = deps[i];\n      var entry = this.reified[i] = { exports: undefined, module: undefined };\n      if (dep === 'exports') {\n        this.hasExportsAsDep = true;\n        entry.exports = this.module.exports;\n      } else if (dep === 'require') {\n        entry.exports = this.makeRequire();\n      } else if (dep === 'module') {\n        entry.exports = this.module;\n      } else {\n        entry.module = findModule(resolve(dep, this.id), this.id, pending);\n      }\n    }\n  };\n\n  Module.prototype.makeRequire = function () {\n    var id = this.id;\n    var r = function (dep) {\n      return require(resolve(dep, id));\n    };\n    r['default'] = r;\n    r.moduleId = id;\n    r.has = function (dep) {\n      return has(resolve(dep, id));\n    };\n    return r;\n  };\n\n  define = function (id, deps, callback) {\n    var module = registry[id];\n\n    // If a module for this id has already been defined and is in any state\n    // other than `new` (meaning it has been or is currently being required),\n    // then we return early to avoid redefinition.\n    if (module && module.state !== 'new') {\n      return;\n    }\n\n    if (arguments.length < 2) {\n      unsupportedModule(arguments.length);\n    }\n\n    if (!Array.isArray(deps)) {\n      callback = deps;\n      deps = [];\n    }\n\n    if (callback instanceof Alias) {\n      registry[id] = new Module(callback.id, deps, callback, true);\n    } else {\n      registry[id] = new Module(id, deps, callback, false);\n    }\n  };\n\n  define.exports = function (name, defaultExport) {\n    var module = registry[name];\n\n    // If a module for this name has already been defined and is in any state\n    // other than `new` (meaning it has been or is currently being required),\n    // then we return early to avoid redefinition.\n    if (module && module.state !== 'new') {\n      return;\n    }\n\n    module = new Module(name, [], noop, null);\n    module.module.exports = defaultExport;\n    module.state = 'finalized';\n    registry[name] = module;\n\n    return module;\n  };\n\n  function noop() {}\n  // we don't support all of AMD\n  // define.amd = {};\n\n  function Alias(id) {\n    this.id = id;\n  }\n\n  define.alias = function (id, target) {\n    if (arguments.length === 2) {\n      return define(target, new Alias(id));\n    }\n\n    return new Alias(id);\n  };\n\n  function missingModule(id, referrer) {\n    throw new Error('Could not find module `' + id + '` imported from `' + referrer + '`');\n  }\n\n  function findModule(id, referrer, pending) {\n    var mod = registry[id] || registry[id + '/index'];\n\n    while (mod && mod.isAlias) {\n      mod = registry[mod.id] || registry[mod.id + '/index'];\n    }\n\n    if (!mod) {\n      missingModule(id, referrer);\n    }\n\n    if (pending && mod.state !== 'pending' && mod.state !== 'finalized') {\n      mod.findDeps(pending);\n      pending.push(mod);\n    }\n    return mod;\n  }\n\n  function resolve(child, id) {\n    if (child.charAt(0) !== '.') {\n      return child;\n    }\n\n\n    var parts = child.split('/');\n    var nameParts = id.split('/');\n    var parentBase = nameParts.slice(0, -1);\n\n    for (var i = 0, l = parts.length; i < l; i++) {\n      var part = parts[i];\n\n      if (part === '..') {\n        if (parentBase.length === 0) {\n          throw new Error('Cannot access parent module of root');\n        }\n        parentBase.pop();\n      } else if (part === '.') {\n        continue;\n      } else {\n        parentBase.push(part);\n      }\n    }\n\n    return parentBase.join('/');\n  }\n\n  function has(id) {\n    return !!(registry[id] || registry[id + '/index']);\n  }\n\n  requirejs.entries = requirejs._eak_seen = registry;\n  requirejs.has = has;\n  requirejs.unsee = function (id) {\n    findModule(id, '(unsee)', false).unsee();\n  };\n\n  requirejs.clear = function () {\n    requirejs.entries = requirejs._eak_seen = registry = dict();\n    seen = dict();\n  };\n\n  // This code primes the JS engine for good performance by warming the\n  // JIT compiler for these functions.\n  define('foo', function () {});\n  define('foo/bar', [], function () {});\n  define('foo/asdf', ['module', 'exports', 'require'], function (module, exports, require) {\n    if (require.has('foo/bar')) {\n      require('foo/bar');\n    }\n  });\n  define('foo/baz', [], define.alias('foo'));\n  define('foo/quz', define.alias('foo'));\n  define.alias('foo', 'foo/qux');\n  define('foo/bar', ['foo', './quz', './baz', './asdf', './bar', '../foo'], function () {});\n  define('foo/main', ['foo/bar'], function () {});\n  define.exports('foo/exports', {});\n\n  require('foo/exports');\n  require('foo/main');\n  require.unsee('foo/bar');\n\n  requirejs.clear();\n\n  if (typeof exports === 'object' && typeof module === 'object' && module.exports) {\n    module.exports = { require: require, define: define };\n  }\n})(this);","/*!\n * jQuery JavaScript Library v3.4.1\n * https://jquery.com/\n *\n * Includes Sizzle.js\n * https://sizzlejs.com/\n *\n * Copyright JS Foundation and other contributors\n * Released under the MIT license\n * https://jquery.org/license\n *\n * Date: 2019-05-01T21:04Z\n */\n( function( global, factory ) {\n\n\t\"use strict\";\n\n\tif ( typeof module === \"object\" && typeof module.exports === \"object\" ) {\n\n\t\t// For CommonJS and CommonJS-like environments where a proper `window`\n\t\t// is present, execute the factory and get jQuery.\n\t\t// For environments that do not have a `window` with a `document`\n\t\t// (such as Node.js), expose a factory as module.exports.\n\t\t// This accentuates the need for the creation of a real `window`.\n\t\t// e.g. var jQuery = require(\"jquery\")(window);\n\t\t// See ticket #14549 for more info.\n\t\tmodule.exports = global.document ?\n\t\t\tfactory( global, true ) :\n\t\t\tfunction( w ) {\n\t\t\t\tif ( !w.document ) {\n\t\t\t\t\tthrow new Error( \"jQuery requires a window with a document\" );\n\t\t\t\t}\n\t\t\t\treturn factory( w );\n\t\t\t};\n\t} else {\n\t\tfactory( global );\n\t}\n\n// Pass this if window is not defined yet\n} )( typeof window !== \"undefined\" ? window : this, function( window, noGlobal ) {\n\n// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1\n// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode\n// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common\n// enough that all such attempts are guarded in a try block.\n\"use strict\";\n\nvar arr = [];\n\nvar document = window.document;\n\nvar getProto = Object.getPrototypeOf;\n\nvar slice = arr.slice;\n\nvar concat = arr.concat;\n\nvar push = arr.push;\n\nvar indexOf = arr.indexOf;\n\nvar class2type = {};\n\nvar toString = class2type.toString;\n\nvar hasOwn = class2type.hasOwnProperty;\n\nvar fnToString = hasOwn.toString;\n\nvar ObjectFunctionString = fnToString.call( Object );\n\nvar support = {};\n\nvar isFunction = function isFunction( obj ) {\n\n      // Support: Chrome <=57, Firefox <=52\n      // In some browsers, typeof returns \"function\" for HTML <object> elements\n      // (i.e., `typeof document.createElement( \"object\" ) === \"function\"`).\n      // We don't want to classify *any* DOM node as a function.\n      return typeof obj === \"function\" && typeof obj.nodeType !== \"number\";\n  };\n\n\nvar isWindow = function isWindow( obj ) {\n\t\treturn obj != null && obj === obj.window;\n\t};\n\n\n\n\n\tvar preservedScriptAttributes = {\n\t\ttype: true,\n\t\tsrc: true,\n\t\tnonce: true,\n\t\tnoModule: true\n\t};\n\n\tfunction DOMEval( code, node, doc ) {\n\t\tdoc = doc || document;\n\n\t\tvar i, val,\n\t\t\tscript = doc.createElement( \"script\" );\n\n\t\tscript.text = code;\n\t\tif ( node ) {\n\t\t\tfor ( i in preservedScriptAttributes ) {\n\n\t\t\t\t// Support: Firefox 64+, Edge 18+\n\t\t\t\t// Some browsers don't support the \"nonce\" property on scripts.\n\t\t\t\t// On the other hand, just using `getAttribute` is not enough as\n\t\t\t\t// the `nonce` attribute is reset to an empty string whenever it\n\t\t\t\t// becomes browsing-context connected.\n\t\t\t\t// See https://github.com/whatwg/html/issues/2369\n\t\t\t\t// See https://html.spec.whatwg.org/#nonce-attributes\n\t\t\t\t// The `node.getAttribute` check was added for the sake of\n\t\t\t\t// `jQuery.globalEval` so that it can fake a nonce-containing node\n\t\t\t\t// via an object.\n\t\t\t\tval = node[ i ] || node.getAttribute && node.getAttribute( i );\n\t\t\t\tif ( val ) {\n\t\t\t\t\tscript.setAttribute( i, val );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdoc.head.appendChild( script ).parentNode.removeChild( script );\n\t}\n\n\nfunction toType( obj ) {\n\tif ( obj == null ) {\n\t\treturn obj + \"\";\n\t}\n\n\t// Support: Android <=2.3 only (functionish RegExp)\n\treturn typeof obj === \"object\" || typeof obj === \"function\" ?\n\t\tclass2type[ toString.call( obj ) ] || \"object\" :\n\t\ttypeof obj;\n}\n/* global Symbol */\n// Defining this global in .eslintrc.json would create a danger of using the global\n// unguarded in another place, it seems safer to define global only for this module\n\n\n\nvar\n\tversion = \"3.4.1\",\n\n\t// Define a local copy of jQuery\n\tjQuery = function( selector, context ) {\n\n\t\t// The jQuery object is actually just the init constructor 'enhanced'\n\t\t// Need init if jQuery is called (just allow error to be thrown if not included)\n\t\treturn new jQuery.fn.init( selector, context );\n\t},\n\n\t// Support: Android <=4.0 only\n\t// Make sure we trim BOM and NBSP\n\trtrim = /^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g;\n\njQuery.fn = jQuery.prototype = {\n\n\t// The current version of jQuery being used\n\tjquery: version,\n\n\tconstructor: jQuery,\n\n\t// The default length of a jQuery object is 0\n\tlength: 0,\n\n\ttoArray: function() {\n\t\treturn slice.call( this );\n\t},\n\n\t// Get the Nth element in the matched element set OR\n\t// Get the whole matched element set as a clean array\n\tget: function( num ) {\n\n\t\t// Return all the elements in a clean array\n\t\tif ( num == null ) {\n\t\t\treturn slice.call( this );\n\t\t}\n\n\t\t// Return just the one element from the set\n\t\treturn num < 0 ? this[ num + this.length ] : this[ num ];\n\t},\n\n\t// Take an array of elements and push it onto the stack\n\t// (returning the new matched element set)\n\tpushStack: function( elems ) {\n\n\t\t// Build a new jQuery matched element set\n\t\tvar ret = jQuery.merge( this.constructor(), elems );\n\n\t\t// Add the old object onto the stack (as a reference)\n\t\tret.prevObject = this;\n\n\t\t// Return the newly-formed element set\n\t\treturn ret;\n\t},\n\n\t// Execute a callback for every element in the matched set.\n\teach: function( callback ) {\n\t\treturn jQuery.each( this, callback );\n\t},\n\n\tmap: function( callback ) {\n\t\treturn this.pushStack( jQuery.map( this, function( elem, i ) {\n\t\t\treturn callback.call( elem, i, elem );\n\t\t} ) );\n\t},\n\n\tslice: function() {\n\t\treturn this.pushStack( slice.apply( this, arguments ) );\n\t},\n\n\tfirst: function() {\n\t\treturn this.eq( 0 );\n\t},\n\n\tlast: function() {\n\t\treturn this.eq( -1 );\n\t},\n\n\teq: function( i ) {\n\t\tvar len = this.length,\n\t\t\tj = +i + ( i < 0 ? len : 0 );\n\t\treturn this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );\n\t},\n\n\tend: function() {\n\t\treturn this.prevObject || this.constructor();\n\t},\n\n\t// For internal use only.\n\t// Behaves like an Array's method, not like a jQuery method.\n\tpush: push,\n\tsort: arr.sort,\n\tsplice: arr.splice\n};\n\njQuery.extend = jQuery.fn.extend = function() {\n\tvar options, name, src, copy, copyIsArray, clone,\n\t\ttarget = arguments[ 0 ] || {},\n\t\ti = 1,\n\t\tlength = arguments.length,\n\t\tdeep = false;\n\n\t// Handle a deep copy situation\n\tif ( typeof target === \"boolean\" ) {\n\t\tdeep = target;\n\n\t\t// Skip the boolean and the target\n\t\ttarget = arguments[ i ] || {};\n\t\ti++;\n\t}\n\n\t// Handle case when target is a string or something (possible in deep copy)\n\tif ( typeof target !== \"object\" && !isFunction( target ) ) {\n\t\ttarget = {};\n\t}\n\n\t// Extend jQuery itself if only one argument is passed\n\tif ( i === length ) {\n\t\ttarget = this;\n\t\ti--;\n\t}\n\n\tfor ( ; i < length; i++ ) {\n\n\t\t// Only deal with non-null/undefined values\n\t\tif ( ( options = arguments[ i ] ) != null ) {\n\n\t\t\t// Extend the base object\n\t\t\tfor ( name in options ) {\n\t\t\t\tcopy = options[ name ];\n\n\t\t\t\t// Prevent Object.prototype pollution\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif ( name === \"__proto__\" || target === copy ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\tif ( deep && copy && ( jQuery.isPlainObject( copy ) ||\n\t\t\t\t\t( copyIsArray = Array.isArray( copy ) ) ) ) {\n\t\t\t\t\tsrc = target[ name ];\n\n\t\t\t\t\t// Ensure proper type for the source value\n\t\t\t\t\tif ( copyIsArray && !Array.isArray( src ) ) {\n\t\t\t\t\t\tclone = [];\n\t\t\t\t\t} else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {\n\t\t\t\t\t\tclone = {};\n\t\t\t\t\t} else {\n\t\t\t\t\t\tclone = src;\n\t\t\t\t\t}\n\t\t\t\t\tcopyIsArray = false;\n\n\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\ttarget[ name ] = jQuery.extend( deep, clone, copy );\n\n\t\t\t\t// Don't bring in undefined values\n\t\t\t\t} else if ( copy !== undefined ) {\n\t\t\t\t\ttarget[ name ] = copy;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n\njQuery.extend( {\n\n\t// Unique for each copy of jQuery on the page\n\texpando: \"jQuery\" + ( version + Math.random() ).replace( /\\D/g, \"\" ),\n\n\t// Assume jQuery is ready without the ready module\n\tisReady: true,\n\n\terror: function( msg ) {\n\t\tthrow new Error( msg );\n\t},\n\n\tnoop: function() {},\n\n\tisPlainObject: function( obj ) {\n\t\tvar proto, Ctor;\n\n\t\t// Detect obvious negatives\n\t\t// Use toString instead of jQuery.type to catch host objects\n\t\tif ( !obj || toString.call( obj ) !== \"[object Object]\" ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tproto = getProto( obj );\n\n\t\t// Objects with no prototype (e.g., `Object.create( null )`) are plain\n\t\tif ( !proto ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Objects with prototype are plain iff they were constructed by a global Object function\n\t\tCtor = hasOwn.call( proto, \"constructor\" ) && proto.constructor;\n\t\treturn typeof Ctor === \"function\" && fnToString.call( Ctor ) === ObjectFunctionString;\n\t},\n\n\tisEmptyObject: function( obj ) {\n\t\tvar name;\n\n\t\tfor ( name in obj ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t},\n\n\t// Evaluates a script in a global context\n\tglobalEval: function( code, options ) {\n\t\tDOMEval( code, { nonce: options && options.nonce } );\n\t},\n\n\teach: function( obj, callback ) {\n\t\tvar length, i = 0;\n\n\t\tif ( isArrayLike( obj ) ) {\n\t\t\tlength = obj.length;\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tif ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor ( i in obj ) {\n\t\t\t\tif ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn obj;\n\t},\n\n\t// Support: Android <=4.0 only\n\ttrim: function( text ) {\n\t\treturn text == null ?\n\t\t\t\"\" :\n\t\t\t( text + \"\" ).replace( rtrim, \"\" );\n\t},\n\n\t// results is for internal usage only\n\tmakeArray: function( arr, results ) {\n\t\tvar ret = results || [];\n\n\t\tif ( arr != null ) {\n\t\t\tif ( isArrayLike( Object( arr ) ) ) {\n\t\t\t\tjQuery.merge( ret,\n\t\t\t\t\ttypeof arr === \"string\" ?\n\t\t\t\t\t[ arr ] : arr\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tpush.call( ret, arr );\n\t\t\t}\n\t\t}\n\n\t\treturn ret;\n\t},\n\n\tinArray: function( elem, arr, i ) {\n\t\treturn arr == null ? -1 : indexOf.call( arr, elem, i );\n\t},\n\n\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t// push.apply(_, arraylike) throws on ancient WebKit\n\tmerge: function( first, second ) {\n\t\tvar len = +second.length,\n\t\t\tj = 0,\n\t\t\ti = first.length;\n\n\t\tfor ( ; j < len; j++ ) {\n\t\t\tfirst[ i++ ] = second[ j ];\n\t\t}\n\n\t\tfirst.length = i;\n\n\t\treturn first;\n\t},\n\n\tgrep: function( elems, callback, invert ) {\n\t\tvar callbackInverse,\n\t\t\tmatches = [],\n\t\t\ti = 0,\n\t\t\tlength = elems.length,\n\t\t\tcallbackExpect = !invert;\n\n\t\t// Go through the array, only saving the items\n\t\t// that pass the validator function\n\t\tfor ( ; i < length; i++ ) {\n\t\t\tcallbackInverse = !callback( elems[ i ], i );\n\t\t\tif ( callbackInverse !== callbackExpect ) {\n\t\t\t\tmatches.push( elems[ i ] );\n\t\t\t}\n\t\t}\n\n\t\treturn matches;\n\t},\n\n\t// arg is for internal usage only\n\tmap: function( elems, callback, arg ) {\n\t\tvar length, value,\n\t\t\ti = 0,\n\t\t\tret = [];\n\n\t\t// Go through the array, translating each of the items to their new values\n\t\tif ( isArrayLike( elems ) ) {\n\t\t\tlength = elems.length;\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tvalue = callback( elems[ i ], i, arg );\n\n\t\t\t\tif ( value != null ) {\n\t\t\t\t\tret.push( value );\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Go through every key on the object,\n\t\t} else {\n\t\t\tfor ( i in elems ) {\n\t\t\t\tvalue = callback( elems[ i ], i, arg );\n\n\t\t\t\tif ( value != null ) {\n\t\t\t\t\tret.push( value );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Flatten any nested arrays\n\t\treturn concat.apply( [], ret );\n\t},\n\n\t// A global GUID counter for objects\n\tguid: 1,\n\n\t// jQuery.support is not used in Core but other projects attach their\n\t// properties to it so it needs to exist.\n\tsupport: support\n} );\n\nif ( typeof Symbol === \"function\" ) {\n\tjQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];\n}\n\n// Populate the class2type map\njQuery.each( \"Boolean Number String Function Array Date RegExp Object Error Symbol\".split( \" \" ),\nfunction( i, name ) {\n\tclass2type[ \"[object \" + name + \"]\" ] = name.toLowerCase();\n} );\n\nfunction isArrayLike( obj ) {\n\n\t// Support: real iOS 8.2 only (not reproducible in simulator)\n\t// `in` check used to prevent JIT error (gh-2145)\n\t// hasOwn isn't used here due to false negatives\n\t// regarding Nodelist length in IE\n\tvar length = !!obj && \"length\" in obj && obj.length,\n\t\ttype = toType( obj );\n\n\tif ( isFunction( obj ) || isWindow( obj ) ) {\n\t\treturn false;\n\t}\n\n\treturn type === \"array\" || length === 0 ||\n\t\ttypeof length === \"number\" && length > 0 && ( length - 1 ) in obj;\n}\nvar Sizzle =\n/*!\n * Sizzle CSS Selector Engine v2.3.4\n * https://sizzlejs.com/\n *\n * Copyright JS Foundation and other contributors\n * Released under the MIT license\n * https://js.foundation/\n *\n * Date: 2019-04-08\n */\n(function( window ) {\n\nvar i,\n\tsupport,\n\tExpr,\n\tgetText,\n\tisXML,\n\ttokenize,\n\tcompile,\n\tselect,\n\toutermostContext,\n\tsortInput,\n\thasDuplicate,\n\n\t// Local document vars\n\tsetDocument,\n\tdocument,\n\tdocElem,\n\tdocumentIsHTML,\n\trbuggyQSA,\n\trbuggyMatches,\n\tmatches,\n\tcontains,\n\n\t// Instance-specific data\n\texpando = \"sizzle\" + 1 * new Date(),\n\tpreferredDoc = window.document,\n\tdirruns = 0,\n\tdone = 0,\n\tclassCache = createCache(),\n\ttokenCache = createCache(),\n\tcompilerCache = createCache(),\n\tnonnativeSelectorCache = createCache(),\n\tsortOrder = function( a, b ) {\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t}\n\t\treturn 0;\n\t},\n\n\t// Instance methods\n\thasOwn = ({}).hasOwnProperty,\n\tarr = [],\n\tpop = arr.pop,\n\tpush_native = arr.push,\n\tpush = arr.push,\n\tslice = arr.slice,\n\t// Use a stripped-down indexOf as it's faster than native\n\t// https://jsperf.com/thor-indexof-vs-for/5\n\tindexOf = function( list, elem ) {\n\t\tvar i = 0,\n\t\t\tlen = list.length;\n\t\tfor ( ; i < len; i++ ) {\n\t\t\tif ( list[i] === elem ) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t},\n\n\tbooleans = \"checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped\",\n\n\t// Regular expressions\n\n\t// http://www.w3.org/TR/css3-selectors/#whitespace\n\twhitespace = \"[\\\\x20\\\\t\\\\r\\\\n\\\\f]\",\n\n\t// http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier\n\tidentifier = \"(?:\\\\\\\\.|[\\\\w-]|[^\\0-\\\\xa0])+\",\n\n\t// Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors\n\tattributes = \"\\\\[\" + whitespace + \"*(\" + identifier + \")(?:\" + whitespace +\n\t\t// Operator (capture 2)\n\t\t\"*([*^$|!~]?=)\" + whitespace +\n\t\t// \"Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]\"\n\t\t\"*(?:'((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\"|(\" + identifier + \"))|)\" + whitespace +\n\t\t\"*\\\\]\",\n\n\tpseudos = \":(\" + identifier + \")(?:\\\\((\" +\n\t\t// To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:\n\t\t// 1. quoted (capture 3; capture 4 or capture 5)\n\t\t\"('((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\")|\" +\n\t\t// 2. simple (capture 6)\n\t\t\"((?:\\\\\\\\.|[^\\\\\\\\()[\\\\]]|\" + attributes + \")*)|\" +\n\t\t// 3. anything else (capture 2)\n\t\t\".*\" +\n\t\t\")\\\\)|)\",\n\n\t// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter\n\trwhitespace = new RegExp( whitespace + \"+\", \"g\" ),\n\trtrim = new RegExp( \"^\" + whitespace + \"+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)\" + whitespace + \"+$\", \"g\" ),\n\n\trcomma = new RegExp( \"^\" + whitespace + \"*,\" + whitespace + \"*\" ),\n\trcombinators = new RegExp( \"^\" + whitespace + \"*([>+~]|\" + whitespace + \")\" + whitespace + \"*\" ),\n\trdescend = new RegExp( whitespace + \"|>\" ),\n\n\trpseudo = new RegExp( pseudos ),\n\tridentifier = new RegExp( \"^\" + identifier + \"$\" ),\n\n\tmatchExpr = {\n\t\t\"ID\": new RegExp( \"^#(\" + identifier + \")\" ),\n\t\t\"CLASS\": new RegExp( \"^\\\\.(\" + identifier + \")\" ),\n\t\t\"TAG\": new RegExp( \"^(\" + identifier + \"|[*])\" ),\n\t\t\"ATTR\": new RegExp( \"^\" + attributes ),\n\t\t\"PSEUDO\": new RegExp( \"^\" + pseudos ),\n\t\t\"CHILD\": new RegExp( \"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\\\(\" + whitespace +\n\t\t\t\"*(even|odd|(([+-]|)(\\\\d*)n|)\" + whitespace + \"*(?:([+-]|)\" + whitespace +\n\t\t\t\"*(\\\\d+)|))\" + whitespace + \"*\\\\)|)\", \"i\" ),\n\t\t\"bool\": new RegExp( \"^(?:\" + booleans + \")$\", \"i\" ),\n\t\t// For use in libraries implementing .is()\n\t\t// We use this for POS matching in `select`\n\t\t\"needsContext\": new RegExp( \"^\" + whitespace + \"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\\\(\" +\n\t\t\twhitespace + \"*((?:-\\\\d)?\\\\d*)\" + whitespace + \"*\\\\)|)(?=[^-]|$)\", \"i\" )\n\t},\n\n\trhtml = /HTML$/i,\n\trinputs = /^(?:input|select|textarea|button)$/i,\n\trheader = /^h\\d$/i,\n\n\trnative = /^[^{]+\\{\\s*\\[native \\w/,\n\n\t// Easily-parseable/retrievable ID or TAG or CLASS selectors\n\trquickExpr = /^(?:#([\\w-]+)|(\\w+)|\\.([\\w-]+))$/,\n\n\trsibling = /[+~]/,\n\n\t// CSS escapes\n\t// http://www.w3.org/TR/CSS21/syndata.html#escaped-characters\n\trunescape = new RegExp( \"\\\\\\\\([\\\\da-f]{1,6}\" + whitespace + \"?|(\" + whitespace + \")|.)\", \"ig\" ),\n\tfunescape = function( _, escaped, escapedWhitespace ) {\n\t\tvar high = \"0x\" + escaped - 0x10000;\n\t\t// NaN means non-codepoint\n\t\t// Support: Firefox<24\n\t\t// Workaround erroneous numeric interpretation of +\"0x\"\n\t\treturn high !== high || escapedWhitespace ?\n\t\t\tescaped :\n\t\t\thigh < 0 ?\n\t\t\t\t// BMP codepoint\n\t\t\t\tString.fromCharCode( high + 0x10000 ) :\n\t\t\t\t// Supplemental Plane codepoint (surrogate pair)\n\t\t\t\tString.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\n\t},\n\n\t// CSS string/identifier serialization\n\t// https://drafts.csswg.org/cssom/#common-serializing-idioms\n\trcssescape = /([\\0-\\x1f\\x7f]|^-?\\d)|^-$|[^\\0-\\x1f\\x7f-\\uFFFF\\w-]/g,\n\tfcssescape = function( ch, asCodePoint ) {\n\t\tif ( asCodePoint ) {\n\n\t\t\t// U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER\n\t\t\tif ( ch === \"\\0\" ) {\n\t\t\t\treturn \"\\uFFFD\";\n\t\t\t}\n\n\t\t\t// Control characters and (dependent upon position) numbers get escaped as code points\n\t\t\treturn ch.slice( 0, -1 ) + \"\\\\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + \" \";\n\t\t}\n\n\t\t// Other potentially-special ASCII characters get backslash-escaped\n\t\treturn \"\\\\\" + ch;\n\t},\n\n\t// Used for iframes\n\t// See setDocument()\n\t// Removing the function wrapper causes a \"Permission Denied\"\n\t// error in IE\n\tunloadHandler = function() {\n\t\tsetDocument();\n\t},\n\n\tinDisabledFieldset = addCombinator(\n\t\tfunction( elem ) {\n\t\t\treturn elem.disabled === true && elem.nodeName.toLowerCase() === \"fieldset\";\n\t\t},\n\t\t{ dir: \"parentNode\", next: \"legend\" }\n\t);\n\n// Optimize for push.apply( _, NodeList )\ntry {\n\tpush.apply(\n\t\t(arr = slice.call( preferredDoc.childNodes )),\n\t\tpreferredDoc.childNodes\n\t);\n\t// Support: Android<4.0\n\t// Detect silently failing push.apply\n\tarr[ preferredDoc.childNodes.length ].nodeType;\n} catch ( e ) {\n\tpush = { apply: arr.length ?\n\n\t\t// Leverage slice if possible\n\t\tfunction( target, els ) {\n\t\t\tpush_native.apply( target, slice.call(els) );\n\t\t} :\n\n\t\t// Support: IE<9\n\t\t// Otherwise append directly\n\t\tfunction( target, els ) {\n\t\t\tvar j = target.length,\n\t\t\t\ti = 0;\n\t\t\t// Can't trust NodeList.length\n\t\t\twhile ( (target[j++] = els[i++]) ) {}\n\t\t\ttarget.length = j - 1;\n\t\t}\n\t};\n}\n\nfunction Sizzle( selector, context, results, seed ) {\n\tvar m, i, elem, nid, match, groups, newSelector,\n\t\tnewContext = context && context.ownerDocument,\n\n\t\t// nodeType defaults to 9, since context defaults to document\n\t\tnodeType = context ? context.nodeType : 9;\n\n\tresults = results || [];\n\n\t// Return early from calls with invalid selector or context\n\tif ( typeof selector !== \"string\" || !selector ||\n\t\tnodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {\n\n\t\treturn results;\n\t}\n\n\t// Try to shortcut find operations (as opposed to filters) in HTML documents\n\tif ( !seed ) {\n\n\t\tif ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {\n\t\t\tsetDocument( context );\n\t\t}\n\t\tcontext = context || document;\n\n\t\tif ( documentIsHTML ) {\n\n\t\t\t// If the selector is sufficiently simple, try using a \"get*By*\" DOM method\n\t\t\t// (excepting DocumentFragment context, where the methods don't exist)\n\t\t\tif ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {\n\n\t\t\t\t// ID selector\n\t\t\t\tif ( (m = match[1]) ) {\n\n\t\t\t\t\t// Document context\n\t\t\t\t\tif ( nodeType === 9 ) {\n\t\t\t\t\t\tif ( (elem = context.getElementById( m )) ) {\n\n\t\t\t\t\t\t\t// Support: IE, Opera, Webkit\n\t\t\t\t\t\t\t// TODO: identify versions\n\t\t\t\t\t\t\t// getElementById can match elements by name instead of ID\n\t\t\t\t\t\t\tif ( elem.id === m ) {\n\t\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t// Element context\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// Support: IE, Opera, Webkit\n\t\t\t\t\t\t// TODO: identify versions\n\t\t\t\t\t\t// getElementById can match elements by name instead of ID\n\t\t\t\t\t\tif ( newContext && (elem = newContext.getElementById( m )) &&\n\t\t\t\t\t\t\tcontains( context, elem ) &&\n\t\t\t\t\t\t\telem.id === m ) {\n\n\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t// Type selector\n\t\t\t\t} else if ( match[2] ) {\n\t\t\t\t\tpush.apply( results, context.getElementsByTagName( selector ) );\n\t\t\t\t\treturn results;\n\n\t\t\t\t// Class selector\n\t\t\t\t} else if ( (m = match[3]) && support.getElementsByClassName &&\n\t\t\t\t\tcontext.getElementsByClassName ) {\n\n\t\t\t\t\tpush.apply( results, context.getElementsByClassName( m ) );\n\t\t\t\t\treturn results;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Take advantage of querySelectorAll\n\t\t\tif ( support.qsa &&\n\t\t\t\t!nonnativeSelectorCache[ selector + \" \" ] &&\n\t\t\t\t(!rbuggyQSA || !rbuggyQSA.test( selector )) &&\n\n\t\t\t\t// Support: IE 8 only\n\t\t\t\t// Exclude object elements\n\t\t\t\t(nodeType !== 1 || context.nodeName.toLowerCase() !== \"object\") ) {\n\n\t\t\t\tnewSelector = selector;\n\t\t\t\tnewContext = context;\n\n\t\t\t\t// qSA considers elements outside a scoping root when evaluating child or\n\t\t\t\t// descendant combinators, which is not what we want.\n\t\t\t\t// In such cases, we work around the behavior by prefixing every selector in the\n\t\t\t\t// list with an ID selector referencing the scope context.\n\t\t\t\t// Thanks to Andrew Dupont for this technique.\n\t\t\t\tif ( nodeType === 1 && rdescend.test( selector ) ) {\n\n\t\t\t\t\t// Capture the context ID, setting it first if necessary\n\t\t\t\t\tif ( (nid = context.getAttribute( \"id\" )) ) {\n\t\t\t\t\t\tnid = nid.replace( rcssescape, fcssescape );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontext.setAttribute( \"id\", (nid = expando) );\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prefix every selector in the list\n\t\t\t\t\tgroups = tokenize( selector );\n\t\t\t\t\ti = groups.length;\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tgroups[i] = \"#\" + nid + \" \" + toSelector( groups[i] );\n\t\t\t\t\t}\n\t\t\t\t\tnewSelector = groups.join( \",\" );\n\n\t\t\t\t\t// Expand context for sibling selectors\n\t\t\t\t\tnewContext = rsibling.test( selector ) && testContext( context.parentNode ) ||\n\t\t\t\t\t\tcontext;\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tpush.apply( results,\n\t\t\t\t\t\tnewContext.querySelectorAll( newSelector )\n\t\t\t\t\t);\n\t\t\t\t\treturn results;\n\t\t\t\t} catch ( qsaError ) {\n\t\t\t\t\tnonnativeSelectorCache( selector, true );\n\t\t\t\t} finally {\n\t\t\t\t\tif ( nid === expando ) {\n\t\t\t\t\t\tcontext.removeAttribute( \"id\" );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// All others\n\treturn select( selector.replace( rtrim, \"$1\" ), context, results, seed );\n}\n\n/**\n * Create key-value caches of limited size\n * @returns {function(string, object)} Returns the Object data after storing it on itself with\n *\tproperty name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)\n *\tdeleting the oldest entry\n */\nfunction createCache() {\n\tvar keys = [];\n\n\tfunction cache( key, value ) {\n\t\t// Use (key + \" \") to avoid collision with native prototype properties (see Issue #157)\n\t\tif ( keys.push( key + \" \" ) > Expr.cacheLength ) {\n\t\t\t// Only keep the most recent entries\n\t\t\tdelete cache[ keys.shift() ];\n\t\t}\n\t\treturn (cache[ key + \" \" ] = value);\n\t}\n\treturn cache;\n}\n\n/**\n * Mark a function for special use by Sizzle\n * @param {Function} fn The function to mark\n */\nfunction markFunction( fn ) {\n\tfn[ expando ] = true;\n\treturn fn;\n}\n\n/**\n * Support testing using an element\n * @param {Function} fn Passed the created element and returns a boolean result\n */\nfunction assert( fn ) {\n\tvar el = document.createElement(\"fieldset\");\n\n\ttry {\n\t\treturn !!fn( el );\n\t} catch (e) {\n\t\treturn false;\n\t} finally {\n\t\t// Remove from its parent by default\n\t\tif ( el.parentNode ) {\n\t\t\tel.parentNode.removeChild( el );\n\t\t}\n\t\t// release memory in IE\n\t\tel = null;\n\t}\n}\n\n/**\n * Adds the same handler for all of the specified attrs\n * @param {String} attrs Pipe-separated list of attributes\n * @param {Function} handler The method that will be applied\n */\nfunction addHandle( attrs, handler ) {\n\tvar arr = attrs.split(\"|\"),\n\t\ti = arr.length;\n\n\twhile ( i-- ) {\n\t\tExpr.attrHandle[ arr[i] ] = handler;\n\t}\n}\n\n/**\n * Checks document order of two siblings\n * @param {Element} a\n * @param {Element} b\n * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b\n */\nfunction siblingCheck( a, b ) {\n\tvar cur = b && a,\n\t\tdiff = cur && a.nodeType === 1 && b.nodeType === 1 &&\n\t\t\ta.sourceIndex - b.sourceIndex;\n\n\t// Use IE sourceIndex if available on both nodes\n\tif ( diff ) {\n\t\treturn diff;\n\t}\n\n\t// Check if b follows a\n\tif ( cur ) {\n\t\twhile ( (cur = cur.nextSibling) ) {\n\t\t\tif ( cur === b ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn a ? 1 : -1;\n}\n\n/**\n * Returns a function to use in pseudos for input types\n * @param {String} type\n */\nfunction createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for buttons\n * @param {String} type\n */\nfunction createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn (name === \"input\" || name === \"button\") && elem.type === type;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for :enabled/:disabled\n * @param {Boolean} disabled true for :disabled; false for :enabled\n */\nfunction createDisabledPseudo( disabled ) {\n\n\t// Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable\n\treturn function( elem ) {\n\n\t\t// Only certain elements can match :enabled or :disabled\n\t\t// https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled\n\t\t// https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled\n\t\tif ( \"form\" in elem ) {\n\n\t\t\t// Check for inherited disabledness on relevant non-disabled elements:\n\t\t\t// * listed form-associated elements in a disabled fieldset\n\t\t\t//   https://html.spec.whatwg.org/multipage/forms.html#category-listed\n\t\t\t//   https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled\n\t\t\t// * option elements in a disabled optgroup\n\t\t\t//   https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled\n\t\t\t// All such elements have a \"form\" property.\n\t\t\tif ( elem.parentNode && elem.disabled === false ) {\n\n\t\t\t\t// Option elements defer to a parent optgroup if present\n\t\t\t\tif ( \"label\" in elem ) {\n\t\t\t\t\tif ( \"label\" in elem.parentNode ) {\n\t\t\t\t\t\treturn elem.parentNode.disabled === disabled;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn elem.disabled === disabled;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Support: IE 6 - 11\n\t\t\t\t// Use the isDisabled shortcut property to check for disabled fieldset ancestors\n\t\t\t\treturn elem.isDisabled === disabled ||\n\n\t\t\t\t\t// Where there is no isDisabled, check manually\n\t\t\t\t\t/* jshint -W018 */\n\t\t\t\t\telem.isDisabled !== !disabled &&\n\t\t\t\t\t\tinDisabledFieldset( elem ) === disabled;\n\t\t\t}\n\n\t\t\treturn elem.disabled === disabled;\n\n\t\t// Try to winnow out elements that can't be disabled before trusting the disabled property.\n\t\t// Some victims get caught in our net (label, legend, menu, track), but it shouldn't\n\t\t// even exist on them, let alone have a boolean value.\n\t\t} else if ( \"label\" in elem ) {\n\t\t\treturn elem.disabled === disabled;\n\t\t}\n\n\t\t// Remaining elements are neither :enabled nor :disabled\n\t\treturn false;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for positionals\n * @param {Function} fn\n */\nfunction createPositionalPseudo( fn ) {\n\treturn markFunction(function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction(function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ (j = matchIndexes[i]) ] ) {\n\t\t\t\t\tseed[j] = !(matches[j] = seed[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Checks a node for validity as a Sizzle context\n * @param {Element|Object=} context\n * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value\n */\nfunction testContext( context ) {\n\treturn context && typeof context.getElementsByTagName !== \"undefined\" && context;\n}\n\n// Expose support vars for convenience\nsupport = Sizzle.support = {};\n\n/**\n * Detects XML nodes\n * @param {Element|Object} elem An element or a document\n * @returns {Boolean} True iff elem is a non-HTML XML node\n */\nisXML = Sizzle.isXML = function( elem ) {\n\tvar namespace = elem.namespaceURI,\n\t\tdocElem = (elem.ownerDocument || elem).documentElement;\n\n\t// Support: IE <=8\n\t// Assume HTML when documentElement doesn't yet exist, such as inside loading iframes\n\t// https://bugs.jquery.com/ticket/4833\n\treturn !rhtml.test( namespace || docElem && docElem.nodeName || \"HTML\" );\n};\n\n/**\n * Sets document-related variables once based on the current document\n * @param {Element|Object} [doc] An element or document object to use to set the document\n * @returns {Object} Returns the current document\n */\nsetDocument = Sizzle.setDocument = function( node ) {\n\tvar hasCompare, subWindow,\n\t\tdoc = node ? node.ownerDocument || node : preferredDoc;\n\n\t// Return early if doc is invalid or already selected\n\tif ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {\n\t\treturn document;\n\t}\n\n\t// Update global variables\n\tdocument = doc;\n\tdocElem = document.documentElement;\n\tdocumentIsHTML = !isXML( document );\n\n\t// Support: IE 9-11, Edge\n\t// Accessing iframe documents after unload throws \"permission denied\" errors (jQuery #13936)\n\tif ( preferredDoc !== document &&\n\t\t(subWindow = document.defaultView) && subWindow.top !== subWindow ) {\n\n\t\t// Support: IE 11, Edge\n\t\tif ( subWindow.addEventListener ) {\n\t\t\tsubWindow.addEventListener( \"unload\", unloadHandler, false );\n\n\t\t// Support: IE 9 - 10 only\n\t\t} else if ( subWindow.attachEvent ) {\n\t\t\tsubWindow.attachEvent( \"onunload\", unloadHandler );\n\t\t}\n\t}\n\n\t/* Attributes\n\t---------------------------------------------------------------------- */\n\n\t// Support: IE<8\n\t// Verify that getAttribute really returns attributes and not properties\n\t// (excepting IE8 booleans)\n\tsupport.attributes = assert(function( el ) {\n\t\tel.className = \"i\";\n\t\treturn !el.getAttribute(\"className\");\n\t});\n\n\t/* getElement(s)By*\n\t---------------------------------------------------------------------- */\n\n\t// Check if getElementsByTagName(\"*\") returns only elements\n\tsupport.getElementsByTagName = assert(function( el ) {\n\t\tel.appendChild( document.createComment(\"\") );\n\t\treturn !el.getElementsByTagName(\"*\").length;\n\t});\n\n\t// Support: IE<9\n\tsupport.getElementsByClassName = rnative.test( document.getElementsByClassName );\n\n\t// Support: IE<10\n\t// Check if getElementById returns elements by name\n\t// The broken getElementById methods don't pick up programmatically-set names,\n\t// so use a roundabout getElementsByName test\n\tsupport.getById = assert(function( el ) {\n\t\tdocElem.appendChild( el ).id = expando;\n\t\treturn !document.getElementsByName || !document.getElementsByName( expando ).length;\n\t});\n\n\t// ID filter and find\n\tif ( support.getById ) {\n\t\tExpr.filter[\"ID\"] = function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\treturn elem.getAttribute(\"id\") === attrId;\n\t\t\t};\n\t\t};\n\t\tExpr.find[\"ID\"] = function( id, context ) {\n\t\t\tif ( typeof context.getElementById !== \"undefined\" && documentIsHTML ) {\n\t\t\t\tvar elem = context.getElementById( id );\n\t\t\t\treturn elem ? [ elem ] : [];\n\t\t\t}\n\t\t};\n\t} else {\n\t\tExpr.filter[\"ID\"] =  function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\tvar node = typeof elem.getAttributeNode !== \"undefined\" &&\n\t\t\t\t\telem.getAttributeNode(\"id\");\n\t\t\t\treturn node && node.value === attrId;\n\t\t\t};\n\t\t};\n\n\t\t// Support: IE 6 - 7 only\n\t\t// getElementById is not reliable as a find shortcut\n\t\tExpr.find[\"ID\"] = function( id, context ) {\n\t\t\tif ( typeof context.getElementById !== \"undefined\" && documentIsHTML ) {\n\t\t\t\tvar node, i, elems,\n\t\t\t\t\telem = context.getElementById( id );\n\n\t\t\t\tif ( elem ) {\n\n\t\t\t\t\t// Verify the id attribute\n\t\t\t\t\tnode = elem.getAttributeNode(\"id\");\n\t\t\t\t\tif ( node && node.value === id ) {\n\t\t\t\t\t\treturn [ elem ];\n\t\t\t\t\t}\n\n\t\t\t\t\t// Fall back on getElementsByName\n\t\t\t\t\telems = context.getElementsByName( id );\n\t\t\t\t\ti = 0;\n\t\t\t\t\twhile ( (elem = elems[i++]) ) {\n\t\t\t\t\t\tnode = elem.getAttributeNode(\"id\");\n\t\t\t\t\t\tif ( node && node.value === id ) {\n\t\t\t\t\t\t\treturn [ elem ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn [];\n\t\t\t}\n\t\t};\n\t}\n\n\t// Tag\n\tExpr.find[\"TAG\"] = support.getElementsByTagName ?\n\t\tfunction( tag, context ) {\n\t\t\tif ( typeof context.getElementsByTagName !== \"undefined\" ) {\n\t\t\t\treturn context.getElementsByTagName( tag );\n\n\t\t\t// DocumentFragment nodes don't have gEBTN\n\t\t\t} else if ( support.qsa ) {\n\t\t\t\treturn context.querySelectorAll( tag );\n\t\t\t}\n\t\t} :\n\n\t\tfunction( tag, context ) {\n\t\t\tvar elem,\n\t\t\t\ttmp = [],\n\t\t\t\ti = 0,\n\t\t\t\t// By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too\n\t\t\t\tresults = context.getElementsByTagName( tag );\n\n\t\t\t// Filter out possible comments\n\t\t\tif ( tag === \"*\" ) {\n\t\t\t\twhile ( (elem = results[i++]) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\t\t\ttmp.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn tmp;\n\t\t\t}\n\t\t\treturn results;\n\t\t};\n\n\t// Class\n\tExpr.find[\"CLASS\"] = support.getElementsByClassName && function( className, context ) {\n\t\tif ( typeof context.getElementsByClassName !== \"undefined\" && documentIsHTML ) {\n\t\t\treturn context.getElementsByClassName( className );\n\t\t}\n\t};\n\n\t/* QSA/matchesSelector\n\t---------------------------------------------------------------------- */\n\n\t// QSA and matchesSelector support\n\n\t// matchesSelector(:active) reports false when true (IE9/Opera 11.5)\n\trbuggyMatches = [];\n\n\t// qSa(:focus) reports false when true (Chrome 21)\n\t// We allow this because of a bug in IE8/9 that throws an error\n\t// whenever `document.activeElement` is accessed on an iframe\n\t// So, we allow :focus to pass through QSA all the time to avoid the IE error\n\t// See https://bugs.jquery.com/ticket/13378\n\trbuggyQSA = [];\n\n\tif ( (support.qsa = rnative.test( document.querySelectorAll )) ) {\n\t\t// Build QSA regex\n\t\t// Regex strategy adopted from Diego Perini\n\t\tassert(function( el ) {\n\t\t\t// Select is set to empty string on purpose\n\t\t\t// This is to test IE's treatment of not explicitly\n\t\t\t// setting a boolean content attribute,\n\t\t\t// since its presence should be enough\n\t\t\t// https://bugs.jquery.com/ticket/12359\n\t\t\tdocElem.appendChild( el ).innerHTML = \"<a id='\" + expando + \"'></a>\" +\n\t\t\t\t\"<select id='\" + expando + \"-\\r\\\\' msallowcapture=''>\" +\n\t\t\t\t\"<option selected=''></option></select>\";\n\n\t\t\t// Support: IE8, Opera 11-12.16\n\t\t\t// Nothing should be selected when empty strings follow ^= or $= or *=\n\t\t\t// The test attribute must be unknown in Opera but \"safe\" for WinRT\n\t\t\t// https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section\n\t\t\tif ( el.querySelectorAll(\"[msallowcapture^='']\").length ) {\n\t\t\t\trbuggyQSA.push( \"[*^$]=\" + whitespace + \"*(?:''|\\\"\\\")\" );\n\t\t\t}\n\n\t\t\t// Support: IE8\n\t\t\t// Boolean attributes and \"value\" are not treated correctly\n\t\t\tif ( !el.querySelectorAll(\"[selected]\").length ) {\n\t\t\t\trbuggyQSA.push( \"\\\\[\" + whitespace + \"*(?:value|\" + booleans + \")\" );\n\t\t\t}\n\n\t\t\t// Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+\n\t\t\tif ( !el.querySelectorAll( \"[id~=\" + expando + \"-]\" ).length ) {\n\t\t\t\trbuggyQSA.push(\"~=\");\n\t\t\t}\n\n\t\t\t// Webkit/Opera - :checked should return selected option elements\n\t\t\t// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n\t\t\t// IE8 throws error here and will not see later tests\n\t\t\tif ( !el.querySelectorAll(\":checked\").length ) {\n\t\t\t\trbuggyQSA.push(\":checked\");\n\t\t\t}\n\n\t\t\t// Support: Safari 8+, iOS 8+\n\t\t\t// https://bugs.webkit.org/show_bug.cgi?id=136851\n\t\t\t// In-page `selector#id sibling-combinator selector` fails\n\t\t\tif ( !el.querySelectorAll( \"a#\" + expando + \"+*\" ).length ) {\n\t\t\t\trbuggyQSA.push(\".#.+[+~]\");\n\t\t\t}\n\t\t});\n\n\t\tassert(function( el ) {\n\t\t\tel.innerHTML = \"<a href='' disabled='disabled'></a>\" +\n\t\t\t\t\"<select disabled='disabled'><option/></select>\";\n\n\t\t\t// Support: Windows 8 Native Apps\n\t\t\t// The type and name attributes are restricted during .innerHTML assignment\n\t\t\tvar input = document.createElement(\"input\");\n\t\t\tinput.setAttribute( \"type\", \"hidden\" );\n\t\t\tel.appendChild( input ).setAttribute( \"name\", \"D\" );\n\n\t\t\t// Support: IE8\n\t\t\t// Enforce case-sensitivity of name attribute\n\t\t\tif ( el.querySelectorAll(\"[name=d]\").length ) {\n\t\t\t\trbuggyQSA.push( \"name\" + whitespace + \"*[*^$|!~]?=\" );\n\t\t\t}\n\n\t\t\t// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)\n\t\t\t// IE8 throws error here and will not see later tests\n\t\t\tif ( el.querySelectorAll(\":enabled\").length !== 2 ) {\n\t\t\t\trbuggyQSA.push( \":enabled\", \":disabled\" );\n\t\t\t}\n\n\t\t\t// Support: IE9-11+\n\t\t\t// IE's :disabled selector does not pick up the children of disabled fieldsets\n\t\t\tdocElem.appendChild( el ).disabled = true;\n\t\t\tif ( el.querySelectorAll(\":disabled\").length !== 2 ) {\n\t\t\t\trbuggyQSA.push( \":enabled\", \":disabled\" );\n\t\t\t}\n\n\t\t\t// Opera 10-11 does not throw on post-comma invalid pseudos\n\t\t\tel.querySelectorAll(\"*,:x\");\n\t\t\trbuggyQSA.push(\",.*:\");\n\t\t});\n\t}\n\n\tif ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||\n\t\tdocElem.webkitMatchesSelector ||\n\t\tdocElem.mozMatchesSelector ||\n\t\tdocElem.oMatchesSelector ||\n\t\tdocElem.msMatchesSelector) )) ) {\n\n\t\tassert(function( el ) {\n\t\t\t// Check to see if it's possible to do matchesSelector\n\t\t\t// on a disconnected node (IE 9)\n\t\t\tsupport.disconnectedMatch = matches.call( el, \"*\" );\n\n\t\t\t// This should fail with an exception\n\t\t\t// Gecko does not error, returns false instead\n\t\t\tmatches.call( el, \"[s!='']:x\" );\n\t\t\trbuggyMatches.push( \"!=\", pseudos );\n\t\t});\n\t}\n\n\trbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join(\"|\") );\n\trbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join(\"|\") );\n\n\t/* Contains\n\t---------------------------------------------------------------------- */\n\thasCompare = rnative.test( docElem.compareDocumentPosition );\n\n\t// Element contains another\n\t// Purposefully self-exclusive\n\t// As in, an element does not contain itself\n\tcontains = hasCompare || rnative.test( docElem.contains ) ?\n\t\tfunction( a, b ) {\n\t\t\tvar adown = a.nodeType === 9 ? a.documentElement : a,\n\t\t\t\tbup = b && b.parentNode;\n\t\t\treturn a === bup || !!( bup && bup.nodeType === 1 && (\n\t\t\t\tadown.contains ?\n\t\t\t\t\tadown.contains( bup ) :\n\t\t\t\t\ta.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16\n\t\t\t));\n\t\t} :\n\t\tfunction( a, b ) {\n\t\t\tif ( b ) {\n\t\t\t\twhile ( (b = b.parentNode) ) {\n\t\t\t\t\tif ( b === a ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\n\t/* Sorting\n\t---------------------------------------------------------------------- */\n\n\t// Document order sorting\n\tsortOrder = hasCompare ?\n\tfunction( a, b ) {\n\n\t\t// Flag for duplicate removal\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\t\t}\n\n\t\t// Sort on method existence if only one input has compareDocumentPosition\n\t\tvar compare = !a.compareDocumentPosition - !b.compareDocumentPosition;\n\t\tif ( compare ) {\n\t\t\treturn compare;\n\t\t}\n\n\t\t// Calculate position if both inputs belong to the same document\n\t\tcompare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?\n\t\t\ta.compareDocumentPosition( b ) :\n\n\t\t\t// Otherwise we know they are disconnected\n\t\t\t1;\n\n\t\t// Disconnected nodes\n\t\tif ( compare & 1 ||\n\t\t\t(!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {\n\n\t\t\t// Choose the first element that is related to our preferred document\n\t\t\tif ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\t// Maintain original order\n\t\t\treturn sortInput ?\n\t\t\t\t( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :\n\t\t\t\t0;\n\t\t}\n\n\t\treturn compare & 4 ? -1 : 1;\n\t} :\n\tfunction( a, b ) {\n\t\t// Exit early if the nodes are identical\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\t\t}\n\n\t\tvar cur,\n\t\t\ti = 0,\n\t\t\taup = a.parentNode,\n\t\t\tbup = b.parentNode,\n\t\t\tap = [ a ],\n\t\t\tbp = [ b ];\n\n\t\t// Parentless nodes are either documents or disconnected\n\t\tif ( !aup || !bup ) {\n\t\t\treturn a === document ? -1 :\n\t\t\t\tb === document ? 1 :\n\t\t\t\taup ? -1 :\n\t\t\t\tbup ? 1 :\n\t\t\t\tsortInput ?\n\t\t\t\t( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :\n\t\t\t\t0;\n\n\t\t// If the nodes are siblings, we can do a quick check\n\t\t} else if ( aup === bup ) {\n\t\t\treturn siblingCheck( a, b );\n\t\t}\n\n\t\t// Otherwise we need full lists of their ancestors for comparison\n\t\tcur = a;\n\t\twhile ( (cur = cur.parentNode) ) {\n\t\t\tap.unshift( cur );\n\t\t}\n\t\tcur = b;\n\t\twhile ( (cur = cur.parentNode) ) {\n\t\t\tbp.unshift( cur );\n\t\t}\n\n\t\t// Walk down the tree looking for a discrepancy\n\t\twhile ( ap[i] === bp[i] ) {\n\t\t\ti++;\n\t\t}\n\n\t\treturn i ?\n\t\t\t// Do a sibling check if the nodes have a common ancestor\n\t\t\tsiblingCheck( ap[i], bp[i] ) :\n\n\t\t\t// Otherwise nodes in our document sort first\n\t\t\tap[i] === preferredDoc ? -1 :\n\t\t\tbp[i] === preferredDoc ? 1 :\n\t\t\t0;\n\t};\n\n\treturn document;\n};\n\nSizzle.matches = function( expr, elements ) {\n\treturn Sizzle( expr, null, null, elements );\n};\n\nSizzle.matchesSelector = function( elem, expr ) {\n\t// Set document vars if needed\n\tif ( ( elem.ownerDocument || elem ) !== document ) {\n\t\tsetDocument( elem );\n\t}\n\n\tif ( support.matchesSelector && documentIsHTML &&\n\t\t!nonnativeSelectorCache[ expr + \" \" ] &&\n\t\t( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&\n\t\t( !rbuggyQSA     || !rbuggyQSA.test( expr ) ) ) {\n\n\t\ttry {\n\t\t\tvar ret = matches.call( elem, expr );\n\n\t\t\t// IE 9's matchesSelector returns false on disconnected nodes\n\t\t\tif ( ret || support.disconnectedMatch ||\n\t\t\t\t\t// As well, disconnected nodes are said to be in a document\n\t\t\t\t\t// fragment in IE 9\n\t\t\t\t\telem.document && elem.document.nodeType !== 11 ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tnonnativeSelectorCache( expr, true );\n\t\t}\n\t}\n\n\treturn Sizzle( expr, document, null, [ elem ] ).length > 0;\n};\n\nSizzle.contains = function( context, elem ) {\n\t// Set document vars if needed\n\tif ( ( context.ownerDocument || context ) !== document ) {\n\t\tsetDocument( context );\n\t}\n\treturn contains( context, elem );\n};\n\nSizzle.attr = function( elem, name ) {\n\t// Set document vars if needed\n\tif ( ( elem.ownerDocument || elem ) !== document ) {\n\t\tsetDocument( elem );\n\t}\n\n\tvar fn = Expr.attrHandle[ name.toLowerCase() ],\n\t\t// Don't get fooled by Object.prototype properties (jQuery #13807)\n\t\tval = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?\n\t\t\tfn( elem, name, !documentIsHTML ) :\n\t\t\tundefined;\n\n\treturn val !== undefined ?\n\t\tval :\n\t\tsupport.attributes || !documentIsHTML ?\n\t\t\telem.getAttribute( name ) :\n\t\t\t(val = elem.getAttributeNode(name)) && val.specified ?\n\t\t\t\tval.value :\n\t\t\t\tnull;\n};\n\nSizzle.escape = function( sel ) {\n\treturn (sel + \"\").replace( rcssescape, fcssescape );\n};\n\nSizzle.error = function( msg ) {\n\tthrow new Error( \"Syntax error, unrecognized expression: \" + msg );\n};\n\n/**\n * Document sorting and removing duplicates\n * @param {ArrayLike} results\n */\nSizzle.uniqueSort = function( results ) {\n\tvar elem,\n\t\tduplicates = [],\n\t\tj = 0,\n\t\ti = 0;\n\n\t// Unless we *know* we can detect duplicates, assume their presence\n\thasDuplicate = !support.detectDuplicates;\n\tsortInput = !support.sortStable && results.slice( 0 );\n\tresults.sort( sortOrder );\n\n\tif ( hasDuplicate ) {\n\t\twhile ( (elem = results[i++]) ) {\n\t\t\tif ( elem === results[ i ] ) {\n\t\t\t\tj = duplicates.push( i );\n\t\t\t}\n\t\t}\n\t\twhile ( j-- ) {\n\t\t\tresults.splice( duplicates[ j ], 1 );\n\t\t}\n\t}\n\n\t// Clear input after sorting to release objects\n\t// See https://github.com/jquery/sizzle/pull/225\n\tsortInput = null;\n\n\treturn results;\n};\n\n/**\n * Utility function for retrieving the text value of an array of DOM nodes\n * @param {Array|Element} elem\n */\ngetText = Sizzle.getText = function( elem ) {\n\tvar node,\n\t\tret = \"\",\n\t\ti = 0,\n\t\tnodeType = elem.nodeType;\n\n\tif ( !nodeType ) {\n\t\t// If no nodeType, this is expected to be an array\n\t\twhile ( (node = elem[i++]) ) {\n\t\t\t// Do not traverse comment nodes\n\t\t\tret += getText( node );\n\t\t}\n\t} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {\n\t\t// Use textContent for elements\n\t\t// innerText usage removed for consistency of new lines (jQuery #11153)\n\t\tif ( typeof elem.textContent === \"string\" ) {\n\t\t\treturn elem.textContent;\n\t\t} else {\n\t\t\t// Traverse its children\n\t\t\tfor ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n\t\t\t\tret += getText( elem );\n\t\t\t}\n\t\t}\n\t} else if ( nodeType === 3 || nodeType === 4 ) {\n\t\treturn elem.nodeValue;\n\t}\n\t// Do not include comment or processing instruction nodes\n\n\treturn ret;\n};\n\nExpr = Sizzle.selectors = {\n\n\t// Can be adjusted by the user\n\tcacheLength: 50,\n\n\tcreatePseudo: markFunction,\n\n\tmatch: matchExpr,\n\n\tattrHandle: {},\n\n\tfind: {},\n\n\trelative: {\n\t\t\">\": { dir: \"parentNode\", first: true },\n\t\t\" \": { dir: \"parentNode\" },\n\t\t\"+\": { dir: \"previousSibling\", first: true },\n\t\t\"~\": { dir: \"previousSibling\" }\n\t},\n\n\tpreFilter: {\n\t\t\"ATTR\": function( match ) {\n\t\t\tmatch[1] = match[1].replace( runescape, funescape );\n\n\t\t\t// Move the given value to match[3] whether quoted or unquoted\n\t\t\tmatch[3] = ( match[3] || match[4] || match[5] || \"\" ).replace( runescape, funescape );\n\n\t\t\tif ( match[2] === \"~=\" ) {\n\t\t\t\tmatch[3] = \" \" + match[3] + \" \";\n\t\t\t}\n\n\t\t\treturn match.slice( 0, 4 );\n\t\t},\n\n\t\t\"CHILD\": function( match ) {\n\t\t\t/* matches from matchExpr[\"CHILD\"]\n\t\t\t\t1 type (only|nth|...)\n\t\t\t\t2 what (child|of-type)\n\t\t\t\t3 argument (even|odd|\\d*|\\d*n([+-]\\d+)?|...)\n\t\t\t\t4 xn-component of xn+y argument ([+-]?\\d*n|)\n\t\t\t\t5 sign of xn-component\n\t\t\t\t6 x of xn-component\n\t\t\t\t7 sign of y-component\n\t\t\t\t8 y of y-component\n\t\t\t*/\n\t\t\tmatch[1] = match[1].toLowerCase();\n\n\t\t\tif ( match[1].slice( 0, 3 ) === \"nth\" ) {\n\t\t\t\t// nth-* requires argument\n\t\t\t\tif ( !match[3] ) {\n\t\t\t\t\tSizzle.error( match[0] );\n\t\t\t\t}\n\n\t\t\t\t// numeric x and y parameters for Expr.filter.CHILD\n\t\t\t\t// remember that false/true cast respectively to 0/1\n\t\t\t\tmatch[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === \"even\" || match[3] === \"odd\" ) );\n\t\t\t\tmatch[5] = +( ( match[7] + match[8] ) || match[3] === \"odd\" );\n\n\t\t\t// other types prohibit arguments\n\t\t\t} else if ( match[3] ) {\n\t\t\t\tSizzle.error( match[0] );\n\t\t\t}\n\n\t\t\treturn match;\n\t\t},\n\n\t\t\"PSEUDO\": function( match ) {\n\t\t\tvar excess,\n\t\t\t\tunquoted = !match[6] && match[2];\n\n\t\t\tif ( matchExpr[\"CHILD\"].test( match[0] ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Accept quoted arguments as-is\n\t\t\tif ( match[3] ) {\n\t\t\t\tmatch[2] = match[4] || match[5] || \"\";\n\n\t\t\t// Strip excess characters from unquoted arguments\n\t\t\t} else if ( unquoted && rpseudo.test( unquoted ) &&\n\t\t\t\t// Get excess from tokenize (recursively)\n\t\t\t\t(excess = tokenize( unquoted, true )) &&\n\t\t\t\t// advance to the next closing parenthesis\n\t\t\t\t(excess = unquoted.indexOf( \")\", unquoted.length - excess ) - unquoted.length) ) {\n\n\t\t\t\t// excess is a negative index\n\t\t\t\tmatch[0] = match[0].slice( 0, excess );\n\t\t\t\tmatch[2] = unquoted.slice( 0, excess );\n\t\t\t}\n\n\t\t\t// Return only captures needed by the pseudo filter method (type and argument)\n\t\t\treturn match.slice( 0, 3 );\n\t\t}\n\t},\n\n\tfilter: {\n\n\t\t\"TAG\": function( nodeNameSelector ) {\n\t\t\tvar nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn nodeNameSelector === \"*\" ?\n\t\t\t\tfunction() { return true; } :\n\t\t\t\tfunction( elem ) {\n\t\t\t\t\treturn elem.nodeName && elem.nodeName.toLowerCase() === nodeName;\n\t\t\t\t};\n\t\t},\n\n\t\t\"CLASS\": function( className ) {\n\t\t\tvar pattern = classCache[ className + \" \" ];\n\n\t\t\treturn pattern ||\n\t\t\t\t(pattern = new RegExp( \"(^|\" + whitespace + \")\" + className + \"(\" + whitespace + \"|$)\" )) &&\n\t\t\t\tclassCache( className, function( elem ) {\n\t\t\t\t\treturn pattern.test( typeof elem.className === \"string\" && elem.className || typeof elem.getAttribute !== \"undefined\" && elem.getAttribute(\"class\") || \"\" );\n\t\t\t\t});\n\t\t},\n\n\t\t\"ATTR\": function( name, operator, check ) {\n\t\t\treturn function( elem ) {\n\t\t\t\tvar result = Sizzle.attr( elem, name );\n\n\t\t\t\tif ( result == null ) {\n\t\t\t\t\treturn operator === \"!=\";\n\t\t\t\t}\n\t\t\t\tif ( !operator ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tresult += \"\";\n\n\t\t\t\treturn operator === \"=\" ? result === check :\n\t\t\t\t\toperator === \"!=\" ? result !== check :\n\t\t\t\t\toperator === \"^=\" ? check && result.indexOf( check ) === 0 :\n\t\t\t\t\toperator === \"*=\" ? check && result.indexOf( check ) > -1 :\n\t\t\t\t\toperator === \"$=\" ? check && result.slice( -check.length ) === check :\n\t\t\t\t\toperator === \"~=\" ? ( \" \" + result.replace( rwhitespace, \" \" ) + \" \" ).indexOf( check ) > -1 :\n\t\t\t\t\toperator === \"|=\" ? result === check || result.slice( 0, check.length + 1 ) === check + \"-\" :\n\t\t\t\t\tfalse;\n\t\t\t};\n\t\t},\n\n\t\t\"CHILD\": function( type, what, argument, first, last ) {\n\t\t\tvar simple = type.slice( 0, 3 ) !== \"nth\",\n\t\t\t\tforward = type.slice( -4 ) !== \"last\",\n\t\t\t\tofType = what === \"of-type\";\n\n\t\t\treturn first === 1 && last === 0 ?\n\n\t\t\t\t// Shortcut for :nth-*(n)\n\t\t\t\tfunction( elem ) {\n\t\t\t\t\treturn !!elem.parentNode;\n\t\t\t\t} :\n\n\t\t\t\tfunction( elem, context, xml ) {\n\t\t\t\t\tvar cache, uniqueCache, outerCache, node, nodeIndex, start,\n\t\t\t\t\t\tdir = simple !== forward ? \"nextSibling\" : \"previousSibling\",\n\t\t\t\t\t\tparent = elem.parentNode,\n\t\t\t\t\t\tname = ofType && elem.nodeName.toLowerCase(),\n\t\t\t\t\t\tuseCache = !xml && !ofType,\n\t\t\t\t\t\tdiff = false;\n\n\t\t\t\t\tif ( parent ) {\n\n\t\t\t\t\t\t// :(first|last|only)-(child|of-type)\n\t\t\t\t\t\tif ( simple ) {\n\t\t\t\t\t\t\twhile ( dir ) {\n\t\t\t\t\t\t\t\tnode = elem;\n\t\t\t\t\t\t\t\twhile ( (node = node[ dir ]) ) {\n\t\t\t\t\t\t\t\t\tif ( ofType ?\n\t\t\t\t\t\t\t\t\t\tnode.nodeName.toLowerCase() === name :\n\t\t\t\t\t\t\t\t\t\tnode.nodeType === 1 ) {\n\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Reverse direction for :only-* (if we haven't yet done so)\n\t\t\t\t\t\t\t\tstart = dir = type === \"only\" && !start && \"nextSibling\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstart = [ forward ? parent.firstChild : parent.lastChild ];\n\n\t\t\t\t\t\t// non-xml :nth-child(...) stores cache data on `parent`\n\t\t\t\t\t\tif ( forward && useCache ) {\n\n\t\t\t\t\t\t\t// Seek `elem` from a previously-cached index\n\n\t\t\t\t\t\t\t// ...in a gzip-friendly way\n\t\t\t\t\t\t\tnode = parent;\n\t\t\t\t\t\t\touterCache = node[ expando ] || (node[ expando ] = {});\n\n\t\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\t\tuniqueCache = outerCache[ node.uniqueID ] ||\n\t\t\t\t\t\t\t\t(outerCache[ node.uniqueID ] = {});\n\n\t\t\t\t\t\t\tcache = uniqueCache[ type ] || [];\n\t\t\t\t\t\t\tnodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];\n\t\t\t\t\t\t\tdiff = nodeIndex && cache[ 2 ];\n\t\t\t\t\t\t\tnode = nodeIndex && parent.childNodes[ nodeIndex ];\n\n\t\t\t\t\t\t\twhile ( (node = ++nodeIndex && node && node[ dir ] ||\n\n\t\t\t\t\t\t\t\t// Fallback to seeking `elem` from the start\n\t\t\t\t\t\t\t\t(diff = nodeIndex = 0) || start.pop()) ) {\n\n\t\t\t\t\t\t\t\t// When found, cache indexes on `parent` and break\n\t\t\t\t\t\t\t\tif ( node.nodeType === 1 && ++diff && node === elem ) {\n\t\t\t\t\t\t\t\t\tuniqueCache[ type ] = [ dirruns, nodeIndex, diff ];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Use previously-cached element index if available\n\t\t\t\t\t\t\tif ( useCache ) {\n\t\t\t\t\t\t\t\t// ...in a gzip-friendly way\n\t\t\t\t\t\t\t\tnode = elem;\n\t\t\t\t\t\t\t\touterCache = node[ expando ] || (node[ expando ] = {});\n\n\t\t\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\t\t\tuniqueCache = outerCache[ node.uniqueID ] ||\n\t\t\t\t\t\t\t\t\t(outerCache[ node.uniqueID ] = {});\n\n\t\t\t\t\t\t\t\tcache = uniqueCache[ type ] || [];\n\t\t\t\t\t\t\t\tnodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];\n\t\t\t\t\t\t\t\tdiff = nodeIndex;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// xml :nth-child(...)\n\t\t\t\t\t\t\t// or :nth-last-child(...) or :nth(-last)?-of-type(...)\n\t\t\t\t\t\t\tif ( diff === false ) {\n\t\t\t\t\t\t\t\t// Use the same loop as above to seek `elem` from the start\n\t\t\t\t\t\t\t\twhile ( (node = ++nodeIndex && node && node[ dir ] ||\n\t\t\t\t\t\t\t\t\t(diff = nodeIndex = 0) || start.pop()) ) {\n\n\t\t\t\t\t\t\t\t\tif ( ( ofType ?\n\t\t\t\t\t\t\t\t\t\tnode.nodeName.toLowerCase() === name :\n\t\t\t\t\t\t\t\t\t\tnode.nodeType === 1 ) &&\n\t\t\t\t\t\t\t\t\t\t++diff ) {\n\n\t\t\t\t\t\t\t\t\t\t// Cache the index of each encountered element\n\t\t\t\t\t\t\t\t\t\tif ( useCache ) {\n\t\t\t\t\t\t\t\t\t\t\touterCache = node[ expando ] || (node[ expando ] = {});\n\n\t\t\t\t\t\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\t\t\t\t\t\tuniqueCache = outerCache[ node.uniqueID ] ||\n\t\t\t\t\t\t\t\t\t\t\t\t(outerCache[ node.uniqueID ] = {});\n\n\t\t\t\t\t\t\t\t\t\t\tuniqueCache[ type ] = [ dirruns, diff ];\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tif ( node === elem ) {\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Incorporate the offset, then check against cycle size\n\t\t\t\t\t\tdiff -= last;\n\t\t\t\t\t\treturn diff === first || ( diff % first === 0 && diff / first >= 0 );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t},\n\n\t\t\"PSEUDO\": function( pseudo, argument ) {\n\t\t\t// pseudo-class names are case-insensitive\n\t\t\t// http://www.w3.org/TR/selectors/#pseudo-classes\n\t\t\t// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters\n\t\t\t// Remember that setFilters inherits from pseudos\n\t\t\tvar args,\n\t\t\t\tfn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||\n\t\t\t\t\tSizzle.error( \"unsupported pseudo: \" + pseudo );\n\n\t\t\t// The user may use createPseudo to indicate that\n\t\t\t// arguments are needed to create the filter function\n\t\t\t// just as Sizzle does\n\t\t\tif ( fn[ expando ] ) {\n\t\t\t\treturn fn( argument );\n\t\t\t}\n\n\t\t\t// But maintain support for old signatures\n\t\t\tif ( fn.length > 1 ) {\n\t\t\t\targs = [ pseudo, pseudo, \"\", argument ];\n\t\t\t\treturn Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?\n\t\t\t\t\tmarkFunction(function( seed, matches ) {\n\t\t\t\t\t\tvar idx,\n\t\t\t\t\t\t\tmatched = fn( seed, argument ),\n\t\t\t\t\t\t\ti = matched.length;\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tidx = indexOf( seed, matched[i] );\n\t\t\t\t\t\t\tseed[ idx ] = !( matches[ idx ] = matched[i] );\n\t\t\t\t\t\t}\n\t\t\t\t\t}) :\n\t\t\t\t\tfunction( elem ) {\n\t\t\t\t\t\treturn fn( elem, 0, args );\n\t\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn fn;\n\t\t}\n\t},\n\n\tpseudos: {\n\t\t// Potentially complex pseudos\n\t\t\"not\": markFunction(function( selector ) {\n\t\t\t// Trim the selector passed to compile\n\t\t\t// to avoid treating leading and trailing\n\t\t\t// spaces as combinators\n\t\t\tvar input = [],\n\t\t\t\tresults = [],\n\t\t\t\tmatcher = compile( selector.replace( rtrim, \"$1\" ) );\n\n\t\t\treturn matcher[ expando ] ?\n\t\t\t\tmarkFunction(function( seed, matches, context, xml ) {\n\t\t\t\t\tvar elem,\n\t\t\t\t\t\tunmatched = matcher( seed, null, xml, [] ),\n\t\t\t\t\t\ti = seed.length;\n\n\t\t\t\t\t// Match elements unmatched by `matcher`\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( (elem = unmatched[i]) ) {\n\t\t\t\t\t\t\tseed[i] = !(matches[i] = elem);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}) :\n\t\t\t\tfunction( elem, context, xml ) {\n\t\t\t\t\tinput[0] = elem;\n\t\t\t\t\tmatcher( input, null, xml, results );\n\t\t\t\t\t// Don't keep the element (issue #299)\n\t\t\t\t\tinput[0] = null;\n\t\t\t\t\treturn !results.pop();\n\t\t\t\t};\n\t\t}),\n\n\t\t\"has\": markFunction(function( selector ) {\n\t\t\treturn function( elem ) {\n\t\t\t\treturn Sizzle( selector, elem ).length > 0;\n\t\t\t};\n\t\t}),\n\n\t\t\"contains\": markFunction(function( text ) {\n\t\t\ttext = text.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\treturn ( elem.textContent || getText( elem ) ).indexOf( text ) > -1;\n\t\t\t};\n\t\t}),\n\n\t\t// \"Whether an element is represented by a :lang() selector\n\t\t// is based solely on the element's language value\n\t\t// being equal to the identifier C,\n\t\t// or beginning with the identifier C immediately followed by \"-\".\n\t\t// The matching of C against the element's language value is performed case-insensitively.\n\t\t// The identifier C does not have to be a valid language name.\"\n\t\t// http://www.w3.org/TR/selectors/#lang-pseudo\n\t\t\"lang\": markFunction( function( lang ) {\n\t\t\t// lang value must be a valid identifier\n\t\t\tif ( !ridentifier.test(lang || \"\") ) {\n\t\t\t\tSizzle.error( \"unsupported lang: \" + lang );\n\t\t\t}\n\t\t\tlang = lang.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn function( elem ) {\n\t\t\t\tvar elemLang;\n\t\t\t\tdo {\n\t\t\t\t\tif ( (elemLang = documentIsHTML ?\n\t\t\t\t\t\telem.lang :\n\t\t\t\t\t\telem.getAttribute(\"xml:lang\") || elem.getAttribute(\"lang\")) ) {\n\n\t\t\t\t\t\telemLang = elemLang.toLowerCase();\n\t\t\t\t\t\treturn elemLang === lang || elemLang.indexOf( lang + \"-\" ) === 0;\n\t\t\t\t\t}\n\t\t\t\t} while ( (elem = elem.parentNode) && elem.nodeType === 1 );\n\t\t\t\treturn false;\n\t\t\t};\n\t\t}),\n\n\t\t// Miscellaneous\n\t\t\"target\": function( elem ) {\n\t\t\tvar hash = window.location && window.location.hash;\n\t\t\treturn hash && hash.slice( 1 ) === elem.id;\n\t\t},\n\n\t\t\"root\": function( elem ) {\n\t\t\treturn elem === docElem;\n\t\t},\n\n\t\t\"focus\": function( elem ) {\n\t\t\treturn elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);\n\t\t},\n\n\t\t// Boolean properties\n\t\t\"enabled\": createDisabledPseudo( false ),\n\t\t\"disabled\": createDisabledPseudo( true ),\n\n\t\t\"checked\": function( elem ) {\n\t\t\t// In CSS3, :checked should return both checked and selected elements\n\t\t\t// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n\t\t\tvar nodeName = elem.nodeName.toLowerCase();\n\t\t\treturn (nodeName === \"input\" && !!elem.checked) || (nodeName === \"option\" && !!elem.selected);\n\t\t},\n\n\t\t\"selected\": function( elem ) {\n\t\t\t// Accessing this property makes selected-by-default\n\t\t\t// options in Safari work properly\n\t\t\tif ( elem.parentNode ) {\n\t\t\t\telem.parentNode.selectedIndex;\n\t\t\t}\n\n\t\t\treturn elem.selected === true;\n\t\t},\n\n\t\t// Contents\n\t\t\"empty\": function( elem ) {\n\t\t\t// http://www.w3.org/TR/selectors/#empty-pseudo\n\t\t\t// :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),\n\t\t\t//   but not by others (comment: 8; processing instruction: 7; etc.)\n\t\t\t// nodeType < 6 works because attributes (2) do not appear as children\n\t\t\tfor ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n\t\t\t\tif ( elem.nodeType < 6 ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\n\t\t\"parent\": function( elem ) {\n\t\t\treturn !Expr.pseudos[\"empty\"]( elem );\n\t\t},\n\n\t\t// Element/input types\n\t\t\"header\": function( elem ) {\n\t\t\treturn rheader.test( elem.nodeName );\n\t\t},\n\n\t\t\"input\": function( elem ) {\n\t\t\treturn rinputs.test( elem.nodeName );\n\t\t},\n\n\t\t\"button\": function( elem ) {\n\t\t\tvar name = elem.nodeName.toLowerCase();\n\t\t\treturn name === \"input\" && elem.type === \"button\" || name === \"button\";\n\t\t},\n\n\t\t\"text\": function( elem ) {\n\t\t\tvar attr;\n\t\t\treturn elem.nodeName.toLowerCase() === \"input\" &&\n\t\t\t\telem.type === \"text\" &&\n\n\t\t\t\t// Support: IE<8\n\t\t\t\t// New HTML5 attribute values (e.g., \"search\") appear with elem.type === \"text\"\n\t\t\t\t( (attr = elem.getAttribute(\"type\")) == null || attr.toLowerCase() === \"text\" );\n\t\t},\n\n\t\t// Position-in-collection\n\t\t\"first\": createPositionalPseudo(function() {\n\t\t\treturn [ 0 ];\n\t\t}),\n\n\t\t\"last\": createPositionalPseudo(function( matchIndexes, length ) {\n\t\t\treturn [ length - 1 ];\n\t\t}),\n\n\t\t\"eq\": createPositionalPseudo(function( matchIndexes, length, argument ) {\n\t\t\treturn [ argument < 0 ? argument + length : argument ];\n\t\t}),\n\n\t\t\"even\": createPositionalPseudo(function( matchIndexes, length ) {\n\t\t\tvar i = 0;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t}),\n\n\t\t\"odd\": createPositionalPseudo(function( matchIndexes, length ) {\n\t\t\tvar i = 1;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t}),\n\n\t\t\"lt\": createPositionalPseudo(function( matchIndexes, length, argument ) {\n\t\t\tvar i = argument < 0 ?\n\t\t\t\targument + length :\n\t\t\t\targument > length ?\n\t\t\t\t\tlength :\n\t\t\t\t\targument;\n\t\t\tfor ( ; --i >= 0; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t}),\n\n\t\t\"gt\": createPositionalPseudo(function( matchIndexes, length, argument ) {\n\t\t\tvar i = argument < 0 ? argument + length : argument;\n\t\t\tfor ( ; ++i < length; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t})\n\t}\n};\n\nExpr.pseudos[\"nth\"] = Expr.pseudos[\"eq\"];\n\n// Add button/input type pseudos\nfor ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {\n\tExpr.pseudos[ i ] = createInputPseudo( i );\n}\nfor ( i in { submit: true, reset: true } ) {\n\tExpr.pseudos[ i ] = createButtonPseudo( i );\n}\n\n// Easy API for creating new setFilters\nfunction setFilters() {}\nsetFilters.prototype = Expr.filters = Expr.pseudos;\nExpr.setFilters = new setFilters();\n\ntokenize = Sizzle.tokenize = function( selector, parseOnly ) {\n\tvar matched, match, tokens, type,\n\t\tsoFar, groups, preFilters,\n\t\tcached = tokenCache[ selector + \" \" ];\n\n\tif ( cached ) {\n\t\treturn parseOnly ? 0 : cached.slice( 0 );\n\t}\n\n\tsoFar = selector;\n\tgroups = [];\n\tpreFilters = Expr.preFilter;\n\n\twhile ( soFar ) {\n\n\t\t// Comma and first run\n\t\tif ( !matched || (match = rcomma.exec( soFar )) ) {\n\t\t\tif ( match ) {\n\t\t\t\t// Don't consume trailing commas as valid\n\t\t\t\tsoFar = soFar.slice( match[0].length ) || soFar;\n\t\t\t}\n\t\t\tgroups.push( (tokens = []) );\n\t\t}\n\n\t\tmatched = false;\n\n\t\t// Combinators\n\t\tif ( (match = rcombinators.exec( soFar )) ) {\n\t\t\tmatched = match.shift();\n\t\t\ttokens.push({\n\t\t\t\tvalue: matched,\n\t\t\t\t// Cast descendant combinators to space\n\t\t\t\ttype: match[0].replace( rtrim, \" \" )\n\t\t\t});\n\t\t\tsoFar = soFar.slice( matched.length );\n\t\t}\n\n\t\t// Filters\n\t\tfor ( type in Expr.filter ) {\n\t\t\tif ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||\n\t\t\t\t(match = preFilters[ type ]( match ))) ) {\n\t\t\t\tmatched = match.shift();\n\t\t\t\ttokens.push({\n\t\t\t\t\tvalue: matched,\n\t\t\t\t\ttype: type,\n\t\t\t\t\tmatches: match\n\t\t\t\t});\n\t\t\t\tsoFar = soFar.slice( matched.length );\n\t\t\t}\n\t\t}\n\n\t\tif ( !matched ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Return the length of the invalid excess\n\t// if we're just parsing\n\t// Otherwise, throw an error or return tokens\n\treturn parseOnly ?\n\t\tsoFar.length :\n\t\tsoFar ?\n\t\t\tSizzle.error( selector ) :\n\t\t\t// Cache the tokens\n\t\t\ttokenCache( selector, groups ).slice( 0 );\n};\n\nfunction toSelector( tokens ) {\n\tvar i = 0,\n\t\tlen = tokens.length,\n\t\tselector = \"\";\n\tfor ( ; i < len; i++ ) {\n\t\tselector += tokens[i].value;\n\t}\n\treturn selector;\n}\n\nfunction addCombinator( matcher, combinator, base ) {\n\tvar dir = combinator.dir,\n\t\tskip = combinator.next,\n\t\tkey = skip || dir,\n\t\tcheckNonElements = base && key === \"parentNode\",\n\t\tdoneName = done++;\n\n\treturn combinator.first ?\n\t\t// Check against closest ancestor/preceding element\n\t\tfunction( elem, context, xml ) {\n\t\t\twhile ( (elem = elem[ dir ]) ) {\n\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\treturn matcher( elem, context, xml );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t} :\n\n\t\t// Check against all ancestor/preceding elements\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar oldCache, uniqueCache, outerCache,\n\t\t\t\tnewCache = [ dirruns, doneName ];\n\n\t\t\t// We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching\n\t\t\tif ( xml ) {\n\t\t\t\twhile ( (elem = elem[ dir ]) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\tif ( matcher( elem, context, xml ) ) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\twhile ( (elem = elem[ dir ]) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\touterCache = elem[ expando ] || (elem[ expando ] = {});\n\n\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\tuniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});\n\n\t\t\t\t\t\tif ( skip && skip === elem.nodeName.toLowerCase() ) {\n\t\t\t\t\t\t\telem = elem[ dir ] || elem;\n\t\t\t\t\t\t} else if ( (oldCache = uniqueCache[ key ]) &&\n\t\t\t\t\t\t\toldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {\n\n\t\t\t\t\t\t\t// Assign to newCache so results back-propagate to previous elements\n\t\t\t\t\t\t\treturn (newCache[ 2 ] = oldCache[ 2 ]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Reuse newcache so results back-propagate to previous elements\n\t\t\t\t\t\t\tuniqueCache[ key ] = newCache;\n\n\t\t\t\t\t\t\t// A match means we're done; a fail means we have to keep checking\n\t\t\t\t\t\t\tif ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n}\n\nfunction elementMatcher( matchers ) {\n\treturn matchers.length > 1 ?\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar i = matchers.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( !matchers[i]( elem, context, xml ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} :\n\t\tmatchers[0];\n}\n\nfunction multipleContexts( selector, contexts, results ) {\n\tvar i = 0,\n\t\tlen = contexts.length;\n\tfor ( ; i < len; i++ ) {\n\t\tSizzle( selector, contexts[i], results );\n\t}\n\treturn results;\n}\n\nfunction condense( unmatched, map, filter, context, xml ) {\n\tvar elem,\n\t\tnewUnmatched = [],\n\t\ti = 0,\n\t\tlen = unmatched.length,\n\t\tmapped = map != null;\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( (elem = unmatched[i]) ) {\n\t\t\tif ( !filter || filter( elem, context, xml ) ) {\n\t\t\t\tnewUnmatched.push( elem );\n\t\t\t\tif ( mapped ) {\n\t\t\t\t\tmap.push( i );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn newUnmatched;\n}\n\nfunction setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {\n\tif ( postFilter && !postFilter[ expando ] ) {\n\t\tpostFilter = setMatcher( postFilter );\n\t}\n\tif ( postFinder && !postFinder[ expando ] ) {\n\t\tpostFinder = setMatcher( postFinder, postSelector );\n\t}\n\treturn markFunction(function( seed, results, context, xml ) {\n\t\tvar temp, i, elem,\n\t\t\tpreMap = [],\n\t\t\tpostMap = [],\n\t\t\tpreexisting = results.length,\n\n\t\t\t// Get initial elements from seed or context\n\t\t\telems = seed || multipleContexts( selector || \"*\", context.nodeType ? [ context ] : context, [] ),\n\n\t\t\t// Prefilter to get matcher input, preserving a map for seed-results synchronization\n\t\t\tmatcherIn = preFilter && ( seed || !selector ) ?\n\t\t\t\tcondense( elems, preMap, preFilter, context, xml ) :\n\t\t\t\telems,\n\n\t\t\tmatcherOut = matcher ?\n\t\t\t\t// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,\n\t\t\t\tpostFinder || ( seed ? preFilter : preexisting || postFilter ) ?\n\n\t\t\t\t\t// ...intermediate processing is necessary\n\t\t\t\t\t[] :\n\n\t\t\t\t\t// ...otherwise use results directly\n\t\t\t\t\tresults :\n\t\t\t\tmatcherIn;\n\n\t\t// Find primary matches\n\t\tif ( matcher ) {\n\t\t\tmatcher( matcherIn, matcherOut, context, xml );\n\t\t}\n\n\t\t// Apply postFilter\n\t\tif ( postFilter ) {\n\t\t\ttemp = condense( matcherOut, postMap );\n\t\t\tpostFilter( temp, [], context, xml );\n\n\t\t\t// Un-match failing elements by moving them back to matcherIn\n\t\t\ti = temp.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( (elem = temp[i]) ) {\n\t\t\t\t\tmatcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( seed ) {\n\t\t\tif ( postFinder || preFilter ) {\n\t\t\t\tif ( postFinder ) {\n\t\t\t\t\t// Get the final matcherOut by condensing this intermediate into postFinder contexts\n\t\t\t\t\ttemp = [];\n\t\t\t\t\ti = matcherOut.length;\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( (elem = matcherOut[i]) ) {\n\t\t\t\t\t\t\t// Restore matcherIn since elem is not yet a final match\n\t\t\t\t\t\t\ttemp.push( (matcherIn[i] = elem) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tpostFinder( null, (matcherOut = []), temp, xml );\n\t\t\t\t}\n\n\t\t\t\t// Move matched elements from seed to results to keep them synchronized\n\t\t\t\ti = matcherOut.length;\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\tif ( (elem = matcherOut[i]) &&\n\t\t\t\t\t\t(temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {\n\n\t\t\t\t\t\tseed[temp] = !(results[temp] = elem);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Add elements to results, through postFinder if defined\n\t\t} else {\n\t\t\tmatcherOut = condense(\n\t\t\t\tmatcherOut === results ?\n\t\t\t\t\tmatcherOut.splice( preexisting, matcherOut.length ) :\n\t\t\t\t\tmatcherOut\n\t\t\t);\n\t\t\tif ( postFinder ) {\n\t\t\t\tpostFinder( null, results, matcherOut, xml );\n\t\t\t} else {\n\t\t\t\tpush.apply( results, matcherOut );\n\t\t\t}\n\t\t}\n\t});\n}\n\nfunction matcherFromTokens( tokens ) {\n\tvar checkContext, matcher, j,\n\t\tlen = tokens.length,\n\t\tleadingRelative = Expr.relative[ tokens[0].type ],\n\t\timplicitRelative = leadingRelative || Expr.relative[\" \"],\n\t\ti = leadingRelative ? 1 : 0,\n\n\t\t// The foundational matcher ensures that elements are reachable from top-level context(s)\n\t\tmatchContext = addCombinator( function( elem ) {\n\t\t\treturn elem === checkContext;\n\t\t}, implicitRelative, true ),\n\t\tmatchAnyContext = addCombinator( function( elem ) {\n\t\t\treturn indexOf( checkContext, elem ) > -1;\n\t\t}, implicitRelative, true ),\n\t\tmatchers = [ function( elem, context, xml ) {\n\t\t\tvar ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (\n\t\t\t\t(checkContext = context).nodeType ?\n\t\t\t\t\tmatchContext( elem, context, xml ) :\n\t\t\t\t\tmatchAnyContext( elem, context, xml ) );\n\t\t\t// Avoid hanging onto element (issue #299)\n\t\t\tcheckContext = null;\n\t\t\treturn ret;\n\t\t} ];\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( (matcher = Expr.relative[ tokens[i].type ]) ) {\n\t\t\tmatchers = [ addCombinator(elementMatcher( matchers ), matcher) ];\n\t\t} else {\n\t\t\tmatcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );\n\n\t\t\t// Return special upon seeing a positional matcher\n\t\t\tif ( matcher[ expando ] ) {\n\t\t\t\t// Find the next relative operator (if any) for proper handling\n\t\t\t\tj = ++i;\n\t\t\t\tfor ( ; j < len; j++ ) {\n\t\t\t\t\tif ( Expr.relative[ tokens[j].type ] ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn setMatcher(\n\t\t\t\t\ti > 1 && elementMatcher( matchers ),\n\t\t\t\t\ti > 1 && toSelector(\n\t\t\t\t\t\t// If the preceding token was a descendant combinator, insert an implicit any-element `*`\n\t\t\t\t\t\ttokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === \" \" ? \"*\" : \"\" })\n\t\t\t\t\t).replace( rtrim, \"$1\" ),\n\t\t\t\t\tmatcher,\n\t\t\t\t\ti < j && matcherFromTokens( tokens.slice( i, j ) ),\n\t\t\t\t\tj < len && matcherFromTokens( (tokens = tokens.slice( j )) ),\n\t\t\t\t\tj < len && toSelector( tokens )\n\t\t\t\t);\n\t\t\t}\n\t\t\tmatchers.push( matcher );\n\t\t}\n\t}\n\n\treturn elementMatcher( matchers );\n}\n\nfunction matcherFromGroupMatchers( elementMatchers, setMatchers ) {\n\tvar bySet = setMatchers.length > 0,\n\t\tbyElement = elementMatchers.length > 0,\n\t\tsuperMatcher = function( seed, context, xml, results, outermost ) {\n\t\t\tvar elem, j, matcher,\n\t\t\t\tmatchedCount = 0,\n\t\t\t\ti = \"0\",\n\t\t\t\tunmatched = seed && [],\n\t\t\t\tsetMatched = [],\n\t\t\t\tcontextBackup = outermostContext,\n\t\t\t\t// We must always have either seed elements or outermost context\n\t\t\t\telems = seed || byElement && Expr.find[\"TAG\"]( \"*\", outermost ),\n\t\t\t\t// Use integer dirruns iff this is the outermost matcher\n\t\t\t\tdirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),\n\t\t\t\tlen = elems.length;\n\n\t\t\tif ( outermost ) {\n\t\t\t\toutermostContext = context === document || context || outermost;\n\t\t\t}\n\n\t\t\t// Add elements passing elementMatchers directly to results\n\t\t\t// Support: IE<9, Safari\n\t\t\t// Tolerate NodeList properties (IE: \"length\"; Safari: <number>) matching elements by id\n\t\t\tfor ( ; i !== len && (elem = elems[i]) != null; i++ ) {\n\t\t\t\tif ( byElement && elem ) {\n\t\t\t\t\tj = 0;\n\t\t\t\t\tif ( !context && elem.ownerDocument !== document ) {\n\t\t\t\t\t\tsetDocument( elem );\n\t\t\t\t\t\txml = !documentIsHTML;\n\t\t\t\t\t}\n\t\t\t\t\twhile ( (matcher = elementMatchers[j++]) ) {\n\t\t\t\t\t\tif ( matcher( elem, context || document, xml) ) {\n\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( outermost ) {\n\t\t\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Track unmatched elements for set filters\n\t\t\t\tif ( bySet ) {\n\t\t\t\t\t// They will have gone through all possible matchers\n\t\t\t\t\tif ( (elem = !matcher && elem) ) {\n\t\t\t\t\t\tmatchedCount--;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Lengthen the array for every element, matched or not\n\t\t\t\t\tif ( seed ) {\n\t\t\t\t\t\tunmatched.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// `i` is now the count of elements visited above, and adding it to `matchedCount`\n\t\t\t// makes the latter nonnegative.\n\t\t\tmatchedCount += i;\n\n\t\t\t// Apply set filters to unmatched elements\n\t\t\t// NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`\n\t\t\t// equals `i`), unless we didn't visit _any_ elements in the above loop because we have\n\t\t\t// no element matchers and no seed.\n\t\t\t// Incrementing an initially-string \"0\" `i` allows `i` to remain a string only in that\n\t\t\t// case, which will result in a \"00\" `matchedCount` that differs from `i` but is also\n\t\t\t// numerically zero.\n\t\t\tif ( bySet && i !== matchedCount ) {\n\t\t\t\tj = 0;\n\t\t\t\twhile ( (matcher = setMatchers[j++]) ) {\n\t\t\t\t\tmatcher( unmatched, setMatched, context, xml );\n\t\t\t\t}\n\n\t\t\t\tif ( seed ) {\n\t\t\t\t\t// Reintegrate element matches to eliminate the need for sorting\n\t\t\t\t\tif ( matchedCount > 0 ) {\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tif ( !(unmatched[i] || setMatched[i]) ) {\n\t\t\t\t\t\t\t\tsetMatched[i] = pop.call( results );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Discard index placeholder values to get only actual matches\n\t\t\t\t\tsetMatched = condense( setMatched );\n\t\t\t\t}\n\n\t\t\t\t// Add matches to results\n\t\t\t\tpush.apply( results, setMatched );\n\n\t\t\t\t// Seedless set matches succeeding multiple successful matchers stipulate sorting\n\t\t\t\tif ( outermost && !seed && setMatched.length > 0 &&\n\t\t\t\t\t( matchedCount + setMatchers.length ) > 1 ) {\n\n\t\t\t\t\tSizzle.uniqueSort( results );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Override manipulation of globals by nested matchers\n\t\t\tif ( outermost ) {\n\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\toutermostContext = contextBackup;\n\t\t\t}\n\n\t\t\treturn unmatched;\n\t\t};\n\n\treturn bySet ?\n\t\tmarkFunction( superMatcher ) :\n\t\tsuperMatcher;\n}\n\ncompile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {\n\tvar i,\n\t\tsetMatchers = [],\n\t\telementMatchers = [],\n\t\tcached = compilerCache[ selector + \" \" ];\n\n\tif ( !cached ) {\n\t\t// Generate a function of recursive functions that can be used to check each element\n\t\tif ( !match ) {\n\t\t\tmatch = tokenize( selector );\n\t\t}\n\t\ti = match.length;\n\t\twhile ( i-- ) {\n\t\t\tcached = matcherFromTokens( match[i] );\n\t\t\tif ( cached[ expando ] ) {\n\t\t\t\tsetMatchers.push( cached );\n\t\t\t} else {\n\t\t\t\telementMatchers.push( cached );\n\t\t\t}\n\t\t}\n\n\t\t// Cache the compiled function\n\t\tcached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );\n\n\t\t// Save selector and tokenization\n\t\tcached.selector = selector;\n\t}\n\treturn cached;\n};\n\n/**\n * A low-level selection function that works with Sizzle's compiled\n *  selector functions\n * @param {String|Function} selector A selector or a pre-compiled\n *  selector function built with Sizzle.compile\n * @param {Element} context\n * @param {Array} [results]\n * @param {Array} [seed] A set of elements to match against\n */\nselect = Sizzle.select = function( selector, context, results, seed ) {\n\tvar i, tokens, token, type, find,\n\t\tcompiled = typeof selector === \"function\" && selector,\n\t\tmatch = !seed && tokenize( (selector = compiled.selector || selector) );\n\n\tresults = results || [];\n\n\t// Try to minimize operations if there is only one selector in the list and no seed\n\t// (the latter of which guarantees us context)\n\tif ( match.length === 1 ) {\n\n\t\t// Reduce context if the leading compound selector is an ID\n\t\ttokens = match[0] = match[0].slice( 0 );\n\t\tif ( tokens.length > 2 && (token = tokens[0]).type === \"ID\" &&\n\t\t\t\tcontext.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) {\n\n\t\t\tcontext = ( Expr.find[\"ID\"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];\n\t\t\tif ( !context ) {\n\t\t\t\treturn results;\n\n\t\t\t// Precompiled matchers will still verify ancestry, so step up a level\n\t\t\t} else if ( compiled ) {\n\t\t\t\tcontext = context.parentNode;\n\t\t\t}\n\n\t\t\tselector = selector.slice( tokens.shift().value.length );\n\t\t}\n\n\t\t// Fetch a seed set for right-to-left matching\n\t\ti = matchExpr[\"needsContext\"].test( selector ) ? 0 : tokens.length;\n\t\twhile ( i-- ) {\n\t\t\ttoken = tokens[i];\n\n\t\t\t// Abort if we hit a combinator\n\t\t\tif ( Expr.relative[ (type = token.type) ] ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( (find = Expr.find[ type ]) ) {\n\t\t\t\t// Search, expanding context for leading sibling combinators\n\t\t\t\tif ( (seed = find(\n\t\t\t\t\ttoken.matches[0].replace( runescape, funescape ),\n\t\t\t\t\trsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context\n\t\t\t\t)) ) {\n\n\t\t\t\t\t// If seed is empty or no tokens remain, we can return early\n\t\t\t\t\ttokens.splice( i, 1 );\n\t\t\t\t\tselector = seed.length && toSelector( tokens );\n\t\t\t\t\tif ( !selector ) {\n\t\t\t\t\t\tpush.apply( results, seed );\n\t\t\t\t\t\treturn results;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Compile and execute a filtering function if one is not provided\n\t// Provide `match` to avoid retokenization if we modified the selector above\n\t( compiled || compile( selector, match ) )(\n\t\tseed,\n\t\tcontext,\n\t\t!documentIsHTML,\n\t\tresults,\n\t\t!context || rsibling.test( selector ) && testContext( context.parentNode ) || context\n\t);\n\treturn results;\n};\n\n// One-time assignments\n\n// Sort stability\nsupport.sortStable = expando.split(\"\").sort( sortOrder ).join(\"\") === expando;\n\n// Support: Chrome 14-35+\n// Always assume duplicates if they aren't passed to the comparison function\nsupport.detectDuplicates = !!hasDuplicate;\n\n// Initialize against the default document\nsetDocument();\n\n// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)\n// Detached nodes confoundingly follow *each other*\nsupport.sortDetached = assert(function( el ) {\n\t// Should return 1, but returns 4 (following)\n\treturn el.compareDocumentPosition( document.createElement(\"fieldset\") ) & 1;\n});\n\n// Support: IE<8\n// Prevent attribute/property \"interpolation\"\n// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx\nif ( !assert(function( el ) {\n\tel.innerHTML = \"<a href='#'></a>\";\n\treturn el.firstChild.getAttribute(\"href\") === \"#\" ;\n}) ) {\n\taddHandle( \"type|href|height|width\", function( elem, name, isXML ) {\n\t\tif ( !isXML ) {\n\t\t\treturn elem.getAttribute( name, name.toLowerCase() === \"type\" ? 1 : 2 );\n\t\t}\n\t});\n}\n\n// Support: IE<9\n// Use defaultValue in place of getAttribute(\"value\")\nif ( !support.attributes || !assert(function( el ) {\n\tel.innerHTML = \"<input/>\";\n\tel.firstChild.setAttribute( \"value\", \"\" );\n\treturn el.firstChild.getAttribute( \"value\" ) === \"\";\n}) ) {\n\taddHandle( \"value\", function( elem, name, isXML ) {\n\t\tif ( !isXML && elem.nodeName.toLowerCase() === \"input\" ) {\n\t\t\treturn elem.defaultValue;\n\t\t}\n\t});\n}\n\n// Support: IE<9\n// Use getAttributeNode to fetch booleans when getAttribute lies\nif ( !assert(function( el ) {\n\treturn el.getAttribute(\"disabled\") == null;\n}) ) {\n\taddHandle( booleans, function( elem, name, isXML ) {\n\t\tvar val;\n\t\tif ( !isXML ) {\n\t\t\treturn elem[ name ] === true ? name.toLowerCase() :\n\t\t\t\t\t(val = elem.getAttributeNode( name )) && val.specified ?\n\t\t\t\t\tval.value :\n\t\t\t\tnull;\n\t\t}\n\t});\n}\n\nreturn Sizzle;\n\n})( window );\n\n\n\njQuery.find = Sizzle;\njQuery.expr = Sizzle.selectors;\n\n// Deprecated\njQuery.expr[ \":\" ] = jQuery.expr.pseudos;\njQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;\njQuery.text = Sizzle.getText;\njQuery.isXMLDoc = Sizzle.isXML;\njQuery.contains = Sizzle.contains;\njQuery.escapeSelector = Sizzle.escape;\n\n\n\n\nvar dir = function( elem, dir, until ) {\n\tvar matched = [],\n\t\ttruncate = until !== undefined;\n\n\twhile ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {\n\t\tif ( elem.nodeType === 1 ) {\n\t\t\tif ( truncate && jQuery( elem ).is( until ) ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tmatched.push( elem );\n\t\t}\n\t}\n\treturn matched;\n};\n\n\nvar siblings = function( n, elem ) {\n\tvar matched = [];\n\n\tfor ( ; n; n = n.nextSibling ) {\n\t\tif ( n.nodeType === 1 && n !== elem ) {\n\t\t\tmatched.push( n );\n\t\t}\n\t}\n\n\treturn matched;\n};\n\n\nvar rneedsContext = jQuery.expr.match.needsContext;\n\n\n\nfunction nodeName( elem, name ) {\n\n  return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();\n\n};\nvar rsingleTag = ( /^<([a-z][^\\/\\0>:\\x20\\t\\r\\n\\f]*)[\\x20\\t\\r\\n\\f]*\\/?>(?:<\\/\\1>|)$/i );\n\n\n\n// Implement the identical functionality for filter and not\nfunction winnow( elements, qualifier, not ) {\n\tif ( isFunction( qualifier ) ) {\n\t\treturn jQuery.grep( elements, function( elem, i ) {\n\t\t\treturn !!qualifier.call( elem, i, elem ) !== not;\n\t\t} );\n\t}\n\n\t// Single element\n\tif ( qualifier.nodeType ) {\n\t\treturn jQuery.grep( elements, function( elem ) {\n\t\t\treturn ( elem === qualifier ) !== not;\n\t\t} );\n\t}\n\n\t// Arraylike of elements (jQuery, arguments, Array)\n\tif ( typeof qualifier !== \"string\" ) {\n\t\treturn jQuery.grep( elements, function( elem ) {\n\t\t\treturn ( indexOf.call( qualifier, elem ) > -1 ) !== not;\n\t\t} );\n\t}\n\n\t// Filtered directly for both simple and complex selectors\n\treturn jQuery.filter( qualifier, elements, not );\n}\n\njQuery.filter = function( expr, elems, not ) {\n\tvar elem = elems[ 0 ];\n\n\tif ( not ) {\n\t\texpr = \":not(\" + expr + \")\";\n\t}\n\n\tif ( elems.length === 1 && elem.nodeType === 1 ) {\n\t\treturn jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];\n\t}\n\n\treturn jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {\n\t\treturn elem.nodeType === 1;\n\t} ) );\n};\n\njQuery.fn.extend( {\n\tfind: function( selector ) {\n\t\tvar i, ret,\n\t\t\tlen = this.length,\n\t\t\tself = this;\n\n\t\tif ( typeof selector !== \"string\" ) {\n\t\t\treturn this.pushStack( jQuery( selector ).filter( function() {\n\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\tif ( jQuery.contains( self[ i ], this ) ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} ) );\n\t\t}\n\n\t\tret = this.pushStack( [] );\n\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tjQuery.find( selector, self[ i ], ret );\n\t\t}\n\n\t\treturn len > 1 ? jQuery.uniqueSort( ret ) : ret;\n\t},\n\tfilter: function( selector ) {\n\t\treturn this.pushStack( winnow( this, selector || [], false ) );\n\t},\n\tnot: function( selector ) {\n\t\treturn this.pushStack( winnow( this, selector || [], true ) );\n\t},\n\tis: function( selector ) {\n\t\treturn !!winnow(\n\t\t\tthis,\n\n\t\t\t// If this is a positional/relative selector, check membership in the returned set\n\t\t\t// so $(\"p:first\").is(\"p:last\") won't return true for a doc with two \"p\".\n\t\t\ttypeof selector === \"string\" && rneedsContext.test( selector ) ?\n\t\t\t\tjQuery( selector ) :\n\t\t\t\tselector || [],\n\t\t\tfalse\n\t\t).length;\n\t}\n} );\n\n\n// Initialize a jQuery object\n\n\n// A central reference to the root jQuery(document)\nvar rootjQuery,\n\n\t// A simple way to check for HTML strings\n\t// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)\n\t// Strict HTML recognition (#11290: must start with <)\n\t// Shortcut simple #id case for speed\n\trquickExpr = /^(?:\\s*(<[\\w\\W]+>)[^>]*|#([\\w-]+))$/,\n\n\tinit = jQuery.fn.init = function( selector, context, root ) {\n\t\tvar match, elem;\n\n\t\t// HANDLE: $(\"\"), $(null), $(undefined), $(false)\n\t\tif ( !selector ) {\n\t\t\treturn this;\n\t\t}\n\n\t\t// Method init() accepts an alternate rootjQuery\n\t\t// so migrate can support jQuery.sub (gh-2101)\n\t\troot = root || rootjQuery;\n\n\t\t// Handle HTML strings\n\t\tif ( typeof selector === \"string\" ) {\n\t\t\tif ( selector[ 0 ] === \"<\" &&\n\t\t\t\tselector[ selector.length - 1 ] === \">\" &&\n\t\t\t\tselector.length >= 3 ) {\n\n\t\t\t\t// Assume that strings that start and end with <> are HTML and skip the regex check\n\t\t\t\tmatch = [ null, selector, null ];\n\n\t\t\t} else {\n\t\t\t\tmatch = rquickExpr.exec( selector );\n\t\t\t}\n\n\t\t\t// Match html or make sure no context is specified for #id\n\t\t\tif ( match && ( match[ 1 ] || !context ) ) {\n\n\t\t\t\t// HANDLE: $(html) -> $(array)\n\t\t\t\tif ( match[ 1 ] ) {\n\t\t\t\t\tcontext = context instanceof jQuery ? context[ 0 ] : context;\n\n\t\t\t\t\t// Option to run scripts is true for back-compat\n\t\t\t\t\t// Intentionally let the error be thrown if parseHTML is not present\n\t\t\t\t\tjQuery.merge( this, jQuery.parseHTML(\n\t\t\t\t\t\tmatch[ 1 ],\n\t\t\t\t\t\tcontext && context.nodeType ? context.ownerDocument || context : document,\n\t\t\t\t\t\ttrue\n\t\t\t\t\t) );\n\n\t\t\t\t\t// HANDLE: $(html, props)\n\t\t\t\t\tif ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {\n\t\t\t\t\t\tfor ( match in context ) {\n\n\t\t\t\t\t\t\t// Properties of context are called as methods if possible\n\t\t\t\t\t\t\tif ( isFunction( this[ match ] ) ) {\n\t\t\t\t\t\t\t\tthis[ match ]( context[ match ] );\n\n\t\t\t\t\t\t\t// ...and otherwise set as attributes\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.attr( match, context[ match ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this;\n\n\t\t\t\t// HANDLE: $(#id)\n\t\t\t\t} else {\n\t\t\t\t\telem = document.getElementById( match[ 2 ] );\n\n\t\t\t\t\tif ( elem ) {\n\n\t\t\t\t\t\t// Inject the element directly into the jQuery object\n\t\t\t\t\t\tthis[ 0 ] = elem;\n\t\t\t\t\t\tthis.length = 1;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\n\t\t\t// HANDLE: $(expr, $(...))\n\t\t\t} else if ( !context || context.jquery ) {\n\t\t\t\treturn ( context || root ).find( selector );\n\n\t\t\t// HANDLE: $(expr, context)\n\t\t\t// (which is just equivalent to: $(context).find(expr)\n\t\t\t} else {\n\t\t\t\treturn this.constructor( context ).find( selector );\n\t\t\t}\n\n\t\t// HANDLE: $(DOMElement)\n\t\t} else if ( selector.nodeType ) {\n\t\t\tthis[ 0 ] = selector;\n\t\t\tthis.length = 1;\n\t\t\treturn this;\n\n\t\t// HANDLE: $(function)\n\t\t// Shortcut for document ready\n\t\t} else if ( isFunction( selector ) ) {\n\t\t\treturn root.ready !== undefined ?\n\t\t\t\troot.ready( selector ) :\n\n\t\t\t\t// Execute immediately if ready is not present\n\t\t\t\tselector( jQuery );\n\t\t}\n\n\t\treturn jQuery.makeArray( selector, this );\n\t};\n\n// Give the init function the jQuery prototype for later instantiation\ninit.prototype = jQuery.fn;\n\n// Initialize central reference\nrootjQuery = jQuery( document );\n\n\nvar rparentsprev = /^(?:parents|prev(?:Until|All))/,\n\n\t// Methods guaranteed to produce a unique set when starting from a unique set\n\tguaranteedUnique = {\n\t\tchildren: true,\n\t\tcontents: true,\n\t\tnext: true,\n\t\tprev: true\n\t};\n\njQuery.fn.extend( {\n\thas: function( target ) {\n\t\tvar targets = jQuery( target, this ),\n\t\t\tl = targets.length;\n\n\t\treturn this.filter( function() {\n\t\t\tvar i = 0;\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tif ( jQuery.contains( this, targets[ i ] ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t},\n\n\tclosest: function( selectors, context ) {\n\t\tvar cur,\n\t\t\ti = 0,\n\t\t\tl = this.length,\n\t\t\tmatched = [],\n\t\t\ttargets = typeof selectors !== \"string\" && jQuery( selectors );\n\n\t\t// Positional selectors never match, since there's no _selection_ context\n\t\tif ( !rneedsContext.test( selectors ) ) {\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tfor ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {\n\n\t\t\t\t\t// Always skip document fragments\n\t\t\t\t\tif ( cur.nodeType < 11 && ( targets ?\n\t\t\t\t\t\ttargets.index( cur ) > -1 :\n\n\t\t\t\t\t\t// Don't pass non-elements to Sizzle\n\t\t\t\t\t\tcur.nodeType === 1 &&\n\t\t\t\t\t\t\tjQuery.find.matchesSelector( cur, selectors ) ) ) {\n\n\t\t\t\t\t\tmatched.push( cur );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );\n\t},\n\n\t// Determine the position of an element within the set\n\tindex: function( elem ) {\n\n\t\t// No argument, return index in parent\n\t\tif ( !elem ) {\n\t\t\treturn ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;\n\t\t}\n\n\t\t// Index in selector\n\t\tif ( typeof elem === \"string\" ) {\n\t\t\treturn indexOf.call( jQuery( elem ), this[ 0 ] );\n\t\t}\n\n\t\t// Locate the position of the desired element\n\t\treturn indexOf.call( this,\n\n\t\t\t// If it receives a jQuery object, the first element is used\n\t\t\telem.jquery ? elem[ 0 ] : elem\n\t\t);\n\t},\n\n\tadd: function( selector, context ) {\n\t\treturn this.pushStack(\n\t\t\tjQuery.uniqueSort(\n\t\t\t\tjQuery.merge( this.get(), jQuery( selector, context ) )\n\t\t\t)\n\t\t);\n\t},\n\n\taddBack: function( selector ) {\n\t\treturn this.add( selector == null ?\n\t\t\tthis.prevObject : this.prevObject.filter( selector )\n\t\t);\n\t}\n} );\n\nfunction sibling( cur, dir ) {\n\twhile ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}\n\treturn cur;\n}\n\njQuery.each( {\n\tparent: function( elem ) {\n\t\tvar parent = elem.parentNode;\n\t\treturn parent && parent.nodeType !== 11 ? parent : null;\n\t},\n\tparents: function( elem ) {\n\t\treturn dir( elem, \"parentNode\" );\n\t},\n\tparentsUntil: function( elem, i, until ) {\n\t\treturn dir( elem, \"parentNode\", until );\n\t},\n\tnext: function( elem ) {\n\t\treturn sibling( elem, \"nextSibling\" );\n\t},\n\tprev: function( elem ) {\n\t\treturn sibling( elem, \"previousSibling\" );\n\t},\n\tnextAll: function( elem ) {\n\t\treturn dir( elem, \"nextSibling\" );\n\t},\n\tprevAll: function( elem ) {\n\t\treturn dir( elem, \"previousSibling\" );\n\t},\n\tnextUntil: function( elem, i, until ) {\n\t\treturn dir( elem, \"nextSibling\", until );\n\t},\n\tprevUntil: function( elem, i, until ) {\n\t\treturn dir( elem, \"previousSibling\", until );\n\t},\n\tsiblings: function( elem ) {\n\t\treturn siblings( ( elem.parentNode || {} ).firstChild, elem );\n\t},\n\tchildren: function( elem ) {\n\t\treturn siblings( elem.firstChild );\n\t},\n\tcontents: function( elem ) {\n\t\tif ( typeof elem.contentDocument !== \"undefined\" ) {\n\t\t\treturn elem.contentDocument;\n\t\t}\n\n\t\t// Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only\n\t\t// Treat the template element as a regular one in browsers that\n\t\t// don't support it.\n\t\tif ( nodeName( elem, \"template\" ) ) {\n\t\t\telem = elem.content || elem;\n\t\t}\n\n\t\treturn jQuery.merge( [], elem.childNodes );\n\t}\n}, function( name, fn ) {\n\tjQuery.fn[ name ] = function( until, selector ) {\n\t\tvar matched = jQuery.map( this, fn, until );\n\n\t\tif ( name.slice( -5 ) !== \"Until\" ) {\n\t\t\tselector = until;\n\t\t}\n\n\t\tif ( selector && typeof selector === \"string\" ) {\n\t\t\tmatched = jQuery.filter( selector, matched );\n\t\t}\n\n\t\tif ( this.length > 1 ) {\n\n\t\t\t// Remove duplicates\n\t\t\tif ( !guaranteedUnique[ name ] ) {\n\t\t\t\tjQuery.uniqueSort( matched );\n\t\t\t}\n\n\t\t\t// Reverse order for parents* and prev-derivatives\n\t\t\tif ( rparentsprev.test( name ) ) {\n\t\t\t\tmatched.reverse();\n\t\t\t}\n\t\t}\n\n\t\treturn this.pushStack( matched );\n\t};\n} );\nvar rnothtmlwhite = ( /[^\\x20\\t\\r\\n\\f]+/g );\n\n\n\n// Convert String-formatted options into Object-formatted ones\nfunction createOptions( options ) {\n\tvar object = {};\n\tjQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t} );\n\treturn object;\n}\n\n/*\n * Create a callback list using the following parameters:\n *\n *\toptions: an optional list of space-separated options that will change how\n *\t\t\tthe callback list behaves or a more traditional option object\n *\n * By default a callback list will act like an event callback list and can be\n * \"fired\" multiple times.\n *\n * Possible options:\n *\n *\tonce:\t\t\twill ensure the callback list can only be fired once (like a Deferred)\n *\n *\tmemory:\t\t\twill keep track of previous values and will call any callback added\n *\t\t\t\t\tafter the list has been fired right away with the latest \"memorized\"\n *\t\t\t\t\tvalues (like a Deferred)\n *\n *\tunique:\t\t\twill ensure a callback can only be added once (no duplicate in the list)\n *\n *\tstopOnFalse:\tinterrupt callings when a callback returns false\n *\n */\njQuery.Callbacks = function( options ) {\n\n\t// Convert options from String-formatted to Object-formatted if needed\n\t// (we check in cache first)\n\toptions = typeof options === \"string\" ?\n\t\tcreateOptions( options ) :\n\t\tjQuery.extend( {}, options );\n\n\tvar // Flag to know if list is currently firing\n\t\tfiring,\n\n\t\t// Last fire value for non-forgettable lists\n\t\tmemory,\n\n\t\t// Flag to know if list was already fired\n\t\tfired,\n\n\t\t// Flag to prevent firing\n\t\tlocked,\n\n\t\t// Actual callback list\n\t\tlist = [],\n\n\t\t// Queue of execution data for repeatable lists\n\t\tqueue = [],\n\n\t\t// Index of currently firing callback (modified by add/remove as needed)\n\t\tfiringIndex = -1,\n\n\t\t// Fire callbacks\n\t\tfire = function() {\n\n\t\t\t// Enforce single-firing\n\t\t\tlocked = locked || options.once;\n\n\t\t\t// Execute callbacks for all pending executions,\n\t\t\t// respecting firingIndex overrides and runtime changes\n\t\t\tfired = firing = true;\n\t\t\tfor ( ; queue.length; firingIndex = -1 ) {\n\t\t\t\tmemory = queue.shift();\n\t\t\t\twhile ( ++firingIndex < list.length ) {\n\n\t\t\t\t\t// Run callback and check for early termination\n\t\t\t\t\tif ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&\n\t\t\t\t\t\toptions.stopOnFalse ) {\n\n\t\t\t\t\t\t// Jump to end and forget the data so .add doesn't re-fire\n\t\t\t\t\t\tfiringIndex = list.length;\n\t\t\t\t\t\tmemory = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Forget the data if we're done with it\n\t\t\tif ( !options.memory ) {\n\t\t\t\tmemory = false;\n\t\t\t}\n\n\t\t\tfiring = false;\n\n\t\t\t// Clean up if we're done firing for good\n\t\t\tif ( locked ) {\n\n\t\t\t\t// Keep an empty list if we have data for future add calls\n\t\t\t\tif ( memory ) {\n\t\t\t\t\tlist = [];\n\n\t\t\t\t// Otherwise, this object is spent\n\t\t\t\t} else {\n\t\t\t\t\tlist = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t// Actual Callbacks object\n\t\tself = {\n\n\t\t\t// Add a callback or a collection of callbacks to the list\n\t\t\tadd: function() {\n\t\t\t\tif ( list ) {\n\n\t\t\t\t\t// If we have memory from a past run, we should fire after adding\n\t\t\t\t\tif ( memory && !firing ) {\n\t\t\t\t\t\tfiringIndex = list.length - 1;\n\t\t\t\t\t\tqueue.push( memory );\n\t\t\t\t\t}\n\n\t\t\t\t\t( function add( args ) {\n\t\t\t\t\t\tjQuery.each( args, function( _, arg ) {\n\t\t\t\t\t\t\tif ( isFunction( arg ) ) {\n\t\t\t\t\t\t\t\tif ( !options.unique || !self.has( arg ) ) {\n\t\t\t\t\t\t\t\t\tlist.push( arg );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if ( arg && arg.length && toType( arg ) !== \"string\" ) {\n\n\t\t\t\t\t\t\t\t// Inspect recursively\n\t\t\t\t\t\t\t\tadd( arg );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\t\t\t\t\t} )( arguments );\n\n\t\t\t\t\tif ( memory && !firing ) {\n\t\t\t\t\t\tfire();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Remove a callback from the list\n\t\t\tremove: function() {\n\t\t\t\tjQuery.each( arguments, function( _, arg ) {\n\t\t\t\t\tvar index;\n\t\t\t\t\twhile ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {\n\t\t\t\t\t\tlist.splice( index, 1 );\n\n\t\t\t\t\t\t// Handle firing indexes\n\t\t\t\t\t\tif ( index <= firingIndex ) {\n\t\t\t\t\t\t\tfiringIndex--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Check if a given callback is in the list.\n\t\t\t// If no argument is given, return whether or not list has callbacks attached.\n\t\t\thas: function( fn ) {\n\t\t\t\treturn fn ?\n\t\t\t\t\tjQuery.inArray( fn, list ) > -1 :\n\t\t\t\t\tlist.length > 0;\n\t\t\t},\n\n\t\t\t// Remove all callbacks from the list\n\t\t\tempty: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\tlist = [];\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Disable .fire and .add\n\t\t\t// Abort any current/pending executions\n\t\t\t// Clear all callbacks and values\n\t\t\tdisable: function() {\n\t\t\t\tlocked = queue = [];\n\t\t\t\tlist = memory = \"\";\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\tdisabled: function() {\n\t\t\t\treturn !list;\n\t\t\t},\n\n\t\t\t// Disable .fire\n\t\t\t// Also disable .add unless we have memory (since it would have no effect)\n\t\t\t// Abort any pending executions\n\t\t\tlock: function() {\n\t\t\t\tlocked = queue = [];\n\t\t\t\tif ( !memory && !firing ) {\n\t\t\t\t\tlist = memory = \"\";\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\tlocked: function() {\n\t\t\t\treturn !!locked;\n\t\t\t},\n\n\t\t\t// Call all callbacks with the given context and arguments\n\t\t\tfireWith: function( context, args ) {\n\t\t\t\tif ( !locked ) {\n\t\t\t\t\targs = args || [];\n\t\t\t\t\targs = [ context, args.slice ? args.slice() : args ];\n\t\t\t\t\tqueue.push( args );\n\t\t\t\t\tif ( !firing ) {\n\t\t\t\t\t\tfire();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Call all the callbacks with the given arguments\n\t\t\tfire: function() {\n\t\t\t\tself.fireWith( this, arguments );\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// To know if the callbacks have already been called at least once\n\t\t\tfired: function() {\n\t\t\t\treturn !!fired;\n\t\t\t}\n\t\t};\n\n\treturn self;\n};\n\n\nfunction Identity( v ) {\n\treturn v;\n}\nfunction Thrower( ex ) {\n\tthrow ex;\n}\n\nfunction adoptValue( value, resolve, reject, noValue ) {\n\tvar method;\n\n\ttry {\n\n\t\t// Check for promise aspect first to privilege synchronous behavior\n\t\tif ( value && isFunction( ( method = value.promise ) ) ) {\n\t\t\tmethod.call( value ).done( resolve ).fail( reject );\n\n\t\t// Other thenables\n\t\t} else if ( value && isFunction( ( method = value.then ) ) ) {\n\t\t\tmethod.call( value, resolve, reject );\n\n\t\t// Other non-thenables\n\t\t} else {\n\n\t\t\t// Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:\n\t\t\t// * false: [ value ].slice( 0 ) => resolve( value )\n\t\t\t// * true: [ value ].slice( 1 ) => resolve()\n\t\t\tresolve.apply( undefined, [ value ].slice( noValue ) );\n\t\t}\n\n\t// For Promises/A+, convert exceptions into rejections\n\t// Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in\n\t// Deferred#then to conditionally suppress rejection.\n\t} catch ( value ) {\n\n\t\t// Support: Android 4.0 only\n\t\t// Strict mode functions invoked without .call/.apply get global-object context\n\t\treject.apply( undefined, [ value ] );\n\t}\n}\n\njQuery.extend( {\n\n\tDeferred: function( func ) {\n\t\tvar tuples = [\n\n\t\t\t\t// action, add listener, callbacks,\n\t\t\t\t// ... .then handlers, argument index, [final state]\n\t\t\t\t[ \"notify\", \"progress\", jQuery.Callbacks( \"memory\" ),\n\t\t\t\t\tjQuery.Callbacks( \"memory\" ), 2 ],\n\t\t\t\t[ \"resolve\", \"done\", jQuery.Callbacks( \"once memory\" ),\n\t\t\t\t\tjQuery.Callbacks( \"once memory\" ), 0, \"resolved\" ],\n\t\t\t\t[ \"reject\", \"fail\", jQuery.Callbacks( \"once memory\" ),\n\t\t\t\t\tjQuery.Callbacks( \"once memory\" ), 1, \"rejected\" ]\n\t\t\t],\n\t\t\tstate = \"pending\",\n\t\t\tpromise = {\n\t\t\t\tstate: function() {\n\t\t\t\t\treturn state;\n\t\t\t\t},\n\t\t\t\talways: function() {\n\t\t\t\t\tdeferred.done( arguments ).fail( arguments );\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\t\t\t\t\"catch\": function( fn ) {\n\t\t\t\t\treturn promise.then( null, fn );\n\t\t\t\t},\n\n\t\t\t\t// Keep pipe for back-compat\n\t\t\t\tpipe: function( /* fnDone, fnFail, fnProgress */ ) {\n\t\t\t\t\tvar fns = arguments;\n\n\t\t\t\t\treturn jQuery.Deferred( function( newDefer ) {\n\t\t\t\t\t\tjQuery.each( tuples, function( i, tuple ) {\n\n\t\t\t\t\t\t\t// Map tuples (progress, done, fail) to arguments (done, fail, progress)\n\t\t\t\t\t\t\tvar fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];\n\n\t\t\t\t\t\t\t// deferred.progress(function() { bind to newDefer or newDefer.notify })\n\t\t\t\t\t\t\t// deferred.done(function() { bind to newDefer or newDefer.resolve })\n\t\t\t\t\t\t\t// deferred.fail(function() { bind to newDefer or newDefer.reject })\n\t\t\t\t\t\t\tdeferred[ tuple[ 1 ] ]( function() {\n\t\t\t\t\t\t\t\tvar returned = fn && fn.apply( this, arguments );\n\t\t\t\t\t\t\t\tif ( returned && isFunction( returned.promise ) ) {\n\t\t\t\t\t\t\t\t\treturned.promise()\n\t\t\t\t\t\t\t\t\t\t.progress( newDefer.notify )\n\t\t\t\t\t\t\t\t\t\t.done( newDefer.resolve )\n\t\t\t\t\t\t\t\t\t\t.fail( newDefer.reject );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tnewDefer[ tuple[ 0 ] + \"With\" ](\n\t\t\t\t\t\t\t\t\t\tthis,\n\t\t\t\t\t\t\t\t\t\tfn ? [ returned ] : arguments\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tfns = null;\n\t\t\t\t\t} ).promise();\n\t\t\t\t},\n\t\t\t\tthen: function( onFulfilled, onRejected, onProgress ) {\n\t\t\t\t\tvar maxDepth = 0;\n\t\t\t\t\tfunction resolve( depth, deferred, handler, special ) {\n\t\t\t\t\t\treturn function() {\n\t\t\t\t\t\t\tvar that = this,\n\t\t\t\t\t\t\t\targs = arguments,\n\t\t\t\t\t\t\t\tmightThrow = function() {\n\t\t\t\t\t\t\t\t\tvar returned, then;\n\n\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.3.3.3\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-59\n\t\t\t\t\t\t\t\t\t// Ignore double-resolution attempts\n\t\t\t\t\t\t\t\t\tif ( depth < maxDepth ) {\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\treturned = handler.apply( that, args );\n\n\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.1\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-48\n\t\t\t\t\t\t\t\t\tif ( returned === deferred.promise() ) {\n\t\t\t\t\t\t\t\t\t\tthrow new TypeError( \"Thenable self-resolution\" );\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Support: Promises/A+ sections 2.3.3.1, 3.5\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-54\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-75\n\t\t\t\t\t\t\t\t\t// Retrieve `then` only once\n\t\t\t\t\t\t\t\t\tthen = returned &&\n\n\t\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.4\n\t\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-64\n\t\t\t\t\t\t\t\t\t\t// Only check objects and functions for thenability\n\t\t\t\t\t\t\t\t\t\t( typeof returned === \"object\" ||\n\t\t\t\t\t\t\t\t\t\t\ttypeof returned === \"function\" ) &&\n\t\t\t\t\t\t\t\t\t\treturned.then;\n\n\t\t\t\t\t\t\t\t\t// Handle a returned thenable\n\t\t\t\t\t\t\t\t\tif ( isFunction( then ) ) {\n\n\t\t\t\t\t\t\t\t\t\t// Special processors (notify) just wait for resolution\n\t\t\t\t\t\t\t\t\t\tif ( special ) {\n\t\t\t\t\t\t\t\t\t\t\tthen.call(\n\t\t\t\t\t\t\t\t\t\t\t\treturned,\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Identity, special ),\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Thrower, special )\n\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t// Normal processors (resolve) also hook into progress\n\t\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\t\t// ...and disregard older resolution values\n\t\t\t\t\t\t\t\t\t\t\tmaxDepth++;\n\n\t\t\t\t\t\t\t\t\t\t\tthen.call(\n\t\t\t\t\t\t\t\t\t\t\t\treturned,\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Identity, special ),\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Thrower, special ),\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Identity,\n\t\t\t\t\t\t\t\t\t\t\t\t\tdeferred.notifyWith )\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Handle all other returned values\n\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\t// Only substitute handlers pass on context\n\t\t\t\t\t\t\t\t\t\t// and multiple values (non-spec behavior)\n\t\t\t\t\t\t\t\t\t\tif ( handler !== Identity ) {\n\t\t\t\t\t\t\t\t\t\t\tthat = undefined;\n\t\t\t\t\t\t\t\t\t\t\targs = [ returned ];\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t// Process the value(s)\n\t\t\t\t\t\t\t\t\t\t// Default process is resolve\n\t\t\t\t\t\t\t\t\t\t( special || deferred.resolveWith )( that, args );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t// Only normal processors (resolve) catch and reject exceptions\n\t\t\t\t\t\t\t\tprocess = special ?\n\t\t\t\t\t\t\t\t\tmightThrow :\n\t\t\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\tmightThrow();\n\t\t\t\t\t\t\t\t\t\t} catch ( e ) {\n\n\t\t\t\t\t\t\t\t\t\t\tif ( jQuery.Deferred.exceptionHook ) {\n\t\t\t\t\t\t\t\t\t\t\t\tjQuery.Deferred.exceptionHook( e,\n\t\t\t\t\t\t\t\t\t\t\t\t\tprocess.stackTrace );\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.3.3.4.1\n\t\t\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-61\n\t\t\t\t\t\t\t\t\t\t\t// Ignore post-resolution exceptions\n\t\t\t\t\t\t\t\t\t\t\tif ( depth + 1 >= maxDepth ) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t// Only substitute handlers pass on context\n\t\t\t\t\t\t\t\t\t\t\t\t// and multiple values (non-spec behavior)\n\t\t\t\t\t\t\t\t\t\t\t\tif ( handler !== Thrower ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tthat = undefined;\n\t\t\t\t\t\t\t\t\t\t\t\t\targs = [ e ];\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\tdeferred.rejectWith( that, args );\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.3.3.1\n\t\t\t\t\t\t\t// https://promisesaplus.com/#point-57\n\t\t\t\t\t\t\t// Re-resolve promises immediately to dodge false rejection from\n\t\t\t\t\t\t\t// subsequent errors\n\t\t\t\t\t\t\tif ( depth ) {\n\t\t\t\t\t\t\t\tprocess();\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t// Call an optional hook to record the stack, in case of exception\n\t\t\t\t\t\t\t\t// since it's otherwise lost when execution goes async\n\t\t\t\t\t\t\t\tif ( jQuery.Deferred.getStackHook ) {\n\t\t\t\t\t\t\t\t\tprocess.stackTrace = jQuery.Deferred.getStackHook();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\twindow.setTimeout( process );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t\treturn jQuery.Deferred( function( newDefer ) {\n\n\t\t\t\t\t\t// progress_handlers.add( ... )\n\t\t\t\t\t\ttuples[ 0 ][ 3 ].add(\n\t\t\t\t\t\t\tresolve(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tnewDefer,\n\t\t\t\t\t\t\t\tisFunction( onProgress ) ?\n\t\t\t\t\t\t\t\t\tonProgress :\n\t\t\t\t\t\t\t\t\tIdentity,\n\t\t\t\t\t\t\t\tnewDefer.notifyWith\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// fulfilled_handlers.add( ... )\n\t\t\t\t\t\ttuples[ 1 ][ 3 ].add(\n\t\t\t\t\t\t\tresolve(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tnewDefer,\n\t\t\t\t\t\t\t\tisFunction( onFulfilled ) ?\n\t\t\t\t\t\t\t\t\tonFulfilled :\n\t\t\t\t\t\t\t\t\tIdentity\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// rejected_handlers.add( ... )\n\t\t\t\t\t\ttuples[ 2 ][ 3 ].add(\n\t\t\t\t\t\t\tresolve(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tnewDefer,\n\t\t\t\t\t\t\t\tisFunction( onRejected ) ?\n\t\t\t\t\t\t\t\t\tonRejected :\n\t\t\t\t\t\t\t\t\tThrower\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t} ).promise();\n\t\t\t\t},\n\n\t\t\t\t// Get a promise for this deferred\n\t\t\t\t// If obj is provided, the promise aspect is added to the object\n\t\t\t\tpromise: function( obj ) {\n\t\t\t\t\treturn obj != null ? jQuery.extend( obj, promise ) : promise;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdeferred = {};\n\n\t\t// Add list-specific methods\n\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\tvar list = tuple[ 2 ],\n\t\t\t\tstateString = tuple[ 5 ];\n\n\t\t\t// promise.progress = list.add\n\t\t\t// promise.done = list.add\n\t\t\t// promise.fail = list.add\n\t\t\tpromise[ tuple[ 1 ] ] = list.add;\n\n\t\t\t// Handle state\n\t\t\tif ( stateString ) {\n\t\t\t\tlist.add(\n\t\t\t\t\tfunction() {\n\n\t\t\t\t\t\t// state = \"resolved\" (i.e., fulfilled)\n\t\t\t\t\t\t// state = \"rejected\"\n\t\t\t\t\t\tstate = stateString;\n\t\t\t\t\t},\n\n\t\t\t\t\t// rejected_callbacks.disable\n\t\t\t\t\t// fulfilled_callbacks.disable\n\t\t\t\t\ttuples[ 3 - i ][ 2 ].disable,\n\n\t\t\t\t\t// rejected_handlers.disable\n\t\t\t\t\t// fulfilled_handlers.disable\n\t\t\t\t\ttuples[ 3 - i ][ 3 ].disable,\n\n\t\t\t\t\t// progress_callbacks.lock\n\t\t\t\t\ttuples[ 0 ][ 2 ].lock,\n\n\t\t\t\t\t// progress_handlers.lock\n\t\t\t\t\ttuples[ 0 ][ 3 ].lock\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// progress_handlers.fire\n\t\t\t// fulfilled_handlers.fire\n\t\t\t// rejected_handlers.fire\n\t\t\tlist.add( tuple[ 3 ].fire );\n\n\t\t\t// deferred.notify = function() { deferred.notifyWith(...) }\n\t\t\t// deferred.resolve = function() { deferred.resolveWith(...) }\n\t\t\t// deferred.reject = function() { deferred.rejectWith(...) }\n\t\t\tdeferred[ tuple[ 0 ] ] = function() {\n\t\t\t\tdeferred[ tuple[ 0 ] + \"With\" ]( this === deferred ? undefined : this, arguments );\n\t\t\t\treturn this;\n\t\t\t};\n\n\t\t\t// deferred.notifyWith = list.fireWith\n\t\t\t// deferred.resolveWith = list.fireWith\n\t\t\t// deferred.rejectWith = list.fireWith\n\t\t\tdeferred[ tuple[ 0 ] + \"With\" ] = list.fireWith;\n\t\t} );\n\n\t\t// Make the deferred a promise\n\t\tpromise.promise( deferred );\n\n\t\t// Call given func if any\n\t\tif ( func ) {\n\t\t\tfunc.call( deferred, deferred );\n\t\t}\n\n\t\t// All done!\n\t\treturn deferred;\n\t},\n\n\t// Deferred helper\n\twhen: function( singleValue ) {\n\t\tvar\n\n\t\t\t// count of uncompleted subordinates\n\t\t\tremaining = arguments.length,\n\n\t\t\t// count of unprocessed arguments\n\t\t\ti = remaining,\n\n\t\t\t// subordinate fulfillment data\n\t\t\tresolveContexts = Array( i ),\n\t\t\tresolveValues = slice.call( arguments ),\n\n\t\t\t// the master Deferred\n\t\t\tmaster = jQuery.Deferred(),\n\n\t\t\t// subordinate callback factory\n\t\t\tupdateFunc = function( i ) {\n\t\t\t\treturn function( value ) {\n\t\t\t\t\tresolveContexts[ i ] = this;\n\t\t\t\t\tresolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;\n\t\t\t\t\tif ( !( --remaining ) ) {\n\t\t\t\t\t\tmaster.resolveWith( resolveContexts, resolveValues );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t};\n\n\t\t// Single- and empty arguments are adopted like Promise.resolve\n\t\tif ( remaining <= 1 ) {\n\t\t\tadoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject,\n\t\t\t\t!remaining );\n\n\t\t\t// Use .then() to unwrap secondary thenables (cf. gh-3000)\n\t\t\tif ( master.state() === \"pending\" ||\n\t\t\t\tisFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {\n\n\t\t\t\treturn master.then();\n\t\t\t}\n\t\t}\n\n\t\t// Multiple arguments are aggregated like Promise.all array elements\n\t\twhile ( i-- ) {\n\t\t\tadoptValue( resolveValues[ i ], updateFunc( i ), master.reject );\n\t\t}\n\n\t\treturn master.promise();\n\t}\n} );\n\n\n// These usually indicate a programmer mistake during development,\n// warn about them ASAP rather than swallowing them by default.\nvar rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;\n\njQuery.Deferred.exceptionHook = function( error, stack ) {\n\n\t// Support: IE 8 - 9 only\n\t// Console exists when dev tools are open, which can happen at any time\n\tif ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {\n\t\twindow.console.warn( \"jQuery.Deferred exception: \" + error.message, error.stack, stack );\n\t}\n};\n\n\n\n\njQuery.readyException = function( error ) {\n\twindow.setTimeout( function() {\n\t\tthrow error;\n\t} );\n};\n\n\n\n\n// The deferred used on DOM ready\nvar readyList = jQuery.Deferred();\n\njQuery.fn.ready = function( fn ) {\n\n\treadyList\n\t\t.then( fn )\n\n\t\t// Wrap jQuery.readyException in a function so that the lookup\n\t\t// happens at the time of error handling instead of callback\n\t\t// registration.\n\t\t.catch( function( error ) {\n\t\t\tjQuery.readyException( error );\n\t\t} );\n\n\treturn this;\n};\n\njQuery.extend( {\n\n\t// Is the DOM ready to be used? Set to true once it occurs.\n\tisReady: false,\n\n\t// A counter to track how many items to wait for before\n\t// the ready event fires. See #6781\n\treadyWait: 1,\n\n\t// Handle when the DOM is ready\n\tready: function( wait ) {\n\n\t\t// Abort if there are pending holds or we're already ready\n\t\tif ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Remember that the DOM is ready\n\t\tjQuery.isReady = true;\n\n\t\t// If a normal DOM Ready event fired, decrement, and wait if need be\n\t\tif ( wait !== true && --jQuery.readyWait > 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If there are functions bound, to execute\n\t\treadyList.resolveWith( document, [ jQuery ] );\n\t}\n} );\n\njQuery.ready.then = readyList.then;\n\n// The ready event handler and self cleanup method\nfunction completed() {\n\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\twindow.removeEventListener( \"load\", completed );\n\tjQuery.ready();\n}\n\n// Catch cases where $(document).ready() is called\n// after the browser event has already occurred.\n// Support: IE <=9 - 10 only\n// Older IE sometimes signals \"interactive\" too soon\nif ( document.readyState === \"complete\" ||\n\t( document.readyState !== \"loading\" && !document.documentElement.doScroll ) ) {\n\n\t// Handle it asynchronously to allow scripts the opportunity to delay ready\n\twindow.setTimeout( jQuery.ready );\n\n} else {\n\n\t// Use the handy event callback\n\tdocument.addEventListener( \"DOMContentLoaded\", completed );\n\n\t// A fallback to window.onload, that will always work\n\twindow.addEventListener( \"load\", completed );\n}\n\n\n\n\n// Multifunctional method to get and set values of a collection\n// The value/s can optionally be executed if it's a function\nvar access = function( elems, fn, key, value, chainable, emptyGet, raw ) {\n\tvar i = 0,\n\t\tlen = elems.length,\n\t\tbulk = key == null;\n\n\t// Sets many values\n\tif ( toType( key ) === \"object\" ) {\n\t\tchainable = true;\n\t\tfor ( i in key ) {\n\t\t\taccess( elems, fn, i, key[ i ], true, emptyGet, raw );\n\t\t}\n\n\t// Sets one value\n\t} else if ( value !== undefined ) {\n\t\tchainable = true;\n\n\t\tif ( !isFunction( value ) ) {\n\t\t\traw = true;\n\t\t}\n\n\t\tif ( bulk ) {\n\n\t\t\t// Bulk operations run against the entire set\n\t\t\tif ( raw ) {\n\t\t\t\tfn.call( elems, value );\n\t\t\t\tfn = null;\n\n\t\t\t// ...except when executing function values\n\t\t\t} else {\n\t\t\t\tbulk = fn;\n\t\t\t\tfn = function( elem, key, value ) {\n\t\t\t\t\treturn bulk.call( jQuery( elem ), value );\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tif ( fn ) {\n\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\tfn(\n\t\t\t\t\telems[ i ], key, raw ?\n\t\t\t\t\tvalue :\n\t\t\t\t\tvalue.call( elems[ i ], i, fn( elems[ i ], key ) )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( chainable ) {\n\t\treturn elems;\n\t}\n\n\t// Gets\n\tif ( bulk ) {\n\t\treturn fn.call( elems );\n\t}\n\n\treturn len ? fn( elems[ 0 ], key ) : emptyGet;\n};\n\n\n// Matches dashed string for camelizing\nvar rmsPrefix = /^-ms-/,\n\trdashAlpha = /-([a-z])/g;\n\n// Used by camelCase as callback to replace()\nfunction fcamelCase( all, letter ) {\n\treturn letter.toUpperCase();\n}\n\n// Convert dashed to camelCase; used by the css and data modules\n// Support: IE <=9 - 11, Edge 12 - 15\n// Microsoft forgot to hump their vendor prefix (#9572)\nfunction camelCase( string ) {\n\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n}\nvar acceptData = function( owner ) {\n\n\t// Accepts only:\n\t//  - Node\n\t//    - Node.ELEMENT_NODE\n\t//    - Node.DOCUMENT_NODE\n\t//  - Object\n\t//    - Any\n\treturn owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );\n};\n\n\n\n\nfunction Data() {\n\tthis.expando = jQuery.expando + Data.uid++;\n}\n\nData.uid = 1;\n\nData.prototype = {\n\n\tcache: function( owner ) {\n\n\t\t// Check if the owner object already has a cache\n\t\tvar value = owner[ this.expando ];\n\n\t\t// If not, create one\n\t\tif ( !value ) {\n\t\t\tvalue = {};\n\n\t\t\t// We can accept data for non-element nodes in modern browsers,\n\t\t\t// but we should not, see #8335.\n\t\t\t// Always return an empty object.\n\t\t\tif ( acceptData( owner ) ) {\n\n\t\t\t\t// If it is a node unlikely to be stringify-ed or looped over\n\t\t\t\t// use plain assignment\n\t\t\t\tif ( owner.nodeType ) {\n\t\t\t\t\towner[ this.expando ] = value;\n\n\t\t\t\t// Otherwise secure it in a non-enumerable property\n\t\t\t\t// configurable must be true to allow the property to be\n\t\t\t\t// deleted when data is removed\n\t\t\t\t} else {\n\t\t\t\t\tObject.defineProperty( owner, this.expando, {\n\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\tconfigurable: true\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn value;\n\t},\n\tset: function( owner, data, value ) {\n\t\tvar prop,\n\t\t\tcache = this.cache( owner );\n\n\t\t// Handle: [ owner, key, value ] args\n\t\t// Always use camelCase key (gh-2257)\n\t\tif ( typeof data === \"string\" ) {\n\t\t\tcache[ camelCase( data ) ] = value;\n\n\t\t// Handle: [ owner, { properties } ] args\n\t\t} else {\n\n\t\t\t// Copy the properties one-by-one to the cache object\n\t\t\tfor ( prop in data ) {\n\t\t\t\tcache[ camelCase( prop ) ] = data[ prop ];\n\t\t\t}\n\t\t}\n\t\treturn cache;\n\t},\n\tget: function( owner, key ) {\n\t\treturn key === undefined ?\n\t\t\tthis.cache( owner ) :\n\n\t\t\t// Always use camelCase key (gh-2257)\n\t\t\towner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ];\n\t},\n\taccess: function( owner, key, value ) {\n\n\t\t// In cases where either:\n\t\t//\n\t\t//   1. No key was specified\n\t\t//   2. A string key was specified, but no value provided\n\t\t//\n\t\t// Take the \"read\" path and allow the get method to determine\n\t\t// which value to return, respectively either:\n\t\t//\n\t\t//   1. The entire cache object\n\t\t//   2. The data stored at the key\n\t\t//\n\t\tif ( key === undefined ||\n\t\t\t\t( ( key && typeof key === \"string\" ) && value === undefined ) ) {\n\n\t\t\treturn this.get( owner, key );\n\t\t}\n\n\t\t// When the key is not a string, or both a key and value\n\t\t// are specified, set or extend (existing objects) with either:\n\t\t//\n\t\t//   1. An object of properties\n\t\t//   2. A key and value\n\t\t//\n\t\tthis.set( owner, key, value );\n\n\t\t// Since the \"set\" path can have two possible entry points\n\t\t// return the expected data based on which path was taken[*]\n\t\treturn value !== undefined ? value : key;\n\t},\n\tremove: function( owner, key ) {\n\t\tvar i,\n\t\t\tcache = owner[ this.expando ];\n\n\t\tif ( cache === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( key !== undefined ) {\n\n\t\t\t// Support array or space separated string of keys\n\t\t\tif ( Array.isArray( key ) ) {\n\n\t\t\t\t// If key is an array of keys...\n\t\t\t\t// We always set camelCase keys, so remove that.\n\t\t\t\tkey = key.map( camelCase );\n\t\t\t} else {\n\t\t\t\tkey = camelCase( key );\n\n\t\t\t\t// If a key with the spaces exists, use it.\n\t\t\t\t// Otherwise, create an array by matching non-whitespace\n\t\t\t\tkey = key in cache ?\n\t\t\t\t\t[ key ] :\n\t\t\t\t\t( key.match( rnothtmlwhite ) || [] );\n\t\t\t}\n\n\t\t\ti = key.length;\n\n\t\t\twhile ( i-- ) {\n\t\t\t\tdelete cache[ key[ i ] ];\n\t\t\t}\n\t\t}\n\n\t\t// Remove the expando if there's no more data\n\t\tif ( key === undefined || jQuery.isEmptyObject( cache ) ) {\n\n\t\t\t// Support: Chrome <=35 - 45\n\t\t\t// Webkit & Blink performance suffers when deleting properties\n\t\t\t// from DOM nodes, so set to undefined instead\n\t\t\t// https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)\n\t\t\tif ( owner.nodeType ) {\n\t\t\t\towner[ this.expando ] = undefined;\n\t\t\t} else {\n\t\t\t\tdelete owner[ this.expando ];\n\t\t\t}\n\t\t}\n\t},\n\thasData: function( owner ) {\n\t\tvar cache = owner[ this.expando ];\n\t\treturn cache !== undefined && !jQuery.isEmptyObject( cache );\n\t}\n};\nvar dataPriv = new Data();\n\nvar dataUser = new Data();\n\n\n\n//\tImplementation Summary\n//\n//\t1. Enforce API surface and semantic compatibility with 1.9.x branch\n//\t2. Improve the module's maintainability by reducing the storage\n//\t\tpaths to a single mechanism.\n//\t3. Use the same single mechanism to support \"private\" and \"user\" data.\n//\t4. _Never_ expose \"private\" data to user code (TODO: Drop _data, _removeData)\n//\t5. Avoid exposing implementation details on user objects (eg. expando properties)\n//\t6. Provide a clear path for implementation upgrade to WeakMap in 2014\n\nvar rbrace = /^(?:\\{[\\w\\W]*\\}|\\[[\\w\\W]*\\])$/,\n\trmultiDash = /[A-Z]/g;\n\nfunction getData( data ) {\n\tif ( data === \"true\" ) {\n\t\treturn true;\n\t}\n\n\tif ( data === \"false\" ) {\n\t\treturn false;\n\t}\n\n\tif ( data === \"null\" ) {\n\t\treturn null;\n\t}\n\n\t// Only convert to a number if it doesn't change the string\n\tif ( data === +data + \"\" ) {\n\t\treturn +data;\n\t}\n\n\tif ( rbrace.test( data ) ) {\n\t\treturn JSON.parse( data );\n\t}\n\n\treturn data;\n}\n\nfunction dataAttr( elem, key, data ) {\n\tvar name;\n\n\t// If nothing was found internally, try to fetch any\n\t// data from the HTML5 data-* attribute\n\tif ( data === undefined && elem.nodeType === 1 ) {\n\t\tname = \"data-\" + key.replace( rmultiDash, \"-$&\" ).toLowerCase();\n\t\tdata = elem.getAttribute( name );\n\n\t\tif ( typeof data === \"string\" ) {\n\t\t\ttry {\n\t\t\t\tdata = getData( data );\n\t\t\t} catch ( e ) {}\n\n\t\t\t// Make sure we set the data so it isn't changed later\n\t\t\tdataUser.set( elem, key, data );\n\t\t} else {\n\t\t\tdata = undefined;\n\t\t}\n\t}\n\treturn data;\n}\n\njQuery.extend( {\n\thasData: function( elem ) {\n\t\treturn dataUser.hasData( elem ) || dataPriv.hasData( elem );\n\t},\n\n\tdata: function( elem, name, data ) {\n\t\treturn dataUser.access( elem, name, data );\n\t},\n\n\tremoveData: function( elem, name ) {\n\t\tdataUser.remove( elem, name );\n\t},\n\n\t// TODO: Now that all calls to _data and _removeData have been replaced\n\t// with direct calls to dataPriv methods, these can be deprecated.\n\t_data: function( elem, name, data ) {\n\t\treturn dataPriv.access( elem, name, data );\n\t},\n\n\t_removeData: function( elem, name ) {\n\t\tdataPriv.remove( elem, name );\n\t}\n} );\n\njQuery.fn.extend( {\n\tdata: function( key, value ) {\n\t\tvar i, name, data,\n\t\t\telem = this[ 0 ],\n\t\t\tattrs = elem && elem.attributes;\n\n\t\t// Gets all values\n\t\tif ( key === undefined ) {\n\t\t\tif ( this.length ) {\n\t\t\t\tdata = dataUser.get( elem );\n\n\t\t\t\tif ( elem.nodeType === 1 && !dataPriv.get( elem, \"hasDataAttrs\" ) ) {\n\t\t\t\t\ti = attrs.length;\n\t\t\t\t\twhile ( i-- ) {\n\n\t\t\t\t\t\t// Support: IE 11 only\n\t\t\t\t\t\t// The attrs elements can be null (#14894)\n\t\t\t\t\t\tif ( attrs[ i ] ) {\n\t\t\t\t\t\t\tname = attrs[ i ].name;\n\t\t\t\t\t\t\tif ( name.indexOf( \"data-\" ) === 0 ) {\n\t\t\t\t\t\t\t\tname = camelCase( name.slice( 5 ) );\n\t\t\t\t\t\t\t\tdataAttr( elem, name, data[ name ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdataPriv.set( elem, \"hasDataAttrs\", true );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn data;\n\t\t}\n\n\t\t// Sets multiple values\n\t\tif ( typeof key === \"object\" ) {\n\t\t\treturn this.each( function() {\n\t\t\t\tdataUser.set( this, key );\n\t\t\t} );\n\t\t}\n\n\t\treturn access( this, function( value ) {\n\t\t\tvar data;\n\n\t\t\t// The calling jQuery object (element matches) is not empty\n\t\t\t// (and therefore has an element appears at this[ 0 ]) and the\n\t\t\t// `value` parameter was not undefined. An empty jQuery object\n\t\t\t// will result in `undefined` for elem = this[ 0 ] which will\n\t\t\t// throw an exception if an attempt to read a data cache is made.\n\t\t\tif ( elem && value === undefined ) {\n\n\t\t\t\t// Attempt to get data from the cache\n\t\t\t\t// The key will always be camelCased in Data\n\t\t\t\tdata = dataUser.get( elem, key );\n\t\t\t\tif ( data !== undefined ) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// Attempt to \"discover\" the data in\n\t\t\t\t// HTML5 custom data-* attrs\n\t\t\t\tdata = dataAttr( elem, key );\n\t\t\t\tif ( data !== undefined ) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// We tried really hard, but the data doesn't exist.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Set the data...\n\t\t\tthis.each( function() {\n\n\t\t\t\t// We always store the camelCased key\n\t\t\t\tdataUser.set( this, key, value );\n\t\t\t} );\n\t\t}, null, value, arguments.length > 1, null, true );\n\t},\n\n\tremoveData: function( key ) {\n\t\treturn this.each( function() {\n\t\t\tdataUser.remove( this, key );\n\t\t} );\n\t}\n} );\n\n\njQuery.extend( {\n\tqueue: function( elem, type, data ) {\n\t\tvar queue;\n\n\t\tif ( elem ) {\n\t\t\ttype = ( type || \"fx\" ) + \"queue\";\n\t\t\tqueue = dataPriv.get( elem, type );\n\n\t\t\t// Speed up dequeue by getting out quickly if this is just a lookup\n\t\t\tif ( data ) {\n\t\t\t\tif ( !queue || Array.isArray( data ) ) {\n\t\t\t\t\tqueue = dataPriv.access( elem, type, jQuery.makeArray( data ) );\n\t\t\t\t} else {\n\t\t\t\t\tqueue.push( data );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn queue || [];\n\t\t}\n\t},\n\n\tdequeue: function( elem, type ) {\n\t\ttype = type || \"fx\";\n\n\t\tvar queue = jQuery.queue( elem, type ),\n\t\t\tstartLength = queue.length,\n\t\t\tfn = queue.shift(),\n\t\t\thooks = jQuery._queueHooks( elem, type ),\n\t\t\tnext = function() {\n\t\t\t\tjQuery.dequeue( elem, type );\n\t\t\t};\n\n\t\t// If the fx queue is dequeued, always remove the progress sentinel\n\t\tif ( fn === \"inprogress\" ) {\n\t\t\tfn = queue.shift();\n\t\t\tstartLength--;\n\t\t}\n\n\t\tif ( fn ) {\n\n\t\t\t// Add a progress sentinel to prevent the fx queue from being\n\t\t\t// automatically dequeued\n\t\t\tif ( type === \"fx\" ) {\n\t\t\t\tqueue.unshift( \"inprogress\" );\n\t\t\t}\n\n\t\t\t// Clear up the last queue stop function\n\t\t\tdelete hooks.stop;\n\t\t\tfn.call( elem, next, hooks );\n\t\t}\n\n\t\tif ( !startLength && hooks ) {\n\t\t\thooks.empty.fire();\n\t\t}\n\t},\n\n\t// Not public - generate a queueHooks object, or return the current one\n\t_queueHooks: function( elem, type ) {\n\t\tvar key = type + \"queueHooks\";\n\t\treturn dataPriv.get( elem, key ) || dataPriv.access( elem, key, {\n\t\t\tempty: jQuery.Callbacks( \"once memory\" ).add( function() {\n\t\t\t\tdataPriv.remove( elem, [ type + \"queue\", key ] );\n\t\t\t} )\n\t\t} );\n\t}\n} );\n\njQuery.fn.extend( {\n\tqueue: function( type, data ) {\n\t\tvar setter = 2;\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tdata = type;\n\t\t\ttype = \"fx\";\n\t\t\tsetter--;\n\t\t}\n\n\t\tif ( arguments.length < setter ) {\n\t\t\treturn jQuery.queue( this[ 0 ], type );\n\t\t}\n\n\t\treturn data === undefined ?\n\t\t\tthis :\n\t\t\tthis.each( function() {\n\t\t\t\tvar queue = jQuery.queue( this, type, data );\n\n\t\t\t\t// Ensure a hooks for this queue\n\t\t\t\tjQuery._queueHooks( this, type );\n\n\t\t\t\tif ( type === \"fx\" && queue[ 0 ] !== \"inprogress\" ) {\n\t\t\t\t\tjQuery.dequeue( this, type );\n\t\t\t\t}\n\t\t\t} );\n\t},\n\tdequeue: function( type ) {\n\t\treturn this.each( function() {\n\t\t\tjQuery.dequeue( this, type );\n\t\t} );\n\t},\n\tclearQueue: function( type ) {\n\t\treturn this.queue( type || \"fx\", [] );\n\t},\n\n\t// Get a promise resolved when queues of a certain type\n\t// are emptied (fx is the type by default)\n\tpromise: function( type, obj ) {\n\t\tvar tmp,\n\t\t\tcount = 1,\n\t\t\tdefer = jQuery.Deferred(),\n\t\t\telements = this,\n\t\t\ti = this.length,\n\t\t\tresolve = function() {\n\t\t\t\tif ( !( --count ) ) {\n\t\t\t\t\tdefer.resolveWith( elements, [ elements ] );\n\t\t\t\t}\n\t\t\t};\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tobj = type;\n\t\t\ttype = undefined;\n\t\t}\n\t\ttype = type || \"fx\";\n\n\t\twhile ( i-- ) {\n\t\t\ttmp = dataPriv.get( elements[ i ], type + \"queueHooks\" );\n\t\t\tif ( tmp && tmp.empty ) {\n\t\t\t\tcount++;\n\t\t\t\ttmp.empty.add( resolve );\n\t\t\t}\n\t\t}\n\t\tresolve();\n\t\treturn defer.promise( obj );\n\t}\n} );\nvar pnum = ( /[+-]?(?:\\d*\\.|)\\d+(?:[eE][+-]?\\d+|)/ ).source;\n\nvar rcssNum = new RegExp( \"^(?:([+-])=|)(\" + pnum + \")([a-z%]*)$\", \"i\" );\n\n\nvar cssExpand = [ \"Top\", \"Right\", \"Bottom\", \"Left\" ];\n\nvar documentElement = document.documentElement;\n\n\n\n\tvar isAttached = function( elem ) {\n\t\t\treturn jQuery.contains( elem.ownerDocument, elem );\n\t\t},\n\t\tcomposed = { composed: true };\n\n\t// Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only\n\t// Check attachment across shadow DOM boundaries when possible (gh-3504)\n\t// Support: iOS 10.0-10.2 only\n\t// Early iOS 10 versions support `attachShadow` but not `getRootNode`,\n\t// leading to errors. We need to check for `getRootNode`.\n\tif ( documentElement.getRootNode ) {\n\t\tisAttached = function( elem ) {\n\t\t\treturn jQuery.contains( elem.ownerDocument, elem ) ||\n\t\t\t\telem.getRootNode( composed ) === elem.ownerDocument;\n\t\t};\n\t}\nvar isHiddenWithinTree = function( elem, el ) {\n\n\t\t// isHiddenWithinTree might be called from jQuery#filter function;\n\t\t// in that case, element will be second argument\n\t\telem = el || elem;\n\n\t\t// Inline style trumps all\n\t\treturn elem.style.display === \"none\" ||\n\t\t\telem.style.display === \"\" &&\n\n\t\t\t// Otherwise, check computed style\n\t\t\t// Support: Firefox <=43 - 45\n\t\t\t// Disconnected elements can have computed display: none, so first confirm that elem is\n\t\t\t// in the document.\n\t\t\tisAttached( elem ) &&\n\n\t\t\tjQuery.css( elem, \"display\" ) === \"none\";\n\t};\n\nvar swap = function( elem, options, callback, args ) {\n\tvar ret, name,\n\t\told = {};\n\n\t// Remember the old values, and insert the new ones\n\tfor ( name in options ) {\n\t\told[ name ] = elem.style[ name ];\n\t\telem.style[ name ] = options[ name ];\n\t}\n\n\tret = callback.apply( elem, args || [] );\n\n\t// Revert the old values\n\tfor ( name in options ) {\n\t\telem.style[ name ] = old[ name ];\n\t}\n\n\treturn ret;\n};\n\n\n\n\nfunction adjustCSS( elem, prop, valueParts, tween ) {\n\tvar adjusted, scale,\n\t\tmaxIterations = 20,\n\t\tcurrentValue = tween ?\n\t\t\tfunction() {\n\t\t\t\treturn tween.cur();\n\t\t\t} :\n\t\t\tfunction() {\n\t\t\t\treturn jQuery.css( elem, prop, \"\" );\n\t\t\t},\n\t\tinitial = currentValue(),\n\t\tunit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? \"\" : \"px\" ),\n\n\t\t// Starting value computation is required for potential unit mismatches\n\t\tinitialInUnit = elem.nodeType &&\n\t\t\t( jQuery.cssNumber[ prop ] || unit !== \"px\" && +initial ) &&\n\t\t\trcssNum.exec( jQuery.css( elem, prop ) );\n\n\tif ( initialInUnit && initialInUnit[ 3 ] !== unit ) {\n\n\t\t// Support: Firefox <=54\n\t\t// Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)\n\t\tinitial = initial / 2;\n\n\t\t// Trust units reported by jQuery.css\n\t\tunit = unit || initialInUnit[ 3 ];\n\n\t\t// Iteratively approximate from a nonzero starting point\n\t\tinitialInUnit = +initial || 1;\n\n\t\twhile ( maxIterations-- ) {\n\n\t\t\t// Evaluate and update our best guess (doubling guesses that zero out).\n\t\t\t// Finish if the scale equals or crosses 1 (making the old*new product non-positive).\n\t\t\tjQuery.style( elem, prop, initialInUnit + unit );\n\t\t\tif ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) {\n\t\t\t\tmaxIterations = 0;\n\t\t\t}\n\t\t\tinitialInUnit = initialInUnit / scale;\n\n\t\t}\n\n\t\tinitialInUnit = initialInUnit * 2;\n\t\tjQuery.style( elem, prop, initialInUnit + unit );\n\n\t\t// Make sure we update the tween properties later on\n\t\tvalueParts = valueParts || [];\n\t}\n\n\tif ( valueParts ) {\n\t\tinitialInUnit = +initialInUnit || +initial || 0;\n\n\t\t// Apply relative offset (+=/-=) if specified\n\t\tadjusted = valueParts[ 1 ] ?\n\t\t\tinitialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :\n\t\t\t+valueParts[ 2 ];\n\t\tif ( tween ) {\n\t\t\ttween.unit = unit;\n\t\t\ttween.start = initialInUnit;\n\t\t\ttween.end = adjusted;\n\t\t}\n\t}\n\treturn adjusted;\n}\n\n\nvar defaultDisplayMap = {};\n\nfunction getDefaultDisplay( elem ) {\n\tvar temp,\n\t\tdoc = elem.ownerDocument,\n\t\tnodeName = elem.nodeName,\n\t\tdisplay = defaultDisplayMap[ nodeName ];\n\n\tif ( display ) {\n\t\treturn display;\n\t}\n\n\ttemp = doc.body.appendChild( doc.createElement( nodeName ) );\n\tdisplay = jQuery.css( temp, \"display\" );\n\n\ttemp.parentNode.removeChild( temp );\n\n\tif ( display === \"none\" ) {\n\t\tdisplay = \"block\";\n\t}\n\tdefaultDisplayMap[ nodeName ] = display;\n\n\treturn display;\n}\n\nfunction showHide( elements, show ) {\n\tvar display, elem,\n\t\tvalues = [],\n\t\tindex = 0,\n\t\tlength = elements.length;\n\n\t// Determine new display value for elements that need to change\n\tfor ( ; index < length; index++ ) {\n\t\telem = elements[ index ];\n\t\tif ( !elem.style ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tdisplay = elem.style.display;\n\t\tif ( show ) {\n\n\t\t\t// Since we force visibility upon cascade-hidden elements, an immediate (and slow)\n\t\t\t// check is required in this first loop unless we have a nonempty display value (either\n\t\t\t// inline or about-to-be-restored)\n\t\t\tif ( display === \"none\" ) {\n\t\t\t\tvalues[ index ] = dataPriv.get( elem, \"display\" ) || null;\n\t\t\t\tif ( !values[ index ] ) {\n\t\t\t\t\telem.style.display = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( elem.style.display === \"\" && isHiddenWithinTree( elem ) ) {\n\t\t\t\tvalues[ index ] = getDefaultDisplay( elem );\n\t\t\t}\n\t\t} else {\n\t\t\tif ( display !== \"none\" ) {\n\t\t\t\tvalues[ index ] = \"none\";\n\n\t\t\t\t// Remember what we're overwriting\n\t\t\t\tdataPriv.set( elem, \"display\", display );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Set the display of the elements in a second loop to avoid constant reflow\n\tfor ( index = 0; index < length; index++ ) {\n\t\tif ( values[ index ] != null ) {\n\t\t\telements[ index ].style.display = values[ index ];\n\t\t}\n\t}\n\n\treturn elements;\n}\n\njQuery.fn.extend( {\n\tshow: function() {\n\t\treturn showHide( this, true );\n\t},\n\thide: function() {\n\t\treturn showHide( this );\n\t},\n\ttoggle: function( state ) {\n\t\tif ( typeof state === \"boolean\" ) {\n\t\t\treturn state ? this.show() : this.hide();\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tif ( isHiddenWithinTree( this ) ) {\n\t\t\t\tjQuery( this ).show();\n\t\t\t} else {\n\t\t\t\tjQuery( this ).hide();\n\t\t\t}\n\t\t} );\n\t}\n} );\nvar rcheckableType = ( /^(?:checkbox|radio)$/i );\n\nvar rtagName = ( /<([a-z][^\\/\\0>\\x20\\t\\r\\n\\f]*)/i );\n\nvar rscriptType = ( /^$|^module$|\\/(?:java|ecma)script/i );\n\n\n\n// We have to close these tags to support XHTML (#13200)\nvar wrapMap = {\n\n\t// Support: IE <=9 only\n\toption: [ 1, \"<select multiple='multiple'>\", \"</select>\" ],\n\n\t// XHTML parsers do not magically insert elements in the\n\t// same way that tag soup parsers do. So we cannot shorten\n\t// this by omitting <tbody> or other required elements.\n\tthead: [ 1, \"<table>\", \"</table>\" ],\n\tcol: [ 2, \"<table><colgroup>\", \"</colgroup></table>\" ],\n\ttr: [ 2, \"<table><tbody>\", \"</tbody></table>\" ],\n\ttd: [ 3, \"<table><tbody><tr>\", \"</tr></tbody></table>\" ],\n\n\t_default: [ 0, \"\", \"\" ]\n};\n\n// Support: IE <=9 only\nwrapMap.optgroup = wrapMap.option;\n\nwrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;\nwrapMap.th = wrapMap.td;\n\n\nfunction getAll( context, tag ) {\n\n\t// Support: IE <=9 - 11 only\n\t// Use typeof to avoid zero-argument method invocation on host objects (#15151)\n\tvar ret;\n\n\tif ( typeof context.getElementsByTagName !== \"undefined\" ) {\n\t\tret = context.getElementsByTagName( tag || \"*\" );\n\n\t} else if ( typeof context.querySelectorAll !== \"undefined\" ) {\n\t\tret = context.querySelectorAll( tag || \"*\" );\n\n\t} else {\n\t\tret = [];\n\t}\n\n\tif ( tag === undefined || tag && nodeName( context, tag ) ) {\n\t\treturn jQuery.merge( [ context ], ret );\n\t}\n\n\treturn ret;\n}\n\n\n// Mark scripts as having already been evaluated\nfunction setGlobalEval( elems, refElements ) {\n\tvar i = 0,\n\t\tl = elems.length;\n\n\tfor ( ; i < l; i++ ) {\n\t\tdataPriv.set(\n\t\t\telems[ i ],\n\t\t\t\"globalEval\",\n\t\t\t!refElements || dataPriv.get( refElements[ i ], \"globalEval\" )\n\t\t);\n\t}\n}\n\n\nvar rhtml = /<|&#?\\w+;/;\n\nfunction buildFragment( elems, context, scripts, selection, ignored ) {\n\tvar elem, tmp, tag, wrap, attached, j,\n\t\tfragment = context.createDocumentFragment(),\n\t\tnodes = [],\n\t\ti = 0,\n\t\tl = elems.length;\n\n\tfor ( ; i < l; i++ ) {\n\t\telem = elems[ i ];\n\n\t\tif ( elem || elem === 0 ) {\n\n\t\t\t// Add nodes directly\n\t\t\tif ( toType( elem ) === \"object\" ) {\n\n\t\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\tjQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );\n\n\t\t\t// Convert non-html into a text node\n\t\t\t} else if ( !rhtml.test( elem ) ) {\n\t\t\t\tnodes.push( context.createTextNode( elem ) );\n\n\t\t\t// Convert html into DOM nodes\n\t\t\t} else {\n\t\t\t\ttmp = tmp || fragment.appendChild( context.createElement( \"div\" ) );\n\n\t\t\t\t// Deserialize a standard representation\n\t\t\t\ttag = ( rtagName.exec( elem ) || [ \"\", \"\" ] )[ 1 ].toLowerCase();\n\t\t\t\twrap = wrapMap[ tag ] || wrapMap._default;\n\t\t\t\ttmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];\n\n\t\t\t\t// Descend through wrappers to the right content\n\t\t\t\tj = wrap[ 0 ];\n\t\t\t\twhile ( j-- ) {\n\t\t\t\t\ttmp = tmp.lastChild;\n\t\t\t\t}\n\n\t\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\tjQuery.merge( nodes, tmp.childNodes );\n\n\t\t\t\t// Remember the top-level container\n\t\t\t\ttmp = fragment.firstChild;\n\n\t\t\t\t// Ensure the created nodes are orphaned (#12392)\n\t\t\t\ttmp.textContent = \"\";\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove wrapper from fragment\n\tfragment.textContent = \"\";\n\n\ti = 0;\n\twhile ( ( elem = nodes[ i++ ] ) ) {\n\n\t\t// Skip elements already in the context collection (trac-4087)\n\t\tif ( selection && jQuery.inArray( elem, selection ) > -1 ) {\n\t\t\tif ( ignored ) {\n\t\t\t\tignored.push( elem );\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tattached = isAttached( elem );\n\n\t\t// Append to fragment\n\t\ttmp = getAll( fragment.appendChild( elem ), \"script\" );\n\n\t\t// Preserve script evaluation history\n\t\tif ( attached ) {\n\t\t\tsetGlobalEval( tmp );\n\t\t}\n\n\t\t// Capture executables\n\t\tif ( scripts ) {\n\t\t\tj = 0;\n\t\t\twhile ( ( elem = tmp[ j++ ] ) ) {\n\t\t\t\tif ( rscriptType.test( elem.type || \"\" ) ) {\n\t\t\t\t\tscripts.push( elem );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn fragment;\n}\n\n\n( function() {\n\tvar fragment = document.createDocumentFragment(),\n\t\tdiv = fragment.appendChild( document.createElement( \"div\" ) ),\n\t\tinput = document.createElement( \"input\" );\n\n\t// Support: Android 4.0 - 4.3 only\n\t// Check state lost if the name is set (#11217)\n\t// Support: Windows Web Apps (WWA)\n\t// `name` and `type` must use .setAttribute for WWA (#14901)\n\tinput.setAttribute( \"type\", \"radio\" );\n\tinput.setAttribute( \"checked\", \"checked\" );\n\tinput.setAttribute( \"name\", \"t\" );\n\n\tdiv.appendChild( input );\n\n\t// Support: Android <=4.1 only\n\t// Older WebKit doesn't clone checked state correctly in fragments\n\tsupport.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;\n\n\t// Support: IE <=11 only\n\t// Make sure textarea (and checkbox) defaultValue is properly cloned\n\tdiv.innerHTML = \"<textarea>x</textarea>\";\n\tsupport.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;\n} )();\n\n\nvar\n\trkeyEvent = /^key/,\n\trmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,\n\trtypenamespace = /^([^.]*)(?:\\.(.+)|)/;\n\nfunction returnTrue() {\n\treturn true;\n}\n\nfunction returnFalse() {\n\treturn false;\n}\n\n// Support: IE <=9 - 11+\n// focus() and blur() are asynchronous, except when they are no-op.\n// So expect focus to be synchronous when the element is already active,\n// and blur to be synchronous when the element is not already active.\n// (focus and blur are always synchronous in other supported browsers,\n// this just defines when we can count on it).\nfunction expectSync( elem, type ) {\n\treturn ( elem === safeActiveElement() ) === ( type === \"focus\" );\n}\n\n// Support: IE <=9 only\n// Accessing document.activeElement can throw unexpectedly\n// https://bugs.jquery.com/ticket/13393\nfunction safeActiveElement() {\n\ttry {\n\t\treturn document.activeElement;\n\t} catch ( err ) { }\n}\n\nfunction on( elem, types, selector, data, fn, one ) {\n\tvar origFn, type;\n\n\t// Types can be a map of types/handlers\n\tif ( typeof types === \"object\" ) {\n\n\t\t// ( types-Object, selector, data )\n\t\tif ( typeof selector !== \"string\" ) {\n\n\t\t\t// ( types-Object, data )\n\t\t\tdata = data || selector;\n\t\t\tselector = undefined;\n\t\t}\n\t\tfor ( type in types ) {\n\t\t\ton( elem, type, selector, data, types[ type ], one );\n\t\t}\n\t\treturn elem;\n\t}\n\n\tif ( data == null && fn == null ) {\n\n\t\t// ( types, fn )\n\t\tfn = selector;\n\t\tdata = selector = undefined;\n\t} else if ( fn == null ) {\n\t\tif ( typeof selector === \"string\" ) {\n\n\t\t\t// ( types, selector, fn )\n\t\t\tfn = data;\n\t\t\tdata = undefined;\n\t\t} else {\n\n\t\t\t// ( types, data, fn )\n\t\t\tfn = data;\n\t\t\tdata = selector;\n\t\t\tselector = undefined;\n\t\t}\n\t}\n\tif ( fn === false ) {\n\t\tfn = returnFalse;\n\t} else if ( !fn ) {\n\t\treturn elem;\n\t}\n\n\tif ( one === 1 ) {\n\t\torigFn = fn;\n\t\tfn = function( event ) {\n\n\t\t\t// Can use an empty set, since event contains the info\n\t\t\tjQuery().off( event );\n\t\t\treturn origFn.apply( this, arguments );\n\t\t};\n\n\t\t// Use same guid so caller can remove using origFn\n\t\tfn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );\n\t}\n\treturn elem.each( function() {\n\t\tjQuery.event.add( this, types, fn, data, selector );\n\t} );\n}\n\n/*\n * Helper functions for managing events -- not part of the public interface.\n * Props to Dean Edwards' addEvent library for many of the ideas.\n */\njQuery.event = {\n\n\tglobal: {},\n\n\tadd: function( elem, types, handler, data, selector ) {\n\n\t\tvar handleObjIn, eventHandle, tmp,\n\t\t\tevents, t, handleObj,\n\t\t\tspecial, handlers, type, namespaces, origType,\n\t\t\telemData = dataPriv.get( elem );\n\n\t\t// Don't attach events to noData or text/comment nodes (but allow plain objects)\n\t\tif ( !elemData ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Caller can pass in an object of custom data in lieu of the handler\n\t\tif ( handler.handler ) {\n\t\t\thandleObjIn = handler;\n\t\t\thandler = handleObjIn.handler;\n\t\t\tselector = handleObjIn.selector;\n\t\t}\n\n\t\t// Ensure that invalid selectors throw exceptions at attach time\n\t\t// Evaluate against documentElement in case elem is a non-element node (e.g., document)\n\t\tif ( selector ) {\n\t\t\tjQuery.find.matchesSelector( documentElement, selector );\n\t\t}\n\n\t\t// Make sure that the handler has a unique ID, used to find/remove it later\n\t\tif ( !handler.guid ) {\n\t\t\thandler.guid = jQuery.guid++;\n\t\t}\n\n\t\t// Init the element's event structure and main handler, if this is the first\n\t\tif ( !( events = elemData.events ) ) {\n\t\t\tevents = elemData.events = {};\n\t\t}\n\t\tif ( !( eventHandle = elemData.handle ) ) {\n\t\t\teventHandle = elemData.handle = function( e ) {\n\n\t\t\t\t// Discard the second event of a jQuery.event.trigger() and\n\t\t\t\t// when an event is called after a page has unloaded\n\t\t\t\treturn typeof jQuery !== \"undefined\" && jQuery.event.triggered !== e.type ?\n\t\t\t\t\tjQuery.event.dispatch.apply( elem, arguments ) : undefined;\n\t\t\t};\n\t\t}\n\n\t\t// Handle multiple events separated by a space\n\t\ttypes = ( types || \"\" ).match( rnothtmlwhite ) || [ \"\" ];\n\t\tt = types.length;\n\t\twhile ( t-- ) {\n\t\t\ttmp = rtypenamespace.exec( types[ t ] ) || [];\n\t\t\ttype = origType = tmp[ 1 ];\n\t\t\tnamespaces = ( tmp[ 2 ] || \"\" ).split( \".\" ).sort();\n\n\t\t\t// There *must* be a type, no attaching namespace-only handlers\n\t\t\tif ( !type ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If event changes its type, use the special event handlers for the changed type\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\n\t\t\t// If selector defined, determine special event api type, otherwise given type\n\t\t\ttype = ( selector ? special.delegateType : special.bindType ) || type;\n\n\t\t\t// Update special based on newly reset type\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\n\t\t\t// handleObj is passed to all event handlers\n\t\t\thandleObj = jQuery.extend( {\n\t\t\t\ttype: type,\n\t\t\t\torigType: origType,\n\t\t\t\tdata: data,\n\t\t\t\thandler: handler,\n\t\t\t\tguid: handler.guid,\n\t\t\t\tselector: selector,\n\t\t\t\tneedsContext: selector && jQuery.expr.match.needsContext.test( selector ),\n\t\t\t\tnamespace: namespaces.join( \".\" )\n\t\t\t}, handleObjIn );\n\n\t\t\t// Init the event handler queue if we're the first\n\t\t\tif ( !( handlers = events[ type ] ) ) {\n\t\t\t\thandlers = events[ type ] = [];\n\t\t\t\thandlers.delegateCount = 0;\n\n\t\t\t\t// Only use addEventListener if the special events handler returns false\n\t\t\t\tif ( !special.setup ||\n\t\t\t\t\tspecial.setup.call( elem, data, namespaces, eventHandle ) === false ) {\n\n\t\t\t\t\tif ( elem.addEventListener ) {\n\t\t\t\t\t\telem.addEventListener( type, eventHandle );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( special.add ) {\n\t\t\t\tspecial.add.call( elem, handleObj );\n\n\t\t\t\tif ( !handleObj.handler.guid ) {\n\t\t\t\t\thandleObj.handler.guid = handler.guid;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add to the element's handler list, delegates in front\n\t\t\tif ( selector ) {\n\t\t\t\thandlers.splice( handlers.delegateCount++, 0, handleObj );\n\t\t\t} else {\n\t\t\t\thandlers.push( handleObj );\n\t\t\t}\n\n\t\t\t// Keep track of which events have ever been used, for event optimization\n\t\t\tjQuery.event.global[ type ] = true;\n\t\t}\n\n\t},\n\n\t// Detach an event or set of events from an element\n\tremove: function( elem, types, handler, selector, mappedTypes ) {\n\n\t\tvar j, origCount, tmp,\n\t\t\tevents, t, handleObj,\n\t\t\tspecial, handlers, type, namespaces, origType,\n\t\t\telemData = dataPriv.hasData( elem ) && dataPriv.get( elem );\n\n\t\tif ( !elemData || !( events = elemData.events ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Once for each type.namespace in types; type may be omitted\n\t\ttypes = ( types || \"\" ).match( rnothtmlwhite ) || [ \"\" ];\n\t\tt = types.length;\n\t\twhile ( t-- ) {\n\t\t\ttmp = rtypenamespace.exec( types[ t ] ) || [];\n\t\t\ttype = origType = tmp[ 1 ];\n\t\t\tnamespaces = ( tmp[ 2 ] || \"\" ).split( \".\" ).sort();\n\n\t\t\t// Unbind all events (on this namespace, if provided) for the element\n\t\t\tif ( !type ) {\n\t\t\t\tfor ( type in events ) {\n\t\t\t\t\tjQuery.event.remove( elem, type + types[ t ], handler, selector, true );\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\t\t\ttype = ( selector ? special.delegateType : special.bindType ) || type;\n\t\t\thandlers = events[ type ] || [];\n\t\t\ttmp = tmp[ 2 ] &&\n\t\t\t\tnew RegExp( \"(^|\\\\.)\" + namespaces.join( \"\\\\.(?:.*\\\\.|)\" ) + \"(\\\\.|$)\" );\n\n\t\t\t// Remove matching events\n\t\t\torigCount = j = handlers.length;\n\t\t\twhile ( j-- ) {\n\t\t\t\thandleObj = handlers[ j ];\n\n\t\t\t\tif ( ( mappedTypes || origType === handleObj.origType ) &&\n\t\t\t\t\t( !handler || handler.guid === handleObj.guid ) &&\n\t\t\t\t\t( !tmp || tmp.test( handleObj.namespace ) ) &&\n\t\t\t\t\t( !selector || selector === handleObj.selector ||\n\t\t\t\t\t\tselector === \"**\" && handleObj.selector ) ) {\n\t\t\t\t\thandlers.splice( j, 1 );\n\n\t\t\t\t\tif ( handleObj.selector ) {\n\t\t\t\t\t\thandlers.delegateCount--;\n\t\t\t\t\t}\n\t\t\t\t\tif ( special.remove ) {\n\t\t\t\t\t\tspecial.remove.call( elem, handleObj );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Remove generic event handler if we removed something and no more handlers exist\n\t\t\t// (avoids potential for endless recursion during removal of special event handlers)\n\t\t\tif ( origCount && !handlers.length ) {\n\t\t\t\tif ( !special.teardown ||\n\t\t\t\t\tspecial.teardown.call( elem, namespaces, elemData.handle ) === false ) {\n\n\t\t\t\t\tjQuery.removeEvent( elem, type, elemData.handle );\n\t\t\t\t}\n\n\t\t\t\tdelete events[ type ];\n\t\t\t}\n\t\t}\n\n\t\t// Remove data and the expando if it's no longer used\n\t\tif ( jQuery.isEmptyObject( events ) ) {\n\t\t\tdataPriv.remove( elem, \"handle events\" );\n\t\t}\n\t},\n\n\tdispatch: function( nativeEvent ) {\n\n\t\t// Make a writable jQuery.Event from the native event object\n\t\tvar event = jQuery.event.fix( nativeEvent );\n\n\t\tvar i, j, ret, matched, handleObj, handlerQueue,\n\t\t\targs = new Array( arguments.length ),\n\t\t\thandlers = ( dataPriv.get( this, \"events\" ) || {} )[ event.type ] || [],\n\t\t\tspecial = jQuery.event.special[ event.type ] || {};\n\n\t\t// Use the fix-ed jQuery.Event rather than the (read-only) native event\n\t\targs[ 0 ] = event;\n\n\t\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\n\t\tevent.delegateTarget = this;\n\n\t\t// Call the preDispatch hook for the mapped type, and let it bail if desired\n\t\tif ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine handlers\n\t\thandlerQueue = jQuery.event.handlers.call( this, event, handlers );\n\n\t\t// Run delegates first; they may want to stop propagation beneath us\n\t\ti = 0;\n\t\twhile ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {\n\t\t\tevent.currentTarget = matched.elem;\n\n\t\t\tj = 0;\n\t\t\twhile ( ( handleObj = matched.handlers[ j++ ] ) &&\n\t\t\t\t!event.isImmediatePropagationStopped() ) {\n\n\t\t\t\t// If the event is namespaced, then each handler is only invoked if it is\n\t\t\t\t// specially universal or its namespaces are a superset of the event's.\n\t\t\t\tif ( !event.rnamespace || handleObj.namespace === false ||\n\t\t\t\t\tevent.rnamespace.test( handleObj.namespace ) ) {\n\n\t\t\t\t\tevent.handleObj = handleObj;\n\t\t\t\t\tevent.data = handleObj.data;\n\n\t\t\t\t\tret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||\n\t\t\t\t\t\thandleObj.handler ).apply( matched.elem, args );\n\n\t\t\t\t\tif ( ret !== undefined ) {\n\t\t\t\t\t\tif ( ( event.result = ret ) === false ) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Call the postDispatch hook for the mapped type\n\t\tif ( special.postDispatch ) {\n\t\t\tspecial.postDispatch.call( this, event );\n\t\t}\n\n\t\treturn event.result;\n\t},\n\n\thandlers: function( event, handlers ) {\n\t\tvar i, handleObj, sel, matchedHandlers, matchedSelectors,\n\t\t\thandlerQueue = [],\n\t\t\tdelegateCount = handlers.delegateCount,\n\t\t\tcur = event.target;\n\n\t\t// Find delegate handlers\n\t\tif ( delegateCount &&\n\n\t\t\t// Support: IE <=9\n\t\t\t// Black-hole SVG <use> instance trees (trac-13180)\n\t\t\tcur.nodeType &&\n\n\t\t\t// Support: Firefox <=42\n\t\t\t// Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)\n\t\t\t// https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click\n\t\t\t// Support: IE 11 only\n\t\t\t// ...but not arrow key \"clicks\" of radio inputs, which can have `button` -1 (gh-2343)\n\t\t\t!( event.type === \"click\" && event.button >= 1 ) ) {\n\n\t\t\tfor ( ; cur !== this; cur = cur.parentNode || this ) {\n\n\t\t\t\t// Don't check non-elements (#13208)\n\t\t\t\t// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)\n\t\t\t\tif ( cur.nodeType === 1 && !( event.type === \"click\" && cur.disabled === true ) ) {\n\t\t\t\t\tmatchedHandlers = [];\n\t\t\t\t\tmatchedSelectors = {};\n\t\t\t\t\tfor ( i = 0; i < delegateCount; i++ ) {\n\t\t\t\t\t\thandleObj = handlers[ i ];\n\n\t\t\t\t\t\t// Don't conflict with Object.prototype properties (#13203)\n\t\t\t\t\t\tsel = handleObj.selector + \" \";\n\n\t\t\t\t\t\tif ( matchedSelectors[ sel ] === undefined ) {\n\t\t\t\t\t\t\tmatchedSelectors[ sel ] = handleObj.needsContext ?\n\t\t\t\t\t\t\t\tjQuery( sel, this ).index( cur ) > -1 :\n\t\t\t\t\t\t\t\tjQuery.find( sel, this, null, [ cur ] ).length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( matchedSelectors[ sel ] ) {\n\t\t\t\t\t\t\tmatchedHandlers.push( handleObj );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( matchedHandlers.length ) {\n\t\t\t\t\t\thandlerQueue.push( { elem: cur, handlers: matchedHandlers } );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Add the remaining (directly-bound) handlers\n\t\tcur = this;\n\t\tif ( delegateCount < handlers.length ) {\n\t\t\thandlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );\n\t\t}\n\n\t\treturn handlerQueue;\n\t},\n\n\taddProp: function( name, hook ) {\n\t\tObject.defineProperty( jQuery.Event.prototype, name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\n\t\t\tget: isFunction( hook ) ?\n\t\t\t\tfunction() {\n\t\t\t\t\tif ( this.originalEvent ) {\n\t\t\t\t\t\t\treturn hook( this.originalEvent );\n\t\t\t\t\t}\n\t\t\t\t} :\n\t\t\t\tfunction() {\n\t\t\t\t\tif ( this.originalEvent ) {\n\t\t\t\t\t\t\treturn this.originalEvent[ name ];\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\tset: function( value ) {\n\t\t\t\tObject.defineProperty( this, name, {\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t\twritable: true,\n\t\t\t\t\tvalue: value\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t},\n\n\tfix: function( originalEvent ) {\n\t\treturn originalEvent[ jQuery.expando ] ?\n\t\t\toriginalEvent :\n\t\t\tnew jQuery.Event( originalEvent );\n\t},\n\n\tspecial: {\n\t\tload: {\n\n\t\t\t// Prevent triggered image.load events from bubbling to window.load\n\t\t\tnoBubble: true\n\t\t},\n\t\tclick: {\n\n\t\t\t// Utilize native event to ensure correct state for checkable inputs\n\t\t\tsetup: function( data ) {\n\n\t\t\t\t// For mutual compressibility with _default, replace `this` access with a local var.\n\t\t\t\t// `|| data` is dead code meant only to preserve the variable through minification.\n\t\t\t\tvar el = this || data;\n\n\t\t\t\t// Claim the first handler\n\t\t\t\tif ( rcheckableType.test( el.type ) &&\n\t\t\t\t\tel.click && nodeName( el, \"input\" ) ) {\n\n\t\t\t\t\t// dataPriv.set( el, \"click\", ... )\n\t\t\t\t\tleverageNative( el, \"click\", returnTrue );\n\t\t\t\t}\n\n\t\t\t\t// Return false to allow normal processing in the caller\n\t\t\t\treturn false;\n\t\t\t},\n\t\t\ttrigger: function( data ) {\n\n\t\t\t\t// For mutual compressibility with _default, replace `this` access with a local var.\n\t\t\t\t// `|| data` is dead code meant only to preserve the variable through minification.\n\t\t\t\tvar el = this || data;\n\n\t\t\t\t// Force setup before triggering a click\n\t\t\t\tif ( rcheckableType.test( el.type ) &&\n\t\t\t\t\tel.click && nodeName( el, \"input\" ) ) {\n\n\t\t\t\t\tleverageNative( el, \"click\" );\n\t\t\t\t}\n\n\t\t\t\t// Return non-false to allow normal event-path propagation\n\t\t\t\treturn true;\n\t\t\t},\n\n\t\t\t// For cross-browser consistency, suppress native .click() on links\n\t\t\t// Also prevent it if we're currently inside a leveraged native-event stack\n\t\t\t_default: function( event ) {\n\t\t\t\tvar target = event.target;\n\t\t\t\treturn rcheckableType.test( target.type ) &&\n\t\t\t\t\ttarget.click && nodeName( target, \"input\" ) &&\n\t\t\t\t\tdataPriv.get( target, \"click\" ) ||\n\t\t\t\t\tnodeName( target, \"a\" );\n\t\t\t}\n\t\t},\n\n\t\tbeforeunload: {\n\t\t\tpostDispatch: function( event ) {\n\n\t\t\t\t// Support: Firefox 20+\n\t\t\t\t// Firefox doesn't alert if the returnValue field is not set.\n\t\t\t\tif ( event.result !== undefined && event.originalEvent ) {\n\t\t\t\t\tevent.originalEvent.returnValue = event.result;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Ensure the presence of an event listener that handles manually-triggered\n// synthetic events by interrupting progress until reinvoked in response to\n// *native* events that it fires directly, ensuring that state changes have\n// already occurred before other listeners are invoked.\nfunction leverageNative( el, type, expectSync ) {\n\n\t// Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add\n\tif ( !expectSync ) {\n\t\tif ( dataPriv.get( el, type ) === undefined ) {\n\t\t\tjQuery.event.add( el, type, returnTrue );\n\t\t}\n\t\treturn;\n\t}\n\n\t// Register the controller as a special universal handler for all event namespaces\n\tdataPriv.set( el, type, false );\n\tjQuery.event.add( el, type, {\n\t\tnamespace: false,\n\t\thandler: function( event ) {\n\t\t\tvar notAsync, result,\n\t\t\t\tsaved = dataPriv.get( this, type );\n\n\t\t\tif ( ( event.isTrigger & 1 ) && this[ type ] ) {\n\n\t\t\t\t// Interrupt processing of the outer synthetic .trigger()ed event\n\t\t\t\t// Saved data should be false in such cases, but might be a leftover capture object\n\t\t\t\t// from an async native handler (gh-4350)\n\t\t\t\tif ( !saved.length ) {\n\n\t\t\t\t\t// Store arguments for use when handling the inner native event\n\t\t\t\t\t// There will always be at least one argument (an event object), so this array\n\t\t\t\t\t// will not be confused with a leftover capture object.\n\t\t\t\t\tsaved = slice.call( arguments );\n\t\t\t\t\tdataPriv.set( this, type, saved );\n\n\t\t\t\t\t// Trigger the native event and capture its result\n\t\t\t\t\t// Support: IE <=9 - 11+\n\t\t\t\t\t// focus() and blur() are asynchronous\n\t\t\t\t\tnotAsync = expectSync( this, type );\n\t\t\t\t\tthis[ type ]();\n\t\t\t\t\tresult = dataPriv.get( this, type );\n\t\t\t\t\tif ( saved !== result || notAsync ) {\n\t\t\t\t\t\tdataPriv.set( this, type, false );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult = {};\n\t\t\t\t\t}\n\t\t\t\t\tif ( saved !== result ) {\n\n\t\t\t\t\t\t// Cancel the outer synthetic event\n\t\t\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\treturn result.value;\n\t\t\t\t\t}\n\n\t\t\t\t// If this is an inner synthetic event for an event with a bubbling surrogate\n\t\t\t\t// (focus or blur), assume that the surrogate already propagated from triggering the\n\t\t\t\t// native event and prevent that from happening again here.\n\t\t\t\t// This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the\n\t\t\t\t// bubbling surrogate propagates *after* the non-bubbling base), but that seems\n\t\t\t\t// less bad than duplication.\n\t\t\t\t} else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t}\n\n\t\t\t// If this is a native event triggered above, everything is now in order\n\t\t\t// Fire an inner synthetic event with the original arguments\n\t\t\t} else if ( saved.length ) {\n\n\t\t\t\t// ...and capture the result\n\t\t\t\tdataPriv.set( this, type, {\n\t\t\t\t\tvalue: jQuery.event.trigger(\n\n\t\t\t\t\t\t// Support: IE <=9 - 11+\n\t\t\t\t\t\t// Extend with the prototype to reset the above stopImmediatePropagation()\n\t\t\t\t\t\tjQuery.extend( saved[ 0 ], jQuery.Event.prototype ),\n\t\t\t\t\t\tsaved.slice( 1 ),\n\t\t\t\t\t\tthis\n\t\t\t\t\t)\n\t\t\t\t} );\n\n\t\t\t\t// Abort handling of the native event\n\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t}\n\t\t}\n\t} );\n}\n\njQuery.removeEvent = function( elem, type, handle ) {\n\n\t// This \"if\" is needed for plain objects\n\tif ( elem.removeEventListener ) {\n\t\telem.removeEventListener( type, handle );\n\t}\n};\n\njQuery.Event = function( src, props ) {\n\n\t// Allow instantiation without the 'new' keyword\n\tif ( !( this instanceof jQuery.Event ) ) {\n\t\treturn new jQuery.Event( src, props );\n\t}\n\n\t// Event object\n\tif ( src && src.type ) {\n\t\tthis.originalEvent = src;\n\t\tthis.type = src.type;\n\n\t\t// Events bubbling up the document may have been marked as prevented\n\t\t// by a handler lower down the tree; reflect the correct value.\n\t\tthis.isDefaultPrevented = src.defaultPrevented ||\n\t\t\t\tsrc.defaultPrevented === undefined &&\n\n\t\t\t\t// Support: Android <=2.3 only\n\t\t\t\tsrc.returnValue === false ?\n\t\t\treturnTrue :\n\t\t\treturnFalse;\n\n\t\t// Create target properties\n\t\t// Support: Safari <=6 - 7 only\n\t\t// Target should not be a text node (#504, #13143)\n\t\tthis.target = ( src.target && src.target.nodeType === 3 ) ?\n\t\t\tsrc.target.parentNode :\n\t\t\tsrc.target;\n\n\t\tthis.currentTarget = src.currentTarget;\n\t\tthis.relatedTarget = src.relatedTarget;\n\n\t// Event type\n\t} else {\n\t\tthis.type = src;\n\t}\n\n\t// Put explicitly provided properties onto the event object\n\tif ( props ) {\n\t\tjQuery.extend( this, props );\n\t}\n\n\t// Create a timestamp if incoming event doesn't have one\n\tthis.timeStamp = src && src.timeStamp || Date.now();\n\n\t// Mark it as fixed\n\tthis[ jQuery.expando ] = true;\n};\n\n// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding\n// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html\njQuery.Event.prototype = {\n\tconstructor: jQuery.Event,\n\tisDefaultPrevented: returnFalse,\n\tisPropagationStopped: returnFalse,\n\tisImmediatePropagationStopped: returnFalse,\n\tisSimulated: false,\n\n\tpreventDefault: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isDefaultPrevented = returnTrue;\n\n\t\tif ( e && !this.isSimulated ) {\n\t\t\te.preventDefault();\n\t\t}\n\t},\n\tstopPropagation: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isPropagationStopped = returnTrue;\n\n\t\tif ( e && !this.isSimulated ) {\n\t\t\te.stopPropagation();\n\t\t}\n\t},\n\tstopImmediatePropagation: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isImmediatePropagationStopped = returnTrue;\n\n\t\tif ( e && !this.isSimulated ) {\n\t\t\te.stopImmediatePropagation();\n\t\t}\n\n\t\tthis.stopPropagation();\n\t}\n};\n\n// Includes all common event props including KeyEvent and MouseEvent specific props\njQuery.each( {\n\taltKey: true,\n\tbubbles: true,\n\tcancelable: true,\n\tchangedTouches: true,\n\tctrlKey: true,\n\tdetail: true,\n\teventPhase: true,\n\tmetaKey: true,\n\tpageX: true,\n\tpageY: true,\n\tshiftKey: true,\n\tview: true,\n\t\"char\": true,\n\tcode: true,\n\tcharCode: true,\n\tkey: true,\n\tkeyCode: true,\n\tbutton: true,\n\tbuttons: true,\n\tclientX: true,\n\tclientY: true,\n\toffsetX: true,\n\toffsetY: true,\n\tpointerId: true,\n\tpointerType: true,\n\tscreenX: true,\n\tscreenY: true,\n\ttargetTouches: true,\n\ttoElement: true,\n\ttouches: true,\n\n\twhich: function( event ) {\n\t\tvar button = event.button;\n\n\t\t// Add which for key events\n\t\tif ( event.which == null && rkeyEvent.test( event.type ) ) {\n\t\t\treturn event.charCode != null ? event.charCode : event.keyCode;\n\t\t}\n\n\t\t// Add which for click: 1 === left; 2 === middle; 3 === right\n\t\tif ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {\n\t\t\tif ( button & 1 ) {\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\tif ( button & 2 ) {\n\t\t\t\treturn 3;\n\t\t\t}\n\n\t\t\tif ( button & 4 ) {\n\t\t\t\treturn 2;\n\t\t\t}\n\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn event.which;\n\t}\n}, jQuery.event.addProp );\n\njQuery.each( { focus: \"focusin\", blur: \"focusout\" }, function( type, delegateType ) {\n\tjQuery.event.special[ type ] = {\n\n\t\t// Utilize native event if possible so blur/focus sequence is correct\n\t\tsetup: function() {\n\n\t\t\t// Claim the first handler\n\t\t\t// dataPriv.set( this, \"focus\", ... )\n\t\t\t// dataPriv.set( this, \"blur\", ... )\n\t\t\tleverageNative( this, type, expectSync );\n\n\t\t\t// Return false to allow normal processing in the caller\n\t\t\treturn false;\n\t\t},\n\t\ttrigger: function() {\n\n\t\t\t// Force setup before trigger\n\t\t\tleverageNative( this, type );\n\n\t\t\t// Return non-false to allow normal event-path propagation\n\t\t\treturn true;\n\t\t},\n\n\t\tdelegateType: delegateType\n\t};\n} );\n\n// Create mouseenter/leave events using mouseover/out and event-time checks\n// so that event delegation works in jQuery.\n// Do the same for pointerenter/pointerleave and pointerover/pointerout\n//\n// Support: Safari 7 only\n// Safari sends mouseenter too often; see:\n// https://bugs.chromium.org/p/chromium/issues/detail?id=470258\n// for the description of the bug (it existed in older Chrome versions as well).\njQuery.each( {\n\tmouseenter: \"mouseover\",\n\tmouseleave: \"mouseout\",\n\tpointerenter: \"pointerover\",\n\tpointerleave: \"pointerout\"\n}, function( orig, fix ) {\n\tjQuery.event.special[ orig ] = {\n\t\tdelegateType: fix,\n\t\tbindType: fix,\n\n\t\thandle: function( event ) {\n\t\t\tvar ret,\n\t\t\t\ttarget = this,\n\t\t\t\trelated = event.relatedTarget,\n\t\t\t\thandleObj = event.handleObj;\n\n\t\t\t// For mouseenter/leave call the handler if related is outside the target.\n\t\t\t// NB: No relatedTarget if the mouse left/entered the browser window\n\t\t\tif ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {\n\t\t\t\tevent.type = handleObj.origType;\n\t\t\t\tret = handleObj.handler.apply( this, arguments );\n\t\t\t\tevent.type = fix;\n\t\t\t}\n\t\t\treturn ret;\n\t\t}\n\t};\n} );\n\njQuery.fn.extend( {\n\n\ton: function( types, selector, data, fn ) {\n\t\treturn on( this, types, selector, data, fn );\n\t},\n\tone: function( types, selector, data, fn ) {\n\t\treturn on( this, types, selector, data, fn, 1 );\n\t},\n\toff: function( types, selector, fn ) {\n\t\tvar handleObj, type;\n\t\tif ( types && types.preventDefault && types.handleObj ) {\n\n\t\t\t// ( event )  dispatched jQuery.Event\n\t\t\thandleObj = types.handleObj;\n\t\t\tjQuery( types.delegateTarget ).off(\n\t\t\t\thandleObj.namespace ?\n\t\t\t\t\thandleObj.origType + \".\" + handleObj.namespace :\n\t\t\t\t\thandleObj.origType,\n\t\t\t\thandleObj.selector,\n\t\t\t\thandleObj.handler\n\t\t\t);\n\t\t\treturn this;\n\t\t}\n\t\tif ( typeof types === \"object\" ) {\n\n\t\t\t// ( types-object [, selector] )\n\t\t\tfor ( type in types ) {\n\t\t\t\tthis.off( type, selector, types[ type ] );\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\t\tif ( selector === false || typeof selector === \"function\" ) {\n\n\t\t\t// ( types [, fn] )\n\t\t\tfn = selector;\n\t\t\tselector = undefined;\n\t\t}\n\t\tif ( fn === false ) {\n\t\t\tfn = returnFalse;\n\t\t}\n\t\treturn this.each( function() {\n\t\t\tjQuery.event.remove( this, types, fn, selector );\n\t\t} );\n\t}\n} );\n\n\nvar\n\n\t/* eslint-disable max-len */\n\n\t// See https://github.com/eslint/eslint/issues/3229\n\trxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\\/\\0>\\x20\\t\\r\\n\\f]*)[^>]*)\\/>/gi,\n\n\t/* eslint-enable */\n\n\t// Support: IE <=10 - 11, Edge 12 - 13 only\n\t// In IE/Edge using regex groups here causes severe slowdowns.\n\t// See https://connect.microsoft.com/IE/feedback/details/1736512/\n\trnoInnerhtml = /<script|<style|<link/i,\n\n\t// checked=\"checked\" or checked\n\trchecked = /checked\\s*(?:[^=]|=\\s*.checked.)/i,\n\trcleanScript = /^\\s*<!(?:\\[CDATA\\[|--)|(?:\\]\\]|--)>\\s*$/g;\n\n// Prefer a tbody over its parent table for containing new rows\nfunction manipulationTarget( elem, content ) {\n\tif ( nodeName( elem, \"table\" ) &&\n\t\tnodeName( content.nodeType !== 11 ? content : content.firstChild, \"tr\" ) ) {\n\n\t\treturn jQuery( elem ).children( \"tbody\" )[ 0 ] || elem;\n\t}\n\n\treturn elem;\n}\n\n// Replace/restore the type attribute of script elements for safe DOM manipulation\nfunction disableScript( elem ) {\n\telem.type = ( elem.getAttribute( \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}\nfunction restoreScript( elem ) {\n\tif ( ( elem.type || \"\" ).slice( 0, 5 ) === \"true/\" ) {\n\t\telem.type = elem.type.slice( 5 );\n\t} else {\n\t\telem.removeAttribute( \"type\" );\n\t}\n\n\treturn elem;\n}\n\nfunction cloneCopyEvent( src, dest ) {\n\tvar i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;\n\n\tif ( dest.nodeType !== 1 ) {\n\t\treturn;\n\t}\n\n\t// 1. Copy private data: events, handlers, etc.\n\tif ( dataPriv.hasData( src ) ) {\n\t\tpdataOld = dataPriv.access( src );\n\t\tpdataCur = dataPriv.set( dest, pdataOld );\n\t\tevents = pdataOld.events;\n\n\t\tif ( events ) {\n\t\t\tdelete pdataCur.handle;\n\t\t\tpdataCur.events = {};\n\n\t\t\tfor ( type in events ) {\n\t\t\t\tfor ( i = 0, l = events[ type ].length; i < l; i++ ) {\n\t\t\t\t\tjQuery.event.add( dest, type, events[ type ][ i ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// 2. Copy user data\n\tif ( dataUser.hasData( src ) ) {\n\t\tudataOld = dataUser.access( src );\n\t\tudataCur = jQuery.extend( {}, udataOld );\n\n\t\tdataUser.set( dest, udataCur );\n\t}\n}\n\n// Fix IE bugs, see support tests\nfunction fixInput( src, dest ) {\n\tvar nodeName = dest.nodeName.toLowerCase();\n\n\t// Fails to persist the checked state of a cloned checkbox or radio button.\n\tif ( nodeName === \"input\" && rcheckableType.test( src.type ) ) {\n\t\tdest.checked = src.checked;\n\n\t// Fails to return the selected option to the default selected state when cloning options\n\t} else if ( nodeName === \"input\" || nodeName === \"textarea\" ) {\n\t\tdest.defaultValue = src.defaultValue;\n\t}\n}\n\nfunction domManip( collection, args, callback, ignored ) {\n\n\t// Flatten any nested arrays\n\targs = concat.apply( [], args );\n\n\tvar fragment, first, scripts, hasScripts, node, doc,\n\t\ti = 0,\n\t\tl = collection.length,\n\t\tiNoClone = l - 1,\n\t\tvalue = args[ 0 ],\n\t\tvalueIsFunction = isFunction( value );\n\n\t// We can't cloneNode fragments that contain checked, in WebKit\n\tif ( valueIsFunction ||\n\t\t\t( l > 1 && typeof value === \"string\" &&\n\t\t\t\t!support.checkClone && rchecked.test( value ) ) ) {\n\t\treturn collection.each( function( index ) {\n\t\t\tvar self = collection.eq( index );\n\t\t\tif ( valueIsFunction ) {\n\t\t\t\targs[ 0 ] = value.call( this, index, self.html() );\n\t\t\t}\n\t\t\tdomManip( self, args, callback, ignored );\n\t\t} );\n\t}\n\n\tif ( l ) {\n\t\tfragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );\n\t\tfirst = fragment.firstChild;\n\n\t\tif ( fragment.childNodes.length === 1 ) {\n\t\t\tfragment = first;\n\t\t}\n\n\t\t// Require either new content or an interest in ignored elements to invoke the callback\n\t\tif ( first || ignored ) {\n\t\t\tscripts = jQuery.map( getAll( fragment, \"script\" ), disableScript );\n\t\t\thasScripts = scripts.length;\n\n\t\t\t// Use the original fragment for the last item\n\t\t\t// instead of the first because it can end up\n\t\t\t// being emptied incorrectly in certain situations (#8070).\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tnode = fragment;\n\n\t\t\t\tif ( i !== iNoClone ) {\n\t\t\t\t\tnode = jQuery.clone( node, true, true );\n\n\t\t\t\t\t// Keep references to cloned scripts for later restoration\n\t\t\t\t\tif ( hasScripts ) {\n\n\t\t\t\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\t\t\tjQuery.merge( scripts, getAll( node, \"script\" ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcallback.call( collection[ i ], node, i );\n\t\t\t}\n\n\t\t\tif ( hasScripts ) {\n\t\t\t\tdoc = scripts[ scripts.length - 1 ].ownerDocument;\n\n\t\t\t\t// Reenable scripts\n\t\t\t\tjQuery.map( scripts, restoreScript );\n\n\t\t\t\t// Evaluate executable scripts on first document insertion\n\t\t\t\tfor ( i = 0; i < hasScripts; i++ ) {\n\t\t\t\t\tnode = scripts[ i ];\n\t\t\t\t\tif ( rscriptType.test( node.type || \"\" ) &&\n\t\t\t\t\t\t!dataPriv.access( node, \"globalEval\" ) &&\n\t\t\t\t\t\tjQuery.contains( doc, node ) ) {\n\n\t\t\t\t\t\tif ( node.src && ( node.type || \"\" ).toLowerCase()  !== \"module\" ) {\n\n\t\t\t\t\t\t\t// Optional AJAX dependency, but won't run scripts if not present\n\t\t\t\t\t\t\tif ( jQuery._evalUrl && !node.noModule ) {\n\t\t\t\t\t\t\t\tjQuery._evalUrl( node.src, {\n\t\t\t\t\t\t\t\t\tnonce: node.nonce || node.getAttribute( \"nonce\" )\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tDOMEval( node.textContent.replace( rcleanScript, \"\" ), node, doc );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn collection;\n}\n\nfunction remove( elem, selector, keepData ) {\n\tvar node,\n\t\tnodes = selector ? jQuery.filter( selector, elem ) : elem,\n\t\ti = 0;\n\n\tfor ( ; ( node = nodes[ i ] ) != null; i++ ) {\n\t\tif ( !keepData && node.nodeType === 1 ) {\n\t\t\tjQuery.cleanData( getAll( node ) );\n\t\t}\n\n\t\tif ( node.parentNode ) {\n\t\t\tif ( keepData && isAttached( node ) ) {\n\t\t\t\tsetGlobalEval( getAll( node, \"script\" ) );\n\t\t\t}\n\t\t\tnode.parentNode.removeChild( node );\n\t\t}\n\t}\n\n\treturn elem;\n}\n\njQuery.extend( {\n\thtmlPrefilter: function( html ) {\n\t\treturn html.replace( rxhtmlTag, \"<$1></$2>\" );\n\t},\n\n\tclone: function( elem, dataAndEvents, deepDataAndEvents ) {\n\t\tvar i, l, srcElements, destElements,\n\t\t\tclone = elem.cloneNode( true ),\n\t\t\tinPage = isAttached( elem );\n\n\t\t// Fix IE cloning issues\n\t\tif ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&\n\t\t\t\t!jQuery.isXMLDoc( elem ) ) {\n\n\t\t\t// We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2\n\t\t\tdestElements = getAll( clone );\n\t\t\tsrcElements = getAll( elem );\n\n\t\t\tfor ( i = 0, l = srcElements.length; i < l; i++ ) {\n\t\t\t\tfixInput( srcElements[ i ], destElements[ i ] );\n\t\t\t}\n\t\t}\n\n\t\t// Copy the events from the original to the clone\n\t\tif ( dataAndEvents ) {\n\t\t\tif ( deepDataAndEvents ) {\n\t\t\t\tsrcElements = srcElements || getAll( elem );\n\t\t\t\tdestElements = destElements || getAll( clone );\n\n\t\t\t\tfor ( i = 0, l = srcElements.length; i < l; i++ ) {\n\t\t\t\t\tcloneCopyEvent( srcElements[ i ], destElements[ i ] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcloneCopyEvent( elem, clone );\n\t\t\t}\n\t\t}\n\n\t\t// Preserve script evaluation history\n\t\tdestElements = getAll( clone, \"script\" );\n\t\tif ( destElements.length > 0 ) {\n\t\t\tsetGlobalEval( destElements, !inPage && getAll( elem, \"script\" ) );\n\t\t}\n\n\t\t// Return the cloned set\n\t\treturn clone;\n\t},\n\n\tcleanData: function( elems ) {\n\t\tvar data, elem, type,\n\t\t\tspecial = jQuery.event.special,\n\t\t\ti = 0;\n\n\t\tfor ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {\n\t\t\tif ( acceptData( elem ) ) {\n\t\t\t\tif ( ( data = elem[ dataPriv.expando ] ) ) {\n\t\t\t\t\tif ( data.events ) {\n\t\t\t\t\t\tfor ( type in data.events ) {\n\t\t\t\t\t\t\tif ( special[ type ] ) {\n\t\t\t\t\t\t\t\tjQuery.event.remove( elem, type );\n\n\t\t\t\t\t\t\t// This is a shortcut to avoid jQuery.event.remove's overhead\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tjQuery.removeEvent( elem, type, data.handle );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Support: Chrome <=35 - 45+\n\t\t\t\t\t// Assign undefined instead of using delete, see Data#remove\n\t\t\t\t\telem[ dataPriv.expando ] = undefined;\n\t\t\t\t}\n\t\t\t\tif ( elem[ dataUser.expando ] ) {\n\n\t\t\t\t\t// Support: Chrome <=35 - 45+\n\t\t\t\t\t// Assign undefined instead of using delete, see Data#remove\n\t\t\t\t\telem[ dataUser.expando ] = undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n} );\n\njQuery.fn.extend( {\n\tdetach: function( selector ) {\n\t\treturn remove( this, selector, true );\n\t},\n\n\tremove: function( selector ) {\n\t\treturn remove( this, selector );\n\t},\n\n\ttext: function( value ) {\n\t\treturn access( this, function( value ) {\n\t\t\treturn value === undefined ?\n\t\t\t\tjQuery.text( this ) :\n\t\t\t\tthis.empty().each( function() {\n\t\t\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\t\t\tthis.textContent = value;\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t}, null, value, arguments.length );\n\t},\n\n\tappend: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\tvar target = manipulationTarget( this, elem );\n\t\t\t\ttarget.appendChild( elem );\n\t\t\t}\n\t\t} );\n\t},\n\n\tprepend: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\tvar target = manipulationTarget( this, elem );\n\t\t\t\ttarget.insertBefore( elem, target.firstChild );\n\t\t\t}\n\t\t} );\n\t},\n\n\tbefore: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.parentNode ) {\n\t\t\t\tthis.parentNode.insertBefore( elem, this );\n\t\t\t}\n\t\t} );\n\t},\n\n\tafter: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.parentNode ) {\n\t\t\t\tthis.parentNode.insertBefore( elem, this.nextSibling );\n\t\t\t}\n\t\t} );\n\t},\n\n\tempty: function() {\n\t\tvar elem,\n\t\t\ti = 0;\n\n\t\tfor ( ; ( elem = this[ i ] ) != null; i++ ) {\n\t\t\tif ( elem.nodeType === 1 ) {\n\n\t\t\t\t// Prevent memory leaks\n\t\t\t\tjQuery.cleanData( getAll( elem, false ) );\n\n\t\t\t\t// Remove any remaining nodes\n\t\t\t\telem.textContent = \"\";\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tclone: function( dataAndEvents, deepDataAndEvents ) {\n\t\tdataAndEvents = dataAndEvents == null ? false : dataAndEvents;\n\t\tdeepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;\n\n\t\treturn this.map( function() {\n\t\t\treturn jQuery.clone( this, dataAndEvents, deepDataAndEvents );\n\t\t} );\n\t},\n\n\thtml: function( value ) {\n\t\treturn access( this, function( value ) {\n\t\t\tvar elem = this[ 0 ] || {},\n\t\t\t\ti = 0,\n\t\t\t\tl = this.length;\n\n\t\t\tif ( value === undefined && elem.nodeType === 1 ) {\n\t\t\t\treturn elem.innerHTML;\n\t\t\t}\n\n\t\t\t// See if we can take a shortcut and just use innerHTML\n\t\t\tif ( typeof value === \"string\" && !rnoInnerhtml.test( value ) &&\n\t\t\t\t!wrapMap[ ( rtagName.exec( value ) || [ \"\", \"\" ] )[ 1 ].toLowerCase() ] ) {\n\n\t\t\t\tvalue = jQuery.htmlPrefilter( value );\n\n\t\t\t\ttry {\n\t\t\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\t\t\telem = this[ i ] || {};\n\n\t\t\t\t\t\t// Remove element nodes and prevent memory leaks\n\t\t\t\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\t\t\t\tjQuery.cleanData( getAll( elem, false ) );\n\t\t\t\t\t\t\telem.innerHTML = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\telem = 0;\n\n\t\t\t\t// If using innerHTML throws an exception, use the fallback method\n\t\t\t\t} catch ( e ) {}\n\t\t\t}\n\n\t\t\tif ( elem ) {\n\t\t\t\tthis.empty().append( value );\n\t\t\t}\n\t\t}, null, value, arguments.length );\n\t},\n\n\treplaceWith: function() {\n\t\tvar ignored = [];\n\n\t\t// Make the changes, replacing each non-ignored context element with the new content\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tvar parent = this.parentNode;\n\n\t\t\tif ( jQuery.inArray( this, ignored ) < 0 ) {\n\t\t\t\tjQuery.cleanData( getAll( this ) );\n\t\t\t\tif ( parent ) {\n\t\t\t\t\tparent.replaceChild( elem, this );\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Force callback invocation\n\t\t}, ignored );\n\t}\n} );\n\njQuery.each( {\n\tappendTo: \"append\",\n\tprependTo: \"prepend\",\n\tinsertBefore: \"before\",\n\tinsertAfter: \"after\",\n\treplaceAll: \"replaceWith\"\n}, function( name, original ) {\n\tjQuery.fn[ name ] = function( selector ) {\n\t\tvar elems,\n\t\t\tret = [],\n\t\t\tinsert = jQuery( selector ),\n\t\t\tlast = insert.length - 1,\n\t\t\ti = 0;\n\n\t\tfor ( ; i <= last; i++ ) {\n\t\t\telems = i === last ? this : this.clone( true );\n\t\t\tjQuery( insert[ i ] )[ original ]( elems );\n\n\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t// .get() because push.apply(_, arraylike) throws on ancient WebKit\n\t\t\tpush.apply( ret, elems.get() );\n\t\t}\n\n\t\treturn this.pushStack( ret );\n\t};\n} );\nvar rnumnonpx = new RegExp( \"^(\" + pnum + \")(?!px)[a-z%]+$\", \"i\" );\n\nvar getStyles = function( elem ) {\n\n\t\t// Support: IE <=11 only, Firefox <=30 (#15098, #14150)\n\t\t// IE throws on elements created in popups\n\t\t// FF meanwhile throws on frame elements through \"defaultView.getComputedStyle\"\n\t\tvar view = elem.ownerDocument.defaultView;\n\n\t\tif ( !view || !view.opener ) {\n\t\t\tview = window;\n\t\t}\n\n\t\treturn view.getComputedStyle( elem );\n\t};\n\nvar rboxStyle = new RegExp( cssExpand.join( \"|\" ), \"i\" );\n\n\n\n( function() {\n\n\t// Executing both pixelPosition & boxSizingReliable tests require only one layout\n\t// so they're executed at the same time to save the second computation.\n\tfunction computeStyleTests() {\n\n\t\t// This is a singleton, we need to execute it only once\n\t\tif ( !div ) {\n\t\t\treturn;\n\t\t}\n\n\t\tcontainer.style.cssText = \"position:absolute;left:-11111px;width:60px;\" +\n\t\t\t\"margin-top:1px;padding:0;border:0\";\n\t\tdiv.style.cssText =\n\t\t\t\"position:relative;display:block;box-sizing:border-box;overflow:scroll;\" +\n\t\t\t\"margin:auto;border:1px;padding:1px;\" +\n\t\t\t\"width:60%;top:1%\";\n\t\tdocumentElement.appendChild( container ).appendChild( div );\n\n\t\tvar divStyle = window.getComputedStyle( div );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\treliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;\n\n\t\t// Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3\n\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\tdiv.style.right = \"60%\";\n\t\tpixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;\n\n\t\t// Support: IE 9 - 11 only\n\t\t// Detect misreporting of content dimensions for box-sizing:border-box elements\n\t\tboxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;\n\n\t\t// Support: IE 9 only\n\t\t// Detect overflow:scroll screwiness (gh-3699)\n\t\t// Support: Chrome <=64\n\t\t// Don't get tricked when zoom affects offsetWidth (gh-4029)\n\t\tdiv.style.position = \"absolute\";\n\t\tscrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;\n\n\t\tdocumentElement.removeChild( container );\n\n\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t// it will also be a sign that checks already performed\n\t\tdiv = null;\n\t}\n\n\tfunction roundPixelMeasures( measure ) {\n\t\treturn Math.round( parseFloat( measure ) );\n\t}\n\n\tvar pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,\n\t\treliableMarginLeftVal,\n\t\tcontainer = document.createElement( \"div\" ),\n\t\tdiv = document.createElement( \"div\" );\n\n\t// Finish early in limited (non-browser) environments\n\tif ( !div.style ) {\n\t\treturn;\n\t}\n\n\t// Support: IE <=9 - 11 only\n\t// Style of cloned element affects source element cloned (#8908)\n\tdiv.style.backgroundClip = \"content-box\";\n\tdiv.cloneNode( true ).style.backgroundClip = \"\";\n\tsupport.clearCloneStyle = div.style.backgroundClip === \"content-box\";\n\n\tjQuery.extend( support, {\n\t\tboxSizingReliable: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn boxSizingReliableVal;\n\t\t},\n\t\tpixelBoxStyles: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn pixelBoxStylesVal;\n\t\t},\n\t\tpixelPosition: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn pixelPositionVal;\n\t\t},\n\t\treliableMarginLeft: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn reliableMarginLeftVal;\n\t\t},\n\t\tscrollboxSize: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn scrollboxSizeVal;\n\t\t}\n\t} );\n} )();\n\n\nfunction curCSS( elem, name, computed ) {\n\tvar width, minWidth, maxWidth, ret,\n\n\t\t// Support: Firefox 51+\n\t\t// Retrieving style before computed somehow\n\t\t// fixes an issue with getting wrong values\n\t\t// on detached elements\n\t\tstyle = elem.style;\n\n\tcomputed = computed || getStyles( elem );\n\n\t// getPropertyValue is needed for:\n\t//   .css('filter') (IE 9 only, #12537)\n\t//   .css('--customProperty) (#3144)\n\tif ( computed ) {\n\t\tret = computed.getPropertyValue( name ) || computed[ name ];\n\n\t\tif ( ret === \"\" && !isAttached( elem ) ) {\n\t\t\tret = jQuery.style( elem, name );\n\t\t}\n\n\t\t// A tribute to the \"awesome hack by Dean Edwards\"\n\t\t// Android Browser returns percentage for some values,\n\t\t// but width seems to be reliably pixels.\n\t\t// This is against the CSSOM draft spec:\n\t\t// https://drafts.csswg.org/cssom/#resolved-values\n\t\tif ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) {\n\n\t\t\t// Remember the original values\n\t\t\twidth = style.width;\n\t\t\tminWidth = style.minWidth;\n\t\t\tmaxWidth = style.maxWidth;\n\n\t\t\t// Put in the new values to get a computed value out\n\t\t\tstyle.minWidth = style.maxWidth = style.width = ret;\n\t\t\tret = computed.width;\n\n\t\t\t// Revert the changed values\n\t\t\tstyle.width = width;\n\t\t\tstyle.minWidth = minWidth;\n\t\t\tstyle.maxWidth = maxWidth;\n\t\t}\n\t}\n\n\treturn ret !== undefined ?\n\n\t\t// Support: IE <=9 - 11 only\n\t\t// IE returns zIndex value as an integer.\n\t\tret + \"\" :\n\t\tret;\n}\n\n\nfunction addGetHookIf( conditionFn, hookFn ) {\n\n\t// Define the hook, we'll check on the first run if it's really needed.\n\treturn {\n\t\tget: function() {\n\t\t\tif ( conditionFn() ) {\n\n\t\t\t\t// Hook not needed (or it's not possible to use it due\n\t\t\t\t// to missing dependency), remove it.\n\t\t\t\tdelete this.get;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Hook needed; redefine it so that the support test is not executed again.\n\t\t\treturn ( this.get = hookFn ).apply( this, arguments );\n\t\t}\n\t};\n}\n\n\nvar cssPrefixes = [ \"Webkit\", \"Moz\", \"ms\" ],\n\temptyStyle = document.createElement( \"div\" ).style,\n\tvendorProps = {};\n\n// Return a vendor-prefixed property or undefined\nfunction vendorPropName( name ) {\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}\n\n// Return a potentially-mapped jQuery.cssProps or vendor prefixed property\nfunction finalPropName( name ) {\n\tvar final = jQuery.cssProps[ name ] || vendorProps[ name ];\n\n\tif ( final ) {\n\t\treturn final;\n\t}\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\treturn vendorProps[ name ] = vendorPropName( name ) || name;\n}\n\n\nvar\n\n\t// Swappable if display is none or starts with table\n\t// except \"table\", \"table-cell\", or \"table-caption\"\n\t// See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display\n\trdisplayswap = /^(none|table(?!-c[ea]).+)/,\n\trcustomProp = /^--/,\n\tcssShow = { position: \"absolute\", visibility: \"hidden\", display: \"block\" },\n\tcssNormalTransform = {\n\t\tletterSpacing: \"0\",\n\t\tfontWeight: \"400\"\n\t};\n\nfunction setPositiveNumber( elem, value, subtract ) {\n\n\t// Any relative (+/-) values have already been\n\t// normalized at this point\n\tvar matches = rcssNum.exec( value );\n\treturn matches ?\n\n\t\t// Guard against undefined \"subtract\", e.g., when used as in cssHooks\n\t\tMath.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || \"px\" ) :\n\t\tvalue;\n}\n\nfunction boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {\n\tvar i = dimension === \"width\" ? 1 : 0,\n\t\textra = 0,\n\t\tdelta = 0;\n\n\t// Adjustment may not be necessary\n\tif ( box === ( isBorderBox ? \"border\" : \"content\" ) ) {\n\t\treturn 0;\n\t}\n\n\tfor ( ; i < 4; i += 2 ) {\n\n\t\t// Both box models exclude margin\n\t\tif ( box === \"margin\" ) {\n\t\t\tdelta += jQuery.css( elem, box + cssExpand[ i ], true, styles );\n\t\t}\n\n\t\t// If we get here with a content-box, we're seeking \"padding\" or \"border\" or \"margin\"\n\t\tif ( !isBorderBox ) {\n\n\t\t\t// Add padding\n\t\t\tdelta += jQuery.css( elem, \"padding\" + cssExpand[ i ], true, styles );\n\n\t\t\t// For \"border\" or \"margin\", add border\n\t\t\tif ( box !== \"padding\" ) {\n\t\t\t\tdelta += jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\n\t\t\t// But still keep track of it otherwise\n\t\t\t} else {\n\t\t\t\textra += jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\t\t\t}\n\n\t\t// If we get here with a border-box (content + padding + border), we're seeking \"content\" or\n\t\t// \"padding\" or \"margin\"\n\t\t} else {\n\n\t\t\t// For \"content\", subtract padding\n\t\t\tif ( box === \"content\" ) {\n\t\t\t\tdelta -= jQuery.css( elem, \"padding\" + cssExpand[ i ], true, styles );\n\t\t\t}\n\n\t\t\t// For \"content\" or \"padding\", subtract border\n\t\t\tif ( box !== \"margin\" ) {\n\t\t\t\tdelta -= jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Account for positive content-box scroll gutter when requested by providing computedVal\n\tif ( !isBorderBox && computedVal >= 0 ) {\n\n\t\t// offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border\n\t\t// Assuming integer scroll gutter, subtract the rest and round down\n\t\tdelta += Math.max( 0, Math.ceil(\n\t\t\telem[ \"offset\" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -\n\t\t\tcomputedVal -\n\t\t\tdelta -\n\t\t\textra -\n\t\t\t0.5\n\n\t\t// If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter\n\t\t// Use an explicit zero to avoid NaN (gh-3964)\n\t\t) ) || 0;\n\t}\n\n\treturn delta;\n}\n\nfunction getWidthOrHeight( elem, dimension, extra ) {\n\n\t// Start with computed style\n\tvar styles = getStyles( elem ),\n\n\t\t// To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).\n\t\t// Fake content-box until we know it's needed to know the true value.\n\t\tboxSizingNeeded = !support.boxSizingReliable() || extra,\n\t\tisBorderBox = boxSizingNeeded &&\n\t\t\tjQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\",\n\t\tvalueIsBorderBox = isBorderBox,\n\n\t\tval = curCSS( elem, dimension, styles ),\n\t\toffsetProp = \"offset\" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 );\n\n\t// Support: Firefox <=54\n\t// Return a confounding non-pixel value or feign ignorance, as appropriate.\n\tif ( rnumnonpx.test( val ) ) {\n\t\tif ( !extra ) {\n\t\t\treturn val;\n\t\t}\n\t\tval = \"auto\";\n\t}\n\n\n\t// Fall back to offsetWidth/offsetHeight when value is \"auto\"\n\t// This happens for inline elements with no explicit setting (gh-3571)\n\t// Support: Android <=4.1 - 4.3 only\n\t// Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)\n\t// Support: IE 9-11 only\n\t// Also use offsetWidth/offsetHeight for when box sizing is unreliable\n\t// We use getClientRects() to check for hidden/disconnected.\n\t// In those cases, the computed value can be trusted to be border-box\n\tif ( ( !support.boxSizingReliable() && isBorderBox ||\n\t\tval === \"auto\" ||\n\t\t!parseFloat( val ) && jQuery.css( elem, \"display\", false, styles ) === \"inline\" ) &&\n\t\telem.getClientRects().length ) {\n\n\t\tisBorderBox = jQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\";\n\n\t\t// Where available, offsetWidth/offsetHeight approximate border box dimensions.\n\t\t// Where not available (e.g., SVG), assume unreliable box-sizing and interpret the\n\t\t// retrieved value as a content box dimension.\n\t\tvalueIsBorderBox = offsetProp in elem;\n\t\tif ( valueIsBorderBox ) {\n\t\t\tval = elem[ offsetProp ];\n\t\t}\n\t}\n\n\t// Normalize \"\" and auto\n\tval = parseFloat( val ) || 0;\n\n\t// Adjust for the element's box model\n\treturn ( val +\n\t\tboxModelAdjustment(\n\t\t\telem,\n\t\t\tdimension,\n\t\t\textra || ( isBorderBox ? \"border\" : \"content\" ),\n\t\t\tvalueIsBorderBox,\n\t\t\tstyles,\n\n\t\t\t// Provide the current computed size to request scroll gutter calculation (gh-3589)\n\t\t\tval\n\t\t)\n\t) + \"px\";\n}\n\njQuery.extend( {\n\n\t// Add in style property hooks for overriding the default\n\t// behavior of getting and setting a style property\n\tcssHooks: {\n\t\topacity: {\n\t\t\tget: function( elem, computed ) {\n\t\t\t\tif ( computed ) {\n\n\t\t\t\t\t// We should always get a number back from opacity\n\t\t\t\t\tvar ret = curCSS( elem, \"opacity\" );\n\t\t\t\t\treturn ret === \"\" ? \"1\" : ret;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\t// Don't automatically add \"px\" to these possibly-unitless properties\n\tcssNumber: {\n\t\t\"animationIterationCount\": true,\n\t\t\"columnCount\": true,\n\t\t\"fillOpacity\": true,\n\t\t\"flexGrow\": true,\n\t\t\"flexShrink\": true,\n\t\t\"fontWeight\": true,\n\t\t\"gridArea\": true,\n\t\t\"gridColumn\": true,\n\t\t\"gridColumnEnd\": true,\n\t\t\"gridColumnStart\": true,\n\t\t\"gridRow\": true,\n\t\t\"gridRowEnd\": true,\n\t\t\"gridRowStart\": true,\n\t\t\"lineHeight\": true,\n\t\t\"opacity\": true,\n\t\t\"order\": true,\n\t\t\"orphans\": true,\n\t\t\"widows\": true,\n\t\t\"zIndex\": true,\n\t\t\"zoom\": true\n\t},\n\n\t// Add in properties whose names you wish to fix before\n\t// setting or getting the value\n\tcssProps: {},\n\n\t// Get and set the style property on a DOM Node\n\tstyle: function( elem, name, value, extra ) {\n\n\t\t// Don't set styles on text and comment nodes\n\t\tif ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Make sure that we're working with the right name\n\t\tvar ret, type, hooks,\n\t\t\torigName = camelCase( name ),\n\t\t\tisCustomProp = rcustomProp.test( name ),\n\t\t\tstyle = elem.style;\n\n\t\t// Make sure that we're working with the right name. We don't\n\t\t// want to query the value if it is a CSS custom property\n\t\t// since they are user-defined.\n\t\tif ( !isCustomProp ) {\n\t\t\tname = finalPropName( origName );\n\t\t}\n\n\t\t// Gets hook for the prefixed version, then unprefixed version\n\t\thooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n\t\t// Check if we're setting a value\n\t\tif ( value !== undefined ) {\n\t\t\ttype = typeof value;\n\n\t\t\t// Convert \"+=\" or \"-=\" to relative numbers (#7345)\n\t\t\tif ( type === \"string\" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {\n\t\t\t\tvalue = adjustCSS( elem, name, ret );\n\n\t\t\t\t// Fixes bug #9237\n\t\t\t\ttype = \"number\";\n\t\t\t}\n\n\t\t\t// Make sure that null and NaN values aren't set (#7116)\n\t\t\tif ( value == null || value !== value ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If a number was passed in, add the unit (except for certain CSS properties)\n\t\t\t// The isCustomProp check can be removed in jQuery 4.0 when we only auto-append\n\t\t\t// \"px\" to a few hardcoded values.\n\t\t\tif ( type === \"number\" && !isCustomProp ) {\n\t\t\t\tvalue += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? \"\" : \"px\" );\n\t\t\t}\n\n\t\t\t// background-* props affect original clone's values\n\t\t\tif ( !support.clearCloneStyle && value === \"\" && name.indexOf( \"background\" ) === 0 ) {\n\t\t\t\tstyle[ name ] = \"inherit\";\n\t\t\t}\n\n\t\t\t// If a hook was provided, use that value, otherwise just set the specified value\n\t\t\tif ( !hooks || !( \"set\" in hooks ) ||\n\t\t\t\t( value = hooks.set( elem, value, extra ) ) !== undefined ) {\n\n\t\t\t\tif ( isCustomProp ) {\n\t\t\t\t\tstyle.setProperty( name, value );\n\t\t\t\t} else {\n\t\t\t\t\tstyle[ name ] = value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// If a hook was provided get the non-computed value from there\n\t\t\tif ( hooks && \"get\" in hooks &&\n\t\t\t\t( ret = hooks.get( elem, false, extra ) ) !== undefined ) {\n\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\t// Otherwise just get the value from the style object\n\t\t\treturn style[ name ];\n\t\t}\n\t},\n\n\tcss: function( elem, name, extra, styles ) {\n\t\tvar val, num, hooks,\n\t\t\torigName = camelCase( name ),\n\t\t\tisCustomProp = rcustomProp.test( name );\n\n\t\t// Make sure that we're working with the right name. We don't\n\t\t// want to modify the value if it is a CSS custom property\n\t\t// since they are user-defined.\n\t\tif ( !isCustomProp ) {\n\t\t\tname = finalPropName( origName );\n\t\t}\n\n\t\t// Try prefixed name followed by the unprefixed name\n\t\thooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n\t\t// If a hook was provided get the computed value from there\n\t\tif ( hooks && \"get\" in hooks ) {\n\t\t\tval = hooks.get( elem, true, extra );\n\t\t}\n\n\t\t// Otherwise, if a way to get the computed value exists, use that\n\t\tif ( val === undefined ) {\n\t\t\tval = curCSS( elem, name, styles );\n\t\t}\n\n\t\t// Convert \"normal\" to computed value\n\t\tif ( val === \"normal\" && name in cssNormalTransform ) {\n\t\t\tval = cssNormalTransform[ name ];\n\t\t}\n\n\t\t// Make numeric if forced or a qualifier was provided and val looks numeric\n\t\tif ( extra === \"\" || extra ) {\n\t\t\tnum = parseFloat( val );\n\t\t\treturn extra === true || isFinite( num ) ? num || 0 : val;\n\t\t}\n\n\t\treturn val;\n\t}\n} );\n\njQuery.each( [ \"height\", \"width\" ], function( i, dimension ) {\n\tjQuery.cssHooks[ dimension ] = {\n\t\tget: function( elem, computed, extra ) {\n\t\t\tif ( computed ) {\n\n\t\t\t\t// Certain elements can have dimension info if we invisibly show them\n\t\t\t\t// but it must have a current display style that would benefit\n\t\t\t\treturn rdisplayswap.test( jQuery.css( elem, \"display\" ) ) &&\n\n\t\t\t\t\t// Support: Safari 8+\n\t\t\t\t\t// Table columns in Safari have non-zero offsetWidth & zero\n\t\t\t\t\t// getBoundingClientRect().width unless display is changed.\n\t\t\t\t\t// Support: IE <=11 only\n\t\t\t\t\t// Running getBoundingClientRect on a disconnected node\n\t\t\t\t\t// in IE throws an error.\n\t\t\t\t\t( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?\n\t\t\t\t\t\tswap( elem, cssShow, function() {\n\t\t\t\t\t\t\treturn getWidthOrHeight( elem, dimension, extra );\n\t\t\t\t\t\t} ) :\n\t\t\t\t\t\tgetWidthOrHeight( elem, dimension, extra );\n\t\t\t}\n\t\t},\n\n\t\tset: function( elem, value, extra ) {\n\t\t\tvar matches,\n\t\t\t\tstyles = getStyles( elem ),\n\n\t\t\t\t// Only read styles.position if the test has a chance to fail\n\t\t\t\t// to avoid forcing a reflow.\n\t\t\t\tscrollboxSizeBuggy = !support.scrollboxSize() &&\n\t\t\t\t\tstyles.position === \"absolute\",\n\n\t\t\t\t// To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991)\n\t\t\t\tboxSizingNeeded = scrollboxSizeBuggy || extra,\n\t\t\t\tisBorderBox = boxSizingNeeded &&\n\t\t\t\t\tjQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\",\n\t\t\t\tsubtract = extra ?\n\t\t\t\t\tboxModelAdjustment(\n\t\t\t\t\t\telem,\n\t\t\t\t\t\tdimension,\n\t\t\t\t\t\textra,\n\t\t\t\t\t\tisBorderBox,\n\t\t\t\t\t\tstyles\n\t\t\t\t\t) :\n\t\t\t\t\t0;\n\n\t\t\t// Account for unreliable border-box dimensions by comparing offset* to computed and\n\t\t\t// faking a content-box to get border and padding (gh-3699)\n\t\t\tif ( isBorderBox && scrollboxSizeBuggy ) {\n\t\t\t\tsubtract -= Math.ceil(\n\t\t\t\t\telem[ \"offset\" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -\n\t\t\t\t\tparseFloat( styles[ dimension ] ) -\n\t\t\t\t\tboxModelAdjustment( elem, dimension, \"border\", false, styles ) -\n\t\t\t\t\t0.5\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Convert to pixels if value adjustment is needed\n\t\t\tif ( subtract && ( matches = rcssNum.exec( value ) ) &&\n\t\t\t\t( matches[ 3 ] || \"px\" ) !== \"px\" ) {\n\n\t\t\t\telem.style[ dimension ] = value;\n\t\t\t\tvalue = jQuery.css( elem, dimension );\n\t\t\t}\n\n\t\t\treturn setPositiveNumber( elem, value, subtract );\n\t\t}\n\t};\n} );\n\njQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,\n\tfunction( elem, computed ) {\n\t\tif ( computed ) {\n\t\t\treturn ( parseFloat( curCSS( elem, \"marginLeft\" ) ) ||\n\t\t\t\telem.getBoundingClientRect().left -\n\t\t\t\t\tswap( elem, { marginLeft: 0 }, function() {\n\t\t\t\t\t\treturn elem.getBoundingClientRect().left;\n\t\t\t\t\t} )\n\t\t\t\t) + \"px\";\n\t\t}\n\t}\n);\n\n// These hooks are used by animate to expand properties\njQuery.each( {\n\tmargin: \"\",\n\tpadding: \"\",\n\tborder: \"Width\"\n}, function( prefix, suffix ) {\n\tjQuery.cssHooks[ prefix + suffix ] = {\n\t\texpand: function( value ) {\n\t\t\tvar i = 0,\n\t\t\t\texpanded = {},\n\n\t\t\t\t// Assumes a single number if not a string\n\t\t\t\tparts = typeof value === \"string\" ? value.split( \" \" ) : [ value ];\n\n\t\t\tfor ( ; i < 4; i++ ) {\n\t\t\t\texpanded[ prefix + cssExpand[ i ] + suffix ] =\n\t\t\t\t\tparts[ i ] || parts[ i - 2 ] || parts[ 0 ];\n\t\t\t}\n\n\t\t\treturn expanded;\n\t\t}\n\t};\n\n\tif ( prefix !== \"margin\" ) {\n\t\tjQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;\n\t}\n} );\n\njQuery.fn.extend( {\n\tcss: function( name, value ) {\n\t\treturn access( this, function( elem, name, value ) {\n\t\t\tvar styles, len,\n\t\t\t\tmap = {},\n\t\t\t\ti = 0;\n\n\t\t\tif ( Array.isArray( name ) ) {\n\t\t\t\tstyles = getStyles( elem );\n\t\t\t\tlen = name.length;\n\n\t\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\t\tmap[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );\n\t\t\t\t}\n\n\t\t\t\treturn map;\n\t\t\t}\n\n\t\t\treturn value !== undefined ?\n\t\t\t\tjQuery.style( elem, name, value ) :\n\t\t\t\tjQuery.css( elem, name );\n\t\t}, name, value, arguments.length > 1 );\n\t}\n} );\n\n\nfunction Tween( elem, options, prop, end, easing ) {\n\treturn new Tween.prototype.init( elem, options, prop, end, easing );\n}\njQuery.Tween = Tween;\n\nTween.prototype = {\n\tconstructor: Tween,\n\tinit: function( elem, options, prop, end, easing, unit ) {\n\t\tthis.elem = elem;\n\t\tthis.prop = prop;\n\t\tthis.easing = easing || jQuery.easing._default;\n\t\tthis.options = options;\n\t\tthis.start = this.now = this.cur();\n\t\tthis.end = end;\n\t\tthis.unit = unit || ( jQuery.cssNumber[ prop ] ? \"\" : \"px\" );\n\t},\n\tcur: function() {\n\t\tvar hooks = Tween.propHooks[ this.prop ];\n\n\t\treturn hooks && hooks.get ?\n\t\t\thooks.get( this ) :\n\t\t\tTween.propHooks._default.get( this );\n\t},\n\trun: function( percent ) {\n\t\tvar eased,\n\t\t\thooks = Tween.propHooks[ this.prop ];\n\n\t\tif ( this.options.duration ) {\n\t\t\tthis.pos = eased = jQuery.easing[ this.easing ](\n\t\t\t\tpercent, this.options.duration * percent, 0, 1, this.options.duration\n\t\t\t);\n\t\t} else {\n\t\t\tthis.pos = eased = percent;\n\t\t}\n\t\tthis.now = ( this.end - this.start ) * eased + this.start;\n\n\t\tif ( this.options.step ) {\n\t\t\tthis.options.step.call( this.elem, this.now, this );\n\t\t}\n\n\t\tif ( hooks && hooks.set ) {\n\t\t\thooks.set( this );\n\t\t} else {\n\t\t\tTween.propHooks._default.set( this );\n\t\t}\n\t\treturn this;\n\t}\n};\n\nTween.prototype.init.prototype = Tween.prototype;\n\nTween.propHooks = {\n\t_default: {\n\t\tget: function( tween ) {\n\t\t\tvar result;\n\n\t\t\t// Use a property on the element directly when it is not a DOM element,\n\t\t\t// or when there is no matching style property that exists.\n\t\t\tif ( tween.elem.nodeType !== 1 ||\n\t\t\t\ttween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {\n\t\t\t\treturn tween.elem[ tween.prop ];\n\t\t\t}\n\n\t\t\t// Passing an empty string as a 3rd parameter to .css will automatically\n\t\t\t// attempt a parseFloat and fallback to a string if the parse fails.\n\t\t\t// Simple values such as \"10px\" are parsed to Float;\n\t\t\t// complex values such as \"rotate(1rad)\" are returned as-is.\n\t\t\tresult = jQuery.css( tween.elem, tween.prop, \"\" );\n\n\t\t\t// Empty strings, null, undefined and \"auto\" are converted to 0.\n\t\t\treturn !result || result === \"auto\" ? 0 : result;\n\t\t},\n\t\tset: function( tween ) {\n\n\t\t\t// Use step hook for back compat.\n\t\t\t// Use cssHook if its there.\n\t\t\t// Use .style if available and use plain properties where available.\n\t\t\tif ( jQuery.fx.step[ tween.prop ] ) {\n\t\t\t\tjQuery.fx.step[ tween.prop ]( tween );\n\t\t\t} else if ( tween.elem.nodeType === 1 && (\n\t\t\t\t\tjQuery.cssHooks[ tween.prop ] ||\n\t\t\t\t\ttween.elem.style[ finalPropName( tween.prop ) ] != null ) ) {\n\t\t\t\tjQuery.style( tween.elem, tween.prop, tween.now + tween.unit );\n\t\t\t} else {\n\t\t\t\ttween.elem[ tween.prop ] = tween.now;\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Support: IE <=9 only\n// Panic based approach to setting things on disconnected nodes\nTween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {\n\tset: function( tween ) {\n\t\tif ( tween.elem.nodeType && tween.elem.parentNode ) {\n\t\t\ttween.elem[ tween.prop ] = tween.now;\n\t\t}\n\t}\n};\n\njQuery.easing = {\n\tlinear: function( p ) {\n\t\treturn p;\n\t},\n\tswing: function( p ) {\n\t\treturn 0.5 - Math.cos( p * Math.PI ) / 2;\n\t},\n\t_default: \"swing\"\n};\n\njQuery.fx = Tween.prototype.init;\n\n// Back compat <1.8 extension point\njQuery.fx.step = {};\n\n\n\n\nvar\n\tfxNow, inProgress,\n\trfxtypes = /^(?:toggle|show|hide)$/,\n\trrun = /queueHooks$/;\n\nfunction schedule() {\n\tif ( inProgress ) {\n\t\tif ( document.hidden === false && window.requestAnimationFrame ) {\n\t\t\twindow.requestAnimationFrame( schedule );\n\t\t} else {\n\t\t\twindow.setTimeout( schedule, jQuery.fx.interval );\n\t\t}\n\n\t\tjQuery.fx.tick();\n\t}\n}\n\n// Animations created synchronously will run synchronously\nfunction createFxNow() {\n\twindow.setTimeout( function() {\n\t\tfxNow = undefined;\n\t} );\n\treturn ( fxNow = Date.now() );\n}\n\n// Generate parameters to create a standard animation\nfunction genFx( type, includeWidth ) {\n\tvar which,\n\t\ti = 0,\n\t\tattrs = { height: type };\n\n\t// If we include width, step value is 1 to do all cssExpand values,\n\t// otherwise step value is 2 to skip over Left and Right\n\tincludeWidth = includeWidth ? 1 : 0;\n\tfor ( ; i < 4; i += 2 - includeWidth ) {\n\t\twhich = cssExpand[ i ];\n\t\tattrs[ \"margin\" + which ] = attrs[ \"padding\" + which ] = type;\n\t}\n\n\tif ( includeWidth ) {\n\t\tattrs.opacity = attrs.width = type;\n\t}\n\n\treturn attrs;\n}\n\nfunction createTween( value, prop, animation ) {\n\tvar tween,\n\t\tcollection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ \"*\" ] ),\n\t\tindex = 0,\n\t\tlength = collection.length;\n\tfor ( ; index < length; index++ ) {\n\t\tif ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {\n\n\t\t\t// We're done with this property\n\t\t\treturn tween;\n\t\t}\n\t}\n}\n\nfunction defaultPrefilter( elem, props, opts ) {\n\tvar prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,\n\t\tisBox = \"width\" in props || \"height\" in props,\n\t\tanim = this,\n\t\torig = {},\n\t\tstyle = elem.style,\n\t\thidden = elem.nodeType && isHiddenWithinTree( elem ),\n\t\tdataShow = dataPriv.get( elem, \"fxshow\" );\n\n\t// Queue-skipping animations hijack the fx hooks\n\tif ( !opts.queue ) {\n\t\thooks = jQuery._queueHooks( elem, \"fx\" );\n\t\tif ( hooks.unqueued == null ) {\n\t\t\thooks.unqueued = 0;\n\t\t\toldfire = hooks.empty.fire;\n\t\t\thooks.empty.fire = function() {\n\t\t\t\tif ( !hooks.unqueued ) {\n\t\t\t\t\toldfire();\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\thooks.unqueued++;\n\n\t\tanim.always( function() {\n\n\t\t\t// Ensure the complete handler is called before this completes\n\t\t\tanim.always( function() {\n\t\t\t\thooks.unqueued--;\n\t\t\t\tif ( !jQuery.queue( elem, \"fx\" ).length ) {\n\t\t\t\t\thooks.empty.fire();\n\t\t\t\t}\n\t\t\t} );\n\t\t} );\n\t}\n\n\t// Detect show/hide animations\n\tfor ( prop in props ) {\n\t\tvalue = props[ prop ];\n\t\tif ( rfxtypes.test( value ) ) {\n\t\t\tdelete props[ prop ];\n\t\t\ttoggle = toggle || value === \"toggle\";\n\t\t\tif ( value === ( hidden ? \"hide\" : \"show\" ) ) {\n\n\t\t\t\t// Pretend to be hidden if this is a \"show\" and\n\t\t\t\t// there is still data from a stopped show/hide\n\t\t\t\tif ( value === \"show\" && dataShow && dataShow[ prop ] !== undefined ) {\n\t\t\t\t\thidden = true;\n\n\t\t\t\t// Ignore all other no-op show/hide data\n\t\t\t\t} else {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\torig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );\n\t\t}\n\t}\n\n\t// Bail out if this is a no-op like .hide().hide()\n\tpropTween = !jQuery.isEmptyObject( props );\n\tif ( !propTween && jQuery.isEmptyObject( orig ) ) {\n\t\treturn;\n\t}\n\n\t// Restrict \"overflow\" and \"display\" styles during box animations\n\tif ( isBox && elem.nodeType === 1 ) {\n\n\t\t// Support: IE <=9 - 11, Edge 12 - 15\n\t\t// Record all 3 overflow attributes because IE does not infer the shorthand\n\t\t// from identically-valued overflowX and overflowY and Edge just mirrors\n\t\t// the overflowX value there.\n\t\topts.overflow = [ style.overflow, style.overflowX, style.overflowY ];\n\n\t\t// Identify a display type, preferring old show/hide data over the CSS cascade\n\t\trestoreDisplay = dataShow && dataShow.display;\n\t\tif ( restoreDisplay == null ) {\n\t\t\trestoreDisplay = dataPriv.get( elem, \"display\" );\n\t\t}\n\t\tdisplay = jQuery.css( elem, \"display\" );\n\t\tif ( display === \"none\" ) {\n\t\t\tif ( restoreDisplay ) {\n\t\t\t\tdisplay = restoreDisplay;\n\t\t\t} else {\n\n\t\t\t\t// Get nonempty value(s) by temporarily forcing visibility\n\t\t\t\tshowHide( [ elem ], true );\n\t\t\t\trestoreDisplay = elem.style.display || restoreDisplay;\n\t\t\t\tdisplay = jQuery.css( elem, \"display\" );\n\t\t\t\tshowHide( [ elem ] );\n\t\t\t}\n\t\t}\n\n\t\t// Animate inline elements as inline-block\n\t\tif ( display === \"inline\" || display === \"inline-block\" && restoreDisplay != null ) {\n\t\t\tif ( jQuery.css( elem, \"float\" ) === \"none\" ) {\n\n\t\t\t\t// Restore the original display value at the end of pure show/hide animations\n\t\t\t\tif ( !propTween ) {\n\t\t\t\t\tanim.done( function() {\n\t\t\t\t\t\tstyle.display = restoreDisplay;\n\t\t\t\t\t} );\n\t\t\t\t\tif ( restoreDisplay == null ) {\n\t\t\t\t\t\tdisplay = style.display;\n\t\t\t\t\t\trestoreDisplay = display === \"none\" ? \"\" : display;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstyle.display = \"inline-block\";\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( opts.overflow ) {\n\t\tstyle.overflow = \"hidden\";\n\t\tanim.always( function() {\n\t\t\tstyle.overflow = opts.overflow[ 0 ];\n\t\t\tstyle.overflowX = opts.overflow[ 1 ];\n\t\t\tstyle.overflowY = opts.overflow[ 2 ];\n\t\t} );\n\t}\n\n\t// Implement show/hide animations\n\tpropTween = false;\n\tfor ( prop in orig ) {\n\n\t\t// General show/hide setup for this element animation\n\t\tif ( !propTween ) {\n\t\t\tif ( dataShow ) {\n\t\t\t\tif ( \"hidden\" in dataShow ) {\n\t\t\t\t\thidden = dataShow.hidden;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdataShow = dataPriv.access( elem, \"fxshow\", { display: restoreDisplay } );\n\t\t\t}\n\n\t\t\t// Store hidden/visible for toggle so `.stop().toggle()` \"reverses\"\n\t\t\tif ( toggle ) {\n\t\t\t\tdataShow.hidden = !hidden;\n\t\t\t}\n\n\t\t\t// Show elements before animating them\n\t\t\tif ( hidden ) {\n\t\t\t\tshowHide( [ elem ], true );\n\t\t\t}\n\n\t\t\t/* eslint-disable no-loop-func */\n\n\t\t\tanim.done( function() {\n\n\t\t\t/* eslint-enable no-loop-func */\n\n\t\t\t\t// The final step of a \"hide\" animation is actually hiding the element\n\t\t\t\tif ( !hidden ) {\n\t\t\t\t\tshowHide( [ elem ] );\n\t\t\t\t}\n\t\t\t\tdataPriv.remove( elem, \"fxshow\" );\n\t\t\t\tfor ( prop in orig ) {\n\t\t\t\t\tjQuery.style( elem, prop, orig[ prop ] );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t// Per-property setup\n\t\tpropTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );\n\t\tif ( !( prop in dataShow ) ) {\n\t\t\tdataShow[ prop ] = propTween.start;\n\t\t\tif ( hidden ) {\n\t\t\t\tpropTween.end = propTween.start;\n\t\t\t\tpropTween.start = 0;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction propFilter( props, specialEasing ) {\n\tvar index, name, easing, value, hooks;\n\n\t// camelCase, specialEasing and expand cssHook pass\n\tfor ( index in props ) {\n\t\tname = camelCase( index );\n\t\teasing = specialEasing[ name ];\n\t\tvalue = props[ index ];\n\t\tif ( Array.isArray( value ) ) {\n\t\t\teasing = value[ 1 ];\n\t\t\tvalue = props[ index ] = value[ 0 ];\n\t\t}\n\n\t\tif ( index !== name ) {\n\t\t\tprops[ name ] = value;\n\t\t\tdelete props[ index ];\n\t\t}\n\n\t\thooks = jQuery.cssHooks[ name ];\n\t\tif ( hooks && \"expand\" in hooks ) {\n\t\t\tvalue = hooks.expand( value );\n\t\t\tdelete props[ name ];\n\n\t\t\t// Not quite $.extend, this won't overwrite existing keys.\n\t\t\t// Reusing 'index' because we have the correct \"name\"\n\t\t\tfor ( index in value ) {\n\t\t\t\tif ( !( index in props ) ) {\n\t\t\t\t\tprops[ index ] = value[ index ];\n\t\t\t\t\tspecialEasing[ index ] = easing;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tspecialEasing[ name ] = easing;\n\t\t}\n\t}\n}\n\nfunction Animation( elem, properties, options ) {\n\tvar result,\n\t\tstopped,\n\t\tindex = 0,\n\t\tlength = Animation.prefilters.length,\n\t\tdeferred = jQuery.Deferred().always( function() {\n\n\t\t\t// Don't match elem in the :animated selector\n\t\t\tdelete tick.elem;\n\t\t} ),\n\t\ttick = function() {\n\t\t\tif ( stopped ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar currentTime = fxNow || createFxNow(),\n\t\t\t\tremaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),\n\n\t\t\t\t// Support: Android 2.3 only\n\t\t\t\t// Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)\n\t\t\t\ttemp = remaining / animation.duration || 0,\n\t\t\t\tpercent = 1 - temp,\n\t\t\t\tindex = 0,\n\t\t\t\tlength = animation.tweens.length;\n\n\t\t\tfor ( ; index < length; index++ ) {\n\t\t\t\tanimation.tweens[ index ].run( percent );\n\t\t\t}\n\n\t\t\tdeferred.notifyWith( elem, [ animation, percent, remaining ] );\n\n\t\t\t// If there's more to do, yield\n\t\t\tif ( percent < 1 && length ) {\n\t\t\t\treturn remaining;\n\t\t\t}\n\n\t\t\t// If this was an empty animation, synthesize a final progress notification\n\t\t\tif ( !length ) {\n\t\t\t\tdeferred.notifyWith( elem, [ animation, 1, 0 ] );\n\t\t\t}\n\n\t\t\t// Resolve the animation and report its conclusion\n\t\t\tdeferred.resolveWith( elem, [ animation ] );\n\t\t\treturn false;\n\t\t},\n\t\tanimation = deferred.promise( {\n\t\t\telem: elem,\n\t\t\tprops: jQuery.extend( {}, properties ),\n\t\t\topts: jQuery.extend( true, {\n\t\t\t\tspecialEasing: {},\n\t\t\t\teasing: jQuery.easing._default\n\t\t\t}, options ),\n\t\t\toriginalProperties: properties,\n\t\t\toriginalOptions: options,\n\t\t\tstartTime: fxNow || createFxNow(),\n\t\t\tduration: options.duration,\n\t\t\ttweens: [],\n\t\t\tcreateTween: function( prop, end ) {\n\t\t\t\tvar tween = jQuery.Tween( elem, animation.opts, prop, end,\n\t\t\t\t\t\tanimation.opts.specialEasing[ prop ] || animation.opts.easing );\n\t\t\t\tanimation.tweens.push( tween );\n\t\t\t\treturn tween;\n\t\t\t},\n\t\t\tstop: function( gotoEnd ) {\n\t\t\t\tvar index = 0,\n\n\t\t\t\t\t// If we are going to the end, we want to run all the tweens\n\t\t\t\t\t// otherwise we skip this part\n\t\t\t\t\tlength = gotoEnd ? animation.tweens.length : 0;\n\t\t\t\tif ( stopped ) {\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t\tstopped = true;\n\t\t\t\tfor ( ; index < length; index++ ) {\n\t\t\t\t\tanimation.tweens[ index ].run( 1 );\n\t\t\t\t}\n\n\t\t\t\t// Resolve when we played the last frame; otherwise, reject\n\t\t\t\tif ( gotoEnd ) {\n\t\t\t\t\tdeferred.notifyWith( elem, [ animation, 1, 0 ] );\n\t\t\t\t\tdeferred.resolveWith( elem, [ animation, gotoEnd ] );\n\t\t\t\t} else {\n\t\t\t\t\tdeferred.rejectWith( elem, [ animation, gotoEnd ] );\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t}\n\t\t} ),\n\t\tprops = animation.props;\n\n\tpropFilter( props, animation.opts.specialEasing );\n\n\tfor ( ; index < length; index++ ) {\n\t\tresult = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );\n\t\tif ( result ) {\n\t\t\tif ( isFunction( result.stop ) ) {\n\t\t\t\tjQuery._queueHooks( animation.elem, animation.opts.queue ).stop =\n\t\t\t\t\tresult.stop.bind( result );\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t}\n\n\tjQuery.map( props, createTween, animation );\n\n\tif ( isFunction( animation.opts.start ) ) {\n\t\tanimation.opts.start.call( elem, animation );\n\t}\n\n\t// Attach callbacks from options\n\tanimation\n\t\t.progress( animation.opts.progress )\n\t\t.done( animation.opts.done, animation.opts.complete )\n\t\t.fail( animation.opts.fail )\n\t\t.always( animation.opts.always );\n\n\tjQuery.fx.timer(\n\t\tjQuery.extend( tick, {\n\t\t\telem: elem,\n\t\t\tanim: animation,\n\t\t\tqueue: animation.opts.queue\n\t\t} )\n\t);\n\n\treturn animation;\n}\n\njQuery.Animation = jQuery.extend( Animation, {\n\n\ttweeners: {\n\t\t\"*\": [ function( prop, value ) {\n\t\t\tvar tween = this.createTween( prop, value );\n\t\t\tadjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );\n\t\t\treturn tween;\n\t\t} ]\n\t},\n\n\ttweener: function( props, callback ) {\n\t\tif ( isFunction( props ) ) {\n\t\t\tcallback = props;\n\t\t\tprops = [ \"*\" ];\n\t\t} else {\n\t\t\tprops = props.match( rnothtmlwhite );\n\t\t}\n\n\t\tvar prop,\n\t\t\tindex = 0,\n\t\t\tlength = props.length;\n\n\t\tfor ( ; index < length; index++ ) {\n\t\t\tprop = props[ index ];\n\t\t\tAnimation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];\n\t\t\tAnimation.tweeners[ prop ].unshift( callback );\n\t\t}\n\t},\n\n\tprefilters: [ defaultPrefilter ],\n\n\tprefilter: function( callback, prepend ) {\n\t\tif ( prepend ) {\n\t\t\tAnimation.prefilters.unshift( callback );\n\t\t} else {\n\t\t\tAnimation.prefilters.push( callback );\n\t\t}\n\t}\n} );\n\njQuery.speed = function( speed, easing, fn ) {\n\tvar opt = speed && typeof speed === \"object\" ? jQuery.extend( {}, speed ) : {\n\t\tcomplete: fn || !fn && easing ||\n\t\t\tisFunction( speed ) && speed,\n\t\tduration: speed,\n\t\teasing: fn && easing || easing && !isFunction( easing ) && easing\n\t};\n\n\t// Go to the end state if fx are off\n\tif ( jQuery.fx.off ) {\n\t\topt.duration = 0;\n\n\t} else {\n\t\tif ( typeof opt.duration !== \"number\" ) {\n\t\t\tif ( opt.duration in jQuery.fx.speeds ) {\n\t\t\t\topt.duration = jQuery.fx.speeds[ opt.duration ];\n\n\t\t\t} else {\n\t\t\t\topt.duration = jQuery.fx.speeds._default;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Normalize opt.queue - true/undefined/null -> \"fx\"\n\tif ( opt.queue == null || opt.queue === true ) {\n\t\topt.queue = \"fx\";\n\t}\n\n\t// Queueing\n\topt.old = opt.complete;\n\n\topt.complete = function() {\n\t\tif ( isFunction( opt.old ) ) {\n\t\t\topt.old.call( this );\n\t\t}\n\n\t\tif ( opt.queue ) {\n\t\t\tjQuery.dequeue( this, opt.queue );\n\t\t}\n\t};\n\n\treturn opt;\n};\n\njQuery.fn.extend( {\n\tfadeTo: function( speed, to, easing, callback ) {\n\n\t\t// Show any hidden elements after setting opacity to 0\n\t\treturn this.filter( isHiddenWithinTree ).css( \"opacity\", 0 ).show()\n\n\t\t\t// Animate to the value specified\n\t\t\t.end().animate( { opacity: to }, speed, easing, callback );\n\t},\n\tanimate: function( prop, speed, easing, callback ) {\n\t\tvar empty = jQuery.isEmptyObject( prop ),\n\t\t\toptall = jQuery.speed( speed, easing, callback ),\n\t\t\tdoAnimation = function() {\n\n\t\t\t\t// Operate on a copy of prop so per-property easing won't be lost\n\t\t\t\tvar anim = Animation( this, jQuery.extend( {}, prop ), optall );\n\n\t\t\t\t// Empty animations, or finishing resolves immediately\n\t\t\t\tif ( empty || dataPriv.get( this, \"finish\" ) ) {\n\t\t\t\t\tanim.stop( true );\n\t\t\t\t}\n\t\t\t};\n\t\t\tdoAnimation.finish = doAnimation;\n\n\t\treturn empty || optall.queue === false ?\n\t\t\tthis.each( doAnimation ) :\n\t\t\tthis.queue( optall.queue, doAnimation );\n\t},\n\tstop: function( type, clearQueue, gotoEnd ) {\n\t\tvar stopQueue = function( hooks ) {\n\t\t\tvar stop = hooks.stop;\n\t\t\tdelete hooks.stop;\n\t\t\tstop( gotoEnd );\n\t\t};\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tgotoEnd = clearQueue;\n\t\t\tclearQueue = type;\n\t\t\ttype = undefined;\n\t\t}\n\t\tif ( clearQueue && type !== false ) {\n\t\t\tthis.queue( type || \"fx\", [] );\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tvar dequeue = true,\n\t\t\t\tindex = type != null && type + \"queueHooks\",\n\t\t\t\ttimers = jQuery.timers,\n\t\t\t\tdata = dataPriv.get( this );\n\n\t\t\tif ( index ) {\n\t\t\t\tif ( data[ index ] && data[ index ].stop ) {\n\t\t\t\t\tstopQueue( data[ index ] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor ( index in data ) {\n\t\t\t\t\tif ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {\n\t\t\t\t\t\tstopQueue( data[ index ] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor ( index = timers.length; index--; ) {\n\t\t\t\tif ( timers[ index ].elem === this &&\n\t\t\t\t\t( type == null || timers[ index ].queue === type ) ) {\n\n\t\t\t\t\ttimers[ index ].anim.stop( gotoEnd );\n\t\t\t\t\tdequeue = false;\n\t\t\t\t\ttimers.splice( index, 1 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Start the next in the queue if the last step wasn't forced.\n\t\t\t// Timers currently will call their complete callbacks, which\n\t\t\t// will dequeue but only if they were gotoEnd.\n\t\t\tif ( dequeue || !gotoEnd ) {\n\t\t\t\tjQuery.dequeue( this, type );\n\t\t\t}\n\t\t} );\n\t},\n\tfinish: function( type ) {\n\t\tif ( type !== false ) {\n\t\t\ttype = type || \"fx\";\n\t\t}\n\t\treturn this.each( function() {\n\t\t\tvar index,\n\t\t\t\tdata = dataPriv.get( this ),\n\t\t\t\tqueue = data[ type + \"queue\" ],\n\t\t\t\thooks = data[ type + \"queueHooks\" ],\n\t\t\t\ttimers = jQuery.timers,\n\t\t\t\tlength = queue ? queue.length : 0;\n\n\t\t\t// Enable finishing flag on private data\n\t\t\tdata.finish = true;\n\n\t\t\t// Empty the queue first\n\t\t\tjQuery.queue( this, type, [] );\n\n\t\t\tif ( hooks && hooks.stop ) {\n\t\t\t\thooks.stop.call( this, true );\n\t\t\t}\n\n\t\t\t// Look for any active animations, and finish them\n\t\t\tfor ( index = timers.length; index--; ) {\n\t\t\t\tif ( timers[ index ].elem === this && timers[ index ].queue === type ) {\n\t\t\t\t\ttimers[ index ].anim.stop( true );\n\t\t\t\t\ttimers.splice( index, 1 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Look for any animations in the old queue and finish them\n\t\t\tfor ( index = 0; index < length; index++ ) {\n\t\t\t\tif ( queue[ index ] && queue[ index ].finish ) {\n\t\t\t\t\tqueue[ index ].finish.call( this );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Turn off finishing flag\n\t\t\tdelete data.finish;\n\t\t} );\n\t}\n} );\n\njQuery.each( [ \"toggle\", \"show\", \"hide\" ], function( i, name ) {\n\tvar cssFn = jQuery.fn[ name ];\n\tjQuery.fn[ name ] = function( speed, easing, callback ) {\n\t\treturn speed == null || typeof speed === \"boolean\" ?\n\t\t\tcssFn.apply( this, arguments ) :\n\t\t\tthis.animate( genFx( name, true ), speed, easing, callback );\n\t};\n} );\n\n// Generate shortcuts for custom animations\njQuery.each( {\n\tslideDown: genFx( \"show\" ),\n\tslideUp: genFx( \"hide\" ),\n\tslideToggle: genFx( \"toggle\" ),\n\tfadeIn: { opacity: \"show\" },\n\tfadeOut: { opacity: \"hide\" },\n\tfadeToggle: { opacity: \"toggle\" }\n}, function( name, props ) {\n\tjQuery.fn[ name ] = function( speed, easing, callback ) {\n\t\treturn this.animate( props, speed, easing, callback );\n\t};\n} );\n\njQuery.timers = [];\njQuery.fx.tick = function() {\n\tvar timer,\n\t\ti = 0,\n\t\ttimers = jQuery.timers;\n\n\tfxNow = Date.now();\n\n\tfor ( ; i < timers.length; i++ ) {\n\t\ttimer = timers[ i ];\n\n\t\t// Run the timer and safely remove it when done (allowing for external removal)\n\t\tif ( !timer() && timers[ i ] === timer ) {\n\t\t\ttimers.splice( i--, 1 );\n\t\t}\n\t}\n\n\tif ( !timers.length ) {\n\t\tjQuery.fx.stop();\n\t}\n\tfxNow = undefined;\n};\n\njQuery.fx.timer = function( timer ) {\n\tjQuery.timers.push( timer );\n\tjQuery.fx.start();\n};\n\njQuery.fx.interval = 13;\njQuery.fx.start = function() {\n\tif ( inProgress ) {\n\t\treturn;\n\t}\n\n\tinProgress = true;\n\tschedule();\n};\n\njQuery.fx.stop = function() {\n\tinProgress = null;\n};\n\njQuery.fx.speeds = {\n\tslow: 600,\n\tfast: 200,\n\n\t// Default speed\n\t_default: 400\n};\n\n\n// Based off of the plugin by Clint Helfers, with permission.\n// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/\njQuery.fn.delay = function( time, type ) {\n\ttime = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;\n\ttype = type || \"fx\";\n\n\treturn this.queue( type, function( next, hooks ) {\n\t\tvar timeout = window.setTimeout( next, time );\n\t\thooks.stop = function() {\n\t\t\twindow.clearTimeout( timeout );\n\t\t};\n\t} );\n};\n\n\n( function() {\n\tvar input = document.createElement( \"input\" ),\n\t\tselect = document.createElement( \"select\" ),\n\t\topt = select.appendChild( document.createElement( \"option\" ) );\n\n\tinput.type = \"checkbox\";\n\n\t// Support: Android <=4.3 only\n\t// Default value for a checkbox should be \"on\"\n\tsupport.checkOn = input.value !== \"\";\n\n\t// Support: IE <=11 only\n\t// Must access selectedIndex to make default options select\n\tsupport.optSelected = opt.selected;\n\n\t// Support: IE <=11 only\n\t// An input loses its value after becoming a radio\n\tinput = document.createElement( \"input\" );\n\tinput.value = \"t\";\n\tinput.type = \"radio\";\n\tsupport.radioValue = input.value === \"t\";\n} )();\n\n\nvar boolHook,\n\tattrHandle = jQuery.expr.attrHandle;\n\njQuery.fn.extend( {\n\tattr: function( name, value ) {\n\t\treturn access( this, jQuery.attr, name, value, arguments.length > 1 );\n\t},\n\n\tremoveAttr: function( name ) {\n\t\treturn this.each( function() {\n\t\t\tjQuery.removeAttr( this, name );\n\t\t} );\n\t}\n} );\n\njQuery.extend( {\n\tattr: function( elem, name, value ) {\n\t\tvar ret, hooks,\n\t\t\tnType = elem.nodeType;\n\n\t\t// Don't get/set attributes on text, comment and attribute nodes\n\t\tif ( nType === 3 || nType === 8 || nType === 2 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Fallback to prop when attributes are not supported\n\t\tif ( typeof elem.getAttribute === \"undefined\" ) {\n\t\t\treturn jQuery.prop( elem, name, value );\n\t\t}\n\n\t\t// Attribute hooks are determined by the lowercase version\n\t\t// Grab necessary hook if one is defined\n\t\tif ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {\n\t\t\thooks = jQuery.attrHooks[ name.toLowerCase() ] ||\n\t\t\t\t( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );\n\t\t}\n\n\t\tif ( value !== undefined ) {\n\t\t\tif ( value === null ) {\n\t\t\t\tjQuery.removeAttr( elem, name );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( hooks && \"set\" in hooks &&\n\t\t\t\t( ret = hooks.set( elem, value, name ) ) !== undefined ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\telem.setAttribute( name, value + \"\" );\n\t\t\treturn value;\n\t\t}\n\n\t\tif ( hooks && \"get\" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {\n\t\t\treturn ret;\n\t\t}\n\n\t\tret = jQuery.find.attr( elem, name );\n\n\t\t// Non-existent attributes return null, we normalize to undefined\n\t\treturn ret == null ? undefined : ret;\n\t},\n\n\tattrHooks: {\n\t\ttype: {\n\t\t\tset: function( elem, value ) {\n\t\t\t\tif ( !support.radioValue && value === \"radio\" &&\n\t\t\t\t\tnodeName( elem, \"input\" ) ) {\n\t\t\t\t\tvar val = elem.value;\n\t\t\t\t\telem.setAttribute( \"type\", value );\n\t\t\t\t\tif ( val ) {\n\t\t\t\t\t\telem.value = val;\n\t\t\t\t\t}\n\t\t\t\t\treturn value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\tremoveAttr: function( elem, value ) {\n\t\tvar name,\n\t\t\ti = 0,\n\n\t\t\t// Attribute names can contain non-HTML whitespace characters\n\t\t\t// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2\n\t\t\tattrNames = value && value.match( rnothtmlwhite );\n\n\t\tif ( attrNames && elem.nodeType === 1 ) {\n\t\t\twhile ( ( name = attrNames[ i++ ] ) ) {\n\t\t\t\telem.removeAttribute( name );\n\t\t\t}\n\t\t}\n\t}\n} );\n\n// Hooks for boolean attributes\nboolHook = {\n\tset: function( elem, value, name ) {\n\t\tif ( value === false ) {\n\n\t\t\t// Remove boolean attributes when set to false\n\t\t\tjQuery.removeAttr( elem, name );\n\t\t} else {\n\t\t\telem.setAttribute( name, name );\n\t\t}\n\t\treturn name;\n\t}\n};\n\njQuery.each( jQuery.expr.match.bool.source.match( /\\w+/g ), function( i, name ) {\n\tvar getter = attrHandle[ name ] || jQuery.find.attr;\n\n\tattrHandle[ name ] = function( elem, name, isXML ) {\n\t\tvar ret, handle,\n\t\t\tlowercaseName = name.toLowerCase();\n\n\t\tif ( !isXML ) {\n\n\t\t\t// Avoid an infinite loop by temporarily removing this function from the getter\n\t\t\thandle = attrHandle[ lowercaseName ];\n\t\t\tattrHandle[ lowercaseName ] = ret;\n\t\t\tret = getter( elem, name, isXML ) != null ?\n\t\t\t\tlowercaseName :\n\t\t\t\tnull;\n\t\t\tattrHandle[ lowercaseName ] = handle;\n\t\t}\n\t\treturn ret;\n\t};\n} );\n\n\n\n\nvar rfocusable = /^(?:input|select|textarea|button)$/i,\n\trclickable = /^(?:a|area)$/i;\n\njQuery.fn.extend( {\n\tprop: function( name, value ) {\n\t\treturn access( this, jQuery.prop, name, value, arguments.length > 1 );\n\t},\n\n\tremoveProp: function( name ) {\n\t\treturn this.each( function() {\n\t\t\tdelete this[ jQuery.propFix[ name ] || name ];\n\t\t} );\n\t}\n} );\n\njQuery.extend( {\n\tprop: function( elem, name, value ) {\n\t\tvar ret, hooks,\n\t\t\tnType = elem.nodeType;\n\n\t\t// Don't get/set properties on text, comment and attribute nodes\n\t\tif ( nType === 3 || nType === 8 || nType === 2 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {\n\n\t\t\t// Fix name and attach hooks\n\t\t\tname = jQuery.propFix[ name ] || name;\n\t\t\thooks = jQuery.propHooks[ name ];\n\t\t}\n\n\t\tif ( value !== undefined ) {\n\t\t\tif ( hooks && \"set\" in hooks &&\n\t\t\t\t( ret = hooks.set( elem, value, name ) ) !== undefined ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\treturn ( elem[ name ] = value );\n\t\t}\n\n\t\tif ( hooks && \"get\" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {\n\t\t\treturn ret;\n\t\t}\n\n\t\treturn elem[ name ];\n\t},\n\n\tpropHooks: {\n\t\ttabIndex: {\n\t\t\tget: function( elem ) {\n\n\t\t\t\t// Support: IE <=9 - 11 only\n\t\t\t\t// elem.tabIndex doesn't always return the\n\t\t\t\t// correct value when it hasn't been explicitly set\n\t\t\t\t// https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/\n\t\t\t\t// Use proper attribute retrieval(#12072)\n\t\t\t\tvar tabindex = jQuery.find.attr( elem, \"tabindex\" );\n\n\t\t\t\tif ( tabindex ) {\n\t\t\t\t\treturn parseInt( tabindex, 10 );\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\trfocusable.test( elem.nodeName ) ||\n\t\t\t\t\trclickable.test( elem.nodeName ) &&\n\t\t\t\t\telem.href\n\t\t\t\t) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t},\n\n\tpropFix: {\n\t\t\"for\": \"htmlFor\",\n\t\t\"class\": \"className\"\n\t}\n} );\n\n// Support: IE <=11 only\n// Accessing the selectedIndex property\n// forces the browser to respect setting selected\n// on the option\n// The getter ensures a default option is selected\n// when in an optgroup\n// eslint rule \"no-unused-expressions\" is disabled for this code\n// since it considers such accessions noop\nif ( !support.optSelected ) {\n\tjQuery.propHooks.selected = {\n\t\tget: function( elem ) {\n\n\t\t\t/* eslint no-unused-expressions: \"off\" */\n\n\t\t\tvar parent = elem.parentNode;\n\t\t\tif ( parent && parent.parentNode ) {\n\t\t\t\tparent.parentNode.selectedIndex;\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\t\tset: function( elem ) {\n\n\t\t\t/* eslint no-unused-expressions: \"off\" */\n\n\t\t\tvar parent = elem.parentNode;\n\t\t\tif ( parent ) {\n\t\t\t\tparent.selectedIndex;\n\n\t\t\t\tif ( parent.parentNode ) {\n\t\t\t\t\tparent.parentNode.selectedIndex;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\n\njQuery.each( [\n\t\"tabIndex\",\n\t\"readOnly\",\n\t\"maxLength\",\n\t\"cellSpacing\",\n\t\"cellPadding\",\n\t\"rowSpan\",\n\t\"colSpan\",\n\t\"useMap\",\n\t\"frameBorder\",\n\t\"contentEditable\"\n], function() {\n\tjQuery.propFix[ this.toLowerCase() ] = this;\n} );\n\n\n\n\n\t// Strip and collapse whitespace according to HTML spec\n\t// https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace\n\tfunction stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}\n\n\nfunction getClass( elem ) {\n\treturn elem.getAttribute && elem.getAttribute( \"class\" ) || \"\";\n}\n\nfunction classesToArray( value ) {\n\tif ( Array.isArray( value ) ) {\n\t\treturn value;\n\t}\n\tif ( typeof value === \"string\" ) {\n\t\treturn value.match( rnothtmlwhite ) || [];\n\t}\n\treturn [];\n}\n\njQuery.fn.extend( {\n\taddClass: function( value ) {\n\t\tvar classes, elem, cur, curValue, clazz, j, finalValue,\n\t\t\ti = 0;\n\n\t\tif ( isFunction( value ) ) {\n\t\t\treturn this.each( function( j ) {\n\t\t\t\tjQuery( this ).addClass( value.call( this, j, getClass( this ) ) );\n\t\t\t} );\n\t\t}\n\n\t\tclasses = classesToArray( value );\n\n\t\tif ( classes.length ) {\n\t\t\twhile ( ( elem = this[ i++ ] ) ) {\n\t\t\t\tcurValue = getClass( elem );\n\t\t\t\tcur = elem.nodeType === 1 && ( \" \" + stripAndCollapse( curValue ) + \" \" );\n\n\t\t\t\tif ( cur ) {\n\t\t\t\t\tj = 0;\n\t\t\t\t\twhile ( ( clazz = classes[ j++ ] ) ) {\n\t\t\t\t\t\tif ( cur.indexOf( \" \" + clazz + \" \" ) < 0 ) {\n\t\t\t\t\t\t\tcur += clazz + \" \";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Only assign if different to avoid unneeded rendering.\n\t\t\t\t\tfinalValue = stripAndCollapse( cur );\n\t\t\t\t\tif ( curValue !== finalValue ) {\n\t\t\t\t\t\telem.setAttribute( \"class\", finalValue );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tremoveClass: function( value ) {\n\t\tvar classes, elem, cur, curValue, clazz, j, finalValue,\n\t\t\ti = 0;\n\n\t\tif ( isFunction( value ) ) {\n\t\t\treturn this.each( function( j ) {\n\t\t\t\tjQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );\n\t\t\t} );\n\t\t}\n\n\t\tif ( !arguments.length ) {\n\t\t\treturn this.attr( \"class\", \"\" );\n\t\t}\n\n\t\tclasses = classesToArray( value );\n\n\t\tif ( classes.length ) {\n\t\t\twhile ( ( elem = this[ i++ ] ) ) {\n\t\t\t\tcurValue = getClass( elem );\n\n\t\t\t\t// This expression is here for better compressibility (see addClass)\n\t\t\t\tcur = elem.nodeType === 1 && ( \" \" + stripAndCollapse( curValue ) + \" \" );\n\n\t\t\t\tif ( cur ) {\n\t\t\t\t\tj = 0;\n\t\t\t\t\twhile ( ( clazz = classes[ j++ ] ) ) {\n\n\t\t\t\t\t\t// Remove *all* instances\n\t\t\t\t\t\twhile ( cur.indexOf( \" \" + clazz + \" \" ) > -1 ) {\n\t\t\t\t\t\t\tcur = cur.replace( \" \" + clazz + \" \", \" \" );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Only assign if different to avoid unneeded rendering.\n\t\t\t\t\tfinalValue = stripAndCollapse( cur );\n\t\t\t\t\tif ( curValue !== finalValue ) {\n\t\t\t\t\t\telem.setAttribute( \"class\", finalValue );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\ttoggleClass: function( value, stateVal ) {\n\t\tvar type = typeof value,\n\t\t\tisValidValue = type === \"string\" || Array.isArray( value );\n\n\t\tif ( typeof stateVal === \"boolean\" && isValidValue ) {\n\t\t\treturn stateVal ? this.addClass( value ) : this.removeClass( value );\n\t\t}\n\n\t\tif ( isFunction( value ) ) {\n\t\t\treturn this.each( function( i ) {\n\t\t\t\tjQuery( this ).toggleClass(\n\t\t\t\t\tvalue.call( this, i, getClass( this ), stateVal ),\n\t\t\t\t\tstateVal\n\t\t\t\t);\n\t\t\t} );\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tvar className, i, self, classNames;\n\n\t\t\tif ( isValidValue ) {\n\n\t\t\t\t// Toggle individual class names\n\t\t\t\ti = 0;\n\t\t\t\tself = jQuery( this );\n\t\t\t\tclassNames = classesToArray( value );\n\n\t\t\t\twhile ( ( className = classNames[ i++ ] ) ) {\n\n\t\t\t\t\t// Check each className given, space separated list\n\t\t\t\t\tif ( self.hasClass( className ) ) {\n\t\t\t\t\t\tself.removeClass( className );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tself.addClass( className );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t// Toggle whole class name\n\t\t\t} else if ( value === undefined || type === \"boolean\" ) {\n\t\t\t\tclassName = getClass( this );\n\t\t\t\tif ( className ) {\n\n\t\t\t\t\t// Store className if set\n\t\t\t\t\tdataPriv.set( this, \"__className__\", className );\n\t\t\t\t}\n\n\t\t\t\t// If the element has a class name or if we're passed `false`,\n\t\t\t\t// then remove the whole classname (if there was one, the above saved it).\n\t\t\t\t// Otherwise bring back whatever was previously saved (if anything),\n\t\t\t\t// falling back to the empty string if nothing was stored.\n\t\t\t\tif ( this.setAttribute ) {\n\t\t\t\t\tthis.setAttribute( \"class\",\n\t\t\t\t\t\tclassName || value === false ?\n\t\t\t\t\t\t\"\" :\n\t\t\t\t\t\tdataPriv.get( this, \"__className__\" ) || \"\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t},\n\n\thasClass: function( selector ) {\n\t\tvar className, elem,\n\t\t\ti = 0;\n\n\t\tclassName = \" \" + selector + \" \";\n\t\twhile ( ( elem = this[ i++ ] ) ) {\n\t\t\tif ( elem.nodeType === 1 &&\n\t\t\t\t( \" \" + stripAndCollapse( getClass( elem ) ) + \" \" ).indexOf( className ) > -1 ) {\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n} );\n\n\n\n\nvar rreturn = /\\r/g;\n\njQuery.fn.extend( {\n\tval: function( value ) {\n\t\tvar hooks, ret, valueIsFunction,\n\t\t\telem = this[ 0 ];\n\n\t\tif ( !arguments.length ) {\n\t\t\tif ( elem ) {\n\t\t\t\thooks = jQuery.valHooks[ elem.type ] ||\n\t\t\t\t\tjQuery.valHooks[ elem.nodeName.toLowerCase() ];\n\n\t\t\t\tif ( hooks &&\n\t\t\t\t\t\"get\" in hooks &&\n\t\t\t\t\t( ret = hooks.get( elem, \"value\" ) ) !== undefined\n\t\t\t\t) {\n\t\t\t\t\treturn ret;\n\t\t\t\t}\n\n\t\t\t\tret = elem.value;\n\n\t\t\t\t// Handle most common string cases\n\t\t\t\tif ( typeof ret === \"string\" ) {\n\t\t\t\t\treturn ret.replace( rreturn, \"\" );\n\t\t\t\t}\n\n\t\t\t\t// Handle cases where value is null/undef or number\n\t\t\t\treturn ret == null ? \"\" : ret;\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tvalueIsFunction = isFunction( value );\n\n\t\treturn this.each( function( i ) {\n\t\t\tvar val;\n\n\t\t\tif ( this.nodeType !== 1 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( valueIsFunction ) {\n\t\t\t\tval = value.call( this, i, jQuery( this ).val() );\n\t\t\t} else {\n\t\t\t\tval = value;\n\t\t\t}\n\n\t\t\t// Treat null/undefined as \"\"; convert numbers to string\n\t\t\tif ( val == null ) {\n\t\t\t\tval = \"\";\n\n\t\t\t} else if ( typeof val === \"number\" ) {\n\t\t\t\tval += \"\";\n\n\t\t\t} else if ( Array.isArray( val ) ) {\n\t\t\t\tval = jQuery.map( val, function( value ) {\n\t\t\t\t\treturn value == null ? \"\" : value + \"\";\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\thooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];\n\n\t\t\t// If set returns undefined, fall back to normal setting\n\t\t\tif ( !hooks || !( \"set\" in hooks ) || hooks.set( this, val, \"value\" ) === undefined ) {\n\t\t\t\tthis.value = val;\n\t\t\t}\n\t\t} );\n\t}\n} );\n\njQuery.extend( {\n\tvalHooks: {\n\t\toption: {\n\t\t\tget: function( elem ) {\n\n\t\t\t\tvar val = jQuery.find.attr( elem, \"value\" );\n\t\t\t\treturn val != null ?\n\t\t\t\t\tval :\n\n\t\t\t\t\t// Support: IE <=10 - 11 only\n\t\t\t\t\t// option.text throws exceptions (#14686, #14858)\n\t\t\t\t\t// Strip and collapse whitespace\n\t\t\t\t\t// https://html.spec.whatwg.org/#strip-and-collapse-whitespace\n\t\t\t\t\tstripAndCollapse( jQuery.text( elem ) );\n\t\t\t}\n\t\t},\n\t\tselect: {\n\t\t\tget: function( elem ) {\n\t\t\t\tvar value, option, i,\n\t\t\t\t\toptions = elem.options,\n\t\t\t\t\tindex = elem.selectedIndex,\n\t\t\t\t\tone = elem.type === \"select-one\",\n\t\t\t\t\tvalues = one ? null : [],\n\t\t\t\t\tmax = one ? index + 1 : options.length;\n\n\t\t\t\tif ( index < 0 ) {\n\t\t\t\t\ti = max;\n\n\t\t\t\t} else {\n\t\t\t\t\ti = one ? index : 0;\n\t\t\t\t}\n\n\t\t\t\t// Loop through all the selected options\n\t\t\t\tfor ( ; i < max; i++ ) {\n\t\t\t\t\toption = options[ i ];\n\n\t\t\t\t\t// Support: IE <=9 only\n\t\t\t\t\t// IE8-9 doesn't update selected after form reset (#2551)\n\t\t\t\t\tif ( ( option.selected || i === index ) &&\n\n\t\t\t\t\t\t\t// Don't return options that are disabled or in a disabled optgroup\n\t\t\t\t\t\t\t!option.disabled &&\n\t\t\t\t\t\t\t( !option.parentNode.disabled ||\n\t\t\t\t\t\t\t\t!nodeName( option.parentNode, \"optgroup\" ) ) ) {\n\n\t\t\t\t\t\t// Get the specific value for the option\n\t\t\t\t\t\tvalue = jQuery( option ).val();\n\n\t\t\t\t\t\t// We don't need an array for one selects\n\t\t\t\t\t\tif ( one ) {\n\t\t\t\t\t\t\treturn value;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Multi-Selects return an array\n\t\t\t\t\t\tvalues.push( value );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn values;\n\t\t\t},\n\n\t\t\tset: function( elem, value ) {\n\t\t\t\tvar optionSet, option,\n\t\t\t\t\toptions = elem.options,\n\t\t\t\t\tvalues = jQuery.makeArray( value ),\n\t\t\t\t\ti = options.length;\n\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\toption = options[ i ];\n\n\t\t\t\t\t/* eslint-disable no-cond-assign */\n\n\t\t\t\t\tif ( option.selected =\n\t\t\t\t\t\tjQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1\n\t\t\t\t\t) {\n\t\t\t\t\t\toptionSet = true;\n\t\t\t\t\t}\n\n\t\t\t\t\t/* eslint-enable no-cond-assign */\n\t\t\t\t}\n\n\t\t\t\t// Force browsers to behave consistently when non-matching value is set\n\t\t\t\tif ( !optionSet ) {\n\t\t\t\t\telem.selectedIndex = -1;\n\t\t\t\t}\n\t\t\t\treturn values;\n\t\t\t}\n\t\t}\n\t}\n} );\n\n// Radios and checkboxes getter/setter\njQuery.each( [ \"radio\", \"checkbox\" ], function() {\n\tjQuery.valHooks[ this ] = {\n\t\tset: function( elem, value ) {\n\t\t\tif ( Array.isArray( value ) ) {\n\t\t\t\treturn ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );\n\t\t\t}\n\t\t}\n\t};\n\tif ( !support.checkOn ) {\n\t\tjQuery.valHooks[ this ].get = function( elem ) {\n\t\t\treturn elem.getAttribute( \"value\" ) === null ? \"on\" : elem.value;\n\t\t};\n\t}\n} );\n\n\n\n\n// Return jQuery for attributes-only inclusion\n\n\nsupport.focusin = \"onfocusin\" in window;\n\n\nvar rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,\n\tstopPropagationCallback = function( e ) {\n\t\te.stopPropagation();\n\t};\n\njQuery.extend( jQuery.event, {\n\n\ttrigger: function( event, data, elem, onlyHandlers ) {\n\n\t\tvar i, cur, tmp, bubbleType, ontype, handle, special, lastElement,\n\t\t\teventPath = [ elem || document ],\n\t\t\ttype = hasOwn.call( event, \"type\" ) ? event.type : event,\n\t\t\tnamespaces = hasOwn.call( event, \"namespace\" ) ? event.namespace.split( \".\" ) : [];\n\n\t\tcur = lastElement = tmp = elem = elem || document;\n\n\t\t// Don't do events on text and comment nodes\n\t\tif ( elem.nodeType === 3 || elem.nodeType === 8 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// focus/blur morphs to focusin/out; ensure we're not firing them right now\n\t\tif ( rfocusMorph.test( type + jQuery.event.triggered ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( type.indexOf( \".\" ) > -1 ) {\n\n\t\t\t// Namespaced trigger; create a regexp to match event type in handle()\n\t\t\tnamespaces = type.split( \".\" );\n\t\t\ttype = namespaces.shift();\n\t\t\tnamespaces.sort();\n\t\t}\n\t\tontype = type.indexOf( \":\" ) < 0 && \"on\" + type;\n\n\t\t// Caller can pass in a jQuery.Event object, Object, or just an event type string\n\t\tevent = event[ jQuery.expando ] ?\n\t\t\tevent :\n\t\t\tnew jQuery.Event( type, typeof event === \"object\" && event );\n\n\t\t// Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)\n\t\tevent.isTrigger = onlyHandlers ? 2 : 3;\n\t\tevent.namespace = namespaces.join( \".\" );\n\t\tevent.rnamespace = event.namespace ?\n\t\t\tnew RegExp( \"(^|\\\\.)\" + namespaces.join( \"\\\\.(?:.*\\\\.|)\" ) + \"(\\\\.|$)\" ) :\n\t\t\tnull;\n\n\t\t// Clean up the event in case it is being reused\n\t\tevent.result = undefined;\n\t\tif ( !event.target ) {\n\t\t\tevent.target = elem;\n\t\t}\n\n\t\t// Clone any incoming data and prepend the event, creating the handler arg list\n\t\tdata = data == null ?\n\t\t\t[ event ] :\n\t\t\tjQuery.makeArray( data, [ event ] );\n\n\t\t// Allow special events to draw outside the lines\n\t\tspecial = jQuery.event.special[ type ] || {};\n\t\tif ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine event propagation path in advance, per W3C events spec (#9951)\n\t\t// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)\n\t\tif ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {\n\n\t\t\tbubbleType = special.delegateType || type;\n\t\t\tif ( !rfocusMorph.test( bubbleType + type ) ) {\n\t\t\t\tcur = cur.parentNode;\n\t\t\t}\n\t\t\tfor ( ; cur; cur = cur.parentNode ) {\n\t\t\t\teventPath.push( cur );\n\t\t\t\ttmp = cur;\n\t\t\t}\n\n\t\t\t// Only add window if we got to document (e.g., not plain obj or detached DOM)\n\t\t\tif ( tmp === ( elem.ownerDocument || document ) ) {\n\t\t\t\teventPath.push( tmp.defaultView || tmp.parentWindow || window );\n\t\t\t}\n\t\t}\n\n\t\t// Fire handlers on the event path\n\t\ti = 0;\n\t\twhile ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {\n\t\t\tlastElement = cur;\n\t\t\tevent.type = i > 1 ?\n\t\t\t\tbubbleType :\n\t\t\t\tspecial.bindType || type;\n\n\t\t\t// jQuery handler\n\t\t\thandle = ( dataPriv.get( cur, \"events\" ) || {} )[ event.type ] &&\n\t\t\t\tdataPriv.get( cur, \"handle\" );\n\t\t\tif ( handle ) {\n\t\t\t\thandle.apply( cur, data );\n\t\t\t}\n\n\t\t\t// Native handler\n\t\t\thandle = ontype && cur[ ontype ];\n\t\t\tif ( handle && handle.apply && acceptData( cur ) ) {\n\t\t\t\tevent.result = handle.apply( cur, data );\n\t\t\t\tif ( event.result === false ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tevent.type = type;\n\n\t\t// If nobody prevented the default action, do it now\n\t\tif ( !onlyHandlers && !event.isDefaultPrevented() ) {\n\n\t\t\tif ( ( !special._default ||\n\t\t\t\tspecial._default.apply( eventPath.pop(), data ) === false ) &&\n\t\t\t\tacceptData( elem ) ) {\n\n\t\t\t\t// Call a native DOM method on the target with the same name as the event.\n\t\t\t\t// Don't do default actions on window, that's where global variables be (#6170)\n\t\t\t\tif ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {\n\n\t\t\t\t\t// Don't re-trigger an onFOO event when we call its FOO() method\n\t\t\t\t\ttmp = elem[ ontype ];\n\n\t\t\t\t\tif ( tmp ) {\n\t\t\t\t\t\telem[ ontype ] = null;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prevent re-triggering of the same event, since we already bubbled it above\n\t\t\t\t\tjQuery.event.triggered = type;\n\n\t\t\t\t\tif ( event.isPropagationStopped() ) {\n\t\t\t\t\t\tlastElement.addEventListener( type, stopPropagationCallback );\n\t\t\t\t\t}\n\n\t\t\t\t\telem[ type ]();\n\n\t\t\t\t\tif ( event.isPropagationStopped() ) {\n\t\t\t\t\t\tlastElement.removeEventListener( type, stopPropagationCallback );\n\t\t\t\t\t}\n\n\t\t\t\t\tjQuery.event.triggered = undefined;\n\n\t\t\t\t\tif ( tmp ) {\n\t\t\t\t\t\telem[ ontype ] = tmp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn event.result;\n\t},\n\n\t// Piggyback on a donor event to simulate a different one\n\t// Used only for `focus(in | out)` events\n\tsimulate: function( type, elem, event ) {\n\t\tvar e = jQuery.extend(\n\t\t\tnew jQuery.Event(),\n\t\t\tevent,\n\t\t\t{\n\t\t\t\ttype: type,\n\t\t\t\tisSimulated: true\n\t\t\t}\n\t\t);\n\n\t\tjQuery.event.trigger( e, null, elem );\n\t}\n\n} );\n\njQuery.fn.extend( {\n\n\ttrigger: function( type, data ) {\n\t\treturn this.each( function() {\n\t\t\tjQuery.event.trigger( type, data, this );\n\t\t} );\n\t},\n\ttriggerHandler: function( type, data ) {\n\t\tvar elem = this[ 0 ];\n\t\tif ( elem ) {\n\t\t\treturn jQuery.event.trigger( type, data, elem, true );\n\t\t}\n\t}\n} );\n\n\n// Support: Firefox <=44\n// Firefox doesn't have focus(in | out) events\n// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787\n//\n// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1\n// focus(in | out) events fire after focus & blur events,\n// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order\n// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857\nif ( !support.focusin ) {\n\tjQuery.each( { focus: \"focusin\", blur: \"focusout\" }, function( orig, fix ) {\n\n\t\t// Attach a single capturing handler on the document while someone wants focusin/focusout\n\t\tvar handler = function( event ) {\n\t\t\tjQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );\n\t\t};\n\n\t\tjQuery.event.special[ fix ] = {\n\t\t\tsetup: function() {\n\t\t\t\tvar doc = this.ownerDocument || this,\n\t\t\t\t\tattaches = dataPriv.access( doc, fix );\n\n\t\t\t\tif ( !attaches ) {\n\t\t\t\t\tdoc.addEventListener( orig, handler, true );\n\t\t\t\t}\n\t\t\t\tdataPriv.access( doc, fix, ( attaches || 0 ) + 1 );\n\t\t\t},\n\t\t\tteardown: function() {\n\t\t\t\tvar doc = this.ownerDocument || this,\n\t\t\t\t\tattaches = dataPriv.access( doc, fix ) - 1;\n\n\t\t\t\tif ( !attaches ) {\n\t\t\t\t\tdoc.removeEventListener( orig, handler, true );\n\t\t\t\t\tdataPriv.remove( doc, fix );\n\n\t\t\t\t} else {\n\t\t\t\t\tdataPriv.access( doc, fix, attaches );\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t} );\n}\nvar location = window.location;\n\nvar nonce = Date.now();\n\nvar rquery = ( /\\?/ );\n\n\n\n// Cross-browser xml parsing\njQuery.parseXML = function( data ) {\n\tvar xml;\n\tif ( !data || typeof data !== \"string\" ) {\n\t\treturn null;\n\t}\n\n\t// Support: IE 9 - 11 only\n\t// IE throws on parseFromString with invalid input.\n\ttry {\n\t\txml = ( new window.DOMParser() ).parseFromString( data, \"text/xml\" );\n\t} catch ( e ) {\n\t\txml = undefined;\n\t}\n\n\tif ( !xml || xml.getElementsByTagName( \"parsererror\" ).length ) {\n\t\tjQuery.error( \"Invalid XML: \" + data );\n\t}\n\treturn xml;\n};\n\n\nvar\n\trbracket = /\\[\\]$/,\n\trCRLF = /\\r?\\n/g,\n\trsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,\n\trsubmittable = /^(?:input|select|textarea|keygen)/i;\n\nfunction buildParams( prefix, obj, traditional, add ) {\n\tvar name;\n\n\tif ( Array.isArray( obj ) ) {\n\n\t\t// Serialize array item.\n\t\tjQuery.each( obj, function( i, v ) {\n\t\t\tif ( traditional || rbracket.test( prefix ) ) {\n\n\t\t\t\t// Treat each array item as a scalar.\n\t\t\t\tadd( prefix, v );\n\n\t\t\t} else {\n\n\t\t\t\t// Item is non-scalar (array or object), encode its numeric index.\n\t\t\t\tbuildParams(\n\t\t\t\t\tprefix + \"[\" + ( typeof v === \"object\" && v != null ? i : \"\" ) + \"]\",\n\t\t\t\t\tv,\n\t\t\t\t\ttraditional,\n\t\t\t\t\tadd\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\n\t} else if ( !traditional && toType( obj ) === \"object\" ) {\n\n\t\t// Serialize object item.\n\t\tfor ( name in obj ) {\n\t\t\tbuildParams( prefix + \"[\" + name + \"]\", obj[ name ], traditional, add );\n\t\t}\n\n\t} else {\n\n\t\t// Serialize scalar item.\n\t\tadd( prefix, obj );\n\t}\n}\n\n// Serialize an array of form elements or a set of\n// key/values into a query string\njQuery.param = function( a, traditional ) {\n\tvar prefix,\n\t\ts = [],\n\t\tadd = function( key, valueOrFunction ) {\n\n\t\t\t// If value is a function, invoke it and use its return value\n\t\t\tvar value = isFunction( valueOrFunction ) ?\n\t\t\t\tvalueOrFunction() :\n\t\t\t\tvalueOrFunction;\n\n\t\t\ts[ s.length ] = encodeURIComponent( key ) + \"=\" +\n\t\t\t\tencodeURIComponent( value == null ? \"\" : value );\n\t\t};\n\n\tif ( a == null ) {\n\t\treturn \"\";\n\t}\n\n\t// If an array was passed in, assume that it is an array of form elements.\n\tif ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {\n\n\t\t// Serialize the form elements\n\t\tjQuery.each( a, function() {\n\t\t\tadd( this.name, this.value );\n\t\t} );\n\n\t} else {\n\n\t\t// If traditional, encode the \"old\" way (the way 1.3.2 or older\n\t\t// did it), otherwise encode params recursively.\n\t\tfor ( prefix in a ) {\n\t\t\tbuildParams( prefix, a[ prefix ], traditional, add );\n\t\t}\n\t}\n\n\t// Return the resulting serialization\n\treturn s.join( \"&\" );\n};\n\njQuery.fn.extend( {\n\tserialize: function() {\n\t\treturn jQuery.param( this.serializeArray() );\n\t},\n\tserializeArray: function() {\n\t\treturn this.map( function() {\n\n\t\t\t// Can add propHook for \"elements\" to filter or add form elements\n\t\t\tvar elements = jQuery.prop( this, \"elements\" );\n\t\t\treturn elements ? jQuery.makeArray( elements ) : this;\n\t\t} )\n\t\t.filter( function() {\n\t\t\tvar type = this.type;\n\n\t\t\t// Use .is( \":disabled\" ) so that fieldset[disabled] works\n\t\t\treturn this.name && !jQuery( this ).is( \":disabled\" ) &&\n\t\t\t\trsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&\n\t\t\t\t( this.checked || !rcheckableType.test( type ) );\n\t\t} )\n\t\t.map( function( i, elem ) {\n\t\t\tvar val = jQuery( this ).val();\n\n\t\t\tif ( val == null ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif ( Array.isArray( val ) ) {\n\t\t\t\treturn jQuery.map( val, function( val ) {\n\t\t\t\t\treturn { name: elem.name, value: val.replace( rCRLF, \"\\r\\n\" ) };\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\treturn { name: elem.name, value: val.replace( rCRLF, \"\\r\\n\" ) };\n\t\t} ).get();\n\t}\n} );\n\n\nvar\n\tr20 = /%20/g,\n\trhash = /#.*$/,\n\trantiCache = /([?&])_=[^&]*/,\n\trheaders = /^(.*?):[ \\t]*([^\\r\\n]*)$/mg,\n\n\t// #7653, #8125, #8152: local protocol detection\n\trlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,\n\trnoContent = /^(?:GET|HEAD)$/,\n\trprotocol = /^\\/\\//,\n\n\t/* Prefilters\n\t * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)\n\t * 2) These are called:\n\t *    - BEFORE asking for a transport\n\t *    - AFTER param serialization (s.data is a string if s.processData is true)\n\t * 3) key is the dataType\n\t * 4) the catchall symbol \"*\" can be used\n\t * 5) execution will start with transport dataType and THEN continue down to \"*\" if needed\n\t */\n\tprefilters = {},\n\n\t/* Transports bindings\n\t * 1) key is the dataType\n\t * 2) the catchall symbol \"*\" can be used\n\t * 3) selection will start with transport dataType and THEN go to \"*\" if needed\n\t */\n\ttransports = {},\n\n\t// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression\n\tallTypes = \"*/\".concat( \"*\" ),\n\n\t// Anchor tag for parsing the document origin\n\toriginAnchor = document.createElement( \"a\" );\n\toriginAnchor.href = location.href;\n\n// Base \"constructor\" for jQuery.ajaxPrefilter and jQuery.ajaxTransport\nfunction addToPrefiltersOrTransports( structure ) {\n\n\t// dataTypeExpression is optional and defaults to \"*\"\n\treturn function( dataTypeExpression, func ) {\n\n\t\tif ( typeof dataTypeExpression !== \"string\" ) {\n\t\t\tfunc = dataTypeExpression;\n\t\t\tdataTypeExpression = \"*\";\n\t\t}\n\n\t\tvar dataType,\n\t\t\ti = 0,\n\t\t\tdataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];\n\n\t\tif ( isFunction( func ) ) {\n\n\t\t\t// For each dataType in the dataTypeExpression\n\t\t\twhile ( ( dataType = dataTypes[ i++ ] ) ) {\n\n\t\t\t\t// Prepend if requested\n\t\t\t\tif ( dataType[ 0 ] === \"+\" ) {\n\t\t\t\t\tdataType = dataType.slice( 1 ) || \"*\";\n\t\t\t\t\t( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );\n\n\t\t\t\t// Otherwise append\n\t\t\t\t} else {\n\t\t\t\t\t( structure[ dataType ] = structure[ dataType ] || [] ).push( func );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\n\n// Base inspection function for prefilters and transports\nfunction inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t} );\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}\n\n// A special extend for ajax options\n// that takes \"flat\" options (not to be deep extended)\n// Fixes #9887\nfunction ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}\n\n/* Handles responses to an ajax request:\n * - finds the right dataType (mediates between content-type and expected dataType)\n * - returns the corresponding response\n */\nfunction ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}\n\n/* Chain conversions given the request and the original response\n * Also sets the responseXXX fields on the jqXHR instance\n */\nfunction ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s.throws ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tstate: \"parsererror\",\n\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}\n\njQuery.extend( {\n\n\t// Counter for holding the number of active queries\n\tactive: 0,\n\n\t// Last-Modified header cache for next request\n\tlastModified: {},\n\tetag: {},\n\n\tajaxSettings: {\n\t\turl: location.href,\n\t\ttype: \"GET\",\n\t\tisLocal: rlocalProtocol.test( location.protocol ),\n\t\tglobal: true,\n\t\tprocessData: true,\n\t\tasync: true,\n\t\tcontentType: \"application/x-www-form-urlencoded; charset=UTF-8\",\n\n\t\t/*\n\t\ttimeout: 0,\n\t\tdata: null,\n\t\tdataType: null,\n\t\tusername: null,\n\t\tpassword: null,\n\t\tcache: null,\n\t\tthrows: false,\n\t\ttraditional: false,\n\t\theaders: {},\n\t\t*/\n\n\t\taccepts: {\n\t\t\t\"*\": allTypes,\n\t\t\ttext: \"text/plain\",\n\t\t\thtml: \"text/html\",\n\t\t\txml: \"application/xml, text/xml\",\n\t\t\tjson: \"application/json, text/javascript\"\n\t\t},\n\n\t\tcontents: {\n\t\t\txml: /\\bxml\\b/,\n\t\t\thtml: /\\bhtml/,\n\t\t\tjson: /\\bjson\\b/\n\t\t},\n\n\t\tresponseFields: {\n\t\t\txml: \"responseXML\",\n\t\t\ttext: \"responseText\",\n\t\t\tjson: \"responseJSON\"\n\t\t},\n\n\t\t// Data converters\n\t\t// Keys separate source (or catchall \"*\") and destination types with a single space\n\t\tconverters: {\n\n\t\t\t// Convert anything to text\n\t\t\t\"* text\": String,\n\n\t\t\t// Text to html (true = no transformation)\n\t\t\t\"text html\": true,\n\n\t\t\t// Evaluate text as a json expression\n\t\t\t\"text json\": JSON.parse,\n\n\t\t\t// Parse text as xml\n\t\t\t\"text xml\": jQuery.parseXML\n\t\t},\n\n\t\t// For options that shouldn't be deep extended:\n\t\t// you can add your own custom options here if\n\t\t// and when you create one that shouldn't be\n\t\t// deep extended (see ajaxExtend)\n\t\tflatOptions: {\n\t\t\turl: true,\n\t\t\tcontext: true\n\t\t}\n\t},\n\n\t// Creates a full fledged settings object into target\n\t// with both ajaxSettings and settings fields.\n\t// If target is omitted, writes into ajaxSettings.\n\tajaxSetup: function( target, settings ) {\n\t\treturn settings ?\n\n\t\t\t// Building a settings object\n\t\t\tajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :\n\n\t\t\t// Extending ajaxSettings\n\t\t\tajaxExtend( jQuery.ajaxSettings, target );\n\t},\n\n\tajaxPrefilter: addToPrefiltersOrTransports( prefilters ),\n\tajaxTransport: addToPrefiltersOrTransports( transports ),\n\n\t// Main method\n\tajax: function( url, options ) {\n\n\t\t// If url is an object, simulate pre-1.5 signature\n\t\tif ( typeof url === \"object\" ) {\n\t\t\toptions = url;\n\t\t\turl = undefined;\n\t\t}\n\n\t\t// Force options to be an object\n\t\toptions = options || {};\n\n\t\tvar transport,\n\n\t\t\t// URL without anti-cache param\n\t\t\tcacheURL,\n\n\t\t\t// Response headers\n\t\t\tresponseHeadersString,\n\t\t\tresponseHeaders,\n\n\t\t\t// timeout handle\n\t\t\ttimeoutTimer,\n\n\t\t\t// Url cleanup var\n\t\t\turlAnchor,\n\n\t\t\t// Request state (becomes false upon send and true upon completion)\n\t\t\tcompleted,\n\n\t\t\t// To know if global events are to be dispatched\n\t\t\tfireGlobals,\n\n\t\t\t// Loop variable\n\t\t\ti,\n\n\t\t\t// uncached part of the url\n\t\t\tuncached,\n\n\t\t\t// Create the final options object\n\t\t\ts = jQuery.ajaxSetup( {}, options ),\n\n\t\t\t// Callbacks context\n\t\t\tcallbackContext = s.context || s,\n\n\t\t\t// Context for global events is callbackContext if it is a DOM node or jQuery collection\n\t\t\tglobalEventContext = s.context &&\n\t\t\t\t( callbackContext.nodeType || callbackContext.jquery ) ?\n\t\t\t\t\tjQuery( callbackContext ) :\n\t\t\t\t\tjQuery.event,\n\n\t\t\t// Deferreds\n\t\t\tdeferred = jQuery.Deferred(),\n\t\t\tcompleteDeferred = jQuery.Callbacks( \"once memory\" ),\n\n\t\t\t// Status-dependent callbacks\n\t\t\tstatusCode = s.statusCode || {},\n\n\t\t\t// Headers (they are sent all at once)\n\t\t\trequestHeaders = {},\n\t\t\trequestHeadersNames = {},\n\n\t\t\t// Default abort message\n\t\t\tstrAbort = \"canceled\",\n\n\t\t\t// Fake xhr\n\t\t\tjqXHR = {\n\t\t\t\treadyState: 0,\n\n\t\t\t\t// Builds headers hashtable if needed\n\t\t\t\tgetResponseHeader: function( key ) {\n\t\t\t\t\tvar match;\n\t\t\t\t\tif ( completed ) {\n\t\t\t\t\t\tif ( !responseHeaders ) {\n\t\t\t\t\t\t\tresponseHeaders = {};\n\t\t\t\t\t\t\twhile ( ( match = rheaders.exec( responseHeadersString ) ) ) {\n\t\t\t\t\t\t\t\tresponseHeaders[ match[ 1 ].toLowerCase() + \" \" ] =\n\t\t\t\t\t\t\t\t\t( responseHeaders[ match[ 1 ].toLowerCase() + \" \" ] || [] )\n\t\t\t\t\t\t\t\t\t\t.concat( match[ 2 ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmatch = responseHeaders[ key.toLowerCase() + \" \" ];\n\t\t\t\t\t}\n\t\t\t\t\treturn match == null ? null : match.join( \", \" );\n\t\t\t\t},\n\n\t\t\t\t// Raw string\n\t\t\t\tgetAllResponseHeaders: function() {\n\t\t\t\t\treturn completed ? responseHeadersString : null;\n\t\t\t\t},\n\n\t\t\t\t// Caches the header\n\t\t\t\tsetRequestHeader: function( name, value ) {\n\t\t\t\t\tif ( completed == null ) {\n\t\t\t\t\t\tname = requestHeadersNames[ name.toLowerCase() ] =\n\t\t\t\t\t\t\trequestHeadersNames[ name.toLowerCase() ] || name;\n\t\t\t\t\t\trequestHeaders[ name ] = value;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Overrides response content-type header\n\t\t\t\toverrideMimeType: function( type ) {\n\t\t\t\t\tif ( completed == null ) {\n\t\t\t\t\t\ts.mimeType = type;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Status-dependent callbacks\n\t\t\t\tstatusCode: function( map ) {\n\t\t\t\t\tvar code;\n\t\t\t\t\tif ( map ) {\n\t\t\t\t\t\tif ( completed ) {\n\n\t\t\t\t\t\t\t// Execute the appropriate callbacks\n\t\t\t\t\t\t\tjqXHR.always( map[ jqXHR.status ] );\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// Lazy-add the new callbacks in a way that preserves old ones\n\t\t\t\t\t\t\tfor ( code in map ) {\n\t\t\t\t\t\t\t\tstatusCode[ code ] = [ statusCode[ code ], map[ code ] ];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Cancel the request\n\t\t\t\tabort: function( statusText ) {\n\t\t\t\t\tvar finalText = statusText || strAbort;\n\t\t\t\t\tif ( transport ) {\n\t\t\t\t\t\ttransport.abort( finalText );\n\t\t\t\t\t}\n\t\t\t\t\tdone( 0, finalText );\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t};\n\n\t\t// Attach deferreds\n\t\tdeferred.promise( jqXHR );\n\n\t\t// Add protocol if not provided (prefilters might expect it)\n\t\t// Handle falsy url in the settings object (#10093: consistency with old signature)\n\t\t// We also use the url parameter if available\n\t\ts.url = ( ( url || s.url || location.href ) + \"\" )\n\t\t\t.replace( rprotocol, location.protocol + \"//\" );\n\n\t\t// Alias method option to type as per ticket #12004\n\t\ts.type = options.method || options.type || s.method || s.type;\n\n\t\t// Extract dataTypes list\n\t\ts.dataTypes = ( s.dataType || \"*\" ).toLowerCase().match( rnothtmlwhite ) || [ \"\" ];\n\n\t\t// A cross-domain request is in order when the origin doesn't match the current origin.\n\t\tif ( s.crossDomain == null ) {\n\t\t\turlAnchor = document.createElement( \"a\" );\n\n\t\t\t// Support: IE <=8 - 11, Edge 12 - 15\n\t\t\t// IE throws exception on accessing the href property if url is malformed,\n\t\t\t// e.g. http://example.com:80x/\n\t\t\ttry {\n\t\t\t\turlAnchor.href = s.url;\n\n\t\t\t\t// Support: IE <=8 - 11 only\n\t\t\t\t// Anchor's host property isn't correctly set when s.url is relative\n\t\t\t\turlAnchor.href = urlAnchor.href;\n\t\t\t\ts.crossDomain = originAnchor.protocol + \"//\" + originAnchor.host !==\n\t\t\t\t\turlAnchor.protocol + \"//\" + urlAnchor.host;\n\t\t\t} catch ( e ) {\n\n\t\t\t\t// If there is an error parsing the URL, assume it is crossDomain,\n\t\t\t\t// it can be rejected by the transport if it is invalid\n\t\t\t\ts.crossDomain = true;\n\t\t\t}\n\t\t}\n\n\t\t// Convert data if not already a string\n\t\tif ( s.data && s.processData && typeof s.data !== \"string\" ) {\n\t\t\ts.data = jQuery.param( s.data, s.traditional );\n\t\t}\n\n\t\t// Apply prefilters\n\t\tinspectPrefiltersOrTransports( prefilters, s, options, jqXHR );\n\n\t\t// If request was aborted inside a prefilter, stop there\n\t\tif ( completed ) {\n\t\t\treturn jqXHR;\n\t\t}\n\n\t\t// We can fire global events as of now if asked to\n\t\t// Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)\n\t\tfireGlobals = jQuery.event && s.global;\n\n\t\t// Watch for a new set of requests\n\t\tif ( fireGlobals && jQuery.active++ === 0 ) {\n\t\t\tjQuery.event.trigger( \"ajaxStart\" );\n\t\t}\n\n\t\t// Uppercase the type\n\t\ts.type = s.type.toUpperCase();\n\n\t\t// Determine if request has content\n\t\ts.hasContent = !rnoContent.test( s.type );\n\n\t\t// Save the URL in case we're toying with the If-Modified-Since\n\t\t// and/or If-None-Match header later on\n\t\t// Remove hash to simplify url manipulation\n\t\tcacheURL = s.url.replace( rhash, \"\" );\n\n\t\t// More options handling for requests with no content\n\t\tif ( !s.hasContent ) {\n\n\t\t\t// Remember the hash so we can put it back\n\t\t\tuncached = s.url.slice( cacheURL.length );\n\n\t\t\t// If data is available and should be processed, append data to url\n\t\t\tif ( s.data && ( s.processData || typeof s.data === \"string\" ) ) {\n\t\t\t\tcacheURL += ( rquery.test( cacheURL ) ? \"&\" : \"?\" ) + s.data;\n\n\t\t\t\t// #9682: remove data so that it's not used in an eventual retry\n\t\t\t\tdelete s.data;\n\t\t\t}\n\n\t\t\t// Add or update anti-cache param if needed\n\t\t\tif ( s.cache === false ) {\n\t\t\t\tcacheURL = cacheURL.replace( rantiCache, \"$1\" );\n\t\t\t\tuncached = ( rquery.test( cacheURL ) ? \"&\" : \"?\" ) + \"_=\" + ( nonce++ ) + uncached;\n\t\t\t}\n\n\t\t\t// Put hash and anti-cache on the URL that will be requested (gh-1732)\n\t\t\ts.url = cacheURL + uncached;\n\n\t\t// Change '%20' to '+' if this is encoded form body content (gh-2658)\n\t\t} else if ( s.data && s.processData &&\n\t\t\t( s.contentType || \"\" ).indexOf( \"application/x-www-form-urlencoded\" ) === 0 ) {\n\t\t\ts.data = s.data.replace( r20, \"+\" );\n\t\t}\n\n\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\tif ( s.ifModified ) {\n\t\t\tif ( jQuery.lastModified[ cacheURL ] ) {\n\t\t\t\tjqXHR.setRequestHeader( \"If-Modified-Since\", jQuery.lastModified[ cacheURL ] );\n\t\t\t}\n\t\t\tif ( jQuery.etag[ cacheURL ] ) {\n\t\t\t\tjqXHR.setRequestHeader( \"If-None-Match\", jQuery.etag[ cacheURL ] );\n\t\t\t}\n\t\t}\n\n\t\t// Set the correct header, if data is being sent\n\t\tif ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {\n\t\t\tjqXHR.setRequestHeader( \"Content-Type\", s.contentType );\n\t\t}\n\n\t\t// Set the Accepts header for the server, depending on the dataType\n\t\tjqXHR.setRequestHeader(\n\t\t\t\"Accept\",\n\t\t\ts.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?\n\t\t\t\ts.accepts[ s.dataTypes[ 0 ] ] +\n\t\t\t\t\t( s.dataTypes[ 0 ] !== \"*\" ? \", \" + allTypes + \"; q=0.01\" : \"\" ) :\n\t\t\t\ts.accepts[ \"*\" ]\n\t\t);\n\n\t\t// Check for headers option\n\t\tfor ( i in s.headers ) {\n\t\t\tjqXHR.setRequestHeader( i, s.headers[ i ] );\n\t\t}\n\n\t\t// Allow custom headers/mimetypes and early abort\n\t\tif ( s.beforeSend &&\n\t\t\t( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {\n\n\t\t\t// Abort if not done already and return\n\t\t\treturn jqXHR.abort();\n\t\t}\n\n\t\t// Aborting is no longer a cancellation\n\t\tstrAbort = \"abort\";\n\n\t\t// Install callbacks on deferreds\n\t\tcompleteDeferred.add( s.complete );\n\t\tjqXHR.done( s.success );\n\t\tjqXHR.fail( s.error );\n\n\t\t// Get transport\n\t\ttransport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );\n\n\t\t// If no transport, we auto-abort\n\t\tif ( !transport ) {\n\t\t\tdone( -1, \"No Transport\" );\n\t\t} else {\n\t\t\tjqXHR.readyState = 1;\n\n\t\t\t// Send global event\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxSend\", [ jqXHR, s ] );\n\t\t\t}\n\n\t\t\t// If request was aborted inside ajaxSend, stop there\n\t\t\tif ( completed ) {\n\t\t\t\treturn jqXHR;\n\t\t\t}\n\n\t\t\t// Timeout\n\t\t\tif ( s.async && s.timeout > 0 ) {\n\t\t\t\ttimeoutTimer = window.setTimeout( function() {\n\t\t\t\t\tjqXHR.abort( \"timeout\" );\n\t\t\t\t}, s.timeout );\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tcompleted = false;\n\t\t\t\ttransport.send( requestHeaders, done );\n\t\t\t} catch ( e ) {\n\n\t\t\t\t// Rethrow post-completion exceptions\n\t\t\t\tif ( completed ) {\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\n\t\t\t\t// Propagate others as results\n\t\t\t\tdone( -1, e );\n\t\t\t}\n\t\t}\n\n\t\t// Callback for when everything is done\n\t\tfunction done( status, nativeStatusText, responses, headers ) {\n\t\t\tvar isSuccess, success, error, response, modified,\n\t\t\t\tstatusText = nativeStatusText;\n\n\t\t\t// Ignore repeat invocations\n\t\t\tif ( completed ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcompleted = true;\n\n\t\t\t// Clear timeout if it exists\n\t\t\tif ( timeoutTimer ) {\n\t\t\t\twindow.clearTimeout( timeoutTimer );\n\t\t\t}\n\n\t\t\t// Dereference transport for early garbage collection\n\t\t\t// (no matter how long the jqXHR object will be used)\n\t\t\ttransport = undefined;\n\n\t\t\t// Cache response headers\n\t\t\tresponseHeadersString = headers || \"\";\n\n\t\t\t// Set readyState\n\t\t\tjqXHR.readyState = status > 0 ? 4 : 0;\n\n\t\t\t// Determine if successful\n\t\t\tisSuccess = status >= 200 && status < 300 || status === 304;\n\n\t\t\t// Get response data\n\t\t\tif ( responses ) {\n\t\t\t\tresponse = ajaxHandleResponses( s, jqXHR, responses );\n\t\t\t}\n\n\t\t\t// Convert no matter what (that way responseXXX fields are always set)\n\t\t\tresponse = ajaxConvert( s, response, jqXHR, isSuccess );\n\n\t\t\t// If successful, handle type chaining\n\t\t\tif ( isSuccess ) {\n\n\t\t\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\t\t\tif ( s.ifModified ) {\n\t\t\t\t\tmodified = jqXHR.getResponseHeader( \"Last-Modified\" );\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.lastModified[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t\tmodified = jqXHR.getResponseHeader( \"etag\" );\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.etag[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// if no content\n\t\t\t\tif ( status === 204 || s.type === \"HEAD\" ) {\n\t\t\t\t\tstatusText = \"nocontent\";\n\n\t\t\t\t// if not modified\n\t\t\t\t} else if ( status === 304 ) {\n\t\t\t\t\tstatusText = \"notmodified\";\n\n\t\t\t\t// If we have data, let's convert it\n\t\t\t\t} else {\n\t\t\t\t\tstatusText = response.state;\n\t\t\t\t\tsuccess = response.data;\n\t\t\t\t\terror = response.error;\n\t\t\t\t\tisSuccess = !error;\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\t// Extract error from statusText and normalize for non-aborts\n\t\t\t\terror = statusText;\n\t\t\t\tif ( status || !statusText ) {\n\t\t\t\t\tstatusText = \"error\";\n\t\t\t\t\tif ( status < 0 ) {\n\t\t\t\t\t\tstatus = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set data for the fake xhr object\n\t\t\tjqXHR.status = status;\n\t\t\tjqXHR.statusText = ( nativeStatusText || statusText ) + \"\";\n\n\t\t\t// Success/Error\n\t\t\tif ( isSuccess ) {\n\t\t\t\tdeferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );\n\t\t\t} else {\n\t\t\t\tdeferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );\n\t\t\t}\n\n\t\t\t// Status-dependent callbacks\n\t\t\tjqXHR.statusCode( statusCode );\n\t\t\tstatusCode = undefined;\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( isSuccess ? \"ajaxSuccess\" : \"ajaxError\",\n\t\t\t\t\t[ jqXHR, s, isSuccess ? success : error ] );\n\t\t\t}\n\n\t\t\t// Complete\n\t\t\tcompleteDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxComplete\", [ jqXHR, s ] );\n\n\t\t\t\t// Handle the global AJAX counter\n\t\t\t\tif ( !( --jQuery.active ) ) {\n\t\t\t\t\tjQuery.event.trigger( \"ajaxStop\" );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn jqXHR;\n\t},\n\n\tgetJSON: function( url, data, callback ) {\n\t\treturn jQuery.get( url, data, callback, \"json\" );\n\t},\n\n\tgetScript: function( url, callback ) {\n\t\treturn jQuery.get( url, undefined, callback, \"script\" );\n\t}\n} );\n\njQuery.each( [ \"get\", \"post\" ], function( i, method ) {\n\tjQuery[ method ] = function( url, data, callback, type ) {\n\n\t\t// Shift arguments if data argument was omitted\n\t\tif ( isFunction( data ) ) {\n\t\t\ttype = type || callback;\n\t\t\tcallback = data;\n\t\t\tdata = undefined;\n\t\t}\n\n\t\t// The url can be an options object (which then must have .url)\n\t\treturn jQuery.ajax( jQuery.extend( {\n\t\t\turl: url,\n\t\t\ttype: method,\n\t\t\tdataType: type,\n\t\t\tdata: data,\n\t\t\tsuccess: callback\n\t\t}, jQuery.isPlainObject( url ) && url ) );\n\t};\n} );\n\n\njQuery._evalUrl = function( url, options ) {\n\treturn jQuery.ajax( {\n\t\turl: url,\n\n\t\t// Make this explicit, since user can override this through ajaxSetup (#11264)\n\t\ttype: \"GET\",\n\t\tdataType: \"script\",\n\t\tcache: true,\n\t\tasync: false,\n\t\tglobal: false,\n\n\t\t// Only evaluate the response if it is successful (gh-4126)\n\t\t// dataFilter is not invoked for failure responses, so using it instead\n\t\t// of the default converter is kludgy but it works.\n\t\tconverters: {\n\t\t\t\"text script\": function() {}\n\t\t},\n\t\tdataFilter: function( response ) {\n\t\t\tjQuery.globalEval( response, options );\n\t\t}\n\t} );\n};\n\n\njQuery.fn.extend( {\n\twrapAll: function( html ) {\n\t\tvar wrap;\n\n\t\tif ( this[ 0 ] ) {\n\t\t\tif ( isFunction( html ) ) {\n\t\t\t\thtml = html.call( this[ 0 ] );\n\t\t\t}\n\n\t\t\t// The elements to wrap the target around\n\t\t\twrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );\n\n\t\t\tif ( this[ 0 ].parentNode ) {\n\t\t\t\twrap.insertBefore( this[ 0 ] );\n\t\t\t}\n\n\t\t\twrap.map( function() {\n\t\t\t\tvar elem = this;\n\n\t\t\t\twhile ( elem.firstElementChild ) {\n\t\t\t\t\telem = elem.firstElementChild;\n\t\t\t\t}\n\n\t\t\t\treturn elem;\n\t\t\t} ).append( this );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\twrapInner: function( html ) {\n\t\tif ( isFunction( html ) ) {\n\t\t\treturn this.each( function( i ) {\n\t\t\t\tjQuery( this ).wrapInner( html.call( this, i ) );\n\t\t\t} );\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tvar self = jQuery( this ),\n\t\t\t\tcontents = self.contents();\n\n\t\t\tif ( contents.length ) {\n\t\t\t\tcontents.wrapAll( html );\n\n\t\t\t} else {\n\t\t\t\tself.append( html );\n\t\t\t}\n\t\t} );\n\t},\n\n\twrap: function( html ) {\n\t\tvar htmlIsFunction = isFunction( html );\n\n\t\treturn this.each( function( i ) {\n\t\t\tjQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html );\n\t\t} );\n\t},\n\n\tunwrap: function( selector ) {\n\t\tthis.parent( selector ).not( \"body\" ).each( function() {\n\t\t\tjQuery( this ).replaceWith( this.childNodes );\n\t\t} );\n\t\treturn this;\n\t}\n} );\n\n\njQuery.expr.pseudos.hidden = function( elem ) {\n\treturn !jQuery.expr.pseudos.visible( elem );\n};\njQuery.expr.pseudos.visible = function( elem ) {\n\treturn !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );\n};\n\n\n\n\njQuery.ajaxSettings.xhr = function() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n};\n\nvar xhrSuccessStatus = {\n\n\t\t// File protocol always yields status code 0, assume 200\n\t\t0: 200,\n\n\t\t// Support: IE <=9 only\n\t\t// #1450: sometimes IE returns 1223 when it should be 204\n\t\t1223: 204\n\t},\n\txhrSupported = jQuery.ajaxSettings.xhr();\n\nsupport.cors = !!xhrSupported && ( \"withCredentials\" in xhrSupported );\nsupport.ajax = xhrSupported = !!xhrSupported;\n\njQuery.ajaxTransport( function( options ) {\n\tvar callback, errorCallback;\n\n\t// Cross domain only allowed if supported through XMLHttpRequest\n\tif ( support.cors || xhrSupported && !options.crossDomain ) {\n\t\treturn {\n\t\t\tsend: function( headers, complete ) {\n\t\t\t\tvar i,\n\t\t\t\t\txhr = options.xhr();\n\n\t\t\t\txhr.open(\n\t\t\t\t\toptions.type,\n\t\t\t\t\toptions.url,\n\t\t\t\t\toptions.async,\n\t\t\t\t\toptions.username,\n\t\t\t\t\toptions.password\n\t\t\t\t);\n\n\t\t\t\t// Apply custom fields if provided\n\t\t\t\tif ( options.xhrFields ) {\n\t\t\t\t\tfor ( i in options.xhrFields ) {\n\t\t\t\t\t\txhr[ i ] = options.xhrFields[ i ];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Override mime type if needed\n\t\t\t\tif ( options.mimeType && xhr.overrideMimeType ) {\n\t\t\t\t\txhr.overrideMimeType( options.mimeType );\n\t\t\t\t}\n\n\t\t\t\t// X-Requested-With header\n\t\t\t\t// For cross-domain requests, seeing as conditions for a preflight are\n\t\t\t\t// akin to a jigsaw puzzle, we simply never set it to be sure.\n\t\t\t\t// (it can always be set on a per-request basis or even using ajaxSetup)\n\t\t\t\t// For same-domain requests, won't change header if already provided.\n\t\t\t\tif ( !options.crossDomain && !headers[ \"X-Requested-With\" ] ) {\n\t\t\t\t\theaders[ \"X-Requested-With\" ] = \"XMLHttpRequest\";\n\t\t\t\t}\n\n\t\t\t\t// Set headers\n\t\t\t\tfor ( i in headers ) {\n\t\t\t\t\txhr.setRequestHeader( i, headers[ i ] );\n\t\t\t\t}\n\n\t\t\t\t// Callback\n\t\t\t\tcallback = function( type ) {\n\t\t\t\t\treturn function() {\n\t\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\t\tcallback = errorCallback = xhr.onload =\n\t\t\t\t\t\t\t\txhr.onerror = xhr.onabort = xhr.ontimeout =\n\t\t\t\t\t\t\t\t\txhr.onreadystatechange = null;\n\n\t\t\t\t\t\t\tif ( type === \"abort\" ) {\n\t\t\t\t\t\t\t\txhr.abort();\n\t\t\t\t\t\t\t} else if ( type === \"error\" ) {\n\n\t\t\t\t\t\t\t\t// Support: IE <=9 only\n\t\t\t\t\t\t\t\t// On a manual native abort, IE9 throws\n\t\t\t\t\t\t\t\t// errors on any property access that is not readyState\n\t\t\t\t\t\t\t\tif ( typeof xhr.status !== \"number\" ) {\n\t\t\t\t\t\t\t\t\tcomplete( 0, \"error\" );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tcomplete(\n\n\t\t\t\t\t\t\t\t\t\t// File: protocol always yields status 0; see #8605, #14207\n\t\t\t\t\t\t\t\t\t\txhr.status,\n\t\t\t\t\t\t\t\t\t\txhr.statusText\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcomplete(\n\t\t\t\t\t\t\t\t\txhrSuccessStatus[ xhr.status ] || xhr.status,\n\t\t\t\t\t\t\t\t\txhr.statusText,\n\n\t\t\t\t\t\t\t\t\t// Support: IE <=9 only\n\t\t\t\t\t\t\t\t\t// IE9 has no XHR2 but throws on binary (trac-11426)\n\t\t\t\t\t\t\t\t\t// For XHR2 non-text, let the caller handle it (gh-2498)\n\t\t\t\t\t\t\t\t\t( xhr.responseType || \"text\" ) !== \"text\"  ||\n\t\t\t\t\t\t\t\t\ttypeof xhr.responseText !== \"string\" ?\n\t\t\t\t\t\t\t\t\t\t{ binary: xhr.response } :\n\t\t\t\t\t\t\t\t\t\t{ text: xhr.responseText },\n\t\t\t\t\t\t\t\t\txhr.getAllResponseHeaders()\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t// Listen to events\n\t\t\t\txhr.onload = callback();\n\t\t\t\terrorCallback = xhr.onerror = xhr.ontimeout = callback( \"error\" );\n\n\t\t\t\t// Support: IE 9 only\n\t\t\t\t// Use onreadystatechange to replace onabort\n\t\t\t\t// to handle uncaught aborts\n\t\t\t\tif ( xhr.onabort !== undefined ) {\n\t\t\t\t\txhr.onabort = errorCallback;\n\t\t\t\t} else {\n\t\t\t\t\txhr.onreadystatechange = function() {\n\n\t\t\t\t\t\t// Check readyState before timeout as it changes\n\t\t\t\t\t\tif ( xhr.readyState === 4 ) {\n\n\t\t\t\t\t\t\t// Allow onerror to be called first,\n\t\t\t\t\t\t\t// but that will not handle a native abort\n\t\t\t\t\t\t\t// Also, save errorCallback to a variable\n\t\t\t\t\t\t\t// as xhr.onerror cannot be accessed\n\t\t\t\t\t\t\twindow.setTimeout( function() {\n\t\t\t\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\t\t\t\terrorCallback();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// Create the abort callback\n\t\t\t\tcallback = callback( \"abort\" );\n\n\t\t\t\ttry {\n\n\t\t\t\t\t// Do send the request (this may raise an exception)\n\t\t\t\t\txhr.send( options.hasContent && options.data || null );\n\t\t\t\t} catch ( e ) {\n\n\t\t\t\t\t// #14683: Only rethrow if this hasn't been notified as an error yet\n\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tabort: function() {\n\t\t\t\tif ( callback ) {\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n} );\n\n\n\n\n// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)\njQuery.ajaxPrefilter( function( s ) {\n\tif ( s.crossDomain ) {\n\t\ts.contents.script = false;\n\t}\n} );\n\n// Install script dataType\njQuery.ajaxSetup( {\n\taccepts: {\n\t\tscript: \"text/javascript, application/javascript, \" +\n\t\t\t\"application/ecmascript, application/x-ecmascript\"\n\t},\n\tcontents: {\n\t\tscript: /\\b(?:java|ecma)script\\b/\n\t},\n\tconverters: {\n\t\t\"text script\": function( text ) {\n\t\t\tjQuery.globalEval( text );\n\t\t\treturn text;\n\t\t}\n\t}\n} );\n\n// Handle cache's special case and crossDomain\njQuery.ajaxPrefilter( \"script\", function( s ) {\n\tif ( s.cache === undefined ) {\n\t\ts.cache = false;\n\t}\n\tif ( s.crossDomain ) {\n\t\ts.type = \"GET\";\n\t}\n} );\n\n// Bind script tag hack transport\njQuery.ajaxTransport( \"script\", function( s ) {\n\n\t// This transport only deals with cross domain or forced-by-attrs requests\n\tif ( s.crossDomain || s.scriptAttrs ) {\n\t\tvar script, callback;\n\t\treturn {\n\t\t\tsend: function( _, complete ) {\n\t\t\t\tscript = jQuery( \"<script>\" )\n\t\t\t\t\t.attr( s.scriptAttrs || {} )\n\t\t\t\t\t.prop( { charset: s.scriptCharset, src: s.url } )\n\t\t\t\t\t.on( \"load error\", callback = function( evt ) {\n\t\t\t\t\t\tscript.remove();\n\t\t\t\t\t\tcallback = null;\n\t\t\t\t\t\tif ( evt ) {\n\t\t\t\t\t\t\tcomplete( evt.type === \"error\" ? 404 : 200, evt.type );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\n\t\t\t\t// Use native DOM manipulation to avoid our domManip AJAX trickery\n\t\t\t\tdocument.head.appendChild( script[ 0 ] );\n\t\t\t},\n\t\t\tabort: function() {\n\t\t\t\tif ( callback ) {\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n} );\n\n\n\n\nvar oldCallbacks = [],\n\trjsonp = /(=)\\?(?=&|$)|\\?\\?/;\n\n// Default jsonp settings\njQuery.ajaxSetup( {\n\tjsonp: \"callback\",\n\tjsonpCallback: function() {\n\t\tvar callback = oldCallbacks.pop() || ( jQuery.expando + \"_\" + ( nonce++ ) );\n\t\tthis[ callback ] = true;\n\t\treturn callback;\n\t}\n} );\n\n// Detect, normalize options and install callbacks for jsonp requests\njQuery.ajaxPrefilter( \"json jsonp\", function( s, originalSettings, jqXHR ) {\n\n\tvar callbackName, overwritten, responseContainer,\n\t\tjsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?\n\t\t\t\"url\" :\n\t\t\ttypeof s.data === \"string\" &&\n\t\t\t\t( s.contentType || \"\" )\n\t\t\t\t\t.indexOf( \"application/x-www-form-urlencoded\" ) === 0 &&\n\t\t\t\trjsonp.test( s.data ) && \"data\"\n\t\t);\n\n\t// Handle iff the expected data type is \"jsonp\" or we have a parameter to set\n\tif ( jsonProp || s.dataTypes[ 0 ] === \"jsonp\" ) {\n\n\t\t// Get callback name, remembering preexisting value associated with it\n\t\tcallbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ?\n\t\t\ts.jsonpCallback() :\n\t\t\ts.jsonpCallback;\n\n\t\t// Insert callback into url or form data\n\t\tif ( jsonProp ) {\n\t\t\ts[ jsonProp ] = s[ jsonProp ].replace( rjsonp, \"$1\" + callbackName );\n\t\t} else if ( s.jsonp !== false ) {\n\t\t\ts.url += ( rquery.test( s.url ) ? \"&\" : \"?\" ) + s.jsonp + \"=\" + callbackName;\n\t\t}\n\n\t\t// Use data converter to retrieve json after script execution\n\t\ts.converters[ \"script json\" ] = function() {\n\t\t\tif ( !responseContainer ) {\n\t\t\t\tjQuery.error( callbackName + \" was not called\" );\n\t\t\t}\n\t\t\treturn responseContainer[ 0 ];\n\t\t};\n\n\t\t// Force json dataType\n\t\ts.dataTypes[ 0 ] = \"json\";\n\n\t\t// Install callback\n\t\toverwritten = window[ callbackName ];\n\t\twindow[ callbackName ] = function() {\n\t\t\tresponseContainer = arguments;\n\t\t};\n\n\t\t// Clean-up function (fires after converters)\n\t\tjqXHR.always( function() {\n\n\t\t\t// If previous value didn't exist - remove it\n\t\t\tif ( overwritten === undefined ) {\n\t\t\t\tjQuery( window ).removeProp( callbackName );\n\n\t\t\t// Otherwise restore preexisting value\n\t\t\t} else {\n\t\t\t\twindow[ callbackName ] = overwritten;\n\t\t\t}\n\n\t\t\t// Save back as free\n\t\t\tif ( s[ callbackName ] ) {\n\n\t\t\t\t// Make sure that re-using the options doesn't screw things around\n\t\t\t\ts.jsonpCallback = originalSettings.jsonpCallback;\n\n\t\t\t\t// Save the callback name for future use\n\t\t\t\toldCallbacks.push( callbackName );\n\t\t\t}\n\n\t\t\t// Call if it was a function and we have a response\n\t\t\tif ( responseContainer && isFunction( overwritten ) ) {\n\t\t\t\toverwritten( responseContainer[ 0 ] );\n\t\t\t}\n\n\t\t\tresponseContainer = overwritten = undefined;\n\t\t} );\n\n\t\t// Delegate to script\n\t\treturn \"script\";\n\t}\n} );\n\n\n\n\n// Support: Safari 8 only\n// In Safari 8 documents created via document.implementation.createHTMLDocument\n// collapse sibling forms: the second one becomes a child of the first one.\n// Because of that, this security measure has to be disabled in Safari 8.\n// https://bugs.webkit.org/show_bug.cgi?id=137337\nsupport.createHTMLDocument = ( function() {\n\tvar body = document.implementation.createHTMLDocument( \"\" ).body;\n\tbody.innerHTML = \"<form></form><form></form>\";\n\treturn body.childNodes.length === 2;\n} )();\n\n\n// Argument \"data\" should be string of html\n// context (optional): If specified, the fragment will be created in this context,\n// defaults to document\n// keepScripts (optional): If true, will include scripts passed in the html string\njQuery.parseHTML = function( data, context, keepScripts ) {\n\tif ( typeof data !== \"string\" ) {\n\t\treturn [];\n\t}\n\tif ( typeof context === \"boolean\" ) {\n\t\tkeepScripts = context;\n\t\tcontext = false;\n\t}\n\n\tvar base, parsed, scripts;\n\n\tif ( !context ) {\n\n\t\t// Stop scripts or inline event handlers from being executed immediately\n\t\t// by using document.implementation\n\t\tif ( support.createHTMLDocument ) {\n\t\t\tcontext = document.implementation.createHTMLDocument( \"\" );\n\n\t\t\t// Set the base href for the created document\n\t\t\t// so any parsed elements with URLs\n\t\t\t// are based on the document's URL (gh-2965)\n\t\t\tbase = context.createElement( \"base\" );\n\t\t\tbase.href = document.location.href;\n\t\t\tcontext.head.appendChild( base );\n\t\t} else {\n\t\t\tcontext = document;\n\t\t}\n\t}\n\n\tparsed = rsingleTag.exec( data );\n\tscripts = !keepScripts && [];\n\n\t// Single tag\n\tif ( parsed ) {\n\t\treturn [ context.createElement( parsed[ 1 ] ) ];\n\t}\n\n\tparsed = buildFragment( [ data ], context, scripts );\n\n\tif ( scripts && scripts.length ) {\n\t\tjQuery( scripts ).remove();\n\t}\n\n\treturn jQuery.merge( [], parsed.childNodes );\n};\n\n\n/**\n * Load a url into a page\n */\njQuery.fn.load = function( url, params, callback ) {\n\tvar selector, type, response,\n\t\tself = this,\n\t\toff = url.indexOf( \" \" );\n\n\tif ( off > -1 ) {\n\t\tselector = stripAndCollapse( url.slice( off ) );\n\t\turl = url.slice( 0, off );\n\t}\n\n\t// If it's a function\n\tif ( isFunction( params ) ) {\n\n\t\t// We assume that it's the callback\n\t\tcallback = params;\n\t\tparams = undefined;\n\n\t// Otherwise, build a param string\n\t} else if ( params && typeof params === \"object\" ) {\n\t\ttype = \"POST\";\n\t}\n\n\t// If we have elements to modify, make the request\n\tif ( self.length > 0 ) {\n\t\tjQuery.ajax( {\n\t\t\turl: url,\n\n\t\t\t// If \"type\" variable is undefined, then \"GET\" method will be used.\n\t\t\t// Make value of this field explicit since\n\t\t\t// user can override it through ajaxSetup method\n\t\t\ttype: type || \"GET\",\n\t\t\tdataType: \"html\",\n\t\t\tdata: params\n\t\t} ).done( function( responseText ) {\n\n\t\t\t// Save response for use in complete callback\n\t\t\tresponse = arguments;\n\n\t\t\tself.html( selector ?\n\n\t\t\t\t// If a selector was specified, locate the right elements in a dummy div\n\t\t\t\t// Exclude scripts to avoid IE 'Permission Denied' errors\n\t\t\t\tjQuery( \"<div>\" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :\n\n\t\t\t\t// Otherwise use the full result\n\t\t\t\tresponseText );\n\n\t\t// If the request succeeds, this function gets \"data\", \"status\", \"jqXHR\"\n\t\t// but they are ignored because response was set above.\n\t\t// If it fails, this function gets \"jqXHR\", \"status\", \"error\"\n\t\t} ).always( callback && function( jqXHR, status ) {\n\t\t\tself.each( function() {\n\t\t\t\tcallback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );\n\t\t\t} );\n\t\t} );\n\t}\n\n\treturn this;\n};\n\n\n\n\n// Attach a bunch of functions for handling common AJAX events\njQuery.each( [\n\t\"ajaxStart\",\n\t\"ajaxStop\",\n\t\"ajaxComplete\",\n\t\"ajaxError\",\n\t\"ajaxSuccess\",\n\t\"ajaxSend\"\n], function( i, type ) {\n\tjQuery.fn[ type ] = function( fn ) {\n\t\treturn this.on( type, fn );\n\t};\n} );\n\n\n\n\njQuery.expr.pseudos.animated = function( elem ) {\n\treturn jQuery.grep( jQuery.timers, function( fn ) {\n\t\treturn elem === fn.elem;\n\t} ).length;\n};\n\n\n\n\njQuery.offset = {\n\tsetOffset: function( elem, options, i ) {\n\t\tvar curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,\n\t\t\tposition = jQuery.css( elem, \"position\" ),\n\t\t\tcurElem = jQuery( elem ),\n\t\t\tprops = {};\n\n\t\t// Set position first, in-case top/left are set even on static elem\n\t\tif ( position === \"static\" ) {\n\t\t\telem.style.position = \"relative\";\n\t\t}\n\n\t\tcurOffset = curElem.offset();\n\t\tcurCSSTop = jQuery.css( elem, \"top\" );\n\t\tcurCSSLeft = jQuery.css( elem, \"left\" );\n\t\tcalculatePosition = ( position === \"absolute\" || position === \"fixed\" ) &&\n\t\t\t( curCSSTop + curCSSLeft ).indexOf( \"auto\" ) > -1;\n\n\t\t// Need to be able to calculate position if either\n\t\t// top or left is auto and position is either absolute or fixed\n\t\tif ( calculatePosition ) {\n\t\t\tcurPosition = curElem.position();\n\t\t\tcurTop = curPosition.top;\n\t\t\tcurLeft = curPosition.left;\n\n\t\t} else {\n\t\t\tcurTop = parseFloat( curCSSTop ) || 0;\n\t\t\tcurLeft = parseFloat( curCSSLeft ) || 0;\n\t\t}\n\n\t\tif ( isFunction( options ) ) {\n\n\t\t\t// Use jQuery.extend here to allow modification of coordinates argument (gh-1848)\n\t\t\toptions = options.call( elem, i, jQuery.extend( {}, curOffset ) );\n\t\t}\n\n\t\tif ( options.top != null ) {\n\t\t\tprops.top = ( options.top - curOffset.top ) + curTop;\n\t\t}\n\t\tif ( options.left != null ) {\n\t\t\tprops.left = ( options.left - curOffset.left ) + curLeft;\n\t\t}\n\n\t\tif ( \"using\" in options ) {\n\t\t\toptions.using.call( elem, props );\n\n\t\t} else {\n\t\t\tcurElem.css( props );\n\t\t}\n\t}\n};\n\njQuery.fn.extend( {\n\n\t// offset() relates an element's border box to the document origin\n\toffset: function( options ) {\n\n\t\t// Preserve chaining for setter\n\t\tif ( arguments.length ) {\n\t\t\treturn options === undefined ?\n\t\t\t\tthis :\n\t\t\t\tthis.each( function( i ) {\n\t\t\t\t\tjQuery.offset.setOffset( this, options, i );\n\t\t\t\t} );\n\t\t}\n\n\t\tvar rect, win,\n\t\t\telem = this[ 0 ];\n\n\t\tif ( !elem ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Return zeros for disconnected and hidden (display: none) elements (gh-2310)\n\t\t// Support: IE <=11 only\n\t\t// Running getBoundingClientRect on a\n\t\t// disconnected node in IE throws an error\n\t\tif ( !elem.getClientRects().length ) {\n\t\t\treturn { top: 0, left: 0 };\n\t\t}\n\n\t\t// Get document-relative position by adding viewport scroll to viewport-relative gBCR\n\t\trect = elem.getBoundingClientRect();\n\t\twin = elem.ownerDocument.defaultView;\n\t\treturn {\n\t\t\ttop: rect.top + win.pageYOffset,\n\t\t\tleft: rect.left + win.pageXOffset\n\t\t};\n\t},\n\n\t// position() relates an element's margin box to its offset parent's padding box\n\t// This corresponds to the behavior of CSS absolute positioning\n\tposition: function() {\n\t\tif ( !this[ 0 ] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar offsetParent, offset, doc,\n\t\t\telem = this[ 0 ],\n\t\t\tparentOffset = { top: 0, left: 0 };\n\n\t\t// position:fixed elements are offset from the viewport, which itself always has zero offset\n\t\tif ( jQuery.css( elem, \"position\" ) === \"fixed\" ) {\n\n\t\t\t// Assume position:fixed implies availability of getBoundingClientRect\n\t\t\toffset = elem.getBoundingClientRect();\n\n\t\t} else {\n\t\t\toffset = this.offset();\n\n\t\t\t// Account for the *real* offset parent, which can be the document or its root element\n\t\t\t// when a statically positioned element is identified\n\t\t\tdoc = elem.ownerDocument;\n\t\t\toffsetParent = elem.offsetParent || doc.documentElement;\n\t\t\twhile ( offsetParent &&\n\t\t\t\t( offsetParent === doc.body || offsetParent === doc.documentElement ) &&\n\t\t\t\tjQuery.css( offsetParent, \"position\" ) === \"static\" ) {\n\n\t\t\t\toffsetParent = offsetParent.parentNode;\n\t\t\t}\n\t\t\tif ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) {\n\n\t\t\t\t// Incorporate borders into its offset, since they are outside its content origin\n\t\t\t\tparentOffset = jQuery( offsetParent ).offset();\n\t\t\t\tparentOffset.top += jQuery.css( offsetParent, \"borderTopWidth\", true );\n\t\t\t\tparentOffset.left += jQuery.css( offsetParent, \"borderLeftWidth\", true );\n\t\t\t}\n\t\t}\n\n\t\t// Subtract parent offsets and element margins\n\t\treturn {\n\t\t\ttop: offset.top - parentOffset.top - jQuery.css( elem, \"marginTop\", true ),\n\t\t\tleft: offset.left - parentOffset.left - jQuery.css( elem, \"marginLeft\", true )\n\t\t};\n\t},\n\n\t// This method will return documentElement in the following cases:\n\t// 1) For the element inside the iframe without offsetParent, this method will return\n\t//    documentElement of the parent window\n\t// 2) For the hidden or detached element\n\t// 3) For body or html element, i.e. in case of the html node - it will return itself\n\t//\n\t// but those exceptions were never presented as a real life use-cases\n\t// and might be considered as more preferable results.\n\t//\n\t// This logic, however, is not guaranteed and can change at any point in the future\n\toffsetParent: function() {\n\t\treturn this.map( function() {\n\t\t\tvar offsetParent = this.offsetParent;\n\n\t\t\twhile ( offsetParent && jQuery.css( offsetParent, \"position\" ) === \"static\" ) {\n\t\t\t\toffsetParent = offsetParent.offsetParent;\n\t\t\t}\n\n\t\t\treturn offsetParent || documentElement;\n\t\t} );\n\t}\n} );\n\n// Create scrollLeft and scrollTop methods\njQuery.each( { scrollLeft: \"pageXOffset\", scrollTop: \"pageYOffset\" }, function( method, prop ) {\n\tvar top = \"pageYOffset\" === prop;\n\n\tjQuery.fn[ method ] = function( val ) {\n\t\treturn access( this, function( elem, method, val ) {\n\n\t\t\t// Coalesce documents and windows\n\t\t\tvar win;\n\t\t\tif ( isWindow( elem ) ) {\n\t\t\t\twin = elem;\n\t\t\t} else if ( elem.nodeType === 9 ) {\n\t\t\t\twin = elem.defaultView;\n\t\t\t}\n\n\t\t\tif ( val === undefined ) {\n\t\t\t\treturn win ? win[ prop ] : elem[ method ];\n\t\t\t}\n\n\t\t\tif ( win ) {\n\t\t\t\twin.scrollTo(\n\t\t\t\t\t!top ? val : win.pageXOffset,\n\t\t\t\t\ttop ? val : win.pageYOffset\n\t\t\t\t);\n\n\t\t\t} else {\n\t\t\t\telem[ method ] = val;\n\t\t\t}\n\t\t}, method, val, arguments.length );\n\t};\n} );\n\n// Support: Safari <=7 - 9.1, Chrome <=37 - 49\n// Add the top/left cssHooks using jQuery.fn.position\n// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084\n// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347\n// getComputedStyle returns percent when specified for top/left/bottom/right;\n// rather than make the css module depend on the offset module, just check for it here\njQuery.each( [ \"top\", \"left\" ], function( i, prop ) {\n\tjQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,\n\t\tfunction( elem, computed ) {\n\t\t\tif ( computed ) {\n\t\t\t\tcomputed = curCSS( elem, prop );\n\n\t\t\t\t// If curCSS returns percentage, fallback to offset\n\t\t\t\treturn rnumnonpx.test( computed ) ?\n\t\t\t\t\tjQuery( elem ).position()[ prop ] + \"px\" :\n\t\t\t\t\tcomputed;\n\t\t\t}\n\t\t}\n\t);\n} );\n\n\n// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods\njQuery.each( { Height: \"height\", Width: \"width\" }, function( name, type ) {\n\tjQuery.each( { padding: \"inner\" + name, content: type, \"\": \"outer\" + name },\n\t\tfunction( defaultExtra, funcName ) {\n\n\t\t// Margin is only for outerHeight, outerWidth\n\t\tjQuery.fn[ funcName ] = function( margin, value ) {\n\t\t\tvar chainable = arguments.length && ( defaultExtra || typeof margin !== \"boolean\" ),\n\t\t\t\textra = defaultExtra || ( margin === true || value === true ? \"margin\" : \"border\" );\n\n\t\t\treturn access( this, function( elem, type, value ) {\n\t\t\t\tvar doc;\n\n\t\t\t\tif ( isWindow( elem ) ) {\n\n\t\t\t\t\t// $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)\n\t\t\t\t\treturn funcName.indexOf( \"outer\" ) === 0 ?\n\t\t\t\t\t\telem[ \"inner\" + name ] :\n\t\t\t\t\t\telem.document.documentElement[ \"client\" + name ];\n\t\t\t\t}\n\n\t\t\t\t// Get document width or height\n\t\t\t\tif ( elem.nodeType === 9 ) {\n\t\t\t\t\tdoc = elem.documentElement;\n\n\t\t\t\t\t// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],\n\t\t\t\t\t// whichever is greatest\n\t\t\t\t\treturn Math.max(\n\t\t\t\t\t\telem.body[ \"scroll\" + name ], doc[ \"scroll\" + name ],\n\t\t\t\t\t\telem.body[ \"offset\" + name ], doc[ \"offset\" + name ],\n\t\t\t\t\t\tdoc[ \"client\" + name ]\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn value === undefined ?\n\n\t\t\t\t\t// Get width or height on the element, requesting but not forcing parseFloat\n\t\t\t\t\tjQuery.css( elem, type, extra ) :\n\n\t\t\t\t\t// Set width or height on the element\n\t\t\t\t\tjQuery.style( elem, type, value, extra );\n\t\t\t}, type, chainable ? margin : undefined, chainable );\n\t\t};\n\t} );\n} );\n\n\njQuery.each( ( \"blur focus focusin focusout resize scroll click dblclick \" +\n\t\"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave \" +\n\t\"change select submit keydown keypress keyup contextmenu\" ).split( \" \" ),\n\tfunction( i, name ) {\n\n\t// Handle event binding\n\tjQuery.fn[ name ] = function( data, fn ) {\n\t\treturn arguments.length > 0 ?\n\t\t\tthis.on( name, null, data, fn ) :\n\t\t\tthis.trigger( name );\n\t};\n} );\n\njQuery.fn.extend( {\n\thover: function( fnOver, fnOut ) {\n\t\treturn this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );\n\t}\n} );\n\n\n\n\njQuery.fn.extend( {\n\n\tbind: function( types, data, fn ) {\n\t\treturn this.on( types, null, data, fn );\n\t},\n\tunbind: function( types, fn ) {\n\t\treturn this.off( types, null, fn );\n\t},\n\n\tdelegate: function( selector, types, data, fn ) {\n\t\treturn this.on( types, selector, data, fn );\n\t},\n\tundelegate: function( selector, types, fn ) {\n\n\t\t// ( namespace ) or ( selector, types [, fn] )\n\t\treturn arguments.length === 1 ?\n\t\t\tthis.off( selector, \"**\" ) :\n\t\t\tthis.off( types, selector || \"**\", fn );\n\t}\n} );\n\n// Bind a function to a context, optionally partially applying any\n// arguments.\n// jQuery.proxy is deprecated to promote standards (specifically Function#bind)\n// However, it is not slated for removal any time soon\njQuery.proxy = function( fn, context ) {\n\tvar tmp, args, proxy;\n\n\tif ( typeof context === \"string\" ) {\n\t\ttmp = fn[ context ];\n\t\tcontext = fn;\n\t\tfn = tmp;\n\t}\n\n\t// Quick check to determine if target is callable, in the spec\n\t// this throws a TypeError, but we will just return undefined.\n\tif ( !isFunction( fn ) ) {\n\t\treturn undefined;\n\t}\n\n\t// Simulated bind\n\targs = slice.call( arguments, 2 );\n\tproxy = function() {\n\t\treturn fn.apply( context || this, args.concat( slice.call( arguments ) ) );\n\t};\n\n\t// Set the guid of unique handler to the same of original handler, so it can be removed\n\tproxy.guid = fn.guid = fn.guid || jQuery.guid++;\n\n\treturn proxy;\n};\n\njQuery.holdReady = function( hold ) {\n\tif ( hold ) {\n\t\tjQuery.readyWait++;\n\t} else {\n\t\tjQuery.ready( true );\n\t}\n};\njQuery.isArray = Array.isArray;\njQuery.parseJSON = JSON.parse;\njQuery.nodeName = nodeName;\njQuery.isFunction = isFunction;\njQuery.isWindow = isWindow;\njQuery.camelCase = camelCase;\njQuery.type = toType;\n\njQuery.now = Date.now;\n\njQuery.isNumeric = function( obj ) {\n\n\t// As of jQuery 3.0, isNumeric is limited to\n\t// strings and numbers (primitives or objects)\n\t// that can be coerced to finite numbers (gh-2662)\n\tvar type = jQuery.type( obj );\n\treturn ( type === \"number\" || type === \"string\" ) &&\n\n\t\t// parseFloat NaNs numeric-cast false positives (\"\")\n\t\t// ...but misinterprets leading-number strings, particularly hex literals (\"0x...\")\n\t\t// subtraction forces infinities to NaN\n\t\t!isNaN( obj - parseFloat( obj ) );\n};\n\n\n\n\n// Register as a named AMD module, since jQuery can be concatenated with other\n// files that may use define, but not via a proper concatenation script that\n// understands anonymous AMD modules. A named AMD is safest and most robust\n// way to register. Lowercase jquery is used because AMD module names are\n// derived from file names, and jQuery is normally delivered in a lowercase\n// file name. Do this after creating the global so that if an AMD module wants\n// to call noConflict to hide this version of jQuery, it will work.\n\n// Note that for maximum portability, libraries that are not jQuery should\n// declare themselves as anonymous modules, and avoid setting a global if an\n// AMD loader is present. jQuery is a special case. For more information, see\n// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon\n\nif ( typeof define === \"function\" && define.amd ) {\n\tdefine( \"jquery\", [], function() {\n\t\treturn jQuery;\n\t} );\n}\n\n\n\n\nvar\n\n\t// Map over jQuery in case of overwrite\n\t_jQuery = window.jQuery,\n\n\t// Map over the $ in case of overwrite\n\t_$ = window.$;\n\njQuery.noConflict = function( deep ) {\n\tif ( window.$ === jQuery ) {\n\t\twindow.$ = _$;\n\t}\n\n\tif ( deep && window.jQuery === jQuery ) {\n\t\twindow.jQuery = _jQuery;\n\t}\n\n\treturn jQuery;\n};\n\n// Expose jQuery and $ identifiers, even in AMD\n// (#7102#comment:10, https://github.com/jquery/jquery/pull/557)\n// and CommonJS for browser emulators (#13566)\nif ( !noGlobal ) {\n\twindow.jQuery = window.$ = jQuery;\n}\n\n\n\n\nreturn jQuery;\n} );\n","/*!\n * @overview  Ember - JavaScript Application Framework\n * @copyright Copyright 2011-2019 Tilde Inc. and contributors\n *            Portions Copyright 2006-2011 Strobe Inc.\n *            Portions Copyright 2008-2011 Apple Inc. All rights reserved.\n * @license   Licensed under MIT license\n *            See https://raw.github.com/emberjs/ember.js/master/LICENSE\n * @version   3.15.0\n */","/*globals process */\nvar define, require, Ember; // Used in @ember/-internals/environment/lib/global.js\n\n\nmainContext = this; // eslint-disable-line no-undef\n\n(function () {\n  var registry;\n  var seen;\n\n  function missingModule(name, referrerName) {\n    if (referrerName) {\n      throw new Error('Could not find module ' + name + ' required by: ' + referrerName);\n    } else {\n      throw new Error('Could not find module ' + name);\n    }\n  }\n\n  function internalRequire(_name, referrerName) {\n    var name = _name;\n    var mod = registry[name];\n\n    if (!mod) {\n      name = name + '/index';\n      mod = registry[name];\n    }\n\n    var exports = seen[name];\n\n    if (exports !== undefined) {\n      return exports;\n    }\n\n    exports = seen[name] = {};\n\n    if (!mod) {\n      missingModule(_name, referrerName);\n    }\n\n    var deps = mod.deps;\n    var callback = mod.callback;\n    var reified = new Array(deps.length);\n\n    for (var i = 0; i < deps.length; i++) {\n      if (deps[i] === 'exports') {\n        reified[i] = exports;\n      } else if (deps[i] === 'require') {\n        reified[i] = require;\n      } else {\n        reified[i] = internalRequire(deps[i], name);\n      }\n    }\n\n    callback.apply(this, reified);\n    return exports;\n  }\n\n  var isNode = typeof window === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';\n\n  if (!isNode) {\n    Ember = this.Ember = this.Ember || {};\n  }\n\n  if (typeof Ember === 'undefined') {\n    Ember = {};\n  }\n\n  if (typeof Ember.__loader === 'undefined') {\n    registry = Object.create(null);\n    seen = Object.create(null);\n\n    define = function (name, deps, callback) {\n      var value = {};\n\n      if (!callback) {\n        value.deps = [];\n        value.callback = deps;\n      } else {\n        value.deps = deps;\n        value.callback = callback;\n      }\n\n      registry[name] = value;\n    };\n\n    require = function (name) {\n      return internalRequire(name, null);\n    }; // setup `require` module\n\n\n    require['default'] = require;\n\n    require.has = function registryHas(moduleName) {\n      return Boolean(registry[moduleName]) || Boolean(registry[moduleName + '/index']);\n    };\n\n    require._eak_seen = registry;\n    Ember.__loader = {\n      define: define,\n      require: require,\n      registry: registry\n    };\n  } else {\n    define = Ember.__loader.define;\n    require = Ember.__loader.require;\n  }\n})();","define(\"@ember/-internals/browser-environment/index\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.hasDOM = _exports.isFirefox = _exports.isChrome = _exports.userAgent = _exports.history = _exports.location = _exports.window = void 0;\n  // check if window exists and actually is the global\n  var hasDom = typeof self === 'object' && self !== null && self.Object === Object && typeof Window !== 'undefined' && self.constructor === Window && typeof document === 'object' && document !== null && self.document === document && typeof location === 'object' && location !== null && self.location === location && typeof history === 'object' && history !== null && self.history === history && typeof navigator === 'object' && navigator !== null && self.navigator === navigator && typeof navigator.userAgent === 'string';\n  _exports.hasDOM = hasDom;\n  var window = hasDom ? self : null;\n  _exports.window = window;\n  var location$1 = hasDom ? self.location : null;\n  _exports.location = location$1;\n  var history$1 = hasDom ? self.history : null;\n  _exports.history = history$1;\n  var userAgent = hasDom ? self.navigator.userAgent : 'Lynx (textmode)';\n  _exports.userAgent = userAgent;\n  var isChrome = hasDom ? Boolean(window.chrome) && !window.opera : false;\n  _exports.isChrome = isChrome;\n  var isFirefox = hasDom ? typeof InstallTrigger !== 'undefined' : false;\n  _exports.isFirefox = isFirefox;\n});","define(\"@ember/-internals/console/index\", [\"exports\", \"@ember/debug\", \"@ember/deprecated-features\"], function (_exports, _debug, _deprecatedFeatures) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  // Deliver message that the function is deprecated\n  var DEPRECATION_MESSAGE = 'Use of Ember.Logger is deprecated. Please use `console` for logging.';\n  var DEPRECATION_ID = 'ember-console.deprecate-logger';\n  var DEPRECATION_URL = 'https://emberjs.com/deprecations/v3.x#toc_use-console-rather-than-ember-logger';\n  /**\n     @module ember\n  */\n\n  /**\n    Inside Ember-Metal, simply uses the methods from `imports.console`.\n    Override this to provide more robust logging functionality.\n  \n    @class Logger\n    @deprecated Use 'console' instead\n  \n    @namespace Ember\n    @public\n  */\n\n  var DEPRECATED_LOGGER;\n\n  if (_deprecatedFeatures.LOGGER) {\n    DEPRECATED_LOGGER = {\n      /**\n      Logs the arguments to the console.\n      You can pass as many arguments as you want and they will be joined together with a space.\n       ```javascript\n      var foo = 1;\n      Ember.Logger.log('log value of foo:', foo);\n      // \"log value of foo: 1\" will be printed to the console\n      ```\n      @method log\n      @for Ember.Logger\n      @param {*} arguments\n      @public\n      */\n      log() {\n        (true && !(false) && (0, _debug.deprecate)(DEPRECATION_MESSAGE, false, {\n          id: DEPRECATION_ID,\n          until: '4.0.0',\n          url: DEPRECATION_URL\n        }));\n        return console.log(...arguments); // eslint-disable-line no-console\n      },\n\n      /**\n      Prints the arguments to the console with a warning icon.\n      You can pass as many arguments as you want and they will be joined together with a space.\n       ```javascript\n      Ember.Logger.warn('Something happened!');\n      // \"Something happened!\" will be printed to the console with a warning icon.\n      ```\n      @method warn\n      @for Ember.Logger\n      @param {*} arguments\n      @public\n      */\n      warn() {\n        (true && !(false) && (0, _debug.deprecate)(DEPRECATION_MESSAGE, false, {\n          id: DEPRECATION_ID,\n          until: '4.0.0',\n          url: DEPRECATION_URL\n        }));\n        return console.warn(...arguments); // eslint-disable-line no-console\n      },\n\n      /**\n      Prints the arguments to the console with an error icon, red text and a stack trace.\n      You can pass as many arguments as you want and they will be joined together with a space.\n       ```javascript\n      Ember.Logger.error('Danger! Danger!');\n      // \"Danger! Danger!\" will be printed to the console in red text.\n      ```\n      @method error\n      @for Ember.Logger\n      @param {*} arguments\n      @public\n      */\n      error() {\n        (true && !(false) && (0, _debug.deprecate)(DEPRECATION_MESSAGE, false, {\n          id: DEPRECATION_ID,\n          until: '4.0.0',\n          url: DEPRECATION_URL\n        }));\n        return console.error(...arguments); // eslint-disable-line no-console\n      },\n\n      /**\n      Logs the arguments to the console.\n      You can pass as many arguments as you want and they will be joined together with a space.\n       ```javascript\n      var foo = 1;\n      Ember.Logger.info('log value of foo:', foo);\n      // \"log value of foo: 1\" will be printed to the console\n      ```\n      @method info\n      @for Ember.Logger\n      @param {*} arguments\n      @public\n      */\n      info() {\n        (true && !(false) && (0, _debug.deprecate)(DEPRECATION_MESSAGE, false, {\n          id: DEPRECATION_ID,\n          until: '4.0.0',\n          url: DEPRECATION_URL\n        }));\n        return console.info(...arguments); // eslint-disable-line no-console\n      },\n\n      /**\n      Logs the arguments to the console in blue text.\n      You can pass as many arguments as you want and they will be joined together with a space.\n       ```javascript\n      var foo = 1;\n      Ember.Logger.debug('log value of foo:', foo);\n      // \"log value of foo: 1\" will be printed to the console\n      ```\n      @method debug\n      @for Ember.Logger\n      @param {*} arguments\n      @public\n      */\n      debug() {\n        (true && !(false) && (0, _debug.deprecate)(DEPRECATION_MESSAGE, false, {\n          id: DEPRECATION_ID,\n          until: '4.0.0',\n          url: DEPRECATION_URL\n        }));\n        /* eslint-disable no-console */\n\n        if (console.debug) {\n          return console.debug(...arguments);\n        }\n\n        return console.info(...arguments);\n        /* eslint-enable no-console */\n      },\n\n      /**\n      If the value passed into `Ember.Logger.assert` is not truthy it will throw an error with a stack trace.\n       ```javascript\n      Ember.Logger.assert(true); // undefined\n      Ember.Logger.assert(true === false); // Throws an Assertion failed error.\n      Ember.Logger.assert(true === false, 'Something invalid'); // Throws an Assertion failed error with message.\n      ```\n      @method assert\n      @for Ember.Logger\n      @param {Boolean} bool Value to test\n      @param {String} message Assertion message on failed\n      @public\n      */\n      assert() {\n        (true && !(false) && (0, _debug.deprecate)(DEPRECATION_MESSAGE, false, {\n          id: DEPRECATION_ID,\n          until: '4.0.0',\n          url: DEPRECATION_URL\n        }));\n        return console.assert(...arguments); // eslint-disable-line no-console\n      }\n\n    };\n  }\n\n  var _default = DEPRECATED_LOGGER;\n  _exports.default = _default;\n});","define(\"@ember/-internals/container/index\", [\"exports\", \"@ember/-internals/owner\", \"@ember/-internals/utils\", \"@ember/debug\", \"@ember/polyfills\"], function (_exports, _owner, _utils, _debug, _polyfills) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.privatize = privatize;\n  _exports.FACTORY_FOR = _exports.Container = _exports.Registry = void 0;\n  var leakTracking;\n  var containers;\n\n  if (true\n  /* DEBUG */\n  ) {\n    // requires v8\n    // chrome --js-flags=\"--allow-natives-syntax --expose-gc\"\n    // node --allow-natives-syntax --expose-gc\n    try {\n      if (typeof gc === 'function') {\n        leakTracking = (() => {\n          // avoid syntax errors when --allow-natives-syntax not present\n          var GetWeakSetValues = new Function('weakSet', 'return %GetWeakSetValues(weakSet, 0)');\n          containers = new WeakSet();\n          return {\n            hasContainers() {\n              gc();\n              return GetWeakSetValues(containers).length > 0;\n            },\n\n            reset() {\n              var values = GetWeakSetValues(containers);\n\n              for (var i = 0; i < values.length; i++) {\n                containers.delete(values[i]);\n              }\n            }\n\n          };\n        })();\n      }\n    } catch (e) {// ignore\n    }\n  }\n  /**\n   A container used to instantiate and cache objects.\n  \n   Every `Container` must be associated with a `Registry`, which is referenced\n   to determine the factory and options that should be used to instantiate\n   objects.\n  \n   The public API for `Container` is still in flux and should not be considered\n   stable.\n  \n   @private\n   @class Container\n   */\n\n\n  class Container {\n    constructor(registry, options = {}) {\n      this.registry = registry;\n      this.owner = options.owner || null;\n      this.cache = (0, _utils.dictionary)(options.cache || null);\n      this.factoryManagerCache = (0, _utils.dictionary)(options.factoryManagerCache || null);\n      this.isDestroyed = false;\n      this.isDestroying = false;\n\n      if (true\n      /* DEBUG */\n      ) {\n        this.validationCache = (0, _utils.dictionary)(options.validationCache || null);\n\n        if (containers !== undefined) {\n          containers.add(this);\n        }\n      }\n    }\n    /**\n     @private\n     @property registry\n     @type Registry\n     @since 1.11.0\n     */\n\n    /**\n     @private\n     @property cache\n     @type InheritingDict\n     */\n\n    /**\n     @private\n     @property validationCache\n     @type InheritingDict\n     */\n\n    /**\n     Given a fullName return a corresponding instance.\n      The default behavior is for lookup to return a singleton instance.\n     The singleton is scoped to the container, allowing multiple containers\n     to all have their own locally scoped singletons.\n      ```javascript\n     let registry = new Registry();\n     let container = registry.container();\n      registry.register('api:twitter', Twitter);\n      let twitter = container.lookup('api:twitter');\n      twitter instanceof Twitter; // => true\n      // by default the container will return singletons\n     let twitter2 = container.lookup('api:twitter');\n     twitter2 instanceof Twitter; // => true\n      twitter === twitter2; //=> true\n     ```\n      If singletons are not wanted, an optional flag can be provided at lookup.\n      ```javascript\n     let registry = new Registry();\n     let container = registry.container();\n      registry.register('api:twitter', Twitter);\n      let twitter = container.lookup('api:twitter', { singleton: false });\n     let twitter2 = container.lookup('api:twitter', { singleton: false });\n      twitter === twitter2; //=> false\n     ```\n      @private\n     @method lookup\n     @param {String} fullName\n     @param {Object} [options]\n     @param {String} [options.source] The fullname of the request source (used for local lookup)\n     @return {any}\n     */\n\n\n    lookup(fullName, options) {\n      (true && !(!this.isDestroyed) && (0, _debug.assert)('expected container not to be destroyed', !this.isDestroyed));\n      (true && !(this.registry.isValidFullName(fullName)) && (0, _debug.assert)('fullName must be a proper full name', this.registry.isValidFullName(fullName)));\n      return lookup(this, this.registry.normalize(fullName), options);\n    }\n    /**\n     A depth first traversal, destroying the container, its descendant containers and all\n     their managed objects.\n      @private\n     @method destroy\n     */\n\n\n    destroy() {\n      destroyDestroyables(this);\n      this.isDestroying = true;\n    }\n\n    finalizeDestroy() {\n      resetCache(this);\n      this.isDestroyed = true;\n    }\n    /**\n     Clear either the entire cache or just the cache for a particular key.\n        @private\n     @method reset\n     @param {String} fullName optional key to reset; if missing, resets everything\n    */\n\n\n    reset(fullName) {\n      if (this.isDestroyed) return;\n\n      if (fullName === undefined) {\n        destroyDestroyables(this);\n        resetCache(this);\n      } else {\n        resetMember(this, this.registry.normalize(fullName));\n      }\n    }\n    /**\n     Returns an object that can be used to provide an owner to a\n     manually created instance.\n      @private\n     @method ownerInjection\n     @returns { Object }\n    */\n\n\n    ownerInjection() {\n      return {\n        [_owner.OWNER]: this.owner\n      };\n    }\n    /**\n     Given a fullName, return the corresponding factory. The consumer of the factory\n     is responsible for the destruction of any factory instances, as there is no\n     way for the container to ensure instances are destroyed when it itself is\n     destroyed.\n      @public\n     @method factoryFor\n     @param {String} fullName\n     @param {Object} [options]\n     @param {String} [options.source] The fullname of the request source (used for local lookup)\n     @return {any}\n     */\n\n\n    factoryFor(fullName, options = {}) {\n      (true && !(!this.isDestroyed) && (0, _debug.assert)('expected container not to be destroyed', !this.isDestroyed));\n      var normalizedName = this.registry.normalize(fullName);\n      (true && !(this.registry.isValidFullName(normalizedName)) && (0, _debug.assert)('fullName must be a proper full name', this.registry.isValidFullName(normalizedName)));\n      (true && !(false\n      /* EMBER_MODULE_UNIFICATION */\n      || !options.namespace) && (0, _debug.assert)('EMBER_MODULE_UNIFICATION must be enabled to pass a namespace option to factoryFor', false || !options.namespace));\n\n      if (options.source || options.namespace) {\n        normalizedName = this.registry.expandLocalLookup(fullName, options);\n\n        if (!normalizedName) {\n          return;\n        }\n      }\n\n      return factoryFor(this, normalizedName, fullName);\n    }\n\n  }\n\n  _exports.Container = Container;\n\n  if (true\n  /* DEBUG */\n  ) {\n    Container._leakTracking = leakTracking;\n  }\n  /*\n   * Wrap a factory manager in a proxy which will not permit properties to be\n   * set on the manager.\n   */\n\n\n  function wrapManagerInDeprecationProxy(manager) {\n    if (_utils.HAS_NATIVE_PROXY) {\n      var validator = {\n        set(_obj, prop) {\n          throw new Error(\"You attempted to set \\\"\" + prop + \"\\\" on a factory manager created by container#factoryFor. A factory manager is a read-only construct.\");\n        }\n\n      }; // Note:\n      // We have to proxy access to the manager here so that private property\n      // access doesn't cause the above errors to occur.\n\n      var m = manager;\n      var proxiedManager = {\n        class: m.class,\n\n        create(props) {\n          return m.create(props);\n        }\n\n      };\n      var proxy = new Proxy(proxiedManager, validator);\n      FACTORY_FOR.set(proxy, manager);\n    }\n\n    return manager;\n  }\n\n  function isSingleton(container, fullName) {\n    return container.registry.getOption(fullName, 'singleton') !== false;\n  }\n\n  function isInstantiatable(container, fullName) {\n    return container.registry.getOption(fullName, 'instantiate') !== false;\n  }\n\n  function lookup(container, fullName, options = {}) {\n    (true && !(false\n    /* EMBER_MODULE_UNIFICATION */\n    || !options.namespace) && (0, _debug.assert)('EMBER_MODULE_UNIFICATION must be enabled to pass a namespace option to lookup', false || !options.namespace));\n    var normalizedName = fullName;\n\n    if (options.source || options.namespace) {\n      normalizedName = container.registry.expandLocalLookup(fullName, options);\n\n      if (!normalizedName) {\n        return;\n      }\n    }\n\n    if (options.singleton !== false) {\n      var cached = container.cache[normalizedName];\n\n      if (cached !== undefined) {\n        return cached;\n      }\n    }\n\n    return instantiateFactory(container, normalizedName, fullName, options);\n  }\n\n  function factoryFor(container, normalizedName, fullName) {\n    var cached = container.factoryManagerCache[normalizedName];\n\n    if (cached !== undefined) {\n      return cached;\n    }\n\n    var factory = container.registry.resolve(normalizedName);\n\n    if (factory === undefined) {\n      return;\n    }\n\n    if (true\n    /* DEBUG */\n    && factory && typeof factory._onLookup === 'function') {\n      factory._onLookup(fullName);\n    }\n\n    var manager = new FactoryManager(container, factory, fullName, normalizedName);\n\n    if (true\n    /* DEBUG */\n    ) {\n      manager = wrapManagerInDeprecationProxy(manager);\n    }\n\n    container.factoryManagerCache[normalizedName] = manager;\n    return manager;\n  }\n\n  function isSingletonClass(container, fullName, {\n    instantiate,\n    singleton\n  }) {\n    return singleton !== false && !instantiate && isSingleton(container, fullName) && !isInstantiatable(container, fullName);\n  }\n\n  function isSingletonInstance(container, fullName, {\n    instantiate,\n    singleton\n  }) {\n    return singleton !== false && instantiate !== false && isSingleton(container, fullName) && isInstantiatable(container, fullName);\n  }\n\n  function isFactoryClass(container, fullname, {\n    instantiate,\n    singleton\n  }) {\n    return instantiate === false && (singleton === false || !isSingleton(container, fullname)) && !isInstantiatable(container, fullname);\n  }\n\n  function isFactoryInstance(container, fullName, {\n    instantiate,\n    singleton\n  }) {\n    return instantiate !== false && (singleton !== false || isSingleton(container, fullName)) && isInstantiatable(container, fullName);\n  }\n\n  function instantiateFactory(container, normalizedName, fullName, options) {\n    var factoryManager = factoryFor(container, normalizedName, fullName);\n\n    if (factoryManager === undefined) {\n      return;\n    } // SomeClass { singleton: true, instantiate: true } | { singleton: true } | { instantiate: true } | {}\n    // By default majority of objects fall into this case\n\n\n    if (isSingletonInstance(container, fullName, options)) {\n      return container.cache[normalizedName] = factoryManager.create();\n    } // SomeClass { singleton: false, instantiate: true }\n\n\n    if (isFactoryInstance(container, fullName, options)) {\n      return factoryManager.create();\n    } // SomeClass { singleton: true, instantiate: false } | { instantiate: false } | { singleton: false, instantiation: false }\n\n\n    if (isSingletonClass(container, fullName, options) || isFactoryClass(container, fullName, options)) {\n      return factoryManager.class;\n    }\n\n    throw new Error('Could not create factory');\n  }\n\n  function processInjections(container, injections, result) {\n    if (true\n    /* DEBUG */\n    ) {\n      container.registry.validateInjections(injections);\n    }\n\n    var hash = result.injections;\n\n    if (hash === undefined) {\n      hash = result.injections = {};\n    }\n\n    for (var i = 0; i < injections.length; i++) {\n      var {\n        property,\n        specifier,\n        source\n      } = injections[i];\n\n      if (source) {\n        hash[property] = lookup(container, specifier, {\n          source\n        });\n      } else {\n        hash[property] = lookup(container, specifier);\n      }\n\n      if (!result.isDynamic) {\n        result.isDynamic = !isSingleton(container, specifier);\n      }\n    }\n  }\n\n  function buildInjections(container, typeInjections, injections) {\n    var result = {\n      injections: undefined,\n      isDynamic: false\n    };\n\n    if (typeInjections !== undefined) {\n      processInjections(container, typeInjections, result);\n    }\n\n    if (injections !== undefined) {\n      processInjections(container, injections, result);\n    }\n\n    return result;\n  }\n\n  function injectionsFor(container, fullName) {\n    var registry = container.registry;\n    var [type] = fullName.split(':');\n    var typeInjections = registry.getTypeInjections(type);\n    var injections = registry.getInjections(fullName);\n    return buildInjections(container, typeInjections, injections);\n  }\n\n  function destroyDestroyables(container) {\n    var cache = container.cache;\n    var keys = Object.keys(cache);\n\n    for (var i = 0; i < keys.length; i++) {\n      var key = keys[i];\n      var value = cache[key];\n\n      if (value.destroy) {\n        value.destroy();\n      }\n    }\n  }\n\n  function resetCache(container) {\n    container.cache = (0, _utils.dictionary)(null);\n    container.factoryManagerCache = (0, _utils.dictionary)(null);\n  }\n\n  function resetMember(container, fullName) {\n    var member = container.cache[fullName];\n    delete container.factoryManagerCache[fullName];\n\n    if (member) {\n      delete container.cache[fullName];\n\n      if (member.destroy) {\n        member.destroy();\n      }\n    }\n  }\n\n  var FACTORY_FOR = new WeakMap();\n  _exports.FACTORY_FOR = FACTORY_FOR;\n\n  class FactoryManager {\n    constructor(container, factory, fullName, normalizedName) {\n      this.container = container;\n      this.owner = container.owner;\n      this.class = factory;\n      this.fullName = fullName;\n      this.normalizedName = normalizedName;\n      this.madeToString = undefined;\n      this.injections = undefined;\n      FACTORY_FOR.set(this, this);\n    }\n\n    toString() {\n      if (this.madeToString === undefined) {\n        this.madeToString = this.container.registry.makeToString(this.class, this.fullName);\n      }\n\n      return this.madeToString;\n    }\n\n    create(options) {\n      var injectionsCache = this.injections;\n\n      if (injectionsCache === undefined) {\n        var {\n          injections,\n          isDynamic\n        } = injectionsFor(this.container, this.normalizedName);\n        injectionsCache = injections;\n\n        if (!isDynamic) {\n          this.injections = injections;\n        }\n      }\n\n      var props = injectionsCache;\n\n      if (options !== undefined) {\n        props = (0, _polyfills.assign)({}, injectionsCache, options);\n      }\n\n      if (true\n      /* DEBUG */\n      ) {\n        var lazyInjections;\n        var validationCache = this.container.validationCache; // Ensure that all lazy injections are valid at instantiation time\n\n        if (!validationCache[this.fullName] && this.class && typeof this.class._lazyInjections === 'function') {\n          lazyInjections = this.class._lazyInjections();\n          lazyInjections = this.container.registry.normalizeInjectionsHash(lazyInjections);\n          this.container.registry.validateInjections(lazyInjections);\n        }\n\n        validationCache[this.fullName] = true;\n      }\n\n      if (!this.class.create) {\n        throw new Error(\"Failed to create an instance of '\" + this.normalizedName + \"'. Most likely an improperly defined class or an invalid module export.\");\n      } // required to allow access to things like\n      // the customized toString, _debugContainerKey,\n      // owner, etc. without a double extend and without\n      // modifying the objects properties\n\n\n      if (typeof this.class._initFactory === 'function') {\n        this.class._initFactory(this);\n      } else {\n        // in the non-EmberObject case we need to still setOwner\n        // this is required for supporting glimmer environment and\n        // template instantiation which rely heavily on\n        // `options[OWNER]` being passed into `create`\n        // TODO: clean this up, and remove in future versions\n        if (options === undefined || props === undefined) {\n          // avoid mutating `props` here since they are the cached injections\n          props = (0, _polyfills.assign)({}, props);\n        }\n\n        (0, _owner.setOwner)(props, this.owner);\n      }\n\n      var instance = this.class.create(props);\n      FACTORY_FOR.set(instance, this);\n      return instance;\n    }\n\n  }\n\n  var VALID_FULL_NAME_REGEXP = /^[^:]+:[^:]+$/;\n  /**\n   A registry used to store factory and option information keyed\n   by type.\n  \n   A `Registry` stores the factory and option information needed by a\n   `Container` to instantiate and cache objects.\n  \n   The API for `Registry` is still in flux and should not be considered stable.\n  \n   @private\n   @class Registry\n   @since 1.11.0\n  */\n\n  class Registry {\n    constructor(options = {}) {\n      this.fallback = options.fallback || null;\n      this.resolver = options.resolver || null;\n      this.registrations = (0, _utils.dictionary)(options.registrations || null);\n      this._typeInjections = (0, _utils.dictionary)(null);\n      this._injections = (0, _utils.dictionary)(null);\n      this._localLookupCache = Object.create(null);\n      this._normalizeCache = (0, _utils.dictionary)(null);\n      this._resolveCache = (0, _utils.dictionary)(null);\n      this._failSet = new Set();\n      this._options = (0, _utils.dictionary)(null);\n      this._typeOptions = (0, _utils.dictionary)(null);\n    }\n    /**\n     A backup registry for resolving registrations when no matches can be found.\n        @private\n     @property fallback\n     @type Registry\n     */\n\n    /**\n     An object that has a `resolve` method that resolves a name.\n        @private\n     @property resolver\n     @type Resolver\n     */\n\n    /**\n     @private\n     @property registrations\n     @type InheritingDict\n     */\n\n    /**\n     @private\n        @property _typeInjections\n     @type InheritingDict\n     */\n\n    /**\n     @private\n        @property _injections\n     @type InheritingDict\n     */\n\n    /**\n     @private\n        @property _normalizeCache\n     @type InheritingDict\n     */\n\n    /**\n     @private\n        @property _resolveCache\n     @type InheritingDict\n     */\n\n    /**\n     @private\n        @property _options\n     @type InheritingDict\n     */\n\n    /**\n     @private\n        @property _typeOptions\n     @type InheritingDict\n     */\n\n    /**\n     Creates a container based on this registry.\n        @private\n     @method container\n     @param {Object} options\n     @return {Container} created container\n     */\n\n\n    container(options) {\n      return new Container(this, options);\n    }\n    /**\n     Registers a factory for later injection.\n        Example:\n        ```javascript\n     let registry = new Registry();\n        registry.register('model:user', Person, {singleton: false });\n     registry.register('fruit:favorite', Orange);\n     registry.register('communication:main', Email, {singleton: false});\n     ```\n        @private\n     @method register\n     @param {String} fullName\n     @param {Function} factory\n     @param {Object} options\n     */\n\n\n    register(fullName, factory, options = {}) {\n      (true && !(this.isValidFullName(fullName)) && (0, _debug.assert)('fullName must be a proper full name', this.isValidFullName(fullName)));\n      (true && !(factory !== undefined) && (0, _debug.assert)(\"Attempting to register an unknown factory: '\" + fullName + \"'\", factory !== undefined));\n      var normalizedName = this.normalize(fullName);\n      (true && !(!this._resolveCache[normalizedName]) && (0, _debug.assert)(\"Cannot re-register: '\" + fullName + \"', as it has already been resolved.\", !this._resolveCache[normalizedName]));\n\n      this._failSet.delete(normalizedName);\n\n      this.registrations[normalizedName] = factory;\n      this._options[normalizedName] = options;\n    }\n    /**\n     Unregister a fullName\n        ```javascript\n     let registry = new Registry();\n     registry.register('model:user', User);\n        registry.resolve('model:user').create() instanceof User //=> true\n        registry.unregister('model:user')\n     registry.resolve('model:user') === undefined //=> true\n     ```\n        @private\n     @method unregister\n     @param {String} fullName\n     */\n\n\n    unregister(fullName) {\n      (true && !(this.isValidFullName(fullName)) && (0, _debug.assert)('fullName must be a proper full name', this.isValidFullName(fullName)));\n      var normalizedName = this.normalize(fullName);\n      this._localLookupCache = Object.create(null);\n      delete this.registrations[normalizedName];\n      delete this._resolveCache[normalizedName];\n      delete this._options[normalizedName];\n\n      this._failSet.delete(normalizedName);\n    }\n    /**\n     Given a fullName return the corresponding factory.\n        By default `resolve` will retrieve the factory from\n     the registry.\n        ```javascript\n     let registry = new Registry();\n     registry.register('api:twitter', Twitter);\n        registry.resolve('api:twitter') // => Twitter\n     ```\n        Optionally the registry can be provided with a custom resolver.\n     If provided, `resolve` will first provide the custom resolver\n     the opportunity to resolve the fullName, otherwise it will fallback\n     to the registry.\n        ```javascript\n     let registry = new Registry();\n     registry.resolver = function(fullName) {\n        // lookup via the module system of choice\n      };\n        // the twitter factory is added to the module system\n     registry.resolve('api:twitter') // => Twitter\n     ```\n        @private\n     @method resolve\n     @param {String} fullName\n     @param {Object} [options]\n     @param {String} [options.source] the fullname of the request source (used for local lookups)\n     @return {Function} fullName's factory\n     */\n\n\n    resolve(fullName, options) {\n      var factory = resolve(this, this.normalize(fullName), options);\n\n      if (factory === undefined && this.fallback !== null) {\n        factory = this.fallback.resolve(...arguments);\n      }\n\n      return factory;\n    }\n    /**\n     A hook that can be used to describe how the resolver will\n     attempt to find the factory.\n        For example, the default Ember `.describe` returns the full\n     class name (including namespace) where Ember's resolver expects\n     to find the `fullName`.\n        @private\n     @method describe\n     @param {String} fullName\n     @return {string} described fullName\n     */\n\n\n    describe(fullName) {\n      if (this.resolver !== null && this.resolver.lookupDescription) {\n        return this.resolver.lookupDescription(fullName);\n      } else if (this.fallback !== null) {\n        return this.fallback.describe(fullName);\n      } else {\n        return fullName;\n      }\n    }\n    /**\n     A hook to enable custom fullName normalization behavior\n        @private\n     @method normalizeFullName\n     @param {String} fullName\n     @return {string} normalized fullName\n     */\n\n\n    normalizeFullName(fullName) {\n      if (this.resolver !== null && this.resolver.normalize) {\n        return this.resolver.normalize(fullName);\n      } else if (this.fallback !== null) {\n        return this.fallback.normalizeFullName(fullName);\n      } else {\n        return fullName;\n      }\n    }\n    /**\n     Normalize a fullName based on the application's conventions\n        @private\n     @method normalize\n     @param {String} fullName\n     @return {string} normalized fullName\n     */\n\n\n    normalize(fullName) {\n      return this._normalizeCache[fullName] || (this._normalizeCache[fullName] = this.normalizeFullName(fullName));\n    }\n    /**\n     @method makeToString\n        @private\n     @param {any} factory\n     @param {string} fullName\n     @return {function} toString function\n     */\n\n\n    makeToString(factory, fullName) {\n      if (this.resolver !== null && this.resolver.makeToString) {\n        return this.resolver.makeToString(factory, fullName);\n      } else if (this.fallback !== null) {\n        return this.fallback.makeToString(factory, fullName);\n      } else {\n        return factory.toString();\n      }\n    }\n    /**\n     Given a fullName check if the container is aware of its factory\n     or singleton instance.\n        @private\n     @method has\n     @param {String} fullName\n     @param {Object} [options]\n     @param {String} [options.source] the fullname of the request source (used for local lookups)\n     @return {Boolean}\n     */\n\n\n    has(fullName, options) {\n      if (!this.isValidFullName(fullName)) {\n        return false;\n      }\n\n      var source = options && options.source && this.normalize(options.source);\n      var namespace = options && options.namespace || undefined;\n      return has(this, this.normalize(fullName), source, namespace);\n    }\n    /**\n     Allow registering options for all factories of a type.\n        ```javascript\n     let registry = new Registry();\n     let container = registry.container();\n        // if all of type `connection` must not be singletons\n     registry.optionsForType('connection', { singleton: false });\n        registry.register('connection:twitter', TwitterConnection);\n     registry.register('connection:facebook', FacebookConnection);\n        let twitter = container.lookup('connection:twitter');\n     let twitter2 = container.lookup('connection:twitter');\n        twitter === twitter2; // => false\n        let facebook = container.lookup('connection:facebook');\n     let facebook2 = container.lookup('connection:facebook');\n        facebook === facebook2; // => false\n     ```\n        @private\n     @method optionsForType\n     @param {String} type\n     @param {Object} options\n     */\n\n\n    optionsForType(type, options) {\n      this._typeOptions[type] = options;\n    }\n\n    getOptionsForType(type) {\n      var optionsForType = this._typeOptions[type];\n\n      if (optionsForType === undefined && this.fallback !== null) {\n        optionsForType = this.fallback.getOptionsForType(type);\n      }\n\n      return optionsForType;\n    }\n    /**\n     @private\n     @method options\n     @param {String} fullName\n     @param {Object} options\n     */\n\n\n    options(fullName, options) {\n      var normalizedName = this.normalize(fullName);\n      this._options[normalizedName] = options;\n    }\n\n    getOptions(fullName) {\n      var normalizedName = this.normalize(fullName);\n      var options = this._options[normalizedName];\n\n      if (options === undefined && this.fallback !== null) {\n        options = this.fallback.getOptions(fullName);\n      }\n\n      return options;\n    }\n\n    getOption(fullName, optionName) {\n      var options = this._options[fullName];\n\n      if (options !== undefined && options[optionName] !== undefined) {\n        return options[optionName];\n      }\n\n      var type = fullName.split(':')[0];\n      options = this._typeOptions[type];\n\n      if (options && options[optionName] !== undefined) {\n        return options[optionName];\n      } else if (this.fallback !== null) {\n        return this.fallback.getOption(fullName, optionName);\n      }\n\n      return undefined;\n    }\n    /**\n     Used only via `injection`.\n        Provides a specialized form of injection, specifically enabling\n     all objects of one type to be injected with a reference to another\n     object.\n        For example, provided each object of type `controller` needed a `router`.\n     one would do the following:\n        ```javascript\n     let registry = new Registry();\n     let container = registry.container();\n        registry.register('router:main', Router);\n     registry.register('controller:user', UserController);\n     registry.register('controller:post', PostController);\n        registry.typeInjection('controller', 'router', 'router:main');\n        let user = container.lookup('controller:user');\n     let post = container.lookup('controller:post');\n        user.router instanceof Router; //=> true\n     post.router instanceof Router; //=> true\n        // both controllers share the same router\n     user.router === post.router; //=> true\n     ```\n        @private\n     @method typeInjection\n     @param {String} type\n     @param {String} property\n     @param {String} fullName\n     */\n\n\n    typeInjection(type, property, fullName) {\n      (true && !(this.isValidFullName(fullName)) && (0, _debug.assert)('fullName must be a proper full name', this.isValidFullName(fullName)));\n      var fullNameType = fullName.split(':')[0];\n      (true && !(fullNameType !== type) && (0, _debug.assert)(\"Cannot inject a '\" + fullName + \"' on other \" + type + \"(s).\", fullNameType !== type));\n      var injections = this._typeInjections[type] || (this._typeInjections[type] = []);\n      injections.push({\n        property,\n        specifier: fullName\n      });\n    }\n    /**\n     Defines injection rules.\n        These rules are used to inject dependencies onto objects when they\n     are instantiated.\n        Two forms of injections are possible:\n        * Injecting one fullName on another fullName\n     * Injecting one fullName on a type\n        Example:\n        ```javascript\n     let registry = new Registry();\n     let container = registry.container();\n        registry.register('source:main', Source);\n     registry.register('model:user', User);\n     registry.register('model:post', Post);\n        // injecting one fullName on another fullName\n     // eg. each user model gets a post model\n     registry.injection('model:user', 'post', 'model:post');\n        // injecting one fullName on another type\n     registry.injection('model', 'source', 'source:main');\n        let user = container.lookup('model:user');\n     let post = container.lookup('model:post');\n        user.source instanceof Source; //=> true\n     post.source instanceof Source; //=> true\n        user.post instanceof Post; //=> true\n        // and both models share the same source\n     user.source === post.source; //=> true\n     ```\n        @private\n     @method injection\n     @param {String} factoryName\n     @param {String} property\n     @param {String} injectionName\n     */\n\n\n    injection(fullName, property, injectionName) {\n      (true && !(this.isValidFullName(injectionName)) && (0, _debug.assert)(\"Invalid injectionName, expected: 'type:name' got: \" + injectionName, this.isValidFullName(injectionName)));\n      var normalizedInjectionName = this.normalize(injectionName);\n\n      if (fullName.indexOf(':') === -1) {\n        return this.typeInjection(fullName, property, normalizedInjectionName);\n      }\n\n      (true && !(this.isValidFullName(fullName)) && (0, _debug.assert)('fullName must be a proper full name', this.isValidFullName(fullName)));\n      var normalizedName = this.normalize(fullName);\n      var injections = this._injections[normalizedName] || (this._injections[normalizedName] = []);\n      injections.push({\n        property,\n        specifier: normalizedInjectionName\n      });\n    }\n    /**\n     @private\n     @method knownForType\n     @param {String} type the type to iterate over\n    */\n\n\n    knownForType(type) {\n      var localKnown = (0, _utils.dictionary)(null);\n      var registeredNames = Object.keys(this.registrations);\n\n      for (var index = 0; index < registeredNames.length; index++) {\n        var fullName = registeredNames[index];\n        var itemType = fullName.split(':')[0];\n\n        if (itemType === type) {\n          localKnown[fullName] = true;\n        }\n      }\n\n      var fallbackKnown, resolverKnown;\n\n      if (this.fallback !== null) {\n        fallbackKnown = this.fallback.knownForType(type);\n      }\n\n      if (this.resolver !== null && this.resolver.knownForType) {\n        resolverKnown = this.resolver.knownForType(type);\n      }\n\n      return (0, _polyfills.assign)({}, fallbackKnown, localKnown, resolverKnown);\n    }\n\n    isValidFullName(fullName) {\n      return VALID_FULL_NAME_REGEXP.test(fullName);\n    }\n\n    getInjections(fullName) {\n      var injections = this._injections[fullName];\n\n      if (this.fallback !== null) {\n        var fallbackInjections = this.fallback.getInjections(fullName);\n\n        if (fallbackInjections !== undefined) {\n          injections = injections === undefined ? fallbackInjections : injections.concat(fallbackInjections);\n        }\n      }\n\n      return injections;\n    }\n\n    getTypeInjections(type) {\n      var injections = this._typeInjections[type];\n\n      if (this.fallback !== null) {\n        var fallbackInjections = this.fallback.getTypeInjections(type);\n\n        if (fallbackInjections !== undefined) {\n          injections = injections === undefined ? fallbackInjections : injections.concat(fallbackInjections);\n        }\n      }\n\n      return injections;\n    }\n    /**\n     Given a fullName and a source fullName returns the fully resolved\n     fullName. Used to allow for local lookup.\n        ```javascript\n     let registry = new Registry();\n        // the twitter factory is added to the module system\n     registry.expandLocalLookup('component:post-title', { source: 'template:post' }) // => component:post/post-title\n     ```\n        @private\n     @method expandLocalLookup\n     @param {String} fullName\n     @param {Object} [options]\n     @param {String} [options.source] the fullname of the request source (used for local lookups)\n     @return {String} fullName\n     */\n\n\n    expandLocalLookup(fullName, options) {\n      if (this.resolver !== null && this.resolver.expandLocalLookup) {\n        (true && !(this.isValidFullName(fullName)) && (0, _debug.assert)('fullName must be a proper full name', this.isValidFullName(fullName)));\n        (true && !(!options.source || this.isValidFullName(options.source)) && (0, _debug.assert)('options.source must be a proper full name', !options.source || this.isValidFullName(options.source)));\n        var normalizedFullName = this.normalize(fullName);\n        var normalizedSource = this.normalize(options.source);\n        return expandLocalLookup(this, normalizedFullName, normalizedSource, options.namespace);\n      } else if (this.fallback !== null) {\n        return this.fallback.expandLocalLookup(fullName, options);\n      } else {\n        return null;\n      }\n    }\n\n  }\n\n  _exports.Registry = Registry;\n\n  if (true\n  /* DEBUG */\n  ) {\n    var proto = Registry.prototype;\n\n    proto.normalizeInjectionsHash = function (hash) {\n      var injections = [];\n\n      for (var key in hash) {\n        if (hash.hasOwnProperty(key)) {\n          var {\n            specifier,\n            source,\n            namespace\n          } = hash[key];\n          (true && !(this.isValidFullName(specifier)) && (0, _debug.assert)(\"Expected a proper full name, given '\" + specifier + \"'\", this.isValidFullName(specifier)));\n          injections.push({\n            property: key,\n            specifier,\n            source,\n            namespace\n          });\n        }\n      }\n\n      return injections;\n    };\n\n    proto.validateInjections = function (injections) {\n      if (!injections) {\n        return;\n      }\n\n      for (var i = 0; i < injections.length; i++) {\n        var {\n          specifier,\n          source,\n          namespace\n        } = injections[i];\n        (true && !(this.has(specifier, {\n          source,\n          namespace\n        })) && (0, _debug.assert)(\"Attempting to inject an unknown injection: '\" + specifier + \"'\", this.has(specifier, {\n          source,\n          namespace\n        })));\n      }\n    };\n  }\n\n  function expandLocalLookup(registry, normalizedName, normalizedSource, namespace) {\n    var cache = registry._localLookupCache;\n    var normalizedNameCache = cache[normalizedName];\n\n    if (!normalizedNameCache) {\n      normalizedNameCache = cache[normalizedName] = Object.create(null);\n    }\n\n    var cacheKey = namespace || normalizedSource;\n    var cached = normalizedNameCache[cacheKey];\n\n    if (cached !== undefined) {\n      return cached;\n    }\n\n    var expanded = registry.resolver.expandLocalLookup(normalizedName, normalizedSource, namespace);\n    return normalizedNameCache[cacheKey] = expanded;\n  }\n\n  function resolve(registry, _normalizedName, options) {\n    var normalizedName = _normalizedName; // when `source` is provided expand normalizedName\n    // and source into the full normalizedName\n\n    if (options !== undefined && (options.source || options.namespace)) {\n      normalizedName = registry.expandLocalLookup(_normalizedName, options);\n\n      if (!normalizedName) {\n        return;\n      }\n    }\n\n    var cached = registry._resolveCache[normalizedName];\n\n    if (cached !== undefined) {\n      return cached;\n    }\n\n    if (registry._failSet.has(normalizedName)) {\n      return;\n    }\n\n    var resolved;\n\n    if (registry.resolver) {\n      resolved = registry.resolver.resolve(normalizedName);\n    }\n\n    if (resolved === undefined) {\n      resolved = registry.registrations[normalizedName];\n    }\n\n    if (resolved === undefined) {\n      registry._failSet.add(normalizedName);\n    } else {\n      registry._resolveCache[normalizedName] = resolved;\n    }\n\n    return resolved;\n  }\n\n  function has(registry, fullName, source, namespace) {\n    return registry.resolve(fullName, {\n      source,\n      namespace\n    }) !== undefined;\n  }\n\n  var privateNames = (0, _utils.dictionary)(null);\n  var privateSuffix = (\"\" + Math.random() + Date.now()).replace('.', '');\n\n  function privatize([fullName]) {\n    var name = privateNames[fullName];\n\n    if (name) {\n      return name;\n    }\n\n    var [type, rawName] = fullName.split(':');\n    return privateNames[fullName] = (0, _utils.intern)(type + \":\" + rawName + \"-\" + privateSuffix);\n  }\n  /*\n  Public API for the container is still in flux.\n  The public API, specified on the application namespace should be considered the stable API.\n  // @module container\n    @private\n  */\n\n});","define(\"@ember/-internals/environment/index\", [\"exports\", \"@ember/debug\", \"@ember/deprecated-features\"], function (_exports, _debug, _deprecatedFeatures) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.getLookup = getLookup;\n  _exports.setLookup = setLookup;\n  _exports.getENV = getENV;\n  _exports.ENV = _exports.context = _exports.global = void 0;\n\n  // from lodash to catch fake globals\n  function checkGlobal(value) {\n    return value && value.Object === Object ? value : undefined;\n  } // element ids can ruin global miss checks\n\n\n  function checkElementIdShadowing(value) {\n    return value && value.nodeType === undefined ? value : undefined;\n  } // export real global\n\n\n  var global$1 = checkGlobal(checkElementIdShadowing(typeof global === 'object' && global)) || checkGlobal(typeof self === 'object' && self) || checkGlobal(typeof window === 'object' && window) || typeof mainContext !== 'undefined' && mainContext || // set before strict mode in Ember loader/wrapper\n  new Function('return this')(); // eval outside of strict mode\n\n  _exports.global = global$1;\n\n  var context = function (global, Ember) {\n    return Ember === undefined ? {\n      imports: global,\n      exports: global,\n      lookup: global\n    } : {\n      // import jQuery\n      imports: Ember.imports || global,\n      // export Ember\n      exports: Ember.exports || global,\n      // search for Namespaces\n      lookup: Ember.lookup || global\n    };\n  }(global$1, global$1.Ember);\n\n  _exports.context = context;\n\n  function getLookup() {\n    return context.lookup;\n  }\n\n  function setLookup(value) {\n    context.lookup = value;\n  }\n  /**\n    The hash of environment variables used to control various configuration\n    settings. To specify your own or override default settings, add the\n    desired properties to a global hash named `EmberENV` (or `ENV` for\n    backwards compatibility with earlier versions of Ember). The `EmberENV`\n    hash must be created before loading Ember.\n  \n    @class EmberENV\n    @type Object\n    @public\n  */\n\n\n  var ENV = {\n    ENABLE_OPTIONAL_FEATURES: false,\n\n    /**\n      Determines whether Ember should add to `Array`, `Function`, and `String`\n      native object prototypes, a few extra methods in order to provide a more\n      friendly API.\n         We generally recommend leaving this option set to true however, if you need\n      to turn it off, you can add the configuration property\n      `EXTEND_PROTOTYPES` to `EmberENV` and set it to `false`.\n         Note, when disabled (the default configuration for Ember Addons), you will\n      instead have to access all methods and functions from the Ember\n      namespace.\n         @property EXTEND_PROTOTYPES\n      @type Boolean\n      @default true\n      @for EmberENV\n      @public\n    */\n    EXTEND_PROTOTYPES: {\n      Array: true,\n      Function: true,\n      String: true\n    },\n\n    /**\n      The `LOG_STACKTRACE_ON_DEPRECATION` property, when true, tells Ember to log\n      a full stack trace during deprecation warnings.\n         @property LOG_STACKTRACE_ON_DEPRECATION\n      @type Boolean\n      @default true\n      @for EmberENV\n      @public\n    */\n    LOG_STACKTRACE_ON_DEPRECATION: true,\n\n    /**\n      The `LOG_VERSION` property, when true, tells Ember to log versions of all\n      dependent libraries in use.\n         @property LOG_VERSION\n      @type Boolean\n      @default true\n      @for EmberENV\n      @public\n    */\n    LOG_VERSION: true,\n    RAISE_ON_DEPRECATION: false,\n    STRUCTURED_PROFILE: false,\n\n    /**\n      Whether to insert a `<div class=\"ember-view\" />` wrapper around the\n      application template. See RFC #280.\n         This is not intended to be set directly, as the implementation may change in\n      the future. Use `@ember/optional-features` instead.\n         @property _APPLICATION_TEMPLATE_WRAPPER\n      @for EmberENV\n      @type Boolean\n      @default true\n      @private\n    */\n    _APPLICATION_TEMPLATE_WRAPPER: true,\n\n    /**\n      Whether to use Glimmer Component semantics (as opposed to the classic \"Curly\"\n      components semantics) for template-only components. See RFC #278.\n         This is not intended to be set directly, as the implementation may change in\n      the future. Use `@ember/optional-features` instead.\n         @property _TEMPLATE_ONLY_GLIMMER_COMPONENTS\n      @for EmberENV\n      @type Boolean\n      @default false\n      @private\n    */\n    _TEMPLATE_ONLY_GLIMMER_COMPONENTS: false,\n\n    /**\n      Whether to perform extra bookkeeping needed to make the `captureRenderTree`\n      API work.\n         This has to be set before the ember JavaScript code is evaluated. This is\n      usually done by setting `window.EmberENV = { _DEBUG_RENDER_TREE: true };`\n      or `window.ENV = { _DEBUG_RENDER_TREE: true };` before the \"vendor\"\n      `<script>` tag in `index.html`.\n         Setting the flag after Ember is already loaded will not work correctly. It\n      may appear to work somewhat, but fundamentally broken.\n         This is not intended to be set directly. Ember Inspector will enable the\n      flag on behalf of the user as needed.\n         This flag is always on in development mode.\n         The flag is off by default in production mode, due to the cost associated\n      with the the bookkeeping work.\n         The expected flow is that Ember Inspector will ask the user to refresh the\n      page after enabling the feature. It could also offer a feature where the\n      user add some domains to the \"always on\" list. In either case, Ember\n      Inspector will inject the code on the page to set the flag if needed.\n         @property _DEBUG_RENDER_TREE\n      @for EmberENV\n      @type Boolean\n      @default false\n      @private\n    */\n    _DEBUG_RENDER_TREE: true\n    /* DEBUG */\n    ,\n\n    /**\n      Whether the app is using jQuery. See RFC #294.\n         This is not intended to be set directly, as the implementation may change in\n      the future. Use `@ember/optional-features` instead.\n         @property _JQUERY_INTEGRATION\n      @for EmberENV\n      @type Boolean\n      @default true\n      @private\n    */\n    _JQUERY_INTEGRATION: true,\n\n    /**\n      Whether the app defaults to using async observers.\n         This is not intended to be set directly, as the implementation may change in\n      the future. Use `@ember/optional-features` instead.\n         @property _DEFAULT_ASYNC_OBSERVERS\n      @for EmberENV\n      @type Boolean\n      @default false\n      @private\n    */\n    _DEFAULT_ASYNC_OBSERVERS: false,\n\n    /**\n      Controls the maximum number of scheduled rerenders without \"settling\". In general,\n      applications should not need to modify this environment variable, but please\n      open an issue so that we can determine if a better default value is needed.\n         @property _RERENDER_LOOP_LIMIT\n      @for EmberENV\n      @type number\n      @default 1000\n      @private\n     */\n    _RERENDER_LOOP_LIMIT: 1000,\n    EMBER_LOAD_HOOKS: {},\n    FEATURES: {}\n  };\n  _exports.ENV = ENV;\n  var providedEnv = global$1.EmberENV;\n\n  if (providedEnv === undefined) {\n    providedEnv = global$1.ENV;\n    (true && !(providedEnv === undefined) && (0, _debug.deprecate)(\"Configuring Ember's boot options via `window.ENV` is deprecated, please migrate to `window.EmberENV` instead.\", providedEnv === undefined, {\n      id: 'ember-environment.window.env',\n      until: '3.17.0'\n    }));\n  }\n\n  (EmberENV => {\n    if (typeof EmberENV !== 'object' || EmberENV === null) return;\n\n    for (var flag in EmberENV) {\n      if (!EmberENV.hasOwnProperty(flag) || flag === 'EXTEND_PROTOTYPES' || flag === 'EMBER_LOAD_HOOKS') continue;\n      var defaultValue = ENV[flag];\n\n      if (defaultValue === true) {\n        ENV[flag] = EmberENV[flag] !== false;\n      } else if (defaultValue === false) {\n        ENV[flag] = EmberENV[flag] === true;\n      }\n    }\n\n    var {\n      EXTEND_PROTOTYPES\n    } = EmberENV;\n\n    if (EXTEND_PROTOTYPES !== undefined) {\n      if (typeof EXTEND_PROTOTYPES === 'object' && EXTEND_PROTOTYPES !== null) {\n        ENV.EXTEND_PROTOTYPES.String = EXTEND_PROTOTYPES.String !== false;\n\n        if (_deprecatedFeatures.FUNCTION_PROTOTYPE_EXTENSIONS) {\n          ENV.EXTEND_PROTOTYPES.Function = EXTEND_PROTOTYPES.Function !== false;\n        }\n\n        ENV.EXTEND_PROTOTYPES.Array = EXTEND_PROTOTYPES.Array !== false;\n      } else {\n        var isEnabled = EXTEND_PROTOTYPES !== false;\n        ENV.EXTEND_PROTOTYPES.String = isEnabled;\n\n        if (_deprecatedFeatures.FUNCTION_PROTOTYPE_EXTENSIONS) {\n          ENV.EXTEND_PROTOTYPES.Function = isEnabled;\n        }\n\n        ENV.EXTEND_PROTOTYPES.Array = isEnabled;\n      }\n    } // TODO this does not seem to be used by anything,\n    //      can we remove it? do we need to deprecate it?\n\n\n    var {\n      EMBER_LOAD_HOOKS\n    } = EmberENV;\n\n    if (typeof EMBER_LOAD_HOOKS === 'object' && EMBER_LOAD_HOOKS !== null) {\n      for (var hookName in EMBER_LOAD_HOOKS) {\n        if (!EMBER_LOAD_HOOKS.hasOwnProperty(hookName)) continue;\n        var hooks = EMBER_LOAD_HOOKS[hookName];\n\n        if (Array.isArray(hooks)) {\n          ENV.EMBER_LOAD_HOOKS[hookName] = hooks.filter(hook => typeof hook === 'function');\n        }\n      }\n    }\n\n    var {\n      FEATURES\n    } = EmberENV;\n\n    if (typeof FEATURES === 'object' && FEATURES !== null) {\n      for (var feature in FEATURES) {\n        if (!FEATURES.hasOwnProperty(feature)) continue;\n        ENV.FEATURES[feature] = FEATURES[feature] === true;\n      }\n    }\n\n    if (true\n    /* DEBUG */\n    ) {\n      ENV._DEBUG_RENDER_TREE = true;\n    }\n  })(providedEnv);\n\n  function getENV() {\n    return ENV;\n  }\n});","define(\"@ember/-internals/error-handling/index\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.getOnerror = getOnerror;\n  _exports.setOnerror = setOnerror;\n  _exports.getDispatchOverride = getDispatchOverride;\n  _exports.setDispatchOverride = setDispatchOverride;\n  _exports.onErrorTarget = void 0;\n  var onerror;\n  var onErrorTarget = {\n    get onerror() {\n      return onerror;\n    }\n\n  }; // Ember.onerror getter\n\n  _exports.onErrorTarget = onErrorTarget;\n\n  function getOnerror() {\n    return onerror;\n  } // Ember.onerror setter\n\n\n  function setOnerror(handler) {\n    onerror = handler;\n  }\n\n  var dispatchOverride; // allows testing adapter to override dispatch\n\n  function getDispatchOverride() {\n    return dispatchOverride;\n  }\n\n  function setDispatchOverride(handler) {\n    dispatchOverride = handler;\n  }\n});","define(\"@ember/-internals/extension-support/index\", [\"exports\", \"@ember/-internals/extension-support/lib/data_adapter\", \"@ember/-internals/extension-support/lib/container_debug_adapter\"], function (_exports, _data_adapter, _container_debug_adapter) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"DataAdapter\", {\n    enumerable: true,\n    get: function () {\n      return _data_adapter.default;\n    }\n  });\n  Object.defineProperty(_exports, \"ContainerDebugAdapter\", {\n    enumerable: true,\n    get: function () {\n      return _container_debug_adapter.default;\n    }\n  });\n});","define(\"@ember/-internals/extension-support/lib/container_debug_adapter\", [\"exports\", \"@ember/string\", \"@ember/-internals/runtime\"], function (_exports, _string, _runtime) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n  @module @ember/debug\n  */\n\n  /**\n    The `ContainerDebugAdapter` helps the container and resolver interface\n    with tools that debug Ember such as the\n    [Ember Inspector](https://github.com/emberjs/ember-inspector)\n    for Chrome and Firefox.\n  \n    This class can be extended by a custom resolver implementer\n    to override some of the methods with library-specific code.\n  \n    The methods likely to be overridden are:\n  \n    * `canCatalogEntriesByType`\n    * `catalogEntriesByType`\n  \n    The adapter will need to be registered\n    in the application's container as `container-debug-adapter:main`.\n  \n    Example:\n  \n    ```javascript\n    Application.initializer({\n      name: \"containerDebugAdapter\",\n  \n      initialize(application) {\n        application.register('container-debug-adapter:main', require('app/container-debug-adapter'));\n      }\n    });\n    ```\n  \n    @class ContainerDebugAdapter\n    @extends EmberObject\n    @since 1.5.0\n    @public\n  */\n  var _default = _runtime.Object.extend({\n    /**\n      The resolver instance of the application\n      being debugged. This property will be injected\n      on creation.\n       @property resolver\n      @default null\n      @public\n    */\n    resolver: null,\n\n    /**\n      Returns true if it is possible to catalog a list of available\n      classes in the resolver for a given type.\n       @method canCatalogEntriesByType\n      @param {String} type The type. e.g. \"model\", \"controller\", \"route\".\n      @return {boolean} whether a list is available for this type.\n      @public\n    */\n    canCatalogEntriesByType(type) {\n      if (type === 'model' || type === 'template') {\n        return false;\n      }\n\n      return true;\n    },\n\n    /**\n      Returns the available classes a given type.\n       @method catalogEntriesByType\n      @param {String} type The type. e.g. \"model\", \"controller\", \"route\".\n      @return {Array} An array of strings.\n      @public\n    */\n    catalogEntriesByType(type) {\n      var namespaces = (0, _runtime.A)(_runtime.Namespace.NAMESPACES);\n      var types = (0, _runtime.A)();\n      var typeSuffixRegex = new RegExp((0, _string.classify)(type) + \"$\");\n      namespaces.forEach(namespace => {\n        for (var key in namespace) {\n          if (!namespace.hasOwnProperty(key)) {\n            continue;\n          }\n\n          if (typeSuffixRegex.test(key)) {\n            var klass = namespace[key];\n\n            if ((0, _runtime.typeOf)(klass) === 'class') {\n              types.push((0, _string.dasherize)(key.replace(typeSuffixRegex, '')));\n            }\n          }\n        }\n      });\n      return types;\n    }\n\n  });\n\n  _exports.default = _default;\n});","define(\"@ember/-internals/extension-support/lib/data_adapter\", [\"exports\", \"@ember/-internals/owner\", \"@ember/runloop\", \"@ember/-internals/metal\", \"@ember/string\", \"@ember/-internals/runtime\"], function (_exports, _owner, _runloop, _metal, _string, _runtime) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n  @module @ember/debug\n  */\n\n  /**\n    The `DataAdapter` helps a data persistence library\n    interface with tools that debug Ember such\n    as the [Ember Inspector](https://github.com/emberjs/ember-inspector)\n    for Chrome and Firefox.\n  \n    This class will be extended by a persistence library\n    which will override some of the methods with\n    library-specific code.\n  \n    The methods likely to be overridden are:\n  \n    * `getFilters`\n    * `detect`\n    * `columnsForType`\n    * `getRecords`\n    * `getRecordColumnValues`\n    * `getRecordKeywords`\n    * `getRecordFilterValues`\n    * `getRecordColor`\n    * `observeRecord`\n  \n    The adapter will need to be registered\n    in the application's container as `dataAdapter:main`.\n  \n    Example:\n  \n    ```javascript\n    Application.initializer({\n      name: \"data-adapter\",\n  \n      initialize: function(application) {\n        application.register('data-adapter:main', DS.DataAdapter);\n      }\n    });\n    ```\n  \n    @class DataAdapter\n    @extends EmberObject\n    @public\n  */\n  var _default = _runtime.Object.extend({\n    init() {\n      this._super(...arguments);\n\n      this.releaseMethods = (0, _runtime.A)();\n    },\n\n    /**\n      The container-debug-adapter which is used\n      to list all models.\n       @property containerDebugAdapter\n      @default undefined\n      @since 1.5.0\n      @public\n    **/\n    containerDebugAdapter: undefined,\n\n    /**\n      The number of attributes to send\n      as columns. (Enough to make the record\n      identifiable).\n       @private\n      @property attributeLimit\n      @default 3\n      @since 1.3.0\n    */\n    attributeLimit: 3,\n\n    /**\n       Ember Data > v1.0.0-beta.18\n       requires string model names to be passed\n       around instead of the actual factories.\n        This is a stamp for the Ember Inspector\n       to differentiate between the versions\n       to be able to support older versions too.\n        @public\n       @property acceptsModelName\n     */\n    acceptsModelName: true,\n\n    /**\n      Stores all methods that clear observers.\n      These methods will be called on destruction.\n       @private\n      @property releaseMethods\n      @since 1.3.0\n    */\n    releaseMethods: (0, _runtime.A)(),\n\n    /**\n      Specifies how records can be filtered.\n      Records returned will need to have a `filterValues`\n      property with a key for every name in the returned array.\n       @public\n      @method getFilters\n      @return {Array} List of objects defining filters.\n       The object should have a `name` and `desc` property.\n    */\n    getFilters() {\n      return (0, _runtime.A)();\n    },\n\n    /**\n      Fetch the model types and observe them for changes.\n       @public\n      @method watchModelTypes\n       @param {Function} typesAdded Callback to call to add types.\n      Takes an array of objects containing wrapped types (returned from `wrapModelType`).\n       @param {Function} typesUpdated Callback to call when a type has changed.\n      Takes an array of objects containing wrapped types.\n       @return {Function} Method to call to remove all observers\n    */\n    watchModelTypes(typesAdded, typesUpdated) {\n      var modelTypes = this.getModelTypes();\n      var releaseMethods = (0, _runtime.A)();\n      var typesToSend;\n      typesToSend = modelTypes.map(type => {\n        var klass = type.klass;\n        var wrapped = this.wrapModelType(klass, type.name);\n        releaseMethods.push(this.observeModelType(type.name, typesUpdated));\n        return wrapped;\n      });\n      typesAdded(typesToSend);\n\n      var release = () => {\n        releaseMethods.forEach(fn => fn());\n        this.releaseMethods.removeObject(release);\n      };\n\n      this.releaseMethods.pushObject(release);\n      return release;\n    },\n\n    _nameToClass(type) {\n      if (typeof type === 'string') {\n        var owner = (0, _owner.getOwner)(this);\n        var Factory = owner.factoryFor(\"model:\" + type);\n        type = Factory && Factory.class;\n      }\n\n      return type;\n    },\n\n    /**\n      Fetch the records of a given type and observe them for changes.\n       @public\n      @method watchRecords\n       @param {String} modelName The model name.\n       @param {Function} recordsAdded Callback to call to add records.\n      Takes an array of objects containing wrapped records.\n      The object should have the following properties:\n        columnValues: {Object} The key and value of a table cell.\n        object: {Object} The actual record object.\n       @param {Function} recordsUpdated Callback to call when a record has changed.\n      Takes an array of objects containing wrapped records.\n       @param {Function} recordsRemoved Callback to call when a record has removed.\n      Takes the following parameters:\n        index: The array index where the records were removed.\n        count: The number of records removed.\n       @return {Function} Method to call to remove all observers.\n    */\n    watchRecords(modelName, recordsAdded, recordsUpdated, recordsRemoved) {\n      var releaseMethods = (0, _runtime.A)();\n\n      var klass = this._nameToClass(modelName);\n\n      var records = this.getRecords(klass, modelName);\n      var release;\n\n      function recordUpdated(updatedRecord) {\n        recordsUpdated([updatedRecord]);\n      }\n\n      var recordsToSend = records.map(record => {\n        releaseMethods.push(this.observeRecord(record, recordUpdated));\n        return this.wrapRecord(record);\n      });\n\n      var contentDidChange = (array, idx, removedCount, addedCount) => {\n        for (var i = idx; i < idx + addedCount; i++) {\n          var record = (0, _metal.objectAt)(array, i);\n          var wrapped = this.wrapRecord(record);\n          releaseMethods.push(this.observeRecord(record, recordUpdated));\n          recordsAdded([wrapped]);\n        }\n\n        if (removedCount) {\n          recordsRemoved(idx, removedCount);\n        }\n      };\n\n      var observer = {\n        didChange: contentDidChange,\n\n        willChange() {\n          return this;\n        }\n\n      };\n      (0, _metal.addArrayObserver)(records, this, observer);\n\n      release = () => {\n        releaseMethods.forEach(fn => fn());\n        (0, _metal.removeArrayObserver)(records, this, observer);\n        this.releaseMethods.removeObject(release);\n      };\n\n      recordsAdded(recordsToSend);\n      this.releaseMethods.pushObject(release);\n      return release;\n    },\n\n    /**\n      Clear all observers before destruction\n      @private\n      @method willDestroy\n    */\n    willDestroy() {\n      this._super(...arguments);\n\n      this.releaseMethods.forEach(fn => fn());\n    },\n\n    /**\n      Detect whether a class is a model.\n       Test that against the model class\n      of your persistence library.\n       @public\n      @method detect\n      @return boolean Whether the class is a model class or not.\n    */\n    detect() {\n      return false;\n    },\n\n    /**\n      Get the columns for a given model type.\n       @public\n      @method columnsForType\n      @return {Array} An array of columns of the following format:\n       name: {String} The name of the column.\n       desc: {String} Humanized description (what would show in a table column name).\n    */\n    columnsForType() {\n      return (0, _runtime.A)();\n    },\n\n    /**\n      Adds observers to a model type class.\n       @private\n      @method observeModelType\n      @param {String} modelName The model type name.\n      @param {Function} typesUpdated Called when a type is modified.\n      @return {Function} The function to call to remove observers.\n    */\n    observeModelType(modelName, typesUpdated) {\n      var klass = this._nameToClass(modelName);\n\n      var records = this.getRecords(klass, modelName);\n\n      function onChange() {\n        typesUpdated([this.wrapModelType(klass, modelName)]);\n      }\n\n      var observer = {\n        didChange(array, idx, removedCount, addedCount) {\n          // Only re-fetch records if the record count changed\n          // (which is all we care about as far as model types are concerned).\n          if (removedCount > 0 || addedCount > 0) {\n            (0, _runloop.scheduleOnce)('actions', this, onChange);\n          }\n        },\n\n        willChange() {\n          return this;\n        }\n\n      };\n      (0, _metal.addArrayObserver)(records, this, observer);\n\n      var release = () => (0, _metal.removeArrayObserver)(records, this, observer);\n\n      return release;\n    },\n\n    /**\n      Wraps a given model type and observes changes to it.\n       @private\n      @method wrapModelType\n      @param {Class} klass A model class.\n      @param {String} modelName Name of the class.\n      @return {Object} Contains the wrapped type and the function to remove observers\n      Format:\n        type: {Object} The wrapped type.\n          The wrapped type has the following format:\n            name: {String} The name of the type.\n            count: {Integer} The number of records available.\n            columns: {Columns} An array of columns to describe the record.\n            object: {Class} The actual Model type class.\n        release: {Function} The function to remove observers.\n    */\n    wrapModelType(klass, name) {\n      var records = this.getRecords(klass, name);\n      var typeToSend;\n      typeToSend = {\n        name,\n        count: (0, _metal.get)(records, 'length'),\n        columns: this.columnsForType(klass),\n        object: klass\n      };\n      return typeToSend;\n    },\n\n    /**\n      Fetches all models defined in the application.\n       @private\n      @method getModelTypes\n      @return {Array} Array of model types.\n    */\n    getModelTypes() {\n      var containerDebugAdapter = this.get('containerDebugAdapter');\n      var types;\n\n      if (containerDebugAdapter.canCatalogEntriesByType('model')) {\n        types = containerDebugAdapter.catalogEntriesByType('model');\n      } else {\n        types = this._getObjectsOnNamespaces();\n      } // New adapters return strings instead of classes.\n\n\n      types = (0, _runtime.A)(types).map(name => {\n        return {\n          klass: this._nameToClass(name),\n          name\n        };\n      });\n      types = (0, _runtime.A)(types).filter(type => this.detect(type.klass));\n      return (0, _runtime.A)(types);\n    },\n\n    /**\n      Loops over all namespaces and all objects\n      attached to them.\n       @private\n      @method _getObjectsOnNamespaces\n      @return {Array} Array of model type strings.\n    */\n    _getObjectsOnNamespaces() {\n      var namespaces = (0, _runtime.A)(_runtime.Namespace.NAMESPACES);\n      var types = (0, _runtime.A)();\n      namespaces.forEach(namespace => {\n        for (var key in namespace) {\n          if (!namespace.hasOwnProperty(key)) {\n            continue;\n          } // Even though we will filter again in `getModelTypes`,\n          // we should not call `lookupFactory` on non-models\n\n\n          if (!this.detect(namespace[key])) {\n            continue;\n          }\n\n          var name = (0, _string.dasherize)(key);\n          types.push(name);\n        }\n      });\n      return types;\n    },\n\n    /**\n      Fetches all loaded records for a given type.\n       @public\n      @method getRecords\n      @return {Array} An array of records.\n       This array will be observed for changes,\n       so it should update when new records are added/removed.\n    */\n    getRecords() {\n      return (0, _runtime.A)();\n    },\n\n    /**\n      Wraps a record and observers changes to it.\n       @private\n      @method wrapRecord\n      @param {Object} record The record instance.\n      @return {Object} The wrapped record. Format:\n      columnValues: {Array}\n      searchKeywords: {Array}\n    */\n    wrapRecord(record) {\n      var recordToSend = {\n        object: record\n      };\n      recordToSend.columnValues = this.getRecordColumnValues(record);\n      recordToSend.searchKeywords = this.getRecordKeywords(record);\n      recordToSend.filterValues = this.getRecordFilterValues(record);\n      recordToSend.color = this.getRecordColor(record);\n      return recordToSend;\n    },\n\n    /**\n      Gets the values for each column.\n       @public\n      @method getRecordColumnValues\n      @return {Object} Keys should match column names defined\n      by the model type.\n    */\n    getRecordColumnValues() {\n      return {};\n    },\n\n    /**\n      Returns keywords to match when searching records.\n       @public\n      @method getRecordKeywords\n      @return {Array} Relevant keywords for search.\n    */\n    getRecordKeywords() {\n      return (0, _runtime.A)();\n    },\n\n    /**\n      Returns the values of filters defined by `getFilters`.\n       @public\n      @method getRecordFilterValues\n      @param {Object} record The record instance.\n      @return {Object} The filter values.\n    */\n    getRecordFilterValues() {\n      return {};\n    },\n\n    /**\n      Each record can have a color that represents its state.\n       @public\n      @method getRecordColor\n      @param {Object} record The record instance\n      @return {String} The records color.\n        Possible options: black, red, blue, green.\n    */\n    getRecordColor() {\n      return null;\n    },\n\n    /**\n      Observes all relevant properties and re-sends the wrapped record\n      when a change occurs.\n       @public\n      @method observerRecord\n      @return {Function} The function to call to remove all observers.\n    */\n    observeRecord() {\n      return function () {};\n    }\n\n  });\n\n  _exports.default = _default;\n});","define(\"@ember/-internals/glimmer/index\", [\"exports\", \"ember-babel\", \"@ember/polyfills\", \"@ember/-internals/container\", \"@glimmer/opcode-compiler\", \"@ember/-internals/runtime\", \"@ember/-internals/utils\", \"@ember/runloop\", \"@glimmer/reference\", \"@ember/-internals/metal\", \"@ember/debug\", \"@glimmer/runtime\", \"@glimmer/util\", \"@ember/-internals/owner\", \"@ember/-internals/views\", \"@ember/-internals/browser-environment\", \"@ember/instrumentation\", \"@ember/service\", \"@ember/-internals/environment\", \"@ember/deprecated-features\", \"@ember/string\", \"@glimmer/wire-format\", \"rsvp\", \"@glimmer/node\", \"@ember/-internals/routing\", \"@ember/component/template-only\", \"@ember/error\"], function (_exports, _emberBabel, _polyfills, _container, _opcodeCompiler, _runtime, _utils, _runloop, _reference, _metal, _debug, _runtime2, _util, _owner, _views, _browserEnvironment, _instrumentation, _service, _environment2, _deprecatedFeatures, _string, _wireFormat, _rsvp, _node, _routing, _templateOnly, _error) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.template = template;\n  _exports.helper = helper;\n  _exports.escapeExpression = escapeExpression;\n  _exports.htmlSafe = htmlSafe;\n  _exports.isHTMLSafe = isHTMLSafe;\n  _exports._resetRenderers = _resetRenderers;\n  _exports.renderSettled = renderSettled;\n  _exports.getTemplate = getTemplate;\n  _exports.setTemplate = setTemplate;\n  _exports.hasTemplate = hasTemplate;\n  _exports.getTemplates = getTemplates;\n  _exports.setTemplates = setTemplates;\n  _exports.setupEngineRegistry = setupEngineRegistry;\n  _exports.setupApplicationRegistry = setupApplicationRegistry;\n  _exports._registerMacros = registerMacros;\n  _exports.iterableFor = iterableFor;\n  _exports.capabilities = capabilities;\n  _exports.setComponentManager = setComponentManager;\n  _exports.getComponentManager = getComponentManager;\n  _exports.setModifierManager = setModifierManager;\n  _exports.getModifierManager = getModifierManager;\n  _exports.modifierCapabilities = capabilities$1;\n  _exports.setComponentTemplate = setComponentTemplate;\n  _exports.getComponentTemplate = getComponentTemplate;\n  Object.defineProperty(_exports, \"DOMChanges\", {\n    enumerable: true,\n    get: function () {\n      return _runtime2.DOMChanges;\n    }\n  });\n  Object.defineProperty(_exports, \"DOMTreeConstruction\", {\n    enumerable: true,\n    get: function () {\n      return _runtime2.DOMTreeConstruction;\n    }\n  });\n  Object.defineProperty(_exports, \"isSerializationFirstNode\", {\n    enumerable: true,\n    get: function () {\n      return _runtime2.isSerializationFirstNode;\n    }\n  });\n  Object.defineProperty(_exports, \"NodeDOMTreeConstruction\", {\n    enumerable: true,\n    get: function () {\n      return _node.NodeDOMTreeConstruction;\n    }\n  });\n  _exports.OutletView = _exports.INVOKE = _exports.UpdatableReference = _exports.AbstractComponentManager = _exports._experimentalMacros = _exports.InteractiveRenderer = _exports.InertRenderer = _exports.Renderer = _exports.SafeString = _exports.Environment = _exports.Helper = _exports.Component = _exports.LinkComponent = _exports.TextArea = _exports.TextField = _exports.Checkbox = _exports.templateCacheCounters = _exports.RootTemplate = void 0;\n\n  function _templateObject10() {\n    var data = (0, _emberBabel.taggedTemplateLiteralLoose)([\"component:-default\"]);\n\n    _templateObject10 = function () {\n      return data;\n    };\n\n    return data;\n  }\n\n  function _templateObject9() {\n    var data = (0, _emberBabel.taggedTemplateLiteralLoose)([\"template-compiler:main\"]);\n\n    _templateObject9 = function () {\n      return data;\n    };\n\n    return data;\n  }\n\n  function _templateObject8() {\n    var data = (0, _emberBabel.taggedTemplateLiteralLoose)([\"template-compiler:main\"]);\n\n    _templateObject8 = function () {\n      return data;\n    };\n\n    return data;\n  }\n\n  function _templateObject7() {\n    var data = (0, _emberBabel.taggedTemplateLiteralLoose)([\"template:components/-default\"]);\n\n    _templateObject7 = function () {\n      return data;\n    };\n\n    return data;\n  }\n\n  function _templateObject6() {\n    var data = (0, _emberBabel.taggedTemplateLiteralLoose)([\"template:-root\"]);\n\n    _templateObject6 = function () {\n      return data;\n    };\n\n    return data;\n  }\n\n  function _templateObject5() {\n    var data = (0, _emberBabel.taggedTemplateLiteralLoose)([\"template:-root\"]);\n\n    _templateObject5 = function () {\n      return data;\n    };\n\n    return data;\n  }\n\n  function _templateObject4() {\n    var data = (0, _emberBabel.taggedTemplateLiteralLoose)([\"component:-default\"]);\n\n    _templateObject4 = function () {\n      return data;\n    };\n\n    return data;\n  }\n\n  function _templateObject3() {\n    var data = (0, _emberBabel.taggedTemplateLiteralLoose)([\"template:components/-default\"]);\n\n    _templateObject3 = function () {\n      return data;\n    };\n\n    return data;\n  }\n\n  function _templateObject2() {\n    var data = (0, _emberBabel.taggedTemplateLiteralLoose)([\"template:components/-default\"]);\n\n    _templateObject2 = function () {\n      return data;\n    };\n\n    return data;\n  }\n\n  function _templateObject() {\n    var data = (0, _emberBabel.taggedTemplateLiteralLoose)([\"template-compiler:main\"]);\n\n    _templateObject = function () {\n      return data;\n    };\n\n    return data;\n  }\n\n  function isTemplateFactory(template) {\n    return typeof template === 'function';\n  }\n\n  var counters = {\n    cacheHit: 0,\n    cacheMiss: 0\n  };\n  _exports.templateCacheCounters = counters;\n  var TEMPLATE_COMPILER_MAIN = (0, _container.privatize)(_templateObject());\n\n  function template(json) {\n    var glimmerFactory = (0, _opcodeCompiler.templateFactory)(json);\n    var cache = new WeakMap();\n\n    var factory = owner => {\n      var result = cache.get(owner);\n\n      if (result === undefined) {\n        counters.cacheMiss++;\n        var compiler = owner.lookup(TEMPLATE_COMPILER_MAIN);\n        result = glimmerFactory.create(compiler, {\n          owner\n        });\n        cache.set(owner, result);\n      } else {\n        counters.cacheHit++;\n      }\n\n      return result;\n    };\n\n    factory.__id = glimmerFactory.id;\n    factory.__meta = glimmerFactory.meta;\n    return factory;\n  }\n\n  var RootTemplate = template({\n    \"id\": \"hjhxUoru\",\n    \"block\": \"{\\\"symbols\\\":[],\\\"statements\\\":[[1,[28,\\\"component\\\",[[23,0,[]]],null],false]],\\\"hasEval\\\":false}\",\n    \"meta\": {\n      \"moduleName\": \"packages/@ember/-internals/glimmer/lib/templates/root.hbs\"\n    }\n  });\n  /**\n  @module @ember/component\n  */\n\n  _exports.RootTemplate = RootTemplate;\n  var RECOMPUTE_TAG = (0, _utils.symbol)('RECOMPUTE_TAG');\n\n  function isHelperFactory(helper) {\n    return typeof helper === 'object' && helper !== null && helper.class && helper.class.isHelperFactory;\n  }\n\n  function isSimpleHelper(helper) {\n    return helper.destroy === undefined;\n  }\n  /**\n    Ember Helpers are functions that can compute values, and are used in templates.\n    For example, this code calls a helper named `format-currency`:\n  \n    ```app/templates/application.hbs\n    <Cost @cents={{230}} />\n    ```\n  \n    ```app/components/cost.hbs\n    <div>{{format-currency @cents currency=\"$\"}}</div>\n    ```\n  \n    Additionally a helper can be called as a nested helper.\n    In this example, we show the formatted currency value if the `showMoney`\n    named argument is truthy.\n  \n    ```handlebars\n    {{if @showMoney (format-currency @cents currency=\"$\")}}\n    ```\n  \n    Helpers defined using a class must provide a `compute` function. For example:\n  \n    ```app/helpers/format-currency.js\n    import Helper from '@ember/component/helper';\n  \n    export default class extends Helper {\n      compute([cents], { currency }) {\n        return `${currency}${cents * 0.01}`;\n      }\n    }\n    ```\n  \n    Each time the input to a helper changes, the `compute` function will be\n    called again.\n  \n    As instances, these helpers also have access to the container and will accept\n    injected dependencies.\n  \n    Additionally, class helpers can call `recompute` to force a new computation.\n  \n    @class Helper\n    @public\n    @since 1.13.0\n  */\n\n\n  var Helper = _runtime.FrameworkObject.extend({\n    init() {\n      this._super(...arguments);\n\n      this[RECOMPUTE_TAG] = (0, _reference.createTag)();\n    },\n\n    /**\n      On a class-based helper, it may be useful to force a recomputation of that\n      helpers value. This is akin to `rerender` on a component.\n         For example, this component will rerender when the `currentUser` on a\n      session service changes:\n         ```app/helpers/current-user-email.js\n      import Helper from '@ember/component/helper'\n      import { inject as service } from '@ember/service'\n      import { observer } from '@ember/object'\n         export default Helper.extend({\n        session: service(),\n           onNewUser: observer('session.currentUser', function() {\n          this.recompute();\n        }),\n           compute() {\n          return this.get('session.currentUser.email');\n        }\n      });\n      ```\n         @method recompute\n      @public\n      @since 1.13.0\n    */\n    recompute() {\n      (0, _runloop.join)(() => (0, _reference.dirty)(this[RECOMPUTE_TAG]));\n    }\n\n  });\n\n  _exports.Helper = Helper;\n  Helper.isHelperFactory = true;\n  (0, _runtime.setFrameworkClass)(Helper);\n\n  class Wrapper {\n    constructor(compute) {\n      this.compute = compute;\n      this.isHelperFactory = true;\n    }\n\n    create() {\n      // needs new instance or will leak containers\n      return {\n        compute: this.compute\n      };\n    }\n\n  }\n  /**\n    In many cases it is not necessary to use the full `Helper` class.\n    The `helper` method create pure-function helpers without instances.\n    For example:\n  \n    ```app/helpers/format-currency.js\n    import { helper } from '@ember/component/helper';\n  \n    export default helper(function([cents], {currency}) {\n      return `${currency}${cents * 0.01}`;\n    });\n    ```\n  \n    @static\n    @param {Function} helper The helper function\n    @method helper\n    @for @ember/component/helper\n    @public\n    @since 1.13.0\n  */\n\n\n  function helper(helperFn) {\n    return new Wrapper(helperFn);\n  }\n\n  var debugRenderMessage;\n\n  if (true\n  /* DEBUG */\n  ) {\n    debugRenderMessage = renderingStack => {\n      return \"While rendering:\\n----------------\\n\" + renderingStack.replace(/^/gm, '  ');\n    };\n  }\n\n  var debugRenderMessage$1 = debugRenderMessage;\n\n  function toBool(predicate) {\n    if ((0, _runtime.isArray)(predicate)) {\n      return predicate.length !== 0;\n    } else {\n      return Boolean(predicate);\n    }\n  }\n\n  var UPDATE = (0, _utils.symbol)('UPDATE');\n  var INVOKE = (0, _utils.symbol)('INVOKE');\n  _exports.INVOKE = INVOKE;\n  var ACTION = (0, _utils.symbol)('ACTION');\n\n  class EmberPathReference {\n    get(key) {\n      return PropertyReference.create(this, key);\n    }\n\n  }\n\n  class CachedReference$1 extends EmberPathReference {\n    constructor() {\n      super();\n      this.lastRevision = null;\n      this.lastValue = null;\n    }\n\n    value() {\n      var {\n        tag,\n        lastRevision,\n        lastValue\n      } = this;\n\n      if (lastRevision === null || !(0, _reference.validate)(tag, lastRevision)) {\n        lastValue = this.lastValue = this.compute();\n        this.lastRevision = (0, _reference.value)(tag);\n      }\n\n      return lastValue;\n    }\n\n  }\n\n  class RootReference extends _reference.ConstReference {\n    constructor(value$$1, env) {\n      super(value$$1);\n      this.env = env;\n      this.children = Object.create(null);\n    }\n\n    static create(value$$1, env) {\n      return valueToRef(value$$1, true, env);\n    }\n\n    get(propertyKey) {\n      var ref = this.children[propertyKey];\n\n      if (ref === undefined) {\n        ref = this.children[propertyKey] = new RootPropertyReference(this.inner, propertyKey, this.env);\n      }\n\n      return ref;\n    }\n\n  }\n\n  class PropertyReference extends CachedReference$1 {\n    static create(parentReference, propertyKey) {\n      if ((0, _reference.isConst)(parentReference)) {\n        return valueKeyToRef(parentReference.value(), propertyKey);\n      } else {\n        return new NestedPropertyReference(parentReference, propertyKey);\n      }\n    }\n\n    get(key) {\n      return new NestedPropertyReference(this, key);\n    }\n\n  }\n\n  class RootPropertyReference extends PropertyReference {\n    constructor(parentValue, propertyKey, env) {\n      super();\n      this.parentValue = parentValue;\n      this.propertyKey = propertyKey;\n\n      if (true\n      /* DEBUG */\n      ) {\n        // Capture the stack when this reference is created, as that is the\n        // component/context that the component was created _in_. Later, it could\n        // be accessed from any number of components.\n        this.debugStackLog = env ? env.debugRenderTree.logCurrentRenderStack() : '';\n      }\n\n      {\n        this.propertyTag = (0, _reference.createUpdatableTag)();\n      }\n      this.tag = this.propertyTag;\n\n      if (true\n      /* DEBUG */\n      && !true\n      /* EMBER_METAL_TRACKED_PROPERTIES */\n      ) {\n          (0, _metal.watchKey)(parentValue, propertyKey);\n        }\n    }\n\n    compute() {\n      var {\n        parentValue,\n        propertyKey\n      } = this;\n      var ret;\n      {\n        var tag = (0, _metal.track)(() => ret = (0, _metal.get)(parentValue, propertyKey), true\n        /* DEBUG */\n        && debugRenderMessage$1(this['debug']()));\n        (0, _metal.consume)(tag);\n        (0, _reference.update)(this.propertyTag, tag);\n      }\n      return ret;\n    }\n\n    [UPDATE](value$$1) {\n      (0, _metal.set)(this.parentValue, this.propertyKey, value$$1);\n    }\n\n  }\n\n  if (true\n  /* DEBUG */\n  ) {\n    RootPropertyReference.prototype['debug'] = function debug(subPath) {\n      var path = \"this.\" + this['propertyKey'];\n\n      if (subPath) {\n        path += \".\" + subPath;\n      }\n\n      return \"\" + this['debugStackLog'] + path;\n    };\n  }\n\n  class NestedPropertyReference extends PropertyReference {\n    constructor(parentReference, propertyKey) {\n      super();\n      this.parentReference = parentReference;\n      this.propertyKey = propertyKey;\n      var parentReferenceTag = parentReference.tag;\n      var propertyTag = this.propertyTag = (0, _reference.createUpdatableTag)();\n      this.tag = (0, _reference.combine)([parentReferenceTag, propertyTag]);\n    }\n\n    compute() {\n      var {\n        parentReference,\n        propertyTag,\n        propertyKey\n      } = this;\n\n      var _parentValue = parentReference.value();\n\n      var parentValueType = typeof _parentValue;\n\n      if (parentValueType === 'string' && propertyKey === 'length') {\n        return _parentValue.length;\n      }\n\n      if (parentValueType === 'object' && _parentValue !== null || parentValueType === 'function') {\n        var parentValue = _parentValue;\n\n        if (true\n        /* DEBUG */\n        && !true\n        /* EMBER_METAL_TRACKED_PROPERTIES */\n        ) {\n            (0, _metal.watchKey)(parentValue, propertyKey);\n          }\n\n        var ret;\n        {\n          var tag = (0, _metal.track)(() => ret = (0, _metal.get)(parentValue, propertyKey), true\n          /* DEBUG */\n          && debugRenderMessage$1(this['debug']()));\n          (0, _metal.consume)(tag);\n          (0, _reference.update)(propertyTag, tag);\n        }\n        return ret;\n      } else {\n        return undefined;\n      }\n    }\n\n    [UPDATE](value$$1) {\n      (0, _metal.set)(this.parentReference.value()\n      /* let the other side handle the error */\n      , this.propertyKey, value$$1);\n    }\n\n  }\n\n  if (true\n  /* DEBUG */\n  ) {\n    NestedPropertyReference.prototype['debug'] = function debug(subPath) {\n      var parent = this['parentReference'];\n      var path = subPath ? this['propertyKey'] + \".\" + subPath : this['propertyKey'];\n\n      if (typeof parent['debug'] === 'function') {\n        return parent['debug'](path);\n      } else {\n        return \"unknownObject.\" + path;\n      }\n    };\n  }\n\n  class UpdatableReference extends EmberPathReference {\n    constructor(value$$1) {\n      super();\n      this.tag = (0, _reference.createTag)();\n      this._value = value$$1;\n    }\n\n    value() {\n      return this._value;\n    }\n\n    update(value$$1) {\n      var {\n        _value\n      } = this;\n\n      if (value$$1 !== _value) {\n        (0, _reference.dirty)(this.tag);\n        this._value = value$$1;\n      }\n    }\n\n  }\n\n  _exports.UpdatableReference = UpdatableReference;\n\n  class ConditionalReference$1 extends _runtime2.ConditionalReference {\n    static create(reference) {\n      if ((0, _reference.isConst)(reference)) {\n        var value$$1 = reference.value();\n\n        if (!(0, _utils.isProxy)(value$$1)) {\n          return _runtime2.PrimitiveReference.create(toBool(value$$1));\n        }\n      }\n\n      return new ConditionalReference$1(reference);\n    }\n\n    constructor(reference) {\n      super(reference);\n      this.objectTag = (0, _reference.createUpdatableTag)();\n      this.tag = (0, _reference.combine)([reference.tag, this.objectTag]);\n    }\n\n    toBool(predicate) {\n      if ((0, _utils.isProxy)(predicate)) {\n        (0, _reference.update)(this.objectTag, (0, _metal.tagForProperty)(predicate, 'isTruthy'));\n        return Boolean((0, _metal.get)(predicate, 'isTruthy'));\n      } else {\n        (0, _reference.update)(this.objectTag, (0, _metal.tagFor)(predicate));\n        return toBool(predicate);\n      }\n    }\n\n  }\n\n  class SimpleHelperReference extends CachedReference$1 {\n    constructor(helper$$1, args) {\n      super();\n      this.helper = helper$$1;\n      this.args = args;\n      var computeTag = this.computeTag = (0, _reference.createUpdatableTag)();\n      this.tag = (0, _reference.combine)([args.tag, computeTag]);\n    }\n\n    static create(helper$$1, args) {\n      if ((0, _reference.isConst)(args)) {\n        var {\n          positional,\n          named\n        } = args;\n        var positionalValue = positional.value();\n        var namedValue = named.value();\n\n        if (true\n        /* DEBUG */\n        ) {\n          (0, _debug.debugFreeze)(positionalValue);\n          (0, _debug.debugFreeze)(namedValue);\n        }\n\n        var result = helper$$1(positionalValue, namedValue);\n        return valueToRef(result);\n      } else {\n        return new SimpleHelperReference(helper$$1, args);\n      }\n    }\n\n    compute() {\n      var {\n        helper: helper$$1,\n        computeTag,\n        args: {\n          positional,\n          named\n        }\n      } = this;\n      var positionalValue = positional.value();\n      var namedValue = named.value();\n\n      if (true\n      /* DEBUG */\n      ) {\n        (0, _debug.debugFreeze)(positionalValue);\n        (0, _debug.debugFreeze)(namedValue);\n      }\n\n      var computedValue;\n      var combinedTrackingTag = (0, _metal.track)(() => {\n        if (true\n        /* DEBUG */\n        ) {\n          (0, _metal.deprecateMutationsInAutotrackingTransaction)(() => {\n            computedValue = helper$$1(positionalValue, namedValue);\n          });\n        } else {\n          computedValue = helper$$1(positionalValue, namedValue);\n        }\n      }, true\n      /* DEBUG */\n      && debugRenderMessage$1(\"(result of a `\" + (0, _utils.getDebugName)(helper$$1) + \"` helper)\"));\n      (0, _reference.update)(computeTag, combinedTrackingTag);\n      return computedValue;\n    }\n\n  }\n\n  class ClassBasedHelperReference extends CachedReference$1 {\n    constructor(instance, args) {\n      super();\n      this.instance = instance;\n      this.args = args;\n      var computeTag = this.computeTag = (0, _reference.createUpdatableTag)();\n      this.tag = (0, _reference.combine)([instance[RECOMPUTE_TAG], args.tag, computeTag]);\n    }\n\n    static create(instance, args) {\n      return new ClassBasedHelperReference(instance, args);\n    }\n\n    compute() {\n      var {\n        instance,\n        computeTag,\n        args: {\n          positional,\n          named\n        }\n      } = this;\n      var positionalValue = positional.value();\n      var namedValue = named.value();\n\n      if (true\n      /* DEBUG */\n      ) {\n        (0, _debug.debugFreeze)(positionalValue);\n        (0, _debug.debugFreeze)(namedValue);\n      }\n\n      var computedValue;\n      var combinedTrackingTag = (0, _metal.track)(() => {\n        if (true\n        /* DEBUG */\n        ) {\n          (0, _metal.deprecateMutationsInAutotrackingTransaction)(() => {\n            computedValue = instance.compute(positionalValue, namedValue);\n          });\n        } else {\n          computedValue = instance.compute(positionalValue, namedValue);\n        }\n      }, true\n      /* DEBUG */\n      && debugRenderMessage$1(\"(result of a `\" + (0, _utils.getDebugName)(instance) + \"` helper)\"));\n      (0, _reference.update)(computeTag, combinedTrackingTag);\n      return computedValue;\n    }\n\n  }\n\n  class InternalHelperReference extends CachedReference$1 {\n    constructor(helper$$1, args) {\n      super();\n      this.helper = helper$$1;\n      this.args = args;\n      this.tag = args.tag;\n    }\n\n    compute() {\n      var {\n        helper: helper$$1,\n        args\n      } = this;\n      return helper$$1(args);\n    }\n\n  }\n\n  class UnboundReference extends _reference.ConstReference {\n    static create(value$$1) {\n      return valueToRef(value$$1, false);\n    }\n\n    get(key) {\n      return valueToRef(this.inner[key], false);\n    }\n\n  }\n\n  class ReadonlyReference extends CachedReference$1 {\n    constructor(inner) {\n      super();\n      this.inner = inner;\n      this.tag = inner.tag;\n    }\n\n    get [INVOKE]() {\n      return this.inner[INVOKE];\n    }\n\n    compute() {\n      return this.inner.value();\n    }\n\n    get(key) {\n      return this.inner.get(key);\n    }\n\n  }\n\n  function referenceFromParts(root, parts) {\n    var reference = root;\n\n    for (var i = 0; i < parts.length; i++) {\n      reference = reference.get(parts[i]);\n    }\n\n    return reference;\n  }\n\n  function isObject(value$$1) {\n    return value$$1 !== null && typeof value$$1 === 'object';\n  }\n\n  function isFunction(value$$1) {\n    return typeof value$$1 === 'function';\n  }\n\n  function isPrimitive(value$$1) {\n    if (true\n    /* DEBUG */\n    ) {\n      var label;\n\n      try {\n        label = \" (was `\" + String(value$$1) + \"`)\";\n      } catch (e) {\n        label = null;\n      }\n\n      (true && !(value$$1 === undefined || value$$1 === null || typeof value$$1 === 'boolean' || typeof value$$1 === 'number' || typeof value$$1 === 'string') && (0, _debug.assert)(\"This is a fall-through check for typing purposes only! `value` must already be a primitive at this point.\" + label + \")\", value$$1 === undefined || value$$1 === null || typeof value$$1 === 'boolean' || typeof value$$1 === 'number' || typeof value$$1 === 'string'));\n    }\n\n    return true;\n  }\n\n  function valueToRef(value$$1, bound = true, env) {\n    if (isObject(value$$1)) {\n      // root of interop with ember objects\n      return bound ? new RootReference(value$$1, env) : new UnboundReference(value$$1);\n    } else if (isFunction(value$$1)) {\n      // ember doesn't do observing with functions\n      return new UnboundReference(value$$1);\n    } else if (isPrimitive(value$$1)) {\n      return _runtime2.PrimitiveReference.create(value$$1);\n    } else if (true\n    /* DEBUG */\n    ) {\n      var type = typeof value$$1;\n      var output;\n\n      try {\n        output = String(value$$1);\n      } catch (e) {\n        output = null;\n      }\n\n      if (output) {\n        throw (0, _util.unreachable)(\"[BUG] Unexpected \" + type + \" (\" + output + \")\");\n      } else {\n        throw (0, _util.unreachable)(\"[BUG] Unexpected \" + type);\n      }\n    } else {\n      throw (0, _util.unreachable)();\n    }\n  }\n\n  function valueKeyToRef(value$$1, key) {\n    if (isObject(value$$1)) {\n      // root of interop with ember objects\n      return new RootPropertyReference(value$$1, key);\n    } else if (isFunction(value$$1)) {\n      // ember doesn't do observing with functions\n      return new UnboundReference(value$$1[key]);\n    } else if (isPrimitive(value$$1)) {\n      return _runtime2.UNDEFINED_REFERENCE;\n    } else if (true\n    /* DEBUG */\n    ) {\n      var type = typeof value$$1;\n      var output;\n\n      try {\n        output = String(value$$1);\n      } catch (e) {\n        output = null;\n      }\n\n      if (output) {\n        throw (0, _util.unreachable)(\"[BUG] Unexpected \" + type + \" (\" + output + \")\");\n      } else {\n        throw (0, _util.unreachable)(\"[BUG] Unexpected \" + type);\n      }\n    } else {\n      throw (0, _util.unreachable)();\n    }\n  }\n\n  var DIRTY_TAG = (0, _utils.symbol)('DIRTY_TAG');\n  var ARGS = (0, _utils.symbol)('ARGS');\n  var IS_DISPATCHING_ATTRS = (0, _utils.symbol)('IS_DISPATCHING_ATTRS');\n  var HAS_BLOCK = (0, _utils.symbol)('HAS_BLOCK');\n  var BOUNDS = (0, _utils.symbol)('BOUNDS');\n  /**\n  @module @ember/component\n  */\n\n  /**\n    A component is an isolated piece of UI, represented by a template and an\n    optional class. When a component has a class, its template's `this` value\n    is an instance of the component class.\n  \n    ## Template-only Components\n  \n    The simplest way to create a component is to create a template file in\n    `app/templates/components`. For example, if you name a template\n    `app/templates/components/person-profile.hbs`:\n  \n    ```app/templates/components/person-profile.hbs\n    <h1>{{@person.name}}</h1>\n    <img src={{@person.avatar}}>\n    <p class='signature'>{{@person.signature}}</p>\n    ```\n  \n    You will be able to use `<PersonProfile />` to invoke this component elsewhere\n    in your application:\n  \n    ```app/templates/application.hbs\n    <PersonProfile @person={{this.currentUser}} />\n    ```\n  \n    Note that component names are capitalized here in order to distinguish them\n    from regular HTML elements, but they are dasherized in the file system.\n  \n    While the angle bracket invocation form is generally preferred, it is also\n    possible to invoke the same component with the `{{person-profile}}` syntax:\n  \n    ```app/templates/application.hbs\n    {{person-profile person=this.currentUser}}\n    ```\n  \n    Note that with this syntax, you use dashes in the component name and\n    arguments are passed without the `@` sign.\n  \n    In both cases, Ember will render the content of the component template we\n    created above. The end result will be something like this:\n  \n    ```html\n    <h1>Tomster</h1>\n    <img src=\"https://emberjs.com/tomster.jpg\">\n    <p class='signature'>Out of office this week</p>\n    ```\n  \n    ## File System Nesting\n  \n    Components can be nested inside sub-folders for logical groupping. For\n    example, if we placed our template in\n    `app/templates/components/person/short-profile.hbs`, we can invoke it as\n    `<Person::ShortProfile />`:\n  \n    ```app/templates/application.hbs\n    <Person::ShortProfile @person={{this.currentUser}} />\n    ```\n  \n    Or equivalently, `{{person/short-profile}}`:\n  \n    ```app/templates/application.hbs\n    {{person/short-profile person=this.currentUser}}\n    ```\n  \n    ## Yielding Contents\n  \n    You can use `yield` inside a template to include the **contents** of any block\n    attached to the component. The block will be executed in its original context:\n  \n    ```handlebars\n    <PersonProfile @person={{this.currentUser}}>\n      <p>Admin mode</p>\n      {{! Executed in the current context. }}\n    </PersonProfile>\n    ```\n  \n    or\n  \n    ```handlebars\n    {{#person-profile person=this.currentUser}}\n      <p>Admin mode</p>\n      {{! Executed in the current context. }}\n    {{/person-profile}}\n    ```\n  \n    ```app/templates/components/person-profile.hbs\n    <h1>{{@person.name}}</h1>\n    {{yield}}\n    ```\n  \n    ## Customizing Components With JavaScript\n  \n    If you want to customize the component in order to handle events, transform\n    arguments or maintain internal state, you implement a subclass of `Component`.\n  \n    One example is to add computed properties to your component:\n  \n    ```app/components/person-profile.js\n    import Component from '@ember/component';\n  \n    export default Component.extend({\n      displayName: computed('person.title', 'person.firstName', 'person.lastName', function() {\n        let { title, firstName, lastName } = this;\n  \n        if (title) {\n          return `${title} ${lastName}`;\n        } else {\n          return `${firstName} ${lastName}`;\n        }\n      })\n    });\n    ```\n  \n    And then use it in the component's template:\n  \n    ```app/templates/components/person-profile.hbs\n    <h1>{{this.displayName}}</h1>\n    {{yield}}\n    ```\n  \n    ## Customizing a Component's HTML Element in JavaScript\n  \n    ### HTML Tag\n  \n    The default HTML tag name used for a component's HTML representation is `div`.\n    This can be customized by setting the `tagName` property.\n  \n    Consider the following component class:\n  \n    ```app/components/emphasized-paragraph.js\n    import Component from '@ember/component';\n  \n    export default Component.extend({\n      tagName: 'em'\n    });\n    ```\n  \n    When invoked, this component would produce output that looks something like\n    this:\n  \n    ```html\n    <em id=\"ember1\" class=\"ember-view\"></em>\n    ```\n  \n    ### HTML `class` Attribute\n  \n    The HTML `class` attribute of a component's tag can be set by providing a\n    `classNames` property that is set to an array of strings:\n  \n    ```app/components/my-widget.js\n    import Component from '@ember/component';\n  \n    export default Component.extend({\n      classNames: ['my-class', 'my-other-class']\n    });\n    ```\n  \n    Invoking this component will produce output that looks like this:\n  \n    ```html\n    <div id=\"ember1\" class=\"ember-view my-class my-other-class\"></div>\n    ```\n  \n    `class` attribute values can also be set by providing a `classNameBindings`\n    property set to an array of properties names for the component. The return\n    value of these properties will be added as part of the value for the\n    components's `class` attribute. These properties can be computed properties:\n  \n    ```app/components/my-widget.js\n    import Component from '@ember/component';\n    import { computed } from '@ember/object';\n  \n    export default Component.extend({\n      classNames: ['my-class', 'my-other-class'],\n      classNameBindings: ['propertyA', 'propertyB'],\n  \n      propertyA: 'from-a',\n      propertyB: computed(function() {\n        if (someLogic) { return 'from-b'; }\n      })\n    });\n    ```\n  \n    Invoking this component will produce HTML that looks like:\n  \n    ```html\n    <div id=\"ember1\" class=\"ember-view my-class my-other-class from-a from-b\"></div>\n    ```\n  \n    Note that `classNames` and `classNameBindings` is in addition to the `class`\n    attribute passed with the angle bracket invocation syntax. Therefore, if this\n    component was invoked like so:\n  \n    ```handlebars\n    <MyWidget class=\"from-invocation\" />\n    ```\n  \n    The resulting HTML will look similar to this:\n  \n    ```html\n    <div id=\"ember1\" class=\"from-invocation ember-view my-class my-other-class from-a from-b\"></div>\n    ```\n  \n    If the value of a class name binding returns a boolean the property name\n    itself will be used as the class name if the property is true. The class name\n    will not be added if the value is `false` or `undefined`.\n  \n    ```app/components/my-widget.js\n    import Component from '@ember/component';\n  \n    export default Component.extend({\n      classNameBindings: ['hovered'],\n  \n      hovered: true\n    });\n    ```\n  \n    Invoking this component will produce HTML that looks like:\n  \n    ```html\n    <div id=\"ember1\" class=\"ember-view hovered\"></div>\n    ```\n  \n    ### Custom Class Names for Boolean Values\n  \n    When using boolean class name bindings you can supply a string value other\n    than the property name for use as the `class` HTML attribute by appending the\n    preferred value after a \":\" character when defining the binding:\n  \n    ```app/components/my-widget.js\n    import Component from '@ember/component';\n  \n    export default Component.extend({\n      classNameBindings: ['awesome:so-very-cool'],\n  \n      awesome: true\n    });\n    ```\n  \n    Invoking this component will produce HTML that looks like:\n  \n    ```html\n    <div id=\"ember1\" class=\"ember-view so-very-cool\"></div>\n    ```\n  \n    Boolean value class name bindings whose property names are in a\n    camelCase-style format will be converted to a dasherized format:\n  \n    ```app/components/my-widget.js\n    import Component from '@ember/component';\n  \n    export default Component.extend({\n      classNameBindings: ['isUrgent'],\n  \n      isUrgent: true\n    });\n    ```\n  \n    Invoking this component will produce HTML that looks like:\n  \n    ```html\n    <div id=\"ember1\" class=\"ember-view is-urgent\"></div>\n    ```\n  \n    Class name bindings can also refer to object values that are found by\n    traversing a path relative to the component itself:\n  \n    ```app/components/my-widget.js\n    import Component from '@ember/component';\n    import EmberObject from '@ember/object';\n  \n    export default Component.extend({\n      classNameBindings: ['messages.empty'],\n  \n      messages: EmberObject.create({\n        empty: true\n      })\n    });\n    ```\n  \n    Invoking this component will produce HTML that looks like:\n  \n    ```html\n    <div id=\"ember1\" class=\"ember-view empty\"></div>\n    ```\n  \n    If you want to add a class name for a property which evaluates to true and\n    and a different class name if it evaluates to false, you can pass a binding\n    like this:\n  \n    ```app/components/my-widget.js\n    import Component from '@ember/component';\n  \n    export default Component.extend({\n      classNameBindings: ['isEnabled:enabled:disabled'],\n      isEnabled: true\n    });\n    ```\n  \n    Invoking this component will produce HTML that looks like:\n  \n    ```html\n    <div id=\"ember1\" class=\"ember-view enabled\"></div>\n    ```\n  \n    When isEnabled is `false`, the resulting HTML representation looks like this:\n  \n    ```html\n    <div id=\"ember1\" class=\"ember-view disabled\"></div>\n    ```\n  \n    This syntax offers the convenience to add a class if a property is `false`:\n  \n    ```app/components/my-widget.js\n    import Component from '@ember/component';\n  \n    // Applies no class when isEnabled is true and class 'disabled' when isEnabled is false\n    export default Component.extend({\n      classNameBindings: ['isEnabled::disabled'],\n      isEnabled: true\n    });\n    ```\n  \n    Invoking this component when the `isEnabled` property is true will produce\n    HTML that looks like:\n  \n    ```html\n    <div id=\"ember1\" class=\"ember-view\"></div>\n    ```\n  \n    Invoking it when the `isEnabled` property on the component is `false` will\n    produce HTML that looks like:\n  \n    ```html\n    <div id=\"ember1\" class=\"ember-view disabled\"></div>\n    ```\n  \n    Updates to the value of a class name binding will result in automatic update\n    of the  HTML `class` attribute in the component's rendered HTML\n    representation. If the value becomes `false` or `undefined` the class name\n    will be removed.\n  \n    Both `classNames` and `classNameBindings` are concatenated properties. See\n    [EmberObject](/ember/release/classes/EmberObject) documentation for more\n    information about concatenated properties.\n  \n    ### Other HTML Attributes\n  \n    The HTML attribute section of a component's tag can be set by providing an\n    `attributeBindings` property set to an array of property names on the component.\n    The return value of these properties will be used as the value of the component's\n    HTML associated attribute:\n  \n    ```app/components/my-anchor.js\n    import Component from '@ember/component';\n  \n    export default Component.extend({\n      tagName: 'a',\n      attributeBindings: ['href'],\n  \n      href: 'http://google.com'\n    });\n    ```\n  \n    Invoking this component will produce HTML that looks like:\n  \n    ```html\n    <a id=\"ember1\" class=\"ember-view\" href=\"http://google.com\"></a>\n    ```\n  \n    One property can be mapped on to another by placing a \":\" between\n    the source property and the destination property:\n  \n    ```app/components/my-anchor.js\n    import Component from '@ember/component';\n  \n    export default Component.extend({\n      tagName: 'a',\n      attributeBindings: ['url:href'],\n  \n      url: 'http://google.com'\n    });\n    ```\n  \n    Invoking this component will produce HTML that looks like:\n  \n    ```html\n    <a id=\"ember1\" class=\"ember-view\" href=\"http://google.com\"></a>\n    ```\n  \n    HTML attributes passed with angle bracket invocations will take precedence\n    over those specified in `attributeBindings`. Therefore, if this component was\n    invoked like so:\n  \n    ```handlebars\n    <MyAnchor href=\"http://bing.com\" @url=\"http://google.com\" />\n    ```\n  \n    The resulting HTML will looks like this:\n  \n    ```html\n    <a id=\"ember1\" class=\"ember-view\" href=\"http://bing.com\"></a>\n    ```\n  \n    Note that the `href` attribute is ultimately set to `http://bing.com`,\n    despite it having attribute binidng to the `url` property, which was\n    set to `http://google.com`.\n  \n    Namespaced attributes (e.g. `xlink:href`) are supported, but have to be\n    mapped, since `:` is not a valid character for properties in Javascript:\n  \n    ```app/components/my-use.js\n    import Component from '@ember/component';\n  \n    export default Component.extend({\n      tagName: 'use',\n      attributeBindings: ['xlinkHref:xlink:href'],\n  \n      xlinkHref: '#triangle'\n    });\n    ```\n  \n    Invoking this component will produce HTML that looks like:\n  \n    ```html\n    <use xlink:href=\"#triangle\"></use>\n    ```\n  \n    If the value of a property monitored by `attributeBindings` is a boolean, the\n    attribute will be present or absent depending on the value:\n  \n    ```app/components/my-text-input.js\n    import Component from '@ember/component';\n  \n    export default Component.extend({\n      tagName: 'input',\n      attributeBindings: ['disabled'],\n  \n      disabled: false\n    });\n    ```\n  \n    Invoking this component will produce HTML that looks like:\n  \n    ```html\n    <input id=\"ember1\" class=\"ember-view\" />\n    ```\n  \n    `attributeBindings` can refer to computed properties:\n  \n    ```app/components/my-text-input.js\n    import Component from '@ember/component';\n    import { computed } from '@ember/object';\n  \n    export default Component.extend({\n      tagName: 'input',\n      attributeBindings: ['disabled'],\n  \n      disabled: computed(function() {\n        if (someLogic) {\n          return true;\n        } else {\n          return false;\n        }\n      })\n    });\n    ```\n  \n    To prevent setting an attribute altogether, use `null` or `undefined` as the\n    value of the property used in `attributeBindings`:\n  \n    ```app/components/my-text-input.js\n    import Component from '@ember/component';\n  \n    export default Component.extend({\n      tagName: 'form',\n      attributeBindings: ['novalidate'],\n      novalidate: null\n    });\n    ```\n  \n    Updates to the property of an attribute binding will result in automatic\n    update of the  HTML attribute in the component's HTML output.\n  \n    `attributeBindings` is a concatenated property. See\n    [EmberObject](/ember/release/classes/EmberObject) documentation for more\n    information about concatenated properties.\n  \n    ## Layouts\n  \n    The `layout` property can be used to dynamically specify a template associated\n    with a component class, instead of relying on Ember to link together a\n    component class and a template based on file names.\n  \n    In general, applications should not use this feature, but it's commonly used\n    in addons for historical reasons.\n  \n    The `layout` property should be set to the default export of a template\n    module, which is the name of a template file without the `.hbs` extension.\n  \n    ```app/templates/components/person-profile.hbs\n    <h1>Person's Title</h1>\n    <div class='details'>{{yield}}</div>\n    ```\n  \n    ```app/components/person-profile.js\n      import Component from '@ember/component';\n      import layout from '../templates/components/person-profile';\n  \n      export default Component.extend({\n        layout\n      });\n    ```\n  \n    If you invoke the component:\n  \n    ```handlebars\n    <PersonProfile>\n      <h2>Chief Basket Weaver</h2>\n      <h3>Fisherman Industries</h3>\n    </PersonProfile>\n    ```\n  \n    or\n  \n    ```handlebars\n    {{#person-profile}}\n      <h2>Chief Basket Weaver</h2>\n      <h3>Fisherman Industries</h3>\n    {{/person-profile}}\n    ```\n  \n    It will result in the following HTML output:\n  \n    ```html\n    <h1>Person's Title</h1>\n      <div class=\"details\">\n      <h2>Chief Basket Weaver</h2>\n      <h3>Fisherman Industries</h3>\n    </div>\n    ```\n  \n    ## Handling Browser Events\n  \n    Components can respond to user-initiated events in one of three ways: passing\n    actions with angle bracket invocation, adding event handler methods to the\n    component's class, or adding actions to the component's template.\n  \n    ### Passing Actions With Angle Bracket Invoation\n  \n    For one-off events specific to particular instance of a component, it is possible\n    to pass actions to the component's element using angle bracket invoation syntax.\n  \n    ```handlebars\n    <MyWidget {{action 'firstWidgetClicked'}} />\n  \n    <MyWidget {{action 'secondWidgetClicked'}} />\n    ```\n  \n    In this case, when the first component is clicked on, Ember will invoke the\n    `firstWidgetClicked` action. When the second component is clicked on, Ember\n    will invoke the `secondWidgetClicked` action instead.\n  \n    Besides `{{action}}`, it is also possible to pass any arbitrary element modifiers\n    using the angle bracket invocation syntax.\n  \n    ### Event Handler Methods\n  \n    Components can also respond to user-initiated events by implementing a method\n    that matches the event name. This approach is appropiate when the same event\n    should be handled by all instances of the same component.\n  \n    An event object will be passed as the argument to the event handler method.\n  \n    ```app/components/my-widget.js\n    import Component from '@ember/component';\n  \n    export default Component.extend({\n      click(event) {\n        // `event.target` is either the component's element or one of its children\n        let tag = event.target.tagName.toLowerCase();\n        console.log('clicked on a `<${tag}>` HTML element!');\n      }\n    });\n    ```\n  \n    In this example, whenever the user clicked anywhere inside the component, it\n    will log a message to the console.\n  \n    It is possible to handle event types other than `click` by implementing the\n    following event handler methods. In addition, custom events can be registered\n    by using `Application.customEvents`.\n  \n    Touch events:\n  \n    * `touchStart`\n    * `touchMove`\n    * `touchEnd`\n    * `touchCancel`\n  \n    Keyboard events:\n  \n    * `keyDown`\n    * `keyUp`\n    * `keyPress`\n  \n    Mouse events:\n  \n    * `mouseDown`\n    * `mouseUp`\n    * `contextMenu`\n    * `click`\n    * `doubleClick`\n    * `focusIn`\n    * `focusOut`\n  \n    Form events:\n  \n    * `submit`\n    * `change`\n    * `focusIn`\n    * `focusOut`\n    * `input`\n  \n    Drag and drop events:\n  \n    * `dragStart`\n    * `drag`\n    * `dragEnter`\n    * `dragLeave`\n    * `dragOver`\n    * `dragEnd`\n    * `drop`\n  \n    ### `{{action}}` Helper\n  \n    Instead of handling all events of a particular type anywhere inside the\n    component's element, you may instead want to limit it to a particular\n    element in the component's template. In this case, it would be more\n    convenient to implement an action instead.\n  \n    For example, you could implement the action `hello` for the `person-profile`\n    component:\n  \n    ```app/components/person-profile.js\n    import Component from '@ember/component';\n  \n    export default Component.extend({\n      actions: {\n        hello(name) {\n          console.log(\"Hello\", name);\n        }\n      }\n    });\n    ```\n  \n    And then use it in the component's template:\n  \n    ```app/templates/components/person-profile.hbs\n    <h1>{{@person.name}}</h1>\n  \n    <button {{action 'hello' @person.name}}>\n      Say Hello to {{@person.name}}\n    </button>\n    ```\n  \n    When the user clicks the button, Ember will invoke the `hello` action,\n    passing in the current value of `@person.name` as an argument.\n  \n    See [Ember.Templates.helpers.action](/ember/release/classes/Ember.Templates.helpers/methods/action?anchor=action).\n  \n    @class Component\n    @extends Ember.CoreView\n    @uses Ember.TargetActionSupport\n    @uses Ember.ClassNamesSupport\n    @uses Ember.ActionSupport\n    @uses Ember.ViewMixin\n    @uses Ember.ViewStateSupport\n    @public\n  */\n\n  var Component = _views.CoreView.extend(_views.ChildViewsSupport, _views.ViewStateSupport, _views.ClassNamesSupport, _runtime.TargetActionSupport, _views.ActionSupport, _views.ViewMixin, {\n    isComponent: true,\n\n    init() {\n      this._super(...arguments);\n\n      this[IS_DISPATCHING_ATTRS] = false;\n      this[DIRTY_TAG] = (0, _reference.createTag)();\n      this[BOUNDS] = null;\n\n      if (true\n      /* DEBUG */\n      && this.renderer._destinedForDOM && this.tagName === '') {\n        var eventNames = [];\n        var eventDispatcher = (0, _owner.getOwner)(this).lookup('event_dispatcher:main');\n        var events = eventDispatcher && eventDispatcher._finalEvents || {}; // tslint:disable-next-line:forin\n\n        for (var key in events) {\n          var methodName = events[key];\n\n          if (typeof this[methodName] === 'function') {\n            eventNames.push(methodName);\n          }\n        } // If in a tagless component, assert that no event handlers are defined\n\n\n        (true && !(!eventNames.length) && (0, _debug.assert)( // tslint:disable-next-line:max-line-length\n        \"You can not define `\" + eventNames + \"` function(s) to handle DOM event in the `\" + this + \"` tagless component since it doesn't have any DOM element.\", !eventNames.length));\n      }\n\n      (true && !(this.mouseEnter === undefined) && (0, _debug.deprecate)(this + \": Using `mouseEnter` event handler methods in components has been deprecated.\", this.mouseEnter === undefined, {\n        id: 'ember-views.event-dispatcher.mouseenter-leave-move',\n        until: '4.0.0',\n        url: 'https://emberjs.com/deprecations/v3.x#toc_component-mouseenter-leave-move'\n      }));\n      (true && !(this.mouseLeave === undefined) && (0, _debug.deprecate)(this + \": Using `mouseLeave` event handler methods in components has been deprecated.\", this.mouseLeave === undefined, {\n        id: 'ember-views.event-dispatcher.mouseenter-leave-move',\n        until: '4.0.0',\n        url: 'https://emberjs.com/deprecations/v3.x#toc_component-mouseenter-leave-move'\n      }));\n      (true && !(this.mouseMove === undefined) && (0, _debug.deprecate)(this + \": Using `mouseMove` event handler methods in components has been deprecated.\", this.mouseMove === undefined, {\n        id: 'ember-views.event-dispatcher.mouseenter-leave-move',\n        until: '4.0.0',\n        url: 'https://emberjs.com/deprecations/v3.x#toc_component-mouseenter-leave-move'\n      }));\n    },\n\n    rerender() {\n      (0, _reference.dirty)(this[DIRTY_TAG]);\n\n      this._super();\n    },\n\n    [_metal.PROPERTY_DID_CHANGE](key) {\n      if (this[IS_DISPATCHING_ATTRS]) {\n        return;\n      }\n\n      var args = this[ARGS];\n      var reference = args !== undefined ? args[key] : undefined;\n\n      if (reference !== undefined && reference[UPDATE] !== undefined) {\n        reference[UPDATE]((0, _metal.get)(this, key));\n      }\n    },\n\n    getAttr(key) {\n      // TODO Intimate API should be deprecated\n      return this.get(key);\n    },\n\n    /**\n      Normally, Ember's component model is \"write-only\". The component takes a\n      bunch of attributes that it got passed in, and uses them to render its\n      template.\n       One nice thing about this model is that if you try to set a value to the\n      same thing as last time, Ember (through HTMLBars) will avoid doing any\n      work on the DOM.\n       This is not just a performance optimization. If an attribute has not\n      changed, it is important not to clobber the element's \"hidden state\".\n      For example, if you set an input's `value` to the same value as before,\n      it will clobber selection state and cursor position. In other words,\n      setting an attribute is not **always** idempotent.\n       This method provides a way to read an element's attribute and also\n      update the last value Ember knows about at the same time. This makes\n      setting an attribute idempotent.\n       In particular, what this means is that if you get an `<input>` element's\n      `value` attribute and then re-render the template with the same value,\n      it will avoid clobbering the cursor and selection position.\n      Since most attribute sets are idempotent in the browser, you typically\n      can get away with reading attributes using jQuery, but the most reliable\n      way to do so is through this method.\n      @method readDOMAttr\n       @param {String} name the name of the attribute\n      @return String\n      @public\n     */\n    readDOMAttr(name) {\n      // TODO revisit this\n      var _element = (0, _views.getViewElement)(this);\n\n      (true && !(_element !== null) && (0, _debug.assert)(\"Cannot call `readDOMAttr` on \" + this + \" which does not have an element\", _element !== null));\n      var element = _element;\n      var isSVG = element.namespaceURI === _runtime2.SVG_NAMESPACE;\n      var {\n        type,\n        normalized\n      } = (0, _runtime2.normalizeProperty)(element, name);\n\n      if (isSVG || type === 'attr') {\n        return element.getAttribute(normalized);\n      }\n\n      return element[normalized];\n    },\n\n    /**\n     The WAI-ARIA role of the control represented by this view. For example, a\n     button may have a role of type 'button', or a pane may have a role of\n     type 'alertdialog'. This property is used by assistive software to help\n     visually challenged users navigate rich web applications.\n      The full list of valid WAI-ARIA roles is available at:\n     [https://www.w3.org/TR/wai-aria/#roles_categorization](https://www.w3.org/TR/wai-aria/#roles_categorization)\n      @property ariaRole\n     @type String\n     @default null\n     @public\n     */\n\n    /**\n     Enables components to take a list of parameters as arguments.\n     For example, a component that takes two parameters with the names\n     `name` and `age`:\n      ```app/components/my-component.js\n     import Component from '@ember/component';\n      let MyComponent = Component.extend();\n      MyComponent.reopenClass({\n       positionalParams: ['name', 'age']\n     });\n      export default MyComponent;\n     ```\n      It can then be invoked like this:\n      ```hbs\n     {{my-component \"John\" 38}}\n     ```\n      The parameters can be referred to just like named parameters:\n      ```hbs\n     Name: {{name}}, Age: {{age}}.\n     ```\n      Using a string instead of an array allows for an arbitrary number of\n     parameters:\n      ```app/components/my-component.js\n     import Component from '@ember/component';\n      let MyComponent = Component.extend();\n      MyComponent.reopenClass({\n       positionalParams: 'names'\n     });\n      export default MyComponent;\n     ```\n      It can then be invoked like this:\n      ```hbs\n     {{my-component \"John\" \"Michael\" \"Scott\"}}\n     ```\n     The parameters can then be referred to by enumerating over the list:\n      ```hbs\n     {{#each names as |name|}}{{name}}{{/each}}\n     ```\n      @static\n     @public\n     @property positionalParams\n     @since 1.13.0\n     */\n\n    /**\n     Called when the attributes passed into the component have been updated.\n     Called both during the initial render of a container and during a rerender.\n     Can be used in place of an observer; code placed here will be executed\n     every time any attribute updates.\n     @method didReceiveAttrs\n     @public\n     @since 1.13.0\n     */\n    didReceiveAttrs() {},\n\n    /**\n     Called when the attributes passed into the component have been updated.\n     Called both during the initial render of a container and during a rerender.\n     Can be used in place of an observer; code placed here will be executed\n     every time any attribute updates.\n     @event didReceiveAttrs\n     @public\n     @since 1.13.0\n     */\n\n    /**\n     Called after a component has been rendered, both on initial render and\n     in subsequent rerenders.\n     @method didRender\n     @public\n     @since 1.13.0\n     */\n    didRender() {},\n\n    /**\n     Called after a component has been rendered, both on initial render and\n     in subsequent rerenders.\n     @event didRender\n     @public\n     @since 1.13.0\n     */\n\n    /**\n     Called before a component has been rendered, both on initial render and\n     in subsequent rerenders.\n     @method willRender\n     @public\n     @since 1.13.0\n     */\n    willRender() {},\n\n    /**\n     Called before a component has been rendered, both on initial render and\n     in subsequent rerenders.\n     @event willRender\n     @public\n     @since 1.13.0\n     */\n\n    /**\n     Called when the attributes passed into the component have been changed.\n     Called only during a rerender, not during an initial render.\n     @method didUpdateAttrs\n     @public\n     @since 1.13.0\n     */\n    didUpdateAttrs() {},\n\n    /**\n     Called when the attributes passed into the component have been changed.\n     Called only during a rerender, not during an initial render.\n     @event didUpdateAttrs\n     @public\n     @since 1.13.0\n     */\n\n    /**\n     Called when the component is about to update and rerender itself.\n     Called only during a rerender, not during an initial render.\n     @method willUpdate\n     @public\n     @since 1.13.0\n     */\n    willUpdate() {},\n\n    /**\n     Called when the component is about to update and rerender itself.\n     Called only during a rerender, not during an initial render.\n     @event willUpdate\n     @public\n     @since 1.13.0\n     */\n\n    /**\n     Called when the component has updated and rerendered itself.\n     Called only during a rerender, not during an initial render.\n     @method didUpdate\n     @public\n     @since 1.13.0\n     */\n    didUpdate() {}\n\n  });\n\n  _exports.Component = Component;\n\n  Component.toString = () => '@ember/component';\n\n  Component.reopenClass({\n    isComponentFactory: true,\n    positionalParams: []\n  });\n  (0, _runtime.setFrameworkClass)(Component);\n  var layout = template({\n    \"id\": \"hvtsz7RF\",\n    \"block\": \"{\\\"symbols\\\":[],\\\"statements\\\":[],\\\"hasEval\\\":false}\",\n    \"meta\": {\n      \"moduleName\": \"packages/@ember/-internals/glimmer/lib/templates/empty.hbs\"\n    }\n  });\n  /**\n  @module @ember/component\n  */\n\n  /**\n    The internal class used to create text inputs when the `{{input}}`\n    helper is used with `type` of `checkbox`.\n  \n    See [Ember.Templates.helpers.input](/ember/release/classes/Ember.Templates.helpers/methods/input?anchor=input)  for usage details.\n  \n    ## Direct manipulation of `checked`\n  \n    The `checked` attribute of an `Checkbox` object should always be set\n    through the Ember object or by interacting with its rendered element\n    representation via the mouse, keyboard, or touch. Updating the value of the\n    checkbox via jQuery will result in the checked value of the object and its\n    element losing synchronization.\n  \n    ## Layout and LayoutName properties\n  \n    Because HTML `input` elements are self closing `layout` and `layoutName`\n    properties will not be applied.\n  \n    @class Checkbox\n    @extends Component\n    @public\n  */\n\n  var Checkbox = Component.extend({\n    layout,\n\n    /**\n      By default, this component will add the `ember-checkbox` class to the component's element.\n         @property classNames\n      @type Array | String\n      @default ['ember-checkbox']\n      @public\n     */\n    classNames: ['ember-checkbox'],\n    tagName: 'input',\n\n    /**\n      By default this component will forward a number of arguments to attributes on the the\n      component's element:\n         * indeterminate\n      * disabled\n      * tabindex\n      * name\n      * autofocus\n      * required\n      * form\n         When invoked with curly braces, this is the exhaustive list of HTML attributes you can\n      customize (i.e. `{{input type=\"checkbox\" disabled=true}}`).\n         When invoked with angle bracket invocation, this list is irrelevant, because you can use HTML\n      attribute syntax to customize the element (i.e.\n      `<Input @type=\"checkbox\" disabled data-custom=\"custom value\" />`). However, `@type` and\n      `@checked` must be passed as named arguments, not attributes.\n         @property attributeBindings\n      @type Array | String\n      @default ['type', 'checked', 'indeterminate', 'disabled', 'tabindex', 'name', 'autofocus', 'required', 'form']\n      @public\n    */\n    attributeBindings: ['type', 'checked', 'indeterminate', 'disabled', 'tabindex', 'name', 'autofocus', 'required', 'form'],\n\n    /**\n      Sets the `type` attribute of the `Checkbox`'s element\n         @property disabled\n      @default false\n      @private\n     */\n    type: 'checkbox',\n\n    /**\n      Sets the `disabled` attribute of the `Checkbox`'s element\n         @property disabled\n      @default false\n      @public\n     */\n    disabled: false,\n\n    /**\n      Corresponds to the `indeterminate` property of the `Checkbox`'s element\n         @property disabled\n      @default false\n      @public\n     */\n    indeterminate: false,\n\n    /**\n      Whenever the checkbox is inserted into the DOM, perform initialization steps, which include\n      setting the indeterminate property if needed.\n         If this method is overridden, `super` must be called.\n         @method\n      @public\n     */\n    didInsertElement() {\n      this._super(...arguments);\n\n      this.element.indeterminate = Boolean(this.indeterminate);\n    },\n\n    /**\n      Whenever the `change` event is fired on the checkbox, update its `checked` property to reflect\n      whether the checkbox is checked.\n         If this method is overridden, `super` must be called.\n         @method\n      @public\n     */\n    change() {\n      (0, _metal.set)(this, 'checked', this.element.checked);\n    }\n\n  });\n  _exports.Checkbox = Checkbox;\n\n  if (true\n  /* DEBUG */\n  ) {\n    var UNSET = {};\n    Checkbox.reopen({\n      value: UNSET,\n\n      didReceiveAttrs() {\n        this._super();\n\n        (true && !(!(this.type === 'checkbox' && this.value !== UNSET)) && (0, _debug.assert)(\"`<Input @type='checkbox' @value={{...}} />` is not supported; \" + \"please use `<Input @type='checkbox' @checked={{...}} />` instead.\", !(this.type === 'checkbox' && this.value !== UNSET)));\n      }\n\n    });\n  }\n\n  Checkbox.toString = () => '@ember/component/checkbox';\n  /**\n  @module @ember/component\n  */\n\n\n  var inputTypes = _browserEnvironment.hasDOM ? Object.create(null) : null;\n\n  function canSetTypeOfInput(type) {\n    // if running in outside of a browser always return\n    // the original type\n    if (!_browserEnvironment.hasDOM) {\n      return Boolean(type);\n    }\n\n    if (type in inputTypes) {\n      return inputTypes[type];\n    }\n\n    var inputTypeTestElement = document.createElement('input');\n\n    try {\n      inputTypeTestElement.type = type;\n    } catch (e) {// ignored\n    }\n\n    return inputTypes[type] = inputTypeTestElement.type === type;\n  }\n  /**\n    The internal class used to create text inputs when the `Input` component is used with `type` of `text`.\n  \n    See [Ember.Templates.components.Input](/ember/release/classes/Ember.Templates.components/methods/Input?anchor=Input) for usage details.\n  \n    ## Layout and LayoutName properties\n  \n    Because HTML `input` elements are self closing `layout` and `layoutName`\n    properties will not be applied.\n  \n    @class TextField\n    @extends Component\n    @uses Ember.TextSupport\n    @public\n  */\n\n\n  var TextField = Component.extend(_views.TextSupport, {\n    layout,\n\n    /**\n      By default, this component will add the `ember-text-field` class to the component's element.\n         @property classNames\n      @type Array | String\n      @default ['ember-text-field']\n      @public\n     */\n    classNames: ['ember-text-field'],\n    tagName: 'input',\n\n    /**\n      By default this component will forward a number of arguments to attributes on the the\n      component's element:\n         * accept\n      * autocomplete\n      * autosave\n      * dir\n      * formaction\n      * formenctype\n      * formmethod\n      * formnovalidate\n      * formtarget\n      * height\n      * inputmode\n      * lang\n      * list\n      * type\n      * max\n      * min\n      * multiple\n      * name\n      * pattern\n      * size\n      * step\n      * value\n      * width\n         When invoked with `{{input type=\"text\"}}`, you can only customize these attributes. When invoked\n      with `<Input @type=\"text\" />`, you can just use HTML attributes directly.\n         @property attributeBindings\n      @type Array | String\n      @default ['accept', 'autocomplete', 'autosave', 'dir', 'formaction', 'formenctype', 'formmethod', 'formnovalidate', 'formtarget', 'height', 'inputmode', 'lang', 'list', 'type', 'max', 'min', 'multiple', 'name', 'pattern', 'size', 'step', 'value', 'width']\n      @public\n    */\n    attributeBindings: ['accept', 'autocomplete', 'autosave', 'dir', 'formaction', 'formenctype', 'formmethod', 'formnovalidate', 'formtarget', 'height', 'inputmode', 'lang', 'list', 'type', 'max', 'min', 'multiple', 'name', 'pattern', 'size', 'step', 'value', 'width'],\n\n    /**\n      As the user inputs text, this property is updated to reflect the `value` property of the HTML\n      element.\n         @property value\n      @type String\n      @default \"\"\n      @public\n    */\n    value: '',\n\n    /**\n      The `type` attribute of the input element.\n         @property type\n      @type String\n      @default \"text\"\n      @public\n    */\n    type: (0, _metal.computed)({\n      get() {\n        return 'text';\n      },\n\n      set(_key, value$$1) {\n        var type = 'text';\n\n        if (canSetTypeOfInput(value$$1)) {\n          type = value$$1;\n        }\n\n        return type;\n      }\n\n    }),\n\n    /**\n      The `size` of the text field in characters.\n         @property size\n      @type String\n      @default null\n      @public\n    */\n    size: null,\n\n    /**\n      The `pattern` attribute of input element.\n         @property pattern\n      @type String\n      @default null\n      @public\n    */\n    pattern: null,\n\n    /**\n      The `min` attribute of input element used with `type=\"number\"` or `type=\"range\"`.\n         @property min\n      @type String\n      @default null\n      @since 1.4.0\n      @public\n    */\n    min: null,\n\n    /**\n      The `max` attribute of input element used with `type=\"number\"` or `type=\"range\"`.\n         @property max\n      @type String\n      @default null\n      @since 1.4.0\n      @public\n    */\n    max: null\n  });\n  _exports.TextField = TextField;\n\n  TextField.toString = () => '@ember/component/text-field';\n  /**\n  @module @ember/component\n  */\n\n  /**\n    The `Textarea` component inserts a new instance of `<textarea>` tag into the template.\n  \n    The `@value` argument provides the content of the `<textarea>`.\n  \n    This template:\n  \n    ```handlebars\n    <Textarea @value=\"A bunch of text\" />\n    ```\n  \n    Would result in the following HTML:\n  \n    ```html\n    <textarea class=\"ember-text-area\">\n      A bunch of text\n    </textarea>\n    ```\n  \n    The `@value` argument is two-way bound. If the user types text into the textarea, the `@value`\n    argument is updated. If the `@value` argument is updated, the text in the textarea is updated.\n  \n    In the following example, the `writtenWords` property on the component will be updated as the user\n    types 'Lots of text' into the text area of their browser's window.\n  \n    ```app/components/word-editor.js\n    import Component from '@glimmer/component';\n    import { tracked } from '@glimmer/tracking';\n  \n    export default class WordEditorComponent extends Component {\n      @tracked writtenWords = \"Lots of text that IS bound\";\n    }\n    ```\n  \n    ```handlebars\n    <Textarea @value={{writtenWords}} />\n    ```\n  \n    Would result in the following HTML:\n  \n    ```html\n    <textarea class=\"ember-text-area\">\n      Lots of text that IS bound\n    </textarea>\n    ```\n  \n    If you wanted a one way binding, you could use the `<textarea>` element directly, and use the\n    `value` DOM property and the `input` event.\n  \n    ### Actions\n  \n    The `Textarea` component takes a number of arguments with callbacks that are invoked in\n    response to user events.\n  \n    * `enter`\n    * `insert-newline`\n    * `escape-press`\n    * `focus-in`\n    * `focus-out`\n    * `key-press`\n  \n    These callbacks are passed to `Textarea` like this:\n  \n    ```handlebars\n    <Textarea @value={{this.searchWord}} @enter={{this.query}} />\n    ```\n  \n    ## Classic Invocation Syntax\n  \n    The `Textarea` component can also be invoked using curly braces, just like any other Ember\n    component.\n  \n    For example, this is an invocation using angle-bracket notation:\n  \n    ```handlebars\n    <Textarea @value={{this.searchWord}} @enter={{this.query}} />\n    ```\n  \n    You could accomplish the same thing using classic invocation:\n  \n    ```handlebars\n    {{textarea value=this.searchWord enter=this.query}}\n    ```\n  \n    The main difference is that angle-bracket invocation supports any HTML attribute using HTML\n    attribute syntax, because attributes and arguments have different syntax when using angle-bracket\n    invocation. Curly brace invocation, on the other hand, only has a single syntax for arguments,\n    and components must manually map attributes onto component arguments.\n  \n    When using classic invocation with `{{textarea}}`, only the following attributes are mapped onto\n    arguments:\n  \n    * rows\n    * cols\n    * name\n    * selectionEnd\n    * selectionStart\n    * autocomplete\n    * wrap\n    * lang\n    * dir\n    * value\n  \n    ## Classic `layout` and `layoutName` properties\n  \n    Because HTML `textarea` elements do not contain inner HTML the `layout` and\n    `layoutName` properties will not be applied.\n  \n    @method Textarea\n    @for Ember.Templates.components\n    @see {TextArea}\n    @public\n  */\n\n  /**\n    See Ember.Templates.components.Textarea.\n  \n    @method textarea\n    @for Ember.Templates.helpers\n    @see {Ember.Templates.components.textarea}\n    @public\n  */\n\n  /**\n    The internal representation used for `Textarea` invocations.\n  \n    @class TextArea\n    @extends Component\n    @see {Ember.Templates.components.Textarea}\n    @uses Ember.TextSupport\n    @public\n  */\n\n\n  var TextArea = Component.extend(_views.TextSupport, {\n    classNames: ['ember-text-area'],\n    layout,\n    tagName: 'textarea',\n    attributeBindings: ['rows', 'cols', 'name', 'selectionEnd', 'selectionStart', 'autocomplete', 'wrap', 'lang', 'dir', 'value'],\n    rows: null,\n    cols: null\n  });\n  _exports.TextArea = TextArea;\n\n  TextArea.toString = () => '@ember/component/text-area';\n\n  var layout$1 = template({\n    \"id\": \"giTNx+op\",\n    \"block\": \"{\\\"symbols\\\":[\\\"&default\\\"],\\\"statements\\\":[[4,\\\"if\\\",[[25,1]],null,{\\\"statements\\\":[[14,1]],\\\"parameters\\\":[]},{\\\"statements\\\":[[1,[23,0,[\\\"linkTitle\\\"]],false]],\\\"parameters\\\":[]}]],\\\"hasEval\\\":false}\",\n    \"meta\": {\n      \"moduleName\": \"packages/@ember/-internals/glimmer/lib/templates/link-to.hbs\"\n    }\n  });\n  /**\n  @module ember\n  */\n\n  /**\n    The `LinkTo` component renders a link to the supplied `routeName` passing an optionally\n    supplied model to the route as its `model` context of the route. The block for `LinkTo`\n    becomes the contents of the rendered element:\n  \n    ```handlebars\n    <LinkTo @route='photoGallery'>\n      Great Hamster Photos\n    </LinkTo>\n    ```\n  \n    This will result in:\n  \n    ```html\n    <a href=\"/hamster-photos\">\n      Great Hamster Photos\n    </a>\n    ```\n  \n    ### Disabling the `LinkTo` component\n  \n    The `LinkTo` component can be disabled by using the `disabled` argument. A disabled link\n    doesn't result in a transition when activated, and adds the `disabled` class to the `<a>`\n    element.\n  \n    (The class name to apply to the element can be overridden by using the `disabledClass`\n    argument)\n  \n    ```handlebars\n    <LinkTo @route='photoGallery' @disabled={{true}}>\n      Great Hamster Photos\n    </LinkTo>\n    ```\n  \n    ### Handling `href`\n  \n    `<LinkTo>` will use your application's Router to fill the element's `href` property with a URL\n    that matches the path to the supplied `routeName`.\n  \n    ### Handling current route\n  \n    The `LinkTo` component will apply a CSS class name of 'active' when the application's current\n    route matches the supplied routeName. For example, if the application's current route is\n    'photoGallery.recent', then the following invocation of `LinkTo`:\n  \n    ```handlebars\n    <LinkTo @route='photoGallery.recent'>\n      Great Hamster Photos\n    </LinkTo>\n    ```\n  \n    will result in\n  \n    ```html\n    <a href=\"/hamster-photos/this-week\" class=\"active\">\n      Great Hamster Photos\n    </a>\n    ```\n  \n    The CSS class used for active classes can be customized by passing an `activeClass` argument:\n  \n    ```handlebars\n    <LinkTo @route='photoGallery.recent' @activeClass=\"current-url\">\n      Great Hamster Photos\n    </LinkTo>\n    ```\n  \n    ```html\n    <a href=\"/hamster-photos/this-week\" class=\"current-url\">\n      Great Hamster Photos\n    </a>\n    ```\n  \n    ### Keeping a link active for other routes\n  \n    If you need a link to be 'active' even when it doesn't match the current route, you can use the\n    `current-when` argument.\n  \n    ```handlebars\n    <LinkTo @route='photoGallery' @current-when='photos'>\n      Photo Gallery\n    </LinkTo>\n    ```\n  \n    This may be helpful for keeping links active for:\n  \n    * non-nested routes that are logically related\n    * some secondary menu approaches\n    * 'top navigation' with 'sub navigation' scenarios\n  \n    A link will be active if `current-when` is `true` or the current\n    route is the route this link would transition to.\n  \n    To match multiple routes 'space-separate' the routes:\n  \n    ```handlebars\n    <LinkTo @route='gallery' @current-when='photos drawings paintings'>\n      Art Gallery\n    </LinkTo>\n    ```\n  \n    ### Supplying a model\n  \n    An optional `model` argument can be used for routes whose\n    paths contain dynamic segments. This argument will become\n    the model context of the linked route:\n  \n    ```javascript\n    Router.map(function() {\n      this.route(\"photoGallery\", {path: \"hamster-photos/:photo_id\"});\n    });\n    ```\n  \n    ```handlebars\n    <LinkTo @route='photoGallery' @model={{this.aPhoto}}>\n      {{aPhoto.title}}\n    </LinkTo>\n    ```\n  \n    ```html\n    <a href=\"/hamster-photos/42\">\n      Tomster\n    </a>\n    ```\n  \n    ### Supplying multiple models\n  \n    For deep-linking to route paths that contain multiple\n    dynamic segments, the `models` argument can be used.\n  \n    As the router transitions through the route path, each\n    supplied model argument will become the context for the\n    route with the dynamic segments:\n  \n    ```javascript\n    Router.map(function() {\n      this.route(\"photoGallery\", { path: \"hamster-photos/:photo_id\" }, function() {\n        this.route(\"comment\", {path: \"comments/:comment_id\"});\n      });\n    });\n    ```\n  \n    This argument will become the model context of the linked route:\n  \n    ```handlebars\n    <LinkTo @route='photoGallery.comment' @models={{array this.aPhoto this.comment}}>\n      {{comment.body}}\n    </LinkTo>\n    ```\n  \n    ```html\n    <a href=\"/hamster-photos/42/comments/718\">\n      A+++ would snuggle again.\n    </a>\n    ```\n  \n    ### Supplying an explicit dynamic segment value\n  \n    If you don't have a model object available to pass to `LinkTo`,\n    an optional string or integer argument can be passed for routes whose\n    paths contain dynamic segments. This argument will become the value\n    of the dynamic segment:\n  \n    ```javascript\n    Router.map(function() {\n      this.route(\"photoGallery\", { path: \"hamster-photos/:photo_id\" });\n    });\n    ```\n  \n    ```handlebars\n    <LinkTo @route='photoGallery' @model={{aPhotoId}}>\n      {{this.aPhoto.title}}\n    </LinkTo>\n    ```\n  \n    ```html\n    <a href=\"/hamster-photos/42\">\n      Tomster\n    </a>\n    ```\n  \n    When transitioning into the linked route, the `model` hook will\n    be triggered with parameters including this passed identifier.\n  \n    ### Allowing Default Action\n  \n    By default the `<LinkTo>` component prevents the default browser action by calling\n    `preventDefault()` to avoid reloading the browser page.\n  \n    If you need to trigger a full browser reload pass `@preventDefault={{false}}`:\n  \n    ```handlebars\n    <LinkTo @route='photoGallery' @model={{this.aPhotoId}} @preventDefault={{false}}>\n      {{this.aPhotoId.title}}\n    </LinkTo>\n    ```\n  \n    ### Supplying a `tagName`\n  \n    By default `<LinkTo>` renders an `<a>` element. This can be overridden for a single use of\n    `<LinkTo>` by supplying a `tagName` argument:\n  \n    ```handlebars\n    <LinkTo @route='photoGallery' @tagName='li'>\n      Great Hamster Photos\n    </LinkTo>\n    ```\n  \n    This produces:\n  \n    ```html\n    <li>\n      Great Hamster Photos\n    </li>\n    ```\n  \n    In general, this is not recommended. Instead, you can use the `transition-to` helper together\n    with a click event handler on the HTML tag of your choosing.\n  \n    @for Ember.Templates.components\n    @method LinkTo\n    @see {LinkComponent}\n    @public\n  */\n\n  /**\n    @module @ember/routing\n  */\n\n  /**\n    See [Ember.Templates.components.LinkTo](/ember/release/classes/Ember.Templates.components/methods/input?anchor=LinkTo).\n  \n    @for Ember.Templates.helpers\n    @method link-to\n    @see {Ember.Templates.components.LinkTo}\n    @public\n  **/\n\n  /**\n    `LinkComponent` is the internal component invoked with `<LinkTo>` or `{{link-to}}`.\n  \n    @class LinkComponent\n    @extends Component\n    @see {Ember.Templates.components.LinkTo}\n    @public\n  **/\n\n  var UNDEFINED = Object.freeze({\n    toString() {\n      return 'UNDEFINED';\n    }\n\n  });\n  var EMPTY_QUERY_PARAMS = Object.freeze({});\n  var LinkComponent = Component.extend({\n    layout: layout$1,\n    tagName: 'a',\n\n    /**\n      @property route\n      @public\n    */\n    route: UNDEFINED,\n\n    /**\n      @property model\n      @public\n    */\n    model: UNDEFINED,\n\n    /**\n      @property models\n      @public\n    */\n    models: UNDEFINED,\n\n    /**\n      @property query\n      @public\n    */\n    query: UNDEFINED,\n\n    /**\n      Used to determine when this `LinkComponent` is active.\n         @property current-when\n      @public\n    */\n    'current-when': null,\n\n    /**\n      Sets the `title` attribute of the `LinkComponent`'s HTML element.\n         @property title\n      @default null\n      @public\n    **/\n    title: null,\n\n    /**\n      Sets the `rel` attribute of the `LinkComponent`'s HTML element.\n         @property rel\n      @default null\n      @public\n    **/\n    rel: null,\n\n    /**\n      Sets the `tabindex` attribute of the `LinkComponent`'s HTML element.\n         @property tabindex\n      @default null\n      @public\n    **/\n    tabindex: null,\n\n    /**\n      Sets the `target` attribute of the `LinkComponent`'s HTML element.\n         @since 1.8.0\n      @property target\n      @default null\n      @public\n    **/\n    target: null,\n\n    /**\n      The CSS class to apply to `LinkComponent`'s element when its `active`\n      property is `true`.\n         @property activeClass\n      @type String\n      @default active\n      @public\n    **/\n    activeClass: 'active',\n\n    /**\n      The CSS class to apply to `LinkComponent`'s element when its `loading`\n      property is `true`.\n         @property loadingClass\n      @type String\n      @default loading\n      @private\n    **/\n    loadingClass: 'loading',\n\n    /**\n      The CSS class to apply to a `LinkComponent`'s element when its `disabled`\n      property is `true`.\n         @property disabledClass\n      @type String\n      @default disabled\n      @private\n    **/\n    disabledClass: 'disabled',\n\n    /**\n      Determines whether the `LinkComponent` will trigger routing via\n      the `replaceWith` routing strategy.\n         @property replace\n      @type Boolean\n      @default false\n      @public\n    **/\n    replace: false,\n\n    /**\n      By default this component will forward `href`, `title`, `rel`, `tabindex`, and `target`\n      arguments to attributes on the component's element. When invoked with `{{link-to}}`, you can\n      only customize these attributes. When invoked with `<LinkTo>`, you can just use HTML\n      attributes directly.\n         @property attributeBindings\n      @type Array | String\n      @default ['title', 'rel', 'tabindex', 'target']\n      @public\n    */\n    attributeBindings: ['href', 'title', 'rel', 'tabindex', 'target'],\n\n    /**\n      By default this component will set classes on its element when any of the following arguments\n      are truthy:\n         * active\n      * loading\n      * disabled\n         When these arguments are truthy, a class with the same name will be set on the element. When\n      falsy, the associated class will not be on the element.\n         @property classNameBindings\n      @type Array\n      @default ['active', 'loading', 'disabled', 'ember-transitioning-in', 'ember-transitioning-out']\n      @public\n    */\n    classNameBindings: ['active', 'loading', 'disabled', 'transitioningIn', 'transitioningOut'],\n\n    /**\n      By default this component responds to the `click` event. When the component element is an\n      `<a>` element, activating the link in another way, such as using the keyboard, triggers the\n      click event.\n         @property eventName\n      @type String\n      @default click\n      @private\n    */\n    eventName: 'click',\n\n    // this is doc'ed here so it shows up in the events\n    // section of the API documentation, which is where\n    // people will likely go looking for it.\n\n    /**\n      Triggers the `LinkComponent`'s routing behavior. If\n      `eventName` is changed to a value other than `click`\n      the routing behavior will trigger on that custom event\n      instead.\n         @event click\n      @private\n    */\n\n    /**\n      An overridable method called when `LinkComponent` objects are instantiated.\n         Example:\n         ```app/components/my-link.js\n      import LinkComponent from '@ember/routing/link-component';\n         export default LinkComponent.extend({\n        init() {\n          this._super(...arguments);\n          console.log('Event is ' + this.get('eventName'));\n        }\n      });\n      ```\n         NOTE: If you do override `init` for a framework class like `Component`,\n      be sure to call `this._super(...arguments)` in your\n      `init` declaration! If you don't, Ember may not have an opportunity to\n      do important setup work, and you'll see strange behavior in your\n      application.\n         @method init\n      @private\n    */\n    init() {\n      this._super(...arguments); // Map desired event name to invoke function\n\n\n      var {\n        eventName\n      } = this;\n      this.on(eventName, this, this._invoke);\n    },\n\n    _routing: (0, _service.inject)('-routing'),\n    _currentRoute: (0, _metal.alias)('_routing.currentRouteName'),\n    _currentRouterState: (0, _metal.alias)('_routing.currentState'),\n    _targetRouterState: (0, _metal.alias)('_routing.targetState'),\n    _route: (0, _metal.computed)('route', '_currentRouterState', function computeLinkToComponentRoute() {\n      var {\n        route\n      } = this;\n      return route === UNDEFINED ? this._currentRoute : route;\n    }),\n    _models: (0, _metal.computed)('model', 'models', function computeLinkToComponentModels() {\n      var {\n        model,\n        models\n      } = this;\n      (true && !(model === UNDEFINED || models === UNDEFINED) && (0, _debug.assert)('You cannot provide both the `@model` and `@models` arguments to the <LinkTo> component.', model === UNDEFINED || models === UNDEFINED));\n\n      if (model !== UNDEFINED) {\n        return [model];\n      } else if (models !== UNDEFINED) {\n        (true && !(Array.isArray(models)) && (0, _debug.assert)('The `@models` argument must be an array.', Array.isArray(models)));\n        return models;\n      } else {\n        return [];\n      }\n    }),\n    _query: (0, _metal.computed)('query', function computeLinkToComponentQuery() {\n      var {\n        query\n      } = this;\n\n      if (query === UNDEFINED) {\n        return EMPTY_QUERY_PARAMS;\n      } else {\n        return (0, _polyfills.assign)({}, query);\n      }\n    }),\n\n    /**\n      Accessed as a classname binding to apply the component's `disabledClass`\n      CSS `class` to the element when the link is disabled.\n         When `true`, interactions with the element will not trigger route changes.\n      @property disabled\n      @private\n    */\n    disabled: (0, _metal.computed)({\n      get(_key) {\n        // always returns false for `get` because (due to the `set` just below)\n        // the cached return value from the set will prevent this getter from _ever_\n        // being called after a set has occured\n        return false;\n      },\n\n      set(_key, value$$1) {\n        this._isDisabled = value$$1;\n        return value$$1 ? this.disabledClass : false;\n      }\n\n    }),\n\n    /**\n      Accessed as a classname binding to apply the component's `activeClass`\n      CSS `class` to the element when the link is active.\n         This component is considered active when its `currentWhen` property is `true`\n      or the application's current route is the route this component would trigger\n      transitions into.\n         The `currentWhen` property can match against multiple routes by separating\n      route names using the ` ` (space) character.\n         @property active\n      @private\n    */\n    active: (0, _metal.computed)('activeClass', '_active', function computeLinkToComponentActiveClass() {\n      return this._active ? this.activeClass : false;\n    }),\n    _active: (0, _metal.computed)('_currentRouterState', '_route', '_models', '_query', 'loading', 'current-when', function computeLinkToComponentActive() {\n      var {\n        _currentRouterState: state\n      } = this;\n\n      if (state) {\n        return this._isActive(state);\n      } else {\n        return false;\n      }\n    }),\n    willBeActive: (0, _metal.computed)('_currentRouterState', '_targetRouterState', '_route', '_models', '_query', 'loading', 'current-when', function computeLinkToComponentWillBeActive() {\n      var {\n        _currentRouterState: current,\n        _targetRouterState: target\n      } = this;\n\n      if (current === target) {\n        return;\n      }\n\n      return this._isActive(target);\n    }),\n\n    _isActive(routerState) {\n      if (this.loading) {\n        return false;\n      }\n\n      var currentWhen = this['current-when'];\n\n      if (typeof currentWhen === 'boolean') {\n        return currentWhen;\n      }\n\n      var isCurrentWhenSpecified = Boolean(currentWhen);\n\n      if (isCurrentWhenSpecified) {\n        currentWhen = currentWhen.split(' ');\n      } else {\n        currentWhen = [this._route];\n      }\n\n      var {\n        _models: models,\n        _query: query,\n        _routing: routing\n      } = this;\n\n      for (var i = 0; i < currentWhen.length; i++) {\n        if (routing.isActiveForRoute(models, query, currentWhen[i], routerState, isCurrentWhenSpecified)) {\n          return true;\n        }\n      }\n\n      return false;\n    },\n\n    transitioningIn: (0, _metal.computed)('_active', 'willBeActive', function computeLinkToComponentTransitioningIn() {\n      if (this.willBeActive === true && !this._active) {\n        return 'ember-transitioning-in';\n      } else {\n        return false;\n      }\n    }),\n    transitioningOut: (0, _metal.computed)('_active', 'willBeActive', function computeLinkToComponentTransitioningOut() {\n      if (this.willBeActive === false && this._active) {\n        return 'ember-transitioning-out';\n      } else {\n        return false;\n      }\n    }),\n\n    /**\n      Event handler that invokes the link, activating the associated route.\n         @method _invoke\n      @param {Event} event\n      @private\n    */\n    _invoke(event) {\n      if (!(0, _views.isSimpleClick)(event)) {\n        return true;\n      }\n\n      var {\n        bubbles,\n        preventDefault\n      } = this;\n      var target = this.element.target;\n      var isSelf = !target || target === '_self';\n\n      if (preventDefault !== false && isSelf) {\n        event.preventDefault();\n      }\n\n      if (bubbles === false) {\n        event.stopPropagation();\n      }\n\n      if (this._isDisabled) {\n        return false;\n      }\n\n      if (this.loading) {\n        // tslint:disable-next-line:max-line-length\n        (true && (0, _debug.warn)('This link is in an inactive loading state because at least one of its models ' + 'currently has a null/undefined value, or the provided route name is invalid.', false, {\n          id: 'ember-glimmer.link-to.inactive-loading-state'\n        }));\n        return false;\n      }\n\n      if (!isSelf) {\n        return false;\n      }\n\n      var {\n        _route: routeName,\n        _models: models,\n        _query: queryParams,\n        replace: shouldReplace\n      } = this;\n      var payload = {\n        queryParams,\n        routeName\n      };\n      (0, _instrumentation.flaggedInstrument)('interaction.link-to', payload, this._generateTransition(payload, routeName, models, queryParams, shouldReplace));\n      return false;\n    },\n\n    _generateTransition(payload, qualifiedRouteName, models, queryParams, shouldReplace) {\n      var {\n        _routing: routing\n      } = this;\n      return () => {\n        payload.transition = routing.transitionTo(qualifiedRouteName, models, queryParams, shouldReplace);\n      };\n    },\n\n    /**\n      Sets the element's `href` attribute to the url for\n      the `LinkComponent`'s targeted route.\n         If the `LinkComponent`'s `tagName` is changed to a value other\n      than `a`, this property will be ignored.\n         @property href\n      @private\n    */\n    href: (0, _metal.computed)('_currentRouterState', '_route', '_models', '_query', 'tagName', 'loading', 'loadingHref', function computeLinkToComponentHref() {\n      if (this.tagName !== 'a') {\n        return;\n      }\n\n      if (this.loading) {\n        return this.loadingHref;\n      }\n\n      var {\n        _route: route,\n        _models: models,\n        _query: query,\n        _routing: routing\n      } = this;\n\n      if (true\n      /* DEBUG */\n      ) {\n        /*\n         * Unfortunately, to get decent error messages, we need to do this.\n         * In some future state we should be able to use a \"feature flag\"\n         * which allows us to strip this without needing to call it twice.\n         *\n         * if (isDebugBuild()) {\n         *   // Do the useful debug thing, probably including try/catch.\n         * } else {\n         *   // Do the performant thing.\n         * }\n         */\n        try {\n          return routing.generateURL(route, models, query);\n        } catch (e) {\n          // tslint:disable-next-line:max-line-length\n          (true && !(false) && (0, _debug.assert)(\"You attempted to generate a link for the \\\"\" + this.route + \"\\\" route, but did not \" + \"pass the models required for generating its dynamic segments. \" + e.message));\n        }\n      } else {\n        return routing.generateURL(route, models, query);\n      }\n    }),\n    loading: (0, _metal.computed)('_route', '_modelsAreLoaded', 'loadingClass', function computeLinkToComponentLoading() {\n      var {\n        _route: route,\n        _modelsAreLoaded: loaded\n      } = this;\n\n      if (!loaded || route === null || route === undefined) {\n        return this.loadingClass;\n      }\n    }),\n    _modelsAreLoaded: (0, _metal.computed)('_models', function computeLinkToComponentModelsAreLoaded() {\n      var {\n        _models: models\n      } = this;\n\n      for (var i = 0; i < models.length; i++) {\n        var model = models[i];\n\n        if (model === null || model === undefined) {\n          return false;\n        }\n      }\n\n      return true;\n    }),\n\n    /**\n      The default href value to use while a link-to is loading.\n      Only applies when tagName is 'a'\n         @property loadingHref\n      @type String\n      @default #\n      @private\n    */\n    loadingHref: '#',\n\n    didReceiveAttrs() {\n      var {\n        disabledWhen\n      } = this;\n\n      if (disabledWhen !== undefined) {\n        this.set('disabled', disabledWhen);\n      }\n\n      var {\n        params\n      } = this;\n\n      if (!params || params.length === 0) {\n        (true && !(!(this.route === UNDEFINED && this.model === UNDEFINED && this.models === UNDEFINED && this.query === UNDEFINED)) && (0, _debug.assert)('You must provide at least one of the `@route`, `@model`, `@models` or `@query` argument to `<LinkTo>`.', !(this.route === UNDEFINED && this.model === UNDEFINED && this.models === UNDEFINED && this.query === UNDEFINED)));\n        var {\n          _models: models\n        } = this;\n\n        if (models.length > 0) {\n          var lastModel = models[models.length - 1];\n\n          if (typeof lastModel === 'object' && lastModel !== null && lastModel.isQueryParams) {\n            this.query = lastModel.values;\n            models.pop();\n          }\n        }\n\n        return;\n      }\n\n      params = params.slice(); // Process the positional arguments, in order.\n      // 1. Inline link title comes first, if present.\n\n      if (!this[HAS_BLOCK]) {\n        this.set('linkTitle', params.shift());\n      } // 2. The last argument is possibly the `query` object.\n\n\n      var queryParams = params[params.length - 1];\n\n      if (queryParams && queryParams.isQueryParams) {\n        this.set('query', params.pop().values);\n      } else {\n        this.set('query', UNDEFINED);\n      } // 3. If there is a `route`, it is now at index 0.\n\n\n      if (params.length === 0) {\n        this.set('route', UNDEFINED);\n      } else {\n        this.set('route', params.shift());\n      } // 4. Any remaining indices (if any) are `models`.\n\n\n      this.set('model', UNDEFINED);\n      this.set('models', params);\n    }\n\n  });\n  _exports.LinkComponent = LinkComponent;\n\n  LinkComponent.toString = () => '@ember/routing/link-component';\n\n  LinkComponent.reopenClass({\n    positionalParams: 'params'\n  });\n  /**\n  @module ember\n  */\n\n  /**\n    The `{{#each}}` helper loops over elements in a collection. It is an extension\n    of the base Handlebars `{{#each}}` helper.\n  \n    The default behavior of `{{#each}}` is to yield its inner block once for every\n    item in an array passing the item as the first block parameter.\n  \n    Assuming the `@developers` argument contains this array:\n  \n    ```javascript\n    [{ name: 'Yehuda' },{ name: 'Tom' }, { name: 'Paul' }];\n    ```\n  \n    ```handlebars\n    <ul>\n      {{#each @developers as |person|}}\n        <li>Hello, {{person.name}}!</li>\n      {{/each}}\n    </ul>\n    ```\n  \n    The same rules apply to arrays of primitives.\n  \n    ```javascript\n    ['Yehuda', 'Tom', 'Paul']\n    ```\n  \n    ```handlebars\n    <ul>\n      {{#each @developerNames as |name|}}\n        <li>Hello, {{name}}!</li>\n      {{/each}}\n    </ul>\n    ```\n  \n    During iteration, the index of each item in the array is provided as a second block\n    parameter.\n  \n    ```handlebars\n    <ul>\n      {{#each @developers as |person index|}}\n        <li>Hello, {{person.name}}! You're number {{index}} in line</li>\n      {{/each}}\n    </ul>\n    ```\n  \n    ### Specifying Keys\n  \n    In order to improve rendering speed, Ember will try to reuse the DOM elements\n    where possible. Specifically, if the same item is present in the array both\n    before and after the change, its DOM output will be reused.\n  \n    The `key` option is used to tell Ember how to determine if the items in the\n    array being iterated over with `{{#each}}` has changed between renders. By\n    default the item's object identity is used.\n  \n    This is usually sufficient, so in most cases, the `key` option is simply not\n    needed. However, in some rare cases, the objects' identities may change even\n    though they represent the same underlying data.\n  \n    For example:\n  \n    ```javascript\n    people.map(person => {\n      return { ...person, type: 'developer' };\n    });\n    ```\n  \n    In this case, each time the `people` array is `map`-ed over, it will produce\n    an new array with completely different objects between renders. In these cases,\n    you can help Ember determine how these objects related to each other with the\n    `key` option:\n  \n    ```handlebars\n    <ul>\n      {{#each @developers key=\"name\" as |person|}}\n        <li>Hello, {{person.name}}!</li>\n      {{/each}}\n    </ul>\n    ```\n  \n    By doing so, Ember will use the value of the property specified (`person.name`\n    in the example) to find a \"match\" from the previous render. That is, if Ember\n    has previously seen an object from the `@developers` array with a matching\n    name, its DOM elements will be re-used.\n  \n    ### {{else}} condition\n  \n    `{{#each}}` can have a matching `{{else}}`. The contents of this block will render\n    if the collection is empty.\n  \n    ```handlebars\n    <ul>\n      {{#each @developers as |person|}}\n        <li>{{person.name}} is available!</li>\n      {{else}}\n        <li>Sorry, nobody is available for this task.</li>\n      {{/each}}\n    </ul>\n    ```\n  \n    @method each\n    @for Ember.Templates.helpers\n    @public\n   */\n\n  /**\n    The `{{each-in}}` helper loops over properties on an object.\n  \n    For example, if the `@user` argument contains this object:\n  \n    ```javascript\n    {\n      \"name\": \"Shelly Sails\",\n      \"age\": 42\n    }\n    ```\n  \n    This template would display all properties on the `@user`\n    object in a list:\n  \n    ```handlebars\n    <ul>\n    {{#each-in @user as |key value|}}\n      <li>{{key}}: {{value}}</li>\n    {{/each-in}}\n    </ul>\n    ```\n  \n    Outputting their name and age.\n  \n    @method each-in\n    @for Ember.Templates.helpers\n    @public\n    @since 2.1.0\n  */\n\n  var EACH_IN_REFERENCE = (0, _utils.symbol)('EACH_IN');\n\n  class EachInReference {\n    constructor(inner) {\n      this.inner = inner;\n      this.tag = inner.tag;\n      this[EACH_IN_REFERENCE] = true;\n    }\n\n    value() {\n      return this.inner.value();\n    }\n\n    get(key) {\n      return this.inner.get(key);\n    }\n\n  }\n\n  function isEachIn(ref) {\n    return ref !== null && typeof ref === 'object' && ref[EACH_IN_REFERENCE];\n  }\n\n  function eachIn(_vm, args) {\n    return new EachInReference(args.positional.at(0));\n  }\n\n  var ITERATOR_KEY_GUID = 'be277757-bbbe-4620-9fcb-213ef433cca2';\n\n  function iterableFor(ref, keyPath) {\n    if (isEachIn(ref)) {\n      return new EachInIterable(ref, keyPath || '@key');\n    } else {\n      return new EachIterable(ref, keyPath || '@identity');\n    }\n  }\n\n  class BoundedIterator {\n    constructor(length, keyFor) {\n      this.length = length;\n      this.keyFor = keyFor;\n      this.position = 0;\n    }\n\n    isEmpty() {\n      return false;\n    }\n\n    memoFor(position) {\n      return position;\n    }\n\n    next() {\n      var {\n        length,\n        keyFor,\n        position\n      } = this;\n\n      if (position >= length) {\n        return null;\n      }\n\n      var value$$1 = this.valueFor(position);\n      var memo = this.memoFor(position);\n      var key = keyFor(value$$1, memo, position);\n      this.position++;\n      return {\n        key,\n        value: value$$1,\n        memo\n      };\n    }\n\n  }\n\n  class ArrayIterator extends BoundedIterator {\n    constructor(array, length, keyFor) {\n      super(length, keyFor);\n      this.array = array;\n    }\n\n    static from(array, keyFor) {\n      var {\n        length\n      } = array;\n\n      if (length === 0) {\n        return EMPTY_ITERATOR;\n      } else {\n        return new this(array, length, keyFor);\n      }\n    }\n\n    static fromForEachable(object, keyFor) {\n      var array = [];\n      object.forEach(item => array.push(item));\n      return this.from(array, keyFor);\n    }\n\n    valueFor(position) {\n      return this.array[position];\n    }\n\n  }\n\n  class EmberArrayIterator extends BoundedIterator {\n    constructor(array, length, keyFor) {\n      super(length, keyFor);\n      this.array = array;\n    }\n\n    static from(array, keyFor) {\n      var {\n        length\n      } = array;\n\n      if (length === 0) {\n        return EMPTY_ITERATOR;\n      } else {\n        return new this(array, length, keyFor);\n      }\n    }\n\n    valueFor(position) {\n      return (0, _metal.objectAt)(this.array, position);\n    }\n\n  }\n\n  class ObjectIterator extends BoundedIterator {\n    constructor(keys, values, length, keyFor) {\n      super(length, keyFor);\n      this.keys = keys;\n      this.values = values;\n    }\n\n    static fromIndexable(obj, keyFor) {\n      var keys = Object.keys(obj);\n      var {\n        length\n      } = keys;\n\n      if (length === 0) {\n        return EMPTY_ITERATOR;\n      } else {\n        var values = [];\n\n        for (var i = 0; i < length; i++) {\n          var value$$1 = void 0;\n          var key = keys[i];\n          value$$1 = obj[key]; // Add the tag of the returned value if it is an array, since arrays\n          // should always cause updates if they are consumed and then changed\n\n          if (true\n          /* EMBER_METAL_TRACKED_PROPERTIES */\n          && (0, _metal.isTracking)()) {\n            (0, _metal.consume)((0, _metal.tagForProperty)(obj, key));\n\n            if (Array.isArray(value$$1) || (0, _utils.isEmberArray)(value$$1)) {\n              (0, _metal.consume)((0, _metal.tagForProperty)(value$$1, '[]'));\n            }\n          }\n\n          values.push(value$$1);\n        }\n\n        return new this(keys, values, length, keyFor);\n      }\n    }\n\n    static fromForEachable(obj, keyFor) {\n      var keys = [];\n      var values = [];\n      var length = 0;\n      var isMapLike = false;\n      obj.forEach((value$$1, key) => {\n        isMapLike = isMapLike || arguments.length >= 2;\n\n        if (isMapLike) {\n          keys.push(key);\n        }\n\n        values.push(value$$1);\n        length++;\n      });\n\n      if (length === 0) {\n        return EMPTY_ITERATOR;\n      } else if (isMapLike) {\n        return new this(keys, values, length, keyFor);\n      } else {\n        return new ArrayIterator(values, length, keyFor);\n      }\n    }\n\n    valueFor(position) {\n      return this.values[position];\n    }\n\n    memoFor(position) {\n      return this.keys[position];\n    }\n\n  }\n\n  class NativeIterator {\n    constructor(iterable, result, keyFor) {\n      this.iterable = iterable;\n      this.result = result;\n      this.keyFor = keyFor;\n      this.position = 0;\n    }\n\n    static from(iterable, keyFor) {\n      var iterator = iterable[Symbol.iterator]();\n      var result = iterator.next();\n      var {\n        value: value$$1,\n        done\n      } = result;\n\n      if (done) {\n        return EMPTY_ITERATOR;\n      } else if (Array.isArray(value$$1) && value$$1.length === 2) {\n        return new this(iterator, result, keyFor);\n      } else {\n        return new ArrayLikeNativeIterator(iterator, result, keyFor);\n      }\n    }\n\n    isEmpty() {\n      return false;\n    }\n\n    next() {\n      var {\n        iterable,\n        result,\n        position,\n        keyFor\n      } = this;\n\n      if (result.done) {\n        return null;\n      }\n\n      var value$$1 = this.valueFor(result, position);\n      var memo = this.memoFor(result, position);\n      var key = keyFor(value$$1, memo, position);\n      this.position++;\n      this.result = iterable.next();\n      return {\n        key,\n        value: value$$1,\n        memo\n      };\n    }\n\n  }\n\n  class ArrayLikeNativeIterator extends NativeIterator {\n    valueFor(result) {\n      return result.value;\n    }\n\n    memoFor(_result, position) {\n      return position;\n    }\n\n  }\n\n  class MapLikeNativeIterator extends NativeIterator {\n    valueFor(result) {\n      return result.value[1];\n    }\n\n    memoFor(result) {\n      return result.value[0];\n    }\n\n  }\n\n  var EMPTY_ITERATOR = {\n    isEmpty() {\n      return true;\n    },\n\n    next() {\n      (true && !(false) && (0, _debug.assert)('Cannot call next() on an empty iterator'));\n      return null;\n    }\n\n  };\n\n  class EachInIterable {\n    constructor(ref, keyPath) {\n      this.ref = ref;\n      this.keyPath = keyPath;\n      this.valueTag = (0, _reference.createUpdatableTag)();\n      this.tag = (0, _reference.combine)([ref.tag, this.valueTag]);\n    }\n\n    iterate() {\n      var {\n        ref,\n        valueTag\n      } = this;\n      var iterable = ref.value();\n      var tag = (0, _metal.tagFor)(iterable);\n\n      if ((0, _utils.isProxy)(iterable)) {\n        // this is because the each-in doesn't actually get(proxy, 'key') but bypasses it\n        // and the proxy's tag is lazy updated on access\n        iterable = (0, _runtime._contentFor)(iterable);\n      }\n\n      (0, _reference.update)(valueTag, tag);\n\n      if (!isIndexable(iterable)) {\n        return EMPTY_ITERATOR;\n      }\n\n      if (Array.isArray(iterable) || (0, _utils.isEmberArray)(iterable)) {\n        return ObjectIterator.fromIndexable(iterable, this.keyFor(true));\n      } else if (_utils.HAS_NATIVE_SYMBOL && isNativeIterable(iterable)) {\n        return MapLikeNativeIterator.from(iterable, this.keyFor());\n      } else if (hasForEach(iterable)) {\n        return ObjectIterator.fromForEachable(iterable, this.keyFor());\n      } else {\n        return ObjectIterator.fromIndexable(iterable, this.keyFor(true));\n      }\n    }\n\n    valueReferenceFor(item) {\n      return new UpdatableReference(item.value);\n    }\n\n    updateValueReference(ref, item) {\n      ref.update(item.value);\n    }\n\n    memoReferenceFor(item) {\n      return new UpdatableReference(item.memo);\n    }\n\n    updateMemoReference(ref, item) {\n      ref.update(item.memo);\n    }\n\n    keyFor(hasUniqueKeys = false) {\n      var {\n        keyPath\n      } = this;\n\n      switch (keyPath) {\n        case '@key':\n          return hasUniqueKeys ? ObjectKey : Unique(MapKey);\n\n        case '@index':\n          return Index;\n\n        case '@identity':\n          return Unique(Identity);\n\n        default:\n          (true && !(keyPath[0] !== '@') && (0, _debug.assert)(\"Invalid key: \" + keyPath, keyPath[0] !== '@'));\n          return Unique(KeyPath(keyPath));\n      }\n    }\n\n  }\n\n  class EachIterable {\n    constructor(ref, keyPath) {\n      this.ref = ref;\n      this.keyPath = keyPath;\n      this.valueTag = (0, _reference.createUpdatableTag)();\n      this.tag = (0, _reference.combine)([ref.tag, this.valueTag]);\n    }\n\n    iterate() {\n      var {\n        ref,\n        valueTag\n      } = this;\n      var iterable = ref.value();\n      (0, _reference.update)(valueTag, (0, _metal.tagForProperty)(iterable, '[]'));\n\n      if (iterable === null || typeof iterable !== 'object') {\n        return EMPTY_ITERATOR;\n      }\n\n      var keyFor = this.keyFor();\n\n      if (Array.isArray(iterable)) {\n        return ArrayIterator.from(iterable, keyFor);\n      } else if ((0, _utils.isEmberArray)(iterable)) {\n        return EmberArrayIterator.from(iterable, keyFor);\n      } else if (_utils.HAS_NATIVE_SYMBOL && isNativeIterable(iterable)) {\n        return ArrayLikeNativeIterator.from(iterable, keyFor);\n      } else if (hasForEach(iterable)) {\n        return ArrayIterator.fromForEachable(iterable, keyFor);\n      } else {\n        return EMPTY_ITERATOR;\n      }\n    }\n\n    valueReferenceFor(item) {\n      return new UpdatableReference(item.value);\n    }\n\n    updateValueReference(ref, item) {\n      ref.update(item.value);\n    }\n\n    memoReferenceFor(item) {\n      return new UpdatableReference(item.memo);\n    }\n\n    updateMemoReference(ref, item) {\n      ref.update(item.memo);\n    }\n\n    keyFor() {\n      var {\n        keyPath\n      } = this;\n\n      switch (keyPath) {\n        case '@index':\n          return Index;\n\n        case '@identity':\n          return Unique(Identity);\n\n        default:\n          (true && !(keyPath[0] !== '@') && (0, _debug.assert)(\"Invalid key: \" + keyPath, keyPath[0] !== '@'));\n          return Unique(KeyPath(keyPath));\n      }\n    }\n\n  }\n\n  function hasForEach(value$$1) {\n    return typeof value$$1['forEach'] === 'function';\n  }\n\n  function isNativeIterable(value$$1) {\n    return typeof value$$1[Symbol.iterator] === 'function';\n  }\n\n  function isIndexable(value$$1) {\n    return value$$1 !== null && (typeof value$$1 === 'object' || typeof value$$1 === 'function');\n  } // Position in an array is guarenteed to be unique\n\n\n  function Index(_value, _memo, position) {\n    return String(position);\n  } // Object.keys(...) is guarenteed to be strings and unique\n\n\n  function ObjectKey(_value, memo) {\n    return memo;\n  } // Map keys can be any objects\n\n\n  function MapKey(_value, memo) {\n    return Identity(memo);\n  }\n\n  function Identity(value$$1) {\n    switch (typeof value$$1) {\n      case 'string':\n        return value$$1;\n\n      case 'number':\n        return String(value$$1);\n\n      default:\n        return (0, _utils.guidFor)(value$$1);\n    }\n  }\n\n  function KeyPath(keyPath) {\n    return value$$1 => String((0, _metal.get)(value$$1, keyPath));\n  }\n\n  function Unique(func) {\n    var seen = {};\n    return (value$$1, memo, position) => {\n      var key = func(value$$1, memo, position);\n      var count = seen[key];\n\n      if (count === undefined) {\n        seen[key] = 0;\n        return key;\n      } else {\n        seen[key] = ++count;\n        return \"\" + key + ITERATOR_KEY_GUID + count;\n      }\n    };\n  }\n  /**\n  @module @ember/template\n  */\n\n\n  class SafeString {\n    constructor(string) {\n      this.string = string;\n    }\n\n    toString() {\n      return \"\" + this.string;\n    }\n\n    toHTML() {\n      return this.toString();\n    }\n\n  }\n\n  _exports.SafeString = SafeString;\n  var escape = {\n    '&': '&amp;',\n    '<': '&lt;',\n    '>': '&gt;',\n    '\"': '&quot;',\n    \"'\": '&#x27;',\n    '`': '&#x60;',\n    '=': '&#x3D;'\n  };\n  var possible = /[&<>\"'`=]/;\n  var badChars = /[&<>\"'`=]/g;\n\n  function escapeChar(chr) {\n    return escape[chr];\n  }\n\n  function escapeExpression(string) {\n    if (typeof string !== 'string') {\n      // don't escape SafeStrings, since they're already safe\n      if (string && string.toHTML) {\n        return string.toHTML();\n      } else if (string === null || string === undefined) {\n        return '';\n      } else if (!string) {\n        return String(string);\n      } // Force a string conversion as this will be done by the append regardless and\n      // the regex test will do this transparently behind the scenes, causing issues if\n      // an object's to string has escaped characters in it.\n\n\n      string = String(string);\n    }\n\n    if (!possible.test(string)) {\n      return string;\n    }\n\n    return string.replace(badChars, escapeChar);\n  }\n  /**\n    Mark a string as safe for unescaped output with Ember templates. If you\n    return HTML from a helper, use this function to\n    ensure Ember's rendering layer does not escape the HTML.\n  \n    ```javascript\n    import { htmlSafe } from '@ember/template';\n  \n    htmlSafe('<div>someString</div>')\n    ```\n  \n    @method htmlSafe\n    @for @ember/template\n    @static\n    @return {SafeString} A string that will not be HTML escaped by Handlebars.\n    @public\n  */\n\n\n  function htmlSafe(str) {\n    if (str === null || str === undefined) {\n      str = '';\n    } else if (typeof str !== 'string') {\n      str = String(str);\n    }\n\n    return new SafeString(str);\n  }\n  /**\n    Detects if a string was decorated using `htmlSafe`.\n  \n    ```javascript\n    import { htmlSafe, isHTMLSafe } from '@ember/template';\n  \n    var plainString = 'plain string',\n        safeString = htmlSafe('<div>someValue</div>');\n  \n    isHTMLSafe(plainString); // false\n    isHTMLSafe(safeString);  // true\n    ```\n  \n    @method isHTMLSafe\n    @for @ember/template\n    @static\n    @return {Boolean} `true` if the string was decorated with `htmlSafe`, `false` otherwise.\n    @public\n  */\n\n\n  function isHTMLSafe(str) {\n    return str !== null && typeof str === 'object' && typeof str.toHTML === 'function';\n  }\n  /* globals module, URL */\n\n\n  var nodeURL;\n  var parsingNode;\n\n  function installProtocolForURL(environment) {\n    var protocol;\n\n    if (_browserEnvironment.hasDOM) {\n      protocol = browserProtocolForURL.call(environment, 'foobar:baz');\n    } // Test to see if our DOM implementation parses\n    // and normalizes URLs.\n\n\n    if (protocol === 'foobar:') {\n      // Swap in the method that doesn't do this test now that\n      // we know it works.\n      environment.protocolForURL = browserProtocolForURL;\n    } else if (typeof URL === 'object') {\n      // URL globally provided, likely from FastBoot's sandbox\n      nodeURL = URL;\n      environment.protocolForURL = nodeProtocolForURL;\n    } else if (typeof module !== undefined && typeof module.require === 'function') {\n      // Otherwise, we need to fall back to our own URL parsing.\n      // Global `require` is shadowed by Ember's loader so we have to use the fully\n      // qualified `module.require`.\n      // tslint:disable-next-line:no-require-imports\n      nodeURL = module.require('url');\n      environment.protocolForURL = nodeProtocolForURL;\n    } else {\n      throw new Error('Could not find valid URL parsing mechanism for URL Sanitization');\n    }\n  }\n\n  function browserProtocolForURL(url) {\n    if (!parsingNode) {\n      parsingNode = document.createElement('a');\n    }\n\n    parsingNode.href = url;\n    return parsingNode.protocol;\n  }\n\n  function nodeProtocolForURL(url) {\n    var protocol = null;\n\n    if (typeof url === 'string') {\n      protocol = nodeURL.parse(url).protocol;\n    }\n\n    return protocol === null ? ':' : protocol;\n  }\n\n  var GUID = 0;\n\n  class Ref {\n    constructor(value$$1) {\n      this.id = GUID++;\n      this.value = value$$1;\n    }\n\n    get() {\n      return this.value;\n    }\n\n    release() {\n      (true && !(this.value !== null) && (0, _debug.assert)('BUG: double release?', this.value !== null));\n      this.value = null;\n    }\n\n    toString() {\n      var label = \"Ref \" + this.id;\n\n      if (this.value === null) {\n        return label + \" (released)\";\n      } else {\n        try {\n          return label + \": \" + this.value;\n        } catch (_a) {\n          return label;\n        }\n      }\n    }\n\n  }\n\n  var _repeat = String.prototype.repeat || function (count) {\n    return new Array(count + 1).join(this);\n  };\n\n  function repeatString(str, count) {\n    return _repeat.call(str, count);\n  }\n\n  class StackWithToArray extends _util.Stack {\n    toArray() {\n      // polyfilling feature of modern Glimmer VM\n      return this['stack'];\n    }\n\n  }\n\n  class DebugRenderTree {\n    constructor() {\n      this.stack = new StackWithToArray();\n      this.refs = new WeakMap();\n      this.roots = new Set();\n      this.nodes = new WeakMap();\n    }\n\n    begin() {\n      this.reset();\n    }\n\n    create(state, node) {\n      this.nodes.set(state, (0, _polyfills.assign)({}, node, {\n        bounds: null,\n        refs: new Set()\n      }));\n      this.appendChild(state);\n      this.enter(state);\n    }\n\n    update(state) {\n      this.enter(state);\n    } // for dynamic layouts\n\n\n    setTemplate(state, template) {\n      this.nodeFor(state).template = template;\n    }\n\n    didRender(state, bounds) {\n      (true && !(this.stack.current === state) && (0, _debug.assert)(\"BUG: expecting \" + this.stack.current + \", got \" + state, this.stack.current === state));\n      this.nodeFor(state).bounds = bounds;\n      this.exit();\n    }\n\n    willDestroy(state) {\n      (0, _util.expect)(this.refs.get(state), 'BUG: missing ref').release();\n    }\n\n    commit() {\n      this.reset();\n    }\n\n    capture() {\n      return this.captureRefs(this.roots);\n    }\n\n    logCurrentRenderStack() {\n      var nodes = this.stack.toArray().map(bucket => this.nodeFor(bucket));\n      var message = nodes.filter(node => node.type !== 'outlet' && node.name !== '-top-level').map((node, index) => \"\" + repeatString(' ', index * 2) + node.name);\n      message.push(\"\" + repeatString(' ', message.length * 2));\n      return message.join('\\n');\n    }\n\n    reset() {\n      if (this.stack.size !== 0) {\n        // We probably encountered an error during the rendering loop. This will\n        // likely trigger undefined behavior and memory leaks as the error left\n        // things in an inconsistent state. It is recommended that the user\n        // refresh the page.\n        // TODO: We could warn here? But this happens all the time in our tests?\n        while (!this.stack.isEmpty()) {\n          this.stack.pop();\n        }\n      }\n    }\n\n    enter(state) {\n      this.stack.push(state);\n    }\n\n    exit() {\n      (true && !(this.stack.size !== 0) && (0, _debug.assert)('BUG: unbalanced pop', this.stack.size !== 0));\n      this.stack.pop();\n    }\n\n    nodeFor(state) {\n      return (0, _util.expect)(this.nodes.get(state), 'BUG: missing node');\n    }\n\n    appendChild(state) {\n      (true && !(!this.refs.has(state)) && (0, _debug.assert)('BUG: child already appended', !this.refs.has(state)));\n      var parent = this.stack.current;\n      var ref = new Ref(state);\n      this.refs.set(state, ref);\n\n      if (parent) {\n        this.nodeFor(parent).refs.add(ref);\n      } else {\n        this.roots.add(ref);\n      }\n    }\n\n    captureRefs(refs) {\n      var captured = [];\n      refs.forEach(ref => {\n        var state = ref.get();\n\n        if (state) {\n          captured.push(this.captureNode(\"render-node:\" + ref.id, state));\n        } else {\n          refs.delete(ref);\n        }\n      });\n      return captured;\n    }\n\n    captureNode(id, state) {\n      var node = this.nodeFor(state);\n      var {\n        type,\n        name,\n        args,\n        instance,\n        refs\n      } = node;\n      var template = this.captureTemplate(node);\n      var bounds = this.captureBounds(node);\n      var children = this.captureRefs(refs);\n      return {\n        id,\n        type,\n        name,\n        args: args.value(),\n        instance,\n        template,\n        bounds,\n        children\n      };\n    }\n\n    captureTemplate({\n      template\n    }) {\n      return template && template.referrer.moduleName || null;\n    }\n\n    captureBounds(node) {\n      var bounds = (0, _util.expect)(node.bounds, 'BUG: missing bounds');\n      var parentElement = bounds.parentElement();\n      var firstNode = bounds.firstNode();\n      var lastNode = bounds.lastNode();\n      return {\n        parentElement,\n        firstNode,\n        lastNode\n      };\n    }\n\n  }\n\n  class Environment$1 extends _runtime2.Environment {\n    constructor(injections) {\n      super(injections);\n      this.inTransaction = false;\n      var owner = injections[_owner.OWNER];\n      this.owner = owner;\n      this.isInteractive = owner.lookup('-environment:main').isInteractive; // can be removed once https://github.com/tildeio/glimmer/pull/305 lands\n\n      this.destroyedComponents = [];\n      installProtocolForURL(this);\n\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        this._debugRenderTree = new DebugRenderTree();\n      }\n    }\n\n    static create(options) {\n      return new this(options);\n    }\n\n    get debugRenderTree() {\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        return this._debugRenderTree;\n      } else {\n        throw new Error(\"Can't access debug render tree outside of the inspector (_DEBUG_RENDER_TREE flag is disabled)\");\n      }\n    } // this gets clobbered by installPlatformSpecificProtocolForURL\n    // it really should just delegate to a platform specific injection\n\n\n    protocolForURL(s) {\n      return s;\n    }\n\n    toConditionalReference(reference) {\n      return ConditionalReference$1.create(reference);\n    }\n\n    iterableFor(ref, key) {\n      return iterableFor(ref, key);\n    }\n\n    scheduleInstallModifier(modifier, manager) {\n      if (this.isInteractive) {\n        super.scheduleInstallModifier(modifier, manager);\n      }\n    }\n\n    scheduleUpdateModifier(modifier, manager) {\n      if (this.isInteractive) {\n        super.scheduleUpdateModifier(modifier, manager);\n      }\n    }\n\n    didDestroy(destroyable) {\n      destroyable.destroy();\n    }\n\n    begin() {\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        this.debugRenderTree.begin();\n      }\n\n      this.inTransaction = true;\n      super.begin();\n    }\n\n    commit() {\n      var destroyedComponents = this.destroyedComponents;\n      this.destroyedComponents = []; // components queued for destruction must be destroyed before firing\n      // `didCreate` to prevent errors when removing and adding a component\n      // with the same name (would throw an error when added to view registry)\n\n      for (var i = 0; i < destroyedComponents.length; i++) {\n        destroyedComponents[i].destroy();\n      }\n\n      try {\n        super.commit();\n      } finally {\n        this.inTransaction = false;\n      }\n\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        this.debugRenderTree.commit();\n      }\n    }\n\n  }\n\n  _exports.Environment = Environment$1;\n\n  if (true\n  /* DEBUG */\n  ) {\n    class StyleAttributeManager extends _runtime2.SimpleDynamicAttribute {\n      set(dom, value$$1, env) {\n        (true && (0, _debug.warn)((0, _views.constructStyleDeprecationMessage)(value$$1), (() => {\n          if (value$$1 === null || value$$1 === undefined || isHTMLSafe(value$$1)) {\n            return true;\n          }\n\n          return false;\n        })(), {\n          id: 'ember-htmlbars.style-xss-warning'\n        }));\n        super.set(dom, value$$1, env);\n      }\n\n      update(value$$1, env) {\n        (true && (0, _debug.warn)((0, _views.constructStyleDeprecationMessage)(value$$1), (() => {\n          if (value$$1 === null || value$$1 === undefined || isHTMLSafe(value$$1)) {\n            return true;\n          }\n\n          return false;\n        })(), {\n          id: 'ember-htmlbars.style-xss-warning'\n        }));\n        super.update(value$$1, env);\n      }\n\n    }\n\n    Environment$1.prototype.attributeFor = function (element, attribute, isTrusting, namespace) {\n      if (attribute === 'style' && !isTrusting) {\n        return new StyleAttributeManager({\n          element,\n          name: attribute,\n          namespace\n        });\n      }\n\n      return _runtime2.Environment.prototype.attributeFor.call(this, element, attribute, isTrusting, namespace);\n    };\n  } // implements the ComponentManager interface as defined in glimmer:\n  // tslint:disable-next-line:max-line-length\n  // https://github.com/glimmerjs/glimmer-vm/blob/v0.24.0-beta.4/packages/%40glimmer/runtime/lib/component/interfaces.ts#L21\n\n\n  class AbstractManager {\n    prepareArgs(_state, _args) {\n      return null;\n    }\n\n    didCreateElement(_component, _element, _operations) {// noop\n    }\n\n    didRenderLayout(_component, _bounds) {// noop\n    }\n\n    didCreate(_bucket) {// noop\n    }\n\n    update(_bucket, _dynamicScope) {// noop\n    }\n\n    didUpdateLayout(_bucket, _bounds) {// noop\n    }\n\n    didUpdate(_bucket) {// noop\n    }\n\n  }\n\n  _exports.AbstractComponentManager = AbstractManager;\n\n  function instrumentationPayload(def) {\n    return {\n      object: def.name + \":\" + def.outlet\n    };\n  }\n\n  var CAPABILITIES = {\n    dynamicLayout: false,\n    dynamicTag: false,\n    prepareArgs: false,\n    createArgs: _environment2.ENV._DEBUG_RENDER_TREE,\n    attributeHook: false,\n    elementHook: false,\n    createCaller: false,\n    dynamicScope: true,\n    updateHook: _environment2.ENV._DEBUG_RENDER_TREE,\n    createInstance: true\n  };\n\n  class OutletComponentManager extends AbstractManager {\n    create(environment, definition, args, dynamicScope) {\n      var parentStateRef = dynamicScope.outletState;\n      var currentStateRef = definition.ref;\n      dynamicScope.outletState = currentStateRef;\n      var state = {\n        self: RootReference.create(definition.controller),\n        environment,\n        finalize: (0, _instrumentation._instrumentStart)('render.outlet', instrumentationPayload, definition)\n      };\n\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        state.outlet = {\n          name: definition.outlet\n        };\n        environment.debugRenderTree.create(state.outlet, {\n          type: 'outlet',\n          name: state.outlet.name,\n          args: _runtime2.EMPTY_ARGS,\n          instance: undefined,\n          template: undefined\n        });\n        var parentState = parentStateRef.value();\n        var parentOwner = parentState && parentState.render && parentState.render.owner;\n        var currentOwner = currentStateRef.value().render.owner;\n\n        if (parentOwner && parentOwner !== currentOwner) {\n          var engine = currentOwner;\n          (true && !(typeof currentOwner.mountPoint === 'string') && (0, _debug.assert)('invalid engine: missing mountPoint', typeof currentOwner.mountPoint === 'string'));\n          (true && !(currentOwner.routable === true) && (0, _debug.assert)('invalid engine: missing routable', currentOwner.routable === true));\n          var mountPoint = engine.mountPoint;\n          state.engine = {\n            mountPoint\n          };\n          environment.debugRenderTree.create(state.engine, {\n            type: 'engine',\n            name: mountPoint,\n            args: _runtime2.EMPTY_ARGS,\n            instance: engine,\n            template: undefined\n          });\n        }\n\n        environment.debugRenderTree.create(state, {\n          type: 'route-template',\n          name: definition.name,\n          args: args.capture(),\n          instance: definition.controller,\n          template: definition.template\n        });\n      }\n\n      return state;\n    }\n\n    getLayout({\n      template\n    }, _resolver) {\n      // The router has already resolved the template\n      var layout = template.asLayout();\n      return {\n        handle: layout.compile(),\n        symbolTable: layout.symbolTable\n      };\n    }\n\n    getCapabilities() {\n      return CAPABILITIES;\n    }\n\n    getSelf({\n      self\n    }) {\n      return self;\n    }\n\n    getTag() {\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        // returning a const tag skips the update hook (VM BUG?)\n        return (0, _reference.createTag)();\n      } else {\n        // an outlet has no hooks\n        return _reference.CONSTANT_TAG;\n      }\n    }\n\n    didRenderLayout(state, bounds) {\n      state.finalize();\n\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        state.environment.debugRenderTree.didRender(state, bounds);\n\n        if (state.engine) {\n          state.environment.debugRenderTree.didRender(state.engine, bounds);\n        }\n\n        state.environment.debugRenderTree.didRender(state.outlet, bounds);\n      }\n    }\n\n    update(state) {\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        state.environment.debugRenderTree.update(state.outlet);\n\n        if (state.engine) {\n          state.environment.debugRenderTree.update(state.engine);\n        }\n\n        state.environment.debugRenderTree.update(state);\n      }\n    }\n\n    didUpdateLayout(state, bounds) {\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        state.environment.debugRenderTree.didRender(state, bounds);\n\n        if (state.engine) {\n          state.environment.debugRenderTree.didRender(state.engine, bounds);\n        }\n\n        state.environment.debugRenderTree.didRender(state.outlet, bounds);\n      }\n    }\n\n    getDestructor(state) {\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        return {\n          destroy() {\n            state.environment.debugRenderTree.willDestroy(state);\n\n            if (state.engine) {\n              state.environment.debugRenderTree.willDestroy(state.engine);\n            }\n\n            state.environment.debugRenderTree.willDestroy(state.outlet);\n          }\n\n        };\n      } else {\n        return null;\n      }\n    }\n\n  }\n\n  var OUTLET_MANAGER = new OutletComponentManager();\n\n  class OutletComponentDefinition {\n    constructor(state, manager = OUTLET_MANAGER) {\n      this.state = state;\n      this.manager = manager;\n    }\n\n  }\n\n  function createRootOutlet(outletView) {\n    if (_environment2.ENV._APPLICATION_TEMPLATE_WRAPPER) {\n      var WRAPPED_CAPABILITIES = (0, _polyfills.assign)({}, CAPABILITIES, {\n        dynamicTag: true,\n        elementHook: true\n      });\n      var WrappedOutletComponentManager = class extends OutletComponentManager {\n        getTagName(_component) {\n          return 'div';\n        }\n\n        getLayout(state) {\n          // The router has already resolved the template\n          var template = state.template;\n          var layout = template.asWrappedLayout();\n          return {\n            handle: layout.compile(),\n            symbolTable: layout.symbolTable\n          };\n        }\n\n        getCapabilities() {\n          return WRAPPED_CAPABILITIES;\n        }\n\n        didCreateElement(component, element, _operations) {\n          // to add GUID id and class\n          element.setAttribute('class', 'ember-view');\n          element.setAttribute('id', (0, _utils.guidFor)(component));\n        }\n\n      };\n      var WRAPPED_OUTLET_MANAGER = new WrappedOutletComponentManager();\n      return new OutletComponentDefinition(outletView.state, WRAPPED_OUTLET_MANAGER);\n    } else {\n      return new OutletComponentDefinition(outletView.state);\n    }\n  }\n\n  function NOOP() {}\n  /**\n    @module ember\n  */\n\n  /**\n    Represents the internal state of the component.\n  \n    @class ComponentStateBucket\n    @private\n  */\n\n\n  class ComponentStateBucket {\n    constructor(environment, component, args, finalizer, hasWrappedElement) {\n      this.environment = environment;\n      this.component = component;\n      this.args = args;\n      this.finalizer = finalizer;\n      this.hasWrappedElement = hasWrappedElement;\n      this.classRef = null;\n      this.classRef = null;\n      this.argsRevision = args === null ? 0 : (0, _reference.value)(args.tag);\n      this.rootRef = new RootReference(component, environment);\n    }\n\n    destroy() {\n      var {\n        component,\n        environment\n      } = this;\n\n      if (environment.isInteractive) {\n        component.trigger('willDestroyElement');\n        component.trigger('willClearRender');\n        var element = (0, _views.getViewElement)(component);\n\n        if (element) {\n          (0, _views.clearElementView)(element);\n          (0, _views.clearViewElement)(component);\n        }\n      }\n\n      environment.destroyedComponents.push(component);\n    }\n\n    finalize() {\n      var {\n        finalizer\n      } = this;\n      finalizer();\n      this.finalizer = NOOP;\n    }\n\n  }\n\n  function referenceForKey(rootRef, key) {\n    return rootRef.get(key);\n  }\n\n  function referenceForParts(rootRef, parts) {\n    var isAttrs = parts[0] === 'attrs'; // TODO deprecate this\n\n    if (isAttrs) {\n      parts.shift();\n\n      if (parts.length === 1) {\n        return referenceForKey(rootRef, parts[0]);\n      }\n    }\n\n    return referenceFromParts(rootRef, parts);\n  } // TODO we should probably do this transform at build time\n\n\n  function wrapComponentClassAttribute(hash) {\n    if (hash === null) {\n      return;\n    }\n\n    var [keys, values] = hash;\n    var index = keys === null ? -1 : keys.indexOf('class');\n\n    if (index !== -1) {\n      var value$$1 = values[index];\n\n      if (!Array.isArray(value$$1)) {\n        return;\n      }\n\n      var [type] = value$$1;\n\n      if (type === _wireFormat.Ops.Get || type === _wireFormat.Ops.MaybeLocal) {\n        var path = value$$1[value$$1.length - 1];\n        var propName = path[path.length - 1];\n        values[index] = [_wireFormat.Ops.Helper, '-class', [value$$1, propName], null];\n      }\n    }\n  }\n\n  var AttributeBinding = {\n    parse(microsyntax) {\n      var colonIndex = microsyntax.indexOf(':');\n\n      if (colonIndex === -1) {\n        (true && !(microsyntax !== 'class') && (0, _debug.assert)('You cannot use class as an attributeBinding, use classNameBindings instead.', microsyntax !== 'class'));\n        return [microsyntax, microsyntax, true];\n      } else {\n        var prop = microsyntax.substring(0, colonIndex);\n        var attribute = microsyntax.substring(colonIndex + 1);\n        (true && !(attribute !== 'class') && (0, _debug.assert)('You cannot use class as an attributeBinding, use classNameBindings instead.', attribute !== 'class'));\n        return [prop, attribute, false];\n      }\n    },\n\n    install(_element, component, rootRef, parsed, operations) {\n      var [prop, attribute, isSimple] = parsed;\n\n      if (attribute === 'id') {\n        var elementId = (0, _metal.get)(component, prop);\n\n        if (elementId === undefined || elementId === null) {\n          elementId = component.elementId;\n        }\n\n        elementId = _runtime2.PrimitiveReference.create(elementId);\n        operations.setAttribute('id', elementId, true, null); // operations.addStaticAttribute(element, 'id', elementId);\n\n        return;\n      }\n\n      var isPath = prop.indexOf('.') > -1;\n      var reference = isPath ? referenceForParts(rootRef, prop.split('.')) : referenceForKey(rootRef, prop);\n      (true && !(!(isSimple && isPath)) && (0, _debug.assert)(\"Illegal attributeBinding: '\" + prop + \"' is not a valid attribute name.\", !(isSimple && isPath)));\n\n      if (_deprecatedFeatures.EMBER_COMPONENT_IS_VISIBLE && attribute === 'style' && StyleBindingReference !== undefined) {\n        reference = new StyleBindingReference(reference, referenceForKey(rootRef, 'isVisible'), component);\n      }\n\n      operations.setAttribute(attribute, reference, false, null); // operations.addDynamicAttribute(element, attribute, reference, false);\n    }\n\n  };\n  var DISPLAY_NONE = 'display: none;';\n  var SAFE_DISPLAY_NONE = htmlSafe(DISPLAY_NONE);\n  var StyleBindingReference;\n\n  if (_deprecatedFeatures.EMBER_COMPONENT_IS_VISIBLE) {\n    StyleBindingReference = class extends _reference.CachedReference {\n      constructor(inner, isVisible, component) {\n        super();\n        this.inner = inner;\n        this.isVisible = isVisible;\n        this.component = component;\n        this.tag = (0, _reference.combine)([inner.tag, isVisible.tag]);\n      }\n\n      compute() {\n        var value$$1 = this.inner.value();\n        var isVisible = this.isVisible.value();\n\n        if (isVisible !== undefined) {\n          (true && !(false) && (0, _debug.deprecate)(\"`isVisible` is deprecated (from \\\"\" + this.component._debugContainerKey + \"\\\")\", false, {\n            id: 'ember-component.is-visible',\n            until: '4.0.0',\n            url: 'https://deprecations.emberjs.com/v3.x#toc_ember-component-is-visible'\n          }));\n        }\n\n        if (isVisible !== false) {\n          return value$$1;\n        }\n\n        if (!value$$1) {\n          return SAFE_DISPLAY_NONE;\n        } else {\n          var style = value$$1 + ' ' + DISPLAY_NONE;\n          return isHTMLSafe(value$$1) ? htmlSafe(style) : style;\n        }\n      }\n\n    };\n  }\n\n  var IsVisibleBinding;\n\n  if (_deprecatedFeatures.EMBER_COMPONENT_IS_VISIBLE) {\n    IsVisibleBinding = {\n      install(_element, component, rootRef, operations) {\n        var componentMapStyleValue = isVisible => {\n          return this.mapStyleValue(isVisible, component);\n        };\n\n        operations.setAttribute('style', (0, _reference.map)(referenceForKey(rootRef, 'isVisible'), componentMapStyleValue), false, null); // // the upstream type for addDynamicAttribute's `value` argument\n        // // appears to be incorrect. It is currently a Reference<string>, I\n        // // think it should be a Reference<string|null>.\n        // operations.addDynamicAttribute(element, 'style', ref as any as Reference<string>, false);\n      },\n\n      mapStyleValue(isVisible, component) {\n        if (isVisible !== undefined) {\n          (true && !(false) && (0, _debug.deprecate)(\"`isVisible` is deprecated (from \\\"\" + component._debugContainerKey + \"\\\")\", false, {\n            id: 'ember-component.is-visible',\n            until: '4.0.0',\n            url: 'https://deprecations.emberjs.com/v3.x#toc_ember-component-is-visible'\n          }));\n        }\n\n        return isVisible === false ? SAFE_DISPLAY_NONE : null;\n      }\n\n    };\n  }\n\n  var ClassNameBinding = {\n    install(_element, rootRef, microsyntax, operations) {\n      var [prop, truthy, falsy] = microsyntax.split(':');\n      var isStatic = prop === '';\n\n      if (isStatic) {\n        operations.setAttribute('class', _runtime2.PrimitiveReference.create(truthy), true, null);\n      } else {\n        var isPath = prop.indexOf('.') > -1;\n        var parts = isPath ? prop.split('.') : [];\n        var value$$1 = isPath ? referenceForParts(rootRef, parts) : referenceForKey(rootRef, prop);\n        var ref;\n\n        if (truthy === undefined) {\n          ref = new SimpleClassNameBindingReference(value$$1, isPath ? parts[parts.length - 1] : prop);\n        } else {\n          ref = new ColonClassNameBindingReference(value$$1, truthy, falsy);\n        }\n\n        operations.setAttribute('class', ref, false, null); // // the upstream type for addDynamicAttribute's `value` argument\n        // // appears to be incorrect. It is currently a Reference<string>, I\n        // // think it should be a Reference<string|null>.\n        // operations.addDynamicAttribute(element, 'class', ref as any as Reference<string>, false);\n      }\n    }\n\n  };\n\n  class SimpleClassNameBindingReference extends _reference.CachedReference {\n    constructor(inner, path) {\n      super();\n      this.inner = inner;\n      this.path = path;\n      this.tag = inner.tag;\n      this.inner = inner;\n      this.path = path;\n      this.dasherizedPath = null;\n    }\n\n    compute() {\n      var value$$1 = this.inner.value();\n\n      if (value$$1 === true) {\n        var {\n          path,\n          dasherizedPath\n        } = this;\n        return dasherizedPath || (this.dasherizedPath = (0, _string.dasherize)(path));\n      } else if (value$$1 || value$$1 === 0) {\n        return String(value$$1);\n      } else {\n        return null;\n      }\n    }\n\n  }\n\n  class ColonClassNameBindingReference extends _reference.CachedReference {\n    constructor(inner, truthy = null, falsy = null) {\n      super();\n      this.inner = inner;\n      this.truthy = truthy;\n      this.falsy = falsy;\n      this.tag = inner.tag;\n    }\n\n    compute() {\n      var {\n        inner,\n        truthy,\n        falsy\n      } = this;\n      return inner.value() ? truthy : falsy;\n    }\n\n  } // inputs needed by CurlyComponents (attrs and props, with mutable\n  // cells, etc).\n\n\n  function processComponentArgs(namedArgs) {\n    var keys = namedArgs.names;\n    var attrs = namedArgs.value();\n    var props = Object.create(null);\n    var args = Object.create(null);\n    props[ARGS] = args;\n\n    for (var i = 0; i < keys.length; i++) {\n      var name = keys[i];\n      var ref = namedArgs.get(name);\n      var value$$1 = attrs[name];\n\n      if (typeof value$$1 === 'function' && value$$1[ACTION]) {\n        attrs[name] = value$$1;\n      } else if (ref[UPDATE]) {\n        attrs[name] = new MutableCell(ref, value$$1);\n      }\n\n      args[name] = ref;\n      props[name] = value$$1;\n    }\n\n    props.attrs = attrs;\n    return props;\n  }\n\n  var REF = (0, _utils.symbol)('REF');\n\n  class MutableCell {\n    constructor(ref, value$$1) {\n      this[_views.MUTABLE_CELL] = true;\n      this[REF] = ref;\n      this.value = value$$1;\n    }\n\n    update(val) {\n      this[REF][UPDATE](val);\n    }\n\n  }\n\n  var __rest = undefined && undefined.__rest || function (s, e) {\n    var t = {};\n\n    for (var p in s) {\n      if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n    }\n\n    if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n      if (e.indexOf(p[i]) < 0) t[p[i]] = s[p[i]];\n    }\n    return t;\n  };\n\n  function aliasIdToElementId(args, props) {\n    if (args.named.has('id')) {\n      // tslint:disable-next-line:max-line-length\n      (true && !(!args.named.has('elementId')) && (0, _debug.assert)(\"You cannot invoke a component with both 'id' and 'elementId' at the same time.\", !args.named.has('elementId')));\n      props.elementId = props.id;\n    }\n  } // We must traverse the attributeBindings in reverse keeping track of\n  // what has already been applied. This is essentially refining the concatenated\n  // properties applying right to left.\n\n\n  function applyAttributeBindings(element, attributeBindings, component, rootRef, operations) {\n    var seen = [];\n    var i = attributeBindings.length - 1;\n\n    while (i !== -1) {\n      var binding = attributeBindings[i];\n      var parsed = AttributeBinding.parse(binding);\n      var attribute = parsed[1];\n\n      if (seen.indexOf(attribute) === -1) {\n        seen.push(attribute);\n        AttributeBinding.install(element, component, rootRef, parsed, operations);\n      }\n\n      i--;\n    }\n\n    if (seen.indexOf('id') === -1) {\n      var id$$1 = component.elementId ? component.elementId : (0, _utils.guidFor)(component);\n      operations.setAttribute('id', _runtime2.PrimitiveReference.create(id$$1), false, null);\n    }\n\n    if (_deprecatedFeatures.EMBER_COMPONENT_IS_VISIBLE && IsVisibleBinding !== undefined && seen.indexOf('style') === -1) {\n      IsVisibleBinding.install(element, component, rootRef, operations);\n    }\n  }\n\n  var DEFAULT_LAYOUT = (0, _container.privatize)(_templateObject2());\n  var EMPTY_POSITIONAL_ARGS = [];\n  (0, _debug.debugFreeze)(EMPTY_POSITIONAL_ARGS);\n\n  class CurlyComponentManager extends AbstractManager {\n    getLayout(state, _resolver) {\n      return {\n        // TODO fix\n        handle: state.handle,\n        symbolTable: state.symbolTable\n      };\n    }\n\n    templateFor(component) {\n      var {\n        layout,\n        layoutName\n      } = component;\n      var owner = (0, _owner.getOwner)(component);\n      var factory;\n\n      if (layout === undefined) {\n        if (layoutName !== undefined) {\n          var _factory = owner.lookup(\"template:\" + layoutName);\n\n          (true && !(_factory !== undefined) && (0, _debug.assert)(\"Layout `\" + layoutName + \"` not found!\", _factory !== undefined));\n          factory = _factory;\n        } else {\n          factory = owner.lookup(DEFAULT_LAYOUT);\n        }\n      } else if (isTemplateFactory(layout)) {\n        factory = layout;\n      } else {\n        // we were provided an instance already\n        return layout;\n      }\n\n      return factory(owner);\n    }\n\n    getDynamicLayout(bucket) {\n      var component = bucket.component;\n      var template$$1 = this.templateFor(component);\n      var layout = template$$1.asWrappedLayout();\n\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        bucket.environment.debugRenderTree.setTemplate(bucket, template$$1);\n      }\n\n      return {\n        handle: layout.compile(),\n        symbolTable: layout.symbolTable\n      };\n    }\n\n    getTagName(state) {\n      var {\n        component,\n        hasWrappedElement\n      } = state;\n\n      if (!hasWrappedElement) {\n        return null;\n      }\n\n      return component && component.tagName || 'div';\n    }\n\n    getCapabilities(state) {\n      return state.capabilities;\n    }\n\n    prepareArgs(state, args) {\n      if (args.named.has('__ARGS__')) {\n        var _a = args.named.capture().map,\n            {\n          __ARGS__\n        } = _a,\n            rest = __rest(_a, [\"__ARGS__\"]);\n\n        var prepared = {\n          positional: EMPTY_POSITIONAL_ARGS,\n          named: (0, _polyfills.assign)({}, rest, __ARGS__.value())\n        };\n        return prepared;\n      }\n\n      var {\n        positionalParams\n      } = state.ComponentClass.class; // early exits\n\n      if (positionalParams === undefined || positionalParams === null || args.positional.length === 0) {\n        return null;\n      }\n\n      var named;\n\n      if (typeof positionalParams === 'string') {\n        (true && !(!args.named.has(positionalParams)) && (0, _debug.assert)(\"You cannot specify positional parameters and the hash argument `\" + positionalParams + \"`.\", !args.named.has(positionalParams)));\n        named = {\n          [positionalParams]: args.positional.capture()\n        };\n        (0, _polyfills.assign)(named, args.named.capture().map);\n      } else if (Array.isArray(positionalParams) && positionalParams.length > 0) {\n        var count = Math.min(positionalParams.length, args.positional.length);\n        named = {};\n        (0, _polyfills.assign)(named, args.named.capture().map);\n\n        for (var i = 0; i < count; i++) {\n          var name = positionalParams[i];\n          (true && !(!args.named.has(name)) && (0, _debug.assert)(\"You cannot specify both a positional param (at position \" + i + \") and the hash argument `\" + name + \"`.\", !args.named.has(name)));\n          named[name] = args.positional.at(i);\n        }\n      } else {\n        return null;\n      }\n\n      return {\n        positional: _util.EMPTY_ARRAY,\n        named\n      };\n    }\n    /*\n     * This hook is responsible for actually instantiating the component instance.\n     * It also is where we perform additional bookkeeping to support legacy\n     * features like exposed by view mixins like ChildViewSupport, ActionSupport,\n     * etc.\n     */\n\n\n    create(environment, state, args, dynamicScope, callerSelfRef, hasBlock) {\n      // Get the nearest concrete component instance from the scope. \"Virtual\"\n      // components will be skipped.\n      var parentView = dynamicScope.view; // Get the Ember.Component subclass to instantiate for this component.\n\n      var factory = state.ComponentClass; // Capture the arguments, which tells Glimmer to give us our own, stable\n      // copy of the Arguments object that is safe to hold on to between renders.\n\n      var capturedArgs = args.named.capture();\n      var props = processComponentArgs(capturedArgs); // Alias `id` argument to `elementId` property on the component instance.\n\n      aliasIdToElementId(args, props); // Set component instance's parentView property to point to nearest concrete\n      // component.\n\n      props.parentView = parentView; // Set whether this component was invoked with a block\n      // (`{{#my-component}}{{/my-component}}`) or without one\n      // (`{{my-component}}`).\n\n      props[HAS_BLOCK] = hasBlock; // Save the current `this` context of the template as the component's\n      // `_target`, so bubbled actions are routed to the right place.\n\n      props._target = callerSelfRef.value(); // static layout asserts CurriedDefinition\n\n      if (state.template) {\n        props.layout = state.template;\n      } // caller:\n      // <FaIcon @name=\"bug\" />\n      //\n      // callee:\n      // <i class=\"fa-{{@name}}\"></i>\n      // Now that we've built up all of the properties to set on the component instance,\n      // actually create it.\n\n\n      var component = factory.create(props);\n      var finalizer = (0, _instrumentation._instrumentStart)('render.component', initialRenderInstrumentDetails, component); // We become the new parentView for downstream components, so save our\n      // component off on the dynamic scope.\n\n      dynamicScope.view = component; // Unless we're the root component, we need to add ourselves to our parent\n      // component's childViews array.\n\n      if (parentView !== null && parentView !== undefined) {\n        (0, _views.addChildView)(parentView, component);\n      }\n\n      component.trigger('didReceiveAttrs');\n      var hasWrappedElement = component.tagName !== ''; // We usually do this in the `didCreateElement`, but that hook doesn't fire for tagless components\n\n      if (!hasWrappedElement) {\n        if (environment.isInteractive) {\n          component.trigger('willRender');\n        }\n\n        component._transitionTo('hasElement');\n\n        if (environment.isInteractive) {\n          component.trigger('willInsertElement');\n        }\n      } // Track additional lifecycle metadata about this component in a state bucket.\n      // Essentially we're saving off all the state we'll need in the future.\n\n\n      var bucket = new ComponentStateBucket(environment, component, capturedArgs, finalizer, hasWrappedElement);\n\n      if (args.named.has('class')) {\n        bucket.classRef = args.named.get('class');\n      }\n\n      if (true\n      /* DEBUG */\n      ) {\n        processComponentInitializationAssertions(component, props);\n      }\n\n      if (environment.isInteractive && hasWrappedElement) {\n        component.trigger('willRender');\n      }\n\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        environment.debugRenderTree.create(bucket, {\n          type: 'component',\n          name: state.name,\n          args: args.capture(),\n          instance: component,\n          template: state.template\n        });\n      }\n\n      return bucket;\n    }\n\n    getSelf({\n      rootRef\n    }) {\n      return rootRef;\n    }\n\n    didCreateElement({\n      component,\n      classRef,\n      environment,\n      rootRef\n    }, element, operations) {\n      (0, _views.setViewElement)(component, element);\n      (0, _views.setElementView)(element, component);\n      var {\n        attributeBindings,\n        classNames,\n        classNameBindings\n      } = component;\n\n      if (attributeBindings && attributeBindings.length) {\n        applyAttributeBindings(element, attributeBindings, component, rootRef, operations);\n      } else {\n        var id$$1 = component.elementId ? component.elementId : (0, _utils.guidFor)(component);\n        operations.setAttribute('id', _runtime2.PrimitiveReference.create(id$$1), false, null);\n\n        if (_deprecatedFeatures.EMBER_COMPONENT_IS_VISIBLE && IsVisibleBinding !== undefined) {\n          IsVisibleBinding.install(element, component, rootRef, operations);\n        }\n      }\n\n      if (classRef) {\n        var ref = new SimpleClassNameBindingReference(classRef, classRef['propertyKey']);\n        operations.setAttribute('class', ref, false, null);\n      }\n\n      if (classNames && classNames.length) {\n        classNames.forEach(name => {\n          operations.setAttribute('class', _runtime2.PrimitiveReference.create(name), false, null);\n        });\n      }\n\n      if (classNameBindings && classNameBindings.length) {\n        classNameBindings.forEach(binding => {\n          ClassNameBinding.install(element, rootRef, binding, operations);\n        });\n      }\n\n      operations.setAttribute('class', _runtime2.PrimitiveReference.create('ember-view'), false, null);\n\n      if ('ariaRole' in component) {\n        operations.setAttribute('role', referenceForKey(rootRef, 'ariaRole'), false, null);\n      }\n\n      component._transitionTo('hasElement');\n\n      if (environment.isInteractive) {\n        component.trigger('willInsertElement');\n      }\n    }\n\n    didRenderLayout(bucket, bounds) {\n      bucket.component[BOUNDS] = bounds;\n      bucket.finalize();\n\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        bucket.environment.debugRenderTree.didRender(bucket, bounds);\n      }\n    }\n\n    getTag({\n      args,\n      component\n    }) {\n      return args ? (0, _reference.combine)([args.tag, component[DIRTY_TAG]]) : component[DIRTY_TAG];\n    }\n\n    didCreate({\n      component,\n      environment\n    }) {\n      if (environment.isInteractive) {\n        component._transitionTo('inDOM');\n\n        component.trigger('didInsertElement');\n        component.trigger('didRender');\n      }\n    }\n\n    update(bucket) {\n      var {\n        component,\n        args,\n        argsRevision,\n        environment\n      } = bucket;\n\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        environment.debugRenderTree.update(bucket);\n      }\n\n      bucket.finalizer = (0, _instrumentation._instrumentStart)('render.component', rerenderInstrumentDetails, component);\n\n      if (args && !(0, _reference.validate)(args.tag, argsRevision)) {\n        var props = processComponentArgs(args);\n        bucket.argsRevision = (0, _reference.value)(args.tag);\n        component[IS_DISPATCHING_ATTRS] = true;\n        component.setProperties(props);\n        component[IS_DISPATCHING_ATTRS] = false;\n        component.trigger('didUpdateAttrs');\n        component.trigger('didReceiveAttrs');\n      }\n\n      if (environment.isInteractive) {\n        component.trigger('willUpdate');\n        component.trigger('willRender');\n      }\n    }\n\n    didUpdateLayout(bucket, bounds) {\n      bucket.finalize();\n\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        bucket.environment.debugRenderTree.didRender(bucket, bounds);\n      }\n    }\n\n    didUpdate({\n      component,\n      environment\n    }) {\n      if (environment.isInteractive) {\n        component.trigger('didUpdate');\n        component.trigger('didRender');\n      }\n    }\n\n    getDestructor(bucket) {\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        return {\n          destroy() {\n            bucket.environment.debugRenderTree.willDestroy(bucket);\n            bucket.destroy();\n          }\n\n        };\n      } else {\n        return bucket;\n      }\n    }\n\n  }\n\n  function processComponentInitializationAssertions(component, props) {\n    (true && !((() => {\n      var {\n        classNameBindings\n      } = component;\n\n      for (var i = 0; i < classNameBindings.length; i++) {\n        var binding = classNameBindings[i];\n\n        if (typeof binding !== 'string' || binding.length === 0) {\n          return false;\n        }\n      }\n\n      return true;\n    })()) && (0, _debug.assert)(\"classNameBindings must be non-empty strings: \" + component, (() => {\n      var {\n        classNameBindings\n      } = component;\n\n      for (var i = 0; i < classNameBindings.length; i++) {\n        var binding = classNameBindings[i];\n\n        if (typeof binding !== 'string' || binding.length === 0) {\n          return false;\n        }\n      }\n\n      return true;\n    })()));\n    (true && !((() => {\n      var {\n        classNameBindings\n      } = component;\n\n      for (var i = 0; i < classNameBindings.length; i++) {\n        var binding = classNameBindings[i];\n\n        if (binding.split(' ').length > 1) {\n          return false;\n        }\n      }\n\n      return true;\n    })()) && (0, _debug.assert)(\"classNameBindings must not have spaces in them: \" + component, (() => {\n      var {\n        classNameBindings\n      } = component;\n\n      for (var i = 0; i < classNameBindings.length; i++) {\n        var binding = classNameBindings[i];\n\n        if (binding.split(' ').length > 1) {\n          return false;\n        }\n      }\n\n      return true;\n    })()));\n    (true && !(component.tagName !== '' || !component.classNameBindings || component.classNameBindings.length === 0) && (0, _debug.assert)(\"You cannot use `classNameBindings` on a tag-less component: \" + component, component.tagName !== '' || !component.classNameBindings || component.classNameBindings.length === 0));\n    (true && !(component.tagName !== '' || props.id === component.elementId || !component.elementId && component.elementId !== '') && (0, _debug.assert)(\"You cannot use `elementId` on a tag-less component: \" + component, component.tagName !== '' || props.id === component.elementId || !component.elementId && component.elementId !== ''));\n    (true && !(component.tagName !== '' || !component.attributeBindings || component.attributeBindings.length === 0) && (0, _debug.assert)(\"You cannot use `attributeBindings` on a tag-less component: \" + component, component.tagName !== '' || !component.attributeBindings || component.attributeBindings.length === 0));\n  }\n\n  function initialRenderInstrumentDetails(component) {\n    return component.instrumentDetails({\n      initialRender: true\n    });\n  }\n\n  function rerenderInstrumentDetails(component) {\n    return component.instrumentDetails({\n      initialRender: false\n    });\n  }\n\n  var CURLY_CAPABILITIES = {\n    dynamicLayout: true,\n    dynamicTag: true,\n    prepareArgs: true,\n    createArgs: true,\n    attributeHook: true,\n    elementHook: true,\n    createCaller: true,\n    dynamicScope: true,\n    updateHook: true,\n    createInstance: true\n  };\n  var CURLY_COMPONENT_MANAGER = new CurlyComponentManager();\n\n  class CurlyComponentDefinition {\n    // tslint:disable-next-line:no-shadowed-variable\n    constructor(name, ComponentClass, handle, template$$1, args) {\n      this.name = name;\n      this.ComponentClass = ComponentClass;\n      this.handle = handle;\n      this.template = template$$1;\n      this.manager = CURLY_COMPONENT_MANAGER;\n      var layout = template$$1 && template$$1.asLayout();\n      var symbolTable = layout ? layout.symbolTable : undefined;\n      this.symbolTable = symbolTable;\n      this.template = template$$1;\n      this.args = args;\n      this.state = {\n        name,\n        ComponentClass,\n        handle,\n        template: template$$1,\n        capabilities: CURLY_CAPABILITIES,\n        symbolTable\n      };\n    }\n\n  }\n\n  class RootComponentManager extends CurlyComponentManager {\n    constructor(component) {\n      super();\n      this.component = component;\n    }\n\n    getLayout(_state) {\n      var template = this.templateFor(this.component);\n      var layout = template.asWrappedLayout();\n      return {\n        handle: layout.compile(),\n        symbolTable: layout.symbolTable\n      };\n    }\n\n    create(environment, state, _args, dynamicScope) {\n      var component = this.component;\n      var finalizer = (0, _instrumentation._instrumentStart)('render.component', initialRenderInstrumentDetails, component);\n      dynamicScope.view = component;\n      var hasWrappedElement = component.tagName !== ''; // We usually do this in the `didCreateElement`, but that hook doesn't fire for tagless components\n\n      if (!hasWrappedElement) {\n        if (environment.isInteractive) {\n          component.trigger('willRender');\n        }\n\n        component._transitionTo('hasElement');\n\n        if (environment.isInteractive) {\n          component.trigger('willInsertElement');\n        }\n      }\n\n      if (true\n      /* DEBUG */\n      ) {\n        processComponentInitializationAssertions(component, {});\n      }\n\n      var bucket = new ComponentStateBucket(environment, component, null, finalizer, hasWrappedElement);\n\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        environment.debugRenderTree.create(bucket, {\n          type: 'component',\n          name: state.name,\n          args: _runtime2.EMPTY_ARGS,\n          instance: component,\n          template: state.template\n        });\n      }\n\n      return bucket;\n    }\n\n  } // ROOT is the top-level template it has nothing but one yield.\n  // it is supposed to have a dummy element\n\n\n  var ROOT_CAPABILITIES = {\n    dynamicLayout: false,\n    dynamicTag: true,\n    prepareArgs: false,\n    createArgs: false,\n    attributeHook: true,\n    elementHook: true,\n    createCaller: true,\n    dynamicScope: true,\n    updateHook: true,\n    createInstance: true\n  };\n\n  class RootComponentDefinition {\n    constructor(component) {\n      this.component = component;\n      var manager = new RootComponentManager(component);\n      this.manager = manager;\n\n      var factory = _container.FACTORY_FOR.get(component);\n\n      this.state = {\n        name: factory.fullName.slice(10),\n        capabilities: ROOT_CAPABILITIES,\n        ComponentClass: factory,\n        handle: null\n      };\n    }\n\n    getTag({\n      component\n    }) {\n      return component[DIRTY_TAG];\n    }\n\n  }\n\n  class DynamicScope {\n    constructor(view, outletState) {\n      this.view = view;\n      this.outletState = outletState;\n    }\n\n    child() {\n      return new DynamicScope(this.view, this.outletState);\n    }\n\n    get(key) {\n      // tslint:disable-next-line:max-line-length\n      (true && !(key === 'outletState') && (0, _debug.assert)(\"Using `-get-dynamic-scope` is only supported for `outletState` (you used `\" + key + \"`).\", key === 'outletState'));\n      return this.outletState;\n    }\n\n    set(key, value$$1) {\n      // tslint:disable-next-line:max-line-length\n      (true && !(key === 'outletState') && (0, _debug.assert)(\"Using `-with-dynamic-scope` is only supported for `outletState` (you used `\" + key + \"`).\", key === 'outletState'));\n      this.outletState = value$$1;\n      return value$$1;\n    }\n\n  }\n\n  class RootState {\n    constructor(root, env, template, self, parentElement, dynamicScope, builder) {\n      (true && !(template !== undefined) && (0, _debug.assert)(\"You cannot render `\" + self.value() + \"` without a template.\", template !== undefined));\n      this.id = (0, _views.getViewId)(root);\n      this.env = env;\n      this.root = root;\n      this.result = undefined;\n      this.shouldReflush = false;\n      this.destroyed = false;\n\n      this.render = () => {\n        var layout = template.asLayout();\n        var handle = layout.compile();\n        var iterator = (0, _runtime2.renderMain)(layout['compiler'].program, env, self, dynamicScope, builder(env, {\n          element: parentElement,\n          nextSibling: null\n        }), handle);\n        var iteratorResult;\n\n        do {\n          iteratorResult = iterator.next();\n        } while (!iteratorResult.done);\n\n        var result = this.result = iteratorResult.value; // override .render function after initial render\n\n        this.render = () => result.rerender({\n          alwaysRevalidate: false\n        });\n      };\n    }\n\n    isFor(possibleRoot) {\n      return this.root === possibleRoot;\n    }\n\n    destroy() {\n      var {\n        result,\n        env\n      } = this;\n      this.destroyed = true;\n      this.env = undefined;\n      this.root = null;\n      this.result = undefined;\n      this.render = undefined;\n\n      if (result) {\n        /*\n         Handles these scenarios:\n                * When roots are removed during standard rendering process, a transaction exists already\n           `.begin()` / `.commit()` are not needed.\n         * When roots are being destroyed manually (`component.append(); component.destroy() case), no\n           transaction exists already.\n         * When roots are being destroyed during `Renderer#destroy`, no transaction exists\n                */\n        var needsTransaction = !env.inTransaction;\n\n        if (needsTransaction) {\n          env.begin();\n        }\n\n        try {\n          result.destroy();\n        } finally {\n          if (needsTransaction) {\n            env.commit();\n          }\n        }\n      }\n    }\n\n  }\n\n  var renderers = [];\n\n  function _resetRenderers() {\n    renderers.length = 0;\n  }\n\n  function register(renderer) {\n    (true && !(renderers.indexOf(renderer) === -1) && (0, _debug.assert)('Cannot register the same renderer twice', renderers.indexOf(renderer) === -1));\n    renderers.push(renderer);\n  }\n\n  function deregister(renderer) {\n    var index = renderers.indexOf(renderer);\n    (true && !(index !== -1) && (0, _debug.assert)('Cannot deregister unknown unregistered renderer', index !== -1));\n    renderers.splice(index, 1);\n  }\n\n  function loopBegin() {\n    for (var i = 0; i < renderers.length; i++) {\n      renderers[i]._scheduleRevalidate();\n    }\n  }\n\n  function K() {\n    /* noop */\n  }\n\n  var renderSettledDeferred = null;\n  /*\n    Returns a promise which will resolve when rendering has settled. Settled in\n    this context is defined as when all of the tags in use are \"current\" (e.g.\n    `renderers.every(r => r._isValid())`). When this is checked at the _end_ of\n    the run loop, this essentially guarantees that all rendering is completed.\n  \n    @method renderSettled\n    @returns {Promise<void>} a promise which fulfills when rendering has settled\n  */\n\n  function renderSettled() {\n    if (renderSettledDeferred === null) {\n      renderSettledDeferred = _rsvp.default.defer(); // if there is no current runloop, the promise created above will not have\n      // a chance to resolve (because its resolved in backburner's \"end\" event)\n\n      if (!(0, _runloop.getCurrentRunLoop)()) {\n        // ensure a runloop has been kicked off\n        _runloop.backburner.schedule('actions', null, K);\n      }\n    }\n\n    return renderSettledDeferred.promise;\n  }\n\n  function resolveRenderPromise() {\n    if (renderSettledDeferred !== null) {\n      var resolve = renderSettledDeferred.resolve;\n      renderSettledDeferred = null;\n\n      _runloop.backburner.join(null, resolve);\n    }\n  }\n\n  var loops = 0;\n\n  function loopEnd() {\n    for (var i = 0; i < renderers.length; i++) {\n      if (!renderers[i]._isValid()) {\n        if (loops > _environment2.ENV._RERENDER_LOOP_LIMIT) {\n          loops = 0; // TODO: do something better\n\n          renderers[i].destroy();\n          throw new Error('infinite rendering invalidation detected');\n        }\n\n        loops++;\n        return _runloop.backburner.join(null, K);\n      }\n    }\n\n    loops = 0;\n    resolveRenderPromise();\n  }\n\n  _runloop.backburner.on('begin', loopBegin);\n\n  _runloop.backburner.on('end', loopEnd);\n\n  class Renderer {\n    constructor(env, rootTemplate, viewRegistry, destinedForDOM = false, builder = _runtime2.clientBuilder) {\n      this._env = env;\n      this._rootTemplate = rootTemplate(env.owner);\n      this._viewRegistry = viewRegistry;\n      this._destinedForDOM = destinedForDOM;\n      this._destroyed = false;\n      this._roots = [];\n      this._lastRevision = -1;\n      this._isRenderingRoots = false;\n      this._removedRoots = [];\n      this._builder = builder;\n    } // renderer HOOKS\n\n\n    appendOutletView(view, target) {\n      var definition = createRootOutlet(view);\n\n      this._appendDefinition(view, (0, _runtime2.curry)(definition), target);\n    }\n\n    appendTo(view, target) {\n      var definition = new RootComponentDefinition(view);\n\n      this._appendDefinition(view, (0, _runtime2.curry)(definition), target);\n    }\n\n    _appendDefinition(root, definition, target) {\n      var self = new UnboundReference(definition);\n      var dynamicScope = new DynamicScope(null, _runtime2.UNDEFINED_REFERENCE);\n      var rootState = new RootState(root, this._env, this._rootTemplate, self, target, dynamicScope, this._builder);\n\n      this._renderRoot(rootState);\n    }\n\n    rerender() {\n      this._scheduleRevalidate();\n    }\n\n    register(view) {\n      var id = (0, _views.getViewId)(view);\n      (true && !(!this._viewRegistry[id]) && (0, _debug.assert)('Attempted to register a view with an id already in use: ' + id, !this._viewRegistry[id]));\n      this._viewRegistry[id] = view;\n    }\n\n    unregister(view) {\n      delete this._viewRegistry[(0, _views.getViewId)(view)];\n    }\n\n    remove(view) {\n      view._transitionTo('destroying');\n\n      this.cleanupRootFor(view);\n\n      if (this._destinedForDOM) {\n        view.trigger('didDestroyElement');\n      }\n    }\n\n    cleanupRootFor(view) {\n      // no need to cleanup roots if we have already been destroyed\n      if (this._destroyed) {\n        return;\n      }\n\n      var roots = this._roots; // traverse in reverse so we can remove items\n      // without mucking up the index\n\n      var i = this._roots.length;\n\n      while (i--) {\n        var root = roots[i];\n\n        if (root.isFor(view)) {\n          root.destroy();\n          roots.splice(i, 1);\n        }\n      }\n    }\n\n    destroy() {\n      if (this._destroyed) {\n        return;\n      }\n\n      this._destroyed = true;\n\n      this._clearAllRoots();\n    }\n\n    getBounds(view) {\n      var bounds = view[BOUNDS];\n      (true && !(Boolean(bounds)) && (0, _debug.assert)('object passed to getBounds must have the BOUNDS symbol as a property', Boolean(bounds)));\n      var parentElement = bounds.parentElement();\n      var firstNode = bounds.firstNode();\n      var lastNode = bounds.lastNode();\n      return {\n        parentElement,\n        firstNode,\n        lastNode\n      };\n    }\n\n    createElement(tagName) {\n      return this._env.getAppendOperations().createElement(tagName);\n    }\n\n    _renderRoot(root) {\n      var {\n        _roots: roots\n      } = this;\n      roots.push(root);\n\n      if (roots.length === 1) {\n        register(this);\n      }\n\n      this._renderRootsTransaction();\n    }\n\n    _renderRoots() {\n      var {\n        _roots: roots,\n        _env: env,\n        _removedRoots: removedRoots\n      } = this;\n      var initialRootsLength;\n\n      do {\n        env.begin();\n\n        try {\n          // ensure that for the first iteration of the loop\n          // each root is processed\n          initialRootsLength = roots.length;\n\n          for (var i = 0; i < roots.length; i++) {\n            var root = roots[i];\n\n            if (root.destroyed) {\n              // add to the list of roots to be removed\n              // they will be removed from `this._roots` later\n              removedRoots.push(root); // skip over roots that have been marked as destroyed\n\n              continue;\n            } // when processing non-initial reflush loops,\n            // do not process more roots than needed\n\n\n            if (i >= initialRootsLength) {\n              continue;\n            }\n\n            if (true\n            /* DEBUG */\n            ) {\n              // run in an autotracking transaction to prevent backflow errors.\n              // we use `bind` here to avoid creating a closure (and requiring a\n              // hoisted variable).\n              (0, _metal.runInAutotrackingTransaction)(root.render.bind(root));\n            } else {\n              root.render();\n            }\n          }\n\n          this._lastRevision = (0, _reference.value)(_reference.CURRENT_TAG);\n        } finally {\n          env.commit();\n        }\n      } while (roots.length > initialRootsLength); // remove any roots that were destroyed during this transaction\n\n\n      while (removedRoots.length) {\n        var _root = removedRoots.pop();\n\n        var rootIndex = roots.indexOf(_root);\n        roots.splice(rootIndex, 1);\n      }\n\n      if (this._roots.length === 0) {\n        deregister(this);\n      }\n    }\n\n    _renderRootsTransaction() {\n      if (this._isRenderingRoots) {\n        // currently rendering roots, a new root was added and will\n        // be processed by the existing _renderRoots invocation\n        return;\n      } // used to prevent calling _renderRoots again (see above)\n      // while we are actively rendering roots\n\n\n      this._isRenderingRoots = true;\n      var completedWithoutError = false;\n\n      try {\n        this._renderRoots();\n\n        completedWithoutError = true;\n      } finally {\n        if (!completedWithoutError) {\n          this._lastRevision = (0, _reference.value)(_reference.CURRENT_TAG);\n\n          if (this._env.inTransaction === true) {\n            this._env.commit();\n          }\n        }\n\n        this._isRenderingRoots = false;\n      }\n    }\n\n    _clearAllRoots() {\n      var roots = this._roots;\n\n      for (var i = 0; i < roots.length; i++) {\n        var root = roots[i];\n        root.destroy();\n      }\n\n      this._removedRoots.length = 0;\n      this._roots = []; // if roots were present before destroying\n      // deregister this renderer instance\n\n      if (roots.length) {\n        deregister(this);\n      }\n    }\n\n    _scheduleRevalidate() {\n      _runloop.backburner.scheduleOnce('render', this, this._revalidate);\n    }\n\n    _isValid() {\n      return this._destroyed || this._roots.length === 0 || (0, _reference.validate)(_reference.CURRENT_TAG, this._lastRevision);\n    }\n\n    _revalidate() {\n      if (this._isValid()) {\n        return;\n      }\n\n      this._renderRootsTransaction();\n    }\n\n  }\n\n  _exports.Renderer = Renderer;\n\n  class InertRenderer extends Renderer {\n    static create({\n      env,\n      rootTemplate,\n      _viewRegistry,\n      builder\n    }) {\n      return new this(env, rootTemplate, _viewRegistry, false, builder);\n    }\n\n    getElement(_view) {\n      throw new Error('Accessing `this.element` is not allowed in non-interactive environments (such as FastBoot).');\n    }\n\n  }\n\n  _exports.InertRenderer = InertRenderer;\n\n  class InteractiveRenderer extends Renderer {\n    static create({\n      env,\n      rootTemplate,\n      _viewRegistry,\n      builder\n    }) {\n      return new this(env, rootTemplate, _viewRegistry, true, builder);\n    }\n\n    getElement(view) {\n      return (0, _views.getViewElement)(view);\n    }\n\n  }\n\n  _exports.InteractiveRenderer = InteractiveRenderer;\n  var TEMPLATES = {};\n\n  function setTemplates(templates) {\n    TEMPLATES = templates;\n  }\n\n  function getTemplates() {\n    return TEMPLATES;\n  }\n\n  function getTemplate(name) {\n    if (TEMPLATES.hasOwnProperty(name)) {\n      return TEMPLATES[name];\n    }\n  }\n\n  function hasTemplate(name) {\n    return TEMPLATES.hasOwnProperty(name);\n  }\n\n  function setTemplate(name, template) {\n    return TEMPLATES[name] = template;\n  }\n\n  class InternalComponentDefinition {\n    constructor(manager, ComponentClass, layout) {\n      this.manager = manager;\n      this.state = {\n        ComponentClass,\n        layout\n      };\n    }\n\n  }\n\n  class InternalManager extends AbstractManager {\n    constructor(owner) {\n      super();\n      this.owner = owner;\n    }\n\n    getLayout({\n      layout: _layout\n    }) {\n      var layout = _layout.asLayout();\n\n      return {\n        handle: layout.compile(),\n        symbolTable: layout.symbolTable\n      };\n    }\n\n  }\n\n  var CAPABILITIES$1 = {\n    dynamicLayout: false,\n    dynamicTag: false,\n    prepareArgs: true,\n    createArgs: true,\n    attributeHook: false,\n    elementHook: false,\n    createCaller: true,\n    dynamicScope: false,\n    updateHook: true,\n    createInstance: true\n  };\n  var EMPTY_POSITIONAL_ARGS$1 = [];\n  (0, _debug.debugFreeze)(EMPTY_POSITIONAL_ARGS$1);\n\n  class InputComponentManager extends InternalManager {\n    getCapabilities() {\n      return CAPABILITIES$1;\n    }\n\n    prepareArgs(_state, args) {\n      (true && !(args.positional.length === 0) && (0, _debug.assert)('The `<Input />` component does not take any positional arguments', args.positional.length === 0));\n      var __ARGS__ = args.named.capture().map;\n      return {\n        positional: EMPTY_POSITIONAL_ARGS$1,\n        named: {\n          __ARGS__: new RootReference(__ARGS__),\n          type: args.named.get('type')\n        }\n      };\n    }\n\n    create(env, {\n      ComponentClass,\n      layout\n    }, args, _dynamicScope, caller) {\n      (true && !((0, _reference.isConst)(caller)) && (0, _debug.assert)('caller must be const', (0, _reference.isConst)(caller)));\n      var type = args.named.get('type');\n      var instance = ComponentClass.create({\n        caller: caller.value(),\n        type: type.value()\n      });\n      var state = {\n        env,\n        type,\n        instance\n      };\n\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        env.debugRenderTree.create(state, {\n          type: 'component',\n          name: 'input',\n          args: args.capture(),\n          instance,\n          template: layout\n        });\n      }\n\n      return state;\n    }\n\n    getSelf({\n      env,\n      instance\n    }) {\n      return new RootReference(instance, env);\n    }\n\n    getTag() {\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        // returning a const tag skips the update hook (VM BUG?)\n        return (0, _reference.createTag)();\n      } else {\n        // an outlet has no hooks\n        return _reference.CONSTANT_TAG;\n      }\n    }\n\n    didRenderLayout(state, bounds) {\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        state.env.debugRenderTree.didRender(state, bounds);\n      }\n    }\n\n    update(state) {\n      (0, _metal.set)(state.instance, 'type', state.type.value());\n\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        state.env.debugRenderTree.update(state);\n      }\n    }\n\n    didUpdateLayout(state, bounds) {\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        state.env.debugRenderTree.didRender(state, bounds);\n      }\n    }\n\n    getDestructor(state) {\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        return {\n          destroy() {\n            state.env.debugRenderTree.willDestroy(state);\n            state.instance.destroy();\n          }\n\n        };\n      } else {\n        return state.instance;\n      }\n    }\n\n  }\n\n  var InputComponentManagerFactory = owner => {\n    return new InputComponentManager(owner);\n  };\n\n  var MANAGERS = new WeakMap();\n  var getPrototypeOf = Object.getPrototypeOf;\n\n  function setManager(wrapper, obj) {\n    MANAGERS.set(obj, wrapper);\n    return obj;\n  }\n\n  function getManager(obj) {\n    var pointer = obj;\n\n    while (pointer !== undefined && pointer !== null) {\n      var manager = MANAGERS.get(pointer);\n\n      if (manager !== undefined) {\n        return manager;\n      }\n\n      pointer = getPrototypeOf(pointer);\n    }\n\n    return null;\n  }\n  /**\n  @module @ember/component\n  */\n\n  /**\n    See [Ember.Templates.components.Input](/ember/release/classes/Ember.Templates.components/methods/Input?anchor=Input).\n  \n    @method input\n    @for Ember.Templates.helpers\n    @param {Hash} options\n    @public\n    */\n\n  /**\n    The `Input` component lets you create an HTML `<input>` element.\n  \n    ```handlebars\n    <Input @value=\"987\" />\n    ```\n  \n    creates an `<input>` element with `type=\"text\"` and value set to 987.\n  \n    ### Text field\n  \n    If no `type` argument is specified, a default of type 'text' is used.\n  \n    ```handlebars\n    Search:\n    <Input @value={{this.searchWord}}>\n    ```\n  \n    In this example, the initial value in the `<input>` will be set to the value of\n    `this.searchWord`. If the user changes the text, the value of `this.searchWord` will also be\n    updated.\n  \n    ### Actions\n  \n    The `Input` component takes a number of arguments with callbacks that are invoked in response to\n    user events.\n  \n    * `enter`\n    * `insert-newline`\n    * `escape-press`\n    * `focus-in`\n    * `focus-out`\n    * `key-press`\n    * `key-up`\n  \n    These callbacks are passed to `Input` like this:\n  \n    ```handlebars\n    <Input @value={{this.searchWord}} @enter={{this.query}} />\n    ```\n  \n    ### `<input>` HTML Attributes to Avoid\n  \n    In most cases, if you want to pass an attribute to the underlying HTML `<input>` element, you\n    can pass the attribute directly, just like any other Ember component.\n  \n    ```handlebars\n    <Input @type=\"text\" size=\"10\" />\n    ```\n  \n    In this example, the `size` attribute will be applied to the underlying `<input>` element in the\n    outputted HTML.\n  \n    However, there are a few attributes where you **must** use the `@` version.\n  \n    * `@type`: This argument is used to control which Ember component is used under the hood\n    * `@value`: The `@value` argument installs a two-way binding onto the element. If you wanted a\n      one-way binding, use `<input>` with the `value` property and the `input` event instead.\n    * `@checked` (for checkboxes): like `@value`, the `@checked` argument installs a two-way binding\n      onto the element. If you wanted a one-way binding, use `<input type=\"checkbox\">` with\n      `checked` and the `input` event instead.\n  \n    ### Extending `TextField`\n  \n    Internally, `<Input @type=\"text\" />` creates an instance of `TextField`, passing arguments from\n    the helper to `TextField`'s `create` method. Subclassing `TextField` is supported but not\n    recommended.\n  \n    See [TextField](/ember/release/classes/TextField)\n  \n    ### Checkbox\n  \n    To create an `<input type=\"checkbox\">`:\n  \n    ```handlebars\n    Emberize Everything:\n    <Input @type=\"checkbox\" @checked={{this.isEmberized}} name=\"isEmberized\" />\n    ```\n  \n    This will bind the checked state of this checkbox to the value of `isEmberized` -- if either one\n    changes, it will be reflected in the other.\n  \n    ### Extending `Checkbox`\n  \n    Internally, `<Input @type=\"checkbox\" />` creates an instance of `Checkbox`. Subclassing\n    `TextField` is supported but not recommended.\n  \n    See [Checkbox](/ember/release/classes/Checkbox)\n  \n    @method Input\n    @for Ember.Templates.components\n    @see {TextField}\n    @see {Checkbox}\n    @param {Hash} options\n    @public\n  */\n\n\n  var Input = _runtime.Object.extend({\n    isCheckbox: (0, _metal.computed)('type', function () {\n      return this.type === 'checkbox';\n    })\n  });\n\n  setManager({\n    factory: InputComponentManagerFactory,\n    internal: true,\n    type: 'component'\n  }, Input);\n\n  Input.toString = () => '@ember/component/input'; ///<reference path=\"./simple-dom.d.ts\" />\n\n  /**\n  @module ember\n  */\n\n  /**\n    Calls [String.loc](/ember/release/classes/String/methods/loc?anchor=loc) with the\n    provided string. This is a convenient way to localize text within a template.\n    For example:\n  \n    ```javascript\n    Ember.STRINGS = {\n      '_welcome_': 'Bonjour'\n    };\n    ```\n  \n    ```handlebars\n    <div class='message'>\n      {{loc '_welcome_'}}\n    </div>\n    ```\n  \n    ```html\n    <div class='message'>\n      Bonjour\n    </div>\n    ```\n  \n    See [String.loc](/ember/release/classes/String/methods/loc?anchor=loc) for how to\n    set up localized string references.\n  \n    @method loc\n    @for Ember.Templates.helpers\n    @param {String} str The string to format.\n    @see {String#loc}\n    @public\n  */\n\n\n  var loc$1 = helper(function (params) {\n    return _string.loc.apply(null, params\n    /* let the other side handle errors */\n    );\n  });\n\n  class CompileTimeLookup {\n    constructor(resolver) {\n      this.resolver = resolver;\n    }\n\n    getCapabilities(handle) {\n      var definition = this.resolver.resolve(handle);\n      var {\n        manager,\n        state\n      } = definition;\n      return manager.getCapabilities(state);\n    }\n\n    getLayout(handle) {\n      var {\n        manager,\n        state\n      } = this.resolver.resolve(handle);\n      var capabilities = manager.getCapabilities(state);\n\n      if (capabilities.dynamicLayout) {\n        return null;\n      }\n\n      var invocation = manager.getLayout(state, this.resolver);\n      return {\n        // TODO: this seems weird, it already is compiled\n        compile() {\n          return invocation.handle;\n        },\n\n        symbolTable: invocation.symbolTable\n      };\n    }\n\n    lookupHelper(name, referrer) {\n      return this.resolver.lookupHelper(name, referrer);\n    }\n\n    lookupModifier(name, referrer) {\n      return this.resolver.lookupModifier(name, referrer);\n    }\n\n    lookupComponentDefinition(name, referrer) {\n      return this.resolver.lookupComponentHandle(name, referrer);\n    }\n\n    lookupPartial(name, referrer) {\n      return this.resolver.lookupPartial(name, referrer);\n    }\n\n  }\n\n  var CAPABILITIES$2 = {\n    dynamicLayout: false,\n    dynamicTag: false,\n    prepareArgs: false,\n    createArgs: true,\n    attributeHook: false,\n    elementHook: false,\n    createCaller: false,\n    dynamicScope: true,\n    updateHook: true,\n    createInstance: true\n  };\n\n  function capabilities(managerAPI, options = {}) {\n    (true && !(managerAPI === '3.4' || managerAPI === '3.13') && (0, _debug.assert)('Invalid component manager compatibility specified', managerAPI === '3.4' || managerAPI === '3.13'));\n    var updateHook = true;\n    {\n      updateHook = managerAPI === '3.13' ? Boolean(options.updateHook) : true;\n    }\n    return {\n      asyncLifeCycleCallbacks: Boolean(options.asyncLifecycleCallbacks),\n      destructor: Boolean(options.destructor),\n      updateHook\n    };\n  }\n\n  function hasAsyncLifeCycleCallbacks(delegate) {\n    return delegate.capabilities.asyncLifeCycleCallbacks;\n  }\n\n  function hasUpdateHook(delegate) {\n    return delegate.capabilities.updateHook;\n  }\n\n  function hasAsyncUpdateHook(delegate) {\n    return hasAsyncLifeCycleCallbacks(delegate) && hasUpdateHook(delegate);\n  }\n\n  function hasDestructors(delegate) {\n    return delegate.capabilities.destructor;\n  }\n  /**\n    The CustomComponentManager allows addons to provide custom component\n    implementations that integrate seamlessly into Ember. This is accomplished\n    through a delegate, registered with the custom component manager, which\n    implements a set of hooks that determine component behavior.\n  \n    To create a custom component manager, instantiate a new CustomComponentManager\n    class and pass the delegate as the first argument:\n  \n    ```js\n    let manager = new CustomComponentManager({\n      // ...delegate implementation...\n    });\n    ```\n  \n    ## Delegate Hooks\n  \n    Throughout the lifecycle of a component, the component manager will invoke\n    delegate hooks that are responsible for surfacing those lifecycle changes to\n    the end developer.\n  \n    * `create()` - invoked when a new instance of a component should be created\n    * `update()` - invoked when the arguments passed to a component change\n    * `getContext()` - returns the object that should be\n  */\n\n\n  class CustomComponentManager extends AbstractManager {\n    create(env, definition, args) {\n      var {\n        delegate\n      } = definition;\n      var capturedArgs = args.capture();\n      var value$$1;\n      var namedArgsProxy = {};\n      {\n        if (_utils.HAS_NATIVE_PROXY) {\n          var handler = {\n            get(_target, prop) {\n              if (capturedArgs.named.has(prop)) {\n                var ref = capturedArgs.named.get(prop);\n                (0, _metal.consume)(ref.tag);\n                return ref.value();\n              }\n            },\n\n            has(_target, prop) {\n              return capturedArgs.named.has(prop);\n            },\n\n            ownKeys(_target) {\n              return capturedArgs.named.names;\n            },\n\n            getOwnPropertyDescriptor(_target, prop) {\n              (true && !(capturedArgs.named.has(prop)) && (0, _debug.assert)('args proxies do not have real property descriptors, so you should never need to call getOwnPropertyDescriptor yourself. This code exists for enumerability, such as in for-in loops and Object.keys()', capturedArgs.named.has(prop)));\n              return {\n                enumerable: true,\n                configurable: true\n              };\n            }\n\n          };\n\n          if (true\n          /* DEBUG */\n          ) {\n            handler.set = function (_target, prop) {\n              (true && !(false) && (0, _debug.assert)(\"You attempted to set \" + definition.ComponentClass.class + \"#\" + String(prop) + \" on a components arguments. Component arguments are immutable and cannot be updated directly, they always represent the values that are passed to your component. If you want to set default values, you should use a getter instead\"));\n              return false;\n            };\n          }\n\n          namedArgsProxy = new Proxy(namedArgsProxy, handler);\n        } else {\n          capturedArgs.named.names.forEach(name => {\n            Object.defineProperty(namedArgsProxy, name, {\n              enumerable: true,\n              configurable: true,\n\n              get() {\n                var ref = capturedArgs.named.get(name);\n                (0, _metal.consume)(ref.tag);\n                return ref.value();\n              }\n\n            });\n          });\n        }\n\n        _metal.ARGS_PROXY_TAGS.set(namedArgsProxy, capturedArgs.named);\n\n        value$$1 = {\n          named: namedArgsProxy,\n          positional: capturedArgs.positional.value()\n        };\n      }\n      var component = delegate.createComponent(definition.ComponentClass.class, value$$1);\n      var bucket = new CustomComponentState(delegate, component, capturedArgs, env, namedArgsProxy);\n\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        env.debugRenderTree.create(bucket, {\n          type: 'component',\n          name: definition.name,\n          args: args.capture(),\n          instance: component,\n          template: definition.template\n        });\n      }\n\n      return bucket;\n    }\n\n    update(bucket) {\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        bucket.env.debugRenderTree.update(bucket);\n      }\n\n      var {\n        delegate,\n        component,\n        args,\n        namedArgsProxy\n      } = bucket;\n      var value$$1;\n      {\n        value$$1 = {\n          named: namedArgsProxy,\n          positional: args.positional.value()\n        };\n      }\n\n      if (hasUpdateHook(delegate)) {\n        delegate.updateComponent(component, value$$1);\n      }\n    }\n\n    didCreate({\n      delegate,\n      component\n    }) {\n      if (hasAsyncLifeCycleCallbacks(delegate)) {\n        delegate.didCreateComponent(component);\n      }\n    }\n\n    didUpdate({\n      delegate,\n      component\n    }) {\n      if (hasAsyncUpdateHook(delegate)) {\n        delegate.didUpdateComponent(component);\n      }\n    }\n\n    getContext({\n      delegate,\n      component\n    }) {\n      delegate.getContext(component);\n    }\n\n    getSelf({\n      env,\n      delegate,\n      component\n    }) {\n      return RootReference.create(delegate.getContext(component), env);\n    }\n\n    getDestructor(state) {\n      var destructor = null;\n\n      if (hasDestructors(state.delegate)) {\n        destructor = state;\n      }\n\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        var inner = destructor;\n        destructor = {\n          destroy() {\n            state.env.debugRenderTree.willDestroy(state);\n\n            if (inner) {\n              inner.destroy();\n            }\n          }\n\n        };\n      }\n\n      return destructor;\n    }\n\n    getCapabilities({\n      delegate\n    }) {\n      return (0, _polyfills.assign)({}, CAPABILITIES$2, {\n        updateHook: _environment2.ENV._DEBUG_RENDER_TREE || delegate.capabilities.updateHook\n      });\n    }\n\n    getTag({\n      args\n    }) {\n      if ((0, _reference.isConst)(args)) {\n        // returning a const tag skips the update hook (VM BUG?)\n        return (0, _reference.createTag)();\n      } else {\n        return args.tag;\n      }\n    }\n\n    didRenderLayout(bucket, bounds) {\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        bucket.env.debugRenderTree.didRender(bucket, bounds);\n      }\n    }\n\n    didUpdateLayout(bucket, bounds) {\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        bucket.env.debugRenderTree.didRender(bucket, bounds);\n      }\n    }\n\n    getLayout(state) {\n      return {\n        handle: state.template.asLayout().compile(),\n        symbolTable: state.symbolTable\n      };\n    }\n\n  }\n\n  var CUSTOM_COMPONENT_MANAGER = new CustomComponentManager();\n  /**\n   * Stores internal state about a component instance after it's been created.\n   */\n\n  class CustomComponentState {\n    constructor(delegate, component, args, env, namedArgsProxy) {\n      this.delegate = delegate;\n      this.component = component;\n      this.args = args;\n      this.env = env;\n      this.namedArgsProxy = namedArgsProxy;\n    }\n\n    destroy() {\n      var {\n        delegate,\n        component\n      } = this;\n\n      if (hasDestructors(delegate)) {\n        delegate.destroyComponent(component);\n      }\n    }\n\n  }\n\n  class CustomManagerDefinition {\n    constructor(name, ComponentClass, delegate, template) {\n      this.name = name;\n      this.ComponentClass = ComponentClass;\n      this.delegate = delegate;\n      this.template = template;\n      this.manager = CUSTOM_COMPONENT_MANAGER;\n      var layout = template.asLayout();\n      var symbolTable = layout.symbolTable;\n      this.symbolTable = symbolTable;\n      this.state = {\n        name,\n        ComponentClass,\n        template,\n        symbolTable,\n        delegate\n      };\n    }\n\n  }\n\n  var CAPABILITIES$3 = {\n    dynamicLayout: false,\n    dynamicTag: false,\n    prepareArgs: false,\n    createArgs: _environment2.ENV._DEBUG_RENDER_TREE,\n    attributeHook: false,\n    elementHook: false,\n    createCaller: false,\n    dynamicScope: false,\n    updateHook: _environment2.ENV._DEBUG_RENDER_TREE,\n    createInstance: true\n  };\n\n  class TemplateOnlyComponentManager extends AbstractManager {\n    getLayout({\n      template\n    }) {\n      var layout = template.asLayout();\n      return {\n        handle: layout.compile(),\n        symbolTable: layout.symbolTable\n      };\n    }\n\n    getCapabilities() {\n      return CAPABILITIES$3;\n    }\n\n    create(environment, {\n      name,\n      template\n    }, args) {\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        var bucket = {\n          environment\n        };\n        environment.debugRenderTree.create(bucket, {\n          type: 'component',\n          name: name,\n          args: args.capture(),\n          instance: null,\n          template\n        });\n        return bucket;\n      } else {\n        return null;\n      }\n    }\n\n    getSelf() {\n      return _runtime2.NULL_REFERENCE;\n    }\n\n    getTag() {\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        // returning a const tag skips the update hook (VM BUG?)\n        return (0, _reference.createTag)();\n      } else {\n        // an outlet has no hooks\n        return _reference.CONSTANT_TAG;\n      }\n    }\n\n    getDestructor(bucket) {\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        return {\n          destroy() {\n            bucket.environment.debugRenderTree.willDestroy(bucket);\n          }\n\n        };\n      } else {\n        return null;\n      }\n    }\n\n    didRenderLayout(bucket, bounds) {\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        bucket.environment.debugRenderTree.didRender(bucket, bounds);\n      }\n    }\n\n    update(bucket) {\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        bucket.environment.debugRenderTree.update(bucket);\n      }\n    }\n\n    didUpdateLayout(bucket, bounds) {\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        bucket.environment.debugRenderTree.didRender(bucket, bounds);\n      }\n    }\n\n  }\n\n  var MANAGER = new TemplateOnlyComponentManager();\n\n  class TemplateOnlyComponentDefinition {\n    constructor(name, template) {\n      this.name = name;\n      this.template = template;\n      this.manager = MANAGER;\n    }\n\n    get state() {\n      return this;\n    }\n\n  }\n\n  var helper$1;\n\n  if (true\n  /* DEBUG */\n  ) {\n    class ComponentAssertionReference {\n      constructor(component, message) {\n        this.component = component;\n        this.message = message;\n        this.tag = component.tag;\n      }\n\n      value() {\n        var value$$1 = this.component.value();\n        (true && !(typeof value$$1 !== 'string') && (0, _debug.assert)(this.message, typeof value$$1 !== 'string'));\n        return value$$1;\n      }\n\n      get(property) {\n        return this.component.get(property);\n      }\n\n    }\n\n    helper$1 = (_vm, args) => new ComponentAssertionReference(args.positional.at(0), args.positional.at(1).value());\n  } else {\n    helper$1 = (_vm, args) => args.positional.at(0);\n  }\n\n  var componentAssertionHelper = helper$1;\n\n  function classHelper({\n    positional\n  }) {\n    var path = positional.at(0);\n    var args = positional.length;\n    var value$$1 = path.value();\n\n    if (value$$1 === true) {\n      if (args > 1) {\n        return (0, _string.dasherize)(positional.at(1).value());\n      }\n\n      return null;\n    }\n\n    if (value$$1 === false) {\n      if (args > 2) {\n        return (0, _string.dasherize)(positional.at(2).value());\n      }\n\n      return null;\n    }\n\n    return value$$1;\n  }\n\n  function classHelper$1(_vm, args) {\n    return new InternalHelperReference(classHelper, args.capture());\n  }\n\n  function inputTypeHelper({\n    positional\n  }) {\n    var type = positional.at(0).value();\n\n    if (type === 'checkbox') {\n      return '-checkbox';\n    }\n\n    return '-text-field';\n  }\n\n  function inputTypeHelper$1(_vm, args) {\n    return new InternalHelperReference(inputTypeHelper, args.capture());\n  }\n\n  function normalizeClass({\n    positional\n  }) {\n    var classNameParts = positional.at(0).value().split('.');\n    var className = classNameParts[classNameParts.length - 1];\n    var value$$1 = positional.at(1).value();\n\n    if (value$$1 === true) {\n      return (0, _string.dasherize)(className);\n    } else if (!value$$1 && value$$1 !== 0) {\n      return '';\n    } else {\n      return String(value$$1);\n    }\n  }\n\n  function normalizeClassHelper(_vm, args) {\n    return new InternalHelperReference(normalizeClass, args.capture());\n  }\n  /**\n  @module ember\n  */\n\n  /**\n    The `{{action}}` helper provides a way to pass triggers for behavior (usually\n    just a function) between components, and into components from controllers.\n  \n    ### Passing functions with the action helper\n  \n    There are three contexts an action helper can be used in. The first two\n    contexts to discuss are attribute context, and Handlebars value context.\n  \n    ```handlebars\n    {{! An example of attribute context }}\n    <div onclick={{action \"save\"}}></div>\n    {{! Examples of Handlebars value context }}\n    {{input on-input=(action \"save\")}}\n    {{yield (action \"refreshData\") andAnotherParam}}\n    ```\n  \n    In these contexts,\n    the helper is called a \"closure action\" helper. Its behavior is simple:\n    If passed a function name, read that function off the `actions` property\n    of the current context. Once that function is read, or immediately if a function was\n    passed, create a closure over that function and any arguments.\n    The resulting value of an action helper used this way is simply a function.\n  \n    For example, in the attribute context:\n  \n    ```handlebars\n    {{! An example of attribute context }}\n    <div onclick={{action \"save\"}}></div>\n    ```\n  \n    The resulting template render logic would be:\n  \n    ```js\n    var div = document.createElement('div');\n    var actionFunction = (function(context){\n      return function() {\n        return context.actions.save.apply(context, arguments);\n      };\n    })(context);\n    div.onclick = actionFunction;\n    ```\n  \n    Thus when the div is clicked, the action on that context is called.\n    Because the `actionFunction` is just a function, closure actions can be\n    passed between components and still execute in the correct context.\n  \n    Here is an example action handler on a component:\n  \n    ```app/components/my-component.js\n    import Component from '@glimmer/component';\n    import { action } from '@ember/object';\n  \n    export default class extends Component {\n      @action\n      save() {\n        this.model.save();\n      }\n    }\n    ```\n  \n    Actions are always looked up on the `actions` property of the current context.\n    This avoids collisions in the naming of common actions, such as `destroy`.\n    Two options can be passed to the `action` helper when it is used in this way.\n  \n    * `target=someProperty` will look to `someProperty` instead of the current\n      context for the `actions` hash. This can be useful when targeting a\n      service for actions.\n    * `value=\"target.value\"` will read the path `target.value` off the first\n      argument to the action when it is called and rewrite the first argument\n      to be that value. This is useful when attaching actions to event listeners.\n  \n    ### Invoking an action\n  \n    Closure actions curry both their scope and any arguments. When invoked, any\n    additional arguments are added to the already curried list.\n    Actions should be invoked using the [sendAction](/ember/release/classes/Component/methods/sendAction?anchor=sendAction)\n    method. The first argument to `sendAction` is the action to be called, and\n    additional arguments are passed to the action function. This has interesting\n    properties combined with currying of arguments. For example:\n  \n    ```app/components/update-name.js\n    import Component from '@glimmer/component';\n    import { action } from '@ember/object';\n  \n    export default class extends Component {\n      @action\n      setName(model, name) {\n        model.set('name', name);\n      }\n    }\n    ```\n  \n    ```app/components/update-name.hbs\n    {{input on-input=(action (action 'setName' @model) value=\"target.value\")}}\n    ```\n  \n    The first argument (`@model`) was curried over, and the run-time argument (`event`)\n    becomes a second argument. Action calls can be nested this way because each simply\n    returns a function. Any function can be passed to the `{{action}}` helper, including\n    other actions.\n  \n    Actions invoked with `sendAction` have the same currying behavior as demonstrated\n    with `on-input` above. For example:\n  \n    ```app/components/my-input.js\n    import Component from '@glimmer/component';\n    import { action } from '@ember/object';\n  \n    export default class extends Component {\n      @action\n      setName(model, name) {\n        model.set('name', name);\n      }\n    }\n    ```\n  \n    ```handlebars\n    <MyInput @submit={{action 'setName' @model}} />\n    ```\n  \n    or\n  \n    ```handlebars\n    {{my-input submit=(action 'setName' @model)}}\n    ```\n  \n    ```app/components/my-component.js\n    import Component from '@ember/component';\n  \n    export default Component.extend({\n      click() {\n        // Note that model is not passed, it was curried in the template\n        this.sendAction('submit', 'bob');\n      }\n    });\n    ```\n  \n    ### Attaching actions to DOM elements\n  \n    The third context of the `{{action}}` helper can be called \"element space\".\n    For example:\n  \n    ```handlebars\n    {{! An example of element space }}\n    <div {{action \"save\"}}></div>\n    ```\n  \n    Used this way, the `{{action}}` helper provides a useful shortcut for\n    registering an HTML element in a template for a single DOM event and\n    forwarding that interaction to the template's context (controller or component).\n    If the context of a template is a controller, actions used this way will\n    bubble to routes when the controller does not implement the specified action.\n    Once an action hits a route, it will bubble through the route hierarchy.\n  \n    ### Event Propagation\n  \n    `{{action}}` helpers called in element space can control event bubbling. Note\n    that the closure style actions cannot.\n  \n    Events triggered through the action helper will automatically have\n    `.preventDefault()` called on them. You do not need to do so in your event\n    handlers. If you need to allow event propagation (to handle file inputs for\n    example) you can supply the `preventDefault=false` option to the `{{action}}` helper:\n  \n    ```handlebars\n    <div {{action \"sayHello\" preventDefault=false}}>\n      <input type=\"file\" />\n      <input type=\"checkbox\" />\n    </div>\n    ```\n  \n    To disable bubbling, pass `bubbles=false` to the helper:\n  \n    ```handlebars\n    <button {{action 'edit' post bubbles=false}}>Edit</button>\n    ```\n  \n    To disable bubbling with closure style actions you must create your own\n    wrapper helper that makes use of `event.stopPropagation()`:\n  \n    ```handlebars\n    <div onclick={{disable-bubbling (action \"sayHello\")}}>Hello</div>\n    ```\n  \n    ```app/helpers/disable-bubbling.js\n    import { helper } from '@ember/component/helper';\n  \n    export function disableBubbling([action]) {\n      return function(event) {\n        event.stopPropagation();\n        return action(event);\n      };\n    }\n    export default helper(disableBubbling);\n    ```\n  \n    If you need the default handler to trigger you should either register your\n    own event handler, or use event methods on your view class. See\n    [\"Responding to Browser Events\"](/ember/release/classes/Component)\n    in the documentation for `Component` for more information.\n  \n    ### Specifying DOM event type\n  \n    `{{action}}` helpers called in element space can specify an event type.\n    By default the `{{action}}` helper registers for DOM `click` events. You can\n    supply an `on` option to the helper to specify a different DOM event name:\n  \n    ```handlebars\n    <div {{action \"anActionName\" on=\"doubleClick\"}}>\n      click me\n    </div>\n    ```\n  \n    See [\"Event Names\"](/ember/release/classes/Component) for a list of\n    acceptable DOM event names.\n  \n    ### Specifying whitelisted modifier keys\n  \n    `{{action}}` helpers called in element space can specify modifier keys.\n    By default the `{{action}}` helper will ignore click events with pressed modifier\n    keys. You can supply an `allowedKeys` option to specify which keys should not be ignored.\n  \n    ```handlebars\n    <div {{action \"anActionName\" allowedKeys=\"alt\"}}>\n      click me\n    </div>\n    ```\n  \n    This way the action will fire when clicking with the alt key pressed down.\n    Alternatively, supply \"any\" to the `allowedKeys` option to accept any combination of modifier keys.\n  \n    ```handlebars\n    <div {{action \"anActionName\" allowedKeys=\"any\"}}>\n      click me with any key pressed\n    </div>\n    ```\n  \n    ### Specifying a Target\n  \n    A `target` option can be provided to the helper to change\n    which object will receive the method call. This option must be a path\n    to an object, accessible in the current context:\n  \n    ```app/templates/application.hbs\n    <div {{action \"anActionName\" target=someService}}>\n      click me\n    </div>\n    ```\n  \n    ```app/controllers/application.js\n    import Controller from '@ember/controller';\n    import { inject as service } from '@ember/service';\n  \n    export default class extends Controller {\n      @service someService;\n    }\n    ```\n  \n    @method action\n    @for Ember.Templates.helpers\n    @public\n  */\n\n\n  function action(_vm, args) {\n    var {\n      named,\n      positional\n    } = args;\n    var capturedArgs = positional.capture(); // The first two argument slots are reserved.\n    // pos[0] is the context (or `this`)\n    // pos[1] is the action name or function\n    // Anything else is an action argument.\n\n    var [context, action, ...restArgs] = capturedArgs.references; // TODO: Is there a better way of doing this?\n\n    var debugKey = action.propertyKey;\n    var target = named.has('target') ? named.get('target') : context;\n    var processArgs = makeArgsProcessor(named.has('value') && named.get('value'), restArgs);\n    var fn;\n\n    if (typeof action[INVOKE] === 'function') {\n      fn = makeClosureAction(action, action, action[INVOKE], processArgs, debugKey);\n    } else if ((0, _reference.isConst)(target) && (0, _reference.isConst)(action)) {\n      fn = makeClosureAction(context.value(), target.value(), action.value(), processArgs, debugKey);\n    } else {\n      fn = makeDynamicClosureAction(context.value(), target, action, processArgs, debugKey);\n    }\n\n    fn[ACTION] = true;\n    return new UnboundReference(fn);\n  }\n\n  function NOOP$1(args) {\n    return args;\n  }\n\n  function makeArgsProcessor(valuePathRef, actionArgsRef) {\n    var mergeArgs;\n\n    if (actionArgsRef.length > 0) {\n      mergeArgs = args => {\n        return actionArgsRef.map(ref => ref.value()).concat(args);\n      };\n    }\n\n    var readValue;\n\n    if (valuePathRef) {\n      readValue = args => {\n        var valuePath = valuePathRef.value();\n\n        if (valuePath && args.length > 0) {\n          args[0] = (0, _metal.get)(args[0], valuePath);\n        }\n\n        return args;\n      };\n    }\n\n    if (mergeArgs && readValue) {\n      return args => {\n        return readValue(mergeArgs(args));\n      };\n    } else {\n      return mergeArgs || readValue || NOOP$1;\n    }\n  }\n\n  function makeDynamicClosureAction(context, targetRef, actionRef, processArgs, debugKey) {\n    // We don't allow undefined/null values, so this creates a throw-away action to trigger the assertions\n    if (true\n    /* DEBUG */\n    ) {\n      makeClosureAction(context, targetRef.value(), actionRef.value(), processArgs, debugKey);\n    }\n\n    return (...args) => {\n      return makeClosureAction(context, targetRef.value(), actionRef.value(), processArgs, debugKey)(...args);\n    };\n  }\n\n  function makeClosureAction(context, target, action, processArgs, debugKey) {\n    var self;\n    var fn;\n    (true && !(action !== undefined && action !== null) && (0, _debug.assert)(\"Action passed is null or undefined in (action) from \" + target + \".\", action !== undefined && action !== null));\n\n    if (typeof action[INVOKE] === 'function') {\n      self = action;\n      fn = action[INVOKE];\n    } else {\n      var typeofAction = typeof action;\n\n      if (typeofAction === 'string') {\n        self = target;\n        fn = target.actions && target.actions[action];\n        (true && !(fn) && (0, _debug.assert)(\"An action named '\" + action + \"' was not found in \" + target, fn));\n      } else if (typeofAction === 'function') {\n        self = context;\n        fn = action;\n      } else {\n        // tslint:disable-next-line:max-line-length\n        (true && !(false) && (0, _debug.assert)(\"An action could not be made for `\" + (debugKey || action) + \"` in \" + target + \". Please confirm that you are using either a quoted action name (i.e. `(action '\" + (debugKey || 'myAction') + \"')`) or a function available in \" + target + \".\", false));\n      }\n    }\n\n    return (...args) => {\n      var payload = {\n        target: self,\n        args,\n        label: '@glimmer/closure-action'\n      };\n      return (0, _instrumentation.flaggedInstrument)('interaction.ember-action', payload, () => {\n        return (0, _runloop.join)(self, fn, ...processArgs(args));\n      });\n    };\n  }\n  /**\n  @module ember\n  */\n\n  /**\n     Use the `{{array}}` helper to create an array to pass as an option to your\n     components.\n  \n     ```handlebars\n     <MyComponent @people={{array\n       'Tom Dade'\n       'Yehuda Katz'\n       this.myOtherPerson}}\n     />\n     ```\n      or\n     ```handlebars\n     {{my-component people=(array\n       'Tom Dade'\n       'Yehuda Katz'\n       this.myOtherPerson)\n     }}\n     ```\n  \n     Would result in an object such as:\n  \n     ```js\n     ['Tom Date', 'Yehuda Katz', this.get('myOtherPerson')]\n     ```\n  \n     Where the 3rd item in the array is bound to updates of the `myOtherPerson` property.\n  \n     @method array\n     @for Ember.Templates.helpers\n     @param {Array} options\n     @return {Array} Array\n     @since 3.8.0\n     @public\n   */\n\n\n  function array(_vm, args) {\n    return args.positional.capture();\n  }\n\n  var isEmpty = value$$1 => {\n    return value$$1 === null || value$$1 === undefined || typeof value$$1.toString !== 'function';\n  };\n\n  var normalizeTextValue = value$$1 => {\n    if (isEmpty(value$$1)) {\n      return '';\n    }\n\n    return String(value$$1);\n  };\n  /**\n  @module ember\n  */\n\n  /**\n    Concatenates the given arguments into a string.\n  \n    Example:\n  \n    ```handlebars\n    {{some-component name=(concat firstName \" \" lastName)}}\n  \n    {{! would pass name=\"<first name value> <last name value>\" to the component}}\n    ```\n  \n    or for angle bracket invocation, you actually don't need concat at all.\n  \n    ```handlebars\n    <SomeComponent @name=\"{{firstName}} {{lastName}}\" />\n    ```\n  \n    @public\n    @method concat\n    @for Ember.Templates.helpers\n    @since 1.13.0\n  */\n\n\n  function concat({\n    positional\n  }) {\n    return positional.value().map(normalizeTextValue).join('');\n  }\n\n  function concat$1(_vm, args) {\n    return new InternalHelperReference(concat, args.capture());\n  }\n\n  function buildUntouchableThis(source) {\n    var context = null;\n\n    if (true\n    /* DEBUG */\n    && _utils.HAS_NATIVE_PROXY) {\n      var assertOnProperty = property => {\n        (true && !(false) && (0, _debug.assert)(\"You accessed `this.\" + String(property) + \"` from a function passed to the \" + source + \", but the function itself was not bound to a valid `this` context. Consider updating to usage of `@action`.\"));\n      };\n\n      context = new Proxy({}, {\n        get(_target, property) {\n          assertOnProperty(property);\n        },\n\n        set(_target, property) {\n          assertOnProperty(property);\n          return false;\n        },\n\n        has(_target, property) {\n          assertOnProperty(property);\n          return false;\n        }\n\n      });\n    }\n\n    return context;\n  }\n\n  var context = buildUntouchableThis('`fn` helper');\n  /**\n  @module ember\n  */\n\n  /**\n    The `fn` helper allows you to ensure a function that you are passing off\n    to another component, helper, or modifier has access to arguments that are\n    available in the template.\n  \n    For example, if you have an `each` helper looping over a number of items, you\n    may need to pass a function that expects to receive the item as an argument\n    to a component invoked within the loop. Here's how you could use the `fn`\n    helper to pass both the function and its arguments together:\n  \n      ```app/templates/components/items-listing.hbs\n    {{#each @items as |item|}}\n      <DisplayItem @item=item @select={{fn this.handleSelected item}} />\n    {{/each}}\n    ```\n  \n    ```app/components/items-list.js\n    import Component from '@glimmer/component';\n    import { action } from '@ember/object';\n  \n    export default class ItemsList extends Component {\n      @action\n      handleSelected(item) {\n        // ...snip...\n      }\n    }\n    ```\n  \n    In this case the `display-item` component will receive a normal function\n    that it can invoke. When it invokes the function, the `handleSelected`\n    function will receive the `item` and any arguments passed, thanks to the\n    `fn` helper.\n  \n    Let's take look at what that means in a couple circumstances:\n  \n    - When invoked as `this.args.select()` the `handleSelected` function will\n      receive the `item` from the loop as its first and only argument.\n    - When invoked as `this.args.select('foo')` the `handleSelected` function\n      will receive the `item` from the loop as its first argument and the\n      string `'foo'` as its second argument.\n  \n    In the example above, we used `@action` to ensure that `handleSelected` is\n    properly bound to the `items-list`, but let's explore what happens if we\n    left out `@action`:\n  \n    ```app/components/items-list.js\n    import Component from '@glimmer/component';\n  \n    export default class ItemsList extends Component {\n      handleSelected(item) {\n        // ...snip...\n      }\n    }\n    ```\n  \n    In this example, when `handleSelected` is invoked inside the `display-item`\n    component, it will **not** have access to the component instance. In other\n    words, it will have no `this` context, so please make sure your functions\n    are bound (via `@action` or other means) before passing into `fn`!\n  \n    See also [partial application](https://en.wikipedia.org/wiki/Partial_application).\n  \n    @method fn\n    @for Ember.Templates.helpers\n    @public\n    @since 3.11.0\n  */\n\n  function fnHelper({\n    positional\n  }) {\n    var callbackRef = positional.at(0);\n\n    if (true\n    /* DEBUG */\n    && typeof callbackRef[INVOKE] !== 'function') {\n      var callback = callbackRef.value();\n      (true && !(typeof callback === 'function') && (0, _debug.assert)(\"You must pass a function as the `fn` helpers first argument, you passed \" + callback, typeof callback === 'function'));\n    }\n\n    return (...invocationArgs) => {\n      var [fn, ...args] = positional.value();\n\n      if (typeof callbackRef[INVOKE] === 'function') {\n        // references with the INVOKE symbol expect the function behind\n        // the symbol to be bound to the reference\n        return callbackRef[INVOKE](...args, ...invocationArgs);\n      } else {\n        return fn['call'](context, ...args, ...invocationArgs);\n      }\n    };\n  }\n\n  function fn(_vm, args) {\n    return new InternalHelperReference(fnHelper, args.capture());\n  }\n  /**\n  @module ember\n  */\n\n  /**\n    Dynamically look up a property on an object. The second argument to `{{get}}`\n    should have a string value, although it can be bound.\n  \n    For example, these two usages are equivalent:\n  \n    ```handlebars\n    {{person.height}}\n    {{get person \"height\"}}\n    ```\n  \n    If there were several facts about a person, the `{{get}}` helper can dynamically\n    pick one:\n  \n    ```handlebars\n    {{get person factName}}\n    ```\n  \n    For a more complex example, this template would allow the user to switch\n    between showing the user's height and weight with a click:\n  \n    ```handlebars\n    {{get person factName}}\n    <button {{action (fn (mut factName)) \"height\"}}>Show height</button>\n    <button {{action (fn (mut factName)) \"weight\"}}>Show weight</button>\n    ```\n  \n    The `{{get}}` helper can also respect mutable values itself. For example:\n  \n    ```handlebars\n    {{input value=(mut (get person factName)) type=\"text\"}}\n    <button {{action (fn (mut factName)) \"height\"}}>Show height</button>\n    <button {{action (fn (mut factName)) \"weight\"}}>Show weight</button>\n    ```\n  \n    Would allow the user to swap what fact is being displayed, and also edit\n    that fact via a two-way mutable binding.\n  \n    @public\n    @method get\n    @for Ember.Templates.helpers\n    @since 2.1.0\n   */\n\n\n  function get$1(_vm, args) {\n    return GetHelperReference.create(args.positional.at(0), args.positional.at(1));\n  }\n\n  function referenceFromPath(source, path) {\n    var innerReference;\n\n    if (path === undefined || path === null || path === '') {\n      innerReference = _runtime2.NULL_REFERENCE;\n    } else if (typeof path === 'string' && path.indexOf('.') > -1) {\n      innerReference = referenceFromParts(source, path.split('.'));\n    } else {\n      innerReference = source.get(path);\n    }\n\n    return innerReference;\n  }\n\n  class GetHelperReference extends CachedReference$1 {\n    static create(sourceReference, pathReference) {\n      if ((0, _reference.isConst)(pathReference)) {\n        var path = pathReference.value();\n        return referenceFromPath(sourceReference, path);\n      } else {\n        return new GetHelperReference(sourceReference, pathReference);\n      }\n    }\n\n    constructor(sourceReference, pathReference) {\n      super();\n      this.sourceReference = sourceReference;\n      this.pathReference = pathReference;\n      this.lastPath = null;\n      this.innerReference = _runtime2.NULL_REFERENCE;\n      var innerTag = this.innerTag = (0, _reference.createUpdatableTag)();\n      this.tag = (0, _reference.combine)([sourceReference.tag, pathReference.tag, innerTag]);\n    }\n\n    compute() {\n      var {\n        lastPath,\n        innerReference,\n        innerTag\n      } = this;\n      var path = this.pathReference.value();\n\n      if (path !== lastPath) {\n        innerReference = referenceFromPath(this.sourceReference, path);\n        (0, _reference.update)(innerTag, innerReference.tag);\n        this.innerReference = innerReference;\n        this.lastPath = path;\n      }\n\n      return innerReference.value();\n    }\n\n    [UPDATE](value$$1) {\n      (0, _metal.set)(this.sourceReference.value(), this.pathReference.value(), value$$1);\n    }\n\n  }\n  /**\n  @module ember\n  */\n\n  /**\n     Use the `{{hash}}` helper to create a hash to pass as an option to your\n     components. This is specially useful for contextual components where you can\n     just yield a hash:\n  \n     ```handlebars\n     {{yield (hash\n        name='Sarah'\n        title=office\n     )}}\n     ```\n  \n     Would result in an object such as:\n  \n     ```js\n     { name: 'Sarah', title: this.get('office') }\n     ```\n  \n     Where the `title` is bound to updates of the `office` property.\n  \n     Note that the hash is an empty object with no prototype chain, therefore\n     common methods like `toString` are not available in the resulting hash.\n     If you need to use such a method, you can use the `call` or `apply`\n     approach:\n  \n     ```js\n     function toString(obj) {\n       return Object.prototype.toString.apply(obj);\n     }\n     ```\n  \n     @method hash\n     @for Ember.Templates.helpers\n     @param {Object} options\n     @return {Object} Hash\n     @since 2.3.0\n     @public\n   */\n\n\n  function hash(_vm, args) {\n    return args.named.capture();\n  }\n  /**\n  @module ember\n  */\n\n\n  class ConditionalHelperReference extends CachedReference$1 {\n    static create(_condRef, truthyRef, falsyRef) {\n      var condRef = ConditionalReference$1.create(_condRef);\n\n      if ((0, _reference.isConst)(condRef)) {\n        return condRef.value() ? truthyRef : falsyRef;\n      } else {\n        return new ConditionalHelperReference(condRef, truthyRef, falsyRef);\n      }\n    }\n\n    constructor(cond, truthy, falsy) {\n      super();\n      this.branchTag = (0, _reference.createUpdatableTag)();\n      this.tag = (0, _reference.combine)([cond.tag, this.branchTag]);\n      this.cond = cond;\n      this.truthy = truthy;\n      this.falsy = falsy;\n    }\n\n    compute() {\n      var branch = this.cond.value() ? this.truthy : this.falsy;\n      (0, _reference.update)(this.branchTag, branch.tag);\n      return branch.value();\n    }\n\n  }\n  /**\n    The `if` helper allows you to conditionally render one of two branches,\n    depending on the \"truthiness\" of a property.\n    For example the following values are all falsey: `false`, `undefined`, `null`, `\"\"`, `0`, `NaN` or an empty array.\n  \n    This helper has two forms, block and inline.\n  \n    ## Block form\n  \n    You can use the block form of `if` to conditionally render a section of the template.\n  \n    To use it, pass the conditional value to the `if` helper,\n    using the block form to wrap the section of template you want to conditionally render.\n    Like so:\n  \n    ```handlebars\n    {{! will not render if foo is falsey}}\n    {{#if foo}}\n      Welcome to the {{foo.bar}}\n    {{/if}}\n    ```\n  \n    You can also specify a template to show if the property is falsey by using\n    the `else` helper.\n  \n    ```handlebars\n    {{! is it raining outside?}}\n    {{#if isRaining}}\n      Yes, grab an umbrella!\n    {{else}}\n      No, it's lovely outside!\n    {{/if}}\n    ```\n  \n    You are also able to combine `else` and `if` helpers to create more complex\n    conditional logic.\n  \n    ```handlebars\n    {{#if isMorning}}\n      Good morning\n    {{else if isAfternoon}}\n      Good afternoon\n    {{else}}\n      Good night\n    {{/if}}\n    ```\n  \n    ## Inline form\n  \n    The inline `if` helper conditionally renders a single property or string.\n  \n    In this form, the `if` helper receives three arguments, the conditional value,\n    the value to render when truthy, and the value to render when falsey.\n  \n    For example, if `useLongGreeting` is truthy, the following:\n  \n    ```handlebars\n    {{if useLongGreeting \"Hello\" \"Hi\"}} Alex\n    ```\n  \n    Will render:\n  \n    ```html\n    Hello Alex\n    ```\n  \n    ### Nested `if`\n  \n    You can use the `if` helper inside another helper as a nested helper:\n  \n    ```handlebars\n    <SomeComponent @height={{if isBig \"100\" \"10\"}} />\n    ```\n  \n    or\n  \n    ```handlebars\n    {{some-component height=(if isBig \"100\" \"10\")}}\n    ```\n  \n    One detail to keep in mind is that both branches of the `if` helper will be evaluated,\n    so if you have `{{if condition \"foo\" (expensive-operation \"bar\")`,\n    `expensive-operation` will always calculate.\n  \n    @method if\n    @for Ember.Templates.helpers\n    @public\n  */\n\n\n  function inlineIf(_vm, {\n    positional\n  }) {\n    (true && !(positional.length === 3 || positional.length === 2) && (0, _debug.assert)('The inline form of the `if` helper expects two or three arguments, e.g. ' + '`{{if trialExpired \"Expired\" expiryDate}}`.', positional.length === 3 || positional.length === 2));\n    return ConditionalHelperReference.create(positional.at(0), positional.at(1), positional.at(2));\n  }\n  /**\n    The `unless` helper is the inverse of the `if` helper. It displays if a value\n    is falsey (\"not true\" or \"is false\"). Example values that will display with\n    `unless`: `false`, `undefined`, `null`, `\"\"`, `0`, `NaN` or an empty array.\n  \n    ## Inline form\n  \n    The inline `unless` helper conditionally renders a single property or string.\n    This helper acts like a ternary operator. If the first property is falsy,\n    the second argument will be displayed, otherwise, the third argument will be\n    displayed\n  \n    For example, if `useLongGreeting` is false below:\n  \n    ```handlebars\n    {{unless useLongGreeting \"Hi\" \"Hello\"}} Ben\n    ```\n  \n    Then it will display:\n  \n    ```html\n    Hi\n    ```\n  \n    You can use the `unless` helper inside another helper as a subexpression.\n    If isBig is not true, it will set the height to 10:\n  \n    ```handlebars\n    {{! If isBig is not true, it will set the height to 10.}}\n    <SomeComponent @height={{unless isBig \"10\" \"100\"}} />\n    ```\n  \n    or\n  \n    ```handlebars\n    {{some-component height=(unless isBig \"10\" \"100\")}}\n    ```\n  \n    ## Block form\n  \n    Like the `if` helper, `unless` helper also has a block form.\n  \n    ```handlebars\n    {{! If greetings are found, the text below will not render.}}\n    {{#unless greetings}}\n      No greetings were found. Why not set one?\n    {{/unless}}\n    ```\n  \n    You can also use an `else` helper with the `unless` block. The\n    `else` will display if the value is truthy.\n  \n    ```handlebars\n    {{! Is the user logged in?}}\n    {{#unless userData}}\n      Please login.\n    {{else}}\n      Welcome back!\n    {{/unless}}\n    ```\n  \n    If `userData` is false, undefined, null, or empty in the above example,\n    then it will render:\n  \n    ```html\n    Please login.\n    ```\n  \n    @method unless\n    @for Ember.Templates.helpers\n    @public\n  */\n\n\n  function inlineUnless(_vm, {\n    positional\n  }) {\n    (true && !(positional.length === 3 || positional.length === 2) && (0, _debug.assert)('The inline form of the `unless` helper expects two or three arguments, e.g. ' + '`{{unless isFirstLogin \"Welcome back!\"}}`.', positional.length === 3 || positional.length === 2));\n    return ConditionalHelperReference.create(positional.at(0), positional.at(2), positional.at(1));\n  }\n  /**\n  @module ember\n  */\n\n  /**\n    `log` allows you to output the value of variables in the current rendering\n    context. `log` also accepts primitive types such as strings or numbers.\n  \n    ```handlebars\n    {{log \"myVariable:\" myVariable }}\n    ```\n  \n    @method log\n    @for Ember.Templates.helpers\n    @param {Array} params\n    @public\n  */\n\n\n  function log({\n    positional\n  }) {\n    /* eslint-disable no-console */\n    console.log(...positional.value());\n    /* eslint-enable no-console */\n  }\n\n  function log$1(_vm, args) {\n    return new InternalHelperReference(log, args.capture());\n  }\n  /**\n  @module ember\n  */\n\n  /**\n    The `mut` helper lets you __clearly specify__ that a child `Component` can update the\n    (mutable) value passed to it, which will __change the value of the parent component__.\n  \n    To specify that a parameter is mutable, when invoking the child `Component`:\n  \n    ```handlebars\n    <MyChild @childClickCount={{fn (mut totalClicks)}} />\n    ```\n  \n     or\n  \n    ```handlebars\n    {{my-child childClickCount=(mut totalClicks)}}\n    ```\n  \n    The child `Component` can then modify the parent's value just by modifying its own\n    property:\n  \n    ```javascript\n    // my-child.js\n    export default Component.extend({\n      click() {\n        this.incrementProperty('childClickCount');\n      }\n    });\n    ```\n  \n    Note that for curly components (`{{my-component}}`) the bindings are already mutable,\n    making the `mut` unnecessary.\n  \n    Additionally, the `mut` helper can be combined with the `fn` helper to\n    mutate a value. For example:\n  \n    ```handlebars\n    <MyChild @childClickCount={{this.totalClicks}} @click-count-change={{fn (mut totalClicks))}} />\n    ```\n  \n    or\n  \n    ```handlebars\n    {{my-child childClickCount=totalClicks click-count-change=(fn (mut totalClicks))}}\n    ```\n  \n    The child `Component` would invoke the function with the new click value:\n  \n    ```javascript\n    // my-child.js\n    export default Component.extend({\n      click() {\n        this.get('click-count-change')(this.get('childClickCount') + 1);\n      }\n    });\n    ```\n  \n    The `mut` helper changes the `totalClicks` value to what was provided as the `fn` argument.\n  \n    The `mut` helper, when used with `fn`, will return a function that\n    sets the value passed to `mut` to its first argument. As an example, we can create a\n    button that increments a value passing the value directly to the `fn`:\n  \n    ```handlebars\n    {{! inc helper is not provided by Ember }}\n    <button onclick={{fn (mut count) (inc count)}}>\n      Increment count\n    </button>\n    ```\n  \n    You can also use the `value` option:\n  \n    ```handlebars\n    <input value={{name}} oninput={{fn (mut name) value=\"target.value\"}}>\n    ```\n  \n    @method mut\n    @param {Object} [attr] the \"two-way\" attribute that can be modified.\n    @for Ember.Templates.helpers\n    @public\n  */\n\n\n  var MUT_REFERENCE = (0, _utils.symbol)('MUT');\n  var SOURCE = (0, _utils.symbol)('SOURCE');\n\n  function isMut(ref) {\n    return ref && ref[MUT_REFERENCE];\n  }\n\n  function unMut(ref) {\n    return ref[SOURCE] || ref;\n  }\n\n  function mut(_vm, args) {\n    var rawRef = args.positional.at(0);\n\n    if (isMut(rawRef)) {\n      return rawRef;\n    } // TODO: Improve this error message. This covers at least two distinct\n    // cases:\n    //\n    // 1. (mut \"not a path\") – passing a literal, result from a helper\n    //    invocation, etc\n    //\n    // 2. (mut receivedValue) – passing a value received from the caller\n    //    that was originally derived from a literal, result from a helper\n    //    invocation, etc\n    //\n    // This message is alright for the first case, but could be quite\n    // confusing for the second case.\n\n\n    (true && !(rawRef[UPDATE]) && (0, _debug.assert)('You can only pass a path to mut', rawRef[UPDATE]));\n    var wrappedRef = Object.create(rawRef);\n    wrappedRef[SOURCE] = rawRef;\n    wrappedRef[INVOKE] = rawRef[UPDATE];\n    wrappedRef[MUT_REFERENCE] = true;\n    return wrappedRef;\n  }\n  /**\n  @module ember\n  */\n\n  /**\n    This is a helper to be used in conjunction with the link-to helper.\n    It will supply url query parameters to the target route.\n  \n    @example In this example we are setting the `direction` query param to the value `\"asc\"`\n  \n    ```app/templates/application.hbs\n    <LinkTo\n      @route=\"posts\"\n      {{query-params direction=\"asc\"}}\n    >\n      Sort\n    </LinkTo>\n    ```\n  \n    @method query-params\n    @for Ember.Templates.helpers\n    @param {Object} hash takes a hash of query parameters\n    @return {Object} A `QueryParams` object for `{{link-to}}`\n    @public\n  */\n\n\n  function queryParams({\n    positional,\n    named\n  }) {\n    // tslint:disable-next-line:max-line-length\n    (true && !(positional.value().length === 0) && (0, _debug.assert)(\"The `query-params` helper only accepts hash parameters, e.g. (query-params queryParamPropertyName='foo') as opposed to just (query-params 'foo')\", positional.value().length === 0));\n    return new _routing.QueryParams((0, _polyfills.assign)({}, named.value()));\n  }\n\n  function queryParams$1(_vm, args) {\n    return new InternalHelperReference(queryParams, args.capture());\n  }\n  /**\n    The `readonly` helper let's you specify that a binding is one-way only,\n    instead of two-way.\n    When you pass a `readonly` binding from an outer context (e.g. parent component),\n    to to an inner context (e.g. child component), you are saying that changing that\n    property in the inner context does not change the value in the outer context.\n  \n    To specify that a binding is read-only, when invoking the child `Component`:\n  \n    ```app/components/my-parent.js\n    export default Component.extend({\n      totalClicks: 3\n    });\n    ```\n  \n    ```app/templates/components/my-parent.hbs\n    {{log totalClicks}} // -> 3\n    <MyChild @childClickCount={{readonly totalClicks}} />\n    ```\n    ```\n    {{my-child childClickCount=(readonly totalClicks)}}\n    ```\n  \n    Now, when you update `childClickCount`:\n  \n    ```app/components/my-child.js\n    export default Component.extend({\n      click() {\n        this.incrementProperty('childClickCount');\n      }\n    });\n    ```\n  \n    The value updates in the child component, but not the parent component:\n  \n    ```app/templates/components/my-child.hbs\n    {{log childClickCount}} //-> 4\n    ```\n  \n    ```app/templates/components/my-parent.hbs\n    {{log totalClicks}} //-> 3\n    <MyChild @childClickCount={{readonly totalClicks}} />\n    ```\n    or\n    ```app/templates/components/my-parent.hbs\n    {{log totalClicks}} //-> 3\n    {{my-child childClickCount=(readonly totalClicks)}}\n    ```\n  \n    ### Objects and Arrays\n  \n    When passing a property that is a complex object (e.g. object, array) instead of a primitive object (e.g. number, string),\n    only the reference to the object is protected using the readonly helper.\n    This means that you can change properties of the object both on the parent component, as well as the child component.\n    The `readonly` binding behaves similar to the `const` keyword in JavaScript.\n  \n    Let's look at an example:\n  \n    First let's set up the parent component:\n  \n    ```app/components/my-parent.js\n    import Component from '@ember/component';\n  \n    export default Component.extend({\n      clicks: null,\n  \n      init() {\n        this._super(...arguments);\n        this.set('clicks', { total: 3 });\n      }\n    });\n    ```\n  \n    ```app/templates/components/my-parent.hbs\n    {{log clicks.total}} //-> 3\n    <MyChild @childClicks={{readonly clicks}} />\n    ```\n    ```app/templates/components/my-parent.hbs\n    {{log clicks.total}} //-> 3\n    {{my-child childClicks=(readonly clicks)}}\n    ```\n  \n    Now, if you update the `total` property of `childClicks`:\n  \n    ```app/components/my-child.js\n    import Component from '@ember/component';\n  \n    export default Component.extend({\n      click() {\n        this.get('clicks').incrementProperty('total');\n      }\n    });\n    ```\n  \n    You will see the following happen:\n  \n    ```app/templates/components/my-parent.hbs\n    {{log clicks.total}} //-> 4\n    <MyChild @childClicks={{readonly clicks}} />\n    ```\n    or\n    ```app/templates/components/my-parent.hbs\n    {{log clicks.total}} //-> 4\n    {{my-child childClicks=(readonly clicks)}}\n    ```\n  \n    ```app/templates/components/my-child.hbs\n    {{log childClicks.total}} //-> 4\n    ```\n  \n    @method readonly\n    @param {Object} [attr] the read-only attribute.\n    @for Ember.Templates.helpers\n    @private\n  */\n\n\n  function readonly(_vm, args) {\n    var ref = unMut(args.positional.at(0));\n    return new ReadonlyReference(ref);\n  }\n  /**\n  @module ember\n  */\n\n  /**\n    The `{{unbound}}` helper disconnects the one-way binding of a property,\n    essentially freezing its value at the moment of rendering. For example,\n    in this example the display of the variable `name` will not change even\n    if it is set with a new value:\n  \n    ```handlebars\n    {{unbound name}}\n    ```\n  \n    Like any helper, the `unbound` helper can accept a nested helper expression.\n    This allows for custom helpers to be rendered unbound:\n  \n    ```handlebars\n    {{unbound (some-custom-helper)}}\n    {{unbound (capitalize name)}}\n    {{! You can use any helper, including unbound, in a nested expression }}\n    {{capitalize (unbound name)}}\n    ```\n  \n    The `unbound` helper only accepts a single argument, and it return an\n    unbound value.\n  \n    @method unbound\n    @for Ember.Templates.helpers\n    @public\n  */\n\n\n  function unbound(_vm, args) {\n    (true && !(args.positional.length === 1 && args.named.length === 0) && (0, _debug.assert)('unbound helper cannot be called with multiple params or hash params', args.positional.length === 1 && args.named.length === 0));\n    return UnboundReference.create(args.positional.at(0).value());\n  }\n\n  var MODIFIERS = ['alt', 'shift', 'meta', 'ctrl'];\n  var POINTER_EVENT_TYPE_REGEX = /^click|mouse|touch/;\n\n  function isAllowedEvent(event, allowedKeys) {\n    if (allowedKeys === null || allowedKeys === undefined) {\n      if (POINTER_EVENT_TYPE_REGEX.test(event.type)) {\n        return (0, _views.isSimpleClick)(event);\n      } else {\n        allowedKeys = '';\n      }\n    }\n\n    if (allowedKeys.indexOf('any') >= 0) {\n      return true;\n    }\n\n    for (var i = 0; i < MODIFIERS.length; i++) {\n      if (event[MODIFIERS[i] + 'Key'] && allowedKeys.indexOf(MODIFIERS[i]) === -1) {\n        return false;\n      }\n    }\n\n    return true;\n  }\n\n  var ActionHelper = {\n    // registeredActions is re-exported for compatibility with older plugins\n    // that were using this undocumented API.\n    registeredActions: _views.ActionManager.registeredActions,\n\n    registerAction(actionState) {\n      var {\n        actionId\n      } = actionState;\n      _views.ActionManager.registeredActions[actionId] = actionState;\n      return actionId;\n    },\n\n    unregisterAction(actionState) {\n      var {\n        actionId\n      } = actionState;\n      delete _views.ActionManager.registeredActions[actionId];\n    }\n\n  };\n\n  class ActionState {\n    constructor(element, actionId, actionName, actionArgs, namedArgs, positionalArgs, implicitTarget, dom, tag) {\n      this.element = element;\n      this.actionId = actionId;\n      this.actionName = actionName;\n      this.actionArgs = actionArgs;\n      this.namedArgs = namedArgs;\n      this.positional = positionalArgs;\n      this.implicitTarget = implicitTarget;\n      this.dom = dom;\n      this.eventName = this.getEventName();\n      this.tag = tag;\n    }\n\n    getEventName() {\n      return this.namedArgs.get('on').value() || 'click';\n    }\n\n    getActionArgs() {\n      var result = new Array(this.actionArgs.length);\n\n      for (var i = 0; i < this.actionArgs.length; i++) {\n        result[i] = this.actionArgs[i].value();\n      }\n\n      return result;\n    }\n\n    getTarget() {\n      var {\n        implicitTarget,\n        namedArgs\n      } = this;\n      var target;\n\n      if (namedArgs.has('target')) {\n        target = namedArgs.get('target').value();\n      } else {\n        target = implicitTarget.value();\n      }\n\n      return target;\n    }\n\n    handler(event) {\n      var {\n        actionName,\n        namedArgs\n      } = this;\n      var bubbles = namedArgs.get('bubbles');\n      var preventDefault = namedArgs.get('preventDefault');\n      var allowedKeys = namedArgs.get('allowedKeys');\n      var target = this.getTarget();\n      var shouldBubble = bubbles.value() !== false;\n\n      if (!isAllowedEvent(event, allowedKeys.value())) {\n        return true;\n      }\n\n      if (preventDefault.value() !== false) {\n        event.preventDefault();\n      }\n\n      if (!shouldBubble) {\n        event.stopPropagation();\n      }\n\n      (0, _runloop.join)(() => {\n        var args = this.getActionArgs();\n        var payload = {\n          args,\n          target,\n          name: null\n        };\n\n        if (typeof actionName[INVOKE] === 'function') {\n          (0, _instrumentation.flaggedInstrument)('interaction.ember-action', payload, () => {\n            actionName[INVOKE].apply(actionName, args);\n          });\n          return;\n        }\n\n        if (typeof actionName === 'function') {\n          (0, _instrumentation.flaggedInstrument)('interaction.ember-action', payload, () => {\n            actionName.apply(target, args);\n          });\n          return;\n        }\n\n        payload.name = actionName;\n\n        if (target.send) {\n          (0, _instrumentation.flaggedInstrument)('interaction.ember-action', payload, () => {\n            target.send.apply(target, [actionName, ...args]);\n          });\n        } else {\n          (true && !(typeof target[actionName] === 'function') && (0, _debug.assert)(\"The action '\" + actionName + \"' did not exist on \" + target, typeof target[actionName] === 'function'));\n          (0, _instrumentation.flaggedInstrument)('interaction.ember-action', payload, () => {\n            target[actionName].apply(target, args);\n          });\n        }\n      });\n      return shouldBubble;\n    }\n\n    destroy() {\n      ActionHelper.unregisterAction(this);\n    }\n\n  } // implements ModifierManager<Action>\n\n\n  class ActionModifierManager {\n    create(element, _state, args, _dynamicScope, dom) {\n      var {\n        named,\n        positional,\n        tag\n      } = args.capture();\n      var implicitTarget;\n      var actionName;\n      var actionNameRef;\n\n      if (positional.length > 1) {\n        implicitTarget = positional.at(0);\n        actionNameRef = positional.at(1);\n\n        if (actionNameRef[INVOKE]) {\n          actionName = actionNameRef;\n        } else {\n          var actionLabel = actionNameRef.propertyKey;\n          actionName = actionNameRef.value();\n          (true && !(typeof actionName === 'string' || typeof actionName === 'function') && (0, _debug.assert)('You specified a quoteless path, `' + actionLabel + '`, to the ' + '{{action}} helper which did not resolve to an action name (a ' + 'string). Perhaps you meant to use a quoted actionName? (e.g. ' + '{{action \"' + actionLabel + '\"}}).', typeof actionName === 'string' || typeof actionName === 'function'));\n        }\n      }\n\n      var actionArgs = []; // The first two arguments are (1) `this` and (2) the action name.\n      // Everything else is a param.\n\n      for (var i = 2; i < positional.length; i++) {\n        actionArgs.push(positional.at(i));\n      }\n\n      var actionId = (0, _utils.uuid)();\n      var actionState = new ActionState(element, actionId, actionName, actionArgs, named, positional, implicitTarget, dom, tag);\n      (true && !(actionState.eventName !== 'mouseEnter' && actionState.eventName !== 'mouseLeave' && actionState.eventName !== 'mouseMove') && (0, _debug.deprecate)(\"Using the `{{action}}` modifier with `\" + actionState.eventName + \"` events has been deprecated.\", actionState.eventName !== 'mouseEnter' && actionState.eventName !== 'mouseLeave' && actionState.eventName !== 'mouseMove', {\n        id: 'ember-views.event-dispatcher.mouseenter-leave-move',\n        until: '4.0.0',\n        url: 'https://emberjs.com/deprecations/v3.x#toc_action-mouseenter-leave-move'\n      }));\n      return actionState;\n    }\n\n    install(actionState) {\n      var {\n        dom,\n        element,\n        actionId\n      } = actionState;\n      ActionHelper.registerAction(actionState);\n      dom.setAttribute(element, 'data-ember-action', '');\n      dom.setAttribute(element, \"data-ember-action-\" + actionId, actionId);\n    }\n\n    update(actionState) {\n      var {\n        positional\n      } = actionState;\n      var actionNameRef = positional.at(1);\n\n      if (!actionNameRef[INVOKE]) {\n        actionState.actionName = actionNameRef.value();\n      }\n\n      actionState.eventName = actionState.getEventName();\n    }\n\n    getTag(actionState) {\n      return actionState.tag;\n    }\n\n    getDestructor(modifier) {\n      return modifier;\n    }\n\n  }\n\n  function capabilities$1(managerAPI, optionalFeatures = {}) {\n    if (managerAPI !== '3.13') {\n      managerAPI = '3.13';\n      (true && !(false) && (0, _debug.deprecate)('Modifier manager capabilities now require you to pass a valid version when being generated. Valid versions include: 3.13', false, {\n        until: '3.17.0',\n        id: 'implicit-modifier-manager-capabilities'\n      }));\n    }\n\n    (true && !(managerAPI === '3.13') && (0, _debug.assert)('Invalid modifier manager compatibility specified', managerAPI === '3.13'));\n    return {\n      disableAutoTracking: Boolean(optionalFeatures.disableAutoTracking)\n    };\n  }\n\n  class CustomModifierDefinition {\n    constructor(name, ModifierClass, delegate, isInteractive) {\n      this.name = name;\n      this.ModifierClass = ModifierClass;\n      this.delegate = delegate;\n      this.state = {\n        ModifierClass,\n        name,\n        delegate\n      };\n      this.manager = isInteractive ? CUSTOM_INTERACTIVE_MODIFIER_MANAGER : CUSTOM_NON_INTERACTIVE_MODIFIER_MANAGER;\n    }\n\n  }\n\n  class CustomModifierState {\n    constructor(element, delegate, modifier, args) {\n      this.element = element;\n      this.delegate = delegate;\n      this.modifier = modifier;\n      this.args = args;\n      this.tag = (0, _reference.createUpdatableTag)();\n    }\n\n    destroy() {\n      var {\n        delegate,\n        modifier,\n        args\n      } = this;\n      delegate.destroyModifier(modifier, args.value());\n    }\n\n  }\n  /**\n    The CustomModifierManager allows addons to provide custom modifier\n    implementations that integrate seamlessly into Ember. This is accomplished\n    through a delegate, registered with the custom modifier manager, which\n    implements a set of hooks that determine modifier behavior.\n    To create a custom modifier manager, instantiate a new CustomModifierManager\n    class and pass the delegate as the first argument:\n  \n    ```js\n    let manager = new CustomModifierManager({\n      // ...delegate implementation...\n    });\n    ```\n  \n    ## Delegate Hooks\n  \n    Throughout the lifecycle of a modifier, the modifier manager will invoke\n    delegate hooks that are responsible for surfacing those lifecycle changes to\n    the end developer.\n    * `createModifier()` - invoked when a new instance of a modifier should be created\n    * `installModifier()` - invoked when the modifier is installed on the element\n    * `updateModifier()` - invoked when the arguments passed to a modifier change\n    * `destroyModifier()` - invoked when the modifier is about to be destroyed\n  */\n\n\n  class InteractiveCustomModifierManager {\n    create(element, definition, args) {\n      var {\n        delegate,\n        ModifierClass\n      } = definition;\n      var capturedArgs = args.capture();\n      var instance = definition.delegate.createModifier(ModifierClass, capturedArgs.value());\n\n      if (delegate.capabilities === undefined) {\n        delegate.capabilities = capabilities$1('3.13');\n        (true && !(false) && (0, _debug.deprecate)('Custom modifier managers must define their capabilities using the capabilities() helper function', false, {\n          until: '3.17.0',\n          id: 'implicit-modifier-manager-capabilities'\n        }));\n      }\n\n      return new CustomModifierState(element, delegate, instance, capturedArgs);\n    }\n\n    getTag({\n      args,\n      tag\n    }) {\n      return (0, _reference.combine)([tag, args.tag]);\n    }\n\n    install(state) {\n      var {\n        element,\n        args,\n        delegate,\n        modifier,\n        tag\n      } = state;\n      var {\n        capabilities\n      } = delegate;\n\n      if (capabilities.disableAutoTracking === true) {\n        (0, _metal.untrack)(() => delegate.installModifier(modifier, element, args.value()));\n      } else {\n        var combinedTrackingTag = (0, _metal.track)(() => delegate.installModifier(modifier, element, args.value()), true\n        /* DEBUG */\n        && debugRenderMessage$1(\"(instance of a `\" + (0, _utils.getDebugName)(modifier) + \"` modifier)\"));\n        (0, _reference.update)(tag, combinedTrackingTag);\n      }\n    }\n\n    update(state) {\n      var {\n        args,\n        delegate,\n        modifier,\n        tag\n      } = state;\n      var {\n        capabilities\n      } = delegate;\n\n      if (capabilities.disableAutoTracking === true) {\n        (0, _metal.untrack)(() => delegate.updateModifier(modifier, args.value()));\n      } else {\n        var combinedTrackingTag = (0, _metal.track)(() => delegate.updateModifier(modifier, args.value()), true\n        /* DEBUG */\n        && debugRenderMessage$1(\"(instance of a `\" + (0, _utils.getDebugName)(modifier) + \"` modifier)\"));\n        (0, _reference.update)(tag, combinedTrackingTag);\n      }\n    }\n\n    getDestructor(state) {\n      return state;\n    }\n\n  }\n\n  class NonInteractiveCustomModifierManager {\n    create() {\n      return null;\n    }\n\n    getTag() {\n      return _reference.CONSTANT_TAG;\n    }\n\n    install() {}\n\n    update() {}\n\n    getDestructor() {\n      return null;\n    }\n\n  }\n\n  var CUSTOM_INTERACTIVE_MODIFIER_MANAGER = new InteractiveCustomModifierManager();\n  var CUSTOM_NON_INTERACTIVE_MODIFIER_MANAGER = new NonInteractiveCustomModifierManager();\n  var untouchableContext = buildUntouchableThis('`on` modifier');\n  /**\n  @module ember\n  */\n\n  /*\n    Internet Explorer 11 does not support `once` and also does not support\n    passing `eventOptions`. In some situations it then throws a weird script\n    error, like:\n  \n    ```\n    Could not complete the operation due to error 80020101\n    ```\n  \n    This flag determines, whether `{ once: true }` and thus also event options in\n    general are supported.\n  */\n\n  var SUPPORTS_EVENT_OPTIONS = (() => {\n    try {\n      var div = document.createElement('div');\n      var counter = 0;\n      div.addEventListener('click', () => counter++, {\n        once: true\n      });\n      var event;\n\n      if (typeof Event === 'function') {\n        event = new Event('click');\n      } else {\n        event = document.createEvent('Event');\n        event.initEvent('click', true, true);\n      }\n\n      div.dispatchEvent(event);\n      div.dispatchEvent(event);\n      return counter === 1;\n    } catch (error) {\n      return false;\n    }\n  })();\n\n  class OnModifierState {\n    constructor(element, args) {\n      this.shouldUpdate = true;\n      this.element = element;\n      this.args = args;\n      this.tag = args.tag;\n    }\n\n    updateFromArgs() {\n      var {\n        args\n      } = this;\n      var {\n        once,\n        passive,\n        capture\n      } = args.named.value();\n\n      if (once !== this.once) {\n        this.once = once;\n        this.shouldUpdate = true;\n      }\n\n      if (passive !== this.passive) {\n        this.passive = passive;\n        this.shouldUpdate = true;\n      }\n\n      if (capture !== this.capture) {\n        this.capture = capture;\n        this.shouldUpdate = true;\n      }\n\n      var options;\n\n      if (once || passive || capture) {\n        options = this.options = {\n          once,\n          passive,\n          capture\n        };\n      } else {\n        this.options = undefined;\n      }\n\n      (true && !(args.positional.at(0) !== undefined && typeof args.positional.at(0).value() === 'string') && (0, _debug.assert)('You must pass a valid DOM event name as the first argument to the `on` modifier', args.positional.at(0) !== undefined && typeof args.positional.at(0).value() === 'string'));\n      var eventName = args.positional.at(0).value();\n\n      if (eventName !== this.eventName) {\n        this.eventName = eventName;\n        this.shouldUpdate = true;\n      }\n\n      (true && !(args.positional.at(1) !== undefined && typeof args.positional.at(1).value() === 'function') && (0, _debug.assert)('You must pass a function as the second argument to the `on` modifier', args.positional.at(1) !== undefined && typeof args.positional.at(1).value() === 'function'));\n      var userProvidedCallback = args.positional.at(1).value();\n\n      if (userProvidedCallback !== this.userProvidedCallback) {\n        this.userProvidedCallback = userProvidedCallback;\n        this.shouldUpdate = true;\n      }\n\n      (true && !(args.positional.length === 2) && (0, _debug.assert)(\"You can only pass two positional arguments (event name and callback) to the `on` modifier, but you provided \" + args.positional.length + \". Consider using the `fn` helper to provide additional arguments to the `on` callback.\", args.positional.length === 2));\n      var needsCustomCallback = SUPPORTS_EVENT_OPTIONS === false && once ||\n      /* needs manual once implementation */\n      true\n      /* DEBUG */\n      && passive\n      /* needs passive enforcement */\n      ;\n\n      if (this.shouldUpdate) {\n        if (needsCustomCallback) {\n          var callback = this.callback = function (event) {\n            if (true\n            /* DEBUG */\n            && passive) {\n              event.preventDefault = () => {\n                (true && !(false) && (0, _debug.assert)(\"You marked this listener as 'passive', meaning that you must not call 'event.preventDefault()': \\n\\n\" + userProvidedCallback));\n              };\n            }\n\n            if (!SUPPORTS_EVENT_OPTIONS && once) {\n              removeEventListener(this, eventName, callback, options);\n            }\n\n            return userProvidedCallback.call(untouchableContext, event);\n          };\n        } else if (true\n        /* DEBUG */\n        ) {\n          // prevent the callback from being bound to the element\n          this.callback = userProvidedCallback.bind(untouchableContext);\n        } else {\n          this.callback = userProvidedCallback;\n        }\n      }\n    }\n\n    destroy() {\n      var {\n        element,\n        eventName,\n        callback,\n        options\n      } = this;\n      removeEventListener(element, eventName, callback, options);\n    }\n\n  }\n\n  var adds = 0;\n  var removes = 0;\n\n  function removeEventListener(element, eventName, callback, options) {\n    removes++;\n\n    if (SUPPORTS_EVENT_OPTIONS) {\n      // when options are supported, use them across the board\n      element.removeEventListener(eventName, callback, options);\n    } else if (options !== undefined && options.capture) {\n      // used only in the following case:\n      //\n      // `{ once: true | false, passive: true | false, capture: true }\n      //\n      // `once` is handled via a custom callback that removes after first\n      // invocation so we only care about capture here as a boolean\n      element.removeEventListener(eventName, callback, true);\n    } else {\n      // used only in the following cases:\n      //\n      // * where there is no options\n      // * `{ once: true | false, passive: true | false, capture: false }\n      element.removeEventListener(eventName, callback);\n    }\n  }\n\n  function addEventListener(element, eventName, callback, options) {\n    adds++;\n\n    if (SUPPORTS_EVENT_OPTIONS) {\n      // when options are supported, use them across the board\n      element.addEventListener(eventName, callback, options);\n    } else if (options !== undefined && options.capture) {\n      // used only in the following case:\n      //\n      // `{ once: true | false, passive: true | false, capture: true }\n      //\n      // `once` is handled via a custom callback that removes after first\n      // invocation so we only care about capture here as a boolean\n      element.addEventListener(eventName, callback, true);\n    } else {\n      // used only in the following cases:\n      //\n      // * where there is no options\n      // * `{ once: true | false, passive: true | false, capture: false }\n      element.addEventListener(eventName, callback);\n    }\n  }\n  /**\n    The `{{on}}` modifier lets you easily add event listeners (it uses\n    [EventTarget.addEventListener](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener)\n    internally).\n  \n    For example, if you'd like to run a function on your component when a `<button>`\n    in the components template is clicked you might do something like:\n  \n    ```app/templates/components/like-post.hbs\n    <button {{on 'click' this.saveLike}}>Like this post!</button>\n    ```\n  \n    ```app/components/like-post.js\n    import Component from '@glimmer/component';\n    import { action } from '@ember/object';\n  \n    export default class LikePostComponent extends Component {\n      @action\n      saveLike() {\n        // someone likes your post!\n        // better send a request off to your server...\n      }\n    }\n    ```\n  \n    ### Arguments\n  \n    `{{on}}` accepts two positional arguments, and a few named arguments.\n  \n    The positional arguments are:\n  \n    - `event` -- the name to use when calling `addEventListener`\n    - `callback` -- the function to be passed to `addEventListener`\n  \n    The named arguments are:\n  \n    - capture -- a `true` value indicates that events of this type will be dispatched\n      to the registered listener before being dispatched to any EventTarget beneath it\n      in the DOM tree.\n    - once -- indicates that the listener should be invoked at most once after being\n      added. If true, the listener would be automatically removed when invoked.\n    - passive -- if `true`, indicates that the function specified by listener will never\n      call preventDefault(). If a passive listener does call preventDefault(), the user\n      agent will do nothing other than generate a console warning. See\n      [Improving scrolling performance with passive listeners](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Improving_scrolling_performance_with_passive_listeners)\n      to learn more.\n  \n    The callback function passed to `{{on}}` will receive any arguments that are passed\n    to the event handler. Most commonly this would be the `event` itself.\n  \n    If you would like to pass additional arguments to the function you should use\n    the `{{fn}}` helper.\n  \n    For example, in our example case above if you'd like to pass in the post that\n    was being liked when the button is clicked you could do something like:\n  \n    ```app/templates/components/like-post.js\n    <button {{on 'click' (fn this.saveLike @post)}}>Like this post!</button>\n    ```\n  \n    In this case, the `saveLike` function will receive two arguments: the click event\n    and the value of `@post`.\n  \n    ### Function Context\n  \n    In the example above, we used `@action` to ensure that `likePost` is\n    properly bound to the `items-list`, but let's explore what happens if we\n    left out `@action`:\n  \n    ```app/components/like-post.js\n    import Component from '@glimmer/component';\n  \n    export default class LikePostComponent extends Component {\n      saveLike() {\n        // ...snip...\n      }\n    }\n    ```\n  \n    In this example, when the button is clicked `saveLike` will be invoked,\n    it will **not** have access to the component instance. In other\n    words, it will have no `this` context, so please make sure your functions\n    are bound (via `@action` or other means) before passing into `on`!\n  \n    @method on\n    @for Ember.Templates.helpers\n    @public\n    @since 3.11.0\n  */\n\n\n  class OnModifierManager {\n    constructor(isInteractive) {\n      this.SUPPORTS_EVENT_OPTIONS = SUPPORTS_EVENT_OPTIONS;\n      this.isInteractive = isInteractive;\n    }\n\n    get counters() {\n      return {\n        adds,\n        removes\n      };\n    }\n\n    create(element, _state, args) {\n      if (!this.isInteractive) {\n        return null;\n      }\n\n      var capturedArgs = args.capture();\n      return new OnModifierState(element, capturedArgs);\n    }\n\n    getTag(state) {\n      if (state === null) {\n        return _reference.CONSTANT_TAG;\n      }\n\n      return state.tag;\n    }\n\n    install(state) {\n      if (state === null) {\n        return;\n      }\n\n      state.updateFromArgs();\n      var {\n        element,\n        eventName,\n        callback,\n        options\n      } = state;\n      addEventListener(element, eventName, callback, options);\n      state.shouldUpdate = false;\n    }\n\n    update(state) {\n      if (state === null) {\n        return;\n      } // stash prior state for el.removeEventListener\n\n\n      var {\n        element,\n        eventName,\n        callback,\n        options\n      } = state;\n      state.updateFromArgs();\n\n      if (!state.shouldUpdate) {\n        return;\n      } // use prior state values for removal\n\n\n      removeEventListener(element, eventName, callback, options); // read updated values from the state object\n\n      addEventListener(state.element, state.eventName, state.callback, state.options);\n      state.shouldUpdate = false;\n    }\n\n    getDestructor(state) {\n      return state;\n    }\n\n  }\n  /**\n  @module ember\n  */\n\n  /**\n      The `let` helper receives one or more positional arguments and yields\n      them out as block params.\n  \n      This allows the developer to introduce shorter names for certain computations\n      in the template.\n  \n      This is especially useful if you are passing properties to a component\n      that receives a lot of options and you want to clean up the invocation.\n  \n      For the following example, the template receives a `post` object with\n      `content` and `title` properties.\n  \n      We are going to call the `my-post` component, passing a title which is\n      the title of the post suffixed with the name of the blog, the content\n      of the post, and a series of options defined in-place.\n  \n      ```handlebars\n      {{#let\n          (concat post.title ' | The Ember.js Blog')\n          post.content\n          (hash\n            theme=\"high-contrast\"\n            enableComments=true\n          )\n          as |title content options|\n      }}\n        <MyPost @title={{title}} @content={{content}} @options={{options}} />\n      {{/let}}\n    ```\n   or\n    ```handlebars\n      {{#let\n          (concat post.title ' | The Ember.js Blog')\n          post.content\n          (hash\n            theme=\"high-contrast\"\n            enableComments=true\n          )\n          as |title content options|\n      }}\n        {{my-post title=title content=content options=options}}\n      {{/let}}\n    ```\n  \n    @method let\n    @for Ember.Templates.helpers\n    @public\n  */\n\n\n  function blockLetMacro(params, _hash, template, _inverse, builder) {\n    if (template !== null) {\n      if (params !== null) {\n        builder.compileParams(params);\n        builder.invokeStaticBlock(template, params.length);\n      } else {\n        builder.invokeStatic(template);\n      }\n    }\n\n    return true;\n  }\n\n  var CAPABILITIES$4 = {\n    dynamicLayout: true,\n    dynamicTag: false,\n    prepareArgs: false,\n    createArgs: true,\n    attributeHook: false,\n    elementHook: false,\n    createCaller: true,\n    dynamicScope: true,\n    updateHook: true,\n    createInstance: true\n  }; // TODO\n  // This \"disables\" the \"@model\" feature by making the arg untypable syntatically\n  // Delete this when EMBER_ROUTING_MODEL_ARG has shipped\n\n  var MODEL_ARG_NAME = 'model';\n\n  class MountManager extends AbstractManager {\n    getDynamicLayout(state, _) {\n      var templateFactory$$1 = state.engine.lookup('template:application');\n      var template = templateFactory$$1(state.engine);\n      var layout = template.asLayout();\n\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        state.environment.debugRenderTree.setTemplate(state.controller, template);\n      }\n\n      return {\n        handle: layout.compile(),\n        symbolTable: layout.symbolTable\n      };\n    }\n\n    getCapabilities() {\n      return CAPABILITIES$4;\n    }\n\n    create(environment, {\n      name\n    }, args) {\n      // TODO\n      // mount is a runtime helper, this shouldn't use dynamic layout\n      // we should resolve the engine app template in the helper\n      // it also should use the owner that looked up the mount helper.\n      var engine = environment.owner.buildChildEngineInstance(name);\n      engine.boot();\n      var applicationFactory = engine.factoryFor(\"controller:application\");\n      var controllerFactory = applicationFactory || (0, _routing.generateControllerFactory)(engine, 'application');\n      var controller;\n      var self;\n      var bucket;\n      var modelRef;\n\n      if (args.named.has(MODEL_ARG_NAME)) {\n        modelRef = args.named.get(MODEL_ARG_NAME);\n      }\n\n      if (modelRef === undefined) {\n        controller = controllerFactory.create();\n        self = new RootReference(controller, environment);\n        bucket = {\n          engine,\n          controller,\n          self,\n          environment\n        };\n      } else {\n        var model = modelRef.value();\n        controller = controllerFactory.create({\n          model\n        });\n        self = new RootReference(controller, environment);\n        bucket = {\n          engine,\n          controller,\n          self,\n          modelRef,\n          environment\n        };\n      }\n\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        environment.debugRenderTree.create(bucket, {\n          type: 'engine',\n          name,\n          args: args.capture(),\n          instance: engine,\n          template: undefined\n        });\n        environment.debugRenderTree.create(controller, {\n          type: 'route-template',\n          name: 'application',\n          args: args.capture(),\n          instance: controller,\n          // set in getDynamicLayout\n          template: undefined\n        });\n      }\n\n      return bucket;\n    }\n\n    getSelf({\n      self\n    }) {\n      return self;\n    }\n\n    getTag(state) {\n      var tag = _reference.CONSTANT_TAG;\n\n      if (state.modelRef) {\n        tag = state.modelRef.tag;\n      }\n\n      if (_environment2.ENV._DEBUG_RENDER_TREE && (0, _reference.isConstTag)(tag)) {\n        tag = (0, _reference.createTag)();\n      }\n\n      return tag;\n    }\n\n    getDestructor(bucket) {\n      var {\n        engine,\n        environment,\n        controller\n      } = bucket;\n\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        return {\n          destroy() {\n            environment.debugRenderTree.willDestroy(controller);\n            environment.debugRenderTree.willDestroy(bucket);\n            engine.destroy();\n          }\n\n        };\n      } else {\n        return engine;\n      }\n    }\n\n    didRenderLayout(bucket, bounds) {\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        bucket.environment.debugRenderTree.didRender(bucket.controller, bounds);\n        bucket.environment.debugRenderTree.didRender(bucket, bounds);\n      }\n    }\n\n    update(bucket) {\n      var {\n        controller,\n        environment,\n        modelRef\n      } = bucket;\n\n      if (modelRef !== undefined) {\n        controller.set('model', modelRef.value());\n      }\n\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        environment.debugRenderTree.update(bucket);\n        environment.debugRenderTree.update(bucket.controller);\n      }\n    }\n\n    didUpdateLayout(bucket, bounds) {\n      if (_environment2.ENV._DEBUG_RENDER_TREE) {\n        bucket.environment.debugRenderTree.didRender(bucket.controller, bounds);\n        bucket.environment.debugRenderTree.didRender(bucket, bounds);\n      }\n    }\n\n  }\n\n  var MOUNT_MANAGER = new MountManager();\n\n  class MountDefinition {\n    constructor(name) {\n      this.manager = MOUNT_MANAGER;\n      this.state = {\n        name\n      };\n    }\n\n  }\n\n  function mountHelper(vm, args) {\n    var env = vm.env;\n    var nameRef = args.positional.at(0);\n    var captured = null; // TODO: the functionailty to create a proper CapturedArgument should be\n    // exported by glimmer, or that it should provide an overload for `curry`\n    // that takes `PreparedArguments`\n\n    if (args.named.has('model')) {\n      (true && !(args.named.length === 1) && (0, _debug.assert)('[BUG] this should already be checked by the macro', args.named.length === 1));\n      var named = args.named.capture();\n      var {\n        tag\n      } = named; // TODO delete me after EMBER_ROUTING_MODEL_ARG has shipped\n\n      if (true\n      /* DEBUG */\n      && MODEL_ARG_NAME !== 'model') {\n        (true && !(named['_map'] === null) && (0, _debug.assert)('[BUG] named._map is not null', named['_map'] === null));\n        named.names = [MODEL_ARG_NAME];\n      }\n\n      captured = {\n        tag,\n        positional: _runtime2.EMPTY_ARGS.positional,\n        named,\n        length: 1,\n\n        value() {\n          return {\n            named: this.named.value(),\n            positional: this.positional.value()\n          };\n        }\n\n      };\n    }\n\n    return new DynamicEngineReference(nameRef, env, captured);\n  }\n  /**\n    The `{{mount}}` helper lets you embed a routeless engine in a template.\n    Mounting an engine will cause an instance to be booted and its `application`\n    template to be rendered.\n  \n    For example, the following template mounts the `ember-chat` engine:\n  \n    ```handlebars\n    {{! application.hbs }}\n    {{mount \"ember-chat\"}}\n    ```\n  \n    Additionally, you can also pass in a `model` argument that will be\n    set as the engines model. This can be an existing object:\n  \n    ```\n    <div>\n      {{mount 'admin' model=userSettings}}\n    </div>\n    ```\n  \n    Or an inline `hash`, and you can even pass components:\n  \n    ```\n    <div>\n      <h1>Application template!</h1>\n      {{mount 'admin' model=(hash\n          title='Secret Admin'\n          signInButton=(component 'sign-in-button')\n      )}}\n    </div>\n    ```\n  \n    @method mount\n    @param {String} name Name of the engine to mount.\n    @param {Object} [model] Object that will be set as\n                            the model of the engine.\n    @for Ember.Templates.helpers\n    @public\n  */\n\n\n  function mountMacro(_name, params, hash, builder) {\n    (true && !(params.length === 1) && (0, _debug.assert)('You can only pass a single positional argument to the {{mount}} helper, e.g. {{mount \"chat-engine\"}}.', params.length === 1));\n\n    if (true\n    /* DEBUG */\n    && hash) {\n      var keys = hash[0];\n      var extra = keys.filter(k => k !== 'model');\n      (true && !(extra.length === 0) && (0, _debug.assert)('You can only pass a `model` argument to the {{mount}} helper, ' + 'e.g. {{mount \"profile-engine\" model=this.profile}}. ' + (\"You passed \" + extra.join(',') + \".\"), extra.length === 0));\n    }\n\n    var expr = [_wireFormat.Ops.Helper, '-mount', params || [], hash];\n    builder.dynamicComponent(expr, null, [], null, false, null, null);\n    return true;\n  }\n\n  class DynamicEngineReference {\n    constructor(nameRef, env, args) {\n      this.nameRef = nameRef;\n      this.env = env;\n      this.args = args;\n      this._lastName = null;\n      this._lastDef = null;\n      this.tag = nameRef.tag;\n    }\n\n    value() {\n      var {\n        env,\n        nameRef,\n        args\n      } = this;\n      var name = nameRef.value();\n\n      if (typeof name === 'string') {\n        if (this._lastName === name) {\n          return this._lastDef;\n        }\n\n        (true && !(env.owner.hasRegistration(\"engine:\" + name)) && (0, _debug.assert)(\"You used `{{mount '\" + name + \"'}}`, but the engine '\" + name + \"' can not be found.\", env.owner.hasRegistration(\"engine:\" + name)));\n\n        if (!env.owner.hasRegistration(\"engine:\" + name)) {\n          return null;\n        }\n\n        this._lastName = name;\n        this._lastDef = (0, _runtime2.curry)(new MountDefinition(name), args);\n        return this._lastDef;\n      } else {\n        (true && !(name === null || name === undefined) && (0, _debug.assert)(\"Invalid engine name '\" + name + \"' specified, engine name must be either a string, null or undefined.\", name === null || name === undefined));\n        this._lastDef = null;\n        this._lastName = null;\n        return null;\n      }\n    }\n\n    get() {\n      return _runtime2.UNDEFINED_REFERENCE;\n    }\n\n  }\n  /**\n   * Represents the root outlet.\n   */\n\n\n  class RootOutletReference {\n    constructor(outletState) {\n      this.outletState = outletState;\n      this.tag = (0, _reference.createTag)();\n    }\n\n    get(key) {\n      return new PathReference(this, key);\n    }\n\n    value() {\n      return this.outletState;\n    }\n\n    update(state) {\n      this.outletState.outlets.main = state;\n      (0, _reference.dirty)(this.tag);\n    }\n\n  }\n  /**\n   * Represents the connected outlet.\n   */\n\n\n  class OutletReference {\n    constructor(parentStateRef, outletNameRef) {\n      this.parentStateRef = parentStateRef;\n      this.outletNameRef = outletNameRef;\n      this.tag = (0, _reference.combine)([parentStateRef.tag, outletNameRef.tag]);\n    }\n\n    value() {\n      var outletState = this.parentStateRef.value();\n      var outlets = outletState === undefined ? undefined : outletState.outlets;\n      return outlets === undefined ? undefined : outlets[this.outletNameRef.value()];\n    }\n\n    get(key) {\n      return new PathReference(this, key);\n    }\n\n  }\n  /**\n   * Outlet state is dirtied from root.\n   * This just using the parent tag for dirtiness.\n   */\n\n\n  class PathReference {\n    constructor(parent, key) {\n      this.parent = parent;\n      this.key = key;\n      this.tag = parent.tag;\n    }\n\n    get(key) {\n      return new PathReference(this, key);\n    }\n\n    value() {\n      var parent = this.parent.value();\n      return parent && parent[this.key];\n    }\n\n  }\n  /**\n    The `{{outlet}}` helper lets you specify where a child route will render in\n    your template. An important use of the `{{outlet}}` helper is in your\n    application's `application.hbs` file:\n  \n    ```handlebars\n    {{! app/templates/application.hbs }}\n    <!-- header content goes here, and will always display -->\n    <MyHeader />\n    <div class=\"my-dynamic-content\">\n      <!-- this content will change based on the current route, which depends on the current URL -->\n      {{outlet}}\n    </div>\n    <!-- footer content goes here, and will always display -->\n    <MyFooter />\n    ```\n  \n    You may also specify a name for the `{{outlet}}`, which is useful when using more than one\n    `{{outlet}}` in a template:\n  \n    ```handlebars\n    {{outlet \"menu\"}}\n    {{outlet \"sidebar\"}}\n    {{outlet \"main\"}}\n    ```\n  \n    Your routes can then render into a specific one of these `outlet`s by specifying the `outlet`\n    attribute in your `renderTemplate` function:\n  \n    ```app/routes/menu.js\n    import Route from '@ember/routing/route';\n  \n    export default Route.extend({\n      renderTemplate() {\n        this.render({ outlet: 'menu' });\n      }\n    });\n    ```\n  \n    See the [routing guide](https://guides.emberjs.com/release/routing/rendering-a-template/) for more\n    information on how your `route` interacts with the `{{outlet}}` helper.\n    Note: Your content __will not render__ if there isn't an `{{outlet}}` for it.\n  \n    @method outlet\n    @param {String} [name]\n    @for Ember.Templates.helpers\n    @public\n  */\n\n\n  function outletHelper(vm, args) {\n    var scope = vm.dynamicScope();\n    var nameRef;\n\n    if (args.positional.length === 0) {\n      nameRef = new _reference.ConstReference('main');\n    } else {\n      nameRef = args.positional.at(0);\n    }\n\n    return new OutletComponentReference(new OutletReference(scope.outletState, nameRef), vm.env);\n  }\n\n  function outletMacro(_name, params, hash, builder) {\n    var expr = [_wireFormat.Ops.Helper, '-outlet', params || [], hash];\n    builder.dynamicComponent(expr, null, [], null, false, null, null);\n    return true;\n  }\n\n  class OutletModelReference {\n    constructor(parent, env) {\n      this.parent = parent;\n      this.env = env;\n      this.tag = parent.tag;\n    }\n\n    value() {\n      var state = this.parent.value();\n\n      if (state === undefined) {\n        return undefined;\n      }\n\n      var {\n        render\n      } = state;\n\n      if (render === undefined) {\n        return undefined;\n      }\n\n      return render.model;\n    }\n\n    get(property) {\n      if (true\n      /* DEBUG */\n      ) {\n        // We capture the log stack now, as accessing `{{@model}}` directly can't\n        // cause issues (doesn't autotrack) but accessing subproperties can. We\n        // don't want to capture the log stack when `value` or `debug` are called,\n        // because the ref might have been passed downward, so we'd have the\n        // incorrect context.\n        //\n        // TODO: This feels messy, side-effect of the fact that this ref is\n        // created well before the component itself.\n        this.debugStackLog = this.env.debugRenderTree.logCurrentRenderStack(); // This guarentees that we preserve the `debug()` output below\n\n        return new NestedPropertyReference(this, property);\n      } else {\n        return PropertyReference.create(this, property);\n      }\n    }\n\n  }\n\n  if (true\n  /* DEBUG */\n  ) {\n    OutletModelReference.prototype['debug'] = function debug(subPath) {\n      return this['debugStackLog'] + \"@model.\" + subPath;\n    };\n  }\n\n  class OutletComponentReference {\n    constructor(outletRef, env) {\n      this.outletRef = outletRef;\n      this.args = null;\n      this.definition = null;\n      this.lastState = null; // The router always dirties the root state.\n\n      var tag = this.tag = outletRef.tag;\n      {\n        var modelRef = new OutletModelReference(outletRef, env);\n        var map$$1 = (0, _util.dict)();\n        map$$1.model = modelRef; // TODO: the functionailty to create a proper CapturedArgument should be\n        // exported by glimmer, or that it should provide an overload for `curry`\n        // that takes `PreparedArguments`\n\n        this.args = {\n          tag,\n          positional: _runtime2.EMPTY_ARGS.positional,\n          named: {\n            tag,\n            map: map$$1,\n            names: ['model'],\n            references: [modelRef],\n            length: 1,\n\n            has(key) {\n              return key === 'model';\n            },\n\n            get(key) {\n              return key === 'model' ? modelRef : _runtime2.UNDEFINED_REFERENCE;\n            },\n\n            value() {\n              var model = modelRef.value();\n              return {\n                model\n              };\n            }\n\n          },\n          length: 1,\n\n          value() {\n            return {\n              named: this.named.value(),\n              positional: this.positional.value()\n            };\n          }\n\n        };\n      }\n    }\n\n    value() {\n      var state = stateFor(this.outletRef);\n\n      if (validate$1(state, this.lastState)) {\n        return this.definition;\n      }\n\n      this.lastState = state;\n      var definition = null;\n\n      if (state !== null) {\n        definition = (0, _runtime2.curry)(new OutletComponentDefinition(state), this.args);\n      }\n\n      return this.definition = definition;\n    }\n\n    get(_key) {\n      return _runtime2.UNDEFINED_REFERENCE;\n    }\n\n  }\n\n  function stateFor(ref) {\n    var outlet = ref.value();\n    if (outlet === undefined) return null;\n    var render = outlet.render;\n    if (render === undefined) return null;\n    var template$$1 = render.template;\n    if (template$$1 === undefined) return null; // this guard can be removed once @ember/test-helpers@1.6.0 has \"aged out\"\n    // and is no longer considered supported\n\n    if (isTemplateFactory(template$$1)) {\n      template$$1 = template$$1(render.owner);\n    }\n\n    return {\n      ref,\n      name: render.name,\n      outlet: render.outlet,\n      template: template$$1,\n      controller: render.controller,\n      model: render.model\n    };\n  }\n\n  function validate$1(state, lastState) {\n    if (state === null) {\n      return lastState === null;\n    }\n\n    if (lastState === null) {\n      return false;\n    }\n\n    return state.template === lastState.template && state.controller === lastState.controller;\n  }\n\n  function hashToArgs(hash) {\n    if (hash === null) return null;\n    var names = hash[0].map(key => \"@\" + key);\n    return [names, hash[1]];\n  }\n\n  function refineInlineSyntax(name, params, hash, builder) {\n    (true && !(!(builder.compiler['resolver']['resolver']['builtInHelpers'][name] && builder.referrer.owner.hasRegistration(\"helper:\" + name))) && (0, _debug.assert)(\"You attempted to overwrite the built-in helper \\\"\" + name + \"\\\" which is not allowed. Please rename the helper.\", !(builder.compiler['resolver']['resolver']['builtInHelpers'][name] && builder.referrer.owner.hasRegistration(\"helper:\" + name))));\n    var handle = builder.compiler['resolver'].lookupComponentDefinition(name, builder.referrer);\n\n    if (handle !== null) {\n      builder.component.static(handle, [params === null ? [] : params, hashToArgs(hash), null, null]);\n      return true;\n    }\n\n    return false;\n  }\n\n  function refineBlockSyntax(name, params, hash, template, inverse, builder) {\n    var handle = builder.compiler['resolver'].lookupComponentDefinition(name, builder.referrer);\n\n    if (handle !== null) {\n      wrapComponentClassAttribute(hash);\n      builder.component.static(handle, [params, hashToArgs(hash), template, inverse]);\n      return true;\n    }\n\n    (true && !(builder.referrer.owner.hasRegistration(\"helper:\" + name)) && (0, _debug.assert)(\"A component or helper named \\\"\" + name + \"\\\" could not be found\", builder.referrer.owner.hasRegistration(\"helper:\" + name)));\n    (true && !(!(() => {\n      var resolver = builder.compiler['resolver']['resolver'];\n      var {\n        owner,\n        moduleName\n      } = builder.referrer;\n\n      if (name === 'component' || resolver['builtInHelpers'][name]) {\n        return true;\n      }\n\n      var options = {\n        source: \"template:\" + moduleName\n      };\n      return owner.hasRegistration(\"helper:\" + name, options) || owner.hasRegistration(\"helper:\" + name);\n    })()) && (0, _debug.assert)(\"Helpers may not be used in the block form, for example {{#\" + name + \"}}{{/\" + name + \"}}. Please use a component, or alternatively use the helper in combination with a built-in Ember helper, for example {{#if (\" + name + \")}}{{/if}}.\", !(() => {\n      var resolver = builder.compiler['resolver']['resolver'];\n      var {\n        owner,\n        moduleName\n      } = builder.referrer;\n\n      if (name === 'component' || resolver['builtInHelpers'][name]) {\n        return true;\n      }\n\n      var options = {\n        source: \"template:\" + moduleName\n      };\n      return owner.hasRegistration(\"helper:\" + name, options) || owner.hasRegistration(\"helper:\" + name);\n    })()));\n    return false;\n  }\n\n  var experimentalMacros = []; // This is a private API to allow for experimental macros\n  // to be created in user space. Registering a macro should\n  // should be done in an initializer.\n\n  _exports._experimentalMacros = experimentalMacros;\n\n  function registerMacros(macro) {\n    experimentalMacros.push(macro);\n  }\n\n  function populateMacros(macros) {\n    var {\n      inlines,\n      blocks\n    } = macros;\n    inlines.add('outlet', outletMacro);\n    inlines.add('mount', mountMacro);\n    inlines.addMissing(refineInlineSyntax);\n    blocks.add('let', blockLetMacro);\n    blocks.addMissing(refineBlockSyntax);\n\n    for (var i = 0; i < experimentalMacros.length; i++) {\n      var macro = experimentalMacros[i];\n      macro(blocks, inlines);\n    }\n\n    return {\n      blocks,\n      inlines\n    };\n  }\n\n  var TEMPLATES$1 = new WeakMap();\n  var getPrototypeOf$1 = Object.getPrototypeOf;\n\n  function setComponentTemplate(factory, obj) {\n    (true && !(obj !== null && (typeof obj === 'object' || typeof obj === 'function')) && (0, _debug.assert)(\"Cannot call `setComponentTemplate` on `\" + (0, _utils.toString)(obj) + \"`\", obj !== null && (typeof obj === 'object' || typeof obj === 'function')));\n    (true && !(!TEMPLATES$1.has(obj)) && (0, _debug.assert)(\"Cannot call `setComponentTemplate` multiple times on the same class (`\" + obj + \"`)\", !TEMPLATES$1.has(obj)));\n    TEMPLATES$1.set(obj, factory);\n    return obj;\n  }\n\n  function getComponentTemplate(obj) {\n    var pointer = obj;\n\n    while (pointer !== undefined && pointer !== null) {\n      var _template = TEMPLATES$1.get(pointer);\n\n      if (_template !== undefined) {\n        return _template;\n      }\n\n      pointer = getPrototypeOf$1(pointer);\n    }\n\n    return null;\n  }\n\n  function setModifierManager(factory, obj) {\n    return setManager({\n      factory,\n      internal: false,\n      type: 'modifier'\n    }, obj);\n  }\n\n  function getModifierManager(obj) {\n    var wrapper = getManager(obj);\n\n    if (wrapper && !wrapper.internal && wrapper.type === 'modifier') {\n      return wrapper.factory;\n    } else {\n      return undefined;\n    }\n  }\n\n  function instrumentationPayload$1(name) {\n    return {\n      object: \"component:\" + name\n    };\n  }\n\n  function makeOptions(moduleName, namespace) {\n    return {\n      source: moduleName !== undefined ? \"template:\" + moduleName : undefined,\n      namespace\n    };\n  }\n\n  function componentFor(name, owner, options) {\n    var fullName = \"component:\" + name;\n    return owner.factoryFor(fullName, options) || null;\n  }\n\n  function layoutFor(name, owner, options) {\n    var templateFullName = \"template:components/\" + name;\n    return owner.lookup(templateFullName, options) || null;\n  }\n\n  function lookupComponentPair(owner, name, options) {\n    var component = componentFor(name, owner, options);\n    {\n      if (component !== null && component.class !== undefined) {\n        var _layout2 = getComponentTemplate(component.class);\n\n        if (_layout2 !== null) {\n          return {\n            component,\n            layout: _layout2\n          };\n        }\n      }\n    }\n    var layout = layoutFor(name, owner, options);\n\n    if (component === null && layout === null) {\n      return null;\n    } else {\n      return {\n        component,\n        layout\n      };\n    }\n  }\n\n  function lookupComponent(owner, name, options) {\n    if (options.source || options.namespace) {\n      var pair = lookupComponentPair(owner, name, options);\n\n      if (pair !== null) {\n        return pair;\n      }\n    }\n\n    return lookupComponentPair(owner, name);\n  }\n\n  var lookupPartial;\n  var templateFor;\n  var parseUnderscoredName;\n\n  if (_deprecatedFeatures.PARTIALS) {\n    lookupPartial = function (templateName, owner) {\n      (true && !(false) && (0, _debug.deprecate)(\"The use of `{{partial}}` is deprecated, please refactor the \\\"\" + templateName + \"\\\" partial to a component\", false, {\n        id: 'ember-views.partial',\n        until: '4.0.0',\n        url: 'https://deprecations.emberjs.com/v3.x#toc_ember-views-partial'\n      }));\n\n      if (templateName === null) {\n        return;\n      }\n\n      var template = templateFor(owner, parseUnderscoredName(templateName), templateName);\n      (true && !(Boolean(template)) && (0, _debug.assert)(\"Unable to find partial with name \\\"\" + templateName + \"\\\"\", Boolean(template)));\n      return template;\n    };\n\n    templateFor = function (owner, underscored, name) {\n      if (_deprecatedFeatures.PARTIALS) {\n        if (!name) {\n          return;\n        }\n\n        (true && !(name.indexOf('.') === -1) && (0, _debug.assert)(\"templateNames are not allowed to contain periods: \" + name, name.indexOf('.') === -1));\n\n        if (!owner) {\n          throw new _error.default('Container was not found when looking up a views template. ' + 'This is most likely due to manually instantiating an Ember.View. ' + 'See: http://git.io/EKPpnA');\n        }\n\n        return owner.lookup(\"template:\" + underscored) || owner.lookup(\"template:\" + name);\n      }\n    };\n\n    parseUnderscoredName = function (templateName) {\n      var nameParts = templateName.split('/');\n      var lastPart = nameParts[nameParts.length - 1];\n      nameParts[nameParts.length - 1] = \"_\" + lastPart;\n      return nameParts.join('/');\n    };\n  }\n\n  var BUILTINS_HELPERS = {\n    if: inlineIf,\n    action,\n    array,\n    concat: concat$1,\n    fn,\n    get: get$1,\n    hash,\n    log: log$1,\n    mut,\n    'query-params': queryParams$1,\n    readonly,\n    unbound,\n    unless: inlineUnless,\n    '-class': classHelper$1,\n    '-each-in': eachIn,\n    '-input-type': inputTypeHelper$1,\n    '-normalize-class': normalizeClassHelper,\n    '-get-dynamic-var': _runtime2.getDynamicVar,\n    '-mount': mountHelper,\n    '-outlet': outletHelper,\n    '-assert-implicit-component-helper-argument': componentAssertionHelper\n  };\n\n  class RuntimeResolver {\n    constructor(isInteractive) {\n      this.handles = [undefined];\n      this.objToHandle = new WeakMap();\n      this.builtInHelpers = BUILTINS_HELPERS;\n      this.componentDefinitionCache = new Map();\n      this.componentDefinitionCount = 0;\n      this.helperDefinitionCount = 0;\n      var macros = new _opcodeCompiler.Macros();\n      populateMacros(macros);\n      this.compiler = new _opcodeCompiler.LazyCompiler(new CompileTimeLookup(this), this, macros);\n      this.isInteractive = isInteractive;\n      this.builtInModifiers = {\n        action: {\n          manager: new ActionModifierManager(),\n          state: null\n        },\n        on: {\n          manager: new OnModifierManager(isInteractive),\n          state: null\n        }\n      };\n    }\n    /***  IRuntimeResolver ***/\n\n    /**\n     * public componentDefHandleCount = 0;\n     * Called while executing Append Op.PushDynamicComponentManager if string\n     */\n\n\n    lookupComponentDefinition(name, meta) {\n      var handle = this.lookupComponentHandle(name, meta);\n\n      if (handle === null) {\n        (true && !(false) && (0, _debug.assert)(\"Could not find component named \\\"\" + name + \"\\\" (no component or template with that name was found)\"));\n        return null;\n      }\n\n      return this.resolve(handle);\n    }\n\n    lookupComponentHandle(name, meta) {\n      var nextHandle = this.handles.length;\n      var handle = this.handle(this._lookupComponentDefinition(name, meta));\n      (true && !(!(name === 'text-area' && handle === null)) && (0, _debug.assert)('Could not find component `<TextArea />` (did you mean `<Textarea />`?)', !(name === 'text-area' && handle === null)));\n\n      if (nextHandle === handle) {\n        this.componentDefinitionCount++;\n      }\n\n      return handle;\n    }\n    /**\n     * Called by RuntimeConstants to lookup unresolved handles.\n     */\n\n\n    resolve(handle) {\n      return this.handles[handle];\n    } // End IRuntimeResolver\n\n    /**\n     * Called by CompileTimeLookup compiling Unknown or Helper OpCode\n     */\n\n\n    lookupHelper(name, meta) {\n      var nextHandle = this.handles.length;\n\n      var helper$$1 = this._lookupHelper(name, meta);\n\n      if (helper$$1 !== null) {\n        var handle = this.handle(helper$$1);\n\n        if (nextHandle === handle) {\n          this.helperDefinitionCount++;\n        }\n\n        return handle;\n      }\n\n      return null;\n    }\n    /**\n     * Called by CompileTimeLookup compiling the\n     */\n\n\n    lookupModifier(name, meta) {\n      return this.handle(this._lookupModifier(name, meta));\n    }\n    /**\n     * Called by CompileTimeLookup to lookup partial\n     */\n\n\n    lookupPartial(name, meta) {\n      if (_deprecatedFeatures.PARTIALS) {\n        var partial = this._lookupPartial(name, meta);\n\n        return this.handle(partial);\n      } else {\n        return null;\n      }\n    } // end CompileTimeLookup\n    // needed for lazy compile time lookup\n\n\n    handle(obj) {\n      if (obj === undefined || obj === null) {\n        return null;\n      }\n\n      var handle = this.objToHandle.get(obj);\n\n      if (handle === undefined) {\n        handle = this.handles.push(obj) - 1;\n        this.objToHandle.set(obj, handle);\n      }\n\n      return handle;\n    }\n\n    _lookupHelper(_name, meta) {\n      var helper$$1 = this.builtInHelpers[_name];\n\n      if (helper$$1 !== undefined) {\n        return helper$$1;\n      }\n\n      var {\n        owner,\n        moduleName\n      } = meta;\n      var name = _name;\n      var namespace = undefined;\n      var options = makeOptions(moduleName, namespace);\n      var factory = owner.factoryFor(\"helper:\" + name, options) || owner.factoryFor(\"helper:\" + name);\n\n      if (!isHelperFactory(factory)) {\n        return null;\n      }\n\n      return (vm, args) => {\n        var helper$$1 = factory.create();\n\n        if (isSimpleHelper(helper$$1)) {\n          return SimpleHelperReference.create(helper$$1.compute, args.capture());\n        }\n\n        vm.newDestroyable(helper$$1);\n        return ClassBasedHelperReference.create(helper$$1, args.capture());\n      };\n    }\n\n    _lookupPartial(name, meta) {\n      var templateFactory$$1 = lookupPartial(name, meta.owner);\n      var template = templateFactory$$1(meta.owner);\n      return new _opcodeCompiler.PartialDefinition(name, template);\n    }\n\n    _lookupModifier(name, meta) {\n      var builtin = this.builtInModifiers[name];\n\n      if (builtin === undefined) {\n        var {\n          owner\n        } = meta;\n        var modifier = owner.factoryFor(\"modifier:\" + name);\n\n        if (modifier !== undefined) {\n          var managerFactory = getModifierManager(modifier.class);\n          var manager = managerFactory(owner);\n          return new CustomModifierDefinition(name, modifier, manager, this.isInteractive);\n        }\n      }\n\n      return builtin;\n    }\n\n    _parseNameForNamespace(_name) {\n      var name = _name;\n      var namespace = undefined;\n\n      var namespaceDelimiterOffset = _name.indexOf('::');\n\n      if (namespaceDelimiterOffset !== -1) {\n        name = _name.slice(namespaceDelimiterOffset + 2);\n        namespace = _name.slice(0, namespaceDelimiterOffset);\n      }\n\n      return {\n        name,\n        namespace\n      };\n    }\n\n    _lookupComponentDefinition(_name, {\n      moduleName,\n      owner\n    }) {\n      var name = _name;\n      var namespace = undefined;\n      var pair = lookupComponent(owner, name, makeOptions(moduleName, namespace));\n\n      if (pair === null) {\n        return null;\n      }\n\n      var layout = null;\n      var key;\n\n      if (pair.component === null) {\n        key = layout = pair.layout(owner);\n      } else {\n        key = pair.component;\n      }\n\n      var cachedComponentDefinition = this.componentDefinitionCache.get(key);\n\n      if (cachedComponentDefinition !== undefined) {\n        return cachedComponentDefinition;\n      }\n\n      if (layout === null && pair.layout !== null) {\n        layout = pair.layout(owner);\n      }\n\n      var finalizer = (0, _instrumentation._instrumentStart)('render.getComponentDefinition', instrumentationPayload$1, name);\n      var definition = null;\n\n      if (pair.component === null) {\n        if (_environment2.ENV._TEMPLATE_ONLY_GLIMMER_COMPONENTS) {\n          definition = new TemplateOnlyComponentDefinition(name, layout);\n        }\n      } else if (true\n      /* EMBER_GLIMMER_SET_COMPONENT_TEMPLATE */\n      && (0, _templateOnly.isTemplateOnlyComponent)(pair.component.class)) {\n        definition = new TemplateOnlyComponentDefinition(name, layout);\n      }\n\n      if (pair.component !== null) {\n        (true && !(pair.component.class !== undefined) && (0, _debug.assert)(\"missing component class \" + name, pair.component.class !== undefined));\n        var ComponentClass = pair.component.class;\n        var wrapper = getManager(ComponentClass);\n\n        if (wrapper !== null && wrapper.type === 'component') {\n          var {\n            factory\n          } = wrapper;\n\n          if (wrapper.internal) {\n            (true && !(pair.layout !== null) && (0, _debug.assert)(\"missing layout for internal component \" + name, pair.layout !== null));\n            definition = new InternalComponentDefinition(factory(owner), ComponentClass, layout);\n          } else {\n            definition = new CustomManagerDefinition(name, pair.component, factory(owner), layout !== null ? layout : owner.lookup((0, _container.privatize)(_templateObject3()))(owner));\n          }\n        }\n      }\n\n      if (definition === null) {\n        definition = new CurlyComponentDefinition(name, pair.component || owner.factoryFor((0, _container.privatize)(_templateObject4())), null, layout);\n      }\n\n      finalizer();\n      this.componentDefinitionCache.set(key, definition);\n      return definition;\n    }\n\n  }\n\n  var TemplateCompiler = {\n    create({\n      environment\n    }) {\n      return new RuntimeResolver(environment.isInteractive).compiler;\n    }\n\n  };\n  var ComponentTemplate = template({\n    \"id\": \"chfQcH83\",\n    \"block\": \"{\\\"symbols\\\":[\\\"&default\\\"],\\\"statements\\\":[[14,1]],\\\"hasEval\\\":false}\",\n    \"meta\": {\n      \"moduleName\": \"packages/@ember/-internals/glimmer/lib/templates/component.hbs\"\n    }\n  });\n  var InputTemplate = template({\n    \"id\": \"NWZzLSII\",\n    \"block\": \"{\\\"symbols\\\":[\\\"Checkbox\\\",\\\"TextField\\\",\\\"@__ARGS__\\\",\\\"&attrs\\\"],\\\"statements\\\":[[4,\\\"let\\\",[[28,\\\"component\\\",[\\\"-checkbox\\\"],null],[28,\\\"component\\\",[\\\"-text-field\\\"],null]],null,{\\\"statements\\\":[[4,\\\"if\\\",[[23,0,[\\\"isCheckbox\\\"]]],null,{\\\"statements\\\":[[6,[23,1,[]],[[13,4]],[[\\\"@target\\\",\\\"@__ARGS__\\\"],[[23,0,[\\\"caller\\\"]],[23,3,[]]]]]],\\\"parameters\\\":[]},{\\\"statements\\\":[[6,[23,2,[]],[[13,4]],[[\\\"@target\\\",\\\"@__ARGS__\\\"],[[23,0,[\\\"caller\\\"]],[23,3,[]]]]]],\\\"parameters\\\":[]}]],\\\"parameters\\\":[1,2]},null]],\\\"hasEval\\\":false}\",\n    \"meta\": {\n      \"moduleName\": \"packages/@ember/-internals/glimmer/lib/templates/input.hbs\"\n    }\n  });\n  var OutletTemplate = template({\n    \"id\": \"ffAL6HDl\",\n    \"block\": \"{\\\"symbols\\\":[],\\\"statements\\\":[[1,[22,\\\"outlet\\\"],false]],\\\"hasEval\\\":false}\",\n    \"meta\": {\n      \"moduleName\": \"packages/@ember/-internals/glimmer/lib/templates/outlet.hbs\"\n    }\n  });\n  var TOP_LEVEL_NAME = '-top-level';\n  var TOP_LEVEL_OUTLET = 'main';\n\n  class OutletView {\n    constructor(_environment, renderer, owner, template) {\n      this._environment = _environment;\n      this.renderer = renderer;\n      this.owner = owner;\n      this.template = template;\n      var ref = this.ref = new RootOutletReference({\n        outlets: {\n          main: undefined\n        },\n        render: {\n          owner: owner,\n          into: undefined,\n          outlet: TOP_LEVEL_OUTLET,\n          name: TOP_LEVEL_NAME,\n          controller: undefined,\n          model: undefined,\n          template\n        }\n      });\n      this.state = {\n        ref,\n        name: TOP_LEVEL_NAME,\n        outlet: TOP_LEVEL_OUTLET,\n        template,\n        controller: undefined,\n        model: undefined\n      };\n    }\n\n    static extend(injections) {\n      return class extends OutletView {\n        static create(options) {\n          if (options) {\n            return super.create((0, _polyfills.assign)({}, injections, options));\n          } else {\n            return super.create(injections);\n          }\n        }\n\n      };\n    }\n\n    static reopenClass(injections) {\n      (0, _polyfills.assign)(this, injections);\n    }\n\n    static create(options) {\n      var {\n        _environment,\n        renderer,\n        template: templateFactory$$1\n      } = options;\n      var owner = options[_owner.OWNER];\n      var template = templateFactory$$1(owner);\n      return new OutletView(_environment, renderer, owner, template);\n    }\n\n    appendTo(selector) {\n      var target;\n\n      if (this._environment.hasDOM) {\n        target = typeof selector === 'string' ? document.querySelector(selector) : selector;\n      } else {\n        target = selector;\n      }\n\n      (0, _runloop.schedule)('render', this.renderer, 'appendOutletView', this, target);\n    }\n\n    rerender() {\n      /**/\n    }\n\n    setOutletState(state) {\n      this.ref.update(state);\n    }\n\n    destroy() {\n      /**/\n    }\n\n  }\n\n  _exports.OutletView = OutletView;\n\n  function setupApplicationRegistry(registry) {\n    registry.injection('service:-glimmer-environment', 'appendOperations', 'service:-dom-tree-construction');\n    registry.injection('renderer', 'env', 'service:-glimmer-environment'); // because we are using injections we can't use instantiate false\n    // we need to use bind() to copy the function so factory for\n    // association won't leak\n\n    registry.register('service:-dom-builder', {\n      create({\n        bootOptions\n      }) {\n        var {\n          _renderMode\n        } = bootOptions;\n\n        switch (_renderMode) {\n          case 'serialize':\n            return _node.serializeBuilder.bind(null);\n\n          case 'rehydrate':\n            return _runtime2.rehydrationBuilder.bind(null);\n\n          default:\n            return _runtime2.clientBuilder.bind(null);\n        }\n      }\n\n    });\n    registry.injection('service:-dom-builder', 'bootOptions', '-environment:main');\n    registry.injection('renderer', 'builder', 'service:-dom-builder');\n    registry.register((0, _container.privatize)(_templateObject5()), RootTemplate);\n    registry.injection('renderer', 'rootTemplate', (0, _container.privatize)(_templateObject6()));\n    registry.register('renderer:-dom', InteractiveRenderer);\n    registry.register('renderer:-inert', InertRenderer);\n\n    if (_browserEnvironment.hasDOM) {\n      registry.injection('service:-glimmer-environment', 'updateOperations', 'service:-dom-changes');\n    }\n\n    registry.register('service:-dom-changes', {\n      create({\n        document\n      }) {\n        return new _runtime2.DOMChanges(document);\n      }\n\n    });\n    registry.register('service:-dom-tree-construction', {\n      create({\n        document\n      }) {\n        var Implementation = _browserEnvironment.hasDOM ? _runtime2.DOMTreeConstruction : _node.NodeDOMTreeConstruction;\n        return new Implementation(document);\n      }\n\n    });\n  }\n\n  function setupEngineRegistry(registry) {\n    registry.optionsForType('template', {\n      instantiate: false\n    });\n    registry.register('view:-outlet', OutletView);\n    registry.register('template:-outlet', OutletTemplate);\n    registry.injection('view:-outlet', 'template', 'template:-outlet');\n    registry.injection('service:-dom-changes', 'document', 'service:-document');\n    registry.injection('service:-dom-tree-construction', 'document', 'service:-document');\n    registry.register((0, _container.privatize)(_templateObject7()), ComponentTemplate);\n    registry.register('service:-glimmer-environment', Environment$1);\n    registry.register((0, _container.privatize)(_templateObject8()), TemplateCompiler);\n    registry.injection((0, _container.privatize)(_templateObject9()), 'environment', '-environment:main');\n    registry.optionsForType('helper', {\n      instantiate: false\n    });\n    registry.register('helper:loc', loc$1);\n    registry.register('component:-text-field', TextField);\n    registry.register('component:-checkbox', Checkbox);\n    registry.register('component:link-to', LinkComponent);\n    registry.register('component:input', Input);\n    registry.register('template:components/input', InputTemplate);\n    registry.register('component:textarea', TextArea);\n\n    if (!_environment2.ENV._TEMPLATE_ONLY_GLIMMER_COMPONENTS) {\n      registry.register((0, _container.privatize)(_templateObject10()), Component);\n    }\n  }\n\n  function setComponentManager(stringOrFunction, obj) {\n    var factory;\n\n    if (_deprecatedFeatures.COMPONENT_MANAGER_STRING_LOOKUP && typeof stringOrFunction === 'string') {\n      (true && !(false) && (0, _debug.deprecate)('Passing the name of the component manager to \"setupComponentManager\" is deprecated. Please pass a function that produces an instance of the manager.', false, {\n        id: 'deprecate-string-based-component-manager',\n        until: '4.0.0',\n        url: 'https://emberjs.com/deprecations/v3.x/#toc_component-manager-string-lookup'\n      }));\n\n      factory = function (owner) {\n        return owner.lookup(\"component-manager:\" + stringOrFunction);\n      };\n    } else {\n      factory = stringOrFunction;\n    }\n\n    return setManager({\n      factory,\n      internal: false,\n      type: 'component'\n    }, obj);\n  }\n\n  function getComponentManager(obj) {\n    var wrapper = getManager(obj);\n\n    if (wrapper && !wrapper.internal && wrapper.type === 'component') {\n      return wrapper.factory;\n    } else {\n      return undefined;\n    }\n  }\n  /**\n    [Glimmer](https://github.com/tildeio/glimmer) is a templating engine used by Ember.js that is compatible with a subset of the [Handlebars](http://handlebarsjs.com/) syntax.\n  \n    ### Showing a property\n  \n    Templates manage the flow of an application's UI, and display state (through\n    the DOM) to a user. For example, given a component with the property \"name\",\n    that component's template can use the name in several ways:\n  \n    ```app/components/person-profile.js\n    import Component from '@ember/component';\n  \n    export default Component.extend({\n      name: 'Jill'\n    });\n    ```\n  \n    ```app/templates/components/person-profile.hbs\n    {{name}}\n    <div>{{name}}</div>\n    <span data-name={{name}}></span>\n    ```\n  \n    Any time the \"name\" property on the component changes, the DOM will be\n    updated.\n  \n    Properties can be chained as well:\n  \n    ```handlebars\n    {{aUserModel.name}}\n    <div>{{listOfUsers.firstObject.name}}</div>\n    ```\n  \n    ### Using Ember helpers\n  \n    When content is passed in mustaches `{{}}`, Ember will first try to find a helper\n    or component with that name. For example, the `if` helper:\n  \n    ```handlebars\n    {{if name \"I have a name\" \"I have no name\"}}\n    <span data-has-name={{if name true}}></span>\n    ```\n  \n    The returned value is placed where the `{{}}` is called. The above style is\n    called \"inline\". A second style of helper usage is called \"block\". For example:\n  \n    ```handlebars\n    {{#if name}}\n    I have a name\n    {{else}}\n    I have no name\n    {{/if}}\n    ```\n  \n    The block form of helpers allows you to control how the UI is created based\n    on the values of properties.\n    A third form of helper is called \"nested\". For example here the concat\n    helper will add \" Doe\" to a displayed name if the person has no last name:\n  \n    ```handlebars\n    <span data-name={{concat firstName (\n    if lastName (concat \" \" lastName) \"Doe\"\n    )}}></span>\n    ```\n  \n    Ember's built-in helpers are described under the [Ember.Templates.helpers](/ember/release/classes/Ember.Templates.helpers)\n    namespace. Documentation on creating custom helpers can be found under\n    [helper](/ember/release/functions/@ember%2Fcomponent%2Fhelper/helper) (or\n    under [Helper](/ember/release/classes/Helper) if a helper requires access to\n    dependency injection).\n  \n    ### Invoking a Component\n  \n    Ember components represent state to the UI of an application. Further\n    reading on components can be found under [Component](/ember/release/classes/Component).\n  \n    @module @ember/component\n    @main @ember/component\n    @public\n   */\n\n});","define(\"@ember/-internals/meta/index\", [\"exports\", \"@ember/-internals/meta/lib/meta\"], function (_exports, _meta) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"counters\", {\n    enumerable: true,\n    get: function () {\n      return _meta.counters;\n    }\n  });\n  Object.defineProperty(_exports, \"deleteMeta\", {\n    enumerable: true,\n    get: function () {\n      return _meta.deleteMeta;\n    }\n  });\n  Object.defineProperty(_exports, \"Meta\", {\n    enumerable: true,\n    get: function () {\n      return _meta.Meta;\n    }\n  });\n  Object.defineProperty(_exports, \"meta\", {\n    enumerable: true,\n    get: function () {\n      return _meta.meta;\n    }\n  });\n  Object.defineProperty(_exports, \"peekMeta\", {\n    enumerable: true,\n    get: function () {\n      return _meta.peekMeta;\n    }\n  });\n  Object.defineProperty(_exports, \"setMeta\", {\n    enumerable: true,\n    get: function () {\n      return _meta.setMeta;\n    }\n  });\n  Object.defineProperty(_exports, \"UNDEFINED\", {\n    enumerable: true,\n    get: function () {\n      return _meta.UNDEFINED;\n    }\n  });\n});","define(\"@ember/-internals/meta/lib/meta\", [\"exports\", \"@ember/-internals/utils\", \"@ember/debug\", \"@glimmer/reference\"], function (_exports, _utils, _debug, _reference) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.setMeta = setMeta;\n  _exports.peekMeta = peekMeta;\n  _exports.deleteMeta = deleteMeta;\n  _exports.counters = _exports.meta = _exports.Meta = _exports.UNDEFINED = void 0;\n  var objectPrototype = Object.prototype;\n  var counters;\n  _exports.counters = counters;\n\n  if (true\n  /* DEBUG */\n  ) {\n    _exports.counters = counters = {\n      peekCalls: 0,\n      peekPrototypeWalks: 0,\n      setCalls: 0,\n      deleteCalls: 0,\n      metaCalls: 0,\n      metaInstantiated: 0,\n      matchingListenersCalls: 0,\n      observerEventsCalls: 0,\n      addToListenersCalls: 0,\n      removeFromListenersCalls: 0,\n      removeAllListenersCalls: 0,\n      listenersInherited: 0,\n      listenersFlattened: 0,\n      parentListenersUsed: 0,\n      flattenedListenersCalls: 0,\n      reopensAfterFlatten: 0,\n      readableLazyChainsCalls: 0,\n      writableLazyChainsCalls: 0\n    };\n  }\n  /**\n  @module ember\n  */\n\n\n  var UNDEFINED = (0, _utils.symbol)('undefined');\n  _exports.UNDEFINED = UNDEFINED;\n  var currentListenerVersion = 1;\n\n  class Meta {\n    constructor(obj) {\n      this._listenersVersion = 1;\n      this._inheritedEnd = -1;\n      this._flattenedVersion = 0;\n\n      if (true\n      /* DEBUG */\n      ) {\n        counters.metaInstantiated++;\n        this._values = undefined;\n      }\n\n      this._parent = undefined;\n      this._descriptors = undefined;\n      this._watching = undefined;\n      this._mixins = undefined;\n      this._deps = undefined;\n      this._chainWatchers = undefined;\n      this._chains = undefined;\n      this._tag = undefined;\n      this._tags = undefined; // initial value for all flags right now is false\n      // see FLAGS const for detailed list of flags used\n\n      this._flags = 0\n      /* NONE */\n      ; // used only internally\n\n      this.source = obj;\n      this.proto = obj.constructor === undefined ? undefined : obj.constructor.prototype;\n      this._listeners = undefined;\n    }\n\n    get parent() {\n      var parent = this._parent;\n\n      if (parent === undefined) {\n        var proto = getPrototypeOf(this.source);\n        this._parent = parent = proto === null || proto === objectPrototype ? null : meta(proto);\n      }\n\n      return parent;\n    }\n\n    setInitializing() {\n      this._flags |= 8\n      /* INITIALIZING */\n      ;\n    }\n\n    unsetInitializing() {\n      this._flags ^= 8\n      /* INITIALIZING */\n      ;\n    }\n\n    isInitializing() {\n      return this._hasFlag(8\n      /* INITIALIZING */\n      );\n    }\n\n    isPrototypeMeta(obj) {\n      return this.proto === this.source && this.source === obj;\n    }\n\n    destroy() {\n      if (this.isMetaDestroyed()) {\n        return;\n      }\n\n      this.setMetaDestroyed(); // remove chainWatchers to remove circular references that would prevent GC\n\n      var chains = this.readableChains();\n\n      if (chains !== undefined) {\n        chains.destroy();\n      }\n    }\n\n    isSourceDestroying() {\n      return this._hasFlag(1\n      /* SOURCE_DESTROYING */\n      );\n    }\n\n    setSourceDestroying() {\n      this._flags |= 1\n      /* SOURCE_DESTROYING */\n      ;\n    }\n\n    isSourceDestroyed() {\n      return this._hasFlag(2\n      /* SOURCE_DESTROYED */\n      );\n    }\n\n    setSourceDestroyed() {\n      this._flags |= 2\n      /* SOURCE_DESTROYED */\n      ;\n    }\n\n    isMetaDestroyed() {\n      return this._hasFlag(4\n      /* META_DESTROYED */\n      );\n    }\n\n    setMetaDestroyed() {\n      this._flags |= 4\n      /* META_DESTROYED */\n      ;\n    }\n\n    _hasFlag(flag) {\n      return (this._flags & flag) === flag;\n    }\n\n    _getOrCreateOwnMap(key) {\n      return this[key] || (this[key] = Object.create(null));\n    }\n\n    _getOrCreateOwnSet(key) {\n      return this[key] || (this[key] = new Set());\n    }\n\n    _findInherited1(key) {\n      var pointer = this;\n\n      while (pointer !== null) {\n        var map = pointer[key];\n\n        if (map !== undefined) {\n          return map;\n        }\n\n        pointer = pointer.parent;\n      }\n    }\n\n    _findInherited2(key, subkey) {\n      var pointer = this;\n\n      while (pointer !== null) {\n        var map = pointer[key];\n\n        if (map !== undefined) {\n          var value = map[subkey];\n\n          if (value !== undefined) {\n            return value;\n          }\n        }\n\n        pointer = pointer.parent;\n      }\n    }\n\n    _findInherited3(key, subkey, subsubkey) {\n      var pointer = this;\n\n      while (pointer !== null) {\n        var map = pointer[key];\n\n        if (map !== undefined) {\n          var submap = map[subkey];\n\n          if (submap !== undefined) {\n            var value = submap[subsubkey];\n\n            if (value !== undefined) {\n              return value;\n            }\n          }\n        }\n\n        pointer = pointer.parent;\n      }\n    }\n\n    _findInheritedMap(key, subkey) {\n      var pointer = this;\n\n      while (pointer !== null) {\n        var map = pointer[key];\n\n        if (map !== undefined) {\n          var value = map.get(subkey);\n\n          if (value !== undefined) {\n            return value;\n          }\n        }\n\n        pointer = pointer.parent;\n      }\n    }\n\n    _hasInInheritedSet(key, value) {\n      var pointer = this;\n\n      while (pointer !== null) {\n        var set = pointer[key];\n\n        if (set !== undefined && set.has(value)) {\n          return true;\n        }\n\n        pointer = pointer.parent;\n      }\n\n      return false;\n    } // Implements a member that provides a lazily created map of maps,\n    // with inheritance at both levels.\n\n\n    writeDeps(subkey, itemkey, count) {\n      (true && !(!this.isMetaDestroyed()) && (0, _debug.assert)(this.isMetaDestroyed() ? \"Cannot modify dependent keys for `\" + itemkey + \"` on `\" + (0, _utils.toString)(this.source) + \"` after it has been destroyed.\" : '', !this.isMetaDestroyed()));\n\n      var outerMap = this._getOrCreateOwnMap('_deps');\n\n      var innerMap = outerMap[subkey];\n\n      if (innerMap === undefined) {\n        innerMap = outerMap[subkey] = Object.create(null);\n      }\n\n      innerMap[itemkey] = count;\n    }\n\n    peekDeps(subkey, itemkey) {\n      var val = this._findInherited3('_deps', subkey, itemkey);\n\n      return val === undefined ? 0 : val;\n    }\n\n    hasDeps(subkey) {\n      var val = this._findInherited2('_deps', subkey);\n\n      return val !== undefined;\n    }\n\n    forEachInDeps(subkey, fn) {\n      var pointer = this;\n      var seen;\n\n      while (pointer !== null) {\n        var map = pointer._deps;\n\n        if (map !== undefined) {\n          var innerMap = map[subkey];\n\n          if (innerMap !== undefined) {\n            seen = seen === undefined ? new Set() : seen;\n\n            for (var innerKey in innerMap) {\n              if (!seen.has(innerKey)) {\n                seen.add(innerKey);\n\n                if (innerMap[innerKey] > 0) {\n                  fn(innerKey);\n                }\n              }\n            }\n          }\n        }\n\n        pointer = pointer.parent;\n      }\n    }\n\n    writableTags() {\n      return this._getOrCreateOwnMap('_tags');\n    }\n\n    readableTags() {\n      return this._tags;\n    }\n\n    writableTag() {\n      (true && !(!this.isMetaDestroyed()) && (0, _debug.assert)(this.isMetaDestroyed() ? \"Cannot create a new tag for `\" + (0, _utils.toString)(this.source) + \"` after it has been destroyed.\" : '', !this.isMetaDestroyed()));\n      var ret = this._tag;\n\n      if (ret === undefined) {\n        ret = this._tag = (0, _reference.createUpdatableTag)();\n      }\n\n      return ret;\n    }\n\n    readableTag() {\n      return this._tag;\n    }\n\n    writableLazyChainsFor(key) {\n      if (true\n      /* DEBUG */\n      ) {\n        counters.writableLazyChainsCalls++;\n      }\n\n      var lazyChains = this._getOrCreateOwnMap('_lazyChains');\n\n      if (!(key in lazyChains)) {\n        lazyChains[key] = Object.create(null);\n      }\n\n      return lazyChains[key];\n    }\n\n    readableLazyChainsFor(key) {\n      if (true\n      /* DEBUG */\n      ) {\n        counters.readableLazyChainsCalls++;\n      }\n\n      var lazyChains = this._lazyChains;\n\n      if (lazyChains !== undefined) {\n        return lazyChains[key];\n      }\n\n      return undefined;\n    }\n\n    writableChainWatchers(create) {\n      (true && !(!this.isMetaDestroyed()) && (0, _debug.assert)(this.isMetaDestroyed() ? \"Cannot create a new chain watcher for `\" + (0, _utils.toString)(this.source) + \"` after it has been destroyed.\" : '', !this.isMetaDestroyed()));\n      var ret = this._chainWatchers;\n\n      if (ret === undefined) {\n        ret = this._chainWatchers = create(this.source);\n      }\n\n      return ret;\n    }\n\n    readableChainWatchers() {\n      return this._chainWatchers;\n    }\n\n    writableChains(create) {\n      (true && !(!this.isMetaDestroyed()) && (0, _debug.assert)(this.isMetaDestroyed() ? \"Cannot create a new chains for `\" + (0, _utils.toString)(this.source) + \"` after it has been destroyed.\" : '', !this.isMetaDestroyed()));\n      var {\n        _chains: ret\n      } = this;\n\n      if (ret === undefined) {\n        this._chains = ret = create(this.source);\n        var {\n          parent\n        } = this;\n\n        if (parent !== null) {\n          var parentChains = parent.writableChains(create);\n          parentChains.copyTo(ret);\n        }\n      }\n\n      return ret;\n    }\n\n    readableChains() {\n      return this._findInherited1('_chains');\n    }\n\n    writeWatching(subkey, value) {\n      (true && !(!this.isMetaDestroyed()) && (0, _debug.assert)(this.isMetaDestroyed() ? \"Cannot update watchers for `\" + subkey + \"` on `\" + (0, _utils.toString)(this.source) + \"` after it has been destroyed.\" : '', !this.isMetaDestroyed()));\n\n      var map = this._getOrCreateOwnMap('_watching');\n\n      map[subkey] = value;\n    }\n\n    peekWatching(subkey) {\n      var count = this._findInherited2('_watching', subkey);\n\n      return count === undefined ? 0 : count;\n    }\n\n    addMixin(mixin) {\n      (true && !(!this.isMetaDestroyed()) && (0, _debug.assert)(this.isMetaDestroyed() ? \"Cannot add mixins of `\" + (0, _utils.toString)(mixin) + \"` on `\" + (0, _utils.toString)(this.source) + \"` call addMixin after it has been destroyed.\" : '', !this.isMetaDestroyed()));\n\n      var set = this._getOrCreateOwnSet('_mixins');\n\n      set.add(mixin);\n    }\n\n    hasMixin(mixin) {\n      return this._hasInInheritedSet('_mixins', mixin);\n    }\n\n    forEachMixins(fn) {\n      var pointer = this;\n      var seen;\n\n      while (pointer !== null) {\n        var set = pointer._mixins;\n\n        if (set !== undefined) {\n          seen = seen === undefined ? new Set() : seen; // TODO cleanup typing here\n\n          set.forEach(mixin => {\n            if (!seen.has(mixin)) {\n              seen.add(mixin);\n              fn(mixin);\n            }\n          });\n        }\n\n        pointer = pointer.parent;\n      }\n    }\n\n    writeDescriptors(subkey, value) {\n      (true && !(!this.isMetaDestroyed()) && (0, _debug.assert)(this.isMetaDestroyed() ? \"Cannot update descriptors for `\" + subkey + \"` on `\" + (0, _utils.toString)(this.source) + \"` after it has been destroyed.\" : '', !this.isMetaDestroyed()));\n      var map = this._descriptors || (this._descriptors = new Map());\n      map.set(subkey, value);\n    }\n\n    peekDescriptors(subkey) {\n      var possibleDesc = this._findInheritedMap('_descriptors', subkey);\n\n      return possibleDesc === UNDEFINED ? undefined : possibleDesc;\n    }\n\n    removeDescriptors(subkey) {\n      this.writeDescriptors(subkey, UNDEFINED);\n    }\n\n    forEachDescriptors(fn) {\n      var pointer = this;\n      var seen;\n\n      while (pointer !== null) {\n        var map = pointer._descriptors;\n\n        if (map !== undefined) {\n          seen = seen === undefined ? new Set() : seen;\n          map.forEach((value, key) => {\n            if (!seen.has(key)) {\n              seen.add(key);\n\n              if (value !== UNDEFINED) {\n                fn(key, value);\n              }\n            }\n          });\n        }\n\n        pointer = pointer.parent;\n      }\n    }\n\n    addToListeners(eventName, target, method, once, sync) {\n      if (true\n      /* DEBUG */\n      ) {\n        counters.addToListenersCalls++;\n      }\n\n      this.pushListener(eventName, target, method, once ? 1\n      /* ONCE */\n      : 0\n      /* ADD */\n      , sync);\n    }\n\n    removeFromListeners(eventName, target, method) {\n      if (true\n      /* DEBUG */\n      ) {\n        counters.removeFromListenersCalls++;\n      }\n\n      this.pushListener(eventName, target, method, 2\n      /* REMOVE */\n      );\n    }\n\n    pushListener(event, target, method, kind, sync = false) {\n      var listeners = this.writableListeners();\n      var i = indexOfListener(listeners, event, target, method); // remove if found listener was inherited\n\n      if (i !== -1 && i < this._inheritedEnd) {\n        listeners.splice(i, 1);\n        this._inheritedEnd--;\n        i = -1;\n      } // if not found, push. Note that we must always push if a listener is not\n      // found, even in the case of a function listener remove, because we may be\n      // attempting to add or remove listeners _before_ flattening has occured.\n\n\n      if (i === -1) {\n        (true && !(!(this.isPrototypeMeta(this.source) && typeof method === 'function')) && (0, _debug.assert)('You cannot add function listeners to prototypes. Convert the listener to a string listener, or add it to the instance instead.', !(this.isPrototypeMeta(this.source) && typeof method === 'function')));\n        (true && !(!(!this.isPrototypeMeta(this.source) && typeof method === 'function' && kind === 2\n        /* REMOVE */\n        )) && (0, _debug.assert)('You attempted to remove a function listener which did not exist on the instance, which means you may have attempted to remove it before it was added.', !(!this.isPrototypeMeta(this.source) && typeof method === 'function' && kind === 2)));\n        listeners.push({\n          event,\n          target,\n          method,\n          kind,\n          sync\n        });\n      } else {\n        var listener = listeners[i]; // If the listener is our own listener and we are trying to remove it, we\n        // want to splice it out entirely so we don't hold onto a reference.\n\n        if (kind === 2\n        /* REMOVE */\n        && listener.kind !== 2\n        /* REMOVE */\n        ) {\n            listeners.splice(i, 1);\n          } else {\n          (true && !(!(listener.kind === 0\n          /* ADD */\n          && kind === 0\n          /* ADD */\n          && listener.sync !== sync)) && (0, _debug.assert)(\"You attempted to add an observer for the same method on '\" + event.split(':')[0] + \"' twice to \" + target + \" as both sync and async. Observers must be either sync or async, they cannot be both. This is likely a mistake, you should either remove the code that added the observer a second time, or update it to always be sync or async. The method was \" + method + \".\", !(listener.kind === 0 && kind === 0 && listener.sync !== sync))); // update own listener\n\n          listener.kind = kind;\n          listener.sync = sync;\n        }\n      }\n    }\n\n    writableListeners() {\n      // Check if we need to invalidate and reflatten. We need to do this if we\n      // have already flattened (flattened version is the current version) and\n      // we are either writing to a prototype meta OR we have never inherited, and\n      // may have cached the parent's listeners.\n      if (this._flattenedVersion === currentListenerVersion && (this.source === this.proto || this._inheritedEnd === -1)) {\n        if (true\n        /* DEBUG */\n        ) {\n          counters.reopensAfterFlatten++;\n        }\n\n        currentListenerVersion++;\n      } // Inherited end has not been set, then we have never created our own\n      // listeners, but may have cached the parent's\n\n\n      if (this._inheritedEnd === -1) {\n        this._inheritedEnd = 0;\n        this._listeners = [];\n      }\n\n      return this._listeners;\n    }\n    /**\n      Flattening is based on a global revision counter. If the revision has\n      bumped it means that somewhere in a class inheritance chain something has\n      changed, so we need to reflatten everything. This can only happen if:\n         1. A meta has been flattened (listener has been called)\n      2. The meta is a prototype meta with children who have inherited its\n         listeners\n      3. A new listener is subsequently added to the meta (e.g. via `.reopen()`)\n         This is a very rare occurence, so while the counter is global it shouldn't\n      be updated very often in practice.\n    */\n\n\n    flattenedListeners() {\n      if (true\n      /* DEBUG */\n      ) {\n        counters.flattenedListenersCalls++;\n      }\n\n      if (this._flattenedVersion < currentListenerVersion) {\n        if (true\n        /* DEBUG */\n        ) {\n          counters.listenersFlattened++;\n        }\n\n        var parent = this.parent;\n\n        if (parent !== null) {\n          // compute\n          var parentListeners = parent.flattenedListeners();\n\n          if (parentListeners !== undefined) {\n            if (this._listeners === undefined) {\n              // If this instance doesn't have any of its own listeners (writableListeners\n              // has never been called) then we don't need to do any flattening, return\n              // the parent's listeners instead.\n              if (true\n              /* DEBUG */\n              ) {\n                counters.parentListenersUsed++;\n              }\n\n              this._listeners = parentListeners;\n            } else {\n              var listeners = this._listeners;\n\n              if (this._inheritedEnd > 0) {\n                listeners.splice(0, this._inheritedEnd);\n                this._inheritedEnd = 0;\n              }\n\n              for (var i = 0; i < parentListeners.length; i++) {\n                var listener = parentListeners[i];\n                var index = indexOfListener(listeners, listener.event, listener.target, listener.method);\n\n                if (index === -1) {\n                  if (true\n                  /* DEBUG */\n                  ) {\n                    counters.listenersInherited++;\n                  }\n\n                  listeners.unshift(listener);\n                  this._inheritedEnd++;\n                }\n              }\n            }\n          }\n        }\n\n        this._flattenedVersion = currentListenerVersion;\n      }\n\n      return this._listeners;\n    }\n\n    matchingListeners(eventName) {\n      var listeners = this.flattenedListeners();\n      var result;\n\n      if (true\n      /* DEBUG */\n      ) {\n        counters.matchingListenersCalls++;\n      }\n\n      if (listeners !== undefined) {\n        for (var index = 0; index < listeners.length; index++) {\n          var listener = listeners[index]; // REMOVE listeners are placeholders that tell us not to\n          // inherit, so they never match. Only ADD and ONCE can match.\n\n          if (listener.event === eventName && (listener.kind === 0\n          /* ADD */\n          || listener.kind === 1\n          /* ONCE */\n          )) {\n            if (result === undefined) {\n              // we create this array only after we've found a listener that\n              // matches to avoid allocations when no matches are found.\n              result = [];\n            }\n\n            result.push(listener.target, listener.method, listener.kind === 1\n            /* ONCE */\n            );\n          }\n        }\n      }\n\n      return result;\n    }\n\n    observerEvents() {\n      var listeners = this.flattenedListeners();\n      var result;\n\n      if (true\n      /* DEBUG */\n      ) {\n        counters.observerEventsCalls++;\n      }\n\n      if (listeners !== undefined) {\n        for (var index = 0; index < listeners.length; index++) {\n          var listener = listeners[index]; // REMOVE listeners are placeholders that tell us not to\n          // inherit, so they never match. Only ADD and ONCE can match.\n\n          if ((listener.kind === 0\n          /* ADD */\n          || listener.kind === 1\n          /* ONCE */\n          ) && listener.event.indexOf(':change') !== -1) {\n            if (result === undefined) {\n              // we create this array only after we've found a listener that\n              // matches to avoid allocations when no matches are found.\n              result = [];\n            }\n\n            result.push(listener);\n          }\n        }\n      }\n\n      return result;\n    }\n\n  }\n\n  _exports.Meta = Meta;\n\n  if (true\n  /* DEBUG */\n  ) {\n    Meta.prototype.writeValues = function (subkey, value) {\n      (true && !(!this.isMetaDestroyed()) && (0, _debug.assert)(this.isMetaDestroyed() ? \"Cannot set the value of `\" + subkey + \"` on `\" + (0, _utils.toString)(this.source) + \"` after it has been destroyed.\" : '', !this.isMetaDestroyed()));\n\n      var map = this._getOrCreateOwnMap('_values');\n\n      map[subkey] = value === undefined ? UNDEFINED : value;\n    };\n\n    Meta.prototype.peekValues = function (key) {\n      var val = this._findInherited2('_values', key);\n\n      return val === UNDEFINED ? undefined : val;\n    };\n\n    Meta.prototype.deleteFromValues = function (key) {\n      delete this._getOrCreateOwnMap('_values')[key];\n    };\n\n    Meta.prototype.readInheritedValue = function (key) {\n      return this._findInherited2('_values', key);\n    };\n\n    Meta.prototype.writeValue = function (obj, key, value) {\n      var descriptor = (0, _utils.lookupDescriptor)(obj, key);\n      var isMandatorySetter = descriptor !== null && descriptor.set && descriptor.set.isMandatorySetter;\n\n      if (isMandatorySetter) {\n        this.writeValues(key, value);\n      } else {\n        obj[key] = value;\n      }\n    };\n  }\n\n  var getPrototypeOf = Object.getPrototypeOf;\n  var metaStore = new WeakMap();\n\n  function setMeta(obj, meta) {\n    (true && !(obj !== null) && (0, _debug.assert)('Cannot call `setMeta` on null', obj !== null));\n    (true && !(obj !== undefined) && (0, _debug.assert)('Cannot call `setMeta` on undefined', obj !== undefined));\n    (true && !(typeof obj === 'object' || typeof obj === 'function') && (0, _debug.assert)(\"Cannot call `setMeta` on \" + typeof obj, typeof obj === 'object' || typeof obj === 'function'));\n\n    if (true\n    /* DEBUG */\n    ) {\n      counters.setCalls++;\n    }\n\n    metaStore.set(obj, meta);\n  }\n\n  function peekMeta(obj) {\n    (true && !(obj !== null) && (0, _debug.assert)('Cannot call `peekMeta` on null', obj !== null));\n    (true && !(obj !== undefined) && (0, _debug.assert)('Cannot call `peekMeta` on undefined', obj !== undefined));\n    (true && !(typeof obj === 'object' || typeof obj === 'function') && (0, _debug.assert)(\"Cannot call `peekMeta` on \" + typeof obj, typeof obj === 'object' || typeof obj === 'function'));\n\n    if (true\n    /* DEBUG */\n    ) {\n      counters.peekCalls++;\n    }\n\n    var meta = metaStore.get(obj);\n\n    if (meta !== undefined) {\n      return meta;\n    }\n\n    var pointer = getPrototypeOf(obj);\n\n    while (pointer !== null) {\n      if (true\n      /* DEBUG */\n      ) {\n        counters.peekPrototypeWalks++;\n      }\n\n      meta = metaStore.get(pointer);\n\n      if (meta !== undefined) {\n        if (meta.proto !== pointer) {\n          // The meta was a prototype meta which was not marked as initializing.\n          // This can happen when a prototype chain was created manually via\n          // Object.create() and the source object does not have a constructor.\n          meta.proto = pointer;\n        }\n\n        return meta;\n      }\n\n      pointer = getPrototypeOf(pointer);\n    }\n\n    return null;\n  }\n  /**\n    Tears down the meta on an object so that it can be garbage collected.\n    Multiple calls will have no effect.\n  \n    @method deleteMeta\n    @for Ember\n    @param {Object} obj  the object to destroy\n    @return {void}\n    @private\n  */\n\n\n  function deleteMeta(obj) {\n    (true && !(obj !== null) && (0, _debug.assert)('Cannot call `deleteMeta` on null', obj !== null));\n    (true && !(obj !== undefined) && (0, _debug.assert)('Cannot call `deleteMeta` on undefined', obj !== undefined));\n    (true && !(typeof obj === 'object' || typeof obj === 'function') && (0, _debug.assert)(\"Cannot call `deleteMeta` on \" + typeof obj, typeof obj === 'object' || typeof obj === 'function'));\n\n    if (true\n    /* DEBUG */\n    ) {\n      counters.deleteCalls++;\n    }\n\n    var meta = peekMeta(obj);\n\n    if (meta !== null) {\n      meta.destroy();\n    }\n  }\n  /**\n    Retrieves the meta hash for an object. If `writable` is true ensures the\n    hash is writable for this object as well.\n  \n    The meta object contains information about computed property descriptors as\n    well as any watched properties and other information. You generally will\n    not access this information directly but instead work with higher level\n    methods that manipulate this hash indirectly.\n  \n    @method meta\n    @for Ember\n    @private\n  \n    @param {Object} obj The object to retrieve meta for\n    @param {Boolean} [writable=true] Pass `false` if you do not intend to modify\n      the meta hash, allowing the method to avoid making an unnecessary copy.\n    @return {Object} the meta hash for an object\n  */\n\n\n  var meta = function meta(obj) {\n    (true && !(obj !== null) && (0, _debug.assert)('Cannot call `meta` on null', obj !== null));\n    (true && !(obj !== undefined) && (0, _debug.assert)('Cannot call `meta` on undefined', obj !== undefined));\n    (true && !(typeof obj === 'object' || typeof obj === 'function') && (0, _debug.assert)(\"Cannot call `meta` on \" + typeof obj, typeof obj === 'object' || typeof obj === 'function'));\n\n    if (true\n    /* DEBUG */\n    ) {\n      counters.metaCalls++;\n    }\n\n    var maybeMeta = peekMeta(obj); // remove this code, in-favor of explicit parent\n\n    if (maybeMeta !== null && maybeMeta.source === obj) {\n      return maybeMeta;\n    }\n\n    var newMeta = new Meta(obj);\n    setMeta(obj, newMeta);\n    return newMeta;\n  };\n\n  _exports.meta = meta;\n\n  if (true\n  /* DEBUG */\n  ) {\n    meta._counters = counters;\n  }\n\n  function indexOfListener(listeners, event, target, method) {\n    for (var i = listeners.length - 1; i >= 0; i--) {\n      var listener = listeners[i];\n\n      if (listener.event === event && listener.target === target && listener.method === method) {\n        return i;\n      }\n    }\n\n    return -1;\n  }\n});","define(\"@ember/-internals/metal/index\", [\"exports\", \"@ember/polyfills\", \"@ember/-internals/meta\", \"@ember/-internals/utils\", \"@ember/debug\", \"@glimmer/reference\", \"@ember/runloop\", \"@ember/-internals/environment\", \"@ember/error\", \"ember/version\", \"@ember/deprecated-features\", \"@ember/-internals/owner\"], function (_exports, _polyfills, _meta2, _utils, _debug, _reference, _runloop, _environment, _error, _version, _deprecatedFeatures, _owner) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.computed = computed;\n  _exports.isComputed = isComputed;\n  _exports.getCacheFor = getCacheFor;\n  _exports.getCachedValueFor = getCachedValueFor;\n  _exports.peekCacheFor = peekCacheFor;\n  _exports.alias = alias;\n  _exports.deprecateProperty = deprecateProperty;\n  _exports._getPath = _getPath;\n  _exports.get = get;\n  _exports.getWithDefault = getWithDefault;\n  _exports.set = set;\n  _exports.trySet = trySet;\n  _exports.objectAt = objectAt;\n  _exports.replace = replace;\n  _exports.replaceInNativeArray = replaceInNativeArray;\n  _exports.addArrayObserver = addArrayObserver;\n  _exports.removeArrayObserver = removeArrayObserver;\n  _exports.arrayContentWillChange = arrayContentWillChange;\n  _exports.arrayContentDidChange = arrayContentDidChange;\n  _exports.eachProxyFor = eachProxyFor;\n  _exports.eachProxyArrayWillChange = eachProxyArrayWillChange;\n  _exports.eachProxyArrayDidChange = eachProxyArrayDidChange;\n  _exports.addListener = addListener;\n  _exports.hasListeners = hasListeners;\n  _exports.on = on;\n  _exports.removeListener = removeListener;\n  _exports.sendEvent = sendEvent;\n  _exports.isNone = isNone;\n  _exports.isEmpty = isEmpty;\n  _exports.isBlank = isBlank;\n  _exports.isPresent = isPresent;\n  _exports.beginPropertyChanges = beginPropertyChanges;\n  _exports.changeProperties = changeProperties;\n  _exports.endPropertyChanges = endPropertyChanges;\n  _exports.notifyPropertyChange = notifyPropertyChange;\n  _exports.overrideChains = overrideChains;\n  _exports.defineProperty = defineProperty;\n  _exports.isElementDescriptor = isElementDescriptor;\n  _exports.nativeDescDecorator = nativeDescDecorator;\n  _exports.descriptorForDecorator = descriptorForDecorator;\n  _exports.descriptorForProperty = descriptorForProperty;\n  _exports.isClassicDecorator = isClassicDecorator;\n  _exports.setClassicDecorator = setClassicDecorator;\n  _exports.watchKey = watchKey;\n  _exports.unwatchKey = unwatchKey;\n  _exports.finishChains = finishChains;\n  _exports.removeChainWatcher = removeChainWatcher;\n  _exports.getChainTagsForKey = getChainTagsForKey;\n  _exports.watchPath = watchPath;\n  _exports.unwatchPath = unwatchPath;\n  _exports.isWatching = isWatching;\n  _exports.unwatch = unwatch;\n  _exports.watch = watch;\n  _exports.watcherCount = watcherCount;\n  _exports.getProperties = getProperties;\n  _exports.setProperties = setProperties;\n  _exports.expandProperties = expandProperties;\n  _exports.addObserver = addObserver;\n  _exports.activateObserver = activateObserver;\n  _exports.removeObserver = removeObserver;\n  _exports.flushAsyncObservers = flushAsyncObservers;\n  _exports.mixin = mixin;\n  _exports.observer = observer;\n  _exports.applyMixin = applyMixin;\n  _exports.inject = inject;\n  _exports.tagForProperty = tagForProperty;\n  _exports.tagFor = tagFor;\n  _exports.markObjectAsDirty = markObjectAsDirty;\n  _exports.consume = consume;\n  _exports.tracked = tracked;\n  _exports.track = track;\n  _exports.untrack = untrack;\n  _exports.isTracking = isTracking;\n  _exports.addNamespace = addNamespace;\n  _exports.classToString = classToString;\n  _exports.findNamespace = findNamespace;\n  _exports.findNamespaces = findNamespaces;\n  _exports.processNamespace = processNamespace;\n  _exports.processAllNamespaces = processAllNamespaces;\n  _exports.removeNamespace = removeNamespace;\n  _exports.isNamespaceSearchDisabled = isSearchDisabled;\n  _exports.setNamespaceSearchDisabled = setSearchDisabled;\n  _exports.NAMESPACES_BY_ID = _exports.NAMESPACES = _exports.deprecateMutationsInAutotrackingTransaction = _exports.runInAutotrackingTransaction = _exports.Tracker = _exports.UNKNOWN_PROPERTY_TAG = _exports.DEBUG_INJECTION_FUNCTIONS = _exports.aliasMethod = _exports.Mixin = _exports.Libraries = _exports.libraries = _exports.ARGS_PROXY_TAGS = _exports.ChainNode = _exports.PROPERTY_DID_CHANGE = _exports.PROXY_CONTENT = _exports.ComputedProperty = _exports._globalsComputed = void 0;\n  var COMPUTED_PROPERTY_CACHED_VALUES = new WeakMap();\n  var COMPUTED_PROPERTY_LAST_REVISION = new WeakMap();\n\n  function getCacheFor(obj) {\n    var cache = COMPUTED_PROPERTY_CACHED_VALUES.get(obj);\n\n    if (cache === undefined) {\n      cache = new Map();\n      COMPUTED_PROPERTY_CACHED_VALUES.set(obj, cache);\n    }\n\n    return cache;\n  }\n  /**\n    Returns the cached value for a property, if one exists.\n    This can be useful for peeking at the value of a computed\n    property that is generated lazily, without accidentally causing\n    it to be created.\n  \n    @method cacheFor\n    @static\n    @for @ember/object/internals\n    @param {Object} obj the object whose property you want to check\n    @param {String} key the name of the property whose cached value you want\n      to return\n    @return {Object} the cached value\n    @public\n  */\n\n\n  function getCachedValueFor(obj, key) {\n    var cache = COMPUTED_PROPERTY_CACHED_VALUES.get(obj);\n\n    if (cache !== undefined) {\n      return cache.get(key);\n    }\n  }\n\n  var setLastRevisionFor;\n  var getLastRevisionFor;\n  {\n    setLastRevisionFor = (obj, key, revision) => {\n      var cache = COMPUTED_PROPERTY_LAST_REVISION.get(obj);\n\n      if (cache === undefined) {\n        cache = new Map();\n        COMPUTED_PROPERTY_LAST_REVISION.set(obj, cache);\n      }\n\n      cache.set(key, revision);\n    };\n\n    getLastRevisionFor = (obj, key) => {\n      var cache = COMPUTED_PROPERTY_LAST_REVISION.get(obj);\n\n      if (cache === undefined) {\n        return 0;\n      } else {\n        var revision = cache.get(key);\n        return revision === undefined ? 0 : revision;\n      }\n    };\n  }\n\n  function peekCacheFor(obj) {\n    return COMPUTED_PROPERTY_CACHED_VALUES.get(obj);\n  }\n\n  var EACH_PROXIES = new WeakMap();\n\n  function eachProxyArrayWillChange(array, idx, removedCnt, addedCnt) {\n    var eachProxy = EACH_PROXIES.get(array);\n\n    if (eachProxy !== undefined) {\n      eachProxy.arrayWillChange(array, idx, removedCnt, addedCnt);\n    }\n  }\n\n  function eachProxyArrayDidChange(array, idx, removedCnt, addedCnt) {\n    var eachProxy = EACH_PROXIES.get(array);\n\n    if (eachProxy !== undefined) {\n      eachProxy.arrayDidChange(array, idx, removedCnt, addedCnt);\n    }\n  }\n  /**\n  @module @ember/object\n  */\n\n  /*\n    The event system uses a series of nested hashes to store listeners on an\n    object. When a listener is registered, or when an event arrives, these\n    hashes are consulted to determine which target and action pair to invoke.\n  \n    The hashes are stored in the object's meta hash, and look like this:\n  \n        // Object's meta hash\n        {\n          listeners: {       // variable name: `listenerSet`\n            \"foo:change\": [ // variable name: `actions`\n              target, method, once\n            ]\n          }\n        }\n  \n  */\n\n  /**\n    Add an event listener\n  \n    @method addListener\n    @static\n    @for @ember/object/events\n    @param obj\n    @param {String} eventName\n    @param {Object|Function} target A target object or a function\n    @param {Function|String} method A function or the name of a function to be called on `target`\n    @param {Boolean} once A flag whether a function should only be called once\n    @public\n  */\n\n\n  function addListener(obj, eventName, target, method, once, sync = true) {\n    (true && !(Boolean(obj) && Boolean(eventName)) && (0, _debug.assert)('You must pass at least an object and event name to addListener', Boolean(obj) && Boolean(eventName)));\n\n    if (!method && 'function' === typeof target) {\n      method = target;\n      target = null;\n    }\n\n    (0, _meta2.meta)(obj).addToListeners(eventName, target, method, once === true, sync);\n  }\n  /**\n    Remove an event listener\n  \n    Arguments should match those passed to `addListener`.\n  \n    @method removeListener\n    @static\n    @for @ember/object/events\n    @param obj\n    @param {String} eventName\n    @param {Object|Function} target A target object or a function\n    @param {Function|String} method A function or the name of a function to be called on `target`\n    @public\n  */\n\n\n  function removeListener(obj, eventName, targetOrFunction, functionOrName) {\n    (true && !(Boolean(obj) && Boolean(eventName) && (typeof targetOrFunction === 'function' || typeof targetOrFunction === 'object' && Boolean(functionOrName))) && (0, _debug.assert)('You must pass at least an object, event name, and method or target and method/method name to removeListener', Boolean(obj) && Boolean(eventName) && (typeof targetOrFunction === 'function' || typeof targetOrFunction === 'object' && Boolean(functionOrName))));\n    var target, method;\n\n    if (typeof targetOrFunction === 'object') {\n      target = targetOrFunction;\n      method = functionOrName;\n    } else {\n      target = null;\n      method = targetOrFunction;\n    }\n\n    var m = (0, _meta2.meta)(obj);\n    m.removeFromListeners(eventName, target, method);\n  }\n  /**\n    Send an event. The execution of suspended listeners\n    is skipped, and once listeners are removed. A listener without\n    a target is executed on the passed object. If an array of actions\n    is not passed, the actions stored on the passed object are invoked.\n  \n    @method sendEvent\n    @static\n    @for @ember/object/events\n    @param obj\n    @param {String} eventName\n    @param {Array} params Optional parameters for each listener.\n    @return {Boolean} if the event was delivered to one or more actions\n    @public\n  */\n\n\n  function sendEvent(obj, eventName, params, actions, _meta) {\n    if (actions === undefined) {\n      var meta$$1 = _meta === undefined ? (0, _meta2.peekMeta)(obj) : _meta;\n      actions = typeof meta$$1 === 'object' && meta$$1 !== null ? meta$$1.matchingListeners(eventName) : undefined;\n    }\n\n    if (actions === undefined || actions.length === 0) {\n      return false;\n    }\n\n    for (var i = actions.length - 3; i >= 0; i -= 3) {\n      // looping in reverse for once listeners\n      var target = actions[i];\n      var method = actions[i + 1];\n      var once = actions[i + 2];\n\n      if (!method) {\n        continue;\n      }\n\n      if (once) {\n        removeListener(obj, eventName, target, method);\n      }\n\n      if (!target) {\n        target = obj;\n      }\n\n      if ('string' === typeof method) {\n        method = target[method];\n      }\n\n      method.apply(target, params);\n    }\n\n    return true;\n  }\n  /**\n    @private\n    @method hasListeners\n    @static\n    @for @ember/object/events\n    @param obj\n    @param {String} eventName\n    @return {Boolean} if `obj` has listeners for event `eventName`\n  */\n\n\n  function hasListeners(obj, eventName) {\n    var meta$$1 = (0, _meta2.peekMeta)(obj);\n\n    if (meta$$1 === null) {\n      return false;\n    }\n\n    var matched = meta$$1.matchingListeners(eventName);\n    return matched !== undefined && matched.length > 0;\n  }\n  /**\n    Define a property as a function that should be executed when\n    a specified event or events are triggered.\n  \n    ``` javascript\n    import EmberObject from '@ember/object';\n    import { on } from '@ember/object/evented';\n    import { sendEvent } from '@ember/object/events';\n  \n    let Job = EmberObject.extend({\n      logCompleted: on('completed', function() {\n        console.log('Job completed!');\n      })\n    });\n  \n    let job = Job.create();\n  \n    sendEvent(job, 'completed'); // Logs 'Job completed!'\n   ```\n  \n    @method on\n    @static\n    @for @ember/object/evented\n    @param {String} eventNames*\n    @param {Function} func\n    @return {Function} the listener function, passed as last argument to on(...)\n    @public\n  */\n\n\n  function on(...args) {\n    var func = args.pop();\n    var events = args;\n    (true && !(typeof func === 'function') && (0, _debug.assert)('on expects function as last argument', typeof func === 'function'));\n    (true && !(events.length > 0 && events.every(p => typeof p === 'string' && p.length > 0)) && (0, _debug.assert)('on called without valid event names', events.length > 0 && events.every(p => typeof p === 'string' && p.length > 0)));\n    (0, _utils.setListeners)(func, events);\n    return func;\n  }\n\n  var AFTER_OBSERVERS = ':change';\n\n  function changeEvent(keyName) {\n    return keyName + AFTER_OBSERVERS;\n  }\n\n  var DECORATOR_DESCRIPTOR_MAP = new WeakMap();\n  /**\n    Returns the CP descriptor assocaited with `obj` and `keyName`, if any.\n  \n    @method descriptorForProperty\n    @param {Object} obj the object to check\n    @param {String} keyName the key to check\n    @return {Descriptor}\n    @private\n  */\n\n  function descriptorForProperty(obj, keyName, _meta) {\n    (true && !(obj !== null) && (0, _debug.assert)('Cannot call `descriptorForProperty` on null', obj !== null));\n    (true && !(obj !== undefined) && (0, _debug.assert)('Cannot call `descriptorForProperty` on undefined', obj !== undefined));\n    (true && !(typeof obj === 'object' || typeof obj === 'function') && (0, _debug.assert)(\"Cannot call `descriptorForProperty` on \" + typeof obj, typeof obj === 'object' || typeof obj === 'function'));\n    var meta$$1 = _meta === undefined ? (0, _meta2.peekMeta)(obj) : _meta;\n\n    if (meta$$1 !== null) {\n      return meta$$1.peekDescriptors(keyName);\n    }\n  }\n\n  function descriptorForDecorator(dec) {\n    return DECORATOR_DESCRIPTOR_MAP.get(dec);\n  }\n  /**\n    Check whether a value is a decorator\n  \n    @method isClassicDecorator\n    @param {any} possibleDesc the value to check\n    @return {boolean}\n    @private\n  */\n\n\n  function isClassicDecorator(dec) {\n    return dec !== null && dec !== undefined && DECORATOR_DESCRIPTOR_MAP.has(dec);\n  }\n  /**\n    Set a value as a decorator\n  \n    @method setClassicDecorator\n    @param {function} decorator the value to mark as a decorator\n    @private\n  */\n\n\n  function setClassicDecorator(dec, value$$1 = true) {\n    DECORATOR_DESCRIPTOR_MAP.set(dec, value$$1);\n  }\n\n  var firstDotIndexCache = new _utils.Cache(1000, key => key.indexOf('.'));\n\n  function isPath(path) {\n    return typeof path === 'string' && firstDotIndexCache.get(path) !== -1;\n  }\n  /**\n  @module @ember/object\n  */\n  // DEFINING PROPERTIES API\n  //\n\n\n  function MANDATORY_SETTER_FUNCTION(name) {\n    function SETTER_FUNCTION(value$$1) {\n      var m = (0, _meta2.peekMeta)(this);\n\n      if (m.isInitializing() || m.isPrototypeMeta(this)) {\n        m.writeValues(name, value$$1);\n      } else {\n        (true && !(false) && (0, _debug.assert)(\"You must use set() to set the `\" + name + \"` property (of \" + this + \") to `\" + value$$1 + \"`.\", false));\n      }\n    }\n\n    return (0, _polyfills.assign)(SETTER_FUNCTION, {\n      isMandatorySetter: true\n    });\n  }\n\n  function DEFAULT_GETTER_FUNCTION(name) {\n    return function GETTER_FUNCTION() {\n      var meta$$1 = (0, _meta2.peekMeta)(this);\n\n      if (meta$$1 !== null) {\n        return meta$$1.peekValues(name);\n      }\n    };\n  }\n\n  function INHERITING_GETTER_FUNCTION(name) {\n    function IGETTER_FUNCTION() {\n      var meta$$1 = (0, _meta2.peekMeta)(this);\n      var val;\n\n      if (meta$$1 !== null) {\n        val = meta$$1.readInheritedValue(name);\n\n        if (val === undefined) {\n          var proto = Object.getPrototypeOf(this);\n          val = proto === null ? undefined : proto[name];\n        } else {\n          val = val === _meta2.UNDEFINED ? undefined : val;\n        }\n      }\n\n      return val;\n    }\n\n    return (0, _polyfills.assign)(IGETTER_FUNCTION, {\n      isInheritingGetter: true\n    });\n  }\n  /**\n    NOTE: This is a low-level method used by other parts of the API. You almost\n    never want to call this method directly. Instead you should use\n    `mixin()` to define new properties.\n  \n    Defines a property on an object. This method works much like the ES5\n    `Object.defineProperty()` method except that it can also accept computed\n    properties and other special descriptors.\n  \n    Normally this method takes only three parameters. However if you pass an\n    instance of `Descriptor` as the third param then you can pass an\n    optional value as the fourth parameter. This is often more efficient than\n    creating new descriptor hashes for each property.\n  \n    ## Examples\n  \n    ```javascript\n    import { defineProperty, computed } from '@ember/object';\n  \n    // ES5 compatible mode\n    defineProperty(contact, 'firstName', {\n      writable: true,\n      configurable: false,\n      enumerable: true,\n      value: 'Charles'\n    });\n  \n    // define a simple property\n    defineProperty(contact, 'lastName', undefined, 'Jolley');\n  \n    // define a computed property\n    defineProperty(contact, 'fullName', computed('firstName', 'lastName', function() {\n      return this.firstName+' '+this.lastName;\n    }));\n    ```\n  \n    @public\n    @method defineProperty\n    @static\n    @for @ember/object\n    @param {Object} obj the object to define this property on. This may be a prototype.\n    @param {String} keyName the name of the property\n    @param {Descriptor} [desc] an instance of `Descriptor` (typically a\n      computed property) or an ES5 descriptor.\n      You must provide this or `data` but not both.\n    @param {*} [data] something other than a descriptor, that will\n      become the explicit value of this property.\n  */\n\n\n  function defineProperty(obj, keyName, desc, data, meta$$1) {\n    if (meta$$1 === undefined) {\n      meta$$1 = (0, _meta2.meta)(obj);\n    }\n\n    var watching = meta$$1.peekWatching(keyName) > 0;\n    var previousDesc = descriptorForProperty(obj, keyName, meta$$1);\n    var wasDescriptor = previousDesc !== undefined;\n\n    if (wasDescriptor) {\n      previousDesc.teardown(obj, keyName, meta$$1);\n    } // used to track if the the property being defined be enumerable\n\n\n    var enumerable = true; // Ember.NativeArray is a normal Ember.Mixin that we mix into `Array.prototype` when prototype extensions are enabled\n    // mutating a native object prototype like this should _not_ result in enumerable properties being added (or we have significant\n    // issues with things like deep equality checks from test frameworks, or things like jQuery.extend(true, [], [])).\n    //\n    // this is a hack, and we should stop mutating the array prototype by default 😫\n\n    if (obj === Array.prototype) {\n      enumerable = false;\n    }\n\n    var value$$1;\n\n    if (isClassicDecorator(desc)) {\n      var propertyDesc;\n\n      if (true\n      /* DEBUG */\n      ) {\n        propertyDesc = desc(obj, keyName, undefined, meta$$1, true);\n      } else {\n        propertyDesc = desc(obj, keyName, undefined, meta$$1);\n      }\n\n      Object.defineProperty(obj, keyName, propertyDesc); // pass the decorator function forward for backwards compat\n\n      value$$1 = desc;\n    } else if (desc === undefined || desc === null) {\n      value$$1 = data;\n\n      if (true\n      /* DEBUG */\n      && watching) {\n        meta$$1.writeValues(keyName, data);\n        var defaultDescriptor = {\n          configurable: true,\n          enumerable,\n          set: MANDATORY_SETTER_FUNCTION(keyName),\n          get: DEFAULT_GETTER_FUNCTION(keyName)\n        };\n        Object.defineProperty(obj, keyName, defaultDescriptor);\n      } else if (wasDescriptor || enumerable === false) {\n        Object.defineProperty(obj, keyName, {\n          configurable: true,\n          enumerable,\n          writable: true,\n          value: value$$1\n        });\n      } else {\n        if (true\n        /* EMBER_METAL_TRACKED_PROPERTIES */\n        && true\n        /* DEBUG */\n        ) {\n          (0, _utils.setWithMandatorySetter)(obj, keyName, data);\n        } else {\n          obj[keyName] = data;\n        }\n      }\n    } else {\n      value$$1 = desc; // fallback to ES5\n\n      Object.defineProperty(obj, keyName, desc);\n    } // if key is being watched, override chains that\n    // were initialized with the prototype\n\n\n    {\n      if (!meta$$1.isPrototypeMeta(obj)) {\n        revalidateObservers(obj);\n      }\n    } // The `value` passed to the `didDefineProperty` hook is\n    // either the descriptor or data, whichever was passed.\n\n    if (typeof obj.didDefineProperty === 'function') {\n      obj.didDefineProperty(obj, keyName, value$$1);\n    }\n  }\n\n  var handleMandatorySetter;\n\n  function watchKey(obj, keyName, _meta) {\n    var meta$$1 = _meta === undefined ? (0, _meta2.meta)(obj) : _meta;\n    var count = meta$$1.peekWatching(keyName);\n    meta$$1.writeWatching(keyName, count + 1);\n\n    if (count === 0) {\n      // activate watching first time\n      var possibleDesc = descriptorForProperty(obj, keyName, meta$$1);\n\n      if (possibleDesc !== undefined && possibleDesc.willWatch !== undefined) {\n        possibleDesc.willWatch(obj, keyName, meta$$1);\n      }\n\n      if (true\n      /* DEBUG */\n      ) {\n        // NOTE: this is dropped for prod + minified builds\n        handleMandatorySetter(meta$$1, obj, keyName);\n      }\n    }\n  }\n\n  if (true\n  /* DEBUG */\n  ) {\n    var _hasOwnProperty = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key);\n\n    var _propertyIsEnumerable = (obj, key) => Object.prototype.propertyIsEnumerable.call(obj, key); // Future traveler, although this code looks scary. It merely exists in\n    // development to aid in development asertions. Production builds of\n    // ember strip this entire block out\n\n\n    handleMandatorySetter = function handleMandatorySetter(m, obj, keyName) {\n      var descriptor = (0, _utils.lookupDescriptor)(obj, keyName);\n      var hasDescriptor = descriptor !== null;\n      var possibleDesc = hasDescriptor && descriptor.value;\n\n      if (isClassicDecorator(possibleDesc)) {\n        return;\n      }\n\n      var configurable = hasDescriptor ? descriptor.configurable : true;\n      var isWritable = hasDescriptor ? descriptor.writable : true;\n      var hasValue = hasDescriptor ? 'value' in descriptor : true; // this x in Y deopts, so keeping it in this function is better;\n\n      if (configurable && isWritable && hasValue && keyName in obj) {\n        var desc = {\n          configurable: true,\n          set: MANDATORY_SETTER_FUNCTION(keyName),\n          enumerable: _propertyIsEnumerable(obj, keyName),\n          get: undefined\n        };\n\n        if (_hasOwnProperty(obj, keyName)) {\n          m.writeValues(keyName, obj[keyName]);\n          desc.get = DEFAULT_GETTER_FUNCTION(keyName);\n        } else {\n          desc.get = INHERITING_GETTER_FUNCTION(keyName);\n        }\n\n        Object.defineProperty(obj, keyName, desc);\n      }\n    };\n  }\n\n  function unwatchKey(obj, keyName, _meta) {\n    var meta$$1 = _meta === undefined ? (0, _meta2.peekMeta)(obj) : _meta; // do nothing of this object has already been destroyed\n\n    if (meta$$1 === null || meta$$1.isSourceDestroyed()) {\n      return;\n    }\n\n    var count = meta$$1.peekWatching(keyName);\n\n    if (count === 1) {\n      meta$$1.writeWatching(keyName, 0);\n      var possibleDesc = descriptorForProperty(obj, keyName, meta$$1);\n      var isDescriptor = possibleDesc !== undefined;\n\n      if (isDescriptor && possibleDesc.didUnwatch !== undefined) {\n        possibleDesc.didUnwatch(obj, keyName, meta$$1);\n      }\n\n      if (typeof obj.didUnwatchProperty === 'function') {\n        obj.didUnwatchProperty(keyName);\n      }\n\n      if (true\n      /* DEBUG */\n      ) {\n        // It is true, the following code looks quite WAT. But have no fear, It\n        // exists purely to improve development ergonomics and is removed from\n        // ember.min.js and ember.prod.js builds.\n        //\n        // Some further context: Once a property is watched by ember, bypassing `set`\n        // for mutation, will bypass observation. This code exists to assert when\n        // that occurs, and attempt to provide more helpful feedback. The alternative\n        // is tricky to debug partially observable properties.\n        if (!isDescriptor && keyName in obj) {\n          var maybeMandatoryDescriptor = (0, _utils.lookupDescriptor)(obj, keyName);\n\n          if (maybeMandatoryDescriptor && maybeMandatoryDescriptor.set && maybeMandatoryDescriptor.set.isMandatorySetter) {\n            if (maybeMandatoryDescriptor.get && maybeMandatoryDescriptor.get.isInheritingGetter) {\n              var possibleValue = meta$$1.readInheritedValue(keyName);\n\n              if (possibleValue === undefined) {\n                delete obj[keyName];\n                return;\n              }\n            }\n\n            Object.defineProperty(obj, keyName, {\n              configurable: true,\n              enumerable: Object.prototype.propertyIsEnumerable.call(obj, keyName),\n              writable: true,\n              value: meta$$1.peekValues(keyName)\n            });\n            meta$$1.deleteFromValues(keyName);\n          }\n        }\n      }\n    } else if (count > 1) {\n      meta$$1.writeWatching(keyName, count - 1);\n    }\n  }\n\n  function eachProxyFor(array) {\n    var eachProxy = EACH_PROXIES.get(array);\n\n    if (eachProxy === undefined) {\n      eachProxy = new EachProxy(array);\n      EACH_PROXIES.set(array, eachProxy);\n    }\n\n    return eachProxy;\n  }\n\n  class EachProxy {\n    constructor(content) {\n      this._content = content;\n      this._keys = undefined;\n      (0, _meta2.meta)(this);\n    } // ..........................................................\n    // ARRAY CHANGES\n    // Invokes whenever the content array itself changes.\n\n\n    arrayWillChange(content, idx, removedCnt\n    /*, addedCnt */\n    ) {\n      // eslint-disable-line no-unused-vars\n      var keys = this._keys;\n\n      if (!keys) {\n        return;\n      }\n\n      var lim = removedCnt > 0 ? idx + removedCnt : -1;\n\n      if (lim > 0) {\n        for (var key in keys) {\n          removeObserverForContentKey(content, key, this, idx, lim);\n        }\n      }\n    }\n\n    arrayDidChange(content, idx, _removedCnt, addedCnt) {\n      var keys = this._keys;\n\n      if (!keys) {\n        return;\n      }\n\n      var lim = addedCnt > 0 ? idx + addedCnt : -1;\n      var meta$$1 = (0, _meta2.peekMeta)(this);\n\n      for (var key in keys) {\n        if (lim > 0) {\n          addObserverForContentKey(content, key, this, idx, lim);\n        }\n\n        notifyPropertyChange(this, key, meta$$1);\n      }\n    } // ..........................................................\n    // LISTEN FOR NEW OBSERVERS AND OTHER EVENT LISTENERS\n    // Start monitoring keys based on who is listening...\n\n\n    willWatchProperty(property) {\n      this.beginObservingContentKey(property);\n    }\n\n    didUnwatchProperty(property) {\n      this.stopObservingContentKey(property);\n    } // ..........................................................\n    // CONTENT KEY OBSERVING\n    // Actual watch keys on the source content.\n\n\n    beginObservingContentKey(keyName) {\n      var keys = this._keys;\n\n      if (keys === undefined) {\n        keys = this._keys = Object.create(null);\n      }\n\n      if (!keys[keyName]) {\n        keys[keyName] = 1;\n        var content = this._content;\n        var len = content.length;\n        addObserverForContentKey(content, keyName, this, 0, len);\n      } else {\n        keys[keyName]++;\n      }\n    }\n\n    stopObservingContentKey(keyName) {\n      var keys = this._keys;\n\n      if (keys !== undefined && keys[keyName] > 0 && --keys[keyName] <= 0) {\n        var content = this._content;\n        var len = content.length;\n        removeObserverForContentKey(content, keyName, this, 0, len);\n      }\n    }\n\n    contentKeyDidChange(_obj, keyName) {\n      notifyPropertyChange(this, keyName);\n    }\n\n  }\n\n  function addObserverForContentKey(content, keyName, proxy, idx, loc) {\n    while (--loc >= idx) {\n      var item = objectAt(content, loc);\n\n      if (item) {\n        (true && !(typeof item === 'object') && (0, _debug.assert)(\"When using @each to observe the array `\" + content.toString() + \"`, the array must return an object\", typeof item === 'object'));\n        addObserver(item, keyName, proxy, 'contentKeyDidChange');\n      }\n    }\n  }\n\n  function removeObserverForContentKey(content, keyName, proxy, idx, loc) {\n    while (--loc >= idx) {\n      var item = objectAt(content, loc);\n\n      if (item) {\n        removeObserver(item, keyName, proxy, 'contentKeyDidChange');\n      }\n    }\n  }\n\n  function isElementDescriptor(args) {\n    var [maybeTarget, maybeKey, maybeDesc] = args;\n    return (// Ensure we have the right number of args\n      args.length === 3 && ( // Make sure the target is a class or object (prototype)\n      typeof maybeTarget === 'function' || typeof maybeTarget === 'object' && maybeTarget !== null) && // Make sure the key is a string\n      typeof maybeKey === 'string' && ( // Make sure the descriptor is the right shape\n      typeof maybeDesc === 'object' && maybeDesc !== null && 'enumerable' in maybeDesc && 'configurable' in maybeDesc || // TS compatibility\n      maybeDesc === undefined)\n    );\n  } // ..........................................................\n  // DEPENDENT KEYS\n  //\n\n\n  function addDependentKeys(desc, obj, keyName, meta$$1) {\n    // the descriptor has a list of dependent keys, so\n    // add all of its dependent keys.\n    var depKeys = desc._dependentKeys;\n\n    if (depKeys === null || depKeys === undefined) {\n      return;\n    }\n\n    for (var idx = 0; idx < depKeys.length; idx++) {\n      var depKey = depKeys[idx]; // Increment the number of times depKey depends on keyName.\n\n      meta$$1.writeDeps(depKey, keyName, meta$$1.peekDeps(depKey, keyName) + 1); // Watch the depKey\n\n      watch(obj, depKey, meta$$1);\n    }\n  }\n\n  function removeDependentKeys(desc, obj, keyName, meta$$1) {\n    // the descriptor has a list of dependent keys, so\n    // remove all of its dependent keys.\n    var depKeys = desc._dependentKeys;\n\n    if (depKeys === null || depKeys === undefined) {\n      return;\n    }\n\n    for (var idx = 0; idx < depKeys.length; idx++) {\n      var depKey = depKeys[idx]; // Decrement the number of times depKey depends on keyName.\n\n      meta$$1.writeDeps(depKey, keyName, meta$$1.peekDeps(depKey, keyName) - 1); // Unwatch the depKey\n\n      unwatch(obj, depKey, meta$$1);\n    }\n  }\n\n  function nativeDescDecorator(propertyDesc) {\n    var decorator = function () {\n      return propertyDesc;\n    };\n\n    setClassicDecorator(decorator);\n    return decorator;\n  }\n  /**\n    Objects of this type can implement an interface to respond to requests to\n    get and set. The default implementation handles simple properties.\n  \n    @class Descriptor\n    @private\n  */\n\n\n  class ComputedDescriptor {\n    constructor() {\n      this.enumerable = true;\n      this.configurable = true;\n      this._dependentKeys = undefined;\n      this._meta = undefined;\n    }\n\n    setup(_obj, keyName, _propertyDesc, meta$$1) {\n      meta$$1.writeDescriptors(keyName, this);\n    }\n\n    teardown(_obj, keyName, meta$$1) {\n      meta$$1.removeDescriptors(keyName);\n    }\n\n  }\n\n  function DESCRIPTOR_GETTER_FUNCTION(name, descriptor) {\n    return function CPGETTER_FUNCTION() {\n      return descriptor.get(this, name);\n    };\n  }\n\n  function DESCRIPTOR_SETTER_FUNCTION(name, descriptor) {\n    var func = function CPSETTER_FUNCTION(value$$1) {\n      return descriptor.set(this, name, value$$1);\n    };\n\n    CP_SETTER_FUNCS.add(func);\n    return func;\n  }\n\n  var CP_SETTER_FUNCS = new _polyfills._WeakSet();\n\n  function makeComputedDecorator(desc, DecoratorClass) {\n    var decorator = function COMPUTED_DECORATOR(target, key, propertyDesc, maybeMeta, isClassicDecorator$$1) {\n      (true && !(isClassicDecorator$$1 || !propertyDesc || !propertyDesc.get || propertyDesc.get.toString().indexOf('CPGETTER_FUNCTION') === -1) && (0, _debug.assert)(\"Only one computed property decorator can be applied to a class field or accessor, but '\" + key + \"' was decorated twice. You may have added the decorator to both a getter and setter, which is unecessary.\", isClassicDecorator$$1 || !propertyDesc || !propertyDesc.get || propertyDesc.get.toString().indexOf('CPGETTER_FUNCTION') === -1));\n      var meta$$1 = arguments.length === 3 ? (0, _meta2.meta)(target) : maybeMeta;\n      desc.setup(target, key, propertyDesc, meta$$1);\n      var computedDesc = {\n        enumerable: desc.enumerable,\n        configurable: desc.configurable,\n        get: DESCRIPTOR_GETTER_FUNCTION(key, desc)\n      };\n      {\n        computedDesc.set = DESCRIPTOR_SETTER_FUNCTION(key, desc);\n      }\n      return computedDesc;\n    };\n\n    setClassicDecorator(decorator, desc);\n    Object.setPrototypeOf(decorator, DecoratorClass.prototype);\n    return decorator;\n  }\n\n  var DEPRECATE_IN_AUTOTRACKING_TRANSACTION = false;\n  var AUTOTRACKING_TRANSACTION = null;\n  var runInAutotrackingTransaction;\n  _exports.runInAutotrackingTransaction = runInAutotrackingTransaction;\n  var deprecateMutationsInAutotrackingTransaction;\n  _exports.deprecateMutationsInAutotrackingTransaction = deprecateMutationsInAutotrackingTransaction;\n  var debuggingContexts;\n  var assertTagNotConsumed;\n  var markTagAsConsumed;\n\n  if (true\n  /* DEBUG */\n  ) {\n    /**\n     * Creates a global autotracking transaction. This will prevent any backflow\n     * in any `track` calls within the transaction, even if they are not\n     * externally consumed.\n     *\n     * `runInAutotrackingTransaction` can be called within itself, and it will add\n     * onto the existing transaction if one exists.\n     *\n     * TODO: Only throw an error if the `track` is consumed.\n     */\n    _exports.runInAutotrackingTransaction = runInAutotrackingTransaction = fn => {\n      var previousDeprecateState = DEPRECATE_IN_AUTOTRACKING_TRANSACTION;\n      var previousTransactionState = AUTOTRACKING_TRANSACTION;\n      DEPRECATE_IN_AUTOTRACKING_TRANSACTION = false;\n\n      if (previousTransactionState === null) {\n        // if there was no transaction start it. Otherwise, the transaction already exists.\n        AUTOTRACKING_TRANSACTION = new WeakMap();\n      }\n\n      try {\n        fn();\n      } finally {\n        DEPRECATE_IN_AUTOTRACKING_TRANSACTION = previousDeprecateState;\n        AUTOTRACKING_TRANSACTION = previousTransactionState;\n      }\n    };\n    /**\n     * Switches to deprecating within an autotracking transaction, if one exists.\n     * If `runInAutotrackingTransaction` is called within the callback of this\n     * method, it switches back to throwing an error, allowing zebra-striping of\n     * the types of errors that are thrown.\n     *\n     * Does not start an autotracking transaction.\n     */\n\n\n    _exports.deprecateMutationsInAutotrackingTransaction = deprecateMutationsInAutotrackingTransaction = fn => {\n      var previousDeprecateState = DEPRECATE_IN_AUTOTRACKING_TRANSACTION;\n      DEPRECATE_IN_AUTOTRACKING_TRANSACTION = true;\n\n      try {\n        fn();\n      } finally {\n        DEPRECATE_IN_AUTOTRACKING_TRANSACTION = previousDeprecateState;\n      }\n    };\n\n    var nthIndex = (str, pattern, n, startingPos = -1) => {\n      var i = startingPos;\n\n      while (n-- > 0 && i++ < str.length) {\n        i = str.indexOf(pattern, i);\n        if (i < 0) break;\n      }\n\n      return i;\n    };\n\n    var makeAutotrackingErrorMessage = (sourceData, obj, keyName) => {\n      var dirtyString = keyName ? \"`\" + keyName + \"` on `\" + (0, _utils.getDebugName)(obj) + \"`\" : \"`\" + (0, _utils.getDebugName)(obj) + \"`\";\n      var message = [\"You attempted to update \" + dirtyString + \", but it had already been used previously in the same computation.  Attempting to update a value after using it in a computation can cause logical errors, infinite revalidation bugs, and performance issues, and is not supported.\"];\n\n      if (sourceData.context) {\n        message.push(\"`\" + keyName + \"` was first used:\\n\\n\" + sourceData.context);\n      }\n\n      if (sourceData.error.stack) {\n        var sourceStack = sourceData.error.stack;\n        var thirdIndex = nthIndex(sourceStack, '\\n', 3);\n        sourceStack = sourceStack.substr(thirdIndex);\n        message.push(\"Stack trace for the first usage: \" + sourceStack);\n      }\n\n      message.push(\"Stack trace for the update:\");\n      return message.join('\\n\\n');\n    };\n\n    debuggingContexts = [];\n\n    markTagAsConsumed = (_tag, sourceError) => {\n      if (!AUTOTRACKING_TRANSACTION || AUTOTRACKING_TRANSACTION.has(_tag)) return;\n      AUTOTRACKING_TRANSACTION.set(_tag, {\n        context: debuggingContexts.map(c => c.replace(/^/gm, '  ').replace(/^ /, '-')).join('\\n\\n'),\n        error: sourceError\n      }); // We need to mark the tag and all of its subtags as consumed, so we need to\n      // cast in and access its internals. In the future this shouldn't be necessary,\n      // this is only for computed properties.e\n\n      var tag = _tag;\n\n      if (tag.subtag) {\n        markTagAsConsumed(tag.subtag, sourceError);\n      }\n\n      if (tag.subtags) {\n        tag.subtags.forEach(tag => markTagAsConsumed(tag, sourceError));\n      }\n    };\n\n    assertTagNotConsumed = (tag, obj, keyName, forceHardError = false) => {\n      if (AUTOTRACKING_TRANSACTION === null) return;\n      var sourceData = AUTOTRACKING_TRANSACTION.get(tag);\n      if (!sourceData) return;\n\n      if (DEPRECATE_IN_AUTOTRACKING_TRANSACTION && !forceHardError) {\n        (true && !(false) && (0, _debug.deprecate)(makeAutotrackingErrorMessage(sourceData, obj, keyName), false, {\n          id: 'autotracking.mutation-after-consumption',\n          until: '4.0.0'\n        }));\n      } else {\n        // This hack makes the assertion message nicer, we can cut off the first\n        // few lines of the stack trace and let users know where the actual error\n        // occurred.\n        try {\n          (true && !(false) && (0, _debug.assert)(makeAutotrackingErrorMessage(sourceData, obj, keyName), false));\n        } catch (e) {\n          if (e.stack) {\n            var updateStackBegin = e.stack.indexOf('Stack trace for the update:');\n\n            if (updateStackBegin !== -1) {\n              var start = nthIndex(e.stack, '\\n', 1, updateStackBegin);\n              var end = nthIndex(e.stack, '\\n', 4, updateStackBegin);\n              e.stack = e.stack.substr(0, start) + e.stack.substr(end);\n            }\n          }\n\n          throw e;\n        }\n      }\n    };\n  }\n  /**\n    An object that that tracks @tracked properties that were consumed.\n  \n    @private\n  */\n\n\n  class Tracker {\n    constructor() {\n      this.tags = new Set();\n      this.last = null;\n    }\n\n    add(tag) {\n      this.tags.add(tag);\n\n      if (true\n      /* DEBUG */\n      ) {\n        markTagAsConsumed(tag, new Error());\n      }\n\n      this.last = tag;\n    }\n\n    get size() {\n      return this.tags.size;\n    }\n\n    combine() {\n      if (this.tags.size === 0) {\n        return _reference.CONSTANT_TAG;\n      } else if (this.tags.size === 1) {\n        return this.last;\n      } else {\n        var tags = [];\n        this.tags.forEach(tag => tags.push(tag));\n        return (0, _reference.combine)(tags);\n      }\n    }\n\n  }\n\n  _exports.Tracker = Tracker;\n\n  function tracked(...args) {\n    (true && !(!(isElementDescriptor(args.slice(0, 3)) && args.length === 5 && args[4] === true)) && (0, _debug.assert)(\"@tracked can only be used directly as a native decorator. If you're using tracked in classic classes, add parenthesis to call it like a function: tracked()\", !(isElementDescriptor(args.slice(0, 3)) && args.length === 5 && args[4] === true)));\n\n    if (!isElementDescriptor(args)) {\n      var propertyDesc = args[0];\n      (true && !(args.length === 0 || typeof propertyDesc === 'object' && propertyDesc !== null) && (0, _debug.assert)(\"tracked() may only receive an options object containing 'value' or 'initializer', received \" + propertyDesc, args.length === 0 || typeof propertyDesc === 'object' && propertyDesc !== null));\n\n      if (true\n      /* DEBUG */\n      && propertyDesc) {\n        var keys = Object.keys(propertyDesc);\n        (true && !(keys.length <= 1 && (keys[0] === undefined || keys[0] === 'value' || keys[0] === 'initializer')) && (0, _debug.assert)(\"The options object passed to tracked() may only contain a 'value' or 'initializer' property, not both. Received: [\" + keys + \"]\", keys.length <= 1 && (keys[0] === undefined || keys[0] === 'value' || keys[0] === 'initializer')));\n        (true && !(!('initializer' in propertyDesc) || typeof propertyDesc.initializer === 'function') && (0, _debug.assert)(\"The initializer passed to tracked must be a function. Received \" + propertyDesc.initializer, !('initializer' in propertyDesc) || typeof propertyDesc.initializer === 'function'));\n      }\n\n      var initializer = propertyDesc ? propertyDesc.initializer : undefined;\n      var value$$1 = propertyDesc ? propertyDesc.value : undefined;\n\n      var decorator = function (target, key, _desc, _meta, isClassicDecorator$$1) {\n        (true && !(isClassicDecorator$$1) && (0, _debug.assert)(\"You attempted to set a default value for \" + key + \" with the @tracked({ value: 'default' }) syntax. You can only use this syntax with classic classes. For native classes, you can use class initializers: @tracked field = 'default';\", isClassicDecorator$$1));\n        var fieldDesc = {\n          initializer: initializer || (() => value$$1)\n        };\n        return descriptorForField([target, key, fieldDesc]);\n      };\n\n      setClassicDecorator(decorator);\n      return decorator;\n    }\n\n    return descriptorForField(args);\n  }\n\n  if (true\n  /* DEBUG */\n  ) {\n    // Normally this isn't a classic decorator, but we want to throw a helpful\n    // error in development so we need it to treat it like one\n    setClassicDecorator(tracked);\n  }\n\n  function descriptorForField([_target, key, desc]) {\n    (true && !(!desc || !desc.value && !desc.get && !desc.set) && (0, _debug.assert)(\"You attempted to use @tracked on \" + key + \", but that element is not a class field. @tracked is only usable on class fields. Native getters and setters will autotrack add any tracked fields they encounter, so there is no need mark getters and setters with @tracked.\", !desc || !desc.value && !desc.get && !desc.set));\n    var initializer = desc ? desc.initializer : undefined;\n    var values = new WeakMap();\n    var hasInitializer = typeof initializer === 'function';\n    return {\n      enumerable: true,\n      configurable: true,\n\n      get() {\n        var propertyTag = tagForProperty(this, key);\n        consume(propertyTag);\n        var value$$1; // If the field has never been initialized, we should initialize it\n\n        if (hasInitializer && !values.has(this)) {\n          value$$1 = initializer.call(this);\n          values.set(this, value$$1);\n        } else {\n          value$$1 = values.get(this);\n        } // Add the tag of the returned value if it is an array, since arrays\n        // should always cause updates if they are consumed and then changed\n\n\n        if (Array.isArray(value$$1) || (0, _utils.isEmberArray)(value$$1)) {\n          (0, _reference.update)(propertyTag, tagForProperty(value$$1, '[]'));\n        }\n\n        return value$$1;\n      },\n\n      set(newValue) {\n        if (true\n        /* DEBUG */\n        ) {\n          // No matter what, attempting to update a tracked property in an\n          // autotracking context after it has been read is invalid, even if we\n          // are otherwise warning, so always assert.\n          assertTagNotConsumed(tagForProperty(this, key), this, key, true);\n        }\n\n        markObjectAsDirty(this, key);\n        values.set(this, newValue);\n\n        if (propertyDidChange !== null) {\n          propertyDidChange();\n        }\n      }\n\n    };\n  }\n  /**\n    @private\n  \n    Whenever a tracked computed property is entered, the current tracker is\n    saved off and a new tracker is replaced.\n  \n    Any tracked properties consumed are added to the current tracker.\n  \n    When a tracked computed property is exited, the tracker's tags are\n    combined and added to the parent tracker.\n  \n    The consequence is that each tracked computed property has a tag\n    that corresponds to the tracked properties consumed inside of\n    itself, including child tracked computed properties.\n  */\n\n\n  var CURRENT_TRACKER = null;\n\n  function track(callback, debuggingContext) {\n    // Note: debuggingContext is allowed to be false so `DEBUG && 'debug message'` works\n    var parent = CURRENT_TRACKER;\n    var current = new Tracker();\n    CURRENT_TRACKER = current;\n\n    try {\n      if (true\n      /* DEBUG */\n      ) {\n        if (debuggingContext) {\n          debuggingContexts.unshift(debuggingContext);\n        }\n\n        runInAutotrackingTransaction(callback);\n      } else {\n        callback();\n      }\n    } finally {\n      if (true\n      /* DEBUG */\n      && debuggingContext) {\n        debuggingContexts.shift();\n      }\n\n      CURRENT_TRACKER = parent;\n    }\n\n    return current.combine();\n  }\n\n  function consume(tag) {\n    if (CURRENT_TRACKER !== null) {\n      CURRENT_TRACKER.add(tag);\n    }\n  }\n\n  function isTracking() {\n    return CURRENT_TRACKER !== null;\n  }\n\n  function untrack(callback) {\n    var parent = CURRENT_TRACKER;\n    CURRENT_TRACKER = null;\n\n    try {\n      callback();\n    } finally {\n      CURRENT_TRACKER = parent;\n    }\n  }\n\n  var propertyDidChange = null;\n  var UNKNOWN_PROPERTY_TAG = (0, _utils.symbol)('UNKNOWN_PROPERTY_TAG');\n  _exports.UNKNOWN_PROPERTY_TAG = UNKNOWN_PROPERTY_TAG;\n\n  function tagForProperty(object, propertyKey, _meta) {\n    var objectType = typeof object;\n\n    if (objectType !== 'function' && (objectType !== 'object' || object === null)) {\n      return _reference.CONSTANT_TAG;\n    }\n\n    var meta$$1 = _meta === undefined ? (0, _meta2.meta)(object) : _meta;\n    {\n      if (!(propertyKey in object) && typeof object[UNKNOWN_PROPERTY_TAG] === 'function') {\n        return object[UNKNOWN_PROPERTY_TAG](propertyKey);\n      }\n    }\n    var tags = meta$$1.writableTags();\n    var tag = tags[propertyKey];\n\n    if (tag) {\n      return tag;\n    }\n\n    {\n      var newTag = (0, _reference.createUpdatableTag)();\n\n      if (true\n      /* DEBUG */\n      ) {\n        {\n          (0, _utils.setupMandatorySetter)(object, propertyKey);\n        }\n        newTag._propertyKey = propertyKey;\n      }\n\n      return tags[propertyKey] = newTag;\n    }\n  }\n\n  function tagFor(object, _meta) {\n    if (typeof object === 'object' && object !== null) {\n      var meta$$1 = _meta === undefined ? (0, _meta2.meta)(object) : _meta;\n\n      if (!meta$$1.isMetaDestroyed()) {\n        return meta$$1.writableTag();\n      }\n    }\n\n    return _reference.CONSTANT_TAG;\n  }\n\n  function markObjectAsDirty(obj, propertyKey, _meta) {\n    var meta$$1 = _meta === undefined ? (0, _meta2.meta)(obj) : _meta;\n    var objectTag = meta$$1.readableTag();\n\n    if (objectTag !== undefined) {\n      if (true\n      /* DEBUG */\n      ) {\n        assertTagNotConsumed(objectTag, obj);\n      }\n\n      (0, _reference.dirty)(objectTag);\n    }\n\n    var tags = meta$$1.readableTags();\n    var propertyTag = tags !== undefined ? tags[propertyKey] : undefined;\n\n    if (propertyTag !== undefined) {\n      if (true\n      /* DEBUG */\n      ) {\n        assertTagNotConsumed(propertyTag, obj, propertyKey);\n      }\n\n      (0, _reference.dirty)(propertyTag);\n    }\n\n    if (objectTag !== undefined || propertyTag !== undefined) {\n      ensureRunloop();\n    }\n  }\n\n  function ensureRunloop() {\n    _runloop.backburner.ensureInstance();\n  }\n  /**\n  @module @ember/object\n  */\n\n\n  var PROXY_CONTENT = (0, _utils.symbol)('PROXY_CONTENT');\n  _exports.PROXY_CONTENT = PROXY_CONTENT;\n  var getPossibleMandatoryProxyValue;\n\n  if (true\n  /* DEBUG */\n  && _utils.HAS_NATIVE_PROXY) {\n    getPossibleMandatoryProxyValue = function getPossibleMandatoryProxyValue(obj, keyName) {\n      var content = obj[PROXY_CONTENT];\n\n      if (content === undefined) {\n        return obj[keyName];\n      } else {\n        /* global Reflect */\n        return Reflect.get(content, keyName, obj);\n      }\n    };\n  } // ..........................................................\n  // GET AND SET\n  //\n  // If we are on a platform that supports accessors we can use those.\n  // Otherwise simulate accessors by looking up the property directly on the\n  // object.\n\n  /**\n    Gets the value of a property on an object. If the property is computed,\n    the function will be invoked. If the property is not defined but the\n    object implements the `unknownProperty` method then that will be invoked.\n  \n    ```javascript\n    import { get } from '@ember/object';\n    get(obj, \"name\");\n    ```\n  \n    If you plan to run on IE8 and older browsers then you should use this\n    method anytime you want to retrieve a property on an object that you don't\n    know for sure is private. (Properties beginning with an underscore '_'\n    are considered private.)\n  \n    On all newer browsers, you only need to use this method to retrieve\n    properties if the property might not be defined on the object and you want\n    to respect the `unknownProperty` handler. Otherwise you can ignore this\n    method.\n  \n    Note that if the object itself is `undefined`, this method will throw\n    an error.\n  \n    @method get\n    @for @ember/object\n    @static\n    @param {Object} obj The object to retrieve from.\n    @param {String} keyName The property key to retrieve\n    @return {Object} the property value or `null`.\n    @public\n  */\n\n\n  function get(obj, keyName) {\n    (true && !(arguments.length === 2) && (0, _debug.assert)(\"Get must be called with two arguments; an object and a property key\", arguments.length === 2));\n    (true && !(obj !== undefined && obj !== null) && (0, _debug.assert)(\"Cannot call get with '\" + keyName + \"' on an undefined object.\", obj !== undefined && obj !== null));\n    (true && !(typeof keyName === 'string' || typeof keyName === 'number' && !isNaN(keyName)) && (0, _debug.assert)(\"The key provided to get must be a string or number, you passed \" + keyName, typeof keyName === 'string' || typeof keyName === 'number' && !isNaN(keyName)));\n    (true && !(typeof keyName !== 'string' || keyName.lastIndexOf('this.', 0) !== 0) && (0, _debug.assert)(\"'this' in paths is not supported\", typeof keyName !== 'string' || keyName.lastIndexOf('this.', 0) !== 0));\n    var type = typeof obj;\n    var isObject = type === 'object';\n    var isFunction = type === 'function';\n    var isObjectLike = isObject || isFunction;\n\n    if (isPath(keyName)) {\n      return isObjectLike ? _getPath(obj, keyName) : undefined;\n    }\n\n    var value$$1;\n\n    if (isObjectLike) {\n      var tracking = isTracking();\n      {\n        if (tracking) {\n          consume(tagForProperty(obj, keyName));\n        }\n      }\n\n      if (true\n      /* DEBUG */\n      && _utils.HAS_NATIVE_PROXY) {\n        value$$1 = getPossibleMandatoryProxyValue(obj, keyName);\n      } else {\n        value$$1 = obj[keyName];\n      } // Add the tag of the returned value if it is an array, since arrays\n      // should always cause updates if they are consumed and then changed\n\n\n      if (true\n      /* EMBER_METAL_TRACKED_PROPERTIES */\n      && tracking && (Array.isArray(value$$1) || (0, _utils.isEmberArray)(value$$1))) {\n        consume(tagForProperty(value$$1, '[]'));\n      }\n    } else {\n      value$$1 = obj[keyName];\n    }\n\n    if (value$$1 === undefined) {\n      if (isObject && !(keyName in obj) && typeof obj.unknownProperty === 'function') {\n        if (true\n        /* DEBUG */\n        ) {\n          var ret;\n          deprecateMutationsInAutotrackingTransaction(() => {\n            ret = obj.unknownProperty(keyName);\n          });\n          return ret;\n        } else {\n          return obj.unknownProperty(keyName);\n        }\n      }\n    }\n\n    return value$$1;\n  }\n\n  function _getPath(root, path) {\n    var obj = root;\n    var parts = typeof path === 'string' ? path.split('.') : path;\n\n    for (var i = 0; i < parts.length; i++) {\n      if (obj === undefined || obj === null || obj.isDestroyed) {\n        return undefined;\n      }\n\n      obj = get(obj, parts[i]);\n    }\n\n    return obj;\n  }\n  /**\n    Retrieves the value of a property from an Object, or a default value in the\n    case that the property returns `undefined`.\n  \n    ```javascript\n    import { getWithDefault } from '@ember/object';\n    getWithDefault(person, 'lastName', 'Doe');\n    ```\n  \n    @method getWithDefault\n    @for @ember/object\n    @static\n    @param {Object} obj The object to retrieve from.\n    @param {String} keyName The name of the property to retrieve\n    @param {Object} defaultValue The value to return if the property value is undefined\n    @return {Object} The property value or the defaultValue.\n    @public\n  */\n\n\n  function getWithDefault(root, key, defaultValue) {\n    var value$$1 = get(root, key);\n\n    if (value$$1 === undefined) {\n      return defaultValue;\n    }\n\n    return value$$1;\n  }\n\n  function isObject(obj) {\n    return typeof obj === 'object' && obj !== null;\n  }\n\n  function isVolatile(obj, keyName, meta$$1) {\n    var desc = descriptorForProperty(obj, keyName, meta$$1);\n    return !(desc !== undefined && desc._volatile === false);\n  }\n\n  class ChainWatchers {\n    constructor() {\n      // chain nodes that reference a key in this obj by key\n      // we only create ChainWatchers when we are going to add them\n      // so create this upfront\n      this.chains = Object.create(null);\n    }\n\n    add(key, node) {\n      var nodes = this.chains[key];\n\n      if (nodes === undefined) {\n        this.chains[key] = [node];\n      } else {\n        nodes.push(node);\n      }\n    }\n\n    remove(key, node) {\n      var nodes = this.chains[key];\n\n      if (nodes !== undefined) {\n        for (var i = 0; i < nodes.length; i++) {\n          if (nodes[i] === node) {\n            nodes.splice(i, 1);\n            break;\n          }\n        }\n      }\n    }\n\n    has(key, node) {\n      var nodes = this.chains[key];\n\n      if (nodes !== undefined) {\n        for (var i = 0; i < nodes.length; i++) {\n          if (nodes[i] === node) {\n            return true;\n          }\n        }\n      }\n\n      return false;\n    }\n\n    revalidateAll() {\n      for (var key in this.chains) {\n        this.notify(key, true, undefined);\n      }\n    }\n\n    revalidate(key) {\n      this.notify(key, true, undefined);\n    } // key: the string key that is part of a path changed\n    // revalidate: boolean; the chains that are watching this value should revalidate\n    // callback: function that will be called with the object and path that\n    //           will be/are invalidated by this key change, depending on\n    //           whether the revalidate flag is passed\n\n\n    notify(key, revalidate, callback) {\n      var nodes = this.chains[key];\n\n      if (nodes === undefined || nodes.length === 0) {\n        return;\n      }\n\n      var affected = undefined;\n\n      if (callback !== undefined) {\n        affected = [];\n      }\n\n      for (var i = 0; i < nodes.length; i++) {\n        nodes[i].notify(revalidate, affected);\n      }\n\n      if (callback === undefined) {\n        return;\n      } // we gather callbacks so we don't notify them during revalidation\n\n\n      for (var _i = 0; _i < affected.length; _i += 2) {\n        var obj = affected[_i];\n        var path = affected[_i + 1];\n        callback(obj, path);\n      }\n    }\n\n  }\n\n  function makeChainWatcher() {\n    return new ChainWatchers();\n  }\n\n  function makeChainNode(obj) {\n    return new ChainNode(null, null, obj);\n  }\n\n  function addChainWatcher(obj, keyName, node) {\n    var m = (0, _meta2.meta)(obj);\n    m.writableChainWatchers(makeChainWatcher).add(keyName, node);\n    watchKey(obj, keyName, m);\n  }\n\n  function removeChainWatcher(obj, keyName, node, _meta) {\n    if (!isObject(obj)) {\n      return;\n    }\n\n    var meta$$1 = _meta === undefined ? (0, _meta2.peekMeta)(obj) : _meta;\n\n    if (meta$$1 === null || meta$$1.isSourceDestroying() || meta$$1.isMetaDestroyed() || meta$$1.readableChainWatchers() === undefined) {\n      return;\n    } // make meta writable\n\n\n    meta$$1 = (0, _meta2.meta)(obj);\n    meta$$1.readableChainWatchers().remove(keyName, node);\n    unwatchKey(obj, keyName, meta$$1);\n  }\n\n  var NODE_STACK = [];\n\n  function destroyRoot(root) {\n    pushChildren(root);\n\n    while (NODE_STACK.length > 0) {\n      var node = NODE_STACK.pop();\n      pushChildren(node);\n      destroyOne(node);\n    }\n  }\n\n  function destroyOne(node) {\n    if (node.isWatching) {\n      removeChainWatcher(node.object, node.key, node);\n      node.isWatching = false;\n    }\n  }\n\n  function pushChildren(node) {\n    var nodes = node.chains;\n\n    if (nodes !== undefined) {\n      for (var key in nodes) {\n        if (nodes[key] !== undefined) {\n          NODE_STACK.push(nodes[key]);\n        }\n      }\n    }\n  } // A ChainNode watches a single key on an object. If you provide a starting\n  // value for the key then the node won't actually watch it. For a root node\n  // pass null for parent and key and object for value.\n\n\n  class ChainNode {\n    constructor(parent, key, value$$1) {\n      this.paths = undefined;\n      this.isWatching = false;\n      this.chains = undefined;\n      this.object = undefined;\n      this.count = 0;\n      this.parent = parent;\n      this.key = key;\n      this.content = value$$1; // It is false for the root of a chain (because we have no parent)\n\n      var isWatching = this.isWatching = parent !== null;\n\n      if (isWatching) {\n        var parentValue = parent.value();\n\n        if (isObject(parentValue)) {\n          this.object = parentValue;\n          addChainWatcher(parentValue, key, this);\n        }\n      }\n    }\n\n    value() {\n      if (this.content === undefined && this.isWatching) {\n        var obj = this.parent.value();\n        this.content = lazyGet(obj, this.key);\n      }\n\n      return this.content;\n    }\n\n    destroy() {\n      // check if root\n      if (this.parent === null) {\n        destroyRoot(this);\n      } else {\n        destroyOne(this);\n      }\n    } // copies a top level object only\n\n\n    copyTo(target) {\n      var paths = this.paths;\n\n      if (paths !== undefined) {\n        var path;\n\n        for (path in paths) {\n          if (paths[path] > 0) {\n            target.add(path);\n          }\n        }\n      }\n    } // called on the root node of a chain to setup watchers on the specified\n    // path.\n\n\n    add(path) {\n      var paths = this.paths || (this.paths = {});\n      paths[path] = (paths[path] || 0) + 1;\n      var tails = path.split('.');\n      this.chain(tails.shift(), tails);\n    } // called on the root node of a chain to teardown watcher on the specified\n    // path\n\n\n    remove(path) {\n      var paths = this.paths;\n\n      if (paths === undefined) {\n        return;\n      }\n\n      if (paths[path] > 0) {\n        paths[path]--;\n      }\n\n      var tails = path.split('.');\n      this.unchain(tails.shift(), tails);\n    }\n\n    chain(key, tails) {\n      var chains = this.chains;\n\n      if (chains === undefined) {\n        chains = this.chains = Object.create(null);\n      }\n\n      var node = chains[key];\n\n      if (node === undefined) {\n        node = chains[key] = new ChainNode(this, key, undefined);\n      }\n\n      node.count++; // count chains...\n      // chain rest of path if there is one\n\n      if (tails.length > 0) {\n        node.chain(tails.shift(), tails);\n      }\n    }\n\n    unchain(key, tails) {\n      var chains = this.chains;\n      var node = chains[key]; // unchain rest of path first...\n\n      if (tails.length > 0) {\n        node.unchain(tails.shift(), tails);\n      } // delete node if needed.\n\n\n      node.count--;\n\n      if (node.count <= 0) {\n        chains[node.key] = undefined;\n        node.destroy();\n      }\n    }\n\n    notify(revalidate, affected) {\n      if (revalidate && this.isWatching) {\n        var parentValue = this.parent.value();\n\n        if (parentValue !== this.object) {\n          removeChainWatcher(this.object, this.key, this);\n\n          if (isObject(parentValue)) {\n            this.object = parentValue;\n            addChainWatcher(parentValue, this.key, this);\n          } else {\n            this.object = undefined;\n          }\n        }\n\n        this.content = undefined;\n      } // then notify chains...\n\n\n      var chains = this.chains;\n\n      if (chains !== undefined) {\n        var node;\n\n        for (var key in chains) {\n          node = chains[key];\n\n          if (node !== undefined) {\n            node.notify(revalidate, affected);\n          }\n        }\n      }\n\n      if (affected !== undefined && this.parent !== null) {\n        this.parent.populateAffected(this.key, 1, affected);\n      }\n    }\n\n    populateAffected(path, depth, affected) {\n      if (this.key) {\n        path = this.key + \".\" + path;\n      }\n\n      if (this.parent !== null) {\n        this.parent.populateAffected(path, depth + 1, affected);\n      } else if (depth > 1) {\n        affected.push(this.value(), path);\n      }\n    }\n\n  }\n\n  _exports.ChainNode = ChainNode;\n\n  function lazyGet(obj, key) {\n    if (!isObject(obj)) {\n      return;\n    }\n\n    var meta$$1 = (0, _meta2.peekMeta)(obj); // check if object meant only to be a prototype\n\n    if (meta$$1 !== null && meta$$1.proto === obj) {\n      return;\n    } // Use `get` if the return value is an EachProxy or an uncacheable value.\n\n\n    if (key === '@each') {\n      return eachProxyFor(obj);\n    } else if (isVolatile(obj, key, meta$$1)) {\n      return get(obj, key); // Otherwise attempt to get the cached value of the computed property\n    } else {\n      return getCachedValueFor(obj, key);\n    }\n  }\n\n  function finishChains(meta$$1) {\n    // finish any current chains node watchers that reference obj\n    var chainWatchers = meta$$1.readableChainWatchers();\n\n    if (chainWatchers !== undefined) {\n      chainWatchers.revalidateAll();\n    } // ensure that if we have inherited any chains they have been\n    // copied onto our own meta.\n\n\n    if (meta$$1.readableChains() !== undefined) {\n      meta$$1.writableChains(makeChainNode);\n    }\n  }\n\n  function watchPath(obj, keyPath, meta$$1) {\n    var m = meta$$1 === undefined ? (0, _meta2.meta)(obj) : meta$$1;\n    var counter = m.peekWatching(keyPath);\n    m.writeWatching(keyPath, counter + 1);\n\n    if (counter === 0) {\n      // activate watching first time\n      m.writableChains(makeChainNode).add(keyPath);\n    }\n  }\n\n  function unwatchPath(obj, keyPath, meta$$1) {\n    var m = meta$$1 === undefined ? (0, _meta2.peekMeta)(obj) : meta$$1;\n\n    if (m === null) {\n      return;\n    }\n\n    var counter = m.peekWatching(keyPath);\n\n    if (counter > 0) {\n      m.writeWatching(keyPath, counter - 1);\n\n      if (counter === 1) {\n        m.writableChains(makeChainNode).remove(keyPath);\n      }\n    }\n  }\n  /**\n  @module ember\n  */\n\n  /**\n    Starts watching a property on an object. Whenever the property changes,\n    invokes `Ember.notifyPropertyChange`. This is the primitive used by observers\n    and dependent keys; usually you will never call this method directly but instead\n    use higher level methods like `addObserver()`.\n  \n    @private\n    @method watch\n    @for Ember\n    @param obj\n    @param {String} keyPath\n    @param {Object} meta\n  */\n\n\n  function watch(obj, keyPath, meta$$1) {\n    if (isPath(keyPath)) {\n      watchPath(obj, keyPath, meta$$1);\n    } else {\n      watchKey(obj, keyPath, meta$$1);\n    }\n  }\n\n  function isWatching(obj, key) {\n    return watcherCount(obj, key) > 0;\n  }\n\n  function watcherCount(obj, key) {\n    var meta$$1 = (0, _meta2.peekMeta)(obj);\n    return meta$$1 !== null && meta$$1.peekWatching(key) || 0;\n  }\n  /**\n    Stops watching a property on an object. Usually you will never call this method directly but instead\n    use higher level methods like `removeObserver()`.\n  \n    @private\n    @method unwatch\n    @for Ember\n    @param obj\n    @param {String} keyPath\n    @param {Object} meta\n  */\n\n\n  function unwatch(obj, keyPath, meta$$1) {\n    if (isPath(keyPath)) {\n      unwatchPath(obj, keyPath, meta$$1);\n    } else {\n      unwatchKey(obj, keyPath, meta$$1);\n    }\n  }\n\n  var SYNC_DEFAULT = !_environment.ENV._DEFAULT_ASYNC_OBSERVERS;\n  var SYNC_OBSERVERS = new Map();\n  var ASYNC_OBSERVERS = new Map();\n  /**\n  @module @ember/object\n  */\n\n  /**\n    @method addObserver\n    @static\n    @for @ember/object/observers\n    @param obj\n    @param {String} path\n    @param {Object|Function} target\n    @param {Function|String} [method]\n    @public\n  */\n\n  function addObserver(obj, path, target, method, sync = SYNC_DEFAULT) {\n    var eventName = changeEvent(path);\n    addListener(obj, eventName, target, method, false, sync);\n    {\n      var meta$$1 = (0, _meta2.peekMeta)(obj);\n\n      if (meta$$1 === null || !(meta$$1.isPrototypeMeta(obj) || meta$$1.isInitializing())) {\n        activateObserver(obj, eventName, sync);\n      }\n    }\n  }\n  /**\n    @method removeObserver\n    @static\n    @for @ember/object/observers\n    @param obj\n    @param {String} path\n    @param {Object|Function} target\n    @param {Function|String} [method]\n    @public\n  */\n\n\n  function removeObserver(obj, path, target, method, sync = SYNC_DEFAULT) {\n    var eventName = changeEvent(path);\n    {\n      var meta$$1 = (0, _meta2.peekMeta)(obj);\n\n      if (meta$$1 === null || !(meta$$1.isPrototypeMeta(obj) || meta$$1.isInitializing())) {\n        deactivateObserver(obj, eventName, sync);\n      }\n    }\n    removeListener(obj, eventName, target, method);\n  }\n\n  function getOrCreateActiveObserversFor(target, sync) {\n    var observerMap = sync === true ? SYNC_OBSERVERS : ASYNC_OBSERVERS;\n\n    if (!observerMap.has(target)) {\n      observerMap.set(target, new Map());\n    }\n\n    return observerMap.get(target);\n  }\n\n  function activateObserver(target, eventName, sync = false) {\n    var activeObservers = getOrCreateActiveObserversFor(target, sync);\n\n    if (activeObservers.has(eventName)) {\n      activeObservers.get(eventName).count++;\n    } else {\n      var [path] = eventName.split(':');\n      var tag = (0, _reference.combine)(getChainTagsForKey(target, path));\n      activeObservers.set(eventName, {\n        count: 1,\n        path,\n        tag,\n        lastRevision: (0, _reference.value)(tag),\n        suspended: false\n      });\n    }\n  }\n\n  function deactivateObserver(target, eventName, sync = false) {\n    var observerMap = sync === true ? SYNC_OBSERVERS : ASYNC_OBSERVERS;\n    var activeObservers = observerMap.get(target);\n\n    if (activeObservers !== undefined) {\n      var _observer = activeObservers.get(eventName);\n\n      _observer.count--;\n\n      if (_observer.count === 0) {\n        activeObservers.delete(eventName);\n\n        if (activeObservers.size === 0) {\n          observerMap.delete(target);\n        }\n      }\n    }\n  }\n  /**\n   * Primarily used for cases where we are redefining a class, e.g. mixins/reopen\n   * being applied later. Revalidates all the observers, resetting their tags.\n   *\n   * @private\n   * @param target\n   */\n\n\n  function revalidateObservers(target) {\n    if (ASYNC_OBSERVERS.has(target)) {\n      ASYNC_OBSERVERS.get(target).forEach(observer => {\n        observer.tag = (0, _reference.combine)(getChainTagsForKey(target, observer.path));\n        observer.lastRevision = (0, _reference.value)(observer.tag);\n      });\n    }\n\n    if (SYNC_OBSERVERS.has(target)) {\n      SYNC_OBSERVERS.get(target).forEach(observer => {\n        observer.tag = (0, _reference.combine)(getChainTagsForKey(target, observer.path));\n        observer.lastRevision = (0, _reference.value)(observer.tag);\n      });\n    }\n  }\n\n  var lastKnownRevision = 0;\n\n  function flushAsyncObservers(shouldSchedule = true) {\n    if (lastKnownRevision === (0, _reference.value)(_reference.CURRENT_TAG)) {\n      return;\n    }\n\n    lastKnownRevision = (0, _reference.value)(_reference.CURRENT_TAG);\n    ASYNC_OBSERVERS.forEach((activeObservers, target) => {\n      var meta$$1 = (0, _meta2.peekMeta)(target);\n\n      if (meta$$1 && (meta$$1.isSourceDestroying() || meta$$1.isMetaDestroyed())) {\n        ASYNC_OBSERVERS.delete(target);\n        return;\n      }\n\n      activeObservers.forEach((observer, eventName) => {\n        if (!(0, _reference.validate)(observer.tag, observer.lastRevision)) {\n          var sendObserver = () => {\n            try {\n              sendEvent(target, eventName, [target, observer.path]);\n            } finally {\n              observer.tag = (0, _reference.combine)(getChainTagsForKey(target, observer.path));\n              observer.lastRevision = (0, _reference.value)(observer.tag);\n            }\n          };\n\n          if (shouldSchedule) {\n            (0, _runloop.schedule)('actions', sendObserver);\n          } else {\n            sendObserver();\n          }\n        }\n      });\n    });\n  }\n\n  function flushSyncObservers() {\n    // When flushing synchronous observers, we know that something has changed (we\n    // only do this during a notifyPropertyChange), so there's no reason to check\n    // a global revision.\n    SYNC_OBSERVERS.forEach((activeObservers, target) => {\n      var meta$$1 = (0, _meta2.peekMeta)(target);\n\n      if (meta$$1 && (meta$$1.isSourceDestroying() || meta$$1.isMetaDestroyed())) {\n        SYNC_OBSERVERS.delete(target);\n        return;\n      }\n\n      activeObservers.forEach((observer, eventName) => {\n        if (!observer.suspended && !(0, _reference.validate)(observer.tag, observer.lastRevision)) {\n          try {\n            observer.suspended = true;\n            sendEvent(target, eventName, [target, observer.path]);\n          } finally {\n            observer.tag = (0, _reference.combine)(getChainTagsForKey(target, observer.path));\n            observer.lastRevision = (0, _reference.value)(observer.tag);\n            observer.suspended = false;\n          }\n        }\n      });\n    });\n  }\n\n  function setObserverSuspended(target, property, suspended) {\n    var activeObservers = SYNC_OBSERVERS.get(target);\n\n    if (!activeObservers) {\n      return;\n    }\n\n    var observer = activeObservers.get(changeEvent(property));\n\n    if (observer) {\n      observer.suspended = suspended;\n    }\n  }\n  /**\n   @module ember\n   @private\n   */\n\n\n  var PROPERTY_DID_CHANGE = (0, _utils.symbol)('PROPERTY_DID_CHANGE');\n  _exports.PROPERTY_DID_CHANGE = PROPERTY_DID_CHANGE;\n  var deferred = 0;\n  /**\n    This function is called just after an object property has changed.\n    It will notify any observers and clear caches among other things.\n  \n    Normally you will not need to call this method directly but if for some\n    reason you can't directly watch a property you can invoke this method\n    manually.\n  \n    @method notifyPropertyChange\n    @for @ember/object\n    @param {Object} obj The object with the property that will change\n    @param {String} keyName The property key (or path) that will change.\n    @param {Meta} meta The objects meta.\n    @return {void}\n    @since 3.1.0\n    @public\n  */\n\n  function notifyPropertyChange(obj, keyName, _meta) {\n    var meta$$1 = _meta === undefined ? (0, _meta2.peekMeta)(obj) : _meta;\n\n    if (meta$$1 !== null && (meta$$1.isInitializing() || meta$$1.isPrototypeMeta(obj))) {\n      return;\n    }\n\n    if (meta$$1 !== null) {\n      markObjectAsDirty(obj, keyName, meta$$1);\n    }\n\n    if (true\n    /* EMBER_METAL_TRACKED_PROPERTIES */\n    && deferred <= 0) {\n      flushSyncObservers();\n    }\n\n    if (PROPERTY_DID_CHANGE in obj) {\n      obj[PROPERTY_DID_CHANGE](keyName);\n    }\n  }\n\n  function overrideChains(_obj, keyName, meta$$1) {\n    var chainWatchers = meta$$1.readableChainWatchers();\n\n    if (chainWatchers !== undefined) {\n      chainWatchers.revalidate(keyName);\n    }\n  }\n  /**\n    @method beginPropertyChanges\n    @chainable\n    @private\n  */\n\n\n  function beginPropertyChanges() {\n    deferred++;\n  }\n  /**\n    @method endPropertyChanges\n    @private\n  */\n\n\n  function endPropertyChanges() {\n    deferred--;\n\n    if (deferred <= 0) {\n      {\n        flushSyncObservers();\n      }\n    }\n  }\n  /**\n    Make a series of property changes together in an\n    exception-safe way.\n  \n    ```javascript\n    Ember.changeProperties(function() {\n      obj1.set('foo', mayBlowUpWhenSet);\n      obj2.set('bar', baz);\n    });\n    ```\n  \n    @method changeProperties\n    @param {Function} callback\n    @private\n  */\n\n\n  function changeProperties(callback) {\n    beginPropertyChanges();\n\n    try {\n      callback();\n    } finally {\n      endPropertyChanges();\n    }\n  }\n\n  function arrayContentWillChange(array, startIdx, removeAmt, addAmt) {\n    // if no args are passed assume everything changes\n    if (startIdx === undefined) {\n      startIdx = 0;\n      removeAmt = addAmt = -1;\n    } else {\n      if (removeAmt === undefined) {\n        removeAmt = -1;\n      }\n\n      if (addAmt === undefined) {\n        addAmt = -1;\n      }\n    }\n\n    sendEvent(array, '@array:before', [array, startIdx, removeAmt, addAmt]);\n    return array;\n  }\n\n  function arrayContentDidChange(array, startIdx, removeAmt, addAmt) {\n    // if no args are passed assume everything changes\n    if (startIdx === undefined) {\n      startIdx = 0;\n      removeAmt = addAmt = -1;\n    } else {\n      if (removeAmt === undefined) {\n        removeAmt = -1;\n      }\n\n      if (addAmt === undefined) {\n        addAmt = -1;\n      }\n    }\n\n    var meta$$1 = (0, _meta2.peekMeta)(array);\n\n    if (addAmt < 0 || removeAmt < 0 || addAmt - removeAmt !== 0) {\n      notifyPropertyChange(array, 'length', meta$$1);\n    }\n\n    notifyPropertyChange(array, '[]', meta$$1);\n    sendEvent(array, '@array:change', [array, startIdx, removeAmt, addAmt]);\n    var cache = peekCacheFor(array);\n\n    if (cache !== undefined) {\n      var length = array.length;\n      var addedAmount = addAmt === -1 ? 0 : addAmt;\n      var removedAmount = removeAmt === -1 ? 0 : removeAmt;\n      var delta = addedAmount - removedAmount;\n      var previousLength = length - delta;\n      var normalStartIdx = startIdx < 0 ? previousLength + startIdx : startIdx;\n\n      if (cache.has('firstObject') && normalStartIdx === 0) {\n        notifyPropertyChange(array, 'firstObject', meta$$1);\n      }\n\n      if (cache.has('lastObject')) {\n        var previousLastIndex = previousLength - 1;\n        var lastAffectedIndex = normalStartIdx + removedAmount;\n\n        if (previousLastIndex < lastAffectedIndex) {\n          notifyPropertyChange(array, 'lastObject', meta$$1);\n        }\n      }\n    }\n\n    return array;\n  }\n\n  var EMPTY_ARRAY = Object.freeze([]);\n\n  function objectAt(array, index) {\n    if (Array.isArray(array)) {\n      return array[index];\n    } else {\n      return array.objectAt(index);\n    }\n  }\n\n  function replace(array, start, deleteCount, items = EMPTY_ARRAY) {\n    if (Array.isArray(array)) {\n      replaceInNativeArray(array, start, deleteCount, items);\n    } else {\n      array.replace(start, deleteCount, items);\n    }\n  }\n\n  var CHUNK_SIZE = 60000; // To avoid overflowing the stack, we splice up to CHUNK_SIZE items at a time.\n  // See https://code.google.com/p/chromium/issues/detail?id=56588 for more details.\n\n  function replaceInNativeArray(array, start, deleteCount, items) {\n    arrayContentWillChange(array, start, deleteCount, items.length);\n\n    if (items.length <= CHUNK_SIZE) {\n      array.splice(start, deleteCount, ...items);\n    } else {\n      array.splice(start, deleteCount);\n\n      for (var i = 0; i < items.length; i += CHUNK_SIZE) {\n        var chunk = items.slice(i, i + CHUNK_SIZE);\n        array.splice(start + i, 0, ...chunk);\n      }\n    }\n\n    arrayContentDidChange(array, start, deleteCount, items.length);\n  }\n\n  function arrayObserversHelper(obj, target, opts, operation, notify) {\n    var willChange = opts && opts.willChange || 'arrayWillChange';\n    var didChange = opts && opts.didChange || 'arrayDidChange';\n    var hasObservers = obj.hasArrayObservers;\n    operation(obj, '@array:before', target, willChange);\n    operation(obj, '@array:change', target, didChange);\n\n    if (hasObservers === notify) {\n      notifyPropertyChange(obj, 'hasArrayObservers');\n    }\n\n    return obj;\n  }\n\n  function addArrayObserver(array, target, opts) {\n    return arrayObserversHelper(array, target, opts, addListener, false);\n  }\n\n  function removeArrayObserver(array, target, opts) {\n    return arrayObserversHelper(array, target, opts, removeListener, true);\n  }\n\n  var ARGS_PROXY_TAGS = new WeakMap();\n  _exports.ARGS_PROXY_TAGS = ARGS_PROXY_TAGS;\n\n  function finishLazyChains(obj, key, value$$1) {\n    var meta$$1 = (0, _meta2.peekMeta)(obj);\n    var lazyTags = meta$$1 !== null ? meta$$1.readableLazyChainsFor(key) : undefined;\n\n    if (lazyTags === undefined) {\n      return;\n    }\n\n    if (value$$1 === null || typeof value$$1 !== 'object' && typeof value$$1 !== 'function') {\n      for (var path in lazyTags) {\n        delete lazyTags[path];\n      }\n\n      return;\n    }\n\n    for (var _path in lazyTags) {\n      var tag = lazyTags[_path];\n      (0, _reference.update)(tag, (0, _reference.combine)(getChainTagsForKey(value$$1, _path)));\n      delete lazyTags[_path];\n    }\n  }\n\n  function getChainTagsForKeys(obj, keys) {\n    var chainTags = [];\n\n    for (var i = 0; i < keys.length; i++) {\n      chainTags.push(...getChainTagsForKey(obj, keys[i]));\n    }\n\n    return chainTags;\n  }\n\n  function getChainTagsForKey(obj, path) {\n    var chainTags = [];\n    var current = obj;\n    var pathLength = path.length;\n    var segmentEnd = -1; // prevent closures\n\n    var segment, descriptor; // eslint-disable-next-line no-constant-condition\n\n    while (true) {\n      var currentType = typeof current;\n\n      if (current === null || currentType !== 'object' && currentType !== 'function') {\n        // we've hit the end of the chain for now, break out\n        break;\n      }\n\n      var lastSegmentEnd = segmentEnd + 1;\n      segmentEnd = path.indexOf('.', lastSegmentEnd);\n\n      if (segmentEnd === -1) {\n        segmentEnd = pathLength;\n      }\n\n      segment = path.slice(lastSegmentEnd, segmentEnd); // If the segment is an @each, we can process it and then break\n\n      if (segment === '@each' && segmentEnd !== pathLength) {\n        lastSegmentEnd = segmentEnd + 1;\n        segmentEnd = path.indexOf('.', lastSegmentEnd); // There should be exactly one segment after an `@each` (i.e. `@each.foo`, not `@each.foo.bar`)\n\n        (true && !(segmentEnd === -1) && (0, _debug.deprecate)(\"When using @each in a dependent-key or an observer, \" + \"you can only chain one property level deep after \" + (\"the @each. That is, `\" + path.slice(0, segmentEnd) + \"` \") + (\"is allowed but `\" + path + \"` (which is what you passed) \") + \"is not.\\n\\n\" + \"This was never supported. Currently, the extra segments \" + (\"are silently ignored, i.e. `\" + path + \"` behaves exactly \") + (\"the same as `\" + path.slice(0, segmentEnd) + \"`. \") + \"In the future, this will throw an error.\\n\\n\" + \"If the current behavior is acceptable for your use case, \" + \"please remove the extraneous segments by changing your \" + (\"key to `\" + path.slice(0, segmentEnd) + \"`. \") + \"Otherwise, please create an intermediary computed property \" + \"or switch to using tracked properties.\", segmentEnd === -1, {\n          until: '3.17.0',\n          id: 'ember-metal.computed-deep-each'\n        }));\n        var arrLength = current.length;\n\n        if (typeof arrLength !== 'number' || // TODO: should the second test be `isEmberArray` instead?\n        !(Array.isArray(current) || 'objectAt' in current)) {\n          // If the current object isn't an array, there's nothing else to do,\n          // we don't watch individual properties. Break out of the loop.\n          break;\n        } else if (arrLength === 0) {\n          // Fast path for empty arrays\n          chainTags.push(tagForProperty(current, '[]'));\n          break;\n        }\n\n        if (segmentEnd === -1) {\n          segment = path.slice(lastSegmentEnd);\n        } else {\n          // Deprecated, remove once we turn the deprecation into an assertion\n          segment = path.slice(lastSegmentEnd, segmentEnd);\n        } // Push the tags for each item's property\n\n\n        for (var i = 0; i < arrLength; i++) {\n          var item = objectAt(current, i);\n\n          if (item) {\n            (true && !(typeof item === 'object') && (0, _debug.assert)(\"When using @each to observe the array `\" + current.toString() + \"`, the items in the array must be objects\", typeof item === 'object'));\n            chainTags.push(tagForProperty(item, segment));\n          }\n        } // Push the tag for the array length itself\n\n\n        chainTags.push(tagForProperty(current, '[]'));\n        break;\n      } // If the segment is linking to an args proxy, we need to manually access\n      // the tags for the args, since they are direct references and don't have a\n      // tagForProperty. We then continue chaining like normal after it, since\n      // you could chain off an arg if it were an object, for instance.\n\n\n      if (segment === 'args' && ARGS_PROXY_TAGS.has(current.args)) {\n        (true && !(segmentEnd !== pathLength) && (0, _debug.assert)(\"When watching the 'args' on a GlimmerComponent, you must watch a value on the args. You cannot watch the object itself, as it never changes.\", segmentEnd !== pathLength));\n        lastSegmentEnd = segmentEnd + 1;\n        segmentEnd = path.indexOf('.', lastSegmentEnd);\n\n        if (segmentEnd === -1) {\n          segmentEnd = pathLength;\n        }\n\n        segment = path.slice(lastSegmentEnd, segmentEnd);\n        var namedArgs = ARGS_PROXY_TAGS.get(current.args);\n        var ref = namedArgs.get(segment);\n        chainTags.push(ref.tag); // We still need to break if we're at the end of the path.\n\n        if (segmentEnd === pathLength) {\n          break;\n        } // Otherwise, set the current value and then continue to the next segment\n\n\n        current = ref.value();\n        continue;\n      } // TODO: Assert that current[segment] isn't an undecorated, non-MANDATORY_SETTER/dependentKeyCompat getter\n\n\n      var propertyTag = tagForProperty(current, segment);\n      descriptor = descriptorForProperty(current, segment);\n      chainTags.push(propertyTag); // If the key was an alias, we should always get the next value in order to\n      // bootstrap the alias. This is because aliases, unlike other CPs, should\n      // always be in sync with the aliased value.\n\n      if (descriptor !== undefined && typeof descriptor.altKey === 'string') {\n        current = current[segment]; // We still need to break if we're at the end of the path.\n\n        if (segmentEnd === pathLength) {\n          break;\n        } // Otherwise, continue to process the next segment\n\n\n        continue;\n      } // If we're at the end of the path, processing the last segment, and it's\n      // not an alias, we should _not_ get the last value, since we already have\n      // its tag. There's no reason to access it and do more work.\n\n\n      if (segmentEnd === pathLength) {\n        break;\n      }\n\n      if (descriptor === undefined) {\n        // If the descriptor is undefined, then its a normal property, so we should\n        // lookup the value to chain off of like normal.\n        if (!(segment in current) && typeof current.unknownProperty === 'function') {\n          current = current.unknownProperty(segment);\n        } else {\n          current = current[segment];\n        }\n      } else {\n        // If the descriptor is defined, then its a normal CP (not an alias, which\n        // would have been handled earlier). We get the last revision to check if\n        // the CP is still valid, and if so we use the cached value. If not, then\n        // we create a lazy chain lookup, and the next time the CP is caluculated,\n        // it will update that lazy chain.\n        var lastRevision = getLastRevisionFor(current, segment);\n\n        if ((0, _reference.validate)(propertyTag, lastRevision)) {\n          current = peekCacheFor(current).get(segment);\n        } else {\n          var lazyChains = (0, _meta2.meta)(current).writableLazyChainsFor(segment);\n          var rest = path.substr(segmentEnd + 1);\n          var placeholderTag = lazyChains[rest];\n\n          if (placeholderTag === undefined) {\n            placeholderTag = lazyChains[rest] = (0, _reference.createUpdatableTag)();\n          }\n\n          chainTags.push(placeholderTag);\n          break;\n        }\n      }\n    }\n\n    return chainTags;\n  }\n  /**\n  @module @ember/object\n  */\n\n\n  var END_WITH_EACH_REGEX = /\\.@each$/;\n  /**\n    Expands `pattern`, invoking `callback` for each expansion.\n  \n    The only pattern supported is brace-expansion, anything else will be passed\n    once to `callback` directly.\n  \n    Example\n  \n    ```js\n    import { expandProperties } from '@ember/object/computed';\n  \n    function echo(arg){ console.log(arg); }\n  \n    expandProperties('foo.bar', echo);              //=> 'foo.bar'\n    expandProperties('{foo,bar}', echo);            //=> 'foo', 'bar'\n    expandProperties('foo.{bar,baz}', echo);        //=> 'foo.bar', 'foo.baz'\n    expandProperties('{foo,bar}.baz', echo);        //=> 'foo.baz', 'bar.baz'\n    expandProperties('foo.{bar,baz}.[]', echo)      //=> 'foo.bar.[]', 'foo.baz.[]'\n    expandProperties('{foo,bar}.{spam,eggs}', echo) //=> 'foo.spam', 'foo.eggs', 'bar.spam', 'bar.eggs'\n    expandProperties('{foo}.bar.{baz}')             //=> 'foo.bar.baz'\n    ```\n  \n    @method expandProperties\n    @static\n    @for @ember/object/computed\n    @public\n    @param {String} pattern The property pattern to expand.\n    @param {Function} callback The callback to invoke.  It is invoked once per\n    expansion, and is passed the expansion.\n  */\n\n  function expandProperties(pattern, callback) {\n    (true && !(typeof pattern === 'string') && (0, _debug.assert)(\"A computed property key must be a string, you passed \" + typeof pattern + \" \" + pattern, typeof pattern === 'string'));\n    (true && !(pattern.indexOf(' ') === -1) && (0, _debug.assert)('Brace expanded properties cannot contain spaces, e.g. \"user.{firstName, lastName}\" should be \"user.{firstName,lastName}\"', pattern.indexOf(' ') === -1)); // regex to look for double open, double close, or unclosed braces\n\n    (true && !(pattern.match(/\\{[^}{]*\\{|\\}[^}{]*\\}|\\{[^}]*$/g) === null) && (0, _debug.assert)(\"Brace expanded properties have to be balanced and cannot be nested, pattern: \" + pattern, pattern.match(/\\{[^}{]*\\{|\\}[^}{]*\\}|\\{[^}]*$/g) === null));\n    var start = pattern.indexOf('{');\n\n    if (start < 0) {\n      callback(pattern.replace(END_WITH_EACH_REGEX, '.[]'));\n    } else {\n      dive('', pattern, start, callback);\n    }\n  }\n\n  function dive(prefix, pattern, start, callback) {\n    var end = pattern.indexOf('}'),\n        i = 0,\n        newStart,\n        arrayLength;\n    var tempArr = pattern.substring(start + 1, end).split(',');\n    var after = pattern.substring(end + 1);\n    prefix = prefix + pattern.substring(0, start);\n    arrayLength = tempArr.length;\n\n    while (i < arrayLength) {\n      newStart = after.indexOf('{');\n\n      if (newStart < 0) {\n        callback((prefix + tempArr[i++] + after).replace(END_WITH_EACH_REGEX, '.[]'));\n      } else {\n        dive(prefix + tempArr[i++], after, newStart, callback);\n      }\n    }\n  }\n  /**\n   @module @ember/object\n  */\n\n  /**\n    Sets the value of a property on an object, respecting computed properties\n    and notifying observers and other listeners of the change.\n    If the specified property is not defined on the object and the object\n    implements the `setUnknownProperty` method, then instead of setting the\n    value of the property on the object, its `setUnknownProperty` handler\n    will be invoked with the two parameters `keyName` and `value`.\n  \n    ```javascript\n    import { set } from '@ember/object';\n    set(obj, \"name\", value);\n    ```\n  \n    @method set\n    @static\n    @for @ember/object\n    @param {Object} obj The object to modify.\n    @param {String} keyName The property key to set\n    @param {Object} value The value to set\n    @return {Object} the passed value.\n    @public\n  */\n\n\n  function set(obj, keyName, value$$1, tolerant) {\n    (true && !(arguments.length === 3 || arguments.length === 4) && (0, _debug.assert)(\"Set must be called with three or four arguments; an object, a property key, a value and tolerant true/false\", arguments.length === 3 || arguments.length === 4));\n    (true && !(obj && typeof obj === 'object' || typeof obj === 'function') && (0, _debug.assert)(\"Cannot call set with '\" + keyName + \"' on an undefined object.\", obj && typeof obj === 'object' || typeof obj === 'function'));\n    (true && !(typeof keyName === 'string' || typeof keyName === 'number' && !isNaN(keyName)) && (0, _debug.assert)(\"The key provided to set must be a string or number, you passed \" + keyName, typeof keyName === 'string' || typeof keyName === 'number' && !isNaN(keyName)));\n    (true && !(typeof keyName !== 'string' || keyName.lastIndexOf('this.', 0) !== 0) && (0, _debug.assert)(\"'this' in paths is not supported\", typeof keyName !== 'string' || keyName.lastIndexOf('this.', 0) !== 0));\n\n    if (obj.isDestroyed) {\n      (true && !(tolerant) && (0, _debug.assert)(\"calling set on destroyed object: \" + (0, _utils.toString)(obj) + \".\" + keyName + \" = \" + (0, _utils.toString)(value$$1), tolerant));\n      return;\n    }\n\n    if (isPath(keyName)) {\n      return setPath(obj, keyName, value$$1, tolerant);\n    }\n\n    var meta$$1 = (0, _meta2.peekMeta)(obj);\n    {\n      var descriptor = (0, _utils.lookupDescriptor)(obj, keyName);\n      var setter = descriptor === null ? undefined : descriptor.set;\n\n      if (setter !== undefined && CP_SETTER_FUNCS.has(setter)) {\n        obj[keyName] = value$$1;\n        return value$$1;\n      }\n    }\n    var currentValue;\n\n    if (true\n    /* DEBUG */\n    && _utils.HAS_NATIVE_PROXY) {\n      currentValue = getPossibleMandatoryProxyValue(obj, keyName);\n    } else {\n      currentValue = obj[keyName];\n    }\n\n    if (currentValue === undefined && 'object' === typeof obj && !(keyName in obj) && typeof obj.setUnknownProperty === 'function') {\n      /* unknown property */\n      obj.setUnknownProperty(keyName, value$$1);\n    } else {\n      if (true\n      /* DEBUG */\n      ) {\n        {\n          (0, _utils.setWithMandatorySetter)(obj, keyName, value$$1);\n        }\n      } else {\n        obj[keyName] = value$$1;\n      }\n\n      if (currentValue !== value$$1) {\n        notifyPropertyChange(obj, keyName, meta$$1);\n      }\n    }\n\n    return value$$1;\n  }\n\n  function setPath(root, path, value$$1, tolerant) {\n    var parts = path.split('.');\n    var keyName = parts.pop();\n    (true && !(keyName.trim().length > 0) && (0, _debug.assert)('Property set failed: You passed an empty path', keyName.trim().length > 0));\n\n    var newRoot = _getPath(root, parts);\n\n    if (newRoot !== null && newRoot !== undefined) {\n      return set(newRoot, keyName, value$$1);\n    } else if (!tolerant) {\n      throw new _error.default(\"Property set failed: object in path \\\"\" + parts.join('.') + \"\\\" could not be found.\");\n    }\n  }\n  /**\n    Error-tolerant form of `set`. Will not blow up if any part of the\n    chain is `undefined`, `null`, or destroyed.\n  \n    This is primarily used when syncing bindings, which may try to update after\n    an object has been destroyed.\n  \n    ```javascript\n    import { trySet } from '@ember/object';\n  \n    let obj = { name: \"Zoey\" };\n    trySet(obj, \"contacts.twitter\", \"@emberjs\");\n    ```\n  \n    @method trySet\n    @static\n    @for @ember/object\n    @param {Object} root The object to modify.\n    @param {String} path The property path to set\n    @param {Object} value The value to set\n    @public\n  */\n\n\n  function trySet(root, path, value$$1) {\n    return set(root, path, value$$1, true);\n  }\n  /**\n  @module @ember/object\n  */\n\n\n  var DEEP_EACH_REGEX = /\\.@each\\.[^.]+\\./;\n\n  function noop() {}\n  /**\n    `@computed` is a decorator that turns a JavaScript getter and setter into a\n    computed property, which is a _cached, trackable value_. By default the getter\n    will only be called once and the result will be cached. You can specify\n    various properties that your computed property depends on. This will force the\n    cached result to be cleared if the dependencies are modified, and lazily recomputed the next time something asks for it.\n  \n    In the following example we decorate a getter - `fullName` -  by calling\n    `computed` with the property dependencies (`firstName` and `lastName`) as\n    arguments. The `fullName` getter will be called once (regardless of how many\n    times it is accessed) as long as its dependencies do not change. Once\n    `firstName` or `lastName` are updated any future calls to `fullName` will\n    incorporate the new values, and any watchers of the value such as templates\n    will be updated:\n  \n    ```javascript\n    import { computed, set } from '@ember/object';\n  \n    class Person {\n      constructor(firstName, lastName) {\n        set(this, 'firstName', firstName);\n        set(this, 'lastName', lastName);\n      }\n  \n      @computed('firstName', 'lastName')\n      get fullName() {\n        return `${this.firstName} ${this.lastName}`;\n      }\n    });\n  \n    let tom = new Person('Tom', 'Dale');\n  \n    tom.fullName; // 'Tom Dale'\n    ```\n  \n    You can also provide a setter, which will be used when updating the computed\n    property. Ember's `set` function must be used to update the property\n    since it will also notify observers of the property:\n  \n    ```javascript\n    import { computed, set } from '@ember/object';\n  \n    class Person {\n      constructor(firstName, lastName) {\n        set(this, 'firstName', firstName);\n        set(this, 'lastName', lastName);\n      }\n  \n      @computed('firstName', 'lastName')\n      get fullName() {\n        return `${this.firstName} ${this.lastName}`;\n      }\n  \n      set fullName(value) {\n        let [firstName, lastName] = value.split(' ');\n  \n        set(this, 'firstName', firstName);\n        set(this, 'lastName', lastName);\n      }\n    });\n  \n    let person = new Person();\n  \n    set(person, 'fullName', 'Peter Wagenet');\n    person.firstName; // 'Peter'\n    person.lastName;  // 'Wagenet'\n    ```\n  \n    You can also pass a getter function or object with `get` and `set` functions\n    as the last argument to the computed decorator. This allows you to define\n    computed property _macros_:\n  \n    ```js\n    import { computed } from '@ember/object';\n  \n    function join(...keys) {\n      return computed(...keys, function() {\n        return keys.map(key => this[key]).join(' ');\n      });\n    }\n  \n    class Person {\n      @join('firstName', 'lastName')\n      fullName;\n    }\n    ```\n  \n    Note that when defined this way, getters and setters receive the _key_ of the\n    property they are decorating as the first argument. Setters receive the value\n    they are setting to as the second argument instead. Additionally, setters must\n    _return_ the value that should be cached:\n  \n    ```javascript\n    import { computed, set } from '@ember/object';\n  \n    function fullNameMacro(firstNameKey, lastNameKey) {\n      return computed(firstNameKey, lastNameKey, {\n        get() {\n          return `${this[firstNameKey]} ${this[lastNameKey]}`;\n        }\n  \n        set(key, value) {\n          let [firstName, lastName] = value.split(' ');\n  \n          set(this, firstNameKey, firstName);\n          set(this, lastNameKey, lastName);\n  \n          return value;\n        }\n      });\n    }\n  \n    class Person {\n      constructor(firstName, lastName) {\n        set(this, 'firstName', firstName);\n        set(this, 'lastName', lastName);\n      }\n  \n      @fullNameMacro fullName;\n    });\n  \n    let person = new Person();\n  \n    set(person, 'fullName', 'Peter Wagenet');\n    person.firstName; // 'Peter'\n    person.lastName;  // 'Wagenet'\n    ```\n  \n    Computed properties can also be used in classic classes. To do this, we\n    provide the getter and setter as the last argument like we would for a macro,\n    and we assign it to a property on the class definition. This is an _anonymous_\n    computed macro:\n  \n    ```javascript\n    import EmberObject, { computed, set } from '@ember/object';\n  \n    let Person = EmberObject.extend({\n      // these will be supplied by `create`\n      firstName: null,\n      lastName: null,\n  \n      fullName: computed('firstName', 'lastName', {\n        get() {\n          return `${this.firstName} ${this.lastName}`;\n        }\n  \n        set(key, value) {\n          let [firstName, lastName] = value.split(' ');\n  \n          set(this, 'firstName', firstName);\n          set(this, 'lastName', lastName);\n  \n          return value;\n        }\n      })\n    });\n  \n    let tom = Person.create({\n      firstName: 'Tom',\n      lastName: 'Dale'\n    });\n  \n    tom.get('fullName') // 'Tom Dale'\n    ```\n  \n    You can overwrite computed property without setters with a normal property (no\n    longer computed) that won't change if dependencies change. You can also mark\n    computed property as `.readOnly()` and block all attempts to set it.\n  \n    ```javascript\n    import { computed, set } from '@ember/object';\n  \n    class Person {\n      constructor(firstName, lastName) {\n        set(this, 'firstName', firstName);\n        set(this, 'lastName', lastName);\n      }\n  \n      @computed('firstName', 'lastName').readOnly()\n      get fullName() {\n        return `${this.firstName} ${this.lastName}`;\n      }\n    });\n  \n    let person = new Person();\n    person.set('fullName', 'Peter Wagenet'); // Uncaught Error: Cannot set read-only property \"fullName\" on object: <(...):emberXXX>\n    ```\n  \n    Additional resources:\n    - [Decorators RFC](https://github.com/emberjs/rfcs/blob/master/text/0408-decorators.md)\n    - [New CP syntax RFC](https://github.com/emberjs/rfcs/blob/master/text/0011-improved-cp-syntax.md)\n    - [New computed syntax explained in \"Ember 1.12 released\" ](https://emberjs.com/blog/2015/05/13/ember-1-12-released.html#toc_new-computed-syntax)\n  \n    @class ComputedProperty\n    @public\n  */\n\n\n  class ComputedProperty extends ComputedDescriptor {\n    constructor(args) {\n      super();\n      this._volatile = false;\n      this._readOnly = false;\n      this._suspended = undefined;\n      this._hasConfig = false;\n      this._getter = undefined;\n      this._setter = undefined;\n      var maybeConfig = args[args.length - 1];\n\n      if (typeof maybeConfig === 'function' || maybeConfig !== null && typeof maybeConfig === 'object') {\n        this._hasConfig = true;\n        var config = args.pop();\n\n        if (typeof config === 'function') {\n          (true && !(!isClassicDecorator(config)) && (0, _debug.assert)(\"You attempted to pass a computed property instance to computed(). Computed property instances are decorator functions, and cannot be passed to computed() because they cannot be turned into decorators twice\", !isClassicDecorator(config)));\n          this._getter = config;\n        } else {\n          var objectConfig = config;\n          (true && !(typeof objectConfig === 'object' && !Array.isArray(objectConfig)) && (0, _debug.assert)('computed expects a function or an object as last argument.', typeof objectConfig === 'object' && !Array.isArray(objectConfig)));\n          (true && !(Object.keys(objectConfig).every(key => key === 'get' || key === 'set')) && (0, _debug.assert)('Config object passed to computed can only contain `get` and `set` keys.', Object.keys(objectConfig).every(key => key === 'get' || key === 'set')));\n          (true && !(Boolean(objectConfig.get) || Boolean(objectConfig.set)) && (0, _debug.assert)('Computed properties must receive a getter or a setter, you passed none.', Boolean(objectConfig.get) || Boolean(objectConfig.set)));\n          this._getter = objectConfig.get || noop;\n          this._setter = objectConfig.set;\n        }\n      }\n\n      if (args.length > 0) {\n        this._property(...args);\n      }\n    }\n\n    setup(obj, keyName, propertyDesc, meta$$1) {\n      super.setup(obj, keyName, propertyDesc, meta$$1);\n      (true && !(!(propertyDesc && typeof propertyDesc.value === 'function')) && (0, _debug.assert)(\"@computed can only be used on accessors or fields, attempted to use it with \" + keyName + \" but that was a method. Try converting it to a getter (e.g. `get \" + keyName + \"() {}`)\", !(propertyDesc && typeof propertyDesc.value === 'function')));\n      (true && !(!propertyDesc || !propertyDesc.initializer) && (0, _debug.assert)(\"@computed can only be used on empty fields. \" + keyName + \" has an initial value (e.g. `\" + keyName + \" = someValue`)\", !propertyDesc || !propertyDesc.initializer));\n      (true && !(!(this._hasConfig && propertyDesc && (typeof propertyDesc.get === 'function' || typeof propertyDesc.set === 'function'))) && (0, _debug.assert)(\"Attempted to apply a computed property that already has a getter/setter to a \" + keyName + \", but it is a method or an accessor. If you passed @computed a function or getter/setter (e.g. `@computed({ get() { ... } })`), then it must be applied to a field\", !(this._hasConfig && propertyDesc && (typeof propertyDesc.get === 'function' || typeof propertyDesc.set === 'function'))));\n\n      if (this._hasConfig === false) {\n        (true && !(propertyDesc && (typeof propertyDesc.get === 'function' || typeof propertyDesc.set === 'function')) && (0, _debug.assert)(\"Attempted to use @computed on \" + keyName + \", but it did not have a getter or a setter. You must either pass a get a function or getter/setter to @computed directly (e.g. `@computed({ get() { ... } })`) or apply @computed directly to a getter/setter\", propertyDesc && (typeof propertyDesc.get === 'function' || typeof propertyDesc.set === 'function')));\n        var {\n          get: _get,\n          set: set$$1\n        } = propertyDesc;\n\n        if (_get !== undefined) {\n          this._getter = _get;\n        }\n\n        if (set$$1 !== undefined) {\n          this._setter = function setterWrapper(_key, value$$1) {\n            var ret = set$$1.call(this, value$$1);\n\n            if (_get !== undefined) {\n              return typeof ret === 'undefined' ? _get.call(this) : ret;\n            }\n\n            return ret;\n          };\n        }\n      }\n    }\n    /**\n      Call on a computed property to set it into non-cached mode. When in this\n      mode the computed property will not automatically cache the return value.\n      It also does not automatically fire any change events. You must manually notify\n      any changes if you want to observe this property.\n      Dependency keys have no effect on volatile properties as they are for cache\n      invalidation and notification when cached value is invalidated.\n      ```javascript\n      import EmberObject, { computed } from '@ember/object';\n      let outsideService = EmberObject.extend({\n        value: computed(function() {\n          return OutsideService.getValue();\n        }).volatile()\n      }).create();\n      ```\n      @method volatile\n      @return {ComputedProperty} this\n      @chainable\n      @public\n    */\n\n\n    volatile() {\n      (true && !(false) && (0, _debug.deprecate)('Setting a computed property as volatile has been deprecated. Instead, consider using a native getter with native class syntax.', false, {\n        id: 'computed-property.volatile',\n        until: '4.0.0',\n        url: 'https://emberjs.com/deprecations/v3.x#toc_computed-property-volatile'\n      }));\n      this._volatile = true;\n    }\n    /**\n      Call on a computed property to set it into read-only mode. When in this\n      mode the computed property will throw an error when set.\n      ```javascript\n      import EmberObject, { computed } from '@ember/object';\n      let Person = EmberObject.extend({\n        guid: computed(function() {\n          return 'guid-guid-guid';\n        }).readOnly()\n      });\n      let person = Person.create();\n      person.set('guid', 'new-guid'); // will throw an exception\n      ```\n      @method readOnly\n      @return {ComputedProperty} this\n      @chainable\n      @public\n    */\n\n\n    readOnly() {\n      this._readOnly = true;\n      (true && !(!(this._readOnly && this._setter && this._setter !== this._getter)) && (0, _debug.assert)('Computed properties that define a setter using the new syntax cannot be read-only', !(this._readOnly && this._setter && this._setter !== this._getter)));\n    }\n    /**\n      Sets the dependent keys on this computed property. Pass any number of\n      arguments containing key paths that this computed property depends on.\n      ```javascript\n      import EmberObject, { computed } from '@ember/object';\n      let President = EmberObject.extend({\n        fullName: computed('firstName', 'lastName', function() {\n          return this.get('firstName') + ' ' + this.get('lastName');\n          // Tell Ember that this computed property depends on firstName\n          // and lastName\n        })\n      });\n      let president = President.create({\n        firstName: 'Barack',\n        lastName: 'Obama'\n      });\n      president.get('fullName'); // 'Barack Obama'\n      ```\n      @method property\n      @param {String} path* zero or more property paths\n      @return {ComputedProperty} this\n      @chainable\n      @public\n    */\n\n\n    property(...passedArgs) {\n      (true && !(false) && (0, _debug.deprecate)('Setting dependency keys using the `.property()` modifier has been deprecated. Pass the dependency keys directly to computed as arguments instead. If you are using `.property()` on a computed property macro, consider refactoring your macro to receive additional dependent keys in its initial declaration.', false, {\n        id: 'computed-property.property',\n        until: '4.0.0',\n        url: 'https://emberjs.com/deprecations/v3.x#toc_computed-property-property'\n      }));\n\n      this._property(...passedArgs);\n    }\n\n    _property(...passedArgs) {\n      var args = [];\n\n      function addArg(property) {\n        (true && (0, _debug.warn)(\"Dependent keys containing @each only work one level deep. \" + (\"You used the key \\\"\" + property + \"\\\" which is invalid. \") + \"Please create an intermediary computed property.\", DEEP_EACH_REGEX.test(property) === false, {\n          id: 'ember-metal.computed-deep-each'\n        }));\n        args.push(property);\n      }\n\n      for (var i = 0; i < passedArgs.length; i++) {\n        expandProperties(passedArgs[i], addArg);\n      }\n\n      this._dependentKeys = args;\n    }\n    /**\n      In some cases, you may want to annotate computed properties with additional\n      metadata about how they function or what values they operate on. For example,\n      computed property functions may close over variables that are then no longer\n      available for introspection.\n      You can pass a hash of these values to a computed property like this:\n      ```\n      import { computed } from '@ember/object';\n      import Person from 'my-app/utils/person';\n      person: computed(function() {\n        let personId = this.get('personId');\n        return Person.create({ id: personId });\n      }).meta({ type: Person })\n      ```\n      The hash that you pass to the `meta()` function will be saved on the\n      computed property descriptor under the `_meta` key. Ember runtime\n      exposes a public API for retrieving these values from classes,\n      via the `metaForProperty()` function.\n      @method meta\n      @param {Object} meta\n      @chainable\n      @public\n    */\n    // invalidate cache when CP key changes\n\n\n    didChange(obj, keyName) {\n      // _suspended is set via a CP.set to ensure we don't clear\n      // the cached value set by the setter\n      if (this._volatile || this._suspended === obj) {\n        return;\n      } // don't create objects just to invalidate\n\n\n      var meta$$1 = (0, _meta2.peekMeta)(obj);\n\n      if (meta$$1 === null || meta$$1.source !== obj) {\n        return;\n      }\n\n      var cache = peekCacheFor(obj);\n\n      if (cache !== undefined && cache.delete(keyName)) {\n        removeDependentKeys(this, obj, keyName, meta$$1);\n      }\n    }\n\n    get(obj, keyName) {\n      if (this._volatile) {\n        return this._getter.call(obj, keyName);\n      }\n\n      var cache = getCacheFor(obj);\n      {\n        var propertyTag = tagForProperty(obj, keyName);\n        var ret;\n\n        if (cache.has(keyName) && (0, _reference.validate)(propertyTag, getLastRevisionFor(obj, keyName))) {\n          ret = cache.get(keyName);\n        } else {\n          // For backwards compatibility, we only throw if the CP has any dependencies. CPs without dependencies\n          // should be allowed, even after the object has been destroyed, which is why we check _dependentKeys.\n          (true && !(this._dependentKeys === undefined || !(0, _meta2.meta)(obj).isMetaDestroyed()) && (0, _debug.assert)(\"Attempted to access the computed \" + obj + \".\" + keyName + \" on a destroyed object, which is not allowed\", this._dependentKeys === undefined || !(0, _meta2.meta)(obj).isMetaDestroyed()));\n          var upstreamTag = undefined;\n\n          if (this._auto === true) {\n            upstreamTag = track(() => {\n              ret = this._getter.call(obj, keyName);\n            });\n          } else {\n            // Create a tracker that absorbs any trackable actions inside the CP\n            untrack(() => {\n              ret = this._getter.call(obj, keyName);\n            });\n          }\n\n          if (this._dependentKeys !== undefined) {\n            var tag = (0, _reference.combine)(getChainTagsForKeys(obj, this._dependentKeys));\n            upstreamTag = upstreamTag === undefined ? tag : (0, _reference.combine)([upstreamTag, tag]);\n          }\n\n          if (upstreamTag !== undefined) {\n            (0, _reference.update)(propertyTag, upstreamTag);\n          }\n\n          setLastRevisionFor(obj, keyName, (0, _reference.value)(propertyTag));\n          cache.set(keyName, ret);\n          finishLazyChains(obj, keyName, ret);\n        }\n\n        consume(propertyTag); // Add the tag of the returned value if it is an array, since arrays\n        // should always cause updates if they are consumed and then changed\n\n        if (Array.isArray(ret) || (0, _utils.isEmberArray)(ret)) {\n          consume(tagForProperty(ret, '[]'));\n        }\n\n        return ret;\n      }\n    }\n\n    set(obj, keyName, value$$1) {\n      if (this._readOnly) {\n        this._throwReadOnlyError(obj, keyName);\n      }\n\n      if (!this._setter) {\n        return this.clobberSet(obj, keyName, value$$1);\n      }\n\n      if (this._volatile) {\n        return this.volatileSet(obj, keyName, value$$1);\n      }\n\n      {\n        var ret;\n\n        try {\n          beginPropertyChanges();\n          ret = this._set(obj, keyName, value$$1);\n          finishLazyChains(obj, keyName, ret);\n          var propertyTag = tagForProperty(obj, keyName);\n\n          if (this._dependentKeys !== undefined) {\n            (0, _reference.update)(propertyTag, (0, _reference.combine)(getChainTagsForKeys(obj, this._dependentKeys)));\n          }\n\n          setLastRevisionFor(obj, keyName, (0, _reference.value)(propertyTag));\n        } finally {\n          endPropertyChanges();\n        }\n\n        return ret;\n      }\n    }\n\n    _throwReadOnlyError(obj, keyName) {\n      throw new _error.default(\"Cannot set read-only property \\\"\" + keyName + \"\\\" on object: \" + (0, _utils.inspect)(obj));\n    }\n\n    clobberSet(obj, keyName, value$$1) {\n      (true && !(false) && (0, _debug.deprecate)(\"The \" + (0, _utils.toString)(obj) + \"#\" + keyName + \" computed property was just overriden. This removes the computed property and replaces it with a plain value, and has been deprecated. If you want this behavior, consider defining a setter which does it manually.\", false, {\n        id: 'computed-property.override',\n        until: '4.0.0',\n        url: 'https://emberjs.com/deprecations/v3.x#toc_computed-property-override'\n      }));\n      var cachedValue = getCachedValueFor(obj, keyName);\n      defineProperty(obj, keyName, null, cachedValue);\n      set(obj, keyName, value$$1);\n      return value$$1;\n    }\n\n    volatileSet(obj, keyName, value$$1) {\n      return this._setter.call(obj, keyName, value$$1);\n    }\n\n    setWithSuspend(obj, keyName, value$$1) {\n      var oldSuspended = this._suspended;\n      this._suspended = obj;\n\n      try {\n        return this._set(obj, keyName, value$$1);\n      } finally {\n        this._suspended = oldSuspended;\n      }\n    }\n\n    _set(obj, keyName, value$$1) {\n      var cache = getCacheFor(obj);\n      var hadCachedValue = cache.has(keyName);\n      var cachedValue = cache.get(keyName);\n      var ret;\n      {\n        setObserverSuspended(obj, keyName, true);\n\n        try {\n          ret = this._setter.call(obj, keyName, value$$1, cachedValue);\n        } finally {\n          setObserverSuspended(obj, keyName, false);\n        }\n      } // allows setter to return the same value that is cached already\n\n      if (hadCachedValue && cachedValue === ret) {\n        return ret;\n      }\n\n      var meta$$1 = (0, _meta2.meta)(obj);\n      cache.set(keyName, ret);\n      notifyPropertyChange(obj, keyName, meta$$1);\n      return ret;\n    }\n    /* called before property is overridden */\n\n\n    teardown(obj, keyName, meta$$1) {\n      if (!this._volatile) {\n        var cache = peekCacheFor(obj);\n\n        if (cache !== undefined && cache.delete(keyName)) {\n          removeDependentKeys(this, obj, keyName, meta$$1);\n        }\n      }\n\n      super.teardown(obj, keyName, meta$$1);\n    }\n\n  }\n\n  _exports.ComputedProperty = ComputedProperty;\n  {\n    ComputedProperty.prototype.auto = function () {\n      this._auto = true;\n    };\n  } // TODO: This class can be svelted once `meta` has been deprecated\n\n  class ComputedDecoratorImpl extends Function {\n    readOnly() {\n      descriptorForDecorator(this).readOnly();\n      return this;\n    }\n\n    volatile() {\n      descriptorForDecorator(this).volatile();\n      return this;\n    }\n\n    property(...keys) {\n      descriptorForDecorator(this).property(...keys);\n      return this;\n    }\n\n    meta(meta$$1) {\n      var prop = descriptorForDecorator(this);\n\n      if (arguments.length === 0) {\n        return prop._meta || {};\n      } else {\n        prop._meta = meta$$1;\n        return this;\n      }\n    } // TODO: Remove this when we can provide alternatives in the ecosystem to\n    // addons such as ember-macro-helpers that use it.\n\n\n    get _getter() {\n      return descriptorForDecorator(this)._getter;\n    } // TODO: Refactor this, this is an internal API only\n\n\n    set enumerable(value$$1) {\n      descriptorForDecorator(this).enumerable = value$$1;\n    }\n\n  }\n\n  function computed(...args) {\n    (true && !(!(isElementDescriptor(args.slice(0, 3)) && args.length === 5 && args[4] === true)) && (0, _debug.assert)(\"@computed can only be used directly as a native decorator. If you're using tracked in classic classes, add parenthesis to call it like a function: computed()\", !(isElementDescriptor(args.slice(0, 3)) && args.length === 5 && args[4] === true)));\n\n    if (isElementDescriptor(args)) {\n      var decorator = makeComputedDecorator(new ComputedProperty([]), ComputedDecoratorImpl);\n      return decorator(args[0], args[1], args[2]);\n    }\n\n    return makeComputedDecorator(new ComputedProperty(args), ComputedDecoratorImpl);\n  }\n  /**\n    Allows checking if a given property on an object is a computed property. For the most part,\n    this doesn't matter (you would normally just access the property directly and use its value),\n    but for some tooling specific scenarios (e.g. the ember-inspector) it is important to\n    differentiate if a property is a computed property or a \"normal\" property.\n  \n    This will work on either a class's prototype or an instance itself.\n  \n    @static\n    @method isComputed\n    @for @ember/debug\n    @private\n   */\n\n\n  function isComputed(obj, key) {\n    return Boolean(descriptorForProperty(obj, key));\n  }\n\n  var _globalsComputed = computed.bind(null);\n\n  _exports._globalsComputed = _globalsComputed;\n  var CONSUMED = Object.freeze({});\n\n  function alias(altKey) {\n    (true && !(!isElementDescriptor(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @alias as a decorator directly, but it requires a `altKey` parameter', !isElementDescriptor(Array.prototype.slice.call(arguments))));\n    return makeComputedDecorator(new AliasedProperty(altKey), AliasDecoratorImpl);\n  } // TODO: This class can be svelted once `meta` has been deprecated\n\n\n  class AliasDecoratorImpl extends Function {\n    readOnly() {\n      descriptorForDecorator(this).readOnly();\n      return this;\n    }\n\n    oneWay() {\n      descriptorForDecorator(this).oneWay();\n      return this;\n    }\n\n    meta(meta$$1) {\n      var prop = descriptorForDecorator(this);\n\n      if (arguments.length === 0) {\n        return prop._meta || {};\n      } else {\n        prop._meta = meta$$1;\n      }\n    }\n\n  }\n\n  class AliasedProperty extends ComputedDescriptor {\n    constructor(altKey) {\n      super();\n      this.altKey = altKey;\n    }\n\n    setup(obj, keyName, propertyDesc, meta$$1) {\n      (true && !(this.altKey !== keyName) && (0, _debug.assert)(\"Setting alias '\" + keyName + \"' on self\", this.altKey !== keyName));\n      super.setup(obj, keyName, propertyDesc, meta$$1);\n    }\n\n    teardown(obj, keyName, meta$$1) {\n      super.teardown(obj, keyName, meta$$1);\n    }\n\n    willWatch(obj, keyName, meta$$1) {}\n\n    get(obj, keyName) {\n      var ret;\n      {\n        var propertyTag = tagForProperty(obj, keyName); // We don't use the tag since CPs are not automatic, we just want to avoid\n        // anything tracking while we get the altKey\n\n        untrack(() => {\n          ret = get(obj, this.altKey);\n        });\n        var lastRevision = getLastRevisionFor(obj, keyName);\n\n        if (!(0, _reference.validate)(propertyTag, lastRevision)) {\n          (0, _reference.update)(propertyTag, (0, _reference.combine)(getChainTagsForKey(obj, this.altKey)));\n          setLastRevisionFor(obj, keyName, (0, _reference.value)(propertyTag));\n          finishLazyChains(obj, keyName, ret);\n        }\n\n        consume(propertyTag);\n      }\n      return ret;\n    }\n\n    unconsume(obj, keyName, meta$$1) {\n      var wasConsumed = getCachedValueFor(obj, keyName) === CONSUMED;\n\n      if (wasConsumed || meta$$1.peekWatching(keyName) > 0) {\n        removeDependentKeys(this, obj, keyName, meta$$1);\n      }\n\n      if (wasConsumed) {\n        getCacheFor(obj).delete(keyName);\n      }\n    }\n\n    consume(obj, keyName, meta$$1) {\n      var cache = getCacheFor(obj);\n\n      if (cache.get(keyName) !== CONSUMED) {\n        cache.set(keyName, CONSUMED);\n        addDependentKeys(this, obj, keyName, meta$$1);\n      }\n    }\n\n    set(obj, _keyName, value$$1) {\n      return set(obj, this.altKey, value$$1);\n    }\n\n    readOnly() {\n      this.set = AliasedProperty_readOnlySet;\n    }\n\n    oneWay() {\n      this.set = AliasedProperty_oneWaySet;\n    }\n\n  }\n\n  function AliasedProperty_readOnlySet(obj, keyName) {\n    // eslint-disable-line no-unused-vars\n    throw new _error.default(\"Cannot set read-only property '\" + keyName + \"' on object: \" + (0, _utils.inspect)(obj));\n  }\n\n  function AliasedProperty_oneWaySet(obj, keyName, value$$1) {\n    defineProperty(obj, keyName, null);\n    return set(obj, keyName, value$$1);\n  }\n  /**\n  @module ember\n  */\n\n  /**\n    Used internally to allow changing properties in a backwards compatible way, and print a helpful\n    deprecation warning.\n  \n    @method deprecateProperty\n    @param {Object} object The object to add the deprecated property to.\n    @param {String} deprecatedKey The property to add (and print deprecation warnings upon accessing).\n    @param {String} newKey The property that will be aliased.\n    @private\n    @since 1.7.0\n  */\n\n\n  function deprecateProperty(object, deprecatedKey, newKey, options) {\n    function _deprecate() {\n      (true && !(false) && (0, _debug.deprecate)(\"Usage of `\" + deprecatedKey + \"` is deprecated, use `\" + newKey + \"` instead.\", false, options));\n    }\n\n    Object.defineProperty(object, deprecatedKey, {\n      configurable: true,\n      enumerable: false,\n\n      set(value$$1) {\n        _deprecate();\n\n        set(this, newKey, value$$1);\n      },\n\n      get() {\n        _deprecate();\n\n        return get(this, newKey);\n      }\n\n    });\n  }\n  /**\n   @module @ember/utils\n  */\n\n  /**\n    Returns true if the passed value is null or undefined. This avoids errors\n    from JSLint complaining about use of ==, which can be technically\n    confusing.\n  \n    ```javascript\n    isNone();              // true\n    isNone(null);          // true\n    isNone(undefined);     // true\n    isNone('');            // false\n    isNone([]);            // false\n    isNone(function() {}); // false\n    ```\n  \n    @method isNone\n    @static\n    @for @ember/utils\n    @param {Object} obj Value to test\n    @return {Boolean}\n    @public\n  */\n\n\n  function isNone(obj) {\n    return obj === null || obj === undefined;\n  }\n  /**\n   @module @ember/utils\n  */\n\n  /**\n    Verifies that a value is `null` or `undefined`, an empty string, or an empty\n    array.\n  \n    Constrains the rules on `isNone` by returning true for empty strings and\n    empty arrays.\n  \n    If the value is an object with a `size` property of type number, it is used\n    to check emptiness.\n  \n    ```javascript\n    isEmpty();                 // true\n    isEmpty(null);             // true\n    isEmpty(undefined);        // true\n    isEmpty('');               // true\n    isEmpty([]);               // true\n    isEmpty({ size: 0});       // true\n    isEmpty({});               // false\n    isEmpty('Adam Hawkins');   // false\n    isEmpty([0,1,2]);          // false\n    isEmpty('\\n\\t');           // false\n    isEmpty('  ');             // false\n    isEmpty({ size: 1 })       // false\n    isEmpty({ size: () => 0 }) // false\n    ```\n  \n    @method isEmpty\n    @static\n    @for @ember/utils\n    @param {Object} obj Value to test\n    @return {Boolean}\n    @public\n  */\n\n\n  function isEmpty(obj) {\n    var none = obj === null || obj === undefined;\n\n    if (none) {\n      return none;\n    }\n\n    if (typeof obj.size === 'number') {\n      return !obj.size;\n    }\n\n    var objectType = typeof obj;\n\n    if (objectType === 'object') {\n      var size = get(obj, 'size');\n\n      if (typeof size === 'number') {\n        return !size;\n      }\n    }\n\n    if (typeof obj.length === 'number' && objectType !== 'function') {\n      return !obj.length;\n    }\n\n    if (objectType === 'object') {\n      var length = get(obj, 'length');\n\n      if (typeof length === 'number') {\n        return !length;\n      }\n    }\n\n    return false;\n  }\n  /**\n   @module @ember/utils\n  */\n\n  /**\n    A value is blank if it is empty or a whitespace string.\n  \n    ```javascript\n    import { isBlank } from '@ember/utils';\n  \n    isBlank();                // true\n    isBlank(null);            // true\n    isBlank(undefined);       // true\n    isBlank('');              // true\n    isBlank([]);              // true\n    isBlank('\\n\\t');          // true\n    isBlank('  ');            // true\n    isBlank({});              // false\n    isBlank('\\n\\t Hello');    // false\n    isBlank('Hello world');   // false\n    isBlank([1,2,3]);         // false\n    ```\n  \n    @method isBlank\n    @static\n    @for @ember/utils\n    @param {Object} obj Value to test\n    @return {Boolean}\n    @since 1.5.0\n    @public\n  */\n\n\n  function isBlank(obj) {\n    return isEmpty(obj) || typeof obj === 'string' && /\\S/.test(obj) === false;\n  }\n  /**\n   @module @ember/utils\n  */\n\n  /**\n    A value is present if it not `isBlank`.\n  \n    ```javascript\n    isPresent();                // false\n    isPresent(null);            // false\n    isPresent(undefined);       // false\n    isPresent('');              // false\n    isPresent('  ');            // false\n    isPresent('\\n\\t');          // false\n    isPresent([]);              // false\n    isPresent({ length: 0 });   // false\n    isPresent(false);           // true\n    isPresent(true);            // true\n    isPresent('string');        // true\n    isPresent(0);               // true\n    isPresent(function() {});   // true\n    isPresent({});              // true\n    isPresent('\\n\\t Hello');    // true\n    isPresent([1, 2, 3]);       // true\n    ```\n  \n    @method isPresent\n    @static\n    @for @ember/utils\n    @param {Object} obj Value to test\n    @return {Boolean}\n    @since 1.8.0\n    @public\n  */\n\n\n  function isPresent(obj) {\n    return !isBlank(obj);\n  }\n  /**\n   @module ember\n  */\n\n  /**\n    Helper class that allows you to register your library with Ember.\n  \n    Singleton created at `Ember.libraries`.\n  \n    @class Libraries\n    @constructor\n    @private\n  */\n\n\n  class Libraries {\n    constructor() {\n      this._registry = [];\n      this._coreLibIndex = 0;\n    }\n\n    _getLibraryByName(name) {\n      var libs = this._registry;\n      var count = libs.length;\n\n      for (var i = 0; i < count; i++) {\n        if (libs[i].name === name) {\n          return libs[i];\n        }\n      }\n\n      return undefined;\n    }\n\n    register(name, version, isCoreLibrary) {\n      var index = this._registry.length;\n\n      if (!this._getLibraryByName(name)) {\n        if (isCoreLibrary) {\n          index = this._coreLibIndex++;\n        }\n\n        this._registry.splice(index, 0, {\n          name,\n          version\n        });\n      } else {\n        (true && (0, _debug.warn)(\"Library \\\"\" + name + \"\\\" is already registered with Ember.\", false, {\n          id: 'ember-metal.libraries-register'\n        }));\n      }\n    }\n\n    registerCoreLibrary(name, version) {\n      this.register(name, version, true);\n    }\n\n    deRegister(name) {\n      var lib = this._getLibraryByName(name);\n\n      var index;\n\n      if (lib) {\n        index = this._registry.indexOf(lib);\n\n        this._registry.splice(index, 1);\n      }\n    }\n\n  }\n\n  _exports.Libraries = Libraries;\n\n  if (true\n  /* DEBUG */\n  ) {\n    Libraries.prototype.logVersions = function () {\n      var libs = this._registry;\n      var nameLengths = libs.map(item => get(item, 'name.length'));\n      var maxNameLength = Math.max.apply(null, nameLengths);\n      (0, _debug.debug)('-------------------------------');\n\n      for (var i = 0; i < libs.length; i++) {\n        var lib = libs[i];\n        var spaces = new Array(maxNameLength - lib.name.length + 1).join(' ');\n        (0, _debug.debug)([lib.name, spaces, ' : ', lib.version].join(''));\n      }\n\n      (0, _debug.debug)('-------------------------------');\n    };\n  }\n\n  var LIBRARIES = new Libraries();\n  _exports.libraries = LIBRARIES;\n  LIBRARIES.registerCoreLibrary('Ember', _version.default);\n  /**\n   @module @ember/object\n  */\n\n  /**\n    To get multiple properties at once, call `getProperties`\n    with an object followed by a list of strings or an array:\n  \n    ```javascript\n    import { getProperties } from '@ember/object';\n  \n    getProperties(record, 'firstName', 'lastName', 'zipCode');\n    // { firstName: 'John', lastName: 'Doe', zipCode: '10011' }\n    ```\n  \n    is equivalent to:\n  \n    ```javascript\n    import { getProperties } from '@ember/object';\n  \n    getProperties(record, ['firstName', 'lastName', 'zipCode']);\n    // { firstName: 'John', lastName: 'Doe', zipCode: '10011' }\n    ```\n  \n    @method getProperties\n    @static\n    @for @ember/object\n    @param {Object} obj\n    @param {String...|Array} list of keys to get\n    @return {Object}\n    @public\n  */\n\n  function getProperties(obj, keys) {\n    var ret = {};\n    var propertyNames = arguments;\n    var i = 1;\n\n    if (arguments.length === 2 && Array.isArray(keys)) {\n      i = 0;\n      propertyNames = arguments[1];\n    }\n\n    for (; i < propertyNames.length; i++) {\n      ret[propertyNames[i]] = get(obj, propertyNames[i]);\n    }\n\n    return ret;\n  }\n  /**\n   @module @ember/object\n  */\n\n  /**\n    Set a list of properties on an object. These properties are set inside\n    a single `beginPropertyChanges` and `endPropertyChanges` batch, so\n    observers will be buffered.\n  \n    ```javascript\n    import EmberObject from '@ember/object';\n    let anObject = EmberObject.create();\n  \n    anObject.setProperties({\n      firstName: 'Stanley',\n      lastName: 'Stuart',\n      age: 21\n    });\n    ```\n  \n    @method setProperties\n    @static\n    @for @ember/object\n    @param obj\n    @param {Object} properties\n    @return properties\n    @public\n  */\n\n\n  function setProperties(obj, properties) {\n    if (properties === null || typeof properties !== 'object') {\n      return properties;\n    }\n\n    changeProperties(() => {\n      var props = Object.keys(properties);\n      var propertyName;\n\n      for (var i = 0; i < props.length; i++) {\n        propertyName = props[i];\n        set(obj, propertyName, properties[propertyName]);\n      }\n    });\n    return properties;\n  } // move into its own package\n  // it is needed by Mixin for classToString\n  // maybe move it into environment\n\n\n  var hasOwnProperty = Object.prototype.hasOwnProperty;\n  var searchDisabled = false;\n  var flags = {\n    _set: 0,\n    _unprocessedNamespaces: false,\n\n    get unprocessedNamespaces() {\n      return this._unprocessedNamespaces;\n    },\n\n    set unprocessedNamespaces(v) {\n      this._set++;\n      this._unprocessedNamespaces = v;\n    }\n\n  };\n  var unprocessedMixins = false;\n  var NAMESPACES = [];\n  _exports.NAMESPACES = NAMESPACES;\n  var NAMESPACES_BY_ID = Object.create(null);\n  _exports.NAMESPACES_BY_ID = NAMESPACES_BY_ID;\n\n  function addNamespace(namespace) {\n    flags.unprocessedNamespaces = true;\n    NAMESPACES.push(namespace);\n  }\n\n  function removeNamespace(namespace) {\n    var name = (0, _utils.getName)(namespace);\n    delete NAMESPACES_BY_ID[name];\n    NAMESPACES.splice(NAMESPACES.indexOf(namespace), 1);\n\n    if (name in _environment.context.lookup && namespace === _environment.context.lookup[name]) {\n      _environment.context.lookup[name] = undefined;\n    }\n  }\n\n  function findNamespaces() {\n    if (!flags.unprocessedNamespaces) {\n      return;\n    }\n\n    var lookup = _environment.context.lookup;\n    var keys = Object.keys(lookup);\n\n    for (var i = 0; i < keys.length; i++) {\n      var key = keys[i]; // Only process entities that start with uppercase A-Z\n\n      if (!isUppercase(key.charCodeAt(0))) {\n        continue;\n      }\n\n      var obj = tryIsNamespace(lookup, key);\n\n      if (obj) {\n        (0, _utils.setName)(obj, key);\n      }\n    }\n  }\n\n  function findNamespace(name) {\n    if (!searchDisabled) {\n      processAllNamespaces();\n    }\n\n    return NAMESPACES_BY_ID[name];\n  }\n\n  function processNamespace(namespace) {\n    _processNamespace([namespace.toString()], namespace, new Set());\n  }\n\n  function processAllNamespaces() {\n    var unprocessedNamespaces = flags.unprocessedNamespaces;\n\n    if (unprocessedNamespaces) {\n      findNamespaces();\n      flags.unprocessedNamespaces = false;\n    }\n\n    if (unprocessedNamespaces || unprocessedMixins) {\n      var namespaces = NAMESPACES;\n\n      for (var i = 0; i < namespaces.length; i++) {\n        processNamespace(namespaces[i]);\n      }\n\n      unprocessedMixins = false;\n    }\n  }\n\n  function classToString() {\n    var name = (0, _utils.getName)(this);\n\n    if (name !== void 0) {\n      return name;\n    }\n\n    name = calculateToString(this);\n    (0, _utils.setName)(this, name);\n    return name;\n  }\n\n  function isSearchDisabled() {\n    return searchDisabled;\n  }\n\n  function setSearchDisabled(flag) {\n    searchDisabled = Boolean(flag);\n  }\n\n  function setUnprocessedMixins() {\n    unprocessedMixins = true;\n  }\n\n  function _processNamespace(paths, root, seen) {\n    var idx = paths.length;\n    var id = paths.join('.');\n    NAMESPACES_BY_ID[id] = root;\n    (0, _utils.setName)(root, id); // Loop over all of the keys in the namespace, looking for classes\n\n    for (var key in root) {\n      if (!hasOwnProperty.call(root, key)) {\n        continue;\n      }\n\n      var obj = root[key]; // If we are processing the `Ember` namespace, for example, the\n      // `paths` will start with `[\"Ember\"]`. Every iteration through\n      // the loop will update the **second** element of this list with\n      // the key, so processing `Ember.View` will make the Array\n      // `['Ember', 'View']`.\n\n      paths[idx] = key; // If we have found an unprocessed class\n\n      if (obj && obj.toString === classToString && (0, _utils.getName)(obj) === void 0) {\n        // Replace the class' `toString` with the dot-separated path\n        (0, _utils.setName)(obj, paths.join('.')); // Support nested namespaces\n      } else if (obj && obj.isNamespace) {\n        // Skip aliased namespaces\n        if (seen.has(obj)) {\n          continue;\n        }\n\n        seen.add(obj); // Process the child namespace\n\n        _processNamespace(paths, obj, seen);\n      }\n    }\n\n    paths.length = idx; // cut out last item\n  }\n\n  function isUppercase(code) {\n    return code >= 65 && code <= 90 // A\n    ; // Z\n  }\n\n  function tryIsNamespace(lookup, prop) {\n    try {\n      var obj = lookup[prop];\n      return (obj !== null && typeof obj === 'object' || typeof obj === 'function') && obj.isNamespace && obj;\n    } catch (e) {// continue\n    }\n  }\n\n  function calculateToString(target) {\n    var str;\n\n    if (!searchDisabled) {\n      processAllNamespaces();\n      str = (0, _utils.getName)(target);\n\n      if (str !== void 0) {\n        return str;\n      }\n\n      var superclass = target;\n\n      do {\n        superclass = Object.getPrototypeOf(superclass);\n\n        if (superclass === Function.prototype || superclass === Object.prototype) {\n          break;\n        }\n\n        str = (0, _utils.getName)(target);\n\n        if (str !== void 0) {\n          str = \"(subclass of \" + str + \")\";\n          break;\n        }\n      } while (str === void 0);\n    }\n\n    return str || '(unknown)';\n  }\n  /**\n  @module @ember/object\n  */\n\n\n  var a_concat = Array.prototype.concat;\n  var {\n    isArray\n  } = Array;\n\n  function isMethod(obj) {\n    return 'function' === typeof obj && obj.isMethod !== false && obj !== Boolean && obj !== Object && obj !== Number && obj !== Array && obj !== Date && obj !== String;\n  }\n\n  function isAccessor(desc) {\n    return typeof desc.get === 'function' || typeof desc.set === 'function';\n  }\n\n  function extractAccessors(properties) {\n    if (properties !== undefined) {\n      var descriptors = (0, _utils.getOwnPropertyDescriptors)(properties);\n      var keys = Object.keys(descriptors);\n      var hasAccessors = keys.some(key => isAccessor(descriptors[key]));\n\n      if (hasAccessors) {\n        var extracted = {};\n        keys.forEach(key => {\n          var descriptor = descriptors[key];\n\n          if (isAccessor(descriptor)) {\n            extracted[key] = nativeDescDecorator(descriptor);\n          } else {\n            extracted[key] = properties[key];\n          }\n        });\n        return extracted;\n      }\n    }\n\n    return properties;\n  }\n\n  var CONTINUE = {};\n\n  function mixinProperties(mixinsMeta, mixin) {\n    if (mixin instanceof Mixin) {\n      if (mixinsMeta.hasMixin(mixin)) {\n        return CONTINUE;\n      }\n\n      mixinsMeta.addMixin(mixin);\n      return mixin.properties;\n    } else {\n      return mixin; // apply anonymous mixin properties\n    }\n  }\n\n  function concatenatedMixinProperties(concatProp, props, values, base) {\n    // reset before adding each new mixin to pickup concats from previous\n    var concats = values[concatProp] || base[concatProp];\n\n    if (props[concatProp]) {\n      concats = concats ? a_concat.call(concats, props[concatProp]) : props[concatProp];\n    }\n\n    return concats;\n  }\n\n  function giveDecoratorSuper(meta$$1, key, decorator, values, descs, base) {\n    var property = descriptorForDecorator(decorator);\n    var superProperty;\n\n    if (!(property instanceof ComputedProperty) || property._getter === undefined) {\n      return decorator;\n    } // Computed properties override methods, and do not call super to them\n\n\n    if (values[key] === undefined) {\n      // Find the original descriptor in a parent mixin\n      superProperty = descriptorForDecorator(descs[key]);\n    } // If we didn't find the original descriptor in a parent mixin, find\n    // it on the original object.\n\n\n    if (!superProperty) {\n      superProperty = descriptorForProperty(base, key, meta$$1);\n    }\n\n    if (superProperty === undefined || !(superProperty instanceof ComputedProperty)) {\n      return decorator;\n    }\n\n    var get = (0, _utils.wrap)(property._getter, superProperty._getter);\n    var set;\n\n    if (superProperty._setter) {\n      if (property._setter) {\n        set = (0, _utils.wrap)(property._setter, superProperty._setter);\n      } else {\n        // If the super property has a setter, we default to using it no matter what.\n        // This is clearly very broken and weird, but it's what was here so we have\n        // to keep it until the next major at least.\n        //\n        // TODO: Add a deprecation here.\n        set = superProperty._setter;\n      }\n    } else {\n      set = property._setter;\n    } // only create a new CP if we must\n\n\n    if (get !== property._getter || set !== property._setter) {\n      // Since multiple mixins may inherit from the same parent, we need\n      // to clone the computed property so that other mixins do not receive\n      // the wrapped version.\n      var newProperty = Object.create(property);\n      newProperty._getter = get;\n      newProperty._setter = set;\n      return makeComputedDecorator(newProperty, ComputedProperty);\n    }\n\n    return decorator;\n  }\n\n  function giveMethodSuper(obj, key, method, values, descs) {\n    // Methods overwrite computed properties, and do not call super to them.\n    if (descs[key] !== undefined) {\n      return method;\n    } // Find the original method in a parent mixin\n\n\n    var superMethod = values[key]; // If we didn't find the original value in a parent mixin, find it in\n    // the original object\n\n    if (superMethod === undefined && descriptorForProperty(obj, key) === undefined) {\n      superMethod = obj[key];\n    } // Only wrap the new method if the original method was a function\n\n\n    if (typeof superMethod === 'function') {\n      return (0, _utils.wrap)(method, superMethod);\n    }\n\n    return method;\n  }\n\n  function applyConcatenatedProperties(obj, key, value$$1, values) {\n    var baseValue = values[key] || obj[key];\n    var ret = (0, _utils.makeArray)(baseValue).concat((0, _utils.makeArray)(value$$1));\n\n    if (true\n    /* DEBUG */\n    ) {\n      // it is possible to use concatenatedProperties with strings (which cannot be frozen)\n      // only freeze objects...\n      if (typeof ret === 'object' && ret !== null) {\n        // prevent mutating `concatenatedProperties` array after it is applied\n        Object.freeze(ret);\n      }\n    }\n\n    return ret;\n  }\n\n  function applyMergedProperties(obj, key, value$$1, values) {\n    var baseValue = values[key] || obj[key];\n    (true && !(!isArray(value$$1)) && (0, _debug.assert)(\"You passed in `\" + JSON.stringify(value$$1) + \"` as the value for `\" + key + \"` but `\" + key + \"` cannot be an Array\", !isArray(value$$1)));\n\n    if (!baseValue) {\n      return value$$1;\n    }\n\n    var newBase = (0, _polyfills.assign)({}, baseValue);\n    var hasFunction = false;\n\n    for (var prop in value$$1) {\n      if (!value$$1.hasOwnProperty(prop)) {\n        continue;\n      }\n\n      var propValue = value$$1[prop];\n\n      if (isMethod(propValue)) {\n        // TODO: support for Computed Properties, etc?\n        hasFunction = true;\n        newBase[prop] = giveMethodSuper(obj, prop, propValue, baseValue, {});\n      } else {\n        newBase[prop] = propValue;\n      }\n    }\n\n    if (hasFunction) {\n      newBase._super = _utils.ROOT;\n    }\n\n    return newBase;\n  }\n\n  function addNormalizedProperty(base, key, value$$1, meta$$1, descs, values, concats, mergings) {\n    if (isClassicDecorator(value$$1)) {\n      // Wrap descriptor function to implement _super() if needed\n      descs[key] = giveDecoratorSuper(meta$$1, key, value$$1, values, descs, base);\n      values[key] = undefined;\n    } else {\n      if (concats && concats.indexOf(key) >= 0 || key === 'concatenatedProperties' || key === 'mergedProperties') {\n        value$$1 = applyConcatenatedProperties(base, key, value$$1, values);\n      } else if (mergings && mergings.indexOf(key) > -1) {\n        value$$1 = applyMergedProperties(base, key, value$$1, values);\n      } else if (isMethod(value$$1)) {\n        value$$1 = giveMethodSuper(base, key, value$$1, values, descs);\n      }\n\n      descs[key] = undefined;\n      values[key] = value$$1;\n    }\n  }\n\n  function mergeMixins(mixins, meta$$1, descs, values, base, keys) {\n    var currentMixin, props, key, concats, mergings;\n\n    function removeKeys(keyName) {\n      delete descs[keyName];\n      delete values[keyName];\n    }\n\n    for (var i = 0; i < mixins.length; i++) {\n      currentMixin = mixins[i];\n      (true && !(typeof currentMixin === 'object' && currentMixin !== null && Object.prototype.toString.call(currentMixin) !== '[object Array]') && (0, _debug.assert)(\"Expected hash or Mixin instance, got \" + Object.prototype.toString.call(currentMixin), typeof currentMixin === 'object' && currentMixin !== null && Object.prototype.toString.call(currentMixin) !== '[object Array]'));\n      props = mixinProperties(meta$$1, currentMixin);\n\n      if (props === CONTINUE) {\n        continue;\n      }\n\n      if (props) {\n        // remove willMergeMixin after 3.4 as it was used for _actions\n        if (base.willMergeMixin) {\n          base.willMergeMixin(props);\n        }\n\n        concats = concatenatedMixinProperties('concatenatedProperties', props, values, base);\n        mergings = concatenatedMixinProperties('mergedProperties', props, values, base);\n\n        for (key in props) {\n          if (!props.hasOwnProperty(key)) {\n            continue;\n          }\n\n          keys.push(key);\n          addNormalizedProperty(base, key, props[key], meta$$1, descs, values, concats, mergings);\n        } // manually copy toString() because some JS engines do not enumerate it\n\n\n        if (props.hasOwnProperty('toString')) {\n          base.toString = props.toString;\n        }\n      } else if (currentMixin.mixins) {\n        mergeMixins(currentMixin.mixins, meta$$1, descs, values, base, keys);\n\n        if (currentMixin._without) {\n          currentMixin._without.forEach(removeKeys);\n        }\n      }\n    }\n  }\n\n  var followMethodAlias;\n\n  if (_deprecatedFeatures.ALIAS_METHOD) {\n    followMethodAlias = function (obj, alias, descs, values) {\n      var altKey = alias.methodName;\n      var possibleDesc;\n      var desc = descs[altKey];\n      var value$$1 = values[altKey];\n\n      if (desc !== undefined || value$$1 !== undefined) {// do nothing\n      } else if ((possibleDesc = descriptorForProperty(obj, altKey)) !== undefined) {\n        desc = possibleDesc;\n        value$$1 = undefined;\n      } else {\n        desc = undefined;\n        value$$1 = obj[altKey];\n      }\n\n      return {\n        desc,\n        value: value$$1\n      };\n    };\n  }\n\n  function updateObserversAndListeners(obj, key, fn, add) {\n    var observers = (0, _utils.getObservers)(fn);\n    var listeners = (0, _utils.getListeners)(fn);\n\n    if (observers !== undefined) {\n      var updateObserver = add ? addObserver : removeObserver;\n\n      for (var i = 0; i < observers.paths.length; i++) {\n        updateObserver(obj, observers.paths[i], null, key, observers.sync);\n      }\n    }\n\n    if (listeners !== undefined) {\n      var updateListener = add ? addListener : removeListener;\n\n      for (var _i2 = 0; _i2 < listeners.length; _i2++) {\n        updateListener(obj, listeners[_i2], null, key);\n      }\n    }\n  }\n\n  function replaceObserversAndListeners(obj, key, prev, next) {\n    if (typeof prev === 'function') {\n      updateObserversAndListeners(obj, key, prev, false);\n    }\n\n    if (typeof next === 'function') {\n      updateObserversAndListeners(obj, key, next, true);\n    }\n  }\n\n  function applyMixin(obj, mixins) {\n    var descs = {};\n    var values = {};\n    var meta$$1 = (0, _meta2.meta)(obj);\n    var keys = [];\n    var key, value$$1, desc;\n    obj._super = _utils.ROOT; // Go through all mixins and hashes passed in, and:\n    //\n    // * Handle concatenated properties\n    // * Handle merged properties\n    // * Set up _super wrapping if necessary\n    // * Set up computed property descriptors\n    // * Copying `toString` in broken browsers\n\n    mergeMixins(mixins, meta$$1, descs, values, obj, keys);\n\n    for (var i = 0; i < keys.length; i++) {\n      key = keys[i];\n\n      if (key === 'constructor' || !values.hasOwnProperty(key)) {\n        continue;\n      }\n\n      desc = descs[key];\n      value$$1 = values[key];\n\n      if (_deprecatedFeatures.ALIAS_METHOD) {\n        while (value$$1 && value$$1 instanceof AliasImpl) {\n          var followed = followMethodAlias(obj, value$$1, descs, values);\n          desc = followed.desc;\n          value$$1 = followed.value;\n        }\n      }\n\n      if (desc === undefined && value$$1 === undefined) {\n        continue;\n      }\n\n      if (descriptorForProperty(obj, key) !== undefined) {\n        replaceObserversAndListeners(obj, key, null, value$$1);\n      } else {\n        replaceObserversAndListeners(obj, key, obj[key], value$$1);\n      }\n\n      defineProperty(obj, key, desc, value$$1, meta$$1);\n    }\n\n    return obj;\n  }\n  /**\n    @method mixin\n    @param obj\n    @param mixins*\n    @return obj\n    @private\n  */\n\n\n  function mixin(obj, ...args) {\n    applyMixin(obj, args);\n    return obj;\n  }\n  /**\n    The `Mixin` class allows you to create mixins, whose properties can be\n    added to other classes. For instance,\n  \n    ```javascript\n    import Mixin from '@ember/object/mixin';\n  \n    const EditableMixin = Mixin.create({\n      edit() {\n        console.log('starting to edit');\n        this.set('isEditing', true);\n      },\n      isEditing: false\n    });\n    ```\n  \n    ```javascript\n    import EmberObject from '@ember/object';\n    import EditableMixin from '../mixins/editable';\n  \n    // Mix mixins into classes by passing them as the first arguments to\n    // `.extend.`\n    const Comment = EmberObject.extend(EditableMixin, {\n      post: null\n    });\n  \n    let comment = Comment.create({\n      post: somePost\n    });\n  \n    comment.edit(); // outputs 'starting to edit'\n    ```\n  \n    Note that Mixins are created with `Mixin.create`, not\n    `Mixin.extend`.\n  \n    Note that mixins extend a constructor's prototype so arrays and object literals\n    defined as properties will be shared amongst objects that implement the mixin.\n    If you want to define a property in a mixin that is not shared, you can define\n    it either as a computed property or have it be created on initialization of the object.\n  \n    ```javascript\n    // filters array will be shared amongst any object implementing mixin\n    import Mixin from '@ember/object/mixin';\n    import { A } from '@ember/array';\n  \n    const FilterableMixin = Mixin.create({\n      filters: A()\n    });\n    ```\n  \n    ```javascript\n    import Mixin from '@ember/object/mixin';\n    import { A } from '@ember/array';\n    import { computed } from '@ember/object';\n  \n    // filters will be a separate array for every object implementing the mixin\n    const FilterableMixin = Mixin.create({\n      filters: computed(function() {\n        return A();\n      })\n    });\n    ```\n  \n    ```javascript\n    import Mixin from '@ember/object/mixin';\n    import { A } from '@ember/array';\n  \n    // filters will be created as a separate array during the object's initialization\n    const Filterable = Mixin.create({\n      filters: null,\n  \n      init() {\n        this._super(...arguments);\n        this.set(\"filters\", A());\n      }\n    });\n    ```\n  \n    @class Mixin\n    @public\n  */\n\n\n  class Mixin {\n    constructor(mixins, properties) {\n      this.properties = extractAccessors(properties);\n      this.mixins = buildMixinsArray(mixins);\n      this.ownerConstructor = undefined;\n      this._without = undefined;\n\n      if (true\n      /* DEBUG */\n      ) {\n        /*\n          In debug builds, we seal mixins to help avoid performance pitfalls.\n                 In IE11 there is a quirk that prevents sealed objects from being added\n          to a WeakMap. Unfortunately, the mixin system currently relies on\n          weak maps in `guidFor`, so we need to prime the guid cache weak map.\n        */\n        (0, _utils.guidFor)(this);\n        Object.seal(this);\n      }\n    }\n    /**\n      @method create\n      @for @ember/object/mixin\n      @static\n      @param arguments*\n      @public\n    */\n\n\n    static create(...args) {\n      // ES6TODO: this relies on a global state?\n      setUnprocessedMixins();\n      var M = this;\n      return new M(args, undefined);\n    } // returns the mixins currently applied to the specified object\n    // TODO: Make `mixin`\n\n\n    static mixins(obj) {\n      var meta$$1 = (0, _meta2.peekMeta)(obj);\n      var ret = [];\n\n      if (meta$$1 === null) {\n        return ret;\n      }\n\n      meta$$1.forEachMixins(currentMixin => {\n        // skip primitive mixins since these are always anonymous\n        if (!currentMixin.properties) {\n          ret.push(currentMixin);\n        }\n      });\n      return ret;\n    }\n    /**\n      @method reopen\n      @param arguments*\n      @private\n    */\n\n\n    reopen(...args) {\n      if (args.length === 0) {\n        return;\n      }\n\n      if (this.properties) {\n        var currentMixin = new Mixin(undefined, this.properties);\n        this.properties = undefined;\n        this.mixins = [currentMixin];\n      } else if (!this.mixins) {\n        this.mixins = [];\n      }\n\n      this.mixins = this.mixins.concat(buildMixinsArray(args));\n      return this;\n    }\n    /**\n      @method apply\n      @param obj\n      @return applied object\n      @private\n    */\n\n\n    apply(obj) {\n      return applyMixin(obj, [this]);\n    }\n\n    applyPartial(obj) {\n      return applyMixin(obj, [this]);\n    }\n    /**\n      @method detect\n      @param obj\n      @return {Boolean}\n      @private\n    */\n\n\n    detect(obj) {\n      if (typeof obj !== 'object' || obj === null) {\n        return false;\n      }\n\n      if (obj instanceof Mixin) {\n        return _detect(obj, this);\n      }\n\n      var meta$$1 = (0, _meta2.peekMeta)(obj);\n\n      if (meta$$1 === null) {\n        return false;\n      }\n\n      return meta$$1.hasMixin(this);\n    }\n\n    without(...args) {\n      var ret = new Mixin([this]);\n      ret._without = args;\n      return ret;\n    }\n\n    keys() {\n      return _keys(this);\n    }\n\n    toString() {\n      return '(unknown mixin)';\n    }\n\n  }\n\n  _exports.Mixin = Mixin;\n\n  function buildMixinsArray(mixins) {\n    var length = mixins && mixins.length || 0;\n    var m = undefined;\n\n    if (length > 0) {\n      m = new Array(length);\n\n      for (var i = 0; i < length; i++) {\n        var x = mixins[i];\n        (true && !(typeof x === 'object' && x !== null && Object.prototype.toString.call(x) !== '[object Array]') && (0, _debug.assert)(\"Expected hash or Mixin instance, got \" + Object.prototype.toString.call(x), typeof x === 'object' && x !== null && Object.prototype.toString.call(x) !== '[object Array]'));\n\n        if (x instanceof Mixin) {\n          m[i] = x;\n        } else {\n          m[i] = new Mixin(undefined, x);\n        }\n      }\n    }\n\n    return m;\n  }\n\n  Mixin.prototype.toString = classToString;\n\n  if (true\n  /* DEBUG */\n  ) {\n    Object.seal(Mixin.prototype);\n  }\n\n  function _detect(curMixin, targetMixin, seen = new Set()) {\n    if (seen.has(curMixin)) {\n      return false;\n    }\n\n    seen.add(curMixin);\n\n    if (curMixin === targetMixin) {\n      return true;\n    }\n\n    var mixins = curMixin.mixins;\n\n    if (mixins) {\n      return mixins.some(mixin => _detect(mixin, targetMixin, seen));\n    }\n\n    return false;\n  }\n\n  function _keys(mixin, ret = new Set(), seen = new Set()) {\n    if (seen.has(mixin)) {\n      return;\n    }\n\n    seen.add(mixin);\n\n    if (mixin.properties) {\n      var props = Object.keys(mixin.properties);\n\n      for (var i = 0; i < props.length; i++) {\n        ret.add(props[i]);\n      }\n    } else if (mixin.mixins) {\n      mixin.mixins.forEach(x => _keys(x, ret, seen));\n    }\n\n    return ret;\n  }\n\n  var AliasImpl;\n\n  if (_deprecatedFeatures.ALIAS_METHOD) {\n    AliasImpl = class AliasImpl {\n      constructor(methodName) {\n        this.methodName = methodName;\n      }\n\n    };\n  }\n  /**\n    Makes a method available via an additional name.\n  \n    ```app/utils/person.js\n    import EmberObject, {\n      aliasMethod\n    } from '@ember/object';\n  \n    export default EmberObject.extend({\n      name() {\n        return 'Tomhuda Katzdale';\n      },\n      moniker: aliasMethod('name')\n    });\n    ```\n  \n    ```javascript\n    let goodGuy = Person.create();\n  \n    goodGuy.name();    // 'Tomhuda Katzdale'\n    goodGuy.moniker(); // 'Tomhuda Katzdale'\n    ```\n  \n    @method aliasMethod\n    @static\n    @deprecated Use a shared utility method instead\n    @for @ember/object\n    @param {String} methodName name of the method to alias\n    @public\n  */\n\n\n  var aliasMethod;\n  _exports.aliasMethod = aliasMethod;\n\n  if (_deprecatedFeatures.ALIAS_METHOD) {\n    _exports.aliasMethod = aliasMethod = function aliasMethod(methodName) {\n      (true && !(false) && (0, _debug.deprecate)(\"You attempted to alias '\" + methodName + \", but aliasMethod has been deprecated. Consider extracting the method into a shared utility function.\", false, {\n        id: 'object.alias-method',\n        until: '4.0.0',\n        url: 'https://emberjs.com/deprecations/v3.x#toc_object-alias-method'\n      }));\n      return new AliasImpl(methodName);\n    };\n  }\n\n  function observer(...args) {\n    var funcOrDef = args.pop();\n    (true && !(typeof funcOrDef === 'function' || typeof funcOrDef === 'object' && funcOrDef !== null) && (0, _debug.assert)('observer must be provided a function or an observer definition', typeof funcOrDef === 'function' || typeof funcOrDef === 'object' && funcOrDef !== null));\n    var func, dependentKeys, sync;\n\n    if (typeof funcOrDef === 'function') {\n      func = funcOrDef;\n      dependentKeys = args;\n      sync = !_environment.ENV._DEFAULT_ASYNC_OBSERVERS;\n    } else {\n      func = funcOrDef.fn;\n      dependentKeys = funcOrDef.dependentKeys;\n      sync = funcOrDef.sync;\n    }\n\n    (true && !(typeof func === 'function') && (0, _debug.assert)('observer called without a function', typeof func === 'function'));\n    (true && !(Array.isArray(dependentKeys) && dependentKeys.length > 0 && dependentKeys.every(p => typeof p === 'string' && Boolean(p.length))) && (0, _debug.assert)('observer called without valid path', Array.isArray(dependentKeys) && dependentKeys.length > 0 && dependentKeys.every(p => typeof p === 'string' && Boolean(p.length))));\n    (true && !(typeof sync === 'boolean') && (0, _debug.assert)('observer called without sync', typeof sync === 'boolean'));\n    var paths = [];\n\n    var addWatchedProperty = path => paths.push(path);\n\n    for (var i = 0; i < dependentKeys.length; ++i) {\n      expandProperties(dependentKeys[i], addWatchedProperty);\n    }\n\n    (0, _utils.setObservers)(func, {\n      paths,\n      sync\n    });\n    return func;\n  }\n\n  var DEBUG_INJECTION_FUNCTIONS;\n  _exports.DEBUG_INJECTION_FUNCTIONS = DEBUG_INJECTION_FUNCTIONS;\n\n  if (true\n  /* DEBUG */\n  ) {\n    _exports.DEBUG_INJECTION_FUNCTIONS = DEBUG_INJECTION_FUNCTIONS = new WeakMap();\n  }\n\n  function inject(type, ...args) {\n    (true && !(typeof type === 'string') && (0, _debug.assert)('a string type must be provided to inject', typeof type === 'string'));\n    var calledAsDecorator = isElementDescriptor(args);\n    var source, namespace;\n    var name = calledAsDecorator ? undefined : args[0];\n    var options = calledAsDecorator ? undefined : args[1];\n\n    var getInjection = function (propertyName) {\n      var owner = (0, _owner.getOwner)(this) || this.container; // fallback to `container` for backwards compat\n\n      (true && !(Boolean(owner)) && (0, _debug.assert)(\"Attempting to lookup an injected property on an object without a container, ensure that the object was instantiated via a container.\", Boolean(owner)));\n      return owner.lookup(type + \":\" + (name || propertyName), {\n        source,\n        namespace\n      });\n    };\n\n    if (true\n    /* DEBUG */\n    ) {\n      DEBUG_INJECTION_FUNCTIONS.set(getInjection, {\n        namespace,\n        source,\n        type,\n        name\n      });\n    }\n\n    var decorator = computed({\n      get: getInjection,\n\n      set(keyName, value$$1) {\n        defineProperty(this, keyName, null, value$$1);\n      }\n\n    });\n\n    if (calledAsDecorator) {\n      return decorator(args[0], args[1], args[2]);\n    } else {\n      return decorator;\n    }\n  }\n});","define(\"@ember/-internals/owner/index\", [\"exports\", \"@ember/-internals/utils\"], function (_exports, _utils) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.getOwner = getOwner;\n  _exports.setOwner = setOwner;\n  _exports.OWNER = void 0;\n\n  /**\n  @module @ember/application\n  */\n  var OWNER = (0, _utils.symbol)('OWNER');\n  /**\n    Framework objects in an Ember application (components, services, routes, etc.)\n    are created via a factory and dependency injection system. Each of these\n    objects is the responsibility of an \"owner\", which handled its\n    instantiation and manages its lifetime.\n  \n    `getOwner` fetches the owner object responsible for an instance. This can\n    be used to lookup or resolve other class instances, or register new factories\n    into the owner.\n  \n    For example, this component dynamically looks up a service based on the\n    `audioType` passed as an argument:\n  \n    ```app/components/play-audio.js\n    import Component from '@glimmer/component';\n    import { action } from '@ember/object';\n    import { getOwner } from '@ember/application';\n  \n    // Usage:\n    //\n    //   <PlayAudio @audioType={{@model.audioType}} @audioFile={{@model.file}}/>\n    //\n    export default class extends Component {\n      get audioService() {\n        let owner = getOwner(this);\n        return owner.lookup(`service:${this.args.audioType}`);\n      }\n  \n      @action\n      onPlay() {\n        let player = this.audioService;\n        player.play(this.args.audioFile);\n      }\n    }\n    ```\n  \n    @method getOwner\n    @static\n    @for @ember/application\n    @param {Object} object An object with an owner.\n    @return {Object} An owner object.\n    @since 2.3.0\n    @public\n  */\n\n  _exports.OWNER = OWNER;\n\n  function getOwner(object) {\n    return object[OWNER];\n  }\n  /**\n    `setOwner` forces a new owner on a given object instance. This is primarily\n    useful in some testing cases.\n  \n    @method setOwner\n    @static\n    @for @ember/application\n    @param {Object} object An object instance.\n    @param {Object} object The new owner object of the object instance.\n    @since 2.3.0\n    @public\n  */\n\n\n  function setOwner(object, owner) {\n    object[OWNER] = owner;\n  }\n});","define(\"@ember/-internals/routing/index\", [\"exports\", \"@ember/-internals/routing/lib/ext/controller\", \"@ember/-internals/routing/lib/location/api\", \"@ember/-internals/routing/lib/location/none_location\", \"@ember/-internals/routing/lib/location/hash_location\", \"@ember/-internals/routing/lib/location/history_location\", \"@ember/-internals/routing/lib/location/auto_location\", \"@ember/-internals/routing/lib/system/generate_controller\", \"@ember/-internals/routing/lib/system/controller_for\", \"@ember/-internals/routing/lib/system/dsl\", \"@ember/-internals/routing/lib/system/router\", \"@ember/-internals/routing/lib/system/route\", \"@ember/-internals/routing/lib/system/query_params\", \"@ember/-internals/routing/lib/services/routing\", \"@ember/-internals/routing/lib/services/router\", \"@ember/-internals/routing/lib/system/cache\"], function (_exports, _controller, _api, _none_location, _hash_location, _history_location, _auto_location, _generate_controller, _controller_for, _dsl, _router, _route, _query_params, _routing, _router2, _cache) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"Location\", {\n    enumerable: true,\n    get: function () {\n      return _api.default;\n    }\n  });\n  Object.defineProperty(_exports, \"NoneLocation\", {\n    enumerable: true,\n    get: function () {\n      return _none_location.default;\n    }\n  });\n  Object.defineProperty(_exports, \"HashLocation\", {\n    enumerable: true,\n    get: function () {\n      return _hash_location.default;\n    }\n  });\n  Object.defineProperty(_exports, \"HistoryLocation\", {\n    enumerable: true,\n    get: function () {\n      return _history_location.default;\n    }\n  });\n  Object.defineProperty(_exports, \"AutoLocation\", {\n    enumerable: true,\n    get: function () {\n      return _auto_location.default;\n    }\n  });\n  Object.defineProperty(_exports, \"generateController\", {\n    enumerable: true,\n    get: function () {\n      return _generate_controller.default;\n    }\n  });\n  Object.defineProperty(_exports, \"generateControllerFactory\", {\n    enumerable: true,\n    get: function () {\n      return _generate_controller.generateControllerFactory;\n    }\n  });\n  Object.defineProperty(_exports, \"controllerFor\", {\n    enumerable: true,\n    get: function () {\n      return _controller_for.default;\n    }\n  });\n  Object.defineProperty(_exports, \"RouterDSL\", {\n    enumerable: true,\n    get: function () {\n      return _dsl.default;\n    }\n  });\n  Object.defineProperty(_exports, \"Router\", {\n    enumerable: true,\n    get: function () {\n      return _router.default;\n    }\n  });\n  Object.defineProperty(_exports, \"Route\", {\n    enumerable: true,\n    get: function () {\n      return _route.default;\n    }\n  });\n  Object.defineProperty(_exports, \"QueryParams\", {\n    enumerable: true,\n    get: function () {\n      return _query_params.default;\n    }\n  });\n  Object.defineProperty(_exports, \"RoutingService\", {\n    enumerable: true,\n    get: function () {\n      return _routing.default;\n    }\n  });\n  Object.defineProperty(_exports, \"RouterService\", {\n    enumerable: true,\n    get: function () {\n      return _router2.default;\n    }\n  });\n  Object.defineProperty(_exports, \"BucketCache\", {\n    enumerable: true,\n    get: function () {\n      return _cache.default;\n    }\n  });\n});","define(\"@ember/-internals/routing/lib/ext/controller\", [\"exports\", \"@ember/-internals/metal\", \"@ember/controller/lib/controller_mixin\", \"@ember/-internals/routing/lib/utils\"], function (_exports, _metal, _controller_mixin, _utils) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n  @module ember\n  */\n  _controller_mixin.default.reopen({\n    concatenatedProperties: ['queryParams'],\n\n    /**\n      Defines which query parameters the controller accepts.\n      If you give the names `['category','page']` it will bind\n      the values of these query parameters to the variables\n      `this.category` and `this.page`.\n      By default, Ember coerces query parameter values using `toggleProperty`.\n      This behavior may lead to unexpected results.\n      Available queryParam types: `boolean`, `number`, `array`.\n      If query param type not specified, it will be `string`.\n      To explicitly configure a query parameter property so it coerces as expected, you must define a type property:\n         ```javascript\n        queryParams: [{\n          category: {\n            type: 'boolean'\n          }\n        }]\n      ```\n         @for Ember.ControllerMixin\n      @property queryParams\n      @public\n    */\n    queryParams: null,\n\n    /**\n     This property is updated to various different callback functions depending on\n     the current \"state\" of the backing route. It is used by\n     `Controller.prototype._qpChanged`.\n        The methods backing each state can be found in the `Route.prototype._qp` computed\n     property return value (the `.states` property). The current values are listed here for\n     the sanity of future travelers:\n        * `inactive` - This state is used when this controller instance is not part of the active\n       route hierarchy. Set in `Route.prototype._reset` (a `router.js` microlib hook) and\n       `Route.prototype.actions.finalizeQueryParamChange`.\n     * `active` - This state is used when this controller instance is part of the active\n       route hierarchy. Set in `Route.prototype.actions.finalizeQueryParamChange`.\n     * `allowOverrides` - This state is used in `Route.prototype.setup` (`route.js` microlib hook).\n         @method _qpDelegate\n      @private\n    */\n    _qpDelegate: null,\n\n    /**\n     During `Route#setup` observers are created to invoke this method\n     when any of the query params declared in `Controller#queryParams` property\n     are changed.\n        When invoked this method uses the currently active query param update delegate\n     (see `Controller.prototype._qpDelegate` for details) and invokes it with\n     the QP key/value being changed.\n         @method _qpChanged\n      @private\n    */\n    _qpChanged(controller, _prop) {\n      var dotIndex = _prop.indexOf('.[]');\n\n      var prop = dotIndex === -1 ? _prop : _prop.slice(0, dotIndex);\n      var delegate = controller._qpDelegate;\n      var value = (0, _metal.get)(controller, prop);\n      delegate(prop, value);\n    },\n\n    /**\n      Transition the application into another route. The route may\n      be either a single route or route path:\n         ```javascript\n      aController.transitionToRoute('blogPosts');\n      aController.transitionToRoute('blogPosts.recentEntries');\n      ```\n         Optionally supply a model for the route in question. The model\n      will be serialized into the URL using the `serialize` hook of\n      the route:\n         ```javascript\n      aController.transitionToRoute('blogPost', aPost);\n      ```\n         If a literal is passed (such as a number or a string), it will\n      be treated as an identifier instead. In this case, the `model`\n      hook of the route will be triggered:\n         ```javascript\n      aController.transitionToRoute('blogPost', 1);\n      ```\n         Multiple models will be applied last to first recursively up the\n      route tree.\n         ```app/router.js\n      Router.map(function() {\n        this.route('blogPost', { path: ':blogPostId' }, function() {\n          this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n        });\n      });\n      ```\n         ```javascript\n      aController.transitionToRoute('blogComment', aPost, aComment);\n      aController.transitionToRoute('blogComment', 1, 13);\n      ```\n         It is also possible to pass a URL (a string that starts with a\n      `/`).\n         ```javascript\n      aController.transitionToRoute('/');\n      aController.transitionToRoute('/blog/post/1/comment/13');\n      aController.transitionToRoute('/blog/posts?sort=title');\n      ```\n         An options hash with a `queryParams` property may be provided as\n      the final argument to add query parameters to the destination URL.\n         ```javascript\n      aController.transitionToRoute('blogPost', 1, {\n        queryParams: { showComments: 'true' }\n      });\n         // if you just want to transition the query parameters without changing the route\n      aController.transitionToRoute({ queryParams: { sort: 'date' } });\n      ```\n         See also [replaceRoute](/ember/release/classes/Ember.ControllerMixin/methods/replaceRoute?anchor=replaceRoute).\n         @param {String} name the name of the route or a URL\n      @param {...Object} models the model(s) or identifier(s) to be used\n        while transitioning to the route.\n      @param {Object} [options] optional hash with a queryParams property\n        containing a mapping of query parameters\n      @for Ember.ControllerMixin\n      @method transitionToRoute\n      @public\n    */\n    transitionToRoute(...args) {\n      // target may be either another controller or a router\n      var target = (0, _metal.get)(this, 'target');\n      var method = target.transitionToRoute || target.transitionTo;\n      return method.apply(target, (0, _utils.prefixRouteNameArg)(this, args));\n    },\n\n    /**\n      Transition into another route while replacing the current URL, if possible.\n      This will replace the current history entry instead of adding a new one.\n      Beside that, it is identical to `transitionToRoute` in all other respects.\n         ```javascript\n      aController.replaceRoute('blogPosts');\n      aController.replaceRoute('blogPosts.recentEntries');\n      ```\n         Optionally supply a model for the route in question. The model\n      will be serialized into the URL using the `serialize` hook of\n      the route:\n         ```javascript\n      aController.replaceRoute('blogPost', aPost);\n      ```\n         If a literal is passed (such as a number or a string), it will\n      be treated as an identifier instead. In this case, the `model`\n      hook of the route will be triggered:\n         ```javascript\n      aController.replaceRoute('blogPost', 1);\n      ```\n         Multiple models will be applied last to first recursively up the\n      route tree.\n         ```app/router.js\n      Router.map(function() {\n        this.route('blogPost', { path: ':blogPostId' }, function() {\n          this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n        });\n      });\n      ```\n         ```\n      aController.replaceRoute('blogComment', aPost, aComment);\n      aController.replaceRoute('blogComment', 1, 13);\n      ```\n         It is also possible to pass a URL (a string that starts with a\n      `/`).\n         ```javascript\n      aController.replaceRoute('/');\n      aController.replaceRoute('/blog/post/1/comment/13');\n      ```\n         @param {String} name the name of the route or a URL\n      @param {...Object} models the model(s) or identifier(s) to be used\n      while transitioning to the route.\n      @for Ember.ControllerMixin\n      @method replaceRoute\n      @public\n    */\n    replaceRoute(...args) {\n      // target may be either another controller or a router\n      var target = (0, _metal.get)(this, 'target');\n      var method = target.replaceRoute || target.replaceWith;\n      return method.apply(target, (0, _utils.prefixRouteNameArg)(this, args));\n    }\n\n  });\n\n  var _default = _controller_mixin.default;\n  _exports.default = _default;\n});","define(\"@ember/-internals/routing/lib/location/api\", [\"exports\", \"@ember/debug\"], function (_exports, _debug) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n  @module @ember/routing\n  */\n\n  /**\n    Location returns an instance of the correct implementation of\n    the `location` API.\n  \n    ## Implementations\n  \n    You can pass an implementation name (`hash`, `history`, `none`, `auto`) to force a\n    particular implementation to be used in your application.\n  \n    See [HashLocation](/ember/release/classes/HashLocation).\n    See [HistoryLocation](/ember/release/classes/HistoryLocation).\n    See [NoneLocation](/ember/release/classes/NoneLocation).\n    See [AutoLocation](/ember/release/classes/AutoLocation).\n  \n    ## Location API\n  \n    Each location implementation must provide the following methods:\n  \n    * implementation: returns the string name used to reference the implementation.\n    * getURL: returns the current URL.\n    * setURL(path): sets the current URL.\n    * replaceURL(path): replace the current URL (optional).\n    * onUpdateURL(callback): triggers the callback when the URL changes.\n    * formatURL(url): formats `url` to be placed into `href` attribute.\n    * detect() (optional): instructs the location to do any feature detection\n        necessary. If the location needs to redirect to a different URL, it\n        can cancel routing by setting the `cancelRouterSetup` property on itself\n        to `false`.\n  \n    Calling setURL or replaceURL will not trigger onUpdateURL callbacks.\n  \n    ## Custom implementation\n  \n    Ember scans `app/locations/*` for extending the Location API.\n  \n    Example:\n  \n    ```javascript\n    import HistoryLocation from '@ember/routing/history-location';\n  \n    export default class MyHistory {\n      implementation: 'my-custom-history',\n      constructor() {\n        this._history = HistoryLocation.create(...arguments);\n      }\n      create() {\n        return new this(...arguments);\n      }\n      pushState(path) {\n         this._history.pushState(path);\n      }\n    }\n    ```\n  \n    @class Location\n    @private\n  */\n  var _default = {\n    /**\n     This is deprecated in favor of using the container to lookup the location\n     implementation as desired.\n        For example:\n        ```javascript\n     // Given a location registered as follows:\n     container.register('location:history-test', HistoryTestLocation);\n        // You could create a new instance via:\n     container.lookup('location:history-test');\n     ```\n         @method create\n      @param {Object} options\n      @return {Object} an instance of an implementation of the `location` API\n      @deprecated Use the container to lookup the location implementation that you\n      need.\n      @private\n    */\n    create(options) {\n      var implementation = options && options.implementation;\n      (true && !(Boolean(implementation)) && (0, _debug.assert)(\"Location.create: you must specify a 'implementation' option\", Boolean(implementation)));\n      var implementationClass = this.implementations[implementation];\n      (true && !(Boolean(implementationClass)) && (0, _debug.assert)(\"Location.create: \" + implementation + \" is not a valid implementation\", Boolean(implementationClass)));\n      return implementationClass.create(...arguments);\n    },\n\n    implementations: {}\n  };\n  _exports.default = _default;\n});","define(\"@ember/-internals/routing/lib/location/auto_location\", [\"exports\", \"@ember/-internals/browser-environment\", \"@ember/-internals/metal\", \"@ember/-internals/owner\", \"@ember/-internals/runtime\", \"@ember/-internals/utils\", \"@ember/debug\", \"@ember/-internals/routing/lib/location/util\"], function (_exports, _browserEnvironment, _metal, _owner, _runtime, _utils, _debug, _util) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.getHistoryPath = getHistoryPath;\n  _exports.getHashPath = getHashPath;\n  _exports.default = void 0;\n\n  /**\n  @module @ember/routing\n  */\n\n  /**\n    AutoLocation will select the best location option based off browser\n    support with the priority order: history, hash, none.\n  \n    Clean pushState paths accessed by hashchange-only browsers will be redirected\n    to the hash-equivalent and vice versa so future transitions are consistent.\n  \n    Keep in mind that since some of your users will use `HistoryLocation`, your\n    server must serve the Ember app at all the routes you define.\n  \n    Browsers that support the `history` API will use `HistoryLocation`, those that\n    do not, but still support the `hashchange` event will use `HashLocation`, and\n    in the rare case neither is supported will use `NoneLocation`.\n  \n    Example:\n  \n    ```app/router.js\n    Router.map(function() {\n      this.route('posts', function() {\n        this.route('new');\n      });\n    });\n  \n    Router.reopen({\n      location: 'auto'\n    });\n    ```\n  \n    This will result in a posts.new url of `/posts/new` for modern browsers that\n    support the `history` api or `/#/posts/new` for older ones, like Internet\n    Explorer 9 and below.\n  \n    When a user visits a link to your application, they will be automatically\n    upgraded or downgraded to the appropriate `Location` class, with the URL\n    transformed accordingly, if needed.\n  \n    Keep in mind that since some of your users will use `HistoryLocation`, your\n    server must serve the Ember app at all the routes you define.\n  \n    @class AutoLocation\n    @static\n    @protected\n  */\n  class AutoLocation extends _runtime.Object {\n    constructor() {\n      super(...arguments);\n      this.implementation = 'auto';\n    }\n    /**\n     Called by the router to instruct the location to do any feature detection\n     necessary. In the case of AutoLocation, we detect whether to use history\n     or hash concrete implementations.\n        @private\n    */\n\n\n    detect() {\n      var rootURL = this.rootURL;\n      (true && !(rootURL.charAt(rootURL.length - 1) === '/') && (0, _debug.assert)('rootURL must end with a trailing forward slash e.g. \"/app/\"', rootURL.charAt(rootURL.length - 1) === '/'));\n      var implementation = detectImplementation({\n        location: this.location,\n        history: this.history,\n        userAgent: this.userAgent,\n        rootURL,\n        documentMode: this.documentMode,\n        global: this.global\n      });\n\n      if (implementation === false) {\n        (0, _metal.set)(this, 'cancelRouterSetup', true);\n        implementation = 'none';\n      }\n\n      var concrete = (0, _owner.getOwner)(this).lookup(\"location:\" + implementation);\n      (true && !(concrete !== undefined) && (0, _debug.assert)(\"Could not find location '\" + implementation + \"'.\", concrete !== undefined));\n      (0, _metal.set)(concrete, 'rootURL', rootURL);\n      (0, _metal.set)(this, 'concreteImplementation', concrete);\n    }\n\n    willDestroy() {\n      var {\n        concreteImplementation\n      } = this;\n\n      if (concreteImplementation) {\n        concreteImplementation.destroy();\n      }\n    }\n\n  }\n\n  _exports.default = AutoLocation;\n  AutoLocation.reopen({\n    /**\n      @private\n         Will be pre-pended to path upon state change.\n         @since 1.5.1\n      @property rootURL\n      @default '/'\n    */\n    rootURL: '/',\n    initState: delegateToConcreteImplementation('initState'),\n    getURL: delegateToConcreteImplementation('getURL'),\n    setURL: delegateToConcreteImplementation('setURL'),\n    replaceURL: delegateToConcreteImplementation('replaceURL'),\n    onUpdateURL: delegateToConcreteImplementation('onUpdateURL'),\n    formatURL: delegateToConcreteImplementation('formatURL'),\n\n    /**\n      @private\n         The browser's `location` object. This is typically equivalent to\n      `window.location`, but may be overridden for testing.\n         @property location\n      @default environment.location\n    */\n    location: _browserEnvironment.location,\n\n    /**\n      @private\n         The browser's `history` object. This is typically equivalent to\n      `window.history`, but may be overridden for testing.\n         @since 1.5.1\n      @property history\n      @default environment.history\n    */\n    history: _browserEnvironment.history,\n\n    /**\n     @private\n        The user agent's global variable. In browsers, this will be `window`.\n        @since 1.11\n     @property global\n     @default window\n    */\n    global: _browserEnvironment.window,\n\n    /**\n      @private\n         The browser's `userAgent`. This is typically equivalent to\n      `navigator.userAgent`, but may be overridden for testing.\n         @since 1.5.1\n      @property userAgent\n      @default environment.history\n    */\n    userAgent: _browserEnvironment.userAgent,\n\n    /**\n      @private\n         This property is used by the router to know whether to cancel the routing\n      setup process, which is needed while we redirect the browser.\n         @since 1.5.1\n      @property cancelRouterSetup\n      @default false\n    */\n    cancelRouterSetup: false\n  });\n\n  function delegateToConcreteImplementation(methodName) {\n    return function (...args) {\n      var {\n        concreteImplementation\n      } = this;\n      (true && !(Boolean(concreteImplementation)) && (0, _debug.assert)(\"AutoLocation's detect() method should be called before calling any other hooks.\", Boolean(concreteImplementation)));\n      return (0, _utils.tryInvoke)(concreteImplementation, methodName, args);\n    };\n  }\n\n  function detectImplementation(options) {\n    var {\n      location,\n      userAgent,\n      history,\n      documentMode,\n      global,\n      rootURL\n    } = options;\n    var implementation = 'none';\n    var cancelRouterSetup = false;\n    var currentPath = (0, _util.getFullPath)(location);\n\n    if ((0, _util.supportsHistory)(userAgent, history)) {\n      var historyPath = getHistoryPath(rootURL, location); // If the browser supports history and we have a history path, we can use\n      // the history location with no redirects.\n\n      if (currentPath === historyPath) {\n        implementation = 'history';\n      } else if (currentPath.substr(0, 2) === '/#') {\n        history.replaceState({\n          path: historyPath\n        }, '', historyPath);\n        implementation = 'history';\n      } else {\n        cancelRouterSetup = true;\n        (0, _util.replacePath)(location, historyPath);\n      }\n    } else if ((0, _util.supportsHashChange)(documentMode, global)) {\n      var hashPath = getHashPath(rootURL, location); // Be sure we're using a hashed path, otherwise let's switch over it to so\n      // we start off clean and consistent. We'll count an index path with no\n      // hash as \"good enough\" as well.\n\n      if (currentPath === hashPath || currentPath === '/' && hashPath === '/#/') {\n        implementation = 'hash';\n      } else {\n        // Our URL isn't in the expected hash-supported format, so we want to\n        // cancel the router setup and replace the URL to start off clean\n        cancelRouterSetup = true;\n        (0, _util.replacePath)(location, hashPath);\n      }\n    }\n\n    if (cancelRouterSetup) {\n      return false;\n    }\n\n    return implementation;\n  }\n  /**\n    @private\n  \n    Returns the current path as it should appear for HistoryLocation supported\n    browsers. This may very well differ from the real current path (e.g. if it\n    starts off as a hashed URL)\n  */\n\n\n  function getHistoryPath(rootURL, location) {\n    var path = (0, _util.getPath)(location);\n    var hash = (0, _util.getHash)(location);\n    var query = (0, _util.getQuery)(location);\n    var rootURLIndex = path.indexOf(rootURL);\n    var routeHash, hashParts;\n    (true && !(rootURLIndex === 0) && (0, _debug.assert)(\"Path \" + path + \" does not start with the provided rootURL \" + rootURL, rootURLIndex === 0)); // By convention, Ember.js routes using HashLocation are required to start\n    // with `#/`. Anything else should NOT be considered a route and should\n    // be passed straight through, without transformation.\n\n    if (hash.substr(0, 2) === '#/') {\n      // There could be extra hash segments after the route\n      hashParts = hash.substr(1).split('#'); // The first one is always the route url\n\n      routeHash = hashParts.shift(); // If the path already has a trailing slash, remove the one\n      // from the hashed route so we don't double up.\n\n      if (path.charAt(path.length - 1) === '/') {\n        routeHash = routeHash.substr(1);\n      } // This is the \"expected\" final order\n\n\n      path += routeHash + query;\n\n      if (hashParts.length) {\n        path += \"#\" + hashParts.join('#');\n      }\n    } else {\n      path += query + hash;\n    }\n\n    return path;\n  }\n  /**\n    @private\n  \n    Returns the current path as it should appear for HashLocation supported\n    browsers. This may very well differ from the real current path.\n  \n    @method _getHashPath\n  */\n\n\n  function getHashPath(rootURL, location) {\n    var path = rootURL;\n    var historyPath = getHistoryPath(rootURL, location);\n    var routePath = historyPath.substr(rootURL.length);\n\n    if (routePath !== '') {\n      if (routePath[0] !== '/') {\n        routePath = \"/\" + routePath;\n      }\n\n      path += \"#\" + routePath;\n    }\n\n    return path;\n  }\n});","define(\"@ember/-internals/routing/lib/location/hash_location\", [\"exports\", \"@ember/-internals/metal\", \"@ember/-internals/runtime\", \"@ember/runloop\", \"@ember/-internals/routing/lib/location/util\"], function (_exports, _metal, _runtime, _runloop, _util) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n  @module @ember/routing\n  */\n\n  /**\n    `HashLocation` implements the location API using the browser's\n    hash. At present, it relies on a `hashchange` event existing in the\n    browser.\n  \n    Using `HashLocation` results in URLs with a `#` (hash sign) separating the\n    server side URL portion of the URL from the portion that is used by Ember.\n  \n    Example:\n  \n    ```app/router.js\n    Router.map(function() {\n      this.route('posts', function() {\n        this.route('new');\n      });\n    });\n  \n    Router.reopen({\n      location: 'hash'\n    });\n    ```\n  \n    This will result in a posts.new url of `/#/posts/new`.\n  \n    @class HashLocation\n    @extends EmberObject\n    @protected\n  */\n  class HashLocation extends _runtime.Object {\n    constructor() {\n      super(...arguments);\n      this.implementation = 'hash';\n    }\n\n    init() {\n      (0, _metal.set)(this, 'location', this._location || window.location);\n      this._hashchangeHandler = undefined;\n    }\n    /**\n      @private\n         Returns normalized location.hash\n         @since 1.5.1\n      @method getHash\n    */\n\n\n    getHash() {\n      return (0, _util.getHash)(this.location);\n    }\n    /**\n      Returns the normalized URL, constructed from `location.hash`.\n         e.g. `#/foo` => `/foo` as well as `#/foo#bar` => `/foo#bar`.\n         By convention, hashed paths must begin with a forward slash, otherwise they\n      are not treated as a path so we can distinguish intent.\n         @private\n      @method getURL\n    */\n\n\n    getURL() {\n      var originalPath = this.getHash().substr(1);\n      var outPath = originalPath;\n\n      if (outPath[0] !== '/') {\n        outPath = '/'; // Only add the # if the path isn't empty.\n        // We do NOT want `/#` since the ampersand\n        // is only included (conventionally) when\n        // the location.hash has a value\n\n        if (originalPath) {\n          outPath += \"#\" + originalPath;\n        }\n      }\n\n      return outPath;\n    }\n    /**\n      Set the `location.hash` and remembers what was set. This prevents\n      `onUpdateURL` callbacks from triggering when the hash was set by\n      `HashLocation`.\n         @private\n      @method setURL\n      @param path {String}\n    */\n\n\n    setURL(path) {\n      this.location.hash = path;\n      (0, _metal.set)(this, 'lastSetURL', path);\n    }\n    /**\n      Uses location.replace to update the url without a page reload\n      or history modification.\n         @private\n      @method replaceURL\n      @param path {String}\n    */\n\n\n    replaceURL(path) {\n      this.location.replace(\"#\" + path);\n      (0, _metal.set)(this, 'lastSetURL', path);\n    }\n    /**\n      Register a callback to be invoked when the hash changes. These\n      callbacks will execute when the user presses the back or forward\n      button, but not after `setURL` is invoked.\n         @private\n      @method onUpdateURL\n      @param callback {Function}\n    */\n\n\n    onUpdateURL(callback) {\n      this._removeEventListener();\n\n      this._hashchangeHandler = (0, _runloop.bind)(this, function () {\n        var path = this.getURL();\n\n        if (this.lastSetURL === path) {\n          return;\n        }\n\n        (0, _metal.set)(this, 'lastSetURL', null);\n        callback(path);\n      });\n      window.addEventListener('hashchange', this._hashchangeHandler);\n    }\n    /**\n      Given a URL, formats it to be placed into the page as part\n      of an element's `href` attribute.\n         This is used, for example, when using the {{action}} helper\n      to generate a URL based on an event.\n         @private\n      @method formatURL\n      @param url {String}\n    */\n\n\n    formatURL(url) {\n      return \"#\" + url;\n    }\n    /**\n      Cleans up the HashLocation event listener.\n         @private\n      @method willDestroy\n    */\n\n\n    willDestroy() {\n      this._removeEventListener();\n    }\n\n    _removeEventListener() {\n      if (this._hashchangeHandler) {\n        window.removeEventListener('hashchange', this._hashchangeHandler);\n      }\n    }\n\n  }\n\n  _exports.default = HashLocation;\n});","define(\"@ember/-internals/routing/lib/location/history_location\", [\"exports\", \"@ember/-internals/metal\", \"@ember/-internals/runtime\", \"@ember/-internals/routing/lib/location/util\"], function (_exports, _metal, _runtime, _util) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n  @module @ember/routing\n  */\n  var popstateFired = false;\n\n  function _uuid() {\n    return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n      var r, v;\n      r = Math.random() * 16 | 0;\n      v = c === 'x' ? r : r & 3 | 8;\n      return v.toString(16);\n    });\n  }\n  /**\n    HistoryLocation implements the location API using the browser's\n    history.pushState API.\n  \n    Using `HistoryLocation` results in URLs that are indistinguishable from a\n    standard URL. This relies upon the browser's `history` API.\n  \n    Example:\n  \n    ```app/router.js\n    Router.map(function() {\n      this.route('posts', function() {\n        this.route('new');\n      });\n    });\n  \n    Router.reopen({\n      location: 'history'\n    });\n    ```\n  \n    This will result in a posts.new url of `/posts/new`.\n  \n    Keep in mind that your server must serve the Ember app at all the routes you\n    define.\n  \n    @class HistoryLocation\n    @extends EmberObject\n    @protected\n  */\n\n\n  class HistoryLocation extends _runtime.Object {\n    constructor() {\n      super(...arguments);\n      this.implementation = 'history';\n      /**\n        Will be pre-pended to path upon state change\n               @property rootURL\n        @default '/'\n        @private\n      */\n\n      this.rootURL = '/';\n    }\n    /**\n      @private\n         Returns normalized location.hash\n         @method getHash\n    */\n\n\n    getHash() {\n      return (0, _util.getHash)(this.location);\n    }\n\n    init() {\n      this._super(...arguments);\n\n      var base = document.querySelector('base');\n      var baseURL = '';\n\n      if (base) {\n        baseURL = base.getAttribute('href');\n      }\n\n      (0, _metal.set)(this, 'baseURL', baseURL);\n      (0, _metal.set)(this, 'location', this.location || window.location);\n      this._popstateHandler = undefined;\n    }\n    /**\n      Used to set state on first call to setURL\n         @private\n      @method initState\n    */\n\n\n    initState() {\n      var history = this.history || window.history;\n      (0, _metal.set)(this, 'history', history);\n      var {\n        state\n      } = history;\n      var path = this.formatURL(this.getURL());\n\n      if (state && state.path === path) {\n        // preserve existing state\n        // used for webkit workaround, since there will be no initial popstate event\n        this._previousURL = this.getURL();\n      } else {\n        this.replaceState(path);\n      }\n    }\n    /**\n      Returns the current `location.pathname` without `rootURL` or `baseURL`\n         @private\n      @method getURL\n      @return url {String}\n    */\n\n\n    getURL() {\n      var {\n        location,\n        rootURL,\n        baseURL\n      } = this;\n      var path = location.pathname; // remove trailing slashes if they exists\n\n      rootURL = rootURL.replace(/\\/$/, '');\n      baseURL = baseURL.replace(/\\/$/, ''); // remove baseURL and rootURL from start of path\n\n      var url = path.replace(new RegExp(\"^\" + baseURL + \"(?=/|$)\"), '').replace(new RegExp(\"^\" + rootURL + \"(?=/|$)\"), '').replace(/\\/\\//g, '/'); // remove extra slashes\n\n      var search = location.search || '';\n      url += search + this.getHash();\n      return url;\n    }\n    /**\n      Uses `history.pushState` to update the url without a page reload.\n         @private\n      @method setURL\n      @param path {String}\n    */\n\n\n    setURL(path) {\n      var {\n        state\n      } = this.history;\n      path = this.formatURL(path);\n\n      if (!state || state.path !== path) {\n        this.pushState(path);\n      }\n    }\n    /**\n      Uses `history.replaceState` to update the url without a page reload\n      or history modification.\n         @private\n      @method replaceURL\n      @param path {String}\n    */\n\n\n    replaceURL(path) {\n      var {\n        state\n      } = this.history;\n      path = this.formatURL(path);\n\n      if (!state || state.path !== path) {\n        this.replaceState(path);\n      }\n    }\n    /**\n     Pushes a new state.\n        @private\n     @method pushState\n     @param path {String}\n    */\n\n\n    pushState(path) {\n      var state = {\n        path,\n        uuid: _uuid()\n      };\n      this.history.pushState(state, null, path); // used for webkit workaround\n\n      this._previousURL = this.getURL();\n    }\n    /**\n     Replaces the current state.\n        @private\n     @method replaceState\n     @param path {String}\n    */\n\n\n    replaceState(path) {\n      var state = {\n        path,\n        uuid: _uuid()\n      };\n      this.history.replaceState(state, null, path); // used for webkit workaround\n\n      this._previousURL = this.getURL();\n    }\n    /**\n      Register a callback to be invoked whenever the browser\n      history changes, including using forward and back buttons.\n         @private\n      @method onUpdateURL\n      @param callback {Function}\n    */\n\n\n    onUpdateURL(callback) {\n      this._removeEventListener();\n\n      this._popstateHandler = () => {\n        // Ignore initial page load popstate event in Chrome\n        if (!popstateFired) {\n          popstateFired = true;\n\n          if (this.getURL() === this._previousURL) {\n            return;\n          }\n        }\n\n        callback(this.getURL());\n      };\n\n      window.addEventListener('popstate', this._popstateHandler);\n    }\n    /**\n      Used when using `{{action}}` helper.  The url is always appended to the rootURL.\n         @private\n      @method formatURL\n      @param url {String}\n      @return formatted url {String}\n    */\n\n\n    formatURL(url) {\n      var {\n        rootURL,\n        baseURL\n      } = this;\n\n      if (url !== '') {\n        // remove trailing slashes if they exists\n        rootURL = rootURL.replace(/\\/$/, '');\n        baseURL = baseURL.replace(/\\/$/, '');\n      } else if (baseURL[0] === '/' && rootURL[0] === '/') {\n        // if baseURL and rootURL both start with a slash\n        // ... remove trailing slash from baseURL if it exists\n        baseURL = baseURL.replace(/\\/$/, '');\n      }\n\n      return baseURL + rootURL + url;\n    }\n    /**\n      Cleans up the HistoryLocation event listener.\n         @private\n      @method willDestroy\n    */\n\n\n    willDestroy() {\n      this._removeEventListener();\n    }\n\n    _removeEventListener() {\n      if (this._popstateHandler) {\n        window.removeEventListener('popstate', this._popstateHandler);\n      }\n    }\n\n  }\n\n  _exports.default = HistoryLocation;\n});","define(\"@ember/-internals/routing/lib/location/none_location\", [\"exports\", \"@ember/-internals/metal\", \"@ember/-internals/runtime\", \"@ember/debug\"], function (_exports, _metal, _runtime, _debug) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n  @module @ember/routing\n  */\n\n  /**\n    NoneLocation does not interact with the browser. It is useful for\n    testing, or when you need to manage state with your Router, but temporarily\n    don't want it to muck with the URL (for example when you embed your\n    application in a larger page).\n  \n    Using `NoneLocation` causes Ember to not store the applications URL state\n    in the actual URL. This is generally used for testing purposes, and is one\n    of the changes made when calling `App.setupForTesting()`.\n  \n    @class NoneLocation\n    @extends EmberObject\n    @protected\n  */\n  class NoneLocation extends _runtime.Object {\n    constructor() {\n      super(...arguments);\n      this.implementation = 'none';\n    }\n\n    detect() {\n      var {\n        rootURL\n      } = this;\n      (true && !(rootURL.charAt(rootURL.length - 1) === '/') && (0, _debug.assert)('rootURL must end with a trailing forward slash e.g. \"/app/\"', rootURL.charAt(rootURL.length - 1) === '/'));\n    }\n    /**\n      Returns the current path without `rootURL`.\n         @private\n      @method getURL\n      @return {String} path\n    */\n\n\n    getURL() {\n      var {\n        path,\n        rootURL\n      } = this; // remove trailing slashes if they exists\n\n      rootURL = rootURL.replace(/\\/$/, ''); // remove rootURL from url\n\n      return path.replace(new RegExp(\"^\" + rootURL + \"(?=/|$)\"), '');\n    }\n    /**\n      Set the path and remembers what was set. Using this method\n      to change the path will not invoke the `updateURL` callback.\n         @private\n      @method setURL\n      @param path {String}\n    */\n\n\n    setURL(path) {\n      (0, _metal.set)(this, 'path', path);\n    }\n    /**\n      Register a callback to be invoked when the path changes. These\n      callbacks will execute when the user presses the back or forward\n      button, but not after `setURL` is invoked.\n         @private\n      @method onUpdateURL\n      @param callback {Function}\n    */\n\n\n    onUpdateURL(callback) {\n      this.updateCallback = callback;\n    }\n    /**\n      Sets the path and calls the `updateURL` callback.\n         @private\n      @method handleURL\n      @param url {String}\n    */\n\n\n    handleURL(url) {\n      (0, _metal.set)(this, 'path', url);\n      this.updateCallback(url);\n    }\n    /**\n      Given a URL, formats it to be placed into the page as part\n      of an element's `href` attribute.\n         This is used, for example, when using the {{action}} helper\n      to generate a URL based on an event.\n         @private\n      @method formatURL\n      @param url {String}\n      @return {String} url\n    */\n\n\n    formatURL(url) {\n      var {\n        rootURL\n      } = this;\n\n      if (url !== '') {\n        // remove trailing slashes if they exists\n        rootURL = rootURL.replace(/\\/$/, '');\n      }\n\n      return rootURL + url;\n    }\n\n  }\n\n  _exports.default = NoneLocation;\n  NoneLocation.reopen({\n    path: '',\n\n    /**\n      Will be pre-pended to path.\n         @private\n      @property rootURL\n      @default '/'\n    */\n    rootURL: '/'\n  });\n});","define(\"@ember/-internals/routing/lib/location/util\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.getPath = getPath;\n  _exports.getQuery = getQuery;\n  _exports.getHash = getHash;\n  _exports.getFullPath = getFullPath;\n  _exports.getOrigin = getOrigin;\n  _exports.supportsHashChange = supportsHashChange;\n  _exports.supportsHistory = supportsHistory;\n  _exports.replacePath = replacePath;\n\n  /**\n    @private\n  \n    Returns the current `location.pathname`, normalized for IE inconsistencies.\n  */\n  function getPath(location) {\n    var pathname = location.pathname; // Various versions of IE/Opera don't always return a leading slash\n\n    if (pathname[0] !== '/') {\n      pathname = \"/\" + pathname;\n    }\n\n    return pathname;\n  }\n  /**\n    @private\n  \n    Returns the current `location.search`.\n  */\n\n\n  function getQuery(location) {\n    return location.search;\n  }\n  /**\n    @private\n  \n    Returns the hash or empty string\n  */\n\n\n  function getHash(location) {\n    if (location.hash !== undefined) {\n      return location.hash.substr(0);\n    }\n\n    return '';\n  }\n\n  function getFullPath(location) {\n    return getPath(location) + getQuery(location) + getHash(location);\n  }\n\n  function getOrigin(location) {\n    var origin = location.origin; // Older browsers, especially IE, don't have origin\n\n    if (!origin) {\n      origin = location.protocol + \"//\" + location.hostname;\n\n      if (location.port) {\n        origin += \":\" + location.port;\n      }\n    }\n\n    return origin;\n  }\n  /*\n    `documentMode` only exist in Internet Explorer, and it's tested because IE8 running in\n    IE7 compatibility mode claims to support `onhashchange` but actually does not.\n  \n    `global` is an object that may have an `onhashchange` property.\n  \n    @private\n    @function supportsHashChange\n  */\n\n\n  function supportsHashChange(documentMode, global) {\n    return global && 'onhashchange' in global && (documentMode === undefined || documentMode > 7);\n  }\n  /*\n    `userAgent` is a user agent string. We use user agent testing here, because\n    the stock Android browser is known to have buggy versions of the History API,\n    in some Android versions.\n  \n    @private\n    @function supportsHistory\n  */\n\n\n  function supportsHistory(userAgent, history) {\n    // Boosted from Modernizr: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js\n    // The stock browser on Android 2.2 & 2.3, and 4.0.x returns positive on history support\n    // Unfortunately support is really buggy and there is no clean way to detect\n    // these bugs, so we fall back to a user agent sniff :(\n    // We only want Android 2 and 4.0, stock browser, and not Chrome which identifies\n    // itself as 'Mobile Safari' as well, nor Windows Phone.\n    if ((userAgent.indexOf('Android 2.') !== -1 || userAgent.indexOf('Android 4.0') !== -1) && userAgent.indexOf('Mobile Safari') !== -1 && userAgent.indexOf('Chrome') === -1 && userAgent.indexOf('Windows Phone') === -1) {\n      return false;\n    }\n\n    return Boolean(history && 'pushState' in history);\n  }\n  /**\n    Replaces the current location, making sure we explicitly include the origin\n    to prevent redirecting to a different origin.\n  \n    @private\n  */\n\n\n  function replacePath(location, path) {\n    location.replace(getOrigin(location) + path);\n  }\n});","define(\"@ember/-internals/routing/lib/services/router\", [\"exports\", \"@ember/-internals/runtime\", \"@ember/debug\", \"@ember/object/computed\", \"@ember/service\", \"@ember/-internals/routing/lib/utils\"], function (_exports, _runtime, _debug, _computed, _service, _utils) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  var freezeRouteInfo;\n\n  if (true\n  /* DEBUG */\n  ) {\n    freezeRouteInfo = transition => {\n      if (transition.from !== null && !Object.isFrozen(transition.from)) {\n        Object.freeze(transition.from);\n      }\n\n      if (transition.to !== null && !Object.isFrozen(transition.to)) {\n        Object.freeze(transition.to);\n      }\n    };\n  }\n\n  function cleanURL(url, rootURL) {\n    if (rootURL === '/') {\n      return url;\n    }\n\n    return url.substr(rootURL.length, url.length);\n  }\n  /**\n     The Router service is the public API that provides access to the router.\n  \n     The immediate benefit of the Router service is that you can inject it into components,\n     giving them a friendly way to initiate transitions and ask questions about the current\n     global router state.\n  \n     In this example, the Router service is injected into a component to initiate a transition\n     to a dedicated route:\n  \n     ```app/components/example.js\n     import Component from '@glimmer/component';\n     import { action } from '@ember/object';\n     import { inject as service } from '@ember/service';\n  \n     export default class ExampleComponent extends Component {\n       @service router;\n  \n       @action\n       next() {\n         this.router.transitionTo('other.route');\n       }\n     }\n     ```\n  \n     Like any service, it can also be injected into helpers, routes, etc.\n  \n     @public\n     @extends Service\n     @class RouterService\n   */\n\n\n  class RouterService extends _service.default {\n    init() {\n      super.init(...arguments);\n\n      this._router.on('routeWillChange', transition => {\n        if (true\n        /* DEBUG */\n        ) {\n          freezeRouteInfo(transition);\n        }\n\n        this.trigger('routeWillChange', transition);\n      });\n\n      this._router.on('routeDidChange', transition => {\n        if (true\n        /* DEBUG */\n        ) {\n          freezeRouteInfo(transition);\n        }\n\n        this.trigger('routeDidChange', transition);\n      });\n    }\n    /**\n       Transition the application into another route. The route may\n       be either a single route or route path:\n          See [transitionTo](/ember/release/classes/Route/methods/transitionTo?anchor=transitionTo) for more info.\n          Calling `transitionTo` from the Router service will cause default query parameter values to be included in the URL.\n       This behavior is different from calling `transitionTo` on a route or `transitionToRoute` on a controller.\n       See the [Router Service RFC](https://github.com/emberjs/rfcs/blob/master/text/0095-router-service.md#query-parameter-semantics) for more info.\n          In the following example we use the Router service to navigate to a route with a\n       specific model from a Component.\n          ```javascript\n       import Component from '@glimmer/component';\n       import { action } from '@ember/object';\n       import { inject as service } from '@ember/service';\n          export default class extends Component {\n         @service router;\n            @action\n         goToComments(post) {\n           this.router.transitionTo('comments', post);\n         }\n       }\n       ```\n          @method transitionTo\n       @param {String} routeNameOrUrl the name of the route or a URL\n       @param {...Object} models the model(s) or identifier(s) to be used while\n         transitioning to the route.\n       @param {Object} [options] optional hash with a queryParams property\n         containing a mapping of query parameters\n       @return {Transition} the transition object associated with this\n         attempted transition\n       @public\n     */\n\n\n    transitionTo(...args) {\n      if ((0, _utils.resemblesURL)(args[0])) {\n        return this._router._doURLTransition('transitionTo', args[0]);\n      }\n\n      var {\n        routeName,\n        models,\n        queryParams\n      } = (0, _utils.extractRouteArgs)(args);\n\n      var transition = this._router._doTransition(routeName, models, queryParams, true);\n\n      transition['_keepDefaultQueryParamValues'] = true;\n      return transition;\n    }\n    /**\n       Transition into another route while replacing the current URL, if possible.\n       The route may be either a single route or route path:\n          See [replaceWith](/ember/release/classes/Route/methods/replaceWith?anchor=replaceWith) for more info.\n          Calling `replaceWith` from the Router service will cause default query parameter values to be included in the URL.\n       This behavior is different from calling `replaceWith` on a route.\n       See the [Router Service RFC](https://github.com/emberjs/rfcs/blob/master/text/0095-router-service.md#query-parameter-semantics) for more info.\n          Usage example:\n          ```app/routes/application.js\n       import Route from '@ember/routing/route';\n          export default class extends Route {\n         beforeModel() {\n           if (!authorized()){\n             this.replaceWith('unauthorized');\n           }\n         }\n       });\n       ```\n          @method replaceWith\n       @param {String} routeNameOrUrl the name of the route or a URL\n       @param {...Object} models the model(s) or identifier(s) to be used while\n         transitioning to the route.\n       @param {Object} [options] optional hash with a queryParams property\n         containing a mapping of query parameters\n       @return {Transition} the transition object associated with this\n         attempted transition\n       @public\n     */\n\n\n    replaceWith()\n    /* routeNameOrUrl, ...models, options */\n    {\n      return this.transitionTo(...arguments).method('replace');\n    }\n    /**\n      Generate a URL based on the supplied route name and optionally a model. The\n      URL is returned as a string that can be used for any purpose.\n         In this example, the URL for the `author.books` route for a given author\n      is copied to the clipboard.\n         ```app/templates/application.hbs\n      <CopyLink @author={{hash id=\"tomster\" name=\"Tomster\"}} />\n      ```\n         ```app/components/copy-link.js\n      import Component from '@glimmer/component';\n      import { inject as service } from '@ember/service';\n      import { action } from '@ember/object';\n         export default class CopyLinkComponent extends Component {\n        @service router;\n        @service clipboard;\n           @action\n        copyBooksURL() {\n          if (this.author) {\n            const url = this.router.urlFor('author.books', this.args.author);\n            this.clipboard.set(url);\n            // Clipboard now has /author/tomster/books\n          }\n        }\n      }\n      ```\n         Just like with `transitionTo` and `replaceWith`, `urlFor` can also handle\n      query parameters.\n         ```app/templates/application.hbs\n      <CopyLink @author={{hash id=\"tomster\" name=\"Tomster\"}} />\n      ```\n         ```app/components/copy-link.js\n      import Component from '@glimmer/component';\n      import { inject as service } from '@ember/service';\n      import { action } from '@ember/object';\n         export default class CopyLinkComponent extends Component {\n        @service router;\n        @service clipboard;\n           @action\n        copyOnlyEmberBooksURL() {\n          if (this.author) {\n            const url = this.router.urlFor('author.books', this.author, {\n              queryParams: { filter: 'emberjs' }\n            });\n            this.clipboard.set(url);\n            // Clipboard now has /author/tomster/books?filter=emberjs\n          }\n        }\n      }\n      ```\n          @method urlFor\n       @param {String} routeName the name of the route\n       @param {...Object} models the model(s) or identifier(s) to be used while\n         transitioning to the route.\n       @param {Object} [options] optional hash with a queryParams property\n         containing a mapping of query parameters\n       @return {String} the string representing the generated URL\n       @public\n     */\n\n\n    urlFor(routeName, ...args) {\n      return this._router.generate(routeName, ...args);\n    }\n    /**\n       Determines whether a route is active.\n          @method isActive\n       @param {String} routeName the name of the route\n       @param {...Object} models the model(s) or identifier(s) to be used while\n         transitioning to the route.\n       @param {Object} [options] optional hash with a queryParams property\n         containing a mapping of query parameters\n       @return {boolean} true if the provided routeName/models/queryParams are active\n       @public\n     */\n\n\n    isActive(...args) {\n      var {\n        routeName,\n        models,\n        queryParams\n      } = (0, _utils.extractRouteArgs)(args);\n      var routerMicrolib = this._router._routerMicrolib;\n\n      if (!routerMicrolib.isActiveIntent(routeName, models)) {\n        return false;\n      }\n\n      var hasQueryParams = Object.keys(queryParams).length > 0;\n\n      if (hasQueryParams) {\n        this._router._prepareQueryParams(routeName, models, queryParams, true\n        /* fromRouterService */\n        );\n\n        return (0, _utils.shallowEqual)(queryParams, routerMicrolib.state.queryParams);\n      }\n\n      return true;\n    }\n    /**\n       Takes a string URL and returns a `RouteInfo` for the leafmost route represented\n       by the URL. Returns `null` if the URL is not recognized. This method expects to\n       receive the actual URL as seen by the browser including the app's `rootURL`.\n          See [RouteInfo](/ember/release/classes/RouteInfo) for more info.\n          In the following example `recognize` is used to verify if a path belongs to our\n       application before transitioning to it.\n          ```\n       import Component from '@ember/component';\n       import { inject as service } from '@ember/service';\n          export default class extends Component {\n         @service router;\n         path = '/';\n            click() {\n           if (this.router.recognize(this.path)) {\n             this.router.transitionTo(this.path);\n           }\n         }\n       }\n       ```\n           @method recognize\n        @param {String} url\n        @public\n      */\n\n\n    recognize(url) {\n      (true && !(url.indexOf(this.rootURL) === 0) && (0, _debug.assert)(\"You must pass a url that begins with the application's rootURL \\\"\" + this.rootURL + \"\\\"\", url.indexOf(this.rootURL) === 0));\n      var internalURL = cleanURL(url, this.rootURL);\n      return this._router._routerMicrolib.recognize(internalURL);\n    }\n    /**\n      Takes a string URL and returns a promise that resolves to a\n      `RouteInfoWithAttributes` for the leafmost route represented by the URL.\n      The promise rejects if the URL is not recognized or an unhandled exception\n      is encountered. This method expects to receive the actual URL as seen by\n      the browser including the app's `rootURL`.\n           @method recognizeAndLoad\n        @param {String} url\n        @public\n     */\n\n\n    recognizeAndLoad(url) {\n      (true && !(url.indexOf(this.rootURL) === 0) && (0, _debug.assert)(\"You must pass a url that begins with the application's rootURL \\\"\" + this.rootURL + \"\\\"\", url.indexOf(this.rootURL) === 0));\n      var internalURL = cleanURL(url, this.rootURL);\n      return this._router._routerMicrolib.recognizeAndLoad(internalURL);\n    }\n\n  }\n\n  _exports.default = RouterService;\n  RouterService.reopen(_runtime.Evented, {\n    /**\n       Name of the current route.\n          This property represents the logical name of the route,\n       which is comma separated.\n       For the following router:\n          ```app/router.js\n       Router.map(function() {\n         this.route('about');\n         this.route('blog', function () {\n           this.route('post', { path: ':post_id' });\n         });\n       });\n       ```\n          It will return:\n          * `index` when you visit `/`\n       * `about` when you visit `/about`\n       * `blog.index` when you visit `/blog`\n       * `blog.post` when you visit `/blog/some-post-id`\n          @property currentRouteName\n       @type String\n       @public\n     */\n    currentRouteName: (0, _computed.readOnly)('_router.currentRouteName'),\n\n    /**\n       Current URL for the application.\n         This property represents the URL path for this route.\n      For the following router:\n          ```app/router.js\n       Router.map(function() {\n         this.route('about');\n         this.route('blog', function () {\n           this.route('post', { path: ':post_id' });\n         });\n       });\n       ```\n          It will return:\n          * `/` when you visit `/`\n       * `/about` when you visit `/about`\n       * `/blog` when you visit `/blog`\n       * `/blog/some-post-id` when you visit `/blog/some-post-id`\n          @property currentURL\n       @type String\n       @public\n     */\n    currentURL: (0, _computed.readOnly)('_router.currentURL'),\n\n    /**\n      The `location` property returns what implementation of the `location` API\n      your application is using, which determines what type of URL is being used.\n         See [Location](/ember/release/classes/Location) for more information.\n         To force a particular `location` API implementation to be used in your\n      application you can set a location type on your `config/environment`.\n      For example, to set the `history` type:\n         ```config/environment.js\n      'use strict';\n         module.exports = function(environment) {\n        let ENV = {\n          modulePrefix: 'router-service',\n          environment,\n          rootURL: '/',\n          locationType: 'history',\n          ...\n        }\n      }\n      ```\n         The following location types are available by default:\n      `auto`, `hash`, `history`, `none`.\n         See [HashLocation](/ember/release/classes/HashLocation).\n      See [HistoryLocation](/ember/release/classes/HistoryLocation).\n      See [NoneLocation](/ember/release/classes/NoneLocation).\n      See [AutoLocation](/ember/release/classes/AutoLocation).\n         @property location\n      @default 'hash'\n      @see {Location}\n      @public\n    */\n    location: (0, _computed.readOnly)('_router.location'),\n\n    /**\n      The `rootURL` property represents the URL of the root of\n      the application, '/' by default.\n      This prefix is assumed on all routes defined on this app.\n         If you change the `rootURL` in your environment configuration\n      like so:\n         ```config/environment.js\n      'use strict';\n         module.exports = function(environment) {\n        let ENV = {\n          modulePrefix: 'router-service',\n          environment,\n          rootURL: '/my-root',\n        …\n        }\n      ]\n      ```\n         This property will return `/my-root`.\n         @property rootURL\n      @default '/'\n      @public\n    */\n    rootURL: (0, _computed.readOnly)('_router.rootURL'),\n\n    /**\n      The `currentRoute` property contains metadata about the current leaf route.\n      It returns a `RouteInfo` object that has information like the route name,\n      params, query params and more.\n         See [RouteInfo](/ember/release/classes/RouteInfo) for more info.\n         This property is guaranteed to change whenever a route transition\n      happens (even when that transition only changes parameters\n      and doesn't change the active route).\n         Usage example:\n      ```app/components/header.js\n        import Component from '@glimmer/component';\n        import { inject as service } from '@ember/service';\n        import { notEmpty } from '@ember/object/computed';\n           export default class extends Component {\n          @service router;\n             @notEmpty('router.currentRoute.child') isChildRoute;\n        });\n      ```\n          @property currentRoute\n       @type RouteInfo\n       @public\n     */\n    currentRoute: (0, _computed.readOnly)('_router.currentRoute')\n  });\n});","define(\"@ember/-internals/routing/lib/services/routing\", [\"exports\", \"@ember/object/computed\", \"@ember/polyfills\", \"@ember/service\"], function (_exports, _computed, _polyfills, _service) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n  @module ember\n  */\n\n  /**\n    The Routing service is used by LinkComponent, and provides facilities for\n    the component/view layer to interact with the router.\n  \n    This is a private service for internal usage only. For public usage,\n    refer to the `Router` service.\n  \n    @private\n    @class RoutingService\n  */\n  class RoutingService extends _service.default {\n    hasRoute(routeName) {\n      return this.router.hasRoute(routeName);\n    }\n\n    transitionTo(routeName, models, queryParams, shouldReplace) {\n      var transition = this.router._doTransition(routeName, models, queryParams);\n\n      if (shouldReplace) {\n        transition.method('replace');\n      }\n\n      return transition;\n    }\n\n    normalizeQueryParams(routeName, models, queryParams) {\n      this.router._prepareQueryParams(routeName, models, queryParams);\n    }\n\n    generateURL(routeName, models, queryParams) {\n      var router = this.router; // return early when the router microlib is not present, which is the case for {{link-to}} in integration tests\n\n      if (!router._routerMicrolib) {\n        return;\n      }\n\n      var visibleQueryParams = {};\n\n      if (queryParams) {\n        (0, _polyfills.assign)(visibleQueryParams, queryParams);\n        this.normalizeQueryParams(routeName, models, visibleQueryParams);\n      }\n\n      return router.generate(routeName, ...models, {\n        queryParams: visibleQueryParams\n      });\n    }\n\n    isActiveForRoute(contexts, queryParams, routeName, routerState, isCurrentWhenSpecified) {\n      var handlers = this.router._routerMicrolib.recognizer.handlersFor(routeName);\n\n      var leafName = handlers[handlers.length - 1].handler;\n      var maximumContexts = numberOfContextsAcceptedByHandler(routeName, handlers); // NOTE: any ugliness in the calculation of activeness is largely\n      // due to the fact that we support automatic normalizing of\n      // `resource` -> `resource.index`, even though there might be\n      // dynamic segments / query params defined on `resource.index`\n      // which complicates (and makes somewhat ambiguous) the calculation\n      // of activeness for links that link to `resource` instead of\n      // directly to `resource.index`.\n      // if we don't have enough contexts revert back to full route name\n      // this is because the leaf route will use one of the contexts\n\n      if (contexts.length > maximumContexts) {\n        routeName = leafName;\n      }\n\n      return routerState.isActiveIntent(routeName, contexts, queryParams, !isCurrentWhenSpecified);\n    }\n\n  }\n\n  _exports.default = RoutingService;\n  RoutingService.reopen({\n    targetState: (0, _computed.readOnly)('router.targetState'),\n    currentState: (0, _computed.readOnly)('router.currentState'),\n    currentRouteName: (0, _computed.readOnly)('router.currentRouteName'),\n    currentPath: (0, _computed.readOnly)('router.currentPath')\n  });\n\n  function numberOfContextsAcceptedByHandler(handlerName, handlerInfos) {\n    var req = 0;\n\n    for (var i = 0; i < handlerInfos.length; i++) {\n      req += handlerInfos[i].names.length;\n\n      if (handlerInfos[i].handler === handlerName) {\n        break;\n      }\n    }\n\n    return req;\n  }\n});","define(\"@ember/-internals/routing/lib/system/cache\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n    A two-tiered cache with support for fallback values when doing lookups.\n    Uses \"buckets\" and then \"keys\" to cache values.\n  \n    @private\n    @class BucketCache\n  */\n  class BucketCache {\n    constructor() {\n      this.cache = new Map();\n    }\n\n    has(bucketKey) {\n      return this.cache.has(bucketKey);\n    }\n\n    stash(bucketKey, key, value) {\n      var bucket = this.cache.get(bucketKey);\n\n      if (bucket === undefined) {\n        bucket = new Map();\n        this.cache.set(bucketKey, bucket);\n      }\n\n      bucket.set(key, value);\n    }\n\n    lookup(bucketKey, prop, defaultValue) {\n      if (!this.has(bucketKey)) {\n        return defaultValue;\n      }\n\n      var bucket = this.cache.get(bucketKey);\n\n      if (bucket.has(prop)) {\n        return bucket.get(prop);\n      } else {\n        return defaultValue;\n      }\n    }\n\n  }\n\n  _exports.default = BucketCache;\n});","define(\"@ember/-internals/routing/lib/system/controller_for\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = controllerFor;\n\n  /**\n  @module ember\n  */\n\n  /**\n    Finds a controller instance.\n  \n    @for Ember\n    @method controllerFor\n    @private\n  */\n  function controllerFor(container, controllerName, lookupOptions) {\n    return container.lookup(\"controller:\" + controllerName, lookupOptions);\n  }\n});","define(\"@ember/-internals/routing/lib/system/dsl\", [\"exports\", \"@ember/debug\", \"@ember/polyfills\"], function (_exports, _debug, _polyfills) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  var uuid = 0;\n\n  function isCallback(value) {\n    return typeof value === 'function';\n  }\n\n  function isOptions(value) {\n    return value !== null && typeof value === 'object';\n  }\n\n  class DSLImpl {\n    constructor(name = null, options) {\n      this.explicitIndex = false;\n      this.parent = name;\n      this.enableLoadingSubstates = Boolean(options && options.enableLoadingSubstates);\n      this.matches = [];\n      this.options = options;\n    }\n\n    route(name, _options, _callback) {\n      var options;\n      var callback = null;\n      var dummyErrorRoute = \"/_unused_dummy_error_path_route_\" + name + \"/:error\";\n\n      if (isCallback(_options)) {\n        (true && !(arguments.length === 2) && (0, _debug.assert)('Unexpected arguments', arguments.length === 2));\n        options = {};\n        callback = _options;\n      } else if (isCallback(_callback)) {\n        (true && !(arguments.length === 3) && (0, _debug.assert)('Unexpected arguments', arguments.length === 3));\n        (true && !(isOptions(_options)) && (0, _debug.assert)('Unexpected arguments', isOptions(_options)));\n        options = _options;\n        callback = _callback;\n      } else {\n        options = _options || {};\n      }\n\n      (true && !((() => {\n        if (options.overrideNameAssertion === true) {\n          return true;\n        }\n\n        return ['basic', 'application'].indexOf(name) === -1;\n      })()) && (0, _debug.assert)(\"'\" + name + \"' cannot be used as a route name.\", (() => {\n        if (options.overrideNameAssertion === true) {\n          return true;\n        }\n\n        return ['basic', 'application'].indexOf(name) === -1;\n      })()));\n      (true && !(name.indexOf(':') === -1) && (0, _debug.assert)(\"'\" + name + \"' is not a valid route name. It cannot contain a ':'. You may want to use the 'path' option instead.\", name.indexOf(':') === -1));\n\n      if (this.enableLoadingSubstates) {\n        createRoute(this, name + \"_loading\", {\n          resetNamespace: options.resetNamespace\n        });\n        createRoute(this, name + \"_error\", {\n          resetNamespace: options.resetNamespace,\n          path: dummyErrorRoute\n        });\n      }\n\n      if (callback) {\n        var fullName = getFullName(this, name, options.resetNamespace);\n        var dsl = new DSLImpl(fullName, this.options);\n        createRoute(dsl, 'loading');\n        createRoute(dsl, 'error', {\n          path: dummyErrorRoute\n        });\n        callback.call(dsl);\n        createRoute(this, name, options, dsl.generate());\n      } else {\n        createRoute(this, name, options);\n      }\n    }\n    /* eslint-enable no-dupe-class-members */\n\n\n    push(url, name, callback, serialize) {\n      var parts = name.split('.');\n\n      if (this.options.engineInfo) {\n        var localFullName = name.slice(this.options.engineInfo.fullName.length + 1);\n        var routeInfo = (0, _polyfills.assign)({\n          localFullName\n        }, this.options.engineInfo);\n\n        if (serialize) {\n          routeInfo.serializeMethod = serialize;\n        }\n\n        this.options.addRouteForEngine(name, routeInfo);\n      } else if (serialize) {\n        throw new Error(\"Defining a route serializer on route '\" + name + \"' outside an Engine is not allowed.\");\n      }\n\n      if (url === '' || url === '/' || parts[parts.length - 1] === 'index') {\n        this.explicitIndex = true;\n      }\n\n      this.matches.push(url, name, callback);\n    }\n\n    generate() {\n      var dslMatches = this.matches;\n\n      if (!this.explicitIndex) {\n        this.route('index', {\n          path: '/'\n        });\n      }\n\n      return match => {\n        for (var i = 0; i < dslMatches.length; i += 3) {\n          match(dslMatches[i]).to(dslMatches[i + 1], dslMatches[i + 2]);\n        }\n      };\n    }\n\n    mount(_name, options = {}) {\n      var engineRouteMap = this.options.resolveRouteMap(_name);\n      var name = _name;\n\n      if (options.as) {\n        name = options.as;\n      }\n\n      var fullName = getFullName(this, name, options.resetNamespace);\n      var engineInfo = {\n        name: _name,\n        instanceId: uuid++,\n        mountPoint: fullName,\n        fullName\n      };\n      var path = options.path;\n\n      if (typeof path !== 'string') {\n        path = \"/\" + name;\n      }\n\n      var callback;\n      var dummyErrorRoute = \"/_unused_dummy_error_path_route_\" + name + \"/:error\";\n\n      if (engineRouteMap) {\n        var shouldResetEngineInfo = false;\n        var oldEngineInfo = this.options.engineInfo;\n\n        if (oldEngineInfo) {\n          shouldResetEngineInfo = true;\n          this.options.engineInfo = engineInfo;\n        }\n\n        var optionsForChild = (0, _polyfills.assign)({\n          engineInfo\n        }, this.options);\n        var childDSL = new DSLImpl(fullName, optionsForChild);\n        createRoute(childDSL, 'loading');\n        createRoute(childDSL, 'error', {\n          path: dummyErrorRoute\n        });\n        engineRouteMap.class.call(childDSL);\n        callback = childDSL.generate();\n\n        if (shouldResetEngineInfo) {\n          this.options.engineInfo = oldEngineInfo;\n        }\n      }\n\n      var localFullName = 'application';\n      var routeInfo = (0, _polyfills.assign)({\n        localFullName\n      }, engineInfo);\n\n      if (this.enableLoadingSubstates) {\n        // These values are important to register the loading routes under their\n        // proper names for the Router and within the Engine's registry.\n        var substateName = name + \"_loading\";\n        var _localFullName = \"application_loading\";\n\n        var _routeInfo = (0, _polyfills.assign)({\n          localFullName: _localFullName\n        }, engineInfo);\n\n        createRoute(this, substateName, {\n          resetNamespace: options.resetNamespace\n        });\n        this.options.addRouteForEngine(substateName, _routeInfo);\n        substateName = name + \"_error\";\n        _localFullName = \"application_error\";\n        _routeInfo = (0, _polyfills.assign)({\n          localFullName: _localFullName\n        }, engineInfo);\n        createRoute(this, substateName, {\n          resetNamespace: options.resetNamespace,\n          path: dummyErrorRoute\n        });\n        this.options.addRouteForEngine(substateName, _routeInfo);\n      }\n\n      this.options.addRouteForEngine(fullName, routeInfo);\n      this.push(path, fullName, callback);\n    }\n\n  }\n\n  _exports.default = DSLImpl;\n\n  function canNest(dsl) {\n    return dsl.parent !== 'application';\n  }\n\n  function getFullName(dsl, name, resetNamespace) {\n    if (canNest(dsl) && resetNamespace !== true) {\n      return dsl.parent + \".\" + name;\n    } else {\n      return name;\n    }\n  }\n\n  function createRoute(dsl, name, options = {}, callback) {\n    var fullName = getFullName(dsl, name, options.resetNamespace);\n\n    if (typeof options.path !== 'string') {\n      options.path = \"/\" + name;\n    }\n\n    dsl.push(options.path, fullName, callback, options.serialize);\n  }\n});","define(\"@ember/-internals/routing/lib/system/engines\", [], function () {\n  \"use strict\";\n});","define(\"@ember/-internals/routing/lib/system/generate_controller\", [\"exports\", \"@ember/-internals/metal\", \"@ember/debug\"], function (_exports, _metal, _debug) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.generateControllerFactory = generateControllerFactory;\n  _exports.default = generateController;\n\n  /**\n  @module ember\n  */\n\n  /**\n    Generates a controller factory\n  \n    @for Ember\n    @method generateControllerFactory\n    @private\n  */\n  function generateControllerFactory(owner, controllerName) {\n    var Factory = owner.factoryFor('controller:basic').class;\n    Factory = Factory.extend({\n      toString() {\n        return \"(generated \" + controllerName + \" controller)\";\n      }\n\n    });\n    var fullName = \"controller:\" + controllerName;\n    owner.register(fullName, Factory);\n    return owner.factoryFor(fullName);\n  }\n  /**\n    Generates and instantiates a controller extending from `controller:basic`\n    if present, or `Controller` if not.\n  \n    @for Ember\n    @method generateController\n    @private\n    @since 1.3.0\n  */\n\n\n  function generateController(owner, controllerName) {\n    generateControllerFactory(owner, controllerName);\n    var fullName = \"controller:\" + controllerName;\n    var instance = owner.lookup(fullName);\n\n    if (true\n    /* DEBUG */\n    ) {\n      if ((0, _metal.get)(instance, 'namespace.LOG_ACTIVE_GENERATION')) {\n        (0, _debug.info)(\"generated -> \" + fullName, {\n          fullName\n        });\n      }\n    }\n\n    return instance;\n  }\n});","define(\"@ember/-internals/routing/lib/system/query_params\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  class QueryParams {\n    constructor(values = null) {\n      this.isQueryParams = true;\n      this.values = values;\n    }\n\n  }\n\n  _exports.default = QueryParams;\n});","define(\"@ember/-internals/routing/lib/system/route-info\", [], function () {\n  \"use strict\";\n  /**\n    A `RouteInfoWithAttributes` is an object that contains\n    metadata, including the resolved value from the routes\n    `model` hook. Like `RouteInfo`, a `RouteInfoWithAttributes`\n    represents a specific route within a Transition.\n    It is read-only and internally immutable. It is also not\n    observable, because a Transition instance is never\n    changed after creation.\n  \n    @class RouteInfoWithAttributes\n    @public\n  */\n\n  /**\n    The dot-separated, fully-qualified name of the\n    route, like \"people.index\".\n    @property {String} name\n    @public\n  */\n\n  /**\n    The final segment of the fully-qualified name of\n    the route, like \"index\"\n    @property {String} localName\n    @public\n  */\n\n  /**\n    The values of the route's parameters. These are the\n    same params that are received as arguments to the\n    route's model hook. Contains only the parameters\n    valid for this route, if any (params for parent or\n    child routes are not merged).\n    @property {Object} params\n    @public\n  */\n\n  /**\n    The ordered list of the names of the params\n    required for this route. It will contain the same\n    strings as `Object.keys(params)`, but here the order\n    is significant. This allows users to correctly pass\n    params into routes programmatically.\n    @property {Array} paramNames\n    @public\n  */\n\n  /**\n    The values of any queryParams on this route.\n    @property {Object} queryParams\n    @public\n  */\n\n  /**\n    This is the resolved return value from the\n    route's model hook.\n    @property {Object|Array|String} attributes\n    @public\n  */\n\n  /**\n    Will contain the result `Route#buildRouteInfoMetadata`\n    for the corresponding Route.\n    @property {Any} metadata\n    @public\n  */\n\n  /**\n    A reference to the parent route's RouteInfo.\n    This can be used to traverse upward to the topmost\n    `RouteInfo`.\n    @property {RouteInfo|null} parent\n    @public\n  */\n\n  /**\n    A reference to the child route's RouteInfo.\n    This can be used to traverse downward to the\n    leafmost `RouteInfo`.\n    @property {RouteInfo|null} child\n    @public\n  */\n\n  /**\n    Allows you to traverse through the linked list\n    of `RouteInfo`s from the topmost to leafmost.\n    Returns the first `RouteInfo` in the linked list\n    for which the callback returns true.\n  \n      This method is similar to the `find()` method\n      defined in ECMAScript 2015.\n  \n      The callback method you provide should have the\n      following signature (all parameters are optional):\n  \n      ```javascript\n      function(item, index, array);\n      ```\n  \n      - `item` is the current item in the iteration.\n      - `index` is the current index in the iteration.\n      - `array` is the array itself.\n  \n      It should return the `true` to include the item in\n      the results, `false` otherwise.\n  \n      Note that in addition to a callback, you can also\n      pass an optional target object that will be set as\n      `this` on the context.\n  \n    @method find\n    @param {Function} callback the callback to execute\n    @param {Object} [target*] optional target to use\n    @returns {Object} Found item or undefined\n    @public\n  */\n\n  /**\n    A RouteInfo is an object that contains metadata\n    about a specific route within a Transition. It is\n    read-only and internally immutable. It is also not\n    observable, because a Transition instance is never\n    changed after creation.\n  \n    @class RouteInfo\n    @public\n  */\n\n  /**\n    The dot-separated, fully-qualified name of the\n    route, like \"people.index\".\n    @property {String} name\n    @public\n  */\n\n  /**\n    The final segment of the fully-qualified name of\n    the route, like \"index\"\n    @property {String} localName\n    @public\n  */\n\n  /**\n    The values of the route's parameters. These are the\n    same params that are received as arguments to the\n    route's `model` hook. Contains only the parameters\n    valid for this route, if any (params for parent or\n    child routes are not merged).\n    @property {Object} params\n    @public\n  */\n\n  /**\n    The ordered list of the names of the params\n    required for this route. It will contain the same\n    strings as Object.keys(params), but here the order\n    is significant. This allows users to correctly pass\n    params into routes programmatically.\n    @property {Array} paramNames\n    @public\n  */\n\n  /**\n    The values of any queryParams on this route.\n    @property {Object} queryParams\n    @public\n  */\n\n  /**\n    A reference to the parent route's `RouteInfo`.\n    This can be used to traverse upward to the topmost\n    `RouteInfo`.\n    @property {RouteInfo|null} parent\n    @public\n  */\n\n  /**\n    A reference to the child route's `RouteInfo`.\n    This can be used to traverse downward to the\n    leafmost `RouteInfo`.\n    @property {RouteInfo|null} child\n    @public\n  */\n\n  /**\n    Allows you to traverse through the linked list\n    of `RouteInfo`s from the topmost to leafmost.\n    Returns the first `RouteInfo` in the linked list\n    for which the callback returns true.\n  \n      This method is similar to the `find()` method\n      defined in ECMAScript 2015.\n  \n      The callback method you provide should have the\n      following signature (all parameters are optional):\n  \n      ```javascript\n      function(item, index, array);\n      ```\n  \n      - `item` is the current item in the iteration.\n      - `index` is the current index in the iteration.\n      - `array` is the array itself.\n  \n      It should return the `true` to include the item in\n      the results, `false` otherwise.\n  \n      Note that in addition to a callback, you can also\n      pass an optional target object that will be set as\n      `this` on the context.\n  \n    @method find\n    @param {Function} callback the callback to execute\n    @param {Object} [target*] optional target to use\n    @returns {Object} Found item or undefined\n    @public\n  */\n});","define(\"@ember/-internals/routing/lib/system/route\", [\"exports\", \"@ember/polyfills\", \"@ember/-internals/metal\", \"@ember/-internals/owner\", \"@ember/-internals/runtime\", \"@ember/-internals/utils\", \"@ember/debug\", \"@ember/deprecated-features\", \"@ember/object/compat\", \"@ember/runloop\", \"@ember/string\", \"router_js\", \"@ember/-internals/routing/lib/utils\", \"@ember/-internals/routing/lib/system/generate_controller\"], function (_exports, _polyfills, _metal, _owner, _runtime, _utils, _debug, _deprecatedFeatures, _compat, _runloop, _string, _router_js, _utils2, _generate_controller) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.defaultSerialize = defaultSerialize;\n  _exports.hasDefaultSerialize = hasDefaultSerialize;\n  _exports.default = _exports.ROUTER_EVENT_DEPRECATIONS = _exports.ROUTE_CONNECTIONS = void 0;\n  var ROUTE_CONNECTIONS = new WeakMap();\n  _exports.ROUTE_CONNECTIONS = ROUTE_CONNECTIONS;\n\n  function defaultSerialize(model, params) {\n    if (params.length < 1 || !model) {\n      return;\n    }\n\n    var object = {};\n\n    if (params.length === 1) {\n      var [name] = params;\n\n      if (name in model) {\n        object[name] = (0, _metal.get)(model, name);\n      } else if (/_id$/.test(name)) {\n        object[name] = (0, _metal.get)(model, 'id');\n      }\n    } else {\n      object = (0, _metal.getProperties)(model, params);\n    }\n\n    return object;\n  }\n\n  function hasDefaultSerialize(route) {\n    return route.serialize === defaultSerialize;\n  }\n  /**\n  @module @ember/routing\n  */\n\n  /**\n    The `Route` class is used to define individual routes. Refer to\n    the [routing guide](https://guides.emberjs.com/release/routing/) for documentation.\n  \n    @class Route\n    @extends EmberObject\n    @uses ActionHandler\n    @uses Evented\n    @since 1.0.0\n    @public\n  */\n\n\n  class Route extends _runtime.Object {\n    constructor() {\n      super(...arguments);\n      this.context = {};\n    }\n    /**\n      The name of the route, dot-delimited.\n         For example, a route found at `app/routes/posts/post.js` will have\n      a `routeName` of `posts.post`.\n         @property routeName\n      @for Route\n      @type String\n      @since 1.0.0\n      @public\n    */\n\n    /**\n      The name of the route, dot-delimited, including the engine prefix\n      if applicable.\n         For example, a route found at `addon/routes/posts/post.js` within an\n      engine named `admin` will have a `fullRouteName` of `admin.posts.post`.\n         @property fullRouteName\n      @for Route\n      @type String\n      @since 2.10.0\n      @public\n    */\n\n    /**\n      Sets the name for this route, including a fully resolved name for routes\n      inside engines.\n         @private\n      @method _setRouteName\n      @param {String} name\n    */\n\n\n    _setRouteName(name) {\n      this.routeName = name;\n      this.fullRouteName = getEngineRouteName((0, _owner.getOwner)(this), name);\n    }\n    /**\n      @private\n         @method _stashNames\n    */\n\n\n    _stashNames(routeInfo, dynamicParent) {\n      if (this._names) {\n        return;\n      }\n\n      var names = this._names = routeInfo['_names'];\n\n      if (!names.length) {\n        routeInfo = dynamicParent;\n        names = routeInfo && routeInfo['_names'] || [];\n      }\n\n      var qps = (0, _metal.get)(this, '_qp.qps');\n      var namePaths = new Array(names.length);\n\n      for (var a = 0; a < names.length; ++a) {\n        namePaths[a] = routeInfo.name + \".\" + names[a];\n      }\n\n      for (var i = 0; i < qps.length; ++i) {\n        var qp = qps[i];\n\n        if (qp.scope === 'model') {\n          qp.parts = namePaths;\n        }\n      }\n    }\n    /**\n      @private\n         @property _activeQPChanged\n    */\n\n\n    _activeQPChanged(qp, value) {\n      this._router._activeQPChanged(qp.scopedPropertyName, value);\n    }\n    /**\n      @private\n      @method _updatingQPChanged\n    */\n\n\n    _updatingQPChanged(qp) {\n      this._router._updatingQPChanged(qp.urlKey);\n    }\n    /**\n      Returns a hash containing the parameters of an ancestor route.\n         You may notice that `this.paramsFor` sometimes works when referring to a\n      child route, but this behavior should not be relied upon as only ancestor\n      routes are certain to be loaded in time.\n         Example\n         ```app/router.js\n      // ...\n         Router.map(function() {\n        this.route('member', { path: ':name' }, function() {\n          this.route('interest', { path: ':interest' });\n        });\n      });\n      ```\n         ```app/routes/member.js\n      import Route from '@ember/routing/route';\n         export default class MemberRoute extends Route {\n        queryParams = {\n          memberQp: { refreshModel: true }\n        }\n      }\n      ```\n         ```app/routes/member/interest.js\n      import Route from '@ember/routing/route';\n         export default class MemberInterestRoute Route {\n        queryParams = {\n          interestQp: { refreshModel: true }\n        }\n           model() {\n          return this.paramsFor('member');\n        }\n      }\n      ```\n         If we visit `/turing/maths?memberQp=member&interestQp=interest` the model for\n      the `member.interest` route is a hash with:\n         * `name`: `turing`\n      * `memberQp`: `member`\n         @method paramsFor\n      @param {String} name\n      @return {Object} hash containing the parameters of the route `name`\n      @since 1.4.0\n      @public\n    */\n\n\n    paramsFor(name) {\n      var route = (0, _owner.getOwner)(this).lookup(\"route:\" + name);\n\n      if (route === undefined) {\n        return {};\n      }\n\n      var transition = this._router._routerMicrolib.activeTransition;\n      var state = transition ? transition[_router_js.STATE_SYMBOL] : this._router._routerMicrolib.state;\n      var fullName = route.fullRouteName;\n      var params = (0, _polyfills.assign)({}, state.params[fullName]);\n      var queryParams = getQueryParamsFor(route, state);\n      return Object.keys(queryParams).reduce((params, key) => {\n        (true && !(!params[key]) && (0, _debug.assert)(\"The route '\" + this.routeName + \"' has both a dynamic segment and query param with name '\" + key + \"'. Please rename one to avoid collisions.\", !params[key]));\n        params[key] = queryParams[key];\n        return params;\n      }, params);\n    }\n    /**\n      Serializes the query parameter key\n         @method serializeQueryParamKey\n      @param {String} controllerPropertyName\n      @private\n    */\n\n\n    serializeQueryParamKey(controllerPropertyName) {\n      return controllerPropertyName;\n    }\n    /**\n      Serializes value of the query parameter based on defaultValueType\n         @method serializeQueryParam\n      @param {Object} value\n      @param {String} urlKey\n      @param {String} defaultValueType\n      @private\n    */\n\n\n    serializeQueryParam(value, _urlKey, defaultValueType) {\n      // urlKey isn't used here, but anyone overriding\n      // can use it to provide serialization specific\n      // to a certain query param.\n      return this._router._serializeQueryParam(value, defaultValueType);\n    }\n    /**\n      Deserializes value of the query parameter based on defaultValueType\n         @method deserializeQueryParam\n      @param {Object} value\n      @param {String} urlKey\n      @param {String} defaultValueType\n      @private\n    */\n\n\n    deserializeQueryParam(value, _urlKey, defaultValueType) {\n      // urlKey isn't used here, but anyone overriding\n      // can use it to provide deserialization specific\n      // to a certain query param.\n      return this._router._deserializeQueryParam(value, defaultValueType);\n    }\n    /**\n      @private\n         @property _optionsForQueryParam\n    */\n\n\n    _optionsForQueryParam(qp) {\n      return (0, _metal.get)(this, \"queryParams.\" + qp.urlKey) || (0, _metal.get)(this, \"queryParams.\" + qp.prop) || {};\n    }\n    /**\n      A hook you can use to reset controller values either when the model\n      changes or the route is exiting.\n         ```app/routes/articles.js\n      import Route from '@ember/routing/route';\n         export default class ArticlesRoute extends Route {\n        resetController(controller, isExiting, transition) {\n          if (isExiting && transition.targetName !== 'error') {\n            controller.set('page', 1);\n          }\n        }\n      }\n      ```\n         @method resetController\n      @param {Controller} controller instance\n      @param {Boolean} isExiting\n      @param {Object} transition\n      @since 1.7.0\n      @public\n    */\n\n\n    resetController(_controller, _isExiting, _transition) {\n      return this;\n    }\n    /**\n      @private\n         @method exit\n    */\n\n\n    exit() {\n      this.deactivate();\n      this.trigger('deactivate');\n      this.teardownViews();\n    }\n    /**\n      @private\n         @method _internalReset\n      @since 3.6.0\n    */\n\n\n    _internalReset(isExiting, transition) {\n      var controller = this.controller;\n      controller._qpDelegate = (0, _metal.get)(this, '_qp.states.inactive');\n      this.resetController(controller, isExiting, transition);\n    }\n    /**\n      @private\n         @method enter\n    */\n\n\n    enter() {\n      ROUTE_CONNECTIONS.set(this, []);\n      this.activate();\n      this.trigger('activate');\n    }\n    /**\n      The `willTransition` action is fired at the beginning of any\n      attempted transition with a `Transition` object as the sole\n      argument. This action can be used for aborting, redirecting,\n      or decorating the transition from the currently active routes.\n         A good example is preventing navigation when a form is\n      half-filled out:\n         ```app/routes/contact-form.js\n      import Route from '@ember/routing/route';\n      import { action } from '@ember/object';\n         export default class ContactFormRoute extends Route {\n        @action\n        willTransition(transition) {\n          if (this.controller.get('userHasEnteredData')) {\n            this.controller.displayNavigationConfirm();\n            transition.abort();\n          }\n        }\n      }\n      ```\n         You can also redirect elsewhere by calling\n      `this.transitionTo('elsewhere')` from within `willTransition`.\n      Note that `willTransition` will not be fired for the\n      redirecting `transitionTo`, since `willTransition` doesn't\n      fire when there is already a transition underway. If you want\n      subsequent `willTransition` actions to fire for the redirecting\n      transition, you must first explicitly call\n      `transition.abort()`.\n         To allow the `willTransition` event to continue bubbling to the parent\n      route, use `return true;`. When the `willTransition` method has a\n      return value of `true` then the parent route's `willTransition` method\n      will be fired, enabling \"bubbling\" behavior for the event.\n         @event willTransition\n      @param {Transition} transition\n      @since 1.0.0\n      @public\n    */\n\n    /**\n      The `didTransition` action is fired after a transition has\n      successfully been completed. This occurs after the normal model\n      hooks (`beforeModel`, `model`, `afterModel`, `setupController`)\n      have resolved. The `didTransition` action has no arguments,\n      however, it can be useful for tracking page views or resetting\n      state on the controller.\n         ```app/routes/login.js\n      import Route from '@ember/routing/route';\n      import { action } from '@ember/object';\n         export default class LoginRoute extends Route {\n        @action\n        didTransition() {\n          this.controller.get('errors.base').clear();\n          return true; // Bubble the didTransition event\n        }\n      }\n      ```\n         @event didTransition\n      @since 1.2.0\n      @public\n    */\n\n    /**\n      The `loading` action is fired on the route when a route's `model`\n      hook returns a promise that is not already resolved. The current\n      `Transition` object is the first parameter and the route that\n      triggered the loading event is the second parameter.\n         ```app/routes/application.js\n      import Route from '@ember/routing/route';\n      import { action } from '@ember/object';\n         export default class ApplicationRoute extends Route {\n        @action\n        loading(transition, route) {\n          let controller = this.controllerFor('foo');\n          controller.set('currentlyLoading', true);\n             transition.finally(function() {\n            controller.set('currentlyLoading', false);\n          });\n        }\n      }\n      ```\n         @event loading\n      @param {Transition} transition\n      @param {Route} route The route that triggered the loading event\n      @since 1.2.0\n      @public\n    */\n\n    /**\n      When attempting to transition into a route, any of the hooks\n      may return a promise that rejects, at which point an `error`\n      action will be fired on the partially-entered routes, allowing\n      for per-route error handling logic, or shared error handling\n      logic defined on a parent route.\n         Here is an example of an error handler that will be invoked\n      for rejected promises from the various hooks on the route,\n      as well as any unhandled errors from child routes:\n         ```app/routes/admin.js\n      import { reject } from 'rsvp';\n      import Route from '@ember/routing/route';\n      import { action } from '@ember/object';\n         export default class AdminRoute extends Route {\n        beforeModel() {\n          return reject('bad things!');\n        }\n           @action\n        error(error, transition) {\n          // Assuming we got here due to the error in `beforeModel`,\n          // we can expect that error === \"bad things!\",\n          // but a promise model rejecting would also\n          // call this hook, as would any errors encountered\n          // in `afterModel`.\n             // The `error` hook is also provided the failed\n          // `transition`, which can be stored and later\n          // `.retry()`d if desired.\n             this.transitionTo('login');\n        }\n      }\n      ```\n         `error` actions that bubble up all the way to `ApplicationRoute`\n      will fire a default error handler that logs the error. You can\n      specify your own global default error handler by overriding the\n      `error` handler on `ApplicationRoute`:\n         ```app/routes/application.js\n      import Route from '@ember/routing/route';\n      import { action } from '@ember/object';\n         export default class ApplicationRoute extends Route {\n        @action\n        error(error, transition) {\n          this.controllerFor('banner').displayError(error.message);\n        }\n      }\n      ```\n      @event error\n      @param {Error} error\n      @param {Transition} transition\n      @since 1.0.0\n      @public\n    */\n\n    /**\n      This event is triggered when the router enters the route. It is\n      not executed when the model for the route changes.\n         ```app/routes/application.js\n      import { on } from '@ember/object/evented';\n      import Route from '@ember/routing/route';\n         export default Route.extend({\n        collectAnalytics: on('activate', function(){\n          collectAnalytics();\n        })\n      });\n      ```\n         @event activate\n      @since 1.9.0\n      @public\n    */\n\n    /**\n      This event is triggered when the router completely exits this\n      route. It is not executed when the model for the route changes.\n         ```app/routes/index.js\n      import { on } from '@ember/object/evented';\n      import Route from '@ember/routing/route';\n         export default Route.extend({\n        trackPageLeaveAnalytics: on('deactivate', function(){\n          trackPageLeaveAnalytics();\n        })\n      });\n      ```\n         @event deactivate\n      @since 1.9.0\n      @public\n    */\n\n    /**\n      This hook is executed when the router completely exits this route. It is\n      not executed when the model for the route changes.\n         @method deactivate\n      @since 1.0.0\n      @public\n    */\n\n\n    deactivate() {}\n    /**\n      This hook is executed when the router enters the route. It is not executed\n      when the model for the route changes.\n         @method activate\n      @since 1.0.0\n      @public\n    */\n\n\n    activate() {}\n    /**\n      Transition the application into another route. The route may\n      be either a single route or route path:\n         ```javascript\n      this.transitionTo('blogPosts');\n      this.transitionTo('blogPosts.recentEntries');\n      ```\n         Optionally supply a model for the route in question. The model\n      will be serialized into the URL using the `serialize` hook of\n      the route:\n         ```javascript\n      this.transitionTo('blogPost', aPost);\n      ```\n         If a literal is passed (such as a number or a string), it will\n      be treated as an identifier instead. In this case, the `model`\n      hook of the route will be triggered:\n         ```javascript\n      this.transitionTo('blogPost', 1);\n      ```\n         Multiple models will be applied last to first recursively up the\n      route tree.\n         ```app/routes.js\n      // ...\n         Router.map(function() {\n        this.route('blogPost', { path:':blogPostId' }, function() {\n          this.route('blogComment', { path: ':blogCommentId' });\n        });\n      });\n         export default Router;\n      ```\n         ```javascript\n      this.transitionTo('blogComment', aPost, aComment);\n      this.transitionTo('blogComment', 1, 13);\n      ```\n         It is also possible to pass a URL (a string that starts with a\n      `/`).\n         ```javascript\n      this.transitionTo('/');\n      this.transitionTo('/blog/post/1/comment/13');\n      this.transitionTo('/blog/posts?sort=title');\n      ```\n         An options hash with a `queryParams` property may be provided as\n      the final argument to add query parameters to the destination URL.\n         ```javascript\n      this.transitionTo('blogPost', 1, {\n        queryParams: { showComments: 'true' }\n      });\n         // if you just want to transition the query parameters without changing the route\n      this.transitionTo({ queryParams: { sort: 'date' } });\n      ```\n         See also [replaceWith](#method_replaceWith).\n         Simple Transition Example\n         ```app/routes.js\n      // ...\n         Router.map(function() {\n        this.route('index');\n        this.route('secret');\n        this.route('fourOhFour', { path: '*:' });\n      });\n         export default Router;\n      ```\n         ```app/routes/index.js\n      import Route from '@ember/routing/route';\n      import { action } from '@ember/object';\n         export default class IndexRoute extends Route {\n        @action\n        moveToSecret(context) {\n          if (authorized()) {\n            this.transitionTo('secret', context);\n          } else {\n            this.transitionTo('fourOhFour');\n          }\n        }\n      }\n      ```\n         Transition to a nested route\n         ```app/router.js\n      // ...\n         Router.map(function() {\n        this.route('articles', { path: '/articles' }, function() {\n          this.route('new');\n        });\n      });\n         export default Router;\n      ```\n         ```app/routes/index.js\n      import Route from '@ember/routing/route';\n      import { action } from '@ember/object';\n         export default class IndexRoute extends Route {\n        @action\n        transitionToNewArticle() {\n          this.transitionTo('articles.new');\n        }\n      }\n      ```\n         Multiple Models Example\n         ```app/router.js\n      // ...\n         Router.map(function() {\n        this.route('index');\n           this.route('breakfast', { path: ':breakfastId' }, function() {\n          this.route('cereal', { path: ':cerealId' });\n        });\n      });\n         export default Router;\n      ```\n         ```app/routes/index.js\n      import Route from '@ember/routing/route';\n      import { action } from '@ember/object';\n         export default class IndexRoute extends Route {\n        @action\n        moveToChocolateCereal() {\n          let cereal = { cerealId: 'ChocolateYumminess' };\n          let breakfast = { breakfastId: 'CerealAndMilk' };\n             this.transitionTo('breakfast.cereal', breakfast, cereal);\n        }\n      }\n      ```\n         Nested Route with Query String Example\n         ```app/routes.js\n      // ...\n         Router.map(function() {\n        this.route('fruits', function() {\n          this.route('apples');\n        });\n      });\n         export default Router;\n      ```\n         ```app/routes/index.js\n      import Route from '@ember/routing/route';\n         export default class IndexRoute extends Route {\n        @action\n        transitionToApples() {\n          this.transitionTo('fruits.apples', { queryParams: { color: 'red' } });\n        }\n      }\n      ```\n         @method transitionTo\n      @param {String} name the name of the route or a URL\n      @param {...Object} models the model(s) or identifier(s) to be used while\n        transitioning to the route.\n      @param {Object} [options] optional hash with a queryParams property\n        containing a mapping of query parameters\n      @return {Transition} the transition object associated with this\n        attempted transition\n      @since 1.0.0\n      @public\n    */\n\n\n    transitionTo(...args) {\n      // eslint-disable-line no-unused-vars\n      return this._router.transitionTo(...(0, _utils2.prefixRouteNameArg)(this, args));\n    }\n    /**\n      Perform a synchronous transition into another route without attempting\n      to resolve promises, update the URL, or abort any currently active\n      asynchronous transitions (i.e. regular transitions caused by\n      `transitionTo` or URL changes).\n         This method is handy for performing intermediate transitions on the\n      way to a final destination route, and is called internally by the\n      default implementations of the `error` and `loading` handlers.\n         @method intermediateTransitionTo\n      @param {String} name the name of the route\n      @param {...Object} models the model(s) to be used while transitioning\n      to the route.\n      @since 1.2.0\n      @public\n     */\n\n\n    intermediateTransitionTo(...args) {\n      var [name, ...preparedArgs] = (0, _utils2.prefixRouteNameArg)(this, args);\n\n      this._router.intermediateTransitionTo(name, ...preparedArgs);\n    }\n    /**\n      Refresh the model on this route and any child routes, firing the\n      `beforeModel`, `model`, and `afterModel` hooks in a similar fashion\n      to how routes are entered when transitioning in from other route.\n      The current route params (e.g. `article_id`) will be passed in\n      to the respective model hooks, and if a different model is returned,\n      `setupController` and associated route hooks will re-fire as well.\n         An example usage of this method is re-querying the server for the\n      latest information using the same parameters as when the route\n      was first entered.\n         Note that this will cause `model` hooks to fire even on routes\n      that were provided a model object when the route was initially\n      entered.\n         @method refresh\n      @return {Transition} the transition object associated with this\n        attempted transition\n      @since 1.4.0\n      @public\n     */\n\n\n    refresh() {\n      return this._router._routerMicrolib.refresh(this);\n    }\n    /**\n      Transition into another route while replacing the current URL, if possible.\n      This will replace the current history entry instead of adding a new one.\n      Beside that, it is identical to `transitionTo` in all other respects. See\n      'transitionTo' for additional information regarding multiple models.\n         Example\n         ```app/router.js\n      // ...\n         Router.map(function() {\n        this.route('index');\n        this.route('secret');\n      });\n         export default Router;\n      ```\n         ```app/routes/secret.js\n      import Route from '@ember/routing/route';\n         export default class SecretRoute Route {\n        afterModel() {\n          if (!authorized()){\n            this.replaceWith('index');\n          }\n        }\n      }\n      ```\n         @method replaceWith\n      @param {String} name the name of the route or a URL\n      @param {...Object} models the model(s) or identifier(s) to be used while\n        transitioning to the route.\n      @param {Object} [options] optional hash with a queryParams property\n        containing a mapping of query parameters\n      @return {Transition} the transition object associated with this\n        attempted transition\n      @since 1.0.0\n      @public\n    */\n\n\n    replaceWith(...args) {\n      return this._router.replaceWith(...(0, _utils2.prefixRouteNameArg)(this, args));\n    }\n    /**\n      This hook is the entry point for router.js\n         @private\n      @method setup\n    */\n\n\n    setup(context, transition) {\n      var controllerName = this.controllerName || this.routeName;\n      var definedController = this.controllerFor(controllerName, true);\n      var controller;\n\n      if (definedController) {\n        controller = definedController;\n      } else {\n        controller = this.generateController(controllerName);\n      } // Assign the route's controller so that it can more easily be\n      // referenced in action handlers. Side effects. Side effects everywhere.\n\n\n      if (!this.controller) {\n        var qp = (0, _metal.get)(this, '_qp');\n        var propNames = qp !== undefined ? (0, _metal.get)(qp, 'propertyNames') : [];\n        addQueryParamsObservers(controller, propNames);\n        this.controller = controller;\n      }\n\n      var queryParams = (0, _metal.get)(this, '_qp');\n      var states = queryParams.states;\n      controller._qpDelegate = states.allowOverrides;\n\n      if (transition) {\n        // Update the model dep values used to calculate cache keys.\n        (0, _utils2.stashParamNames)(this._router, transition[_router_js.STATE_SYMBOL].routeInfos);\n        var cache = this._bucketCache;\n        var params = transition[_router_js.PARAMS_SYMBOL];\n        var allParams = queryParams.propertyNames;\n        allParams.forEach(prop => {\n          var aQp = queryParams.map[prop];\n          aQp.values = params;\n          var cacheKey = (0, _utils2.calculateCacheKey)(aQp.route.fullRouteName, aQp.parts, aQp.values);\n          var value = cache.lookup(cacheKey, prop, aQp.undecoratedDefaultValue);\n          (0, _metal.set)(controller, prop, value);\n        });\n        var qpValues = getQueryParamsFor(this, transition[_router_js.STATE_SYMBOL]);\n        (0, _metal.setProperties)(controller, qpValues);\n      }\n\n      this.setupController(controller, context, transition);\n\n      if (this._environment.options.shouldRender) {\n        this.renderTemplate(controller, context);\n      } // Setup can cause changes to QPs which need to be propogated immediately in\n      // some situations. Eventually, we should work on making these async somehow.\n\n\n      if (true\n      /* EMBER_METAL_TRACKED_PROPERTIES */\n      ) {\n          (0, _metal.flushAsyncObservers)(false);\n        }\n    }\n    /*\n      Called when a query parameter for this route changes, regardless of whether the route\n      is currently part of the active route hierarchy. This will update the query parameter's\n      value in the cache so if this route becomes active, the cache value has been updated.\n    */\n\n\n    _qpChanged(prop, value, qp) {\n      if (!qp) {\n        return;\n      } // Update model-dep cache\n\n\n      var cache = this._bucketCache;\n      var cacheKey = (0, _utils2.calculateCacheKey)(qp.route.fullRouteName, qp.parts, qp.values);\n      cache.stash(cacheKey, prop, value);\n    }\n    /**\n      This hook is the first of the route entry validation hooks\n      called when an attempt is made to transition into a route\n      or one of its children. It is called before `model` and\n      `afterModel`, and is appropriate for cases when:\n         1) A decision can be made to redirect elsewhere without\n         needing to resolve the model first.\n      2) Any async operations need to occur first before the\n         model is attempted to be resolved.\n         This hook is provided the current `transition` attempt\n      as a parameter, which can be used to `.abort()` the transition,\n      save it for a later `.retry()`, or retrieve values set\n      on it from a previous hook. You can also just call\n      `this.transitionTo` to another route to implicitly\n      abort the `transition`.\n         You can return a promise from this hook to pause the\n      transition until the promise resolves (or rejects). This could\n      be useful, for instance, for retrieving async code from\n      the server that is required to enter a route.\n         @method beforeModel\n      @param {Transition} transition\n      @return {any | Promise<any>} if the value returned from this hook is\n        a promise, the transition will pause until the transition\n        resolves. Otherwise, non-promise return values are not\n        utilized in any way.\n      @since 1.0.0\n      @public\n    */\n\n\n    beforeModel() {}\n    /**\n      This hook is called after this route's model has resolved.\n      It follows identical async/promise semantics to `beforeModel`\n      but is provided the route's resolved model in addition to\n      the `transition`, and is therefore suited to performing\n      logic that can only take place after the model has already\n      resolved.\n         ```app/routes/posts.js\n      import Route from '@ember/routing/route';\n         export default class PostsRoute extends Route {\n        afterModel(posts, transition) {\n          if (posts.get('length') === 1) {\n            this.transitionTo('post.show', posts.get('firstObject'));\n          }\n        }\n      }\n      ```\n         Refer to documentation for `beforeModel` for a description\n      of transition-pausing semantics when a promise is returned\n      from this hook.\n         @method afterModel\n      @param {Object} resolvedModel the value returned from `model`,\n        or its resolved value if it was a promise\n      @param {Transition} transition\n      @return {any | Promise<any>} if the value returned from this hook is\n        a promise, the transition will pause until the transition\n        resolves. Otherwise, non-promise return values are not\n        utilized in any way.\n      @since 1.0.0\n      @public\n     */\n\n\n    afterModel() {}\n    /**\n      A hook you can implement to optionally redirect to another route.\n         If you call `this.transitionTo` from inside of this hook, this route\n      will not be entered in favor of the other hook.\n         `redirect` and `afterModel` behave very similarly and are\n      called almost at the same time, but they have an important\n      distinction in the case that, from one of these hooks, a\n      redirect into a child route of this route occurs: redirects\n      from `afterModel` essentially invalidate the current attempt\n      to enter this route, and will result in this route's `beforeModel`,\n      `model`, and `afterModel` hooks being fired again within\n      the new, redirecting transition. Redirects that occur within\n      the `redirect` hook, on the other hand, will _not_ cause\n      these hooks to be fired again the second time around; in\n      other words, by the time the `redirect` hook has been called,\n      both the resolved model and attempted entry into this route\n      are considered to be fully validated.\n         @method redirect\n      @param {Object} model the model for this route\n      @param {Transition} transition the transition object associated with the current transition\n      @since 1.0.0\n      @public\n    */\n\n\n    redirect() {}\n    /**\n      Called when the context is changed by router.js.\n         @private\n      @method contextDidChange\n    */\n\n\n    contextDidChange() {\n      this.currentModel = this.context;\n    }\n    /**\n      A hook you can implement to convert the URL into the model for\n      this route.\n         ```app/router.js\n      // ...\n         Router.map(function() {\n        this.route('post', { path: '/posts/:post_id' });\n      });\n         export default Router;\n      ```\n         The model for the `post` route is `store.findRecord('post', params.post_id)`.\n         By default, if your route has a dynamic segment ending in `_id`:\n         * The model class is determined from the segment (`post_id`'s\n        class is `App.Post`)\n      * The find method is called on the model class with the value of\n        the dynamic segment.\n         Note that for routes with dynamic segments, this hook is not always\n      executed. If the route is entered through a transition (e.g. when\n      using the `link-to` Handlebars helper or the `transitionTo` method\n      of routes), and a model context is already provided this hook\n      is not called.\n         A model context does not include a primitive string or number,\n      which does cause the model hook to be called.\n         Routes without dynamic segments will always execute the model hook.\n         ```javascript\n      // no dynamic segment, model hook always called\n      this.transitionTo('posts');\n         // model passed in, so model hook not called\n      thePost = store.findRecord('post', 1);\n      this.transitionTo('post', thePost);\n         // integer passed in, model hook is called\n      this.transitionTo('post', 1);\n         // model id passed in, model hook is called\n      // useful for forcing the hook to execute\n      thePost = store.findRecord('post', 1);\n      this.transitionTo('post', thePost.id);\n      ```\n         This hook follows the asynchronous/promise semantics\n      described in the documentation for `beforeModel`. In particular,\n      if a promise returned from `model` fails, the error will be\n      handled by the `error` hook on `Route`.\n         Example\n         ```app/routes/post.js\n      import Route from '@ember/routing/route';\n         export default class PostRoute extends Route {\n        model(params) {\n          return this.store.findRecord('post', params.post_id);\n        }\n      }\n      ```\n         @method model\n      @param {Object} params the parameters extracted from the URL\n      @param {Transition} transition\n      @return {any | Promise<any>} the model for this route. If\n        a promise is returned, the transition will pause until\n        the promise resolves, and the resolved value of the promise\n        will be used as the model for this route.\n      @since 1.0.0\n      @public\n    */\n\n\n    model(params, transition) {\n      var name, sawParams, value;\n      var queryParams = (0, _metal.get)(this, '_qp.map');\n\n      for (var prop in params) {\n        if (prop === 'queryParams' || queryParams && prop in queryParams) {\n          continue;\n        }\n\n        var match = prop.match(/^(.*)_id$/);\n\n        if (match !== null) {\n          name = match[1];\n          value = params[prop];\n        }\n\n        sawParams = true;\n      }\n\n      if (!name) {\n        if (sawParams) {\n          return (0, _polyfills.assign)({}, params);\n        } else {\n          if (transition.resolveIndex < 1) {\n            return;\n          }\n\n          return transition[_router_js.STATE_SYMBOL].routeInfos[transition.resolveIndex - 1].context;\n        }\n      }\n\n      return this.findModel(name, value);\n    }\n    /**\n      @private\n      @method deserialize\n      @param {Object} params the parameters extracted from the URL\n      @param {Transition} transition\n      @return {any | Promise<any>} the model for this route.\n         Router.js hook.\n     */\n\n\n    deserialize(_params, transition) {\n      return this.model(this._paramsFor(this.routeName, _params), transition);\n    }\n    /**\n         @method findModel\n      @param {String} type the model type\n      @param {Object} value the value passed to find\n      @private\n    */\n\n\n    findModel(...args) {\n      return (0, _metal.get)(this, 'store').find(...args);\n    }\n    /**\n      A hook you can use to setup the controller for the current route.\n         This method is called with the controller for the current route and the\n      model supplied by the `model` hook.\n         By default, the `setupController` hook sets the `model` property of\n      the controller to the specified `model` when it is not `undefined`.\n         If you implement the `setupController` hook in your Route, it will\n      prevent this default behavior. If you want to preserve that behavior\n      when implementing your `setupController` function, make sure to call\n      `super`:\n         ```app/routes/photos.js\n      import Route from '@ember/routing/route';\n         export default class PhotosRoute extendes Route {\n        model() {\n          return this.store.findAll('photo');\n        }\n           setupController(controller, model) {\n          super.setupController(controller, model);\n             this.controllerFor('application').set('showingPhotos', true);\n        }\n      }\n      ```\n         The provided controller will be one resolved based on the name\n      of this route.\n         If no explicit controller is defined, Ember will automatically create one.\n         As an example, consider the router:\n         ```app/router.js\n      // ...\n         Router.map(function() {\n        this.route('post', { path: '/posts/:post_id' });\n      });\n         export default Router;\n      ```\n         If you have defined a file for the post controller,\n      the framework will use it.\n      If it is not defined, a basic `Controller` instance would be used.\n         @example Behavior of a basic Controller\n         ```app/routes/post.js\n      import Route from '@ember/routing/route';\n         export default class PostRoute extends Route {\n        setupController(controller, model) {\n          controller.set('model', model);\n        }\n      });\n      ```\n         @method setupController\n      @param {Controller} controller instance\n      @param {Object} model\n      @since 1.0.0\n      @public\n    */\n\n\n    setupController(controller, context, _transition) {\n      // eslint-disable-line no-unused-vars\n      if (controller && context !== undefined) {\n        (0, _metal.set)(controller, 'model', context);\n      }\n    }\n    /**\n      Returns the controller of the current route, or a parent (or any ancestor)\n      route in a route hierarchy.\n         The controller instance must already have been created, either through entering the\n      associated route or using `generateController`.\n         ```app/routes/post.js\n      import Route from '@ember/routing/route';\n         export default class PostRoute extends Route {\n        setupController(controller, post) {\n          super.setupController(controller, post);\n             this.controllerFor('posts').set('currentPost', post);\n        }\n      }\n      ```\n         @method controllerFor\n      @param {String} name the name of the route or controller\n      @return {Controller}\n      @since 1.0.0\n      @public\n    */\n\n\n    controllerFor(name, _skipAssert) {\n      var owner = (0, _owner.getOwner)(this);\n      var route = owner.lookup(\"route:\" + name);\n\n      if (route && route.controllerName) {\n        name = route.controllerName;\n      }\n\n      var controller = owner.lookup(\"controller:\" + name); // NOTE: We're specifically checking that skipAssert is true, because according\n      //   to the old API the second parameter was model. We do not want people who\n      //   passed a model to skip the assertion.\n\n      (true && !(controller !== undefined || _skipAssert === true) && (0, _debug.assert)(\"The controller named '\" + name + \"' could not be found. Make sure that this route exists and has already been entered at least once. If you are accessing a controller not associated with a route, make sure the controller class is explicitly defined.\", controller !== undefined || _skipAssert === true));\n      return controller;\n    }\n    /**\n      Generates a controller for a route.\n         Example\n         ```app/routes/post.js\n      import Route from '@ember/routing/route';\n         export default class Post extends Route {\n        setupController(controller, post) {\n          super.setupController(controller, post);\n             this.generateController('posts');\n        }\n      }\n      ```\n         @method generateController\n      @param {String} name the name of the controller\n      @private\n    */\n\n\n    generateController(name) {\n      var owner = (0, _owner.getOwner)(this);\n      return (0, _generate_controller.default)(owner, name);\n    }\n    /**\n      Returns the resolved model of a parent (or any ancestor) route\n      in a route hierarchy.  During a transition, all routes\n      must resolve a model object, and if a route\n      needs access to a parent route's model in order to\n      resolve a model (or just reuse the model from a parent),\n      it can call `this.modelFor(theNameOfParentRoute)` to\n      retrieve it. If the ancestor route's model was a promise,\n      its resolved result is returned.\n         Example\n         ```app/router.js\n      // ...\n         Router.map(function() {\n        this.route('post', { path: '/posts/:post_id' }, function() {\n          this.route('comments');\n        });\n      });\n         export default Router;\n      ```\n         ```app/routes/post/comments.js\n      import Route from '@ember/routing/route';\n         export default class PostCommentsRoute extends Route {\n        model() {\n          let post = this.modelFor('post');\n             return post.comments;\n        }\n      }\n      ```\n         @method modelFor\n      @param {String} name the name of the route\n      @return {Object} the model object\n      @since 1.0.0\n      @public\n    */\n\n\n    modelFor(_name) {\n      var name;\n      var owner = (0, _owner.getOwner)(this);\n      var transition = this._router && this._router._routerMicrolib ? this._router._routerMicrolib.activeTransition : undefined; // Only change the route name when there is an active transition.\n      // Otherwise, use the passed in route name.\n\n      if (owner.routable && transition !== undefined) {\n        name = getEngineRouteName(owner, _name);\n      } else {\n        name = _name;\n      }\n\n      var route = owner.lookup(\"route:\" + name); // If we are mid-transition, we want to try and look up\n      // resolved parent contexts on the current transitionEvent.\n\n      if (transition !== undefined && transition !== null) {\n        var modelLookupName = route && route.routeName || name;\n\n        if (transition.resolvedModels.hasOwnProperty(modelLookupName)) {\n          return transition.resolvedModels[modelLookupName];\n        }\n      }\n\n      return route && route.currentModel;\n    }\n    /**\n      A hook you can use to render the template for the current route.\n         This method is called with the controller for the current route and the\n      model supplied by the `model` hook. By default, it renders the route's\n      template, configured with the controller for the route.\n         This method can be overridden to set up and render additional or\n      alternative templates.\n         ```app/routes/posts.js\n      import Route from '@ember/routing/route';\n         export default class PostsRoute extends Route {\n        renderTemplate(controller, model) {\n          let favController = this.controllerFor('favoritePost');\n             // Render the `favoritePost` template into\n          // the outlet `posts`, and display the `favoritePost`\n          // controller.\n          this.render('favoritePost', {\n            outlet: 'posts',\n            controller: favController\n          });\n        }\n      }\n      ```\n         @method renderTemplate\n      @param {Object} controller the route's controller\n      @param {Object} model the route's model\n      @since 1.0.0\n      @public\n    */\n\n\n    renderTemplate(_controller, _model) {\n      // eslint-disable-line no-unused-vars\n      this.render();\n    }\n    /**\n      `render` is used to render a template into a region of another template\n      (indicated by an `{{outlet}}`). `render` is used both during the entry\n      phase of routing (via the `renderTemplate` hook) and later in response to\n      user interaction.\n         For example, given the following minimal router and templates:\n         ```app/router.js\n      // ...\n         Router.map(function() {\n        this.route('photos');\n      });\n         export default Router;\n      ```\n         ```handlebars\n      <!-- application.hbs -->\n      <div class='something-in-the-app-hbs'>\n        {{outlet \"anOutletName\"}}\n      </div>\n      ```\n         ```handlebars\n      <!-- photos.hbs -->\n      <h1>Photos</h1>\n      ```\n         You can render `photos.hbs` into the `\"anOutletName\"` outlet of\n      `application.hbs` by calling `render`:\n         ```app/routes/post.js\n      import Route from '@ember/routing/route';\n         export default class PostRoute extends Route {\n        renderTemplate() {\n          this.render('photos', {\n            into: 'application',\n            outlet: 'anOutletName'\n          })\n        }\n      }\n      ```\n         `render` additionally allows you to supply which `controller` and\n      `model` objects should be loaded and associated with the rendered template.\n         ```app/routes/posts.js\n      import Route from '@ember/routing/route';\n         export default class PostsRoute extends Route {\n        renderTemplate(controller, model){\n          this.render('posts', {    // the template to render, referenced by name\n            into: 'application',    // the template to render into, referenced by name\n            outlet: 'anOutletName', // the outlet inside `options.into` to render into.\n            controller: 'someControllerName', // the controller to use for this template, referenced by name\n            model: model            // the model to set on `options.controller`.\n          })\n        }\n      }\n      ```\n         The string values provided for the template name, and controller\n      will eventually pass through to the resolver for lookup. See\n      Resolver for how these are mapped to JavaScript objects in your\n      application. The template to render into needs to be related to  either the\n      current route or one of its ancestors.\n         Not all options need to be passed to `render`. Default values will be used\n      based on the name of the route specified in the router or the Route's\n      `controllerName` and `templateName` properties.\n         For example:\n         ```app/router.js\n      // ...\n         Router.map(function() {\n        this.route('index');\n        this.route('post', { path: '/posts/:post_id' });\n      });\n         export default Router;\n      ```\n         ```app/routes/post.js\n      import Route from '@ember/routing/route';\n         export default class PostRoute extends Route {\n        renderTemplate() {\n          this.render(); // all defaults apply\n        }\n      }\n      ```\n         The name of the route, defined by the router, is `post`.\n         The following equivalent default options will be applied when\n      the Route calls `render`:\n         ```javascript\n      this.render('post', {  // the template name associated with 'post' Route\n        into: 'application', // the parent route to 'post' Route\n        outlet: 'main',      // {{outlet}} and {{outlet 'main'}} are synonymous,\n        controller: 'post',  // the controller associated with the 'post' Route\n      })\n      ```\n         By default the controller's `model` will be the route's model, so it does not\n      need to be passed unless you wish to change which model is being used.\n         @method render\n      @param {String} name the name of the template to render\n      @param {Object} [options] the options\n      @param {String} [options.into] the template to render into,\n                      referenced by name. Defaults to the parent template\n      @param {String} [options.outlet] the outlet inside `options.into` to render into.\n                      Defaults to 'main'\n      @param {String|Object} [options.controller] the controller to use for this template,\n                      referenced by name or as a controller instance. Defaults to the Route's paired controller\n      @param {Object} [options.model] the model object to set on `options.controller`.\n                      Defaults to the return value of the Route's model hook\n      @since 1.0.0\n      @public\n    */\n\n\n    render(_name, options) {\n      var name;\n      var isDefaultRender = arguments.length === 0;\n\n      if (!isDefaultRender) {\n        if (typeof _name === 'object' && !options) {\n          name = this.templateName || this.routeName;\n          options = _name;\n        } else {\n          (true && !(!(0, _metal.isEmpty)(_name)) && (0, _debug.assert)('The name in the given arguments is undefined or empty string', !(0, _metal.isEmpty)(_name)));\n          name = _name;\n        }\n      }\n\n      var renderOptions = buildRenderOptions(this, isDefaultRender, name, options);\n      ROUTE_CONNECTIONS.get(this).push(renderOptions);\n      (0, _runloop.once)(this._router, '_setOutlets');\n    }\n    /**\n      Disconnects a view that has been rendered into an outlet.\n         You may pass any or all of the following options to `disconnectOutlet`:\n         * `outlet`: the name of the outlet to clear (default: 'main')\n      * `parentView`: the name of the view containing the outlet to clear\n         (default: the view rendered by the parent route)\n         Example:\n         ```app/routes/application.js\n      import Route from '@ember/routing/route';\n      import { action } from '@ember/object';\n         export default class ApplicationRoute extends Route {\n        @action\n        showModal(evt) {\n          this.render(evt.modalName, {\n            outlet: 'modal',\n            into: 'application'\n          });\n        }\n           @action\n        hideModal() {\n          this.disconnectOutlet({\n            outlet: 'modal',\n            parentView: 'application'\n          });\n        }\n      }\n      ```\n         Alternatively, you can pass the `outlet` name directly as a string.\n         Example:\n         ```app/routes/application.js\n      import Route from '@ember/routing/route';\n      import { action } from '@ember/object';\n         export default class ApplicationRoute extends Route {\n        @action\n        showModal(evt) {\n          // ...\n        }\n           @action\n        hideModal(evt) {\n          this.disconnectOutlet('modal');\n        }\n      }\n      ```\n         @method disconnectOutlet\n      @param {Object|String} options the options hash or outlet name\n      @since 1.0.0\n      @public\n    */\n\n\n    disconnectOutlet(options) {\n      var outletName;\n      var parentView;\n\n      if (options) {\n        if (typeof options === 'string') {\n          outletName = options;\n        } else {\n          outletName = options.outlet;\n          parentView = options.parentView ? options.parentView.replace(/\\//g, '.') : undefined;\n          (true && !(!('outlet' in options && options.outlet === undefined)) && (0, _debug.assert)('You passed undefined as the outlet name.', !('outlet' in options && options.outlet === undefined)));\n        }\n      }\n\n      outletName = outletName || 'main';\n\n      this._disconnectOutlet(outletName, parentView);\n\n      var routeInfos = this._router._routerMicrolib.currentRouteInfos;\n\n      for (var i = 0; i < routeInfos.length; i++) {\n        // This non-local state munging is sadly necessary to maintain\n        // backward compatibility with our existing semantics, which allow\n        // any route to disconnectOutlet things originally rendered by any\n        // other route. This should all get cut in 2.0.\n        routeInfos[i].route._disconnectOutlet(outletName, parentView);\n      }\n    }\n\n    _disconnectOutlet(outletName, parentView) {\n      var parent = parentRoute(this);\n\n      if (parent && parentView === parent.routeName) {\n        parentView = undefined;\n      }\n\n      var connections = ROUTE_CONNECTIONS.get(this);\n\n      for (var i = 0; i < connections.length; i++) {\n        var connection = connections[i];\n\n        if (connection.outlet === outletName && connection.into === parentView) {\n          // This neuters the disconnected outlet such that it doesn't\n          // render anything, but it leaves an entry in the outlet\n          // hierarchy so that any existing other renders that target it\n          // don't suddenly blow up. They will still stick themselves\n          // into its outlets, which won't render anywhere. All of this\n          // statefulness should get the machete in 2.0.\n          connections[i] = {\n            owner: connection.owner,\n            into: connection.into,\n            outlet: connection.outlet,\n            name: connection.name,\n            controller: undefined,\n            template: undefined,\n            model: undefined\n          };\n          (0, _runloop.once)(this._router, '_setOutlets');\n        }\n      }\n\n      ROUTE_CONNECTIONS.set(this, connections);\n    }\n\n    willDestroy() {\n      this.teardownViews();\n    }\n    /**\n      @private\n         @method teardownViews\n    */\n\n\n    teardownViews() {\n      var connections = ROUTE_CONNECTIONS.get(this);\n\n      if (connections !== undefined && connections.length > 0) {\n        ROUTE_CONNECTIONS.set(this, []);\n        (0, _runloop.once)(this._router, '_setOutlets');\n      }\n    }\n    /**\n      Allows you to produce custom metadata for the route.\n      The return value of this method will be attatched to\n      its corresponding RouteInfoWithAttributes obejct.\n         Example\n         ```app/routes/posts/index.js\n      import Route from '@ember/routing/route';\n         export default class PostsIndexRoute extends Route {\n        buildRouteInfoMetadata() {\n          return { title: 'Posts Page' }\n        }\n      }\n      ```\n         ```app/routes/application.js\n      import Route from '@ember/routing/route';\n      import { inject as service } from '@ember/service';\n         export default class ApplicationRoute extends Route {\n        @service router\n           constructor() {\n          super(...arguments);\n             this.router.on('routeDidChange', transition => {\n            document.title = transition.to.metadata.title;\n            // would update document's title to \"Posts Page\"\n          });\n        }\n      }\n      ```\n         @return any\n     */\n\n\n    buildRouteInfoMetadata() {}\n\n  }\n\n  Route.reopenClass({\n    isRouteFactory: true\n  });\n\n  function parentRoute(route) {\n    var routeInfo = routeInfoFor(route, route._router._routerMicrolib.state.routeInfos, -1);\n    return routeInfo && routeInfo.route;\n  }\n\n  function routeInfoFor(route, routeInfos, offset = 0) {\n    if (!routeInfos) {\n      return;\n    }\n\n    var current;\n\n    for (var i = 0; i < routeInfos.length; i++) {\n      current = routeInfos[i].route;\n\n      if (current === route) {\n        return routeInfos[i + offset];\n      }\n    }\n\n    return;\n  }\n\n  function buildRenderOptions(route, isDefaultRender, _name, options) {\n    (true && !(isDefaultRender || !(options && 'outlet' in options && options.outlet === undefined)) && (0, _debug.assert)('You passed undefined as the outlet name.', isDefaultRender || !(options && 'outlet' in options && options.outlet === undefined)));\n    var owner = (0, _owner.getOwner)(route);\n    var name, templateName, into, outlet, model;\n    var controller = undefined;\n\n    if (options) {\n      into = options.into && options.into.replace(/\\//g, '.');\n      outlet = options.outlet;\n      controller = options.controller;\n      model = options.model;\n    }\n\n    outlet = outlet || 'main';\n\n    if (isDefaultRender) {\n      name = route.routeName;\n      templateName = route.templateName || name;\n    } else {\n      name = _name.replace(/\\//g, '.');\n      templateName = name;\n    }\n\n    if (controller === undefined) {\n      if (isDefaultRender) {\n        controller = route.controllerName || owner.lookup(\"controller:\" + name);\n      } else {\n        controller = owner.lookup(\"controller:\" + name) || route.controllerName || route.routeName;\n      }\n    }\n\n    if (typeof controller === 'string') {\n      var controllerName = controller;\n      controller = owner.lookup(\"controller:\" + controllerName);\n      (true && !(isDefaultRender || controller !== undefined) && (0, _debug.assert)(\"You passed `controller: '\" + controllerName + \"'` into the `render` method, but no such controller could be found.\", isDefaultRender || controller !== undefined));\n    }\n\n    if (model === undefined) {\n      model = route.currentModel;\n    } else {\n      controller.set('model', model);\n    }\n\n    var template = owner.lookup(\"template:\" + templateName);\n    (true && !(isDefaultRender || template !== undefined) && (0, _debug.assert)(\"Could not find \\\"\" + templateName + \"\\\" template, view, or component.\", isDefaultRender || template !== undefined));\n    var parent;\n\n    if (into && (parent = parentRoute(route)) && into === parent.routeName) {\n      into = undefined;\n    }\n\n    var renderOptions = {\n      owner,\n      into,\n      outlet,\n      name,\n      controller,\n      model,\n      template: template !== undefined ? template(owner) : route._topLevelViewTemplate(owner)\n    };\n\n    if (true\n    /* DEBUG */\n    ) {\n      var LOG_VIEW_LOOKUPS = (0, _metal.get)(route._router, 'namespace.LOG_VIEW_LOOKUPS');\n\n      if (LOG_VIEW_LOOKUPS && !template) {\n        (0, _debug.info)(\"Could not find \\\"\" + name + \"\\\" template. Nothing will be rendered\", {\n          fullName: \"template:\" + name\n        });\n      }\n    }\n\n    return renderOptions;\n  }\n\n  function getFullQueryParams(router, state) {\n    if (state['fullQueryParams']) {\n      return state['fullQueryParams'];\n    }\n\n    state['fullQueryParams'] = {};\n    (0, _polyfills.assign)(state['fullQueryParams'], state.queryParams);\n\n    router._deserializeQueryParams(state.routeInfos, state['fullQueryParams']);\n\n    return state['fullQueryParams'];\n  }\n\n  function getQueryParamsFor(route, state) {\n    state['queryParamsFor'] = state['queryParamsFor'] || {};\n    var name = route.fullRouteName;\n\n    if (state['queryParamsFor'][name]) {\n      return state['queryParamsFor'][name];\n    }\n\n    var fullQueryParams = getFullQueryParams(route._router, state);\n    var params = state['queryParamsFor'][name] = {}; // Copy over all the query params for this route/controller into params hash.\n\n    var qps = (0, _metal.get)(route, '_qp.qps');\n\n    for (var i = 0; i < qps.length; ++i) {\n      // Put deserialized qp on params hash.\n      var qp = qps[i];\n      var qpValueWasPassedIn = qp.prop in fullQueryParams;\n      params[qp.prop] = qpValueWasPassedIn ? fullQueryParams[qp.prop] : copyDefaultValue(qp.defaultValue);\n    }\n\n    return params;\n  }\n\n  function copyDefaultValue(value) {\n    if (Array.isArray(value)) {\n      return (0, _runtime.A)(value.slice());\n    }\n\n    return value;\n  }\n  /*\n    Merges all query parameters from a controller with those from\n    a route, returning a new object and avoiding any mutations to\n    the existing objects.\n  */\n\n\n  function mergeEachQueryParams(controllerQP, routeQP) {\n    var qps = {};\n    var keysAlreadyMergedOrSkippable = {\n      defaultValue: true,\n      type: true,\n      scope: true,\n      as: true\n    }; // first loop over all controller qps, merging them with any matching route qps\n    // into a new empty object to avoid mutating.\n\n    for (var cqpName in controllerQP) {\n      if (!controllerQP.hasOwnProperty(cqpName)) {\n        continue;\n      }\n\n      var newControllerParameterConfiguration = {};\n      (0, _polyfills.assign)(newControllerParameterConfiguration, controllerQP[cqpName], routeQP[cqpName]);\n      qps[cqpName] = newControllerParameterConfiguration; // allows us to skip this QP when we check route QPs.\n\n      keysAlreadyMergedOrSkippable[cqpName] = true;\n    } // loop over all route qps, skipping those that were merged in the first pass\n    // because they also appear in controller qps\n\n\n    for (var rqpName in routeQP) {\n      if (!routeQP.hasOwnProperty(rqpName) || keysAlreadyMergedOrSkippable[rqpName]) {\n        continue;\n      }\n\n      var newRouteParameterConfiguration = {};\n      (0, _polyfills.assign)(newRouteParameterConfiguration, routeQP[rqpName], controllerQP[rqpName]);\n      qps[rqpName] = newRouteParameterConfiguration;\n    }\n\n    return qps;\n  }\n\n  function addQueryParamsObservers(controller, propNames) {\n    propNames.forEach(prop => {\n      if ((0, _metal.descriptorForProperty)(controller, prop) === undefined) {\n        var desc = (0, _utils.lookupDescriptor)(controller, prop);\n\n        if (desc !== null && (typeof desc.get === 'function' || typeof desc.set === 'function')) {\n          (0, _metal.defineProperty)(controller, prop, (0, _compat.dependentKeyCompat)({\n            get: desc.get,\n            set: desc.set\n          }));\n        }\n      }\n\n      (0, _metal.addObserver)(controller, prop + \".[]\", controller, controller._qpChanged, false);\n    });\n  }\n\n  function getEngineRouteName(engine, routeName) {\n    if (engine.routable) {\n      var prefix = engine.mountPoint;\n\n      if (routeName === 'application') {\n        return prefix;\n      } else {\n        return prefix + \".\" + routeName;\n      }\n    }\n\n    return routeName;\n  }\n  /**\n      A hook you can implement to convert the route's model into parameters\n      for the URL.\n  \n      ```app/router.js\n      // ...\n  \n      Router.map(function() {\n        this.route('post', { path: '/posts/:post_id' });\n      });\n  \n      ```\n  \n      ```app/routes/post.js\n      import Route from '@ember/routing/route';\n  \n      export default class PostRoute extends Route {\n        model({ post_id }) {\n          // the server returns `{ id: 12 }`\n          return fetch(`/posts/${post_id}`;\n        }\n  \n        serialize(model) {\n          // this will make the URL `/posts/12`\n          return { post_id: model.id };\n        }\n      }\n      ```\n  \n      The default `serialize` method will insert the model's `id` into the\n      route's dynamic segment (in this case, `:post_id`) if the segment contains '_id'.\n      If the route has multiple dynamic segments or does not contain '_id', `serialize`\n      will return `getProperties(model, params)`\n  \n      This method is called when `transitionTo` is called with a context\n      in order to populate the URL.\n  \n      @method serialize\n      @param {Object} model the routes model\n      @param {Array} params an Array of parameter names for the current\n        route (in the example, `['post_id']`.\n      @return {Object} the serialized parameters\n      @since 1.0.0\n      @public\n    */\n\n\n  Route.prototype.serialize = defaultSerialize;\n  Route.reopen(_runtime.ActionHandler, _runtime.Evented, {\n    mergedProperties: ['queryParams'],\n\n    /**\n      Configuration hash for this route's queryParams. The possible\n      configuration options and their defaults are as follows\n      (assuming a query param whose controller property is `page`):\n         ```javascript\n      queryParams: {\n        page: {\n          // By default, controller query param properties don't\n          // cause a full transition when they are changed, but\n          // rather only cause the URL to update. Setting\n          // `refreshModel` to true will cause an \"in-place\"\n          // transition to occur, whereby the model hooks for\n          // this route (and any child routes) will re-fire, allowing\n          // you to reload models (e.g., from the server) using the\n          // updated query param values.\n          refreshModel: false,\n             // By default, changes to controller query param properties\n          // cause the URL to update via `pushState`, which means an\n          // item will be added to the browser's history, allowing\n          // you to use the back button to restore the app to the\n          // previous state before the query param property was changed.\n          // Setting `replace` to true will use `replaceState` (or its\n          // hash location equivalent), which causes no browser history\n          // item to be added. This options name and default value are\n          // the same as the `link-to` helper's `replace` option.\n          replace: false,\n             // By default, the query param URL key is the same name as\n          // the controller property name. Use `as` to specify a\n          // different URL key.\n          as: 'page'\n        }\n      }\n      ```\n         @property queryParams\n      @for Route\n      @type Object\n      @since 1.6.0\n      @public\n    */\n    queryParams: {},\n\n    /**\n      The name of the template to use by default when rendering this routes\n      template.\n         ```app/routes/posts/list.js\n      import Route from '@ember/routing/route';\n         export default class extends Route {\n        templateName = 'posts/list'\n      });\n      ```\n         ```app/routes/posts/index.js\n      import PostsList from '../posts/list';\n         export default class extends PostsList {};\n      ```\n         ```app/routes/posts/archived.js\n      import PostsList from '../posts/list';\n         export default class extends PostsList {};\n      ```\n         @property templateName\n      @type String\n      @default null\n      @since 1.4.0\n      @public\n    */\n    templateName: null,\n\n    /**\n      @private\n         @property _names\n    */\n    _names: null,\n\n    /**\n      The name of the controller to associate with this route.\n         By default, Ember will lookup a route's controller that matches the name\n      of the route (i.e. `posts.new`). However,\n      if you would like to define a specific controller to use, you can do so\n      using this property.\n         This is useful in many ways, as the controller specified will be:\n         * passed to the `setupController` method.\n      * used as the controller for the template being rendered by the route.\n      * returned from a call to `controllerFor` for the route.\n         @property controllerName\n      @type String\n      @default null\n      @since 1.4.0\n      @public\n    */\n    controllerName: null,\n\n    /**\n      Store property provides a hook for data persistence libraries to inject themselves.\n         By default, this store property provides the exact same functionality previously\n      in the model hook.\n         Currently, the required interface is:\n         `store.find(modelName, findArguments)`\n         @property store\n      @type {Object}\n      @private\n    */\n    store: (0, _metal.computed)({\n      get() {\n        var owner = (0, _owner.getOwner)(this);\n        var routeName = this.routeName;\n        var namespace = (0, _metal.get)(this, '_router.namespace');\n        return {\n          find(name, value) {\n            var modelClass = owner.factoryFor(\"model:\" + name);\n            (true && !(Boolean(modelClass)) && (0, _debug.assert)(\"You used the dynamic segment \" + name + \"_id in your route \" + routeName + \", but \" + namespace + \".\" + (0, _string.classify)(name) + \" did not exist and you did not override your route's `model` hook.\", Boolean(modelClass)));\n\n            if (!modelClass) {\n              return;\n            }\n\n            modelClass = modelClass.class;\n            (true && !(typeof modelClass.find === 'function') && (0, _debug.assert)((0, _string.classify)(name) + \" has no method `find`.\", typeof modelClass.find === 'function'));\n            return modelClass.find(value);\n          }\n\n        };\n      },\n\n      set(key, value) {\n        (0, _metal.defineProperty)(this, key, null, value);\n      }\n\n    }),\n\n    /**\n        @private\n           @property _qp\n      */\n    _qp: (0, _metal.computed)(function () {\n      var combinedQueryParameterConfiguration;\n      var controllerName = this.controllerName || this.routeName;\n      var owner = (0, _owner.getOwner)(this);\n      var controller = owner.lookup(\"controller:\" + controllerName);\n      var queryParameterConfiguraton = (0, _metal.get)(this, 'queryParams');\n      var hasRouterDefinedQueryParams = Object.keys(queryParameterConfiguraton).length > 0;\n\n      if (controller) {\n        // the developer has authored a controller class in their application for\n        // this route find its query params and normalize their object shape them\n        // merge in the query params for the route. As a mergedProperty,\n        // Route#queryParams is always at least `{}`\n        var controllerDefinedQueryParameterConfiguration = (0, _metal.get)(controller, 'queryParams') || {};\n        var normalizedControllerQueryParameterConfiguration = (0, _utils2.normalizeControllerQueryParams)(controllerDefinedQueryParameterConfiguration);\n        combinedQueryParameterConfiguration = mergeEachQueryParams(normalizedControllerQueryParameterConfiguration, queryParameterConfiguraton);\n      } else if (hasRouterDefinedQueryParams) {\n        // the developer has not defined a controller but *has* supplied route query params.\n        // Generate a class for them so we can later insert default values\n        controller = (0, _generate_controller.default)(owner, controllerName);\n        combinedQueryParameterConfiguration = queryParameterConfiguraton;\n      }\n\n      var qps = [];\n      var map = {};\n      var propertyNames = [];\n\n      for (var propName in combinedQueryParameterConfiguration) {\n        if (!combinedQueryParameterConfiguration.hasOwnProperty(propName)) {\n          continue;\n        } // to support the dubious feature of using unknownProperty\n        // on queryParams configuration\n\n\n        if (propName === 'unknownProperty' || propName === '_super') {\n          // possible todo: issue deprecation warning?\n          continue;\n        }\n\n        var desc = combinedQueryParameterConfiguration[propName];\n        var scope = desc.scope || 'model';\n        var parts = void 0;\n\n        if (scope === 'controller') {\n          parts = [];\n        }\n\n        var urlKey = desc.as || this.serializeQueryParamKey(propName);\n        var defaultValue = (0, _metal.get)(controller, propName);\n        defaultValue = copyDefaultValue(defaultValue);\n        var type = desc.type || (0, _runtime.typeOf)(defaultValue);\n        var defaultValueSerialized = this.serializeQueryParam(defaultValue, urlKey, type);\n        var scopedPropertyName = controllerName + \":\" + propName;\n        var qp = {\n          undecoratedDefaultValue: (0, _metal.get)(controller, propName),\n          defaultValue,\n          serializedDefaultValue: defaultValueSerialized,\n          serializedValue: defaultValueSerialized,\n          type,\n          urlKey,\n          prop: propName,\n          scopedPropertyName,\n          controllerName,\n          route: this,\n          parts,\n          values: null,\n          scope\n        };\n        map[propName] = map[urlKey] = map[scopedPropertyName] = qp;\n        qps.push(qp);\n        propertyNames.push(propName);\n      }\n\n      return {\n        qps,\n        map,\n        propertyNames,\n        states: {\n          /*\n            Called when a query parameter changes in the URL, this route cares\n            about that query parameter, but the route is not currently\n            in the active route hierarchy.\n          */\n          inactive: (prop, value) => {\n            var qp = map[prop];\n\n            this._qpChanged(prop, value, qp);\n          },\n\n          /*\n            Called when a query parameter changes in the URL, this route cares\n            about that query parameter, and the route is currently\n            in the active route hierarchy.\n          */\n          active: (prop, value) => {\n            var qp = map[prop];\n\n            this._qpChanged(prop, value, qp);\n\n            return this._activeQPChanged(qp, value);\n          },\n\n          /*\n            Called when a value of a query parameter this route handles changes in a controller\n            and the route is currently in the active route hierarchy.\n          */\n          allowOverrides: (prop, value) => {\n            var qp = map[prop];\n\n            this._qpChanged(prop, value, qp);\n\n            return this._updatingQPChanged(qp);\n          }\n        }\n      };\n    }),\n\n    /**\n      Sends an action to the router, which will delegate it to the currently\n      active route hierarchy per the bubbling rules explained under `actions`.\n         Example\n         ```app/router.js\n      // ...\n         Router.map(function() {\n        this.route('index');\n      });\n         export default Router;\n      ```\n         ```app/routes/application.js\n      import Route from '@ember/routing/route';\n      import { action } from '@ember/object';\n         export default class ApplicationRoute extends Route {\n        @action\n        track(arg) {\n          console.log(arg, 'was clicked');\n        }\n      }\n      ```\n         ```app/routes/index.js\n      import Route from '@ember/routing/route';\n      import { action } from '@glimmer/tracking';\n         export default class IndexRoute extends Route {\n        @action\n        trackIfDebug(arg) {\n          if (debug) {\n            this.send('track', arg);\n          }\n        }\n      }\n      ```\n         @method send\n      @param {String} name the name of the action to trigger\n      @param {...*} args\n      @since 1.0.0\n      @public\n    */\n    send(...args) {\n      (true && !(!this.isDestroying && !this.isDestroyed) && (0, _debug.assert)(\"Attempted to call .send() with the action '\" + args[0] + \"' on the destroyed route '\" + this.routeName + \"'.\", !this.isDestroying && !this.isDestroyed));\n\n      if (this._router && this._router._routerMicrolib || !(0, _debug.isTesting)()) {\n        this._router.send(...args);\n      } else {\n        var name = args.shift();\n        var action = this.actions[name];\n\n        if (action) {\n          return action.apply(this, args);\n        }\n      }\n    },\n\n    /**\n      The controller associated with this route.\n         Example\n         ```app/routes/form.js\n      import Route from '@ember/routing/route';\n      import { action } from '@ember/object';\n         export default class FormRoute extends Route {\n        @action\n        willTransition(transition) {\n          if (this.controller.get('userHasEnteredData') &&\n              !confirm('Are you sure you want to abandon progress?')) {\n            transition.abort();\n          } else {\n            // Bubble the `willTransition` action so that\n            // parent routes can decide whether or not to abort.\n            return true;\n          }\n        }\n      }\n      ```\n         @property controller\n      @type Controller\n      @since 1.6.0\n      @public\n    */\n    actions: {\n      /**\n      This action is called when one or more query params have changed. Bubbles.\n           @method queryParamsDidChange\n      @param changed {Object} Keys are names of query params that have changed.\n      @param totalPresent {Object} Keys are names of query params that are currently set.\n      @param removed {Object} Keys are names of query params that have been removed.\n      @returns {boolean}\n      @private\n      */\n      queryParamsDidChange(changed, _totalPresent, removed) {\n        var qpMap = (0, _metal.get)(this, '_qp').map;\n        var totalChanged = Object.keys(changed).concat(Object.keys(removed));\n\n        for (var i = 0; i < totalChanged.length; ++i) {\n          var qp = qpMap[totalChanged[i]];\n\n          if (qp && (0, _metal.get)(this._optionsForQueryParam(qp), 'refreshModel') && this._router.currentState) {\n            this.refresh();\n            break;\n          }\n        }\n\n        return true;\n      },\n\n      finalizeQueryParamChange(params, finalParams, transition) {\n        if (this.fullRouteName !== 'application') {\n          return true;\n        } // Transition object is absent for intermediate transitions.\n\n\n        if (!transition) {\n          return;\n        }\n\n        var routeInfos = transition[_router_js.STATE_SYMBOL].routeInfos;\n        var router = this._router;\n\n        var qpMeta = router._queryParamsFor(routeInfos);\n\n        var changes = router._qpUpdates;\n        var qpUpdated = false;\n        var replaceUrl;\n        (0, _utils2.stashParamNames)(router, routeInfos);\n\n        for (var i = 0; i < qpMeta.qps.length; ++i) {\n          var qp = qpMeta.qps[i];\n          var route = qp.route;\n          var controller = route.controller;\n          var presentKey = qp.urlKey in params && qp.urlKey; // Do a reverse lookup to see if the changed query\n          // param URL key corresponds to a QP property on\n          // this controller.\n\n          var value = void 0,\n              svalue = void 0;\n\n          if (changes.has(qp.urlKey)) {\n            // Value updated in/before setupController\n            value = (0, _metal.get)(controller, qp.prop);\n            svalue = route.serializeQueryParam(value, qp.urlKey, qp.type);\n          } else {\n            if (presentKey) {\n              svalue = params[presentKey];\n\n              if (svalue !== undefined) {\n                value = route.deserializeQueryParam(svalue, qp.urlKey, qp.type);\n              }\n            } else {\n              // No QP provided; use default value.\n              svalue = qp.serializedDefaultValue;\n              value = copyDefaultValue(qp.defaultValue);\n            }\n          }\n\n          controller._qpDelegate = (0, _metal.get)(route, '_qp.states.inactive');\n          var thisQueryParamChanged = svalue !== qp.serializedValue;\n\n          if (thisQueryParamChanged) {\n            if (transition.queryParamsOnly && replaceUrl !== false) {\n              var options = route._optionsForQueryParam(qp);\n\n              var replaceConfigValue = (0, _metal.get)(options, 'replace');\n\n              if (replaceConfigValue) {\n                replaceUrl = true;\n              } else if (replaceConfigValue === false) {\n                // Explicit pushState wins over any other replaceStates.\n                replaceUrl = false;\n              }\n            }\n\n            (0, _metal.set)(controller, qp.prop, value);\n            qpUpdated = true;\n          } // Stash current serialized value of controller.\n\n\n          qp.serializedValue = svalue;\n          var thisQueryParamHasDefaultValue = qp.serializedDefaultValue === svalue;\n\n          if (!thisQueryParamHasDefaultValue || transition._keepDefaultQueryParamValues) {\n            finalParams.push({\n              value: svalue,\n              visible: true,\n              key: presentKey || qp.urlKey\n            });\n          }\n        } // Some QPs have been updated, and those changes need to be propogated\n        // immediately. Eventually, we should work on making this async somehow.\n\n\n        if (true\n        /* EMBER_METAL_TRACKED_PROPERTIES */\n        && qpUpdated === true) {\n          (0, _metal.flushAsyncObservers)(false);\n        }\n\n        if (replaceUrl) {\n          transition.method('replace');\n        }\n\n        qpMeta.qps.forEach(qp => {\n          var routeQpMeta = (0, _metal.get)(qp.route, '_qp');\n          var finalizedController = qp.route.controller;\n          finalizedController._qpDelegate = (0, _metal.get)(routeQpMeta, 'states.active');\n        });\n\n        router._qpUpdates.clear();\n\n        return;\n      }\n\n    }\n  });\n  var ROUTER_EVENT_DEPRECATIONS;\n  _exports.ROUTER_EVENT_DEPRECATIONS = ROUTER_EVENT_DEPRECATIONS;\n\n  if (_deprecatedFeatures.ROUTER_EVENTS) {\n    _exports.ROUTER_EVENT_DEPRECATIONS = ROUTER_EVENT_DEPRECATIONS = {\n      on(name) {\n        this._super(...arguments);\n\n        var hasDidTransition = name === 'didTransition';\n        var hasWillTransition = name === 'willTransition';\n\n        if (hasDidTransition) {\n          (true && !(false) && (0, _debug.deprecate)('You attempted to listen to the \"didTransition\" event which is deprecated. Please inject the router service and listen to the \"routeDidChange\" event.', false, {\n            id: 'deprecate-router-events',\n            until: '4.0.0',\n            url: 'https://emberjs.com/deprecations/v3.x#toc_deprecate-router-events'\n          }));\n        }\n\n        if (hasWillTransition) {\n          (true && !(false) && (0, _debug.deprecate)('You attempted to listen to the \"willTransition\" event which is deprecated. Please inject the router service and listen to the \"routeWillChange\" event.', false, {\n            id: 'deprecate-router-events',\n            until: '4.0.0',\n            url: 'https://emberjs.com/deprecations/v3.x#toc_deprecate-router-events'\n          }));\n        }\n      }\n\n    };\n    Route.reopen(ROUTER_EVENT_DEPRECATIONS, {\n      _paramsFor(routeName, params) {\n        var transition = this._router._routerMicrolib.activeTransition;\n\n        if (transition !== undefined) {\n          return this.paramsFor(routeName);\n        }\n\n        return params;\n      }\n\n    });\n  }\n\n  (0, _runtime.setFrameworkClass)(Route);\n  var _default = Route;\n  _exports.default = _default;\n});","define(\"@ember/-internals/routing/lib/system/router\", [\"exports\", \"@ember/-internals/metal\", \"@ember/-internals/owner\", \"@ember/-internals/runtime\", \"@ember/debug\", \"@ember/deprecated-features\", \"@ember/error\", \"@ember/polyfills\", \"@ember/runloop\", \"@ember/-internals/routing/lib/location/api\", \"@ember/-internals/routing/lib/utils\", \"@ember/-internals/routing/lib/system/dsl\", \"@ember/-internals/routing/lib/system/route\", \"@ember/-internals/routing/lib/system/router_state\", \"router_js\"], function (_exports, _metal, _owner, _runtime, _debug, _deprecatedFeatures, _error2, _polyfills, _runloop, _api, _utils, _dsl, _route, _router_state, _router_js) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.triggerEvent = triggerEvent;\n  _exports.default = void 0;\n\n  function defaultDidTransition(infos) {\n    updatePaths(this);\n\n    this._cancelSlowTransitionTimer();\n\n    this.notifyPropertyChange('url');\n    this.set('currentState', this.targetState); // Put this in the runloop so url will be accurate. Seems\n    // less surprising than didTransition being out of sync.\n\n    (0, _runloop.once)(this, this.trigger, 'didTransition');\n\n    if (true\n    /* DEBUG */\n    ) {\n      if ((0, _metal.get)(this, 'namespace').LOG_TRANSITIONS) {\n        // eslint-disable-next-line no-console\n        console.log(\"Transitioned into '\" + EmberRouter._routePath(infos) + \"'\");\n      }\n    }\n  }\n\n  function defaultWillTransition(oldInfos, newInfos, transition) {\n    (0, _runloop.once)(this, this.trigger, 'willTransition', transition);\n\n    if (true\n    /* DEBUG */\n    ) {\n      if ((0, _metal.get)(this, 'namespace').LOG_TRANSITIONS) {\n        // eslint-disable-next-line no-console\n        console.log(\"Preparing to transition from '\" + EmberRouter._routePath(oldInfos) + \"' to '\" + EmberRouter._routePath(newInfos) + \"'\");\n      }\n    }\n  }\n\n  function K() {\n    return this;\n  }\n\n  var {\n    slice\n  } = Array.prototype;\n  /**\n    The `EmberRouter` class manages the application state and URLs. Refer to\n    the [routing guide](https://guides.emberjs.com/release/routing/) for documentation.\n  \n    @class EmberRouter\n    @extends EmberObject\n    @uses Evented\n    @public\n  */\n\n  class EmberRouter extends _runtime.Object {\n    constructor() {\n      super(...arguments);\n      this.currentURL = null;\n      this.currentRouteName = null;\n      this.currentPath = null;\n      this.currentRoute = null;\n      this._qpCache = Object.create(null);\n      this._qpUpdates = new Set();\n      this._handledErrors = new Set();\n      this._engineInstances = Object.create(null);\n      this._engineInfoByRoute = Object.create(null);\n      this.currentState = null;\n      this.targetState = null;\n\n      this._resetQueuedQueryParameterChanges();\n    }\n\n    _initRouterJs() {\n      var location = (0, _metal.get)(this, 'location');\n      var router = this;\n      var owner = (0, _owner.getOwner)(this);\n      var seen = Object.create(null);\n\n      class PrivateRouter extends _router_js.default {\n        getRoute(name) {\n          var routeName = name;\n          var routeOwner = owner;\n          var engineInfo = router._engineInfoByRoute[routeName];\n\n          if (engineInfo) {\n            var engineInstance = router._getEngineInstance(engineInfo);\n\n            routeOwner = engineInstance;\n            routeName = engineInfo.localFullName;\n          }\n\n          var fullRouteName = \"route:\" + routeName;\n          var route = routeOwner.lookup(fullRouteName);\n\n          if (seen[name]) {\n            return route;\n          }\n\n          seen[name] = true;\n\n          if (!route) {\n            var DefaultRoute = routeOwner.factoryFor('route:basic').class;\n            routeOwner.register(fullRouteName, DefaultRoute.extend());\n            route = routeOwner.lookup(fullRouteName);\n\n            if (true\n            /* DEBUG */\n            ) {\n              if ((0, _metal.get)(router, 'namespace.LOG_ACTIVE_GENERATION')) {\n                (0, _debug.info)(\"generated -> \" + fullRouteName, {\n                  fullName: fullRouteName\n                });\n              }\n            }\n          }\n\n          route._setRouteName(routeName);\n\n          if (engineInfo && !(0, _route.hasDefaultSerialize)(route)) {\n            throw new Error('Defining a custom serialize method on an Engine route is not supported.');\n          }\n\n          return route;\n        }\n\n        getSerializer(name) {\n          var engineInfo = router._engineInfoByRoute[name]; // If this is not an Engine route, we fall back to the handler for serialization\n\n          if (!engineInfo) {\n            return;\n          }\n\n          return engineInfo.serializeMethod || _route.defaultSerialize;\n        }\n\n        updateURL(path) {\n          (0, _runloop.once)(() => {\n            location.setURL(path);\n            (0, _metal.set)(router, 'currentURL', path);\n          });\n        }\n\n        didTransition(infos) {\n          if (_deprecatedFeatures.ROUTER_EVENTS) {\n            if (router.didTransition !== defaultDidTransition) {\n              (true && !(false) && (0, _debug.deprecate)('You attempted to override the \"didTransition\" method which is deprecated. Please inject the router service and listen to the \"routeDidChange\" event.', false, {\n                id: 'deprecate-router-events',\n                until: '4.0.0',\n                url: 'https://emberjs.com/deprecations/v3.x#toc_deprecate-router-events'\n              }));\n            }\n          }\n\n          router.didTransition(infos);\n        }\n\n        willTransition(oldInfos, newInfos, transition) {\n          if (_deprecatedFeatures.ROUTER_EVENTS) {\n            if (router.willTransition !== defaultWillTransition) {\n              (true && !(false) && (0, _debug.deprecate)('You attempted to override the \"willTransition\" method which is deprecated. Please inject the router service and listen to the \"routeWillChange\" event.', false, {\n                id: 'deprecate-router-events',\n                until: '4.0.0',\n                url: 'https://emberjs.com/deprecations/v3.x#toc_deprecate-router-events'\n              }));\n            }\n          }\n\n          router.willTransition(oldInfos, newInfos, transition);\n        }\n\n        triggerEvent(routeInfos, ignoreFailure, name, args) {\n          return triggerEvent.bind(router)(routeInfos, ignoreFailure, name, args);\n        }\n\n        routeWillChange(transition) {\n          router.trigger('routeWillChange', transition);\n        }\n\n        routeDidChange(transition) {\n          router.set('currentRoute', transition.to);\n          (0, _runloop.once)(() => {\n            router.trigger('routeDidChange', transition);\n          });\n        }\n\n        transitionDidError(error, transition) {\n          if (error.wasAborted || transition.isAborted) {\n            // If the error was a transition erorr or the transition aborted\n            // log the abort.\n            return (0, _router_js.logAbort)(transition);\n          } else {\n            // Otherwise trigger the \"error\" event to attempt an intermediate\n            // transition into an error substate\n            transition.trigger(false, 'error', error.error, transition, error.route);\n\n            if (router._isErrorHandled(error.error)) {\n              // If we handled the error with a substate just roll the state back on\n              // the transition and send the \"routeDidChange\" event for landing on\n              // the error substate and return the error.\n              transition.rollback();\n              this.routeDidChange(transition);\n              return error.error;\n            } else {\n              // If it was not handled, abort the transition completely and return\n              // the error.\n              transition.abort();\n              return error.error;\n            }\n          }\n        }\n\n        _triggerWillChangeContext() {\n          return router;\n        }\n\n        _triggerWillLeave() {\n          return router;\n        }\n\n        replaceURL(url) {\n          if (location.replaceURL) {\n            var doReplaceURL = () => {\n              location.replaceURL(url);\n              (0, _metal.set)(router, 'currentURL', url);\n            };\n\n            (0, _runloop.once)(doReplaceURL);\n          } else {\n            this.updateURL(url);\n          }\n        }\n\n      }\n\n      var routerMicrolib = this._routerMicrolib = new PrivateRouter();\n      var dslCallbacks = this.constructor.dslCallbacks || [K];\n\n      var dsl = this._buildDSL();\n\n      dsl.route('application', {\n        path: '/',\n        resetNamespace: true,\n        overrideNameAssertion: true\n      }, function () {\n        for (var i = 0; i < dslCallbacks.length; i++) {\n          dslCallbacks[i].call(this);\n        }\n      });\n\n      if (true\n      /* DEBUG */\n      ) {\n        if ((0, _metal.get)(this, 'namespace.LOG_TRANSITIONS_INTERNAL')) {\n          routerMicrolib.log = console.log.bind(console); // eslint-disable-line no-console\n        }\n      }\n\n      routerMicrolib.map(dsl.generate());\n    }\n\n    _buildDSL() {\n      var enableLoadingSubstates = this._hasModuleBasedResolver();\n\n      var router = this;\n      var owner = (0, _owner.getOwner)(this);\n      var options = {\n        enableLoadingSubstates,\n\n        resolveRouteMap(name) {\n          return owner.factoryFor(\"route-map:\" + name);\n        },\n\n        addRouteForEngine(name, engineInfo) {\n          if (!router._engineInfoByRoute[name]) {\n            router._engineInfoByRoute[name] = engineInfo;\n          }\n        }\n\n      };\n      return new _dsl.default(null, options);\n    }\n    /*\n      Resets all pending query parameter changes.\n      Called after transitioning to a new route\n      based on query parameter changes.\n    */\n\n\n    _resetQueuedQueryParameterChanges() {\n      this._queuedQPChanges = {};\n    }\n\n    _hasModuleBasedResolver() {\n      var owner = (0, _owner.getOwner)(this);\n\n      if (!owner) {\n        return false;\n      }\n\n      var resolver = (0, _metal.get)(owner, 'application.__registry__.resolver.moduleBasedResolver');\n      return Boolean(resolver);\n    }\n    /**\n      Initializes the current router instance and sets up the change handling\n      event listeners used by the instances `location` implementation.\n         A property named `initialURL` will be used to determine the initial URL.\n      If no value is found `/` will be used.\n         @method startRouting\n      @private\n    */\n\n\n    startRouting() {\n      var initialURL = (0, _metal.get)(this, 'initialURL');\n\n      if (this.setupRouter()) {\n        if (initialURL === undefined) {\n          initialURL = (0, _metal.get)(this, 'location').getURL();\n        }\n\n        var initialTransition = this.handleURL(initialURL);\n\n        if (initialTransition && initialTransition.error) {\n          throw initialTransition.error;\n        }\n      }\n    }\n\n    setupRouter() {\n      this._setupLocation();\n\n      var location = (0, _metal.get)(this, 'location'); // Allow the Location class to cancel the router setup while it refreshes\n      // the page\n\n      if ((0, _metal.get)(location, 'cancelRouterSetup')) {\n        return false;\n      }\n\n      this._initRouterJs();\n\n      location.onUpdateURL(url => {\n        this.handleURL(url);\n      });\n      return true;\n    }\n\n    _setOutlets() {\n      // This is triggered async during Route#willDestroy.\n      // If the router is also being destroyed we do not want to\n      // to create another this._toplevelView (and leak the renderer)\n      if (this.isDestroying || this.isDestroyed) {\n        return;\n      }\n\n      var routeInfos = this._routerMicrolib.currentRouteInfos;\n      var route;\n      var defaultParentState;\n      var liveRoutes = null;\n\n      if (!routeInfos) {\n        return;\n      }\n\n      for (var i = 0; i < routeInfos.length; i++) {\n        route = routeInfos[i].route;\n\n        var connections = _route.ROUTE_CONNECTIONS.get(route);\n\n        var ownState = void 0;\n\n        for (var j = 0; j < connections.length; j++) {\n          var appended = appendLiveRoute(liveRoutes, defaultParentState, connections[j]);\n          liveRoutes = appended.liveRoutes;\n\n          if (appended.ownState.render.name === route.routeName || appended.ownState.render.outlet === 'main') {\n            ownState = appended.ownState;\n          }\n        }\n\n        if (connections.length === 0) {\n          ownState = representEmptyRoute(liveRoutes, defaultParentState, route);\n        }\n\n        defaultParentState = ownState;\n      } // when a transitionTo happens after the validation phase\n      // during the initial transition _setOutlets is called\n      // when no routes are active. However, it will get called\n      // again with the correct values during the next turn of\n      // the runloop\n\n\n      if (!liveRoutes) {\n        return;\n      }\n\n      if (!this._toplevelView) {\n        var owner = (0, _owner.getOwner)(this);\n        var OutletView = owner.factoryFor('view:-outlet');\n        this._toplevelView = OutletView.create();\n\n        this._toplevelView.setOutletState(liveRoutes);\n\n        var instance = owner.lookup('-application-instance:main');\n        instance.didCreateRootView(this._toplevelView);\n      } else {\n        this._toplevelView.setOutletState(liveRoutes);\n      }\n    }\n\n    handleURL(url) {\n      // Until we have an ember-idiomatic way of accessing #hashes, we need to\n      // remove it because router.js doesn't know how to handle it.\n      var _url = url.split(/#(.+)?/)[0];\n      return this._doURLTransition('handleURL', _url);\n    }\n\n    _doURLTransition(routerJsMethod, url) {\n      var transition = this._routerMicrolib[routerJsMethod](url || '/');\n\n      didBeginTransition(transition, this);\n      return transition;\n    }\n    /**\n      Transition the application into another route. The route may\n      be either a single route or route path:\n         See [transitionTo](/ember/release/classes/Route/methods/transitionTo?anchor=transitionTo) for more info.\n         @method transitionTo\n      @param {String} name the name of the route or a URL\n      @param {...Object} models the model(s) or identifier(s) to be used while\n        transitioning to the route.\n      @param {Object} [options] optional hash with a queryParams property\n        containing a mapping of query parameters\n      @return {Transition} the transition object associated with this\n        attempted transition\n      @public\n    */\n\n\n    transitionTo(...args) {\n      if ((0, _utils.resemblesURL)(args[0])) {\n        (true && !(!this.isDestroying && !this.isDestroyed) && (0, _debug.assert)(\"A transition was attempted from '\" + this.currentRouteName + \"' to '\" + args[0] + \"' but the application instance has already been destroyed.\", !this.isDestroying && !this.isDestroyed));\n        return this._doURLTransition('transitionTo', args[0]);\n      }\n\n      var {\n        routeName,\n        models,\n        queryParams\n      } = (0, _utils.extractRouteArgs)(args);\n      (true && !(!this.isDestroying && !this.isDestroyed) && (0, _debug.assert)(\"A transition was attempted from '\" + this.currentRouteName + \"' to '\" + routeName + \"' but the application instance has already been destroyed.\", !this.isDestroying && !this.isDestroyed));\n      return this._doTransition(routeName, models, queryParams);\n    }\n\n    intermediateTransitionTo(name, ...args) {\n      this._routerMicrolib.intermediateTransitionTo(name, ...args);\n\n      updatePaths(this);\n\n      if (true\n      /* DEBUG */\n      ) {\n        var infos = this._routerMicrolib.currentRouteInfos;\n\n        if ((0, _metal.get)(this, 'namespace').LOG_TRANSITIONS) {\n          // eslint-disable-next-line no-console\n          console.log(\"Intermediate-transitioned into '\" + EmberRouter._routePath(infos) + \"'\");\n        }\n      }\n    }\n\n    replaceWith(...args) {\n      return this.transitionTo(...args).method('replace');\n    }\n\n    generate(name, ...args) {\n      var url = this._routerMicrolib.generate(name, ...args);\n\n      return this.location.formatURL(url);\n    }\n    /**\n      Determines if the supplied route is currently active.\n         @method isActive\n      @param routeName\n      @return {Boolean}\n      @private\n    */\n\n\n    isActive(routeName) {\n      return this._routerMicrolib.isActive(routeName);\n    }\n    /**\n      An alternative form of `isActive` that doesn't require\n      manual concatenation of the arguments into a single\n      array.\n         @method isActiveIntent\n      @param routeName\n      @param models\n      @param queryParams\n      @return {Boolean}\n      @private\n      @since 1.7.0\n    */\n\n\n    isActiveIntent(routeName, models, queryParams) {\n      return this.currentState.isActiveIntent(routeName, models, queryParams);\n    }\n\n    send(name, ...args) {\n      /*name, context*/\n      this._routerMicrolib.trigger(name, ...args);\n    }\n    /**\n      Does this router instance have the given route.\n         @method hasRoute\n      @return {Boolean}\n      @private\n    */\n\n\n    hasRoute(route) {\n      return this._routerMicrolib.hasRoute(route);\n    }\n    /**\n      Resets the state of the router by clearing the current route\n      handlers and deactivating them.\n         @private\n      @method reset\n     */\n\n\n    reset() {\n      if (this._routerMicrolib) {\n        this._routerMicrolib.reset();\n      }\n    }\n\n    willDestroy() {\n      if (this._toplevelView) {\n        this._toplevelView.destroy();\n\n        this._toplevelView = null;\n      }\n\n      this._super(...arguments);\n\n      this.reset();\n      var instances = this._engineInstances;\n\n      for (var name in instances) {\n        for (var id in instances[name]) {\n          (0, _runloop.run)(instances[name][id], 'destroy');\n        }\n      }\n    }\n    /*\n      Called when an active route's query parameter has changed.\n      These changes are batched into a runloop run and trigger\n      a single transition.\n    */\n\n\n    _activeQPChanged(queryParameterName, newValue) {\n      this._queuedQPChanges[queryParameterName] = newValue;\n      (0, _runloop.once)(this, this._fireQueryParamTransition);\n    }\n\n    _updatingQPChanged(queryParameterName) {\n      this._qpUpdates.add(queryParameterName);\n    }\n    /*\n      Triggers a transition to a route based on query parameter changes.\n      This is called once per runloop, to batch changes.\n         e.g.\n         if these methods are called in succession:\n      this._activeQPChanged('foo', '10');\n        // results in _queuedQPChanges = { foo: '10' }\n      this._activeQPChanged('bar', false);\n        // results in _queuedQPChanges = { foo: '10', bar: false }\n         _queuedQPChanges will represent both of these changes\n      and the transition using `transitionTo` will be triggered\n      once.\n    */\n\n\n    _fireQueryParamTransition() {\n      this.transitionTo({\n        queryParams: this._queuedQPChanges\n      });\n\n      this._resetQueuedQueryParameterChanges();\n    }\n\n    _setupLocation() {\n      var location = this.location;\n      var rootURL = this.rootURL;\n      var owner = (0, _owner.getOwner)(this);\n\n      if ('string' === typeof location && owner) {\n        var resolvedLocation = owner.lookup(\"location:\" + location);\n\n        if (resolvedLocation !== undefined) {\n          location = (0, _metal.set)(this, 'location', resolvedLocation);\n        } else {\n          // Allow for deprecated registration of custom location API's\n          var options = {\n            implementation: location\n          };\n          location = (0, _metal.set)(this, 'location', _api.default.create(options));\n        }\n      }\n\n      if (location !== null && typeof location === 'object') {\n        if (rootURL) {\n          (0, _metal.set)(location, 'rootURL', rootURL);\n        } // Allow the location to do any feature detection, such as AutoLocation\n        // detecting history support. This gives it a chance to set its\n        // `cancelRouterSetup` property which aborts routing.\n\n\n        if (typeof location.detect === 'function') {\n          location.detect();\n        } // ensure that initState is called AFTER the rootURL is set on\n        // the location instance\n\n\n        if (typeof location.initState === 'function') {\n          location.initState();\n        }\n      }\n    }\n    /**\n      Serializes the given query params according to their QP meta information.\n         @private\n      @method _serializeQueryParams\n      @param {Arrray<RouteInfo>} routeInfos\n      @param {Object} queryParams\n      @return {Void}\n    */\n\n\n    _serializeQueryParams(routeInfos, queryParams) {\n      forEachQueryParam(this, routeInfos, queryParams, (key, value, qp) => {\n        if (qp) {\n          delete queryParams[key];\n          queryParams[qp.urlKey] = qp.route.serializeQueryParam(value, qp.urlKey, qp.type);\n        } else if (value === undefined) {\n          return; // We don't serialize undefined values\n        } else {\n          queryParams[key] = this._serializeQueryParam(value, (0, _runtime.typeOf)(value));\n        }\n      });\n    }\n    /**\n      Serializes the value of a query parameter based on a type\n         @private\n      @method _serializeQueryParam\n      @param {Object} value\n      @param {String} type\n    */\n\n\n    _serializeQueryParam(value, type) {\n      if (value === null || value === undefined) {\n        return value;\n      } else if (type === 'array') {\n        return JSON.stringify(value);\n      }\n\n      return \"\" + value;\n    }\n    /**\n      Deserializes the given query params according to their QP meta information.\n         @private\n      @method _deserializeQueryParams\n      @param {Array<RouteInfo>} routeInfos\n      @param {Object} queryParams\n      @return {Void}\n    */\n\n\n    _deserializeQueryParams(routeInfos, queryParams) {\n      forEachQueryParam(this, routeInfos, queryParams, (key, value, qp) => {\n        // If we don't have QP meta info for a given key, then we do nothing\n        // because all values will be treated as strings\n        if (qp) {\n          delete queryParams[key];\n          queryParams[qp.prop] = qp.route.deserializeQueryParam(value, qp.urlKey, qp.type);\n        }\n      });\n    }\n    /**\n      Deserializes the value of a query parameter based on a default type\n         @private\n      @method _deserializeQueryParam\n      @param {Object} value\n      @param {String} defaultType\n    */\n\n\n    _deserializeQueryParam(value, defaultType) {\n      if (value === null || value === undefined) {\n        return value;\n      } else if (defaultType === 'boolean') {\n        return value === 'true';\n      } else if (defaultType === 'number') {\n        return Number(value).valueOf();\n      } else if (defaultType === 'array') {\n        return (0, _runtime.A)(JSON.parse(value));\n      }\n\n      return value;\n    }\n    /**\n      Removes (prunes) any query params with default values from the given QP\n      object. Default values are determined from the QP meta information per key.\n         @private\n      @method _pruneDefaultQueryParamValues\n      @param {Array<RouteInfo>} routeInfos\n      @param {Object} queryParams\n      @return {Void}\n    */\n\n\n    _pruneDefaultQueryParamValues(routeInfos, queryParams) {\n      var qps = this._queryParamsFor(routeInfos);\n\n      for (var key in queryParams) {\n        var qp = qps.map[key];\n\n        if (qp && qp.serializedDefaultValue === queryParams[key]) {\n          delete queryParams[key];\n        }\n      }\n    }\n\n    _doTransition(_targetRouteName, models, _queryParams, _keepDefaultQueryParamValues) {\n      var targetRouteName = _targetRouteName || (0, _utils.getActiveTargetName)(this._routerMicrolib);\n\n      (true && !(Boolean(targetRouteName) && this._routerMicrolib.hasRoute(targetRouteName)) && (0, _debug.assert)(\"The route \" + targetRouteName + \" was not found\", Boolean(targetRouteName) && this._routerMicrolib.hasRoute(targetRouteName)));\n      var queryParams = {};\n\n      this._processActiveTransitionQueryParams(targetRouteName, models, queryParams, _queryParams);\n\n      (0, _polyfills.assign)(queryParams, _queryParams);\n\n      this._prepareQueryParams(targetRouteName, models, queryParams, Boolean(_keepDefaultQueryParamValues));\n\n      var transition = this._routerMicrolib.transitionTo(targetRouteName, ...models, {\n        queryParams\n      });\n\n      didBeginTransition(transition, this);\n      return transition;\n    }\n\n    _processActiveTransitionQueryParams(targetRouteName, models, queryParams, _queryParams) {\n      // merge in any queryParams from the active transition which could include\n      // queryParams from the url on initial load.\n      if (!this._routerMicrolib.activeTransition) {\n        return;\n      }\n\n      var unchangedQPs = {};\n      var qpUpdates = this._qpUpdates;\n      var params = this._routerMicrolib.activeTransition[_router_js.QUERY_PARAMS_SYMBOL];\n\n      for (var key in params) {\n        if (!qpUpdates.has(key)) {\n          unchangedQPs[key] = params[key];\n        }\n      } // We need to fully scope queryParams so that we can create one object\n      // that represents both passed-in queryParams and ones that aren't changed\n      // from the active transition.\n\n\n      this._fullyScopeQueryParams(targetRouteName, models, _queryParams);\n\n      this._fullyScopeQueryParams(targetRouteName, models, unchangedQPs);\n\n      (0, _polyfills.assign)(queryParams, unchangedQPs);\n    }\n    /**\n      Prepares the query params for a URL or Transition. Restores any undefined QP\n      keys/values, serializes all values, and then prunes any default values.\n         @private\n      @method _prepareQueryParams\n      @param {String} targetRouteName\n      @param {Array<Object>} models\n      @param {Object} queryParams\n      @param {boolean} keepDefaultQueryParamValues\n      @return {Void}\n    */\n\n\n    _prepareQueryParams(targetRouteName, models, queryParams, _fromRouterService) {\n      var state = calculatePostTransitionState(this, targetRouteName, models);\n\n      this._hydrateUnsuppliedQueryParams(state, queryParams, Boolean(_fromRouterService));\n\n      this._serializeQueryParams(state.routeInfos, queryParams);\n\n      if (!_fromRouterService) {\n        this._pruneDefaultQueryParamValues(state.routeInfos, queryParams);\n      }\n    }\n    /**\n      Returns the meta information for the query params of a given route. This\n      will be overridden to allow support for lazy routes.\n         @private\n      @method _getQPMeta\n      @param {RouteInfo} routeInfo\n      @return {Object}\n    */\n\n\n    _getQPMeta(routeInfo) {\n      var route = routeInfo.route;\n      return route && (0, _metal.get)(route, '_qp');\n    }\n    /**\n      Returns a merged query params meta object for a given set of routeInfos.\n      Useful for knowing what query params are available for a given route hierarchy.\n         @private\n      @method _queryParamsFor\n      @param {Array<RouteInfo>} routeInfos\n      @return {Object}\n     */\n\n\n    _queryParamsFor(routeInfos) {\n      var routeInfoLength = routeInfos.length;\n      var leafRouteName = routeInfos[routeInfoLength - 1].name;\n      var cached = this._qpCache[leafRouteName];\n\n      if (cached !== undefined) {\n        return cached;\n      }\n\n      var shouldCache = true;\n      var map = {};\n      var qps = [];\n      var qpsByUrlKey = true\n      /* DEBUG */\n      ? {} : null;\n      var qpMeta;\n      var qp;\n      var urlKey;\n      var qpOther;\n\n      for (var i = 0; i < routeInfoLength; ++i) {\n        qpMeta = this._getQPMeta(routeInfos[i]);\n\n        if (!qpMeta) {\n          shouldCache = false;\n          continue;\n        } // Loop over each QP to make sure we don't have any collisions by urlKey\n\n\n        for (var _i = 0; _i < qpMeta.qps.length; _i++) {\n          qp = qpMeta.qps[_i];\n\n          if (true\n          /* DEBUG */\n          ) {\n            urlKey = qp.urlKey;\n            qpOther = qpsByUrlKey[urlKey];\n\n            if (qpOther && qpOther.controllerName !== qp.controllerName) {\n              (true && !(false) && (0, _debug.assert)(\"You're not allowed to have more than one controller property map to the same query param key, but both `\" + qpOther.scopedPropertyName + \"` and `\" + qp.scopedPropertyName + \"` map to `\" + urlKey + \"`. You can fix this by mapping one of the controller properties to a different query param key via the `as` config option, e.g. `\" + qpOther.prop + \": { as: 'other-\" + qpOther.prop + \"' }`\", false));\n            }\n\n            qpsByUrlKey[urlKey] = qp;\n          }\n\n          qps.push(qp);\n        }\n\n        (0, _polyfills.assign)(map, qpMeta.map);\n      }\n\n      var finalQPMeta = {\n        qps,\n        map\n      };\n\n      if (shouldCache) {\n        this._qpCache[leafRouteName] = finalQPMeta;\n      }\n\n      return finalQPMeta;\n    }\n    /**\n      Maps all query param keys to their fully scoped property name of the form\n      `controllerName:propName`.\n         @private\n      @method _fullyScopeQueryParams\n      @param {String} leafRouteName\n      @param {Array<Object>} contexts\n      @param {Object} queryParams\n      @return {Void}\n    */\n\n\n    _fullyScopeQueryParams(leafRouteName, contexts, queryParams) {\n      var state = calculatePostTransitionState(this, leafRouteName, contexts);\n      var routeInfos = state.routeInfos;\n      var qpMeta;\n\n      for (var i = 0, len = routeInfos.length; i < len; ++i) {\n        qpMeta = this._getQPMeta(routeInfos[i]);\n\n        if (!qpMeta) {\n          continue;\n        }\n\n        var qp = void 0;\n        var presentProp = void 0;\n\n        for (var j = 0, qpLen = qpMeta.qps.length; j < qpLen; ++j) {\n          qp = qpMeta.qps[j];\n          presentProp = qp.prop in queryParams && qp.prop || qp.scopedPropertyName in queryParams && qp.scopedPropertyName || qp.urlKey in queryParams && qp.urlKey;\n\n          if (presentProp) {\n            if (presentProp !== qp.scopedPropertyName) {\n              queryParams[qp.scopedPropertyName] = queryParams[presentProp];\n              delete queryParams[presentProp];\n            }\n          }\n        }\n      }\n    }\n    /**\n      Hydrates (adds/restores) any query params that have pre-existing values into\n      the given queryParams hash. This is what allows query params to be \"sticky\"\n      and restore their last known values for their scope.\n         @private\n      @method _hydrateUnsuppliedQueryParams\n      @param {TransitionState} state\n      @param {Object} queryParams\n      @return {Void}\n    */\n\n\n    _hydrateUnsuppliedQueryParams(state, queryParams, _fromRouterService) {\n      var routeInfos = state.routeInfos;\n      var appCache = this._bucketCache;\n      var qpMeta;\n      var qp;\n      var presentProp;\n\n      for (var i = 0; i < routeInfos.length; ++i) {\n        qpMeta = this._getQPMeta(routeInfos[i]);\n\n        if (!qpMeta) {\n          continue;\n        }\n\n        for (var j = 0, qpLen = qpMeta.qps.length; j < qpLen; ++j) {\n          qp = qpMeta.qps[j];\n          presentProp = qp.prop in queryParams && qp.prop || qp.scopedPropertyName in queryParams && qp.scopedPropertyName || qp.urlKey in queryParams && qp.urlKey;\n          (true && !(function () {\n            if (qp.urlKey === presentProp) {\n              return true;\n            }\n\n            if (_fromRouterService && presentProp !== false && qp.urlKey !== qp.prop) {\n              // assumptions (mainly from current transitionTo_test):\n              // - this is only supposed to be run when there is an alias to a query param and the alias is used to set the param\n              // - when there is no alias: qp.urlKey == qp.prop\n              return false;\n            }\n\n            return true;\n          }()) && (0, _debug.assert)(\"You passed the `\" + presentProp + \"` query parameter during a transition into \" + qp.route.routeName + \", please update to \" + qp.urlKey, function () {\n            if (qp.urlKey === presentProp) {\n              return true;\n            }\n\n            if (_fromRouterService && presentProp !== false && qp.urlKey !== qp.prop) {\n              return false;\n            }\n\n            return true;\n          }()));\n\n          if (presentProp) {\n            if (presentProp !== qp.scopedPropertyName) {\n              queryParams[qp.scopedPropertyName] = queryParams[presentProp];\n              delete queryParams[presentProp];\n            }\n          } else {\n            var cacheKey = (0, _utils.calculateCacheKey)(qp.route.fullRouteName, qp.parts, state.params);\n            queryParams[qp.scopedPropertyName] = appCache.lookup(cacheKey, qp.prop, qp.defaultValue);\n          }\n        }\n      }\n    }\n\n    _scheduleLoadingEvent(transition, originRoute) {\n      this._cancelSlowTransitionTimer();\n\n      this._slowTransitionTimer = (0, _runloop.scheduleOnce)('routerTransitions', this, '_handleSlowTransition', transition, originRoute);\n    }\n\n    _handleSlowTransition(transition, originRoute) {\n      if (!this._routerMicrolib.activeTransition) {\n        // Don't fire an event if we've since moved on from\n        // the transition that put us in a loading state.\n        return;\n      }\n\n      var targetState = new _router_state.default(this, this._routerMicrolib, this._routerMicrolib.activeTransition[_router_js.STATE_SYMBOL]);\n      this.set('targetState', targetState);\n      transition.trigger(true, 'loading', transition, originRoute);\n    }\n\n    _cancelSlowTransitionTimer() {\n      if (this._slowTransitionTimer) {\n        (0, _runloop.cancel)(this._slowTransitionTimer);\n      }\n\n      this._slowTransitionTimer = null;\n    } // These three helper functions are used to ensure errors aren't\n    // re-raised if they're handled in a route's error action.\n\n\n    _markErrorAsHandled(error) {\n      this._handledErrors.add(error);\n    }\n\n    _isErrorHandled(error) {\n      return this._handledErrors.has(error);\n    }\n\n    _clearHandledError(error) {\n      this._handledErrors.delete(error);\n    }\n\n    _getEngineInstance({\n      name,\n      instanceId,\n      mountPoint\n    }) {\n      var engineInstances = this._engineInstances;\n\n      if (!engineInstances[name]) {\n        engineInstances[name] = Object.create(null);\n      }\n\n      var engineInstance = engineInstances[name][instanceId];\n\n      if (!engineInstance) {\n        var owner = (0, _owner.getOwner)(this);\n        (true && !(owner.hasRegistration(\"engine:\" + name)) && (0, _debug.assert)(\"You attempted to mount the engine '\" + name + \"' in your router map, but the engine can not be found.\", owner.hasRegistration(\"engine:\" + name)));\n        engineInstance = owner.buildChildEngineInstance(name, {\n          routable: true,\n          mountPoint\n        });\n        engineInstance.boot();\n        engineInstances[name][instanceId] = engineInstance;\n      }\n\n      return engineInstance;\n    }\n\n  }\n  /*\n    Helper function for iterating over routes in a set of routeInfos that are\n    at or above the given origin route. Example: if `originRoute` === 'foo.bar'\n    and the routeInfos given were for 'foo.bar.baz', then the given callback\n    will be invoked with the routes for 'foo.bar', 'foo', and 'application'\n    individually.\n  \n    If the callback returns anything other than `true`, then iteration will stop.\n  \n    @private\n    @param {Route} originRoute\n    @param {Array<RouteInfo>} routeInfos\n    @param {Function} callback\n    @return {Void}\n   */\n\n\n  function forEachRouteAbove(routeInfos, callback) {\n    for (var i = routeInfos.length - 1; i >= 0; --i) {\n      var routeInfo = routeInfos[i];\n      var route = routeInfo.route; // routeInfo.handler being `undefined` generally means either:\n      //\n      // 1. an error occurred during creation of the route in question\n      // 2. the route is across an async boundary (e.g. within an engine)\n      //\n      // In both of these cases, we cannot invoke the callback on that specific\n      // route, because it just doesn't exist...\n\n      if (route === undefined) {\n        continue;\n      }\n\n      if (callback(route, routeInfo) !== true) {\n        return;\n      }\n    }\n  } // These get invoked when an action bubbles above ApplicationRoute\n  // and are not meant to be overridable.\n\n\n  var defaultActionHandlers = {\n    willResolveModel(_routeInfos, transition, originRoute) {\n      this._scheduleLoadingEvent(transition, originRoute);\n    },\n\n    // Attempt to find an appropriate error route or substate to enter.\n    error(routeInfos, error, transition) {\n      var router = this;\n      var routeInfoWithError = routeInfos[routeInfos.length - 1];\n      forEachRouteAbove(routeInfos, (route, routeInfo) => {\n        // We don't check the leaf most routeInfo since that would\n        // technically be below where we're at in the route hierarchy.\n        if (routeInfo !== routeInfoWithError) {\n          // Check for the existence of an 'error' route.\n          var errorRouteName = findRouteStateName(route, 'error');\n\n          if (errorRouteName) {\n            router._markErrorAsHandled(error);\n\n            router.intermediateTransitionTo(errorRouteName, error);\n            return false;\n          }\n        } // Check for an 'error' substate route\n\n\n        var errorSubstateName = findRouteSubstateName(route, 'error');\n\n        if (errorSubstateName) {\n          router._markErrorAsHandled(error);\n\n          router.intermediateTransitionTo(errorSubstateName, error);\n          return false;\n        }\n\n        return true;\n      });\n      logError(error, \"Error while processing route: \" + transition.targetName);\n    },\n\n    // Attempt to find an appropriate loading route or substate to enter.\n    loading(routeInfos, transition) {\n      var router = this;\n      var routeInfoWithSlowLoading = routeInfos[routeInfos.length - 1];\n      forEachRouteAbove(routeInfos, (route, routeInfo) => {\n        // We don't check the leaf most routeInfos since that would\n        // technically be below where we're at in the route hierarchy.\n        if (routeInfo !== routeInfoWithSlowLoading) {\n          // Check for the existence of a 'loading' route.\n          var loadingRouteName = findRouteStateName(route, 'loading');\n\n          if (loadingRouteName) {\n            router.intermediateTransitionTo(loadingRouteName);\n            return false;\n          }\n        } // Check for loading substate\n\n\n        var loadingSubstateName = findRouteSubstateName(route, 'loading');\n\n        if (loadingSubstateName) {\n          router.intermediateTransitionTo(loadingSubstateName);\n          return false;\n        } // Don't bubble above pivot route.\n\n\n        return transition.pivotHandler !== route;\n      });\n    }\n\n  };\n\n  function logError(_error, initialMessage) {\n    var errorArgs = [];\n    var error;\n\n    if (_error && typeof _error === 'object' && typeof _error.errorThrown === 'object') {\n      error = _error.errorThrown;\n    } else {\n      error = _error;\n    }\n\n    if (initialMessage) {\n      errorArgs.push(initialMessage);\n    }\n\n    if (error) {\n      if (error.message) {\n        errorArgs.push(error.message);\n      }\n\n      if (error.stack) {\n        errorArgs.push(error.stack);\n      }\n\n      if (typeof error === 'string') {\n        errorArgs.push(error);\n      }\n    }\n\n    console.error(...errorArgs); //eslint-disable-line no-console\n  }\n  /**\n    Finds the name of the substate route if it exists for the given route. A\n    substate route is of the form `route_state`, such as `foo_loading`.\n  \n    @private\n    @param {Route} route\n    @param {String} state\n    @return {String}\n  */\n\n\n  function findRouteSubstateName(route, state) {\n    var owner = (0, _owner.getOwner)(route);\n    var {\n      routeName,\n      fullRouteName,\n      _router: router\n    } = route;\n    var substateName = routeName + \"_\" + state;\n    var substateNameFull = fullRouteName + \"_\" + state;\n    return routeHasBeenDefined(owner, router, substateName, substateNameFull) ? substateNameFull : '';\n  }\n  /**\n    Finds the name of the state route if it exists for the given route. A state\n    route is of the form `route.state`, such as `foo.loading`. Properly Handles\n    `application` named routes.\n  \n    @private\n    @param {Route} route\n    @param {String} state\n    @return {String}\n  */\n\n\n  function findRouteStateName(route, state) {\n    var owner = (0, _owner.getOwner)(route);\n    var {\n      routeName,\n      fullRouteName,\n      _router: router\n    } = route;\n    var stateName = routeName === 'application' ? state : routeName + \".\" + state;\n    var stateNameFull = fullRouteName === 'application' ? state : fullRouteName + \".\" + state;\n    return routeHasBeenDefined(owner, router, stateName, stateNameFull) ? stateNameFull : '';\n  }\n  /**\n    Determines whether or not a route has been defined by checking that the route\n    is in the Router's map and the owner has a registration for that route.\n  \n    @private\n    @param {Owner} owner\n    @param {Router} router\n    @param {String} localName\n    @param {String} fullName\n    @return {Boolean}\n  */\n\n\n  function routeHasBeenDefined(owner, router, localName, fullName) {\n    var routerHasRoute = router.hasRoute(fullName);\n    var ownerHasRoute = owner.hasRegistration(\"template:\" + localName) || owner.hasRegistration(\"route:\" + localName);\n    return routerHasRoute && ownerHasRoute;\n  }\n\n  function triggerEvent(routeInfos, ignoreFailure, name, args) {\n    if (!routeInfos) {\n      if (ignoreFailure) {\n        return;\n      }\n\n      throw new _error2.default(\"Can't trigger action '\" + name + \"' because your app hasn't finished transitioning into its first route. To trigger an action on destination routes during a transition, you can call `.send()` on the `Transition` object passed to the `model/beforeModel/afterModel` hooks.\");\n    }\n\n    var eventWasHandled = false;\n    var routeInfo, handler, actionHandler;\n\n    for (var i = routeInfos.length - 1; i >= 0; i--) {\n      routeInfo = routeInfos[i];\n      handler = routeInfo.route;\n      actionHandler = handler && handler.actions && handler.actions[name];\n\n      if (actionHandler) {\n        if (actionHandler.apply(handler, args) === true) {\n          eventWasHandled = true;\n        } else {\n          // Should only hit here if a non-bubbling error action is triggered on a route.\n          if (name === 'error') {\n            handler._router._markErrorAsHandled(args[0]);\n          }\n\n          return;\n        }\n      }\n    }\n\n    var defaultHandler = defaultActionHandlers[name];\n\n    if (defaultHandler) {\n      defaultHandler.apply(this, [routeInfos, ...args]);\n      return;\n    }\n\n    if (!eventWasHandled && !ignoreFailure) {\n      throw new _error2.default(\"Nothing handled the action '\" + name + \"'. If you did handle the action, this error can be caused by returning true from an action handler in a controller, causing the action to bubble.\");\n    }\n  }\n\n  function calculatePostTransitionState(emberRouter, leafRouteName, contexts) {\n    var state = emberRouter._routerMicrolib.applyIntent(leafRouteName, contexts);\n\n    var {\n      routeInfos,\n      params\n    } = state;\n\n    for (var i = 0; i < routeInfos.length; ++i) {\n      var routeInfo = routeInfos[i]; // If the routeInfo is not resolved, we serialize the context into params\n\n      if (!routeInfo.isResolved) {\n        params[routeInfo.name] = routeInfo.serialize(routeInfo.context);\n      } else {\n        params[routeInfo.name] = routeInfo.params;\n      }\n    }\n\n    return state;\n  }\n\n  function updatePaths(router) {\n    var infos = router._routerMicrolib.currentRouteInfos;\n\n    if (infos.length === 0) {\n      return;\n    }\n\n    var path = EmberRouter._routePath(infos);\n\n    var currentRouteName = infos[infos.length - 1].name;\n    var currentURL = router.get('location').getURL();\n    (0, _metal.set)(router, 'currentPath', path);\n    (0, _metal.set)(router, 'currentRouteName', currentRouteName);\n    (0, _metal.set)(router, 'currentURL', currentURL);\n    var appController = (0, _owner.getOwner)(router).lookup('controller:application');\n\n    if (!appController) {\n      // appController might not exist when top-level loading/error\n      // substates have been entered since ApplicationRoute hasn't\n      // actually been entered at that point.\n      return;\n    }\n\n    if (_deprecatedFeatures.APP_CTRL_ROUTER_PROPS) {\n      if (!('currentPath' in appController)) {\n        Object.defineProperty(appController, 'currentPath', {\n          get() {\n            (true && !(false) && (0, _debug.deprecate)('Accessing `currentPath` on `controller:application` is deprecated, use the `currentPath` property on `service:router` instead.', false, {\n              id: 'application-controller.router-properties',\n              until: '4.0.0',\n              url: 'https://emberjs.com/deprecations/v3.x#toc_application-controller-router-properties'\n            }));\n            return (0, _metal.get)(router, 'currentPath');\n          }\n\n        });\n      }\n\n      (0, _metal.notifyPropertyChange)(appController, 'currentPath');\n\n      if (!('currentRouteName' in appController)) {\n        Object.defineProperty(appController, 'currentRouteName', {\n          get() {\n            (true && !(false) && (0, _debug.deprecate)('Accessing `currentRouteName` on `controller:application` is deprecated, use the `currentRouteName` property on `service:router` instead.', false, {\n              id: 'application-controller.router-properties',\n              until: '4.0.0',\n              url: 'https://emberjs.com/deprecations/v3.x#toc_application-controller-router-properties'\n            }));\n            return (0, _metal.get)(router, 'currentRouteName');\n          }\n\n        });\n      }\n\n      (0, _metal.notifyPropertyChange)(appController, 'currentRouteName');\n    }\n  }\n\n  EmberRouter.reopenClass({\n    /**\n      The `Router.map` function allows you to define mappings from URLs to routes\n      in your application. These mappings are defined within the\n      supplied callback function using `this.route`.\n         The first parameter is the name of the route which is used by default as the\n      path name as well.\n         The second parameter is the optional options hash. Available options are:\n           * `path`: allows you to provide your own path as well as mark dynamic\n          segments.\n        * `resetNamespace`: false by default; when nesting routes, ember will\n          combine the route names to form the fully-qualified route name, which is\n          used with `{{link-to}}` or manually transitioning to routes. Setting\n          `resetNamespace: true` will cause the route not to inherit from its\n          parent route's names. This is handy for preventing extremely long route names.\n          Keep in mind that the actual URL path behavior is still retained.\n         The third parameter is a function, which can be used to nest routes.\n      Nested routes, by default, will have the parent route tree's route name and\n      path prepended to it's own.\n         ```app/router.js\n      Router.map(function(){\n        this.route('post', { path: '/post/:post_id' }, function() {\n          this.route('edit');\n          this.route('comments', { resetNamespace: true }, function() {\n            this.route('new');\n          });\n        });\n      });\n      ```\n         @method map\n      @param callback\n      @public\n    */\n    map(callback) {\n      if (!this.dslCallbacks) {\n        this.dslCallbacks = [];\n        this.reopenClass({\n          dslCallbacks: this.dslCallbacks\n        });\n      }\n\n      this.dslCallbacks.push(callback);\n      return this;\n    },\n\n    _routePath(routeInfos) {\n      var path = []; // We have to handle coalescing resource names that\n      // are prefixed with their parent's names, e.g.\n      // ['foo', 'foo.bar.baz'] => 'foo.bar.baz', not 'foo.foo.bar.baz'\n\n      function intersectionMatches(a1, a2) {\n        for (var i = 0; i < a1.length; ++i) {\n          if (a1[i] !== a2[i]) {\n            return false;\n          }\n        }\n\n        return true;\n      }\n\n      var name, nameParts, oldNameParts;\n\n      for (var i = 1; i < routeInfos.length; i++) {\n        name = routeInfos[i].name;\n        nameParts = name.split('.');\n        oldNameParts = slice.call(path);\n\n        while (oldNameParts.length) {\n          if (intersectionMatches(oldNameParts, nameParts)) {\n            break;\n          }\n\n          oldNameParts.shift();\n        }\n\n        path.push(...nameParts.slice(oldNameParts.length));\n      }\n\n      return path.join('.');\n    }\n\n  });\n\n  function didBeginTransition(transition, router) {\n    var routerState = new _router_state.default(router, router._routerMicrolib, transition[_router_js.STATE_SYMBOL]);\n\n    if (!router.currentState) {\n      router.set('currentState', routerState);\n    }\n\n    router.set('targetState', routerState);\n    transition.promise = transition.catch(error => {\n      if (router._isErrorHandled(error)) {\n        router._clearHandledError(error);\n      } else {\n        throw error;\n      }\n    }, 'Transition Error');\n  }\n\n  function forEachQueryParam(router, routeInfos, queryParams, callback) {\n    var qpCache = router._queryParamsFor(routeInfos);\n\n    for (var key in queryParams) {\n      if (!queryParams.hasOwnProperty(key)) {\n        continue;\n      }\n\n      var value = queryParams[key];\n      var qp = qpCache.map[key];\n      callback(key, value, qp);\n    }\n  }\n\n  function findLiveRoute(liveRoutes, name) {\n    if (!liveRoutes) {\n      return;\n    }\n\n    var stack = [liveRoutes];\n\n    while (stack.length > 0) {\n      var test = stack.shift();\n\n      if (test.render.name === name) {\n        return test;\n      }\n\n      var outlets = test.outlets;\n\n      for (var outletName in outlets) {\n        stack.push(outlets[outletName]);\n      }\n    }\n\n    return;\n  }\n\n  function appendLiveRoute(liveRoutes, defaultParentState, renderOptions) {\n    var target;\n    var myState = {\n      render: renderOptions,\n      outlets: Object.create(null),\n      wasUsed: false\n    };\n\n    if (renderOptions.into) {\n      target = findLiveRoute(liveRoutes, renderOptions.into);\n    } else {\n      target = defaultParentState;\n    }\n\n    if (target) {\n      (0, _metal.set)(target.outlets, renderOptions.outlet, myState);\n    } else {\n      liveRoutes = myState;\n    }\n\n    return {\n      liveRoutes,\n      ownState: myState\n    };\n  }\n\n  function representEmptyRoute(liveRoutes, defaultParentState, route) {\n    // the route didn't render anything\n    var alreadyAppended = findLiveRoute(liveRoutes, route.routeName);\n\n    if (alreadyAppended) {\n      // But some other route has already rendered our default\n      // template, so that becomes the default target for any\n      // children we may have.\n      return alreadyAppended;\n    } else {\n      // Create an entry to represent our default template name,\n      // just so other routes can target it and inherit its place\n      // in the outlet hierarchy.\n      defaultParentState.outlets.main = {\n        render: {\n          name: route.routeName,\n          outlet: 'main'\n        },\n        outlets: {}\n      };\n      return defaultParentState;\n    }\n  }\n\n  EmberRouter.reopen(_runtime.Evented, {\n    /**\n      Handles updating the paths and notifying any listeners of the URL\n      change.\n         Triggers the router level `didTransition` hook.\n         For example, to notify google analytics when the route changes,\n      you could use this hook.  (Note: requires also including GA scripts, etc.)\n         ```javascript\n      import config from './config/environment';\n      import EmberRouter from '@ember/routing/router';\n      import { inject as service } from '@ember/service';\n         let Router = EmberRouter.extend({\n        location: config.locationType,\n           router: service(),\n           didTransition: function() {\n          this._super(...arguments);\n             ga('send', 'pageview', {\n            page: this.router.currentURL,\n            title: this.router.currentRouteName,\n          });\n        }\n      });\n      ```\n         @method didTransition\n      @public\n      @since 1.2.0\n    */\n    didTransition: defaultDidTransition,\n\n    /**\n      Handles notifying any listeners of an impending URL\n      change.\n         Triggers the router level `willTransition` hook.\n         @method willTransition\n      @public\n      @since 1.11.0\n    */\n    willTransition: defaultWillTransition,\n\n    /**\n     Represents the URL of the root of the application, often '/'. This prefix is\n     assumed on all routes defined on this router.\n        @property rootURL\n     @default '/'\n     @public\n    */\n    rootURL: '/',\n\n    /**\n     The `location` property determines the type of URL's that your\n     application will use.\n        The following location types are currently available:\n        * `history` - use the browser's history API to make the URLs look just like any standard URL\n     * `hash` - use `#` to separate the server part of the URL from the Ember part: `/blog/#/posts/new`\n     * `none` - do not store the Ember URL in the actual browser URL (mainly used for testing)\n     * `auto` - use the best option based on browser capabilities: `history` if possible, then `hash` if possible, otherwise `none`\n        This value is defaulted to `auto` by the `locationType` setting of `/config/environment.js`\n        @property location\n     @default 'hash'\n     @see {Location}\n     @public\n    */\n    location: 'hash',\n\n    /**\n     Represents the current URL.\n        @property url\n     @type {String}\n     @private\n    */\n    url: (0, _metal.computed)(function () {\n      var location = (0, _metal.get)(this, 'location');\n\n      if (typeof location === 'string') {\n        return undefined;\n      }\n\n      return location.getURL();\n    })\n  });\n\n  if (_deprecatedFeatures.ROUTER_EVENTS) {\n    EmberRouter.reopen(_route.ROUTER_EVENT_DEPRECATIONS);\n  }\n\n  var _default = EmberRouter;\n  _exports.default = _default;\n});","define(\"@ember/-internals/routing/lib/system/router_state\", [\"exports\", \"@ember/polyfills\", \"@ember/-internals/routing/lib/utils\"], function (_exports, _polyfills, _utils) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  class RouterState {\n    constructor(emberRouter, router, routerJsState) {\n      this.emberRouter = emberRouter;\n      this.router = router;\n      this.routerJsState = routerJsState;\n    }\n\n    isActiveIntent(routeName, models, queryParams, queryParamsMustMatch) {\n      var state = this.routerJsState;\n\n      if (!this.router.isActiveIntent(routeName, models, undefined, state)) {\n        return false;\n      }\n\n      if (queryParamsMustMatch && Object.keys(queryParams).length > 0) {\n        var visibleQueryParams = (0, _polyfills.assign)({}, queryParams);\n\n        this.emberRouter._prepareQueryParams(routeName, models, visibleQueryParams);\n\n        return (0, _utils.shallowEqual)(visibleQueryParams, state.queryParams);\n      }\n\n      return true;\n    }\n\n  }\n\n  _exports.default = RouterState;\n});","define(\"@ember/-internals/routing/lib/system/transition\", [], function () {\n  \"use strict\";\n  /**\n    A Transition is a thennable (a promise-like object) that represents\n    an attempt to transition to another route. It can be aborted, either\n    explicitly via `abort` or by attempting another transition while a\n    previous one is still underway. An aborted transition can also\n    be `retry()`d later.\n  \n    @class Transition\n    @public\n  */\n\n  /**\n    The Transition's internal promise. Calling `.then` on this property\n    is that same as calling `.then` on the Transition object itself, but\n    this property is exposed for when you want to pass around a\n    Transition's promise, but not the Transition object itself, since\n    Transition object can be externally `abort`ed, while the promise\n    cannot.\n  \n    @property promise\n    @type {Object}\n    @public\n    */\n\n  /**\n    Custom state can be stored on a Transition's `data` object.\n    This can be useful for decorating a Transition within an earlier\n    hook and shared with a later hook. Properties set on `data` will\n    be copied to new transitions generated by calling `retry` on this\n    transition.\n  \n    @property data\n    @type {Object}\n    @public\n  */\n\n  /**\n    A standard promise hook that resolves if the transition\n    succeeds and rejects if it fails/redirects/aborts.\n  \n    Forwards to the internal `promise` property which you can\n    use in situations where you want to pass around a thennable,\n    but not the Transition itself.\n  \n    @method then\n    @param {Function} onFulfilled\n    @param {Function} onRejected\n    @param {String} label optional string for labeling the promise.\n    Useful for tooling.\n    @return {Promise}\n    @public\n  */\n\n  /**\n  \n    Forwards to the internal `promise` property which you can\n    use in situations where you want to pass around a thennable,\n    but not the Transition itself.\n  \n    @method catch\n    @param {Function} onRejection\n    @param {String} label optional string for labeling the promise.\n    Useful for tooling.\n    @return {Promise}\n    @public\n  */\n\n  /**\n  \n    Forwards to the internal `promise` property which you can\n    use in situations where you want to pass around a thennable,\n    but not the Transition itself.\n  \n    @method finally\n    @param {Function} callback\n    @param {String} label optional string for labeling the promise.\n    Useful for tooling.\n    @return {Promise}\n    @public\n  */\n\n  /**\n    Aborts the Transition. Note you can also implicitly abort a transition\n    by initiating another transition while a previous one is underway.\n  \n    @method abort\n    @return {Transition} this transition\n    @public\n  */\n\n  /**\n  \n    Retries a previously-aborted transition (making sure to abort the\n    transition if it's still active). Returns a new transition that\n    represents the new attempt to transition.\n  \n    @method retry\n    @return {Transition} new transition\n    @public\n    */\n\n  /**\n  \n    Sets the URL-changing method to be employed at the end of a\n    successful transition. By default, a new Transition will just\n    use `updateURL`, but passing 'replace' to this method will\n    cause the URL to update using 'replaceWith' instead. Omitting\n    a parameter will disable the URL change, allowing for transitions\n    that don't update the URL at completion (this is also used for\n    handleURL, since the URL has already changed before the\n    transition took place).\n  \n    @method method\n    @param {String} method the type of URL-changing method to use\n      at the end of a transition. Accepted values are 'replace',\n      falsy values, or any other non-falsy value (which is\n      interpreted as an updateURL transition).\n  \n    @return {Transition} this transition\n    @public\n  */\n\n  /**\n  \n    Fires an event on the current list of resolved/resolving\n    handlers within this transition. Useful for firing events\n    on route hierarchies that haven't fully been entered yet.\n  \n    Note: This method is also aliased as `send`\n  \n    @method trigger\n    @param {Boolean} [ignoreFailure=false] a boolean specifying whether unhandled events throw an error\n    @param {String} name the name of the event to fire\n    @public\n  */\n\n  /**\n   * This property is a `RouteInfo` object that represents\n   * where the router is transitioning to. It's important\n   * to note that a `RouteInfo` is a linked list and this\n   * property represents the leafmost route.\n   * @property {null|RouteInfo|RouteInfoWithAttributes} to\n   * @public\n   */\n\n  /**\n   * This property is a `RouteInfo` object that represents\n   * where transition originated from. It's important\n   * to note that a `RouteInfo` is a linked list and this\n   * property represents the head node of the list.\n   * In the case of an initial render, `from` will be set to\n   * `null`.\n   * @property {null|RouteInfoWithAttributes} from\n   * @public\n   */\n\n  /**\n    Transitions are aborted and their promises rejected\n    when redirects occur; this method returns a promise\n    that will follow any redirects that occur and fulfill\n    with the value fulfilled by any redirecting transitions\n    that occur.\n  \n    @method followRedirects\n    @return {Promise} a promise that fulfills with the same\n      value that the final redirecting transition fulfills with\n    @public\n  */\n});","define(\"@ember/-internals/routing/lib/utils\", [\"exports\", \"@ember/-internals/metal\", \"@ember/-internals/owner\", \"@ember/error\", \"@ember/polyfills\", \"router_js\"], function (_exports, _metal, _owner, _error, _polyfills, _router_js) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.extractRouteArgs = extractRouteArgs;\n  _exports.getActiveTargetName = getActiveTargetName;\n  _exports.stashParamNames = stashParamNames;\n  _exports.calculateCacheKey = calculateCacheKey;\n  _exports.normalizeControllerQueryParams = normalizeControllerQueryParams;\n  _exports.resemblesURL = resemblesURL;\n  _exports.prefixRouteNameArg = prefixRouteNameArg;\n  _exports.shallowEqual = shallowEqual;\n  var ALL_PERIODS_REGEX = /\\./g;\n\n  function extractRouteArgs(args) {\n    args = args.slice();\n    var possibleQueryParams = args[args.length - 1];\n    var queryParams;\n\n    if (possibleQueryParams && possibleQueryParams.hasOwnProperty('queryParams')) {\n      queryParams = args.pop().queryParams;\n    } else {\n      queryParams = {};\n    }\n\n    var routeName = args.shift();\n    return {\n      routeName,\n      models: args,\n      queryParams\n    };\n  }\n\n  function getActiveTargetName(router) {\n    var routeInfos = router.activeTransition ? router.activeTransition[_router_js.STATE_SYMBOL].routeInfos : router.state.routeInfos;\n    return routeInfos[routeInfos.length - 1].name;\n  }\n\n  function stashParamNames(router, routeInfos) {\n    if (routeInfos['_namesStashed']) {\n      return;\n    } // This helper exists because router.js/route-recognizer.js awkwardly\n    // keeps separate a routeInfo's list of parameter names depending\n    // on whether a URL transition or named transition is happening.\n    // Hopefully we can remove this in the future.\n\n\n    var targetRouteName = routeInfos[routeInfos.length - 1].name;\n\n    var recogHandlers = router._routerMicrolib.recognizer.handlersFor(targetRouteName);\n\n    var dynamicParent;\n\n    for (var i = 0; i < routeInfos.length; ++i) {\n      var routeInfo = routeInfos[i];\n      var names = recogHandlers[i].names;\n\n      if (names.length) {\n        dynamicParent = routeInfo;\n      }\n\n      routeInfo['_names'] = names;\n      var route = routeInfo.route;\n\n      route._stashNames(routeInfo, dynamicParent);\n    }\n\n    routeInfos['_namesStashed'] = true;\n  }\n\n  function _calculateCacheValuePrefix(prefix, part) {\n    // calculates the dot separated sections from prefix that are also\n    // at the start of part - which gives us the route name\n    // given : prefix = site.article.comments, part = site.article.id\n    //      - returns: site.article (use get(values[site.article], 'id') to get the dynamic part - used below)\n    // given : prefix = site.article, part = site.article.id\n    //      - returns: site.article. (use get(values[site.article], 'id') to get the dynamic part - used below)\n    var prefixParts = prefix.split('.');\n    var currPrefix = '';\n\n    for (var i = 0; i < prefixParts.length; i++) {\n      var currPart = prefixParts.slice(0, i + 1).join('.');\n\n      if (part.indexOf(currPart) !== 0) {\n        break;\n      }\n\n      currPrefix = currPart;\n    }\n\n    return currPrefix;\n  }\n  /*\n    Stolen from Controller\n  */\n\n\n  function calculateCacheKey(prefix, parts = [], values) {\n    var suffixes = '';\n\n    for (var i = 0; i < parts.length; ++i) {\n      var part = parts[i];\n\n      var cacheValuePrefix = _calculateCacheValuePrefix(prefix, part);\n\n      var value = void 0;\n\n      if (values) {\n        if (cacheValuePrefix && cacheValuePrefix in values) {\n          var partRemovedPrefix = part.indexOf(cacheValuePrefix) === 0 ? part.substr(cacheValuePrefix.length + 1) : part;\n          value = (0, _metal.get)(values[cacheValuePrefix], partRemovedPrefix);\n        } else {\n          value = (0, _metal.get)(values, part);\n        }\n      }\n\n      suffixes += \"::\" + part + \":\" + value;\n    }\n\n    return prefix + suffixes.replace(ALL_PERIODS_REGEX, '-');\n  }\n  /*\n    Controller-defined query parameters can come in three shapes:\n  \n    Array\n      queryParams: ['foo', 'bar']\n    Array of simple objects where value is an alias\n      queryParams: [\n        {\n          'foo': 'rename_foo_to_this'\n        },\n        {\n          'bar': 'call_bar_this_instead'\n        }\n      ]\n    Array of fully defined objects\n      queryParams: [\n        {\n          'foo': {\n            as: 'rename_foo_to_this'\n          },\n        }\n        {\n          'bar': {\n            as: 'call_bar_this_instead',\n            scope: 'controller'\n          }\n        }\n      ]\n  \n    This helper normalizes all three possible styles into the\n    'Array of fully defined objects' style.\n  */\n\n\n  function normalizeControllerQueryParams(queryParams) {\n    var qpMap = {};\n\n    for (var i = 0; i < queryParams.length; ++i) {\n      accumulateQueryParamDescriptors(queryParams[i], qpMap);\n    }\n\n    return qpMap;\n  }\n\n  function accumulateQueryParamDescriptors(_desc, accum) {\n    var desc = _desc;\n    var tmp;\n\n    if (typeof desc === 'string') {\n      tmp = {};\n      tmp[desc] = {\n        as: null\n      };\n      desc = tmp;\n    }\n\n    for (var key in desc) {\n      if (!desc.hasOwnProperty(key)) {\n        return;\n      }\n\n      var singleDesc = desc[key];\n\n      if (typeof singleDesc === 'string') {\n        singleDesc = {\n          as: singleDesc\n        };\n      }\n\n      tmp = accum[key] || {\n        as: null,\n        scope: 'model'\n      };\n      (0, _polyfills.assign)(tmp, singleDesc);\n      accum[key] = tmp;\n    }\n  }\n  /*\n    Check if a routeName resembles a url instead\n  \n    @private\n  */\n\n\n  function resemblesURL(str) {\n    return typeof str === 'string' && (str === '' || str[0] === '/');\n  }\n  /*\n    Returns an arguments array where the route name arg is prefixed based on the mount point\n  \n    @private\n  */\n\n\n  function prefixRouteNameArg(route, args) {\n    var routeName = args[0];\n    var owner = (0, _owner.getOwner)(route);\n    var prefix = owner.mountPoint; // only alter the routeName if it's actually referencing a route.\n\n    if (owner.routable && typeof routeName === 'string') {\n      if (resemblesURL(routeName)) {\n        throw new _error.default('Programmatic transitions by URL cannot be used within an Engine. Please use the route name instead.');\n      } else {\n        routeName = prefix + \".\" + routeName;\n        args[0] = routeName;\n      }\n    }\n\n    return args;\n  }\n\n  function shallowEqual(a, b) {\n    var k;\n    var aCount = 0;\n    var bCount = 0;\n\n    for (k in a) {\n      if (a.hasOwnProperty(k)) {\n        if (a[k] !== b[k]) {\n          return false;\n        }\n\n        aCount++;\n      }\n    }\n\n    for (k in b) {\n      if (b.hasOwnProperty(k)) {\n        bCount++;\n      }\n    }\n\n    return aCount === bCount;\n  }\n});","define(\"@ember/-internals/runtime/index\", [\"exports\", \"@ember/-internals/runtime/lib/system/object\", \"@ember/-internals/runtime/lib/mixins/registry_proxy\", \"@ember/-internals/runtime/lib/mixins/container_proxy\", \"@ember/-internals/runtime/lib/copy\", \"@ember/-internals/runtime/lib/compare\", \"@ember/-internals/runtime/lib/is-equal\", \"@ember/-internals/runtime/lib/mixins/array\", \"@ember/-internals/runtime/lib/mixins/comparable\", \"@ember/-internals/runtime/lib/system/namespace\", \"@ember/-internals/runtime/lib/system/array_proxy\", \"@ember/-internals/runtime/lib/system/object_proxy\", \"@ember/-internals/runtime/lib/system/core_object\", \"@ember/-internals/runtime/lib/mixins/action_handler\", \"@ember/-internals/runtime/lib/mixins/copyable\", \"@ember/-internals/runtime/lib/mixins/enumerable\", \"@ember/-internals/runtime/lib/mixins/-proxy\", \"@ember/-internals/runtime/lib/mixins/observable\", \"@ember/-internals/runtime/lib/mixins/mutable_enumerable\", \"@ember/-internals/runtime/lib/mixins/target_action_support\", \"@ember/-internals/runtime/lib/mixins/evented\", \"@ember/-internals/runtime/lib/mixins/promise_proxy\", \"@ember/-internals/runtime/lib/ext/rsvp\", \"@ember/-internals/runtime/lib/type-of\", \"@ember/-internals/runtime/lib/ext/function\"], function (_exports, _object, _registry_proxy, _container_proxy, _copy, _compare, _isEqual, _array, _comparable, _namespace, _array_proxy, _object_proxy, _core_object, _action_handler, _copyable, _enumerable, _proxy, _observable, _mutable_enumerable, _target_action_support, _evented, _promise_proxy, _rsvp, _typeOf, _function) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"Object\", {\n    enumerable: true,\n    get: function () {\n      return _object.default;\n    }\n  });\n  Object.defineProperty(_exports, \"FrameworkObject\", {\n    enumerable: true,\n    get: function () {\n      return _object.FrameworkObject;\n    }\n  });\n  Object.defineProperty(_exports, \"RegistryProxyMixin\", {\n    enumerable: true,\n    get: function () {\n      return _registry_proxy.default;\n    }\n  });\n  Object.defineProperty(_exports, \"ContainerProxyMixin\", {\n    enumerable: true,\n    get: function () {\n      return _container_proxy.default;\n    }\n  });\n  Object.defineProperty(_exports, \"copy\", {\n    enumerable: true,\n    get: function () {\n      return _copy.default;\n    }\n  });\n  Object.defineProperty(_exports, \"compare\", {\n    enumerable: true,\n    get: function () {\n      return _compare.default;\n    }\n  });\n  Object.defineProperty(_exports, \"isEqual\", {\n    enumerable: true,\n    get: function () {\n      return _isEqual.default;\n    }\n  });\n  Object.defineProperty(_exports, \"Array\", {\n    enumerable: true,\n    get: function () {\n      return _array.default;\n    }\n  });\n  Object.defineProperty(_exports, \"NativeArray\", {\n    enumerable: true,\n    get: function () {\n      return _array.NativeArray;\n    }\n  });\n  Object.defineProperty(_exports, \"A\", {\n    enumerable: true,\n    get: function () {\n      return _array.A;\n    }\n  });\n  Object.defineProperty(_exports, \"MutableArray\", {\n    enumerable: true,\n    get: function () {\n      return _array.MutableArray;\n    }\n  });\n  Object.defineProperty(_exports, \"removeAt\", {\n    enumerable: true,\n    get: function () {\n      return _array.removeAt;\n    }\n  });\n  Object.defineProperty(_exports, \"uniqBy\", {\n    enumerable: true,\n    get: function () {\n      return _array.uniqBy;\n    }\n  });\n  Object.defineProperty(_exports, \"isArray\", {\n    enumerable: true,\n    get: function () {\n      return _array.isArray;\n    }\n  });\n  Object.defineProperty(_exports, \"Comparable\", {\n    enumerable: true,\n    get: function () {\n      return _comparable.default;\n    }\n  });\n  Object.defineProperty(_exports, \"Namespace\", {\n    enumerable: true,\n    get: function () {\n      return _namespace.default;\n    }\n  });\n  Object.defineProperty(_exports, \"ArrayProxy\", {\n    enumerable: true,\n    get: function () {\n      return _array_proxy.default;\n    }\n  });\n  Object.defineProperty(_exports, \"ObjectProxy\", {\n    enumerable: true,\n    get: function () {\n      return _object_proxy.default;\n    }\n  });\n  Object.defineProperty(_exports, \"CoreObject\", {\n    enumerable: true,\n    get: function () {\n      return _core_object.default;\n    }\n  });\n  Object.defineProperty(_exports, \"setFrameworkClass\", {\n    enumerable: true,\n    get: function () {\n      return _core_object.setFrameworkClass;\n    }\n  });\n  Object.defineProperty(_exports, \"ActionHandler\", {\n    enumerable: true,\n    get: function () {\n      return _action_handler.default;\n    }\n  });\n  Object.defineProperty(_exports, \"Copyable\", {\n    enumerable: true,\n    get: function () {\n      return _copyable.default;\n    }\n  });\n  Object.defineProperty(_exports, \"Enumerable\", {\n    enumerable: true,\n    get: function () {\n      return _enumerable.default;\n    }\n  });\n  Object.defineProperty(_exports, \"_ProxyMixin\", {\n    enumerable: true,\n    get: function () {\n      return _proxy.default;\n    }\n  });\n  Object.defineProperty(_exports, \"_contentFor\", {\n    enumerable: true,\n    get: function () {\n      return _proxy.contentFor;\n    }\n  });\n  Object.defineProperty(_exports, \"Observable\", {\n    enumerable: true,\n    get: function () {\n      return _observable.default;\n    }\n  });\n  Object.defineProperty(_exports, \"MutableEnumerable\", {\n    enumerable: true,\n    get: function () {\n      return _mutable_enumerable.default;\n    }\n  });\n  Object.defineProperty(_exports, \"TargetActionSupport\", {\n    enumerable: true,\n    get: function () {\n      return _target_action_support.default;\n    }\n  });\n  Object.defineProperty(_exports, \"Evented\", {\n    enumerable: true,\n    get: function () {\n      return _evented.default;\n    }\n  });\n  Object.defineProperty(_exports, \"PromiseProxyMixin\", {\n    enumerable: true,\n    get: function () {\n      return _promise_proxy.default;\n    }\n  });\n  Object.defineProperty(_exports, \"RSVP\", {\n    enumerable: true,\n    get: function () {\n      return _rsvp.default;\n    }\n  });\n  Object.defineProperty(_exports, \"onerrorDefault\", {\n    enumerable: true,\n    get: function () {\n      return _rsvp.onerrorDefault;\n    }\n  });\n  Object.defineProperty(_exports, \"typeOf\", {\n    enumerable: true,\n    get: function () {\n      return _typeOf.typeOf;\n    }\n  });\n});","define(\"@ember/-internals/runtime/lib/compare\", [\"exports\", \"@ember/-internals/runtime/lib/type-of\", \"@ember/-internals/runtime/lib/mixins/comparable\"], function (_exports, _typeOf, _comparable) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = compare;\n  var TYPE_ORDER = {\n    undefined: 0,\n    null: 1,\n    boolean: 2,\n    number: 3,\n    string: 4,\n    array: 5,\n    object: 6,\n    instance: 7,\n    function: 8,\n    class: 9,\n    date: 10\n  }; //\n  // the spaceship operator\n  //\n  //                      `. ___\n  //                     __,' __`.                _..----....____\n  //         __...--.'``;.   ,.   ;``--..__     .'    ,-._    _.-'\n  //   _..-''-------'   `'   `'   `'     O ``-''._   (,;') _,'\n  // ,'________________                          \\`-._`-','\n  //  `._              ```````````------...___   '-.._'-:\n  //     ```--.._      ,.                     ````--...__\\-.\n  //             `.--. `-` \"INFINITY IS LESS     ____    |  |`\n  //               `. `.   THAN BEYOND\"        ,'`````.  ;  ;`\n  //                 `._`.        __________   `.      \\'__/`\n  //                    `-:._____/______/___/____`.     \\  `\n  //                                |       `._    `.    \\\n  //                                `._________`-.   `.   `.___\n  //                                              SSt  `------'`\n\n  function spaceship(a, b) {\n    var diff = a - b;\n    return (diff > 0) - (diff < 0);\n  }\n  /**\n   @module @ember/utils\n  */\n\n  /**\n   Compares two javascript values and returns:\n  \n    - -1 if the first is smaller than the second,\n    - 0 if both are equal,\n    - 1 if the first is greater than the second.\n  \n    ```javascript\n    import { compare } from '@ember/utils';\n  \n    compare('hello', 'hello');  // 0\n    compare('abc', 'dfg');      // -1\n    compare(2, 1);              // 1\n    ```\n  \n   If the types of the two objects are different precedence occurs in the\n   following order, with types earlier in the list considered `<` types\n   later in the list:\n  \n    - undefined\n    - null\n    - boolean\n    - number\n    - string\n    - array\n    - object\n    - instance\n    - function\n    - class\n    - date\n  \n    ```javascript\n    import { compare } from '@ember/utils';\n  \n    compare('hello', 50);       // 1\n    compare(50, 'hello');       // -1\n    ```\n  \n   @method compare\n   @for @ember/utils\n   @static\n   @param {Object} v First value to compare\n   @param {Object} w Second value to compare\n   @return {Number} -1 if v < w, 0 if v = w and 1 if v > w.\n   @public\n  */\n\n\n  function compare(v, w) {\n    if (v === w) {\n      return 0;\n    }\n\n    var type1 = (0, _typeOf.typeOf)(v);\n    var type2 = (0, _typeOf.typeOf)(w);\n\n    if (type1 === 'instance' && _comparable.default.detect(v) && v.constructor.compare) {\n      return v.constructor.compare(v, w);\n    }\n\n    if (type2 === 'instance' && _comparable.default.detect(w) && w.constructor.compare) {\n      return w.constructor.compare(w, v) * -1;\n    }\n\n    var res = spaceship(TYPE_ORDER[type1], TYPE_ORDER[type2]);\n\n    if (res !== 0) {\n      return res;\n    } // types are equal - so we have to check values now\n\n\n    switch (type1) {\n      case 'boolean':\n      case 'number':\n        return spaceship(v, w);\n\n      case 'string':\n        return spaceship(v.localeCompare(w), 0);\n\n      case 'array':\n        {\n          var vLen = v.length;\n          var wLen = w.length;\n          var len = Math.min(vLen, wLen);\n\n          for (var i = 0; i < len; i++) {\n            var r = compare(v[i], w[i]);\n\n            if (r !== 0) {\n              return r;\n            }\n          } // all elements are equal now\n          // shorter array should be ordered first\n\n\n          return spaceship(vLen, wLen);\n        }\n\n      case 'instance':\n        if (_comparable.default.detect(v)) {\n          return v.compare(v, w);\n        }\n\n        return 0;\n\n      case 'date':\n        return spaceship(v.getTime(), w.getTime());\n\n      default:\n        return 0;\n    }\n  }\n});","define(\"@ember/-internals/runtime/lib/copy\", [\"exports\", \"@ember/debug\", \"@ember/-internals/runtime/lib/system/object\", \"@ember/-internals/runtime/lib/mixins/copyable\"], function (_exports, _debug, _object, _copyable) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = copy;\n\n  /**\n   @module @ember/object\n  */\n  function _copy(obj, deep, seen, copies) {\n    // primitive data types are immutable, just return them.\n    if (typeof obj !== 'object' || obj === null) {\n      return obj;\n    }\n\n    var ret, loc; // avoid cyclical loops\n\n    if (deep && (loc = seen.indexOf(obj)) >= 0) {\n      return copies[loc];\n    }\n\n    if (deep) {\n      seen.push(obj);\n    } // IMPORTANT: this specific test will detect a native array only. Any other\n    // object will need to implement Copyable.\n\n\n    if (Array.isArray(obj)) {\n      ret = obj.slice();\n\n      if (deep) {\n        copies.push(ret);\n        loc = ret.length;\n\n        while (--loc >= 0) {\n          ret[loc] = _copy(ret[loc], deep, seen, copies);\n        }\n      }\n    } else if (_copyable.default.detect(obj)) {\n      ret = obj.copy(deep, seen, copies);\n\n      if (deep) {\n        copies.push(ret);\n      }\n    } else if (obj instanceof Date) {\n      ret = new Date(obj.getTime());\n\n      if (deep) {\n        copies.push(ret);\n      }\n    } else {\n      (true && !(!(obj instanceof _object.default) || _copyable.default.detect(obj)) && (0, _debug.assert)('Cannot clone an EmberObject that does not implement Copyable', !(obj instanceof _object.default) || _copyable.default.detect(obj)));\n      ret = {};\n\n      if (deep) {\n        copies.push(ret);\n      }\n\n      var key;\n\n      for (key in obj) {\n        // support Null prototype\n        if (!Object.prototype.hasOwnProperty.call(obj, key)) {\n          continue;\n        } // Prevents browsers that don't respect non-enumerability from\n        // copying internal Ember properties\n\n\n        if (key.substring(0, 2) === '__') {\n          continue;\n        }\n\n        ret[key] = deep ? _copy(obj[key], deep, seen, copies) : obj[key];\n      }\n    }\n\n    return ret;\n  }\n  /**\n    Creates a shallow copy of the passed object. A deep copy of the object is\n    returned if the optional `deep` argument is `true`.\n  \n    If the passed object implements the `Copyable` interface, then this\n    function will delegate to the object's `copy()` method and return the\n    result. See `Copyable` for further details.\n  \n    For primitive values (which are immutable in JavaScript), the passed object\n    is simply returned.\n  \n    @method copy\n    @deprecated Use 'ember-copy' addon instead\n    @static\n    @for @ember/object/internals\n    @param {Object} obj The object to clone\n    @param {Boolean} [deep=false] If true, a deep copy of the object is made.\n    @return {Object} The copied object\n    @public\n  */\n\n\n  function copy(obj, deep) {\n    (true && !(false) && (0, _debug.deprecate)('Use ember-copy addon instead of copy method and Copyable mixin.', false, {\n      id: 'ember-runtime.deprecate-copy-copyable',\n      until: '4.0.0',\n      url: 'https://emberjs.com/deprecations/v3.x/#toc_ember-runtime-deprecate-copy-copyable'\n    })); // fast paths\n\n    if ('object' !== typeof obj || obj === null) {\n      return obj; // can't copy primitives\n    }\n\n    if (!Array.isArray(obj) && _copyable.default.detect(obj)) {\n      return obj.copy(deep);\n    }\n\n    return _copy(obj, deep, deep ? [] : null, deep ? [] : null);\n  }\n});","define(\"@ember/-internals/runtime/lib/ext/function\", [\"@ember/-internals/environment\", \"@ember/-internals/metal\", \"@ember/debug\", \"@ember/deprecated-features\"], function (_environment, _metal, _debug, _deprecatedFeatures) {\n  \"use strict\";\n\n  /**\n  @module ember\n  */\n  if (_deprecatedFeatures.FUNCTION_PROTOTYPE_EXTENSIONS && _environment.ENV.EXTEND_PROTOTYPES.Function) {\n    Object.defineProperties(Function.prototype, {\n      /**\n        The `property` extension of Javascript's Function prototype is available\n        when `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is\n        `true`, which is the default.\n         Computed properties allow you to treat a function like a property:\n         ```app/utils/president.js\n        import EmberObject from '@ember/object';\n         export default EmberObject.extend({\n          firstName: '',\n          lastName:  '',\n           fullName: function() {\n            return this.get('firstName') + ' ' + this.get('lastName');\n          }.property() // Call this flag to mark the function as a property\n        });\n        ```\n         ```javascript\n        let president = President.create({\n          firstName: 'Barack',\n          lastName: 'Obama'\n        });\n         president.get('fullName'); // 'Barack Obama'\n        ```\n         Treating a function like a property is useful because they can work with\n        bindings, just like any other property.\n         Many computed properties have dependencies on other properties. For\n        example, in the above example, the `fullName` property depends on\n        `firstName` and `lastName` to determine its value. You can tell Ember\n        about these dependencies like this:\n         ```app/utils/president.js\n        import EmberObject from '@ember/object';\n         export default EmberObject.extend({\n          firstName: '',\n          lastName:  '',\n           fullName: function() {\n            return this.get('firstName') + ' ' + this.get('lastName');\n             // Tell Ember.js that this computed property depends on firstName\n            // and lastName\n          }.property('firstName', 'lastName')\n        });\n        ```\n         Make sure you list these dependencies so Ember knows when to update\n        bindings that connect to a computed property. Changing a dependency\n        will not immediately trigger an update of the computed property, but\n        will instead clear the cache so that it is updated when the next `get`\n        is called on the property.\n         See [ComputedProperty](/ember/release/classes/ComputedProperty), [@ember/object/computed](/ember/release/classes/@ember%2Fobject%2Fcomputed).\n         @method property\n        @for Function\n        @public\n      */\n      property: {\n        configurable: true,\n        enumerable: false,\n        writable: true,\n        value: function () {\n          (true && !(false) && (0, _debug.deprecate)(\"Function prototype extensions have been deprecated, please migrate from function(){}.property('bar') to computed('bar', function() {}).\", false, {\n            id: 'function-prototype-extensions.property',\n            until: '4.0.0',\n            url: 'https://deprecations.emberjs.com/v3.x#toc_function-prototype-extensions-property'\n          }));\n          return (0, _metal.computed)(...arguments, this);\n        }\n      },\n\n      /**\n        The `observes` extension of Javascript's Function prototype is available\n        when `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is\n        true, which is the default.\n         You can observe property changes simply by adding the `observes`\n        call to the end of your method declarations in classes that you write.\n        For example:\n         ```javascript\n        import EmberObject from '@ember/object';\n         EmberObject.extend({\n          valueObserver: function() {\n            // Executes whenever the \"value\" property changes\n          }.observes('value')\n        });\n        ```\n         In the future this method may become asynchronous.\n         See `observer`.\n         @method observes\n        @for Function\n        @public\n      */\n      observes: {\n        configurable: true,\n        enumerable: false,\n        writable: true,\n        value: function () {\n          (true && !(false) && (0, _debug.deprecate)(\"Function prototype extensions have been deprecated, please migrate from function(){}.observes('foo') to observer('foo', function() {}).\", false, {\n            id: 'function-prototype-extensions.observes',\n            until: '4.0.0',\n            url: 'https://deprecations.emberjs.com/v3.x#toc_function-prototype-extensions-observes'\n          }));\n          return (0, _metal.observer)(...arguments, this);\n        }\n      },\n\n      /**\n        The `on` extension of Javascript's Function prototype is available\n        when `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is\n        true, which is the default.\n         You can listen for events simply by adding the `on` call to the end of\n        your method declarations in classes or mixins that you write. For example:\n         ```javascript\n        import Mixin from '@ember/mixin';\n         Mixin.create({\n          doSomethingWithElement: function() {\n            // Executes whenever the \"didInsertElement\" event fires\n          }.on('didInsertElement')\n        });\n        ```\n         See `@ember/object/evented/on`.\n         @method on\n        @for Function\n        @public\n      */\n      on: {\n        configurable: true,\n        enumerable: false,\n        writable: true,\n        value: function () {\n          (true && !(false) && (0, _debug.deprecate)(\"Function prototype extensions have been deprecated, please migrate from function(){}.on('foo') to on('foo', function() {}).\", false, {\n            id: 'function-prototype-extensions.on',\n            until: '4.0.0',\n            url: 'https://deprecations.emberjs.com/v3.x#toc_function-prototype-extensions-on'\n          }));\n          return (0, _metal.on)(...arguments, this);\n        }\n      }\n    });\n  }\n});","define(\"@ember/-internals/runtime/lib/ext/rsvp\", [\"exports\", \"rsvp\", \"@ember/runloop\", \"@ember/-internals/error-handling\", \"@ember/debug\"], function (_exports, RSVP, _runloop, _errorHandling, _debug) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.onerrorDefault = onerrorDefault;\n  _exports.default = void 0;\n  RSVP.configure('async', (callback, promise) => {\n    _runloop.backburner.schedule('actions', null, callback, promise);\n  });\n  RSVP.configure('after', cb => {\n    _runloop.backburner.schedule(_runloop._rsvpErrorQueue, null, cb);\n  });\n  RSVP.on('error', onerrorDefault);\n\n  function onerrorDefault(reason) {\n    var error = errorFor(reason);\n\n    if (error) {\n      var overrideDispatch = (0, _errorHandling.getDispatchOverride)();\n\n      if (overrideDispatch) {\n        overrideDispatch(error);\n      } else {\n        throw error;\n      }\n    }\n  }\n\n  function errorFor(reason) {\n    if (!reason) return;\n\n    if (reason.errorThrown) {\n      return unwrapErrorThrown(reason);\n    }\n\n    if (reason.name === 'UnrecognizedURLError') {\n      (true && !(false) && (0, _debug.assert)(\"The URL '\" + reason.message + \"' did not match any routes in your application\", false));\n      return;\n    }\n\n    if (reason.name === 'TransitionAborted') {\n      return;\n    }\n\n    return reason;\n  }\n\n  function unwrapErrorThrown(reason) {\n    var error = reason.errorThrown;\n\n    if (typeof error === 'string') {\n      error = new Error(error);\n    }\n\n    Object.defineProperty(error, '__reason_with_error_thrown__', {\n      value: reason,\n      enumerable: false\n    });\n    return error;\n  }\n\n  var _default = RSVP;\n  _exports.default = _default;\n});","define(\"@ember/-internals/runtime/lib/is-equal\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = isEqual;\n\n  /**\n   @module @ember/utils\n  */\n\n  /**\n    Compares two objects, returning true if they are equal.\n  \n    ```javascript\n    import { isEqual } from '@ember/utils';\n  \n    isEqual('hello', 'hello');                   // true\n    isEqual(1, 2);                               // false\n    ```\n  \n    `isEqual` is a more specific comparison than a triple equal comparison.\n    It will call the `isEqual` instance method on the objects being\n    compared, allowing finer control over when objects should be considered\n    equal to each other.\n  \n    ```javascript\n    import { isEqual } from '@ember/utils';\n    import EmberObject from '@ember/object';\n  \n    let Person = EmberObject.extend({\n      isEqual(other) { return this.ssn == other.ssn; }\n    });\n  \n    let personA = Person.create({name: 'Muhammad Ali', ssn: '123-45-6789'});\n    let personB = Person.create({name: 'Cassius Clay', ssn: '123-45-6789'});\n  \n    isEqual(personA, personB); // true\n    ```\n  \n    Due to the expense of array comparisons, collections will never be equal to\n    each other even if each of their items are equal to each other.\n  \n    ```javascript\n    import { isEqual } from '@ember/utils';\n  \n    isEqual([4, 2], [4, 2]);                     // false\n    ```\n  \n    @method isEqual\n    @for @ember/utils\n    @static\n    @param {Object} a first object to compare\n    @param {Object} b second object to compare\n    @return {Boolean}\n    @public\n  */\n  function isEqual(a, b) {\n    if (a && typeof a.isEqual === 'function') {\n      return a.isEqual(b);\n    }\n\n    if (a instanceof Date && b instanceof Date) {\n      return a.getTime() === b.getTime();\n    }\n\n    return a === b;\n  }\n});","define(\"@ember/-internals/runtime/lib/mixins/-proxy\", [\"exports\", \"@ember/-internals/meta\", \"@ember/-internals/metal\", \"@ember/-internals/utils\", \"@ember/debug\", \"@glimmer/reference\"], function (_exports, _meta, _metal, _utils, _debug, _reference) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.contentFor = contentFor;\n  _exports.default = void 0;\n\n  /**\n  @module ember\n  */\n  function contentFor(proxy, m) {\n    var content = (0, _metal.get)(proxy, 'content');\n    var tag = (m === undefined ? (0, _meta.meta)(proxy) : m).readableTag();\n\n    if (tag !== undefined) {\n      (0, _reference.update)(tag, (0, _metal.tagFor)(content));\n    }\n\n    return content;\n  }\n  /**\n    `Ember.ProxyMixin` forwards all properties not defined by the proxy itself\n    to a proxied `content` object.  See ObjectProxy for more details.\n  \n    @class ProxyMixin\n    @namespace Ember\n    @private\n  */\n\n\n  var _default = _metal.Mixin.create({\n    /**\n      The object whose properties will be forwarded.\n       @property content\n      @type {unknown}\n      @default null\n      @public\n    */\n    content: null,\n\n    init() {\n      this._super(...arguments);\n\n      (0, _utils.setProxy)(this);\n      var m = (0, _meta.meta)(this);\n      m.writableTag();\n    },\n\n    willDestroy() {\n      this.set('content', null);\n\n      this._super(...arguments);\n    },\n\n    isTruthy: (0, _metal.computed)('content', function () {\n      return Boolean((0, _metal.get)(this, 'content'));\n    }),\n\n    willWatchProperty(key) {\n      if (!true\n      /* EMBER_METAL_TRACKED_PROPERTIES */\n      ) {\n          var contentKey = \"content.\" + key;\n          (0, _metal.addObserver)(this, contentKey, null, '_contentPropertyDidChange');\n        }\n    },\n\n    didUnwatchProperty(key) {\n      if (!true\n      /* EMBER_METAL_TRACKED_PROPERTIES */\n      ) {\n          var contentKey = \"content.\" + key;\n          (0, _metal.removeObserver)(this, contentKey, null, '_contentPropertyDidChange');\n        }\n    },\n\n    _contentPropertyDidChange(content, contentKey) {\n      var key = contentKey.slice(8); // remove \"content.\"\n\n      if (key in this) {\n        return;\n      } // if shadowed in proxy\n\n\n      (0, _metal.notifyPropertyChange)(this, key);\n    },\n\n    [_metal.UNKNOWN_PROPERTY_TAG](key) {\n      return (0, _reference.combine)((0, _metal.getChainTagsForKey)(this, \"content.\" + key));\n    },\n\n    unknownProperty(key) {\n      var content = contentFor(this);\n\n      if (content) {\n        return (0, _metal.get)(content, key);\n      }\n    },\n\n    setUnknownProperty(key, value) {\n      var m = (0, _meta.meta)(this);\n\n      if (m.isInitializing() || m.isPrototypeMeta(this)) {\n        // if marked as prototype or object is initializing then just\n        // defineProperty rather than delegate\n        (0, _metal.defineProperty)(this, key, null, value);\n        return value;\n      }\n\n      var content = contentFor(this, m);\n      (true && !(content) && (0, _debug.assert)(\"Cannot delegate set('\" + key + \"', \" + value + \") to the 'content' property of object proxy \" + this + \": its 'content' is undefined.\", content));\n      return (0, _metal.set)(content, key, value);\n    }\n\n  });\n\n  _exports.default = _default;\n});","define(\"@ember/-internals/runtime/lib/mixins/action_handler\", [\"exports\", \"@ember/-internals/metal\", \"@ember/debug\"], function (_exports, _metal, _debug) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n  @module ember\n  */\n\n  /**\n    `Ember.ActionHandler` is available on some familiar classes including\n    `Route`, `Component`, and `Controller`.\n    (Internally the mixin is used by `Ember.CoreView`, `Ember.ControllerMixin`,\n    and `Route` and available to the above classes through\n    inheritance.)\n  \n    @class ActionHandler\n    @namespace Ember\n    @private\n  */\n  var ActionHandler = _metal.Mixin.create({\n    mergedProperties: ['actions'],\n\n    /**\n      The collection of functions, keyed by name, available on this\n      `ActionHandler` as action targets.\n       These functions will be invoked when a matching `{{action}}` is triggered\n      from within a template and the application's current route is this route.\n       Actions can also be invoked from other parts of your application\n      via `ActionHandler#send`.\n       The `actions` hash will inherit action handlers from\n      the `actions` hash defined on extended parent classes\n      or mixins rather than just replace the entire hash, e.g.:\n       ```app/mixins/can-display-banner.js\n      import Mixin from '@ember/mixin';\n       export default Mixin.create({\n        actions: {\n          displayBanner(msg) {\n            // ...\n          }\n        }\n      });\n      ```\n       ```app/routes/welcome.js\n      import Route from '@ember/routing/route';\n      import CanDisplayBanner from '../mixins/can-display-banner';\n       export default Route.extend(CanDisplayBanner, {\n        actions: {\n          playMusic() {\n            // ...\n          }\n        }\n      });\n       // `WelcomeRoute`, when active, will be able to respond\n      // to both actions, since the actions hash is merged rather\n      // then replaced when extending mixins / parent classes.\n      this.send('displayBanner');\n      this.send('playMusic');\n      ```\n       Within a Controller, Route or Component's action handler,\n      the value of the `this` context is the Controller, Route or\n      Component object:\n       ```app/routes/song.js\n      import Route from '@ember/routing/route';\n       export default Route.extend({\n        actions: {\n          myAction() {\n            this.controllerFor(\"song\");\n            this.transitionTo(\"other.route\");\n            ...\n          }\n        }\n      });\n      ```\n       It is also possible to call `this._super(...arguments)` from within an\n      action handler if it overrides a handler defined on a parent\n      class or mixin:\n       Take for example the following routes:\n       ```app/mixins/debug-route.js\n      import Mixin from '@ember/mixin';\n       export default Mixin.create({\n        actions: {\n          debugRouteInformation() {\n            console.debug(\"It's a-me, console.debug!\");\n          }\n        }\n      });\n      ```\n       ```app/routes/annoying-debug.js\n      import Route from '@ember/routing/route';\n      import DebugRoute from '../mixins/debug-route';\n       export default Route.extend(DebugRoute, {\n        actions: {\n          debugRouteInformation() {\n            // also call the debugRouteInformation of mixed in DebugRoute\n            this._super(...arguments);\n             // show additional annoyance\n            window.alert(...);\n          }\n        }\n      });\n      ```\n       ## Bubbling\n       By default, an action will stop bubbling once a handler defined\n      on the `actions` hash handles it. To continue bubbling the action,\n      you must return `true` from the handler:\n       ```app/router.js\n      Router.map(function() {\n        this.route(\"album\", function() {\n          this.route(\"song\");\n        });\n      });\n      ```\n       ```app/routes/album.js\n      import Route from '@ember/routing/route';\n       export default Route.extend({\n        actions: {\n          startPlaying: function() {\n          }\n        }\n      });\n      ```\n       ```app/routes/album-song.js\n      import Route from '@ember/routing/route';\n       export default Route.extend({\n        actions: {\n          startPlaying() {\n            // ...\n             if (actionShouldAlsoBeTriggeredOnParentRoute) {\n              return true;\n            }\n          }\n        }\n      });\n      ```\n       @property actions\n      @type Object\n      @default null\n      @public\n    */\n\n    /**\n      Triggers a named action on the `ActionHandler`. Any parameters\n      supplied after the `actionName` string will be passed as arguments\n      to the action target function.\n       If the `ActionHandler` has its `target` property set, actions may\n      bubble to the `target`. Bubbling happens when an `actionName` can\n      not be found in the `ActionHandler`'s `actions` hash or if the\n      action target function returns `true`.\n       Example\n       ```app/routes/welcome.js\n      import Route from '@ember/routing/route';\n       export default Route.extend({\n        actions: {\n          playTheme() {\n            this.send('playMusic', 'theme.mp3');\n          },\n          playMusic(track) {\n            // ...\n          }\n        }\n      });\n      ```\n       @method send\n      @param {String} actionName The action to trigger\n      @param {*} context a context to send with the action\n      @public\n    */\n    send(actionName, ...args) {\n      (true && !(!this.isDestroying && !this.isDestroyed) && (0, _debug.assert)(\"Attempted to call .send() with the action '\" + actionName + \"' on the destroyed object '\" + this + \"'.\", !this.isDestroying && !this.isDestroyed));\n\n      if (this.actions && this.actions[actionName]) {\n        var shouldBubble = this.actions[actionName].apply(this, args) === true;\n\n        if (!shouldBubble) {\n          return;\n        }\n      }\n\n      var target = (0, _metal.get)(this, 'target');\n\n      if (target) {\n        (true && !(typeof target.send === 'function') && (0, _debug.assert)(\"The `target` for \" + this + \" (\" + target + \") does not have a `send` method\", typeof target.send === 'function'));\n        target.send(...arguments);\n      }\n    }\n\n  });\n\n  var _default = ActionHandler;\n  _exports.default = _default;\n});","define(\"@ember/-internals/runtime/lib/mixins/array\", [\"exports\", \"@ember/-internals/metal\", \"@ember/-internals/utils\", \"@ember/debug\", \"@ember/-internals/runtime/lib/mixins/enumerable\", \"@ember/-internals/runtime/lib/compare\", \"@ember/-internals/environment\", \"@ember/-internals/runtime/lib/mixins/observable\", \"@ember/-internals/runtime/lib/mixins/mutable_enumerable\", \"@ember/-internals/runtime/lib/type-of\"], function (_exports, _metal, _utils, _debug, _enumerable, _compare, _environment, _observable, _mutable_enumerable, _typeOf) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.uniqBy = uniqBy;\n  _exports.removeAt = removeAt;\n  _exports.isArray = isArray;\n  _exports.default = _exports.MutableArray = _exports.NativeArray = _exports.A = void 0;\n\n  /**\n  @module @ember/array\n  */\n  var EMPTY_ARRAY = Object.freeze([]);\n\n  var identityFunction = item => item;\n\n  function uniqBy(array, key = identityFunction) {\n    (true && !(isArray(array)) && (0, _debug.assert)(\"first argument passed to `uniqBy` should be array\", isArray(array)));\n    var ret = A();\n    var seen = new Set();\n    var getter = typeof key === 'function' ? key : item => (0, _metal.get)(item, key);\n    array.forEach(item => {\n      var val = getter(item);\n\n      if (!seen.has(val)) {\n        seen.add(val);\n        ret.push(item);\n      }\n    });\n    return ret;\n  }\n\n  function iter(key, value) {\n    var valueProvided = arguments.length === 2;\n    return valueProvided ? item => value === (0, _metal.get)(item, key) : item => Boolean((0, _metal.get)(item, key));\n  }\n\n  function findIndex(array, predicate, startAt) {\n    var len = array.length;\n\n    for (var index = startAt; index < len; index++) {\n      var item = (0, _metal.objectAt)(array, index);\n\n      if (predicate(item, index, array)) {\n        return index;\n      }\n    }\n\n    return -1;\n  }\n\n  function find(array, callback, target) {\n    var predicate = callback.bind(target);\n    var index = findIndex(array, predicate, 0);\n    return index === -1 ? undefined : (0, _metal.objectAt)(array, index);\n  }\n\n  function any(array, callback, target) {\n    var predicate = callback.bind(target);\n    return findIndex(array, predicate, 0) !== -1;\n  }\n\n  function every(array, callback, target) {\n    var cb = callback.bind(target);\n\n    var predicate = (item, index, array) => !cb(item, index, array);\n\n    return findIndex(array, predicate, 0) === -1;\n  }\n\n  function indexOf(array, val, startAt = 0, withNaNCheck) {\n    var len = array.length;\n\n    if (startAt < 0) {\n      startAt += len;\n    } // SameValueZero comparison (NaN !== NaN)\n\n\n    var predicate = withNaNCheck && val !== val ? item => item !== item : item => item === val;\n    return findIndex(array, predicate, startAt);\n  }\n\n  function removeAt(array, index, len = 1) {\n    (true && !(index > -1 && index < array.length) && (0, _debug.assert)(\"`removeAt` index provided is out of range\", index > -1 && index < array.length));\n    (0, _metal.replace)(array, index, len, EMPTY_ARRAY);\n    return array;\n  }\n\n  function insertAt(array, index, item) {\n    (true && !(index > -1 && index <= array.length) && (0, _debug.assert)(\"`insertAt` index provided is out of range\", index > -1 && index <= array.length));\n    (0, _metal.replace)(array, index, 0, [item]);\n    return item;\n  }\n  /**\n    Returns true if the passed object is an array or Array-like.\n  \n    Objects are considered Array-like if any of the following are true:\n  \n      - the object is a native Array\n      - the object has an objectAt property\n      - the object is an Object, and has a length property\n  \n    Unlike `typeOf` this method returns true even if the passed object is\n    not formally an array but appears to be array-like (i.e. implements `Array`)\n  \n    ```javascript\n    import { isArray } from '@ember/array';\n    import ArrayProxy from '@ember/array/proxy';\n  \n    isArray();                                      // false\n    isArray([]);                                    // true\n    isArray(ArrayProxy.create({ content: [] }));    // true\n    ```\n  \n    @method isArray\n    @static\n    @for @ember/array\n    @param {Object} obj The object to test\n    @return {Boolean} true if the passed object is an array or Array-like\n    @public\n  */\n\n\n  function isArray(_obj) {\n    var obj = _obj;\n\n    if (true\n    /* DEBUG */\n    && _utils.HAS_NATIVE_PROXY && typeof _obj === 'object' && _obj !== null) {\n      var possibleProxyContent = _obj[_metal.PROXY_CONTENT];\n\n      if (possibleProxyContent !== undefined) {\n        obj = possibleProxyContent;\n      }\n    }\n\n    if (!obj || obj.setInterval) {\n      return false;\n    }\n\n    if (Array.isArray(obj) || ArrayMixin.detect(obj)) {\n      return true;\n    }\n\n    var type = (0, _typeOf.typeOf)(obj);\n\n    if ('array' === type) {\n      return true;\n    }\n\n    var length = obj.length;\n\n    if (typeof length === 'number' && length === length && 'object' === type) {\n      return true;\n    }\n\n    return false;\n  }\n  /*\n    This allows us to define computed properties that are not enumerable.\n    The primary reason this is important is that when `NativeArray` is\n    applied to `Array.prototype` we need to ensure that we do not add _any_\n    new enumerable properties.\n  */\n\n\n  function nonEnumerableComputed() {\n    var property = (0, _metal.computed)(...arguments);\n    property.enumerable = false;\n    return property;\n  }\n\n  function mapBy(key) {\n    return this.map(next => (0, _metal.get)(next, key));\n  } // ..........................................................\n  // ARRAY\n  //\n\n  /**\n    This mixin implements Observer-friendly Array-like behavior. It is not a\n    concrete implementation, but it can be used up by other classes that want\n    to appear like arrays.\n  \n    For example, ArrayProxy is a concrete class that can be instantiated to\n    implement array-like behavior. This class uses the Array Mixin by way of\n    the MutableArray mixin, which allows observable changes to be made to the\n    underlying array.\n  \n    This mixin defines methods specifically for collections that provide\n    index-ordered access to their contents. When you are designing code that\n    needs to accept any kind of Array-like object, you should use these methods\n    instead of Array primitives because these will properly notify observers of\n    changes to the array.\n  \n    Although these methods are efficient, they do add a layer of indirection to\n    your application so it is a good idea to use them only when you need the\n    flexibility of using both true JavaScript arrays and \"virtual\" arrays such\n    as controllers and collections.\n  \n    You can use the methods defined in this module to access and modify array\n    contents in an observable-friendly way. You can also be notified whenever\n    the membership of an array changes by using `.observes('myArray.[]')`.\n  \n    To support `EmberArray` in your own class, you must override two\n    primitives to use it: `length()` and `objectAt()`.\n  \n    @class EmberArray\n    @uses Enumerable\n    @since Ember 0.9.0\n    @public\n  */\n\n\n  var ArrayMixin = _metal.Mixin.create(_enumerable.default, {\n    [_utils.EMBER_ARRAY]: true,\n\n    /**\n      __Required.__ You must implement this method to apply this mixin.\n       Your array must support the `length` property. Your replace methods should\n      set this property whenever it changes.\n       @property {Number} length\n      @public\n    */\n\n    /**\n      Returns the object at the given `index`. If the given `index` is negative\n      or is greater or equal than the array length, returns `undefined`.\n       This is one of the primitives you must implement to support `EmberArray`.\n      If your object supports retrieving the value of an array item using `get()`\n      (i.e. `myArray.get(0)`), then you do not need to implement this method\n      yourself.\n       ```javascript\n      let arr = ['a', 'b', 'c', 'd'];\n       arr.objectAt(0);   // 'a'\n      arr.objectAt(3);   // 'd'\n      arr.objectAt(-1);  // undefined\n      arr.objectAt(4);   // undefined\n      arr.objectAt(5);   // undefined\n      ```\n       @method objectAt\n      @param {Number} idx The index of the item to return.\n      @return {*} item at index or undefined\n      @public\n    */\n\n    /**\n      This returns the objects at the specified indexes, using `objectAt`.\n       ```javascript\n      let arr = ['a', 'b', 'c', 'd'];\n       arr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\n      arr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]\n      ```\n       @method objectsAt\n      @param {Array} indexes An array of indexes of items to return.\n      @return {Array}\n      @public\n     */\n    objectsAt(indexes) {\n      return indexes.map(idx => (0, _metal.objectAt)(this, idx));\n    },\n\n    /**\n      This is the handler for the special array content property. If you get\n      this property, it will return this. If you set this property to a new\n      array, it will replace the current content.\n       ```javascript\n      let peopleToMoon = ['Armstrong', 'Aldrin'];\n       peopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n       peopleToMoon.set('[]', ['Collins']); // ['Collins']\n      peopleToMoon.get('[]'); // ['Collins']\n      ```\n       @property []\n      @return this\n      @public\n    */\n    '[]': nonEnumerableComputed({\n      get() {\n        return this;\n      },\n\n      set(key, value) {\n        this.replace(0, this.length, value);\n        return this;\n      }\n\n    }),\n\n    /**\n      The first object in the array, or `undefined` if the array is empty.\n       ```javascript\n      let vowels = ['a', 'e', 'i', 'o', 'u'];\n      vowels.firstObject; // 'a'\n       vowels.shiftObject();\n      vowels.firstObject; // 'e'\n       vowels.reverseObjects();\n      vowels.firstObject; // 'u'\n       vowels.clear();\n      vowels.firstObject; // undefined\n      ```\n       @property firstObject\n      @return {Object | undefined} The first object in the array\n      @public\n    */\n    firstObject: nonEnumerableComputed(function () {\n      return (0, _metal.objectAt)(this, 0);\n    }).readOnly(),\n\n    /**\n      The last object in the array, or `undefined` if the array is empty.\n       @property lastObject\n      @return {Object | undefined} The last object in the array\n      @public\n    */\n    lastObject: nonEnumerableComputed(function () {\n      return (0, _metal.objectAt)(this, this.length - 1);\n    }).readOnly(),\n\n    // Add any extra methods to EmberArray that are native to the built-in Array.\n\n    /**\n      Returns a new array that is a slice of the receiver. This implementation\n      uses the observable array methods to retrieve the objects for the new\n      slice.\n       ```javascript\n      let arr = ['red', 'green', 'blue'];\n       arr.slice(0);       // ['red', 'green', 'blue']\n      arr.slice(0, 2);    // ['red', 'green']\n      arr.slice(1, 100);  // ['green', 'blue']\n      ```\n       @method slice\n      @param {Number} beginIndex (Optional) index to begin slicing from.\n      @param {Number} endIndex (Optional) index to end the slice at (but not included).\n      @return {Array} New array with specified slice\n      @public\n    */\n    slice(beginIndex = 0, endIndex) {\n      var ret = A();\n      var length = this.length;\n\n      if (beginIndex < 0) {\n        beginIndex = length + beginIndex;\n      }\n\n      if (endIndex === undefined || endIndex > length) {\n        endIndex = length;\n      } else if (endIndex < 0) {\n        endIndex = length + endIndex;\n      }\n\n      while (beginIndex < endIndex) {\n        ret[ret.length] = (0, _metal.objectAt)(this, beginIndex++);\n      }\n\n      return ret;\n    },\n\n    /**\n      Used to determine the passed object's first occurence in the array.\n      Returns the index if found, -1 if no match is found.\n       The optional `startAt` argument can be used to pass a starting\n      index to search from, effectively slicing the searchable portion\n      of the array. If it's negative it will add the array length to\n      the startAt value passed in as the index to search from. If less\n      than or equal to `-1 * array.length` the entire array is searched.\n       ```javascript\n      let arr = ['a', 'b', 'c', 'd', 'a'];\n       arr.indexOf('a');       //  0\n      arr.indexOf('z');       // -1\n      arr.indexOf('a', 2);    //  4\n      arr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\n      arr.indexOf('a', -100); //  0, searches entire array\n      arr.indexOf('b', 3);    // -1\n      arr.indexOf('a', 100);  // -1\n       let people = [{ name: 'Zoey' }, { name: 'Bob' }]\n      let newPerson = { name: 'Tom' };\n      people = [newPerson, ...people, newPerson];\n       people.indexOf(newPerson);     //  0\n      people.indexOf(newPerson, 1);  //  3\n      people.indexOf(newPerson, -4); //  0\n      people.indexOf(newPerson, 10); // -1\n      ```\n       @method indexOf\n      @param {Object} object the item to search for\n      @param {Number} startAt optional starting location to search, default 0\n      @return {Number} index or -1 if not found\n      @public\n    */\n    indexOf(object, startAt) {\n      return indexOf(this, object, startAt, false);\n    },\n\n    /**\n      Returns the index of the given `object`'s last occurrence.\n       - If no `startAt` argument is given, the search starts from\n      the last position.\n      - If it's greater than or equal to the length of the array,\n      the search starts from the last position.\n      - If it's negative, it is taken as the offset from the end\n      of the array i.e. `startAt + array.length`.\n      - If it's any other positive number, will search backwards\n      from that index of the array.\n       Returns -1 if no match is found.\n       ```javascript\n      let arr = ['a', 'b', 'c', 'd', 'a'];\n       arr.lastIndexOf('a');       //  4\n      arr.lastIndexOf('z');       // -1\n      arr.lastIndexOf('a', 2);    //  0\n      arr.lastIndexOf('a', -1);   //  4\n      arr.lastIndexOf('a', -3);   //  0\n      arr.lastIndexOf('b', 3);    //  1\n      arr.lastIndexOf('a', 100);  //  4\n      ```\n       @method lastIndexOf\n      @param {Object} object the item to search for\n      @param {Number} startAt optional starting location to search from\n      backwards, defaults to `(array.length - 1)`\n      @return {Number} The last index of the `object` in the array or -1\n      if not found\n      @public\n    */\n    lastIndexOf(object, startAt) {\n      var len = this.length;\n\n      if (startAt === undefined || startAt >= len) {\n        startAt = len - 1;\n      }\n\n      if (startAt < 0) {\n        startAt += len;\n      }\n\n      for (var idx = startAt; idx >= 0; idx--) {\n        if ((0, _metal.objectAt)(this, idx) === object) {\n          return idx;\n        }\n      }\n\n      return -1;\n    },\n\n    // ..........................................................\n    // ARRAY OBSERVERS\n    //\n\n    /**\n      Adds an array observer to the receiving array. The array observer object\n      normally must implement two methods:\n       * `willChange(observedObj, start, removeCount, addCount)` - This method will be\n        called just before the array is modified.\n      * `didChange(observedObj, start, removeCount, addCount)` - This method will be\n        called just after the array is modified.\n       Both callbacks will be passed the observed object, starting index of the\n      change as well as a count of the items to be removed and added. You can use\n      these callbacks to optionally inspect the array during the change, clear\n      caches, or do any other bookkeeping necessary.\n       In addition to passing a target, you can also include an options hash\n      which you can use to override the method names that will be invoked on the\n      target.\n       @method addArrayObserver\n      @param {Object} target The observer object.\n      @param {Object} opts Optional hash of configuration options including\n        `willChange` and `didChange` option.\n      @return {EmberArray} receiver\n      @public\n      @example\n          import Service from '@ember/service';\n           export default Service.extend({\n            data: Ember.A(),\n             init() {\n              this._super(...arguments);\n               this.data.addArrayObserver(this, {\n                willChange: 'dataWillChange',\n                didChange: 'dataDidChange'\n              });\n            },\n             dataWillChange(array, start, removeCount, addCount) {\n              console.log('array will change', array, start, removeCount, addCount);\n            },\n             dataDidChange(array, start, removeCount, addCount) {\n              console.log('array did change', array, start, removeCount, addCount);\n            }\n          });\n    */\n    addArrayObserver(target, opts) {\n      return (0, _metal.addArrayObserver)(this, target, opts);\n    },\n\n    /**\n      Removes an array observer from the object if the observer is current\n      registered. Calling this method multiple times with the same object will\n      have no effect.\n       @method removeArrayObserver\n      @param {Object} target The object observing the array.\n      @param {Object} opts Optional hash of configuration options including\n        `willChange` and `didChange` option.\n      @return {EmberArray} receiver\n      @public\n    */\n    removeArrayObserver(target, opts) {\n      return (0, _metal.removeArrayObserver)(this, target, opts);\n    },\n\n    /**\n      Becomes true whenever the array currently has observers watching changes\n      on the array.\n       ```javascript\n      let arr = [1, 2, 3, 4, 5];\n      arr.hasArrayObservers; // false\n       arr.addArrayObserver(this, {\n        willChange() {\n          console.log('willChange');\n        }\n      });\n      arr.hasArrayObservers; // true\n      ```\n       @property {Boolean} hasArrayObservers\n      @public\n    */\n    hasArrayObservers: (0, _metal.nativeDescDecorator)({\n      configurable: true,\n      enumerable: false,\n\n      get() {\n        (0, _metal.hasListeners)(this, '@array:change') || (0, _metal.hasListeners)(this, '@array:before');\n      }\n\n    }),\n\n    /**\n      If you are implementing an object that supports `EmberArray`, call this\n      method just before the array content changes to notify any observers and\n      invalidate any related properties. Pass the starting index of the change\n      as well as a delta of the amounts to change.\n       ```app/components/show-post.js\n      import Component from '@ember/component';\n      import EmberObject from '@ember/object';\n       const Post = EmberObject.extend({\n        body: '',\n        save() {}\n      })\n       export default Component.extend({\n        attemptsToModify: 0,\n        successfulModifications: 0,\n        posts: null,\n         init() {\n          this._super(...arguments);\n           this.posts = [1, 2, 3].map(i => Post.create({ body: i }));\n          this.posts.addArrayObserver(this, {\n            willChange() {\n              this.incrementProperty('attemptsToModify');\n            },\n            didChange() {\n              this.incrementProperty('successfulModifications');\n            }\n          });\n        },\n         actions: {\n          editPost(post, newContent) {\n            let oldContent = post.body,\n                postIndex = this.posts.indexOf(post);\n             this.posts.arrayContentWillChange(postIndex, 0, 0); // attemptsToModify = 1\n            post.set('body', newContent);\n             post.save()\n              .then(response => {\n                this.posts.arrayContentDidChange(postIndex, 0, 0); // successfulModifications = 1\n              })\n              .catch(error => {\n                post.set('body', oldContent);\n              })\n          }\n        }\n      });\n      ```\n       @method arrayContentWillChange\n      @param {Number} startIdx The starting index in the array that will change.\n      @param {Number} removeAmt The number of items that will be removed. If you\n        pass `null` assumes 0\n      @param {Number} addAmt The number of items that will be added. If you\n        pass `null` assumes 0.\n      @return {EmberArray} receiver\n      @public\n    */\n    arrayContentWillChange(startIdx, removeAmt, addAmt) {\n      return (0, _metal.arrayContentWillChange)(this, startIdx, removeAmt, addAmt);\n    },\n\n    /**\n      If you are implementing an object that supports `EmberArray`, call this\n      method just after the array content changes to notify any observers and\n      invalidate any related properties. Pass the starting index of the change\n      as well as a delta of the amounts to change.\n       ```javascript\n      let arr = [1, 2, 3, 4, 5];\n       arr.copyWithin(-2); // [1, 2, 3, 1, 2]\n      // arr.lastObject = 5\n      arr.arrayContentDidChange(3, 2, 2);\n      // arr.lastObject = 2\n      ```\n       @method arrayContentDidChange\n      @param {Number} startIdx The starting index in the array that did change.\n      @param {Number} removeAmt The number of items that were removed. If you\n        pass `null` assumes 0\n      @param {Number} addAmt The number of items that were added. If you\n        pass `null` assumes 0.\n      @return {EmberArray} receiver\n      @public\n    */\n    arrayContentDidChange(startIdx, removeAmt, addAmt) {\n      return (0, _metal.arrayContentDidChange)(this, startIdx, removeAmt, addAmt);\n    },\n\n    /**\n      Iterates through the array, calling the passed function on each\n      item. This method corresponds to the `forEach()` method defined in\n      JavaScript 1.6.\n       The callback method you provide should have the following signature (all\n      parameters are optional):\n       ```javascript\n      function(item, index, array);\n      ```\n       - `item` is the current item in the iteration.\n      - `index` is the current index in the iteration.\n      - `array` is the array itself.\n       Note that in addition to a callback, you can also pass an optional target\n      object that will be set as `this` on the context. This is a good way\n      to give your iterator function access to the current object.\n       Example Usage:\n       ```javascript\n      let foods = [\n        { name: 'apple', eaten: false },\n        { name: 'banana', eaten: false },\n        { name: 'carrot', eaten: false }\n      ];\n       foods.forEach((food) => food.eaten = true);\n       let output = '';\n      foods.forEach((item, index, array) =>\n        output += `${index + 1}/${array.length} ${item.name}\\n`;\n      );\n      console.log(output);\n      // 1/3 apple\n      // 2/3 banana\n      // 3/3 carrot\n      ```\n       @method forEach\n      @param {Function} callback The callback to execute\n      @param {Object} [target] The target object to use\n      @return {Object} receiver\n      @public\n    */\n    forEach(callback, target = null) {\n      (true && !(typeof callback === 'function') && (0, _debug.assert)('`forEach` expects a function as first argument.', typeof callback === 'function'));\n      var length = this.length;\n\n      for (var index = 0; index < length; index++) {\n        var item = this.objectAt(index);\n        callback.call(target, item, index, this);\n      }\n\n      return this;\n    },\n\n    /**\n      Alias for `mapBy`.\n       Returns the value of the named\n      property on all items in the enumeration.\n       ```javascript\n      let people = [{name: 'Joe'}, {name: 'Matt'}];\n       people.getEach('name');\n      // ['Joe', 'Matt'];\n       people.getEach('nonexistentProperty');\n      // [undefined, undefined];\n      ```\n       @method getEach\n      @param {String} key name of the property\n      @return {Array} The mapped array.\n      @public\n    */\n    getEach: mapBy,\n\n    /**\n      Sets the value on the named property for each member. This is more\n      ergonomic than using other methods defined on this helper. If the object\n      implements Observable, the value will be changed to `set(),` otherwise\n      it will be set directly. `null` objects are skipped.\n       ```javascript\n      let people = [{name: 'Joe'}, {name: 'Matt'}];\n       people.setEach('zipCode', '10011);\n      // [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];\n      ```\n       @method setEach\n      @param {String} key The key to set\n      @param {Object} value The object to set\n      @return {Object} receiver\n      @public\n    */\n    setEach(key, value) {\n      return this.forEach(item => (0, _metal.set)(item, key, value));\n    },\n\n    /**\n      Maps all of the items in the enumeration to another value, returning\n      a new array. This method corresponds to `map()` defined in JavaScript 1.6.\n       The callback method you provide should have the following signature (all\n      parameters are optional):\n       ```javascript\n      function(item, index, array);\n      let arr = [1, 2, 3, 4, 5, 6];\n       arr.map(element => element * element);\n      // [1, 4, 9, 16, 25, 36];\n       arr.map((element, index) => element + index);\n      // [1, 3, 5, 7, 9, 11];\n      ```\n       - `item` is the current item in the iteration.\n      - `index` is the current index in the iteration.\n      - `array` is the array itself.\n       It should return the mapped value.\n       Note that in addition to a callback, you can also pass an optional target\n      object that will be set as `this` on the context. This is a good way\n      to give your iterator function access to the current object.\n       @method map\n      @param {Function} callback The callback to execute\n      @param {Object} [target] The target object to use\n      @return {Array} The mapped array.\n      @public\n    */\n    map(callback, target = null) {\n      (true && !(typeof callback === 'function') && (0, _debug.assert)('`map` expects a function as first argument.', typeof callback === 'function'));\n      var ret = A();\n      this.forEach((x, idx, i) => ret[idx] = callback.call(target, x, idx, i));\n      return ret;\n    },\n\n    /**\n      Similar to map, this specialized function returns the value of the named\n      property on all items in the enumeration.\n       ```javascript\n      let people = [{name: 'Joe'}, {name: 'Matt'}];\n       people.mapBy('name');\n      // ['Joe', 'Matt'];\n       people.mapBy('unknownProperty');\n      // [undefined, undefined];\n      ```\n       @method mapBy\n      @param {String} key name of the property\n      @return {Array} The mapped array.\n      @public\n    */\n    mapBy,\n\n    /**\n      Returns a new array with all of the items in the enumeration that the provided\n      callback function returns true for. This method corresponds to [Array.prototype.filter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter).\n       The callback method should have the following signature:\n       ```javascript\n      function(item, index, array);\n      ```\n       - `item` is the current item in the iteration.\n      - `index` is the current index in the iteration.\n      - `array` is the array itself.\n       All parameters are optional. The function should return `true` to include the item\n      in the results, and `false` otherwise.\n       Example:\n       ```javascript\n      function isAdult(person) {\n        return person.age > 18;\n      };\n       let people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n       people.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];\n      ```\n       Note that in addition to a callback, you can pass an optional target object\n      that will be set as `this` on the context. This is a good way to give your\n      iterator function access to the current object.\n       @method filter\n      @param {Function} callback The callback to execute\n      @param {Object} [target] The target object to use\n      @return {Array} A filtered array.\n      @public\n    */\n    filter(callback, target = null) {\n      (true && !(typeof callback === 'function') && (0, _debug.assert)('`filter` expects a function as first argument.', typeof callback === 'function'));\n      var ret = A();\n      this.forEach((x, idx, i) => {\n        if (callback.call(target, x, idx, i)) {\n          ret.push(x);\n        }\n      });\n      return ret;\n    },\n\n    /**\n      Returns an array with all of the items in the enumeration where the passed\n      function returns false. This method is the inverse of filter().\n       The callback method you provide should have the following signature (all\n      parameters are optional):\n       ```javascript\n      function(item, index, array);\n      ```\n       - *item* is the current item in the iteration.\n      - *index* is the current index in the iteration\n      - *array* is the array itself.\n       It should return a falsey value to include the item in the results.\n       Note that in addition to a callback, you can also pass an optional target\n      object that will be set as \"this\" on the context. This is a good way\n      to give your iterator function access to the current object.\n       Example Usage:\n       ```javascript\n      const food = [\n        { food: 'apple', isFruit: true },\n        { food: 'bread', isFruit: false },\n        { food: 'banana', isFruit: true }\n      ];\n      const nonFruits = food.reject(function(thing) {\n        return thing.isFruit;\n      }); // [{food: 'bread', isFruit: false}]\n      ```\n       @method reject\n      @param {Function} callback The callback to execute\n      @param {Object} [target] The target object to use\n      @return {Array} A rejected array.\n      @public\n    */\n    reject(callback, target = null) {\n      (true && !(typeof callback === 'function') && (0, _debug.assert)('`reject` expects a function as first argument.', typeof callback === 'function'));\n      return this.filter(function () {\n        return !callback.apply(target, arguments);\n      });\n    },\n\n    /**\n      Filters the array by the property and an optional value. If a value is given, it returns\n      the items that have said value for the property. If not, it returns all the items that\n      have a truthy value for the property.\n       Example Usage:\n       ```javascript\n      let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n       things.filterBy('food', 'beans'); // [{ food: 'beans' }]\n      things.filterBy('isFruit'); // [{ food: 'apple' }]\n      ```\n       @method filterBy\n      @param {String} key the property to test\n      @param {*} [value] optional value to test against.\n      @return {Array} filtered array\n      @public\n    */\n    filterBy() {\n      return this.filter(iter(...arguments));\n    },\n\n    /**\n      Returns an array with the items that do not have truthy values for the provided key.\n      You can pass an optional second argument with a target value to reject for the key.\n      Otherwise this will reject objects where the provided property evaluates to false.\n       Example Usage:\n       ```javascript\n        let food = [\n          { name: \"apple\", isFruit: true },\n          { name: \"carrot\", isFruit: false },\n          { name: \"bread\", isFruit: false },\n        ];\n        food.rejectBy('isFruit'); // [{ name: \"carrot\", isFruit: false }, { name: \"bread\", isFruit: false }]\n        food.rejectBy('name', 'carrot'); // [{ name: \"apple\", isFruit: true }}, { name: \"bread\", isFruit: false }]\n      ```\n       @method rejectBy\n      @param {String} key the property to test\n      @param {*} [value] optional value to test against.\n      @return {Array} rejected array\n      @public\n    */\n    rejectBy() {\n      return this.reject(iter(...arguments));\n    },\n\n    /**\n      Returns the first item in the array for which the callback returns true.\n      This method is similar to the `find()` method defined in ECMAScript 2015.\n       The callback method you provide should have the following signature (all\n      parameters are optional):\n       ```javascript\n      function(item, index, array);\n      ```\n       - `item` is the current item in the iteration.\n      - `index` is the current index in the iteration.\n      - `array` is the array itself.\n       It should return the `true` to include the item in the results, `false`\n      otherwise.\n       Note that in addition to a callback, you can also pass an optional target\n      object that will be set as `this` on the context. This is a good way\n      to give your iterator function access to the current object.\n       Example Usage:\n       ```javascript\n      let users = [\n        { id: 1, name: 'Yehuda' },\n        { id: 2, name: 'Tom' },\n        { id: 3, name: 'Melanie' },\n        { id: 4, name: 'Leah' }\n      ];\n       users.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\n      users.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]\n      ```\n       @method find\n      @param {Function} callback The callback to execute\n      @param {Object} [target] The target object to use\n      @return {Object} Found item or `undefined`.\n      @public\n    */\n    find(callback, target = null) {\n      (true && !(typeof callback === 'function') && (0, _debug.assert)('`find` expects a function as first argument.', typeof callback === 'function'));\n      return find(this, callback, target);\n    },\n\n    /**\n      Returns the first item with a property matching the passed value. You\n      can pass an optional second argument with the target value. Otherwise\n      this will match any property that evaluates to `true`.\n       This method works much like the more generic `find()` method.\n       Usage Example:\n       ```javascript\n      let users = [\n        { id: 1, name: 'Yehuda', isTom: false },\n        { id: 2, name: 'Tom', isTom: true },\n        { id: 3, name: 'Melanie', isTom: false },\n        { id: 4, name: 'Leah', isTom: false }\n      ];\n       users.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\n      users.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\n      users.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }\n      ```\n       @method findBy\n      @param {String} key the property to test\n      @param {String} [value] optional value to test against.\n      @return {Object} found item or `undefined`\n      @public\n    */\n    findBy() {\n      return find(this, iter(...arguments));\n    },\n\n    /**\n      Returns `true` if the passed function returns true for every item in the\n      enumeration. This corresponds with the `Array.prototype.every()` method defined in ES5.\n       The callback method should have the following signature:\n       ```javascript\n      function(item, index, array);\n      ```\n       - `item` is the current item in the iteration.\n      - `index` is the current index in the iteration.\n      - `array` is the array itself.\n       All params are optional. The method should return `true` or `false`.\n       Note that in addition to a callback, you can also pass an optional target\n      object that will be set as `this` on the context. This is a good way\n      to give your iterator function access to the current object.\n       Usage example:\n       ```javascript\n      function isAdult(person) {\n        return person.age > 18;\n      };\n       const people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\n      const areAllAdults = people.every(isAdult);\n      ```\n       @method every\n      @param {Function} callback The callback to execute\n      @param {Object} [target] The target object to use\n      @return {Boolean}\n      @public\n    */\n    every(callback, target = null) {\n      (true && !(typeof callback === 'function') && (0, _debug.assert)('`every` expects a function as first argument.', typeof callback === 'function'));\n      return every(this, callback, target);\n    },\n\n    /**\n      Returns `true` if the passed property resolves to the value of the second\n      argument for all items in the array. This method is often simpler/faster\n      than using a callback.\n       Note that like the native `Array.every`, `isEvery` will return true when called\n      on any empty array.\n      ```javascript\n      class Language {\n        constructor(name, isProgrammingLanguage) {\n          this.name = name;\n          this.programmingLanguage = isProgrammingLanguage;\n        }\n      }\n       const compiledLanguages = [\n        new Language('Java', true),\n        new Language('Go', true),\n        new Language('Rust', true)\n      ]\n       const languagesKnownByMe = [\n        new Language('Javascript', true),\n        new Language('English', false),\n        new Language('Ruby', true)\n      ]\n       compiledLanguages.isEvery('programmingLanguage'); // true\n      languagesKnownByMe.isEvery('programmingLanguage'); // false\n      ```\n       @method isEvery\n      @param {String} key the property to test\n      @param {String} [value] optional value to test against. Defaults to `true`\n      @return {Boolean}\n      @since 1.3.0\n      @public\n    */\n    isEvery() {\n      return every(this, iter(...arguments));\n    },\n\n    /**\n      The any() method executes the callback function once for each element\n      present in the array until it finds the one where callback returns a truthy\n      value (i.e. `true`). If such an element is found, any() immediately returns\n      true. Otherwise, any() returns false.\n       ```javascript\n      function(item, index, array);\n      ```\n       - `item` is the current item in the iteration.\n      - `index` is the current index in the iteration.\n      - `array` is the array object itself.\n       Note that in addition to a callback, you can also pass an optional target\n      object that will be set as `this` on the context. It can be a good way\n      to give your iterator function access to an object in cases where an ES6\n      arrow function would not be appropriate.\n       Usage Example:\n       ```javascript\n      let includesManager = people.any(this.findPersonInManagersList, this);\n       let includesStockHolder = people.any(person => {\n        return this.findPersonInStockHoldersList(person)\n      });\n       if (includesManager || includesStockHolder) {\n        Paychecks.addBiggerBonus();\n      }\n      ```\n       @method any\n      @param {Function} callback The callback to execute\n      @param {Object} [target] The target object to use\n      @return {Boolean} `true` if the passed function returns `true` for any item\n      @public\n    */\n    any(callback, target = null) {\n      (true && !(typeof callback === 'function') && (0, _debug.assert)('`any` expects a function as first argument.', typeof callback === 'function'));\n      return any(this, callback, target);\n    },\n\n    /**\n      Returns `true` if the passed property resolves to the value of the second\n      argument for any item in the array. This method is often simpler/faster\n      than using a callback.\n       Example usage:\n       ```javascript\n      const food = [\n        { food: 'apple', isFruit: true },\n        { food: 'bread', isFruit: false },\n        { food: 'banana', isFruit: true }\n      ];\n       food.isAny('isFruit'); // true\n      ```\n       @method isAny\n      @param {String} key the property to test\n      @param {String} [value] optional value to test against. Defaults to `true`\n      @return {Boolean}\n      @since 1.3.0\n      @public\n    */\n    isAny() {\n      return any(this, iter(...arguments));\n    },\n\n    /**\n      This will combine the values of the array into a single value. It\n      is a useful way to collect a summary value from an array. This\n      corresponds to the `reduce()` method defined in JavaScript 1.8.\n       The callback method you provide should have the following signature (all\n      parameters are optional):\n       ```javascript\n      function(previousValue, item, index, array);\n      ```\n       - `previousValue` is the value returned by the last call to the iterator.\n      - `item` is the current item in the iteration.\n      - `index` is the current index in the iteration.\n      - `array` is the array itself.\n       Return the new cumulative value.\n       In addition to the callback you can also pass an `initialValue`. An error\n      will be raised if you do not pass an initial value and the enumerator is\n      empty.\n       Note that unlike the other methods, this method does not allow you to\n      pass a target object to set as this for the callback. It's part of the\n      spec. Sorry.\n       Example Usage:\n       ```javascript\n        let numbers = [1, 2, 3, 4, 5];\n         numbers.reduce(function(summation, current) {\n          return summation + current;\n        }); // 15 (1 + 2 + 3 + 4 + 5)\n         numbers.reduce(function(summation, current) {\n          return summation + current;\n        }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n          let binaryValues = [true, false, false];\n         binaryValues.reduce(function(truthValue, current) {\n          return truthValue && current;\n        }); // false (true && false && false)\n      ```\n       @method reduce\n      @param {Function} callback The callback to execute\n      @param {Object} initialValue Initial value for the reduce\n      @return {Object} The reduced value.\n      @public\n    */\n    reduce(callback, initialValue) {\n      (true && !(typeof callback === 'function') && (0, _debug.assert)('`reduce` expects a function as first argument.', typeof callback === 'function'));\n      var ret = initialValue;\n      this.forEach(function (item, i) {\n        ret = callback(ret, item, i, this);\n      }, this);\n      return ret;\n    },\n\n    /**\n      Invokes the named method on every object in the receiver that\n      implements it. This method corresponds to the implementation in\n      Prototype 1.6.\n       ```javascript\n      class Person {\n        name = null;\n         constructor(name) {\n          this.name = name;\n        }\n         greet(prefix='Hello') {\n          return `${prefix} ${this.name}`;\n        }\n      }\n       let people = [new Person('Joe'), new Person('Matt')];\n       people.invoke('greet'); // ['Hello Joe', 'Hello Matt']\n      people.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']\n      ```\n       @method invoke\n      @param {String} methodName the name of the method\n      @param {Object...} args optional arguments to pass as well.\n      @return {Array} return values from calling invoke.\n      @public\n    */\n    invoke(methodName, ...args) {\n      var ret = A();\n      this.forEach(item => ret.push((0, _utils.tryInvoke)(item, methodName, args)));\n      return ret;\n    },\n\n    /**\n      Simply converts the object into a genuine array. The order is not\n      guaranteed. Corresponds to the method implemented by Prototype.\n       @method toArray\n      @return {Array} the object as an array.\n      @public\n    */\n    toArray() {\n      return this.map(item => item);\n    },\n\n    /**\n      Returns a copy of the array with all `null` and `undefined` elements removed.\n       ```javascript\n      let arr = ['a', null, 'c', undefined];\n      arr.compact();  // ['a', 'c']\n      ```\n       @method compact\n      @return {Array} the array without null and undefined elements.\n      @public\n    */\n    compact() {\n      return this.filter(value => value != null);\n    },\n\n    /**\n      Used to determine if the array contains the passed object.\n      Returns `true` if found, `false` otherwise.\n       The optional `startAt` argument can be used to pass a starting\n      index to search from, effectively slicing the searchable portion\n      of the array. If it's negative it will add the array length to\n      the startAt value passed in as the index to search from. If less\n      than or equal to `-1 * array.length` the entire array is searched.\n       This method has the same behavior of JavaScript's [Array.includes](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes).\n       ```javascript\n      [1, 2, 3].includes(2);     // true\n      [1, 2, 3].includes(4);     // false\n      [1, 2, 3].includes(3, 2);  // true\n      [1, 2, 3].includes(3, 3);  // false\n      [1, 2, 3].includes(3, -1); // true\n      [1, 2, 3].includes(1, -1); // false\n      [1, 2, 3].includes(1, -4); // true\n      [1, 2, NaN].includes(NaN); // true\n      ```\n       @method includes\n      @param {Object} object The object to search for.\n      @param {Number} startAt optional starting location to search, default 0\n      @return {Boolean} `true` if object is found in the array.\n      @public\n    */\n    includes(object, startAt) {\n      return indexOf(this, object, startAt, true) !== -1;\n    },\n\n    /**\n      Sorts the array by the keys specified in the argument.\n       You may provide multiple arguments to sort by multiple properties.\n       ```javascript\n     let colors = [\n       { name: 'red', weight: 500 },\n       { name: 'green', weight: 600 },\n       { name: 'blue', weight: 500 }\n      ];\n      colors.sortBy('name');\n     // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n      colors.sortBy('weight', 'name');\n     // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]\n     ```\n       @method sortBy\n      @param {String} property name(s) to sort on\n      @return {Array} The sorted array.\n      @since 1.2.0\n      @public\n    */\n    sortBy() {\n      var sortKeys = arguments;\n      return this.toArray().sort((a, b) => {\n        for (var i = 0; i < sortKeys.length; i++) {\n          var key = sortKeys[i];\n          var propA = (0, _metal.get)(a, key);\n          var propB = (0, _metal.get)(b, key); // return 1 or -1 else continue to the next sortKey\n\n          var compareValue = (0, _compare.default)(propA, propB);\n\n          if (compareValue) {\n            return compareValue;\n          }\n        }\n\n        return 0;\n      });\n    },\n\n    /**\n      Returns a new array that contains only unique values. The default\n      implementation returns an array regardless of the receiver type.\n       ```javascript\n      let arr = ['a', 'a', 'b', 'b'];\n      arr.uniq();  // ['a', 'b']\n      ```\n       This only works on primitive data types, e.g. Strings, Numbers, etc.\n       @method uniq\n      @return {EmberArray}\n      @public\n    */\n    uniq() {\n      return uniqBy(this);\n    },\n\n    /**\n      Returns a new array that contains only items containing a unique property value.\n      The default implementation returns an array regardless of the receiver type.\n       ```javascript\n      let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\n      arr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n       let arr = [2.2, 2.1, 3.2, 3.3];\n      arr.uniqBy(Math.floor);  // [2.2, 3.2];\n      ```\n       @method uniqBy\n      @param {String,Function} key\n      @return {EmberArray}\n      @public\n    */\n    uniqBy(key) {\n      return uniqBy(this, key);\n    },\n\n    /**\n      Returns a new array that excludes the passed value. The default\n      implementation returns an array regardless of the receiver type.\n      If the receiver does not contain the value it returns the original array.\n       ```javascript\n      let arr = ['a', 'b', 'a', 'c'];\n      arr.without('a');  // ['b', 'c']\n      ```\n       @method without\n      @param {Object} value\n      @return {EmberArray}\n      @public\n    */\n    without(value) {\n      if (!this.includes(value)) {\n        return this; // nothing to do\n      } // SameValueZero comparison (NaN !== NaN)\n\n\n      var predicate = value === value ? item => item !== value : item => item === item;\n      return this.filter(predicate);\n    }\n\n  });\n  /**\n    This mixin defines the API for modifying array-like objects. These methods\n    can be applied only to a collection that keeps its items in an ordered set.\n    It builds upon the Array mixin and adds methods to modify the array.\n    One concrete implementations of this class include ArrayProxy.\n  \n    It is important to use the methods in this class to modify arrays so that\n    changes are observable. This allows the binding system in Ember to function\n    correctly.\n  \n  \n    Note that an Array can change even if it does not implement this mixin.\n    For example, one might implement a SparseArray that cannot be directly\n    modified, but if its underlying enumerable changes, it will change also.\n  \n    @class MutableArray\n    @uses EmberArray\n    @uses MutableEnumerable\n    @public\n  */\n\n\n  var MutableArray = _metal.Mixin.create(ArrayMixin, _mutable_enumerable.default, {\n    /**\n      __Required.__ You must implement this method to apply this mixin.\n       This is one of the primitives you must implement to support `Array`.\n      You should replace amt objects started at idx with the objects in the\n      passed array. You should also call `this.arrayContentDidChange()`\n       Note that this method is expected to validate the type(s) of objects that it expects.\n       @method replace\n      @param {Number} idx Starting index in the array to replace. If\n        idx >= length, then append to the end of the array.\n      @param {Number} amt Number of elements that should be removed from\n        the array, starting at *idx*.\n      @param {EmberArray} objects An array of zero or more objects that should be\n        inserted into the array at *idx*\n      @public\n    */\n\n    /**\n      Remove all elements from the array. This is useful if you\n      want to reuse an existing array without having to recreate it.\n       ```javascript\n      let colors = ['red', 'green', 'blue'];\n       colors.length;  // 3\n      colors.clear(); // []\n      colors.length;  // 0\n      ```\n       @method clear\n      @return {Array} An empty Array.\n      @public\n    */\n    clear() {\n      var len = this.length;\n\n      if (len === 0) {\n        return this;\n      }\n\n      this.replace(0, len, EMPTY_ARRAY);\n      return this;\n    },\n\n    /**\n      This will use the primitive `replace()` method to insert an object at the\n      specified index.\n       ```javascript\n      let colors = ['red', 'green', 'blue'];\n       colors.insertAt(2, 'yellow');  // ['red', 'green', 'yellow', 'blue']\n      colors.insertAt(5, 'orange');  // Error: Index out of range\n      ```\n       @method insertAt\n      @param {Number} idx index of insert the object at.\n      @param {Object} object object to insert\n      @return {EmberArray} receiver\n      @public\n    */\n    insertAt(idx, object) {\n      insertAt(this, idx, object);\n      return this;\n    },\n\n    /**\n      Remove an object at the specified index using the `replace()` primitive\n      method. You can pass either a single index, or a start and a length.\n       If you pass a start and length that is beyond the\n      length this method will throw an assertion.\n       ```javascript\n      let colors = ['red', 'green', 'blue', 'yellow', 'orange'];\n       colors.removeAt(0);     // ['green', 'blue', 'yellow', 'orange']\n      colors.removeAt(2, 2);  // ['green', 'blue']\n      colors.removeAt(4, 2);  // Error: Index out of range\n      ```\n       @method removeAt\n      @param {Number} start index, start of range\n      @param {Number} len length of passing range\n      @return {EmberArray} receiver\n      @public\n    */\n    removeAt(start, len) {\n      return removeAt(this, start, len);\n    },\n\n    /**\n      Push the object onto the end of the array. Works just like `push()` but it\n      is KVO-compliant.\n       ```javascript\n      let colors = ['red', 'green'];\n       colors.pushObject('black');     // ['red', 'green', 'black']\n      colors.pushObject(['yellow']);  // ['red', 'green', ['yellow']]\n      ```\n       @method pushObject\n      @param {*} obj object to push\n      @return object same object passed as a param\n      @public\n    */\n    pushObject(obj) {\n      return insertAt(this, this.length, obj);\n    },\n\n    /**\n      Add the objects in the passed array to the end of the array. Defers\n      notifying observers of the change until all objects are added.\n       ```javascript\n      let colors = ['red'];\n       colors.pushObjects(['yellow', 'orange']);  // ['red', 'yellow', 'orange']\n      ```\n       @method pushObjects\n      @param {EmberArray} objects the objects to add\n      @return {EmberArray} receiver\n      @public\n    */\n    pushObjects(objects) {\n      this.replace(this.length, 0, objects);\n      return this;\n    },\n\n    /**\n      Pop object from array or nil if none are left. Works just like `pop()` but\n      it is KVO-compliant.\n       ```javascript\n      let colors = ['red', 'green', 'blue'];\n       colors.popObject();   // 'blue'\n      console.log(colors);  // ['red', 'green']\n      ```\n       @method popObject\n      @return object\n      @public\n    */\n    popObject() {\n      var len = this.length;\n\n      if (len === 0) {\n        return null;\n      }\n\n      var ret = (0, _metal.objectAt)(this, len - 1);\n      this.removeAt(len - 1, 1);\n      return ret;\n    },\n\n    /**\n      Shift an object from start of array or nil if none are left. Works just\n      like `shift()` but it is KVO-compliant.\n       ```javascript\n      let colors = ['red', 'green', 'blue'];\n       colors.shiftObject();  // 'red'\n      console.log(colors);   // ['green', 'blue']\n      ```\n       @method shiftObject\n      @return object\n      @public\n    */\n    shiftObject() {\n      if (this.length === 0) {\n        return null;\n      }\n\n      var ret = (0, _metal.objectAt)(this, 0);\n      this.removeAt(0);\n      return ret;\n    },\n\n    /**\n      Unshift an object to start of array. Works just like `unshift()` but it is\n      KVO-compliant.\n       ```javascript\n      let colors = ['red'];\n       colors.unshiftObject('yellow');    // ['yellow', 'red']\n      colors.unshiftObject(['black']);   // [['black'], 'yellow', 'red']\n      ```\n       @method unshiftObject\n      @param {*} obj object to unshift\n      @return object same object passed as a param\n      @public\n    */\n    unshiftObject(obj) {\n      return insertAt(this, 0, obj);\n    },\n\n    /**\n      Adds the named objects to the beginning of the array. Defers notifying\n      observers until all objects have been added.\n       ```javascript\n      let colors = ['red'];\n       colors.unshiftObjects(['black', 'white']);   // ['black', 'white', 'red']\n      colors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function\n      ```\n       @method unshiftObjects\n      @param {Enumberable} objects the objects to add\n      @return {EmberArray} receiver\n      @public\n    */\n    unshiftObjects(objects) {\n      this.replace(0, 0, objects);\n      return this;\n    },\n\n    /**\n      Reverse objects in the array. Works just like `reverse()` but it is\n      KVO-compliant.\n       @method reverseObjects\n      @return {EmberArray} receiver\n       @public\n    */\n    reverseObjects() {\n      var len = this.length;\n\n      if (len === 0) {\n        return this;\n      }\n\n      var objects = this.toArray().reverse();\n      this.replace(0, len, objects);\n      return this;\n    },\n\n    /**\n      Replace all the receiver's content with content of the argument.\n      If argument is an empty array receiver will be cleared.\n       ```javascript\n      let colors = ['red', 'green', 'blue'];\n       colors.setObjects(['black', 'white']);  // ['black', 'white']\n      colors.setObjects([]);                  // []\n      ```\n       @method setObjects\n      @param {EmberArray} objects array whose content will be used for replacing\n          the content of the receiver\n      @return {EmberArray} receiver with the new content\n      @public\n    */\n    setObjects(objects) {\n      if (objects.length === 0) {\n        return this.clear();\n      }\n\n      var len = this.length;\n      this.replace(0, len, objects);\n      return this;\n    },\n\n    /**\n      Remove all occurrences of an object in the array.\n       ```javascript\n      let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago'];\n       cities.removeObject('Chicago');  // ['Berlin', 'Lima']\n      cities.removeObject('Lima');     // ['Berlin']\n      cities.removeObject('Tokyo')     // ['Berlin']\n      ```\n       @method removeObject\n      @param {*} obj object to remove\n      @return {EmberArray} receiver\n      @public\n    */\n    removeObject(obj) {\n      var loc = this.length || 0;\n\n      while (--loc >= 0) {\n        var curObject = (0, _metal.objectAt)(this, loc);\n\n        if (curObject === obj) {\n          this.removeAt(loc);\n        }\n      }\n\n      return this;\n    },\n\n    /**\n      Removes each object in the passed array from the receiver.\n       @method removeObjects\n      @param {EmberArray} objects the objects to remove\n      @return {EmberArray} receiver\n      @public\n    */\n    removeObjects(objects) {\n      (0, _metal.beginPropertyChanges)();\n\n      for (var i = objects.length - 1; i >= 0; i--) {\n        this.removeObject(objects[i]);\n      }\n\n      (0, _metal.endPropertyChanges)();\n      return this;\n    },\n\n    /**\n      Push the object onto the end of the array if it is not already\n      present in the array.\n       ```javascript\n      let cities = ['Chicago', 'Berlin'];\n       cities.addObject('Lima');    // ['Chicago', 'Berlin', 'Lima']\n      cities.addObject('Berlin');  // ['Chicago', 'Berlin', 'Lima']\n      ```\n       @method addObject\n      @param {*} obj object to add, if not already present\n      @return {EmberArray} receiver\n      @public\n    */\n    addObject(obj) {\n      var included = this.includes(obj);\n\n      if (!included) {\n        this.pushObject(obj);\n      }\n\n      return this;\n    },\n\n    /**\n      Adds each object in the passed array to the receiver.\n       @method addObjects\n      @param {EmberArray} objects the objects to add.\n      @return {EmberArray} receiver\n      @public\n    */\n    addObjects(objects) {\n      (0, _metal.beginPropertyChanges)();\n      objects.forEach(obj => this.addObject(obj));\n      (0, _metal.endPropertyChanges)();\n      return this;\n    }\n\n  });\n  /**\n    Creates an `Ember.NativeArray` from an Array-like object.\n    Does not modify the original object's contents. `A()` is not needed if\n    `EmberENV.EXTEND_PROTOTYPES` is `true` (the default value). However,\n    it is recommended that you use `A()` when creating addons for\n    ember or when you can not guarantee that `EmberENV.EXTEND_PROTOTYPES`\n    will be `true`.\n  \n    Example\n  \n    ```app/components/my-component.js\n    import Component from '@ember/component';\n    import { A } from '@ember/array';\n  \n    export default Component.extend({\n      tagName: 'ul',\n      classNames: ['pagination'],\n  \n      init() {\n        this._super(...arguments);\n  \n        if (!this.get('content')) {\n          this.set('content', A());\n          this.set('otherContent', A([1,2,3]));\n        }\n      }\n    });\n    ```\n  \n    @method A\n    @static\n    @for @ember/array\n    @return {Ember.NativeArray}\n    @public\n  */\n  // Add Ember.Array to Array.prototype. Remove methods with native\n  // implementations and supply some more optimized versions of generic methods\n  // because they are so common.\n\n  /**\n  @module ember\n  */\n\n  /**\n    The NativeArray mixin contains the properties needed to make the native\n    Array support MutableArray and all of its dependent APIs. Unless you\n    have `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Array` set to\n    false, this will be applied automatically. Otherwise you can apply the mixin\n    at anytime by calling `Ember.NativeArray.apply(Array.prototype)`.\n  \n    @class Ember.NativeArray\n    @uses MutableArray\n    @uses Observable\n    @public\n  */\n\n\n  _exports.MutableArray = MutableArray;\n\n  var NativeArray = _metal.Mixin.create(MutableArray, _observable.default, {\n    objectAt(idx) {\n      return this[idx];\n    },\n\n    // primitive for array support.\n    replace(start, deleteCount, items = EMPTY_ARRAY) {\n      (true && !(Array.isArray(items)) && (0, _debug.assert)('The third argument to replace needs to be an array.', Array.isArray(items)));\n      (0, _metal.replaceInNativeArray)(this, start, deleteCount, items);\n      return this;\n    }\n\n  }); // Remove any methods implemented natively so we don't override them\n\n\n  _exports.NativeArray = NativeArray;\n  var ignore = ['length'];\n  NativeArray.keys().forEach(methodName => {\n    if (Array.prototype[methodName]) {\n      ignore.push(methodName);\n    }\n  });\n  _exports.NativeArray = NativeArray = NativeArray.without(...ignore);\n  var A;\n  _exports.A = A;\n\n  if (_environment.ENV.EXTEND_PROTOTYPES.Array) {\n    NativeArray.apply(Array.prototype);\n\n    _exports.A = A = function (arr) {\n      (true && !(!(this instanceof A)) && (0, _debug.assert)('You cannot create an Ember Array with `new A()`, please update to calling A as a function: `A()`', !(this instanceof A)));\n      return arr || [];\n    };\n  } else {\n    _exports.A = A = function (arr) {\n      (true && !(!(this instanceof A)) && (0, _debug.assert)('You cannot create an Ember Array with `new A()`, please update to calling A as a function: `A()`', !(this instanceof A)));\n\n      if (!arr) {\n        arr = [];\n      }\n\n      return ArrayMixin.detect(arr) ? arr : NativeArray.apply(arr);\n    };\n  }\n\n  var _default = ArrayMixin;\n  _exports.default = _default;\n});","define(\"@ember/-internals/runtime/lib/mixins/comparable\", [\"exports\", \"@ember/-internals/metal\"], function (_exports, _metal) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n  @module ember\n  */\n\n  /**\n    Implements some standard methods for comparing objects. Add this mixin to\n    any class you create that can compare its instances.\n  \n    You should implement the `compare()` method.\n  \n    @class Comparable\n    @namespace Ember\n    @since Ember 0.9\n    @private\n  */\n  var _default = _metal.Mixin.create({\n    /**\n      __Required.__ You must implement this method to apply this mixin.\n       Override to return the result of the comparison of the two parameters. The\n      compare method should return:\n       - `-1` if `a < b`\n      - `0` if `a == b`\n      - `1` if `a > b`\n       Default implementation raises an exception.\n       @method compare\n      @param a {Object} the first object to compare\n      @param b {Object} the second object to compare\n      @return {Number} the result of the comparison\n      @private\n    */\n    compare: null\n  });\n\n  _exports.default = _default;\n});","define(\"@ember/-internals/runtime/lib/mixins/container_proxy\", [\"exports\", \"@ember/runloop\", \"@ember/-internals/metal\"], function (_exports, _runloop, _metal) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n  @module ember\n  */\n\n  /**\n    ContainerProxyMixin is used to provide public access to specific\n    container functionality.\n  \n    @class ContainerProxyMixin\n    @private\n  */\n  var containerProxyMixin = {\n    /**\n     The container stores state.\n      @private\n     @property {Ember.Container} __container__\n     */\n    __container__: null,\n\n    /**\n     Returns an object that can be used to provide an owner to a\n     manually created instance.\n      Example:\n      ```\n     import { getOwner } from '@ember/application';\n      let owner = getOwner(this);\n      User.create(\n       owner.ownerInjection(),\n       { username: 'rwjblue' }\n     )\n     ```\n      @public\n     @method ownerInjection\n     @since 2.3.0\n     @return {Object}\n    */\n    ownerInjection() {\n      return this.__container__.ownerInjection();\n    },\n\n    /**\n     Given a fullName return a corresponding instance.\n      The default behavior is for lookup to return a singleton instance.\n     The singleton is scoped to the container, allowing multiple containers\n     to all have their own locally scoped singletons.\n      ```javascript\n     let registry = new Registry();\n     let container = registry.container();\n      registry.register('api:twitter', Twitter);\n      let twitter = container.lookup('api:twitter');\n      twitter instanceof Twitter; // => true\n      // by default the container will return singletons\n     let twitter2 = container.lookup('api:twitter');\n     twitter2 instanceof Twitter; // => true\n      twitter === twitter2; //=> true\n     ```\n      If singletons are not wanted an optional flag can be provided at lookup.\n      ```javascript\n     let registry = new Registry();\n     let container = registry.container();\n      registry.register('api:twitter', Twitter);\n      let twitter = container.lookup('api:twitter', { singleton: false });\n     let twitter2 = container.lookup('api:twitter', { singleton: false });\n      twitter === twitter2; //=> false\n     ```\n      @public\n     @method lookup\n     @param {String} fullName\n     @param {Object} options\n     @return {any}\n     */\n    lookup(fullName, options) {\n      return this.__container__.lookup(fullName, options);\n    },\n\n    destroy() {\n      var container = this.__container__;\n\n      if (container) {\n        (0, _runloop.join)(() => {\n          container.destroy();\n          (0, _runloop.schedule)('destroy', container, 'finalizeDestroy');\n        });\n      }\n\n      this._super();\n    },\n\n    /**\n    Given a fullName return a factory manager.\n     This method returns a manager which can be used for introspection of the\n    factory's class or for the creation of factory instances with initial\n    properties. The manager is an object with the following properties:\n     * `class` - The registered or resolved class.\n    * `create` - A function that will create an instance of the class with\n      any dependencies injected.\n     For example:\n     ```javascript\n    import { getOwner } from '@ember/application';\n     let owner = getOwner(otherInstance);\n    // the owner is commonly the `applicationInstance`, and can be accessed via\n    // an instance initializer.\n     let factory = owner.factoryFor('service:bespoke');\n     factory.class;\n    // The registered or resolved class. For example when used with an Ember-CLI\n    // app, this would be the default export from `app/services/bespoke.js`.\n     let instance = factory.create({\n      someProperty: 'an initial property value'\n    });\n    // Create an instance with any injections and the passed options as\n    // initial properties.\n    ```\n     Any instances created via the factory's `.create()` method *must* be destroyed\n    manually by the caller of `.create()`. Typically, this is done during the creating\n    objects own `destroy` or `willDestroy` methods.\n     @public\n    @method factoryFor\n    @param {String} fullName\n    @param {Object} options\n    @return {FactoryManager}\n    */\n    factoryFor(fullName, options = {}) {\n      return this.__container__.factoryFor(fullName, options);\n    }\n\n  };\n\n  var _default = _metal.Mixin.create(containerProxyMixin);\n\n  _exports.default = _default;\n});","define(\"@ember/-internals/runtime/lib/mixins/copyable\", [\"exports\", \"@ember/-internals/metal\"], function (_exports, _metal) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n  @module ember\n  */\n\n  /**\n    Implements some standard methods for copying an object. Add this mixin to\n    any object you create that can create a copy of itself. This mixin is\n    added automatically to the built-in array.\n  \n    You should generally implement the `copy()` method to return a copy of the\n    receiver.\n  \n    @class Copyable\n    @namespace Ember\n    @since Ember 0.9\n    @deprecated Use 'ember-copy' addon instead\n    @private\n  */\n  var _default = _metal.Mixin.create({\n    /**\n      __Required.__ You must implement this method to apply this mixin.\n       Override to return a copy of the receiver. Default implementation raises\n      an exception.\n       @method copy\n      @param {Boolean} deep if `true`, a deep copy of the object should be made\n      @return {Object} copy of receiver\n      @private\n    */\n    copy: null\n  });\n\n  _exports.default = _default;\n});","define(\"@ember/-internals/runtime/lib/mixins/enumerable\", [\"exports\", \"@ember/-internals/metal\"], function (_exports, _metal) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n  @module @ember/enumerable\n  @private\n  */\n\n  /**\n    The methods in this mixin have been moved to [MutableArray](/ember/release/classes/MutableArray). This mixin has\n    been intentionally preserved to avoid breaking Enumerable.detect checks\n    until the community migrates away from them.\n  \n    @class Enumerable\n    @private\n  */\n  var _default = _metal.Mixin.create();\n\n  _exports.default = _default;\n});","define(\"@ember/-internals/runtime/lib/mixins/evented\", [\"exports\", \"@ember/-internals/metal\"], function (_exports, _metal) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n  @module @ember/object\n  */\n\n  /**\n    This mixin allows for Ember objects to subscribe to and emit events.\n  \n    ```app/utils/person.js\n    import EmberObject from '@ember/object';\n    import Evented from '@ember/object/evented';\n  \n    export default EmberObject.extend(Evented, {\n      greet() {\n        // ...\n        this.trigger('greet');\n      }\n    });\n    ```\n  \n    ```javascript\n    var person = Person.create();\n  \n    person.on('greet', function() {\n      console.log('Our person has greeted');\n    });\n  \n    person.greet();\n  \n    // outputs: 'Our person has greeted'\n    ```\n  \n    You can also chain multiple event subscriptions:\n  \n    ```javascript\n    person.on('greet', function() {\n      console.log('Our person has greeted');\n    }).one('greet', function() {\n      console.log('Offer one-time special');\n    }).off('event', this, forgetThis);\n    ```\n  \n    @class Evented\n    @public\n   */\n  var _default = _metal.Mixin.create({\n    /**\n      Subscribes to a named event with given function.\n       ```javascript\n      person.on('didLoad', function() {\n        // fired once the person has loaded\n      });\n      ```\n       An optional target can be passed in as the 2nd argument that will\n      be set as the \"this\" for the callback. This is a good way to give your\n      function access to the object triggering the event. When the target\n      parameter is used the callback method becomes the third argument.\n       @method on\n      @param {String} name The name of the event\n      @param {Object} [target] The \"this\" binding for the callback\n      @param {Function|String} method A function or the name of a function to be called on `target`\n      @return this\n      @public\n    */\n    on(name, target, method) {\n      (0, _metal.addListener)(this, name, target, method);\n      return this;\n    },\n\n    /**\n      Subscribes a function to a named event and then cancels the subscription\n      after the first time the event is triggered. It is good to use ``one`` when\n      you only care about the first time an event has taken place.\n       This function takes an optional 2nd argument that will become the \"this\"\n      value for the callback. When the target parameter is used the callback method\n      becomes the third argument.\n       @method one\n      @param {String} name The name of the event\n      @param {Object} [target] The \"this\" binding for the callback\n      @param {Function|String} method A function or the name of a function to be called on `target`\n      @return this\n      @public\n    */\n    one(name, target, method) {\n      (0, _metal.addListener)(this, name, target, method, true);\n      return this;\n    },\n\n    /**\n      Triggers a named event for the object. Any additional arguments\n      will be passed as parameters to the functions that are subscribed to the\n      event.\n       ```javascript\n      person.on('didEat', function(food) {\n        console.log('person ate some ' + food);\n      });\n       person.trigger('didEat', 'broccoli');\n       // outputs: person ate some broccoli\n      ```\n      @method trigger\n      @param {String} name The name of the event\n      @param {Object...} args Optional arguments to pass on\n      @public\n    */\n    trigger(name, ...args) {\n      (0, _metal.sendEvent)(this, name, args);\n    },\n\n    /**\n      Cancels subscription for given name, target, and method.\n       @method off\n      @param {String} name The name of the event\n      @param {Object} target The target of the subscription\n      @param {Function|String} method The function or the name of a function of the subscription\n      @return this\n      @public\n    */\n    off(name, target, method) {\n      (0, _metal.removeListener)(this, name, target, method);\n      return this;\n    },\n\n    /**\n      Checks to see if object has any subscriptions for named event.\n       @method has\n      @param {String} name The name of the event\n      @return {Boolean} does the object have a subscription for event\n      @public\n     */\n    has(name) {\n      return (0, _metal.hasListeners)(this, name);\n    }\n\n  });\n\n  _exports.default = _default;\n});","define(\"@ember/-internals/runtime/lib/mixins/mutable_enumerable\", [\"exports\", \"@ember/-internals/runtime/lib/mixins/enumerable\", \"@ember/-internals/metal\"], function (_exports, _enumerable, _metal) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n  @module ember\n  */\n\n  /**\n    The methods in this mixin have been moved to MutableArray. This mixin has\n    been intentionally preserved to avoid breaking MutableEnumerable.detect\n    checks until the community migrates away from them.\n  \n    @class MutableEnumerable\n    @namespace Ember\n    @uses Enumerable\n    @private\n  */\n  var _default = _metal.Mixin.create(_enumerable.default);\n\n  _exports.default = _default;\n});","define(\"@ember/-internals/runtime/lib/mixins/observable\", [\"exports\", \"@ember/-internals/metal\", \"@ember/debug\"], function (_exports, _metal, _debug) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n  @module @ember/object\n  */\n\n  /**\n    ## Overview\n  \n    This mixin provides properties and property observing functionality, core\n    features of the Ember object model.\n  \n    Properties and observers allow one object to observe changes to a\n    property on another object. This is one of the fundamental ways that\n    models, controllers and views communicate with each other in an Ember\n    application.\n  \n    Any object that has this mixin applied can be used in observer\n    operations. That includes `EmberObject` and most objects you will\n    interact with as you write your Ember application.\n  \n    Note that you will not generally apply this mixin to classes yourself,\n    but you will use the features provided by this module frequently, so it\n    is important to understand how to use it.\n  \n    ## Using `get()` and `set()`\n  \n    Because of Ember's support for bindings and observers, you will always\n    access properties using the get method, and set properties using the\n    set method. This allows the observing objects to be notified and\n    computed properties to be handled properly.\n  \n    More documentation about `get` and `set` are below.\n  \n    ## Observing Property Changes\n  \n    You typically observe property changes simply by using the `observer`\n    function in classes that you write.\n  \n    For example:\n  \n    ```javascript\n    import { observer } from '@ember/object';\n    import EmberObject from '@ember/object';\n  \n    EmberObject.extend({\n      valueObserver: observer('value', function(sender, key, value, rev) {\n        // Executes whenever the \"value\" property changes\n        // See the addObserver method for more information about the callback arguments\n      })\n    });\n    ```\n  \n    Although this is the most common way to add an observer, this capability\n    is actually built into the `EmberObject` class on top of two methods\n    defined in this mixin: `addObserver` and `removeObserver`. You can use\n    these two methods to add and remove observers yourself if you need to\n    do so at runtime.\n  \n    To add an observer for a property, call:\n  \n    ```javascript\n    object.addObserver('propertyKey', targetObject, targetAction)\n    ```\n  \n    This will call the `targetAction` method on the `targetObject` whenever\n    the value of the `propertyKey` changes.\n  \n    Note that if `propertyKey` is a computed property, the observer will be\n    called when any of the property dependencies are changed, even if the\n    resulting value of the computed property is unchanged. This is necessary\n    because computed properties are not computed until `get` is called.\n  \n    @class Observable\n    @public\n  */\n  var _default = _metal.Mixin.create({\n    /**\n      Retrieves the value of a property from the object.\n       This method is usually similar to using `object[keyName]` or `object.keyName`,\n      however it supports both computed properties and the unknownProperty\n      handler.\n       Because `get` unifies the syntax for accessing all these kinds\n      of properties, it can make many refactorings easier, such as replacing a\n      simple property with a computed property, or vice versa.\n       ### Computed Properties\n       Computed properties are methods defined with the `property` modifier\n      declared at the end, such as:\n       ```javascript\n      import { computed } from '@ember/object';\n       fullName: computed('firstName', 'lastName', function() {\n        return this.get('firstName') + ' ' + this.get('lastName');\n      })\n      ```\n       When you call `get` on a computed property, the function will be\n      called and the return value will be returned instead of the function\n      itself.\n       ### Unknown Properties\n       Likewise, if you try to call `get` on a property whose value is\n      `undefined`, the `unknownProperty()` method will be called on the object.\n      If this method returns any value other than `undefined`, it will be returned\n      instead. This allows you to implement \"virtual\" properties that are\n      not defined upfront.\n       @method get\n      @param {String} keyName The property to retrieve\n      @return {Object} The property value or undefined.\n      @public\n    */\n    get(keyName) {\n      return (0, _metal.get)(this, keyName);\n    },\n\n    /**\n      To get the values of multiple properties at once, call `getProperties`\n      with a list of strings or an array:\n       ```javascript\n      record.getProperties('firstName', 'lastName', 'zipCode');\n      // { firstName: 'John', lastName: 'Doe', zipCode: '10011' }\n      ```\n       is equivalent to:\n       ```javascript\n      record.getProperties(['firstName', 'lastName', 'zipCode']);\n      // { firstName: 'John', lastName: 'Doe', zipCode: '10011' }\n      ```\n       @method getProperties\n      @param {String...|Array} list of keys to get\n      @return {Object}\n      @public\n    */\n    getProperties(...args) {\n      return (0, _metal.getProperties)(...[this].concat(args));\n    },\n\n    /**\n      Sets the provided key or path to the value.\n       ```javascript\n      record.set(\"key\", value);\n      ```\n       This method is generally very similar to calling `object[\"key\"] = value` or\n      `object.key = value`, except that it provides support for computed\n      properties, the `setUnknownProperty()` method and property observers.\n       ### Computed Properties\n       If you try to set a value on a key that has a computed property handler\n      defined (see the `get()` method for an example), then `set()` will call\n      that method, passing both the value and key instead of simply changing\n      the value itself. This is useful for those times when you need to\n      implement a property that is composed of one or more member\n      properties.\n       ### Unknown Properties\n       If you try to set a value on a key that is undefined in the target\n      object, then the `setUnknownProperty()` handler will be called instead. This\n      gives you an opportunity to implement complex \"virtual\" properties that\n      are not predefined on the object. If `setUnknownProperty()` returns\n      undefined, then `set()` will simply set the value on the object.\n       ### Property Observers\n       In addition to changing the property, `set()` will also register a property\n      change with the object. Unless you have placed this call inside of a\n      `beginPropertyChanges()` and `endPropertyChanges(),` any \"local\" observers\n      (i.e. observer methods declared on the same object), will be called\n      immediately. Any \"remote\" observers (i.e. observer methods declared on\n      another object) will be placed in a queue and called at a later time in a\n      coalesced manner.\n       @method set\n      @param {String} keyName The property to set\n      @param {Object} value The value to set or `null`.\n      @return {Object} The passed value\n      @public\n    */\n    set(keyName, value) {\n      return (0, _metal.set)(this, keyName, value);\n    },\n\n    /**\n      Sets a list of properties at once. These properties are set inside\n      a single `beginPropertyChanges` and `endPropertyChanges` batch, so\n      observers will be buffered.\n       ```javascript\n      record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });\n      ```\n       @method setProperties\n      @param {Object} hash the hash of keys and values to set\n      @return {Object} The passed in hash\n      @public\n    */\n    setProperties(hash) {\n      return (0, _metal.setProperties)(this, hash);\n    },\n\n    /**\n      Begins a grouping of property changes.\n       You can use this method to group property changes so that notifications\n      will not be sent until the changes are finished. If you plan to make a\n      large number of changes to an object at one time, you should call this\n      method at the beginning of the changes to begin deferring change\n      notifications. When you are done making changes, call\n      `endPropertyChanges()` to deliver the deferred change notifications and end\n      deferring.\n       @method beginPropertyChanges\n      @return {Observable}\n      @private\n    */\n    beginPropertyChanges() {\n      (0, _metal.beginPropertyChanges)();\n      return this;\n    },\n\n    /**\n      Ends a grouping of property changes.\n       You can use this method to group property changes so that notifications\n      will not be sent until the changes are finished. If you plan to make a\n      large number of changes to an object at one time, you should call\n      `beginPropertyChanges()` at the beginning of the changes to defer change\n      notifications. When you are done making changes, call this method to\n      deliver the deferred change notifications and end deferring.\n       @method endPropertyChanges\n      @return {Observable}\n      @private\n    */\n    endPropertyChanges() {\n      (0, _metal.endPropertyChanges)();\n      return this;\n    },\n\n    /**\n      Notify the observer system that a property has just changed.\n       Sometimes you need to change a value directly or indirectly without\n      actually calling `get()` or `set()` on it. In this case, you can use this\n      method instead. Calling this method will notify all observers that the\n      property has potentially changed value.\n       @method notifyPropertyChange\n      @param {String} keyName The property key to be notified about.\n      @return {Observable}\n      @public\n    */\n    notifyPropertyChange(keyName) {\n      (0, _metal.notifyPropertyChange)(this, keyName);\n      return this;\n    },\n\n    /**\n      Adds an observer on a property.\n       This is the core method used to register an observer for a property.\n       Once you call this method, any time the key's value is set, your observer\n      will be notified. Note that the observers are triggered any time the\n      value is set, regardless of whether it has actually changed. Your\n      observer should be prepared to handle that.\n       There are two common invocation patterns for `.addObserver()`:\n       - Passing two arguments:\n        - the name of the property to observe (as a string)\n        - the function to invoke (an actual function)\n      - Passing three arguments:\n        - the name of the property to observe (as a string)\n        - the target object (will be used to look up and invoke a\n          function on)\n        - the name of the function to invoke on the target object\n          (as a string).\n       ```app/components/my-component.js\n      import Component from '@ember/component';\n       export default Component.extend({\n        init() {\n          this._super(...arguments);\n           // the following are equivalent:\n           // using three arguments\n          this.addObserver('foo', this, 'fooDidChange');\n           // using two arguments\n          this.addObserver('foo', (...args) => {\n            this.fooDidChange(...args);\n          });\n        },\n         fooDidChange() {\n          // your custom logic code\n        }\n      });\n      ```\n       ### Observer Methods\n       Observer methods have the following signature:\n       ```app/components/my-component.js\n      import Component from '@ember/component';\n       export default Component.extend({\n        init() {\n          this._super(...arguments);\n          this.addObserver('foo', this, 'fooDidChange');\n        },\n         fooDidChange(sender, key, value, rev) {\n          // your code\n        }\n      });\n      ```\n       The `sender` is the object that changed. The `key` is the property that\n      changes. The `value` property is currently reserved and unused. The `rev`\n      is the last property revision of the object when it changed, which you can\n      use to detect if the key value has really changed or not.\n       Usually you will not need the value or revision parameters at\n      the end. In this case, it is common to write observer methods that take\n      only a sender and key value as parameters or, if you aren't interested in\n      any of these values, to write an observer that has no parameters at all.\n       @method addObserver\n      @param {String} key The key to observe\n      @param {Object} target The target object to invoke\n      @param {String|Function} method The method to invoke\n      @param {Boolean} sync Whether the observer is sync or not\n      @return {Observable}\n      @public\n    */\n    addObserver(key, target, method, sync) {\n      (0, _metal.addObserver)(this, key, target, method, sync);\n      return this;\n    },\n\n    /**\n      Remove an observer you have previously registered on this object. Pass\n      the same key, target, and method you passed to `addObserver()` and your\n      target will no longer receive notifications.\n       @method removeObserver\n      @param {String} key The key to observe\n      @param {Object} target The target object to invoke\n      @param {String|Function} method The method to invoke\n      @param {Boolean} sync Whether the observer is async or not\n      @return {Observable}\n      @public\n    */\n    removeObserver(key, target, method, sync) {\n      (0, _metal.removeObserver)(this, key, target, method, sync);\n      return this;\n    },\n\n    /**\n      Returns `true` if the object currently has observers registered for a\n      particular key. You can use this method to potentially defer performing\n      an expensive action until someone begins observing a particular property\n      on the object.\n       @method hasObserverFor\n      @param {String} key Key to check\n      @return {Boolean}\n      @private\n    */\n    hasObserverFor(key) {\n      return (0, _metal.hasListeners)(this, key + \":change\");\n    },\n\n    /**\n      Retrieves the value of a property, or a default value in the case that the\n      property returns `undefined`.\n       ```javascript\n      person.getWithDefault('lastName', 'Doe');\n      ```\n       @method getWithDefault\n      @param {String} keyName The name of the property to retrieve\n      @param {Object} defaultValue The value to return if the property value is undefined\n      @return {Object} The property value or the defaultValue.\n      @public\n    */\n    getWithDefault(keyName, defaultValue) {\n      return (0, _metal.getWithDefault)(this, keyName, defaultValue);\n    },\n\n    /**\n      Set the value of a property to the current value plus some amount.\n       ```javascript\n      person.incrementProperty('age');\n      team.incrementProperty('score', 2);\n      ```\n       @method incrementProperty\n      @param {String} keyName The name of the property to increment\n      @param {Number} increment The amount to increment by. Defaults to 1\n      @return {Number} The new property value\n      @public\n    */\n    incrementProperty(keyName, increment = 1) {\n      (true && !(!isNaN(parseFloat(increment)) && isFinite(increment)) && (0, _debug.assert)('Must pass a numeric value to incrementProperty', !isNaN(parseFloat(increment)) && isFinite(increment)));\n      return (0, _metal.set)(this, keyName, (parseFloat((0, _metal.get)(this, keyName)) || 0) + increment);\n    },\n\n    /**\n      Set the value of a property to the current value minus some amount.\n       ```javascript\n      player.decrementProperty('lives');\n      orc.decrementProperty('health', 5);\n      ```\n       @method decrementProperty\n      @param {String} keyName The name of the property to decrement\n      @param {Number} decrement The amount to decrement by. Defaults to 1\n      @return {Number} The new property value\n      @public\n    */\n    decrementProperty(keyName, decrement = 1) {\n      (true && !(!isNaN(parseFloat(decrement)) && isFinite(decrement)) && (0, _debug.assert)('Must pass a numeric value to decrementProperty', !isNaN(parseFloat(decrement)) && isFinite(decrement)));\n      return (0, _metal.set)(this, keyName, ((0, _metal.get)(this, keyName) || 0) - decrement);\n    },\n\n    /**\n      Set the value of a boolean property to the opposite of its\n      current value.\n       ```javascript\n      starship.toggleProperty('warpDriveEngaged');\n      ```\n       @method toggleProperty\n      @param {String} keyName The name of the property to toggle\n      @return {Boolean} The new property value\n      @public\n    */\n    toggleProperty(keyName) {\n      return (0, _metal.set)(this, keyName, !(0, _metal.get)(this, keyName));\n    },\n\n    /**\n      Returns the cached value of a computed property, if it exists.\n      This allows you to inspect the value of a computed property\n      without accidentally invoking it if it is intended to be\n      generated lazily.\n       @method cacheFor\n      @param {String} keyName\n      @return {Object} The cached value of the computed property, if any\n      @public\n    */\n    cacheFor(keyName) {\n      return (0, _metal.getCachedValueFor)(this, keyName);\n    }\n\n  });\n\n  _exports.default = _default;\n});","define(\"@ember/-internals/runtime/lib/mixins/promise_proxy\", [\"exports\", \"@ember/-internals/metal\", \"@ember/error\"], function (_exports, _metal, _error) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n    @module @ember/object\n  */\n  function tap(proxy, promise) {\n    (0, _metal.setProperties)(proxy, {\n      isFulfilled: false,\n      isRejected: false\n    });\n    return promise.then(value => {\n      if (!proxy.isDestroyed && !proxy.isDestroying) {\n        (0, _metal.setProperties)(proxy, {\n          content: value,\n          isFulfilled: true\n        });\n      }\n\n      return value;\n    }, reason => {\n      if (!proxy.isDestroyed && !proxy.isDestroying) {\n        (0, _metal.setProperties)(proxy, {\n          reason,\n          isRejected: true\n        });\n      }\n\n      throw reason;\n    }, 'Ember: PromiseProxy');\n  }\n  /**\n    A low level mixin making ObjectProxy promise-aware.\n  \n    ```javascript\n    import { resolve } from 'rsvp';\n    import $ from 'jquery';\n    import ObjectProxy from '@ember/object/proxy';\n    import PromiseProxyMixin from '@ember/object/promise-proxy-mixin';\n  \n    let ObjectPromiseProxy = ObjectProxy.extend(PromiseProxyMixin);\n  \n    let proxy = ObjectPromiseProxy.create({\n      promise: resolve($.getJSON('/some/remote/data.json'))\n    });\n  \n    proxy.then(function(json){\n       // the json\n    }, function(reason) {\n       // the reason why you have no json\n    });\n    ```\n  \n    the proxy has bindable attributes which\n    track the promises life cycle\n  \n    ```javascript\n    proxy.get('isPending')   //=> true\n    proxy.get('isSettled')  //=> false\n    proxy.get('isRejected')  //=> false\n    proxy.get('isFulfilled') //=> false\n    ```\n  \n    When the $.getJSON completes, and the promise is fulfilled\n    with json, the life cycle attributes will update accordingly.\n    Note that $.getJSON doesn't return an ECMA specified promise,\n    it is useful to wrap this with an `RSVP.resolve` so that it behaves\n    as a spec compliant promise.\n  \n    ```javascript\n    proxy.get('isPending')   //=> false\n    proxy.get('isSettled')   //=> true\n    proxy.get('isRejected')  //=> false\n    proxy.get('isFulfilled') //=> true\n    ```\n  \n    As the proxy is an ObjectProxy, and the json now its content,\n    all the json properties will be available directly from the proxy.\n  \n    ```javascript\n    // Assuming the following json:\n    {\n      firstName: 'Stefan',\n      lastName: 'Penner'\n    }\n  \n    // both properties will accessible on the proxy\n    proxy.get('firstName') //=> 'Stefan'\n    proxy.get('lastName')  //=> 'Penner'\n    ```\n  \n    @class PromiseProxyMixin\n    @public\n  */\n\n\n  var _default = _metal.Mixin.create({\n    /**\n      If the proxied promise is rejected this will contain the reason\n      provided.\n       @property reason\n      @default null\n      @public\n    */\n    reason: null,\n\n    /**\n      Once the proxied promise has settled this will become `false`.\n       @property isPending\n      @default true\n      @public\n    */\n    isPending: (0, _metal.computed)('isSettled', function () {\n      return !(0, _metal.get)(this, 'isSettled');\n    }).readOnly(),\n\n    /**\n      Once the proxied promise has settled this will become `true`.\n       @property isSettled\n      @default false\n      @public\n    */\n    isSettled: (0, _metal.computed)('isRejected', 'isFulfilled', function () {\n      return (0, _metal.get)(this, 'isRejected') || (0, _metal.get)(this, 'isFulfilled');\n    }).readOnly(),\n\n    /**\n      Will become `true` if the proxied promise is rejected.\n       @property isRejected\n      @default false\n      @public\n    */\n    isRejected: false,\n\n    /**\n      Will become `true` if the proxied promise is fulfilled.\n       @property isFulfilled\n      @default false\n      @public\n    */\n    isFulfilled: false,\n\n    /**\n      The promise whose fulfillment value is being proxied by this object.\n       This property must be specified upon creation, and should not be\n      changed once created.\n       Example:\n       ```javascript\n      import ObjectProxy from '@ember/object/proxy';\n      import PromiseProxyMixin from '@ember/object/promise-proxy-mixin';\n       ObjectProxy.extend(PromiseProxyMixin).create({\n        promise: <thenable>\n      });\n      ```\n       @property promise\n      @public\n    */\n    promise: (0, _metal.computed)({\n      get() {\n        throw new _error.default(\"PromiseProxy's promise must be set\");\n      },\n\n      set(key, promise) {\n        return tap(this, promise);\n      }\n\n    }),\n\n    /**\n      An alias to the proxied promise's `then`.\n       See RSVP.Promise.then.\n       @method then\n      @param {Function} callback\n      @return {RSVP.Promise}\n      @public\n    */\n    then: promiseAlias('then'),\n\n    /**\n      An alias to the proxied promise's `catch`.\n       See RSVP.Promise.catch.\n       @method catch\n      @param {Function} callback\n      @return {RSVP.Promise}\n      @since 1.3.0\n      @public\n    */\n    catch: promiseAlias('catch'),\n\n    /**\n      An alias to the proxied promise's `finally`.\n       See RSVP.Promise.finally.\n       @method finally\n      @param {Function} callback\n      @return {RSVP.Promise}\n      @since 1.3.0\n      @public\n    */\n    finally: promiseAlias('finally')\n  });\n\n  _exports.default = _default;\n\n  function promiseAlias(name) {\n    return function () {\n      var promise = (0, _metal.get)(this, 'promise');\n      return promise[name](...arguments);\n    };\n  }\n});","define(\"@ember/-internals/runtime/lib/mixins/registry_proxy\", [\"exports\", \"@ember/debug\", \"@ember/-internals/metal\"], function (_exports, _debug, _metal) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n  @module ember\n  */\n\n  /**\n    RegistryProxyMixin is used to provide public access to specific\n    registry functionality.\n  \n    @class RegistryProxyMixin\n    @private\n  */\n  var _default = _metal.Mixin.create({\n    __registry__: null,\n\n    /**\n     Given a fullName return the corresponding factory.\n      @public\n     @method resolveRegistration\n     @param {String} fullName\n     @return {Function} fullName's factory\n     */\n    resolveRegistration(fullName, options) {\n      (true && !(this.__registry__.isValidFullName(fullName)) && (0, _debug.assert)('fullName must be a proper full name', this.__registry__.isValidFullName(fullName)));\n      return this.__registry__.resolve(fullName, options);\n    },\n\n    /**\n      Registers a factory that can be used for dependency injection (with\n      `inject`) or for service lookup. Each factory is registered with\n      a full name including two parts: `type:name`.\n       A simple example:\n       ```javascript\n      import Application from '@ember/application';\n      import EmberObject from '@ember/object';\n       let App = Application.create();\n       App.Orange = EmberObject.extend();\n      App.register('fruit:favorite', App.Orange);\n      ```\n       Ember will resolve factories from the `App` namespace automatically.\n      For example `App.CarsController` will be discovered and returned if\n      an application requests `controller:cars`.\n       An example of registering a controller with a non-standard name:\n       ```javascript\n      import Application from '@ember/application';\n      import Controller from '@ember/controller';\n       let App = Application.create();\n      let Session = Controller.extend();\n       App.register('controller:session', Session);\n       // The Session controller can now be treated like a normal controller,\n      // despite its non-standard name.\n      App.ApplicationController = Controller.extend({\n        needs: ['session']\n      });\n      ```\n       Registered factories are **instantiated** by having `create`\n      called on them. Additionally they are **singletons**, each time\n      they are looked up they return the same instance.\n       Some examples modifying that default behavior:\n       ```javascript\n      import Application from '@ember/application';\n      import EmberObject from '@ember/object';\n       let App = Application.create();\n       App.Person = EmberObject.extend();\n      App.Orange = EmberObject.extend();\n      App.Email = EmberObject.extend();\n      App.session = EmberObject.create();\n       App.register('model:user', App.Person, { singleton: false });\n      App.register('fruit:favorite', App.Orange);\n      App.register('communication:main', App.Email, { singleton: false });\n      App.register('session', App.session, { instantiate: false });\n      ```\n       @method register\n      @param  fullName {String} type:name (e.g., 'model:user')\n      @param  factory {any} (e.g., App.Person)\n      @param  options {Object} (optional) disable instantiation or singleton usage\n      @public\n     */\n    register: registryAlias('register'),\n\n    /**\n     Unregister a factory.\n      ```javascript\n     import Application from '@ember/application';\n     import EmberObject from '@ember/object';\n      let App = Application.create();\n     let User = EmberObject.extend();\n     App.register('model:user', User);\n      App.resolveRegistration('model:user').create() instanceof User //=> true\n      App.unregister('model:user')\n     App.resolveRegistration('model:user') === undefined //=> true\n     ```\n      @public\n     @method unregister\n     @param {String} fullName\n     */\n    unregister: registryAlias('unregister'),\n\n    /**\n     Check if a factory is registered.\n      @public\n     @method hasRegistration\n     @param {String} fullName\n     @return {Boolean}\n     */\n    hasRegistration: registryAlias('has'),\n\n    /**\n     Return a specific registered option for a particular factory.\n      @public\n     @method registeredOption\n     @param  {String} fullName\n     @param  {String} optionName\n     @return {Object} options\n     */\n    registeredOption: registryAlias('getOption'),\n\n    /**\n     Register options for a particular factory.\n      @public\n     @method registerOptions\n     @param {String} fullName\n     @param {Object} options\n     */\n    registerOptions: registryAlias('options'),\n\n    /**\n     Return registered options for a particular factory.\n      @public\n     @method registeredOptions\n     @param  {String} fullName\n     @return {Object} options\n     */\n    registeredOptions: registryAlias('getOptions'),\n\n    /**\n     Allow registering options for all factories of a type.\n      ```javascript\n     import Application from '@ember/application';\n      let App = Application.create();\n     let appInstance = App.buildInstance();\n      // if all of type `connection` must not be singletons\n     appInstance.registerOptionsForType('connection', { singleton: false });\n      appInstance.register('connection:twitter', TwitterConnection);\n     appInstance.register('connection:facebook', FacebookConnection);\n      let twitter = appInstance.lookup('connection:twitter');\n     let twitter2 = appInstance.lookup('connection:twitter');\n      twitter === twitter2; // => false\n      let facebook = appInstance.lookup('connection:facebook');\n     let facebook2 = appInstance.lookup('connection:facebook');\n      facebook === facebook2; // => false\n     ```\n      @public\n     @method registerOptionsForType\n     @param {String} type\n     @param {Object} options\n     */\n    registerOptionsForType: registryAlias('optionsForType'),\n\n    /**\n     Return the registered options for all factories of a type.\n      @public\n     @method registeredOptionsForType\n     @param {String} type\n     @return {Object} options\n     */\n    registeredOptionsForType: registryAlias('getOptionsForType'),\n\n    /**\n      Define a dependency injection onto a specific factory or all factories\n      of a type.\n       When Ember instantiates a controller, view, or other framework component\n      it can attach a dependency to that component. This is often used to\n      provide services to a set of framework components.\n       An example of providing a session object to all controllers:\n       ```javascript\n      import { alias } from '@ember/object/computed';\n      import Application from '@ember/application';\n      import Controller from '@ember/controller';\n      import EmberObject from '@ember/object';\n       let App = Application.create();\n      let Session = EmberObject.extend({ isAuthenticated: false });\n       // A factory must be registered before it can be injected\n      App.register('session:main', Session);\n       // Inject 'session:main' onto all factories of the type 'controller'\n      // with the name 'session'\n      App.inject('controller', 'session', 'session:main');\n       App.IndexController = Controller.extend({\n        isLoggedIn: alias('session.isAuthenticated')\n      });\n      ```\n       Injections can also be performed on specific factories.\n       ```javascript\n      App.inject(<full_name or type>, <property name>, <full_name>)\n      App.inject('route', 'source', 'source:main')\n      App.inject('route:application', 'email', 'model:email')\n      ```\n       It is important to note that injections can only be performed on\n      classes that are instantiated by Ember itself. Instantiating a class\n      directly (via `create` or `new`) bypasses the dependency injection\n      system.\n       @public\n      @method inject\n      @param  factoryNameOrType {String}\n      @param  property {String}\n      @param  injectionName {String}\n    **/\n    inject: registryAlias('injection')\n  });\n\n  _exports.default = _default;\n\n  function registryAlias(name) {\n    return function () {\n      return this.__registry__[name](...arguments);\n    };\n  }\n});","define(\"@ember/-internals/runtime/lib/mixins/target_action_support\", [\"exports\", \"@ember/-internals/environment\", \"@ember/-internals/metal\", \"@ember/debug\"], function (_exports, _environment, _metal, _debug) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n  @module ember\n  */\n\n  /**\n  `Ember.TargetActionSupport` is a mixin that can be included in a class\n  to add a `triggerAction` method with semantics similar to the Handlebars\n  `{{action}}` helper. In normal Ember usage, the `{{action}}` helper is\n  usually the best choice. This mixin is most often useful when you are\n  doing more complex event handling in Components.\n  \n  @class TargetActionSupport\n  @namespace Ember\n  @extends Mixin\n  @private\n  */\n  var _default = _metal.Mixin.create({\n    target: null,\n    action: null,\n    actionContext: null,\n    actionContextObject: (0, _metal.computed)('actionContext', function () {\n      var actionContext = (0, _metal.get)(this, 'actionContext');\n\n      if (typeof actionContext === 'string') {\n        var value = (0, _metal.get)(this, actionContext);\n\n        if (value === undefined) {\n          value = (0, _metal.get)(_environment.context.lookup, actionContext);\n        }\n\n        return value;\n      } else {\n        return actionContext;\n      }\n    }),\n\n    /**\n    Send an `action` with an `actionContext` to a `target`. The action, actionContext\n    and target will be retrieved from properties of the object. For example:\n     ```javascript\n    import { alias } from '@ember/object/computed';\n     App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n      target: alias('controller'),\n      action: 'save',\n      actionContext: alias('context'),\n      click() {\n        this.triggerAction(); // Sends the `save` action, along with the current context\n                              // to the current controller\n      }\n    });\n    ```\n     The `target`, `action`, and `actionContext` can be provided as properties of\n    an optional object argument to `triggerAction` as well.\n     ```javascript\n    App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n      click() {\n        this.triggerAction({\n          action: 'save',\n          target: this.get('controller'),\n          actionContext: this.get('context')\n        }); // Sends the `save` action, along with the current context\n            // to the current controller\n      }\n    });\n    ```\n     The `actionContext` defaults to the object you are mixing `TargetActionSupport` into.\n    But `target` and `action` must be specified either as properties or with the argument\n    to `triggerAction`, or a combination:\n     ```javascript\n    import { alias } from '@ember/object/computed';\n     App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n      target: alias('controller'),\n      click() {\n        this.triggerAction({\n          action: 'save'\n        }); // Sends the `save` action, along with a reference to `this`,\n            // to the current controller\n      }\n    });\n    ```\n     @method triggerAction\n    @param opts {Object} (optional, with the optional keys action, target and/or actionContext)\n    @return {Boolean} true if the action was sent successfully and did not return false\n    @private\n    */\n    triggerAction(opts = {}) {\n      var {\n        action,\n        target,\n        actionContext\n      } = opts;\n      action = action || (0, _metal.get)(this, 'action');\n      target = target || getTarget(this);\n\n      if (actionContext === undefined) {\n        actionContext = (0, _metal.get)(this, 'actionContextObject') || this;\n      }\n\n      if (target && action) {\n        var ret;\n\n        if (target.send) {\n          ret = target.send(...[action].concat(actionContext));\n        } else {\n          (true && !(typeof target[action] === 'function') && (0, _debug.assert)(\"The action '\" + action + \"' did not exist on \" + target, typeof target[action] === 'function'));\n          ret = target[action](...[].concat(actionContext));\n        }\n\n        if (ret !== false) {\n          return true;\n        }\n      }\n\n      return false;\n    }\n\n  });\n\n  _exports.default = _default;\n\n  function getTarget(instance) {\n    var target = (0, _metal.get)(instance, 'target');\n\n    if (target) {\n      if (typeof target === 'string') {\n        var value = (0, _metal.get)(instance, target);\n\n        if (value === undefined) {\n          value = (0, _metal.get)(_environment.context.lookup, target);\n        }\n\n        return value;\n      } else {\n        return target;\n      }\n    }\n\n    if (instance._target) {\n      return instance._target;\n    }\n\n    return null;\n  }\n});","define(\"@ember/-internals/runtime/lib/system/array_proxy\", [\"exports\", \"@ember/-internals/metal\", \"@ember/-internals/runtime/lib/system/object\", \"@ember/-internals/runtime/lib/mixins/array\", \"@ember/debug\", \"@glimmer/reference\"], function (_exports, _metal, _object, _array, _debug, _reference) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n  @module @ember/array\n  */\n  var ARRAY_OBSERVER_MAPPING = {\n    willChange: '_arrangedContentArrayWillChange',\n    didChange: '_arrangedContentArrayDidChange'\n  };\n  /**\n    An ArrayProxy wraps any other object that implements `Array` and/or\n    `MutableArray,` forwarding all requests. This makes it very useful for\n    a number of binding use cases or other cases where being able to swap\n    out the underlying array is useful.\n  \n    A simple example of usage:\n  \n    ```javascript\n    import { A } from '@ember/array';\n    import ArrayProxy from '@ember/array/proxy';\n  \n    let pets = ['dog', 'cat', 'fish'];\n    let ap = ArrayProxy.create({ content: A(pets) });\n  \n    ap.get('firstObject');                        // 'dog'\n    ap.set('content', ['amoeba', 'paramecium']);\n    ap.get('firstObject');                        // 'amoeba'\n    ```\n  \n    This class can also be useful as a layer to transform the contents of\n    an array, as they are accessed. This can be done by overriding\n    `objectAtContent`:\n  \n    ```javascript\n    import { A } from '@ember/array';\n    import ArrayProxy from '@ember/array/proxy';\n  \n    let pets = ['dog', 'cat', 'fish'];\n    let ap = ArrayProxy.create({\n        content: A(pets),\n        objectAtContent: function(idx) {\n            return this.get('content').objectAt(idx).toUpperCase();\n        }\n    });\n  \n    ap.get('firstObject'); // . 'DOG'\n    ```\n  \n    When overriding this class, it is important to place the call to\n    `_super` *after* setting `content` so the internal observers have\n    a chance to fire properly:\n  \n    ```javascript\n    import { A } from '@ember/array';\n    import ArrayProxy from '@ember/array/proxy';\n  \n    export default ArrayProxy.extend({\n      init() {\n        this.set('content', A(['dog', 'cat', 'fish']));\n        this._super(...arguments);\n      }\n    });\n    ```\n  \n    @class ArrayProxy\n    @extends EmberObject\n    @uses MutableArray\n    @public\n  */\n\n  class ArrayProxy extends _object.default {\n    init() {\n      super.init(...arguments);\n      /*\n        `this._objectsDirtyIndex` determines which indexes in the `this._objects`\n        cache are dirty.\n         If `this._objectsDirtyIndex === -1` then no indexes are dirty.\n        Otherwise, an index `i` is dirty if `i >= this._objectsDirtyIndex`.\n         Calling `objectAt` with a dirty index will cause the `this._objects`\n        cache to be recomputed.\n      */\n\n      this._objectsDirtyIndex = 0;\n      this._objects = null;\n      this._lengthDirty = true;\n      this._length = 0;\n      this._arrangedContent = null;\n\n      if (true\n      /* EMBER_METAL_TRACKED_PROPERTIES */\n      ) {\n          this._arrangedContentIsUpdating = false;\n          this._arrangedContentTag = (0, _reference.combine)((0, _metal.getChainTagsForKey)(this, 'arrangedContent'));\n          this._arrangedContentRevision = (0, _reference.value)(this._arrangedContentTag);\n        }\n\n      this._addArrangedContentArrayObserver();\n    }\n\n    willDestroy() {\n      this._removeArrangedContentArrayObserver();\n    }\n    /**\n      The content array. Must be an object that implements `Array` and/or\n      `MutableArray.`\n       @property content\n      @type EmberArray\n      @public\n    */\n\n    /**\n      Should actually retrieve the object at the specified index from the\n      content. You can override this method in subclasses to transform the\n      content item to something new.\n       This method will only be called if content is non-`null`.\n       @method objectAtContent\n      @param {Number} idx The index to retrieve.\n      @return {Object} the value or undefined if none found\n      @public\n    */\n\n\n    objectAtContent(idx) {\n      return (0, _metal.objectAt)((0, _metal.get)(this, 'arrangedContent'), idx);\n    } // See additional docs for `replace` from `MutableArray`:\n    // https://api.emberjs.com/ember/release/classes/MutableArray/methods/replace?anchor=replace\n\n\n    replace(idx, amt, objects) {\n      (true && !((0, _metal.get)(this, 'arrangedContent') === (0, _metal.get)(this, 'content')) && (0, _debug.assert)('Mutating an arranged ArrayProxy is not allowed', (0, _metal.get)(this, 'arrangedContent') === (0, _metal.get)(this, 'content')));\n      this.replaceContent(idx, amt, objects);\n    }\n    /**\n      Should actually replace the specified objects on the content array.\n      You can override this method in subclasses to transform the content item\n      into something new.\n       This method will only be called if content is non-`null`.\n       @method replaceContent\n      @param {Number} idx The starting index\n      @param {Number} amt The number of items to remove from the content.\n      @param {EmberArray} objects Optional array of objects to insert or null if no\n        objects.\n      @return {void}\n      @public\n    */\n\n\n    replaceContent(idx, amt, objects) {\n      (0, _metal.get)(this, 'content').replace(idx, amt, objects);\n    } // Overriding objectAt is not supported.\n\n\n    objectAt(idx) {\n      if (true\n      /* EMBER_METAL_TRACKED_PROPERTIES */\n      ) {\n          this._revalidate();\n        }\n\n      if (this._objects === null) {\n        this._objects = [];\n      }\n\n      if (this._objectsDirtyIndex !== -1 && idx >= this._objectsDirtyIndex) {\n        var arrangedContent = (0, _metal.get)(this, 'arrangedContent');\n\n        if (arrangedContent) {\n          var length = this._objects.length = (0, _metal.get)(arrangedContent, 'length');\n\n          for (var i = this._objectsDirtyIndex; i < length; i++) {\n            this._objects[i] = this.objectAtContent(i);\n          }\n        } else {\n          this._objects.length = 0;\n        }\n\n        this._objectsDirtyIndex = -1;\n      }\n\n      return this._objects[idx];\n    } // Overriding length is not supported.\n\n\n    get length() {\n      if (true\n      /* EMBER_METAL_TRACKED_PROPERTIES */\n      ) {\n          this._revalidate();\n        }\n\n      if (this._lengthDirty) {\n        var arrangedContent = (0, _metal.get)(this, 'arrangedContent');\n        this._length = arrangedContent ? (0, _metal.get)(arrangedContent, 'length') : 0;\n        this._lengthDirty = false;\n      }\n\n      return this._length;\n    }\n\n    set length(value) {\n      var length = this.length;\n      var removedCount = length - value;\n      var added;\n\n      if (removedCount === 0) {\n        return;\n      } else if (removedCount < 0) {\n        added = new Array(-removedCount);\n        removedCount = 0;\n      }\n\n      var content = (0, _metal.get)(this, 'content');\n\n      if (content) {\n        (0, _metal.replace)(content, value, removedCount, added);\n\n        this._invalidate();\n      }\n    }\n\n    [_metal.PROPERTY_DID_CHANGE](key) {\n      if (true\n      /* EMBER_METAL_TRACKED_PROPERTIES */\n      ) {\n          this._revalidate();\n        } else {\n        if (key === 'arrangedContent') {\n          this._updateArrangedContentArray();\n        } else if (key === 'content') {\n          this._invalidate();\n        }\n      }\n    }\n\n    _updateArrangedContentArray() {\n      var oldLength = this._objects === null ? 0 : this._objects.length;\n      var arrangedContent = (0, _metal.get)(this, 'arrangedContent');\n      var newLength = arrangedContent ? (0, _metal.get)(arrangedContent, 'length') : 0;\n\n      this._removeArrangedContentArrayObserver();\n\n      this.arrayContentWillChange(0, oldLength, newLength);\n\n      this._invalidate();\n\n      this.arrayContentDidChange(0, oldLength, newLength);\n\n      this._addArrangedContentArrayObserver();\n    }\n\n    _addArrangedContentArrayObserver() {\n      var arrangedContent = (0, _metal.get)(this, 'arrangedContent');\n\n      if (arrangedContent && !arrangedContent.isDestroyed) {\n        (true && !(arrangedContent !== this) && (0, _debug.assert)(\"Can't set ArrayProxy's content to itself\", arrangedContent !== this));\n        (true && !((0, _array.isArray)(arrangedContent) || arrangedContent.isDestroyed) && (0, _debug.assert)(\"ArrayProxy expects an Array or ArrayProxy, but you passed \" + typeof arrangedContent, (0, _array.isArray)(arrangedContent) || arrangedContent.isDestroyed));\n        (0, _metal.addArrayObserver)(arrangedContent, this, ARRAY_OBSERVER_MAPPING);\n        this._arrangedContent = arrangedContent;\n      }\n    }\n\n    _removeArrangedContentArrayObserver() {\n      if (this._arrangedContent) {\n        (0, _metal.removeArrayObserver)(this._arrangedContent, this, ARRAY_OBSERVER_MAPPING);\n      }\n    }\n\n    _arrangedContentArrayWillChange() {}\n\n    _arrangedContentArrayDidChange(proxy, idx, removedCnt, addedCnt) {\n      this.arrayContentWillChange(idx, removedCnt, addedCnt);\n      var dirtyIndex = idx;\n\n      if (dirtyIndex < 0) {\n        var length = (0, _metal.get)(this._arrangedContent, 'length');\n        dirtyIndex += length + removedCnt - addedCnt;\n      }\n\n      if (this._objectsDirtyIndex === -1 || this._objectsDirtyIndex > dirtyIndex) {\n        this._objectsDirtyIndex = dirtyIndex;\n      }\n\n      this._lengthDirty = true;\n      this.arrayContentDidChange(idx, removedCnt, addedCnt);\n    }\n\n    _invalidate() {\n      this._objectsDirtyIndex = 0;\n      this._lengthDirty = true;\n    }\n\n  }\n\n  _exports.default = ArrayProxy;\n\n  var _revalidate;\n\n  if (true\n  /* EMBER_METAL_TRACKED_PROPERTIES */\n  ) {\n      _revalidate = function () {\n        if (!this._arrangedContentIsUpdating && !(0, _reference.validate)(this._arrangedContentTag, this._arrangedContentRevision)) {\n          this._arrangedContentIsUpdating = true;\n\n          this._updateArrangedContentArray();\n\n          this._arrangedContentIsUpdating = false;\n          this._arrangedContentTag = (0, _reference.combine)((0, _metal.getChainTagsForKey)(this, 'arrangedContent'));\n          this._arrangedContentRevision = (0, _reference.value)(this._arrangedContentTag);\n        }\n      };\n    }\n\n  ArrayProxy.reopen(_array.MutableArray, {\n    /**\n      The array that the proxy pretends to be. In the default `ArrayProxy`\n      implementation, this and `content` are the same. Subclasses of `ArrayProxy`\n      can override this property to provide things like sorting and filtering.\n       @property arrangedContent\n      @public\n    */\n    arrangedContent: (0, _metal.alias)('content'),\n    _revalidate\n  });\n});","define(\"@ember/-internals/runtime/lib/system/core_object\", [\"exports\", \"@ember/-internals/container\", \"@ember/-internals/owner\", \"@ember/polyfills\", \"@ember/-internals/utils\", \"@ember/runloop\", \"@ember/-internals/meta\", \"@ember/-internals/metal\", \"@ember/-internals/runtime/lib/mixins/action_handler\", \"@ember/debug\"], function (_exports, _container, _owner, _polyfills, _utils, _runloop, _meta2, _metal, _action_handler, _debug) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.setFrameworkClass = setFrameworkClass;\n  _exports.default = void 0;\n\n  /**\n    @module @ember/object\n  */\n  var reopen = _metal.Mixin.prototype.reopen;\n  var wasApplied = new _polyfills._WeakSet();\n  var factoryMap = new WeakMap();\n  var prototypeMixinMap = new WeakMap();\n  var initCalled = true\n  /* DEBUG */\n  ? new _polyfills._WeakSet() : undefined; // only used in debug builds to enable the proxy trap\n\n  var PASSED_FROM_CREATE = true\n  /* DEBUG */\n  ? (0, _utils.symbol)('PASSED_FROM_CREATE') : undefined;\n  var FRAMEWORK_CLASSES = (0, _utils.symbol)('FRAMEWORK_CLASS');\n\n  function setFrameworkClass(klass) {\n    klass[FRAMEWORK_CLASSES] = true;\n  }\n\n  function initialize(obj, properties) {\n    var m = (0, _meta2.meta)(obj);\n\n    if (properties !== undefined) {\n      (true && !(typeof properties === 'object' && properties !== null) && (0, _debug.assert)('EmberObject.create only accepts objects.', typeof properties === 'object' && properties !== null));\n      (true && !(!(properties instanceof _metal.Mixin)) && (0, _debug.assert)('EmberObject.create no longer supports mixing in other ' + 'definitions, use .extend & .create separately instead.', !(properties instanceof _metal.Mixin)));\n      var concatenatedProperties = obj.concatenatedProperties;\n      var mergedProperties = obj.mergedProperties;\n      var hasConcatenatedProps = concatenatedProperties !== undefined && concatenatedProperties.length > 0;\n      var hasMergedProps = mergedProperties !== undefined && mergedProperties.length > 0;\n      var keyNames = Object.keys(properties);\n\n      for (var i = 0; i < keyNames.length; i++) {\n        var keyName = keyNames[i];\n        var value = properties[keyName];\n        (true && !(!(0, _metal.isClassicDecorator)(value)) && (0, _debug.assert)('EmberObject.create no longer supports defining computed ' + 'properties. Define computed properties using extend() or reopen() ' + 'before calling create().', !(0, _metal.isClassicDecorator)(value)));\n        (true && !(!(typeof value === 'function' && value.toString().indexOf('._super') !== -1)) && (0, _debug.assert)('EmberObject.create no longer supports defining methods that call _super.', !(typeof value === 'function' && value.toString().indexOf('._super') !== -1)));\n        (true && !(!(keyName === 'actions' && _action_handler.default.detect(obj))) && (0, _debug.assert)('`actions` must be provided at extend time, not at create time, ' + 'when Ember.ActionHandler is used (i.e. views, controllers & routes).', !(keyName === 'actions' && _action_handler.default.detect(obj))));\n        var possibleDesc = (0, _metal.descriptorForProperty)(obj, keyName, m);\n        var isDescriptor = possibleDesc !== undefined;\n\n        if (!isDescriptor) {\n          var baseValue = obj[keyName];\n\n          if (hasConcatenatedProps && concatenatedProperties.indexOf(keyName) > -1) {\n            if (baseValue) {\n              value = (0, _utils.makeArray)(baseValue).concat(value);\n            } else {\n              value = (0, _utils.makeArray)(value);\n            }\n          }\n\n          if (hasMergedProps && mergedProperties.indexOf(keyName) > -1) {\n            value = (0, _polyfills.assign)({}, baseValue, value);\n          }\n        }\n\n        if (isDescriptor) {\n          possibleDesc.set(obj, keyName, value);\n        } else if (typeof obj.setUnknownProperty === 'function' && !(keyName in obj)) {\n          obj.setUnknownProperty(keyName, value);\n        } else {\n          if (true\n          /* DEBUG */\n          ) {\n            (0, _metal.defineProperty)(obj, keyName, null, value, m); // setup mandatory setter\n          } else {\n            obj[keyName] = value;\n          }\n        }\n      }\n    } // using DEBUG here to avoid the extraneous variable when not needed\n\n\n    if (true\n    /* DEBUG */\n    ) {\n      initCalled.add(obj);\n    }\n\n    obj.init(properties);\n    m.unsetInitializing();\n\n    if (true\n    /* EMBER_METAL_TRACKED_PROPERTIES */\n    ) {\n        var observerEvents = m.observerEvents();\n\n        if (observerEvents !== undefined) {\n          for (var _i = 0; _i < observerEvents.length; _i++) {\n            (0, _metal.activateObserver)(obj, observerEvents[_i].event, observerEvents[_i].sync);\n          }\n        }\n      } else {\n      // re-enable chains\n      (0, _metal.finishChains)(m);\n    }\n\n    (0, _metal.sendEvent)(obj, 'init', undefined, undefined, undefined, m);\n  }\n  /**\n    `CoreObject` is the base class for all Ember constructs. It establishes a\n    class system based on Ember's Mixin system, and provides the basis for the\n    Ember Object Model. `CoreObject` should generally not be used directly,\n    instead you should use `EmberObject`.\n  \n    ## Usage\n  \n    You can define a class by extending from `CoreObject` using the `extend`\n    method:\n  \n    ```js\n    const Person = CoreObject.extend({\n      name: 'Tomster',\n    });\n    ```\n  \n    For detailed usage, see the [Object Model](https://guides.emberjs.com/release/object-model/)\n    section of the guides.\n  \n    ## Usage with Native Classes\n  \n    Native JavaScript `class` syntax can be used to extend from any `CoreObject`\n    based class:\n  \n    ```js\n    class Person extends CoreObject {\n      init() {\n        super.init(...arguments);\n        this.name = 'Tomster';\n      }\n    }\n    ```\n  \n    Some notes about `class` usage:\n  \n    * `new` syntax is not currently supported with classes that extend from\n      `EmberObject` or `CoreObject`. You must continue to use the `create` method\n      when making new instances of classes, even if they are defined using native\n      class syntax. If you want to use `new` syntax, consider creating classes\n      which do _not_ extend from `EmberObject` or `CoreObject`. Ember features,\n      such as computed properties and decorators, will still work with base-less\n      classes.\n    * Instead of using `this._super()`, you must use standard `super` syntax in\n      native classes. See the [MDN docs on classes](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes#Super_class_calls_with_super)\n      for more details.\n    * Native classes support using [constructors](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes#Constructor)\n      to set up newly-created instances. Ember uses these to, among other things,\n      support features that need to retrieve other entities by name, like Service\n      injection and `getOwner`. To ensure your custom instance setup logic takes\n      place after this important work is done, avoid using the `constructor` in\n      favor of `init`.\n    * Properties passed to `create` will be available on the instance by the time\n      `init` runs, so any code that requires these values should work at that\n      time.\n    * Using native classes, and switching back to the old Ember Object model is\n      fully supported.\n  \n    @class CoreObject\n    @public\n  */\n\n\n  class CoreObject {\n    static _initFactory(factory) {\n      factoryMap.set(this, factory);\n    }\n\n    constructor(passedFromCreate) {\n      // pluck off factory\n      var initFactory = factoryMap.get(this.constructor);\n\n      if (initFactory !== undefined) {\n        factoryMap.delete(this.constructor);\n\n        _container.FACTORY_FOR.set(this, initFactory);\n      } // prepare prototype...\n\n\n      this.constructor.proto();\n      var self = this;\n\n      if (true\n      /* DEBUG */\n      && _utils.HAS_NATIVE_PROXY && typeof self.unknownProperty === 'function') {\n        var messageFor = (obj, property) => {\n          return \"You attempted to access the `\" + String(property) + \"` property (of \" + obj + \").\\n\" + \"Since Ember 3.1, this is usually fine as you no longer need to use `.get()`\\n\" + \"to access computed properties. However, in this case, the object in question\\n\" + \"is a special kind of Ember object (a proxy). Therefore, it is still necessary\\n\" + (\"to use `.get('\" + String(property) + \"')` in this case.\\n\\n\") + \"If you encountered this error because of third-party code that you don't control,\\n\" + \"there is more information at https://github.com/emberjs/ember.js/issues/16148, and\\n\" + \"you can help us improve this error message by telling us more about what happened in\\n\" + \"this situation.\";\n        };\n        /* globals Proxy Reflect */\n\n\n        self = new Proxy(this, {\n          get(target, property, receiver) {\n            if (property === _metal.PROXY_CONTENT) {\n              return target;\n            } else if ( // init called will be set on the proxy, not the target, so get with the receiver\n            !initCalled.has(receiver) || typeof property === 'symbol' || (0, _utils.isInternalSymbol)(property) || property === 'toJSON' || property === 'toString' || property === 'toStringExtension' || property === 'didDefineProperty' || property === 'willWatchProperty' || property === 'didUnwatchProperty' || property === 'didAddListener' || property === 'didRemoveListener' || property === 'isDescriptor' || property === '_onLookup' || property in target) {\n              return Reflect.get(target, property, receiver);\n            }\n\n            var value = target.unknownProperty.call(receiver, property);\n\n            if (typeof value !== 'function') {\n              (true && !(value === undefined || value === null) && (0, _debug.assert)(messageFor(receiver, property), value === undefined || value === null));\n            }\n          }\n\n        });\n\n        _container.FACTORY_FOR.set(self, initFactory);\n      } // disable chains\n\n\n      var m = (0, _meta2.meta)(self);\n      m.setInitializing();\n      (true && !((() => {\n        if (passedFromCreate === PASSED_FROM_CREATE) {\n          return true;\n        }\n\n        if (initFactory === undefined) {\n          return false;\n        }\n\n        if (passedFromCreate === initFactory.owner) {\n          return true;\n        }\n\n        return false;\n      })()) && (0, _debug.assert)(\"An EmberObject based class, \" + this.constructor + \", was not instantiated correctly. You may have either used `new` instead of `.create()`, or not passed arguments to your call to super in the constructor: `super(...arguments)`. If you are trying to use `new`, consider using native classes without extending from EmberObject.\", (() => {\n        if (passedFromCreate === PASSED_FROM_CREATE) {\n          return true;\n        }\n\n        if (initFactory === undefined) {\n          return false;\n        }\n\n        if (passedFromCreate === initFactory.owner) {\n          return true;\n        }\n\n        return false;\n      })())); // only return when in debug builds and `self` is the proxy created above\n\n      if (true\n      /* DEBUG */\n      && self !== this) {\n        return self;\n      }\n    }\n\n    reopen(...args) {\n      (0, _metal.applyMixin)(this, args);\n      return this;\n    }\n    /**\n      An overridable method called when objects are instantiated. By default,\n      does nothing unless it is overridden during class definition.\n       Example:\n       ```javascript\n      import EmberObject from '@ember/object';\n       const Person = EmberObject.extend({\n        init() {\n          alert(`Name is ${this.get('name')}`);\n        }\n      });\n       let steve = Person.create({\n        name: 'Steve'\n      });\n       // alerts 'Name is Steve'.\n      ```\n       NOTE: If you do override `init` for a framework class like `Ember.View`,\n      be sure to call `this._super(...arguments)` in your\n      `init` declaration! If you don't, Ember may not have an opportunity to\n      do important setup work, and you'll see strange behavior in your\n      application.\n       @method init\n      @public\n    */\n\n\n    init() {}\n    /**\n      Defines the properties that will be concatenated from the superclass\n      (instead of overridden).\n       By default, when you extend an Ember class a property defined in\n      the subclass overrides a property with the same name that is defined\n      in the superclass. However, there are some cases where it is preferable\n      to build up a property's value by combining the superclass' property\n      value with the subclass' value. An example of this in use within Ember\n      is the `classNames` property of `Ember.View`.\n       Here is some sample code showing the difference between a concatenated\n      property and a normal one:\n       ```javascript\n      import EmberObject from '@ember/object';\n       const Bar = EmberObject.extend({\n        // Configure which properties to concatenate\n        concatenatedProperties: ['concatenatedProperty'],\n         someNonConcatenatedProperty: ['bar'],\n        concatenatedProperty: ['bar']\n      });\n       const FooBar = Bar.extend({\n        someNonConcatenatedProperty: ['foo'],\n        concatenatedProperty: ['foo']\n      });\n       let fooBar = FooBar.create();\n      fooBar.get('someNonConcatenatedProperty'); // ['foo']\n      fooBar.get('concatenatedProperty'); // ['bar', 'foo']\n      ```\n       This behavior extends to object creation as well. Continuing the\n      above example:\n       ```javascript\n      let fooBar = FooBar.create({\n        someNonConcatenatedProperty: ['baz'],\n        concatenatedProperty: ['baz']\n      })\n      fooBar.get('someNonConcatenatedProperty'); // ['baz']\n      fooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']\n      ```\n       Adding a single property that is not an array will just add it in the array:\n       ```javascript\n      let fooBar = FooBar.create({\n        concatenatedProperty: 'baz'\n      })\n      view.get('concatenatedProperty'); // ['bar', 'foo', 'baz']\n      ```\n       Using the `concatenatedProperties` property, we can tell Ember to mix the\n      content of the properties.\n       In `Component` the `classNames`, `classNameBindings` and\n      `attributeBindings` properties are concatenated.\n       This feature is available for you to use throughout the Ember object model,\n      although typical app developers are likely to use it infrequently. Since\n      it changes expectations about behavior of properties, you should properly\n      document its usage in each individual concatenated property (to not\n      mislead your users to think they can override the property in a subclass).\n       @property concatenatedProperties\n      @type Array\n      @default null\n      @public\n    */\n\n    /**\n      Defines the properties that will be merged from the superclass\n      (instead of overridden).\n       By default, when you extend an Ember class a property defined in\n      the subclass overrides a property with the same name that is defined\n      in the superclass. However, there are some cases where it is preferable\n      to build up a property's value by merging the superclass property value\n      with the subclass property's value. An example of this in use within Ember\n      is the `queryParams` property of routes.\n       Here is some sample code showing the difference between a merged\n      property and a normal one:\n       ```javascript\n      import EmberObject from '@ember/object';\n       const Bar = EmberObject.extend({\n        // Configure which properties are to be merged\n        mergedProperties: ['mergedProperty'],\n         someNonMergedProperty: {\n          nonMerged: 'superclass value of nonMerged'\n        },\n        mergedProperty: {\n          page: { replace: false },\n          limit: { replace: true }\n        }\n      });\n       const FooBar = Bar.extend({\n        someNonMergedProperty: {\n          completelyNonMerged: 'subclass value of nonMerged'\n        },\n        mergedProperty: {\n          limit: { replace: false }\n        }\n      });\n       let fooBar = FooBar.create();\n       fooBar.get('someNonMergedProperty');\n      // => { completelyNonMerged: 'subclass value of nonMerged' }\n      //\n      // Note the entire object, including the nonMerged property of\n      // the superclass object, has been replaced\n       fooBar.get('mergedProperty');\n      // => {\n      //   page: {replace: false},\n      //   limit: {replace: false}\n      // }\n      //\n      // Note the page remains from the superclass, and the\n      // `limit` property's value of `false` has been merged from\n      // the subclass.\n      ```\n       This behavior is not available during object `create` calls. It is only\n      available at `extend` time.\n       In `Route` the `queryParams` property is merged.\n       This feature is available for you to use throughout the Ember object model,\n      although typical app developers are likely to use it infrequently. Since\n      it changes expectations about behavior of properties, you should properly\n      document its usage in each individual merged property (to not\n      mislead your users to think they can override the property in a subclass).\n       @property mergedProperties\n      @type Array\n      @default null\n      @public\n    */\n\n    /**\n      Destroyed object property flag.\n       if this property is `true` the observers and bindings were already\n      removed by the effect of calling the `destroy()` method.\n       @property isDestroyed\n      @default false\n      @public\n    */\n\n\n    get isDestroyed() {\n      return (0, _meta2.peekMeta)(this).isSourceDestroyed();\n    }\n\n    set isDestroyed(value) {\n      (true && !(false) && (0, _debug.assert)(\"You cannot set `\" + this + \".isDestroyed` directly, please use `.destroy()`.\", false));\n    }\n    /**\n      Destruction scheduled flag. The `destroy()` method has been called.\n       The object stays intact until the end of the run loop at which point\n      the `isDestroyed` flag is set.\n       @property isDestroying\n      @default false\n      @public\n    */\n\n\n    get isDestroying() {\n      return (0, _meta2.peekMeta)(this).isSourceDestroying();\n    }\n\n    set isDestroying(value) {\n      (true && !(false) && (0, _debug.assert)(\"You cannot set `\" + this + \".isDestroying` directly, please use `.destroy()`.\", false));\n    }\n    /**\n      Destroys an object by setting the `isDestroyed` flag and removing its\n      metadata, which effectively destroys observers and bindings.\n       If you try to set a property on a destroyed object, an exception will be\n      raised.\n       Note that destruction is scheduled for the end of the run loop and does not\n      happen immediately.  It will set an isDestroying flag immediately.\n       @method destroy\n      @return {EmberObject} receiver\n      @public\n    */\n\n\n    destroy() {\n      var m = (0, _meta2.peekMeta)(this);\n\n      if (m.isSourceDestroying()) {\n        return;\n      }\n\n      m.setSourceDestroying();\n      (0, _runloop.schedule)('actions', this, this.willDestroy);\n      (0, _runloop.schedule)('destroy', this, this._scheduledDestroy, m);\n      return this;\n    }\n    /**\n      Override to implement teardown.\n       @method willDestroy\n      @public\n    */\n\n\n    willDestroy() {}\n    /**\n      Invoked by the run loop to actually destroy the object. This is\n      scheduled for execution by the `destroy` method.\n       @private\n      @method _scheduledDestroy\n    */\n\n\n    _scheduledDestroy(m) {\n      if (m.isSourceDestroyed()) {\n        return;\n      }\n\n      (0, _meta2.deleteMeta)(this);\n      m.setSourceDestroyed();\n    }\n    /**\n      Returns a string representation which attempts to provide more information\n      than Javascript's `toString` typically does, in a generic way for all Ember\n      objects.\n       ```javascript\n      import EmberObject from '@ember/object';\n       const Person = EmberObject.extend();\n      person = Person.create();\n      person.toString(); //=> \"<Person:ember1024>\"\n      ```\n       If the object's class is not defined on an Ember namespace, it will\n      indicate it is a subclass of the registered superclass:\n       ```javascript\n      const Student = Person.extend();\n      let student = Student.create();\n      student.toString(); //=> \"<(subclass of Person):ember1025>\"\n      ```\n       If the method `toStringExtension` is defined, its return value will be\n      included in the output.\n       ```javascript\n      const Teacher = Person.extend({\n        toStringExtension() {\n          return this.get('fullName');\n        }\n      });\n      teacher = Teacher.create();\n      teacher.toString(); //=> \"<Teacher:ember1026:Tom Dale>\"\n      ```\n       @method toString\n      @return {String} string representation\n      @public\n    */\n\n\n    toString() {\n      var hasToStringExtension = typeof this.toStringExtension === 'function';\n      var extension = hasToStringExtension ? \":\" + this.toStringExtension() : '';\n      var ret = \"<\" + ((0, _utils.getName)(this) || _container.FACTORY_FOR.get(this) || this.constructor.toString()) + \":\" + (0, _utils.guidFor)(this) + extension + \">\";\n      return ret;\n    }\n    /**\n      Creates a new subclass.\n       ```javascript\n      import EmberObject from '@ember/object';\n       const Person = EmberObject.extend({\n        say(thing) {\n          alert(thing);\n         }\n      });\n      ```\n       This defines a new subclass of EmberObject: `Person`. It contains one method: `say()`.\n       You can also create a subclass from any existing class by calling its `extend()` method.\n      For example, you might want to create a subclass of Ember's built-in `Component` class:\n       ```javascript\n      import Component from '@ember/component';\n       const PersonComponent = Component.extend({\n        tagName: 'li',\n        classNameBindings: ['isAdministrator']\n      });\n      ```\n       When defining a subclass, you can override methods but still access the\n      implementation of your parent class by calling the special `_super()` method:\n       ```javascript\n      import EmberObject from '@ember/object';\n       const Person = EmberObject.extend({\n        say(thing) {\n          let name = this.get('name');\n          alert(`${name} says: ${thing}`);\n        }\n      });\n       const Soldier = Person.extend({\n        say(thing) {\n          this._super(`${thing}, sir!`);\n        },\n        march(numberOfHours) {\n          alert(`${this.get('name')} marches for ${numberOfHours} hours.`);\n        }\n      });\n       let yehuda = Soldier.create({\n        name: 'Yehuda Katz'\n      });\n       yehuda.say('Yes');  // alerts \"Yehuda Katz says: Yes, sir!\"\n      ```\n       The `create()` on line #17 creates an *instance* of the `Soldier` class.\n      The `extend()` on line #8 creates a *subclass* of `Person`. Any instance\n      of the `Person` class will *not* have the `march()` method.\n       You can also pass `Mixin` classes to add additional properties to the subclass.\n       ```javascript\n      import EmberObject from '@ember/object';\n      import Mixin from '@ember/object/mixin';\n       const Person = EmberObject.extend({\n        say(thing) {\n          alert(`${this.get('name')} says: ${thing}`);\n        }\n      });\n       const SingingMixin = Mixin.create({\n        sing(thing) {\n          alert(`${this.get('name')} sings: la la la ${thing}`);\n        }\n      });\n       const BroadwayStar = Person.extend(SingingMixin, {\n        dance() {\n          alert(`${this.get('name')} dances: tap tap tap tap `);\n        }\n      });\n      ```\n       The `BroadwayStar` class contains three methods: `say()`, `sing()`, and `dance()`.\n       @method extend\n      @static\n      @for @ember/object\n      @param {Mixin} [mixins]* One or more Mixin classes\n      @param {Object} [arguments]* Object containing values to use within the new class\n      @public\n    */\n\n\n    static extend() {\n      var Class = class extends this {};\n      reopen.apply(Class.PrototypeMixin, arguments);\n      return Class;\n    }\n    /**\n      Creates an instance of a class. Accepts either no arguments, or an object\n      containing values to initialize the newly instantiated object with.\n       ```javascript\n      import EmberObject from '@ember/object';\n       const Person = EmberObject.extend({\n        helloWorld() {\n          alert(`Hi, my name is ${this.get('name')}`);\n        }\n      });\n       let tom = Person.create({\n        name: 'Tom Dale'\n      });\n       tom.helloWorld(); // alerts \"Hi, my name is Tom Dale\".\n      ```\n       `create` will call the `init` function if defined during\n      `AnyObject.extend`\n       If no arguments are passed to `create`, it will not set values to the new\n      instance during initialization:\n       ```javascript\n      let noName = Person.create();\n      noName.helloWorld(); // alerts undefined\n      ```\n       NOTE: For performance reasons, you cannot declare methods or computed\n      properties during `create`. You should instead declare methods and computed\n      properties when using `extend`.\n       @method create\n      @for @ember/object\n      @static\n      @param [arguments]*\n      @public\n    */\n\n\n    static create(props, extra) {\n      var C = this;\n      var instance;\n\n      if (this[FRAMEWORK_CLASSES]) {\n        var initFactory = factoryMap.get(this);\n        var owner;\n\n        if (initFactory !== undefined) {\n          owner = initFactory.owner;\n        } else if (props !== undefined) {\n          owner = (0, _owner.getOwner)(props);\n        }\n\n        if (owner === undefined) {\n          // fallback to passing the special PASSED_FROM_CREATE symbol\n          // to avoid an error when folks call things like Controller.extend().create()\n          // we should do a subsequent deprecation pass to ensure this isn't allowed\n          owner = PASSED_FROM_CREATE;\n        }\n\n        instance = new C(owner);\n      } else {\n        instance = true\n        /* DEBUG */\n        ? new C(PASSED_FROM_CREATE) : new C();\n      }\n\n      if (extra === undefined) {\n        initialize(instance, props);\n      } else {\n        initialize(instance, flattenProps.apply(this, arguments));\n      }\n\n      return instance;\n    }\n    /**\n      Augments a constructor's prototype with additional\n      properties and functions:\n       ```javascript\n      import EmberObject from '@ember/object';\n       const MyObject = EmberObject.extend({\n        name: 'an object'\n      });\n       o = MyObject.create();\n      o.get('name'); // 'an object'\n       MyObject.reopen({\n        say(msg) {\n          console.log(msg);\n        }\n      });\n       o2 = MyObject.create();\n      o2.say('hello'); // logs \"hello\"\n       o.say('goodbye'); // logs \"goodbye\"\n      ```\n       To add functions and properties to the constructor itself,\n      see `reopenClass`\n       @method reopen\n      @for @ember/object\n      @static\n      @public\n    */\n\n\n    static reopen() {\n      this.willReopen();\n      reopen.apply(this.PrototypeMixin, arguments);\n      return this;\n    }\n\n    static willReopen() {\n      var p = this.prototype;\n\n      if (wasApplied.has(p)) {\n        wasApplied.delete(p); // If the base mixin already exists and was applied, create a new mixin to\n        // make sure that it gets properly applied. Reusing the same mixin after\n        // the first `proto` call will cause it to get skipped.\n\n        if (prototypeMixinMap.has(this)) {\n          prototypeMixinMap.set(this, _metal.Mixin.create(this.PrototypeMixin));\n        }\n      }\n    }\n    /**\n      Augments a constructor's own properties and functions:\n       ```javascript\n      import EmberObject from '@ember/object';\n       const MyObject = EmberObject.extend({\n        name: 'an object'\n      });\n       MyObject.reopenClass({\n        canBuild: false\n      });\n       MyObject.canBuild; // false\n      o = MyObject.create();\n      ```\n       In other words, this creates static properties and functions for the class.\n      These are only available on the class and not on any instance of that class.\n       ```javascript\n      import EmberObject from '@ember/object';\n       const Person = EmberObject.extend({\n        name: '',\n        sayHello() {\n          alert(`Hello. My name is ${this.get('name')}`);\n        }\n      });\n       Person.reopenClass({\n        species: 'Homo sapiens',\n         createPerson(name) {\n          return Person.create({ name });\n        }\n      });\n       let tom = Person.create({\n        name: 'Tom Dale'\n      });\n      let yehuda = Person.createPerson('Yehuda Katz');\n       tom.sayHello(); // \"Hello. My name is Tom Dale\"\n      yehuda.sayHello(); // \"Hello. My name is Yehuda Katz\"\n      alert(Person.species); // \"Homo sapiens\"\n      ```\n       Note that `species` and `createPerson` are *not* valid on the `tom` and `yehuda`\n      variables. They are only valid on `Person`.\n       To add functions and properties to instances of\n      a constructor by extending the constructor's prototype\n      see `reopen`\n       @method reopenClass\n      @for @ember/object\n      @static\n      @public\n    */\n\n\n    static reopenClass() {\n      (0, _metal.applyMixin)(this, arguments);\n      return this;\n    }\n\n    static detect(obj) {\n      if ('function' !== typeof obj) {\n        return false;\n      }\n\n      while (obj) {\n        if (obj === this) {\n          return true;\n        }\n\n        obj = obj.superclass;\n      }\n\n      return false;\n    }\n\n    static detectInstance(obj) {\n      return obj instanceof this;\n    }\n    /**\n      In some cases, you may want to annotate computed properties with additional\n      metadata about how they function or what values they operate on. For\n      example, computed property functions may close over variables that are then\n      no longer available for introspection.\n       You can pass a hash of these values to a computed property like this:\n       ```javascript\n      import { computed } from '@ember/object';\n       person: computed(function() {\n        let personId = this.get('personId');\n        return Person.create({ id: personId });\n      }).meta({ type: Person })\n      ```\n       Once you've done this, you can retrieve the values saved to the computed\n      property from your class like this:\n       ```javascript\n      MyClass.metaForProperty('person');\n      ```\n       This will return the original hash that was passed to `meta()`.\n       @static\n      @method metaForProperty\n      @param key {String} property name\n      @private\n    */\n\n\n    static metaForProperty(key) {\n      var proto = this.proto(); // ensure prototype is initialized\n\n      var possibleDesc = (0, _metal.descriptorForProperty)(proto, key);\n      (true && !(possibleDesc !== undefined) && (0, _debug.assert)(\"metaForProperty() could not find a computed property with key '\" + key + \"'.\", possibleDesc !== undefined));\n      return possibleDesc._meta || {};\n    }\n    /**\n      Iterate over each computed property for the class, passing its name\n      and any associated metadata (see `metaForProperty`) to the callback.\n       @static\n      @method eachComputedProperty\n      @param {Function} callback\n      @param {Object} binding\n      @private\n    */\n\n\n    static eachComputedProperty(callback, binding = this) {\n      this.proto(); // ensure prototype is initialized\n\n      var empty = {};\n      (0, _meta2.meta)(this.prototype).forEachDescriptors((name, descriptor) => {\n        if (descriptor.enumerable) {\n          var _meta = descriptor._meta || empty;\n\n          callback.call(binding, name, _meta);\n        }\n      });\n    }\n\n    static get PrototypeMixin() {\n      var prototypeMixin = prototypeMixinMap.get(this);\n\n      if (prototypeMixin === undefined) {\n        prototypeMixin = _metal.Mixin.create();\n        prototypeMixin.ownerConstructor = this;\n        prototypeMixinMap.set(this, prototypeMixin);\n      }\n\n      return prototypeMixin;\n    }\n\n    static get superclass() {\n      var c = Object.getPrototypeOf(this);\n      return c !== Function.prototype ? c : undefined;\n    }\n\n    static proto() {\n      var p = this.prototype;\n\n      if (!wasApplied.has(p)) {\n        wasApplied.add(p);\n        var parent = this.superclass;\n\n        if (parent) {\n          parent.proto();\n        } // If the prototype mixin exists, apply it. In the case of native classes,\n        // it will not exist (unless the class has been reopened).\n\n\n        if (prototypeMixinMap.has(this)) {\n          this.PrototypeMixin.apply(p);\n        }\n      }\n\n      return p;\n    }\n\n  }\n\n  CoreObject.toString = _metal.classToString;\n  (0, _utils.setName)(CoreObject, 'Ember.CoreObject');\n  CoreObject.isClass = true;\n  CoreObject.isMethod = false;\n\n  function flattenProps(...props) {\n    var {\n      concatenatedProperties,\n      mergedProperties\n    } = this;\n    var hasConcatenatedProps = concatenatedProperties !== undefined && concatenatedProperties.length > 0;\n    var hasMergedProps = mergedProperties !== undefined && mergedProperties.length > 0;\n    var initProperties = {};\n\n    for (var i = 0; i < props.length; i++) {\n      var properties = props[i];\n      (true && !(!(properties instanceof _metal.Mixin)) && (0, _debug.assert)('EmberObject.create no longer supports mixing in other ' + 'definitions, use .extend & .create separately instead.', !(properties instanceof _metal.Mixin)));\n      var keyNames = Object.keys(properties);\n\n      for (var j = 0, k = keyNames.length; j < k; j++) {\n        var keyName = keyNames[j];\n        var value = properties[keyName];\n\n        if (hasConcatenatedProps && concatenatedProperties.indexOf(keyName) > -1) {\n          var baseValue = initProperties[keyName];\n\n          if (baseValue) {\n            value = (0, _utils.makeArray)(baseValue).concat(value);\n          } else {\n            value = (0, _utils.makeArray)(value);\n          }\n        }\n\n        if (hasMergedProps && mergedProperties.indexOf(keyName) > -1) {\n          var _baseValue = initProperties[keyName];\n          value = (0, _polyfills.assign)({}, _baseValue, value);\n        }\n\n        initProperties[keyName] = value;\n      }\n    }\n\n    return initProperties;\n  }\n\n  if (true\n  /* DEBUG */\n  ) {\n    /**\n      Provides lookup-time type validation for injected properties.\n       @private\n      @method _onLookup\n    */\n    CoreObject._onLookup = function injectedPropertyAssertion(debugContainerKey) {\n      var [type] = debugContainerKey.split(':');\n      var proto = this.proto();\n\n      for (var key in proto) {\n        var desc = (0, _metal.descriptorForProperty)(proto, key);\n\n        if (desc && _metal.DEBUG_INJECTION_FUNCTIONS.has(desc._getter)) {\n          (true && !(type === 'controller' || _metal.DEBUG_INJECTION_FUNCTIONS.get(desc._getter).type !== 'controller') && (0, _debug.assert)(\"Defining `\" + key + \"` as an injected controller property on a non-controller (`\" + debugContainerKey + \"`) is not allowed.\", type === 'controller' || _metal.DEBUG_INJECTION_FUNCTIONS.get(desc._getter).type !== 'controller'));\n        }\n      }\n    };\n    /**\n      Returns a hash of property names and container names that injected\n      properties will lookup on the container lazily.\n       @method _lazyInjections\n      @return {Object} Hash of all lazy injected property keys to container names\n      @private\n    */\n\n\n    CoreObject._lazyInjections = function () {\n      var injections = {};\n      var proto = this.proto();\n      var key;\n      var desc;\n\n      for (key in proto) {\n        desc = (0, _metal.descriptorForProperty)(proto, key);\n\n        if (desc && _metal.DEBUG_INJECTION_FUNCTIONS.has(desc._getter)) {\n          var {\n            namespace,\n            source,\n            type,\n            name\n          } = _metal.DEBUG_INJECTION_FUNCTIONS.get(desc._getter);\n\n          injections[key] = {\n            namespace,\n            source,\n            specifier: type + \":\" + (name || key)\n          };\n        }\n      }\n\n      return injections;\n    };\n  }\n\n  var _default = CoreObject;\n  _exports.default = _default;\n});","define(\"@ember/-internals/runtime/lib/system/namespace\", [\"exports\", \"@ember/-internals/metal\", \"@ember/-internals/utils\", \"@ember/-internals/runtime/lib/system/object\"], function (_exports, _metal, _utils, _object) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n  @module ember\n  */\n  // Preloaded into namespaces\n\n  /**\n    A Namespace is an object usually used to contain other objects or methods\n    such as an application or framework. Create a namespace anytime you want\n    to define one of these new containers.\n  \n    # Example Usage\n  \n    ```javascript\n    MyFramework = Ember.Namespace.create({\n      VERSION: '1.0.0'\n    });\n    ```\n  \n    @class Namespace\n    @namespace Ember\n    @extends EmberObject\n    @public\n  */\n  class Namespace extends _object.default {\n    init() {\n      (0, _metal.addNamespace)(this);\n    }\n\n    toString() {\n      var name = (0, _metal.get)(this, 'name') || (0, _metal.get)(this, 'modulePrefix');\n\n      if (name) {\n        return name;\n      }\n\n      (0, _metal.findNamespaces)();\n      name = (0, _utils.getName)(this);\n\n      if (name === undefined) {\n        name = (0, _utils.guidFor)(this);\n        (0, _utils.setName)(this, name);\n      }\n\n      return name;\n    }\n\n    nameClasses() {\n      (0, _metal.processNamespace)(this);\n    }\n\n    destroy() {\n      (0, _metal.removeNamespace)(this);\n      super.destroy();\n    }\n\n  }\n\n  _exports.default = Namespace;\n  Namespace.prototype.isNamespace = true;\n  Namespace.NAMESPACES = _metal.NAMESPACES;\n  Namespace.NAMESPACES_BY_ID = _metal.NAMESPACES_BY_ID;\n  Namespace.processAll = _metal.processAllNamespaces;\n  Namespace.byName = _metal.findNamespace;\n});","define(\"@ember/-internals/runtime/lib/system/object\", [\"exports\", \"@ember/-internals/container\", \"@ember/-internals/owner\", \"@ember/-internals/utils\", \"@ember/-internals/metal\", \"@ember/-internals/runtime/lib/system/core_object\", \"@ember/-internals/runtime/lib/mixins/observable\", \"@ember/debug\"], function (_exports, _container, _owner, _utils, _metal, _core_object, _observable, _debug) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.FrameworkObject = _exports.default = void 0;\n\n  /**\n  @module @ember/object\n  */\n  var instanceOwner = new WeakMap();\n  /**\n    `EmberObject` is the main base class for all Ember objects. It is a subclass\n    of `CoreObject` with the `Observable` mixin applied. For details,\n    see the documentation for each of these.\n  \n    @class EmberObject\n    @extends CoreObject\n    @uses Observable\n    @public\n  */\n\n  class EmberObject extends _core_object.default {\n    get _debugContainerKey() {\n      var factory = _container.FACTORY_FOR.get(this);\n\n      return factory !== undefined && factory.fullName;\n    }\n\n    get [_owner.OWNER]() {\n      var owner = instanceOwner.get(this);\n\n      if (owner !== undefined) {\n        return owner;\n      }\n\n      var factory = _container.FACTORY_FOR.get(this);\n\n      return factory !== undefined && factory.owner;\n    } // we need a setter here largely to support\n    // folks calling `owner.ownerInjection()` API\n\n\n    set [_owner.OWNER](value) {\n      instanceOwner.set(this, value);\n    }\n\n  }\n\n  _exports.default = EmberObject;\n  (0, _utils.setName)(EmberObject, 'Ember.Object');\n\n  _observable.default.apply(EmberObject.prototype);\n\n  var FrameworkObject;\n  _exports.FrameworkObject = FrameworkObject;\n  _exports.FrameworkObject = FrameworkObject = class FrameworkObject extends _core_object.default {\n    get _debugContainerKey() {\n      var factory = _container.FACTORY_FOR.get(this);\n\n      return factory !== undefined && factory.fullName;\n    }\n\n    constructor(owner) {\n      super();\n      (0, _owner.setOwner)(this, owner);\n    }\n\n  };\n\n  _observable.default.apply(FrameworkObject.prototype);\n\n  if (true\n  /* DEBUG */\n  ) {\n    var INIT_WAS_CALLED = (0, _utils.symbol)('INIT_WAS_CALLED');\n    var ASSERT_INIT_WAS_CALLED = (0, _utils.symbol)('ASSERT_INIT_WAS_CALLED');\n    _exports.FrameworkObject = FrameworkObject = class DebugFrameworkObject extends EmberObject {\n      init() {\n        super.init(...arguments);\n        this[INIT_WAS_CALLED] = true;\n      }\n\n      [ASSERT_INIT_WAS_CALLED]() {\n        (true && !(this[INIT_WAS_CALLED]) && (0, _debug.assert)(\"You must call `this._super(...arguments);` when overriding `init` on a framework object. Please update \" + this + \" to call `this._super(...arguments);` from `init`.\", this[INIT_WAS_CALLED]));\n      }\n\n    };\n    (0, _metal.addListener)(FrameworkObject.prototype, 'init', null, ASSERT_INIT_WAS_CALLED);\n  }\n});","define(\"@ember/-internals/runtime/lib/system/object_proxy\", [\"exports\", \"@ember/-internals/runtime/lib/system/object\", \"@ember/-internals/runtime/lib/mixins/-proxy\"], function (_exports, _object, _proxy) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n    `ObjectProxy` forwards all properties not defined by the proxy itself\n    to a proxied `content` object.\n  \n    ```javascript\n    import EmberObject from '@ember/object';\n    import ObjectProxy from '@ember/object/proxy';\n  \n    object = EmberObject.create({\n      name: 'Foo'\n    });\n  \n    proxy = ObjectProxy.create({\n      content: object\n    });\n  \n    // Access and change existing properties\n    proxy.get('name')          // 'Foo'\n    proxy.set('name', 'Bar');\n    object.get('name')         // 'Bar'\n  \n    // Create new 'description' property on `object`\n    proxy.set('description', 'Foo is a whizboo baz');\n    object.get('description')  // 'Foo is a whizboo baz'\n    ```\n  \n    While `content` is unset, setting a property to be delegated will throw an\n    Error.\n  \n    ```javascript\n    import ObjectProxy from '@ember/object/proxy';\n  \n    proxy = ObjectProxy.create({\n      content: null,\n      flag: null\n    });\n    proxy.set('flag', true);\n    proxy.get('flag');         // true\n    proxy.get('foo');          // undefined\n    proxy.set('foo', 'data');  // throws Error\n    ```\n  \n    Delegated properties can be bound to and will change when content is updated.\n  \n    Computed properties on the proxy itself can depend on delegated properties.\n  \n    ```javascript\n    import { computed } from '@ember/object';\n    import ObjectProxy from '@ember/object/proxy';\n  \n    ProxyWithComputedProperty = ObjectProxy.extend({\n      fullName: computed('firstName', 'lastName', function() {\n        var firstName = this.get('firstName'),\n            lastName = this.get('lastName');\n        if (firstName && lastName) {\n          return firstName + ' ' + lastName;\n        }\n        return firstName || lastName;\n      })\n    });\n  \n    proxy = ProxyWithComputedProperty.create();\n  \n    proxy.get('fullName');  // undefined\n    proxy.set('content', {\n      firstName: 'Tom', lastName: 'Dale'\n    }); // triggers property change for fullName on proxy\n  \n    proxy.get('fullName');  // 'Tom Dale'\n    ```\n  \n    @class ObjectProxy\n    @extends EmberObject\n    @uses Ember.ProxyMixin\n    @public\n  */\n  class ObjectProxy extends _object.default {}\n\n  _exports.default = ObjectProxy;\n  ObjectProxy.PrototypeMixin.reopen(_proxy.default);\n});","define(\"@ember/-internals/runtime/lib/type-of\", [\"exports\", \"@ember/-internals/runtime/lib/system/core_object\"], function (_exports, _core_object) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.typeOf = typeOf;\n  // ........................................\n  // TYPING & ARRAY MESSAGING\n  //\n  var TYPE_MAP = {\n    '[object Boolean]': 'boolean',\n    '[object Number]': 'number',\n    '[object String]': 'string',\n    '[object Function]': 'function',\n    '[object Array]': 'array',\n    '[object Date]': 'date',\n    '[object RegExp]': 'regexp',\n    '[object Object]': 'object',\n    '[object FileList]': 'filelist'\n  };\n  var {\n    toString\n  } = Object.prototype;\n  /**\n   @module @ember/utils\n  */\n\n  /**\n    Returns a consistent type for the passed object.\n  \n    Use this instead of the built-in `typeof` to get the type of an item.\n    It will return the same result across all browsers and includes a bit\n    more detail. Here is what will be returned:\n  \n        | Return Value  | Meaning                                              |\n        |---------------|------------------------------------------------------|\n        | 'string'      | String primitive or String object.                   |\n        | 'number'      | Number primitive or Number object.                   |\n        | 'boolean'     | Boolean primitive or Boolean object.                 |\n        | 'null'        | Null value                                           |\n        | 'undefined'   | Undefined value                                      |\n        | 'function'    | A function                                           |\n        | 'array'       | An instance of Array                                 |\n        | 'regexp'      | An instance of RegExp                                |\n        | 'date'        | An instance of Date                                  |\n        | 'filelist'    | An instance of FileList                              |\n        | 'class'       | An Ember class (created using EmberObject.extend())  |\n        | 'instance'    | An Ember object instance                             |\n        | 'error'       | An instance of the Error object                      |\n        | 'object'      | A JavaScript object not inheriting from EmberObject  |\n  \n    Examples:\n  \n    ```javascript\n    import { A } from '@ember/array';\n    import { typeOf } from '@ember/utils';\n    import EmberObject from '@ember/object';\n  \n    typeOf();                       // 'undefined'\n    typeOf(null);                   // 'null'\n    typeOf(undefined);              // 'undefined'\n    typeOf('michael');              // 'string'\n    typeOf(new String('michael'));  // 'string'\n    typeOf(101);                    // 'number'\n    typeOf(new Number(101));        // 'number'\n    typeOf(true);                   // 'boolean'\n    typeOf(new Boolean(true));      // 'boolean'\n    typeOf(A);                      // 'function'\n    typeOf(A());                    // 'array'\n    typeOf([1, 2, 90]);             // 'array'\n    typeOf(/abc/);                  // 'regexp'\n    typeOf(new Date());             // 'date'\n    typeOf(event.target.files);     // 'filelist'\n    typeOf(EmberObject.extend());   // 'class'\n    typeOf(EmberObject.create());   // 'instance'\n    typeOf(new Error('teamocil'));  // 'error'\n  \n    // 'normal' JavaScript object\n    typeOf({ a: 'b' });             // 'object'\n    ```\n  \n    @method typeOf\n    @for @ember/utils\n    @param {Object} item the item to check\n    @return {String} the type\n    @public\n    @static\n  */\n\n  function typeOf(item) {\n    if (item === null) {\n      return 'null';\n    }\n\n    if (item === undefined) {\n      return 'undefined';\n    }\n\n    var ret = TYPE_MAP[toString.call(item)] || 'object';\n\n    if (ret === 'function') {\n      if (_core_object.default.detect(item)) {\n        ret = 'class';\n      }\n    } else if (ret === 'object') {\n      if (item instanceof Error) {\n        ret = 'error';\n      } else if (item instanceof _core_object.default) {\n        ret = 'instance';\n      } else if (item instanceof Date) {\n        ret = 'date';\n      }\n    }\n\n    return ret;\n  }\n});","define(\"@ember/-internals/utils/index\", [\"exports\", \"@ember/polyfills\", \"@ember/debug\"], function (_exports, _polyfills, _debug) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.symbol = symbol;\n  _exports.isInternalSymbol = isInternalSymbol;\n  _exports.dictionary = makeDictionary;\n  _exports.uuid = uuid;\n  _exports.generateGuid = generateGuid;\n  _exports.guidFor = guidFor;\n  _exports.intern = intern;\n  _exports.wrap = wrap;\n  _exports.getObservers = getObservers;\n  _exports.getListeners = getListeners;\n  _exports.setObservers = setObservers;\n  _exports.setListeners = setListeners;\n  _exports.inspect = inspect;\n  _exports.lookupDescriptor = lookupDescriptor;\n  _exports.canInvoke = canInvoke;\n  _exports.tryInvoke = tryInvoke;\n  _exports.makeArray = makeArray;\n  _exports.getName = getName;\n  _exports.setName = setName;\n  _exports.toString = toString;\n  _exports.isProxy = isProxy;\n  _exports.setProxy = setProxy;\n  _exports.isEmberArray = isEmberArray;\n  _exports.setWithMandatorySetter = _exports.teardownMandatorySetter = _exports.setupMandatorySetter = _exports.EMBER_ARRAY = _exports.Cache = _exports.HAS_NATIVE_PROXY = _exports.HAS_NATIVE_SYMBOL = _exports.ROOT = _exports.checkHasSuper = _exports.GUID_KEY = _exports.getOwnPropertyDescriptors = _exports.getDebugName = void 0;\n\n  /**\n    Strongly hint runtimes to intern the provided string.\n  \n    When do I need to use this function?\n  \n    For the most part, never. Pre-mature optimization is bad, and often the\n    runtime does exactly what you need it to, and more often the trade-off isn't\n    worth it.\n  \n    Why?\n  \n    Runtimes store strings in at least 2 different representations:\n    Ropes and Symbols (interned strings). The Rope provides a memory efficient\n    data-structure for strings created from concatenation or some other string\n    manipulation like splitting.\n  \n    Unfortunately checking equality of different ropes can be quite costly as\n    runtimes must resort to clever string comparison algorithms. These\n    algorithms typically cost in proportion to the length of the string.\n    Luckily, this is where the Symbols (interned strings) shine. As Symbols are\n    unique by their string content, equality checks can be done by pointer\n    comparison.\n  \n    How do I know if my string is a rope or symbol?\n  \n    Typically (warning general sweeping statement, but truthy in runtimes at\n    present) static strings created as part of the JS source are interned.\n    Strings often used for comparisons can be interned at runtime if some\n    criteria are met.  One of these criteria can be the size of the entire rope.\n    For example, in chrome 38 a rope longer then 12 characters will not\n    intern, nor will segments of that rope.\n  \n    Some numbers: http://jsperf.com/eval-vs-keys/8\n  \n    Known Trick™\n  \n    @private\n    @return {String} interned version of the provided string\n  */\n  function intern(str) {\n    var obj = {};\n    obj[str] = 1;\n\n    for (var key in obj) {\n      if (key === str) {\n        return key;\n      }\n    }\n\n    return str;\n  }\n  /**\n    Returns whether Type(value) is Object.\n  \n    Useful for checking whether a value is a valid WeakMap key.\n  \n    Refs: https://tc39.github.io/ecma262/#sec-typeof-operator-runtime-semantics-evaluation\n          https://tc39.github.io/ecma262/#sec-weakmap.prototype.set\n  \n    @private\n    @function isObject\n  */\n\n\n  function isObject(value) {\n    return value !== null && (typeof value === 'object' || typeof value === 'function');\n  }\n  /**\n   @module @ember/object\n  */\n\n  /**\n   Previously we used `Ember.$.uuid`, however `$.uuid` has been removed from\n   jQuery master. We'll just bootstrap our own uuid now.\n  \n   @private\n   @return {Number} the uuid\n   */\n\n\n  var _uuid = 0;\n  /**\n   Generates a universally unique identifier. This method\n   is used internally by Ember for assisting with\n   the generation of GUID's and other unique identifiers.\n  \n   @public\n   @return {Number} [description]\n   */\n\n  function uuid() {\n    return ++_uuid;\n  }\n  /**\n   Prefix used for guids through out Ember.\n   @private\n   @property GUID_PREFIX\n   @for Ember\n   @type String\n   @final\n   */\n\n\n  var GUID_PREFIX = 'ember'; // Used for guid generation...\n\n  var OBJECT_GUIDS = new WeakMap();\n  var NON_OBJECT_GUIDS = new Map();\n  /**\n    A unique key used to assign guids and other private metadata to objects.\n    If you inspect an object in your browser debugger you will often see these.\n    They can be safely ignored.\n  \n    On browsers that support it, these properties are added with enumeration\n    disabled so they won't show up when you iterate over your properties.\n  \n    @private\n    @property GUID_KEY\n    @for Ember\n    @type String\n    @final\n  */\n\n  var GUID_KEY = intern(\"__ember\" + Date.now());\n  /**\n    Generates a new guid, optionally saving the guid to the object that you\n    pass in. You will rarely need to use this method. Instead you should\n    call `guidFor(obj)`, which return an existing guid if available.\n  \n    @private\n    @method generateGuid\n    @static\n    @for @ember/object/internals\n    @param {Object} [obj] Object the guid will be used for. If passed in, the guid will\n      be saved on the object and reused whenever you pass the same object\n      again.\n  \n      If no object is passed, just generate a new guid.\n    @param {String} [prefix] Prefix to place in front of the guid. Useful when you want to\n      separate the guid into separate namespaces.\n    @return {String} the guid\n  */\n\n  _exports.GUID_KEY = GUID_KEY;\n\n  function generateGuid(obj, prefix = GUID_PREFIX) {\n    var guid = prefix + uuid();\n\n    if (isObject(obj)) {\n      OBJECT_GUIDS.set(obj, guid);\n    }\n\n    return guid;\n  }\n  /**\n    Returns a unique id for the object. If the object does not yet have a guid,\n    one will be assigned to it. You can call this on any object,\n    `EmberObject`-based or not.\n  \n    You can also use this method on DOM Element objects.\n  \n    @public\n    @static\n    @method guidFor\n    @for @ember/object/internals\n    @param {Object} obj any object, string, number, Element, or primitive\n    @return {String} the unique guid for this instance.\n  */\n\n\n  function guidFor(value) {\n    var guid;\n\n    if (isObject(value)) {\n      guid = OBJECT_GUIDS.get(value);\n\n      if (guid === undefined) {\n        guid = GUID_PREFIX + uuid();\n        OBJECT_GUIDS.set(value, guid);\n      }\n    } else {\n      guid = NON_OBJECT_GUIDS.get(value);\n\n      if (guid === undefined) {\n        var type = typeof value;\n\n        if (type === 'string') {\n          guid = 'st' + uuid();\n        } else if (type === 'number') {\n          guid = 'nu' + uuid();\n        } else if (type === 'symbol') {\n          guid = 'sy' + uuid();\n        } else {\n          guid = '(' + value + ')';\n        }\n\n        NON_OBJECT_GUIDS.set(value, guid);\n      }\n    }\n\n    return guid;\n  }\n\n  var GENERATED_SYMBOLS = [];\n\n  function isInternalSymbol(possibleSymbol) {\n    return GENERATED_SYMBOLS.indexOf(possibleSymbol) !== -1;\n  }\n\n  function symbol(debugName) {\n    // TODO: Investigate using platform symbols, but we do not\n    // want to require non-enumerability for this API, which\n    // would introduce a large cost.\n    var id = GUID_KEY + Math.floor(Math.random() * Date.now());\n    var symbol = intern(\"__\" + debugName + id + \"__\");\n    GENERATED_SYMBOLS.push(symbol);\n    return symbol;\n  } // the delete is meant to hint at runtimes that this object should remain in\n  // dictionary mode. This is clearly a runtime specific hack, but currently it\n  // appears worthwhile in some usecases. Please note, these deletes do increase\n  // the cost of creation dramatically over a plain Object.create. And as this\n  // only makes sense for long-lived dictionaries that aren't instantiated often.\n\n\n  function makeDictionary(parent) {\n    var dict = Object.create(parent);\n    dict['_dict'] = null;\n    delete dict['_dict'];\n    return dict;\n  }\n\n  var getDebugName;\n\n  if (true\n  /* DEBUG */\n  ) {\n    var getFunctionName = fn => {\n      var functionName = fn.name;\n\n      if (functionName === undefined) {\n        var match = Function.prototype.toString.call(fn).match(/function (\\w+)\\s*\\(/);\n        functionName = match && match[1] || '';\n      }\n\n      return functionName;\n    };\n\n    var getObjectName = obj => {\n      var name;\n      var className;\n\n      if (obj.constructor && obj.constructor !== Object) {\n        className = getFunctionName(obj.constructor);\n      }\n\n      if ('toString' in obj && obj.toString !== Object.prototype.toString && obj.toString !== Function.prototype.toString) {\n        name = obj.toString();\n      } // If the class has a decent looking name, and the `toString` is one of the\n      // default Ember toStrings, replace the constructor portion of the toString\n      // with the class name. We check the length of the class name to prevent doing\n      // this when the value is minified.\n\n\n      if (name && name.match(/<.*:ember\\d+>/) && className && className[0] !== '_' && className.length > 2 && className !== 'Class') {\n        return name.replace(/<.*:/, \"<\" + className + \":\");\n      }\n\n      return name || className;\n    };\n\n    var getPrimitiveName = value => {\n      return String(value);\n    };\n\n    getDebugName = value => {\n      if (typeof value === 'function') {\n        return getFunctionName(value) || \"(unknown function)\";\n      } else if (typeof value === 'object' && value !== null) {\n        return getObjectName(value) || \"(unknown object)\";\n      } else {\n        return getPrimitiveName(value);\n      }\n    };\n  }\n\n  var getDebugName$1 = getDebugName;\n  _exports.getDebugName = getDebugName$1;\n  var getOwnPropertyDescriptors;\n\n  if (Object.getOwnPropertyDescriptors !== undefined) {\n    getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors;\n  } else {\n    getOwnPropertyDescriptors = function (obj) {\n      var descriptors = {};\n      Object.keys(obj).forEach(key => {\n        descriptors[key] = Object.getOwnPropertyDescriptor(obj, key);\n      });\n      return descriptors;\n    };\n  }\n\n  var getOwnPropertyDescriptors$1 = getOwnPropertyDescriptors;\n  _exports.getOwnPropertyDescriptors = getOwnPropertyDescriptors$1;\n  var HAS_SUPER_PATTERN = /\\.(_super|call\\(this|apply\\(this)/;\n  var fnToString = Function.prototype.toString;\n\n  var checkHasSuper = (() => {\n    var sourceAvailable = fnToString.call(function () {\n      return this;\n    }).indexOf('return this') > -1;\n\n    if (sourceAvailable) {\n      return function checkHasSuper(func) {\n        return HAS_SUPER_PATTERN.test(fnToString.call(func));\n      };\n    }\n\n    return function checkHasSuper() {\n      return true;\n    };\n  })();\n\n  _exports.checkHasSuper = checkHasSuper;\n  var HAS_SUPER_MAP = new WeakMap();\n  var ROOT = Object.freeze(function () {});\n  _exports.ROOT = ROOT;\n  HAS_SUPER_MAP.set(ROOT, false);\n\n  function hasSuper(func) {\n    var hasSuper = HAS_SUPER_MAP.get(func);\n\n    if (hasSuper === undefined) {\n      hasSuper = checkHasSuper(func);\n      HAS_SUPER_MAP.set(func, hasSuper);\n    }\n\n    return hasSuper;\n  }\n\n  var OBSERVERS_MAP = new WeakMap();\n\n  function setObservers(func, observers) {\n    OBSERVERS_MAP.set(func, observers);\n  }\n\n  function getObservers(func) {\n    return OBSERVERS_MAP.get(func);\n  }\n\n  var LISTENERS_MAP = new WeakMap();\n\n  function setListeners(func, listeners) {\n    if (listeners) {\n      LISTENERS_MAP.set(func, listeners);\n    }\n  }\n\n  function getListeners(func) {\n    return LISTENERS_MAP.get(func);\n  }\n\n  var IS_WRAPPED_FUNCTION_SET = new _polyfills._WeakSet();\n  /**\n    Wraps the passed function so that `this._super` will point to the superFunc\n    when the function is invoked. This is the primitive we use to implement\n    calls to super.\n  \n    @private\n    @method wrap\n    @for Ember\n    @param {Function} func The function to call\n    @param {Function} superFunc The super function.\n    @return {Function} wrapped function.\n  */\n\n  function wrap(func, superFunc) {\n    if (!hasSuper(func)) {\n      return func;\n    } // ensure an unwrapped super that calls _super is wrapped with a terminal _super\n\n\n    if (!IS_WRAPPED_FUNCTION_SET.has(superFunc) && hasSuper(superFunc)) {\n      return _wrap(func, _wrap(superFunc, ROOT));\n    }\n\n    return _wrap(func, superFunc);\n  }\n\n  function _wrap(func, superFunc) {\n    function superWrapper() {\n      var orig = this._super;\n      this._super = superFunc;\n      var ret = func.apply(this, arguments);\n      this._super = orig;\n      return ret;\n    }\n\n    IS_WRAPPED_FUNCTION_SET.add(superWrapper);\n    setObservers(superWrapper, getObservers(func));\n    setListeners(superWrapper, getListeners(func));\n    return superWrapper;\n  }\n\n  var {\n    toString: objectToString\n  } = Object.prototype;\n  var {\n    toString: functionToString\n  } = Function.prototype;\n  var {\n    isArray\n  } = Array;\n  var {\n    keys: objectKeys\n  } = Object;\n  var {\n    stringify\n  } = JSON;\n  var LIST_LIMIT = 100;\n  var DEPTH_LIMIT = 4;\n  var SAFE_KEY = /^[\\w$]+$/;\n  /**\n   @module @ember/debug\n  */\n\n  /**\n    Convenience method to inspect an object. This method will attempt to\n    convert the object into a useful string description.\n  \n    It is a pretty simple implementation. If you want something more robust,\n    use something like JSDump: https://github.com/NV/jsDump\n  \n    @method inspect\n    @static\n    @param {Object} obj The object you want to inspect.\n    @return {String} A description of the object\n    @since 1.4.0\n    @private\n  */\n\n  function inspect(obj) {\n    // detect Node util.inspect call inspect(depth: number, opts: object)\n    if (typeof obj === 'number' && arguments.length === 2) {\n      return this;\n    }\n\n    return inspectValue(obj, 0);\n  }\n\n  function inspectValue(value, depth, seen) {\n    var valueIsArray = false;\n\n    switch (typeof value) {\n      case 'undefined':\n        return 'undefined';\n\n      case 'object':\n        if (value === null) return 'null';\n\n        if (isArray(value)) {\n          valueIsArray = true;\n          break;\n        } // is toString Object.prototype.toString or undefined then traverse\n\n\n        if (value.toString === objectToString || value.toString === undefined) {\n          break;\n        } // custom toString\n\n\n        return value.toString();\n\n      case 'function':\n        return value.toString === functionToString ? value.name ? \"[Function:\" + value.name + \"]\" : \"[Function]\" : value.toString();\n\n      case 'string':\n        return stringify(value);\n\n      case 'symbol':\n      case 'boolean':\n      case 'number':\n      default:\n        return value.toString();\n    }\n\n    if (seen === undefined) {\n      seen = new _polyfills._WeakSet();\n    } else {\n      if (seen.has(value)) return \"[Circular]\";\n    }\n\n    seen.add(value);\n    return valueIsArray ? inspectArray(value, depth + 1, seen) : inspectObject(value, depth + 1, seen);\n  }\n\n  function inspectKey(key) {\n    return SAFE_KEY.test(key) ? key : stringify(key);\n  }\n\n  function inspectObject(obj, depth, seen) {\n    if (depth > DEPTH_LIMIT) {\n      return '[Object]';\n    }\n\n    var s = '{';\n    var keys = objectKeys(obj);\n\n    for (var i = 0; i < keys.length; i++) {\n      s += i === 0 ? ' ' : ', ';\n\n      if (i >= LIST_LIMIT) {\n        s += \"... \" + (keys.length - LIST_LIMIT) + \" more keys\";\n        break;\n      }\n\n      var key = keys[i];\n      s += inspectKey(key) + ': ' + inspectValue(obj[key], depth, seen);\n    }\n\n    s += ' }';\n    return s;\n  }\n\n  function inspectArray(arr, depth, seen) {\n    if (depth > DEPTH_LIMIT) {\n      return '[Array]';\n    }\n\n    var s = '[';\n\n    for (var i = 0; i < arr.length; i++) {\n      s += i === 0 ? ' ' : ', ';\n\n      if (i >= LIST_LIMIT) {\n        s += \"... \" + (arr.length - LIST_LIMIT) + \" more items\";\n        break;\n      }\n\n      s += inspectValue(arr[i], depth, seen);\n    }\n\n    s += ' ]';\n    return s;\n  }\n\n  function lookupDescriptor(obj, keyName) {\n    var current = obj;\n\n    do {\n      var descriptor = Object.getOwnPropertyDescriptor(current, keyName);\n\n      if (descriptor !== undefined) {\n        return descriptor;\n      }\n\n      current = Object.getPrototypeOf(current);\n    } while (current !== null);\n\n    return null;\n  }\n  /**\n    Checks to see if the `methodName` exists on the `obj`.\n  \n    ```javascript\n    let foo = { bar: function() { return 'bar'; }, baz: null };\n  \n    Ember.canInvoke(foo, 'bar'); // true\n    Ember.canInvoke(foo, 'baz'); // false\n    Ember.canInvoke(foo, 'bat'); // false\n    ```\n  \n    @method canInvoke\n    @for Ember\n    @param {Object} obj The object to check for the method\n    @param {String} methodName The method name to check for\n    @return {Boolean}\n    @private\n  */\n\n\n  function canInvoke(obj, methodName) {\n    return obj !== null && obj !== undefined && typeof obj[methodName] === 'function';\n  }\n  /**\n    @module @ember/utils\n  */\n\n  /**\n    Checks to see if the `methodName` exists on the `obj`,\n    and if it does, invokes it with the arguments passed.\n  \n    ```javascript\n    import { tryInvoke } from '@ember/utils';\n  \n    let d = new Date('03/15/2013');\n  \n    tryInvoke(d, 'getTime');              // 1363320000000\n    tryInvoke(d, 'setFullYear', [2014]);  // 1394856000000\n    tryInvoke(d, 'noSuchMethod', [2014]); // undefined\n    ```\n  \n    @method tryInvoke\n    @for @ember/utils\n    @static\n    @param {Object} obj The object to check for the method\n    @param {String} methodName The method name to check for\n    @param {Array} [args] The arguments to pass to the method\n    @return {*} the return value of the invoked method or undefined if it cannot be invoked\n    @public\n  */\n\n\n  function tryInvoke(obj, methodName, args) {\n    if (canInvoke(obj, methodName)) {\n      var method = obj[methodName];\n      return method.apply(obj, args);\n    }\n  }\n\n  var {\n    isArray: isArray$1\n  } = Array;\n\n  function makeArray(obj) {\n    if (obj === null || obj === undefined) {\n      return [];\n    }\n\n    return isArray$1(obj) ? obj : [obj];\n  }\n\n  var NAMES = new WeakMap();\n\n  function setName(obj, name) {\n    if (isObject(obj)) NAMES.set(obj, name);\n  }\n\n  function getName(obj) {\n    return NAMES.get(obj);\n  }\n\n  var objectToString$1 = Object.prototype.toString;\n\n  function isNone(obj) {\n    return obj === null || obj === undefined;\n  }\n  /*\n   A `toString` util function that supports objects without a `toString`\n   method, e.g. an object created with `Object.create(null)`.\n  */\n\n\n  function toString(obj) {\n    if (typeof obj === 'string') {\n      return obj;\n    }\n\n    if (null === obj) return 'null';\n    if (undefined === obj) return 'undefined';\n\n    if (Array.isArray(obj)) {\n      // Reimplement Array.prototype.join according to spec (22.1.3.13)\n      // Changing ToString(element) with this safe version of ToString.\n      var r = '';\n\n      for (var k = 0; k < obj.length; k++) {\n        if (k > 0) {\n          r += ',';\n        }\n\n        if (!isNone(obj[k])) {\n          r += toString(obj[k]);\n        }\n      }\n\n      return r;\n    }\n\n    if (typeof obj.toString === 'function') {\n      return obj.toString();\n    }\n\n    return objectToString$1.call(obj);\n  }\n\n  var HAS_NATIVE_SYMBOL = function () {\n    if (typeof Symbol !== 'function') {\n      return false;\n    }\n\n    return typeof Symbol() === 'symbol';\n  }();\n\n  _exports.HAS_NATIVE_SYMBOL = HAS_NATIVE_SYMBOL;\n  var HAS_NATIVE_PROXY = typeof Proxy === 'function';\n  _exports.HAS_NATIVE_PROXY = HAS_NATIVE_PROXY;\n  var PROXIES = new _polyfills._WeakSet();\n\n  function isProxy(value) {\n    if (isObject(value)) {\n      return PROXIES.has(value);\n    }\n\n    return false;\n  }\n\n  function setProxy(object) {\n    if (isObject(object)) {\n      PROXIES.add(object);\n    }\n  }\n\n  class Cache {\n    constructor(limit, func, store) {\n      this.limit = limit;\n      this.func = func;\n      this.store = store;\n      this.size = 0;\n      this.misses = 0;\n      this.hits = 0;\n      this.store = store || new Map();\n    }\n\n    get(key) {\n      if (this.store.has(key)) {\n        this.hits++;\n        return this.store.get(key);\n      } else {\n        this.misses++;\n        return this.set(key, this.func(key));\n      }\n    }\n\n    set(key, value) {\n      if (this.limit > this.size) {\n        this.size++;\n        this.store.set(key, value);\n      }\n\n      return value;\n    }\n\n    purge() {\n      this.store.clear();\n      this.size = 0;\n      this.hits = 0;\n      this.misses = 0;\n    }\n\n  }\n\n  _exports.Cache = Cache;\n  var EMBER_ARRAY = symbol('EMBER_ARRAY');\n  _exports.EMBER_ARRAY = EMBER_ARRAY;\n\n  function isEmberArray(obj) {\n    return obj && obj[EMBER_ARRAY];\n  }\n\n  var setupMandatorySetter;\n  _exports.setupMandatorySetter = setupMandatorySetter;\n  var teardownMandatorySetter;\n  _exports.teardownMandatorySetter = teardownMandatorySetter;\n  var setWithMandatorySetter;\n  _exports.setWithMandatorySetter = setWithMandatorySetter;\n\n  if (true\n  /* DEBUG */\n  && true\n  /* EMBER_METAL_TRACKED_PROPERTIES */\n  ) {\n      var MANDATORY_SETTERS = new WeakMap();\n\n      var _propertyIsEnumerable = function (obj, key) {\n        return Object.prototype.propertyIsEnumerable.call(obj, key);\n      };\n\n      _exports.setupMandatorySetter = setupMandatorySetter = function (obj, keyName) {\n        var desc = lookupDescriptor(obj, keyName) || {};\n\n        if (desc.get || desc.set) {\n          // if it has a getter or setter, we can't install the mandatory setter.\n          // native setters are allowed, we have to assume that they will resolve\n          // to tracked properties.\n          return;\n        }\n\n        if (desc && (!desc.configurable || !desc.writable)) {\n          // if it isn't writable anyways, so we shouldn't provide the setter.\n          // if it isn't configurable, we can't overwrite it anyways.\n          return;\n        }\n\n        var setters = MANDATORY_SETTERS.get(obj);\n\n        if (setters === undefined) {\n          setters = {};\n          MANDATORY_SETTERS.set(obj, setters);\n        }\n\n        desc.hadOwnProperty = Object.hasOwnProperty.call(obj, keyName);\n        setters[keyName] = desc;\n        Object.defineProperty(obj, keyName, {\n          configurable: true,\n          enumerable: _propertyIsEnumerable(obj, keyName),\n\n          get() {\n            if (desc.get) {\n              return desc.get.call(this);\n            } else {\n              return desc.value;\n            }\n          },\n\n          set(value) {\n            (true && !(false) && (0, _debug.assert)(\"You attempted to update \" + this + \".\" + String(keyName) + \" to \\\"\" + String(value) + \"\\\", but it is being tracked by a tracking context, such as a template, computed property, or observer. In order to make sure the context updates properly, you must invalidate the property when updating it. You can mark the property as `@tracked`, or use `@ember/object#set` to do this.\"));\n          }\n\n        });\n      };\n\n      _exports.teardownMandatorySetter = teardownMandatorySetter = function (obj, keyName) {\n        var setters = MANDATORY_SETTERS.get(obj);\n\n        if (setters !== undefined && setters[keyName] !== undefined) {\n          Object.defineProperty(obj, keyName, setters[keyName]);\n          setters[keyName] = undefined;\n        }\n      };\n\n      _exports.setWithMandatorySetter = setWithMandatorySetter = function (obj, keyName, value) {\n        var setters = MANDATORY_SETTERS.get(obj);\n\n        if (setters !== undefined && setters[keyName] !== undefined) {\n          var setter = setters[keyName];\n\n          if (setter.set) {\n            setter.set.call(obj, value);\n          } else {\n            setter.value = value; // If the object didn't have own property before, it would have changed\n            // the enumerability after setting the value the first time.\n\n            if (!setter.hadOwnProperty) {\n              var desc = lookupDescriptor(obj, keyName);\n              desc.enumerable = true;\n              Object.defineProperty(obj, keyName, desc);\n            }\n          }\n        } else {\n          obj[keyName] = value;\n        }\n      };\n    }\n  /*\n   This package will be eagerly parsed and should have no dependencies on external\n   packages.\n  \n   It is intended to be used to share utility methods that will be needed\n   by every Ember application (and is **not** a dumping ground of useful utilities).\n  \n   Utility methods that are needed in < 80% of cases should be placed\n   elsewhere (so they can be lazily evaluated / parsed).\n  */\n\n});","define(\"@ember/-internals/views/index\", [\"exports\", \"@ember/-internals/views/lib/system/jquery\", \"@ember/-internals/views/lib/system/utils\", \"@ember/-internals/views/lib/system/event_dispatcher\", \"@ember/-internals/views/lib/component_lookup\", \"@ember/-internals/views/lib/mixins/text_support\", \"@ember/-internals/views/lib/views/core_view\", \"@ember/-internals/views/lib/mixins/class_names_support\", \"@ember/-internals/views/lib/mixins/child_views_support\", \"@ember/-internals/views/lib/mixins/view_state_support\", \"@ember/-internals/views/lib/mixins/view_support\", \"@ember/-internals/views/lib/mixins/action_support\", \"@ember/-internals/views/lib/compat/attrs\", \"@ember/-internals/views/lib/system/action_manager\"], function (_exports, _jquery, _utils, _event_dispatcher, _component_lookup, _text_support, _core_view, _class_names_support, _child_views_support, _view_state_support, _view_support, _action_support, _attrs, _action_manager) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"jQuery\", {\n    enumerable: true,\n    get: function () {\n      return _jquery.jQuery;\n    }\n  });\n  Object.defineProperty(_exports, \"jQueryDisabled\", {\n    enumerable: true,\n    get: function () {\n      return _jquery.jQueryDisabled;\n    }\n  });\n  Object.defineProperty(_exports, \"addChildView\", {\n    enumerable: true,\n    get: function () {\n      return _utils.addChildView;\n    }\n  });\n  Object.defineProperty(_exports, \"isSimpleClick\", {\n    enumerable: true,\n    get: function () {\n      return _utils.isSimpleClick;\n    }\n  });\n  Object.defineProperty(_exports, \"getViewBounds\", {\n    enumerable: true,\n    get: function () {\n      return _utils.getViewBounds;\n    }\n  });\n  Object.defineProperty(_exports, \"getViewClientRects\", {\n    enumerable: true,\n    get: function () {\n      return _utils.getViewClientRects;\n    }\n  });\n  Object.defineProperty(_exports, \"getViewBoundingClientRect\", {\n    enumerable: true,\n    get: function () {\n      return _utils.getViewBoundingClientRect;\n    }\n  });\n  Object.defineProperty(_exports, \"getRootViews\", {\n    enumerable: true,\n    get: function () {\n      return _utils.getRootViews;\n    }\n  });\n  Object.defineProperty(_exports, \"getChildViews\", {\n    enumerable: true,\n    get: function () {\n      return _utils.getChildViews;\n    }\n  });\n  Object.defineProperty(_exports, \"getViewId\", {\n    enumerable: true,\n    get: function () {\n      return _utils.getViewId;\n    }\n  });\n  Object.defineProperty(_exports, \"getElementView\", {\n    enumerable: true,\n    get: function () {\n      return _utils.getElementView;\n    }\n  });\n  Object.defineProperty(_exports, \"getViewElement\", {\n    enumerable: true,\n    get: function () {\n      return _utils.getViewElement;\n    }\n  });\n  Object.defineProperty(_exports, \"setElementView\", {\n    enumerable: true,\n    get: function () {\n      return _utils.setElementView;\n    }\n  });\n  Object.defineProperty(_exports, \"setViewElement\", {\n    enumerable: true,\n    get: function () {\n      return _utils.setViewElement;\n    }\n  });\n  Object.defineProperty(_exports, \"clearElementView\", {\n    enumerable: true,\n    get: function () {\n      return _utils.clearElementView;\n    }\n  });\n  Object.defineProperty(_exports, \"clearViewElement\", {\n    enumerable: true,\n    get: function () {\n      return _utils.clearViewElement;\n    }\n  });\n  Object.defineProperty(_exports, \"constructStyleDeprecationMessage\", {\n    enumerable: true,\n    get: function () {\n      return _utils.constructStyleDeprecationMessage;\n    }\n  });\n  Object.defineProperty(_exports, \"EventDispatcher\", {\n    enumerable: true,\n    get: function () {\n      return _event_dispatcher.default;\n    }\n  });\n  Object.defineProperty(_exports, \"ComponentLookup\", {\n    enumerable: true,\n    get: function () {\n      return _component_lookup.default;\n    }\n  });\n  Object.defineProperty(_exports, \"TextSupport\", {\n    enumerable: true,\n    get: function () {\n      return _text_support.default;\n    }\n  });\n  Object.defineProperty(_exports, \"CoreView\", {\n    enumerable: true,\n    get: function () {\n      return _core_view.default;\n    }\n  });\n  Object.defineProperty(_exports, \"ClassNamesSupport\", {\n    enumerable: true,\n    get: function () {\n      return _class_names_support.default;\n    }\n  });\n  Object.defineProperty(_exports, \"ChildViewsSupport\", {\n    enumerable: true,\n    get: function () {\n      return _child_views_support.default;\n    }\n  });\n  Object.defineProperty(_exports, \"ViewStateSupport\", {\n    enumerable: true,\n    get: function () {\n      return _view_state_support.default;\n    }\n  });\n  Object.defineProperty(_exports, \"ViewMixin\", {\n    enumerable: true,\n    get: function () {\n      return _view_support.default;\n    }\n  });\n  Object.defineProperty(_exports, \"ActionSupport\", {\n    enumerable: true,\n    get: function () {\n      return _action_support.default;\n    }\n  });\n  Object.defineProperty(_exports, \"MUTABLE_CELL\", {\n    enumerable: true,\n    get: function () {\n      return _attrs.MUTABLE_CELL;\n    }\n  });\n  Object.defineProperty(_exports, \"ActionManager\", {\n    enumerable: true,\n    get: function () {\n      return _action_manager.default;\n    }\n  });\n});","define(\"@ember/-internals/views/lib/compat/attrs\", [\"exports\", \"@ember/-internals/utils\"], function (_exports, _utils) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.MUTABLE_CELL = void 0;\n  var MUTABLE_CELL = (0, _utils.symbol)('MUTABLE_CELL');\n  _exports.MUTABLE_CELL = MUTABLE_CELL;\n});","define(\"@ember/-internals/views/lib/compat/fallback-view-registry\", [\"exports\", \"@ember/-internals/utils\"], function (_exports, _utils) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  var _default = (0, _utils.dictionary)(null);\n\n  _exports.default = _default;\n});","define(\"@ember/-internals/views/lib/component_lookup\", [\"exports\", \"@ember/-internals/runtime\"], function (_exports, _runtime) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  var _default = _runtime.Object.extend({\n    componentFor(name, owner, options) {\n      var fullName = \"component:\" + name;\n      return owner.factoryFor(fullName, options);\n    },\n\n    layoutFor(name, owner, options) {\n      var templateFullName = \"template:components/\" + name;\n      return owner.lookup(templateFullName, options);\n    }\n\n  });\n\n  _exports.default = _default;\n});","define(\"@ember/-internals/views/lib/mixins/action_support\", [\"exports\", \"@ember/-internals/utils\", \"@ember/-internals/metal\", \"@ember/debug\", \"@ember/-internals/views/lib/compat/attrs\", \"@ember/deprecated-features\"], function (_exports, _utils, _metal, _debug, _attrs, _deprecatedFeatures) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n   @module ember\n  */\n  var mixinObj = {\n    send(actionName, ...args) {\n      (true && !(!this.isDestroying && !this.isDestroyed) && (0, _debug.assert)(\"Attempted to call .send() with the action '\" + actionName + \"' on the destroyed object '\" + this + \"'.\", !this.isDestroying && !this.isDestroyed));\n      var action = this.actions && this.actions[actionName];\n\n      if (action) {\n        var shouldBubble = action.apply(this, args) === true;\n\n        if (!shouldBubble) {\n          return;\n        }\n      }\n\n      var target = (0, _metal.get)(this, 'target');\n\n      if (target) {\n        (true && !(typeof target.send === 'function') && (0, _debug.assert)(\"The `target` for \" + this + \" (\" + target + \") does not have a `send` method\", typeof target.send === 'function'));\n        target.send(...arguments);\n      } else {\n        (true && !(action) && (0, _debug.assert)((0, _utils.inspect)(this) + \" had no action handler for: \" + actionName, action));\n      }\n    }\n\n  };\n\n  if (_deprecatedFeatures.SEND_ACTION) {\n    /**\n      Calls an action passed to a component.\n       For example a component for playing or pausing music may translate click events\n      into action notifications of \"play\" or \"stop\" depending on some internal state\n      of the component:\n       ```app/components/play-button.js\n      import Component from '@ember/component';\n       export default Component.extend({\n        click() {\n          if (this.get('isPlaying')) {\n            this.sendAction('play');\n          } else {\n            this.sendAction('stop');\n          }\n        }\n      });\n      ```\n       The actions \"play\" and \"stop\" must be passed to this `play-button` component:\n       ```handlebars\n      {{! app/templates/application.hbs }}\n      {{play-button play=(action \"musicStarted\") stop=(action \"musicStopped\")}}\n      ```\n       When the component receives a browser `click` event it translate this\n      interaction into application-specific semantics (\"play\" or \"stop\") and\n      calls the specified action.\n       ```app/controller/application.js\n      import Controller from '@ember/controller';\n       export default Controller.extend({\n        actions: {\n          musicStarted() {\n            // called when the play button is clicked\n            // and the music started playing\n          },\n          musicStopped() {\n            // called when the play button is clicked\n            // and the music stopped playing\n          }\n        }\n      });\n      ```\n       If no action is passed to `sendAction` a default name of \"action\"\n      is assumed.\n       ```app/components/next-button.js\n      import Component from '@ember/component';\n       export default Component.extend({\n        click() {\n          this.sendAction();\n        }\n      });\n      ```\n       ```handlebars\n      {{! app/templates/application.hbs }}\n      {{next-button action=(action \"playNextSongInAlbum\")}}\n      ```\n       ```app/controllers/application.js\n      import Controller from '@ember/controller';\n       export default Controller.extend({\n        actions: {\n          playNextSongInAlbum() {\n            ...\n          }\n        }\n      });\n      ```\n       @method sendAction\n      @param [action] {String} the action to call\n      @param [params] {*} arguments for the action\n      @public\n      @deprecated\n    */\n    var sendAction = function sendAction(action, ...contexts) {\n      (true && !(!this.isDestroying && !this.isDestroyed) && (0, _debug.assert)(\"Attempted to call .sendAction() with the action '\" + action + \"' on the destroyed object '\" + this + \"'.\", !this.isDestroying && !this.isDestroyed));\n      (true && !(false) && (0, _debug.deprecate)(\"You called \" + (0, _utils.inspect)(this) + \".sendAction(\" + (typeof action === 'string' ? \"\\\"\" + action + \"\\\"\" : '') + \") but Component#sendAction is deprecated. Please use closure actions instead.\", false, {\n        id: 'ember-component.send-action',\n        until: '4.0.0',\n        url: 'https://emberjs.com/deprecations/v3.x#toc_ember-component-send-action'\n      }));\n      var actionName; // Send the default action\n\n      if (action === undefined) {\n        action = 'action';\n      }\n\n      actionName = (0, _metal.get)(this, \"attrs.\" + action) || (0, _metal.get)(this, action);\n      actionName = validateAction(this, actionName); // If no action name for that action could be found, just abort.\n\n      if (actionName === undefined) {\n        return;\n      }\n\n      if (typeof actionName === 'function') {\n        actionName(...contexts);\n      } else {\n        this.triggerAction({\n          action: actionName,\n          actionContext: contexts\n        });\n      }\n    };\n\n    var validateAction = function validateAction(component, actionName) {\n      if (actionName && actionName[_attrs.MUTABLE_CELL]) {\n        actionName = actionName.value;\n      }\n\n      (true && !(actionName === null || actionName === undefined || typeof actionName === 'string' || typeof actionName === 'function') && (0, _debug.assert)(\"The default action was triggered on the component \" + component.toString() + \", but the action name (\" + actionName + \") was not a string.\", actionName === null || actionName === undefined || typeof actionName === 'string' || typeof actionName === 'function'));\n      return actionName;\n    };\n\n    mixinObj.sendAction = sendAction;\n  }\n  /**\n   @class ActionSupport\n   @namespace Ember\n   @private\n  */\n\n\n  var _default = _metal.Mixin.create(mixinObj);\n\n  _exports.default = _default;\n});","define(\"@ember/-internals/views/lib/mixins/child_views_support\", [\"exports\", \"@ember/-internals/metal\", \"@ember/-internals/views/lib/system/utils\"], function (_exports, _metal, _utils) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n  @module ember\n  */\n  var _default = _metal.Mixin.create({\n    /**\n      Array of child views. You should never edit this array directly.\n       @property childViews\n      @type Array\n      @default []\n      @private\n    */\n    childViews: (0, _metal.nativeDescDecorator)({\n      configurable: false,\n      enumerable: false,\n\n      get() {\n        return (0, _utils.getChildViews)(this);\n      }\n\n    }),\n\n    appendChild(view) {\n      (0, _utils.addChildView)(this, view);\n    }\n\n  });\n\n  _exports.default = _default;\n});","define(\"@ember/-internals/views/lib/mixins/class_names_support\", [\"exports\", \"@ember/-internals/metal\", \"@ember/debug\"], function (_exports, _metal, _debug) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n  @module ember\n  */\n  var EMPTY_ARRAY = Object.freeze([]);\n  /**\n    @class ClassNamesSupport\n    @namespace Ember\n    @private\n  */\n\n  var _default = _metal.Mixin.create({\n    concatenatedProperties: ['classNames', 'classNameBindings'],\n\n    init() {\n      this._super(...arguments);\n\n      (true && !((0, _metal.descriptorForProperty)(this, 'classNameBindings') === undefined && Array.isArray(this.classNameBindings)) && (0, _debug.assert)(\"Only arrays are allowed for 'classNameBindings'\", (0, _metal.descriptorForProperty)(this, 'classNameBindings') === undefined && Array.isArray(this.classNameBindings)));\n      (true && !((0, _metal.descriptorForProperty)(this, 'classNames') === undefined && Array.isArray(this.classNames)) && (0, _debug.assert)(\"Only arrays of static class strings are allowed for 'classNames'. For dynamic classes, use 'classNameBindings'.\", (0, _metal.descriptorForProperty)(this, 'classNames') === undefined && Array.isArray(this.classNames)));\n    },\n\n    /**\n      Standard CSS class names to apply to the view's outer element. This\n      property automatically inherits any class names defined by the view's\n      superclasses as well.\n       @property classNames\n      @type Array\n      @default ['ember-view']\n      @public\n    */\n    classNames: EMPTY_ARRAY,\n\n    /**\n      A list of properties of the view to apply as class names. If the property\n      is a string value, the value of that string will be applied as a class\n      name.\n       ```javascript\n      // Applies the 'high' class to the view element\n      import Component from '@ember/component';\n      Component.extend({\n        classNameBindings: ['priority'],\n        priority: 'high'\n      });\n      ```\n       If the value of the property is a Boolean, the name of that property is\n      added as a dasherized class name.\n       ```javascript\n      // Applies the 'is-urgent' class to the view element\n      import Component from '@ember/component';\n      Component.extend({\n        classNameBindings: ['isUrgent'],\n        isUrgent: true\n      });\n      ```\n       If you would prefer to use a custom value instead of the dasherized\n      property name, you can pass a binding like this:\n       ```javascript\n      // Applies the 'urgent' class to the view element\n      import Component from '@ember/component';\n      Component.extend({\n        classNameBindings: ['isUrgent:urgent'],\n        isUrgent: true\n      });\n      ```\n       If you would like to specify a class that should only be added when the\n      property is false, you can declare a binding like this:\n       ```javascript\n      // Applies the 'disabled' class to the view element\n      import Component from '@ember/component';\n      Component.extend({\n        classNameBindings: ['isEnabled::disabled'],\n        isEnabled: false\n      });\n      ```\n       This list of properties is inherited from the component's superclasses as well.\n       @property classNameBindings\n      @type Array\n      @default []\n      @public\n    */\n    classNameBindings: EMPTY_ARRAY\n  });\n\n  _exports.default = _default;\n});","define(\"@ember/-internals/views/lib/mixins/text_support\", [\"exports\", \"@ember/-internals/metal\", \"@ember/-internals/runtime\", \"@ember/debug\", \"@ember/deprecated-features\"], function (_exports, _metal, _runtime, _debug, _deprecatedFeatures) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n  @module ember\n  */\n  var KEY_EVENTS = {\n    13: 'insertNewline',\n    27: 'cancel'\n  };\n  /**\n    `TextSupport` is a shared mixin used by both `TextField` and\n    `TextArea`. `TextSupport` adds a number of methods that allow you to\n    specify a controller action to invoke when a certain event is fired on your\n    text field or textarea. The specified controller action would get the current\n    value of the field passed in as the only argument unless the value of\n    the field is empty. In that case, the instance of the field itself is passed\n    in as the only argument.\n  \n    Let's use the pressing of the escape key as an example. If you wanted to\n    invoke a controller action when a user presses the escape key while on your\n    field, you would use the `escape-press` attribute on your field like so:\n  \n    ```handlebars\n      {{! application.hbs}}\n  \n      {{input escape-press='alertUser'}}\n    ```\n  \n    ```javascript\n        import Application from '@ember/application';\n        import Controller from '@ember/controller';\n        App = Application.create();\n  \n        App.ApplicationController = Controller.extend({\n          actions: {\n            alertUser: function ( currentValue ) {\n              alert( 'escape pressed, current value: ' + currentValue );\n            }\n          }\n        });\n    ```\n  \n    The following chart is a visual representation of what takes place when the\n    escape key is pressed in this scenario:\n  \n    ```\n    The Template\n    +---------------------------+\n    |                           |\n    | escape-press='alertUser'  |\n    |                           |          TextSupport Mixin\n    +----+----------------------+          +-------------------------------+\n         |                                 | cancel method                 |\n         |      escape button pressed      |                               |\n         +-------------------------------> | checks for the `escape-press` |\n                                           | attribute and pulls out the   |\n         +-------------------------------+ | `alertUser` value             |\n         |     action name 'alertUser'     +-------------------------------+\n         |     sent to controller\n         v\n    Controller\n    +------------------------------------------ +\n    |                                           |\n    |  actions: {                               |\n    |     alertUser: function( currentValue ){  |\n    |       alert( 'the esc key was pressed!' ) |\n    |     }                                     |\n    |  }                                        |\n    |                                           |\n    +-------------------------------------------+\n    ```\n  \n    Here are the events that we currently support along with the name of the\n    attribute you would need to use on your field. To reiterate, you would use the\n    attribute name like so:\n  \n    ```handlebars\n      {{input attribute-name='controllerAction'}}\n    ```\n  \n    ```\n    +--------------------+----------------+\n    |                    |                |\n    | event              | attribute name |\n    +--------------------+----------------+\n    | new line inserted  | insert-newline |\n    |                    |                |\n    | enter key pressed  | enter          |\n    |                    |                |\n    | cancel key pressed | escape-press   |\n    |                    |                |\n    | focusin            | focus-in       |\n    |                    |                |\n    | focusout           | focus-out      |\n    |                    |                |\n    | keypress           | key-press      |\n    |                    |                |\n    | keyup              | key-up         |\n    |                    |                |\n    | keydown            | key-down       |\n    +--------------------+----------------+\n    ```\n  \n    @class TextSupport\n    @namespace Ember\n    @uses Ember.TargetActionSupport\n    @extends Mixin\n    @private\n  */\n\n  var _default = _metal.Mixin.create(_runtime.TargetActionSupport, {\n    value: '',\n    attributeBindings: ['autocapitalize', 'autocorrect', 'autofocus', 'disabled', 'form', 'maxlength', 'minlength', 'placeholder', 'readonly', 'required', 'selectionDirection', 'spellcheck', 'tabindex', 'title'],\n    placeholder: null,\n    disabled: false,\n    maxlength: null,\n\n    init() {\n      this._super(...arguments);\n\n      this.on('paste', this, this._elementValueDidChange);\n      this.on('cut', this, this._elementValueDidChange);\n      this.on('input', this, this._elementValueDidChange);\n    },\n\n    /**\n      Whether the `keyUp` event that triggers an `action` to be sent continues\n      propagating to other views.\n       By default, when the user presses the return key on their keyboard and\n      the text field has an `action` set, the action will be sent to the view's\n      controller and the key event will stop propagating.\n       If you would like parent views to receive the `keyUp` event even after an\n      action has been dispatched, set `bubbles` to true.\n       @property bubbles\n      @type Boolean\n      @default false\n      @private\n    */\n    bubbles: false,\n\n    interpretKeyEvents(event) {\n      var map = KEY_EVENTS;\n      var method = map[event.keyCode];\n\n      this._elementValueDidChange();\n\n      if (method) {\n        return this[method](event);\n      }\n    },\n\n    _elementValueDidChange() {\n      (0, _metal.set)(this, 'value', this.element.value);\n    },\n\n    change(event) {\n      this._elementValueDidChange(event);\n    },\n\n    /**\n      Allows you to specify a controller action to invoke when either the `enter`\n      key is pressed or, in the case of the field being a textarea, when a newline\n      is inserted. To use this method, give your field an `insert-newline`\n      attribute. The value of that attribute should be the name of the action\n      in your controller that you wish to invoke.\n       For an example on how to use the `insert-newline` attribute, please\n      reference the example near the top of this file.\n       @method insertNewline\n      @param {Event} event\n      @private\n    */\n    insertNewline(event) {\n      sendAction('enter', this, event);\n      sendAction('insert-newline', this, event);\n    },\n\n    /**\n      Allows you to specify a controller action to invoke when the escape button\n      is pressed. To use this method, give your field an `escape-press`\n      attribute. The value of that attribute should be the name of the action\n      in your controller that you wish to invoke.\n       For an example on how to use the `escape-press` attribute, please reference\n      the example near the top of this file.\n       @method cancel\n      @param {Event} event\n      @private\n    */\n    cancel(event) {\n      sendAction('escape-press', this, event);\n    },\n\n    /**\n      Allows you to specify a controller action to invoke when a field receives\n      focus. To use this method, give your field a `focus-in` attribute. The value\n      of that attribute should be the name of the action in your controller\n      that you wish to invoke.\n       For an example on how to use the `focus-in` attribute, please reference the\n      example near the top of this file.\n       @method focusIn\n      @param {Event} event\n      @private\n    */\n    focusIn(event) {\n      sendAction('focus-in', this, event);\n    },\n\n    /**\n      Allows you to specify a controller action to invoke when a field loses\n      focus. To use this method, give your field a `focus-out` attribute. The value\n      of that attribute should be the name of the action in your controller\n      that you wish to invoke.\n       For an example on how to use the `focus-out` attribute, please reference the\n      example near the top of this file.\n       @method focusOut\n      @param {Event} event\n      @private\n    */\n    focusOut(event) {\n      this._elementValueDidChange(event);\n\n      sendAction('focus-out', this, event);\n    },\n\n    /**\n      Allows you to specify a controller action to invoke when a key is pressed.\n      To use this method, give your field a `key-press` attribute. The value of\n      that attribute should be the name of the action in your controller you\n      that wish to invoke.\n       For an example on how to use the `key-press` attribute, please reference the\n      example near the top of this file.\n       @method keyPress\n      @param {Event} event\n      @private\n    */\n    keyPress(event) {\n      sendAction('key-press', this, event);\n    },\n\n    /**\n      Allows you to specify a controller action to invoke when a key-up event is\n      fired. To use this method, give your field a `key-up` attribute. The value\n      of that attribute should be the name of the action in your controller\n      that you wish to invoke.\n       For an example on how to use the `key-up` attribute, please reference the\n      example near the top of this file.\n       @method keyUp\n      @param {Event} event\n      @private\n    */\n    keyUp(event) {\n      this.interpretKeyEvents(event);\n      sendAction('key-up', this, event);\n    },\n\n    /**\n      Allows you to specify a controller action to invoke when a key-down event is\n      fired. To use this method, give your field a `key-down` attribute. The value\n      of that attribute should be the name of the action in your controller that\n      you wish to invoke.\n       For an example on how to use the `key-down` attribute, please reference the\n      example near the top of this file.\n       @method keyDown\n      @param {Event} event\n      @private\n    */\n    keyDown(event) {\n      sendAction('key-down', this, event);\n    }\n\n  }); // In principle, this shouldn't be necessary, but the legacy\n  // sendAction semantics for TextField are different from\n  // the component semantics so this method normalizes them.\n\n\n  _exports.default = _default;\n\n  function sendAction(eventName, view, event) {\n    var actionName = (0, _metal.get)(view, \"attrs.\" + eventName) || (0, _metal.get)(view, eventName);\n    var value = (0, _metal.get)(view, 'value');\n\n    if (_deprecatedFeatures.SEND_ACTION && typeof actionName === 'string') {\n      var message = \"Passing actions to components as strings (like `<Input @\" + eventName + \"=\\\"\" + actionName + \"\\\" />`) is deprecated. Please use closure actions instead (`<Input @\" + eventName + \"={{action \\\"\" + actionName + \"\\\"}} />`).\";\n      (true && !(false) && (0, _debug.deprecate)(message, false, {\n        id: 'ember-component.send-action',\n        until: '4.0.0',\n        url: 'https://emberjs.com/deprecations/v3.x#toc_ember-component-send-action'\n      }));\n      view.triggerAction({\n        action: actionName,\n        actionContext: [value, event]\n      });\n    } else if (typeof actionName === 'function') {\n      actionName(value, event);\n    }\n\n    if (actionName && !(0, _metal.get)(view, 'bubbles')) {\n      event.stopPropagation();\n    }\n  }\n});","define(\"@ember/-internals/views/lib/mixins/view_state_support\", [\"exports\", \"@ember/-internals/metal\"], function (_exports, _metal) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n  @module ember\n  */\n  var _default = _metal.Mixin.create({\n    _transitionTo(state) {\n      var priorState = this._currentState;\n      var currentState = this._currentState = this._states[state];\n      this._state = state;\n\n      if (priorState && priorState.exit) {\n        priorState.exit(this);\n      }\n\n      if (currentState.enter) {\n        currentState.enter(this);\n      }\n    }\n\n  });\n\n  _exports.default = _default;\n});","define(\"@ember/-internals/views/lib/mixins/view_support\", [\"exports\", \"@ember/-internals/utils\", \"@ember/-internals/metal\", \"@ember/debug\", \"@ember/-internals/browser-environment\", \"@ember/-internals/views/lib/system/utils\", \"@ember/-internals/views/lib/system/jquery\", \"@ember/deprecated-features\"], function (_exports, _utils, _metal, _debug, _browserEnvironment, _utils2, _jquery, _deprecatedFeatures) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  function K() {\n    return this;\n  }\n\n  var mixin = {\n    /**\n     A list of properties of the view to apply as attributes. If the property\n     is a string value, the value of that string will be applied as the value\n     for an attribute of the property's name.\n      The following example creates a tag like `<div priority=\"high\" />`.\n      ```app/components/my-component.js\n     import Component from '@ember/component';\n      export default Component.extend({\n        attributeBindings: ['priority'],\n        priority: 'high'\n      });\n     ```\n      If the value of the property is a Boolean, the attribute is treated as\n     an HTML Boolean attribute. It will be present if the property is `true`\n     and omitted if the property is `false`.\n      The following example creates markup like `<div visible />`.\n      ```app/components/my-component.js\n     import Component from '@ember/component';\n      export default Component.extend({\n        attributeBindings: ['visible'],\n        visible: true\n      });\n     ```\n      If you would prefer to use a custom value instead of the property name,\n     you can create the same markup as the last example with a binding like\n     this:\n      ```app/components/my-component.js\n     import Component from '@ember/component';\n      export default Component.extend({\n        attributeBindings: ['isVisible:visible'],\n        isVisible: true\n      });\n     ```\n      This list of attributes is inherited from the component's superclasses,\n     as well.\n      @property attributeBindings\n     @type Array\n     @default []\n     @public\n     */\n    concatenatedProperties: ['attributeBindings'],\n\n    // ..........................................................\n    // TEMPLATE SUPPORT\n    //\n\n    /**\n     Return the nearest ancestor that is an instance of the provided\n     class or mixin.\n      @method nearestOfType\n     @param {Class,Mixin} klass Subclass of Ember.View (or Ember.View itself),\n     or an instance of Mixin.\n     @return Ember.View\n     @deprecated use `yield` and contextual components for composition instead.\n     @private\n     */\n    nearestOfType(klass) {\n      var view = this.parentView;\n      var isOfType = klass instanceof _metal.Mixin ? view => klass.detect(view) : view => klass.detect(view.constructor);\n\n      while (view) {\n        if (isOfType(view)) {\n          return view;\n        }\n\n        view = view.parentView;\n      }\n    },\n\n    /**\n     Return the nearest ancestor that has a given property.\n      @method nearestWithProperty\n     @param {String} property A property name\n     @return Ember.View\n     @deprecated use `yield` and contextual components for composition instead.\n     @private\n     */\n    nearestWithProperty(property) {\n      var view = this.parentView;\n\n      while (view) {\n        if (property in view) {\n          return view;\n        }\n\n        view = view.parentView;\n      }\n    },\n\n    /**\n     Renders the view again. This will work regardless of whether the\n     view is already in the DOM or not. If the view is in the DOM, the\n     rendering process will be deferred to give bindings a chance\n     to synchronize.\n      If children were added during the rendering process using `appendChild`,\n     `rerender` will remove them, because they will be added again\n     if needed by the next `render`.\n      In general, if the display of your view changes, you should modify\n     the DOM element directly instead of manually calling `rerender`, which can\n     be slow.\n      @method rerender\n     @public\n     */\n    rerender() {\n      return this._currentState.rerender(this);\n    },\n\n    // ..........................................................\n    // ELEMENT SUPPORT\n    //\n\n    /**\n     Returns the current DOM element for the view.\n       @property element\n      @type DOMElement\n      @public\n    */\n    element: (0, _metal.nativeDescDecorator)({\n      configurable: false,\n      enumerable: false,\n\n      get() {\n        return this.renderer.getElement(this);\n      }\n\n    }),\n\n    /**\n     Appends the view's element to the specified parent element.\n      Note that this method just schedules the view to be appended; the DOM\n     element will not be appended to the given element until all bindings have\n     finished synchronizing.\n      This is not typically a function that you will need to call directly when\n     building your application. If you do need to use `appendTo`, be sure that\n     the target element you are providing is associated with an `Application`\n     and does not have an ancestor element that is associated with an Ember view.\n      @method appendTo\n     @param {String|DOMElement|jQuery} A selector, element, HTML string, or jQuery object\n     @return {Ember.View} receiver\n     @private\n     */\n    appendTo(selector) {\n      var target;\n\n      if (_browserEnvironment.hasDOM) {\n        target = typeof selector === 'string' ? document.querySelector(selector) : selector;\n        (true && !(target) && (0, _debug.assert)(\"You tried to append to (\" + selector + \") but that isn't in the DOM\", target));\n        (true && !(!(0, _utils2.matches)(target, '.ember-view')) && (0, _debug.assert)('You cannot append to an existing Ember.View.', !(0, _utils2.matches)(target, '.ember-view')));\n        (true && !((() => {\n          var node = target.parentNode;\n\n          while (node) {\n            if (node.nodeType !== 9 && (0, _utils2.matches)(node, '.ember-view')) {\n              return false;\n            }\n\n            node = node.parentNode;\n          }\n\n          return true;\n        })()) && (0, _debug.assert)('You cannot append to an existing Ember.View.', (() => {\n          var node = target.parentNode;\n\n          while (node) {\n            if (node.nodeType !== 9 && (0, _utils2.matches)(node, '.ember-view')) {\n              return false;\n            }\n\n            node = node.parentNode;\n          }\n\n          return true;\n        })()));\n      } else {\n        target = selector;\n        (true && !(typeof target !== 'string') && (0, _debug.assert)(\"You tried to append to a selector string (\" + selector + \") in an environment without jQuery\", typeof target !== 'string'));\n        (true && !(typeof selector.appendChild === 'function') && (0, _debug.assert)(\"You tried to append to a non-Element (\" + selector + \") in an environment without jQuery\", typeof selector.appendChild === 'function'));\n      }\n\n      this.renderer.appendTo(this, target);\n      return this;\n    },\n\n    /**\n     Appends the view's element to the document body. If the view does\n     not have an HTML representation yet\n     the element will be generated automatically.\n      If your application uses the `rootElement` property, you must append\n     the view within that element. Rendering views outside of the `rootElement`\n     is not supported.\n      Note that this method just schedules the view to be appended; the DOM\n     element will not be appended to the document body until all bindings have\n     finished synchronizing.\n      @method append\n     @return {Ember.View} receiver\n     @private\n     */\n    append() {\n      return this.appendTo(document.body);\n    },\n\n    /**\n     The HTML `id` of the view's element in the DOM. You can provide this\n     value yourself but it must be unique (just as in HTML):\n      ```handlebars\n     {{my-component elementId=\"a-really-cool-id\"}}\n     ```\n      If not manually set a default value will be provided by the framework.\n      Once rendered an element's `elementId` is considered immutable and you\n     should never change it. If you need to compute a dynamic value for the\n     `elementId`, you should do this when the component or element is being\n     instantiated:\n      ```app/components/my-component.js\n     import Component from '@ember/component';\n      export default Component.extend({\n        init() {\n          this._super(...arguments);\n          let index = this.get('index');\n          this.set('elementId', 'component-id' + index);\n        }\n      });\n     ```\n      @property elementId\n     @type String\n     @public\n     */\n    elementId: null,\n\n    /**\n     Called when a view is going to insert an element into the DOM.\n      @event willInsertElement\n     @public\n     */\n    willInsertElement: K,\n\n    /**\n     Called when the element of the view has been inserted into the DOM.\n     Override this function to do any set up that requires an element\n     in the document body.\n      When a view has children, didInsertElement will be called on the\n     child view(s) first and on itself afterwards.\n      @event didInsertElement\n     @public\n     */\n    didInsertElement: K,\n\n    /**\n     Called when the view is about to rerender, but before anything has\n     been torn down. This is a good opportunity to tear down any manual\n     observers you have installed based on the DOM state\n      @event willClearRender\n     @public\n     */\n    willClearRender: K,\n\n    /**\n     You must call `destroy` on a view to destroy the view (and all of its\n     child views). This will remove the view from any parent node, then make\n     sure that the DOM element managed by the view can be released by the\n     memory manager.\n      @method destroy\n     @private\n     */\n    destroy() {\n      this._super(...arguments);\n\n      this._currentState.destroy(this);\n    },\n\n    /**\n     Called when the element of the view is going to be destroyed. Override\n     this function to do any teardown that requires an element, like removing\n     event listeners.\n      Please note: any property changes made during this event will have no\n     effect on object observers.\n      @event willDestroyElement\n     @public\n     */\n    willDestroyElement: K,\n\n    /**\n     Called after the element of the view is destroyed.\n      @event willDestroyElement\n     @public\n     */\n    didDestroyElement: K,\n\n    /**\n     Called when the parentView property has changed.\n      @event parentViewDidChange\n     @private\n     */\n    parentViewDidChange: K,\n    // ..........................................................\n    // STANDARD RENDER PROPERTIES\n    //\n\n    /**\n     Tag name for the view's outer element. The tag name is only used when an\n     element is first created. If you change the `tagName` for an element, you\n     must destroy and recreate the view element.\n      By default, the render buffer will use a `<div>` tag for views.\n      If the tagName is `''`, the view will be tagless, with no outer element.\n     Component properties that depend on the presence of an outer element, such\n     as `classNameBindings` and `attributeBindings`, do not work with tagless\n     components. Tagless components cannot implement methods to handle events,\n     and have no associated jQuery object to return with `$()`.\n      @property tagName\n     @type String\n     @default null\n     @public\n     */\n    // We leave this null by default so we can tell the difference between\n    // the default case and a user-specified tag.\n    tagName: null,\n\n    // .......................................................\n    // CORE DISPLAY METHODS\n    //\n\n    /**\n     Setup a view, but do not finish waking it up.\n      * configure `childViews`\n     * register the view with the global views hash, which is used for event\n     dispatch\n      @method init\n     @private\n     */\n    init() {\n      this._super(...arguments); // tslint:disable-next-line:max-line-length\n\n\n      (true && !((0, _metal.descriptorForProperty)(this, 'elementId') === undefined) && (0, _debug.assert)(\"You cannot use a computed property for the component's `elementId` (\" + this + \").\", (0, _metal.descriptorForProperty)(this, 'elementId') === undefined)); // tslint:disable-next-line:max-line-length\n\n      (true && !((0, _metal.descriptorForProperty)(this, 'tagName') === undefined) && (0, _debug.assert)(\"You cannot use a computed property for the component's `tagName` (\" + this + \").\", (0, _metal.descriptorForProperty)(this, 'tagName') === undefined));\n\n      if (!this.elementId && this.tagName !== '') {\n        this.elementId = (0, _utils.guidFor)(this);\n      }\n\n      (true && !(!this.render) && (0, _debug.assert)('Using a custom `.render` function is no longer supported.', !this.render));\n    },\n\n    // .......................................................\n    // EVENT HANDLING\n    //\n\n    /**\n     Handle events from `EventDispatcher`\n      @method handleEvent\n     @param eventName {String}\n     @param evt {Event}\n     @private\n     */\n    handleEvent(eventName, evt) {\n      return this._currentState.handleEvent(this, eventName, evt);\n    }\n\n  };\n\n  if (_deprecatedFeatures.JQUERY_INTEGRATION) {\n    /**\n     Returns a jQuery object for this view's element. If you pass in a selector\n     string, this method will return a jQuery object, using the current element\n     as its buffer.\n      For example, calling `view.$('li')` will return a jQuery object containing\n     all of the `li` elements inside the DOM element of this view.\n      @method $\n     @param {String} [selector] a jQuery-compatible selector string\n     @return {jQuery} the jQuery object for the DOM node\n     @public\n     @deprecated\n     */\n    mixin.$ = function $(sel) {\n      (true && !(this.tagName !== '') && (0, _debug.assert)(\"You cannot access this.$() on a component with `tagName: ''` specified.\", this.tagName !== ''));\n      (true && !(!_jquery.jQueryDisabled) && (0, _debug.assert)('You cannot access this.$() with `jQuery` disabled.', !_jquery.jQueryDisabled));\n      (true && !(false) && (0, _debug.deprecate)('Using this.$() in a component has been deprecated, consider using this.element', false, {\n        id: 'ember-views.curly-components.jquery-element',\n        until: '4.0.0',\n        url: 'https://emberjs.com/deprecations/v3.x#toc_jquery-apis'\n      }));\n\n      if (this.element) {\n        return sel ? (0, _jquery.jQuery)(sel, this.element) : (0, _jquery.jQuery)(this.element);\n      }\n    };\n  }\n  /**\n   @class ViewMixin\n   @namespace Ember\n   @private\n  */\n\n\n  var _default = _metal.Mixin.create(mixin);\n\n  _exports.default = _default;\n});","define(\"@ember/-internals/views/lib/system/action_manager\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = ActionManager;\n\n  /**\n  @module ember\n  */\n  function ActionManager() {}\n  /**\n    Global action id hash.\n  \n    @private\n    @property registeredActions\n    @type Object\n  */\n\n\n  ActionManager.registeredActions = {};\n});","define(\"@ember/-internals/views/lib/system/event_dispatcher\", [\"exports\", \"@ember/-internals/owner\", \"@ember/polyfills\", \"@ember/debug\", \"@ember/-internals/metal\", \"@ember/-internals/runtime\", \"@ember/-internals/views\", \"@ember/-internals/views/lib/system/jquery\", \"@ember/-internals/views/lib/system/action_manager\", \"@ember/-internals/views/lib/system/jquery_event_deprecation\", \"@ember/-internals/views/lib/system/utils\", \"@ember/deprecated-features\"], function (_exports, _owner, _polyfills, _debug, _metal, _runtime, _views, _jquery, _action_manager, _jquery_event_deprecation, _utils, _deprecatedFeatures) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n  @module ember\n  */\n  var ROOT_ELEMENT_CLASS = 'ember-application';\n  var ROOT_ELEMENT_SELECTOR = \".\" + ROOT_ELEMENT_CLASS;\n  var EVENT_MAP = {\n    mouseenter: 'mouseover',\n    mouseleave: 'mouseout'\n  };\n  /**\n    `Ember.EventDispatcher` handles delegating browser events to their\n    corresponding `Ember.Views.` For example, when you click on a view,\n    `Ember.EventDispatcher` ensures that that view's `mouseDown` method gets\n    called.\n  \n    @class EventDispatcher\n    @namespace Ember\n    @private\n    @extends Ember.Object\n  */\n\n  var _default = _runtime.Object.extend({\n    /**\n      The set of events names (and associated handler function names) to be setup\n      and dispatched by the `EventDispatcher`. Modifications to this list can be done\n      at setup time, generally via the `Application.customEvents` hash.\n       To add new events to be listened to:\n       ```javascript\n      import Application from '@ember/application';\n       let App = Application.create({\n        customEvents: {\n          paste: 'paste'\n        }\n      });\n      ```\n       To prevent default events from being listened to:\n       ```javascript\n      import Application from '@ember/application';\n       let App = Application.create({\n        customEvents: {\n          mouseenter: null,\n          mouseleave: null\n        }\n      });\n      ```\n      @property events\n      @type Object\n      @private\n    */\n    events: (0, _polyfills.assign)({\n      touchstart: 'touchStart',\n      touchmove: 'touchMove',\n      touchend: 'touchEnd',\n      touchcancel: 'touchCancel',\n      keydown: 'keyDown',\n      keyup: 'keyUp',\n      keypress: 'keyPress',\n      mousedown: 'mouseDown',\n      mouseup: 'mouseUp',\n      contextmenu: 'contextMenu',\n      click: 'click',\n      dblclick: 'doubleClick',\n      focusin: 'focusIn',\n      focusout: 'focusOut',\n      submit: 'submit',\n      input: 'input',\n      change: 'change',\n      dragstart: 'dragStart',\n      drag: 'drag',\n      dragenter: 'dragEnter',\n      dragleave: 'dragLeave',\n      dragover: 'dragOver',\n      drop: 'drop',\n      dragend: 'dragEnd'\n    }, _deprecatedFeatures.MOUSE_ENTER_LEAVE_MOVE_EVENTS ? {\n      mouseenter: 'mouseEnter',\n      mouseleave: 'mouseLeave',\n      mousemove: 'mouseMove'\n    } : {}),\n\n    /**\n      The root DOM element to which event listeners should be attached. Event\n      listeners will be attached to the document unless this is overridden.\n       Can be specified as a DOMElement or a selector string.\n       The default body is a string since this may be evaluated before document.body\n      exists in the DOM.\n       @private\n      @property rootElement\n      @type DOMElement\n      @default 'body'\n    */\n    rootElement: 'body',\n\n    init() {\n      this._super();\n\n      (true && !((() => {\n        var owner = (0, _owner.getOwner)(this);\n        var environment = owner.lookup('-environment:main');\n        return environment.isInteractive;\n      })()) && (0, _debug.assert)('EventDispatcher should never be instantiated in fastboot mode. Please report this as an Ember bug.', (() => {\n        var owner = (0, _owner.getOwner)(this);\n        var environment = owner.lookup('-environment:main');\n        return environment.isInteractive;\n      })()));\n      this._eventHandlers = Object.create(null);\n    },\n\n    /**\n      Sets up event listeners for standard browser events.\n       This will be called after the browser sends a `DOMContentReady` event. By\n      default, it will set up all of the listeners on the document body. If you\n      would like to register the listeners on a different element, set the event\n      dispatcher's `root` property.\n       @private\n      @method setup\n      @param addedEvents {Object}\n    */\n    setup(addedEvents, _rootElement) {\n      var events = this._finalEvents = (0, _polyfills.assign)({}, (0, _metal.get)(this, 'events'), addedEvents);\n\n      if (_rootElement !== undefined && _rootElement !== null) {\n        (0, _metal.set)(this, 'rootElement', _rootElement);\n      }\n\n      var rootElementSelector = (0, _metal.get)(this, 'rootElement');\n      var rootElement;\n\n      if (!_deprecatedFeatures.JQUERY_INTEGRATION || _jquery.jQueryDisabled) {\n        if (typeof rootElementSelector !== 'string') {\n          rootElement = rootElementSelector;\n        } else {\n          rootElement = document.querySelector(rootElementSelector);\n        }\n\n        (true && !(!rootElement.classList.contains(ROOT_ELEMENT_CLASS)) && (0, _debug.assert)(\"You cannot use the same root element (\" + ((0, _metal.get)(this, 'rootElement') || rootElement.tagName) + \") multiple times in an Ember.Application\", !rootElement.classList.contains(ROOT_ELEMENT_CLASS)));\n        (true && !((() => {\n          var target = rootElement.parentNode;\n\n          do {\n            if (target.classList.contains(ROOT_ELEMENT_CLASS)) {\n              return false;\n            }\n\n            target = target.parentNode;\n          } while (target && target.nodeType === 1);\n\n          return true;\n        })()) && (0, _debug.assert)('You cannot make a new Ember.Application using a root element that is a descendent of an existing Ember.Application', (() => {\n          var target = rootElement.parentNode;\n\n          do {\n            if (target.classList.contains(ROOT_ELEMENT_CLASS)) {\n              return false;\n            }\n\n            target = target.parentNode;\n          } while (target && target.nodeType === 1);\n\n          return true;\n        })()));\n        (true && !(!rootElement.querySelector(ROOT_ELEMENT_SELECTOR)) && (0, _debug.assert)('You cannot make a new Ember.Application using a root element that is an ancestor of an existing Ember.Application', !rootElement.querySelector(ROOT_ELEMENT_SELECTOR)));\n        rootElement.classList.add(ROOT_ELEMENT_CLASS);\n        (true && !(rootElement.classList.contains(ROOT_ELEMENT_CLASS)) && (0, _debug.assert)(\"Unable to add '\" + ROOT_ELEMENT_CLASS + \"' class to root element (\" + ((0, _metal.get)(this, 'rootElement') || rootElement.tagName) + \"). Make sure you set rootElement to the body or an element in the body.\", rootElement.classList.contains(ROOT_ELEMENT_CLASS)));\n      } else {\n        rootElement = (0, _jquery.jQuery)(rootElementSelector);\n        (true && !(!rootElement.is(ROOT_ELEMENT_SELECTOR)) && (0, _debug.assert)(\"You cannot use the same root element (\" + (rootElement.selector || rootElement[0].tagName) + \") multiple times in an Ember.Application\", !rootElement.is(ROOT_ELEMENT_SELECTOR)));\n        (true && !(!rootElement.closest(ROOT_ELEMENT_SELECTOR).length) && (0, _debug.assert)('You cannot make a new Ember.Application using a root element that is a descendent of an existing Ember.Application', !rootElement.closest(ROOT_ELEMENT_SELECTOR).length));\n        (true && !(!rootElement.find(ROOT_ELEMENT_SELECTOR).length) && (0, _debug.assert)('You cannot make a new Ember.Application using a root element that is an ancestor of an existing Ember.Application', !rootElement.find(ROOT_ELEMENT_SELECTOR).length));\n        rootElement.addClass(ROOT_ELEMENT_CLASS);\n\n        if (!rootElement.is(ROOT_ELEMENT_SELECTOR)) {\n          throw new TypeError(\"Unable to add '\" + ROOT_ELEMENT_CLASS + \"' class to root element (\" + (rootElement.selector || rootElement[0].tagName) + \"). Make sure you set rootElement to the body or an element in the body.\");\n        }\n      }\n\n      for (var event in events) {\n        if (events.hasOwnProperty(event)) {\n          this.setupHandler(rootElement, event, events[event]);\n        }\n      }\n    },\n\n    /**\n      Registers an event listener on the rootElement. If the given event is\n      triggered, the provided event handler will be triggered on the target view.\n       If the target view does not implement the event handler, or if the handler\n      returns `false`, the parent view will be called. The event will continue to\n      bubble to each successive parent view until it reaches the top.\n       @private\n      @method setupHandler\n      @param {Element} rootElement\n      @param {String} event the browser-originated event to listen to\n      @param {String} eventName the name of the method to call on the view\n    */\n    setupHandler(rootElement, event, eventName) {\n      if (eventName === null) {\n        return;\n      }\n\n      if (!_deprecatedFeatures.JQUERY_INTEGRATION || _jquery.jQueryDisabled) {\n        var viewHandler = (target, event) => {\n          var view = (0, _views.getElementView)(target);\n          var result = true;\n\n          if (view) {\n            result = view.handleEvent(eventName, event);\n          }\n\n          return result;\n        };\n\n        var actionHandler = (target, event) => {\n          var actionId = target.getAttribute('data-ember-action');\n          var actions = _action_manager.default.registeredActions[actionId]; // In Glimmer2 this attribute is set to an empty string and an additional\n          // attribute it set for each action on a given element. In this case, the\n          // attributes need to be read so that a proper set of action handlers can\n          // be coalesced.\n\n          if (actionId === '') {\n            var attributes = target.attributes;\n            var attributeCount = attributes.length;\n            actions = [];\n\n            for (var i = 0; i < attributeCount; i++) {\n              var attr = attributes.item(i);\n              var attrName = attr.name;\n\n              if (attrName.indexOf('data-ember-action-') === 0) {\n                actions = actions.concat(_action_manager.default.registeredActions[attr.value]);\n              }\n            }\n          } // We have to check for actions here since in some cases, jQuery will trigger\n          // an event on `removeChild` (i.e. focusout) after we've already torn down the\n          // action handlers for the view.\n\n\n          if (!actions) {\n            return;\n          }\n\n          var result = true;\n\n          for (var index = 0; index < actions.length; index++) {\n            var action = actions[index];\n\n            if (action && action.eventName === eventName) {\n              // return false if any of the action handlers returns false\n              result = action.handler(event) && result;\n            }\n          }\n\n          return result;\n        }; // Special handling of events that don't bubble (event delegation does not work).\n        // Mimics the way this is handled in jQuery,\n        // see https://github.com/jquery/jquery/blob/899c56f6ada26821e8af12d9f35fa039100e838e/src/event.js#L666-L700\n\n\n        if (_deprecatedFeatures.MOUSE_ENTER_LEAVE_MOVE_EVENTS && EVENT_MAP[event] !== undefined) {\n          var mappedEventType = EVENT_MAP[event];\n          var origEventType = event;\n\n          var createFakeEvent = (eventType, event) => {\n            var fakeEvent = document.createEvent('MouseEvent');\n            fakeEvent.initMouseEvent(eventType, false, false, event.view, event.detail, event.screenX, event.screenY, event.clientX, event.clientY, event.ctrlKey, event.altKey, event.shiftKey, event.metaKey, event.button, event.relatedTarget); // fake event.target as we don't dispatch the event\n\n            Object.defineProperty(fakeEvent, 'target', {\n              value: event.target,\n              enumerable: true\n            });\n            return fakeEvent;\n          };\n\n          var handleMappedEvent = this._eventHandlers[mappedEventType] = event => {\n            var target = event.target;\n            var related = event.relatedTarget;\n\n            while (target && target.nodeType === 1 && (related === null || related !== target && !(0, _utils.contains)(target, related))) {\n              // mouseEnter/Leave don't bubble, so there is no logic to prevent it as with other events\n              if ((0, _views.getElementView)(target)) {\n                viewHandler(target, createFakeEvent(origEventType, event));\n              } else if (target.hasAttribute('data-ember-action')) {\n                actionHandler(target, createFakeEvent(origEventType, event));\n              } // separate mouseEnter/Leave events are dispatched for each listening element\n              // until the element (related) has been reached that the pointing device exited from/to\n\n\n              target = target.parentNode;\n            }\n          };\n\n          rootElement.addEventListener(mappedEventType, handleMappedEvent);\n        } else {\n          var handleEvent = this._eventHandlers[event] = event => {\n            var target = event.target;\n\n            do {\n              if ((0, _views.getElementView)(target)) {\n                if (viewHandler(target, event) === false) {\n                  event.preventDefault();\n                  event.stopPropagation();\n                  break;\n                } else if (event.cancelBubble === true) {\n                  break;\n                }\n              } else if (typeof target.hasAttribute === 'function' && target.hasAttribute('data-ember-action')) {\n                if (actionHandler(target, event) === false) {\n                  break;\n                }\n              }\n\n              target = target.parentNode;\n            } while (target && target.nodeType === 1);\n          };\n\n          rootElement.addEventListener(event, handleEvent);\n        }\n      } else {\n        rootElement.on(event + \".ember\", '.ember-view', function (evt) {\n          var view = (0, _views.getElementView)(this);\n          var result = true;\n\n          if (view) {\n            result = view.handleEvent(eventName, (0, _jquery_event_deprecation.default)(evt));\n          }\n\n          return result;\n        });\n        rootElement.on(event + \".ember\", '[data-ember-action]', evt => {\n          var attributes = evt.currentTarget.attributes;\n          var handledActions = [];\n          evt = (0, _jquery_event_deprecation.default)(evt);\n\n          for (var i = 0; i < attributes.length; i++) {\n            var attr = attributes.item(i);\n            var attrName = attr.name;\n\n            if (attrName.lastIndexOf('data-ember-action-', 0) !== -1) {\n              var action = _action_manager.default.registeredActions[attr.value]; // We have to check for action here since in some cases, jQuery will trigger\n              // an event on `removeChild` (i.e. focusout) after we've already torn down the\n              // action handlers for the view.\n\n              if (action && action.eventName === eventName && handledActions.indexOf(action) === -1) {\n                action.handler(evt); // Action handlers can mutate state which in turn creates new attributes on the element.\n                // This effect could cause the `data-ember-action` attribute to shift down and be invoked twice.\n                // To avoid this, we keep track of which actions have been handled.\n\n                handledActions.push(action);\n              }\n            }\n          }\n        });\n      }\n    },\n\n    destroy() {\n      var rootElementSelector = (0, _metal.get)(this, 'rootElement');\n      var rootElement;\n\n      if (rootElementSelector.nodeType) {\n        rootElement = rootElementSelector;\n      } else {\n        rootElement = document.querySelector(rootElementSelector);\n      }\n\n      if (!rootElement) {\n        return;\n      }\n\n      if (!_deprecatedFeatures.JQUERY_INTEGRATION || _jquery.jQueryDisabled) {\n        for (var event in this._eventHandlers) {\n          rootElement.removeEventListener(event, this._eventHandlers[event]);\n        }\n      } else {\n        (0, _jquery.jQuery)(rootElementSelector).off('.ember', '**');\n      }\n\n      rootElement.classList.remove(ROOT_ELEMENT_CLASS);\n      return this._super(...arguments);\n    },\n\n    toString() {\n      return '(EventDispatcher)';\n    }\n\n  });\n\n  _exports.default = _default;\n});","define(\"@ember/-internals/views/lib/system/jquery\", [\"exports\", \"@ember/-internals/environment\", \"@ember/-internals/browser-environment\", \"@ember/deprecated-features\"], function (_exports, _environment, _browserEnvironment, _deprecatedFeatures) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.jQueryDisabled = _exports.jQuery = void 0;\n  var jQuery;\n  _exports.jQuery = jQuery;\n  var jQueryDisabled = !_deprecatedFeatures.JQUERY_INTEGRATION || _environment.ENV._JQUERY_INTEGRATION === false;\n  _exports.jQueryDisabled = jQueryDisabled;\n\n  if (_deprecatedFeatures.JQUERY_INTEGRATION && _browserEnvironment.hasDOM) {\n    _exports.jQuery = jQuery = _environment.context.imports.jQuery;\n\n    if (!jQueryDisabled && jQuery) {\n      if (jQuery.event.addProp) {\n        jQuery.event.addProp('dataTransfer');\n      } else {\n        // http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#dndevents\n        ['dragstart', 'drag', 'dragenter', 'dragleave', 'dragover', 'drop', 'dragend'].forEach(eventName => {\n          jQuery.event.fixHooks[eventName] = {\n            props: ['dataTransfer']\n          };\n        });\n      }\n    } else {\n      _exports.jQuery = jQuery = undefined;\n      _exports.jQueryDisabled = jQueryDisabled = true;\n    }\n  }\n});","define(\"@ember/-internals/views/lib/system/jquery_event_deprecation\", [\"exports\", \"@ember/debug\", \"@ember/-internals/environment\", \"@ember/-internals/utils\", \"@ember/deprecated-features\"], function (_exports, _debug, _environment, _utils, _deprecatedFeatures) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = addJQueryEventDeprecation;\n\n  /* global Proxy */\n  function addJQueryEventDeprecation(jqEvent) {\n    if (true\n    /* DEBUG */\n    && _deprecatedFeatures.JQUERY_INTEGRATION && _utils.HAS_NATIVE_PROXY) {\n      var boundFunctions = new Map(); // wrap the jQuery event in a Proxy to add the deprecation message for originalEvent, according to RFC#294\n      // we need a native Proxy here, so we can make sure that the internal use of originalEvent in jQuery itself does\n      // not trigger a deprecation\n\n      return new Proxy(jqEvent, {\n        get(target, name) {\n          switch (name) {\n            case 'originalEvent':\n              (true && !((EmberENV => {\n                // this deprecation is intentionally checking `global.EmberENV` /\n                // `global.ENV` so that we can ensure we _only_ deprecate in the\n                // case where jQuery integration is enabled implicitly (e.g.\n                // \"defaulted\" to enabled) as opposed to when the user explicitly\n                // opts in to using jQuery\n                if (typeof EmberENV !== 'object' || EmberENV === null) return false;\n                return EmberENV._JQUERY_INTEGRATION === true;\n              })(_environment.global.EmberENV || _environment.global.ENV)) && (0, _debug.deprecate)('Accessing jQuery.Event specific properties is deprecated. Either use the ember-jquery-legacy addon to normalize events to native events, or explicitly opt into jQuery integration using @ember/optional-features.', (EmberENV => {\n                if (typeof EmberENV !== 'object' || EmberENV === null) return false;\n                return EmberENV._JQUERY_INTEGRATION === true;\n              })(_environment.global.EmberENV || _environment.global.ENV), {\n                id: 'ember-views.event-dispatcher.jquery-event',\n                until: '4.0.0',\n                url: 'https://emberjs.com/deprecations/v3.x#toc_jquery-event'\n              }));\n              return target[name];\n            // provide an escape hatch for ember-jquery-legacy to access originalEvent without a deprecation\n\n            case '__originalEvent':\n              return target.originalEvent;\n\n            default:\n              if (typeof target[name] === 'function') {\n                // cache functions for reuse\n                if (!boundFunctions.has(name)) {\n                  // for jQuery.Event methods call them with `target` as the `this` context, so they will access\n                  // `originalEvent` from the original jQuery event, not our proxy, thus not trigger the deprecation\n                  boundFunctions.set(name, target[name].bind(target));\n                }\n\n                return boundFunctions.get(name);\n              } // same for jQuery's getter functions for simple properties\n\n\n              return target[name];\n          }\n        }\n\n      });\n    }\n\n    return jqEvent;\n  }\n});","define(\"@ember/-internals/views/lib/system/utils\", [\"exports\", \"@ember/-internals/owner\", \"@ember/-internals/utils\", \"@ember/debug\"], function (_exports, _owner, _utils, _debug) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.isSimpleClick = isSimpleClick;\n  _exports.constructStyleDeprecationMessage = constructStyleDeprecationMessage;\n  _exports.getRootViews = getRootViews;\n  _exports.getViewId = getViewId;\n  _exports.getElementView = getElementView;\n  _exports.getViewElement = getViewElement;\n  _exports.setElementView = setElementView;\n  _exports.setViewElement = setViewElement;\n  _exports.clearElementView = clearElementView;\n  _exports.clearViewElement = clearViewElement;\n  _exports.getChildViews = getChildViews;\n  _exports.initChildViews = initChildViews;\n  _exports.addChildView = addChildView;\n  _exports.collectChildViews = collectChildViews;\n  _exports.getViewBounds = getViewBounds;\n  _exports.getViewRange = getViewRange;\n  _exports.getViewClientRects = getViewClientRects;\n  _exports.getViewBoundingClientRect = getViewBoundingClientRect;\n  _exports.matches = matches;\n  _exports.contains = contains;\n  _exports.elMatches = void 0;\n\n  /* globals Element */\n\n  /**\n  @module ember\n  */\n  function isSimpleClick(event) {\n    var modifier = event.shiftKey || event.metaKey || event.altKey || event.ctrlKey;\n    var secondaryClick = event.which > 1; // IE9 may return undefined\n\n    return !modifier && !secondaryClick;\n  }\n\n  function constructStyleDeprecationMessage(affectedStyle) {\n    return '' + 'Binding style attributes may introduce cross-site scripting vulnerabilities; ' + 'please ensure that values being bound are properly escaped. For more information, ' + 'including how to disable this warning, see ' + 'https://emberjs.com/deprecations/v1.x/#toc_binding-style-attributes. ' + 'Style affected: \"' + affectedStyle + '\"';\n  }\n  /**\n    @private\n    @method getRootViews\n    @param {Object} owner\n  */\n\n\n  function getRootViews(owner) {\n    var registry = owner.lookup('-view-registry:main');\n    var rootViews = [];\n    Object.keys(registry).forEach(id => {\n      var view = registry[id];\n\n      if (view.parentView === null) {\n        rootViews.push(view);\n      }\n    });\n    return rootViews;\n  }\n  /**\n    @private\n    @method getViewId\n    @param {Ember.View} view\n   */\n\n\n  function getViewId(view) {\n    if (view.tagName !== '' && view.elementId) {\n      return view.elementId;\n    } else {\n      return (0, _utils.guidFor)(view);\n    }\n  }\n\n  var ELEMENT_VIEW = new WeakMap();\n  var VIEW_ELEMENT = new WeakMap();\n\n  function getElementView(element) {\n    return ELEMENT_VIEW.get(element) || null;\n  }\n  /**\n    @private\n    @method getViewElement\n    @param {Ember.View} view\n   */\n\n\n  function getViewElement(view) {\n    return VIEW_ELEMENT.get(view) || null;\n  }\n\n  function setElementView(element, view) {\n    ELEMENT_VIEW.set(element, view);\n  }\n\n  function setViewElement(view, element) {\n    VIEW_ELEMENT.set(view, element);\n  } // These are not needed for GC, but for correctness. We want to be able to\n  // null-out these links while the objects are still live. Specifically, in\n  // this case, we want to prevent access to the element (and vice verse) during\n  // destruction.\n\n\n  function clearElementView(element) {\n    ELEMENT_VIEW.delete(element);\n  }\n\n  function clearViewElement(view) {\n    VIEW_ELEMENT.delete(view);\n  }\n\n  var CHILD_VIEW_IDS = new WeakMap();\n  /**\n    @private\n    @method getChildViews\n    @param {Ember.View} view\n  */\n\n  function getChildViews(view) {\n    var owner = (0, _owner.getOwner)(view);\n    var registry = owner.lookup('-view-registry:main');\n    return collectChildViews(view, registry);\n  }\n\n  function initChildViews(view) {\n    var childViews = new Set();\n    CHILD_VIEW_IDS.set(view, childViews);\n    return childViews;\n  }\n\n  function addChildView(parent, child) {\n    var childViews = CHILD_VIEW_IDS.get(parent);\n\n    if (childViews === undefined) {\n      childViews = initChildViews(parent);\n    }\n\n    childViews.add(getViewId(child));\n  }\n\n  function collectChildViews(view, registry) {\n    var views = [];\n    var childViews = CHILD_VIEW_IDS.get(view);\n\n    if (childViews !== undefined) {\n      childViews.forEach(id => {\n        var view = registry[id];\n\n        if (view && !view.isDestroying && !view.isDestroyed) {\n          views.push(view);\n        }\n      });\n    }\n\n    return views;\n  }\n  /**\n    @private\n    @method getViewBounds\n    @param {Ember.View} view\n  */\n\n\n  function getViewBounds(view) {\n    return view.renderer.getBounds(view);\n  }\n  /**\n    @private\n    @method getViewRange\n    @param {Ember.View} view\n  */\n\n\n  function getViewRange(view) {\n    var bounds = getViewBounds(view);\n    var range = document.createRange();\n    range.setStartBefore(bounds.firstNode);\n    range.setEndAfter(bounds.lastNode);\n    return range;\n  }\n  /**\n    `getViewClientRects` provides information about the position of the border\n    box edges of a view relative to the viewport.\n  \n    It is only intended to be used by development tools like the Ember Inspector\n    and may not work on older browsers.\n  \n    @private\n    @method getViewClientRects\n    @param {Ember.View} view\n  */\n\n\n  function getViewClientRects(view) {\n    var range = getViewRange(view);\n    return range.getClientRects();\n  }\n  /**\n    `getViewBoundingClientRect` provides information about the position of the\n    bounding border box edges of a view relative to the viewport.\n  \n    It is only intended to be used by development tools like the Ember Inspector\n    and may not work on older browsers.\n  \n    @private\n    @method getViewBoundingClientRect\n    @param {Ember.View} view\n  */\n\n\n  function getViewBoundingClientRect(view) {\n    var range = getViewRange(view);\n    return range.getBoundingClientRect();\n  }\n  /**\n    Determines if the element matches the specified selector.\n  \n    @private\n    @method matches\n    @param {DOMElement} el\n    @param {String} selector\n  */\n\n\n  var elMatches = typeof Element !== 'undefined' ? Element.prototype.matches || Element.prototype['matchesSelector'] || Element.prototype['mozMatchesSelector'] || Element.prototype['msMatchesSelector'] || Element.prototype['oMatchesSelector'] || Element.prototype['webkitMatchesSelector'] : undefined;\n  _exports.elMatches = elMatches;\n\n  function matches(el, selector) {\n    (true && !(elMatches !== undefined) && (0, _debug.assert)('cannot call `matches` in fastboot mode', elMatches !== undefined));\n    return elMatches.call(el, selector);\n  }\n\n  function contains(a, b) {\n    if (a.contains !== undefined) {\n      return a.contains(b);\n    }\n\n    var current = b.parentNode;\n\n    while (current && (current = current.parentNode)) {\n      if (current === a) {\n        return true;\n      }\n    }\n\n    return false;\n  }\n});","define(\"@ember/-internals/views/lib/views/core_view\", [\"exports\", \"@ember/-internals/runtime\", \"@ember/-internals/views/lib/views/states\"], function (_exports, _runtime, _states) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n    `Ember.CoreView` is an abstract class that exists to give view-like behavior\n    to both Ember's main view class `Component` and other classes that don't need\n    the full functionality of `Component`.\n  \n    Unless you have specific needs for `CoreView`, you will use `Component`\n    in your applications.\n  \n    @class CoreView\n    @namespace Ember\n    @extends EmberObject\n    @deprecated Use `Component` instead.\n    @uses Evented\n    @uses Ember.ActionHandler\n    @private\n  */\n  var CoreView = _runtime.FrameworkObject.extend(_runtime.Evented, _runtime.ActionHandler, {\n    isView: true,\n    _states: _states.default,\n\n    init() {\n      this._super(...arguments);\n\n      this._state = 'preRender';\n      this._currentState = this._states.preRender;\n\n      if (!this.renderer) {\n        throw new Error(\"Cannot instantiate a component without a renderer. Please ensure that you are creating \" + this + \" with a proper container/registry.\");\n      }\n    },\n\n    /**\n      If the view is currently inserted into the DOM of a parent view, this\n      property will point to the parent of the view.\n       @property parentView\n      @type Ember.View\n      @default null\n      @private\n    */\n    parentView: null,\n\n    instrumentDetails(hash) {\n      hash.object = this.toString();\n      hash.containerKey = this._debugContainerKey;\n      hash.view = this;\n      return hash;\n    },\n\n    /**\n      Override the default event firing from `Evented` to\n      also call methods with the given name.\n       @method trigger\n      @param name {String}\n      @private\n    */\n    trigger(name, ...args) {\n      this._super(...arguments);\n\n      var method = this[name];\n\n      if (typeof method === 'function') {\n        return method.apply(this, args);\n      }\n    },\n\n    has(name) {\n      return typeof this[name] === 'function' || this._super(name);\n    }\n\n  });\n\n  CoreView.reopenClass({\n    isViewFactory: true\n  });\n  var _default = CoreView;\n  _exports.default = _default;\n});","define(\"@ember/-internals/views/lib/views/states\", [\"exports\", \"@ember/-internals/views/lib/views/states/pre_render\", \"@ember/-internals/views/lib/views/states/has_element\", \"@ember/-internals/views/lib/views/states/in_dom\", \"@ember/-internals/views/lib/views/states/destroying\"], function (_exports, _pre_render, _has_element, _in_dom, _destroying) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /*\n    Describe how the specified actions should behave in the various\n    states that a view can exist in. Possible states:\n  \n    * preRender: when a view is first instantiated, and after its\n      element was destroyed, it is in the preRender state\n    * hasElement: the DOM representation of the view is created,\n      and is ready to be inserted\n    * inDOM: once a view has been inserted into the DOM it is in\n      the inDOM state. A view spends the vast majority of its\n      existence in this state.\n    * destroyed: once a view has been destroyed (using the destroy\n      method), it is in this state. No further actions can be invoked\n      on a destroyed view.\n  */\n  var states = Object.freeze({\n    preRender: _pre_render.default,\n    inDOM: _in_dom.default,\n    hasElement: _has_element.default,\n    destroying: _destroying.default\n  });\n  var _default = states;\n  _exports.default = _default;\n});","define(\"@ember/-internals/views/lib/views/states/default\", [\"exports\", \"@ember/error\"], function (_exports, _error) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  var _default = {\n    // appendChild is only legal while rendering the buffer.\n    appendChild() {\n      throw new _error.default(\"You can't use appendChild outside of the rendering process\");\n    },\n\n    // Handle events from `Ember.EventDispatcher`\n    handleEvent() {\n      return true; // continue event propagation\n    },\n\n    rerender() {},\n\n    destroy() {}\n\n  };\n\n  var _default2 = Object.freeze(_default);\n\n  _exports.default = _default2;\n});","define(\"@ember/-internals/views/lib/views/states/destroying\", [\"exports\", \"@ember/polyfills\", \"@ember/error\", \"@ember/-internals/views/lib/views/states/default\"], function (_exports, _polyfills, _error, _default3) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  var destroying = (0, _polyfills.assign)({}, _default3.default, {\n    appendChild() {\n      throw new _error.default(\"You can't call appendChild on a view being destroyed\");\n    },\n\n    rerender() {\n      throw new _error.default(\"You can't call rerender on a view being destroyed\");\n    }\n\n  });\n\n  var _default2 = Object.freeze(destroying);\n\n  _exports.default = _default2;\n});","define(\"@ember/-internals/views/lib/views/states/has_element\", [\"exports\", \"@ember/polyfills\", \"@ember/-internals/views/lib/views/states/default\", \"@ember/runloop\", \"@ember/instrumentation\"], function (_exports, _polyfills, _default3, _runloop, _instrumentation) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  var hasElement = (0, _polyfills.assign)({}, _default3.default, {\n    rerender(view) {\n      view.renderer.rerender(view);\n    },\n\n    destroy(view) {\n      view.renderer.remove(view);\n    },\n\n    // Handle events from `Ember.EventDispatcher`\n    handleEvent(view, eventName, event) {\n      if (view.has(eventName)) {\n        // Handler should be able to re-dispatch events, so we don't\n        // preventDefault or stopPropagation.\n        return (0, _instrumentation.flaggedInstrument)(\"interaction.\" + eventName, {\n          event,\n          view\n        }, () => {\n          return (0, _runloop.join)(view, view.trigger, eventName, event);\n        });\n      } else {\n        return true; // continue event propagation\n      }\n    }\n\n  });\n\n  var _default2 = Object.freeze(hasElement);\n\n  _exports.default = _default2;\n});","define(\"@ember/-internals/views/lib/views/states/in_dom\", [\"exports\", \"@ember/-internals/utils\", \"@ember/polyfills\", \"@ember/error\", \"@ember/-internals/views/lib/views/states/has_element\"], function (_exports, _utils, _polyfills, _error, _has_element) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  var inDOM = (0, _polyfills.assign)({}, _has_element.default, {\n    enter(view) {\n      // Register the view for event handling. This hash is used by\n      // Ember.EventDispatcher to dispatch incoming events.\n      view.renderer.register(view);\n\n      if (true\n      /* DEBUG */\n      ) {\n        var elementId = view.elementId;\n\n        if (true\n        /* EMBER_METAL_TRACKED_PROPERTIES */\n        ) {\n            (0, _utils.teardownMandatorySetter)(view, 'elementId');\n          }\n\n        Object.defineProperty(view, 'elementId', {\n          configurable: true,\n          enumerable: true,\n\n          get() {\n            return elementId;\n          },\n\n          set() {\n            throw new _error.default(\"Changing a view's elementId after creation is not allowed\");\n          }\n\n        });\n      }\n    },\n\n    exit(view) {\n      view.renderer.unregister(view);\n    }\n\n  });\n\n  var _default = Object.freeze(inDOM);\n\n  _exports.default = _default;\n});","define(\"@ember/-internals/views/lib/views/states/pre_render\", [\"exports\", \"@ember/-internals/views/lib/views/states/default\", \"@ember/polyfills\"], function (_exports, _default3, _polyfills) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  var preRender = (0, _polyfills.assign)({}, _default3.default);\n\n  var _default2 = Object.freeze(preRender);\n\n  _exports.default = _default2;\n});","define(\"@ember/application/globals-resolver\", [\"exports\", \"@ember/-internals/utils\", \"@ember/-internals/metal\", \"@ember/debug\", \"@ember/string\", \"@ember/-internals/runtime\", \"@ember/-internals/glimmer\"], function (_exports, _utils, _metal, _debug, _string, _runtime, _glimmer) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n  @module @ember/application\n  */\n\n  /**\n    The DefaultResolver defines the default lookup rules to resolve\n    container lookups before consulting the container for registered\n    items:\n  \n    * templates are looked up on `Ember.TEMPLATES`\n    * other names are looked up on the application after converting\n      the name. For example, `controller:post` looks up\n      `App.PostController` by default.\n    * there are some nuances (see examples below)\n  \n    ### How Resolving Works\n  \n    The container calls this object's `resolve` method with the\n    `fullName` argument.\n  \n    It first parses the fullName into an object using `parseName`.\n  \n    Then it checks for the presence of a type-specific instance\n    method of the form `resolve[Type]` and calls it if it exists.\n    For example if it was resolving 'template:post', it would call\n    the `resolveTemplate` method.\n  \n    Its last resort is to call the `resolveOther` method.\n  \n    The methods of this object are designed to be easy to override\n    in a subclass. For example, you could enhance how a template\n    is resolved like so:\n  \n    ```app/app.js\n    import Application from '@ember/application';\n    import GlobalsResolver from '@ember/application/globals-resolver';\n  \n    App = Application.create({\n      Resolver: GlobalsResolver.extend({\n        resolveTemplate(parsedName) {\n          let resolvedTemplate = this._super(parsedName);\n          if (resolvedTemplate) { return resolvedTemplate; }\n  \n          return Ember.TEMPLATES['not_found'];\n        }\n      })\n    });\n    ```\n  \n    Some examples of how names are resolved:\n  \n    ```text\n    'template:post'           //=> Ember.TEMPLATES['post']\n    'template:posts/byline'   //=> Ember.TEMPLATES['posts/byline']\n    'template:posts.byline'   //=> Ember.TEMPLATES['posts/byline']\n    'template:blogPost'       //=> Ember.TEMPLATES['blog-post']\n    'controller:post'         //=> App.PostController\n    'controller:posts.index'  //=> App.PostsIndexController\n    'controller:blog/post'    //=> Blog.PostController\n    'controller:basic'        //=> Controller\n    'route:post'              //=> App.PostRoute\n    'route:posts.index'       //=> App.PostsIndexRoute\n    'route:blog/post'         //=> Blog.PostRoute\n    'route:basic'             //=> Route\n    'foo:post'                //=> App.PostFoo\n    'model:post'              //=> App.Post\n    ```\n  \n    @class GlobalsResolver\n    @extends EmberObject\n    @public\n  */\n  class DefaultResolver extends _runtime.Object {\n    static create(props) {\n      // DO NOT REMOVE even though this doesn't do anything\n      // This is required for a FireFox 60+ JIT bug with our tests.\n      // without it, create(props) in our tests would lose props on a deopt.\n      return super.create(props);\n    }\n    /**\n      This will be set to the Application instance when it is\n      created.\n       @property namespace\n      @public\n    */\n\n\n    init() {\n      this._parseNameCache = (0, _utils.dictionary)(null);\n    }\n\n    normalize(fullName) {\n      var [type, name] = fullName.split(':');\n      (true && !(fullName.split(':').length === 2) && (0, _debug.assert)('Tried to normalize a container name without a colon (:) in it. ' + 'You probably tried to lookup a name that did not contain a type, ' + 'a colon, and a name. A proper lookup name would be `view:post`.', fullName.split(':').length === 2));\n\n      if (type !== 'template') {\n        var result = name.replace(/(\\.|_|-)./g, m => m.charAt(1).toUpperCase());\n        return type + \":\" + result;\n      } else {\n        return fullName;\n      }\n    }\n    /**\n      This method is called via the container's resolver method.\n      It parses the provided `fullName` and then looks up and\n      returns the appropriate template or class.\n       @method resolve\n      @param {String} fullName the lookup string\n      @return {Object} the resolved factory\n      @public\n    */\n\n\n    resolve(fullName) {\n      var parsedName = this.parseName(fullName);\n      var resolveMethodName = parsedName.resolveMethodName;\n      var resolved;\n\n      if (this[resolveMethodName]) {\n        resolved = this[resolveMethodName](parsedName);\n      }\n\n      resolved = resolved || this.resolveOther(parsedName);\n\n      if (true\n      /* DEBUG */\n      ) {\n        if (parsedName.root && parsedName.root.LOG_RESOLVER) {\n          this._logLookup(resolved, parsedName);\n        }\n\n        if (resolved) {\n          var VALIDATED_TYPES = {\n            route: ['isRouteFactory', 'Ember.Route'],\n            component: ['isComponentFactory', 'Ember.Component'],\n            view: ['isViewFactory', 'Ember.View'],\n            service: ['isServiceFactory', 'Ember.Service']\n          };\n          var validationAttributes = VALIDATED_TYPES[parsedName.type];\n\n          if (validationAttributes) {\n            var [factoryFlag, expectedType] = validationAttributes;\n            (true && !(Boolean(resolved[factoryFlag])) && (0, _debug.assert)(\"Expected \" + parsedName.fullName + \" to resolve to an \" + expectedType + \" but \" + (\"instead it was \" + resolved + \".\"), Boolean(resolved[factoryFlag])));\n          }\n        }\n      }\n\n      return resolved;\n    }\n    /**\n      Convert the string name of the form 'type:name' to\n      a Javascript object with the parsed aspects of the name\n      broken out.\n       @param {String} fullName the lookup string\n      @method parseName\n      @protected\n    */\n\n\n    parseName(fullName) {\n      return this._parseNameCache[fullName] || (this._parseNameCache[fullName] = this._parseName(fullName));\n    }\n\n    _parseName(fullName) {\n      var [type, fullNameWithoutType] = fullName.split(':');\n      var name = fullNameWithoutType;\n      var namespace = (0, _metal.get)(this, 'namespace');\n      var root = namespace;\n      var lastSlashIndex = name.lastIndexOf('/');\n      var dirname = lastSlashIndex !== -1 ? name.slice(0, lastSlashIndex) : null;\n\n      if (type !== 'template' && lastSlashIndex !== -1) {\n        var parts = name.split('/');\n        name = parts[parts.length - 1];\n        var namespaceName = (0, _string.capitalize)(parts.slice(0, -1).join('.'));\n        root = (0, _metal.findNamespace)(namespaceName);\n        (true && !(root) && (0, _debug.assert)(\"You are looking for a \" + name + \" \" + type + \" in the \" + namespaceName + \" namespace, but the namespace could not be found\", root));\n      }\n\n      var resolveMethodName = fullNameWithoutType === 'main' ? 'Main' : (0, _string.classify)(type);\n\n      if (!(name && type)) {\n        throw new TypeError(\"Invalid fullName: `\" + fullName + \"`, must be of the form `type:name` \");\n      }\n\n      return {\n        fullName,\n        type,\n        fullNameWithoutType,\n        dirname,\n        name,\n        root,\n        resolveMethodName: \"resolve\" + resolveMethodName\n      };\n    }\n    /**\n      Returns a human-readable description for a fullName. Used by the\n      Application namespace in assertions to describe the\n      precise name of the class that Ember is looking for, rather than\n      container keys.\n       @param {String} fullName the lookup string\n      @method lookupDescription\n      @protected\n    */\n\n\n    lookupDescription(fullName) {\n      var parsedName = this.parseName(fullName);\n      var description;\n\n      if (parsedName.type === 'template') {\n        return \"template at \" + parsedName.fullNameWithoutType.replace(/\\./g, '/');\n      }\n\n      description = parsedName.root + \".\" + (0, _string.classify)(parsedName.name).replace(/\\./g, '');\n\n      if (parsedName.type !== 'model') {\n        description += (0, _string.classify)(parsedName.type);\n      }\n\n      return description;\n    }\n\n    makeToString(factory) {\n      return factory.toString();\n    }\n    /**\n      Given a parseName object (output from `parseName`), apply\n      the conventions expected by `Router`\n       @param {Object} parsedName a parseName object with the parsed\n        fullName lookup string\n      @method useRouterNaming\n      @protected\n    */\n\n\n    useRouterNaming(parsedName) {\n      if (parsedName.name === 'basic') {\n        parsedName.name = '';\n      } else {\n        parsedName.name = parsedName.name.replace(/\\./g, '_');\n      }\n    }\n    /**\n      Look up the template in Ember.TEMPLATES\n       @param {Object} parsedName a parseName object with the parsed\n        fullName lookup string\n      @method resolveTemplate\n      @protected\n    */\n\n\n    resolveTemplate(parsedName) {\n      var templateName = parsedName.fullNameWithoutType.replace(/\\./g, '/');\n      return (0, _glimmer.getTemplate)(templateName) || (0, _glimmer.getTemplate)((0, _string.decamelize)(templateName));\n    }\n    /**\n      Lookup the view using `resolveOther`\n       @param {Object} parsedName a parseName object with the parsed\n        fullName lookup string\n      @method resolveView\n      @protected\n    */\n\n\n    resolveView(parsedName) {\n      this.useRouterNaming(parsedName);\n      return this.resolveOther(parsedName);\n    }\n    /**\n      Lookup the controller using `resolveOther`\n       @param {Object} parsedName a parseName object with the parsed\n        fullName lookup string\n      @method resolveController\n      @protected\n    */\n\n\n    resolveController(parsedName) {\n      this.useRouterNaming(parsedName);\n      return this.resolveOther(parsedName);\n    }\n    /**\n      Lookup the route using `resolveOther`\n       @param {Object} parsedName a parseName object with the parsed\n        fullName lookup string\n      @method resolveRoute\n      @protected\n    */\n\n\n    resolveRoute(parsedName) {\n      this.useRouterNaming(parsedName);\n      return this.resolveOther(parsedName);\n    }\n    /**\n      Lookup the model on the Application namespace\n       @param {Object} parsedName a parseName object with the parsed\n        fullName lookup string\n      @method resolveModel\n      @protected\n    */\n\n\n    resolveModel(parsedName) {\n      var className = (0, _string.classify)(parsedName.name);\n      var factory = (0, _metal.get)(parsedName.root, className);\n      return factory;\n    }\n    /**\n      Look up the specified object (from parsedName) on the appropriate\n      namespace (usually on the Application)\n       @param {Object} parsedName a parseName object with the parsed\n        fullName lookup string\n      @method resolveHelper\n      @protected\n    */\n\n\n    resolveHelper(parsedName) {\n      return this.resolveOther(parsedName);\n    }\n    /**\n      Look up the specified object (from parsedName) on the appropriate\n      namespace (usually on the Application)\n       @param {Object} parsedName a parseName object with the parsed\n        fullName lookup string\n      @method resolveOther\n      @protected\n    */\n\n\n    resolveOther(parsedName) {\n      var className = (0, _string.classify)(parsedName.name) + (0, _string.classify)(parsedName.type);\n      var factory = (0, _metal.get)(parsedName.root, className);\n      return factory;\n    }\n\n    resolveMain(parsedName) {\n      var className = (0, _string.classify)(parsedName.type);\n      return (0, _metal.get)(parsedName.root, className);\n    }\n    /**\n      Used to iterate all items of a given type.\n       @method knownForType\n      @param {String} type the type to search for\n      @private\n    */\n\n\n    knownForType(type) {\n      var namespace = (0, _metal.get)(this, 'namespace');\n      var suffix = (0, _string.classify)(type);\n      var typeRegexp = new RegExp(suffix + \"$\");\n      var known = (0, _utils.dictionary)(null);\n      var knownKeys = Object.keys(namespace);\n\n      for (var index = 0; index < knownKeys.length; index++) {\n        var name = knownKeys[index];\n\n        if (typeRegexp.test(name)) {\n          var containerName = this.translateToContainerFullname(type, name);\n          known[containerName] = true;\n        }\n      }\n\n      return known;\n    }\n    /**\n      Converts provided name from the backing namespace into a container lookup name.\n       Examples:\n       * App.FooBarHelper -> helper:foo-bar\n      * App.THelper -> helper:t\n       @method translateToContainerFullname\n      @param {String} type\n      @param {String} name\n      @private\n    */\n\n\n    translateToContainerFullname(type, name) {\n      var suffix = (0, _string.classify)(type);\n      var namePrefix = name.slice(0, suffix.length * -1);\n      var dasherizedName = (0, _string.dasherize)(namePrefix);\n      return type + \":\" + dasherizedName;\n    }\n\n  }\n\n  var _default = DefaultResolver;\n  _exports.default = _default;\n\n  if (true\n  /* DEBUG */\n  ) {\n    /**\n        @method _logLookup\n        @param {Boolean} found\n        @param {Object} parsedName\n        @private\n      */\n    DefaultResolver.prototype._logLookup = function (found, parsedName) {\n      var symbol = found ? '[✓]' : '[ ]';\n      var padding;\n\n      if (parsedName.fullName.length > 60) {\n        padding = '.';\n      } else {\n        padding = new Array(60 - parsedName.fullName.length).join('.');\n      }\n\n      (0, _debug.info)(symbol, parsedName.fullName, padding, this.lookupDescription(parsedName.fullName));\n    };\n  }\n});","define(\"@ember/application/index\", [\"exports\", \"@ember/-internals/owner\", \"@ember/application/lib/lazy_load\", \"@ember/application/lib/application\"], function (_exports, _owner, _lazy_load, _application) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"getOwner\", {\n    enumerable: true,\n    get: function () {\n      return _owner.getOwner;\n    }\n  });\n  Object.defineProperty(_exports, \"setOwner\", {\n    enumerable: true,\n    get: function () {\n      return _owner.setOwner;\n    }\n  });\n  Object.defineProperty(_exports, \"onLoad\", {\n    enumerable: true,\n    get: function () {\n      return _lazy_load.onLoad;\n    }\n  });\n  Object.defineProperty(_exports, \"runLoadHooks\", {\n    enumerable: true,\n    get: function () {\n      return _lazy_load.runLoadHooks;\n    }\n  });\n  Object.defineProperty(_exports, \"_loaded\", {\n    enumerable: true,\n    get: function () {\n      return _lazy_load._loaded;\n    }\n  });\n  Object.defineProperty(_exports, \"default\", {\n    enumerable: true,\n    get: function () {\n      return _application.default;\n    }\n  });\n});","define(\"@ember/application/instance\", [\"exports\", \"@ember/polyfills\", \"@ember/-internals/metal\", \"@ember/-internals/browser-environment\", \"@ember/-internals/views\", \"@ember/engine/instance\", \"@ember/-internals/glimmer\"], function (_exports, _polyfills, _metal, environment, _views, _instance, _glimmer) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n  @module @ember/application\n  */\n\n  /**\n    The `ApplicationInstance` encapsulates all of the stateful aspects of a\n    running `Application`.\n  \n    At a high-level, we break application boot into two distinct phases:\n  \n    * Definition time, where all of the classes, templates, and other\n      dependencies are loaded (typically in the browser).\n    * Run time, where we begin executing the application once everything\n      has loaded.\n  \n    Definition time can be expensive and only needs to happen once since it is\n    an idempotent operation. For example, between test runs and FastBoot\n    requests, the application stays the same. It is only the state that we want\n    to reset.\n  \n    That state is what the `ApplicationInstance` manages: it is responsible for\n    creating the container that contains all application state, and disposing of\n    it once the particular test run or FastBoot request has finished.\n  \n    @public\n    @class ApplicationInstance\n    @extends EngineInstance\n  */\n  var ApplicationInstance = _instance.default.extend({\n    /**\n      The `Application` for which this is an instance.\n       @property {Application} application\n      @private\n    */\n    application: null,\n\n    /**\n      The DOM events for which the event dispatcher should listen.\n       By default, the application's `Ember.EventDispatcher` listens\n      for a set of standard DOM events, such as `mousedown` and\n      `keyup`, and delegates them to your application's `Ember.View`\n      instances.\n       @private\n      @property {Object} customEvents\n    */\n    customEvents: null,\n\n    /**\n      The root DOM element of the Application as an element or a\n      [jQuery-compatible selector\n      string](http://api.jquery.com/category/selectors/).\n       @private\n      @property {String|DOMElement} rootElement\n    */\n    rootElement: null,\n\n    init() {\n      this._super(...arguments);\n\n      this.application._watchInstance(this); // Register this instance in the per-instance registry.\n      //\n      // Why do we need to register the instance in the first place?\n      // Because we need a good way for the root route (a.k.a ApplicationRoute)\n      // to notify us when it has created the root-most view. That view is then\n      // appended to the rootElement, in the case of apps, to the fixture harness\n      // in tests, or rendered to a string in the case of FastBoot.\n\n\n      this.register('-application-instance:main', this, {\n        instantiate: false\n      });\n    },\n\n    /**\n      Overrides the base `EngineInstance._bootSync` method with concerns relevant\n      to booting application (instead of engine) instances.\n       This method should only contain synchronous boot concerns. Asynchronous\n      boot concerns should eventually be moved to the `boot` method, which\n      returns a promise.\n       Until all boot code has been made asynchronous, we need to continue to\n      expose this method for use *internally* in places where we need to boot an\n      instance synchronously.\n       @private\n    */\n    _bootSync(options) {\n      if (this._booted) {\n        return this;\n      }\n\n      options = new BootOptions(options);\n      this.setupRegistry(options);\n\n      if (options.rootElement) {\n        this.rootElement = options.rootElement;\n      } else {\n        this.rootElement = this.application.rootElement;\n      }\n\n      if (options.location) {\n        (0, _metal.set)(this.router, 'location', options.location);\n      }\n\n      this.application.runInstanceInitializers(this);\n\n      if (options.isInteractive) {\n        this.setupEventDispatcher();\n      }\n\n      this._booted = true;\n      return this;\n    },\n\n    setupRegistry(options) {\n      this.constructor.setupRegistry(this.__registry__, options);\n    },\n\n    router: (0, _metal.computed)(function () {\n      return this.lookup('router:main');\n    }).readOnly(),\n\n    /**\n      This hook is called by the root-most Route (a.k.a. the ApplicationRoute)\n      when it has finished creating the root View. By default, we simply take the\n      view and append it to the `rootElement` specified on the Application.\n       In cases like FastBoot and testing, we can override this hook and implement\n      custom behavior, such as serializing to a string and sending over an HTTP\n      socket rather than appending to DOM.\n       @param view {Ember.View} the root-most view\n      @deprecated\n      @private\n    */\n    didCreateRootView(view) {\n      view.appendTo(this.rootElement);\n    },\n\n    /**\n      Tells the router to start routing. The router will ask the location for the\n      current URL of the page to determine the initial URL to start routing to.\n      To start the app at a specific URL, call `handleURL` instead.\n       @private\n    */\n    startRouting() {\n      this.router.startRouting();\n      this._didSetupRouter = true;\n    },\n\n    /**\n      Sets up the router, initializing the child router and configuring the\n      location before routing begins.\n       Because setup should only occur once, multiple calls to `setupRouter`\n      beyond the first call have no effect.\n      \n      This is commonly used in order to confirm things that rely on the router\n      are functioning properly from tests that are primarily rendering related.\n      \n      For example, from within [ember-qunit](https://github.com/emberjs/ember-qunit)'s\n      `setupRenderingTest` calling `this.owner.setupRouter()` would allow that\n      rendering test to confirm that any `<LinkTo></LinkTo>`'s that are rendered\n      have the correct URL.\n      \n      @public\n    */\n    setupRouter() {\n      if (this._didSetupRouter) {\n        return;\n      }\n\n      this._didSetupRouter = true;\n      this.router.setupRouter();\n    },\n\n    /**\n      Directs the router to route to a particular URL. This is useful in tests,\n      for example, to tell the app to start at a particular URL.\n       @param url {String} the URL the router should route to\n      @private\n    */\n    handleURL(url) {\n      this.setupRouter();\n      return this.router.handleURL(url);\n    },\n\n    /**\n      @private\n    */\n    setupEventDispatcher() {\n      var dispatcher = this.lookup('event_dispatcher:main');\n      var applicationCustomEvents = (0, _metal.get)(this.application, 'customEvents');\n      var instanceCustomEvents = (0, _metal.get)(this, 'customEvents');\n      var customEvents = (0, _polyfills.assign)({}, applicationCustomEvents, instanceCustomEvents);\n      dispatcher.setup(customEvents, this.rootElement);\n      return dispatcher;\n    },\n\n    /**\n      Returns the current URL of the app instance. This is useful when your\n      app does not update the browsers URL bar (i.e. it uses the `'none'`\n      location adapter).\n       @public\n      @return {String} the current URL\n    */\n    getURL() {\n      return this.router.url;\n    },\n\n    // `instance.visit(url)` should eventually replace `instance.handleURL()`;\n    // the test helpers can probably be switched to use this implementation too\n\n    /**\n      Navigate the instance to a particular URL. This is useful in tests, for\n      example, or to tell the app to start at a particular URL. This method\n      returns a promise that resolves with the app instance when the transition\n      is complete, or rejects if the transion was aborted due to an error.\n       @public\n      @param url {String} the destination URL\n      @return {Promise<ApplicationInstance>}\n    */\n    visit(url) {\n      this.setupRouter();\n\n      var bootOptions = this.__container__.lookup('-environment:main');\n\n      var router = this.router;\n\n      var handleTransitionResolve = () => {\n        if (!bootOptions.options.shouldRender) {\n          // No rendering is needed, and routing has completed, simply return.\n          return this;\n        } else {\n          // Ensure that the visit promise resolves when all rendering has completed\n          return (0, _glimmer.renderSettled)().then(() => this);\n        }\n      };\n\n      var handleTransitionReject = error => {\n        if (error.error) {\n          throw error.error;\n        } else if (error.name === 'TransitionAborted' && router._routerMicrolib.activeTransition) {\n          return router._routerMicrolib.activeTransition.then(handleTransitionResolve, handleTransitionReject);\n        } else if (error.name === 'TransitionAborted') {\n          throw new Error(error.message);\n        } else {\n          throw error;\n        }\n      };\n\n      var location = (0, _metal.get)(router, 'location'); // Keeps the location adapter's internal URL in-sync\n\n      location.setURL(url); // getURL returns the set url with the rootURL stripped off\n\n      return router.handleURL(location.getURL()).then(handleTransitionResolve, handleTransitionReject);\n    },\n\n    willDestroy() {\n      this._super(...arguments);\n\n      this.application._unwatchInstance(this);\n    }\n\n  });\n\n  ApplicationInstance.reopenClass({\n    /**\n     @private\n     @method setupRegistry\n     @param {Registry} registry\n     @param {BootOptions} options\n    */\n    setupRegistry(registry, options = {}) {\n      if (!options.toEnvironment) {\n        options = new BootOptions(options);\n      }\n\n      registry.register('-environment:main', options.toEnvironment(), {\n        instantiate: false\n      });\n      registry.register('service:-document', options.document, {\n        instantiate: false\n      });\n\n      this._super(registry, options);\n    }\n\n  });\n  /**\n    A list of boot-time configuration options for customizing the behavior of\n    an `ApplicationInstance`.\n  \n    This is an interface class that exists purely to document the available\n    options; you do not need to construct it manually. Simply pass a regular\n    JavaScript object containing the desired options into methods that require\n    one of these options object:\n  \n    ```javascript\n    MyApp.visit(\"/\", { location: \"none\", rootElement: \"#container\" });\n    ```\n  \n    Not all combinations of the supported options are valid. See the documentation\n    on `Application#visit` for the supported configurations.\n  \n    Internal, experimental or otherwise unstable flags are marked as private.\n  \n    @class BootOptions\n    @namespace ApplicationInstance\n    @public\n  */\n\n  class BootOptions {\n    constructor(options = {}) {\n      /**\n        Provide a specific instance of jQuery. This is useful in conjunction with\n        the `document` option, as it allows you to use a copy of `jQuery` that is\n        appropriately bound to the foreign `document` (e.g. a jsdom).\n         This is highly experimental and support very incomplete at the moment.\n         @property jQuery\n        @type Object\n        @default auto-detected\n        @private\n      */\n      this.jQuery = _views.jQuery; // This default is overridable below\n\n      /**\n        Interactive mode: whether we need to set up event delegation and invoke\n        lifecycle callbacks on Components.\n         @property isInteractive\n        @type boolean\n        @default auto-detected\n        @private\n      */\n\n      this.isInteractive = environment.hasDOM; // This default is overridable below\n\n      /**\n        @property _renderMode\n        @type string\n        @default false\n        @private\n      */\n\n      this._renderMode = options._renderMode;\n      /**\n        Run in a full browser environment.\n         When this flag is set to `false`, it will disable most browser-specific\n        and interactive features. Specifically:\n         * It does not use `jQuery` to append the root view; the `rootElement`\n          (either specified as a subsequent option or on the application itself)\n          must already be an `Element` in the given `document` (as opposed to a\n          string selector).\n         * It does not set up an `EventDispatcher`.\n         * It does not run any `Component` lifecycle hooks (such as `didInsertElement`).\n         * It sets the `location` option to `\"none\"`. (If you would like to use\n          the location adapter specified in the app's router instead, you can also\n          specify `{ location: null }` to specifically opt-out.)\n         @property isBrowser\n        @type boolean\n        @default auto-detected\n        @public\n      */\n\n      if (options.isBrowser !== undefined) {\n        this.isBrowser = Boolean(options.isBrowser);\n      } else {\n        this.isBrowser = environment.hasDOM;\n      }\n\n      if (!this.isBrowser) {\n        this.jQuery = null;\n        this.isInteractive = false;\n        this.location = 'none';\n      }\n      /**\n        Disable rendering completely.\n         When this flag is set to `false`, it will disable the entire rendering\n        pipeline. Essentially, this puts the app into \"routing-only\" mode. No\n        templates will be rendered, and no Components will be created.\n         @property shouldRender\n        @type boolean\n        @default true\n        @public\n      */\n\n\n      if (options.shouldRender !== undefined) {\n        this.shouldRender = Boolean(options.shouldRender);\n      } else {\n        this.shouldRender = true;\n      }\n\n      if (!this.shouldRender) {\n        this.jQuery = null;\n        this.isInteractive = false;\n      }\n      /**\n        If present, render into the given `Document` object instead of the\n        global `window.document` object.\n         In practice, this is only useful in non-browser environment or in\n        non-interactive mode, because Ember's `jQuery` dependency is\n        implicitly bound to the current document, causing event delegation\n        to not work properly when the app is rendered into a foreign\n        document object (such as an iframe's `contentDocument`).\n         In non-browser mode, this could be a \"`Document`-like\" object as\n        Ember only interact with a small subset of the DOM API in non-\n        interactive mode. While the exact requirements have not yet been\n        formalized, the `SimpleDOM` library's implementation is known to\n        work.\n         @property document\n        @type Document\n        @default the global `document` object\n        @public\n      */\n\n\n      if (options.document) {\n        this.document = options.document;\n      } else {\n        this.document = typeof document !== 'undefined' ? document : null;\n      }\n      /**\n        If present, overrides the application's `rootElement` property on\n        the instance. This is useful for testing environment, where you\n        might want to append the root view to a fixture area.\n         In non-browser mode, because Ember does not have access to jQuery,\n        this options must be specified as a DOM `Element` object instead of\n        a selector string.\n         See the documentation on `Application`'s `rootElement` for\n        details.\n         @property rootElement\n        @type String|Element\n        @default null\n        @public\n       */\n\n\n      if (options.rootElement) {\n        this.rootElement = options.rootElement;\n      } // Set these options last to give the user a chance to override the\n      // defaults from the \"combo\" options like `isBrowser` (although in\n      // practice, the resulting combination is probably invalid)\n\n      /**\n        If present, overrides the router's `location` property with this\n        value. This is useful for environments where trying to modify the\n        URL would be inappropriate.\n         @property location\n        @type string\n        @default null\n        @public\n      */\n\n\n      if (options.location !== undefined) {\n        this.location = options.location;\n      }\n\n      if (options.jQuery !== undefined) {\n        this.jQuery = options.jQuery;\n      }\n\n      if (options.isInteractive !== undefined) {\n        this.isInteractive = Boolean(options.isInteractive);\n      }\n    }\n\n    toEnvironment() {\n      // Do we really want to assign all of this!?\n      var env = (0, _polyfills.assign)({}, environment); // For compatibility with existing code\n\n      env.hasDOM = this.isBrowser;\n      env.isInteractive = this.isInteractive;\n      env._renderMode = this._renderMode;\n      env.options = this;\n      return env;\n    }\n\n  }\n\n  var _default = ApplicationInstance;\n  _exports.default = _default;\n});","define(\"@ember/application/lib/application\", [\"exports\", \"ember-babel\", \"@ember/-internals/utils\", \"@ember/-internals/environment\", \"@ember/-internals/browser-environment\", \"@ember/debug\", \"@ember/runloop\", \"@ember/-internals/metal\", \"@ember/application/lib/lazy_load\", \"@ember/-internals/runtime\", \"@ember/-internals/views\", \"@ember/-internals/routing\", \"@ember/application/instance\", \"@ember/engine\", \"@ember/-internals/container\", \"@ember/-internals/glimmer\", \"@ember/deprecated-features\"], function (_exports, _emberBabel, _utils, _environment, _browserEnvironment, _debug, _runloop, _metal, _lazy_load, _runtime, _views, _routing, _instance, _engine, _container, _glimmer, _deprecatedFeatures) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  function _templateObject() {\n    var data = (0, _emberBabel.taggedTemplateLiteralLoose)([\"-bucket-cache:main\"]);\n\n    _templateObject = function () {\n      return data;\n    };\n\n    return data;\n  }\n\n  var librariesRegistered = false;\n  /**\n    An instance of `Application` is the starting point for every Ember\n    application. It helps to instantiate, initialize and coordinate the many\n    objects that make up your app.\n  \n    Each Ember app has one and only one `Application` object. In fact, the\n    very first thing you should do in your application is create the instance:\n  \n    ```javascript\n    import Application from '@ember/application';\n  \n    window.App = Application.create();\n    ```\n  \n    Typically, the application object is the only global variable. All other\n    classes in your app should be properties on the `Application` instance,\n    which highlights its first role: a global namespace.\n  \n    For example, if you define a view class, it might look like this:\n  \n    ```javascript\n    import Application from '@ember/application';\n  \n    App.MyView = Ember.View.extend();\n    ```\n  \n    By default, calling `Application.create()` will automatically initialize\n    your application by calling the `Application.initialize()` method. If\n    you need to delay initialization, you can call your app's `deferReadiness()`\n    method. When you are ready for your app to be initialized, call its\n    `advanceReadiness()` method.\n  \n    You can define a `ready` method on the `Application` instance, which\n    will be run by Ember when the application is initialized.\n  \n    Because `Application` inherits from `Ember.Namespace`, any classes\n    you create will have useful string representations when calling `toString()`.\n    See the `Ember.Namespace` documentation for more information.\n  \n    While you can think of your `Application` as a container that holds the\n    other classes in your application, there are several other responsibilities\n    going on under-the-hood that you may want to understand.\n  \n    ### Event Delegation\n  \n    Ember uses a technique called _event delegation_. This allows the framework\n    to set up a global, shared event listener instead of requiring each view to\n    do it manually. For example, instead of each view registering its own\n    `mousedown` listener on its associated element, Ember sets up a `mousedown`\n    listener on the `body`.\n  \n    If a `mousedown` event occurs, Ember will look at the target of the event and\n    start walking up the DOM node tree, finding corresponding views and invoking\n    their `mouseDown` method as it goes.\n  \n    `Application` has a number of default events that it listens for, as\n    well as a mapping from lowercase events to camel-cased view method names. For\n    example, the `keypress` event causes the `keyPress` method on the view to be\n    called, the `dblclick` event causes `doubleClick` to be called, and so on.\n  \n    If there is a bubbling browser event that Ember does not listen for by\n    default, you can specify custom events and their corresponding view method\n    names by setting the application's `customEvents` property:\n  \n    ```javascript\n    import Application from '@ember/application';\n  \n    let App = Application.create({\n      customEvents: {\n        // add support for the paste event\n        paste: 'paste'\n      }\n    });\n    ```\n  \n    To prevent Ember from setting up a listener for a default event,\n    specify the event name with a `null` value in the `customEvents`\n    property:\n  \n    ```javascript\n    import Application from '@ember/application';\n  \n    let App = Application.create({\n      customEvents: {\n        // prevent listeners for mouseenter/mouseleave events\n        mouseenter: null,\n        mouseleave: null\n      }\n    });\n    ```\n  \n    By default, the application sets up these event listeners on the document\n    body. However, in cases where you are embedding an Ember application inside\n    an existing page, you may want it to set up the listeners on an element\n    inside the body.\n  \n    For example, if only events inside a DOM element with the ID of `ember-app`\n    should be delegated, set your application's `rootElement` property:\n  \n    ```javascript\n    import Application from '@ember/application';\n  \n    let App = Application.create({\n      rootElement: '#ember-app'\n    });\n    ```\n  \n    The `rootElement` can be either a DOM element or a jQuery-compatible selector\n    string. Note that *views appended to the DOM outside the root element will\n    not receive events.* If you specify a custom root element, make sure you only\n    append views inside it!\n  \n    To learn more about the events Ember components use, see\n  \n    [components/handling-events](https://guides.emberjs.com/release/components/handling-events/#toc_event-names).\n  \n    ### Initializers\n  \n    Libraries on top of Ember can add initializers, like so:\n  \n    ```javascript\n    import Application from '@ember/application';\n  \n    Application.initializer({\n      name: 'api-adapter',\n  \n      initialize: function(application) {\n        application.register('api-adapter:main', ApiAdapter);\n      }\n    });\n    ```\n  \n    Initializers provide an opportunity to access the internal registry, which\n    organizes the different components of an Ember application. Additionally\n    they provide a chance to access the instantiated application. Beyond\n    being used for libraries, initializers are also a great way to organize\n    dependency injection or setup in your own application.\n  \n    ### Routing\n  \n    In addition to creating your application's router, `Application` is\n    also responsible for telling the router when to start routing. Transitions\n    between routes can be logged with the `LOG_TRANSITIONS` flag, and more\n    detailed intra-transition logging can be logged with\n    the `LOG_TRANSITIONS_INTERNAL` flag:\n  \n    ```javascript\n    import Application from '@ember/application';\n  \n    let App = Application.create({\n      LOG_TRANSITIONS: true, // basic logging of successful transitions\n      LOG_TRANSITIONS_INTERNAL: true // detailed logging of all routing steps\n    });\n    ```\n  \n    By default, the router will begin trying to translate the current URL into\n    application state once the browser emits the `DOMContentReady` event. If you\n    need to defer routing, you can call the application's `deferReadiness()`\n    method. Once routing can begin, call the `advanceReadiness()` method.\n  \n    If there is any setup required before routing begins, you can implement a\n    `ready()` method on your app that will be invoked immediately before routing\n    begins.\n  \n    @class Application\n    @extends Engine\n    @uses RegistryProxyMixin\n    @public\n  */\n\n  var Application = _engine.default.extend({\n    /**\n      The root DOM element of the Application. This can be specified as an\n      element or a\n      [jQuery-compatible selector string](http://api.jquery.com/category/selectors/).\n       This is the element that will be passed to the Application's,\n      `eventDispatcher`, which sets up the listeners for event delegation. Every\n      view in your application should be a child of the element you specify here.\n       @property rootElement\n      @type DOMElement\n      @default 'body'\n      @public\n    */\n    rootElement: 'body',\n\n    /**\n      The `Ember.EventDispatcher` responsible for delegating events to this\n      application's views.\n       The event dispatcher is created by the application at initialization time\n      and sets up event listeners on the DOM element described by the\n      application's `rootElement` property.\n       See the documentation for `Ember.EventDispatcher` for more information.\n       @property eventDispatcher\n      @type Ember.EventDispatcher\n      @default null\n      @public\n    */\n    eventDispatcher: null,\n\n    /**\n      The DOM events for which the event dispatcher should listen.\n       By default, the application's `Ember.EventDispatcher` listens\n      for a set of standard DOM events, such as `mousedown` and\n      `keyup`, and delegates them to your application's `Ember.View`\n      instances.\n       If you would like additional bubbling events to be delegated to your\n      views, set your `Application`'s `customEvents` property\n      to a hash containing the DOM event name as the key and the\n      corresponding view method name as the value. Setting an event to\n      a value of `null` will prevent a default event listener from being\n      added for that event.\n       To add new events to be listened to:\n       ```javascript\n      import Application from '@ember/application';\n       let App = Application.create({\n        customEvents: {\n          // add support for the paste event\n          paste: 'paste'\n        }\n      });\n      ```\n       To prevent default events from being listened to:\n       ```javascript\n      import Application from '@ember/application';\n       let App = Application.create({\n        customEvents: {\n          // remove support for mouseenter / mouseleave events\n          mouseenter: null,\n          mouseleave: null\n        }\n      });\n      ```\n      @property customEvents\n      @type Object\n      @default null\n      @public\n    */\n    customEvents: null,\n\n    /**\n      Whether the application should automatically start routing and render\n      templates to the `rootElement` on DOM ready. While default by true,\n      other environments such as FastBoot or a testing harness can set this\n      property to `false` and control the precise timing and behavior of the boot\n      process.\n       @property autoboot\n      @type Boolean\n      @default true\n      @private\n    */\n    autoboot: true,\n\n    /**\n      Whether the application should be configured for the legacy \"globals mode\".\n      Under this mode, the Application object serves as a global namespace for all\n      classes.\n       ```javascript\n      import Application from '@ember/application';\n      import Component from '@ember/component';\n       let App = Application.create({\n        ...\n      });\n       App.Router.reopen({\n        location: 'none'\n      });\n       App.Router.map({\n        ...\n      });\n       App.MyComponent = Component.extend({\n        ...\n      });\n      ```\n       This flag also exposes other internal APIs that assumes the existence of\n      a special \"default instance\", like `App.__container__.lookup(...)`.\n       This option is currently not configurable, its value is derived from\n      the `autoboot` flag – disabling `autoboot` also implies opting-out of\n      globals mode support, although they are ultimately orthogonal concerns.\n       Some of the global modes features are already deprecated in 1.x. The\n      existence of this flag is to untangle the globals mode code paths from\n      the autoboot code paths, so that these legacy features can be reviewed\n      for deprecation/removal separately.\n       Forcing the (autoboot=true, _globalsMode=false) here and running the tests\n      would reveal all the places where we are still relying on these legacy\n      behavior internally (mostly just tests).\n       @property _globalsMode\n      @type Boolean\n      @default true\n      @private\n    */\n    _globalsMode: true,\n\n    /**\n      An array of application instances created by `buildInstance()`. Used\n      internally to ensure that all instances get destroyed.\n       @property _applicationInstances\n      @type Array\n      @default null\n      @private\n    */\n    _applicationInstances: null,\n\n    init() {\n      // eslint-disable-line no-unused-vars\n      this._super(...arguments);\n\n      if (!this.$) {\n        this.$ = _views.jQuery;\n      }\n\n      registerLibraries();\n\n      if (true\n      /* DEBUG */\n      ) {\n        if (_environment.ENV.LOG_VERSION) {\n          // we only need to see this once per Application#init\n          _environment.ENV.LOG_VERSION = false;\n\n          _metal.libraries.logVersions();\n        }\n      } // Start off the number of deferrals at 1. This will be decremented by\n      // the Application's own `boot` method.\n\n\n      this._readinessDeferrals = 1;\n      this._booted = false;\n      this._applicationInstances = new Set();\n      this.autoboot = this._globalsMode = Boolean(this.autoboot);\n\n      if (this._globalsMode) {\n        this._prepareForGlobalsMode();\n      }\n\n      if (this.autoboot) {\n        this.waitForDOMReady();\n      }\n    },\n\n    /**\n      Create an ApplicationInstance for this application.\n       @public\n      @method buildInstance\n      @return {ApplicationInstance} the application instance\n    */\n    buildInstance(options = {}) {\n      options.base = this;\n      options.application = this;\n      return _instance.default.create(options);\n    },\n\n    /**\n      Start tracking an ApplicationInstance for this application.\n      Used when the ApplicationInstance is created.\n       @private\n      @method _watchInstance\n    */\n    _watchInstance(instance) {\n      this._applicationInstances.add(instance);\n    },\n\n    /**\n      Stop tracking an ApplicationInstance for this application.\n      Used when the ApplicationInstance is about to be destroyed.\n       @private\n      @method _unwatchInstance\n    */\n    _unwatchInstance(instance) {\n      return this._applicationInstances.delete(instance);\n    },\n\n    /**\n      Enable the legacy globals mode by allowing this application to act\n      as a global namespace. See the docs on the `_globalsMode` property\n      for details.\n       Most of these features are already deprecated in 1.x, so we can\n      stop using them internally and try to remove them.\n       @private\n      @method _prepareForGlobalsMode\n    */\n    _prepareForGlobalsMode() {\n      // Create subclass of Router for this Application instance.\n      // This is to ensure that someone reopening `App.Router` does not\n      // tamper with the default `Router`.\n      this.Router = (this.Router || _routing.Router).extend();\n\n      this._buildDeprecatedInstance();\n    },\n\n    /*\n      Build the deprecated instance for legacy globals mode support.\n      Called when creating and resetting the application.\n       This is orthogonal to autoboot: the deprecated instance needs to\n      be created at Application construction (not boot) time to expose\n      App.__container__. If autoboot sees that this instance exists,\n      it will continue booting it to avoid doing unncessary work (as\n      opposed to building a new instance at boot time), but they are\n      otherwise unrelated.\n       @private\n      @method _buildDeprecatedInstance\n    */\n    _buildDeprecatedInstance() {\n      // Build a default instance\n      var instance = this.buildInstance(); // Legacy support for App.__container__ and other global methods\n      // on App that rely on a single, default instance.\n\n      this.__deprecatedInstance__ = instance;\n      this.__container__ = instance.__container__;\n    },\n\n    /**\n      Automatically kick-off the boot process for the application once the\n      DOM has become ready.\n       The initialization itself is scheduled on the actions queue which\n      ensures that code-loading finishes before booting.\n       If you are asynchronously loading code, you should call `deferReadiness()`\n      to defer booting, and then call `advanceReadiness()` once all of your code\n      has finished loading.\n       @private\n      @method waitForDOMReady\n    */\n    waitForDOMReady() {\n      if (!this.$ || this.$.isReady) {\n        (0, _runloop.schedule)('actions', this, 'domReady');\n      } else {\n        this.$().ready((0, _runloop.bind)(this, 'domReady'));\n      }\n    },\n\n    /**\n      This is the autoboot flow:\n       1. Boot the app by calling `this.boot()`\n      2. Create an instance (or use the `__deprecatedInstance__` in globals mode)\n      3. Boot the instance by calling `instance.boot()`\n      4. Invoke the `App.ready()` callback\n      5. Kick-off routing on the instance\n       Ideally, this is all we would need to do:\n       ```javascript\n      _autoBoot() {\n        this.boot().then(() => {\n          let instance = (this._globalsMode) ? this.__deprecatedInstance__ : this.buildInstance();\n          return instance.boot();\n        }).then((instance) => {\n          App.ready();\n          instance.startRouting();\n        });\n      }\n      ```\n       Unfortunately, we cannot actually write this because we need to participate\n      in the \"synchronous\" boot process. While the code above would work fine on\n      the initial boot (i.e. DOM ready), when `App.reset()` is called, we need to\n      boot a new instance synchronously (see the documentation on `_bootSync()`\n      for details).\n       Because of this restriction, the actual logic of this method is located\n      inside `didBecomeReady()`.\n       @private\n      @method domReady\n    */\n    domReady() {\n      if (this.isDestroyed) {\n        return;\n      }\n\n      this._bootSync(); // Continues to `didBecomeReady`\n\n    },\n\n    /**\n      Use this to defer readiness until some condition is true.\n       Example:\n       ```javascript\n      import Application from '@ember/application';\n       let App = Application.create();\n       App.deferReadiness();\n       // $ is a reference to the jQuery object/function\n      import $ from 'jquery;\n       $.getJSON('/auth-token', function(token) {\n        App.token = token;\n        App.advanceReadiness();\n      });\n      ```\n       This allows you to perform asynchronous setup logic and defer\n      booting your application until the setup has finished.\n       However, if the setup requires a loading UI, it might be better\n      to use the router for this purpose.\n       @method deferReadiness\n      @public\n    */\n    deferReadiness() {\n      (true && !(this instanceof Application) && (0, _debug.assert)('You must call deferReadiness on an instance of Application', this instanceof Application));\n      (true && !(this._readinessDeferrals > 0) && (0, _debug.assert)('You cannot defer readiness since the `ready()` hook has already been called.', this._readinessDeferrals > 0));\n      this._readinessDeferrals++;\n    },\n\n    /**\n      Call `advanceReadiness` after any asynchronous setup logic has completed.\n      Each call to `deferReadiness` must be matched by a call to `advanceReadiness`\n      or the application will never become ready and routing will not begin.\n       @method advanceReadiness\n      @see {Application#deferReadiness}\n      @public\n    */\n    advanceReadiness() {\n      (true && !(this instanceof Application) && (0, _debug.assert)('You must call advanceReadiness on an instance of Application', this instanceof Application));\n      this._readinessDeferrals--;\n\n      if (this._readinessDeferrals === 0) {\n        (0, _runloop.once)(this, this.didBecomeReady);\n      }\n    },\n\n    /**\n      Initialize the application and return a promise that resolves with the `Application`\n      object when the boot process is complete.\n       Run any application initializers and run the application load hook. These hooks may\n      choose to defer readiness. For example, an authentication hook might want to defer\n      readiness until the auth token has been retrieved.\n       By default, this method is called automatically on \"DOM ready\"; however, if autoboot\n      is disabled, this is automatically called when the first application instance is\n      created via `visit`.\n       @public\n      @method boot\n      @return {Promise<Application,Error>}\n    */\n    boot() {\n      if (this._bootPromise) {\n        return this._bootPromise;\n      }\n\n      try {\n        this._bootSync();\n      } catch (_) {// Ignore the error: in the asynchronous boot path, the error is already reflected\n        // in the promise rejection\n      }\n\n      return this._bootPromise;\n    },\n\n    /**\n      Unfortunately, a lot of existing code assumes the booting process is\n      \"synchronous\". Specifically, a lot of tests assumes the last call to\n      `app.advanceReadiness()` or `app.reset()` will result in the app being\n      fully-booted when the current runloop completes.\n       We would like new code (like the `visit` API) to stop making this assumption,\n      so we created the asynchronous version above that returns a promise. But until\n      we have migrated all the code, we would have to expose this method for use\n      *internally* in places where we need to boot an app \"synchronously\".\n       @private\n    */\n    _bootSync() {\n      if (this._booted) {\n        return;\n      } // Even though this returns synchronously, we still need to make sure the\n      // boot promise exists for book-keeping purposes: if anything went wrong in\n      // the boot process, we need to store the error as a rejection on the boot\n      // promise so that a future caller of `boot()` can tell what failed.\n\n\n      var defer = this._bootResolver = _runtime.RSVP.defer();\n\n      this._bootPromise = defer.promise;\n\n      try {\n        this.runInitializers();\n        (0, _lazy_load.runLoadHooks)('application', this);\n        this.advanceReadiness(); // Continues to `didBecomeReady`\n      } catch (error) {\n        // For the asynchronous boot path\n        defer.reject(error); // For the synchronous boot path\n\n        throw error;\n      }\n    },\n\n    /**\n      Reset the application. This is typically used only in tests. It cleans up\n      the application in the following order:\n       1. Deactivate existing routes\n      2. Destroy all objects in the container\n      3. Create a new application container\n      4. Re-route to the existing url\n       Typical Example:\n       ```javascript\n      import Application from '@ember/application';\n      let App;\n       run(function() {\n        App = Application.create();\n      });\n       module('acceptance test', {\n        setup: function() {\n          App.reset();\n        }\n      });\n       test('first test', function() {\n        // App is freshly reset\n      });\n       test('second test', function() {\n        // App is again freshly reset\n      });\n      ```\n       Advanced Example:\n       Occasionally you may want to prevent the app from initializing during\n      setup. This could enable extra configuration, or enable asserting prior\n      to the app becoming ready.\n       ```javascript\n      import Application from '@ember/application';\n      let App;\n       run(function() {\n        App = Application.create();\n      });\n       module('acceptance test', {\n        setup: function() {\n          run(function() {\n            App.reset();\n            App.deferReadiness();\n          });\n        }\n      });\n       test('first test', function() {\n        ok(true, 'something before app is initialized');\n         run(function() {\n          App.advanceReadiness();\n        });\n         ok(true, 'something after app is initialized');\n      });\n      ```\n       @method reset\n      @public\n    */\n    reset() {\n      (true && !(this._globalsMode && this.autoboot) && (0, _debug.assert)(\"Calling reset() on instances of `Application` is not\\n            supported when globals mode is disabled; call `visit()` to\\n            create new `ApplicationInstance`s and dispose them\\n            via their `destroy()` method instead.\", this._globalsMode && this.autoboot));\n      var instance = this.__deprecatedInstance__;\n      this._readinessDeferrals = 1;\n      this._bootPromise = null;\n      this._bootResolver = null;\n      this._booted = false;\n\n      function handleReset() {\n        (0, _runloop.run)(instance, 'destroy');\n\n        this._buildDeprecatedInstance();\n\n        (0, _runloop.schedule)('actions', this, '_bootSync');\n      }\n\n      (0, _runloop.join)(this, handleReset);\n    },\n\n    /**\n      @private\n      @method didBecomeReady\n    */\n    didBecomeReady() {\n      try {\n        // TODO: Is this still needed for _globalsMode = false?\n        if (!(0, _debug.isTesting)()) {\n          // Eagerly name all classes that are already loaded\n          (0, _metal.processAllNamespaces)();\n          (0, _metal.setNamespaceSearchDisabled)(true);\n        } // See documentation on `_autoboot()` for details\n\n\n        if (this.autoboot) {\n          var instance;\n\n          if (this._globalsMode) {\n            // If we already have the __deprecatedInstance__ lying around, boot it to\n            // avoid unnecessary work\n            instance = this.__deprecatedInstance__;\n          } else {\n            // Otherwise, build an instance and boot it. This is currently unreachable,\n            // because we forced _globalsMode to === autoboot; but having this branch\n            // allows us to locally toggle that flag for weeding out legacy globals mode\n            // dependencies independently\n            instance = this.buildInstance();\n          }\n\n          instance._bootSync(); // TODO: App.ready() is not called when autoboot is disabled, is this correct?\n\n\n          this.ready();\n          instance.startRouting();\n        } // For the asynchronous boot path\n\n\n        this._bootResolver.resolve(this); // For the synchronous boot path\n\n\n        this._booted = true;\n      } catch (error) {\n        // For the asynchronous boot path\n        this._bootResolver.reject(error); // For the synchronous boot path\n\n\n        throw error;\n      }\n    },\n\n    /**\n      Called when the Application has become ready, immediately before routing\n      begins. The call will be delayed until the DOM has become ready.\n       @event ready\n      @public\n    */\n    ready() {\n      return this;\n    },\n\n    // This method must be moved to the application instance object\n    willDestroy() {\n      this._super(...arguments);\n\n      (0, _metal.setNamespaceSearchDisabled)(false);\n      this._booted = false;\n      this._bootPromise = null;\n      this._bootResolver = null;\n\n      if (_lazy_load._loaded.application === this) {\n        _lazy_load._loaded.application = undefined;\n      }\n\n      if (this._applicationInstances.size) {\n        this._applicationInstances.forEach(i => i.destroy());\n\n        this._applicationInstances.clear();\n      }\n    },\n\n    /**\n      Boot a new instance of `ApplicationInstance` for the current\n      application and navigate it to the given `url`. Returns a `Promise` that\n      resolves with the instance when the initial routing and rendering is\n      complete, or rejects with any error that occurred during the boot process.\n       When `autoboot` is disabled, calling `visit` would first cause the\n      application to boot, which runs the application initializers.\n       This method also takes a hash of boot-time configuration options for\n      customizing the instance's behavior. See the documentation on\n      `ApplicationInstance.BootOptions` for details.\n       `ApplicationInstance.BootOptions` is an interface class that exists\n      purely to document the available options; you do not need to construct it\n      manually. Simply pass a regular JavaScript object containing of the\n      desired options:\n       ```javascript\n      MyApp.visit(\"/\", { location: \"none\", rootElement: \"#container\" });\n      ```\n       ### Supported Scenarios\n       While the `BootOptions` class exposes a large number of knobs, not all\n      combinations of them are valid; certain incompatible combinations might\n      result in unexpected behavior.\n       For example, booting the instance in the full browser environment\n      while specifying a foreign `document` object (e.g. `{ isBrowser: true,\n      document: iframe.contentDocument }`) does not work correctly today,\n      largely due to Ember's jQuery dependency.\n       Currently, there are three officially supported scenarios/configurations.\n      Usages outside of these scenarios are not guaranteed to work, but please\n      feel free to file bug reports documenting your experience and any issues\n      you encountered to help expand support.\n       #### Browser Applications (Manual Boot)\n       The setup is largely similar to how Ember works out-of-the-box. Normally,\n      Ember will boot a default instance for your Application on \"DOM ready\".\n      However, you can customize this behavior by disabling `autoboot`.\n       For example, this allows you to render a miniture demo of your application\n      into a specific area on your marketing website:\n       ```javascript\n      import MyApp from 'my-app';\n       $(function() {\n        let App = MyApp.create({ autoboot: false });\n         let options = {\n          // Override the router's location adapter to prevent it from updating\n          // the URL in the address bar\n          location: 'none',\n           // Override the default `rootElement` on the app to render into a\n          // specific `div` on the page\n          rootElement: '#demo'\n        };\n         // Start the app at the special demo URL\n        App.visit('/demo', options);\n      });\n      ```\n       Or perhaps you might want to boot two instances of your app on the same\n      page for a split-screen multiplayer experience:\n       ```javascript\n      import MyApp from 'my-app';\n       $(function() {\n        let App = MyApp.create({ autoboot: false });\n         let sessionId = MyApp.generateSessionID();\n         let player1 = App.visit(`/matches/join?name=Player+1&session=${sessionId}`, { rootElement: '#left', location: 'none' });\n        let player2 = App.visit(`/matches/join?name=Player+2&session=${sessionId}`, { rootElement: '#right', location: 'none' });\n         Promise.all([player1, player2]).then(() => {\n          // Both apps have completed the initial render\n          $('#loading').fadeOut();\n        });\n      });\n      ```\n       Do note that each app instance maintains their own registry/container, so\n      they will run in complete isolation by default.\n       #### Server-Side Rendering (also known as FastBoot)\n       This setup allows you to run your Ember app in a server environment using\n      Node.js and render its content into static HTML for SEO purposes.\n       ```javascript\n      const HTMLSerializer = new SimpleDOM.HTMLSerializer(SimpleDOM.voidMap);\n       function renderURL(url) {\n        let dom = new SimpleDOM.Document();\n        let rootElement = dom.body;\n        let options = { isBrowser: false, document: dom, rootElement: rootElement };\n         return MyApp.visit(options).then(instance => {\n          try {\n            return HTMLSerializer.serialize(rootElement.firstChild);\n          } finally {\n            instance.destroy();\n          }\n        });\n      }\n      ```\n       In this scenario, because Ember does not have access to a global `document`\n      object in the Node.js environment, you must provide one explicitly. In practice,\n      in the non-browser environment, the stand-in `document` object only needs to\n      implement a limited subset of the full DOM API. The `SimpleDOM` library is known\n      to work.\n       Since there is no access to jQuery in the non-browser environment, you must also\n      specify a DOM `Element` object in the same `document` for the `rootElement` option\n      (as opposed to a selector string like `\"body\"`).\n       See the documentation on the `isBrowser`, `document` and `rootElement` properties\n      on `ApplicationInstance.BootOptions` for details.\n       #### Server-Side Resource Discovery\n       This setup allows you to run the routing layer of your Ember app in a server\n      environment using Node.js and completely disable rendering. This allows you\n      to simulate and discover the resources (i.e. AJAX requests) needed to fulfill\n      a given request and eagerly \"push\" these resources to the client.\n       ```app/initializers/network-service.js\n      import BrowserNetworkService from 'app/services/network/browser';\n      import NodeNetworkService from 'app/services/network/node';\n       // Inject a (hypothetical) service for abstracting all AJAX calls and use\n      // the appropriate implementation on the client/server. This also allows the\n      // server to log all the AJAX calls made during a particular request and use\n      // that for resource-discovery purpose.\n       export function initialize(application) {\n        if (window) { // browser\n          application.register('service:network', BrowserNetworkService);\n        } else { // node\n          application.register('service:network', NodeNetworkService);\n        }\n         application.inject('route', 'network', 'service:network');\n      };\n       export default {\n        name: 'network-service',\n        initialize: initialize\n      };\n      ```\n       ```app/routes/post.js\n      import Route from '@ember/routing/route';\n       // An example of how the (hypothetical) service is used in routes.\n       export default Route.extend({\n        model(params) {\n          return this.network.fetch(`/api/posts/${params.post_id}.json`);\n        },\n         afterModel(post) {\n          if (post.isExternalContent) {\n            return this.network.fetch(`/api/external/?url=${post.externalURL}`);\n          } else {\n            return post;\n          }\n        }\n      });\n      ```\n       ```javascript\n      // Finally, put all the pieces together\n       function discoverResourcesFor(url) {\n        return MyApp.visit(url, { isBrowser: false, shouldRender: false }).then(instance => {\n          let networkService = instance.lookup('service:network');\n          return networkService.requests; // => { \"/api/posts/123.json\": \"...\" }\n        });\n      }\n      ```\n       @public\n      @method visit\n      @param url {String} The initial URL to navigate to\n      @param options {ApplicationInstance.BootOptions}\n      @return {Promise<ApplicationInstance, Error>}\n    */\n    visit(url, options) {\n      return this.boot().then(() => {\n        var instance = this.buildInstance();\n        return instance.boot(options).then(() => instance.visit(url)).catch(error => {\n          (0, _runloop.run)(instance, 'destroy');\n          throw error;\n        });\n      });\n    }\n\n  });\n\n  Application.reopenClass({\n    /**\n      This creates a registry with the default Ember naming conventions.\n       It also configures the registry:\n       * registered views are created every time they are looked up (they are\n        not singletons)\n      * registered templates are not factories; the registered value is\n        returned directly.\n      * the router receives the application as its `namespace` property\n      * all controllers receive the router as their `target` and `controllers`\n        properties\n      * all controllers receive the application as their `namespace` property\n      * the application view receives the application controller as its\n        `controller` property\n      * the application view receives the application template as its\n        `defaultTemplate` property\n       @method buildRegistry\n      @static\n      @param {Application} namespace the application for which to\n        build the registry\n      @return {Ember.Registry} the built registry\n      @private\n    */\n    buildRegistry() {\n      // eslint-disable-line no-unused-vars\n      var registry = this._super(...arguments);\n\n      commonSetupRegistry(registry);\n      (0, _glimmer.setupApplicationRegistry)(registry);\n      return registry;\n    }\n\n  });\n\n  function commonSetupRegistry(registry) {\n    registry.register('router:main', _routing.Router.extend());\n    registry.register('-view-registry:main', {\n      create() {\n        return (0, _utils.dictionary)(null);\n      }\n\n    });\n    registry.register('route:basic', _routing.Route);\n    registry.register('event_dispatcher:main', _views.EventDispatcher);\n    registry.injection('router:main', 'namespace', 'application:main');\n    registry.register('location:auto', _routing.AutoLocation);\n    registry.register('location:hash', _routing.HashLocation);\n    registry.register('location:history', _routing.HistoryLocation);\n    registry.register('location:none', _routing.NoneLocation);\n    registry.register((0, _container.privatize)(_templateObject()), {\n      create() {\n        return new _routing.BucketCache();\n      }\n\n    });\n    registry.register('service:router', _routing.RouterService);\n    registry.injection('service:router', '_router', 'router:main');\n  }\n\n  function registerLibraries() {\n    if (!librariesRegistered) {\n      librariesRegistered = true;\n\n      if (_deprecatedFeatures.JQUERY_INTEGRATION && _browserEnvironment.hasDOM && !_views.jQueryDisabled) {\n        _metal.libraries.registerCoreLibrary('jQuery', (0, _views.jQuery)().jquery);\n      }\n    }\n  }\n\n  var _default = Application;\n  _exports.default = _default;\n});","define(\"@ember/application/lib/lazy_load\", [\"exports\", \"@ember/-internals/environment\", \"@ember/-internals/browser-environment\"], function (_exports, _environment, _browserEnvironment) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.onLoad = onLoad;\n  _exports.runLoadHooks = runLoadHooks;\n  _exports._loaded = void 0;\n\n  /*globals CustomEvent */\n\n  /**\n    @module @ember/application\n  */\n  var loadHooks = _environment.ENV.EMBER_LOAD_HOOKS || {};\n  var loaded = {};\n  var _loaded = loaded;\n  /**\n    Detects when a specific package of Ember (e.g. 'Application')\n    has fully loaded and is available for extension.\n  \n    The provided `callback` will be called with the `name` passed\n    resolved from a string into the object:\n  \n    ``` javascript\n    import { onLoad } from '@ember/application';\n  \n    onLoad('Ember.Application' function(hbars) {\n      hbars.registerHelper(...);\n    });\n    ```\n  \n    @method onLoad\n    @static\n    @for @ember/application\n    @param name {String} name of hook\n    @param callback {Function} callback to be called\n    @private\n  */\n\n  _exports._loaded = _loaded;\n\n  function onLoad(name, callback) {\n    var object = loaded[name];\n    loadHooks[name] = loadHooks[name] || [];\n    loadHooks[name].push(callback);\n\n    if (object) {\n      callback(object);\n    }\n  }\n  /**\n    Called when an Ember.js package (e.g Application) has finished\n    loading. Triggers any callbacks registered for this event.\n  \n    @method runLoadHooks\n    @static\n    @for @ember/application\n    @param name {String} name of hook\n    @param object {Object} object to pass to callbacks\n    @private\n  */\n\n\n  function runLoadHooks(name, object) {\n    loaded[name] = object;\n\n    if (_browserEnvironment.window && typeof CustomEvent === 'function') {\n      var event = new CustomEvent(name, {\n        detail: object,\n        name\n      });\n\n      _browserEnvironment.window.dispatchEvent(event);\n    }\n\n    if (loadHooks[name]) {\n      loadHooks[name].forEach(callback => callback(object));\n    }\n  }\n});","define(\"@ember/canary-features/index\", [\"exports\", \"@ember/-internals/environment\", \"@ember/polyfills\"], function (_exports, _environment, _polyfills) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.isEnabled = isEnabled;\n  _exports.EMBER_ROUTING_MODEL_ARG = _exports.EMBER_GLIMMER_SET_COMPONENT_TEMPLATE = _exports.EMBER_CUSTOM_COMPONENT_ARG_PROXY = _exports.EMBER_METAL_TRACKED_PROPERTIES = _exports.EMBER_MODULE_UNIFICATION = _exports.EMBER_IMPROVED_INSTRUMENTATION = _exports.EMBER_LIBRARIES_ISREGISTERED = _exports.FEATURES = _exports.DEFAULT_FEATURES = void 0;\n\n  /**\n    Set `EmberENV.FEATURES` in your application's `config/environment.js` file\n    to enable canary features in your application.\n  \n    See the [feature flag guide](https://guides.emberjs.com/release/configuring-ember/feature-flags/)\n    for more details.\n  \n    @module @ember/canary-features\n    @public\n  */\n  var DEFAULT_FEATURES = {\n    EMBER_LIBRARIES_ISREGISTERED: false,\n    EMBER_IMPROVED_INSTRUMENTATION: false,\n    EMBER_MODULE_UNIFICATION: false,\n    EMBER_METAL_TRACKED_PROPERTIES: true,\n    EMBER_CUSTOM_COMPONENT_ARG_PROXY: true,\n    EMBER_GLIMMER_SET_COMPONENT_TEMPLATE: true,\n    EMBER_ROUTING_MODEL_ARG: true\n  };\n  /**\n    The hash of enabled Canary features. Add to this, any canary features\n    before creating your application.\n  \n    @class FEATURES\n    @static\n    @since 1.1.0\n    @public\n  */\n\n  _exports.DEFAULT_FEATURES = DEFAULT_FEATURES;\n  var FEATURES = (0, _polyfills.assign)(DEFAULT_FEATURES, _environment.ENV.FEATURES);\n  /**\n    Determine whether the specified `feature` is enabled. Used by Ember's\n    build tools to exclude experimental features from beta/stable builds.\n  \n    You can define the following configuration options:\n  \n    * `EmberENV.ENABLE_OPTIONAL_FEATURES` - enable any features that have not been explicitly\n      enabled/disabled.\n  \n    @method isEnabled\n    @param {String} feature The feature to check\n    @return {Boolean}\n    @since 1.1.0\n    @public\n  */\n\n  _exports.FEATURES = FEATURES;\n\n  function isEnabled(feature) {\n    var featureValue = FEATURES[feature];\n\n    if (featureValue === true || featureValue === false) {\n      return featureValue;\n    } else if (_environment.ENV.ENABLE_OPTIONAL_FEATURES) {\n      return true;\n    } else {\n      return false;\n    }\n  }\n\n  function featureValue(value) {\n    if (_environment.ENV.ENABLE_OPTIONAL_FEATURES && value === null) {\n      return true;\n    }\n\n    return value;\n  }\n\n  var EMBER_LIBRARIES_ISREGISTERED = featureValue(FEATURES.EMBER_LIBRARIES_ISREGISTERED);\n  _exports.EMBER_LIBRARIES_ISREGISTERED = EMBER_LIBRARIES_ISREGISTERED;\n  var EMBER_IMPROVED_INSTRUMENTATION = featureValue(FEATURES.EMBER_IMPROVED_INSTRUMENTATION);\n  _exports.EMBER_IMPROVED_INSTRUMENTATION = EMBER_IMPROVED_INSTRUMENTATION;\n  var EMBER_MODULE_UNIFICATION = featureValue(FEATURES.EMBER_MODULE_UNIFICATION);\n  _exports.EMBER_MODULE_UNIFICATION = EMBER_MODULE_UNIFICATION;\n  var EMBER_METAL_TRACKED_PROPERTIES = featureValue(FEATURES.EMBER_METAL_TRACKED_PROPERTIES);\n  _exports.EMBER_METAL_TRACKED_PROPERTIES = EMBER_METAL_TRACKED_PROPERTIES;\n  var EMBER_CUSTOM_COMPONENT_ARG_PROXY = featureValue(FEATURES.EMBER_CUSTOM_COMPONENT_ARG_PROXY);\n  _exports.EMBER_CUSTOM_COMPONENT_ARG_PROXY = EMBER_CUSTOM_COMPONENT_ARG_PROXY;\n  var EMBER_GLIMMER_SET_COMPONENT_TEMPLATE = featureValue(FEATURES.EMBER_GLIMMER_SET_COMPONENT_TEMPLATE);\n  _exports.EMBER_GLIMMER_SET_COMPONENT_TEMPLATE = EMBER_GLIMMER_SET_COMPONENT_TEMPLATE;\n  var EMBER_ROUTING_MODEL_ARG = featureValue(FEATURES.EMBER_ROUTING_MODEL_ARG);\n  _exports.EMBER_ROUTING_MODEL_ARG = EMBER_ROUTING_MODEL_ARG;\n});","define(\"@ember/component/index\", [\"exports\", \"@ember/-internals/glimmer\"], function (_exports, _glimmer) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"Component\", {\n    enumerable: true,\n    get: function () {\n      return _glimmer.Component;\n    }\n  });\n});","define(\"@ember/component/template-only\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = templateOnlyComponent;\n  _exports.isTemplateOnlyComponent = isTemplateOnlyComponent;\n  _exports.TemplateOnlyComponent = void 0;\n\n  // This is only exported for types, don't use this class directly\n  class TemplateOnlyComponent {\n    constructor(moduleName = '@ember/component/template-only') {\n      this.moduleName = moduleName;\n    }\n\n    toString() {\n      return this.moduleName;\n    }\n\n  }\n  /**\n    @module @ember/component/template-only\n    @public\n  */\n\n  /**\n    This utility function is used to declare a given component has no backing class. When the rendering engine detects this it\n    is able to perform a number of optimizations. Templates that are associated with `templateOnly()` will be rendered _as is_\n    without adding a wrapping `<div>` (or any of the other element customization behaviors of [@ember/component](/ember/release/classes/Component)).\n    Specifically, this means that the template will be rendered as \"outer HTML\".\n  \n    In general, this method will be used by build time tooling and would not be directly written in an application. However,\n    at times it may be useful to use directly to leverage the \"outer HTML\" semantics mentioned above. For example, if an addon would like\n    to use these semantics for its templates but cannot be certain it will only be consumed by applications that have enabled the\n    `template-only-glimmer-components` optional feature.\n  \n    @example\n  \n    ```js\n    import templateOnly from '@ember/component/template-only';\n  \n    export default templateOnly();\n    ```\n  \n    @public\n    @method templateOnly\n    @param {String} moduleName the module name that the template only component represents, this will be used for debugging purposes\n    @category EMBER_GLIMMER_SET_COMPONENT_TEMPLATE\n  */\n\n\n  _exports.TemplateOnlyComponent = TemplateOnlyComponent;\n\n  function templateOnlyComponent(moduleName) {\n    return new TemplateOnlyComponent(moduleName);\n  }\n\n  function isTemplateOnlyComponent(component) {\n    return component instanceof TemplateOnlyComponent;\n  }\n});","define(\"@ember/controller/index\", [\"exports\", \"@ember/-internals/runtime\", \"@ember/-internals/metal\", \"@ember/controller/lib/controller_mixin\"], function (_exports, _runtime, _metal, _controller_mixin) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.inject = inject;\n  _exports.default = void 0;\n\n  /**\n  @module @ember/controller\n  */\n\n  /**\n    @class Controller\n    @extends EmberObject\n    @uses Ember.ControllerMixin\n    @public\n  */\n  var Controller = _runtime.FrameworkObject.extend(_controller_mixin.default);\n\n  (0, _runtime.setFrameworkClass)(Controller);\n  /**\n    Creates a property that lazily looks up another controller in the container.\n    Can only be used when defining another controller.\n  \n    Example:\n  \n    ```app/controllers/post.js\n    import Controller, {\n      inject as controller\n    } from '@ember/controller';\n  \n    export default class PostController extends Controller {\n      @controller posts;\n    }\n    ```\n  \n    Classic Class Example:\n  \n    ```app/controllers/post.js\n    import Controller, {\n      inject as controller\n    } from '@ember/controller';\n  \n    export default Controller.extend({\n      posts: controller()\n    });\n    ```\n  \n    This example will create a `posts` property on the `post` controller that\n    looks up the `posts` controller in the container, making it easy to reference\n    other controllers.\n  \n    @method inject\n    @static\n    @for @ember/controller\n    @since 1.10.0\n    @param {String} name (optional) name of the controller to inject, defaults to\n           the property's name\n    @return {ComputedDecorator} injection decorator instance\n    @public\n  */\n\n  function inject() {\n    return (0, _metal.inject)('controller', ...arguments);\n  }\n\n  var _default = Controller;\n  _exports.default = _default;\n});","define(\"@ember/controller/lib/controller_mixin\", [\"exports\", \"@ember/-internals/metal\", \"@ember/-internals/runtime\", \"@ember/-internals/utils\"], function (_exports, _metal, _runtime, _utils) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  var MODEL = (0, _utils.symbol)('MODEL');\n  /**\n  @module ember\n  */\n\n  /**\n    @class ControllerMixin\n    @namespace Ember\n    @uses Ember.ActionHandler\n    @private\n  */\n\n  var _default = _metal.Mixin.create(_runtime.ActionHandler, {\n    /* ducktype as a controller */\n    isController: true,\n\n    /**\n      The object to which actions from the view should be sent.\n       For example, when a Handlebars template uses the `{{action}}` helper,\n      it will attempt to send the action to the view's controller's `target`.\n       By default, the value of the target property is set to the router, and\n      is injected when a controller is instantiated. This injection is applied\n      as part of the application's initialization process. In most cases the\n      `target` property will automatically be set to the logical consumer of\n      actions for the controller.\n       @property target\n      @default null\n      @public\n    */\n    target: null,\n    store: null,\n\n    /**\n      The controller's current model. When retrieving or modifying a controller's\n      model, this property should be used instead of the `content` property.\n       @property model\n      @public\n    */\n    model: (0, _metal.computed)({\n      get() {\n        return this[MODEL];\n      },\n\n      set(key, value) {\n        return this[MODEL] = value;\n      }\n\n    })\n  });\n\n  _exports.default = _default;\n});","define(\"@ember/debug/index\", [\"exports\", \"@ember/-internals/browser-environment\", \"@ember/error\", \"@ember/debug/lib/deprecate\", \"@ember/debug/lib/testing\", \"@ember/debug/lib/warn\", \"@ember/debug/lib/capture-render-tree\"], function (_exports, _browserEnvironment, _error, _deprecate2, _testing, _warn2, _captureRenderTree) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"registerDeprecationHandler\", {\n    enumerable: true,\n    get: function () {\n      return _deprecate2.registerHandler;\n    }\n  });\n  Object.defineProperty(_exports, \"isTesting\", {\n    enumerable: true,\n    get: function () {\n      return _testing.isTesting;\n    }\n  });\n  Object.defineProperty(_exports, \"setTesting\", {\n    enumerable: true,\n    get: function () {\n      return _testing.setTesting;\n    }\n  });\n  Object.defineProperty(_exports, \"registerWarnHandler\", {\n    enumerable: true,\n    get: function () {\n      return _warn2.registerHandler;\n    }\n  });\n  Object.defineProperty(_exports, \"captureRenderTree\", {\n    enumerable: true,\n    get: function () {\n      return _captureRenderTree.default;\n    }\n  });\n  _exports._warnIfUsingStrippedFeatureFlags = _exports.getDebugFunction = _exports.setDebugFunction = _exports.deprecateFunc = _exports.runInDebug = _exports.debugFreeze = _exports.debugSeal = _exports.deprecate = _exports.debug = _exports.warn = _exports.info = _exports.assert = void 0;\n\n  // These are the default production build versions:\n  var noop = () => {};\n\n  var assert = noop;\n  _exports.assert = assert;\n  var info = noop;\n  _exports.info = info;\n  var warn = noop;\n  _exports.warn = warn;\n  var debug = noop;\n  _exports.debug = debug;\n  var deprecate = noop;\n  _exports.deprecate = deprecate;\n  var debugSeal = noop;\n  _exports.debugSeal = debugSeal;\n  var debugFreeze = noop;\n  _exports.debugFreeze = debugFreeze;\n  var runInDebug = noop;\n  _exports.runInDebug = runInDebug;\n  var setDebugFunction = noop;\n  _exports.setDebugFunction = setDebugFunction;\n  var getDebugFunction = noop;\n  _exports.getDebugFunction = getDebugFunction;\n\n  var deprecateFunc = function () {\n    return arguments[arguments.length - 1];\n  };\n\n  _exports.deprecateFunc = deprecateFunc;\n\n  if (true\n  /* DEBUG */\n  ) {\n    _exports.setDebugFunction = setDebugFunction = function (type, callback) {\n      switch (type) {\n        case 'assert':\n          return _exports.assert = assert = callback;\n\n        case 'info':\n          return _exports.info = info = callback;\n\n        case 'warn':\n          return _exports.warn = warn = callback;\n\n        case 'debug':\n          return _exports.debug = debug = callback;\n\n        case 'deprecate':\n          return _exports.deprecate = deprecate = callback;\n\n        case 'debugSeal':\n          return _exports.debugSeal = debugSeal = callback;\n\n        case 'debugFreeze':\n          return _exports.debugFreeze = debugFreeze = callback;\n\n        case 'runInDebug':\n          return _exports.runInDebug = runInDebug = callback;\n\n        case 'deprecateFunc':\n          return _exports.deprecateFunc = deprecateFunc = callback;\n      }\n    };\n\n    _exports.getDebugFunction = getDebugFunction = function (type) {\n      switch (type) {\n        case 'assert':\n          return assert;\n\n        case 'info':\n          return info;\n\n        case 'warn':\n          return warn;\n\n        case 'debug':\n          return debug;\n\n        case 'deprecate':\n          return deprecate;\n\n        case 'debugSeal':\n          return debugSeal;\n\n        case 'debugFreeze':\n          return debugFreeze;\n\n        case 'runInDebug':\n          return runInDebug;\n\n        case 'deprecateFunc':\n          return deprecateFunc;\n      }\n    };\n  }\n  /**\n  @module @ember/debug\n  */\n\n\n  if (true\n  /* DEBUG */\n  ) {\n    /**\n      Verify that a certain expectation is met, or throw a exception otherwise.\n         This is useful for communicating assumptions in the code to other human\n      readers as well as catching bugs that accidentally violates these\n      expectations.\n         Assertions are removed from production builds, so they can be freely added\n      for documentation and debugging purposes without worries of incuring any\n      performance penalty. However, because of that, they should not be used for\n      checks that could reasonably fail during normal usage. Furthermore, care\n      should be taken to avoid accidentally relying on side-effects produced from\n      evaluating the condition itself, since the code will not run in production.\n         ```javascript\n      import { assert } from '@ember/debug';\n         // Test for truthiness\n      assert('Must pass a string', typeof str === 'string');\n         // Fail unconditionally\n      assert('This code path should never be run');\n      ```\n         @method assert\n      @static\n      @for @ember/debug\n      @param {String} description Describes the expectation. This will become the\n        text of the Error thrown if the assertion fails.\n      @param {any} condition Must be truthy for the assertion to pass. If\n        falsy, an exception will be thrown.\n      @public\n      @since 1.0.0\n    */\n    setDebugFunction('assert', function assert(desc, test) {\n      if (!test) {\n        throw new _error.default(\"Assertion Failed: \" + desc);\n      }\n    });\n    /**\n      Display a debug notice.\n         Calls to this function are removed from production builds, so they can be\n      freely added for documentation and debugging purposes without worries of\n      incuring any performance penalty.\n         ```javascript\n      import { debug } from '@ember/debug';\n         debug('I\\'m a debug notice!');\n      ```\n         @method debug\n      @for @ember/debug\n      @static\n      @param {String} message A debug message to display.\n      @public\n    */\n\n    setDebugFunction('debug', function debug(message) {\n      /* eslint-disable no-console */\n      if (console.debug) {\n        console.debug(\"DEBUG: \" + message);\n      } else {\n        console.log(\"DEBUG: \" + message);\n      }\n      /* eslint-ensable no-console */\n\n    });\n    /**\n      Display an info notice.\n         Calls to this function are removed from production builds, so they can be\n      freely added for documentation and debugging purposes without worries of\n      incuring any performance penalty.\n         @method info\n      @private\n    */\n\n    setDebugFunction('info', function info() {\n      console.info(...arguments);\n      /* eslint-disable-line no-console */\n    });\n    /**\n     @module @ember/debug\n     @public\n    */\n\n    /**\n      Alias an old, deprecated method with its new counterpart.\n         Display a deprecation warning with the provided message and a stack trace\n      (Chrome and Firefox only) when the assigned method is called.\n         Calls to this function are removed from production builds, so they can be\n      freely added for documentation and debugging purposes without worries of\n      incuring any performance penalty.\n         ```javascript\n      import { deprecateFunc } from '@ember/debug';\n         Ember.oldMethod = deprecateFunc('Please use the new, updated method', options, Ember.newMethod);\n      ```\n         @method deprecateFunc\n      @static\n      @for @ember/debug\n      @param {String} message A description of the deprecation.\n      @param {Object} [options] The options object for `deprecate`.\n      @param {Function} func The new function called to replace its deprecated counterpart.\n      @return {Function} A new function that wraps the original function with a deprecation warning\n      @private\n    */\n\n    setDebugFunction('deprecateFunc', function deprecateFunc(...args) {\n      if (args.length === 3) {\n        var [message, options, func] = args;\n        return function (...args) {\n          deprecate(message, false, options);\n          return func.apply(this, args);\n        };\n      } else {\n        var [_message, _func] = args;\n        return function () {\n          deprecate(_message);\n          return _func.apply(this, arguments);\n        };\n      }\n    });\n    /**\n     @module @ember/debug\n     @public\n    */\n\n    /**\n      Run a function meant for debugging.\n         Calls to this function are removed from production builds, so they can be\n      freely added for documentation and debugging purposes without worries of\n      incuring any performance penalty.\n         ```javascript\n      import Component from '@ember/component';\n      import { runInDebug } from '@ember/debug';\n         runInDebug(() => {\n        Component.reopen({\n          didInsertElement() {\n            console.log(\"I'm happy\");\n          }\n        });\n      });\n      ```\n         @method runInDebug\n      @for @ember/debug\n      @static\n      @param {Function} func The function to be executed.\n      @since 1.5.0\n      @public\n    */\n\n    setDebugFunction('runInDebug', function runInDebug(func) {\n      func();\n    });\n    setDebugFunction('debugSeal', function debugSeal(obj) {\n      Object.seal(obj);\n    });\n    setDebugFunction('debugFreeze', function debugFreeze(obj) {\n      // re-freezing an already frozen object introduces a significant\n      // performance penalty on Chrome (tested through 59).\n      //\n      // See: https://bugs.chromium.org/p/v8/issues/detail?id=6450\n      if (!Object.isFrozen(obj)) {\n        Object.freeze(obj);\n      }\n    });\n    setDebugFunction('deprecate', _deprecate2.default);\n    setDebugFunction('warn', _warn2.default);\n  }\n\n  var _warnIfUsingStrippedFeatureFlags;\n\n  _exports._warnIfUsingStrippedFeatureFlags = _warnIfUsingStrippedFeatureFlags;\n\n  if (true\n  /* DEBUG */\n  && !(0, _testing.isTesting)()) {\n    if (typeof window !== 'undefined' && (_browserEnvironment.isFirefox || _browserEnvironment.isChrome) && window.addEventListener) {\n      window.addEventListener('load', () => {\n        if (document.documentElement && document.documentElement.dataset && !document.documentElement.dataset.emberExtension) {\n          var downloadURL;\n\n          if (_browserEnvironment.isChrome) {\n            downloadURL = 'https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi';\n          } else if (_browserEnvironment.isFirefox) {\n            downloadURL = 'https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/';\n          }\n\n          debug(\"For more advanced debugging, install the Ember Inspector from \" + downloadURL);\n        }\n      }, false);\n    }\n  }\n});","define(\"@ember/debug/lib/capture-render-tree\", [\"exports\", \"@glimmer/util\"], function (_exports, _util) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = captureRenderTree;\n\n  /**\n    @module @ember/debug\n  */\n\n  /**\n    Ember Inspector calls this function to capture the current render tree.\n  \n    In production mode, this requires turning on `ENV._DEBUG_RENDER_TREE`\n    before loading Ember.\n  \n    @private\n    @static\n    @method captureRenderTree\n    @for @ember/debug\n    @param app {ApplicationInstance} An `ApplicationInstance`.\n    @since 3.14.0\n  */\n  function captureRenderTree(app) {\n    var env = (0, _util.expect)(app.lookup('service:-glimmer-environment'), 'BUG: owner is missing service:-glimmer-environment');\n    return env.debugRenderTree.capture();\n  }\n});","define(\"@ember/debug/lib/deprecate\", [\"exports\", \"@ember/-internals/environment\", \"@ember/debug/index\", \"@ember/debug/lib/handlers\"], function (_exports, _environment, _index, _handlers) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.missingOptionsUntilDeprecation = _exports.missingOptionsIdDeprecation = _exports.missingOptionsDeprecation = _exports.registerHandler = _exports.default = void 0;\n\n  /**\n   @module @ember/debug\n   @public\n  */\n\n  /**\n    Allows for runtime registration of handler functions that override the default deprecation behavior.\n    Deprecations are invoked by calls to [@ember/debug/deprecate](/ember/release/classes/@ember%2Fdebug/methods/deprecate?anchor=deprecate).\n    The following example demonstrates its usage by registering a handler that throws an error if the\n    message contains the word \"should\", otherwise defers to the default handler.\n  \n    ```javascript\n    import { registerDeprecationHandler } from '@ember/debug';\n  \n    registerDeprecationHandler((message, options, next) => {\n      if (message.indexOf('should') !== -1) {\n        throw new Error(`Deprecation message with should: ${message}`);\n      } else {\n        // defer to whatever handler was registered before this one\n        next(message, options);\n      }\n    });\n    ```\n  \n    The handler function takes the following arguments:\n  \n    <ul>\n      <li> <code>message</code> - The message received from the deprecation call.</li>\n      <li> <code>options</code> - An object passed in with the deprecation call containing additional information including:</li>\n        <ul>\n          <li> <code>id</code> - An id of the deprecation in the form of <code>package-name.specific-deprecation</code>.</li>\n          <li> <code>until</code> - The Ember version number the feature and deprecation will be removed in.</li>\n        </ul>\n      <li> <code>next</code> - A function that calls into the previously registered handler.</li>\n    </ul>\n  \n    @public\n    @static\n    @method registerDeprecationHandler\n    @for @ember/debug\n    @param handler {Function} A function to handle deprecation calls.\n    @since 2.1.0\n  */\n  var registerHandler = () => {};\n\n  _exports.registerHandler = registerHandler;\n  var missingOptionsDeprecation;\n  _exports.missingOptionsDeprecation = missingOptionsDeprecation;\n  var missingOptionsIdDeprecation;\n  _exports.missingOptionsIdDeprecation = missingOptionsIdDeprecation;\n  var missingOptionsUntilDeprecation;\n  _exports.missingOptionsUntilDeprecation = missingOptionsUntilDeprecation;\n\n  var deprecate = () => {};\n\n  if (true\n  /* DEBUG */\n  ) {\n    _exports.registerHandler = registerHandler = function registerHandler(handler) {\n      (0, _handlers.registerHandler)('deprecate', handler);\n    };\n\n    var formatMessage = function formatMessage(_message, options) {\n      var message = _message;\n\n      if (options && options.id) {\n        message = message + (\" [deprecation id: \" + options.id + \"]\");\n      }\n\n      if (options && options.url) {\n        message += \" See \" + options.url + \" for more details.\";\n      }\n\n      return message;\n    };\n\n    registerHandler(function logDeprecationToConsole(message, options) {\n      var updatedMessage = formatMessage(message, options);\n      console.warn(\"DEPRECATION: \" + updatedMessage); // eslint-disable-line no-console\n    });\n    var captureErrorForStack;\n\n    if (new Error().stack) {\n      captureErrorForStack = () => new Error();\n    } else {\n      captureErrorForStack = () => {\n        try {\n          __fail__.fail();\n        } catch (e) {\n          return e;\n        }\n      };\n    }\n\n    registerHandler(function logDeprecationStackTrace(message, options, next) {\n      if (_environment.ENV.LOG_STACKTRACE_ON_DEPRECATION) {\n        var stackStr = '';\n        var error = captureErrorForStack();\n        var stack;\n\n        if (error.stack) {\n          if (error['arguments']) {\n            // Chrome\n            stack = error.stack.replace(/^\\s+at\\s+/gm, '').replace(/^([^\\(]+?)([\\n$])/gm, '{anonymous}($1)$2').replace(/^Object.<anonymous>\\s*\\(([^\\)]+)\\)/gm, '{anonymous}($1)').split('\\n');\n            stack.shift();\n          } else {\n            // Firefox\n            stack = error.stack.replace(/(?:\\n@:0)?\\s+$/m, '').replace(/^\\(/gm, '{anonymous}(').split('\\n');\n          }\n\n          stackStr = \"\\n    \" + stack.slice(2).join('\\n    ');\n        }\n\n        var updatedMessage = formatMessage(message, options);\n        console.warn(\"DEPRECATION: \" + updatedMessage + stackStr); // eslint-disable-line no-console\n      } else {\n        next(message, options);\n      }\n    });\n    registerHandler(function raiseOnDeprecation(message, options, next) {\n      if (_environment.ENV.RAISE_ON_DEPRECATION) {\n        var updatedMessage = formatMessage(message);\n        throw new Error(updatedMessage);\n      } else {\n        next(message, options);\n      }\n    });\n    _exports.missingOptionsDeprecation = missingOptionsDeprecation = 'When calling `deprecate` you ' + 'must provide an `options` hash as the third parameter.  ' + '`options` should include `id` and `until` properties.';\n    _exports.missingOptionsIdDeprecation = missingOptionsIdDeprecation = 'When calling `deprecate` you must provide `id` in options.';\n    _exports.missingOptionsUntilDeprecation = missingOptionsUntilDeprecation = 'When calling `deprecate` you must provide `until` in options.';\n    /**\n     @module @ember/debug\n     @public\n     */\n\n    /**\n      Display a deprecation warning with the provided message and a stack trace\n      (Chrome and Firefox only).\n         * In a production build, this method is defined as an empty function (NOP).\n      Uses of this method in Ember itself are stripped from the ember.prod.js build.\n         @method deprecate\n      @for @ember/debug\n      @param {String} message A description of the deprecation.\n      @param {Boolean} test A boolean. If falsy, the deprecation will be displayed.\n      @param {Object} options\n      @param {String} options.id A unique id for this deprecation. The id can be\n        used by Ember debugging tools to change the behavior (raise, log or silence)\n        for that specific deprecation. The id should be namespaced by dots, e.g.\n        \"view.helper.select\".\n      @param {string} options.until The version of Ember when this deprecation\n        warning will be removed.\n      @param {String} [options.url] An optional url to the transition guide on the\n        emberjs.com website.\n      @static\n      @public\n      @since 1.0.0\n    */\n\n    deprecate = function deprecate(message, test, options) {\n      (0, _index.assert)(missingOptionsDeprecation, Boolean(options && (options.id || options.until)));\n      (0, _index.assert)(missingOptionsIdDeprecation, Boolean(options.id));\n      (0, _index.assert)(missingOptionsUntilDeprecation, Boolean(options.until));\n      (0, _handlers.invoke)('deprecate', message, test, options);\n    };\n  }\n\n  var _default = deprecate;\n  _exports.default = _default;\n});","define(\"@ember/debug/lib/handlers\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.invoke = _exports.registerHandler = _exports.HANDLERS = void 0;\n  var HANDLERS = {};\n  _exports.HANDLERS = HANDLERS;\n\n  var registerHandler = () => {};\n\n  _exports.registerHandler = registerHandler;\n\n  var invoke = () => {};\n\n  _exports.invoke = invoke;\n\n  if (true\n  /* DEBUG */\n  ) {\n    _exports.registerHandler = registerHandler = function registerHandler(type, callback) {\n      var nextHandler = HANDLERS[type] || (() => {});\n\n      HANDLERS[type] = (message, options) => {\n        callback(message, options, nextHandler);\n      };\n    };\n\n    _exports.invoke = invoke = function invoke(type, message, test, options) {\n      if (test) {\n        return;\n      }\n\n      var handlerForType = HANDLERS[type];\n\n      if (handlerForType) {\n        handlerForType(message, options);\n      }\n    };\n  }\n});","define(\"@ember/debug/lib/testing\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.isTesting = isTesting;\n  _exports.setTesting = setTesting;\n  var testing = false;\n\n  function isTesting() {\n    return testing;\n  }\n\n  function setTesting(value) {\n    testing = Boolean(value);\n  }\n});","define(\"@ember/debug/lib/warn\", [\"exports\", \"@ember/debug/index\", \"@ember/debug/lib/handlers\"], function (_exports, _index, _handlers) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.missingOptionsDeprecation = _exports.missingOptionsIdDeprecation = _exports.registerHandler = _exports.default = void 0;\n\n  var registerHandler = () => {};\n\n  _exports.registerHandler = registerHandler;\n\n  var warn = () => {};\n\n  var missingOptionsDeprecation;\n  _exports.missingOptionsDeprecation = missingOptionsDeprecation;\n  var missingOptionsIdDeprecation;\n  /**\n  @module @ember/debug\n  */\n\n  _exports.missingOptionsIdDeprecation = missingOptionsIdDeprecation;\n\n  if (true\n  /* DEBUG */\n  ) {\n    /**\n      Allows for runtime registration of handler functions that override the default warning behavior.\n      Warnings are invoked by calls made to [@ember/debug/warn](/ember/release/classes/@ember%2Fdebug/methods/warn?anchor=warn).\n      The following example demonstrates its usage by registering a handler that does nothing overriding Ember's\n      default warning behavior.\n         ```javascript\n      import { registerWarnHandler } from '@ember/debug';\n         // next is not called, so no warnings get the default behavior\n      registerWarnHandler(() => {});\n      ```\n         The handler function takes the following arguments:\n         <ul>\n        <li> <code>message</code> - The message received from the warn call. </li>\n        <li> <code>options</code> - An object passed in with the warn call containing additional information including:</li>\n          <ul>\n            <li> <code>id</code> - An id of the warning in the form of <code>package-name.specific-warning</code>.</li>\n          </ul>\n        <li> <code>next</code> - A function that calls into the previously registered handler.</li>\n      </ul>\n         @public\n      @static\n      @method registerWarnHandler\n      @for @ember/debug\n      @param handler {Function} A function to handle warnings.\n      @since 2.1.0\n    */\n    _exports.registerHandler = registerHandler = function registerHandler(handler) {\n      (0, _handlers.registerHandler)('warn', handler);\n    };\n\n    registerHandler(function logWarning(message) {\n      /* eslint-disable no-console */\n      console.warn(\"WARNING: \" + message);\n      /* eslint-enable no-console */\n    });\n    _exports.missingOptionsDeprecation = missingOptionsDeprecation = 'When calling `warn` you ' + 'must provide an `options` hash as the third parameter.  ' + '`options` should include an `id` property.';\n    _exports.missingOptionsIdDeprecation = missingOptionsIdDeprecation = 'When calling `warn` you must provide `id` in options.';\n    /**\n      Display a warning with the provided message.\n         * In a production build, this method is defined as an empty function (NOP).\n      Uses of this method in Ember itself are stripped from the ember.prod.js build.\n         ```javascript\n      import { warn } from '@ember/debug';\n      import tomsterCount from './tomster-counter'; // a module in my project\n         // Log a warning if we have more than 3 tomsters\n      warn('Too many tomsters!', tomsterCount <= 3, {\n        id: 'ember-debug.too-many-tomsters'\n      });\n      ```\n         @method warn\n      @for @ember/debug\n      @static\n      @param {String} message A warning to display.\n      @param {Boolean} test An optional boolean. If falsy, the warning\n        will be displayed.\n      @param {Object} options An object that can be used to pass a unique\n        `id` for this warning.  The `id` can be used by Ember debugging tools\n        to change the behavior (raise, log, or silence) for that specific warning.\n        The `id` should be namespaced by dots, e.g. \"ember-debug.feature-flag-with-features-stripped\"\n      @public\n      @since 1.0.0\n    */\n\n    warn = function warn(message, test, options) {\n      if (arguments.length === 2 && typeof test === 'object') {\n        options = test;\n        test = false;\n      }\n\n      (0, _index.assert)(missingOptionsDeprecation, Boolean(options));\n      (0, _index.assert)(missingOptionsIdDeprecation, Boolean(options && options.id));\n      (0, _handlers.invoke)('warn', message, test, options);\n    };\n  }\n\n  var _default = warn;\n  _exports.default = _default;\n});","define(\"@ember/deprecated-features/index\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.PARTIALS = _exports.EMBER_COMPONENT_IS_VISIBLE = _exports.MOUSE_ENTER_LEAVE_MOVE_EVENTS = _exports.FUNCTION_PROTOTYPE_EXTENSIONS = _exports.APP_CTRL_ROUTER_PROPS = _exports.ALIAS_METHOD = _exports.JQUERY_INTEGRATION = _exports.COMPONENT_MANAGER_STRING_LOOKUP = _exports.ROUTER_EVENTS = _exports.MERGE = _exports.LOGGER = _exports.EMBER_EXTEND_PROTOTYPES = _exports.SEND_ACTION = void 0;\n\n  /* eslint-disable no-implicit-coercion */\n  // These versions should be the version that the deprecation was _introduced_,\n  // not the version that the feature will be removed.\n  var SEND_ACTION = !!'3.4.0';\n  _exports.SEND_ACTION = SEND_ACTION;\n  var EMBER_EXTEND_PROTOTYPES = !!'3.2.0-beta.5';\n  _exports.EMBER_EXTEND_PROTOTYPES = EMBER_EXTEND_PROTOTYPES;\n  var LOGGER = !!'3.2.0-beta.1';\n  _exports.LOGGER = LOGGER;\n  var MERGE = !!'3.6.0-beta.1';\n  _exports.MERGE = MERGE;\n  var ROUTER_EVENTS = !!'4.0.0';\n  _exports.ROUTER_EVENTS = ROUTER_EVENTS;\n  var COMPONENT_MANAGER_STRING_LOOKUP = !!'3.8.0';\n  _exports.COMPONENT_MANAGER_STRING_LOOKUP = COMPONENT_MANAGER_STRING_LOOKUP;\n  var JQUERY_INTEGRATION = !!'3.9.0';\n  _exports.JQUERY_INTEGRATION = JQUERY_INTEGRATION;\n  var ALIAS_METHOD = !!'3.9.0';\n  _exports.ALIAS_METHOD = ALIAS_METHOD;\n  var APP_CTRL_ROUTER_PROPS = !!'3.10.0-beta.1';\n  _exports.APP_CTRL_ROUTER_PROPS = APP_CTRL_ROUTER_PROPS;\n  var FUNCTION_PROTOTYPE_EXTENSIONS = !!'3.11.0-beta.1';\n  _exports.FUNCTION_PROTOTYPE_EXTENSIONS = FUNCTION_PROTOTYPE_EXTENSIONS;\n  var MOUSE_ENTER_LEAVE_MOVE_EVENTS = !!'3.13.0-beta.1';\n  _exports.MOUSE_ENTER_LEAVE_MOVE_EVENTS = MOUSE_ENTER_LEAVE_MOVE_EVENTS;\n  var EMBER_COMPONENT_IS_VISIBLE = !!'3.15.0-beta.1';\n  _exports.EMBER_COMPONENT_IS_VISIBLE = EMBER_COMPONENT_IS_VISIBLE;\n  var PARTIALS = !!'3.15.0-beta.1';\n  _exports.PARTIALS = PARTIALS;\n});","define(\"@ember/engine/index\", [\"exports\", \"ember-babel\", \"@ember/engine/lib/engine-parent\", \"@ember/-internals/utils\", \"@ember/controller\", \"@ember/-internals/runtime\", \"@ember/-internals/container\", \"dag-map\", \"@ember/debug\", \"@ember/-internals/metal\", \"@ember/application/globals-resolver\", \"@ember/engine/instance\", \"@ember/-internals/routing\", \"@ember/-internals/extension-support\", \"@ember/-internals/views\", \"@ember/-internals/glimmer\"], function (_exports, _emberBabel, _engineParent, _utils, _controller, _runtime, _container, _dagMap, _debug, _metal, _globalsResolver, _instance, _routing, _extensionSupport, _views, _glimmer) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"getEngineParent\", {\n    enumerable: true,\n    get: function () {\n      return _engineParent.getEngineParent;\n    }\n  });\n  Object.defineProperty(_exports, \"setEngineParent\", {\n    enumerable: true,\n    get: function () {\n      return _engineParent.setEngineParent;\n    }\n  });\n  _exports.default = void 0;\n\n  function _templateObject2() {\n    var data = (0, _emberBabel.taggedTemplateLiteralLoose)([\"-bucket-cache:main\"]);\n\n    _templateObject2 = function () {\n      return data;\n    };\n\n    return data;\n  }\n\n  function _templateObject() {\n    var data = (0, _emberBabel.taggedTemplateLiteralLoose)([\"-bucket-cache:main\"]);\n\n    _templateObject = function () {\n      return data;\n    };\n\n    return data;\n  }\n\n  function props(obj) {\n    var properties = [];\n\n    for (var key in obj) {\n      properties.push(key);\n    }\n\n    return properties;\n  }\n  /**\n  @module @ember/engine\n  */\n\n  /**\n    The `Engine` class contains core functionality for both applications and\n    engines.\n  \n    Each engine manages a registry that's used for dependency injection and\n    exposed through `RegistryProxy`.\n  \n    Engines also manage initializers and instance initializers.\n  \n    Engines can spawn `EngineInstance` instances via `buildInstance()`.\n  \n    @class Engine\n    @extends Ember.Namespace\n    @uses RegistryProxy\n    @public\n  */\n\n\n  var Engine = _runtime.Namespace.extend(_runtime.RegistryProxyMixin, {\n    init() {\n      this._super(...arguments);\n\n      this.buildRegistry();\n    },\n\n    /**\n      A private flag indicating whether an engine's initializers have run yet.\n       @private\n      @property _initializersRan\n    */\n    _initializersRan: false,\n\n    /**\n      Ensure that initializers are run once, and only once, per engine.\n       @private\n      @method ensureInitializers\n    */\n    ensureInitializers() {\n      if (!this._initializersRan) {\n        this.runInitializers();\n        this._initializersRan = true;\n      }\n    },\n\n    /**\n      Create an EngineInstance for this engine.\n       @public\n      @method buildInstance\n      @return {EngineInstance} the engine instance\n    */\n    buildInstance(options = {}) {\n      this.ensureInitializers();\n      options.base = this;\n      return _instance.default.create(options);\n    },\n\n    /**\n      Build and configure the registry for the current engine.\n       @private\n      @method buildRegistry\n      @return {Ember.Registry} the configured registry\n    */\n    buildRegistry() {\n      var registry = this.__registry__ = this.constructor.buildRegistry(this);\n      return registry;\n    },\n\n    /**\n      @private\n      @method initializer\n    */\n    initializer(options) {\n      this.constructor.initializer(options);\n    },\n\n    /**\n      @private\n      @method instanceInitializer\n    */\n    instanceInitializer(options) {\n      this.constructor.instanceInitializer(options);\n    },\n\n    /**\n      @private\n      @method runInitializers\n    */\n    runInitializers() {\n      this._runInitializer('initializers', (name, initializer) => {\n        (true && !(Boolean(initializer)) && (0, _debug.assert)(\"No application initializer named '\" + name + \"'\", Boolean(initializer)));\n        initializer.initialize(this);\n      });\n    },\n\n    /**\n      @private\n      @since 1.12.0\n      @method runInstanceInitializers\n    */\n    runInstanceInitializers(instance) {\n      this._runInitializer('instanceInitializers', (name, initializer) => {\n        (true && !(Boolean(initializer)) && (0, _debug.assert)(\"No instance initializer named '\" + name + \"'\", Boolean(initializer)));\n        initializer.initialize(instance);\n      });\n    },\n\n    _runInitializer(bucketName, cb) {\n      var initializersByName = (0, _metal.get)(this.constructor, bucketName);\n      var initializers = props(initializersByName);\n      var graph = new _dagMap.default();\n      var initializer;\n\n      for (var i = 0; i < initializers.length; i++) {\n        initializer = initializersByName[initializers[i]];\n        graph.add(initializer.name, initializer, initializer.before, initializer.after);\n      }\n\n      graph.topsort(cb);\n    }\n\n  });\n\n  Engine.reopenClass({\n    initializers: Object.create(null),\n    instanceInitializers: Object.create(null),\n\n    /**\n      The goal of initializers should be to register dependencies and injections.\n      This phase runs once. Because these initializers may load code, they are\n      allowed to defer application readiness and advance it. If you need to access\n      the container or store you should use an InstanceInitializer that will be run\n      after all initializers and therefore after all code is loaded and the app is\n      ready.\n       Initializer receives an object which has the following attributes:\n      `name`, `before`, `after`, `initialize`. The only required attribute is\n      `initialize`, all others are optional.\n       * `name` allows you to specify under which name the initializer is registered.\n      This must be a unique name, as trying to register two initializers with the\n      same name will result in an error.\n       ```app/initializer/named-initializer.js\n      import { debug } from '@ember/debug';\n       export function initialize() {\n        debug('Running namedInitializer!');\n      }\n       export default {\n        name: 'named-initializer',\n        initialize\n      };\n      ```\n       * `before` and `after` are used to ensure that this initializer is ran prior\n      or after the one identified by the value. This value can be a single string\n      or an array of strings, referencing the `name` of other initializers.\n       An example of ordering initializers, we create an initializer named `first`:\n       ```app/initializer/first.js\n      import { debug } from '@ember/debug';\n       export function initialize() {\n        debug('First initializer!');\n      }\n       export default {\n        name: 'first',\n        initialize\n      };\n      ```\n       ```bash\n      // DEBUG: First initializer!\n      ```\n       We add another initializer named `second`, specifying that it should run\n      after the initializer named `first`:\n       ```app/initializer/second.js\n      import { debug } from '@ember/debug';\n       export function initialize() {\n        debug('Second initializer!');\n      }\n       export default {\n        name: 'second',\n        after: 'first',\n        initialize\n      };\n      ```\n       ```\n      // DEBUG: First initializer!\n      // DEBUG: Second initializer!\n      ```\n       Afterwards we add a further initializer named `pre`, this time specifying\n      that it should run before the initializer named `first`:\n       ```app/initializer/pre.js\n      import { debug } from '@ember/debug';\n       export function initialize() {\n        debug('Pre initializer!');\n      }\n       export default {\n        name: 'pre',\n        before: 'first',\n        initialize\n      };\n      ```\n       ```bash\n      // DEBUG: Pre initializer!\n      // DEBUG: First initializer!\n      // DEBUG: Second initializer!\n      ```\n       Finally we add an initializer named `post`, specifying it should run after\n      both the `first` and the `second` initializers:\n       ```app/initializer/post.js\n      import { debug } from '@ember/debug';\n       export function initialize() {\n        debug('Post initializer!');\n      }\n       export default {\n        name: 'post',\n        after: ['first', 'second'],\n        initialize\n      };\n      ```\n       ```bash\n      // DEBUG: Pre initializer!\n      // DEBUG: First initializer!\n      // DEBUG: Second initializer!\n      // DEBUG: Post initializer!\n      ```\n       * `initialize` is a callback function that receives one argument,\n        `application`, on which you can operate.\n       Example of using `application` to register an adapter:\n       ```app/initializer/api-adapter.js\n      import ApiAdapter from '../utils/api-adapter';\n       export function initialize(application) {\n        application.register('api-adapter:main', ApiAdapter);\n      }\n       export default {\n        name: 'post',\n        after: ['first', 'second'],\n        initialize\n      };\n      ```\n       @method initializer\n      @param initializer {Object}\n      @public\n    */\n    initializer: buildInitializerMethod('initializers', 'initializer'),\n\n    /**\n      Instance initializers run after all initializers have run. Because\n      instance initializers run after the app is fully set up. We have access\n      to the store, container, and other items. However, these initializers run\n      after code has loaded and are not allowed to defer readiness.\n       Instance initializer receives an object which has the following attributes:\n      `name`, `before`, `after`, `initialize`. The only required attribute is\n      `initialize`, all others are optional.\n       * `name` allows you to specify under which name the instanceInitializer is\n      registered. This must be a unique name, as trying to register two\n      instanceInitializer with the same name will result in an error.\n       ```app/initializer/named-instance-initializer.js\n      import { debug } from '@ember/debug';\n       export function initialize() {\n        debug('Running named-instance-initializer!');\n      }\n       export default {\n        name: 'named-instance-initializer',\n        initialize\n      };\n      ```\n       * `before` and `after` are used to ensure that this initializer is ran prior\n      or after the one identified by the value. This value can be a single string\n      or an array of strings, referencing the `name` of other initializers.\n       * See Application.initializer for discussion on the usage of before\n      and after.\n       Example instanceInitializer to preload data into the store.\n       ```app/initializer/preload-data.js\n      import $ from 'jquery';\n       export function initialize(application) {\n          var userConfig, userConfigEncoded, store;\n          // We have a HTML escaped JSON representation of the user's basic\n          // configuration generated server side and stored in the DOM of the main\n          // index.html file. This allows the app to have access to a set of data\n          // without making any additional remote calls. Good for basic data that is\n          // needed for immediate rendering of the page. Keep in mind, this data,\n          // like all local models and data can be manipulated by the user, so it\n          // should not be relied upon for security or authorization.\n           // Grab the encoded data from the meta tag\n          userConfigEncoded = $('head meta[name=app-user-config]').attr('content');\n           // Unescape the text, then parse the resulting JSON into a real object\n          userConfig = JSON.parse(unescape(userConfigEncoded));\n           // Lookup the store\n          store = application.lookup('service:store');\n           // Push the encoded JSON into the store\n          store.pushPayload(userConfig);\n      }\n       export default {\n        name: 'named-instance-initializer',\n        initialize\n      };\n      ```\n       @method instanceInitializer\n      @param instanceInitializer\n      @public\n    */\n    instanceInitializer: buildInitializerMethod('instanceInitializers', 'instance initializer'),\n\n    /**\n      This creates a registry with the default Ember naming conventions.\n       It also configures the registry:\n       * registered views are created every time they are looked up (they are\n        not singletons)\n      * registered templates are not factories; the registered value is\n        returned directly.\n      * the router receives the application as its `namespace` property\n      * all controllers receive the router as their `target` and `controllers`\n        properties\n      * all controllers receive the application as their `namespace` property\n      * the application view receives the application controller as its\n        `controller` property\n      * the application view receives the application template as its\n        `defaultTemplate` property\n       @method buildRegistry\n      @static\n      @param {Application} namespace the application for which to\n        build the registry\n      @return {Ember.Registry} the built registry\n      @private\n    */\n    buildRegistry(namespace) {\n      var registry = new _container.Registry({\n        resolver: resolverFor(namespace)\n      });\n      registry.set = _metal.set;\n      registry.register('application:main', namespace, {\n        instantiate: false\n      });\n      commonSetupRegistry(registry);\n      (0, _glimmer.setupEngineRegistry)(registry);\n      return registry;\n    },\n\n    /**\n      Set this to provide an alternate class to `DefaultResolver`\n       @deprecated Use 'Resolver' instead\n      @property resolver\n      @public\n    */\n    resolver: null,\n\n    /**\n      Set this to provide an alternate class to `DefaultResolver`\n       @property resolver\n      @public\n    */\n    Resolver: null\n  });\n  /**\n    This function defines the default lookup rules for container lookups:\n  \n    * templates are looked up on `Ember.TEMPLATES`\n    * other names are looked up on the application after classifying the name.\n      For example, `controller:post` looks up `App.PostController` by default.\n    * if the default lookup fails, look for registered classes on the container\n  \n    This allows the application to register default injections in the container\n    that could be overridden by the normal naming convention.\n  \n    @private\n    @method resolverFor\n    @param {Ember.Namespace} namespace the namespace to look for classes\n    @return {*} the resolved value for a given lookup\n  */\n\n  function resolverFor(namespace) {\n    var ResolverClass = (0, _metal.get)(namespace, 'Resolver') || _globalsResolver.default;\n\n    var props = {\n      namespace\n    };\n    return ResolverClass.create(props);\n  }\n\n  function buildInitializerMethod(bucketName, humanName) {\n    return function (initializer) {\n      // If this is the first initializer being added to a subclass, we are going to reopen the class\n      // to make sure we have a new `initializers` object, which extends from the parent class' using\n      // prototypal inheritance. Without this, attempting to add initializers to the subclass would\n      // pollute the parent class as well as other subclasses.\n      if (this.superclass[bucketName] !== undefined && this.superclass[bucketName] === this[bucketName]) {\n        var attrs = {};\n        attrs[bucketName] = Object.create(this[bucketName]);\n        this.reopenClass(attrs);\n      }\n\n      (true && !(!this[bucketName][initializer.name]) && (0, _debug.assert)(\"The \" + humanName + \" '\" + initializer.name + \"' has already been registered\", !this[bucketName][initializer.name]));\n      (true && !((0, _utils.canInvoke)(initializer, 'initialize')) && (0, _debug.assert)(\"An \" + humanName + \" cannot be registered without an initialize function\", (0, _utils.canInvoke)(initializer, 'initialize')));\n      (true && !(initializer.name !== undefined) && (0, _debug.assert)(\"An \" + humanName + \" cannot be registered without a name property\", initializer.name !== undefined));\n      this[bucketName][initializer.name] = initializer;\n    };\n  }\n\n  function commonSetupRegistry(registry) {\n    registry.optionsForType('component', {\n      singleton: false\n    });\n    registry.optionsForType('view', {\n      singleton: false\n    });\n    registry.register('controller:basic', _controller.default, {\n      instantiate: false\n    });\n    registry.injection('view', '_viewRegistry', '-view-registry:main');\n    registry.injection('renderer', '_viewRegistry', '-view-registry:main');\n    registry.injection('route', '_topLevelViewTemplate', 'template:-outlet');\n    registry.injection('view:-outlet', 'namespace', 'application:main');\n    registry.injection('controller', 'target', 'router:main');\n    registry.injection('controller', 'namespace', 'application:main');\n    registry.injection('router', '_bucketCache', (0, _container.privatize)(_templateObject()));\n    registry.injection('route', '_bucketCache', (0, _container.privatize)(_templateObject2()));\n    registry.injection('route', '_router', 'router:main'); // Register the routing service...\n\n    registry.register('service:-routing', _routing.RoutingService); // Then inject the app router into it\n\n    registry.injection('service:-routing', 'router', 'router:main'); // DEBUGGING\n\n    registry.register('resolver-for-debugging:main', registry.resolver, {\n      instantiate: false\n    });\n    registry.injection('container-debug-adapter:main', 'resolver', 'resolver-for-debugging:main');\n    registry.injection('data-adapter:main', 'containerDebugAdapter', 'container-debug-adapter:main'); // Custom resolver authors may want to register their own ContainerDebugAdapter with this key\n\n    registry.register('container-debug-adapter:main', _extensionSupport.ContainerDebugAdapter);\n    registry.register('component-lookup:main', _views.ComponentLookup);\n  }\n\n  var _default = Engine;\n  _exports.default = _default;\n});","define(\"@ember/engine/instance\", [\"exports\", \"ember-babel\", \"@ember/-internals/utils\", \"@ember/-internals/runtime\", \"@ember/debug\", \"@ember/error\", \"@ember/-internals/container\", \"@ember/engine/lib/engine-parent\"], function (_exports, _emberBabel, _utils, _runtime, _debug, _error, _container, _engineParent) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  function _templateObject2() {\n    var data = (0, _emberBabel.taggedTemplateLiteralLoose)([\"template-compiler:main\"]);\n\n    _templateObject2 = function () {\n      return data;\n    };\n\n    return data;\n  }\n\n  function _templateObject() {\n    var data = (0, _emberBabel.taggedTemplateLiteralLoose)([\"-bucket-cache:main\"]);\n\n    _templateObject = function () {\n      return data;\n    };\n\n    return data;\n  }\n\n  /**\n    The `EngineInstance` encapsulates all of the stateful aspects of a\n    running `Engine`.\n  \n    @public\n    @class EngineInstance\n    @extends EmberObject\n    @uses RegistryProxyMixin\n    @uses ContainerProxyMixin\n  */\n  var EngineInstance = _runtime.Object.extend(_runtime.RegistryProxyMixin, _runtime.ContainerProxyMixin, {\n    /**\n      The base `Engine` for which this is an instance.\n       @property {Engine} engine\n      @private\n    */\n    base: null,\n\n    init() {\n      this._super(...arguments);\n\n      (0, _utils.guidFor)(this);\n      var base = this.base;\n\n      if (!base) {\n        base = this.application;\n        this.base = base;\n      } // Create a per-instance registry that will use the application's registry\n      // as a fallback for resolving registrations.\n\n\n      var registry = this.__registry__ = new _container.Registry({\n        fallback: base.__registry__\n      }); // Create a per-instance container from the instance's registry\n\n      this.__container__ = registry.container({\n        owner: this\n      });\n      this._booted = false;\n    },\n\n    /**\n      Initialize the `EngineInstance` and return a promise that resolves\n      with the instance itself when the boot process is complete.\n       The primary task here is to run any registered instance initializers.\n       See the documentation on `BootOptions` for the options it takes.\n       @public\n      @method boot\n      @param options {Object}\n      @return {Promise<EngineInstance,Error>}\n    */\n    boot(options) {\n      if (this._bootPromise) {\n        return this._bootPromise;\n      }\n\n      this._bootPromise = new _runtime.RSVP.Promise(resolve => resolve(this._bootSync(options)));\n      return this._bootPromise;\n    },\n\n    /**\n      Unfortunately, a lot of existing code assumes booting an instance is\n      synchronous – specifically, a lot of tests assume the last call to\n      `app.advanceReadiness()` or `app.reset()` will result in a new instance\n      being fully-booted when the current runloop completes.\n       We would like new code (like the `visit` API) to stop making this\n      assumption, so we created the asynchronous version above that returns a\n      promise. But until we have migrated all the code, we would have to expose\n      this method for use *internally* in places where we need to boot an instance\n      synchronously.\n       @private\n    */\n    _bootSync(options) {\n      if (this._booted) {\n        return this;\n      }\n\n      (true && !((0, _engineParent.getEngineParent)(this)) && (0, _debug.assert)(\"An engine instance's parent must be set via `setEngineParent(engine, parent)` prior to calling `engine.boot()`.\", (0, _engineParent.getEngineParent)(this)));\n      this.cloneParentDependencies();\n      this.setupRegistry(options);\n      this.base.runInstanceInitializers(this);\n      this._booted = true;\n      return this;\n    },\n\n    setupRegistry(options = this.__container__.lookup('-environment:main')) {\n      this.constructor.setupRegistry(this.__registry__, options);\n    },\n\n    /**\n     Unregister a factory.\n      Overrides `RegistryProxy#unregister` in order to clear any cached instances\n     of the unregistered factory.\n      @public\n     @method unregister\n     @param {String} fullName\n     */\n    unregister(fullName) {\n      this.__container__.reset(fullName);\n\n      this._super(...arguments);\n    },\n\n    /**\n      Build a new `EngineInstance` that's a child of this instance.\n       Engines must be registered by name with their parent engine\n      (or application).\n       @private\n      @method buildChildEngineInstance\n      @param name {String} the registered name of the engine.\n      @param options {Object} options provided to the engine instance.\n      @return {EngineInstance,Error}\n    */\n    buildChildEngineInstance(name, options = {}) {\n      var Engine = this.lookup(\"engine:\" + name);\n\n      if (!Engine) {\n        throw new _error.default(\"You attempted to mount the engine '\" + name + \"', but it is not registered with its parent.\");\n      }\n\n      var engineInstance = Engine.buildInstance(options);\n      (0, _engineParent.setEngineParent)(engineInstance, this);\n      return engineInstance;\n    },\n\n    /**\n      Clone dependencies shared between an engine instance and its parent.\n       @private\n      @method cloneParentDependencies\n    */\n    cloneParentDependencies() {\n      var parent = (0, _engineParent.getEngineParent)(this);\n      var registrations = ['route:basic', 'service:-routing', 'service:-glimmer-environment'];\n      registrations.forEach(key => this.register(key, parent.resolveRegistration(key)));\n      var env = parent.lookup('-environment:main');\n      this.register('-environment:main', env, {\n        instantiate: false\n      });\n      var singletons = ['router:main', (0, _container.privatize)(_templateObject()), '-view-registry:main', \"renderer:-\" + (env.isInteractive ? 'dom' : 'inert'), 'service:-document', (0, _container.privatize)(_templateObject2())];\n\n      if (env.isInteractive) {\n        singletons.push('event_dispatcher:main');\n      }\n\n      singletons.forEach(key => this.register(key, parent.lookup(key), {\n        instantiate: false\n      }));\n      this.inject('view', '_environment', '-environment:main');\n      this.inject('route', '_environment', '-environment:main');\n    }\n\n  });\n\n  EngineInstance.reopenClass({\n    /**\n     @private\n     @method setupRegistry\n     @param {Registry} registry\n     @param {BootOptions} options\n     */\n    setupRegistry(registry, options) {\n      // when no options/environment is present, do nothing\n      if (!options) {\n        return;\n      }\n\n      registry.injection('view', '_environment', '-environment:main');\n      registry.injection('route', '_environment', '-environment:main');\n\n      if (options.isInteractive) {\n        registry.injection('view', 'renderer', 'renderer:-dom');\n        registry.injection('component', 'renderer', 'renderer:-dom');\n      } else {\n        registry.injection('view', 'renderer', 'renderer:-inert');\n        registry.injection('component', 'renderer', 'renderer:-inert');\n      }\n    }\n\n  });\n  var _default = EngineInstance;\n  _exports.default = _default;\n});","define(\"@ember/engine/lib/engine-parent\", [\"exports\", \"@ember/-internals/utils\"], function (_exports, _utils) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.getEngineParent = getEngineParent;\n  _exports.setEngineParent = setEngineParent;\n\n  /**\n  @module @ember/engine\n  */\n  var ENGINE_PARENT = (0, _utils.symbol)('ENGINE_PARENT');\n  /**\n    `getEngineParent` retrieves an engine instance's parent instance.\n  \n    @method getEngineParent\n    @param {EngineInstance} engine An engine instance.\n    @return {EngineInstance} The parent engine instance.\n    @for @ember/engine\n    @static\n    @private\n  */\n\n  function getEngineParent(engine) {\n    return engine[ENGINE_PARENT];\n  }\n  /**\n    `setEngineParent` sets an engine instance's parent instance.\n  \n    @method setEngineParent\n    @param {EngineInstance} engine An engine instance.\n    @param {EngineInstance} parent The parent engine instance.\n    @private\n  */\n\n\n  function setEngineParent(engine, parent) {\n    engine[ENGINE_PARENT] = parent;\n  }\n});","define(\"@ember/error/index\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n   @module @ember/error\n  */\n\n  /**\n    The JavaScript Error object used by Ember.assert.\n  \n    @class Error\n    @namespace Ember\n    @extends Error\n    @constructor\n    @public\n  */\n  var _default = Error;\n  _exports.default = _default;\n});","define(\"@ember/instrumentation/index\", [\"exports\", \"@ember/-internals/environment\"], function (_exports, _environment) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.instrument = instrument;\n  _exports._instrumentStart = _instrumentStart;\n  _exports.subscribe = subscribe;\n  _exports.unsubscribe = unsubscribe;\n  _exports.reset = reset;\n  _exports.flaggedInstrument = _exports.subscribers = void 0;\n\n  /* eslint no-console:off */\n\n  /* global console */\n\n  /**\n  @module @ember/instrumentation\n  @private\n  */\n\n  /**\n    The purpose of the Ember Instrumentation module is\n    to provide efficient, general-purpose instrumentation\n    for Ember.\n  \n    Subscribe to a listener by using `subscribe`:\n  \n    ```javascript\n    import { subscribe } from '@ember/instrumentation';\n  \n    subscribe(\"render\", {\n      before(name, timestamp, payload) {\n  \n      },\n  \n      after(name, timestamp, payload) {\n  \n      }\n    });\n    ```\n  \n    If you return a value from the `before` callback, that same\n    value will be passed as a fourth parameter to the `after`\n    callback.\n  \n    Instrument a block of code by using `instrument`:\n  \n    ```javascript\n    import { instrument } from '@ember/instrumentation';\n  \n    instrument(\"render.handlebars\", payload, function() {\n      // rendering logic\n    }, binding);\n    ```\n  \n    Event names passed to `instrument` are namespaced\n    by periods, from more general to more specific. Subscribers\n    can listen for events by whatever level of granularity they\n    are interested in.\n  \n    In the above example, the event is `render.handlebars`,\n    and the subscriber listened for all events beginning with\n    `render`. It would receive callbacks for events named\n    `render`, `render.handlebars`, `render.container`, or\n    even `render.handlebars.layout`.\n  \n    @class Instrumentation\n    @static\n    @private\n  */\n  var subscribers = [];\n  _exports.subscribers = subscribers;\n  var cache = {};\n\n  function populateListeners(name) {\n    var listeners = [];\n    var subscriber;\n\n    for (var i = 0; i < subscribers.length; i++) {\n      subscriber = subscribers[i];\n\n      if (subscriber.regex.test(name)) {\n        listeners.push(subscriber.object);\n      }\n    }\n\n    cache[name] = listeners;\n    return listeners;\n  }\n\n  var time = (() => {\n    var perf = 'undefined' !== typeof window ? window.performance || {} : {};\n    var fn = perf.now || perf.mozNow || perf.webkitNow || perf.msNow || perf.oNow;\n    return fn ? fn.bind(perf) : Date.now;\n  })();\n\n  function isCallback(value) {\n    return typeof value === 'function';\n  }\n\n  function instrument(name, p1, p2, p3) {\n    var _payload;\n\n    var callback;\n    var binding;\n\n    if (arguments.length <= 3 && isCallback(p1)) {\n      callback = p1;\n      binding = p2;\n    } else {\n      _payload = p1;\n      callback = p2;\n      binding = p3;\n    } // fast path\n\n\n    if (subscribers.length === 0) {\n      return callback.call(binding);\n    } // avoid allocating the payload in fast path\n\n\n    var payload = _payload || {};\n\n    var finalizer = _instrumentStart(name, () => payload);\n\n    if (finalizer === NOOP) {\n      return callback.call(binding);\n    } else {\n      return withFinalizer(callback, finalizer, payload, binding);\n    }\n  }\n\n  var flaggedInstrument;\n  _exports.flaggedInstrument = flaggedInstrument;\n\n  if (false\n  /* EMBER_IMPROVED_INSTRUMENTATION */\n  ) {\n      _exports.flaggedInstrument = flaggedInstrument = instrument;\n    } else {\n    _exports.flaggedInstrument = flaggedInstrument = function instrument(_name, _payload, callback) {\n      return callback();\n    };\n  }\n\n  function withFinalizer(callback, finalizer, payload, binding) {\n    try {\n      return callback.call(binding);\n    } catch (e) {\n      payload.exception = e;\n      throw e;\n    } finally {\n      finalizer();\n    }\n  }\n\n  function NOOP() {}\n\n  function _instrumentStart(name, payloadFunc, payloadArg) {\n    if (subscribers.length === 0) {\n      return NOOP;\n    }\n\n    var listeners = cache[name];\n\n    if (!listeners) {\n      listeners = populateListeners(name);\n    }\n\n    if (listeners.length === 0) {\n      return NOOP;\n    }\n\n    var payload = payloadFunc(payloadArg);\n    var STRUCTURED_PROFILE = _environment.ENV.STRUCTURED_PROFILE;\n    var timeName;\n\n    if (STRUCTURED_PROFILE) {\n      timeName = name + \": \" + payload.object;\n      console.time(timeName);\n    }\n\n    var beforeValues = [];\n    var timestamp = time();\n\n    for (var i = 0; i < listeners.length; i++) {\n      var listener = listeners[i];\n      beforeValues.push(listener.before(name, timestamp, payload));\n    }\n\n    return function _instrumentEnd() {\n      var timestamp = time();\n\n      for (var _i = 0; _i < listeners.length; _i++) {\n        var _listener = listeners[_i];\n\n        if (typeof _listener.after === 'function') {\n          _listener.after(name, timestamp, payload, beforeValues[_i]);\n        }\n      }\n\n      if (STRUCTURED_PROFILE) {\n        console.timeEnd(timeName);\n      }\n    };\n  }\n  /**\n    Subscribes to a particular event or instrumented block of code.\n  \n    @method subscribe\n    @for @ember/instrumentation\n    @static\n  \n    @param {String} [pattern] Namespaced event name.\n    @param {Object} [object] Before and After hooks.\n  \n    @return {Subscriber}\n    @private\n  */\n\n\n  function subscribe(pattern, object) {\n    var paths = pattern.split('.');\n    var path;\n    var regexes = [];\n\n    for (var i = 0; i < paths.length; i++) {\n      path = paths[i];\n\n      if (path === '*') {\n        regexes.push('[^\\\\.]*');\n      } else {\n        regexes.push(path);\n      }\n    }\n\n    var regex = regexes.join('\\\\.');\n    regex = regex + \"(\\\\..*)?\";\n    var subscriber = {\n      pattern,\n      regex: new RegExp(\"^\" + regex + \"$\"),\n      object\n    };\n    subscribers.push(subscriber);\n    cache = {};\n    return subscriber;\n  }\n  /**\n    Unsubscribes from a particular event or instrumented block of code.\n  \n    @method unsubscribe\n    @for @ember/instrumentation\n    @static\n  \n    @param {Object} [subscriber]\n    @private\n  */\n\n\n  function unsubscribe(subscriber) {\n    var index = 0;\n\n    for (var i = 0; i < subscribers.length; i++) {\n      if (subscribers[i] === subscriber) {\n        index = i;\n      }\n    }\n\n    subscribers.splice(index, 1);\n    cache = {};\n  }\n  /**\n    Resets `Instrumentation` by flushing list of subscribers.\n  \n    @method reset\n    @for @ember/instrumentation\n    @static\n    @private\n  */\n\n\n  function reset() {\n    subscribers.length = 0;\n    cache = {};\n  }\n});","define(\"@ember/modifier/index\", [\"exports\", \"@ember/-internals/glimmer\"], function (_exports, _glimmer) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"setModifierManager\", {\n    enumerable: true,\n    get: function () {\n      return _glimmer.setModifierManager;\n    }\n  });\n  Object.defineProperty(_exports, \"capabilties\", {\n    enumerable: true,\n    get: function () {\n      return _glimmer.modifierCapabilities;\n    }\n  });\n});","define(\"@ember/object/compat\", [\"exports\", \"@ember/-internals/metal\", \"@ember/debug\", \"@glimmer/reference\"], function (_exports, _metal, _debug, _reference) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.dependentKeyCompat = dependentKeyCompat;\n\n  var wrapGetterSetter = function (_target, key, desc) {\n    var {\n      get: originalGet\n    } = desc;\n\n    if (originalGet !== undefined) {\n      desc.get = function () {\n        var propertyTag = (0, _metal.tagForProperty)(this, key);\n        var ret;\n        var tag = (0, _metal.track)(() => {\n          ret = originalGet.call(this);\n        });\n        (0, _reference.update)(propertyTag, tag);\n        (0, _metal.consume)(tag);\n        return ret;\n      };\n    }\n\n    return desc;\n  };\n\n  function dependentKeyCompat(target, key, desc) {\n    (true && !(Boolean(true\n    /* EMBER_METAL_TRACKED_PROPERTIES */\n    )) && (0, _debug.assert)('The dependentKeyCompat decorator can only be used if the tracked properties feature is enabled', Boolean(true)));\n\n    if (!(0, _metal.isElementDescriptor)([target, key, desc])) {\n      desc = target;\n\n      var decorator = function (target, key, _desc, _meta, isClassicDecorator) {\n        (true && !(isClassicDecorator) && (0, _debug.assert)('The @dependentKeyCompat decorator may only be passed a method when used in classic classes. You should decorate getters/setters directly in native classes', isClassicDecorator));\n        (true && !(desc !== null && typeof desc === 'object' && (typeof desc.get === 'function' || typeof desc.set === 'function')) && (0, _debug.assert)('The dependentKeyCompat() decorator must be passed a getter or setter when used in classic classes', desc !== null && typeof desc === 'object' && (typeof desc.get === 'function' || typeof desc.set === 'function')));\n        return wrapGetterSetter(target, key, desc);\n      };\n\n      (0, _metal.setClassicDecorator)(decorator);\n      return decorator;\n    }\n\n    (true && !(desc !== null && typeof desc.get === 'function' || typeof desc.set === 'function') && (0, _debug.assert)('The @dependentKeyCompat decorator must be applied to getters/setters when used in native classes', desc !== null && typeof desc.get === 'function' || typeof desc.set === 'function'));\n    return wrapGetterSetter(target, key, desc);\n  }\n\n  (0, _metal.setClassicDecorator)(dependentKeyCompat);\n});","define(\"@ember/object/computed\", [\"exports\", \"@ember/object/lib/computed/computed_macros\", \"@ember/object/lib/computed/reduce_computed_macros\"], function (_exports, _computed_macros, _reduce_computed_macros) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"empty\", {\n    enumerable: true,\n    get: function () {\n      return _computed_macros.empty;\n    }\n  });\n  Object.defineProperty(_exports, \"notEmpty\", {\n    enumerable: true,\n    get: function () {\n      return _computed_macros.notEmpty;\n    }\n  });\n  Object.defineProperty(_exports, \"none\", {\n    enumerable: true,\n    get: function () {\n      return _computed_macros.none;\n    }\n  });\n  Object.defineProperty(_exports, \"not\", {\n    enumerable: true,\n    get: function () {\n      return _computed_macros.not;\n    }\n  });\n  Object.defineProperty(_exports, \"bool\", {\n    enumerable: true,\n    get: function () {\n      return _computed_macros.bool;\n    }\n  });\n  Object.defineProperty(_exports, \"match\", {\n    enumerable: true,\n    get: function () {\n      return _computed_macros.match;\n    }\n  });\n  Object.defineProperty(_exports, \"equal\", {\n    enumerable: true,\n    get: function () {\n      return _computed_macros.equal;\n    }\n  });\n  Object.defineProperty(_exports, \"gt\", {\n    enumerable: true,\n    get: function () {\n      return _computed_macros.gt;\n    }\n  });\n  Object.defineProperty(_exports, \"gte\", {\n    enumerable: true,\n    get: function () {\n      return _computed_macros.gte;\n    }\n  });\n  Object.defineProperty(_exports, \"lt\", {\n    enumerable: true,\n    get: function () {\n      return _computed_macros.lt;\n    }\n  });\n  Object.defineProperty(_exports, \"lte\", {\n    enumerable: true,\n    get: function () {\n      return _computed_macros.lte;\n    }\n  });\n  Object.defineProperty(_exports, \"oneWay\", {\n    enumerable: true,\n    get: function () {\n      return _computed_macros.oneWay;\n    }\n  });\n  Object.defineProperty(_exports, \"readOnly\", {\n    enumerable: true,\n    get: function () {\n      return _computed_macros.readOnly;\n    }\n  });\n  Object.defineProperty(_exports, \"deprecatingAlias\", {\n    enumerable: true,\n    get: function () {\n      return _computed_macros.deprecatingAlias;\n    }\n  });\n  Object.defineProperty(_exports, \"and\", {\n    enumerable: true,\n    get: function () {\n      return _computed_macros.and;\n    }\n  });\n  Object.defineProperty(_exports, \"or\", {\n    enumerable: true,\n    get: function () {\n      return _computed_macros.or;\n    }\n  });\n  Object.defineProperty(_exports, \"sum\", {\n    enumerable: true,\n    get: function () {\n      return _reduce_computed_macros.sum;\n    }\n  });\n  Object.defineProperty(_exports, \"min\", {\n    enumerable: true,\n    get: function () {\n      return _reduce_computed_macros.min;\n    }\n  });\n  Object.defineProperty(_exports, \"max\", {\n    enumerable: true,\n    get: function () {\n      return _reduce_computed_macros.max;\n    }\n  });\n  Object.defineProperty(_exports, \"map\", {\n    enumerable: true,\n    get: function () {\n      return _reduce_computed_macros.map;\n    }\n  });\n  Object.defineProperty(_exports, \"sort\", {\n    enumerable: true,\n    get: function () {\n      return _reduce_computed_macros.sort;\n    }\n  });\n  Object.defineProperty(_exports, \"setDiff\", {\n    enumerable: true,\n    get: function () {\n      return _reduce_computed_macros.setDiff;\n    }\n  });\n  Object.defineProperty(_exports, \"mapBy\", {\n    enumerable: true,\n    get: function () {\n      return _reduce_computed_macros.mapBy;\n    }\n  });\n  Object.defineProperty(_exports, \"filter\", {\n    enumerable: true,\n    get: function () {\n      return _reduce_computed_macros.filter;\n    }\n  });\n  Object.defineProperty(_exports, \"filterBy\", {\n    enumerable: true,\n    get: function () {\n      return _reduce_computed_macros.filterBy;\n    }\n  });\n  Object.defineProperty(_exports, \"uniq\", {\n    enumerable: true,\n    get: function () {\n      return _reduce_computed_macros.uniq;\n    }\n  });\n  Object.defineProperty(_exports, \"uniqBy\", {\n    enumerable: true,\n    get: function () {\n      return _reduce_computed_macros.uniqBy;\n    }\n  });\n  Object.defineProperty(_exports, \"union\", {\n    enumerable: true,\n    get: function () {\n      return _reduce_computed_macros.union;\n    }\n  });\n  Object.defineProperty(_exports, \"intersect\", {\n    enumerable: true,\n    get: function () {\n      return _reduce_computed_macros.intersect;\n    }\n  });\n  Object.defineProperty(_exports, \"collect\", {\n    enumerable: true,\n    get: function () {\n      return _reduce_computed_macros.collect;\n    }\n  });\n});","define(\"@ember/object/index\", [\"exports\", \"@ember/debug\", \"@ember/polyfills\", \"@ember/-internals/metal\"], function (_exports, _debug, _polyfills, _metal) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.action = action;\n\n  /**\n    Decorator that turns the target function into an Action which can be accessed\n    directly by reference.\n  \n    ```js\n    import Component from '@ember/component';\n    import { action, set } from '@ember/object';\n  \n    export default class Tooltip extends Component {\n      @action\n      toggleShowing() {\n        set(this, 'isShowing', !this.isShowing);\n      }\n    }\n    ```\n    ```hbs\n    <!-- template.hbs -->\n    <button {{action this.toggleShowing}}>Show tooltip</button>\n  \n    {{#if isShowing}}\n      <div class=\"tooltip\">\n        I'm a tooltip!\n      </div>\n    {{/if}}\n    ```\n  \n    Decorated actions also interop with the string style template actions:\n  \n    ```hbs\n    <!-- template.hbs -->\n    <button {{action \"toggleShowing\"}}>Show tooltip</button>\n  \n    {{#if isShowing}}\n      <div class=\"tooltip\">\n        I'm a tooltip!\n      </div>\n    {{/if}}\n    ```\n  \n    It also binds the function directly to the instance, so it can be used in any\n    context and will correctly refer to the class it came from:\n  \n    ```hbs\n    <!-- template.hbs -->\n    <button\n      {{did-insert this.toggleShowing}}\n      {{on \"click\" this.toggleShowing}}\n    >\n      Show tooltip\n    </button>\n  \n    {{#if isShowing}}\n      <div class=\"tooltip\">\n        I'm a tooltip!\n      </div>\n    {{/if}}\n    ```\n  \n    This can also be used in JavaScript code directly:\n  \n    ```js\n    import Component from '@ember/component';\n    import { action, set } from '@ember/object';\n  \n    export default class Tooltip extends Component {\n      constructor() {\n        super(...arguments);\n  \n        // this.toggleShowing is still bound correctly when added to\n        // the event listener\n        document.addEventListener('click', this.toggleShowing);\n      }\n  \n      @action\n      toggleShowing() {\n        set(this, 'isShowing', !this.isShowing);\n      }\n    }\n    ```\n  \n    This is considered best practice, since it means that methods will be bound\n    correctly no matter where they are used. By contrast, the `{{action}}` helper\n    and modifier can also be used to bind context, but it will be required for\n    every usage of the method:\n  \n    ```hbs\n    <!-- template.hbs -->\n    <button\n      {{did-insert (action this.toggleShowing)}}\n      {{on \"click\" (action this.toggleShowing)}}\n    >\n      Show tooltip\n    </button>\n  \n    {{#if isShowing}}\n      <div class=\"tooltip\">\n        I'm a tooltip!\n      </div>\n    {{/if}}\n    ```\n  \n    They also do not have equivalents in JavaScript directly, so they cannot be\n    used for other situations where binding would be useful.\n  \n    @public\n    @method action\n    @for @ember/object\n    @static\n    @param {Function|undefined} callback The function to turn into an action,\n                                         when used in classic classes\n    @return {PropertyDecorator} property decorator instance\n  */\n  var BINDINGS_MAP = new WeakMap();\n\n  function setupAction(target, key, actionFn) {\n    if (target.constructor !== undefined && typeof target.constructor.proto === 'function') {\n      target.constructor.proto();\n    }\n\n    if (!target.hasOwnProperty('actions')) {\n      var parentActions = target.actions; // we need to assign because of the way mixins copy actions down when inheriting\n\n      target.actions = parentActions ? (0, _polyfills.assign)({}, parentActions) : {};\n    }\n\n    target.actions[key] = actionFn;\n    return {\n      get() {\n        var bindings = BINDINGS_MAP.get(this);\n\n        if (bindings === undefined) {\n          bindings = new Map();\n          BINDINGS_MAP.set(this, bindings);\n        }\n\n        var fn = bindings.get(actionFn);\n\n        if (fn === undefined) {\n          fn = actionFn.bind(this);\n          bindings.set(actionFn, fn);\n        }\n\n        return fn;\n      }\n\n    };\n  }\n\n  function action(target, key, desc) {\n    var actionFn;\n\n    if (!(0, _metal.isElementDescriptor)([target, key, desc])) {\n      actionFn = target;\n\n      var decorator = function (target, key, desc, meta, isClassicDecorator) {\n        (true && !(isClassicDecorator) && (0, _debug.assert)('The @action decorator may only be passed a method when used in classic classes. You should decorate methods directly in native classes', isClassicDecorator));\n        (true && !(typeof actionFn === 'function') && (0, _debug.assert)('The action() decorator must be passed a method when used in classic classes', typeof actionFn === 'function'));\n        return setupAction(target, key, actionFn);\n      };\n\n      (0, _metal.setClassicDecorator)(decorator);\n      return decorator;\n    }\n\n    actionFn = desc.value;\n    (true && !(typeof actionFn === 'function') && (0, _debug.assert)('The @action decorator must be applied to methods when used in native classes', typeof actionFn === 'function'));\n    return setupAction(target, key, actionFn);\n  }\n\n  (0, _metal.setClassicDecorator)(action);\n});","define(\"@ember/object/lib/computed/computed_macros\", [\"exports\", \"@ember/-internals/metal\", \"@ember/debug\"], function (_exports, _metal, _debug) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.empty = empty;\n  _exports.notEmpty = notEmpty;\n  _exports.none = none;\n  _exports.not = not;\n  _exports.bool = bool;\n  _exports.match = match;\n  _exports.equal = equal;\n  _exports.gt = gt;\n  _exports.gte = gte;\n  _exports.lt = lt;\n  _exports.lte = lte;\n  _exports.oneWay = oneWay;\n  _exports.readOnly = readOnly;\n  _exports.deprecatingAlias = deprecatingAlias;\n  _exports.or = _exports.and = void 0;\n\n  /**\n  @module @ember/object\n  */\n  function expandPropertiesToArray(predicateName, properties) {\n    var expandedProperties = [];\n\n    function extractProperty(entry) {\n      expandedProperties.push(entry);\n    }\n\n    for (var i = 0; i < properties.length; i++) {\n      var property = properties[i];\n      (true && !(property.indexOf(' ') < 0) && (0, _debug.assert)(\"Dependent keys passed to computed.\" + predicateName + \"() can't have spaces.\", property.indexOf(' ') < 0));\n      (0, _metal.expandProperties)(property, extractProperty);\n    }\n\n    return expandedProperties;\n  }\n\n  function generateComputedWithPredicate(name, predicate) {\n    return (...properties) => {\n      (true && !(!(0, _metal.isElementDescriptor)(properties)) && (0, _debug.assert)(\"You attempted to use @\" + name + \" as a decorator directly, but it requires at least one dependent key parameter\", !(0, _metal.isElementDescriptor)(properties)));\n      var dependentKeys = expandPropertiesToArray(name, properties);\n      var computedFunc = (0, _metal.computed)(...dependentKeys, function () {\n        var lastIdx = dependentKeys.length - 1;\n\n        for (var i = 0; i < lastIdx; i++) {\n          var value = (0, _metal.get)(this, dependentKeys[i]);\n\n          if (!predicate(value)) {\n            return value;\n          }\n        }\n\n        return (0, _metal.get)(this, dependentKeys[lastIdx]);\n      });\n      return computedFunc;\n    };\n  }\n  /**\n    A computed property macro that returns true if the value of the dependent\n    property is null, an empty string, empty array, or empty function.\n  \n    Example:\n  \n    ```javascript\n    import { set } from '@ember/object';\n    import { empty } from '@ember/object/computed';\n  \n    class ToDoList {\n      constructor(todos) {\n        set(this, 'todos', todos);\n      }\n  \n      @empty('todos') isDone;\n    }\n  \n    let todoList = new ToDoList(\n      ['Unit Test', 'Documentation', 'Release']\n    );\n  \n    todoList.isDone; // false\n    set(todoList, 'todos', []);\n    todoList.isDone; // true\n    ```\n  \n    Classic Class Example:\n  \n    ```javascript\n    import EmberObject, { set } from '@ember/object';\n    import { empty } from '@ember/object/computed';\n  \n    let ToDoList = EmberObject.extend({\n      isDone: empty('todos')\n    });\n  \n    let todoList = ToDoList.create({\n      todos: ['Unit Test', 'Documentation', 'Release']\n    });\n  \n    todoList.isDone; // false\n    set(todoList, 'todos', []);\n    todoList.isDone; // true\n    ```\n  \n    @since 1.6.0\n    @method empty\n    @static\n    @for @ember/object/computed\n    @param {String} dependentKey\n    @return {ComputedProperty} computed property which returns true if the value\n    of the dependent property is null, an empty string, empty array, or empty\n    function and false if the underlying value is not empty.\n  \n    @public\n  */\n\n\n  function empty(dependentKey) {\n    (true && !(!(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @empty as a decorator directly, but it requires a `dependentKey` parameter', !(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))));\n    return (0, _metal.computed)(dependentKey + \".length\", function () {\n      return (0, _metal.isEmpty)((0, _metal.get)(this, dependentKey));\n    });\n  }\n  /**\n    A computed property that returns true if the value of the dependent property\n    is NOT null, an empty string, empty array, or empty function.\n  \n    Example:\n  \n    ```javascript\n    import { set } from '@ember/object';\n    import { notEmpty } from '@ember/object/computed';\n  \n    class Hamster {\n      constructor(backpack) {\n        set(this, 'backpack', backpack);\n      }\n  \n      @notEmpty('backpack') hasStuff\n    }\n  \n    let hamster = new Hamster(\n      ['Food', 'Sleeping Bag', 'Tent']\n    );\n  \n    hamster.hasStuff; // true\n    set(hamster, 'backpack', []);\n    hamster.hasStuff; // false\n    ```\n  \n    Classic Class Example:\n  \n    ```javascript\n    import EmberObject, { set } from '@ember/object';\n    import { notEmpty } from '@ember/object/computed';\n  \n    let Hamster = EmberObject.extend({\n      hasStuff: notEmpty('backpack')\n    });\n  \n    let hamster = Hamster.create({\n      backpack: ['Food', 'Sleeping Bag', 'Tent']\n    });\n  \n    hamster.hasStuff; // true\n    set(hamster, 'backpack', []);\n    hamster.hasStuff; // false\n    ```\n  \n    @method notEmpty\n    @static\n    @for @ember/object/computed\n    @param {String} dependentKey\n    @return {ComputedProperty} computed property which returns true if original\n    value for property is not empty.\n    @public\n  */\n\n\n  function notEmpty(dependentKey) {\n    (true && !(!(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @notEmpty as a decorator directly, but it requires a `dependentKey` parameter', !(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))));\n    return (0, _metal.computed)(dependentKey + \".length\", function () {\n      return !(0, _metal.isEmpty)((0, _metal.get)(this, dependentKey));\n    });\n  }\n  /**\n    A computed property that returns true if the value of the dependent property\n    is null or undefined. This avoids errors from JSLint complaining about use of\n    ==, which can be technically confusing.\n  \n    ```javascript\n    import { set } from '@ember/object';\n    import { none } from '@ember/object/computed';\n  \n    class Hamster {\n      @none('food') isHungry;\n    }\n  \n    let hamster = new Hamster();\n  \n    hamster.isHungry; // true\n  \n    set(hamster, 'food', 'Banana');\n    hamster.isHungry; // false\n  \n    set(hamster, 'food', null);\n    hamster.isHungry; // true\n    ```\n  \n    Classic Class Example:\n  \n    ```javascript\n    import EmberObject, { set } from '@ember/object';\n    import { none } from '@ember/object/computed';\n  \n    let Hamster = EmberObject.extend({\n      isHungry: none('food')\n    });\n  \n    let hamster = Hamster.create();\n  \n    hamster.isHungry; // true\n  \n    set(hamster, 'food', 'Banana');\n    hamster.isHungry; // false\n  \n    set(hamster, 'food', null);\n    hamster.isHungry; // true\n    ```\n  \n    @method none\n    @static\n    @for @ember/object/computed\n    @param {String} dependentKey\n    @return {ComputedProperty} computed property which returns true if original\n    value for property is null or undefined.\n    @public\n  */\n\n\n  function none(dependentKey) {\n    (true && !(!(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @none as a decorator directly, but it requires a `dependentKey` parameter', !(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))));\n    return (0, _metal.computed)(dependentKey, function () {\n      return (0, _metal.isNone)((0, _metal.get)(this, dependentKey));\n    });\n  }\n  /**\n    A computed property that returns the inverse boolean value of the original\n    value for the dependent property.\n  \n    Example:\n  \n    ```javascript\n    import { set } from '@ember/object';\n    import { not } from '@ember/object/computed';\n  \n    class User {\n      loggedIn = false;\n  \n      @not('loggedIn') isAnonymous;\n    }\n  \n    let user = new User();\n  \n    user.isAnonymous; // true\n    set(user, 'loggedIn', true);\n    user.isAnonymous; // false\n    ```\n  \n    Classic Class Example:\n  \n    ```javascript\n    import EmberObject, { set } from '@ember/object';\n    import { not } from '@ember/object/computed';\n  \n    let User = EmberObject.extend({\n      loggedIn: false,\n  \n      isAnonymous: not('loggedIn')\n    });\n  \n    let user = User.create();\n  \n    user.isAnonymous; // true\n    set(user, 'loggedIn', true);\n    user.isAnonymous; // false\n    ```\n  \n    @method not\n    @static\n    @for @ember/object/computed\n    @param {String} dependentKey\n    @return {ComputedProperty} computed property which returns inverse of the\n    original value for property\n    @public\n  */\n\n\n  function not(dependentKey) {\n    (true && !(!(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @not as a decorator directly, but it requires a `dependentKey` parameter', !(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))));\n    return (0, _metal.computed)(dependentKey, function () {\n      return !(0, _metal.get)(this, dependentKey);\n    });\n  }\n  /**\n    A computed property that converts the provided dependent property into a\n    boolean value.\n  \n    Example:\n  \n    ```javascript\n    import { set } from '@ember/object';\n    import { bool } from '@ember/object/computed';\n  \n  \n    class Hamster {\n      @bool('numBananas') hasBananas\n    }\n  \n    let hamster = new Hamster();\n  \n    hamster.hasBananas; // false\n  \n    set(hamster, 'numBananas', 0);\n    hamster.hasBananas; // false\n  \n    set(hamster, 'numBananas', 1);\n    hamster.hasBananas; // true\n  \n    set(hamster, 'numBananas', null);\n    hamster.hasBananas; // false\n    ```\n  \n    Classic Class Example:\n  \n    ```javascript\n    import EmberObject, { set } from '@ember/object';\n    import { bool } from '@ember/object/computed';\n  \n  \n    let Hamster = EmberObject.extend({\n      hasBananas: bool('numBananas')\n    });\n  \n    let hamster = Hamster.create();\n  \n    hamster.hasBananas; // false\n  \n    set(hamster, 'numBananas', 0);\n    hamster.hasBananas; // false\n  \n    set(hamster, 'numBananas', 1);\n    hamster.hasBananas; // true\n  \n    set(hamster, 'numBananas', null);\n    hamster.hasBananas; // false\n    ```\n  \n    @method bool\n    @static\n    @for @ember/object/computed\n    @param {String} dependentKey\n    @return {ComputedProperty} computed property which converts to boolean the\n    original value for property\n    @public\n  */\n\n\n  function bool(dependentKey) {\n    (true && !(!(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @bool as a decorator directly, but it requires a `dependentKey` parameter', !(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))));\n    return (0, _metal.computed)(dependentKey, function () {\n      return Boolean((0, _metal.get)(this, dependentKey));\n    });\n  }\n  /**\n    A computed property which matches the original value for the dependent\n    property against a given RegExp, returning `true` if the value matches the\n    RegExp and `false` if it does not.\n  \n    Example:\n  \n    ```javascript\n    import { set } from '@ember/object';\n    import { match } from '@ember/object/computed';\n  \n    class User {\n      @match('email', /^.+@.+\\..+$/) hasValidEmail;\n    }\n  \n    let user = new User();\n  \n    user.hasValidEmail; // false\n  \n    set(user, 'email', '');\n    user.hasValidEmail; // false\n  \n    set(user, 'email', 'ember_hamster@example.com');\n    user.hasValidEmail; // true\n    ```\n  \n    Classic Class Example:\n  \n    ```javascript\n    import EmberObject, { set } from '@ember/object';\n    import { match } from '@ember/object/computed';\n  \n    let User = EmberObject.extend({\n      hasValidEmail: match('email', /^.+@.+\\..+$/)\n    });\n  \n    let user = User.create();\n  \n    user.hasValidEmail; // false\n  \n    set(user, 'email', '');\n    user.hasValidEmail; // false\n  \n    set(user, 'email', 'ember_hamster@example.com');\n    user.hasValidEmail; // true\n    ```\n  \n    @method match\n    @static\n    @for @ember/object/computed\n    @param {String} dependentKey\n    @param {RegExp} regexp\n    @return {ComputedProperty} computed property which match the original value\n    for property against a given RegExp\n    @public\n  */\n\n\n  function match(dependentKey, regexp) {\n    (true && !(!(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @match as a decorator directly, but it requires `dependentKey` and `regexp` parameters', !(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))));\n    return (0, _metal.computed)(dependentKey, function () {\n      var value = (0, _metal.get)(this, dependentKey);\n      return regexp.test(value);\n    });\n  }\n  /**\n    A computed property that returns true if the provided dependent property is\n    equal to the given value.\n  \n    Example:\n  \n    ```javascript\n    import { set } from '@ember/object';\n    import { equal } from '@ember/object/computed';\n  \n    class Hamster {\n      @equal('percentCarrotsEaten', 100) satisfied;\n    }\n  \n    let hamster = new Hamster();\n  \n    hamster.satisfied; // false\n  \n    set(hamster, 'percentCarrotsEaten', 100);\n    hamster.satisfied; // true\n  \n    set(hamster, 'percentCarrotsEaten', 50);\n    hamster.satisfied; // false\n    ```\n  \n    Classic Class Example:\n  \n    ```javascript\n    import EmberObject, { set } from '@ember/object';\n    import { equal } from '@ember/object/computed';\n  \n    let Hamster = EmberObject.extend({\n      satisfied: equal('percentCarrotsEaten', 100)\n    });\n  \n    let hamster = Hamster.create();\n  \n    hamster.satisfied; // false\n  \n    set(hamster, 'percentCarrotsEaten', 100);\n    hamster.satisfied; // true\n  \n    set(hamster, 'percentCarrotsEaten', 50);\n    hamster.satisfied; // false\n    ```\n  \n    @method equal\n    @static\n    @for @ember/object/computed\n    @param {String} dependentKey\n    @param {String|Number|Object} value\n    @return {ComputedProperty} computed property which returns true if the\n    original value for property is equal to the given value.\n    @public\n  */\n\n\n  function equal(dependentKey, value) {\n    (true && !(!(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @equal as a decorator directly, but it requires `dependentKey` and `value` parameter', !(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))));\n    return (0, _metal.computed)(dependentKey, function () {\n      return (0, _metal.get)(this, dependentKey) === value;\n    });\n  }\n  /**\n    A computed property that returns true if the provided dependent property is\n    greater than the provided value.\n  \n    Example:\n  \n    ```javascript\n    import { set } from '@ember/object';\n    import { gt } from '@ember/object/computed';\n  \n    class Hamster {\n      @gt('numBananas', 10) hasTooManyBananas;\n    }\n  \n    let hamster = new Hamster();\n  \n    hamster.hasTooManyBananas; // false\n  \n    set(hamster, 'numBananas', 3);\n    hamster.hasTooManyBananas; // false\n  \n    set(hamster, 'numBananas', 11);\n    hamster.hasTooManyBananas; // true\n    ```\n  \n    Classic Class Example:\n  \n    ```javascript\n    import EmberObject, { set } from '@ember/object';\n    import { gt } from '@ember/object/computed';\n  \n    let Hamster = EmberObject.extend({\n      hasTooManyBananas: gt('numBananas', 10)\n    });\n  \n    let hamster = Hamster.create();\n  \n    hamster.hasTooManyBananas; // false\n  \n    set(hamster, 'numBananas', 3);\n    hamster.hasTooManyBananas; // false\n  \n    set(hamster, 'numBananas', 11);\n    hamster.hasTooManyBananas; // true\n    ```\n  \n    @method gt\n    @static\n    @for @ember/object/computed\n    @param {String} dependentKey\n    @param {Number} value\n    @return {ComputedProperty} computed property which returns true if the\n    original value for property is greater than given value.\n    @public\n  */\n\n\n  function gt(dependentKey, value) {\n    (true && !(!(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @gt as a decorator directly, but it requires `dependentKey` and `value` parameters', !(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))));\n    return (0, _metal.computed)(dependentKey, function () {\n      return (0, _metal.get)(this, dependentKey) > value;\n    });\n  }\n  /**\n    A computed property that returns true if the provided dependent property is\n    greater than or equal to the provided value.\n  \n    Example:\n  \n    ```javascript\n    import { set } from '@ember/object';\n    import { gte } from '@ember/object/computed';\n  \n    class Hamster {\n      @gte('numBananas', 10) hasTooManyBananas;\n    }\n  \n    let hamster = new Hamster();\n  \n    hamster.hasTooManyBananas; // false\n  \n    set(hamster, 'numBananas', 3);\n    hamster.hasTooManyBananas; // false\n  \n    set(hamster, 'numBananas', 10);\n    hamster.hasTooManyBananas; // true\n    ```\n  \n    Classic Class Example:\n  \n    ```javascript\n    import EmberObject, { set } from '@ember/object';\n    import { gte } from '@ember/object/computed';\n  \n    let Hamster = EmberObject.extend({\n      hasTooManyBananas: gte('numBananas', 10)\n    });\n  \n    let hamster = Hamster.create();\n  \n    hamster.hasTooManyBananas; // false\n  \n    set(hamster, 'numBananas', 3);\n    hamster.hasTooManyBananas; // false\n  \n    set(hamster, 'numBananas', 10);\n    hamster.hasTooManyBananas; // true\n    ```\n  \n    @method gte\n    @static\n    @for @ember/object/computed\n    @param {String} dependentKey\n    @param {Number} value\n    @return {ComputedProperty} computed property which returns true if the\n    original value for property is greater or equal then given value.\n    @public\n  */\n\n\n  function gte(dependentKey, value) {\n    (true && !(!(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @gte as a decorator directly, but it requires `dependentKey` and `value` parameters', !(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))));\n    return (0, _metal.computed)(dependentKey, function () {\n      return (0, _metal.get)(this, dependentKey) >= value;\n    });\n  }\n  /**\n    A computed property that returns true if the provided dependent property is\n    less than the provided value.\n  \n    Example:\n  \n    ```javascript\n    import { set } from '@ember/object';\n    import { lt } from '@ember/object/computed';\n  \n    class Hamster {\n      @lt('numBananas', 3) needsMoreBananas;\n    }\n  \n    let hamster = new Hamster();\n  \n    hamster.needsMoreBananas; // true\n  \n    set(hamster, 'numBananas', 3);\n    hamster.needsMoreBananas; // false\n  \n    set(hamster, 'numBananas', 2);\n    hamster.needsMoreBananas; // true\n    ```\n  \n    Classic Class Example:\n  \n    ```javascript\n    import EmberObject, { set } from '@ember/object';\n    import { lt } from '@ember/object/computed';\n  \n    let Hamster = EmberObject.extend({\n      needsMoreBananas: lt('numBananas', 3)\n    });\n  \n    let hamster = Hamster.create();\n  \n    hamster.needsMoreBananas; // true\n  \n    set(hamster, 'numBananas', 3);\n    hamster.needsMoreBananas; // false\n  \n    set(hamster, 'numBananas', 2);\n    hamster.needsMoreBananas; // true\n    ```\n  \n    @method lt\n    @static\n    @for @ember/object/computed\n    @param {String} dependentKey\n    @param {Number} value\n    @return {ComputedProperty} computed property which returns true if the\n    original value for property is less then given value.\n    @public\n  */\n\n\n  function lt(dependentKey, value) {\n    (true && !(!(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @lt as a decorator directly, but it requires `dependentKey` and `value` parameters', !(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))));\n    return (0, _metal.computed)(dependentKey, function () {\n      return (0, _metal.get)(this, dependentKey) < value;\n    });\n  }\n  /**\n    A computed property that returns true if the provided dependent property is\n    less than or equal to the provided value.\n  \n    Example:\n  \n    ```javascript\n    import { set } from '@ember/object';\n    import { lte } from '@ember/object/computed';\n  \n    class Hamster {\n      @lte('numBananas', 3) needsMoreBananas;\n    }\n  \n    let hamster = new Hamster();\n  \n    hamster.needsMoreBananas; // true\n  \n    set(hamster, 'numBananas', 5);\n    hamster.needsMoreBananas; // false\n  \n    set(hamster, 'numBananas', 3);\n    hamster.needsMoreBananas; // true\n    ```\n  \n    Classic Class Example:\n  \n    ```javascript\n    import EmberObject, { set } from '@ember/object';\n    import { lte } from '@ember/object/computed';\n  \n    let Hamster = EmberObject.extend({\n      needsMoreBananas: lte('numBananas', 3)\n    });\n  \n    let hamster = Hamster.create();\n  \n    hamster.needsMoreBananas; // true\n  \n    set(hamster, 'numBananas', 5);\n    hamster.needsMoreBananas; // false\n  \n    set(hamster, 'numBananas', 3);\n    hamster.needsMoreBananas; // true\n    ```\n  \n    @method lte\n    @static\n    @for @ember/object/computed\n    @param {String} dependentKey\n    @param {Number} value\n    @return {ComputedProperty} computed property which returns true if the\n    original value for property is less or equal than given value.\n    @public\n  */\n\n\n  function lte(dependentKey, value) {\n    (true && !(!(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @lte as a decorator directly, but it requires `dependentKey` and `value` parameters', !(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))));\n    return (0, _metal.computed)(dependentKey, function () {\n      return (0, _metal.get)(this, dependentKey) <= value;\n    });\n  }\n  /**\n    A computed property that performs a logical `and` on the original values for\n    the provided dependent properties.\n  \n    You may pass in more than two properties and even use property brace\n    expansion.  The computed property will return the first falsy value or last\n    truthy value just like JavaScript's `&&` operator.\n  \n    Example:\n  \n    ```javascript\n    import { set } from '@ember/object';\n    import { and } from '@ember/object/computed';\n  \n    class Hamster {\n      @and('hasTent', 'hasBackpack') readyForCamp;\n      @and('hasWalkingStick', 'hasBackpack') readyForHike;\n    }\n  \n    let tomster = new Hamster();\n  \n    tomster.readyForCamp; // false\n  \n    set(tomster, 'hasTent', true);\n    tomster.readyForCamp; // false\n  \n    set(tomster, 'hasBackpack', true);\n    tomster.readyForCamp; // true\n  \n    set(tomster, 'hasBackpack', 'Yes');\n    tomster.readyForCamp; // 'Yes'\n  \n    set(tomster, 'hasWalkingStick', null);\n    tomster.readyForHike; // null\n    ```\n  \n    Classic Class Example:\n  \n    ```javascript\n    import EmberObject, { set } from '@ember/object';\n    import { and } from '@ember/object/computed';\n  \n    let Hamster = EmberObject.extend({\n      readyForCamp: and('hasTent', 'hasBackpack'),\n      readyForHike: and('hasWalkingStick', 'hasBackpack')\n    });\n  \n    let tomster = Hamster.create();\n  \n    tomster.readyForCamp; // false\n  \n    set(tomster, 'hasTent', true);\n    tomster.readyForCamp; // false\n  \n    set(tomster, 'hasBackpack', true);\n    tomster.readyForCamp; // true\n  \n    set(tomster, 'hasBackpack', 'Yes');\n    tomster.readyForCamp; // 'Yes'\n  \n    set(tomster, 'hasWalkingStick', null);\n    tomster.readyForHike; // null\n    ```\n  \n    @method and\n    @static\n    @for @ember/object/computed\n    @param {String} dependentKey*\n    @return {ComputedProperty} computed property which performs a logical `and` on\n    the values of all the original values for properties.\n    @public\n  */\n\n\n  var and = generateComputedWithPredicate('and', value => value);\n  /**\n    A computed property which performs a logical `or` on the original values for\n    the provided dependent properties.\n  \n    You may pass in more than two properties and even use property brace\n    expansion.  The computed property will return the first truthy value or last\n    falsy value just like JavaScript's `||` operator.\n  \n    Example:\n  \n    ```javascript\n    import { set } from '@ember/object';\n    import { or } from '@ember/object/computed';\n  \n    class Hamster {\n      @or('hasJacket', 'hasUmbrella') readyForRain;\n      @or('hasSunscreen', 'hasUmbrella') readyForBeach;\n    }\n  \n    let tomster = new Hamster();\n  \n    tomster.readyForRain; // undefined\n  \n    set(tomster, 'hasUmbrella', true);\n    tomster.readyForRain; // true\n  \n    set(tomster, 'hasJacket', 'Yes');\n    tomster.readyForRain; // 'Yes'\n  \n    set(tomster, 'hasSunscreen', 'Check');\n    tomster.readyForBeach; // 'Check'\n    ```\n  \n    Classic Class Example:\n  \n    ```javascript\n    import EmberObject, { set } from '@ember/object';\n    import { or } from '@ember/object/computed';\n  \n    let Hamster = EmberObject.extend({\n      readyForRain: or('hasJacket', 'hasUmbrella'),\n      readyForBeach: or('hasSunscreen', 'hasUmbrella')\n    });\n  \n    let tomster = Hamster.create();\n  \n    tomster.readyForRain; // undefined\n  \n    set(tomster, 'hasUmbrella', true);\n    tomster.readyForRain; // true\n  \n    set(tomster, 'hasJacket', 'Yes');\n    tomster.readyForRain; // 'Yes'\n  \n    set(tomster, 'hasSunscreen', 'Check');\n    tomster.readyForBeach; // 'Check'\n    ```\n  \n    @method or\n    @static\n    @for @ember/object/computed\n    @param {String} dependentKey*\n    @return {ComputedProperty} computed property which performs a logical `or` on\n    the values of all the original values for properties.\n    @public\n  */\n\n  _exports.and = and;\n  var or = generateComputedWithPredicate('or', value => !value);\n  /**\n    Creates a new property that is an alias for another property on an object.\n    Calls to `get` or `set` this property behave as though they were called on the\n    original property.\n  \n    Example:\n  \n    ```javascript\n    import { set } from '@ember/object';\n    import { alias } from '@ember/object/computed';\n  \n    class Person {\n      name = 'Alex Matchneer';\n  \n      @alias('name') nomen;\n    }\n  \n    let alex = new Person();\n  \n    alex.nomen; // 'Alex Matchneer'\n    alex.name;  // 'Alex Matchneer'\n  \n    set(alex, 'nomen', '@machty');\n    alex.name;  // '@machty'\n    ```\n  \n    Classic Class Example:\n  \n    ```javascript\n    import EmberObject, { set } from '@ember/object';\n    import { alias } from '@ember/object/computed';\n  \n    let Person = EmberObject.extend({\n      name: 'Alex Matchneer',\n  \n      nomen: alias('name')\n    });\n  \n    let alex = Person.create();\n  \n    alex.nomen; // 'Alex Matchneer'\n    alex.name;  // 'Alex Matchneer'\n  \n    set(alex, 'nomen', '@machty');\n    alex.name;  // '@machty'\n    ```\n  \n    @method alias\n    @static\n    @for @ember/object/computed\n    @param {String} dependentKey\n    @return {ComputedProperty} computed property which creates an alias to the\n    original value for property.\n    @public\n  */\n\n  /**\n    Where `computed.alias` aliases `get` and `set`, and allows for bidirectional\n    data flow, `computed.oneWay` only provides an aliased `get`. The `set` will\n    not mutate the upstream property, rather causes the current property to become\n    the value set. This causes the downstream property to permanently diverge from\n    the upstream property.\n  \n    Example:\n  \n    ```javascript\n    import { set } from '@ember/object';\n    import { oneWay }from '@ember/object/computed';\n  \n    class User {\n      constructor(firstName, lastName) {\n        set(this, 'firstName', firstName);\n        set(this, 'lastName', lastName);\n      }\n  \n      @oneWay('firstName') nickName;\n    }\n  \n    let teddy = new User('Teddy', 'Zeenny');\n  \n    teddy.nickName; // 'Teddy'\n  \n    set(teddy, 'nickName', 'TeddyBear');\n    teddy.firstName; // 'Teddy'\n    teddy.nickName; // 'TeddyBear'\n    ```\n  \n    Classic Class Example:\n  \n    ```javascript\n    import EmberObject, { set } from '@ember/object';\n    import { oneWay } from '@ember/object/computed';\n  \n    let User = EmberObject.extend({\n      firstName: null,\n      lastName: null,\n  \n      nickName: oneWay('firstName')\n    });\n  \n    let teddy = User.create({\n      firstName: 'Teddy',\n      lastName: 'Zeenny'\n    });\n  \n    teddy.nickName; // 'Teddy'\n  \n    set(teddy, 'nickName', 'TeddyBear'); // 'TeddyBear'\n    teddy.firstName; // 'Teddy'\n    teddy.nickName; // 'TeddyBear'\n    ```\n  \n    @method oneWay\n    @static\n    @for @ember/object/computed\n    @param {String} dependentKey\n    @return {ComputedProperty} computed property which creates a one way computed\n    property to the original value for property.\n    @public\n  */\n\n  _exports.or = or;\n\n  function oneWay(dependentKey) {\n    (true && !(!(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @oneWay as a decorator directly, but it requires a `dependentKey` parameter', !(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))));\n    return (0, _metal.alias)(dependentKey).oneWay();\n  }\n  /**\n    This is a more semantically meaningful alias of `computed.oneWay`, whose name\n    is somewhat ambiguous as to which direction the data flows.\n  \n    @method reads\n    @static\n    @for @ember/object/computed\n    @param {String} dependentKey\n    @return {ComputedProperty} computed property which creates a one way computed\n      property to the original value for property.\n    @public\n   */\n\n  /**\n    Where `computed.oneWay` provides oneWay bindings, `computed.readOnly` provides\n    a readOnly one way binding. Very often when using `computed.oneWay` one does\n    not also want changes to propagate back up, as they will replace the value.\n  \n    This prevents the reverse flow, and also throws an exception when it occurs.\n  \n    Example:\n  \n    ```javascript\n    import { set } from '@ember/object';\n    import { readOnly } from '@ember/object/computed';\n  \n    class User {\n      constructor(firstName, lastName) {\n        set(this, 'firstName', firstName);\n        set(this, 'lastName', lastName);\n      }\n  \n      @readOnly('firstName') nickName;\n    });\n  \n    let teddy = new User('Teddy', 'Zeenny');\n  \n    teddy.nickName; // 'Teddy'\n  \n    set(teddy, 'nickName', 'TeddyBear'); // throws Exception\n    // throw new EmberError('Cannot Set: nickName on: <User:ember27288>' );`\n  \n    teddy.firstName; // 'Teddy'\n    ```\n  \n    Classic Class Example:\n  \n    ```javascript\n    import EmberObject, { set } from '@ember/object';\n    import { readOnly } from '@ember/object/computed';\n  \n    let User = EmberObject.extend({\n      firstName: null,\n      lastName: null,\n  \n      nickName: readOnly('firstName')\n    });\n  \n    let teddy = User.create({\n      firstName: 'Teddy',\n      lastName:  'Zeenny'\n    });\n  \n    teddy.nickName; // 'Teddy'\n  \n    set(teddy, 'nickName', 'TeddyBear'); // throws Exception\n    // throw new EmberError('Cannot Set: nickName on: <User:ember27288>' );`\n  \n    teddy.firstName; // 'Teddy'\n    ```\n  \n    @method readOnly\n    @static\n    @for @ember/object/computed\n    @param {String} dependentKey\n    @return {ComputedProperty} computed property which creates a one way computed\n    property to the original value for property.\n    @since 1.5.0\n    @public\n  */\n\n\n  function readOnly(dependentKey) {\n    (true && !(!(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @readOnly as a decorator directly, but it requires a `dependentKey` parameter', !(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))));\n    return (0, _metal.alias)(dependentKey).readOnly();\n  }\n  /**\n    Creates a new property that is an alias for another property on an object.\n    Calls to `get` or `set` this property behave as though they were called on the\n    original property, but also print a deprecation warning.\n  \n    Example:\n  \n    ```javascript\n    import { set } from '@ember/object';\n    import { deprecatingAlias } from '@ember/object/computed';\n  \n    class Hamster {\n      @deprecatingAlias('cavendishCount', {\n        id: 'hamster.deprecate-banana',\n        until: '3.0.0'\n      })\n      bananaCount;\n    }\n  \n    let hamster = new Hamster();\n  \n    set(hamster, 'bananaCount', 5); // Prints a deprecation warning.\n    hamster.cavendishCount; // 5\n    ```\n  \n    Classic Class Example:\n  \n    ```javascript\n    import EmberObject, { set } from '@ember/object';\n    import { deprecatingAlias } from '@ember/object/computed';\n  \n    let Hamster = EmberObject.extend({\n      bananaCount: deprecatingAlias('cavendishCount', {\n        id: 'hamster.deprecate-banana',\n        until: '3.0.0'\n      })\n    });\n  \n    let hamster = Hamster.create();\n  \n    set(hamster, 'bananaCount', 5); // Prints a deprecation warning.\n    hamster.cavendishCount; // 5\n    ```\n  \n    @method deprecatingAlias\n    @static\n    @for @ember/object/computed\n    @param {String} dependentKey\n    @param {Object} options Options for `deprecate`.\n    @return {ComputedProperty} computed property which creates an alias with a\n    deprecation to the original value for property.\n    @since 1.7.0\n    @public\n  */\n\n\n  function deprecatingAlias(dependentKey, options) {\n    (true && !(!(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @deprecatingAlias as a decorator directly, but it requires `dependentKey` and `options` parameters', !(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))));\n    return (0, _metal.computed)(dependentKey, {\n      get(key) {\n        (true && !(false) && (0, _debug.deprecate)(\"Usage of `\" + key + \"` is deprecated, use `\" + dependentKey + \"` instead.\", false, options));\n        return (0, _metal.get)(this, dependentKey);\n      },\n\n      set(key, value) {\n        (true && !(false) && (0, _debug.deprecate)(\"Usage of `\" + key + \"` is deprecated, use `\" + dependentKey + \"` instead.\", false, options));\n        (0, _metal.set)(this, dependentKey, value);\n        return value;\n      }\n\n    });\n  }\n});","define(\"@ember/object/lib/computed/reduce_computed_macros\", [\"exports\", \"@ember/debug\", \"@ember/-internals/metal\", \"@ember/-internals/runtime\"], function (_exports, _debug, _metal, _runtime) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.sum = sum;\n  _exports.max = max;\n  _exports.min = min;\n  _exports.map = map;\n  _exports.mapBy = mapBy;\n  _exports.filter = filter;\n  _exports.filterBy = filterBy;\n  _exports.uniq = uniq;\n  _exports.uniqBy = uniqBy;\n  _exports.intersect = intersect;\n  _exports.setDiff = setDiff;\n  _exports.collect = collect;\n  _exports.sort = sort;\n  _exports.union = void 0;\n\n  /**\n  @module @ember/object\n  */\n  function reduceMacro(dependentKey, callback, initialValue, name) {\n    (true && !(!/[\\[\\]\\{\\}]/g.test(dependentKey)) && (0, _debug.assert)(\"Dependent key passed to `computed.\" + name + \"` shouldn't contain brace expanding pattern.\", !/[\\[\\]\\{\\}]/g.test(dependentKey)));\n    return (0, _metal.computed)(dependentKey + \".[]\", function () {\n      var arr = (0, _metal.get)(this, dependentKey);\n\n      if (arr === null || typeof arr !== 'object') {\n        return initialValue;\n      }\n\n      return arr.reduce(callback, initialValue, this);\n    }).readOnly();\n  }\n\n  function arrayMacro(dependentKey, additionalDependentKeys, callback) {\n    // This is a bit ugly\n    var propertyName;\n\n    if (/@each/.test(dependentKey)) {\n      propertyName = dependentKey.replace(/\\.@each.*$/, '');\n    } else {\n      propertyName = dependentKey;\n      dependentKey += '.[]';\n    }\n\n    return (0, _metal.computed)(dependentKey, ...additionalDependentKeys, function () {\n      var value = (0, _metal.get)(this, propertyName);\n\n      if ((0, _runtime.isArray)(value)) {\n        return (0, _runtime.A)(callback.call(this, value));\n      } else {\n        return (0, _runtime.A)();\n      }\n    }).readOnly();\n  }\n\n  function multiArrayMacro(_dependentKeys, callback, name) {\n    (true && !(_dependentKeys.every(dependentKey => !/[\\[\\]\\{\\}]/g.test(dependentKey))) && (0, _debug.assert)(\"Dependent keys passed to `computed.\" + name + \"` shouldn't contain brace expanding pattern.\", _dependentKeys.every(dependentKey => !/[\\[\\]\\{\\}]/g.test(dependentKey))));\n\n    var dependentKeys = _dependentKeys.map(key => key + \".[]\");\n\n    return (0, _metal.computed)(...dependentKeys, function () {\n      return (0, _runtime.A)(callback.call(this, _dependentKeys));\n    }).readOnly();\n  }\n  /**\n    A computed property that returns the sum of the values in the dependent array.\n  \n    Example:\n  \n    ```javascript\n    import { sum } from '@ember/object/computed';\n  \n    class Invoice {\n      lineItems = [1.00, 2.50, 9.99];\n  \n      @sum('lineItems') total;\n    }\n  \n    let invoice = new Invoice();\n  \n    invoice.total; // 13.49\n    ```\n  \n    Classic Class Example:\n  \n    ```javascript\n    import EmberObject from '@ember/object';\n    import { sum } from '@ember/object/computed';\n  \n    let Invoice = EmberObject.extend({\n      lineItems: [1.00, 2.50, 9.99],\n  \n      total: sum('lineItems')\n    })\n  \n    let invoice = Invoice.create();\n  \n    invoice.total; // 13.49\n    ```\n  \n    @method sum\n    @for @ember/object/computed\n    @static\n    @param {String} dependentKey\n    @return {ComputedProperty} computes the sum of all values in the\n    dependentKey's array\n    @since 1.4.0\n    @public\n  */\n\n\n  function sum(dependentKey) {\n    (true && !(!(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @sum as a decorator directly, but it requires a `dependentKey` parameter', !(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))));\n    return reduceMacro(dependentKey, (sum, item) => sum + item, 0, 'sum');\n  }\n  /**\n    A computed property that calculates the maximum value in the dependent array.\n    This will return `-Infinity` when the dependent array is empty.\n  \n    Example:\n  \n    ```javascript\n    import { set } from '@ember/object';\n    import { mapBy, max } from '@ember/object/computed';\n  \n    class Person {\n      children = [];\n  \n      @mapBy('children', 'age') childAges;\n      @max('childAges') maxChildAge;\n    }\n  \n    let lordByron = new Person();\n  \n    lordByron.maxChildAge; // -Infinity\n  \n    set(lordByron, 'children', [\n      {\n        name: 'Augusta Ada Byron',\n        age: 7\n      }\n    ]);\n    lordByron.maxChildAge; // 7\n  \n    set(lordByron, 'children', [\n      ...lordByron.children,\n      {\n        name: 'Allegra Byron',\n        age: 5\n      }, {\n        name: 'Elizabeth Medora Leigh',\n        age: 8\n      }\n    ]);\n    lordByron.maxChildAge; // 8\n    ```\n  \n    Classic Class Example:\n  \n    ```javascript\n    import EmberObject, { set } from '@ember/object';\n    import { mapBy, max } from '@ember/object/computed';\n  \n    let Person = EmberObject.extend({\n      childAges: mapBy('children', 'age'),\n      maxChildAge: max('childAges')\n    });\n  \n    let lordByron = Person.create({ children: [] });\n  \n    lordByron.maxChildAge; // -Infinity\n  \n    set(lordByron, 'children', [\n      {\n        name: 'Augusta Ada Byron',\n        age: 7\n      }\n    ]);\n    lordByron.maxChildAge; // 7\n  \n    set(lordByron, 'children', [\n      ...lordByron.children,\n      {\n        name: 'Allegra Byron',\n        age: 5\n      }, {\n        name: 'Elizabeth Medora Leigh',\n        age: 8\n      }\n    ]);\n    lordByron.maxChildAge; // 8\n    ```\n  \n    If the types of the arguments are not numbers, they will be converted to\n    numbers and the type of the return value will always be `Number`. For example,\n    the max of a list of Date objects will be the highest timestamp as a `Number`.\n    This behavior is consistent with `Math.max`.\n  \n    @method max\n    @for @ember/object/computed\n    @static\n    @param {String} dependentKey\n    @return {ComputedProperty} computes the largest value in the dependentKey's\n    array\n    @public\n  */\n\n\n  function max(dependentKey) {\n    (true && !(!(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @max as a decorator directly, but it requires a `dependentKey` parameter', !(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))));\n    return reduceMacro(dependentKey, (max, item) => Math.max(max, item), -Infinity, 'max');\n  }\n  /**\n    A computed property that calculates the minimum value in the dependent array.\n    This will return `Infinity` when the dependent array is empty.\n  \n    Example:\n  \n    ```javascript\n    import { set } from '@ember/object';\n    import { mapBy, min } from '@ember/object/computed';\n  \n    class Person {\n      children = [];\n  \n      @mapBy('children', 'age') childAges;\n      @min('childAges') minChildAge;\n    }\n  \n    let lordByron = Person.create({ children: [] });\n  \n    lordByron.minChildAge; // Infinity\n  \n    set(lordByron, 'children', [\n      {\n        name: 'Augusta Ada Byron',\n        age: 7\n      }\n    ]);\n    lordByron.minChildAge; // 7\n  \n    set(lordByron, 'children', [\n      ...lordByron.children,\n      {\n        name: 'Allegra Byron',\n        age: 5\n      }, {\n        name: 'Elizabeth Medora Leigh',\n        age: 8\n      }\n    ]);\n    lordByron.minChildAge; // 5\n    ```\n  \n    Classic Class Example:\n  \n    ```javascript\n    import EmberObject, { set } from '@ember/object';\n    import { mapBy, min } from '@ember/object/computed';\n  \n    let Person = EmberObject.extend({\n      childAges: mapBy('children', 'age'),\n      minChildAge: min('childAges')\n    });\n  \n    let lordByron = Person.create({ children: [] });\n  \n    lordByron.minChildAge; // Infinity\n  \n    set(lordByron, 'children', [\n      {\n        name: 'Augusta Ada Byron',\n        age: 7\n      }\n    ]);\n    lordByron.minChildAge; // 7\n  \n    set(lordByron, 'children', [\n      ...lordByron.children,\n      {\n        name: 'Allegra Byron',\n        age: 5\n      }, {\n        name: 'Elizabeth Medora Leigh',\n        age: 8\n      }\n    ]);\n    lordByron.minChildAge; // 5\n    ```\n  \n    If the types of the arguments are not numbers, they will be converted to\n    numbers and the type of the return value will always be `Number`. For example,\n    the min of a list of Date objects will be the lowest timestamp as a `Number`.\n    This behavior is consistent with `Math.min`.\n  \n    @method min\n    @for @ember/object/computed\n    @static\n    @param {String} dependentKey\n    @return {ComputedProperty} computes the smallest value in the dependentKey's array\n    @public\n  */\n\n\n  function min(dependentKey) {\n    (true && !(!(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @min as a decorator directly, but it requires a `dependentKey` parameter', !(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))));\n    return reduceMacro(dependentKey, (min, item) => Math.min(min, item), Infinity, 'min');\n  }\n  /**\n    Returns an array mapped via the callback\n  \n    The callback method you provide should have the following signature:\n    - `item` is the current item in the iteration.\n    - `index` is the integer index of the current item in the iteration.\n  \n    ```javascript\n    function mapCallback(item, index);\n    ```\n  \n    Example:\n  \n    ```javascript\n    import { set } from '@ember/object';\n    import { map } from '@ember/object/computed';\n  \n    class Hamster {\n      constructor(chores) {\n        set(this, 'chores', chores);\n      }\n  \n      @map('chores', function(chore, index) {\n        return `${chore.toUpperCase()}!`;\n      })\n      excitingChores;\n    });\n  \n    let hamster = new Hamster(['clean', 'write more unit tests']);\n  \n    hamster.excitingChores; // ['CLEAN!', 'WRITE MORE UNIT TESTS!']\n    ```\n  \n    Classic Class Example:\n  \n    ```javascript\n    import EmberObject from '@ember/object';\n    import { map } from '@ember/object/computed';\n  \n    let Hamster = EmberObject.extend({\n      excitingChores: map('chores', function(chore, index) {\n        return `${chore.toUpperCase()}!`;\n      })\n    });\n  \n    let hamster = Hamster.create({\n      chores: ['clean', 'write more unit tests']\n    });\n  \n    hamster.excitingChores; // ['CLEAN!', 'WRITE MORE UNIT TESTS!']\n    ```\n  \n    You can optionally pass an array of additional dependent keys as the second\n    parameter to the macro, if your map function relies on any external values:\n  \n    ```javascript\n    import { set } from '@ember/object';\n    import { map } from '@ember/object/computed';\n  \n    class Hamster {\n      shouldUpperCase = false;\n  \n      constructor(chores) {\n        set(this, 'chores', chores);\n      }\n  \n      @map('chores', ['shouldUpperCase'], function(chore, index) {\n        if (this.shouldUpperCase) {\n          return `${chore.toUpperCase()}!`;\n        } else {\n          return `${chore}!`;\n        }\n      })\n      excitingChores;\n    }\n  \n    let hamster = new Hamster(['clean', 'write more unit tests']);\n  \n    hamster.excitingChores; // ['clean!', 'write more unit tests!']\n  \n    set(hamster, 'shouldUpperCase', true);\n    hamster.excitingChores; // ['CLEAN!', 'WRITE MORE UNIT TESTS!']\n    ```\n  \n    @method map\n    @for @ember/object/computed\n    @static\n    @param {String} dependentKey\n    @param {Array} [additionalDependentKeys] optional array of additional\n    dependent keys\n    @param {Function} callback\n    @return {ComputedProperty} an array mapped via the callback\n    @public\n  */\n\n\n  function map(dependentKey, additionalDependentKeys, callback) {\n    (true && !(!(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @map as a decorator directly, but it requires atleast `dependentKey` and `callback` parameters', !(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))));\n\n    if (callback === undefined && typeof additionalDependentKeys === 'function') {\n      callback = additionalDependentKeys;\n      additionalDependentKeys = [];\n    }\n\n    (true && !(typeof callback === 'function') && (0, _debug.assert)('The final parameter provided to map must be a callback function', typeof callback === 'function'));\n    (true && !(Array.isArray(additionalDependentKeys)) && (0, _debug.assert)('The second parameter provided to map must either be the callback or an array of additional dependent keys', Array.isArray(additionalDependentKeys)));\n    return arrayMacro(dependentKey, additionalDependentKeys, function (value) {\n      return value.map(callback, this);\n    });\n  }\n  /**\n    Returns an array mapped to the specified key.\n  \n    Example:\n  \n    ```javascript\n    import { set } from '@ember/object';\n    import { mapBy } from '@ember/object/computed';\n  \n    class Person {\n      children = [];\n  \n      @mapBy('children', 'age') childAges;\n    }\n  \n    let lordByron = new Person();\n  \n    lordByron.childAges; // []\n  \n    set(lordByron, 'children', [\n      {\n        name: 'Augusta Ada Byron',\n        age: 7\n      }\n    ]);\n    lordByron.childAges; // [7]\n  \n    set(lordByron, 'children', [\n      ...lordByron.children,\n      {\n        name: 'Allegra Byron',\n        age: 5\n      }, {\n        name: 'Elizabeth Medora Leigh',\n        age: 8\n      }\n    ]);\n    lordByron.childAges; // [7, 5, 8]\n    ```\n  \n    Classic Class Example:\n  \n    ```javascript\n    import EmberObject, { set } from '@ember/object';\n    import { mapBy } from '@ember/object/computed';\n  \n    let Person = EmberObject.extend({\n      childAges: mapBy('children', 'age')\n    });\n  \n    let lordByron = Person.create({ children: [] });\n  \n    lordByron.childAges; // []\n  \n    set(lordByron, 'children', [\n      {\n        name: 'Augusta Ada Byron',\n        age: 7\n      }\n    ]);\n    lordByron.childAges; // [7]\n  \n    set(lordByron, 'children', [\n      ...lordByron.children,\n      {\n        name: 'Allegra Byron',\n        age: 5\n      }, {\n        name: 'Elizabeth Medora Leigh',\n        age: 8\n      }\n    ]);\n    lordByron.childAges; // [7, 5, 8]\n    ```\n  \n    @method mapBy\n    @for @ember/object/computed\n    @static\n    @param {String} dependentKey\n    @param {String} propertyKey\n    @return {ComputedProperty} an array mapped to the specified key\n    @public\n  */\n\n\n  function mapBy(dependentKey, propertyKey) {\n    (true && !(!(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @mapBy as a decorator directly, but it requires `dependentKey` and `propertyKey` parameters', !(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))));\n    (true && !(typeof propertyKey === 'string') && (0, _debug.assert)('`computed.mapBy` expects a property string for its second argument, ' + 'perhaps you meant to use \"map\"', typeof propertyKey === 'string'));\n    (true && !(!/[\\[\\]\\{\\}]/g.test(dependentKey)) && (0, _debug.assert)(\"Dependent key passed to `computed.mapBy` shouldn't contain brace expanding pattern.\", !/[\\[\\]\\{\\}]/g.test(dependentKey)));\n    return map(dependentKey + \".@each.\" + propertyKey, item => (0, _metal.get)(item, propertyKey));\n  }\n  /**\n    Filters the array by the callback.\n  \n    The callback method you provide should have the following signature:\n    - `item` is the current item in the iteration.\n    - `index` is the integer index of the current item in the iteration.\n    - `array` is the dependant array itself.\n  \n    ```javascript\n    function filterCallback(item, index, array);\n    ```\n  \n    Example:\n  \n    ```javascript\n    import { set } from '@ember/object';\n    import { filter } from '@ember/object/computed';\n  \n    class Hamster {\n      constructor(chores) {\n        set(this, 'chores', chores);\n      }\n  \n      @filter('chores', function(chore, index, array) {\n        return !chore.done;\n      })\n      remainingChores;\n    }\n  \n    let hamster = Hamster.create([\n      { name: 'cook', done: true },\n      { name: 'clean', done: true },\n      { name: 'write more unit tests', done: false }\n    ]);\n  \n    hamster.remainingChores; // [{name: 'write more unit tests', done: false}]\n    ```\n  \n    Classic Class Example:\n  \n    ```javascript\n    import EmberObject from '@ember/object';\n    import { filter } from '@ember/object/computed';\n  \n    let Hamster = EmberObject.extend({\n      remainingChores: filter('chores', function(chore, index, array) {\n        return !chore.done;\n      })\n    });\n  \n    let hamster = Hamster.create({\n      chores: [\n        { name: 'cook', done: true },\n        { name: 'clean', done: true },\n        { name: 'write more unit tests', done: false }\n      ]\n    });\n  \n    hamster.remainingChores; // [{name: 'write more unit tests', done: false}]\n    ```\n  \n    You can also use `@each.property` in your dependent key, the callback will\n    still use the underlying array:\n  \n    ```javascript\n    import { set } from '@ember/object';\n    import { filter } from '@ember/object/computed';\n  \n    class Hamster {\n      constructor(chores) {\n        set(this, 'chores', chores);\n      }\n  \n      @filter('chores.@each.done', function(chore, index, array) {\n        return !chore.done;\n      })\n      remainingChores;\n    }\n  \n    let hamster = new Hamster([\n      { name: 'cook', done: true },\n      { name: 'clean', done: true },\n      { name: 'write more unit tests', done: false }\n    ]);\n    hamster.remainingChores; // [{name: 'write more unit tests', done: false}]\n  \n    set(hamster.chores[2], 'done', true);\n    hamster.remainingChores; // []\n    ```\n  \n    Finally, you can optionally pass an array of additional dependent keys as the\n    second parameter to the macro, if your filter function relies on any external\n    values:\n  \n    ```javascript\n    import { filter } from '@ember/object/computed';\n  \n    class Hamster {\n      constructor(chores) {\n        set(this, 'chores', chores);\n      }\n  \n      doneKey = 'finished';\n  \n      @filter('chores', ['doneKey'], function(chore, index, array) {\n        return !chore[this.doneKey];\n      })\n      remainingChores;\n    }\n  \n    let hamster = new Hamster([\n      { name: 'cook', finished: true },\n      { name: 'clean', finished: true },\n      { name: 'write more unit tests', finished: false }\n    ]);\n  \n    hamster.remainingChores; // [{name: 'write more unit tests', finished: false}]\n    ```\n  \n    @method filter\n    @for @ember/object/computed\n    @static\n    @param {String} dependentKey\n    @param {Array} [additionalDependentKeys] optional array of additional dependent keys\n    @param {Function} callback\n    @return {ComputedProperty} the filtered array\n    @public\n  */\n\n\n  function filter(dependentKey, additionalDependentKeys, callback) {\n    (true && !(!(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @filter as a decorator directly, but it requires atleast `dependentKey` and `callback` parameters', !(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))));\n\n    if (callback === undefined && typeof additionalDependentKeys === 'function') {\n      callback = additionalDependentKeys;\n      additionalDependentKeys = [];\n    }\n\n    (true && !(typeof callback === 'function') && (0, _debug.assert)('The final parameter provided to filter must be a callback function', typeof callback === 'function'));\n    (true && !(Array.isArray(additionalDependentKeys)) && (0, _debug.assert)('The second parameter provided to filter must either be the callback or an array of additional dependent keys', Array.isArray(additionalDependentKeys)));\n    return arrayMacro(dependentKey, additionalDependentKeys, function (value) {\n      return value.filter(callback, this);\n    });\n  }\n  /**\n    Filters the array by the property and value.\n  \n    Example:\n  \n    ```javascript\n    import { set } from '@ember/object';\n    import { filterBy } from '@ember/object/computed';\n  \n    class Hamster {\n      constructor(chores) {\n        set(this, 'chores', chores);\n      }\n  \n      @filterBy('chores', 'done', false) remainingChores;\n    }\n  \n    let hamster = new Hamster([\n      { name: 'cook', done: true },\n      { name: 'clean', done: true },\n      { name: 'write more unit tests', done: false }\n    ]);\n  \n    hamster.remainingChores; // [{ name: 'write more unit tests', done: false }]\n    ```\n  \n    Classic Class Example:\n  \n    ```javascript\n    import EmberObject from '@ember/object';\n    import { filterBy } from '@ember/object/computed';\n  \n    let Hamster = EmberObject.extend({\n      remainingChores: filterBy('chores', 'done', false)\n    });\n  \n    let hamster = Hamster.create({\n      chores: [\n        { name: 'cook', done: true },\n        { name: 'clean', done: true },\n        { name: 'write more unit tests', done: false }\n      ]\n    });\n  \n    hamster.remainingChores; // [{ name: 'write more unit tests', done: false }]\n    ```\n  \n    @method filterBy\n    @for @ember/object/computed\n    @static\n    @param {String} dependentKey\n    @param {String} propertyKey\n    @param {*} value\n    @return {ComputedProperty} the filtered array\n    @public\n  */\n\n\n  function filterBy(dependentKey, propertyKey, value) {\n    (true && !(!(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @filterBy as a decorator directly, but it requires atleast `dependentKey` and `propertyKey` parameters', !(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))));\n    (true && !(!/[\\[\\]\\{\\}]/g.test(dependentKey)) && (0, _debug.assert)(\"Dependent key passed to `computed.filterBy` shouldn't contain brace expanding pattern.\", !/[\\[\\]\\{\\}]/g.test(dependentKey)));\n    var callback;\n\n    if (arguments.length === 2) {\n      callback = item => (0, _metal.get)(item, propertyKey);\n    } else {\n      callback = item => (0, _metal.get)(item, propertyKey) === value;\n    }\n\n    return filter(dependentKey + \".@each.\" + propertyKey, callback);\n  }\n  /**\n    A computed property which returns a new array with all the unique elements\n    from one or more dependent arrays.\n  \n    Example:\n  \n    ```javascript\n    import { set } from '@ember/object';\n    import { uniq } from '@ember/object/computed';\n  \n    class Hamster {\n      constructor(fruits) {\n        set(this, 'fruits', fruits);\n      }\n  \n      @uniq('fruits') uniqueFruits;\n    }\n  \n    let hamster = new Hamster([\n      'banana',\n      'grape',\n      'kale',\n      'banana'\n    ]);\n  \n    hamster.uniqueFruits; // ['banana', 'grape', 'kale']\n    ```\n  \n    Classic Class Example:\n  \n    ```javascript\n    import EmberObject from '@ember/object';\n    import { uniq } from '@ember/object/computed';\n  \n    let Hamster = EmberObject.extend({\n      uniqueFruits: uniq('fruits')\n    });\n  \n    let hamster = Hamster.create({\n      fruits: [\n        'banana',\n        'grape',\n        'kale',\n        'banana'\n      ]\n    });\n  \n    hamster.uniqueFruits; // ['banana', 'grape', 'kale']\n    ```\n  \n    @method uniq\n    @for @ember/object/computed\n    @static\n    @param {String} propertyKey*\n    @return {ComputedProperty} computes a new array with all the\n    unique elements from the dependent array\n    @public\n  */\n\n\n  function uniq(...args) {\n    (true && !(!(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @uniq/@union as a decorator directly, but it requires atleast one dependent key parameter', !(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))));\n    return multiArrayMacro(args, function (dependentKeys) {\n      var uniq = (0, _runtime.A)();\n      var seen = new Set();\n      dependentKeys.forEach(dependentKey => {\n        var value = (0, _metal.get)(this, dependentKey);\n\n        if ((0, _runtime.isArray)(value)) {\n          value.forEach(item => {\n            if (!seen.has(item)) {\n              seen.add(item);\n              uniq.push(item);\n            }\n          });\n        }\n      });\n      return uniq;\n    }, 'uniq');\n  }\n  /**\n    A computed property which returns a new array with all the unique elements\n    from an array, with uniqueness determined by specific key.\n  \n    Example:\n  \n    ```javascript\n    import { set } from '@ember/object';\n    import { uniqBy } from '@ember/object/computed';\n  \n    class Hamster {\n      constructor(fruits) {\n        set(this, 'fruits', fruits);\n      }\n  \n      @uniqBy('fruits', 'id') uniqueFruits;\n    }\n  \n    let hamster = new Hamster([\n      { id: 1, 'banana' },\n      { id: 2, 'grape' },\n      { id: 3, 'peach' },\n      { id: 1, 'banana' }\n    ]);\n  \n    hamster.uniqueFruits; // [ { id: 1, 'banana' }, { id: 2, 'grape' }, { id: 3, 'peach' }]\n    ```\n  \n    Classic Class Example:\n  \n    ```javascript\n    import EmberObject from '@ember/object';\n    import { uniqBy } from '@ember/object/computed';\n  \n    let Hamster = EmberObject.extend({\n      uniqueFruits: uniqBy('fruits', 'id')\n    });\n  \n    let hamster = Hamster.create({\n      fruits: [\n        { id: 1, 'banana' },\n        { id: 2, 'grape' },\n        { id: 3, 'peach' },\n        { id: 1, 'banana' }\n      ]\n    });\n  \n    hamster.uniqueFruits; // [ { id: 1, 'banana' }, { id: 2, 'grape' }, { id: 3, 'peach' }]\n    ```\n  \n    @method uniqBy\n    @for @ember/object/computed\n    @static\n    @param {String} dependentKey\n    @param {String} propertyKey\n    @return {ComputedProperty} computes a new array with all the\n    unique elements from the dependent array\n    @public\n  */\n\n\n  function uniqBy(dependentKey, propertyKey) {\n    (true && !(!(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @uniqBy as a decorator directly, but it requires `dependentKey` and `propertyKey` parameters', !(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))));\n    (true && !(!/[\\[\\]\\{\\}]/g.test(dependentKey)) && (0, _debug.assert)(\"Dependent key passed to `computed.uniqBy` shouldn't contain brace expanding pattern.\", !/[\\[\\]\\{\\}]/g.test(dependentKey)));\n    return (0, _metal.computed)(dependentKey + \".[]\", function () {\n      var list = (0, _metal.get)(this, dependentKey);\n      return (0, _runtime.isArray)(list) ? (0, _runtime.uniqBy)(list, propertyKey) : (0, _runtime.A)();\n    }).readOnly();\n  }\n  /**\n    A computed property which returns a new array with all the unique elements\n    from one or more dependent arrays.\n  \n    Example:\n  \n    ```javascript\n    import { set } from '@ember/object';\n    import { union } from '@ember/object/computed';\n  \n    class Hamster {\n      constructor(fruits, vegetables) {\n        set(this, 'fruits', fruits);\n        set(this, 'vegetables', vegetables);\n      }\n  \n      @union('fruits', 'vegetables') ediblePlants;\n    });\n  \n    let hamster = new, Hamster(\n      [\n        'banana',\n        'grape',\n        'kale',\n        'banana',\n        'tomato'\n      ],\n      [\n        'tomato',\n        'carrot',\n        'lettuce'\n      ]\n    );\n  \n    hamster.uniqueFruits; // ['banana', 'grape', 'kale', 'tomato', 'carrot', 'lettuce']\n    ```\n  \n    Classic Class Example:\n  \n    ```javascript\n    import EmberObject from '@ember/object';\n    import { union } from '@ember/object/computed';\n  \n    let Hamster = EmberObject.extend({\n      uniqueFruits: union('fruits', 'vegetables')\n    });\n  \n    let hamster = Hamster.create({\n      fruits: [\n        'banana',\n        'grape',\n        'kale',\n        'banana',\n        'tomato'\n      ],\n      vegetables: [\n        'tomato',\n        'carrot',\n        'lettuce'\n      ]\n    });\n  \n    hamster.uniqueFruits; // ['banana', 'grape', 'kale', 'tomato', 'carrot', 'lettuce']\n    ```\n  \n    @method union\n    @for @ember/object/computed\n    @static\n    @param {String} propertyKey*\n    @return {ComputedProperty} computes a new array with all the unique elements\n    from one or more dependent arrays.\n    @public\n  */\n\n\n  var union = uniq;\n  /**\n    A computed property which returns a new array with all the elements\n    two or more dependent arrays have in common.\n  \n    Example:\n  \n    ```javascript\n    import { set } from '@ember/object';\n    import { intersect } from '@ember/object/computed';\n  \n    class FriendGroups {\n      constructor(adaFriends, charlesFriends) {\n        set(this, 'adaFriends', adaFriends);\n        set(this, 'charlesFriends', charlesFriends);\n      }\n  \n      @intersect('adaFriends', 'charlesFriends') friendsInCommon;\n    }\n  \n    let groups = new FriendGroups(\n      ['Charles Babbage', 'John Hobhouse', 'William King', 'Mary Somerville'],\n      ['William King', 'Mary Somerville', 'Ada Lovelace', 'George Peacock']\n    );\n  \n    groups.friendsInCommon; // ['William King', 'Mary Somerville']\n    ```\n  \n    Classic Class Example:\n  \n    ```javascript\n    import EmberObject from '@ember/object';\n    import { intersect } from '@ember/object/computed';\n  \n    let FriendGroups = EmberObject.extend({\n      friendsInCommon: intersect('adaFriends', 'charlesFriends')\n    });\n  \n    let groups = FriendGroups.create({\n      adaFriends: ['Charles Babbage', 'John Hobhouse', 'William King', 'Mary Somerville'],\n      charlesFriends: ['William King', 'Mary Somerville', 'Ada Lovelace', 'George Peacock']\n    });\n  \n    groups.friendsInCommon; // ['William King', 'Mary Somerville']\n    ```\n  \n    @method intersect\n    @for @ember/object/computed\n    @static\n    @param {String} propertyKey*\n    @return {ComputedProperty} computes a new array with all the duplicated\n    elements from the dependent arrays\n    @public\n  */\n\n  _exports.union = union;\n\n  function intersect(...args) {\n    (true && !(!(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @intersect as a decorator directly, but it requires atleast one dependent key parameter', !(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))));\n    return multiArrayMacro(args, function (dependentKeys) {\n      var arrays = dependentKeys.map(dependentKey => {\n        var array = (0, _metal.get)(this, dependentKey);\n        return (0, _runtime.isArray)(array) ? array : [];\n      });\n      var results = arrays.pop().filter(candidate => {\n        for (var i = 0; i < arrays.length; i++) {\n          var found = false;\n          var array = arrays[i];\n\n          for (var j = 0; j < array.length; j++) {\n            if (array[j] === candidate) {\n              found = true;\n              break;\n            }\n          }\n\n          if (found === false) {\n            return false;\n          }\n        }\n\n        return true;\n      });\n      return (0, _runtime.A)(results);\n    }, 'intersect');\n  }\n  /**\n    A computed property which returns a new array with all the properties from the\n    first dependent array that are not in the second dependent array.\n  \n    Example:\n  \n    ```javascript\n    import { set } from '@ember/object';\n    import { setDiff } from '@ember/object/computed';\n  \n    class Hamster {\n      constructor(likes, fruits) {\n        set(this, 'likes', likes);\n        set(this, 'fruits', fruits);\n      }\n  \n      @setDiff('likes', 'fruits') wants;\n    }\n  \n    let hamster = new Hamster(\n      [\n        'banana',\n        'grape',\n        'kale'\n      ],\n      [\n        'grape',\n        'kale',\n      ]\n    );\n  \n    hamster.wants; // ['banana']\n    ```\n  \n    Classic Class Example:\n  \n    ```javascript\n    import EmberObject from '@ember/object';\n    import { setDiff } from '@ember/object/computed';\n  \n    let Hamster = EmberObject.extend({\n      wants: setDiff('likes', 'fruits')\n    });\n  \n    let hamster = Hamster.create({\n      likes: [\n        'banana',\n        'grape',\n        'kale'\n      ],\n      fruits: [\n        'grape',\n        'kale',\n      ]\n    });\n  \n    hamster.wants; // ['banana']\n    ```\n  \n    @method setDiff\n    @for @ember/object/computed\n    @static\n    @param {String} setAProperty\n    @param {String} setBProperty\n    @return {ComputedProperty} computes a new array with all the items from the\n    first dependent array that are not in the second dependent array\n    @public\n  */\n\n\n  function setDiff(setAProperty, setBProperty) {\n    (true && !(!(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @setDiff as a decorator directly, but it requires atleast one dependent key parameter', !(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))));\n    (true && !(arguments.length === 2) && (0, _debug.assert)('`computed.setDiff` requires exactly two dependent arrays.', arguments.length === 2));\n    (true && !(!/[\\[\\]\\{\\}]/g.test(setAProperty) && !/[\\[\\]\\{\\}]/g.test(setBProperty)) && (0, _debug.assert)(\"Dependent keys passed to `computed.setDiff` shouldn't contain brace expanding pattern.\", !/[\\[\\]\\{\\}]/g.test(setAProperty) && !/[\\[\\]\\{\\}]/g.test(setBProperty)));\n    return (0, _metal.computed)(setAProperty + \".[]\", setBProperty + \".[]\", function () {\n      var setA = this.get(setAProperty);\n      var setB = this.get(setBProperty);\n\n      if (!(0, _runtime.isArray)(setA)) {\n        return (0, _runtime.A)();\n      }\n\n      if (!(0, _runtime.isArray)(setB)) {\n        return (0, _runtime.A)(setA);\n      }\n\n      return setA.filter(x => setB.indexOf(x) === -1);\n    }).readOnly();\n  }\n  /**\n    A computed property that returns the array of values for the provided\n    dependent properties.\n  \n    Example:\n  \n    ```javascript\n    import { set } from '@ember/object';\n    import { collect } from '@ember/object/computed';\n  \n    class Hamster {\n      @collect('hat', 'shirt') clothes;\n    }\n  \n    let hamster = new Hamster();\n  \n    hamster.clothes; // [null, null]\n  \n    set(hamster, 'hat', 'Camp Hat');\n    set(hamster, 'shirt', 'Camp Shirt');\n    hamster.clothes; // ['Camp Hat', 'Camp Shirt']\n    ```\n  \n    Classic Class Example:\n  \n    ```javascript\n    import EmberObject, { set } from '@ember/object';\n    import { collect } from '@ember/object/computed';\n  \n    let Hamster = EmberObject.extend({\n      clothes: collect('hat', 'shirt')\n    });\n  \n    let hamster = Hamster.create();\n  \n    hamster.clothes; // [null, null]\n  \n    set(hamster, 'hat', 'Camp Hat');\n    set(hamster, 'shirt', 'Camp Shirt');\n    hamster.clothes; // ['Camp Hat', 'Camp Shirt']\n    ```\n  \n    @method collect\n    @for @ember/object/computed\n    @static\n    @param {String} dependentKey*\n    @return {ComputedProperty} computed property which maps values of all passed\n    in properties to an array.\n    @public\n  */\n\n\n  function collect(...dependentKeys) {\n    (true && !(!(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @collect as a decorator directly, but it requires atleast one dependent key parameter', !(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))));\n    return multiArrayMacro(dependentKeys, function () {\n      var res = dependentKeys.map(key => {\n        var val = (0, _metal.get)(this, key);\n        return val === undefined ? null : val;\n      });\n      return (0, _runtime.A)(res);\n    }, 'collect');\n  }\n  /**\n    A computed property which returns a new array with all the properties from the\n    first dependent array sorted based on a property or sort function. The sort\n    macro can be used in two different ways:\n  \n    1. By providing a sort callback function\n    2. By providing an array of keys to sort the array\n  \n    In the first form, the callback method you provide should have the following\n    signature:\n  \n    ```javascript\n    function sortCallback(itemA, itemB);\n    ```\n  \n    - `itemA` the first item to compare.\n    - `itemB` the second item to compare.\n  \n    This function should return negative number (e.g. `-1`) when `itemA` should\n    come before `itemB`. It should return positive number (e.g. `1`) when `itemA`\n    should come after `itemB`. If the `itemA` and `itemB` are equal this function\n    should return `0`.\n  \n    Therefore, if this function is comparing some numeric values, simple `itemA -\n    itemB` or `itemA.get( 'foo' ) - itemB.get( 'foo' )` can be used instead of\n    series of `if`.\n  \n    Example:\n  \n    ```javascript\n    import { set } from '@ember/object';\n    import { sort } from '@ember/object/computed';\n  \n    class ToDoList {\n      constructor(todos) {\n        set(this, 'todos', todos);\n      }\n  \n      // using a custom sort function\n      @sort('todos', function(a, b){\n        if (a.priority > b.priority) {\n          return 1;\n        } else if (a.priority < b.priority) {\n          return -1;\n        }\n  \n        return 0;\n      })\n      priorityTodos;\n    }\n  \n    let todoList = new ToDoList([\n      { name: 'Unit Test', priority: 2 },\n      { name: 'Documentation', priority: 3 },\n      { name: 'Release', priority: 1 }\n    ]);\n  \n    todoList.priorityTodos; // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }]\n    ```\n  \n    Classic Class Example:\n  \n    ```javascript\n    import EmberObject from '@ember/object';\n    import { sort } from '@ember/object/computed';\n  \n    let ToDoList = EmberObject.extend({\n      // using a custom sort function\n      priorityTodos: sort('todos', function(a, b){\n        if (a.priority > b.priority) {\n          return 1;\n        } else if (a.priority < b.priority) {\n          return -1;\n        }\n  \n        return 0;\n      })\n    });\n  \n    let todoList = ToDoList.create({\n      todos: [\n        { name: 'Unit Test', priority: 2 },\n        { name: 'Documentation', priority: 3 },\n        { name: 'Release', priority: 1 }\n      ]\n    });\n  \n    todoList.priorityTodos; // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }]\n    ```\n  \n    You can also optionally pass an array of additional dependent keys as the\n    second parameter, if your sort function is dependent on additional values that\n    could changes:\n  \n    ```js\n    import EmberObject, { set } from '@ember/object';\n    import { sort } from '@ember/object/computed';\n  \n    class ToDoList {\n      sortKey = 'priority';\n  \n      constructor(todos) {\n        set(this, 'todos', todos);\n      }\n  \n      // using a custom sort function\n      @sort('todos', ['sortKey'], function(a, b){\n        if (a[this.sortKey] > b[this.sortKey]) {\n          return 1;\n        } else if (a[this.sortKey] < b[this.sortKey]) {\n          return -1;\n        }\n  \n        return 0;\n      })\n      sortedTodos;\n    });\n  \n    let todoList = new ToDoList([\n      { name: 'Unit Test', priority: 2 },\n      { name: 'Documentation', priority: 3 },\n      { name: 'Release', priority: 1 }\n    ]);\n  \n    todoList.priorityTodos; // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }]\n    ```\n  \n    In the second form, you should provide the key of the array of sort values as\n    the second parameter:\n  \n    ```javascript\n    import { set } from '@ember/object';\n    import { sort } from '@ember/object/computed';\n  \n    class ToDoList {\n      constructor(todos) {\n        set(this, 'todos', todos);\n      }\n  \n      // using standard ascending sort\n      todosSorting = ['name'];\n      @sort('todos', 'todosSorting') sortedTodos;\n  \n      // using descending sort\n      todosSortingDesc = ['name:desc'];\n      @sort('todos', 'todosSortingDesc') sortedTodosDesc;\n    }\n  \n    let todoList = new ToDoList([\n      { name: 'Unit Test', priority: 2 },\n      { name: 'Documentation', priority: 3 },\n      { name: 'Release', priority: 1 }\n    ]);\n  \n    todoList.sortedTodos; // [{ name:'Documentation', priority:3 }, { name:'Release', priority:1 }, { name:'Unit Test', priority:2 }]\n    todoList.sortedTodosDesc; // [{ name:'Unit Test', priority:2 }, { name:'Release', priority:1 }, { name:'Documentation', priority:3 }]\n    ```\n  \n    @method sort\n    @for @ember/object/computed\n    @static\n    @param {String} itemsKey\n    @param {String|Function|Array} sortDefinitionOrDependentKeys The key of the sort definition (an array of sort properties),\n    the sort function, or an array of additional dependent keys\n    @param {Function?} sortDefinition the sort function (when used with additional dependent keys)\n    @return {ComputedProperty} computes a new sorted array based on the sort\n    property array or callback function\n    @public\n  */\n\n\n  function sort(itemsKey, additionalDependentKeys, sortDefinition) {\n    (true && !(!(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))) && (0, _debug.assert)('You attempted to use @sort as a decorator directly, but it requires atleast an `itemsKey` parameter', !(0, _metal.isElementDescriptor)(Array.prototype.slice.call(arguments))));\n\n    if (true\n    /* DEBUG */\n    ) {\n      var argumentsValid = false;\n\n      if (arguments.length === 2) {\n        argumentsValid = typeof itemsKey === 'string' && (typeof additionalDependentKeys === 'string' || typeof additionalDependentKeys === 'function');\n      }\n\n      if (arguments.length === 3) {\n        argumentsValid = typeof itemsKey === 'string' && Array.isArray(additionalDependentKeys) && typeof sortDefinition === 'function';\n      }\n\n      (true && !(argumentsValid) && (0, _debug.assert)('`computed.sort` can either be used with an array of sort properties or with a sort function. If used with an array of sort properties, it must receive exactly two arguments: the key of the array to sort, and the key of the array of sort properties. If used with a sort function, it may recieve up to three arguments: the key of the array to sort, an optional additional array of dependent keys for the computed property, and the sort function.', argumentsValid));\n    }\n\n    if (sortDefinition === undefined && !Array.isArray(additionalDependentKeys)) {\n      sortDefinition = additionalDependentKeys;\n      additionalDependentKeys = [];\n    }\n\n    if (typeof sortDefinition === 'function') {\n      return customSort(itemsKey, additionalDependentKeys, sortDefinition);\n    } else {\n      return propertySort(itemsKey, sortDefinition);\n    }\n  }\n\n  function customSort(itemsKey, additionalDependentKeys, comparator) {\n    return arrayMacro(itemsKey, additionalDependentKeys, function (value) {\n      return value.slice().sort((x, y) => comparator.call(this, x, y));\n    });\n  } // This one needs to dynamically set up and tear down observers on the itemsKey\n  // depending on the sortProperties\n\n\n  function propertySort(itemsKey, sortPropertiesKey) {\n    var activeObserversMap = new WeakMap();\n    var sortPropertyDidChangeMap = new WeakMap();\n\n    if (true\n    /* EMBER_METAL_TRACKED_PROPERTIES */\n    ) {\n        var cp = (0, _metal.computed)(itemsKey + \".[]\", sortPropertiesKey + \".[]\", function (key) {\n          var sortProperties = (0, _metal.get)(this, sortPropertiesKey);\n          (true && !((0, _runtime.isArray)(sortProperties) && sortProperties.every(s => typeof s === 'string')) && (0, _debug.assert)(\"The sort definition for '\" + key + \"' on \" + this + \" must be a function or an array of strings\", (0, _runtime.isArray)(sortProperties) && sortProperties.every(s => typeof s === 'string')));\n          var itemsKeyIsAtThis = itemsKey === '@this';\n          var normalizedSortProperties = normalizeSortProperties(sortProperties);\n          var items = itemsKeyIsAtThis ? this : (0, _metal.get)(this, itemsKey);\n\n          if (!(0, _runtime.isArray)(items)) {\n            return (0, _runtime.A)();\n          }\n\n          if (normalizedSortProperties.length === 0) {\n            return (0, _runtime.A)(items.slice());\n          } else {\n            return sortByNormalizedSortProperties(items, normalizedSortProperties);\n          }\n        }).readOnly();\n        (0, _metal.descriptorForDecorator)(cp).auto();\n        return cp;\n      } else {\n      return (0, _metal.computed)(sortPropertiesKey + \".[]\", function (key) {\n        var sortProperties = (0, _metal.get)(this, sortPropertiesKey);\n        (true && !((0, _runtime.isArray)(sortProperties) && sortProperties.every(s => typeof s === 'string')) && (0, _debug.assert)(\"The sort definition for '\" + key + \"' on \" + this + \" must be a function or an array of strings\", (0, _runtime.isArray)(sortProperties) && sortProperties.every(s => typeof s === 'string'))); // Add/remove property observers as required.\n\n        var activeObservers = activeObserversMap.get(this);\n\n        if (!sortPropertyDidChangeMap.has(this)) {\n          sortPropertyDidChangeMap.set(this, function () {\n            (0, _metal.notifyPropertyChange)(this, key);\n          });\n        }\n\n        var sortPropertyDidChange = sortPropertyDidChangeMap.get(this);\n\n        if (activeObservers !== undefined) {\n          activeObservers.forEach(path => (0, _metal.removeObserver)(this, path, sortPropertyDidChange));\n        }\n\n        var itemsKeyIsAtThis = itemsKey === '@this';\n        var normalizedSortProperties = normalizeSortProperties(sortProperties);\n\n        if (normalizedSortProperties.length === 0) {\n          var path = itemsKeyIsAtThis ? \"[]\" : itemsKey + \".[]\";\n          (0, _metal.addObserver)(this, path, sortPropertyDidChange);\n          activeObservers = [path];\n        } else {\n          activeObservers = normalizedSortProperties.map(([prop]) => {\n            var path = itemsKeyIsAtThis ? \"@each.\" + prop : itemsKey + \".@each.\" + prop;\n            (0, _metal.addObserver)(this, path, sortPropertyDidChange);\n            return path;\n          });\n        }\n\n        activeObserversMap.set(this, activeObservers);\n        var items = itemsKeyIsAtThis ? this : (0, _metal.get)(this, itemsKey);\n\n        if (!(0, _runtime.isArray)(items)) {\n          return (0, _runtime.A)();\n        }\n\n        if (normalizedSortProperties.length === 0) {\n          return (0, _runtime.A)(items.slice());\n        } else {\n          return sortByNormalizedSortProperties(items, normalizedSortProperties);\n        }\n      }).readOnly();\n    }\n  }\n\n  function normalizeSortProperties(sortProperties) {\n    return sortProperties.map(p => {\n      var [prop, direction] = p.split(':');\n      direction = direction || 'asc';\n      return [prop, direction];\n    });\n  }\n\n  function sortByNormalizedSortProperties(items, normalizedSortProperties) {\n    return (0, _runtime.A)(items.slice().sort((itemA, itemB) => {\n      for (var i = 0; i < normalizedSortProperties.length; i++) {\n        var [prop, direction] = normalizedSortProperties[i];\n        var result = (0, _runtime.compare)((0, _metal.get)(itemA, prop), (0, _metal.get)(itemB, prop));\n\n        if (result !== 0) {\n          return direction === 'desc' ? -1 * result : result;\n        }\n      }\n\n      return 0;\n    }));\n  }\n});","define(\"@ember/polyfills/index\", [\"exports\", \"@ember/deprecated-features\", \"@ember/polyfills/lib/merge\", \"@ember/polyfills/lib/assign\", \"@ember/polyfills/lib/weak_set\"], function (_exports, _deprecatedFeatures, _merge, _assign, _weak_set) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"assign\", {\n    enumerable: true,\n    get: function () {\n      return _assign.default;\n    }\n  });\n  Object.defineProperty(_exports, \"assignPolyfill\", {\n    enumerable: true,\n    get: function () {\n      return _assign.assign;\n    }\n  });\n  Object.defineProperty(_exports, \"_WeakSet\", {\n    enumerable: true,\n    get: function () {\n      return _weak_set.default;\n    }\n  });\n  _exports.merge = void 0;\n  var merge = _deprecatedFeatures.MERGE ? _merge.default : undefined; // Export `assignPolyfill` for testing\n\n  _exports.merge = merge;\n});","define(\"@ember/polyfills/lib/assign\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.assign = assign;\n  _exports.default = void 0;\n\n  /**\n   @module @ember/polyfills\n  */\n\n  /**\n    Copy properties from a source object to a target object. Source arguments remain unchanged.\n  \n    ```javascript\n    import { assign } from '@ember/polyfills';\n  \n    var a = { first: 'Yehuda' };\n    var b = { last: 'Katz' };\n    var c = { company: 'Other Company' };\n    var d = { company: 'Tilde Inc.' };\n    assign(a, b, c, d); // a === { first: 'Yehuda', last: 'Katz', company: 'Tilde Inc.' };\n    ```\n  \n    @method assign\n    @for @ember/polyfills\n    @param {Object} target The object to assign into\n    @param {Object} ...args The objects to copy properties from\n    @return {Object}\n    @public\n    @static\n  */\n  function assign(target) {\n    for (var i = 1; i < arguments.length; i++) {\n      var arg = arguments[i];\n\n      if (!arg) {\n        continue;\n      }\n\n      var updates = Object.keys(arg);\n\n      for (var _i = 0; _i < updates.length; _i++) {\n        var prop = updates[_i];\n        target[prop] = arg[prop];\n      }\n    }\n\n    return target;\n  } // Note: We use the bracket notation so\n  //       that the babel plugin does not\n  //       transform it.\n  // https://www.npmjs.com/package/babel-plugin-transform-object-assign\n\n\n  var {\n    assign: _assign\n  } = Object;\n\n  var _default = _assign || assign;\n\n  _exports.default = _default;\n});","define(\"@ember/polyfills/lib/merge\", [\"exports\", \"@ember/debug\"], function (_exports, _debug) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = merge;\n\n  /**\n    Merge the contents of two objects together into the first object.\n  \n    ```javascript\n    import { merge } from '@ember/polyfills';\n  \n    merge({ first: 'Tom' }, { last: 'Dale' }); // { first: 'Tom', last: 'Dale' }\n    var a = { first: 'Yehuda' };\n    var b = { last: 'Katz' };\n    merge(a, b); // a == { first: 'Yehuda', last: 'Katz' }, b == { last: 'Katz' }\n    ```\n  \n    @method merge\n    @static\n    @for @ember/polyfills\n    @param {Object} original The object to merge into\n    @param {Object} updates The object to copy properties from\n    @return {Object}\n    @deprecated\n    @public\n  */\n  function merge(original, updates) {\n    (true && !(false) && (0, _debug.deprecate)('Use of `merge` has been deprecated. Please use `assign` instead.', false, {\n      id: 'ember-polyfills.deprecate-merge',\n      until: '4.0.0',\n      url: 'https://emberjs.com/deprecations/v3.x/#toc_ember-polyfills-deprecate-merge'\n    }));\n\n    if (updates === null || typeof updates !== 'object') {\n      return original;\n    }\n\n    var props = Object.keys(updates);\n    var prop;\n\n    for (var i = 0; i < props.length; i++) {\n      prop = props[i];\n      original[prop] = updates[prop];\n    }\n\n    return original;\n  }\n});","define(\"@ember/polyfills/lib/weak_set\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /* globals WeakSet */\n  var _default = typeof WeakSet === 'function' ? WeakSet : class WeakSetPolyFill {\n    constructor() {\n      this._map = new WeakMap();\n    }\n\n    add(val) {\n      this._map.set(val, true);\n\n      return this;\n    }\n\n    delete(val) {\n      return this._map.delete(val);\n    }\n\n    has(val) {\n      return this._map.has(val);\n    }\n\n  };\n\n  _exports.default = _default;\n});","define(\"@ember/runloop/index\", [\"exports\", \"@ember/debug\", \"@ember/-internals/error-handling\", \"@ember/-internals/metal\", \"backburner\"], function (_exports, _debug, _errorHandling, _metal, _backburner) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.getCurrentRunLoop = getCurrentRunLoop;\n  _exports.run = run;\n  _exports.join = join;\n  _exports.begin = begin;\n  _exports.end = end;\n  _exports.schedule = schedule;\n  _exports.hasScheduledTimers = hasScheduledTimers;\n  _exports.cancelTimers = cancelTimers;\n  _exports.later = later;\n  _exports.once = once;\n  _exports.scheduleOnce = scheduleOnce;\n  _exports.next = next;\n  _exports.cancel = cancel;\n  _exports.debounce = debounce;\n  _exports.throttle = throttle;\n  _exports.bind = _exports._globalsRun = _exports.backburner = _exports.queues = _exports._rsvpErrorQueue = void 0;\n  var currentRunLoop = null;\n\n  function getCurrentRunLoop() {\n    return currentRunLoop;\n  }\n\n  function onBegin(current) {\n    currentRunLoop = current;\n  }\n\n  function onEnd(current, next) {\n    currentRunLoop = next;\n\n    if (true\n    /* EMBER_METAL_TRACKED_PROPERTIES */\n    ) {\n        (0, _metal.flushAsyncObservers)();\n      }\n  }\n\n  var flush;\n\n  if (true\n  /* EMBER_METAL_TRACKED_PROPERTIES */\n  ) {\n      flush = function (queueName, next) {\n        if (queueName === 'render' || queueName === _rsvpErrorQueue) {\n          (0, _metal.flushAsyncObservers)();\n        }\n\n        next();\n      };\n    }\n\n  var _rsvpErrorQueue = (\"\" + Math.random() + Date.now()).replace('.', '');\n  /**\n    Array of named queues. This array determines the order in which queues\n    are flushed at the end of the RunLoop. You can define your own queues by\n    simply adding the queue name to this array. Normally you should not need\n    to inspect or modify this property.\n  \n    @property queues\n    @type Array\n    @default ['actions', 'destroy']\n    @private\n  */\n\n\n  _exports._rsvpErrorQueue = _rsvpErrorQueue;\n  var queues = ['actions', // used in router transitions to prevent unnecessary loading state entry\n  // if all context promises resolve on the 'actions' queue first\n  'routerTransitions', 'render', 'afterRender', 'destroy', // used to re-throw unhandled RSVP rejection errors specifically in this\n  // position to avoid breaking anything rendered in the other sections\n  _rsvpErrorQueue];\n  _exports.queues = queues;\n  var backburner = new _backburner.default(queues, {\n    defaultQueue: 'actions',\n    onBegin,\n    onEnd,\n    onErrorTarget: _errorHandling.onErrorTarget,\n    onErrorMethod: 'onerror',\n    flush\n  });\n  /**\n   @module @ember/runloop\n  */\n  // ..........................................................\n  // run - this is ideally the only public API the dev sees\n  //\n\n  /**\n    Runs the passed target and method inside of a RunLoop, ensuring any\n    deferred actions including bindings and views updates are flushed at the\n    end.\n  \n    Normally you should not need to invoke this method yourself. However if\n    you are implementing raw event handlers when interfacing with other\n    libraries or plugins, you should probably wrap all of your code inside this\n    call.\n  \n    ```javascript\n    import { run } from '@ember/runloop';\n  \n    run(function() {\n      // code to be executed within a RunLoop\n    });\n    ```\n    @method run\n    @for @ember/runloop\n    @static\n    @param {Object} [target] target of method to call\n    @param {Function|String} method Method to invoke.\n      May be a function or a string. If you pass a string\n      then it will be looked up on the passed target.\n    @param {Object} [args*] Any additional arguments you wish to pass to the method.\n    @return {Object} return value from invoking the passed function.\n    @public\n  */\n\n  _exports.backburner = backburner;\n\n  function run() {\n    return backburner.run(...arguments);\n  } // used for the Ember.run global only\n\n\n  var _globalsRun = run.bind(null);\n  /**\n    If no run-loop is present, it creates a new one. If a run loop is\n    present it will queue itself to run on the existing run-loops action\n    queue.\n  \n    Please note: This is not for normal usage, and should be used sparingly.\n  \n    If invoked when not within a run loop:\n  \n    ```javascript\n    import { join } from '@ember/runloop';\n  \n    join(function() {\n      // creates a new run-loop\n    });\n    ```\n  \n    Alternatively, if called within an existing run loop:\n  \n    ```javascript\n    import { run, join } from '@ember/runloop';\n  \n    run(function() {\n      // creates a new run-loop\n  \n      join(function() {\n        // joins with the existing run-loop, and queues for invocation on\n        // the existing run-loops action queue.\n      });\n    });\n    ```\n  \n    @method join\n    @static\n    @for @ember/runloop\n    @param {Object} [target] target of method to call\n    @param {Function|String} method Method to invoke.\n      May be a function or a string. If you pass a string\n      then it will be looked up on the passed target.\n    @param {Object} [args*] Any additional arguments you wish to pass to the method.\n    @return {Object} Return value from invoking the passed function. Please note,\n    when called within an existing loop, no return value is possible.\n    @public\n  */\n\n\n  _exports._globalsRun = _globalsRun;\n\n  function join() {\n    return backburner.join(...arguments);\n  }\n  /**\n    Allows you to specify which context to call the specified function in while\n    adding the execution of that function to the Ember run loop. This ability\n    makes this method a great way to asynchronously integrate third-party libraries\n    into your Ember application.\n  \n    `bind` takes two main arguments, the desired context and the function to\n    invoke in that context. Any additional arguments will be supplied as arguments\n    to the function that is passed in.\n  \n    Let's use the creation of a TinyMCE component as an example. Currently,\n    TinyMCE provides a setup configuration option we can use to do some processing\n    after the TinyMCE instance is initialized but before it is actually rendered.\n    We can use that setup option to do some additional setup for our component.\n    The component itself could look something like the following:\n  \n    ```app/components/rich-text-editor.js\n    import Component from '@ember/component';\n    import { on } from '@ember/object/evented';\n    import { bind } from '@ember/runloop';\n  \n    export default Component.extend({\n      initializeTinyMCE: on('didInsertElement', function() {\n        tinymce.init({\n          selector: '#' + this.$().prop('id'),\n          setup: bind(this, this.setupEditor)\n        });\n      }),\n  \n      didInsertElement() {\n        tinymce.init({\n          selector: '#' + this.$().prop('id'),\n          setup: bind(this, this.setupEditor)\n        });\n      }\n  \n      setupEditor(editor) {\n        this.set('editor', editor);\n  \n        editor.on('change', function() {\n          console.log('content changed!');\n        });\n      }\n    });\n    ```\n  \n    In this example, we use `bind` to bind the setupEditor method to the\n    context of the RichTextEditor component and to have the invocation of that\n    method be safely handled and executed by the Ember run loop.\n  \n    @method bind\n    @static\n    @for @ember/runloop\n    @param {Object} [target] target of method to call\n    @param {Function|String} method Method to invoke.\n      May be a function or a string. If you pass a string\n      then it will be looked up on the passed target.\n    @param {Object} [args*] Any additional arguments you wish to pass to the method.\n    @return {Function} returns a new function that will always have a particular context\n    @since 1.4.0\n    @public\n  */\n\n\n  var bind = (...curried) => {\n    (true && !(function (methodOrTarget, methodOrArg) {\n      // Applies the same logic as backburner parseArgs for detecting if a method\n      // is actually being passed.\n      var length = arguments.length;\n\n      if (length === 0) {\n        return false;\n      } else if (length === 1) {\n        return typeof methodOrTarget === 'function';\n      } else {\n        var type = typeof methodOrArg;\n        return type === 'function' || // second argument is a function\n        methodOrTarget !== null && type === 'string' && methodOrArg in methodOrTarget || // second argument is the name of a method in first argument\n        typeof methodOrTarget === 'function' //first argument is a function\n        ;\n      }\n    }(...curried)) && (0, _debug.assert)('could not find a suitable method to bind', function (methodOrTarget, methodOrArg) {\n      var length = arguments.length;\n\n      if (length === 0) {\n        return false;\n      } else if (length === 1) {\n        return typeof methodOrTarget === 'function';\n      } else {\n        var type = typeof methodOrArg;\n        return type === 'function' || methodOrTarget !== null && type === 'string' && methodOrArg in methodOrTarget || typeof methodOrTarget === 'function';\n      }\n    }(...curried)));\n    return (...args) => join(...curried.concat(args));\n  };\n  /**\n    Begins a new RunLoop. Any deferred actions invoked after the begin will\n    be buffered until you invoke a matching call to `end()`. This is\n    a lower-level way to use a RunLoop instead of using `run()`.\n  \n    ```javascript\n    import { begin, end } from '@ember/runloop';\n  \n    begin();\n    // code to be executed within a RunLoop\n    end();\n    ```\n  \n    @method begin\n    @static\n    @for @ember/runloop\n    @return {void}\n    @public\n  */\n\n\n  _exports.bind = bind;\n\n  function begin() {\n    backburner.begin();\n  }\n  /**\n    Ends a RunLoop. This must be called sometime after you call\n    `begin()` to flush any deferred actions. This is a lower-level way\n    to use a RunLoop instead of using `run()`.\n  \n    ```javascript\n    import { begin, end } from '@ember/runloop';\n  \n    begin();\n    // code to be executed within a RunLoop\n    end();\n    ```\n  \n    @method end\n    @static\n    @for @ember/runloop\n    @return {void}\n    @public\n  */\n\n\n  function end() {\n    backburner.end();\n  }\n  /**\n    Adds the passed target/method and any optional arguments to the named\n    queue to be executed at the end of the RunLoop. If you have not already\n    started a RunLoop when calling this method one will be started for you\n    automatically.\n  \n    At the end of a RunLoop, any methods scheduled in this way will be invoked.\n    Methods will be invoked in an order matching the named queues defined in\n    the `queues` property.\n  \n    ```javascript\n    import { schedule } from '@ember/runloop';\n  \n    schedule('afterRender', this, function() {\n      // this will be executed in the 'afterRender' queue\n      console.log('scheduled on afterRender queue');\n    });\n  \n    schedule('actions', this, function() {\n      // this will be executed in the 'actions' queue\n      console.log('scheduled on actions queue');\n    });\n  \n    // Note the functions will be run in order based on the run queues order.\n    // Output would be:\n    //   scheduled on actions queue\n    //   scheduled on afterRender queue\n    ```\n  \n    @method schedule\n    @static\n    @for @ember/runloop\n    @param {String} queue The name of the queue to schedule against. Default queues is 'actions'\n    @param {Object} [target] target object to use as the context when invoking a method.\n    @param {String|Function} method The method to invoke. If you pass a string it\n      will be resolved on the target object at the time the scheduled item is\n      invoked allowing you to change the target function.\n    @param {Object} [arguments*] Optional arguments to be passed to the queued method.\n    @return {*} Timer information for use in canceling, see `cancel`.\n    @public\n  */\n\n\n  function schedule()\n  /* queue, target, method */\n  {\n    return backburner.schedule(...arguments);\n  } // Used by global test teardown\n\n\n  function hasScheduledTimers() {\n    return backburner.hasTimers();\n  } // Used by global test teardown\n\n\n  function cancelTimers() {\n    backburner.cancelTimers();\n  }\n  /**\n    Invokes the passed target/method and optional arguments after a specified\n    period of time. The last parameter of this method must always be a number\n    of milliseconds.\n  \n    You should use this method whenever you need to run some action after a\n    period of time instead of using `setTimeout()`. This method will ensure that\n    items that expire during the same script execution cycle all execute\n    together, which is often more efficient than using a real setTimeout.\n  \n    ```javascript\n    import { later } from '@ember/runloop';\n  \n    later(myContext, function() {\n      // code here will execute within a RunLoop in about 500ms with this == myContext\n    }, 500);\n    ```\n  \n    @method later\n    @static\n    @for @ember/runloop\n    @param {Object} [target] target of method to invoke\n    @param {Function|String} method The method to invoke.\n      If you pass a string it will be resolved on the\n      target at the time the method is invoked.\n    @param {Object} [args*] Optional arguments to pass to the timeout.\n    @param {Number} wait Number of milliseconds to wait.\n    @return {*} Timer information for use in canceling, see `cancel`.\n    @public\n  */\n\n\n  function later()\n  /*target, method*/\n  {\n    return backburner.later(...arguments);\n  }\n  /**\n   Schedule a function to run one time during the current RunLoop. This is equivalent\n    to calling `scheduleOnce` with the \"actions\" queue.\n  \n    @method once\n    @static\n    @for @ember/runloop\n    @param {Object} [target] The target of the method to invoke.\n    @param {Function|String} method The method to invoke.\n      If you pass a string it will be resolved on the\n      target at the time the method is invoked.\n    @param {Object} [args*] Optional arguments to pass to the timeout.\n    @return {Object} Timer information for use in canceling, see `cancel`.\n    @public\n  */\n\n\n  function once(...args) {\n    args.unshift('actions');\n    return backburner.scheduleOnce(...args);\n  }\n  /**\n    Schedules a function to run one time in a given queue of the current RunLoop.\n    Calling this method with the same queue/target/method combination will have\n    no effect (past the initial call).\n  \n    Note that although you can pass optional arguments these will not be\n    considered when looking for duplicates. New arguments will replace previous\n    calls.\n  \n    ```javascript\n    import { run, scheduleOnce } from '@ember/runloop';\n  \n    function sayHi() {\n      console.log('hi');\n    }\n  \n    run(function() {\n      scheduleOnce('afterRender', myContext, sayHi);\n      scheduleOnce('afterRender', myContext, sayHi);\n      // sayHi will only be executed once, in the afterRender queue of the RunLoop\n    });\n    ```\n  \n    Also note that for `scheduleOnce` to prevent additional calls, you need to\n    pass the same function instance. The following case works as expected:\n  \n    ```javascript\n    function log() {\n      console.log('Logging only once');\n    }\n  \n    function scheduleIt() {\n      scheduleOnce('actions', myContext, log);\n    }\n  \n    scheduleIt();\n    scheduleIt();\n    ```\n  \n    But this other case will schedule the function multiple times:\n  \n    ```javascript\n    import { scheduleOnce } from '@ember/runloop';\n  \n    function scheduleIt() {\n      scheduleOnce('actions', myContext, function() {\n        console.log('Closure');\n      });\n    }\n  \n    scheduleIt();\n    scheduleIt();\n  \n    // \"Closure\" will print twice, even though we're using `scheduleOnce`,\n    // because the function we pass to it won't match the\n    // previously scheduled operation.\n    ```\n  \n    Available queues, and their order, can be found at `queues`\n  \n    @method scheduleOnce\n    @static\n    @for @ember/runloop\n    @param {String} [queue] The name of the queue to schedule against. Default queues is 'actions'.\n    @param {Object} [target] The target of the method to invoke.\n    @param {Function|String} method The method to invoke.\n      If you pass a string it will be resolved on the\n      target at the time the method is invoked.\n    @param {Object} [args*] Optional arguments to pass to the timeout.\n    @return {Object} Timer information for use in canceling, see `cancel`.\n    @public\n  */\n\n\n  function scheduleOnce()\n  /* queue, target, method*/\n  {\n    return backburner.scheduleOnce(...arguments);\n  }\n  /**\n    Schedules an item to run from within a separate run loop, after\n    control has been returned to the system. This is equivalent to calling\n    `later` with a wait time of 1ms.\n  \n    ```javascript\n    import { next } from '@ember/runloop';\n  \n    next(myContext, function() {\n      // code to be executed in the next run loop,\n      // which will be scheduled after the current one\n    });\n    ```\n  \n    Multiple operations scheduled with `next` will coalesce\n    into the same later run loop, along with any other operations\n    scheduled by `later` that expire right around the same\n    time that `next` operations will fire.\n  \n    Note that there are often alternatives to using `next`.\n    For instance, if you'd like to schedule an operation to happen\n    after all DOM element operations have completed within the current\n    run loop, you can make use of the `afterRender` run loop queue (added\n    by the `ember-views` package, along with the preceding `render` queue\n    where all the DOM element operations happen).\n  \n    Example:\n  \n    ```app/components/my-component.js\n    import Component from '@ember/component';\n    import { scheduleOnce } from '@ember/runloop';\n  \n    export Component.extend({\n      didInsertElement() {\n        this._super(...arguments);\n        scheduleOnce('afterRender', this, 'processChildElements');\n      },\n  \n      processChildElements() {\n        // ... do something with component's child component\n        // elements after they've finished rendering, which\n        // can't be done within this component's\n        // `didInsertElement` hook because that gets run\n        // before the child elements have been added to the DOM.\n      }\n    });\n    ```\n  \n    One benefit of the above approach compared to using `next` is\n    that you will be able to perform DOM/CSS operations before unprocessed\n    elements are rendered to the screen, which may prevent flickering or\n    other artifacts caused by delaying processing until after rendering.\n  \n    The other major benefit to the above approach is that `next`\n    introduces an element of non-determinism, which can make things much\n    harder to test, due to its reliance on `setTimeout`; it's much harder\n    to guarantee the order of scheduled operations when they are scheduled\n    outside of the current run loop, i.e. with `next`.\n  \n    @method next\n    @static\n    @for @ember/runloop\n    @param {Object} [target] target of method to invoke\n    @param {Function|String} method The method to invoke.\n      If you pass a string it will be resolved on the\n      target at the time the method is invoked.\n    @param {Object} [args*] Optional arguments to pass to the timeout.\n    @return {Object} Timer information for use in canceling, see `cancel`.\n    @public\n  */\n\n\n  function next(...args) {\n    args.push(1);\n    return backburner.later(...args);\n  }\n  /**\n    Cancels a scheduled item. Must be a value returned by `later()`,\n    `once()`, `scheduleOnce()`, `next()`, `debounce()`, or\n    `throttle()`.\n  \n    ```javascript\n    import {\n      next,\n      cancel,\n      later,\n      scheduleOnce,\n      once,\n      throttle,\n      debounce\n    } from '@ember/runloop';\n  \n    let runNext = next(myContext, function() {\n      // will not be executed\n    });\n  \n    cancel(runNext);\n  \n    let runLater = later(myContext, function() {\n      // will not be executed\n    }, 500);\n  \n    cancel(runLater);\n  \n    let runScheduleOnce = scheduleOnce('afterRender', myContext, function() {\n      // will not be executed\n    });\n  \n    cancel(runScheduleOnce);\n  \n    let runOnce = once(myContext, function() {\n      // will not be executed\n    });\n  \n    cancel(runOnce);\n  \n    let throttle = throttle(myContext, function() {\n      // will not be executed\n    }, 1, false);\n  \n    cancel(throttle);\n  \n    let debounce = debounce(myContext, function() {\n      // will not be executed\n    }, 1);\n  \n    cancel(debounce);\n  \n    let debounceImmediate = debounce(myContext, function() {\n      // will be executed since we passed in true (immediate)\n    }, 100, true);\n  \n    // the 100ms delay until this method can be called again will be canceled\n    cancel(debounceImmediate);\n    ```\n  \n    @method cancel\n    @static\n    @for @ember/runloop\n    @param {Object} timer Timer object to cancel\n    @return {Boolean} true if canceled or false/undefined if it wasn't found\n    @public\n  */\n\n\n  function cancel(timer) {\n    return backburner.cancel(timer);\n  }\n  /**\n    Delay calling the target method until the debounce period has elapsed\n    with no additional debounce calls. If `debounce` is called again before\n    the specified time has elapsed, the timer is reset and the entire period\n    must pass again before the target method is called.\n  \n    This method should be used when an event may be called multiple times\n    but the action should only be called once when the event is done firing.\n    A common example is for scroll events where you only want updates to\n    happen once scrolling has ceased.\n  \n    ```javascript\n    import { debounce } from '@ember/runloop';\n  \n    function whoRan() {\n      console.log(this.name + ' ran.');\n    }\n  \n    let myContext = { name: 'debounce' };\n  \n    debounce(myContext, whoRan, 150);\n  \n    // less than 150ms passes\n    debounce(myContext, whoRan, 150);\n  \n    // 150ms passes\n    // whoRan is invoked with context myContext\n    // console logs 'debounce ran.' one time.\n    ```\n  \n    Immediate allows you to run the function immediately, but debounce\n    other calls for this function until the wait time has elapsed. If\n    `debounce` is called again before the specified time has elapsed,\n    the timer is reset and the entire period must pass again before\n    the method can be called again.\n  \n    ```javascript\n    import { debounce } from '@ember/runloop';\n  \n    function whoRan() {\n      console.log(this.name + ' ran.');\n    }\n  \n    let myContext = { name: 'debounce' };\n  \n    debounce(myContext, whoRan, 150, true);\n  \n    // console logs 'debounce ran.' one time immediately.\n    // 100ms passes\n    debounce(myContext, whoRan, 150, true);\n  \n    // 150ms passes and nothing else is logged to the console and\n    // the debouncee is no longer being watched\n    debounce(myContext, whoRan, 150, true);\n  \n    // console logs 'debounce ran.' one time immediately.\n    // 150ms passes and nothing else is logged to the console and\n    // the debouncee is no longer being watched\n    ```\n  \n    @method debounce\n    @static\n    @for @ember/runloop\n    @param {Object} [target] target of method to invoke\n    @param {Function|String} method The method to invoke.\n      May be a function or a string. If you pass a string\n      then it will be looked up on the passed target.\n    @param {Object} [args*] Optional arguments to pass to the timeout.\n    @param {Number} wait Number of milliseconds to wait.\n    @param {Boolean} immediate Trigger the function on the leading instead\n      of the trailing edge of the wait interval. Defaults to false.\n    @return {Array} Timer information for use in canceling, see `cancel`.\n    @public\n  */\n\n\n  function debounce() {\n    return backburner.debounce(...arguments);\n  }\n  /**\n    Ensure that the target method is never called more frequently than\n    the specified spacing period. The target method is called immediately.\n  \n    ```javascript\n    import { throttle } from '@ember/runloop';\n  \n    function whoRan() {\n      console.log(this.name + ' ran.');\n    }\n  \n    let myContext = { name: 'throttle' };\n  \n    throttle(myContext, whoRan, 150);\n    // whoRan is invoked with context myContext\n    // console logs 'throttle ran.'\n  \n    // 50ms passes\n    throttle(myContext, whoRan, 150);\n  \n    // 50ms passes\n    throttle(myContext, whoRan, 150);\n  \n    // 150ms passes\n    throttle(myContext, whoRan, 150);\n    // whoRan is invoked with context myContext\n    // console logs 'throttle ran.'\n    ```\n  \n    @method throttle\n    @static\n    @for @ember/runloop\n    @param {Object} [target] target of method to invoke\n    @param {Function|String} method The method to invoke.\n      May be a function or a string. If you pass a string\n      then it will be looked up on the passed target.\n    @param {Object} [args*] Optional arguments to pass to the timeout.\n    @param {Number} spacing Number of milliseconds to space out requests.\n    @param {Boolean} immediate Trigger the function on the leading instead\n      of the trailing edge of the wait interval. Defaults to true.\n    @return {Array} Timer information for use in canceling, see `cancel`.\n    @public\n  */\n\n\n  function throttle() {\n    return backburner.throttle(...arguments);\n  }\n});","define(\"@ember/service/index\", [\"exports\", \"@ember/-internals/runtime\", \"@ember/-internals/metal\"], function (_exports, _runtime, _metal) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.inject = inject;\n  _exports.default = void 0;\n\n  /**\n   @module @ember/service\n   @public\n   */\n\n  /**\n    Creates a property that lazily looks up a service in the container. There are\n    no restrictions as to what objects a service can be injected into.\n  \n    Example:\n  \n    ```app/routes/application.js\n    import Route from '@ember/routing/route';\n    import { inject as service } from '@ember/service';\n  \n    export default class ApplicationRoute extends Route {\n      @service('auth') authManager;\n  \n      model() {\n        return this.authManager.findCurrentUser();\n      }\n    }\n    ```\n  \n    Classic Class Example:\n  \n    ```app/routes/application.js\n    import Route from '@ember/routing/route';\n    import { inject as service } from '@ember/service';\n  \n    export default Route.extend({\n      authManager: service('auth'),\n  \n      model() {\n        return this.get('authManager').findCurrentUser();\n      }\n    });\n    ```\n  \n    This example will create an `authManager` property on the application route\n    that looks up the `auth` service in the container, making it easily accessible\n    in the `model` hook.\n  \n    @method inject\n    @static\n    @since 1.10.0\n    @for @ember/service\n    @param {String} name (optional) name of the service to inject, defaults to\n           the property's name\n    @return {ComputedDecorator} injection decorator instance\n    @public\n  */\n  function inject() {\n    return (0, _metal.inject)('service', ...arguments);\n  }\n  /**\n    @class Service\n    @extends EmberObject\n    @since 1.10.0\n    @public\n  */\n\n\n  var Service = _runtime.FrameworkObject.extend();\n\n  Service.reopenClass({\n    isServiceFactory: true\n  });\n  (0, _runtime.setFrameworkClass)(Service);\n  var _default = Service;\n  _exports.default = _default;\n});","define(\"@ember/string/index\", [\"exports\", \"@ember/string/lib/string_registry\", \"@ember/-internals/environment\", \"@ember/-internals/utils\"], function (_exports, _string_registry, _environment, _utils) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.loc = loc;\n  _exports.w = w;\n  _exports.decamelize = decamelize;\n  _exports.dasherize = dasherize;\n  _exports.camelize = camelize;\n  _exports.classify = classify;\n  _exports.underscore = underscore;\n  _exports.capitalize = capitalize;\n  Object.defineProperty(_exports, \"_getStrings\", {\n    enumerable: true,\n    get: function () {\n      return _string_registry.getStrings;\n    }\n  });\n  Object.defineProperty(_exports, \"_setStrings\", {\n    enumerable: true,\n    get: function () {\n      return _string_registry.setStrings;\n    }\n  });\n\n  /**\n  @module @ember/string\n  */\n  var STRING_DASHERIZE_REGEXP = /[ _]/g;\n  var STRING_DASHERIZE_CACHE = new _utils.Cache(1000, key => decamelize(key).replace(STRING_DASHERIZE_REGEXP, '-'));\n  var STRING_CAMELIZE_REGEXP_1 = /(\\-|\\_|\\.|\\s)+(.)?/g;\n  var STRING_CAMELIZE_REGEXP_2 = /(^|\\/)([A-Z])/g;\n  var CAMELIZE_CACHE = new _utils.Cache(1000, key => key.replace(STRING_CAMELIZE_REGEXP_1, (_match, _separator, chr) => chr ? chr.toUpperCase() : '').replace(STRING_CAMELIZE_REGEXP_2, (match\n  /*, separator, chr */\n  ) => match.toLowerCase()));\n  var STRING_CLASSIFY_REGEXP_1 = /^(\\-|_)+(.)?/;\n  var STRING_CLASSIFY_REGEXP_2 = /(.)(\\-|\\_|\\.|\\s)+(.)?/g;\n  var STRING_CLASSIFY_REGEXP_3 = /(^|\\/|\\.)([a-z])/g;\n  var CLASSIFY_CACHE = new _utils.Cache(1000, str => {\n    var replace1 = (_match, _separator, chr) => chr ? \"_\" + chr.toUpperCase() : '';\n\n    var replace2 = (_match, initialChar, _separator, chr) => initialChar + (chr ? chr.toUpperCase() : '');\n\n    var parts = str.split('/');\n\n    for (var i = 0; i < parts.length; i++) {\n      parts[i] = parts[i].replace(STRING_CLASSIFY_REGEXP_1, replace1).replace(STRING_CLASSIFY_REGEXP_2, replace2);\n    }\n\n    return parts.join('/').replace(STRING_CLASSIFY_REGEXP_3, (match\n    /*, separator, chr */\n    ) => match.toUpperCase());\n  });\n  var STRING_UNDERSCORE_REGEXP_1 = /([a-z\\d])([A-Z]+)/g;\n  var STRING_UNDERSCORE_REGEXP_2 = /\\-|\\s+/g;\n  var UNDERSCORE_CACHE = new _utils.Cache(1000, str => str.replace(STRING_UNDERSCORE_REGEXP_1, '$1_$2').replace(STRING_UNDERSCORE_REGEXP_2, '_').toLowerCase());\n  var STRING_CAPITALIZE_REGEXP = /(^|\\/)([a-z\\u00C0-\\u024F])/g;\n  var CAPITALIZE_CACHE = new _utils.Cache(1000, str => str.replace(STRING_CAPITALIZE_REGEXP, (match\n  /*, separator, chr */\n  ) => match.toUpperCase()));\n  var STRING_DECAMELIZE_REGEXP = /([a-z\\d])([A-Z])/g;\n  var DECAMELIZE_CACHE = new _utils.Cache(1000, str => str.replace(STRING_DECAMELIZE_REGEXP, '$1_$2').toLowerCase());\n  /**\n    Defines string helper methods including string formatting and localization.\n    Unless `EmberENV.EXTEND_PROTOTYPES.String` is `false` these methods will also be\n    added to the `String.prototype` as well.\n  \n    @class String\n    @public\n  */\n\n  function _fmt(str, formats) {\n    // first, replace any ORDERED replacements.\n    var idx = 0; // the current index for non-numerical replacements\n\n    return str.replace(/%@([0-9]+)?/g, (_s, argIndex) => {\n      var i = argIndex ? parseInt(argIndex, 10) - 1 : idx++;\n      var r = i < formats.length ? formats[i] : undefined;\n      return typeof r === 'string' ? r : r === null ? '(null)' : r === undefined ? '' : String(r);\n    });\n  }\n  /**\n    Formats the passed string, but first looks up the string in the localized\n    strings hash. This is a convenient way to localize text.\n  \n    Note that it is traditional but not required to prefix localized string\n    keys with an underscore or other character so you can easily identify\n    localized strings.\n  \n    ```javascript\n    import { loc } from '@ember/string';\n  \n    Ember.STRINGS = {\n      '_Hello World': 'Bonjour le monde',\n      '_Hello %@ %@': 'Bonjour %@ %@'\n    };\n  \n    loc(\"_Hello World\");  // 'Bonjour le monde';\n    loc(\"_Hello %@ %@\", [\"John\", \"Smith\"]);  // \"Bonjour John Smith\";\n    ```\n  \n    @method loc\n    @param {String} str The string to format\n    @param {Array} formats Optional array of parameters to interpolate into string.\n    @return {String} formatted string\n    @public\n  */\n\n\n  function loc(str, formats) {\n    if (!Array.isArray(formats) || arguments.length > 2) {\n      formats = Array.prototype.slice.call(arguments, 1);\n    }\n\n    str = (0, _string_registry.getString)(str) || str;\n    return _fmt(str, formats);\n  }\n  /**\n    Splits a string into separate units separated by spaces, eliminating any\n    empty strings in the process. This is a convenience method for split that\n    is mostly useful when applied to the `String.prototype`.\n  \n    ```javascript\n    import { w } from '@ember/string';\n  \n    w(\"alpha beta gamma\").forEach(function(key) {\n      console.log(key);\n    });\n  \n    // > alpha\n    // > beta\n    // > gamma\n    ```\n  \n    @method w\n    @param {String} str The string to split\n    @return {Array} array containing the split strings\n    @public\n  */\n\n\n  function w(str) {\n    return str.split(/\\s+/);\n  }\n  /**\n    Converts a camelized string into all lower case separated by underscores.\n  \n    ```javascript\n    import { decamelize } from '@ember/string';\n  \n    decamelize('innerHTML');          // 'inner_html'\n    decamelize('action_name');        // 'action_name'\n    decamelize('css-class-name');     // 'css-class-name'\n    decamelize('my favorite items');  // 'my favorite items'\n    ```\n  \n    @method decamelize\n    @param {String} str The string to decamelize.\n    @return {String} the decamelized string.\n    @public\n  */\n\n\n  function decamelize(str) {\n    return DECAMELIZE_CACHE.get(str);\n  }\n  /**\n    Replaces underscores, spaces, or camelCase with dashes.\n  \n    ```javascript\n    import { dasherize } from '@ember/string';\n  \n    dasherize('innerHTML');                // 'inner-html'\n    dasherize('action_name');              // 'action-name'\n    dasherize('css-class-name');           // 'css-class-name'\n    dasherize('my favorite items');        // 'my-favorite-items'\n    dasherize('privateDocs/ownerInvoice';  // 'private-docs/owner-invoice'\n    ```\n  \n    @method dasherize\n    @param {String} str The string to dasherize.\n    @return {String} the dasherized string.\n    @public\n  */\n\n\n  function dasherize(str) {\n    return STRING_DASHERIZE_CACHE.get(str);\n  }\n  /**\n    Returns the lowerCamelCase form of a string.\n  \n    ```javascript\n    import { camelize } from '@ember/string';\n  \n    camelize('innerHTML');                   // 'innerHTML'\n    camelize('action_name');                 // 'actionName'\n    camelize('css-class-name');              // 'cssClassName'\n    camelize('my favorite items');           // 'myFavoriteItems'\n    camelize('My Favorite Items');           // 'myFavoriteItems'\n    camelize('private-docs/owner-invoice');  // 'privateDocs/ownerInvoice'\n    ```\n  \n    @method camelize\n    @param {String} str The string to camelize.\n    @return {String} the camelized string.\n    @public\n  */\n\n\n  function camelize(str) {\n    return CAMELIZE_CACHE.get(str);\n  }\n  /**\n    Returns the UpperCamelCase form of a string.\n  \n    ```javascript\n    import { classify } from '@ember/string';\n  \n    classify('innerHTML');                   // 'InnerHTML'\n    classify('action_name');                 // 'ActionName'\n    classify('css-class-name');              // 'CssClassName'\n    classify('my favorite items');           // 'MyFavoriteItems'\n    classify('private-docs/owner-invoice');  // 'PrivateDocs/OwnerInvoice'\n    ```\n  \n    @method classify\n    @param {String} str the string to classify\n    @return {String} the classified string\n    @public\n  */\n\n\n  function classify(str) {\n    return CLASSIFY_CACHE.get(str);\n  }\n  /**\n    More general than decamelize. Returns the lower\\_case\\_and\\_underscored\n    form of a string.\n  \n    ```javascript\n    import { underscore } from '@ember/string';\n  \n    underscore('innerHTML');                 // 'inner_html'\n    underscore('action_name');               // 'action_name'\n    underscore('css-class-name');            // 'css_class_name'\n    underscore('my favorite items');         // 'my_favorite_items'\n    underscore('privateDocs/ownerInvoice');  // 'private_docs/owner_invoice'\n    ```\n  \n    @method underscore\n    @param {String} str The string to underscore.\n    @return {String} the underscored string.\n    @public\n  */\n\n\n  function underscore(str) {\n    return UNDERSCORE_CACHE.get(str);\n  }\n  /**\n    Returns the Capitalized form of a string\n  \n    ```javascript\n    import { capitalize } from '@ember/string';\n  \n    capitalize('innerHTML')                 // 'InnerHTML'\n    capitalize('action_name')               // 'Action_name'\n    capitalize('css-class-name')            // 'Css-class-name'\n    capitalize('my favorite items')         // 'My favorite items'\n    capitalize('privateDocs/ownerInvoice'); // 'PrivateDocs/ownerInvoice'\n    ```\n  \n    @method capitalize\n    @param {String} str The string to capitalize.\n    @return {String} The capitalized string.\n    @public\n  */\n\n\n  function capitalize(str) {\n    return CAPITALIZE_CACHE.get(str);\n  }\n\n  if (_environment.ENV.EXTEND_PROTOTYPES.String) {\n    Object.defineProperties(String.prototype, {\n      /**\n        See [String.w](/ember/release/classes/String/methods/w?anchor=w).\n             @method w\n        @for @ember/string\n        @static\n        @private\n      */\n      w: {\n        configurable: true,\n        enumerable: false,\n        writeable: true,\n\n        value() {\n          return w(this);\n        }\n\n      },\n\n      /**\n        See [String.loc](/ember/release/classes/String/methods/loc?anchor=loc).\n             @method loc\n        @for @ember/string\n        @static\n        @private\n      */\n      loc: {\n        configurable: true,\n        enumerable: false,\n        writeable: true,\n\n        value(...args) {\n          return loc(this, args);\n        }\n\n      },\n\n      /**\n        See [String.camelize](/ember/release/classes/String/methods/camelize?anchor=camelize).\n             @method camelize\n        @for @ember/string\n        @static\n        @private\n      */\n      camelize: {\n        configurable: true,\n        enumerable: false,\n        writeable: true,\n\n        value() {\n          return camelize(this);\n        }\n\n      },\n\n      /**\n        See [String.decamelize](/ember/release/classes/String/methods/decamelize?anchor=decamelize).\n             @method decamelize\n        @for @ember/string\n        @static\n        @private\n      */\n      decamelize: {\n        configurable: true,\n        enumerable: false,\n        writeable: true,\n\n        value() {\n          return decamelize(this);\n        }\n\n      },\n\n      /**\n        See [String.dasherize](/ember/release/classes/String/methods/dasherize?anchor=dasherize).\n             @method dasherize\n        @for @ember/string\n        @static\n        @private\n      */\n      dasherize: {\n        configurable: true,\n        enumerable: false,\n        writeable: true,\n\n        value() {\n          return dasherize(this);\n        }\n\n      },\n\n      /**\n        See [String.underscore](/ember/release/classes/String/methods/underscore?anchor=underscore).\n             @method underscore\n        @for @ember/string\n        @static\n        @private\n      */\n      underscore: {\n        configurable: true,\n        enumerable: false,\n        writeable: true,\n\n        value() {\n          return underscore(this);\n        }\n\n      },\n\n      /**\n        See [String.classify](/ember/release/classes/String/methods/classify?anchor=classify).\n             @method classify\n        @for @ember/string\n        @static\n        @private\n      */\n      classify: {\n        configurable: true,\n        enumerable: false,\n        writeable: true,\n\n        value() {\n          return classify(this);\n        }\n\n      },\n\n      /**\n        See [String.capitalize](/ember/release/classes/String/methods/capitalize?anchor=capitalize).\n             @method capitalize\n        @for @ember/string\n        @static\n        @private\n      */\n      capitalize: {\n        configurable: true,\n        enumerable: false,\n        writeable: true,\n\n        value() {\n          return capitalize(this);\n        }\n\n      }\n    });\n  }\n});","define(\"@ember/string/lib/string_registry\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.setStrings = setStrings;\n  _exports.getStrings = getStrings;\n  _exports.getString = getString;\n  // STATE within a module is frowned upon, this exists\n  // to support Ember.STRINGS but shield ember internals from this legacy global\n  // API.\n  var STRINGS = {};\n\n  function setStrings(strings) {\n    STRINGS = strings;\n  }\n\n  function getStrings() {\n    return STRINGS;\n  }\n\n  function getString(name) {\n    return STRINGS[name];\n  }\n});","define(\"@glimmer/encoder\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.InstructionEncoder = void 0;\n\n  class InstructionEncoder {\n    constructor(buffer) {\n      this.buffer = buffer;\n      this.typePos = 0;\n      this.size = 0;\n    }\n\n    encode(type, machine) {\n      if (type > 255\n      /* TYPE_SIZE */\n      ) {\n          throw new Error(\"Opcode type over 8-bits. Got \" + type + \".\");\n        }\n\n      this.buffer.push(type | machine | arguments.length - 2 << 8\n      /* ARG_SHIFT */\n      );\n      this.typePos = this.buffer.length - 1;\n\n      for (var i = 2; i < arguments.length; i++) {\n        var op = arguments[i];\n\n        if (typeof op === 'number' && op > 4294967295\n        /* MAX_SIZE */\n        ) {\n            throw new Error(\"Operand over 32-bits. Got \" + op + \".\");\n          }\n\n        this.buffer.push(op);\n      }\n\n      this.size = this.buffer.length;\n    }\n\n    patch(position, target) {\n      if (this.buffer[position + 1] === -1) {\n        this.buffer[position + 1] = target;\n      } else {\n        throw new Error('Trying to patch operand in populated slot instead of a reserved slot.');\n      }\n    }\n\n    patchWith(position, target, operand) {\n      if (this.buffer[position + 1] === -1) {\n        this.buffer[position + 1] = target;\n        this.buffer[position + 2] = operand;\n      } else {\n        throw new Error('Trying to patch operand in populated slot instead of a reserved slot.');\n      }\n    }\n\n  }\n\n  _exports.InstructionEncoder = InstructionEncoder;\n});","define(\"@glimmer/low-level\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.Stack = _exports.Storage = void 0;\n\n  class Storage {\n    constructor() {\n      this.array = [];\n      this.next = 0;\n    }\n\n    add(element) {\n      var {\n        next: slot,\n        array\n      } = this;\n\n      if (slot === array.length) {\n        this.next++;\n      } else {\n        var prev = array[slot];\n        this.next = prev;\n      }\n\n      this.array[slot] = element;\n      return slot;\n    }\n\n    deref(pointer) {\n      return this.array[pointer];\n    }\n\n    drop(pointer) {\n      this.array[pointer] = this.next;\n      this.next = pointer;\n    }\n\n  }\n\n  _exports.Storage = Storage;\n\n  class Stack {\n    constructor(vec = []) {\n      this.vec = vec;\n    }\n\n    clone() {\n      return new Stack(this.vec.slice());\n    }\n\n    sliceFrom(start) {\n      return new Stack(this.vec.slice(start));\n    }\n\n    slice(start, end) {\n      return new Stack(this.vec.slice(start, end));\n    }\n\n    copy(from, to) {\n      this.vec[to] = this.vec[from];\n    } // TODO: how to model u64 argument?\n\n\n    writeRaw(pos, value) {\n      // TODO: Grow?\n      this.vec[pos] = value;\n    } // TODO: partially decoded enum?\n\n\n    getRaw(pos) {\n      return this.vec[pos];\n    }\n\n    reset() {\n      this.vec.length = 0;\n    }\n\n    len() {\n      return this.vec.length;\n    }\n\n  }\n\n  _exports.Stack = Stack;\n});","define(\"@glimmer/node\", [\"exports\", \"@glimmer/runtime\"], function (_exports, _runtime) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.serializeBuilder = serializeBuilder;\n  _exports.NodeDOMTreeConstruction = void 0;\n\n  class NodeDOMTreeConstruction extends _runtime.DOMTreeConstruction {\n    constructor(doc) {\n      super(doc);\n    } // override to prevent usage of `this.document` until after the constructor\n\n\n    setupUselessElement() {} // override to avoid SVG detection/work when in node (this is not needed in SSR)\n\n\n    createElement(tag) {\n      return this.document.createElement(tag);\n    } // override to avoid namespace shenanigans when in node (this is not needed in SSR)\n\n\n    setAttribute(element, name, value) {\n      element.setAttribute(name, value);\n    }\n\n  }\n\n  _exports.NodeDOMTreeConstruction = NodeDOMTreeConstruction;\n  var TEXT_NODE = 3;\n\n  function currentNode(cursor) {\n    var {\n      element,\n      nextSibling\n    } = cursor;\n\n    if (nextSibling === null) {\n      return element.lastChild;\n    } else {\n      return nextSibling.previousSibling;\n    }\n  }\n\n  class SerializeBuilder extends _runtime.NewElementBuilder {\n    constructor() {\n      super(...arguments);\n      this.serializeBlockDepth = 0;\n    }\n\n    __openBlock() {\n      var {\n        tagName\n      } = this.element;\n\n      if (tagName !== 'TITLE' && tagName !== 'SCRIPT' && tagName !== 'STYLE') {\n        var depth = this.serializeBlockDepth++;\n\n        this.__appendComment(\"%+b:\" + depth + \"%\");\n      }\n\n      super.__openBlock();\n    }\n\n    __closeBlock() {\n      var {\n        tagName\n      } = this.element;\n\n      super.__closeBlock();\n\n      if (tagName !== 'TITLE' && tagName !== 'SCRIPT' && tagName !== 'STYLE') {\n        var depth = --this.serializeBlockDepth;\n\n        this.__appendComment(\"%-b:\" + depth + \"%\");\n      }\n    }\n\n    __appendHTML(html) {\n      var {\n        tagName\n      } = this.element;\n\n      if (tagName === 'TITLE' || tagName === 'SCRIPT' || tagName === 'STYLE') {\n        return super.__appendHTML(html);\n      } // Do we need to run the html tokenizer here?\n\n\n      var first = this.__appendComment('%glmr%');\n\n      if (tagName === 'TABLE') {\n        var openIndex = html.indexOf('<');\n\n        if (openIndex > -1) {\n          var tr = html.slice(openIndex + 1, openIndex + 3);\n\n          if (tr === 'tr') {\n            html = \"<tbody>\" + html + \"</tbody>\";\n          }\n        }\n      }\n\n      if (html === '') {\n        this.__appendComment('% %');\n      } else {\n        super.__appendHTML(html);\n      }\n\n      var last = this.__appendComment('%glmr%');\n\n      return new _runtime.ConcreteBounds(this.element, first, last);\n    }\n\n    __appendText(string) {\n      var {\n        tagName\n      } = this.element;\n      var current = currentNode(this);\n\n      if (tagName === 'TITLE' || tagName === 'SCRIPT' || tagName === 'STYLE') {\n        return super.__appendText(string);\n      } else if (string === '') {\n        return this.__appendComment('% %');\n      } else if (current && current.nodeType === TEXT_NODE) {\n        this.__appendComment('%|%');\n      }\n\n      return super.__appendText(string);\n    }\n\n    closeElement() {\n      if (this.element['needsExtraClose'] === true) {\n        this.element['needsExtraClose'] = false;\n        super.closeElement();\n      }\n\n      return super.closeElement();\n    }\n\n    openElement(tag) {\n      if (tag === 'tr') {\n        if (this.element.tagName !== 'TBODY' && this.element.tagName !== 'THEAD' && this.element.tagName !== 'TFOOT') {\n          this.openElement('tbody'); // This prevents the closeBlock comment from being re-parented\n          // under the auto inserted tbody. Rehydration builder needs to\n          // account for the insertion since it is injected here and not\n          // really in the template.\n\n          this.constructing['needsExtraClose'] = true;\n          this.flushElement(null);\n        }\n      }\n\n      return super.openElement(tag);\n    }\n\n    pushRemoteElement(element, cursorId, nextSibling = null) {\n      var {\n        dom\n      } = this;\n      var script = dom.createElement('script');\n      script.setAttribute('glmr', cursorId);\n      dom.insertBefore(element, script, nextSibling);\n      super.pushRemoteElement(element, cursorId, nextSibling);\n    }\n\n  }\n\n  function serializeBuilder(env, cursor) {\n    return SerializeBuilder.forInitialRender(env, cursor);\n  }\n});","define(\"@glimmer/opcode-compiler\", [\"exports\", \"@ember/polyfills\", \"@glimmer/util\", \"@glimmer/vm\", \"@glimmer/wire-format\", \"@glimmer/encoder\", \"@glimmer/program\"], function (_exports, _polyfills, _util, _vm, _wireFormat, _encoder, _program) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.compile = compile;\n  _exports.templateFactory = templateFactory;\n  _exports.debug = debug;\n  _exports.debugSlice = debugSlice;\n  _exports.logOpcode = logOpcode;\n  _exports.PLACEHOLDER_HANDLE = _exports.WrappedBuilder = _exports.PartialDefinition = _exports.StdOpcodeBuilder = _exports.OpcodeBuilder = _exports.EagerOpcodeBuilder = _exports.LazyOpcodeBuilder = _exports.CompilableProgram = _exports.CompilableBlock = _exports.debugCompiler = _exports.AbstractCompiler = _exports.LazyCompiler = _exports.Macros = _exports.ATTRS_BLOCK = void 0;\n  var PLACEHOLDER_HANDLE = -1;\n  _exports.PLACEHOLDER_HANDLE = PLACEHOLDER_HANDLE;\n  var Ops$1;\n\n  (function (Ops$$1) {\n    Ops$$1[Ops$$1[\"OpenComponentElement\"] = 0] = \"OpenComponentElement\";\n    Ops$$1[Ops$$1[\"DidCreateElement\"] = 1] = \"DidCreateElement\";\n    Ops$$1[Ops$$1[\"DidRenderLayout\"] = 2] = \"DidRenderLayout\";\n    Ops$$1[Ops$$1[\"Debugger\"] = 3] = \"Debugger\";\n  })(Ops$1 || (Ops$1 = {}));\n\n  var Ops$2 = _wireFormat.Ops;\n  var ATTRS_BLOCK = '&attrs';\n  _exports.ATTRS_BLOCK = ATTRS_BLOCK;\n\n  class Compilers {\n    constructor(offset = 0) {\n      this.offset = offset;\n      this.names = (0, _util.dict)();\n      this.funcs = [];\n    }\n\n    add(name, func) {\n      this.funcs.push(func);\n      this.names[name] = this.funcs.length - 1;\n    }\n\n    compile(sexp, builder) {\n      var name = sexp[this.offset];\n      var index = this.names[name];\n      var func = this.funcs[index];\n      func(sexp, builder);\n    }\n\n  }\n\n  var _statementCompiler;\n\n  function statementCompiler() {\n    if (_statementCompiler) {\n      return _statementCompiler;\n    }\n\n    var STATEMENTS = _statementCompiler = new Compilers();\n    STATEMENTS.add(Ops$2.Text, (sexp, builder) => {\n      builder.text(sexp[1]);\n    });\n    STATEMENTS.add(Ops$2.Comment, (sexp, builder) => {\n      builder.comment(sexp[1]);\n    });\n    STATEMENTS.add(Ops$2.CloseElement, (_sexp, builder) => {\n      builder.closeElement();\n    });\n    STATEMENTS.add(Ops$2.FlushElement, (_sexp, builder) => {\n      builder.flushElement();\n    });\n    STATEMENTS.add(Ops$2.Modifier, (sexp, builder) => {\n      var {\n        referrer\n      } = builder;\n      var [, name, params, hash] = sexp;\n      var handle = builder.compiler.resolveModifier(name, referrer);\n\n      if (handle !== null) {\n        builder.modifier(handle, params, hash);\n      } else {\n        throw new Error(\"Compile Error \" + name + \" is not a modifier: Helpers may not be used in the element form.\");\n      }\n    });\n    STATEMENTS.add(Ops$2.StaticAttr, (sexp, builder) => {\n      var [, name, value, namespace] = sexp;\n      builder.staticAttr(name, namespace, value);\n    });\n    STATEMENTS.add(Ops$2.DynamicAttr, (sexp, builder) => {\n      dynamicAttr(sexp, false, builder);\n    });\n    STATEMENTS.add(Ops$2.ComponentAttr, (sexp, builder) => {\n      componentAttr(sexp, false, builder);\n    });\n    STATEMENTS.add(Ops$2.TrustingAttr, (sexp, builder) => {\n      dynamicAttr(sexp, true, builder);\n    });\n    STATEMENTS.add(Ops$2.TrustingComponentAttr, (sexp, builder) => {\n      componentAttr(sexp, true, builder);\n    });\n    STATEMENTS.add(Ops$2.OpenElement, (sexp, builder) => {\n      var [, tag, simple] = sexp;\n\n      if (!simple) {\n        builder.putComponentOperations();\n      }\n\n      builder.openPrimitiveElement(tag);\n    });\n    STATEMENTS.add(Ops$2.DynamicComponent, (sexp, builder) => {\n      var [, definition, attrs, args, template] = sexp;\n      var block = builder.template(template);\n      var attrsBlock = null;\n\n      if (attrs.length > 0) {\n        attrsBlock = builder.inlineBlock({\n          statements: attrs,\n          parameters: _util.EMPTY_ARRAY\n        });\n      }\n\n      builder.dynamicComponent(definition, attrsBlock, null, args, false, block, null);\n    });\n    STATEMENTS.add(Ops$2.Component, (sexp, builder) => {\n      var [, tag, attrs, args, block] = sexp;\n      var {\n        referrer\n      } = builder;\n      var {\n        handle,\n        capabilities,\n        compilable\n      } = builder.compiler.resolveLayoutForTag(tag, referrer);\n\n      if (handle !== null && capabilities !== null) {\n        var attrsBlock = null;\n\n        if (attrs.length > 0) {\n          attrsBlock = builder.inlineBlock({\n            statements: attrs,\n            parameters: _util.EMPTY_ARRAY\n          });\n        }\n\n        var child = builder.template(block);\n\n        if (compilable) {\n          builder.pushComponentDefinition(handle);\n          builder.invokeStaticComponent(capabilities, compilable, attrsBlock, null, args, false, child && child);\n        } else {\n          builder.pushComponentDefinition(handle);\n          builder.invokeComponent(capabilities, attrsBlock, null, args, false, child && child);\n        }\n      } else {\n        throw new Error(\"Compile Error: Cannot find component \" + tag);\n      }\n    });\n    STATEMENTS.add(Ops$2.Partial, (sexp, builder) => {\n      var [, name, evalInfo] = sexp;\n      var {\n        referrer\n      } = builder;\n      builder.replayableIf({\n        args() {\n          builder.expr(name);\n          builder.dup();\n          return 2;\n        },\n\n        ifTrue() {\n          builder.invokePartial(referrer, builder.evalSymbols(), evalInfo);\n          builder.popScope();\n          builder.popFrame(); // FIXME: WAT\n        }\n\n      });\n    });\n    STATEMENTS.add(Ops$2.Yield, (sexp, builder) => {\n      var [, to, params] = sexp;\n      builder.yield(to, params);\n    });\n    STATEMENTS.add(Ops$2.AttrSplat, (sexp, builder) => {\n      var [, to] = sexp;\n      builder.yield(to, []);\n    });\n    STATEMENTS.add(Ops$2.Debugger, (sexp, builder) => {\n      var [, evalInfo] = sexp;\n      builder.debugger(builder.evalSymbols(), evalInfo);\n    });\n    STATEMENTS.add(Ops$2.ClientSideStatement, (sexp, builder) => {\n      CLIENT_SIDE.compile(sexp, builder);\n    });\n    STATEMENTS.add(Ops$2.Append, (sexp, builder) => {\n      var [, value, trusting] = sexp;\n      var returned = builder.compileInline(sexp) || value;\n      if (returned === true) return;\n      builder.guardedAppend(value, trusting);\n    });\n    STATEMENTS.add(Ops$2.Block, (sexp, builder) => {\n      var [, name, params, hash, _template, _inverse] = sexp;\n      var template = builder.template(_template);\n      var inverse = builder.template(_inverse);\n      var templateBlock = template && template;\n      var inverseBlock = inverse && inverse;\n      builder.compileBlock(name, params, hash, templateBlock, inverseBlock);\n    });\n    var CLIENT_SIDE = new Compilers(1);\n    CLIENT_SIDE.add(Ops$1.OpenComponentElement, (sexp, builder) => {\n      builder.putComponentOperations();\n      builder.openPrimitiveElement(sexp[2]);\n    });\n    CLIENT_SIDE.add(Ops$1.DidCreateElement, (_sexp, builder) => {\n      builder.didCreateElement(_vm.Register.s0);\n    });\n    CLIENT_SIDE.add(Ops$1.Debugger, () => {\n      // tslint:disable-next-line:no-debugger\n      debugger;\n    });\n    CLIENT_SIDE.add(Ops$1.DidRenderLayout, (_sexp, builder) => {\n      builder.didRenderLayout(_vm.Register.s0);\n    });\n    return STATEMENTS;\n  }\n\n  function componentAttr(sexp, trusting, builder) {\n    var [, name, value, namespace] = sexp;\n    builder.expr(value);\n\n    if (namespace) {\n      builder.componentAttr(name, namespace, trusting);\n    } else {\n      builder.componentAttr(name, null, trusting);\n    }\n  }\n\n  function dynamicAttr(sexp, trusting, builder) {\n    var [, name, value, namespace] = sexp;\n    builder.expr(value);\n\n    if (namespace) {\n      builder.dynamicAttr(name, namespace, trusting);\n    } else {\n      builder.dynamicAttr(name, null, trusting);\n    }\n  }\n\n  var _expressionCompiler;\n\n  function expressionCompiler() {\n    if (_expressionCompiler) {\n      return _expressionCompiler;\n    }\n\n    var EXPRESSIONS = _expressionCompiler = new Compilers();\n    EXPRESSIONS.add(Ops$2.Unknown, (sexp, builder) => {\n      var {\n        compiler,\n        referrer,\n        containingLayout: {\n          asPartial\n        }\n      } = builder;\n      var name = sexp[1];\n      var handle = compiler.resolveHelper(name, referrer);\n\n      if (handle !== null) {\n        builder.helper(handle, null, null);\n      } else if (asPartial) {\n        builder.resolveMaybeLocal(name);\n      } else {\n        builder.getVariable(0);\n        builder.getProperty(name);\n      }\n    });\n    EXPRESSIONS.add(Ops$2.Concat, (sexp, builder) => {\n      var parts = sexp[1];\n\n      for (var i = 0; i < parts.length; i++) {\n        builder.expr(parts[i]);\n      }\n\n      builder.concat(parts.length);\n    });\n    EXPRESSIONS.add(Ops$2.Helper, (sexp, builder) => {\n      var {\n        compiler,\n        referrer\n      } = builder;\n      var [, name, params, hash] = sexp; // TODO: triage this in the WF compiler\n\n      if (name === 'component') {\n        var [definition, ...restArgs] = params;\n        builder.curryComponent(definition, restArgs, hash, true);\n        return;\n      }\n\n      var handle = compiler.resolveHelper(name, referrer);\n\n      if (handle !== null) {\n        builder.helper(handle, params, hash);\n      } else {\n        throw new Error(\"Compile Error: \" + name + \" is not a helper\");\n      }\n    });\n    EXPRESSIONS.add(Ops$2.Get, (sexp, builder) => {\n      var [, head, path] = sexp;\n      builder.getVariable(head);\n\n      for (var i = 0; i < path.length; i++) {\n        builder.getProperty(path[i]);\n      }\n    });\n    EXPRESSIONS.add(Ops$2.MaybeLocal, (sexp, builder) => {\n      var [, path] = sexp;\n\n      if (builder.containingLayout.asPartial) {\n        var head = path[0];\n        path = path.slice(1);\n        builder.resolveMaybeLocal(head);\n      } else {\n        builder.getVariable(0);\n      }\n\n      for (var i = 0; i < path.length; i++) {\n        builder.getProperty(path[i]);\n      }\n    });\n    EXPRESSIONS.add(Ops$2.Undefined, (_sexp, builder) => {\n      return builder.pushPrimitiveReference(undefined);\n    });\n    EXPRESSIONS.add(Ops$2.HasBlock, (sexp, builder) => {\n      builder.hasBlock(sexp[1]);\n    });\n    EXPRESSIONS.add(Ops$2.HasBlockParams, (sexp, builder) => {\n      builder.hasBlockParams(sexp[1]);\n    });\n    return EXPRESSIONS;\n  }\n\n  class Macros {\n    constructor() {\n      var {\n        blocks,\n        inlines\n      } = populateBuiltins();\n      this.blocks = blocks;\n      this.inlines = inlines;\n    }\n\n  }\n\n  _exports.Macros = Macros;\n\n  class Blocks {\n    constructor() {\n      this.names = (0, _util.dict)();\n      this.funcs = [];\n    }\n\n    add(name, func) {\n      this.funcs.push(func);\n      this.names[name] = this.funcs.length - 1;\n    }\n\n    addMissing(func) {\n      this.missing = func;\n    }\n\n    compile(name, params, hash, template, inverse, builder) {\n      var index = this.names[name];\n\n      if (index === undefined) {\n        var func = this.missing;\n        var handled = func(name, params, hash, template, inverse, builder);\n      } else {\n        var _func = this.funcs[index];\n\n        _func(params, hash, template, inverse, builder);\n      }\n    }\n\n  }\n\n  class Inlines {\n    constructor() {\n      this.names = (0, _util.dict)();\n      this.funcs = [];\n    }\n\n    add(name, func) {\n      this.funcs.push(func);\n      this.names[name] = this.funcs.length - 1;\n    }\n\n    addMissing(func) {\n      this.missing = func;\n    }\n\n    compile(sexp, builder) {\n      var value = sexp[1]; // TODO: Fix this so that expression macros can return\n      // things like components, so that {{component foo}}\n      // is the same as {{(component foo)}}\n\n      if (!Array.isArray(value)) return ['expr', value];\n      var name;\n      var params;\n      var hash;\n\n      if (value[0] === Ops$2.Helper) {\n        name = value[1];\n        params = value[2];\n        hash = value[3];\n      } else if (value[0] === Ops$2.Unknown) {\n        name = value[1];\n        params = hash = null;\n      } else {\n        return ['expr', value];\n      }\n\n      var index = this.names[name];\n\n      if (index === undefined && this.missing) {\n        var func = this.missing;\n        var returned = func(name, params, hash, builder);\n        return returned === false ? ['expr', value] : returned;\n      } else if (index !== undefined) {\n        var _func2 = this.funcs[index];\n\n        var _returned = _func2(name, params, hash, builder);\n\n        return _returned === false ? ['expr', value] : _returned;\n      } else {\n        return ['expr', value];\n      }\n    }\n\n  }\n\n  function populateBuiltins(blocks = new Blocks(), inlines = new Inlines()) {\n    blocks.add('if', (params, _hash, template, inverse, builder) => {\n      //        PutArgs\n      //        Test(Environment)\n      //        Enter(BEGIN, END)\n      // BEGIN: Noop\n      //        JumpUnless(ELSE)\n      //        Evaluate(default)\n      //        Jump(END)\n      // ELSE:  Noop\n      //        Evalulate(inverse)\n      // END:   Noop\n      //        Exit\n      if (!params || params.length !== 1) {\n        throw new Error(\"SYNTAX ERROR: #if requires a single argument\");\n      }\n\n      builder.replayableIf({\n        args() {\n          builder.expr(params[0]);\n          builder.toBoolean();\n          return 1;\n        },\n\n        ifTrue() {\n          builder.invokeStaticBlock(template);\n        },\n\n        ifFalse() {\n          if (inverse) {\n            builder.invokeStaticBlock(inverse);\n          }\n        }\n\n      });\n    });\n    blocks.add('unless', (params, _hash, template, inverse, builder) => {\n      //        PutArgs\n      //        Test(Environment)\n      //        Enter(BEGIN, END)\n      // BEGIN: Noop\n      //        JumpUnless(ELSE)\n      //        Evaluate(default)\n      //        Jump(END)\n      // ELSE:  Noop\n      //        Evalulate(inverse)\n      // END:   Noop\n      //        Exit\n      if (!params || params.length !== 1) {\n        throw new Error(\"SYNTAX ERROR: #unless requires a single argument\");\n      }\n\n      builder.replayableIf({\n        args() {\n          builder.expr(params[0]);\n          builder.toBoolean();\n          return 1;\n        },\n\n        ifTrue() {\n          if (inverse) {\n            builder.invokeStaticBlock(inverse);\n          }\n        },\n\n        ifFalse() {\n          builder.invokeStaticBlock(template);\n        }\n\n      });\n    });\n    blocks.add('with', (params, _hash, template, inverse, builder) => {\n      //        PutArgs\n      //        Test(Environment)\n      //        Enter(BEGIN, END)\n      // BEGIN: Noop\n      //        JumpUnless(ELSE)\n      //        Evaluate(default)\n      //        Jump(END)\n      // ELSE:  Noop\n      //        Evalulate(inverse)\n      // END:   Noop\n      //        Exit\n      if (!params || params.length !== 1) {\n        throw new Error(\"SYNTAX ERROR: #with requires a single argument\");\n      }\n\n      builder.replayableIf({\n        args() {\n          builder.expr(params[0]);\n          builder.dup();\n          builder.toBoolean();\n          return 2;\n        },\n\n        ifTrue() {\n          builder.invokeStaticBlock(template, 1);\n        },\n\n        ifFalse() {\n          if (inverse) {\n            builder.invokeStaticBlock(inverse);\n          }\n        }\n\n      });\n    });\n    blocks.add('each', (params, hash, template, inverse, builder) => {\n      //         Enter(BEGIN, END)\n      // BEGIN:  Noop\n      //         PutArgs\n      //         PutIterable\n      //         JumpUnless(ELSE)\n      //         EnterList(BEGIN2, END2)\n      // ITER:   Noop\n      //         NextIter(BREAK)\n      // BEGIN2: Noop\n      //         PushChildScope\n      //         Evaluate(default)\n      //         PopScope\n      // END2:   Noop\n      //         Exit\n      //         Jump(ITER)\n      // BREAK:  Noop\n      //         ExitList\n      //         Jump(END)\n      // ELSE:   Noop\n      //         Evalulate(inverse)\n      // END:    Noop\n      //         Exit\n      builder.replayable({\n        args() {\n          if (hash && hash[0][0] === 'key') {\n            builder.expr(hash[1][0]);\n          } else {\n            builder.pushPrimitiveReference(null);\n          }\n\n          builder.expr(params[0]);\n          return 2;\n        },\n\n        body() {\n          builder.putIterator();\n          builder.jumpUnless('ELSE');\n          builder.pushFrame();\n          builder.dup(_vm.Register.fp, 1);\n          builder.returnTo('ITER');\n          builder.enterList('BODY');\n          builder.label('ITER');\n          builder.iterate('BREAK');\n          builder.label('BODY');\n          builder.invokeStaticBlock(template, 2);\n          builder.pop(2);\n          builder.jump('FINALLY');\n          builder.label('BREAK');\n          builder.exitList();\n          builder.popFrame();\n          builder.jump('FINALLY');\n          builder.label('ELSE');\n\n          if (inverse) {\n            builder.invokeStaticBlock(inverse);\n          }\n        }\n\n      });\n    });\n    blocks.add('in-element', (params, hash, template, _inverse, builder) => {\n      if (!params || params.length !== 1) {\n        throw new Error(\"SYNTAX ERROR: #in-element requires a single argument\");\n      }\n\n      builder.replayableIf({\n        args() {\n          var [keys, values] = hash;\n\n          for (var i = 0; i < keys.length; i++) {\n            var key = keys[i];\n\n            if (key === 'nextSibling' || key === 'guid') {\n              builder.expr(values[i]);\n            } else {\n              throw new Error(\"SYNTAX ERROR: #in-element does not take a `\" + keys[0] + \"` option\");\n            }\n          }\n\n          builder.expr(params[0]);\n          builder.dup();\n          return 4;\n        },\n\n        ifTrue() {\n          builder.pushRemoteElement();\n          builder.invokeStaticBlock(template);\n          builder.popRemoteElement();\n        }\n\n      });\n    });\n    blocks.add('-with-dynamic-vars', (_params, hash, template, _inverse, builder) => {\n      if (hash) {\n        var [names, expressions] = hash;\n        builder.compileParams(expressions);\n        builder.pushDynamicScope();\n        builder.bindDynamicScope(names);\n        builder.invokeStaticBlock(template);\n        builder.popDynamicScope();\n      } else {\n        builder.invokeStaticBlock(template);\n      }\n    });\n    blocks.add('component', (_params, hash, template, inverse, builder) => {\n      var tag = _params[0];\n\n      if (typeof tag === 'string') {\n        var returned = builder.staticComponentHelper(_params[0], hash, template);\n        if (returned) return;\n      }\n\n      var [definition, ...params] = _params;\n      builder.dynamicComponent(definition, null, params, hash, true, template, inverse);\n    });\n    inlines.add('component', (_name, _params, hash, builder) => {\n      var tag = _params && _params[0];\n\n      if (typeof tag === 'string') {\n        var returned = builder.staticComponentHelper(tag, hash, null);\n        if (returned) return true;\n      }\n\n      var [definition, ...params] = _params;\n      builder.dynamicComponent(definition, null, params, hash, true, null, null);\n      return true;\n    });\n    return {\n      blocks,\n      inlines\n    };\n  }\n\n  var PLACEHOLDER_HANDLE$1 = -1;\n\n  class CompilableProgram {\n    constructor(compiler, layout) {\n      this.compiler = compiler;\n      this.layout = layout;\n      this.compiled = null;\n    }\n\n    get symbolTable() {\n      return this.layout.block;\n    }\n\n    compile() {\n      if (this.compiled !== null) return this.compiled;\n      this.compiled = PLACEHOLDER_HANDLE$1;\n      var {\n        block: {\n          statements\n        }\n      } = this.layout;\n      return this.compiled = this.compiler.add(statements, this.layout);\n    }\n\n  }\n\n  _exports.CompilableProgram = CompilableProgram;\n\n  class CompilableBlock {\n    constructor(compiler, parsed) {\n      this.compiler = compiler;\n      this.parsed = parsed;\n      this.compiled = null;\n    }\n\n    get symbolTable() {\n      return this.parsed.block;\n    }\n\n    compile() {\n      if (this.compiled !== null) return this.compiled; // Track that compilation has started but not yet finished by temporarily\n      // using a placeholder handle. In eager compilation mode, where compile()\n      // may be called recursively, we use this as a signal that the handle cannot\n      // be known synchronously and must be linked lazily.\n\n      this.compiled = PLACEHOLDER_HANDLE$1;\n      var {\n        block: {\n          statements\n        },\n        containingLayout\n      } = this.parsed;\n      return this.compiled = this.compiler.add(statements, containingLayout);\n    }\n\n  }\n\n  _exports.CompilableBlock = CompilableBlock;\n\n  function compile(statements, builder, compiler) {\n    var sCompiler = statementCompiler();\n\n    for (var i = 0; i < statements.length; i++) {\n      sCompiler.compile(statements[i], builder);\n    }\n\n    var handle = builder.commit();\n    return handle;\n  }\n\n  function debugSlice(program, start, end) {}\n\n  function logOpcode(type, params) {\n    var out = type;\n\n    if (params) {\n      var args = Object.keys(params).map(p => \" \" + p + \"=\" + json(params[p])).join('');\n      out += args;\n    }\n\n    return \"(\" + out + \")\";\n  }\n\n  function json(param) {}\n\n  function debug(pos, c, op, ...operands) {\n    var metadata = null;\n\n    if (!metadata) {\n      throw (0, _util.unreachable)(\"Missing Opcode Metadata for \" + op);\n    }\n\n    var out = (0, _util.dict)();\n    metadata.ops.forEach((operand, index) => {\n      var op = operands[index];\n\n      switch (operand.type) {\n        case 'to':\n          out[operand.name] = pos + op;\n          break;\n\n        case 'i32':\n        case 'symbol':\n        case 'block':\n          out[operand.name] = op;\n          break;\n\n        case 'handle':\n          out[operand.name] = c.resolveHandle(op);\n          break;\n\n        case 'str':\n          out[operand.name] = c.getString(op);\n          break;\n\n        case 'option-str':\n          out[operand.name] = op ? c.getString(op) : null;\n          break;\n\n        case 'str-array':\n          out[operand.name] = c.getStringArray(op);\n          break;\n\n        case 'array':\n          out[operand.name] = c.getArray(op);\n          break;\n\n        case 'bool':\n          out[operand.name] = !!op;\n          break;\n\n        case 'primitive':\n          out[operand.name] = decodePrimitive(op, c);\n          break;\n\n        case 'register':\n          out[operand.name] = _vm.Register[op];\n          break;\n\n        case 'serializable':\n          out[operand.name] = c.getSerializable(op);\n          break;\n\n        case 'lazy-constant':\n          out[operand.name] = c.getOther(op);\n          break;\n      }\n    });\n    return [metadata.name, out];\n  }\n\n  function decodePrimitive(primitive, constants) {\n    var flag = primitive & 7; // 111\n\n    var value = primitive >> 3;\n\n    switch (flag) {\n      case 0\n      /* NUMBER */\n      :\n        return value;\n\n      case 1\n      /* FLOAT */\n      :\n        return constants.getNumber(value);\n\n      case 2\n      /* STRING */\n      :\n        return constants.getString(value);\n\n      case 3\n      /* BOOLEAN_OR_VOID */\n      :\n        switch (value) {\n          case 0:\n            return false;\n\n          case 1:\n            return true;\n\n          case 2:\n            return null;\n\n          case 3:\n            return undefined;\n        }\n\n      case 4\n      /* NEGATIVE */\n      :\n      case 5\n      /* BIG_NUM */\n      :\n        return constants.getNumber(value);\n\n      default:\n        throw (0, _util.unreachable)();\n    }\n  }\n\n  class StdLib {\n    constructor(main, trustingGuardedAppend, cautiousGuardedAppend) {\n      this.main = main;\n      this.trustingGuardedAppend = trustingGuardedAppend;\n      this.cautiousGuardedAppend = cautiousGuardedAppend;\n    }\n\n    static compile(compiler) {\n      var main = this.std(compiler, b => b.main());\n      var trustingGuardedAppend = this.std(compiler, b => b.stdAppend(true));\n      var cautiousGuardedAppend = this.std(compiler, b => b.stdAppend(false));\n      return new StdLib(main, trustingGuardedAppend, cautiousGuardedAppend);\n    }\n\n    static std(compiler, callback) {\n      return StdOpcodeBuilder.build(compiler, callback);\n    }\n\n    getAppend(trusting) {\n      return trusting ? this.trustingGuardedAppend : this.cautiousGuardedAppend;\n    }\n\n  }\n\n  class AbstractCompiler {\n    constructor(macros, program, resolver) {\n      this.macros = macros;\n      this.program = program;\n      this.resolver = resolver;\n      this.initialize();\n    }\n\n    initialize() {\n      this.stdLib = StdLib.compile(this);\n    }\n\n    get constants() {\n      return this.program.constants;\n    }\n\n    compileInline(sexp, builder) {\n      var {\n        inlines\n      } = this.macros;\n      return inlines.compile(sexp, builder);\n    }\n\n    compileBlock(name, params, hash, template, inverse, builder) {\n      var {\n        blocks\n      } = this.macros;\n      blocks.compile(name, params, hash, template, inverse, builder);\n    }\n\n    add(statements, containingLayout) {\n      return compile(statements, this.builderFor(containingLayout), this);\n    }\n\n    commit(scopeSize, buffer) {\n      var heap = this.program.heap; // TODO: change the whole malloc API and do something more efficient\n\n      var handle = heap.malloc();\n\n      for (var i = 0; i < buffer.length; i++) {\n        var value = buffer[i];\n\n        if (typeof value === 'function') {\n          heap.pushPlaceholder(value);\n        } else {\n          heap.push(value);\n        }\n      }\n\n      heap.finishMalloc(handle, scopeSize);\n      return handle;\n    }\n\n    resolveLayoutForTag(tag, referrer) {\n      var {\n        resolver\n      } = this;\n      var handle = resolver.lookupComponentDefinition(tag, referrer);\n      if (handle === null) return {\n        handle: null,\n        capabilities: null,\n        compilable: null\n      };\n      return this.resolveLayoutForHandle(handle);\n    }\n\n    resolveLayoutForHandle(handle) {\n      var {\n        resolver\n      } = this;\n      var capabilities = resolver.getCapabilities(handle);\n      var compilable = null;\n\n      if (!capabilities.dynamicLayout) {\n        compilable = resolver.getLayout(handle);\n      }\n\n      return {\n        handle,\n        capabilities,\n        compilable\n      };\n    }\n\n    resolveModifier(name, referrer) {\n      return this.resolver.lookupModifier(name, referrer);\n    }\n\n    resolveHelper(name, referrer) {\n      return this.resolver.lookupHelper(name, referrer);\n    }\n\n  }\n\n  _exports.AbstractCompiler = AbstractCompiler;\n  var debugCompiler;\n  _exports.debugCompiler = debugCompiler;\n\n  class WrappedBuilder {\n    constructor(compiler, layout) {\n      this.compiler = compiler;\n      this.layout = layout;\n      this.compiled = null;\n      var {\n        block\n      } = layout;\n      var symbols = block.symbols.slice(); // ensure ATTRS_BLOCK is always included (only once) in the list of symbols\n\n      var attrsBlockIndex = symbols.indexOf(ATTRS_BLOCK);\n\n      if (attrsBlockIndex === -1) {\n        this.attrsBlockNumber = symbols.push(ATTRS_BLOCK);\n      } else {\n        this.attrsBlockNumber = attrsBlockIndex + 1;\n      }\n\n      this.symbolTable = {\n        hasEval: block.hasEval,\n        symbols\n      };\n    }\n\n    compile() {\n      if (this.compiled !== null) return this.compiled; //========DYNAMIC\n      //        PutValue(TagExpr)\n      //        Test\n      //        JumpUnless(BODY)\n      //        PutComponentOperations\n      //        OpenDynamicPrimitiveElement\n      //        DidCreateElement\n      //        ...attr statements...\n      //        FlushElement\n      // BODY:  Noop\n      //        ...body statements...\n      //        PutValue(TagExpr)\n      //        Test\n      //        JumpUnless(END)\n      //        CloseElement\n      // END:   Noop\n      //        DidRenderLayout\n      //        Exit\n      //\n      //========STATIC\n      //        OpenPrimitiveElementOpcode\n      //        DidCreateElement\n      //        ...attr statements...\n      //        FlushElement\n      //        ...body statements...\n      //        CloseElement\n      //        DidRenderLayout\n      //        Exit\n\n      var {\n        compiler,\n        layout\n      } = this;\n      var b = compiler.builderFor(layout);\n      b.startLabels();\n      b.fetch(_vm.Register.s1);\n      b.getComponentTagName(_vm.Register.s0);\n      b.primitiveReference();\n      b.dup();\n      b.load(_vm.Register.s1);\n      b.jumpUnless('BODY');\n      b.fetch(_vm.Register.s1);\n      b.putComponentOperations();\n      b.openDynamicElement();\n      b.didCreateElement(_vm.Register.s0);\n      b.yield(this.attrsBlockNumber, []);\n      b.flushElement();\n      b.label('BODY');\n      b.invokeStaticBlock(blockFor(layout, compiler));\n      b.fetch(_vm.Register.s1);\n      b.jumpUnless('END');\n      b.closeElement();\n      b.label('END');\n      b.load(_vm.Register.s1);\n      b.stopLabels();\n      var handle = b.commit();\n      return this.compiled = handle;\n    }\n\n  }\n\n  _exports.WrappedBuilder = WrappedBuilder;\n\n  function blockFor(layout, compiler) {\n    return new CompilableBlock(compiler, {\n      block: {\n        statements: layout.block.statements,\n        parameters: _util.EMPTY_ARRAY\n      },\n      containingLayout: layout\n    });\n  }\n\n  class ComponentBuilder {\n    constructor(builder) {\n      this.builder = builder;\n    }\n\n    static(handle, args) {\n      var [params, hash, _default, inverse] = args;\n      var {\n        builder\n      } = this;\n\n      if (handle !== null) {\n        var {\n          capabilities,\n          compilable\n        } = builder.compiler.resolveLayoutForHandle(handle);\n\n        if (compilable) {\n          builder.pushComponentDefinition(handle);\n          builder.invokeStaticComponent(capabilities, compilable, null, params, hash, false, _default, inverse);\n        } else {\n          builder.pushComponentDefinition(handle);\n          builder.invokeComponent(capabilities, null, params, hash, false, _default, inverse);\n        }\n      }\n    }\n\n  }\n\n  class Labels {\n    constructor() {\n      this.labels = (0, _util.dict)();\n      this.targets = [];\n    }\n\n    label(name, index) {\n      this.labels[name] = index;\n    }\n\n    target(at, target) {\n      this.targets.push({\n        at,\n        target\n      });\n    }\n\n    patch(encoder) {\n      var {\n        targets,\n        labels\n      } = this;\n\n      for (var i = 0; i < targets.length; i++) {\n        var {\n          at,\n          target\n        } = targets[i];\n        var address = labels[target] - at;\n        encoder.patch(at, address);\n      }\n    }\n\n  }\n\n  class StdOpcodeBuilder {\n    constructor(compiler, size = 0) {\n      this.size = size;\n      this.encoder = new _encoder.InstructionEncoder([]);\n      this.labelsStack = new _util.Stack();\n      this.compiler = compiler;\n    }\n\n    static build(compiler, callback) {\n      var builder = new StdOpcodeBuilder(compiler);\n      callback(builder);\n      return builder.commit();\n    }\n\n    push(name) {\n      switch (arguments.length) {\n        case 1:\n          return this.encoder.encode(name, 0);\n\n        case 2:\n          return this.encoder.encode(name, 0, arguments[1]);\n\n        case 3:\n          return this.encoder.encode(name, 0, arguments[1], arguments[2]);\n\n        default:\n          return this.encoder.encode(name, 0, arguments[1], arguments[2], arguments[3]);\n      }\n    }\n\n    pushMachine(name) {\n      switch (arguments.length) {\n        case 1:\n          return this.encoder.encode(name, 1024\n          /* MACHINE_MASK */\n          );\n\n        case 2:\n          return this.encoder.encode(name, 1024\n          /* MACHINE_MASK */\n          , arguments[1]);\n\n        case 3:\n          return this.encoder.encode(name, 1024\n          /* MACHINE_MASK */\n          , arguments[1], arguments[2]);\n\n        default:\n          return this.encoder.encode(name, 1024\n          /* MACHINE_MASK */\n          , arguments[1], arguments[2], arguments[3]);\n      }\n    }\n\n    commit() {\n      this.pushMachine(24\n      /* Return */\n      );\n      return this.compiler.commit(this.size, this.encoder.buffer);\n    }\n\n    reserve(name) {\n      this.encoder.encode(name, 0, -1);\n    }\n\n    reserveWithOperand(name, operand) {\n      this.encoder.encode(name, 0, -1, operand);\n    }\n\n    reserveMachine(name) {\n      this.encoder.encode(name, 1024\n      /* MACHINE_MASK */\n      , -1);\n    } ///\n\n\n    main() {\n      this.push(68\n      /* Main */\n      , _vm.Register.s0);\n      this.invokePreparedComponent(false, false, true);\n    }\n\n    appendHTML() {\n      this.push(28\n      /* AppendHTML */\n      );\n    }\n\n    appendSafeHTML() {\n      this.push(29\n      /* AppendSafeHTML */\n      );\n    }\n\n    appendDocumentFragment() {\n      this.push(30\n      /* AppendDocumentFragment */\n      );\n    }\n\n    appendNode() {\n      this.push(31\n      /* AppendNode */\n      );\n    }\n\n    appendText() {\n      this.push(32\n      /* AppendText */\n      );\n    }\n\n    beginComponentTransaction() {\n      this.push(91\n      /* BeginComponentTransaction */\n      );\n    }\n\n    commitComponentTransaction() {\n      this.push(92\n      /* CommitComponentTransaction */\n      );\n    }\n\n    pushDynamicScope() {\n      this.push(44\n      /* PushDynamicScope */\n      );\n    }\n\n    popDynamicScope() {\n      this.push(45\n      /* PopDynamicScope */\n      );\n    }\n\n    pushRemoteElement() {\n      this.push(41\n      /* PushRemoteElement */\n      );\n    }\n\n    popRemoteElement() {\n      this.push(42\n      /* PopRemoteElement */\n      );\n    }\n\n    pushRootScope(symbols, bindCallerScope) {\n      this.push(20\n      /* RootScope */\n      , symbols, bindCallerScope ? 1 : 0);\n    }\n\n    pushVirtualRootScope(register) {\n      this.push(21\n      /* VirtualRootScope */\n      , register);\n    }\n\n    pushChildScope() {\n      this.push(22\n      /* ChildScope */\n      );\n    }\n\n    popScope() {\n      this.push(23\n      /* PopScope */\n      );\n    }\n\n    prepareArgs(state) {\n      this.push(79\n      /* PrepareArgs */\n      , state);\n    }\n\n    createComponent(state, hasDefault) {\n      var flag = hasDefault | 0;\n      this.push(81\n      /* CreateComponent */\n      , flag, state);\n    }\n\n    registerComponentDestructor(state) {\n      this.push(82\n      /* RegisterComponentDestructor */\n      , state);\n    }\n\n    putComponentOperations() {\n      this.push(83\n      /* PutComponentOperations */\n      );\n    }\n\n    getComponentSelf(state) {\n      this.push(84\n      /* GetComponentSelf */\n      , state);\n    }\n\n    getComponentTagName(state) {\n      this.push(85\n      /* GetComponentTagName */\n      , state);\n    }\n\n    getComponentLayout(state) {\n      this.push(86\n      /* GetComponentLayout */\n      , state);\n    }\n\n    setupForEval(state) {\n      this.push(87\n      /* SetupForEval */\n      , state);\n    }\n\n    invokeComponentLayout(state) {\n      this.push(90\n      /* InvokeComponentLayout */\n      , state);\n    }\n\n    didCreateElement(state) {\n      this.push(93\n      /* DidCreateElement */\n      , state);\n    }\n\n    didRenderLayout(state) {\n      this.push(94\n      /* DidRenderLayout */\n      , state);\n    }\n\n    pushFrame() {\n      this.pushMachine(57\n      /* PushFrame */\n      );\n    }\n\n    popFrame() {\n      this.pushMachine(58\n      /* PopFrame */\n      );\n    }\n\n    pushSmallFrame() {\n      this.pushMachine(59\n      /* PushSmallFrame */\n      );\n    }\n\n    popSmallFrame() {\n      this.pushMachine(60\n      /* PopSmallFrame */\n      );\n    }\n\n    invokeVirtual() {\n      this.pushMachine(49\n      /* InvokeVirtual */\n      );\n    }\n\n    invokeYield() {\n      this.push(51\n      /* InvokeYield */\n      );\n    }\n\n    toBoolean() {\n      this.push(63\n      /* ToBoolean */\n      );\n    }\n\n    invokePreparedComponent(hasBlock, bindableBlocks, bindableAtNames, populateLayout = null) {\n      this.beginComponentTransaction();\n      this.pushDynamicScope();\n      this.createComponent(_vm.Register.s0, hasBlock); // this has to run after createComponent to allow\n      // for late-bound layouts, but a caller is free\n      // to populate the layout earlier if it wants to\n      // and do nothing here.\n\n      if (populateLayout) populateLayout();\n      this.registerComponentDestructor(_vm.Register.s0);\n      this.getComponentSelf(_vm.Register.s0);\n      this.pushVirtualRootScope(_vm.Register.s0);\n      this.setVariable(0);\n      this.setupForEval(_vm.Register.s0);\n      if (bindableAtNames) this.setNamedVariables(_vm.Register.s0);\n      if (bindableBlocks) this.setBlocks(_vm.Register.s0);\n      this.pop();\n      this.invokeComponentLayout(_vm.Register.s0);\n      this.didRenderLayout(_vm.Register.s0);\n      this.popFrame();\n      this.popScope();\n      this.popDynamicScope();\n      this.commitComponentTransaction();\n    }\n\n    get pos() {\n      return this.encoder.typePos;\n    }\n\n    get nextPos() {\n      return this.encoder.size;\n    } ///\n\n\n    compileInline(sexp) {\n      return this.compiler.compileInline(sexp, this);\n    }\n\n    compileBlock(name, params, hash, template, inverse) {\n      this.compiler.compileBlock(name, params, hash, template, inverse, this);\n    }\n\n    label(name) {\n      this.labels.label(name, this.nextPos);\n    } // helpers\n\n\n    get labels() {\n      return this.labelsStack.current;\n    }\n\n    startLabels() {\n      this.labelsStack.push(new Labels());\n    }\n\n    stopLabels() {\n      var label = this.labelsStack.pop();\n      label.patch(this.encoder);\n    } // components\n\n\n    pushCurriedComponent() {\n      this.push(74\n      /* PushCurriedComponent */\n      );\n    }\n\n    pushDynamicComponentInstance() {\n      this.push(73\n      /* PushDynamicComponentInstance */\n      );\n    } // dom\n\n\n    openDynamicElement() {\n      this.push(34\n      /* OpenDynamicElement */\n      );\n    }\n\n    flushElement() {\n      this.push(38\n      /* FlushElement */\n      );\n    }\n\n    closeElement() {\n      this.push(39\n      /* CloseElement */\n      );\n    } // lists\n\n\n    putIterator() {\n      this.push(66\n      /* PutIterator */\n      );\n    }\n\n    enterList(start) {\n      this.reserve(64\n      /* EnterList */\n      );\n      this.labels.target(this.pos, start);\n    }\n\n    exitList() {\n      this.push(65\n      /* ExitList */\n      );\n    }\n\n    iterate(breaks) {\n      this.reserve(67\n      /* Iterate */\n      );\n      this.labels.target(this.pos, breaks);\n    } // expressions\n\n\n    setNamedVariables(state) {\n      this.push(2\n      /* SetNamedVariables */\n      , state);\n    }\n\n    setBlocks(state) {\n      this.push(3\n      /* SetBlocks */\n      , state);\n    }\n\n    setVariable(symbol) {\n      this.push(4\n      /* SetVariable */\n      , symbol);\n    }\n\n    setBlock(symbol) {\n      this.push(5\n      /* SetBlock */\n      , symbol);\n    }\n\n    getVariable(symbol) {\n      this.push(6\n      /* GetVariable */\n      , symbol);\n    }\n\n    getBlock(symbol) {\n      this.push(8\n      /* GetBlock */\n      , symbol);\n    }\n\n    hasBlock(symbol) {\n      this.push(9\n      /* HasBlock */\n      , symbol);\n    }\n\n    concat(size) {\n      this.push(11\n      /* Concat */\n      , size);\n    }\n\n    load(register) {\n      this.push(18\n      /* Load */\n      , register);\n    }\n\n    fetch(register) {\n      this.push(19\n      /* Fetch */\n      , register);\n    }\n\n    dup(register = _vm.Register.sp, offset = 0) {\n      return this.push(16\n      /* Dup */\n      , register, offset);\n    }\n\n    pop(count = 1) {\n      return this.push(17\n      /* Pop */\n      , count);\n    } // vm\n\n\n    returnTo(label) {\n      this.reserveMachine(25\n      /* ReturnTo */\n      );\n      this.labels.target(this.pos, label);\n    }\n\n    primitiveReference() {\n      this.push(14\n      /* PrimitiveReference */\n      );\n    }\n\n    reifyU32() {\n      this.push(15\n      /* ReifyU32 */\n      );\n    }\n\n    enter(args) {\n      this.push(61\n      /* Enter */\n      , args);\n    }\n\n    exit() {\n      this.push(62\n      /* Exit */\n      );\n    }\n\n    return() {\n      this.pushMachine(24\n      /* Return */\n      );\n    }\n\n    jump(target) {\n      this.reserveMachine(52\n      /* Jump */\n      );\n      this.labels.target(this.pos, target);\n    }\n\n    jumpIf(target) {\n      this.reserve(53\n      /* JumpIf */\n      );\n      this.labels.target(this.pos, target);\n    }\n\n    jumpUnless(target) {\n      this.reserve(54\n      /* JumpUnless */\n      );\n      this.labels.target(this.pos, target);\n    }\n\n    jumpEq(value, target) {\n      this.reserveWithOperand(55\n      /* JumpEq */\n      , value);\n      this.labels.target(this.pos, target);\n    }\n\n    assertSame() {\n      this.push(56\n      /* AssertSame */\n      );\n    }\n\n    pushEmptyArgs() {\n      this.push(77\n      /* PushEmptyArgs */\n      );\n    }\n\n    switch(_opcode, callback) {\n      // Setup the switch DSL\n      var clauses = [];\n      var count = 0;\n\n      function when(match, callback) {\n        clauses.push({\n          match,\n          callback,\n          label: \"CLAUSE\" + count++\n        });\n      } // Call the callback\n\n\n      callback(when); // Emit the opcodes for the switch\n\n      this.enter(2);\n      this.assertSame();\n      this.reifyU32();\n      this.startLabels(); // First, emit the jump opcodes. We don't need a jump for the last\n      // opcode, since it bleeds directly into its clause.\n\n      clauses.slice(0, -1).forEach(clause => this.jumpEq(clause.match, clause.label)); // Enumerate the clauses in reverse order. Earlier matches will\n      // require fewer checks.\n\n      for (var i = clauses.length - 1; i >= 0; i--) {\n        var clause = clauses[i];\n        this.label(clause.label);\n        this.pop(2);\n        clause.callback(); // The first match is special: it is placed directly before the END\n        // label, so no additional jump is needed at the end of it.\n\n        if (i !== 0) {\n          this.jump('END');\n        }\n      }\n\n      this.label('END');\n      this.stopLabels();\n      this.exit();\n    }\n\n    stdAppend(trusting) {\n      this.switch(this.contentType(), when => {\n        when(1\n        /* String */\n        , () => {\n          if (trusting) {\n            this.assertSame();\n            this.appendHTML();\n          } else {\n            this.appendText();\n          }\n        });\n        when(0\n        /* Component */\n        , () => {\n          this.pushCurriedComponent();\n          this.pushDynamicComponentInstance();\n          this.invokeBareComponent();\n        });\n        when(3\n        /* SafeString */\n        , () => {\n          this.assertSame();\n          this.appendSafeHTML();\n        });\n        when(4\n        /* Fragment */\n        , () => {\n          this.assertSame();\n          this.appendDocumentFragment();\n        });\n        when(5\n        /* Node */\n        , () => {\n          this.assertSame();\n          this.appendNode();\n        });\n      });\n    }\n\n    populateLayout(state) {\n      this.push(89\n      /* PopulateLayout */\n      , state);\n    }\n\n    invokeBareComponent() {\n      this.fetch(_vm.Register.s0);\n      this.dup(_vm.Register.sp, 1);\n      this.load(_vm.Register.s0);\n      this.pushFrame();\n      this.pushEmptyArgs();\n      this.prepareArgs(_vm.Register.s0);\n      this.invokePreparedComponent(false, false, true, () => {\n        this.getComponentLayout(_vm.Register.s0);\n        this.populateLayout(_vm.Register.s0);\n      });\n      this.load(_vm.Register.s0);\n    }\n\n    isComponent() {\n      this.push(69\n      /* IsComponent */\n      );\n    }\n\n    contentType() {\n      this.push(70\n      /* ContentType */\n      );\n    }\n\n    pushBlockScope() {\n      this.push(47\n      /* PushBlockScope */\n      );\n    }\n\n  }\n\n  _exports.StdOpcodeBuilder = StdOpcodeBuilder;\n\n  class OpcodeBuilder extends StdOpcodeBuilder {\n    constructor(compiler, containingLayout) {\n      super(compiler, containingLayout ? containingLayout.block.symbols.length : 0);\n      this.containingLayout = containingLayout;\n      this.component = new ComponentBuilder(this);\n      this.expressionCompiler = expressionCompiler();\n      this.constants = compiler.constants;\n      this.stdLib = compiler.stdLib;\n    } /// MECHANICS\n\n\n    get referrer() {\n      return this.containingLayout && this.containingLayout.referrer;\n    }\n\n    expr(expression) {\n      if (Array.isArray(expression)) {\n        this.expressionCompiler.compile(expression, this);\n      } else {\n        this.pushPrimitiveReference(expression);\n      }\n    } ///\n    // args\n\n\n    pushArgs(names, flags) {\n      var serialized = this.constants.stringArray(names);\n      this.push(76\n      /* PushArgs */\n      , serialized, flags);\n    }\n\n    pushYieldableBlock(block) {\n      this.pushSymbolTable(block && block.symbolTable);\n      this.pushBlockScope();\n      this.pushBlock(block);\n    }\n\n    curryComponent(definition,\n    /* TODO: attrs: Option<RawInlineBlock>, */\n    params, hash, synthetic) {\n      var referrer = this.containingLayout.referrer;\n      this.pushFrame();\n      this.compileArgs(params, hash, null, synthetic);\n      this.push(80\n      /* CaptureArgs */\n      );\n      this.expr(definition);\n      this.push(71\n      /* CurryComponent */\n      , this.constants.serializable(referrer));\n      this.popFrame();\n      this.fetch(_vm.Register.v0);\n    }\n\n    pushSymbolTable(table) {\n      if (table) {\n        var constant = this.constants.serializable(table);\n        this.push(48\n        /* PushSymbolTable */\n        , constant);\n      } else {\n        this.primitive(null);\n      }\n    }\n\n    invokeComponent(capabilities, attrs, params, hash, synthetic, block, inverse = null, layout) {\n      this.fetch(_vm.Register.s0);\n      this.dup(_vm.Register.sp, 1);\n      this.load(_vm.Register.s0);\n      this.pushFrame();\n      var bindableBlocks = !!(block || inverse || attrs);\n      var bindableAtNames = capabilities === true || capabilities.prepareArgs || !!(hash && hash[0].length !== 0);\n      var blocks = {\n        main: block,\n        else: inverse,\n        attrs\n      };\n      this.compileArgs(params, hash, blocks, synthetic);\n      this.prepareArgs(_vm.Register.s0);\n      this.invokePreparedComponent(block !== null, bindableBlocks, bindableAtNames, () => {\n        if (layout) {\n          this.pushSymbolTable(layout.symbolTable);\n          this.pushLayout(layout);\n          this.resolveLayout();\n        } else {\n          this.getComponentLayout(_vm.Register.s0);\n        }\n\n        this.populateLayout(_vm.Register.s0);\n      });\n      this.load(_vm.Register.s0);\n    }\n\n    invokeStaticComponent(capabilities, layout, attrs, params, hash, synthetic, block, inverse = null) {\n      var {\n        symbolTable\n      } = layout;\n      var bailOut = symbolTable.hasEval || capabilities.prepareArgs;\n\n      if (bailOut) {\n        this.invokeComponent(capabilities, attrs, params, hash, synthetic, block, inverse, layout);\n        return;\n      }\n\n      this.fetch(_vm.Register.s0);\n      this.dup(_vm.Register.sp, 1);\n      this.load(_vm.Register.s0);\n      var {\n        symbols\n      } = symbolTable;\n\n      if (capabilities.createArgs) {\n        this.pushFrame();\n        this.compileArgs(params, hash, null, synthetic);\n      }\n\n      this.beginComponentTransaction();\n\n      if (capabilities.dynamicScope) {\n        this.pushDynamicScope();\n      }\n\n      if (capabilities.createInstance) {\n        this.createComponent(_vm.Register.s0, block !== null);\n      }\n\n      if (capabilities.createArgs) {\n        this.popFrame();\n      }\n\n      this.pushFrame();\n      this.registerComponentDestructor(_vm.Register.s0);\n      var bindings = [];\n      this.getComponentSelf(_vm.Register.s0);\n      bindings.push({\n        symbol: 0,\n        isBlock: false\n      });\n\n      for (var i = 0; i < symbols.length; i++) {\n        var symbol = symbols[i];\n\n        switch (symbol.charAt(0)) {\n          case '&':\n            var callerBlock = null;\n\n            if (symbol === '&default') {\n              callerBlock = block;\n            } else if (symbol === '&inverse') {\n              callerBlock = inverse;\n            } else if (symbol === ATTRS_BLOCK) {\n              callerBlock = attrs;\n            } else {\n              throw (0, _util.unreachable)();\n            }\n\n            if (callerBlock) {\n              this.pushYieldableBlock(callerBlock);\n              bindings.push({\n                symbol: i + 1,\n                isBlock: true\n              });\n            } else {\n              this.pushYieldableBlock(null);\n              bindings.push({\n                symbol: i + 1,\n                isBlock: true\n              });\n            }\n\n            break;\n\n          case '@':\n            if (!hash) {\n              break;\n            }\n\n            var [keys, values] = hash;\n            var lookupName = symbol;\n\n            if (synthetic) {\n              lookupName = symbol.slice(1);\n            }\n\n            var index = keys.indexOf(lookupName);\n\n            if (index !== -1) {\n              this.expr(values[index]);\n              bindings.push({\n                symbol: i + 1,\n                isBlock: false\n              });\n            }\n\n            break;\n        }\n      }\n\n      this.pushRootScope(symbols.length + 1, !!(block || inverse || attrs));\n\n      for (var _i = bindings.length - 1; _i >= 0; _i--) {\n        var {\n          symbol: _symbol,\n          isBlock\n        } = bindings[_i];\n\n        if (isBlock) {\n          this.setBlock(_symbol);\n        } else {\n          this.setVariable(_symbol);\n        }\n      }\n\n      this.invokeStatic(layout);\n\n      if (capabilities.createInstance) {\n        this.didRenderLayout(_vm.Register.s0);\n      }\n\n      this.popFrame();\n      this.popScope();\n\n      if (capabilities.dynamicScope) {\n        this.popDynamicScope();\n      }\n\n      this.commitComponentTransaction();\n      this.load(_vm.Register.s0);\n    }\n\n    dynamicComponent(definition, attrs, params, hash, synthetic, block, inverse = null) {\n      this.replayable({\n        args: () => {\n          this.expr(definition);\n          this.dup();\n          return 2;\n        },\n        body: () => {\n          this.jumpUnless('ELSE');\n          this.resolveDynamicComponent(this.containingLayout.referrer);\n          this.pushDynamicComponentInstance();\n          this.invokeComponent(true, attrs, params, hash, synthetic, block, inverse);\n          this.label('ELSE');\n        }\n      });\n    }\n\n    yield(to, params) {\n      this.compileArgs(params, null, null, false);\n      this.getBlock(to);\n      this.resolveBlock();\n      this.invokeYield();\n      this.popScope();\n      this.popFrame();\n    }\n\n    guardedAppend(expression, trusting) {\n      this.pushFrame();\n      this.expr(expression);\n      this.pushMachine(50\n      /* InvokeStatic */\n      , this.stdLib.getAppend(trusting));\n      this.popFrame();\n    }\n\n    invokeStaticBlock(block, callerCount = 0) {\n      var {\n        parameters\n      } = block.symbolTable;\n      var calleeCount = parameters.length;\n      var count = Math.min(callerCount, calleeCount);\n      this.pushFrame();\n\n      if (count) {\n        this.pushChildScope();\n\n        for (var i = 0; i < count; i++) {\n          this.dup(_vm.Register.fp, callerCount - i);\n          this.setVariable(parameters[i]);\n        }\n      }\n\n      this.pushBlock(block);\n      this.resolveBlock();\n      this.invokeVirtual();\n\n      if (count) {\n        this.popScope();\n      }\n\n      this.popFrame();\n    } /// CONVENIENCE\n    // internal helpers\n\n\n    string(_string) {\n      return this.constants.string(_string);\n    }\n\n    names(_names) {\n      var names = [];\n\n      for (var i = 0; i < _names.length; i++) {\n        var n = _names[i];\n        names[i] = this.constants.string(n);\n      }\n\n      return this.constants.array(names);\n    }\n\n    symbols(symbols) {\n      return this.constants.array(symbols);\n    } // vm\n\n\n    primitive(_primitive) {\n      var type = 0\n      /* NUMBER */\n      ;\n      var primitive;\n\n      switch (typeof _primitive) {\n        case 'number':\n          if (_primitive % 1 === 0) {\n            if (_primitive > -1) {\n              primitive = _primitive;\n            } else {\n              primitive = this.constants.number(_primitive);\n              type = 4\n              /* NEGATIVE */\n              ;\n            }\n          } else {\n            primitive = this.constants.number(_primitive);\n            type = 1\n            /* FLOAT */\n            ;\n          }\n\n          break;\n\n        case 'string':\n          primitive = this.string(_primitive);\n          type = 2\n          /* STRING */\n          ;\n          break;\n\n        case 'boolean':\n          primitive = _primitive | 0;\n          type = 3\n          /* BOOLEAN_OR_VOID */\n          ;\n          break;\n\n        case 'object':\n          // assume null\n          primitive = 2;\n          type = 3\n          /* BOOLEAN_OR_VOID */\n          ;\n          break;\n\n        case 'undefined':\n          primitive = 3;\n          type = 3\n          /* BOOLEAN_OR_VOID */\n          ;\n          break;\n\n        default:\n          throw new Error('Invalid primitive passed to pushPrimitive');\n      }\n\n      var immediate = this.sizeImmediate(primitive << 3 | type, primitive);\n      this.push(13\n      /* Primitive */\n      , immediate);\n    }\n\n    sizeImmediate(shifted, primitive) {\n      if (shifted >= 4294967295\n      /* MAX_SIZE */\n      || shifted < 0) {\n        return this.constants.number(primitive) << 3 | 5\n        /* BIG_NUM */\n        ;\n      }\n\n      return shifted;\n    }\n\n    pushPrimitiveReference(primitive) {\n      this.primitive(primitive);\n      this.primitiveReference();\n    } // components\n\n\n    pushComponentDefinition(handle) {\n      this.push(72\n      /* PushComponentDefinition */\n      , this.constants.handle(handle));\n    }\n\n    resolveDynamicComponent(referrer) {\n      this.push(75\n      /* ResolveDynamicComponent */\n      , this.constants.serializable(referrer));\n    }\n\n    staticComponentHelper(tag, hash, template) {\n      var {\n        handle,\n        capabilities,\n        compilable\n      } = this.compiler.resolveLayoutForTag(tag, this.referrer);\n\n      if (handle !== null && capabilities !== null) {\n        if (compilable) {\n          if (hash) {\n            for (var i = 0; i < hash.length; i = i + 2) {\n              hash[i][0] = \"@\" + hash[i][0];\n            }\n          }\n\n          this.pushComponentDefinition(handle);\n          this.invokeStaticComponent(capabilities, compilable, null, null, hash, false, template && template);\n          return true;\n        }\n      }\n\n      return false;\n    } // partial\n\n\n    invokePartial(referrer, symbols, evalInfo) {\n      var _meta = this.constants.serializable(referrer);\n\n      var _symbols = this.constants.stringArray(symbols);\n\n      var _evalInfo = this.constants.array(evalInfo);\n\n      this.push(95\n      /* InvokePartial */\n      , _meta, _symbols, _evalInfo);\n    }\n\n    resolveMaybeLocal(name) {\n      this.push(96\n      /* ResolveMaybeLocal */\n      , this.string(name));\n    } // debugger\n\n\n    debugger(symbols, evalInfo) {\n      this.push(97\n      /* Debugger */\n      , this.constants.stringArray(symbols), this.constants.array(evalInfo));\n    } // dom\n\n\n    text(text) {\n      this.push(26\n      /* Text */\n      , this.constants.string(text));\n    }\n\n    openPrimitiveElement(tag) {\n      this.push(33\n      /* OpenElement */\n      , this.constants.string(tag));\n    }\n\n    modifier(locator, params, hash) {\n      this.pushFrame();\n      this.compileArgs(params, hash, null, true);\n      this.push(40\n      /* Modifier */\n      , this.constants.handle(locator));\n      this.popFrame();\n    }\n\n    comment(_comment) {\n      var comment = this.constants.string(_comment);\n      this.push(27\n      /* Comment */\n      , comment);\n    }\n\n    dynamicAttr(_name, _namespace, trusting) {\n      var name = this.constants.string(_name);\n      var namespace = _namespace ? this.constants.string(_namespace) : 0;\n      this.push(36\n      /* DynamicAttr */\n      , name, trusting === true ? 1 : 0, namespace);\n    }\n\n    componentAttr(_name, _namespace, trusting) {\n      var name = this.constants.string(_name);\n      var namespace = _namespace ? this.constants.string(_namespace) : 0;\n      this.push(37\n      /* ComponentAttr */\n      , name, trusting === true ? 1 : 0, namespace);\n    }\n\n    staticAttr(_name, _namespace, _value) {\n      var name = this.constants.string(_name);\n      var namespace = _namespace ? this.constants.string(_namespace) : 0;\n      var value = this.constants.string(_value);\n      this.push(35\n      /* StaticAttr */\n      , name, value, namespace);\n    } // expressions\n\n\n    hasBlockParams(to) {\n      this.getBlock(to);\n      this.resolveBlock();\n      this.push(10\n      /* HasBlockParams */\n      );\n    }\n\n    getProperty(key) {\n      this.push(7\n      /* GetProperty */\n      , this.string(key));\n    }\n\n    helper(helper, params, hash) {\n      this.pushFrame();\n      this.compileArgs(params, hash, null, true);\n      this.push(1\n      /* Helper */\n      , this.constants.handle(helper));\n      this.popFrame();\n      this.fetch(_vm.Register.v0);\n    }\n\n    bindDynamicScope(_names) {\n      this.push(43\n      /* BindDynamicScope */\n      , this.names(_names));\n    } // convenience methods\n\n    /**\n     * A convenience for pushing some arguments on the stack and\n     * running some code if the code needs to be re-executed during\n     * updating execution if some of the arguments have changed.\n     *\n     * # Initial Execution\n     *\n     * The `args` function should push zero or more arguments onto\n     * the stack and return the number of arguments pushed.\n     *\n     * The `body` function provides the instructions to execute both\n     * during initial execution and during updating execution.\n     *\n     * Internally, this function starts by pushing a new frame, so\n     * that the body can return and sets the return point ($ra) to\n     * the ENDINITIAL label.\n     *\n     * It then executes the `args` function, which adds instructions\n     * responsible for pushing the arguments for the block to the\n     * stack. These arguments will be restored to the stack before\n     * updating execution.\n     *\n     * Next, it adds the Enter opcode, which marks the current position\n     * in the DOM, and remembers the current $pc (the next instruction)\n     * as the first instruction to execute during updating execution.\n     *\n     * Next, it runs `body`, which adds the opcodes that should\n     * execute both during initial execution and during updating execution.\n     * If the `body` wishes to finish early, it should Jump to the\n     * `FINALLY` label.\n     *\n     * Next, it adds the FINALLY label, followed by:\n     *\n     * - the Exit opcode, which finalizes the marked DOM started by the\n     *   Enter opcode.\n     * - the Return opcode, which returns to the current return point\n     *   ($ra).\n     *\n     * Finally, it adds the ENDINITIAL label followed by the PopFrame\n     * instruction, which restores $fp, $sp and $ra.\n     *\n     * # Updating Execution\n     *\n     * Updating execution for this `replayable` occurs if the `body` added an\n     * assertion, via one of the `JumpIf`, `JumpUnless` or `AssertSame` opcodes.\n     *\n     * If, during updating executon, the assertion fails, the initial VM is\n     * restored, and the stored arguments are pushed onto the stack. The DOM\n     * between the starting and ending markers is cleared, and the VM's cursor\n     * is set to the area just cleared.\n     *\n     * The return point ($ra) is set to -1, the exit instruction.\n     *\n     * Finally, the $pc is set to to the instruction saved off by the\n     * Enter opcode during initial execution, and execution proceeds as\n     * usual.\n     *\n     * The only difference is that when a `Return` instruction is\n     * encountered, the program jumps to -1 rather than the END label,\n     * and the PopFrame opcode is not needed.\n     */\n\n\n    replayable({\n      args,\n      body\n    }) {\n      // Start a new label frame, to give END and RETURN\n      // a unique meaning.\n      this.startLabels();\n      this.pushFrame(); // If the body invokes a block, its return will return to\n      // END. Otherwise, the return in RETURN will return to END.\n\n      this.returnTo('ENDINITIAL'); // Push the arguments onto the stack. The args() function\n      // tells us how many stack elements to retain for re-execution\n      // when updating.\n\n      var count = args(); // Start a new updating closure, remembering `count` elements\n      // from the stack. Everything after this point, and before END,\n      // will execute both initially and to update the block.\n      //\n      // The enter and exit opcodes also track the area of the DOM\n      // associated with this block. If an assertion inside the block\n      // fails (for example, the test value changes from true to false\n      // in an #if), the DOM is cleared and the program is re-executed,\n      // restoring `count` elements to the stack and executing the\n      // instructions between the enter and exit.\n\n      this.enter(count); // Evaluate the body of the block. The body of the block may\n      // return, which will jump execution to END during initial\n      // execution, and exit the updating routine.\n\n      body(); // All execution paths in the body should run the FINALLY once\n      // they are done. It is executed both during initial execution\n      // and during updating execution.\n\n      this.label('FINALLY'); // Finalize the DOM.\n\n      this.exit(); // In initial execution, this is a noop: it returns to the\n      // immediately following opcode. In updating execution, this\n      // exits the updating routine.\n\n      this.return(); // Cleanup code for the block. Runs on initial execution\n      // but not on updating.\n\n      this.label('ENDINITIAL');\n      this.popFrame();\n      this.stopLabels();\n    }\n    /**\n     * A specialized version of the `replayable` convenience that allows the\n     * caller to provide different code based upon whether the item at\n     * the top of the stack is true or false.\n     *\n     * As in `replayable`, the `ifTrue` and `ifFalse` code can invoke `return`.\n     *\n     * During the initial execution, a `return` will continue execution\n     * in the cleanup code, which finalizes the current DOM block and pops\n     * the current frame.\n     *\n     * During the updating execution, a `return` will exit the updating\n     * routine, as it can reuse the DOM block and is always only a single\n     * frame deep.\n     */\n\n\n    replayableIf({\n      args,\n      ifTrue,\n      ifFalse\n    }) {\n      this.replayable({\n        args,\n        body: () => {\n          // If the conditional is false, jump to the ELSE label.\n          this.jumpUnless('ELSE'); // Otherwise, execute the code associated with the true branch.\n\n          ifTrue(); // We're done, so return. In the initial execution, this runs\n          // the cleanup code. In the updating VM, it exits the updating\n          // routine.\n\n          this.jump('FINALLY');\n          this.label('ELSE'); // If the conditional is false, and code associatied ith the\n          // false branch was provided, execute it. If there was no code\n          // associated with the false branch, jumping to the else statement\n          // has no other behavior.\n\n          if (ifFalse) {\n            ifFalse();\n          }\n        }\n      });\n    }\n\n    inlineBlock(block) {\n      return new CompilableBlock(this.compiler, {\n        block,\n        containingLayout: this.containingLayout\n      });\n    }\n\n    evalSymbols() {\n      var {\n        containingLayout: {\n          block\n        }\n      } = this;\n      return block.hasEval ? block.symbols : null;\n    }\n\n    compileParams(params) {\n      if (!params) return 0;\n\n      for (var i = 0; i < params.length; i++) {\n        this.expr(params[i]);\n      }\n\n      return params.length;\n    }\n\n    compileArgs(params, hash, blocks, synthetic) {\n      if (blocks) {\n        this.pushYieldableBlock(blocks.main);\n        this.pushYieldableBlock(blocks.else);\n        this.pushYieldableBlock(blocks.attrs);\n      }\n\n      var count = this.compileParams(params);\n      var flags = count << 4;\n      if (synthetic) flags |= 0b1000;\n\n      if (blocks) {\n        flags |= 0b111;\n      }\n\n      var names = _util.EMPTY_ARRAY;\n\n      if (hash) {\n        names = hash[0];\n        var val = hash[1];\n\n        for (var i = 0; i < val.length; i++) {\n          this.expr(val[i]);\n        }\n      }\n\n      this.pushArgs(names, flags);\n    }\n\n    template(block) {\n      if (!block) return null;\n      return this.inlineBlock(block);\n    }\n\n  }\n\n  _exports.OpcodeBuilder = OpcodeBuilder;\n\n  class LazyOpcodeBuilder extends OpcodeBuilder {\n    pushBlock(block) {\n      if (block) {\n        this.pushOther(block);\n      } else {\n        this.primitive(null);\n      }\n    }\n\n    resolveBlock() {\n      this.push(46\n      /* CompileBlock */\n      );\n    }\n\n    pushLayout(layout) {\n      if (layout) {\n        this.pushOther(layout);\n      } else {\n        this.primitive(null);\n      }\n    }\n\n    resolveLayout() {\n      this.push(46\n      /* CompileBlock */\n      );\n    }\n\n    invokeStatic(compilable) {\n      this.pushOther(compilable);\n      this.push(46\n      /* CompileBlock */\n      );\n      this.pushMachine(49\n      /* InvokeVirtual */\n      );\n    }\n\n    pushOther(value) {\n      this.push(12\n      /* Constant */\n      , this.other(value));\n    }\n\n    other(value) {\n      return this.constants.other(value);\n    }\n\n  }\n\n  _exports.LazyOpcodeBuilder = LazyOpcodeBuilder;\n\n  class EagerOpcodeBuilder extends OpcodeBuilder {\n    pushBlock(block) {\n      var handle = block ? block.compile() : null;\n      this.primitive(handle);\n    }\n\n    resolveBlock() {\n      return;\n    }\n\n    pushLayout(layout) {\n      if (layout) {\n        this.primitive(layout.compile());\n      } else {\n        this.primitive(null);\n      }\n    }\n\n    resolveLayout() {}\n\n    invokeStatic(compilable) {\n      var handle = compilable.compile(); // If the handle for the invoked component is not yet known (for example,\n      // because this is a recursive invocation and we're still compiling), push a\n      // function that will produce the correct handle when the heap is\n      // serialized.\n\n      if (handle === PLACEHOLDER_HANDLE$1) {\n        this.pushMachine(50\n        /* InvokeStatic */\n        , () => compilable.compile());\n      } else {\n        this.pushMachine(50\n        /* InvokeStatic */\n        , handle);\n      }\n    }\n\n  }\n\n  _exports.EagerOpcodeBuilder = EagerOpcodeBuilder;\n\n  class LazyCompiler extends AbstractCompiler {\n    // FIXME: turn to static method\n    constructor(lookup, resolver, macros) {\n      var constants = new _program.LazyConstants(resolver);\n      var program = new _program.Program(constants);\n      super(macros, program, lookup);\n    }\n\n    builderFor(containingLayout) {\n      return new LazyOpcodeBuilder(this, containingLayout);\n    }\n\n  }\n\n  _exports.LazyCompiler = LazyCompiler;\n\n  class PartialDefinition {\n    constructor(name, // for debugging\n    template) {\n      this.name = name;\n      this.template = template;\n    }\n\n    getPartial() {\n      var partial = this.template.asPartial();\n      var handle = partial.compile();\n      return {\n        symbolTable: partial.symbolTable,\n        handle\n      };\n    }\n\n  }\n\n  _exports.PartialDefinition = PartialDefinition;\n  var clientId = 0;\n\n  function templateFactory({\n    id: templateId,\n    meta,\n    block\n  }) {\n    var parsedBlock;\n    var id = templateId || \"client-\" + clientId++;\n\n    var create = (compiler, envMeta) => {\n      var newMeta = envMeta ? (0, _util.assign)({}, envMeta, meta) : meta;\n\n      if (!parsedBlock) {\n        parsedBlock = JSON.parse(block);\n      }\n\n      return new TemplateImpl(compiler, {\n        id,\n        block: parsedBlock,\n        referrer: newMeta\n      });\n    };\n\n    return {\n      id,\n      meta,\n      create\n    };\n  }\n\n  class TemplateImpl {\n    constructor(compiler, parsedLayout) {\n      this.compiler = compiler;\n      this.parsedLayout = parsedLayout;\n      this.layout = null;\n      this.partial = null;\n      this.wrappedLayout = null;\n      var {\n        block\n      } = parsedLayout;\n      this.symbols = block.symbols;\n      this.hasEval = block.hasEval;\n      this.referrer = parsedLayout.referrer;\n      this.id = parsedLayout.id || \"client-\" + clientId++;\n    }\n\n    asLayout() {\n      if (this.layout) return this.layout;\n      return this.layout = new CompilableProgram(this.compiler, (0, _polyfills.assign)({}, this.parsedLayout, {\n        asPartial: false\n      }));\n    }\n\n    asPartial() {\n      if (this.partial) return this.partial;\n      return this.layout = new CompilableProgram(this.compiler, (0, _polyfills.assign)({}, this.parsedLayout, {\n        asPartial: true\n      }));\n    }\n\n    asWrappedLayout() {\n      if (this.wrappedLayout) return this.wrappedLayout;\n      return this.wrappedLayout = new WrappedBuilder(this.compiler, (0, _polyfills.assign)({}, this.parsedLayout, {\n        asPartial: false\n      }));\n    }\n\n  }\n});","define(\"@glimmer/program\", [\"exports\", \"@glimmer/util\"], function (_exports, _util) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.Opcode = _exports.Program = _exports.RuntimeProgram = _exports.WriteOnlyProgram = _exports.Heap = _exports.LazyConstants = _exports.Constants = _exports.RuntimeConstants = _exports.WriteOnlyConstants = _exports.WELL_KNOWN_EMPTY_ARRAY_POSITION = void 0;\n  var UNRESOLVED = {};\n  var WELL_KNOWN_EMPTY_ARRAY_POSITION = 0;\n  _exports.WELL_KNOWN_EMPTY_ARRAY_POSITION = WELL_KNOWN_EMPTY_ARRAY_POSITION;\n  var WELL_KNOW_EMPTY_ARRAY = Object.freeze([]);\n\n  class WriteOnlyConstants {\n    constructor() {\n      // `0` means NULL\n      this.strings = [];\n      this.arrays = [WELL_KNOW_EMPTY_ARRAY];\n      this.tables = [];\n      this.handles = [];\n      this.resolved = [];\n      this.numbers = [];\n    }\n\n    string(value) {\n      var index = this.strings.indexOf(value);\n\n      if (index > -1) {\n        return index;\n      }\n\n      return this.strings.push(value) - 1;\n    }\n\n    stringArray(strings) {\n      var _strings = new Array(strings.length);\n\n      for (var i = 0; i < strings.length; i++) {\n        _strings[i] = this.string(strings[i]);\n      }\n\n      return this.array(_strings);\n    }\n\n    array(values) {\n      if (values.length === 0) {\n        return WELL_KNOWN_EMPTY_ARRAY_POSITION;\n      }\n\n      var index = this.arrays.indexOf(values);\n\n      if (index > -1) {\n        return index;\n      }\n\n      return this.arrays.push(values) - 1;\n    }\n\n    handle(handle) {\n      var index = this.handles.indexOf(handle);\n\n      if (index > -1) {\n        return index;\n      }\n\n      this.resolved.push(UNRESOLVED);\n      return this.handles.push(handle) - 1;\n    }\n\n    serializable(value) {\n      var str = JSON.stringify(value);\n      var index = this.strings.indexOf(str);\n\n      if (index > -1) {\n        return index;\n      }\n\n      return this.strings.push(str) - 1;\n    }\n\n    number(number) {\n      var index = this.numbers.indexOf(number);\n\n      if (index > -1) {\n        return index;\n      }\n\n      return this.numbers.push(number) - 1;\n    }\n\n    toPool() {\n      return {\n        strings: this.strings,\n        arrays: this.arrays,\n        handles: this.handles,\n        numbers: this.numbers\n      };\n    }\n\n  }\n\n  _exports.WriteOnlyConstants = WriteOnlyConstants;\n\n  class RuntimeConstants {\n    constructor(resolver, pool) {\n      this.resolver = resolver;\n      this.strings = pool.strings;\n      this.arrays = pool.arrays;\n      this.handles = pool.handles;\n      this.resolved = this.handles.map(() => UNRESOLVED);\n      this.numbers = pool.numbers;\n    }\n\n    getString(value) {\n      return this.strings[value];\n    }\n\n    getNumber(value) {\n      return this.numbers[value];\n    }\n\n    getStringArray(value) {\n      var names = this.getArray(value);\n\n      var _names = new Array(names.length);\n\n      for (var i = 0; i < names.length; i++) {\n        var n = names[i];\n        _names[i] = this.getString(n);\n      }\n\n      return _names;\n    }\n\n    getArray(value) {\n      return this.arrays[value];\n    }\n\n    resolveHandle(index) {\n      var resolved = this.resolved[index];\n\n      if (resolved === UNRESOLVED) {\n        var handle = this.handles[index];\n        resolved = this.resolved[index] = this.resolver.resolve(handle);\n      }\n\n      return resolved;\n    }\n\n    getSerializable(s) {\n      return JSON.parse(this.strings[s]);\n    }\n\n  }\n\n  _exports.RuntimeConstants = RuntimeConstants;\n\n  class Constants extends WriteOnlyConstants {\n    constructor(resolver, pool) {\n      super();\n      this.resolver = resolver;\n\n      if (pool) {\n        this.strings = pool.strings;\n        this.arrays = pool.arrays;\n        this.handles = pool.handles;\n        this.resolved = this.handles.map(() => UNRESOLVED);\n        this.numbers = pool.numbers;\n      }\n    }\n\n    getNumber(value) {\n      return this.numbers[value];\n    }\n\n    getString(value) {\n      return this.strings[value];\n    }\n\n    getStringArray(value) {\n      var names = this.getArray(value);\n\n      var _names = new Array(names.length);\n\n      for (var i = 0; i < names.length; i++) {\n        var n = names[i];\n        _names[i] = this.getString(n);\n      }\n\n      return _names;\n    }\n\n    getArray(value) {\n      return this.arrays[value];\n    }\n\n    resolveHandle(index) {\n      var resolved = this.resolved[index];\n\n      if (resolved === UNRESOLVED) {\n        var handle = this.handles[index];\n        resolved = this.resolved[index] = this.resolver.resolve(handle);\n      }\n\n      return resolved;\n    }\n\n    getSerializable(s) {\n      return JSON.parse(this.strings[s]);\n    }\n\n  }\n\n  _exports.Constants = Constants;\n\n  class LazyConstants extends Constants {\n    constructor() {\n      super(...arguments);\n      this.others = [];\n      this.serializables = [];\n    }\n\n    serializable(value) {\n      var index = this.serializables.indexOf(value);\n\n      if (index > -1) {\n        return index;\n      }\n\n      return this.serializables.push(value) - 1;\n    }\n\n    getSerializable(s) {\n      return this.serializables[s];\n    }\n\n    getOther(value) {\n      return this.others[value - 1];\n    }\n\n    other(other) {\n      return this.others.push(other);\n    }\n\n  }\n\n  _exports.LazyConstants = LazyConstants;\n\n  class Opcode {\n    constructor(heap) {\n      this.heap = heap;\n      this.offset = 0;\n    }\n\n    get size() {\n      var rawType = this.heap.getbyaddr(this.offset);\n      return ((rawType & 768\n      /* OPERAND_LEN_MASK */\n      ) >> 8\n      /* ARG_SHIFT */\n      ) + 1;\n    }\n\n    get isMachine() {\n      var rawType = this.heap.getbyaddr(this.offset);\n      return rawType & 1024\n      /* MACHINE_MASK */\n      ;\n    }\n\n    get type() {\n      return this.heap.getbyaddr(this.offset) & 255\n      /* TYPE_MASK */\n      ;\n    }\n\n    get op1() {\n      return this.heap.getbyaddr(this.offset + 1);\n    }\n\n    get op2() {\n      return this.heap.getbyaddr(this.offset + 2);\n    }\n\n    get op3() {\n      return this.heap.getbyaddr(this.offset + 3);\n    }\n\n  }\n\n  _exports.Opcode = Opcode;\n\n  function encodeTableInfo(scopeSize, state) {\n    return state | scopeSize << 2;\n  }\n\n  function changeState(info, newState) {\n    return info | newState << 30;\n  }\n\n  var PAGE_SIZE = 0x100000;\n  /**\n   * The Heap is responsible for dynamically allocating\n   * memory in which we read/write the VM's instructions\n   * from/to. When we malloc we pass out a VMHandle, which\n   * is used as an indirect way of accessing the memory during\n   * execution of the VM. Internally we track the different\n   * regions of the memory in an int array known as the table.\n   *\n   * The table 32-bit aligned and has the following layout:\n   *\n   * | ... | hp (u32) |       info (u32)   | size (u32) |\n   * | ... |  Handle  | Scope Size | State | Size       |\n   * | ... | 32bits   | 30bits     | 2bits | 32bit      |\n   *\n   * With this information we effectively have the ability to\n   * control when we want to free memory. That being said you\n   * can not free during execution as raw address are only\n   * valid during the execution. This means you cannot close\n   * over them as you will have a bad memory access exception.\n   */\n\n  class Heap {\n    constructor(serializedHeap) {\n      this.placeholders = [];\n      this.offset = 0;\n      this.handle = 0;\n      this.capacity = PAGE_SIZE;\n\n      if (serializedHeap) {\n        var {\n          buffer,\n          table,\n          handle\n        } = serializedHeap;\n        this.heap = new Uint32Array(buffer);\n        this.table = table;\n        this.offset = this.heap.length;\n        this.handle = handle;\n        this.capacity = 0;\n      } else {\n        this.heap = new Uint32Array(PAGE_SIZE);\n        this.table = [];\n      }\n    }\n\n    push(item) {\n      this.sizeCheck();\n      this.heap[this.offset++] = item;\n    }\n\n    sizeCheck() {\n      if (this.capacity === 0) {\n        var heap = slice(this.heap, 0, this.offset);\n        this.heap = new Uint32Array(heap.length + PAGE_SIZE);\n        this.heap.set(heap, 0);\n        this.capacity = PAGE_SIZE;\n      }\n\n      this.capacity--;\n    }\n\n    getbyaddr(address) {\n      return this.heap[address];\n    }\n\n    setbyaddr(address, value) {\n      this.heap[address] = value;\n    }\n\n    malloc() {\n      // push offset, info, size\n      this.table.push(this.offset, 0, 0);\n      var handle = this.handle;\n      this.handle += 3\n      /* ENTRY_SIZE */\n      ;\n      return handle;\n    }\n\n    finishMalloc(handle, scopeSize) {\n      this.table[handle + 1\n      /* INFO_OFFSET */\n      ] = encodeTableInfo(scopeSize, 0\n      /* Allocated */\n      );\n    }\n\n    size() {\n      return this.offset;\n    } // It is illegal to close over this address, as compaction\n    // may move it. However, it is legal to use this address\n    // multiple times between compactions.\n\n\n    getaddr(handle) {\n      return this.table[handle];\n    }\n\n    gethandle(address) {\n      this.table.push(address, encodeTableInfo(0, 3\n      /* Pointer */\n      ), 0);\n      var handle = this.handle;\n      this.handle += 3\n      /* ENTRY_SIZE */\n      ;\n      return handle;\n    }\n\n    sizeof(handle) {\n      return -1;\n    }\n\n    scopesizeof(handle) {\n      var info = this.table[handle + 1\n      /* INFO_OFFSET */\n      ];\n      return info >> 2;\n    }\n\n    free(handle) {\n      var info = this.table[handle + 1\n      /* INFO_OFFSET */\n      ];\n      this.table[handle + 1\n      /* INFO_OFFSET */\n      ] = changeState(info, 1\n      /* Freed */\n      );\n    }\n\n    pushPlaceholder(valueFunc) {\n      this.sizeCheck();\n      var address = this.offset++;\n      this.heap[address] = 2147483647\n      /* MAX_SIZE */\n      ;\n      this.placeholders.push([address, valueFunc]);\n    }\n\n    patchPlaceholders() {\n      var {\n        placeholders\n      } = this;\n\n      for (var i = 0; i < placeholders.length; i++) {\n        var [address, getValue] = placeholders[i];\n        this.setbyaddr(address, getValue());\n      }\n    }\n\n    capture(offset = this.offset) {\n      this.patchPlaceholders(); // Only called in eager mode\n\n      var buffer = slice(this.heap, 0, offset).buffer;\n      return {\n        handle: this.handle,\n        table: this.table,\n        buffer: buffer\n      };\n    }\n\n  }\n\n  _exports.Heap = Heap;\n\n  class WriteOnlyProgram {\n    constructor(constants = new WriteOnlyConstants(), heap = new Heap()) {\n      this.constants = constants;\n      this.heap = heap;\n      this._opcode = new Opcode(this.heap);\n    }\n\n    opcode(offset) {\n      this._opcode.offset = offset;\n      return this._opcode;\n    }\n\n  }\n\n  _exports.WriteOnlyProgram = WriteOnlyProgram;\n\n  class RuntimeProgram {\n    constructor(constants, heap) {\n      this.constants = constants;\n      this.heap = heap;\n      this._opcode = new Opcode(this.heap);\n    }\n\n    static hydrate(rawHeap, pool, resolver) {\n      var heap = new Heap(rawHeap);\n      var constants = new RuntimeConstants(resolver, pool);\n      return new RuntimeProgram(constants, heap);\n    }\n\n    opcode(offset) {\n      this._opcode.offset = offset;\n      return this._opcode;\n    }\n\n  }\n\n  _exports.RuntimeProgram = RuntimeProgram;\n\n  class Program extends WriteOnlyProgram {}\n\n  _exports.Program = Program;\n\n  function slice(arr, start, end) {\n    if (arr.slice !== undefined) {\n      return arr.slice(start, end);\n    }\n\n    var ret = new Uint32Array(end);\n\n    for (; start < end; start++) {\n      ret[start] = arr[start];\n    }\n\n    return ret;\n  }\n});","define(\"@glimmer/reference\", [\"exports\", \"@glimmer/util\"], function (_exports, _util) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.map = map;\n  _exports.isModified = isModified;\n  _exports.bump = bump;\n  _exports.value = value;\n  _exports.validate = validate;\n  _exports.createTag = createTag;\n  _exports.createUpdatableTag = createUpdatableTag;\n  _exports.isConst = isConst;\n  _exports.isConstTag = isConstTag;\n  _exports.combineTagged = combineTagged;\n  _exports.combineSlice = combineSlice;\n  _exports.combine = combine;\n  _exports.CURRENT_TAG = _exports.VOLATILE_TAG = _exports.CONSTANT_TAG = _exports.update = _exports.dirty = _exports.MonomorphicTagImpl = _exports.ALLOW_CYCLES = _exports.COMPUTE = _exports.VOLATILE = _exports.INITIAL = _exports.CONSTANT = _exports.IteratorSynchronizer = _exports.ReferenceIterator = _exports.IterationArtifacts = _exports.ListItem = _exports.ConstReference = _exports.ReferenceCache = _exports.CachedReference = void 0;\n  var symbol = typeof Symbol !== 'undefined' ? Symbol : key => \"__\" + key + Math.floor(Math.random() * Date.now()) + \"__\";\n  var CONSTANT = 0;\n  _exports.CONSTANT = CONSTANT;\n  var INITIAL = 1;\n  _exports.INITIAL = INITIAL;\n  var VOLATILE = 9007199254740991; // MAX_INT\n\n  _exports.VOLATILE = VOLATILE;\n  var $REVISION = INITIAL;\n\n  function bump() {\n    $REVISION++;\n  } //////////\n\n\n  var COMPUTE = symbol('TAG_COMPUTE'); //////////\n\n  /**\n   * `value` receives a tag and returns an opaque Revision based on that tag. This\n   * snapshot can then later be passed to `validate` with the same tag to\n   * determine if the tag has changed at all since the time that `value` was\n   * called.\n   *\n   * The current implementation returns the global revision count directly for\n   * performance reasons. This is an implementation detail, and should not be\n   * relied on directly by users of these APIs. Instead, Revisions should be\n   * treated as if they are opaque/unknown, and should only be interacted with via\n   * the `value`/`validate` API.\n   *\n   * @param tag\n   */\n\n  _exports.COMPUTE = COMPUTE;\n\n  function value(_tag) {\n    return $REVISION;\n  }\n  /**\n   * `validate` receives a tag and a snapshot from a previous call to `value` with\n   * the same tag, and determines if the tag is still valid compared to the\n   * snapshot. If the tag's state has changed at all since then, `validate` will\n   * return false, otherwise it will return true. This is used to determine if a\n   * calculation related to the tags should be rerun.\n   *\n   * @param tag\n   * @param snapshot\n   */\n\n\n  function validate(tag, snapshot) {\n    return snapshot >= tag[COMPUTE]();\n  }\n\n  var TYPE = symbol('TAG_TYPE');\n  var ALLOW_CYCLES;\n  _exports.ALLOW_CYCLES = ALLOW_CYCLES;\n\n  class MonomorphicTagImpl {\n    constructor(type) {\n      this.revision = INITIAL;\n      this.lastChecked = INITIAL;\n      this.lastValue = INITIAL;\n      this.isUpdating = false;\n      this.subtag = null;\n      this.subtags = null;\n      this[TYPE] = type;\n    }\n\n    [COMPUTE]() {\n      var {\n        lastChecked\n      } = this;\n\n      if (lastChecked !== $REVISION) {\n        this.isUpdating = true;\n        this.lastChecked = $REVISION;\n\n        try {\n          var {\n            subtags,\n            subtag,\n            revision\n          } = this;\n\n          if (subtag !== null) {\n            revision = Math.max(revision, subtag[COMPUTE]());\n          }\n\n          if (subtags !== null) {\n            for (var i = 0; i < subtags.length; i++) {\n              var _value = subtags[i][COMPUTE]();\n\n              revision = Math.max(_value, revision);\n            }\n          }\n\n          this.lastValue = revision;\n        } finally {\n          this.isUpdating = false;\n        }\n      }\n\n      if (this.isUpdating === true) {\n        this.lastChecked = ++$REVISION;\n      }\n\n      return this.lastValue;\n    }\n\n    static update(_tag, subtag) {\n      // TODO: TS 3.7 should allow us to do this via assertion\n      var tag = _tag;\n\n      if (subtag === CONSTANT_TAG) {\n        tag.subtag = null;\n      } else {\n        tag.subtag = subtag; // subtag could be another type of tag, e.g. CURRENT_TAG or VOLATILE_TAG.\n        // If so, lastChecked/lastValue will be undefined, result in these being\n        // NaN. This is fine, it will force the system to recompute.\n\n        tag.lastChecked = Math.min(tag.lastChecked, subtag.lastChecked);\n        tag.lastValue = Math.max(tag.lastValue, subtag.lastValue);\n      }\n    }\n\n    static dirty(tag) {\n      tag.revision = ++$REVISION;\n    }\n\n  }\n\n  _exports.MonomorphicTagImpl = MonomorphicTagImpl;\n  var dirty = MonomorphicTagImpl.dirty;\n  _exports.dirty = dirty;\n  var update = MonomorphicTagImpl.update; //////////\n\n  _exports.update = update;\n\n  function createTag() {\n    return new MonomorphicTagImpl(0\n    /* Dirtyable */\n    );\n  }\n\n  function createUpdatableTag() {\n    return new MonomorphicTagImpl(1\n    /* Updatable */\n    );\n  } //////////\n\n\n  var CONSTANT_TAG = new MonomorphicTagImpl(3\n  /* Constant */\n  );\n  _exports.CONSTANT_TAG = CONSTANT_TAG;\n\n  function isConst({\n    tag\n  }) {\n    return tag === CONSTANT_TAG;\n  }\n\n  function isConstTag(tag) {\n    return tag === CONSTANT_TAG;\n  } //////////\n\n\n  class VolatileTag {\n    [COMPUTE]() {\n      return VOLATILE;\n    }\n\n  }\n\n  var VOLATILE_TAG = new VolatileTag(); //////////\n\n  _exports.VOLATILE_TAG = VOLATILE_TAG;\n\n  class CurrentTag {\n    [COMPUTE]() {\n      return $REVISION;\n    }\n\n  }\n\n  var CURRENT_TAG = new CurrentTag(); //////////\n\n  _exports.CURRENT_TAG = CURRENT_TAG;\n\n  function combineTagged(tagged) {\n    var optimized = [];\n\n    for (var i = 0, l = tagged.length; i < l; i++) {\n      var tag = tagged[i].tag;\n      if (tag === CONSTANT_TAG) continue;\n      optimized.push(tag);\n    }\n\n    return _combine(optimized);\n  }\n\n  function combineSlice(slice) {\n    var optimized = [];\n    var node = slice.head();\n\n    while (node !== null) {\n      var tag = node.tag;\n      if (tag !== CONSTANT_TAG) optimized.push(tag);\n      node = slice.nextNode(node);\n    }\n\n    return _combine(optimized);\n  }\n\n  function combine(tags) {\n    var optimized = [];\n\n    for (var i = 0, l = tags.length; i < l; i++) {\n      var tag = tags[i];\n      if (tag === CONSTANT_TAG) continue;\n      optimized.push(tag);\n    }\n\n    return _combine(optimized);\n  }\n\n  function _combine(tags) {\n    switch (tags.length) {\n      case 0:\n        return CONSTANT_TAG;\n\n      case 1:\n        return tags[0];\n\n      default:\n        var tag = new MonomorphicTagImpl(2\n        /* Combinator */\n        );\n        tag.subtags = tags;\n        return tag;\n    }\n  }\n\n  class CachedReference {\n    constructor() {\n      this.lastRevision = null;\n      this.lastValue = null;\n    }\n\n    value() {\n      var {\n        tag,\n        lastRevision,\n        lastValue\n      } = this;\n\n      if (lastRevision === null || !validate(tag, lastRevision)) {\n        lastValue = this.lastValue = this.compute();\n        this.lastRevision = value(tag);\n      }\n\n      return lastValue;\n    }\n\n    invalidate() {\n      this.lastRevision = null;\n    }\n\n  }\n\n  _exports.CachedReference = CachedReference;\n\n  class MapperReference extends CachedReference {\n    constructor(reference, mapper) {\n      super();\n      this.tag = reference.tag;\n      this.reference = reference;\n      this.mapper = mapper;\n    }\n\n    compute() {\n      var {\n        reference,\n        mapper\n      } = this;\n      return mapper(reference.value());\n    }\n\n  }\n\n  function map(reference, mapper) {\n    return new MapperReference(reference, mapper);\n  } //////////\n\n\n  class ReferenceCache {\n    constructor(reference) {\n      this.lastValue = null;\n      this.lastRevision = null;\n      this.initialized = false;\n      this.tag = reference.tag;\n      this.reference = reference;\n    }\n\n    peek() {\n      if (!this.initialized) {\n        return this.initialize();\n      }\n\n      return this.lastValue;\n    }\n\n    revalidate() {\n      if (!this.initialized) {\n        return this.initialize();\n      }\n\n      var {\n        reference,\n        lastRevision\n      } = this;\n      var tag = reference.tag;\n      if (validate(tag, lastRevision)) return NOT_MODIFIED;\n      this.lastRevision = value(tag);\n      var {\n        lastValue\n      } = this;\n      var currentValue = reference.value();\n      if (currentValue === lastValue) return NOT_MODIFIED;\n      this.lastValue = currentValue;\n      return currentValue;\n    }\n\n    initialize() {\n      var {\n        reference\n      } = this;\n      var currentValue = this.lastValue = reference.value();\n      this.lastRevision = value(reference.tag);\n      this.initialized = true;\n      return currentValue;\n    }\n\n  }\n\n  _exports.ReferenceCache = ReferenceCache;\n  var NOT_MODIFIED = 'adb3b78e-3d22-4e4b-877a-6317c2c5c145';\n\n  function isModified(value$$1) {\n    return value$$1 !== NOT_MODIFIED;\n  }\n\n  class ConstReference {\n    constructor(inner) {\n      this.inner = inner;\n      this.tag = CONSTANT_TAG;\n    }\n\n    value() {\n      return this.inner;\n    }\n\n  }\n\n  _exports.ConstReference = ConstReference;\n\n  class ListItem extends _util.ListNode {\n    constructor(iterable, result) {\n      super(iterable.valueReferenceFor(result));\n      this.retained = false;\n      this.seen = false;\n      this.key = result.key;\n      this.iterable = iterable;\n      this.memo = iterable.memoReferenceFor(result);\n    }\n\n    update(item) {\n      this.retained = true;\n      this.iterable.updateValueReference(this.value, item);\n      this.iterable.updateMemoReference(this.memo, item);\n    }\n\n    shouldRemove() {\n      return !this.retained;\n    }\n\n    reset() {\n      this.retained = false;\n      this.seen = false;\n    }\n\n  }\n\n  _exports.ListItem = ListItem;\n\n  class IterationArtifacts {\n    constructor(iterable) {\n      this.iterator = null;\n      this.map = (0, _util.dict)();\n      this.list = new _util.LinkedList();\n      this.tag = iterable.tag;\n      this.iterable = iterable;\n    }\n\n    isEmpty() {\n      var iterator = this.iterator = this.iterable.iterate();\n      return iterator.isEmpty();\n    }\n\n    iterate() {\n      var iterator;\n\n      if (this.iterator === null) {\n        iterator = this.iterable.iterate();\n      } else {\n        iterator = this.iterator;\n      }\n\n      this.iterator = null;\n      return iterator;\n    }\n\n    has(key) {\n      return !!this.map[key];\n    }\n\n    get(key) {\n      return this.map[key];\n    }\n\n    wasSeen(key) {\n      var node = this.map[key];\n      return node !== undefined && node.seen;\n    }\n\n    append(item) {\n      var {\n        map,\n        list,\n        iterable\n      } = this;\n      var node = map[item.key] = new ListItem(iterable, item);\n      list.append(node);\n      return node;\n    }\n\n    insertBefore(item, reference) {\n      var {\n        map,\n        list,\n        iterable\n      } = this;\n      var node = map[item.key] = new ListItem(iterable, item);\n      node.retained = true;\n      list.insertBefore(node, reference);\n      return node;\n    }\n\n    move(item, reference) {\n      var {\n        list\n      } = this;\n      item.retained = true;\n      list.remove(item);\n      list.insertBefore(item, reference);\n    }\n\n    remove(item) {\n      var {\n        list\n      } = this;\n      list.remove(item);\n      delete this.map[item.key];\n    }\n\n    nextNode(item) {\n      return this.list.nextNode(item);\n    }\n\n    head() {\n      return this.list.head();\n    }\n\n  }\n\n  _exports.IterationArtifacts = IterationArtifacts;\n\n  class ReferenceIterator {\n    // if anyone needs to construct this object with something other than\n    // an iterable, let @wycats know.\n    constructor(iterable) {\n      this.iterator = null;\n      var artifacts = new IterationArtifacts(iterable);\n      this.artifacts = artifacts;\n    }\n\n    next() {\n      var {\n        artifacts\n      } = this;\n      var iterator = this.iterator = this.iterator || artifacts.iterate();\n      var item = iterator.next();\n      if (item === null) return null;\n      return artifacts.append(item);\n    }\n\n  }\n\n  _exports.ReferenceIterator = ReferenceIterator;\n  var Phase;\n\n  (function (Phase) {\n    Phase[Phase[\"Append\"] = 0] = \"Append\";\n    Phase[Phase[\"Prune\"] = 1] = \"Prune\";\n    Phase[Phase[\"Done\"] = 2] = \"Done\";\n  })(Phase || (Phase = {}));\n\n  class IteratorSynchronizer {\n    constructor({\n      target,\n      artifacts\n    }) {\n      this.target = target;\n      this.artifacts = artifacts;\n      this.iterator = artifacts.iterate();\n      this.current = artifacts.head();\n    }\n\n    sync() {\n      var phase = Phase.Append;\n\n      while (true) {\n        switch (phase) {\n          case Phase.Append:\n            phase = this.nextAppend();\n            break;\n\n          case Phase.Prune:\n            phase = this.nextPrune();\n            break;\n\n          case Phase.Done:\n            this.nextDone();\n            return;\n        }\n      }\n    }\n\n    advanceToKey(key) {\n      var {\n        current,\n        artifacts\n      } = this;\n      var seek = current;\n\n      while (seek !== null && seek.key !== key) {\n        seek.seen = true;\n        seek = artifacts.nextNode(seek);\n      }\n\n      if (seek !== null) {\n        this.current = artifacts.nextNode(seek);\n      }\n    }\n\n    nextAppend() {\n      var {\n        iterator,\n        current,\n        artifacts\n      } = this;\n      var item = iterator.next();\n\n      if (item === null) {\n        return this.startPrune();\n      }\n\n      var {\n        key\n      } = item;\n\n      if (current !== null && current.key === key) {\n        this.nextRetain(item);\n      } else if (artifacts.has(key)) {\n        this.nextMove(item);\n      } else {\n        this.nextInsert(item);\n      }\n\n      return Phase.Append;\n    }\n\n    nextRetain(item) {\n      var {\n        artifacts,\n        current\n      } = this;\n      current = current;\n      current.update(item);\n      this.current = artifacts.nextNode(current);\n      this.target.retain(item.key, current.value, current.memo);\n    }\n\n    nextMove(item) {\n      var {\n        current,\n        artifacts,\n        target\n      } = this;\n      var {\n        key\n      } = item;\n      var found = artifacts.get(item.key);\n      found.update(item);\n\n      if (artifacts.wasSeen(item.key)) {\n        artifacts.move(found, current);\n        target.move(found.key, found.value, found.memo, current ? current.key : null);\n      } else {\n        this.advanceToKey(key);\n      }\n    }\n\n    nextInsert(item) {\n      var {\n        artifacts,\n        target,\n        current\n      } = this;\n      var node = artifacts.insertBefore(item, current);\n      target.insert(node.key, node.value, node.memo, current ? current.key : null);\n    }\n\n    startPrune() {\n      this.current = this.artifacts.head();\n      return Phase.Prune;\n    }\n\n    nextPrune() {\n      var {\n        artifacts,\n        target,\n        current\n      } = this;\n\n      if (current === null) {\n        return Phase.Done;\n      }\n\n      var node = current;\n      this.current = artifacts.nextNode(node);\n\n      if (node.shouldRemove()) {\n        artifacts.remove(node);\n        target.delete(node.key);\n      } else {\n        node.reset();\n      }\n\n      return Phase.Prune;\n    }\n\n    nextDone() {\n      this.target.done();\n    }\n\n  }\n\n  _exports.IteratorSynchronizer = IteratorSynchronizer;\n});","define(\"@glimmer/runtime\", [\"exports\", \"@glimmer/util\", \"@glimmer/reference\", \"@glimmer/vm\", \"@glimmer/low-level\"], function (_exports, _util, _reference2, _vm2, _lowLevel) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.renderMain = renderMain;\n  _exports.renderComponent = renderComponent;\n  _exports.setDebuggerCallback = setDebuggerCallback;\n  _exports.resetDebuggerCallback = resetDebuggerCallback;\n  _exports.getDynamicVar = getDynamicVar;\n  _exports.isCurriedComponentDefinition = isCurriedComponentDefinition;\n  _exports.curry = curry;\n  _exports.isWhitespace = isWhitespace;\n  _exports.normalizeProperty = normalizeProperty;\n  _exports.clientBuilder = clientBuilder;\n  _exports.rehydrationBuilder = rehydrationBuilder;\n  _exports.isSerializationFirstNode = isSerializationFirstNode;\n  _exports.capabilityFlagsFrom = capabilityFlagsFrom;\n  _exports.hasCapability = hasCapability;\n  _exports.Cursor = _exports.ConcreteBounds = _exports.SERIALIZATION_FIRST_NODE_STRING = _exports.RehydrateBuilder = _exports.NewElementBuilder = _exports.DOMTreeConstruction = _exports.IDOMChanges = _exports.SVG_NAMESPACE = _exports.DOMChanges = _exports.CurriedComponentDefinition = _exports.MINIMAL_CAPABILITIES = _exports.DEFAULT_CAPABILITIES = _exports.DefaultEnvironment = _exports.Environment = _exports.Scope = _exports.EMPTY_ARGS = _exports.DynamicAttribute = _exports.SimpleDynamicAttribute = _exports.RenderResult = _exports.UpdatingVM = _exports.LowLevelVM = _exports.ConditionalReference = _exports.PrimitiveReference = _exports.UNDEFINED_REFERENCE = _exports.NULL_REFERENCE = void 0;\n\n  // these import bindings will be stripped from build\n  class AppendOpcodes {\n    constructor() {\n      this.evaluateOpcode = (0, _util.fillNulls)(98\n      /* Size */\n      ).slice();\n    }\n\n    add(name, evaluate, kind = 'syscall') {\n      this.evaluateOpcode[name] = {\n        syscall: kind === 'syscall',\n        evaluate\n      };\n    }\n\n    debugBefore(vm, opcode, type) {\n      var sp;\n      var state;\n      return {\n        sp: sp,\n        state\n      };\n    }\n\n    debugAfter(vm, opcode, type, pre) {\n      var expectedChange;\n      var {\n        sp,\n        state\n      } = pre;\n      var metadata = null;\n\n      if (metadata !== null) {\n        if (typeof metadata.stackChange === 'number') {\n          expectedChange = metadata.stackChange;\n        } else {\n          expectedChange = metadata.stackChange({\n            opcode,\n            constants: vm.constants,\n            state\n          });\n          if (isNaN(expectedChange)) throw (0, _util.unreachable)();\n        }\n      }\n    }\n\n    evaluate(vm, opcode, type) {\n      var operation = this.evaluateOpcode[type];\n\n      if (operation.syscall) {\n        operation.evaluate(vm, opcode);\n      } else {\n        operation.evaluate(vm.inner, opcode);\n      }\n    }\n\n  }\n\n  var APPEND_OPCODES = new AppendOpcodes();\n\n  class AbstractOpcode {\n    constructor() {\n      (0, _util.initializeGuid)(this);\n    }\n\n  }\n\n  class UpdatingOpcode extends AbstractOpcode {\n    constructor() {\n      super(...arguments);\n      this.next = null;\n      this.prev = null;\n    }\n\n  }\n\n  class PrimitiveReference extends _reference2.ConstReference {\n    constructor(value$$1) {\n      super(value$$1);\n    }\n\n    static create(value$$1) {\n      if (value$$1 === undefined) {\n        return UNDEFINED_REFERENCE;\n      } else if (value$$1 === null) {\n        return NULL_REFERENCE;\n      } else if (value$$1 === true) {\n        return TRUE_REFERENCE;\n      } else if (value$$1 === false) {\n        return FALSE_REFERENCE;\n      } else if (typeof value$$1 === 'number') {\n        return new ValueReference(value$$1);\n      } else {\n        return new StringReference(value$$1);\n      }\n    }\n\n    get(_key) {\n      return UNDEFINED_REFERENCE;\n    }\n\n  }\n\n  _exports.PrimitiveReference = PrimitiveReference;\n\n  class StringReference extends PrimitiveReference {\n    constructor() {\n      super(...arguments);\n      this.lengthReference = null;\n    }\n\n    get(key) {\n      if (key === 'length') {\n        var {\n          lengthReference\n        } = this;\n\n        if (lengthReference === null) {\n          lengthReference = this.lengthReference = new ValueReference(this.inner.length);\n        }\n\n        return lengthReference;\n      } else {\n        return super.get(key);\n      }\n    }\n\n  }\n\n  class ValueReference extends PrimitiveReference {\n    constructor(value$$1) {\n      super(value$$1);\n    }\n\n  }\n\n  var UNDEFINED_REFERENCE = new ValueReference(undefined);\n  _exports.UNDEFINED_REFERENCE = UNDEFINED_REFERENCE;\n  var NULL_REFERENCE = new ValueReference(null);\n  _exports.NULL_REFERENCE = NULL_REFERENCE;\n  var TRUE_REFERENCE = new ValueReference(true);\n  var FALSE_REFERENCE = new ValueReference(false);\n\n  class ConditionalReference {\n    constructor(inner) {\n      this.inner = inner;\n      this.tag = inner.tag;\n    }\n\n    value() {\n      return this.toBool(this.inner.value());\n    }\n\n    toBool(value$$1) {\n      return !!value$$1;\n    }\n\n  }\n\n  _exports.ConditionalReference = ConditionalReference;\n\n  class ConcatReference extends _reference2.CachedReference {\n    constructor(parts) {\n      super();\n      this.parts = parts;\n      this.tag = (0, _reference2.combineTagged)(parts);\n    }\n\n    compute() {\n      var parts = new Array();\n\n      for (var i = 0; i < this.parts.length; i++) {\n        var value$$1 = this.parts[i].value();\n\n        if (value$$1 !== null && value$$1 !== undefined) {\n          parts[i] = castToString(value$$1);\n        }\n      }\n\n      if (parts.length > 0) {\n        return parts.join('');\n      }\n\n      return null;\n    }\n\n  }\n\n  function castToString(value$$1) {\n    if (typeof value$$1.toString !== 'function') {\n      return '';\n    }\n\n    return String(value$$1);\n  }\n\n  APPEND_OPCODES.add(1\n  /* Helper */\n  , (vm, {\n    op1: handle\n  }) => {\n    var stack = vm.stack;\n    var helper = vm.constants.resolveHandle(handle);\n    var args = stack.pop();\n    var value$$1 = helper(vm, args);\n    vm.loadValue(_vm2.Register.v0, value$$1);\n  });\n  APPEND_OPCODES.add(6\n  /* GetVariable */\n  , (vm, {\n    op1: symbol\n  }) => {\n    var expr = vm.referenceForSymbol(symbol);\n    vm.stack.push(expr);\n  });\n  APPEND_OPCODES.add(4\n  /* SetVariable */\n  , (vm, {\n    op1: symbol\n  }) => {\n    var expr = vm.stack.pop();\n    vm.scope().bindSymbol(symbol, expr);\n  });\n  APPEND_OPCODES.add(5\n  /* SetBlock */\n  , (vm, {\n    op1: symbol\n  }) => {\n    var handle = vm.stack.pop();\n    var scope = vm.stack.pop(); // FIXME(mmun): shouldn't need to cast this\n\n    var table = vm.stack.pop();\n    var block = table ? [handle, scope, table] : null;\n    vm.scope().bindBlock(symbol, block);\n  });\n  APPEND_OPCODES.add(96\n  /* ResolveMaybeLocal */\n  , (vm, {\n    op1: _name\n  }) => {\n    var name = vm.constants.getString(_name);\n    var locals = vm.scope().getPartialMap();\n    var ref = locals[name];\n\n    if (ref === undefined) {\n      ref = vm.getSelf().get(name);\n    }\n\n    vm.stack.push(ref);\n  });\n  APPEND_OPCODES.add(20\n  /* RootScope */\n  , (vm, {\n    op1: symbols,\n    op2: bindCallerScope\n  }) => {\n    vm.pushRootScope(symbols, !!bindCallerScope);\n  });\n  APPEND_OPCODES.add(7\n  /* GetProperty */\n  , (vm, {\n    op1: _key\n  }) => {\n    var key = vm.constants.getString(_key);\n    var expr = vm.stack.pop();\n    vm.stack.push(expr.get(key));\n  });\n  APPEND_OPCODES.add(8\n  /* GetBlock */\n  , (vm, {\n    op1: _block\n  }) => {\n    var {\n      stack\n    } = vm;\n    var block = vm.scope().getBlock(_block);\n\n    if (block) {\n      stack.push(block[2]);\n      stack.push(block[1]);\n      stack.push(block[0]);\n    } else {\n      stack.push(null);\n      stack.push(null);\n      stack.push(null);\n    }\n  });\n  APPEND_OPCODES.add(9\n  /* HasBlock */\n  , (vm, {\n    op1: _block\n  }) => {\n    var hasBlock = !!vm.scope().getBlock(_block);\n    vm.stack.push(hasBlock ? TRUE_REFERENCE : FALSE_REFERENCE);\n  });\n  APPEND_OPCODES.add(10\n  /* HasBlockParams */\n  , vm => {\n    // FIXME(mmun): should only need to push the symbol table\n    var block = vm.stack.pop();\n    var scope = vm.stack.pop();\n    var table = vm.stack.pop();\n    var hasBlockParams = table && table.parameters.length;\n    vm.stack.push(hasBlockParams ? TRUE_REFERENCE : FALSE_REFERENCE);\n  });\n  APPEND_OPCODES.add(11\n  /* Concat */\n  , (vm, {\n    op1: count\n  }) => {\n    var out = new Array(count);\n\n    for (var i = count; i > 0; i--) {\n      var offset = i - 1;\n      out[offset] = vm.stack.pop();\n    }\n\n    vm.stack.push(new ConcatReference(out));\n  });\n  var CURRIED_COMPONENT_DEFINITION_BRAND = 'CURRIED COMPONENT DEFINITION [id=6f00feb9-a0ef-4547-99ea-ac328f80acea]';\n\n  function isCurriedComponentDefinition(definition) {\n    return !!(definition && definition[CURRIED_COMPONENT_DEFINITION_BRAND]);\n  }\n\n  function isComponentDefinition(definition) {\n    return definition && definition[CURRIED_COMPONENT_DEFINITION_BRAND];\n  }\n\n  class CurriedComponentDefinition {\n    /** @internal */\n    constructor(inner, args) {\n      this.inner = inner;\n      this.args = args;\n      this[CURRIED_COMPONENT_DEFINITION_BRAND] = true;\n    }\n\n    unwrap(args) {\n      args.realloc(this.offset);\n      var definition = this;\n\n      while (true) {\n        var {\n          args: curriedArgs,\n          inner\n        } = definition;\n\n        if (curriedArgs) {\n          args.positional.prepend(curriedArgs.positional);\n          args.named.merge(curriedArgs.named);\n        }\n\n        if (!isCurriedComponentDefinition(inner)) {\n          return inner;\n        }\n\n        definition = inner;\n      }\n    }\n    /** @internal */\n\n\n    get offset() {\n      var {\n        inner,\n        args\n      } = this;\n      var length = args ? args.positional.length : 0;\n      return isCurriedComponentDefinition(inner) ? length + inner.offset : length;\n    }\n\n  }\n\n  _exports.CurriedComponentDefinition = CurriedComponentDefinition;\n\n  function curry(spec, args = null) {\n    return new CurriedComponentDefinition(spec, args);\n  }\n\n  function normalizeStringValue(value$$1) {\n    if (isEmpty(value$$1)) {\n      return '';\n    }\n\n    return String(value$$1);\n  }\n\n  function shouldCoerce(value$$1) {\n    return isString(value$$1) || isEmpty(value$$1) || typeof value$$1 === 'boolean' || typeof value$$1 === 'number';\n  }\n\n  function isEmpty(value$$1) {\n    return value$$1 === null || value$$1 === undefined || typeof value$$1.toString !== 'function';\n  }\n\n  function isSafeString(value$$1) {\n    return typeof value$$1 === 'object' && value$$1 !== null && typeof value$$1.toHTML === 'function';\n  }\n\n  function isNode(value$$1) {\n    return typeof value$$1 === 'object' && value$$1 !== null && typeof value$$1.nodeType === 'number';\n  }\n\n  function isFragment(value$$1) {\n    return isNode(value$$1) && value$$1.nodeType === 11;\n  }\n\n  function isString(value$$1) {\n    return typeof value$$1 === 'string';\n  }\n\n  class DynamicTextContent extends UpdatingOpcode {\n    constructor(node, reference, lastValue) {\n      super();\n      this.node = node;\n      this.reference = reference;\n      this.lastValue = lastValue;\n      this.type = 'dynamic-text';\n      this.tag = reference.tag;\n      this.lastRevision = (0, _reference2.value)(this.tag);\n    }\n\n    evaluate() {\n      var {\n        reference,\n        tag\n      } = this;\n\n      if (!(0, _reference2.validate)(tag, this.lastRevision)) {\n        this.lastRevision = (0, _reference2.value)(tag);\n        this.update(reference.value());\n      }\n    }\n\n    update(value$$1) {\n      var {\n        lastValue\n      } = this;\n      if (value$$1 === lastValue) return;\n      var normalized;\n\n      if (isEmpty(value$$1)) {\n        normalized = '';\n      } else if (isString(value$$1)) {\n        normalized = value$$1;\n      } else {\n        normalized = String(value$$1);\n      }\n\n      if (normalized !== lastValue) {\n        var textNode = this.node;\n        textNode.nodeValue = this.lastValue = normalized;\n      }\n    }\n\n  }\n\n  class IsCurriedComponentDefinitionReference extends ConditionalReference {\n    static create(inner) {\n      return new IsCurriedComponentDefinitionReference(inner);\n    }\n\n    toBool(value$$1) {\n      return isCurriedComponentDefinition(value$$1);\n    }\n\n  }\n\n  class ContentTypeReference {\n    constructor(inner) {\n      this.inner = inner;\n      this.tag = inner.tag;\n    }\n\n    value() {\n      var value$$1 = this.inner.value();\n\n      if (shouldCoerce(value$$1)) {\n        return 1\n        /* String */\n        ;\n      } else if (isComponentDefinition(value$$1)) {\n        return 0\n        /* Component */\n        ;\n      } else if (isSafeString(value$$1)) {\n        return 3\n        /* SafeString */\n        ;\n      } else if (isFragment(value$$1)) {\n        return 4\n        /* Fragment */\n        ;\n      } else if (isNode(value$$1)) {\n        return 5\n        /* Node */\n        ;\n      } else {\n          return 1\n          /* String */\n          ;\n        }\n    }\n\n  }\n\n  APPEND_OPCODES.add(28\n  /* AppendHTML */\n  , vm => {\n    var reference = vm.stack.pop();\n    var rawValue = reference.value();\n    var value$$1 = isEmpty(rawValue) ? '' : String(rawValue);\n    vm.elements().appendDynamicHTML(value$$1);\n  });\n  APPEND_OPCODES.add(29\n  /* AppendSafeHTML */\n  , vm => {\n    var reference = vm.stack.pop();\n    var rawValue = reference.value().toHTML();\n    var value$$1 = isEmpty(rawValue) ? '' : rawValue;\n    vm.elements().appendDynamicHTML(value$$1);\n  });\n  APPEND_OPCODES.add(32\n  /* AppendText */\n  , vm => {\n    var reference = vm.stack.pop();\n    var rawValue = reference.value();\n    var value$$1 = isEmpty(rawValue) ? '' : String(rawValue);\n    var node = vm.elements().appendDynamicText(value$$1);\n\n    if (!(0, _reference2.isConst)(reference)) {\n      vm.updateWith(new DynamicTextContent(node, reference, value$$1));\n    }\n  });\n  APPEND_OPCODES.add(30\n  /* AppendDocumentFragment */\n  , vm => {\n    var reference = vm.stack.pop();\n    var value$$1 = reference.value();\n    vm.elements().appendDynamicFragment(value$$1);\n  });\n  APPEND_OPCODES.add(31\n  /* AppendNode */\n  , vm => {\n    var reference = vm.stack.pop();\n    var value$$1 = reference.value();\n    vm.elements().appendDynamicNode(value$$1);\n  });\n  APPEND_OPCODES.add(22\n  /* ChildScope */\n  , vm => vm.pushChildScope());\n  APPEND_OPCODES.add(23\n  /* PopScope */\n  , vm => vm.popScope());\n  APPEND_OPCODES.add(44\n  /* PushDynamicScope */\n  , vm => vm.pushDynamicScope());\n  APPEND_OPCODES.add(45\n  /* PopDynamicScope */\n  , vm => vm.popDynamicScope());\n  APPEND_OPCODES.add(12\n  /* Constant */\n  , (vm, {\n    op1: other\n  }) => {\n    vm.stack.push(vm.constants.getOther(other));\n  });\n  APPEND_OPCODES.add(13\n  /* Primitive */\n  , (vm, {\n    op1: primitive\n  }) => {\n    var stack = vm.stack;\n    var flag = primitive & 7; // 111\n\n    var value$$1 = primitive >> 3;\n\n    switch (flag) {\n      case 0\n      /* NUMBER */\n      :\n        stack.push(value$$1);\n        break;\n\n      case 1\n      /* FLOAT */\n      :\n        stack.push(vm.constants.getNumber(value$$1));\n        break;\n\n      case 2\n      /* STRING */\n      :\n        stack.push(vm.constants.getString(value$$1));\n        break;\n\n      case 3\n      /* BOOLEAN_OR_VOID */\n      :\n        stack.pushEncodedImmediate(primitive);\n        break;\n\n      case 4\n      /* NEGATIVE */\n      :\n        stack.push(vm.constants.getNumber(value$$1));\n        break;\n\n      case 5\n      /* BIG_NUM */\n      :\n        stack.push(vm.constants.getNumber(value$$1));\n        break;\n    }\n  });\n  APPEND_OPCODES.add(14\n  /* PrimitiveReference */\n  , vm => {\n    var stack = vm.stack;\n    stack.push(PrimitiveReference.create(stack.pop()));\n  });\n  APPEND_OPCODES.add(15\n  /* ReifyU32 */\n  , vm => {\n    var stack = vm.stack;\n    stack.push(stack.peek().value());\n  });\n  APPEND_OPCODES.add(16\n  /* Dup */\n  , (vm, {\n    op1: register,\n    op2: offset\n  }) => {\n    var position = vm.fetchValue(register) - offset;\n    vm.stack.dup(position);\n  });\n  APPEND_OPCODES.add(17\n  /* Pop */\n  , (vm, {\n    op1: count\n  }) => {\n    vm.stack.pop(count);\n  });\n  APPEND_OPCODES.add(18\n  /* Load */\n  , (vm, {\n    op1: register\n  }) => {\n    vm.load(register);\n  });\n  APPEND_OPCODES.add(19\n  /* Fetch */\n  , (vm, {\n    op1: register\n  }) => {\n    vm.fetch(register);\n  });\n  APPEND_OPCODES.add(43\n  /* BindDynamicScope */\n  , (vm, {\n    op1: _names\n  }) => {\n    var names = vm.constants.getArray(_names);\n    vm.bindDynamicScope(names);\n  });\n  APPEND_OPCODES.add(61\n  /* Enter */\n  , (vm, {\n    op1: args\n  }) => {\n    vm.enter(args);\n  });\n  APPEND_OPCODES.add(62\n  /* Exit */\n  , vm => {\n    vm.exit();\n  });\n  APPEND_OPCODES.add(48\n  /* PushSymbolTable */\n  , (vm, {\n    op1: _table\n  }) => {\n    var stack = vm.stack;\n    stack.push(vm.constants.getSerializable(_table));\n  });\n  APPEND_OPCODES.add(47\n  /* PushBlockScope */\n  , vm => {\n    var stack = vm.stack;\n    stack.push(vm.scope());\n  });\n  APPEND_OPCODES.add(46\n  /* CompileBlock */\n  , vm => {\n    var stack = vm.stack;\n    var block = stack.pop();\n\n    if (block) {\n      stack.push(block.compile());\n    } else {\n      stack.pushNull();\n    }\n  });\n  APPEND_OPCODES.add(51\n  /* InvokeYield */\n  , vm => {\n    var {\n      stack\n    } = vm;\n    var handle = stack.pop();\n    var scope = stack.pop(); // FIXME(mmun): shouldn't need to cast this\n\n    var table = stack.pop();\n    var args = stack.pop();\n\n    if (table === null) {\n      // To balance the pop{Frame,Scope}\n      vm.pushFrame();\n      vm.pushScope(scope); // Could be null but it doesnt matter as it is immediatelly popped.\n\n      return;\n    }\n\n    var invokingScope = scope; // If necessary, create a child scope\n\n    {\n      var locals = table.parameters;\n      var localsCount = locals.length;\n\n      if (localsCount > 0) {\n        invokingScope = invokingScope.child();\n\n        for (var i = 0; i < localsCount; i++) {\n          invokingScope.bindSymbol(locals[i], args.at(i));\n        }\n      }\n    }\n    vm.pushFrame();\n    vm.pushScope(invokingScope);\n    vm.call(handle);\n  });\n  APPEND_OPCODES.add(53\n  /* JumpIf */\n  , (vm, {\n    op1: target\n  }) => {\n    var reference = vm.stack.pop();\n\n    if ((0, _reference2.isConst)(reference)) {\n      if (reference.value()) {\n        vm.goto(target);\n      }\n    } else {\n      var cache = new _reference2.ReferenceCache(reference);\n\n      if (cache.peek()) {\n        vm.goto(target);\n      }\n\n      vm.updateWith(new Assert(cache));\n    }\n  });\n  APPEND_OPCODES.add(54\n  /* JumpUnless */\n  , (vm, {\n    op1: target\n  }) => {\n    var reference = vm.stack.pop();\n\n    if ((0, _reference2.isConst)(reference)) {\n      if (!reference.value()) {\n        vm.goto(target);\n      }\n    } else {\n      var cache = new _reference2.ReferenceCache(reference);\n\n      if (!cache.peek()) {\n        vm.goto(target);\n      }\n\n      vm.updateWith(new Assert(cache));\n    }\n  });\n  APPEND_OPCODES.add(55\n  /* JumpEq */\n  , (vm, {\n    op1: target,\n    op2: comparison\n  }) => {\n    var other = vm.stack.peek();\n\n    if (other === comparison) {\n      vm.goto(target);\n    }\n  });\n  APPEND_OPCODES.add(56\n  /* AssertSame */\n  , vm => {\n    var reference = vm.stack.peek();\n\n    if (!(0, _reference2.isConst)(reference)) {\n      vm.updateWith(Assert.initialize(new _reference2.ReferenceCache(reference)));\n    }\n  });\n  APPEND_OPCODES.add(63\n  /* ToBoolean */\n  , vm => {\n    var {\n      env,\n      stack\n    } = vm;\n    stack.push(env.toConditionalReference(stack.pop()));\n  });\n\n  class Assert extends UpdatingOpcode {\n    constructor(cache) {\n      super();\n      this.type = 'assert';\n      this.tag = cache.tag;\n      this.cache = cache;\n    }\n\n    static initialize(cache) {\n      var assert = new Assert(cache);\n      cache.peek();\n      return assert;\n    }\n\n    evaluate(vm) {\n      var {\n        cache\n      } = this;\n\n      if ((0, _reference2.isModified)(cache.revalidate())) {\n        vm.throw();\n      }\n    }\n\n  }\n\n  class JumpIfNotModifiedOpcode extends UpdatingOpcode {\n    constructor(tag, target) {\n      super();\n      this.target = target;\n      this.type = 'jump-if-not-modified';\n      this.tag = tag;\n      this.lastRevision = (0, _reference2.value)(tag);\n    }\n\n    evaluate(vm) {\n      var {\n        tag,\n        target,\n        lastRevision\n      } = this;\n\n      if (!vm.alwaysRevalidate && (0, _reference2.validate)(tag, lastRevision)) {\n        vm.goto(target);\n      }\n    }\n\n    didModify() {\n      this.lastRevision = (0, _reference2.value)(this.tag);\n    }\n\n  }\n\n  class DidModifyOpcode extends UpdatingOpcode {\n    constructor(target) {\n      super();\n      this.target = target;\n      this.type = 'did-modify';\n      this.tag = _reference2.CONSTANT_TAG;\n    }\n\n    evaluate() {\n      this.target.didModify();\n    }\n\n  }\n\n  class LabelOpcode {\n    constructor(label) {\n      this.tag = _reference2.CONSTANT_TAG;\n      this.type = 'label';\n      this.label = null;\n      this.prev = null;\n      this.next = null;\n      (0, _util.initializeGuid)(this);\n      this.label = label;\n    }\n\n    evaluate() {}\n\n    inspect() {\n      return this.label + \" [\" + this._guid + \"]\";\n    }\n\n  }\n\n  APPEND_OPCODES.add(26\n  /* Text */\n  , (vm, {\n    op1: text\n  }) => {\n    vm.elements().appendText(vm.constants.getString(text));\n  });\n  APPEND_OPCODES.add(27\n  /* Comment */\n  , (vm, {\n    op1: text\n  }) => {\n    vm.elements().appendComment(vm.constants.getString(text));\n  });\n  APPEND_OPCODES.add(33\n  /* OpenElement */\n  , (vm, {\n    op1: tag\n  }) => {\n    vm.elements().openElement(vm.constants.getString(tag));\n  });\n  APPEND_OPCODES.add(34\n  /* OpenDynamicElement */\n  , vm => {\n    var tagName = vm.stack.pop().value();\n    vm.elements().openElement(tagName);\n  });\n  APPEND_OPCODES.add(41\n  /* PushRemoteElement */\n  , vm => {\n    var elementRef = vm.stack.pop();\n    var nextSiblingRef = vm.stack.pop();\n    var guidRef = vm.stack.pop();\n    var element;\n    var nextSibling;\n    var guid = guidRef.value();\n\n    if ((0, _reference2.isConst)(elementRef)) {\n      element = elementRef.value();\n    } else {\n      var cache = new _reference2.ReferenceCache(elementRef);\n      element = cache.peek();\n      vm.updateWith(new Assert(cache));\n    }\n\n    if ((0, _reference2.isConst)(nextSiblingRef)) {\n      nextSibling = nextSiblingRef.value();\n    } else {\n      var _cache = new _reference2.ReferenceCache(nextSiblingRef);\n\n      nextSibling = _cache.peek();\n      vm.updateWith(new Assert(_cache));\n    }\n\n    vm.elements().pushRemoteElement(element, guid, nextSibling);\n  });\n  APPEND_OPCODES.add(42\n  /* PopRemoteElement */\n  , vm => {\n    vm.elements().popRemoteElement();\n  });\n  APPEND_OPCODES.add(38\n  /* FlushElement */\n  , vm => {\n    var operations = vm.fetchValue(_vm2.Register.t0);\n    var modifiers = null;\n\n    if (operations) {\n      modifiers = operations.flush(vm);\n      vm.loadValue(_vm2.Register.t0, null);\n    }\n\n    vm.elements().flushElement(modifiers);\n  });\n  APPEND_OPCODES.add(39\n  /* CloseElement */\n  , vm => {\n    var modifiers = vm.elements().closeElement();\n\n    if (modifiers) {\n      modifiers.forEach(([manager, modifier]) => {\n        vm.env.scheduleInstallModifier(modifier, manager);\n        var destructor = manager.getDestructor(modifier);\n\n        if (destructor) {\n          vm.newDestroyable(destructor);\n        }\n      });\n    }\n  });\n  APPEND_OPCODES.add(40\n  /* Modifier */\n  , (vm, {\n    op1: handle\n  }) => {\n    var {\n      manager,\n      state\n    } = vm.constants.resolveHandle(handle);\n    var stack = vm.stack;\n    var args = stack.pop();\n    var {\n      constructing,\n      updateOperations\n    } = vm.elements();\n    var dynamicScope = vm.dynamicScope();\n    var modifier = manager.create(constructing, state, args, dynamicScope, updateOperations);\n    var operations = vm.fetchValue(_vm2.Register.t0);\n    operations.addModifier(manager, modifier);\n    var tag = manager.getTag(modifier);\n\n    if (!(0, _reference2.isConstTag)(tag)) {\n      vm.updateWith(new UpdateModifierOpcode(tag, manager, modifier));\n    }\n  });\n\n  class UpdateModifierOpcode extends UpdatingOpcode {\n    constructor(tag, manager, modifier) {\n      super();\n      this.tag = tag;\n      this.manager = manager;\n      this.modifier = modifier;\n      this.type = 'update-modifier';\n      this.lastUpdated = (0, _reference2.value)(tag);\n    }\n\n    evaluate(vm) {\n      var {\n        manager,\n        modifier,\n        tag,\n        lastUpdated\n      } = this;\n\n      if (!(0, _reference2.validate)(tag, lastUpdated)) {\n        vm.env.scheduleUpdateModifier(modifier, manager);\n        this.lastUpdated = (0, _reference2.value)(tag);\n      }\n    }\n\n  }\n\n  APPEND_OPCODES.add(35\n  /* StaticAttr */\n  , (vm, {\n    op1: _name,\n    op2: _value,\n    op3: _namespace\n  }) => {\n    var name = vm.constants.getString(_name);\n    var value$$1 = vm.constants.getString(_value);\n    var namespace = _namespace ? vm.constants.getString(_namespace) : null;\n    vm.elements().setStaticAttribute(name, value$$1, namespace);\n  });\n  APPEND_OPCODES.add(36\n  /* DynamicAttr */\n  , (vm, {\n    op1: _name,\n    op2: trusting,\n    op3: _namespace\n  }) => {\n    var name = vm.constants.getString(_name);\n    var reference = vm.stack.pop();\n    var value$$1 = reference.value();\n    var namespace = _namespace ? vm.constants.getString(_namespace) : null;\n    var attribute = vm.elements().setDynamicAttribute(name, value$$1, !!trusting, namespace);\n\n    if (!(0, _reference2.isConst)(reference)) {\n      vm.updateWith(new UpdateDynamicAttributeOpcode(reference, attribute));\n    }\n  });\n\n  class UpdateDynamicAttributeOpcode extends UpdatingOpcode {\n    constructor(reference, attribute) {\n      super();\n      this.reference = reference;\n      this.attribute = attribute;\n      this.type = 'patch-element';\n      var {\n        tag\n      } = reference;\n      this.tag = tag;\n      this.lastRevision = (0, _reference2.value)(tag);\n    }\n\n    evaluate(vm) {\n      var {\n        attribute,\n        reference,\n        tag\n      } = this;\n\n      if (!(0, _reference2.validate)(tag, this.lastRevision)) {\n        this.lastRevision = (0, _reference2.value)(tag);\n        attribute.update(reference.value(), vm.env);\n      }\n    }\n\n  }\n\n  function resolveComponent(resolver, name, meta) {\n    var definition = resolver.lookupComponentDefinition(name, meta);\n    return definition;\n  }\n\n  class CurryComponentReference {\n    constructor(inner, resolver, meta, args) {\n      this.inner = inner;\n      this.resolver = resolver;\n      this.meta = meta;\n      this.args = args;\n      this.tag = inner.tag;\n      this.lastValue = null;\n      this.lastDefinition = null;\n    }\n\n    value() {\n      var {\n        inner,\n        lastValue\n      } = this;\n      var value$$1 = inner.value();\n\n      if (value$$1 === lastValue) {\n        return this.lastDefinition;\n      }\n\n      var definition = null;\n\n      if (isCurriedComponentDefinition(value$$1)) {\n        definition = value$$1;\n      } else if (typeof value$$1 === 'string' && value$$1) {\n        var {\n          resolver,\n          meta\n        } = this;\n        definition = resolveComponent(resolver, value$$1, meta);\n      }\n\n      definition = this.curry(definition);\n      this.lastValue = value$$1;\n      this.lastDefinition = definition;\n      return definition;\n    }\n\n    get() {\n      return UNDEFINED_REFERENCE;\n    }\n\n    curry(definition) {\n      var {\n        args\n      } = this;\n\n      if (!args && isCurriedComponentDefinition(definition)) {\n        return definition;\n      } else if (!definition) {\n        return null;\n      } else {\n        return new CurriedComponentDefinition(definition, args);\n      }\n    }\n\n  }\n\n  class ClassListReference {\n    constructor(list) {\n      this.list = list;\n      this.tag = (0, _reference2.combineTagged)(list);\n      this.list = list;\n    }\n\n    value() {\n      var ret = [];\n      var {\n        list\n      } = this;\n\n      for (var i = 0; i < list.length; i++) {\n        var value$$1 = normalizeStringValue(list[i].value());\n        if (value$$1) ret.push(value$$1);\n      }\n\n      return ret.length === 0 ? null : ret.join(' ');\n    }\n\n  }\n  /**\n   * Converts a ComponentCapabilities object into a 32-bit integer representation.\n   */\n\n\n  function capabilityFlagsFrom(capabilities) {\n    return 0 | (capabilities.dynamicLayout ? 1\n    /* DynamicLayout */\n    : 0) | (capabilities.dynamicTag ? 2\n    /* DynamicTag */\n    : 0) | (capabilities.prepareArgs ? 4\n    /* PrepareArgs */\n    : 0) | (capabilities.createArgs ? 8\n    /* CreateArgs */\n    : 0) | (capabilities.attributeHook ? 16\n    /* AttributeHook */\n    : 0) | (capabilities.elementHook ? 32\n    /* ElementHook */\n    : 0) | (capabilities.dynamicScope ? 64\n    /* DynamicScope */\n    : 0) | (capabilities.createCaller ? 128\n    /* CreateCaller */\n    : 0) | (capabilities.updateHook ? 256\n    /* UpdateHook */\n    : 0) | (capabilities.createInstance ? 512\n    /* CreateInstance */\n    : 0);\n  }\n\n  function hasCapability(capabilities, capability) {\n    return !!(capabilities & capability);\n  }\n\n  APPEND_OPCODES.add(69\n  /* IsComponent */\n  , vm => {\n    var stack = vm.stack;\n    var ref = stack.pop();\n    stack.push(IsCurriedComponentDefinitionReference.create(ref));\n  });\n  APPEND_OPCODES.add(70\n  /* ContentType */\n  , vm => {\n    var stack = vm.stack;\n    var ref = stack.peek();\n    stack.push(new ContentTypeReference(ref));\n  });\n  APPEND_OPCODES.add(71\n  /* CurryComponent */\n  , (vm, {\n    op1: _meta\n  }) => {\n    var stack = vm.stack;\n    var definition = stack.pop();\n    var capturedArgs = stack.pop();\n    var meta = vm.constants.getSerializable(_meta);\n    var resolver = vm.constants.resolver;\n    vm.loadValue(_vm2.Register.v0, new CurryComponentReference(definition, resolver, meta, capturedArgs)); // expectStackChange(vm.stack, -args.length - 1, 'CurryComponent');\n  });\n  APPEND_OPCODES.add(72\n  /* PushComponentDefinition */\n  , (vm, {\n    op1: handle\n  }) => {\n    var definition = vm.constants.resolveHandle(handle);\n    var {\n      manager\n    } = definition;\n    var capabilities = capabilityFlagsFrom(manager.getCapabilities(definition.state));\n    var instance = {\n      definition,\n      manager,\n      capabilities,\n      state: null,\n      handle: null,\n      table: null,\n      lookup: null\n    };\n    vm.stack.push(instance);\n  });\n  APPEND_OPCODES.add(75\n  /* ResolveDynamicComponent */\n  , (vm, {\n    op1: _meta\n  }) => {\n    var stack = vm.stack;\n    var component = stack.pop().value();\n    var meta = vm.constants.getSerializable(_meta);\n    vm.loadValue(_vm2.Register.t1, null); // Clear the temp register\n\n    var definition;\n\n    if (typeof component === 'string') {\n      var {\n        constants: {\n          resolver\n        }\n      } = vm;\n      var resolvedDefinition = resolveComponent(resolver, component, meta);\n      definition = resolvedDefinition;\n    } else if (isCurriedComponentDefinition(component)) {\n      definition = component;\n    } else {\n      throw (0, _util.unreachable)();\n    }\n\n    stack.push(definition);\n  });\n  APPEND_OPCODES.add(73\n  /* PushDynamicComponentInstance */\n  , vm => {\n    var {\n      stack\n    } = vm;\n    var definition = stack.pop();\n    var capabilities, manager;\n\n    if (isCurriedComponentDefinition(definition)) {\n      manager = capabilities = null;\n    } else {\n      manager = definition.manager;\n      capabilities = capabilityFlagsFrom(manager.getCapabilities(definition.state));\n    }\n\n    stack.push({\n      definition,\n      capabilities,\n      manager,\n      state: null,\n      handle: null,\n      table: null\n    });\n  });\n  APPEND_OPCODES.add(74\n  /* PushCurriedComponent */\n  , (vm, {}) => {\n    var stack = vm.stack;\n    var component = stack.pop().value();\n    var definition;\n\n    if (isCurriedComponentDefinition(component)) {\n      definition = component;\n    } else {\n      throw (0, _util.unreachable)();\n    }\n\n    stack.push(definition);\n  });\n  APPEND_OPCODES.add(76\n  /* PushArgs */\n  , (vm, {\n    op1: _names,\n    op2: flags\n  }) => {\n    var stack = vm.stack;\n    var names = vm.constants.getStringArray(_names);\n    var positionalCount = flags >> 4;\n    var synthetic = flags & 0b1000;\n    var blockNames = [];\n    if (flags & 0b0100) blockNames.push('main');\n    if (flags & 0b0010) blockNames.push('else');\n    if (flags & 0b0001) blockNames.push('attrs');\n    vm.args.setup(stack, names, blockNames, positionalCount, !!synthetic);\n    stack.push(vm.args);\n  });\n  APPEND_OPCODES.add(77\n  /* PushEmptyArgs */\n  , vm => {\n    var {\n      stack\n    } = vm;\n    stack.push(vm.args.empty(stack));\n  });\n  APPEND_OPCODES.add(80\n  /* CaptureArgs */\n  , vm => {\n    var stack = vm.stack;\n    var args = stack.pop();\n    var capturedArgs = args.capture();\n    stack.push(capturedArgs);\n  });\n  APPEND_OPCODES.add(79\n  /* PrepareArgs */\n  , (vm, {\n    op1: _state\n  }) => {\n    var stack = vm.stack;\n    var instance = vm.fetchValue(_state);\n    var args = stack.pop();\n    var {\n      definition\n    } = instance;\n\n    if (isCurriedComponentDefinition(definition)) {\n      definition = resolveCurriedComponentDefinition(instance, definition, args);\n    }\n\n    var {\n      manager,\n      state\n    } = definition;\n    var capabilities = instance.capabilities;\n\n    if (hasCapability(capabilities, 4\n    /* PrepareArgs */\n    ) !== true) {\n      stack.push(args);\n      return;\n    }\n\n    var blocks = args.blocks.values;\n    var blockNames = args.blocks.names;\n    var preparedArgs = manager.prepareArgs(state, args);\n\n    if (preparedArgs) {\n      args.clear();\n\n      for (var i = 0; i < blocks.length; i++) {\n        stack.push(blocks[i]);\n      }\n\n      var {\n        positional,\n        named\n      } = preparedArgs;\n      var positionalCount = positional.length;\n\n      for (var _i = 0; _i < positionalCount; _i++) {\n        stack.push(positional[_i]);\n      }\n\n      var names = Object.keys(named);\n\n      for (var _i2 = 0; _i2 < names.length; _i2++) {\n        stack.push(named[names[_i2]]);\n      }\n\n      args.setup(stack, names, blockNames, positionalCount, true);\n    }\n\n    stack.push(args);\n  });\n\n  function resolveCurriedComponentDefinition(instance, definition, args) {\n    var unwrappedDefinition = instance.definition = definition.unwrap(args);\n    var {\n      manager,\n      state\n    } = unwrappedDefinition;\n    instance.manager = manager;\n    instance.capabilities = capabilityFlagsFrom(manager.getCapabilities(state));\n    return unwrappedDefinition;\n  }\n\n  APPEND_OPCODES.add(81\n  /* CreateComponent */\n  , (vm, {\n    op1: flags,\n    op2: _state\n  }) => {\n    var instance = vm.fetchValue(_state);\n    var {\n      definition,\n      manager\n    } = instance;\n    var capabilities = instance.capabilities = capabilityFlagsFrom(manager.getCapabilities(definition.state));\n    var dynamicScope = null;\n\n    if (hasCapability(capabilities, 64\n    /* DynamicScope */\n    )) {\n      dynamicScope = vm.dynamicScope();\n    }\n\n    var hasDefaultBlock = flags & 1;\n    var args = null;\n\n    if (hasCapability(capabilities, 8\n    /* CreateArgs */\n    )) {\n      args = vm.stack.peek();\n    }\n\n    var self = null;\n\n    if (hasCapability(capabilities, 128\n    /* CreateCaller */\n    )) {\n      self = vm.getSelf();\n    }\n\n    var state = manager.create(vm.env, definition.state, args, dynamicScope, self, !!hasDefaultBlock); // We want to reuse the `state` POJO here, because we know that the opcodes\n    // only transition at exactly one place.\n\n    instance.state = state;\n    var tag = manager.getTag(state);\n\n    if (hasCapability(capabilities, 256\n    /* UpdateHook */\n    ) && !(0, _reference2.isConstTag)(tag)) {\n      vm.updateWith(new UpdateComponentOpcode(tag, state, manager, dynamicScope));\n    }\n  });\n  APPEND_OPCODES.add(82\n  /* RegisterComponentDestructor */\n  , (vm, {\n    op1: _state\n  }) => {\n    var {\n      manager,\n      state\n    } = vm.fetchValue(_state);\n    var destructor = manager.getDestructor(state);\n    if (destructor) vm.newDestroyable(destructor);\n  });\n  APPEND_OPCODES.add(91\n  /* BeginComponentTransaction */\n  , vm => {\n    vm.beginCacheGroup();\n    vm.elements().pushSimpleBlock();\n  });\n  APPEND_OPCODES.add(83\n  /* PutComponentOperations */\n  , vm => {\n    vm.loadValue(_vm2.Register.t0, new ComponentElementOperations());\n  });\n  APPEND_OPCODES.add(37\n  /* ComponentAttr */\n  , (vm, {\n    op1: _name,\n    op2: trusting,\n    op3: _namespace\n  }) => {\n    var name = vm.constants.getString(_name);\n    var reference = vm.stack.pop();\n    var namespace = _namespace ? vm.constants.getString(_namespace) : null;\n    vm.fetchValue(_vm2.Register.t0).setAttribute(name, reference, !!trusting, namespace);\n  });\n\n  class ComponentElementOperations {\n    constructor() {\n      this.attributes = (0, _util.dict)();\n      this.classes = [];\n      this.modifiers = [];\n    }\n\n    setAttribute(name, value$$1, trusting, namespace) {\n      var deferred = {\n        value: value$$1,\n        namespace,\n        trusting\n      };\n\n      if (name === 'class') {\n        this.classes.push(value$$1);\n      }\n\n      this.attributes[name] = deferred;\n    }\n\n    addModifier(manager, modifier) {\n      this.modifiers.push([manager, modifier]);\n    }\n\n    flush(vm) {\n      for (var name in this.attributes) {\n        var attr = this.attributes[name];\n        var {\n          value: reference,\n          namespace,\n          trusting\n        } = attr;\n\n        if (name === 'class') {\n          reference = new ClassListReference(this.classes);\n        }\n\n        if (name === 'type') {\n          continue;\n        }\n\n        var attribute = vm.elements().setDynamicAttribute(name, reference.value(), trusting, namespace);\n\n        if (!(0, _reference2.isConst)(reference)) {\n          vm.updateWith(new UpdateDynamicAttributeOpcode(reference, attribute));\n        }\n      }\n\n      if ('type' in this.attributes) {\n        var type = this.attributes.type;\n        var {\n          value: _reference,\n          namespace: _namespace2,\n          trusting: _trusting\n        } = type;\n\n        var _attribute = vm.elements().setDynamicAttribute('type', _reference.value(), _trusting, _namespace2);\n\n        if (!(0, _reference2.isConst)(_reference)) {\n          vm.updateWith(new UpdateDynamicAttributeOpcode(_reference, _attribute));\n        }\n      }\n\n      return this.modifiers;\n    }\n\n  }\n\n  APPEND_OPCODES.add(93\n  /* DidCreateElement */\n  , (vm, {\n    op1: _state\n  }) => {\n    var {\n      definition,\n      state\n    } = vm.fetchValue(_state);\n    var {\n      manager\n    } = definition;\n    var operations = vm.fetchValue(_vm2.Register.t0);\n    var action = 'DidCreateElementOpcode#evaluate';\n    manager.didCreateElement(state, vm.elements().expectConstructing(action), operations);\n  });\n  APPEND_OPCODES.add(84\n  /* GetComponentSelf */\n  , (vm, {\n    op1: _state\n  }) => {\n    var {\n      definition,\n      state\n    } = vm.fetchValue(_state);\n    var {\n      manager\n    } = definition;\n    vm.stack.push(manager.getSelf(state));\n  });\n  APPEND_OPCODES.add(85\n  /* GetComponentTagName */\n  , (vm, {\n    op1: _state\n  }) => {\n    var {\n      definition,\n      state\n    } = vm.fetchValue(_state);\n    var {\n      manager\n    } = definition;\n    vm.stack.push(manager.getTagName(state));\n  }); // Dynamic Invocation Only\n\n  APPEND_OPCODES.add(86\n  /* GetComponentLayout */\n  , (vm, {\n    op1: _state\n  }) => {\n    var instance = vm.fetchValue(_state);\n    var {\n      manager,\n      definition\n    } = instance;\n    var {\n      constants: {\n        resolver\n      },\n      stack\n    } = vm;\n    var {\n      state: instanceState,\n      capabilities\n    } = instance;\n    var {\n      state: definitionState\n    } = definition;\n    var invoke;\n\n    if (hasStaticLayoutCapability(capabilities, manager)) {\n      invoke = manager.getLayout(definitionState, resolver);\n    } else if (hasDynamicLayoutCapability(capabilities, manager)) {\n      invoke = manager.getDynamicLayout(instanceState, resolver);\n    } else {\n      throw (0, _util.unreachable)();\n    }\n\n    stack.push(invoke.symbolTable);\n    stack.push(invoke.handle);\n  });\n\n  function hasStaticLayoutCapability(capabilities, _manager) {\n    return hasCapability(capabilities, 1\n    /* DynamicLayout */\n    ) === false;\n  }\n\n  function hasDynamicLayoutCapability(capabilities, _manager) {\n    return hasCapability(capabilities, 1\n    /* DynamicLayout */\n    ) === true;\n  }\n\n  APPEND_OPCODES.add(68\n  /* Main */\n  , (vm, {\n    op1: register\n  }) => {\n    var definition = vm.stack.pop();\n    var invocation = vm.stack.pop();\n    var {\n      manager\n    } = definition;\n    var capabilities = capabilityFlagsFrom(manager.getCapabilities(definition.state));\n    var state = {\n      definition,\n      manager,\n      capabilities,\n      state: null,\n      handle: invocation.handle,\n      table: invocation.symbolTable,\n      lookup: null\n    };\n    vm.loadValue(register, state);\n  });\n  APPEND_OPCODES.add(89\n  /* PopulateLayout */\n  , (vm, {\n    op1: _state\n  }) => {\n    var {\n      stack\n    } = vm;\n    var handle = stack.pop();\n    var table = stack.pop();\n    var state = vm.fetchValue(_state);\n    state.handle = handle;\n    state.table = table;\n  });\n  APPEND_OPCODES.add(21\n  /* VirtualRootScope */\n  , (vm, {\n    op1: _state\n  }) => {\n    var {\n      symbols\n    } = vm.fetchValue(_state).table;\n    vm.pushRootScope(symbols.length + 1, true);\n  });\n  APPEND_OPCODES.add(87\n  /* SetupForEval */\n  , (vm, {\n    op1: _state\n  }) => {\n    var state = vm.fetchValue(_state);\n\n    if (state.table.hasEval) {\n      var lookup = state.lookup = (0, _util.dict)();\n      vm.scope().bindEvalScope(lookup);\n    }\n  });\n  APPEND_OPCODES.add(2\n  /* SetNamedVariables */\n  , (vm, {\n    op1: _state\n  }) => {\n    var state = vm.fetchValue(_state);\n    var scope = vm.scope();\n    var args = vm.stack.peek();\n    var callerNames = args.named.atNames;\n\n    for (var i = callerNames.length - 1; i >= 0; i--) {\n      var atName = callerNames[i];\n      var symbol = state.table.symbols.indexOf(callerNames[i]);\n      var value$$1 = args.named.get(atName, false);\n      if (symbol !== -1) scope.bindSymbol(symbol + 1, value$$1);\n      if (state.lookup) state.lookup[atName] = value$$1;\n    }\n  });\n\n  function bindBlock(symbolName, blockName, state, blocks, vm) {\n    var symbol = state.table.symbols.indexOf(symbolName);\n    var block = blocks.get(blockName);\n\n    if (symbol !== -1) {\n      vm.scope().bindBlock(symbol + 1, block);\n    }\n\n    if (state.lookup) state.lookup[symbolName] = block;\n  }\n\n  APPEND_OPCODES.add(3\n  /* SetBlocks */\n  , (vm, {\n    op1: _state\n  }) => {\n    var state = vm.fetchValue(_state);\n    var {\n      blocks\n    } = vm.stack.peek();\n    bindBlock('&attrs', 'attrs', state, blocks, vm);\n    bindBlock('&inverse', 'else', state, blocks, vm);\n    bindBlock('&default', 'main', state, blocks, vm);\n  }); // Dynamic Invocation Only\n\n  APPEND_OPCODES.add(90\n  /* InvokeComponentLayout */\n  , (vm, {\n    op1: _state\n  }) => {\n    var state = vm.fetchValue(_state);\n    vm.call(state.handle);\n  });\n  APPEND_OPCODES.add(94\n  /* DidRenderLayout */\n  , (vm, {\n    op1: _state\n  }) => {\n    var {\n      manager,\n      state\n    } = vm.fetchValue(_state);\n    var bounds = vm.elements().popBlock();\n    var mgr = manager;\n    mgr.didRenderLayout(state, bounds);\n    vm.env.didCreate(state, manager);\n    vm.updateWith(new DidUpdateLayoutOpcode(manager, state, bounds));\n  });\n  APPEND_OPCODES.add(92\n  /* CommitComponentTransaction */\n  , vm => {\n    vm.commitCacheGroup();\n  });\n\n  class UpdateComponentOpcode extends UpdatingOpcode {\n    constructor(tag, component, manager, dynamicScope) {\n      super();\n      this.tag = tag;\n      this.component = component;\n      this.manager = manager;\n      this.dynamicScope = dynamicScope;\n      this.type = 'update-component';\n    }\n\n    evaluate(_vm) {\n      var {\n        component,\n        manager,\n        dynamicScope\n      } = this;\n      manager.update(component, dynamicScope);\n    }\n\n  }\n\n  class DidUpdateLayoutOpcode extends UpdatingOpcode {\n    constructor(manager, component, bounds) {\n      super();\n      this.manager = manager;\n      this.component = component;\n      this.bounds = bounds;\n      this.type = 'did-update-layout';\n      this.tag = _reference2.CONSTANT_TAG;\n    }\n\n    evaluate(vm) {\n      var {\n        manager,\n        component,\n        bounds\n      } = this;\n      manager.didUpdateLayout(component, bounds);\n      vm.env.didUpdate(component, manager);\n    }\n\n  }\n  /* tslint:disable */\n\n\n  function debugCallback(context, get) {\n    console.info('Use `context`, and `get(<path>)` to debug this template.'); // for example...\n\n    context === get('this');\n    debugger;\n  }\n  /* tslint:enable */\n\n\n  var callback = debugCallback; // For testing purposes\n\n  function setDebuggerCallback(cb) {\n    callback = cb;\n  }\n\n  function resetDebuggerCallback() {\n    callback = debugCallback;\n  }\n\n  class ScopeInspector {\n    constructor(scope, symbols, evalInfo) {\n      this.scope = scope;\n      this.locals = (0, _util.dict)();\n\n      for (var i = 0; i < evalInfo.length; i++) {\n        var slot = evalInfo[i];\n        var name = symbols[slot - 1];\n        var ref = scope.getSymbol(slot);\n        this.locals[name] = ref;\n      }\n    }\n\n    get(path) {\n      var {\n        scope,\n        locals\n      } = this;\n      var parts = path.split('.');\n      var [head, ...tail] = path.split('.');\n      var evalScope = scope.getEvalScope();\n      var ref;\n\n      if (head === 'this') {\n        ref = scope.getSelf();\n      } else if (locals[head]) {\n        ref = locals[head];\n      } else if (head.indexOf('@') === 0 && evalScope[head]) {\n        ref = evalScope[head];\n      } else {\n        ref = this.scope.getSelf();\n        tail = parts;\n      }\n\n      return tail.reduce((r, part) => r.get(part), ref);\n    }\n\n  }\n\n  APPEND_OPCODES.add(97\n  /* Debugger */\n  , (vm, {\n    op1: _symbols,\n    op2: _evalInfo\n  }) => {\n    var symbols = vm.constants.getStringArray(_symbols);\n    var evalInfo = vm.constants.getArray(_evalInfo);\n    var inspector = new ScopeInspector(vm.scope(), symbols, evalInfo);\n    callback(vm.getSelf().value(), path => inspector.get(path).value());\n  });\n  APPEND_OPCODES.add(95\n  /* InvokePartial */\n  , (vm, {\n    op1: _meta,\n    op2: _symbols,\n    op3: _evalInfo\n  }) => {\n    var {\n      constants,\n      constants: {\n        resolver\n      },\n      stack\n    } = vm;\n    var name = stack.pop().value();\n    var meta = constants.getSerializable(_meta);\n    var outerSymbols = constants.getStringArray(_symbols);\n    var evalInfo = constants.getArray(_evalInfo);\n    var handle = resolver.lookupPartial(name, meta);\n    var definition = resolver.resolve(handle);\n    var {\n      symbolTable,\n      handle: vmHandle\n    } = definition.getPartial();\n    {\n      var partialSymbols = symbolTable.symbols;\n      var outerScope = vm.scope();\n      var partialScope = vm.pushRootScope(partialSymbols.length, false);\n      var evalScope = outerScope.getEvalScope();\n      partialScope.bindCallerScope(outerScope.getCallerScope());\n      partialScope.bindEvalScope(evalScope);\n      partialScope.bindSelf(outerScope.getSelf());\n      var locals = Object.create(outerScope.getPartialMap());\n\n      for (var i = 0; i < evalInfo.length; i++) {\n        var slot = evalInfo[i];\n        var _name2 = outerSymbols[slot - 1];\n        var ref = outerScope.getSymbol(slot);\n        locals[_name2] = ref;\n      }\n\n      if (evalScope) {\n        for (var _i3 = 0; _i3 < partialSymbols.length; _i3++) {\n          var _name3 = partialSymbols[_i3];\n          var symbol = _i3 + 1;\n          var value$$1 = evalScope[_name3];\n          if (value$$1 !== undefined) partialScope.bind(symbol, value$$1);\n        }\n      }\n\n      partialScope.bindPartialMap(locals);\n      vm.pushFrame(); // sp += 2\n\n      vm.call(vmHandle);\n    }\n  });\n\n  class IterablePresenceReference {\n    constructor(artifacts) {\n      this.tag = artifacts.tag;\n      this.artifacts = artifacts;\n    }\n\n    value() {\n      return !this.artifacts.isEmpty();\n    }\n\n  }\n\n  APPEND_OPCODES.add(66\n  /* PutIterator */\n  , vm => {\n    var stack = vm.stack;\n    var listRef = stack.pop();\n    var key = stack.pop();\n    var iterable = vm.env.iterableFor(listRef, key.value());\n    var iterator = new _reference2.ReferenceIterator(iterable);\n    stack.push(iterator);\n    stack.push(new IterablePresenceReference(iterator.artifacts));\n  });\n  APPEND_OPCODES.add(64\n  /* EnterList */\n  , (vm, {\n    op1: relativeStart\n  }) => {\n    vm.enterList(relativeStart);\n  });\n  APPEND_OPCODES.add(65\n  /* ExitList */\n  , vm => {\n    vm.exitList();\n  });\n  APPEND_OPCODES.add(67\n  /* Iterate */\n  , (vm, {\n    op1: breaks\n  }) => {\n    var stack = vm.stack;\n    var item = stack.peek().next();\n\n    if (item) {\n      var tryOpcode = vm.iterate(item.memo, item.value);\n      vm.enterItem(item.key, tryOpcode);\n    } else {\n      vm.goto(breaks);\n    }\n  });\n\n  class Cursor {\n    constructor(element, nextSibling) {\n      this.element = element;\n      this.nextSibling = nextSibling;\n    }\n\n  }\n\n  _exports.Cursor = Cursor;\n\n  class ConcreteBounds {\n    constructor(parentNode, first, last) {\n      this.parentNode = parentNode;\n      this.first = first;\n      this.last = last;\n    }\n\n    parentElement() {\n      return this.parentNode;\n    }\n\n    firstNode() {\n      return this.first;\n    }\n\n    lastNode() {\n      return this.last;\n    }\n\n  }\n\n  _exports.ConcreteBounds = ConcreteBounds;\n\n  class SingleNodeBounds {\n    constructor(parentNode, node) {\n      this.parentNode = parentNode;\n      this.node = node;\n    }\n\n    parentElement() {\n      return this.parentNode;\n    }\n\n    firstNode() {\n      return this.node;\n    }\n\n    lastNode() {\n      return this.node;\n    }\n\n  }\n\n  function move(bounds, reference) {\n    var parent = bounds.parentElement();\n    var first = bounds.firstNode();\n    var last = bounds.lastNode();\n    var current = first;\n\n    while (true) {\n      var next = current.nextSibling;\n      parent.insertBefore(current, reference);\n\n      if (current === last) {\n        return next;\n      }\n\n      current = next;\n    }\n  }\n\n  function clear(bounds) {\n    var parent = bounds.parentElement();\n    var first = bounds.firstNode();\n    var last = bounds.lastNode();\n    var current = first;\n\n    while (true) {\n      var next = current.nextSibling;\n      parent.removeChild(current);\n\n      if (current === last) {\n        return next;\n      }\n\n      current = next;\n    }\n  } // Patch:    insertAdjacentHTML on SVG Fix\n  // Browsers: Safari, IE, Edge, Firefox ~33-34\n  // Reason:   insertAdjacentHTML does not exist on SVG elements in Safari. It is\n  //           present but throws an exception on IE and Edge. Old versions of\n  //           Firefox create nodes in the incorrect namespace.\n  // Fix:      Since IE and Edge silently fail to create SVG nodes using\n  //           innerHTML, and because Firefox may create nodes in the incorrect\n  //           namespace using innerHTML on SVG elements, an HTML-string wrapping\n  //           approach is used. A pre/post SVG tag is added to the string, then\n  //           that whole string is added to a div. The created nodes are plucked\n  //           out and applied to the target location on DOM.\n\n\n  function applySVGInnerHTMLFix(document, DOMClass, svgNamespace) {\n    if (!document) return DOMClass;\n\n    if (!shouldApplyFix(document, svgNamespace)) {\n      return DOMClass;\n    }\n\n    var div = document.createElement('div');\n    return class DOMChangesWithSVGInnerHTMLFix extends DOMClass {\n      insertHTMLBefore(parent, nextSibling, html) {\n        if (html === '') {\n          return super.insertHTMLBefore(parent, nextSibling, html);\n        }\n\n        if (parent.namespaceURI !== svgNamespace) {\n          return super.insertHTMLBefore(parent, nextSibling, html);\n        }\n\n        return fixSVG(parent, div, html, nextSibling);\n      }\n\n    };\n  }\n\n  function fixSVG(parent, div, html, reference) {\n    var source; // This is important, because decendants of the <foreignObject> integration\n    // point are parsed in the HTML namespace\n\n    if (parent.tagName.toUpperCase() === 'FOREIGNOBJECT') {\n      // IE, Edge: also do not correctly support using `innerHTML` on SVG\n      // namespaced elements. So here a wrapper is used.\n      var wrappedHtml = '<svg><foreignObject>' + html + '</foreignObject></svg>';\n      div.innerHTML = wrappedHtml;\n      source = div.firstChild.firstChild;\n    } else {\n      // IE, Edge: also do not correctly support using `innerHTML` on SVG\n      // namespaced elements. So here a wrapper is used.\n      var _wrappedHtml = '<svg>' + html + '</svg>';\n\n      div.innerHTML = _wrappedHtml;\n      source = div.firstChild;\n    }\n\n    return moveNodesBefore(source, parent, reference);\n  }\n\n  function shouldApplyFix(document, svgNamespace) {\n    var svg = document.createElementNS(svgNamespace, 'svg');\n\n    try {\n      svg['insertAdjacentHTML']('beforeend', '<circle></circle>');\n    } catch (e) {// IE, Edge: Will throw, insertAdjacentHTML is unsupported on SVG\n      // Safari: Will throw, insertAdjacentHTML is not present on SVG\n    } finally {\n      // FF: Old versions will create a node in the wrong namespace\n      if (svg.childNodes.length === 1 && svg.firstChild.namespaceURI === SVG_NAMESPACE) {\n        // The test worked as expected, no fix required\n        return false;\n      }\n\n      return true;\n    }\n  } // Patch:    Adjacent text node merging fix\n  // Browsers: IE, Edge, Firefox w/o inspector open\n  // Reason:   These browsers will merge adjacent text nodes. For exmaple given\n  //           <div>Hello</div> with div.insertAdjacentHTML(' world') browsers\n  //           with proper behavior will populate div.childNodes with two items.\n  //           These browsers will populate it with one merged node instead.\n  // Fix:      Add these nodes to a wrapper element, then iterate the childNodes\n  //           of that wrapper and move the nodes to their target location. Note\n  //           that potential SVG bugs will have been handled before this fix.\n  //           Note that this fix must only apply to the previous text node, as\n  //           the base implementation of `insertHTMLBefore` already handles\n  //           following text nodes correctly.\n\n\n  function applyTextNodeMergingFix(document, DOMClass) {\n    if (!document) return DOMClass;\n\n    if (!shouldApplyFix$1(document)) {\n      return DOMClass;\n    }\n\n    return class DOMChangesWithTextNodeMergingFix extends DOMClass {\n      constructor(document) {\n        super(document);\n        this.uselessComment = document.createComment('');\n      }\n\n      insertHTMLBefore(parent, nextSibling, html) {\n        if (html === '') {\n          return super.insertHTMLBefore(parent, nextSibling, html);\n        }\n\n        var didSetUselessComment = false;\n        var nextPrevious = nextSibling ? nextSibling.previousSibling : parent.lastChild;\n\n        if (nextPrevious && nextPrevious instanceof Text) {\n          didSetUselessComment = true;\n          parent.insertBefore(this.uselessComment, nextSibling);\n        }\n\n        var bounds = super.insertHTMLBefore(parent, nextSibling, html);\n\n        if (didSetUselessComment) {\n          parent.removeChild(this.uselessComment);\n        }\n\n        return bounds;\n      }\n\n    };\n  }\n\n  function shouldApplyFix$1(document) {\n    var mergingTextDiv = document.createElement('div');\n    mergingTextDiv.innerHTML = 'first';\n    mergingTextDiv.insertAdjacentHTML('beforeend', 'second');\n\n    if (mergingTextDiv.childNodes.length === 2) {\n      // It worked as expected, no fix required\n      return false;\n    }\n\n    return true;\n  }\n\n  var SVG_NAMESPACE = \"http://www.w3.org/2000/svg\"\n  /* SVG */\n  ; // http://www.w3.org/TR/html/syntax.html#html-integration-point\n\n  _exports.SVG_NAMESPACE = SVG_NAMESPACE;\n  var SVG_INTEGRATION_POINTS = {\n    foreignObject: 1,\n    desc: 1,\n    title: 1\n  }; // http://www.w3.org/TR/html/syntax.html#adjust-svg-attributes\n  // TODO: Adjust SVG attributes\n  // http://www.w3.org/TR/html/syntax.html#parsing-main-inforeign\n  // TODO: Adjust SVG elements\n  // http://www.w3.org/TR/html/syntax.html#parsing-main-inforeign\n\n  var BLACKLIST_TABLE = Object.create(null);\n  ['b', 'big', 'blockquote', 'body', 'br', 'center', 'code', 'dd', 'div', 'dl', 'dt', 'em', 'embed', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'hr', 'i', 'img', 'li', 'listing', 'main', 'meta', 'nobr', 'ol', 'p', 'pre', 'ruby', 's', 'small', 'span', 'strong', 'strike', 'sub', 'sup', 'table', 'tt', 'u', 'ul', 'var'].forEach(tag => BLACKLIST_TABLE[tag] = 1);\n  var WHITESPACE = /[\\t-\\r \\xA0\\u1680\\u180E\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000\\uFEFF]/;\n  var doc = typeof document === 'undefined' ? null : document;\n\n  function isWhitespace(string) {\n    return WHITESPACE.test(string);\n  }\n\n  function moveNodesBefore(source, target, nextSibling) {\n    var first = source.firstChild;\n    var last = first;\n    var current = first;\n\n    while (current) {\n      var next = current.nextSibling;\n      target.insertBefore(current, nextSibling);\n      last = current;\n      current = next;\n    }\n\n    return new ConcreteBounds(target, first, last);\n  }\n\n  class DOMOperations {\n    constructor(document) {\n      this.document = document;\n      this.setupUselessElement();\n    } // split into seperate method so that NodeDOMTreeConstruction\n    // can override it.\n\n\n    setupUselessElement() {\n      this.uselessElement = this.document.createElement('div');\n    }\n\n    createElement(tag, context) {\n      var isElementInSVGNamespace, isHTMLIntegrationPoint;\n\n      if (context) {\n        isElementInSVGNamespace = context.namespaceURI === SVG_NAMESPACE || tag === 'svg';\n        isHTMLIntegrationPoint = SVG_INTEGRATION_POINTS[context.tagName];\n      } else {\n        isElementInSVGNamespace = tag === 'svg';\n        isHTMLIntegrationPoint = false;\n      }\n\n      if (isElementInSVGNamespace && !isHTMLIntegrationPoint) {\n        // FIXME: This does not properly handle <font> with color, face, or\n        // size attributes, which is also disallowed by the spec. We should fix\n        // this.\n        if (BLACKLIST_TABLE[tag]) {\n          throw new Error(\"Cannot create a \" + tag + \" inside an SVG context\");\n        }\n\n        return this.document.createElementNS(SVG_NAMESPACE, tag);\n      } else {\n        return this.document.createElement(tag);\n      }\n    }\n\n    insertBefore(parent, node, reference) {\n      parent.insertBefore(node, reference);\n    }\n\n    insertHTMLBefore(parent, nextSibling, html) {\n      if (html === '') {\n        var comment = this.createComment('');\n        parent.insertBefore(comment, nextSibling);\n        return new ConcreteBounds(parent, comment, comment);\n      }\n\n      var prev = nextSibling ? nextSibling.previousSibling : parent.lastChild;\n      var last;\n\n      if (nextSibling === null) {\n        parent.insertAdjacentHTML(\"beforeend\"\n        /* beforeend */\n        , html);\n        last = parent.lastChild;\n      } else if (nextSibling instanceof HTMLElement) {\n        nextSibling.insertAdjacentHTML(\"beforebegin\"\n        /* beforebegin */\n        , html);\n        last = nextSibling.previousSibling;\n      } else {\n        // Non-element nodes do not support insertAdjacentHTML, so add an\n        // element and call it on that element. Then remove the element.\n        //\n        // This also protects Edge, IE and Firefox w/o the inspector open\n        // from merging adjacent text nodes. See ./compat/text-node-merging-fix.ts\n        var {\n          uselessElement\n        } = this;\n        parent.insertBefore(uselessElement, nextSibling);\n        uselessElement.insertAdjacentHTML(\"beforebegin\"\n        /* beforebegin */\n        , html);\n        last = uselessElement.previousSibling;\n        parent.removeChild(uselessElement);\n      }\n\n      var first = prev ? prev.nextSibling : parent.firstChild;\n      return new ConcreteBounds(parent, first, last);\n    }\n\n    createTextNode(text) {\n      return this.document.createTextNode(text);\n    }\n\n    createComment(data) {\n      return this.document.createComment(data);\n    }\n\n  }\n\n  var DOM;\n\n  (function (DOM) {\n    class TreeConstruction extends DOMOperations {\n      createElementNS(namespace, tag) {\n        return this.document.createElementNS(namespace, tag);\n      }\n\n      setAttribute(element, name, value$$1, namespace = null) {\n        if (namespace) {\n          element.setAttributeNS(namespace, name, value$$1);\n        } else {\n          element.setAttribute(name, value$$1);\n        }\n      }\n\n    }\n\n    DOM.TreeConstruction = TreeConstruction;\n    var appliedTreeContruction = TreeConstruction;\n    appliedTreeContruction = applyTextNodeMergingFix(doc, appliedTreeContruction);\n    appliedTreeContruction = applySVGInnerHTMLFix(doc, appliedTreeContruction, SVG_NAMESPACE);\n    DOM.DOMTreeConstruction = appliedTreeContruction;\n  })(DOM || (DOM = {}));\n\n  class DOMChanges extends DOMOperations {\n    constructor(document) {\n      super(document);\n      this.document = document;\n      this.namespace = null;\n    }\n\n    setAttribute(element, name, value$$1) {\n      element.setAttribute(name, value$$1);\n    }\n\n    removeAttribute(element, name) {\n      element.removeAttribute(name);\n    }\n\n    insertAfter(element, node, reference) {\n      this.insertBefore(element, node, reference.nextSibling);\n    }\n\n  }\n\n  _exports.IDOMChanges = DOMChanges;\n  var helper = DOMChanges;\n  helper = applyTextNodeMergingFix(doc, helper);\n  helper = applySVGInnerHTMLFix(doc, helper, SVG_NAMESPACE);\n  var helper$1 = helper;\n  _exports.DOMChanges = helper$1;\n  var DOMTreeConstruction = DOM.DOMTreeConstruction;\n  _exports.DOMTreeConstruction = DOMTreeConstruction;\n  var badProtocols = ['javascript:', 'vbscript:'];\n  var badTags = ['A', 'BODY', 'LINK', 'IMG', 'IFRAME', 'BASE', 'FORM'];\n  var badTagsForDataURI = ['EMBED'];\n  var badAttributes = ['href', 'src', 'background', 'action'];\n  var badAttributesForDataURI = ['src'];\n\n  function has(array, item) {\n    return array.indexOf(item) !== -1;\n  }\n\n  function checkURI(tagName, attribute) {\n    return (tagName === null || has(badTags, tagName)) && has(badAttributes, attribute);\n  }\n\n  function checkDataURI(tagName, attribute) {\n    if (tagName === null) return false;\n    return has(badTagsForDataURI, tagName) && has(badAttributesForDataURI, attribute);\n  }\n\n  function requiresSanitization(tagName, attribute) {\n    return checkURI(tagName, attribute) || checkDataURI(tagName, attribute);\n  }\n\n  function sanitizeAttributeValue(env, element, attribute, value$$1) {\n    var tagName = null;\n\n    if (value$$1 === null || value$$1 === undefined) {\n      return value$$1;\n    }\n\n    if (isSafeString(value$$1)) {\n      return value$$1.toHTML();\n    }\n\n    if (!element) {\n      tagName = null;\n    } else {\n      tagName = element.tagName.toUpperCase();\n    }\n\n    var str = normalizeStringValue(value$$1);\n\n    if (checkURI(tagName, attribute)) {\n      var protocol = env.protocolForURL(str);\n\n      if (has(badProtocols, protocol)) {\n        return \"unsafe:\" + str;\n      }\n    }\n\n    if (checkDataURI(tagName, attribute)) {\n      return \"unsafe:\" + str;\n    }\n\n    return str;\n  }\n  /*\n   * @method normalizeProperty\n   * @param element {HTMLElement}\n   * @param slotName {String}\n   * @returns {Object} { name, type }\n   */\n\n\n  function normalizeProperty(element, slotName) {\n    var type, normalized;\n\n    if (slotName in element) {\n      normalized = slotName;\n      type = 'prop';\n    } else {\n      var lower = slotName.toLowerCase();\n\n      if (lower in element) {\n        type = 'prop';\n        normalized = lower;\n      } else {\n        type = 'attr';\n        normalized = slotName;\n      }\n    }\n\n    if (type === 'prop' && (normalized.toLowerCase() === 'style' || preferAttr(element.tagName, normalized))) {\n      type = 'attr';\n    }\n\n    return {\n      normalized,\n      type\n    };\n  } // properties that MUST be set as attributes, due to:\n  // * browser bug\n  // * strange spec outlier\n\n\n  var ATTR_OVERRIDES = {\n    INPUT: {\n      form: true,\n      // Chrome 46.0.2464.0: 'autocorrect' in document.createElement('input') === false\n      // Safari 8.0.7: 'autocorrect' in document.createElement('input') === false\n      // Mobile Safari (iOS 8.4 simulator): 'autocorrect' in document.createElement('input') === true\n      autocorrect: true,\n      // Chrome 54.0.2840.98: 'list' in document.createElement('input') === true\n      // Safari 9.1.3: 'list' in document.createElement('input') === false\n      list: true\n    },\n    // element.form is actually a legitimate readOnly property, that is to be\n    // mutated, but must be mutated by setAttribute...\n    SELECT: {\n      form: true\n    },\n    OPTION: {\n      form: true\n    },\n    TEXTAREA: {\n      form: true\n    },\n    LABEL: {\n      form: true\n    },\n    FIELDSET: {\n      form: true\n    },\n    LEGEND: {\n      form: true\n    },\n    OBJECT: {\n      form: true\n    },\n    BUTTON: {\n      form: true\n    }\n  };\n\n  function preferAttr(tagName, propName) {\n    var tag = ATTR_OVERRIDES[tagName.toUpperCase()];\n    return tag && tag[propName.toLowerCase()] || false;\n  }\n\n  function dynamicAttribute(element, attr, namespace) {\n    var {\n      tagName,\n      namespaceURI\n    } = element;\n    var attribute = {\n      element,\n      name: attr,\n      namespace\n    };\n\n    if (namespaceURI === SVG_NAMESPACE) {\n      return buildDynamicAttribute(tagName, attr, attribute);\n    }\n\n    var {\n      type,\n      normalized\n    } = normalizeProperty(element, attr);\n\n    if (type === 'attr') {\n      return buildDynamicAttribute(tagName, normalized, attribute);\n    } else {\n      return buildDynamicProperty(tagName, normalized, attribute);\n    }\n  }\n\n  function buildDynamicAttribute(tagName, name, attribute) {\n    if (requiresSanitization(tagName, name)) {\n      return new SafeDynamicAttribute(attribute);\n    } else {\n      return new SimpleDynamicAttribute(attribute);\n    }\n  }\n\n  function buildDynamicProperty(tagName, name, attribute) {\n    if (requiresSanitization(tagName, name)) {\n      return new SafeDynamicProperty(name, attribute);\n    }\n\n    if (isUserInputValue(tagName, name)) {\n      return new InputValueDynamicAttribute(name, attribute);\n    }\n\n    if (isOptionSelected(tagName, name)) {\n      return new OptionSelectedDynamicAttribute(name, attribute);\n    }\n\n    return new DefaultDynamicProperty(name, attribute);\n  }\n\n  class DynamicAttribute {\n    constructor(attribute) {\n      this.attribute = attribute;\n    }\n\n  }\n\n  _exports.DynamicAttribute = DynamicAttribute;\n\n  class SimpleDynamicAttribute extends DynamicAttribute {\n    set(dom, value$$1, _env) {\n      var normalizedValue = normalizeValue(value$$1);\n\n      if (normalizedValue !== null) {\n        var {\n          name,\n          namespace\n        } = this.attribute;\n\n        dom.__setAttribute(name, normalizedValue, namespace);\n      }\n    }\n\n    update(value$$1, _env) {\n      var normalizedValue = normalizeValue(value$$1);\n      var {\n        element,\n        name\n      } = this.attribute;\n\n      if (normalizedValue === null) {\n        element.removeAttribute(name);\n      } else {\n        element.setAttribute(name, normalizedValue);\n      }\n    }\n\n  }\n\n  _exports.SimpleDynamicAttribute = SimpleDynamicAttribute;\n\n  class DefaultDynamicProperty extends DynamicAttribute {\n    constructor(normalizedName, attribute) {\n      super(attribute);\n      this.normalizedName = normalizedName;\n    }\n\n    set(dom, value$$1, _env) {\n      if (value$$1 !== null && value$$1 !== undefined) {\n        this.value = value$$1;\n\n        dom.__setProperty(this.normalizedName, value$$1);\n      }\n    }\n\n    update(value$$1, _env) {\n      var {\n        element\n      } = this.attribute;\n\n      if (this.value !== value$$1) {\n        element[this.normalizedName] = this.value = value$$1;\n\n        if (value$$1 === null || value$$1 === undefined) {\n          this.removeAttribute();\n        }\n      }\n    }\n\n    removeAttribute() {\n      // TODO this sucks but to preserve properties first and to meet current\n      // semantics we must do this.\n      var {\n        element,\n        namespace\n      } = this.attribute;\n\n      if (namespace) {\n        element.removeAttributeNS(namespace, this.normalizedName);\n      } else {\n        element.removeAttribute(this.normalizedName);\n      }\n    }\n\n  }\n\n  class SafeDynamicProperty extends DefaultDynamicProperty {\n    set(dom, value$$1, env) {\n      var {\n        element,\n        name\n      } = this.attribute;\n      var sanitized = sanitizeAttributeValue(env, element, name, value$$1);\n      super.set(dom, sanitized, env);\n    }\n\n    update(value$$1, env) {\n      var {\n        element,\n        name\n      } = this.attribute;\n      var sanitized = sanitizeAttributeValue(env, element, name, value$$1);\n      super.update(sanitized, env);\n    }\n\n  }\n\n  class SafeDynamicAttribute extends SimpleDynamicAttribute {\n    set(dom, value$$1, env) {\n      var {\n        element,\n        name\n      } = this.attribute;\n      var sanitized = sanitizeAttributeValue(env, element, name, value$$1);\n      super.set(dom, sanitized, env);\n    }\n\n    update(value$$1, env) {\n      var {\n        element,\n        name\n      } = this.attribute;\n      var sanitized = sanitizeAttributeValue(env, element, name, value$$1);\n      super.update(sanitized, env);\n    }\n\n  }\n\n  class InputValueDynamicAttribute extends DefaultDynamicProperty {\n    set(dom, value$$1) {\n      dom.__setProperty('value', normalizeStringValue(value$$1));\n    }\n\n    update(value$$1) {\n      var input = this.attribute.element;\n      var currentValue = input.value;\n      var normalizedValue = normalizeStringValue(value$$1);\n\n      if (currentValue !== normalizedValue) {\n        input.value = normalizedValue;\n      }\n    }\n\n  }\n\n  class OptionSelectedDynamicAttribute extends DefaultDynamicProperty {\n    set(dom, value$$1) {\n      if (value$$1 !== null && value$$1 !== undefined && value$$1 !== false) {\n        dom.__setProperty('selected', true);\n      }\n    }\n\n    update(value$$1) {\n      var option = this.attribute.element;\n\n      if (value$$1) {\n        option.selected = true;\n      } else {\n        option.selected = false;\n      }\n    }\n\n  }\n\n  function isOptionSelected(tagName, attribute) {\n    return tagName === 'OPTION' && attribute === 'selected';\n  }\n\n  function isUserInputValue(tagName, attribute) {\n    return (tagName === 'INPUT' || tagName === 'TEXTAREA') && attribute === 'value';\n  }\n\n  function normalizeValue(value$$1) {\n    if (value$$1 === false || value$$1 === undefined || value$$1 === null || typeof value$$1.toString === 'undefined') {\n      return null;\n    }\n\n    if (value$$1 === true) {\n      return '';\n    } // onclick function etc in SSR\n\n\n    if (typeof value$$1 === 'function') {\n      return null;\n    }\n\n    return String(value$$1);\n  }\n\n  class Scope {\n    constructor( // the 0th slot is `self`\n    slots, callerScope, // named arguments and blocks passed to a layout that uses eval\n    evalScope, // locals in scope when the partial was invoked\n    partialMap) {\n      this.slots = slots;\n      this.callerScope = callerScope;\n      this.evalScope = evalScope;\n      this.partialMap = partialMap;\n    }\n\n    static root(self, size = 0) {\n      var refs = new Array(size + 1);\n\n      for (var i = 0; i <= size; i++) {\n        refs[i] = UNDEFINED_REFERENCE;\n      }\n\n      return new Scope(refs, null, null, null).init({\n        self\n      });\n    }\n\n    static sized(size = 0) {\n      var refs = new Array(size + 1);\n\n      for (var i = 0; i <= size; i++) {\n        refs[i] = UNDEFINED_REFERENCE;\n      }\n\n      return new Scope(refs, null, null, null);\n    }\n\n    init({\n      self\n    }) {\n      this.slots[0] = self;\n      return this;\n    }\n\n    getSelf() {\n      return this.get(0);\n    }\n\n    getSymbol(symbol) {\n      return this.get(symbol);\n    }\n\n    getBlock(symbol) {\n      var block = this.get(symbol);\n      return block === UNDEFINED_REFERENCE ? null : block;\n    }\n\n    getEvalScope() {\n      return this.evalScope;\n    }\n\n    getPartialMap() {\n      return this.partialMap;\n    }\n\n    bind(symbol, value$$1) {\n      this.set(symbol, value$$1);\n    }\n\n    bindSelf(self) {\n      this.set(0, self);\n    }\n\n    bindSymbol(symbol, value$$1) {\n      this.set(symbol, value$$1);\n    }\n\n    bindBlock(symbol, value$$1) {\n      this.set(symbol, value$$1);\n    }\n\n    bindEvalScope(map) {\n      this.evalScope = map;\n    }\n\n    bindPartialMap(map) {\n      this.partialMap = map;\n    }\n\n    bindCallerScope(scope) {\n      this.callerScope = scope;\n    }\n\n    getCallerScope() {\n      return this.callerScope;\n    }\n\n    child() {\n      return new Scope(this.slots.slice(), this.callerScope, this.evalScope, this.partialMap);\n    }\n\n    get(index) {\n      if (index >= this.slots.length) {\n        throw new RangeError(\"BUG: cannot get $\" + index + \" from scope; length=\" + this.slots.length);\n      }\n\n      return this.slots[index];\n    }\n\n    set(index, value$$1) {\n      if (index >= this.slots.length) {\n        throw new RangeError(\"BUG: cannot get $\" + index + \" from scope; length=\" + this.slots.length);\n      }\n\n      this.slots[index] = value$$1;\n    }\n\n  }\n\n  _exports.Scope = Scope;\n\n  class Transaction {\n    constructor() {\n      this.scheduledInstallManagers = [];\n      this.scheduledInstallModifiers = [];\n      this.scheduledUpdateModifierManagers = [];\n      this.scheduledUpdateModifiers = [];\n      this.createdComponents = [];\n      this.createdManagers = [];\n      this.updatedComponents = [];\n      this.updatedManagers = [];\n      this.destructors = [];\n    }\n\n    didCreate(component, manager) {\n      this.createdComponents.push(component);\n      this.createdManagers.push(manager);\n    }\n\n    didUpdate(component, manager) {\n      this.updatedComponents.push(component);\n      this.updatedManagers.push(manager);\n    }\n\n    scheduleInstallModifier(modifier, manager) {\n      this.scheduledInstallModifiers.push(modifier);\n      this.scheduledInstallManagers.push(manager);\n    }\n\n    scheduleUpdateModifier(modifier, manager) {\n      this.scheduledUpdateModifiers.push(modifier);\n      this.scheduledUpdateModifierManagers.push(manager);\n    }\n\n    didDestroy(d) {\n      this.destructors.push(d);\n    }\n\n    commit() {\n      var {\n        createdComponents,\n        createdManagers\n      } = this;\n\n      for (var i = 0; i < createdComponents.length; i++) {\n        var component = createdComponents[i];\n        var manager = createdManagers[i];\n        manager.didCreate(component);\n      }\n\n      var {\n        updatedComponents,\n        updatedManagers\n      } = this;\n\n      for (var _i4 = 0; _i4 < updatedComponents.length; _i4++) {\n        var _component = updatedComponents[_i4];\n        var _manager2 = updatedManagers[_i4];\n\n        _manager2.didUpdate(_component);\n      }\n\n      var {\n        destructors\n      } = this;\n\n      for (var _i5 = 0; _i5 < destructors.length; _i5++) {\n        destructors[_i5].destroy();\n      }\n\n      var {\n        scheduledInstallManagers,\n        scheduledInstallModifiers\n      } = this;\n\n      for (var _i6 = 0; _i6 < scheduledInstallManagers.length; _i6++) {\n        var modifier = scheduledInstallModifiers[_i6];\n        var _manager3 = scheduledInstallManagers[_i6];\n\n        _manager3.install(modifier);\n      }\n\n      var {\n        scheduledUpdateModifierManagers,\n        scheduledUpdateModifiers\n      } = this;\n\n      for (var _i7 = 0; _i7 < scheduledUpdateModifierManagers.length; _i7++) {\n        var _modifier = scheduledUpdateModifiers[_i7];\n        var _manager4 = scheduledUpdateModifierManagers[_i7];\n\n        _manager4.update(_modifier);\n      }\n    }\n\n  }\n\n  class Environment {\n    constructor({\n      appendOperations,\n      updateOperations\n    }) {\n      this._transaction = null;\n      this.appendOperations = appendOperations;\n      this.updateOperations = updateOperations;\n    }\n\n    toConditionalReference(reference) {\n      return new ConditionalReference(reference);\n    }\n\n    getAppendOperations() {\n      return this.appendOperations;\n    }\n\n    getDOM() {\n      return this.updateOperations;\n    }\n\n    begin() {\n      this._transaction = new Transaction();\n    }\n\n    get transaction() {\n      return this._transaction;\n    }\n\n    didCreate(component, manager) {\n      this.transaction.didCreate(component, manager);\n    }\n\n    didUpdate(component, manager) {\n      this.transaction.didUpdate(component, manager);\n    }\n\n    scheduleInstallModifier(modifier, manager) {\n      this.transaction.scheduleInstallModifier(modifier, manager);\n    }\n\n    scheduleUpdateModifier(modifier, manager) {\n      this.transaction.scheduleUpdateModifier(modifier, manager);\n    }\n\n    didDestroy(d) {\n      this.transaction.didDestroy(d);\n    }\n\n    commit() {\n      var transaction = this.transaction;\n      this._transaction = null;\n      transaction.commit();\n    }\n\n    attributeFor(element, attr, _isTrusting, namespace = null) {\n      return dynamicAttribute(element, attr, namespace);\n    }\n\n  }\n\n  _exports.Environment = Environment;\n\n  class DefaultEnvironment extends Environment {\n    constructor(options) {\n      if (!options) {\n        var _document = window.document;\n        var appendOperations = new DOMTreeConstruction(_document);\n        var updateOperations = new DOMChanges(_document);\n        options = {\n          appendOperations,\n          updateOperations\n        };\n      }\n\n      super(options);\n    }\n\n  }\n\n  _exports.DefaultEnvironment = DefaultEnvironment;\n\n  class LowLevelVM {\n    constructor(stack, heap, program, externs, pc = -1, ra = -1) {\n      this.stack = stack;\n      this.heap = heap;\n      this.program = program;\n      this.externs = externs;\n      this.pc = pc;\n      this.ra = ra;\n      this.currentOpSize = 0;\n    } // Start a new frame and save $ra and $fp on the stack\n\n\n    pushFrame() {\n      this.stack.push(this.ra);\n      this.stack.push(this.stack.fp);\n      this.stack.fp = this.stack.sp - 1;\n    } // Restore $ra, $sp and $fp\n\n\n    popFrame() {\n      this.stack.sp = this.stack.fp - 1;\n      this.ra = this.stack.get(0);\n      this.stack.fp = this.stack.get(1);\n    }\n\n    pushSmallFrame() {\n      this.stack.push(this.ra);\n    }\n\n    popSmallFrame() {\n      this.ra = this.stack.popSmi();\n    } // Jump to an address in `program`\n\n\n    goto(offset) {\n      var addr = this.pc + offset - this.currentOpSize;\n      this.pc = addr;\n    } // Save $pc into $ra, then jump to a new address in `program` (jal in MIPS)\n\n\n    call(handle) {\n      this.ra = this.pc;\n      this.pc = this.heap.getaddr(handle);\n    } // Put a specific `program` address in $ra\n\n\n    returnTo(offset) {\n      var addr = this.pc + offset - this.currentOpSize;\n      this.ra = addr;\n    } // Return to the `program` address stored in $ra\n\n\n    return() {\n      this.pc = this.ra;\n    }\n\n    nextStatement() {\n      var {\n        pc,\n        program\n      } = this;\n\n      if (pc === -1) {\n        return null;\n      } // We have to save off the current operations size so that\n      // when we do a jump we can calculate the correct offset\n      // to where we are going. We can't simply ask for the size\n      // in a jump because we have have already incremented the\n      // program counter to the next instruction prior to executing.\n\n\n      var {\n        size\n      } = this.program.opcode(pc);\n      var operationSize = this.currentOpSize = size;\n      this.pc += operationSize;\n      return program.opcode(pc);\n    }\n\n    evaluateOuter(opcode, vm) {\n      {\n        this.evaluateInner(opcode, vm);\n      }\n    }\n\n    evaluateInner(opcode, vm) {\n      if (opcode.isMachine) {\n        this.evaluateMachine(opcode);\n      } else {\n        this.evaluateSyscall(opcode, vm);\n      }\n    }\n\n    evaluateMachine(opcode) {\n      switch (opcode.type) {\n        case 57\n        /* PushFrame */\n        :\n          return this.pushFrame();\n\n        case 58\n        /* PopFrame */\n        :\n          return this.popFrame();\n\n        case 59\n        /* PushSmallFrame */\n        :\n          return this.pushSmallFrame();\n\n        case 60\n        /* PopSmallFrame */\n        :\n          return this.popSmallFrame();\n\n        case 50\n        /* InvokeStatic */\n        :\n          return this.call(opcode.op1);\n\n        case 49\n        /* InvokeVirtual */\n        :\n          return this.call(this.stack.popSmi());\n\n        case 52\n        /* Jump */\n        :\n          return this.goto(opcode.op1);\n\n        case 24\n        /* Return */\n        :\n          return this.return();\n\n        case 25\n        /* ReturnTo */\n        :\n          return this.returnTo(opcode.op1);\n      }\n    }\n\n    evaluateSyscall(opcode, vm) {\n      APPEND_OPCODES.evaluate(vm, opcode, opcode.type);\n    }\n\n  }\n\n  class First {\n    constructor(node) {\n      this.node = node;\n    }\n\n    firstNode() {\n      return this.node;\n    }\n\n  }\n\n  class Last {\n    constructor(node) {\n      this.node = node;\n    }\n\n    lastNode() {\n      return this.node;\n    }\n\n  }\n\n  class NewElementBuilder {\n    constructor(env, parentNode, nextSibling) {\n      this.constructing = null;\n      this.operations = null;\n      this.cursorStack = new _util.Stack();\n      this.modifierStack = new _util.Stack();\n      this.blockStack = new _util.Stack();\n      this.pushElement(parentNode, nextSibling);\n      this.env = env;\n      this.dom = env.getAppendOperations();\n      this.updateOperations = env.getDOM();\n    }\n\n    static forInitialRender(env, cursor) {\n      var builder = new this(env, cursor.element, cursor.nextSibling);\n      builder.pushSimpleBlock();\n      return builder;\n    }\n\n    static resume(env, tracker, nextSibling) {\n      var parentNode = tracker.parentElement();\n      var stack = new this(env, parentNode, nextSibling);\n      stack.pushSimpleBlock();\n      stack.pushBlockTracker(tracker);\n      return stack;\n    }\n\n    get element() {\n      return this.cursorStack.current.element;\n    }\n\n    get nextSibling() {\n      return this.cursorStack.current.nextSibling;\n    }\n\n    expectConstructing(method) {\n      return this.constructing;\n    }\n\n    block() {\n      return this.blockStack.current;\n    }\n\n    popElement() {\n      this.cursorStack.pop();\n      this.cursorStack.current;\n    }\n\n    pushSimpleBlock() {\n      return this.pushBlockTracker(new SimpleBlockTracker(this.element));\n    }\n\n    pushUpdatableBlock() {\n      return this.pushBlockTracker(new UpdatableBlockTracker(this.element));\n    }\n\n    pushBlockList(list) {\n      return this.pushBlockTracker(new BlockListTracker(this.element, list));\n    }\n\n    pushBlockTracker(tracker, isRemote = false) {\n      var current = this.blockStack.current;\n\n      if (current !== null) {\n        current.newDestroyable(tracker);\n\n        if (!isRemote) {\n          current.didAppendBounds(tracker);\n        }\n      }\n\n      this.__openBlock();\n\n      this.blockStack.push(tracker);\n      return tracker;\n    }\n\n    popBlock() {\n      this.block().finalize(this);\n\n      this.__closeBlock();\n\n      return this.blockStack.pop();\n    }\n\n    __openBlock() {}\n\n    __closeBlock() {} // todo return seems unused\n\n\n    openElement(tag) {\n      var element = this.__openElement(tag);\n\n      this.constructing = element;\n      return element;\n    }\n\n    __openElement(tag) {\n      return this.dom.createElement(tag, this.element);\n    }\n\n    flushElement(modifiers) {\n      var parent = this.element;\n      var element = this.constructing;\n\n      this.__flushElement(parent, element);\n\n      this.constructing = null;\n      this.operations = null;\n      this.pushModifiers(modifiers);\n      this.pushElement(element, null);\n      this.didOpenElement(element);\n    }\n\n    __flushElement(parent, constructing) {\n      this.dom.insertBefore(parent, constructing, this.nextSibling);\n    }\n\n    closeElement() {\n      this.willCloseElement();\n      this.popElement();\n      return this.popModifiers();\n    }\n\n    pushRemoteElement(element, guid, nextSibling = null) {\n      this.__pushRemoteElement(element, guid, nextSibling);\n    }\n\n    __pushRemoteElement(element, _guid, nextSibling) {\n      this.pushElement(element, nextSibling);\n      var tracker = new RemoteBlockTracker(element);\n      this.pushBlockTracker(tracker, true);\n    }\n\n    popRemoteElement() {\n      this.popBlock();\n      this.popElement();\n    }\n\n    pushElement(element, nextSibling) {\n      this.cursorStack.push(new Cursor(element, nextSibling));\n    }\n\n    pushModifiers(modifiers) {\n      this.modifierStack.push(modifiers);\n    }\n\n    popModifiers() {\n      return this.modifierStack.pop();\n    }\n\n    didAddDestroyable(d) {\n      this.block().newDestroyable(d);\n    }\n\n    didAppendBounds(bounds) {\n      this.block().didAppendBounds(bounds);\n      return bounds;\n    }\n\n    didAppendNode(node) {\n      this.block().didAppendNode(node);\n      return node;\n    }\n\n    didOpenElement(element) {\n      this.block().openElement(element);\n      return element;\n    }\n\n    willCloseElement() {\n      this.block().closeElement();\n    }\n\n    appendText(string) {\n      return this.didAppendNode(this.__appendText(string));\n    }\n\n    __appendText(text) {\n      var {\n        dom,\n        element,\n        nextSibling\n      } = this;\n      var node = dom.createTextNode(text);\n      dom.insertBefore(element, node, nextSibling);\n      return node;\n    }\n\n    __appendNode(node) {\n      this.dom.insertBefore(this.element, node, this.nextSibling);\n      return node;\n    }\n\n    __appendFragment(fragment) {\n      var first = fragment.firstChild;\n\n      if (first) {\n        var ret = new ConcreteBounds(this.element, first, fragment.lastChild);\n        this.dom.insertBefore(this.element, fragment, this.nextSibling);\n        return ret;\n      } else {\n        return new SingleNodeBounds(this.element, this.__appendComment(''));\n      }\n    }\n\n    __appendHTML(html) {\n      return this.dom.insertHTMLBefore(this.element, this.nextSibling, html);\n    }\n\n    appendDynamicHTML(value$$1) {\n      var bounds = this.trustedContent(value$$1);\n      this.didAppendBounds(bounds);\n    }\n\n    appendDynamicText(value$$1) {\n      var node = this.untrustedContent(value$$1);\n      this.didAppendNode(node);\n      return node;\n    }\n\n    appendDynamicFragment(value$$1) {\n      var bounds = this.__appendFragment(value$$1);\n\n      this.didAppendBounds(bounds);\n    }\n\n    appendDynamicNode(value$$1) {\n      var node = this.__appendNode(value$$1);\n\n      var bounds = new SingleNodeBounds(this.element, node);\n      this.didAppendBounds(bounds);\n    }\n\n    trustedContent(value$$1) {\n      return this.__appendHTML(value$$1);\n    }\n\n    untrustedContent(value$$1) {\n      return this.__appendText(value$$1);\n    }\n\n    appendComment(string) {\n      return this.didAppendNode(this.__appendComment(string));\n    }\n\n    __appendComment(string) {\n      var {\n        dom,\n        element,\n        nextSibling\n      } = this;\n      var node = dom.createComment(string);\n      dom.insertBefore(element, node, nextSibling);\n      return node;\n    }\n\n    __setAttribute(name, value$$1, namespace) {\n      this.dom.setAttribute(this.constructing, name, value$$1, namespace);\n    }\n\n    __setProperty(name, value$$1) {\n      this.constructing[name] = value$$1;\n    }\n\n    setStaticAttribute(name, value$$1, namespace) {\n      this.__setAttribute(name, value$$1, namespace);\n    }\n\n    setDynamicAttribute(name, value$$1, trusting, namespace) {\n      var element = this.constructing;\n      var attribute = this.env.attributeFor(element, name, trusting, namespace);\n      attribute.set(this, value$$1, this.env);\n      return attribute;\n    }\n\n  }\n\n  _exports.NewElementBuilder = NewElementBuilder;\n\n  class SimpleBlockTracker {\n    constructor(parent) {\n      this.parent = parent;\n      this.first = null;\n      this.last = null;\n      this.destroyables = null;\n      this.nesting = 0;\n    }\n\n    destroy() {\n      var {\n        destroyables\n      } = this;\n\n      if (destroyables && destroyables.length) {\n        for (var i = 0; i < destroyables.length; i++) {\n          destroyables[i].destroy();\n        }\n      }\n    }\n\n    parentElement() {\n      return this.parent;\n    }\n\n    firstNode() {\n      var first = this.first;\n      return first.firstNode();\n    }\n\n    lastNode() {\n      var last = this.last;\n      return last.lastNode();\n    }\n\n    openElement(element) {\n      this.didAppendNode(element);\n      this.nesting++;\n    }\n\n    closeElement() {\n      this.nesting--;\n    }\n\n    didAppendNode(node) {\n      if (this.nesting !== 0) return;\n\n      if (!this.first) {\n        this.first = new First(node);\n      }\n\n      this.last = new Last(node);\n    }\n\n    didAppendBounds(bounds) {\n      if (this.nesting !== 0) return;\n\n      if (!this.first) {\n        this.first = bounds;\n      }\n\n      this.last = bounds;\n    }\n\n    newDestroyable(d) {\n      this.destroyables = this.destroyables || [];\n      this.destroyables.push(d);\n    }\n\n    finalize(stack) {\n      if (this.first === null) {\n        stack.appendComment('');\n      }\n    }\n\n  }\n\n  class RemoteBlockTracker extends SimpleBlockTracker {\n    destroy() {\n      super.destroy();\n      clear(this);\n    }\n\n  }\n\n  class UpdatableBlockTracker extends SimpleBlockTracker {\n    reset(env) {\n      var {\n        destroyables\n      } = this;\n\n      if (destroyables && destroyables.length) {\n        for (var i = 0; i < destroyables.length; i++) {\n          env.didDestroy(destroyables[i]);\n        }\n      }\n\n      var nextSibling = clear(this);\n      this.first = null;\n      this.last = null;\n      this.destroyables = null;\n      this.nesting = 0;\n      return nextSibling;\n    }\n\n  }\n\n  class BlockListTracker {\n    constructor(parent, boundList) {\n      this.parent = parent;\n      this.boundList = boundList;\n      this.parent = parent;\n      this.boundList = boundList;\n    }\n\n    destroy() {\n      this.boundList.forEachNode(node => node.destroy());\n    }\n\n    parentElement() {\n      return this.parent;\n    }\n\n    firstNode() {\n      var head = this.boundList.head();\n      return head.firstNode();\n    }\n\n    lastNode() {\n      var tail = this.boundList.tail();\n      return tail.lastNode();\n    }\n\n    openElement(_element) {}\n\n    closeElement() {}\n\n    didAppendNode(_node) {}\n\n    didAppendBounds(_bounds) {}\n\n    newDestroyable(_d) {}\n\n    finalize(_stack) {}\n\n  }\n\n  function clientBuilder(env, cursor) {\n    return NewElementBuilder.forInitialRender(env, cursor);\n  }\n\n  var MAX_SMI = 0xfffffff;\n\n  class InnerStack {\n    constructor(inner = new _lowLevel.Stack(), js = []) {\n      this.inner = inner;\n      this.js = js;\n    }\n\n    slice(start, end) {\n      var inner;\n\n      if (typeof start === 'number' && typeof end === 'number') {\n        inner = this.inner.slice(start, end);\n      } else if (typeof start === 'number' && end === undefined) {\n        inner = this.inner.sliceFrom(start);\n      } else {\n        inner = this.inner.clone();\n      }\n\n      return new InnerStack(inner, this.js.slice(start, end));\n    }\n\n    sliceInner(start, end) {\n      var out = [];\n\n      for (var i = start; i < end; i++) {\n        out.push(this.get(i));\n      }\n\n      return out;\n    }\n\n    copy(from, to) {\n      this.inner.copy(from, to);\n    }\n\n    write(pos, value$$1) {\n      if (isImmediate(value$$1)) {\n        this.inner.writeRaw(pos, encodeImmediate(value$$1));\n      } else {\n        var idx = this.js.length;\n        this.js.push(value$$1);\n        this.inner.writeRaw(pos, ~idx);\n      }\n    }\n\n    writeRaw(pos, value$$1) {\n      this.inner.writeRaw(pos, value$$1);\n    }\n\n    get(pos) {\n      var value$$1 = this.inner.getRaw(pos);\n\n      if (value$$1 < 0) {\n        return this.js[~value$$1];\n      } else {\n        return decodeImmediate(value$$1);\n      }\n    }\n\n    reset() {\n      this.inner.reset();\n      this.js.length = 0;\n    }\n\n    get length() {\n      return this.inner.len();\n    }\n\n  }\n\n  class EvaluationStack {\n    constructor(stack, fp, sp) {\n      this.stack = stack;\n      this.fp = fp;\n      this.sp = sp;\n    }\n\n    static empty() {\n      return new this(new InnerStack(), 0, -1);\n    }\n\n    static restore(snapshot) {\n      var stack = new InnerStack();\n\n      for (var i = 0; i < snapshot.length; i++) {\n        stack.write(i, snapshot[i]);\n      }\n\n      return new this(stack, 0, snapshot.length - 1);\n    }\n\n    push(value$$1) {\n      this.stack.write(++this.sp, value$$1);\n    }\n\n    pushEncodedImmediate(value$$1) {\n      this.stack.writeRaw(++this.sp, value$$1);\n    }\n\n    pushNull() {\n      this.stack.write(++this.sp, null);\n    }\n\n    dup(position = this.sp) {\n      this.stack.copy(position, ++this.sp);\n    }\n\n    copy(from, to) {\n      this.stack.copy(from, to);\n    }\n\n    pop(n = 1) {\n      var top = this.stack.get(this.sp);\n      this.sp -= n;\n      return top;\n    }\n\n    popSmi() {\n      return this.stack.get(this.sp--);\n    }\n\n    peek(offset = 0) {\n      return this.stack.get(this.sp - offset);\n    }\n\n    get(offset, base = this.fp) {\n      return this.stack.get(base + offset);\n    }\n\n    set(value$$1, offset, base = this.fp) {\n      this.stack.write(base + offset, value$$1);\n    }\n\n    slice(start, end) {\n      return this.stack.slice(start, end);\n    }\n\n    sliceArray(start, end) {\n      return this.stack.sliceInner(start, end);\n    }\n\n    capture(items) {\n      var end = this.sp + 1;\n      var start = end - items;\n      return this.stack.sliceInner(start, end);\n    }\n\n    reset() {\n      this.stack.reset();\n    }\n\n    toArray() {\n      return this.stack.sliceInner(this.fp, this.sp + 1);\n    }\n\n  }\n\n  function isImmediate(value$$1) {\n    var type = typeof value$$1;\n    if (value$$1 === null || value$$1 === undefined) return true;\n\n    switch (type) {\n      case 'boolean':\n      case 'undefined':\n        return true;\n\n      case 'number':\n        // not an integer\n        if (value$$1 % 1 !== 0) return false;\n        var abs = Math.abs(value$$1);\n        if (abs > MAX_SMI) return false;\n        return true;\n\n      default:\n        return false;\n    }\n  }\n\n  function encodeSmi(primitive) {\n    if (primitive < 0) {\n      var abs = Math.abs(primitive);\n      if (abs > MAX_SMI) throw new Error('not smi');\n      return Math.abs(primitive) << 3 | 4\n      /* NEGATIVE */\n      ;\n    } else {\n      if (primitive > MAX_SMI) throw new Error('not smi');\n      return primitive << 3 | 0\n      /* NUMBER */\n      ;\n    }\n  }\n\n  function encodeImmediate(primitive) {\n    switch (typeof primitive) {\n      case 'number':\n        return encodeSmi(primitive);\n\n      case 'boolean':\n        return primitive ? 11\n        /* True */\n        : 3\n        /* False */\n        ;\n\n      case 'object':\n        // assume null\n        return 19\n        /* Null */\n        ;\n\n      case 'undefined':\n        return 27\n        /* Undef */\n        ;\n\n      default:\n        throw (0, _util.unreachable)();\n    }\n  }\n\n  function decodeSmi(smi) {\n    switch (smi & 0b111) {\n      case 0\n      /* NUMBER */\n      :\n        return smi >> 3;\n\n      case 4\n      /* NEGATIVE */\n      :\n        return -(smi >> 3);\n\n      default:\n        throw (0, _util.unreachable)();\n    }\n  }\n\n  function decodeImmediate(immediate) {\n    switch (immediate) {\n      case 3\n      /* False */\n      :\n        return false;\n\n      case 11\n      /* True */\n      :\n        return true;\n\n      case 19\n      /* Null */\n      :\n        return null;\n\n      case 27\n      /* Undef */\n      :\n        return undefined;\n\n      default:\n        return decodeSmi(immediate);\n    }\n  }\n\n  class UpdatingVM {\n    constructor(env, program, {\n      alwaysRevalidate = false\n    }) {\n      this.frameStack = new _util.Stack();\n      this.env = env;\n      this.constants = program.constants;\n      this.dom = env.getDOM();\n      this.alwaysRevalidate = alwaysRevalidate;\n    }\n\n    execute(opcodes, handler) {\n      var {\n        frameStack\n      } = this;\n      this.try(opcodes, handler);\n\n      while (true) {\n        if (frameStack.isEmpty()) break;\n        var opcode = this.frame.nextStatement();\n\n        if (opcode === null) {\n          this.frameStack.pop();\n          continue;\n        }\n\n        opcode.evaluate(this);\n      }\n    }\n\n    get frame() {\n      return this.frameStack.current;\n    }\n\n    goto(op) {\n      this.frame.goto(op);\n    }\n\n    try(ops, handler) {\n      this.frameStack.push(new UpdatingVMFrame(ops, handler));\n    }\n\n    throw() {\n      this.frame.handleException();\n      this.frameStack.pop();\n    }\n\n  }\n\n  _exports.UpdatingVM = UpdatingVM;\n\n  class BlockOpcode extends UpdatingOpcode {\n    constructor(start, state, runtime, bounds, children) {\n      super();\n      this.start = start;\n      this.state = state;\n      this.runtime = runtime;\n      this.type = 'block';\n      this.next = null;\n      this.prev = null;\n      this.children = children;\n      this.bounds = bounds;\n    }\n\n    parentElement() {\n      return this.bounds.parentElement();\n    }\n\n    firstNode() {\n      return this.bounds.firstNode();\n    }\n\n    lastNode() {\n      return this.bounds.lastNode();\n    }\n\n    evaluate(vm) {\n      vm.try(this.children, null);\n    }\n\n    destroy() {\n      this.bounds.destroy();\n    }\n\n    didDestroy() {\n      this.runtime.env.didDestroy(this.bounds);\n    }\n\n  }\n\n  class TryOpcode extends BlockOpcode {\n    constructor(start, state, runtime, bounds, children) {\n      super(start, state, runtime, bounds, children);\n      this.type = 'try';\n      this.tag = this._tag = (0, _reference2.createUpdatableTag)();\n    }\n\n    didInitializeChildren() {\n      (0, _reference2.update)(this._tag, (0, _reference2.combineSlice)(this.children));\n    }\n\n    evaluate(vm) {\n      vm.try(this.children, this);\n    }\n\n    handleException() {\n      var {\n        state,\n        bounds,\n        children,\n        start,\n        prev,\n        next,\n        runtime\n      } = this;\n      children.clear();\n      var elementStack = NewElementBuilder.resume(runtime.env, bounds, bounds.reset(runtime.env));\n      var vm = VM.resume(state, runtime, elementStack);\n      var updating = new _util.LinkedList();\n      vm.execute(start, vm => {\n        vm.stack = EvaluationStack.restore(state.stack);\n        vm.updatingOpcodeStack.push(updating);\n        vm.updateWith(this);\n        vm.updatingOpcodeStack.push(children);\n      });\n      this.prev = prev;\n      this.next = next;\n    }\n\n  }\n\n  class ListRevalidationDelegate {\n    constructor(opcode, marker) {\n      this.opcode = opcode;\n      this.marker = marker;\n      this.didInsert = false;\n      this.didDelete = false;\n      this.map = opcode.map;\n      this.updating = opcode['children'];\n    }\n\n    insert(key, item, memo, before) {\n      var {\n        map,\n        opcode,\n        updating\n      } = this;\n      var nextSibling = null;\n      var reference = null;\n\n      if (typeof before === 'string') {\n        reference = map[before];\n        nextSibling = reference['bounds'].firstNode();\n      } else {\n        nextSibling = this.marker;\n      }\n\n      var vm = opcode.vmForInsertion(nextSibling);\n      var tryOpcode = null;\n      var {\n        start\n      } = opcode;\n      vm.execute(start, vm => {\n        map[key] = tryOpcode = vm.iterate(memo, item);\n        vm.updatingOpcodeStack.push(new _util.LinkedList());\n        vm.updateWith(tryOpcode);\n        vm.updatingOpcodeStack.push(tryOpcode.children);\n      });\n      updating.insertBefore(tryOpcode, reference);\n      this.didInsert = true;\n    }\n\n    retain(_key, _item, _memo) {}\n\n    move(key, _item, _memo, before) {\n      var {\n        map,\n        updating\n      } = this;\n      var entry = map[key];\n      var reference = map[before] || null;\n\n      if (typeof before === 'string') {\n        move(entry, reference.firstNode());\n      } else {\n        move(entry, this.marker);\n      }\n\n      updating.remove(entry);\n      updating.insertBefore(entry, reference);\n    }\n\n    delete(key) {\n      var {\n        map\n      } = this;\n      var opcode = map[key];\n      opcode.didDestroy();\n      clear(opcode);\n      this.updating.remove(opcode);\n      delete map[key];\n      this.didDelete = true;\n    }\n\n    done() {\n      this.opcode.didInitializeChildren(this.didInsert || this.didDelete);\n    }\n\n  }\n\n  class ListBlockOpcode extends BlockOpcode {\n    constructor(start, state, runtime, bounds, children, artifacts) {\n      super(start, state, runtime, bounds, children);\n      this.type = 'list-block';\n      this.map = (0, _util.dict)();\n      this.lastIterated = _reference2.INITIAL;\n      this.artifacts = artifacts;\n\n      var _tag = this._tag = (0, _reference2.createUpdatableTag)();\n\n      this.tag = (0, _reference2.combine)([artifacts.tag, _tag]);\n    }\n\n    didInitializeChildren(listDidChange = true) {\n      this.lastIterated = (0, _reference2.value)(this.artifacts.tag);\n\n      if (listDidChange) {\n        (0, _reference2.update)(this._tag, (0, _reference2.combineSlice)(this.children));\n      }\n    }\n\n    evaluate(vm) {\n      var {\n        artifacts,\n        lastIterated\n      } = this;\n\n      if (!(0, _reference2.validate)(artifacts.tag, lastIterated)) {\n        var {\n          bounds\n        } = this;\n        var {\n          dom\n        } = vm;\n        var marker = dom.createComment('');\n        dom.insertAfter(bounds.parentElement(), marker, bounds.lastNode());\n        var target = new ListRevalidationDelegate(this, marker);\n        var synchronizer = new _reference2.IteratorSynchronizer({\n          target,\n          artifacts\n        });\n        synchronizer.sync();\n        this.parentElement().removeChild(marker);\n      } // Run now-updated updating opcodes\n\n\n      super.evaluate(vm);\n    }\n\n    vmForInsertion(nextSibling) {\n      var {\n        bounds,\n        state,\n        runtime\n      } = this;\n      var elementStack = NewElementBuilder.forInitialRender(runtime.env, {\n        element: bounds.parentElement(),\n        nextSibling\n      });\n      return VM.resume(state, runtime, elementStack);\n    }\n\n  }\n\n  class UpdatingVMFrame {\n    constructor(ops, exceptionHandler) {\n      this.ops = ops;\n      this.exceptionHandler = exceptionHandler;\n      this.current = ops.head();\n    }\n\n    goto(op) {\n      this.current = op;\n    }\n\n    nextStatement() {\n      var {\n        current,\n        ops\n      } = this;\n      if (current) this.current = ops.nextNode(current);\n      return current;\n    }\n\n    handleException() {\n      if (this.exceptionHandler) {\n        this.exceptionHandler.handleException();\n      }\n    }\n\n  }\n\n  class RenderResult {\n    constructor(env, program, updating, bounds) {\n      this.env = env;\n      this.program = program;\n      this.updating = updating;\n      this.bounds = bounds;\n    }\n\n    rerender({\n      alwaysRevalidate = false\n    } = {\n      alwaysRevalidate: false\n    }) {\n      var {\n        env,\n        program,\n        updating\n      } = this;\n      var vm = new UpdatingVM(env, program, {\n        alwaysRevalidate\n      });\n      vm.execute(updating, this);\n    }\n\n    parentElement() {\n      return this.bounds.parentElement();\n    }\n\n    firstNode() {\n      return this.bounds.firstNode();\n    }\n\n    lastNode() {\n      return this.bounds.lastNode();\n    }\n\n    handleException() {\n      throw 'this should never happen';\n    }\n\n    destroy() {\n      this.bounds.destroy();\n      clear(this.bounds);\n    }\n\n  }\n\n  _exports.RenderResult = RenderResult;\n\n  class Arguments {\n    constructor() {\n      this.stack = null;\n      this.positional = new PositionalArguments();\n      this.named = new NamedArguments();\n      this.blocks = new BlockArguments();\n    }\n\n    empty(stack) {\n      var base = stack.sp + 1;\n      this.named.empty(stack, base);\n      this.positional.empty(stack, base);\n      this.blocks.empty(stack, base);\n      return this;\n    }\n\n    setup(stack, names, blockNames, positionalCount, synthetic) {\n      this.stack = stack;\n      /*\n             | ... | blocks      | positional  | named |\n             | ... | b0    b1    | p0 p1 p2 p3 | n0 n1 |\n       index | ... | 4/5/6 7/8/9 | 10 11 12 13 | 14 15 |\n                     ^             ^             ^  ^\n                   bbase         pbase       nbase  sp\n      */\n\n      var named = this.named;\n      var namedCount = names.length;\n      var namedBase = stack.sp - namedCount + 1;\n      named.setup(stack, namedBase, namedCount, names, synthetic);\n      var positional = this.positional;\n      var positionalBase = namedBase - positionalCount;\n      positional.setup(stack, positionalBase, positionalCount);\n      var blocks = this.blocks;\n      var blocksCount = blockNames.length;\n      var blocksBase = positionalBase - blocksCount * 3;\n      blocks.setup(stack, blocksBase, blocksCount, blockNames);\n    }\n\n    get tag() {\n      return (0, _reference2.combineTagged)([this.positional, this.named]);\n    }\n\n    get base() {\n      return this.blocks.base;\n    }\n\n    get length() {\n      return this.positional.length + this.named.length + this.blocks.length * 3;\n    }\n\n    at(pos) {\n      return this.positional.at(pos);\n    }\n\n    realloc(offset) {\n      var {\n        stack\n      } = this;\n\n      if (offset > 0 && stack !== null) {\n        var {\n          positional,\n          named\n        } = this;\n        var newBase = positional.base + offset;\n        var length = positional.length + named.length;\n\n        for (var i = length - 1; i >= 0; i--) {\n          stack.copy(i + positional.base, i + newBase);\n        }\n\n        positional.base += offset;\n        named.base += offset;\n        stack.sp += offset;\n      }\n    }\n\n    capture() {\n      var positional = this.positional.length === 0 ? EMPTY_POSITIONAL : this.positional.capture();\n      var named = this.named.length === 0 ? EMPTY_NAMED : this.named.capture();\n      return new CapturedArguments(this.tag, positional, named, this.length);\n    }\n\n    clear() {\n      var {\n        stack,\n        length\n      } = this;\n      if (length > 0 && stack !== null) stack.pop(length);\n    }\n\n  }\n\n  class CapturedArguments {\n    constructor(tag, positional, named, length) {\n      this.tag = tag;\n      this.positional = positional;\n      this.named = named;\n      this.length = length;\n    }\n\n    value() {\n      return {\n        named: this.named.value(),\n        positional: this.positional.value()\n      };\n    }\n\n  }\n\n  class PositionalArguments {\n    constructor() {\n      this.base = 0;\n      this.length = 0;\n      this.stack = null;\n      this._tag = null;\n      this._references = null;\n    }\n\n    empty(stack, base) {\n      this.stack = stack;\n      this.base = base;\n      this.length = 0;\n      this._tag = _reference2.CONSTANT_TAG;\n      this._references = _util.EMPTY_ARRAY;\n    }\n\n    setup(stack, base, length) {\n      this.stack = stack;\n      this.base = base;\n      this.length = length;\n\n      if (length === 0) {\n        this._tag = _reference2.CONSTANT_TAG;\n        this._references = _util.EMPTY_ARRAY;\n      } else {\n        this._tag = null;\n        this._references = null;\n      }\n    }\n\n    get tag() {\n      var tag = this._tag;\n\n      if (!tag) {\n        tag = this._tag = (0, _reference2.combineTagged)(this.references);\n      }\n\n      return tag;\n    }\n\n    at(position) {\n      var {\n        base,\n        length,\n        stack\n      } = this;\n\n      if (position < 0 || position >= length) {\n        return UNDEFINED_REFERENCE;\n      }\n\n      return stack.get(position, base);\n    }\n\n    capture() {\n      return new CapturedPositionalArguments(this.tag, this.references);\n    }\n\n    prepend(other) {\n      var additions = other.length;\n\n      if (additions > 0) {\n        var {\n          base,\n          length,\n          stack\n        } = this;\n        this.base = base = base - additions;\n        this.length = length + additions;\n\n        for (var i = 0; i < additions; i++) {\n          stack.set(other.at(i), i, base);\n        }\n\n        this._tag = null;\n        this._references = null;\n      }\n    }\n\n    get references() {\n      var references = this._references;\n\n      if (!references) {\n        var {\n          stack,\n          base,\n          length\n        } = this;\n        references = this._references = stack.sliceArray(base, base + length);\n      }\n\n      return references;\n    }\n\n  }\n\n  class CapturedPositionalArguments {\n    constructor(tag, references, length = references.length) {\n      this.tag = tag;\n      this.references = references;\n      this.length = length;\n    }\n\n    static empty() {\n      return new CapturedPositionalArguments(_reference2.CONSTANT_TAG, _util.EMPTY_ARRAY, 0);\n    }\n\n    at(position) {\n      return this.references[position];\n    }\n\n    value() {\n      return this.references.map(this.valueOf);\n    }\n\n    get(name) {\n      var {\n        references,\n        length\n      } = this;\n\n      if (name === 'length') {\n        return PrimitiveReference.create(length);\n      } else {\n        var idx = parseInt(name, 10);\n\n        if (idx < 0 || idx >= length) {\n          return UNDEFINED_REFERENCE;\n        } else {\n          return references[idx];\n        }\n      }\n    }\n\n    valueOf(reference) {\n      return reference.value();\n    }\n\n  }\n\n  class NamedArguments {\n    constructor() {\n      this.base = 0;\n      this.length = 0;\n      this._references = null;\n      this._names = _util.EMPTY_ARRAY;\n      this._atNames = _util.EMPTY_ARRAY;\n    }\n\n    empty(stack, base) {\n      this.stack = stack;\n      this.base = base;\n      this.length = 0;\n      this._references = _util.EMPTY_ARRAY;\n      this._names = _util.EMPTY_ARRAY;\n      this._atNames = _util.EMPTY_ARRAY;\n    }\n\n    setup(stack, base, length, names, synthetic) {\n      this.stack = stack;\n      this.base = base;\n      this.length = length;\n\n      if (length === 0) {\n        this._references = _util.EMPTY_ARRAY;\n        this._names = _util.EMPTY_ARRAY;\n        this._atNames = _util.EMPTY_ARRAY;\n      } else {\n        this._references = null;\n\n        if (synthetic) {\n          this._names = names;\n          this._atNames = null;\n        } else {\n          this._names = null;\n          this._atNames = names;\n        }\n      }\n    }\n\n    get tag() {\n      return (0, _reference2.combineTagged)(this.references);\n    }\n\n    get names() {\n      var names = this._names;\n\n      if (!names) {\n        names = this._names = this._atNames.map(this.toSyntheticName);\n      }\n\n      return names;\n    }\n\n    get atNames() {\n      var atNames = this._atNames;\n\n      if (!atNames) {\n        atNames = this._atNames = this._names.map(this.toAtName);\n      }\n\n      return atNames;\n    }\n\n    has(name) {\n      return this.names.indexOf(name) !== -1;\n    }\n\n    get(name, synthetic = true) {\n      var {\n        base,\n        stack\n      } = this;\n      var names = synthetic ? this.names : this.atNames;\n      var idx = names.indexOf(name);\n\n      if (idx === -1) {\n        return UNDEFINED_REFERENCE;\n      }\n\n      return stack.get(idx, base);\n    }\n\n    capture() {\n      return new CapturedNamedArguments(this.tag, this.names, this.references);\n    }\n\n    merge(other) {\n      var {\n        length: extras\n      } = other;\n\n      if (extras > 0) {\n        var {\n          names,\n          length,\n          stack\n        } = this;\n        var {\n          names: extraNames\n        } = other;\n\n        if (Object.isFrozen(names) && names.length === 0) {\n          names = [];\n        }\n\n        for (var i = 0; i < extras; i++) {\n          var name = extraNames[i];\n          var idx = names.indexOf(name);\n\n          if (idx === -1) {\n            length = names.push(name);\n            stack.push(other.references[i]);\n          }\n        }\n\n        this.length = length;\n        this._references = null;\n        this._names = names;\n        this._atNames = null;\n      }\n    }\n\n    get references() {\n      var references = this._references;\n\n      if (!references) {\n        var {\n          base,\n          length,\n          stack\n        } = this;\n        references = this._references = stack.sliceArray(base, base + length);\n      }\n\n      return references;\n    }\n\n    toSyntheticName(name) {\n      return name.slice(1);\n    }\n\n    toAtName(name) {\n      return \"@\" + name;\n    }\n\n  }\n\n  class CapturedNamedArguments {\n    constructor(tag, names, references) {\n      this.tag = tag;\n      this.names = names;\n      this.references = references;\n      this.length = names.length;\n      this._map = null;\n    }\n\n    get map() {\n      var map = this._map;\n\n      if (!map) {\n        var {\n          names,\n          references\n        } = this;\n        map = this._map = (0, _util.dict)();\n\n        for (var i = 0; i < names.length; i++) {\n          var name = names[i];\n          map[name] = references[i];\n        }\n      }\n\n      return map;\n    }\n\n    has(name) {\n      return this.names.indexOf(name) !== -1;\n    }\n\n    get(name) {\n      var {\n        names,\n        references\n      } = this;\n      var idx = names.indexOf(name);\n\n      if (idx === -1) {\n        return UNDEFINED_REFERENCE;\n      } else {\n        return references[idx];\n      }\n    }\n\n    value() {\n      var {\n        names,\n        references\n      } = this;\n      var out = (0, _util.dict)();\n\n      for (var i = 0; i < names.length; i++) {\n        var name = names[i];\n        out[name] = references[i].value();\n      }\n\n      return out;\n    }\n\n  }\n\n  class BlockArguments {\n    constructor() {\n      this.internalValues = null;\n      this.internalTag = null;\n      this.names = _util.EMPTY_ARRAY;\n      this.length = 0;\n      this.base = 0;\n    }\n\n    empty(stack, base) {\n      this.stack = stack;\n      this.names = _util.EMPTY_ARRAY;\n      this.base = base;\n      this.length = 0;\n      this.internalTag = _reference2.CONSTANT_TAG;\n      this.internalValues = _util.EMPTY_ARRAY;\n    }\n\n    setup(stack, base, length, names) {\n      this.stack = stack;\n      this.names = names;\n      this.base = base;\n      this.length = length;\n\n      if (length === 0) {\n        this.internalTag = _reference2.CONSTANT_TAG;\n        this.internalValues = _util.EMPTY_ARRAY;\n      } else {\n        this.internalTag = null;\n        this.internalValues = null;\n      }\n    }\n\n    get values() {\n      var values = this.internalValues;\n\n      if (!values) {\n        var {\n          base,\n          length,\n          stack\n        } = this;\n        values = this.internalValues = stack.sliceArray(base, base + length * 3);\n      }\n\n      return values;\n    }\n\n    has(name) {\n      return this.names.indexOf(name) !== -1;\n    }\n\n    get(name) {\n      var {\n        base,\n        stack,\n        names\n      } = this;\n      var idx = names.indexOf(name);\n\n      if (names.indexOf(name) === -1) {\n        return null;\n      }\n\n      var table = stack.get(idx * 3, base);\n      var scope = stack.get(idx * 3 + 1, base); // FIXME(mmun): shouldn't need to cast this\n\n      var handle = stack.get(idx * 3 + 2, base);\n      return handle === null ? null : [handle, scope, table];\n    }\n\n    capture() {\n      return new CapturedBlockArguments(this.names, this.values);\n    }\n\n  }\n\n  class CapturedBlockArguments {\n    constructor(names, values) {\n      this.names = names;\n      this.values = values;\n      this.length = names.length;\n    }\n\n    has(name) {\n      return this.names.indexOf(name) !== -1;\n    }\n\n    get(name) {\n      var idx = this.names.indexOf(name);\n      if (idx === -1) return null;\n      return [this.values[idx * 3 + 2], this.values[idx * 3 + 1], this.values[idx * 3]];\n    }\n\n  }\n\n  var EMPTY_NAMED = new CapturedNamedArguments(_reference2.CONSTANT_TAG, _util.EMPTY_ARRAY, _util.EMPTY_ARRAY);\n  var EMPTY_POSITIONAL = new CapturedPositionalArguments(_reference2.CONSTANT_TAG, _util.EMPTY_ARRAY);\n  var EMPTY_ARGS = new CapturedArguments(_reference2.CONSTANT_TAG, EMPTY_POSITIONAL, EMPTY_NAMED, 0);\n  _exports.EMPTY_ARGS = EMPTY_ARGS;\n\n  class VM {\n    constructor(runtime, scope, dynamicScope, elementStack) {\n      this.runtime = runtime;\n      this.elementStack = elementStack;\n      this.dynamicScopeStack = new _util.Stack();\n      this.scopeStack = new _util.Stack();\n      this.updatingOpcodeStack = new _util.Stack();\n      this.cacheGroups = new _util.Stack();\n      this.listBlockStack = new _util.Stack();\n      this.s0 = null;\n      this.s1 = null;\n      this.t0 = null;\n      this.t1 = null;\n      this.v0 = null;\n      this.heap = this.program.heap;\n      this.constants = this.program.constants;\n      this.elementStack = elementStack;\n      this.scopeStack.push(scope);\n      this.dynamicScopeStack.push(dynamicScope);\n      this.args = new Arguments();\n      this.inner = new LowLevelVM(EvaluationStack.empty(), this.heap, runtime.program, {\n        debugBefore: opcode => {\n          return APPEND_OPCODES.debugBefore(this, opcode, opcode.type);\n        },\n        debugAfter: (opcode, state) => {\n          APPEND_OPCODES.debugAfter(this, opcode, opcode.type, state);\n        }\n      });\n    }\n\n    get stack() {\n      return this.inner.stack;\n    }\n\n    set stack(value$$1) {\n      this.inner.stack = value$$1;\n    }\n    /* Registers */\n\n\n    set currentOpSize(value$$1) {\n      this.inner.currentOpSize = value$$1;\n    }\n\n    get currentOpSize() {\n      return this.inner.currentOpSize;\n    }\n\n    get pc() {\n      return this.inner.pc;\n    }\n\n    set pc(value$$1) {\n      this.inner.pc = value$$1;\n    }\n\n    get ra() {\n      return this.inner.ra;\n    }\n\n    set ra(value$$1) {\n      this.inner.ra = value$$1;\n    }\n\n    get fp() {\n      return this.stack.fp;\n    }\n\n    set fp(fp) {\n      this.stack.fp = fp;\n    }\n\n    get sp() {\n      return this.stack.sp;\n    }\n\n    set sp(sp) {\n      this.stack.sp = sp;\n    } // Fetch a value from a register onto the stack\n\n\n    fetch(register) {\n      this.stack.push(this[_vm2.Register[register]]);\n    } // Load a value from the stack into a register\n\n\n    load(register) {\n      this[_vm2.Register[register]] = this.stack.pop();\n    } // Fetch a value from a register\n\n\n    fetchValue(register) {\n      return this[_vm2.Register[register]];\n    } // Load a value into a register\n\n\n    loadValue(register, value$$1) {\n      this[_vm2.Register[register]] = value$$1;\n    }\n    /**\n     * Migrated to Inner\n     */\n    // Start a new frame and save $ra and $fp on the stack\n\n\n    pushFrame() {\n      this.inner.pushFrame();\n    } // Restore $ra, $sp and $fp\n\n\n    popFrame() {\n      this.inner.popFrame();\n    } // Jump to an address in `program`\n\n\n    goto(offset) {\n      this.inner.goto(offset);\n    } // Save $pc into $ra, then jump to a new address in `program` (jal in MIPS)\n\n\n    call(handle) {\n      this.inner.call(handle);\n    } // Put a specific `program` address in $ra\n\n\n    returnTo(offset) {\n      this.inner.returnTo(offset);\n    } // Return to the `program` address stored in $ra\n\n\n    return() {\n      this.inner.return();\n    }\n    /**\n     * End of migrated.\n     */\n\n\n    static initial(program, env, self, dynamicScope, elementStack, handle) {\n      var scopeSize = program.heap.scopesizeof(handle);\n      var scope = Scope.root(self, scopeSize);\n      var vm = new VM({\n        program,\n        env\n      }, scope, dynamicScope, elementStack);\n      vm.pc = vm.heap.getaddr(handle);\n      vm.updatingOpcodeStack.push(new _util.LinkedList());\n      return vm;\n    }\n\n    static empty(program, env, elementStack, handle) {\n      var dynamicScope = {\n        get() {\n          return UNDEFINED_REFERENCE;\n        },\n\n        set() {\n          return UNDEFINED_REFERENCE;\n        },\n\n        child() {\n          return dynamicScope;\n        }\n\n      };\n      var vm = new VM({\n        program,\n        env\n      }, Scope.root(UNDEFINED_REFERENCE, 0), dynamicScope, elementStack);\n      vm.updatingOpcodeStack.push(new _util.LinkedList());\n      vm.pc = vm.heap.getaddr(handle);\n      return vm;\n    }\n\n    static resume({\n      scope,\n      dynamicScope\n    }, runtime, stack) {\n      return new VM(runtime, scope, dynamicScope, stack);\n    }\n\n    get program() {\n      return this.runtime.program;\n    }\n\n    get env() {\n      return this.runtime.env;\n    }\n\n    capture(args) {\n      return {\n        dynamicScope: this.dynamicScope(),\n        scope: this.scope(),\n        stack: this.stack.capture(args)\n      };\n    }\n\n    beginCacheGroup() {\n      this.cacheGroups.push(this.updating().tail());\n    }\n\n    commitCacheGroup() {\n      //        JumpIfNotModified(END)\n      //        (head)\n      //        (....)\n      //        (tail)\n      //        DidModify\n      // END:   Noop\n      var END = new LabelOpcode('END');\n      var opcodes = this.updating();\n      var marker = this.cacheGroups.pop();\n      var head = marker ? opcodes.nextNode(marker) : opcodes.head();\n      var tail = opcodes.tail();\n      var tag = (0, _reference2.combineSlice)(new _util.ListSlice(head, tail));\n      var guard = new JumpIfNotModifiedOpcode(tag, END);\n      opcodes.insertBefore(guard, head);\n      opcodes.append(new DidModifyOpcode(guard));\n      opcodes.append(END);\n    }\n\n    enter(args) {\n      var updating = new _util.LinkedList();\n      var state = this.capture(args);\n      var tracker = this.elements().pushUpdatableBlock();\n      var tryOpcode = new TryOpcode(this.heap.gethandle(this.pc), state, this.runtime, tracker, updating);\n      this.didEnter(tryOpcode);\n    }\n\n    iterate(memo, value$$1) {\n      var stack = this.stack;\n      stack.push(value$$1);\n      stack.push(memo);\n      var state = this.capture(2);\n      var tracker = this.elements().pushUpdatableBlock(); // let ip = this.ip;\n      // this.ip = end + 4;\n      // this.frames.push(ip);\n\n      return new TryOpcode(this.heap.gethandle(this.pc), state, this.runtime, tracker, new _util.LinkedList());\n    }\n\n    enterItem(key, opcode) {\n      this.listBlock().map[key] = opcode;\n      this.didEnter(opcode);\n    }\n\n    enterList(relativeStart) {\n      var updating = new _util.LinkedList();\n      var state = this.capture(0);\n      var tracker = this.elements().pushBlockList(updating);\n      var artifacts = this.stack.peek().artifacts;\n      var addr = this.pc + relativeStart - this.currentOpSize;\n      var start = this.heap.gethandle(addr);\n      var opcode = new ListBlockOpcode(start, state, this.runtime, tracker, updating, artifacts);\n      this.listBlockStack.push(opcode);\n      this.didEnter(opcode);\n    }\n\n    didEnter(opcode) {\n      this.updateWith(opcode);\n      this.updatingOpcodeStack.push(opcode.children);\n    }\n\n    exit() {\n      this.elements().popBlock();\n      this.updatingOpcodeStack.pop();\n      var parent = this.updating().tail();\n      parent.didInitializeChildren();\n    }\n\n    exitList() {\n      this.exit();\n      this.listBlockStack.pop();\n    }\n\n    updateWith(opcode) {\n      this.updating().append(opcode);\n    }\n\n    listBlock() {\n      return this.listBlockStack.current;\n    }\n\n    updating() {\n      return this.updatingOpcodeStack.current;\n    }\n\n    elements() {\n      return this.elementStack;\n    }\n\n    scope() {\n      return this.scopeStack.current;\n    }\n\n    dynamicScope() {\n      return this.dynamicScopeStack.current;\n    }\n\n    pushChildScope() {\n      this.scopeStack.push(this.scope().child());\n    }\n\n    pushDynamicScope() {\n      var child = this.dynamicScope().child();\n      this.dynamicScopeStack.push(child);\n      return child;\n    }\n\n    pushRootScope(size, bindCaller) {\n      var scope = Scope.sized(size);\n      if (bindCaller) scope.bindCallerScope(this.scope());\n      this.scopeStack.push(scope);\n      return scope;\n    }\n\n    pushScope(scope) {\n      this.scopeStack.push(scope);\n    }\n\n    popScope() {\n      this.scopeStack.pop();\n    }\n\n    popDynamicScope() {\n      this.dynamicScopeStack.pop();\n    }\n\n    newDestroyable(d) {\n      this.elements().didAddDestroyable(d);\n    } /// SCOPE HELPERS\n\n\n    getSelf() {\n      return this.scope().getSelf();\n    }\n\n    referenceForSymbol(symbol) {\n      return this.scope().getSymbol(symbol);\n    } /// EXECUTION\n\n\n    execute(start, initialize) {\n      this.pc = this.heap.getaddr(start);\n      if (initialize) initialize(this);\n      var result;\n\n      while (true) {\n        result = this.next();\n        if (result.done) break;\n      }\n\n      return result.value;\n    }\n\n    next() {\n      var {\n        env,\n        program,\n        updatingOpcodeStack,\n        elementStack\n      } = this;\n      var opcode = this.inner.nextStatement();\n      var result;\n\n      if (opcode !== null) {\n        this.inner.evaluateOuter(opcode, this);\n        result = {\n          done: false,\n          value: null\n        };\n      } else {\n        // Unload the stack\n        this.stack.reset();\n        result = {\n          done: true,\n          value: new RenderResult(env, program, updatingOpcodeStack.pop(), elementStack.popBlock())\n        };\n      }\n\n      return result;\n    }\n\n    bindDynamicScope(names) {\n      var scope = this.dynamicScope();\n\n      for (var i = names.length - 1; i >= 0; i--) {\n        var name = this.constants.getString(names[i]);\n        scope.set(name, this.stack.pop());\n      }\n    }\n\n  }\n\n  _exports.LowLevelVM = VM;\n\n  class TemplateIteratorImpl {\n    constructor(vm) {\n      this.vm = vm;\n    }\n\n    next() {\n      return this.vm.next();\n    }\n\n  }\n\n  function renderMain(program, env, self, dynamicScope, builder, handle) {\n    var vm = VM.initial(program, env, self, dynamicScope, builder, handle);\n    return new TemplateIteratorImpl(vm);\n  }\n  /**\n   * Returns a TemplateIterator configured to render a root component.\n   */\n\n\n  function renderComponent(program, env, builder, main, name, args = {}) {\n    var vm = VM.empty(program, env, builder, main);\n    var {\n      resolver\n    } = vm.constants;\n    var definition = resolveComponent(resolver, name, null);\n    var {\n      manager,\n      state\n    } = definition;\n    var capabilities = capabilityFlagsFrom(manager.getCapabilities(state));\n    var invocation;\n\n    if (hasStaticLayoutCapability(capabilities, manager)) {\n      invocation = manager.getLayout(state, resolver);\n    } else {\n      throw new Error('Cannot invoke components with dynamic layouts as a root component.');\n    } // Get a list of tuples of argument names and references, like\n    // [['title', reference], ['name', reference]]\n\n\n    var argList = Object.keys(args).map(key => [key, args[key]]);\n    var blockNames = ['main', 'else', 'attrs']; // Prefix argument names with `@` symbol\n\n    var argNames = argList.map(([name]) => \"@\" + name);\n    vm.pushFrame(); // Push blocks on to the stack, three stack values per block\n\n    for (var i = 0; i < 3 * blockNames.length; i++) {\n      vm.stack.push(null);\n    }\n\n    vm.stack.push(null); // For each argument, push its backing reference on to the stack\n\n    argList.forEach(([, reference]) => {\n      vm.stack.push(reference);\n    }); // Configure VM based on blocks and args just pushed on to the stack.\n\n    vm.args.setup(vm.stack, argNames, blockNames, 0, false); // Needed for the Op.Main opcode: arguments, component invocation object, and\n    // component definition.\n\n    vm.stack.push(vm.args);\n    vm.stack.push(invocation);\n    vm.stack.push(definition);\n    return new TemplateIteratorImpl(vm);\n  }\n\n  class DynamicVarReference {\n    constructor(scope, nameRef) {\n      this.scope = scope;\n      this.nameRef = nameRef;\n      var varTag = this.varTag = (0, _reference2.createUpdatableTag)();\n      this.tag = (0, _reference2.combine)([nameRef.tag, varTag]);\n    }\n\n    value() {\n      return this.getVar().value();\n    }\n\n    get(key) {\n      return this.getVar().get(key);\n    }\n\n    getVar() {\n      var name = String(this.nameRef.value());\n      var ref = this.scope.get(name);\n      (0, _reference2.update)(this.varTag, ref.tag);\n      return ref;\n    }\n\n  }\n\n  function getDynamicVar(vm, args) {\n    var scope = vm.dynamicScope();\n    var nameRef = args.positional.at(0);\n    return new DynamicVarReference(scope, nameRef);\n  }\n  /** @internal */\n\n\n  var DEFAULT_CAPABILITIES = {\n    dynamicLayout: true,\n    dynamicTag: true,\n    prepareArgs: true,\n    createArgs: true,\n    attributeHook: false,\n    elementHook: false,\n    dynamicScope: true,\n    createCaller: false,\n    updateHook: true,\n    createInstance: true\n  };\n  _exports.DEFAULT_CAPABILITIES = DEFAULT_CAPABILITIES;\n  var MINIMAL_CAPABILITIES = {\n    dynamicLayout: false,\n    dynamicTag: false,\n    prepareArgs: false,\n    createArgs: false,\n    attributeHook: false,\n    elementHook: false,\n    dynamicScope: false,\n    createCaller: false,\n    updateHook: false,\n    createInstance: false\n  };\n  _exports.MINIMAL_CAPABILITIES = MINIMAL_CAPABILITIES;\n  var SERIALIZATION_FIRST_NODE_STRING = '%+b:0%';\n  _exports.SERIALIZATION_FIRST_NODE_STRING = SERIALIZATION_FIRST_NODE_STRING;\n\n  function isSerializationFirstNode(node) {\n    return node.nodeValue === SERIALIZATION_FIRST_NODE_STRING;\n  }\n\n  class RehydratingCursor extends Cursor {\n    constructor(element, nextSibling, startingBlockDepth) {\n      super(element, nextSibling);\n      this.startingBlockDepth = startingBlockDepth;\n      this.candidate = null;\n      this.injectedOmittedNode = false;\n      this.openBlockDepth = startingBlockDepth - 1;\n    }\n\n  }\n\n  class RehydrateBuilder extends NewElementBuilder {\n    // private candidate: Option<Simple.Node> = null;\n    constructor(env, parentNode, nextSibling) {\n      super(env, parentNode, nextSibling);\n      this.unmatchedAttributes = null;\n      this.blockDepth = 0;\n      if (nextSibling) throw new Error('Rehydration with nextSibling not supported');\n      var node = this.currentCursor.element.firstChild;\n\n      while (node !== null) {\n        if (isComment(node) && isSerializationFirstNode(node)) {\n          break;\n        }\n\n        node = node.nextSibling;\n      }\n\n      this.candidate = node;\n    }\n\n    get currentCursor() {\n      return this.cursorStack.current;\n    }\n\n    get candidate() {\n      if (this.currentCursor) {\n        return this.currentCursor.candidate;\n      }\n\n      return null;\n    }\n\n    set candidate(node) {\n      this.currentCursor.candidate = node;\n    }\n\n    pushElement(element, nextSibling) {\n      var {\n        blockDepth = 0\n      } = this;\n      var cursor = new RehydratingCursor(element, nextSibling, blockDepth);\n      var currentCursor = this.currentCursor;\n\n      if (currentCursor) {\n        if (currentCursor.candidate) {\n          /**\n           * <div>   <---------------  currentCursor.element\n           *   <!--%+b:1%-->\n           *   <div> <---------------  currentCursor.candidate -> cursor.element\n           *     <!--%+b:2%--> <-  currentCursor.candidate.firstChild -> cursor.candidate\n           *     Foo\n           *     <!--%-b:2%-->\n           *   </div>\n           *   <!--%-b:1%-->  <--  becomes currentCursor.candidate\n           */\n          // where to rehydrate from if we are in rehydration mode\n          cursor.candidate = element.firstChild; // where to continue when we pop\n\n          currentCursor.candidate = element.nextSibling;\n        }\n      }\n\n      this.cursorStack.push(cursor);\n    }\n\n    clearMismatch(candidate) {\n      var current = candidate;\n      var currentCursor = this.currentCursor;\n\n      if (currentCursor !== null) {\n        var openBlockDepth = currentCursor.openBlockDepth;\n\n        if (openBlockDepth >= currentCursor.startingBlockDepth) {\n          while (current && !(isComment(current) && getCloseBlockDepth(current) === openBlockDepth)) {\n            current = this.remove(current);\n          }\n        } else {\n          while (current !== null) {\n            current = this.remove(current);\n          }\n        } // current cursor parentNode should be openCandidate if element\n        // or openCandidate.parentNode if comment\n\n\n        currentCursor.nextSibling = current; // disable rehydration until we popElement or closeBlock for openBlockDepth\n\n        currentCursor.candidate = null;\n      }\n    }\n\n    __openBlock() {\n      var {\n        currentCursor\n      } = this;\n      if (currentCursor === null) return;\n      var blockDepth = this.blockDepth;\n      this.blockDepth++;\n      var {\n        candidate\n      } = currentCursor;\n      if (candidate === null) return;\n      var {\n        tagName\n      } = currentCursor.element;\n\n      if (isComment(candidate) && getOpenBlockDepth(candidate) === blockDepth) {\n        currentCursor.candidate = this.remove(candidate);\n        currentCursor.openBlockDepth = blockDepth;\n      } else if (tagName !== 'TITLE' && tagName !== 'SCRIPT' && tagName !== 'STYLE') {\n        this.clearMismatch(candidate);\n      }\n    }\n\n    __closeBlock() {\n      var {\n        currentCursor\n      } = this;\n      if (currentCursor === null) return; // openBlock is the last rehydrated open block\n\n      var openBlockDepth = currentCursor.openBlockDepth; // this currently is the expected next open block depth\n\n      this.blockDepth--;\n      var {\n        candidate\n      } = currentCursor; // rehydrating\n\n      if (candidate !== null) {\n        if (isComment(candidate) && getCloseBlockDepth(candidate) === openBlockDepth) {\n          currentCursor.candidate = this.remove(candidate);\n          currentCursor.openBlockDepth--;\n        } else {\n          this.clearMismatch(candidate);\n        } // if the openBlockDepth matches the blockDepth we just closed to\n        // then restore rehydration\n\n      }\n\n      if (currentCursor.openBlockDepth === this.blockDepth) {\n        currentCursor.candidate = this.remove(currentCursor.nextSibling);\n        currentCursor.openBlockDepth--;\n      }\n    }\n\n    __appendNode(node) {\n      var {\n        candidate\n      } = this; // This code path is only used when inserting precisely one node. It needs more\n      // comparison logic, but we can probably lean on the cases where this code path\n      // is actually used.\n\n      if (candidate) {\n        return candidate;\n      } else {\n        return super.__appendNode(node);\n      }\n    }\n\n    __appendHTML(html) {\n      var candidateBounds = this.markerBounds();\n\n      if (candidateBounds) {\n        var first = candidateBounds.firstNode();\n        var last = candidateBounds.lastNode();\n        var newBounds = new ConcreteBounds(this.element, first.nextSibling, last.previousSibling);\n        var possibleEmptyMarker = this.remove(first);\n        this.remove(last);\n\n        if (possibleEmptyMarker !== null && isEmpty$1(possibleEmptyMarker)) {\n          this.candidate = this.remove(possibleEmptyMarker);\n\n          if (this.candidate !== null) {\n            this.clearMismatch(this.candidate);\n          }\n        }\n\n        return newBounds;\n      } else {\n        return super.__appendHTML(html);\n      }\n    }\n\n    remove(node) {\n      var element = node.parentNode;\n      var next = node.nextSibling;\n      element.removeChild(node);\n      return next;\n    }\n\n    markerBounds() {\n      var _candidate = this.candidate;\n\n      if (_candidate && isMarker(_candidate)) {\n        var first = _candidate;\n        var last = first.nextSibling;\n\n        while (last && !isMarker(last)) {\n          last = last.nextSibling;\n        }\n\n        return new ConcreteBounds(this.element, first, last);\n      } else {\n        return null;\n      }\n    }\n\n    __appendText(string) {\n      var {\n        candidate\n      } = this;\n\n      if (candidate) {\n        if (isTextNode(candidate)) {\n          if (candidate.nodeValue !== string) {\n            candidate.nodeValue = string;\n          }\n\n          this.candidate = candidate.nextSibling;\n          return candidate;\n        } else if (candidate && (isSeparator(candidate) || isEmpty$1(candidate))) {\n          this.candidate = candidate.nextSibling;\n          this.remove(candidate);\n          return this.__appendText(string);\n        } else if (isEmpty$1(candidate)) {\n          var next = this.remove(candidate);\n          this.candidate = next;\n          var text = this.dom.createTextNode(string);\n          this.dom.insertBefore(this.element, text, next);\n          return text;\n        } else {\n          this.clearMismatch(candidate);\n          return super.__appendText(string);\n        }\n      } else {\n        return super.__appendText(string);\n      }\n    }\n\n    __appendComment(string) {\n      var _candidate = this.candidate;\n\n      if (_candidate && isComment(_candidate)) {\n        if (_candidate.nodeValue !== string) {\n          _candidate.nodeValue = string;\n        }\n\n        this.candidate = _candidate.nextSibling;\n        return _candidate;\n      } else if (_candidate) {\n        this.clearMismatch(_candidate);\n      }\n\n      return super.__appendComment(string);\n    }\n\n    __openElement(tag) {\n      var _candidate = this.candidate;\n\n      if (_candidate && isElement(_candidate) && isSameNodeType(_candidate, tag)) {\n        this.unmatchedAttributes = [].slice.call(_candidate.attributes);\n        return _candidate;\n      } else if (_candidate) {\n        if (isElement(_candidate) && _candidate.tagName === 'TBODY') {\n          this.pushElement(_candidate, null);\n          this.currentCursor.injectedOmittedNode = true;\n          return this.__openElement(tag);\n        }\n\n        this.clearMismatch(_candidate);\n      }\n\n      return super.__openElement(tag);\n    }\n\n    __setAttribute(name, value$$1, namespace) {\n      var unmatched = this.unmatchedAttributes;\n\n      if (unmatched) {\n        var attr = findByName(unmatched, name);\n\n        if (attr) {\n          if (attr.value !== value$$1) {\n            attr.value = value$$1;\n          }\n\n          unmatched.splice(unmatched.indexOf(attr), 1);\n          return;\n        }\n      }\n\n      return super.__setAttribute(name, value$$1, namespace);\n    }\n\n    __setProperty(name, value$$1) {\n      var unmatched = this.unmatchedAttributes;\n\n      if (unmatched) {\n        var attr = findByName(unmatched, name);\n\n        if (attr) {\n          if (attr.value !== value$$1) {\n            attr.value = value$$1;\n          }\n\n          unmatched.splice(unmatched.indexOf(attr), 1);\n          return;\n        }\n      }\n\n      return super.__setProperty(name, value$$1);\n    }\n\n    __flushElement(parent, constructing) {\n      var {\n        unmatchedAttributes: unmatched\n      } = this;\n\n      if (unmatched) {\n        for (var i = 0; i < unmatched.length; i++) {\n          this.constructing.removeAttribute(unmatched[i].name);\n        }\n\n        this.unmatchedAttributes = null;\n      } else {\n        super.__flushElement(parent, constructing);\n      }\n    }\n\n    willCloseElement() {\n      var {\n        candidate,\n        currentCursor\n      } = this;\n\n      if (candidate !== null) {\n        this.clearMismatch(candidate);\n      }\n\n      if (currentCursor && currentCursor.injectedOmittedNode) {\n        this.popElement();\n      }\n\n      super.willCloseElement();\n    }\n\n    getMarker(element, guid) {\n      var marker = element.querySelector(\"script[glmr=\\\"\" + guid + \"\\\"]\");\n\n      if (marker) {\n        return marker;\n      }\n\n      throw new Error('Cannot find serialized cursor for `in-element`');\n    }\n\n    __pushRemoteElement(element, cursorId, nextSibling = null) {\n      var marker = this.getMarker(element, cursorId);\n\n      if (marker.parentNode === element) {\n        var currentCursor = this.currentCursor;\n        var candidate = currentCursor.candidate;\n        this.pushElement(element, nextSibling);\n        currentCursor.candidate = candidate;\n        this.candidate = this.remove(marker);\n        var tracker = new RemoteBlockTracker(element);\n        this.pushBlockTracker(tracker, true);\n      }\n    }\n\n    didAppendBounds(bounds) {\n      super.didAppendBounds(bounds);\n\n      if (this.candidate) {\n        var last = bounds.lastNode();\n        this.candidate = last && last.nextSibling;\n      }\n\n      return bounds;\n    }\n\n  }\n\n  _exports.RehydrateBuilder = RehydrateBuilder;\n\n  function isTextNode(node) {\n    return node.nodeType === 3;\n  }\n\n  function isComment(node) {\n    return node.nodeType === 8;\n  }\n\n  function getOpenBlockDepth(node) {\n    var boundsDepth = node.nodeValue.match(/^%\\+b:(\\d+)%$/);\n\n    if (boundsDepth && boundsDepth[1]) {\n      return Number(boundsDepth[1]);\n    } else {\n      return null;\n    }\n  }\n\n  function getCloseBlockDepth(node) {\n    var boundsDepth = node.nodeValue.match(/^%\\-b:(\\d+)%$/);\n\n    if (boundsDepth && boundsDepth[1]) {\n      return Number(boundsDepth[1]);\n    } else {\n      return null;\n    }\n  }\n\n  function isElement(node) {\n    return node.nodeType === 1;\n  }\n\n  function isMarker(node) {\n    return node.nodeType === 8 && node.nodeValue === '%glmr%';\n  }\n\n  function isSeparator(node) {\n    return node.nodeType === 8 && node.nodeValue === '%|%';\n  }\n\n  function isEmpty$1(node) {\n    return node.nodeType === 8 && node.nodeValue === '% %';\n  }\n\n  function isSameNodeType(candidate, tag) {\n    if (candidate.namespaceURI === SVG_NAMESPACE) {\n      return candidate.tagName === tag;\n    }\n\n    return candidate.tagName === tag.toUpperCase();\n  }\n\n  function findByName(array, name) {\n    for (var i = 0; i < array.length; i++) {\n      var attr = array[i];\n      if (attr.name === name) return attr;\n    }\n\n    return undefined;\n  }\n\n  function rehydrationBuilder(env, cursor) {\n    return RehydrateBuilder.forInitialRender(env, cursor);\n  }\n});","define(\"@glimmer/util\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.assert = debugAssert;\n  _exports.assign = assign;\n  _exports.fillNulls = fillNulls;\n  _exports.ensureGuid = ensureGuid;\n  _exports.initializeGuid = initializeGuid;\n  _exports.dict = dict;\n  _exports.unwrap = unwrap;\n  _exports.expect = expect;\n  _exports.unreachable = unreachable;\n  _exports.EMPTY_ARRAY = _exports.ListSlice = _exports.ListNode = _exports.LinkedList = _exports.EMPTY_SLICE = _exports.DictSet = _exports.Stack = void 0;\n\n  function unwrap(val) {\n    if (val === null || val === undefined) throw new Error(\"Expected value to be present\");\n    return val;\n  }\n\n  function expect(val, message) {\n    if (val === null || val === undefined) throw new Error(message);\n    return val;\n  }\n\n  function unreachable(message = 'unreachable') {\n    return new Error(message);\n  } // import Logger from './logger';\n  // let alreadyWarned = false;\n\n\n  function debugAssert(test, msg) {\n    // if (!alreadyWarned) {\n    //   alreadyWarned = true;\n    //   Logger.warn(\"Don't leave debug assertions on in public builds\");\n    // }\n    if (!test) {\n      throw new Error(msg || 'assertion failure');\n    }\n  }\n\n  var {\n    keys: objKeys\n  } = Object;\n\n  function assign(obj) {\n    for (var i = 1; i < arguments.length; i++) {\n      var assignment = arguments[i];\n      if (assignment === null || typeof assignment !== 'object') continue;\n      var keys = objKeys(assignment);\n\n      for (var j = 0; j < keys.length; j++) {\n        var key = keys[j];\n        obj[key] = assignment[key];\n      }\n    }\n\n    return obj;\n  }\n\n  function fillNulls(count) {\n    var arr = new Array(count);\n\n    for (var i = 0; i < count; i++) {\n      arr[i] = null;\n    }\n\n    return arr;\n  }\n\n  var GUID = 0;\n\n  function initializeGuid(object) {\n    return object._guid = ++GUID;\n  }\n\n  function ensureGuid(object) {\n    return object._guid || initializeGuid(object);\n  }\n\n  function dict() {\n    return Object.create(null);\n  }\n\n  class DictSet {\n    constructor() {\n      this.dict = dict();\n    }\n\n    add(obj) {\n      if (typeof obj === 'string') this.dict[obj] = obj;else this.dict[ensureGuid(obj)] = obj;\n      return this;\n    }\n\n    delete(obj) {\n      if (typeof obj === 'string') delete this.dict[obj];else if (obj._guid) delete this.dict[obj._guid];\n    }\n\n  }\n\n  _exports.DictSet = DictSet;\n\n  class Stack {\n    constructor() {\n      this.stack = [];\n      this.current = null;\n    }\n\n    get size() {\n      return this.stack.length;\n    }\n\n    push(item) {\n      this.current = item;\n      this.stack.push(item);\n    }\n\n    pop() {\n      var item = this.stack.pop();\n      var len = this.stack.length;\n      this.current = len === 0 ? null : this.stack[len - 1];\n      return item === undefined ? null : item;\n    }\n\n    isEmpty() {\n      return this.stack.length === 0;\n    }\n\n  }\n\n  _exports.Stack = Stack;\n\n  class ListNode {\n    constructor(value) {\n      this.next = null;\n      this.prev = null;\n      this.value = value;\n    }\n\n  }\n\n  _exports.ListNode = ListNode;\n\n  class LinkedList {\n    constructor() {\n      this.clear();\n    }\n\n    head() {\n      return this._head;\n    }\n\n    tail() {\n      return this._tail;\n    }\n\n    clear() {\n      this._head = this._tail = null;\n    }\n\n    toArray() {\n      var out = [];\n      this.forEachNode(n => out.push(n));\n      return out;\n    }\n\n    nextNode(node) {\n      return node.next;\n    }\n\n    forEachNode(callback) {\n      var node = this._head;\n\n      while (node !== null) {\n        callback(node);\n        node = node.next;\n      }\n    }\n\n    insertBefore(node, reference = null) {\n      if (reference === null) return this.append(node);\n      if (reference.prev) reference.prev.next = node;else this._head = node;\n      node.prev = reference.prev;\n      node.next = reference;\n      reference.prev = node;\n      return node;\n    }\n\n    append(node) {\n      var tail = this._tail;\n\n      if (tail) {\n        tail.next = node;\n        node.prev = tail;\n        node.next = null;\n      } else {\n        this._head = node;\n      }\n\n      return this._tail = node;\n    }\n\n    remove(node) {\n      if (node.prev) node.prev.next = node.next;else this._head = node.next;\n      if (node.next) node.next.prev = node.prev;else this._tail = node.prev;\n      return node;\n    }\n\n  }\n\n  _exports.LinkedList = LinkedList;\n\n  class ListSlice {\n    constructor(head, tail) {\n      this._head = head;\n      this._tail = tail;\n    }\n\n    forEachNode(callback) {\n      var node = this._head;\n\n      while (node !== null) {\n        callback(node);\n        node = this.nextNode(node);\n      }\n    }\n\n    head() {\n      return this._head;\n    }\n\n    tail() {\n      return this._tail;\n    }\n\n    toArray() {\n      var out = [];\n      this.forEachNode(n => out.push(n));\n      return out;\n    }\n\n    nextNode(node) {\n      if (node === this._tail) return null;\n      return node.next;\n    }\n\n  }\n\n  _exports.ListSlice = ListSlice;\n  var EMPTY_SLICE = new ListSlice(null, null);\n  _exports.EMPTY_SLICE = EMPTY_SLICE;\n  var EMPTY_ARRAY = Object.freeze([]);\n  _exports.EMPTY_ARRAY = EMPTY_ARRAY;\n});","define(\"@glimmer/vm\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.Register = void 0;\n\n  /**\n   * Registers\n   *\n   * For the most part, these follows MIPS naming conventions, however the\n   * register numbers are different.\n   */\n  var Register;\n  _exports.Register = Register;\n\n  (function (Register) {\n    // $0 or $pc (program counter): pointer into `program` for the next insturction; -1 means exit\n    Register[Register[\"pc\"] = 0] = \"pc\"; // $1 or $ra (return address): pointer into `program` for the return\n\n    Register[Register[\"ra\"] = 1] = \"ra\"; // $2 or $fp (frame pointer): pointer into the `evalStack` for the base of the stack\n\n    Register[Register[\"fp\"] = 2] = \"fp\"; // $3 or $sp (stack pointer): pointer into the `evalStack` for the top of the stack\n\n    Register[Register[\"sp\"] = 3] = \"sp\"; // $4-$5 or $s0-$s1 (saved): callee saved general-purpose registers\n\n    Register[Register[\"s0\"] = 4] = \"s0\";\n    Register[Register[\"s1\"] = 5] = \"s1\"; // $6-$7 or $t0-$t1 (temporaries): caller saved general-purpose registers\n\n    Register[Register[\"t0\"] = 6] = \"t0\";\n    Register[Register[\"t1\"] = 7] = \"t1\"; // $8 or $v0 (return value)\n\n    Register[Register[\"v0\"] = 8] = \"v0\";\n  })(Register || (_exports.Register = Register = {}));\n});","define(\"@glimmer/wire-format\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.is = is;\n  _exports.isAttribute = isAttribute;\n  _exports.isArgument = isArgument;\n  _exports.isMaybeLocal = _exports.isGet = _exports.isFlushElement = _exports.Ops = void 0;\n  var Opcodes;\n  _exports.Ops = Opcodes;\n\n  (function (Opcodes) {\n    // Statements\n    Opcodes[Opcodes[\"Text\"] = 0] = \"Text\";\n    Opcodes[Opcodes[\"Append\"] = 1] = \"Append\";\n    Opcodes[Opcodes[\"Comment\"] = 2] = \"Comment\";\n    Opcodes[Opcodes[\"Modifier\"] = 3] = \"Modifier\";\n    Opcodes[Opcodes[\"Block\"] = 4] = \"Block\";\n    Opcodes[Opcodes[\"Component\"] = 5] = \"Component\";\n    Opcodes[Opcodes[\"DynamicComponent\"] = 6] = \"DynamicComponent\";\n    Opcodes[Opcodes[\"OpenElement\"] = 7] = \"OpenElement\";\n    Opcodes[Opcodes[\"FlushElement\"] = 8] = \"FlushElement\";\n    Opcodes[Opcodes[\"CloseElement\"] = 9] = \"CloseElement\";\n    Opcodes[Opcodes[\"StaticAttr\"] = 10] = \"StaticAttr\";\n    Opcodes[Opcodes[\"DynamicAttr\"] = 11] = \"DynamicAttr\";\n    Opcodes[Opcodes[\"ComponentAttr\"] = 12] = \"ComponentAttr\";\n    Opcodes[Opcodes[\"AttrSplat\"] = 13] = \"AttrSplat\";\n    Opcodes[Opcodes[\"Yield\"] = 14] = \"Yield\";\n    Opcodes[Opcodes[\"Partial\"] = 15] = \"Partial\";\n    Opcodes[Opcodes[\"DynamicArg\"] = 16] = \"DynamicArg\";\n    Opcodes[Opcodes[\"StaticArg\"] = 17] = \"StaticArg\";\n    Opcodes[Opcodes[\"TrustingAttr\"] = 18] = \"TrustingAttr\";\n    Opcodes[Opcodes[\"TrustingComponentAttr\"] = 19] = \"TrustingComponentAttr\";\n    Opcodes[Opcodes[\"Debugger\"] = 20] = \"Debugger\";\n    Opcodes[Opcodes[\"ClientSideStatement\"] = 21] = \"ClientSideStatement\"; // Expressions\n\n    Opcodes[Opcodes[\"Unknown\"] = 22] = \"Unknown\";\n    Opcodes[Opcodes[\"Get\"] = 23] = \"Get\";\n    Opcodes[Opcodes[\"MaybeLocal\"] = 24] = \"MaybeLocal\";\n    Opcodes[Opcodes[\"HasBlock\"] = 25] = \"HasBlock\";\n    Opcodes[Opcodes[\"HasBlockParams\"] = 26] = \"HasBlockParams\";\n    Opcodes[Opcodes[\"Undefined\"] = 27] = \"Undefined\";\n    Opcodes[Opcodes[\"Helper\"] = 28] = \"Helper\";\n    Opcodes[Opcodes[\"Concat\"] = 29] = \"Concat\";\n    Opcodes[Opcodes[\"ClientSideExpression\"] = 30] = \"ClientSideExpression\";\n  })(Opcodes || (_exports.Ops = Opcodes = {}));\n\n  function is(variant) {\n    return function (value) {\n      return Array.isArray(value) && value[0] === variant;\n    };\n  } // Statements\n\n\n  var isFlushElement = is(Opcodes.FlushElement);\n  _exports.isFlushElement = isFlushElement;\n\n  function isAttribute(val) {\n    return val[0] === Opcodes.StaticAttr || val[0] === Opcodes.DynamicAttr || val[0] === Opcodes.ComponentAttr || val[0] === Opcodes.TrustingAttr || val[0] === Opcodes.TrustingComponentAttr || val[0] === Opcodes.AttrSplat || val[0] === Opcodes.Modifier;\n  }\n\n  function isArgument(val) {\n    return val[0] === Opcodes.StaticArg || val[0] === Opcodes.DynamicArg;\n  } // Expressions\n\n\n  var isGet = is(Opcodes.Get);\n  _exports.isGet = isGet;\n  var isMaybeLocal = is(Opcodes.MaybeLocal);\n  _exports.isMaybeLocal = isMaybeLocal;\n});","define(\"backburner\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.buildPlatform = buildPlatform;\n  _exports.default = void 0;\n  var SET_TIMEOUT = setTimeout;\n\n  var NOOP = () => {};\n\n  function buildNext(flush) {\n    // Using \"promises first\" here to:\n    //\n    // 1) Ensure more consistent experience on browsers that\n    //    have differently queued microtasks (separate queues for\n    //    MutationObserver vs Promises).\n    // 2) Ensure better debugging experiences (it shows up in Chrome\n    //    call stack as \"Promise.then (async)\") which is more consistent\n    //    with user expectations\n    //\n    // When Promise is unavailable use MutationObserver (mostly so that we\n    // still get microtasks on IE11), and when neither MutationObserver and\n    // Promise are present use a plain old setTimeout.\n    if (typeof Promise === 'function') {\n      var autorunPromise = Promise.resolve();\n      return () => autorunPromise.then(flush);\n    } else if (typeof MutationObserver === 'function') {\n      var iterations = 0;\n      var observer = new MutationObserver(flush);\n      var node = document.createTextNode('');\n      observer.observe(node, {\n        characterData: true\n      });\n      return () => {\n        iterations = ++iterations % 2;\n        node.data = '' + iterations;\n        return iterations;\n      };\n    } else {\n      return () => SET_TIMEOUT(flush, 0);\n    }\n  }\n\n  function buildPlatform(flush) {\n    var clearNext = NOOP;\n    return {\n      setTimeout(fn, ms) {\n        return setTimeout(fn, ms);\n      },\n\n      clearTimeout(timerId) {\n        return clearTimeout(timerId);\n      },\n\n      now() {\n        return Date.now();\n      },\n\n      next: buildNext(flush),\n      clearNext\n    };\n  }\n\n  var NUMBER = /\\d+/;\n  var TIMERS_OFFSET = 6;\n\n  function isCoercableNumber(suspect) {\n    var type = typeof suspect;\n    return type === 'number' && suspect === suspect || type === 'string' && NUMBER.test(suspect);\n  }\n\n  function getOnError(options) {\n    return options.onError || options.onErrorTarget && options.onErrorTarget[options.onErrorMethod];\n  }\n\n  function findItem(target, method, collection) {\n    var index = -1;\n\n    for (var i = 0, l = collection.length; i < l; i += 4) {\n      if (collection[i] === target && collection[i + 1] === method) {\n        index = i;\n        break;\n      }\n    }\n\n    return index;\n  }\n\n  function findTimerItem(target, method, collection) {\n    var index = -1;\n\n    for (var i = 2, l = collection.length; i < l; i += 6) {\n      if (collection[i] === target && collection[i + 1] === method) {\n        index = i - 2;\n        break;\n      }\n    }\n\n    return index;\n  }\n\n  function getQueueItems(items, queueItemLength, queueItemPositionOffset = 0) {\n    var queueItems = [];\n\n    for (var i = 0; i < items.length; i += queueItemLength) {\n      var maybeError = items[i + 3\n      /* stack */\n      + queueItemPositionOffset];\n      var queueItem = {\n        target: items[i + 0\n        /* target */\n        + queueItemPositionOffset],\n        method: items[i + 1\n        /* method */\n        + queueItemPositionOffset],\n        args: items[i + 2\n        /* args */\n        + queueItemPositionOffset],\n        stack: maybeError !== undefined && 'stack' in maybeError ? maybeError.stack : ''\n      };\n      queueItems.push(queueItem);\n    }\n\n    return queueItems;\n  }\n\n  function binarySearch(time, timers) {\n    var start = 0;\n    var end = timers.length - TIMERS_OFFSET;\n    var middle;\n    var l;\n\n    while (start < end) {\n      // since timers is an array of pairs 'l' will always\n      // be an integer\n      l = (end - start) / TIMERS_OFFSET; // compensate for the index in case even number\n      // of pairs inside timers\n\n      middle = start + l - l % TIMERS_OFFSET;\n\n      if (time >= timers[middle]) {\n        start = middle + TIMERS_OFFSET;\n      } else {\n        end = middle;\n      }\n    }\n\n    return time >= timers[start] ? start + TIMERS_OFFSET : start;\n  }\n\n  var QUEUE_ITEM_LENGTH = 4;\n\n  class Queue {\n    constructor(name, options = {}, globalOptions = {}) {\n      this._queueBeingFlushed = [];\n      this.targetQueues = new Map();\n      this.index = 0;\n      this._queue = [];\n      this.name = name;\n      this.options = options;\n      this.globalOptions = globalOptions;\n    }\n\n    stackFor(index) {\n      if (index < this._queue.length) {\n        var entry = this._queue[index * 3 + QUEUE_ITEM_LENGTH];\n\n        if (entry) {\n          return entry.stack;\n        } else {\n          return null;\n        }\n      }\n    }\n\n    flush(sync) {\n      var {\n        before,\n        after\n      } = this.options;\n      var target;\n      var method;\n      var args;\n      var errorRecordedForStack;\n      this.targetQueues.clear();\n\n      if (this._queueBeingFlushed.length === 0) {\n        this._queueBeingFlushed = this._queue;\n        this._queue = [];\n      }\n\n      if (before !== undefined) {\n        before();\n      }\n\n      var invoke;\n      var queueItems = this._queueBeingFlushed;\n\n      if (queueItems.length > 0) {\n        var onError = getOnError(this.globalOptions);\n        invoke = onError ? this.invokeWithOnError : this.invoke;\n\n        for (var i = this.index; i < queueItems.length; i += QUEUE_ITEM_LENGTH) {\n          this.index += QUEUE_ITEM_LENGTH;\n          method = queueItems[i + 1]; // method could have been nullified / canceled during flush\n\n          if (method !== null) {\n            //\n            //    ** Attention intrepid developer **\n            //\n            //    To find out the stack of this task when it was scheduled onto\n            //    the run loop, add the following to your app.js:\n            //\n            //    Ember.run.backburner.DEBUG = true; // NOTE: This slows your app, don't leave it on in production.\n            //\n            //    Once that is in place, when you are at a breakpoint and navigate\n            //    here in the stack explorer, you can look at `errorRecordedForStack.stack`,\n            //    which will be the captured stack when this job was scheduled.\n            //\n            //    One possible long-term solution is the following Chrome issue:\n            //       https://bugs.chromium.org/p/chromium/issues/detail?id=332624\n            //\n            target = queueItems[i];\n            args = queueItems[i + 2];\n            errorRecordedForStack = queueItems[i + 3]; // Debugging assistance\n\n            invoke(target, method, args, onError, errorRecordedForStack);\n          }\n\n          if (this.index !== this._queueBeingFlushed.length && this.globalOptions.mustYield && this.globalOptions.mustYield()) {\n            return 1\n            /* Pause */\n            ;\n          }\n        }\n      }\n\n      if (after !== undefined) {\n        after();\n      }\n\n      this._queueBeingFlushed.length = 0;\n      this.index = 0;\n\n      if (sync !== false && this._queue.length > 0) {\n        // check if new items have been added\n        this.flush(true);\n      }\n    }\n\n    hasWork() {\n      return this._queueBeingFlushed.length > 0 || this._queue.length > 0;\n    }\n\n    cancel({\n      target,\n      method\n    }) {\n      var queue = this._queue;\n      var targetQueueMap = this.targetQueues.get(target);\n\n      if (targetQueueMap !== undefined) {\n        targetQueueMap.delete(method);\n      }\n\n      var index = findItem(target, method, queue);\n\n      if (index > -1) {\n        queue.splice(index, QUEUE_ITEM_LENGTH);\n        return true;\n      } // if not found in current queue\n      // could be in the queue that is being flushed\n\n\n      queue = this._queueBeingFlushed;\n      index = findItem(target, method, queue);\n\n      if (index > -1) {\n        queue[index + 1] = null;\n        return true;\n      }\n\n      return false;\n    }\n\n    push(target, method, args, stack) {\n      this._queue.push(target, method, args, stack);\n\n      return {\n        queue: this,\n        target,\n        method\n      };\n    }\n\n    pushUnique(target, method, args, stack) {\n      var localQueueMap = this.targetQueues.get(target);\n\n      if (localQueueMap === undefined) {\n        localQueueMap = new Map();\n        this.targetQueues.set(target, localQueueMap);\n      }\n\n      var index = localQueueMap.get(method);\n\n      if (index === undefined) {\n        var queueIndex = this._queue.push(target, method, args, stack) - QUEUE_ITEM_LENGTH;\n        localQueueMap.set(method, queueIndex);\n      } else {\n        var queue = this._queue;\n        queue[index + 2] = args; // replace args\n\n        queue[index + 3] = stack; // replace stack\n      }\n\n      return {\n        queue: this,\n        target,\n        method\n      };\n    }\n\n    _getDebugInfo(debugEnabled) {\n      if (debugEnabled) {\n        var debugInfo = getQueueItems(this._queue, QUEUE_ITEM_LENGTH);\n        return debugInfo;\n      }\n\n      return undefined;\n    }\n\n    invoke(target, method, args\n    /*, onError, errorRecordedForStack */\n    ) {\n      if (args === undefined) {\n        method.call(target);\n      } else {\n        method.apply(target, args);\n      }\n    }\n\n    invokeWithOnError(target, method, args, onError, errorRecordedForStack) {\n      try {\n        if (args === undefined) {\n          method.call(target);\n        } else {\n          method.apply(target, args);\n        }\n      } catch (error) {\n        onError(error, errorRecordedForStack);\n      }\n    }\n\n  }\n\n  class DeferredActionQueues {\n    constructor(queueNames = [], options) {\n      this.queues = {};\n      this.queueNameIndex = 0;\n      this.queueNames = queueNames;\n      queueNames.reduce(function (queues, queueName) {\n        queues[queueName] = new Queue(queueName, options[queueName], options);\n        return queues;\n      }, this.queues);\n    }\n    /**\n     * @method schedule\n     * @param {String} queueName\n     * @param {Any} target\n     * @param {Any} method\n     * @param {Any} args\n     * @param {Boolean} onceFlag\n     * @param {Any} stack\n     * @return queue\n     */\n\n\n    schedule(queueName, target, method, args, onceFlag, stack) {\n      var queues = this.queues;\n      var queue = queues[queueName];\n\n      if (queue === undefined) {\n        throw new Error(\"You attempted to schedule an action in a queue (\" + queueName + \") that doesn't exist\");\n      }\n\n      if (method === undefined || method === null) {\n        throw new Error(\"You attempted to schedule an action in a queue (\" + queueName + \") for a method that doesn't exist\");\n      }\n\n      this.queueNameIndex = 0;\n\n      if (onceFlag) {\n        return queue.pushUnique(target, method, args, stack);\n      } else {\n        return queue.push(target, method, args, stack);\n      }\n    }\n    /**\n     * DeferredActionQueues.flush() calls Queue.flush()\n     *\n     * @method flush\n     * @param {Boolean} fromAutorun\n     */\n\n\n    flush(fromAutorun = false) {\n      var queue;\n      var queueName;\n      var numberOfQueues = this.queueNames.length;\n\n      while (this.queueNameIndex < numberOfQueues) {\n        queueName = this.queueNames[this.queueNameIndex];\n        queue = this.queues[queueName];\n\n        if (queue.hasWork() === false) {\n          this.queueNameIndex++;\n\n          if (fromAutorun && this.queueNameIndex < numberOfQueues) {\n            return 1\n            /* Pause */\n            ;\n          }\n        } else {\n          if (queue.flush(false\n          /* async */\n          ) === 1\n          /* Pause */\n          ) {\n              return 1\n              /* Pause */\n              ;\n            }\n        }\n      }\n    }\n    /**\n     * Returns debug information for the current queues.\n     *\n     * @method _getDebugInfo\n     * @param {Boolean} debugEnabled\n     * @returns {IDebugInfo | undefined}\n     */\n\n\n    _getDebugInfo(debugEnabled) {\n      if (debugEnabled) {\n        var debugInfo = {};\n        var queue;\n        var queueName;\n        var numberOfQueues = this.queueNames.length;\n        var i = 0;\n\n        while (i < numberOfQueues) {\n          queueName = this.queueNames[i];\n          queue = this.queues[queueName];\n          debugInfo[queueName] = queue._getDebugInfo(debugEnabled);\n          i++;\n        }\n\n        return debugInfo;\n      }\n\n      return;\n    }\n\n  }\n\n  function iteratorDrain(fn) {\n    var iterator = fn();\n    var result = iterator.next();\n\n    while (result.done === false) {\n      result.value();\n      result = iterator.next();\n    }\n  }\n\n  var noop = function () {};\n\n  var DISABLE_SCHEDULE = Object.freeze([]);\n\n  function parseArgs() {\n    var length = arguments.length;\n    var args;\n    var method;\n    var target;\n\n    if (length === 0) {} else if (length === 1) {\n      target = null;\n      method = arguments[0];\n    } else {\n      var argsIndex = 2;\n      var methodOrTarget = arguments[0];\n      var methodOrArgs = arguments[1];\n      var type = typeof methodOrArgs;\n\n      if (type === 'function') {\n        target = methodOrTarget;\n        method = methodOrArgs;\n      } else if (methodOrTarget !== null && type === 'string' && methodOrArgs in methodOrTarget) {\n        target = methodOrTarget;\n        method = target[methodOrArgs];\n      } else if (typeof methodOrTarget === 'function') {\n        argsIndex = 1;\n        target = null;\n        method = methodOrTarget;\n      }\n\n      if (length > argsIndex) {\n        var len = length - argsIndex;\n        args = new Array(len);\n\n        for (var i = 0; i < len; i++) {\n          args[i] = arguments[i + argsIndex];\n        }\n      }\n    }\n\n    return [target, method, args];\n  }\n\n  function parseTimerArgs() {\n    var [target, method, args] = parseArgs(...arguments);\n    var wait = 0;\n    var length = args !== undefined ? args.length : 0;\n\n    if (length > 0) {\n      var last = args[length - 1];\n\n      if (isCoercableNumber(last)) {\n        wait = parseInt(args.pop(), 10);\n      }\n    }\n\n    return [target, method, args, wait];\n  }\n\n  function parseDebounceArgs() {\n    var target;\n    var method;\n    var isImmediate;\n    var args;\n    var wait;\n\n    if (arguments.length === 2) {\n      method = arguments[0];\n      wait = arguments[1];\n      target = null;\n    } else {\n      [target, method, args] = parseArgs(...arguments);\n\n      if (args === undefined) {\n        wait = 0;\n      } else {\n        wait = args.pop();\n\n        if (!isCoercableNumber(wait)) {\n          isImmediate = wait === true;\n          wait = args.pop();\n        }\n      }\n    }\n\n    wait = parseInt(wait, 10);\n    return [target, method, args, wait, isImmediate];\n  }\n\n  var UUID = 0;\n  var beginCount = 0;\n  var endCount = 0;\n  var beginEventCount = 0;\n  var endEventCount = 0;\n  var runCount = 0;\n  var joinCount = 0;\n  var deferCount = 0;\n  var scheduleCount = 0;\n  var scheduleIterableCount = 0;\n  var deferOnceCount = 0;\n  var scheduleOnceCount = 0;\n  var setTimeoutCount = 0;\n  var laterCount = 0;\n  var throttleCount = 0;\n  var debounceCount = 0;\n  var cancelTimersCount = 0;\n  var cancelCount = 0;\n  var autorunsCreatedCount = 0;\n  var autorunsCompletedCount = 0;\n  var deferredActionQueuesCreatedCount = 0;\n  var nestedDeferredActionQueuesCreated = 0;\n\n  class Backburner {\n    constructor(queueNames, options) {\n      this.DEBUG = false;\n      this.currentInstance = null;\n      this.instanceStack = [];\n      this._eventCallbacks = {\n        end: [],\n        begin: []\n      };\n      this._timerTimeoutId = null;\n      this._timers = [];\n      this._autorun = false;\n      this._autorunStack = null;\n      this.queueNames = queueNames;\n      this.options = options || {};\n\n      if (typeof this.options.defaultQueue === 'string') {\n        this._defaultQueue = this.options.defaultQueue;\n      } else {\n        this._defaultQueue = this.queueNames[0];\n      }\n\n      this._onBegin = this.options.onBegin || noop;\n      this._onEnd = this.options.onEnd || noop;\n      this._boundRunExpiredTimers = this._runExpiredTimers.bind(this);\n\n      this._boundAutorunEnd = () => {\n        autorunsCompletedCount++; // if the autorun was already flushed, do nothing\n\n        if (this._autorun === false) {\n          return;\n        }\n\n        this._autorun = false;\n        this._autorunStack = null;\n\n        this._end(true\n        /* fromAutorun */\n        );\n      };\n\n      var builder = this.options._buildPlatform || buildPlatform;\n      this._platform = builder(this._boundAutorunEnd);\n    }\n\n    get counters() {\n      return {\n        begin: beginCount,\n        end: endCount,\n        events: {\n          begin: beginEventCount,\n          end: endEventCount\n        },\n        autoruns: {\n          created: autorunsCreatedCount,\n          completed: autorunsCompletedCount\n        },\n        run: runCount,\n        join: joinCount,\n        defer: deferCount,\n        schedule: scheduleCount,\n        scheduleIterable: scheduleIterableCount,\n        deferOnce: deferOnceCount,\n        scheduleOnce: scheduleOnceCount,\n        setTimeout: setTimeoutCount,\n        later: laterCount,\n        throttle: throttleCount,\n        debounce: debounceCount,\n        cancelTimers: cancelTimersCount,\n        cancel: cancelCount,\n        loops: {\n          total: deferredActionQueuesCreatedCount,\n          nested: nestedDeferredActionQueuesCreated\n        }\n      };\n    }\n\n    get defaultQueue() {\n      return this._defaultQueue;\n    }\n    /*\n      @method begin\n      @return instantiated class DeferredActionQueues\n    */\n\n\n    begin() {\n      beginCount++;\n      var options = this.options;\n      var previousInstance = this.currentInstance;\n      var current;\n\n      if (this._autorun !== false) {\n        current = previousInstance;\n\n        this._cancelAutorun();\n      } else {\n        if (previousInstance !== null) {\n          nestedDeferredActionQueuesCreated++;\n          this.instanceStack.push(previousInstance);\n        }\n\n        deferredActionQueuesCreatedCount++;\n        current = this.currentInstance = new DeferredActionQueues(this.queueNames, options);\n        beginEventCount++;\n\n        this._trigger('begin', current, previousInstance);\n      }\n\n      this._onBegin(current, previousInstance);\n\n      return current;\n    }\n\n    end() {\n      endCount++;\n\n      this._end(false);\n    }\n\n    on(eventName, callback) {\n      if (typeof callback !== 'function') {\n        throw new TypeError(\"Callback must be a function\");\n      }\n\n      var callbacks = this._eventCallbacks[eventName];\n\n      if (callbacks !== undefined) {\n        callbacks.push(callback);\n      } else {\n        throw new TypeError(\"Cannot on() event \" + eventName + \" because it does not exist\");\n      }\n    }\n\n    off(eventName, callback) {\n      var callbacks = this._eventCallbacks[eventName];\n\n      if (!eventName || callbacks === undefined) {\n        throw new TypeError(\"Cannot off() event \" + eventName + \" because it does not exist\");\n      }\n\n      var callbackFound = false;\n\n      if (callback) {\n        for (var i = 0; i < callbacks.length; i++) {\n          if (callbacks[i] === callback) {\n            callbackFound = true;\n            callbacks.splice(i, 1);\n            i--;\n          }\n        }\n      }\n\n      if (!callbackFound) {\n        throw new TypeError(\"Cannot off() callback that does not exist\");\n      }\n    }\n\n    run() {\n      runCount++;\n      var [target, method, args] = parseArgs(...arguments);\n      return this._run(target, method, args);\n    }\n\n    join() {\n      joinCount++;\n      var [target, method, args] = parseArgs(...arguments);\n      return this._join(target, method, args);\n    }\n    /**\n     * @deprecated please use schedule instead.\n     */\n\n\n    defer(queueName, target, method, ...args) {\n      deferCount++;\n      return this.schedule(queueName, target, method, ...args);\n    }\n\n    schedule(queueName, ..._args) {\n      scheduleCount++;\n      var [target, method, args] = parseArgs(..._args);\n      var stack = this.DEBUG ? new Error() : undefined;\n      return this._ensureInstance().schedule(queueName, target, method, args, false, stack);\n    }\n    /*\n      Defer the passed iterable of functions to run inside the specified queue.\n         @method scheduleIterable\n      @param {String} queueName\n      @param {Iterable} an iterable of functions to execute\n      @return method result\n    */\n\n\n    scheduleIterable(queueName, iterable) {\n      scheduleIterableCount++;\n      var stack = this.DEBUG ? new Error() : undefined;\n      return this._ensureInstance().schedule(queueName, null, iteratorDrain, [iterable], false, stack);\n    }\n    /**\n     * @deprecated please use scheduleOnce instead.\n     */\n\n\n    deferOnce(queueName, target, method, ...args) {\n      deferOnceCount++;\n      return this.scheduleOnce(queueName, target, method, ...args);\n    }\n\n    scheduleOnce(queueName, ..._args) {\n      scheduleOnceCount++;\n      var [target, method, args] = parseArgs(..._args);\n      var stack = this.DEBUG ? new Error() : undefined;\n      return this._ensureInstance().schedule(queueName, target, method, args, true, stack);\n    }\n\n    setTimeout() {\n      setTimeoutCount++;\n      return this.later(...arguments);\n    }\n\n    later() {\n      laterCount++;\n      var [target, method, args, wait] = parseTimerArgs(...arguments);\n      return this._later(target, method, args, wait);\n    }\n\n    throttle() {\n      throttleCount++;\n      var [target, method, args, wait, isImmediate = true] = parseDebounceArgs(...arguments);\n      var index = findTimerItem(target, method, this._timers);\n      var timerId;\n\n      if (index === -1) {\n        timerId = this._later(target, method, isImmediate ? DISABLE_SCHEDULE : args, wait);\n\n        if (isImmediate) {\n          this._join(target, method, args);\n        }\n      } else {\n        timerId = this._timers[index + 1];\n        var argIndex = index + 4;\n\n        if (this._timers[argIndex] !== DISABLE_SCHEDULE) {\n          this._timers[argIndex] = args;\n        }\n      }\n\n      return timerId;\n    }\n\n    debounce() {\n      debounceCount++;\n      var [target, method, args, wait, isImmediate = false] = parseDebounceArgs(...arguments);\n      var _timers = this._timers;\n      var index = findTimerItem(target, method, _timers);\n      var timerId;\n\n      if (index === -1) {\n        timerId = this._later(target, method, isImmediate ? DISABLE_SCHEDULE : args, wait);\n\n        if (isImmediate) {\n          this._join(target, method, args);\n        }\n      } else {\n        var executeAt = this._platform.now() + wait;\n        var argIndex = index + 4;\n\n        if (_timers[argIndex] === DISABLE_SCHEDULE) {\n          args = DISABLE_SCHEDULE;\n        }\n\n        timerId = _timers[index + 1];\n        var i = binarySearch(executeAt, _timers);\n\n        if (index + TIMERS_OFFSET === i) {\n          _timers[index] = executeAt;\n          _timers[argIndex] = args;\n        } else {\n          var stack = this._timers[index + 5];\n\n          this._timers.splice(i, 0, executeAt, timerId, target, method, args, stack);\n\n          this._timers.splice(index, TIMERS_OFFSET);\n        }\n\n        if (index === 0) {\n          this._reinstallTimerTimeout();\n        }\n      }\n\n      return timerId;\n    }\n\n    cancelTimers() {\n      cancelTimersCount++;\n\n      this._clearTimerTimeout();\n\n      this._timers = [];\n\n      this._cancelAutorun();\n    }\n\n    hasTimers() {\n      return this._timers.length > 0 || this._autorun;\n    }\n\n    cancel(timer) {\n      cancelCount++;\n\n      if (timer === null || timer === undefined) {\n        return false;\n      }\n\n      var timerType = typeof timer;\n\n      if (timerType === 'number') {\n        // we're cancelling a setTimeout or throttle or debounce\n        return this._cancelLaterTimer(timer);\n      } else if (timerType === 'object' && timer.queue && timer.method) {\n        // we're cancelling a deferOnce\n        return timer.queue.cancel(timer);\n      }\n\n      return false;\n    }\n\n    ensureInstance() {\n      this._ensureInstance();\n    }\n    /**\n     * Returns debug information related to the current instance of Backburner\n     *\n     * @method getDebugInfo\n     * @returns {Object | undefined} Will return and Object containing debug information if\n     * the DEBUG flag is set to true on the current instance of Backburner, else undefined.\n     */\n\n\n    getDebugInfo() {\n      if (this.DEBUG) {\n        return {\n          autorun: this._autorunStack,\n          counters: this.counters,\n          timers: getQueueItems(this._timers, TIMERS_OFFSET, 2),\n          instanceStack: [this.currentInstance, ...this.instanceStack].map(deferredActionQueue => deferredActionQueue && deferredActionQueue._getDebugInfo(this.DEBUG))\n        };\n      }\n\n      return undefined;\n    }\n\n    _end(fromAutorun) {\n      var currentInstance = this.currentInstance;\n      var nextInstance = null;\n\n      if (currentInstance === null) {\n        throw new Error(\"end called without begin\");\n      } // Prevent double-finally bug in Safari 6.0.2 and iOS 6\n      // This bug appears to be resolved in Safari 6.0.5 and iOS 7\n\n\n      var finallyAlreadyCalled = false;\n      var result;\n\n      try {\n        result = currentInstance.flush(fromAutorun);\n      } finally {\n        if (!finallyAlreadyCalled) {\n          finallyAlreadyCalled = true;\n\n          if (result === 1\n          /* Pause */\n          ) {\n              var plannedNextQueue = this.queueNames[currentInstance.queueNameIndex];\n\n              this._scheduleAutorun(plannedNextQueue);\n            } else {\n            this.currentInstance = null;\n\n            if (this.instanceStack.length > 0) {\n              nextInstance = this.instanceStack.pop();\n              this.currentInstance = nextInstance;\n            }\n\n            this._trigger('end', currentInstance, nextInstance);\n\n            this._onEnd(currentInstance, nextInstance);\n          }\n        }\n      }\n    }\n\n    _join(target, method, args) {\n      if (this.currentInstance === null) {\n        return this._run(target, method, args);\n      }\n\n      if (target === undefined && args === undefined) {\n        return method();\n      } else {\n        return method.apply(target, args);\n      }\n    }\n\n    _run(target, method, args) {\n      var onError = getOnError(this.options);\n      this.begin();\n\n      if (onError) {\n        try {\n          return method.apply(target, args);\n        } catch (error) {\n          onError(error);\n        } finally {\n          this.end();\n        }\n      } else {\n        try {\n          return method.apply(target, args);\n        } finally {\n          this.end();\n        }\n      }\n    }\n\n    _cancelAutorun() {\n      if (this._autorun) {\n        this._platform.clearNext();\n\n        this._autorun = false;\n        this._autorunStack = null;\n      }\n    }\n\n    _later(target, method, args, wait) {\n      var stack = this.DEBUG ? new Error() : undefined;\n      var executeAt = this._platform.now() + wait;\n      var id = UUID++;\n\n      if (this._timers.length === 0) {\n        this._timers.push(executeAt, id, target, method, args, stack);\n\n        this._installTimerTimeout();\n      } else {\n        // find position to insert\n        var i = binarySearch(executeAt, this._timers);\n\n        this._timers.splice(i, 0, executeAt, id, target, method, args, stack); // always reinstall since it could be out of sync\n\n\n        this._reinstallTimerTimeout();\n      }\n\n      return id;\n    }\n\n    _cancelLaterTimer(timer) {\n      for (var i = 1; i < this._timers.length; i += TIMERS_OFFSET) {\n        if (this._timers[i] === timer) {\n          this._timers.splice(i - 1, TIMERS_OFFSET);\n\n          if (i === 1) {\n            this._reinstallTimerTimeout();\n          }\n\n          return true;\n        }\n      }\n\n      return false;\n    }\n    /**\n     Trigger an event. Supports up to two arguments. Designed around\n     triggering transition events from one run loop instance to the\n     next, which requires an argument for the  instance and then\n     an argument for the next instance.\n        @private\n     @method _trigger\n     @param {String} eventName\n     @param {any} arg1\n     @param {any} arg2\n     */\n\n\n    _trigger(eventName, arg1, arg2) {\n      var callbacks = this._eventCallbacks[eventName];\n\n      if (callbacks !== undefined) {\n        for (var i = 0; i < callbacks.length; i++) {\n          callbacks[i](arg1, arg2);\n        }\n      }\n    }\n\n    _runExpiredTimers() {\n      this._timerTimeoutId = null;\n\n      if (this._timers.length > 0) {\n        this.begin();\n\n        this._scheduleExpiredTimers();\n\n        this.end();\n      }\n    }\n\n    _scheduleExpiredTimers() {\n      var timers = this._timers;\n      var i = 0;\n      var l = timers.length;\n      var defaultQueue = this._defaultQueue;\n\n      var n = this._platform.now();\n\n      for (; i < l; i += TIMERS_OFFSET) {\n        var executeAt = timers[i];\n\n        if (executeAt > n) {\n          break;\n        }\n\n        var args = timers[i + 4];\n\n        if (args !== DISABLE_SCHEDULE) {\n          var target = timers[i + 2];\n          var method = timers[i + 3];\n          var stack = timers[i + 5];\n          this.currentInstance.schedule(defaultQueue, target, method, args, false, stack);\n        }\n      }\n\n      timers.splice(0, i);\n\n      this._installTimerTimeout();\n    }\n\n    _reinstallTimerTimeout() {\n      this._clearTimerTimeout();\n\n      this._installTimerTimeout();\n    }\n\n    _clearTimerTimeout() {\n      if (this._timerTimeoutId === null) {\n        return;\n      }\n\n      this._platform.clearTimeout(this._timerTimeoutId);\n\n      this._timerTimeoutId = null;\n    }\n\n    _installTimerTimeout() {\n      if (this._timers.length === 0) {\n        return;\n      }\n\n      var minExpiresAt = this._timers[0];\n\n      var n = this._platform.now();\n\n      var wait = Math.max(0, minExpiresAt - n);\n      this._timerTimeoutId = this._platform.setTimeout(this._boundRunExpiredTimers, wait);\n    }\n\n    _ensureInstance() {\n      var currentInstance = this.currentInstance;\n\n      if (currentInstance === null) {\n        this._autorunStack = this.DEBUG ? new Error() : undefined;\n        currentInstance = this.begin();\n\n        this._scheduleAutorun(this.queueNames[0]);\n      }\n\n      return currentInstance;\n    }\n\n    _scheduleAutorun(plannedNextQueue) {\n      autorunsCreatedCount++;\n      var next = this._platform.next;\n      var flush = this.options.flush;\n\n      if (flush) {\n        flush(plannedNextQueue, next);\n      } else {\n        next();\n      }\n\n      this._autorun = true;\n    }\n\n  }\n\n  Backburner.Queue = Queue;\n  Backburner.buildPlatform = buildPlatform;\n  Backburner.buildNext = buildNext;\n  var _default = Backburner;\n  _exports.default = _default;\n});","define(\"dag-map\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n   * A topologically ordered map of key/value pairs with a simple API for adding constraints.\n   *\n   * Edges can forward reference keys that have not been added yet (the forward reference will\n   * map the key to undefined).\n   */\n  var DAG = function () {\n    function DAG() {\n      this._vertices = new Vertices();\n    }\n    /**\n     * Adds a key/value pair with dependencies on other key/value pairs.\n     *\n     * @public\n     * @param key    The key of the vertex to be added.\n     * @param value  The value of that vertex.\n     * @param before A key or array of keys of the vertices that must\n     *               be visited before this vertex.\n     * @param after  An string or array of strings with the keys of the\n     *               vertices that must be after this vertex is visited.\n     */\n\n\n    DAG.prototype.add = function (key, value, before, after) {\n      if (!key) throw new Error('argument `key` is required');\n      var vertices = this._vertices;\n      var v = vertices.add(key);\n      v.val = value;\n\n      if (before) {\n        if (typeof before === \"string\") {\n          vertices.addEdge(v, vertices.add(before));\n        } else {\n          for (var i = 0; i < before.length; i++) {\n            vertices.addEdge(v, vertices.add(before[i]));\n          }\n        }\n      }\n\n      if (after) {\n        if (typeof after === \"string\") {\n          vertices.addEdge(vertices.add(after), v);\n        } else {\n          for (var i = 0; i < after.length; i++) {\n            vertices.addEdge(vertices.add(after[i]), v);\n          }\n        }\n      }\n    };\n    /**\n     * @deprecated please use add.\n     */\n\n\n    DAG.prototype.addEdges = function (key, value, before, after) {\n      this.add(key, value, before, after);\n    };\n    /**\n     * Visits key/value pairs in topological order.\n     *\n     * @public\n     * @param callback The function to be invoked with each key/value.\n     */\n\n\n    DAG.prototype.each = function (callback) {\n      this._vertices.walk(callback);\n    };\n    /**\n     * @deprecated please use each.\n     */\n\n\n    DAG.prototype.topsort = function (callback) {\n      this.each(callback);\n    };\n\n    return DAG;\n  }();\n\n  var _default = DAG;\n  /** @private */\n\n  _exports.default = _default;\n\n  var Vertices = function () {\n    function Vertices() {\n      this.length = 0;\n      this.stack = new IntStack();\n      this.path = new IntStack();\n      this.result = new IntStack();\n    }\n\n    Vertices.prototype.add = function (key) {\n      if (!key) throw new Error(\"missing key\");\n      var l = this.length | 0;\n      var vertex;\n\n      for (var i = 0; i < l; i++) {\n        vertex = this[i];\n        if (vertex.key === key) return vertex;\n      }\n\n      this.length = l + 1;\n      return this[l] = {\n        idx: l,\n        key: key,\n        val: undefined,\n        out: false,\n        flag: false,\n        length: 0\n      };\n    };\n\n    Vertices.prototype.addEdge = function (v, w) {\n      this.check(v, w.key);\n      var l = w.length | 0;\n\n      for (var i = 0; i < l; i++) {\n        if (w[i] === v.idx) return;\n      }\n\n      w.length = l + 1;\n      w[l] = v.idx;\n      v.out = true;\n    };\n\n    Vertices.prototype.walk = function (cb) {\n      this.reset();\n\n      for (var i = 0; i < this.length; i++) {\n        var vertex = this[i];\n        if (vertex.out) continue;\n        this.visit(vertex, \"\");\n      }\n\n      this.each(this.result, cb);\n    };\n\n    Vertices.prototype.check = function (v, w) {\n      if (v.key === w) {\n        throw new Error(\"cycle detected: \" + w + \" <- \" + w);\n      } // quick check\n\n\n      if (v.length === 0) return; // shallow check\n\n      for (var i = 0; i < v.length; i++) {\n        var key = this[v[i]].key;\n\n        if (key === w) {\n          throw new Error(\"cycle detected: \" + w + \" <- \" + v.key + \" <- \" + w);\n        }\n      } // deep check\n\n\n      this.reset();\n      this.visit(v, w);\n\n      if (this.path.length > 0) {\n        var msg_1 = \"cycle detected: \" + w;\n        this.each(this.path, function (key) {\n          msg_1 += \" <- \" + key;\n        });\n        throw new Error(msg_1);\n      }\n    };\n\n    Vertices.prototype.reset = function () {\n      this.stack.length = 0;\n      this.path.length = 0;\n      this.result.length = 0;\n\n      for (var i = 0, l = this.length; i < l; i++) {\n        this[i].flag = false;\n      }\n    };\n\n    Vertices.prototype.visit = function (start, search) {\n      var _a = this,\n          stack = _a.stack,\n          path = _a.path,\n          result = _a.result;\n\n      stack.push(start.idx);\n\n      while (stack.length) {\n        var index = stack.pop() | 0;\n\n        if (index >= 0) {\n          // enter\n          var vertex = this[index];\n          if (vertex.flag) continue;\n          vertex.flag = true;\n          path.push(index);\n          if (search === vertex.key) break; // push exit\n\n          stack.push(~index);\n          this.pushIncoming(vertex);\n        } else {\n          // exit\n          path.pop();\n          result.push(~index);\n        }\n      }\n    };\n\n    Vertices.prototype.pushIncoming = function (incomming) {\n      var stack = this.stack;\n\n      for (var i = incomming.length - 1; i >= 0; i--) {\n        var index = incomming[i];\n\n        if (!this[index].flag) {\n          stack.push(index);\n        }\n      }\n    };\n\n    Vertices.prototype.each = function (indices, cb) {\n      for (var i = 0, l = indices.length; i < l; i++) {\n        var vertex = this[indices[i]];\n        cb(vertex.key, vertex.val);\n      }\n    };\n\n    return Vertices;\n  }();\n  /** @private */\n\n\n  var IntStack = function () {\n    function IntStack() {\n      this.length = 0;\n    }\n\n    IntStack.prototype.push = function (n) {\n      this[this.length++] = n | 0;\n    };\n\n    IntStack.prototype.pop = function () {\n      return this[--this.length] | 0;\n    };\n\n    return IntStack;\n  }();\n});","define(\"ember-babel\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.wrapNativeSuper = wrapNativeSuper;\n  _exports.classCallCheck = classCallCheck;\n  _exports.inheritsLoose = inheritsLoose;\n  _exports.taggedTemplateLiteralLoose = taggedTemplateLiteralLoose;\n  _exports.createClass = createClass;\n  _exports.assertThisInitialized = assertThisInitialized;\n  _exports.possibleConstructorReturn = possibleConstructorReturn;\n  _exports.objectDestructuringEmpty = objectDestructuringEmpty;\n  var setPrototypeOf = Object.setPrototypeOf;\n  var nativeWrapperCache = new Map(); // Super minimal version of Babel's wrapNativeSuper. We only use this for\n  // extending Function, for ComputedDecoratorImpl and AliasDecoratorImpl. We know\n  // we will never directly create an instance of these classes so no need to\n  // include `construct` code or other helpers.\n\n  function wrapNativeSuper(Class) {\n    if (nativeWrapperCache.has(Class)) {\n      return nativeWrapperCache.get(Class);\n    }\n\n    function Wrapper() {}\n\n    Wrapper.prototype = Object.create(Class.prototype, {\n      constructor: {\n        value: Wrapper,\n        enumerable: false,\n        writable: true,\n        configurable: true\n      }\n    });\n    nativeWrapperCache.set(Class, Wrapper);\n    return setPrototypeOf(Wrapper, Class);\n  }\n\n  function classCallCheck(instance, Constructor) {\n    if (true\n    /* DEBUG */\n    ) {\n      if (!(instance instanceof Constructor)) {\n        throw new TypeError('Cannot call a class as a function');\n      }\n    }\n  }\n  /*\n    Overrides default `inheritsLoose` to _also_ call `Object.setPrototypeOf`.\n    This is needed so that we can use `loose` option with the\n    `@babel/plugin-transform-classes` (because we want simple assignment to the\n    prototype whereever possible) but also keep our constructor based prototypal\n    inheritance working properly\n  */\n\n\n  function inheritsLoose(subClass, superClass) {\n    if (true\n    /* DEBUG */\n    ) {\n      if (typeof superClass !== 'function' && superClass !== null) {\n        throw new TypeError('Super expression must either be null or a function');\n      }\n    }\n\n    subClass.prototype = Object.create(superClass === null ? null : superClass.prototype, {\n      constructor: {\n        value: subClass,\n        writable: true,\n        configurable: true\n      }\n    });\n\n    if (superClass !== null) {\n      setPrototypeOf(subClass, superClass);\n    }\n  }\n\n  function taggedTemplateLiteralLoose(strings, raw) {\n    if (!raw) {\n      raw = strings.slice(0);\n    }\n\n    strings.raw = raw;\n    return strings;\n  }\n\n  function _defineProperties(target, props) {\n    for (var i = 0; i < props.length; i++) {\n      var descriptor = props[i];\n      descriptor.enumerable = descriptor.enumerable || false;\n      descriptor.configurable = true;\n      if ('value' in descriptor) descriptor.writable = true;\n      Object.defineProperty(target, descriptor.key, descriptor);\n    }\n  }\n  /*\n    Differs from default implementation by avoiding boolean coercion of\n    `protoProps` and `staticProps`.\n  */\n\n\n  function createClass(Constructor, protoProps, staticProps) {\n    if (protoProps !== null && protoProps !== undefined) {\n      _defineProperties(Constructor.prototype, protoProps);\n    }\n\n    if (staticProps !== null && staticProps !== undefined) {\n      _defineProperties(Constructor, staticProps);\n    }\n\n    return Constructor;\n  }\n\n  function assertThisInitialized(self) {\n    if (true\n    /* DEBUG */\n    && self === void 0) {\n      throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n    }\n\n    return self;\n  }\n  /*\n    Adds `DEBUG` guard to error being thrown, and avoids boolean coercion of `call`.\n  */\n\n\n  function possibleConstructorReturn(self, call) {\n    if (typeof call === 'object' && call !== null || typeof call === 'function') {\n      return call;\n    }\n\n    return assertThisInitialized(self);\n  }\n\n  function objectDestructuringEmpty(obj) {\n    if (true\n    /* DEBUG */\n    && (obj === null || obj === undefined)) {\n      throw new TypeError('Cannot destructure undefined');\n    }\n  }\n});","define(\"ember-testing/index\", [\"exports\", \"ember-testing/lib/test\", \"ember-testing/lib/adapters/adapter\", \"ember-testing/lib/setup_for_testing\", \"ember-testing/lib/adapters/qunit\", \"ember-testing/lib/support\", \"ember-testing/lib/ext/application\", \"ember-testing/lib/ext/rsvp\", \"ember-testing/lib/helpers\", \"ember-testing/lib/initializers\"], function (_exports, _test, _adapter, _setup_for_testing, _qunit, _support, _application, _rsvp, _helpers, _initializers) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"Test\", {\n    enumerable: true,\n    get: function () {\n      return _test.default;\n    }\n  });\n  Object.defineProperty(_exports, \"Adapter\", {\n    enumerable: true,\n    get: function () {\n      return _adapter.default;\n    }\n  });\n  Object.defineProperty(_exports, \"setupForTesting\", {\n    enumerable: true,\n    get: function () {\n      return _setup_for_testing.default;\n    }\n  });\n  Object.defineProperty(_exports, \"QUnitAdapter\", {\n    enumerable: true,\n    get: function () {\n      return _qunit.default;\n    }\n  });\n});","define(\"ember-testing/lib/adapters/adapter\", [\"exports\", \"@ember/-internals/runtime\"], function (_exports, _runtime) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  function K() {\n    return this;\n  }\n  /**\n   @module @ember/test\n  */\n\n  /**\n    The primary purpose of this class is to create hooks that can be implemented\n    by an adapter for various test frameworks.\n  \n    @class TestAdapter\n    @public\n  */\n\n\n  var _default = _runtime.Object.extend({\n    /**\n      This callback will be called whenever an async operation is about to start.\n       Override this to call your framework's methods that handle async\n      operations.\n       @public\n      @method asyncStart\n    */\n    asyncStart: K,\n\n    /**\n      This callback will be called whenever an async operation has completed.\n       @public\n      @method asyncEnd\n    */\n    asyncEnd: K,\n\n    /**\n      Override this method with your testing framework's false assertion.\n      This function is called whenever an exception occurs causing the testing\n      promise to fail.\n       QUnit example:\n       ```javascript\n        exception: function(error) {\n          ok(false, error);\n        };\n      ```\n       @public\n      @method exception\n      @param {String} error The exception to be raised.\n    */\n    exception(error) {\n      throw error;\n    }\n\n  });\n\n  _exports.default = _default;\n});","define(\"ember-testing/lib/adapters/qunit\", [\"exports\", \"@ember/-internals/utils\", \"ember-testing/lib/adapters/adapter\"], function (_exports, _utils, _adapter) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /* globals QUnit */\n\n  /**\n     @module ember\n  */\n\n  /**\n    This class implements the methods defined by TestAdapter for the\n    QUnit testing framework.\n  \n    @class QUnitAdapter\n    @namespace Ember.Test\n    @extends TestAdapter\n    @public\n  */\n  var _default = _adapter.default.extend({\n    init() {\n      this.doneCallbacks = [];\n    },\n\n    asyncStart() {\n      if (typeof QUnit.stop === 'function') {\n        // very old QUnit version\n        QUnit.stop();\n      } else {\n        this.doneCallbacks.push(QUnit.config.current ? QUnit.config.current.assert.async() : null);\n      }\n    },\n\n    asyncEnd() {\n      // checking for QUnit.stop here (even though we _need_ QUnit.start) because\n      // QUnit.start() still exists in QUnit 2.x (it just throws an error when calling\n      // inside a test context)\n      if (typeof QUnit.stop === 'function') {\n        QUnit.start();\n      } else {\n        var done = this.doneCallbacks.pop(); // This can be null if asyncStart() was called outside of a test\n\n        if (done) {\n          done();\n        }\n      }\n    },\n\n    exception(error) {\n      QUnit.config.current.assert.ok(false, (0, _utils.inspect)(error));\n    }\n\n  });\n\n  _exports.default = _default;\n});","define(\"ember-testing/lib/events\", [\"exports\", \"@ember/runloop\", \"@ember/polyfills\", \"ember-testing/lib/helpers/-is-form-control\"], function (_exports, _runloop, _polyfills, _isFormControl) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.focus = focus;\n  _exports.fireEvent = fireEvent;\n  var DEFAULT_EVENT_OPTIONS = {\n    canBubble: true,\n    cancelable: true\n  };\n  var KEYBOARD_EVENT_TYPES = ['keydown', 'keypress', 'keyup'];\n  var MOUSE_EVENT_TYPES = ['click', 'mousedown', 'mouseup', 'dblclick', 'mouseenter', 'mouseleave', 'mousemove', 'mouseout', 'mouseover'];\n\n  function focus(el) {\n    if (!el) {\n      return;\n    }\n\n    if (el.isContentEditable || (0, _isFormControl.default)(el)) {\n      var type = el.getAttribute('type');\n\n      if (type !== 'checkbox' && type !== 'radio' && type !== 'hidden') {\n        (0, _runloop.run)(null, function () {\n          var browserIsNotFocused = document.hasFocus && !document.hasFocus(); // makes `document.activeElement` be `element`. If the browser is focused, it also fires a focus event\n\n          el.focus(); // Firefox does not trigger the `focusin` event if the window\n          // does not have focus. If the document does not have focus then\n          // fire `focusin` event as well.\n\n          if (browserIsNotFocused) {\n            // if the browser is not focused the previous `el.focus()` didn't fire an event, so we simulate it\n            fireEvent(el, 'focus', {\n              bubbles: false\n            });\n            fireEvent(el, 'focusin');\n          }\n        });\n      }\n    }\n  }\n\n  function fireEvent(element, type, options = {}) {\n    if (!element) {\n      return;\n    }\n\n    var event;\n\n    if (KEYBOARD_EVENT_TYPES.indexOf(type) > -1) {\n      event = buildKeyboardEvent(type, options);\n    } else if (MOUSE_EVENT_TYPES.indexOf(type) > -1) {\n      var rect = element.getBoundingClientRect();\n      var x = rect.left + 1;\n      var y = rect.top + 1;\n      var simulatedCoordinates = {\n        screenX: x + 5,\n        screenY: y + 95,\n        clientX: x,\n        clientY: y\n      };\n      event = buildMouseEvent(type, (0, _polyfills.assign)(simulatedCoordinates, options));\n    } else {\n      event = buildBasicEvent(type, options);\n    }\n\n    element.dispatchEvent(event);\n  }\n\n  function buildBasicEvent(type, options = {}) {\n    var event = document.createEvent('Events'); // Event.bubbles is read only\n\n    var bubbles = options.bubbles !== undefined ? options.bubbles : true;\n    var cancelable = options.cancelable !== undefined ? options.cancelable : true;\n    delete options.bubbles;\n    delete options.cancelable;\n    event.initEvent(type, bubbles, cancelable);\n    (0, _polyfills.assign)(event, options);\n    return event;\n  }\n\n  function buildMouseEvent(type, options = {}) {\n    var event;\n\n    try {\n      event = document.createEvent('MouseEvents');\n      var eventOpts = (0, _polyfills.assign)({}, DEFAULT_EVENT_OPTIONS, options);\n      event.initMouseEvent(type, eventOpts.canBubble, eventOpts.cancelable, window, eventOpts.detail, eventOpts.screenX, eventOpts.screenY, eventOpts.clientX, eventOpts.clientY, eventOpts.ctrlKey, eventOpts.altKey, eventOpts.shiftKey, eventOpts.metaKey, eventOpts.button, eventOpts.relatedTarget);\n    } catch (e) {\n      event = buildBasicEvent(type, options);\n    }\n\n    return event;\n  }\n\n  function buildKeyboardEvent(type, options = {}) {\n    var event;\n\n    try {\n      event = document.createEvent('KeyEvents');\n      var eventOpts = (0, _polyfills.assign)({}, DEFAULT_EVENT_OPTIONS, options);\n      event.initKeyEvent(type, eventOpts.canBubble, eventOpts.cancelable, window, eventOpts.ctrlKey, eventOpts.altKey, eventOpts.shiftKey, eventOpts.metaKey, eventOpts.keyCode, eventOpts.charCode);\n    } catch (e) {\n      event = buildBasicEvent(type, options);\n    }\n\n    return event;\n  }\n});","define(\"ember-testing/lib/ext/application\", [\"@ember/application\", \"ember-testing/lib/setup_for_testing\", \"ember-testing/lib/test/helpers\", \"ember-testing/lib/test/promise\", \"ember-testing/lib/test/run\", \"ember-testing/lib/test/on_inject_helpers\", \"ember-testing/lib/test/adapter\"], function (_application, _setup_for_testing, _helpers, _promise, _run, _on_inject_helpers, _adapter) {\n  \"use strict\";\n\n  _application.default.reopen({\n    /**\n     This property contains the testing helpers for the current application. These\n     are created once you call `injectTestHelpers` on your `Application`\n     instance. The included helpers are also available on the `window` object by\n     default, but can be used from this object on the individual application also.\n       @property testHelpers\n      @type {Object}\n      @default {}\n      @public\n    */\n    testHelpers: {},\n\n    /**\n     This property will contain the original methods that were registered\n     on the `helperContainer` before `injectTestHelpers` is called.\n      When `removeTestHelpers` is called, these methods are restored to the\n     `helperContainer`.\n       @property originalMethods\n      @type {Object}\n      @default {}\n      @private\n      @since 1.3.0\n    */\n    originalMethods: {},\n\n    /**\n    This property indicates whether or not this application is currently in\n    testing mode. This is set when `setupForTesting` is called on the current\n    application.\n     @property testing\n    @type {Boolean}\n    @default false\n    @since 1.3.0\n    @public\n    */\n    testing: false,\n\n    /**\n      This hook defers the readiness of the application, so that you can start\n      the app when your tests are ready to run. It also sets the router's\n      location to 'none', so that the window's location will not be modified\n      (preventing both accidental leaking of state between tests and interference\n      with your testing framework). `setupForTesting` should only be called after\n      setting a custom `router` class (for example `App.Router = Router.extend(`).\n       Example:\n       ```\n      App.setupForTesting();\n      ```\n       @method setupForTesting\n      @public\n    */\n    setupForTesting() {\n      (0, _setup_for_testing.default)();\n      this.testing = true;\n      this.resolveRegistration('router:main').reopen({\n        location: 'none'\n      });\n    },\n\n    /**\n      This will be used as the container to inject the test helpers into. By\n      default the helpers are injected into `window`.\n       @property helperContainer\n      @type {Object} The object to be used for test helpers.\n      @default window\n      @since 1.2.0\n      @private\n    */\n    helperContainer: null,\n\n    /**\n      This injects the test helpers into the `helperContainer` object. If an object is provided\n      it will be used as the helperContainer. If `helperContainer` is not set it will default\n      to `window`. If a function of the same name has already been defined it will be cached\n      (so that it can be reset if the helper is removed with `unregisterHelper` or\n      `removeTestHelpers`).\n       Any callbacks registered with `onInjectHelpers` will be called once the\n      helpers have been injected.\n       Example:\n      ```\n      App.injectTestHelpers();\n      ```\n       @method injectTestHelpers\n      @public\n    */\n    injectTestHelpers(helperContainer) {\n      if (helperContainer) {\n        this.helperContainer = helperContainer;\n      } else {\n        this.helperContainer = window;\n      }\n\n      this.reopen({\n        willDestroy() {\n          this._super(...arguments);\n\n          this.removeTestHelpers();\n        }\n\n      });\n      this.testHelpers = {};\n\n      for (var name in _helpers.helpers) {\n        this.originalMethods[name] = this.helperContainer[name];\n        this.testHelpers[name] = this.helperContainer[name] = helper(this, name);\n        protoWrap(_promise.default.prototype, name, helper(this, name), _helpers.helpers[name].meta.wait);\n      }\n\n      (0, _on_inject_helpers.invokeInjectHelpersCallbacks)(this);\n    },\n\n    /**\n      This removes all helpers that have been registered, and resets and functions\n      that were overridden by the helpers.\n       Example:\n       ```javascript\n      App.removeTestHelpers();\n      ```\n       @public\n      @method removeTestHelpers\n    */\n    removeTestHelpers() {\n      if (!this.helperContainer) {\n        return;\n      }\n\n      for (var name in _helpers.helpers) {\n        this.helperContainer[name] = this.originalMethods[name];\n        delete _promise.default.prototype[name];\n        delete this.testHelpers[name];\n        delete this.originalMethods[name];\n      }\n    }\n\n  }); // This method is no longer needed\n  // But still here for backwards compatibility\n  // of helper chaining\n\n\n  function protoWrap(proto, name, callback, isAsync) {\n    proto[name] = function (...args) {\n      if (isAsync) {\n        return callback.apply(this, args);\n      } else {\n        return this.then(function () {\n          return callback.apply(this, args);\n        });\n      }\n    };\n  }\n\n  function helper(app, name) {\n    var fn = _helpers.helpers[name].method;\n    var meta = _helpers.helpers[name].meta;\n\n    if (!meta.wait) {\n      return (...args) => fn.apply(app, [app, ...args]);\n    }\n\n    return (...args) => {\n      var lastPromise = (0, _run.default)(() => (0, _promise.resolve)((0, _promise.getLastPromise)())); // wait for last helper's promise to resolve and then\n      // execute. To be safe, we need to tell the adapter we're going\n      // asynchronous here, because fn may not be invoked before we\n      // return.\n\n      (0, _adapter.asyncStart)();\n      return lastPromise.then(() => fn.apply(app, [app, ...args])).finally(_adapter.asyncEnd);\n    };\n  }\n});","define(\"ember-testing/lib/ext/rsvp\", [\"exports\", \"@ember/-internals/runtime\", \"@ember/runloop\", \"@ember/debug\", \"ember-testing/lib/test/adapter\"], function (_exports, _runtime, _runloop, _debug, _adapter) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  _runtime.RSVP.configure('async', function (callback, promise) {\n    // if schedule will cause autorun, we need to inform adapter\n    if ((0, _debug.isTesting)() && !_runloop.backburner.currentInstance) {\n      (0, _adapter.asyncStart)();\n\n      _runloop.backburner.schedule('actions', () => {\n        (0, _adapter.asyncEnd)();\n        callback(promise);\n      });\n    } else {\n      _runloop.backburner.schedule('actions', () => callback(promise));\n    }\n  });\n\n  var _default = _runtime.RSVP;\n  _exports.default = _default;\n});","define(\"ember-testing/lib/helpers\", [\"ember-testing/lib/test/helpers\", \"ember-testing/lib/helpers/and_then\", \"ember-testing/lib/helpers/click\", \"ember-testing/lib/helpers/current_path\", \"ember-testing/lib/helpers/current_route_name\", \"ember-testing/lib/helpers/current_url\", \"ember-testing/lib/helpers/fill_in\", \"ember-testing/lib/helpers/find\", \"ember-testing/lib/helpers/find_with_assert\", \"ember-testing/lib/helpers/key_event\", \"ember-testing/lib/helpers/pause_test\", \"ember-testing/lib/helpers/trigger_event\", \"ember-testing/lib/helpers/visit\", \"ember-testing/lib/helpers/wait\"], function (_helpers, _and_then, _click, _current_path, _current_route_name, _current_url, _fill_in, _find, _find_with_assert, _key_event, _pause_test, _trigger_event, _visit, _wait) {\n  \"use strict\";\n\n  (0, _helpers.registerAsyncHelper)('visit', _visit.default);\n  (0, _helpers.registerAsyncHelper)('click', _click.default);\n  (0, _helpers.registerAsyncHelper)('keyEvent', _key_event.default);\n  (0, _helpers.registerAsyncHelper)('fillIn', _fill_in.default);\n  (0, _helpers.registerAsyncHelper)('wait', _wait.default);\n  (0, _helpers.registerAsyncHelper)('andThen', _and_then.default);\n  (0, _helpers.registerAsyncHelper)('pauseTest', _pause_test.pauseTest);\n  (0, _helpers.registerAsyncHelper)('triggerEvent', _trigger_event.default);\n  (0, _helpers.registerHelper)('find', _find.default);\n  (0, _helpers.registerHelper)('findWithAssert', _find_with_assert.default);\n  (0, _helpers.registerHelper)('currentRouteName', _current_route_name.default);\n  (0, _helpers.registerHelper)('currentPath', _current_path.default);\n  (0, _helpers.registerHelper)('currentURL', _current_url.default);\n  (0, _helpers.registerHelper)('resumeTest', _pause_test.resumeTest);\n});","define(\"ember-testing/lib/helpers/-is-form-control\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = isFormControl;\n  var FORM_CONTROL_TAGS = ['INPUT', 'BUTTON', 'SELECT', 'TEXTAREA'];\n  /**\n    @private\n    @param {Element} element the element to check\n    @returns {boolean} `true` when the element is a form control, `false` otherwise\n  */\n\n  function isFormControl(element) {\n    var {\n      tagName,\n      type\n    } = element;\n\n    if (type === 'hidden') {\n      return false;\n    }\n\n    return FORM_CONTROL_TAGS.indexOf(tagName) > -1;\n  }\n});","define(\"ember-testing/lib/helpers/and_then\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = andThen;\n\n  function andThen(app, callback) {\n    return app.testHelpers.wait(callback(app));\n  }\n});","define(\"ember-testing/lib/helpers/click\", [\"exports\", \"ember-testing/lib/events\"], function (_exports, _events) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = click;\n\n  /**\n  @module ember\n  */\n\n  /**\n    Clicks an element and triggers any actions triggered by the element's `click`\n    event.\n  \n    Example:\n  \n    ```javascript\n    click('.some-jQuery-selector').then(function() {\n      // assert something\n    });\n    ```\n  \n    @method click\n    @param {String} selector jQuery selector for finding element on the DOM\n    @param {Object} context A DOM Element, Document, or jQuery to use as context\n    @return {RSVP.Promise<undefined>}\n    @public\n  */\n  function click(app, selector, context) {\n    var $el = app.testHelpers.findWithAssert(selector, context);\n    var el = $el[0];\n    (0, _events.fireEvent)(el, 'mousedown');\n    (0, _events.focus)(el);\n    (0, _events.fireEvent)(el, 'mouseup');\n    (0, _events.fireEvent)(el, 'click');\n    return app.testHelpers.wait();\n  }\n});","define(\"ember-testing/lib/helpers/current_path\", [\"exports\", \"@ember/-internals/metal\"], function (_exports, _metal) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = currentPath;\n\n  /**\n  @module ember\n  */\n\n  /**\n    Returns the current path.\n  \n  Example:\n  \n  ```javascript\n  function validateURL() {\n    equal(currentPath(), 'some.path.index', \"correct path was transitioned into.\");\n  }\n  \n  click('#some-link-id').then(validateURL);\n  ```\n  \n  @method currentPath\n  @return {Object} The currently active path.\n  @since 1.5.0\n  @public\n  */\n  function currentPath(app) {\n    var routingService = app.__container__.lookup('service:-routing');\n\n    return (0, _metal.get)(routingService, 'currentPath');\n  }\n});","define(\"ember-testing/lib/helpers/current_route_name\", [\"exports\", \"@ember/-internals/metal\"], function (_exports, _metal) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = currentRouteName;\n\n  /**\n  @module ember\n  */\n\n  /**\n    Returns the currently active route name.\n  \n  Example:\n  \n  ```javascript\n  function validateRouteName() {\n    equal(currentRouteName(), 'some.path', \"correct route was transitioned into.\");\n  }\n  visit('/some/path').then(validateRouteName)\n  ```\n  \n  @method currentRouteName\n  @return {Object} The name of the currently active route.\n  @since 1.5.0\n  @public\n  */\n  function currentRouteName(app) {\n    var routingService = app.__container__.lookup('service:-routing');\n\n    return (0, _metal.get)(routingService, 'currentRouteName');\n  }\n});","define(\"ember-testing/lib/helpers/current_url\", [\"exports\", \"@ember/-internals/metal\"], function (_exports, _metal) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = currentURL;\n\n  /**\n  @module ember\n  */\n\n  /**\n    Returns the current URL.\n  \n  Example:\n  \n  ```javascript\n  function validateURL() {\n    equal(currentURL(), '/some/path', \"correct URL was transitioned into.\");\n  }\n  \n  click('#some-link-id').then(validateURL);\n  ```\n  \n  @method currentURL\n  @return {Object} The currently active URL.\n  @since 1.5.0\n  @public\n  */\n  function currentURL(app) {\n    var router = app.__container__.lookup('router:main');\n\n    return (0, _metal.get)(router, 'location').getURL();\n  }\n});","define(\"ember-testing/lib/helpers/fill_in\", [\"exports\", \"ember-testing/lib/events\", \"ember-testing/lib/helpers/-is-form-control\"], function (_exports, _events, _isFormControl) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = fillIn;\n\n  /**\n  @module ember\n  */\n\n  /**\n    Fills in an input element with some text.\n  \n    Example:\n  \n    ```javascript\n    fillIn('#email', 'you@example.com').then(function() {\n      // assert something\n    });\n    ```\n  \n    @method fillIn\n    @param {String} selector jQuery selector finding an input element on the DOM\n    to fill text with\n    @param {String} text text to place inside the input element\n    @return {RSVP.Promise<undefined>}\n    @public\n  */\n  function fillIn(app, selector, contextOrText, text) {\n    var $el, el, context;\n\n    if (text === undefined) {\n      text = contextOrText;\n    } else {\n      context = contextOrText;\n    }\n\n    $el = app.testHelpers.findWithAssert(selector, context);\n    el = $el[0];\n    (0, _events.focus)(el);\n\n    if ((0, _isFormControl.default)(el)) {\n      el.value = text;\n    } else {\n      el.innerHTML = text;\n    }\n\n    (0, _events.fireEvent)(el, 'input');\n    (0, _events.fireEvent)(el, 'change');\n    return app.testHelpers.wait();\n  }\n});","define(\"ember-testing/lib/helpers/find\", [\"exports\", \"@ember/-internals/metal\", \"@ember/debug\", \"@ember/-internals/views\"], function (_exports, _metal, _debug, _views) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = find;\n\n  /**\n  @module ember\n  */\n\n  /**\n    Finds an element in the context of the app's container element. A simple alias\n    for `app.$(selector)`.\n  \n    Example:\n  \n    ```javascript\n    var $el = find('.my-selector');\n    ```\n  \n    With the `context` param:\n  \n    ```javascript\n    var $el = find('.my-selector', '.parent-element-class');\n    ```\n  \n    @method find\n    @param {String} selector jQuery selector for element lookup\n    @param {String} [context] (optional) jQuery selector that will limit the selector\n                              argument to find only within the context's children\n    @return {Object} DOM element representing the results of the query\n    @public\n  */\n  function find(app, selector, context) {\n    if (_views.jQueryDisabled) {\n      (true && !(false) && (0, _debug.assert)('If jQuery is disabled, please import and use helpers from @ember/test-helpers [https://github.com/emberjs/ember-test-helpers]. Note: `find` is not an available helper.'));\n    }\n\n    var $el;\n    context = context || (0, _metal.get)(app, 'rootElement');\n    $el = app.$(selector, context);\n    return $el;\n  }\n});","define(\"ember-testing/lib/helpers/find_with_assert\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = findWithAssert;\n\n  /**\n  @module ember\n  */\n\n  /**\n    Like `find`, but throws an error if the element selector returns no results.\n  \n    Example:\n  \n    ```javascript\n    var $el = findWithAssert('.doesnt-exist'); // throws error\n    ```\n  \n    With the `context` param:\n  \n    ```javascript\n    var $el = findWithAssert('.selector-id', '.parent-element-class'); // assert will pass\n    ```\n  \n    @method findWithAssert\n    @param {String} selector jQuery selector string for finding an element within\n    the DOM\n    @param {String} [context] (optional) jQuery selector that will limit the\n    selector argument to find only within the context's children\n    @return {Object} jQuery object representing the results of the query\n    @throws {Error} throws error if object returned has a length of 0\n    @public\n  */\n  function findWithAssert(app, selector, context) {\n    var $el = app.testHelpers.find(selector, context);\n\n    if ($el.length === 0) {\n      throw new Error('Element ' + selector + ' not found.');\n    }\n\n    return $el;\n  }\n});","define(\"ember-testing/lib/helpers/key_event\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = keyEvent;\n\n  /**\n  @module ember\n  */\n\n  /**\n    Simulates a key event, e.g. `keypress`, `keydown`, `keyup` with the desired keyCode\n    Example:\n    ```javascript\n    keyEvent('.some-jQuery-selector', 'keypress', 13).then(function() {\n     // assert something\n    });\n    ```\n    @method keyEvent\n    @param {String} selector jQuery selector for finding element on the DOM\n    @param {String} type the type of key event, e.g. `keypress`, `keydown`, `keyup`\n    @param {Number} keyCode the keyCode of the simulated key event\n    @return {RSVP.Promise<undefined>}\n    @since 1.5.0\n    @public\n  */\n  function keyEvent(app, selector, contextOrType, typeOrKeyCode, keyCode) {\n    var context, type;\n\n    if (keyCode === undefined) {\n      context = null;\n      keyCode = typeOrKeyCode;\n      type = contextOrType;\n    } else {\n      context = contextOrType;\n      type = typeOrKeyCode;\n    }\n\n    return app.testHelpers.triggerEvent(selector, context, type, {\n      keyCode,\n      which: keyCode\n    });\n  }\n});","define(\"ember-testing/lib/helpers/pause_test\", [\"exports\", \"@ember/-internals/runtime\", \"@ember/debug\"], function (_exports, _runtime, _debug) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.resumeTest = resumeTest;\n  _exports.pauseTest = pauseTest;\n\n  /**\n  @module ember\n  */\n  var resume;\n  /**\n   Resumes a test paused by `pauseTest`.\n  \n   @method resumeTest\n   @return {void}\n   @public\n  */\n\n  function resumeTest() {\n    (true && !(resume) && (0, _debug.assert)('Testing has not been paused. There is nothing to resume.', resume));\n    resume();\n    resume = undefined;\n  }\n  /**\n   Pauses the current test - this is useful for debugging while testing or for test-driving.\n   It allows you to inspect the state of your application at any point.\n   Example (The test will pause before clicking the button):\n  \n   ```javascript\n   visit('/')\n   return pauseTest();\n   click('.btn');\n   ```\n  \n   You may want to turn off the timeout before pausing.\n  \n   qunit (timeout available to use as of 2.4.0):\n  \n   ```\n   visit('/');\n   assert.timeout(0);\n   return pauseTest();\n   click('.btn');\n   ```\n  \n   mocha (timeout happens automatically as of ember-mocha v0.14.0):\n  \n   ```\n   visit('/');\n   this.timeout(0);\n   return pauseTest();\n   click('.btn');\n   ```\n  \n  \n   @since 1.9.0\n   @method pauseTest\n   @return {Object} A promise that will never resolve\n   @public\n  */\n\n\n  function pauseTest() {\n    (0, _debug.info)('Testing paused. Use `resumeTest()` to continue.');\n    return new _runtime.RSVP.Promise(resolve => {\n      resume = resolve;\n    }, 'TestAdapter paused promise');\n  }\n});","define(\"ember-testing/lib/helpers/trigger_event\", [\"exports\", \"ember-testing/lib/events\"], function (_exports, _events) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = triggerEvent;\n\n  /**\n  @module ember\n  */\n\n  /**\n    Triggers the given DOM event on the element identified by the provided selector.\n    Example:\n    ```javascript\n    triggerEvent('#some-elem-id', 'blur');\n    ```\n    This is actually used internally by the `keyEvent` helper like so:\n    ```javascript\n    triggerEvent('#some-elem-id', 'keypress', { keyCode: 13 });\n    ```\n   @method triggerEvent\n   @param {String} selector jQuery selector for finding element on the DOM\n   @param {String} [context] jQuery selector that will limit the selector\n                             argument to find only within the context's children\n   @param {String} type The event type to be triggered.\n   @param {Object} [options] The options to be passed to jQuery.Event.\n   @return {RSVP.Promise<undefined>}\n   @since 1.5.0\n   @public\n  */\n  function triggerEvent(app, selector, contextOrType, typeOrOptions, possibleOptions) {\n    var arity = arguments.length;\n    var context, type, options;\n\n    if (arity === 3) {\n      // context and options are optional, so this is\n      // app, selector, type\n      context = null;\n      type = contextOrType;\n      options = {};\n    } else if (arity === 4) {\n      // context and options are optional, so this is\n      if (typeof typeOrOptions === 'object') {\n        // either\n        // app, selector, type, options\n        context = null;\n        type = contextOrType;\n        options = typeOrOptions;\n      } else {\n        // or\n        // app, selector, context, type\n        context = contextOrType;\n        type = typeOrOptions;\n        options = {};\n      }\n    } else {\n      context = contextOrType;\n      type = typeOrOptions;\n      options = possibleOptions;\n    }\n\n    var $el = app.testHelpers.findWithAssert(selector, context);\n    var el = $el[0];\n    (0, _events.fireEvent)(el, type, options);\n    return app.testHelpers.wait();\n  }\n});","define(\"ember-testing/lib/helpers/visit\", [\"exports\", \"@ember/runloop\"], function (_exports, _runloop) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = visit;\n\n  /**\n    Loads a route, sets up any controllers, and renders any templates associated\n    with the route as though a real user had triggered the route change while\n    using your app.\n  \n    Example:\n  \n    ```javascript\n    visit('posts/index').then(function() {\n      // assert something\n    });\n    ```\n  \n    @method visit\n    @param {String} url the name of the route\n    @return {RSVP.Promise<undefined>}\n    @public\n  */\n  function visit(app, url) {\n    var router = app.__container__.lookup('router:main');\n\n    var shouldHandleURL = false;\n    app.boot().then(() => {\n      router.location.setURL(url);\n\n      if (shouldHandleURL) {\n        (0, _runloop.run)(app.__deprecatedInstance__, 'handleURL', url);\n      }\n    });\n\n    if (app._readinessDeferrals > 0) {\n      router.initialURL = url;\n      (0, _runloop.run)(app, 'advanceReadiness');\n      delete router.initialURL;\n    } else {\n      shouldHandleURL = true;\n    }\n\n    return app.testHelpers.wait();\n  }\n});","define(\"ember-testing/lib/helpers/wait\", [\"exports\", \"ember-testing/lib/test/waiters\", \"@ember/-internals/runtime\", \"@ember/runloop\", \"ember-testing/lib/test/pending_requests\"], function (_exports, _waiters, _runtime, _runloop, _pending_requests) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = wait;\n\n  /**\n  @module ember\n  */\n\n  /**\n    Causes the run loop to process any pending events. This is used to ensure that\n    any async operations from other helpers (or your assertions) have been processed.\n  \n    This is most often used as the return value for the helper functions (see 'click',\n    'fillIn','visit',etc). However, there is a method to register a test helper which\n    utilizes this method without the need to actually call `wait()` in your helpers.\n  \n    The `wait` helper is built into `registerAsyncHelper` by default. You will not need\n    to `return app.testHelpers.wait();` - the wait behavior is provided for you.\n  \n    Example:\n  \n    ```javascript\n    import { registerAsyncHelper } from '@ember/test';\n  \n    registerAsyncHelper('loginUser', function(app, username, password) {\n      visit('secured/path/here')\n        .fillIn('#username', username)\n        .fillIn('#password', password)\n        .click('.submit');\n    });\n    ```\n  \n    @method wait\n    @param {Object} value The value to be returned.\n    @return {RSVP.Promise<any>} Promise that resolves to the passed value.\n    @public\n    @since 1.0.0\n  */\n  function wait(app, value) {\n    return new _runtime.RSVP.Promise(function (resolve) {\n      var router = app.__container__.lookup('router:main'); // Every 10ms, poll for the async thing to have finished\n\n\n      var watcher = setInterval(() => {\n        // 1. If the router is loading, keep polling\n        var routerIsLoading = router._routerMicrolib && Boolean(router._routerMicrolib.activeTransition);\n\n        if (routerIsLoading) {\n          return;\n        } // 2. If there are pending Ajax requests, keep polling\n\n\n        if ((0, _pending_requests.pendingRequests)()) {\n          return;\n        } // 3. If there are scheduled timers or we are inside of a run loop, keep polling\n\n\n        if ((0, _runloop.hasScheduledTimers)() || (0, _runloop.getCurrentRunLoop)()) {\n          return;\n        }\n\n        if ((0, _waiters.checkWaiters)()) {\n          return;\n        } // Stop polling\n\n\n        clearInterval(watcher); // Synchronously resolve the promise\n\n        (0, _runloop.run)(null, resolve, value);\n      }, 10);\n    });\n  }\n});","define(\"ember-testing/lib/initializers\", [\"@ember/application\"], function (_application) {\n  \"use strict\";\n\n  var name = 'deferReadiness in `testing` mode';\n  (0, _application.onLoad)('Ember.Application', function (Application) {\n    if (!Application.initializers[name]) {\n      Application.initializer({\n        name: name,\n\n        initialize(application) {\n          if (application.testing) {\n            application.deferReadiness();\n          }\n        }\n\n      });\n    }\n  });\n});","define(\"ember-testing/lib/setup_for_testing\", [\"exports\", \"@ember/debug\", \"@ember/-internals/views\", \"ember-testing/lib/test/adapter\", \"ember-testing/lib/test/pending_requests\", \"ember-testing/lib/adapters/adapter\", \"ember-testing/lib/adapters/qunit\"], function (_exports, _debug, _views, _adapter, _pending_requests, _adapter2, _qunit) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = setupForTesting;\n\n  /* global self */\n\n  /**\n    Sets Ember up for testing. This is useful to perform\n    basic setup steps in order to unit test.\n  \n    Use `App.setupForTesting` to perform integration tests (full\n    application testing).\n  \n    @method setupForTesting\n    @namespace Ember\n    @since 1.5.0\n    @private\n  */\n  function setupForTesting() {\n    (0, _debug.setTesting)(true);\n    var adapter = (0, _adapter.getAdapter)(); // if adapter is not manually set default to QUnit\n\n    if (!adapter) {\n      (0, _adapter.setAdapter)(typeof self.QUnit === 'undefined' ? _adapter2.default.create() : _qunit.default.create());\n    }\n\n    if (!_views.jQueryDisabled) {\n      (0, _views.jQuery)(document).off('ajaxSend', _pending_requests.incrementPendingRequests);\n      (0, _views.jQuery)(document).off('ajaxComplete', _pending_requests.decrementPendingRequests);\n      (0, _pending_requests.clearPendingRequests)();\n      (0, _views.jQuery)(document).on('ajaxSend', _pending_requests.incrementPendingRequests);\n      (0, _views.jQuery)(document).on('ajaxComplete', _pending_requests.decrementPendingRequests);\n    }\n  }\n});","define(\"ember-testing/lib/support\", [\"@ember/debug\", \"@ember/-internals/views\", \"@ember/-internals/browser-environment\"], function (_debug, _views, _browserEnvironment) {\n  \"use strict\";\n\n  /**\n    @module ember\n  */\n  var $ = _views.jQuery;\n  /**\n    This method creates a checkbox and triggers the click event to fire the\n    passed in handler. It is used to correct for a bug in older versions\n    of jQuery (e.g 1.8.3).\n  \n    @private\n    @method testCheckboxClick\n  */\n\n  function testCheckboxClick(handler) {\n    var input = document.createElement('input');\n    $(input).attr('type', 'checkbox').css({\n      position: 'absolute',\n      left: '-1000px',\n      top: '-1000px'\n    }).appendTo('body').on('click', handler).trigger('click').remove();\n  }\n\n  if (_browserEnvironment.hasDOM && !_views.jQueryDisabled) {\n    $(function () {\n      /*\n        Determine whether a checkbox checked using jQuery's \"click\" method will have\n        the correct value for its checked property.\n         If we determine that the current jQuery version exhibits this behavior,\n        patch it to work correctly as in the commit for the actual fix:\n        https://github.com/jquery/jquery/commit/1fb2f92.\n      */\n      testCheckboxClick(function () {\n        if (!this.checked && !$.event.special.click) {\n          $.event.special.click = {\n            // For checkbox, fire native event so checked state will be right\n            trigger() {\n              if (this.nodeName === 'INPUT' && this.type === 'checkbox' && this.click) {\n                this.click();\n                return false;\n              }\n            }\n\n          };\n        }\n      }); // Try again to verify that the patch took effect or blow up.\n\n      testCheckboxClick(function () {\n        (true && (0, _debug.warn)(\"clicked checkboxes should be checked! the jQuery patch didn't work\", this.checked, {\n          id: 'ember-testing.test-checkbox-click'\n        }));\n      });\n    });\n  }\n});","define(\"ember-testing/lib/test\", [\"exports\", \"ember-testing/lib/test/helpers\", \"ember-testing/lib/test/on_inject_helpers\", \"ember-testing/lib/test/promise\", \"ember-testing/lib/test/waiters\", \"ember-testing/lib/test/adapter\"], function (_exports, _helpers, _on_inject_helpers, _promise, _waiters, _adapter) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n    @module ember\n  */\n\n  /**\n    This is a container for an assortment of testing related functionality:\n  \n    * Choose your default test adapter (for your framework of choice).\n    * Register/Unregister additional test helpers.\n    * Setup callbacks to be fired when the test helpers are injected into\n      your application.\n  \n    @class Test\n    @namespace Ember\n    @public\n  */\n  var Test = {\n    /**\n      Hash containing all known test helpers.\n       @property _helpers\n      @private\n      @since 1.7.0\n    */\n    _helpers: _helpers.helpers,\n    registerHelper: _helpers.registerHelper,\n    registerAsyncHelper: _helpers.registerAsyncHelper,\n    unregisterHelper: _helpers.unregisterHelper,\n    onInjectHelpers: _on_inject_helpers.onInjectHelpers,\n    Promise: _promise.default,\n    promise: _promise.promise,\n    resolve: _promise.resolve,\n    registerWaiter: _waiters.registerWaiter,\n    unregisterWaiter: _waiters.unregisterWaiter,\n    checkWaiters: _waiters.checkWaiters\n  };\n  /**\n   Used to allow ember-testing to communicate with a specific testing\n   framework.\n  \n   You can manually set it before calling `App.setupForTesting()`.\n  \n   Example:\n  \n   ```javascript\n   Ember.Test.adapter = MyCustomAdapter.create()\n   ```\n  \n   If you do not set it, ember-testing will default to `Ember.Test.QUnitAdapter`.\n  \n   @public\n   @for Ember.Test\n   @property adapter\n   @type {Class} The adapter to be used.\n   @default Ember.Test.QUnitAdapter\n  */\n\n  Object.defineProperty(Test, 'adapter', {\n    get: _adapter.getAdapter,\n    set: _adapter.setAdapter\n  });\n  var _default = Test;\n  _exports.default = _default;\n});","define(\"ember-testing/lib/test/adapter\", [\"exports\", \"@ember/-internals/error-handling\"], function (_exports, _errorHandling) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.getAdapter = getAdapter;\n  _exports.setAdapter = setAdapter;\n  _exports.asyncStart = asyncStart;\n  _exports.asyncEnd = asyncEnd;\n  var adapter;\n\n  function getAdapter() {\n    return adapter;\n  }\n\n  function setAdapter(value) {\n    adapter = value;\n\n    if (value && typeof value.exception === 'function') {\n      (0, _errorHandling.setDispatchOverride)(adapterDispatch);\n    } else {\n      (0, _errorHandling.setDispatchOverride)(null);\n    }\n  }\n\n  function asyncStart() {\n    if (adapter) {\n      adapter.asyncStart();\n    }\n  }\n\n  function asyncEnd() {\n    if (adapter) {\n      adapter.asyncEnd();\n    }\n  }\n\n  function adapterDispatch(error) {\n    adapter.exception(error);\n    console.error(error.stack); // eslint-disable-line no-console\n  }\n});","define(\"ember-testing/lib/test/helpers\", [\"exports\", \"ember-testing/lib/test/promise\"], function (_exports, _promise) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.registerHelper = registerHelper;\n  _exports.registerAsyncHelper = registerAsyncHelper;\n  _exports.unregisterHelper = unregisterHelper;\n  _exports.helpers = void 0;\n  var helpers = {};\n  /**\n   @module @ember/test\n  */\n\n  /**\n    `registerHelper` is used to register a test helper that will be injected\n    when `App.injectTestHelpers` is called.\n  \n    The helper method will always be called with the current Application as\n    the first parameter.\n  \n    For example:\n  \n    ```javascript\n    import { registerHelper } from '@ember/test';\n    import { run } from '@ember/runloop';\n  \n    registerHelper('boot', function(app) {\n      run(app, app.advanceReadiness);\n    });\n    ```\n  \n    This helper can later be called without arguments because it will be\n    called with `app` as the first parameter.\n  \n    ```javascript\n    import Application from '@ember/application';\n  \n    App = Application.create();\n    App.injectTestHelpers();\n    boot();\n    ```\n  \n    @public\n    @for @ember/test\n    @static\n    @method registerHelper\n    @param {String} name The name of the helper method to add.\n    @param {Function} helperMethod\n    @param options {Object}\n  */\n\n  _exports.helpers = helpers;\n\n  function registerHelper(name, helperMethod) {\n    helpers[name] = {\n      method: helperMethod,\n      meta: {\n        wait: false\n      }\n    };\n  }\n  /**\n    `registerAsyncHelper` is used to register an async test helper that will be injected\n    when `App.injectTestHelpers` is called.\n  \n    The helper method will always be called with the current Application as\n    the first parameter.\n  \n    For example:\n  \n    ```javascript\n    import { registerAsyncHelper } from '@ember/test';\n    import { run } from '@ember/runloop';\n  \n    registerAsyncHelper('boot', function(app) {\n      run(app, app.advanceReadiness);\n    });\n    ```\n  \n    The advantage of an async helper is that it will not run\n    until the last async helper has completed.  All async helpers\n    after it will wait for it complete before running.\n  \n  \n    For example:\n  \n    ```javascript\n    import { registerAsyncHelper } from '@ember/test';\n  \n    registerAsyncHelper('deletePost', function(app, postId) {\n      click('.delete-' + postId);\n    });\n  \n    // ... in your test\n    visit('/post/2');\n    deletePost(2);\n    visit('/post/3');\n    deletePost(3);\n    ```\n  \n    @public\n    @for @ember/test\n    @method registerAsyncHelper\n    @param {String} name The name of the helper method to add.\n    @param {Function} helperMethod\n    @since 1.2.0\n  */\n\n\n  function registerAsyncHelper(name, helperMethod) {\n    helpers[name] = {\n      method: helperMethod,\n      meta: {\n        wait: true\n      }\n    };\n  }\n  /**\n    Remove a previously added helper method.\n  \n    Example:\n  \n    ```javascript\n    import { unregisterHelper } from '@ember/test';\n  \n    unregisterHelper('wait');\n    ```\n  \n    @public\n    @method unregisterHelper\n    @static\n    @for @ember/test\n    @param {String} name The helper to remove.\n  */\n\n\n  function unregisterHelper(name) {\n    delete helpers[name];\n    delete _promise.default.prototype[name];\n  }\n});","define(\"ember-testing/lib/test/on_inject_helpers\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.onInjectHelpers = onInjectHelpers;\n  _exports.invokeInjectHelpersCallbacks = invokeInjectHelpersCallbacks;\n  _exports.callbacks = void 0;\n  var callbacks = [];\n  /**\n    Used to register callbacks to be fired whenever `App.injectTestHelpers`\n    is called.\n  \n    The callback will receive the current application as an argument.\n  \n    Example:\n  \n    ```javascript\n    import $ from 'jquery';\n  \n    Ember.Test.onInjectHelpers(function() {\n      $(document).ajaxSend(function() {\n        Test.pendingRequests++;\n      });\n  \n      $(document).ajaxComplete(function() {\n        Test.pendingRequests--;\n      });\n    });\n    ```\n  \n    @public\n    @for Ember.Test\n    @method onInjectHelpers\n    @param {Function} callback The function to be called.\n  */\n\n  _exports.callbacks = callbacks;\n\n  function onInjectHelpers(callback) {\n    callbacks.push(callback);\n  }\n\n  function invokeInjectHelpersCallbacks(app) {\n    for (var i = 0; i < callbacks.length; i++) {\n      callbacks[i](app);\n    }\n  }\n});","define(\"ember-testing/lib/test/pending_requests\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.pendingRequests = pendingRequests;\n  _exports.clearPendingRequests = clearPendingRequests;\n  _exports.incrementPendingRequests = incrementPendingRequests;\n  _exports.decrementPendingRequests = decrementPendingRequests;\n  var requests = [];\n\n  function pendingRequests() {\n    return requests.length;\n  }\n\n  function clearPendingRequests() {\n    requests.length = 0;\n  }\n\n  function incrementPendingRequests(_, xhr) {\n    requests.push(xhr);\n  }\n\n  function decrementPendingRequests(_, xhr) {\n    setTimeout(function () {\n      for (var i = 0; i < requests.length; i++) {\n        if (xhr === requests[i]) {\n          requests.splice(i, 1);\n          break;\n        }\n      }\n    }, 0);\n  }\n});","define(\"ember-testing/lib/test/promise\", [\"exports\", \"@ember/-internals/runtime\", \"ember-testing/lib/test/run\"], function (_exports, _runtime, _run) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.promise = promise;\n  _exports.resolve = resolve;\n  _exports.getLastPromise = getLastPromise;\n  _exports.default = void 0;\n  var lastPromise;\n\n  class TestPromise extends _runtime.RSVP.Promise {\n    constructor() {\n      super(...arguments);\n      lastPromise = this;\n    }\n\n    then(_onFulfillment, ...args) {\n      var onFulfillment = typeof _onFulfillment === 'function' ? result => isolate(_onFulfillment, result) : undefined;\n      return super.then(onFulfillment, ...args);\n    }\n\n  }\n  /**\n    This returns a thenable tailored for testing.  It catches failed\n    `onSuccess` callbacks and invokes the `Ember.Test.adapter.exception`\n    callback in the last chained then.\n  \n    This method should be returned by async helpers such as `wait`.\n  \n    @public\n    @for Ember.Test\n    @method promise\n    @param {Function} resolver The function used to resolve the promise.\n    @param {String} label An optional string for identifying the promise.\n  */\n\n\n  _exports.default = TestPromise;\n\n  function promise(resolver, label) {\n    var fullLabel = \"Ember.Test.promise: \" + (label || '<Unknown Promise>');\n    return new TestPromise(resolver, fullLabel);\n  }\n  /**\n    Replacement for `Ember.RSVP.resolve`\n    The only difference is this uses\n    an instance of `Ember.Test.Promise`\n  \n    @public\n    @for Ember.Test\n    @method resolve\n    @param {Mixed} The value to resolve\n    @since 1.2.0\n  */\n\n\n  function resolve(result, label) {\n    return TestPromise.resolve(result, label);\n  }\n\n  function getLastPromise() {\n    return lastPromise;\n  } // This method isolates nested async methods\n  // so that they don't conflict with other last promises.\n  //\n  // 1. Set `Ember.Test.lastPromise` to null\n  // 2. Invoke method\n  // 3. Return the last promise created during method\n\n\n  function isolate(onFulfillment, result) {\n    // Reset lastPromise for nested helpers\n    lastPromise = null;\n    var value = onFulfillment(result);\n    var promise = lastPromise;\n    lastPromise = null; // If the method returned a promise\n    // return that promise. If not,\n    // return the last async helper's promise\n\n    if (value && value instanceof TestPromise || !promise) {\n      return value;\n    } else {\n      return (0, _run.default)(() => resolve(promise).then(() => value));\n    }\n  }\n});","define(\"ember-testing/lib/test/run\", [\"exports\", \"@ember/runloop\"], function (_exports, _runloop) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = run;\n\n  function run(fn) {\n    if (!(0, _runloop.getCurrentRunLoop)()) {\n      return (0, _runloop.run)(fn);\n    } else {\n      return fn();\n    }\n  }\n});","define(\"ember-testing/lib/test/waiters\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.registerWaiter = registerWaiter;\n  _exports.unregisterWaiter = unregisterWaiter;\n  _exports.checkWaiters = checkWaiters;\n\n  /**\n   @module @ember/test\n  */\n  var contexts = [];\n  var callbacks = [];\n  /**\n     This allows ember-testing to play nicely with other asynchronous\n     events, such as an application that is waiting for a CSS3\n     transition or an IndexDB transaction. The waiter runs periodically\n     after each async helper (i.e. `click`, `andThen`, `visit`, etc) has executed,\n     until the returning result is truthy. After the waiters finish, the next async helper\n     is executed and the process repeats.\n  \n     For example:\n  \n     ```javascript\n     import { registerWaiter } from '@ember/test';\n  \n     registerWaiter(function() {\n       return myPendingTransactions() === 0;\n     });\n     ```\n     The `context` argument allows you to optionally specify the `this`\n     with which your callback will be invoked.\n  \n     For example:\n  \n     ```javascript\n     import { registerWaiter } from '@ember/test';\n  \n     registerWaiter(MyDB, MyDB.hasPendingTransactions);\n     ```\n  \n     @public\n     @for @ember/test\n     @static\n     @method registerWaiter\n     @param {Object} context (optional)\n     @param {Function} callback\n     @since 1.2.0\n  */\n\n  function registerWaiter(context, callback) {\n    if (arguments.length === 1) {\n      callback = context;\n      context = null;\n    }\n\n    if (indexOf(context, callback) > -1) {\n      return;\n    }\n\n    contexts.push(context);\n    callbacks.push(callback);\n  }\n  /**\n     `unregisterWaiter` is used to unregister a callback that was\n     registered with `registerWaiter`.\n  \n     @public\n     @for @ember/test\n     @static\n     @method unregisterWaiter\n     @param {Object} context (optional)\n     @param {Function} callback\n     @since 1.2.0\n  */\n\n\n  function unregisterWaiter(context, callback) {\n    if (!callbacks.length) {\n      return;\n    }\n\n    if (arguments.length === 1) {\n      callback = context;\n      context = null;\n    }\n\n    var i = indexOf(context, callback);\n\n    if (i === -1) {\n      return;\n    }\n\n    contexts.splice(i, 1);\n    callbacks.splice(i, 1);\n  }\n  /**\n    Iterates through each registered test waiter, and invokes\n    its callback. If any waiter returns false, this method will return\n    true indicating that the waiters have not settled yet.\n  \n    This is generally used internally from the acceptance/integration test\n    infrastructure.\n  \n    @public\n    @for @ember/test\n    @static\n    @method checkWaiters\n  */\n\n\n  function checkWaiters() {\n    if (!callbacks.length) {\n      return false;\n    }\n\n    for (var i = 0; i < callbacks.length; i++) {\n      var context = contexts[i];\n      var callback = callbacks[i];\n\n      if (!callback.call(context)) {\n        return true;\n      }\n    }\n\n    return false;\n  }\n\n  function indexOf(context, callback) {\n    for (var i = 0; i < callbacks.length; i++) {\n      if (callbacks[i] === callback && contexts[i] === context) {\n        return i;\n      }\n    }\n\n    return -1;\n  }\n});","define(\"ember/index\", [\"exports\", \"require\", \"@ember/-internals/environment\", \"node-module\", \"@ember/-internals/utils\", \"@ember/-internals/container\", \"@ember/instrumentation\", \"@ember/-internals/meta\", \"@ember/-internals/metal\", \"@ember/canary-features\", \"@ember/debug\", \"backburner\", \"@ember/-internals/console\", \"@ember/controller\", \"@ember/controller/lib/controller_mixin\", \"@ember/string\", \"@ember/service\", \"@ember/object\", \"@ember/object/compat\", \"@ember/object/computed\", \"@ember/-internals/runtime\", \"@ember/-internals/glimmer\", \"ember/version\", \"@ember/-internals/views\", \"@ember/-internals/routing\", \"@ember/-internals/extension-support\", \"@ember/error\", \"@ember/runloop\", \"@ember/-internals/error-handling\", \"@ember/-internals/owner\", \"@ember/application\", \"@ember/application/globals-resolver\", \"@ember/application/instance\", \"@ember/engine\", \"@ember/engine/instance\", \"@ember/polyfills\", \"@ember/deprecated-features\", \"@ember/component/template-only\"], function (_exports, _require, _environment, _nodeModule, utils, _container, instrumentation, _meta, metal, _canaryFeatures, EmberDebug, _backburner, _console, _controller, _controller_mixin, _string, _service, _object, _compat, _computed, _runtime, _glimmer, _version, views, routing, extensionSupport, _error, runloop, _errorHandling, _owner, _application, _globalsResolver, _instance, _engine, _instance2, _polyfills, _deprecatedFeatures, _templateOnly) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  // eslint-disable-next-line import/no-unresolved\n  // ****@ember/-internals/environment****\n  var Ember = typeof _environment.context.imports.Ember === 'object' && _environment.context.imports.Ember || {};\n  Ember.isNamespace = true;\n\n  Ember.toString = function () {\n    return 'Ember';\n  };\n\n  Object.defineProperty(Ember, 'ENV', {\n    get: _environment.getENV,\n    enumerable: false\n  });\n  Object.defineProperty(Ember, 'lookup', {\n    get: _environment.getLookup,\n    set: _environment.setLookup,\n    enumerable: false\n  });\n\n  if (_deprecatedFeatures.EMBER_EXTEND_PROTOTYPES) {\n    Object.defineProperty(Ember, 'EXTEND_PROTOTYPES', {\n      enumerable: false,\n\n      get() {\n        (true && !(false) && (0, EmberDebug.deprecate)('Accessing Ember.EXTEND_PROTOTYPES is deprecated, please migrate to Ember.ENV.EXTEND_PROTOTYPES', false, {\n          id: 'ember-env.old-extend-prototypes',\n          until: '4.0.0'\n        }));\n        return _environment.ENV.EXTEND_PROTOTYPES;\n      }\n\n    });\n  } // ****@ember/application****\n\n\n  Ember.getOwner = _owner.getOwner;\n  Ember.setOwner = _owner.setOwner;\n  Ember.Application = _application.default;\n  Ember.DefaultResolver = Ember.Resolver = _globalsResolver.default;\n  Ember.ApplicationInstance = _instance.default; // ****@ember/engine****\n\n  Ember.Engine = _engine.default;\n  Ember.EngineInstance = _instance2.default; // ****@ember/polyfills****\n\n  Ember.assign = _polyfills.assign;\n  Ember.merge = _polyfills.merge; // ****@ember/-internals/utils****\n\n  Ember.generateGuid = utils.generateGuid;\n  Ember.GUID_KEY = utils.GUID_KEY;\n  Ember.guidFor = utils.guidFor;\n  Ember.inspect = utils.inspect;\n  Ember.makeArray = utils.makeArray;\n  Ember.canInvoke = utils.canInvoke;\n  Ember.tryInvoke = utils.tryInvoke;\n  Ember.wrap = utils.wrap;\n  Ember.uuid = utils.uuid; // ****@ember/-internals/container****\n\n  Ember.Container = _container.Container;\n  Ember.Registry = _container.Registry; // ****@ember/debug****\n\n  Ember.assert = EmberDebug.assert;\n  Ember.warn = EmberDebug.warn;\n  Ember.debug = EmberDebug.debug;\n  Ember.deprecate = EmberDebug.deprecate;\n  Ember.deprecateFunc = EmberDebug.deprecateFunc;\n  Ember.runInDebug = EmberDebug.runInDebug; // ****@ember/error****\n\n  Ember.Error = _error.default;\n  /**\n    @public\n    @class Ember.Debug\n  */\n\n  Ember.Debug = {\n    registerDeprecationHandler: EmberDebug.registerDeprecationHandler,\n    registerWarnHandler: EmberDebug.registerWarnHandler,\n    isComputed: metal.isComputed\n  }; // ****@ember/instrumentation****\n\n  Ember.instrument = instrumentation.instrument;\n  Ember.subscribe = instrumentation.subscribe;\n  Ember.Instrumentation = {\n    instrument: instrumentation.instrument,\n    subscribe: instrumentation.subscribe,\n    unsubscribe: instrumentation.unsubscribe,\n    reset: instrumentation.reset\n  }; // ****@ember/runloop****\n  // Using _globalsRun here so that mutating the function (adding\n  // `next`, `later`, etc to it) is only available in globals builds\n\n  Ember.run = runloop._globalsRun;\n  Ember.run.backburner = runloop.backburner;\n  Ember.run.begin = runloop.begin;\n  Ember.run.bind = runloop.bind;\n  Ember.run.cancel = runloop.cancel;\n  Ember.run.debounce = runloop.debounce;\n  Ember.run.end = runloop.end;\n  Ember.run.hasScheduledTimers = runloop.hasScheduledTimers;\n  Ember.run.join = runloop.join;\n  Ember.run.later = runloop.later;\n  Ember.run.next = runloop.next;\n  Ember.run.once = runloop.once;\n  Ember.run.schedule = runloop.schedule;\n  Ember.run.scheduleOnce = runloop.scheduleOnce;\n  Ember.run.throttle = runloop.throttle;\n  Ember.run.cancelTimers = runloop.cancelTimers;\n  Object.defineProperty(Ember.run, 'currentRunLoop', {\n    get: runloop.getCurrentRunLoop,\n    enumerable: false\n  }); // ****@ember/-internals/metal****\n  // Using _globalsComputed here so that mutating the function is only available\n  // in globals builds\n\n  var computed = metal._globalsComputed;\n  Ember.computed = computed;\n  Ember._descriptor = metal.nativeDescDecorator;\n  Ember._tracked = metal.tracked;\n  computed.alias = metal.alias;\n  Ember.cacheFor = metal.getCachedValueFor;\n  Ember.ComputedProperty = metal.ComputedProperty;\n  Object.defineProperty(Ember, '_setComputedDecorator', {\n    get() {\n      (true && !(false) && (0, EmberDebug.deprecate)('Please migrate from Ember._setComputedDecorator to Ember._setClassicDecorator', false, {\n        id: 'ember._setComputedDecorator',\n        until: '3.13.0'\n      }));\n      return metal.setClassicDecorator;\n    }\n\n  });\n  Ember._setClassicDecorator = metal.setClassicDecorator;\n  Ember.meta = _meta.meta;\n  Ember.get = metal.get;\n  Ember.getWithDefault = metal.getWithDefault;\n  Ember._getPath = metal._getPath;\n  Ember.set = metal.set;\n  Ember.trySet = metal.trySet;\n  Ember.FEATURES = (0, _polyfills.assign)({\n    isEnabled: _canaryFeatures.isEnabled\n  }, _canaryFeatures.FEATURES);\n  Ember._Cache = utils.Cache;\n  Ember.on = metal.on;\n  Ember.addListener = metal.addListener;\n  Ember.removeListener = metal.removeListener;\n  Ember.sendEvent = metal.sendEvent;\n  Ember.hasListeners = metal.hasListeners;\n  Ember.isNone = metal.isNone;\n  Ember.isEmpty = metal.isEmpty;\n  Ember.isBlank = metal.isBlank;\n  Ember.isPresent = metal.isPresent;\n  Ember.notifyPropertyChange = metal.notifyPropertyChange;\n  Ember.overrideChains = metal.overrideChains;\n  Ember.beginPropertyChanges = metal.beginPropertyChanges;\n  Ember.endPropertyChanges = metal.endPropertyChanges;\n  Ember.changeProperties = metal.changeProperties;\n  Ember.platform = {\n    defineProperty: true,\n    hasPropertyAccessors: true\n  };\n  Ember.defineProperty = metal.defineProperty;\n  Ember.watchKey = metal.watchKey;\n  Ember.unwatchKey = metal.unwatchKey;\n  Ember.removeChainWatcher = metal.removeChainWatcher;\n  Ember._ChainNode = metal.ChainNode;\n  Ember.finishChains = metal.finishChains;\n  Ember.watchPath = metal.watchPath;\n  Ember.unwatchPath = metal.unwatchPath;\n  Ember.watch = metal.watch;\n  Ember.isWatching = metal.isWatching;\n  Ember.unwatch = metal.unwatch;\n  Ember.destroy = _meta.deleteMeta;\n  Ember.libraries = metal.libraries;\n  Ember.getProperties = metal.getProperties;\n  Ember.setProperties = metal.setProperties;\n  Ember.expandProperties = metal.expandProperties;\n  Ember.addObserver = metal.addObserver;\n  Ember.removeObserver = metal.removeObserver;\n  Ember.aliasMethod = metal.aliasMethod;\n  Ember.observer = metal.observer;\n  Ember.mixin = metal.mixin;\n  Ember.Mixin = metal.Mixin;\n  /**\n    A function may be assigned to `Ember.onerror` to be called when Ember\n    internals encounter an error. This is useful for specialized error handling\n    and reporting code.\n  \n    ```javascript\n    import $ from 'jquery';\n  \n    Ember.onerror = function(error) {\n      $.ajax('/report-error', 'POST', {\n        stack: error.stack,\n        otherInformation: 'whatever app state you want to provide'\n      });\n    };\n    ```\n  \n    Internally, `Ember.onerror` is used as Backburner's error handler.\n  \n    @event onerror\n    @for Ember\n    @param {Exception} error the error object\n    @public\n  */\n\n  Object.defineProperty(Ember, 'onerror', {\n    get: _errorHandling.getOnerror,\n    set: _errorHandling.setOnerror,\n    enumerable: false\n  });\n  Object.defineProperty(Ember, 'testing', {\n    get: EmberDebug.isTesting,\n    set: EmberDebug.setTesting,\n    enumerable: false\n  });\n  Ember._Backburner = _backburner.default; // ****@ember/-internals/console****\n\n  if (_deprecatedFeatures.LOGGER) {\n    Ember.Logger = _console.default;\n  } // ****@ember/-internals/runtime****\n\n\n  Ember.A = _runtime.A;\n  Ember.String = {\n    loc: _string.loc,\n    w: _string.w,\n    dasherize: _string.dasherize,\n    decamelize: _string.decamelize,\n    camelize: _string.camelize,\n    classify: _string.classify,\n    underscore: _string.underscore,\n    capitalize: _string.capitalize\n  };\n  Ember.Object = _runtime.Object;\n  Ember._RegistryProxyMixin = _runtime.RegistryProxyMixin;\n  Ember._ContainerProxyMixin = _runtime.ContainerProxyMixin;\n  Ember.compare = _runtime.compare;\n  Ember.copy = _runtime.copy;\n  Ember.isEqual = _runtime.isEqual;\n  Ember._setFrameworkClass = _runtime.setFrameworkClass;\n  /**\n  @module ember\n  */\n\n  /**\n    Namespace for injection helper methods.\n  \n    @class inject\n    @namespace Ember\n    @static\n    @public\n  */\n\n  Ember.inject = function inject() {\n    (true && !(false) && (0, EmberDebug.assert)(\"Injected properties must be created through helpers, see '\" + Object.keys(inject).map(k => \"'inject.\" + k + \"'\").join(' or ') + \"'\"));\n  };\n\n  Ember.inject.service = _service.inject;\n  Ember.inject.controller = _controller.inject;\n  Ember.Array = _runtime.Array;\n  Ember.Comparable = _runtime.Comparable;\n  Ember.Enumerable = _runtime.Enumerable;\n  Ember.ArrayProxy = _runtime.ArrayProxy;\n  Ember.ObjectProxy = _runtime.ObjectProxy;\n  Ember.ActionHandler = _runtime.ActionHandler;\n  Ember.CoreObject = _runtime.CoreObject;\n  Ember.NativeArray = _runtime.NativeArray;\n  Ember.Copyable = _runtime.Copyable;\n  Ember.MutableEnumerable = _runtime.MutableEnumerable;\n  Ember.MutableArray = _runtime.MutableArray;\n  Ember.TargetActionSupport = _runtime.TargetActionSupport;\n  Ember.Evented = _runtime.Evented;\n  Ember.PromiseProxyMixin = _runtime.PromiseProxyMixin;\n  Ember.Observable = _runtime.Observable;\n  Ember.typeOf = _runtime.typeOf;\n  Ember.isArray = _runtime.isArray;\n  Ember.Object = _runtime.Object;\n  Ember.onLoad = _application.onLoad;\n  Ember.runLoadHooks = _application.runLoadHooks;\n  Ember.Controller = _controller.default;\n  Ember.ControllerMixin = _controller_mixin.default;\n  Ember.Service = _service.default;\n  Ember._ProxyMixin = _runtime._ProxyMixin;\n  Ember.RSVP = _runtime.RSVP;\n  Ember.Namespace = _runtime.Namespace;\n  Ember._action = _object.action;\n  Ember._dependentKeyCompat = _compat.dependentKeyCompat;\n  computed.empty = _computed.empty;\n  computed.notEmpty = _computed.notEmpty;\n  computed.none = _computed.none;\n  computed.not = _computed.not;\n  computed.bool = _computed.bool;\n  computed.match = _computed.match;\n  computed.equal = _computed.equal;\n  computed.gt = _computed.gt;\n  computed.gte = _computed.gte;\n  computed.lt = _computed.lt;\n  computed.lte = _computed.lte;\n  computed.oneWay = _computed.oneWay;\n  computed.reads = _computed.oneWay;\n  computed.readOnly = _computed.readOnly;\n  computed.deprecatingAlias = _computed.deprecatingAlias;\n  computed.and = _computed.and;\n  computed.or = _computed.or;\n  computed.sum = _computed.sum;\n  computed.min = _computed.min;\n  computed.max = _computed.max;\n  computed.map = _computed.map;\n  computed.sort = _computed.sort;\n  computed.setDiff = _computed.setDiff;\n  computed.mapBy = _computed.mapBy;\n  computed.filter = _computed.filter;\n  computed.filterBy = _computed.filterBy;\n  computed.uniq = _computed.uniq;\n  computed.uniqBy = _computed.uniqBy;\n  computed.union = _computed.union;\n  computed.intersect = _computed.intersect;\n  computed.collect = _computed.collect;\n  /**\n    Defines the hash of localized strings for the current language. Used by\n    the `String.loc` helper. To localize, add string values to this\n    hash.\n  \n    @property STRINGS\n    @for Ember\n    @type Object\n    @private\n  */\n\n  Object.defineProperty(Ember, 'STRINGS', {\n    configurable: false,\n    get: _string._getStrings,\n    set: _string._setStrings\n  });\n  /**\n    Whether searching on the global for new Namespace instances is enabled.\n  \n    This is only exported here as to not break any addons.  Given the new\n    visit API, you will have issues if you treat this as a indicator of\n    booted.\n  \n    Internally this is only exposing a flag in Namespace.\n  \n    @property BOOTED\n    @for Ember\n    @type Boolean\n    @private\n  */\n\n  Object.defineProperty(Ember, 'BOOTED', {\n    configurable: false,\n    enumerable: false,\n    get: metal.isNamespaceSearchDisabled,\n    set: metal.setNamespaceSearchDisabled\n  }); // ****@ember/-internals/glimmer****\n\n  Ember.Component = _glimmer.Component;\n  _glimmer.Helper.helper = _glimmer.helper;\n  Ember.Helper = _glimmer.Helper;\n  Ember.Checkbox = _glimmer.Checkbox;\n  Ember.TextField = _glimmer.TextField;\n  Ember.TextArea = _glimmer.TextArea;\n  Ember.LinkComponent = _glimmer.LinkComponent;\n  Ember._setComponentManager = _glimmer.setComponentManager;\n  Ember._componentManagerCapabilities = _glimmer.capabilities;\n  Ember._setModifierManager = _glimmer.setModifierManager;\n  Ember._modifierManagerCapabilities = _glimmer.modifierCapabilities;\n\n  if (true\n  /* EMBER_GLIMMER_SET_COMPONENT_TEMPLATE */\n  ) {\n      Ember._getComponentTemplate = _glimmer.getComponentTemplate;\n      Ember._setComponentTemplate = _glimmer.setComponentTemplate;\n      Ember._templateOnlyComponent = _templateOnly.default;\n    }\n\n  Ember._captureRenderTree = EmberDebug.captureRenderTree;\n  Ember.Handlebars = {\n    template: _glimmer.template,\n    Utils: {\n      escapeExpression: _glimmer.escapeExpression\n    }\n  };\n  Ember.HTMLBars = {\n    template: _glimmer.template\n  };\n\n  if (_environment.ENV.EXTEND_PROTOTYPES.String) {\n    String.prototype.htmlSafe = function () {\n      return (0, _glimmer.htmlSafe)(this);\n    };\n  }\n\n  Ember.String.htmlSafe = _glimmer.htmlSafe;\n  Ember.String.isHTMLSafe = _glimmer.isHTMLSafe;\n  /**\n    Global hash of shared templates. This will automatically be populated\n    by the build tools so that you can store your Handlebars templates in\n    separate files that get loaded into JavaScript at buildtime.\n  \n    @property TEMPLATES\n    @for Ember\n    @type Object\n    @private\n  */\n\n  Object.defineProperty(Ember, 'TEMPLATES', {\n    get: _glimmer.getTemplates,\n    set: _glimmer.setTemplates,\n    configurable: false,\n    enumerable: false\n  });\n  /**\n    The semantic version\n  \n    @property VERSION\n    @type String\n    @public\n  */\n\n  Ember.VERSION = _version.default; // ****@ember/-internals/views****\n\n  if (_deprecatedFeatures.JQUERY_INTEGRATION && !views.jQueryDisabled) {\n    Object.defineProperty(Ember, '$', {\n      get() {\n        (true && !(false) && (0, EmberDebug.deprecate)(\"Using Ember.$() has been deprecated, use `import jQuery from 'jquery';` instead\", false, {\n          id: 'ember-views.curly-components.jquery-element',\n          until: '4.0.0',\n          url: 'https://emberjs.com/deprecations/v3.x#toc_jquery-apis'\n        }));\n        return views.jQuery;\n      },\n\n      configurable: true,\n      enumerable: true\n    });\n  }\n\n  Ember.ViewUtils = {\n    isSimpleClick: views.isSimpleClick,\n    getElementView: views.getElementView,\n    getViewElement: views.getViewElement,\n    getViewBounds: views.getViewBounds,\n    getViewClientRects: views.getViewClientRects,\n    getViewBoundingClientRect: views.getViewBoundingClientRect,\n    getRootViews: views.getRootViews,\n    getChildViews: views.getChildViews,\n    isSerializationFirstNode: _glimmer.isSerializationFirstNode\n  };\n  Ember.TextSupport = views.TextSupport;\n  Ember.ComponentLookup = views.ComponentLookup;\n  Ember.EventDispatcher = views.EventDispatcher; // ****@ember/-internals/routing****\n\n  Ember.Location = routing.Location;\n  Ember.AutoLocation = routing.AutoLocation;\n  Ember.HashLocation = routing.HashLocation;\n  Ember.HistoryLocation = routing.HistoryLocation;\n  Ember.NoneLocation = routing.NoneLocation;\n  Ember.controllerFor = routing.controllerFor;\n  Ember.generateControllerFactory = routing.generateControllerFactory;\n  Ember.generateController = routing.generateController;\n  Ember.RouterDSL = routing.RouterDSL;\n  Ember.Router = routing.Router;\n  Ember.Route = routing.Route;\n  (0, _application.runLoadHooks)('Ember.Application', _application.default);\n  Ember.DataAdapter = extensionSupport.DataAdapter;\n  Ember.ContainerDebugAdapter = extensionSupport.ContainerDebugAdapter;\n\n  if ((0, _require.has)('ember-template-compiler')) {\n    (0, _require.default)(\"ember-template-compiler\");\n  } // do this to ensure that Ember.Test is defined properly on the global\n  // if it is present.\n\n\n  if ((0, _require.has)('ember-testing')) {\n    var testing = (0, _require.default)(\"ember-testing\");\n    Ember.Test = testing.Test;\n    Ember.Test.Adapter = testing.Adapter;\n    Ember.Test.QUnitAdapter = testing.QUnitAdapter;\n    Ember.setupForTesting = testing.setupForTesting;\n  }\n\n  (0, _application.runLoadHooks)('Ember');\n  var _default = Ember;\n  _exports.default = _default;\n\n  if (_nodeModule.IS_NODE) {\n    _nodeModule.module.exports = Ember;\n  } else {\n    _environment.context.exports.Ember = _environment.context.exports.Em = Ember;\n  }\n  /**\n   @module jquery\n   @public\n   */\n\n  /**\n   @class jquery\n   @public\n   @static\n   */\n\n  /**\n    Alias for jQuery\n  \n    @for jquery\n    @method $\n    @static\n    @public\n  */\n\n});","define(\"ember/version\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  var _default = \"3.15.0\";\n  _exports.default = _default;\n});","define(\"node-module/index\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.require = _exports.module = _exports.IS_NODE = void 0;\n\n  /*global module */\n  var IS_NODE = typeof module === 'object' && typeof module.require === 'function';\n  _exports.IS_NODE = IS_NODE;\n  var exportModule;\n  _exports.module = exportModule;\n  var exportRequire;\n  _exports.require = exportRequire;\n\n  if (IS_NODE) {\n    _exports.module = exportModule = module;\n    _exports.require = exportRequire = module.require;\n  } else {\n    _exports.module = exportModule = null;\n    _exports.require = exportRequire = null;\n  }\n});","define(\"route-recognizer\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  var createObject = Object.create;\n\n  function createMap() {\n    var map = createObject(null);\n    map[\"__\"] = undefined;\n    delete map[\"__\"];\n    return map;\n  }\n\n  var Target = function Target(path, matcher, delegate) {\n    this.path = path;\n    this.matcher = matcher;\n    this.delegate = delegate;\n  };\n\n  Target.prototype.to = function to(target, callback) {\n    var delegate = this.delegate;\n\n    if (delegate && delegate.willAddRoute) {\n      target = delegate.willAddRoute(this.matcher.target, target);\n    }\n\n    this.matcher.add(this.path, target);\n\n    if (callback) {\n      if (callback.length === 0) {\n        throw new Error(\"You must have an argument in the function passed to `to`\");\n      }\n\n      this.matcher.addChild(this.path, target, callback, this.delegate);\n    }\n  };\n\n  var Matcher = function Matcher(target) {\n    this.routes = createMap();\n    this.children = createMap();\n    this.target = target;\n  };\n\n  Matcher.prototype.add = function add(path, target) {\n    this.routes[path] = target;\n  };\n\n  Matcher.prototype.addChild = function addChild(path, target, callback, delegate) {\n    var matcher = new Matcher(target);\n    this.children[path] = matcher;\n    var match = generateMatch(path, matcher, delegate);\n\n    if (delegate && delegate.contextEntered) {\n      delegate.contextEntered(target, match);\n    }\n\n    callback(match);\n  };\n\n  function generateMatch(startingPath, matcher, delegate) {\n    function match(path, callback) {\n      var fullPath = startingPath + path;\n\n      if (callback) {\n        callback(generateMatch(fullPath, matcher, delegate));\n      } else {\n        return new Target(fullPath, matcher, delegate);\n      }\n    }\n\n    return match;\n  }\n\n  function addRoute(routeArray, path, handler) {\n    var len = 0;\n\n    for (var i = 0; i < routeArray.length; i++) {\n      len += routeArray[i].path.length;\n    }\n\n    path = path.substr(len);\n    var route = {\n      path: path,\n      handler: handler\n    };\n    routeArray.push(route);\n  }\n\n  function eachRoute(baseRoute, matcher, callback, binding) {\n    var routes = matcher.routes;\n    var paths = Object.keys(routes);\n\n    for (var i = 0; i < paths.length; i++) {\n      var path = paths[i];\n      var routeArray = baseRoute.slice();\n      addRoute(routeArray, path, routes[path]);\n      var nested = matcher.children[path];\n\n      if (nested) {\n        eachRoute(routeArray, nested, callback, binding);\n      } else {\n        callback.call(binding, routeArray);\n      }\n    }\n  }\n\n  var map = function (callback, addRouteCallback) {\n    var matcher = new Matcher();\n    callback(generateMatch(\"\", matcher, this.delegate));\n    eachRoute([], matcher, function (routes) {\n      if (addRouteCallback) {\n        addRouteCallback(this, routes);\n      } else {\n        this.add(routes);\n      }\n    }, this);\n  }; // Normalizes percent-encoded values in `path` to upper-case and decodes percent-encoded\n  // values that are not reserved (i.e., unicode characters, emoji, etc). The reserved\n  // chars are \"/\" and \"%\".\n  // Safe to call multiple times on the same path.\n  // Normalizes percent-encoded values in `path` to upper-case and decodes percent-encoded\n\n\n  function normalizePath(path) {\n    return path.split(\"/\").map(normalizeSegment).join(\"/\");\n  } // We want to ensure the characters \"%\" and \"/\" remain in percent-encoded\n  // form when normalizing paths, so replace them with their encoded form after\n  // decoding the rest of the path\n\n\n  var SEGMENT_RESERVED_CHARS = /%|\\//g;\n\n  function normalizeSegment(segment) {\n    if (segment.length < 3 || segment.indexOf(\"%\") === -1) {\n      return segment;\n    }\n\n    return decodeURIComponent(segment).replace(SEGMENT_RESERVED_CHARS, encodeURIComponent);\n  } // We do not want to encode these characters when generating dynamic path segments\n  // See https://tools.ietf.org/html/rfc3986#section-3.3\n  // sub-delims: \"!\", \"$\", \"&\", \"'\", \"(\", \")\", \"*\", \"+\", \",\", \";\", \"=\"\n  // others allowed by RFC 3986: \":\", \"@\"\n  //\n  // First encode the entire path segment, then decode any of the encoded special chars.\n  //\n  // The chars \"!\", \"'\", \"(\", \")\", \"*\" do not get changed by `encodeURIComponent`,\n  // so the possible encoded chars are:\n  // ['%24', '%26', '%2B', '%2C', '%3B', '%3D', '%3A', '%40'].\n\n\n  var PATH_SEGMENT_ENCODINGS = /%(?:2(?:4|6|B|C)|3(?:B|D|A)|40)/g;\n\n  function encodePathSegment(str) {\n    return encodeURIComponent(str).replace(PATH_SEGMENT_ENCODINGS, decodeURIComponent);\n  }\n\n  var escapeRegex = /(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\)/g;\n  var isArray = Array.isArray;\n  var hasOwnProperty = Object.prototype.hasOwnProperty;\n\n  function getParam(params, key) {\n    if (typeof params !== \"object\" || params === null) {\n      throw new Error(\"You must pass an object as the second argument to `generate`.\");\n    }\n\n    if (!hasOwnProperty.call(params, key)) {\n      throw new Error(\"You must provide param `\" + key + \"` to `generate`.\");\n    }\n\n    var value = params[key];\n    var str = typeof value === \"string\" ? value : \"\" + value;\n\n    if (str.length === 0) {\n      throw new Error(\"You must provide a param `\" + key + \"`.\");\n    }\n\n    return str;\n  }\n\n  var eachChar = [];\n\n  eachChar[0\n  /* Static */\n  ] = function (segment, currentState) {\n    var state = currentState;\n    var value = segment.value;\n\n    for (var i = 0; i < value.length; i++) {\n      var ch = value.charCodeAt(i);\n      state = state.put(ch, false, false);\n    }\n\n    return state;\n  };\n\n  eachChar[1\n  /* Dynamic */\n  ] = function (_, currentState) {\n    return currentState.put(47\n    /* SLASH */\n    , true, true);\n  };\n\n  eachChar[2\n  /* Star */\n  ] = function (_, currentState) {\n    return currentState.put(-1\n    /* ANY */\n    , false, true);\n  };\n\n  eachChar[4\n  /* Epsilon */\n  ] = function (_, currentState) {\n    return currentState;\n  };\n\n  var regex = [];\n\n  regex[0\n  /* Static */\n  ] = function (segment) {\n    return segment.value.replace(escapeRegex, \"\\\\$1\");\n  };\n\n  regex[1\n  /* Dynamic */\n  ] = function () {\n    return \"([^/]+)\";\n  };\n\n  regex[2\n  /* Star */\n  ] = function () {\n    return \"(.+)\";\n  };\n\n  regex[4\n  /* Epsilon */\n  ] = function () {\n    return \"\";\n  };\n\n  var generate = [];\n\n  generate[0\n  /* Static */\n  ] = function (segment) {\n    return segment.value;\n  };\n\n  generate[1\n  /* Dynamic */\n  ] = function (segment, params) {\n    var value = getParam(params, segment.value);\n\n    if (RouteRecognizer.ENCODE_AND_DECODE_PATH_SEGMENTS) {\n      return encodePathSegment(value);\n    } else {\n      return value;\n    }\n  };\n\n  generate[2\n  /* Star */\n  ] = function (segment, params) {\n    return getParam(params, segment.value);\n  };\n\n  generate[4\n  /* Epsilon */\n  ] = function () {\n    return \"\";\n  };\n\n  var EmptyObject = Object.freeze({});\n  var EmptyArray = Object.freeze([]); // The `names` will be populated with the paramter name for each dynamic/star\n  // segment. `shouldDecodes` will be populated with a boolean for each dyanamic/star\n  // segment, indicating whether it should be decoded during recognition.\n\n  function parse(segments, route, types) {\n    // normalize route as not starting with a \"/\". Recognition will\n    // also normalize.\n    if (route.length > 0 && route.charCodeAt(0) === 47\n    /* SLASH */\n    ) {\n        route = route.substr(1);\n      }\n\n    var parts = route.split(\"/\");\n    var names = undefined;\n    var shouldDecodes = undefined;\n\n    for (var i = 0; i < parts.length; i++) {\n      var part = parts[i];\n      var flags = 0;\n      var type = 0;\n\n      if (part === \"\") {\n        type = 4\n        /* Epsilon */\n        ;\n      } else if (part.charCodeAt(0) === 58\n      /* COLON */\n      ) {\n          type = 1\n          /* Dynamic */\n          ;\n        } else if (part.charCodeAt(0) === 42\n      /* STAR */\n      ) {\n          type = 2\n          /* Star */\n          ;\n        } else {\n        type = 0\n        /* Static */\n        ;\n      }\n\n      flags = 2 << type;\n\n      if (flags & 12\n      /* Named */\n      ) {\n          part = part.slice(1);\n          names = names || [];\n          names.push(part);\n          shouldDecodes = shouldDecodes || [];\n          shouldDecodes.push((flags & 4\n          /* Decoded */\n          ) !== 0);\n        }\n\n      if (flags & 14\n      /* Counted */\n      ) {\n          types[type]++;\n        }\n\n      segments.push({\n        type: type,\n        value: normalizeSegment(part)\n      });\n    }\n\n    return {\n      names: names || EmptyArray,\n      shouldDecodes: shouldDecodes || EmptyArray\n    };\n  }\n\n  function isEqualCharSpec(spec, char, negate) {\n    return spec.char === char && spec.negate === negate;\n  } // A State has a character specification and (`charSpec`) and a list of possible\n  // subsequent states (`nextStates`).\n  //\n  // If a State is an accepting state, it will also have several additional\n  // properties:\n  //\n  // * `regex`: A regular expression that is used to extract parameters from paths\n  //   that reached this accepting state.\n  // * `handlers`: Information on how to convert the list of captures into calls\n  //   to registered handlers with the specified parameters\n  // * `types`: How many static, dynamic or star segments in this route. Used to\n  //   decide which route to use if multiple registered routes match a path.\n  //\n  // Currently, State is implemented naively by looping over `nextStates` and\n  // comparing a character specification against a character. A more efficient\n  // implementation would use a hash of keys pointing at one or more next states.\n\n\n  var State = function State(states, id, char, negate, repeat) {\n    this.states = states;\n    this.id = id;\n    this.char = char;\n    this.negate = negate;\n    this.nextStates = repeat ? id : null;\n    this.pattern = \"\";\n    this._regex = undefined;\n    this.handlers = undefined;\n    this.types = undefined;\n  };\n\n  State.prototype.regex = function regex$1() {\n    if (!this._regex) {\n      this._regex = new RegExp(this.pattern);\n    }\n\n    return this._regex;\n  };\n\n  State.prototype.get = function get(char, negate) {\n    var this$1 = this;\n    var nextStates = this.nextStates;\n\n    if (nextStates === null) {\n      return;\n    }\n\n    if (isArray(nextStates)) {\n      for (var i = 0; i < nextStates.length; i++) {\n        var child = this$1.states[nextStates[i]];\n\n        if (isEqualCharSpec(child, char, negate)) {\n          return child;\n        }\n      }\n    } else {\n      var child$1 = this.states[nextStates];\n\n      if (isEqualCharSpec(child$1, char, negate)) {\n        return child$1;\n      }\n    }\n  };\n\n  State.prototype.put = function put(char, negate, repeat) {\n    var state; // If the character specification already exists in a child of the current\n    // state, just return that state.\n\n    if (state = this.get(char, negate)) {\n      return state;\n    } // Make a new state for the character spec\n\n\n    var states = this.states;\n    state = new State(states, states.length, char, negate, repeat);\n    states[states.length] = state; // Insert the new state as a child of the current state\n\n    if (this.nextStates == null) {\n      this.nextStates = state.id;\n    } else if (isArray(this.nextStates)) {\n      this.nextStates.push(state.id);\n    } else {\n      this.nextStates = [this.nextStates, state.id];\n    } // Return the new state\n\n\n    return state;\n  }; // Find a list of child states matching the next character\n\n\n  State.prototype.match = function match(ch) {\n    var this$1 = this;\n    var nextStates = this.nextStates;\n\n    if (!nextStates) {\n      return [];\n    }\n\n    var returned = [];\n\n    if (isArray(nextStates)) {\n      for (var i = 0; i < nextStates.length; i++) {\n        var child = this$1.states[nextStates[i]];\n\n        if (isMatch(child, ch)) {\n          returned.push(child);\n        }\n      }\n    } else {\n      var child$1 = this.states[nextStates];\n\n      if (isMatch(child$1, ch)) {\n        returned.push(child$1);\n      }\n    }\n\n    return returned;\n  };\n\n  function isMatch(spec, char) {\n    return spec.negate ? spec.char !== char && spec.char !== -1\n    /* ANY */\n    : spec.char === char || spec.char === -1\n    /* ANY */\n    ;\n  } // This is a somewhat naive strategy, but should work in a lot of cases\n  // A better strategy would properly resolve /posts/:id/new and /posts/edit/:id.\n  //\n  // This strategy generally prefers more static and less dynamic matching.\n  // Specifically, it\n  //\n  //  * prefers fewer stars to more, then\n  //  * prefers using stars for less of the match to more, then\n  //  * prefers fewer dynamic segments to more, then\n  //  * prefers more static segments to more\n\n\n  function sortSolutions(states) {\n    return states.sort(function (a, b) {\n      var ref = a.types || [0, 0, 0];\n      var astatics = ref[0];\n      var adynamics = ref[1];\n      var astars = ref[2];\n      var ref$1 = b.types || [0, 0, 0];\n      var bstatics = ref$1[0];\n      var bdynamics = ref$1[1];\n      var bstars = ref$1[2];\n\n      if (astars !== bstars) {\n        return astars - bstars;\n      }\n\n      if (astars) {\n        if (astatics !== bstatics) {\n          return bstatics - astatics;\n        }\n\n        if (adynamics !== bdynamics) {\n          return bdynamics - adynamics;\n        }\n      }\n\n      if (adynamics !== bdynamics) {\n        return adynamics - bdynamics;\n      }\n\n      if (astatics !== bstatics) {\n        return bstatics - astatics;\n      }\n\n      return 0;\n    });\n  }\n\n  function recognizeChar(states, ch) {\n    var nextStates = [];\n\n    for (var i = 0, l = states.length; i < l; i++) {\n      var state = states[i];\n      nextStates = nextStates.concat(state.match(ch));\n    }\n\n    return nextStates;\n  }\n\n  var RecognizeResults = function RecognizeResults(queryParams) {\n    this.length = 0;\n    this.queryParams = queryParams || {};\n  };\n\n  RecognizeResults.prototype.splice = Array.prototype.splice;\n  RecognizeResults.prototype.slice = Array.prototype.slice;\n  RecognizeResults.prototype.push = Array.prototype.push;\n\n  function findHandler(state, originalPath, queryParams) {\n    var handlers = state.handlers;\n    var regex = state.regex();\n\n    if (!regex || !handlers) {\n      throw new Error(\"state not initialized\");\n    }\n\n    var captures = originalPath.match(regex);\n    var currentCapture = 1;\n    var result = new RecognizeResults(queryParams);\n    result.length = handlers.length;\n\n    for (var i = 0; i < handlers.length; i++) {\n      var handler = handlers[i];\n      var names = handler.names;\n      var shouldDecodes = handler.shouldDecodes;\n      var params = EmptyObject;\n      var isDynamic = false;\n\n      if (names !== EmptyArray && shouldDecodes !== EmptyArray) {\n        for (var j = 0; j < names.length; j++) {\n          isDynamic = true;\n          var name = names[j];\n          var capture = captures && captures[currentCapture++];\n\n          if (params === EmptyObject) {\n            params = {};\n          }\n\n          if (RouteRecognizer.ENCODE_AND_DECODE_PATH_SEGMENTS && shouldDecodes[j]) {\n            params[name] = capture && decodeURIComponent(capture);\n          } else {\n            params[name] = capture;\n          }\n        }\n      }\n\n      result[i] = {\n        handler: handler.handler,\n        params: params,\n        isDynamic: isDynamic\n      };\n    }\n\n    return result;\n  }\n\n  function decodeQueryParamPart(part) {\n    // http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1\n    part = part.replace(/\\+/gm, \"%20\");\n    var result;\n\n    try {\n      result = decodeURIComponent(part);\n    } catch (error) {\n      result = \"\";\n    }\n\n    return result;\n  }\n\n  var RouteRecognizer = function RouteRecognizer() {\n    this.names = createMap();\n    var states = [];\n    var state = new State(states, 0, -1\n    /* ANY */\n    , true, false);\n    states[0] = state;\n    this.states = states;\n    this.rootState = state;\n  };\n\n  RouteRecognizer.prototype.add = function add(routes, options) {\n    var currentState = this.rootState;\n    var pattern = \"^\";\n    var types = [0, 0, 0];\n    var handlers = new Array(routes.length);\n    var allSegments = [];\n    var isEmpty = true;\n    var j = 0;\n\n    for (var i = 0; i < routes.length; i++) {\n      var route = routes[i];\n      var ref = parse(allSegments, route.path, types);\n      var names = ref.names;\n      var shouldDecodes = ref.shouldDecodes; // preserve j so it points to the start of newly added segments\n\n      for (; j < allSegments.length; j++) {\n        var segment = allSegments[j];\n\n        if (segment.type === 4\n        /* Epsilon */\n        ) {\n            continue;\n          }\n\n        isEmpty = false; // Add a \"/\" for the new segment\n\n        currentState = currentState.put(47\n        /* SLASH */\n        , false, false);\n        pattern += \"/\"; // Add a representation of the segment to the NFA and regex\n\n        currentState = eachChar[segment.type](segment, currentState);\n        pattern += regex[segment.type](segment);\n      }\n\n      handlers[i] = {\n        handler: route.handler,\n        names: names,\n        shouldDecodes: shouldDecodes\n      };\n    }\n\n    if (isEmpty) {\n      currentState = currentState.put(47\n      /* SLASH */\n      , false, false);\n      pattern += \"/\";\n    }\n\n    currentState.handlers = handlers;\n    currentState.pattern = pattern + \"$\";\n    currentState.types = types;\n    var name;\n\n    if (typeof options === \"object\" && options !== null && options.as) {\n      name = options.as;\n    }\n\n    if (name) {\n      // if (this.names[name]) {\n      //   throw new Error(\"You may not add a duplicate route named `\" + name + \"`.\");\n      // }\n      this.names[name] = {\n        segments: allSegments,\n        handlers: handlers\n      };\n    }\n  };\n\n  RouteRecognizer.prototype.handlersFor = function handlersFor(name) {\n    var route = this.names[name];\n\n    if (!route) {\n      throw new Error(\"There is no route named \" + name);\n    }\n\n    var result = new Array(route.handlers.length);\n\n    for (var i = 0; i < route.handlers.length; i++) {\n      var handler = route.handlers[i];\n      result[i] = handler;\n    }\n\n    return result;\n  };\n\n  RouteRecognizer.prototype.hasRoute = function hasRoute(name) {\n    return !!this.names[name];\n  };\n\n  RouteRecognizer.prototype.generate = function generate$1(name, params) {\n    var route = this.names[name];\n    var output = \"\";\n\n    if (!route) {\n      throw new Error(\"There is no route named \" + name);\n    }\n\n    var segments = route.segments;\n\n    for (var i = 0; i < segments.length; i++) {\n      var segment = segments[i];\n\n      if (segment.type === 4\n      /* Epsilon */\n      ) {\n          continue;\n        }\n\n      output += \"/\";\n      output += generate[segment.type](segment, params);\n    }\n\n    if (output.charAt(0) !== \"/\") {\n      output = \"/\" + output;\n    }\n\n    if (params && params.queryParams) {\n      output += this.generateQueryString(params.queryParams);\n    }\n\n    return output;\n  };\n\n  RouteRecognizer.prototype.generateQueryString = function generateQueryString(params) {\n    var pairs = [];\n    var keys = Object.keys(params);\n    keys.sort();\n\n    for (var i = 0; i < keys.length; i++) {\n      var key = keys[i];\n      var value = params[key];\n\n      if (value == null) {\n        continue;\n      }\n\n      var pair = encodeURIComponent(key);\n\n      if (isArray(value)) {\n        for (var j = 0; j < value.length; j++) {\n          var arrayPair = key + \"[]\" + \"=\" + encodeURIComponent(value[j]);\n          pairs.push(arrayPair);\n        }\n      } else {\n        pair += \"=\" + encodeURIComponent(value);\n        pairs.push(pair);\n      }\n    }\n\n    if (pairs.length === 0) {\n      return \"\";\n    }\n\n    return \"?\" + pairs.join(\"&\");\n  };\n\n  RouteRecognizer.prototype.parseQueryString = function parseQueryString(queryString) {\n    var pairs = queryString.split(\"&\");\n    var queryParams = {};\n\n    for (var i = 0; i < pairs.length; i++) {\n      var pair = pairs[i].split(\"=\"),\n          key = decodeQueryParamPart(pair[0]),\n          keyLength = key.length,\n          isArray = false,\n          value = void 0;\n\n      if (pair.length === 1) {\n        value = \"true\";\n      } else {\n        // Handle arrays\n        if (keyLength > 2 && key.slice(keyLength - 2) === \"[]\") {\n          isArray = true;\n          key = key.slice(0, keyLength - 2);\n\n          if (!queryParams[key]) {\n            queryParams[key] = [];\n          }\n        }\n\n        value = pair[1] ? decodeQueryParamPart(pair[1]) : \"\";\n      }\n\n      if (isArray) {\n        queryParams[key].push(value);\n      } else {\n        queryParams[key] = value;\n      }\n    }\n\n    return queryParams;\n  };\n\n  RouteRecognizer.prototype.recognize = function recognize(path) {\n    var results;\n    var states = [this.rootState];\n    var queryParams = {};\n    var isSlashDropped = false;\n    var hashStart = path.indexOf(\"#\");\n\n    if (hashStart !== -1) {\n      path = path.substr(0, hashStart);\n    }\n\n    var queryStart = path.indexOf(\"?\");\n\n    if (queryStart !== -1) {\n      var queryString = path.substr(queryStart + 1, path.length);\n      path = path.substr(0, queryStart);\n      queryParams = this.parseQueryString(queryString);\n    }\n\n    if (path.charAt(0) !== \"/\") {\n      path = \"/\" + path;\n    }\n\n    var originalPath = path;\n\n    if (RouteRecognizer.ENCODE_AND_DECODE_PATH_SEGMENTS) {\n      path = normalizePath(path);\n    } else {\n      path = decodeURI(path);\n      originalPath = decodeURI(originalPath);\n    }\n\n    var pathLen = path.length;\n\n    if (pathLen > 1 && path.charAt(pathLen - 1) === \"/\") {\n      path = path.substr(0, pathLen - 1);\n      originalPath = originalPath.substr(0, originalPath.length - 1);\n      isSlashDropped = true;\n    }\n\n    for (var i = 0; i < path.length; i++) {\n      states = recognizeChar(states, path.charCodeAt(i));\n\n      if (!states.length) {\n        break;\n      }\n    }\n\n    var solutions = [];\n\n    for (var i$1 = 0; i$1 < states.length; i$1++) {\n      if (states[i$1].handlers) {\n        solutions.push(states[i$1]);\n      }\n    }\n\n    states = sortSolutions(solutions);\n    var state = solutions[0];\n\n    if (state && state.handlers) {\n      // if a trailing slash was dropped and a star segment is the last segment\n      // specified, put the trailing slash back\n      if (isSlashDropped && state.pattern && state.pattern.slice(-5) === \"(.+)$\") {\n        originalPath = originalPath + \"/\";\n      }\n\n      results = findHandler(state, originalPath, queryParams);\n    }\n\n    return results;\n  };\n\n  RouteRecognizer.VERSION = \"0.3.4\"; // Set to false to opt-out of encoding and decoding path segments.\n  // See https://github.com/tildeio/route-recognizer/pull/55\n\n  RouteRecognizer.ENCODE_AND_DECODE_PATH_SEGMENTS = true;\n  RouteRecognizer.Normalizer = {\n    normalizeSegment: normalizeSegment,\n    normalizePath: normalizePath,\n    encodePathSegment: encodePathSegment\n  };\n  RouteRecognizer.prototype.map = map;\n  var _default = RouteRecognizer;\n  _exports.default = _default;\n});","define(\"router_js\", [\"exports\", \"@ember/polyfills\", \"rsvp\", \"route-recognizer\"], function (_exports, _polyfills, _rsvp, _routeRecognizer) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.logAbort = logAbort;\n  _exports.InternalRouteInfo = _exports.TransitionError = _exports.TransitionState = _exports.QUERY_PARAMS_SYMBOL = _exports.PARAMS_SYMBOL = _exports.STATE_SYMBOL = _exports.InternalTransition = _exports.default = void 0;\n\n  var TransitionAbortedError = function () {\n    TransitionAbortedError.prototype = Object.create(Error.prototype);\n    TransitionAbortedError.prototype.constructor = TransitionAbortedError;\n\n    function TransitionAbortedError(message) {\n      var error = Error.call(this, message);\n      this.name = 'TransitionAborted';\n      this.message = message || 'TransitionAborted';\n\n      if (Error.captureStackTrace) {\n        Error.captureStackTrace(this, TransitionAbortedError);\n      } else {\n        this.stack = error.stack;\n      }\n    }\n\n    return TransitionAbortedError;\n  }();\n\n  var slice = Array.prototype.slice;\n  var hasOwnProperty = Object.prototype.hasOwnProperty;\n  /**\n    Determines if an object is Promise by checking if it is \"thenable\".\n  **/\n\n  function isPromise(p) {\n    return p !== null && typeof p === 'object' && typeof p.then === 'function';\n  }\n\n  function merge(hash, other) {\n    for (var prop in other) {\n      if (hasOwnProperty.call(other, prop)) {\n        hash[prop] = other[prop];\n      }\n    }\n  }\n  /**\n    @private\n  \n    Extracts query params from the end of an array\n  **/\n\n\n  function extractQueryParams(array) {\n    var len = array && array.length,\n        head,\n        queryParams;\n\n    if (len && len > 0) {\n      var obj = array[len - 1];\n\n      if (isQueryParams(obj)) {\n        queryParams = obj.queryParams;\n        head = slice.call(array, 0, len - 1);\n        return [head, queryParams];\n      }\n    }\n\n    return [array, null];\n  }\n\n  function isQueryParams(obj) {\n    return obj && hasOwnProperty.call(obj, 'queryParams');\n  }\n  /**\n    @private\n  \n    Coerces query param properties and array elements into strings.\n  **/\n\n\n  function coerceQueryParamsToString(queryParams) {\n    for (var key in queryParams) {\n      var val = queryParams[key];\n\n      if (typeof val === 'number') {\n        queryParams[key] = '' + val;\n      } else if (Array.isArray(val)) {\n        for (var i = 0, l = val.length; i < l; i++) {\n          val[i] = '' + val[i];\n        }\n      }\n    }\n  }\n  /**\n    @private\n   */\n\n\n  function log(router, ...args) {\n    if (!router.log) {\n      return;\n    }\n\n    if (args.length === 2) {\n      var [sequence, msg] = args;\n      router.log('Transition #' + sequence + ': ' + msg);\n    } else {\n      var [_msg] = args;\n      router.log(_msg);\n    }\n  }\n\n  function isParam(object) {\n    return typeof object === 'string' || object instanceof String || typeof object === 'number' || object instanceof Number;\n  }\n\n  function forEach(array, callback) {\n    for (var i = 0, l = array.length; i < l && callback(array[i]) !== false; i++) {// empty intentionally\n    }\n  }\n\n  function getChangelist(oldObject, newObject) {\n    var key;\n    var results = {\n      all: {},\n      changed: {},\n      removed: {}\n    };\n    merge(results.all, newObject);\n    var didChange = false;\n    coerceQueryParamsToString(oldObject);\n    coerceQueryParamsToString(newObject); // Calculate removals\n\n    for (key in oldObject) {\n      if (hasOwnProperty.call(oldObject, key)) {\n        if (!hasOwnProperty.call(newObject, key)) {\n          didChange = true;\n          results.removed[key] = oldObject[key];\n        }\n      }\n    } // Calculate changes\n\n\n    for (key in newObject) {\n      if (hasOwnProperty.call(newObject, key)) {\n        var oldElement = oldObject[key];\n        var newElement = newObject[key];\n\n        if (isArray(oldElement) && isArray(newElement)) {\n          if (oldElement.length !== newElement.length) {\n            results.changed[key] = newObject[key];\n            didChange = true;\n          } else {\n            for (var i = 0, l = oldElement.length; i < l; i++) {\n              if (oldElement[i] !== newElement[i]) {\n                results.changed[key] = newObject[key];\n                didChange = true;\n              }\n            }\n          }\n        } else if (oldObject[key] !== newObject[key]) {\n          results.changed[key] = newObject[key];\n          didChange = true;\n        }\n      }\n    }\n\n    return didChange ? results : undefined;\n  }\n\n  function isArray(obj) {\n    return Array.isArray(obj);\n  }\n\n  function promiseLabel(label) {\n    return 'Router: ' + label;\n  }\n\n  var STATE_SYMBOL = \"__STATE__-2619860001345920-3322w3\";\n  _exports.STATE_SYMBOL = STATE_SYMBOL;\n  var PARAMS_SYMBOL = \"__PARAMS__-261986232992830203-23323\";\n  _exports.PARAMS_SYMBOL = PARAMS_SYMBOL;\n  var QUERY_PARAMS_SYMBOL = \"__QPS__-2619863929824844-32323\";\n  /**\n    A Transition is a thennable (a promise-like object) that represents\n    an attempt to transition to another route. It can be aborted, either\n    explicitly via `abort` or by attempting another transition while a\n    previous one is still underway. An aborted transition can also\n    be `retry()`d later.\n  \n    @class Transition\n    @constructor\n    @param {Object} router\n    @param {Object} intent\n    @param {Object} state\n    @param {Object} error\n    @private\n   */\n\n  _exports.QUERY_PARAMS_SYMBOL = QUERY_PARAMS_SYMBOL;\n\n  class Transition {\n    constructor(router, intent, state, error = undefined, previousTransition = undefined) {\n      this.from = null;\n      this.to = undefined;\n      this.isAborted = false;\n      this.isActive = true;\n      this.urlMethod = 'update';\n      this.resolveIndex = 0;\n      this.queryParamsOnly = false;\n      this.isTransition = true;\n      this.isCausedByAbortingTransition = false;\n      this.isCausedByInitialTransition = false;\n      this.isCausedByAbortingReplaceTransition = false;\n      this._visibleQueryParams = {};\n      this[STATE_SYMBOL] = state || router.state;\n      this.intent = intent;\n      this.router = router;\n      this.data = intent && intent.data || {};\n      this.resolvedModels = {};\n      this[QUERY_PARAMS_SYMBOL] = {};\n      this.promise = undefined;\n      this.error = undefined;\n      this[PARAMS_SYMBOL] = {};\n      this.routeInfos = [];\n      this.targetName = undefined;\n      this.pivotHandler = undefined;\n      this.sequence = -1;\n\n      if (error) {\n        this.promise = _rsvp.Promise.reject(error);\n        this.error = error;\n        return;\n      } // if you're doing multiple redirects, need the new transition to know if it\n      // is actually part of the first transition or not. Any further redirects\n      // in the initial transition also need to know if they are part of the\n      // initial transition\n\n\n      this.isCausedByAbortingTransition = !!previousTransition;\n      this.isCausedByInitialTransition = !!previousTransition && (previousTransition.isCausedByInitialTransition || previousTransition.sequence === 0); // Every transition in the chain is a replace\n\n      this.isCausedByAbortingReplaceTransition = !!previousTransition && previousTransition.urlMethod === 'replace' && (!previousTransition.isCausedByAbortingTransition || previousTransition.isCausedByAbortingReplaceTransition);\n\n      if (state) {\n        this[PARAMS_SYMBOL] = state.params;\n        this[QUERY_PARAMS_SYMBOL] = state.queryParams;\n        this.routeInfos = state.routeInfos;\n        var len = state.routeInfos.length;\n\n        if (len) {\n          this.targetName = state.routeInfos[len - 1].name;\n        }\n\n        for (var i = 0; i < len; ++i) {\n          var handlerInfo = state.routeInfos[i]; // TODO: this all seems hacky\n\n          if (!handlerInfo.isResolved) {\n            break;\n          }\n\n          this.pivotHandler = handlerInfo.route;\n        }\n\n        this.sequence = router.currentSequence++;\n        this.promise = state.resolve(() => {\n          if (this.isAborted) {\n            return _rsvp.Promise.reject(false, promiseLabel('Transition aborted - reject'));\n          }\n\n          return _rsvp.Promise.resolve(true);\n        }, this).catch(result => {\n          return _rsvp.Promise.reject(this.router.transitionDidError(result, this));\n        }, promiseLabel('Handle Abort'));\n      } else {\n        this.promise = _rsvp.Promise.resolve(this[STATE_SYMBOL]);\n        this[PARAMS_SYMBOL] = {};\n      }\n    }\n    /**\n      The Transition's internal promise. Calling `.then` on this property\n      is that same as calling `.then` on the Transition object itself, but\n      this property is exposed for when you want to pass around a\n      Transition's promise, but not the Transition object itself, since\n      Transition object can be externally `abort`ed, while the promise\n      cannot.\n         @property promise\n      @type {Object}\n      @public\n     */\n\n    /**\n      Custom state can be stored on a Transition's `data` object.\n      This can be useful for decorating a Transition within an earlier\n      hook and shared with a later hook. Properties set on `data` will\n      be copied to new transitions generated by calling `retry` on this\n      transition.\n         @property data\n      @type {Object}\n      @public\n     */\n\n    /**\n      A standard promise hook that resolves if the transition\n      succeeds and rejects if it fails/redirects/aborts.\n         Forwards to the internal `promise` property which you can\n      use in situations where you want to pass around a thennable,\n      but not the Transition itself.\n         @method then\n      @param {Function} onFulfilled\n      @param {Function} onRejected\n      @param {String} label optional string for labeling the promise.\n      Useful for tooling.\n      @return {Promise}\n      @public\n     */\n\n\n    then(onFulfilled, onRejected, label) {\n      return this.promise.then(onFulfilled, onRejected, label);\n    }\n    /**\n         Forwards to the internal `promise` property which you can\n      use in situations where you want to pass around a thennable,\n      but not the Transition itself.\n         @method catch\n      @param {Function} onRejection\n      @param {String} label optional string for labeling the promise.\n      Useful for tooling.\n      @return {Promise}\n      @public\n     */\n\n\n    catch(onRejection, label) {\n      return this.promise.catch(onRejection, label);\n    }\n    /**\n         Forwards to the internal `promise` property which you can\n      use in situations where you want to pass around a thennable,\n      but not the Transition itself.\n         @method finally\n      @param {Function} callback\n      @param {String} label optional string for labeling the promise.\n      Useful for tooling.\n      @return {Promise}\n      @public\n     */\n\n\n    finally(callback, label) {\n      return this.promise.finally(callback, label);\n    }\n    /**\n      Aborts the Transition. Note you can also implicitly abort a transition\n      by initiating another transition while a previous one is underway.\n         @method abort\n      @return {Transition} this transition\n      @public\n     */\n\n\n    abort() {\n      this.rollback();\n      var transition = new Transition(this.router, undefined, undefined, undefined);\n      transition.to = this.from;\n      transition.from = this.from;\n      transition.isAborted = true;\n      this.router.routeWillChange(transition);\n      this.router.routeDidChange(transition);\n      return this;\n    }\n\n    rollback() {\n      if (!this.isAborted) {\n        log(this.router, this.sequence, this.targetName + ': transition was aborted');\n\n        if (this.intent !== undefined && this.intent !== null) {\n          this.intent.preTransitionState = this.router.state;\n        }\n\n        this.isAborted = true;\n        this.isActive = false;\n        this.router.activeTransition = undefined;\n      }\n    }\n\n    redirect(newTransition) {\n      this.rollback();\n      this.router.routeWillChange(newTransition);\n    }\n    /**\n         Retries a previously-aborted transition (making sure to abort the\n      transition if it's still active). Returns a new transition that\n      represents the new attempt to transition.\n         @method retry\n      @return {Transition} new transition\n      @public\n     */\n\n\n    retry() {\n      // TODO: add tests for merged state retry()s\n      this.abort();\n      var newTransition = this.router.transitionByIntent(this.intent, false); // inheriting a `null` urlMethod is not valid\n      // the urlMethod is only set to `null` when\n      // the transition is initiated *after* the url\n      // has been updated (i.e. `router.handleURL`)\n      //\n      // in that scenario, the url method cannot be\n      // inherited for a new transition because then\n      // the url would not update even though it should\n\n      if (this.urlMethod !== null) {\n        newTransition.method(this.urlMethod);\n      }\n\n      return newTransition;\n    }\n    /**\n         Sets the URL-changing method to be employed at the end of a\n      successful transition. By default, a new Transition will just\n      use `updateURL`, but passing 'replace' to this method will\n      cause the URL to update using 'replaceWith' instead. Omitting\n      a parameter will disable the URL change, allowing for transitions\n      that don't update the URL at completion (this is also used for\n      handleURL, since the URL has already changed before the\n      transition took place).\n         @method method\n      @param {String} method the type of URL-changing method to use\n        at the end of a transition. Accepted values are 'replace',\n        falsy values, or any other non-falsy value (which is\n        interpreted as an updateURL transition).\n         @return {Transition} this transition\n      @public\n     */\n\n\n    method(method) {\n      this.urlMethod = method;\n      return this;\n    } // Alias 'trigger' as 'send'\n\n\n    send(ignoreFailure = false, _name, err, transition, handler) {\n      this.trigger(ignoreFailure, _name, err, transition, handler);\n    }\n    /**\n         Fires an event on the current list of resolved/resolving\n      handlers within this transition. Useful for firing events\n      on route hierarchies that haven't fully been entered yet.\n         Note: This method is also aliased as `send`\n         @method trigger\n      @param {Boolean} [ignoreFailure=false] a boolean specifying whether unhandled events throw an error\n      @param {String} name the name of the event to fire\n      @public\n     */\n\n\n    trigger(ignoreFailure = false, name, ...args) {\n      // TODO: Deprecate the current signature\n      if (typeof ignoreFailure === 'string') {\n        name = ignoreFailure;\n        ignoreFailure = false;\n      }\n\n      this.router.triggerEvent(this[STATE_SYMBOL].routeInfos.slice(0, this.resolveIndex + 1), ignoreFailure, name, args);\n    }\n    /**\n      Transitions are aborted and their promises rejected\n      when redirects occur; this method returns a promise\n      that will follow any redirects that occur and fulfill\n      with the value fulfilled by any redirecting transitions\n      that occur.\n         @method followRedirects\n      @return {Promise} a promise that fulfills with the same\n        value that the final redirecting transition fulfills with\n      @public\n     */\n\n\n    followRedirects() {\n      var router = this.router;\n      return this.promise.catch(function (reason) {\n        if (router.activeTransition) {\n          return router.activeTransition.followRedirects();\n        }\n\n        return _rsvp.Promise.reject(reason);\n      });\n    }\n\n    toString() {\n      return 'Transition (sequence ' + this.sequence + ')';\n    }\n    /**\n      @private\n     */\n\n\n    log(message) {\n      log(this.router, this.sequence, message);\n    }\n\n  }\n  /**\n    @private\n  \n    Logs and returns an instance of TransitionAborted.\n   */\n\n\n  _exports.InternalTransition = Transition;\n\n  function logAbort(transition) {\n    log(transition.router, transition.sequence, 'detected abort.');\n    return new TransitionAbortedError();\n  }\n\n  function isTransition(obj) {\n    return typeof obj === 'object' && obj instanceof Transition && obj.isTransition;\n  }\n\n  function prepareResult(obj) {\n    if (isTransition(obj)) {\n      return null;\n    }\n\n    return obj;\n  }\n\n  var ROUTE_INFOS = new WeakMap();\n\n  function toReadOnlyRouteInfo(routeInfos, queryParams = {}, includeAttributes = false) {\n    return routeInfos.map((info, i) => {\n      var {\n        name,\n        params,\n        paramNames,\n        context,\n        route\n      } = info;\n\n      if (ROUTE_INFOS.has(info) && includeAttributes) {\n        var _routeInfo = ROUTE_INFOS.get(info);\n\n        _routeInfo = attachMetadata(route, _routeInfo);\n        var routeInfoWithAttribute = createRouteInfoWithAttributes(_routeInfo, context);\n        ROUTE_INFOS.set(info, routeInfoWithAttribute);\n        return routeInfoWithAttribute;\n      }\n\n      var routeInfo = {\n        find(predicate, thisArg) {\n          var publicInfo;\n          var arr = [];\n\n          if (predicate.length === 3) {\n            arr = routeInfos.map(info => ROUTE_INFOS.get(info));\n          }\n\n          for (var _i = 0; routeInfos.length > _i; _i++) {\n            publicInfo = ROUTE_INFOS.get(routeInfos[_i]);\n\n            if (predicate.call(thisArg, publicInfo, _i, arr)) {\n              return publicInfo;\n            }\n          }\n\n          return undefined;\n        },\n\n        get name() {\n          return name;\n        },\n\n        get paramNames() {\n          return paramNames;\n        },\n\n        get metadata() {\n          return buildRouteInfoMetadata(info.route);\n        },\n\n        get parent() {\n          var parent = routeInfos[i - 1];\n\n          if (parent === undefined) {\n            return null;\n          }\n\n          return ROUTE_INFOS.get(parent);\n        },\n\n        get child() {\n          var child = routeInfos[i + 1];\n\n          if (child === undefined) {\n            return null;\n          }\n\n          return ROUTE_INFOS.get(child);\n        },\n\n        get localName() {\n          var parts = this.name.split('.');\n          return parts[parts.length - 1];\n        },\n\n        get params() {\n          return params;\n        },\n\n        get queryParams() {\n          return queryParams;\n        }\n\n      };\n\n      if (includeAttributes) {\n        routeInfo = createRouteInfoWithAttributes(routeInfo, context);\n      }\n\n      ROUTE_INFOS.set(info, routeInfo);\n      return routeInfo;\n    });\n  }\n\n  function createRouteInfoWithAttributes(routeInfo, context) {\n    var attributes = {\n      get attributes() {\n        return context;\n      }\n\n    };\n\n    if (Object.isFrozen(routeInfo) || routeInfo.hasOwnProperty('attributes')) {\n      return Object.freeze((0, _polyfills.assign)({}, routeInfo, attributes));\n    }\n\n    return (0, _polyfills.assign)(routeInfo, attributes);\n  }\n\n  function buildRouteInfoMetadata(route) {\n    if (route !== undefined && route !== null && route.buildRouteInfoMetadata !== undefined) {\n      return route.buildRouteInfoMetadata();\n    }\n\n    return null;\n  }\n\n  function attachMetadata(route, routeInfo) {\n    var metadata = {\n      get metadata() {\n        return buildRouteInfoMetadata(route);\n      }\n\n    };\n\n    if (Object.isFrozen(routeInfo) || routeInfo.hasOwnProperty('metadata')) {\n      return Object.freeze((0, _polyfills.assign)({}, routeInfo, metadata));\n    }\n\n    return (0, _polyfills.assign)(routeInfo, metadata);\n  }\n\n  class InternalRouteInfo {\n    constructor(router, name, paramNames, route) {\n      this._routePromise = undefined;\n      this._route = null;\n      this.params = {};\n      this.isResolved = false;\n      this.name = name;\n      this.paramNames = paramNames;\n      this.router = router;\n\n      if (route) {\n        this._processRoute(route);\n      }\n    }\n\n    getModel(_transition) {\n      return _rsvp.Promise.resolve(this.context);\n    }\n\n    serialize(_context) {\n      return this.params || {};\n    }\n\n    resolve(shouldContinue, transition) {\n      return _rsvp.Promise.resolve(this.routePromise).then(route => this.checkForAbort(shouldContinue, route)).then(() => this.runBeforeModelHook(transition)).then(() => this.checkForAbort(shouldContinue, null)).then(() => this.getModel(transition)).then(resolvedModel => this.checkForAbort(shouldContinue, resolvedModel)).then(resolvedModel => this.runAfterModelHook(transition, resolvedModel)).then(resolvedModel => this.becomeResolved(transition, resolvedModel));\n    }\n\n    becomeResolved(transition, resolvedContext) {\n      var params = this.serialize(resolvedContext);\n\n      if (transition) {\n        this.stashResolvedModel(transition, resolvedContext);\n        transition[PARAMS_SYMBOL] = transition[PARAMS_SYMBOL] || {};\n        transition[PARAMS_SYMBOL][this.name] = params;\n      }\n\n      var context;\n      var contextsMatch = resolvedContext === this.context;\n\n      if ('context' in this || !contextsMatch) {\n        context = resolvedContext;\n      }\n\n      var cached = ROUTE_INFOS.get(this);\n      var resolved = new ResolvedRouteInfo(this.router, this.name, this.paramNames, params, this.route, context);\n\n      if (cached !== undefined) {\n        ROUTE_INFOS.set(resolved, cached);\n      }\n\n      return resolved;\n    }\n\n    shouldSupercede(routeInfo) {\n      // Prefer this newer routeInfo over `other` if:\n      // 1) The other one doesn't exist\n      // 2) The names don't match\n      // 3) This route has a context that doesn't match\n      //    the other one (or the other one doesn't have one).\n      // 4) This route has parameters that don't match the other.\n      if (!routeInfo) {\n        return true;\n      }\n\n      var contextsMatch = routeInfo.context === this.context;\n      return routeInfo.name !== this.name || 'context' in this && !contextsMatch || this.hasOwnProperty('params') && !paramsMatch(this.params, routeInfo.params);\n    }\n\n    get route() {\n      // _route could be set to either a route object or undefined, so we\n      // compare against null to know when it's been set\n      if (this._route !== null) {\n        return this._route;\n      }\n\n      return this.fetchRoute();\n    }\n\n    set route(route) {\n      this._route = route;\n    }\n\n    get routePromise() {\n      if (this._routePromise) {\n        return this._routePromise;\n      }\n\n      this.fetchRoute();\n      return this._routePromise;\n    }\n\n    set routePromise(routePromise) {\n      this._routePromise = routePromise;\n    }\n\n    log(transition, message) {\n      if (transition.log) {\n        transition.log(this.name + ': ' + message);\n      }\n    }\n\n    updateRoute(route) {\n      route._internalName = this.name;\n      return this.route = route;\n    }\n\n    runBeforeModelHook(transition) {\n      if (transition.trigger) {\n        transition.trigger(true, 'willResolveModel', transition, this.route);\n      }\n\n      var result;\n\n      if (this.route) {\n        if (this.route.beforeModel !== undefined) {\n          result = this.route.beforeModel(transition);\n        }\n      }\n\n      if (isTransition(result)) {\n        result = null;\n      }\n\n      return _rsvp.Promise.resolve(result);\n    }\n\n    runAfterModelHook(transition, resolvedModel) {\n      // Stash the resolved model on the payload.\n      // This makes it possible for users to swap out\n      // the resolved model in afterModel.\n      var name = this.name;\n      this.stashResolvedModel(transition, resolvedModel);\n      var result;\n\n      if (this.route !== undefined) {\n        if (this.route.afterModel !== undefined) {\n          result = this.route.afterModel(resolvedModel, transition);\n        }\n      }\n\n      result = prepareResult(result);\n      return _rsvp.Promise.resolve(result).then(() => {\n        // Ignore the fulfilled value returned from afterModel.\n        // Return the value stashed in resolvedModels, which\n        // might have been swapped out in afterModel.\n        return transition.resolvedModels[name];\n      });\n    }\n\n    checkForAbort(shouldContinue, value) {\n      return _rsvp.Promise.resolve(shouldContinue()).then(function () {\n        // We don't care about shouldContinue's resolve value;\n        // pass along the original value passed to this fn.\n        return value;\n      }, null);\n    }\n\n    stashResolvedModel(transition, resolvedModel) {\n      transition.resolvedModels = transition.resolvedModels || {};\n      transition.resolvedModels[this.name] = resolvedModel;\n    }\n\n    fetchRoute() {\n      var route = this.router.getRoute(this.name);\n      return this._processRoute(route);\n    }\n\n    _processRoute(route) {\n      // Setup a routePromise so that we can wait for asynchronously loaded routes\n      this.routePromise = _rsvp.Promise.resolve(route); // Wait until the 'route' property has been updated when chaining to a route\n      // that is a promise\n\n      if (isPromise(route)) {\n        this.routePromise = this.routePromise.then(r => {\n          return this.updateRoute(r);\n        }); // set to undefined to avoid recursive loop in the route getter\n\n        return this.route = undefined;\n      } else if (route) {\n        return this.updateRoute(route);\n      }\n\n      return undefined;\n    }\n\n  }\n\n  _exports.InternalRouteInfo = InternalRouteInfo;\n\n  class ResolvedRouteInfo extends InternalRouteInfo {\n    constructor(router, name, paramNames, params, route, context) {\n      super(router, name, paramNames, route);\n      this.params = params;\n      this.isResolved = true;\n      this.context = context;\n    }\n\n    resolve(_shouldContinue, transition) {\n      // A ResolvedRouteInfo just resolved with itself.\n      if (transition && transition.resolvedModels) {\n        transition.resolvedModels[this.name] = this.context;\n      }\n\n      return _rsvp.Promise.resolve(this);\n    }\n\n  }\n\n  class UnresolvedRouteInfoByParam extends InternalRouteInfo {\n    constructor(router, name, paramNames, params, route) {\n      super(router, name, paramNames, route);\n      this.params = {};\n      this.params = params;\n    }\n\n    getModel(transition) {\n      var fullParams = this.params;\n\n      if (transition && transition[QUERY_PARAMS_SYMBOL]) {\n        fullParams = {};\n        merge(fullParams, this.params);\n        fullParams.queryParams = transition[QUERY_PARAMS_SYMBOL];\n      }\n\n      var route = this.route;\n      var result = undefined;\n\n      if (route.deserialize) {\n        result = route.deserialize(fullParams, transition);\n      } else if (route.model) {\n        result = route.model(fullParams, transition);\n      }\n\n      if (result && isTransition(result)) {\n        result = undefined;\n      }\n\n      return _rsvp.Promise.resolve(result);\n    }\n\n  }\n\n  class UnresolvedRouteInfoByObject extends InternalRouteInfo {\n    constructor(router, name, paramNames, context) {\n      super(router, name, paramNames);\n      this.context = context;\n      this.serializer = this.router.getSerializer(name);\n    }\n\n    getModel(transition) {\n      if (this.router.log !== undefined) {\n        this.router.log(this.name + ': resolving provided model');\n      }\n\n      return super.getModel(transition);\n    }\n    /**\n      @private\n         Serializes a route using its custom `serialize` method or\n      by a default that looks up the expected property name from\n      the dynamic segment.\n         @param {Object} model the model to be serialized for this route\n    */\n\n\n    serialize(model) {\n      var {\n        paramNames,\n        context\n      } = this;\n\n      if (!model) {\n        model = context;\n      }\n\n      var object = {};\n\n      if (isParam(model)) {\n        object[paramNames[0]] = model;\n        return object;\n      } // Use custom serialize if it exists.\n\n\n      if (this.serializer) {\n        // invoke this.serializer unbound (getSerializer returns a stateless function)\n        return this.serializer.call(null, model, paramNames);\n      } else if (this.route !== undefined) {\n        if (this.route.serialize) {\n          return this.route.serialize(model, paramNames);\n        }\n      }\n\n      if (paramNames.length !== 1) {\n        return;\n      }\n\n      var name = paramNames[0];\n\n      if (/_id$/.test(name)) {\n        object[name] = model.id;\n      } else {\n        object[name] = model;\n      }\n\n      return object;\n    }\n\n  }\n\n  function paramsMatch(a, b) {\n    if (!a !== !b) {\n      // Only one is null.\n      return false;\n    }\n\n    if (!a) {\n      // Both must be null.\n      return true;\n    } // Note: this assumes that both params have the same\n    // number of keys, but since we're comparing the\n    // same routes, they should.\n\n\n    for (var k in a) {\n      if (a.hasOwnProperty(k) && a[k] !== b[k]) {\n        return false;\n      }\n    }\n\n    return true;\n  }\n\n  class TransitionIntent {\n    constructor(router, data = {}) {\n      this.router = router;\n      this.data = data;\n    }\n\n  }\n\n  class TransitionState {\n    constructor() {\n      this.routeInfos = [];\n      this.queryParams = {};\n      this.params = {};\n    }\n\n    promiseLabel(label) {\n      var targetName = '';\n      forEach(this.routeInfos, function (routeInfo) {\n        if (targetName !== '') {\n          targetName += '.';\n        }\n\n        targetName += routeInfo.name;\n        return true;\n      });\n      return promiseLabel(\"'\" + targetName + \"': \" + label);\n    }\n\n    resolve(shouldContinue, transition) {\n      // First, calculate params for this state. This is useful\n      // information to provide to the various route hooks.\n      var params = this.params;\n      forEach(this.routeInfos, routeInfo => {\n        params[routeInfo.name] = routeInfo.params || {};\n        return true;\n      });\n      transition.resolveIndex = 0;\n      var currentState = this;\n      var wasAborted = false; // The prelude RSVP.resolve() asyncs us into the promise land.\n\n      return _rsvp.Promise.resolve(null, this.promiseLabel('Start transition')).then(resolveOneRouteInfo, null, this.promiseLabel('Resolve route')).catch(handleError, this.promiseLabel('Handle error'));\n\n      function innerShouldContinue() {\n        return _rsvp.Promise.resolve(shouldContinue(), currentState.promiseLabel('Check if should continue')).catch(function (reason) {\n          // We distinguish between errors that occurred\n          // during resolution (e.g. before\"Model/model/afterModel),\n          // and aborts due to a rejecting promise from shouldContinue().\n          wasAborted = true;\n          return _rsvp.Promise.reject(reason);\n        }, currentState.promiseLabel('Handle abort'));\n      }\n\n      function handleError(error) {\n        // This is the only possible\n        // reject value of TransitionState#resolve\n        var routeInfos = currentState.routeInfos;\n        var errorHandlerIndex = transition.resolveIndex >= routeInfos.length ? routeInfos.length - 1 : transition.resolveIndex;\n        return _rsvp.Promise.reject(new TransitionError(error, currentState.routeInfos[errorHandlerIndex].route, wasAborted, currentState));\n      }\n\n      function proceed(resolvedRouteInfo) {\n        var wasAlreadyResolved = currentState.routeInfos[transition.resolveIndex].isResolved; // Swap the previously unresolved routeInfo with\n        // the resolved routeInfo\n\n        currentState.routeInfos[transition.resolveIndex++] = resolvedRouteInfo;\n\n        if (!wasAlreadyResolved) {\n          // Call the redirect hook. The reason we call it here\n          // vs. afterModel is so that redirects into child\n          // routes don't re-run the model hooks for this\n          // already-resolved route.\n          var {\n            route\n          } = resolvedRouteInfo;\n\n          if (route !== undefined) {\n            if (route.redirect) {\n              route.redirect(resolvedRouteInfo.context, transition);\n            }\n          }\n        } // Proceed after ensuring that the redirect hook\n        // didn't abort this transition by transitioning elsewhere.\n\n\n        return innerShouldContinue().then(resolveOneRouteInfo, null, currentState.promiseLabel('Resolve route'));\n      }\n\n      function resolveOneRouteInfo() {\n        if (transition.resolveIndex === currentState.routeInfos.length) {\n          // This is is the only possible\n          // fulfill value of TransitionState#resolve\n          return currentState;\n        }\n\n        var routeInfo = currentState.routeInfos[transition.resolveIndex];\n        return routeInfo.resolve(innerShouldContinue, transition).then(proceed, null, currentState.promiseLabel('Proceed'));\n      }\n    }\n\n  }\n\n  _exports.TransitionState = TransitionState;\n\n  class TransitionError {\n    constructor(error, route, wasAborted, state) {\n      this.error = error;\n      this.route = route;\n      this.wasAborted = wasAborted;\n      this.state = state;\n    }\n\n  }\n\n  _exports.TransitionError = TransitionError;\n\n  class NamedTransitionIntent extends TransitionIntent {\n    constructor(router, name, pivotHandler, contexts = [], queryParams = {}, data) {\n      super(router, data);\n      this.preTransitionState = undefined;\n      this.name = name;\n      this.pivotHandler = pivotHandler;\n      this.contexts = contexts;\n      this.queryParams = queryParams;\n    }\n\n    applyToState(oldState, isIntermediate) {\n      // TODO: WTF fix me\n      var partitionedArgs = extractQueryParams([this.name].concat(this.contexts)),\n          pureArgs = partitionedArgs[0],\n          handlers = this.router.recognizer.handlersFor(pureArgs[0]);\n      var targetRouteName = handlers[handlers.length - 1].handler;\n      return this.applyToHandlers(oldState, handlers, targetRouteName, isIntermediate, false);\n    }\n\n    applyToHandlers(oldState, parsedHandlers, targetRouteName, isIntermediate, checkingIfActive) {\n      var i, len;\n      var newState = new TransitionState();\n      var objects = this.contexts.slice(0);\n      var invalidateIndex = parsedHandlers.length; // Pivot handlers are provided for refresh transitions\n\n      if (this.pivotHandler) {\n        for (i = 0, len = parsedHandlers.length; i < len; ++i) {\n          if (parsedHandlers[i].handler === this.pivotHandler._internalName) {\n            invalidateIndex = i;\n            break;\n          }\n        }\n      }\n\n      for (i = parsedHandlers.length - 1; i >= 0; --i) {\n        var result = parsedHandlers[i];\n        var name = result.handler;\n        var oldHandlerInfo = oldState.routeInfos[i];\n        var newHandlerInfo = null;\n\n        if (result.names.length > 0) {\n          if (i >= invalidateIndex) {\n            newHandlerInfo = this.createParamHandlerInfo(name, result.names, objects, oldHandlerInfo);\n          } else {\n            newHandlerInfo = this.getHandlerInfoForDynamicSegment(name, result.names, objects, oldHandlerInfo, targetRouteName, i);\n          }\n        } else {\n          // This route has no dynamic segment.\n          // Therefore treat as a param-based handlerInfo\n          // with empty params. This will cause the `model`\n          // hook to be called with empty params, which is desirable.\n          newHandlerInfo = this.createParamHandlerInfo(name, result.names, objects, oldHandlerInfo);\n        }\n\n        if (checkingIfActive) {\n          // If we're performing an isActive check, we want to\n          // serialize URL params with the provided context, but\n          // ignore mismatches between old and new context.\n          newHandlerInfo = newHandlerInfo.becomeResolved(null, newHandlerInfo.context);\n          var oldContext = oldHandlerInfo && oldHandlerInfo.context;\n\n          if (result.names.length > 0 && oldHandlerInfo.context !== undefined && newHandlerInfo.context === oldContext) {\n            // If contexts match in isActive test, assume params also match.\n            // This allows for flexibility in not requiring that every last\n            // handler provide a `serialize` method\n            newHandlerInfo.params = oldHandlerInfo && oldHandlerInfo.params;\n          }\n\n          newHandlerInfo.context = oldContext;\n        }\n\n        var handlerToUse = oldHandlerInfo;\n\n        if (i >= invalidateIndex || newHandlerInfo.shouldSupercede(oldHandlerInfo)) {\n          invalidateIndex = Math.min(i, invalidateIndex);\n          handlerToUse = newHandlerInfo;\n        }\n\n        if (isIntermediate && !checkingIfActive) {\n          handlerToUse = handlerToUse.becomeResolved(null, handlerToUse.context);\n        }\n\n        newState.routeInfos.unshift(handlerToUse);\n      }\n\n      if (objects.length > 0) {\n        throw new Error('More context objects were passed than there are dynamic segments for the route: ' + targetRouteName);\n      }\n\n      if (!isIntermediate) {\n        this.invalidateChildren(newState.routeInfos, invalidateIndex);\n      }\n\n      merge(newState.queryParams, this.queryParams || {});\n      return newState;\n    }\n\n    invalidateChildren(handlerInfos, invalidateIndex) {\n      for (var i = invalidateIndex, l = handlerInfos.length; i < l; ++i) {\n        var handlerInfo = handlerInfos[i];\n\n        if (handlerInfo.isResolved) {\n          var {\n            name,\n            params,\n            route,\n            paramNames\n          } = handlerInfos[i];\n          handlerInfos[i] = new UnresolvedRouteInfoByParam(this.router, name, paramNames, params, route);\n        }\n      }\n    }\n\n    getHandlerInfoForDynamicSegment(name, names, objects, oldHandlerInfo, _targetRouteName, i) {\n      var objectToUse;\n\n      if (objects.length > 0) {\n        // Use the objects provided for this transition.\n        objectToUse = objects[objects.length - 1];\n\n        if (isParam(objectToUse)) {\n          return this.createParamHandlerInfo(name, names, objects, oldHandlerInfo);\n        } else {\n          objects.pop();\n        }\n      } else if (oldHandlerInfo && oldHandlerInfo.name === name) {\n        // Reuse the matching oldHandlerInfo\n        return oldHandlerInfo;\n      } else {\n        if (this.preTransitionState) {\n          var preTransitionHandlerInfo = this.preTransitionState.routeInfos[i];\n          objectToUse = preTransitionHandlerInfo && preTransitionHandlerInfo.context;\n        } else {\n          // Ideally we should throw this error to provide maximal\n          // information to the user that not enough context objects\n          // were provided, but this proves too cumbersome in Ember\n          // in cases where inner template helpers are evaluated\n          // before parent helpers un-render, in which cases this\n          // error somewhat prematurely fires.\n          //throw new Error(\"Not enough context objects were provided to complete a transition to \" + targetRouteName + \". Specifically, the \" + name + \" route needs an object that can be serialized into its dynamic URL segments [\" + names.join(', ') + \"]\");\n          return oldHandlerInfo;\n        }\n      }\n\n      return new UnresolvedRouteInfoByObject(this.router, name, names, objectToUse);\n    }\n\n    createParamHandlerInfo(name, names, objects, oldHandlerInfo) {\n      var params = {}; // Soak up all the provided string/numbers\n\n      var numNames = names.length;\n      var missingParams = [];\n\n      while (numNames--) {\n        // Only use old params if the names match with the new handler\n        var oldParams = oldHandlerInfo && name === oldHandlerInfo.name && oldHandlerInfo.params || {};\n        var peek = objects[objects.length - 1];\n        var paramName = names[numNames];\n\n        if (isParam(peek)) {\n          params[paramName] = '' + objects.pop();\n        } else {\n          // If we're here, this means only some of the params\n          // were string/number params, so try and use a param\n          // value from a previous handler.\n          if (oldParams.hasOwnProperty(paramName)) {\n            params[paramName] = oldParams[paramName];\n          } else {\n            missingParams.push(paramName);\n          }\n        }\n      }\n\n      if (missingParams.length > 0) {\n        throw new Error(\"You didn't provide enough string/numeric parameters to satisfy all of the dynamic segments for route \" + name + \".\" + (\" Missing params: \" + missingParams));\n      }\n\n      return new UnresolvedRouteInfoByParam(this.router, name, names, params);\n    }\n\n  }\n\n  var UnrecognizedURLError = function () {\n    UnrecognizedURLError.prototype = Object.create(Error.prototype);\n    UnrecognizedURLError.prototype.constructor = UnrecognizedURLError;\n\n    function UnrecognizedURLError(message) {\n      var error = Error.call(this, message);\n      this.name = 'UnrecognizedURLError';\n      this.message = message || 'UnrecognizedURL';\n\n      if (Error.captureStackTrace) {\n        Error.captureStackTrace(this, UnrecognizedURLError);\n      } else {\n        this.stack = error.stack;\n      }\n    }\n\n    return UnrecognizedURLError;\n  }();\n\n  class URLTransitionIntent extends TransitionIntent {\n    constructor(router, url, data) {\n      super(router, data);\n      this.url = url;\n      this.preTransitionState = undefined;\n    }\n\n    applyToState(oldState) {\n      var newState = new TransitionState();\n      var results = this.router.recognizer.recognize(this.url),\n          i,\n          len;\n\n      if (!results) {\n        throw new UnrecognizedURLError(this.url);\n      }\n\n      var statesDiffer = false;\n      var _url = this.url; // Checks if a handler is accessible by URL. If it is not, an error is thrown.\n      // For the case where the handler is loaded asynchronously, the error will be\n      // thrown once it is loaded.\n\n      function checkHandlerAccessibility(handler) {\n        if (handler && handler.inaccessibleByURL) {\n          throw new UnrecognizedURLError(_url);\n        }\n\n        return handler;\n      }\n\n      for (i = 0, len = results.length; i < len; ++i) {\n        var result = results[i];\n        var name = result.handler;\n        var paramNames = [];\n\n        if (this.router.recognizer.hasRoute(name)) {\n          paramNames = this.router.recognizer.handlersFor(name)[i].names;\n        }\n\n        var newRouteInfo = new UnresolvedRouteInfoByParam(this.router, name, paramNames, result.params);\n        var route = newRouteInfo.route;\n\n        if (route) {\n          checkHandlerAccessibility(route);\n        } else {\n          // If the hanlder is being loaded asynchronously, check if we can\n          // access it after it has resolved\n          newRouteInfo.routePromise = newRouteInfo.routePromise.then(checkHandlerAccessibility);\n        }\n\n        var oldRouteInfo = oldState.routeInfos[i];\n\n        if (statesDiffer || newRouteInfo.shouldSupercede(oldRouteInfo)) {\n          statesDiffer = true;\n          newState.routeInfos[i] = newRouteInfo;\n        } else {\n          newState.routeInfos[i] = oldRouteInfo;\n        }\n      }\n\n      merge(newState.queryParams, results.queryParams);\n      return newState;\n    }\n\n  }\n\n  class Router {\n    constructor(logger) {\n      this._lastQueryParams = {};\n      this.state = undefined;\n      this.oldState = undefined;\n      this.activeTransition = undefined;\n      this.currentRouteInfos = undefined;\n      this._changedQueryParams = undefined;\n      this.currentSequence = 0;\n      this.log = logger;\n      this.recognizer = new _routeRecognizer.default();\n      this.reset();\n    }\n    /**\n      The main entry point into the router. The API is essentially\n      the same as the `map` method in `route-recognizer`.\n         This method extracts the String handler at the last `.to()`\n      call and uses it as the name of the whole route.\n         @param {Function} callback\n    */\n\n\n    map(callback) {\n      this.recognizer.map(callback, function (recognizer, routes) {\n        for (var i = routes.length - 1, proceed = true; i >= 0 && proceed; --i) {\n          var route = routes[i];\n          var handler = route.handler;\n          recognizer.add(routes, {\n            as: handler\n          });\n          proceed = route.path === '/' || route.path === '' || handler.slice(-6) === '.index';\n        }\n      });\n    }\n\n    hasRoute(route) {\n      return this.recognizer.hasRoute(route);\n    }\n\n    queryParamsTransition(changelist, wasTransitioning, oldState, newState) {\n      this.fireQueryParamDidChange(newState, changelist);\n\n      if (!wasTransitioning && this.activeTransition) {\n        // One of the routes in queryParamsDidChange\n        // caused a transition. Just return that transition.\n        return this.activeTransition;\n      } else {\n        // Running queryParamsDidChange didn't change anything.\n        // Just update query params and be on our way.\n        // We have to return a noop transition that will\n        // perform a URL update at the end. This gives\n        // the user the ability to set the url update\n        // method (default is replaceState).\n        var newTransition = new Transition(this, undefined, undefined);\n        newTransition.queryParamsOnly = true;\n        oldState.queryParams = this.finalizeQueryParamChange(newState.routeInfos, newState.queryParams, newTransition);\n        newTransition[QUERY_PARAMS_SYMBOL] = newState.queryParams;\n        this.toReadOnlyInfos(newTransition, newState);\n        this.routeWillChange(newTransition);\n        newTransition.promise = newTransition.promise.then(result => {\n          this._updateURL(newTransition, oldState);\n\n          this.didTransition(this.currentRouteInfos);\n          this.toInfos(newTransition, newState.routeInfos, true);\n          this.routeDidChange(newTransition);\n          return result;\n        }, null, promiseLabel('Transition complete'));\n        return newTransition;\n      }\n    }\n\n    transitionByIntent(intent, isIntermediate) {\n      try {\n        return this.getTransitionByIntent(intent, isIntermediate);\n      } catch (e) {\n        return new Transition(this, intent, undefined, e, undefined);\n      }\n    }\n\n    recognize(url) {\n      var intent = new URLTransitionIntent(this, url);\n      var newState = this.generateNewState(intent);\n\n      if (newState === null) {\n        return newState;\n      }\n\n      var readonlyInfos = toReadOnlyRouteInfo(newState.routeInfos, newState.queryParams);\n      return readonlyInfos[readonlyInfos.length - 1];\n    }\n\n    recognizeAndLoad(url) {\n      var intent = new URLTransitionIntent(this, url);\n      var newState = this.generateNewState(intent);\n\n      if (newState === null) {\n        return _rsvp.Promise.reject(\"URL \" + url + \" was not recognized\");\n      }\n\n      var newTransition = new Transition(this, intent, newState, undefined);\n      return newTransition.then(() => {\n        var routeInfosWithAttributes = toReadOnlyRouteInfo(newState.routeInfos, newTransition[QUERY_PARAMS_SYMBOL], true);\n        return routeInfosWithAttributes[routeInfosWithAttributes.length - 1];\n      });\n    }\n\n    generateNewState(intent) {\n      try {\n        return intent.applyToState(this.state, false);\n      } catch (e) {\n        return null;\n      }\n    }\n\n    getTransitionByIntent(intent, isIntermediate) {\n      var wasTransitioning = !!this.activeTransition;\n      var oldState = wasTransitioning ? this.activeTransition[STATE_SYMBOL] : this.state;\n      var newTransition;\n      var newState = intent.applyToState(oldState, isIntermediate);\n      var queryParamChangelist = getChangelist(oldState.queryParams, newState.queryParams);\n\n      if (routeInfosEqual(newState.routeInfos, oldState.routeInfos)) {\n        // This is a no-op transition. See if query params changed.\n        if (queryParamChangelist) {\n          var _newTransition = this.queryParamsTransition(queryParamChangelist, wasTransitioning, oldState, newState);\n\n          _newTransition.queryParamsOnly = true;\n          return _newTransition;\n        } // No-op. No need to create a new transition.\n\n\n        return this.activeTransition || new Transition(this, undefined, undefined);\n      }\n\n      if (isIntermediate) {\n        var transition = new Transition(this, undefined, undefined);\n        this.toReadOnlyInfos(transition, newState);\n        this.setupContexts(newState);\n        this.routeWillChange(transition);\n        return this.activeTransition;\n      } // Create a new transition to the destination route.\n\n\n      newTransition = new Transition(this, intent, newState, undefined, this.activeTransition); // transition is to same route with same params, only query params differ.\n      // not caught above probably because refresh() has been used\n\n      if (routeInfosSameExceptQueryParams(newState.routeInfos, oldState.routeInfos)) {\n        newTransition.queryParamsOnly = true;\n      }\n\n      this.toReadOnlyInfos(newTransition, newState); // Abort and usurp any previously active transition.\n\n      if (this.activeTransition) {\n        this.activeTransition.redirect(newTransition);\n      }\n\n      this.activeTransition = newTransition; // Transition promises by default resolve with resolved state.\n      // For our purposes, swap out the promise to resolve\n      // after the transition has been finalized.\n\n      newTransition.promise = newTransition.promise.then(result => {\n        return this.finalizeTransition(newTransition, result);\n      }, null, promiseLabel('Settle transition promise when transition is finalized'));\n\n      if (!wasTransitioning) {\n        this.notifyExistingHandlers(newState, newTransition);\n      }\n\n      this.fireQueryParamDidChange(newState, queryParamChangelist);\n      return newTransition;\n    }\n    /**\n    @private\n       Begins and returns a Transition based on the provided\n    arguments. Accepts arguments in the form of both URL\n    transitions and named transitions.\n       @param {Router} router\n    @param {Array[Object]} args arguments passed to transitionTo,\n      replaceWith, or handleURL\n    */\n\n\n    doTransition(name, modelsArray = [], isIntermediate = false) {\n      var lastArg = modelsArray[modelsArray.length - 1];\n      var queryParams = {};\n\n      if (lastArg !== undefined && lastArg.hasOwnProperty('queryParams')) {\n        queryParams = modelsArray.pop().queryParams;\n      }\n\n      var intent;\n\n      if (name === undefined) {\n        log(this, 'Updating query params'); // A query param update is really just a transition\n        // into the route you're already on.\n\n        var {\n          routeInfos\n        } = this.state;\n        intent = new NamedTransitionIntent(this, routeInfos[routeInfos.length - 1].name, undefined, [], queryParams);\n      } else if (name.charAt(0) === '/') {\n        log(this, 'Attempting URL transition to ' + name);\n        intent = new URLTransitionIntent(this, name);\n      } else {\n        log(this, 'Attempting transition to ' + name);\n        intent = new NamedTransitionIntent(this, name, undefined, modelsArray, queryParams);\n      }\n\n      return this.transitionByIntent(intent, isIntermediate);\n    }\n    /**\n    @private\n       Updates the URL (if necessary) and calls `setupContexts`\n    to update the router's array of `currentRouteInfos`.\n    */\n\n\n    finalizeTransition(transition, newState) {\n      try {\n        log(transition.router, transition.sequence, 'Resolved all models on destination route; finalizing transition.');\n        var routeInfos = newState.routeInfos; // Run all the necessary enter/setup/exit hooks\n\n        this.setupContexts(newState, transition); // Check if a redirect occurred in enter/setup\n\n        if (transition.isAborted) {\n          // TODO: cleaner way? distinguish b/w targetRouteInfos?\n          this.state.routeInfos = this.currentRouteInfos;\n          return _rsvp.Promise.reject(logAbort(transition));\n        }\n\n        this._updateURL(transition, newState);\n\n        transition.isActive = false;\n        this.activeTransition = undefined;\n        this.triggerEvent(this.currentRouteInfos, true, 'didTransition', []);\n        this.didTransition(this.currentRouteInfos);\n        this.toInfos(transition, newState.routeInfos, true);\n        this.routeDidChange(transition);\n        log(this, transition.sequence, 'TRANSITION COMPLETE.'); // Resolve with the final route.\n\n        return routeInfos[routeInfos.length - 1].route;\n      } catch (e) {\n        if (!(e instanceof TransitionAbortedError)) {\n          var infos = transition[STATE_SYMBOL].routeInfos;\n          transition.trigger(true, 'error', e, transition, infos[infos.length - 1].route);\n          transition.abort();\n        }\n\n        throw e;\n      }\n    }\n    /**\n    @private\n       Takes an Array of `RouteInfo`s, figures out which ones are\n    exiting, entering, or changing contexts, and calls the\n    proper route hooks.\n       For example, consider the following tree of routes. Each route is\n    followed by the URL segment it handles.\n       ```\n    |~index (\"/\")\n    | |~posts (\"/posts\")\n    | | |-showPost (\"/:id\")\n    | | |-newPost (\"/new\")\n    | | |-editPost (\"/edit\")\n    | |~about (\"/about/:id\")\n    ```\n       Consider the following transitions:\n       1. A URL transition to `/posts/1`.\n       1. Triggers the `*model` callbacks on the\n          `index`, `posts`, and `showPost` routes\n       2. Triggers the `enter` callback on the same\n       3. Triggers the `setup` callback on the same\n    2. A direct transition to `newPost`\n       1. Triggers the `exit` callback on `showPost`\n       2. Triggers the `enter` callback on `newPost`\n       3. Triggers the `setup` callback on `newPost`\n    3. A direct transition to `about` with a specified\n       context object\n       1. Triggers the `exit` callback on `newPost`\n          and `posts`\n       2. Triggers the `serialize` callback on `about`\n       3. Triggers the `enter` callback on `about`\n       4. Triggers the `setup` callback on `about`\n       @param {Router} transition\n    @param {TransitionState} newState\n    */\n\n\n    setupContexts(newState, transition) {\n      var partition = this.partitionRoutes(this.state, newState);\n      var i, l, route;\n\n      for (i = 0, l = partition.exited.length; i < l; i++) {\n        route = partition.exited[i].route;\n        delete route.context;\n\n        if (route !== undefined) {\n          if (route._internalReset !== undefined) {\n            route._internalReset(true, transition);\n          }\n\n          if (route.exit !== undefined) {\n            route.exit(transition);\n          }\n        }\n      }\n\n      var oldState = this.oldState = this.state;\n      this.state = newState;\n      var currentRouteInfos = this.currentRouteInfos = partition.unchanged.slice();\n\n      try {\n        for (i = 0, l = partition.reset.length; i < l; i++) {\n          route = partition.reset[i].route;\n\n          if (route !== undefined) {\n            if (route._internalReset !== undefined) {\n              route._internalReset(false, transition);\n            }\n          }\n        }\n\n        for (i = 0, l = partition.updatedContext.length; i < l; i++) {\n          this.routeEnteredOrUpdated(currentRouteInfos, partition.updatedContext[i], false, transition);\n        }\n\n        for (i = 0, l = partition.entered.length; i < l; i++) {\n          this.routeEnteredOrUpdated(currentRouteInfos, partition.entered[i], true, transition);\n        }\n      } catch (e) {\n        this.state = oldState;\n        this.currentRouteInfos = oldState.routeInfos;\n        throw e;\n      }\n\n      this.state.queryParams = this.finalizeQueryParamChange(currentRouteInfos, newState.queryParams, transition);\n    }\n    /**\n    @private\n       Fires queryParamsDidChange event\n    */\n\n\n    fireQueryParamDidChange(newState, queryParamChangelist) {\n      // If queryParams changed trigger event\n      if (queryParamChangelist) {\n        // This is a little hacky but we need some way of storing\n        // changed query params given that no activeTransition\n        // is guaranteed to have occurred.\n        this._changedQueryParams = queryParamChangelist.all;\n        this.triggerEvent(newState.routeInfos, true, 'queryParamsDidChange', [queryParamChangelist.changed, queryParamChangelist.all, queryParamChangelist.removed]);\n        this._changedQueryParams = undefined;\n      }\n    }\n    /**\n    @private\n       Helper method used by setupContexts. Handles errors or redirects\n    that may happen in enter/setup.\n    */\n\n\n    routeEnteredOrUpdated(currentRouteInfos, routeInfo, enter, transition) {\n      var route = routeInfo.route,\n          context = routeInfo.context;\n\n      function _routeEnteredOrUpdated(route) {\n        if (enter) {\n          if (route.enter !== undefined) {\n            route.enter(transition);\n          }\n        }\n\n        if (transition && transition.isAborted) {\n          throw new TransitionAbortedError();\n        }\n\n        route.context = context;\n\n        if (route.contextDidChange !== undefined) {\n          route.contextDidChange();\n        }\n\n        if (route.setup !== undefined) {\n          route.setup(context, transition);\n        }\n\n        if (transition && transition.isAborted) {\n          throw new TransitionAbortedError();\n        }\n\n        currentRouteInfos.push(routeInfo);\n        return route;\n      } // If the route doesn't exist, it means we haven't resolved the route promise yet\n\n\n      if (route === undefined) {\n        routeInfo.routePromise = routeInfo.routePromise.then(_routeEnteredOrUpdated);\n      } else {\n        _routeEnteredOrUpdated(route);\n      }\n\n      return true;\n    }\n    /**\n    @private\n       This function is called when transitioning from one URL to\n    another to determine which routes are no longer active,\n    which routes are newly active, and which routes remain\n    active but have their context changed.\n       Take a list of old routes and new routes and partition\n    them into four buckets:\n       * unchanged: the route was active in both the old and\n      new URL, and its context remains the same\n    * updated context: the route was active in both the\n      old and new URL, but its context changed. The route's\n      `setup` method, if any, will be called with the new\n      context.\n    * exited: the route was active in the old URL, but is\n      no longer active.\n    * entered: the route was not active in the old URL, but\n      is now active.\n       The PartitionedRoutes structure has four fields:\n       * `updatedContext`: a list of `RouteInfo` objects that\n      represent routes that remain active but have a changed\n      context\n    * `entered`: a list of `RouteInfo` objects that represent\n      routes that are newly active\n    * `exited`: a list of `RouteInfo` objects that are no\n      longer active.\n    * `unchanged`: a list of `RouteInfo` objects that remain active.\n       @param {Array[InternalRouteInfo]} oldRoutes a list of the route\n      information for the previous URL (or `[]` if this is the\n      first handled transition)\n    @param {Array[InternalRouteInfo]} newRoutes a list of the route\n      information for the new URL\n       @return {Partition}\n    */\n\n\n    partitionRoutes(oldState, newState) {\n      var oldRouteInfos = oldState.routeInfos;\n      var newRouteInfos = newState.routeInfos;\n      var routes = {\n        updatedContext: [],\n        exited: [],\n        entered: [],\n        unchanged: [],\n        reset: []\n      };\n      var routeChanged,\n          contextChanged = false,\n          i,\n          l;\n\n      for (i = 0, l = newRouteInfos.length; i < l; i++) {\n        var oldRouteInfo = oldRouteInfos[i],\n            newRouteInfo = newRouteInfos[i];\n\n        if (!oldRouteInfo || oldRouteInfo.route !== newRouteInfo.route) {\n          routeChanged = true;\n        }\n\n        if (routeChanged) {\n          routes.entered.push(newRouteInfo);\n\n          if (oldRouteInfo) {\n            routes.exited.unshift(oldRouteInfo);\n          }\n        } else if (contextChanged || oldRouteInfo.context !== newRouteInfo.context) {\n          contextChanged = true;\n          routes.updatedContext.push(newRouteInfo);\n        } else {\n          routes.unchanged.push(oldRouteInfo);\n        }\n      }\n\n      for (i = newRouteInfos.length, l = oldRouteInfos.length; i < l; i++) {\n        routes.exited.unshift(oldRouteInfos[i]);\n      }\n\n      routes.reset = routes.updatedContext.slice();\n      routes.reset.reverse();\n      return routes;\n    }\n\n    _updateURL(transition, state) {\n      var urlMethod = transition.urlMethod;\n\n      if (!urlMethod) {\n        return;\n      }\n\n      var {\n        routeInfos\n      } = state;\n      var {\n        name: routeName\n      } = routeInfos[routeInfos.length - 1];\n      var params = {};\n\n      for (var i = routeInfos.length - 1; i >= 0; --i) {\n        var routeInfo = routeInfos[i];\n        merge(params, routeInfo.params);\n\n        if (routeInfo.route.inaccessibleByURL) {\n          urlMethod = null;\n        }\n      }\n\n      if (urlMethod) {\n        params.queryParams = transition._visibleQueryParams || state.queryParams;\n        var url = this.recognizer.generate(routeName, params); // transitions during the initial transition must always use replaceURL.\n        // When the app boots, you are at a url, e.g. /foo. If some route\n        // redirects to bar as part of the initial transition, you don't want to\n        // add a history entry for /foo. If you do, pressing back will immediately\n        // hit the redirect again and take you back to /bar, thus killing the back\n        // button\n\n        var initial = transition.isCausedByInitialTransition; // say you are at / and you click a link to route /foo. In /foo's\n        // route, the transition is aborted using replacewith('/bar').\n        // Because the current url is still /, the history entry for / is\n        // removed from the history. Clicking back will take you to the page\n        // you were on before /, which is often not even the app, thus killing\n        // the back button. That's why updateURL is always correct for an\n        // aborting transition that's not the initial transition\n\n        var replaceAndNotAborting = urlMethod === 'replace' && !transition.isCausedByAbortingTransition; // because calling refresh causes an aborted transition, this needs to be\n        // special cased - if the initial transition is a replace transition, the\n        // urlMethod should be honored here.\n\n        var isQueryParamsRefreshTransition = transition.queryParamsOnly && urlMethod === 'replace'; // say you are at / and you a `replaceWith(/foo)` is called. Then, that\n        // transition is aborted with `replaceWith(/bar)`. At the end, we should\n        // end up with /bar replacing /. We are replacing the replace. We only\n        // will replace the initial route if all subsequent aborts are also\n        // replaces. However, there is some ambiguity around the correct behavior\n        // here.\n\n        var replacingReplace = urlMethod === 'replace' && transition.isCausedByAbortingReplaceTransition;\n\n        if (initial || replaceAndNotAborting || isQueryParamsRefreshTransition || replacingReplace) {\n          this.replaceURL(url);\n        } else {\n          this.updateURL(url);\n        }\n      }\n    }\n\n    finalizeQueryParamChange(resolvedHandlers, newQueryParams, transition) {\n      // We fire a finalizeQueryParamChange event which\n      // gives the new route hierarchy a chance to tell\n      // us which query params it's consuming and what\n      // their final values are. If a query param is\n      // no longer consumed in the final route hierarchy,\n      // its serialized segment will be removed\n      // from the URL.\n      for (var k in newQueryParams) {\n        if (newQueryParams.hasOwnProperty(k) && newQueryParams[k] === null) {\n          delete newQueryParams[k];\n        }\n      }\n\n      var finalQueryParamsArray = [];\n      this.triggerEvent(resolvedHandlers, true, 'finalizeQueryParamChange', [newQueryParams, finalQueryParamsArray, transition]);\n\n      if (transition) {\n        transition._visibleQueryParams = {};\n      }\n\n      var finalQueryParams = {};\n\n      for (var i = 0, len = finalQueryParamsArray.length; i < len; ++i) {\n        var qp = finalQueryParamsArray[i];\n        finalQueryParams[qp.key] = qp.value;\n\n        if (transition && qp.visible !== false) {\n          transition._visibleQueryParams[qp.key] = qp.value;\n        }\n      }\n\n      return finalQueryParams;\n    }\n\n    toReadOnlyInfos(newTransition, newState) {\n      var oldRouteInfos = this.state.routeInfos;\n      this.fromInfos(newTransition, oldRouteInfos);\n      this.toInfos(newTransition, newState.routeInfos);\n      this._lastQueryParams = newState.queryParams;\n    }\n\n    fromInfos(newTransition, oldRouteInfos) {\n      if (newTransition !== undefined && oldRouteInfos.length > 0) {\n        var fromInfos = toReadOnlyRouteInfo(oldRouteInfos, (0, _polyfills.assign)({}, this._lastQueryParams), true);\n        newTransition.from = fromInfos[fromInfos.length - 1] || null;\n      }\n    }\n\n    toInfos(newTransition, newRouteInfos, includeAttributes = false) {\n      if (newTransition !== undefined && newRouteInfos.length > 0) {\n        var toInfos = toReadOnlyRouteInfo(newRouteInfos, (0, _polyfills.assign)({}, newTransition[QUERY_PARAMS_SYMBOL]), includeAttributes);\n        newTransition.to = toInfos[toInfos.length - 1] || null;\n      }\n    }\n\n    notifyExistingHandlers(newState, newTransition) {\n      var oldRouteInfos = this.state.routeInfos,\n          i,\n          oldRouteInfoLen,\n          oldHandler,\n          newRouteInfo;\n      oldRouteInfoLen = oldRouteInfos.length;\n\n      for (i = 0; i < oldRouteInfoLen; i++) {\n        oldHandler = oldRouteInfos[i];\n        newRouteInfo = newState.routeInfos[i];\n\n        if (!newRouteInfo || oldHandler.name !== newRouteInfo.name) {\n          break;\n        }\n\n        if (!newRouteInfo.isResolved) {}\n      }\n\n      this.triggerEvent(oldRouteInfos, true, 'willTransition', [newTransition]);\n      this.routeWillChange(newTransition);\n      this.willTransition(oldRouteInfos, newState.routeInfos, newTransition);\n    }\n    /**\n      Clears the current and target route routes and triggers exit\n      on each of them starting at the leaf and traversing up through\n      its ancestors.\n    */\n\n\n    reset() {\n      if (this.state) {\n        forEach(this.state.routeInfos.slice().reverse(), function (routeInfo) {\n          var route = routeInfo.route;\n\n          if (route !== undefined) {\n            if (route.exit !== undefined) {\n              route.exit();\n            }\n          }\n\n          return true;\n        });\n      }\n\n      this.oldState = undefined;\n      this.state = new TransitionState();\n      this.currentRouteInfos = undefined;\n    }\n    /**\n      let handler = routeInfo.handler;\n      The entry point for handling a change to the URL (usually\n      via the back and forward button).\n         Returns an Array of handlers and the parameters associated\n      with those parameters.\n         @param {String} url a URL to process\n         @return {Array} an Array of `[handler, parameter]` tuples\n    */\n\n\n    handleURL(url) {\n      // Perform a URL-based transition, but don't change\n      // the URL afterward, since it already happened.\n      if (url.charAt(0) !== '/') {\n        url = '/' + url;\n      }\n\n      return this.doTransition(url).method(null);\n    }\n    /**\n      Transition into the specified named route.\n         If necessary, trigger the exit callback on any routes\n      that are no longer represented by the target route.\n         @param {String} name the name of the route\n    */\n\n\n    transitionTo(name, ...contexts) {\n      if (typeof name === 'object') {\n        contexts.push(name);\n        return this.doTransition(undefined, contexts, false);\n      }\n\n      return this.doTransition(name, contexts);\n    }\n\n    intermediateTransitionTo(name, ...args) {\n      return this.doTransition(name, args, true);\n    }\n\n    refresh(pivotRoute) {\n      var previousTransition = this.activeTransition;\n      var state = previousTransition ? previousTransition[STATE_SYMBOL] : this.state;\n      var routeInfos = state.routeInfos;\n\n      if (pivotRoute === undefined) {\n        pivotRoute = routeInfos[0].route;\n      }\n\n      log(this, 'Starting a refresh transition');\n      var name = routeInfos[routeInfos.length - 1].name;\n      var intent = new NamedTransitionIntent(this, name, pivotRoute, [], this._changedQueryParams || state.queryParams);\n      var newTransition = this.transitionByIntent(intent, false); // if the previous transition is a replace transition, that needs to be preserved\n\n      if (previousTransition && previousTransition.urlMethod === 'replace') {\n        newTransition.method(previousTransition.urlMethod);\n      }\n\n      return newTransition;\n    }\n    /**\n      Identical to `transitionTo` except that the current URL will be replaced\n      if possible.\n         This method is intended primarily for use with `replaceState`.\n         @param {String} name the name of the route\n    */\n\n\n    replaceWith(name) {\n      return this.doTransition(name).method('replace');\n    }\n    /**\n      Take a named route and context objects and generate a\n      URL.\n         @param {String} name the name of the route to generate\n        a URL for\n      @param {...Object} objects a list of objects to serialize\n         @return {String} a URL\n    */\n\n\n    generate(routeName, ...args) {\n      var partitionedArgs = extractQueryParams(args),\n          suppliedParams = partitionedArgs[0],\n          queryParams = partitionedArgs[1]; // Construct a TransitionIntent with the provided params\n      // and apply it to the present state of the router.\n\n      var intent = new NamedTransitionIntent(this, routeName, undefined, suppliedParams);\n      var state = intent.applyToState(this.state, false);\n      var params = {};\n\n      for (var i = 0, len = state.routeInfos.length; i < len; ++i) {\n        var routeInfo = state.routeInfos[i];\n        var routeParams = routeInfo.serialize();\n        merge(params, routeParams);\n      }\n\n      params.queryParams = queryParams;\n      return this.recognizer.generate(routeName, params);\n    }\n\n    applyIntent(routeName, contexts) {\n      var intent = new NamedTransitionIntent(this, routeName, undefined, contexts);\n      var state = this.activeTransition && this.activeTransition[STATE_SYMBOL] || this.state;\n      return intent.applyToState(state, false);\n    }\n\n    isActiveIntent(routeName, contexts, queryParams, _state) {\n      var state = _state || this.state,\n          targetRouteInfos = state.routeInfos,\n          routeInfo,\n          len;\n\n      if (!targetRouteInfos.length) {\n        return false;\n      }\n\n      var targetHandler = targetRouteInfos[targetRouteInfos.length - 1].name;\n      var recogHandlers = this.recognizer.handlersFor(targetHandler);\n      var index = 0;\n\n      for (len = recogHandlers.length; index < len; ++index) {\n        routeInfo = targetRouteInfos[index];\n\n        if (routeInfo.name === routeName) {\n          break;\n        }\n      }\n\n      if (index === recogHandlers.length) {\n        // The provided route name isn't even in the route hierarchy.\n        return false;\n      }\n\n      var testState = new TransitionState();\n      testState.routeInfos = targetRouteInfos.slice(0, index + 1);\n      recogHandlers = recogHandlers.slice(0, index + 1);\n      var intent = new NamedTransitionIntent(this, targetHandler, undefined, contexts);\n      var newState = intent.applyToHandlers(testState, recogHandlers, targetHandler, true, true);\n      var routesEqual = routeInfosEqual(newState.routeInfos, testState.routeInfos);\n\n      if (!queryParams || !routesEqual) {\n        return routesEqual;\n      } // Get a hash of QPs that will still be active on new route\n\n\n      var activeQPsOnNewHandler = {};\n      merge(activeQPsOnNewHandler, queryParams);\n      var activeQueryParams = state.queryParams;\n\n      for (var key in activeQueryParams) {\n        if (activeQueryParams.hasOwnProperty(key) && activeQPsOnNewHandler.hasOwnProperty(key)) {\n          activeQPsOnNewHandler[key] = activeQueryParams[key];\n        }\n      }\n\n      return routesEqual && !getChangelist(activeQPsOnNewHandler, queryParams);\n    }\n\n    isActive(routeName, ...args) {\n      var partitionedArgs = extractQueryParams(args);\n      return this.isActiveIntent(routeName, partitionedArgs[0], partitionedArgs[1]);\n    }\n\n    trigger(name, ...args) {\n      this.triggerEvent(this.currentRouteInfos, false, name, args);\n    }\n\n  }\n\n  function routeInfosEqual(routeInfos, otherRouteInfos) {\n    if (routeInfos.length !== otherRouteInfos.length) {\n      return false;\n    }\n\n    for (var i = 0, len = routeInfos.length; i < len; ++i) {\n      if (routeInfos[i] !== otherRouteInfos[i]) {\n        return false;\n      }\n    }\n\n    return true;\n  }\n\n  function routeInfosSameExceptQueryParams(routeInfos, otherRouteInfos) {\n    if (routeInfos.length !== otherRouteInfos.length) {\n      return false;\n    }\n\n    for (var i = 0, len = routeInfos.length; i < len; ++i) {\n      if (routeInfos[i].name !== otherRouteInfos[i].name) {\n        return false;\n      }\n\n      if (!paramsEqual(routeInfos[i].params, otherRouteInfos[i].params)) {\n        return false;\n      }\n    }\n\n    return true;\n  }\n\n  function paramsEqual(params, otherParams) {\n    if (!params && !otherParams) {\n      return true;\n    } else if (!params && !!otherParams || !!params && !otherParams) {\n      // one is falsy but other is not;\n      return false;\n    }\n\n    var keys = Object.keys(params);\n    var otherKeys = Object.keys(otherParams);\n\n    if (keys.length !== otherKeys.length) {\n      return false;\n    }\n\n    for (var i = 0, len = keys.length; i < len; ++i) {\n      var key = keys[i];\n\n      if (params[key] !== otherParams[key]) {\n        return false;\n      }\n    }\n\n    return true;\n  }\n\n  var _default = Router;\n  _exports.default = _default;\n});","define(\"rsvp\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.asap = asap;\n  _exports.all = all$1;\n  _exports.allSettled = allSettled;\n  _exports.race = race$1;\n  _exports.hash = hash;\n  _exports.hashSettled = hashSettled;\n  _exports.rethrow = rethrow;\n  _exports.defer = defer;\n  _exports.denodeify = denodeify;\n  _exports.configure = configure;\n  _exports.on = on;\n  _exports.off = off;\n  _exports.resolve = resolve$2;\n  _exports.reject = reject$2;\n  _exports.map = map;\n  _exports.filter = filter;\n  _exports.async = _exports.EventTarget = _exports.Promise = _exports.cast = _exports.default = void 0;\n\n  function callbacksFor(object) {\n    var callbacks = object._promiseCallbacks;\n\n    if (!callbacks) {\n      callbacks = object._promiseCallbacks = {};\n    }\n\n    return callbacks;\n  }\n  /**\n    @class EventTarget\n    @for rsvp\n    @public\n  */\n\n\n  var EventTarget = {\n    /**\n      `EventTarget.mixin` extends an object with EventTarget methods. For\n      Example:\n       ```javascript\n      import EventTarget from 'rsvp';\n       let object = {};\n       EventTarget.mixin(object);\n       object.on('finished', function(event) {\n        // handle event\n      });\n       object.trigger('finished', { detail: value });\n      ```\n       `EventTarget.mixin` also works with prototypes:\n       ```javascript\n      import EventTarget from 'rsvp';\n       let Person = function() {};\n      EventTarget.mixin(Person.prototype);\n       let yehuda = new Person();\n      let tom = new Person();\n       yehuda.on('poke', function(event) {\n        console.log('Yehuda says OW');\n      });\n       tom.on('poke', function(event) {\n        console.log('Tom says OW');\n      });\n       yehuda.trigger('poke');\n      tom.trigger('poke');\n      ```\n       @method mixin\n      @for rsvp\n      @private\n      @param {Object} object object to extend with EventTarget methods\n    */\n    mixin(object) {\n      object.on = this.on;\n      object.off = this.off;\n      object.trigger = this.trigger;\n      object._promiseCallbacks = undefined;\n      return object;\n    },\n\n    /**\n      Registers a callback to be executed when `eventName` is triggered\n       ```javascript\n      object.on('event', function(eventInfo){\n        // handle the event\n      });\n       object.trigger('event');\n      ```\n       @method on\n      @for EventTarget\n      @private\n      @param {String} eventName name of the event to listen for\n      @param {Function} callback function to be called when the event is triggered.\n    */\n    on(eventName, callback) {\n      if (typeof callback !== 'function') {\n        throw new TypeError('Callback must be a function');\n      }\n\n      var allCallbacks = callbacksFor(this);\n      var callbacks = allCallbacks[eventName];\n\n      if (!callbacks) {\n        callbacks = allCallbacks[eventName] = [];\n      }\n\n      if (callbacks.indexOf(callback) === -1) {\n        callbacks.push(callback);\n      }\n    },\n\n    /**\n      You can use `off` to stop firing a particular callback for an event:\n       ```javascript\n      function doStuff() { // do stuff! }\n      object.on('stuff', doStuff);\n       object.trigger('stuff'); // doStuff will be called\n       // Unregister ONLY the doStuff callback\n      object.off('stuff', doStuff);\n      object.trigger('stuff'); // doStuff will NOT be called\n      ```\n       If you don't pass a `callback` argument to `off`, ALL callbacks for the\n      event will not be executed when the event fires. For example:\n       ```javascript\n      let callback1 = function(){};\n      let callback2 = function(){};\n       object.on('stuff', callback1);\n      object.on('stuff', callback2);\n       object.trigger('stuff'); // callback1 and callback2 will be executed.\n       object.off('stuff');\n      object.trigger('stuff'); // callback1 and callback2 will not be executed!\n      ```\n       @method off\n      @for rsvp\n      @private\n      @param {String} eventName event to stop listening to\n      @param {Function} [callback] optional argument. If given, only the function\n      given will be removed from the event's callback queue. If no `callback`\n      argument is given, all callbacks will be removed from the event's callback\n      queue.\n    */\n    off(eventName, callback) {\n      var allCallbacks = callbacksFor(this);\n\n      if (!callback) {\n        allCallbacks[eventName] = [];\n        return;\n      }\n\n      var callbacks = allCallbacks[eventName];\n      var index = callbacks.indexOf(callback);\n\n      if (index !== -1) {\n        callbacks.splice(index, 1);\n      }\n    },\n\n    /**\n      Use `trigger` to fire custom events. For example:\n       ```javascript\n      object.on('foo', function(){\n        console.log('foo event happened!');\n      });\n      object.trigger('foo');\n      // 'foo event happened!' logged to the console\n      ```\n       You can also pass a value as a second argument to `trigger` that will be\n      passed as an argument to all event listeners for the event:\n       ```javascript\n      object.on('foo', function(value){\n        console.log(value.name);\n      });\n       object.trigger('foo', { name: 'bar' });\n      // 'bar' logged to the console\n      ```\n       @method trigger\n      @for rsvp\n      @private\n      @param {String} eventName name of the event to be triggered\n      @param {*} [options] optional value to be passed to any event handlers for\n      the given `eventName`\n    */\n    trigger(eventName, options, label) {\n      var allCallbacks = callbacksFor(this);\n      var callbacks = allCallbacks[eventName];\n\n      if (callbacks) {\n        // Don't cache the callbacks.length since it may grow\n        var callback;\n\n        for (var i = 0; i < callbacks.length; i++) {\n          callback = callbacks[i];\n          callback(options, label);\n        }\n      }\n    }\n\n  };\n  _exports.EventTarget = EventTarget;\n  var config = {\n    instrument: false\n  };\n  EventTarget['mixin'](config);\n\n  function configure(name, value) {\n    if (arguments.length === 2) {\n      config[name] = value;\n    } else {\n      return config[name];\n    }\n  }\n\n  var queue = [];\n\n  function scheduleFlush() {\n    setTimeout(() => {\n      for (var i = 0; i < queue.length; i++) {\n        var entry = queue[i];\n        var payload = entry.payload;\n        payload.guid = payload.key + payload.id;\n        payload.childGuid = payload.key + payload.childId;\n\n        if (payload.error) {\n          payload.stack = payload.error.stack;\n        }\n\n        config['trigger'](entry.name, entry.payload);\n      }\n\n      queue.length = 0;\n    }, 50);\n  }\n\n  function instrument(eventName, promise, child) {\n    if (1 === queue.push({\n      name: eventName,\n      payload: {\n        key: promise._guidKey,\n        id: promise._id,\n        eventName: eventName,\n        detail: promise._result,\n        childId: child && child._id,\n        label: promise._label,\n        timeStamp: Date.now(),\n        error: config[\"instrument-with-stack\"] ? new Error(promise._label) : null\n      }\n    })) {\n      scheduleFlush();\n    }\n  }\n  /**\n    `Promise.resolve` returns a promise that will become resolved with the\n    passed `value`. It is shorthand for the following:\n  \n    ```javascript\n    import Promise from 'rsvp';\n  \n    let promise = new Promise(function(resolve, reject){\n      resolve(1);\n    });\n  \n    promise.then(function(value){\n      // value === 1\n    });\n    ```\n  \n    Instead of writing the above, your code now simply becomes the following:\n  \n    ```javascript\n    import Promise from 'rsvp';\n  \n    let promise = RSVP.Promise.resolve(1);\n  \n    promise.then(function(value){\n      // value === 1\n    });\n    ```\n  \n    @method resolve\n    @for Promise\n    @static\n    @param {*} object value that the returned promise will be resolved with\n    @param {String} [label] optional string for identifying the returned promise.\n    Useful for tooling.\n    @return {Promise} a promise that will become fulfilled with the given\n    `value`\n  */\n\n\n  function resolve$$1(object, label) {\n    /*jshint validthis:true */\n    var Constructor = this;\n\n    if (object && typeof object === 'object' && object.constructor === Constructor) {\n      return object;\n    }\n\n    var promise = new Constructor(noop, label);\n    resolve$1(promise, object);\n    return promise;\n  }\n\n  function withOwnPromise() {\n    return new TypeError('A promises callback cannot return that same promise.');\n  }\n\n  function objectOrFunction(x) {\n    var type = typeof x;\n    return x !== null && (type === 'object' || type === 'function');\n  }\n\n  function noop() {}\n\n  var PENDING = void 0;\n  var FULFILLED = 1;\n  var REJECTED = 2;\n\n  function tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) {\n    try {\n      then$$1.call(value, fulfillmentHandler, rejectionHandler);\n    } catch (e) {\n      return e;\n    }\n  }\n\n  function handleForeignThenable(promise, thenable, then$$1) {\n    config.async(promise => {\n      var sealed = false;\n      var error = tryThen(then$$1, thenable, value => {\n        if (sealed) {\n          return;\n        }\n\n        sealed = true;\n\n        if (thenable === value) {\n          fulfill(promise, value);\n        } else {\n          resolve$1(promise, value);\n        }\n      }, reason => {\n        if (sealed) {\n          return;\n        }\n\n        sealed = true;\n        reject(promise, reason);\n      }, 'Settle: ' + (promise._label || ' unknown promise'));\n\n      if (!sealed && error) {\n        sealed = true;\n        reject(promise, error);\n      }\n    }, promise);\n  }\n\n  function handleOwnThenable(promise, thenable) {\n    if (thenable._state === FULFILLED) {\n      fulfill(promise, thenable._result);\n    } else if (thenable._state === REJECTED) {\n      thenable._onError = null;\n      reject(promise, thenable._result);\n    } else {\n      subscribe(thenable, undefined, value => {\n        if (thenable === value) {\n          fulfill(promise, value);\n        } else {\n          resolve$1(promise, value);\n        }\n      }, reason => reject(promise, reason));\n    }\n  }\n\n  function handleMaybeThenable(promise, maybeThenable, then$$1) {\n    var isOwnThenable = maybeThenable.constructor === promise.constructor && then$$1 === then && promise.constructor.resolve === resolve$$1;\n\n    if (isOwnThenable) {\n      handleOwnThenable(promise, maybeThenable);\n    } else if (typeof then$$1 === 'function') {\n      handleForeignThenable(promise, maybeThenable, then$$1);\n    } else {\n      fulfill(promise, maybeThenable);\n    }\n  }\n\n  function resolve$1(promise, value) {\n    if (promise === value) {\n      fulfill(promise, value);\n    } else if (objectOrFunction(value)) {\n      var then$$1;\n\n      try {\n        then$$1 = value.then;\n      } catch (error) {\n        reject(promise, error);\n        return;\n      }\n\n      handleMaybeThenable(promise, value, then$$1);\n    } else {\n      fulfill(promise, value);\n    }\n  }\n\n  function publishRejection(promise) {\n    if (promise._onError) {\n      promise._onError(promise._result);\n    }\n\n    publish(promise);\n  }\n\n  function fulfill(promise, value) {\n    if (promise._state !== PENDING) {\n      return;\n    }\n\n    promise._result = value;\n    promise._state = FULFILLED;\n\n    if (promise._subscribers.length === 0) {\n      if (config.instrument) {\n        instrument('fulfilled', promise);\n      }\n    } else {\n      config.async(publish, promise);\n    }\n  }\n\n  function reject(promise, reason) {\n    if (promise._state !== PENDING) {\n      return;\n    }\n\n    promise._state = REJECTED;\n    promise._result = reason;\n    config.async(publishRejection, promise);\n  }\n\n  function subscribe(parent, child, onFulfillment, onRejection) {\n    var subscribers = parent._subscribers;\n    var length = subscribers.length;\n    parent._onError = null;\n    subscribers[length] = child;\n    subscribers[length + FULFILLED] = onFulfillment;\n    subscribers[length + REJECTED] = onRejection;\n\n    if (length === 0 && parent._state) {\n      config.async(publish, parent);\n    }\n  }\n\n  function publish(promise) {\n    var subscribers = promise._subscribers;\n    var settled = promise._state;\n\n    if (config.instrument) {\n      instrument(settled === FULFILLED ? 'fulfilled' : 'rejected', promise);\n    }\n\n    if (subscribers.length === 0) {\n      return;\n    }\n\n    var child,\n        callback,\n        result = promise._result;\n\n    for (var i = 0; i < subscribers.length; i += 3) {\n      child = subscribers[i];\n      callback = subscribers[i + settled];\n\n      if (child) {\n        invokeCallback(settled, child, callback, result);\n      } else {\n        callback(result);\n      }\n    }\n\n    promise._subscribers.length = 0;\n  }\n\n  function invokeCallback(state, promise, callback, result) {\n    var hasCallback = typeof callback === 'function';\n    var value,\n        succeeded = true,\n        error;\n\n    if (hasCallback) {\n      try {\n        value = callback(result);\n      } catch (e) {\n        succeeded = false;\n        error = e;\n      }\n    } else {\n      value = result;\n    }\n\n    if (promise._state !== PENDING) {// noop\n    } else if (value === promise) {\n      reject(promise, withOwnPromise());\n    } else if (succeeded === false) {\n      reject(promise, error);\n    } else if (hasCallback) {\n      resolve$1(promise, value);\n    } else if (state === FULFILLED) {\n      fulfill(promise, value);\n    } else if (state === REJECTED) {\n      reject(promise, value);\n    }\n  }\n\n  function initializePromise(promise, resolver) {\n    var resolved = false;\n\n    try {\n      resolver(value => {\n        if (resolved) {\n          return;\n        }\n\n        resolved = true;\n        resolve$1(promise, value);\n      }, reason => {\n        if (resolved) {\n          return;\n        }\n\n        resolved = true;\n        reject(promise, reason);\n      });\n    } catch (e) {\n      reject(promise, e);\n    }\n  }\n\n  function then(onFulfillment, onRejection, label) {\n    var parent = this;\n    var state = parent._state;\n\n    if (state === FULFILLED && !onFulfillment || state === REJECTED && !onRejection) {\n      config.instrument && instrument('chained', parent, parent);\n      return parent;\n    }\n\n    parent._onError = null;\n    var child = new parent.constructor(noop, label);\n    var result = parent._result;\n    config.instrument && instrument('chained', parent, child);\n\n    if (state === PENDING) {\n      subscribe(parent, child, onFulfillment, onRejection);\n    } else {\n      var callback = state === FULFILLED ? onFulfillment : onRejection;\n      config.async(() => invokeCallback(state, child, callback, result));\n    }\n\n    return child;\n  }\n\n  class Enumerator {\n    constructor(Constructor, input, abortOnReject, label) {\n      this._instanceConstructor = Constructor;\n      this.promise = new Constructor(noop, label);\n      this._abortOnReject = abortOnReject;\n      this._isUsingOwnPromise = Constructor === Promise;\n      this._isUsingOwnResolve = Constructor.resolve === resolve$$1;\n\n      this._init(...arguments);\n    }\n\n    _init(Constructor, input) {\n      var len = input.length || 0;\n      this.length = len;\n      this._remaining = len;\n      this._result = new Array(len);\n\n      this._enumerate(input);\n    }\n\n    _enumerate(input) {\n      var length = this.length;\n      var promise = this.promise;\n\n      for (var i = 0; promise._state === PENDING && i < length; i++) {\n        this._eachEntry(input[i], i, true);\n      }\n\n      this._checkFullfillment();\n    }\n\n    _checkFullfillment() {\n      if (this._remaining === 0) {\n        var result = this._result;\n        fulfill(this.promise, result);\n        this._result = null;\n      }\n    }\n\n    _settleMaybeThenable(entry, i, firstPass) {\n      var c = this._instanceConstructor;\n\n      if (this._isUsingOwnResolve) {\n        var then$$1,\n            error,\n            succeeded = true;\n\n        try {\n          then$$1 = entry.then;\n        } catch (e) {\n          succeeded = false;\n          error = e;\n        }\n\n        if (then$$1 === then && entry._state !== PENDING) {\n          entry._onError = null;\n\n          this._settledAt(entry._state, i, entry._result, firstPass);\n        } else if (typeof then$$1 !== 'function') {\n          this._settledAt(FULFILLED, i, entry, firstPass);\n        } else if (this._isUsingOwnPromise) {\n          var promise = new c(noop);\n\n          if (succeeded === false) {\n            reject(promise, error);\n          } else {\n            handleMaybeThenable(promise, entry, then$$1);\n\n            this._willSettleAt(promise, i, firstPass);\n          }\n        } else {\n          this._willSettleAt(new c(resolve => resolve(entry)), i, firstPass);\n        }\n      } else {\n        this._willSettleAt(c.resolve(entry), i, firstPass);\n      }\n    }\n\n    _eachEntry(entry, i, firstPass) {\n      if (entry !== null && typeof entry === 'object') {\n        this._settleMaybeThenable(entry, i, firstPass);\n      } else {\n        this._setResultAt(FULFILLED, i, entry, firstPass);\n      }\n    }\n\n    _settledAt(state, i, value, firstPass) {\n      var promise = this.promise;\n\n      if (promise._state === PENDING) {\n        if (this._abortOnReject && state === REJECTED) {\n          reject(promise, value);\n        } else {\n          this._setResultAt(state, i, value, firstPass);\n\n          this._checkFullfillment();\n        }\n      }\n    }\n\n    _setResultAt(state, i, value, firstPass) {\n      this._remaining--;\n      this._result[i] = value;\n    }\n\n    _willSettleAt(promise, i, firstPass) {\n      subscribe(promise, undefined, value => this._settledAt(FULFILLED, i, value, firstPass), reason => this._settledAt(REJECTED, i, reason, firstPass));\n    }\n\n  }\n\n  function setSettledResult(state, i, value) {\n    this._remaining--;\n\n    if (state === FULFILLED) {\n      this._result[i] = {\n        state: 'fulfilled',\n        value: value\n      };\n    } else {\n      this._result[i] = {\n        state: 'rejected',\n        reason: value\n      };\n    }\n  }\n  /**\n    `Promise.all` accepts an array of promises, and returns a new promise which\n    is fulfilled with an array of fulfillment values for the passed promises, or\n    rejected with the reason of the first passed promise to be rejected. It casts all\n    elements of the passed iterable to promises as it runs this algorithm.\n  \n    Example:\n  \n    ```javascript\n    import Promise, { resolve } from 'rsvp';\n  \n    let promise1 = resolve(1);\n    let promise2 = resolve(2);\n    let promise3 = resolve(3);\n    let promises = [ promise1, promise2, promise3 ];\n  \n    Promise.all(promises).then(function(array){\n      // The array here would be [ 1, 2, 3 ];\n    });\n    ```\n  \n    If any of the `promises` given to `RSVP.all` are rejected, the first promise\n    that is rejected will be given as an argument to the returned promises's\n    rejection handler. For example:\n  \n    Example:\n  \n    ```javascript\n    import Promise, { resolve, reject } from 'rsvp';\n  \n    let promise1 = resolve(1);\n    let promise2 = reject(new Error(\"2\"));\n    let promise3 = reject(new Error(\"3\"));\n    let promises = [ promise1, promise2, promise3 ];\n  \n    Promise.all(promises).then(function(array){\n      // Code here never runs because there are rejected promises!\n    }, function(error) {\n      // error.message === \"2\"\n    });\n    ```\n  \n    @method all\n    @for Promise\n    @param {Array} entries array of promises\n    @param {String} [label] optional string for labeling the promise.\n    Useful for tooling.\n    @return {Promise} promise that is fulfilled when all `promises` have been\n    fulfilled, or rejected if any of them become rejected.\n    @static\n  */\n\n\n  function all(entries, label) {\n    if (!Array.isArray(entries)) {\n      return this.reject(new TypeError(\"Promise.all must be called with an array\"), label);\n    }\n\n    return new Enumerator(this, entries, true\n    /* abort on reject */\n    , label).promise;\n  }\n  /**\n    `Promise.race` returns a new promise which is settled in the same way as the\n    first passed promise to settle.\n  \n    Example:\n  \n    ```javascript\n    import Promise from 'rsvp';\n  \n    let promise1 = new Promise(function(resolve, reject){\n      setTimeout(function(){\n        resolve('promise 1');\n      }, 200);\n    });\n  \n    let promise2 = new Promise(function(resolve, reject){\n      setTimeout(function(){\n        resolve('promise 2');\n      }, 100);\n    });\n  \n    Promise.race([promise1, promise2]).then(function(result){\n      // result === 'promise 2' because it was resolved before promise1\n      // was resolved.\n    });\n    ```\n  \n    `Promise.race` is deterministic in that only the state of the first\n    settled promise matters. For example, even if other promises given to the\n    `promises` array argument are resolved, but the first settled promise has\n    become rejected before the other promises became fulfilled, the returned\n    promise will become rejected:\n  \n    ```javascript\n    import Promise from 'rsvp';\n  \n    let promise1 = new Promise(function(resolve, reject){\n      setTimeout(function(){\n        resolve('promise 1');\n      }, 200);\n    });\n  \n    let promise2 = new Promise(function(resolve, reject){\n      setTimeout(function(){\n        reject(new Error('promise 2'));\n      }, 100);\n    });\n  \n    Promise.race([promise1, promise2]).then(function(result){\n      // Code here never runs\n    }, function(reason){\n      // reason.message === 'promise 2' because promise 2 became rejected before\n      // promise 1 became fulfilled\n    });\n    ```\n  \n    An example real-world use case is implementing timeouts:\n  \n    ```javascript\n    import Promise from 'rsvp';\n  \n    Promise.race([ajax('foo.json'), timeout(5000)])\n    ```\n  \n    @method race\n    @for Promise\n    @static\n    @param {Array} entries array of promises to observe\n    @param {String} [label] optional string for describing the promise returned.\n    Useful for tooling.\n    @return {Promise} a promise which settles in the same way as the first passed\n    promise to settle.\n  */\n\n\n  function race(entries, label) {\n    /*jshint validthis:true */\n    var Constructor = this;\n    var promise = new Constructor(noop, label);\n\n    if (!Array.isArray(entries)) {\n      reject(promise, new TypeError('Promise.race must be called with an array'));\n      return promise;\n    }\n\n    for (var i = 0; promise._state === PENDING && i < entries.length; i++) {\n      subscribe(Constructor.resolve(entries[i]), undefined, value => resolve$1(promise, value), reason => reject(promise, reason));\n    }\n\n    return promise;\n  }\n  /**\n    `Promise.reject` returns a promise rejected with the passed `reason`.\n    It is shorthand for the following:\n  \n    ```javascript\n    import Promise from 'rsvp';\n  \n    let promise = new Promise(function(resolve, reject){\n      reject(new Error('WHOOPS'));\n    });\n  \n    promise.then(function(value){\n      // Code here doesn't run because the promise is rejected!\n    }, function(reason){\n      // reason.message === 'WHOOPS'\n    });\n    ```\n  \n    Instead of writing the above, your code now simply becomes the following:\n  \n    ```javascript\n    import Promise from 'rsvp';\n  \n    let promise = Promise.reject(new Error('WHOOPS'));\n  \n    promise.then(function(value){\n      // Code here doesn't run because the promise is rejected!\n    }, function(reason){\n      // reason.message === 'WHOOPS'\n    });\n    ```\n  \n    @method reject\n    @for Promise\n    @static\n    @param {*} reason value that the returned promise will be rejected with.\n    @param {String} [label] optional string for identifying the returned promise.\n    Useful for tooling.\n    @return {Promise} a promise rejected with the given `reason`.\n  */\n\n\n  function reject$1(reason, label) {\n    /*jshint validthis:true */\n    var Constructor = this;\n    var promise = new Constructor(noop, label);\n    reject(promise, reason);\n    return promise;\n  }\n\n  var guidKey = 'rsvp_' + Date.now() + '-';\n  var counter = 0;\n\n  function needsResolver() {\n    throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');\n  }\n\n  function needsNew() {\n    throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\");\n  }\n  /**\n    Promise objects represent the eventual result of an asynchronous operation. The\n    primary way of interacting with a promise is through its `then` method, which\n    registers callbacks to receive either a promise’s eventual value or the reason\n    why the promise cannot be fulfilled.\n  \n    Terminology\n    -----------\n  \n    - `promise` is an object or function with a `then` method whose behavior conforms to this specification.\n    - `thenable` is an object or function that defines a `then` method.\n    - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).\n    - `exception` is a value that is thrown using the throw statement.\n    - `reason` is a value that indicates why a promise was rejected.\n    - `settled` the final resting state of a promise, fulfilled or rejected.\n  \n    A promise can be in one of three states: pending, fulfilled, or rejected.\n  \n    Promises that are fulfilled have a fulfillment value and are in the fulfilled\n    state.  Promises that are rejected have a rejection reason and are in the\n    rejected state.  A fulfillment value is never a thenable.\n  \n    Promises can also be said to *resolve* a value.  If this value is also a\n    promise, then the original promise's settled state will match the value's\n    settled state.  So a promise that *resolves* a promise that rejects will\n    itself reject, and a promise that *resolves* a promise that fulfills will\n    itself fulfill.\n  \n  \n    Basic Usage:\n    ------------\n  \n    ```js\n    let promise = new Promise(function(resolve, reject) {\n      // on success\n      resolve(value);\n  \n      // on failure\n      reject(reason);\n    });\n  \n    promise.then(function(value) {\n      // on fulfillment\n    }, function(reason) {\n      // on rejection\n    });\n    ```\n  \n    Advanced Usage:\n    ---------------\n  \n    Promises shine when abstracting away asynchronous interactions such as\n    `XMLHttpRequest`s.\n  \n    ```js\n    function getJSON(url) {\n      return new Promise(function(resolve, reject){\n        let xhr = new XMLHttpRequest();\n  \n        xhr.open('GET', url);\n        xhr.onreadystatechange = handler;\n        xhr.responseType = 'json';\n        xhr.setRequestHeader('Accept', 'application/json');\n        xhr.send();\n  \n        function handler() {\n          if (this.readyState === this.DONE) {\n            if (this.status === 200) {\n              resolve(this.response);\n            } else {\n              reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));\n            }\n          }\n        };\n      });\n    }\n  \n    getJSON('/posts.json').then(function(json) {\n      // on fulfillment\n    }, function(reason) {\n      // on rejection\n    });\n    ```\n  \n    Unlike callbacks, promises are great composable primitives.\n  \n    ```js\n    Promise.all([\n      getJSON('/posts'),\n      getJSON('/comments')\n    ]).then(function(values){\n      values[0] // => postsJSON\n      values[1] // => commentsJSON\n  \n      return values;\n    });\n    ```\n  \n    @class Promise\n    @public\n    @param {function} resolver\n    @param {String} [label] optional string for labeling the promise.\n    Useful for tooling.\n    @constructor\n  */\n\n\n  class Promise {\n    constructor(resolver, label) {\n      this._id = counter++;\n      this._label = label;\n      this._state = undefined;\n      this._result = undefined;\n      this._subscribers = [];\n      config.instrument && instrument('created', this);\n\n      if (noop !== resolver) {\n        typeof resolver !== 'function' && needsResolver();\n        this instanceof Promise ? initializePromise(this, resolver) : needsNew();\n      }\n    }\n\n    _onError(reason) {\n      config.after(() => {\n        if (this._onError) {\n          config.trigger('error', reason, this._label);\n        }\n      });\n    }\n    /**\n      `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same\n      as the catch block of a try/catch statement.\n    \n      ```js\n      function findAuthor(){\n        throw new Error('couldn\\'t find that author');\n      }\n    \n      // synchronous\n      try {\n        findAuthor();\n      } catch(reason) {\n        // something went wrong\n      }\n    \n      // async with promises\n      findAuthor().catch(function(reason){\n        // something went wrong\n      });\n      ```\n    \n      @method catch\n      @param {Function} onRejection\n      @param {String} [label] optional string for labeling the promise.\n      Useful for tooling.\n      @return {Promise}\n    */\n\n\n    catch(onRejection, label) {\n      return this.then(undefined, onRejection, label);\n    }\n    /**\n      `finally` will be invoked regardless of the promise's fate just as native\n      try/catch/finally behaves\n    \n      Synchronous example:\n    \n      ```js\n      findAuthor() {\n        if (Math.random() > 0.5) {\n          throw new Error();\n        }\n        return new Author();\n      }\n    \n      try {\n        return findAuthor(); // succeed or fail\n      } catch(error) {\n        return findOtherAuthor();\n      } finally {\n        // always runs\n        // doesn't affect the return value\n      }\n      ```\n    \n      Asynchronous example:\n    \n      ```js\n      findAuthor().catch(function(reason){\n        return findOtherAuthor();\n      }).finally(function(){\n        // author was either found, or not\n      });\n      ```\n    \n      @method finally\n      @param {Function} callback\n      @param {String} [label] optional string for labeling the promise.\n      Useful for tooling.\n      @return {Promise}\n    */\n\n\n    finally(callback, label) {\n      var promise = this;\n      var constructor = promise.constructor;\n\n      if (typeof callback === 'function') {\n        return promise.then(value => constructor.resolve(callback()).then(() => value), reason => constructor.resolve(callback()).then(() => {\n          throw reason;\n        }));\n      }\n\n      return promise.then(callback, callback);\n    }\n\n  }\n\n  _exports.Promise = Promise;\n  Promise.cast = resolve$$1; // deprecated\n\n  Promise.all = all;\n  Promise.race = race;\n  Promise.resolve = resolve$$1;\n  Promise.reject = reject$1;\n  Promise.prototype._guidKey = guidKey;\n  /**\n    The primary way of interacting with a promise is through its `then` method,\n    which registers callbacks to receive either a promise's eventual value or the\n    reason why the promise cannot be fulfilled.\n  \n    ```js\n    findUser().then(function(user){\n      // user is available\n    }, function(reason){\n      // user is unavailable, and you are given the reason why\n    });\n    ```\n  \n    Chaining\n    --------\n  \n    The return value of `then` is itself a promise.  This second, 'downstream'\n    promise is resolved with the return value of the first promise's fulfillment\n    or rejection handler, or rejected if the handler throws an exception.\n  \n    ```js\n    findUser().then(function (user) {\n      return user.name;\n    }, function (reason) {\n      return 'default name';\n    }).then(function (userName) {\n      // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n      // will be `'default name'`\n    });\n  \n    findUser().then(function (user) {\n      throw new Error('Found user, but still unhappy');\n    }, function (reason) {\n      throw new Error('`findUser` rejected and we\\'re unhappy');\n    }).then(function (value) {\n      // never reached\n    }, function (reason) {\n      // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.\n      // If `findUser` rejected, `reason` will be '`findUser` rejected and we\\'re unhappy'.\n    });\n    ```\n    If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.\n  \n    ```js\n    findUser().then(function (user) {\n      throw new PedagogicalException('Upstream error');\n    }).then(function (value) {\n      // never reached\n    }).then(function (value) {\n      // never reached\n    }, function (reason) {\n      // The `PedgagocialException` is propagated all the way down to here\n    });\n    ```\n  \n    Assimilation\n    ------------\n  \n    Sometimes the value you want to propagate to a downstream promise can only be\n    retrieved asynchronously. This can be achieved by returning a promise in the\n    fulfillment or rejection handler. The downstream promise will then be pending\n    until the returned promise is settled. This is called *assimilation*.\n  \n    ```js\n    findUser().then(function (user) {\n      return findCommentsByAuthor(user);\n    }).then(function (comments) {\n      // The user's comments are now available\n    });\n    ```\n  \n    If the assimliated promise rejects, then the downstream promise will also reject.\n  \n    ```js\n    findUser().then(function (user) {\n      return findCommentsByAuthor(user);\n    }).then(function (comments) {\n      // If `findCommentsByAuthor` fulfills, we'll have the value here\n    }, function (reason) {\n      // If `findCommentsByAuthor` rejects, we'll have the reason here\n    });\n    ```\n  \n    Simple Example\n    --------------\n  \n    Synchronous Example\n  \n    ```javascript\n    let result;\n  \n    try {\n      result = findResult();\n      // success\n    } catch(reason) {\n      // failure\n    }\n    ```\n  \n    Errback Example\n  \n    ```js\n    findResult(function(result, err){\n      if (err) {\n        // failure\n      } else {\n        // success\n      }\n    });\n    ```\n  \n    Promise Example;\n  \n    ```javascript\n    findResult().then(function(result){\n      // success\n    }, function(reason){\n      // failure\n    });\n    ```\n  \n    Advanced Example\n    --------------\n  \n    Synchronous Example\n  \n    ```javascript\n    let author, books;\n  \n    try {\n      author = findAuthor();\n      books  = findBooksByAuthor(author);\n      // success\n    } catch(reason) {\n      // failure\n    }\n    ```\n  \n    Errback Example\n  \n    ```js\n  \n    function foundBooks(books) {\n  \n    }\n  \n    function failure(reason) {\n  \n    }\n  \n    findAuthor(function(author, err){\n      if (err) {\n        failure(err);\n        // failure\n      } else {\n        try {\n          findBoooksByAuthor(author, function(books, err) {\n            if (err) {\n              failure(err);\n            } else {\n              try {\n                foundBooks(books);\n              } catch(reason) {\n                failure(reason);\n              }\n            }\n          });\n        } catch(error) {\n          failure(err);\n        }\n        // success\n      }\n    });\n    ```\n  \n    Promise Example;\n  \n    ```javascript\n    findAuthor().\n      then(findBooksByAuthor).\n      then(function(books){\n        // found books\n    }).catch(function(reason){\n      // something went wrong\n    });\n    ```\n  \n    @method then\n    @param {Function} onFulfillment\n    @param {Function} onRejection\n    @param {String} [label] optional string for labeling the promise.\n    Useful for tooling.\n    @return {Promise}\n  */\n\n  Promise.prototype.then = then;\n\n  function makeObject(_, argumentNames) {\n    var obj = {};\n    var length = _.length;\n    var args = new Array(length);\n\n    for (var x = 0; x < length; x++) {\n      args[x] = _[x];\n    }\n\n    for (var i = 0; i < argumentNames.length; i++) {\n      var name = argumentNames[i];\n      obj[name] = args[i + 1];\n    }\n\n    return obj;\n  }\n\n  function arrayResult(_) {\n    var length = _.length;\n    var args = new Array(length - 1);\n\n    for (var i = 1; i < length; i++) {\n      args[i - 1] = _[i];\n    }\n\n    return args;\n  }\n\n  function wrapThenable(then, promise) {\n    return {\n      then(onFulFillment, onRejection) {\n        return then.call(promise, onFulFillment, onRejection);\n      }\n\n    };\n  }\n  /**\n    `denodeify` takes a 'node-style' function and returns a function that\n    will return an `Promise`. You can use `denodeify` in Node.js or the\n    browser when you'd prefer to use promises over using callbacks. For example,\n    `denodeify` transforms the following:\n  \n    ```javascript\n    let fs = require('fs');\n  \n    fs.readFile('myfile.txt', function(err, data){\n      if (err) return handleError(err);\n      handleData(data);\n    });\n    ```\n  \n    into:\n  \n    ```javascript\n    let fs = require('fs');\n    let readFile = denodeify(fs.readFile);\n  \n    readFile('myfile.txt').then(handleData, handleError);\n    ```\n  \n    If the node function has multiple success parameters, then `denodeify`\n    just returns the first one:\n  \n    ```javascript\n    let request = denodeify(require('request'));\n  \n    request('http://example.com').then(function(res) {\n      // ...\n    });\n    ```\n  \n    However, if you need all success parameters, setting `denodeify`'s\n    second parameter to `true` causes it to return all success parameters\n    as an array:\n  \n    ```javascript\n    let request = denodeify(require('request'), true);\n  \n    request('http://example.com').then(function(result) {\n      // result[0] -> res\n      // result[1] -> body\n    });\n    ```\n  \n    Or if you pass it an array with names it returns the parameters as a hash:\n  \n    ```javascript\n    let request = denodeify(require('request'), ['res', 'body']);\n  \n    request('http://example.com').then(function(result) {\n      // result.res\n      // result.body\n    });\n    ```\n  \n    Sometimes you need to retain the `this`:\n  \n    ```javascript\n    let app = require('express')();\n    let render = denodeify(app.render.bind(app));\n    ```\n  \n    The denodified function inherits from the original function. It works in all\n    environments, except IE 10 and below. Consequently all properties of the original\n    function are available to you. However, any properties you change on the\n    denodeified function won't be changed on the original function. Example:\n  \n    ```javascript\n    let request = denodeify(require('request')),\n        cookieJar = request.jar(); // <- Inheritance is used here\n  \n    request('http://example.com', {jar: cookieJar}).then(function(res) {\n      // cookieJar.cookies holds now the cookies returned by example.com\n    });\n    ```\n  \n    Using `denodeify` makes it easier to compose asynchronous operations instead\n    of using callbacks. For example, instead of:\n  \n    ```javascript\n    let fs = require('fs');\n  \n    fs.readFile('myfile.txt', function(err, data){\n      if (err) { ... } // Handle error\n      fs.writeFile('myfile2.txt', data, function(err){\n        if (err) { ... } // Handle error\n        console.log('done')\n      });\n    });\n    ```\n  \n    you can chain the operations together using `then` from the returned promise:\n  \n    ```javascript\n    let fs = require('fs');\n    let readFile = denodeify(fs.readFile);\n    let writeFile = denodeify(fs.writeFile);\n  \n    readFile('myfile.txt').then(function(data){\n      return writeFile('myfile2.txt', data);\n    }).then(function(){\n      console.log('done')\n    }).catch(function(error){\n      // Handle error\n    });\n    ```\n  \n    @method denodeify\n    @public\n    @static\n    @for rsvp\n    @param {Function} nodeFunc a 'node-style' function that takes a callback as\n    its last argument. The callback expects an error to be passed as its first\n    argument (if an error occurred, otherwise null), and the value from the\n    operation as its second argument ('function(err, value){ }').\n    @param {Boolean|Array} [options] An optional paramter that if set\n    to `true` causes the promise to fulfill with the callback's success arguments\n    as an array. This is useful if the node function has multiple success\n    paramters. If you set this paramter to an array with names, the promise will\n    fulfill with a hash with these names as keys and the success parameters as\n    values.\n    @return {Function} a function that wraps `nodeFunc` to return a `Promise`\n  */\n\n\n  function denodeify(nodeFunc, options) {\n    var fn = function () {\n      var l = arguments.length;\n      var args = new Array(l + 1);\n      var promiseInput = false;\n\n      for (var i = 0; i < l; ++i) {\n        var arg = arguments[i]; // TODO: this code really needs to be cleaned up\n\n        if (!promiseInput) {\n          if (arg !== null && typeof arg === 'object') {\n            if (arg.constructor === Promise) {\n              promiseInput = true;\n            } else {\n              try {\n                promiseInput = arg.then;\n              } catch (error) {\n                var p = new Promise(noop);\n                reject(p, error);\n                return p;\n              }\n            }\n          } else {\n            promiseInput = false;\n          }\n\n          if (promiseInput && promiseInput !== true) {\n            arg = wrapThenable(promiseInput, arg);\n          }\n        }\n\n        args[i] = arg;\n      }\n\n      var promise = new Promise(noop);\n\n      args[l] = function (err, val) {\n        if (err) {\n          reject(promise, err);\n        } else if (options === undefined) {\n          resolve$1(promise, val);\n        } else if (options === true) {\n          resolve$1(promise, arrayResult(arguments));\n        } else if (Array.isArray(options)) {\n          resolve$1(promise, makeObject(arguments, options));\n        } else {\n          resolve$1(promise, val);\n        }\n      };\n\n      if (promiseInput) {\n        return handlePromiseInput(promise, args, nodeFunc, this);\n      } else {\n        return handleValueInput(promise, args, nodeFunc, this);\n      }\n    };\n\n    fn.__proto__ = nodeFunc;\n    return fn;\n  }\n\n  function handleValueInput(promise, args, nodeFunc, self) {\n    try {\n      nodeFunc.apply(self, args);\n    } catch (error) {\n      reject(promise, error);\n    }\n\n    return promise;\n  }\n\n  function handlePromiseInput(promise, args, nodeFunc, self) {\n    return Promise.all(args).then(args => handleValueInput(promise, args, nodeFunc, self));\n  }\n  /**\n    This is a convenient alias for `Promise.all`.\n  \n    @method all\n    @public\n    @static\n    @for rsvp\n    @param {Array} array Array of promises.\n    @param {String} [label] An optional label. This is useful\n    for tooling.\n  */\n\n\n  function all$1(array, label) {\n    return Promise.all(array, label);\n  }\n  /**\n  @module rsvp\n  @public\n  **/\n\n\n  class AllSettled extends Enumerator {\n    constructor(Constructor, entries, label) {\n      super(Constructor, entries, false\n      /* don't abort on reject */\n      , label);\n    }\n\n  }\n\n  AllSettled.prototype._setResultAt = setSettledResult;\n  /**\n  `RSVP.allSettled` is similar to `RSVP.all`, but instead of implementing\n  a fail-fast method, it waits until all the promises have returned and\n  shows you all the results. This is useful if you want to handle multiple\n  promises' failure states together as a set.\n   Returns a promise that is fulfilled when all the given promises have been\n  settled. The return promise is fulfilled with an array of the states of\n  the promises passed into the `promises` array argument.\n   Each state object will either indicate fulfillment or rejection, and\n  provide the corresponding value or reason. The states will take one of\n  the following formats:\n   ```javascript\n  { state: 'fulfilled', value: value }\n    or\n  { state: 'rejected', reason: reason }\n  ```\n   Example:\n   ```javascript\n  let promise1 = RSVP.Promise.resolve(1);\n  let promise2 = RSVP.Promise.reject(new Error('2'));\n  let promise3 = RSVP.Promise.reject(new Error('3'));\n  let promises = [ promise1, promise2, promise3 ];\n   RSVP.allSettled(promises).then(function(array){\n    // array == [\n    //   { state: 'fulfilled', value: 1 },\n    //   { state: 'rejected', reason: Error },\n    //   { state: 'rejected', reason: Error }\n    // ]\n    // Note that for the second item, reason.message will be '2', and for the\n    // third item, reason.message will be '3'.\n  }, function(error) {\n    // Not run. (This block would only be called if allSettled had failed,\n    // for instance if passed an incorrect argument type.)\n  });\n  ```\n   @method allSettled\n  @public\n  @static\n  @for rsvp\n  @param {Array} entries\n  @param {String} [label] - optional string that describes the promise.\n  Useful for tooling.\n  @return {Promise} promise that is fulfilled with an array of the settled\n  states of the constituent promises.\n  */\n\n  function allSettled(entries, label) {\n    if (!Array.isArray(entries)) {\n      return Promise.reject(new TypeError(\"Promise.allSettled must be called with an array\"), label);\n    }\n\n    return new AllSettled(Promise, entries, label).promise;\n  }\n  /**\n    This is a convenient alias for `Promise.race`.\n  \n    @method race\n    @public\n    @static\n    @for rsvp\n    @param {Array} array Array of promises.\n    @param {String} [label] An optional label. This is useful\n    for tooling.\n   */\n\n\n  function race$1(array, label) {\n    return Promise.race(array, label);\n  }\n\n  class PromiseHash extends Enumerator {\n    constructor(Constructor, object, abortOnReject = true, label) {\n      super(Constructor, object, abortOnReject, label);\n    }\n\n    _init(Constructor, object) {\n      this._result = {};\n\n      this._enumerate(object);\n    }\n\n    _enumerate(input) {\n      var keys = Object.keys(input);\n      var length = keys.length;\n      var promise = this.promise;\n      this._remaining = length;\n      var key, val;\n\n      for (var i = 0; promise._state === PENDING && i < length; i++) {\n        key = keys[i];\n        val = input[key];\n\n        this._eachEntry(val, key, true);\n      }\n\n      this._checkFullfillment();\n    }\n\n  }\n  /**\n    `hash` is similar to `all`, but takes an object instead of an array\n    for its `promises` argument.\n  \n    Returns a promise that is fulfilled when all the given promises have been\n    fulfilled, or rejected if any of them become rejected. The returned promise\n    is fulfilled with a hash that has the same key names as the `promises` object\n    argument. If any of the values in the object are not promises, they will\n    simply be copied over to the fulfilled object.\n  \n    Example:\n  \n    ```javascript\n    let promises = {\n      myPromise: resolve(1),\n      yourPromise: resolve(2),\n      theirPromise: resolve(3),\n      notAPromise: 4\n    };\n  \n    hash(promises).then(function(hash){\n      // hash here is an object that looks like:\n      // {\n      //   myPromise: 1,\n      //   yourPromise: 2,\n      //   theirPromise: 3,\n      //   notAPromise: 4\n      // }\n    });\n    ```\n  \n    If any of the `promises` given to `hash` are rejected, the first promise\n    that is rejected will be given as the reason to the rejection handler.\n  \n    Example:\n  \n    ```javascript\n    let promises = {\n      myPromise: resolve(1),\n      rejectedPromise: reject(new Error('rejectedPromise')),\n      anotherRejectedPromise: reject(new Error('anotherRejectedPromise')),\n    };\n  \n    hash(promises).then(function(hash){\n      // Code here never runs because there are rejected promises!\n    }, function(reason) {\n      // reason.message === 'rejectedPromise'\n    });\n    ```\n  \n    An important note: `hash` is intended for plain JavaScript objects that\n    are just a set of keys and values. `hash` will NOT preserve prototype\n    chains.\n  \n    Example:\n  \n    ```javascript\n    import { hash, resolve } from 'rsvp';\n    function MyConstructor(){\n      this.example = resolve('Example');\n    }\n  \n    MyConstructor.prototype = {\n      protoProperty: resolve('Proto Property')\n    };\n  \n    let myObject = new MyConstructor();\n  \n    hash(myObject).then(function(hash){\n      // protoProperty will not be present, instead you will just have an\n      // object that looks like:\n      // {\n      //   example: 'Example'\n      // }\n      //\n      // hash.hasOwnProperty('protoProperty'); // false\n      // 'undefined' === typeof hash.protoProperty\n    });\n    ```\n  \n    @method hash\n    @public\n    @static\n    @for rsvp\n    @param {Object} object\n    @param {String} [label] optional string that describes the promise.\n    Useful for tooling.\n    @return {Promise} promise that is fulfilled when all properties of `promises`\n    have been fulfilled, or rejected if any of them become rejected.\n  */\n\n\n  function hash(object, label) {\n    return Promise.resolve(object, label).then(function (object) {\n      if (object === null || typeof object !== 'object') {\n        throw new TypeError(\"Promise.hash must be called with an object\");\n      }\n\n      return new PromiseHash(Promise, object, label).promise;\n    });\n  }\n\n  class HashSettled extends PromiseHash {\n    constructor(Constructor, object, label) {\n      super(Constructor, object, false, label);\n    }\n\n  }\n\n  HashSettled.prototype._setResultAt = setSettledResult;\n  /**\n    `hashSettled` is similar to `allSettled`, but takes an object\n    instead of an array for its `promises` argument.\n  \n    Unlike `all` or `hash`, which implement a fail-fast method,\n    but like `allSettled`, `hashSettled` waits until all the\n    constituent promises have returned and then shows you all the results\n    with their states and values/reasons. This is useful if you want to\n    handle multiple promises' failure states together as a set.\n  \n    Returns a promise that is fulfilled when all the given promises have been\n    settled, or rejected if the passed parameters are invalid.\n  \n    The returned promise is fulfilled with a hash that has the same key names as\n    the `promises` object argument. If any of the values in the object are not\n    promises, they will be copied over to the fulfilled object and marked with state\n    'fulfilled'.\n  \n    Example:\n  \n    ```javascript\n    import { hashSettled, resolve } from 'rsvp';\n  \n    let promises = {\n      myPromise: resolve(1),\n      yourPromise: resolve(2),\n      theirPromise: resolve(3),\n      notAPromise: 4\n    };\n  \n    hashSettled(promises).then(function(hash){\n      // hash here is an object that looks like:\n      // {\n      //   myPromise: { state: 'fulfilled', value: 1 },\n      //   yourPromise: { state: 'fulfilled', value: 2 },\n      //   theirPromise: { state: 'fulfilled', value: 3 },\n      //   notAPromise: { state: 'fulfilled', value: 4 }\n      // }\n    });\n    ```\n  \n    If any of the `promises` given to `hash` are rejected, the state will\n    be set to 'rejected' and the reason for rejection provided.\n  \n    Example:\n  \n    ```javascript\n    import { hashSettled, reject, resolve } from 'rsvp';\n  \n    let promises = {\n      myPromise: resolve(1),\n      rejectedPromise: reject(new Error('rejection')),\n      anotherRejectedPromise: reject(new Error('more rejection')),\n    };\n  \n    hashSettled(promises).then(function(hash){\n      // hash here is an object that looks like:\n      // {\n      //   myPromise:              { state: 'fulfilled', value: 1 },\n      //   rejectedPromise:        { state: 'rejected', reason: Error },\n      //   anotherRejectedPromise: { state: 'rejected', reason: Error },\n      // }\n      // Note that for rejectedPromise, reason.message == 'rejection',\n      // and for anotherRejectedPromise, reason.message == 'more rejection'.\n    });\n    ```\n  \n    An important note: `hashSettled` is intended for plain JavaScript objects that\n    are just a set of keys and values. `hashSettled` will NOT preserve prototype\n    chains.\n  \n    Example:\n  \n    ```javascript\n    import Promise, { hashSettled, resolve } from 'rsvp';\n  \n    function MyConstructor(){\n      this.example = resolve('Example');\n    }\n  \n    MyConstructor.prototype = {\n      protoProperty: Promise.resolve('Proto Property')\n    };\n  \n    let myObject = new MyConstructor();\n  \n    hashSettled(myObject).then(function(hash){\n      // protoProperty will not be present, instead you will just have an\n      // object that looks like:\n      // {\n      //   example: { state: 'fulfilled', value: 'Example' }\n      // }\n      //\n      // hash.hasOwnProperty('protoProperty'); // false\n      // 'undefined' === typeof hash.protoProperty\n    });\n    ```\n  \n    @method hashSettled\n    @public\n    @for rsvp\n    @param {Object} object\n    @param {String} [label] optional string that describes the promise.\n    Useful for tooling.\n    @return {Promise} promise that is fulfilled when when all properties of `promises`\n    have been settled.\n    @static\n  */\n\n  function hashSettled(object, label) {\n    return Promise.resolve(object, label).then(function (object) {\n      if (object === null || typeof object !== 'object') {\n        throw new TypeError(\"hashSettled must be called with an object\");\n      }\n\n      return new HashSettled(Promise, object, false, label).promise;\n    });\n  }\n  /**\n    `rethrow` will rethrow an error on the next turn of the JavaScript event\n    loop in order to aid debugging.\n  \n    Promises A+ specifies that any exceptions that occur with a promise must be\n    caught by the promises implementation and bubbled to the last handler. For\n    this reason, it is recommended that you always specify a second rejection\n    handler function to `then`. However, `rethrow` will throw the exception\n    outside of the promise, so it bubbles up to your console if in the browser,\n    or domain/cause uncaught exception in Node. `rethrow` will also throw the\n    error again so the error can be handled by the promise per the spec.\n  \n    ```javascript\n    import { rethrow } from 'rsvp';\n  \n    function throws(){\n      throw new Error('Whoops!');\n    }\n  \n    let promise = new Promise(function(resolve, reject){\n      throws();\n    });\n  \n    promise.catch(rethrow).then(function(){\n      // Code here doesn't run because the promise became rejected due to an\n      // error!\n    }, function (err){\n      // handle the error here\n    });\n    ```\n  \n    The 'Whoops' error will be thrown on the next turn of the event loop\n    and you can watch for it in your console. You can also handle it using a\n    rejection handler given to `.then` or `.catch` on the returned promise.\n  \n    @method rethrow\n    @public\n    @static\n    @for rsvp\n    @param {Error} reason reason the promise became rejected.\n    @throws Error\n    @static\n  */\n\n\n  function rethrow(reason) {\n    setTimeout(() => {\n      throw reason;\n    });\n    throw reason;\n  }\n  /**\n    `defer` returns an object similar to jQuery's `$.Deferred`.\n    `defer` should be used when porting over code reliant on `$.Deferred`'s\n    interface. New code should use the `Promise` constructor instead.\n  \n    The object returned from `defer` is a plain object with three properties:\n  \n    * promise - an `Promise`.\n    * reject - a function that causes the `promise` property on this object to\n      become rejected\n    * resolve - a function that causes the `promise` property on this object to\n      become fulfilled.\n  \n    Example:\n  \n     ```javascript\n     let deferred = defer();\n  \n     deferred.resolve(\"Success!\");\n  \n     deferred.promise.then(function(value){\n       // value here is \"Success!\"\n     });\n     ```\n  \n    @method defer\n    @public\n    @static\n    @for rsvp\n    @param {String} [label] optional string for labeling the promise.\n    Useful for tooling.\n    @return {Object}\n   */\n\n\n  function defer(label) {\n    var deferred = {\n      resolve: undefined,\n      reject: undefined\n    };\n    deferred.promise = new Promise((resolve, reject) => {\n      deferred.resolve = resolve;\n      deferred.reject = reject;\n    }, label);\n    return deferred;\n  }\n\n  class MapEnumerator extends Enumerator {\n    constructor(Constructor, entries, mapFn, label) {\n      super(Constructor, entries, true, label, mapFn);\n    }\n\n    _init(Constructor, input, bool, label, mapFn) {\n      var len = input.length || 0;\n      this.length = len;\n      this._remaining = len;\n      this._result = new Array(len);\n      this._mapFn = mapFn;\n\n      this._enumerate(input);\n    }\n\n    _setResultAt(state, i, value, firstPass) {\n      if (firstPass) {\n        try {\n          this._eachEntry(this._mapFn(value, i), i, false);\n        } catch (error) {\n          this._settledAt(REJECTED, i, error, false);\n        }\n      } else {\n        this._remaining--;\n        this._result[i] = value;\n      }\n    }\n\n  }\n  /**\n   `map` is similar to JavaScript's native `map` method. `mapFn` is eagerly called\n    meaning that as soon as any promise resolves its value will be passed to `mapFn`.\n    `map` returns a promise that will become fulfilled with the result of running\n    `mapFn` on the values the promises become fulfilled with.\n  \n    For example:\n  \n    ```javascript\n    import { map, resolve } from 'rsvp';\n  \n    let promise1 = resolve(1);\n    let promise2 = resolve(2);\n    let promise3 = resolve(3);\n    let promises = [ promise1, promise2, promise3 ];\n  \n    let mapFn = function(item){\n      return item + 1;\n    };\n  \n    map(promises, mapFn).then(function(result){\n      // result is [ 2, 3, 4 ]\n    });\n    ```\n  \n    If any of the `promises` given to `map` are rejected, the first promise\n    that is rejected will be given as an argument to the returned promise's\n    rejection handler. For example:\n  \n    ```javascript\n    import { map, reject, resolve } from 'rsvp';\n  \n    let promise1 = resolve(1);\n    let promise2 = reject(new Error('2'));\n    let promise3 = reject(new Error('3'));\n    let promises = [ promise1, promise2, promise3 ];\n  \n    let mapFn = function(item){\n      return item + 1;\n    };\n  \n    map(promises, mapFn).then(function(array){\n      // Code here never runs because there are rejected promises!\n    }, function(reason) {\n      // reason.message === '2'\n    });\n    ```\n  \n    `map` will also wait if a promise is returned from `mapFn`. For example,\n    say you want to get all comments from a set of blog posts, but you need\n    the blog posts first because they contain a url to those comments.\n  \n    ```javscript\n    import { map } from 'rsvp';\n  \n    let mapFn = function(blogPost){\n      // getComments does some ajax and returns an Promise that is fulfilled\n      // with some comments data\n      return getComments(blogPost.comments_url);\n    };\n  \n    // getBlogPosts does some ajax and returns an Promise that is fulfilled\n    // with some blog post data\n    map(getBlogPosts(), mapFn).then(function(comments){\n      // comments is the result of asking the server for the comments\n      // of all blog posts returned from getBlogPosts()\n    });\n    ```\n  \n    @method map\n    @public\n    @static\n    @for rsvp\n    @param {Array} promises\n    @param {Function} mapFn function to be called on each fulfilled promise.\n    @param {String} [label] optional string for labeling the promise.\n    Useful for tooling.\n    @return {Promise} promise that is fulfilled with the result of calling\n    `mapFn` on each fulfilled promise or value when they become fulfilled.\n     The promise will be rejected if any of the given `promises` become rejected.\n  */\n\n\n  function map(promises, mapFn, label) {\n    if (typeof mapFn !== 'function') {\n      return Promise.reject(new TypeError(\"map expects a function as a second argument\"), label);\n    }\n\n    return Promise.resolve(promises, label).then(function (promises) {\n      if (!Array.isArray(promises)) {\n        throw new TypeError(\"map must be called with an array\");\n      }\n\n      return new MapEnumerator(Promise, promises, mapFn, label).promise;\n    });\n  }\n  /**\n    This is a convenient alias for `Promise.resolve`.\n  \n    @method resolve\n    @public\n    @static\n    @for rsvp\n    @param {*} value value that the returned promise will be resolved with\n    @param {String} [label] optional string for identifying the returned promise.\n    Useful for tooling.\n    @return {Promise} a promise that will become fulfilled with the given\n    `value`\n  */\n\n\n  function resolve$2(value, label) {\n    return Promise.resolve(value, label);\n  }\n  /**\n    This is a convenient alias for `Promise.reject`.\n  \n    @method reject\n    @public\n    @static\n    @for rsvp\n    @param {*} reason value that the returned promise will be rejected with.\n    @param {String} [label] optional string for identifying the returned promise.\n    Useful for tooling.\n    @return {Promise} a promise rejected with the given `reason`.\n  */\n\n\n  function reject$2(reason, label) {\n    return Promise.reject(reason, label);\n  }\n\n  var EMPTY_OBJECT = {};\n\n  class FilterEnumerator extends MapEnumerator {\n    _checkFullfillment() {\n      if (this._remaining === 0 && this._result !== null) {\n        var result = this._result.filter(val => val !== EMPTY_OBJECT);\n\n        fulfill(this.promise, result);\n        this._result = null;\n      }\n    }\n\n    _setResultAt(state, i, value, firstPass) {\n      if (firstPass) {\n        this._result[i] = value;\n        var val,\n            succeeded = true;\n\n        try {\n          val = this._mapFn(value, i);\n        } catch (error) {\n          succeeded = false;\n\n          this._settledAt(REJECTED, i, error, false);\n        }\n\n        if (succeeded) {\n          this._eachEntry(val, i, false);\n        }\n      } else {\n        this._remaining--;\n\n        if (!value) {\n          this._result[i] = EMPTY_OBJECT;\n        }\n      }\n    }\n\n  }\n  /**\n   `filter` is similar to JavaScript's native `filter` method.\n   `filterFn` is eagerly called meaning that as soon as any promise\n    resolves its value will be passed to `filterFn`. `filter` returns\n    a promise that will become fulfilled with the result of running\n    `filterFn` on the values the promises become fulfilled with.\n  \n    For example:\n  \n    ```javascript\n    import { filter, resolve } from 'rsvp';\n  \n    let promise1 = resolve(1);\n    let promise2 = resolve(2);\n    let promise3 = resolve(3);\n  \n    let promises = [promise1, promise2, promise3];\n  \n    let filterFn = function(item){\n      return item > 1;\n    };\n  \n    filter(promises, filterFn).then(function(result){\n      // result is [ 2, 3 ]\n    });\n    ```\n  \n    If any of the `promises` given to `filter` are rejected, the first promise\n    that is rejected will be given as an argument to the returned promise's\n    rejection handler. For example:\n  \n    ```javascript\n    import { filter, reject, resolve } from 'rsvp';\n  \n    let promise1 = resolve(1);\n    let promise2 = reject(new Error('2'));\n    let promise3 = reject(new Error('3'));\n    let promises = [ promise1, promise2, promise3 ];\n  \n    let filterFn = function(item){\n      return item > 1;\n    };\n  \n    filter(promises, filterFn).then(function(array){\n      // Code here never runs because there are rejected promises!\n    }, function(reason) {\n      // reason.message === '2'\n    });\n    ```\n  \n    `filter` will also wait for any promises returned from `filterFn`.\n    For instance, you may want to fetch a list of users then return a subset\n    of those users based on some asynchronous operation:\n  \n    ```javascript\n    import { filter, resolve } from 'rsvp';\n  \n    let alice = { name: 'alice' };\n    let bob   = { name: 'bob' };\n    let users = [ alice, bob ];\n  \n    let promises = users.map(function(user){\n      return resolve(user);\n    });\n  \n    let filterFn = function(user){\n      // Here, Alice has permissions to create a blog post, but Bob does not.\n      return getPrivilegesForUser(user).then(function(privs){\n        return privs.can_create_blog_post === true;\n      });\n    };\n    filter(promises, filterFn).then(function(users){\n      // true, because the server told us only Alice can create a blog post.\n      users.length === 1;\n      // false, because Alice is the only user present in `users`\n      users[0] === bob;\n    });\n    ```\n  \n    @method filter\n    @public\n    @static\n    @for rsvp\n    @param {Array} promises\n    @param {Function} filterFn - function to be called on each resolved value to\n    filter the final results.\n    @param {String} [label] optional string describing the promise. Useful for\n    tooling.\n    @return {Promise}\n  */\n\n\n  function filter(promises, filterFn, label) {\n    if (typeof filterFn !== 'function') {\n      return Promise.reject(new TypeError(\"filter expects function as a second argument\"), label);\n    }\n\n    return Promise.resolve(promises, label).then(function (promises) {\n      if (!Array.isArray(promises)) {\n        throw new TypeError(\"filter must be called with an array\");\n      }\n\n      return new FilterEnumerator(Promise, promises, filterFn, label).promise;\n    });\n  }\n\n  var len = 0;\n  var vertxNext;\n\n  function asap(callback, arg) {\n    queue$1[len] = callback;\n    queue$1[len + 1] = arg;\n    len += 2;\n\n    if (len === 2) {\n      // If len is 1, that means that we need to schedule an async flush.\n      // If additional callbacks are queued before the queue is flushed, they\n      // will be processed by this flush that we are scheduling.\n      scheduleFlush$1();\n    }\n  }\n\n  var browserWindow = typeof window !== 'undefined' ? window : undefined;\n  var browserGlobal = browserWindow || {};\n  var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;\n  var isNode = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]'; // test for web worker but not in IE10\n\n  var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined'; // node\n\n  function useNextTick() {\n    var nextTick = process.nextTick; // node version 0.10.x displays a deprecation warning when nextTick is used recursively\n    // setImmediate should be used instead instead\n\n    var version = process.versions.node.match(/^(?:(\\d+)\\.)?(?:(\\d+)\\.)?(\\*|\\d+)$/);\n\n    if (Array.isArray(version) && version[1] === '0' && version[2] === '10') {\n      nextTick = setImmediate;\n    }\n\n    return () => nextTick(flush);\n  } // vertx\n\n\n  function useVertxTimer() {\n    if (typeof vertxNext !== 'undefined') {\n      return function () {\n        vertxNext(flush);\n      };\n    }\n\n    return useSetTimeout();\n  }\n\n  function useMutationObserver() {\n    var iterations = 0;\n    var observer = new BrowserMutationObserver(flush);\n    var node = document.createTextNode('');\n    observer.observe(node, {\n      characterData: true\n    });\n    return () => node.data = iterations = ++iterations % 2;\n  } // web worker\n\n\n  function useMessageChannel() {\n    var channel = new MessageChannel();\n    channel.port1.onmessage = flush;\n    return () => channel.port2.postMessage(0);\n  }\n\n  function useSetTimeout() {\n    return () => setTimeout(flush, 1);\n  }\n\n  var queue$1 = new Array(1000);\n\n  function flush() {\n    for (var i = 0; i < len; i += 2) {\n      var callback = queue$1[i];\n      var arg = queue$1[i + 1];\n      callback(arg);\n      queue$1[i] = undefined;\n      queue$1[i + 1] = undefined;\n    }\n\n    len = 0;\n  }\n\n  function attemptVertex() {\n    try {\n      var vertx = Function('return this')().require('vertx');\n\n      vertxNext = vertx.runOnLoop || vertx.runOnContext;\n      return useVertxTimer();\n    } catch (e) {\n      return useSetTimeout();\n    }\n  }\n\n  var scheduleFlush$1; // Decide what async method to use to triggering processing of queued callbacks:\n\n  if (isNode) {\n    scheduleFlush$1 = useNextTick();\n  } else if (BrowserMutationObserver) {\n    scheduleFlush$1 = useMutationObserver();\n  } else if (isWorker) {\n    scheduleFlush$1 = useMessageChannel();\n  } else if (browserWindow === undefined && typeof require === 'function') {\n    scheduleFlush$1 = attemptVertex();\n  } else {\n    scheduleFlush$1 = useSetTimeout();\n  } // defaults\n\n\n  config.async = asap;\n\n  config.after = cb => setTimeout(cb, 0);\n\n  var cast = resolve$2;\n  _exports.cast = cast;\n\n  var async = (callback, arg) => config.async(callback, arg);\n\n  _exports.async = async;\n\n  function on() {\n    config.on(...arguments);\n  }\n\n  function off() {\n    config.off(...arguments);\n  } // Set up instrumentation through `window.__PROMISE_INTRUMENTATION__`\n\n\n  if (typeof window !== 'undefined' && typeof window['__PROMISE_INSTRUMENTATION__'] === 'object') {\n    var callbacks = window['__PROMISE_INSTRUMENTATION__'];\n    configure('instrument', true);\n\n    for (var eventName in callbacks) {\n      if (callbacks.hasOwnProperty(eventName)) {\n        on(eventName, callbacks[eventName]);\n      }\n    }\n  } // the default export here is for backwards compat:\n  //   https://github.com/tildeio/rsvp.js/issues/434\n\n\n  var rsvp = {\n    asap,\n    cast,\n    Promise,\n    EventTarget,\n    all: all$1,\n    allSettled,\n    race: race$1,\n    hash,\n    hashSettled,\n    rethrow,\n    defer,\n    denodeify,\n    configure,\n    on,\n    off,\n    resolve: resolve$2,\n    reject: reject$2,\n    map,\n    async,\n    filter\n  };\n  var _default = rsvp;\n  _exports.default = _default;\n});","(function () {\n  function vendorModule() {\n    'use strict';\n\n    return {\n      'default': self['jQuery'],\n      __esModule: true\n    };\n  }\n\n  define('jquery', [], vendorModule);\n})();","(function () {\n  Ember.Component.reopen({\n    $(sel) {\n      (true && !(this.tagName !== '') && Ember.assert(\"You cannot access this.$() on a component with `tagName: ''` specified.\", this.tagName !== ''));\n      (true && !(false) && Ember.deprecate('Using this.$() in a component has been deprecated, consider using this.element', false, {\n        id: 'ember-views.curly-components.jquery-element',\n        until: '4.0.0',\n        url: 'https://emberjs.com/deprecations/v3.x#toc_jquery-apis'\n      }));\n\n      if (this.element) {\n        return sel ? jQuery(sel, this.element) : jQuery(this.element);\n      }\n    }\n\n  });\n})();","/*globals jQuery, define, module, exports, require, window, document, postMessage */\n(function (factory) {\n\t\"use strict\";\n\tif (typeof define === 'function' && define.amd) {\n\t\tdefine(['jquery'], factory);\n\t}\n\telse if(typeof module !== 'undefined' && module.exports) {\n\t\tmodule.exports = factory(require('jquery'));\n\t}\n\telse {\n\t\tfactory(jQuery);\n\t}\n}(function ($, undefined) {\n\t\"use strict\";\n/*!\n * jsTree 3.3.8\n * http://jstree.com/\n *\n * Copyright (c) 2014 Ivan Bozhanov (http://vakata.com)\n *\n * Licensed same as jquery - under the terms of the MIT License\n *   http://www.opensource.org/licenses/mit-license.php\n */\n/*!\n * if using jslint please allow for the jQuery global and use following options:\n * jslint: loopfunc: true, browser: true, ass: true, bitwise: true, continue: true, nomen: true, plusplus: true, regexp: true, unparam: true, todo: true, white: true\n */\n/*jshint -W083 */\n\n\t// prevent another load? maybe there is a better way?\n\tif($.jstree) {\n\t\treturn;\n\t}\n\n\t/**\n\t * ### jsTree core functionality\n\t */\n\n\t// internal variables\n\tvar instance_counter = 0,\n\t\tccp_node = false,\n\t\tccp_mode = false,\n\t\tccp_inst = false,\n\t\tthemes_loaded = [],\n\t\tsrc = $('script:last').attr('src'),\n\t\tdocument = window.document; // local variable is always faster to access then a global\n\n\t/**\n\t * holds all jstree related functions and variables, including the actual class and methods to create, access and manipulate instances.\n\t * @name $.jstree\n\t */\n\t$.jstree = {\n\t\t/**\n\t\t * specifies the jstree version in use\n\t\t * @name $.jstree.version\n\t\t */\n\t\tversion : '3.3.8',\n\t\t/**\n\t\t * holds all the default options used when creating new instances\n\t\t * @name $.jstree.defaults\n\t\t */\n\t\tdefaults : {\n\t\t\t/**\n\t\t\t * configure which plugins will be active on an instance. Should be an array of strings, where each element is a plugin name. The default is `[]`\n\t\t\t * @name $.jstree.defaults.plugins\n\t\t\t */\n\t\t\tplugins : []\n\t\t},\n\t\t/**\n\t\t * stores all loaded jstree plugins (used internally)\n\t\t * @name $.jstree.plugins\n\t\t */\n\t\tplugins : {},\n\t\tpath : src && src.indexOf('/') !== -1 ? src.replace(/\\/[^\\/]+$/,'') : '',\n\t\tidregex : /[\\\\:&!^|()\\[\\]<>@*'+~#\";.,=\\- \\/${}%?`]/g,\n\t\troot : '#'\n\t};\n\t\n\t/**\n\t * creates a jstree instance\n\t * @name $.jstree.create(el [, options])\n\t * @param {DOMElement|jQuery|String} el the element to create the instance on, can be jQuery extended or a selector\n\t * @param {Object} options options for this instance (extends `$.jstree.defaults`)\n\t * @return {jsTree} the new instance\n\t */\n\t$.jstree.create = function (el, options) {\n\t\tvar tmp = new $.jstree.core(++instance_counter),\n\t\t\topt = options;\n\t\toptions = $.extend(true, {}, $.jstree.defaults, options);\n\t\tif(opt && opt.plugins) {\n\t\t\toptions.plugins = opt.plugins;\n\t\t}\n\t\t$.each(options.plugins, function (i, k) {\n\t\t\tif(i !== 'core') {\n\t\t\t\ttmp = tmp.plugin(k, options[k]);\n\t\t\t}\n\t\t});\n\t\t$(el).data('jstree', tmp);\n\t\ttmp.init(el, options);\n\t\treturn tmp;\n\t};\n\t/**\n\t * remove all traces of jstree from the DOM and destroy all instances\n\t * @name $.jstree.destroy()\n\t */\n\t$.jstree.destroy = function () {\n\t\t$('.jstree:jstree').jstree('destroy');\n\t\t$(document).off('.jstree');\n\t};\n\t/**\n\t * the jstree class constructor, used only internally\n\t * @private\n\t * @name $.jstree.core(id)\n\t * @param {Number} id this instance's index\n\t */\n\t$.jstree.core = function (id) {\n\t\tthis._id = id;\n\t\tthis._cnt = 0;\n\t\tthis._wrk = null;\n\t\tthis._data = {\n\t\t\tcore : {\n\t\t\t\tthemes : {\n\t\t\t\t\tname : false,\n\t\t\t\t\tdots : false,\n\t\t\t\t\ticons : false,\n\t\t\t\t\tellipsis : false\n\t\t\t\t},\n\t\t\t\tselected : [],\n\t\t\t\tlast_error : {},\n\t\t\t\tworking : false,\n\t\t\t\tworker_queue : [],\n\t\t\t\tfocused : null\n\t\t\t}\n\t\t};\n\t};\n\t/**\n\t * get a reference to an existing instance\n\t *\n\t * __Examples__\n\t *\n\t *\t// provided a container with an ID of \"tree\", and a nested node with an ID of \"branch\"\n\t *\t// all of there will return the same instance\n\t *\t$.jstree.reference('tree');\n\t *\t$.jstree.reference('#tree');\n\t *\t$.jstree.reference($('#tree'));\n\t *\t$.jstree.reference(document.getElementByID('tree'));\n\t *\t$.jstree.reference('branch');\n\t *\t$.jstree.reference('#branch');\n\t *\t$.jstree.reference($('#branch'));\n\t *\t$.jstree.reference(document.getElementByID('branch'));\n\t *\n\t * @name $.jstree.reference(needle)\n\t * @param {DOMElement|jQuery|String} needle\n\t * @return {jsTree|null} the instance or `null` if not found\n\t */\n\t$.jstree.reference = function (needle) {\n\t\tvar tmp = null,\n\t\t\tobj = null;\n\t\tif(needle && needle.id && (!needle.tagName || !needle.nodeType)) { needle = needle.id; }\n\n\t\tif(!obj || !obj.length) {\n\t\t\ttry { obj = $(needle); } catch (ignore) { }\n\t\t}\n\t\tif(!obj || !obj.length) {\n\t\t\ttry { obj = $('#' + needle.replace($.jstree.idregex,'\\\\$&')); } catch (ignore) { }\n\t\t}\n\t\tif(obj && obj.length && (obj = obj.closest('.jstree')).length && (obj = obj.data('jstree'))) {\n\t\t\ttmp = obj;\n\t\t}\n\t\telse {\n\t\t\t$('.jstree').each(function () {\n\t\t\t\tvar inst = $(this).data('jstree');\n\t\t\t\tif(inst && inst._model.data[needle]) {\n\t\t\t\t\ttmp = inst;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn tmp;\n\t};\n\t/**\n\t * Create an instance, get an instance or invoke a command on a instance.\n\t *\n\t * If there is no instance associated with the current node a new one is created and `arg` is used to extend `$.jstree.defaults` for this new instance. There would be no return value (chaining is not broken).\n\t *\n\t * If there is an existing instance and `arg` is a string the command specified by `arg` is executed on the instance, with any additional arguments passed to the function. If the function returns a value it will be returned (chaining could break depending on function).\n\t *\n\t * If there is an existing instance and `arg` is not a string the instance itself is returned (similar to `$.jstree.reference`).\n\t *\n\t * In any other case - nothing is returned and chaining is not broken.\n\t *\n\t * __Examples__\n\t *\n\t *\t$('#tree1').jstree(); // creates an instance\n\t *\t$('#tree2').jstree({ plugins : [] }); // create an instance with some options\n\t *\t$('#tree1').jstree('open_node', '#branch_1'); // call a method on an existing instance, passing additional arguments\n\t *\t$('#tree2').jstree(); // get an existing instance (or create an instance)\n\t *\t$('#tree2').jstree(true); // get an existing instance (will not create new instance)\n\t *\t$('#branch_1').jstree().select_node('#branch_1'); // get an instance (using a nested element and call a method)\n\t *\n\t * @name $().jstree([arg])\n\t * @param {String|Object} arg\n\t * @return {Mixed}\n\t */\n\t$.fn.jstree = function (arg) {\n\t\t// check for string argument\n\t\tvar is_method\t= (typeof arg === 'string'),\n\t\t\targs\t\t= Array.prototype.slice.call(arguments, 1),\n\t\t\tresult\t\t= null;\n\t\tif(arg === true && !this.length) { return false; }\n\t\tthis.each(function () {\n\t\t\t// get the instance (if there is one) and method (if it exists)\n\t\t\tvar instance = $.jstree.reference(this),\n\t\t\t\tmethod = is_method && instance ? instance[arg] : null;\n\t\t\t// if calling a method, and method is available - execute on the instance\n\t\t\tresult = is_method && method ?\n\t\t\t\tmethod.apply(instance, args) :\n\t\t\t\tnull;\n\t\t\t// if there is no instance and no method is being called - create one\n\t\t\tif(!instance && !is_method && (arg === undefined || $.isPlainObject(arg))) {\n\t\t\t\t$.jstree.create(this, arg);\n\t\t\t}\n\t\t\t// if there is an instance and no method is called - return the instance\n\t\t\tif( (instance && !is_method) || arg === true ) {\n\t\t\t\tresult = instance || false;\n\t\t\t}\n\t\t\t// if there was a method call which returned a result - break and return the value\n\t\t\tif(result !== null && result !== undefined) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t\t// if there was a method call with a valid return value - return that, otherwise continue the chain\n\t\treturn result !== null && result !== undefined ?\n\t\t\tresult : this;\n\t};\n\t/**\n\t * used to find elements containing an instance\n\t *\n\t * __Examples__\n\t *\n\t *\t$('div:jstree').each(function () {\n\t *\t\t$(this).jstree('destroy');\n\t *\t});\n\t *\n\t * @name $(':jstree')\n\t * @return {jQuery}\n\t */\n\t$.expr.pseudos.jstree = $.expr.createPseudo(function(search) {\n\t\treturn function(a) {\n\t\t\treturn $(a).hasClass('jstree') &&\n\t\t\t\t$(a).data('jstree') !== undefined;\n\t\t};\n\t});\n\n\t/**\n\t * stores all defaults for the core\n\t * @name $.jstree.defaults.core\n\t */\n\t$.jstree.defaults.core = {\n\t\t/**\n\t\t * data configuration\n\t\t *\n\t\t * If left as `false` the HTML inside the jstree container element is used to populate the tree (that should be an unordered list with list items).\n\t\t *\n\t\t * You can also pass in a HTML string or a JSON array here.\n\t\t *\n\t\t * It is possible to pass in a standard jQuery-like AJAX config and jstree will automatically determine if the response is JSON or HTML and use that to populate the tree.\n\t\t * In addition to the standard jQuery ajax options here you can suppy functions for `data` and `url`, the functions will be run in the current instance's scope and a param will be passed indicating which node is being loaded, the return value of those functions will be used.\n\t\t *\n\t\t * The last option is to specify a function, that function will receive the node being loaded as argument and a second param which is a function which should be called with the result.\n\t\t *\n\t\t * __Examples__\n\t\t *\n\t\t *\t// AJAX\n\t\t *\t$('#tree').jstree({\n\t\t *\t\t'core' : {\n\t\t *\t\t\t'data' : {\n\t\t *\t\t\t\t'url' : '/get/children/',\n\t\t *\t\t\t\t'data' : function (node) {\n\t\t *\t\t\t\t\treturn { 'id' : node.id };\n\t\t *\t\t\t\t}\n\t\t *\t\t\t}\n\t\t *\t\t});\n\t\t *\n\t\t *\t// direct data\n\t\t *\t$('#tree').jstree({\n\t\t *\t\t'core' : {\n\t\t *\t\t\t'data' : [\n\t\t *\t\t\t\t'Simple root node',\n\t\t *\t\t\t\t{\n\t\t *\t\t\t\t\t'id' : 'node_2',\n\t\t *\t\t\t\t\t'text' : 'Root node with options',\n\t\t *\t\t\t\t\t'state' : { 'opened' : true, 'selected' : true },\n\t\t *\t\t\t\t\t'children' : [ { 'text' : 'Child 1' }, 'Child 2']\n\t\t *\t\t\t\t}\n\t\t *\t\t\t]\n\t\t *\t\t}\n\t\t *\t});\n\t\t *\n\t\t *\t// function\n\t\t *\t$('#tree').jstree({\n\t\t *\t\t'core' : {\n\t\t *\t\t\t'data' : function (obj, callback) {\n\t\t *\t\t\t\tcallback.call(this, ['Root 1', 'Root 2']);\n\t\t *\t\t\t}\n\t\t *\t\t});\n\t\t *\n\t\t * @name $.jstree.defaults.core.data\n\t\t */\n\t\tdata\t\t\t: false,\n\t\t/**\n\t\t * configure the various strings used throughout the tree\n\t\t *\n\t\t * You can use an object where the key is the string you need to replace and the value is your replacement.\n\t\t * Another option is to specify a function which will be called with an argument of the needed string and should return the replacement.\n\t\t * If left as `false` no replacement is made.\n\t\t *\n\t\t * __Examples__\n\t\t *\n\t\t *\t$('#tree').jstree({\n\t\t *\t\t'core' : {\n\t\t *\t\t\t'strings' : {\n\t\t *\t\t\t\t'Loading ...' : 'Please wait ...'\n\t\t *\t\t\t}\n\t\t *\t\t}\n\t\t *\t});\n\t\t *\n\t\t * @name $.jstree.defaults.core.strings\n\t\t */\n\t\tstrings\t\t\t: false,\n\t\t/**\n\t\t * determines what happens when a user tries to modify the structure of the tree\n\t\t * If left as `false` all operations like create, rename, delete, move or copy are prevented.\n\t\t * You can set this to `true` to allow all interactions or use a function to have better control.\n\t\t *\n\t\t * __Examples__\n\t\t *\n\t\t *\t$('#tree').jstree({\n\t\t *\t\t'core' : {\n\t\t *\t\t\t'check_callback' : function (operation, node, node_parent, node_position, more) {\n\t\t *\t\t\t\t// operation can be 'create_node', 'rename_node', 'delete_node', 'move_node', 'copy_node' or 'edit'\n\t\t *\t\t\t\t// in case of 'rename_node' node_position is filled with the new node name\n\t\t *\t\t\t\treturn operation === 'rename_node' ? true : false;\n\t\t *\t\t\t}\n\t\t *\t\t}\n\t\t *\t});\n\t\t *\n\t\t * @name $.jstree.defaults.core.check_callback\n\t\t */\n\t\tcheck_callback\t: false,\n\t\t/**\n\t\t * a callback called with a single object parameter in the instance's scope when something goes wrong (operation prevented, ajax failed, etc)\n\t\t * @name $.jstree.defaults.core.error\n\t\t */\n\t\terror\t\t\t: $.noop,\n\t\t/**\n\t\t * the open / close animation duration in milliseconds - set this to `false` to disable the animation (default is `200`)\n\t\t * @name $.jstree.defaults.core.animation\n\t\t */\n\t\tanimation\t\t: 200,\n\t\t/**\n\t\t * a boolean indicating if multiple nodes can be selected\n\t\t * @name $.jstree.defaults.core.multiple\n\t\t */\n\t\tmultiple\t\t: true,\n\t\t/**\n\t\t * theme configuration object\n\t\t * @name $.jstree.defaults.core.themes\n\t\t */\n\t\tthemes\t\t\t: {\n\t\t\t/**\n\t\t\t * the name of the theme to use (if left as `false` the default theme is used)\n\t\t\t * @name $.jstree.defaults.core.themes.name\n\t\t\t */\n\t\t\tname\t\t\t: false,\n\t\t\t/**\n\t\t\t * the URL of the theme's CSS file, leave this as `false` if you have manually included the theme CSS (recommended). You can set this to `true` too which will try to autoload the theme.\n\t\t\t * @name $.jstree.defaults.core.themes.url\n\t\t\t */\n\t\t\turl\t\t\t\t: false,\n\t\t\t/**\n\t\t\t * the location of all jstree themes - only used if `url` is set to `true`\n\t\t\t * @name $.jstree.defaults.core.themes.dir\n\t\t\t */\n\t\t\tdir\t\t\t\t: false,\n\t\t\t/**\n\t\t\t * a boolean indicating if connecting dots are shown\n\t\t\t * @name $.jstree.defaults.core.themes.dots\n\t\t\t */\n\t\t\tdots\t\t\t: true,\n\t\t\t/**\n\t\t\t * a boolean indicating if node icons are shown\n\t\t\t * @name $.jstree.defaults.core.themes.icons\n\t\t\t */\n\t\t\ticons\t\t\t: true,\n\t\t\t/**\n\t\t\t * a boolean indicating if node ellipsis should be shown - this only works with a fixed with on the container\n\t\t\t * @name $.jstree.defaults.core.themes.ellipsis\n\t\t\t */\n\t\t\tellipsis\t\t: false,\n\t\t\t/**\n\t\t\t * a boolean indicating if the tree background is striped\n\t\t\t * @name $.jstree.defaults.core.themes.stripes\n\t\t\t */\n\t\t\tstripes\t\t\t: false,\n\t\t\t/**\n\t\t\t * a string (or boolean `false`) specifying the theme variant to use (if the theme supports variants)\n\t\t\t * @name $.jstree.defaults.core.themes.variant\n\t\t\t */\n\t\t\tvariant\t\t\t: false,\n\t\t\t/**\n\t\t\t * a boolean specifying if a reponsive version of the theme should kick in on smaller screens (if the theme supports it). Defaults to `false`.\n\t\t\t * @name $.jstree.defaults.core.themes.responsive\n\t\t\t */\n\t\t\tresponsive\t\t: false\n\t\t},\n\t\t/**\n\t\t * if left as `true` all parents of all selected nodes will be opened once the tree loads (so that all selected nodes are visible to the user)\n\t\t * @name $.jstree.defaults.core.expand_selected_onload\n\t\t */\n\t\texpand_selected_onload : true,\n\t\t/**\n\t\t * if left as `true` web workers will be used to parse incoming JSON data where possible, so that the UI will not be blocked by large requests. Workers are however about 30% slower. Defaults to `true`\n\t\t * @name $.jstree.defaults.core.worker\n\t\t */\n\t\tworker : true,\n\t\t/**\n\t\t * Force node text to plain text (and escape HTML). Defaults to `false`\n\t\t * @name $.jstree.defaults.core.force_text\n\t\t */\n\t\tforce_text : false,\n\t\t/**\n\t\t * Should the node be toggled if the text is double clicked. Defaults to `true`\n\t\t * @name $.jstree.defaults.core.dblclick_toggle\n\t\t */\n\t\tdblclick_toggle : true,\n\t\t/**\n\t\t * Should the loaded nodes be part of the state. Defaults to `false`\n\t\t * @name $.jstree.defaults.core.loaded_state\n\t\t */\n\t\tloaded_state : false,\n\t\t/**\n\t\t * Should the last active node be focused when the tree container is blurred and the focused again. This helps working with screen readers. Defaults to `true`\n\t\t * @name $.jstree.defaults.core.restore_focus\n\t\t */\n\t\trestore_focus : true,\n\t\t/**\n\t\t * Default keyboard shortcuts (an object where each key is the button name or combo - like 'enter', 'ctrl-space', 'p', etc and the value is the function to execute in the instance's scope)\n\t\t * @name $.jstree.defaults.core.keyboard\n\t\t */\n\t\tkeyboard : {\n\t\t\t'ctrl-space': function (e) {\n\t\t\t\t// aria defines space only with Ctrl\n\t\t\t\te.type = \"click\";\n\t\t\t\t$(e.currentTarget).trigger(e);\n\t\t\t},\n\t\t\t'enter': function (e) {\n\t\t\t\t// enter\n\t\t\t\te.type = \"click\";\n\t\t\t\t$(e.currentTarget).trigger(e);\n\t\t\t},\n\t\t\t'left': function (e) {\n\t\t\t\t// left\n\t\t\t\te.preventDefault();\n\t\t\t\tif(this.is_open(e.currentTarget)) {\n\t\t\t\t\tthis.close_node(e.currentTarget);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvar o = this.get_parent(e.currentTarget);\n\t\t\t\t\tif(o && o.id !== $.jstree.root) { this.get_node(o, true).children('.jstree-anchor').focus(); }\n\t\t\t\t}\n\t\t\t},\n\t\t\t'up': function (e) {\n\t\t\t\t// up\n\t\t\t\te.preventDefault();\n\t\t\t\tvar o = this.get_prev_dom(e.currentTarget);\n\t\t\t\tif(o && o.length) { o.children('.jstree-anchor').focus(); }\n\t\t\t},\n\t\t\t'right': function (e) {\n\t\t\t\t// right\n\t\t\t\te.preventDefault();\n\t\t\t\tif(this.is_closed(e.currentTarget)) {\n\t\t\t\t\tthis.open_node(e.currentTarget, function (o) { this.get_node(o, true).children('.jstree-anchor').focus(); });\n\t\t\t\t}\n\t\t\t\telse if (this.is_open(e.currentTarget)) {\n\t\t\t\t\tvar o = this.get_node(e.currentTarget, true).children('.jstree-children')[0];\n\t\t\t\t\tif(o) { $(this._firstChild(o)).children('.jstree-anchor').focus(); }\n\t\t\t\t}\n\t\t\t},\n\t\t\t'down': function (e) {\n\t\t\t\t// down\n\t\t\t\te.preventDefault();\n\t\t\t\tvar o = this.get_next_dom(e.currentTarget);\n\t\t\t\tif(o && o.length) { o.children('.jstree-anchor').focus(); }\n\t\t\t},\n\t\t\t'*': function (e) {\n\t\t\t\t// aria defines * on numpad as open_all - not very common\n\t\t\t\tthis.open_all();\n\t\t\t},\n\t\t\t'home': function (e) {\n\t\t\t\t// home\n\t\t\t\te.preventDefault();\n\t\t\t\tvar o = this._firstChild(this.get_container_ul()[0]);\n\t\t\t\tif(o) { $(o).children('.jstree-anchor').filter(':visible').focus(); }\n\t\t\t},\n\t\t\t'end': function (e) {\n\t\t\t\t// end\n\t\t\t\te.preventDefault();\n\t\t\t\tthis.element.find('.jstree-anchor').filter(':visible').last().focus();\n\t\t\t},\n\t\t\t'f2': function (e) {\n\t\t\t\t// f2 - safe to include - if check_callback is false it will fail\n\t\t\t\te.preventDefault();\n\t\t\t\tthis.edit(e.currentTarget);\n\t\t\t}\n\t\t}\n\t};\n\t$.jstree.core.prototype = {\n\t\t/**\n\t\t * used to decorate an instance with a plugin. Used internally.\n\t\t * @private\n\t\t * @name plugin(deco [, opts])\n\t\t * @param  {String} deco the plugin to decorate with\n\t\t * @param  {Object} opts options for the plugin\n\t\t * @return {jsTree}\n\t\t */\n\t\tplugin : function (deco, opts) {\n\t\t\tvar Child = $.jstree.plugins[deco];\n\t\t\tif(Child) {\n\t\t\t\tthis._data[deco] = {};\n\t\t\t\tChild.prototype = this;\n\t\t\t\treturn new Child(opts, this);\n\t\t\t}\n\t\t\treturn this;\n\t\t},\n\t\t/**\n\t\t * initialize the instance. Used internally.\n\t\t * @private\n\t\t * @name init(el, optons)\n\t\t * @param {DOMElement|jQuery|String} el the element we are transforming\n\t\t * @param {Object} options options for this instance\n\t\t * @trigger init.jstree, loading.jstree, loaded.jstree, ready.jstree, changed.jstree\n\t\t */\n\t\tinit : function (el, options) {\n\t\t\tthis._model = {\n\t\t\t\tdata : {},\n\t\t\t\tchanged : [],\n\t\t\t\tforce_full_redraw : false,\n\t\t\t\tredraw_timeout : false,\n\t\t\t\tdefault_state : {\n\t\t\t\t\tloaded : true,\n\t\t\t\t\topened : false,\n\t\t\t\t\tselected : false,\n\t\t\t\t\tdisabled : false\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._model.data[$.jstree.root] = {\n\t\t\t\tid : $.jstree.root,\n\t\t\t\tparent : null,\n\t\t\t\tparents : [],\n\t\t\t\tchildren : [],\n\t\t\t\tchildren_d : [],\n\t\t\t\tstate : { loaded : false }\n\t\t\t};\n\n\t\t\tthis.element = $(el).addClass('jstree jstree-' + this._id);\n\t\t\tthis.settings = options;\n\n\t\t\tthis._data.core.ready = false;\n\t\t\tthis._data.core.loaded = false;\n\t\t\tthis._data.core.rtl = (this.element.css(\"direction\") === \"rtl\");\n\t\t\tthis.element[this._data.core.rtl ? 'addClass' : 'removeClass'](\"jstree-rtl\");\n\t\t\tthis.element.attr('role','tree');\n\t\t\tif(this.settings.core.multiple) {\n\t\t\t\tthis.element.attr('aria-multiselectable', true);\n\t\t\t}\n\t\t\tif(!this.element.attr('tabindex')) {\n\t\t\t\tthis.element.attr('tabindex','0');\n\t\t\t}\n\n\t\t\tthis.bind();\n\t\t\t/**\n\t\t\t * triggered after all events are bound\n\t\t\t * @event\n\t\t\t * @name init.jstree\n\t\t\t */\n\t\t\tthis.trigger(\"init\");\n\n\t\t\tthis._data.core.original_container_html = this.element.find(\" > ul > li\").clone(true);\n\t\t\tthis._data.core.original_container_html\n\t\t\t\t.find(\"li\").addBack()\n\t\t\t\t.contents().filter(function() {\n\t\t\t\t\treturn this.nodeType === 3 && (!this.nodeValue || /^\\s+$/.test(this.nodeValue));\n\t\t\t\t})\n\t\t\t\t.remove();\n\t\t\tthis.element.html(\"<\"+\"ul class='jstree-container-ul jstree-children' role='group'><\"+\"li id='j\"+this._id+\"_loading' class='jstree-initial-node jstree-loading jstree-leaf jstree-last' role='tree-item'><i class='jstree-icon jstree-ocl'></i><\"+\"a class='jstree-anchor' href='#'><i class='jstree-icon jstree-themeicon-hidden'></i>\" + this.get_string(\"Loading ...\") + \"</a></li></ul>\");\n\t\t\tthis.element.attr('aria-activedescendant','j' + this._id + '_loading');\n\t\t\tthis._data.core.li_height = this.get_container_ul().children(\"li\").first().outerHeight() || 24;\n\t\t\tthis._data.core.node = this._create_prototype_node();\n\t\t\t/**\n\t\t\t * triggered after the loading text is shown and before loading starts\n\t\t\t * @event\n\t\t\t * @name loading.jstree\n\t\t\t */\n\t\t\tthis.trigger(\"loading\");\n\t\t\tthis.load_node($.jstree.root);\n\t\t},\n\t\t/**\n\t\t * destroy an instance\n\t\t * @name destroy()\n\t\t * @param  {Boolean} keep_html if not set to `true` the container will be emptied, otherwise the current DOM elements will be kept intact\n\t\t */\n\t\tdestroy : function (keep_html) {\n\t\t\t/**\n\t\t\t * triggered before the tree is destroyed\n\t\t\t * @event\n\t\t\t * @name destroy.jstree\n\t\t\t */\n\t\t\tthis.trigger(\"destroy\");\n\t\t\tif(this._wrk) {\n\t\t\t\ttry {\n\t\t\t\t\twindow.URL.revokeObjectURL(this._wrk);\n\t\t\t\t\tthis._wrk = null;\n\t\t\t\t}\n\t\t\t\tcatch (ignore) { }\n\t\t\t}\n\t\t\tif(!keep_html) { this.element.empty(); }\n\t\t\tthis.teardown();\n\t\t},\n\t\t/**\n\t\t * Create a prototype node\n\t\t * @name _create_prototype_node()\n\t\t * @return {DOMElement}\n\t\t */\n\t\t_create_prototype_node : function () {\n\t\t\tvar _node = document.createElement('LI'), _temp1, _temp2;\n\t\t\t_node.setAttribute('role', 'treeitem');\n\t\t\t_temp1 = document.createElement('I');\n\t\t\t_temp1.className = 'jstree-icon jstree-ocl';\n\t\t\t_temp1.setAttribute('role', 'presentation');\n\t\t\t_node.appendChild(_temp1);\n\t\t\t_temp1 = document.createElement('A');\n\t\t\t_temp1.className = 'jstree-anchor';\n\t\t\t_temp1.setAttribute('href','#');\n\t\t\t_temp1.setAttribute('tabindex','-1');\n\t\t\t_temp2 = document.createElement('I');\n\t\t\t_temp2.className = 'jstree-icon jstree-themeicon';\n\t\t\t_temp2.setAttribute('role', 'presentation');\n\t\t\t_temp1.appendChild(_temp2);\n\t\t\t_node.appendChild(_temp1);\n\t\t\t_temp1 = _temp2 = null;\n\n\t\t\treturn _node;\n\t\t},\n\t\t_kbevent_to_func : function (e) {\n\t\t\tvar keys = {\n\t\t\t\t8: \"Backspace\", 9: \"Tab\", 13: \"Enter\", 19: \"Pause\", 27: \"Esc\",\n\t\t\t\t32: \"Space\", 33: \"PageUp\", 34: \"PageDown\", 35: \"End\", 36: \"Home\",\n\t\t\t\t37: \"Left\", 38: \"Up\", 39: \"Right\", 40: \"Down\", 44: \"Print\", 45: \"Insert\",\n\t\t\t\t46: \"Delete\", 96: \"Numpad0\", 97: \"Numpad1\", 98: \"Numpad2\", 99 : \"Numpad3\",\n\t\t\t\t100: \"Numpad4\", 101: \"Numpad5\", 102: \"Numpad6\", 103: \"Numpad7\",\n\t\t\t\t104: \"Numpad8\", 105: \"Numpad9\", '-13': \"NumpadEnter\", 112: \"F1\",\n\t\t\t\t113: \"F2\", 114: \"F3\", 115: \"F4\", 116: \"F5\", 117: \"F6\", 118: \"F7\",\n\t\t\t\t119: \"F8\", 120: \"F9\", 121: \"F10\", 122: \"F11\", 123: \"F12\", 144: \"Numlock\",\n\t\t\t\t145: \"Scrolllock\", 16: 'Shift', 17: 'Ctrl', 18: 'Alt',\n\t\t\t\t48: '0',  49: '1',  50: '2',  51: '3',  52: '4', 53:  '5',\n\t\t\t\t54: '6',  55: '7',  56: '8',  57: '9',  59: ';',  61: '=', 65:  'a',\n\t\t\t\t66: 'b',  67: 'c',  68: 'd',  69: 'e',  70: 'f',  71: 'g', 72:  'h',\n\t\t\t\t73: 'i',  74: 'j',  75: 'k',  76: 'l',  77: 'm',  78: 'n', 79:  'o',\n\t\t\t\t80: 'p',  81: 'q',  82: 'r',  83: 's',  84: 't',  85: 'u', 86:  'v',\n\t\t\t\t87: 'w',  88: 'x',  89: 'y',  90: 'z', 107: '+', 109: '-', 110: '.',\n\t\t\t\t186: ';', 187: '=', 188: ',', 189: '-', 190: '.', 191: '/', 192: '`',\n\t\t\t\t219: '[', 220: '\\\\',221: ']', 222: \"'\", 111: '/', 106: '*', 173: '-'\n\t\t\t};\n\t\t\tvar parts = [];\n\t\t\tif (e.ctrlKey) { parts.push('ctrl'); }\n\t\t\tif (e.altKey) { parts.push('alt'); }\n\t\t\tif (e.shiftKey) { parts.push('shift'); }\n\t\t\tparts.push(keys[e.which] || e.which);\n\t\t\tparts = parts.sort().join('-').toLowerCase();\n\n\t\t\tvar kb = this.settings.core.keyboard, i, tmp;\n\t\t\tfor (i in kb) {\n\t\t\t\tif (kb.hasOwnProperty(i)) {\n\t\t\t\t\ttmp = i;\n\t\t\t\t\tif (tmp !== '-' && tmp !== '+') {\n\t\t\t\t\t\ttmp = tmp.replace('--', '-MINUS').replace('+-', '-MINUS').replace('++', '-PLUS').replace('-+', '-PLUS');\n\t\t\t\t\t\ttmp = tmp.split(/-|\\+/).sort().join('-').replace('MINUS', '-').replace('PLUS', '+').toLowerCase();\n\t\t\t\t\t}\n\t\t\t\t\tif (tmp === parts) {\n\t\t\t\t\t\treturn kb[i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\t\t/**\n\t\t * part of the destroying of an instance. Used internally.\n\t\t * @private\n\t\t * @name teardown()\n\t\t */\n\t\tteardown : function () {\n\t\t\tthis.unbind();\n\t\t\tthis.element\n\t\t\t\t.removeClass('jstree')\n\t\t\t\t.removeData('jstree')\n\t\t\t\t.find(\"[class^='jstree']\")\n\t\t\t\t\t.addBack()\n\t\t\t\t\t.attr(\"class\", function () { return this.className.replace(/jstree[^ ]*|$/ig,''); });\n\t\t\tthis.element = null;\n\t\t},\n\t\t/**\n\t\t * bind all events. Used internally.\n\t\t * @private\n\t\t * @name bind()\n\t\t */\n\t\tbind : function () {\n\t\t\tvar word = '',\n\t\t\t\ttout = null,\n\t\t\t\twas_click = 0;\n\t\t\tthis.element\n\t\t\t\t.on(\"dblclick.jstree\", function (e) {\n\t\t\t\t\t\tif(e.target.tagName && e.target.tagName.toLowerCase() === \"input\") { return true; }\n\t\t\t\t\t\tif(document.selection && document.selection.empty) {\n\t\t\t\t\t\t\tdocument.selection.empty();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tif(window.getSelection) {\n\t\t\t\t\t\t\t\tvar sel = window.getSelection();\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tsel.removeAllRanges();\n\t\t\t\t\t\t\t\t\tsel.collapse();\n\t\t\t\t\t\t\t\t} catch (ignore) { }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t.on(\"mousedown.jstree\", $.proxy(function (e) {\n\t\t\t\t\t\tif(e.target === this.element[0]) {\n\t\t\t\t\t\t\te.preventDefault(); // prevent losing focus when clicking scroll arrows (FF, Chrome)\n\t\t\t\t\t\t\twas_click = +(new Date()); // ie does not allow to prevent losing focus\n\t\t\t\t\t\t}\n\t\t\t\t\t}, this))\n\t\t\t\t.on(\"mousedown.jstree\", \".jstree-ocl\", function (e) {\n\t\t\t\t\t\te.preventDefault(); // prevent any node inside from losing focus when clicking the open/close icon\n\t\t\t\t\t})\n\t\t\t\t.on(\"click.jstree\", \".jstree-ocl\", $.proxy(function (e) {\n\t\t\t\t\t\tthis.toggle_node(e.target);\n\t\t\t\t\t}, this))\n\t\t\t\t.on(\"dblclick.jstree\", \".jstree-anchor\", $.proxy(function (e) {\n\t\t\t\t\t\tif(e.target.tagName && e.target.tagName.toLowerCase() === \"input\") { return true; }\n\t\t\t\t\t\tif(this.settings.core.dblclick_toggle) {\n\t\t\t\t\t\t\tthis.toggle_node(e.target);\n\t\t\t\t\t\t}\n\t\t\t\t\t}, this))\n\t\t\t\t.on(\"click.jstree\", \".jstree-anchor\", $.proxy(function (e) {\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\tif(e.currentTarget !== document.activeElement) { $(e.currentTarget).focus(); }\n\t\t\t\t\t\tthis.activate_node(e.currentTarget, e);\n\t\t\t\t\t}, this))\n\t\t\t\t.on('keydown.jstree', '.jstree-anchor', $.proxy(function (e) {\n\t\t\t\t\t\tif(e.target.tagName && e.target.tagName.toLowerCase() === \"input\") { return true; }\n\t\t\t\t\t\tif(this._data.core.rtl) {\n\t\t\t\t\t\t\tif(e.which === 37) { e.which = 39; }\n\t\t\t\t\t\t\telse if(e.which === 39) { e.which = 37; }\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar f = this._kbevent_to_func(e);\n\t\t\t\t\t\tif (f) {\n\t\t\t\t\t\t\tvar r = f.call(this, e);\n\t\t\t\t\t\t\tif (r === false || r === true) {\n\t\t\t\t\t\t\t\treturn r;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}, this))\n\t\t\t\t.on(\"load_node.jstree\", $.proxy(function (e, data) {\n\t\t\t\t\t\tif(data.status) {\n\t\t\t\t\t\t\tif(data.node.id === $.jstree.root && !this._data.core.loaded) {\n\t\t\t\t\t\t\t\tthis._data.core.loaded = true;\n\t\t\t\t\t\t\t\tif(this._firstChild(this.get_container_ul()[0])) {\n\t\t\t\t\t\t\t\t\tthis.element.attr('aria-activedescendant',this._firstChild(this.get_container_ul()[0]).id);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t * triggered after the root node is loaded for the first time\n\t\t\t\t\t\t\t\t * @event\n\t\t\t\t\t\t\t\t * @name loaded.jstree\n\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\tthis.trigger(\"loaded\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!this._data.core.ready) {\n\t\t\t\t\t\t\t\tsetTimeout($.proxy(function() {\n\t\t\t\t\t\t\t\t\tif(this.element && !this.get_container_ul().find('.jstree-loading').length) {\n\t\t\t\t\t\t\t\t\t\tthis._data.core.ready = true;\n\t\t\t\t\t\t\t\t\t\tif(this._data.core.selected.length) {\n\t\t\t\t\t\t\t\t\t\t\tif(this.settings.core.expand_selected_onload) {\n\t\t\t\t\t\t\t\t\t\t\t\tvar tmp = [], i, j;\n\t\t\t\t\t\t\t\t\t\t\t\tfor(i = 0, j = this._data.core.selected.length; i < j; i++) {\n\t\t\t\t\t\t\t\t\t\t\t\t\ttmp = tmp.concat(this._model.data[this._data.core.selected[i]].parents);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\ttmp = $.vakata.array_unique(tmp);\n\t\t\t\t\t\t\t\t\t\t\t\tfor(i = 0, j = tmp.length; i < j; i++) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis.open_node(tmp[i], false, 0);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tthis.trigger('changed', { 'action' : 'ready', 'selected' : this._data.core.selected });\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t\t\t * triggered after all nodes are finished loading\n\t\t\t\t\t\t\t\t\t\t * @event\n\t\t\t\t\t\t\t\t\t\t * @name ready.jstree\n\t\t\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t\t\tthis.trigger(\"ready\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}, this), 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}, this))\n\t\t\t\t// quick searching when the tree is focused\n\t\t\t\t.on('keypress.jstree', $.proxy(function (e) {\n\t\t\t\t\t\tif(e.target.tagName && e.target.tagName.toLowerCase() === \"input\") { return true; }\n\t\t\t\t\t\tif(tout) { clearTimeout(tout); }\n\t\t\t\t\t\ttout = setTimeout(function () {\n\t\t\t\t\t\t\tword = '';\n\t\t\t\t\t\t}, 500);\n\n\t\t\t\t\t\tvar chr = String.fromCharCode(e.which).toLowerCase(),\n\t\t\t\t\t\t\tcol = this.element.find('.jstree-anchor').filter(':visible'),\n\t\t\t\t\t\t\tind = col.index(document.activeElement) || 0,\n\t\t\t\t\t\t\tend = false;\n\t\t\t\t\t\tword += chr;\n\n\t\t\t\t\t\t// match for whole word from current node down (including the current node)\n\t\t\t\t\t\tif(word.length > 1) {\n\t\t\t\t\t\t\tcol.slice(ind).each($.proxy(function (i, v) {\n\t\t\t\t\t\t\t\tif($(v).text().toLowerCase().indexOf(word) === 0) {\n\t\t\t\t\t\t\t\t\t$(v).focus();\n\t\t\t\t\t\t\t\t\tend = true;\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}, this));\n\t\t\t\t\t\t\tif(end) { return; }\n\n\t\t\t\t\t\t\t// match for whole word from the beginning of the tree\n\t\t\t\t\t\t\tcol.slice(0, ind).each($.proxy(function (i, v) {\n\t\t\t\t\t\t\t\tif($(v).text().toLowerCase().indexOf(word) === 0) {\n\t\t\t\t\t\t\t\t\t$(v).focus();\n\t\t\t\t\t\t\t\t\tend = true;\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}, this));\n\t\t\t\t\t\t\tif(end) { return; }\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// list nodes that start with that letter (only if word consists of a single char)\n\t\t\t\t\t\tif(new RegExp('^' + chr.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&') + '+$').test(word)) {\n\t\t\t\t\t\t\t// search for the next node starting with that letter\n\t\t\t\t\t\t\tcol.slice(ind + 1).each($.proxy(function (i, v) {\n\t\t\t\t\t\t\t\tif($(v).text().toLowerCase().charAt(0) === chr) {\n\t\t\t\t\t\t\t\t\t$(v).focus();\n\t\t\t\t\t\t\t\t\tend = true;\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}, this));\n\t\t\t\t\t\t\tif(end) { return; }\n\n\t\t\t\t\t\t\t// search from the beginning\n\t\t\t\t\t\t\tcol.slice(0, ind + 1).each($.proxy(function (i, v) {\n\t\t\t\t\t\t\t\tif($(v).text().toLowerCase().charAt(0) === chr) {\n\t\t\t\t\t\t\t\t\t$(v).focus();\n\t\t\t\t\t\t\t\t\tend = true;\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}, this));\n\t\t\t\t\t\t\tif(end) { return; }\n\t\t\t\t\t\t}\n\t\t\t\t\t}, this))\n\t\t\t\t// THEME RELATED\n\t\t\t\t.on(\"init.jstree\", $.proxy(function () {\n\t\t\t\t\t\tvar s = this.settings.core.themes;\n\t\t\t\t\t\tthis._data.core.themes.dots\t\t\t= s.dots;\n\t\t\t\t\t\tthis._data.core.themes.stripes\t\t= s.stripes;\n\t\t\t\t\t\tthis._data.core.themes.icons\t\t= s.icons;\n\t\t\t\t\t\tthis._data.core.themes.ellipsis\t\t= s.ellipsis;\n\t\t\t\t\t\tthis.set_theme(s.name || \"default\", s.url);\n\t\t\t\t\t\tthis.set_theme_variant(s.variant);\n\t\t\t\t\t}, this))\n\t\t\t\t.on(\"loading.jstree\", $.proxy(function () {\n\t\t\t\t\t\tthis[ this._data.core.themes.dots ? \"show_dots\" : \"hide_dots\" ]();\n\t\t\t\t\t\tthis[ this._data.core.themes.icons ? \"show_icons\" : \"hide_icons\" ]();\n\t\t\t\t\t\tthis[ this._data.core.themes.stripes ? \"show_stripes\" : \"hide_stripes\" ]();\n\t\t\t\t\t\tthis[ this._data.core.themes.ellipsis ? \"show_ellipsis\" : \"hide_ellipsis\" ]();\n\t\t\t\t\t}, this))\n\t\t\t\t.on('blur.jstree', '.jstree-anchor', $.proxy(function (e) {\n\t\t\t\t\t\tthis._data.core.focused = null;\n\t\t\t\t\t\t$(e.currentTarget).filter('.jstree-hovered').trigger('mouseleave');\n\t\t\t\t\t\tthis.element.attr('tabindex', '0');\n\t\t\t\t\t}, this))\n\t\t\t\t.on('focus.jstree', '.jstree-anchor', $.proxy(function (e) {\n\t\t\t\t\t\tvar tmp = this.get_node(e.currentTarget);\n\t\t\t\t\t\tif(tmp && tmp.id) {\n\t\t\t\t\t\t\tthis._data.core.focused = tmp.id;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.element.find('.jstree-hovered').not(e.currentTarget).trigger('mouseleave');\n\t\t\t\t\t\t$(e.currentTarget).trigger('mouseenter');\n\t\t\t\t\t\tthis.element.attr('tabindex', '-1');\n\t\t\t\t\t}, this))\n\t\t\t\t.on('focus.jstree', $.proxy(function () {\n\t\t\t\t\t\tif(+(new Date()) - was_click > 500 && !this._data.core.focused && this.settings.core.restore_focus) {\n\t\t\t\t\t\t\twas_click = 0;\n\t\t\t\t\t\t\tvar act = this.get_node(this.element.attr('aria-activedescendant'), true);\n\t\t\t\t\t\t\tif(act) {\n\t\t\t\t\t\t\t\tact.find('> .jstree-anchor').focus();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}, this))\n\t\t\t\t.on('mouseenter.jstree', '.jstree-anchor', $.proxy(function (e) {\n\t\t\t\t\t\tthis.hover_node(e.currentTarget);\n\t\t\t\t\t}, this))\n\t\t\t\t.on('mouseleave.jstree', '.jstree-anchor', $.proxy(function (e) {\n\t\t\t\t\t\tthis.dehover_node(e.currentTarget);\n\t\t\t\t\t}, this));\n\t\t},\n\t\t/**\n\t\t * part of the destroying of an instance. Used internally.\n\t\t * @private\n\t\t * @name unbind()\n\t\t */\n\t\tunbind : function () {\n\t\t\tthis.element.off('.jstree');\n\t\t\t$(document).off('.jstree-' + this._id);\n\t\t},\n\t\t/**\n\t\t * trigger an event. Used internally.\n\t\t * @private\n\t\t * @name trigger(ev [, data])\n\t\t * @param  {String} ev the name of the event to trigger\n\t\t * @param  {Object} data additional data to pass with the event\n\t\t */\n\t\ttrigger : function (ev, data) {\n\t\t\tif(!data) {\n\t\t\t\tdata = {};\n\t\t\t}\n\t\t\tdata.instance = this;\n\t\t\tthis.element.triggerHandler(ev.replace('.jstree','') + '.jstree', data);\n\t\t},\n\t\t/**\n\t\t * returns the jQuery extended instance container\n\t\t * @name get_container()\n\t\t * @return {jQuery}\n\t\t */\n\t\tget_container : function () {\n\t\t\treturn this.element;\n\t\t},\n\t\t/**\n\t\t * returns the jQuery extended main UL node inside the instance container. Used internally.\n\t\t * @private\n\t\t * @name get_container_ul()\n\t\t * @return {jQuery}\n\t\t */\n\t\tget_container_ul : function () {\n\t\t\treturn this.element.children(\".jstree-children\").first();\n\t\t},\n\t\t/**\n\t\t * gets string replacements (localization). Used internally.\n\t\t * @private\n\t\t * @name get_string(key)\n\t\t * @param  {String} key\n\t\t * @return {String}\n\t\t */\n\t\tget_string : function (key) {\n\t\t\tvar a = this.settings.core.strings;\n\t\t\tif($.isFunction(a)) { return a.call(this, key); }\n\t\t\tif(a && a[key]) { return a[key]; }\n\t\t\treturn key;\n\t\t},\n\t\t/**\n\t\t * gets the first child of a DOM node. Used internally.\n\t\t * @private\n\t\t * @name _firstChild(dom)\n\t\t * @param  {DOMElement} dom\n\t\t * @return {DOMElement}\n\t\t */\n\t\t_firstChild : function (dom) {\n\t\t\tdom = dom ? dom.firstChild : null;\n\t\t\twhile(dom !== null && dom.nodeType !== 1) {\n\t\t\t\tdom = dom.nextSibling;\n\t\t\t}\n\t\t\treturn dom;\n\t\t},\n\t\t/**\n\t\t * gets the next sibling of a DOM node. Used internally.\n\t\t * @private\n\t\t * @name _nextSibling(dom)\n\t\t * @param  {DOMElement} dom\n\t\t * @return {DOMElement}\n\t\t */\n\t\t_nextSibling : function (dom) {\n\t\t\tdom = dom ? dom.nextSibling : null;\n\t\t\twhile(dom !== null && dom.nodeType !== 1) {\n\t\t\t\tdom = dom.nextSibling;\n\t\t\t}\n\t\t\treturn dom;\n\t\t},\n\t\t/**\n\t\t * gets the previous sibling of a DOM node. Used internally.\n\t\t * @private\n\t\t * @name _previousSibling(dom)\n\t\t * @param  {DOMElement} dom\n\t\t * @return {DOMElement}\n\t\t */\n\t\t_previousSibling : function (dom) {\n\t\t\tdom = dom ? dom.previousSibling : null;\n\t\t\twhile(dom !== null && dom.nodeType !== 1) {\n\t\t\t\tdom = dom.previousSibling;\n\t\t\t}\n\t\t\treturn dom;\n\t\t},\n\t\t/**\n\t\t * get the JSON representation of a node (or the actual jQuery extended DOM node) by using any input (child DOM element, ID string, selector, etc)\n\t\t * @name get_node(obj [, as_dom])\n\t\t * @param  {mixed} obj\n\t\t * @param  {Boolean} as_dom\n\t\t * @return {Object|jQuery}\n\t\t */\n\t\tget_node : function (obj, as_dom) {\n\t\t\tif(obj && obj.id) {\n\t\t\t\tobj = obj.id;\n\t\t\t}\n\t\t\tif (obj instanceof $ && obj.length && obj[0].id) {\n\t\t\t\tobj = obj[0].id;\n\t\t\t}\n\t\t\tvar dom;\n\t\t\ttry {\n\t\t\t\tif(this._model.data[obj]) {\n\t\t\t\t\tobj = this._model.data[obj];\n\t\t\t\t}\n\t\t\t\telse if(typeof obj === \"string\" && this._model.data[obj.replace(/^#/, '')]) {\n\t\t\t\t\tobj = this._model.data[obj.replace(/^#/, '')];\n\t\t\t\t}\n\t\t\t\telse if(typeof obj === \"string\" && (dom = $('#' + obj.replace($.jstree.idregex,'\\\\$&'), this.element)).length && this._model.data[dom.closest('.jstree-node').attr('id')]) {\n\t\t\t\t\tobj = this._model.data[dom.closest('.jstree-node').attr('id')];\n\t\t\t\t}\n\t\t\t\telse if((dom = this.element.find(obj)).length && this._model.data[dom.closest('.jstree-node').attr('id')]) {\n\t\t\t\t\tobj = this._model.data[dom.closest('.jstree-node').attr('id')];\n\t\t\t\t}\n\t\t\t\telse if((dom = this.element.find(obj)).length && dom.hasClass('jstree')) {\n\t\t\t\t\tobj = this._model.data[$.jstree.root];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif(as_dom) {\n\t\t\t\t\tobj = obj.id === $.jstree.root ? this.element : $('#' + obj.id.replace($.jstree.idregex,'\\\\$&'), this.element);\n\t\t\t\t}\n\t\t\t\treturn obj;\n\t\t\t} catch (ex) { return false; }\n\t\t},\n\t\t/**\n\t\t * get the path to a node, either consisting of node texts, or of node IDs, optionally glued together (otherwise an array)\n\t\t * @name get_path(obj [, glue, ids])\n\t\t * @param  {mixed} obj the node\n\t\t * @param  {String} glue if you want the path as a string - pass the glue here (for example '/'), if a falsy value is supplied here, an array is returned\n\t\t * @param  {Boolean} ids if set to true build the path using ID, otherwise node text is used\n\t\t * @return {mixed}\n\t\t */\n\t\tget_path : function (obj, glue, ids) {\n\t\t\tobj = obj.parents ? obj : this.get_node(obj);\n\t\t\tif(!obj || obj.id === $.jstree.root || !obj.parents) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar i, j, p = [];\n\t\t\tp.push(ids ? obj.id : obj.text);\n\t\t\tfor(i = 0, j = obj.parents.length; i < j; i++) {\n\t\t\t\tp.push(ids ? obj.parents[i] : this.get_text(obj.parents[i]));\n\t\t\t}\n\t\t\tp = p.reverse().slice(1);\n\t\t\treturn glue ? p.join(glue) : p;\n\t\t},\n\t\t/**\n\t\t * get the next visible node that is below the `obj` node. If `strict` is set to `true` only sibling nodes are returned.\n\t\t * @name get_next_dom(obj [, strict])\n\t\t * @param  {mixed} obj\n\t\t * @param  {Boolean} strict\n\t\t * @return {jQuery}\n\t\t */\n\t\tget_next_dom : function (obj, strict) {\n\t\t\tvar tmp;\n\t\t\tobj = this.get_node(obj, true);\n\t\t\tif(obj[0] === this.element[0]) {\n\t\t\t\ttmp = this._firstChild(this.get_container_ul()[0]);\n\t\t\t\twhile (tmp && tmp.offsetHeight === 0) {\n\t\t\t\t\ttmp = this._nextSibling(tmp);\n\t\t\t\t}\n\t\t\t\treturn tmp ? $(tmp) : false;\n\t\t\t}\n\t\t\tif(!obj || !obj.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(strict) {\n\t\t\t\ttmp = obj[0];\n\t\t\t\tdo {\n\t\t\t\t\ttmp = this._nextSibling(tmp);\n\t\t\t\t} while (tmp && tmp.offsetHeight === 0);\n\t\t\t\treturn tmp ? $(tmp) : false;\n\t\t\t}\n\t\t\tif(obj.hasClass(\"jstree-open\")) {\n\t\t\t\ttmp = this._firstChild(obj.children('.jstree-children')[0]);\n\t\t\t\twhile (tmp && tmp.offsetHeight === 0) {\n\t\t\t\t\ttmp = this._nextSibling(tmp);\n\t\t\t\t}\n\t\t\t\tif(tmp !== null) {\n\t\t\t\t\treturn $(tmp);\n\t\t\t\t}\n\t\t\t}\n\t\t\ttmp = obj[0];\n\t\t\tdo {\n\t\t\t\ttmp = this._nextSibling(tmp);\n\t\t\t} while (tmp && tmp.offsetHeight === 0);\n\t\t\tif(tmp !== null) {\n\t\t\t\treturn $(tmp);\n\t\t\t}\n\t\t\treturn obj.parentsUntil(\".jstree\",\".jstree-node\").nextAll(\".jstree-node:visible\").first();\n\t\t},\n\t\t/**\n\t\t * get the previous visible node that is above the `obj` node. If `strict` is set to `true` only sibling nodes are returned.\n\t\t * @name get_prev_dom(obj [, strict])\n\t\t * @param  {mixed} obj\n\t\t * @param  {Boolean} strict\n\t\t * @return {jQuery}\n\t\t */\n\t\tget_prev_dom : function (obj, strict) {\n\t\t\tvar tmp;\n\t\t\tobj = this.get_node(obj, true);\n\t\t\tif(obj[0] === this.element[0]) {\n\t\t\t\ttmp = this.get_container_ul()[0].lastChild;\n\t\t\t\twhile (tmp && tmp.offsetHeight === 0) {\n\t\t\t\t\ttmp = this._previousSibling(tmp);\n\t\t\t\t}\n\t\t\t\treturn tmp ? $(tmp) : false;\n\t\t\t}\n\t\t\tif(!obj || !obj.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(strict) {\n\t\t\t\ttmp = obj[0];\n\t\t\t\tdo {\n\t\t\t\t\ttmp = this._previousSibling(tmp);\n\t\t\t\t} while (tmp && tmp.offsetHeight === 0);\n\t\t\t\treturn tmp ? $(tmp) : false;\n\t\t\t}\n\t\t\ttmp = obj[0];\n\t\t\tdo {\n\t\t\t\ttmp = this._previousSibling(tmp);\n\t\t\t} while (tmp && tmp.offsetHeight === 0);\n\t\t\tif(tmp !== null) {\n\t\t\t\tobj = $(tmp);\n\t\t\t\twhile(obj.hasClass(\"jstree-open\")) {\n\t\t\t\t\tobj = obj.children(\".jstree-children\").first().children(\".jstree-node:visible:last\");\n\t\t\t\t}\n\t\t\t\treturn obj;\n\t\t\t}\n\t\t\ttmp = obj[0].parentNode.parentNode;\n\t\t\treturn tmp && tmp.className && tmp.className.indexOf('jstree-node') !== -1 ? $(tmp) : false;\n\t\t},\n\t\t/**\n\t\t * get the parent ID of a node\n\t\t * @name get_parent(obj)\n\t\t * @param  {mixed} obj\n\t\t * @return {String}\n\t\t */\n\t\tget_parent : function (obj) {\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(!obj || obj.id === $.jstree.root) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn obj.parent;\n\t\t},\n\t\t/**\n\t\t * get a jQuery collection of all the children of a node (node must be rendered), returns false on error\n\t\t * @name get_children_dom(obj)\n\t\t * @param  {mixed} obj\n\t\t * @return {jQuery}\n\t\t */\n\t\tget_children_dom : function (obj) {\n\t\t\tobj = this.get_node(obj, true);\n\t\t\tif(obj[0] === this.element[0]) {\n\t\t\t\treturn this.get_container_ul().children(\".jstree-node\");\n\t\t\t}\n\t\t\tif(!obj || !obj.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn obj.children(\".jstree-children\").children(\".jstree-node\");\n\t\t},\n\t\t/**\n\t\t * checks if a node has children\n\t\t * @name is_parent(obj)\n\t\t * @param  {mixed} obj\n\t\t * @return {Boolean}\n\t\t */\n\t\tis_parent : function (obj) {\n\t\t\tobj = this.get_node(obj);\n\t\t\treturn obj && (obj.state.loaded === false || obj.children.length > 0);\n\t\t},\n\t\t/**\n\t\t * checks if a node is loaded (its children are available)\n\t\t * @name is_loaded(obj)\n\t\t * @param  {mixed} obj\n\t\t * @return {Boolean}\n\t\t */\n\t\tis_loaded : function (obj) {\n\t\t\tobj = this.get_node(obj);\n\t\t\treturn obj && obj.state.loaded;\n\t\t},\n\t\t/**\n\t\t * check if a node is currently loading (fetching children)\n\t\t * @name is_loading(obj)\n\t\t * @param  {mixed} obj\n\t\t * @return {Boolean}\n\t\t */\n\t\tis_loading : function (obj) {\n\t\t\tobj = this.get_node(obj);\n\t\t\treturn obj && obj.state && obj.state.loading;\n\t\t},\n\t\t/**\n\t\t * check if a node is opened\n\t\t * @name is_open(obj)\n\t\t * @param  {mixed} obj\n\t\t * @return {Boolean}\n\t\t */\n\t\tis_open : function (obj) {\n\t\t\tobj = this.get_node(obj);\n\t\t\treturn obj && obj.state.opened;\n\t\t},\n\t\t/**\n\t\t * check if a node is in a closed state\n\t\t * @name is_closed(obj)\n\t\t * @param  {mixed} obj\n\t\t * @return {Boolean}\n\t\t */\n\t\tis_closed : function (obj) {\n\t\t\tobj = this.get_node(obj);\n\t\t\treturn obj && this.is_parent(obj) && !obj.state.opened;\n\t\t},\n\t\t/**\n\t\t * check if a node has no children\n\t\t * @name is_leaf(obj)\n\t\t * @param  {mixed} obj\n\t\t * @return {Boolean}\n\t\t */\n\t\tis_leaf : function (obj) {\n\t\t\treturn !this.is_parent(obj);\n\t\t},\n\t\t/**\n\t\t * loads a node (fetches its children using the `core.data` setting). Multiple nodes can be passed to by using an array.\n\t\t * @name load_node(obj [, callback])\n\t\t * @param  {mixed} obj\n\t\t * @param  {function} callback a function to be executed once loading is complete, the function is executed in the instance's scope and receives two arguments - the node and a boolean status\n\t\t * @return {Boolean}\n\t\t * @trigger load_node.jstree\n\t\t */\n\t\tload_node : function (obj, callback) {\n\t\t\tvar k, l, i, j, c;\n\t\t\tif($.isArray(obj)) {\n\t\t\t\tthis._load_nodes(obj.slice(), callback);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(!obj) {\n\t\t\t\tif(callback) { callback.call(this, obj, false); }\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// if(obj.state.loading) { } // the node is already loading - just wait for it to load and invoke callback? but if called implicitly it should be loaded again?\n\t\t\tif(obj.state.loaded) {\n\t\t\t\tobj.state.loaded = false;\n\t\t\t\tfor(i = 0, j = obj.parents.length; i < j; i++) {\n\t\t\t\t\tthis._model.data[obj.parents[i]].children_d = $.vakata.array_filter(this._model.data[obj.parents[i]].children_d, function (v) {\n\t\t\t\t\t\treturn $.inArray(v, obj.children_d) === -1;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tfor(k = 0, l = obj.children_d.length; k < l; k++) {\n\t\t\t\t\tif(this._model.data[obj.children_d[k]].state.selected) {\n\t\t\t\t\t\tc = true;\n\t\t\t\t\t}\n\t\t\t\t\tdelete this._model.data[obj.children_d[k]];\n\t\t\t\t}\n\t\t\t\tif (c) {\n\t\t\t\t\tthis._data.core.selected = $.vakata.array_filter(this._data.core.selected, function (v) {\n\t\t\t\t\t\treturn $.inArray(v, obj.children_d) === -1;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tobj.children = [];\n\t\t\t\tobj.children_d = [];\n\t\t\t\tif(c) {\n\t\t\t\t\tthis.trigger('changed', { 'action' : 'load_node', 'node' : obj, 'selected' : this._data.core.selected });\n\t\t\t\t}\n\t\t\t}\n\t\t\tobj.state.failed = false;\n\t\t\tobj.state.loading = true;\n\t\t\tthis.get_node(obj, true).addClass(\"jstree-loading\").attr('aria-busy',true);\n\t\t\tthis._load_node(obj, $.proxy(function (status) {\n\t\t\t\tobj = this._model.data[obj.id];\n\t\t\t\tobj.state.loading = false;\n\t\t\t\tobj.state.loaded = status;\n\t\t\t\tobj.state.failed = !obj.state.loaded;\n\t\t\t\tvar dom = this.get_node(obj, true), i = 0, j = 0, m = this._model.data, has_children = false;\n\t\t\t\tfor(i = 0, j = obj.children.length; i < j; i++) {\n\t\t\t\t\tif(m[obj.children[i]] && !m[obj.children[i]].state.hidden) {\n\t\t\t\t\t\thas_children = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(obj.state.loaded && dom && dom.length) {\n\t\t\t\t\tdom.removeClass('jstree-closed jstree-open jstree-leaf');\n\t\t\t\t\tif (!has_children) {\n\t\t\t\t\t\tdom.addClass('jstree-leaf');\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (obj.id !== '#') {\n\t\t\t\t\t\t\tdom.addClass(obj.state.opened ? 'jstree-open' : 'jstree-closed');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tdom.removeClass(\"jstree-loading\").attr('aria-busy',false);\n\t\t\t\t/**\n\t\t\t\t * triggered after a node is loaded\n\t\t\t\t * @event\n\t\t\t\t * @name load_node.jstree\n\t\t\t\t * @param {Object} node the node that was loading\n\t\t\t\t * @param {Boolean} status was the node loaded successfully\n\t\t\t\t */\n\t\t\t\tthis.trigger('load_node', { \"node\" : obj, \"status\" : status });\n\t\t\t\tif(callback) {\n\t\t\t\t\tcallback.call(this, obj, status);\n\t\t\t\t}\n\t\t\t}, this));\n\t\t\treturn true;\n\t\t},\n\t\t/**\n\t\t * load an array of nodes (will also load unavailable nodes as soon as they appear in the structure). Used internally.\n\t\t * @private\n\t\t * @name _load_nodes(nodes [, callback])\n\t\t * @param  {array} nodes\n\t\t * @param  {function} callback a function to be executed once loading is complete, the function is executed in the instance's scope and receives one argument - the array passed to _load_nodes\n\t\t */\n\t\t_load_nodes : function (nodes, callback, is_callback, force_reload) {\n\t\t\tvar r = true,\n\t\t\t\tc = function () { this._load_nodes(nodes, callback, true); },\n\t\t\t\tm = this._model.data, i, j, tmp = [];\n\t\t\tfor(i = 0, j = nodes.length; i < j; i++) {\n\t\t\t\tif(m[nodes[i]] && ( (!m[nodes[i]].state.loaded && !m[nodes[i]].state.failed) || (!is_callback && force_reload) )) {\n\t\t\t\t\tif(!this.is_loading(nodes[i])) {\n\t\t\t\t\t\tthis.load_node(nodes[i], c);\n\t\t\t\t\t}\n\t\t\t\t\tr = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(r) {\n\t\t\t\tfor(i = 0, j = nodes.length; i < j; i++) {\n\t\t\t\t\tif(m[nodes[i]] && m[nodes[i]].state.loaded) {\n\t\t\t\t\t\ttmp.push(nodes[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(callback && !callback.done) {\n\t\t\t\t\tcallback.call(this, tmp);\n\t\t\t\t\tcallback.done = true;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * loads all unloaded nodes\n\t\t * @name load_all([obj, callback])\n\t\t * @param {mixed} obj the node to load recursively, omit to load all nodes in the tree\n\t\t * @param {function} callback a function to be executed once loading all the nodes is complete,\n\t\t * @trigger load_all.jstree\n\t\t */\n\t\tload_all : function (obj, callback) {\n\t\t\tif(!obj) { obj = $.jstree.root; }\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(!obj) { return false; }\n\t\t\tvar to_load = [],\n\t\t\t\tm = this._model.data,\n\t\t\t\tc = m[obj.id].children_d,\n\t\t\t\ti, j;\n\t\t\tif(obj.state && !obj.state.loaded) {\n\t\t\t\tto_load.push(obj.id);\n\t\t\t}\n\t\t\tfor(i = 0, j = c.length; i < j; i++) {\n\t\t\t\tif(m[c[i]] && m[c[i]].state && !m[c[i]].state.loaded) {\n\t\t\t\t\tto_load.push(c[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(to_load.length) {\n\t\t\t\tthis._load_nodes(to_load, function () {\n\t\t\t\t\tthis.load_all(obj, callback);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\t/**\n\t\t\t\t * triggered after a load_all call completes\n\t\t\t\t * @event\n\t\t\t\t * @name load_all.jstree\n\t\t\t\t * @param {Object} node the recursively loaded node\n\t\t\t\t */\n\t\t\t\tif(callback) { callback.call(this, obj); }\n\t\t\t\tthis.trigger('load_all', { \"node\" : obj });\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * handles the actual loading of a node. Used only internally.\n\t\t * @private\n\t\t * @name _load_node(obj [, callback])\n\t\t * @param  {mixed} obj\n\t\t * @param  {function} callback a function to be executed once loading is complete, the function is executed in the instance's scope and receives one argument - a boolean status\n\t\t * @return {Boolean}\n\t\t */\n\t\t_load_node : function (obj, callback) {\n\t\t\tvar s = this.settings.core.data, t;\n\t\t\tvar notTextOrCommentNode = function notTextOrCommentNode () {\n\t\t\t\treturn this.nodeType !== 3 && this.nodeType !== 8;\n\t\t\t};\n\t\t\t// use original HTML\n\t\t\tif(!s) {\n\t\t\t\tif(obj.id === $.jstree.root) {\n\t\t\t\t\treturn this._append_html_data(obj, this._data.core.original_container_html.clone(true), function (status) {\n\t\t\t\t\t\tcallback.call(this, status);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn callback.call(this, false);\n\t\t\t\t}\n\t\t\t\t// return callback.call(this, obj.id === $.jstree.root ? this._append_html_data(obj, this._data.core.original_container_html.clone(true)) : false);\n\t\t\t}\n\t\t\tif($.isFunction(s)) {\n\t\t\t\treturn s.call(this, obj, $.proxy(function (d) {\n\t\t\t\t\tif(d === false) {\n\t\t\t\t\t\tcallback.call(this, false);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tthis[typeof d === 'string' ? '_append_html_data' : '_append_json_data'](obj, typeof d === 'string' ? $($.parseHTML(d)).filter(notTextOrCommentNode) : d, function (status) {\n\t\t\t\t\t\t\tcallback.call(this, status);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\t// return d === false ? callback.call(this, false) : callback.call(this, this[typeof d === 'string' ? '_append_html_data' : '_append_json_data'](obj, typeof d === 'string' ? $(d) : d));\n\t\t\t\t}, this));\n\t\t\t}\n\t\t\tif(typeof s === 'object') {\n\t\t\t\tif(s.url) {\n\t\t\t\t\ts = $.extend(true, {}, s);\n\t\t\t\t\tif($.isFunction(s.url)) {\n\t\t\t\t\t\ts.url = s.url.call(this, obj);\n\t\t\t\t\t}\n\t\t\t\t\tif($.isFunction(s.data)) {\n\t\t\t\t\t\ts.data = s.data.call(this, obj);\n\t\t\t\t\t}\n\t\t\t\t\treturn $.ajax(s)\n\t\t\t\t\t\t.done($.proxy(function (d,t,x) {\n\t\t\t\t\t\t\t\tvar type = x.getResponseHeader('Content-Type');\n\t\t\t\t\t\t\t\tif((type && type.indexOf('json') !== -1) || typeof d === \"object\") {\n\t\t\t\t\t\t\t\t\treturn this._append_json_data(obj, d, function (status) { callback.call(this, status); });\n\t\t\t\t\t\t\t\t\t//return callback.call(this, this._append_json_data(obj, d));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif((type && type.indexOf('html') !== -1) || typeof d === \"string\") {\n\t\t\t\t\t\t\t\t\treturn this._append_html_data(obj, $($.parseHTML(d)).filter(notTextOrCommentNode), function (status) { callback.call(this, status); });\n\t\t\t\t\t\t\t\t\t// return callback.call(this, this._append_html_data(obj, $(d)));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tthis._data.core.last_error = { 'error' : 'ajax', 'plugin' : 'core', 'id' : 'core_04', 'reason' : 'Could not load node', 'data' : JSON.stringify({ 'id' : obj.id, 'xhr' : x }) };\n\t\t\t\t\t\t\t\tthis.settings.core.error.call(this, this._data.core.last_error);\n\t\t\t\t\t\t\t\treturn callback.call(this, false);\n\t\t\t\t\t\t\t}, this))\n\t\t\t\t\t\t.fail($.proxy(function (f) {\n\t\t\t\t\t\t\t\tthis._data.core.last_error = { 'error' : 'ajax', 'plugin' : 'core', 'id' : 'core_04', 'reason' : 'Could not load node', 'data' : JSON.stringify({ 'id' : obj.id, 'xhr' : f }) };\n\t\t\t\t\t\t\t\tcallback.call(this, false);\n\t\t\t\t\t\t\t\tthis.settings.core.error.call(this, this._data.core.last_error);\n\t\t\t\t\t\t\t}, this));\n\t\t\t\t}\n\t\t\t\tif ($.isArray(s)) {\n\t\t\t\t\tt = $.extend(true, [], s);\n\t\t\t\t} else if ($.isPlainObject(s)) {\n\t\t\t\t\tt = $.extend(true, {}, s);\n\t\t\t\t} else {\n\t\t\t\t\tt = s;\n\t\t\t\t}\n\t\t\t\tif(obj.id === $.jstree.root) {\n\t\t\t\t\treturn this._append_json_data(obj, t, function (status) {\n\t\t\t\t\t\tcallback.call(this, status);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis._data.core.last_error = { 'error' : 'nodata', 'plugin' : 'core', 'id' : 'core_05', 'reason' : 'Could not load node', 'data' : JSON.stringify({ 'id' : obj.id }) };\n\t\t\t\t\tthis.settings.core.error.call(this, this._data.core.last_error);\n\t\t\t\t\treturn callback.call(this, false);\n\t\t\t\t}\n\t\t\t\t//return callback.call(this, (obj.id === $.jstree.root ? this._append_json_data(obj, t) : false) );\n\t\t\t}\n\t\t\tif(typeof s === 'string') {\n\t\t\t\tif(obj.id === $.jstree.root) {\n\t\t\t\t\treturn this._append_html_data(obj, $($.parseHTML(s)).filter(notTextOrCommentNode), function (status) {\n\t\t\t\t\t\tcallback.call(this, status);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis._data.core.last_error = { 'error' : 'nodata', 'plugin' : 'core', 'id' : 'core_06', 'reason' : 'Could not load node', 'data' : JSON.stringify({ 'id' : obj.id }) };\n\t\t\t\t\tthis.settings.core.error.call(this, this._data.core.last_error);\n\t\t\t\t\treturn callback.call(this, false);\n\t\t\t\t}\n\t\t\t\t//return callback.call(this, (obj.id === $.jstree.root ? this._append_html_data(obj, $(s)) : false) );\n\t\t\t}\n\t\t\treturn callback.call(this, false);\n\t\t},\n\t\t/**\n\t\t * adds a node to the list of nodes to redraw. Used only internally.\n\t\t * @private\n\t\t * @name _node_changed(obj [, callback])\n\t\t * @param  {mixed} obj\n\t\t */\n\t\t_node_changed : function (obj) {\n\t\t\tobj = this.get_node(obj);\n      if (obj && $.inArray(obj.id, this._model.changed) === -1) {\n\t\t\t\tthis._model.changed.push(obj.id);\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * appends HTML content to the tree. Used internally.\n\t\t * @private\n\t\t * @name _append_html_data(obj, data)\n\t\t * @param  {mixed} obj the node to append to\n\t\t * @param  {String} data the HTML string to parse and append\n\t\t * @trigger model.jstree, changed.jstree\n\t\t */\n\t\t_append_html_data : function (dom, data, cb) {\n\t\t\tdom = this.get_node(dom);\n\t\t\tdom.children = [];\n\t\t\tdom.children_d = [];\n\t\t\tvar dat = data.is('ul') ? data.children() : data,\n\t\t\t\tpar = dom.id,\n\t\t\t\tchd = [],\n\t\t\t\tdpc = [],\n\t\t\t\tm = this._model.data,\n\t\t\t\tp = m[par],\n\t\t\t\ts = this._data.core.selected.length,\n\t\t\t\ttmp, i, j;\n\t\t\tdat.each($.proxy(function (i, v) {\n\t\t\t\ttmp = this._parse_model_from_html($(v), par, p.parents.concat());\n\t\t\t\tif(tmp) {\n\t\t\t\t\tchd.push(tmp);\n\t\t\t\t\tdpc.push(tmp);\n\t\t\t\t\tif(m[tmp].children_d.length) {\n\t\t\t\t\t\tdpc = dpc.concat(m[tmp].children_d);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, this));\n\t\t\tp.children = chd;\n\t\t\tp.children_d = dpc;\n\t\t\tfor(i = 0, j = p.parents.length; i < j; i++) {\n\t\t\t\tm[p.parents[i]].children_d = m[p.parents[i]].children_d.concat(dpc);\n\t\t\t}\n\t\t\t/**\n\t\t\t * triggered when new data is inserted to the tree model\n\t\t\t * @event\n\t\t\t * @name model.jstree\n\t\t\t * @param {Array} nodes an array of node IDs\n\t\t\t * @param {String} parent the parent ID of the nodes\n\t\t\t */\n\t\t\tthis.trigger('model', { \"nodes\" : dpc, 'parent' : par });\n\t\t\tif(par !== $.jstree.root) {\n\t\t\t\tthis._node_changed(par);\n\t\t\t\tthis.redraw();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.get_container_ul().children('.jstree-initial-node').remove();\n\t\t\t\tthis.redraw(true);\n\t\t\t}\n\t\t\tif(this._data.core.selected.length !== s) {\n\t\t\t\tthis.trigger('changed', { 'action' : 'model', 'selected' : this._data.core.selected });\n\t\t\t}\n\t\t\tcb.call(this, true);\n\t\t},\n\t\t/**\n\t\t * appends JSON content to the tree. Used internally.\n\t\t * @private\n\t\t * @name _append_json_data(obj, data)\n\t\t * @param  {mixed} obj the node to append to\n\t\t * @param  {String} data the JSON object to parse and append\n\t\t * @param  {Boolean} force_processing internal param - do not set\n\t\t * @trigger model.jstree, changed.jstree\n\t\t */\n\t\t_append_json_data : function (dom, data, cb, force_processing) {\n\t\t\tif(this.element === null) { return; }\n\t\t\tdom = this.get_node(dom);\n\t\t\tdom.children = [];\n\t\t\tdom.children_d = [];\n\t\t\t// *%$@!!!\n\t\t\tif(data.d) {\n\t\t\t\tdata = data.d;\n\t\t\t\tif(typeof data === \"string\") {\n\t\t\t\t\tdata = JSON.parse(data);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!$.isArray(data)) { data = [data]; }\n\t\t\tvar w = null,\n\t\t\t\targs = {\n\t\t\t\t\t'df'\t: this._model.default_state,\n\t\t\t\t\t'dat'\t: data,\n\t\t\t\t\t'par'\t: dom.id,\n\t\t\t\t\t'm'\t\t: this._model.data,\n\t\t\t\t\t't_id'\t: this._id,\n\t\t\t\t\t't_cnt'\t: this._cnt,\n\t\t\t\t\t'sel'\t: this._data.core.selected\n\t\t\t\t},\n\t\t\t\tinst = this,\n\t\t\t\tfunc = function (data, undefined) {\n\t\t\t\t\tif(data.data) { data = data.data; }\n\t\t\t\t\tvar dat = data.dat,\n\t\t\t\t\t\tpar = data.par,\n\t\t\t\t\t\tchd = [],\n\t\t\t\t\t\tdpc = [],\n\t\t\t\t\t\tadd = [],\n\t\t\t\t\t\tdf = data.df,\n\t\t\t\t\t\tt_id = data.t_id,\n\t\t\t\t\t\tt_cnt = data.t_cnt,\n\t\t\t\t\t\tm = data.m,\n\t\t\t\t\t\tp = m[par],\n\t\t\t\t\t\tsel = data.sel,\n\t\t\t\t\t\ttmp, i, j, rslt,\n\t\t\t\t\t\tparse_flat = function (d, p, ps) {\n\t\t\t\t\t\t\tif(!ps) { ps = []; }\n\t\t\t\t\t\t\telse { ps = ps.concat(); }\n\t\t\t\t\t\t\tif(p) { ps.unshift(p); }\n\t\t\t\t\t\t\tvar tid = d.id.toString(),\n\t\t\t\t\t\t\t\ti, j, c, e,\n\t\t\t\t\t\t\t\ttmp = {\n\t\t\t\t\t\t\t\t\tid\t\t\t: tid,\n\t\t\t\t\t\t\t\t\ttext\t\t: d.text || '',\n\t\t\t\t\t\t\t\t\ticon\t\t: d.icon !== undefined ? d.icon : true,\n\t\t\t\t\t\t\t\t\tparent\t\t: p,\n\t\t\t\t\t\t\t\t\tparents\t\t: ps,\n\t\t\t\t\t\t\t\t\tchildren\t: d.children || [],\n\t\t\t\t\t\t\t\t\tchildren_d\t: d.children_d || [],\n\t\t\t\t\t\t\t\t\tdata\t\t: d.data,\n\t\t\t\t\t\t\t\t\tstate\t\t: { },\n\t\t\t\t\t\t\t\t\tli_attr\t\t: { id : false },\n\t\t\t\t\t\t\t\t\ta_attr\t\t: { href : '#' },\n\t\t\t\t\t\t\t\t\toriginal\t: false\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tfor(i in df) {\n\t\t\t\t\t\t\t\tif(df.hasOwnProperty(i)) {\n\t\t\t\t\t\t\t\t\ttmp.state[i] = df[i];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(d && d.data && d.data.jstree && d.data.jstree.icon) {\n\t\t\t\t\t\t\t\ttmp.icon = d.data.jstree.icon;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(tmp.icon === undefined || tmp.icon === null || tmp.icon === \"\") {\n\t\t\t\t\t\t\t\ttmp.icon = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(d && d.data) {\n\t\t\t\t\t\t\t\ttmp.data = d.data;\n\t\t\t\t\t\t\t\tif(d.data.jstree) {\n\t\t\t\t\t\t\t\t\tfor(i in d.data.jstree) {\n\t\t\t\t\t\t\t\t\t\tif(d.data.jstree.hasOwnProperty(i)) {\n\t\t\t\t\t\t\t\t\t\t\ttmp.state[i] = d.data.jstree[i];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(d && typeof d.state === 'object') {\n\t\t\t\t\t\t\t\tfor (i in d.state) {\n\t\t\t\t\t\t\t\t\tif(d.state.hasOwnProperty(i)) {\n\t\t\t\t\t\t\t\t\t\ttmp.state[i] = d.state[i];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(d && typeof d.li_attr === 'object') {\n\t\t\t\t\t\t\t\tfor (i in d.li_attr) {\n\t\t\t\t\t\t\t\t\tif(d.li_attr.hasOwnProperty(i)) {\n\t\t\t\t\t\t\t\t\t\ttmp.li_attr[i] = d.li_attr[i];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!tmp.li_attr.id) {\n\t\t\t\t\t\t\t\ttmp.li_attr.id = tid;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(d && typeof d.a_attr === 'object') {\n\t\t\t\t\t\t\t\tfor (i in d.a_attr) {\n\t\t\t\t\t\t\t\t\tif(d.a_attr.hasOwnProperty(i)) {\n\t\t\t\t\t\t\t\t\t\ttmp.a_attr[i] = d.a_attr[i];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(d && d.children && d.children === true) {\n\t\t\t\t\t\t\t\ttmp.state.loaded = false;\n\t\t\t\t\t\t\t\ttmp.children = [];\n\t\t\t\t\t\t\t\ttmp.children_d = [];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tm[tmp.id] = tmp;\n\t\t\t\t\t\t\tfor(i = 0, j = tmp.children.length; i < j; i++) {\n\t\t\t\t\t\t\t\tc = parse_flat(m[tmp.children[i]], tmp.id, ps);\n\t\t\t\t\t\t\t\te = m[c];\n\t\t\t\t\t\t\t\ttmp.children_d.push(c);\n\t\t\t\t\t\t\t\tif(e.children_d.length) {\n\t\t\t\t\t\t\t\t\ttmp.children_d = tmp.children_d.concat(e.children_d);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdelete d.data;\n\t\t\t\t\t\t\tdelete d.children;\n\t\t\t\t\t\t\tm[tmp.id].original = d;\n\t\t\t\t\t\t\tif(tmp.state.selected) {\n\t\t\t\t\t\t\t\tadd.push(tmp.id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn tmp.id;\n\t\t\t\t\t\t},\n\t\t\t\t\t\tparse_nest = function (d, p, ps) {\n\t\t\t\t\t\t\tif(!ps) { ps = []; }\n\t\t\t\t\t\t\telse { ps = ps.concat(); }\n\t\t\t\t\t\t\tif(p) { ps.unshift(p); }\n\t\t\t\t\t\t\tvar tid = false, i, j, c, e, tmp;\n\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\ttid = 'j' + t_id + '_' + (++t_cnt);\n\t\t\t\t\t\t\t} while(m[tid]);\n\n\t\t\t\t\t\t\ttmp = {\n\t\t\t\t\t\t\t\tid\t\t\t: false,\n\t\t\t\t\t\t\t\ttext\t\t: typeof d === 'string' ? d : '',\n\t\t\t\t\t\t\t\ticon\t\t: typeof d === 'object' && d.icon !== undefined ? d.icon : true,\n\t\t\t\t\t\t\t\tparent\t\t: p,\n\t\t\t\t\t\t\t\tparents\t\t: ps,\n\t\t\t\t\t\t\t\tchildren\t: [],\n\t\t\t\t\t\t\t\tchildren_d\t: [],\n\t\t\t\t\t\t\t\tdata\t\t: null,\n\t\t\t\t\t\t\t\tstate\t\t: { },\n\t\t\t\t\t\t\t\tli_attr\t\t: { id : false },\n\t\t\t\t\t\t\t\ta_attr\t\t: { href : '#' },\n\t\t\t\t\t\t\t\toriginal\t: false\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tfor(i in df) {\n\t\t\t\t\t\t\t\tif(df.hasOwnProperty(i)) {\n\t\t\t\t\t\t\t\t\ttmp.state[i] = df[i];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(d && d.id) { tmp.id = d.id.toString(); }\n\t\t\t\t\t\t\tif(d && d.text) { tmp.text = d.text; }\n\t\t\t\t\t\t\tif(d && d.data && d.data.jstree && d.data.jstree.icon) {\n\t\t\t\t\t\t\t\ttmp.icon = d.data.jstree.icon;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(tmp.icon === undefined || tmp.icon === null || tmp.icon === \"\") {\n\t\t\t\t\t\t\t\ttmp.icon = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(d && d.data) {\n\t\t\t\t\t\t\t\ttmp.data = d.data;\n\t\t\t\t\t\t\t\tif(d.data.jstree) {\n\t\t\t\t\t\t\t\t\tfor(i in d.data.jstree) {\n\t\t\t\t\t\t\t\t\t\tif(d.data.jstree.hasOwnProperty(i)) {\n\t\t\t\t\t\t\t\t\t\t\ttmp.state[i] = d.data.jstree[i];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(d && typeof d.state === 'object') {\n\t\t\t\t\t\t\t\tfor (i in d.state) {\n\t\t\t\t\t\t\t\t\tif(d.state.hasOwnProperty(i)) {\n\t\t\t\t\t\t\t\t\t\ttmp.state[i] = d.state[i];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(d && typeof d.li_attr === 'object') {\n\t\t\t\t\t\t\t\tfor (i in d.li_attr) {\n\t\t\t\t\t\t\t\t\tif(d.li_attr.hasOwnProperty(i)) {\n\t\t\t\t\t\t\t\t\t\ttmp.li_attr[i] = d.li_attr[i];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(tmp.li_attr.id && !tmp.id) {\n\t\t\t\t\t\t\t\ttmp.id = tmp.li_attr.id.toString();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!tmp.id) {\n\t\t\t\t\t\t\t\ttmp.id = tid;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!tmp.li_attr.id) {\n\t\t\t\t\t\t\t\ttmp.li_attr.id = tmp.id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(d && typeof d.a_attr === 'object') {\n\t\t\t\t\t\t\t\tfor (i in d.a_attr) {\n\t\t\t\t\t\t\t\t\tif(d.a_attr.hasOwnProperty(i)) {\n\t\t\t\t\t\t\t\t\t\ttmp.a_attr[i] = d.a_attr[i];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(d && d.children && d.children.length) {\n\t\t\t\t\t\t\t\tfor(i = 0, j = d.children.length; i < j; i++) {\n\t\t\t\t\t\t\t\t\tc = parse_nest(d.children[i], tmp.id, ps);\n\t\t\t\t\t\t\t\t\te = m[c];\n\t\t\t\t\t\t\t\t\ttmp.children.push(c);\n\t\t\t\t\t\t\t\t\tif(e.children_d.length) {\n\t\t\t\t\t\t\t\t\t\ttmp.children_d = tmp.children_d.concat(e.children_d);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttmp.children_d = tmp.children_d.concat(tmp.children);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(d && d.children && d.children === true) {\n\t\t\t\t\t\t\t\ttmp.state.loaded = false;\n\t\t\t\t\t\t\t\ttmp.children = [];\n\t\t\t\t\t\t\t\ttmp.children_d = [];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdelete d.data;\n\t\t\t\t\t\t\tdelete d.children;\n\t\t\t\t\t\t\ttmp.original = d;\n\t\t\t\t\t\t\tm[tmp.id] = tmp;\n\t\t\t\t\t\t\tif(tmp.state.selected) {\n\t\t\t\t\t\t\t\tadd.push(tmp.id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn tmp.id;\n\t\t\t\t\t\t};\n\n\t\t\t\t\tif(dat.length && dat[0].id !== undefined && dat[0].parent !== undefined) {\n\t\t\t\t\t\t// Flat JSON support (for easy import from DB):\n\t\t\t\t\t\t// 1) convert to object (foreach)\n\t\t\t\t\t\tfor(i = 0, j = dat.length; i < j; i++) {\n\t\t\t\t\t\t\tif(!dat[i].children) {\n\t\t\t\t\t\t\t\tdat[i].children = [];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!dat[i].state) {\n\t\t\t\t\t\t\t\tdat[i].state = {};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tm[dat[i].id.toString()] = dat[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// 2) populate children (foreach)\n\t\t\t\t\t\tfor(i = 0, j = dat.length; i < j; i++) {\n\t\t\t\t\t\t\tif (!m[dat[i].parent.toString()]) {\n\t\t\t\t\t\t\t\tif (typeof inst !== \"undefined\") {\n\t\t\t\t\t\t\t\t\tinst._data.core.last_error = { 'error' : 'parse', 'plugin' : 'core', 'id' : 'core_07', 'reason' : 'Node with invalid parent', 'data' : JSON.stringify({ 'id' : dat[i].id.toString(), 'parent' : dat[i].parent.toString() }) };\n\t\t\t\t\t\t\t\t\tinst.settings.core.error.call(inst, inst._data.core.last_error);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tm[dat[i].parent.toString()].children.push(dat[i].id.toString());\n\t\t\t\t\t\t\t// populate parent.children_d\n\t\t\t\t\t\t\tp.children_d.push(dat[i].id.toString());\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// 3) normalize && populate parents and children_d with recursion\n\t\t\t\t\t\tfor(i = 0, j = p.children.length; i < j; i++) {\n\t\t\t\t\t\t\ttmp = parse_flat(m[p.children[i]], par, p.parents.concat());\n\t\t\t\t\t\t\tdpc.push(tmp);\n\t\t\t\t\t\t\tif(m[tmp].children_d.length) {\n\t\t\t\t\t\t\t\tdpc = dpc.concat(m[tmp].children_d);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor(i = 0, j = p.parents.length; i < j; i++) {\n\t\t\t\t\t\t\tm[p.parents[i]].children_d = m[p.parents[i]].children_d.concat(dpc);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// ?) three_state selection - p.state.selected && t - (if three_state foreach(dat => ch) -> foreach(parents) if(parent.selected) child.selected = true;\n\t\t\t\t\t\trslt = {\n\t\t\t\t\t\t\t'cnt' : t_cnt,\n\t\t\t\t\t\t\t'mod' : m,\n\t\t\t\t\t\t\t'sel' : sel,\n\t\t\t\t\t\t\t'par' : par,\n\t\t\t\t\t\t\t'dpc' : dpc,\n\t\t\t\t\t\t\t'add' : add\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tfor(i = 0, j = dat.length; i < j; i++) {\n\t\t\t\t\t\t\ttmp = parse_nest(dat[i], par, p.parents.concat());\n\t\t\t\t\t\t\tif(tmp) {\n\t\t\t\t\t\t\t\tchd.push(tmp);\n\t\t\t\t\t\t\t\tdpc.push(tmp);\n\t\t\t\t\t\t\t\tif(m[tmp].children_d.length) {\n\t\t\t\t\t\t\t\t\tdpc = dpc.concat(m[tmp].children_d);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tp.children = chd;\n\t\t\t\t\t\tp.children_d = dpc;\n\t\t\t\t\t\tfor(i = 0, j = p.parents.length; i < j; i++) {\n\t\t\t\t\t\t\tm[p.parents[i]].children_d = m[p.parents[i]].children_d.concat(dpc);\n\t\t\t\t\t\t}\n\t\t\t\t\t\trslt = {\n\t\t\t\t\t\t\t'cnt' : t_cnt,\n\t\t\t\t\t\t\t'mod' : m,\n\t\t\t\t\t\t\t'sel' : sel,\n\t\t\t\t\t\t\t'par' : par,\n\t\t\t\t\t\t\t'dpc' : dpc,\n\t\t\t\t\t\t\t'add' : add\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\tif(typeof window === 'undefined' || typeof window.document === 'undefined') {\n\t\t\t\t\t\tpostMessage(rslt);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\treturn rslt;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\trslt = function (rslt, worker) {\n\t\t\t\t\tif(this.element === null) { return; }\n\t\t\t\t\tthis._cnt = rslt.cnt;\n\t\t\t\t\tvar i, m = this._model.data;\n\t\t\t\t\tfor (i in m) {\n\t\t\t\t\t\tif (m.hasOwnProperty(i) && m[i].state && m[i].state.loading && rslt.mod[i]) {\n\t\t\t\t\t\t\trslt.mod[i].state.loading = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis._model.data = rslt.mod; // breaks the reference in load_node - careful\n\n\t\t\t\t\tif(worker) {\n\t\t\t\t\t\tvar j, a = rslt.add, r = rslt.sel, s = this._data.core.selected.slice();\n\t\t\t\t\t\tm = this._model.data;\n\t\t\t\t\t\t// if selection was changed while calculating in worker\n\t\t\t\t\t\tif(r.length !== s.length || $.vakata.array_unique(r.concat(s)).length !== r.length) {\n\t\t\t\t\t\t\t// deselect nodes that are no longer selected\n\t\t\t\t\t\t\tfor(i = 0, j = r.length; i < j; i++) {\n\t\t\t\t\t\t\t\tif($.inArray(r[i], a) === -1 && $.inArray(r[i], s) === -1) {\n\t\t\t\t\t\t\t\t\tm[r[i]].state.selected = false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// select nodes that were selected in the mean time\n\t\t\t\t\t\t\tfor(i = 0, j = s.length; i < j; i++) {\n\t\t\t\t\t\t\t\tif($.inArray(s[i], r) === -1) {\n\t\t\t\t\t\t\t\t\tm[s[i]].state.selected = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(rslt.add.length) {\n\t\t\t\t\t\tthis._data.core.selected = this._data.core.selected.concat(rslt.add);\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.trigger('model', { \"nodes\" : rslt.dpc, 'parent' : rslt.par });\n\n\t\t\t\t\tif(rslt.par !== $.jstree.root) {\n\t\t\t\t\t\tthis._node_changed(rslt.par);\n\t\t\t\t\t\tthis.redraw();\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// this.get_container_ul().children('.jstree-initial-node').remove();\n\t\t\t\t\t\tthis.redraw(true);\n\t\t\t\t\t}\n\t\t\t\t\tif(rslt.add.length) {\n\t\t\t\t\t\tthis.trigger('changed', { 'action' : 'model', 'selected' : this._data.core.selected });\n\t\t\t\t\t}\n\t\t\t\t\tcb.call(this, true);\n\t\t\t\t};\n\t\t\tif(this.settings.core.worker && window.Blob && window.URL && window.Worker) {\n\t\t\t\ttry {\n\t\t\t\t\tif(this._wrk === null) {\n\t\t\t\t\t\tthis._wrk = window.URL.createObjectURL(\n\t\t\t\t\t\t\tnew window.Blob(\n\t\t\t\t\t\t\t\t['self.onmessage = ' + func.toString()],\n\t\t\t\t\t\t\t\t{type:\"text/javascript\"}\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tif(!this._data.core.working || force_processing) {\n\t\t\t\t\t\tthis._data.core.working = true;\n\t\t\t\t\t\tw = new window.Worker(this._wrk);\n\t\t\t\t\t\tw.onmessage = $.proxy(function (e) {\n\t\t\t\t\t\t\trslt.call(this, e.data, true);\n\t\t\t\t\t\t\ttry { w.terminate(); w = null; } catch(ignore) { }\n\t\t\t\t\t\t\tif(this._data.core.worker_queue.length) {\n\t\t\t\t\t\t\t\tthis._append_json_data.apply(this, this._data.core.worker_queue.shift());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tthis._data.core.working = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, this);\n\t\t\t\t\t\tif(!args.par) {\n\t\t\t\t\t\t\tif(this._data.core.worker_queue.length) {\n\t\t\t\t\t\t\t\tthis._append_json_data.apply(this, this._data.core.worker_queue.shift());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tthis._data.core.working = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tw.postMessage(args);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tthis._data.core.worker_queue.push([dom, data, cb, true]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch(e) {\n\t\t\t\t\trslt.call(this, func(args), false);\n\t\t\t\t\tif(this._data.core.worker_queue.length) {\n\t\t\t\t\t\tthis._append_json_data.apply(this, this._data.core.worker_queue.shift());\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tthis._data.core.working = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\trslt.call(this, func(args), false);\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * parses a node from a jQuery object and appends them to the in memory tree model. Used internally.\n\t\t * @private\n\t\t * @name _parse_model_from_html(d [, p, ps])\n\t\t * @param  {jQuery} d the jQuery object to parse\n\t\t * @param  {String} p the parent ID\n\t\t * @param  {Array} ps list of all parents\n\t\t * @return {String} the ID of the object added to the model\n\t\t */\n\t\t_parse_model_from_html : function (d, p, ps) {\n\t\t\tif(!ps) { ps = []; }\n\t\t\telse { ps = [].concat(ps); }\n\t\t\tif(p) { ps.unshift(p); }\n\t\t\tvar c, e, m = this._model.data,\n\t\t\t\tdata = {\n\t\t\t\t\tid\t\t\t: false,\n\t\t\t\t\ttext\t\t: false,\n\t\t\t\t\ticon\t\t: true,\n\t\t\t\t\tparent\t\t: p,\n\t\t\t\t\tparents\t\t: ps,\n\t\t\t\t\tchildren\t: [],\n\t\t\t\t\tchildren_d\t: [],\n\t\t\t\t\tdata\t\t: null,\n\t\t\t\t\tstate\t\t: { },\n\t\t\t\t\tli_attr\t\t: { id : false },\n\t\t\t\t\ta_attr\t\t: { href : '#' },\n\t\t\t\t\toriginal\t: false\n\t\t\t\t}, i, tmp, tid;\n\t\t\tfor(i in this._model.default_state) {\n\t\t\t\tif(this._model.default_state.hasOwnProperty(i)) {\n\t\t\t\t\tdata.state[i] = this._model.default_state[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\ttmp = $.vakata.attributes(d, true);\n\t\t\t$.each(tmp, function (i, v) {\n\t\t\t\tv = $.trim(v);\n\t\t\t\tif(!v.length) { return true; }\n\t\t\t\tdata.li_attr[i] = v;\n\t\t\t\tif(i === 'id') {\n\t\t\t\t\tdata.id = v.toString();\n\t\t\t\t}\n\t\t\t});\n\t\t\ttmp = d.children('a').first();\n\t\t\tif(tmp.length) {\n\t\t\t\ttmp = $.vakata.attributes(tmp, true);\n\t\t\t\t$.each(tmp, function (i, v) {\n\t\t\t\t\tv = $.trim(v);\n\t\t\t\t\tif(v.length) {\n\t\t\t\t\t\tdata.a_attr[i] = v;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\ttmp = d.children(\"a\").first().length ? d.children(\"a\").first().clone() : d.clone();\n\t\t\ttmp.children(\"ins, i, ul\").remove();\n\t\t\ttmp = tmp.html();\n\t\t\ttmp = $('<div />').html(tmp);\n\t\t\tdata.text = this.settings.core.force_text ? tmp.text() : tmp.html();\n\t\t\ttmp = d.data();\n\t\t\tdata.data = tmp ? $.extend(true, {}, tmp) : null;\n\t\t\tdata.state.opened = d.hasClass('jstree-open');\n\t\t\tdata.state.selected = d.children('a').hasClass('jstree-clicked');\n\t\t\tdata.state.disabled = d.children('a').hasClass('jstree-disabled');\n\t\t\tif(data.data && data.data.jstree) {\n\t\t\t\tfor(i in data.data.jstree) {\n\t\t\t\t\tif(data.data.jstree.hasOwnProperty(i)) {\n\t\t\t\t\t\tdata.state[i] = data.data.jstree[i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\ttmp = d.children(\"a\").children(\".jstree-themeicon\");\n\t\t\tif(tmp.length) {\n\t\t\t\tdata.icon = tmp.hasClass('jstree-themeicon-hidden') ? false : tmp.attr('rel');\n\t\t\t}\n\t\t\tif(data.state.icon !== undefined) {\n\t\t\t\tdata.icon = data.state.icon;\n\t\t\t}\n\t\t\tif(data.icon === undefined || data.icon === null || data.icon === \"\") {\n\t\t\t\tdata.icon = true;\n\t\t\t}\n\t\t\ttmp = d.children(\"ul\").children(\"li\");\n\t\t\tdo {\n\t\t\t\ttid = 'j' + this._id + '_' + (++this._cnt);\n\t\t\t} while(m[tid]);\n\t\t\tdata.id = data.li_attr.id ? data.li_attr.id.toString() : tid;\n\t\t\tif(tmp.length) {\n\t\t\t\ttmp.each($.proxy(function (i, v) {\n\t\t\t\t\tc = this._parse_model_from_html($(v), data.id, ps);\n\t\t\t\t\te = this._model.data[c];\n\t\t\t\t\tdata.children.push(c);\n\t\t\t\t\tif(e.children_d.length) {\n\t\t\t\t\t\tdata.children_d = data.children_d.concat(e.children_d);\n\t\t\t\t\t}\n\t\t\t\t}, this));\n\t\t\t\tdata.children_d = data.children_d.concat(data.children);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif(d.hasClass('jstree-closed')) {\n\t\t\t\t\tdata.state.loaded = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(data.li_attr['class']) {\n\t\t\t\tdata.li_attr['class'] = data.li_attr['class'].replace('jstree-closed','').replace('jstree-open','');\n\t\t\t}\n\t\t\tif(data.a_attr['class']) {\n\t\t\t\tdata.a_attr['class'] = data.a_attr['class'].replace('jstree-clicked','').replace('jstree-disabled','');\n\t\t\t}\n\t\t\tm[data.id] = data;\n\t\t\tif(data.state.selected) {\n\t\t\t\tthis._data.core.selected.push(data.id);\n\t\t\t}\n\t\t\treturn data.id;\n\t\t},\n\t\t/**\n\t\t * parses a node from a JSON object (used when dealing with flat data, which has no nesting of children, but has id and parent properties) and appends it to the in memory tree model. Used internally.\n\t\t * @private\n\t\t * @name _parse_model_from_flat_json(d [, p, ps])\n\t\t * @param  {Object} d the JSON object to parse\n\t\t * @param  {String} p the parent ID\n\t\t * @param  {Array} ps list of all parents\n\t\t * @return {String} the ID of the object added to the model\n\t\t */\n\t\t_parse_model_from_flat_json : function (d, p, ps) {\n\t\t\tif(!ps) { ps = []; }\n\t\t\telse { ps = ps.concat(); }\n\t\t\tif(p) { ps.unshift(p); }\n\t\t\tvar tid = d.id.toString(),\n\t\t\t\tm = this._model.data,\n\t\t\t\tdf = this._model.default_state,\n\t\t\t\ti, j, c, e,\n\t\t\t\ttmp = {\n\t\t\t\t\tid\t\t\t: tid,\n\t\t\t\t\ttext\t\t: d.text || '',\n\t\t\t\t\ticon\t\t: d.icon !== undefined ? d.icon : true,\n\t\t\t\t\tparent\t\t: p,\n\t\t\t\t\tparents\t\t: ps,\n\t\t\t\t\tchildren\t: d.children || [],\n\t\t\t\t\tchildren_d\t: d.children_d || [],\n\t\t\t\t\tdata\t\t: d.data,\n\t\t\t\t\tstate\t\t: { },\n\t\t\t\t\tli_attr\t\t: { id : false },\n\t\t\t\t\ta_attr\t\t: { href : '#' },\n\t\t\t\t\toriginal\t: false\n\t\t\t\t};\n\t\t\tfor(i in df) {\n\t\t\t\tif(df.hasOwnProperty(i)) {\n\t\t\t\t\ttmp.state[i] = df[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(d && d.data && d.data.jstree && d.data.jstree.icon) {\n\t\t\t\ttmp.icon = d.data.jstree.icon;\n\t\t\t}\n\t\t\tif(tmp.icon === undefined || tmp.icon === null || tmp.icon === \"\") {\n\t\t\t\ttmp.icon = true;\n\t\t\t}\n\t\t\tif(d && d.data) {\n\t\t\t\ttmp.data = d.data;\n\t\t\t\tif(d.data.jstree) {\n\t\t\t\t\tfor(i in d.data.jstree) {\n\t\t\t\t\t\tif(d.data.jstree.hasOwnProperty(i)) {\n\t\t\t\t\t\t\ttmp.state[i] = d.data.jstree[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(d && typeof d.state === 'object') {\n\t\t\t\tfor (i in d.state) {\n\t\t\t\t\tif(d.state.hasOwnProperty(i)) {\n\t\t\t\t\t\ttmp.state[i] = d.state[i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(d && typeof d.li_attr === 'object') {\n\t\t\t\tfor (i in d.li_attr) {\n\t\t\t\t\tif(d.li_attr.hasOwnProperty(i)) {\n\t\t\t\t\t\ttmp.li_attr[i] = d.li_attr[i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!tmp.li_attr.id) {\n\t\t\t\ttmp.li_attr.id = tid;\n\t\t\t}\n\t\t\tif(d && typeof d.a_attr === 'object') {\n\t\t\t\tfor (i in d.a_attr) {\n\t\t\t\t\tif(d.a_attr.hasOwnProperty(i)) {\n\t\t\t\t\t\ttmp.a_attr[i] = d.a_attr[i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(d && d.children && d.children === true) {\n\t\t\t\ttmp.state.loaded = false;\n\t\t\t\ttmp.children = [];\n\t\t\t\ttmp.children_d = [];\n\t\t\t}\n\t\t\tm[tmp.id] = tmp;\n\t\t\tfor(i = 0, j = tmp.children.length; i < j; i++) {\n\t\t\t\tc = this._parse_model_from_flat_json(m[tmp.children[i]], tmp.id, ps);\n\t\t\t\te = m[c];\n\t\t\t\ttmp.children_d.push(c);\n\t\t\t\tif(e.children_d.length) {\n\t\t\t\t\ttmp.children_d = tmp.children_d.concat(e.children_d);\n\t\t\t\t}\n\t\t\t}\n\t\t\tdelete d.data;\n\t\t\tdelete d.children;\n\t\t\tm[tmp.id].original = d;\n\t\t\tif(tmp.state.selected) {\n\t\t\t\tthis._data.core.selected.push(tmp.id);\n\t\t\t}\n\t\t\treturn tmp.id;\n\t\t},\n\t\t/**\n\t\t * parses a node from a JSON object and appends it to the in memory tree model. Used internally.\n\t\t * @private\n\t\t * @name _parse_model_from_json(d [, p, ps])\n\t\t * @param  {Object} d the JSON object to parse\n\t\t * @param  {String} p the parent ID\n\t\t * @param  {Array} ps list of all parents\n\t\t * @return {String} the ID of the object added to the model\n\t\t */\n\t\t_parse_model_from_json : function (d, p, ps) {\n\t\t\tif(!ps) { ps = []; }\n\t\t\telse { ps = ps.concat(); }\n\t\t\tif(p) { ps.unshift(p); }\n\t\t\tvar tid = false, i, j, c, e, m = this._model.data, df = this._model.default_state, tmp;\n\t\t\tdo {\n\t\t\t\ttid = 'j' + this._id + '_' + (++this._cnt);\n\t\t\t} while(m[tid]);\n\n\t\t\ttmp = {\n\t\t\t\tid\t\t\t: false,\n\t\t\t\ttext\t\t: typeof d === 'string' ? d : '',\n\t\t\t\ticon\t\t: typeof d === 'object' && d.icon !== undefined ? d.icon : true,\n\t\t\t\tparent\t\t: p,\n\t\t\t\tparents\t\t: ps,\n\t\t\t\tchildren\t: [],\n\t\t\t\tchildren_d\t: [],\n\t\t\t\tdata\t\t: null,\n\t\t\t\tstate\t\t: { },\n\t\t\t\tli_attr\t\t: { id : false },\n\t\t\t\ta_attr\t\t: { href : '#' },\n\t\t\t\toriginal\t: false\n\t\t\t};\n\t\t\tfor(i in df) {\n\t\t\t\tif(df.hasOwnProperty(i)) {\n\t\t\t\t\ttmp.state[i] = df[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(d && d.id) { tmp.id = d.id.toString(); }\n\t\t\tif(d && d.text) { tmp.text = d.text; }\n\t\t\tif(d && d.data && d.data.jstree && d.data.jstree.icon) {\n\t\t\t\ttmp.icon = d.data.jstree.icon;\n\t\t\t}\n\t\t\tif(tmp.icon === undefined || tmp.icon === null || tmp.icon === \"\") {\n\t\t\t\ttmp.icon = true;\n\t\t\t}\n\t\t\tif(d && d.data) {\n\t\t\t\ttmp.data = d.data;\n\t\t\t\tif(d.data.jstree) {\n\t\t\t\t\tfor(i in d.data.jstree) {\n\t\t\t\t\t\tif(d.data.jstree.hasOwnProperty(i)) {\n\t\t\t\t\t\t\ttmp.state[i] = d.data.jstree[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(d && typeof d.state === 'object') {\n\t\t\t\tfor (i in d.state) {\n\t\t\t\t\tif(d.state.hasOwnProperty(i)) {\n\t\t\t\t\t\ttmp.state[i] = d.state[i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(d && typeof d.li_attr === 'object') {\n\t\t\t\tfor (i in d.li_attr) {\n\t\t\t\t\tif(d.li_attr.hasOwnProperty(i)) {\n\t\t\t\t\t\ttmp.li_attr[i] = d.li_attr[i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(tmp.li_attr.id && !tmp.id) {\n\t\t\t\ttmp.id = tmp.li_attr.id.toString();\n\t\t\t}\n\t\t\tif(!tmp.id) {\n\t\t\t\ttmp.id = tid;\n\t\t\t}\n\t\t\tif(!tmp.li_attr.id) {\n\t\t\t\ttmp.li_attr.id = tmp.id;\n\t\t\t}\n\t\t\tif(d && typeof d.a_attr === 'object') {\n\t\t\t\tfor (i in d.a_attr) {\n\t\t\t\t\tif(d.a_attr.hasOwnProperty(i)) {\n\t\t\t\t\t\ttmp.a_attr[i] = d.a_attr[i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(d && d.children && d.children.length) {\n\t\t\t\tfor(i = 0, j = d.children.length; i < j; i++) {\n\t\t\t\t\tc = this._parse_model_from_json(d.children[i], tmp.id, ps);\n\t\t\t\t\te = m[c];\n\t\t\t\t\ttmp.children.push(c);\n\t\t\t\t\tif(e.children_d.length) {\n\t\t\t\t\t\ttmp.children_d = tmp.children_d.concat(e.children_d);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttmp.children_d = tmp.children.concat(tmp.children_d);\n\t\t\t}\n\t\t\tif(d && d.children && d.children === true) {\n\t\t\t\ttmp.state.loaded = false;\n\t\t\t\ttmp.children = [];\n\t\t\t\ttmp.children_d = [];\n\t\t\t}\n\t\t\tdelete d.data;\n\t\t\tdelete d.children;\n\t\t\ttmp.original = d;\n\t\t\tm[tmp.id] = tmp;\n\t\t\tif(tmp.state.selected) {\n\t\t\t\tthis._data.core.selected.push(tmp.id);\n\t\t\t}\n\t\t\treturn tmp.id;\n\t\t},\n\t\t/**\n\t\t * redraws all nodes that need to be redrawn. Used internally.\n\t\t * @private\n\t\t * @name _redraw()\n\t\t * @trigger redraw.jstree\n\t\t */\n\t\t_redraw : function () {\n\t\t\tvar nodes = this._model.force_full_redraw ? this._model.data[$.jstree.root].children.concat([]) : this._model.changed.concat([]),\n\t\t\t\tf = document.createElement('UL'), tmp, i, j, fe = this._data.core.focused;\n\t\t\tfor(i = 0, j = nodes.length; i < j; i++) {\n\t\t\t\ttmp = this.redraw_node(nodes[i], true, this._model.force_full_redraw);\n\t\t\t\tif(tmp && this._model.force_full_redraw) {\n\t\t\t\t\tf.appendChild(tmp);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(this._model.force_full_redraw) {\n\t\t\t\tf.className = this.get_container_ul()[0].className;\n\t\t\t\tf.setAttribute('role','group');\n\t\t\t\tthis.element.empty().append(f);\n\t\t\t\t//this.get_container_ul()[0].appendChild(f);\n\t\t\t}\n\t\t\tif(fe !== null && this.settings.core.restore_focus) {\n\t\t\t\ttmp = this.get_node(fe, true);\n\t\t\t\tif(tmp && tmp.length && tmp.children('.jstree-anchor')[0] !== document.activeElement) {\n\t\t\t\t\ttmp.children('.jstree-anchor').focus();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis._data.core.focused = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._model.force_full_redraw = false;\n\t\t\tthis._model.changed = [];\n\t\t\t/**\n\t\t\t * triggered after nodes are redrawn\n\t\t\t * @event\n\t\t\t * @name redraw.jstree\n\t\t\t * @param {array} nodes the redrawn nodes\n\t\t\t */\n\t\t\tthis.trigger('redraw', { \"nodes\" : nodes });\n\t\t},\n\t\t/**\n\t\t * redraws all nodes that need to be redrawn or optionally - the whole tree\n\t\t * @name redraw([full])\n\t\t * @param {Boolean} full if set to `true` all nodes are redrawn.\n\t\t */\n\t\tredraw : function (full) {\n\t\t\tif(full) {\n\t\t\t\tthis._model.force_full_redraw = true;\n\t\t\t}\n\t\t\t//if(this._model.redraw_timeout) {\n\t\t\t//\tclearTimeout(this._model.redraw_timeout);\n\t\t\t//}\n\t\t\t//this._model.redraw_timeout = setTimeout($.proxy(this._redraw, this),0);\n\t\t\tthis._redraw();\n\t\t},\n\t\t/**\n\t\t * redraws a single node's children. Used internally.\n\t\t * @private\n\t\t * @name draw_children(node)\n\t\t * @param {mixed} node the node whose children will be redrawn\n\t\t */\n\t\tdraw_children : function (node) {\n\t\t\tvar obj = this.get_node(node),\n\t\t\t\ti = false,\n\t\t\t\tj = false,\n\t\t\t\tk = false,\n\t\t\t\td = document;\n\t\t\tif(!obj) { return false; }\n\t\t\tif(obj.id === $.jstree.root) { return this.redraw(true); }\n\t\t\tnode = this.get_node(node, true);\n\t\t\tif(!node || !node.length) { return false; } // TODO: quick toggle\n\n\t\t\tnode.children('.jstree-children').remove();\n\t\t\tnode = node[0];\n\t\t\tif(obj.children.length && obj.state.loaded) {\n\t\t\t\tk = d.createElement('UL');\n\t\t\t\tk.setAttribute('role', 'group');\n\t\t\t\tk.className = 'jstree-children';\n\t\t\t\tfor(i = 0, j = obj.children.length; i < j; i++) {\n\t\t\t\t\tk.appendChild(this.redraw_node(obj.children[i], true, true));\n\t\t\t\t}\n\t\t\t\tnode.appendChild(k);\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * redraws a single node. Used internally.\n\t\t * @private\n\t\t * @name redraw_node(node, deep, is_callback, force_render)\n\t\t * @param {mixed} node the node to redraw\n\t\t * @param {Boolean} deep should child nodes be redrawn too\n\t\t * @param {Boolean} is_callback is this a recursion call\n\t\t * @param {Boolean} force_render should children of closed parents be drawn anyway\n\t\t */\n\t\tredraw_node : function (node, deep, is_callback, force_render) {\n\t\t\tvar obj = this.get_node(node),\n\t\t\t\tpar = false,\n\t\t\t\tind = false,\n\t\t\t\told = false,\n\t\t\t\ti = false,\n\t\t\t\tj = false,\n\t\t\t\tk = false,\n\t\t\t\tc = '',\n\t\t\t\td = document,\n\t\t\t\tm = this._model.data,\n\t\t\t\tf = false,\n\t\t\t\ts = false,\n\t\t\t\ttmp = null,\n\t\t\t\tt = 0,\n\t\t\t\tl = 0,\n\t\t\t\thas_children = false,\n\t\t\t\tlast_sibling = false;\n\t\t\tif(!obj) { return false; }\n\t\t\tif(obj.id === $.jstree.root) {  return this.redraw(true); }\n\t\t\tdeep = deep || obj.children.length === 0;\n\t\t\tnode = !document.querySelector ? document.getElementById(obj.id) : this.element[0].querySelector('#' + (\"0123456789\".indexOf(obj.id[0]) !== -1 ? '\\\\3' + obj.id[0] + ' ' + obj.id.substr(1).replace($.jstree.idregex,'\\\\$&') : obj.id.replace($.jstree.idregex,'\\\\$&')) ); //, this.element);\n\t\t\tif(!node) {\n\t\t\t\tdeep = true;\n\t\t\t\t//node = d.createElement('LI');\n\t\t\t\tif(!is_callback) {\n\t\t\t\t\tpar = obj.parent !== $.jstree.root ? $('#' + obj.parent.replace($.jstree.idregex,'\\\\$&'), this.element)[0] : null;\n\t\t\t\t\tif(par !== null && (!par || !m[obj.parent].state.opened)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tind = $.inArray(obj.id, par === null ? m[$.jstree.root].children : m[obj.parent].children);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnode = $(node);\n\t\t\t\tif(!is_callback) {\n\t\t\t\t\tpar = node.parent().parent()[0];\n\t\t\t\t\tif(par === this.element[0]) {\n\t\t\t\t\t\tpar = null;\n\t\t\t\t\t}\n\t\t\t\t\tind = node.index();\n\t\t\t\t}\n\t\t\t\t// m[obj.id].data = node.data(); // use only node's data, no need to touch jquery storage\n\t\t\t\tif(!deep && obj.children.length && !node.children('.jstree-children').length) {\n\t\t\t\t\tdeep = true;\n\t\t\t\t}\n\t\t\t\tif(!deep) {\n\t\t\t\t\told = node.children('.jstree-children')[0];\n\t\t\t\t}\n\t\t\t\tf = node.children('.jstree-anchor')[0] === document.activeElement;\n\t\t\t\tnode.remove();\n\t\t\t\t//node = d.createElement('LI');\n\t\t\t\t//node = node[0];\n\t\t\t}\n\t\t\tnode = this._data.core.node.cloneNode(true);\n\t\t\t// node is DOM, deep is boolean\n\n\t\t\tc = 'jstree-node ';\n\t\t\tfor(i in obj.li_attr) {\n\t\t\t\tif(obj.li_attr.hasOwnProperty(i)) {\n\t\t\t\t\tif(i === 'id') { continue; }\n\t\t\t\t\tif(i !== 'class') {\n\t\t\t\t\t\tnode.setAttribute(i, obj.li_attr[i]);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tc += obj.li_attr[i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!obj.a_attr.id) {\n\t\t\t\tobj.a_attr.id = obj.id + '_anchor';\n\t\t\t}\n\t\t\tnode.setAttribute('aria-selected', !!obj.state.selected);\n\t\t\tnode.setAttribute('aria-level', obj.parents.length);\n\t\t\tnode.setAttribute('aria-labelledby', obj.a_attr.id);\n\t\t\tif(obj.state.disabled) {\n\t\t\t\tnode.setAttribute('aria-disabled', true);\n\t\t\t}\n\n\t\t\tfor(i = 0, j = obj.children.length; i < j; i++) {\n\t\t\t\tif(!m[obj.children[i]].state.hidden) {\n\t\t\t\t\thas_children = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(obj.parent !== null && m[obj.parent] && !obj.state.hidden) {\n\t\t\t\ti = $.inArray(obj.id, m[obj.parent].children);\n\t\t\t\tlast_sibling = obj.id;\n\t\t\t\tif(i !== -1) {\n\t\t\t\t\ti++;\n\t\t\t\t\tfor(j = m[obj.parent].children.length; i < j; i++) {\n\t\t\t\t\t\tif(!m[m[obj.parent].children[i]].state.hidden) {\n\t\t\t\t\t\t\tlast_sibling = m[obj.parent].children[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(last_sibling !== obj.id) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(obj.state.hidden) {\n\t\t\t\tc += ' jstree-hidden';\n\t\t\t}\n\t\t\tif (obj.state.loading) {\n\t\t\t\tc += ' jstree-loading';\n\t\t\t}\n\t\t\tif(obj.state.loaded && !has_children) {\n\t\t\t\tc += ' jstree-leaf';\n\t\t\t}\n\t\t\telse {\n\t\t\t\tc += obj.state.opened && obj.state.loaded ? ' jstree-open' : ' jstree-closed';\n\t\t\t\tnode.setAttribute('aria-expanded', (obj.state.opened && obj.state.loaded) );\n\t\t\t}\n\t\t\tif(last_sibling === obj.id) {\n\t\t\t\tc += ' jstree-last';\n\t\t\t}\n\t\t\tnode.id = obj.id;\n\t\t\tnode.className = c;\n\t\t\tc = ( obj.state.selected ? ' jstree-clicked' : '') + ( obj.state.disabled ? ' jstree-disabled' : '');\n\t\t\tfor(j in obj.a_attr) {\n\t\t\t\tif(obj.a_attr.hasOwnProperty(j)) {\n\t\t\t\t\tif(j === 'href' && obj.a_attr[j] === '#') { continue; }\n\t\t\t\t\tif(j !== 'class') {\n\t\t\t\t\t\tnode.childNodes[1].setAttribute(j, obj.a_attr[j]);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tc += ' ' + obj.a_attr[j];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(c.length) {\n\t\t\t\tnode.childNodes[1].className = 'jstree-anchor ' + c;\n\t\t\t}\n\t\t\tif((obj.icon && obj.icon !== true) || obj.icon === false) {\n\t\t\t\tif(obj.icon === false) {\n\t\t\t\t\tnode.childNodes[1].childNodes[0].className += ' jstree-themeicon-hidden';\n\t\t\t\t}\n\t\t\t\telse if(obj.icon.indexOf('/') === -1 && obj.icon.indexOf('.') === -1) {\n\t\t\t\t\tnode.childNodes[1].childNodes[0].className += ' ' + obj.icon + ' jstree-themeicon-custom';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tnode.childNodes[1].childNodes[0].style.backgroundImage = 'url(\"'+obj.icon+'\")';\n\t\t\t\t\tnode.childNodes[1].childNodes[0].style.backgroundPosition = 'center center';\n\t\t\t\t\tnode.childNodes[1].childNodes[0].style.backgroundSize = 'auto';\n\t\t\t\t\tnode.childNodes[1].childNodes[0].className += ' jstree-themeicon-custom';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(this.settings.core.force_text) {\n\t\t\t\tnode.childNodes[1].appendChild(d.createTextNode(obj.text));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnode.childNodes[1].innerHTML += obj.text;\n\t\t\t}\n\n\n\t\t\tif(deep && obj.children.length && (obj.state.opened || force_render) && obj.state.loaded) {\n\t\t\t\tk = d.createElement('UL');\n\t\t\t\tk.setAttribute('role', 'group');\n\t\t\t\tk.className = 'jstree-children';\n\t\t\t\tfor(i = 0, j = obj.children.length; i < j; i++) {\n\t\t\t\t\tk.appendChild(this.redraw_node(obj.children[i], deep, true));\n\t\t\t\t}\n\t\t\t\tnode.appendChild(k);\n\t\t\t}\n\t\t\tif(old) {\n\t\t\t\tnode.appendChild(old);\n\t\t\t}\n\t\t\tif(!is_callback) {\n\t\t\t\t// append back using par / ind\n\t\t\t\tif(!par) {\n\t\t\t\t\tpar = this.element[0];\n\t\t\t\t}\n\t\t\t\tfor(i = 0, j = par.childNodes.length; i < j; i++) {\n\t\t\t\t\tif(par.childNodes[i] && par.childNodes[i].className && par.childNodes[i].className.indexOf('jstree-children') !== -1) {\n\t\t\t\t\t\ttmp = par.childNodes[i];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(!tmp) {\n\t\t\t\t\ttmp = d.createElement('UL');\n\t\t\t\t\ttmp.setAttribute('role', 'group');\n\t\t\t\t\ttmp.className = 'jstree-children';\n\t\t\t\t\tpar.appendChild(tmp);\n\t\t\t\t}\n\t\t\t\tpar = tmp;\n\n\t\t\t\tif(ind < par.childNodes.length) {\n\t\t\t\t\tpar.insertBefore(node, par.childNodes[ind]);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tpar.appendChild(node);\n\t\t\t\t}\n\t\t\t\tif(f) {\n\t\t\t\t\tt = this.element[0].scrollTop;\n\t\t\t\t\tl = this.element[0].scrollLeft;\n\t\t\t\t\tnode.childNodes[1].focus();\n\t\t\t\t\tthis.element[0].scrollTop = t;\n\t\t\t\t\tthis.element[0].scrollLeft = l;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(obj.state.opened && !obj.state.loaded) {\n\t\t\t\tobj.state.opened = false;\n\t\t\t\tsetTimeout($.proxy(function () {\n\t\t\t\t\tthis.open_node(obj.id, false, 0);\n\t\t\t\t}, this), 0);\n\t\t\t}\n\t\t\treturn node;\n\t\t},\n\t\t/**\n\t\t * opens a node, revealing its children. If the node is not loaded it will be loaded and opened once ready.\n\t\t * @name open_node(obj [, callback, animation])\n\t\t * @param {mixed} obj the node to open\n\t\t * @param {Function} callback a function to execute once the node is opened\n\t\t * @param {Number} animation the animation duration in milliseconds when opening the node (overrides the `core.animation` setting). Use `false` for no animation.\n\t\t * @trigger open_node.jstree, after_open.jstree, before_open.jstree\n\t\t */\n\t\topen_node : function (obj, callback, animation) {\n\t\t\tvar t1, t2, d, t;\n\t\t\tif($.isArray(obj)) {\n\t\t\t\tobj = obj.slice();\n\t\t\t\tfor(t1 = 0, t2 = obj.length; t1 < t2; t1++) {\n\t\t\t\t\tthis.open_node(obj[t1], callback, animation);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(!obj || obj.id === $.jstree.root) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tanimation = animation === undefined ? this.settings.core.animation : animation;\n\t\t\tif(!this.is_closed(obj)) {\n\t\t\t\tif(callback) {\n\t\t\t\t\tcallback.call(this, obj, false);\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(!this.is_loaded(obj)) {\n\t\t\t\tif(this.is_loading(obj)) {\n\t\t\t\t\treturn setTimeout($.proxy(function () {\n\t\t\t\t\t\tthis.open_node(obj, callback, animation);\n\t\t\t\t\t}, this), 500);\n\t\t\t\t}\n\t\t\t\tthis.load_node(obj, function (o, ok) {\n\t\t\t\t\treturn ok ? this.open_node(o, callback, animation) : (callback ? callback.call(this, o, false) : false);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\td = this.get_node(obj, true);\n\t\t\t\tt = this;\n\t\t\t\tif(d.length) {\n\t\t\t\t\tif(animation && d.children(\".jstree-children\").length) {\n\t\t\t\t\t\td.children(\".jstree-children\").stop(true, true);\n\t\t\t\t\t}\n\t\t\t\t\tif(obj.children.length && !this._firstChild(d.children('.jstree-children')[0])) {\n\t\t\t\t\t\tthis.draw_children(obj);\n\t\t\t\t\t\t//d = this.get_node(obj, true);\n\t\t\t\t\t}\n\t\t\t\t\tif(!animation) {\n\t\t\t\t\t\tthis.trigger('before_open', { \"node\" : obj });\n\t\t\t\t\t\td[0].className = d[0].className.replace('jstree-closed', 'jstree-open');\n\t\t\t\t\t\td[0].setAttribute(\"aria-expanded\", true);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tthis.trigger('before_open', { \"node\" : obj });\n\t\t\t\t\t\td\n\t\t\t\t\t\t\t.children(\".jstree-children\").css(\"display\",\"none\").end()\n\t\t\t\t\t\t\t.removeClass(\"jstree-closed\").addClass(\"jstree-open\").attr(\"aria-expanded\", true)\n\t\t\t\t\t\t\t.children(\".jstree-children\").stop(true, true)\n\t\t\t\t\t\t\t\t.slideDown(animation, function () {\n\t\t\t\t\t\t\t\t\tthis.style.display = \"\";\n\t\t\t\t\t\t\t\t\tif (t.element) {\n\t\t\t\t\t\t\t\t\t\tt.trigger(\"after_open\", { \"node\" : obj });\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tobj.state.opened = true;\n\t\t\t\tif(callback) {\n\t\t\t\t\tcallback.call(this, obj, true);\n\t\t\t\t}\n\t\t\t\tif(!d.length) {\n\t\t\t\t\t/**\n\t\t\t\t\t * triggered when a node is about to be opened (if the node is supposed to be in the DOM, it will be, but it won't be visible yet)\n\t\t\t\t\t * @event\n\t\t\t\t\t * @name before_open.jstree\n\t\t\t\t\t * @param {Object} node the opened node\n\t\t\t\t\t */\n\t\t\t\t\tthis.trigger('before_open', { \"node\" : obj });\n\t\t\t\t}\n\t\t\t\t/**\n\t\t\t\t * triggered when a node is opened (if there is an animation it will not be completed yet)\n\t\t\t\t * @event\n\t\t\t\t * @name open_node.jstree\n\t\t\t\t * @param {Object} node the opened node\n\t\t\t\t */\n\t\t\t\tthis.trigger('open_node', { \"node\" : obj });\n\t\t\t\tif(!animation || !d.length) {\n\t\t\t\t\t/**\n\t\t\t\t\t * triggered when a node is opened and the animation is complete\n\t\t\t\t\t * @event\n\t\t\t\t\t * @name after_open.jstree\n\t\t\t\t\t * @param {Object} node the opened node\n\t\t\t\t\t */\n\t\t\t\t\tthis.trigger(\"after_open\", { \"node\" : obj });\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * opens every parent of a node (node should be loaded)\n\t\t * @name _open_to(obj)\n\t\t * @param {mixed} obj the node to reveal\n\t\t * @private\n\t\t */\n\t\t_open_to : function (obj) {\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(!obj || obj.id === $.jstree.root) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar i, j, p = obj.parents;\n\t\t\tfor(i = 0, j = p.length; i < j; i+=1) {\n\t\t\t\tif(i !== $.jstree.root) {\n\t\t\t\t\tthis.open_node(p[i], false, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $('#' + obj.id.replace($.jstree.idregex,'\\\\$&'), this.element);\n\t\t},\n\t\t/**\n\t\t * closes a node, hiding its children\n\t\t * @name close_node(obj [, animation])\n\t\t * @param {mixed} obj the node to close\n\t\t * @param {Number} animation the animation duration in milliseconds when closing the node (overrides the `core.animation` setting). Use `false` for no animation.\n\t\t * @trigger close_node.jstree, after_close.jstree\n\t\t */\n\t\tclose_node : function (obj, animation) {\n\t\t\tvar t1, t2, t, d;\n\t\t\tif($.isArray(obj)) {\n\t\t\t\tobj = obj.slice();\n\t\t\t\tfor(t1 = 0, t2 = obj.length; t1 < t2; t1++) {\n\t\t\t\t\tthis.close_node(obj[t1], animation);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(!obj || obj.id === $.jstree.root) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(this.is_closed(obj)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tanimation = animation === undefined ? this.settings.core.animation : animation;\n\t\t\tt = this;\n\t\t\td = this.get_node(obj, true);\n\n\t\t\tobj.state.opened = false;\n\t\t\t/**\n\t\t\t * triggered when a node is closed (if there is an animation it will not be complete yet)\n\t\t\t * @event\n\t\t\t * @name close_node.jstree\n\t\t\t * @param {Object} node the closed node\n\t\t\t */\n\t\t\tthis.trigger('close_node',{ \"node\" : obj });\n\t\t\tif(!d.length) {\n\t\t\t\t/**\n\t\t\t\t * triggered when a node is closed and the animation is complete\n\t\t\t\t * @event\n\t\t\t\t * @name after_close.jstree\n\t\t\t\t * @param {Object} node the closed node\n\t\t\t\t */\n\t\t\t\tthis.trigger(\"after_close\", { \"node\" : obj });\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif(!animation) {\n\t\t\t\t\td[0].className = d[0].className.replace('jstree-open', 'jstree-closed');\n\t\t\t\t\td.attr(\"aria-expanded\", false).children('.jstree-children').remove();\n\t\t\t\t\tthis.trigger(\"after_close\", { \"node\" : obj });\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\td\n\t\t\t\t\t\t.children(\".jstree-children\").attr(\"style\",\"display:block !important\").end()\n\t\t\t\t\t\t.removeClass(\"jstree-open\").addClass(\"jstree-closed\").attr(\"aria-expanded\", false)\n\t\t\t\t\t\t.children(\".jstree-children\").stop(true, true).slideUp(animation, function () {\n\t\t\t\t\t\t\tthis.style.display = \"\";\n\t\t\t\t\t\t\td.children('.jstree-children').remove();\n\t\t\t\t\t\t\tif (t.element) {\n\t\t\t\t\t\t\t\tt.trigger(\"after_close\", { \"node\" : obj });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * toggles a node - closing it if it is open, opening it if it is closed\n\t\t * @name toggle_node(obj)\n\t\t * @param {mixed} obj the node to toggle\n\t\t */\n\t\ttoggle_node : function (obj) {\n\t\t\tvar t1, t2;\n\t\t\tif($.isArray(obj)) {\n\t\t\t\tobj = obj.slice();\n\t\t\t\tfor(t1 = 0, t2 = obj.length; t1 < t2; t1++) {\n\t\t\t\t\tthis.toggle_node(obj[t1]);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif(this.is_closed(obj)) {\n\t\t\t\treturn this.open_node(obj);\n\t\t\t}\n\t\t\tif(this.is_open(obj)) {\n\t\t\t\treturn this.close_node(obj);\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * opens all nodes within a node (or the tree), revealing their children. If the node is not loaded it will be loaded and opened once ready.\n\t\t * @name open_all([obj, animation, original_obj])\n\t\t * @param {mixed} obj the node to open recursively, omit to open all nodes in the tree\n\t\t * @param {Number} animation the animation duration in milliseconds when opening the nodes, the default is no animation\n\t\t * @param {jQuery} reference to the node that started the process (internal use)\n\t\t * @trigger open_all.jstree\n\t\t */\n\t\topen_all : function (obj, animation, original_obj) {\n\t\t\tif(!obj) { obj = $.jstree.root; }\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(!obj) { return false; }\n\t\t\tvar dom = obj.id === $.jstree.root ? this.get_container_ul() : this.get_node(obj, true), i, j, _this;\n\t\t\tif(!dom.length) {\n\t\t\t\tfor(i = 0, j = obj.children_d.length; i < j; i++) {\n\t\t\t\t\tif(this.is_closed(this._model.data[obj.children_d[i]])) {\n\t\t\t\t\t\tthis._model.data[obj.children_d[i]].state.opened = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this.trigger('open_all', { \"node\" : obj });\n\t\t\t}\n\t\t\toriginal_obj = original_obj || dom;\n\t\t\t_this = this;\n\t\t\tdom = this.is_closed(obj) ? dom.find('.jstree-closed').addBack() : dom.find('.jstree-closed');\n\t\t\tdom.each(function () {\n\t\t\t\t_this.open_node(\n\t\t\t\t\tthis,\n\t\t\t\t\tfunction(node, status) { if(status && this.is_parent(node)) { this.open_all(node, animation, original_obj); } },\n\t\t\t\t\tanimation || 0\n\t\t\t\t);\n\t\t\t});\n\t\t\tif(original_obj.find('.jstree-closed').length === 0) {\n\t\t\t\t/**\n\t\t\t\t * triggered when an `open_all` call completes\n\t\t\t\t * @event\n\t\t\t\t * @name open_all.jstree\n\t\t\t\t * @param {Object} node the opened node\n\t\t\t\t */\n\t\t\t\tthis.trigger('open_all', { \"node\" : this.get_node(original_obj) });\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * closes all nodes within a node (or the tree), revealing their children\n\t\t * @name close_all([obj, animation])\n\t\t * @param {mixed} obj the node to close recursively, omit to close all nodes in the tree\n\t\t * @param {Number} animation the animation duration in milliseconds when closing the nodes, the default is no animation\n\t\t * @trigger close_all.jstree\n\t\t */\n\t\tclose_all : function (obj, animation) {\n\t\t\tif(!obj) { obj = $.jstree.root; }\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(!obj) { return false; }\n\t\t\tvar dom = obj.id === $.jstree.root ? this.get_container_ul() : this.get_node(obj, true),\n\t\t\t\t_this = this, i, j;\n\t\t\tif(dom.length) {\n\t\t\t\tdom = this.is_open(obj) ? dom.find('.jstree-open').addBack() : dom.find('.jstree-open');\n\t\t\t\t$(dom.get().reverse()).each(function () { _this.close_node(this, animation || 0); });\n\t\t\t}\n\t\t\tfor(i = 0, j = obj.children_d.length; i < j; i++) {\n\t\t\t\tthis._model.data[obj.children_d[i]].state.opened = false;\n\t\t\t}\n\t\t\t/**\n\t\t\t * triggered when an `close_all` call completes\n\t\t\t * @event\n\t\t\t * @name close_all.jstree\n\t\t\t * @param {Object} node the closed node\n\t\t\t */\n\t\t\tthis.trigger('close_all', { \"node\" : obj });\n\t\t},\n\t\t/**\n\t\t * checks if a node is disabled (not selectable)\n\t\t * @name is_disabled(obj)\n\t\t * @param  {mixed} obj\n\t\t * @return {Boolean}\n\t\t */\n\t\tis_disabled : function (obj) {\n\t\t\tobj = this.get_node(obj);\n\t\t\treturn obj && obj.state && obj.state.disabled;\n\t\t},\n\t\t/**\n\t\t * enables a node - so that it can be selected\n\t\t * @name enable_node(obj)\n\t\t * @param {mixed} obj the node to enable\n\t\t * @trigger enable_node.jstree\n\t\t */\n\t\tenable_node : function (obj) {\n\t\t\tvar t1, t2;\n\t\t\tif($.isArray(obj)) {\n\t\t\t\tobj = obj.slice();\n\t\t\t\tfor(t1 = 0, t2 = obj.length; t1 < t2; t1++) {\n\t\t\t\t\tthis.enable_node(obj[t1]);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(!obj || obj.id === $.jstree.root) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tobj.state.disabled = false;\n\t\t\tthis.get_node(obj,true).children('.jstree-anchor').removeClass('jstree-disabled').attr('aria-disabled', false);\n\t\t\t/**\n\t\t\t * triggered when an node is enabled\n\t\t\t * @event\n\t\t\t * @name enable_node.jstree\n\t\t\t * @param {Object} node the enabled node\n\t\t\t */\n\t\t\tthis.trigger('enable_node', { 'node' : obj });\n\t\t},\n\t\t/**\n\t\t * disables a node - so that it can not be selected\n\t\t * @name disable_node(obj)\n\t\t * @param {mixed} obj the node to disable\n\t\t * @trigger disable_node.jstree\n\t\t */\n\t\tdisable_node : function (obj) {\n\t\t\tvar t1, t2;\n\t\t\tif($.isArray(obj)) {\n\t\t\t\tobj = obj.slice();\n\t\t\t\tfor(t1 = 0, t2 = obj.length; t1 < t2; t1++) {\n\t\t\t\t\tthis.disable_node(obj[t1]);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(!obj || obj.id === $.jstree.root) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tobj.state.disabled = true;\n\t\t\tthis.get_node(obj,true).children('.jstree-anchor').addClass('jstree-disabled').attr('aria-disabled', true);\n\t\t\t/**\n\t\t\t * triggered when an node is disabled\n\t\t\t * @event\n\t\t\t * @name disable_node.jstree\n\t\t\t * @param {Object} node the disabled node\n\t\t\t */\n\t\t\tthis.trigger('disable_node', { 'node' : obj });\n\t\t},\n\t\t/**\n\t\t * determines if a node is hidden\n\t\t * @name is_hidden(obj)\n\t\t * @param {mixed} obj the node\n\t\t */\n\t\tis_hidden : function (obj) {\n\t\t\tobj = this.get_node(obj);\n\t\t\treturn obj.state.hidden === true;\n\t\t},\n\t\t/**\n\t\t * hides a node - it is still in the structure but will not be visible\n\t\t * @name hide_node(obj)\n\t\t * @param {mixed} obj the node to hide\n\t\t * @param {Boolean} skip_redraw internal parameter controlling if redraw is called\n\t\t * @trigger hide_node.jstree\n\t\t */\n\t\thide_node : function (obj, skip_redraw) {\n\t\t\tvar t1, t2;\n\t\t\tif($.isArray(obj)) {\n\t\t\t\tobj = obj.slice();\n\t\t\t\tfor(t1 = 0, t2 = obj.length; t1 < t2; t1++) {\n\t\t\t\t\tthis.hide_node(obj[t1], true);\n\t\t\t\t}\n\t\t\t\tif (!skip_redraw) {\n\t\t\t\t\tthis.redraw();\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(!obj || obj.id === $.jstree.root) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(!obj.state.hidden) {\n\t\t\t\tobj.state.hidden = true;\n\t\t\t\tthis._node_changed(obj.parent);\n\t\t\t\tif(!skip_redraw) {\n\t\t\t\t\tthis.redraw();\n\t\t\t\t}\n\t\t\t\t/**\n\t\t\t\t * triggered when an node is hidden\n\t\t\t\t * @event\n\t\t\t\t * @name hide_node.jstree\n\t\t\t\t * @param {Object} node the hidden node\n\t\t\t\t */\n\t\t\t\tthis.trigger('hide_node', { 'node' : obj });\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * shows a node\n\t\t * @name show_node(obj)\n\t\t * @param {mixed} obj the node to show\n\t\t * @param {Boolean} skip_redraw internal parameter controlling if redraw is called\n\t\t * @trigger show_node.jstree\n\t\t */\n\t\tshow_node : function (obj, skip_redraw) {\n\t\t\tvar t1, t2;\n\t\t\tif($.isArray(obj)) {\n\t\t\t\tobj = obj.slice();\n\t\t\t\tfor(t1 = 0, t2 = obj.length; t1 < t2; t1++) {\n\t\t\t\t\tthis.show_node(obj[t1], true);\n\t\t\t\t}\n\t\t\t\tif (!skip_redraw) {\n\t\t\t\t\tthis.redraw();\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(!obj || obj.id === $.jstree.root) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(obj.state.hidden) {\n\t\t\t\tobj.state.hidden = false;\n\t\t\t\tthis._node_changed(obj.parent);\n\t\t\t\tif(!skip_redraw) {\n\t\t\t\t\tthis.redraw();\n\t\t\t\t}\n\t\t\t\t/**\n\t\t\t\t * triggered when an node is shown\n\t\t\t\t * @event\n\t\t\t\t * @name show_node.jstree\n\t\t\t\t * @param {Object} node the shown node\n\t\t\t\t */\n\t\t\t\tthis.trigger('show_node', { 'node' : obj });\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * hides all nodes\n\t\t * @name hide_all()\n\t\t * @trigger hide_all.jstree\n\t\t */\n\t\thide_all : function (skip_redraw) {\n\t\t\tvar i, m = this._model.data, ids = [];\n\t\t\tfor(i in m) {\n\t\t\t\tif(m.hasOwnProperty(i) && i !== $.jstree.root && !m[i].state.hidden) {\n\t\t\t\t\tm[i].state.hidden = true;\n\t\t\t\t\tids.push(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._model.force_full_redraw = true;\n\t\t\tif(!skip_redraw) {\n\t\t\t\tthis.redraw();\n\t\t\t}\n\t\t\t/**\n\t\t\t * triggered when all nodes are hidden\n\t\t\t * @event\n\t\t\t * @name hide_all.jstree\n\t\t\t * @param {Array} nodes the IDs of all hidden nodes\n\t\t\t */\n\t\t\tthis.trigger('hide_all', { 'nodes' : ids });\n\t\t\treturn ids;\n\t\t},\n\t\t/**\n\t\t * shows all nodes\n\t\t * @name show_all()\n\t\t * @trigger show_all.jstree\n\t\t */\n\t\tshow_all : function (skip_redraw) {\n\t\t\tvar i, m = this._model.data, ids = [];\n\t\t\tfor(i in m) {\n\t\t\t\tif(m.hasOwnProperty(i) && i !== $.jstree.root && m[i].state.hidden) {\n\t\t\t\t\tm[i].state.hidden = false;\n\t\t\t\t\tids.push(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._model.force_full_redraw = true;\n\t\t\tif(!skip_redraw) {\n\t\t\t\tthis.redraw();\n\t\t\t}\n\t\t\t/**\n\t\t\t * triggered when all nodes are shown\n\t\t\t * @event\n\t\t\t * @name show_all.jstree\n\t\t\t * @param {Array} nodes the IDs of all shown nodes\n\t\t\t */\n\t\t\tthis.trigger('show_all', { 'nodes' : ids });\n\t\t\treturn ids;\n\t\t},\n\t\t/**\n\t\t * called when a node is selected by the user. Used internally.\n\t\t * @private\n\t\t * @name activate_node(obj, e)\n\t\t * @param {mixed} obj the node\n\t\t * @param {Object} e the related event\n\t\t * @trigger activate_node.jstree, changed.jstree\n\t\t */\n\t\tactivate_node : function (obj, e) {\n\t\t\tif(this.is_disabled(obj)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(!e || typeof e !== 'object') {\n\t\t\t\te = {};\n\t\t\t}\n\n\t\t\t// ensure last_clicked is still in the DOM, make it fresh (maybe it was moved?) and make sure it is still selected, if not - make last_clicked the last selected node\n\t\t\tthis._data.core.last_clicked = this._data.core.last_clicked && this._data.core.last_clicked.id !== undefined ? this.get_node(this._data.core.last_clicked.id) : null;\n\t\t\tif(this._data.core.last_clicked && !this._data.core.last_clicked.state.selected) { this._data.core.last_clicked = null; }\n\t\t\tif(!this._data.core.last_clicked && this._data.core.selected.length) { this._data.core.last_clicked = this.get_node(this._data.core.selected[this._data.core.selected.length - 1]); }\n\n\t\t\tif(!this.settings.core.multiple || (!e.metaKey && !e.ctrlKey && !e.shiftKey) || (e.shiftKey && (!this._data.core.last_clicked || !this.get_parent(obj) || this.get_parent(obj) !== this._data.core.last_clicked.parent ) )) {\n\t\t\t\tif(!this.settings.core.multiple && (e.metaKey || e.ctrlKey || e.shiftKey) && this.is_selected(obj)) {\n\t\t\t\t\tthis.deselect_node(obj, false, e);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis.deselect_all(true);\n\t\t\t\t\tthis.select_node(obj, false, false, e);\n\t\t\t\t\tthis._data.core.last_clicked = this.get_node(obj);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif(e.shiftKey) {\n\t\t\t\t\tvar o = this.get_node(obj).id,\n\t\t\t\t\t\tl = this._data.core.last_clicked.id,\n\t\t\t\t\t\tp = this.get_node(this._data.core.last_clicked.parent).children,\n\t\t\t\t\t\tc = false,\n\t\t\t\t\t\ti, j;\n\t\t\t\t\tfor(i = 0, j = p.length; i < j; i += 1) {\n\t\t\t\t\t\t// separate IFs work whem o and l are the same\n\t\t\t\t\t\tif(p[i] === o) {\n\t\t\t\t\t\t\tc = !c;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(p[i] === l) {\n\t\t\t\t\t\t\tc = !c;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!this.is_disabled(p[i]) && (c || p[i] === o || p[i] === l)) {\n\t\t\t\t\t\t\tif (!this.is_hidden(p[i])) {\n\t\t\t\t\t\t\t\tthis.select_node(p[i], true, false, e);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tthis.deselect_node(p[i], true, e);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis.trigger('changed', { 'action' : 'select_node', 'node' : this.get_node(obj), 'selected' : this._data.core.selected, 'event' : e });\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif(!this.is_selected(obj)) {\n\t\t\t\t\t\tthis.select_node(obj, false, false, e);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tthis.deselect_node(obj, false, e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t/**\n\t\t\t * triggered when an node is clicked or intercated with by the user\n\t\t\t * @event\n\t\t\t * @name activate_node.jstree\n\t\t\t * @param {Object} node\n\t\t\t * @param {Object} event the ooriginal event (if any) which triggered the call (may be an empty object)\n\t\t\t */\n\t\t\tthis.trigger('activate_node', { 'node' : this.get_node(obj), 'event' : e });\n\t\t},\n\t\t/**\n\t\t * applies the hover state on a node, called when a node is hovered by the user. Used internally.\n\t\t * @private\n\t\t * @name hover_node(obj)\n\t\t * @param {mixed} obj\n\t\t * @trigger hover_node.jstree\n\t\t */\n\t\thover_node : function (obj) {\n\t\t\tobj = this.get_node(obj, true);\n\t\t\tif(!obj || !obj.length || obj.children('.jstree-hovered').length) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar o = this.element.find('.jstree-hovered'), t = this.element;\n\t\t\tif(o && o.length) { this.dehover_node(o); }\n\n\t\t\tobj.children('.jstree-anchor').addClass('jstree-hovered');\n\t\t\t/**\n\t\t\t * triggered when an node is hovered\n\t\t\t * @event\n\t\t\t * @name hover_node.jstree\n\t\t\t * @param {Object} node\n\t\t\t */\n\t\t\tthis.trigger('hover_node', { 'node' : this.get_node(obj) });\n\t\t\tsetTimeout(function () { t.attr('aria-activedescendant', obj[0].id); }, 0);\n\t\t},\n\t\t/**\n\t\t * removes the hover state from a nodecalled when a node is no longer hovered by the user. Used internally.\n\t\t * @private\n\t\t * @name dehover_node(obj)\n\t\t * @param {mixed} obj\n\t\t * @trigger dehover_node.jstree\n\t\t */\n\t\tdehover_node : function (obj) {\n\t\t\tobj = this.get_node(obj, true);\n\t\t\tif(!obj || !obj.length || !obj.children('.jstree-hovered').length) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tobj.children('.jstree-anchor').removeClass('jstree-hovered');\n\t\t\t/**\n\t\t\t * triggered when an node is no longer hovered\n\t\t\t * @event\n\t\t\t * @name dehover_node.jstree\n\t\t\t * @param {Object} node\n\t\t\t */\n\t\t\tthis.trigger('dehover_node', { 'node' : this.get_node(obj) });\n\t\t},\n\t\t/**\n\t\t * select a node\n\t\t * @name select_node(obj [, supress_event, prevent_open])\n\t\t * @param {mixed} obj an array can be used to select multiple nodes\n\t\t * @param {Boolean} supress_event if set to `true` the `changed.jstree` event won't be triggered\n\t\t * @param {Boolean} prevent_open if set to `true` parents of the selected node won't be opened\n\t\t * @trigger select_node.jstree, changed.jstree\n\t\t */\n\t\tselect_node : function (obj, supress_event, prevent_open, e) {\n\t\t\tvar dom, t1, t2, th;\n\t\t\tif($.isArray(obj)) {\n\t\t\t\tobj = obj.slice();\n\t\t\t\tfor(t1 = 0, t2 = obj.length; t1 < t2; t1++) {\n\t\t\t\t\tthis.select_node(obj[t1], supress_event, prevent_open, e);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(!obj || obj.id === $.jstree.root) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tdom = this.get_node(obj, true);\n\t\t\tif(!obj.state.selected) {\n\t\t\t\tobj.state.selected = true;\n\t\t\t\tthis._data.core.selected.push(obj.id);\n\t\t\t\tif(!prevent_open) {\n\t\t\t\t\tdom = this._open_to(obj);\n\t\t\t\t}\n\t\t\t\tif(dom && dom.length) {\n\t\t\t\t\tdom.attr('aria-selected', true).children('.jstree-anchor').addClass('jstree-clicked');\n\t\t\t\t}\n\t\t\t\t/**\n\t\t\t\t * triggered when an node is selected\n\t\t\t\t * @event\n\t\t\t\t * @name select_node.jstree\n\t\t\t\t * @param {Object} node\n\t\t\t\t * @param {Array} selected the current selection\n\t\t\t\t * @param {Object} event the event (if any) that triggered this select_node\n\t\t\t\t */\n\t\t\t\tthis.trigger('select_node', { 'node' : obj, 'selected' : this._data.core.selected, 'event' : e });\n\t\t\t\tif(!supress_event) {\n\t\t\t\t\t/**\n\t\t\t\t\t * triggered when selection changes\n\t\t\t\t\t * @event\n\t\t\t\t\t * @name changed.jstree\n\t\t\t\t\t * @param {Object} node\n\t\t\t\t\t * @param {Object} action the action that caused the selection to change\n\t\t\t\t\t * @param {Array} selected the current selection\n\t\t\t\t\t * @param {Object} event the event (if any) that triggered this changed event\n\t\t\t\t\t */\n\t\t\t\t\tthis.trigger('changed', { 'action' : 'select_node', 'node' : obj, 'selected' : this._data.core.selected, 'event' : e });\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * deselect a node\n\t\t * @name deselect_node(obj [, supress_event])\n\t\t * @param {mixed} obj an array can be used to deselect multiple nodes\n\t\t * @param {Boolean} supress_event if set to `true` the `changed.jstree` event won't be triggered\n\t\t * @trigger deselect_node.jstree, changed.jstree\n\t\t */\n\t\tdeselect_node : function (obj, supress_event, e) {\n\t\t\tvar t1, t2, dom;\n\t\t\tif($.isArray(obj)) {\n\t\t\t\tobj = obj.slice();\n\t\t\t\tfor(t1 = 0, t2 = obj.length; t1 < t2; t1++) {\n\t\t\t\t\tthis.deselect_node(obj[t1], supress_event, e);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(!obj || obj.id === $.jstree.root) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tdom = this.get_node(obj, true);\n\t\t\tif(obj.state.selected) {\n\t\t\t\tobj.state.selected = false;\n\t\t\t\tthis._data.core.selected = $.vakata.array_remove_item(this._data.core.selected, obj.id);\n\t\t\t\tif(dom.length) {\n\t\t\t\t\tdom.attr('aria-selected', false).children('.jstree-anchor').removeClass('jstree-clicked');\n\t\t\t\t}\n\t\t\t\t/**\n\t\t\t\t * triggered when an node is deselected\n\t\t\t\t * @event\n\t\t\t\t * @name deselect_node.jstree\n\t\t\t\t * @param {Object} node\n\t\t\t\t * @param {Array} selected the current selection\n\t\t\t\t * @param {Object} event the event (if any) that triggered this deselect_node\n\t\t\t\t */\n\t\t\t\tthis.trigger('deselect_node', { 'node' : obj, 'selected' : this._data.core.selected, 'event' : e });\n\t\t\t\tif(!supress_event) {\n\t\t\t\t\tthis.trigger('changed', { 'action' : 'deselect_node', 'node' : obj, 'selected' : this._data.core.selected, 'event' : e });\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * select all nodes in the tree\n\t\t * @name select_all([supress_event])\n\t\t * @param {Boolean} supress_event if set to `true` the `changed.jstree` event won't be triggered\n\t\t * @trigger select_all.jstree, changed.jstree\n\t\t */\n\t\tselect_all : function (supress_event) {\n\t\t\tvar tmp = this._data.core.selected.concat([]), i, j;\n\t\t\tthis._data.core.selected = this._model.data[$.jstree.root].children_d.concat();\n\t\t\tfor(i = 0, j = this._data.core.selected.length; i < j; i++) {\n\t\t\t\tif(this._model.data[this._data.core.selected[i]]) {\n\t\t\t\t\tthis._model.data[this._data.core.selected[i]].state.selected = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.redraw(true);\n\t\t\t/**\n\t\t\t * triggered when all nodes are selected\n\t\t\t * @event\n\t\t\t * @name select_all.jstree\n\t\t\t * @param {Array} selected the current selection\n\t\t\t */\n\t\t\tthis.trigger('select_all', { 'selected' : this._data.core.selected });\n\t\t\tif(!supress_event) {\n\t\t\t\tthis.trigger('changed', { 'action' : 'select_all', 'selected' : this._data.core.selected, 'old_selection' : tmp });\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * deselect all selected nodes\n\t\t * @name deselect_all([supress_event])\n\t\t * @param {Boolean} supress_event if set to `true` the `changed.jstree` event won't be triggered\n\t\t * @trigger deselect_all.jstree, changed.jstree\n\t\t */\n\t\tdeselect_all : function (supress_event) {\n\t\t\tvar tmp = this._data.core.selected.concat([]), i, j;\n\t\t\tfor(i = 0, j = this._data.core.selected.length; i < j; i++) {\n\t\t\t\tif(this._model.data[this._data.core.selected[i]]) {\n\t\t\t\t\tthis._model.data[this._data.core.selected[i]].state.selected = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._data.core.selected = [];\n\t\t\tthis.element.find('.jstree-clicked').removeClass('jstree-clicked').parent().attr('aria-selected', false);\n\t\t\t/**\n\t\t\t * triggered when all nodes are deselected\n\t\t\t * @event\n\t\t\t * @name deselect_all.jstree\n\t\t\t * @param {Object} node the previous selection\n\t\t\t * @param {Array} selected the current selection\n\t\t\t */\n\t\t\tthis.trigger('deselect_all', { 'selected' : this._data.core.selected, 'node' : tmp });\n\t\t\tif(!supress_event) {\n\t\t\t\tthis.trigger('changed', { 'action' : 'deselect_all', 'selected' : this._data.core.selected, 'old_selection' : tmp });\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * checks if a node is selected\n\t\t * @name is_selected(obj)\n\t\t * @param  {mixed}  obj\n\t\t * @return {Boolean}\n\t\t */\n\t\tis_selected : function (obj) {\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(!obj || obj.id === $.jstree.root) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn obj.state.selected;\n\t\t},\n\t\t/**\n\t\t * get an array of all selected nodes\n\t\t * @name get_selected([full])\n\t\t * @param  {mixed}  full if set to `true` the returned array will consist of the full node objects, otherwise - only IDs will be returned\n\t\t * @return {Array}\n\t\t */\n\t\tget_selected : function (full) {\n\t\t\treturn full ? $.map(this._data.core.selected, $.proxy(function (i) { return this.get_node(i); }, this)) : this._data.core.selected.slice();\n\t\t},\n\t\t/**\n\t\t * get an array of all top level selected nodes (ignoring children of selected nodes)\n\t\t * @name get_top_selected([full])\n\t\t * @param  {mixed}  full if set to `true` the returned array will consist of the full node objects, otherwise - only IDs will be returned\n\t\t * @return {Array}\n\t\t */\n\t\tget_top_selected : function (full) {\n\t\t\tvar tmp = this.get_selected(true),\n\t\t\t\tobj = {}, i, j, k, l;\n\t\t\tfor(i = 0, j = tmp.length; i < j; i++) {\n\t\t\t\tobj[tmp[i].id] = tmp[i];\n\t\t\t}\n\t\t\tfor(i = 0, j = tmp.length; i < j; i++) {\n\t\t\t\tfor(k = 0, l = tmp[i].children_d.length; k < l; k++) {\n\t\t\t\t\tif(obj[tmp[i].children_d[k]]) {\n\t\t\t\t\t\tdelete obj[tmp[i].children_d[k]];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\ttmp = [];\n\t\t\tfor(i in obj) {\n\t\t\t\tif(obj.hasOwnProperty(i)) {\n\t\t\t\t\ttmp.push(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn full ? $.map(tmp, $.proxy(function (i) { return this.get_node(i); }, this)) : tmp;\n\t\t},\n\t\t/**\n\t\t * get an array of all bottom level selected nodes (ignoring selected parents)\n\t\t * @name get_bottom_selected([full])\n\t\t * @param  {mixed}  full if set to `true` the returned array will consist of the full node objects, otherwise - only IDs will be returned\n\t\t * @return {Array}\n\t\t */\n\t\tget_bottom_selected : function (full) {\n\t\t\tvar tmp = this.get_selected(true),\n\t\t\t\tobj = [], i, j;\n\t\t\tfor(i = 0, j = tmp.length; i < j; i++) {\n\t\t\t\tif(!tmp[i].children.length) {\n\t\t\t\t\tobj.push(tmp[i].id);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn full ? $.map(obj, $.proxy(function (i) { return this.get_node(i); }, this)) : obj;\n\t\t},\n\t\t/**\n\t\t * gets the current state of the tree so that it can be restored later with `set_state(state)`. Used internally.\n\t\t * @name get_state()\n\t\t * @private\n\t\t * @return {Object}\n\t\t */\n\t\tget_state : function () {\n\t\t\tvar state\t= {\n\t\t\t\t'core' : {\n\t\t\t\t\t'open' : [],\n\t\t\t\t\t'loaded' : [],\n\t\t\t\t\t'scroll' : {\n\t\t\t\t\t\t'left' : this.element.scrollLeft(),\n\t\t\t\t\t\t'top' : this.element.scrollTop()\n\t\t\t\t\t},\n\t\t\t\t\t/*!\n\t\t\t\t\t'themes' : {\n\t\t\t\t\t\t'name' : this.get_theme(),\n\t\t\t\t\t\t'icons' : this._data.core.themes.icons,\n\t\t\t\t\t\t'dots' : this._data.core.themes.dots\n\t\t\t\t\t},\n\t\t\t\t\t*/\n\t\t\t\t\t'selected' : []\n\t\t\t\t}\n\t\t\t}, i;\n\t\t\tfor(i in this._model.data) {\n\t\t\t\tif(this._model.data.hasOwnProperty(i)) {\n\t\t\t\t\tif(i !== $.jstree.root) {\n\t\t\t\t\t\tif(this._model.data[i].state.loaded && this.settings.core.loaded_state) {\n\t\t\t\t\t\t\tstate.core.loaded.push(i);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(this._model.data[i].state.opened) {\n\t\t\t\t\t\t\tstate.core.open.push(i);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(this._model.data[i].state.selected) {\n\t\t\t\t\t\t\tstate.core.selected.push(i);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn state;\n\t\t},\n\t\t/**\n\t\t * sets the state of the tree. Used internally.\n\t\t * @name set_state(state [, callback])\n\t\t * @private\n\t\t * @param {Object} state the state to restore. Keep in mind this object is passed by reference and jstree will modify it.\n\t\t * @param {Function} callback an optional function to execute once the state is restored.\n\t\t * @trigger set_state.jstree\n\t\t */\n\t\tset_state : function (state, callback) {\n\t\t\tif(state) {\n\t\t\t\tif(state.core && state.core.selected && state.core.initial_selection === undefined) {\n\t\t\t\t\tstate.core.initial_selection = this._data.core.selected.concat([]).sort().join(',');\n\t\t\t\t}\n\t\t\t\tif(state.core) {\n\t\t\t\t\tvar res, n, t, _this, i;\n\t\t\t\t\tif(state.core.loaded) {\n\t\t\t\t\t\tif(!this.settings.core.loaded_state || !$.isArray(state.core.loaded) || !state.core.loaded.length) {\n\t\t\t\t\t\t\tdelete state.core.loaded;\n\t\t\t\t\t\t\tthis.set_state(state, callback);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tthis._load_nodes(state.core.loaded, function (nodes) {\n\t\t\t\t\t\t\t\tdelete state.core.loaded;\n\t\t\t\t\t\t\t\tthis.set_state(state, callback);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tif(state.core.open) {\n\t\t\t\t\t\tif(!$.isArray(state.core.open) || !state.core.open.length) {\n\t\t\t\t\t\t\tdelete state.core.open;\n\t\t\t\t\t\t\tthis.set_state(state, callback);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tthis._load_nodes(state.core.open, function (nodes) {\n\t\t\t\t\t\t\t\tthis.open_node(nodes, false, 0);\n\t\t\t\t\t\t\t\tdelete state.core.open;\n\t\t\t\t\t\t\t\tthis.set_state(state, callback);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tif(state.core.scroll) {\n\t\t\t\t\t\tif(state.core.scroll && state.core.scroll.left !== undefined) {\n\t\t\t\t\t\t\tthis.element.scrollLeft(state.core.scroll.left);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(state.core.scroll && state.core.scroll.top !== undefined) {\n\t\t\t\t\t\t\tthis.element.scrollTop(state.core.scroll.top);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdelete state.core.scroll;\n\t\t\t\t\t\tthis.set_state(state, callback);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tif(state.core.selected) {\n\t\t\t\t\t\t_this = this;\n\t\t\t\t\t\tif (state.core.initial_selection === undefined ||\n\t\t\t\t\t\t\tstate.core.initial_selection === this._data.core.selected.concat([]).sort().join(',')\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tthis.deselect_all();\n\t\t\t\t\t\t\t$.each(state.core.selected, function (i, v) {\n\t\t\t\t\t\t\t\t_this.select_node(v, false, true);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdelete state.core.initial_selection;\n\t\t\t\t\t\tdelete state.core.selected;\n\t\t\t\t\t\tthis.set_state(state, callback);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tfor(i in state) {\n\t\t\t\t\t\tif(state.hasOwnProperty(i) && i !== \"core\" && $.inArray(i, this.settings.plugins) === -1) {\n\t\t\t\t\t\t\tdelete state[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif($.isEmptyObject(state.core)) {\n\t\t\t\t\t\tdelete state.core;\n\t\t\t\t\t\tthis.set_state(state, callback);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif($.isEmptyObject(state)) {\n\t\t\t\t\tstate = null;\n\t\t\t\t\tif(callback) { callback.call(this); }\n\t\t\t\t\t/**\n\t\t\t\t\t * triggered when a `set_state` call completes\n\t\t\t\t\t * @event\n\t\t\t\t\t * @name set_state.jstree\n\t\t\t\t\t */\n\t\t\t\t\tthis.trigger('set_state');\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\t/**\n\t\t * refreshes the tree - all nodes are reloaded with calls to `load_node`.\n\t\t * @name refresh()\n\t\t * @param {Boolean} skip_loading an option to skip showing the loading indicator\n\t\t * @param {Mixed} forget_state if set to `true` state will not be reapplied, if set to a function (receiving the current state as argument) the result of that function will be used as state\n\t\t * @trigger refresh.jstree\n\t\t */\n\t\trefresh : function (skip_loading, forget_state) {\n\t\t\tthis._data.core.state = forget_state === true ? {} : this.get_state();\n\t\t\tif(forget_state && $.isFunction(forget_state)) { this._data.core.state = forget_state.call(this, this._data.core.state); }\n\t\t\tthis._cnt = 0;\n\t\t\tthis._model.data = {};\n\t\t\tthis._model.data[$.jstree.root] = {\n\t\t\t\tid : $.jstree.root,\n\t\t\t\tparent : null,\n\t\t\t\tparents : [],\n\t\t\t\tchildren : [],\n\t\t\t\tchildren_d : [],\n\t\t\t\tstate : { loaded : false }\n\t\t\t};\n\t\t\tthis._data.core.selected = [];\n\t\t\tthis._data.core.last_clicked = null;\n\t\t\tthis._data.core.focused = null;\n\n\t\t\tvar c = this.get_container_ul()[0].className;\n\t\t\tif(!skip_loading) {\n\t\t\t\tthis.element.html(\"<\"+\"ul class='\"+c+\"' role='group'><\"+\"li class='jstree-initial-node jstree-loading jstree-leaf jstree-last' role='treeitem' id='j\"+this._id+\"_loading'><i class='jstree-icon jstree-ocl'></i><\"+\"a class='jstree-anchor' href='#'><i class='jstree-icon jstree-themeicon-hidden'></i>\" + this.get_string(\"Loading ...\") + \"</a></li></ul>\");\n\t\t\t\tthis.element.attr('aria-activedescendant','j'+this._id+'_loading');\n\t\t\t}\n\t\t\tthis.load_node($.jstree.root, function (o, s) {\n\t\t\t\tif(s) {\n\t\t\t\t\tthis.get_container_ul()[0].className = c;\n\t\t\t\t\tif(this._firstChild(this.get_container_ul()[0])) {\n\t\t\t\t\t\tthis.element.attr('aria-activedescendant',this._firstChild(this.get_container_ul()[0]).id);\n\t\t\t\t\t}\n\t\t\t\t\tthis.set_state($.extend(true, {}, this._data.core.state), function () {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * triggered when a `refresh` call completes\n\t\t\t\t\t\t * @event\n\t\t\t\t\t\t * @name refresh.jstree\n\t\t\t\t\t\t */\n\t\t\t\t\t\tthis.trigger('refresh');\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tthis._data.core.state = null;\n\t\t\t});\n\t\t},\n\t\t/**\n\t\t * refreshes a node in the tree (reload its children) all opened nodes inside that node are reloaded with calls to `load_node`.\n\t\t * @name refresh_node(obj)\n\t\t * @param  {mixed} obj the node\n\t\t * @trigger refresh_node.jstree\n\t\t */\n\t\trefresh_node : function (obj) {\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(!obj || obj.id === $.jstree.root) { return false; }\n\t\t\tvar opened = [], to_load = [], s = this._data.core.selected.concat([]);\n\t\t\tto_load.push(obj.id);\n\t\t\tif(obj.state.opened === true) { opened.push(obj.id); }\n\t\t\tthis.get_node(obj, true).find('.jstree-open').each(function() { to_load.push(this.id); opened.push(this.id); });\n\t\t\tthis._load_nodes(to_load, $.proxy(function (nodes) {\n\t\t\t\tthis.open_node(opened, false, 0);\n\t\t\t\tthis.select_node(s);\n\t\t\t\t/**\n\t\t\t\t * triggered when a node is refreshed\n\t\t\t\t * @event\n\t\t\t\t * @name refresh_node.jstree\n\t\t\t\t * @param {Object} node - the refreshed node\n\t\t\t\t * @param {Array} nodes - an array of the IDs of the nodes that were reloaded\n\t\t\t\t */\n\t\t\t\tthis.trigger('refresh_node', { 'node' : obj, 'nodes' : nodes });\n\t\t\t}, this), false, true);\n\t\t},\n\t\t/**\n\t\t * set (change) the ID of a node\n\t\t * @name set_id(obj, id)\n\t\t * @param  {mixed} obj the node\n\t\t * @param  {String} id the new ID\n\t\t * @return {Boolean}\n\t\t * @trigger set_id.jstree\n\t\t */\n\t\tset_id : function (obj, id) {\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(!obj || obj.id === $.jstree.root) { return false; }\n\t\t\tvar i, j, m = this._model.data, old = obj.id;\n\t\t\tid = id.toString();\n\t\t\t// update parents (replace current ID with new one in children and children_d)\n\t\t\tm[obj.parent].children[$.inArray(obj.id, m[obj.parent].children)] = id;\n\t\t\tfor(i = 0, j = obj.parents.length; i < j; i++) {\n\t\t\t\tm[obj.parents[i]].children_d[$.inArray(obj.id, m[obj.parents[i]].children_d)] = id;\n\t\t\t}\n\t\t\t// update children (replace current ID with new one in parent and parents)\n\t\t\tfor(i = 0, j = obj.children.length; i < j; i++) {\n\t\t\t\tm[obj.children[i]].parent = id;\n\t\t\t}\n\t\t\tfor(i = 0, j = obj.children_d.length; i < j; i++) {\n\t\t\t\tm[obj.children_d[i]].parents[$.inArray(obj.id, m[obj.children_d[i]].parents)] = id;\n\t\t\t}\n\t\t\ti = $.inArray(obj.id, this._data.core.selected);\n\t\t\tif(i !== -1) { this._data.core.selected[i] = id; }\n\t\t\t// update model and obj itself (obj.id, this._model.data[KEY])\n\t\t\ti = this.get_node(obj.id, true);\n\t\t\tif(i) {\n\t\t\t\ti.attr('id', id); //.children('.jstree-anchor').attr('id', id + '_anchor').end().attr('aria-labelledby', id + '_anchor');\n\t\t\t\tif(this.element.attr('aria-activedescendant') === obj.id) {\n\t\t\t\t\tthis.element.attr('aria-activedescendant', id);\n\t\t\t\t}\n\t\t\t}\n\t\t\tdelete m[obj.id];\n\t\t\tobj.id = id;\n\t\t\tobj.li_attr.id = id;\n\t\t\tm[id] = obj;\n\t\t\t/**\n\t\t\t * triggered when a node id value is changed\n\t\t\t * @event\n\t\t\t * @name set_id.jstree\n\t\t\t * @param {Object} node\n\t\t\t * @param {String} old the old id\n\t\t\t */\n\t\t\tthis.trigger('set_id',{ \"node\" : obj, \"new\" : obj.id, \"old\" : old });\n\t\t\treturn true;\n\t\t},\n\t\t/**\n\t\t * get the text value of a node\n\t\t * @name get_text(obj)\n\t\t * @param  {mixed} obj the node\n\t\t * @return {String}\n\t\t */\n\t\tget_text : function (obj) {\n\t\t\tobj = this.get_node(obj);\n\t\t\treturn (!obj || obj.id === $.jstree.root) ? false : obj.text;\n\t\t},\n\t\t/**\n\t\t * set the text value of a node. Used internally, please use `rename_node(obj, val)`.\n\t\t * @private\n\t\t * @name set_text(obj, val)\n\t\t * @param  {mixed} obj the node, you can pass an array to set the text on multiple nodes\n\t\t * @param  {String} val the new text value\n\t\t * @return {Boolean}\n\t\t * @trigger set_text.jstree\n\t\t */\n\t\tset_text : function (obj, val) {\n\t\t\tvar t1, t2;\n\t\t\tif($.isArray(obj)) {\n\t\t\t\tobj = obj.slice();\n\t\t\t\tfor(t1 = 0, t2 = obj.length; t1 < t2; t1++) {\n\t\t\t\t\tthis.set_text(obj[t1], val);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(!obj || obj.id === $.jstree.root) { return false; }\n\t\t\tobj.text = val;\n\t\t\tif(this.get_node(obj, true).length) {\n\t\t\t\tthis.redraw_node(obj.id);\n\t\t\t}\n\t\t\t/**\n\t\t\t * triggered when a node text value is changed\n\t\t\t * @event\n\t\t\t * @name set_text.jstree\n\t\t\t * @param {Object} obj\n\t\t\t * @param {String} text the new value\n\t\t\t */\n\t\t\tthis.trigger('set_text',{ \"obj\" : obj, \"text\" : val });\n\t\t\treturn true;\n\t\t},\n\t\t/**\n\t\t * gets a JSON representation of a node (or the whole tree)\n\t\t * @name get_json([obj, options])\n\t\t * @param  {mixed} obj\n\t\t * @param  {Object} options\n\t\t * @param  {Boolean} options.no_state do not return state information\n\t\t * @param  {Boolean} options.no_id do not return ID\n\t\t * @param  {Boolean} options.no_children do not include children\n\t\t * @param  {Boolean} options.no_data do not include node data\n\t\t * @param  {Boolean} options.no_li_attr do not include LI attributes\n\t\t * @param  {Boolean} options.no_a_attr do not include A attributes\n\t\t * @param  {Boolean} options.flat return flat JSON instead of nested\n\t\t * @return {Object}\n\t\t */\n\t\tget_json : function (obj, options, flat) {\n\t\t\tobj = this.get_node(obj || $.jstree.root);\n\t\t\tif(!obj) { return false; }\n\t\t\tif(options && options.flat && !flat) { flat = []; }\n\t\t\tvar tmp = {\n\t\t\t\t'id' : obj.id,\n\t\t\t\t'text' : obj.text,\n\t\t\t\t'icon' : this.get_icon(obj),\n\t\t\t\t'li_attr' : $.extend(true, {}, obj.li_attr),\n\t\t\t\t'a_attr' : $.extend(true, {}, obj.a_attr),\n\t\t\t\t'state' : {},\n\t\t\t\t'data' : options && options.no_data ? false : $.extend(true, $.isArray(obj.data)?[]:{}, obj.data)\n\t\t\t\t//( this.get_node(obj, true).length ? this.get_node(obj, true).data() : obj.data ),\n\t\t\t}, i, j;\n\t\t\tif(options && options.flat) {\n\t\t\t\ttmp.parent = obj.parent;\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttmp.children = [];\n\t\t\t}\n\t\t\tif(!options || !options.no_state) {\n\t\t\t\tfor(i in obj.state) {\n\t\t\t\t\tif(obj.state.hasOwnProperty(i)) {\n\t\t\t\t\t\ttmp.state[i] = obj.state[i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdelete tmp.state;\n\t\t\t}\n\t\t\tif(options && options.no_li_attr) {\n\t\t\t\tdelete tmp.li_attr;\n\t\t\t}\n\t\t\tif(options && options.no_a_attr) {\n\t\t\t\tdelete tmp.a_attr;\n\t\t\t}\n\t\t\tif(options && options.no_id) {\n\t\t\t\tdelete tmp.id;\n\t\t\t\tif(tmp.li_attr && tmp.li_attr.id) {\n\t\t\t\t\tdelete tmp.li_attr.id;\n\t\t\t\t}\n\t\t\t\tif(tmp.a_attr && tmp.a_attr.id) {\n\t\t\t\t\tdelete tmp.a_attr.id;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(options && options.flat && obj.id !== $.jstree.root) {\n\t\t\t\tflat.push(tmp);\n\t\t\t}\n\t\t\tif(!options || !options.no_children) {\n\t\t\t\tfor(i = 0, j = obj.children.length; i < j; i++) {\n\t\t\t\t\tif(options && options.flat) {\n\t\t\t\t\t\tthis.get_json(obj.children[i], options, flat);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\ttmp.children.push(this.get_json(obj.children[i], options));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn options && options.flat ? flat : (obj.id === $.jstree.root ? tmp.children : tmp);\n\t\t},\n\t\t/**\n\t\t * create a new node (do not confuse with load_node)\n\t\t * @name create_node([par, node, pos, callback, is_loaded])\n\t\t * @param  {mixed}   par       the parent node (to create a root node use either \"#\" (string) or `null`)\n\t\t * @param  {mixed}   node      the data for the new node (a valid JSON object, or a simple string with the name)\n\t\t * @param  {mixed}   pos       the index at which to insert the node, \"first\" and \"last\" are also supported, default is \"last\"\n\t\t * @param  {Function} callback a function to be called once the node is created\n\t\t * @param  {Boolean} is_loaded internal argument indicating if the parent node was succesfully loaded\n\t\t * @return {String}            the ID of the newly create node\n\t\t * @trigger model.jstree, create_node.jstree\n\t\t */\n\t\tcreate_node : function (par, node, pos, callback, is_loaded) {\n\t\t\tif(par === null) { par = $.jstree.root; }\n\t\t\tpar = this.get_node(par);\n\t\t\tif(!par) { return false; }\n\t\t\tpos = pos === undefined ? \"last\" : pos;\n\t\t\tif(!pos.toString().match(/^(before|after)$/) && !is_loaded && !this.is_loaded(par)) {\n\t\t\t\treturn this.load_node(par, function () { this.create_node(par, node, pos, callback, true); });\n\t\t\t}\n\t\t\tif(!node) { node = { \"text\" : this.get_string('New node') }; }\n\t\t\tif(typeof node === \"string\") {\n\t\t\t\tnode = { \"text\" : node };\n\t\t\t} else {\n\t\t\t\tnode = $.extend(true, {}, node);\n\t\t\t}\n\t\t\tif(node.text === undefined) { node.text = this.get_string('New node'); }\n\t\t\tvar tmp, dpc, i, j;\n\n\t\t\tif(par.id === $.jstree.root) {\n\t\t\t\tif(pos === \"before\") { pos = \"first\"; }\n\t\t\t\tif(pos === \"after\") { pos = \"last\"; }\n\t\t\t}\n\t\t\tswitch(pos) {\n\t\t\t\tcase \"before\":\n\t\t\t\t\ttmp = this.get_node(par.parent);\n\t\t\t\t\tpos = $.inArray(par.id, tmp.children);\n\t\t\t\t\tpar = tmp;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"after\" :\n\t\t\t\t\ttmp = this.get_node(par.parent);\n\t\t\t\t\tpos = $.inArray(par.id, tmp.children) + 1;\n\t\t\t\t\tpar = tmp;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"inside\":\n\t\t\t\tcase \"first\":\n\t\t\t\t\tpos = 0;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"last\":\n\t\t\t\t\tpos = par.children.length;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tif(!pos) { pos = 0; }\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(pos > par.children.length) { pos = par.children.length; }\n\t\t\tif(!node.id) { node.id = true; }\n\t\t\tif(!this.check(\"create_node\", node, par, pos)) {\n\t\t\t\tthis.settings.core.error.call(this, this._data.core.last_error);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(node.id === true) { delete node.id; }\n\t\t\tnode = this._parse_model_from_json(node, par.id, par.parents.concat());\n\t\t\tif(!node) { return false; }\n\t\t\ttmp = this.get_node(node);\n\t\t\tdpc = [];\n\t\t\tdpc.push(node);\n\t\t\tdpc = dpc.concat(tmp.children_d);\n\t\t\tthis.trigger('model', { \"nodes\" : dpc, \"parent\" : par.id });\n\n\t\t\tpar.children_d = par.children_d.concat(dpc);\n\t\t\tfor(i = 0, j = par.parents.length; i < j; i++) {\n\t\t\t\tthis._model.data[par.parents[i]].children_d = this._model.data[par.parents[i]].children_d.concat(dpc);\n\t\t\t}\n\t\t\tnode = tmp;\n\t\t\ttmp = [];\n\t\t\tfor(i = 0, j = par.children.length; i < j; i++) {\n\t\t\t\ttmp[i >= pos ? i+1 : i] = par.children[i];\n\t\t\t}\n\t\t\ttmp[pos] = node.id;\n\t\t\tpar.children = tmp;\n\n\t\t\tthis.redraw_node(par, true);\n\t\t\t/**\n\t\t\t * triggered when a node is created\n\t\t\t * @event\n\t\t\t * @name create_node.jstree\n\t\t\t * @param {Object} node\n\t\t\t * @param {String} parent the parent's ID\n\t\t\t * @param {Number} position the position of the new node among the parent's children\n\t\t\t */\n\t\t\tthis.trigger('create_node', { \"node\" : this.get_node(node), \"parent\" : par.id, \"position\" : pos });\n\t\t\tif(callback) { callback.call(this, this.get_node(node)); }\n\t\t\treturn node.id;\n\t\t},\n\t\t/**\n\t\t * set the text value of a node\n\t\t * @name rename_node(obj, val)\n\t\t * @param  {mixed} obj the node, you can pass an array to rename multiple nodes to the same name\n\t\t * @param  {String} val the new text value\n\t\t * @return {Boolean}\n\t\t * @trigger rename_node.jstree\n\t\t */\n\t\trename_node : function (obj, val) {\n\t\t\tvar t1, t2, old;\n\t\t\tif($.isArray(obj)) {\n\t\t\t\tobj = obj.slice();\n\t\t\t\tfor(t1 = 0, t2 = obj.length; t1 < t2; t1++) {\n\t\t\t\t\tthis.rename_node(obj[t1], val);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(!obj || obj.id === $.jstree.root) { return false; }\n\t\t\told = obj.text;\n\t\t\tif(!this.check(\"rename_node\", obj, this.get_parent(obj), val)) {\n\t\t\t\tthis.settings.core.error.call(this, this._data.core.last_error);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tthis.set_text(obj, val); // .apply(this, Array.prototype.slice.call(arguments))\n\t\t\t/**\n\t\t\t * triggered when a node is renamed\n\t\t\t * @event\n\t\t\t * @name rename_node.jstree\n\t\t\t * @param {Object} node\n\t\t\t * @param {String} text the new value\n\t\t\t * @param {String} old the old value\n\t\t\t */\n\t\t\tthis.trigger('rename_node', { \"node\" : obj, \"text\" : val, \"old\" : old });\n\t\t\treturn true;\n\t\t},\n\t\t/**\n\t\t * remove a node\n\t\t * @name delete_node(obj)\n\t\t * @param  {mixed} obj the node, you can pass an array to delete multiple nodes\n\t\t * @return {Boolean}\n\t\t * @trigger delete_node.jstree, changed.jstree\n\t\t */\n\t\tdelete_node : function (obj) {\n\t\t\tvar t1, t2, par, pos, tmp, i, j, k, l, c, top, lft;\n\t\t\tif($.isArray(obj)) {\n\t\t\t\tobj = obj.slice();\n\t\t\t\tfor(t1 = 0, t2 = obj.length; t1 < t2; t1++) {\n\t\t\t\t\tthis.delete_node(obj[t1]);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(!obj || obj.id === $.jstree.root) { return false; }\n\t\t\tpar = this.get_node(obj.parent);\n\t\t\tpos = $.inArray(obj.id, par.children);\n\t\t\tc = false;\n\t\t\tif(!this.check(\"delete_node\", obj, par, pos)) {\n\t\t\t\tthis.settings.core.error.call(this, this._data.core.last_error);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(pos !== -1) {\n\t\t\t\tpar.children = $.vakata.array_remove(par.children, pos);\n\t\t\t}\n\t\t\ttmp = obj.children_d.concat([]);\n\t\t\ttmp.push(obj.id);\n\t\t\tfor(i = 0, j = obj.parents.length; i < j; i++) {\n\t\t\t\tthis._model.data[obj.parents[i]].children_d = $.vakata.array_filter(this._model.data[obj.parents[i]].children_d, function (v) {\n\t\t\t\t\treturn $.inArray(v, tmp) === -1;\n\t\t\t\t});\n\t\t\t}\n\t\t\tfor(k = 0, l = tmp.length; k < l; k++) {\n\t\t\t\tif(this._model.data[tmp[k]].state.selected) {\n\t\t\t\t\tc = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (c) {\n\t\t\t\tthis._data.core.selected = $.vakata.array_filter(this._data.core.selected, function (v) {\n\t\t\t\t\treturn $.inArray(v, tmp) === -1;\n\t\t\t\t});\n\t\t\t}\n\t\t\t/**\n\t\t\t * triggered when a node is deleted\n\t\t\t * @event\n\t\t\t * @name delete_node.jstree\n\t\t\t * @param {Object} node\n\t\t\t * @param {String} parent the parent's ID\n\t\t\t */\n\t\t\tthis.trigger('delete_node', { \"node\" : obj, \"parent\" : par.id });\n\t\t\tif(c) {\n\t\t\t\tthis.trigger('changed', { 'action' : 'delete_node', 'node' : obj, 'selected' : this._data.core.selected, 'parent' : par.id });\n\t\t\t}\n\t\t\tfor(k = 0, l = tmp.length; k < l; k++) {\n\t\t\t\tdelete this._model.data[tmp[k]];\n\t\t\t}\n\t\t\tif($.inArray(this._data.core.focused, tmp) !== -1) {\n\t\t\t\tthis._data.core.focused = null;\n\t\t\t\ttop = this.element[0].scrollTop;\n\t\t\t\tlft = this.element[0].scrollLeft;\n\t\t\t\tif(par.id === $.jstree.root) {\n\t\t\t\t\tif (this._model.data[$.jstree.root].children[0]) {\n\t\t\t\t\t\tthis.get_node(this._model.data[$.jstree.root].children[0], true).children('.jstree-anchor').focus();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis.get_node(par, true).children('.jstree-anchor').focus();\n\t\t\t\t}\n\t\t\t\tthis.element[0].scrollTop  = top;\n\t\t\t\tthis.element[0].scrollLeft = lft;\n\t\t\t}\n\t\t\tthis.redraw_node(par, true);\n\t\t\treturn true;\n\t\t},\n\t\t/**\n\t\t * check if an operation is premitted on the tree. Used internally.\n\t\t * @private\n\t\t * @name check(chk, obj, par, pos)\n\t\t * @param  {String} chk the operation to check, can be \"create_node\", \"rename_node\", \"delete_node\", \"copy_node\" or \"move_node\"\n\t\t * @param  {mixed} obj the node\n\t\t * @param  {mixed} par the parent\n\t\t * @param  {mixed} pos the position to insert at, or if \"rename_node\" - the new name\n\t\t * @param  {mixed} more some various additional information, for example if a \"move_node\" operations is triggered by DND this will be the hovered node\n\t\t * @return {Boolean}\n\t\t */\n\t\tcheck : function (chk, obj, par, pos, more) {\n\t\t\tobj = obj && obj.id ? obj : this.get_node(obj);\n\t\t\tpar = par && par.id ? par : this.get_node(par);\n\t\t\tvar tmp = chk.match(/^move_node|copy_node|create_node$/i) ? par : obj,\n\t\t\t\tchc = this.settings.core.check_callback;\n\t\t\tif(chk === \"move_node\" || chk === \"copy_node\") {\n\t\t\t\tif((!more || !more.is_multi) && (chk === \"move_node\" && $.inArray(obj.id, par.children) === pos)) {\n\t\t\t\t\tthis._data.core.last_error = { 'error' : 'check', 'plugin' : 'core', 'id' : 'core_08', 'reason' : 'Moving node to its current position', 'data' : JSON.stringify({ 'chk' : chk, 'pos' : pos, 'obj' : obj && obj.id ? obj.id : false, 'par' : par && par.id ? par.id : false }) };\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif((!more || !more.is_multi) && (obj.id === par.id || (chk === \"move_node\" && $.inArray(obj.id, par.children) === pos) || $.inArray(par.id, obj.children_d) !== -1)) {\n\t\t\t\t\tthis._data.core.last_error = { 'error' : 'check', 'plugin' : 'core', 'id' : 'core_01', 'reason' : 'Moving parent inside child', 'data' : JSON.stringify({ 'chk' : chk, 'pos' : pos, 'obj' : obj && obj.id ? obj.id : false, 'par' : par && par.id ? par.id : false }) };\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(tmp && tmp.data) { tmp = tmp.data; }\n\t\t\tif(tmp && tmp.functions && (tmp.functions[chk] === false || tmp.functions[chk] === true)) {\n\t\t\t\tif(tmp.functions[chk] === false) {\n\t\t\t\t\tthis._data.core.last_error = { 'error' : 'check', 'plugin' : 'core', 'id' : 'core_02', 'reason' : 'Node data prevents function: ' + chk, 'data' : JSON.stringify({ 'chk' : chk, 'pos' : pos, 'obj' : obj && obj.id ? obj.id : false, 'par' : par && par.id ? par.id : false }) };\n\t\t\t\t}\n\t\t\t\treturn tmp.functions[chk];\n\t\t\t}\n\t\t\tif(chc === false || ($.isFunction(chc) && chc.call(this, chk, obj, par, pos, more) === false) || (chc && chc[chk] === false)) {\n\t\t\t\tthis._data.core.last_error = { 'error' : 'check', 'plugin' : 'core', 'id' : 'core_03', 'reason' : 'User config for core.check_callback prevents function: ' + chk, 'data' : JSON.stringify({ 'chk' : chk, 'pos' : pos, 'obj' : obj && obj.id ? obj.id : false, 'par' : par && par.id ? par.id : false }) };\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\t\t/**\n\t\t * get the last error\n\t\t * @name last_error()\n\t\t * @return {Object}\n\t\t */\n\t\tlast_error : function () {\n\t\t\treturn this._data.core.last_error;\n\t\t},\n\t\t/**\n\t\t * move a node to a new parent\n\t\t * @name move_node(obj, par [, pos, callback, is_loaded])\n\t\t * @param  {mixed} obj the node to move, pass an array to move multiple nodes\n\t\t * @param  {mixed} par the new parent\n\t\t * @param  {mixed} pos the position to insert at (besides integer values, \"first\" and \"last\" are supported, as well as \"before\" and \"after\"), defaults to integer `0`\n\t\t * @param  {function} callback a function to call once the move is completed, receives 3 arguments - the node, the new parent and the position\n\t\t * @param  {Boolean} is_loaded internal parameter indicating if the parent node has been loaded\n\t\t * @param  {Boolean} skip_redraw internal parameter indicating if the tree should be redrawn\n\t\t * @param  {Boolean} instance internal parameter indicating if the node comes from another instance\n\t\t * @trigger move_node.jstree\n\t\t */\n\t\tmove_node : function (obj, par, pos, callback, is_loaded, skip_redraw, origin) {\n\t\t\tvar t1, t2, old_par, old_pos, new_par, old_ins, is_multi, dpc, tmp, i, j, k, l, p;\n\n\t\t\tpar = this.get_node(par);\n\t\t\tpos = pos === undefined ? 0 : pos;\n\t\t\tif(!par) { return false; }\n\t\t\tif(!pos.toString().match(/^(before|after)$/) && !is_loaded && !this.is_loaded(par)) {\n\t\t\t\treturn this.load_node(par, function () { this.move_node(obj, par, pos, callback, true, false, origin); });\n\t\t\t}\n\n\t\t\tif($.isArray(obj)) {\n\t\t\t\tif(obj.length === 1) {\n\t\t\t\t\tobj = obj[0];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t//obj = obj.slice();\n\t\t\t\t\tfor(t1 = 0, t2 = obj.length; t1 < t2; t1++) {\n\t\t\t\t\t\tif((tmp = this.move_node(obj[t1], par, pos, callback, is_loaded, false, origin))) {\n\t\t\t\t\t\t\tpar = tmp;\n\t\t\t\t\t\t\tpos = \"after\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis.redraw();\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tobj = obj && obj.id ? obj : this.get_node(obj);\n\n\t\t\tif(!obj || obj.id === $.jstree.root) { return false; }\n\n\t\t\told_par = (obj.parent || $.jstree.root).toString();\n\t\t\tnew_par = (!pos.toString().match(/^(before|after)$/) || par.id === $.jstree.root) ? par : this.get_node(par.parent);\n\t\t\told_ins = origin ? origin : (this._model.data[obj.id] ? this : $.jstree.reference(obj.id));\n\t\t\tis_multi = !old_ins || !old_ins._id || (this._id !== old_ins._id);\n\t\t\told_pos = old_ins && old_ins._id && old_par && old_ins._model.data[old_par] && old_ins._model.data[old_par].children ? $.inArray(obj.id, old_ins._model.data[old_par].children) : -1;\n\t\t\tif(old_ins && old_ins._id) {\n\t\t\t\tobj = old_ins._model.data[obj.id];\n\t\t\t}\n\n\t\t\tif(is_multi) {\n\t\t\t\tif((tmp = this.copy_node(obj, par, pos, callback, is_loaded, false, origin))) {\n\t\t\t\t\tif(old_ins) { old_ins.delete_node(obj); }\n\t\t\t\t\treturn tmp;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t//var m = this._model.data;\n\t\t\tif(par.id === $.jstree.root) {\n\t\t\t\tif(pos === \"before\") { pos = \"first\"; }\n\t\t\t\tif(pos === \"after\") { pos = \"last\"; }\n\t\t\t}\n\t\t\tswitch(pos) {\n\t\t\t\tcase \"before\":\n\t\t\t\t\tpos = $.inArray(par.id, new_par.children);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"after\" :\n\t\t\t\t\tpos = $.inArray(par.id, new_par.children) + 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"inside\":\n\t\t\t\tcase \"first\":\n\t\t\t\t\tpos = 0;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"last\":\n\t\t\t\t\tpos = new_par.children.length;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tif(!pos) { pos = 0; }\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(pos > new_par.children.length) { pos = new_par.children.length; }\n\t\t\tif(!this.check(\"move_node\", obj, new_par, pos, { 'core' : true, 'origin' : origin, 'is_multi' : (old_ins && old_ins._id && old_ins._id !== this._id), 'is_foreign' : (!old_ins || !old_ins._id) })) {\n\t\t\t\tthis.settings.core.error.call(this, this._data.core.last_error);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(obj.parent === new_par.id) {\n\t\t\t\tdpc = new_par.children.concat();\n\t\t\t\ttmp = $.inArray(obj.id, dpc);\n\t\t\t\tif(tmp !== -1) {\n\t\t\t\t\tdpc = $.vakata.array_remove(dpc, tmp);\n\t\t\t\t\tif(pos > tmp) { pos--; }\n\t\t\t\t}\n\t\t\t\ttmp = [];\n\t\t\t\tfor(i = 0, j = dpc.length; i < j; i++) {\n\t\t\t\t\ttmp[i >= pos ? i+1 : i] = dpc[i];\n\t\t\t\t}\n\t\t\t\ttmp[pos] = obj.id;\n\t\t\t\tnew_par.children = tmp;\n\t\t\t\tthis._node_changed(new_par.id);\n\t\t\t\tthis.redraw(new_par.id === $.jstree.root);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// clean old parent and up\n\t\t\t\ttmp = obj.children_d.concat();\n\t\t\t\ttmp.push(obj.id);\n\t\t\t\tfor(i = 0, j = obj.parents.length; i < j; i++) {\n\t\t\t\t\tdpc = [];\n\t\t\t\t\tp = old_ins._model.data[obj.parents[i]].children_d;\n\t\t\t\t\tfor(k = 0, l = p.length; k < l; k++) {\n\t\t\t\t\t\tif($.inArray(p[k], tmp) === -1) {\n\t\t\t\t\t\t\tdpc.push(p[k]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\told_ins._model.data[obj.parents[i]].children_d = dpc;\n\t\t\t\t}\n\t\t\t\told_ins._model.data[old_par].children = $.vakata.array_remove_item(old_ins._model.data[old_par].children, obj.id);\n\n\t\t\t\t// insert into new parent and up\n\t\t\t\tfor(i = 0, j = new_par.parents.length; i < j; i++) {\n\t\t\t\t\tthis._model.data[new_par.parents[i]].children_d = this._model.data[new_par.parents[i]].children_d.concat(tmp);\n\t\t\t\t}\n\t\t\t\tdpc = [];\n\t\t\t\tfor(i = 0, j = new_par.children.length; i < j; i++) {\n\t\t\t\t\tdpc[i >= pos ? i+1 : i] = new_par.children[i];\n\t\t\t\t}\n\t\t\t\tdpc[pos] = obj.id;\n\t\t\t\tnew_par.children = dpc;\n\t\t\t\tnew_par.children_d.push(obj.id);\n\t\t\t\tnew_par.children_d = new_par.children_d.concat(obj.children_d);\n\n\t\t\t\t// update object\n\t\t\t\tobj.parent = new_par.id;\n\t\t\t\ttmp = new_par.parents.concat();\n\t\t\t\ttmp.unshift(new_par.id);\n\t\t\t\tp = obj.parents.length;\n\t\t\t\tobj.parents = tmp;\n\n\t\t\t\t// update object children\n\t\t\t\ttmp = tmp.concat();\n\t\t\t\tfor(i = 0, j = obj.children_d.length; i < j; i++) {\n\t\t\t\t\tthis._model.data[obj.children_d[i]].parents = this._model.data[obj.children_d[i]].parents.slice(0,p*-1);\n\t\t\t\t\tArray.prototype.push.apply(this._model.data[obj.children_d[i]].parents, tmp);\n\t\t\t\t}\n\n\t\t\t\tif(old_par === $.jstree.root || new_par.id === $.jstree.root) {\n\t\t\t\t\tthis._model.force_full_redraw = true;\n\t\t\t\t}\n\t\t\t\tif(!this._model.force_full_redraw) {\n\t\t\t\t\tthis._node_changed(old_par);\n\t\t\t\t\tthis._node_changed(new_par.id);\n\t\t\t\t}\n\t\t\t\tif(!skip_redraw) {\n\t\t\t\t\tthis.redraw();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(callback) { callback.call(this, obj, new_par, pos); }\n\t\t\t/**\n\t\t\t * triggered when a node is moved\n\t\t\t * @event\n\t\t\t * @name move_node.jstree\n\t\t\t * @param {Object} node\n\t\t\t * @param {String} parent the parent's ID\n\t\t\t * @param {Number} position the position of the node among the parent's children\n\t\t\t * @param {String} old_parent the old parent of the node\n\t\t\t * @param {Number} old_position the old position of the node\n\t\t\t * @param {Boolean} is_multi do the node and new parent belong to different instances\n\t\t\t * @param {jsTree} old_instance the instance the node came from\n\t\t\t * @param {jsTree} new_instance the instance of the new parent\n\t\t\t */\n\t\t\tthis.trigger('move_node', { \"node\" : obj, \"parent\" : new_par.id, \"position\" : pos, \"old_parent\" : old_par, \"old_position\" : old_pos, 'is_multi' : (old_ins && old_ins._id && old_ins._id !== this._id), 'is_foreign' : (!old_ins || !old_ins._id), 'old_instance' : old_ins, 'new_instance' : this });\n\t\t\treturn obj.id;\n\t\t},\n\t\t/**\n\t\t * copy a node to a new parent\n\t\t * @name copy_node(obj, par [, pos, callback, is_loaded])\n\t\t * @param  {mixed} obj the node to copy, pass an array to copy multiple nodes\n\t\t * @param  {mixed} par the new parent\n\t\t * @param  {mixed} pos the position to insert at (besides integer values, \"first\" and \"last\" are supported, as well as \"before\" and \"after\"), defaults to integer `0`\n\t\t * @param  {function} callback a function to call once the move is completed, receives 3 arguments - the node, the new parent and the position\n\t\t * @param  {Boolean} is_loaded internal parameter indicating if the parent node has been loaded\n\t\t * @param  {Boolean} skip_redraw internal parameter indicating if the tree should be redrawn\n\t\t * @param  {Boolean} instance internal parameter indicating if the node comes from another instance\n\t\t * @trigger model.jstree copy_node.jstree\n\t\t */\n\t\tcopy_node : function (obj, par, pos, callback, is_loaded, skip_redraw, origin) {\n\t\t\tvar t1, t2, dpc, tmp, i, j, node, old_par, new_par, old_ins, is_multi;\n\n\t\t\tpar = this.get_node(par);\n\t\t\tpos = pos === undefined ? 0 : pos;\n\t\t\tif(!par) { return false; }\n\t\t\tif(!pos.toString().match(/^(before|after)$/) && !is_loaded && !this.is_loaded(par)) {\n\t\t\t\treturn this.load_node(par, function () { this.copy_node(obj, par, pos, callback, true, false, origin); });\n\t\t\t}\n\n\t\t\tif($.isArray(obj)) {\n\t\t\t\tif(obj.length === 1) {\n\t\t\t\t\tobj = obj[0];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t//obj = obj.slice();\n\t\t\t\t\tfor(t1 = 0, t2 = obj.length; t1 < t2; t1++) {\n\t\t\t\t\t\tif((tmp = this.copy_node(obj[t1], par, pos, callback, is_loaded, true, origin))) {\n\t\t\t\t\t\t\tpar = tmp;\n\t\t\t\t\t\t\tpos = \"after\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis.redraw();\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tobj = obj && obj.id ? obj : this.get_node(obj);\n\t\t\tif(!obj || obj.id === $.jstree.root) { return false; }\n\n\t\t\told_par = (obj.parent || $.jstree.root).toString();\n\t\t\tnew_par = (!pos.toString().match(/^(before|after)$/) || par.id === $.jstree.root) ? par : this.get_node(par.parent);\n\t\t\told_ins = origin ? origin : (this._model.data[obj.id] ? this : $.jstree.reference(obj.id));\n\t\t\tis_multi = !old_ins || !old_ins._id || (this._id !== old_ins._id);\n\n\t\t\tif(old_ins && old_ins._id) {\n\t\t\t\tobj = old_ins._model.data[obj.id];\n\t\t\t}\n\n\t\t\tif(par.id === $.jstree.root) {\n\t\t\t\tif(pos === \"before\") { pos = \"first\"; }\n\t\t\t\tif(pos === \"after\") { pos = \"last\"; }\n\t\t\t}\n\t\t\tswitch(pos) {\n\t\t\t\tcase \"before\":\n\t\t\t\t\tpos = $.inArray(par.id, new_par.children);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"after\" :\n\t\t\t\t\tpos = $.inArray(par.id, new_par.children) + 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"inside\":\n\t\t\t\tcase \"first\":\n\t\t\t\t\tpos = 0;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"last\":\n\t\t\t\t\tpos = new_par.children.length;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tif(!pos) { pos = 0; }\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(pos > new_par.children.length) { pos = new_par.children.length; }\n\t\t\tif(!this.check(\"copy_node\", obj, new_par, pos, { 'core' : true, 'origin' : origin, 'is_multi' : (old_ins && old_ins._id && old_ins._id !== this._id), 'is_foreign' : (!old_ins || !old_ins._id) })) {\n\t\t\t\tthis.settings.core.error.call(this, this._data.core.last_error);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tnode = old_ins ? old_ins.get_json(obj, { no_id : true, no_data : true, no_state : true }) : obj;\n\t\t\tif(!node) { return false; }\n\t\t\tif(node.id === true) { delete node.id; }\n\t\t\tnode = this._parse_model_from_json(node, new_par.id, new_par.parents.concat());\n\t\t\tif(!node) { return false; }\n\t\t\ttmp = this.get_node(node);\n\t\t\tif(obj && obj.state && obj.state.loaded === false) { tmp.state.loaded = false; }\n\t\t\tdpc = [];\n\t\t\tdpc.push(node);\n\t\t\tdpc = dpc.concat(tmp.children_d);\n\t\t\tthis.trigger('model', { \"nodes\" : dpc, \"parent\" : new_par.id });\n\n\t\t\t// insert into new parent and up\n\t\t\tfor(i = 0, j = new_par.parents.length; i < j; i++) {\n\t\t\t\tthis._model.data[new_par.parents[i]].children_d = this._model.data[new_par.parents[i]].children_d.concat(dpc);\n\t\t\t}\n\t\t\tdpc = [];\n\t\t\tfor(i = 0, j = new_par.children.length; i < j; i++) {\n\t\t\t\tdpc[i >= pos ? i+1 : i] = new_par.children[i];\n\t\t\t}\n\t\t\tdpc[pos] = tmp.id;\n\t\t\tnew_par.children = dpc;\n\t\t\tnew_par.children_d.push(tmp.id);\n\t\t\tnew_par.children_d = new_par.children_d.concat(tmp.children_d);\n\n\t\t\tif(new_par.id === $.jstree.root) {\n\t\t\t\tthis._model.force_full_redraw = true;\n\t\t\t}\n\t\t\tif(!this._model.force_full_redraw) {\n\t\t\t\tthis._node_changed(new_par.id);\n\t\t\t}\n\t\t\tif(!skip_redraw) {\n\t\t\t\tthis.redraw(new_par.id === $.jstree.root);\n\t\t\t}\n\t\t\tif(callback) { callback.call(this, tmp, new_par, pos); }\n\t\t\t/**\n\t\t\t * triggered when a node is copied\n\t\t\t * @event\n\t\t\t * @name copy_node.jstree\n\t\t\t * @param {Object} node the copied node\n\t\t\t * @param {Object} original the original node\n\t\t\t * @param {String} parent the parent's ID\n\t\t\t * @param {Number} position the position of the node among the parent's children\n\t\t\t * @param {String} old_parent the old parent of the node\n\t\t\t * @param {Number} old_position the position of the original node\n\t\t\t * @param {Boolean} is_multi do the node and new parent belong to different instances\n\t\t\t * @param {jsTree} old_instance the instance the node came from\n\t\t\t * @param {jsTree} new_instance the instance of the new parent\n\t\t\t */\n\t\t\tthis.trigger('copy_node', { \"node\" : tmp, \"original\" : obj, \"parent\" : new_par.id, \"position\" : pos, \"old_parent\" : old_par, \"old_position\" : old_ins && old_ins._id && old_par && old_ins._model.data[old_par] && old_ins._model.data[old_par].children ? $.inArray(obj.id, old_ins._model.data[old_par].children) : -1,'is_multi' : (old_ins && old_ins._id && old_ins._id !== this._id), 'is_foreign' : (!old_ins || !old_ins._id), 'old_instance' : old_ins, 'new_instance' : this });\n\t\t\treturn tmp.id;\n\t\t},\n\t\t/**\n\t\t * cut a node (a later call to `paste(obj)` would move the node)\n\t\t * @name cut(obj)\n\t\t * @param  {mixed} obj multiple objects can be passed using an array\n\t\t * @trigger cut.jstree\n\t\t */\n\t\tcut : function (obj) {\n\t\t\tif(!obj) { obj = this._data.core.selected.concat(); }\n\t\t\tif(!$.isArray(obj)) { obj = [obj]; }\n\t\t\tif(!obj.length) { return false; }\n\t\t\tvar tmp = [], o, t1, t2;\n\t\t\tfor(t1 = 0, t2 = obj.length; t1 < t2; t1++) {\n\t\t\t\to = this.get_node(obj[t1]);\n\t\t\t\tif(o && o.id && o.id !== $.jstree.root) { tmp.push(o); }\n\t\t\t}\n\t\t\tif(!tmp.length) { return false; }\n\t\t\tccp_node = tmp;\n\t\t\tccp_inst = this;\n\t\t\tccp_mode = 'move_node';\n\t\t\t/**\n\t\t\t * triggered when nodes are added to the buffer for moving\n\t\t\t * @event\n\t\t\t * @name cut.jstree\n\t\t\t * @param {Array} node\n\t\t\t */\n\t\t\tthis.trigger('cut', { \"node\" : obj });\n\t\t},\n\t\t/**\n\t\t * copy a node (a later call to `paste(obj)` would copy the node)\n\t\t * @name copy(obj)\n\t\t * @param  {mixed} obj multiple objects can be passed using an array\n\t\t * @trigger copy.jstree\n\t\t */\n\t\tcopy : function (obj) {\n\t\t\tif(!obj) { obj = this._data.core.selected.concat(); }\n\t\t\tif(!$.isArray(obj)) { obj = [obj]; }\n\t\t\tif(!obj.length) { return false; }\n\t\t\tvar tmp = [], o, t1, t2;\n\t\t\tfor(t1 = 0, t2 = obj.length; t1 < t2; t1++) {\n\t\t\t\to = this.get_node(obj[t1]);\n\t\t\t\tif(o && o.id && o.id !== $.jstree.root) { tmp.push(o); }\n\t\t\t}\n\t\t\tif(!tmp.length) { return false; }\n\t\t\tccp_node = tmp;\n\t\t\tccp_inst = this;\n\t\t\tccp_mode = 'copy_node';\n\t\t\t/**\n\t\t\t * triggered when nodes are added to the buffer for copying\n\t\t\t * @event\n\t\t\t * @name copy.jstree\n\t\t\t * @param {Array} node\n\t\t\t */\n\t\t\tthis.trigger('copy', { \"node\" : obj });\n\t\t},\n\t\t/**\n\t\t * get the current buffer (any nodes that are waiting for a paste operation)\n\t\t * @name get_buffer()\n\t\t * @return {Object} an object consisting of `mode` (\"copy_node\" or \"move_node\"), `node` (an array of objects) and `inst` (the instance)\n\t\t */\n\t\tget_buffer : function () {\n\t\t\treturn { 'mode' : ccp_mode, 'node' : ccp_node, 'inst' : ccp_inst };\n\t\t},\n\t\t/**\n\t\t * check if there is something in the buffer to paste\n\t\t * @name can_paste()\n\t\t * @return {Boolean}\n\t\t */\n\t\tcan_paste : function () {\n\t\t\treturn ccp_mode !== false && ccp_node !== false; // && ccp_inst._model.data[ccp_node];\n\t\t},\n\t\t/**\n\t\t * copy or move the previously cut or copied nodes to a new parent\n\t\t * @name paste(obj [, pos])\n\t\t * @param  {mixed} obj the new parent\n\t\t * @param  {mixed} pos the position to insert at (besides integer, \"first\" and \"last\" are supported), defaults to integer `0`\n\t\t * @trigger paste.jstree\n\t\t */\n\t\tpaste : function (obj, pos) {\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(!obj || !ccp_mode || !ccp_mode.match(/^(copy_node|move_node)$/) || !ccp_node) { return false; }\n\t\t\tif(this[ccp_mode](ccp_node, obj, pos, false, false, false, ccp_inst)) {\n\t\t\t\t/**\n\t\t\t\t * triggered when paste is invoked\n\t\t\t\t * @event\n\t\t\t\t * @name paste.jstree\n\t\t\t\t * @param {String} parent the ID of the receiving node\n\t\t\t\t * @param {Array} node the nodes in the buffer\n\t\t\t\t * @param {String} mode the performed operation - \"copy_node\" or \"move_node\"\n\t\t\t\t */\n\t\t\t\tthis.trigger('paste', { \"parent\" : obj.id, \"node\" : ccp_node, \"mode\" : ccp_mode });\n\t\t\t}\n\t\t\tccp_node = false;\n\t\t\tccp_mode = false;\n\t\t\tccp_inst = false;\n\t\t},\n\t\t/**\n\t\t * clear the buffer of previously copied or cut nodes\n\t\t * @name clear_buffer()\n\t\t * @trigger clear_buffer.jstree\n\t\t */\n\t\tclear_buffer : function () {\n\t\t\tccp_node = false;\n\t\t\tccp_mode = false;\n\t\t\tccp_inst = false;\n\t\t\t/**\n\t\t\t * triggered when the copy / cut buffer is cleared\n\t\t\t * @event\n\t\t\t * @name clear_buffer.jstree\n\t\t\t */\n\t\t\tthis.trigger('clear_buffer');\n\t\t},\n\t\t/**\n\t\t * put a node in edit mode (input field to rename the node)\n\t\t * @name edit(obj [, default_text, callback])\n\t\t * @param  {mixed} obj\n\t\t * @param  {String} default_text the text to populate the input with (if omitted or set to a non-string value the node's text value is used)\n\t\t * @param  {Function} callback a function to be called once the text box is blurred, it is called in the instance's scope and receives the node, a status parameter (true if the rename is successful, false otherwise) and a boolean indicating if the user cancelled the edit. You can access the node's title using .text\n\t\t */\n\t\tedit : function (obj, default_text, callback) {\n\t\t\tvar rtl, w, a, s, t, h1, h2, fn, tmp, cancel = false;\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(!obj) { return false; }\n\t\t\tif(!this.check(\"edit\", obj, this.get_parent(obj))) {\n\t\t\t\tthis.settings.core.error.call(this, this._data.core.last_error);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\ttmp = obj;\n\t\t\tdefault_text = typeof default_text === 'string' ? default_text : obj.text;\n\t\t\tthis.set_text(obj, \"\");\n\t\t\tobj = this._open_to(obj);\n\t\t\ttmp.text = default_text;\n\n\t\t\trtl = this._data.core.rtl;\n\t\t\tw  = this.element.width();\n\t\t\tthis._data.core.focused = tmp.id;\n\t\t\ta  = obj.children('.jstree-anchor').focus();\n\t\t\ts  = $('<span>');\n\t\t\t/*!\n\t\t\toi = obj.children(\"i:visible\"),\n\t\t\tai = a.children(\"i:visible\"),\n\t\t\tw1 = oi.width() * oi.length,\n\t\t\tw2 = ai.width() * ai.length,\n\t\t\t*/\n\t\t\tt  = default_text;\n\t\t\th1 = $(\"<\"+\"div />\", { css : { \"position\" : \"absolute\", \"top\" : \"-200px\", \"left\" : (rtl ? \"0px\" : \"-1000px\"), \"visibility\" : \"hidden\" } }).appendTo(document.body);\n\t\t\th2 = $(\"<\"+\"input />\", {\n\t\t\t\t\t\t\"value\" : t,\n\t\t\t\t\t\t\"class\" : \"jstree-rename-input\",\n\t\t\t\t\t\t// \"size\" : t.length,\n\t\t\t\t\t\t\"css\" : {\n\t\t\t\t\t\t\t\"padding\" : \"0\",\n\t\t\t\t\t\t\t\"border\" : \"1px solid silver\",\n\t\t\t\t\t\t\t\"box-sizing\" : \"border-box\",\n\t\t\t\t\t\t\t\"display\" : \"inline-block\",\n\t\t\t\t\t\t\t\"height\" : (this._data.core.li_height) + \"px\",\n\t\t\t\t\t\t\t\"lineHeight\" : (this._data.core.li_height) + \"px\",\n\t\t\t\t\t\t\t\"width\" : \"150px\" // will be set a bit further down\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"blur\" : $.proxy(function (e) {\n\t\t\t\t\t\t\te.stopImmediatePropagation();\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\tvar i = s.children(\".jstree-rename-input\"),\n\t\t\t\t\t\t\t\tv = i.val(),\n\t\t\t\t\t\t\t\tf = this.settings.core.force_text,\n\t\t\t\t\t\t\t\tnv;\n\t\t\t\t\t\t\tif(v === \"\") { v = t; }\n\t\t\t\t\t\t\th1.remove();\n\t\t\t\t\t\t\ts.replaceWith(a);\n\t\t\t\t\t\t\ts.remove();\n\t\t\t\t\t\t\tt = f ? t : $('<div></div>').append($.parseHTML(t)).html();\n\t\t\t\t\t\t\tobj = this.get_node(obj);\n\t\t\t\t\t\t\tthis.set_text(obj, t);\n\t\t\t\t\t\t\tnv = !!this.rename_node(obj, f ? $('<div></div>').text(v).text() : $('<div></div>').append($.parseHTML(v)).html());\n\t\t\t\t\t\t\tif(!nv) {\n\t\t\t\t\t\t\t\tthis.set_text(obj, t); // move this up? and fix #483\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthis._data.core.focused = tmp.id;\n\t\t\t\t\t\t\tsetTimeout($.proxy(function () {\n\t\t\t\t\t\t\t\tvar node = this.get_node(tmp.id, true);\n\t\t\t\t\t\t\t\tif(node.length) {\n\t\t\t\t\t\t\t\t\tthis._data.core.focused = tmp.id;\n\t\t\t\t\t\t\t\t\tnode.children('.jstree-anchor').focus();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}, this), 0);\n\t\t\t\t\t\t\tif(callback) {\n\t\t\t\t\t\t\t\tcallback.call(this, tmp, nv, cancel);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\th2 = null;\n\t\t\t\t\t\t}, this),\n\t\t\t\t\t\t\"keydown\" : function (e) {\n\t\t\t\t\t\t\tvar key = e.which;\n\t\t\t\t\t\t\tif(key === 27) {\n\t\t\t\t\t\t\t\tcancel = true;\n\t\t\t\t\t\t\t\tthis.value = t;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(key === 27 || key === 13 || key === 37 || key === 38 || key === 39 || key === 40 || key === 32) {\n\t\t\t\t\t\t\t\te.stopImmediatePropagation();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(key === 27 || key === 13) {\n\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\tthis.blur();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"click\" : function (e) { e.stopImmediatePropagation(); },\n\t\t\t\t\t\t\"mousedown\" : function (e) { e.stopImmediatePropagation(); },\n\t\t\t\t\t\t\"keyup\" : function (e) {\n\t\t\t\t\t\t\th2.width(Math.min(h1.text(\"pW\" + this.value).width(),w));\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"keypress\" : function(e) {\n\t\t\t\t\t\t\tif(e.which === 13) { return false; }\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\tfn = {\n\t\t\t\t\t\tfontFamily\t\t: a.css('fontFamily')\t\t|| '',\n\t\t\t\t\t\tfontSize\t\t: a.css('fontSize')\t\t\t|| '',\n\t\t\t\t\t\tfontWeight\t\t: a.css('fontWeight')\t\t|| '',\n\t\t\t\t\t\tfontStyle\t\t: a.css('fontStyle')\t\t|| '',\n\t\t\t\t\t\tfontStretch\t\t: a.css('fontStretch')\t\t|| '',\n\t\t\t\t\t\tfontVariant\t\t: a.css('fontVariant')\t\t|| '',\n\t\t\t\t\t\tletterSpacing\t: a.css('letterSpacing')\t|| '',\n\t\t\t\t\t\twordSpacing\t\t: a.css('wordSpacing')\t\t|| ''\n\t\t\t\t};\n\t\t\ts.attr('class', a.attr('class')).append(a.contents().clone()).append(h2);\n\t\t\ta.replaceWith(s);\n\t\t\th1.css(fn);\n\t\t\th2.css(fn).width(Math.min(h1.text(\"pW\" + h2[0].value).width(),w))[0].select();\n\t\t\t$(document).one('mousedown.jstree touchstart.jstree dnd_start.vakata', function (e) {\n\t\t\t\tif (h2 && e.target !== h2) {\n\t\t\t\t\t$(h2).blur();\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\n\n\t\t/**\n\t\t * changes the theme\n\t\t * @name set_theme(theme_name [, theme_url])\n\t\t * @param {String} theme_name the name of the new theme to apply\n\t\t * @param {mixed} theme_url  the location of the CSS file for this theme. Omit or set to `false` if you manually included the file. Set to `true` to autoload from the `core.themes.dir` directory.\n\t\t * @trigger set_theme.jstree\n\t\t */\n\t\tset_theme : function (theme_name, theme_url) {\n\t\t\tif(!theme_name) { return false; }\n\t\t\tif(theme_url === true) {\n\t\t\t\tvar dir = this.settings.core.themes.dir;\n\t\t\t\tif(!dir) { dir = $.jstree.path + '/themes'; }\n\t\t\t\ttheme_url = dir + '/' + theme_name + '/style.css';\n\t\t\t}\n\t\t\tif(theme_url && $.inArray(theme_url, themes_loaded) === -1) {\n\t\t\t\t$('head').append('<'+'link rel=\"stylesheet\" href=\"' + theme_url + '\" type=\"text/css\" />');\n\t\t\t\tthemes_loaded.push(theme_url);\n\t\t\t}\n\t\t\tif(this._data.core.themes.name) {\n\t\t\t\tthis.element.removeClass('jstree-' + this._data.core.themes.name);\n\t\t\t}\n\t\t\tthis._data.core.themes.name = theme_name;\n\t\t\tthis.element.addClass('jstree-' + theme_name);\n\t\t\tthis.element[this.settings.core.themes.responsive ? 'addClass' : 'removeClass' ]('jstree-' + theme_name + '-responsive');\n\t\t\t/**\n\t\t\t * triggered when a theme is set\n\t\t\t * @event\n\t\t\t * @name set_theme.jstree\n\t\t\t * @param {String} theme the new theme\n\t\t\t */\n\t\t\tthis.trigger('set_theme', { 'theme' : theme_name });\n\t\t},\n\t\t/**\n\t\t * gets the name of the currently applied theme name\n\t\t * @name get_theme()\n\t\t * @return {String}\n\t\t */\n\t\tget_theme : function () { return this._data.core.themes.name; },\n\t\t/**\n\t\t * changes the theme variant (if the theme has variants)\n\t\t * @name set_theme_variant(variant_name)\n\t\t * @param {String|Boolean} variant_name the variant to apply (if `false` is used the current variant is removed)\n\t\t */\n\t\tset_theme_variant : function (variant_name) {\n\t\t\tif(this._data.core.themes.variant) {\n\t\t\t\tthis.element.removeClass('jstree-' + this._data.core.themes.name + '-' + this._data.core.themes.variant);\n\t\t\t}\n\t\t\tthis._data.core.themes.variant = variant_name;\n\t\t\tif(variant_name) {\n\t\t\t\tthis.element.addClass('jstree-' + this._data.core.themes.name + '-' + this._data.core.themes.variant);\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * gets the name of the currently applied theme variant\n\t\t * @name get_theme()\n\t\t * @return {String}\n\t\t */\n\t\tget_theme_variant : function () { return this._data.core.themes.variant; },\n\t\t/**\n\t\t * shows a striped background on the container (if the theme supports it)\n\t\t * @name show_stripes()\n\t\t */\n\t\tshow_stripes : function () {\n\t\t\tthis._data.core.themes.stripes = true;\n\t\t\tthis.get_container_ul().addClass(\"jstree-striped\");\n\t\t\t/**\n\t\t\t * triggered when stripes are shown\n\t\t\t * @event\n\t\t\t * @name show_stripes.jstree\n\t\t\t */\n\t\t\tthis.trigger('show_stripes');\n\t\t},\n\t\t/**\n\t\t * hides the striped background on the container\n\t\t * @name hide_stripes()\n\t\t */\n\t\thide_stripes : function () {\n\t\t\tthis._data.core.themes.stripes = false;\n\t\t\tthis.get_container_ul().removeClass(\"jstree-striped\");\n\t\t\t/**\n\t\t\t * triggered when stripes are hidden\n\t\t\t * @event\n\t\t\t * @name hide_stripes.jstree\n\t\t\t */\n\t\t\tthis.trigger('hide_stripes');\n\t\t},\n\t\t/**\n\t\t * toggles the striped background on the container\n\t\t * @name toggle_stripes()\n\t\t */\n\t\ttoggle_stripes : function () { if(this._data.core.themes.stripes) { this.hide_stripes(); } else { this.show_stripes(); } },\n\t\t/**\n\t\t * shows the connecting dots (if the theme supports it)\n\t\t * @name show_dots()\n\t\t */\n\t\tshow_dots : function () {\n\t\t\tthis._data.core.themes.dots = true;\n\t\t\tthis.get_container_ul().removeClass(\"jstree-no-dots\");\n\t\t\t/**\n\t\t\t * triggered when dots are shown\n\t\t\t * @event\n\t\t\t * @name show_dots.jstree\n\t\t\t */\n\t\t\tthis.trigger('show_dots');\n\t\t},\n\t\t/**\n\t\t * hides the connecting dots\n\t\t * @name hide_dots()\n\t\t */\n\t\thide_dots : function () {\n\t\t\tthis._data.core.themes.dots = false;\n\t\t\tthis.get_container_ul().addClass(\"jstree-no-dots\");\n\t\t\t/**\n\t\t\t * triggered when dots are hidden\n\t\t\t * @event\n\t\t\t * @name hide_dots.jstree\n\t\t\t */\n\t\t\tthis.trigger('hide_dots');\n\t\t},\n\t\t/**\n\t\t * toggles the connecting dots\n\t\t * @name toggle_dots()\n\t\t */\n\t\ttoggle_dots : function () { if(this._data.core.themes.dots) { this.hide_dots(); } else { this.show_dots(); } },\n\t\t/**\n\t\t * show the node icons\n\t\t * @name show_icons()\n\t\t */\n\t\tshow_icons : function () {\n\t\t\tthis._data.core.themes.icons = true;\n\t\t\tthis.get_container_ul().removeClass(\"jstree-no-icons\");\n\t\t\t/**\n\t\t\t * triggered when icons are shown\n\t\t\t * @event\n\t\t\t * @name show_icons.jstree\n\t\t\t */\n\t\t\tthis.trigger('show_icons');\n\t\t},\n\t\t/**\n\t\t * hide the node icons\n\t\t * @name hide_icons()\n\t\t */\n\t\thide_icons : function () {\n\t\t\tthis._data.core.themes.icons = false;\n\t\t\tthis.get_container_ul().addClass(\"jstree-no-icons\");\n\t\t\t/**\n\t\t\t * triggered when icons are hidden\n\t\t\t * @event\n\t\t\t * @name hide_icons.jstree\n\t\t\t */\n\t\t\tthis.trigger('hide_icons');\n\t\t},\n\t\t/**\n\t\t * toggle the node icons\n\t\t * @name toggle_icons()\n\t\t */\n\t\ttoggle_icons : function () { if(this._data.core.themes.icons) { this.hide_icons(); } else { this.show_icons(); } },\n\t\t/**\n\t\t * show the node ellipsis\n\t\t * @name show_icons()\n\t\t */\n\t\tshow_ellipsis : function () {\n\t\t\tthis._data.core.themes.ellipsis = true;\n\t\t\tthis.get_container_ul().addClass(\"jstree-ellipsis\");\n\t\t\t/**\n\t\t\t * triggered when ellisis is shown\n\t\t\t * @event\n\t\t\t * @name show_ellipsis.jstree\n\t\t\t */\n\t\t\tthis.trigger('show_ellipsis');\n\t\t},\n\t\t/**\n\t\t * hide the node ellipsis\n\t\t * @name hide_ellipsis()\n\t\t */\n\t\thide_ellipsis : function () {\n\t\t\tthis._data.core.themes.ellipsis = false;\n\t\t\tthis.get_container_ul().removeClass(\"jstree-ellipsis\");\n\t\t\t/**\n\t\t\t * triggered when ellisis is hidden\n\t\t\t * @event\n\t\t\t * @name hide_ellipsis.jstree\n\t\t\t */\n\t\t\tthis.trigger('hide_ellipsis');\n\t\t},\n\t\t/**\n\t\t * toggle the node ellipsis\n\t\t * @name toggle_icons()\n\t\t */\n\t\ttoggle_ellipsis : function () { if(this._data.core.themes.ellipsis) { this.hide_ellipsis(); } else { this.show_ellipsis(); } },\n\t\t/**\n\t\t * set the node icon for a node\n\t\t * @name set_icon(obj, icon)\n\t\t * @param {mixed} obj\n\t\t * @param {String} icon the new icon - can be a path to an icon or a className, if using an image that is in the current directory use a `./` prefix, otherwise it will be detected as a class\n\t\t */\n\t\tset_icon : function (obj, icon) {\n\t\t\tvar t1, t2, dom, old;\n\t\t\tif($.isArray(obj)) {\n\t\t\t\tobj = obj.slice();\n\t\t\t\tfor(t1 = 0, t2 = obj.length; t1 < t2; t1++) {\n\t\t\t\t\tthis.set_icon(obj[t1], icon);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(!obj || obj.id === $.jstree.root) { return false; }\n\t\t\told = obj.icon;\n\t\t\tobj.icon = icon === true || icon === null || icon === undefined || icon === '' ? true : icon;\n\t\t\tdom = this.get_node(obj, true).children(\".jstree-anchor\").children(\".jstree-themeicon\");\n\t\t\tif(icon === false) {\n\t\t\t\tdom.removeClass('jstree-themeicon-custom ' + old).css(\"background\",\"\").removeAttr(\"rel\");\n\t\t\t\tthis.hide_icon(obj);\n\t\t\t}\n\t\t\telse if(icon === true || icon === null || icon === undefined || icon === '') {\n\t\t\t\tdom.removeClass('jstree-themeicon-custom ' + old).css(\"background\",\"\").removeAttr(\"rel\");\n\t\t\t\tif(old === false) { this.show_icon(obj); }\n\t\t\t}\n\t\t\telse if(icon.indexOf(\"/\") === -1 && icon.indexOf(\".\") === -1) {\n\t\t\t\tdom.removeClass(old).css(\"background\",\"\");\n\t\t\t\tdom.addClass(icon + ' jstree-themeicon-custom').attr(\"rel\",icon);\n\t\t\t\tif(old === false) { this.show_icon(obj); }\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdom.removeClass(old).css(\"background\",\"\");\n\t\t\t\tdom.addClass('jstree-themeicon-custom').css(\"background\", \"url('\" + icon + \"') center center no-repeat\").attr(\"rel\",icon);\n\t\t\t\tif(old === false) { this.show_icon(obj); }\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\t\t/**\n\t\t * get the node icon for a node\n\t\t * @name get_icon(obj)\n\t\t * @param {mixed} obj\n\t\t * @return {String}\n\t\t */\n\t\tget_icon : function (obj) {\n\t\t\tobj = this.get_node(obj);\n\t\t\treturn (!obj || obj.id === $.jstree.root) ? false : obj.icon;\n\t\t},\n\t\t/**\n\t\t * hide the icon on an individual node\n\t\t * @name hide_icon(obj)\n\t\t * @param {mixed} obj\n\t\t */\n\t\thide_icon : function (obj) {\n\t\t\tvar t1, t2;\n\t\t\tif($.isArray(obj)) {\n\t\t\t\tobj = obj.slice();\n\t\t\t\tfor(t1 = 0, t2 = obj.length; t1 < t2; t1++) {\n\t\t\t\t\tthis.hide_icon(obj[t1]);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(!obj || obj === $.jstree.root) { return false; }\n\t\t\tobj.icon = false;\n\t\t\tthis.get_node(obj, true).children(\".jstree-anchor\").children(\".jstree-themeicon\").addClass('jstree-themeicon-hidden');\n\t\t\treturn true;\n\t\t},\n\t\t/**\n\t\t * show the icon on an individual node\n\t\t * @name show_icon(obj)\n\t\t * @param {mixed} obj\n\t\t */\n\t\tshow_icon : function (obj) {\n\t\t\tvar t1, t2, dom;\n\t\t\tif($.isArray(obj)) {\n\t\t\t\tobj = obj.slice();\n\t\t\t\tfor(t1 = 0, t2 = obj.length; t1 < t2; t1++) {\n\t\t\t\t\tthis.show_icon(obj[t1]);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(!obj || obj === $.jstree.root) { return false; }\n\t\t\tdom = this.get_node(obj, true);\n\t\t\tobj.icon = dom.length ? dom.children(\".jstree-anchor\").children(\".jstree-themeicon\").attr('rel') : true;\n\t\t\tif(!obj.icon) { obj.icon = true; }\n\t\t\tdom.children(\".jstree-anchor\").children(\".jstree-themeicon\").removeClass('jstree-themeicon-hidden');\n\t\t\treturn true;\n\t\t}\n\t};\n\n\t// helpers\n\t$.vakata = {};\n\t// collect attributes\n\t$.vakata.attributes = function(node, with_values) {\n\t\tnode = $(node)[0];\n\t\tvar attr = with_values ? {} : [];\n\t\tif(node && node.attributes) {\n\t\t\t$.each(node.attributes, function (i, v) {\n\t\t\t\tif($.inArray(v.name.toLowerCase(),['style','contenteditable','hasfocus','tabindex']) !== -1) { return; }\n\t\t\t\tif(v.value !== null && $.trim(v.value) !== '') {\n\t\t\t\t\tif(with_values) { attr[v.name] = v.value; }\n\t\t\t\t\telse { attr.push(v.name); }\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn attr;\n\t};\n\t$.vakata.array_unique = function(array) {\n\t\tvar a = [], i, j, l, o = {};\n\t\tfor(i = 0, l = array.length; i < l; i++) {\n\t\t\tif(o[array[i]] === undefined) {\n\t\t\t\ta.push(array[i]);\n\t\t\t\to[array[i]] = true;\n\t\t\t}\n\t\t}\n\t\treturn a;\n\t};\n\t// remove item from array\n\t$.vakata.array_remove = function(array, from) {\n\t\tarray.splice(from, 1);\n\t\treturn array;\n\t\t//var rest = array.slice((to || from) + 1 || array.length);\n\t\t//array.length = from < 0 ? array.length + from : from;\n\t\t//array.push.apply(array, rest);\n\t\t//return array;\n\t};\n\t// remove item from array\n\t$.vakata.array_remove_item = function(array, item) {\n\t\tvar tmp = $.inArray(item, array);\n\t\treturn tmp !== -1 ? $.vakata.array_remove(array, tmp) : array;\n\t};\n\t$.vakata.array_filter = function(c,a,b,d,e) {\n\t\tif (c.filter) {\n\t\t\treturn c.filter(a, b);\n\t\t}\n\t\td=[];\n\t\tfor (e in c) {\n\t\t\tif (~~e+''===e+'' && e>=0 && a.call(b,c[e],+e,c)) {\n\t\t\t\td.push(c[e]);\n\t\t\t}\n\t\t}\n\t\treturn d;\n\t};\n\n\n/**\n * ### Changed plugin\n *\n * This plugin adds more information to the `changed.jstree` event. The new data is contained in the `changed` event data property, and contains a lists of `selected` and `deselected` nodes.\n */\n\n\t$.jstree.plugins.changed = function (options, parent) {\n\t\tvar last = [];\n\t\tthis.trigger = function (ev, data) {\n\t\t\tvar i, j;\n\t\t\tif(!data) {\n\t\t\t\tdata = {};\n\t\t\t}\n\t\t\tif(ev.replace('.jstree','') === 'changed') {\n\t\t\t\tdata.changed = { selected : [], deselected : [] };\n\t\t\t\tvar tmp = {};\n\t\t\t\tfor(i = 0, j = last.length; i < j; i++) {\n\t\t\t\t\ttmp[last[i]] = 1;\n\t\t\t\t}\n\t\t\t\tfor(i = 0, j = data.selected.length; i < j; i++) {\n\t\t\t\t\tif(!tmp[data.selected[i]]) {\n\t\t\t\t\t\tdata.changed.selected.push(data.selected[i]);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\ttmp[data.selected[i]] = 2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor(i = 0, j = last.length; i < j; i++) {\n\t\t\t\t\tif(tmp[last[i]] === 1) {\n\t\t\t\t\t\tdata.changed.deselected.push(last[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlast = data.selected.slice();\n\t\t\t}\n\t\t\t/**\n\t\t\t * triggered when selection changes (the \"changed\" plugin enhances the original event with more data)\n\t\t\t * @event\n\t\t\t * @name changed.jstree\n\t\t\t * @param {Object} node\n\t\t\t * @param {Object} action the action that caused the selection to change\n\t\t\t * @param {Array} selected the current selection\n\t\t\t * @param {Object} changed an object containing two properties `selected` and `deselected` - both arrays of node IDs, which were selected or deselected since the last changed event\n\t\t\t * @param {Object} event the event (if any) that triggered this changed event\n\t\t\t * @plugin changed\n\t\t\t */\n\t\t\tparent.trigger.call(this, ev, data);\n\t\t};\n\t\tthis.refresh = function (skip_loading, forget_state) {\n\t\t\tlast = [];\n\t\t\treturn parent.refresh.apply(this, arguments);\n\t\t};\n\t};\n\n/**\n * ### Checkbox plugin\n *\n * This plugin renders checkbox icons in front of each node, making multiple selection much easier.\n * It also supports tri-state behavior, meaning that if a node has a few of its children checked it will be rendered as undetermined, and state will be propagated up.\n */\n\n\tvar _i = document.createElement('I');\n\t_i.className = 'jstree-icon jstree-checkbox';\n\t_i.setAttribute('role', 'presentation');\n\t/**\n\t * stores all defaults for the checkbox plugin\n\t * @name $.jstree.defaults.checkbox\n\t * @plugin checkbox\n\t */\n\t$.jstree.defaults.checkbox = {\n\t\t/**\n\t\t * a boolean indicating if checkboxes should be visible (can be changed at a later time using `show_checkboxes()` and `hide_checkboxes`). Defaults to `true`.\n\t\t * @name $.jstree.defaults.checkbox.visible\n\t\t * @plugin checkbox\n\t\t */\n\t\tvisible\t\t\t\t: true,\n\t\t/**\n\t\t * a boolean indicating if checkboxes should cascade down and have an undetermined state. Defaults to `true`.\n\t\t * @name $.jstree.defaults.checkbox.three_state\n\t\t * @plugin checkbox\n\t\t */\n\t\tthree_state\t\t\t: true,\n\t\t/**\n\t\t * a boolean indicating if clicking anywhere on the node should act as clicking on the checkbox. Defaults to `true`.\n\t\t * @name $.jstree.defaults.checkbox.whole_node\n\t\t * @plugin checkbox\n\t\t */\n\t\twhole_node\t\t\t: true,\n\t\t/**\n\t\t * a boolean indicating if the selected style of a node should be kept, or removed. Defaults to `true`.\n\t\t * @name $.jstree.defaults.checkbox.keep_selected_style\n\t\t * @plugin checkbox\n\t\t */\n\t\tkeep_selected_style\t: true,\n\t\t/**\n\t\t * This setting controls how cascading and undetermined nodes are applied.\n\t\t * If 'up' is in the string - cascading up is enabled, if 'down' is in the string - cascading down is enabled, if 'undetermined' is in the string - undetermined nodes will be used.\n\t\t * If `three_state` is set to `true` this setting is automatically set to 'up+down+undetermined'. Defaults to ''.\n\t\t * @name $.jstree.defaults.checkbox.cascade\n\t\t * @plugin checkbox\n\t\t */\n\t\tcascade\t\t\t\t: '',\n\t\t/**\n\t\t * This setting controls if checkbox are bound to the general tree selection or to an internal array maintained by the checkbox plugin. Defaults to `true`, only set to `false` if you know exactly what you are doing.\n\t\t * @name $.jstree.defaults.checkbox.tie_selection\n\t\t * @plugin checkbox\n\t\t */\n\t\ttie_selection\t\t: true,\n\n\t\t/**\n\t\t * This setting controls if cascading down affects disabled checkboxes\n\t\t * @name $.jstree.defaults.checkbox.cascade_to_disabled\n\t\t * @plugin checkbox\n\t\t */\n\t\tcascade_to_disabled : true,\n\n\t\t/**\n\t\t * This setting controls if cascading down affects hidden checkboxes\n\t\t * @name $.jstree.defaults.checkbox.cascade_to_hidden\n\t\t * @plugin checkbox\n\t\t */\n\t\tcascade_to_hidden : true\n\t};\n\t$.jstree.plugins.checkbox = function (options, parent) {\n\t\tthis.bind = function () {\n\t\t\tparent.bind.call(this);\n\t\t\tthis._data.checkbox.uto = false;\n\t\t\tthis._data.checkbox.selected = [];\n\t\t\tif(this.settings.checkbox.three_state) {\n\t\t\t\tthis.settings.checkbox.cascade = 'up+down+undetermined';\n\t\t\t}\n\t\t\tthis.element\n\t\t\t\t.on(\"init.jstree\", $.proxy(function () {\n\t\t\t\t\t\tthis._data.checkbox.visible = this.settings.checkbox.visible;\n\t\t\t\t\t\tif(!this.settings.checkbox.keep_selected_style) {\n\t\t\t\t\t\t\tthis.element.addClass('jstree-checkbox-no-clicked');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(this.settings.checkbox.tie_selection) {\n\t\t\t\t\t\t\tthis.element.addClass('jstree-checkbox-selection');\n\t\t\t\t\t\t}\n\t\t\t\t\t}, this))\n\t\t\t\t.on(\"loading.jstree\", $.proxy(function () {\n\t\t\t\t\t\tthis[ this._data.checkbox.visible ? 'show_checkboxes' : 'hide_checkboxes' ]();\n\t\t\t\t\t}, this));\n\t\t\tif(this.settings.checkbox.cascade.indexOf('undetermined') !== -1) {\n\t\t\t\tthis.element\n\t\t\t\t\t.on('changed.jstree uncheck_node.jstree check_node.jstree uncheck_all.jstree check_all.jstree move_node.jstree copy_node.jstree redraw.jstree open_node.jstree', $.proxy(function () {\n\t\t\t\t\t\t\t// only if undetermined is in setting\n\t\t\t\t\t\t\tif(this._data.checkbox.uto) { clearTimeout(this._data.checkbox.uto); }\n\t\t\t\t\t\t\tthis._data.checkbox.uto = setTimeout($.proxy(this._undetermined, this), 50);\n\t\t\t\t\t\t}, this));\n\t\t\t}\n\t\t\tif(!this.settings.checkbox.tie_selection) {\n\t\t\t\tthis.element\n\t\t\t\t\t.on('model.jstree', $.proxy(function (e, data) {\n\t\t\t\t\t\tvar m = this._model.data,\n\t\t\t\t\t\t\tp = m[data.parent],\n\t\t\t\t\t\t\tdpc = data.nodes,\n\t\t\t\t\t\t\ti, j;\n\t\t\t\t\t\tfor(i = 0, j = dpc.length; i < j; i++) {\n\t\t\t\t\t\t\tm[dpc[i]].state.checked = m[dpc[i]].state.checked || (m[dpc[i]].original && m[dpc[i]].original.state && m[dpc[i]].original.state.checked);\n\t\t\t\t\t\t\tif(m[dpc[i]].state.checked) {\n\t\t\t\t\t\t\t\tthis._data.checkbox.selected.push(dpc[i]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}, this));\n\t\t\t}\n\t\t\tif(this.settings.checkbox.cascade.indexOf('up') !== -1 || this.settings.checkbox.cascade.indexOf('down') !== -1) {\n\t\t\t\tthis.element\n\t\t\t\t\t.on('model.jstree', $.proxy(function (e, data) {\n\t\t\t\t\t\t\tvar m = this._model.data,\n\t\t\t\t\t\t\t\tp = m[data.parent],\n\t\t\t\t\t\t\t\tdpc = data.nodes,\n\t\t\t\t\t\t\t\tchd = [],\n\t\t\t\t\t\t\t\tc, i, j, k, l, tmp, s = this.settings.checkbox.cascade, t = this.settings.checkbox.tie_selection;\n\n\t\t\t\t\t\t\tif(s.indexOf('down') !== -1) {\n\t\t\t\t\t\t\t\t// apply down\n\t\t\t\t\t\t\t\tif(p.state[ t ? 'selected' : 'checked' ]) {\n\t\t\t\t\t\t\t\t\tfor(i = 0, j = dpc.length; i < j; i++) {\n\t\t\t\t\t\t\t\t\t\tm[dpc[i]].state[ t ? 'selected' : 'checked' ] = true;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tthis._data[ t ? 'core' : 'checkbox' ].selected = this._data[ t ? 'core' : 'checkbox' ].selected.concat(dpc);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tfor(i = 0, j = dpc.length; i < j; i++) {\n\t\t\t\t\t\t\t\t\t\tif(m[dpc[i]].state[ t ? 'selected' : 'checked' ]) {\n\t\t\t\t\t\t\t\t\t\t\tfor(k = 0, l = m[dpc[i]].children_d.length; k < l; k++) {\n\t\t\t\t\t\t\t\t\t\t\t\tm[m[dpc[i]].children_d[k]].state[ t ? 'selected' : 'checked' ] = true;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tthis._data[ t ? 'core' : 'checkbox' ].selected = this._data[ t ? 'core' : 'checkbox' ].selected.concat(m[dpc[i]].children_d);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif(s.indexOf('up') !== -1) {\n\t\t\t\t\t\t\t\t// apply up\n\t\t\t\t\t\t\t\tfor(i = 0, j = p.children_d.length; i < j; i++) {\n\t\t\t\t\t\t\t\t\tif(!m[p.children_d[i]].children.length) {\n\t\t\t\t\t\t\t\t\t\tchd.push(m[p.children_d[i]].parent);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tchd = $.vakata.array_unique(chd);\n\t\t\t\t\t\t\t\tfor(k = 0, l = chd.length; k < l; k++) {\n\t\t\t\t\t\t\t\t\tp = m[chd[k]];\n\t\t\t\t\t\t\t\t\twhile(p && p.id !== $.jstree.root) {\n\t\t\t\t\t\t\t\t\t\tc = 0;\n\t\t\t\t\t\t\t\t\t\tfor(i = 0, j = p.children.length; i < j; i++) {\n\t\t\t\t\t\t\t\t\t\t\tc += m[p.children[i]].state[ t ? 'selected' : 'checked' ];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif(c === j) {\n\t\t\t\t\t\t\t\t\t\t\tp.state[ t ? 'selected' : 'checked' ] = true;\n\t\t\t\t\t\t\t\t\t\t\tthis._data[ t ? 'core' : 'checkbox' ].selected.push(p.id);\n\t\t\t\t\t\t\t\t\t\t\ttmp = this.get_node(p, true);\n\t\t\t\t\t\t\t\t\t\t\tif(tmp && tmp.length) {\n\t\t\t\t\t\t\t\t\t\t\t\ttmp.attr('aria-selected', true).children('.jstree-anchor').addClass( t ? 'jstree-clicked' : 'jstree-checked');\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tp = this.get_node(p.parent);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tthis._data[ t ? 'core' : 'checkbox' ].selected = $.vakata.array_unique(this._data[ t ? 'core' : 'checkbox' ].selected);\n\t\t\t\t\t\t}, this))\n\t\t\t\t\t.on(this.settings.checkbox.tie_selection ? 'select_node.jstree' : 'check_node.jstree', $.proxy(function (e, data) {\n\t\t\t\t\t\t\tvar self = this,\n\t\t\t\t\t\t\t\tobj = data.node,\n\t\t\t\t\t\t\t\tm = this._model.data,\n\t\t\t\t\t\t\t\tpar = this.get_node(obj.parent),\n\t\t\t\t\t\t\t\ti, j, c, tmp, s = this.settings.checkbox.cascade, t = this.settings.checkbox.tie_selection,\n\t\t\t\t\t\t\t\tsel = {}, cur = this._data[ t ? 'core' : 'checkbox' ].selected;\n\n\t\t\t\t\t\t\tfor (i = 0, j = cur.length; i < j; i++) {\n\t\t\t\t\t\t\t\tsel[cur[i]] = true;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// apply down\n\t\t\t\t\t\t\tif(s.indexOf('down') !== -1) {\n\t\t\t\t\t\t\t\t//this._data[ t ? 'core' : 'checkbox' ].selected = $.vakata.array_unique(this._data[ t ? 'core' : 'checkbox' ].selected.concat(obj.children_d));\n\t\t\t\t\t\t\t\tvar selectedIds = this._cascade_new_checked_state(obj.id, true);\n\t\t\t\t\t\t\t\tvar temp = obj.children_d.concat(obj.id);\n\t\t\t\t\t\t\t\tfor (i = 0, j = temp.length; i < j; i++) {\n\t\t\t\t\t\t\t\t\tif (selectedIds.indexOf(temp[i]) > -1) {\n\t\t\t\t\t\t\t\t\t\tsel[temp[i]] = true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\tdelete sel[temp[i]];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// apply up\n\t\t\t\t\t\t\tif(s.indexOf('up') !== -1) {\n\t\t\t\t\t\t\t\twhile(par && par.id !== $.jstree.root) {\n\t\t\t\t\t\t\t\t\tc = 0;\n\t\t\t\t\t\t\t\t\tfor(i = 0, j = par.children.length; i < j; i++) {\n\t\t\t\t\t\t\t\t\t\tc += m[par.children[i]].state[ t ? 'selected' : 'checked' ];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(c === j) {\n\t\t\t\t\t\t\t\t\t\tpar.state[ t ? 'selected' : 'checked' ] = true;\n\t\t\t\t\t\t\t\t\t\tsel[par.id] = true;\n\t\t\t\t\t\t\t\t\t\t//this._data[ t ? 'core' : 'checkbox' ].selected.push(par.id);\n\t\t\t\t\t\t\t\t\t\ttmp = this.get_node(par, true);\n\t\t\t\t\t\t\t\t\t\tif(tmp && tmp.length) {\n\t\t\t\t\t\t\t\t\t\t\ttmp.attr('aria-selected', true).children('.jstree-anchor').addClass(t ? 'jstree-clicked' : 'jstree-checked');\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tpar = this.get_node(par.parent);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tcur = [];\n\t\t\t\t\t\t\tfor (i in sel) {\n\t\t\t\t\t\t\t\tif (sel.hasOwnProperty(i)) {\n\t\t\t\t\t\t\t\t\tcur.push(i);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthis._data[ t ? 'core' : 'checkbox' ].selected = cur;\n\t\t\t\t\t\t}, this))\n\t\t\t\t\t.on(this.settings.checkbox.tie_selection ? 'deselect_all.jstree' : 'uncheck_all.jstree', $.proxy(function (e, data) {\n\t\t\t\t\t\t\tvar obj = this.get_node($.jstree.root),\n\t\t\t\t\t\t\t\tm = this._model.data,\n\t\t\t\t\t\t\t\ti, j, tmp;\n\t\t\t\t\t\t\tfor(i = 0, j = obj.children_d.length; i < j; i++) {\n\t\t\t\t\t\t\t\ttmp = m[obj.children_d[i]];\n\t\t\t\t\t\t\t\tif(tmp && tmp.original && tmp.original.state && tmp.original.state.undetermined) {\n\t\t\t\t\t\t\t\t\ttmp.original.state.undetermined = false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, this))\n\t\t\t\t\t.on(this.settings.checkbox.tie_selection ? 'deselect_node.jstree' : 'uncheck_node.jstree', $.proxy(function (e, data) {\n\t\t\t\t\t\t\tvar self = this,\n\t\t\t\t\t\t\t\tobj = data.node,\n\t\t\t\t\t\t\t\tdom = this.get_node(obj, true),\n\t\t\t\t\t\t\t\ti, j, tmp, s = this.settings.checkbox.cascade, t = this.settings.checkbox.tie_selection,\n\t\t\t\t\t\t\t\tcur = this._data[ t ? 'core' : 'checkbox' ].selected, sel = {},\n\t\t\t\t\t\t\t\tstillSelectedIds = [],\n\t\t\t\t\t\t\t\tallIds = obj.children_d.concat(obj.id);\n\n\t\t\t\t\t\t\t// apply down\n\t\t\t\t\t\t\tif(s.indexOf('down') !== -1) {\n\t\t\t\t\t\t\t\tvar selectedIds = this._cascade_new_checked_state(obj.id, false);\n\n\t\t\t\t\t\t\t\tcur = $.vakata.array_filter(cur, function(id) {\n\t\t\t\t\t\t\t\t\treturn allIds.indexOf(id) === -1 || selectedIds.indexOf(id) > -1;\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// only apply up if cascade up is enabled and if this node is not selected\n\t\t\t\t\t\t\t// (if all child nodes are disabled and cascade_to_disabled === false then this node will till be selected).\n\t\t\t\t\t\t\tif(s.indexOf('up') !== -1 && cur.indexOf(obj.id) === -1) {\n\t\t\t\t\t\t\t\tfor(i = 0, j = obj.parents.length; i < j; i++) {\n\t\t\t\t\t\t\t\t\ttmp = this._model.data[obj.parents[i]];\n\t\t\t\t\t\t\t\t\ttmp.state[ t ? 'selected' : 'checked' ] = false;\n\t\t\t\t\t\t\t\t\tif(tmp && tmp.original && tmp.original.state && tmp.original.state.undetermined) {\n\t\t\t\t\t\t\t\t\t\ttmp.original.state.undetermined = false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\ttmp = this.get_node(obj.parents[i], true);\n\t\t\t\t\t\t\t\t\tif(tmp && tmp.length) {\n\t\t\t\t\t\t\t\t\t\ttmp.attr('aria-selected', false).children('.jstree-anchor').removeClass(t ? 'jstree-clicked' : 'jstree-checked');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tcur = $.vakata.array_filter(cur, function(id) {\n\t\t\t\t\t\t\t\t\treturn obj.parents.indexOf(id) === -1;\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tthis._data[ t ? 'core' : 'checkbox' ].selected = cur;\n\t\t\t\t\t\t}, this));\n\t\t\t}\n\t\t\tif(this.settings.checkbox.cascade.indexOf('up') !== -1) {\n\t\t\t\tthis.element\n\t\t\t\t\t.on('delete_node.jstree', $.proxy(function (e, data) {\n\t\t\t\t\t\t\t// apply up (whole handler)\n\t\t\t\t\t\t\tvar p = this.get_node(data.parent),\n\t\t\t\t\t\t\t\tm = this._model.data,\n\t\t\t\t\t\t\t\ti, j, c, tmp, t = this.settings.checkbox.tie_selection;\n\t\t\t\t\t\t\twhile(p && p.id !== $.jstree.root && !p.state[ t ? 'selected' : 'checked' ]) {\n\t\t\t\t\t\t\t\tc = 0;\n\t\t\t\t\t\t\t\tfor(i = 0, j = p.children.length; i < j; i++) {\n\t\t\t\t\t\t\t\t\tc += m[p.children[i]].state[ t ? 'selected' : 'checked' ];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(j > 0 && c === j) {\n\t\t\t\t\t\t\t\t\tp.state[ t ? 'selected' : 'checked' ] = true;\n\t\t\t\t\t\t\t\t\tthis._data[ t ? 'core' : 'checkbox' ].selected.push(p.id);\n\t\t\t\t\t\t\t\t\ttmp = this.get_node(p, true);\n\t\t\t\t\t\t\t\t\tif(tmp && tmp.length) {\n\t\t\t\t\t\t\t\t\t\ttmp.attr('aria-selected', true).children('.jstree-anchor').addClass(t ? 'jstree-clicked' : 'jstree-checked');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tp = this.get_node(p.parent);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, this))\n\t\t\t\t\t.on('move_node.jstree', $.proxy(function (e, data) {\n\t\t\t\t\t\t\t// apply up (whole handler)\n\t\t\t\t\t\t\tvar is_multi = data.is_multi,\n\t\t\t\t\t\t\t\told_par = data.old_parent,\n\t\t\t\t\t\t\t\tnew_par = this.get_node(data.parent),\n\t\t\t\t\t\t\t\tm = this._model.data,\n\t\t\t\t\t\t\t\tp, c, i, j, tmp, t = this.settings.checkbox.tie_selection;\n\t\t\t\t\t\t\tif(!is_multi) {\n\t\t\t\t\t\t\t\tp = this.get_node(old_par);\n\t\t\t\t\t\t\t\twhile(p && p.id !== $.jstree.root && !p.state[ t ? 'selected' : 'checked' ]) {\n\t\t\t\t\t\t\t\t\tc = 0;\n\t\t\t\t\t\t\t\t\tfor(i = 0, j = p.children.length; i < j; i++) {\n\t\t\t\t\t\t\t\t\t\tc += m[p.children[i]].state[ t ? 'selected' : 'checked' ];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(j > 0 && c === j) {\n\t\t\t\t\t\t\t\t\t\tp.state[ t ? 'selected' : 'checked' ] = true;\n\t\t\t\t\t\t\t\t\t\tthis._data[ t ? 'core' : 'checkbox' ].selected.push(p.id);\n\t\t\t\t\t\t\t\t\t\ttmp = this.get_node(p, true);\n\t\t\t\t\t\t\t\t\t\tif(tmp && tmp.length) {\n\t\t\t\t\t\t\t\t\t\t\ttmp.attr('aria-selected', true).children('.jstree-anchor').addClass(t ? 'jstree-clicked' : 'jstree-checked');\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tp = this.get_node(p.parent);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tp = new_par;\n\t\t\t\t\t\t\twhile(p && p.id !== $.jstree.root) {\n\t\t\t\t\t\t\t\tc = 0;\n\t\t\t\t\t\t\t\tfor(i = 0, j = p.children.length; i < j; i++) {\n\t\t\t\t\t\t\t\t\tc += m[p.children[i]].state[ t ? 'selected' : 'checked' ];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(c === j) {\n\t\t\t\t\t\t\t\t\tif(!p.state[ t ? 'selected' : 'checked' ]) {\n\t\t\t\t\t\t\t\t\t\tp.state[ t ? 'selected' : 'checked' ] = true;\n\t\t\t\t\t\t\t\t\t\tthis._data[ t ? 'core' : 'checkbox' ].selected.push(p.id);\n\t\t\t\t\t\t\t\t\t\ttmp = this.get_node(p, true);\n\t\t\t\t\t\t\t\t\t\tif(tmp && tmp.length) {\n\t\t\t\t\t\t\t\t\t\t\ttmp.attr('aria-selected', true).children('.jstree-anchor').addClass(t ? 'jstree-clicked' : 'jstree-checked');\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tif(p.state[ t ? 'selected' : 'checked' ]) {\n\t\t\t\t\t\t\t\t\t\tp.state[ t ? 'selected' : 'checked' ] = false;\n\t\t\t\t\t\t\t\t\t\tthis._data[ t ? 'core' : 'checkbox' ].selected = $.vakata.array_remove_item(this._data[ t ? 'core' : 'checkbox' ].selected, p.id);\n\t\t\t\t\t\t\t\t\t\ttmp = this.get_node(p, true);\n\t\t\t\t\t\t\t\t\t\tif(tmp && tmp.length) {\n\t\t\t\t\t\t\t\t\t\t\ttmp.attr('aria-selected', false).children('.jstree-anchor').removeClass(t ? 'jstree-clicked' : 'jstree-checked');\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tp = this.get_node(p.parent);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, this));\n\t\t\t}\n\t\t};\n\t\t/**\n\t\t * get an array of all nodes whose state is \"undetermined\"\n\t\t * @name get_undetermined([full])\n\t\t * @param  {boolean} full: if set to `true` the returned array will consist of the full node objects, otherwise - only IDs will be returned\n\t\t * @return {Array}\n\t\t * @plugin checkbox\n\t\t */\n\t\tthis.get_undetermined = function (full) {\n\t\t\tif (this.settings.checkbox.cascade.indexOf('undetermined') === -1) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\tvar i, j, k, l, o = {}, m = this._model.data, t = this.settings.checkbox.tie_selection, s = this._data[ t ? 'core' : 'checkbox' ].selected, p = [], tt = this, r = [];\n\t\t\tfor(i = 0, j = s.length; i < j; i++) {\n\t\t\t\tif(m[s[i]] && m[s[i]].parents) {\n\t\t\t\t\tfor(k = 0, l = m[s[i]].parents.length; k < l; k++) {\n\t\t\t\t\t\tif(o[m[s[i]].parents[k]] !== undefined) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(m[s[i]].parents[k] !== $.jstree.root) {\n\t\t\t\t\t\t\to[m[s[i]].parents[k]] = true;\n\t\t\t\t\t\t\tp.push(m[s[i]].parents[k]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// attempt for server side undetermined state\n\t\t\tthis.element.find('.jstree-closed').not(':has(.jstree-children)')\n\t\t\t\t.each(function () {\n\t\t\t\t\tvar tmp = tt.get_node(this), tmp2;\n\t\t\t\t\t\n\t\t\t\t\tif(!tmp) { return; }\n\t\t\t\t\t\n\t\t\t\t\tif(!tmp.state.loaded) {\n\t\t\t\t\t\tif(tmp.original && tmp.original.state && tmp.original.state.undetermined && tmp.original.state.undetermined === true) {\n\t\t\t\t\t\t\tif(o[tmp.id] === undefined && tmp.id !== $.jstree.root) {\n\t\t\t\t\t\t\t\to[tmp.id] = true;\n\t\t\t\t\t\t\t\tp.push(tmp.id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor(k = 0, l = tmp.parents.length; k < l; k++) {\n\t\t\t\t\t\t\t\tif(o[tmp.parents[k]] === undefined && tmp.parents[k] !== $.jstree.root) {\n\t\t\t\t\t\t\t\t\to[tmp.parents[k]] = true;\n\t\t\t\t\t\t\t\t\tp.push(tmp.parents[k]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tfor(i = 0, j = tmp.children_d.length; i < j; i++) {\n\t\t\t\t\t\t\ttmp2 = m[tmp.children_d[i]];\n\t\t\t\t\t\t\tif(!tmp2.state.loaded && tmp2.original && tmp2.original.state && tmp2.original.state.undetermined && tmp2.original.state.undetermined === true) {\n\t\t\t\t\t\t\t\tif(o[tmp2.id] === undefined && tmp2.id !== $.jstree.root) {\n\t\t\t\t\t\t\t\t\to[tmp2.id] = true;\n\t\t\t\t\t\t\t\t\tp.push(tmp2.id);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tfor(k = 0, l = tmp2.parents.length; k < l; k++) {\n\t\t\t\t\t\t\t\t\tif(o[tmp2.parents[k]] === undefined && tmp2.parents[k] !== $.jstree.root) {\n\t\t\t\t\t\t\t\t\t\to[tmp2.parents[k]] = true;\n\t\t\t\t\t\t\t\t\t\tp.push(tmp2.parents[k]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\tfor (i = 0, j = p.length; i < j; i++) {\n\t\t\t\tif(!m[p[i]].state[ t ? 'selected' : 'checked' ]) {\n\t\t\t\t\tr.push(full ? m[p[i]] : p[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn r;\n\t\t};\n\t\t/**\n\t\t * set the undetermined state where and if necessary. Used internally.\n\t\t * @private\n\t\t * @name _undetermined()\n\t\t * @plugin checkbox\n\t\t */\n\t\tthis._undetermined = function () {\n\t\t\tif(this.element === null) { return; }\n\t\t\tvar p = this.get_undetermined(false), i, j, s;\n\n\t\t\tthis.element.find('.jstree-undetermined').removeClass('jstree-undetermined');\n\t\t\tfor (i = 0, j = p.length; i < j; i++) {\n\t\t\t\ts = this.get_node(p[i], true);\n\t\t\t\tif(s && s.length) {\n\t\t\t\t\ts.children('.jstree-anchor').children('.jstree-checkbox').addClass('jstree-undetermined');\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tthis.redraw_node = function(obj, deep, is_callback, force_render) {\n\t\t\tobj = parent.redraw_node.apply(this, arguments);\n\t\t\tif(obj) {\n\t\t\t\tvar i, j, tmp = null, icon = null;\n\t\t\t\tfor(i = 0, j = obj.childNodes.length; i < j; i++) {\n\t\t\t\t\tif(obj.childNodes[i] && obj.childNodes[i].className && obj.childNodes[i].className.indexOf(\"jstree-anchor\") !== -1) {\n\t\t\t\t\t\ttmp = obj.childNodes[i];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(tmp) {\n\t\t\t\t\tif(!this.settings.checkbox.tie_selection && this._model.data[obj.id].state.checked) { tmp.className += ' jstree-checked'; }\n\t\t\t\t\ticon = _i.cloneNode(false);\n\t\t\t\t\tif(this._model.data[obj.id].state.checkbox_disabled) { icon.className += ' jstree-checkbox-disabled'; }\n\t\t\t\t\ttmp.insertBefore(icon, tmp.childNodes[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!is_callback && this.settings.checkbox.cascade.indexOf('undetermined') !== -1) {\n\t\t\t\tif(this._data.checkbox.uto) { clearTimeout(this._data.checkbox.uto); }\n\t\t\t\tthis._data.checkbox.uto = setTimeout($.proxy(this._undetermined, this), 50);\n\t\t\t}\n\t\t\treturn obj;\n\t\t};\n\t\t/**\n\t\t * show the node checkbox icons\n\t\t * @name show_checkboxes()\n\t\t * @plugin checkbox\n\t\t */\n\t\tthis.show_checkboxes = function () { this._data.core.themes.checkboxes = true; this.get_container_ul().removeClass(\"jstree-no-checkboxes\"); };\n\t\t/**\n\t\t * hide the node checkbox icons\n\t\t * @name hide_checkboxes()\n\t\t * @plugin checkbox\n\t\t */\n\t\tthis.hide_checkboxes = function () { this._data.core.themes.checkboxes = false; this.get_container_ul().addClass(\"jstree-no-checkboxes\"); };\n\t\t/**\n\t\t * toggle the node icons\n\t\t * @name toggle_checkboxes()\n\t\t * @plugin checkbox\n\t\t */\n\t\tthis.toggle_checkboxes = function () { if(this._data.core.themes.checkboxes) { this.hide_checkboxes(); } else { this.show_checkboxes(); } };\n\t\t/**\n\t\t * checks if a node is in an undetermined state\n\t\t * @name is_undetermined(obj)\n\t\t * @param  {mixed} obj\n\t\t * @return {Boolean}\n\t\t */\n\t\tthis.is_undetermined = function (obj) {\n\t\t\tobj = this.get_node(obj);\n\t\t\tvar s = this.settings.checkbox.cascade, i, j, t = this.settings.checkbox.tie_selection, d = this._data[ t ? 'core' : 'checkbox' ].selected, m = this._model.data;\n\t\t\tif(!obj || obj.state[ t ? 'selected' : 'checked' ] === true || s.indexOf('undetermined') === -1 || (s.indexOf('down') === -1 && s.indexOf('up') === -1)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(!obj.state.loaded && obj.original.state.undetermined === true) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tfor(i = 0, j = obj.children_d.length; i < j; i++) {\n\t\t\t\tif($.inArray(obj.children_d[i], d) !== -1 || (!m[obj.children_d[i]].state.loaded && m[obj.children_d[i]].original.state.undetermined)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\t\t/**\n\t\t * disable a node's checkbox\n\t\t * @name disable_checkbox(obj)\n\t\t * @param {mixed} obj an array can be used too\n\t\t * @trigger disable_checkbox.jstree\n\t\t * @plugin checkbox\n\t\t */\n\t\tthis.disable_checkbox = function (obj) {\n\t\t\tvar t1, t2, dom;\n\t\t\tif($.isArray(obj)) {\n\t\t\t\tobj = obj.slice();\n\t\t\t\tfor(t1 = 0, t2 = obj.length; t1 < t2; t1++) {\n\t\t\t\t\tthis.disable_checkbox(obj[t1]);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(!obj || obj.id === $.jstree.root) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tdom = this.get_node(obj, true);\n\t\t\tif(!obj.state.checkbox_disabled) {\n\t\t\t\tobj.state.checkbox_disabled = true;\n\t\t\t\tif(dom && dom.length) {\n\t\t\t\t\tdom.children('.jstree-anchor').children('.jstree-checkbox').addClass('jstree-checkbox-disabled');\n\t\t\t\t}\n\t\t\t\t/**\n\t\t\t\t * triggered when an node's checkbox is disabled\n\t\t\t\t * @event\n\t\t\t\t * @name disable_checkbox.jstree\n\t\t\t\t * @param {Object} node\n\t\t\t\t * @plugin checkbox\n\t\t\t\t */\n\t\t\t\tthis.trigger('disable_checkbox', { 'node' : obj });\n\t\t\t}\n\t\t};\n\t\t/**\n\t\t * enable a node's checkbox\n\t\t * @name enable_checkbox(obj)\n\t\t * @param {mixed} obj an array can be used too\n\t\t * @trigger enable_checkbox.jstree\n\t\t * @plugin checkbox\n\t\t */\n\t\tthis.enable_checkbox = function (obj) {\n\t\t\tvar t1, t2, dom;\n\t\t\tif($.isArray(obj)) {\n\t\t\t\tobj = obj.slice();\n\t\t\t\tfor(t1 = 0, t2 = obj.length; t1 < t2; t1++) {\n\t\t\t\t\tthis.enable_checkbox(obj[t1]);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(!obj || obj.id === $.jstree.root) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tdom = this.get_node(obj, true);\n\t\t\tif(obj.state.checkbox_disabled) {\n\t\t\t\tobj.state.checkbox_disabled = false;\n\t\t\t\tif(dom && dom.length) {\n\t\t\t\t\tdom.children('.jstree-anchor').children('.jstree-checkbox').removeClass('jstree-checkbox-disabled');\n\t\t\t\t}\n\t\t\t\t/**\n\t\t\t\t * triggered when an node's checkbox is enabled\n\t\t\t\t * @event\n\t\t\t\t * @name enable_checkbox.jstree\n\t\t\t\t * @param {Object} node\n\t\t\t\t * @plugin checkbox\n\t\t\t\t */\n\t\t\t\tthis.trigger('enable_checkbox', { 'node' : obj });\n\t\t\t}\n\t\t};\n\n\t\tthis.activate_node = function (obj, e) {\n\t\t\tif($(e.target).hasClass('jstree-checkbox-disabled')) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(this.settings.checkbox.tie_selection && (this.settings.checkbox.whole_node || $(e.target).hasClass('jstree-checkbox'))) {\n\t\t\t\te.ctrlKey = true;\n\t\t\t}\n\t\t\tif(this.settings.checkbox.tie_selection || (!this.settings.checkbox.whole_node && !$(e.target).hasClass('jstree-checkbox'))) {\n\t\t\t\treturn parent.activate_node.call(this, obj, e);\n\t\t\t}\n\t\t\tif(this.is_disabled(obj)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(this.is_checked(obj)) {\n\t\t\t\tthis.uncheck_node(obj, e);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.check_node(obj, e);\n\t\t\t}\n\t\t\tthis.trigger('activate_node', { 'node' : this.get_node(obj) });\n\t\t};\n\n\t\t/**\n\t\t * Cascades checked state to a node and all its descendants. This function does NOT affect hidden and disabled nodes (or their descendants).\n\t\t * However if these unaffected nodes are already selected their ids will be included in the returned array.\n\t\t * @private\n\t\t * @param {string} id the node ID\n\t\t * @param {bool} checkedState should the nodes be checked or not\n\t\t * @returns {Array} Array of all node id's (in this tree branch) that are checked.\n\t\t */\n\t\tthis._cascade_new_checked_state = function (id, checkedState) {\n\t\t\tvar self = this;\n\t\t\tvar t = this.settings.checkbox.tie_selection;\n\t\t\tvar node = this._model.data[id];\n\t\t\tvar selectedNodeIds = [];\n\t\t\tvar selectedChildrenIds = [], i, j, selectedChildIds;\n\n\t\t\tif (\n\t\t\t\t(this.settings.checkbox.cascade_to_disabled || !node.state.disabled) &&\n\t\t\t\t(this.settings.checkbox.cascade_to_hidden || !node.state.hidden)\n\t\t\t) {\n\t\t\t\t//First try and check/uncheck the children\n\t\t\t\tif (node.children) {\n\t\t\t\t\tfor (i = 0, j = node.children.length; i < j; i++) {\n\t\t\t\t\t\tvar childId = node.children[i];\n\t\t\t\t\t\tselectedChildIds = self._cascade_new_checked_state(childId, checkedState);\n\t\t\t\t\t\tselectedNodeIds = selectedNodeIds.concat(selectedChildIds);\n\t\t\t\t\t\tif (selectedChildIds.indexOf(childId) > -1) {\n\t\t\t\t\t\t\tselectedChildrenIds.push(childId);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar dom = self.get_node(node, true);\n\n\t\t\t\t//A node's state is undetermined if some but not all of it's children are checked/selected .\n\t\t\t\tvar undetermined = selectedChildrenIds.length > 0 && selectedChildrenIds.length < node.children.length;\n\n\t\t\t\tif(node.original && node.original.state && node.original.state.undetermined) {\n\t\t\t\t\tnode.original.state.undetermined = undetermined;\n\t\t\t\t}\n\n\t\t\t\t//If a node is undetermined then remove selected class\n\t\t\t\tif (undetermined) {\n\t\t\t\t\tnode.state[ t ? 'selected' : 'checked' ] = false;\n\t\t\t\t\tdom.attr('aria-selected', false).children('.jstree-anchor').removeClass(t ? 'jstree-clicked' : 'jstree-checked');\n\t\t\t\t}\n\t\t\t\t//Otherwise, if the checkedState === true (i.e. the node is being checked now) and all of the node's children are checked (if it has any children),\n\t\t\t\t//check the node and style it correctly.\n\t\t\t\telse if (checkedState && selectedChildrenIds.length === node.children.length) {\n\t\t\t\t\tnode.state[ t ? 'selected' : 'checked' ] = checkedState;\n\t\t\t\t\tselectedNodeIds.push(node.id);\n\n\t\t\t\t\tdom.attr('aria-selected', true).children('.jstree-anchor').addClass(t ? 'jstree-clicked' : 'jstree-checked');\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tnode.state[ t ? 'selected' : 'checked' ] = false;\n\t\t\t\t\tdom.attr('aria-selected', false).children('.jstree-anchor').removeClass(t ? 'jstree-clicked' : 'jstree-checked');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tselectedChildIds = this.get_checked_descendants(id);\n\n\t\t\t\tif (node.state[ t ? 'selected' : 'checked' ]) {\n\t\t\t\t\tselectedChildIds.push(node.id);\n\t\t\t\t}\n\n\t\t\t\tselectedNodeIds = selectedNodeIds.concat(selectedChildIds);\n\t\t\t}\n\n\t\t\treturn selectedNodeIds;\n\t\t};\n\n\t\t/**\n\t\t * Gets ids of nodes selected in branch (of tree) specified by id (does not include the node specified by id)\n\t\t * @name get_checked_descendants(obj)\n\t\t * @param {string} id the node ID\n\t\t * @return {Array} array of IDs\n\t\t * @plugin checkbox\n\t\t */\n\t\tthis.get_checked_descendants = function (id) {\n\t\t\tvar self = this;\n\t\t\tvar t = self.settings.checkbox.tie_selection;\n\t\t\tvar node = self._model.data[id];\n\n\t\t\treturn $.vakata.array_filter(node.children_d, function(_id) {\n\t\t\t\treturn self._model.data[_id].state[ t ? 'selected' : 'checked' ];\n\t\t\t});\n\t\t};\n\n\t\t/**\n\t\t * check a node (only if tie_selection in checkbox settings is false, otherwise select_node will be called internally)\n\t\t * @name check_node(obj)\n\t\t * @param {mixed} obj an array can be used to check multiple nodes\n\t\t * @trigger check_node.jstree\n\t\t * @plugin checkbox\n\t\t */\n\t\tthis.check_node = function (obj, e) {\n\t\t\tif(this.settings.checkbox.tie_selection) { return this.select_node(obj, false, true, e); }\n\t\t\tvar dom, t1, t2, th;\n\t\t\tif($.isArray(obj)) {\n\t\t\t\tobj = obj.slice();\n\t\t\t\tfor(t1 = 0, t2 = obj.length; t1 < t2; t1++) {\n\t\t\t\t\tthis.check_node(obj[t1], e);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(!obj || obj.id === $.jstree.root) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tdom = this.get_node(obj, true);\n\t\t\tif(!obj.state.checked) {\n\t\t\t\tobj.state.checked = true;\n\t\t\t\tthis._data.checkbox.selected.push(obj.id);\n\t\t\t\tif(dom && dom.length) {\n\t\t\t\t\tdom.children('.jstree-anchor').addClass('jstree-checked');\n\t\t\t\t}\n\t\t\t\t/**\n\t\t\t\t * triggered when an node is checked (only if tie_selection in checkbox settings is false)\n\t\t\t\t * @event\n\t\t\t\t * @name check_node.jstree\n\t\t\t\t * @param {Object} node\n\t\t\t\t * @param {Array} selected the current selection\n\t\t\t\t * @param {Object} event the event (if any) that triggered this check_node\n\t\t\t\t * @plugin checkbox\n\t\t\t\t */\n\t\t\t\tthis.trigger('check_node', { 'node' : obj, 'selected' : this._data.checkbox.selected, 'event' : e });\n\t\t\t}\n\t\t};\n\t\t/**\n\t\t * uncheck a node (only if tie_selection in checkbox settings is false, otherwise deselect_node will be called internally)\n\t\t * @name uncheck_node(obj)\n\t\t * @param {mixed} obj an array can be used to uncheck multiple nodes\n\t\t * @trigger uncheck_node.jstree\n\t\t * @plugin checkbox\n\t\t */\n\t\tthis.uncheck_node = function (obj, e) {\n\t\t\tif(this.settings.checkbox.tie_selection) { return this.deselect_node(obj, false, e); }\n\t\t\tvar t1, t2, dom;\n\t\t\tif($.isArray(obj)) {\n\t\t\t\tobj = obj.slice();\n\t\t\t\tfor(t1 = 0, t2 = obj.length; t1 < t2; t1++) {\n\t\t\t\t\tthis.uncheck_node(obj[t1], e);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(!obj || obj.id === $.jstree.root) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tdom = this.get_node(obj, true);\n\t\t\tif(obj.state.checked) {\n\t\t\t\tobj.state.checked = false;\n\t\t\t\tthis._data.checkbox.selected = $.vakata.array_remove_item(this._data.checkbox.selected, obj.id);\n\t\t\t\tif(dom.length) {\n\t\t\t\t\tdom.children('.jstree-anchor').removeClass('jstree-checked');\n\t\t\t\t}\n\t\t\t\t/**\n\t\t\t\t * triggered when an node is unchecked (only if tie_selection in checkbox settings is false)\n\t\t\t\t * @event\n\t\t\t\t * @name uncheck_node.jstree\n\t\t\t\t * @param {Object} node\n\t\t\t\t * @param {Array} selected the current selection\n\t\t\t\t * @param {Object} event the event (if any) that triggered this uncheck_node\n\t\t\t\t * @plugin checkbox\n\t\t\t\t */\n\t\t\t\tthis.trigger('uncheck_node', { 'node' : obj, 'selected' : this._data.checkbox.selected, 'event' : e });\n\t\t\t}\n\t\t};\n\t\t\n\t\t/**\n\t\t * checks all nodes in the tree (only if tie_selection in checkbox settings is false, otherwise select_all will be called internally)\n\t\t * @name check_all()\n\t\t * @trigger check_all.jstree, changed.jstree\n\t\t * @plugin checkbox\n\t\t */\n\t\tthis.check_all = function () {\n\t\t\tif(this.settings.checkbox.tie_selection) { return this.select_all(); }\n\t\t\tvar tmp = this._data.checkbox.selected.concat([]), i, j;\n\t\t\tthis._data.checkbox.selected = this._model.data[$.jstree.root].children_d.concat();\n\t\t\tfor(i = 0, j = this._data.checkbox.selected.length; i < j; i++) {\n\t\t\t\tif(this._model.data[this._data.checkbox.selected[i]]) {\n\t\t\t\t\tthis._model.data[this._data.checkbox.selected[i]].state.checked = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.redraw(true);\n\t\t\t/**\n\t\t\t * triggered when all nodes are checked (only if tie_selection in checkbox settings is false)\n\t\t\t * @event\n\t\t\t * @name check_all.jstree\n\t\t\t * @param {Array} selected the current selection\n\t\t\t * @plugin checkbox\n\t\t\t */\n\t\t\tthis.trigger('check_all', { 'selected' : this._data.checkbox.selected });\n\t\t};\n\t\t/**\n\t\t * uncheck all checked nodes (only if tie_selection in checkbox settings is false, otherwise deselect_all will be called internally)\n\t\t * @name uncheck_all()\n\t\t * @trigger uncheck_all.jstree\n\t\t * @plugin checkbox\n\t\t */\n\t\tthis.uncheck_all = function () {\n\t\t\tif(this.settings.checkbox.tie_selection) { return this.deselect_all(); }\n\t\t\tvar tmp = this._data.checkbox.selected.concat([]), i, j;\n\t\t\tfor(i = 0, j = this._data.checkbox.selected.length; i < j; i++) {\n\t\t\t\tif(this._model.data[this._data.checkbox.selected[i]]) {\n\t\t\t\t\tthis._model.data[this._data.checkbox.selected[i]].state.checked = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._data.checkbox.selected = [];\n\t\t\tthis.element.find('.jstree-checked').removeClass('jstree-checked');\n\t\t\t/**\n\t\t\t * triggered when all nodes are unchecked (only if tie_selection in checkbox settings is false)\n\t\t\t * @event\n\t\t\t * @name uncheck_all.jstree\n\t\t\t * @param {Object} node the previous selection\n\t\t\t * @param {Array} selected the current selection\n\t\t\t * @plugin checkbox\n\t\t\t */\n\t\t\tthis.trigger('uncheck_all', { 'selected' : this._data.checkbox.selected, 'node' : tmp });\n\t\t};\n\t\t/**\n\t\t * checks if a node is checked (if tie_selection is on in the settings this function will return the same as is_selected)\n\t\t * @name is_checked(obj)\n\t\t * @param  {mixed}  obj\n\t\t * @return {Boolean}\n\t\t * @plugin checkbox\n\t\t */\n\t\tthis.is_checked = function (obj) {\n\t\t\tif(this.settings.checkbox.tie_selection) { return this.is_selected(obj); }\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(!obj || obj.id === $.jstree.root) { return false; }\n\t\t\treturn obj.state.checked;\n\t\t};\n\t\t/**\n\t\t * get an array of all checked nodes (if tie_selection is on in the settings this function will return the same as get_selected)\n\t\t * @name get_checked([full])\n\t\t * @param  {mixed}  full if set to `true` the returned array will consist of the full node objects, otherwise - only IDs will be returned\n\t\t * @return {Array}\n\t\t * @plugin checkbox\n\t\t */\n\t\tthis.get_checked = function (full) {\n\t\t\tif(this.settings.checkbox.tie_selection) { return this.get_selected(full); }\n\t\t\treturn full ? $.map(this._data.checkbox.selected, $.proxy(function (i) { return this.get_node(i); }, this)) : this._data.checkbox.selected.slice();\n\t\t};\n\t\t/**\n\t\t * get an array of all top level checked nodes (ignoring children of checked nodes) (if tie_selection is on in the settings this function will return the same as get_top_selected)\n\t\t * @name get_top_checked([full])\n\t\t * @param  {mixed}  full if set to `true` the returned array will consist of the full node objects, otherwise - only IDs will be returned\n\t\t * @return {Array}\n\t\t * @plugin checkbox\n\t\t */\n\t\tthis.get_top_checked = function (full) {\n\t\t\tif(this.settings.checkbox.tie_selection) { return this.get_top_selected(full); }\n\t\t\tvar tmp = this.get_checked(true),\n\t\t\t\tobj = {}, i, j, k, l;\n\t\t\tfor(i = 0, j = tmp.length; i < j; i++) {\n\t\t\t\tobj[tmp[i].id] = tmp[i];\n\t\t\t}\n\t\t\tfor(i = 0, j = tmp.length; i < j; i++) {\n\t\t\t\tfor(k = 0, l = tmp[i].children_d.length; k < l; k++) {\n\t\t\t\t\tif(obj[tmp[i].children_d[k]]) {\n\t\t\t\t\t\tdelete obj[tmp[i].children_d[k]];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\ttmp = [];\n\t\t\tfor(i in obj) {\n\t\t\t\tif(obj.hasOwnProperty(i)) {\n\t\t\t\t\ttmp.push(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn full ? $.map(tmp, $.proxy(function (i) { return this.get_node(i); }, this)) : tmp;\n\t\t};\n\t\t/**\n\t\t * get an array of all bottom level checked nodes (ignoring selected parents) (if tie_selection is on in the settings this function will return the same as get_bottom_selected)\n\t\t * @name get_bottom_checked([full])\n\t\t * @param  {mixed}  full if set to `true` the returned array will consist of the full node objects, otherwise - only IDs will be returned\n\t\t * @return {Array}\n\t\t * @plugin checkbox\n\t\t */\n\t\tthis.get_bottom_checked = function (full) {\n\t\t\tif(this.settings.checkbox.tie_selection) { return this.get_bottom_selected(full); }\n\t\t\tvar tmp = this.get_checked(true),\n\t\t\t\tobj = [], i, j;\n\t\t\tfor(i = 0, j = tmp.length; i < j; i++) {\n\t\t\t\tif(!tmp[i].children.length) {\n\t\t\t\t\tobj.push(tmp[i].id);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn full ? $.map(obj, $.proxy(function (i) { return this.get_node(i); }, this)) : obj;\n\t\t};\n\t\tthis.load_node = function (obj, callback) {\n\t\t\tvar k, l, i, j, c, tmp;\n\t\t\tif(!$.isArray(obj) && !this.settings.checkbox.tie_selection) {\n\t\t\t\ttmp = this.get_node(obj);\n\t\t\t\tif(tmp && tmp.state.loaded) {\n\t\t\t\t\tfor(k = 0, l = tmp.children_d.length; k < l; k++) {\n\t\t\t\t\t\tif(this._model.data[tmp.children_d[k]].state.checked) {\n\t\t\t\t\t\t\tc = true;\n\t\t\t\t\t\t\tthis._data.checkbox.selected = $.vakata.array_remove_item(this._data.checkbox.selected, tmp.children_d[k]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn parent.load_node.apply(this, arguments);\n\t\t};\n\t\tthis.get_state = function () {\n\t\t\tvar state = parent.get_state.apply(this, arguments);\n\t\t\tif(this.settings.checkbox.tie_selection) { return state; }\n\t\t\tstate.checkbox = this._data.checkbox.selected.slice();\n\t\t\treturn state;\n\t\t};\n\t\tthis.set_state = function (state, callback) {\n\t\t\tvar res = parent.set_state.apply(this, arguments);\n\t\t\tif(res && state.checkbox) {\n\t\t\t\tif(!this.settings.checkbox.tie_selection) {\n\t\t\t\t\tthis.uncheck_all();\n\t\t\t\t\tvar _this = this;\n\t\t\t\t\t$.each(state.checkbox, function (i, v) {\n\t\t\t\t\t\t_this.check_node(v);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tdelete state.checkbox;\n\t\t\t\tthis.set_state(state, callback);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn res;\n\t\t};\n\t\tthis.refresh = function (skip_loading, forget_state) {\n\t\t\tif(this.settings.checkbox.tie_selection) {\n\t\t\t\tthis._data.checkbox.selected = [];\n\t\t\t}\n\t\t\treturn parent.refresh.apply(this, arguments);\n\t\t};\n\t};\n\n\t// include the checkbox plugin by default\n\t// $.jstree.defaults.plugins.push(\"checkbox\");\n\n\n/**\n * ### Conditionalselect plugin\n *\n * This plugin allows defining a callback to allow or deny node selection by user input (activate node method).\n */\n\n\t/**\n\t * a callback (function) which is invoked in the instance's scope and receives two arguments - the node and the event that triggered the `activate_node` call. Returning false prevents working with the node, returning true allows invoking activate_node. Defaults to returning `true`.\n\t * @name $.jstree.defaults.checkbox.visible\n\t * @plugin checkbox\n\t */\n\t$.jstree.defaults.conditionalselect = function () { return true; };\n\t$.jstree.plugins.conditionalselect = function (options, parent) {\n\t\t// own function\n\t\tthis.activate_node = function (obj, e) {\n\t\t\tif(this.settings.conditionalselect.call(this, this.get_node(obj), e)) {\n\t\t\t\treturn parent.activate_node.call(this, obj, e);\n\t\t\t}\n\t\t};\n\t};\n\n\n/**\n * ### Contextmenu plugin\n *\n * Shows a context menu when a node is right-clicked.\n */\n\n\t/**\n\t * stores all defaults for the contextmenu plugin\n\t * @name $.jstree.defaults.contextmenu\n\t * @plugin contextmenu\n\t */\n\t$.jstree.defaults.contextmenu = {\n\t\t/**\n\t\t * a boolean indicating if the node should be selected when the context menu is invoked on it. Defaults to `true`.\n\t\t * @name $.jstree.defaults.contextmenu.select_node\n\t\t * @plugin contextmenu\n\t\t */\n\t\tselect_node : true,\n\t\t/**\n\t\t * a boolean indicating if the menu should be shown aligned with the node. Defaults to `true`, otherwise the mouse coordinates are used.\n\t\t * @name $.jstree.defaults.contextmenu.show_at_node\n\t\t * @plugin contextmenu\n\t\t */\n\t\tshow_at_node : true,\n\t\t/**\n\t\t * an object of actions, or a function that accepts a node and a callback function and calls the callback function with an object of actions available for that node (you can also return the items too).\n\t\t *\n\t\t * Each action consists of a key (a unique name) and a value which is an object with the following properties (only label and action are required). Once a menu item is activated the `action` function will be invoked with an object containing the following keys: item - the contextmenu item definition as seen below, reference - the DOM node that was used (the tree node), element - the contextmenu DOM element, position - an object with x/y properties indicating the position of the menu.\n\t\t *\n\t\t * * `separator_before` - a boolean indicating if there should be a separator before this item\n\t\t * * `separator_after` - a boolean indicating if there should be a separator after this item\n\t\t * * `_disabled` - a boolean indicating if this action should be disabled\n\t\t * * `label` - a string - the name of the action (could be a function returning a string)\n\t\t * * `title` - a string - an optional tooltip for the item\n\t\t * * `action` - a function to be executed if this item is chosen, the function will receive \n\t\t * * `icon` - a string, can be a path to an icon or a className, if using an image that is in the current directory use a `./` prefix, otherwise it will be detected as a class\n\t\t * * `shortcut` - keyCode which will trigger the action if the menu is open (for example `113` for rename, which equals F2)\n\t\t * * `shortcut_label` - shortcut label (like for example `F2` for rename)\n\t\t * * `submenu` - an object with the same structure as $.jstree.defaults.contextmenu.items which can be used to create a submenu - each key will be rendered as a separate option in a submenu that will appear once the current item is hovered\n\t\t *\n\t\t * @name $.jstree.defaults.contextmenu.items\n\t\t * @plugin contextmenu\n\t\t */\n\t\titems : function (o, cb) { // Could be an object directly\n\t\t\treturn {\n\t\t\t\t\"create\" : {\n\t\t\t\t\t\"separator_before\"\t: false,\n\t\t\t\t\t\"separator_after\"\t: true,\n\t\t\t\t\t\"_disabled\"\t\t\t: false, //(this.check(\"create_node\", data.reference, {}, \"last\")),\n\t\t\t\t\t\"label\"\t\t\t\t: \"Create\",\n\t\t\t\t\t\"action\"\t\t\t: function (data) {\n\t\t\t\t\t\tvar inst = $.jstree.reference(data.reference),\n\t\t\t\t\t\t\tobj = inst.get_node(data.reference);\n\t\t\t\t\t\tinst.create_node(obj, {}, \"last\", function (new_node) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tinst.edit(new_node);\n\t\t\t\t\t\t\t} catch (ex) {\n\t\t\t\t\t\t\t\tsetTimeout(function () { inst.edit(new_node); },0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"rename\" : {\n\t\t\t\t\t\"separator_before\"\t: false,\n\t\t\t\t\t\"separator_after\"\t: false,\n\t\t\t\t\t\"_disabled\"\t\t\t: false, //(this.check(\"rename_node\", data.reference, this.get_parent(data.reference), \"\")),\n\t\t\t\t\t\"label\"\t\t\t\t: \"Rename\",\n\t\t\t\t\t/*!\n\t\t\t\t\t\"shortcut\"\t\t\t: 113,\n\t\t\t\t\t\"shortcut_label\"\t: 'F2',\n\t\t\t\t\t\"icon\"\t\t\t\t: \"glyphicon glyphicon-leaf\",\n\t\t\t\t\t*/\n\t\t\t\t\t\"action\"\t\t\t: function (data) {\n\t\t\t\t\t\tvar inst = $.jstree.reference(data.reference),\n\t\t\t\t\t\t\tobj = inst.get_node(data.reference);\n\t\t\t\t\t\tinst.edit(obj);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"remove\" : {\n\t\t\t\t\t\"separator_before\"\t: false,\n\t\t\t\t\t\"icon\"\t\t\t\t: false,\n\t\t\t\t\t\"separator_after\"\t: false,\n\t\t\t\t\t\"_disabled\"\t\t\t: false, //(this.check(\"delete_node\", data.reference, this.get_parent(data.reference), \"\")),\n\t\t\t\t\t\"label\"\t\t\t\t: \"Delete\",\n\t\t\t\t\t\"action\"\t\t\t: function (data) {\n\t\t\t\t\t\tvar inst = $.jstree.reference(data.reference),\n\t\t\t\t\t\t\tobj = inst.get_node(data.reference);\n\t\t\t\t\t\tif(inst.is_selected(obj)) {\n\t\t\t\t\t\t\tinst.delete_node(inst.get_selected());\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tinst.delete_node(obj);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"ccp\" : {\n\t\t\t\t\t\"separator_before\"\t: true,\n\t\t\t\t\t\"icon\"\t\t\t\t: false,\n\t\t\t\t\t\"separator_after\"\t: false,\n\t\t\t\t\t\"label\"\t\t\t\t: \"Edit\",\n\t\t\t\t\t\"action\"\t\t\t: false,\n\t\t\t\t\t\"submenu\" : {\n\t\t\t\t\t\t\"cut\" : {\n\t\t\t\t\t\t\t\"separator_before\"\t: false,\n\t\t\t\t\t\t\t\"separator_after\"\t: false,\n\t\t\t\t\t\t\t\"label\"\t\t\t\t: \"Cut\",\n\t\t\t\t\t\t\t\"action\"\t\t\t: function (data) {\n\t\t\t\t\t\t\t\tvar inst = $.jstree.reference(data.reference),\n\t\t\t\t\t\t\t\t\tobj = inst.get_node(data.reference);\n\t\t\t\t\t\t\t\tif(inst.is_selected(obj)) {\n\t\t\t\t\t\t\t\t\tinst.cut(inst.get_top_selected());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tinst.cut(obj);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"copy\" : {\n\t\t\t\t\t\t\t\"separator_before\"\t: false,\n\t\t\t\t\t\t\t\"icon\"\t\t\t\t: false,\n\t\t\t\t\t\t\t\"separator_after\"\t: false,\n\t\t\t\t\t\t\t\"label\"\t\t\t\t: \"Copy\",\n\t\t\t\t\t\t\t\"action\"\t\t\t: function (data) {\n\t\t\t\t\t\t\t\tvar inst = $.jstree.reference(data.reference),\n\t\t\t\t\t\t\t\t\tobj = inst.get_node(data.reference);\n\t\t\t\t\t\t\t\tif(inst.is_selected(obj)) {\n\t\t\t\t\t\t\t\t\tinst.copy(inst.get_top_selected());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tinst.copy(obj);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"paste\" : {\n\t\t\t\t\t\t\t\"separator_before\"\t: false,\n\t\t\t\t\t\t\t\"icon\"\t\t\t\t: false,\n\t\t\t\t\t\t\t\"_disabled\"\t\t\t: function (data) {\n\t\t\t\t\t\t\t\treturn !$.jstree.reference(data.reference).can_paste();\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"separator_after\"\t: false,\n\t\t\t\t\t\t\t\"label\"\t\t\t\t: \"Paste\",\n\t\t\t\t\t\t\t\"action\"\t\t\t: function (data) {\n\t\t\t\t\t\t\t\tvar inst = $.jstree.reference(data.reference),\n\t\t\t\t\t\t\t\t\tobj = inst.get_node(data.reference);\n\t\t\t\t\t\t\t\tinst.paste(obj);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t};\n\n\t$.jstree.plugins.contextmenu = function (options, parent) {\n\t\tthis.bind = function () {\n\t\t\tparent.bind.call(this);\n\n\t\t\tvar last_ts = 0, cto = null, ex, ey;\n\t\t\tthis.element\n\t\t\t\t.on(\"init.jstree loading.jstree ready.jstree\", $.proxy(function () {\n\t\t\t\t\t\tthis.get_container_ul().addClass('jstree-contextmenu');\n\t\t\t\t\t}, this))\n\t\t\t\t.on(\"contextmenu.jstree\", \".jstree-anchor\", $.proxy(function (e, data) {\n\t\t\t\t\t\tif (e.target.tagName.toLowerCase() === 'input') {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\tlast_ts = e.ctrlKey ? +new Date() : 0;\n\t\t\t\t\t\tif(data || cto) {\n\t\t\t\t\t\t\tlast_ts = (+new Date()) + 10000;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(cto) {\n\t\t\t\t\t\t\tclearTimeout(cto);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!this.is_loading(e.currentTarget)) {\n\t\t\t\t\t\t\tthis.show_contextmenu(e.currentTarget, e.pageX, e.pageY, e);\n\t\t\t\t\t\t}\n\t\t\t\t\t}, this))\n\t\t\t\t.on(\"click.jstree\", \".jstree-anchor\", $.proxy(function (e) {\n\t\t\t\t\t\tif(this._data.contextmenu.visible && (!last_ts || (+new Date()) - last_ts > 250)) { // work around safari & macOS ctrl+click\n\t\t\t\t\t\t\t$.vakata.context.hide();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlast_ts = 0;\n\t\t\t\t\t}, this))\n\t\t\t\t.on(\"touchstart.jstree\", \".jstree-anchor\", function (e) {\n\t\t\t\t\t\tif(!e.originalEvent || !e.originalEvent.changedTouches || !e.originalEvent.changedTouches[0]) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tex = e.originalEvent.changedTouches[0].clientX;\n\t\t\t\t\t\tey = e.originalEvent.changedTouches[0].clientY;\n\t\t\t\t\t\tcto = setTimeout(function () {\n\t\t\t\t\t\t\t$(e.currentTarget).trigger('contextmenu', true);\n\t\t\t\t\t\t}, 750);\n\t\t\t\t\t})\n\t\t\t\t.on('touchmove.vakata.jstree', function (e) {\n\t\t\t\t\t\tif(cto && e.originalEvent && e.originalEvent.changedTouches && e.originalEvent.changedTouches[0] && (Math.abs(ex - e.originalEvent.changedTouches[0].clientX) > 10 || Math.abs(ey - e.originalEvent.changedTouches[0].clientY) > 10)) {\n\t\t\t\t\t\t\tclearTimeout(cto);\n\t\t\t\t\t\t\t$.vakata.context.hide();\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t.on('touchend.vakata.jstree', function (e) {\n\t\t\t\t\t\tif(cto) {\n\t\t\t\t\t\t\tclearTimeout(cto);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t/*!\n\t\t\tif(!('oncontextmenu' in document.body) && ('ontouchstart' in document.body)) {\n\t\t\t\tvar el = null, tm = null;\n\t\t\t\tthis.element\n\t\t\t\t\t.on(\"touchstart\", \".jstree-anchor\", function (e) {\n\t\t\t\t\t\tel = e.currentTarget;\n\t\t\t\t\t\ttm = +new Date();\n\t\t\t\t\t\t$(document).one(\"touchend\", function (e) {\n\t\t\t\t\t\t\te.target = document.elementFromPoint(e.originalEvent.targetTouches[0].pageX - window.pageXOffset, e.originalEvent.targetTouches[0].pageY - window.pageYOffset);\n\t\t\t\t\t\t\te.currentTarget = e.target;\n\t\t\t\t\t\t\ttm = ((+(new Date())) - tm);\n\t\t\t\t\t\t\tif(e.target === el && tm > 600 && tm < 1000) {\n\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\t$(el).trigger('contextmenu', e);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tel = null;\n\t\t\t\t\t\t\ttm = null;\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t}\n\t\t\t*/\n\t\t\t$(document).on(\"context_hide.vakata.jstree\", $.proxy(function (e, data) {\n\t\t\t\tthis._data.contextmenu.visible = false;\n\t\t\t\t$(data.reference).removeClass('jstree-context');\n\t\t\t}, this));\n\t\t};\n\t\tthis.teardown = function () {\n\t\t\tif(this._data.contextmenu.visible) {\n\t\t\t\t$.vakata.context.hide();\n\t\t\t}\n\t\t\tparent.teardown.call(this);\n\t\t};\n\n\t\t/**\n\t\t * prepare and show the context menu for a node\n\t\t * @name show_contextmenu(obj [, x, y])\n\t\t * @param {mixed} obj the node\n\t\t * @param {Number} x the x-coordinate relative to the document to show the menu at\n\t\t * @param {Number} y the y-coordinate relative to the document to show the menu at\n\t\t * @param {Object} e the event if available that triggered the contextmenu\n\t\t * @plugin contextmenu\n\t\t * @trigger show_contextmenu.jstree\n\t\t */\n\t\tthis.show_contextmenu = function (obj, x, y, e) {\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(!obj || obj.id === $.jstree.root) { return false; }\n\t\t\tvar s = this.settings.contextmenu,\n\t\t\t\td = this.get_node(obj, true),\n\t\t\t\ta = d.children(\".jstree-anchor\"),\n\t\t\t\to = false,\n\t\t\t\ti = false;\n\t\t\tif(s.show_at_node || x === undefined || y === undefined) {\n\t\t\t\to = a.offset();\n\t\t\t\tx = o.left;\n\t\t\t\ty = o.top + this._data.core.li_height;\n\t\t\t}\n\t\t\tif(this.settings.contextmenu.select_node && !this.is_selected(obj)) {\n\t\t\t\tthis.activate_node(obj, e);\n\t\t\t}\n\n\t\t\ti = s.items;\n\t\t\tif($.isFunction(i)) {\n\t\t\t\ti = i.call(this, obj, $.proxy(function (i) {\n\t\t\t\t\tthis._show_contextmenu(obj, x, y, i);\n\t\t\t\t}, this));\n\t\t\t}\n\t\t\tif($.isPlainObject(i)) {\n\t\t\t\tthis._show_contextmenu(obj, x, y, i);\n\t\t\t}\n\t\t};\n\t\t/**\n\t\t * show the prepared context menu for a node\n\t\t * @name _show_contextmenu(obj, x, y, i)\n\t\t * @param {mixed} obj the node\n\t\t * @param {Number} x the x-coordinate relative to the document to show the menu at\n\t\t * @param {Number} y the y-coordinate relative to the document to show the menu at\n\t\t * @param {Number} i the object of items to show\n\t\t * @plugin contextmenu\n\t\t * @trigger show_contextmenu.jstree\n\t\t * @private\n\t\t */\n\t\tthis._show_contextmenu = function (obj, x, y, i) {\n\t\t\tvar d = this.get_node(obj, true),\n\t\t\t\ta = d.children(\".jstree-anchor\");\n\t\t\t$(document).one(\"context_show.vakata.jstree\", $.proxy(function (e, data) {\n\t\t\t\tvar cls = 'jstree-contextmenu jstree-' + this.get_theme() + '-contextmenu';\n\t\t\t\t$(data.element).addClass(cls);\n\t\t\t\ta.addClass('jstree-context');\n\t\t\t}, this));\n\t\t\tthis._data.contextmenu.visible = true;\n\t\t\t$.vakata.context.show(a, { 'x' : x, 'y' : y }, i);\n\t\t\t/**\n\t\t\t * triggered when the contextmenu is shown for a node\n\t\t\t * @event\n\t\t\t * @name show_contextmenu.jstree\n\t\t\t * @param {Object} node the node\n\t\t\t * @param {Number} x the x-coordinate of the menu relative to the document\n\t\t\t * @param {Number} y the y-coordinate of the menu relative to the document\n\t\t\t * @plugin contextmenu\n\t\t\t */\n\t\t\tthis.trigger('show_contextmenu', { \"node\" : obj, \"x\" : x, \"y\" : y });\n\t\t};\n\t};\n\n\t// contextmenu helper\n\t(function ($) {\n\t\tvar right_to_left = false,\n\t\t\tvakata_context = {\n\t\t\t\telement\t\t: false,\n\t\t\t\treference\t: false,\n\t\t\t\tposition_x\t: 0,\n\t\t\t\tposition_y\t: 0,\n\t\t\t\titems\t\t: [],\n\t\t\t\thtml\t\t: \"\",\n\t\t\t\tis_visible\t: false\n\t\t\t};\n\n\t\t$.vakata.context = {\n\t\t\tsettings : {\n\t\t\t\thide_onmouseleave\t: 0,\n\t\t\t\ticons\t\t\t\t: true\n\t\t\t},\n\t\t\t_trigger : function (event_name) {\n\t\t\t\t$(document).triggerHandler(\"context_\" + event_name + \".vakata\", {\n\t\t\t\t\t\"reference\"\t: vakata_context.reference,\n\t\t\t\t\t\"element\"\t: vakata_context.element,\n\t\t\t\t\t\"position\"\t: {\n\t\t\t\t\t\t\"x\" : vakata_context.position_x,\n\t\t\t\t\t\t\"y\" : vakata_context.position_y\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t\t_execute : function (i) {\n\t\t\t\ti = vakata_context.items[i];\n\t\t\t\treturn i && (!i._disabled || ($.isFunction(i._disabled) && !i._disabled({ \"item\" : i, \"reference\" : vakata_context.reference, \"element\" : vakata_context.element }))) && i.action ? i.action.call(null, {\n\t\t\t\t\t\t\t\"item\"\t\t: i,\n\t\t\t\t\t\t\t\"reference\"\t: vakata_context.reference,\n\t\t\t\t\t\t\t\"element\"\t: vakata_context.element,\n\t\t\t\t\t\t\t\"position\"\t: {\n\t\t\t\t\t\t\t\t\"x\" : vakata_context.position_x,\n\t\t\t\t\t\t\t\t\"y\" : vakata_context.position_y\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}) : false;\n\t\t\t},\n\t\t\t_parse : function (o, is_callback) {\n\t\t\t\tif(!o) { return false; }\n\t\t\t\tif(!is_callback) {\n\t\t\t\t\tvakata_context.html\t\t= \"\";\n\t\t\t\t\tvakata_context.items\t= [];\n\t\t\t\t}\n\t\t\t\tvar str = \"\",\n\t\t\t\t\tsep = false,\n\t\t\t\t\ttmp;\n\n\t\t\t\tif(is_callback) { str += \"<\"+\"ul>\"; }\n\t\t\t\t$.each(o, function (i, val) {\n\t\t\t\t\tif(!val) { return true; }\n\t\t\t\t\tvakata_context.items.push(val);\n\t\t\t\t\tif(!sep && val.separator_before) {\n\t\t\t\t\t\tstr += \"<\"+\"li class='vakata-context-separator'><\"+\"a href='#' \" + ($.vakata.context.settings.icons ? '' : 'style=\"margin-left:0px;\"') + \">&#160;<\"+\"/a><\"+\"/li>\";\n\t\t\t\t\t}\n\t\t\t\t\tsep = false;\n\t\t\t\t\tstr += \"<\"+\"li class='\" + (val._class || \"\") + (val._disabled === true || ($.isFunction(val._disabled) && val._disabled({ \"item\" : val, \"reference\" : vakata_context.reference, \"element\" : vakata_context.element })) ? \" vakata-contextmenu-disabled \" : \"\") + \"' \"+(val.shortcut?\" data-shortcut='\"+val.shortcut+\"' \":'')+\">\";\n\t\t\t\t\tstr += \"<\"+\"a href='#' rel='\" + (vakata_context.items.length - 1) + \"' \" + (val.title ? \"title='\" + val.title + \"'\" : \"\") + \">\";\n\t\t\t\t\tif($.vakata.context.settings.icons) {\n\t\t\t\t\t\tstr += \"<\"+\"i \";\n\t\t\t\t\t\tif(val.icon) {\n\t\t\t\t\t\t\tif(val.icon.indexOf(\"/\") !== -1 || val.icon.indexOf(\".\") !== -1) { str += \" style='background:url(\\\"\" + val.icon + \"\\\") center center no-repeat' \"; }\n\t\t\t\t\t\t\telse { str += \" class='\" + val.icon + \"' \"; }\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstr += \"><\"+\"/i><\"+\"span class='vakata-contextmenu-sep'>&#160;<\"+\"/span>\";\n\t\t\t\t\t}\n\t\t\t\t\tstr += ($.isFunction(val.label) ? val.label({ \"item\" : i, \"reference\" : vakata_context.reference, \"element\" : vakata_context.element }) : val.label) + (val.shortcut?' <span class=\"vakata-contextmenu-shortcut vakata-contextmenu-shortcut-'+val.shortcut+'\">'+ (val.shortcut_label || '') +'</span>':'') + \"<\"+\"/a>\";\n\t\t\t\t\tif(val.submenu) {\n\t\t\t\t\t\ttmp = $.vakata.context._parse(val.submenu, true);\n\t\t\t\t\t\tif(tmp) { str += tmp; }\n\t\t\t\t\t}\n\t\t\t\t\tstr += \"<\"+\"/li>\";\n\t\t\t\t\tif(val.separator_after) {\n\t\t\t\t\t\tstr += \"<\"+\"li class='vakata-context-separator'><\"+\"a href='#' \" + ($.vakata.context.settings.icons ? '' : 'style=\"margin-left:0px;\"') + \">&#160;<\"+\"/a><\"+\"/li>\";\n\t\t\t\t\t\tsep = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tstr  = str.replace(/<li class\\='vakata-context-separator'\\><\\/li\\>$/,\"\");\n\t\t\t\tif(is_callback) { str += \"</ul>\"; }\n\t\t\t\t/**\n\t\t\t\t * triggered on the document when the contextmenu is parsed (HTML is built)\n\t\t\t\t * @event\n\t\t\t\t * @plugin contextmenu\n\t\t\t\t * @name context_parse.vakata\n\t\t\t\t * @param {jQuery} reference the element that was right clicked\n\t\t\t\t * @param {jQuery} element the DOM element of the menu itself\n\t\t\t\t * @param {Object} position the x & y coordinates of the menu\n\t\t\t\t */\n\t\t\t\tif(!is_callback) { vakata_context.html = str; $.vakata.context._trigger(\"parse\"); }\n\t\t\t\treturn str.length > 10 ? str : false;\n\t\t\t},\n\t\t\t_show_submenu : function (o) {\n\t\t\t\to = $(o);\n\t\t\t\tif(!o.length || !o.children(\"ul\").length) { return; }\n\t\t\t\tvar e = o.children(\"ul\"),\n\t\t\t\t\txl = o.offset().left,\n\t\t\t\t\tx = xl + o.outerWidth(),\n\t\t\t\t\ty = o.offset().top,\n\t\t\t\t\tw = e.width(),\n\t\t\t\t\th = e.height(),\n\t\t\t\t\tdw = $(window).width() + $(window).scrollLeft(),\n\t\t\t\t\tdh = $(window).height() + $(window).scrollTop();\n\t\t\t\t// може да се спести е една проверка - дали няма някой от класовете вече нагоре\n\t\t\t\tif(right_to_left) {\n\t\t\t\t\to[x - (w + 10 + o.outerWidth()) < 0 ? \"addClass\" : \"removeClass\"](\"vakata-context-left\");\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\to[x + w > dw  && xl > dw - x ? \"addClass\" : \"removeClass\"](\"vakata-context-right\");\n\t\t\t\t}\n\t\t\t\tif(y + h + 10 > dh) {\n\t\t\t\t\te.css(\"bottom\",\"-1px\");\n\t\t\t\t}\n\n\t\t\t\t//if does not fit - stick it to the side\n\t\t\t\tif (o.hasClass('vakata-context-right')) {\n\t\t\t\t\tif (xl < w) {\n\t\t\t\t\t\te.css(\"margin-right\", xl - w);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (dw - x < w) {\n\t\t\t\t\t\te.css(\"margin-left\", dw - x - w);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\te.show();\n\t\t\t},\n\t\t\tshow : function (reference, position, data) {\n\t\t\t\tvar o, e, x, y, w, h, dw, dh, cond = true;\n\t\t\t\tif(vakata_context.element && vakata_context.element.length) {\n\t\t\t\t\tvakata_context.element.width('');\n\t\t\t\t}\n\t\t\t\tswitch(cond) {\n\t\t\t\t\tcase (!position && !reference):\n\t\t\t\t\t\treturn false;\n\t\t\t\t\tcase (!!position && !!reference):\n\t\t\t\t\t\tvakata_context.reference\t= reference;\n\t\t\t\t\t\tvakata_context.position_x\t= position.x;\n\t\t\t\t\t\tvakata_context.position_y\t= position.y;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase (!position && !!reference):\n\t\t\t\t\t\tvakata_context.reference\t= reference;\n\t\t\t\t\t\to = reference.offset();\n\t\t\t\t\t\tvakata_context.position_x\t= o.left + reference.outerHeight();\n\t\t\t\t\t\tvakata_context.position_y\t= o.top;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase (!!position && !reference):\n\t\t\t\t\t\tvakata_context.position_x\t= position.x;\n\t\t\t\t\t\tvakata_context.position_y\t= position.y;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif(!!reference && !data && $(reference).data('vakata_contextmenu')) {\n\t\t\t\t\tdata = $(reference).data('vakata_contextmenu');\n\t\t\t\t}\n\t\t\t\tif($.vakata.context._parse(data)) {\n\t\t\t\t\tvakata_context.element.html(vakata_context.html);\n\t\t\t\t}\n\t\t\t\tif(vakata_context.items.length) {\n\t\t\t\t\tvakata_context.element.appendTo(document.body);\n\t\t\t\t\te = vakata_context.element;\n\t\t\t\t\tx = vakata_context.position_x;\n\t\t\t\t\ty = vakata_context.position_y;\n\t\t\t\t\tw = e.width();\n\t\t\t\t\th = e.height();\n\t\t\t\t\tdw = $(window).width() + $(window).scrollLeft();\n\t\t\t\t\tdh = $(window).height() + $(window).scrollTop();\n\t\t\t\t\tif(right_to_left) {\n\t\t\t\t\t\tx -= (e.outerWidth() - $(reference).outerWidth());\n\t\t\t\t\t\tif(x < $(window).scrollLeft() + 20) {\n\t\t\t\t\t\t\tx = $(window).scrollLeft() + 20;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(x + w + 20 > dw) {\n\t\t\t\t\t\tx = dw - (w + 20);\n\t\t\t\t\t}\n\t\t\t\t\tif(y + h + 20 > dh) {\n\t\t\t\t\t\ty = dh - (h + 20);\n\t\t\t\t\t}\n\n\t\t\t\t\tvakata_context.element\n\t\t\t\t\t\t.css({ \"left\" : x, \"top\" : y })\n\t\t\t\t\t\t.show()\n\t\t\t\t\t\t.find('a').first().focus().parent().addClass(\"vakata-context-hover\");\n\t\t\t\t\tvakata_context.is_visible = true;\n\t\t\t\t\t/**\n\t\t\t\t\t * triggered on the document when the contextmenu is shown\n\t\t\t\t\t * @event\n\t\t\t\t\t * @plugin contextmenu\n\t\t\t\t\t * @name context_show.vakata\n\t\t\t\t\t * @param {jQuery} reference the element that was right clicked\n\t\t\t\t\t * @param {jQuery} element the DOM element of the menu itself\n\t\t\t\t\t * @param {Object} position the x & y coordinates of the menu\n\t\t\t\t\t */\n\t\t\t\t\t$.vakata.context._trigger(\"show\");\n\t\t\t\t}\n\t\t\t},\n\t\t\thide : function () {\n\t\t\t\tif(vakata_context.is_visible) {\n\t\t\t\t\tvakata_context.element.hide().find(\"ul\").hide().end().find(':focus').blur().end().detach();\n\t\t\t\t\tvakata_context.is_visible = false;\n\t\t\t\t\t/**\n\t\t\t\t\t * triggered on the document when the contextmenu is hidden\n\t\t\t\t\t * @event\n\t\t\t\t\t * @plugin contextmenu\n\t\t\t\t\t * @name context_hide.vakata\n\t\t\t\t\t * @param {jQuery} reference the element that was right clicked\n\t\t\t\t\t * @param {jQuery} element the DOM element of the menu itself\n\t\t\t\t\t * @param {Object} position the x & y coordinates of the menu\n\t\t\t\t\t */\n\t\t\t\t\t$.vakata.context._trigger(\"hide\");\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t$(function () {\n\t\t\tright_to_left = $(document.body).css(\"direction\") === \"rtl\";\n\t\t\tvar to = false;\n\n\t\t\tvakata_context.element = $(\"<ul class='vakata-context'></ul>\");\n\t\t\tvakata_context.element\n\t\t\t\t.on(\"mouseenter\", \"li\", function (e) {\n\t\t\t\t\te.stopImmediatePropagation();\n\n\t\t\t\t\tif($.contains(this, e.relatedTarget)) {\n\t\t\t\t\t\t// премахнато заради delegate mouseleave по-долу\n\t\t\t\t\t\t// $(this).find(\".vakata-context-hover\").removeClass(\"vakata-context-hover\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(to) { clearTimeout(to); }\n\t\t\t\t\tvakata_context.element.find(\".vakata-context-hover\").removeClass(\"vakata-context-hover\").end();\n\n\t\t\t\t\t$(this)\n\t\t\t\t\t\t.siblings().find(\"ul\").hide().end().end()\n\t\t\t\t\t\t.parentsUntil(\".vakata-context\", \"li\").addBack().addClass(\"vakata-context-hover\");\n\t\t\t\t\t$.vakata.context._show_submenu(this);\n\t\t\t\t})\n\t\t\t\t// тестово - дали не натоварва?\n\t\t\t\t.on(\"mouseleave\", \"li\", function (e) {\n\t\t\t\t\tif($.contains(this, e.relatedTarget)) { return; }\n\t\t\t\t\t$(this).find(\".vakata-context-hover\").addBack().removeClass(\"vakata-context-hover\");\n\t\t\t\t})\n\t\t\t\t.on(\"mouseleave\", function (e) {\n\t\t\t\t\t$(this).find(\".vakata-context-hover\").removeClass(\"vakata-context-hover\");\n\t\t\t\t\tif($.vakata.context.settings.hide_onmouseleave) {\n\t\t\t\t\t\tto = setTimeout(\n\t\t\t\t\t\t\t(function (t) {\n\t\t\t\t\t\t\t\treturn function () { $.vakata.context.hide(); };\n\t\t\t\t\t\t\t}(this)), $.vakata.context.settings.hide_onmouseleave);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.on(\"click\", \"a\", function (e) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t//})\n\t\t\t\t//.on(\"mouseup\", \"a\", function (e) {\n\t\t\t\t\tif(!$(this).blur().parent().hasClass(\"vakata-context-disabled\") && $.vakata.context._execute($(this).attr(\"rel\")) !== false) {\n\t\t\t\t\t\t$.vakata.context.hide();\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.on('keydown', 'a', function (e) {\n\t\t\t\t\t\tvar o = null;\n\t\t\t\t\t\tswitch(e.which) {\n\t\t\t\t\t\t\tcase 13:\n\t\t\t\t\t\t\tcase 32:\n\t\t\t\t\t\t\t\te.type = \"click\";\n\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\t$(e.currentTarget).trigger(e);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 37:\n\t\t\t\t\t\t\t\tif(vakata_context.is_visible) {\n\t\t\t\t\t\t\t\t\tvakata_context.element.find(\".vakata-context-hover\").last().closest(\"li\").first().find(\"ul\").hide().find(\".vakata-context-hover\").removeClass(\"vakata-context-hover\").end().end().children('a').focus();\n\t\t\t\t\t\t\t\t\te.stopImmediatePropagation();\n\t\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 38:\n\t\t\t\t\t\t\t\tif(vakata_context.is_visible) {\n\t\t\t\t\t\t\t\t\to = vakata_context.element.find(\"ul:visible\").addBack().last().children(\".vakata-context-hover\").removeClass(\"vakata-context-hover\").prevAll(\"li:not(.vakata-context-separator)\").first();\n\t\t\t\t\t\t\t\t\tif(!o.length) { o = vakata_context.element.find(\"ul:visible\").addBack().last().children(\"li:not(.vakata-context-separator)\").last(); }\n\t\t\t\t\t\t\t\t\to.addClass(\"vakata-context-hover\").children('a').focus();\n\t\t\t\t\t\t\t\t\te.stopImmediatePropagation();\n\t\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 39:\n\t\t\t\t\t\t\t\tif(vakata_context.is_visible) {\n\t\t\t\t\t\t\t\t\tvakata_context.element.find(\".vakata-context-hover\").last().children(\"ul\").show().children(\"li:not(.vakata-context-separator)\").removeClass(\"vakata-context-hover\").first().addClass(\"vakata-context-hover\").children('a').focus();\n\t\t\t\t\t\t\t\t\te.stopImmediatePropagation();\n\t\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 40:\n\t\t\t\t\t\t\t\tif(vakata_context.is_visible) {\n\t\t\t\t\t\t\t\t\to = vakata_context.element.find(\"ul:visible\").addBack().last().children(\".vakata-context-hover\").removeClass(\"vakata-context-hover\").nextAll(\"li:not(.vakata-context-separator)\").first();\n\t\t\t\t\t\t\t\t\tif(!o.length) { o = vakata_context.element.find(\"ul:visible\").addBack().last().children(\"li:not(.vakata-context-separator)\").first(); }\n\t\t\t\t\t\t\t\t\to.addClass(\"vakata-context-hover\").children('a').focus();\n\t\t\t\t\t\t\t\t\te.stopImmediatePropagation();\n\t\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 27:\n\t\t\t\t\t\t\t\t$.vakata.context.hide();\n\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t//console.log(e.which);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t.on('keydown', function (e) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tvar a = vakata_context.element.find('.vakata-contextmenu-shortcut-' + e.which).parent();\n\t\t\t\t\tif(a.parent().not('.vakata-context-disabled')) {\n\t\t\t\t\t\ta.click();\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t$(document)\n\t\t\t\t.on(\"mousedown.vakata.jstree\", function (e) {\n\t\t\t\t\tif(vakata_context.is_visible && vakata_context.element[0] !== e.target  && !$.contains(vakata_context.element[0], e.target)) {\n\t\t\t\t\t\t$.vakata.context.hide();\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.on(\"context_show.vakata.jstree\", function (e, data) {\n\t\t\t\t\tvakata_context.element.find(\"li:has(ul)\").children(\"a\").addClass(\"vakata-context-parent\");\n\t\t\t\t\tif(right_to_left) {\n\t\t\t\t\t\tvakata_context.element.addClass(\"vakata-context-rtl\").css(\"direction\", \"rtl\");\n\t\t\t\t\t}\n\t\t\t\t\t// also apply a RTL class?\n\t\t\t\t\tvakata_context.element.find(\"ul\").hide().end();\n\t\t\t\t});\n\t\t});\n\t}($));\n\t// $.jstree.defaults.plugins.push(\"contextmenu\");\n\n\n/**\n * ### Drag'n'drop plugin\n *\n * Enables dragging and dropping of nodes in the tree, resulting in a move or copy operations.\n */\n\n\t/**\n\t * stores all defaults for the drag'n'drop plugin\n\t * @name $.jstree.defaults.dnd\n\t * @plugin dnd\n\t */\n\t$.jstree.defaults.dnd = {\n\t\t/**\n\t\t * a boolean indicating if a copy should be possible while dragging (by pressint the meta key or Ctrl). Defaults to `true`.\n\t\t * @name $.jstree.defaults.dnd.copy\n\t\t * @plugin dnd\n\t\t */\n\t\tcopy : true,\n\t\t/**\n\t\t * a number indicating how long a node should remain hovered while dragging to be opened. Defaults to `500`.\n\t\t * @name $.jstree.defaults.dnd.open_timeout\n\t\t * @plugin dnd\n\t\t */\n\t\topen_timeout : 500,\n\t\t/**\n\t\t * a function invoked each time a node is about to be dragged, invoked in the tree's scope and receives the nodes about to be dragged as an argument (array) and the event that started the drag - return `false` to prevent dragging\n\t\t * @name $.jstree.defaults.dnd.is_draggable\n\t\t * @plugin dnd\n\t\t */\n\t\tis_draggable : true,\n\t\t/**\n\t\t * a boolean indicating if checks should constantly be made while the user is dragging the node (as opposed to checking only on drop), default is `true`\n\t\t * @name $.jstree.defaults.dnd.check_while_dragging\n\t\t * @plugin dnd\n\t\t */\n\t\tcheck_while_dragging : true,\n\t\t/**\n\t\t * a boolean indicating if nodes from this tree should only be copied with dnd (as opposed to moved), default is `false`\n\t\t * @name $.jstree.defaults.dnd.always_copy\n\t\t * @plugin dnd\n\t\t */\n\t\talways_copy : false,\n\t\t/**\n\t\t * when dropping a node \"inside\", this setting indicates the position the node should go to - it can be an integer or a string: \"first\" (same as 0) or \"last\", default is `0`\n\t\t * @name $.jstree.defaults.dnd.inside_pos\n\t\t * @plugin dnd\n\t\t */\n\t\tinside_pos : 0,\n\t\t/**\n\t\t * when starting the drag on a node that is selected this setting controls if all selected nodes are dragged or only the single node, default is `true`, which means all selected nodes are dragged when the drag is started on a selected node\n\t\t * @name $.jstree.defaults.dnd.drag_selection\n\t\t * @plugin dnd\n\t\t */\n\t\tdrag_selection : true,\n\t\t/**\n\t\t * controls whether dnd works on touch devices. If left as boolean true dnd will work the same as in desktop browsers, which in some cases may impair scrolling. If set to boolean false dnd will not work on touch devices. There is a special third option - string \"selected\" which means only selected nodes can be dragged on touch devices.\n\t\t * @name $.jstree.defaults.dnd.touch\n\t\t * @plugin dnd\n\t\t */\n\t\ttouch : true,\n\t\t/**\n\t\t * controls whether items can be dropped anywhere on the node, not just on the anchor, by default only the node anchor is a valid drop target. Works best with the wholerow plugin. If enabled on mobile depending on the interface it might be hard for the user to cancel the drop, since the whole tree container will be a valid drop target.\n\t\t * @name $.jstree.defaults.dnd.large_drop_target\n\t\t * @plugin dnd\n\t\t */\n\t\tlarge_drop_target : false,\n\t\t/**\n\t\t * controls whether a drag can be initiated from any part of the node and not just the text/icon part, works best with the wholerow plugin. Keep in mind it can cause problems with tree scrolling on mobile depending on the interface - in that case set the touch option to \"selected\".\n\t\t * @name $.jstree.defaults.dnd.large_drag_target\n\t\t * @plugin dnd\n\t\t */\n\t\tlarge_drag_target : false,\n\t\t/**\n\t\t * controls whether use HTML5 dnd api instead of classical. That will allow better integration of dnd events with other HTML5 controls.\n\t\t * @reference http://caniuse.com/#feat=dragndrop\n\t\t * @name $.jstree.defaults.dnd.use_html5\n\t\t * @plugin dnd\n\t\t */\n\t\tuse_html5: false\n\t};\n\tvar drg, elm;\n\t// TODO: now check works by checking for each node individually, how about max_children, unique, etc?\n\t$.jstree.plugins.dnd = function (options, parent) {\n\t\tthis.init = function (el, options) {\n\t\t\tparent.init.call(this, el, options);\n\t\t\tthis.settings.dnd.use_html5 = this.settings.dnd.use_html5 && ('draggable' in document.createElement('span'));\n\t\t};\n\t\tthis.bind = function () {\n\t\t\tparent.bind.call(this);\n\n\t\t\tthis.element\n\t\t\t\t.on(this.settings.dnd.use_html5 ? 'dragstart.jstree' : 'mousedown.jstree touchstart.jstree', this.settings.dnd.large_drag_target ? '.jstree-node' : '.jstree-anchor', $.proxy(function (e) {\n\t\t\t\t\t\tif(this.settings.dnd.large_drag_target && $(e.target).closest('.jstree-node')[0] !== e.currentTarget) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(e.type === \"touchstart\" && (!this.settings.dnd.touch || (this.settings.dnd.touch === 'selected' && !$(e.currentTarget).closest('.jstree-node').children('.jstree-anchor').hasClass('jstree-clicked')))) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar obj = this.get_node(e.target),\n\t\t\t\t\t\t\tmlt = this.is_selected(obj) && this.settings.dnd.drag_selection ? this.get_top_selected().length : 1,\n\t\t\t\t\t\t\ttxt = (mlt > 1 ? mlt + ' ' + this.get_string('nodes') : this.get_text(e.currentTarget));\n\t\t\t\t\t\tif(this.settings.core.force_text) {\n\t\t\t\t\t\t\ttxt = $.vakata.html.escape(txt);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(obj && obj.id && obj.id !== $.jstree.root && (e.which === 1 || e.type === \"touchstart\" || e.type === \"dragstart\") &&\n\t\t\t\t\t\t\t(this.settings.dnd.is_draggable === true || ($.isFunction(this.settings.dnd.is_draggable) && this.settings.dnd.is_draggable.call(this, (mlt > 1 ? this.get_top_selected(true) : [obj]), e)))\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tdrg = { 'jstree' : true, 'origin' : this, 'obj' : this.get_node(obj,true), 'nodes' : mlt > 1 ? this.get_top_selected() : [obj.id] };\n\t\t\t\t\t\t\telm = e.currentTarget;\n\t\t\t\t\t\t\tif (this.settings.dnd.use_html5) {\n\t\t\t\t\t\t\t\t$.vakata.dnd._trigger('start', e, { 'helper': $(), 'element': elm, 'data': drg });\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.element.trigger('mousedown.jstree');\n\t\t\t\t\t\t\t\treturn $.vakata.dnd.start(e, drg, '<div id=\"jstree-dnd\" class=\"jstree-' + this.get_theme() + ' jstree-' + this.get_theme() + '-' + this.get_theme_variant() + ' ' + ( this.settings.core.themes.responsive ? ' jstree-dnd-responsive' : '' ) + '\"><i class=\"jstree-icon jstree-er\"></i>' + txt + '<ins class=\"jstree-copy\" style=\"display:none;\">+</ins></div>');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}, this));\n\t\t\tif (this.settings.dnd.use_html5) {\n\t\t\t\tthis.element\n\t\t\t\t\t.on('dragover.jstree', function (e) {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t$.vakata.dnd._trigger('move', e, { 'helper': $(), 'element': elm, 'data': drg });\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t})\n\t\t\t\t\t//.on('dragenter.jstree', this.settings.dnd.large_drop_target ? '.jstree-node' : '.jstree-anchor', $.proxy(function (e) {\n\t\t\t\t\t//\t\te.preventDefault();\n\t\t\t\t\t//\t\t$.vakata.dnd._trigger('move', e, { 'helper': $(), 'element': elm, 'data': drg });\n\t\t\t\t\t//\t\treturn false;\n\t\t\t\t\t//\t}, this))\n\t\t\t\t\t.on('drop.jstree', $.proxy(function (e) {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t$.vakata.dnd._trigger('stop', e, { 'helper': $(), 'element': elm, 'data': drg });\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}, this));\n\t\t\t}\n\t\t};\n\t\tthis.redraw_node = function(obj, deep, callback, force_render) {\n\t\t\tobj = parent.redraw_node.apply(this, arguments);\n\t\t\tif (obj && this.settings.dnd.use_html5) {\n\t\t\t\tif (this.settings.dnd.large_drag_target) {\n\t\t\t\t\tobj.setAttribute('draggable', true);\n\t\t\t\t} else {\n\t\t\t\t\tvar i, j, tmp = null;\n\t\t\t\t\tfor(i = 0, j = obj.childNodes.length; i < j; i++) {\n\t\t\t\t\t\tif(obj.childNodes[i] && obj.childNodes[i].className && obj.childNodes[i].className.indexOf(\"jstree-anchor\") !== -1) {\n\t\t\t\t\t\t\ttmp = obj.childNodes[i];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(tmp) {\n\t\t\t\t\t\ttmp.setAttribute('draggable', true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn obj;\n\t\t};\n\t};\n\n\t$(function() {\n\t\t// bind only once for all instances\n\t\tvar lastmv = false,\n\t\t\tlaster = false,\n\t\t\tlastev = false,\n\t\t\topento = false,\n\t\t\tmarker = $('<div id=\"jstree-marker\">&#160;</div>').hide(); //.appendTo('body');\n\n\t\t$(document)\n\t\t\t.on('dragover.vakata.jstree', function (e) {\n\t\t\t\tif (elm) {\n\t\t\t\t\t$.vakata.dnd._trigger('move', e, { 'helper': $(), 'element': elm, 'data': drg });\n\t\t\t\t}\n\t\t\t})\n\t\t\t.on('drop.vakata.jstree', function (e) {\n\t\t\t\tif (elm) {\n\t\t\t\t\t$.vakata.dnd._trigger('stop', e, { 'helper': $(), 'element': elm, 'data': drg });\n\t\t\t\t\telm = null;\n\t\t\t\t\tdrg = null;\n\t\t\t\t}\n\t\t\t})\n\t\t\t.on('dnd_start.vakata.jstree', function (e, data) {\n\t\t\t\tlastmv = false;\n\t\t\t\tlastev = false;\n\t\t\t\tif(!data || !data.data || !data.data.jstree) { return; }\n\t\t\t\tmarker.appendTo(document.body); //.show();\n\t\t\t})\n\t\t\t.on('dnd_move.vakata.jstree', function (e, data) {\n\t\t\t\tvar isDifferentNode = data.event.target !== lastev.target;\n\t\t\t\tif(opento) {\n\t\t\t\t\tif (!data.event || data.event.type !== 'dragover' || isDifferentNode) {\n\t\t\t\t\t\tclearTimeout(opento);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(!data || !data.data || !data.data.jstree) { return; }\n\n\t\t\t\t// if we are hovering the marker image do nothing (can happen on \"inside\" drags)\n\t\t\t\tif(data.event.target.id && data.event.target.id === 'jstree-marker') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tlastev = data.event;\n\n\t\t\t\tvar ins = $.jstree.reference(data.event.target),\n\t\t\t\t\tref = false,\n\t\t\t\t\toff = false,\n\t\t\t\t\trel = false,\n\t\t\t\t\ttmp, l, t, h, p, i, o, ok, t1, t2, op, ps, pr, ip, tm, is_copy, pn;\n\t\t\t\t// if we are over an instance\n\t\t\t\tif(ins && ins._data && ins._data.dnd) {\n\t\t\t\t\tmarker.attr('class', 'jstree-' + ins.get_theme() + ( ins.settings.core.themes.responsive ? ' jstree-dnd-responsive' : '' ));\n\t\t\t\t\tis_copy = data.data.origin && (data.data.origin.settings.dnd.always_copy || (data.data.origin.settings.dnd.copy && (data.event.metaKey || data.event.ctrlKey)));\n\t\t\t\t\tdata.helper\n\t\t\t\t\t\t.children().attr('class', 'jstree-' + ins.get_theme() + ' jstree-' + ins.get_theme() + '-' + ins.get_theme_variant() + ' ' + ( ins.settings.core.themes.responsive ? ' jstree-dnd-responsive' : '' ))\n\t\t\t\t\t\t.find('.jstree-copy').first()[ is_copy ? 'show' : 'hide' ]();\n\n\t\t\t\t\t// if are hovering the container itself add a new root node\n\t\t\t\t\t//console.log(data.event);\n\t\t\t\t\tif( (data.event.target === ins.element[0] || data.event.target === ins.get_container_ul()[0]) && ins.get_container_ul().children().length === 0) {\n\t\t\t\t\t\tok = true;\n\t\t\t\t\t\tfor(t1 = 0, t2 = data.data.nodes.length; t1 < t2; t1++) {\n\t\t\t\t\t\t\tok = ok && ins.check( (data.data.origin && (data.data.origin.settings.dnd.always_copy || (data.data.origin.settings.dnd.copy && (data.event.metaKey || data.event.ctrlKey)) ) ? \"copy_node\" : \"move_node\"), (data.data.origin && data.data.origin !== ins ? data.data.origin.get_node(data.data.nodes[t1]) : data.data.nodes[t1]), $.jstree.root, 'last', { 'dnd' : true, 'ref' : ins.get_node($.jstree.root), 'pos' : 'i', 'origin' : data.data.origin, 'is_multi' : (data.data.origin && data.data.origin !== ins), 'is_foreign' : (!data.data.origin) });\n\t\t\t\t\t\t\tif(!ok) { break; }\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(ok) {\n\t\t\t\t\t\t\tlastmv = { 'ins' : ins, 'par' : $.jstree.root, 'pos' : 'last' };\n\t\t\t\t\t\t\tmarker.hide();\n\t\t\t\t\t\t\tdata.helper.find('.jstree-icon').first().removeClass('jstree-er').addClass('jstree-ok');\n\t\t\t\t\t\t\tif (data.event.originalEvent && data.event.originalEvent.dataTransfer) {\n\t\t\t\t\t\t\t\tdata.event.originalEvent.dataTransfer.dropEffect = is_copy ? 'copy' : 'move';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// if we are hovering a tree node\n\t\t\t\t\t\tref = ins.settings.dnd.large_drop_target ? $(data.event.target).closest('.jstree-node').children('.jstree-anchor') : $(data.event.target).closest('.jstree-anchor');\n\t\t\t\t\t\tif(ref && ref.length && ref.parent().is('.jstree-closed, .jstree-open, .jstree-leaf')) {\n\t\t\t\t\t\t\toff = ref.offset();\n\t\t\t\t\t\t\trel = (data.event.pageY !== undefined ? data.event.pageY : data.event.originalEvent.pageY) - off.top;\n\t\t\t\t\t\t\th = ref.outerHeight();\n\t\t\t\t\t\t\tif(rel < h / 3) {\n\t\t\t\t\t\t\t\to = ['b', 'i', 'a'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if(rel > h - h / 3) {\n\t\t\t\t\t\t\t\to = ['a', 'i', 'b'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\to = rel > h / 2 ? ['i', 'a', 'b'] : ['i', 'b', 'a'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$.each(o, function (j, v) {\n\t\t\t\t\t\t\t\tswitch(v) {\n\t\t\t\t\t\t\t\t\tcase 'b':\n\t\t\t\t\t\t\t\t\t\tl = off.left - 6;\n\t\t\t\t\t\t\t\t\t\tt = off.top;\n\t\t\t\t\t\t\t\t\t\tp = ins.get_parent(ref);\n\t\t\t\t\t\t\t\t\t\ti = ref.parent().index();\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase 'i':\n\t\t\t\t\t\t\t\t\t\tip = ins.settings.dnd.inside_pos;\n\t\t\t\t\t\t\t\t\t\ttm = ins.get_node(ref.parent());\n\t\t\t\t\t\t\t\t\t\tl = off.left - 2;\n\t\t\t\t\t\t\t\t\t\tt = off.top + h / 2 + 1;\n\t\t\t\t\t\t\t\t\t\tp = tm.id;\n\t\t\t\t\t\t\t\t\t\ti = ip === 'first' ? 0 : (ip === 'last' ? tm.children.length : Math.min(ip, tm.children.length));\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase 'a':\n\t\t\t\t\t\t\t\t\t\tl = off.left - 6;\n\t\t\t\t\t\t\t\t\t\tt = off.top + h;\n\t\t\t\t\t\t\t\t\t\tp = ins.get_parent(ref);\n\t\t\t\t\t\t\t\t\t\ti = ref.parent().index() + 1;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tok = true;\n\t\t\t\t\t\t\t\tfor(t1 = 0, t2 = data.data.nodes.length; t1 < t2; t1++) {\n\t\t\t\t\t\t\t\t\top = data.data.origin && (data.data.origin.settings.dnd.always_copy || (data.data.origin.settings.dnd.copy && (data.event.metaKey || data.event.ctrlKey))) ? \"copy_node\" : \"move_node\";\n\t\t\t\t\t\t\t\t\tps = i;\n\t\t\t\t\t\t\t\t\tif(op === \"move_node\" && v === 'a' && (data.data.origin && data.data.origin === ins) && p === ins.get_parent(data.data.nodes[t1])) {\n\t\t\t\t\t\t\t\t\t\tpr = ins.get_node(p);\n\t\t\t\t\t\t\t\t\t\tif(ps > $.inArray(data.data.nodes[t1], pr.children)) {\n\t\t\t\t\t\t\t\t\t\t\tps -= 1;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tok = ok && ( (ins && ins.settings && ins.settings.dnd && ins.settings.dnd.check_while_dragging === false) || ins.check(op, (data.data.origin && data.data.origin !== ins ? data.data.origin.get_node(data.data.nodes[t1]) : data.data.nodes[t1]), p, ps, { 'dnd' : true, 'ref' : ins.get_node(ref.parent()), 'pos' : v, 'origin' : data.data.origin, 'is_multi' : (data.data.origin && data.data.origin !== ins), 'is_foreign' : (!data.data.origin) }) );\n\t\t\t\t\t\t\t\t\tif(!ok) {\n\t\t\t\t\t\t\t\t\t\tif(ins && ins.last_error) { laster = ins.last_error(); }\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(v === 'i' && ref.parent().is('.jstree-closed') && ins.settings.dnd.open_timeout) {\n\t\t\t\t\t\t\t\t\tif (!data.event || data.event.type !== 'dragover' || isDifferentNode) {\n\t\t\t\t\t\t\t\t\t\tif (opento) { clearTimeout(opento); }\n\t\t\t\t\t\t\t\t\t\topento = setTimeout((function (x, z) { return function () { x.open_node(z); }; }(ins, ref)), ins.settings.dnd.open_timeout);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(ok) {\n\t\t\t\t\t\t\t\t\tpn = ins.get_node(p, true);\n\t\t\t\t\t\t\t\t\tif (!pn.hasClass('.jstree-dnd-parent')) {\n\t\t\t\t\t\t\t\t\t\t$('.jstree-dnd-parent').removeClass('jstree-dnd-parent');\n\t\t\t\t\t\t\t\t\t\tpn.addClass('jstree-dnd-parent');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tlastmv = { 'ins' : ins, 'par' : p, 'pos' : v === 'i' && ip === 'last' && i === 0 && !ins.is_loaded(tm) ? 'last' : i };\n\t\t\t\t\t\t\t\t\tmarker.css({ 'left' : l + 'px', 'top' : t + 'px' }).show();\n\t\t\t\t\t\t\t\t\tdata.helper.find('.jstree-icon').first().removeClass('jstree-er').addClass('jstree-ok');\n\t\t\t\t\t\t\t\t\tif (data.event.originalEvent && data.event.originalEvent.dataTransfer) {\n\t\t\t\t\t\t\t\t\t\tdata.event.originalEvent.dataTransfer.dropEffect = is_copy ? 'copy' : 'move';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tlaster = {};\n\t\t\t\t\t\t\t\t\to = true;\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tif(o === true) { return; }\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$('.jstree-dnd-parent').removeClass('jstree-dnd-parent');\n\t\t\t\tlastmv = false;\n\t\t\t\tdata.helper.find('.jstree-icon').removeClass('jstree-ok').addClass('jstree-er');\n\t\t\t\tif (data.event.originalEvent && data.event.originalEvent.dataTransfer) {\n\t\t\t\t\t//data.event.originalEvent.dataTransfer.dropEffect = 'none';\n\t\t\t\t}\n\t\t\t\tmarker.hide();\n\t\t\t})\n\t\t\t.on('dnd_scroll.vakata.jstree', function (e, data) {\n\t\t\t\tif(!data || !data.data || !data.data.jstree) { return; }\n\t\t\t\tmarker.hide();\n\t\t\t\tlastmv = false;\n\t\t\t\tlastev = false;\n\t\t\t\tdata.helper.find('.jstree-icon').first().removeClass('jstree-ok').addClass('jstree-er');\n\t\t\t})\n\t\t\t.on('dnd_stop.vakata.jstree', function (e, data) {\n\t\t\t\t$('.jstree-dnd-parent').removeClass('jstree-dnd-parent');\n\t\t\t\tif(opento) { clearTimeout(opento); }\n\t\t\t\tif(!data || !data.data || !data.data.jstree) { return; }\n\t\t\t\tmarker.hide().detach();\n\t\t\t\tvar i, j, nodes = [];\n\t\t\t\tif(lastmv) {\n\t\t\t\t\tfor(i = 0, j = data.data.nodes.length; i < j; i++) {\n\t\t\t\t\t\tnodes[i] = data.data.origin ? data.data.origin.get_node(data.data.nodes[i]) : data.data.nodes[i];\n\t\t\t\t\t}\n\t\t\t\t\tlastmv.ins[ data.data.origin && (data.data.origin.settings.dnd.always_copy || (data.data.origin.settings.dnd.copy && (data.event.metaKey || data.event.ctrlKey))) ? 'copy_node' : 'move_node' ](nodes, lastmv.par, lastmv.pos, false, false, false, data.data.origin);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ti = $(data.event.target).closest('.jstree');\n\t\t\t\t\tif(i.length && laster && laster.error && laster.error === 'check') {\n\t\t\t\t\t\ti = i.jstree(true);\n\t\t\t\t\t\tif(i) {\n\t\t\t\t\t\t\ti.settings.core.error.call(this, laster);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlastev = false;\n\t\t\t\tlastmv = false;\n\t\t\t})\n\t\t\t.on('keyup.jstree keydown.jstree', function (e, data) {\n\t\t\t\tdata = $.vakata.dnd._get();\n\t\t\t\tif(data && data.data && data.data.jstree) {\n\t\t\t\t\tif (e.type === \"keyup\" && e.which === 27) {\n\t\t\t\t\t\tif (opento) { clearTimeout(opento); }\n\t\t\t\t\t\tlastmv = false;\n\t\t\t\t\t\tlaster = false;\n\t\t\t\t\t\tlastev = false;\n\t\t\t\t\t\topento = false;\n\t\t\t\t\t\tmarker.hide().detach();\n\t\t\t\t\t\t$.vakata.dnd._clean();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdata.helper.find('.jstree-copy').first()[ data.data.origin && (data.data.origin.settings.dnd.always_copy || (data.data.origin.settings.dnd.copy && (e.metaKey || e.ctrlKey))) ? 'show' : 'hide' ]();\n\t\t\t\t\t\tif(lastev) {\n\t\t\t\t\t\t\tlastev.metaKey = e.metaKey;\n\t\t\t\t\t\t\tlastev.ctrlKey = e.ctrlKey;\n\t\t\t\t\t\t\t$.vakata.dnd._trigger('move', lastev);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t});\n\n\t// helpers\n\t(function ($) {\n\t\t$.vakata.html = {\n\t\t\tdiv : $('<div />'),\n\t\t\tescape : function (str) {\n\t\t\t\treturn $.vakata.html.div.text(str).html();\n\t\t\t},\n\t\t\tstrip : function (str) {\n\t\t\t\treturn $.vakata.html.div.empty().append($.parseHTML(str)).text();\n\t\t\t}\n\t\t};\n\t\t// private variable\n\t\tvar vakata_dnd = {\n\t\t\telement\t: false,\n\t\t\ttarget\t: false,\n\t\t\tis_down\t: false,\n\t\t\tis_drag\t: false,\n\t\t\thelper\t: false,\n\t\t\thelper_w: 0,\n\t\t\tdata\t: false,\n\t\t\tinit_x\t: 0,\n\t\t\tinit_y\t: 0,\n\t\t\tscroll_l: 0,\n\t\t\tscroll_t: 0,\n\t\t\tscroll_e: false,\n\t\t\tscroll_i: false,\n\t\t\tis_touch: false\n\t\t};\n\t\t$.vakata.dnd = {\n\t\t\tsettings : {\n\t\t\t\tscroll_speed\t\t: 10,\n\t\t\t\tscroll_proximity\t: 20,\n\t\t\t\thelper_left\t\t\t: 5,\n\t\t\t\thelper_top\t\t\t: 10,\n\t\t\t\tthreshold\t\t\t: 5,\n\t\t\t\tthreshold_touch\t\t: 10\n\t\t\t},\n\t\t\t_trigger : function (event_name, e, data) {\n\t\t\t\tif (data === undefined) {\n\t\t\t\t\tdata = $.vakata.dnd._get();\n\t\t\t\t}\n\t\t\t\tdata.event = e;\n\t\t\t\t$(document).triggerHandler(\"dnd_\" + event_name + \".vakata\", data);\n\t\t\t},\n\t\t\t_get : function () {\n\t\t\t\treturn {\n\t\t\t\t\t\"data\"\t\t: vakata_dnd.data,\n\t\t\t\t\t\"element\"\t: vakata_dnd.element,\n\t\t\t\t\t\"helper\"\t: vakata_dnd.helper\n\t\t\t\t};\n\t\t\t},\n\t\t\t_clean : function () {\n\t\t\t\tif(vakata_dnd.helper) { vakata_dnd.helper.remove(); }\n\t\t\t\tif(vakata_dnd.scroll_i) { clearInterval(vakata_dnd.scroll_i); vakata_dnd.scroll_i = false; }\n\t\t\t\tvakata_dnd = {\n\t\t\t\t\telement\t: false,\n\t\t\t\t\ttarget\t: false,\n\t\t\t\t\tis_down\t: false,\n\t\t\t\t\tis_drag\t: false,\n\t\t\t\t\thelper\t: false,\n\t\t\t\t\thelper_w: 0,\n\t\t\t\t\tdata\t: false,\n\t\t\t\t\tinit_x\t: 0,\n\t\t\t\t\tinit_y\t: 0,\n\t\t\t\t\tscroll_l: 0,\n\t\t\t\t\tscroll_t: 0,\n\t\t\t\t\tscroll_e: false,\n\t\t\t\t\tscroll_i: false,\n\t\t\t\t\tis_touch: false\n\t\t\t\t};\n\t\t\t\t$(document).off(\"mousemove.vakata.jstree touchmove.vakata.jstree\", $.vakata.dnd.drag);\n\t\t\t\t$(document).off(\"mouseup.vakata.jstree touchend.vakata.jstree\", $.vakata.dnd.stop);\n\t\t\t},\n\t\t\t_scroll : function (init_only) {\n\t\t\t\tif(!vakata_dnd.scroll_e || (!vakata_dnd.scroll_l && !vakata_dnd.scroll_t)) {\n\t\t\t\t\tif(vakata_dnd.scroll_i) { clearInterval(vakata_dnd.scroll_i); vakata_dnd.scroll_i = false; }\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif(!vakata_dnd.scroll_i) {\n\t\t\t\t\tvakata_dnd.scroll_i = setInterval($.vakata.dnd._scroll, 100);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif(init_only === true) { return false; }\n\n\t\t\t\tvar i = vakata_dnd.scroll_e.scrollTop(),\n\t\t\t\t\tj = vakata_dnd.scroll_e.scrollLeft();\n\t\t\t\tvakata_dnd.scroll_e.scrollTop(i + vakata_dnd.scroll_t * $.vakata.dnd.settings.scroll_speed);\n\t\t\t\tvakata_dnd.scroll_e.scrollLeft(j + vakata_dnd.scroll_l * $.vakata.dnd.settings.scroll_speed);\n\t\t\t\tif(i !== vakata_dnd.scroll_e.scrollTop() || j !== vakata_dnd.scroll_e.scrollLeft()) {\n\t\t\t\t\t/**\n\t\t\t\t\t * triggered on the document when a drag causes an element to scroll\n\t\t\t\t\t * @event\n\t\t\t\t\t * @plugin dnd\n\t\t\t\t\t * @name dnd_scroll.vakata\n\t\t\t\t\t * @param {Mixed} data any data supplied with the call to $.vakata.dnd.start\n\t\t\t\t\t * @param {DOM} element the DOM element being dragged\n\t\t\t\t\t * @param {jQuery} helper the helper shown next to the mouse\n\t\t\t\t\t * @param {jQuery} event the element that is scrolling\n\t\t\t\t\t */\n\t\t\t\t\t$.vakata.dnd._trigger(\"scroll\", vakata_dnd.scroll_e);\n\t\t\t\t}\n\t\t\t},\n\t\t\tstart : function (e, data, html) {\n\t\t\t\tif(e.type === \"touchstart\" && e.originalEvent && e.originalEvent.changedTouches && e.originalEvent.changedTouches[0]) {\n\t\t\t\t\te.pageX = e.originalEvent.changedTouches[0].pageX;\n\t\t\t\t\te.pageY = e.originalEvent.changedTouches[0].pageY;\n\t\t\t\t\te.target = document.elementFromPoint(e.originalEvent.changedTouches[0].pageX - window.pageXOffset, e.originalEvent.changedTouches[0].pageY - window.pageYOffset);\n\t\t\t\t}\n\t\t\t\tif(vakata_dnd.is_drag) { $.vakata.dnd.stop({}); }\n\t\t\t\ttry {\n\t\t\t\t\te.currentTarget.unselectable = \"on\";\n\t\t\t\t\te.currentTarget.onselectstart = function() { return false; };\n\t\t\t\t\tif(e.currentTarget.style) {\n\t\t\t\t\t\te.currentTarget.style.touchAction = \"none\";\n\t\t\t\t\t\te.currentTarget.style.msTouchAction = \"none\";\n\t\t\t\t\t\te.currentTarget.style.MozUserSelect = \"none\";\n\t\t\t\t\t}\n\t\t\t\t} catch(ignore) { }\n\t\t\t\tvakata_dnd.init_x\t= e.pageX;\n\t\t\t\tvakata_dnd.init_y\t= e.pageY;\n\t\t\t\tvakata_dnd.data\t\t= data;\n\t\t\t\tvakata_dnd.is_down\t= true;\n\t\t\t\tvakata_dnd.element\t= e.currentTarget;\n\t\t\t\tvakata_dnd.target\t= e.target;\n\t\t\t\tvakata_dnd.is_touch\t= e.type === \"touchstart\";\n\t\t\t\tif(html !== false) {\n\t\t\t\t\tvakata_dnd.helper = $(\"<div id='vakata-dnd'></div>\").html(html).css({\n\t\t\t\t\t\t\"display\"\t\t: \"block\",\n\t\t\t\t\t\t\"margin\"\t\t: \"0\",\n\t\t\t\t\t\t\"padding\"\t\t: \"0\",\n\t\t\t\t\t\t\"position\"\t\t: \"absolute\",\n\t\t\t\t\t\t\"top\"\t\t\t: \"-2000px\",\n\t\t\t\t\t\t\"lineHeight\"\t: \"16px\",\n\t\t\t\t\t\t\"zIndex\"\t\t: \"10000\"\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t$(document).on(\"mousemove.vakata.jstree touchmove.vakata.jstree\", $.vakata.dnd.drag);\n\t\t\t\t$(document).on(\"mouseup.vakata.jstree touchend.vakata.jstree\", $.vakata.dnd.stop);\n\t\t\t\treturn false;\n\t\t\t},\n\t\t\tdrag : function (e) {\n\t\t\t\tif(e.type === \"touchmove\" && e.originalEvent && e.originalEvent.changedTouches && e.originalEvent.changedTouches[0]) {\n\t\t\t\t\te.pageX = e.originalEvent.changedTouches[0].pageX;\n\t\t\t\t\te.pageY = e.originalEvent.changedTouches[0].pageY;\n\t\t\t\t\te.target = document.elementFromPoint(e.originalEvent.changedTouches[0].pageX - window.pageXOffset, e.originalEvent.changedTouches[0].pageY - window.pageYOffset);\n\t\t\t\t}\n\t\t\t\tif(!vakata_dnd.is_down) { return; }\n\t\t\t\tif(!vakata_dnd.is_drag) {\n\t\t\t\t\tif(\n\t\t\t\t\t\tMath.abs(e.pageX - vakata_dnd.init_x) > (vakata_dnd.is_touch ? $.vakata.dnd.settings.threshold_touch : $.vakata.dnd.settings.threshold) ||\n\t\t\t\t\t\tMath.abs(e.pageY - vakata_dnd.init_y) > (vakata_dnd.is_touch ? $.vakata.dnd.settings.threshold_touch : $.vakata.dnd.settings.threshold)\n\t\t\t\t\t) {\n\t\t\t\t\t\tif(vakata_dnd.helper) {\n\t\t\t\t\t\t\tvakata_dnd.helper.appendTo(document.body);\n\t\t\t\t\t\t\tvakata_dnd.helper_w = vakata_dnd.helper.outerWidth();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvakata_dnd.is_drag = true;\n\t\t\t\t\t\t$(vakata_dnd.target).one('click.vakata', false);\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * triggered on the document when a drag starts\n\t\t\t\t\t\t * @event\n\t\t\t\t\t\t * @plugin dnd\n\t\t\t\t\t\t * @name dnd_start.vakata\n\t\t\t\t\t\t * @param {Mixed} data any data supplied with the call to $.vakata.dnd.start\n\t\t\t\t\t\t * @param {DOM} element the DOM element being dragged\n\t\t\t\t\t\t * @param {jQuery} helper the helper shown next to the mouse\n\t\t\t\t\t\t * @param {Object} event the event that caused the start (probably mousemove)\n\t\t\t\t\t\t */\n\t\t\t\t\t\t$.vakata.dnd._trigger(\"start\", e);\n\t\t\t\t\t}\n\t\t\t\t\telse { return; }\n\t\t\t\t}\n\n\t\t\t\tvar d  = false, w  = false,\n\t\t\t\t\tdh = false, wh = false,\n\t\t\t\t\tdw = false, ww = false,\n\t\t\t\t\tdt = false, dl = false,\n\t\t\t\t\tht = false, hl = false;\n\n\t\t\t\tvakata_dnd.scroll_t = 0;\n\t\t\t\tvakata_dnd.scroll_l = 0;\n\t\t\t\tvakata_dnd.scroll_e = false;\n\t\t\t\t$($(e.target).parentsUntil(\"body\").addBack().get().reverse())\n\t\t\t\t\t.filter(function () {\n\t\t\t\t\t\treturn\t(/^auto|scroll$/).test($(this).css(\"overflow\")) &&\n\t\t\t\t\t\t\t\t(this.scrollHeight > this.offsetHeight || this.scrollWidth > this.offsetWidth);\n\t\t\t\t\t})\n\t\t\t\t\t.each(function () {\n\t\t\t\t\t\tvar t = $(this), o = t.offset();\n\t\t\t\t\t\tif(this.scrollHeight > this.offsetHeight) {\n\t\t\t\t\t\t\tif(o.top + t.height() - e.pageY < $.vakata.dnd.settings.scroll_proximity)\t{ vakata_dnd.scroll_t = 1; }\n\t\t\t\t\t\t\tif(e.pageY - o.top < $.vakata.dnd.settings.scroll_proximity)\t\t\t\t{ vakata_dnd.scroll_t = -1; }\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(this.scrollWidth > this.offsetWidth) {\n\t\t\t\t\t\t\tif(o.left + t.width() - e.pageX < $.vakata.dnd.settings.scroll_proximity)\t{ vakata_dnd.scroll_l = 1; }\n\t\t\t\t\t\t\tif(e.pageX - o.left < $.vakata.dnd.settings.scroll_proximity)\t\t\t\t{ vakata_dnd.scroll_l = -1; }\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(vakata_dnd.scroll_t || vakata_dnd.scroll_l) {\n\t\t\t\t\t\t\tvakata_dnd.scroll_e = $(this);\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\tif(!vakata_dnd.scroll_e) {\n\t\t\t\t\td  = $(document); w = $(window);\n\t\t\t\t\tdh = d.height(); wh = w.height();\n\t\t\t\t\tdw = d.width(); ww = w.width();\n\t\t\t\t\tdt = d.scrollTop(); dl = d.scrollLeft();\n\t\t\t\t\tif(dh > wh && e.pageY - dt < $.vakata.dnd.settings.scroll_proximity)\t\t{ vakata_dnd.scroll_t = -1;  }\n\t\t\t\t\tif(dh > wh && wh - (e.pageY - dt) < $.vakata.dnd.settings.scroll_proximity)\t{ vakata_dnd.scroll_t = 1; }\n\t\t\t\t\tif(dw > ww && e.pageX - dl < $.vakata.dnd.settings.scroll_proximity)\t\t{ vakata_dnd.scroll_l = -1; }\n\t\t\t\t\tif(dw > ww && ww - (e.pageX - dl) < $.vakata.dnd.settings.scroll_proximity)\t{ vakata_dnd.scroll_l = 1; }\n\t\t\t\t\tif(vakata_dnd.scroll_t || vakata_dnd.scroll_l) {\n\t\t\t\t\t\tvakata_dnd.scroll_e = d;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(vakata_dnd.scroll_e) { $.vakata.dnd._scroll(true); }\n\n\t\t\t\tif(vakata_dnd.helper) {\n\t\t\t\t\tht = parseInt(e.pageY + $.vakata.dnd.settings.helper_top, 10);\n\t\t\t\t\thl = parseInt(e.pageX + $.vakata.dnd.settings.helper_left, 10);\n\t\t\t\t\tif(dh && ht + 25 > dh) { ht = dh - 50; }\n\t\t\t\t\tif(dw && hl + vakata_dnd.helper_w > dw) { hl = dw - (vakata_dnd.helper_w + 2); }\n\t\t\t\t\tvakata_dnd.helper.css({\n\t\t\t\t\t\tleft\t: hl + \"px\",\n\t\t\t\t\t\ttop\t\t: ht + \"px\"\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t/**\n\t\t\t\t * triggered on the document when a drag is in progress\n\t\t\t\t * @event\n\t\t\t\t * @plugin dnd\n\t\t\t\t * @name dnd_move.vakata\n\t\t\t\t * @param {Mixed} data any data supplied with the call to $.vakata.dnd.start\n\t\t\t\t * @param {DOM} element the DOM element being dragged\n\t\t\t\t * @param {jQuery} helper the helper shown next to the mouse\n\t\t\t\t * @param {Object} event the event that caused this to trigger (most likely mousemove)\n\t\t\t\t */\n\t\t\t\t$.vakata.dnd._trigger(\"move\", e);\n\t\t\t\treturn false;\n\t\t\t},\n\t\t\tstop : function (e) {\n\t\t\t\tif(e.type === \"touchend\" && e.originalEvent && e.originalEvent.changedTouches && e.originalEvent.changedTouches[0]) {\n\t\t\t\t\te.pageX = e.originalEvent.changedTouches[0].pageX;\n\t\t\t\t\te.pageY = e.originalEvent.changedTouches[0].pageY;\n\t\t\t\t\te.target = document.elementFromPoint(e.originalEvent.changedTouches[0].pageX - window.pageXOffset, e.originalEvent.changedTouches[0].pageY - window.pageYOffset);\n\t\t\t\t}\n\t\t\t\tif(vakata_dnd.is_drag) {\n\t\t\t\t\t/**\n\t\t\t\t\t * triggered on the document when a drag stops (the dragged element is dropped)\n\t\t\t\t\t * @event\n\t\t\t\t\t * @plugin dnd\n\t\t\t\t\t * @name dnd_stop.vakata\n\t\t\t\t\t * @param {Mixed} data any data supplied with the call to $.vakata.dnd.start\n\t\t\t\t\t * @param {DOM} element the DOM element being dragged\n\t\t\t\t\t * @param {jQuery} helper the helper shown next to the mouse\n\t\t\t\t\t * @param {Object} event the event that caused the stop\n\t\t\t\t\t */\n\t\t\t\t\tif (e.target !== vakata_dnd.target) {\n\t\t\t\t\t\t$(vakata_dnd.target).off('click.vakata');\n\t\t\t\t\t}\n\t\t\t\t\t$.vakata.dnd._trigger(\"stop\", e);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif(e.type === \"touchend\" && e.target === vakata_dnd.target) {\n\t\t\t\t\t\tvar to = setTimeout(function () { $(e.target).click(); }, 100);\n\t\t\t\t\t\t$(e.target).one('click', function() { if(to) { clearTimeout(to); } });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$.vakata.dnd._clean();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t};\n\t}($));\n\n\t// include the dnd plugin by default\n\t// $.jstree.defaults.plugins.push(\"dnd\");\n\n\n/**\n * ### Massload plugin\n *\n * Adds massload functionality to jsTree, so that multiple nodes can be loaded in a single request (only useful with lazy loading).\n */\n\n\t/**\n\t * massload configuration\n\t *\n\t * It is possible to set this to a standard jQuery-like AJAX config.\n\t * In addition to the standard jQuery ajax options here you can supply functions for `data` and `url`, the functions will be run in the current instance's scope and a param will be passed indicating which node IDs need to be loaded, the return value of those functions will be used.\n\t *\n\t * You can also set this to a function, that function will receive the node IDs being loaded as argument and a second param which is a function (callback) which should be called with the result.\n\t *\n\t * Both the AJAX and the function approach rely on the same return value - an object where the keys are the node IDs, and the value is the children of that node as an array.\n\t *\n\t *\t{\n\t *\t\t\"id1\" : [{ \"text\" : \"Child of ID1\", \"id\" : \"c1\" }, { \"text\" : \"Another child of ID1\", \"id\" : \"c2\" }],\n\t *\t\t\"id2\" : [{ \"text\" : \"Child of ID2\", \"id\" : \"c3\" }]\n\t *\t}\n\t * \n\t * @name $.jstree.defaults.massload\n\t * @plugin massload\n\t */\n\t$.jstree.defaults.massload = null;\n\t$.jstree.plugins.massload = function (options, parent) {\n\t\tthis.init = function (el, options) {\n\t\t\tthis._data.massload = {};\n\t\t\tparent.init.call(this, el, options);\n\t\t};\n\t\tthis._load_nodes = function (nodes, callback, is_callback, force_reload) {\n\t\t\tvar s = this.settings.massload,\n\t\t\t\tnodesString = JSON.stringify(nodes),\n\t\t\t\ttoLoad = [],\n\t\t\t\tm = this._model.data,\n\t\t\t\ti, j, dom;\n\t\t\tif (!is_callback) {\n\t\t\t\tfor(i = 0, j = nodes.length; i < j; i++) {\n\t\t\t\t\tif(!m[nodes[i]] || ( (!m[nodes[i]].state.loaded && !m[nodes[i]].state.failed) || force_reload) ) {\n\t\t\t\t\t\ttoLoad.push(nodes[i]);\n\t\t\t\t\t\tdom = this.get_node(nodes[i], true);\n\t\t\t\t\t\tif (dom && dom.length) {\n\t\t\t\t\t\t\tdom.addClass(\"jstree-loading\").attr('aria-busy',true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis._data.massload = {};\n\t\t\t\tif (toLoad.length) {\n\t\t\t\t\tif($.isFunction(s)) {\n\t\t\t\t\t\treturn s.call(this, toLoad, $.proxy(function (data) {\n\t\t\t\t\t\t\tvar i, j;\n\t\t\t\t\t\t\tif(data) {\n\t\t\t\t\t\t\t\tfor(i in data) {\n\t\t\t\t\t\t\t\t\tif(data.hasOwnProperty(i)) {\n\t\t\t\t\t\t\t\t\t\tthis._data.massload[i] = data[i];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor(i = 0, j = nodes.length; i < j; i++) {\n\t\t\t\t\t\t\t\tdom = this.get_node(nodes[i], true);\n\t\t\t\t\t\t\t\tif (dom && dom.length) {\n\t\t\t\t\t\t\t\t\tdom.removeClass(\"jstree-loading\").attr('aria-busy',false);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tparent._load_nodes.call(this, nodes, callback, is_callback, force_reload);\n\t\t\t\t\t\t}, this));\n\t\t\t\t\t}\n\t\t\t\t\tif(typeof s === 'object' && s && s.url) {\n\t\t\t\t\t\ts = $.extend(true, {}, s);\n\t\t\t\t\t\tif($.isFunction(s.url)) {\n\t\t\t\t\t\t\ts.url = s.url.call(this, toLoad);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($.isFunction(s.data)) {\n\t\t\t\t\t\t\ts.data = s.data.call(this, toLoad);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn $.ajax(s)\n\t\t\t\t\t\t\t.done($.proxy(function (data,t,x) {\n\t\t\t\t\t\t\t\t\tvar i, j;\n\t\t\t\t\t\t\t\t\tif(data) {\n\t\t\t\t\t\t\t\t\t\tfor(i in data) {\n\t\t\t\t\t\t\t\t\t\t\tif(data.hasOwnProperty(i)) {\n\t\t\t\t\t\t\t\t\t\t\t\tthis._data.massload[i] = data[i];\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tfor(i = 0, j = nodes.length; i < j; i++) {\n\t\t\t\t\t\t\t\t\t\tdom = this.get_node(nodes[i], true);\n\t\t\t\t\t\t\t\t\t\tif (dom && dom.length) {\n\t\t\t\t\t\t\t\t\t\t\tdom.removeClass(\"jstree-loading\").attr('aria-busy',false);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tparent._load_nodes.call(this, nodes, callback, is_callback, force_reload);\n\t\t\t\t\t\t\t\t}, this))\n\t\t\t\t\t\t\t.fail($.proxy(function (f) {\n\t\t\t\t\t\t\t\t\tparent._load_nodes.call(this, nodes, callback, is_callback, force_reload);\n\t\t\t\t\t\t\t\t}, this));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn parent._load_nodes.call(this, nodes, callback, is_callback, force_reload);\n\t\t};\n\t\tthis._load_node = function (obj, callback) {\n\t\t\tvar data = this._data.massload[obj.id],\n\t\t\t\trslt = null, dom;\n\t\t\tif(data) {\n\t\t\t\trslt = this[typeof data === 'string' ? '_append_html_data' : '_append_json_data'](\n\t\t\t\t\tobj,\n\t\t\t\t\ttypeof data === 'string' ? $($.parseHTML(data)).filter(function () { return this.nodeType !== 3; }) : data,\n\t\t\t\t\tfunction (status) { callback.call(this, status); }\n\t\t\t\t);\n\t\t\t\tdom = this.get_node(obj.id, true);\n\t\t\t\tif (dom && dom.length) {\n\t\t\t\t\tdom.removeClass(\"jstree-loading\").attr('aria-busy',false);\n\t\t\t\t}\n\t\t\t\tdelete this._data.massload[obj.id];\n\t\t\t\treturn rslt;\n\t\t\t}\n\t\t\treturn parent._load_node.call(this, obj, callback);\n\t\t};\n\t};\n\n/**\n * ### Search plugin\n *\n * Adds search functionality to jsTree.\n */\n\n\t/**\n\t * stores all defaults for the search plugin\n\t * @name $.jstree.defaults.search\n\t * @plugin search\n\t */\n\t$.jstree.defaults.search = {\n\t\t/**\n\t\t * a jQuery-like AJAX config, which jstree uses if a server should be queried for results.\n\t\t *\n\t\t * A `str` (which is the search string) parameter will be added with the request, an optional `inside` parameter will be added if the search is limited to a node id. The expected result is a JSON array with nodes that need to be opened so that matching nodes will be revealed.\n\t\t * Leave this setting as `false` to not query the server. You can also set this to a function, which will be invoked in the instance's scope and receive 3 parameters - the search string, the callback to call with the array of nodes to load, and the optional node ID to limit the search to\n\t\t * @name $.jstree.defaults.search.ajax\n\t\t * @plugin search\n\t\t */\n\t\tajax : false,\n\t\t/**\n\t\t * Indicates if the search should be fuzzy or not (should `chnd3` match `child node 3`). Default is `false`.\n\t\t * @name $.jstree.defaults.search.fuzzy\n\t\t * @plugin search\n\t\t */\n\t\tfuzzy : false,\n\t\t/**\n\t\t * Indicates if the search should be case sensitive. Default is `false`.\n\t\t * @name $.jstree.defaults.search.case_sensitive\n\t\t * @plugin search\n\t\t */\n\t\tcase_sensitive : false,\n\t\t/**\n\t\t * Indicates if the tree should be filtered (by default) to show only matching nodes (keep in mind this can be a heavy on large trees in old browsers).\n\t\t * This setting can be changed at runtime when calling the search method. Default is `false`.\n\t\t * @name $.jstree.defaults.search.show_only_matches\n\t\t * @plugin search\n\t\t */\n\t\tshow_only_matches : false,\n\t\t/**\n\t\t * Indicates if the children of matched element are shown (when show_only_matches is true)\n\t\t * This setting can be changed at runtime when calling the search method. Default is `false`.\n\t\t * @name $.jstree.defaults.search.show_only_matches_children\n\t\t * @plugin search\n\t\t */\n\t\tshow_only_matches_children : false,\n\t\t/**\n\t\t * Indicates if all nodes opened to reveal the search result, should be closed when the search is cleared or a new search is performed. Default is `true`.\n\t\t * @name $.jstree.defaults.search.close_opened_onclear\n\t\t * @plugin search\n\t\t */\n\t\tclose_opened_onclear : true,\n\t\t/**\n\t\t * Indicates if only leaf nodes should be included in search results. Default is `false`.\n\t\t * @name $.jstree.defaults.search.search_leaves_only\n\t\t * @plugin search\n\t\t */\n\t\tsearch_leaves_only : false,\n\t\t/**\n\t\t * If set to a function it wil be called in the instance's scope with two arguments - search string and node (where node will be every node in the structure, so use with caution).\n\t\t * If the function returns a truthy value the node will be considered a match (it might not be displayed if search_only_leaves is set to true and the node is not a leaf). Default is `false`.\n\t\t * @name $.jstree.defaults.search.search_callback\n\t\t * @plugin search\n\t\t */\n\t\tsearch_callback : false\n\t};\n\n\t$.jstree.plugins.search = function (options, parent) {\n\t\tthis.bind = function () {\n\t\t\tparent.bind.call(this);\n\n\t\t\tthis._data.search.str = \"\";\n\t\t\tthis._data.search.dom = $();\n\t\t\tthis._data.search.res = [];\n\t\t\tthis._data.search.opn = [];\n\t\t\tthis._data.search.som = false;\n\t\t\tthis._data.search.smc = false;\n\t\t\tthis._data.search.hdn = [];\n\n\t\t\tthis.element\n\t\t\t\t.on(\"search.jstree\", $.proxy(function (e, data) {\n\t\t\t\t\t\tif(this._data.search.som && data.res.length) {\n\t\t\t\t\t\t\tvar m = this._model.data, i, j, p = [], k, l;\n\t\t\t\t\t\t\tfor(i = 0, j = data.res.length; i < j; i++) {\n\t\t\t\t\t\t\t\tif(m[data.res[i]] && !m[data.res[i]].state.hidden) {\n\t\t\t\t\t\t\t\t\tp.push(data.res[i]);\n\t\t\t\t\t\t\t\t\tp = p.concat(m[data.res[i]].parents);\n\t\t\t\t\t\t\t\t\tif(this._data.search.smc) {\n\t\t\t\t\t\t\t\t\t\tfor (k = 0, l = m[data.res[i]].children_d.length; k < l; k++) {\n\t\t\t\t\t\t\t\t\t\t\tif (m[m[data.res[i]].children_d[k]] && !m[m[data.res[i]].children_d[k]].state.hidden) {\n\t\t\t\t\t\t\t\t\t\t\t\tp.push(m[data.res[i]].children_d[k]);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tp = $.vakata.array_remove_item($.vakata.array_unique(p), $.jstree.root);\n\t\t\t\t\t\t\tthis._data.search.hdn = this.hide_all(true);\n\t\t\t\t\t\t\tthis.show_node(p, true);\n\t\t\t\t\t\t\tthis.redraw(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}, this))\n\t\t\t\t.on(\"clear_search.jstree\", $.proxy(function (e, data) {\n\t\t\t\t\t\tif(this._data.search.som && data.res.length) {\n\t\t\t\t\t\t\tthis.show_node(this._data.search.hdn, true);\n\t\t\t\t\t\t\tthis.redraw(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}, this));\n\t\t};\n\t\t/**\n\t\t * used to search the tree nodes for a given string\n\t\t * @name search(str [, skip_async])\n\t\t * @param {String} str the search string\n\t\t * @param {Boolean} skip_async if set to true server will not be queried even if configured\n\t\t * @param {Boolean} show_only_matches if set to true only matching nodes will be shown (keep in mind this can be very slow on large trees or old browsers)\n\t\t * @param {mixed} inside an optional node to whose children to limit the search\n\t\t * @param {Boolean} append if set to true the results of this search are appended to the previous search\n\t\t * @plugin search\n\t\t * @trigger search.jstree\n\t\t */\n\t\tthis.search = function (str, skip_async, show_only_matches, inside, append, show_only_matches_children) {\n\t\t\tif(str === false || $.trim(str.toString()) === \"\") {\n\t\t\t\treturn this.clear_search();\n\t\t\t}\n\t\t\tinside = this.get_node(inside);\n\t\t\tinside = inside && inside.id ? inside.id : null;\n\t\t\tstr = str.toString();\n\t\t\tvar s = this.settings.search,\n\t\t\t\ta = s.ajax ? s.ajax : false,\n\t\t\t\tm = this._model.data,\n\t\t\t\tf = null,\n\t\t\t\tr = [],\n\t\t\t\tp = [], i, j;\n\t\t\tif(this._data.search.res.length && !append) {\n\t\t\t\tthis.clear_search();\n\t\t\t}\n\t\t\tif(show_only_matches === undefined) {\n\t\t\t\tshow_only_matches = s.show_only_matches;\n\t\t\t}\n\t\t\tif(show_only_matches_children === undefined) {\n\t\t\t\tshow_only_matches_children = s.show_only_matches_children;\n\t\t\t}\n\t\t\tif(!skip_async && a !== false) {\n\t\t\t\tif($.isFunction(a)) {\n\t\t\t\t\treturn a.call(this, str, $.proxy(function (d) {\n\t\t\t\t\t\t\tif(d && d.d) { d = d.d; }\n\t\t\t\t\t\t\tthis._load_nodes(!$.isArray(d) ? [] : $.vakata.array_unique(d), function () {\n\t\t\t\t\t\t\t\tthis.search(str, true, show_only_matches, inside, append, show_only_matches_children);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}, this), inside);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ta = $.extend({}, a);\n\t\t\t\t\tif(!a.data) { a.data = {}; }\n\t\t\t\t\ta.data.str = str;\n\t\t\t\t\tif(inside) {\n\t\t\t\t\t\ta.data.inside = inside;\n\t\t\t\t\t}\n\t\t\t\t\tif (this._data.search.lastRequest) {\n\t\t\t\t\t\tthis._data.search.lastRequest.abort();\n\t\t\t\t\t}\n\t\t\t\t\tthis._data.search.lastRequest = $.ajax(a)\n\t\t\t\t\t\t.fail($.proxy(function () {\n\t\t\t\t\t\t\tthis._data.core.last_error = { 'error' : 'ajax', 'plugin' : 'search', 'id' : 'search_01', 'reason' : 'Could not load search parents', 'data' : JSON.stringify(a) };\n\t\t\t\t\t\t\tthis.settings.core.error.call(this, this._data.core.last_error);\n\t\t\t\t\t\t}, this))\n\t\t\t\t\t\t.done($.proxy(function (d) {\n\t\t\t\t\t\t\tif(d && d.d) { d = d.d; }\n\t\t\t\t\t\t\tthis._load_nodes(!$.isArray(d) ? [] : $.vakata.array_unique(d), function () {\n\t\t\t\t\t\t\t\tthis.search(str, true, show_only_matches, inside, append, show_only_matches_children);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}, this));\n\t\t\t\t\treturn this._data.search.lastRequest;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!append) {\n\t\t\t\tthis._data.search.str = str;\n\t\t\t\tthis._data.search.dom = $();\n\t\t\t\tthis._data.search.res = [];\n\t\t\t\tthis._data.search.opn = [];\n\t\t\t\tthis._data.search.som = show_only_matches;\n\t\t\t\tthis._data.search.smc = show_only_matches_children;\n\t\t\t}\n\n\t\t\tf = new $.vakata.search(str, true, { caseSensitive : s.case_sensitive, fuzzy : s.fuzzy });\n\t\t\t$.each(m[inside ? inside : $.jstree.root].children_d, function (ii, i) {\n\t\t\t\tvar v = m[i];\n\t\t\t\tif(v.text && !v.state.hidden && (!s.search_leaves_only || (v.state.loaded && v.children.length === 0)) && ( (s.search_callback && s.search_callback.call(this, str, v)) || (!s.search_callback && f.search(v.text).isMatch) ) ) {\n\t\t\t\t\tr.push(i);\n\t\t\t\t\tp = p.concat(v.parents);\n\t\t\t\t}\n\t\t\t});\n\t\t\tif(r.length) {\n\t\t\t\tp = $.vakata.array_unique(p);\n\t\t\t\tfor(i = 0, j = p.length; i < j; i++) {\n\t\t\t\t\tif(p[i] !== $.jstree.root && m[p[i]] && this.open_node(p[i], null, 0) === true) {\n\t\t\t\t\t\tthis._data.search.opn.push(p[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(!append) {\n\t\t\t\t\tthis._data.search.dom = $(this.element[0].querySelectorAll('#' + $.map(r, function (v) { return \"0123456789\".indexOf(v[0]) !== -1 ? '\\\\3' + v[0] + ' ' + v.substr(1).replace($.jstree.idregex,'\\\\$&') : v.replace($.jstree.idregex,'\\\\$&'); }).join(', #')));\n\t\t\t\t\tthis._data.search.res = r;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis._data.search.dom = this._data.search.dom.add($(this.element[0].querySelectorAll('#' + $.map(r, function (v) { return \"0123456789\".indexOf(v[0]) !== -1 ? '\\\\3' + v[0] + ' ' + v.substr(1).replace($.jstree.idregex,'\\\\$&') : v.replace($.jstree.idregex,'\\\\$&'); }).join(', #'))));\n\t\t\t\t\tthis._data.search.res = $.vakata.array_unique(this._data.search.res.concat(r));\n\t\t\t\t}\n\t\t\t\tthis._data.search.dom.children(\".jstree-anchor\").addClass('jstree-search');\n\t\t\t}\n\t\t\t/**\n\t\t\t * triggered after search is complete\n\t\t\t * @event\n\t\t\t * @name search.jstree\n\t\t\t * @param {jQuery} nodes a jQuery collection of matching nodes\n\t\t\t * @param {String} str the search string\n\t\t\t * @param {Array} res a collection of objects represeing the matching nodes\n\t\t\t * @plugin search\n\t\t\t */\n\t\t\tthis.trigger('search', { nodes : this._data.search.dom, str : str, res : this._data.search.res, show_only_matches : show_only_matches });\n\t\t};\n\t\t/**\n\t\t * used to clear the last search (removes classes and shows all nodes if filtering is on)\n\t\t * @name clear_search()\n\t\t * @plugin search\n\t\t * @trigger clear_search.jstree\n\t\t */\n\t\tthis.clear_search = function () {\n\t\t\tif(this.settings.search.close_opened_onclear) {\n\t\t\t\tthis.close_node(this._data.search.opn, 0);\n\t\t\t}\n\t\t\t/**\n\t\t\t * triggered after search is complete\n\t\t\t * @event\n\t\t\t * @name clear_search.jstree\n\t\t\t * @param {jQuery} nodes a jQuery collection of matching nodes (the result from the last search)\n\t\t\t * @param {String} str the search string (the last search string)\n\t\t\t * @param {Array} res a collection of objects represeing the matching nodes (the result from the last search)\n\t\t\t * @plugin search\n\t\t\t */\n\t\t\tthis.trigger('clear_search', { 'nodes' : this._data.search.dom, str : this._data.search.str, res : this._data.search.res });\n\t\t\tif(this._data.search.res.length) {\n\t\t\t\tthis._data.search.dom = $(this.element[0].querySelectorAll('#' + $.map(this._data.search.res, function (v) {\n\t\t\t\t\treturn \"0123456789\".indexOf(v[0]) !== -1 ? '\\\\3' + v[0] + ' ' + v.substr(1).replace($.jstree.idregex,'\\\\$&') : v.replace($.jstree.idregex,'\\\\$&');\n\t\t\t\t}).join(', #')));\n\t\t\t\tthis._data.search.dom.children(\".jstree-anchor\").removeClass(\"jstree-search\");\n\t\t\t}\n\t\t\tthis._data.search.str = \"\";\n\t\t\tthis._data.search.res = [];\n\t\t\tthis._data.search.opn = [];\n\t\t\tthis._data.search.dom = $();\n\t\t};\n\n\t\tthis.redraw_node = function(obj, deep, callback, force_render) {\n\t\t\tobj = parent.redraw_node.apply(this, arguments);\n\t\t\tif(obj) {\n\t\t\t\tif($.inArray(obj.id, this._data.search.res) !== -1) {\n\t\t\t\t\tvar i, j, tmp = null;\n\t\t\t\t\tfor(i = 0, j = obj.childNodes.length; i < j; i++) {\n\t\t\t\t\t\tif(obj.childNodes[i] && obj.childNodes[i].className && obj.childNodes[i].className.indexOf(\"jstree-anchor\") !== -1) {\n\t\t\t\t\t\t\ttmp = obj.childNodes[i];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(tmp) {\n\t\t\t\t\t\ttmp.className += ' jstree-search';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn obj;\n\t\t};\n\t};\n\n\t// helpers\n\t(function ($) {\n\t\t// from http://kiro.me/projects/fuse.html\n\t\t$.vakata.search = function(pattern, txt, options) {\n\t\t\toptions = options || {};\n\t\t\toptions = $.extend({}, $.vakata.search.defaults, options);\n\t\t\tif(options.fuzzy !== false) {\n\t\t\t\toptions.fuzzy = true;\n\t\t\t}\n\t\t\tpattern = options.caseSensitive ? pattern : pattern.toLowerCase();\n\t\t\tvar MATCH_LOCATION\t= options.location,\n\t\t\t\tMATCH_DISTANCE\t= options.distance,\n\t\t\t\tMATCH_THRESHOLD\t= options.threshold,\n\t\t\t\tpatternLen = pattern.length,\n\t\t\t\tmatchmask, pattern_alphabet, match_bitapScore, search;\n\t\t\tif(patternLen > 32) {\n\t\t\t\toptions.fuzzy = false;\n\t\t\t}\n\t\t\tif(options.fuzzy) {\n\t\t\t\tmatchmask = 1 << (patternLen - 1);\n\t\t\t\tpattern_alphabet = (function () {\n\t\t\t\t\tvar mask = {},\n\t\t\t\t\t\ti = 0;\n\t\t\t\t\tfor (i = 0; i < patternLen; i++) {\n\t\t\t\t\t\tmask[pattern.charAt(i)] = 0;\n\t\t\t\t\t}\n\t\t\t\t\tfor (i = 0; i < patternLen; i++) {\n\t\t\t\t\t\tmask[pattern.charAt(i)] |= 1 << (patternLen - i - 1);\n\t\t\t\t\t}\n\t\t\t\t\treturn mask;\n\t\t\t\t}());\n\t\t\t\tmatch_bitapScore = function (e, x) {\n\t\t\t\t\tvar accuracy = e / patternLen,\n\t\t\t\t\t\tproximity = Math.abs(MATCH_LOCATION - x);\n\t\t\t\t\tif(!MATCH_DISTANCE) {\n\t\t\t\t\t\treturn proximity ? 1.0 : accuracy;\n\t\t\t\t\t}\n\t\t\t\t\treturn accuracy + (proximity / MATCH_DISTANCE);\n\t\t\t\t};\n\t\t\t}\n\t\t\tsearch = function (text) {\n\t\t\t\ttext = options.caseSensitive ? text : text.toLowerCase();\n\t\t\t\tif(pattern === text || text.indexOf(pattern) !== -1) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tisMatch: true,\n\t\t\t\t\t\tscore: 0\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tif(!options.fuzzy) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tisMatch: false,\n\t\t\t\t\t\tscore: 1\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tvar i, j,\n\t\t\t\t\ttextLen = text.length,\n\t\t\t\t\tscoreThreshold = MATCH_THRESHOLD,\n\t\t\t\t\tbestLoc = text.indexOf(pattern, MATCH_LOCATION),\n\t\t\t\t\tbinMin, binMid,\n\t\t\t\t\tbinMax = patternLen + textLen,\n\t\t\t\t\tlastRd, start, finish, rd, charMatch,\n\t\t\t\t\tscore = 1,\n\t\t\t\t\tlocations = [];\n\t\t\t\tif (bestLoc !== -1) {\n\t\t\t\t\tscoreThreshold = Math.min(match_bitapScore(0, bestLoc), scoreThreshold);\n\t\t\t\t\tbestLoc = text.lastIndexOf(pattern, MATCH_LOCATION + patternLen);\n\t\t\t\t\tif (bestLoc !== -1) {\n\t\t\t\t\t\tscoreThreshold = Math.min(match_bitapScore(0, bestLoc), scoreThreshold);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbestLoc = -1;\n\t\t\t\tfor (i = 0; i < patternLen; i++) {\n\t\t\t\t\tbinMin = 0;\n\t\t\t\t\tbinMid = binMax;\n\t\t\t\t\twhile (binMin < binMid) {\n\t\t\t\t\t\tif (match_bitapScore(i, MATCH_LOCATION + binMid) <= scoreThreshold) {\n\t\t\t\t\t\t\tbinMin = binMid;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tbinMax = binMid;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbinMid = Math.floor((binMax - binMin) / 2 + binMin);\n\t\t\t\t\t}\n\t\t\t\t\tbinMax = binMid;\n\t\t\t\t\tstart = Math.max(1, MATCH_LOCATION - binMid + 1);\n\t\t\t\t\tfinish = Math.min(MATCH_LOCATION + binMid, textLen) + patternLen;\n\t\t\t\t\trd = new Array(finish + 2);\n\t\t\t\t\trd[finish + 1] = (1 << i) - 1;\n\t\t\t\t\tfor (j = finish; j >= start; j--) {\n\t\t\t\t\t\tcharMatch = pattern_alphabet[text.charAt(j - 1)];\n\t\t\t\t\t\tif (i === 0) {\n\t\t\t\t\t\t\trd[j] = ((rd[j + 1] << 1) | 1) & charMatch;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\trd[j] = ((rd[j + 1] << 1) | 1) & charMatch | (((lastRd[j + 1] | lastRd[j]) << 1) | 1) | lastRd[j + 1];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (rd[j] & matchmask) {\n\t\t\t\t\t\t\tscore = match_bitapScore(i, j - 1);\n\t\t\t\t\t\t\tif (score <= scoreThreshold) {\n\t\t\t\t\t\t\t\tscoreThreshold = score;\n\t\t\t\t\t\t\t\tbestLoc = j - 1;\n\t\t\t\t\t\t\t\tlocations.push(bestLoc);\n\t\t\t\t\t\t\t\tif (bestLoc > MATCH_LOCATION) {\n\t\t\t\t\t\t\t\t\tstart = Math.max(1, 2 * MATCH_LOCATION - bestLoc);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (match_bitapScore(i + 1, MATCH_LOCATION) > scoreThreshold) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tlastRd = rd;\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tisMatch: bestLoc >= 0,\n\t\t\t\t\tscore: score\n\t\t\t\t};\n\t\t\t};\n\t\t\treturn txt === true ? { 'search' : search } : search(txt);\n\t\t};\n\t\t$.vakata.search.defaults = {\n\t\t\tlocation : 0,\n\t\t\tdistance : 100,\n\t\t\tthreshold : 0.6,\n\t\t\tfuzzy : false,\n\t\t\tcaseSensitive : false\n\t\t};\n\t}($));\n\n\t// include the search plugin by default\n\t// $.jstree.defaults.plugins.push(\"search\");\n\n\n/**\n * ### Sort plugin\n *\n * Automatically sorts all siblings in the tree according to a sorting function.\n */\n\n\t/**\n\t * the settings function used to sort the nodes.\n\t * It is executed in the tree's context, accepts two nodes as arguments and should return `1` or `-1`.\n\t * @name $.jstree.defaults.sort\n\t * @plugin sort\n\t */\n\t$.jstree.defaults.sort = function (a, b) {\n\t\t//return this.get_type(a) === this.get_type(b) ? (this.get_text(a) > this.get_text(b) ? 1 : -1) : this.get_type(a) >= this.get_type(b);\n\t\treturn this.get_text(a) > this.get_text(b) ? 1 : -1;\n\t};\n\t$.jstree.plugins.sort = function (options, parent) {\n\t\tthis.bind = function () {\n\t\t\tparent.bind.call(this);\n\t\t\tthis.element\n\t\t\t\t.on(\"model.jstree\", $.proxy(function (e, data) {\n\t\t\t\t\t\tthis.sort(data.parent, true);\n\t\t\t\t\t}, this))\n\t\t\t\t.on(\"rename_node.jstree create_node.jstree\", $.proxy(function (e, data) {\n\t\t\t\t\t\tthis.sort(data.parent || data.node.parent, false);\n\t\t\t\t\t\tthis.redraw_node(data.parent || data.node.parent, true);\n\t\t\t\t\t}, this))\n\t\t\t\t.on(\"move_node.jstree copy_node.jstree\", $.proxy(function (e, data) {\n\t\t\t\t\t\tthis.sort(data.parent, false);\n\t\t\t\t\t\tthis.redraw_node(data.parent, true);\n\t\t\t\t\t}, this));\n\t\t};\n\t\t/**\n\t\t * used to sort a node's children\n\t\t * @private\n\t\t * @name sort(obj [, deep])\n\t\t * @param  {mixed} obj the node\n\t\t * @param {Boolean} deep if set to `true` nodes are sorted recursively.\n\t\t * @plugin sort\n\t\t * @trigger search.jstree\n\t\t */\n\t\tthis.sort = function (obj, deep) {\n\t\t\tvar i, j;\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(obj && obj.children && obj.children.length) {\n\t\t\t\tobj.children.sort($.proxy(this.settings.sort, this));\n\t\t\t\tif(deep) {\n\t\t\t\t\tfor(i = 0, j = obj.children_d.length; i < j; i++) {\n\t\t\t\t\t\tthis.sort(obj.children_d[i], false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t};\n\n\t// include the sort plugin by default\n\t// $.jstree.defaults.plugins.push(\"sort\");\n\n/**\n * ### State plugin\n *\n * Saves the state of the tree (selected nodes, opened nodes) on the user's computer using available options (localStorage, cookies, etc)\n */\n\n\tvar to = false;\n\t/**\n\t * stores all defaults for the state plugin\n\t * @name $.jstree.defaults.state\n\t * @plugin state\n\t */\n\t$.jstree.defaults.state = {\n\t\t/**\n\t\t * A string for the key to use when saving the current tree (change if using multiple trees in your project). Defaults to `jstree`.\n\t\t * @name $.jstree.defaults.state.key\n\t\t * @plugin state\n\t\t */\n\t\tkey\t\t: 'jstree',\n\t\t/**\n\t\t * A space separated list of events that trigger a state save. Defaults to `changed.jstree open_node.jstree close_node.jstree`.\n\t\t * @name $.jstree.defaults.state.events\n\t\t * @plugin state\n\t\t */\n\t\tevents\t: 'changed.jstree open_node.jstree close_node.jstree check_node.jstree uncheck_node.jstree',\n\t\t/**\n\t\t * Time in milliseconds after which the state will expire. Defaults to 'false' meaning - no expire.\n\t\t * @name $.jstree.defaults.state.ttl\n\t\t * @plugin state\n\t\t */\n\t\tttl\t\t: false,\n\t\t/**\n\t\t * A function that will be executed prior to restoring state with one argument - the state object. Can be used to clear unwanted parts of the state.\n\t\t * @name $.jstree.defaults.state.filter\n\t\t * @plugin state\n\t\t */\n\t\tfilter\t: false,\n\t\t/**\n\t\t * Should loaded nodes be restored (setting this to true means that it is possible that the whole tree will be loaded for some users - use with caution). Defaults to `false`\n\t\t * @name $.jstree.defaults.state.preserve_loaded\n\t\t * @plugin state\n\t\t */\n\t\tpreserve_loaded : false\n\t};\n\t$.jstree.plugins.state = function (options, parent) {\n\t\tthis.bind = function () {\n\t\t\tparent.bind.call(this);\n\t\t\tvar bind = $.proxy(function () {\n\t\t\t\tthis.element.on(this.settings.state.events, $.proxy(function () {\n\t\t\t\t\tif(to) { clearTimeout(to); }\n\t\t\t\t\tto = setTimeout($.proxy(function () { this.save_state(); }, this), 100);\n\t\t\t\t}, this));\n\t\t\t\t/**\n\t\t\t\t * triggered when the state plugin is finished restoring the state (and immediately after ready if there is no state to restore).\n\t\t\t\t * @event\n\t\t\t\t * @name state_ready.jstree\n\t\t\t\t * @plugin state\n\t\t\t\t */\n\t\t\t\tthis.trigger('state_ready');\n\t\t\t}, this);\n\t\t\tthis.element\n\t\t\t\t.on(\"ready.jstree\", $.proxy(function (e, data) {\n\t\t\t\t\t\tthis.element.one(\"restore_state.jstree\", bind);\n\t\t\t\t\t\tif(!this.restore_state()) { bind(); }\n\t\t\t\t\t}, this));\n\t\t};\n\t\t/**\n\t\t * save the state\n\t\t * @name save_state()\n\t\t * @plugin state\n\t\t */\n\t\tthis.save_state = function () {\n\t\t\tvar tm = this.get_state();\n\t\t\tif (!this.settings.state.preserve_loaded) {\n\t\t\t\tdelete tm.core.loaded;\n\t\t\t}\n\t\t\tvar st = { 'state' : tm, 'ttl' : this.settings.state.ttl, 'sec' : +(new Date()) };\n\t\t\t$.vakata.storage.set(this.settings.state.key, JSON.stringify(st));\n\t\t};\n\t\t/**\n\t\t * restore the state from the user's computer\n\t\t * @name restore_state()\n\t\t * @plugin state\n\t\t */\n\t\tthis.restore_state = function () {\n\t\t\tvar k = $.vakata.storage.get(this.settings.state.key);\n\t\t\tif(!!k) { try { k = JSON.parse(k); } catch(ex) { return false; } }\n\t\t\tif(!!k && k.ttl && k.sec && +(new Date()) - k.sec > k.ttl) { return false; }\n\t\t\tif(!!k && k.state) { k = k.state; }\n\t\t\tif(!!k && $.isFunction(this.settings.state.filter)) { k = this.settings.state.filter.call(this, k); }\n\t\t\tif(!!k) {\n\t\t\t\tif (!this.settings.state.preserve_loaded) {\n\t\t\t\t\tdelete k.core.loaded;\n\t\t\t\t}\n\t\t\t\tthis.element.one(\"set_state.jstree\", function (e, data) { data.instance.trigger('restore_state', { 'state' : $.extend(true, {}, k) }); });\n\t\t\t\tthis.set_state(k);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\t\t/**\n\t\t * clear the state on the user's computer\n\t\t * @name clear_state()\n\t\t * @plugin state\n\t\t */\n\t\tthis.clear_state = function () {\n\t\t\treturn $.vakata.storage.del(this.settings.state.key);\n\t\t};\n\t};\n\n\t(function ($, undefined) {\n\t\t$.vakata.storage = {\n\t\t\t// simply specifying the functions in FF throws an error\n\t\t\tset : function (key, val) { return window.localStorage.setItem(key, val); },\n\t\t\tget : function (key) { return window.localStorage.getItem(key); },\n\t\t\tdel : function (key) { return window.localStorage.removeItem(key); }\n\t\t};\n\t}($));\n\n\t// include the state plugin by default\n\t// $.jstree.defaults.plugins.push(\"state\");\n\n/**\n * ### Types plugin\n *\n * Makes it possible to add predefined types for groups of nodes, which make it possible to easily control nesting rules and icon for each group.\n */\n\n\t/**\n\t * An object storing all types as key value pairs, where the key is the type name and the value is an object that could contain following keys (all optional).\n\t *\n\t * * `max_children` the maximum number of immediate children this node type can have. Do not specify or set to `-1` for unlimited.\n\t * * `max_depth` the maximum number of nesting this node type can have. A value of `1` would mean that the node can have children, but no grandchildren. Do not specify or set to `-1` for unlimited.\n\t * * `valid_children` an array of node type strings, that nodes of this type can have as children. Do not specify or set to `-1` for no limits.\n\t * * `icon` a string - can be a path to an icon or a className, if using an image that is in the current directory use a `./` prefix, otherwise it will be detected as a class. Omit to use the default icon from your theme.\n\t * * `li_attr` an object of values which will be used to add HTML attributes on the resulting LI DOM node (merged with the node's own data)\n\t * * `a_attr` an object of values which will be used to add HTML attributes on the resulting A DOM node (merged with the node's own data)\n\t *\n\t * There are two predefined types:\n\t *\n\t * * `#` represents the root of the tree, for example `max_children` would control the maximum number of root nodes.\n\t * * `default` represents the default node - any settings here will be applied to all nodes that do not have a type specified.\n\t *\n\t * @name $.jstree.defaults.types\n\t * @plugin types\n\t */\n\t$.jstree.defaults.types = {\n\t\t'default' : {}\n\t};\n\t$.jstree.defaults.types[$.jstree.root] = {};\n\n\t$.jstree.plugins.types = function (options, parent) {\n\t\tthis.init = function (el, options) {\n\t\t\tvar i, j;\n\t\t\tif(options && options.types && options.types['default']) {\n\t\t\t\tfor(i in options.types) {\n\t\t\t\t\tif(i !== \"default\" && i !== $.jstree.root && options.types.hasOwnProperty(i)) {\n\t\t\t\t\t\tfor(j in options.types['default']) {\n\t\t\t\t\t\t\tif(options.types['default'].hasOwnProperty(j) && options.types[i][j] === undefined) {\n\t\t\t\t\t\t\t\toptions.types[i][j] = options.types['default'][j];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tparent.init.call(this, el, options);\n\t\t\tthis._model.data[$.jstree.root].type = $.jstree.root;\n\t\t};\n\t\tthis.refresh = function (skip_loading, forget_state) {\n\t\t\tparent.refresh.call(this, skip_loading, forget_state);\n\t\t\tthis._model.data[$.jstree.root].type = $.jstree.root;\n\t\t};\n\t\tthis.bind = function () {\n\t\t\tthis.element\n\t\t\t\t.on('model.jstree', $.proxy(function (e, data) {\n\t\t\t\t\t\tvar m = this._model.data,\n\t\t\t\t\t\t\tdpc = data.nodes,\n\t\t\t\t\t\t\tt = this.settings.types,\n\t\t\t\t\t\t\ti, j, c = 'default', k;\n\t\t\t\t\t\tfor(i = 0, j = dpc.length; i < j; i++) {\n\t\t\t\t\t\t\tc = 'default';\n\t\t\t\t\t\t\tif(m[dpc[i]].original && m[dpc[i]].original.type && t[m[dpc[i]].original.type]) {\n\t\t\t\t\t\t\t\tc = m[dpc[i]].original.type;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(m[dpc[i]].data && m[dpc[i]].data.jstree && m[dpc[i]].data.jstree.type && t[m[dpc[i]].data.jstree.type]) {\n\t\t\t\t\t\t\t\tc = m[dpc[i]].data.jstree.type;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tm[dpc[i]].type = c;\n\t\t\t\t\t\t\tif(m[dpc[i]].icon === true && t[c].icon !== undefined) {\n\t\t\t\t\t\t\t\tm[dpc[i]].icon = t[c].icon;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(t[c].li_attr !== undefined && typeof t[c].li_attr === 'object') {\n\t\t\t\t\t\t\t\tfor (k in t[c].li_attr) {\n\t\t\t\t\t\t\t\t\tif (t[c].li_attr.hasOwnProperty(k)) {\n\t\t\t\t\t\t\t\t\t\tif (k === 'id') {\n\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse if (m[dpc[i]].li_attr[k] === undefined) {\n\t\t\t\t\t\t\t\t\t\t\tm[dpc[i]].li_attr[k] = t[c].li_attr[k];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse if (k === 'class') {\n\t\t\t\t\t\t\t\t\t\t\tm[dpc[i]].li_attr['class'] = t[c].li_attr['class'] + ' ' + m[dpc[i]].li_attr['class'];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(t[c].a_attr !== undefined && typeof t[c].a_attr === 'object') {\n\t\t\t\t\t\t\t\tfor (k in t[c].a_attr) {\n\t\t\t\t\t\t\t\t\tif (t[c].a_attr.hasOwnProperty(k)) {\n\t\t\t\t\t\t\t\t\t\tif (k === 'id') {\n\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse if (m[dpc[i]].a_attr[k] === undefined) {\n\t\t\t\t\t\t\t\t\t\t\tm[dpc[i]].a_attr[k] = t[c].a_attr[k];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse if (k === 'href' && m[dpc[i]].a_attr[k] === '#') {\n\t\t\t\t\t\t\t\t\t\t\tm[dpc[i]].a_attr['href'] = t[c].a_attr['href'];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse if (k === 'class') {\n\t\t\t\t\t\t\t\t\t\t\tm[dpc[i]].a_attr['class'] = t[c].a_attr['class'] + ' ' + m[dpc[i]].a_attr['class'];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tm[$.jstree.root].type = $.jstree.root;\n\t\t\t\t\t}, this));\n\t\t\tparent.bind.call(this);\n\t\t};\n\t\tthis.get_json = function (obj, options, flat) {\n\t\t\tvar i, j,\n\t\t\t\tm = this._model.data,\n\t\t\t\topt = options ? $.extend(true, {}, options, {no_id:false}) : {},\n\t\t\t\ttmp = parent.get_json.call(this, obj, opt, flat);\n\t\t\tif(tmp === false) { return false; }\n\t\t\tif($.isArray(tmp)) {\n\t\t\t\tfor(i = 0, j = tmp.length; i < j; i++) {\n\t\t\t\t\ttmp[i].type = tmp[i].id && m[tmp[i].id] && m[tmp[i].id].type ? m[tmp[i].id].type : \"default\";\n\t\t\t\t\tif(options && options.no_id) {\n\t\t\t\t\t\tdelete tmp[i].id;\n\t\t\t\t\t\tif(tmp[i].li_attr && tmp[i].li_attr.id) {\n\t\t\t\t\t\t\tdelete tmp[i].li_attr.id;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(tmp[i].a_attr && tmp[i].a_attr.id) {\n\t\t\t\t\t\t\tdelete tmp[i].a_attr.id;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttmp.type = tmp.id && m[tmp.id] && m[tmp.id].type ? m[tmp.id].type : \"default\";\n\t\t\t\tif(options && options.no_id) {\n\t\t\t\t\ttmp = this._delete_ids(tmp);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn tmp;\n\t\t};\n\t\tthis._delete_ids = function (tmp) {\n\t\t\tif($.isArray(tmp)) {\n\t\t\t\tfor(var i = 0, j = tmp.length; i < j; i++) {\n\t\t\t\t\ttmp[i] = this._delete_ids(tmp[i]);\n\t\t\t\t}\n\t\t\t\treturn tmp;\n\t\t\t}\n\t\t\tdelete tmp.id;\n\t\t\tif(tmp.li_attr && tmp.li_attr.id) {\n\t\t\t\tdelete tmp.li_attr.id;\n\t\t\t}\n\t\t\tif(tmp.a_attr && tmp.a_attr.id) {\n\t\t\t\tdelete tmp.a_attr.id;\n\t\t\t}\n\t\t\tif(tmp.children && $.isArray(tmp.children)) {\n\t\t\t\ttmp.children = this._delete_ids(tmp.children);\n\t\t\t}\n\t\t\treturn tmp;\n\t\t};\n\t\tthis.check = function (chk, obj, par, pos, more) {\n\t\t\tif(parent.check.call(this, chk, obj, par, pos, more) === false) { return false; }\n\t\t\tobj = obj && obj.id ? obj : this.get_node(obj);\n\t\t\tpar = par && par.id ? par : this.get_node(par);\n\t\t\tvar m = obj && obj.id ? (more && more.origin ? more.origin : $.jstree.reference(obj.id)) : null, tmp, d, i, j;\n\t\t\tm = m && m._model && m._model.data ? m._model.data : null;\n\t\t\tswitch(chk) {\n\t\t\t\tcase \"create_node\":\n\t\t\t\tcase \"move_node\":\n\t\t\t\tcase \"copy_node\":\n\t\t\t\t\tif(chk !== 'move_node' || $.inArray(obj.id, par.children) === -1) {\n\t\t\t\t\t\ttmp = this.get_rules(par);\n\t\t\t\t\t\tif(tmp.max_children !== undefined && tmp.max_children !== -1 && tmp.max_children === par.children.length) {\n\t\t\t\t\t\t\tthis._data.core.last_error = { 'error' : 'check', 'plugin' : 'types', 'id' : 'types_01', 'reason' : 'max_children prevents function: ' + chk, 'data' : JSON.stringify({ 'chk' : chk, 'pos' : pos, 'obj' : obj && obj.id ? obj.id : false, 'par' : par && par.id ? par.id : false }) };\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(tmp.valid_children !== undefined && tmp.valid_children !== -1 && $.inArray((obj.type || 'default'), tmp.valid_children) === -1) {\n\t\t\t\t\t\t\tthis._data.core.last_error = { 'error' : 'check', 'plugin' : 'types', 'id' : 'types_02', 'reason' : 'valid_children prevents function: ' + chk, 'data' : JSON.stringify({ 'chk' : chk, 'pos' : pos, 'obj' : obj && obj.id ? obj.id : false, 'par' : par && par.id ? par.id : false }) };\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(m && obj.children_d && obj.parents) {\n\t\t\t\t\t\t\td = 0;\n\t\t\t\t\t\t\tfor(i = 0, j = obj.children_d.length; i < j; i++) {\n\t\t\t\t\t\t\t\td = Math.max(d, m[obj.children_d[i]].parents.length);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\td = d - obj.parents.length + 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(d <= 0 || d === undefined) { d = 1; }\n\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\tif(tmp.max_depth !== undefined && tmp.max_depth !== -1 && tmp.max_depth < d) {\n\t\t\t\t\t\t\t\tthis._data.core.last_error = { 'error' : 'check', 'plugin' : 'types', 'id' : 'types_03', 'reason' : 'max_depth prevents function: ' + chk, 'data' : JSON.stringify({ 'chk' : chk, 'pos' : pos, 'obj' : obj && obj.id ? obj.id : false, 'par' : par && par.id ? par.id : false }) };\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tpar = this.get_node(par.parent);\n\t\t\t\t\t\t\ttmp = this.get_rules(par);\n\t\t\t\t\t\t\td++;\n\t\t\t\t\t\t} while(par);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn true;\n\t\t};\n\t\t/**\n\t\t * used to retrieve the type settings object for a node\n\t\t * @name get_rules(obj)\n\t\t * @param {mixed} obj the node to find the rules for\n\t\t * @return {Object}\n\t\t * @plugin types\n\t\t */\n\t\tthis.get_rules = function (obj) {\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(!obj) { return false; }\n\t\t\tvar tmp = this.get_type(obj, true);\n\t\t\tif(tmp.max_depth === undefined) { tmp.max_depth = -1; }\n\t\t\tif(tmp.max_children === undefined) { tmp.max_children = -1; }\n\t\t\tif(tmp.valid_children === undefined) { tmp.valid_children = -1; }\n\t\t\treturn tmp;\n\t\t};\n\t\t/**\n\t\t * used to retrieve the type string or settings object for a node\n\t\t * @name get_type(obj [, rules])\n\t\t * @param {mixed} obj the node to find the rules for\n\t\t * @param {Boolean} rules if set to `true` instead of a string the settings object will be returned\n\t\t * @return {String|Object}\n\t\t * @plugin types\n\t\t */\n\t\tthis.get_type = function (obj, rules) {\n\t\t\tobj = this.get_node(obj);\n\t\t\treturn (!obj) ? false : ( rules ? $.extend({ 'type' : obj.type }, this.settings.types[obj.type]) : obj.type);\n\t\t};\n\t\t/**\n\t\t * used to change a node's type\n\t\t * @name set_type(obj, type)\n\t\t * @param {mixed} obj the node to change\n\t\t * @param {String} type the new type\n\t\t * @plugin types\n\t\t */\n\t\tthis.set_type = function (obj, type) {\n\t\t\tvar m = this._model.data, t, t1, t2, old_type, old_icon, k, d, a;\n\t\t\tif($.isArray(obj)) {\n\t\t\t\tobj = obj.slice();\n\t\t\t\tfor(t1 = 0, t2 = obj.length; t1 < t2; t1++) {\n\t\t\t\t\tthis.set_type(obj[t1], type);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tt = this.settings.types;\n\t\t\tobj = this.get_node(obj);\n\t\t\tif(!t[type] || !obj) { return false; }\n\t\t\td = this.get_node(obj, true);\n\t\t\tif (d && d.length) {\n\t\t\t\ta = d.children('.jstree-anchor');\n\t\t\t}\n\t\t\told_type = obj.type;\n\t\t\told_icon = this.get_icon(obj);\n\t\t\tobj.type = type;\n\t\t\tif(old_icon === true || !t[old_type] || (t[old_type].icon !== undefined && old_icon === t[old_type].icon)) {\n\t\t\t\tthis.set_icon(obj, t[type].icon !== undefined ? t[type].icon : true);\n\t\t\t}\n\n\t\t\t// remove old type props\n\t\t\tif(t[old_type] && t[old_type].li_attr !== undefined && typeof t[old_type].li_attr === 'object') {\n\t\t\t\tfor (k in t[old_type].li_attr) {\n\t\t\t\t\tif (t[old_type].li_attr.hasOwnProperty(k)) {\n\t\t\t\t\t\tif (k === 'id') {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (k === 'class') {\n\t\t\t\t\t\t\tm[obj.id].li_attr['class'] = (m[obj.id].li_attr['class'] || '').replace(t[old_type].li_attr[k], '');\n\t\t\t\t\t\t\tif (d) { d.removeClass(t[old_type].li_attr[k]); }\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (m[obj.id].li_attr[k] === t[old_type].li_attr[k]) {\n\t\t\t\t\t\t\tm[obj.id].li_attr[k] = null;\n\t\t\t\t\t\t\tif (d) { d.removeAttr(k); }\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(t[old_type] && t[old_type].a_attr !== undefined && typeof t[old_type].a_attr === 'object') {\n\t\t\t\tfor (k in t[old_type].a_attr) {\n\t\t\t\t\tif (t[old_type].a_attr.hasOwnProperty(k)) {\n\t\t\t\t\t\tif (k === 'id') {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (k === 'class') {\n\t\t\t\t\t\t\tm[obj.id].a_attr['class'] = (m[obj.id].a_attr['class'] || '').replace(t[old_type].a_attr[k], '');\n\t\t\t\t\t\t\tif (a) { a.removeClass(t[old_type].a_attr[k]); }\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (m[obj.id].a_attr[k] === t[old_type].a_attr[k]) {\n\t\t\t\t\t\t\tif (k === 'href') {\n\t\t\t\t\t\t\t\tm[obj.id].a_attr[k] = '#';\n\t\t\t\t\t\t\t\tif (a) { a.attr('href', '#'); }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tdelete m[obj.id].a_attr[k];\n\t\t\t\t\t\t\t\tif (a) { a.removeAttr(k); }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// add new props\n\t\t\tif(t[type].li_attr !== undefined && typeof t[type].li_attr === 'object') {\n\t\t\t\tfor (k in t[type].li_attr) {\n\t\t\t\t\tif (t[type].li_attr.hasOwnProperty(k)) {\n\t\t\t\t\t\tif (k === 'id') {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (m[obj.id].li_attr[k] === undefined) {\n\t\t\t\t\t\t\tm[obj.id].li_attr[k] = t[type].li_attr[k];\n\t\t\t\t\t\t\tif (d) {\n\t\t\t\t\t\t\t\tif (k === 'class') {\n\t\t\t\t\t\t\t\t\td.addClass(t[type].li_attr[k]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\td.attr(k, t[type].li_attr[k]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (k === 'class') {\n\t\t\t\t\t\t\tm[obj.id].li_attr['class'] = t[type].li_attr[k] + ' ' + m[obj.id].li_attr['class'];\n\t\t\t\t\t\t\tif (d) { d.addClass(t[type].li_attr[k]); }\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(t[type].a_attr !== undefined && typeof t[type].a_attr === 'object') {\n\t\t\t\tfor (k in t[type].a_attr) {\n\t\t\t\t\tif (t[type].a_attr.hasOwnProperty(k)) {\n\t\t\t\t\t\tif (k === 'id') {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (m[obj.id].a_attr[k] === undefined) {\n\t\t\t\t\t\t\tm[obj.id].a_attr[k] = t[type].a_attr[k];\n\t\t\t\t\t\t\tif (a) {\n\t\t\t\t\t\t\t\tif (k === 'class') {\n\t\t\t\t\t\t\t\t\ta.addClass(t[type].a_attr[k]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\ta.attr(k, t[type].a_attr[k]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (k === 'href' && m[obj.id].a_attr[k] === '#') {\n\t\t\t\t\t\t\tm[obj.id].a_attr['href'] = t[type].a_attr['href'];\n\t\t\t\t\t\t\tif (a) { a.attr('href', t[type].a_attr['href']); }\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (k === 'class') {\n\t\t\t\t\t\t\tm[obj.id].a_attr['class'] = t[type].a_attr['class'] + ' ' + m[obj.id].a_attr['class'];\n\t\t\t\t\t\t\tif (a) { a.addClass(t[type].a_attr[k]); }\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t};\n\t};\n\t// include the types plugin by default\n\t// $.jstree.defaults.plugins.push(\"types\");\n\n\n/**\n * ### Unique plugin\n *\n * Enforces that no nodes with the same name can coexist as siblings.\n */\n\n\t/**\n\t * stores all defaults for the unique plugin\n\t * @name $.jstree.defaults.unique\n\t * @plugin unique\n\t */\n\t$.jstree.defaults.unique = {\n\t\t/**\n\t\t * Indicates if the comparison should be case sensitive. Default is `false`.\n\t\t * @name $.jstree.defaults.unique.case_sensitive\n\t\t * @plugin unique\n\t\t */\n\t\tcase_sensitive : false,\n\t\t/**\n\t\t * Indicates if white space should be trimmed before the comparison. Default is `false`.\n\t\t * @name $.jstree.defaults.unique.trim_whitespace\n\t\t * @plugin unique\n\t\t */\n\t\ttrim_whitespace : false,\n\t\t/**\n\t\t * A callback executed in the instance's scope when a new node is created and the name is already taken, the two arguments are the conflicting name and the counter. The default will produce results like `New node (2)`.\n\t\t * @name $.jstree.defaults.unique.duplicate\n\t\t * @plugin unique\n\t\t */\n\t\tduplicate : function (name, counter) {\n\t\t\treturn name + ' (' + counter + ')';\n\t\t}\n\t};\n\n\t$.jstree.plugins.unique = function (options, parent) {\n\t\tthis.check = function (chk, obj, par, pos, more) {\n\t\t\tif(parent.check.call(this, chk, obj, par, pos, more) === false) { return false; }\n\t\t\tobj = obj && obj.id ? obj : this.get_node(obj);\n\t\t\tpar = par && par.id ? par : this.get_node(par);\n\t\t\tif(!par || !par.children) { return true; }\n\t\t\tvar n = chk === \"rename_node\" ? pos : obj.text,\n\t\t\t\tc = [],\n\t\t\t\ts = this.settings.unique.case_sensitive,\n\t\t\t\tw = this.settings.unique.trim_whitespace,\n\t\t\t\tm = this._model.data, i, j, t;\n\t\t\tfor(i = 0, j = par.children.length; i < j; i++) {\n\t\t\t\tt = m[par.children[i]].text;\n\t\t\t\tif (!s) {\n\t\t\t\t\tt = t.toLowerCase();\n\t\t\t\t}\n\t\t\t\tif (w) {\n\t\t\t\t\tt = t.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\t\t\t\t}\n\t\t\t\tc.push(t);\n\t\t\t}\n\t\t\tif(!s) { n = n.toLowerCase(); }\n\t\t\tif (w) { n = n.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, ''); }\n\t\t\tswitch(chk) {\n\t\t\t\tcase \"delete_node\":\n\t\t\t\t\treturn true;\n\t\t\t\tcase \"rename_node\":\n\t\t\t\t\tt = obj.text || '';\n\t\t\t\t\tif (!s) {\n\t\t\t\t\t\tt = t.toLowerCase();\n\t\t\t\t\t}\n\t\t\t\t\tif (w) {\n\t\t\t\t\t\tt = t.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\t\t\t\t\t}\n\t\t\t\t\ti = ($.inArray(n, c) === -1 || (obj.text && t === n));\n\t\t\t\t\tif(!i) {\n\t\t\t\t\t\tthis._data.core.last_error = { 'error' : 'check', 'plugin' : 'unique', 'id' : 'unique_01', 'reason' : 'Child with name ' + n + ' already exists. Preventing: ' + chk, 'data' : JSON.stringify({ 'chk' : chk, 'pos' : pos, 'obj' : obj && obj.id ? obj.id : false, 'par' : par && par.id ? par.id : false }) };\n\t\t\t\t\t}\n\t\t\t\t\treturn i;\n\t\t\t\tcase \"create_node\":\n\t\t\t\t\ti = ($.inArray(n, c) === -1);\n\t\t\t\t\tif(!i) {\n\t\t\t\t\t\tthis._data.core.last_error = { 'error' : 'check', 'plugin' : 'unique', 'id' : 'unique_04', 'reason' : 'Child with name ' + n + ' already exists. Preventing: ' + chk, 'data' : JSON.stringify({ 'chk' : chk, 'pos' : pos, 'obj' : obj && obj.id ? obj.id : false, 'par' : par && par.id ? par.id : false }) };\n\t\t\t\t\t}\n\t\t\t\t\treturn i;\n\t\t\t\tcase \"copy_node\":\n\t\t\t\t\ti = ($.inArray(n, c) === -1);\n\t\t\t\t\tif(!i) {\n\t\t\t\t\t\tthis._data.core.last_error = { 'error' : 'check', 'plugin' : 'unique', 'id' : 'unique_02', 'reason' : 'Child with name ' + n + ' already exists. Preventing: ' + chk, 'data' : JSON.stringify({ 'chk' : chk, 'pos' : pos, 'obj' : obj && obj.id ? obj.id : false, 'par' : par && par.id ? par.id : false }) };\n\t\t\t\t\t}\n\t\t\t\t\treturn i;\n\t\t\t\tcase \"move_node\":\n\t\t\t\t\ti = ( (obj.parent === par.id && (!more || !more.is_multi)) || $.inArray(n, c) === -1);\n\t\t\t\t\tif(!i) {\n\t\t\t\t\t\tthis._data.core.last_error = { 'error' : 'check', 'plugin' : 'unique', 'id' : 'unique_03', 'reason' : 'Child with name ' + n + ' already exists. Preventing: ' + chk, 'data' : JSON.stringify({ 'chk' : chk, 'pos' : pos, 'obj' : obj && obj.id ? obj.id : false, 'par' : par && par.id ? par.id : false }) };\n\t\t\t\t\t}\n\t\t\t\t\treturn i;\n\t\t\t}\n\t\t\treturn true;\n\t\t};\n\t\tthis.create_node = function (par, node, pos, callback, is_loaded) {\n\t\t\tif(!node || node.text === undefined) {\n\t\t\t\tif(par === null) {\n\t\t\t\t\tpar = $.jstree.root;\n\t\t\t\t}\n\t\t\t\tpar = this.get_node(par);\n\t\t\t\tif(!par) {\n\t\t\t\t\treturn parent.create_node.call(this, par, node, pos, callback, is_loaded);\n\t\t\t\t}\n\t\t\t\tpos = pos === undefined ? \"last\" : pos;\n\t\t\t\tif(!pos.toString().match(/^(before|after)$/) && !is_loaded && !this.is_loaded(par)) {\n\t\t\t\t\treturn parent.create_node.call(this, par, node, pos, callback, is_loaded);\n\t\t\t\t}\n\t\t\t\tif(!node) { node = {}; }\n\t\t\t\tvar tmp, n, dpc, i, j, m = this._model.data, s = this.settings.unique.case_sensitive, w = this.settings.unique.trim_whitespace, cb = this.settings.unique.duplicate, t;\n\t\t\t\tn = tmp = this.get_string('New node');\n\t\t\t\tdpc = [];\n\t\t\t\tfor(i = 0, j = par.children.length; i < j; i++) {\n\t\t\t\t\tt = m[par.children[i]].text;\n\t\t\t\t\tif (!s) {\n\t\t\t\t\t\tt = t.toLowerCase();\n\t\t\t\t\t}\n\t\t\t\t\tif (w) {\n\t\t\t\t\t\tt = t.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\t\t\t\t\t}\n\t\t\t\t\tdpc.push(t);\n\t\t\t\t}\n\t\t\t\ti = 1;\n\t\t\t\tt = n;\n\t\t\t\tif (!s) {\n\t\t\t\t\tt = t.toLowerCase();\n\t\t\t\t}\n\t\t\t\tif (w) {\n\t\t\t\t\tt = t.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\t\t\t\t}\n\t\t\t\twhile($.inArray(t, dpc) !== -1) {\n\t\t\t\t\tn = cb.call(this, tmp, (++i)).toString();\n\t\t\t\t\tt = n;\n\t\t\t\t\tif (!s) {\n\t\t\t\t\t\tt = t.toLowerCase();\n\t\t\t\t\t}\n\t\t\t\t\tif (w) {\n\t\t\t\t\t\tt = t.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tnode.text = n;\n\t\t\t}\n\t\t\treturn parent.create_node.call(this, par, node, pos, callback, is_loaded);\n\t\t};\n\t};\n\n\t// include the unique plugin by default\n\t// $.jstree.defaults.plugins.push(\"unique\");\n\n\n/**\n * ### Wholerow plugin\n *\n * Makes each node appear block level. Making selection easier. May cause slow down for large trees in old browsers.\n */\n\n\tvar div = document.createElement('DIV');\n\tdiv.setAttribute('unselectable','on');\n\tdiv.setAttribute('role','presentation');\n\tdiv.className = 'jstree-wholerow';\n\tdiv.innerHTML = '&#160;';\n\t$.jstree.plugins.wholerow = function (options, parent) {\n\t\tthis.bind = function () {\n\t\t\tparent.bind.call(this);\n\n\t\t\tthis.element\n\t\t\t\t.on('ready.jstree set_state.jstree', $.proxy(function () {\n\t\t\t\t\t\tthis.hide_dots();\n\t\t\t\t\t}, this))\n\t\t\t\t.on(\"init.jstree loading.jstree ready.jstree\", $.proxy(function () {\n\t\t\t\t\t\t//div.style.height = this._data.core.li_height + 'px';\n\t\t\t\t\t\tthis.get_container_ul().addClass('jstree-wholerow-ul');\n\t\t\t\t\t}, this))\n\t\t\t\t.on(\"deselect_all.jstree\", $.proxy(function (e, data) {\n\t\t\t\t\t\tthis.element.find('.jstree-wholerow-clicked').removeClass('jstree-wholerow-clicked');\n\t\t\t\t\t}, this))\n\t\t\t\t.on(\"changed.jstree\", $.proxy(function (e, data) {\n\t\t\t\t\t\tthis.element.find('.jstree-wholerow-clicked').removeClass('jstree-wholerow-clicked');\n\t\t\t\t\t\tvar tmp = false, i, j;\n\t\t\t\t\t\tfor(i = 0, j = data.selected.length; i < j; i++) {\n\t\t\t\t\t\t\ttmp = this.get_node(data.selected[i], true);\n\t\t\t\t\t\t\tif(tmp && tmp.length) {\n\t\t\t\t\t\t\t\ttmp.children('.jstree-wholerow').addClass('jstree-wholerow-clicked');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}, this))\n\t\t\t\t.on(\"open_node.jstree\", $.proxy(function (e, data) {\n\t\t\t\t\t\tthis.get_node(data.node, true).find('.jstree-clicked').parent().children('.jstree-wholerow').addClass('jstree-wholerow-clicked');\n\t\t\t\t\t}, this))\n\t\t\t\t.on(\"hover_node.jstree dehover_node.jstree\", $.proxy(function (e, data) {\n\t\t\t\t\t\tif(e.type === \"hover_node\" && this.is_disabled(data.node)) { return; }\n\t\t\t\t\t\tthis.get_node(data.node, true).children('.jstree-wholerow')[e.type === \"hover_node\"?\"addClass\":\"removeClass\"]('jstree-wholerow-hovered');\n\t\t\t\t\t}, this))\n\t\t\t\t.on(\"contextmenu.jstree\", \".jstree-wholerow\", $.proxy(function (e) {\n\t\t\t\t\t\tif (this._data.contextmenu) {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\tvar tmp = $.Event('contextmenu', { metaKey : e.metaKey, ctrlKey : e.ctrlKey, altKey : e.altKey, shiftKey : e.shiftKey, pageX : e.pageX, pageY : e.pageY });\n\t\t\t\t\t\t\t$(e.currentTarget).closest(\".jstree-node\").children(\".jstree-anchor\").first().trigger(tmp);\n\t\t\t\t\t\t}\n\t\t\t\t\t}, this))\n\t\t\t\t/*!\n\t\t\t\t.on(\"mousedown.jstree touchstart.jstree\", \".jstree-wholerow\", function (e) {\n\t\t\t\t\t\tif(e.target === e.currentTarget) {\n\t\t\t\t\t\t\tvar a = $(e.currentTarget).closest(\".jstree-node\").children(\".jstree-anchor\");\n\t\t\t\t\t\t\te.target = a[0];\n\t\t\t\t\t\t\ta.trigger(e);\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t*/\n\t\t\t\t.on(\"click.jstree\", \".jstree-wholerow\", function (e) {\n\t\t\t\t\t\te.stopImmediatePropagation();\n\t\t\t\t\t\tvar tmp = $.Event('click', { metaKey : e.metaKey, ctrlKey : e.ctrlKey, altKey : e.altKey, shiftKey : e.shiftKey });\n\t\t\t\t\t\t$(e.currentTarget).closest(\".jstree-node\").children(\".jstree-anchor\").first().trigger(tmp).focus();\n\t\t\t\t\t})\n\t\t\t\t.on(\"dblclick.jstree\", \".jstree-wholerow\", function (e) {\n\t\t\t\t\t\te.stopImmediatePropagation();\n\t\t\t\t\t\tvar tmp = $.Event('dblclick', { metaKey : e.metaKey, ctrlKey : e.ctrlKey, altKey : e.altKey, shiftKey : e.shiftKey });\n\t\t\t\t\t\t$(e.currentTarget).closest(\".jstree-node\").children(\".jstree-anchor\").first().trigger(tmp).focus();\n\t\t\t\t\t})\n\t\t\t\t.on(\"click.jstree\", \".jstree-leaf > .jstree-ocl\", $.proxy(function (e) {\n\t\t\t\t\t\te.stopImmediatePropagation();\n\t\t\t\t\t\tvar tmp = $.Event('click', { metaKey : e.metaKey, ctrlKey : e.ctrlKey, altKey : e.altKey, shiftKey : e.shiftKey });\n\t\t\t\t\t\t$(e.currentTarget).closest(\".jstree-node\").children(\".jstree-anchor\").first().trigger(tmp).focus();\n\t\t\t\t\t}, this))\n\t\t\t\t.on(\"mouseover.jstree\", \".jstree-wholerow, .jstree-icon\", $.proxy(function (e) {\n\t\t\t\t\t\te.stopImmediatePropagation();\n\t\t\t\t\t\tif(!this.is_disabled(e.currentTarget)) {\n\t\t\t\t\t\t\tthis.hover_node(e.currentTarget);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}, this))\n\t\t\t\t.on(\"mouseleave.jstree\", \".jstree-node\", $.proxy(function (e) {\n\t\t\t\t\t\tthis.dehover_node(e.currentTarget);\n\t\t\t\t\t}, this));\n\t\t};\n\t\tthis.teardown = function () {\n\t\t\tif(this.settings.wholerow) {\n\t\t\t\tthis.element.find(\".jstree-wholerow\").remove();\n\t\t\t}\n\t\t\tparent.teardown.call(this);\n\t\t};\n\t\tthis.redraw_node = function(obj, deep, callback, force_render) {\n\t\t\tobj = parent.redraw_node.apply(this, arguments);\n\t\t\tif(obj) {\n\t\t\t\tvar tmp = div.cloneNode(true);\n\t\t\t\t//tmp.style.height = this._data.core.li_height + 'px';\n\t\t\t\tif($.inArray(obj.id, this._data.core.selected) !== -1) { tmp.className += ' jstree-wholerow-clicked'; }\n\t\t\t\tif(this._data.core.focused && this._data.core.focused === obj.id) { tmp.className += ' jstree-wholerow-hovered'; }\n\t\t\t\tobj.insertBefore(tmp, obj.childNodes[0]);\n\t\t\t}\n\t\t\treturn obj;\n\t\t};\n\t};\n\t// include the wholerow plugin by default\n\t// $.jstree.defaults.plugins.push(\"wholerow\");\n\tif(window.customElements && Object && Object.create) {\n\t\tvar proto = Object.create(HTMLElement.prototype);\n\t\tproto.createdCallback = function () {\n\t\t\tvar c = { core : {}, plugins : [] }, i;\n\t\t\tfor(i in $.jstree.plugins) {\n\t\t\t\tif($.jstree.plugins.hasOwnProperty(i) && this.attributes[i]) {\n\t\t\t\t\tc.plugins.push(i);\n\t\t\t\t\tif(this.getAttribute(i) && JSON.parse(this.getAttribute(i))) {\n\t\t\t\t\t\tc[i] = JSON.parse(this.getAttribute(i));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(i in $.jstree.defaults.core) {\n\t\t\t\tif($.jstree.defaults.core.hasOwnProperty(i) && this.attributes[i]) {\n\t\t\t\t\tc.core[i] = JSON.parse(this.getAttribute(i)) || this.getAttribute(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$(this).jstree(c);\n\t\t};\n\t\t// proto.attributeChangedCallback = function (name, previous, value) { };\n\t\ttry {\n\t\t\twindow.customElements.define(\"vakata-jstree\", function() {}, { prototype: proto });\n\t\t} catch (ignore) { }\n\t}\n\n}));","Ember.libraries.register('Ember CLI jsTree', '1.0.12')","if (typeof FastBoot === 'undefined') {\n      var preferNative = false;\n      (function (global) {\n  define('fetch', ['exports'], function (self) {\n    'use strict';\n\n    var Promise = global.Ember.RSVP.Promise;\n    var supportProps = ['FormData', 'FileReader', 'Blob', 'URLSearchParams', 'Symbol', 'ArrayBuffer'];\n    var polyfillProps = ['fetch', 'Headers', 'Request', 'Response', 'AbortController'];\n    var combinedProps = supportProps;\n\n    if (preferNative) {\n      combinedProps = supportProps.concat(polyfillProps);\n    }\n\n    combinedProps.forEach(function (prop) {\n      if (global[prop]) {\n        Object.defineProperty(self, prop, {\n          configurable: true,\n          get: function () {\n            return global[prop];\n          },\n          set: function (v) {\n            global[prop] = v;\n          }\n        });\n      }\n    });\n\n    (function () {\n      'use strict';\n\n      class Emitter {\n        constructor() {\n          Object.defineProperty(this, 'listeners', {\n            value: {},\n            writable: true,\n            configurable: true\n          });\n        }\n\n        addEventListener(type, callback) {\n          if (!(type in this.listeners)) {\n            this.listeners[type] = [];\n          }\n\n          this.listeners[type].push(callback);\n        }\n\n        removeEventListener(type, callback) {\n          if (!(type in this.listeners)) {\n            return;\n          }\n\n          const stack = this.listeners[type];\n\n          for (let i = 0, l = stack.length; i < l; i++) {\n            if (stack[i] === callback) {\n              stack.splice(i, 1);\n              return;\n            }\n          }\n        }\n\n        dispatchEvent(event) {\n          if (!(event.type in this.listeners)) {\n            return;\n          }\n\n          const debounce = callback => {\n            setTimeout(() => callback.call(this, event));\n          };\n\n          const stack = this.listeners[event.type];\n\n          for (let i = 0, l = stack.length; i < l; i++) {\n            debounce(stack[i]);\n          }\n\n          return !event.defaultPrevented;\n        }\n\n      }\n\n      class AbortSignal extends Emitter {\n        constructor() {\n          super(); // Some versions of babel does not transpile super() correctly for IE <= 10, if the parent\n          // constructor has failed to run, then \"this.listeners\" will still be undefined and then we call\n          // the parent constructor directly instead as a workaround. For general details, see babel bug:\n          // https://github.com/babel/babel/issues/3041\n          // This hack was added as a fix for the issue described here:\n          // https://github.com/Financial-Times/polyfill-library/pull/59#issuecomment-477558042\n\n          if (!this.listeners) {\n            Emitter.call(this);\n          } // Compared to assignment, Object.defineProperty makes properties non-enumerable by default and\n          // we want Object.keys(new AbortController().signal) to be [] for compat with the native impl\n\n\n          Object.defineProperty(this, 'aborted', {\n            value: false,\n            writable: true,\n            configurable: true\n          });\n          Object.defineProperty(this, 'onabort', {\n            value: null,\n            writable: true,\n            configurable: true\n          });\n        }\n\n        toString() {\n          return '[object AbortSignal]';\n        }\n\n        dispatchEvent(event) {\n          if (event.type === 'abort') {\n            this.aborted = true;\n\n            if (typeof this.onabort === 'function') {\n              this.onabort.call(this, event);\n            }\n          }\n\n          super.dispatchEvent(event);\n        }\n\n      }\n\n      class AbortController {\n        constructor() {\n          // Compared to assignment, Object.defineProperty makes properties non-enumerable by default and\n          // we want Object.keys(new AbortController()) to be [] for compat with the native impl\n          Object.defineProperty(this, 'signal', {\n            value: new AbortSignal(),\n            writable: true,\n            configurable: true\n          });\n        }\n\n        abort() {\n          let event;\n\n          try {\n            event = new Event('abort');\n          } catch (e) {\n            if (typeof document !== 'undefined') {\n              if (!document.createEvent) {\n                // For Internet Explorer 8:\n                event = document.createEventObject();\n                event.type = 'abort';\n              } else {\n                // For Internet Explorer 11:\n                event = document.createEvent('Event');\n                event.initEvent('abort', false, false);\n              }\n            } else {\n              // Fallback where document isn't available:\n              event = {\n                type: 'abort',\n                bubbles: false,\n                cancelable: false\n              };\n            }\n          }\n\n          this.signal.dispatchEvent(event);\n        }\n\n        toString() {\n          return '[object AbortController]';\n        }\n\n      }\n\n      if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n        // These are necessary to make sure that we get correct output for:\n        // Object.prototype.toString.call(new AbortController())\n        AbortController.prototype[Symbol.toStringTag] = 'AbortController';\n        AbortSignal.prototype[Symbol.toStringTag] = 'AbortSignal';\n      }\n\n      function polyfillNeeded(self) {\n        if (self.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL) {\n          console.log('__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill');\n          return true;\n        } // Note that the \"unfetch\" minimal fetch polyfill defines fetch() without\n        // defining window.Request, and this polyfill need to work on top of unfetch\n        // so the below feature detection needs the !self.AbortController part.\n        // The Request.prototype check is also needed because Safari versions 11.1.2\n        // up to and including 12.1.x has a window.AbortController present but still\n        // does NOT correctly implement abortable fetch:\n        // https://bugs.webkit.org/show_bug.cgi?id=174980#c2\n\n\n        return typeof self.Request === 'function' && !self.Request.prototype.hasOwnProperty('signal') || !self.AbortController;\n      }\n\n      (function (self) {\n        if (!polyfillNeeded(self)) {\n          return;\n        }\n\n        self.AbortController = AbortController;\n        self.AbortSignal = AbortSignal;\n      })(typeof self !== 'undefined' ? self : global);\n    })();\n\n    var WHATWGFetch = function (exports) {\n      'use strict';\n\n      var support = {\n        searchParams: 'URLSearchParams' in self,\n        iterable: 'Symbol' in self && 'iterator' in Symbol,\n        blob: 'FileReader' in self && 'Blob' in self && function () {\n          try {\n            new Blob();\n            return true;\n          } catch (e) {\n            return false;\n          }\n        }(),\n        formData: 'FormData' in self,\n        arrayBuffer: 'ArrayBuffer' in self\n      };\n\n      function isDataView(obj) {\n        return obj && DataView.prototype.isPrototypeOf(obj);\n      }\n\n      if (support.arrayBuffer) {\n        var viewClasses = ['[object Int8Array]', '[object Uint8Array]', '[object Uint8ClampedArray]', '[object Int16Array]', '[object Uint16Array]', '[object Int32Array]', '[object Uint32Array]', '[object Float32Array]', '[object Float64Array]'];\n\n        var isArrayBufferView = ArrayBuffer.isView || function (obj) {\n          return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1;\n        };\n      }\n\n      function normalizeName(name) {\n        if (typeof name !== 'string') {\n          name = String(name);\n        }\n\n        if (/[^a-z0-9\\-#$%&'*+.^_`|~]/i.test(name)) {\n          throw new TypeError('Invalid character in header field name');\n        }\n\n        return name.toLowerCase();\n      }\n\n      function normalizeValue(value) {\n        if (typeof value !== 'string') {\n          value = String(value);\n        }\n\n        return value;\n      } // Build a destructive iterator for the value list\n\n\n      function iteratorFor(items) {\n        var iterator = {\n          next: function () {\n            var value = items.shift();\n            return {\n              done: value === undefined,\n              value: value\n            };\n          }\n        };\n\n        if (support.iterable) {\n          iterator[Symbol.iterator] = function () {\n            return iterator;\n          };\n        }\n\n        return iterator;\n      }\n\n      function Headers(headers) {\n        this.map = {};\n\n        if (headers instanceof Headers) {\n          headers.forEach(function (value, name) {\n            this.append(name, value);\n          }, this);\n        } else if (Array.isArray(headers)) {\n          headers.forEach(function (header) {\n            this.append(header[0], header[1]);\n          }, this);\n        } else if (headers) {\n          Object.getOwnPropertyNames(headers).forEach(function (name) {\n            this.append(name, headers[name]);\n          }, this);\n        }\n      }\n\n      Headers.prototype.append = function (name, value) {\n        name = normalizeName(name);\n        value = normalizeValue(value);\n        var oldValue = this.map[name];\n        this.map[name] = oldValue ? oldValue + ', ' + value : value;\n      };\n\n      Headers.prototype['delete'] = function (name) {\n        delete this.map[normalizeName(name)];\n      };\n\n      Headers.prototype.get = function (name) {\n        name = normalizeName(name);\n        return this.has(name) ? this.map[name] : null;\n      };\n\n      Headers.prototype.has = function (name) {\n        return this.map.hasOwnProperty(normalizeName(name));\n      };\n\n      Headers.prototype.set = function (name, value) {\n        this.map[normalizeName(name)] = normalizeValue(value);\n      };\n\n      Headers.prototype.forEach = function (callback, thisArg) {\n        for (var name in this.map) {\n          if (this.map.hasOwnProperty(name)) {\n            callback.call(thisArg, this.map[name], name, this);\n          }\n        }\n      };\n\n      Headers.prototype.keys = function () {\n        var items = [];\n        this.forEach(function (value, name) {\n          items.push(name);\n        });\n        return iteratorFor(items);\n      };\n\n      Headers.prototype.values = function () {\n        var items = [];\n        this.forEach(function (value) {\n          items.push(value);\n        });\n        return iteratorFor(items);\n      };\n\n      Headers.prototype.entries = function () {\n        var items = [];\n        this.forEach(function (value, name) {\n          items.push([name, value]);\n        });\n        return iteratorFor(items);\n      };\n\n      if (support.iterable) {\n        Headers.prototype[Symbol.iterator] = Headers.prototype.entries;\n      }\n\n      function consumed(body) {\n        if (body.bodyUsed) {\n          return Promise.reject(new TypeError('Already read'));\n        }\n\n        body.bodyUsed = true;\n      }\n\n      function fileReaderReady(reader) {\n        return new Promise(function (resolve, reject) {\n          reader.onload = function () {\n            resolve(reader.result);\n          };\n\n          reader.onerror = function () {\n            reject(reader.error);\n          };\n        });\n      }\n\n      function readBlobAsArrayBuffer(blob) {\n        var reader = new FileReader();\n        var promise = fileReaderReady(reader);\n        reader.readAsArrayBuffer(blob);\n        return promise;\n      }\n\n      function readBlobAsText(blob) {\n        var reader = new FileReader();\n        var promise = fileReaderReady(reader);\n        reader.readAsText(blob);\n        return promise;\n      }\n\n      function readArrayBufferAsText(buf) {\n        var view = new Uint8Array(buf);\n        var chars = new Array(view.length);\n\n        for (var i = 0; i < view.length; i++) {\n          chars[i] = String.fromCharCode(view[i]);\n        }\n\n        return chars.join('');\n      }\n\n      function bufferClone(buf) {\n        if (buf.slice) {\n          return buf.slice(0);\n        } else {\n          var view = new Uint8Array(buf.byteLength);\n          view.set(new Uint8Array(buf));\n          return view.buffer;\n        }\n      }\n\n      function Body() {\n        this.bodyUsed = false;\n\n        this._initBody = function (body) {\n          this._bodyInit = body;\n\n          if (!body) {\n            this._bodyText = '';\n          } else if (typeof body === 'string') {\n            this._bodyText = body;\n          } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n            this._bodyBlob = body;\n          } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n            this._bodyFormData = body;\n          } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n            this._bodyText = body.toString();\n          } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n            this._bodyArrayBuffer = bufferClone(body.buffer); // IE 10-11 can't handle a DataView body.\n\n            this._bodyInit = new Blob([this._bodyArrayBuffer]);\n          } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n            this._bodyArrayBuffer = bufferClone(body);\n          } else {\n            this._bodyText = body = Object.prototype.toString.call(body);\n          }\n\n          if (!this.headers.get('content-type')) {\n            if (typeof body === 'string') {\n              this.headers.set('content-type', 'text/plain;charset=UTF-8');\n            } else if (this._bodyBlob && this._bodyBlob.type) {\n              this.headers.set('content-type', this._bodyBlob.type);\n            } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n              this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');\n            }\n          }\n        };\n\n        if (support.blob) {\n          this.blob = function () {\n            var rejected = consumed(this);\n\n            if (rejected) {\n              return rejected;\n            }\n\n            if (this._bodyBlob) {\n              return Promise.resolve(this._bodyBlob);\n            } else if (this._bodyArrayBuffer) {\n              return Promise.resolve(new Blob([this._bodyArrayBuffer]));\n            } else if (this._bodyFormData) {\n              throw new Error('could not read FormData body as blob');\n            } else {\n              return Promise.resolve(new Blob([this._bodyText]));\n            }\n          };\n\n          this.arrayBuffer = function () {\n            if (this._bodyArrayBuffer) {\n              return consumed(this) || Promise.resolve(this._bodyArrayBuffer);\n            } else {\n              return this.blob().then(readBlobAsArrayBuffer);\n            }\n          };\n        }\n\n        this.text = function () {\n          var rejected = consumed(this);\n\n          if (rejected) {\n            return rejected;\n          }\n\n          if (this._bodyBlob) {\n            return readBlobAsText(this._bodyBlob);\n          } else if (this._bodyArrayBuffer) {\n            return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer));\n          } else if (this._bodyFormData) {\n            throw new Error('could not read FormData body as text');\n          } else {\n            return Promise.resolve(this._bodyText);\n          }\n        };\n\n        if (support.formData) {\n          this.formData = function () {\n            return this.text().then(decode);\n          };\n        }\n\n        this.json = function () {\n          return this.text().then(JSON.parse);\n        };\n\n        return this;\n      } // HTTP methods whose capitalization should be normalized\n\n\n      var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];\n\n      function normalizeMethod(method) {\n        var upcased = method.toUpperCase();\n        return methods.indexOf(upcased) > -1 ? upcased : method;\n      }\n\n      function Request(input, options) {\n        options = options || {};\n        var body = options.body;\n\n        if (input instanceof Request) {\n          if (input.bodyUsed) {\n            throw new TypeError('Already read');\n          }\n\n          this.url = input.url;\n          this.credentials = input.credentials;\n\n          if (!options.headers) {\n            this.headers = new Headers(input.headers);\n          }\n\n          this.method = input.method;\n          this.mode = input.mode;\n          this.signal = input.signal;\n\n          if (!body && input._bodyInit != null) {\n            body = input._bodyInit;\n            input.bodyUsed = true;\n          }\n        } else {\n          this.url = String(input);\n        }\n\n        this.credentials = options.credentials || this.credentials || 'same-origin';\n\n        if (options.headers || !this.headers) {\n          this.headers = new Headers(options.headers);\n        }\n\n        this.method = normalizeMethod(options.method || this.method || 'GET');\n        this.mode = options.mode || this.mode || null;\n        this.signal = options.signal || this.signal;\n        this.referrer = null;\n\n        if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n          throw new TypeError('Body not allowed for GET or HEAD requests');\n        }\n\n        this._initBody(body);\n      }\n\n      Request.prototype.clone = function () {\n        return new Request(this, {\n          body: this._bodyInit\n        });\n      };\n\n      function decode(body) {\n        var form = new FormData();\n        body.trim().split('&').forEach(function (bytes) {\n          if (bytes) {\n            var split = bytes.split('=');\n            var name = split.shift().replace(/\\+/g, ' ');\n            var value = split.join('=').replace(/\\+/g, ' ');\n            form.append(decodeURIComponent(name), decodeURIComponent(value));\n          }\n        });\n        return form;\n      }\n\n      function parseHeaders(rawHeaders) {\n        var headers = new Headers(); // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n        // https://tools.ietf.org/html/rfc7230#section-3.2\n\n        var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ');\n        preProcessedHeaders.split(/\\r?\\n/).forEach(function (line) {\n          var parts = line.split(':');\n          var key = parts.shift().trim();\n\n          if (key) {\n            var value = parts.join(':').trim();\n            headers.append(key, value);\n          }\n        });\n        return headers;\n      }\n\n      Body.call(Request.prototype);\n\n      function Response(bodyInit, options) {\n        if (!options) {\n          options = {};\n        }\n\n        this.type = 'default';\n        this.status = options.status === undefined ? 200 : options.status;\n        this.ok = this.status >= 200 && this.status < 300;\n        this.statusText = 'statusText' in options ? options.statusText : 'OK';\n        this.headers = new Headers(options.headers);\n        this.url = options.url || '';\n\n        this._initBody(bodyInit);\n      }\n\n      Body.call(Response.prototype);\n\n      Response.prototype.clone = function () {\n        return new Response(this._bodyInit, {\n          status: this.status,\n          statusText: this.statusText,\n          headers: new Headers(this.headers),\n          url: this.url\n        });\n      };\n\n      Response.error = function () {\n        var response = new Response(null, {\n          status: 0,\n          statusText: ''\n        });\n        response.type = 'error';\n        return response;\n      };\n\n      var redirectStatuses = [301, 302, 303, 307, 308];\n\n      Response.redirect = function (url, status) {\n        if (redirectStatuses.indexOf(status) === -1) {\n          throw new RangeError('Invalid status code');\n        }\n\n        return new Response(null, {\n          status: status,\n          headers: {\n            location: url\n          }\n        });\n      };\n\n      exports.DOMException = self.DOMException;\n\n      try {\n        new exports.DOMException();\n      } catch (err) {\n        exports.DOMException = function (message, name) {\n          this.message = message;\n          this.name = name;\n          var error = Error(message);\n          this.stack = error.stack;\n        };\n\n        exports.DOMException.prototype = Object.create(Error.prototype);\n        exports.DOMException.prototype.constructor = exports.DOMException;\n      }\n\n      function fetch(input, init) {\n        return new Promise(function (resolve, reject) {\n          var request = new Request(input, init);\n\n          if (request.signal && request.signal.aborted) {\n            return reject(new exports.DOMException('Aborted', 'AbortError'));\n          }\n\n          var xhr = new XMLHttpRequest();\n\n          function abortXhr() {\n            xhr.abort();\n          }\n\n          xhr.onload = function () {\n            var options = {\n              status: xhr.status,\n              statusText: xhr.statusText,\n              headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n            };\n            options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');\n            var body = 'response' in xhr ? xhr.response : xhr.responseText;\n            resolve(new Response(body, options));\n          };\n\n          xhr.onerror = function () {\n            reject(new TypeError('Network request failed'));\n          };\n\n          xhr.ontimeout = function () {\n            reject(new TypeError('Network request failed'));\n          };\n\n          xhr.onabort = function () {\n            reject(new exports.DOMException('Aborted', 'AbortError'));\n          };\n\n          xhr.open(request.method, request.url, true);\n\n          if (request.credentials === 'include') {\n            xhr.withCredentials = true;\n          } else if (request.credentials === 'omit') {\n            xhr.withCredentials = false;\n          }\n\n          if ('responseType' in xhr && support.blob) {\n            xhr.responseType = 'blob';\n          }\n\n          request.headers.forEach(function (value, name) {\n            xhr.setRequestHeader(name, value);\n          });\n\n          if (request.signal) {\n            request.signal.addEventListener('abort', abortXhr);\n\n            xhr.onreadystatechange = function () {\n              // DONE (success or failure)\n              if (xhr.readyState === 4) {\n                request.signal.removeEventListener('abort', abortXhr);\n              }\n            };\n          }\n\n          xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);\n        });\n      }\n\n      fetch.polyfill = true;\n\n      if (!self.fetch) {\n        self.fetch = fetch;\n        self.Headers = Headers;\n        self.Request = Request;\n        self.Response = Response;\n      }\n\n      exports.Headers = Headers;\n      exports.Request = Request;\n      exports.Response = Response;\n      exports.fetch = fetch;\n      return exports;\n    }({});\n\n    if (!self.fetch) {\n      throw new Error('fetch is not defined - maybe your browser targets are not covering everything you need?');\n    }\n\n    var pending = 0;\n\n    function decrement(result) {\n      pending--;\n      return result;\n    }\n\n    if (global.Ember.Test) {\n      global.Ember.Test.registerWaiter(function () {\n        return pending === 0;\n      });\n\n      self['default'] = function () {\n        pending++;\n        return self.fetch.apply(global, arguments).then(function (response) {\n          response.clone().blob().then(decrement, decrement);\n          return response;\n        }, function (reason) {\n          decrement(reason);\n          throw reason;\n        });\n      };\n    } else {\n      self['default'] = self.fetch;\n    }\n\n    supportProps.forEach(function (prop) {\n      delete self[prop];\n    });\n  });\n  define('fetch/ajax', ['exports'], function () {\n    throw new Error('You included `fetch/ajax` but it was renamed to `ember-fetch/ajax`');\n  });\n})(typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : this);\n    }","Ember.libraries.register('Ember Model Validator', '3.10.0');\n","/*! jQuery v1.11.3 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */\n!function(a,b){\"object\"==typeof module&&\"object\"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error(\"jQuery requires a window with a document\");return b(a)}:b(a)}(\"undefined\"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=\"1.11.3\",m=function(a,b){return new m.fn.init(a,b)},n=/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g,o=/^-ms-/,p=/-([\\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:\"\",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for(\"boolean\"==typeof g&&(j=g,g=arguments[h]||{},h++),\"object\"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:\"jQuery\"+(l+Math.random()).replace(/\\D/g,\"\"),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return\"function\"===m.type(a)},isArray:Array.isArray||function(a){return\"array\"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||\"object\"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,\"constructor\")&&!j.call(a.constructor.prototype,\"isPrototypeOf\"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+\"\":\"object\"==typeof a||\"function\"==typeof a?h[i.call(a)]||\"object\":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,\"ms-\").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?\"\":(a+\"\").replace(n,\"\")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,\"string\"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return\"string\"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each(\"Boolean Number String Function Array Date RegExp Object Error\".split(\" \"),function(a,b){h[\"[object \"+b+\"]\"]=b.toLowerCase()});function r(a){var b=\"length\"in a&&a.length,c=m.type(a);return\"function\"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:\"array\"===c||0===b||\"number\"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u=\"sizzle\"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K=\"checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped\",L=\"[\\\\x20\\\\t\\\\r\\\\n\\\\f]\",M=\"(?:\\\\\\\\.|[\\\\w-]|[^\\\\x00-\\\\xa0])+\",N=M.replace(\"w\",\"w#\"),O=\"\\\\[\"+L+\"*(\"+M+\")(?:\"+L+\"*([*^$|!~]?=)\"+L+\"*(?:'((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\"|(\"+N+\"))|)\"+L+\"*\\\\]\",P=\":(\"+M+\")(?:\\\\((('((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\")|((?:\\\\\\\\.|[^\\\\\\\\()[\\\\]]|\"+O+\")*)|.*)\\\\)|)\",Q=new RegExp(L+\"+\",\"g\"),R=new RegExp(\"^\"+L+\"+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)\"+L+\"+$\",\"g\"),S=new RegExp(\"^\"+L+\"*,\"+L+\"*\"),T=new RegExp(\"^\"+L+\"*([>+~]|\"+L+\")\"+L+\"*\"),U=new RegExp(\"=\"+L+\"*([^\\\\]'\\\"]*?)\"+L+\"*\\\\]\",\"g\"),V=new RegExp(P),W=new RegExp(\"^\"+N+\"$\"),X={ID:new RegExp(\"^#(\"+M+\")\"),CLASS:new RegExp(\"^\\\\.(\"+M+\")\"),TAG:new RegExp(\"^(\"+M.replace(\"w\",\"w*\")+\")\"),ATTR:new RegExp(\"^\"+O),PSEUDO:new RegExp(\"^\"+P),CHILD:new RegExp(\"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\\\(\"+L+\"*(even|odd|(([+-]|)(\\\\d*)n|)\"+L+\"*(?:([+-]|)\"+L+\"*(\\\\d+)|))\"+L+\"*\\\\)|)\",\"i\"),bool:new RegExp(\"^(?:\"+K+\")$\",\"i\"),needsContext:new RegExp(\"^\"+L+\"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\\\(\"+L+\"*((?:-\\\\d)?\\\\d*)\"+L+\"*\\\\)|)(?=[^-]|$)\",\"i\")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\\d$/i,$=/^[^{]+\\{\\s*\\[native \\w/,_=/^(?:#([\\w-]+)|(\\w+)|\\.([\\w-]+))$/,aa=/[+~]/,ba=/'|\\\\/g,ca=new RegExp(\"\\\\\\\\([\\\\da-f]{1,6}\"+L+\"?|(\"+L+\")|.)\",\"ig\"),da=function(a,b,c){var d=\"0x\"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,\"string\"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&\"object\"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute(\"id\"))?s=r.replace(ba,\"\\\\$&\"):b.setAttribute(\"id\",s),s=\"[id='\"+s+\"'] \",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(\",\")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute(\"id\")}}}return i(a.replace(R,\"$1\"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+\" \")>d.cacheLength&&delete b[a.shift()],b[c+\" \"]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement(\"div\");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split(\"|\"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return\"input\"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return(\"input\"===c||\"button\"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pa(a){return a&&\"undefined\"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?\"HTML\"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener(\"unload\",ea,!1):e.attachEvent&&e.attachEvent(\"onunload\",ea)),p=!f(g),c.attributes=ja(function(a){return a.className=\"i\",!a.getAttribute(\"className\")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment(\"\")),!a.getElementsByTagName(\"*\").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(\"undefined\"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute(\"id\")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){var c=\"undefined\"!=typeof a.getAttributeNode&&a.getAttributeNode(\"id\");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return\"undefined\"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if(\"*\"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML=\"<a id='\"+u+\"'></a><select id='\"+u+\"-\\f]' msallowcapture=''><option selected=''></option></select>\",a.querySelectorAll(\"[msallowcapture^='']\").length&&q.push(\"[*^$]=\"+L+\"*(?:''|\\\"\\\")\"),a.querySelectorAll(\"[selected]\").length||q.push(\"\\\\[\"+L+\"*(?:value|\"+K+\")\"),a.querySelectorAll(\"[id~=\"+u+\"-]\").length||q.push(\"~=\"),a.querySelectorAll(\":checked\").length||q.push(\":checked\"),a.querySelectorAll(\"a#\"+u+\"+*\").length||q.push(\".#.+[+~]\")}),ja(function(a){var b=g.createElement(\"input\");b.setAttribute(\"type\",\"hidden\"),a.appendChild(b).setAttribute(\"name\",\"D\"),a.querySelectorAll(\"[name=d]\").length&&q.push(\"name\"+L+\"*[*^$|!~]?=\"),a.querySelectorAll(\":enabled\").length||q.push(\":enabled\",\":disabled\"),a.querySelectorAll(\"*,:x\"),q.push(\",.*:\")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,\"div\"),s.call(a,\"[s!='']:x\"),r.push(\"!=\",P)}),q=q.length&&new RegExp(q.join(\"|\")),r=r.length&&new RegExp(r.join(\"|\")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,\"='$1']\"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.error=function(a){throw new Error(\"Syntax error, unrecognized expression: \"+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c=\"\",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if(\"string\"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:X,attrHandle:{},find:{},relative:{\">\":{dir:\"parentNode\",first:!0},\" \":{dir:\"parentNode\"},\"+\":{dir:\"previousSibling\",first:!0},\"~\":{dir:\"previousSibling\"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ca,da),a[3]=(a[3]||a[4]||a[5]||\"\").replace(ca,da),\"~=\"===a[2]&&(a[3]=\" \"+a[3]+\" \"),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),\"nth\"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*(\"even\"===a[3]||\"odd\"===a[3])),a[5]=+(a[7]+a[8]||\"odd\"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||\"\":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(\")\",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ca,da).toLowerCase();return\"*\"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+\" \"];return b||(b=new RegExp(\"(^|\"+L+\")\"+a+\"(\"+L+\"|$)\"))&&y(a,function(a){return b.test(\"string\"==typeof a.className&&a.className||\"undefined\"!=typeof a.getAttribute&&a.getAttribute(\"class\")||\"\")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?\"!=\"===b:b?(e+=\"\",\"=\"===b?e===c:\"!=\"===b?e!==c:\"^=\"===b?c&&0===e.indexOf(c):\"*=\"===b?c&&e.indexOf(c)>-1:\"$=\"===b?c&&e.slice(-c.length)===c:\"~=\"===b?(\" \"+e.replace(Q,\" \")+\" \").indexOf(c)>-1:\"|=\"===b?e===c||e.slice(0,c.length+1)===c+\"-\":!1):!0}},CHILD:function(a,b,c,d,e){var f=\"nth\"!==a.slice(0,3),g=\"last\"!==a.slice(-4),h=\"of-type\"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?\"nextSibling\":\"previousSibling\",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p=\"only\"===a&&!o&&\"nextSibling\"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error(\"unsupported pseudo: \"+a);return e[u]?e(b):e.length>1?(c=[a,a,\"\",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(R,\"$1\"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||\"\")||ga.error(\"unsupported lang: \"+a),a=a.replace(ca,da).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute(\"xml:lang\")||b.getAttribute(\"lang\"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+\"-\");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return\"input\"===b&&!!a.checked||\"option\"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return\"input\"===b&&\"button\"===a.type||\"button\"===b},text:function(a){var b;return\"input\"===a.nodeName.toLowerCase()&&\"text\"===a.type&&(null==(b=a.getAttribute(\"type\"))||\"text\"===b.toLowerCase())},first:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function qa(){}qa.prototype=d.filters=d.pseudos,d.setFilters=new qa,g=ga.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+\" \"];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R,\" \")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?ga.error(a):z(a,i).slice(0)};function ra(a){for(var b=0,c=a.length,d=\"\";c>b;b++)d+=a[b].value;return d}function sa(a,b,c){var d=b.dir,e=c&&\"parentNode\"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||\"*\",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[\" \"],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sa(ta(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:\" \"===a[i-2].type?\"*\":\"\"})).replace(R,\"$1\"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q=\"0\",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG(\"*\",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+\" \"];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n=\"function\"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&\"ID\"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split(\"\").sort(B).join(\"\")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement(\"div\"))}),ja(function(a){return a.innerHTML=\"<a href='#'></a>\",\"#\"===a.firstChild.getAttribute(\"href\")})||ka(\"type|href|height|width\",function(a,b,c){return c?void 0:a.getAttribute(b,\"type\"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML=\"<input/>\",a.firstChild.setAttribute(\"value\",\"\"),\"\"===a.firstChild.getAttribute(\"value\")})||ka(\"value\",function(a,b,c){return c||\"input\"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute(\"disabled\")})||ka(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);m.find=s,m.expr=s.selectors,m.expr[\":\"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\\w+)\\s*\\/?>(?:<\\/\\1>|)$/,v=/^.[^:#\\[\\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if(\"string\"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=\":not(\"+a+\")\"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if(\"string\"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+\" \"+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,\"string\"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\\s*(<[\\w\\W]+>)[^>]*|#([\\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if(\"string\"==typeof a){if(c=\"<\"===a.charAt(0)&&\">\"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?\"undefined\"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||\"string\"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?\"string\"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,\"parentNode\")},parentsUntil:function(a,b,c){return m.dir(a,\"parentNode\",c)},next:function(a){return D(a,\"nextSibling\")},prev:function(a){return D(a,\"previousSibling\")},nextAll:function(a){return m.dir(a,\"nextSibling\")},prevAll:function(a){return m.dir(a,\"previousSibling\")},nextUntil:function(a,b,c){return m.dir(a,\"nextSibling\",c)},prevUntil:function(a,b,c){return m.dir(a,\"previousSibling\",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,\"iframe\")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return\"Until\"!==a.slice(-5)&&(d=c),d&&\"string\"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a=\"string\"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);\"function\"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&\"string\"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[[\"resolve\",\"done\",m.Callbacks(\"once memory\"),\"resolved\"],[\"reject\",\"fail\",m.Callbacks(\"once memory\"),\"rejected\"],[\"notify\",\"progress\",m.Callbacks(\"memory\")]],c=\"pending\",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+\"With\"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+\"With\"](this===e?d:this,arguments),this},e[f[0]+\"With\"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler(\"ready\"),m(y).off(\"ready\")))}}});function I(){y.addEventListener?(y.removeEventListener(\"DOMContentLoaded\",J,!1),a.removeEventListener(\"load\",J,!1)):(y.detachEvent(\"onreadystatechange\",J),a.detachEvent(\"onload\",J))}function J(){(y.addEventListener||\"load\"===event.type||\"complete\"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),\"complete\"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener(\"DOMContentLoaded\",J,!1),a.addEventListener(\"load\",J,!1);else{y.attachEvent(\"onreadystatechange\",J),a.attachEvent(\"onload\",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll(\"left\")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K=\"undefined\",L;for(L in m(k))break;k.ownLast=\"0\"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName(\"body\")[0],c&&c.style&&(b=y.createElement(\"div\"),d=y.createElement(\"div\"),d.style.cssText=\"position:absolute;border:0;width:0;height:0;top:0;left:-9999px\",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText=\"display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1\",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement(\"div\");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+\" \").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute(\"classid\")===b};var M=/^(?:\\{[\\w\\W]*\\}|\\[[\\w\\W]*\\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d=\"data-\"+b.replace(N,\"-$1\").toLowerCase();if(c=a.getAttribute(d),\"string\"==typeof c){try{c=\"true\"===c?!0:\"false\"===c?!1:\"null\"===c?null:+c+\"\"===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if((\"data\"!==b||!m.isEmptyObject(a[b]))&&\"toJSON\"!==b)return!1;\n\nreturn!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||\"string\"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),(\"object\"==typeof b||\"function\"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),\"string\"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(\" \")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{\"applet \":!0,\"embed \":!0,\"object \":\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,\"parsedAttrs\"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf(\"data-\")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,\"parsedAttrs\",!0)}return e}return\"object\"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||\"fx\")+\"queue\",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||\"fx\";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};\"inprogress\"===e&&(e=c.shift(),d--),e&&(\"fx\"===b&&c.unshift(\"inprogress\"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+\"queueHooks\";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks(\"once memory\").add(function(){m._removeData(a,b+\"queue\"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return\"string\"!=typeof a&&(b=a,a=\"fx\",c--),arguments.length<c?m.queue(this[0],a):void 0===b?this:this.each(function(){var c=m.queue(this,a,b);m._queueHooks(this,a),\"fx\"===a&&\"inprogress\"!==c[0]&&m.dequeue(this,a)})},dequeue:function(a){return this.each(function(){m.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||\"fx\",[])},promise:function(a,b){var c,d=1,e=m.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};\"string\"!=typeof a&&(b=a,a=void 0),a=a||\"fx\";while(g--)c=m._data(f[g],a+\"queueHooks\"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\\d*\\.|)\\d+(?:[eE][+-]?\\d+|)/.source,T=[\"Top\",\"Right\",\"Bottom\",\"Left\"],U=function(a,b){return a=b||a,\"none\"===m.css(a,\"display\")||!m.contains(a.ownerDocument,a)},V=m.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if(\"object\"===m.type(c)){e=!0;for(h in c)m.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,m.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(m(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement(\"input\"),b=y.createElement(\"div\"),c=y.createDocumentFragment();if(b.innerHTML=\"  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>\",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName(\"tbody\").length,k.htmlSerialize=!!b.getElementsByTagName(\"link\").length,k.html5Clone=\"<:nav></:nav>\"!==y.createElement(\"nav\").cloneNode(!0).outerHTML,a.type=\"checkbox\",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML=\"<textarea>x</textarea>\",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML=\"<input type='radio' checked='checked' name='t'/>\",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent(\"onclick\",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement(\"div\");for(b in{submit:!0,change:!0,focusin:!0})c=\"on\"+b,(k[b+\"Bubbles\"]=c in a)||(d.setAttribute(c,\"t\"),k[b+\"Bubbles\"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\\.(.+)|)$/;function aa(){return!0}function ba(){return!1}function ca(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||\"\").match(E)||[\"\"],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||\"\").split(\".\").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(\".\")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent(\"on\"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||\"\").match(E)||[\"\"],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||\"\").split(\".\").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp(\"(^|\\\\.)\"+p.join(\"\\\\.(?:.*\\\\.|)\")+\"(\\\\.|$)\"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&(\"**\"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,\"events\"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,\"type\")?b.type:b,q=j.call(b,\"namespace\")?b.namespace.split(\".\"):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(\".\")>=0&&(q=p.split(\".\"),p=q.shift(),q.sort()),g=p.indexOf(\":\")<0&&\"on\"+p,b=b[m.expando]?b:new m.Event(p,\"object\"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join(\".\"),b.namespace_re=b.namespace?new RegExp(\"(^|\\\\.)\"+q.join(\"\\\\.(?:.*\\\\.|)\")+\"(\\\\.|$)\"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,\"events\")||{})[b.type]&&m._data(h,\"handle\"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,\"events\")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||\"click\"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||\"click\"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+\" \",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[m.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=Z.test(e)?this.mouseHooks:Y.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new m.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||y),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:\"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which\".split(\" \"),fixHooks:{},keyHooks:{props:\"char charCode key keyCode\".split(\" \"),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:\"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement\".split(\" \"),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||y,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==ca()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:\"focusin\"},blur:{trigger:function(){return this===ca()&&this.blur?(this.blur(),!1):void 0},delegateType:\"focusout\"},click:{trigger:function(){return m.nodeName(this,\"input\")&&\"checkbox\"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return m.nodeName(a.target,\"a\")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=m.extend(new m.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?m.event.trigger(e,null,b):m.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},m.removeEvent=y.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d=\"on\"+b;a.detachEvent&&(typeof a[d]===K&&(a[d]=null),a.detachEvent(d,c))},m.Event=function(a,b){return this instanceof m.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?aa:ba):this.type=a,b&&m.extend(this,b),this.timeStamp=a&&a.timeStamp||m.now(),void(this[m.expando]=!0)):new m.Event(a,b)},m.Event.prototype={isDefaultPrevented:ba,isPropagationStopped:ba,isImmediatePropagationStopped:ba,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=aa,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=aa,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=aa,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},m.each({mouseenter:\"mouseover\",mouseleave:\"mouseout\",pointerenter:\"pointerover\",pointerleave:\"pointerout\"},function(a,b){m.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!m.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.submitBubbles||(m.event.special.submit={setup:function(){return m.nodeName(this,\"form\")?!1:void m.event.add(this,\"click._submit keypress._submit\",function(a){var b=a.target,c=m.nodeName(b,\"input\")||m.nodeName(b,\"button\")?b.form:void 0;c&&!m._data(c,\"submitBubbles\")&&(m.event.add(c,\"submit._submit\",function(a){a._submit_bubble=!0}),m._data(c,\"submitBubbles\",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&m.event.simulate(\"submit\",this.parentNode,a,!0))},teardown:function(){return m.nodeName(this,\"form\")?!1:void m.event.remove(this,\"._submit\")}}),k.changeBubbles||(m.event.special.change={setup:function(){return X.test(this.nodeName)?((\"checkbox\"===this.type||\"radio\"===this.type)&&(m.event.add(this,\"propertychange._change\",function(a){\"checked\"===a.originalEvent.propertyName&&(this._just_changed=!0)}),m.event.add(this,\"click._change\",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),m.event.simulate(\"change\",this,a,!0)})),!1):void m.event.add(this,\"beforeactivate._change\",function(a){var b=a.target;X.test(b.nodeName)&&!m._data(b,\"changeBubbles\")&&(m.event.add(b,\"change._change\",function(a){!this.parentNode||a.isSimulated||a.isTrigger||m.event.simulate(\"change\",this.parentNode,a,!0)}),m._data(b,\"changeBubbles\",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||\"radio\"!==b.type&&\"checkbox\"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return m.event.remove(this,\"._change\"),!X.test(this.nodeName)}}),k.focusinBubbles||m.each({focus:\"focusin\",blur:\"focusout\"},function(a,b){var c=function(a){m.event.simulate(b,a.target,m.event.fix(a),!0)};m.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=m._data(d,b);e||d.addEventListener(a,c,!0),m._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=m._data(d,b)-1;e?m._data(d,b,e):(d.removeEventListener(a,c,!0),m._removeData(d,b))}}}),m.fn.extend({on:function(a,b,c,d,e){var f,g;if(\"object\"==typeof a){\"string\"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&(\"string\"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=ba;else if(!d)return this;return 1===e&&(g=d,d=function(a){return m().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=m.guid++)),this.each(function(){m.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,m(a.delegateTarget).off(d.namespace?d.origType+\".\"+d.namespace:d.origType,d.selector,d.handler),this;if(\"object\"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||\"function\"==typeof b)&&(c=b,b=void 0),c===!1&&(c=ba),this.each(function(){m.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){m.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?m.event.trigger(a,b,c,!0):void 0}});function da(a){var b=ea.split(\"|\"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var ea=\"abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video\",fa=/ jQuery\\d+=\"(?:null|\\d+)\"/g,ga=new RegExp(\"<(?:\"+ea+\")[\\\\s/>]\",\"i\"),ha=/^\\s+/,ia=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\\w:]+)[^>]*)\\/>/gi,ja=/<([\\w:]+)/,ka=/<tbody/i,la=/<|&#?\\w+;/,ma=/<(?:script|style|link)/i,na=/checked\\s*(?:[^=]|=\\s*.checked.)/i,oa=/^$|\\/(?:java|ecma)script/i,pa=/^true\\/(.*)/,qa=/^\\s*<!(?:\\[CDATA\\[|--)|(?:\\]\\]|--)>\\s*$/g,ra={option:[1,\"<select multiple='multiple'>\",\"</select>\"],legend:[1,\"<fieldset>\",\"</fieldset>\"],area:[1,\"<map>\",\"</map>\"],param:[1,\"<object>\",\"</object>\"],thead:[1,\"<table>\",\"</table>\"],tr:[2,\"<table><tbody>\",\"</tbody></table>\"],col:[2,\"<table><tbody></tbody><colgroup>\",\"</colgroup></table>\"],td:[3,\"<table><tbody><tr>\",\"</tr></tbody></table>\"],_default:k.htmlSerialize?[0,\"\",\"\"]:[1,\"X<div>\",\"</div>\"]},sa=da(y),ta=sa.appendChild(y.createElement(\"div\"));ra.optgroup=ra.option,ra.tbody=ra.tfoot=ra.colgroup=ra.caption=ra.thead,ra.th=ra.td;function ua(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||\"*\"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||\"*\"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ua(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function va(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wa(a,b){return m.nodeName(a,\"table\")&&m.nodeName(11!==b.nodeType?b:b.firstChild,\"tr\")?a.getElementsByTagName(\"tbody\")[0]||a.appendChild(a.ownerDocument.createElement(\"tbody\")):a}function xa(a){return a.type=(null!==m.find.attr(a,\"type\"))+\"/\"+a.type,a}function ya(a){var b=pa.exec(a.type);return b?a.type=b[1]:a.removeAttribute(\"type\"),a}function za(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,\"globalEval\",!b||m._data(b[d],\"globalEval\"))}function Aa(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Ba(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}\"script\"===c&&b.text!==a.text?(xa(b).text=a.text,ya(b)):\"object\"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):\"input\"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):\"option\"===c?b.defaultSelected=b.selected=a.defaultSelected:(\"input\"===c||\"textarea\"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!ga.test(\"<\"+a.nodeName+\">\")?f=a.cloneNode(!0):(ta.innerHTML=a.outerHTML,ta.removeChild(f=ta.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ua(f),h=ua(a),g=0;null!=(e=h[g]);++g)d[g]&&Ba(e,d[g]);if(b)if(c)for(h=h||ua(a),d=d||ua(f),g=0;null!=(e=h[g]);g++)Aa(e,d[g]);else Aa(a,f);return d=ua(f,\"script\"),d.length>0&&za(d,!i&&ua(a,\"script\")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=da(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if(\"object\"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(la.test(f)){h=h||o.appendChild(b.createElement(\"div\")),i=(ja.exec(f)||[\"\",\"\"])[1].toLowerCase(),l=ra[i]||ra._default,h.innerHTML=l[1]+f.replace(ia,\"<$1></$2>\")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&ha.test(f)&&p.push(b.createTextNode(ha.exec(f)[0])),!k.tbody){f=\"table\"!==i||ka.test(f)?\"<table>\"!==l[1]||ka.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],\"tbody\")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent=\"\";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ua(p,\"input\"),va),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ua(o.appendChild(f),\"script\"),g&&za(h),c)){e=0;while(f=h[e++])oa.test(f.type||\"\")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wa(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ua(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&za(ua(c,\"script\")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ua(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,\"select\")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fa,\"\"):void 0;if(!(\"string\"!=typeof a||ma.test(a)||!k.htmlSerialize&&ga.test(a)||!k.leadingWhitespace&&ha.test(a)||ra[(ja.exec(a)||[\"\",\"\"])[1].toLowerCase()])){a=a.replace(ia,\"<$1></$2>\");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ua(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ua(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&\"string\"==typeof p&&!k.checkClone&&na.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ua(i,\"script\"),xa),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ua(d,\"script\"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,ya),j=0;f>j;j++)d=g[j],oa.test(d.type||\"\")&&!m._data(d,\"globalEval\")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||\"\").replace(qa,\"\")));i=c=null}return this}}),m.each({appendTo:\"append\",prependTo:\"prepend\",insertBefore:\"before\",insertAfter:\"after\",replaceAll:\"replaceWith\"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Ca,Da={};function Ea(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],\"display\");return e.detach(),f}function Fa(a){var b=y,c=Da[a];return c||(c=Ea(a,b),\"none\"!==c&&c||(Ca=(Ca||m(\"<iframe frameborder='0' width='0' height='0'/>\")).appendTo(b.documentElement),b=(Ca[0].contentWindow||Ca[0].contentDocument).document,b.write(),b.close(),c=Ea(a,b),Ca.detach()),Da[a]=c),c}!function(){var a;k.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,d;return c=y.getElementsByTagName(\"body\")[0],c&&c.style?(b=y.createElement(\"div\"),d=y.createElement(\"div\"),d.style.cssText=\"position:absolute;border:0;width:0;height:0;top:0;left:-9999px\",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText=\"-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1\",b.appendChild(y.createElement(\"div\")).style.width=\"5px\",a=3!==b.offsetWidth),c.removeChild(d),a):void 0}}();var Ga=/^margin/,Ha=new RegExp(\"^(\"+S+\")(?!px)[a-z%]+$\",\"i\"),Ia,Ja,Ka=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ia=function(b){return b.ownerDocument.defaultView.opener?b.ownerDocument.defaultView.getComputedStyle(b,null):a.getComputedStyle(b,null)},Ja=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ia(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(\"\"!==g||m.contains(a.ownerDocument,a)||(g=m.style(a,b)),Ha.test(g)&&Ga.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+\"\"}):y.documentElement.currentStyle&&(Ia=function(a){return a.currentStyle},Ja=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ia(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Ha.test(g)&&!Ka.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left=\"fontSize\"===b?\"1em\":g,g=h.pixelLeft+\"px\",h.left=d,f&&(e.left=f)),void 0===g?g:g+\"\"||\"auto\"});function La(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h;if(b=y.createElement(\"div\"),b.innerHTML=\"  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>\",d=b.getElementsByTagName(\"a\")[0],c=d&&d.style){c.cssText=\"float:left;opacity:.5\",k.opacity=\"0.5\"===c.opacity,k.cssFloat=!!c.cssFloat,b.style.backgroundClip=\"content-box\",b.cloneNode(!0).style.backgroundClip=\"\",k.clearCloneStyle=\"content-box\"===b.style.backgroundClip,k.boxSizing=\"\"===c.boxSizing||\"\"===c.MozBoxSizing||\"\"===c.WebkitBoxSizing,m.extend(k,{reliableHiddenOffsets:function(){return null==g&&i(),g},boxSizingReliable:function(){return null==f&&i(),f},pixelPosition:function(){return null==e&&i(),e},reliableMarginRight:function(){return null==h&&i(),h}});function i(){var b,c,d,i;c=y.getElementsByTagName(\"body\")[0],c&&c.style&&(b=y.createElement(\"div\"),d=y.createElement(\"div\"),d.style.cssText=\"position:absolute;border:0;width:0;height:0;top:0;left:-9999px\",c.appendChild(d).appendChild(b),b.style.cssText=\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute\",e=f=!1,h=!0,a.getComputedStyle&&(e=\"1%\"!==(a.getComputedStyle(b,null)||{}).top,f=\"4px\"===(a.getComputedStyle(b,null)||{width:\"4px\"}).width,i=b.appendChild(y.createElement(\"div\")),i.style.cssText=b.style.cssText=\"-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0\",i.style.marginRight=i.style.width=\"0\",b.style.width=\"1px\",h=!parseFloat((a.getComputedStyle(i,null)||{}).marginRight),b.removeChild(i)),b.innerHTML=\"<table><tr><td></td><td>t</td></tr></table>\",i=b.getElementsByTagName(\"td\"),i[0].style.cssText=\"margin:0;border:0;padding:0;display:none\",g=0===i[0].offsetHeight,g&&(i[0].style.display=\"\",i[1].style.display=\"none\",g=0===i[0].offsetHeight),c.removeChild(d))}}}(),m.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Ma=/alpha\\([^)]*\\)/i,Na=/opacity\\s*=\\s*([^)]*)/,Oa=/^(none|table(?!-c[ea]).+)/,Pa=new RegExp(\"^(\"+S+\")(.*)$\",\"i\"),Qa=new RegExp(\"^([+-])=(\"+S+\")\",\"i\"),Ra={position:\"absolute\",visibility:\"hidden\",display:\"block\"},Sa={letterSpacing:\"0\",fontWeight:\"400\"},Ta=[\"Webkit\",\"O\",\"Moz\",\"ms\"];function Ua(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Ta.length;while(e--)if(b=Ta[e]+c,b in a)return b;return d}function Va(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=m._data(d,\"olddisplay\"),c=d.style.display,b?(f[g]||\"none\"!==c||(d.style.display=\"\"),\"\"===d.style.display&&U(d)&&(f[g]=m._data(d,\"olddisplay\",Fa(d.nodeName)))):(e=U(d),(c&&\"none\"!==c||!e)&&m._data(d,\"olddisplay\",e?c:m.css(d,\"display\"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&\"none\"!==d.style.display&&\"\"!==d.style.display||(d.style.display=b?f[g]||\"\":\"none\"));return a}function Wa(a,b,c){var d=Pa.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||\"px\"):b}function Xa(a,b,c,d,e){for(var f=c===(d?\"border\":\"content\")?4:\"width\"===b?1:0,g=0;4>f;f+=2)\"margin\"===c&&(g+=m.css(a,c+T[f],!0,e)),d?(\"content\"===c&&(g-=m.css(a,\"padding\"+T[f],!0,e)),\"margin\"!==c&&(g-=m.css(a,\"border\"+T[f]+\"Width\",!0,e))):(g+=m.css(a,\"padding\"+T[f],!0,e),\"padding\"!==c&&(g+=m.css(a,\"border\"+T[f]+\"Width\",!0,e)));return g}function Ya(a,b,c){var d=!0,e=\"width\"===b?a.offsetWidth:a.offsetHeight,f=Ia(a),g=k.boxSizing&&\"border-box\"===m.css(a,\"boxSizing\",!1,f);if(0>=e||null==e){if(e=Ja(a,b,f),(0>e||null==e)&&(e=a.style[b]),Ha.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Xa(a,b,c||(g?\"border\":\"content\"),d,f)+\"px\"}m.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Ja(a,\"opacity\");return\"\"===c?\"1\":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{\"float\":k.cssFloat?\"cssFloat\":\"styleFloat\"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=m.camelCase(b),i=a.style;if(b=m.cssProps[h]||(m.cssProps[h]=Ua(i,h)),g=m.cssHooks[b]||m.cssHooks[h],void 0===c)return g&&\"get\"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,\"string\"===f&&(e=Qa.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(m.css(a,b)),f=\"number\"),null!=c&&c===c&&(\"number\"!==f||m.cssNumber[h]||(c+=\"px\"),k.clearCloneStyle||\"\"!==c||0!==b.indexOf(\"background\")||(i[b]=\"inherit\"),!(g&&\"set\"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=m.camelCase(b);return b=m.cssProps[h]||(m.cssProps[h]=Ua(a.style,h)),g=m.cssHooks[b]||m.cssHooks[h],g&&\"get\"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Ja(a,b,d)),\"normal\"===f&&b in Sa&&(f=Sa[b]),\"\"===c||c?(e=parseFloat(f),c===!0||m.isNumeric(e)?e||0:f):f}}),m.each([\"height\",\"width\"],function(a,b){m.cssHooks[b]={get:function(a,c,d){return c?Oa.test(m.css(a,\"display\"))&&0===a.offsetWidth?m.swap(a,Ra,function(){return Ya(a,b,d)}):Ya(a,b,d):void 0},set:function(a,c,d){var e=d&&Ia(a);return Wa(a,c,d?Xa(a,b,d,k.boxSizing&&\"border-box\"===m.css(a,\"boxSizing\",!1,e),e):0)}}}),k.opacity||(m.cssHooks.opacity={get:function(a,b){return Na.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||\"\")?.01*parseFloat(RegExp.$1)+\"\":b?\"1\":\"\"},set:function(a,b){var c=a.style,d=a.currentStyle,e=m.isNumeric(b)?\"alpha(opacity=\"+100*b+\")\":\"\",f=d&&d.filter||c.filter||\"\";c.zoom=1,(b>=1||\"\"===b)&&\"\"===m.trim(f.replace(Ma,\"\"))&&c.removeAttribute&&(c.removeAttribute(\"filter\"),\"\"===b||d&&!d.filter)||(c.filter=Ma.test(f)?f.replace(Ma,e):f+\" \"+e)}}),m.cssHooks.marginRight=La(k.reliableMarginRight,function(a,b){return b?m.swap(a,{display:\"inline-block\"},Ja,[a,\"marginRight\"]):void 0}),m.each({margin:\"\",padding:\"\",border:\"Width\"},function(a,b){m.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f=\"string\"==typeof c?c.split(\" \"):[c];4>d;d++)e[a+T[d]+b]=f[d]||f[d-2]||f[0];return e}},Ga.test(a)||(m.cssHooks[a+b].set=Wa)}),m.fn.extend({css:function(a,b){return V(this,function(a,b,c){var d,e,f={},g=0;if(m.isArray(b)){for(d=Ia(a),e=b.length;e>g;g++)f[b[g]]=m.css(a,b[g],!1,d);return f}return void 0!==c?m.style(a,b,c):m.css(a,b)},a,b,arguments.length>1)},show:function(){return Va(this,!0)},hide:function(){return Va(this)},toggle:function(a){return\"boolean\"==typeof a?a?this.show():this.hide():this.each(function(){U(this)?m(this).show():m(this).hide()})}});function Za(a,b,c,d,e){\nreturn new Za.prototype.init(a,b,c,d,e)}m.Tween=Za,Za.prototype={constructor:Za,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||\"swing\",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?\"\":\"px\")},cur:function(){var a=Za.propHooks[this.prop];return a&&a.get?a.get(this):Za.propHooks._default.get(this)},run:function(a){var b,c=Za.propHooks[this.prop];return this.options.duration?this.pos=b=m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Za.propHooks._default.set(this),this}},Za.prototype.init.prototype=Za.prototype,Za.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=m.css(a.elem,a.prop,\"\"),b&&\"auto\"!==b?b:0):a.elem[a.prop]},set:function(a){m.fx.step[a.prop]?m.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[m.cssProps[a.prop]]||m.cssHooks[a.prop])?m.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Za.propHooks.scrollTop=Za.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},m.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},m.fx=Za.prototype.init,m.fx.step={};var $a,_a,ab=/^(?:toggle|show|hide)$/,bb=new RegExp(\"^(?:([+-])=|)(\"+S+\")([a-z%]*)$\",\"i\"),cb=/queueHooks$/,db=[ib],eb={\"*\":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=bb.exec(b),f=e&&e[3]||(m.cssNumber[a]?\"\":\"px\"),g=(m.cssNumber[a]||\"px\"!==f&&+d)&&bb.exec(m.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||\".5\",g/=h,m.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function fb(){return setTimeout(function(){$a=void 0}),$a=m.now()}function gb(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=T[e],d[\"margin\"+c]=d[\"padding\"+c]=a;return b&&(d.opacity=d.width=a),d}function hb(a,b,c){for(var d,e=(eb[b]||[]).concat(eb[\"*\"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ib(a,b,c){var d,e,f,g,h,i,j,l,n=this,o={},p=a.style,q=a.nodeType&&U(a),r=m._data(a,\"fxshow\");c.queue||(h=m._queueHooks(a,\"fx\"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,n.always(function(){n.always(function(){h.unqueued--,m.queue(a,\"fx\").length||h.empty.fire()})})),1===a.nodeType&&(\"height\"in b||\"width\"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=m.css(a,\"display\"),l=\"none\"===j?m._data(a,\"olddisplay\")||Fa(a.nodeName):j,\"inline\"===l&&\"none\"===m.css(a,\"float\")&&(k.inlineBlockNeedsLayout&&\"inline\"!==Fa(a.nodeName)?p.zoom=1:p.display=\"inline-block\")),c.overflow&&(p.overflow=\"hidden\",k.shrinkWrapBlocks()||n.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],ab.exec(e)){if(delete b[d],f=f||\"toggle\"===e,e===(q?\"hide\":\"show\")){if(\"show\"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||m.style(a,d)}else j=void 0;if(m.isEmptyObject(o))\"inline\"===(\"none\"===j?Fa(a.nodeName):j)&&(p.display=j);else{r?\"hidden\"in r&&(q=r.hidden):r=m._data(a,\"fxshow\",{}),f&&(r.hidden=!q),q?m(a).show():n.done(function(){m(a).hide()}),n.done(function(){var b;m._removeData(a,\"fxshow\");for(b in o)m.style(a,b,o[b])});for(d in o)g=hb(q?r[d]:0,d,n),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start=\"width\"===d||\"height\"===d?1:0))}}function jb(a,b){var c,d,e,f,g;for(c in a)if(d=m.camelCase(c),e=b[d],f=a[c],m.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=m.cssHooks[d],g&&\"expand\"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kb(a,b,c){var d,e,f=0,g=db.length,h=m.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=$a||fb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:m.extend({},b),opts:m.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:$a||fb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=m.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jb(k,j.opts.specialEasing);g>f;f++)if(d=db[f].call(j,a,k,j.opts))return d;return m.map(k,hb,j),m.isFunction(j.opts.start)&&j.opts.start.call(a,j),m.fx.timer(m.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}m.Animation=m.extend(kb,{tweener:function(a,b){m.isFunction(a)?(b=a,a=[\"*\"]):a=a.split(\" \");for(var c,d=0,e=a.length;e>d;d++)c=a[d],eb[c]=eb[c]||[],eb[c].unshift(b)},prefilter:function(a,b){b?db.unshift(a):db.push(a)}}),m.speed=function(a,b,c){var d=a&&\"object\"==typeof a?m.extend({},a):{complete:c||!c&&b||m.isFunction(a)&&a,duration:a,easing:c&&b||b&&!m.isFunction(b)&&b};return d.duration=m.fx.off?0:\"number\"==typeof d.duration?d.duration:d.duration in m.fx.speeds?m.fx.speeds[d.duration]:m.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue=\"fx\"),d.old=d.complete,d.complete=function(){m.isFunction(d.old)&&d.old.call(this),d.queue&&m.dequeue(this,d.queue)},d},m.fn.extend({fadeTo:function(a,b,c,d){return this.filter(U).css(\"opacity\",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=m.isEmptyObject(a),f=m.speed(b,c,d),g=function(){var b=kb(this,m.extend({},a),f);(e||m._data(this,\"finish\"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return\"string\"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||\"fx\",[]),this.each(function(){var b=!0,e=null!=a&&a+\"queueHooks\",f=m.timers,g=m._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&cb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&m.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||\"fx\"),this.each(function(){var b,c=m._data(this),d=c[a+\"queue\"],e=c[a+\"queueHooks\"],f=m.timers,g=d?d.length:0;for(c.finish=!0,m.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),m.each([\"toggle\",\"show\",\"hide\"],function(a,b){var c=m.fn[b];m.fn[b]=function(a,d,e){return null==a||\"boolean\"==typeof a?c.apply(this,arguments):this.animate(gb(b,!0),a,d,e)}}),m.each({slideDown:gb(\"show\"),slideUp:gb(\"hide\"),slideToggle:gb(\"toggle\"),fadeIn:{opacity:\"show\"},fadeOut:{opacity:\"hide\"},fadeToggle:{opacity:\"toggle\"}},function(a,b){m.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),m.timers=[],m.fx.tick=function(){var a,b=m.timers,c=0;for($a=m.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||m.fx.stop(),$a=void 0},m.fx.timer=function(a){m.timers.push(a),a()?m.fx.start():m.timers.pop()},m.fx.interval=13,m.fx.start=function(){_a||(_a=setInterval(m.fx.tick,m.fx.interval))},m.fx.stop=function(){clearInterval(_a),_a=null},m.fx.speeds={slow:600,fast:200,_default:400},m.fn.delay=function(a,b){return a=m.fx?m.fx.speeds[a]||a:a,b=b||\"fx\",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e;b=y.createElement(\"div\"),b.setAttribute(\"className\",\"t\"),b.innerHTML=\"  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>\",d=b.getElementsByTagName(\"a\")[0],c=y.createElement(\"select\"),e=c.appendChild(y.createElement(\"option\")),a=b.getElementsByTagName(\"input\")[0],d.style.cssText=\"top:1px\",k.getSetAttribute=\"t\"!==b.className,k.style=/top/.test(d.getAttribute(\"style\")),k.hrefNormalized=\"/a\"===d.getAttribute(\"href\"),k.checkOn=!!a.value,k.optSelected=e.selected,k.enctype=!!y.createElement(\"form\").enctype,c.disabled=!0,k.optDisabled=!e.disabled,a=y.createElement(\"input\"),a.setAttribute(\"value\",\"\"),k.input=\"\"===a.getAttribute(\"value\"),a.value=\"t\",a.setAttribute(\"type\",\"radio\"),k.radioValue=\"t\"===a.value}();var lb=/\\r/g;m.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=m.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,m(this).val()):a,null==e?e=\"\":\"number\"==typeof e?e+=\"\":m.isArray(e)&&(e=m.map(e,function(a){return null==a?\"\":a+\"\"})),b=m.valHooks[this.type]||m.valHooks[this.nodeName.toLowerCase()],b&&\"set\"in b&&void 0!==b.set(this,e,\"value\")||(this.value=e))});if(e)return b=m.valHooks[e.type]||m.valHooks[e.nodeName.toLowerCase()],b&&\"get\"in b&&void 0!==(c=b.get(e,\"value\"))?c:(c=e.value,\"string\"==typeof c?c.replace(lb,\"\"):null==c?\"\":c)}}}),m.extend({valHooks:{option:{get:function(a){var b=m.find.attr(a,\"value\");return null!=b?b:m.trim(m.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f=\"select-one\"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute(\"disabled\"))||c.parentNode.disabled&&m.nodeName(c.parentNode,\"optgroup\"))){if(b=m(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=m.makeArray(b),g=e.length;while(g--)if(d=e[g],m.inArray(m.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),m.each([\"radio\",\"checkbox\"],function(){m.valHooks[this]={set:function(a,b){return m.isArray(b)?a.checked=m.inArray(m(a).val(),b)>=0:void 0}},k.checkOn||(m.valHooks[this].get=function(a){return null===a.getAttribute(\"value\")?\"on\":a.value})});var mb,nb,ob=m.expr.attrHandle,pb=/^(?:checked|selected)$/i,qb=k.getSetAttribute,rb=k.input;m.fn.extend({attr:function(a,b){return V(this,m.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){m.removeAttr(this,a)})}}),m.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===K?m.prop(a,b,c):(1===f&&m.isXMLDoc(a)||(b=b.toLowerCase(),d=m.attrHooks[b]||(m.expr.match.bool.test(b)?nb:mb)),void 0===c?d&&\"get\"in d&&null!==(e=d.get(a,b))?e:(e=m.find.attr(a,b),null==e?void 0:e):null!==c?d&&\"set\"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+\"\"),c):void m.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=m.propFix[c]||c,m.expr.match.bool.test(c)?rb&&qb||!pb.test(c)?a[d]=!1:a[m.camelCase(\"default-\"+c)]=a[d]=!1:m.attr(a,c,\"\"),a.removeAttribute(qb?c:d)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&\"radio\"===b&&m.nodeName(a,\"input\")){var c=a.value;return a.setAttribute(\"type\",b),c&&(a.value=c),b}}}}}),nb={set:function(a,b,c){return b===!1?m.removeAttr(a,c):rb&&qb||!pb.test(c)?a.setAttribute(!qb&&m.propFix[c]||c,c):a[m.camelCase(\"default-\"+c)]=a[c]=!0,c}},m.each(m.expr.match.bool.source.match(/\\w+/g),function(a,b){var c=ob[b]||m.find.attr;ob[b]=rb&&qb||!pb.test(b)?function(a,b,d){var e,f;return d||(f=ob[b],ob[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,ob[b]=f),e}:function(a,b,c){return c?void 0:a[m.camelCase(\"default-\"+b)]?b.toLowerCase():null}}),rb&&qb||(m.attrHooks.value={set:function(a,b,c){return m.nodeName(a,\"input\")?void(a.defaultValue=b):mb&&mb.set(a,b,c)}}),qb||(mb={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+=\"\",\"value\"===c||b===a.getAttribute(c)?b:void 0}},ob.id=ob.name=ob.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&\"\"!==d.value?d.value:null},m.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:mb.set},m.attrHooks.contenteditable={set:function(a,b,c){mb.set(a,\"\"===b?!1:b,c)}},m.each([\"width\",\"height\"],function(a,b){m.attrHooks[b]={set:function(a,c){return\"\"===c?(a.setAttribute(b,\"auto\"),c):void 0}}})),k.style||(m.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+\"\"}});var sb=/^(?:input|select|textarea|button|object)$/i,tb=/^(?:a|area)$/i;m.fn.extend({prop:function(a,b){return V(this,m.prop,a,b,arguments.length>1)},removeProp:function(a){return a=m.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),m.extend({propFix:{\"for\":\"htmlFor\",\"class\":\"className\"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!m.isXMLDoc(a),f&&(b=m.propFix[b]||b,e=m.propHooks[b]),void 0!==c?e&&\"set\"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&\"get\"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=m.find.attr(a,\"tabindex\");return b?parseInt(b,10):sb.test(a.nodeName)||tb.test(a.nodeName)&&a.href?0:-1}}}}),k.hrefNormalized||m.each([\"href\",\"src\"],function(a,b){m.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),k.optSelected||(m.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),m.each([\"tabIndex\",\"readOnly\",\"maxLength\",\"cellSpacing\",\"cellPadding\",\"rowSpan\",\"colSpan\",\"useMap\",\"frameBorder\",\"contentEditable\"],function(){m.propFix[this.toLowerCase()]=this}),k.enctype||(m.propFix.enctype=\"encoding\");var ub=/[\\t\\r\\n\\f]/g;m.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=\"string\"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||\"\").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(\" \"+c.className+\" \").replace(ub,\" \"):\" \")){f=0;while(e=b[f++])d.indexOf(\" \"+e+\" \")<0&&(d+=e+\" \");g=m.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||\"string\"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||\"\").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(\" \"+c.className+\" \").replace(ub,\" \"):\"\")){f=0;while(e=b[f++])while(d.indexOf(\" \"+e+\" \")>=0)d=d.replace(\" \"+e+\" \",\" \");g=a?m.trim(d):\"\",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return\"boolean\"==typeof b&&\"string\"===c?b?this.addClass(a):this.removeClass(a):this.each(m.isFunction(a)?function(c){m(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if(\"string\"===c){var b,d=0,e=m(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===K||\"boolean\"===c)&&(this.className&&m._data(this,\"__className__\",this.className),this.className=this.className||a===!1?\"\":m._data(this,\"__className__\")||\"\")})},hasClass:function(a){for(var b=\" \"+a+\" \",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(\" \"+this[c].className+\" \").replace(ub,\" \").indexOf(b)>=0)return!0;return!1}}),m.each(\"blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu\".split(\" \"),function(a,b){m.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),m.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,\"**\"):this.off(b,a||\"**\",c)}});var vb=m.now(),wb=/\\?/,xb=/(,)|(\\[|{)|(}|])|\"(?:[^\"\\\\\\r\\n]|\\\\[\"\\\\\\/bfnrt]|\\\\u[\\da-fA-F]{4})*\"\\s*:?|true|false|null|-?(?!0\\d)\\d+(?:\\.\\d+|)(?:[eE][+-]?\\d+|)/g;m.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+\"\");var c,d=null,e=m.trim(b+\"\");return e&&!m.trim(e.replace(xb,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,\"\")}))?Function(\"return \"+e)():m.error(\"Invalid JSON: \"+b)},m.parseXML=function(b){var c,d;if(!b||\"string\"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,\"text/xml\")):(c=new ActiveXObject(\"Microsoft.XMLDOM\"),c.async=\"false\",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName(\"parsererror\").length||m.error(\"Invalid XML: \"+b),c};var yb,zb,Ab=/#.*$/,Bb=/([?&])_=[^&]*/,Cb=/^(.*?):[ \\t]*([^\\r\\n]*)\\r?$/gm,Db=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Eb=/^(?:GET|HEAD)$/,Fb=/^\\/\\//,Gb=/^([\\w.+-]+:)(?:\\/\\/(?:[^\\/?#]*@|)([^\\/?#:]*)(?::(\\d+)|)|)/,Hb={},Ib={},Jb=\"*/\".concat(\"*\");try{zb=location.href}catch(Kb){zb=y.createElement(\"a\"),zb.href=\"\",zb=zb.href}yb=Gb.exec(zb.toLowerCase())||[];function Lb(a){return function(b,c){\"string\"!=typeof b&&(c=b,b=\"*\");var d,e=0,f=b.toLowerCase().match(E)||[];if(m.isFunction(c))while(d=f[e++])\"+\"===d.charAt(0)?(d=d.slice(1)||\"*\",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Mb(a,b,c,d){var e={},f=a===Ib;function g(h){var i;return e[h]=!0,m.each(a[h]||[],function(a,h){var j=h(b,c,d);return\"string\"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e[\"*\"]&&g(\"*\")}function Nb(a,b){var c,d,e=m.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&m.extend(!0,a,c),a}function Ob(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while(\"*\"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader(\"Content-Type\"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+\" \"+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Pb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if(\"*\"===f)f=i;else if(\"*\"!==i&&i!==f){if(g=j[i+\" \"+f]||j[\"* \"+f],!g)for(e in j)if(h=e.split(\" \"),h[1]===f&&(g=j[i+\" \"+h[0]]||j[\"* \"+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a[\"throws\"])b=g(b);else try{b=g(b)}catch(l){return{state:\"parsererror\",error:g?l:\"No conversion from \"+i+\" to \"+f}}}return{state:\"success\",data:b}}m.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:zb,type:\"GET\",isLocal:Db.test(yb[1]),global:!0,processData:!0,async:!0,contentType:\"application/x-www-form-urlencoded; charset=UTF-8\",accepts:{\"*\":Jb,text:\"text/plain\",html:\"text/html\",xml:\"application/xml, text/xml\",json:\"application/json, text/javascript\"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:\"responseXML\",text:\"responseText\",json:\"responseJSON\"},converters:{\"* text\":String,\"text html\":!0,\"text json\":m.parseJSON,\"text xml\":m.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Nb(Nb(a,m.ajaxSettings),b):Nb(m.ajaxSettings,a)},ajaxPrefilter:Lb(Hb),ajaxTransport:Lb(Ib),ajax:function(a,b){\"object\"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=m.ajaxSetup({},b),l=k.context||k,n=k.context&&(l.nodeType||l.jquery)?m(l):m.event,o=m.Deferred(),p=m.Callbacks(\"once memory\"),q=k.statusCode||{},r={},s={},t=0,u=\"canceled\",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Cb.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||zb)+\"\").replace(Ab,\"\").replace(Fb,yb[1]+\"//\"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=m.trim(k.dataType||\"*\").toLowerCase().match(E)||[\"\"],null==k.crossDomain&&(c=Gb.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===yb[1]&&c[2]===yb[2]&&(c[3]||(\"http:\"===c[1]?\"80\":\"443\"))===(yb[3]||(\"http:\"===yb[1]?\"80\":\"443\")))),k.data&&k.processData&&\"string\"!=typeof k.data&&(k.data=m.param(k.data,k.traditional)),Mb(Hb,k,b,v),2===t)return v;h=m.event&&k.global,h&&0===m.active++&&m.event.trigger(\"ajaxStart\"),k.type=k.type.toUpperCase(),k.hasContent=!Eb.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(wb.test(e)?\"&\":\"?\")+k.data,delete k.data),k.cache===!1&&(k.url=Bb.test(e)?e.replace(Bb,\"$1_=\"+vb++):e+(wb.test(e)?\"&\":\"?\")+\"_=\"+vb++)),k.ifModified&&(m.lastModified[e]&&v.setRequestHeader(\"If-Modified-Since\",m.lastModified[e]),m.etag[e]&&v.setRequestHeader(\"If-None-Match\",m.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader(\"Content-Type\",k.contentType),v.setRequestHeader(\"Accept\",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+(\"*\"!==k.dataTypes[0]?\", \"+Jb+\"; q=0.01\":\"\"):k.accepts[\"*\"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u=\"abort\";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Mb(Ib,k,b,v)){v.readyState=1,h&&n.trigger(\"ajaxSend\",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort(\"timeout\")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,\"No Transport\");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||\"\",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Ob(k,v,c)),u=Pb(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader(\"Last-Modified\"),w&&(m.lastModified[e]=w),w=v.getResponseHeader(\"etag\"),w&&(m.etag[e]=w)),204===a||\"HEAD\"===k.type?x=\"nocontent\":304===a?x=\"notmodified\":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x=\"error\",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+\"\",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&n.trigger(j?\"ajaxSuccess\":\"ajaxError\",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(n.trigger(\"ajaxComplete\",[v,k]),--m.active||m.event.trigger(\"ajaxStop\")))}return v},getJSON:function(a,b,c){return m.get(a,b,c,\"json\")},getScript:function(a,b){return m.get(a,void 0,b,\"script\")}}),m.each([\"get\",\"post\"],function(a,b){m[b]=function(a,c,d,e){return m.isFunction(c)&&(e=e||d,d=c,c=void 0),m.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),m._evalUrl=function(a){return m.ajax({url:a,type:\"GET\",dataType:\"script\",async:!1,global:!1,\"throws\":!0})},m.fn.extend({wrapAll:function(a){if(m.isFunction(a))return this.each(function(b){m(this).wrapAll(a.call(this,b))});if(this[0]){var b=m(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(m.isFunction(a)?function(b){m(this).wrapInner(a.call(this,b))}:function(){var b=m(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=m.isFunction(a);return this.each(function(c){m(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){m.nodeName(this,\"body\")||m(this).replaceWith(this.childNodes)}).end()}}),m.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!k.reliableHiddenOffsets()&&\"none\"===(a.style&&a.style.display||m.css(a,\"display\"))},m.expr.filters.visible=function(a){return!m.expr.filters.hidden(a)};var Qb=/%20/g,Rb=/\\[\\]$/,Sb=/\\r?\\n/g,Tb=/^(?:submit|button|image|reset|file)$/i,Ub=/^(?:input|select|textarea|keygen)/i;function Vb(a,b,c,d){var e;if(m.isArray(b))m.each(b,function(b,e){c||Rb.test(a)?d(a,e):Vb(a+\"[\"+(\"object\"==typeof e?b:\"\")+\"]\",e,c,d)});else if(c||\"object\"!==m.type(b))d(a,b);else for(e in b)Vb(a+\"[\"+e+\"]\",b[e],c,d)}m.param=function(a,b){var c,d=[],e=function(a,b){b=m.isFunction(b)?b():null==b?\"\":b,d[d.length]=encodeURIComponent(a)+\"=\"+encodeURIComponent(b)};if(void 0===b&&(b=m.ajaxSettings&&m.ajaxSettings.traditional),m.isArray(a)||a.jquery&&!m.isPlainObject(a))m.each(a,function(){e(this.name,this.value)});else for(c in a)Vb(c,a[c],b,e);return d.join(\"&\").replace(Qb,\"+\")},m.fn.extend({serialize:function(){return m.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=m.prop(this,\"elements\");return a?m.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!m(this).is(\":disabled\")&&Ub.test(this.nodeName)&&!Tb.test(a)&&(this.checked||!W.test(a))}).map(function(a,b){var c=m(this).val();return null==c?null:m.isArray(c)?m.map(c,function(a){return{name:b.name,value:a.replace(Sb,\"\\r\\n\")}}):{name:b.name,value:c.replace(Sb,\"\\r\\n\")}}).get()}}),m.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&Zb()||$b()}:Zb;var Wb=0,Xb={},Yb=m.ajaxSettings.xhr();a.attachEvent&&a.attachEvent(\"onunload\",function(){for(var a in Xb)Xb[a](void 0,!0)}),k.cors=!!Yb&&\"withCredentials\"in Yb,Yb=k.ajax=!!Yb,Yb&&m.ajaxTransport(function(a){if(!a.crossDomain||k.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Wb;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c[\"X-Requested-With\"]||(c[\"X-Requested-With\"]=\"XMLHttpRequest\");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+\"\");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Xb[g],b=void 0,f.onreadystatechange=m.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,\"string\"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=\"\"}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Xb[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function Zb(){try{return new a.XMLHttpRequest}catch(b){}}function $b(){try{return new a.ActiveXObject(\"Microsoft.XMLHTTP\")}catch(b){}}m.ajaxSetup({accepts:{script:\"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript\"},contents:{script:/(?:java|ecma)script/},converters:{\"text script\":function(a){return m.globalEval(a),a}}}),m.ajaxPrefilter(\"script\",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type=\"GET\",a.global=!1)}),m.ajaxTransport(\"script\",function(a){if(a.crossDomain){var b,c=y.head||m(\"head\")[0]||y.documentElement;return{send:function(d,e){b=y.createElement(\"script\"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,\"success\"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var _b=[],ac=/(=)\\?(?=&|$)|\\?\\?/;m.ajaxSetup({jsonp:\"callback\",jsonpCallback:function(){var a=_b.pop()||m.expando+\"_\"+vb++;return this[a]=!0,a}}),m.ajaxPrefilter(\"json jsonp\",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(ac.test(b.url)?\"url\":\"string\"==typeof b.data&&!(b.contentType||\"\").indexOf(\"application/x-www-form-urlencoded\")&&ac.test(b.data)&&\"data\");return h||\"jsonp\"===b.dataTypes[0]?(e=b.jsonpCallback=m.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(ac,\"$1\"+e):b.jsonp!==!1&&(b.url+=(wb.test(b.url)?\"&\":\"?\")+b.jsonp+\"=\"+e),b.converters[\"script json\"]=function(){return g||m.error(e+\" was not called\"),g[0]},b.dataTypes[0]=\"json\",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,_b.push(e)),g&&m.isFunction(f)&&f(g[0]),g=f=void 0}),\"script\"):void 0}),m.parseHTML=function(a,b,c){if(!a||\"string\"!=typeof a)return null;\"boolean\"==typeof b&&(c=b,b=!1),b=b||y;var d=u.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=m.buildFragment([a],b,e),e&&e.length&&m(e).remove(),m.merge([],d.childNodes))};var bc=m.fn.load;m.fn.load=function(a,b,c){if(\"string\"!=typeof a&&bc)return bc.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(\" \");return h>=0&&(d=m.trim(a.slice(h,a.length)),a=a.slice(0,h)),m.isFunction(b)?(c=b,b=void 0):b&&\"object\"==typeof b&&(f=\"POST\"),g.length>0&&m.ajax({url:a,type:f,dataType:\"html\",data:b}).done(function(a){e=arguments,g.html(d?m(\"<div>\").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.each([\"ajaxStart\",\"ajaxStop\",\"ajaxComplete\",\"ajaxError\",\"ajaxSuccess\",\"ajaxSend\"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cc=a.document.documentElement;function dc(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,\"position\"),l=m(a),n={};\"static\"===k&&(a.style.position=\"relative\"),h=l.offset(),f=m.css(a,\"top\"),i=m.css(a,\"left\"),j=(\"absolute\"===k||\"fixed\"===k)&&m.inArray(\"auto\",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),\"using\"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dc(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return\"fixed\"===m.css(d,\"position\")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],\"html\")||(c=a.offset()),c.top+=m.css(a[0],\"borderTopWidth\",!0),c.left+=m.css(a[0],\"borderLeftWidth\",!0)),{top:b.top-c.top-m.css(d,\"marginTop\",!0),left:b.left-c.left-m.css(d,\"marginLeft\",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cc;while(a&&!m.nodeName(a,\"html\")&&\"static\"===m.css(a,\"position\"))a=a.offsetParent;return a||cc})}}),m.each({scrollLeft:\"pageXOffset\",scrollTop:\"pageYOffset\"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dc(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each([\"top\",\"left\"],function(a,b){m.cssHooks[b]=La(k.pixelPosition,function(a,c){return c?(c=Ja(a,b),Ha.test(c)?m(a).position()[b]+\"px\":c):void 0})}),m.each({Height:\"height\",Width:\"width\"},function(a,b){m.each({padding:\"inner\"+a,content:b,\"\":\"outer\"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||\"boolean\"!=typeof d),g=c||(d===!0||e===!0?\"margin\":\"border\");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement[\"client\"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body[\"scroll\"+a],e[\"scroll\"+a],b.body[\"offset\"+a],e[\"offset\"+a],e[\"client\"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,\"function\"==typeof define&&define.amd&&define(\"jquery\",[],function(){return m});var ec=a.jQuery,fc=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fc),b&&a.jQuery===m&&(a.jQuery=ec),m},typeof b===K&&(a.jQuery=a.$=m),m});\n","/** X3DOM Runtime, http://www.x3dom.org/ 1.8.1 - 0c742a1a981f8c0a9cbb7059f36c3a6c4cb9fec6 - Fri Sep 27 18:22:15 2019 +0200 */\nif(!Array.forEach){Array.forEach=function(array,fun,thisp){var len=array.length;for(var i=0;i<len;i++){if(i in array){fun.call(thisp,array[i],i,array);}}};}\nif(!Array.map){Array.map=function(array,fun,thisp){var len=array.length;var res=[];for(var i=0;i<len;i++){if(i in array){res[i]=fun.call(thisp,array[i],i,array);}}\nreturn res;};}\nif(!Array.filter){Array.filter=function(array,fun,thisp){var len=array.length;var res=[];for(var i=0;i<len;i++){if(i in array){var val=array[i];if(fun.call(thisp,val,i,array)){res.push(val);}}}\nreturn res;};}\nvar x3dom={canvases:[],x3dNS:'http://www.web3d.org/specifications/x3d-namespace',x3dextNS:'http://philip.html5.org/x3d/ext',xsltNS:'http://www.w3.org/1999/XSL/x3dom.Transform',xhtmlNS:'http://www.w3.org/1999/xhtml'};x3dom.nodeTypes={};x3dom.nodeTypesLC={};x3dom.components={};x3dom.geoCache=[];x3dom.BUFFER_IDX={INDEX:0,POSITION:1,NORMAL:2,TEXCOORD:3,TEXCOORD_0:3,COLOR:4,COLOR_0:4,ID:5,TANGENT:6,BITANGENT:7,TEXCOORD_1:8};x3dom.BRDF_LUT=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAIAAADTED8xAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAMAdJREFUeNrsXduWIruOlGjOzP8/zdceNA+QmbZ19yVJKFh79a6ChKqCkBQRkm38v/8QABBA++/zf+JD2r8k35/4lqIXd1zA/yj7i/ij7rP67jy+psRP77vszG87Lph4T3PnHYEIAAGe/x43BCAoH9L+bZ4i/jwMfotAAEjqxfx+7QL5pvyGAP6vHbxSfFb8TuPXDl6fe0O6bvYH+lm3OwDxP+b1L1ZYtN+O4ykAREJ45MKA5Efj8aB+UcTYCKTc546C3gzd6ZhLfVjfdLvjRj1Q/Ds3uPjpX/m0moujb7SZ8zrTfwBP9iu7d/b9PtFXiBXY8Ye+6eaW/IMCyRndKwUqO5KekgsDPCTBtPSfp0PjibwbakJgZCjc75aoAOBmd6yIjV8E2FN6wkD6vAfTf/X0us7YL5hK/30EabqM+Zo8Pfd1ysteGkAEdIt1swTLgcG4UDoMMMrXc+nffM86IuHMm1uQfyGRqQBIouKUEx7KesBiR5hzdWxNnAN3UDzob3b8p0RKQfeLrJC5XxAS4ueWveyO8AKXQVcqrOspUw2MsKtja+Jp7F/SG81veBqkOl+ECaS/kK0X2qANw7GKAABKesCRyJKrk9XEWfsyl85jkFpI7rOv6eHuL/g8HaS/ubNygUqGYxUB6SVdXqSx+WAYpOhQVteKxS0eCRFet4TefEjujfyaEeoyAvewC1TD1BLHUrSArSX0LO6GgUuHhtJ/GaUgx/ZFbsHu+9/RuINFoHKBIvalKB/99O+J2mD55pR9PP2DWWemOKFrQ+hKemB1VI5zHqECNIiJ6IHyymZ6x30WgN+I9dN211RPoqtlomoEaktgem4d6Phps1jQINz5nS0FEh1P3yE1ZbE8DTE+8DNgj4ZgnfycO1L+YPUImrmfGxIj7mfwzpYCiY5nX5vMLgKaNZRj7fsVU9N/pJEXB/ofmbqZImqny1w3BhQKVDqe0nyy2yazGVHjO6VYUMeL9KT/OkovzX8WFIHmld6rtEcaXu7Tj3Foi7dguk0WGhbSraF0WQh3ynoiIdAmO0f++q92JVNoYhFYFwN3ROIDYeJcWkO4I1c66V+hsClCb9SBCenffAuz4D5pyP6UGOhmL1erA3cEEr1/UJpfEZnrzlbYTCbO5u06MCf91y++qBM8ORjyYHSf0YfvuUogHgMQt0FfFKhe+KIGA/p6wPBSfSibxk4oNsw6MLq2K7kk5a+tR5lo7AzGgHEn8DXBoLSBNTIQbZMxWRxcRSDO6CcaXoGJhr61XWVUD/KfKxqTa2rCXLtzPAYsFwikHCy3ycB3SJufxhFg1IG4uanWAVDdm9GVK4Hx6bVKdwaET2tmnW/sBOnQ8/6jDwDS5KbjkJI/xalxodDq9QAdsrvF9sxF/+B+QQXH+c/C4rBYmZ7Qqc3GACTvF/oA4K1isWWxyoUgP8gZpkNqSIy5+FZUrNlh5Qtcy7md2j5YazHDrxf6AM38fYcsttwhmrBkMWIQiXVgSvofzK9n7zjyjs7AxE7t3FLAr69EMOj4TsliSxjEhswm1gGAznnJ0KCOwoWm7AQxLTwQgE71MVNRMSUGIM+IYG+EacxE4+IRWawVAU5LosMO4O/gYN2pW0OjwPUk+yX4j4SdiVAeIUJTRG1HeMCxHkBKsVoODspiZxJOn97p3sFBxHGbrcGSBCNffwYdOlfprmMy2fuNhzYKtBn2YEytgWqq2Du6qePQ5ghQig7FHdK+9e8hKAeI1jshHgPyCT4m5lP4xJQP9aP359cYyMoa/mzZ4PSAPYUanJiIe/waUueQoiuNjgr4YHe9y8ecldpTWBefWItgPStr7EWbbLM3eRYlQYIOJeuA28zqWIAyzoWm859Q7zbw6w16OOendluFORpA6AN4qtddzKUNURvEye55RWRxpA5oBk7WCApyoSuq4V65ssLZnMvmIykfon0AXfVCYfvY7qfdA6b6LylfMCQG2Pva0+tFNYRGqfyw+270vD/Cs4dwP2uEzXeTHygpENW/BG6ywO/doi+LxXk4FaAYGuDh6bZ/B8LAUEPnQ2vU9hwX30N9Kn7Hzc1uQPdlfWaD5l2XlCzevwmN9Gxdm4TFqdSBxL77kBCviYcCA+FvY0fF77aoHdvn5Xez+b5IuCMS2JkeR2UxxVwmg5n4bk+YzGR7um/hQleeHTpBuXaHQZb/FDboxoSCxwoZF1jUJbyRSdm0iro9Sjc68bW5gWk2GAa3spvMecR7uopAx/3TmU+Q3kQuKGzQ7eMX9EDhoGFggNmhTBD1fLR5ZutZNfMebOhO4y3DJ3y9awExnihbB1N+POu3LhAERm6ie1HpFwQbuoI7lPE6I32uoInZf8hf+LSbcwjPyQ3akYdGMnqqLFQuEBRpHlyyHpHFEHWHBMTH2Lnb59LqQKgUTG3oTvRG36KGu2NgJN+PpPzgNSA2wg62ow/qaIXCjZNIPVHZOYQvDidyI4pse3TkBFjIdN86wq+nOzsWAyt8GwgtjM2VBfHKdkmk6EiqjQJ3fs51h2pkOwDN9q3MiQxfznad++2zrNjpyydQ/WxB6iM2S12dbMrn8dCuB4AU6XedzYA7xPU3/01AmoQL1QGQV8MEywJ46547w8NrYL9BFgeKwAiDn+jqDKZ8QQTjpgNaIrTLUMO3Maeag+5QDtkd8wtdkgC8tT4d1eAt3mi0CIRjYApveVfKB74ksoSp2AoINQp08wdMd6iJJaBY0ypr+SclgVsKAIZ3ibuGJu4QuIOcZ6LY7Uj5zfX1KMSW7CFAVHih2OErCwOvA9AkeJECgb60JeLtGHwm62N2SNXIFkNLLVEf6/UVgyjHDBxn5XvQd6mRKZAwDKcAfVajwF3hDjodAqVL4EcLqwOQQn+NiAj6ozs6Xr4OwIwwWEdp4qOs4vsvu0AgAX1KowCCC4JrxgVd+zKodSO2WEfGcYwLnTbMPAvoYA6K4hitT0VC6spsvhf6AE8vU/Ze9F5VX6MAUguCixlSyHQJQkS/q907iwulBPGZm5DaMQAzwqAvEqbke1AXxSsuEBRADzYK0iYpKZpboUOQlLkW1Ylt7WhAlpSKHFmnLw5On1MlzlG3Hcm7L99nWxmCDQqKCyRyHrtRAMr8HOR3ebDpUFYWy4ERntcHs1WcRf+VTSEILB2eGwaD4LYPQ3Fv9SyQ5AKJnCfbKNA6yhpfgjAdgkG7k0WX+Fwwd7nLoj9+HtlbigDEls9Pd2+WPl0NgGoaVLdW7OVa4Gpfl+1IezC2+EZrrgH0OgBuqyusiUGa7SE9geF0bJ5YB2aZmCegufs9O2xQzQVqc7bRL9uWEUNg7EcIA4lNAbvGlcVQV4yovwl+KZDvUWZ7Utumu8elTVS6iUArxr0m+jaD1k13sie5AiCVxAbqtgiS4r4XcGlrhdFGMAsFKLNx7fsbk8XcITW4U7e9o3EhGATuQB1YsatPH7JpHoinFEVUK4DE77VSYHAeCM76m+6QyMEEkgPt0IRdMaIUX6E0vuHj7YvYERWX2lV3UNTSAuxOiZNiFMIOAz08IqI51UbgvlOcDgmMSK8DcjAwSkOKYce5ENC80/LOOu0UkjugTMnutPLPSQdA9Yaj0xAAj/NAeI8TS1KD3LI16JBtj4p1AAIjD5By+qXZHujeYaU3BiYO+msP4xiUp2uA7pu8JBJADwPR9VeYkmaDNu4QgKOMwaRDXL/KoQKW6w9MPwCFEn+HhE2UhcsYo9fhOdmbXfaPUYjWCyrIX/WQDmjOlFyHxx5BBWl/RZmd6znbdv2tHB+z+UFZkQxeQ75jd62lgLaSenhr9Sskdfe3asehgdEbkAb0K5sIQyUiKprdRWF1UZK1AcvZsjI2M3QLTXPkwRK1+nLK8VR3wi4SS42XS4VHQYFQxro6KRS4v3vIVAwDkQ5xWdxRB4xSAOGRB9FQSkFfveasImBxmwVk7Arjse2+QAB6GIiTQub92SHTRvi60zsgcf2OOuAkeO9igwsZfeJcXu89oX4FUi+4t8tQBRDYvxgGhV42+mIgrRGzPaVoUDFxAp4stug+ayb00XqH0MdOIQilw/x205OztvTOXz8e0KkASKWBI4pgw5apwoPd7w6ZWoJBCipg202DJ4st6RzI7uUfyD9tiihdc0+4HBPII/oEG+n6Z4D7FIhPfZRsnmNdS/kQGJ2whQQq3o5gt0lNAOjg+kp2d1kNxJu+kh6As1a6zIwB/B4ChC0Fqr38yvBRGJEA98DoRERIiN6OAXFQDOko148JVjHwohk9owcs9L9DEH8ElPsrQLM5TJwRlaMQEB6d6AkPxQN1ZbFooaZiybBHU2SGzMjJKYT3xsCJvblTKBBbEwwMwSIjErEL5UhF12SRWyVkh86FuDfdAMoBTWBakxEyY3ij/eL4M+sAXu/n3kuG0WR30LpjXARr2K0XDYM7cWSEB2v3gpSVyXDuItMNYYoPXkZXX8SDYVQh9MbALOvmUtq3+5epG2F6GDSsQywFMna1UpCcOAL2asIHiepDYh3Q4gQlgMhPQfXK7glefB9iousbzy0luPI1722bT+f6bWoUw4AFjI1py2wFVf5SvYslSIxfpfJ6HQBlvt/5GFBwDty339Abb+Q0b0/qePqr3Xe0IqPUwDZPdRmRSGPAG52wTFJtdk2iQ6D3blN1wAiVSOUJMXucN21Db4IqfRjWfQ0ghkGEEQEwYeBJiJCpKr24C1CxlAmPgjzkA6Zm7WP2dAEi8UcyevYVBA0QCQMkwY4US0F8pMI1SWUuxKqAQWNA2Y4KTLeHKPYZKGXHpU/fVATwMnAPPp1tiyJuEs/XBogJXsrWqtgVA8Y0SdVFwEqfNZLpQd/TAerqFFKxqMoP+MoYmI17PPGJ2GiAhr0MMaLgZJEYMLpJymU3KEfeAlfGpL9fbqHQJUeHyxmBL83OptfE/flw79EAPYyo7hCDO1lEEJ1IBd2qr8Op/ePRcjZDete8pjsGtI3505/9+iIwvlDhNMTHr69mgQTzR7szyIjEySKd/YOyAobne9TYtrEUK1YHLAYf7mHFkYHvg+O7dOeKJ3ZHiDALpFGd6k7tMuptIOiKWagPEtumiDhz6wB4aR7lImNH1FIev4gpnQ99fEeE3J+5lHOYHQokKTzSLlOeKIcBObC2oqgOJBd8RnjYJF4g/bhyXxsaQ9v59vyYF7QO9DkXSJSzArEJJ34xqCKuEXhzFqIkEJBalxLUH7KDZGgWbYYg/ghVmno6rnnlvti4N+ILuY7ksWEm/khgGK4RGNsBoWUBYZaxhCVBUFGsSJA9KDyXSi1i6njWC975/r8o2imS1SMi3uFIumsEZoOZ6wdgQ3LiB49d5z7bEM/xjbwYGDxKHrtWTvZfH/hx+A7ch88HkGZksYbaolJgcyTQesBaB5fd739CykNRiC+LARielsPPuRjPfamKAlUcgfFmIbPybB2RCvHAIIvh8KIBwbm0rjpgPErBEJpnCmES/vEysgL9sy5bHRuv8wFI0YjqyA1XCxhzjcizfQINOJv9U8fZ5/kY6HE8OwYlrsSkz7zstPh5USBN+1YI5jkJWQyES4EYXSiBOH5nxZFAn1ugOTEw2cHMvGa8IY0r02fHz5oCfZz3FxXbo3PSz7M4ClIBQA4DUjIfSRyX+CwA+31U9m84oSms98ZAQhMHTl8cun4lVlZfc86vio4LJLEdTenailksBRqtiiNeZv/a1Kc2Y4Nn14HUMoBpJCeQmN8Cu9QFS3+BdlE8mWEgWkCVYg4/RaRVTQeA6zltfI0M4ThQB1bN24QVKgZ+4mAMDGLXDexpr7/m6ffm067EQFD7lpgWn0KybaIpbI1WtYgXkYqyNSSrWCMGIKqYO92ejCDGwRiAVQGwFJ3nVJW75L3XH3+M8FiY1sWxpgFA3ASFI17XLRjEtJG3hl2jifbiGzkGvgPfpz16Vw8B9MLAuEB2jXRxDGx1vAZloVyANMmcgXuqVYzJGLA+mNSUxAibH2BBK9L/W2IV1D4AL+cBlKNGu5sLXEYk8h9TaYCijIWkK82EynDvA7qd6QcEMa5RtHhiAJyM/u63JUCBlDA4crl4vRckbRiQqXpR4DntHlgBZONAHYijPG74YJd27Pmwe4sAnhVO57/m86G7uq4kS4p6gwR0vlSpXuUVWmSDpRziOsGlK0GUR+bSMN7wCqiLuQ/hKWF2fuIHcVG8pl9HwsCylZo+cRDi5HF9/jGkaE/WMnLf65gmjkKtOwZMdK6+/7TIzL5m1QeglAK2SY5N63UHCVC1WW18O75nvA5497v1oZuiZD/v1Rn9veg/RwofIphcFsS+pdml4AgYCMWMJgnUGAA/MNDGdLZudJlCGJbOWYqC9IYA6MDraYzoDkg0zPUhjGwycKxLYVDazG5UhJxQPd9jRp5i19KC8ZS8Ltn3vHJyBRxOwnH3s+4UFMFj6b+KgdiVgir1QE+uYtE+JG0BMYbvjPDs/DgdxnCGJwbACbzoTL50lzaw9b+lJO45lNVS4KZ2jArlbHHA2J0YM4U6SUg8BvrAmilr41Fx2YBRbNBAGFAv7kdLgf1tng7ZHTEMeKYY2H1oIT8JhMoKWL9LLUx3iiQbVDtUmmK4B+lgo1mlIGZMWfjurQPoiVEMUOFoidAKUW8dwKmvv45uwbldZxRsUAYvCoI7kv7NUjCU++PfBu0j3Wm1gZ6Ao2v4hNcZI00IiSvXikWmEHIbFNwuWDAMhkMC5oYEpCsDmtICTbCG6kMvTCNXdpaFCwfAUlPoTkhZ/ycdBjbWx7SE8S2GK0Mw4xpYR685gFkGrxhKCSkyzII6YZ1vOb9xVPsurTPXv+3I5YPhEX+oXBIZsJKMxhmaHqiB9RxHChCYWRl9YhWa/tz3UqM7pCoA6lIhgG+0wyOIewPHtkNqz2sEFILBhbAXfNiVSkP65EQW9JYAmBIbVgUgCOds9zIWKjjGlJBmgD48aGQQGLSjxQZojOdEwJR+kQB3mh4Apxmj8ddMaoA+vEpflycHp8oCBioGdtmjGKgMGCgOCJmiYWtl3TON1IrxsnCOhp4eG10uUFwDzPua3FLA5+TM3I9JphS6XpO/ItwzBCkE0GAMTCkLU6MC3jpkColG2HgF6Pi6KAUYKx2YLwsaU0J3JC7AhXJw1wiSRqgmCQbrnoB4WKR63+4RHQFw7Aw6owKgB/fj63K8IvBERHN8mgJ8RqkDGNAPOfmriwE1BmyUhyPkVwSyj97103d7sjvxkIiVAtLojac6gkDnayblgQWvUKASFWJlmBIbg9/CR/XO4JTFBtDaoPYs0BjJqfa+FbN7ETzo1g27LMSArj4rzIWQHCKk3hmuGwZNMlhWUC1MCZLviIE76bNAEbijwVsUGxRRDRhq8GrGA9rx0EBKgnWU6ihkSQSoCM34lVPU82nU6OTAWMGF6vUABhfiX7MEf0hSsywQVwt1kGBANkRCEc3wQH0gz54dMICCMcKj1gQ7NgZoknqPubDmy2JAvEDZFiXChQxzU8SlpBYSBSTiCJGX+1kdwGDF4PhT2gVoWqXBwOivA33TqZesA7BgdIJfwxphWRkgGjhSiUBFIWDszlQ8oEFyFKvHAJOxHiAkBlLFQUHwirGL1YIY3jcmHS8FhQh2+Y/B7EUzVCkLzaNiKaBGKrh0SMn9/tecC5HOfCIWEI+BmBoO1QFPP9gPrSsLl5W5vg1KcRu0uB9NUlQd/qU8isGsH0z/ZUfMqwOoyNwITdLcGEf7Fi/iB4bImuJfe+vlL7uqZrXlb4pgrnTBGWEAN/HXA3Aq4pWsT8R2gsBMly1TBxLhYRcQE8GpL1wTaRYv6sb3BUegOx5VOsH619id+HdNrJcCkp7YxoMOd2x+AVJNTxmpnlQYigFPDXeaql8aAzDc4cosiMkIX1IkASqJv6ElxEhLUwpKoMtKQOs089Re21BIFtDtzlRq1CdI8UckgdtTy64Q6GYvOCOvvysMChcoXAQQ5QtKUoQ1ESL2RKr5ukp+eAwkdQKyIBRJP2rxoF3m6VH5gqQSUCNKm7NY7xHBslloWDP67z66uUDVMSxWJMjsv/FwpLIghgGWiZ+TH1ZVUIM+7wx42gB1XiTA1GQ+cUfIevFBbXAiFxpc1w/L+lxdGsB2gQJsp0R8Ew+k3IMSI9ISP6HUTdPTPzIZYNQBzMaDIRvM3BxsGI9A/4IxcD4p6uoDuC6QXQS4umWh0ihgoso12ktBSABQJtOLEI9gPR4DWQM07hHF9In7c8+MAbjMqHNGA2RcoNYO4kWgRnYbBnaaV3hRhCC17N+2RPXc79YEx7bPGzgYiIpxXmQ9NHV98MlhEIyEGAXS0Y+iwa8UAarv2SsGsqgoS8FOdQzO416DXh2wuZCGxT5eZFuiMDIx0SsDpi8tOC0MphQEkwKZuZ+UvOsznzLl11Hxem5RCqgMhjoqIEWHlDrQjgxpuR+8YMjLWf/O7MTEjLHqifbopbJ+PBgyNqgJ+mDKbzI9NCSnDIb9M64viEAfxfQvwl3M/Z4Y8OFolog4U5rfIsiHBLx7hHMW1vUTYjwb1KD7otgFOjL6/i2x+5ErYAnrlftZl45UQVA3bVZyvy+IPfY/x9Lp9oimbuAF15tkHmRBCQ3QRkj5I5UuGEkXvI5I0kh/A26G9ZYOeZUBdVKEujAQxYAtlDGia/UpUZfxdwTVoi7BpUweHEj8jALZGoBdcOhdVijEIqDleFKCobm/GpdQKoMtA9wOGnr8R1YCnjCYZefbsuH8zgCcOPYzy/GURTCJfQAT9AL1B8n8aaKiJkL7o7SphQbllQaoE7/cEi5/pUAwIKkQ56YnatESEAaWbPW6BJCZfZjmir6JAk3HeuSyYk2wSISK+0kKjCrrb5xn/xZLoxMq9IulgOpHoagbtL0yRrDeZRnZBSEaA0bHoIvApJjMIAWCc+c9p3P6juCpKVCA/GhZ//BzoBC+LM2/mL0eDMe/hTawwB2IAXTTv14QUM/xIWpku0NroJxaYAnTpyFobWrHqSGxdYJN8iM6oVRXDBTdT2hJDtSJvMzuFcOpU75QH2IxgLFGgRMVGqAjitlN/4E2mQXlgTXEbxmIWIf1vp9rukD68wnaakAFKZKLAFToL1VBBXTOcCS4t7JYa4FJvhBqsxKxyiAHhlEHYqNE012dJUcWTBUDE+38/grwOineSP8c+vVDIuk/agIrAkcpAAH9PNmLVaKZIHK5kGyJSpDVugSi44kdyvhEZ/PkLRZP6FtNf+VKA4h+P2rdADHfVz6KUATEUnDgHiSqwwSx4IfqMYCiHoAQERLfOEMNq9XAtINsd+hquJ+e/nENyoPPkkQwqwTG65LIguocDzWsIY77/TIQ7pRVr9QxEPSAQoRsMeCr4aQd1NHZjcP3XbjHE7HeFw/l05U+gKEEGsSz65scDzWNYXAV2E7b/4Kj+cC1csggAkseoDQogZrbYw7SYdgOmrX4azXQ32uDToQ7dlYAqSHAXSCUtEETD1D7ntq/UJcFC/di/0siP/LaAGVWFO1qIBEVNFXBiDIOxUD+pNR1hwZo21MvyuuDFSBEgbJxVpmepSBuFC0I/0JdFoAZpvIzQbkTVCmMPP2DUA2y9ija1SOT/kV/8/zsvm5JwDlwR0bmcTwAkI0AkXmlcBwRV8BlB0BHv3oPKCHFq4Fcm/SQsP91G2crm8R9kF19cv24Elhh/2vXJAPAaBIzlq8GA1VKtG0LBNBv1o465eslQqsGnLVDV8PYrQPckgo2iadg+swDjt7ojc4OADApfo1CMc0TquSlVRw687Hs/xLTjdgFtRqgdiJGpBpkGFEHKQraoxMhPuUEu3NGncefOFkDaOlfrgY17QFkU9OlL+XWAZF4iaFSuorKrI5q1dtKQGkCRFjQii1PBvGdzegng36EKZFgg07FfQVCVgRAckXLqekG6JUfWpQaUpK9JkSw6QlA5YoiWcwkogpQ7zH3qOE1O8AtpDc0H/HjTr99fxEAkdSdvTXmKecsrHEGRRsB6soAzbAQqNRfJj/1L4Hkn6fdOJXojQxB2BcCZTVmqhQMiuNu4n6FWf9ZT1QqgGKcD0K/6QaU6wQEuBeVQaT+7WZB5MkAcYfnRisXuDTaAoO+kLHFUDYexhnRuodWMJ+5BYHaAHDhXp7l2A195qWWd4IYCSKb9ywgLR5ki10KEnT3CLJ9oUk9gaEwkNpkI7g8DfHjTa7IbyJUAOr+VaQmlwx9adkASN8CG4iIjANFY0DUwWCKYIjqgQ4vqD8e8vuhT4Tj3M06z+Q/LQUihfyQMh0J/vIBOeu3W+7WA9VQr7hHluxbI8htArgpsxAGqi9k20RZ9n9KKYA1s/vv4vrjNUGqALfXmmDyaA/EhuWcHykuHthfTdpXq0n8AE4TQF4GILmiSObyK00EKztBOCyoY2MVTyfA7O7YEDWnyfCdDnfLBSL3pK0I7qWMq27hXIhgkNYWNz+SlJCwNADIygEz8cBlq7tXSjD3h2akxw7Me72fM1z8cwTr+WXhTvuKsJgCPlZjZd+OhudIewo1/ma743QThYGBUM3xbBCj7scWWMgiGjvo1Q0V9L3by8Hipth0OJ5sd6oB8GAuEFcC2OiBOhgaHBpVoZmaRk15K0ctubsAWatkvHGJ0hL1DzKS2sBGZ2CWGIAZKwRg8VLGCz59gggGa7fc9F9C7IVC2/8HggH1BTHI6BAGTqV2UzIGUinapuqy4dCoDFi8kckb4R7YFsUVwdsrESlekLJ8lvTHQ22E3mDQlkTyIQjREhWYj0HKk/a/saoYxoaCYFJHrLMO0CVSe9fmuE8NYBzAKPEfLRhIX05OQbjrl2E4GHA3NGGoFJSEB/XTwZxI0PjSAP+B2c3gcTsIAzltqZ8zRwOQ6P9gfZiFJEFdDV0x/noNcSgqlMMn7WBAUJcEIFscg8rYXBCymgzotoMGhe/S/XzeOL8w96XudCMojsjQ0j8V+YwYdGjgHZFX1pN6RB9456XyL7DJ+nVgJzZX215E7A+ELFGvN3w2+59SCugSubzvBe+EdPSepDqAzPARcK9syBN6Z0rjv+wBl5ke2AllYpDY8bCnc0btsLlG+dqpA4FRuRW5f8oGJ7Ms0aXdqxW/Q9UHIPAsoHrzWpEUdfyKpN1fdgCUQ4udOxW3FJvQbRhR7HAKdRqCb69i7kWXmgmdboAuZf/X5P21BmhcIIUxU5EFX3cbW88y28SumdU6Hdb2OpYKkH+Id4QRlcUNFakDsaOtnd1Cpe6bhtEhCkRv6IKt6GTR6RHVukAEVieVH1pBKB0wEFtFgGKmB2UCFHS4d4dBaQoVvxWC5IrGuVBwJmLgnMmZdWBwGdfUEaBzoI+iC0QgEQaQFbDQ/bWPbpd+A95fg2IqjgZCAmHjOSh8YW2SlTy8ETNtAQg7nlMWhZ3UAbieEkhqgBsd3KNsBjNP0DikWqBD4u9Fer5uVoGJoFfDpYW+XQ2wzPpiN0BfjKvOBZkQH6RAsHICYhb0161foZVxdYhg4ohhAqDsc1mHtkvpH9kf0wKVbwax/0QonB+OeyhmhzKkCMVugNT/EtdPinyGd0VmzcCNoH/F9lUjoLxOPXmJ4KMCSJOV5cnV1eFFcfTv1qqOSQB5QxRBGUn3oBFkniQQw0DMvsi+iAsAF53zBQBN9fsHQHkFe3SsAkC9v+cWDx3odxxLFgNUDmyhWRpJFhlcEkTCAClGPML7BkzZJhrm9r9oDPr0kaDvrQD8+Lr6yF4EuD2f5aJ/DyotBkA/tgyU9M8iAUtJAHIrANmHhqSuCoj2AcwD9rJFoC8SYPZiSHxfsndt0/kVgGriW1WAmvY8q8GOvwfBra4DGvqNNS0gCYBgJBzA1QsCsAPi0dwgqFLGxo5DpthN7Qk3vfv7ESJ4nTwg/Sn3x+04I4zENbgS/9nZf6X5Gh+JJKJRGKkAiqNa62BoRu7YH4f1H9dm/ZgqQN4QkHx6DYuR5le2CPSZPx/n/5zAlKwjkp59gHYagg1Ocv5Tsf8CVQ+CG7WRR1C8TmA7HzWUiZ3XYgYDb3ghSDaozumD/gzE1DCYQ/+QCYl16I/inq6O+2gfgEqoFL5n0wFoKgCHflUEOO4pAXShFAQ5IBPEuIkBnvux+K8xLuXVYSYK4woy2wKbjv4LDkFcQgST2QEopyl36r9n01vTOd5wv08ZNf9i7F8Z6KhT5GaoAXV3SLSA2HmSNkCNVoCxK1a3+zlk+AxD/5tw34rgfQ6CmiEzKvZzplr17imfAAAehQVU4j6+l2Ekr6Mu/rkSEOSP+K2yHgBA2DNUHjuLnK43y/+hEPrFlb74g75YAY7cTK0MePmVBfkpK8CtJj9UU38j5avC13Z+gjeSHBg4rEwsOwOSUYN6SJTeaLN6OCUos7Ab9EZwAJ34ybhHzzA9KBDVew9Cc6xvLX9x07soSt69b1D8SwT4sGb1y33PSVsqmZKJxfoy1JZuspUAwgvqpifGFHCHBkjEEvVEmruXm7vj5WWhj+FIwMoFwkIHw5bR6xWuSC3zAYAHwo0AaPN/CqunSf90AySgh2L8o2KGdg9DkRQPCilCtJDkQjaS/iO+p5v+xYWawfiMw/SzJh2y5ZGqrRFvVCKVk5Vj9qFI/4fwpWpLFQIF+iXibwAPdicox+9J9xsGnLzlGypKWiwpmg7W/VC7CMQ/rXOOAsCvgP6s0/JaDXD0gwvyo6X/XfiWuZ+o4j8786kQfwN8tGmekA3/xJZOIqf+qKrqtg8Agg7ua8TaB7BiBvQ59NNfGfpfMg59BABTwK9ca6b/ffaBisCBWuk+mQ80YYB1SHDIRsY/NW9USu0I7cQoApuDYEemanUgWARScO+oA7Nyf3ab148GfR0Az10hip1riapzTp8BYKR/ourf44tHRYGarF9+y8HtLHwBITz8T1cnQuJgXGrUDDN2ZFxazEK/7SjgZeB4/g/aNEChgGnDRGuAbmtkm/T/ALgpiX+nQLAxn1IB70vAqlUvbJcUeRy6secjEHE3dYzr4LD7GUHtRPSvoz34RaAXKFAlghsLqI6BGxQDP2LiL0C/5/4D98+IaWwfEj58kvYLculQAiJKX0xsbEFgU1RV/ga2/oQxq74bQHgBXL7XQaoDgB8wuslZ3KjMYwuDp/v5jIQjAB4F6IvcX+KeNvZ/8H4Oeopt/WB4vCYVRpQaYfyJ3vEtEc6d9UBHZh84w5k/9kPfgHs9AGo9i4UGaLUvVbSHdpJTCIDXt4+6DuzBUKOAwNz0E6qFv4gSwzb7fihOB4G0HqAbhZjrLqVG3+ZQ/3cz/qsNRygBIPGfZ8d3b3tRnf5fvmdRAYA2oCuIL++vOsGBMBDn21Qb1FYCiokZFcHF2GzfmuAV9uXqY/C+APosAJomAFS5/yA/JJCfw/O5bU+vs/6L9jTf7l9gbVDWYYB8U2iOe7TqPrqfTOGKGppY7Z3NRUByqymcDbU/An0pAEDuAb9Gx+jA/e78EFSknxMe2n2iB0uJpGZLKhcf2tWAUyDqQb8K+phXA/ktISa0wLr3+qResNI3gN4LADgWNJZF4EB/k/tJhv4O+j39H5HAw0Acj9aOgQFhe4lqjx3wmwMGZRdXw3SI4O5MGV/5fsHbp0C/DQBBAW8B8BK+qKO/lrzP6kCPNv2/ug0ohQEq9UE7+xFixzCR7gKBPAc6KEa75W+niTk1JeOfwX0RAEivDM0DoGH/oKN/4z9PuJcV4FkQKnqzh0ED+uAKseYQbN0eFXtkfKGMOMODxoowVHdjHpmEC5Gf3p1of+jXA+AfqwClBdSwf3yZP3uENOh/8Z993nPDghwGDfQj8QCsU8GA2zGqjjNy+Yh78/ZFJ/jHcK9SIGrYP7TaF4oi8HgAaui/HdVgJzzUMB9eCqiOByUGWn0sDbSlabq0MqZsEcR7BRpQUpNwTcrv3vF87uj/FyAeOwLgtSCY4AYy86Gd6hTo37P+qxRsib/aX5O2e6i6BylWBzRFa7qithpGvYwM+j/dLhCk0D+pOn0T6I2/ogoA4v4P1MIXZPTDrXgUigpQZv2dDpVwL6OCXo+iXgGQrFNc+XnuQDn0Z72Xjq1QDHsRp0JwhXb/Gty3AfAobdDS/4HD+jy6Yxv6oYyKnfBsoKfS7akjgeoi8LyH9uOHXRZk7MUb6wygtjLmAwGBp6GfPhvragA8mj5AwXwe2xe3Iv0/4FjtRQXRf/0LB/pf8dBk+oYFlRkd/cO6q7+5tINI5jNNGGhzmhh2Y1IsqE/+4rIIjDunf6TncAQA1R0ALCgQNfynVAIb7WkrAFTor4gQ1iexamGAlv+DeltAZeropLTgid88eKZYRhN5/AUHga6G+yMA/nsTbNDD/YSa/Ijsf0v8bQWQ8n17PzFe4p31qxEh9Gj9oMWJfwMcfwf6sgvUBABAJX8fzwGhh5L+66z/+oKFBP+iTf/SWUYGEYr0ht872bto6/Dph/7iX4K+LIKxCAAh/Re4hwL6O+F5wb3kFw9WChoOYhQE4/gZJSRQapD1W9146gJwW3uMDCB9qJlzwq99f/yjB1Ui+LD/odK+Le8vsv6L9O9hwNI8oQR3VOx8+2yvsJXZw4WGtzDp6wBMWQ18/tafXxBvmwimgwId9j9UCyMfexGAog7AK/2XfEYgOTX0CaVIiBSBshXQrETxNnaekoZX6Nd1q4FntoHpq3BvBgBL/4+S/2wN4z33U/0uEbWYfu27yENCfGMxWgQwaMgofS6dl01OddONoGvi7FOnQV8uUB0APP03FOiA1KNoY+E26gzbRkPifyIGRUaE8k5VhgZwmQ+OLaG61kbhlzmk8ZOnQbcKAEUA7HtFvdL/Rvpb86c5EpIEhlPxfqj9UPsdnaEEctZ+hgX1yYAsO4o8hH8PtesDoCgCuIvg3QDdSH+T41/9AU0MgLTvZrAOBNbmvjeHjaNw2iAQjVL5PxU/mwu07WkOVCzfZRYQfwePQToGYmKnqlMzEBH5UOw5H3v8gaL2zjoc4DeC5ptKx/2/N6IyALYYeDYHKu0rkh/aeL844CkO/XMZoFGgSKZ3y0X8czUm/s0jU0+60Q/9iygQHcsAsNy5sJl/Lpyfg+5vtKf5r6XDfEkIFh+o2xwA1eX8iE/3gjuJ4w/9WgDcSmLTCIDN+TncT2LpHyXLHyQZgJlFGbQeMvRX0DBZV3xZAOxZtu0BF6T/+RWh6XXicfhkdQ9oB7lkZEBAGaPHcK7I2mk5vn/mjxIAsG0DsW+NVUw9EBXof0L/Vq1lUQc/QaBDBOZJLPHEHH60xw+dVXZWps+f2T9NBEPNf16zbUXn60j8BfRLqnP8B4XN3/Af5b2Ux4SSo/mrP+lZczXRIQj6ExB8dwX4R49HvYE9vtB/+D8I9NzZakP/EQM3tqkJKto3u09sN9BHisZAhMxHpyf3f/EwiQJtyeYGQE/0YzHz8zh0MBToVxc6gh4D7NMj6BrH0U+m+FCViX9Mel40AJ5YxNIFeobB45jwKT0fOQb4WS/NF31rq5I7M+c2hjgFf3jJ2PvLAqAKAISaxO8bnOzmD722PxEGnkEy9Wv0O4MymMfbKSMSkWDAzwHNjzXJLtDrRIkbIEJ5XkZ1dliNftIt/wM2UrKvJiri++/QepRfGzQ/7K4JAKTHDQDghi9z81giTLXrT2arC1tLlDp2QMYzTJ5O9NEPlF9MgZ6ew+3Ys/a16HEvBXyJo05aqGFEwDgShDfbd9G/ZvE7nhB4P417HQqECHSDx22rA0X6LxO/trMVRVhwatVJqg8wDlb8jZr9UfZ1fzwbYQjwb6sA9QKx47SLjuF+7b0csYOW8Zkf7P6oBqDbqwLQv+KcvMdB/ZtdPl+mTb3bM/0+zOv/6T/SpVWA2z+gfwD/XvznmALiEz6QP98Hp6LpHcMRPxR+cwWAGzz+AT5j4Hl7yBPOO/pFh4c6ZMBbNxzs2BTkR0u+LQDoRgRwuwHdNw+UXjM/RNW+bny68yUTxI0eapFwwaznD1DQZcLvV0lWV4AX/2nO/tWnO334hB+ibvh80Tbfv9s7AwAR6A7077VrOT3UBS6q3p27QdTv9hMt51Gg5y64/14BANvYc+X5iFResjIp/2a+PRB+kfjnK8A/uN0B/lUbPRCf75+BF/zzSPzF2+UqAN5fCvg4JFjr7zaLevuO/7wAdP4mCn+xJwfAUwHv6wD2ESDgQ84LWOLPzPih+d0B8J9XB0CWvyjrV+r6WOgzEfZD21eL4DvAv4r/0C9bf+jt9wmlA+BG9FTAj3JTON30/CXD3+2rAuBOcA8MNv9uv9tXBgDcCe7F9ugS+SWXF//C5qe2P7UC/E+5Ibr1BtDv/f3dvrAC/C8dO538UPnL1n8wAMiF/q8F9SE3+r3BPRrgd/vd/m4A/CP475vOU/7dfrf3i+DXaXi/2+/2NyvAr3n4u/3pAMBfAPxuf/f2/wMAQAlQpLLpCe4AAAAASUVORK5CYII=\";x3dom.caps={PLATFORM:navigator.platform,AGENT:navigator.userAgent,RENDERMODE:\"HARDWARE\"};x3dom.registerNodeType=function(nodeTypeName,componentName,nodeDef){if(x3dom.components[componentName]===undefined){x3dom.components[componentName]={};}\nnodeDef._typeName=nodeTypeName;nodeDef._compName=componentName;x3dom.components[componentName][nodeTypeName]=nodeDef;x3dom.nodeTypes[nodeTypeName]=nodeDef;x3dom.nodeTypesLC[nodeTypeName.toLowerCase()]=nodeDef;};x3dom.isX3DElement=function(node){var name=(node.nodeType===Node.ELEMENT_NODE&&node.localName)?node.localName.toLowerCase():null;return(name&&(x3dom.nodeTypes[node.localName]||x3dom.nodeTypesLC[name]||name==\"x3d\"||name==\"websg\"||name==\"route\"));};x3dom.extend=function(f){function G(){}\nG.prototype=f.prototype||f;return new G();};x3dom.getStyle=function(oElm,strCssRule){var strValue=\"\";var style=document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(oElm,null):null;if(style){strValue=style.getPropertyValue(strCssRule);}else if(oElm.currentStyle){strCssRule=strCssRule.replace(/\\-(\\w)/g,function(strMatch,p1){return p1.toUpperCase();});strValue=oElm.currentStyle[strCssRule];}\nreturn strValue;};function defineClass(parent,ctor,methods){if(parent){function Inheritance(){}\nInheritance.prototype=parent.prototype;ctor.prototype=new Inheritance();ctor.prototype.constructor=ctor;ctor.superClass=parent;}\nif(methods){for(var m in methods){ctor.prototype[m]=methods[m];}}\nreturn ctor;}\nx3dom.isa=function(object,clazz){return(object instanceof clazz);};x3dom.getGlobal=function(){return(function(){return this;}).call(null);};x3dom.loadJS=function(src,path_prefix,blocking){blocking=(blocking===false)?blocking:true;if(blocking){var url=(path_prefix)?path_prefix.trim()+src:src;var req=new XMLHttpRequest();if(req){req.open(\"GET\",url,false);req.send(null);eval(req.responseText);}}else{var head=document.getElementsByTagName('HEAD').item(0);var script=document.createElement(\"script\");var loadpath=(path_prefix)?path_prefix.trim()+src:src;if(head){x3dom.debug.logError(\"Trying to load external JS file: \"+loadpath);script.type=\"text/javascript\";script.src=loadpath;head.appendChild(script);}else{alert(\"No document object found. Can't load components!\");}}};function array_to_object(a){var o={};for(var i=0;i<a.length;i++){o[a[i]]='';}\nreturn o;}\nwindow.requestAnimFrame=(function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(callback,element){window.setTimeout(callback,16);};})();x3dom.toggleFullScreen=function(){if(document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen){if(document.cancelFullScreen){document.cancelFullScreen();}else if(document.mozCancelFullScreen){document.mozCancelFullScreen();}else if(document.webkitCancelFullScreen){document.webkitCancelFullScreen();}}else{var docElem=document.documentElement;if(docElem.requestFullScreen){docElem.requestFullScreen();}else if(docElem.mozRequestFullScreen){docElem.mozRequestFullScreen();}else if(docElem.webkitRequestFullScreen){docElem.webkitRequestFullScreen();}}};x3dom.debug={INFO:\"INFO\",WARNING:\"WARNING\",ERROR:\"ERROR\",EXCEPTION:\"EXCEPTION\",isActive:false,isFirebugAvailable:false,isSetup:false,isAppend:false,numLinesLogged:0,maxLinesToLog:10000,logContainer:null,setup:function(){if(x3dom.debug.isSetup){return;}\ntry{if(window.console.firebug!==undefined){x3dom.debug.isFirebugAvailable=true;}}\ncatch(err){x3dom.debug.isFirebugAvailable=false;}\nx3dom.debug.setupLogContainer();x3dom.debug.isSetup=true;},activate:function(visible){x3dom.debug.isActive=true;x3dom.debug.logContainer.style.display=(visible)?\"block\":\"none\";},setupLogContainer:function(){x3dom.debug.logContainer=document.createElement(\"div\");x3dom.debug.logContainer.setAttribute(\"class\",\"x3dom-log\");},appendElement:function(x3dElement)\n{x3dElement.appendChild(x3dom.debug.logContainer);},doLog:function(msg,logType){if(!x3dom.debug.isActive){return;}\nif(x3dom.debug.numLinesLogged===x3dom.debug.maxLinesToLog){msg=\"Maximum number of log lines (=\"+x3dom.debug.maxLinesToLog+\") reached. Deactivating logging...\";}\nif(x3dom.debug.numLinesLogged>x3dom.debug.maxLinesToLog){return;}\nvar node=document.createElement(\"p\");node.style.margin=0;switch(logType){case x3dom.debug.INFO:node.style.color=\"#00ff00\";break;case x3dom.debug.WARNING:node.style.color=\"#cd853f\";break;case x3dom.debug.ERROR:node.style.color=\"#ff4500\";break;case x3dom.debug.EXCEPTION:node.style.color=\"#ffff00\";break;default:node.style.color=\"#00ff00\";break;}\ntry{node.innerHTML=logType+\": \"+msg;x3dom.debug.logContainer.insertBefore(node,x3dom.debug.logContainer.firstChild);}catch(err){if(window.console.firebug!==undefined){window.console.warn(msg);}}\nif(x3dom.debug.isFirebugAvailable){switch(logType){case x3dom.debug.INFO:window.console.info(msg);break;case x3dom.debug.WARNING:window.console.warn(msg);break;case x3dom.debug.ERROR:window.console.error(msg);break;case x3dom.debug.EXCEPTION:window.console.debug(msg);break;default:break;}}\nx3dom.debug.numLinesLogged++;},logInfo:function(msg){x3dom.debug.doLog(msg,x3dom.debug.INFO);},logWarning:function(msg){x3dom.debug.doLog(msg,x3dom.debug.WARNING);},logError:function(msg){x3dom.debug.doLog(msg,x3dom.debug.ERROR);},logException:function(msg){x3dom.debug.doLog(msg,x3dom.debug.EXCEPTION);},assert:function(c,msg){if(!c){x3dom.debug.doLog(\"Assertion failed in \"+\nx3dom.debug.assert.caller.name+': '+\nmsg,x3dom.debug.ERROR);}},typeOf:function(obj){var type=typeof obj;return type===\"object\"&&!obj?\"null\":type;},exists:function(obj,name,type){type=type||\"function\";return(obj?this.typeOf(obj[name]):\"null\")===type;},dumpFields:function(node){var str=\"\";for(var fName in node){str+=(fName+\", \");}\nstr+='\\n';x3dom.debug.logInfo(str);return str;}};x3dom.debug.setup();x3dom.arc={};x3dom.arc.instance=null;x3dom.arc.Limits=function(min,max,initial)\n{this._min=min;this._max=max;this.getValue=function(value)\n{value=this._min+(this._max-this._min)*value;return this._max>=value?(this._min<=value?value:this._min):this._max;};};x3dom.arc.ARF=function(name,min,max,dirFac,factorGetterFunc,factorSetterFunc,getterFunc,setterFunc)\n{this._name=name;this._stateValue=[0.5,0.5];this._limits=new x3dom.arc.Limits(min,max);this._factorGetterFunc=factorGetterFunc;this._factorSetterFunc=factorSetterFunc;this._setterFunc=setterFunc;this._getterFunc=getterFunc;this._dirFac=dirFac;this.getFactor=function()\n{return this._factorGetterFunc();};this.update=function(state,step)\n{var stateVal=this._stateValue[state]+step*this._dirFac;this._stateValue[state]=0<=stateVal?(1>=stateVal?stateVal:1):0;this._setterFunc(this._limits.getValue(this._stateValue[state]));};this.reset=function()\n{this._stateValue[0]=0.5;this._stateValue[1]=0.5;};};x3dom.arc.AdaptiveRenderControl=defineClass(null,function(scene)\n{x3dom.arc.instance=this;this._scene=scene;this._targetFrameRate=[];this._targetFrameRate[0]=this._scene._vf.minFrameRate;this._targetFrameRate[1]=this._scene._vf.maxFrameRate;this._currentState=0;var that=this;var environment=that._scene.getEnvironment();this._arfs=[];this._arfs.push(new x3dom.arc.ARF(\"smallFeatureCulling\",0,10,-1,function()\n{return environment._vf.smallFeatureFactor;},function(value)\n{environment._vf.smallFeatureFactor=value;},function()\n{return environment._vf.smallFeatureThreshold;},function(value)\n{environment._vf.smallFeatureThreshold=value;}));this._arfs.push(new x3dom.arc.ARF(\"lowPriorityCulling\",0,100,1,function()\n{return environment._vf.lowPriorityFactor;},function(value)\n{environment._vf.lowPriorityFactor=value;},function()\n{return environment._vf.lowPriorityThreshold*100;},function(value)\n{environment._vf.lowPriorityThreshold=value/100;}));this._arfs.push(new x3dom.arc.ARF(\"tessellationDetailCulling\",1,12,-1,function()\n{return environment._vf.tessellationErrorFactor;},function(value)\n{environment._vf.tessellationErrorFactor=value;},function()\n{return environment.tessellationErrorThreshold;},function(value)\n{environment.tessellationErrorThreshold=value;}));this._stepWidth=0.1;},{update:function(state,fps)\n{this._currentState=state;var delta=fps-this._targetFrameRate[state];this._stepWidth=Math.abs(delta)>10?0.1:0.01;var factorSum=0;var normFactors=[];var i,n=this._arfs.length;for(i=0;i<n;++i)\n{normFactors[i]=this._arfs[i].getFactor();if(normFactors[i]>0)\nfactorSum+=normFactors[i];}\nvar dirFac=delta<0?-1:1;for(i=0;i<n;++i)\n{if(normFactors[i]>0)\n{normFactors[i]/=factorSum;this._arfs[i].update(state,this._stepWidth*normFactors[i]*dirFac);}}},reset:function()\n{for(var i=0,n=this._arfs.length;i<n;++i)\n{this._arfs[i].reset();}}});x3dom.Request=function(url,onloadCallback,priority){this.url=url;this.priority=priority;this.xhr=new XMLHttpRequest();this.onloadCallbacks=[onloadCallback];var self=this;this.xhr.onload=function(){if(x3dom.DownloadManager.debugOutput){x3dom.debug.logInfo('Download manager received data for URL \\''+self.url+'\\'.');}\n--x3dom.DownloadManager.activeDownloads;if((x3dom.DownloadManager.stallToKeepOrder===false)||(x3dom.DownloadManager.resultGetsStalled(self.priority)===false)){var i;for(i=0;i<self.onloadCallbacks.length;++i){self.onloadCallbacks[i](self.xhr.response);}\nx3dom.DownloadManager.removeDownload(self);x3dom.DownloadManager.updateStalledResults();}\nelse if(x3dom.DownloadManager.debugOutput){x3dom.debug.logInfo('Download manager stalled downloaded result for URL \\''+self.url+'\\'.');}\nx3dom.DownloadManager.tryNextDownload();};};x3dom.Request.prototype.send=function(){this.xhr.open('GET',encodeURI(this.url),true);this.xhr.responseType='arraybuffer';this.xhr.send(null);if(x3dom.DownloadManager.debugOutput){x3dom.debug.logInfo('Download manager posted XHR for URL \\''+this.url+'\\'.');}};x3dom.DownloadManager={requests:[],maxDownloads:6,activeDownloads:0,debugOutput:false,stallToKeepOrder:false,toggleDebugOutput:function(flag){this.debugOutput=flag;},toggleStrictReturnOrder:function(flag){this.stallToKeepOrder=false;},removeDownload:function(req){var i,j;var done=false;for(i=0;i<this.requests.length&&!done;++i){if(this.requests[i]){for(j=0;j<this.requests[i].length;++j){if(this.requests[i][j]===req){this.requests[i].splice(j,1);done=true;break;}}}}},tryNextDownload:function(){var firstRequest;var i,j;if(this.activeDownloads<this.maxDownloads){for(i=0;i<this.requests.length&&!firstRequest;++i){if(this.requests[i]){for(j=0;j<this.requests[i].length;++j){if(this.requests[i][j].xhr.readyState===XMLHttpRequest.UNSENT){firstRequest=this.requests[i][j];break;}}}}\nif(firstRequest){firstRequest.send();++this.activeDownloads;}}},resultGetsStalled:function(priority){var i;for(i=0;i<priority;++i){if(this.requests[i]&&this.requests[i].length){return true;}}\nreturn false;},updateStalledResults:function(){if(x3dom.DownloadManager.stallToKeepOrder){var i,j,k;var req,pendingRequestFound=false;for(i=0;i<this.requests.length&&!pendingRequestFound;++i){if(this.requests[i]){for(j=0;j<this.requests[i].length;++j){req=this.requests[i][j];if(req.xhr.readyState===XMLHttpRequest.DONE){if(x3dom.DownloadManager.debugOutput){x3dom.debug.logInfo('Download manager releases stalled result for URL \\''+req.url+'\\'.');}\nfor(k=0;k<req.onloadCallbacks.length;++k){req.onloadCallbacks[k](req.xhr.response);}\nthis.requests[i].splice(j,1);}\nelse{pendingRequestFound=true;}}}}}},get:function(urls,onloadCallbacks,priorities){var i,j,k,r;var found=false;var url,onloadCallback,priority;if(urls.length!==onloadCallbacks.length||urls.length!==priorities.length)\n{x3dom.debug.logError('DownloadManager: The number of given urls, onload callbacks and priorities is not equal. Ignoring requests.');return;}\nfor(k=0;k<urls.length;++k){if(onloadCallbacks[k]==undefined||priorities[k]==undefined){x3dom.debug.logError('DownloadManager: No onload callback and / or priority specified. Ignoring request for \\\"'+urls[k]+'\\\"');continue;}\nelse{url=urls[k];onloadCallback=onloadCallbacks[k];priority=priorities[k];for(i=0;i<this.requests.length&&!found;++i){if(this.requests[i]){for(j=0;j<this.requests[i].length;++j){if(this.requests[i][j].url===url){this.requests[i][j].onloadCallbacks.push(onloadCallback);if(x3dom.DownloadManager.debugOutput){x3dom.debug.logInfo('Download manager appended onload callback for URL \\''+url+'\\' to a registered request using the same URL.');}\nfound=true;break;}}}}\nif(!found){r=new x3dom.Request(url,onloadCallback,priority);if(this.requests[priority]!=undefined){this.requests[priority].push(r);}\nelse{this.requests[priority]=[r];}}}}\nfor(i=0;i<urls.length&&this.activeDownloads<this.maxDownloads;++i){this.tryNextDownload();}},abortAllDownloads:function()\n{var request;for(var i=0;i<this.requests.length;i++)\n{if(this.requests[i]!=undefined)\n{for(var j=0;j<this.requests[i].length;j++)\n{request=this.requests[i][j];request.xhr.abort();this.removeDownload(request);}}}}};x3dom.RequestManager={};x3dom.RequestManager.requests=[];x3dom.RequestManager.maxParallelRequests=50;x3dom.RequestManager.failedRequests=0;x3dom.RequestManager.loadedRequests=0;x3dom.RequestManager.totalRequests=0;x3dom.RequestManager.activeRequests=[];x3dom.RequestManager.requestHeaders=[];x3dom.RequestManager.withCredentials=false;x3dom.RequestManager.onSendRequest=function(counters){};x3dom.RequestManager.onAbortAllRequests=function(counters){};x3dom.RequestManager.addRequestHeader=function(header,value)\n{this.requestHeaders.push({header:header,value:value});};x3dom.RequestManager._sendRequest=function()\n{this.onSendRequest(this._getCounters());if(this.activeRequests.length>this.maxParallelRequests)\n{return;}\nvar request=this.requests.pop();if(request)\n{this.activeRequests.push(request);request.send(null);this._sendRequest();}};x3dom.RequestManager._getCounters=function()\n{return{loaded:this.loadedRequests,active:this.activeRequests.length,failed:this.failedRequests,total:this.totalRequests,};};x3dom.RequestManager.addRequest=function(request)\n{if(!(request instanceof XMLHttpRequest))\n{return;}\nthis.totalRequests++;request.withCredentials=this.withCredentials;for(var i=0;i<this.requestHeaders.length;i++)\n{var header=this.requestHeaders[i].header;var value=this.requestHeaders[i].value;request.setRequestHeader(header,value);}\nrequest.addEventListener(\"load\",this._onLoadHandler.bind(this));request.addEventListener(\"error\",this._onErrorHandler.bind(this));this.requests.push(request);this._sendRequest();};x3dom.RequestManager.abortAllRequests=function()\n{for(var i=0;i<this.activeRequests.length;i++)\n{this.activeRequests[i].abort();}\nthis.requests=[];this.activeRequests=[];this.failedRequests=0;this.loadedRequests=0;this.totalRequests=0;this.onAbortAllRequests(this._getCounters());};x3dom.RequestManager._removeActiveRequest=function(request)\n{var idx=this.activeRequests.indexOf(request);return this.activeRequests.splice(idx,1);};x3dom.RequestManager._onLoadHandler=function(e)\n{this._removeActiveRequest(e.target);this.loadedRequests++;this._sendRequest();};x3dom.RequestManager._onErrorHandler=function(e)\n{this._removeActiveRequest(e.target);this.failedRequests++;this._sendRequest();};x3dom.MultiMaterial=function(params)\n{this._origAmbientIntensity=params.ambientIntensity;this._origDiffuseColor=params.diffuseColor;this._origEmissiveColor=params.emissiveColor;this._origShininess=params.shininess;this._origSpeclarColor=params.specularColor;this._origTransparency=params.transparency;this._origBackAmbientIntensity=params.backAmbientIntensity;this._origBackDiffuseColor=params.backDiffuseColor;this._origBackEmissiveColor=params.backEmissiveColor;this._origBackShininess=params.backShininess;this._origBackSpecularColor=params.backSpecularColor;this._origBackTransparency=params.backTransparency;this._ambientIntensity=params.ambientIntensity;this._diffuseColor=params.diffuseColor;this._emissiveColor=params.emissiveColor;this._shininess=params.shininess;this._specularColor=params.specularColor;this._transparency=params.transparency;this._backAmbientIntensity=params.backAmbientIntensity;this._backDiffuseColor=params.backDiffuseColor;this._backEmissiveColor=params.backEmissiveColor;this._backShininess=params.backShininess;this._backSpecularColor=params.backSpecularColor;this._backTransparency=params.backTransparency;this._highlighted=false;this.reset=function(){this._ambientIntensity=this._origAmbientIntensity;this._diffuseColor=this._origDiffuseColor;this._emissiveColor=this._origEmissiveColor;this._shininess=this._origShininess;this._specularColor=this._origSpeclarColor;this._transparency=this._origTransparency;this._backAmbientIntensity=this._origBackAmbientIntensity;this._backDiffuseColor=this._origBackDiffuseColor;this._backEmissiveColor=this._origBackEmissiveColor;this._backShininess=this._origBackShininess;this._backSpecularColor=this._origBackSpecularColor;this._backTransparency=this._origBackTransparency;};};x3dom.Parts=function(multiPart,ids,colorMap,emissiveMap,specularMap,visibilityMap)\n{var parts=this;this.multiPart=multiPart;this.ids=ids;this.colorMap=colorMap;this.emissiveMap=emissiveMap;this.specularMap=specularMap;this.visibilityMap=visibilityMap;this.width=parts.colorMap.getWidth();this.widthTwo=this.width*this.width;this.setDiffuseColor=function(color,side)\n{var i,partID,pixelIDFront,pixelIDBack;if(side==undefined&&side!=\"front\"&&side!=\"back\"&&side!=\"both\"){side=\"both\";}\ncolor=x3dom.fields.SFColor.parse(color);if(ids.length&&ids.length>1)\n{var pixels=parts.colorMap.getPixels();for(i=0;i<parts.ids.length;i++)\n{partID=parts.ids[i];pixelIDFront=partID;pixelIDBack=partID+this.widthTwo;if(side==\"front\")\n{this.multiPart._materials[partID]._diffuseColor=color;}\nelse if(side==\"back\")\n{this.multiPart._materials[partID]._backDiffuseColor=color;}\nelse if(side==\"both\")\n{this.multiPart._materials[partID]._diffuseColor=color;this.multiPart._materials[partID]._backDiffuseColor=color;}\nif(!this.multiPart._materials[partID]._highlighted)\n{if(side==\"front\"){pixels[pixelIDFront].r=color.r;pixels[pixelIDFront].g=color.g;pixels[pixelIDFront].b=color.b;}else if(side==\"back\"){pixels[pixelIDBack].r=color.r;pixels[pixelIDBack].g=color.g;pixels[pixelIDBack].b=color.b;}else if(side==\"both\"){pixels[pixelIDFront].r=color.r;pixels[pixelIDFront].g=color.g;pixels[pixelIDFront].b=color.b;pixels[pixelIDBack].r=color.r;pixels[pixelIDBack].g=color.g;pixels[pixelIDBack].b=color.b;}}}\nparts.colorMap.setPixels(pixels);}\nelse\n{var xFront,yFront,xBack,yBack,pixelFront,pixelBack;partID=parts.ids[0];pixelIDFront=partID;pixelIDBack=partID+this.widthTwo;if(side==\"front\")\n{xFront=pixelIDFront%this.width;yFront=Math.floor(pixelIDFront/this.width);pixelFront=parts.colorMap.getPixel(xFront,yFront);this.multiPart._materials[partID]._diffuseColor=color;}\nelse if(side==\"back\")\n{xBack=pixelIDBack%this.width;yBack=Math.floor(pixelIDBack/this.width);pixelBack=parts.colorMap.getPixel(xBack,yBack);this.multiPart._materials[partID]._backDiffuseColor=color;}\nelse if(side==\"both\")\n{xFront=pixelIDFront%this.width;yFront=Math.floor(pixelIDFront/this.width);xBack=pixelIDBack%this.width;yBack=Math.floor(pixelIDBack/this.width);pixelFront=parts.colorMap.getPixel(xFront,yFront);pixelBack=parts.colorMap.getPixel(xBack,yBack);this.multiPart._materials[partID]._diffuseColor=color;this.multiPart._materials[partID]._backDiffuseColor=color;}\nif(!this.multiPart._materials[partID]._highlighted)\n{if(side==\"front\")\n{pixelFront.r=color.r;pixelFront.g=color.g;pixelFront.b=color.b;parts.colorMap.setPixel(xFront,yFront,pixelFront);}\nelse if(side==\"back\")\n{pixelBack.r=color.r;pixelBack.g=color.g;pixelBack.b=color.b;parts.colorMap.setPixel(xBack,yBack,pixelBack);}\nelse if(side==\"both\")\n{pixelFront.r=color.r;pixelFront.g=color.g;pixelFront.b=color.b;pixelBack.r=color.r;pixelBack.g=color.g;pixelBack.b=color.b;parts.colorMap.setPixel(xFront,yFront,pixelFront);parts.colorMap.setPixel(xBack,yBack,pixelBack);}}}};this.getDiffuseColor=function(side)\n{var i,partID;if(side==undefined&&side!=\"front\"&&side!=\"back\"){side=\"front\";}\nif(ids.length&&ids.length>1)\n{var diffuseColors=[];for(i=0;i<parts.ids.length;i++)\n{partID=parts.ids[i];if(side==\"front\")\n{diffuseColors.push(this.multiPart._materials[partID]._diffuseColor);}\nelse if(side==\"back\")\n{diffuseColors.push(this.multiPart._materials[partID]._backDiffuseColor);}}\nreturn diffuseColors;}\nelse\n{partID=parts.ids[0];if(side==\"front\")\n{return this.multiPart._materials[partID]._diffuseColor;}\nelse if(side==\"back\")\n{return this.multiPart._materials[partID]._backDiffuseColor;}}};this.setEmissiveColor=function(color,side)\n{var i,partID,pixelIDFront,pixelIDBack;if(side==undefined&&side!=\"front\"&&side!=\"back\"&&side!=\"both\"){side=\"both\";}\ncolor=x3dom.fields.SFColor.parse(color);if(ids.length&&ids.length>1)\n{var pixels=parts.emissiveMap.getPixels();for(i=0;i<parts.ids.length;i++)\n{partID=parts.ids[i];pixelIDFront=partID;pixelIDBack=partID+this.widthTwo;if(side==\"front\")\n{this.multiPart._materials[partID]._emissiveColor=color;}\nelse if(side==\"back\")\n{this.multiPart._materials[partID]._backEmissiveColor=color;}\nelse if(side==\"both\")\n{this.multiPart._materials[partID]._emissiveColor=color;this.multiPart._materials[partID]._backEmissiveColor=color;}\nif(!this.multiPart._materials[partID]._highlighted)\n{if(side==\"front\"){pixels[pixelIDFront].r=color.r;pixels[pixelIDFront].g=color.g;pixels[pixelIDFront].b=color.b;}else if(side==\"back\"){pixels[pixelIDBack].r=color.r;pixels[pixelIDBack].g=color.g;pixels[pixelIDBack].b=color.b;}else if(side==\"both\"){pixels[pixelIDFront].r=color.r;pixels[pixelIDFront].g=color.g;pixels[pixelIDFront].b=color.b;pixels[pixelIDBack].r=color.r;pixels[pixelIDBack].g=color.g;pixels[pixelIDBack].b=color.b;}}}\nparts.emissiveMap.setPixels(pixels);}\nelse\n{var xFront,yFront,xBack,yBack,pixelFront,pixelBack;partID=parts.ids[0];pixelIDFront=partID;pixelIDBack=partID+this.widthTwo;if(side==\"front\")\n{xFront=pixelIDFront%this.width;yFront=Math.floor(pixelIDFront/this.width);pixelFront=parts.emissiveMap.getPixel(xFront,yFront);this.multiPart._materials[partID]._emissiveColor=color;}\nelse if(side==\"back\")\n{xBack=pixelIDBack%this.width;yBack=Math.floor(pixelIDBack/this.width);pixelBack=parts.emissiveMap.getPixel(xBack,yBack);this.multiPart._materials[partID]._backEmissiveColor=color;}\nelse if(side==\"both\")\n{xFront=pixelIDFront%this.width;yFront=Math.floor(pixelIDFront/this.width);xBack=pixelIDBack%this.width;yBack=Math.floor(pixelIDBack/this.width);pixelFront=parts.emissiveMap.getPixel(xFront,yFront);pixelBack=parts.emissiveMap.getPixel(xBack,yBack);this.multiPart._materials[partID]._emissiveColor=color;this.multiPart._materials[partID]._backEmissiveColor=color;}\nif(!this.multiPart._materials[partID]._highlighted)\n{if(side==\"front\")\n{pixelFront.r=color.r;pixelFront.g=color.g;pixelFront.b=color.b;parts.emissiveMap.setPixel(xFront,yFront,pixelFront);}\nelse if(side==\"back\")\n{pixelBack.r=color.r;pixelBack.g=color.g;pixelBack.b=color.b;parts.emissiveMap.setPixel(xBack,yBack,pixelBack);}\nelse if(side==\"both\")\n{pixelFront.r=color.r;pixelFront.g=color.g;pixelFront.b=color.b;pixelBack.r=color.r;pixelBack.g=color.g;pixelBack.b=color.b;parts.emissiveMap.setPixel(xFront,yFront,pixelFront);parts.emissiveMap.setPixel(xBack,yBack,pixelBack);}}}};this.getEmissiveColor=function(side)\n{var i,partID;if(side==undefined&&side!=\"front\"&&side!=\"back\"){side=\"front\";}\nif(ids.length&&ids.length>1)\n{var emissiveColors=[];for(i=0;i<parts.ids.length;i++)\n{partID=parts.ids[i];if(side==\"front\")\n{emissiveColors.push(this.multiPart._materials[partID]._emissiveColor);}\nelse if(side==\"back\")\n{emissiveColors.push(this.multiPart._materials[partID]._backEmissiveColor);}}\nreturn emissiveColors;}\nelse\n{partID=parts.ids[0];if(side==\"front\")\n{return this.multiPart._materials[partID]._emissiveColor;}\nelse if(side==\"back\")\n{return this.multiPart._materials[partID]._backEmissiveColor;}}};this.setSpecularColor=function(color,side)\n{var i,partID,pixelIDFront,pixelIDBack;if(side==undefined&&side!=\"front\"&&side!=\"back\"&&side!=\"both\"){side=\"both\";}\ncolor=x3dom.fields.SFColor.parse(color);if(ids.length&&ids.length>1)\n{var pixels=parts.specularMap.getPixels();for(i=0;i<parts.ids.length;i++)\n{partID=parts.ids[i];pixelIDFront=partID;pixelIDBack=partID+this.widthTwo;if(side==\"front\")\n{this.multiPart._materials[partID]._specularColor=color;}\nelse if(side==\"back\")\n{this.multiPart._materials[partID]._backSpecularColor=color;}\nelse if(side==\"both\")\n{this.multiPart._materials[partID]._specularColor=color;this.multiPart._materials[partID]._backSpecularColor=color;}\nif(!this.multiPart._materials[partID]._highlighted)\n{if(side==\"front\"){pixels[pixelIDFront].r=color.r;pixels[pixelIDFront].g=color.g;pixels[pixelIDFront].b=color.b;}else if(side==\"back\"){pixels[pixelIDBack].r=color.r;pixels[pixelIDBack].g=color.g;pixels[pixelIDBack].b=color.b;}else if(side==\"both\"){pixels[pixelIDFront].r=color.r;pixels[pixelIDFront].g=color.g;pixels[pixelIDFront].b=color.b;pixels[pixelIDBack].r=color.r;pixels[pixelIDBack].g=color.g;pixels[pixelIDBack].b=color.b;}}}\nparts.specularMap.setPixels(pixels);}\nelse\n{var xFront,yFront,xBack,yBack,pixelFront,pixelBack;partID=parts.ids[0];pixelIDFront=partID;pixelIDBack=partID+this.widthTwo;if(side==\"front\")\n{xFront=pixelIDFront%this.width;yFront=Math.floor(pixelIDFront/this.width);pixelFront=parts.specularMap.getPixel(xFront,yFront);this.multiPart._materials[partID]._specularColor=color;}\nelse if(side==\"back\")\n{xBack=pixelIDBack%this.width;yBack=Math.floor(pixelIDBack/this.width);pixelBack=parts.specularMap.getPixel(xBack,yBack);this.multiPart._materials[partID]._backSpecularColor=color;}\nelse if(side==\"both\")\n{xFront=pixelIDFront%this.width;yFront=Math.floor(pixelIDFront/this.width);xBack=pixelIDBack%this.width;yBack=Math.floor(pixelIDBack/this.width);pixelFront=parts.specularMap.getPixel(xFront,yFront);pixelBack=parts.specularMap.getPixel(xBack,yBack);this.multiPart._materials[partID]._specularColor=color;this.multiPart._materials[partID]._backSpecularColor=color;}\nif(!this.multiPart._materials[partID]._highlighted)\n{if(side==\"front\")\n{pixelFront.r=color.r;pixelFront.g=color.g;pixelFront.b=color.b;parts.specularMap.setPixel(xFront,yFront,pixelFront);}\nelse if(side==\"back\")\n{pixelBack.r=color.r;pixelBack.g=color.g;pixelBack.b=color.b;parts.specularMap.setPixel(xBack,yBack,pixelBack);}\nelse if(side==\"both\")\n{pixelFront.r=color.r;pixelFront.g=color.g;pixelFront.b=color.b;pixelBack.r=color.r;pixelBack.g=color.g;pixelBack.b=color.b;parts.specularMap.setPixel(xFront,yFront,pixelFront);parts.specularMap.setPixel(xBack,yBack,pixelBack);}}}};this.getSpecularColor=function(side)\n{var i,partID;if(side==undefined&&side!=\"front\"&&side!=\"back\"){side=\"front\";}\nif(ids.length&&ids.length>1)\n{var specularColors=[];for(i=0;i<parts.ids.length;i++)\n{partID=parts.ids[i];if(side==\"front\")\n{specularColors.push(this.multiPart._materials[partID]._specularColor);}\nelse if(side==\"back\")\n{specularColors.push(this.multiPart._materials[partID]._backSpecularColor);}}\nreturn specularColors;}\nelse\n{partID=parts.ids[0];if(side==\"front\")\n{return this.multiPart._materials[partID]._specularColor;}\nelse if(side==\"back\")\n{return this.multiPart._materials[partID]._backSpecularColor;}}};this.setTransparency=function(transparency,side)\n{var i,partID,pixelIDFront,pixelIDBack;if(side==undefined&&side!=\"front\"&&side!=\"back\"&&side!=\"both\"){side=\"both\";}\nif(ids.length&&ids.length>1)\n{var pixels=parts.colorMap.getPixels();for(i=0;i<parts.ids.length;i++)\n{partID=parts.ids[i];pixelIDFront=partID;pixelIDBack=partID+this.widthTwo;if(side==\"front\")\n{this.multiPart._materials[partID]._transparency=transparency;}\nelse if(side==\"back\")\n{this.multiPart._materials[partID]._backTransparency=transparency;}\nelse if(side==\"both\")\n{this.multiPart._materials[partID]._transparency=transparency;this.multiPart._materials[partID]._backTransparency=transparency;}\nif(!this.multiPart._materials[partID]._highlighted)\n{if(side==\"front\"){pixels[pixelIDFront].a=1.0-transparency;}else if(side==\"back\"){pixels[pixelIDBack].a=1.0-transparency;}else if(side==\"both\"){pixels[pixelIDFront].a=1.0-transparency;pixels[pixelIDBack].a=1.0-transparency;}}}\nparts.colorMap.setPixels(pixels);}\nelse\n{var xFront,yFront,xBack,yBack,pixelFront,pixelBack;partID=parts.ids[0];pixelIDFront=partID;pixelIDBack=partID+this.widthTwo;if(side==\"front\")\n{xFront=pixelIDFront%this.width;yFront=Math.floor(pixelIDFront/this.width);pixelFront=parts.colorMap.getPixel(xFront,yFront);this.multiPart._materials[partID]._transparency=transparency;}\nelse if(side==\"back\")\n{xBack=pixelIDBack%this.width;yBack=Math.floor(pixelIDBack/this.width);pixelBack=parts.colorMap.getPixel(xBack,yBack);this.multiPart._materials[partID]._backTransparency=transparency;}\nelse if(side==\"both\")\n{xFront=pixelIDFront%this.width;yFront=Math.floor(pixelIDFront/this.width);xBack=pixelIDBack%this.width;yBack=Math.floor(pixelIDBack/this.width);pixelFront=parts.colorMap.getPixel(xFront,yFront);pixelBack=parts.colorMap.getPixel(xBack,yBack);this.multiPart._materials[partID]._transparency=transparency;this.multiPart._materials[partID]._backTransparency=transparency;}\nif(!this.multiPart._materials[partID]._highlighted)\n{if(side==\"front\")\n{pixelFront.a=1.0-transparency;parts.colorMap.setPixel(xFront,yFront,pixelFront);}\nelse if(side==\"back\")\n{pixelBack.a=1.0-transparency;parts.colorMap.setPixel(xBack,yBack,pixelBack);}\nelse if(side==\"both\")\n{pixelFront.a=1.0-transparency;pixelBack.a=1.0-transparency;parts.colorMap.setPixel(xFront,yFront,pixelFront);parts.colorMap.setPixel(xBack,yBack,pixelBack);}}}};this.getTransparency=function(side)\n{var i,partID;if(side==undefined&&side!=\"front\"&&side!=\"back\"){side=\"front\";}\nif(ids.length&&ids.length>1)\n{var transparencies=[];for(i=0;i<parts.ids.length;i++)\n{partID=parts.ids[i];if(side==\"front\")\n{transparencies.push(this.multiPart._materials[partID]._transparency);}\nelse if(side==\"back\")\n{transparencies.push(this.multiPart._materials[partID]._backTransparency);}}\nreturn transparencies;}\nelse\n{partID=parts.ids[0];if(side==\"front\")\n{return this.multiPart._materials[partID]._transparency;}\nelse if(side==\"back\")\n{return this.multiPart._materials[partID]._backTransparency;}}};this.setShininess=function(shininess,side)\n{var i,partID,pixelIDFront,pixelIDBack;if(side==undefined&&side!=\"front\"&&side!=\"back\"&&side!=\"both\"){side=\"both\";}\nif(ids.length&&ids.length>1)\n{var pixels=parts.specularMap.getPixels();for(i=0;i<parts.ids.length;i++)\n{partID=parts.ids[i];pixelIDFront=partID;pixelIDBack=partID+this.widthTwo;if(side==\"front\")\n{this.multiPart._materials[partID]._shininess=shininess;}\nelse if(side==\"back\")\n{this.multiPart._materials[partID]._backShininess=shininess;}\nelse if(side==\"both\")\n{this.multiPart._materials[partID]._shininess=shininess;this.multiPart._materials[partID]._backShininess=shininess;}\nif(!this.multiPart._materials[partID]._highlighted)\n{if(side==\"front\"){pixels[pixelIDFront].a=shininess;}else if(side==\"back\"){pixels[pixelIDBack].a=shininess;}else if(side==\"both\"){pixels[pixelIDFront].a=shininess;pixels[pixelIDBack].a=shininess;}}}\nparts.specularMap.setPixels(pixels);}\nelse\n{var xFront,yFront,xBack,yBack,pixelFront,pixelBack;partID=parts.ids[0];pixelIDFront=partID;pixelIDBack=partID+this.widthTwo;if(side==\"front\")\n{xFront=pixelIDFront%this.width;yFront=Math.floor(pixelIDFront/this.width);pixelFront=parts.specularMap.getPixel(xFront,yFront);this.multiPart._materials[partID]._shininess=shininess;}\nelse if(side==\"back\")\n{xBack=pixelIDBack%this.width;yBack=Math.floor(pixelIDBack/this.width);pixelBack=parts.specularMap.getPixel(xBack,yBack);this.multiPart._materials[partID]._backShininess=shininess;}\nelse if(side==\"both\")\n{xFront=pixelIDFront%this.width;yFront=Math.floor(pixelIDFront/this.width);xBack=pixelIDBack%this.width;yBack=Math.floor(pixelIDBack/this.width);pixelFront=parts.specularMap.getPixel(xFront,yFront);pixelBack=parts.specularMap.getPixel(xBack,yBack);this.multiPart._materials[partID]._shininess=shininess;this.multiPart._materials[partID]._backShininess=shininess;}\nif(!this.multiPart._materials[partID]._highlighted)\n{if(side==\"front\")\n{pixelFront.a=shininess;parts.specularMap.setPixel(xFront,yFront,pixelFront);}\nelse if(side==\"back\")\n{pixelBack.a=shininess;parts.specularMap.setPixel(xBack,yBack,pixelBack);}\nelse if(side==\"both\")\n{pixelFront.a=shininess;pixelBack.a=shininess;parts.specularMap.setPixel(xFront,yFront,pixelFront);parts.specularMap.setPixel(xBack,yBack,pixelBack);}}}};this.getShininess=function(side)\n{var i,partID;if(side==undefined&&side!=\"front\"&&side!=\"back\"){side=\"front\";}\nif(ids.length&&ids.length>1)\n{var shininesses=[];for(i=0;i<parts.ids.length;i++)\n{partID=parts.ids[i];if(side==\"front\")\n{shininesses.push(this.multiPart._materials[partID]._shininess);}\nelse if(side==\"back\")\n{shininesses.push(this.multiPart._materials[partID]._backShininess);}}\nreturn shininesses;}\nelse\n{partID=parts.ids[0];if(side==\"front\")\n{return this.multiPart._materials[partID]._shininess;}\nelse if(side==\"back\")\n{return this.multiPart._materials[partID]._backShininess;}}};this.setAmbientIntensity=function(ambientIntensity,side)\n{var i,partID,pixelIDFront,pixelIDBack;if(side==undefined&&side!=\"front\"&&side!=\"back\"&&side!=\"both\"){side=\"both\";}\nif(ids.length&&ids.length>1)\n{var pixels=parts.emissiveMap.getPixels();for(i=0;i<parts.ids.length;i++)\n{partID=parts.ids[i];pixelIDFront=partID;pixelIDBack=partID+this.widthTwo;if(side==\"front\")\n{this.multiPart._materials[partID]._ambientIntensity=ambientIntensity;}\nelse if(side==\"back\")\n{this.multiPart._materials[partID]._backAmbientIntensity=ambientIntensity;}\nelse if(side==\"both\")\n{this.multiPart._materials[partID]._ambientIntensity=ambientIntensity;this.multiPart._materials[partID]._backAmbientIntensity=ambientIntensity;}\nif(!this.multiPart._materials[partID]._highlighted)\n{if(side==\"front\"){pixels[pixelIDFront].a=ambientIntensity;}else if(side==\"back\"){pixels[pixelIDBack].a=ambientIntensity;}else if(side==\"both\"){pixels[pixelIDFront].a=ambientIntensity;pixels[pixelIDBack].a=ambientIntensity;}}}\nparts.emissiveMap.setPixels(pixels);}\nelse\n{var xFront,yFront,xBack,yBack,pixelFront,pixelBack;partID=parts.ids[0];pixelIDFront=partID;pixelIDBack=partID+this.widthTwo;if(side==\"front\")\n{xFront=pixelIDFront%this.width;yFront=Math.floor(pixelIDFront/this.width);pixelFront=parts.emissiveMap.getPixel(xFront,yFront);this.multiPart._materials[partID]._ambientIntensity=ambientIntensity;}\nelse if(side==\"back\")\n{xBack=pixelIDBack%this.width;yBack=Math.floor(pixelIDBack/this.width);pixelBack=parts.emissiveMap.getPixel(xBack,yBack);this.multiPart._materials[partID]._backAmbientIntensity=ambientIntensity;}\nelse if(side==\"both\")\n{xFront=pixelIDFront%this.width;yFront=Math.floor(pixelIDFront/this.width);xBack=pixelIDBack%this.width;yBack=Math.floor(pixelIDBack/this.width);pixelFront=parts.emissiveMap.getPixel(xFront,yFront);pixelBack=parts.emissiveMap.getPixel(xBack,yBack);this.multiPart._materials[partID]._ambientIntensity=ambientIntensity;this.multiPart._materials[partID]._backAmbientIntensity=ambientIntensity;}\nif(!this.multiPart._materials[partID]._highlighted)\n{if(side==\"front\")\n{pixelFront.a=ambientIntensity;parts.emissiveMap.setPixel(xFront,yFront,pixelFront);}\nelse if(side==\"back\")\n{pixelBack.a=ambientIntensity;parts.emissiveMap.setPixel(xBack,yBack,pixelBack);}\nelse if(side==\"both\")\n{pixelFront.a=ambientIntensity;pixelBack.a=ambientIntensity;parts.emissiveMap.setPixel(xFront,yFront,pixelFront);parts.emissiveMap.setPixel(xBack,yBack,pixelBack);}}}};this.getAmbientIntensity=function(side)\n{var i,partID;if(side==undefined&&side!=\"front\"&&side!=\"back\"){side=\"front\";}\nif(ids.length&&ids.length>1)\n{var ambientIntensities=[];for(i=0;i<parts.ids.length;i++)\n{partID=parts.ids[i];if(side==\"front\")\n{ambientIntensities.push(this.multiPart._materials[partID]._ambientIntensity);}\nelse if(side==\"back\")\n{ambientIntensities.push(this.multiPart._materials[partID]._backAmbientIntensity);}}\nreturn ambientIntensities;}\nelse\n{partID=parts.ids[0];if(side==\"front\")\n{return this.multiPart._materials[partID]._ambientIntensity;}\nelse if(side==\"back\")\n{return this.multiPart._materials[partID]._backAmbientIntensity;}}};this.highlight=function(color)\n{var i,partID,pixelIDFront,pixelIDBack,dtColor,eaColor,ssColor;color=x3dom.fields.SFColor.parse(color);if(ids.length&&ids.length>1)\n{var hasChanged=false;var dtPixels=parts.colorMap.getPixels();var eaPixels=parts.emissiveMap.getPixels();var ssPixels=parts.specularMap.getPixels();dtColor=new x3dom.fields.SFColorRGBA(0,0,0,1.0);eaColor=new x3dom.fields.SFColorRGBA(color.r,color.g,color.b,0);ssColor=new x3dom.fields.SFColorRGBA(0,0,0,0);for(i=0;i<parts.ids.length;i++){partID=parts.ids[i];pixelIDFront=partID;pixelIDBack=(parseInt(partID)+parseInt(this.widthTwo)).toString();if(!this.multiPart._materials[partID]._highlighted)\n{hasChanged=true;this.multiPart._materials[partID]._highlighted=true;dtPixels[pixelIDFront]=dtColor;eaPixels[pixelIDFront]=eaColor;ssPixels[pixelIDFront]=ssColor;dtPixels[pixelIDBack]=dtColor;eaPixels[pixelIDBack]=eaColor;ssPixels[pixelIDBack]=ssColor;}}\nif(hasChanged){this.colorMap.setPixels(dtPixels,false);this.emissiveMap.setPixels(eaPixels,false);this.specularMap.setPixels(ssPixels,true);}}\nelse\n{partID=parts.ids[0];pixelIDFront=partID;pixelIDBack=partID+this.widthTwo;var xFront=pixelIDFront%this.width;var yFront=Math.floor(pixelIDFront/this.width);var xBack=pixelIDBack%this.width;var yBack=Math.floor(pixelIDBack/this.width);if(!this.multiPart._materials[partID]._highlighted)\n{this.multiPart._materials[partID]._highlighted=true;dtColor=new x3dom.fields.SFColorRGBA(0,0,0,1);eaColor=new x3dom.fields.SFColorRGBA(color.r,color.g,color.b,0);ssColor=new x3dom.fields.SFColorRGBA(0,0,0,0);this.colorMap.setPixel(xFront,yFront,dtColor,false);this.emissiveMap.setPixel(xFront,yFront,eaColor,false);this.specularMap.setPixel(xFront,yFront,ssColor,false);this.colorMap.setPixel(xBack,yBack,dtColor,false);this.emissiveMap.setPixel(xBack,yBack,eaColor,false);this.specularMap.setPixel(xBack,yBack,ssColor,true);}}};this.unhighlight=function(){var i,partID,pixelIDFront,pixelIDBack,material;var dtColorFront,eaColorFront,ssColorFront;var dtColorBack,eaColorBack,ssColorBack;if(ids.length&&ids.length>1)\n{var hasChanged=false;var dtPixels=parts.colorMap.getPixels();var eaPixels=parts.emissiveMap.getPixels();var ssPixels=parts.specularMap.getPixels();for(i=0;i<parts.ids.length;i++){partID=parts.ids[i];pixelIDFront=partID;pixelIDBack=partID+this.widthTwo;material=this.multiPart._materials[partID];if(material._highlighted)\n{hasChanged=true;material._highlighted=false;dtPixels[pixelIDFront]=new x3dom.fields.SFColorRGBA(material._diffuseColor.r,material._diffuseColor.g,material._diffuseColor.b,1.0-material._transparency);eaPixels[pixelIDFront]=new x3dom.fields.SFColorRGBA(material._emissiveColor.r,material._emissiveColor.g,material._emissiveColor.b,material._ambientIntensity);ssPixels[pixelIDFront]=new x3dom.fields.SFColorRGBA(material._specularColor.r,material._specularColor.g,material._specularColor.b,material._shininess);dtPixels[pixelIDBack]=new x3dom.fields.SFColorRGBA(material._backDiffuseColor.r,material._backDiffuseColor.g,material._backDiffuseColor.b,1.0-material._backTransparency);eaPixels[pixelIDBack]=new x3dom.fields.SFColorRGBA(material._backEmissiveColor.r,material._backEmissiveColor.g,material._backEmissiveColor.b,material._backAmbientIntensity);ssPixels[pixelIDBack]=new x3dom.fields.SFColorRGBA(material._backSpecularColor.r,material._backSpecularColor.g,material._backSpecularColor.b,material._backShininess);}}\nif(hasChanged)\n{this.colorMap.setPixels(dtPixels,false);this.emissiveMap.setPixels(eaPixels,false);this.specularMap.setPixels(ssPixels,true);}}\nelse\n{partID=parts.ids[0];pixelIDFront=partID;pixelIDBack=partID+this.widthTwo;var xFront=pixelIDFront%this.width;var yFront=Math.floor(pixelIDFront/this.width);var xBack=pixelIDBack%this.width;var yBack=Math.floor(pixelIDBack/this.width);material=this.multiPart._materials[partID];if(material._highlighted)\n{material._highlighted=false;dtColorFront=new x3dom.fields.SFColorRGBA(material._diffuseColor.r,material._diffuseColor.g,material._diffuseColor.b,1.0-material._transparency);eaColorFront=new x3dom.fields.SFColorRGBA(material._emissiveColor.r,material._emissiveColor.g,material._emissiveColor.b,material._ambientIntensity);ssColorFront=new x3dom.fields.SFColorRGBA(material._specularColor.r,material._specularColor.g,material._specularColor.b,material._shininess);dtColorBack=new x3dom.fields.SFColorRGBA(material._backDiffuseColor.r,material._backDiffuseColor.g,material._backDiffuseColor.b,1.0-material._backTransparency);eaColorBack=new x3dom.fields.SFColorRGBA(material._backEmissiveColor.r,material._backEmissiveColor.g,material._backEmissiveColor.b,material._backAmbientIntensity);ssColorBack=new x3dom.fields.SFColorRGBA(material._backSpecularColor.r,material._backSpecularColor.g,material._backSpecularColor.b,material._backShininess);this.colorMap.setPixel(xFront,yFront,dtColorFront,false);this.emissiveMap.setPixel(xFront,yFront,eaColorFront,false);this.specularMap.setPixel(xFront,yFront,ssColorFront,false);this.colorMap.setPixel(xBack,yBack,dtColorBack,false);this.emissiveMap.setPixel(xBack,yBack,eaColorBack,false);this.specularMap.setPixel(xBack,yBack,ssColorBack,true);}}};this.toggleHighlight=function(color){for(var i=0;i<parts.ids.length;i++){if(this.multiPart._materials[parts.ids[i]]._highlighted){this.unhighlight();}else{this.highlight(color);}}};this.setColor=function(color,side){this.setDiffuseColor(color,side);};this.getColorRGB=function(){var str=this.getColorRGBA();var values=str.split(\" \");return values[0]+\" \"+values[1]+\" \"+values[2];};this.getColorRGBA=function(){var x,y;var colorRGBA=this.multiPart._originalColor[parts.ids[0]];if(this.multiPart._highlightedParts[parts.ids[0]]){colorRGBA=this.multiPart._highlightedParts[parts.ids[0]];}else{x=parts.ids[0]%parts.colorMap.getWidth();y=Math.floor(parts.ids[0]/parts.colorMap.getWidth());colorRGBA=parts.colorMap.getPixel(x,y);}\nreturn colorRGBA.toString();};this.resetColor=function(){var i,partID,pixelIDFront,pixelIDBack,material;var dtColorFront,eaColorFront,ssColorFront;var dtColorBack,eaColorBack,ssColorBack;if(ids.length&&ids.length>1)\n{var dtPixels=parts.colorMap.getPixels();var eaPixels=parts.emissiveMap.getPixels();var ssPixels=parts.specularMap.getPixels();for(i=0;i<parts.ids.length;i++){partID=parts.ids[i];pixelIDFront=partID;pixelIDBack=partID+this.widthTwo;material=this.multiPart._materials[partID];material.reset();if(!material._highlighted)\n{dtPixels[pixelIDFront]=new x3dom.fields.SFColorRGBA(material._diffuseColor.r,material._diffuseColor.g,material._diffuseColor.b,1.0-material._transparency);eaPixels[pixelIDFront]=new x3dom.fields.SFColorRGBA(material._emissiveColor.r,material._emissiveColor.g,material._emissiveColor.b,material._ambientIntensity);ssPixels[pixelIDFront]=new x3dom.fields.SFColorRGBA(material._specularColor.r,material._specularColor.g,material._specularColor.b,material._shininess);dtPixels[pixelIDBack]=new x3dom.fields.SFColorRGBA(material._backDiffuseColor.r,material._backDiffuseColor.g,material._backDiffuseColor.b,1.0-material._backTransparency);eaPixels[pixelIDBack]=new x3dom.fields.SFColorRGBA(material._backEmissiveColor.r,material._backEmissiveColor.g,material._backEmissiveColor.b,material._backAmbientIntensity);ssPixels[pixelIDBack]=new x3dom.fields.SFColorRGBA(material._backSpecularColor.r,material._backSpecularColor.g,material._backSpecularColor.b,material._backShininess);}}\nthis.colorMap.setPixels(dtPixels,false);this.emissiveMap.setPixels(eaPixels,false);this.specularMap.setPixels(ssPixels,true);}\nelse\n{partID=parts.ids[0];pixelIDFront=partID;pixelIDBack=partID+this.widthTwo;var xFront=pixelIDFront%this.width;var yFront=Math.floor(pixelIDFront/this.width);var xBack=pixelIDBack%this.width;var yBack=Math.floor(pixelIDBack/this.width);material=this.multiPart._materials[partID];material.reset();if(!material._highlighted)\n{dtColorFront=new x3dom.fields.SFColorRGBA(material._diffuseColor.r,material._diffuseColor.g,material._diffuseColor.b,1.0-material._transparency);eaColorFront=new x3dom.fields.SFColorRGBA(material._emissiveColor.r,material._emissiveColor.g,material._emissiveColor.b,material._ambientIntensity);ssColorFront=new x3dom.fields.SFColorRGBA(material._specularColor.r,material._specularColor.g,material._specularColor.b,material._shininess);dtColorBack=new x3dom.fields.SFColorRGBA(material._backDiffuseColor.r,material._backDiffuseColor.g,material._backDiffuseColor.b,1.0-material._backTransparency);eaColorBack=new x3dom.fields.SFColorRGBA(material._backEmissiveColor.r,material._backEmissiveColor.g,material._backEmissiveColor.b,material._backAmbientIntensity);ssColorBack=new x3dom.fields.SFColorRGBA(material._backSpecularColor.r,material._backSpecularColor.g,material._backSpecularColor.b,material._backShininess);this.colorMap.setPixel(xFront,yFront,dtColorFront,false);this.emissiveMap.setPixel(xFront,yFront,eaColorFront,false);this.specularMap.setPixel(xFront,yFront,ssColorFront,false);this.colorMap.setPixel(xBack,yBack,dtColorBack,false);this.emissiveMap.setPixel(xBack,yBack,eaColorBack,false);this.specularMap.setPixel(xBack,yBack,ssColorBack,true);}}};this.setVisibility=function(visibility){var i,j,x,y,usage,visibleCount,visibilityAsInt;if(!(ids.length&&ids.length>1)){x=parts.ids[0]%parts.colorMap.getWidth();y=Math.floor(parts.ids[0]/parts.colorMap.getWidth());var pixel=parts.visibilityMap.getPixel(x,y);visibilityAsInt=(visibility)?1:0;if(pixel.r!=visibilityAsInt){pixel.r=visibilityAsInt;this.multiPart._partVisibility[parts.ids[0]]=visibility;usage=this.multiPart._idMap.mapping[parts.ids[0]].usage;for(j=0;j<usage.length;j++){visibleCount=this.multiPart._visiblePartsPerShape[usage[j]];if(visibility&&visibleCount.val<visibleCount.max){visibleCount.val++;}else if(!visibility&&visibleCount.val>0){visibleCount.val--;}\nif(visibleCount.val){this.multiPart._inlineNamespace.defMap[usage[j]]._vf.render=true;}else{this.multiPart._inlineNamespace.defMap[usage[j]]._vf.render=false;}}\nparts.visibilityMap.setPixel(x,y,pixel);this.multiPart.invalidateVolume();}}\nelse\n{var hasChange=false;var pixels=parts.visibilityMap.getPixels();for(i=0;i<parts.ids.length;i++){visibilityAsInt=(visibility)?1:0;if(pixels[parts.ids[i]].r!=visibilityAsInt){pixels[parts.ids[i]].r=visibilityAsInt;hasChange=true;this.multiPart._partVisibility[parts.ids[i]]=visibility;usage=this.multiPart._idMap.mapping[parts.ids[i]].usage;for(j=0;j<usage.length;j++){visibleCount=this.multiPart._visiblePartsPerShape[usage[j]];if(visibility&&visibleCount.val<visibleCount.max){visibleCount.val++;}else if(!visibility&&visibleCount.val>0){visibleCount.val--;}\nif(visibleCount.val){this.multiPart._inlineNamespace.defMap[usage[j]]._vf.render=true;}else{this.multiPart._inlineNamespace.defMap[usage[j]]._vf.render=false;}}}}\nif(hasChange)\n{parts.visibilityMap.setPixels(pixels);this.multiPart.invalidateVolume();}}};this.getVolume=function(){var volume;var transmat=this.multiPart.getCurrentTransform();if(ids.length&&ids.length>1)\n{volume=new x3dom.fields.BoxVolume();for(var i=0;i<parts.ids.length;i++){volume.extendBounds(this.multiPart._partVolume[parts.ids[i]].min,this.multiPart._partVolume[parts.ids[i]].max);}\nvolume.transform(transmat);return volume;}\nelse\n{volume=x3dom.fields.BoxVolume.copy(this.multiPart._partVolume[parts.ids[0]]);volume.transform(transmat);return volume;}};this.fit=function(updateCenterOfRotation){var volume=this.getVolume();this.multiPart._nameSpace.doc._viewarea.fit(volume.min,volume.max,updateCenterOfRotation);};};x3dom.Properties=function(){this.properties={};};x3dom.Properties.prototype.setProperty=function(name,value){x3dom.debug.logInfo(\"Properties: Setting property '\"+name+\"' to value '\"+value+\"'\");this.properties[name]=value;};x3dom.Properties.prototype.getProperty=function(name,def){if(this.properties[name]){return this.properties[name]}else{return def;}};x3dom.Properties.prototype.merge=function(other){for(var attrname in other.properties){this.properties[attrname]=other.properties[attrname];}};x3dom.Properties.prototype.toString=function(){var str=\"\";for(var name in this.properties){str+=\"Name: \"+name+\" Value: \"+this.properties[name]+\"\\n\";}\nreturn str;};x3dom.DoublyLinkedList=function(){this.length=0;this.first=null;this.last=null;};x3dom.DoublyLinkedList.ListNode=function(point,point_index,normals,colors,texCoords){this.point=point;this.point_index=point_index;this.normals=normals;this.colors=colors;this.texCoords=texCoords;this.next=null;this.prev=null;};x3dom.DoublyLinkedList.prototype.appendNode=function(node){if(this.first===null){node.prev=node;node.next=node;this.first=node;this.last=node;}else{node.prev=this.last;node.next=this.first;this.first.prev=node;this.last.next=node;this.last=node;}\nthis.length++;};x3dom.DoublyLinkedList.prototype.insertAfterNode=function(node,newNode){newNode.prev=node;newNode.next=node.next;node.next.prev=newNode;node.next=newNode;if(newNode.prev==this.last){this.last=newNode;}\nthis.length++;};x3dom.DoublyLinkedList.prototype.deleteNode=function(node){if(this.length>1){node.prev.next=node.next;node.next.prev=node.prev;if(node==this.first){this.first=node.next;}\nif(node==this.last){this.last=node.prev;}}else{this.first=null;this.last=null;}\nnode.prev=null;node.next=null;this.length--;};x3dom.DoublyLinkedList.prototype.getNode=function(index){var node=null;if(index>this.length){return node;}\nfor(var i=0;i<this.length;i++){if(i==0){node=this.first;}else{node=node.next;}\nif(i==index){return node;}}\nreturn null;};x3dom.DoublyLinkedList.prototype.invert=function(){var tmp=null;var node=this.first;for(var i=0;i<this.length;i++){tmp=node.prev;node.prev=node.next;node.next=tmp;node=node.prev;}\ntmp=this.first;this.first=this.last;this.last=tmp;};x3dom.EarClipping={getIndexes:function(linklist){var node=linklist.first.next;var plane=this.identifyPlane(node.prev.point,node.point,node.next.point);var i,points,point_indexes,x,y;points=[];point_indexes=[];for(i=0;i<linklist.length;i++){node=linklist.getNode(i);switch(plane){case\"XY\":{x=node.point.x;y=node.point.y;break;}\ncase\"XZ\":{x=node.point.z;y=node.point.x;break;}\ndefault:{x=node.point.y;y=node.point.z;}}\npoints.push(y);points.push(x);point_indexes.push(node.point_index);}\nvar triangles=x3dom.EarCut.triangulate(points,null,2);triangles=triangles.map(function(m){return point_indexes[m];});return triangles;},getMultiIndexes:function(linklist){var node=linklist.first.next;var plane=this.identifyPlane(node.prev.point,node.point,node.next.point);var data={};data.indices=[];data.point=[];data.normals=[];data.colors=[];data.texCoords=[];var mapped={};mapped.indices=[];mapped.point=[];mapped.normals=[];mapped.colors=[];mapped.texCoords=[];var points=[];var i,x,y;for(i=0;i<linklist.length;i++){node=linklist.getNode(i);switch(plane){case\"XY\":{x=node.point.x;y=node.point.y;break;}\ncase\"XZ\":{x=node.point.z;y=node.point.x;break;}\ndefault:{x=node.point.y;y=node.point.z;}}\npoints.push(y);points.push(x);mapped.indices.push(node.point_index);mapped.point.push(node.point);if(node.normals)mapped.normals.push(node.normals);if(node.colors)mapped.colors.push(node.colors);if(node.texCoords)mapped.texCoords.push(node.texCoords);}\nvar triangles=x3dom.EarCut.triangulate(points,null,2);data.indices=triangles.map(function(m){return mapped.indices[m];});data.point=triangles.map(function(m){return mapped.point[m];});if(node.normals)data.normals=triangles.map(function(m){return mapped.normals[m];});if(node.colors)data.colors=triangles.map(function(m){return mapped.colors[m];});if(node.texCoords)data.texCoords=triangles.map(function(m){return mapped.texCoords[m];});return data;},identifyPlane:function(p1,p2,p3){var v1x,v1y,v1z;var v2x,v2y,v2z;var v3x,v3y,v3z;v1x=p2.x-p1.x;v1y=p2.y-p1.y;v1z=p2.z-p1.z;v2x=p3.x-p1.x;v2y=p3.y-p1.y;v2z=p3.z-p1.z;v3x=Math.abs(v1y*v2z-v1z*v2y);v3y=Math.abs(v1z*v2x-v1x*v2z);v3z=Math.abs(v1x*v2y-v1y*v2x);var angle=Math.max(v3x,v3y,v3z);if(angle==v3x){return'YZ';}else if(angle==v3y){return'XZ';}else if(angle==v3z){return'XY';}else{return'XZ';}}};x3dom.EarCut={triangulate:function mapEarcut(data,holes,dim){return earcut(data,holes,dim);function earcut(data,holeIndices,dim){dim=dim||2;var hasHoles=holeIndices&&holeIndices.length,outerLen=hasHoles?holeIndices[0]*dim:data.length,clockwise=windingOrder(data,0,outerLen,dim),outerNode=linkedList(data,0,outerLen,dim,true,clockwise),triangles=[];if(!outerNode)return triangles;var minX,minY,maxX,maxY,x,y,size;if(hasHoles)outerNode=eliminateHoles(data,holeIndices,outerNode,dim);if(data.length>80*dim){minX=maxX=data[0];minY=maxY=data[1];for(var i=dim;i<outerLen;i+=dim){x=data[i];y=data[i+1];if(x<minX)minX=x;if(y<minY)minY=y;if(x>maxX)maxX=x;if(y>maxY)maxY=y;}\nsize=Math.max(maxX-minX,maxY-minY);}\nearcutLinked(outerNode,triangles,dim,minX,minY,size);if(clockwise===false){triangles.reverse();}\nreturn triangles;}\nfunction windingOrder(data,start,end,dim){var sum=0;var i,j;for(i=start,j=end-dim;i<end;i+=dim){sum+=(data[j]-data[i])*(data[i+1]+data[j+1]);j=i;}\nreturn sum>0;}\nfunction linkedList(data,start,end,dim,clockwise,oclockwise){var i,j,last;if(clockwise===oclockwise){for(i=start;i<end;i+=dim)last=insertNode(i,data[i],data[i+1],last);}else{for(i=end-dim;i>=start;i-=dim)last=insertNode(i,data[i],data[i+1],last);}\nreturn last;}\nfunction filterPoints(start,end){if(!start)return start;if(!end)end=start;var p=start,again;do{again=false;if(!p.steiner&&(equals(p,p.next)||area(p.prev,p,p.next)===0)){removeNode(p);p=end=p.prev;if(p===p.next)return null;again=true;}else{p=p.next;}}while(again||p!==end);return end;}\nfunction earcutLinked(ear,triangles,dim,minX,minY,size,pass){if(!ear)return;if(!pass&&size)indexCurve(ear,minX,minY,size);var stop=ear,prev,next;while(ear.prev!==ear.next){prev=ear.prev;next=ear.next;if(size?isEarHashed(ear,minX,minY,size):isEar(ear)){triangles.push(prev.i/dim);triangles.push(ear.i/dim);triangles.push(next.i/dim);removeNode(ear);ear=next.next;stop=next.next;continue;}\near=next;if(ear===stop){if(!pass){earcutLinked(filterPoints(ear),triangles,dim,minX,minY,size,1);}else if(pass===1){ear=cureLocalIntersections(ear,triangles,dim);earcutLinked(ear,triangles,dim,minX,minY,size,2);}else if(pass===2){splitEarcut(ear,triangles,dim,minX,minY,size);}\nbreak;}}}\nfunction isEar(ear){var a=ear.prev,b=ear,c=ear.next;if(area(a,b,c)>=0)return false;var p=ear.next.next;while(p!==ear.prev){if(pointInTriangle(a.x,a.y,b.x,b.y,c.x,c.y,p.x,p.y)&&area(p.prev,p,p.next)>=0)return false;p=p.next;}\nreturn true;}\nfunction isEarHashed(ear,minX,minY,size){var a=ear.prev,b=ear,c=ear.next;if(area(a,b,c)>=0)return false;var minTX=a.x<b.x?(a.x<c.x?a.x:c.x):(b.x<c.x?b.x:c.x),minTY=a.y<b.y?(a.y<c.y?a.y:c.y):(b.y<c.y?b.y:c.y),maxTX=a.x>b.x?(a.x>c.x?a.x:c.x):(b.x>c.x?b.x:c.x),maxTY=a.y>b.y?(a.y>c.y?a.y:c.y):(b.y>c.y?b.y:c.y);var minZ=zOrder(minTX,minTY,minX,minY,size),maxZ=zOrder(maxTX,maxTY,minX,minY,size);var p=ear.nextZ;while(p&&p.z<=maxZ){if(p!==ear.prev&&p!==ear.next&&pointInTriangle(a.x,a.y,b.x,b.y,c.x,c.y,p.x,p.y)&&area(p.prev,p,p.next)>=0)return false;p=p.nextZ;}\np=ear.prevZ;while(p&&p.z>=minZ){if(p!==ear.prev&&p!==ear.next&&pointInTriangle(a.x,a.y,b.x,b.y,c.x,c.y,p.x,p.y)&&area(p.prev,p,p.next)>=0)return false;p=p.prevZ;}\nreturn true;}\nfunction cureLocalIntersections(start,triangles,dim){var p=start;do{var a=p.prev,b=p.next.next;if(intersects(a,p,p.next,b)&&locallyInside(a,b)&&locallyInside(b,a)){triangles.push(a.i/dim);triangles.push(p.i/dim);triangles.push(b.i/dim);removeNode(p);removeNode(p.next);p=start=b;}\np=p.next;}while(p!==start);return p;}\nfunction splitEarcut(start,triangles,dim,minX,minY,size){var a=start;do{var b=a.next.next;while(b!==a.prev){if(a.i!==b.i&&isValidDiagonal(a,b)){var c=splitPolygon(a,b);a=filterPoints(a,a.next);c=filterPoints(c,c.next);earcutLinked(a,triangles,dim,minX,minY,size);earcutLinked(c,triangles,dim,minX,minY,size);return;}\nb=b.next;}\na=a.next;}while(a!==start);}\nfunction eliminateHoles(data,holeIndices,outerNode,dim){var queue=[],i,len,start,end,list;for(i=0,len=holeIndices.length;i<len;i++){start=holeIndices[i]*dim;end=i<len-1?holeIndices[i+1]*dim:data.length;list=linkedList(data,start,end,dim,false);if(list===list.next)list.steiner=true;queue.push(getLeftmost(list));}\nqueue.sort(compareX);for(i=0;i<queue.length;i++){eliminateHole(queue[i],outerNode);outerNode=filterPoints(outerNode,outerNode.next);}\nreturn outerNode;}\nfunction compareX(a,b){return a.x-b.x;}\nfunction eliminateHole(hole,outerNode){outerNode=findHoleBridge(hole,outerNode);if(outerNode){var b=splitPolygon(outerNode,hole);filterPoints(b,b.next);}}\nfunction findHoleBridge(hole,outerNode){var p=outerNode,hx=hole.x,hy=hole.y,qx=-Infinity,m;do{if(hy<=p.y&&hy>=p.next.y){var x=p.x+(hy-p.y)*(p.next.x-p.x)/(p.next.y-p.y);if(x<=hx&&x>qx){qx=x;m=p.x<p.next.x?p:p.next;}}\np=p.next;}while(p!==outerNode);if(!m)return null;var stop=m,tanMin=Infinity,tan;p=m.next;while(p!==stop){if(hx>=p.x&&p.x>=m.x&&pointInTriangle(hy<m.y?hx:qx,hy,m.x,m.y,hy<m.y?qx:hx,hy,p.x,p.y)){tan=Math.abs(hy-p.y)/(hx-p.x);if((tan<tanMin||(tan===tanMin&&p.x>m.x))&&locallyInside(p,hole)){m=p;tanMin=tan;}}\np=p.next;}\nreturn m;}\nfunction indexCurve(start,minX,minY,size){var p=start;do{if(p.z===null)p.z=zOrder(p.x,p.y,minX,minY,size);p.prevZ=p.prev;p.nextZ=p.next;p=p.next;}while(p!==start);p.prevZ.nextZ=null;p.prevZ=null;sortLinked(p);}\nfunction sortLinked(list){var i,p,q,e,tail,numMerges,pSize,qSize,inSize=1;do{p=list;list=null;tail=null;numMerges=0;while(p){numMerges++;q=p;pSize=0;for(i=0;i<inSize;i++){pSize++;q=q.nextZ;if(!q)break;}\nqSize=inSize;while(pSize>0||(qSize>0&&q)){if(pSize===0){e=q;q=q.nextZ;qSize--;}else if(qSize===0||!q){e=p;p=p.nextZ;pSize--;}else if(p.z<=q.z){e=p;p=p.nextZ;pSize--;}else{e=q;q=q.nextZ;qSize--;}\nif(tail)tail.nextZ=e;else list=e;e.prevZ=tail;tail=e;}\np=q;}\ntail.nextZ=null;inSize*=2;}while(numMerges>1);return list;}\nfunction zOrder(x,y,minX,minY,size){x=32767*(x-minX)/size;y=32767*(y-minY)/size;x=(x|(x<<8))&0x00FF00FF;x=(x|(x<<4))&0x0F0F0F0F;x=(x|(x<<2))&0x33333333;x=(x|(x<<1))&0x55555555;y=(y|(y<<8))&0x00FF00FF;y=(y|(y<<4))&0x0F0F0F0F;y=(y|(y<<2))&0x33333333;y=(y|(y<<1))&0x55555555;return x|(y<<1);}\nfunction getLeftmost(start){var p=start,leftmost=start;do{if(p.x<leftmost.x)leftmost=p;p=p.next;}while(p!==start);return leftmost;}\nfunction pointInTriangle(ax,ay,bx,by,cx,cy,px,py){return(cx-px)*(ay-py)-(ax-px)*(cy-py)>=0&&(ax-px)*(by-py)-(bx-px)*(ay-py)>=0&&(bx-px)*(cy-py)-(cx-px)*(by-py)>=0;}\nfunction isValidDiagonal(a,b){return equals(a,b)||a.next.i!==b.i&&a.prev.i!==b.i&&!intersectsPolygon(a,b)&&locallyInside(a,b)&&locallyInside(b,a)&&middleInside(a,b);}\nfunction area(p,q,r){return(q.y-p.y)*(r.x-q.x)-(q.x-p.x)*(r.y-q.y);}\nfunction equals(p1,p2){return p1.x===p2.x&&p1.y===p2.y;}\nfunction intersects(p1,q1,p2,q2){return area(p1,q1,p2)>0!==area(p1,q1,q2)>0&&area(p2,q2,p1)>0!==area(p2,q2,q1)>0;}\nfunction intersectsPolygon(a,b){var p=a;do{if(p.i!==a.i&&p.next.i!==a.i&&p.i!==b.i&&p.next.i!==b.i&&intersects(p,p.next,a,b))return true;p=p.next;}while(p!==a);return false;}\nfunction locallyInside(a,b){return area(a.prev,a,a.next)<0?area(a,b,a.next)>=0&&area(a,a.prev,b)>=0:area(a,b,a.prev)<0||area(a,a.next,b)<0;}\nfunction middleInside(a,b){var p=a,inside=false,px=(a.x+b.x)/2,py=(a.y+b.y)/2;do{if(((p.y>py)!==(p.next.y>py))&&(px<(p.next.x-p.x)*(py-p.y)/(p.next.y-p.y)+p.x))\ninside=!inside;p=p.next;}while(p!==a);return inside;}\nfunction splitPolygon(a,b){var a2=new Node(a.i,a.x,a.y),b2=new Node(b.i,b.x,b.y),an=a.next,bp=b.prev;a.next=b;b.prev=a;a2.next=an;an.prev=a2;b2.next=a2;a2.prev=b2;bp.next=b2;b2.prev=bp;return b2;}\nfunction insertNode(i,x,y,last){var p=new Node(i,x,y);if(!last){p.prev=p;p.next=p;}else{p.next=last.next;p.prev=last;last.next.prev=p;last.next=p;}\nreturn p;}\nfunction removeNode(p){p.next.prev=p.prev;p.prev.next=p.next;if(p.prevZ)p.prevZ.nextZ=p.nextZ;if(p.nextZ)p.nextZ.prevZ=p.prevZ;}\nfunction Node(i,x,y){this.i=i;this.x=x;this.y=y;this.prev=null;this.next=null;this.z=null;this.prevZ=null;this.nextZ=null;this.steiner=false;}}}\nx3dom.FieldInterpolator=function(beginTime,endTime,beginValue,endValue)\n{this.beginTime=beginTime||0;this.endTime=endTime||1;this.beginValue=beginValue||0;this.endValue=endValue||0;this.isInterpolating=false;};x3dom.FieldInterpolator.prototype.isActive=function()\n{return(this.beginTime>0);};x3dom.FieldInterpolator.prototype.calcFraction=function(time)\n{var fraction=(time-this.beginTime)/(this.endTime-this.beginTime);return(Math.sin((fraction*Math.PI)-(Math.PI/2))+1)/2.0;};x3dom.FieldInterpolator.prototype.reset=function()\n{this.isInterpolating=false;this.beginTime=0;this.endTime=1;this.beginValue=0;this.endValue=0;};x3dom.FieldInterpolator.prototype.interpolate=function(time)\n{if(time<this.beginTime)\n{return this.beginValue;}\nelse if(time>=this.endTime)\n{var endValue=this.endValue;this.reset();return endValue;}\nelse\n{this.isInterpolating=true;return this.beginValue+(this.endValue-this.beginValue)*this.calcFraction(time);}};x3dom.Utils={};x3dom.Utils.maxIndexableCoords=65535;x3dom.Utils.needLineWidth=false;x3dom.Utils.measurements=[];window.performance=window.performance||{};performance.now=(function(){return performance.now||performance.mozNow||performance.msNow||performance.oNow||performance.webkitNow||function(){return new Date().getTime();};})();x3dom.Utils.startMeasure=function(name){var uname=name.toUpperCase();if(!x3dom.Utils.measurements[uname]){if(performance&&performance.now){x3dom.Utils.measurements[uname]=performance.now();}else{x3dom.Utils.measurements[uname]=new Date().getTime();}}};x3dom.Utils.stopMeasure=function(name){var uname=name.toUpperCase();if(x3dom.Utils.measurements[uname]){var startTime=x3dom.Utils.measurements[uname];delete x3dom.Utils.measurements[uname];if(performance&&performance.now){return performance.now()-startTime;}else{return new Date().getTime()-startTime;}}\nreturn 0;};x3dom.Utils.isNumber=function(n){return!isNaN(parseFloat(n))&&isFinite(n);};x3dom.Utils.createTexture2D=function(gl,doc,src,bgnd,crossOrigin,scale,genMipMaps,flipY)\n{flipY=flipY||false;var texture=gl.createTexture();var data=new Uint8Array([0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255]);gl.bindTexture(gl.TEXTURE_2D,texture);gl.texImage2D(gl.TEXTURE_2D,0,gl.RGBA,2,2,0,gl.RGBA,gl.UNSIGNED_BYTE,data);if(genMipMaps){gl.generateMipmap(gl.TEXTURE_2D);}\ngl.bindTexture(gl.TEXTURE_2D,null);texture.ready=false;if(src==null||src=='')\nreturn texture;var image=new Image();switch(crossOrigin.toLowerCase()){case'anonymous':{image.crossOrigin='anonymous';}break;case'use-credentials':{image.crossOrigin='use-credentials';}break;case'none':{}break;default:{if(x3dom.Utils.forbiddenBySOP(src)){image.crossOrigin='anonymous';}}}\nimage.src=src;doc.incrementDownloads();image.onload=function(){texture.originalWidth=image.width;texture.originalHeight=image.height;if(scale)\nimage=x3dom.Utils.scaleImage(image);if(bgnd==true||flipY==true){gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL,true);}\ngl.bindTexture(gl.TEXTURE_2D,texture);gl.texImage2D(gl.TEXTURE_2D,0,gl.RGBA,gl.RGBA,gl.UNSIGNED_BYTE,image);if(genMipMaps){gl.generateMipmap(gl.TEXTURE_2D);}\ngl.bindTexture(gl.TEXTURE_2D,null);if(bgnd==true||flipY==true){gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL,false);}\ntexture.width=image.width;texture.height=image.height;texture.ready=true;doc.decrementDownloads();doc.needRender=true;};image.onerror=function(error)\n{x3dom.Utils.tryDDSLoading(texture,gl,doc,src,genMipMaps,flipY).then(function(){doc.decrementDownloads();doc.needRender=true;},function(){x3dom.debug.logError(\"[Utils|createTexture2D] Can't load Image: \"+src);doc.decrementDownloads();});};return texture;};x3dom.Utils.tryDDSLoading=function(texture,gl,doc,src,genMipMaps,flipY)\n{return x3dom.DDSLoader.load(src).then(function(dds){if(!dds||(dds.isCompressed&&!x3dom.caps.COMPRESSED_TEXTURE))\n{return;}\ngl.bindTexture(dds.type,texture);flipY=false;if(flipY)\n{gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL,true);}\nif(!x3dom.Utils.isPowerOfTwo(dds.width)&&!x3dom.Utils.isPowerOfTwo(dds.height))\n{gl.texParameteri(dds.type,gl.TEXTURE_MAG_FILTER,gl.LINEAR);gl.texParameteri(dds.type,gl.TEXTURE_MIN_FILTER,gl.LINEAR);gl.texParameteri(dds.type,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE);gl.texParameteri(dds.type,gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE);dds.generateMipmaps=false;}\nelse if(dds.generateMipmaps)\n{gl.texParameteri(dds.type,gl.TEXTURE_MIN_FILTER,gl.LINEAR_MIPMAP_LINEAR);}\nfor(var target in dds.data)\n{var width=dds.width;var height=dds.height;var levels=dds.data[target];for(var l=0;l<levels.length;l++)\n{if(l!=0)\n{width=Math.max(width*0.5,1);height=Math.max(height*0.5,1);}\nif(dds.format.internal<33776||dds.format.internal>33779)\n{gl.texImage2D(+target,l,dds.format.internal,width,height,0,dds.format.format,dds.format.type,levels[l]);}\nelse\n{gl.compressedTexImage2D(+target,l,dds.format.internal,width,height,0,levels[l]);dds.generateMipmaps=false;}}}\nif(dds.generateMipmaps)\n{gl.generateMipmap(dds.type);}\nif(flipY)\n{gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL,false);}\ngl.bindTexture(dds.type,null);texture.width=dds.width;texture.height=dds.height;texture.ready=true;texture.textureCubeReady=true;});};x3dom.Utils.createTextureCube=function(gl,doc,src,bgnd,crossOrigin,scale,genMipMaps,flipY)\n{var data=new Uint8Array([0,0,0,255,0,0,0,255,0,0,0,255,0,0,0,255]);var texture=gl.createTexture();var faces;if(bgnd){faces=[gl.TEXTURE_CUBE_MAP_POSITIVE_Z,gl.TEXTURE_CUBE_MAP_NEGATIVE_Z,gl.TEXTURE_CUBE_MAP_POSITIVE_Y,gl.TEXTURE_CUBE_MAP_NEGATIVE_Y,gl.TEXTURE_CUBE_MAP_POSITIVE_X,gl.TEXTURE_CUBE_MAP_NEGATIVE_X];}\nelse\n{faces=[gl.TEXTURE_CUBE_MAP_NEGATIVE_Z,gl.TEXTURE_CUBE_MAP_POSITIVE_Z,gl.TEXTURE_CUBE_MAP_NEGATIVE_Y,gl.TEXTURE_CUBE_MAP_POSITIVE_Y,gl.TEXTURE_CUBE_MAP_NEGATIVE_X,gl.TEXTURE_CUBE_MAP_POSITIVE_X];}\ntexture.ready=false;texture.pendingTextureLoads=-1;texture.textureCubeReady=false;var width=0,height=0;for(var i=0;i<faces.length;i++)\n{gl.bindTexture(gl.TEXTURE_CUBE_MAP,texture);gl.texImage2D(faces[i],0,gl.RGBA,2,2,0,gl.RGBA,gl.UNSIGNED_BYTE,data);gl.bindTexture(gl.TEXTURE_CUBE_MAP,null);}\nif(src.length==1)\n{doc.incrementDownloads();x3dom.Utils.tryDDSLoading(texture,gl,doc,src[0],genMipMaps,flipY).then(function(){doc.decrementDownloads();doc.needRender=true;},function(){x3dom.debug.logError(\"[Utils|createTexture2D] Can't load Image: \"+src);doc.decrementDownloads();});}\nelse if(src.length==6)\n{for(var i=0;i<faces.length;i++)\n{var face=faces[i];var image=new Image();switch(crossOrigin.toLowerCase()){case'anonymous':{image.crossOrigin='anonymous';}break;case'use-credentials':{image.crossOrigin='use-credentials';}break;case'none':{}break;default:{if(x3dom.Utils.forbiddenBySOP(src[i])){image.crossOrigin='anonymous';}}}\ntexture.pendingTextureLoads++;doc.incrementDownloads();image.onload=(function(texture,face,image,swap){return function(){if(width==0&&height==0){width=image.width;height=image.height;}\nelse if(scale&&(width!=image.width||height!=image.height)){x3dom.debug.logWarning(\"[Utils|createTextureCube] Rescaling CubeMap images, which are of different size!\");image=x3dom.Utils.rescaleImage(image,width,height);}\ngl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL,swap);gl.bindTexture(gl.TEXTURE_CUBE_MAP,texture);gl.texImage2D(face,0,gl.RGBA,gl.RGBA,gl.UNSIGNED_BYTE,image);gl.bindTexture(gl.TEXTURE_CUBE_MAP,null);gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL,false);texture.pendingTextureLoads--;doc.decrementDownloads();if(texture.pendingTextureLoads<0){texture.width=width;texture.height=height;texture.textureCubeReady=true;if(genMipMaps){gl.bindTexture(gl.TEXTURE_CUBE_MAP,texture);gl.generateMipmap(gl.TEXTURE_CUBE_MAP);gl.bindTexture(gl.TEXTURE_CUBE_MAP,null);}\nx3dom.debug.logInfo(\"[Utils|createTextureCube] Loading CubeMap finished...\");doc.needRender=true;}};})(texture,face,image,bgnd);image.onerror=function()\n{doc.decrementDownloads();x3dom.debug.logError(\"[Utils|createTextureCube] Can't load CubeMap!\");};image.src=src[i];}}\nreturn texture;};x3dom.Utils.initFBO=function(gl,w,h,type,mipMap,needDepthBuf,numMrt){var tex=gl.createTexture();tex.width=w;tex.height=h;gl.bindTexture(gl.TEXTURE_2D,tex);gl.texImage2D(gl.TEXTURE_2D,0,gl.RGBA,w,h,0,gl.RGBA,type,null);if(mipMap)\ngl.generateMipmap(gl.TEXTURE_2D);gl.bindTexture(gl.TEXTURE_2D,null);var i,mrts=null;if(x3dom.caps.DRAW_BUFFERS&&numMrt!==undefined){mrts=[tex];for(i=1;i<numMrt;i++){mrts[i]=gl.createTexture();mrts[i].width=w;mrts[i].height=h;gl.bindTexture(gl.TEXTURE_2D,mrts[i]);gl.texImage2D(gl.TEXTURE_2D,0,gl.RGBA,w,h,0,gl.RGBA,type,null);if(mipMap)\ngl.generateMipmap(gl.TEXTURE_2D);gl.bindTexture(gl.TEXTURE_2D,null);}}\nvar fbo=gl.createFramebuffer();var dtex=null;var rb=null;if(needDepthBuf){if(x3dom.caps.DEPTH_TEXTURE!==null){dtex=gl.createTexture();gl.bindTexture(gl.TEXTURE_2D,dtex);gl.texImage2D(gl.TEXTURE_2D,0,gl.DEPTH_COMPONENT,w,h,0,gl.DEPTH_COMPONENT,gl.UNSIGNED_SHORT,null);if(mipMap)\ngl.generateMipmap(gl.TEXTURE_2D);gl.bindTexture(gl.TEXTURE_2D,null);dtex.width=w;dtex.height=h;}\nelse{rb=gl.createRenderbuffer();gl.bindRenderbuffer(gl.RENDERBUFFER,rb);gl.renderbufferStorage(gl.RENDERBUFFER,gl.DEPTH_COMPONENT16,w,h);gl.bindRenderbuffer(gl.RENDERBUFFER,null);}}\ngl.bindFramebuffer(gl.FRAMEBUFFER,fbo);gl.framebufferTexture2D(gl.FRAMEBUFFER,gl.COLOR_ATTACHMENT0,gl.TEXTURE_2D,tex,0);if(x3dom.caps.DRAW_BUFFERS&&numMrt!==undefined){for(i=1;i<numMrt;i++){gl.framebufferTexture2D(gl.FRAMEBUFFER,gl.COLOR_ATTACHMENT0+i,gl.TEXTURE_2D,mrts[i],0);}}\nif(needDepthBuf&&x3dom.caps.DEPTH_TEXTURE!==null){gl.framebufferTexture2D(gl.FRAMEBUFFER,gl.DEPTH_ATTACHMENT,gl.TEXTURE_2D,dtex,0);}\nelse{gl.framebufferRenderbuffer(gl.FRAMEBUFFER,gl.DEPTH_ATTACHMENT,gl.RENDERBUFFER,rb);}\nvar status=gl.checkFramebufferStatus(gl.FRAMEBUFFER);if(status!=gl.FRAMEBUFFER_COMPLETE){x3dom.debug.logWarning(\"[Utils|InitFBO] FBO-Status: \"+status);}\ngl.bindFramebuffer(gl.FRAMEBUFFER,null);return{fbo:fbo,dtex:dtex,rbo:rb,tex:tex,texTargets:mrts,width:w,height:h,type:type,mipMap:mipMap};};x3dom.Utils.getFileName=function(url)\n{var filename;if(url.lastIndexOf(\"/\")>-1){filename=url.substr(url.lastIndexOf(\"/\")+1);}\nelse if(url.lastIndexOf(\"\\\\\")>-1){filename=url.substr(url.lastIndexOf(\"\\\\\")+1);}\nelse{filename=url;}\nreturn filename;};x3dom.Utils.isWebGL2Enabled=function()\n{var canvas=document.createElement(\"canvas\");var webgl2=canvas.getContext(\"webgl2\")||canvas.getContext(\"experimental-webgl2\");return(webgl2)?true:false;};x3dom.Utils.findTextureByName=function(texture,name)\n{for(var i=0;i<texture.length;++i)\n{if(name==texture[i].samplerName)\nreturn texture[i];}\nreturn false;};x3dom.Utils.rescaleImage=function(image,width,height)\n{var canvas=document.createElement(\"canvas\");canvas.width=width;canvas.height=height;canvas.getContext(\"2d\").drawImage(image,0,0,image.width,image.height,0,0,canvas.width,canvas.height);return canvas;};x3dom.Utils.scaleImage=function(image)\n{if(!x3dom.Utils.isPowerOfTwo(image.width)||!x3dom.Utils.isPowerOfTwo(image.height)){var canvas=document.createElement(\"canvas\");canvas.width=x3dom.Utils.nextHighestPowerOfTwo(image.width);canvas.height=x3dom.Utils.nextHighestPowerOfTwo(image.height);var ctx=canvas.getContext(\"2d\");ctx.drawImage(image,0,0,image.width,image.height,0,0,canvas.width,canvas.height);image=canvas;}\nreturn image;};x3dom.Utils.isPowerOfTwo=function(x)\n{return((x&(x-1))===0);};x3dom.Utils.nextHighestPowerOfTwo=function(x)\n{--x;for(var i=1;i<32;i<<=1){x=x|x>>i;}\nreturn(x+1);};x3dom.Utils.nextBestPowerOfTwo=function(x)\n{var log2x=Math.log(x)/0.693147180559945;return Math.pow(2,Math.round(log2x));};x3dom.Utils.getDataTypeSize=function(type)\n{switch(type)\n{case\"Int8\":case\"Uint8\":return 1;case\"Int16\":case\"Uint16\":return 2;case\"Int32\":case\"Uint32\":case\"Float32\":return 4;case\"Float64\":default:return 8;}};x3dom.Utils.getOffsetMultiplier=function(indexType,gl)\n{switch(indexType)\n{case gl.UNSIGNED_SHORT:return 1;case gl.UNSIGNED_INT:return 2;case gl.UNSIGNED_BYTE:return 0.5;default:return 1;}};x3dom.Utils.getByteAwareOffset=function(offset,indexType,gl)\n{switch(indexType)\n{case gl.UNSIGNED_SHORT:return 2*offset;case gl.UNSIGNED_INT:return 4*offset;case gl.UNSIGNED_BYTE:return offset;default:return 2*offset;}};x3dom.Utils.getVertexAttribType=function(type,gl)\n{var dataType=gl.NONE;switch(type)\n{case\"Int8\":dataType=gl.BYTE;break;case\"Uint8\":dataType=gl.UNSIGNED_BYTE;break;case\"Int16\":dataType=gl.SHORT;break;case\"Uint16\":dataType=gl.UNSIGNED_SHORT;break;case\"Int32\":dataType=gl.INT;break;case\"Uint32\":dataType=gl.UNSIGNED_INT;break;case\"Float32\":dataType=gl.FLOAT;break;case\"Float64\":default:x3dom.debug.logError(\"Can't find this.gl data type for \"+type+\", getting FLOAT...\");dataType=gl.FLOAT;break;}\nreturn dataType;};x3dom.Utils.getArrayBufferView=function(type,buffer)\n{var array=null;switch(type)\n{case\"Int8\":array=new Int8Array(buffer);break;case\"Uint8\":array=new Uint8Array(buffer);break;case\"Int16\":array=new Int16Array(buffer);break;case\"Uint16\":array=new Uint16Array(buffer);break;case\"Int32\":array=new Int32Array(buffer);break;case\"Uint32\":array=new Uint32Array(buffer);break;case\"Float32\":array=new Float32Array(buffer);break;case\"Float64\":array=new Float64Array(buffer);break;default:x3dom.debug.logError(\"Can't create typed array view of type \"+type+\", trying Float32...\");array=new Float32Array(buffer);break;}\nreturn array;};x3dom.Utils.isUnsignedType=function(str)\n{return(str==\"Uint8\"||str==\"Uint16\"||str==\"Uint16\"||str==\"Uint32\");};x3dom.Utils.checkDirtyLighting=function(viewarea)\n{return(viewarea.getLights().length+viewarea._scene.getNavigationInfo()._vf.headlight);};x3dom.Utils.checkDirtyPhysicalEnvironmentLight=function(viewarea,shaderProperties)\n{return(!!shaderProperties.PHYSICALENVLIGHT!=viewarea.hasPhysicalEnvironmentLight());};x3dom.Utils.checkDirtyEnvironment=function(viewarea,shaderProperties)\n{var environment=viewarea._scene.getEnvironment();return(shaderProperties.GAMMACORRECTION!=environment._vf.gammaCorrectionDefault);};x3dom.Utils.minFilterDic=function(gl,minFilter)\n{switch(minFilter.toUpperCase())\n{case\"NEAREST\":return gl.NEAREST;case\"LINEAR\":return gl.LINEAR;case\"NEAREST_MIPMAP_NEAREST\":return gl.NEAREST_MIPMAP_NEAREST;case\"NEAREST_MIPMAP_LINEAR\":return gl.NEAREST_MIPMAP_LINEAR;case\"LINEAR_MIPMAP_NEAREST\":return gl.LINEAR_MIPMAP_NEAREST;case\"LINEAR_MIPMAP_LINEAR\":return gl.LINEAR_MIPMAP_LINEAR;case\"AVG_PIXEL\":return gl.LINEAR;case\"AVG_PIXEL_AVG_MIPMAP\":return gl.LINEAR_MIPMAP_LINEAR;case\"AVG_PIXEL_NEAREST_MIPMAP\":return gl.LINEAR_MIPMAP_NEAREST;case\"DEFAULT\":return gl.LINEAR_MIPMAP_LINEAR;case\"FASTEST\":return gl.NEAREST;case\"NEAREST_PIXEL\":return gl.NEAREST;case\"NEAREST_PIXEL_AVG_MIPMAP\":return gl.NEAREST_MIPMAP_LINEAR;case\"NEAREST_PIXEL_NEAREST_MIPMAP\":return gl.NEAREST_MIPMAP_NEAREST;case\"NICEST\":return gl.LINEAR_MIPMAP_LINEAR;default:return gl.LINEAR;}};x3dom.Utils.minFilterDicX3D=function(minFilter)\n{switch(minFilter)\n{case 9728:return\"NEAREST\";case 9729:return\"LINEAR\";case 9984:return\"NEAREST_MIPMAP_NEAREST\";case 9985:return\"LINEAR_MIPMAP_NEAREST\";case 9986:return\"NEAREST_MIPMAP_LINEAR\";case 9987:return\"LINEAR_MIPMAP_LINEAR\";default:return\"LINEAR_MIPMAP_LINEAR\";}};x3dom.Utils.magFilterDic=function(gl,magFilter)\n{switch(magFilter.toUpperCase())\n{case\"NEAREST\":return gl.NEAREST;case\"LINEAR\":return gl.LINEAR;case\"AVG_PIXEL\":return gl.LINEAR;case\"DEFAULT\":return gl.LINEAR;case\"FASTEST\":return gl.NEAREST;case\"NEAREST_PIXEL\":return gl.NEAREST;case\"NICEST\":return gl.LINEAR;default:return gl.LINEAR;}};x3dom.Utils.magFilterDicX3D=function(magFilter)\n{switch(magFilter)\n{case 9728:return\"NEAREST\";case 9729:return\"LINEAR\";default:return\"LINEAR\";}};x3dom.Utils.boundaryModesDicX3D=function(mode)\n{switch(mode)\n{case 10497:return\"REPEAT\";case 33071:return\"CLAMP_TO_EDGE\";case 33648:return\"MIRRORED_REPEAT\";default:return\"REPEAT\";}};x3dom.Utils.boundaryModesDic=function(gl,mode)\n{switch(mode.toUpperCase())\n{case\"CLAMP\":return gl.CLAMP_TO_EDGE;case\"CLAMP_TO_EDGE\":return gl.CLAMP_TO_EDGE;case\"CLAMP_TO_BOUNDARY\":return gl.CLAMP_TO_EDGE;case\"MIRRORED_REPEAT\":return gl.MIRRORED_REPEAT;case\"REPEAT\":return gl.REPEAT;default:return gl.REPEAT;}};x3dom.Utils.primTypeDic=function(gl,type)\n{switch(type.toUpperCase())\n{case\"POINTS\":return gl.POINTS;case\"LINES\":return gl.LINES;case\"LINELOOP\":return gl.LINE_LOOP;case\"LINESTRIP\":return gl.LINE_STRIP;case\"TRIANGLES\":return gl.TRIANGLES;case\"TRIANGLESTRIP\":return gl.TRIANGLE_STRIP;case\"TRIANGLEFAN\":return gl.TRIANGLE_FAN;default:return gl.TRIANGLES;}};x3dom.Utils.depthFunc=function(gl,func)\n{switch(func.toUpperCase())\n{case\"NEVER\":return gl.NEVER;case\"ALWAYS\":return gl.ALWAYS;case\"LESS\":return gl.LESS;case\"EQUAL\":return gl.EQUAL;case\"LEQUAL\":return gl.LEQUAL;case\"GREATER\":return gl.GREATER;case\"GEQUAL\":return gl.GEQUAL;case\"NOTEQUAL\":return gl.NOTEQUAL;default:return gl.LEQUAL;}};x3dom.Utils.blendFunc=function(gl,func)\n{switch(func.toLowerCase())\n{case\"zero\":return gl.ZERO;case\"one\":return gl.ONE;case\"dst_color\":return gl.DST_COLOR;case\"dst_alpha\":return gl.DST_ALPHA;case\"src_color\":return gl.SRC_COLOR;case\"src_alpha\":return gl.SRC_ALPHA;case\"one_minus_dst_color\":return gl.ONE_MINUS_DST_COLOR;case\"one_minus_dst_alpha\":return gl.ONE_MINUS_DST_ALPHA;case\"one_minus_src_color\":return gl.ONE_MINUS_SRC_COLOR;case\"one_minus_src_alpha\":return gl.ONE_MINUS_SRC_ALPHA;case\"src_alpha_saturate\":return gl.SRC_ALPHA_SATURATE;case\"constant_color\":return gl.CONSTANT_COLOR;case\"constant_alpha\":return gl.CONSTANT_ALPHA;case\"one_minus_constant_color\":return gl.ONE_MINUS_CONSTANT_COLOR;case\"one_minus_constant_alpha\":return gl.ONE_MINUS_CONSTANT_ALPHA;default:return 0;}};x3dom.Utils.blendEquation=function(gl,func)\n{switch(func.toLowerCase())\n{case\"func_add\":return gl.FUNC_ADD;case\"func_subtract\":return gl.FUNC_SUBTRACT;case\"func_reverse_subtract\":return gl.FUNC_REVERSE_SUBTRACT;case\"min\":return 0;case\"max\":return 0;case\"logic_op\":return 0;default:return 0;}};x3dom.Utils.gunzip=function(arraybuffer)\n{var byteArray=new Uint8Array(arraybuffer);try{arraybuffer=new Zlib.Gunzip(byteArray).decompress().buffer;}catch(e){}\nreturn arraybuffer;};x3dom.Utils.generateProperties=function(viewarea,shape)\n{var property={};var geometry=shape._cf.geometry.node;var appearance=shape._cf.appearance.node;var texture=appearance?appearance._cf.texture.node:null;var material=appearance?appearance._cf.material.node:null;var environment=viewarea._scene.getEnvironment();if(appearance&&appearance._shader&&x3dom.isa(appearance._shader,x3dom.nodeTypes.ComposedShader)){property.CSHADER=appearance._shader._id;}\nelse if(geometry){property.CSHADER=-1;property.APPMAT=(appearance&&(material||property.CSSHADER))?1:0;property.SOLID=(shape.isSolid())?1:0;property.TEXT=(x3dom.isa(geometry,x3dom.nodeTypes.Text))?1:0;property.POPGEOMETRY=(x3dom.isa(geometry,x3dom.nodeTypes.PopGeometry))?1:0;property.BUFFERGEOMETRY=(x3dom.isa(geometry,x3dom.nodeTypes.BufferGeometry))?1:0;property.IMAGEGEOMETRY=(x3dom.isa(geometry,x3dom.nodeTypes.ImageGeometry))?1:0;property.BINARYGEOMETRY=(x3dom.isa(geometry,x3dom.nodeTypes.BinaryGeometry))?1:0;property.EXTERNALGEOMETRY=(x3dom.isa(geometry,x3dom.nodeTypes.ExternalGeometry))?1:0;property.IG_PRECISION=(property.IMAGEGEOMETRY)?geometry.numCoordinateTextures():0;property.IG_INDEXED=(property.IMAGEGEOMETRY&&geometry.getIndexTexture()!=null)?1:0;property.POINTLINE2D=!geometry.needLighting()?1:0;property.VERTEXID=((property.BINARYGEOMETRY||property.EXTERNALGEOMETRY)&&geometry._vf.idsPerVertex)?1:0;property.IS_PARTICLE=(x3dom.isa(geometry,x3dom.nodeTypes.ParticleSet))?1:0;property.TANGENTDATA=(geometry._mesh._tangents[0].length>0&&geometry._mesh._binormals[0].length>0)?1:0;property.PBR_MATERIAL=(property.APPMAT&&x3dom.isa(material,x3dom.nodeTypes.PhysicalMaterial))?1:0;property.TWOSIDEDMAT=(property.APPMAT&&x3dom.isa(material,x3dom.nodeTypes.TwoSidedMaterial))?1:0;property.SEPARATEBACKMAT=(property.TWOSIDEDMAT&&material._vf.separateBackColor)?1:0;property.SHADOW=(viewarea.getLightsShadow())?1:0;property.FOG=(viewarea._scene.getFog()._vf.visibilityRange>0)?1:0;property.CSSHADER=(appearance&&appearance._shader&&x3dom.isa(appearance._shader,x3dom.nodeTypes.CommonSurfaceShader))?1:0;property.LIGHTS=(!property.POINTLINE2D&&appearance&&shape.isLit()&&(material||property.CSSHADER))?viewarea.getLights().length+(viewarea._scene.getNavigationInfo()._vf.headlight):0;property.TEXTURED=(texture||property.TEXT||(property.CSSHADER&&appearance._shader.needTexcoords())||(property.PBR_MATERIAL&&material.hasTextures()))?1:0;property.CUBEMAP=(texture&&x3dom.isa(texture,x3dom.nodeTypes.X3DEnvironmentTextureNode))||(property.CSSHADER&&appearance._shader.getEnvironmentMap())?1:0;property.PIXELTEX=(texture&&x3dom.isa(texture,x3dom.nodeTypes.PixelTexture))?1:0;property.TEXTRAFO=(appearance&&appearance._cf.textureTransform.node)?1:0;property.DIFFUSEMAP=(texture&&!x3dom.isa(texture,x3dom.nodeTypes.X3DEnvironmentTextureNode))||(property.CSSHADER&&appearance._shader.getDiffuseMap())||(property.PBR_MATERIAL&&material._cf.baseColorTexture.node)?1:0;property.NORMALMAP=(property.CSSHADER&&appearance._shader.getNormalMap())||(property.PBR_MATERIAL&&material._cf.normalTexture.node)?1:0;property.SPECMAP=(property.CSSHADER&&appearance._shader.getSpecularMap())?1:0;property.SHINMAP=(property.CSSHADER&&appearance._shader.getShininessMap())?1:0;property.EMISSIVEMAP=(property.PBR_MATERIAL&&material._cf.emissiveTexture.node)?1:0;property.OCCLUSIONMAP=(property.PBR_MATERIAL&&material._cf.occlusionTexture.node)?1:0;property.DISPLACEMENTMAP=(property.CSSHADER&&appearance._shader.getDisplacementMap())?1:0;property.DIFFPLACEMENTMAP=(property.CSSHADER&&appearance._shader.getDiffuseDisplacementMap())?1:0;property.MULTIDIFFALPMAP=(property.VERTEXID&&property.CSSHADER&&appearance._shader.getMultiDiffuseAlphaMap())?1:0;property.MULTIEMIAMBMAP=(property.VERTEXID&&property.CSSHADER&&appearance._shader.getMultiEmissiveAmbientMap())?1:0;property.MULTISPECSHINMAP=(property.VERTEXID&&property.CSSHADER&&appearance._shader.getMultiSpecularShininessMap())?1:0;property.MULTIVISMAP=(property.VERTEXID&&property.CSSHADER&&appearance._shader.getMultiVisibilityMap())?1:0;property.ALPHAMODE=(property.PBR_MATERIAL)?material._vf.alphaMode:\"BLEND\";property.ISROUGHNESSMETALLIC=(property.PBR_MATERIAL&&material._vf.model==\"roughnessMetallic\")?1:0;property.ROUGHNESSMETALLICMAP=(property.PBR_MATERIAL&&material._cf.roughnessMetallicTexture.node)?1:0;property.SPECULARGLOSSINESSMAP=(property.PBR_MATERIAL&&material._cf.specularGlossinessTexture.node)?1:0;property.OCCLUSIONROUGHNESSMETALLICMAP=(property.PBR_MATERIAL&&material._cf.occlusionRoughnessMetallicTexture.node)?1:0;property.PHYSICALENVLIGHT=viewarea.hasPhysicalEnvironmentLight()?1:0;property.NORMALSPACE=(property.NORMALMAP&&property.CSSHADER)?appearance._shader._vf.normalSpace.toUpperCase():(property.NORMALMAP&&property.PBR_MATERIAL)?material._vf.normalSpace.toUpperCase():\"TANGENT\";property.BLENDING=(property.TEXT||property.CUBEMAP||property.CSSHADER||(property.PBR_MATERIAL)||(texture&&texture._blending))?1:0;property.REQUIREBBOX=(geometry._vf.coordType!==undefined&&geometry._vf.coordType!=\"Float32\")?1:0;property.REQUIREBBOXNOR=(geometry._vf.normalType!==undefined&&geometry._vf.normalType!=\"Float32\")?1:0;property.REQUIREBBOXCOL=(geometry._vf.colorType!==undefined&&geometry._vf.colorType!=\"Float32\")?1:0;property.REQUIREBBOXTEX=(geometry._vf.texCoordType!==undefined&&geometry._vf.texCoordType!=\"Float32\")?1:0;property.COLCOMPONENTS=geometry._mesh._numColComponents;property.NORCOMPONENTS=geometry._mesh._numNormComponents;property.POSCOMPONENTS=geometry._mesh._numPosComponents;property.SPHEREMAPPING=(geometry._cf.texCoord!==undefined&&geometry._cf.texCoord.node!==null&&geometry._cf.texCoord.node._vf.mode&&geometry._cf.texCoord.node._vf.mode.toLowerCase()==\"sphere\")?1:0;property.VERTEXCOLOR=(geometry._mesh._colors[0].length>0||(property.IMAGEGEOMETRY&&geometry.getColorTexture())||(property.POPGEOMETRY&&geometry.hasColor())||(property.BUFFERGEOMETRY&&geometry.hasColor())||(geometry._vf.color!==undefined&&geometry._vf.color.length>0))?1:0;property.CLIPPLANES=shape._clipPlanes.length;property.ALPHATHRESHOLD=(appearance)?appearance._vf.alphaClipThreshold.toFixed(2):0.1;property.MULTITEXCOORD=(property.BUFFERGEOMETRY&&geometry.hasMultiTexCoord())?1:0;property.DIFFUSEMAPCHANNEL=(property.PBR_MATERIAL&&property.DIFFUSEMAP&&material._cf.baseColorTexture.node._vf.channel===1)?1:0;property.NORMALMAPCHANNEL=(property.PBR_MATERIAL&&property.NORMALMAP&&material._cf.normalTexture.node._vf.channel===1)?1:0;property.EMISSIVEMAPCHANNEL=(property.PBR_MATERIAL&&property.EMISSIVEMAP&&material._cf.emissiveTexture.node._vf.channel===1)?1:0;property.OCCLUSIONMAPCHANNEL=(property.PBR_MATERIAL&&property.OCCLUSIONMAP&&material._cf.occlusionTexture.node._vf.channel===1)?1:0;property.ROUGHNESSMETALLICMAPCHANNEL=(property.PBR_MATERIAL&&property.ROUGHNESSMETALLICMAP&&material._cf.roughnessMetallicTexture.node._vf.channel===1)?1:0;property.OCCLUSIONROUGHNESSMETALLICMAPCHANNEL=(property.PBR_MATERIAL&&property.OCCLUSIONROUGHNESSMETALLICMAP&&material._cf.occlusionRoughnessMetallicTexture.node._vf.channel===1)?1:0;property.SPECULARGLOSSINESSMAPCHANNEL=(property.PBR_MATERIAL&&property.SPECULARGLOSSINESSMAP&&material._cf.specularGlossinessTexture.node._vf.channel===1)?1:0;property.ALPHAMASK=(property.PBR_MATERIAL&&material._vf.alphaMode==\"MASK\")?1:0;property.UNLIT=(property.PBR_MATERIAL&&material._vf.unlit)?1:0;property.GAMMACORRECTION=environment._vf.gammaCorrectionDefault;property.KHR_MATERIAL_COMMONS=0;}\nproperty.toIdentifier=function(){delete this.id;var id=\"\";for(var p in this){if(this[p]!=this.toIdentifier&&this[p]!=this.toString){id+=this[p];}}\nthis.id=id;return id;};property.toString=function(){var str=\"\";for(var p in this){if(this[p]!=this.toIdentifier&&this[p]!=this.toString){str+=p+\": \"+this[p]+\", \";}}\nreturn str;};property.toIdentifier();return property;};x3dom.Utils.lerp=function(value1,value2,amount)\n{amount=amount<0?0:amount;amount=amount>1?1:amount;return value1+(value2-value1)*amount;}\nx3dom.Utils.wrapProgram=function(gl,program,shaderID)\n{var shader={shaderID:shaderID,program:program};shader.bind=function(){gl.useProgram(program);};var loc=null;var obj=null;var i,glErr;var numUniforms=gl.getProgramParameter(program,gl.ACTIVE_UNIFORMS);for(i=0;i<numUniforms;++i){try{obj=gl.getActiveUniform(program,i);}\ncatch(eu){if(!obj)continue;}\nglErr=gl.getError();if(glErr){x3dom.debug.logError(\"GL-Error (on searching uniforms): \"+glErr);}\nloc=gl.getUniformLocation(program,obj.name);switch(obj.type){case gl.SAMPLER_2D:shader.__defineSetter__(obj.name,(function(loc){return function(val){gl.uniform1i(loc,val);};})(loc));break;case gl.SAMPLER_CUBE:shader.__defineSetter__(obj.name,(function(loc){return function(val){gl.uniform1i(loc,val);};})(loc));break;case gl.BOOL:shader.__defineSetter__(obj.name,(function(loc){return function(val){gl.uniform1i(loc,val);};})(loc));break;case gl.FLOAT:if(obj.name.indexOf(\"[0]\")!=-1)\nshader.__defineSetter__(obj.name.substring(0,obj.name.length-3),(function(loc){return function(val){gl.uniform1fv(loc,new Float32Array(val));};})(loc));else\nshader.__defineSetter__(obj.name,(function(loc){return function(val){gl.uniform1f(loc,val);};})(loc));break;case gl.FLOAT_VEC2:shader.__defineSetter__(obj.name,(function(loc){return function(val){gl.uniform2f(loc,val[0],val[1]);};})(loc));break;case gl.FLOAT_VEC3:if(obj.name.indexOf(\"[0]\")!=-1)\nshader.__defineSetter__(obj.name.substring(0,obj.name.length-3),(function(loc){return function(val){gl.uniform3fv(loc,new Float32Array(val));};})(loc));else\nshader.__defineSetter__(obj.name,(function(loc){return function(val){gl.uniform3f(loc,val[0],val[1],val[2]);};})(loc));break;case gl.FLOAT_VEC4:shader.__defineSetter__(obj.name,(function(loc){return function(val){gl.uniform4f(loc,val[0],val[1],val[2],val[3]);};})(loc));break;case gl.FLOAT_MAT2:shader.__defineSetter__(obj.name,(function(loc){return function(val){gl.uniformMatrix2fv(loc,false,new Float32Array(val));};})(loc));break;case gl.FLOAT_MAT3:shader.__defineSetter__(obj.name,(function(loc){return function(val){gl.uniformMatrix3fv(loc,false,new Float32Array(val));};})(loc));break;case gl.FLOAT_MAT4:shader.__defineSetter__(obj.name,(function(loc){return function(val){gl.uniformMatrix4fv(loc,false,new Float32Array(val));};})(loc));break;case gl.INT:shader.__defineSetter__(obj.name,(function(loc){return function(val){gl.uniform1i(loc,val);};})(loc));break;default:x3dom.debug.logWarning('GLSL program variable '+obj.name+' has unknown type '+obj.type);}}\nvar numAttribs=gl.getProgramParameter(program,gl.ACTIVE_ATTRIBUTES);for(i=0;i<numAttribs;++i){try{obj=gl.getActiveAttrib(program,i);}\ncatch(ea){if(!obj)continue;}\nglErr=gl.getError();if(glErr){x3dom.debug.logError(\"GL-Error (on searching attributes): \"+glErr);}\nloc=gl.getAttribLocation(program,obj.name);shader[obj.name]=loc;}\nreturn shader;};x3dom.Utils.arrayBufferToJSON=function(array,offset,length)\n{offset=(offset!=undefined)?offset:0;length=(length!=undefined)?length:array.length;var out,i,len,c;var char2,char3;out=\"\";len=length;i=offset;while(i<len)\n{c=array[i++];switch(c>>4)\n{case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:out+=String.fromCharCode(c);break;case 12:case 13:char2=array[i++];out+=String.fromCharCode(((c&0x1F)<<6)|(char2&0x3F));break;case 14:char2=array[i++];char3=array[i++];out+=String.fromCharCode(((c&0x0F)<<12)|((char2&0x3F)<<6)|((char3&0x3F)<<0));break;}}\nreturn JSON.parse(out);}\nx3dom.Utils.arrayBufferToObjectURL=function(buffer,mimetype)\n{return URL.createObjectURL(new Blob([new Uint8Array(buffer)],{type:mimetype}));}\nx3dom.Utils.dataURIToObjectURL=function(dataURI)\n{if(dataURI.indexOf(\"data:\")==-1)\n{return dataURI;}\nvar parts=dataURI.split(\",\");var mimetype=parts[0].split(':')[1].split(';')[0];var data=parts[1];var binaryString=window.atob(data);var byteLength=binaryString.length;var bytes=new Uint8Array(byteLength);for(var i=0;i<byteLength;i++)\n{bytes[i]=binaryString.charCodeAt(i);}\nreturn URL.createObjectURL(new Blob([bytes],{type:mimetype}));}\nx3dom.Utils.arrayBufferToDataURL=function(buffer,mimetype)\n{var binary='';var bytes=new Uint8Array(buffer);for(var i=0;i<bytes.byteLength;i++)\n{binary+=String.fromCharCode(bytes[i]);}\nreturn\"data:\"+mimetype+\";base64,\"+window.btoa(binary);}\nx3dom.Utils.forbiddenBySOP=function(uri_string){uri_string=uri_string.toLowerCase();var Scheme_AuthorityPQF=uri_string.split('//');var Scheme;var AuthorityPQF;var Authority;var UserInfo_HostPort;var HostPort;var Host_Port;var Port;var Host;var originPort=document.location.port===\"\"?\"80\":document.location.port;if(Scheme_AuthorityPQF.length===2){Scheme=Scheme_AuthorityPQF[0];AuthorityPQF=Scheme_AuthorityPQF[1];Authority=AuthorityPQF.split('/')[0].split('?')[0].split('#')[0];UserInfo_HostPort=Authority.split('@');if(UserInfo_HostPort.length===1){HostPort=UserInfo_HostPort[0];}else{HostPort=UserInfo_HostPort[1];}\nHost_Port=HostPort.split(':');Host=Host_Port[0];Port=Host_Port[1];}\nPort=Port||originPort;Host=Host||document.location.host;Scheme=Scheme||document.location.protocol;return!(Port===originPort&&Host===document.location.host&&Scheme===document.location.protocol);};x3dom.States=function(x3dElem){var that=this;this.active=false;this.viewer=document.createElement('div');this.viewer.id='x3dom-state-viewer';var title=document.createElement('div');title.className='x3dom-states-head';title.appendChild(document.createTextNode('x3dom'));var subTitle=document.createElement('span');subTitle.className='x3dom-states-head2';subTitle.appendChild(document.createTextNode('stats'));title.appendChild(subTitle);this.renderMode=document.createElement('div');this.renderMode.className='x3dom-states-rendermode-hardware';this.measureList=document.createElement('ul');this.measureList.className='x3dom-states-list';this.infoList=document.createElement('ul');this.infoList.className='x3dom-states-list';this.requestList=document.createElement('ul');this.requestList.className='x3dom-states-list';this.viewer.appendChild(this.renderMode);this.viewer.appendChild(this.measureList);this.viewer.appendChild(this.infoList);this.viewer.appendChild(this.requestList);this.disableContextMenu=function(e){e.preventDefault();e.stopPropagation();e.returnValue=false;return false;};this.thousandSeperator=function(value){return value.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g,\",\");};this.toFixed=function(value){var fixed=(value<1)?2:(value<10)?2:2;return value.toFixed(fixed);};this.addItem=function(list,key,value){var item=document.createElement('li');item.className='x3dom-states-item';var keyDiv=document.createElement('div');keyDiv.className='x3dom-states-item-title';keyDiv.appendChild(document.createTextNode(key));var valueDiv=document.createElement('div');valueDiv.className='x3dom-states-item-value';valueDiv.appendChild(document.createTextNode(value));item.appendChild(keyDiv);item.appendChild(valueDiv);list.appendChild(item);};this.update=function(){if(!x3dElem.runtime&&this.updateMethodID!==undefined){clearInterval(this.updateMethodID);return;}\nvar infos=x3dElem.runtime.states.infos;var measurements=x3dElem.runtime.states.measurements;var renderMode=x3dom.caps.RENDERMODE;if(renderMode==\"HARDWARE\"){this.renderMode.innerHTML=\"Hardware-Rendering\";this.renderMode.className='x3dom-states-rendermode-hardware';}else if(renderMode==\"SOFTWARE\"){this.renderMode.innerHTML=\"Software-Rendering\";this.renderMode.className='x3dom-states-rendermode-software';}\nthis.measureList.innerHTML=\"\";for(var m in measurements)\n{if(measurements.hasOwnProperty(m))\n{this.addItem(this.measureList,m,this.toFixed(measurements[m]));}}\nthis.infoList.innerHTML=\"\";for(var i in infos)\n{if(infos.hasOwnProperty(i))\n{this.addItem(this.infoList,i,this.thousandSeperator(infos[i]));}}\nthis.requestList.innerHTML=\"\";this.addItem(this.requestList,\"#ACTIVE\",x3dom.RequestManager.activeRequests.length);this.addItem(this.requestList,\"#TOTAL\",x3dom.RequestManager.totalRequests);this.addItem(this.requestList,\"#LOADED\",x3dom.RequestManager.loadedRequests);this.addItem(this.requestList,\"#FAILED\",x3dom.RequestManager.failedRequests);};this.updateMethodID=window.setInterval(function(){that.update();},1000);this.viewer.addEventListener(\"contextmenu\",that.disableContextMenu);};x3dom.States.prototype.display=function(value){this.active=(value!==undefined)?value:!this.active;this.viewer.style.display=(this.active)?\"block\":\"none\";};x3dom.StateManager=function(ctx3d)\n{this.gl=ctx3d;this.states=[];this.initStates();};x3dom.StateManager.prototype.initStates=function()\n{this.states['shaderID']=null;this.states['colorMask']={red:null,green:null,blue:null,alpha:null};this.states['depthMask']=null;this.states['stencilMask']=null;this.states['cullFace']=null;this.states['frontFace']=null;this.states['lineWidth']=null;this.states['blendColor']={red:null,green:null,blue:null,alpha:null};this.states['blendEquation']=null;this.states['blendEquationSeparate']={modeRGB:null,modeAlpha:null};this.states['blendFunc']={sfactor:null,dfactor:null};this.states['blendFuncSeparate']={srcRGB:null,dstRGB:null,srcAlpha:null,dstAlpha:null};this.states['depthFunc']=null;this.states['viewport']={x:null,y:null,width:null,height:null};this.states['depthRange']={zNear:null,zFar:null};};x3dom.StateManager.prototype.useProgram=function(shader)\n{if(this.states['shaderID']!=shader.shaderID)\n{this.gl.useProgram(shader.program);this.states['shaderID']=shader.shaderID;return true;}\nreturn false;};x3dom.StateManager.prototype.unsetProgram=function()\n{this.states['shaderID']=null;};x3dom.StateManager.prototype.enable=function(cap)\n{if(this.states[cap]!==true)\n{this.gl.enable(cap);this.states[cap]=true;}};x3dom.StateManager.prototype.disable=function(cap)\n{if(this.states[cap]!==false)\n{this.gl.disable(cap);this.states[cap]=false;}};x3dom.StateManager.prototype.colorMask=function(red,green,blue,alpha)\n{if(this.states['colorMask'].red!=red||this.states['colorMask'].green!=green||this.states['colorMask'].blue!=blue||this.states['colorMask'].alpha!=alpha)\n{this.gl.colorMask(red,green,blue,alpha);this.states['colorMask'].red=red;this.states['colorMask'].green=green;this.states['colorMask'].blue=blue;this.states['colorMask'].alpha=alpha;}};x3dom.StateManager.prototype.depthMask=function(flag)\n{if(this.states['depthMask']!=flag)\n{this.gl.depthMask(flag);this.states['depthMask']=flag;}};x3dom.StateManager.prototype.stencilMask=function(mask)\n{if(this.states['stencilMask']!=mask)\n{this.gl.stencilMask(mask);this.states['stencilMask']=mask;}};x3dom.StateManager.prototype.cullFace=function(mode)\n{if(this.states['cullFace']!=mode)\n{this.gl.cullFace(mode);this.states['cullFace']=mode;}};x3dom.StateManager.prototype.frontFace=function(mode)\n{if(this.states['frontFace']!=mode)\n{this.gl.frontFace(mode);this.states['frontFace']=mode;}};x3dom.StateManager.prototype.lineWidth=function(width)\n{width=(width<=1)?1:width;if(this.states['lineWidth']!=width)\n{this.gl.lineWidth(width);this.states['lineWidth']=width;}};x3dom.StateManager.prototype.blendColor=function(red,green,blue,alpha)\n{if(this.states['blendColor'].red!=red||this.states['blendColor'].green!=green||this.states['blendColor'].blue!=blue||this.states['blendColor'].alpha!=alpha)\n{this.gl.blendColor(red,green,blue,alpha);this.states['blendColor'].red=red;this.states['blendColor'].green=green;this.states['blendColor'].blue=blue;this.states['blendColor'].alpha=alpha;}};x3dom.StateManager.prototype.blendEquation=function(mode)\n{if(mode&&this.states['blendEquation']!=mode)\n{this.gl.blendEquation(mode);this.states['blendEquation']=mode;}};x3dom.StateManager.prototype.blendEquationSeparate=function(modeRGB,modeAlpha)\n{if(this.states['blendEquationSeparate'].modeRGB!=modeRGB||this.states['blendEquationSeparate'].modeAlpha!=modeAlpha)\n{this.gl.blendEquationSeparate(modeRGB,modeAlpha);this.states['blendEquationSeparate'].modeRGB=modeRGB;this.states['blendEquationSeparate'].modeAlpha=modeAlpha;}};x3dom.StateManager.prototype.blendFunc=function(sfactor,dfactor)\n{if(this.states['blendFunc'].sfactor!=sfactor||this.states['blendFunc'].dfactor!=dfactor)\n{this.gl.blendFunc(sfactor,dfactor);this.states['blendFunc'].sfactor=sfactor;this.states['blendFunc'].dfactor=dfactor;}};x3dom.StateManager.prototype.blendFuncSeparate=function(srcRGB,dstRGB,srcAlpha,dstAlpha)\n{if(this.states['blendFuncSeparate'].srcRGB!=srcRGB||this.states['blendFuncSeparate'].dstRGB!=dstRGB||this.states['blendFuncSeparate'].srcAlpha!=srcAlpha||this.states['blendFuncSeparate'].dstAlpha!=dstAlpha)\n{this.gl.blendFuncSeparate(srcRGB,dstRGB,srcAlpha,dstAlpha);this.states['blendFuncSeparate'].srcRGB=srcRGB;this.states['blendFuncSeparate'].dstRGB=dstRGB;this.states['blendFuncSeparate'].srcAlpha=srcAlpha;this.states['blendFuncSeparate'].dstAlpha=dstAlpha;}};x3dom.StateManager.prototype.depthFunc=function(func)\n{if(this.states['depthFunc']!=func)\n{this.gl.depthFunc(func);this.states['depthFunc']=func;}};x3dom.StateManager.prototype.depthRange=function(zNear,zFar)\n{if(zNear<0||zFar<0||zNear>zFar)\n{return;}\nzNear=(zNear>1)?1:zNear;zFar=(zFar>1)?1:zFar;if(this.states['depthRange'].zNear!=zNear||this.states['depthRange'].zFar!=zFar)\n{this.gl.depthRange(zNear,zFar);this.states['depthRange'].zNear=zNear;this.states['depthRange'].zFar=zFar;}};x3dom.StateManager.prototype.viewport=function(x,y,width,height)\n{if(this.states['viewport'].x!=x||this.states['viewport'].y!=y||this.states['viewport'].width!=width||this.states['viewport'].height!=height)\n{this.gl.viewport(x,y,width,height);this.states['viewport'].x=x;this.states['viewport'].y=y;this.states['viewport'].width=width;this.states['viewport'].height=height;}};x3dom.StateManager.prototype.bindFramebuffer=function(target,framebuffer)\n{this.gl.bindFramebuffer(target,framebuffer);this.initStates();};x3dom.BinaryContainerLoader={outOfMemory:false,checkError:function(gl){var glErr=gl.getError();if(glErr){if(glErr==gl.OUT_OF_MEMORY){this.outOfMemory=true;x3dom.debug.logError(\"GL-Error \"+glErr+\" on loading binary container (out of memory).\");console.error(\"WebGL: OUT_OF_MEMORY\");}\nelse{x3dom.debug.logError(\"GL-Error \"+glErr+\" on loading binary container.\");}}}};x3dom.BinaryContainerLoader.setupBinGeo=function(shape,sp,gl,viewarea,currContext)\n{if(this.outOfMemory){return;}\nvar t00=new Date().getTime();var that=this;var binGeo=shape._cf.geometry.node;shape._webgl.binaryGeometry=-1;shape._webgl.internalDownloadCount=((binGeo._vf.index.length>0)?1:0)+\n((binGeo._hasStrideOffset&&binGeo._vf.coord.length>0)?1:0)+\n((!binGeo._hasStrideOffset&&binGeo._vf.coord.length>0)?1:0)+\n((!binGeo._hasStrideOffset&&binGeo._vf.normal.length>0)?1:0)+\n((!binGeo._hasStrideOffset&&binGeo._vf.texCoord.length>0)?1:0)+\n((!binGeo._hasStrideOffset&&binGeo._vf.color.length>0)?1:0);var createTriangleSoup=(binGeo._vf.normalPerVertex==false)||((binGeo._vf.index.length>0)&&(binGeo._vf.indexType==\"Int32\"||(binGeo._vf.indexType==\"Uint32\"&&!x3dom.caps.INDEX_UINT)));shape._webgl.makeSeparateTris={index:null,coord:null,normal:null,texCoord:null,color:null,pushBuffer:function(name,buf){this[name]=buf;if(--shape._webgl.internalDownloadCount==0){if(this.coord)\nthis.createMesh();shape._nameSpace.doc.needRender=true;}\nif(--shape._nameSpace.doc.downloadCount==0)\nshape._nameSpace.doc.needRender=true;},createMesh:function(){var geoNode=binGeo;if(geoNode._hasStrideOffset){x3dom.debug.logError(geoNode._vf.indexType+\" index type and per-face normals not supported for interleaved arrays.\");return;}\nfor(var k=0;k<shape._webgl.primType.length;k++){if(shape._webgl.primType[k]==gl.TRIANGLE_STRIP){x3dom.debug.logError(\"makeSeparateTris: triangle strips not yet supported for per-face normals.\");return;}}\nvar attribTypeStr=geoNode._vf.coordType;shape._webgl.coordType=x3dom.Utils.getVertexAttribType(attribTypeStr,gl);var bgCenter,bgSize,bgPrecisionMax;if(shape._webgl.coordType!=gl.FLOAT)\n{if(geoNode._mesh._numPosComponents==4&&x3dom.Utils.isUnsignedType(geoNode._vf.coordType))\nbgCenter=x3dom.fields.SFVec3f.copy(geoNode.getMin());else\nbgCenter=x3dom.fields.SFVec3f.copy(geoNode._vf.position);bgSize=x3dom.fields.SFVec3f.copy(geoNode._vf.size);bgPrecisionMax=geoNode.getPrecisionMax('coordType');}\nelse\n{bgCenter=new x3dom.fields.SFVec3f(0,0,0);bgSize=new x3dom.fields.SFVec3f(1,1,1);bgPrecisionMax=1.0;}\nvar dataLen=shape._coordStrideOffset[0]/x3dom.Utils.getDataTypeSize(geoNode._vf.coordType);dataLen=(dataLen==0)?3:dataLen;x3dom.debug.logWarning(\"makeSeparateTris.createMesh called with coord length \"+dataLen);if(this.color&&dataLen!=shape._colorStrideOffset[0]/x3dom.Utils.getDataTypeSize(geoNode._vf.colorType))\n{this.color=null;x3dom.debug.logWarning(\"Color format not supported.\");}\nvar texDataLen=this.texCoord?(shape._texCoordStrideOffset[0]/x3dom.Utils.getDataTypeSize(geoNode._vf.texCoordType)):0;geoNode._vf.normalType=\"Float32\";shape._webgl.normalType=gl.FLOAT;geoNode._mesh._numNormComponents=3;shape._normalStrideOffset=[0,0];var posBuf=[],normBuf=[],texcBuf=[],colBuf=[];var i,j,l,n=this.index?(this.index.length-2):(this.coord.length/3-2);for(i=0;i<n;i+=3)\n{j=dataLen*(this.index?this.index[i]:i);var p0=new x3dom.fields.SFVec3f(bgSize.x*this.coord[j]/bgPrecisionMax,bgSize.y*this.coord[j+1]/bgPrecisionMax,bgSize.z*this.coord[j+2]/bgPrecisionMax);posBuf.push(this.coord[j]);posBuf.push(this.coord[j+1]);posBuf.push(this.coord[j+2]);if(dataLen>3)posBuf.push(this.coord[j+3]);if(this.color){colBuf.push(this.color[j]);colBuf.push(this.color[j+1]);colBuf.push(this.color[j+2]);if(dataLen>3)colBuf.push(this.color[j+3]);}\nif(this.texCoord){l=texDataLen*(this.index?this.index[i]:i);texcBuf.push(this.texCoord[l]);texcBuf.push(this.texCoord[l+1]);if(texDataLen>3){texcBuf.push(this.texCoord[l+2]);texcBuf.push(this.texCoord[l+3]);}}\nj=dataLen*(this.index?this.index[i+1]:i+1);var p1=new x3dom.fields.SFVec3f(bgSize.x*this.coord[j]/bgPrecisionMax,bgSize.y*this.coord[j+1]/bgPrecisionMax,bgSize.z*this.coord[j+2]/bgPrecisionMax);posBuf.push(this.coord[j]);posBuf.push(this.coord[j+1]);posBuf.push(this.coord[j+2]);if(dataLen>3)posBuf.push(this.coord[j+3]);if(this.color){colBuf.push(this.color[j]);colBuf.push(this.color[j+1]);colBuf.push(this.color[j+2]);if(dataLen>3)colBuf.push(this.color[j+3]);}\nif(this.texCoord){l=texDataLen*(this.index?this.index[i+1]:i+1);texcBuf.push(this.texCoord[l]);texcBuf.push(this.texCoord[l+1]);if(texDataLen>3){texcBuf.push(this.texCoord[l+2]);texcBuf.push(this.texCoord[l+3]);}}\nj=dataLen*(this.index?this.index[i+2]:i+2);var p2=new x3dom.fields.SFVec3f(bgSize.x*this.coord[j]/bgPrecisionMax,bgSize.y*this.coord[j+1]/bgPrecisionMax,bgSize.z*this.coord[j+2]/bgPrecisionMax);posBuf.push(this.coord[j]);posBuf.push(this.coord[j+1]);posBuf.push(this.coord[j+2]);if(dataLen>3)posBuf.push(this.coord[j+3]);if(this.color){colBuf.push(this.color[j]);colBuf.push(this.color[j+1]);colBuf.push(this.color[j+2]);if(dataLen>3)colBuf.push(this.color[j+3]);}\nif(this.texCoord){l=texDataLen*(this.index?this.index[i+2]:i+2);texcBuf.push(this.texCoord[l]);texcBuf.push(this.texCoord[l+1]);if(texDataLen>3){texcBuf.push(this.texCoord[l+2]);texcBuf.push(this.texCoord[l+3]);}}\nvar a=p0.subtract(p1);var b=p1.subtract(p2);var norm=a.cross(b).normalize();for(j=0;j<3;j++){normBuf.push(norm.x);normBuf.push(norm.y);normBuf.push(norm.z);}}\nvar buffer=gl.createBuffer();shape._webgl.buffers[x3dom.BUFFER_IDX.POSITION]=buffer;gl.bindBuffer(gl.ARRAY_BUFFER,buffer);gl.bufferData(gl.ARRAY_BUFFER,x3dom.Utils.getArrayBufferView(geoNode._vf.coordType,posBuf),gl.STATIC_DRAW);gl.vertexAttribPointer(sp.position,geoNode._mesh._numPosComponents,shape._webgl.coordType,false,shape._coordStrideOffset[0],shape._coordStrideOffset[1]);gl.enableVertexAttribArray(sp.position);buffer=gl.createBuffer();shape._webgl.buffers[x3dom.BUFFER_IDX.NORMAL]=buffer;gl.bindBuffer(gl.ARRAY_BUFFER,buffer);gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(normBuf),gl.STATIC_DRAW);gl.vertexAttribPointer(sp.normal,geoNode._mesh._numNormComponents,shape._webgl.normalType,false,shape._normalStrideOffset[0],shape._normalStrideOffset[1]);gl.enableVertexAttribArray(sp.normal);if(this.texCoord)\n{buffer=gl.createBuffer();shape._webgl.buffers[x3dom.BUFFER_IDX.TEXCOORD]=buffer;gl.bindBuffer(gl.ARRAY_BUFFER,buffer);gl.bufferData(gl.ARRAY_BUFFER,x3dom.Utils.getArrayBufferView(geoNode._vf.texCoordType,texcBuf),gl.STATIC_DRAW);gl.vertexAttribPointer(sp.texcoord,geoNode._mesh._numTexComponents,shape._webgl.texCoordType,false,shape._texCoordStrideOffset[0],shape._texCoordStrideOffset[1]);gl.enableVertexAttribArray(sp.texcoord);}\nif(this.color)\n{buffer=gl.createBuffer();shape._webgl.buffers[x3dom.BUFFER_IDX.COLOR]=buffer;gl.bindBuffer(gl.ARRAY_BUFFER,buffer);gl.bufferData(gl.ARRAY_BUFFER,x3dom.Utils.getArrayBufferView(geoNode._vf.colorType,colBuf),gl.STATIC_DRAW);gl.vertexAttribPointer(sp.color,geoNode._mesh._numColComponents,shape._webgl.colorType,false,shape._colorStrideOffset[0],shape._colorStrideOffset[1]);gl.enableVertexAttribArray(sp.color);}\ngeoNode._vf.vertexCount=[];geoNode._vf.vertexCount[0]=posBuf.length/dataLen;geoNode._mesh._numCoords=geoNode._vf.vertexCount[0];geoNode._mesh._numFaces=geoNode._vf.vertexCount[0]/3;shape._webgl.primType=[];shape._webgl.primType[0]=gl.TRIANGLES;posBuf=null;normBuf=null;texcBuf=null;colBuf=null;this.index=null;this.coord=null;this.normal=null;this.texCoord=null;this.color=null;that.checkError(gl);delete shape._webgl.shader;shape._webgl.shader=currContext.cache.getDynamicShader(gl,viewarea,shape);}};if(binGeo._vf.index.length>0)\n{shape._webgl.binaryGeometry=1;var xmlhttp0=new XMLHttpRequest();xmlhttp0.open(\"GET\",shape._nameSpace.getURL(binGeo._vf.index),true);xmlhttp0.responseType=\"arraybuffer\";shape._nameSpace.doc.incrementDownloads();x3dom.RequestManager.addRequest(xmlhttp0);xmlhttp0.onload=function()\n{shape._nameSpace.doc.decrementDownloads();shape._webgl.internalDownloadCount-=1;if(xmlhttp0.status!=200){x3dom.debug.logError(\"XHR1/ index load failed with status: \"+xmlhttp0.status);return;}\nif(!shape._webgl)\nreturn;var XHR_buffer=binGeo._vf.compressed==true?x3dom.Utils.gunzip(xmlhttp0.response):xmlhttp0.response;var geoNode=binGeo;var attribTypeStr=geoNode._vf.indexType;var indexArray=x3dom.Utils.getArrayBufferView(attribTypeStr,XHR_buffer);if(createTriangleSoup){shape._webgl.makeSeparateTris.pushBuffer(\"index\",indexArray);return;}\nvar indicesBuffer=gl.createBuffer();if(x3dom.caps.INDEX_UINT&&attribTypeStr==\"Uint32\"){shape._webgl.indexType=gl.UNSIGNED_INT;}\nelse{shape._webgl.indexType=gl.UNSIGNED_SHORT;}\ngl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER,indicesBuffer);gl.bufferData(gl.ELEMENT_ARRAY_BUFFER,indexArray,gl.STATIC_DRAW);gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER,null);if(geoNode._vf.vertexCount[0]==0)\ngeoNode._vf.vertexCount[0]=indexArray.length;geoNode._mesh._numFaces=0;for(var i=0;i<geoNode._vf.vertexCount.length;i++){if(shape._webgl.primType[i]==gl.TRIANGLE_STRIP)\ngeoNode._mesh._numFaces+=geoNode._vf.vertexCount[i]-2;else\ngeoNode._mesh._numFaces+=geoNode._vf.vertexCount[i]/3;}\nindexArray=null;if(shape._webgl.internalDownloadCount==0)\n{shape._nameSpace.doc.needRender=true;}\nthat.checkError(gl);var t11=new Date().getTime()-t00;x3dom.debug.logInfo(\"XHR0/ index load time: \"+t11+\" ms\");shape._webgl.buffers[x3dom.BUFFER_IDX.INDEX]=indicesBuffer;};}\nif(binGeo._hasStrideOffset&&binGeo._vf.coord.length>0)\n{var xmlhttp=new XMLHttpRequest();xmlhttp.open(\"GET\",shape._nameSpace.getURL(binGeo._vf.coord),true);xmlhttp.responseType=\"arraybuffer\";shape._nameSpace.doc.incrementDownloads();x3dom.RequestManager.addRequest(xmlhttp);xmlhttp.onload=function()\n{shape._nameSpace.doc.decrementDownloads();shape._webgl.internalDownloadCount-=1;if(xmlhttp.status!=200){x3dom.debug.logError(\"XHR1/ interleaved array load failed with status: \"+xmlhttp.status);return;}\nif(!shape._webgl)\nreturn;var XHR_buffer=binGeo._vf.compressed==true?x3dom.Utils.gunzip(xmlhttp.response):xmlhttp.response;var geoNode=binGeo;var attribTypeStr=geoNode._vf.coordType;shape._webgl.coordType=x3dom.Utils.getVertexAttribType(attribTypeStr,gl);shape._webgl.normalType=shape._webgl.coordType;shape._webgl.texCoordType=shape._webgl.coordType;shape._webgl.colorType=shape._webgl.coordType;var attributes=x3dom.Utils.getArrayBufferView(attribTypeStr,XHR_buffer);var dataLen=shape._coordStrideOffset[0]/x3dom.Utils.getDataTypeSize(attribTypeStr);if(dataLen)\ngeoNode._mesh._numCoords=attributes.length/dataLen;if(geoNode._vf.index.length==0){for(var i=0;i<geoNode._vf.vertexCount.length;i++){if(shape._webgl.primType[i]==gl.TRIANGLE_STRIP)\ngeoNode._mesh._numFaces+=geoNode._vf.vertexCount[i]-2;else\ngeoNode._mesh._numFaces+=geoNode._vf.vertexCount[i]/3;}}\nvar buffer=gl.createBuffer();gl.bindBuffer(gl.ARRAY_BUFFER,buffer);gl.bufferData(gl.ARRAY_BUFFER,attributes,gl.STATIC_DRAW);gl.vertexAttribPointer(sp.position,geoNode._mesh._numPosComponents,shape._webgl.coordType,false,shape._coordStrideOffset[0],shape._coordStrideOffset[1]);gl.enableVertexAttribArray(sp.position);if(geoNode._vf.normal.length>0)\n{shape._webgl.buffers[x3dom.BUFFER_IDX.NORMAL]=buffer;gl.bindBuffer(gl.ARRAY_BUFFER,buffer);gl.bufferData(gl.ARRAY_BUFFER,attributes,gl.STATIC_DRAW);gl.vertexAttribPointer(sp.normal,geoNode._mesh._numNormComponents,shape._webgl.normalType,false,shape._normalStrideOffset[0],shape._normalStrideOffset[1]);gl.enableVertexAttribArray(sp.normal);}\nif(geoNode._vf.texCoord.length>0)\n{shape._webgl.buffers[x3dom.BUFFER_IDX.TEXCOORD]=buffer;gl.bindBuffer(gl.ARRAY_BUFFER,buffer);gl.bufferData(gl.ARRAY_BUFFER,attributes,gl.STATIC_DRAW);gl.vertexAttribPointer(sp.texcoord,geoNode._mesh._numTexComponents,shape._webgl.texCoordType,false,shape._texCoordStrideOffset[0],shape._texCoordStrideOffset[1]);gl.enableVertexAttribArray(sp.texcoord);}\nif(geoNode._vf.color.length>0)\n{shape._webgl.buffers[x3dom.BUFFER_IDX.COLOR]=buffer;gl.bindBuffer(gl.ARRAY_BUFFER,buffer);gl.bufferData(gl.ARRAY_BUFFER,attributes,gl.STATIC_DRAW);gl.vertexAttribPointer(sp.color,geoNode._mesh._numColComponents,shape._webgl.colorType,false,shape._colorStrideOffset[0],shape._colorStrideOffset[1]);gl.enableVertexAttribArray(sp.color);}\nattributes=null;if(shape._webgl.internalDownloadCount==0)\n{shape._nameSpace.doc.needRender=true;}\nthat.checkError(gl);var t11=new Date().getTime()-t00;x3dom.debug.logInfo(\"XHR/ interleaved array load time: \"+t11+\" ms\");shape._webgl.buffers[x3dom.BUFFER_IDX.POSITION]=buffer;};}\nif(!binGeo._hasStrideOffset&&binGeo._vf.coord.length>0)\n{var xmlhttp1=new XMLHttpRequest();xmlhttp1.open(\"GET\",shape._nameSpace.getURL(binGeo._vf.coord),true);xmlhttp1.responseType=\"arraybuffer\";shape._nameSpace.doc.incrementDownloads();x3dom.RequestManager.addRequest(xmlhttp1);xmlhttp1.onload=function()\n{shape._nameSpace.doc.decrementDownloads();shape._webgl.internalDownloadCount-=1;if(xmlhttp1.status!=200){x3dom.debug.logError(\"XHR1/ coord load failed with status: \"+xmlhttp1.status);return;}\nif(!shape._webgl)\nreturn;var XHR_buffer=binGeo._vf.compressed==true?x3dom.Utils.gunzip(xmlhttp1.response):xmlhttp1.response;var geoNode=binGeo;var i=0;var attribTypeStr=geoNode._vf.coordType;shape._webgl.coordType=x3dom.Utils.getVertexAttribType(attribTypeStr,gl);var vertices=x3dom.Utils.getArrayBufferView(attribTypeStr,XHR_buffer);if(createTriangleSoup){shape._webgl.makeSeparateTris.pushBuffer(\"coord\",vertices);return;}\ngl.bindAttribLocation(sp.program,0,\"position\");var positionBuffer=gl.createBuffer();gl.bindBuffer(gl.ARRAY_BUFFER,positionBuffer);gl.bufferData(gl.ARRAY_BUFFER,vertices,gl.STATIC_DRAW);gl.bindBuffer(gl.ARRAY_BUFFER,null);geoNode._mesh._numCoords=vertices.length/geoNode._mesh._numPosComponents;if(geoNode._vf.index.length==0){for(i=0;i<geoNode._vf.vertexCount.length;i++){if(shape._webgl.primType[i]==gl.TRIANGLE_STRIP)\ngeoNode._mesh._numFaces+=geoNode._vf.vertexCount[i]-2;else\ngeoNode._mesh._numFaces+=geoNode._vf.vertexCount[i]/3;}}\nif((attribTypeStr==\"Float32\")&&(shape._vf.bboxSize.x<0||shape._vf.bboxSize.y<0||shape._vf.bboxSize.z<0))\n{var min=new x3dom.fields.SFVec3f(vertices[0],vertices[1],vertices[2]);var max=new x3dom.fields.SFVec3f(vertices[0],vertices[1],vertices[2]);for(i=3;i<vertices.length;i+=3)\n{if(min.x>vertices[i+0]){min.x=vertices[i+0];}\nif(min.y>vertices[i+1]){min.y=vertices[i+1];}\nif(min.z>vertices[i+2]){min.z=vertices[i+2];}\nif(max.x<vertices[i+0]){max.x=vertices[i+0];}\nif(max.y<vertices[i+1]){max.y=vertices[i+1];}\nif(max.z<vertices[i+2]){max.z=vertices[i+2];}}\nshape._vf.bboxCenter.setValues(min.add(max).multiply(0.5));shape._vf.bboxSize.setValues(max.subtract(min));}\nvertices=null;if(shape._webgl.internalDownloadCount==0)\n{shape._nameSpace.doc.needRender=true;}\nthat.checkError(gl);var t11=new Date().getTime()-t00;x3dom.debug.logInfo(\"XHR1/ coord load time: \"+t11+\" ms\");shape._webgl.buffers[x3dom.BUFFER_IDX.POSITION]=positionBuffer;};}\nif(!binGeo._hasStrideOffset&&binGeo._vf.normal.length>0)\n{var xmlhttp2=new XMLHttpRequest();xmlhttp2.open(\"GET\",shape._nameSpace.getURL(binGeo._vf.normal),true);xmlhttp2.responseType=\"arraybuffer\";shape._nameSpace.doc.incrementDownloads();x3dom.RequestManager.addRequest(xmlhttp2);xmlhttp2.onload=function()\n{shape._nameSpace.doc.decrementDownloads();shape._webgl.internalDownloadCount-=1;if(xmlhttp2.status!=200){x3dom.debug.logError(\"XHR2/ normal load failed with status: \"+xmlhttp2.status);return;}\nif(!shape._webgl)\nreturn;var XHR_buffer=binGeo._vf.compressed==true?x3dom.Utils.gunzip(xmlhttp2.response):xmlhttp2.response;var attribTypeStr=binGeo._vf.normalType;shape._webgl.normalType=x3dom.Utils.getVertexAttribType(attribTypeStr,gl);var normals=x3dom.Utils.getArrayBufferView(attribTypeStr,XHR_buffer);if(createTriangleSoup){shape._webgl.makeSeparateTris.pushBuffer(\"normal\",normals);return;}\nvar normalBuffer=gl.createBuffer();gl.bindBuffer(gl.ARRAY_BUFFER,normalBuffer);gl.bufferData(gl.ARRAY_BUFFER,normals,gl.STATIC_DRAW);gl.bindBuffer(gl.ARRAY_BUFFER,null);normals=null;if(shape._webgl.internalDownloadCount==0)\n{shape._nameSpace.doc.needRender=true;}\nthat.checkError(gl);var t11=new Date().getTime()-t00;x3dom.debug.logInfo(\"XHR2/ normal load time: \"+t11+\" ms\");shape._webgl.buffers[x3dom.BUFFER_IDX.NORMAL]=normalBuffer;};}\nif(!binGeo._hasStrideOffset&&binGeo._vf.texCoord.length>0)\n{var xmlhttp3=new XMLHttpRequest();xmlhttp3.open(\"GET\",shape._nameSpace.getURL(binGeo._vf.texCoord),true);xmlhttp3.responseType=\"arraybuffer\";shape._nameSpace.doc.incrementDownloads();x3dom.RequestManager.addRequest(xmlhttp3);xmlhttp3.onload=function()\n{var i,j;var tmp;shape._nameSpace.doc.decrementDownloads();shape._webgl.internalDownloadCount-=1;if(xmlhttp3.status!=200){x3dom.debug.logError(\"XHR3/ texcoord load failed with status: \"+xmlhttp3.status);return;}\nif(!shape._webgl)\nreturn;var XHR_buffer=binGeo._vf.compressed==true?x3dom.Utils.gunzip(xmlhttp3.response):xmlhttp3.response;var attribTypeStr=binGeo._vf.texCoordType;shape._webgl.texCoordType=x3dom.Utils.getVertexAttribType(attribTypeStr,gl);var texCoords=x3dom.Utils.getArrayBufferView(attribTypeStr,XHR_buffer);if(createTriangleSoup){shape._webgl.makeSeparateTris.pushBuffer(\"texCoord\",texCoords);return;}\nif(binGeo._vf[\"idsPerVertex\"])\n{var idBuffer=gl.createBuffer();gl.bindBuffer(gl.ARRAY_BUFFER,idBuffer);var ids=x3dom.Utils.getArrayBufferView(\"Float32\",texCoords.length/2);for(i=0,j=0;i<texCoords.length;i+=2,j++)\n{ids[j]=texCoords[i+1]*65536+texCoords[i];}\ngl.bufferData(gl.ARRAY_BUFFER,ids,gl.STATIC_DRAW);gl.bindBuffer(gl.ARRAY_BUFFER,null);shape._webgl.buffers[x3dom.BUFFER_IDX.ID]=idBuffer;}\nelse\n{var texcBuffer=gl.createBuffer();gl.bindBuffer(gl.ARRAY_BUFFER,texcBuffer);gl.bufferData(gl.ARRAY_BUFFER,texCoords,gl.STATIC_DRAW);gl.bindBuffer(gl.ARRAY_BUFFER,null);shape._webgl.buffers[x3dom.BUFFER_IDX.TEXCOORD]=texcBuffer;}\ntexCoords=null;if(shape._webgl.internalDownloadCount==0)\n{shape._nameSpace.doc.needRender=true;}\nthat.checkError(gl);var t11=new Date().getTime()-t00;x3dom.debug.logInfo(\"XHR3/ texCoord load time: \"+t11+\" ms\");};}\nif(!binGeo._hasStrideOffset&&binGeo._vf.color.length>0)\n{var xmlhttp4=new XMLHttpRequest();xmlhttp4.open(\"GET\",shape._nameSpace.getURL(binGeo._vf.color),true);xmlhttp4.responseType=\"arraybuffer\";shape._nameSpace.doc.incrementDownloads();x3dom.RequestManager.addRequest(xmlhttp4);xmlhttp4.onload=function()\n{shape._nameSpace.doc.decrementDownloads();shape._webgl.internalDownloadCount-=1;if(xmlhttp4.status!=200){x3dom.debug.logError(\"XHR4/ color load failed with status: \"+xmlhttp4.status);return;}\nif(!shape._webgl)\nreturn;var XHR_buffer=binGeo._vf.compressed==true?x3dom.Utils.gunzip(xmlhttp4.response):xmlhttp4.response;var attribTypeStr=binGeo._vf.colorType;shape._webgl.colorType=x3dom.Utils.getVertexAttribType(attribTypeStr,gl);var colors=x3dom.Utils.getArrayBufferView(attribTypeStr,XHR_buffer);if(createTriangleSoup){shape._webgl.makeSeparateTris.pushBuffer(\"color\",colors);return;}\nvar colorBuffer=gl.createBuffer();gl.bindBuffer(gl.ARRAY_BUFFER,colorBuffer);gl.bufferData(gl.ARRAY_BUFFER,colors,gl.STATIC_DRAW);gl.bindBuffer(gl.ARRAY_BUFFER,null);colors=null;if(shape._webgl.internalDownloadCount==0)\n{shape._nameSpace.doc.needRender=true;}\nthat.checkError(gl);var t11=new Date().getTime()-t00;x3dom.debug.logInfo(\"XHR4/ color load time: \"+t11+\" ms\");shape._webgl.buffers[x3dom.BUFFER_IDX.COLOR]=colorBuffer;};}\nif(!binGeo._hasStrideOffset&&binGeo._vf.tangent.length>0)\n{var xmlhttp5=new XMLHttpRequest();xmlhttp5.open(\"GET\",shape._nameSpace.getURL(binGeo._vf.normal),true);xmlhttp5.responseType=\"arraybuffer\";shape._nameSpace.doc.incrementDownloads();x3dom.RequestManager.addRequest(xmlhttp5);xmlhttp5.onload=function()\n{shape._nameSpace.doc.decrementDownloads();shape._webgl.internalDownloadCount-=1;if(xmlhttp5.status!=200){x3dom.debug.logError(\"XHR2/ normal load failed with status: \"+xmlhttp5.status);return;}\nif(!shape._webgl)\nreturn;var XHR_buffer=binGeo._vf.compressed==true?x3dom.Utils.gunzip(xmlhttp5.response):xmlhttp5.response;var attribTypeStr=binGeo._vf.tangentType;shape._webgl.tangentType=x3dom.Utils.getVertexAttribType(attribTypeStr,gl);var tangents=x3dom.Utils.getArrayBufferView(attribTypeStr,XHR_buffer);if(createTriangleSoup){shape._webgl.makeSeparateTris.pushBuffer(\"tangent\",tangents);return;}\nvar tangentBuffer=gl.createBuffer();gl.bindBuffer(gl.ARRAY_BUFFER,tangentBuffer);gl.bufferData(gl.ARRAY_BUFFER,tangents,gl.STATIC_DRAW);gl.bindBuffer(gl.ARRAY_BUFFER,null);tangents=null;if(shape._webgl.internalDownloadCount==0)\n{shape._nameSpace.doc.needRender=true;}\nthat.checkError(gl);var t11=new Date().getTime()-t00;x3dom.debug.logInfo(\"XHR5/ normal load time: \"+t11+\" ms\");shape._webgl.buffers[x3dom.BUFFER_IDX.TANGENT]=tangentBuffer;};}\nif(!binGeo._hasStrideOffset&&binGeo._vf.binormal.length>0)\n{var xmlhttp6=new XMLHttpRequest();xmlhttp6.open(\"GET\",shape._nameSpace.getURL(binGeo._vf.normal),true);xmlhttp6.responseType=\"arraybuffer\";shape._nameSpace.doc.incrementDownloads();x3dom.RequestManager.addRequest(xmlhttp6);xmlhttp6.onload=function()\n{shape._nameSpace.doc.decrementDownloads();shape._webgl.internalDownloadCount-=1;if(xmlhttp6.status!=200){x3dom.debug.logError(\"XHR6/ normal load failed with status: \"+xmlhttp6.status);return;}\nif(!shape._webgl)\nreturn;var XHR_buffer=binGeo._vf.compressed==true?x3dom.Utils.gunzip(xmlhttp6.response):xmlhttp6.response;var attribTypeStr=binGeo._vf.binormalType;shape._webgl.binormalType=x3dom.Utils.getVertexAttribType(attribTypeStr,gl);var binormals=x3dom.Utils.getArrayBufferView(attribTypeStr,XHR_buffer);if(createTriangleSoup){shape._webgl.makeSeparateTris.pushBuffer(\"binormal\",binormals);return;}\nvar binormalBuffer=gl.createBuffer();gl.bindBuffer(gl.ARRAY_BUFFER,binormalBuffer);gl.bufferData(gl.ARRAY_BUFFER,binormals,gl.STATIC_DRAW);gl.bindBuffer(gl.ARRAY_BUFFER,null);binormals=null;if(shape._webgl.internalDownloadCount==0)\n{shape._nameSpace.doc.needRender=true;}\nthat.checkError(gl);var t11=new Date().getTime()-t00;x3dom.debug.logInfo(\"XHR6/ normal load time: \"+t11+\" ms\");shape._webgl.buffers[x3dom.BUFFER_IDX.BITANGENT]=binormalBuffer;};}};x3dom.BinaryContainerLoader.setupPopGeo=function(shape,sp,gl,viewarea,currContext)\n{if(this.outOfMemory){return;}\nvar popGeo=shape._cf.geometry.node;if(popGeo.hasIndex()){shape._webgl.popGeometry=1;shape._webgl.buffers[x3dom.BUFFER_IDX.INDEX]=gl.createBuffer();gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER,shape._webgl.buffers[x3dom.BUFFER_IDX.INDEX]);gl.bufferData(gl.ELEMENT_ARRAY_BUFFER,popGeo.getTotalNumberOfIndices()*2,gl.STATIC_DRAW);shape._webgl.buffers[x3dom.BUFFER_IDX.ID]=gl.createBuffer();var idBuffer=new Float32Array(popGeo._vf.vertexBufferSize);(function(){for(var i=0;i<idBuffer.length;++i)idBuffer[i]=i;})();gl.bindBuffer(gl.ARRAY_BUFFER,shape._webgl.buffers[x3dom.BUFFER_IDX.ID]);gl.bufferData(gl.ARRAY_BUFFER,idBuffer,gl.STATIC_DRAW);}\nelse{shape._webgl.popGeometry=-1;}\nshape._webgl.buffers[x3dom.BUFFER_IDX.POSITION]=gl.createBuffer();gl.bindBuffer(gl.ARRAY_BUFFER,shape._webgl.buffers[x3dom.BUFFER_IDX.POSITION]);gl.bufferData(gl.ARRAY_BUFFER,(popGeo._vf.attributeStride*popGeo._vf.vertexBufferSize),gl.STATIC_DRAW);var attribTypeStr=popGeo._vf.coordType;shape._webgl.coordType=x3dom.Utils.getVertexAttribType(attribTypeStr,gl);shape._coordStrideOffset[0]=popGeo.getAttributeStride();shape._coordStrideOffset[1]=popGeo.getPositionOffset();gl.vertexAttribPointer(sp.position,shape._cf.geometry.node._mesh._numPosComponents,shape._webgl.coordType,false,shape._coordStrideOffset[0],shape._coordStrideOffset[1]);gl.enableVertexAttribArray(sp.position);if(popGeo.hasNormal()){attribTypeStr=popGeo._vf.normalType;shape._webgl.normalType=x3dom.Utils.getVertexAttribType(attribTypeStr,gl);shape._normalStrideOffset[0]=popGeo.getAttributeStride();shape._normalStrideOffset[1]=popGeo.getNormalOffset();shape._webgl.buffers[x3dom.BUFFER_IDX.NORMAL]=shape._webgl.buffers[x3dom.BUFFER_IDX.POSITION];gl.vertexAttribPointer(sp.normal,shape._cf.geometry.node._mesh._numNormComponents,shape._webgl.normalType,false,shape._normalStrideOffset[0],shape._normalStrideOffset[1]);gl.enableVertexAttribArray(sp.normal);}\nif(popGeo.hasTexCoord()){attribTypeStr=popGeo._vf.texCoordType;shape._webgl.texCoordType=x3dom.Utils.getVertexAttribType(attribTypeStr,gl);shape._webgl.buffers[x3dom.BUFFER_IDX.TEXCOORD]=shape._webgl.buffers[x3dom.BUFFER_IDX.POSITION];shape._texCoordStrideOffset[0]=popGeo.getAttributeStride();shape._texCoordStrideOffset[1]=popGeo.getTexCoordOffset();gl.vertexAttribPointer(sp.texcoord,shape._cf.geometry.node._mesh._numTexComponents,shape._webgl.texCoordType,false,shape._texCoordStrideOffset[0],shape._texCoordStrideOffset[1]);gl.enableVertexAttribArray(sp.texcoord);}\nif(popGeo.hasColor()){attribTypeStr=popGeo._vf.colorType;shape._webgl.colorType=x3dom.Utils.getVertexAttribType(attribTypeStr,gl);shape._webgl.buffers[x3dom.BUFFER_IDX.COLOR]=shape._webgl.buffers[x3dom.BUFFER_IDX.POSITION];shape._colorStrideOffset[0]=popGeo.getAttributeStride();shape._colorStrideOffset[1]=popGeo.getColorOffset();gl.vertexAttribPointer(sp.color,shape._cf.geometry.node._mesh._numColComponents,shape._webgl.colorType,false,shape._colorStrideOffset[0],shape._colorStrideOffset[1]);gl.enableVertexAttribArray(sp.color);}\nshape._webgl.currentNumIndices=0;shape._webgl.currentNumVertices=0;shape._webgl.numVerticesAtLevel=[];shape._webgl.levelsAvailable=0;this.checkError(gl);shape._webgl.levelLoaded=[];(function(){for(var i=0;i<popGeo.getNumLevels();++i)\nshape._webgl.levelLoaded.push(false);})();var uploadDataToGPU=function(data,lvl){shape._webgl.levelLoaded[lvl]=true;shape._webgl.numVerticesAtLevel[lvl]=0;if(data){var indexDataLengthInBytes=0;var redrawNeeded=false;if(popGeo.hasIndex()){indexDataLengthInBytes=popGeo.getNumIndicesByLevel(lvl)*2;if(indexDataLengthInBytes>0){redrawNeeded=true;var indexDataView=new Uint8Array(data,0,indexDataLengthInBytes);gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER,shape._webgl.buffers[x3dom.BUFFER_IDX.INDEX]);(function(){var indexDataOffset=0;for(var i=0;i<lvl;++i){indexDataOffset+=popGeo.getNumIndicesByLevel(i);}\ngl.bufferSubData(gl.ELEMENT_ARRAY_BUFFER,indexDataOffset*2,indexDataView);})();}}\nvar vertexDataLengthInBytes=data.byteLength-indexDataLengthInBytes;if(vertexDataLengthInBytes>0){redrawNeeded=true;var attributeDataView=new Uint8Array(data,indexDataLengthInBytes,vertexDataLengthInBytes);gl.bindBuffer(gl.ARRAY_BUFFER,shape._webgl.buffers[x3dom.BUFFER_IDX.POSITION]);if(!popGeo.hasIndex()){gl.bufferSubData(gl.ARRAY_BUFFER,shape._webgl.currentNumVertices*popGeo.getAttributeStride(),attributeDataView);}\nelse{gl.bufferSubData(gl.ARRAY_BUFFER,popGeo.getVertexDataBufferOffset(lvl)*popGeo.getAttributeStride(),attributeDataView);}\nshape._webgl.numVerticesAtLevel[lvl]=vertexDataLengthInBytes/popGeo.getAttributeStride();shape._webgl.currentNumVertices+=shape._webgl.numVerticesAtLevel[lvl];}\n(function(){var numValidIndices=0;for(var i=shape._webgl.levelsAvailable;i<popGeo.getNumLevels();++i){if(shape._webgl.levelLoaded[i]===false){break;}\nelse{numValidIndices+=popGeo.getNumIndicesByLevel(i);++shape._webgl.levelsAvailable;}}\nshape._webgl.currentNumIndices=numValidIndices;})();popGeo._mesh._numCoords=shape._webgl.currentNumVertices;popGeo._mesh._numFaces=(popGeo.hasIndex()?shape._webgl.currentNumIndices:shape._webgl.currentNumVertices)/3;popGeo.adaptVertexCount(popGeo.hasIndex()?popGeo._mesh._numFaces*3:popGeo._mesh._numCoords);if(redrawNeeded){shape._nameSpace.doc.needRender=true;}}};var dataURLs=popGeo.getDataURLs();var downloadCallbacks=[];var priorities=[];shape._webgl.downloadStartTimer=new Date().getTime();for(var i=0;i<dataURLs.length;++i){shape._nameSpace.doc.incrementDownloads();(function(idx){downloadCallbacks.push(function(data){shape._nameSpace.doc.decrementDownloads();return uploadDataToGPU(data,idx);});})(i);priorities.push(i);}\nx3dom.DownloadManager.get(dataURLs,downloadCallbacks,priorities);};x3dom.BinaryContainerLoader.setupImgGeo=function(shape,sp,gl,viewarea,currContext)\n{if(this.outOfMemory){return;}\nvar imageGeometry=shape._cf.geometry.node;if(imageGeometry.getIndexTexture()){shape._webgl.imageGeometry=1;}else{shape._webgl.imageGeometry=-1;}\nimageGeometry.unsetGeoDirty();if(currContext.IG_PositionBuffer==null){currContext.IG_PositionBuffer=gl.createBuffer();}\nshape._webgl.buffers[x3dom.BUFFER_IDX.POSITION]=currContext.IG_PositionBuffer;gl.bindBuffer(gl.ARRAY_BUFFER,currContext.IG_PositionBuffer);var vertices=new Float32Array(shape._webgl.positions[0]);gl.bufferData(gl.ARRAY_BUFFER,vertices,gl.STATIC_DRAW);gl.bindBuffer(gl.ARRAY_BUFFER,currContext.IG_PositionBuffer);gl.vertexAttribPointer(sp.position,imageGeometry._mesh._numPosComponents,shape._webgl.coordType,false,shape._coordStrideOffset[0],shape._coordStrideOffset[1]);gl.enableVertexAttribArray(sp.position);vertices=null;this.checkError(gl);};x3dom.BinaryContainerLoader.bufferGeoCache={};x3dom.BinaryContainerLoader.setupBufferGeo=function(shape,sp,gl,viewarea,currContext)\n{var URL;var isDataURL=false;var bufferGeo=shape._cf.geometry.node;var idxAccessor=null;var posAccessor=null;var needNormalComputation=true;shape._webgl.bufferGeometry=(bufferGeo._indexed)?1:-1;bufferGeo._mesh._numCoords=bufferGeo._vf.vertexCount[0];bufferGeo._mesh._numFaces=bufferGeo._vf.vertexCount[0]/3;var initAccessors=function()\n{var accessors=bufferGeo._cf.accessors.nodes;for(var i=0;i<accessors.length;i++)\n{var accessor=accessors[i];var byteOffset=accessor._vf.byteOffset;var byteStride=accessor._vf.byteStride;var bufferType=accessor._vf.bufferType;var components=accessor._vf.components;var componentType=accessor._vf.componentType;var normalized=accessor._vf.normalized;var view=accessor._vf.view;switch(bufferType)\n{case\"INDEX\":idxAccessor=accessor;shape._webgl.indexType=componentType;shape._indexOffset=byteOffset;break;case\"POSITION\":posAccessor=accessor;shape._coordStrideOffset=[byteStride,byteOffset];shape._webgl.coordType=componentType;shape._webgl.coordNormalized=normalized;bufferGeo._mesh._numPosComponents=components;break;case\"NORMAL\":needNormalComputation=false;shape._normalStrideOffset=[byteStride,byteOffset];shape._webgl.normalType=componentType;shape._webgl.normalNormalized=normalized;bufferGeo._mesh._numNormComponents=components;break;case\"TEXCOORD_0\":case\"TEXCOORD\":shape._texCoordStrideOffset=[byteStride,byteOffset];shape._webgl.texCoordType=componentType;shape._webgl.texCoordNormalized=normalized;bufferGeo._mesh._numTexComponents=components;break;case\"TEXCOORD_1\":shape._texCoord2StrideOffset=[byteStride,byteOffset];shape._webgl.texCoord2Type=componentType;shape._webgl.texCoord2Normalized=normalized;bufferGeo._mesh._numTex2Components=components;break;case\"COLOR\":case\"COLOR_0\":shape._colorStrideOffset=[byteStride,byteOffset];shape._webgl.colorType=componentType;shape._webgl.colorNormalized=normalized;bufferGeo._mesh._numColComponents=components;break;case\"TANGENT\":shape._tangentStrideOffset=[byteStride,byteOffset];shape._webgl.tangentType=componentType;shape._webgl.tangentNormalized=normalized;bufferGeo._mesh._numTangentComponents=components;break;case\"BITANGENT\":shape._binormalStrideOffset=[byteStride,byteOffset];shape._webgl.binormalType=componentType;shape._webgl.binormalNormalized=normalized;bufferGeo._mesh._numBinormalComponents=components;break;}\nvar bufferIdx=x3dom.BUFFER_IDX[accessor._vf.bufferType];var bufferViewID=bufferGeo._cf.views.nodes[view]._vf.id;shape._webgl.buffers[bufferIdx]=x3dom.BinaryContainerLoader.bufferGeoCache[URL].buffers[bufferViewID];}}\nvar initBufferViews=function(arraybuffer)\n{var views=bufferGeo._cf.views.nodes;for(var i=0;i<views.length;i++)\n{var view=views[i];var bufferID=view._vf.id;var byteOffset=view._vf.byteOffset;var byteLength=view._vf.byteLength;if(x3dom.BinaryContainerLoader.bufferGeoCache[URL].buffers[bufferID]==undefined||!gl.isBuffer(x3dom.BinaryContainerLoader.bufferGeoCache[URL].buffers[bufferID]))\n{var bufferData=new Uint8Array(arraybuffer,byteOffset,byteLength);var buffer=gl.createBuffer();gl.bindBuffer(view._vf.target,buffer);gl.bufferData(view._vf.target,bufferData,gl.STATIC_DRAW);gl.bindBuffer(view._vf.target,null);x3dom.BinaryContainerLoader.bufferGeoCache[URL].buffers[bufferID]=buffer;}}};var getPositions=function(arraybuffer)\n{var positions\nif(posAccessor)\n{var posView=bufferGeo._cf.views.nodes[posAccessor._vf.view];var byteOffset=posAccessor._vf.byteOffset+posView._vf.byteOffset;var byteLength=posAccessor._vf.count*posAccessor._vf.components;positions=x3dom.BinaryContainerLoader.getArrayBufferFromType(posAccessor._vf.componentType,arraybuffer,byteOffset,byteLength);}\nreturn positions;};var getIndices=function(arraybuffer)\n{var indices;if(idxAccessor)\n{var idxView=bufferGeo._cf.views.nodes[idxAccessor._vf.view];var byteOffset=idxAccessor._vf.byteOffset+idxView._vf.byteOffset;var byteLength=idxAccessor._vf.count*idxAccessor._vf.components;indices=x3dom.BinaryContainerLoader.getArrayBufferFromType(idxAccessor._vf.componentType,arraybuffer,byteOffset,byteLength);}\nreturn indices;};var computeNormals=function(arraybuffer)\n{if(needNormalComputation==false)\n{return;}\nvar positions=getPositions(arraybuffer),indices=getIndices(arraybuffer),normals=new Float32Array(posAccessor._vf.count*3);var vA=new x3dom.fields.SFVec3f(),vB=new x3dom.fields.SFVec3f(),vC=new x3dom.fields.SFVec3f();var ab=new x3dom.fields.SFVec3f(),cb=new x3dom.fields.SFVec3f();if(indices)\n{var i0,i1,i2;for(var i=0;i<indices.length;i+=3)\n{i0=indices[i]*3;i1=indices[i+1]*3;i2=indices[i+2]*3;vA.set(positions[i0],positions[i0+1],positions[i0+2]);vB.set(positions[i1],positions[i1+1],positions[i1+2]);vC.set(positions[i2],positions[i2+1],positions[i2+2]);ab=ab.subtractVectors(vA,vB);cb=cb.subtractVectors(vC,vB);cb=cb.cross(ab);cb=cb.normalize();normals[i0]=normals[i1]=normals[i2]=cb.x;normals[i0+1]=normals[i1+1]=normals[i2+1]=cb.y;normals[i0+2]=normals[i1+2]=normals[i2+2]=cb.z;}}\nelse if(positions)\n{for(var i=0;i<positions.length;i+=9)\n{vA.set(positions[i],positions[i+1],positions[i+2]);vB.set(positions[i+3],positions[i+4],positions[i+5]);vC.set(positions[i+6],positions[i+7],positions[i+8]);ab=ab.subtractVectors(vA,vB);cb=cb.subtractVectors(vC,vB);cb=cb.cross(ab);cb=cb.normalize();normals[i]=normals[i+3]=normals[i+6]=cb.x;normals[i+1]=normals[i+4]=normals[i+7]=cb.y;normals[i+2]=normals[i+5]=normals[i+8]=cb.z;}}\nvar buffer=gl.createBuffer();gl.bindBuffer(34962,buffer);gl.bufferData(34962,normals,gl.STATIC_DRAW);gl.bindBuffer(34962,null);shape._webgl.buffers[x3dom.BUFFER_IDX.NORMAL]=buffer;shape._normalStrideOffset=[12,0];shape._webgl.normalType=5126;bufferGeo._mesh._numNormComponents=3;}\nif(bufferGeo._vf.buffer!=\"\")\n{URL=shape._nameSpace.getURL(bufferGeo._vf.buffer);if(x3dom.BinaryContainerLoader.bufferGeoCache[URL]==undefined)\n{shape._nameSpace.doc.incrementDownloads();x3dom.BinaryContainerLoader.bufferGeoCache[URL]={};x3dom.BinaryContainerLoader.bufferGeoCache[URL].buffers=[];x3dom.BinaryContainerLoader.bufferGeoCache[URL].decrementDownload=true;x3dom.BinaryContainerLoader.bufferGeoCache[URL].promise=new Promise(function(resolve,reject){var xhr=new XMLHttpRequest();xhr.open(\"GET\",URL);xhr.responseType=\"arraybuffer\";xhr.onload=function(e)\n{if(xhr.status!=200)\n{reject();}\nelse\n{resolve(xhr.response);}}\nxhr.onerror=function(e)\n{reject();}\nx3dom.RequestManager.addRequest(xhr);});}\nx3dom.BinaryContainerLoader.bufferGeoCache[URL].promise.then(function(arraybuffer){if(shape._webgl==undefined)\n{x3dom.BinaryContainerLoader.bufferGeoCache[URL]=undefined;return;}\ninitBufferViews(arraybuffer);initAccessors();computeNormals(arraybuffer);if(x3dom.BinaryContainerLoader.bufferGeoCache[URL].decrementDownload)\n{x3dom.BinaryContainerLoader.bufferGeoCache[URL].decrementDownload=false;shape._nameSpace.doc.decrementDownloads();shape._nameSpace.doc.needRender=true;}}).catch(function()\n{if(x3dom.BinaryContainerLoader.bufferGeoCache[URL].decrementDownload)\n{x3dom.BinaryContainerLoader.bufferGeoCache[URL].decrementDownload=false;shape._nameSpace.doc.decrementDownloads();}});}};x3dom.BinaryContainerLoader.setupBufferInterpolator=function(interpolator)\n{var getKeys=function(interpolator,accessor,arraybuffer)\n{var view=interpolator._cf.views.nodes[accessor._vf.view];var byteOffset=accessor._vf.byteOffset+view._vf.byteOffset;var byteLength=accessor._vf.count*accessor._vf.components;var componentType=accessor._vf.componentType;var data=x3dom.BinaryContainerLoader.getArrayBufferFromType(componentType,arraybuffer,byteOffset,byteLength);for(var i=0,n=data.length;i<n;i++)\n{data[i]=data[i]/interpolator._vf.duration}\nreturn new x3dom.fields.MFFloat(data);};var getKeyValues=function(interpolator,accessor,arraybuffer)\n{var view=interpolator._cf.views.nodes[accessor._vf.view];var byteOffset=accessor._vf.byteOffset+view._vf.byteOffset;var byteLength=accessor._vf.count*accessor._vf.components;var componentType=accessor._vf.componentType;var data=x3dom.BinaryContainerLoader.getArrayBufferFromType(componentType,arraybuffer,byteOffset,byteLength);return interpolator.keyValueFromAccessor(data,componentType);};var initAccessors=function(arraybuffer)\n{var key;var keyValue;var accessors=interpolator._cf.accessors.nodes;for(var i=0;i<accessors.length;i++)\n{var accessor=accessors[i];switch(accessor._vf.bufferType)\n{case\"SAMPLER_INPUT\":key=getKeys(interpolator,accessor,arraybuffer);break;case\"SAMPLER_OUTPUT\":keyValue=getKeyValues(interpolator,accessor,arraybuffer);break;}}\nif(interpolator._vf.interpolation===\"STEP\")\n{var stepKey=key.copy();var stepValue=keyValue.copy();for(var i=1,n=key.length;i<n;i++)\n{stepKey.splice(i*2,0,key[i]);}\nfor(var i=0,n=keyValue.length;i<n;i++)\n{stepValue.splice(i*2+1,0,keyValue[i]);}\nkey=stepKey;keyValue=stepValue;}\ninterpolator._vf.key=key;interpolator._vf.keyValue=keyValue;};var URL=interpolator._nameSpace.getURL(interpolator._vf.buffer);if(x3dom.BinaryContainerLoader.bufferGeoCache[URL]==undefined)\n{interpolator._nameSpace.doc.incrementDownloads();x3dom.BinaryContainerLoader.bufferGeoCache[URL]={};x3dom.BinaryContainerLoader.bufferGeoCache[URL].buffers=[];x3dom.BinaryContainerLoader.bufferGeoCache[URL].decrementDownload=true;x3dom.BinaryContainerLoader.bufferGeoCache[URL].promise=new Promise(function(resolve,reject){var xhr=new XMLHttpRequest();xhr.open(\"GET\",URL);xhr.responseType=\"arraybuffer\";xhr.onload=function(e)\n{if(xhr.status!=200)\n{reject();}\nelse\n{resolve(xhr.response);}}\nxhr.onerror=function(e)\n{reject();}\nx3dom.RequestManager.addRequest(xhr);});}\nx3dom.BinaryContainerLoader.bufferGeoCache[URL].promise.then(function(arraybuffer)\n{if(interpolator==undefined)\n{x3dom.BinaryContainerLoader.bufferGeoCache[URL]=undefined;return;}\ninitAccessors(arraybuffer);if(x3dom.BinaryContainerLoader.bufferGeoCache[URL].decrementDownload)\n{x3dom.BinaryContainerLoader.bufferGeoCache[URL].decrementDownload=false;interpolator._nameSpace.doc.decrementDownloads();interpolator._nameSpace.doc.needRender=true;}}).catch(function()\n{if(x3dom.BinaryContainerLoader.bufferGeoCache[URL].decrementDownload)\n{x3dom.BinaryContainerLoader.bufferGeoCache[URL].decrementDownload=false;interpolator._nameSpace.doc.decrementDownloads();}});};x3dom.BinaryContainerLoader.getArrayBufferFromType=function(componentType,arraybuffer,byteOffset,byteLength)\n{switch(componentType)\n{case 5120:return new Int8Array(arraybuffer,byteOffset,byteLength);case 5121:return new Uint8Array(arraybuffer,byteOffset,byteLength);case 5122:return new Int16Array(arraybuffer,byteOffset,byteLength);case 5123:return new Uint16Array(arraybuffer,byteOffset,byteLength);case 5125:return new Uint32Array(arraybuffer,byteOffset,byteLength);case 5126:return new Float32Array(arraybuffer,byteOffset,byteLength);}}\nx3dom.DrawableCollection=function(drawableCollectionConfig){this.collection=[];this.viewMatrix=drawableCollectionConfig.viewMatrix;this.projMatrix=drawableCollectionConfig.projMatrix;this.sceneMatrix=drawableCollectionConfig.sceneMatrix;this.viewarea=drawableCollectionConfig.viewArea;var scene=this.viewarea._scene;var env=scene.getEnvironment();var viewpoint=scene.getViewpoint();this.near=viewpoint.getNear();this.pixelHeightAtDistOne=viewpoint.getImgPlaneHeightAtDistOne()/this.viewarea._height;this.context=drawableCollectionConfig.context;this.gl=drawableCollectionConfig.gl;this.viewFrustum=this.viewarea.getViewfrustum(this.sceneMatrix);this.worldVol=new x3dom.fields.BoxVolume();this.frustumCulling=drawableCollectionConfig.frustumCulling&&(this.viewFrustum!=null);this.smallFeatureThreshold=drawableCollectionConfig.smallFeatureThreshold;this.sortOpaque=(this.smallFeatureThreshold>0&&env._lowPriorityThreshold<1);this.sortTrans=drawableCollectionConfig.sortTrans;this.prioLevels=10;this.maxTreshold=100;this.sortBySortKey=false;this.sortByPriority=false;this.numberOfNodes=0;this.length=0;};x3dom.DrawableCollection.prototype.cull=function(transform,graphState,singlePath,planeMask){var node=graphState.boundedNode;if(!node||!node._vf.render){return-1;}\nvar volume=node.getVolume();var MASK_SET=63;if(this.frustumCulling&&graphState.needCulling){var wvol;if(singlePath&&!graphState.worldVolume.isValid()){graphState.worldVolume.transformFrom(transform,volume);wvol=graphState.worldVolume;}\nelse if(planeMask<MASK_SET){this.worldVol.transformFrom(transform,volume);wvol=this.worldVol;}\nif(planeMask<MASK_SET)\nplaneMask=this.viewFrustum.intersect(wvol,planeMask);if(planeMask==-1)\n{return-1;}}\nelse{planeMask=MASK_SET;}\ngraphState.coverage=-1;if(this.smallFeatureThreshold>0||node.forceUpdateCoverage()){var modelViewMat=this.viewMatrix.mult(transform);graphState.center=modelViewMat.multMatrixPnt(volume.getCenter());var rVec=modelViewMat.multMatrixVec(volume.getRadialVec());var r=rVec.length();var dist=Math.max(-graphState.center.z-r,this.near);var projPixelLength=dist*this.pixelHeightAtDistOne;graphState.coverage=(r*2.0)/projPixelLength;if(this.smallFeatureThreshold>0&&graphState.coverage<this.smallFeatureThreshold&&graphState.needCulling){return-1;}}\nthis.numberOfNodes++;return planeMask;};x3dom.DrawableCollection.prototype.addShape=function(shape,transform,graphState){var drawable={};drawable.shape=shape;drawable.transform=transform;drawable.localTransform=graphState.localMatrix;drawable.localVolume=graphState.volume;drawable.worldVolume=x3dom.fields.BoxVolume.copy(graphState.worldVolume);drawable.priority=Math.max(0,graphState.coverage);drawable.shaderID=shape.getShaderProperties(this.viewarea).id;var appearance=shape._cf.appearance.node;drawable.sortType=appearance?appearance._vf.sortType.toLowerCase():\"opaque\";drawable.sortKey=appearance?appearance._vf.sortKey:0;if(drawable.sortType=='transparent'){if(this.smallFeatureThreshold>0){drawable.zPos=graphState.center.z;}\nelse{var center=transform.multMatrixPnt(shape.getCenter());center=this.viewMatrix.multMatrixPnt(center);drawable.zPos=center.z;}}\nif(!this.sortBySortKey&&drawable.sortKey!=0){this.sortBySortKey=true;}\nif(this.collection[drawable.sortType]===undefined){this.collection[drawable.sortType]=[];}\nthis.collection[drawable.sortType].push(drawable);this.length++;if(this.context&&this.gl){this.context.setupShape(this.gl,drawable,this.viewarea);}};x3dom.DrawableCollection.prototype.addDrawable=function(drawable){drawable.shaderID=drawable.shape.getShaderProperties(this.viewarea).id;var appearance=drawable.shape._cf.appearance.node;drawable.sortType=appearance?appearance._vf.sortType.toLowerCase():\"opaque\";drawable.sortKey=appearance?appearance._vf.sortKey:0;if(drawable.sortType=='transparent'){var center=drawable.transform.multMatrixPnt(drawable.shape.getCenter());center=this.viewMatrix.multMatrixPnt(center);drawable.zPos=center.z;}\nif(!this.sortBySortKey&&drawable.sortKey!=0){this.sortBySortKey=true;}\nif(this.collection[drawable.sortType]===undefined){this.collection[drawable.sortType]=[];}\nthis.collection[drawable.sortType].push(drawable);this.length++;if(this.context&&this.gl){this.context.setupShape(this.gl,drawable,this.viewarea);}};x3dom.DrawableCollection.prototype.calculatePriority=function(graphState){var priority=Math.max(0,graphState.coverage);var pl=this.prioLevels-1;priority=Math.min(Math.round(priority/(this.maxTreshold/pl)),pl);return priority;};x3dom.DrawableCollection.prototype.concat=function(){var opaque=(this.collection['opaque']!==undefined)?this.collection['opaque']:[];var transparent=(this.collection['transparent']!==undefined)?this.collection['transparent']:[];this.collection=opaque.concat(transparent);};x3dom.DrawableCollection.prototype.get=function(idx){return this.collection[idx];};x3dom.DrawableCollection.prototype.sort=function(){var opaque=[];var transparent=[];var that=this;if(this.collection['opaque']!==undefined){if(this.sortOpaque){this.collection['opaque'].sort(function(a,b){if(a.sortKey==b.sortKey||!that.sortBySortKey){return b.priority-a.priority;}\nreturn a.sortKey-b.sortKey;});}\nopaque=this.collection['opaque'];}\nif(this.collection['transparent']!==undefined){if(this.sortTrans){this.collection['transparent'].sort(function(a,b){if(a.sortKey==b.sortKey||!that.sortBySortKey){if(a.priority==b.priority||!that.sortByPriority){return a.zPos-b.zPos;}\nreturn b.priority-a.priority;}\nreturn a.sortKey-b.sortKey;});}\ntransparent=this.collection['transparent'];}\nthis.collection=opaque.concat(transparent);};x3dom.DrawableCollection.prototype.forEach=function(fnc,maxPriority){maxPriority=(maxPriority!==undefined)?Math.min(maxPriority,this.prioLevels):this.prioLevels;var sortKey,priority,shaderID,drawable;for(sortKey=0;sortKey<this.collection['opaque'].length;++sortKey)\n{if(this.collection['opaque'][sortKey]!==undefined)\n{for(priority=this.collection['opaque'][sortKey].length;priority>0;--priority)\n{if(this.collection['opaque'][sortKey][priority]!==undefined)\n{for(shaderID in this.collection['opaque'][sortKey][priority])\n{for(drawable=0;drawable<this.collection['opaque'][sortKey][priority][shaderID].length;++drawable)\n{fnc(this.collection['opaque'][sortKey][priority][shaderID][drawable]);}}}}}}\nfor(sortKey=0;sortKey<this.collection['transparent'].length;++sortKey)\n{if(this.collection['transparent'][sortKey]!==undefined)\n{for(priority=this.collection['transparent'][sortKey].length;priority>0;--priority)\n{if(this.collection['transparent'][sortKey][priority]!==undefined)\n{for(var shaderId in this.collection['transparent'][sortKey][priority])\n{this.collection['transparent'][sortKey][priority][shaderId].sort(function(a,b){return a.zPos-b.zPos});for(drawable=0;drawable<this.collection['transparent'][sortKey][priority][shaderId].length;++drawable)\n{fnc(this.collection['transparent'][sortKey][priority][shaderId][drawable]);}}}}}}};x3dom.Moveable=function(x3domElem,boundedObj,callback,gridSize,mode){this._x3domRoot=x3domElem;this._runtime=x3domElem.runtime;this._callback=callback;this._gridSize=gridSize?gridSize:0;this._moveable=boundedObj;this._drag=false;this._w=0;this._h=0;this._uPlane=null;this._vPlane=null;this._pPlane=null;this._isect=null;this._translationOffset=null;this._rotationOffset=null;this._scaleOffset=null;this._lastX=0;this._lastY=0;this._buttonState=0;this._mode=(mode&&mode.length)?mode.toLowerCase():\"translation\";this._firstRay=null;this._matrixTrafo=null;this._navType=\"examine\";this.attachHandlers();};x3dom.Moveable.prototype.setGridSize=function(gridSize){this._gridSize=gridSize;};x3dom.Moveable.prototype.setMode=function(mode){this._mode=mode.toLowerCase();};x3dom.Moveable.prototype.attachHandlers=function(){this._moveable._iMove=this;if(!this._x3domRoot._iMove)\nthis._x3domRoot._iMove=[];this._x3domRoot._iMove.push(this);this._moveable.addEventListener('mousedown',this.start,false);this._moveable.addEventListener('mouseover',this.over,false);this._moveable.addEventListener('mouseout',this.out,false);if(this._x3domRoot._iMove.length==1){this._x3domRoot.addEventListener('mouseup',this.stop,false);this._x3domRoot.addEventListener('mouseout',this.stop,false);this._x3domRoot.addEventListener('mousemove',this.move,true);if(!this._runtime.canvas.disableTouch){this._x3domRoot.addEventListener('MozTouchDown',this.touchStartHandlerMoz,false);this._x3domRoot.addEventListener('MozTouchMove',this.touchMoveHandlerMoz,true);this._x3domRoot.addEventListener('MozTouchUp',this.touchEndHandlerMoz,false);this._x3domRoot.addEventListener('touchstart',this.touchStartHandler,false);this._x3domRoot.addEventListener('touchmove',this.touchMoveHandler,true);this._x3domRoot.addEventListener('touchend',this.touchEndHandler,false);}}};x3dom.Moveable.prototype.detachHandlers=function(){var iMove=this._x3domRoot._iMove;if(iMove){for(var i=0,n=iMove.length;i<n;i++){if(iMove[i]==this){iMove.splice(i,1);break;}}}\nthis._moveable.removeEventListener('mousedown',this.start,false);this._moveable.removeEventListener('mouseover',this.over,false);this._moveable.removeEventListener('mouseout',this.out,false);if(iMove.length==0){this._x3domRoot.removeEventListener('mouseup',this.stop,false);this._x3domRoot.removeEventListener('mouseout',this.stop,false);this._x3domRoot.removeEventListener('mousemove',this.move,true);if(!this._runtime.canvas.disableTouch){this._x3domRoot.removeEventListener('MozTouchDown',this.touchStartHandlerMoz,false);this._x3domRoot.removeEventListener('MozTouchMove',this.touchMoveHandlerMoz,true);this._x3domRoot.removeEventListener('MozTouchUp',this.touchEndHandlerMoz,false);this._x3domRoot.removeEventListener('touchstart',this.touchStartHandler,false);this._x3domRoot.removeEventListener('touchmove',this.touchMoveHandler,true);this._x3domRoot.removeEventListener('touchend',this.touchEndHandler,false);}}\nif(this._moveable._iMove)\ndelete this._moveable._iMove;};x3dom.Moveable.prototype.calcViewPlane=function(origin){this._w=this._runtime.getWidth();this._h=this._runtime.getHeight();var ray=this._runtime.getViewingRay(0,this._h-1);var r=ray.pos.add(ray.dir);ray=this._runtime.getViewingRay(this._w-1,this._h-1);var s=ray.pos.add(ray.dir);ray=this._runtime.getViewingRay(0,0);var t=ray.pos.add(ray.dir);this._uPlane=s.subtract(r).normalize();this._vPlane=t.subtract(r).normalize();if(arguments.length===0)\nthis._pPlane=r;else\nthis._pPlane=x3dom.fields.SFVec3f.copy(origin);};x3dom.Moveable.prototype.det=function(mat){return mat[0][0]*mat[1][1]*mat[2][2]+mat[0][1]*mat[1][2]*mat[2][0]+\nmat[0][2]*mat[2][1]*mat[1][0]-mat[2][0]*mat[1][1]*mat[0][2]-\nmat[0][0]*mat[2][1]*mat[1][2]-mat[1][0]*mat[0][1]*mat[2][2];};x3dom.Moveable.prototype.translateXY=function(l){var track=null;var z=[],n=[];for(var i=0;i<3;i++){z[i]=[];n[i]=[];z[i][0]=this._uPlane.at(i);n[i][0]=z[i][0];z[i][1]=this._vPlane.at(i);n[i][1]=z[i][1];z[i][2]=(l.pos.subtract(this._pPlane)).at(i);n[i][2]=-l.dir.at(i);}\nvar s=this.det(n);if(s!==0){var t=this.det(z)/s;track=l.pos.addScaled(l.dir,t);}\nif(track){if(this._isect){track=track.subtract(this._isect);}\ntrack=track.add(this._translationOffset);}\nreturn track;};x3dom.Moveable.prototype.translateZ=function(l,currY){var vol=this._runtime.getSceneBBox();var sign=(currY<this._lastY)?1:-1;var fact=sign*(vol.max.subtract(vol.min)).length()/100;this._translationOffset=this._translationOffset.addScaled(l.dir,fact);return this._translationOffset;};x3dom.Moveable.prototype.rotate=function(posX,posY){var twoPi=2*Math.PI;var alpha=((posY-this._lastY)*twoPi)/this._w;var beta=((posX-this._lastX)*twoPi)/this._h;var q=x3dom.fields.Quaternion.axisAngle(this._uPlane,alpha);var h=q.toMatrix();this._rotationOffset=h.mult(this._rotationOffset);q=x3dom.fields.Quaternion.axisAngle(this._vPlane,beta);h=q.toMatrix();this._rotationOffset=h.mult(this._rotationOffset);var mat=this._rotationOffset.mult(x3dom.fields.SFMatrix4f.scale(this._scaleOffset));var rot=new x3dom.fields.Quaternion(0,0,1,0);rot.setValue(mat);return rot;};x3dom.Moveable.prototype.over=function(event){var that=this._iMove;that._runtime.getCanvas().style.cursor=\"crosshair\";};x3dom.Moveable.prototype.out=function(event){var that=this._iMove;if(!that._drag)\nthat._runtime.getCanvas().style.cursor=\"pointer\";};x3dom.Moveable.prototype.start=function(event){var that=this._iMove;switch(that._mode){case\"translation\":that._buttonState=(event.button==4)?1:(event.button&3);break;case\"rotation\":that._buttonState=4;break;case\"all\":default:that._buttonState=event.button;break;}\nif(!that._drag&&that._buttonState){that._lastX=event.layerX;that._lastY=event.layerY;that._drag=true;that._navType=that._runtime.navigationType();that._runtime.noNav();that._isect=new x3dom.fields.SFVec3f(event.worldX,event.worldY,event.worldZ);that.calcViewPlane(that._isect);that._firstRay=that._runtime.getViewingRay(event.layerX,event.layerY);var mTrans=that._moveable.getAttribute(\"translation\");that._matrixTrafo=null;if(mTrans){that._translationOffset=x3dom.fields.SFVec3f.parse(mTrans);var mRot=that._moveable.getAttribute(\"rotation\");mRot=mRot?x3dom.fields.Quaternion.parseAxisAngle(mRot):new x3dom.fields.Quaternion(0,0,1,0);that._rotationOffset=mRot.toMatrix();var mScal=that._moveable.getAttribute(\"scale\");that._scaleOffset=mScal?x3dom.fields.SFVec3f.parse(mScal):new x3dom.fields.SFVec3f(1,1,1);}\nelse{mTrans=that._moveable.getAttribute(\"matrix\");if(mTrans){that._matrixTrafo=x3dom.fields.SFMatrix4f.parse(mTrans).transpose();var translation=new x3dom.fields.SFVec3f(0,0,0),scaleFactor=new x3dom.fields.SFVec3f(1,1,1);var rotation=new x3dom.fields.Quaternion(0,0,1,0),scaleOrientation=new x3dom.fields.Quaternion(0,0,1,0);that._matrixTrafo.getTransform(translation,rotation,scaleFactor,scaleOrientation);that._translationOffset=translation;that._rotationOffset=rotation.toMatrix();that._scaleOffset=scaleFactor;}\nelse{that._translationOffset=new x3dom.fields.SFVec3f(0,0,0);that._rotationOffset=new x3dom.fields.SFMatrix4f();that._scaleOffset=new x3dom.fields.SFVec3f(1,1,1);}}\nthat._runtime.getCanvas().style.cursor=\"crosshair\";}};x3dom.Moveable.prototype.move=function(event){for(var i=0,n=this._iMove.length;i<n;i++){var that=this._iMove[i];if(that._drag){var pos=that._runtime.mousePosition(event);var ray=that._runtime.getViewingRay(pos[0],pos[1]);var track=null;if(that._buttonState==2)\ntrack=that.translateZ(that._firstRay,pos[1]);else if(that._buttonState==1)\ntrack=that.translateXY(ray);else\ntrack=that.rotate(pos[0],pos[1]);if(track){if(that._gridSize>0&&that._buttonState!=4){var x=that._gridSize*Math.round(track.x/that._gridSize);var y=that._gridSize*Math.round(track.y/that._gridSize);var z=that._gridSize*Math.round(track.z/that._gridSize);track=new x3dom.fields.SFVec3f(x,y,z);}\nif(!that._matrixTrafo){if(that._buttonState==4){that._moveable.setAttribute(\"rotation\",track.toAxisAngle().toString());}\nelse{that._moveable.setAttribute(\"translation\",track.toString());}}\nelse{if(that._buttonState==4){that._matrixTrafo.setRotate(track);}\nelse{that._matrixTrafo.setTranslate(track);}\nthat._moveable.setAttribute(\"matrix\",that._matrixTrafo.toGL().toString());}\nif(that._callback){that._callback(that._moveable,track);}}\nthat._lastX=pos[0];that._lastY=pos[1];}}};x3dom.Moveable.prototype.stop=function(event){for(var i=0,n=this._iMove.length;i<n;i++){var that=this._iMove[i];if(that._drag){that._lastX=event.layerX;that._lastY=event.layerY;that._isect=null;that._drag=false;var navi=that._runtime.canvas.doc._scene.getNavigationInfo();navi.setType(that._navType);that._runtime.getCanvas().style.cursor=\"pointer\";}}};x3dom.Moveable.prototype.touchStartHandler=function(evt){evt.preventDefault();};x3dom.Moveable.prototype.touchStartHandlerMoz=function(evt){evt.preventDefault();};x3dom.Moveable.prototype.touchMoveHandler=function(evt){evt.preventDefault();};x3dom.Moveable.prototype.touchMoveHandlerMoz=function(evt){evt.preventDefault();};x3dom.Moveable.prototype.touchEndHandler=function(evt){if(this._iMove.length){var that=this._iMove[0];that.stop.apply(that._x3domRoot,[evt]);}\nevt.preventDefault();};x3dom.Moveable.prototype.touchEndHandlerMoz=function(evt){if(this._iMove.length){var that=this._iMove[0];that.stop.apply(that._x3domRoot,[evt]);}\nevt.preventDefault();};(function(){'use strict';function q(b){throw b;}var t=void 0,u=!0,aa=this;function A(b,a){var c=b.split(\".\"),d=aa;!(c[0]in d)&&d.execScript&&d.execScript(\"var \"+c[0]);for(var e;c.length&&(e=c.shift());)!c.length&&a!==t?d[e]=a:d=d[e]?d[e]:d[e]={}};var B=\"undefined\"!==typeof Uint8Array&&\"undefined\"!==typeof Uint16Array&&\"undefined\"!==typeof Uint32Array&&\"undefined\"!==typeof DataView;function F(b,a){this.index=\"number\"===typeof a?a:0;this.m=0;this.buffer=b instanceof(B?Uint8Array:Array)?b:new(B?Uint8Array:Array)(32768);2*this.buffer.length<=this.index&&q(Error(\"invalid index\"));this.buffer.length<=this.index&&this.f()}F.prototype.f=function(){var b=this.buffer,a,c=b.length,d=new(B?Uint8Array:Array)(c<<1);if(B)d.set(b);else for(a=0;a<c;++a)d[a]=b[a];return this.buffer=d};F.prototype.d=function(b,a,c){var d=this.buffer,e=this.index,f=this.m,g=d[e],k;c&&1<a&&(b=8<a?(H[b&255]<<24|H[b>>>8&255]<<16|H[b>>>16&255]<<8|H[b>>>24&255])>>32-a:H[b]>>8-a);if(8>a+f)g=g<<a|b,f+=a;else for(k=0;k<a;++k)g=g<<1|b>>a-k-1&1,8===++f&&(f=0,d[e++]=H[g],g=0,e===d.length&&(d=this.f()));d[e]=g;this.buffer=d;this.m=f;this.index=e};F.prototype.finish=function(){var b=this.buffer,a=this.index,c;0<this.m&&(b[a]<<=8-this.m,b[a]=H[b[a]],a++);B?c=b.subarray(0,a):(b.length=a,c=b);return c};var ba=new(B?Uint8Array:Array)(256),ca;for(ca=0;256>ca;++ca){for(var K=ca,da=K,ea=7,K=K>>>1;K;K>>>=1)da<<=1,da|=K&1,--ea;ba[ca]=(da<<ea&255)>>>0}var H=ba;function ja(b,a,c){var d,e=\"number\"===typeof a?a:a=0,f=\"number\"===typeof c?c:b.length;d=-1;for(e=f&7;e--;++a)d=d>>>8^O[(d^b[a])&255];for(e=f>>3;e--;a+=8)d=d>>>8^O[(d^b[a])&255],d=d>>>8^O[(d^b[a+1])&255],d=d>>>8^O[(d^b[a+2])&255],d=d>>>8^O[(d^b[a+3])&255],d=d>>>8^O[(d^b[a+4])&255],d=d>>>8^O[(d^b[a+5])&255],d=d>>>8^O[(d^b[a+6])&255],d=d>>>8^O[(d^b[a+7])&255];return(d^4294967295)>>>0}\nvar ka=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918E3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],O=B?new Uint32Array(ka):ka;function P(){}P.prototype.getName=function(){return this.name};P.prototype.getData=function(){return this.data};P.prototype.Y=function(){return this.Z};A(\"Zlib.GunzipMember\",P);A(\"Zlib.GunzipMember.prototype.getName\",P.prototype.getName);A(\"Zlib.GunzipMember.prototype.getData\",P.prototype.getData);A(\"Zlib.GunzipMember.prototype.getMtime\",P.prototype.Y);function la(b){this.buffer=new(B?Uint16Array:Array)(2*b);this.length=0}la.prototype.getParent=function(b){return 2*((b-2)/4|0)};la.prototype.push=function(b,a){var c,d,e=this.buffer,f;c=this.length;e[this.length++]=a;for(e[this.length++]=b;0<c;)if(d=this.getParent(c),e[c]>e[d])f=e[c],e[c]=e[d],e[d]=f,f=e[c+1],e[c+1]=e[d+1],e[d+1]=f,c=d;else break;return this.length};la.prototype.pop=function(){var b,a,c=this.buffer,d,e,f;a=c[0];b=c[1];this.length-=2;c[0]=c[this.length];c[1]=c[this.length+1];for(f=0;;){e=2*f+2;if(e>=this.length)break;e+2<this.length&&c[e+2]>c[e]&&(e+=2);if(c[e]>c[f])d=c[f],c[f]=c[e],c[e]=d,d=c[f+1],c[f+1]=c[e+1],c[e+1]=d;else break;f=e}return{index:b,value:a,length:this.length}};function ma(b){var a=b.length,c=0,d=Number.POSITIVE_INFINITY,e,f,g,k,h,l,s,p,m,n;for(p=0;p<a;++p)b[p]>c&&(c=b[p]),b[p]<d&&(d=b[p]);e=1<<c;f=new(B?Uint32Array:Array)(e);g=1;k=0;for(h=2;g<=c;){for(p=0;p<a;++p)if(b[p]===g){l=0;s=k;for(m=0;m<g;++m)l=l<<1|s&1,s>>=1;n=g<<16|p;for(m=l;m<e;m+=h)f[m]=n;++k}++g;k<<=1;h<<=1}return[f,c,d]};function na(b,a){this.k=qa;this.I=0;this.input=B&&b instanceof Array?new Uint8Array(b):b;this.b=0;a&&(a.lazy&&(this.I=a.lazy),\"number\"===typeof a.compressionType&&(this.k=a.compressionType),a.outputBuffer&&(this.a=B&&a.outputBuffer instanceof Array?new Uint8Array(a.outputBuffer):a.outputBuffer),\"number\"===typeof a.outputIndex&&(this.b=a.outputIndex));this.a||(this.a=new(B?Uint8Array:Array)(32768))}var qa=2,ra={NONE:0,v:1,o:qa,ba:3},sa=[],S;for(S=0;288>S;S++)switch(u){case 143>=S:sa.push([S+48,8]);break;case 255>=S:sa.push([S-144+400,9]);break;case 279>=S:sa.push([S-256+0,7]);break;case 287>=S:sa.push([S-280+192,8]);break;default:q(\"invalid literal: \"+S)}\nna.prototype.g=function(){var b,a,c,d,e=this.input;switch(this.k){case 0:c=0;for(d=e.length;c<d;){a=B?e.subarray(c,c+65535):e.slice(c,c+65535);c+=a.length;var f=a,g=c===d,k=t,h=t,l=t,s=t,p=t,m=this.a,n=this.b;if(B){for(m=new Uint8Array(this.a.buffer);m.length<=n+f.length+5;)m=new Uint8Array(m.length<<1);m.set(this.a)}k=g?1:0;m[n++]=k|0;h=f.length;l=~h+65536&65535;m[n++]=h&255;m[n++]=h>>>8&255;m[n++]=l&255;m[n++]=l>>>8&255;if(B)m.set(f,n),n+=f.length,m=m.subarray(0,n);else{s=0;for(p=f.length;s<p;++s)m[n++]=f[s];m.length=n}this.b=n;this.a=m}break;case 1:var r=new F(B?new Uint8Array(this.a.buffer):this.a,this.b);r.d(1,1,u);r.d(1,2,u);var v=ta(this,e),x,Q,y;x=0;for(Q=v.length;x<Q;x++)if(y=v[x],F.prototype.d.apply(r,sa[y]),256<y)r.d(v[++x],v[++x],u),r.d(v[++x],5),r.d(v[++x],v[++x],u);else if(256===y)break;this.a=r.finish();this.b=this.a.length;break;case qa:var E=new F(B?new Uint8Array(this.a.buffer):this.a,this.b),Ka,R,X,Y,Z,pb=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],fa,La,ga,Ma,oa,wa=Array(19),Na,$,pa,C,Oa;Ka=qa;E.d(1,1,u);E.d(Ka,2,u);R=ta(this,e);fa=ua(this.W,15);La=va(fa);ga=ua(this.V,7);Ma=va(ga);for(X=286;257<X&&0===fa[X-1];X--);for(Y=30;1<Y&&0===ga[Y-1];Y--);var Pa=X,Qa=Y,J=new(B?Uint32Array:Array)(Pa+Qa),w,L,z,ha,I=new(B?Uint32Array:Array)(316),G,D,M=new(B?Uint8Array:Array)(19);for(w=L=0;w<Pa;w++)J[L++]=fa[w];for(w=0;w<Qa;w++)J[L++]=ga[w];if(!B){w=0;for(ha=M.length;w<ha;++w)M[w]=0}w=G=0;for(ha=J.length;w<ha;w+=L){for(L=1;w+L<ha&&J[w+L]===J[w];++L);z=L;if(0===J[w])if(3>z)for(;0<z--;)I[G++]=0,M[0]++;else for(;0<z;)D=138>z?z:138,D>z-3&&D<z&&(D=z-3),10>=D?(I[G++]=17,I[G++]=D-3,M[17]++):(I[G++]=18,I[G++]=D-11,M[18]++),z-=D;else if(I[G++]=J[w],M[J[w]]++,z--,3>z)for(;0<z--;)I[G++]=J[w],M[J[w]]++;else for(;0<z;)D=6>z?z:6,D>z-3&&D<z&&(D=z-3),I[G++]=16,I[G++]=D-3,M[16]++,z-=D}b=B?I.subarray(0,G):I.slice(0,G);oa=ua(M,7);for(C=0;19>C;C++)wa[C]=oa[pb[C]];for(Z=19;4<Z&&0===wa[Z-1];Z--);Na=va(oa);E.d(X-257,5,u);E.d(Y-1,5,u);E.d(Z-4,4,u);for(C=0;C<Z;C++)E.d(wa[C],3,u);C=0;for(Oa=b.length;C<Oa;C++)if($=b[C],E.d(Na[$],oa[$],u),16<=$){C++;switch($){case 16:pa=2;break;case 17:pa=3;break;case 18:pa=7;break;default:q(\"invalid code: \"+$)}E.d(b[C],pa,u)}var Ra=[La,fa],Sa=[Ma,ga],N,Ta,ia,za,Ua,Va,Wa,Xa;Ua=Ra[0];Va=Ra[1];Wa=Sa[0];Xa=Sa[1];N=0;for(Ta=R.length;N<Ta;++N)if(ia=R[N],E.d(Ua[ia],Va[ia],u),256<ia)E.d(R[++N],R[++N],u),za=R[++N],E.d(Wa[za],Xa[za],u),E.d(R[++N],R[++N],u);else if(256===ia)break;this.a=E.finish();this.b=this.a.length;break;default:q(\"invalid compression type\")}return this.a};function xa(b,a){this.length=b;this.Q=a}\nvar ya=function(){function b(a){switch(u){case 3===a:return[257,a-3,0];case 4===a:return[258,a-4,0];case 5===a:return[259,a-5,0];case 6===a:return[260,a-6,0];case 7===a:return[261,a-7,0];case 8===a:return[262,a-8,0];case 9===a:return[263,a-9,0];case 10===a:return[264,a-10,0];case 12>=a:return[265,a-11,1];case 14>=a:return[266,a-13,1];case 16>=a:return[267,a-15,1];case 18>=a:return[268,a-17,1];case 22>=a:return[269,a-19,2];case 26>=a:return[270,a-23,2];case 30>=a:return[271,a-27,2];case 34>=a:return[272,a-31,2];case 42>=a:return[273,a-35,3];case 50>=a:return[274,a-43,3];case 58>=a:return[275,a-51,3];case 66>=a:return[276,a-59,3];case 82>=a:return[277,a-67,4];case 98>=a:return[278,a-83,4];case 114>=a:return[279,a-99,4];case 130>=a:return[280,a-115,4];case 162>=a:return[281,a-131,5];case 194>=a:return[282,a-163,5];case 226>=a:return[283,a-195,5];case 257>=a:return[284,a-227,5];case 258===a:return[285,a-258,0];default:q(\"invalid length: \"+a)}}var a=[],c,d;for(c=3;258>=c;c++)d=b(c),a[c]=d[2]<<24|d[1]<<16|d[0];return a}(),Aa=B?new Uint32Array(ya):ya;function ta(b,a){function c(a,c){var b=a.Q,d=[],e=0,f;f=Aa[a.length];d[e++]=f&65535;d[e++]=f>>16&255;d[e++]=f>>24;var g;switch(u){case 1===b:g=[0,b-1,0];break;case 2===b:g=[1,b-2,0];break;case 3===b:g=[2,b-3,0];break;case 4===b:g=[3,b-4,0];break;case 6>=b:g=[4,b-5,1];break;case 8>=b:g=[5,b-7,1];break;case 12>=b:g=[6,b-9,2];break;case 16>=b:g=[7,b-13,2];break;case 24>=b:g=[8,b-17,3];break;case 32>=b:g=[9,b-25,3];break;case 48>=b:g=[10,b-33,4];break;case 64>=b:g=[11,b-49,4];break;case 96>=b:g=[12,b-\n65,5];break;case 128>=b:g=[13,b-97,5];break;case 192>=b:g=[14,b-129,6];break;case 256>=b:g=[15,b-193,6];break;case 384>=b:g=[16,b-257,7];break;case 512>=b:g=[17,b-385,7];break;case 768>=b:g=[18,b-513,8];break;case 1024>=b:g=[19,b-769,8];break;case 1536>=b:g=[20,b-1025,9];break;case 2048>=b:g=[21,b-1537,9];break;case 3072>=b:g=[22,b-2049,10];break;case 4096>=b:g=[23,b-3073,10];break;case 6144>=b:g=[24,b-4097,11];break;case 8192>=b:g=[25,b-6145,11];break;case 12288>=b:g=[26,b-8193,12];break;case 16384>=b:g=[27,b-12289,12];break;case 24576>=b:g=[28,b-16385,13];break;case 32768>=b:g=[29,b-24577,13];break;default:q(\"invalid distance\")}f=g;d[e++]=f[0];d[e++]=f[1];d[e++]=f[2];var h,k;h=0;for(k=d.length;h<k;++h)m[n++]=d[h];v[d[0]]++;x[d[3]]++;r=a.length+c-1;p=null}var d,e,f,g,k,h={},l,s,p,m=B?new Uint16Array(2*a.length):[],n=0,r=0,v=new(B?Uint32Array:Array)(286),x=new(B?Uint32Array:Array)(30),Q=b.I,y;if(!B){for(f=0;285>=f;)v[f++]=0;for(f=0;29>=f;)x[f++]=0}v[256]=1;d=0;for(e=a.length;d<e;++d){f=k=0;for(g=3;f<g&&d+f!==e;++f)k=k<<8|a[d+f];h[k]===t&&(h[k]=[]);l=h[k];if(!(0<r--)){for(;0<l.length&&32768<d-l[0];)l.shift();if(d+3>=e){p&&c(p,-1);f=0;for(g=e-d;f<g;++f)y=a[d+f],m[n++]=y,++v[y];break}0<l.length?(s=Ba(a,d,l),p?p.length<s.length?(y=a[d-1],m[n++]=y,++v[y],c(s,0)):c(p,-1):s.length<Q?p=s:c(s,0)):p?c(p,-1):(y=a[d],m[n++]=y,++v[y])}l.push(d)}m[n++]=256;v[256]++;b.W=v;b.V=x;return B?m.subarray(0,n):m}\nfunction Ba(b,a,c){var d,e,f=0,g,k,h,l,s=b.length;k=0;l=c.length;a:for(;k<l;k++){d=c[l-k-1];g=3;if(3<f){for(h=f;3<h;h--)if(b[d+h-1]!==b[a+h-1])continue a;g=f}for(;258>g&&a+g<s&&b[d+g]===b[a+g];)++g;g>f&&(e=d,f=g);if(258===g)break}return new xa(f,a-e)}\nfunction ua(b,a){var c=b.length,d=new la(572),e=new(B?Uint8Array:Array)(c),f,g,k,h,l;if(!B)for(h=0;h<c;h++)e[h]=0;for(h=0;h<c;++h)0<b[h]&&d.push(h,b[h]);f=Array(d.length/2);g=new(B?Uint32Array:Array)(d.length/2);if(1===f.length)return e[d.pop().index]=1,e;h=0;for(l=d.length/2;h<l;++h)f[h]=d.pop(),g[h]=f[h].value;k=Ca(g,g.length,a);h=0;for(l=f.length;h<l;++h)e[f[h].index]=k[h];return e}\nfunction Ca(b,a,c){function d(b){var c=h[b][l[b]];c===a?(d(b+1),d(b+1)):--g[c];++l[b]}var e=new(B?Uint16Array:Array)(c),f=new(B?Uint8Array:Array)(c),g=new(B?Uint8Array:Array)(a),k=Array(c),h=Array(c),l=Array(c),s=(1<<c)-a,p=1<<c-1,m,n,r,v,x;e[c-1]=a;for(n=0;n<c;++n)s<p?f[n]=0:(f[n]=1,s-=p),s<<=1,e[c-2-n]=(e[c-1-n]/2|0)+a;e[0]=f[0];k[0]=Array(e[0]);h[0]=Array(e[0]);for(n=1;n<c;++n)e[n]>2*e[n-1]+f[n]&&(e[n]=2*e[n-1]+f[n]),k[n]=Array(e[n]),h[n]=Array(e[n]);for(m=0;m<a;++m)g[m]=c;for(r=0;r<e[c-1];++r)k[c-\n1][r]=b[r],h[c-1][r]=r;for(m=0;m<c;++m)l[m]=0;1===f[c-1]&&(--g[0],++l[c-1]);for(n=c-2;0<=n;--n){v=m=0;x=l[n+1];for(r=0;r<e[n];r++)v=k[n+1][x]+k[n+1][x+1],v>b[m]?(k[n][r]=v,h[n][r]=a,x+=2):(k[n][r]=b[m],h[n][r]=m,++m);l[n]=0;1===f[n]&&d(n)}return g}\nfunction va(b){var a=new(B?Uint16Array:Array)(b.length),c=[],d=[],e=0,f,g,k,h;f=0;for(g=b.length;f<g;f++)c[b[f]]=(c[b[f]]|0)+1;f=1;for(g=16;f<=g;f++)d[f]=e,e+=c[f]|0,e<<=1;f=0;for(g=b.length;f<g;f++){e=d[b[f]];d[b[f]]+=1;k=a[f]=0;for(h=b[f];k<h;k++)a[f]=a[f]<<1|e&1,e>>>=1}return a};function Da(b,a){this.input=b;this.b=this.c=0;this.i={};a&&(a.flags&&(this.i=a.flags),\"string\"===typeof a.filename&&(this.filename=a.filename),\"string\"===typeof a.comment&&(this.A=a.comment),a.deflateOptions&&(this.l=a.deflateOptions));this.l||(this.l={})}\nDa.prototype.g=function(){var b,a,c,d,e,f,g,k,h=new(B?Uint8Array:Array)(32768),l=0,s=this.input,p=this.c,m=this.filename,n=this.A;h[l++]=31;h[l++]=139;h[l++]=8;b=0;this.i.fname&&(b|=Ea);this.i.fcomment&&(b|=Fa);this.i.fhcrc&&(b|=Ga);h[l++]=b;a=(Date.now?Date.now():+new Date)/1E3|0;h[l++]=a&255;h[l++]=a>>>8&255;h[l++]=a>>>16&255;h[l++]=a>>>24&255;h[l++]=0;h[l++]=Ha;if(this.i.fname!==t){g=0;for(k=m.length;g<k;++g)f=m.charCodeAt(g),255<f&&(h[l++]=f>>>8&255),h[l++]=f&255;h[l++]=0}if(this.i.comment){g=0;for(k=n.length;g<k;++g)f=n.charCodeAt(g),255<f&&(h[l++]=f>>>8&255),h[l++]=f&255;h[l++]=0}this.i.fhcrc&&(c=ja(h,0,l)&65535,h[l++]=c&255,h[l++]=c>>>8&255);this.l.outputBuffer=h;this.l.outputIndex=l;e=new na(s,this.l);h=e.g();l=e.b;B&&(l+8>h.buffer.byteLength?(this.a=new Uint8Array(l+8),this.a.set(new Uint8Array(h.buffer)),h=this.a):h=new Uint8Array(h.buffer));d=ja(s,t,t);h[l++]=d&255;h[l++]=d>>>8&255;h[l++]=d>>>16&255;h[l++]=d>>>24&255;k=s.length;h[l++]=k&255;h[l++]=k>>>8&255;h[l++]=k>>>16&255;h[l++]=k>>>24&255;this.c=p;B&&l<h.length&&(this.a=h=h.subarray(0,l));return h};var Ha=255,Ga=2,Ea=8,Fa=16;A(\"Zlib.Gzip\",Da);A(\"Zlib.Gzip.prototype.compress\",Da.prototype.g);function T(b,a){this.p=[];this.q=32768;this.e=this.j=this.c=this.u=0;this.input=B?new Uint8Array(b):b;this.w=!1;this.r=Ia;this.M=!1;if(a||!(a={}))a.index&&(this.c=a.index),a.bufferSize&&(this.q=a.bufferSize),a.bufferType&&(this.r=a.bufferType),a.resize&&(this.M=a.resize);switch(this.r){case Ja:this.b=32768;this.a=new(B?Uint8Array:Array)(32768+this.q+258);break;case Ia:this.b=0;this.a=new(B?Uint8Array:Array)(this.q);this.f=this.U;this.B=this.R;this.s=this.T;break;default:q(Error(\"invalid inflate mode\"))}}\nvar Ja=0,Ia=1,Ya={O:Ja,N:Ia};T.prototype.h=function(){for(;!this.w;){var b=U(this,3);b&1&&(this.w=u);b>>>=1;switch(b){case 0:var a=this.input,c=this.c,d=this.a,e=this.b,f=a.length,g=t,k=t,h=d.length,l=t;this.e=this.j=0;c+1>=f&&q(Error(\"invalid uncompressed block header: LEN\"));g=a[c++]|a[c++]<<8;c+1>=f&&q(Error(\"invalid uncompressed block header: NLEN\"));k=a[c++]|a[c++]<<8;g===~k&&q(Error(\"invalid uncompressed block header: length verify\"));c+g>a.length&&q(Error(\"input buffer is broken\"));switch(this.r){case Ja:for(;e+g>d.length;){l=h-e;g-=l;if(B)d.set(a.subarray(c,c+l),e),e+=l,c+=l;else for(;l--;)d[e++]=a[c++];this.b=e;d=this.f();e=this.b}break;case Ia:for(;e+g>d.length;)d=this.f({F:2});break;default:q(Error(\"invalid inflate mode\"))}if(B)d.set(a.subarray(c,c+g),e),e+=g,c+=g;else for(;g--;)d[e++]=a[c++];this.c=c;this.b=e;this.a=d;break;case 1:this.s(Za,$a);break;case 2:ab(this);break;default:q(Error(\"unknown BTYPE: \"+b))}}return this.B()};var bb=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],cb=B?new Uint16Array(bb):bb,db=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258],eb=B?new Uint16Array(db):db,fb=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],gb=B?new Uint8Array(fb):fb,hb=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],ib=B?new Uint16Array(hb):hb,jb=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],kb=B?new Uint8Array(jb):jb,lb=new(B?Uint8Array:Array)(288),V,mb;V=0;for(mb=lb.length;V<mb;++V)lb[V]=143>=V?8:255>=V?9:279>=V?7:8;var Za=ma(lb),nb=new(B?Uint8Array:Array)(30),ob,qb;ob=0;for(qb=nb.length;ob<qb;++ob)nb[ob]=5;var $a=ma(nb);function U(b,a){for(var c=b.j,d=b.e,e=b.input,f=b.c,g=e.length,k;d<a;)f>=g&&q(Error(\"input buffer is broken\")),c|=e[f++]<<d,d+=8;k=c&(1<<a)-1;b.j=c>>>a;b.e=d-a;b.c=f;return k}\nfunction rb(b,a){for(var c=b.j,d=b.e,e=b.input,f=b.c,g=e.length,k=a[0],h=a[1],l,s;d<h&&!(f>=g);)c|=e[f++]<<d,d+=8;l=k[c&(1<<h)-1];s=l>>>16;b.j=c>>s;b.e=d-s;b.c=f;return l&65535}\nfunction ab(b){function a(a,b,c){var d,e=this.J,f,g;for(g=0;g<a;)switch(d=rb(this,b),d){case 16:for(f=3+U(this,2);f--;)c[g++]=e;break;case 17:for(f=3+U(this,3);f--;)c[g++]=0;e=0;break;case 18:for(f=11+U(this,7);f--;)c[g++]=0;e=0;break;default:e=c[g++]=d}this.J=e;return c}var c=U(b,5)+257,d=U(b,5)+1,e=U(b,4)+4,f=new(B?Uint8Array:Array)(cb.length),g,k,h,l;for(l=0;l<e;++l)f[cb[l]]=U(b,3);if(!B){l=e;for(e=f.length;l<e;++l)f[cb[l]]=0}g=ma(f);k=new(B?Uint8Array:Array)(c);h=new(B?Uint8Array:Array)(d);b.J=0;b.s(ma(a.call(b,c,g,k)),ma(a.call(b,d,g,h)))}T.prototype.s=function(b,a){var c=this.a,d=this.b;this.C=b;for(var e=c.length-258,f,g,k,h;256!==(f=rb(this,b));)if(256>f)d>=e&&(this.b=d,c=this.f(),d=this.b),c[d++]=f;else{g=f-257;h=eb[g];0<gb[g]&&(h+=U(this,gb[g]));f=rb(this,a);k=ib[f];0<kb[f]&&(k+=U(this,kb[f]));d>=e&&(this.b=d,c=this.f(),d=this.b);for(;h--;)c[d]=c[d++-k]}for(;8<=this.e;)this.e-=8,this.c--;this.b=d};T.prototype.T=function(b,a){var c=this.a,d=this.b;this.C=b;for(var e=c.length,f,g,k,h;256!==(f=rb(this,b));)if(256>f)d>=e&&(c=this.f(),e=c.length),c[d++]=f;else{g=f-257;h=eb[g];0<gb[g]&&(h+=U(this,gb[g]));f=rb(this,a);k=ib[f];0<kb[f]&&(k+=U(this,kb[f]));d+h>e&&(c=this.f(),e=c.length);for(;h--;)c[d]=c[d++-k]}for(;8<=this.e;)this.e-=8,this.c--;this.b=d};T.prototype.f=function(){var b=new(B?Uint8Array:Array)(this.b-32768),a=this.b-32768,c,d,e=this.a;if(B)b.set(e.subarray(32768,b.length));else{c=0;for(d=b.length;c<d;++c)b[c]=e[c+32768]}this.p.push(b);this.u+=b.length;if(B)e.set(e.subarray(a,a+32768));else for(c=0;32768>c;++c)e[c]=e[a+c];this.b=32768;return e};T.prototype.U=function(b){var a,c=this.input.length/this.c+1|0,d,e,f,g=this.input,k=this.a;b&&(\"number\"===typeof b.F&&(c=b.F),\"number\"===typeof b.P&&(c+=b.P));2>c?(d=(g.length-this.c)/this.C[2],f=258*(d/2)|0,e=f<k.length?k.length+f:k.length<<1):e=k.length*c;B?(a=new Uint8Array(e),a.set(k)):a=k;return this.a=a};T.prototype.B=function(){var b=0,a=this.a,c=this.p,d,e=new(B?Uint8Array:Array)(this.u+(this.b-32768)),f,g,k,h;if(0===c.length)return B?this.a.subarray(32768,this.b):this.a.slice(32768,this.b);f=0;for(g=c.length;f<g;++f){d=c[f];k=0;for(h=d.length;k<h;++k)e[b++]=d[k]}f=32768;for(g=this.b;f<g;++f)e[b++]=a[f];this.p=[];return this.buffer=e};T.prototype.R=function(){var b,a=this.b;B?this.M?(b=new Uint8Array(a),b.set(this.a.subarray(0,a))):b=this.a.subarray(0,a):(this.a.length>a&&(this.a.length=a),b=this.a);return this.buffer=b};function sb(b){this.input=b;this.c=0;this.t=[];this.D=!1}sb.prototype.X=function(){this.D||this.h();return this.t.slice()};sb.prototype.h=function(){for(var b=this.input.length;this.c<b;){var a=new P,c=t,d=t,e=t,f=t,g=t,k=t,h=t,l=t,s=t,p=this.input,m=this.c;a.G=p[m++];a.H=p[m++];(31!==a.G||139!==a.H)&&q(Error(\"invalid file signature:\"+a.G+\",\"+a.H));a.z=p[m++];switch(a.z){case 8:break;default:q(Error(\"unknown compression method: \"+a.z))}a.n=p[m++];l=p[m++]|p[m++]<<8|p[m++]<<16|p[m++]<<24;a.Z=new Date(1E3*l);a.fa=p[m++];a.ea=p[m++];0<(a.n&4)&&(a.aa=p[m++]|p[m++]<<8,m+=a.aa);if(0<(a.n&Ea)){h=[];for(k=0;0<(g=p[m++]);)h[k++]=String.fromCharCode(g);a.name=h.join(\"\")}if(0<(a.n&Fa)){h=[];for(k=0;0<(g=p[m++]);)h[k++]=String.fromCharCode(g);a.A=h.join(\"\")}0<(a.n&Ga)&&(a.S=ja(p,0,m)&65535,a.S!==(p[m++]|p[m++]<<8)&&q(Error(\"invalid header crc16\")));c=p[p.length-4]|p[p.length-3]<<8|p[p.length-2]<<16|p[p.length-1]<<24;p.length-m-4-4<512*c&&(f=c);d=new T(p,{index:m,bufferSize:f});a.data=e=d.h();m=d.c;a.ca=s=(p[m++]|p[m++]<<8|p[m++]<<16|p[m++]<<24)>>>0;ja(e,t,t)!==s&&q(Error(\"invalid CRC-32 checksum: 0x\"+ja(e,t,t).toString(16)+\" / 0x\"+s.toString(16)));a.da=c=(p[m++]|p[m++]<<8|p[m++]<<16|p[m++]<<24)>>>0;(e.length&4294967295)!==c&&q(Error(\"invalid input size: \"+(e.length&4294967295)+\" / \"+c));this.t.push(a);this.c=m}this.D=u;var n=this.t,r,v,x=0,Q=0,y;r=0;for(v=n.length;r<v;++r)Q+=n[r].data.length;if(B){y=new Uint8Array(Q);for(r=0;r<v;++r)y.set(n[r].data,x),x+=n[r].data.length}else{y=[];for(r=0;r<v;++r)y[r]=n[r].data;y=Array.prototype.concat.apply([],y)}return y};A(\"Zlib.Gunzip\",sb);A(\"Zlib.Gunzip.prototype.decompress\",sb.prototype.h);A(\"Zlib.Gunzip.prototype.getMembers\",sb.prototype.X);function tb(b){if(\"string\"===typeof b){var a=b.split(\"\"),c,d;c=0;for(d=a.length;c<d;c++)a[c]=(a[c].charCodeAt(0)&255)>>>0;b=a}for(var e=1,f=0,g=b.length,k,h=0;0<g;){k=1024<g?1024:g;g-=k;do e+=b[h++],f+=e;while(--k);e%=65521;f%=65521}return(f<<16|e)>>>0};function ub(b,a){var c,d;this.input=b;this.c=0;if(a||!(a={}))a.index&&(this.c=a.index),a.verify&&(this.$=a.verify);c=b[this.c++];d=b[this.c++];switch(c&15){case vb:this.method=vb;break;default:q(Error(\"unsupported compression method\"))}0!==((c<<8)+d)%31&&q(Error(\"invalid fcheck flag:\"+((c<<8)+d)%31));d&32&&q(Error(\"fdict flag is not supported\"));this.L=new T(b,{index:this.c,bufferSize:a.bufferSize,bufferType:a.bufferType,resize:a.resize})}\nub.prototype.h=function(){var b=this.input,a,c;a=this.L.h();this.c=this.L.c;this.$&&(c=(b[this.c++]<<24|b[this.c++]<<16|b[this.c++]<<8|b[this.c++])>>>0,c!==tb(a)&&q(Error(\"invalid adler-32 checksum\")));return a};var vb=8;function wb(b,a){this.input=b;this.a=new(B?Uint8Array:Array)(32768);this.k=W.o;var c={},d;if((a||!(a={}))&&\"number\"===typeof a.compressionType)this.k=a.compressionType;for(d in a)c[d]=a[d];c.outputBuffer=this.a;this.K=new na(this.input,c)}var W=ra;wb.prototype.g=function(){var b,a,c,d,e,f,g,k=0;g=this.a;b=vb;switch(b){case vb:a=Math.LOG2E*Math.log(32768)-8;break;default:q(Error(\"invalid compression method\"))}c=a<<4|b;g[k++]=c;switch(b){case vb:switch(this.k){case W.NONE:e=0;break;case W.v:e=1;break;case W.o:e=2;break;default:q(Error(\"unsupported compression type\"))}break;default:q(Error(\"invalid compression method\"))}d=e<<6|0;g[k++]=d|31-(256*c+d)%31;f=tb(this.input);this.K.b=k;g=this.K.g();k=g.length;B&&(g=new Uint8Array(g.buffer),g.length<=k+4&&(this.a=new Uint8Array(g.length+4),this.a.set(g),g=this.a),g=g.subarray(0,k+4));g[k++]=f>>24&255;g[k++]=f>>16&255;g[k++]=f>>8&255;g[k++]=f&255;return g};function xb(b,a){var c,d,e,f;if(Object.keys)c=Object.keys(a);else for(d in c=[],e=0,a)c[e++]=d;e=0;for(f=c.length;e<f;++e)d=c[e],A(b+\".\"+d,a[d])};A(\"Zlib.Inflate\",ub);A(\"Zlib.Inflate.prototype.decompress\",ub.prototype.h);xb(\"Zlib.Inflate.BufferType\",{ADAPTIVE:Ya.N,BLOCK:Ya.O});A(\"Zlib.Deflate\",wb);A(\"Zlib.Deflate.compress\",function(b,a){return(new wb(b,a)).g()});A(\"Zlib.Deflate.prototype.compress\",wb.prototype.g);xb(\"Zlib.Deflate.CompressionType\",{NONE:W.NONE,FIXED:W.v,DYNAMIC:W.o});}).call(this);!function(t,e){e()}(this,function(){\"use strict\";function t(t){var e=typeof t;return null!==t&&(\"object\"===e||\"function\"===e)}function e(t){return\"function\"==typeof t}function n(t){B=t}function r(t){G=t}function o(){return function(){return process.nextTick(a)}}function i(){return\"undefined\"!=typeof z?function(){z(a)}:c()}function s(){var t=0,e=new J(a),n=document.createTextNode(\"\");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function u(){var t=new MessageChannel;return t.port1.onmessage=a,function(){return t.port2.postMessage(0)}}function c(){var t=setTimeout;return function(){return t(a,1)}}function a(){for(var t=0;t<W;t+=2){var e=V[t],n=V[t+1];e(n),V[t]=void 0,V[t+1]=void 0}W=0}function f(){try{var t=Function(\"return this\")().require(\"vertx\");return z=t.runOnLoop||t.runOnContext,i()}catch(e){return c()}}function l(t,e){var n=this,r=new this.constructor(p);void 0===r[Z]&&O(r);var o=n._state;if(o){var i=arguments[o-1];G(function(){return P(o,r,i,n._result)})}else E(n,r,t,e);return r}function h(t){var e=this;if(t&&\"object\"==typeof t&&t.constructor===e)return t;var n=new e(p);return g(n,t),n}function p(){}function v(){return new TypeError(\"You cannot resolve a promise with itself\")}function d(){return new TypeError(\"A promises callback cannot return that same promise.\")}function _(t){try{return t.then}catch(e){return nt.error=e,nt}}function y(t,e,n,r){try{t.call(e,n,r)}catch(o){return o}}function m(t,e,n){G(function(t){var r=!1,o=y(n,e,function(n){r||(r=!0,e!==n?g(t,n):S(t,n))},function(e){r||(r=!0,j(t,e))},\"Settle: \"+(t._label||\" unknown promise\"));!r&&o&&(r=!0,j(t,o))},t)}function b(t,e){e._state===tt?S(t,e._result):e._state===et?j(t,e._result):E(e,void 0,function(e){return g(t,e)},function(e){return j(t,e)})}function w(t,n,r){n.constructor===t.constructor&&r===l&&n.constructor.resolve===h?b(t,n):r===nt?(j(t,nt.error),nt.error=null):void 0===r?S(t,n):e(r)?m(t,n,r):S(t,n)}function g(e,n){e===n?j(e,v()):t(n)?w(e,n,_(n)):S(e,n)}function A(t){t._onerror&&t._onerror(t._result),T(t)}function S(t,e){t._state===$&&(t._result=e,t._state=tt,0!==t._subscribers.length&&G(T,t))}function j(t,e){t._state===$&&(t._state=et,t._result=e,G(A,t))}function E(t,e,n,r){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+tt]=n,o[i+et]=r,0===i&&t._state&&G(T,t)}function T(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,o=void 0,i=t._result,s=0;s<e.length;s+=3)r=e[s],o=e[s+n],r?P(n,r,o,i):o(i);t._subscribers.length=0}}function M(t,e){try{return t(e)}catch(n){return nt.error=n,nt}}function P(t,n,r,o){var i=e(r),s=void 0,u=void 0,c=void 0,a=void 0;if(i){if(s=M(r,o),s===nt?(a=!0,u=s.error,s.error=null):c=!0,n===s)return void j(n,d())}else s=o,c=!0;n._state!==$||(i&&c?g(n,s):a?j(n,u):t===tt?S(n,s):t===et&&j(n,s))}function x(t,e){try{e(function(e){g(t,e)},function(e){j(t,e)})}catch(n){j(t,n)}}function C(){return rt++}function O(t){t[Z]=rt++,t._state=void 0,t._result=void 0,t._subscribers=[]}function k(){return new Error(\"Array Methods must be provided an Array\")}function F(t){return new ot(this,t).promise}function Y(t){var e=this;return new e(U(t)?function(n,r){for(var o=t.length,i=0;i<o;i++)e.resolve(t[i]).then(n,r)}:function(t,e){return e(new TypeError(\"You must pass an array to race.\"))})}function q(t){var e=this,n=new e(p);return j(n,t),n}function D(){throw new TypeError(\"You must pass a resolver function as the first argument to the promise constructor\")}function K(){throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\")}function L(){var t=void 0;if(\"undefined\"!=typeof global)t=global;else if(\"undefined\"!=typeof self)t=self;else try{t=Function(\"return this\")()}catch(e){throw new Error(\"polyfill failed because global object is unavailable in this environment\")}var n=t.Promise;if(n){var r=null;try{r=Object.prototype.toString.call(n.resolve())}catch(e){}if(\"[object Promise]\"===r&&!n.cast)return}t.Promise=it}var N=void 0;N=Array.isArray?Array.isArray:function(t){return\"[object Array]\"===Object.prototype.toString.call(t)};var U=N,W=0,z=void 0,B=void 0,G=function(t,e){V[W]=t,V[W+1]=e,W+=2,2===W&&(B?B(a):X())},H=\"undefined\"!=typeof window?window:void 0,I=H||{},J=I.MutationObserver||I.WebKitMutationObserver,Q=\"undefined\"==typeof self&&\"undefined\"!=typeof process&&\"[object process]\"==={}.toString.call(process),R=\"undefined\"!=typeof Uint8ClampedArray&&\"undefined\"!=typeof importScripts&&\"undefined\"!=typeof MessageChannel,V=new Array(1e3),X=void 0;X=Q?o():J?s():R?u():void 0===H&&\"function\"==typeof require?f():c();var Z=Math.random().toString(36).substring(2),$=void 0,tt=1,et=2,nt={error:null},rt=0,ot=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(p),this.promise[Z]||O(this.promise),U(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?S(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&S(this.promise,this._result))):j(this.promise,k())}return t.prototype._enumerate=function(t){for(var e=0;this._state===$&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===h){var o=_(t);if(o===l&&t._state!==$)this._settledAt(t._state,e,t._result);else if(\"function\"!=typeof o)this._remaining--,this._result[e]=t;else if(n===it){var i=new n(p);w(i,t,o),this._willSettleAt(i,e)}else this._willSettleAt(new n(function(e){return e(t)}),e)}else this._willSettleAt(r(t),e)},t.prototype._settledAt=function(t,e,n){var r=this.promise;r._state===$&&(this._remaining--,t===et?j(r,n):this._result[e]=n),0===this._remaining&&S(r,this._result)},t.prototype._willSettleAt=function(t,e){var n=this;E(t,void 0,function(t){return n._settledAt(tt,e,t)},function(t){return n._settledAt(et,e,t)})},t}(),it=function(){function t(e){this[Z]=C(),this._result=this._state=void 0,this._subscribers=[],p!==e&&(\"function\"!=typeof e&&D(),this instanceof t?x(this,e):K())}return t.prototype[\"catch\"]=function(t){return this.then(null,t)},t.prototype[\"finally\"]=function(t){var e=this,n=e.constructor;return e.then(function(e){return n.resolve(t()).then(function(){return e})},function(e){return n.resolve(t()).then(function(){throw e})})},t}();return it.prototype.then=l,it.all=F,it.race=Y,it.resolve=h,it.reject=q,it._setScheduler=n,it._setAsap=r,it._asap=G,it.polyfill=L,it.Promise=it,it.polyfill(),it});if(x3dom.glTF==null)\nx3dom.glTF={};x3dom.glTF.glTFLoader=function(response,meshOnly)\n{this.meshOnly=meshOnly;this.header=this.readHeader(response);if(this.header.sceneLength>0){this.scene=this.readScene(response,this.header);this.body=this.readBody(response,this.header);}\nthis._mesh={};};x3dom.glTF.glTFLoader.prototype.getScene=function(shape,shaderProgram,gl,sceneName)\n{this.reset(shape,gl);if(sceneName==null)\n{sceneName=this.scene[\"scene\"];}\nvar scene=this.scene.scenes[sceneName];this.updateScene(shape,shaderProgram,gl,scene);};x3dom.glTF.glTFLoader.prototype.getMesh=function(shape,shaderProgram,gl,meshName)\n{this.reset(shape,gl);var mesh;if(meshName==null)\n{mesh=Object.keys(this.scene.meshes)[0];}else\n{for(var key in this.scene.meshes){if(this.scene.meshes.hasOwnProperty(key)&&key==meshName)\n{mesh=this.scene.meshes[key];break;}}}\nthis.updateMesh(shape,shaderProgram,gl,mesh,new x3dom.fields.SFMatrix4f());};x3dom.glTF.glTFLoader.prototype.reset=function(shape,gl)\n{this._mesh._numCoords=0;this._mesh._numFaces=0;shape._webgl.externalGeometry=-1;if(this.loaded.bufferViews==null)\nthis.loaded.bufferViews=this.loadBufferViews(shape,gl);};x3dom.glTF.glTFLoader.prototype.updateScene=function(shape,shaderProgram,gl,scene)\n{var nodes=scene[\"nodes\"];for(var i=0;i<nodes.length;++i)\n{var nodeID=nodes[i];var worldTransform=new x3dom.fields.SFMatrix4f();this.traverseNode(shape,shaderProgram,gl,this.scene.nodes[nodeID],worldTransform);}};x3dom.glTF.glTFLoader.prototype.traverseNode=function(shape,shaderProgram,gl,node,transform)\n{var worldTransform=transform.mult(this.getTransform(node));var children=node[\"children\"];if(children!=null)\nfor(var i=0;i<children.length;++i)\n{var childID=children[i];this.traverseNode(shape,shaderProgram,gl,this.scene.nodes[childID],worldTransform);}\nvar meshes=node[\"meshes\"];if(meshes!=null&&meshes.length>0)\nfor(var i=0;i<meshes.length;++i){var meshID=meshes[i];{this.updateMesh(shape,shaderProgram,gl,this.scene.meshes[meshID],worldTransform);this.loaded.meshes[meshID]=1;}}};x3dom.glTF.glTFLoader.prototype.getTransform=function(node){var transform=new x3dom.fields.SFMatrix4f();if(node.matrix){transform.setFromArray(node.matrix);return transform;}\nif(node.scale&&node.scale.length==3){var s=node.scale;transform.setScale(new x3dom.fields.SFVec3f(s[0],s[1],s[2]));}\nif(node.rotation&&node.rotation.length==4){var r=node.rotation;var rotationMatrix=new x3dom.fields.SFMatrix4f();rotationMatrix.setRotate(new x3dom.fields.Quaternion(r[0],r[1],r[2],r[3]));transform=rotationMatrix.mult(transform);}\nif(node.translation&&node.translation.length==3){var t=node.translation;var translationMatrix=x3dom.fields.SFMatrix4f.translation(new x3dom.fields.SFVec3f(t[0],t[1],t[2]));transform=translationMatrix.mult(transform);}\nreturn transform;};x3dom.glTF.glTFLoader.prototype.updateMesh=function(shape,shaderProgram,gl,mesh,worldTransform)\n{var primitives=mesh[\"primitives\"];for(var i=0;i<primitives.length;++i){this.loadglTFMesh(shape,shaderProgram,gl,primitives[i],worldTransform);}};x3dom.glTF.glTFLoader.prototype.loadPrimitive=function(shape,shaderProgram,gl,primitive)\n{var INDEX_BUFFER_IDX=0;var POSITION_BUFFER_IDX=1;var NORMAL_BUFFER_IDX=2;var TEXCOORD_BUFFER_IDX=3;var COLOR_BUFFER_IDX=4;var x3domTypeID,x3domShortTypeID;var meshIdx=this.loaded.meshCount;var bufferOffset=meshIdx*6;shape._webgl.primType[meshIdx]=primitive[\"mode\"];var indexed=(primitive.indices!=null&&primitive.indices!=\"\");if(indexed==true){var indicesAccessor=this.scene.accessors[primitive.indices];shape._webgl.indexOffset[meshIdx]=indicesAccessor[\"byteOffset\"];shape._webgl.drawCount[meshIdx]=indicesAccessor[\"count\"];shape._webgl.buffers[INDEX_BUFFER_IDX+bufferOffset]=this.loaded.bufferViews[indicesAccessor[\"bufferView\"]];this._mesh._numFaces+=indicesAccessor[\"count\"]/3;}\nvar attributes=primitive[\"attributes\"];for(var attributeID in attributes)\n{var accessorName=attributes[attributeID];var accessor=this.scene.accessors[accessorName];switch(attributeID)\n{case\"POSITION\":x3domTypeID=\"coord\";x3domShortTypeID=\"Pos\";shape._webgl.buffers[POSITION_BUFFER_IDX+bufferOffset]=this.loaded.bufferViews[accessor[\"bufferView\"]];if(indexed==false)\n{shape._webgl.drawCount[meshIdx]=accessor[\"count\"];this._mesh._numFaces+=accessor[\"count\"]/3;}\nthis._mesh._numCoords+=accessor[\"count\"];break;case\"NORMAL\":x3domTypeID=\"normal\";x3domShortTypeID=\"Norm\";shape._webgl.buffers[NORMAL_BUFFER_IDX+bufferOffset]=this.loaded.bufferViews[accessor[\"bufferView\"]];break;case\"TEXCOORD_0\":x3domTypeID=\"texCoord\";x3domShortTypeID=\"Tex\";shape._webgl.buffers[TEXCOORD_BUFFER_IDX+bufferOffset]=this.loaded.bufferViews[accessor[\"bufferView\"]];break;case\"COLOR\":x3domTypeID=\"color\";x3domShortTypeID=\"Col\";shape._webgl.buffers[COLOR_BUFFER_IDX+bufferOffset]=this.loaded.bufferViews[accessor[\"bufferView\"]];break;}\nif(x3domTypeID!=null){shape[\"_\"+x3domTypeID+\"StrideOffset\"][meshIdx]=[];shape[\"_\"+x3domTypeID+\"StrideOffset\"][meshIdx][0]=accessor[\"byteStride\"];shape[\"_\"+x3domTypeID+\"StrideOffset\"][meshIdx][1]=accessor[\"byteOffset\"];shape._webgl[x3domTypeID+\"Type\"]=accessor[\"componentType\"];this._mesh[\"_num\"+x3domShortTypeID+\"Components\"]=this.getNumComponentsForType(accessor[\"type\"]);}}\nthis.loaded.meshCount+=1;shape._dirty.shader=true;shape._nameSpace.doc.needRender=true;x3dom.BinaryContainerLoader.checkError(gl);};x3dom.glTF.glTFLoader.prototype.loadglTFMesh=function(shape,shaderProgram,gl,primitive,worldTransform)\n{\"use strict\";var mesh=new x3dom.glTF.glTFMesh();mesh.primitiveType=primitive[\"mode\"];var indexed=(primitive.indices!=null&&primitive.indices!=\"\");if(indexed==true){var indicesAccessor=this.scene.accessors[primitive.indices];mesh.buffers[glTF_BUFFER_IDX.INDEX]={};mesh.buffers[glTF_BUFFER_IDX.INDEX].offset=indicesAccessor[\"byteOffset\"];mesh.buffers[glTF_BUFFER_IDX.INDEX].type=indicesAccessor[\"componentType\"];mesh.buffers[glTF_BUFFER_IDX.INDEX].idx=this.loaded.bufferViews[indicesAccessor[\"bufferView\"]];mesh.drawCount=indicesAccessor[\"count\"];this._mesh._numFaces+=indicesAccessor[\"count\"]/3;}\nvar attributes=primitive[\"attributes\"];for(var attributeID in attributes)\n{var accessorName=attributes[attributeID];var accessor=this.scene.accessors[accessorName];var idx=null;switch(attributeID)\n{case\"POSITION\":idx=glTF_BUFFER_IDX.POSITION;if(indexed==false)\n{mesh.drawCount=accessor[\"count\"];this._mesh._numFaces+=accessor[\"count\"]/3;}\nthis._mesh.numCoords+=accessor[\"count\"];break;case\"NORMAL\":idx=glTF_BUFFER_IDX.NORMAL;break;case\"TEXCOORD_0\":idx=glTF_BUFFER_IDX.TEXCOORD;break;case\"COLOR\":idx=glTF_BUFFER_IDX.COLOR;break;}\nif(idx!=null){mesh.buffers[idx]={};mesh.buffers[idx].idx=this.loaded.bufferViews[accessor[\"bufferView\"]];mesh.buffers[idx].offset=accessor[\"byteOffset\"];mesh.buffers[idx].stride=accessor[\"byteStride\"];mesh.buffers[idx].type=accessor[\"componentType\"];mesh.buffers[idx].numComponents=this.getNumComponentsForType(accessor[\"type\"]);}}\nthis.loaded.meshCount+=1;shape._dirty.shader=true;shape._nameSpace.doc.needRender=true;x3dom.BinaryContainerLoader.checkError(gl);if(primitive.material!=null&&!this.meshOnly){mesh.material=this.loadMaterial(gl,this.scene.materials[primitive.material]);mesh.material.worldTransform=worldTransform;}\nif(shape.meshes==null)\nshape.meshes=[];shape.meshes.push(mesh);};x3dom.glTF.glTFLoader.prototype.loadBufferViews=function(shape,gl)\n{var buffers={};var bufferViews=this.scene.bufferViews;for(var bufferId in bufferViews)\n{if(!bufferViews.hasOwnProperty(bufferId))continue;var bufferView=bufferViews[bufferId];if(bufferView.target==null&&bufferView.target!=gl.ARRAY_BUFFER&&bufferView.target!=gl.ELEMENT_ARRAY_BUFFER)\ncontinue;shape._webgl.externalGeometry=1;var data=new Uint8Array(this.body.buffer,this.header.bodyOffset+bufferView[\"byteOffset\"],bufferView[\"byteLength\"]);var newBuffer=gl.createBuffer();gl.bindBuffer(bufferView[\"target\"],newBuffer);gl.bufferData(bufferView[\"target\"],data,gl.STATIC_DRAW);buffers[bufferId]=newBuffer;}\nreturn buffers;};x3dom.glTF.glTFLoader.prototype.readHeader=function(response)\n{var header={};var magicBytes=new Uint8Array(response,0,4);var versionBytes=new Uint32Array(response,4,1);var lengthBytes=new Uint32Array(response,8,1);var sceneLengthBytes=new Uint32Array(response,12,1);var sceneFormatBytes=new Uint32Array(response,16,1);header.magic=new TextDecoder(\"ascii\").decode(magicBytes);if(versionBytes[0]==1)\nheader.version=\"Version 1\";header.length=lengthBytes[0];header.sceneLength=sceneLengthBytes[0];if(sceneFormatBytes[0]==0)\nheader.sceneFormat=\"JSON\";header.bodyOffset=header.sceneLength+20;return header;};x3dom.glTF.glTFLoader.prototype.readScene=function(response,header)\n{var sceneBytes=new Uint8Array(response,20,header.sceneLength);var json=JSON.parse(new TextDecoder(\"utf-8\").decode(sceneBytes));return json;};x3dom.glTF.glTFLoader.prototype.readBody=function(response,header)\n{var offset=header.sceneLength+20;var body=new Uint8Array(response,offset,header.length-offset);return body;};x3dom.glTF.glTFLoader.prototype.getNumComponentsForType=function(type)\n{switch(type)\n{case\"SCALAR\":return 1;case\"VEC2\":return 2;case\"VEC3\":return 3;case\"VEC4\":return 4;default:return 0;}};x3dom.glTF.glTFLoader.prototype.loadImage=function(imageNodeName,mimeType)\n{if(this.loaded.images==null)\nthis.loaded.images={};if(this.loaded.images[imageNodeName]!=null)\nreturn this.loaded.images[imageNodeName];var imageNode=this.scene.images[imageNodeName];if(imageNode.extensions!=null&&imageNode.extensions.KHR_binary_glTF!=null)\n{var ext=imageNode.extensions.KHR_binary_glTF;var bufferView=this.scene.bufferViews[ext.bufferView];var uint8Array=new Uint8Array(this.body.buffer,this.header.bodyOffset+bufferView.byteOffset,bufferView.byteLength);var blob=new Blob([uint8Array],{type:ext.mimeType});var blobUrl=window.URL.createObjectURL(blob);var image=new Image();image.src=blobUrl;this.loaded.images[imageNodeName]=image;return image;}\nif(imageNode.uri!=null)\n{var image=new Image();image.src=imageNode.uri;this.loaded.images[imageNodeName]=image;return image;}\nreturn null;};x3dom.glTF.glTFLoader.prototype.loadTexture=function(gl,textureNodeName)\n{if(this.loaded.textures==null)\nthis.loaded.textures={};if(this.loaded.textures[textureNodeName]!=null)\nreturn this.loaded.textures[textureNodeName];var textureNode=this.scene.textures[textureNodeName];var format=textureNode.format;var internalFormat=textureNode.internalFormat;var sampler={};var samplerNode=this.scene.samplers[textureNode.sampler];if(samplerNode!=null)\n{for(var key in samplerNode){if(samplerNode.hasOwnProperty(key))\nsampler[key]=samplerNode[key];}}\nvar image=this.loadImage(textureNode.source);var target=textureNode.target;var type=textureNode.type;var glTFTexture=new x3dom.glTF.glTFTexture(gl,format,internalFormat,sampler,target,type,image);this.loaded.textures[textureNodeName]=glTFTexture;return glTFTexture;};x3dom.glTF.glTFLoader.prototype.loadMaterial=function(gl,materialNode)\n{if(materialNode){if(materialNode.extensions!=null&&materialNode.extensions.KHR_materials_common!=null)\n{materialNode=materialNode.extensions.KHR_materials_common;var material=new x3dom.glTF.glTFKHRMaterialCommons();material.technique=glTF_KHR_MATERIAL_COMMON_TECHNIQUE[materialNode.technique];material.doubleSided=materialNode.doubleSided;for(var key in materialNode.values)\nif(materialNode.values.hasOwnProperty(key))\n{var value=materialNode.values[key];if(typeof value==='string')\n{material[key+\"Tex\"]=this.loadTexture(gl,value);}\nelse\n{material[key]=value;}}\nreturn material;}else\n{var technique=this.scene.techniques[materialNode.technique];var program=this.loadShaderProgram(gl,technique.program);var material=new x3dom.glTF.glTFMaterial(technique);material.program=program;for(var key in technique.parameters){if(!technique.parameters.hasOwnProperty(key))continue;var parameter=technique.parameters[key];if(parameter.value!=null){material.values[key]=parameter.value;}}\nfor(var key in materialNode.values)\nif(materialNode.values.hasOwnProperty(key))\n{var value=materialNode.values[key];if(typeof value==='string')\n{material.textures[key]=this.loadTexture(gl,value);}\nelse\n{material.values[key]=value;}}\nreturn material;}}\nreturn new x3dom.glTF.glTFKHRMaterialCommons();};x3dom.glTF.glTFLoader.prototype.loadShaderProgram=function(gl,shaderProgramName)\n{if(this.loaded.programs==null)\nthis.loaded.programs={};if(this.loaded.programs[shaderProgramName]!=null)\nreturn this.loaded.programs[shaderProgramName];var shaderProgramNode=this.scene.programs[shaderProgramName];var vertexShaderNode=this.scene.shaders[shaderProgramNode.vertexShader];var vertexShaderSrc=this._loadShaderSource(vertexShaderNode);var fragmentShaderNode=this.scene.shaders[shaderProgramNode.fragmentShader];var fragmentShaderSrc=this._loadShaderSource(fragmentShaderNode);var program=gl.createProgram();var vertexShader=gl.createShader(gl.VERTEX_SHADER);gl.shaderSource(vertexShader,vertexShaderSrc);gl.compileShader(vertexShader);if(!gl.getShaderParameter(vertexShader,gl.COMPILE_STATUS)){x3dom.debug.logError(\"[glTF binary] VertexShader \"+gl.getShaderInfoLog(vertexShader));}\nvar fragmentShader=gl.createShader(gl.FRAGMENT_SHADER);gl.shaderSource(fragmentShader,fragmentShaderSrc);gl.compileShader(fragmentShader);if(!gl.getShaderParameter(fragmentShader,gl.COMPILE_STATUS)){x3dom.debug.logError(\"[glTF binary] FragmentShader \"+gl.getShaderInfoLog(fragmentShader));}\ngl.attachShader(program,vertexShader);gl.attachShader(program,fragmentShader);gl.bindAttribLocation(program,0,\"position\");gl.linkProgram(program);var program=x3dom.Utils.wrapProgram(gl,program);this.loaded.programs[shaderProgramName]=program;return program;};x3dom.glTF.glTFLoader.prototype._loadShaderSource=function(shaderNode)\n{if(shaderNode.extensions!=null&&shaderNode.extensions.KHR_binary_glTF!=null)\n{var bufferView=this.scene.bufferViews[shaderNode.extensions.KHR_binary_glTF.bufferView];var shaderBytes=new Uint8Array(this.body.buffer,this.header.bodyOffset+bufferView.byteOffset,bufferView.byteLength);var src=new TextDecoder(\"ascii\").decode(shaderBytes);return src;}\nelse\n{var dataURL=/^data\\:([^]*?)(?:;([^]*?))?(;base64)?,([^]*)$/;var result=dataURL.exec(shaderNode.uri);if(result)\n{var data=result[4];if(result[2]===\"base64\")\ndata=atob(data);else\ndata=unescape(data);return data;}\nx3dom.debug.logError('no shader found');}};x3dom.glTF2Loader=function(nameSpace)\n{this._nameSpace=nameSpace;this._definitions={};}\nx3dom.glTF2Loader.prototype.load=function(input,binary)\n{this._gltf=this._getGLTF(input,binary);var x3dScene=this._generateX3DScene();var sceneID=this._gltf.scene||0;var scene=this._gltf.scenes[sceneID];this._generateX3DWorldInfo(scene,x3dScene);for(var i=0;i<scene.nodes.length;i++)\n{var node=this._gltf.nodes[scene.nodes[i]];this._traverseNodes(node,x3dScene,scene.nodes[i]);}\nif(this._gltf.animations)\n{for(var i=0;i<this._gltf.animations.length;i++)\n{var animation=this._gltf.animations[i];var animationID=\"glTF_ANIMATION_\"+i;this._generateX3DAnimationNodes(x3dScene,animation,animationID);}}\nreturn x3dScene;};x3dom.glTF2Loader.prototype._generateX3DWorldInfo=function(scene,parent)\n{if(this._gltf.asset)\n{var asset=this._gltf.asset;var assetProperties=['copyright','generator','version','minversion'];var worldInfo=document.createElement(\"worldinfo\");var info=new x3dom.fields.MFString();var property,i;for(i=0;i<assetProperties.length;i++)\n{property=assetProperties[i];if(asset[property]){info.push('\"'+assetProperties[i]+\":\"+asset[property]+'\"');}}\nworldInfo.setAttribute('info',info.toString());if(asset.extras&&asset.extras.title)\n{worldInfo.setAttribute('title',asset.extras.title);}\nvar metadata=document.createElement('MetadataSet');metadata.setAttribute('name','global');metadata.setAttribute('containerfield','metadata');this._generateX3DMetadata(asset,metadata,\"asset_extras\",\"value\");this._generateX3DMetadata(scene,metadata,\"scene_extras\",\"value\");if(metadata.hasChildNodes()){worldInfo.appendChild(metadata);}\nparent.appendChild(worldInfo);}};x3dom.glTF2Loader.prototype._generateX3DMetadata=function(node,parent,name,containerfield)\n{if(!node.extras){return;}\nname=name||\"extras\";containerfield=containerfield||\"metadata\";var metadata=_generateMetadata(name,node.extras,containerfield);parent.appendChild(metadata);return;function _generateMetadata(name,value,cf){var type=typeof value;if(type=='string'||value===null||type=='undefined')\n{return _generateX3DMetadataNode('MetadataString',name,JSON.stringify(value),cf);}\nelse if(type=='number'){return _generateX3DMetadataNode('MetadataFloat',name,value,cf);}\nelse if(type=='boolean'){return _generateX3DMetadataNode('MetadataBoolean',name,value,cf);}\nelse if(type=='object'){return _generateX3DMetadataSetNode(name,value,cf);}\nreturn _generateX3DMetadataNode('MetadataString',name,value,cf);}\nfunction _generateX3DMetadataNode(nodename,name,value,cf){var x3dnode=document.createElement(nodename);x3dnode.setAttribute('name',name);x3dnode.setAttribute('value',value);x3dnode.setAttribute('containerfield',cf);return x3dnode;}\nfunction _generateX3DMetadataSetNode(name,value,cf){var x3dnode=document.createElement('MetadataSet');x3dnode.setAttribute('name',name);x3dnode.setAttribute('containerfield',cf);var keys=Object.keys(value),key,i;for(i=0;i<keys.length;i++)\n{key=keys[i];x3dnode.appendChild(_generateMetadata(key,value[key],\"value\"));}\nreturn x3dnode;}};x3dom.glTF2Loader.prototype._traverseNodes=function(node,parent,index)\n{var x3dNode=this._generateX3DNode(node,index);parent.appendChild(x3dNode);if(node.children)\n{for(var i=0;i<node.children.length;i++)\n{var child=this._gltf.nodes[node.children[i]];this._traverseNodes(child,x3dNode,node.children[i]);}}};x3dom.glTF2Loader.prototype._generateX3DNode=function(node,index)\n{var x3dNode;node.name=(node.name)?node.name:index;if(node.matrix!=undefined)\n{x3dNode=this._generateX3DMatrixTransform(node);}\nelse if(node.translation!=undefined||node.rotation!=undefined||node.scale!=undefined)\n{x3dNode=this._generateX3DTransform(node);}\nelse\n{x3dNode=this._generateX3DTransform(node);}\nthis._generateX3DMetadata(node,x3dNode);if(node.mesh!=undefined)\n{var mesh=this._gltf.meshes[node.mesh];for(var i=0;i<mesh.primitives.length;i++)\n{x3dNode.appendChild(this._generateX3DShape(mesh.primitives[i]));}}\nif(node.model!=undefined)\n{var model=this._gltf.models[node.model];if(model.uri!=undefined)\n{x3dNode.appendChild(this._generateX3DInline(model));}}\nif(node.camera!=undefined)\n{x3dNode.appendChild(this._generateX3DViewpoint(node));}\nreturn x3dNode;};x3dom.glTF2Loader.prototype._generateX3DScene=function()\n{var scene=document.createElement(\"scene\");return scene;};x3dom.glTF2Loader.prototype._generateX3DTransform=function(node)\n{var transform=document.createElement(\"transform\");if(node.translation!=undefined)\n{transform.setAttribute(\"translation\",node.translation.join(\" \"));}\nif(node.rotation!=undefined)\n{transform.setAttribute(\"rotation\",this._toAxisAngle(node.rotation).join(\" \"));}\nif(node.scale!=undefined)\n{transform.setAttribute(\"scale\",node.scale.join(\" \"));}\nif(node.name!=undefined)\n{transform.setAttribute(\"DEF\",\"glTF_NODE_\"+node.name);}\nreturn transform;};x3dom.glTF2Loader.prototype._generateX3DMatrixTransform=function(node)\n{var matrixTransform=document.createElement(\"matrixtransform\");if(node.matrix!=undefined)\n{matrixTransform.setAttribute(\"matrix\",node.matrix.join(\" \"));}\nif(node.name!=undefined)\n{matrixTransform.setAttribute(\"DEF\",\"glTF_NODE_\"+node.name);}\nreturn matrixTransform;};x3dom.glTF2Loader.prototype._generateX3DGroup=function(node)\n{return document.createElement(\"group\");};x3dom.glTF2Loader.prototype._generateX3DInline=function(model)\n{var inline=document.createElement(\"inline\");inline.setAttribute(\"url\",model.uri);if(model.mimeType!=undefined)\n{inline.setAttribute(\"contentType\",model.mimeType);}\nreturn inline;};x3dom.glTF2Loader.prototype._generateX3DViewpoint=function(node)\n{var camera=this._gltf.cameras[node.camera];var cameraID=\"glTF_CAMERA_\"+node.camera;switch(camera.type)\n{case\"orthographic\":return this._generateX3DOrthoViewpoint(cameraID,camera.orthographic);case\"perspective\":return this._generateX3DPerspectiveViewpoint(cameraID,camera.perspective);default:return this._generateX3DPerspectiveViewpoint(cameraID,camera.perspective);}};x3dom.glTF2Loader.prototype._generateX3DPerspectiveViewpoint=function(id,camera)\n{var viewpoint=document.createElement(\"viewpoint\");this._generateX3DMetadata(camera,viewpoint);var fov=camera.yfov||0.785398;var znear=camera.znear||-1;var zfar=camera.zfar||-1;var _zratio=100000;if(zfar/znear>_zratio){zfar=znear=-1;}\nviewpoint.setAttribute(\"DEF\",id);viewpoint.setAttribute(\"fieldOfView\",fov);viewpoint.setAttribute(\"zNear\",znear);viewpoint.setAttribute(\"zFar\",zfar);viewpoint.setAttribute(\"position\",\"0 0 0\");return viewpoint;};x3dom.glTF2Loader.prototype._generateX3DOrthoViewpoint=function(id,camera)\n{var viewpoint=document.createElement(\"orthoviewpoint\");this._generateX3DMetadata(camera,viewpoint);var xmag=camera.xmag||1;var ymag=camera.ymag||1;var znear=camera.znear||-1;var zfar=camera.zfar||-1;var fov=[-xmag,-ymag,xmag,ymag];viewpoint.setAttribute(\"DEF\",id);viewpoint.setAttribute(\"fieldOfView\",fov);viewpoint.setAttribute(\"zNear\",znear);viewpoint.setAttribute(\"zFar\",zfar);viewpoint.setAttribute(\"position\",\"0 0 0\");return viewpoint;};x3dom.glTF2Loader.prototype._generateX3DShape=function(primitive)\n{var shape=document.createElement(\"shape\");this._generateX3DMetadata(primitive,shape);var material=(primitive.material!=undefined)?this._gltf.materials[primitive.material]:{};shape.appendChild(this._generateX3DAppearance(material));shape.appendChild(this._generateX3DBufferGeometry(primitive));return shape;};x3dom.glTF2Loader.prototype._generateX3DAppearance=function(material)\n{var appearance=document.createElement(\"appearance\");this._generateX3DMetadata(material,appearance);if(material.alphaMode===\"BLEND\")\n{appearance.setAttribute(\"sortType\",\"transparent\");}\nelse\n{appearance.setAttribute(\"sortType\",\"opaque\");}\nappearance.appendChild(this._generateX3DPhysicalMaterial(material));if(this._textureTransform)\n{appearance.appendChild(this._textureTransform);this._textureTransform=undefined;}\nreturn appearance;};x3dom.glTF2Loader.prototype._generateX3DPhysicalMaterial=function(material)\n{var mat=document.createElement(\"physicalmaterial\");if(this._USEorDEF(mat,\"glTF_MATERIAL_\"+material.name))\n{return mat;}\nvar texture;var baseColorFactor=[1,1,1,1];var emissiveFactor=material.emissiveFactor||[0,0,0];var metallicFactor=1;var roughnessFactor=1;var alphaMode=material.alphaMode||\"OPAQUE\";var alphaCutoff=material.alphaCutoff||0.5;var seperateOcclusion=true\nvar model=undefined;var pbr=undefined;var channel=0;var transform;if(material.pbrMetallicRoughness)\n{pbr=material.pbrMetallicRoughness;model=\"roughnessMetallic\";}\nelse if(material.extensions&&material.extensions.KHR_materials_pbrSpecularGlossiness)\n{pbr=material.extensions.KHR_materials_pbrSpecularGlossiness;model=\"specularGlossiness\";}\nif(model==\"roughnessMetallic\")\n{var baseColorFactor=pbr.baseColorFactor||[1,1,1,1];var metallicFactor=(pbr.metallicFactor!=undefined)?pbr.metallicFactor:1;var roughnessFactor=(pbr.roughnessFactor!=undefined)?pbr.roughnessFactor:1;if(pbr.baseColorTexture)\n{channel=(pbr.baseColorTexture.texCoord)?1:0;texture=this._gltf.textures[pbr.baseColorTexture.index];transform=(pbr.baseColorTexture.extensions&&pbr.baseColorTexture.extensions.KHR_texture_transform)?pbr.baseColorTexture.extensions.KHR_texture_transform:undefined;mat.appendChild(this._generateX3DImageTexture(texture,\"baseColorTexture\",channel,transform));}\nif(pbr.metallicRoughnessTexture)\n{channel=(pbr.metallicRoughnessTexture.texCoord)?1:0;texture=this._gltf.textures[pbr.metallicRoughnessTexture.index];transform=(pbr.metallicRoughnessTexture.extensions&&pbr.metallicRoughnessTexture.extensions.KHR_texture_transform)?pbr.metallicRoughnessTexture.extensions.KHR_texture_transform:undefined;if(material.occlusionTexture&&material.occlusionTexture.index==pbr.metallicRoughnessTexture.index)\n{seperateOcclusion=false;mat.appendChild(this._generateX3DImageTexture(texture,\"occlusionRoughnessMetallicTexture\",channel,transform));}\nelse\n{mat.appendChild(this._generateX3DImageTexture(texture,\"roughnessMetallicTexture\",channel,transform));}}\nmat.setAttribute(\"baseColorFactor\",baseColorFactor.join(\" \"));mat.setAttribute(\"metallicFactor\",metallicFactor);mat.setAttribute(\"roughnessFactor\",roughnessFactor);}\nelse if(model==\"specularGlossiness\")\n{var diffuseFactor=pbr.diffuseFactor||[1,1,1,1];var specularFactor=pbr.specularFactor||[1,1,1];var glossinessFactor=(pbr.glossinessFactor!=undefined)?pbr.glossinessFactor:1;if(pbr.diffuseTexture)\n{channel=(pbr.diffuseTexture.texCoord)?1:0;texture=this._gltf.textures[pbr.diffuseTexture.index];transform=(pbr.diffuseTexture.extensions&&pbr.diffuseTexture.extensions.KHR_texture_transform)?pbr.diffuseTexture.extensions.KHR_texture_transform:undefined;mat.appendChild(this._generateX3DImageTexture(texture,\"baseColorTexture\",channel,transform));}\nif(pbr.specularGlossinessTexture)\n{channel=(pbr.specularGlossinessTexture.texCoord)?1:0;texture=this._gltf.textures[pbr.specularGlossinessTexture.index];transform=(pbr.specularGlossinessTexture.extensions&&pbr.specularGlossinessTexture.extensions.KHR_texture_transform)?pbr.specularGlossinessTexture.extensions.KHR_texture_transform:undefined;mat.appendChild(this._generateX3DImageTexture(texture,\"specularGlossinessTexture\",channel,transform));}\nmat.setAttribute(\"diffuseFactor\",diffuseFactor.join(\" \"));mat.setAttribute(\"specularFactor\",specularFactor.join(\" \"));mat.setAttribute(\"glossinessFactor\",glossinessFactor);}\nif(material.normalTexture)\n{channel=(material.normalTexture.texCoord)?1:0;texture=this._gltf.textures[material.normalTexture.index];transform=(material.normalTexture.extensions&&material.normalTexture.extensions.KHR_texture_transform)?material.normalTexture.extensions.KHR_texture_transform:undefined;mat.appendChild(this._generateX3DImageTexture(texture,\"normalTexture\",channel,transform));}\nif(material.emissiveTexture)\n{channel=(material.emissiveTexture.texCoord)?1:0;texture=this._gltf.textures[material.emissiveTexture.index];transform=(material.emissiveTexture.extensions&&material.emissiveTexture.extensions.KHR_texture_transform)?material.emissiveTexture.extensions.KHR_texture_transform:undefined;mat.appendChild(this._generateX3DImageTexture(texture,\"emissiveTexture\",channel,transform));}\nif(material.occlusionTexture&&seperateOcclusion)\n{channel=(material.occlusionTexture.texCoord)?1:0;texture=this._gltf.textures[material.occlusionTexture.index];transform=(material.occlusionTexture.extensions&&material.occlusionTexture.extensions.KHR_texture_transform)?material.occlusionTexture.extensions.KHR_texture_transform:undefined;mat.appendChild(this._generateX3DImageTexture(texture,\"occlusionTexture\",channel,transform));}\nif(material.extensions&&material.extensions.KHR_materials_unlit)\n{mat.setAttribute(\"unlit\",true);}\nmat.setAttribute(\"emissiveFactor\",emissiveFactor.join(\" \"));mat.setAttribute(\"alphaMode\",alphaMode);mat.setAttribute(\"alphaCutoff\",alphaCutoff);mat.setAttribute(\"model\",model);return mat;};x3dom.glTF2Loader.prototype._generateX3DImageTexture=function(texture,containerField,channel,transform)\n{var image=this._gltf.images[texture.source];var imagetexture=document.createElement(\"imagetexture\");this._generateX3DMetadata(texture,imagetexture);imagetexture.setAttribute(\"origChannelCount\",\"2\");imagetexture.setAttribute(\"flipY\",\"true\");if(containerField)\n{imagetexture.setAttribute(\"containerField\",containerField);}\nif(image.uri!=undefined)\n{imagetexture.setAttribute(\"url\",x3dom.Utils.dataURIToObjectURL(image.uri));}\nif(texture.sampler!=undefined)\n{var sampler=this._gltf.samplers[texture.sampler];imagetexture.appendChild(this._createX3DTextureProperties(sampler));}\nif(channel)\n{imagetexture.setAttribute(\"channel\",\"1\");}\nif(transform)\n{this._textureTransform=this._createX3DTextureTransform(imagetexture,transform);}\nreturn imagetexture;};x3dom.glTF2Loader.prototype._createX3DTextureProperties=function(sampler)\n{var textureproperties=document.createElement(\"textureproperties\");textureproperties.setAttribute(\"boundaryModeS\",x3dom.Utils.boundaryModesDicX3D(sampler.wrapS));textureproperties.setAttribute(\"boundaryModeT\",x3dom.Utils.boundaryModesDicX3D(sampler.wrapT));textureproperties.setAttribute(\"magnificationFilter\",x3dom.Utils.magFilterDicX3D(sampler.magFilter));textureproperties.setAttribute(\"minificationFilter\",x3dom.Utils.minFilterDicX3D(sampler.minFilter));if(sampler.minFilter==undefined||(sampler.minFilter>=9984&&sampler.minFilter<=9987))\n{textureproperties.setAttribute(\"generateMipMaps\",\"true\");}\nreturn textureproperties;};x3dom.glTF2Loader.prototype._createX3DTextureTransform=function(imagetexture,transform)\n{var texturetransform=document.createElement(\"matrixtexturetransform\");var offset=transform.offset||[0,0];var rotation=transform.rotation||0;var scale=transform.scale||[1,1];var negCenter=new x3dom.fields.SFVec3f(-0,-0,0);var posCenter=new x3dom.fields.SFVec3f(0,0,0);var trans3=new x3dom.fields.SFVec3f(offset[0],offset[1],0);var scale3=new x3dom.fields.SFVec3f(scale[0],scale[1],0);var trafo=x3dom.fields.SFMatrix4f.translation(posCenter.add(trans3)).mult(x3dom.fields.SFMatrix4f.rotationZ(rotation*-1.0)).mult(x3dom.fields.SFMatrix4f.scale(scale3)).mult(x3dom.fields.SFMatrix4f.translation(negCenter));texturetransform.setAttribute(\"matrix\",trafo.toString());if(transform.texCoord)\n{imagetexture.setAttribute(\"channel\",texCoord);}\nreturn texturetransform;};x3dom.glTF2Loader.prototype._generateX3DBufferGeometry=function(primitive)\n{var views=[];var bufferGeometry=document.createElement(\"buffergeometry\");var centerAndSize=this._getCenterAndSize(primitive);bufferGeometry.setAttribute(\"buffer\",this._bufferURI(primitive));bufferGeometry.setAttribute(\"position\",centerAndSize.center.join(\" \"));bufferGeometry.setAttribute(\"size\",centerAndSize.size.join(\" \"));bufferGeometry.setAttribute(\"vertexCount\",this._getVertexCount(primitive));bufferGeometry.setAttribute(\"primType\",this._primitiveType(primitive.mode));if(primitive.material!=undefined)\n{var material=this._gltf.materials[primitive.material];if(material.doubleSided)\n{bufferGeometry.setAttribute(\"solid\",\"false\");}}\nif(primitive.indices!=undefined)\n{var accessor=this._gltf.accessors[primitive.indices];var view=this._gltf.bufferViews[accessor.bufferView];view.id=accessor.bufferView;view.target=34963;var viewID=views.indexOf(view)\nif(view.target!=undefined&&viewID==-1)\n{viewID=views.push(view)-1;}\nbufferGeometry.appendChild(this._generateX3DBufferAccessor(\"INDEX\",accessor,viewID));}\nfor(var attribute in primitive.attributes)\n{var accessor=this._gltf.accessors[primitive.attributes[attribute]];var view=this._gltf.bufferViews[accessor.bufferView];view.target=34962;view.id=accessor.bufferView;var viewID=views.indexOf(view)\nif(view.target!=undefined&&viewID==-1)\n{viewID=views.push(view)-1;}\nbufferGeometry.appendChild(this._generateX3DBufferAccessor(attribute,accessor,viewID));}\nfor(var i=0;i<views.length;i++)\n{bufferGeometry.appendChild(this._generateX3DBufferView(views[i]));}\nreturn bufferGeometry;}\nx3dom.glTF2Loader.prototype._generateX3DBufferView=function(view)\n{var bufferView=document.createElement(\"bufferview\");bufferView.setAttribute(\"target\",view.target);bufferView.setAttribute(\"byteOffset\",view.byteOffset||0);bufferView.setAttribute(\"byteLength\",view.byteLength);bufferView.setAttribute(\"id\",view.id);return bufferView;};x3dom.glTF2Loader.prototype._generateX3DBufferAccessor=function(buffer,accessor,viewID)\n{var components=this._componentsOf(accessor.type);var bufferView=this._gltf.bufferViews[accessor.bufferView];var byteOffset=accessor.byteOffset;var bufferAccessor=document.createElement(\"bufferaccessor\");bufferAccessor.setAttribute(\"bufferType\",buffer.replace(\"_0\",\"\"));bufferAccessor.setAttribute(\"view\",viewID);bufferAccessor.setAttribute(\"byteOffset\",byteOffset||0);bufferAccessor.setAttribute(\"byteStride\",bufferView.byteStride||0);bufferAccessor.setAttribute(\"normalized\",accessor.normalized||false);bufferAccessor.setAttribute(\"components\",components);bufferAccessor.setAttribute(\"componentType\",accessor.componentType);bufferAccessor.setAttribute(\"count\",accessor.count);return bufferAccessor;};x3dom.glTF2Loader.prototype._generateX3DAnimationNodes=function(x3dScene,animation,animationID)\n{var duration=this._animationDuration(animation);var timeSensorID=animationID+\"_TIMESENSOR\";x3dScene.appendChild(this._generateX3DTimeSensor(timeSensorID,duration));for(var i=0;i<animation.channels.length;i++)\n{var channel=animation.channels[i];var path=channel.target.path;var node=channel.target.node;var sampler=animation.samplers[channel.sampler];var targetID=\"glTF_NODE_\"+this._gltf.nodes[node].name;var interpolatorID=animationID+\"_INTERPOLATOR_\"+i;x3dScene.appendChild(this._generateX3DInterpolator(interpolatorID,path,sampler,duration));x3dScene.appendChild(this._createX3DRoute(\"fraction_changed\",timeSensorID,\"set_fraction\",interpolatorID));x3dScene.appendChild(this._createX3DRoute(\"value_changed\",interpolatorID,\"set_\"+path,targetID));}};x3dom.glTF2Loader.prototype._generateX3DTimeSensor=function(id,duration)\n{var clock=document.createElement('TimeSensor');clock.setAttribute('loop','true');clock.setAttribute('cycleInterval',duration);clock.setAttribute('DEF',id);return clock;};x3dom.glTF2Loader.prototype._generateX3DInterpolator=function(id,path,sampler,duration)\n{var interpolator;var interpolation=sampler.interpolation||\"LINEAR\";var accessorInput=this._gltf.accessors[sampler.input];var accessorOutput=this._gltf.accessors[sampler.output];var viewInput=this._gltf.bufferViews[accessorInput.bufferView];var viewOutput=this._gltf.bufferViews[accessorOutput.bufferView];switch(path)\n{case\"scale\":case\"translation\":interpolator=document.createElement(\"PositionInterpolator\");break;case\"rotation\":interpolator=document.createElement(\"OrientationInterpolator\");break;case\"weights\":interpolator=document.createElement(\"ScalarInterpolator\");break;}\ninterpolator.setAttribute('DEF',id);interpolator.setAttribute(\"buffer\",this._bufferURI(sampler));interpolator.setAttribute(\"interpolation\",interpolation);interpolator.setAttribute(\"duration\",duration);interpolator.appendChild(this._generateX3DBufferAccessor('SAMPLER_INPUT',accessorInput,0));interpolator.appendChild(this._generateX3DBufferAccessor('SAMPLER_OUTPUT',accessorOutput,1));interpolator.appendChild(this._generateX3DBufferView(viewInput));interpolator.appendChild(this._generateX3DBufferView(viewOutput));return interpolator;};x3dom.glTF2Loader.prototype._createX3DRoute=function(fromField,fromNode,toField,toNode)\n{var route=document.createElement('ROUTE');route.setAttribute('fromField',fromField);route.setAttribute('fromNode',fromNode);route.setAttribute('toField',toField);route.setAttribute('toNode',toNode);return route;}\nx3dom.glTF2Loader.prototype._getCenterAndSize=function(primitive)\n{var size=[1,1,1];var center=[0,0,0];if(primitive.attributes.POSITION!=undefined)\n{var accessor=this._gltf.accessors[primitive.attributes.POSITION];size[0]=accessor.max[0]-accessor.min[0];size[1]=accessor.max[1]-accessor.min[1];size[2]=accessor.max[2]-accessor.min[2];center[0]=accessor.min[0]+size[0]*0.5;center[1]=accessor.min[1]+size[1]*0.5;center[2]=accessor.min[2]+size[2]*0.5;}\nreturn{center:center,size:size};};x3dom.glTF2Loader.prototype._getVertexCount=function(primitive)\n{var vertexCount=0;var accessor;if(primitive.indices!=undefined)\n{accessor=this._gltf.accessors[primitive.indices];vertexCount=accessor.count;}\nelse if(primitive.attributes.POSITION!=undefined)\n{accessor=this._gltf.accessors[primitive.attributes.POSITION];vertexCount=accessor.count;}\nreturn vertexCount;}\nx3dom.glTF2Loader.prototype._sizeInBytes=function(componentType)\n{switch(componentType)\n{case 5120:return 1;case 5121:return 1;case 5122:return 2;case 5123:return 2;case 5125:return 4;case 5126:return 4;}};x3dom.glTF2Loader.prototype._componentsOf=function(type)\n{switch(type)\n{case\"SCALAR\":return 1;case\"VEC2\":return 2;case\"VEC3\":return 3;case\"VEC4\":return 4;case\"MAT2\":return 4;case\"MAT3\":return 9;case\"MAT4\":return 16;}};x3dom.glTF2Loader.prototype._bufferURI=function(value)\n{var uri=\"\",accessorIdx;if(value.attributes!=undefined&&value.attributes.POSITION!=undefined)\n{accessorIdx=value.attributes.POSITION;}\nelse if(value.input)\n{accessorIdx=value.input;}\nif(accessorIdx!=undefined)\n{var accessor=this._gltf.accessors[accessorIdx];var bufferView=this._gltf.bufferViews[accessor.bufferView];var buffer=this._gltf.buffers[bufferView.buffer];uri=x3dom.Utils.dataURIToObjectURL(buffer.uri);}\nreturn uri;};x3dom.glTF2Loader.prototype._USEorDEF=function(node,value)\n{if(this._definitions[value]!=undefined)\n{node.setAttribute(\"USE\",value);return true;}\nelse\n{node.setAttribute(\"DEF\",value);this._definitions[value]=value;return false;}}\nx3dom.glTF2Loader.prototype._primitiveType=function(mode)\n{switch(mode)\n{case 0:return\"POINTS\";case 1:return\"LINES\";case 2:return\"LINE_LOOP\";case 3:return\"LINE_STRIP\";case 4:return\"TRIANGLES\";case 5:return\"TRIANGLE_STRIP\";case 6:return\"TRIANGLE_FAN\";default:return\"TRIANGLES\";}};x3dom.glTF2Loader.prototype._isDefaultSampler=function(sampler)\n{return(sampler.wrapS==10497&&sampler.wrapS==10497&&sampler.magFilter==9729&&sampler.minFilter==9729);};x3dom.glTF2Loader.prototype._toAxisAngle=function(quat)\n{var result=[];var quat=new x3dom.fields.Quaternion(quat[0],quat[1],quat[2],quat[3]);var axisAngle=quat.toAxisAngle();result[0]=axisAngle[0].x;result[1]=axisAngle[0].y;result[2]=axisAngle[0].z;result[3]=axisAngle[1];return result;};x3dom.glTF2Loader.prototype._getGLTF=function(input,binary)\n{if(!binary)\n{return(typeof input==\"string\")?JSON.parse(input):input;}\nvar byteOffset=0;var header=new Uint32Array(input,byteOffset,3);if(header[0]==1179937895||header[1]==2)\n{byteOffset+=12;var jsonHeader=new Uint32Array(input,byteOffset,2);if(jsonHeader[1]==1313821514)\n{byteOffset+=8;var jsonData=new Uint8Array(input,byteOffset,jsonHeader[0]);byteOffset+=jsonHeader[0];var binaryHeader=new Uint32Array(input,byteOffset,2);if(binaryHeader[1]==5130562)\n{byteOffset+=8;var binaryData=new Uint8Array(input,byteOffset,binaryHeader[0]);var gltf=x3dom.Utils.arrayBufferToJSON(jsonData);gltf.buffers[0].uri=x3dom.Utils.arrayBufferToObjectURL(binaryData,\"application/octet-stream\");this._convertBinaryImages(gltf,input,byteOffset);return gltf;}}}};x3dom.glTF2Loader.prototype._convertBinaryImages=function(gltf,buffer,byteOffset)\n{if(gltf.images!=undefined)\n{for(var i=0;i<gltf.images.length;i++)\n{var image=gltf.images[i];if(image.bufferView!=undefined)\n{var bufferView=gltf.bufferViews[image.bufferView];bufferView.byteOffset=bufferView.byteOffset||0;var imageData=new Uint8Array(buffer,byteOffset+bufferView.byteOffset,bufferView.byteLength);image.uri=x3dom.Utils.arrayBufferToObjectURL(imageData,image.mimeType);}}}};x3dom.glTF2Loader.prototype._animationDuration=function(animation)\n{var duration=-1;for(var i=0;i<animation.channels.length;i++)\n{var channel=animation.channels[i];var sampler=animation.samplers[channel.sampler];var accessor=this._gltf.accessors[sampler.input];duration=Math.max(accessor.max[0],duration);}\nreturn duration;};if(x3dom.glTF==null)\nx3dom.glTF={};glTF_BUFFER_IDX={INDEX:0,POSITION:1,NORMAL:2,TEXCOORD:3,COLOR:4,TANGENT:6,BITANGENT:7};glTF_KHR_MATERIAL_COMMON_TECHNIQUE={BLINN:0,PHONG:1,LAMBERT:2,CONSTANT:3};PBR_MATERIAL_TECHNIQUE={METALLICROUGHNESS:0,SPECULARGLOSSINESS:1};x3dom.glTF.glTFMesh=function()\n{this.indexOffset=0;this.drawCount=0;this.numFaces=0;this.primitiveType=0;this.numCoords=0;this.buffers={};this.transform=new x3dom.fields.SFMatrix4f();this.material=null;};x3dom.glTF.glTFMesh.prototype.bindVertexAttribPointer=function(gl,shaderProgram)\n{if(this.buffers[x3dom.BUFFER_IDX.INDEX]){gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER,this.buffers[x3dom.BUFFER_IDX.INDEX].idx);}\nif(this.material!=null&&this.material.attributeMapping!=null)\n{var mapping=this.material.attributeMapping;this._bindVertexAttribPointer(gl,this.material.program[mapping[x3dom.BUFFER_IDX.POSITION]],this.buffers[x3dom.BUFFER_IDX.POSITION]);this._bindVertexAttribPointer(gl,this.material.program[mapping[x3dom.BUFFER_IDX.NORMAL]],this.buffers[x3dom.BUFFER_IDX.NORMAL]);this._bindVertexAttribPointer(gl,this.material.program[mapping[x3dom.BUFFER_IDX.TEXCOORD]],this.buffers[x3dom.BUFFER_IDX.TEXCOORD]);this._bindVertexAttribPointer(gl,this.material.program[mapping[x3dom.BUFFER_IDX.COLOR]],this.buffers[x3dom.BUFFER_IDX.COLOR]);this._bindVertexAttribPointer(gl,this.material.program[mapping[x3dom.BUFFER_IDX.TANGENT]],this.buffers[x3dom.BUFFER_IDX.TANGENT]);this._bindVertexAttribPointer(gl,this.material.program[mapping[x3dom.BUFFER_IDX.BITANGENT]],this.buffers[x3dom.BUFFER_IDX.BITANGENT]);}\nelse\n{this._bindVertexAttribPointer(gl,shaderProgram.position,this.buffers[x3dom.BUFFER_IDX.POSITION]);this._bindVertexAttribPointer(gl,shaderProgram.normal,this.buffers[x3dom.BUFFER_IDX.NORMAL]);this._bindVertexAttribPointer(gl,shaderProgram.texcoord,this.buffers[x3dom.BUFFER_IDX.TEXCOORD]);this._bindVertexAttribPointer(gl,shaderProgram.color,this.buffers[x3dom.BUFFER_IDX.COLOR]);this._bindVertexAttribPointer(gl,shaderProgram.tangent,this.buffers[x3dom.BUFFER_IDX.TANGENT]);this._bindVertexAttribPointer(gl,shaderProgram.bitangent,this.buffers[x3dom.BUFFER_IDX.BITANGENT]);}};x3dom.glTF.glTFMesh.prototype.bindVertexAttribPointerPosition=function(gl,shaderProgram,useMaterial)\n{if(this.buffers[x3dom.BUFFER_IDX.INDEX]){gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER,this.buffers[x3dom.BUFFER_IDX.INDEX].idx);}\nif(useMaterial==true&&this.material!=null&&this.material.attributeMapping!=null)\n{var mapping=this.material.attributeMapping;this._bindVertexAttribPointer(gl,this.material.program[mapping[x3dom.BUFFER_IDX.POSITION]],this.buffers[x3dom.BUFFER_IDX.POSITION]);}\nelse\n{this._bindVertexAttribPointer(gl,shaderProgram.position,this.buffers[x3dom.BUFFER_IDX.POSITION]);}};x3dom.glTF.glTFMesh.prototype._bindVertexAttribPointer=function(gl,shaderPosition,buffer)\n{if(shaderPosition!=null)\n{if(buffer!=null){gl.bindBuffer(gl.ARRAY_BUFFER,buffer.idx);gl.vertexAttribPointer(shaderPosition,buffer.numComponents,buffer.type,false,buffer.stride,buffer.offset);gl.enableVertexAttribArray(shaderPosition);}else{gl.disableVertexAttribArray(shaderPosition);}}};x3dom.glTF.glTFMesh.prototype.render=function(gl,polyMode)\n{if(this.material!=null&&!this.material.created())\nreturn;if(polyMode==null||polyMode>this.primitiveType)\npolyMode=this.primitiveType;if(this.buffers[x3dom.BUFFER_IDX.INDEX])\ngl.drawElements(polyMode,this.drawCount,this.buffers[x3dom.BUFFER_IDX.INDEX].type,this.buffers[x3dom.BUFFER_IDX.INDEX].offset);else\ngl.drawArrays(polyMode,0,this.drawCount);};x3dom.glTF.glTFTexture=function(gl,format,internalFormat,sampler,target,type,image,flip)\n{this.format=format;this.internalFormat=internalFormat;this.sampler=sampler;this.target=target;this.type=type;this.image=image;this.flip=flip;this.created=false;this.create(gl);};x3dom.glTF.glTFTexture.prototype.needsPowerOfTwo=function(gl)\n{var resize=true;resize&=(this.sampler.magFilter==gl.LINEAR||this.sampler.magFilter==gl.NEAREST);resize&=(this.sampler.minFilter==gl.LINEAR||this.sampler.minFilter==gl.NEAREST);resize&=(this.sampler.wrapS==gl.CLAMP_TO_EDGE);resize&=(this.sampler.wrapT==gl.CLAMP_TO_EDGE);return!resize;};x3dom.glTF.glTFTexture.prototype.needsMipMaps=function(gl)\n{var need=true;need&=(this.sampler.magFilter==gl.LINEAR||this.sampler.magFilter==gl.NEAREST);need&=(this.sampler.minFilter==gl.LINEAR||this.sampler.minFilter==gl.NEAREST);return!need;};x3dom.glTF.glTFTexture.prototype.create=function(gl)\n{if(this.image.complete==false)\nreturn;this.glTexture=gl.createTexture();var imgSrc=this.image;if(this.needsPowerOfTwo(gl)){var width=this.image.width;var height=this.image.height;var aspect=width/height;imgSrc=x3dom.Utils.scaleImage(this.image);var aspect2=imgSrc.width/imgSrc.height;if(Math.abs(aspect-aspect2)>0.01){console.warn(\"Image \"+this.image.src+\" was resized to power of two, but has unsupported aspect ratio and may be distorted!\");}}\nif(this.flip)\n{gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL,true);}\ngl.bindTexture(gl.TEXTURE_2D,this.glTexture);gl.texImage2D(gl.TEXTURE_2D,0,this.internalFormat,this.format,this.type,imgSrc);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,this.sampler.magFilter);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,this.sampler.minFilter);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,this.sampler.wrapS);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,this.sampler.wrapT);if(this.needsMipMaps(gl))\n{gl.generateMipmap(gl.TEXTURE_2D);}\nif(this.flip)\n{gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL,false);}\ngl.bindTexture(gl.TEXTURE_2D,null);this.created=true;};x3dom.glTF.glTFTexture.prototype.bind=function(gl,textureUnit,shaderProgram,uniformName)\n{gl.activeTexture(gl.TEXTURE0+textureUnit);if(!this.created)\nthis.create(gl);gl.bindTexture(gl.TEXTURE_2D,this.glTexture);gl.uniform1i(gl.getUniformLocation(shaderProgram,uniformName),textureUnit);};x3dom.glTF.PBRMaterial=function()\n{this.baseColorFactor=[0.3,0.1,0.1,1];this.baseColorTex=null;this.metallicFactor=0;this.metallicTex=null;this.roughnessFactor=0.2;this.roughnessTex=null;this.normalTex=null;this.occlusionTex=null;this.doubleSided=false;this.technique=PBR_MATERIAL_TECHNIQUE.METALLICROUGHNESS;this.attributeMapping={};this.attributeMapping[x3dom.BUFFER_IDX.POSITION]=\"position\";this.attributeMapping[x3dom.BUFFER_IDX.NORMAL]=\"normal\";this.attributeMapping[x3dom.BUFFER_IDX.TEXCOORD]=\"texcoord\";this.attributeMapping[x3dom.BUFFER_IDX.TANGENT]=\"tangent\";this.attributeMapping[x3dom.BUFFER_IDX.BITANGENT]=\"bitangent\";};x3dom.glTF.PBRMaterial.prototype.created=function()\n{if(this.baseColorTex!=null&&this.baseColorTex.created!=true)\nreturn false;if(this.metallicTex!=null&&this.metallicTex.created!=true)\nreturn false;if(this.roughnessTex!=null&&this.roughnessTex.created!=true)\nreturn false;if(this.normalTex!=null&&this.normalTex.created!=true)\nreturn false;if(this.occlusionTex!=null&&this.occlusionTex.created!=true)\nreturn false;return true;};x3dom.glTF.PBRMaterial.prototype.setShader=function(gl,cache,shape,properties)\n{properties.EMPTY_SHADER=0;properties.PBR_MATERIAL=1;if(this.baseColorTex!=null)\nproperties.USE_BASECOLOR_TEX=1;else\nproperties.USE_BASECOLOR_TEX=0;if(this.metallicTex!=null)\nproperties.USE_METALLIC_TEX=1;else\nproperties.USE_METALLIC_TEX=0;if(this.roughnessTex!=null)\nproperties.USE_ROUGHNESS_TEX=1;else\nproperties.USE_ROUGHNESS_TEX=0;if(this.normalTex!=null)\nproperties.USE_NORMAL_TEX=1;else\nproperties.USE_NORMAL_TEX=0;if(this.occlusionTex!=null)\nproperties.USE_OCCLUSION_TEX=1;else\nproperties.USE_OCCLUSION_TEX=0;properties.toIdentifier();this.program=cache.getShaderByProperties(gl,shape,properties);};x3dom.glTF.PBRMaterial.prototype.bind=function(gl,shaderProgram)\n{this.program.bind();for(var key in shaderProgram){if(!shaderProgram.hasOwnProperty(key))\ncontinue;if(this.program.hasOwnProperty(key))\nthis.program[key]=shaderProgram[key];}\nif(this.baseColorTex!=null)\nthis.baseColorTex.bind(gl,0,this.program.program,\"baseColorTex\");if(this.metallicTex!=null)\nthis.metallicTex.bind(gl,1,this.program.program,\"metallicTex\");if(this.roughnessTex!=null)\nthis.roughnessTex.bind(gl,2,this.program.program,\"roughnessTex\");if(this.normalTex!=null)\nthis.normalTex.bind(gl,3,this.program.program,\"normalTex\");if(this.occlusionTex!=null)\nthis.occlusionTex.bind(gl,4,this.program.program,\"occlusionTex\");this.program.baseColorFactor=this.baseColorFactor;this.program.metallicFactor=this.metallicFactor;this.program.roughnessFactor=this.roughnessFactor;this.program.technique=this.technique;};x3dom.glTF.glTFKHRMaterialCommons=function()\n{this.diffuse=[0.3,0.1,0.1,1];this.diffuseTex=null;this.emission=[0.0,0.0,0.0,1];this.emissionTex=null;this.specular=[0.8,0.8,0.8,1];this.specularTex=null;this.ambient=[0,0,0,1];this.shininess=2;this.transparency=0.0;this.globalAmbient=[0,0,0,1];this.lightVector=[1,0,0,1];this.doubleSided=false;this.technique=glTF_KHR_MATERIAL_COMMON_TECHNIQUE.PHONG;this.attributeMapping={};this.attributeMapping[x3dom.BUFFER_IDX.POSITION]=\"position\";this.attributeMapping[x3dom.BUFFER_IDX.NORMAL]=\"normal\";this.attributeMapping[x3dom.BUFFER_IDX.TEXCOORD]=\"texcoord\";this.attributeMapping[x3dom.BUFFER_IDX.COLOR]=\"color\";};x3dom.glTF.glTFKHRMaterialCommons.prototype.created=function()\n{if(this.diffuseTex!=null&&this.diffuseTex.created!=true)\nreturn false;if(this.emissionTex!=null&&this.emissionTex.created!=true)\nreturn false;if(this.specularTex!=null&&this.specularTex.created!=true)\nreturn false;return true;};x3dom.glTF.glTFKHRMaterialCommons.prototype.setShader=function(gl,cache,shape,properties)\n{properties.EMPTY_SHADER=0;properties.KHR_MATERIAL_COMMONS=1;if(this.diffuseTex!=null)\nproperties.USE_DIFFUSE_TEX=1;else\nproperties.USE_DIFFUSE_TEX=0;if(this.emissionTex!=null)\nproperties.USE_SPECULAR_TEX=1;else\nproperties.USE_SPECULAR_TEX=0;if(this.specularTex!=null)\nproperties.USE_EMISSION_TEX=1;else\nproperties.USE_EMISSION_TEX=0;properties.toIdentifier();this.program=cache.getShaderByProperties(gl,shape,properties);};x3dom.glTF.glTFKHRMaterialCommons.prototype.bind=function(gl,shaderProgram)\n{this.program.bind();for(var key in shaderProgram){if(!shaderProgram.hasOwnProperty(key))\ncontinue;if(this.program.hasOwnProperty(key))\nthis.program[key]=this.updateTransforms(key,shaderProgram[key]);}\nif(this.diffuseTex!=null)\nthis.diffuseTex.bind(gl,0,this.program.program,\"diffuseTex\");else\nthis.program.diffuse=this.diffuse;if(this.emissionTex!=null)\nthis.emissionTex.bind(gl,0,this.program.program,\"emissionTex\");else\nthis.program.emission=this.emission;if(this.specularTex!=null)\nthis.specularTex.bind(gl,0,this.program.program,\"specularTex\");else\nthis.program.specular=this.specular;this.program.shininess=this.shininess;this.program.transparency=this.transparency;this.program.globalAmbient=this.globalAmbient;this.program.lightVector=this.lightVector;this.program.lightVector=this.lightVector;this.program.technique=this.technique;};x3dom.glTF.glTFKHRMaterialCommons.prototype.updateTransforms=function(uniform,value)\n{var matrix4f=new x3dom.fields.SFMatrix4f();function glMultMatrix4(gl,m){matrix4f.setFromArray(gl);return matrix4f.mult(m).toGL();};switch(uniform){case\"modelViewInverseTransposeMatrix\":var worldInverse=this.worldTransform.inverse();matrix4f.setFromArray(value);var mat=worldInverse.mult(matrix4f).transpose().toGL();var model_view_inv_gl=[mat[0],mat[1],mat[2],mat[4],mat[5],mat[6],mat[8],mat[9],mat[10]];return model_view_inv_gl;break;case\"modelViewInverseMatrix\":var worldInverse=this.worldTransform.inverse();matrix4f.setFromArray(value);return worldInverse.mult(matrix4f);break;case\"modelViewMatrix\":case\"modelViewProjectionMatrix\":case\"modelMatrix\":case\"model\":return glMultMatrix4(value,this.worldTransform);break;case\"viewMatrix\":case\"projectionMatrix\":return value;break;default:return value;break;}\nconsole.warn(\"switch default not encountered ?\");return value;};x3dom.glTF.glTFMaterial=function(technique)\n{this.technique=technique;this.values={};this.semanticMapping={};this.attributeMapping={};this.textures={};for(var key in this.technique.uniforms)\n{if(this.technique.uniforms.hasOwnProperty(key))\n{var parameter=this.technique.parameters[this.technique.uniforms[key]];if(parameter.semantic!=null)\nswitch(parameter.semantic)\n{case\"MODELVIEW\":this.semanticMapping[key]=\"modelViewMatrix\";break;case\"MODELVIEWINVERSETRANSPOSE\":this.semanticMapping[key]=\"modelViewInverseTransposeMatrix\";break;case\"PROJECTION\":this.semanticMapping[key]=\"projectionMatrix\";break;case\"MODEL\":this.semanticMapping[key]=\"modelMatrix\";break;case\"MODELVIEWPROJECTION\":this.semanticMapping[key]=\"modelViewProjectionMatrix\";break;case\"VIEW\":this.semanticMapping[key]=\"viewMatrix\";break;case\"MODELVIEWINVERSE\":this.semanticMapping[key]=\"modelViewInverseMatrix\";break;default:break;}}}\nfor(var key in this.technique.attributes){if(this.technique.attributes.hasOwnProperty(key)){var parameter=this.technique.parameters[this.technique.attributes[key]];if(parameter.semantic!=null)\nswitch(parameter.semantic){case\"POSITION\":this.attributeMapping[x3dom.BUFFER_IDX.POSITION]=key;break;case\"NORMAL\":this.attributeMapping[x3dom.BUFFER_IDX.NORMAL]=key;break;case\"TEXCOORD_0\":this.attributeMapping[x3dom.BUFFER_IDX.TEXCOORD]=key;break;case\"COLOR\":this.attributeMapping[x3dom.BUFFER_IDX.COLOR]=key;break;default:break;}}}};x3dom.glTF.glTFMaterial.prototype.created=function()\n{for(var key in this.textures){if(!this.textures.hasOwnProperty(key))continue;if(this.textures[key].created!=true)\nreturn false;}\nreturn true;};x3dom.glTF.glTFMaterial.prototype.bind=function(gl,shaderParameter)\n{if(this.program!=null)\nthis.program.bind();this.updateTransforms(shaderParameter);var texUnit=0;for(var key in this.technique.uniforms)\nif(this.technique.uniforms.hasOwnProperty(key))\n{var uniformName=this.technique.uniforms[key];if(this.textures[uniformName]!=null){var texture=this.textures[uniformName];texture.bind(gl,texUnit,this.program.program,key);texUnit++;}\nelse if(this.values[uniformName]!=null)\nthis.program[key]=this.values[uniformName];}};x3dom.glTF.glTFMaterial.prototype.updateTransforms=function(shaderParameter)\n{var matrix4f=new x3dom.fields.SFMatrix4f();function glMultMatrix4(gl,m){matrix4f.setFromArray(gl);return matrix4f.mult(m).toGL();}\nif(this.program!==null)\n{this.program.bind();for(var key in this.semanticMapping){if(!this.semanticMapping.hasOwnProperty(key))continue;var worldInverse;var mapping=this.semanticMapping[key];switch(mapping){case\"modelViewMatrix\":this.program[key]=shaderParameter.modelViewMatrix;break;case\"viewMatrix\":this.program[key]=shaderParameter.viewMatrix;break;case\"modelViewInverseTransposeMatrix\":worldInverse=this.worldTransform.inverse();matrix4f.setFromArray(shaderParameter.modelViewMatrixInverse);var mat=worldInverse.mult(matrix4f).transpose().toGL();var model_view_inv_gl=[mat[0],mat[1],mat[2],mat[4],mat[5],mat[6],mat[8],mat[9],mat[10]];this.program[key]=model_view_inv_gl;break;case\"modelViewInverseMatrix\":worldInverse=shaderParameter.model.inverse();matrix4f.setFromArray(shaderParameter.modelViewMatrixInverse);this.program[key]=worldInverse.mult(matrix4f);break;case\"modelViewProjectionMatrix\":this.program[key]=shaderParameter.modelViewProjectionMatrix;break;case\"modelMatrix\":this.program[key]=shaderParameter.model;break;case\"projectionMatrix\":this.program[key]=shaderParameter.projectionMatrix;break;default:break;}}}};x3dom.DDSLoader={};x3dom.DDSLoader.load=function(src)\n{return new Promise(function(resolve,reject){var xhr=new XMLHttpRequest();xhr.open('GET',src,true);xhr.responseType=\"arraybuffer\";xhr.onload=function()\n{var dds=x3dom.DDSLoader._read(xhr.response);if(dds)\n{resolve(dds);}\nelse\n{reject(dds);}};xhr.onerror=function()\n{reject();};x3dom.RequestManager.addRequest(xhr);});}\nx3dom.DDSLoader._read=function(source)\n{if(source===undefined||source.byteLength<128)\n{return;}\nlet dds={isCompressed:false,isVolume:false,isCubeMap:false,targets:[],data:[]};let int32Buffer=new Uint32Array(source,0,32);dds.header=x3dom.DDSLoader._readHeader(int32Buffer);int32Buffer=new Uint32Array(source,128,5);dds.header10=x3dom.DDSLoader._readHeader10(dds,int32Buffer);if(dds.header.dwMagic!=0x20534444)\n{return;}\nif(dds.header.dwSize!=0x7C)\n{return;}\nif(!x3dom.DDSLoader._readFormat(dds))\n{return;}\nx3dom.DDSLoader._readMipmapCount(dds);x3dom.DDSLoader._readType(dds);this._readData(dds,source);return dds;}\nx3dom.DDSLoader._readHeader=function(buffer)\n{return{dwMagic:buffer[0],dwSize:buffer[1],dwFlags:x3dom.DDSLoader._readDDSFlags(buffer[2]),dwHeight:buffer[3],dwWidth:buffer[4],dwPitchOrLinearSize:buffer[5],dwDepth:buffer[6],dwMipMapCount:buffer[7],dwReserved1:\"UNUSED\",ddspf:{dwSize:buffer[19],dwFlags:x3dom.DDSLoader._readPFFlags(buffer[20]),dwFourCC:x3dom.DDSLoader.int32ToFourCC(buffer[21]),dwRGBBitCount:buffer[22],dwRBitMask:buffer[23],dwGBitMask:buffer[24],dwBBitMask:buffer[25],dwABitMask:buffer[26]},dwCaps:x3dom.DDSLoader._readCapsFlags(buffer[27]),dwCaps2:x3dom.DDSLoader._readCaps2Flags(buffer[28]),dwCaps3:\"UNUSED\",dwCaps4:\"UNUSED\",dwReserved2:\"UNUSED\"}};x3dom.DDSLoader._readHeader10=function(dds,buffer)\n{if(dds.header.ddspf.dwFourCC!=\"DX10\")\n{return null;}\nreturn{dxgiFormat:buffer[0],resourceDimension:x3dom.DDSLoader._readResourceDimension(buffer[1]),miscFlags:x3dom.DDSLoader._readMiscFlags(buffer[2]),arraySize:buffer[3],miscFlags2:x3dom.DDSLoader._readMiscFlags2(buffer[4]),}};x3dom.DDSLoader._readMipmapCount=function(dds)\n{dds.numberOfMipmaps=(dds.header.dwFlags.DDSD_MIPMAPCOUNT)?dds.header.dwMipMapCount:1;}\nx3dom.DDSLoader._readType=function(dds)\n{if(dds.header.dwFlags.DDSD_DEPTH&&dds.header.dwCaps2.DDSCAPS2_VOLUME)\n{dds.type=32879;dds.numberOfImages=dds.header.dwCaps.DDSD_DEPTH;}\nelse if(dds.header.dwCaps2.DDSCAPS2_CUBEMAP)\n{dds.type=34067;if(dds.header.dwCaps2.DDSCAPS2_CUBEMAP_POSITIVEX)\n{dds.targets.push(34069);}\nif(dds.header.dwCaps2.DDSCAPS2_CUBEMAP_NEGATIVEX)\n{dds.targets.push(34070);}\nif(dds.header.dwCaps2.DDSCAPS2_CUBEMAP_POSITIVEY)\n{dds.targets.push(34071);}\nif(dds.header.dwCaps2.DDSCAPS2_CUBEMAP_NEGATIVEY)\n{dds.targets.push(34072);}\nif(dds.header.dwCaps2.DDSCAPS2_CUBEMAP_POSITIVEZ)\n{dds.targets.push(34073);}\nif(dds.header.dwCaps2.DDSCAPS2_CUBEMAP_NEGATIVEZ)\n{dds.targets.push(34074);}\ndds.numberOfImages=dds.targets.length;}\nelse\n{dds.type=3553;dds.targets.push(3553);dds.numberOfImages=dds.targets.length;}};x3dom.DDSLoader._readDDSFlags=function(dwFlags)\n{return{DDSD_CAPS:(dwFlags&0x1)?true:false,DDSD_HEIGHT:(dwFlags&0x2)?true:false,DDSD_WIDTH:(dwFlags&0x4)?true:false,DDSD_PITCH:(dwFlags&0x8)?true:false,DDSD_PIXELFORMAT:(dwFlags&0x1000)?true:false,DDSD_MIPMAPCOUNT:(dwFlags&0x20000)?true:false,DDSD_LINEARSIZE:(dwFlags&0x80000)?true:false,DDSD_DEPTH:(dwFlags&0x800000)?true:false}}\nx3dom.DDSLoader._readPFFlags=function(dwFlags)\n{return{DDPF_ALPHAPIXELS:(dwFlags&0x1)?true:false,DDPF_ALPHA:(dwFlags&0x2)?true:false,DDPF_FOURCC:(dwFlags&0x4)?true:false,DDPF_RGB:(dwFlags&0x40)?true:false,DDPF_YUV:(dwFlags&0x200)?true:false,DDPF_LUMINANCE:(dwFlags&0x20000)?true:false}}\nx3dom.DDSLoader._readCapsFlags=function(dwFlags)\n{return{DDSCAPS_COMPLEX:(dwFlags&0x8)?true:false,DDSCAPS_MIPMAP:(dwFlags&0x400000)?true:false,DDSCAPS_TEXTURE:(dwFlags&0x1000)?true:false}}\nx3dom.DDSLoader._readCaps2Flags=function(dwFlags)\n{return{DDSCAPS2_CUBEMAP:(dwFlags&0x200)?true:false,DDSCAPS2_CUBEMAP_POSITIVEX:(dwFlags&0x400)?true:false,DDSCAPS2_CUBEMAP_NEGATIVEX:(dwFlags&0x800)?true:false,DDSCAPS2_CUBEMAP_POSITIVEY:(dwFlags&0x1000)?true:false,DDSCAPS2_CUBEMAP_NEGATIVEY:(dwFlags&0x2000)?true:false,DDSCAPS2_CUBEMAP_POSITIVEZ:(dwFlags&0x4000)?true:false,DDSCAPS2_CUBEMAP_NEGATIVEZ:(dwFlags&0x8000)?true:false,DDSCAPS2_VOLUME:(dwFlags&0x20000)?true:false}}\nx3dom.DDSLoader._readResourceDimension=function(resourceDimension)\n{switch(resourceDimension)\n{case 0x0:return\"D3D10_RESOURCE_DIMENSION_UNKNOWN\";case 0x1:return\"D3D10_RESOURCE_DIMENSION_BUFFER\";case 0x2:return\"D3D10_RESOURCE_DIMENSION_TEXTURE1D\";case 0x3:return\"D3D10_RESOURCE_DIMENSION_TEXTURE2D\";case 0x4:return\"D3D10_RESOURCE_DIMENSION_TEXTURE3D\";}}\nx3dom.DDSLoader._readMiscFlags=function(miscFlag)\n{return{D3D11_RESOURCE_MISC_GENERATE_MIPS:(miscFlag&0x1)?true:false,D3D11_RESOURCE_MISC_SHARED:(miscFlag&0x2)?true:false,D3D11_RESOURCE_MISC_TEXTURECUBE:(miscFlag&0x4)?true:false,D3D11_RESOURCE_MISC_DRAWINDIRECT_ARGS:(miscFlag&0x10)?true:false,D3D11_RESOURCE_MISC_BUFFER_ALLOW_RAW_VIEWS:(miscFlag&0x20)?true:false,D3D11_RESOURCE_MISC_BUFFER_STRUCTURED:(miscFlag&0x40)?true:false,D3D11_RESOURCE_MISC_RESOURCE_CLAMP:(miscFlag&0x80)?true:false,D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX:(miscFlag&0x100)?true:false,D3D11_RESOURCE_MISC_GDI_COMPATIBLE:(miscFlag&0x200)?true:false,D3D11_RESOURCE_MISC_SHARED_NTHANDLE:(miscFlag&0x800)?true:false,D3D11_RESOURCE_MISC_RESTRICTED_CONTENT:(miscFlag&0x1000)?true:false,D3D11_RESOURCE_MISC_RESTRICT_SHARED_RESOURCE:(miscFlag&0x2000)?true:false,D3D11_RESOURCE_MISC_RESTRICT_SHARED_RESOURCE_DRIVER:(miscFlag&0x4000)?true:false,D3D11_RESOURCE_MISC_GUARDED:(miscFlag&0x8000)?true:false,D3D11_RESOURCE_MISC_TILE_POOL:(miscFlag&0x20000)?true:false,D3D11_RESOURCE_MISC_TILED:(miscFlag&0x40000)?true:false,D3D11_RESOURCE_MISC_HW_PROTECTED:(miscFlag&0x80000)?true:false,}}\nx3dom.DDSLoader._readMiscFlags2=function(miscFlag)\n{let miscFlags2={};switch(miscFlag)\n{case 0x0:miscFlags2.alphaMode=\"DDS_ALPHA_MODE_UNKNOWN\";break;case 0x1:miscFlags2.alphaMode=\"DDS_ALPHA_MODE_UNKNOWN\";break;case 0x2:miscFlags2.alphaMode=\"DDS_ALPHA_MODE_UNKNOWN\";break;case 0x3:miscFlags2.alphaMode=\"DDS_ALPHA_MODE_UNKNOWN\";break;case 0x4:miscFlags2.alphaMode=\"DDS_ALPHA_MODE_UNKNOWN\";break;}\nreturn miscFlags2;}\nx3dom.DDSLoader._readData=function(dds,buffer,texture,options)\n{var offset=(dds.header10)?148:128;var byteArray,width,height;dds.width=dds.header.dwWidth;dds.height=dds.header.dwHeight;dds.generateMipmaps=(dds.numberOfMipmaps<=1&&!dds.isCompressed);for(let i=0;i<dds.numberOfImages;i++)\n{width=dds.header.dwWidth;height=dds.header.dwHeight;dds.data[dds.targets[i]]=[];for(var m=0;m<dds.numberOfMipmaps;m++)\n{if(m!=0)\n{width=Math.max(width*0.5,1);height=Math.max(height*0.5,1);}\nif(dds.isCompressed)\n{byteArray=this._readCompressedData(buffer,width,height,offset,dds.blockSize);dds.data[dds.targets[i]][m]=byteArray;}\nelse\n{byteArray=this._readUncompressedData(buffer,width,height,offset,dds.format);dds.data[dds.targets[i]][m]=byteArray;}\noffset+=byteArray.length*byteArray.BYTES_PER_ELEMENT*dds.format.bytesPerElementFactor;}}\nif(dds.format.overwriteType)\n{dds.format.type=dds.format.overwriteType;}\nif(dds.format.overwriteInternalType)\n{dds.format.internal=dds.format.overwriteInternalType;}\nreturn dds;};x3dom.DDSLoader._readCompressedData=function(buffer,width,height,offset,blockSize)\n{let length=Math.max(1,parseInt((width+3)/4))*Math.max(1,parseInt((height+3)/4))*blockSize;return new Uint8Array(buffer.slice(offset,offset+length));}\nx3dom.DDSLoader._readUncompressedData=function(buffer,width,height,offset,format,type)\n{format.bytesPerElementFactor=1;if(format.internal==6406)\n{return new Uint8Array(buffer.slice(offset,offset+width*height));}\nelse if(format.internal==6409)\n{return new Uint8Array(buffer.slice(offset,offset+width*height));}\nelse if(format.internal==6410)\n{return new Uint8Array(buffer.slice(offset,offset+width*height*2));}\nelse if(format.internal==6407)\n{return x3dom.DDSLoader.R8G8B8_To_B8G8R8(new Uint8Array(buffer.slice(offset,offset+width*height*3)));}\nelse if(format.internal==36194)\n{return new Uint16Array(buffer.slice(offset,offset+width*height*2));}\nelse if(format.internal==6408&&format.type!=36193&&format.type!=5126)\n{return x3dom.DDSLoader.A8R8G8B8_To_A8B8G8R8(new Uint8Array(buffer.slice(offset,offset+width*height*4)));}\nelse if(format.internal==32854)\n{return x3dom.DDSLoader.A4R4G4B4_To_A4B4G4R4(new Uint16Array(buffer.slice(offset,offset+width*height*2)));}\nelse if(format.internal==32855)\n{return x3dom.DDSLoader.A1R5G5B5_To_A1B5G5R5(new Uint16Array(buffer.slice(offset,offset+width*height*2)));}\nelse if(format.internal==34842||format.type==36193)\n{if(x3dom.caps.HFP_TEXTURES||x3dom.caps.WEBGL_VERSION==2)\n{return new Uint16Array(buffer.slice(offset,offset+width*height*4*2));}\nelse if(x3dom.caps.FP_TEXTURES)\n{format.overwriteType=5126;format.overwriteInternalType=(x3dom.caps.WEBGL_VERSION==2)?34836:6408;format.bytesPerElementFactor=0.5;return x3dom.DDSLoader.UI16_To_F32(new Uint16Array(buffer.slice(offset,offset+width*height*4*2)));}\nelse\n{format.overwriteType=5121;format.overwriteInternalType=6408;format.bytesPerElementFactor=2;return x3dom.DDSLoader.UI16_To_UI8(new Uint16Array(buffer.slice(offset,offset+width*height*4*2)));}}\nelse if(format.internal==34836||format.type==5126)\n{if(x3dom.caps.FP_TEXTURES||x3dom.caps.WEBGL_VERSION==2)\n{return new Float32Array(buffer.slice(offset,offset+width*height*4*4));}\nelse\n{}}\nelse if(format.internal==35898)\n{return new Uint8Array(buffer.slice(offset,offset+width*height*3));}};x3dom.DDSLoader._readFormat=function(dds)\n{let pixelFormat=dds.header.ddspf;if(pixelFormat.dwFlags.DDPF_FOURCC)\n{if(pixelFormat.dwFourCC==\"DXT1\")\n{dds.blockSize=8;dds.isCompressed=true;dds.format={internal:33776,format:6407,type:5121};}\nelse if(pixelFormat.dwFourCC==\"DXT3\")\n{dds.blockSize=16;dds.isCompressed=true;dds.format={internal:33778,format:6408,type:5121};}\nelse if(pixelFormat.dwFourCC==\"DXT5\")\n{dds.blockSize=16;dds.isCompressed=true;dds.format={internal:33779,format:6408,type:5121};}\nelse if(pixelFormat.dwFourCC==\"t\")\n{if(x3dom.caps.WEBGL_VERSION==2)\n{dds.format={internal:34836,format:6408,type:5126};}\nelse\n{dds.format={internal:6408,format:6408,type:5126};}}\nelse if(pixelFormat.dwFourCC==\"q\"||pixelFormat.dwFourCC==\"$\")\n{if(x3dom.caps.WEBGL_VERSION==2)\n{dds.format={internal:34842,format:6408,type:5131};}\nelse\n{dds.format={internal:6408,format:6408,type:36193};}}\nelse\n{return false;}}\nelse if(pixelFormat.dwFlags.DDPF_RGB&&!pixelFormat.dwFlags.DDPF_ALPHAPIXELS)\n{if(pixelFormat.dwRGBBitCount==24&&pixelFormat.dwRBitMask==0xff0000&&pixelFormat.dwGBitMask==0xff00&&pixelFormat.dwBBitMask==0xff)\n{dds.format={internal:6407,format:6407,type:5121};}\nelse if(pixelFormat.dwRGBBitCount==16&&pixelFormat.dwRBitMask==0xf800&&pixelFormat.dwGBitMask==0x7e0&&pixelFormat.dwBBitMask==0x1f)\n{dds.format={internal:36194,format:6407,type:33635};}\nelse\n{return false;}}\nelse if(pixelFormat.dwFlags.DDPF_RGB&&pixelFormat.dwFlags.DDPF_ALPHAPIXELS)\n{if(pixelFormat.dwRGBBitCount==32&&pixelFormat.dwRBitMask==0xff0000&&pixelFormat.dwGBitMask==0xff00&&pixelFormat.dwBBitMask==0xff&&pixelFormat.dwABitMask==0xff000000)\n{dds.format={internal:6408,format:6408,type:5121};}\nelse if(pixelFormat.dwRGBBitCount==16&&pixelFormat.dwRBitMask==0xf00&&pixelFormat.dwGBitMask==0xf0&&pixelFormat.dwBBitMask==0xf&&pixelFormat.dwABitMask==0xf000)\n{dds.format={internal:32854,format:6408,type:32819};}\nelse if(pixelFormat.dwRGBBitCount==16&&pixelFormat.dwRBitMask==0x7C00&&pixelFormat.dwGBitMask==0x3E0&&pixelFormat.dwBBitMask==0x1F&&pixelFormat.dwABitMask==0x8000)\n{dds.format={internal:32855,format:6408,type:32820};}\nelse\n{return false;}}\nelse if(pixelFormat.dwFlags.DDPF_LUMINANCE&&!pixelFormat.dwFlags.DDPF_ALPHAPIXELS)\n{if(pixelFormat.dwRGBBitCount==8&&pixelFormat.dwRBitMask==0xff)\n{dds.format={internal:6409,format:6409,type:5121};}\nelse\n{return false;}}\nelse if(pixelFormat.dwFlags.DDPF_LUMINANCE&&pixelFormat.dwFlags.DDPF_ALPHAPIXELS)\n{if(pixelFormat.dwRGBBitCount==16&&pixelFormat.dwRBitMask==0xff&&pixelFormat.dwABitMask==0xff00)\n{dds.format={internal:6410,format:6410,type:5121};}\nelse\n{return false;}}\nelse if(pixelFormat.dwFlags.DDPF_ALPHA)\n{if(pixelFormat.dwRGBBitCount==8&&pixelFormat.dwABitMask==0xff)\n{dds.format={internal:6406,format:6406,type:5121};}\nelse\n{return false;}}\nelse\n{return false;}\nreturn true;};x3dom.DDSLoader.int32ToFourCC=function(value)\n{return String.fromCharCode((value)&0xff,(value>>8)&0xff,(value>>16)&0xff,(value>>24)&0xff).replace(/[\\x00]/g,\"\");};x3dom.DDSLoader.R8G8B8_To_B8G8R8=function(src)\n{var dst=new Uint8Array(src.length);for(var i=0;i<src.length;i+=3)\n{dst[i]=src[i+1];dst[i+1]=src[i+0];dst[i+2]=src[i+2];}\nreturn dst;};x3dom.DDSLoader.A8R8G8B8_To_A8B8G8R8=function(src)\n{var dst=new Uint8Array(src.length);for(var i=0;i<src.length;i+=4)\n{dst[i]=src[i+2];dst[i+1]=src[i+1];dst[i+2]=src[i+0];dst[i+3]=src[i+3];}\nreturn dst;};x3dom.DDSLoader.UI16_To_UI8=function(src)\n{var dst=new Uint8Array(src.length);for(var i=0;i<src.length;i+=4)\n{dst[i]=x3dom.DDSLoader.UI16_To_UI8_2(src[i])*255;dst[i+1]=x3dom.DDSLoader.UI16_To_UI8_2(src[i+1])*255;dst[i+2]=x3dom.DDSLoader.UI16_To_UI8_2(src[i+2])*255;dst[i+3]=x3dom.DDSLoader.UI16_To_UI8_2(src[i+3])*255;}\nreturn dst;};x3dom.DDSLoader.UI16_To_F32=function(src)\n{var dst=new Float32Array(src.length);for(var i=0;i<src.length;i+=4)\n{dst[i]=x3dom.DDSLoader.UI16_To_F16(src[i]);dst[i+1]=x3dom.DDSLoader.UI16_To_F16(src[i+1]);dst[i+2]=x3dom.DDSLoader.UI16_To_F16(src[i+2]);dst[i+3]=x3dom.DDSLoader.UI16_To_F16(src[i+3]);}\nreturn dst;};x3dom.DDSLoader.UI16_To_F16=function(interger)\n{var sign=(interger>>15)&0x1;var exponent=(interger>>10)&0x3ff;var fraction=interger&(Math.pow(2,10)-1);var result;if(exponent===0)\n{if(fraction===0)\n{result=0.0;}\nelse\n{result=Math.pow(-1,sign)*fraction/Math.pow(2,10)*Math.pow(2,-14)}}\nresult=Math.pow(-1,sign)*(1+fraction/Math.pow(2,10))*Math.pow(2,exponent-15);return result;}\nx3dom.DDSLoader.UI16_To_UI8_2=function(interger)\n{var float=x3dom.DDSLoader.UI16_To_F16(interger)\nreturn float/(float+1);}\nx3dom.DDSLoader.A4R4G4B4_To_A4B4G4R4=function(src){var a,r,g,b;var dst=new Uint16Array(src.length);for(var i=0;i<src.length;i++)\n{a=(src[i]>>12)&0xf;r=(src[i]>>8)&0xf;g=(src[i]>>4)&0xf;b=(src[i])&0xf;var test=(r<<12)&(g<<8)&(b<<4)&(a);dst[i]=(r<<12)&(g<<8)&(b<<4)&(a);}\nreturn dst;};x3dom.DDSLoader.A1R5G5B5_To_A1B5G5R5=function(src)\n{var a,r,g,b;var dst=new Uint16Array(src.length);for(var i=0;i<src.length;i++)\n{a=(src[i]>>15)&0x1;r=(src[i]>>10)&0x1f;g=(src[i]>>5)&0x5f;b=(src[i])&0x5f;dst[i]=(r<<11)&(g<<6)&(b<<1)&(a);}\nreturn dst;};x3dom.VRControllerManager=function()\n{this.leftInline=undefined;this.leftTransform=undefined;this.rightInline=undefined;this.rightTransform=undefined;this.leftGamepadIdx=undefined;this.rightGamepadIdx=undefined;this.vrDisplay=undefined;this.wasPresenting=false;this.controllers={\"HTC Vive MV\":{left:\"https://x3dom.org/download/assets/vr/vive.glb\",right:\"https://x3dom.org/download/assets/vr/vive.glb\",scaleFactor:new x3dom.fields.SFVec3f(40,40,40),offset:new x3dom.fields.SFVec3f(),axesScale:[1,1]},\"Oculus Oculus Rift CV1\":{left:\"https://x3dom.org/download/assets/vr/oculus-touch-left.glb\",right:\"https://x3dom.org/download/assets/vr/oculus-touch-right.glb\",scaleFactor:new x3dom.fields.SFVec3f(39.5,39.5,39.5),offset:new x3dom.fields.SFVec3f(),axesScale:[1,1]},\"Oculus Go\":{left:\"https://x3dom.org/download/assets/vr/oculus-go.glb\",right:\"https://x3dom.org/download/assets/vr/oculus-go.glb\",scaleFactor:new x3dom.fields.SFVec3f(1,1,1),offset:new x3dom.fields.SFVec3f(0.2,-0.3,-0.3),axesScale:[1,-1]},\"Emulated HTC Vive DVT\":{left:\"https://x3dom.org/download/assets/vr/vive.glb\",right:\"https://x3dom.org/download/assets/vr/vive.glb\",scaleFactor:new x3dom.fields.SFVec3f(40,40,40),offset:new x3dom.fields.SFVec3f(),axesScale:[1,1]},\"WindowsMR DELL VISOR VR118\":{left:\"https://x3dom.org/download/assets/vr/microsoft-left.glb\",right:\"https://x3dom.org/download/assets/vr/microsoft-right.glb\",scaleFactor:new x3dom.fields.SFVec3f(40,40,40),offset:new x3dom.fields.SFVec3f(),axesScale:[1,1]}}\nthis._addInlines();this._addGamePadListeners();};x3dom.VRControllerManager.prototype._addGamePadListeners=function()\n{window.addEventListener(\"gamepadconnected\",this._onGamePadConnected.bind(this));window.addEventListener(\"gamepaddisconnected\",this._onGamePadDisconnected.bind(this));}\nx3dom.VRControllerManager.prototype._onGamePadConnected=function(e)\n{var gamepad=e.gamepad;navigator.getVRDisplays().then(function(displays){var display=displays[0];if(display&&gamepad.displayId==display.displayId)\n{var controller=this.controllers[display.displayName];if(!controller)\n{return;}\nif(gamepad.hand==\"left\")\n{this.leftGamepadIdx=gamepad.index;this.leftInline.setAttribute(\"url\",controller.left);}\nelse if(gamepad.hand==\"right\")\n{this.rightGamepadIdx=gamepad.index;this.rightInline.setAttribute(\"url\",controller.right,controller.scaleFactor);}}}.bind(this));}\nx3dom.VRControllerManager.prototype._onGamePadDisconnected=function(e)\n{console.log(e);}\nx3dom.VRControllerManager.prototype._addInlines=function()\n{var x3dScene=document.querySelector(\"scene\")||document.querySelector(\"Scene\")\nif(x3dScene)\n{this.leftTransform=document.createElement(\"matrixtransform\");this.leftInline=document.createElement(\"inline\");this.rightTransform=document.createElement(\"matrixtransform\");this.rightInline=document.createElement(\"inline\");this.leftInline.setAttribute(\"render\",\"false\");this.rightInline.setAttribute(\"render\",\"false\");this.leftTransform.appendChild(this.leftInline);this.rightTransform.appendChild(this.rightInline);x3dScene.appendChild(this.leftTransform);x3dScene.appendChild(this.rightTransform);}}\nx3dom.VRControllerManager.prototype.fit=function(viewarea,vrDisplay)\n{var min=viewarea._scene._lastMin;var max=viewarea._scene._lastMax;var dia2=max.subtract(min).multiply(0.5);var bsr=dia2.length();var viewDir=viewarea.vrLeftViewMatrix.e2();var aspect=Math.min(viewarea._width/viewarea._height,1);var tanfov2=Math.tan(1.57/2.0);var dist=bsr/tanfov2/aspect;viewarea._movement=viewDir.multiply(-dist)}\nx3dom.VRControllerManager.prototype.update=function(viewarea,vrDisplay)\n{if(!vrDisplay||(vrDisplay&&!vrDisplay.isPresenting))\n{if(this.wasPresenting)\n{this.leftInline.setAttribute(\"render\",\"false\");this.rightInline.setAttribute(\"render\",\"false\");this.wasPresenting=false;}\nreturn;}\nelse\n{if(!this.wasPresenting)\n{this.leftInline.setAttribute(\"render\",\"true\");this.rightInline.setAttribute(\"render\",\"true\");this.fit(viewarea,vrDisplay);}\nthis.wasPresenting=true;}\nvar gamepads=navigator.getGamepads();var controller={};if(this.leftGamepadIdx!=undefined&&gamepads[this.leftGamepadIdx])\n{var gamepad=gamepads[this.leftGamepadIdx];controller.left=gamepad;}\nif(this.rightGamepadIdx!=undefined&&gamepads[this.rightGamepadIdx])\n{var gamepad=gamepads[this.rightGamepadIdx];controller.right=gamepad;}\nthis.onUpdate(viewarea,vrDisplay,controller);}\nx3dom.VRControllerManager.prototype.onUpdate=function(viewarea,vrDisplay,controllers)\n{var transMat=new x3dom.fields.SFMatrix4f();var rotMat=new x3dom.fields.SFMatrix4f();var axes=[0,0];var axesScale=this.controllers[vrDisplay.displayName].axesScale;if(controllers.left)\n{axes[0]+=controllers.left.axes[0]*axesScale[0];axes[1]+=controllers.left.axes[1]*axesScale[1];if(controllers.left.buttons[1].pressed)\n{this.fit(viewarea);}}\nif(controllers.right)\n{axes[0]+=controllers.right.axes[0]*axesScale[0];axes[1]+=controllers.right.axes[1]*axesScale[1];if(controllers.right.buttons[1].pressed)\n{this.fit(viewarea);}}\nvar dx=axes[0]*5;var dy=axes[1]*5;var viewDir=viewarea.vrLeftViewMatrix.e2();var rightDir=viewarea.vrLeftViewMatrix.e0();var d=(viewarea._scene._lastMax.subtract(viewarea._scene._lastMin)).length();d=((d<x3dom.fields.Eps)?1:d);viewDir=new x3dom.fields.SFVec3f(-viewDir.x,-viewDir.y,viewDir.z).multiply(d*(dy/viewarea._height));rightDir=new x3dom.fields.SFVec3f(-rightDir.x,-rightDir.y,rightDir.z).multiply(d*(dx/viewarea._width));viewarea._movement=viewarea._movement.add(rightDir).add(viewDir);transMat=x3dom.fields.SFMatrix4f.translation(viewarea._movement);viewarea.vrLeftViewMatrix=viewarea.vrLeftViewMatrix.mult(transMat).mult(rotMat);viewarea.vrRightViewMatrix=viewarea.vrRightViewMatrix.mult(transMat).mult(rotMat);this._updateControllerModels(viewarea,vrDisplay,controllers);}\nx3dom.VRControllerManager.prototype._updateControllerModels=function(viewarea,vrDisplay,controllers)\n{if(!vrDisplay||(vrDisplay&&!vrDisplay.isPresenting))\n{this.leftInline.setAttribute(\"render\",\"false\");this.rightInline.setAttribute(\"render\",\"false\");return;}\nelse\n{this.leftInline.setAttribute(\"render\",\"true\");this.rightInline.setAttribute(\"render\",\"true\");}\nif(controllers.left)\n{var pose=controllers.left.pose;var rotation=(pose.orientation)?x3dom.fields.Quaternion.fromArray(pose.orientation):new x3dom.fields.Quaternion();var position=(pose.position)?x3dom.fields.SFVec3f.fromArray(pose.position):this.controllers[vrDisplay.displayName].offset;var scale=this.controllers[vrDisplay.displayName].scaleFactor;position=position.subtract(viewarea._movement);var matrix=x3dom.fields.SFMatrix4f.fromRotationTranslationScale(rotation,position,scale);this.leftTransform.setAttribute(\"matrix\",matrix.toString());}\nif(controllers.right)\n{var pose=controllers.right.pose;var rotation=(pose.orientation)?x3dom.fields.Quaternion.fromArray(pose.orientation):new x3dom.fields.Quaternion();var position=(pose.position)?x3dom.fields.SFVec3f.fromArray(pose.position):this.controllers[vrDisplay.displayName].offset;var scale=this.controllers[vrDisplay.displayName].scaleFactor;position=position.subtract(viewarea._movement);var matrix=x3dom.fields.SFMatrix4f.fromRotationTranslationScale(rotation,position,scale);this.rightTransform.setAttribute(\"matrix\",matrix.toString());}};x3dom.X3DCanvas=function(x3dElem,canvasIdx)\n{var that=this;this._canvasIdx=canvasIdx;this.x3dElem=x3dElem;this._current_dim=[0,0];this.fps_t0=new Date().getTime();this.lastTimeFPSWasTaken=0;this.framesSinceLastTime=0;this._totalTime=0;this._elapsedTime=0;this.doc=null;this.vrDisplay=null;this.vrDisplayPromise=null;this.vrFrameData=null;this.devicePixelRatio=window.devicePixelRatio||1;this.lastMousePos={x:0,y:0};x3dom.caps.DOMNodeInsertedEvent_perSubtree=!(navigator.userAgent.indexOf('MSIE')!=-1||navigator.userAgent.indexOf('Trident')!=-1);x3dElem.__setAttribute=x3dElem.setAttribute;x3dElem.setAttribute=function(attrName,newVal)\n{this.__setAttribute(attrName,newVal);newVal=parseInt(newVal);switch(attrName){case\"width\":that.canvas.setAttribute(\"width\",newVal*that.devicePixelRatio);if(that.doc&&that.doc._viewarea){that.doc._viewarea._width=parseInt(that.canvas.getAttribute(\"width\"),0);that.doc.needRender=true;}\nbreak;case\"height\":that.canvas.setAttribute(\"height\",newVal*that.devicePixelRatio);if(that.doc&&that.doc._viewarea){that.doc._viewarea._height=parseInt(that.canvas.getAttribute(\"height\"),0);that.doc.needRender=true;}\nbreak;default:break;}};x3dom.caps.MOBILE=(navigator.appVersion.indexOf(\"Mobile\")>-1);this.backend=this.x3dElem.getAttribute('backend');this.backend=(this.backend)?this.backend.toLowerCase():'none';this.canvas=this._createHTMLCanvas(x3dElem);x3dom.debug.appendElement(x3dElem);this.canvas.parent=this;this.gl=this._initContext(this.canvas,(this.backend.search(\"desktop\")>=0),(this.backend.search(\"mobile\")>=0),(this.backend.search(\"webgl2\")>=0));this.backend='webgl';if(this.gl==null)\n{this.hasRuntime=false;this._createInitFailedDiv(x3dElem);return;}\nx3dom.caps.BACKEND=this.backend;var runtimeEnabled=x3dElem.getAttribute(\"runtimeEnabled\");if(runtimeEnabled!==null)\n{this.hasRuntime=(runtimeEnabled.toLowerCase()==\"true\");}\nelse\n{this.hasRuntime=x3dElem.hasRuntime;}\nthis.showStat=x3dElem.getAttribute(\"showStat\");this.stateViewer=new x3dom.States(x3dElem);if(this.showStat!==null&&this.showStat==\"true\")\n{this.stateViewer.display(true);}\nthis.x3dElem.appendChild(this.stateViewer.viewer);this.showProgress=x3dElem.getAttribute(\"showProgress\");this.progressDiv=this._createProgressDiv();this.progressDiv.style.display=(this.showProgress!==null&&this.showProgress==\"true\")?\"flex\":\"none\";this.x3dElem.appendChild(this.progressDiv);this.vrDiv=this._createVRDiv();this.x3dElem.appendChild(this.vrDiv);this.showTouchpoints=x3dElem.getAttribute(\"showTouchpoints\");this.showTouchpoints=this.showTouchpoints?this.showTouchpoints:false;this.disableTouch=x3dElem.getAttribute(\"disableTouch\");this.disableTouch=this.disableTouch?(this.disableTouch.toLowerCase()==\"true\"):false;this.disableKeys=x3dElem.getAttribute(\"disableKeys\");this.disableKeys=this.disableKeys?(this.disableKeys.toLowerCase()==\"true\"):false;this.disableRightDrag=x3dElem.getAttribute(\"disableRightDrag\");this.disableRightDrag=this.disableRightDrag?(this.disableRightDrag.toLowerCase()==\"true\"):false;this.disableLeftDrag=x3dElem.getAttribute(\"disableLeftDrag\");this.disableLeftDrag=this.disableLeftDrag?(this.disableLeftDrag.toLowerCase()==\"true\"):false;this.disableMiddleDrag=x3dElem.getAttribute(\"disableMiddleDrag\");this.disableMiddleDrag=this.disableMiddleDrag?(this.disableMiddleDrag.toLowerCase()==\"true\"):false;this.bindEventListeners();};x3dom.X3DCanvas.prototype.bindEventListeners=function(){var that=this;this.onMouseDown=function(evt){if(!this.isMulti){this.focus();this.classList.add('x3dom-canvas-mousedown');switch(evt.button){case 0:this.mouse_button=1;break;case 1:this.mouse_button=4;break;case 2:this.mouse_button=2;break;default:this.mouse_button=0;break;}\nif(evt.shiftKey){this.mouse_button=1;}\nif(evt.ctrlKey){this.mouse_button=4;}\nif(evt.altKey){this.mouse_button=2;}\nvar pos=this.parent.mousePosition(evt);this.mouse_drag_x=pos.x;this.mouse_drag_y=pos.y;this.mouse_dragging=true;this.parent.doc.onMousePress(that.gl,this.mouse_drag_x,this.mouse_drag_y,this.mouse_button);this.parent.doc.needRender=true;}}\nthis.onMouseUp=function(evt){if(!this.isMulti){var prev_mouse_button=this.mouse_button;this.classList.remove('x3dom-canvas-mousedown');this.mouse_button=0;this.mouse_dragging=false;this.parent.doc.onMouseRelease(that.gl,this.mouse_drag_x,this.mouse_drag_y,this.mouse_button,prev_mouse_button);this.parent.doc.needRender=true;}}\nthis.onMouseOver=function(evt){if(!this.isMulti){this.mouse_button=0;this.mouse_dragging=false;this.parent.doc.onMouseOver(that.gl,this.mouse_drag_x,this.mouse_drag_y,this.mouse_button);this.parent.doc.needRender=true;}}\nthis.onMouseAlt=function(evt){if(!this.isMulti){this.mouse_button=0;this.mouse_dragging=false;this.classList.remove('x3dom-canvas-mousedown');this.parent.doc.onMouseOut(that.gl,this.mouse_drag_x,this.mouse_drag_y,this.mouse_button);this.parent.doc.needRender=true;}}\nthis.onDoubleClick=function(evt){if(!this.isMulti){this.mouse_button=0;var pos=this.parent.mousePosition(evt);this.mouse_drag_x=pos.x;this.mouse_drag_y=pos.y;this.mouse_dragging=false;this.parent.doc.onDoubleClick(that.gl,this.mouse_drag_x,this.mouse_drag_y);this.parent.doc.needRender=true;}}\nthis.onMouseMove=function(evt){if(!this.isMulti){var pos=this.parent.mousePosition(evt);if(pos.x!=that.lastMousePos.x||pos.y!=that.lastMousePos.y){that.lastMousePos=pos;this.mouse_drag_x=pos.x;this.mouse_drag_y=pos.y;if(this.mouse_dragging){if(evt.shiftKey){this.mouse_button=1;}\nif(evt.ctrlKey){this.mouse_button=4;}\nif(evt.altKey){this.mouse_button=2;}\nif(this.mouse_button==1&&!this.parent.disableLeftDrag||this.mouse_button==2&&!this.parent.disableRightDrag||this.mouse_button==4&&!this.parent.disableMiddleDrag)\n{this.parent.doc.onDrag(that.gl,this.mouse_drag_x,this.mouse_drag_y,this.mouse_button);}}\nelse{this.parent.doc.onMove(that.gl,this.mouse_drag_x,this.mouse_drag_y,this.mouse_button);}\nthis.parent.doc.needRender=true;evt.preventDefault();evt.stopPropagation();}}}\nthis.onDOMMouseScroll=function(evt){if(!this.isMulti){this.focus();var originalY=this.parent.mousePosition(evt).y;if(this.parent.doc._scene.getNavigationInfo()._vf.reverseScroll==true){this.mouse_drag_y-=2*evt.detail;}\nelse{this.mouse_drag_y+=2*evt.detail;}\nthis.parent.doc.onWheel(that.gl,this.mouse_drag_x,this.mouse_drag_y,originalY);this.parent.doc.needRender=true;evt.preventDefault();evt.stopPropagation();}}\nthis.onKeyPress=function(evt){if(!this.parent.disableKeys){evt.preventDefault();this.parent.doc.onKeyPress(evt.charCode);}\nthis.parent.doc.needRender=true;}\nthis.onMouseWheel=function(evt){if(!this.isMulti){this.focus();var originalY=this.parent.mousePosition(evt).y;if(this.parent.doc._scene.getNavigationInfo()._vf.reverseScroll==true){this.mouse_drag_y+=0.1*evt.wheelDelta;}\nelse{this.mouse_drag_y-=0.1*evt.wheelDelta;}\nthis.parent.doc.onWheel(that.gl,this.mouse_drag_x,this.mouse_drag_y,originalY);this.parent.doc.needRender=true;evt.preventDefault();evt.stopPropagation();}}\nthis.onKeyUp=function(evt){if(!this.parent.disableKeys){this.parent.doc.onKeyUp(evt.keyCode);}\nthis.parent.doc.needRender=true;}\nthis.onKeyDown=function(evt){if(!this.parent.disableKeys){this.parent.doc.onKeyDown(evt.keyCode);}\nthis.parent.doc.needRender=true;}\nthis.onVrDisplayPresentChange=function(evt){if(this.vrDisplay&&this.vrDisplay.isPresenting)\n{var leftEye=this.vrDisplay.getEyeParameters('left');var rightEye=this.vrDisplay.getEyeParameters('right');this._oldCanvasWidth=this.canvas.width;this._oldCanvasHeight=this.canvas.height;this.canvas.width=Math.max(leftEye.renderWidth,rightEye.renderWidth)*2;this.canvas.height=Math.max(leftEye.renderHeight,rightEye.renderHeight);this.gl.VRMode=2;this.doc.needRender=true;}\nelse if(this.vrDisplay&&!this.vrDisplay.isPresenting)\n{this.canvas.width=this._oldCanvasWidth;this.canvas.height=this._oldCanvasHeight;this.vrFrameData=null;this.gl.VRMode=1;this.doc.needRender=true;}};if(this.canvas!==null&&this.gl!==null&&this.hasRuntime){this.canvas.mouse_dragging=false;this.canvas.mouse_button=0;this.canvas.mouse_drag_x=0;this.canvas.mouse_drag_y=0;this.canvas.isMulti=false;this.canvas.oncontextmenu=function(evt){evt.preventDefault();evt.stopPropagation();return false;};this.canvas.addEventListener(\"webglcontextlost\",function(event){x3dom.debug.logError(\"WebGL context lost\");event.preventDefault();},false);this.canvas.addEventListener(\"webglcontextrestored\",function(event){x3dom.debug.logError(\"recover WebGL state and resources on context lost NYI\");event.preventDefault();},false);window.addEventListener('vrdisplaypresentchange',this.onVrDisplayPresentChange.bind(this),false);this.canvas.addEventListener('mousedown',this.onMouseDown,false);this.canvas.addEventListener('mouseup',this.onMouseUp,false);this.canvas.addEventListener('mouseover',this.onMouseOver,false);this.canvas.addEventListener('mouseout',this.onMouseOut,false);this.canvas.addEventListener('dblclick',this.onDoubleClick,false);this.canvas.addEventListener('mousemove',this.onMouseMove,false);this.canvas.addEventListener('DOMMouseScroll',this.onDOMMouseScroll,false);this.canvas.addEventListener('mousewheel',this.onMouseWheel,false);this.canvas.addEventListener('keypress',this.onKeyPress,true);this.canvas.addEventListener('keyup',this.onKeyUp,true);this.canvas.addEventListener('keydown',this.onKeyDown,true);var touches={numTouches:0,firstTouchTime:new Date().getTime(),firstTouchPoint:new x3dom.fields.SFVec2f(0,0),lastPos:new x3dom.fields.SFVec2f(),lastDrag:new x3dom.fields.SFVec2f(),lastMiddle:new x3dom.fields.SFVec2f(),lastSquareDistance:0,lastAngle:0,lastLayer:[],examineNavType:1,calcAngle:function(vector)\n{var rotation=vector.normalize().dot(new x3dom.fields.SFVec2f(1,0));rotation=Math.acos(rotation);if(vector.y<0)\nrotation=Math.PI+(Math.PI-rotation);return rotation;},disableTouch:this.disableTouch,visMarker:this.showTouchpoints,visMarkerBag:[],visualizeTouches:function(evt)\n{if(!this.visMarker)\nreturn;var touchBag=[];var marker=null;for(var i=0;i<evt.touches.length;i++){var id=evt.touches[i].identifier||evt.touches[i].streamId;if(!id)id=0;var index=this.visMarkerBag.indexOf(id);if(index>=0){marker=document.getElementById(\"visMarker\"+id);marker.style.left=(evt.touches[i].pageX)+\"px\";marker.style.top=(evt.touches[i].pageY)+\"px\";}\nelse{marker=document.createElement(\"div\");marker.appendChild(document.createTextNode(\"#\"+id));marker.id=\"visMarker\"+id;marker.className=\"x3dom-touch-marker\";document.body.appendChild(marker);index=this.visMarkerBag.length;this.visMarkerBag[index]=id;}\ntouchBag.push(id);}\nfor(var j=this.visMarkerBag.length-1;j>=0;j--){var oldId=this.visMarkerBag[j];if(touchBag.indexOf(oldId)<0){this.visMarkerBag.splice(j,1);marker=document.getElementById(\"visMarker\"+oldId);document.body.removeChild(marker);}}}};var touchStartHandler=function(evt,doc)\n{this.isMulti=true;evt.preventDefault();touches.visualizeTouches(evt);this.focus();if(doc==null)\ndoc=this.parent.doc;var navi=doc._scene.getNavigationInfo();switch(navi.getType()){case\"examine\":touches.examineNavType=1;break;case\"turntable\":touches.examineNavType=2;break;default:touches.examineNavType=0;break;}\ntouches.lastLayer=[];var i,pos;for(i=0;i<evt.touches.length;i++){pos=this.parent.mousePosition(evt.touches[i]);touches.lastLayer.push([evt.touches[i].identifier,new x3dom.fields.SFVec2f(pos.x,pos.y)]);}\nif(touches.numTouches<1&&evt.touches.length==1){touches.numTouches=1;touches.lastDrag=new x3dom.fields.SFVec2f(evt.touches[0].screenX,evt.touches[0].screenY);}\nelse if(touches.numTouches<2&&evt.touches.length>=2){touches.numTouches=2;var touch0=new x3dom.fields.SFVec2f(evt.touches[0].screenX,evt.touches[0].screenY);var touch1=new x3dom.fields.SFVec2f(evt.touches[1].screenX,evt.touches[1].screenY);var distance=touch1.subtract(touch0);var middle=distance.multiply(0.5).add(touch0);var squareDistance=distance.dot(distance);touches.lastMiddle=middle;touches.lastSquareDistance=squareDistance;touches.lastAngle=touches.calcAngle(distance);touches.lastPos=this.parent.mousePosition(evt.touches[0]);}\ndoc._scene.updateVolume();if(touches.examineNavType==1){for(i=0;i<evt.touches.length;i++){pos=this.parent.mousePosition(evt.touches[i]);doc.onPick(that.gl,pos.x,pos.y);doc._viewarea.prepareEvents(pos.x,pos.y,0,\"onmouseover\");doc._viewarea.prepareEvents(pos.x,pos.y,1,\"onmousedown\");doc._viewarea._pickingInfo.lastClickObj=doc._viewarea._pickingInfo.pickObj;}}\nelse if(evt.touches.length){pos=this.parent.mousePosition(evt.touches[0]);doc.onMousePress(that.gl,pos.x,pos.y,1);}\ndoc.needRender=true;};var touchMoveHandler=function(evt,doc)\n{evt.preventDefault();touches.visualizeTouches(evt);if(doc==null)\ndoc=this.parent.doc;var pos=null;var rotMatrix=null;var touch0,touch1,distance,middle,squareDistance,deltaMiddle,deltaZoom,deltaMove;if(touches.examineNavType==1){if(evt.touches.length==1){var currentDrag=new x3dom.fields.SFVec2f(evt.touches[0].screenX,evt.touches[0].screenY);var deltaDrag=currentDrag.subtract(touches.lastDrag);touches.lastDrag=currentDrag;var mx=x3dom.fields.SFMatrix4f.rotationY(deltaDrag.x/100);var my=x3dom.fields.SFMatrix4f.rotationX(deltaDrag.y/100);rotMatrix=mx.mult(my);doc.onMoveView(that.gl,evt,touches,null,rotMatrix);pos=this.parent.mousePosition(evt.touches[0]);doc.onPick(that.gl,pos.x,pos.y);doc._viewarea.prepareEvents(pos.x,pos.y,1,\"onmousemove\");}\nelse if(evt.touches.length>=2){touch0=new x3dom.fields.SFVec2f(evt.touches[0].screenX,evt.touches[0].screenY);touch1=new x3dom.fields.SFVec2f(evt.touches[1].screenX,evt.touches[1].screenY);distance=touch1.subtract(touch0);middle=distance.multiply(0.5).add(touch0);squareDistance=distance.dot(distance);deltaMiddle=middle.subtract(touches.lastMiddle);deltaZoom=squareDistance-touches.lastSquareDistance;deltaMove=new x3dom.fields.SFVec3f(deltaMiddle.x/screen.width,-deltaMiddle.y/screen.height,deltaZoom/(screen.width*screen.height*0.2));var rotation=touches.calcAngle(distance);var angleDelta=touches.lastAngle-rotation;touches.lastAngle=rotation;rotMatrix=x3dom.fields.SFMatrix4f.rotationZ(angleDelta);touches.lastMiddle=middle;touches.lastSquareDistance=squareDistance;doc.onMoveView(that.gl,evt,touches,deltaMove,rotMatrix);}}\nelse if(evt.touches.length){if(touches.examineNavType==2&&evt.touches.length>=2){touch0=new x3dom.fields.SFVec2f(evt.touches[0].screenX,evt.touches[0].screenY);touch1=new x3dom.fields.SFVec2f(evt.touches[1].screenX,evt.touches[1].screenY);distance=touch1.subtract(touch0);squareDistance=distance.dot(distance);deltaZoom=(squareDistance-touches.lastSquareDistance)/(0.1*(screen.width+screen.height));touches.lastPos.y+=deltaZoom;touches.lastSquareDistance=squareDistance;doc.onDrag(that.gl,touches.lastPos.x,touches.lastPos.y,2);}\nelse{pos=this.parent.mousePosition(evt.touches[0]);doc.onDrag(that.gl,pos.x,pos.y,1);}}\ndoc.needRender=true;};var touchEndHandler=function(evt,doc)\n{this.isMulti=false;evt.preventDefault();touches.visualizeTouches(evt);if(doc==null)\ndoc=this.parent.doc;doc._viewarea._isMoving=false;if(touches.numTouches==2&&evt.touches.length==1)\ntouches.lastDrag=new x3dom.fields.SFVec2f(evt.touches[0].screenX,evt.touches[0].screenY);if(evt.touches.length==0)\n{var affectedPointingSensorsList=doc._nodeBag.affectedPointingSensors;for(var i=0;i<affectedPointingSensorsList.length;++i)\n{affectedPointingSensorsList[i].pointerReleased();}\ndoc._nodeBag.affectedPointingSensors=[];}\nvar dblClick=false;if(evt.touches.length<2){if(touches.numTouches==1)\ndblClick=true;touches.numTouches=evt.touches.length;}\nif(touches.examineNavType==1){for(var i=0;i<touches.lastLayer.length;i++){var pos=touches.lastLayer[i][1];doc.onPick(that.gl,pos.x,pos.y);if(doc._scene._vf.pickMode.toLowerCase()!==\"box\"){doc._viewarea.prepareEvents(pos.x,pos.y,1,\"onmouseup\");doc._viewarea._pickingInfo.lastClickObj=doc._viewarea._pickingInfo.pickObj;if(doc._viewarea._pickingInfo.pickObj&&doc._viewarea._pickingInfo.pickObj===doc._viewarea._pickingInfo.lastClickObj){doc._viewarea.prepareEvents(pos.x,pos.y,1,\"onclick\");}}\nelse{var line=doc._viewarea.calcViewRay(pos.x,pos.y);var isect=doc._scene.doIntersect(line);var obj=line.hitObject;if(isect&&obj){doc._viewarea._pick.setValues(line.hitPoint);doc._viewarea.checkEvents(obj,pos.x,pos.y,1,\"onclick\");x3dom.debug.logInfo(\"Hit '\"+obj._xmlNode.localName+\"/ \"+\nobj._DEF+\"' at pos \"+doc._viewarea._pick);}}}\nif(dblClick){var now=new Date().getTime();var dist=touches.firstTouchPoint.subtract(touches.lastDrag).length();if(dist<18&&now-touches.firstTouchTime<180)\ndoc.onDoubleClick(that.gl,0,0);touches.firstTouchTime=now;touches.firstTouchPoint=touches.lastDrag;}}\nelse if(touches.lastLayer.length){pos=touches.lastLayer[0][1];doc.onMouseRelease(that.gl,pos.x,pos.y,0,1);}\ndoc.needRender=true;};if(!this.disableTouch)\n{this.canvas.addEventListener('touchstart',touchStartHandler,true);this.canvas.addEventListener('touchmove',touchMoveHandler,true);this.canvas.addEventListener('touchend',touchEndHandler,true);}}};x3dom.X3DCanvas.prototype._initContext=function(canvas,forbidMobileShaders,forceMobileShaders,tryWebGL2)\n{x3dom.debug.logInfo(\"Initializing X3DCanvas for [\"+canvas.id+\"]\");var gl=x3dom.gfx_webgl(canvas,forbidMobileShaders,forceMobileShaders,tryWebGL2,this.x3dElem);if(!gl)\n{x3dom.debug.logError(\"No 3D context found...\");this.x3dElem.removeChild(canvas);return null;}\nelse\n{var webglVersion=parseFloat(x3dom.caps.VERSION.match(/\\d+\\.\\d+/)[0]);if(webglVersion<1.0){x3dom.debug.logError(\"WebGL version \"+x3dom.caps.VERSION+\" lacks important WebGL/GLSL features needed for shadows, special vertex attribute types, etc.!\");}}\nreturn gl;};x3dom.X3DCanvas.prototype.appendParam=function(node,name,value){var param=document.createElement('param');param.setAttribute('name',name);param.setAttribute('value',value);node.appendChild(param);};x3dom.X3DCanvas.prototype._createInitFailedDiv=function(x3dElem){var div=document.createElement('div');div.setAttribute(\"id\",\"x3dom-create-init-failed\");div.style.width=x3dElem.getAttribute(\"width\");div.style.height=x3dElem.getAttribute(\"height\");div.style.backgroundColor=\"#C00\";div.style.color=\"#FFF\";div.style.fontSize=\"20px\";div.style.fontWidth=\"bold\";div.style.padding=\"10px 10px 10px 10px\";div.style.display=\"inline-block\";div.style.fontFamily=\"Helvetica\";div.style.textAlign=\"center\";div.appendChild(document.createTextNode('Your Browser does not support X3DOM'));div.appendChild(document.createElement('br'));div.appendChild(document.createTextNode('Read more about Browser support on:'));div.appendChild(document.createElement('br'));var link=document.createElement('a');link.setAttribute('href','http://www.x3dom.org/?page_id=9');link.appendChild(document.createTextNode('X3DOM | Browser Support'));div.appendChild(link);var altImg=x3dElem.getAttribute(\"altImg\")||null;if(altImg){var altImgObj=new Image();altImgObj.src=altImg;div.style.backgroundImage=\"url(\"+altImg+\")\";div.style.backgroundRepeat=\"no-repeat\";div.style.backgroundPosition=\"50% 50%\";}\nx3dElem.appendChild(div);x3dom.debug.logError(\"Your Browser does not support X3DOM!\");};x3dom.X3DCanvas.prototype._createHTMLCanvas=function(x3dElem)\n{x3dom.debug.logInfo(\"Creating canvas for (X)3D element...\");var canvas=document.createElement('canvas');canvas.setAttribute(\"class\",\"x3dom-canvas\");var userStyle=x3dElem.getAttribute(\"style\");if(userStyle){x3dom.debug.logInfo(\"Inline X3D styles detected\");}\nvar evtArr=[\"onmousedown\",\"onmousemove\",\"onmouseout\",\"onmouseover\",\"onmouseup\",\"onclick\",\"ondblclick\",\"onkeydown\",\"onkeypress\",\"onkeyup\",\"ontouchstart\",\"ontouchmove\",\"ontouchend\",\"ontouchcancel\",\"ontouchleave\",\"ontouchenter\",\"ondragstart\",\"ondrop\",\"ondragover\"];for(var i=0;i<evtArr.length;i++)\n{var evtName=evtArr[i];var userEvt=x3dElem.getAttribute(evtName);if(userEvt){x3dom.debug.logInfo(evtName+\", \"+userEvt);canvas.setAttribute(evtName,userEvt);x3dElem.removeAttribute(evtName);}}\nvar userProp=x3dElem.getAttribute(\"draggable\");if(userProp){x3dom.debug.logInfo(\"draggable=\"+userProp);canvas.setAttribute(\"draggable\",userProp);}\nif(!x3dElem.__addEventListener&&!x3dElem.__removeEventListener)\n{x3dElem.__addEventListener=x3dElem.addEventListener;x3dElem.__removeEventListener=x3dElem.removeEventListener;x3dElem.addEventListener=function(type,func,phase){var j,found=false;for(j=0;j<evtArr.length&&!found;j++){if(evtArr[j]===type){found=true;}}\nif(found){x3dom.debug.logInfo('addEventListener for div.on'+type);canvas.addEventListener(type,func,phase);}else{x3dom.debug.logInfo('addEventListener for X3D.on'+type);this.__addEventListener(type,func,phase);}};x3dElem.removeEventListener=function(type,func,phase){var j,found=false;for(j=0;j<evtArr.length&&!found;j++){if(evtArr[j]===type){found=true;}}\nif(found){x3dom.debug.logInfo('removeEventListener for div.on'+type);canvas.removeEventListener(type,func,phase);}else{x3dom.debug.logInfo('removeEventListener for X3D.on'+type);this.__removeEventListener(type,func,phase);}};}\nif(x3dElem.hasAttribute(\"ondownloadsfinished\"))\n{x3dElem.addEventListener(\"downloadsfinished\",function()\n{var eventObject={target:x3dElem,type:\"downloadsfinished\"};var funcStr=x3dElem.getAttribute(\"ondownloadsfinished\");var func=new Function('event',funcStr);func.call(x3dElem,eventObject);},true);}\nx3dElem.appendChild(canvas);var id=x3dElem.getAttribute(\"id\");if(id!==null){canvas.id=\"x3dom-\"+id+\"-canvas\";}else{var index=new Date().getTime();canvas.id=\"x3dom-\"+index+\"-canvas\";}\nvar w,h;if((w=x3dElem.getAttribute(\"width\"))!==null){if(w.indexOf(\"%\")>=0){x3dom.debug.logWarning(\"The width attribute is to be specified in pixels not in percent.\");}\ncanvas.style.width=w;x3dElem.style.width=w;canvas.setAttribute(\"width\",w);}\nif((h=x3dElem.getAttribute(\"height\"))!==null){if(h.indexOf(\"%\")>=0){x3dom.debug.logWarning(\"The height attribute is to be specified in pixels not in percent.\");}\ncanvas.style.height=h;x3dElem.style.height=h;canvas.setAttribute(\"height\",h);}\ncanvas.setAttribute(\"tabindex\",\"0\");return canvas;};x3dom.X3DCanvas.prototype._watchForResize=function(){if(this.vrDisplay&&this.vrDisplay.isPresenting)\n{return;}\nvar new_dim=[parseInt(x3dom.getStyle(this.canvas,\"width\")),parseInt(x3dom.getStyle(this.canvas,\"height\"))];if((this._current_dim[0]!=new_dim[0])||(this._current_dim[1]!=new_dim[1])){this._current_dim=new_dim;this.x3dElem.setAttribute(\"width\",new_dim[0]+\"px\");this.x3dElem.setAttribute(\"height\",new_dim[1]+\"px\");}};x3dom.X3DCanvas.prototype._createProgressDiv=function(){var progressDiv=document.createElement('div');progressDiv.setAttribute(\"class\",\"x3dom-progress\");var spinnerDiv=document.createElement('div');spinnerDiv.setAttribute(\"class\",\"x3dom-progress-spinner\");progressDiv.appendChild(spinnerDiv);var text=document.createElement('div');text.setAttribute(\"id\",\"x3domProgessCount\");text.appendChild(document.createTextNode('Loading...'));progressDiv.appendChild(text);progressDiv.oncontextmenu=progressDiv.onmousedown=function(evt){evt.preventDefault();evt.stopPropagation();return false;};return progressDiv;};x3dom.X3DCanvas.prototype._createVRDiv=function(){var vrDiv=document.createElement('div');vrDiv.setAttribute(\"class\",\"x3dom-vr\");vrDiv.onclick=function()\n{this.x3dElem.runtime.toggleVR();}.bind(this);vrDiv.oncontextmenu=function(evt){evt.preventDefault();evt.stopPropagation();return false;};return vrDiv;};x3dom.X3DCanvas.prototype.mousePosition=function(evt)\n{var rect=evt.target.getBoundingClientRect();var offsetX=Math.round(evt.clientX-rect.left)*this.devicePixelRatio;var offsetY=Math.round(evt.clientY-rect.top)*this.devicePixelRatio;return new x3dom.fields.SFVec2f(offsetX,offsetY);};x3dom.X3DCanvas.prototype.tick=function(timestamp)\n{var that=this;this._elapsedTime=(this._totalTime)?timestamp-this._totalTime:0;this._totalTime=timestamp;var runtime=this.x3dElem.runtime;var d=new Date().getTime();var diff=d-this.lastTimeFPSWasTaken;var fps=1000.0/(d-this.fps_t0);this.fps_t0=d;this.doc.advanceTime(d/1000.0);var animD=new Date().getTime()-d;if(this.doc.hasAnimationStateChanged())\n{if(this.doc.isAnimating())\n{runtime.onAnimationStarted();}\nelse\n{runtime.onAnimationFinished();}}\nif(this.doc.needRender){if(diff>=1000){runtime.fps=this.framesSinceLastTime/(diff/1000.0);runtime.addMeasurement('FPS',runtime.fps);this.framesSinceLastTime=0;this.lastTimeFPSWasTaken=d;}\nthis.framesSinceLastTime++;runtime.addMeasurement('ANIM',animD);if(runtime.isReady==false){runtime.ready();runtime.isReady=true;}\nruntime.enterFrame({\"total\":this._totalTime,\"elapsed\":this._elapsedTime});if(this.vrDisplay&&this.vrDisplay.isPresenting)\n{if(!this.vrFrameData)\n{this.vrFrameData=new VRFrameData();}\nthis.vrDisplay.getFrameData(this.vrFrameData);}\nelse\n{this.doc.needRender=false;}\nthis.doc.render(this.gl,this.vrFrameData,this.vrDisplay);if(!this.doc._scene._vf.doPickPass)\n{runtime.removeMeasurement('PICKING');}\nruntime.exitFrame({\"total\":this._totalTime,\"elapsed\":this._elapsedTime});if(this.vrDisplay&&this.vrDisplay.isPresenting)\n{this.vrDisplay.submitFrame();}}\nif(this.progressDiv){if(this.doc.downloadCount>0){runtime.addInfo(\"#LOADS:\",this.doc.downloadCount);}else{runtime.removeInfo(\"#LOADS:\");}\nif(this.doc.properties.getProperty(\"showProgress\")!=='false'){if(this.progressDiv){var count=Math.max(+this.doc.downloadCount,0);this.progressDiv.childNodes[1].textContent=\"\"+count;if(this.doc.downloadCount>0){this.progressDiv.style.opacity='1';}else{this.progressDiv.style.opacity='0';}}}else{this.progressDiv.style.opacity='0';}}\nif(this.doc.downloadCount<=0&&this.doc.previousDownloadCount>0)\n{var evt;if(document.createEvent){evt=document.createEvent(\"Events\");evt.initEvent(\"downloadsfinished\",true,true);that.x3dElem.dispatchEvent(evt);}else if(document.createEventObject){evt=document.createEventObject();that.x3dElem.fireEvent(\"ondownloadsfinished\",evt);}}\nthis.doc.previousDownloadCount=this.doc.downloadCount;};x3dom.X3DCanvas.prototype.load=function(uri,sceneElemPos,settings){this.doc=new x3dom.X3DDocument(this.canvas,this.gl,settings);var x3dCanvas=this;this.doc.onload=function(){if(x3dCanvas.hasRuntime){(function mainloop(timestamp){if(x3dCanvas.doc&&x3dCanvas.x3dElem.runtime){x3dCanvas._watchForResize();x3dCanvas.tick(timestamp);if(navigator.getVRDisplays)\n{if(x3dCanvas.vrDisplay)\n{x3dCanvas.vrDisplay.requestAnimationFrame(mainloop,x3dCanvas);}\nelse\n{if(!this.vrDisplayPromise)\n{this.vrDisplayPromise=navigator.getVRDisplays();}\nthis.vrDisplayPromise.then(function(displays){x3dCanvas.vrDisplay=displays[0];if(x3dCanvas.vrDisplay)\n{x3dCanvas.vrDisplay.requestAnimationFrame(mainloop,x3dCanvas);x3dCanvas.vrDiv.style.display=\"block\";}\nelse\n{window.requestAnimFrame(mainloop,x3dCanvas);}});}}\nelse\n{window.requestAnimFrame(mainloop,x3dCanvas);}}})();}else{x3dCanvas.tick();}};this.x3dElem.render=function(){if(x3dCanvas.hasRuntime){x3dCanvas.doc.needRender=true;}else{x3dCanvas.doc.render(x3dCanvas.gl);}};this.x3dElem.context=x3dCanvas.gl.ctx3d;this.doc.onerror=function(){alert('Failed to load X3D document');};this.doc.load(uri,sceneElemPos);};x3dom.runtime={};x3dom.Runtime=function(doc,canvas){this.doc=doc;this.canvas=canvas;this.config={};this.isReady=false;this.fps=0;this.VRMode=false;this.states={measurements:[],infos:[]};};x3dom.Runtime.prototype.addMeasurement=function(title,value){this.states.measurements[title]=value;};x3dom.Runtime.prototype.removeMeasurement=function(title){if(this.states.measurements[title]){delete this.states.measurements[title];}};x3dom.Runtime.prototype.addInfo=function(title,value){this.states.infos[title]=value;};x3dom.Runtime.prototype.removeInfo=function(title){delete this.states.infos[title];};x3dom.Runtime.prototype.initialize=function(doc,canvas){this.doc=doc;this.canvas=canvas;this.config={};this.isReady=false;this.fps=0;};x3dom.Runtime.prototype.noBackendFound=function(){x3dom.debug.logInfo('No backend found. Unable to render.');};x3dom.Runtime.prototype.ready=function(){x3dom.debug.logInfo('System ready.');};x3dom.Runtime.prototype.enterFrame=function(){};x3dom.Runtime.prototype.exitFrame=function(){};x3dom.Runtime.prototype.triggerRedraw=function(){this.canvas.doc.needRender=true;};x3dom.Runtime.prototype.getActiveBindable=function(typeName){var stacks;var i,current,result;var type;stacks=this.canvas.doc._bindableBag._stacks;result=[];type=x3dom.nodeTypesLC[typeName.toLowerCase()];if(!type){x3dom.debug.logError('No node of type \"'+typeName+'\" found.');return null;}\nfor(i=0;i<stacks.length;i++){current=stacks[i].getActive();if(current._xmlNode!==undefined&&x3dom.isa(current,type)){result.push(current);}}\nreturn result[0]?result[0]._xmlNode:null;};x3dom.Runtime.prototype.nextView=function(){var stack=this.canvas.doc._scene.getViewpoint()._stack;if(stack){stack.switchTo('next');}else{x3dom.debug.logError('No valid ViewBindable stack.');}};x3dom.Runtime.prototype.prevView=function(){var stack=this.canvas.doc._scene.getViewpoint()._stack;if(stack){stack.switchTo('prev');}else{x3dom.debug.logError('No valid ViewBindable stack.');}};x3dom.Runtime.prototype.viewpoint=function(){return this.canvas.doc._scene.getViewpoint();};x3dom.Runtime.prototype.viewMatrix=function(){return this.canvas.doc._viewarea.getViewMatrix();};x3dom.Runtime.prototype.projectionMatrix=function(){return this.canvas.doc._viewarea.getProjectionMatrix();};x3dom.Runtime.prototype.getWorldToCameraCoordinatesMatrix=function(){return this.canvas.doc._viewarea.getWCtoCCMatrix();};x3dom.Runtime.prototype.getCameraToWorldCoordinatesMatrix=function(){return this.canvas.doc._viewarea.getCCtoWCMatrix();};x3dom.Runtime.prototype.getViewingRay=function(x,y){return this.canvas.doc._viewarea.calcViewRay(x,y);};x3dom.Runtime.prototype.shootRay=function(x,y){var doc=this.canvas.doc;var info=doc._viewarea._pickingInfo;doc.onPick(this.canvas.gl,x,y);return{pickPosition:info.pickObj?info.pickPos:null,pickNormal:info.pickObj?info.pickNorm:null,pickObject:info.pickObj?info.pickObj._xmlNode:null};};x3dom.Runtime.prototype.getWidth=function(){return this.canvas.doc._viewarea._width;};x3dom.Runtime.prototype.getHeight=function(){return this.canvas.doc._viewarea._height;};x3dom.Runtime.prototype.mousePosition=function(event){var pos=this.canvas.mousePosition(event);return[pos.x,pos.y];};x3dom.Runtime.prototype.calcCanvasPos=function(wx,wy,wz){var DPR=window.devicePixelRatio||1;var pnt=new x3dom.fields.SFVec3f(wx,wy,wz);var mat=this.canvas.doc._viewarea.getWCtoCCMatrix();var pos=mat.multFullMatrixPnt(pnt);var w=this.canvas.doc._viewarea._width/DPR;var h=this.canvas.doc._viewarea._height/DPR;var x=Math.round((pos.x+1)*(w-1)/2);var y=Math.round((h-1)*(1-pos.y)/2);return[x,y];};x3dom.Runtime.prototype.getBBoxPoints=function(){var scene=this.canvas.doc._scene;scene.updateVolume();return[{x:scene._lastMin.x,y:scene._lastMin.y,z:scene._lastMin.z},{x:scene._lastMax.x,y:scene._lastMin.y,z:scene._lastMin.z},{x:scene._lastMin.x,y:scene._lastMax.y,z:scene._lastMin.z},{x:scene._lastMax.x,y:scene._lastMax.y,z:scene._lastMin.z},{x:scene._lastMin.x,y:scene._lastMin.y,z:scene._lastMax.z},{x:scene._lastMax.x,y:scene._lastMin.y,z:scene._lastMax.z},{x:scene._lastMin.x,y:scene._lastMax.y,z:scene._lastMax.z},{x:scene._lastMax.x,y:scene._lastMax.y,z:scene._lastMax.z},];};x3dom.Runtime.prototype.getSceneBRect=function(){var min={x:Number.MAX_VALUE,y:Number.MAX_VALUE};var max={x:Number.MIN_VALUE,y:Number.MIN_VALUE};var points=this.getBBoxPoints();for(var i=0;i<points.length;i++){var pos2D=this.calcCanvasPos(points[i].x,points[i].y,points[i].z);min.x=(pos2D[0]<min.x)?pos2D[0]:min.x;min.y=(pos2D[1]<min.y)?pos2D[1]:min.y;max.x=(pos2D[0]>max.x)?pos2D[0]:max.x;max.y=(pos2D[1]>max.y)?pos2D[1]:max.y;}\nvar rect={x:min.x,y:min.y,width:max.x-min.x,height:max.y-min.y};return rect;};x3dom.Runtime.prototype.calcClientPos=function(wx,wy,wz){var elem=this.canvas.canvas.offsetParent;if(!elem){x3dom.debug.logError(\"Can't calc client pos without offsetParent.\");return[0,0];}\nvar canvasPos=elem.getBoundingClientRect();var mousePos=this.calcCanvasPos(wx,wy,wz);var compStyle=document.defaultView.getComputedStyle(elem,null);var paddingLeft=parseFloat(compStyle.getPropertyValue('padding-left'));var borderLeftWidth=parseFloat(compStyle.getPropertyValue('border-left-width'));var paddingTop=parseFloat(compStyle.getPropertyValue('padding-top'));var borderTopWidth=parseFloat(compStyle.getPropertyValue('border-top-width'));var x=canvasPos.left+paddingLeft+borderLeftWidth+mousePos[0];var y=canvasPos.top+paddingTop+borderTopWidth+mousePos[1];return[x,y];};x3dom.Runtime.prototype.getScreenshot=function(){var url=\"\";var backend=this.canvas.backend;var canvas=this.canvas.canvas;if(canvas){if(backend==\"flash\"){url=canvas.getScreenshot();}else{var canvas2d=document.createElement(\"canvas\");canvas2d.width=canvas.width;canvas2d.height=canvas.height;var ctx=canvas2d.getContext(\"2d\");ctx.drawImage(canvas,0,0,canvas.width,canvas.height);ctx.scale(1,-1);ctx.translate(0,-canvas.height);url=canvas2d.toDataURL();}}\nreturn url;};x3dom.Runtime.prototype.getCanvas=function(){return this.canvas.canvas;};x3dom.Runtime.prototype.lightMatrix=function(){this.canvas.doc._viewarea.getLightMatrix();};x3dom.Runtime.prototype.resetView=function(){this.canvas.doc._viewarea.resetView();};x3dom.Runtime.prototype.lightView=function(){if(this.canvas.doc._nodeBag.lights.length>0){this.canvas.doc._viewarea.animateTo(this.canvas.doc._viewarea.getLightMatrix()[0],this.canvas.doc._scene.getViewpoint());return true;}else{x3dom.debug.logInfo(\"No lights to navigate to.\");return false;}};x3dom.Runtime.prototype.uprightView=function(){this.canvas.doc._viewarea.uprightView();};x3dom.Runtime.prototype.fitAll=function(updateCenterOfRotation){if(updateCenterOfRotation===undefined){updateCenterOfRotation=true;}\nvar scene=this.canvas.doc._scene;scene.updateVolume();this.canvas.doc._viewarea.fit(scene._lastMin,scene._lastMax,updateCenterOfRotation);};x3dom.Runtime.prototype.fitObject=function(obj,updateCenterOfRotation){if(obj&&obj._x3domNode){if(updateCenterOfRotation===undefined){updateCenterOfRotation=true;}\nvar min=x3dom.fields.SFVec3f.MAX();var max=x3dom.fields.SFVec3f.MIN();var vol=obj._x3domNode.getVolume();vol.getBounds(min,max);var mat=obj._x3domNode.getCurrentTransform();min=mat.multMatrixPnt(min);max=mat.multMatrixPnt(max);if(x3dom.isa(obj._x3domNode,x3dom.nodeTypes.X3DTransformNode)){var invMat=obj._x3domNode._trafo.inverse();min=invMat.multMatrixPnt(min);max=invMat.multMatrixPnt(max);}\nthis.canvas.doc._viewarea.fit(min,max,updateCenterOfRotation);}};x3dom.Runtime.prototype.showAll=function(axis,updateCenterOfRotation){this.canvas.doc._viewarea.showAll(axis,updateCenterOfRotation);};x3dom.Runtime.prototype.showObject=function(obj,axis){if(obj&&obj._x3domNode){if(axis===undefined)axis=\"negZ\";var min=x3dom.fields.SFVec3f.MAX();var max=x3dom.fields.SFVec3f.MIN();var vol=obj._x3domNode.getVolume();vol.getBounds(min,max);var mat=obj._x3domNode.getCurrentTransform();min=mat.multMatrixPnt(min);max=mat.multMatrixPnt(max);var viewarea=this.canvas.doc._viewarea;var focalLen=(viewarea._width<viewarea._height)?viewarea._width:viewarea._height;var n0;switch(axis){case\"posX\":n0=new x3dom.fields.SFVec3f(1,0,0);break;case\"negX\":n0=new x3dom.fields.SFVec3f(-1,0,0);break;case\"posY\":n0=new x3dom.fields.SFVec3f(0,1,0);break;case\"negY\":n0=new x3dom.fields.SFVec3f(1,-1,0);break;case\"posZ\":n0=new x3dom.fields.SFVec3f(0,0,1);break;case\"negZ\":n0=new x3dom.fields.SFVec3f(0,0,-1);break;}\nvar viewpoint=this.canvas.doc._scene.getViewpoint();var fov=viewpoint.getFieldOfView()/2.0;var ta=Math.tan(fov);if(Math.abs(ta)>x3dom.fields.Eps){focalLen/=ta;}\nvar w=viewarea._width-1;var h=viewarea._height-1;var frame=0.25;var minScreenPos=new x3dom.fields.SFVec2f(frame*w,frame*h);frame=0.75;var maxScreenPos=new x3dom.fields.SFVec2f(frame*w,frame*h);var dia2=max.subtract(min).multiply(0.5);var rw=dia2.length();var pc=min.add(dia2);var vc=maxScreenPos.subtract(minScreenPos).multiply(0.5);var rs=1.5*vc.length();vc=vc.add(minScreenPos);var dist=1.0;if(rs>x3dom.fields.Eps){dist=(rw/rs)*Math.sqrt(vc.x*vc.x+vc.y*vc.y+focalLen*focalLen);}\nn0=mat.multMatrixVec(n0).normalize();n0=n0.multiply(dist);var p0=pc.add(n0);var qDir=x3dom.fields.Quaternion.rotateFromTo(new x3dom.fields.SFVec3f(0,0,1),n0);var R=qDir.toMatrix();var T=x3dom.fields.SFMatrix4f.translation(p0.negate());var M=x3dom.fields.SFMatrix4f.translation(p0);M=M.mult(R).mult(T).mult(M);var viewmat=M.inverse();viewarea.animateTo(viewmat,viewpoint);}};x3dom.Runtime.prototype.animateViewpointTo=function(target,duration){var viewarea=this.canvas.doc._viewarea;var viewpoint=this.canvas.doc._scene.getViewpoint();if(target._x3domNode!=undefined)\n{target=target._x3domNode}\nviewarea.animateTo(target,viewpoint,duration);};x3dom.Runtime.prototype.getCenter=function(domNode){if(domNode&&domNode._x3domNode&&(this.isA(domNode,\"X3DShapeNode\")||this.isA(domNode,\"X3DGeometryNode\"))){return domNode._x3domNode.getCenter();}\nreturn null;};x3dom.Runtime.prototype.getCurrentTransform=function(domNode){if(domNode&&domNode._x3domNode){return domNode._x3domNode.getCurrentTransform();}\nreturn null;};x3dom.Runtime.prototype.getBBox=function(domNode){if(domNode&&domNode._x3domNode&&this.isA(domNode,\"X3DBoundedObject\")){var vol=domNode._x3domNode.getVolume();return{min:x3dom.fields.SFVec3f.copy(vol.min),max:x3dom.fields.SFVec3f.copy(vol.max)}}\nreturn null;};x3dom.Runtime.prototype.getSceneBBox=function(){var scene=this.canvas.doc._scene;scene.updateVolume();return{min:x3dom.fields.SFVec3f.copy(scene._lastMin),max:x3dom.fields.SFVec3f.copy(scene._lastMax)}};x3dom.Runtime.prototype.debug=function(show){var doc=this.canvas.doc;if(doc._viewarea._visDbgBuf===undefined){doc._viewarea._visDbgBuf=(doc._x3dElem.getAttribute(\"showLog\")==='true');}\nif(arguments.length>0){if(show===true){doc._viewarea._visDbgBuf=true;x3dom.debug.logContainer.style.display=\"block\";}else{doc._viewarea._visDbgBuf=false;x3dom.debug.logContainer.style.display=\"none\";}}else{doc._viewarea._visDbgBuf=!doc._viewarea._visDbgBuf;x3dom.debug.logContainer.style.display=(doc._viewarea._visDbgBuf==true)?\"block\":\"none\";}\ndoc.needRender=true;return doc._viewarea._visDbgBuf;};x3dom.Runtime.prototype.navigationType=function(){return this.canvas.doc._scene.getNavigationInfo().getType();};x3dom.Runtime.prototype.noNav=function(){this.canvas.doc._scene.getNavigationInfo().setType(\"none\");};x3dom.Runtime.prototype.examine=function(){this.canvas.doc._scene.getNavigationInfo().setType(\"examine\");};x3dom.Runtime.prototype.turnTable=function(){this.canvas.doc._scene.getNavigationInfo().setType(\"turntable\");};x3dom.Runtime.prototype.fly=function(){this.canvas.doc._scene.getNavigationInfo().setType(\"fly\");};x3dom.Runtime.prototype.freeFly=function(){this.canvas.doc._scene.getNavigationInfo().setType(\"freefly\");};x3dom.Runtime.prototype.lookAt=function(){this.canvas.doc._scene.getNavigationInfo().setType(\"lookat\");};x3dom.Runtime.prototype.lookAround=function(){this.canvas.doc._scene.getNavigationInfo().setType(\"lookaround\");};x3dom.Runtime.prototype.walk=function(){this.canvas.doc._scene.getNavigationInfo().setType(\"walk\");};x3dom.Runtime.prototype.game=function(){this.canvas.doc._scene.getNavigationInfo().setType(\"game\");};x3dom.Runtime.prototype.helicopter=function(){this.canvas.doc._scene.getNavigationInfo().setType(\"helicopter\");};x3dom.Runtime.prototype.resetExamin=function(){var viewarea=this.canvas.doc._viewarea;viewarea._rotMat=x3dom.fields.SFMatrix4f.identity();viewarea._transMat=x3dom.fields.SFMatrix4f.identity();viewarea._movement=new x3dom.fields.SFVec3f(0,0,0);viewarea._needNavigationMatrixUpdate=true;this.canvas.doc.needRender=true;};x3dom.Runtime.prototype.disableKeys=function(){this.canvas.disableKeys=true;};x3dom.Runtime.prototype.enableKeys=function(){this.canvas.disableKeys=false;};x3dom.Runtime.prototype.disableLeftDrag=function(){this.canvas.disableLeftDrag=true;};x3dom.Runtime.prototype.enableLeftDrag=function(){this.canvas.disableLeftDrag=false;};x3dom.Runtime.prototype.disableRightDrag=function(){this.canvas.disableRightDrag=true;};x3dom.Runtime.prototype.enableRightDrag=function(){this.canvas.disableRightDrag=false;};x3dom.Runtime.prototype.disableMiddleDrag=function(){this.canvas.disableMiddleDrag=true;};x3dom.Runtime.prototype.enableMiddleDrag=function(){this.canvas.disableMiddleDrag=false;};x3dom.Runtime.prototype.togglePoints=function(lines){var doc=this.canvas.doc;var mod=(lines===true)?3:2;doc._viewarea._points=++doc._viewarea._points%mod;doc.needRender=true;return doc._viewarea._points;};x3dom.Runtime.prototype.pickRect=function(x1,y1,x2,y2){return this.canvas.doc.onPickRect(this.canvas.gl,x1,y1,x2,y2);};x3dom.Runtime.prototype.pickMode=function(options){if(options&&options.internal===true){return this.canvas.doc._scene._vf.pickMode;}\nreturn this.canvas.doc._scene._vf.pickMode.toLowerCase();};x3dom.Runtime.prototype.changePickMode=function(type){type=type.toLowerCase();switch(type){case'idbuf':type='idBuf';break;case'idbuf24':type='idBuf24';break;case'idbufid':type='idBufId';break;case'texcoord':type='texCoord';break;case'color':type='color';break;case'box':type='box';break;default:x3dom.debug.logWarning(\"Switch pickMode to \"+type+' unknown intersect type');type=undefined;}\nif(type!==undefined){this.canvas.doc._scene._vf.pickMode=type;x3dom.debug.logInfo(\"Switched pickMode to '\"+type+\"'.\");return true;}\nreturn false;};x3dom.Runtime.prototype.speed=function(newSpeed){var navi=this.canvas.doc._scene.getNavigationInfo();if(newSpeed){navi._vf.speed=newSpeed;x3dom.debug.logInfo(\"Changed navigation speed to \"+navi._vf.speed);}\nreturn navi._vf.speed;};x3dom.Runtime.prototype.zoom=function(zoomAmount){this.canvas.doc._viewarea.zoom(zoomAmount);this.canvas.doc.needRender=true;};x3dom.Runtime.prototype.statistics=function(mode){var states=this.canvas.stateViewer;if(states){this.canvas.doc.needRender=true;if(mode===true){states.display(mode);return true;}else if(mode===false){states.display(mode);return false;}else{states.display(!states.active);return states.active;}}\nreturn false;};x3dom.Runtime.prototype.processIndicator=function(mode){var processDiv=this.canvas.progressDiv;if(processDiv){if(mode===true){processDiv.style.display='flex';return true;}else if(mode===false){processDiv.style.display='none';return false;}\nreturn processDiv.style.display!='none'}\nreturn false;};x3dom.Runtime.prototype.properties=function(){return this.canvas.doc.properties;};x3dom.Runtime.prototype.backendName=function(){return this.canvas.backend;};x3dom.Runtime.prototype.getFPS=function(){return this.fps;};x3dom.Runtime.prototype.isA=function(domNode,nodeType){var inherits=false;if(nodeType&&domNode&&domNode._x3domNode){if(nodeType===\"\"){nodeType=\"X3DNode\";}\ninherits=x3dom.isa(domNode._x3domNode,x3dom.nodeTypesLC[nodeType.toLowerCase()]);}\nreturn inherits;};x3dom.Runtime.prototype.getPixelScale=function(){var vp=this.viewpoint();if(!x3dom.isa(vp,x3dom.nodeTypes.OrthoViewpoint)){x3dom.debug.logError(\"getPixelScale is only implemented for orthographic Viewpoints\");return null;}\nvar zoomLevel=vp.getZoom();var left=zoomLevel[0];var bottom=zoomLevel[1];var right=zoomLevel[2];var top=zoomLevel[3];var x=right-left;var y=top-bottom;var pixelScaleX=x/this.getWidth();var pixelScaleY=y/this.getHeight();return new x3dom.fields.SFVec3f(pixelScaleX,pixelScaleY,0.0);};x3dom.Runtime.prototype.onAnimationStarted=function(){};x3dom.Runtime.prototype.onAnimationFinished=function(){};x3dom.Runtime.prototype.enterVR=function(){if(this.canvas.vrDisplay&&!this.canvas.vrDisplay.isPresenting)\n{this.canvas.vrDisplay.requestPresent([{source:this.canvas.canvas}]).then(function(){this.canvas.doc.needRender=true;}.bind(this));}};x3dom.Runtime.prototype.exitVR=function(){if(this.canvas.vrDisplay&&this.canvas.vrDisplay.isPresenting)\n{this.canvas.vrDisplay.exitPresent();}};x3dom.Runtime.prototype.toggleVR=function(){if(this.canvas.vrDisplay&&!this.canvas.vrDisplay.isPresenting)\n{this.enterVR();}\nelse if(this.canvas.vrDisplay&&this.canvas.vrDisplay.isPresenting)\n{this.exitVR();}};x3dom.Runtime.prototype.toggleProjection=function(perspViewID,orthoViewID){var dist;var factor=2.2;var runtime=document.getElementById(\"x3d\").runtime;var navInfo=runtime.canvas.doc._scene.getNavigationInfo();var speed=navInfo._vf.transitionTime;var persp=document.getElementById(perspViewID)._x3domNode;var ortho=document.getElementById(orthoViewID)._x3domNode;navInfo._vf.transitionTime=0;ortho._bindAnimation=false;persp._bindAnimation=false;if(persp._vf.isActive){ortho._viewMatrix=persp._viewMatrix;document.getElementById(orthoViewID).setAttribute(\"set_bind\",\"true\");dist=persp._viewMatrix.e3().length()/factor;ortho.setZoom(dist);}else if(ortho._vf.isActive){persp._viewMatrix=ortho._viewMatrix;document.getElementById(perspViewID).setAttribute(\"set_bind\",\"true\");dist=ortho._fieldOfView[2]*-factor;var translation=ortho._viewMatrix.e2().normalize().multiply(dist);persp._viewMatrix.setTranslate(translation);}\nnavInfo._vf.transitionTime=speed;ortho._bindAnimation=true;persp._bindAnimation=true;return(persp._vf.isActive)?0:1;};x3dom.Runtime.prototype.replaceWorld=function(scene){var x3dElement=this.doc.cloneNode(false);var child,name;while(child=scene.firstChild){name=child.nodeType===1?child.localName.toUpperCase():null;if(name=='HEAD'||name=='SCENE')x3dElement.appendChild(child);else{child.remove();}}\nthis.doc.parentNode.replaceChild(x3dElement,this.doc);this.doc=x3dElement;x3dom.reload();return;};x3dom.Runtime.prototype.createX3DFromJS=function(jsobject,optionalURL){if(optionalURL){jsobject=x3dom.protoExpander.prototypeExpander(optionalURL,jsobject);}\nvar jsonParser=new x3dom.JSONParser();return jsonParser.parseJavaScript(jsobject);};x3dom.Runtime.prototype.createX3DFromString=function(jsonOrXML,optionalURL){try{var jsobject=JSON.parse(jsonOrXML);return this.createX3DFromJS(jsobject,optionalURL);}catch(e){var parser=new DOMParser();var doc=parser.parseFromString(jsonOrXML,'application/xml');var scene=doc.querySelector('X3D');if(scene==null){doc=parser.parseFromString(jsonOrXML,'text/html');scene=doc.querySelector('X3D');}\nreturn scene;}};x3dom.Runtime.prototype.createX3DFromURLPromise=function(url,optionalURL){this.canvas.doc.incrementDownloads();that=this;return fetch(url).then(function(r){return r.text();}).then(function(text){that.canvas.doc.decrementDownloads();return that.createX3DFromString(text,optionalURL);}).catch(function(r){that.canvas.doc.decrementDownloads();x3dom.debug.logError('fetch failed: '+r);return null;});};x3dom.Runtime.prototype.loadURL=function(url,optionalURL){that=this;this.createX3DFromURLPromise(url,optionalURL).then(function(x3d){if(x3d!=null)that.replaceWorld(x3d);else x3dom.debug.logError(\"loadURL: could not fetch or parse \"+url);});};x3dom.userAgentFeature={supportsDOMAttrModified:false};(function loadX3DOM(){\"use strict\";var onload=function(){var i,j;var x3ds_unfiltered=document.getElementsByTagName('X3D');var x3ds=[];for(i=0;i<x3ds_unfiltered.length;i++){if(x3ds_unfiltered[i].hasRuntime===undefined)\nx3ds.push(x3ds_unfiltered[i]);}\nvar params;var settings=new x3dom.Properties();var validParams=array_to_object(['showLog','showStat','showProgress','PrimitiveQuality','components','loadpath','disableDoubleClick','backend','altImg','runtimeEnabled','disableKeys','showTouchpoints','disableTouch','maxActiveDownloads','useGeoCache']);var components,prefix;var showLoggingConsole=false;for(i=0;i<x3ds.length;i++){settings.setProperty(\"showLog\",x3ds[i].getAttribute(\"showLog\")||'false');settings.setProperty(\"showStat\",x3ds[i].getAttribute(\"showStat\")||'false');settings.setProperty(\"showProgress\",x3ds[i].getAttribute(\"showProgress\")||'true');settings.setProperty(\"PrimitiveQuality\",x3ds[i].getAttribute(\"PrimitiveQuality\")||'High');settings.setProperty(\"useGeoCache\",x3ds[i].getAttribute(\"useGeoCache\")||'true');params=x3ds[i].getElementsByTagName('PARAM');for(j=0;j<params.length;j++){if(params[j].getAttribute('name')in validParams){settings.setProperty(params[j].getAttribute('name'),params[j].getAttribute('value'));}else{}}\nif(settings.getProperty('showLog')==='true'){showLoggingConsole=true;}\nif(typeof X3DOM_SECURITY_OFF!='undefined'&&X3DOM_SECURITY_OFF===true){components=settings.getProperty('components',x3ds[i].getAttribute(\"components\"));if(components){prefix=settings.getProperty('loadpath',x3ds[i].getAttribute(\"loadpath\"));components=components.trim().split(',');for(j=0;j<components.length;j++){x3dom.loadJS(components[j]+\".js\",prefix);}}\nif(x3ds[i].getAttribute(\"src\")){var _scene=document.createElement(\"scene\");var _inl=document.createElement(\"Inline\");_inl.setAttribute(\"url\",x3ds[i].getAttribute(\"src\"));_scene.appendChild(_inl);x3ds[i].appendChild(_scene);}}}\nif(showLoggingConsole==true){x3dom.debug.activate(true);}else{x3dom.debug.activate(false);}\nx3ds=Array.map(x3ds,function(n){n.hasRuntime=true;return n;});if(x3dom.versionInfo!==undefined){x3dom.debug.logInfo(\"X3DOM version \"+x3dom.versionInfo.version+\", \"+\"Revison <a href='https://github.com/x3dom/x3dom/tree/\"+x3dom.versionInfo.revision+\"'>\"\n+x3dom.versionInfo.revision+\"</a>, \"+\"Date \"+x3dom.versionInfo.date);}\nx3dom.debug.logInfo(\"Found \"+x3ds.length+\" X3D and nodes...\");var x3d_element;var x3dcanvas;var altDiv,altP,aLnk,altImg;var t0,t1;for(i=0;i<x3ds.length;i++){x3d_element=x3ds[i];x3dcanvas=new x3dom.X3DCanvas(x3d_element,x3dom.canvases.length);x3dom.canvases.push(x3dcanvas);if(x3dcanvas.gl===null){altDiv=document.createElement(\"div\");altDiv.setAttribute(\"class\",\"x3dom-nox3d\");altDiv.setAttribute(\"id\",\"x3dom-nox3d\");altP=document.createElement(\"p\");altP.appendChild(document.createTextNode(\"WebGL is not yet supported in your browser. \"));aLnk=document.createElement(\"a\");aLnk.setAttribute(\"href\",\"http://www.x3dom.org/?page_id=9\");aLnk.appendChild(document.createTextNode(\"Follow link for a list of supported browsers... \"));altDiv.appendChild(altP);altDiv.appendChild(aLnk);x3dcanvas.x3dElem.appendChild(altDiv);if(x3dcanvas.stateViewer){x3d_element.removeChild(x3dcanvas.stateViewer.viewer);}\ncontinue;}\nt0=new Date().getTime();x3ds[i].runtime=new x3dom.Runtime(x3ds[i],x3dcanvas);x3ds[i].runtime.initialize(x3ds[i],x3dcanvas);if(x3dom.runtime.ready){x3ds[i].runtime.ready=x3dom.runtime.ready;}\nif(x3dcanvas.backend==''){x3dom.runtime.noBackendFound();}\nx3dcanvas.load(x3ds[i],i,settings);if(settings.getProperty('showStat')==='true'){x3ds[i].runtime.statistics(true);}else{x3ds[i].runtime.statistics(false);}\nif(settings.getProperty('showProgress')==='true'){if(settings.getProperty('showProgress')==='bar'){x3dcanvas.progressDiv.setAttribute(\"class\",\"x3dom-progress bar\");}\nx3ds[i].runtime.processIndicator(true);}else{x3ds[i].runtime.processIndicator(false);}\nt1=new Date().getTime()-t0;x3dom.debug.logInfo(\"Time for setup and init of GL element no. \"+i+\": \"+t1+\" ms.\");}\nvar ready=(function(eventType){var evt=null;if(document.createEvent){evt=document.createEvent(\"Events\");evt.initEvent(eventType,true,true);document.dispatchEvent(evt);}else if(document.createEventObject){evt=document.createEventObject();document.body.fireEvent('on'+eventType,evt);}})('load');};var onunload=function(){if(x3dom.canvases){for(var i=0;i<x3dom.canvases.length;i++){x3dom.canvases[i].doc.shutdown(x3dom.canvases[i].gl);}\nx3dom.canvases=[];}};x3dom.reload=function(){onload();};if(window.addEventListener){window.addEventListener('load',onload,false);window.addEventListener('unload',onunload,false);window.addEventListener('reload',onunload,false);}else if(window.attachEvent){window.attachEvent('onload',onload);window.attachEvent('onunload',onunload);window.attachEvent('onreload',onunload);}\nif(document.readyState===\"complete\"){window.setTimeout(function(){onload();},20);}})();x3dom.Cache=function(){this.textures=[];this.shaders=[];};x3dom.Cache.prototype.getTexture2D=function(gl,doc,url,bgnd,crossOrigin,scale,genMipMaps,flipY){var textureIdentifier=url;if(this.textures[textureIdentifier]===undefined){this.textures[textureIdentifier]=x3dom.Utils.createTexture2D(gl,doc,url,bgnd,crossOrigin,scale,genMipMaps,flipY);}\nreturn this.textures[textureIdentifier];};x3dom.Cache.prototype.getTexture2DByDEF=function(gl,nameSpace,def){var textureIdentifier=nameSpace.name+\"_\"+def;if(this.textures[textureIdentifier]===undefined){this.textures[textureIdentifier]=gl.createTexture();}\nreturn this.textures[textureIdentifier];};x3dom.Cache.prototype.getTextureCube=function(gl,doc,url,bgnd,crossOrigin,scale,genMipMaps,flipY){var textureIdentifier=\"\";for(var i=0;i<url.length;++i){textureIdentifier+=url[i]+\"|\";}\nif(this.textures[textureIdentifier]===undefined){this.textures[textureIdentifier]=x3dom.Utils.createTextureCube(gl,doc,url,bgnd,crossOrigin,scale,genMipMaps,flipY);}\nreturn this.textures[textureIdentifier];};x3dom.Cache.prototype.getShader=function(gl,shaderIdentifier){var program=null;if(this.shaders[shaderIdentifier]===undefined){switch(shaderIdentifier){case x3dom.shader.PICKING:program=new x3dom.shader.PickingShader(gl);break;case x3dom.shader.PICKING_24:program=new x3dom.shader.Picking24Shader(gl);break;case x3dom.shader.PICKING_ID:program=new x3dom.shader.PickingIdShader(gl);break;case x3dom.shader.PICKING_COLOR:program=new x3dom.shader.PickingColorShader(gl);break;case x3dom.shader.PICKING_TEXCOORD:program=new x3dom.shader.PickingTexcoordShader(gl);break;case x3dom.shader.FRONTGROUND_TEXTURE:program=new x3dom.shader.FrontgroundTextureShader(gl);break;case x3dom.shader.BACKGROUND_TEXTURE:program=new x3dom.shader.BackgroundTextureShader(gl);break;case x3dom.shader.BACKGROUND_SKYTEXTURE:program=new x3dom.shader.BackgroundSkyTextureShader(gl);break;case x3dom.shader.BACKGROUND_CUBETEXTURE:program=new x3dom.shader.BackgroundCubeTextureShader(gl);break;case x3dom.shader.BACKGROUND_CUBETEXTURE_DDS:program=new x3dom.shader.BackgroundCubeTextureDDSShader(gl);break;case x3dom.shader.SHADOW:program=new x3dom.shader.ShadowShader(gl);break;case x3dom.shader.BLUR:program=new x3dom.shader.BlurShader(gl);break;case x3dom.shader.DEPTH:break;case x3dom.shader.NORMAL:program=new x3dom.shader.NormalShader(gl);break;case x3dom.shader.TEXTURE_REFINEMENT:program=new x3dom.shader.TextureRefinementShader(gl);break;default:break;}\nif(program){this.shaders[shaderIdentifier]=x3dom.Utils.wrapProgram(gl,program,shaderIdentifier);}else{x3dom.debug.logError(\"Couldn't create shader: \"+shaderIdentifier);}}\nreturn this.shaders[shaderIdentifier];};x3dom.Cache.prototype.getDynamicShader=function(gl,viewarea,shape){var properties=x3dom.Utils.generateProperties(viewarea,shape);var shaderID=properties.id;if(this.shaders[shaderID]===undefined){var program=null;if(properties.CSHADER!=-1){program=new x3dom.shader.ComposedShader(gl,shape);}else{program=(x3dom.caps.MOBILE&&!properties.CSSHADER)?new x3dom.shader.DynamicMobileShader(gl,properties):new x3dom.shader.DynamicShader(gl,properties);}\nthis.shaders[shaderID]=x3dom.Utils.wrapProgram(gl,program,shaderID);}\nreturn this.shaders[shaderID];};x3dom.Cache.prototype.getShaderByProperties=function(gl,shape,properties,pickMode,shadows){var shaderID=properties.id;if(pickMode!==undefined&&pickMode!==null){shaderID+=pickMode;}\nif(shadows!==undefined&&shadows!==null){shaderID+=\"S\";}\nif(this.shaders[shaderID]===undefined){var program=null;if(pickMode!==undefined&&pickMode!==null){program=new x3dom.shader.DynamicShaderPicking(gl,properties,pickMode);}else if(shadows!==undefined&&shadows!==null){program=new x3dom.shader.DynamicShadowShader(gl,properties);}else if(properties.CSHADER!=-1){program=new x3dom.shader.ComposedShader(gl,shape);}else if(properties.KHR_MATERIAL_COMMONS!=null&&properties.KHR_MATERIAL_COMMONS!=0){program=new x3dom.shader.KHRMaterialCommonsShader(gl,properties);}else if(properties.EMPTY_SHADER!=null&&properties.EMPTY_SHADER!=0){return{\"shaderID\":shaderID};}else{program=(x3dom.caps.MOBILE&&!properties.CSSHADER)?new x3dom.shader.DynamicMobileShader(gl,properties):new x3dom.shader.DynamicShader(gl,properties);}\nthis.shaders[shaderID]=x3dom.Utils.wrapProgram(gl,program,shaderID);}\nreturn this.shaders[shaderID];};x3dom.Cache.prototype.getShadowRenderingShader=function(gl,shadowedLights){var ID=\"shadow\";for(var i=0;i<shadowedLights.length;i++){if(x3dom.isa(shadowedLights[i],x3dom.nodeTypes.SpotLight)){ID+=\"S\";}else if(x3dom.isa(shadowedLights[i],x3dom.nodeTypes.PointLight)){ID+=\"P\";}else{ID+=\"D\";}}\nif(this.shaders[ID]===undefined){var program=new x3dom.shader.ShadowRenderingShader(gl,shadowedLights);this.shaders[ID]=x3dom.Utils.wrapProgram(gl,program,ID);}\nreturn this.shaders[ID];};x3dom.Cache.prototype.Release=function(gl){for(var texture in this.textures){gl.deleteTexture(this.textures[texture]);}\nthis.textures=[];for(var shaderId in this.shaders){var shader=this.shaders[shaderId];var glShaders=gl.getAttachedShaders(shader.program);for(var i=0;i<glShaders.length;++i){gl.detachShader(shader.program,glShaders[i]);gl.deleteShader(glShaders[i]);}\ngl.deleteProgram(shader.program)}\nthis.shaders=[];};function startDashVideo(recurl,texturediv){var vars=function(){var vars={};var parts=window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi,function(m,key,value){vars[key]=value;});return vars;},url=recurl,video,context,player;if(vars&&vars.hasOwnProperty(\"url\")){url=vars.url;}\nvideo=document.querySelector(texturediv);context=new Dash.di.DashContext();player=new MediaPlayer(context);player.startup();player.attachView(video);player.setAutoPlay(false);player.attachSource(url);}\nx3dom.Texture=function(gl,doc,cache,node){this.gl=gl;this.doc=doc;this.cache=cache;this.node=node;this.samplerName=\"diffuseMap\";this.type=gl.TEXTURE_2D;this.format=gl.RGBA;this.magFilter=gl.LINEAR;this.minFilter=gl.LINEAR;this.wrapS=gl.REPEAT;this.wrapT=gl.REPEAT;this.genMipMaps=false;this.texture=null;this.ready=false;this.anisotropicDegree=1.0;this.dashtexture=false;var tex=this.node;var suffix=\"mpd\";this.node._x3domTexture=this;if(x3dom.isa(tex,x3dom.nodeTypes.MovieTexture)){if(tex._vf.url[0].indexOf(suffix,tex._vf.url[0].length-suffix.length)!==-1){this.dashtexture=true;var js=document.getElementById(\"AdditionalDashVideoScript\");if(!js){js=document.createElement(\"script\");js.setAttribute(\"type\",\"text/javascript\");js.setAttribute(\"src\",x3dom.Texture.dashVideoScriptFile);js.setAttribute(\"id\",\"AdditionalDashVideoScript\");js.onload=function(){var texObj;while((texObj=x3dom.Texture.loadDashVideos.pop())){x3dom.Texture.textNum++;texObj.update();}\njs.ready=true;};document.getElementsByTagName('head')[0].appendChild(js);}\nif(js.ready===true){x3dom.Texture.textNum++;this.update();}\nelse{x3dom.Texture.loadDashVideos.push(this);}}}\nif(!this.dashtexture){this.update();}};x3dom.Texture.dashVideoScriptFile=\"dash.all.js\";x3dom.Texture.loadDashVideos=[];x3dom.Texture.textNum=0;x3dom.Texture.clampFontSize=false;x3dom.Texture.minFontQuality=0.5;x3dom.Texture.maxFontQuality=10;x3dom.Texture.prototype.update=function(){if(x3dom.isa(this.node,x3dom.nodeTypes.Text)){this.updateText();}else{this.updateTexture();}\nthis.node.validateGLObject();};x3dom.Texture.prototype.setPixel=function(x,y,pixel,update){var gl=this.gl;var pixels=new Uint8Array(pixel);gl.bindTexture(this.type,this.texture);gl.pixelStorei(gl.UNPACK_ALIGNMENT,1);gl.texSubImage2D(this.type,0,x,y,1,1,this.format,gl.UNSIGNED_BYTE,pixels);gl.bindTexture(this.type,null);if(update){this.doc.needRender=true;}};x3dom.Texture.prototype.updateTexture=function(){var gl=this.gl;var doc=this.doc;var tex=this.node;this.samplerName=tex._type;if(x3dom.isa(tex,x3dom.nodeTypes.X3DEnvironmentTextureNode)){this.type=gl.TEXTURE_CUBE_MAP;}else{this.type=gl.TEXTURE_2D;}\nif(x3dom.isa(tex,x3dom.nodeTypes.PixelTexture)){switch(tex._vf.image.comp){case 1:this.format=gl.LUMINANCE;break;case 2:this.format=gl.LUMINANCE_ALPHA;break;case 3:this.format=gl.RGB;break;case 4:this.format=gl.RGBA;break;}}else{this.format=gl.RGBA;}\nif(tex._cf.textureProperties.node!==null){var texProp=tex._cf.textureProperties.node;this.wrapS=x3dom.Utils.boundaryModesDic(gl,texProp._vf.boundaryModeS);this.wrapT=x3dom.Utils.boundaryModesDic(gl,texProp._vf.boundaryModeT);this.minFilter=x3dom.Utils.minFilterDic(gl,texProp._vf.minificationFilter);this.magFilter=x3dom.Utils.magFilterDic(gl,texProp._vf.magnificationFilter);this.anisotropicDegree=Math.min(Math.max(texProp._vf.anisotropicDegree,1.0),x3dom.caps.MAX_ANISOTROPY);if(texProp._vf.generateMipMaps===true){this.genMipMaps=true;if(this.minFilter==gl.NEAREST){this.minFilter=gl.NEAREST_MIPMAP_NEAREST;}else if(this.minFilter==gl.LINEAR){this.minFilter=gl.LINEAR_MIPMAP_LINEAR;}\nif(this.texture&&(this.texture.ready||this.texture.textureCubeReady)){gl.bindTexture(this.type,this.texture);gl.generateMipmap(this.type);gl.bindTexture(this.type,null);}}else{this.genMipMaps=false;if((this.minFilter==gl.LINEAR_MIPMAP_LINEAR)||(this.minFilter==gl.LINEAR_MIPMAP_NEAREST)){this.minFilter=gl.LINEAR;}else if((this.minFilter==gl.NEAREST_MIPMAP_LINEAR)||(this.minFilter==gl.NEAREST_MIPMAP_NEAREST)){this.minFilter=gl.NEAREST;}}}else{if(tex._vf.repeatS==false){this.wrapS=gl.CLAMP_TO_EDGE;}else{this.wrapS=gl.REPEAT;}\nif(tex._vf.repeatT==false){this.wrapT=gl.CLAMP_TO_EDGE;}else{this.wrapT=gl.REPEAT;}\nif(this.samplerName==\"displacementMap\"||this.samplerName==\"multiDiffuseAlphaMap\"||this.samplerName==\"multiVisibilityMap\"||this.samplerName==\"multiEmissiveAmbientMap\"||this.samplerName==\"multiSpecularShininessMap\"){this.wrapS=gl.CLAMP_TO_EDGE;this.wrapT=gl.CLAMP_TO_EDGE;this.minFilter=gl.NEAREST;this.magFilter=gl.NEAREST;}}\nvar childTex=(tex._video&&tex._needPerFrameUpdate===true);if(tex._isCanvas&&tex._canvas){if(this.texture==null){this.texture=gl.createTexture();}\nthis.texture.width=tex._canvas.width;this.texture.height=tex._canvas.height;this.texture.ready=true;gl.bindTexture(this.type,this.texture);gl.texImage2D(this.type,0,this.format,this.format,gl.UNSIGNED_BYTE,tex._canvas);if(this.genMipMaps){gl.generateMipmap(this.type);}\ngl.bindTexture(this.type,null);}\nelse if(x3dom.isa(tex,x3dom.nodeTypes.RenderedTexture)){if(tex._webgl&&tex._webgl.fbo){if(tex._webgl.fbo.dtex&&tex._vf.depthMap){this.texture=tex._webgl.fbo.dtex;}else{this.texture=tex._webgl.fbo.tex;}}else{this.texture=null;x3dom.debug.logError(\"Try updating RenderedTexture without FBO initialized!\");}\nif(this.texture){this.texture.ready=true;}}\nelse if(x3dom.isa(tex,x3dom.nodeTypes.PixelTexture)){if(this.texture==null){if(this.node._DEF){this.texture=this.cache.getTexture2DByDEF(gl,this.node._nameSpace,this.node._DEF);}else{this.texture=gl.createTexture();}}\nthis.texture.width=tex._vf.image.width;this.texture.height=tex._vf.image.height;this.texture.ready=true;var pixelArr=tex._vf.image.array;var pixelArrfont_size=tex._vf.image.width*tex._vf.image.height*tex._vf.image.comp;var pixels=new Uint8Array(pixelArrfont_size);pixels.set(pixelArr);gl.bindTexture(this.type,this.texture);gl.pixelStorei(gl.UNPACK_ALIGNMENT,1);gl.texImage2D(this.type,0,this.format,tex._vf.image.width,tex._vf.image.height,0,this.format,gl.UNSIGNED_BYTE,pixels);if(this.genMipMaps){gl.generateMipmap(this.type);}\ngl.bindTexture(this.type,null);}else if(x3dom.isa(tex,x3dom.nodeTypes.MovieTexture)||childTex){var that=this;var p=document.getElementsByTagName('body')[0];if(this.texture==null){this.texture=gl.createTexture();}\nif(this.dashtexture){var element_vid=document.createElement('div');element_vid.setAttribute('class','dash-video-player'+x3dom.Texture.textNum);tex._video=document.createElement('video');tex._video.setAttribute('preload','auto');tex._video.setAttribute('muted','muted');var scriptToRun=document.createElement('script');scriptToRun.setAttribute('type','text/javascript');scriptToRun.innerHTML='startDashVideo(\"'+tex._vf.url[0]+'\",\".dash-video-player'+x3dom.Texture.textNum+' video\")';element_vid.appendChild(scriptToRun);element_vid.appendChild(tex._video);p.appendChild(element_vid);tex._video.style.visibility=\"hidden\";tex._video.style.display=\"none\";}else{if(!childTex){tex._video=document.createElement('video');tex._video.setAttribute('preload','auto');tex._video.setAttribute('muted','muted');p.appendChild(tex._video);tex._video.style.visibility=\"hidden\";tex._video.style.display=\"none\";}\nfor(var i=0;i<tex._vf.url.length;i++){var videoUrl=tex._nameSpace.getURL(tex._vf.url[i]);x3dom.debug.logInfo('Adding video file: '+videoUrl);var src=document.createElement('source');src.setAttribute('src',videoUrl);tex._video.appendChild(src);}}\nvar updateMovie=function(){gl.bindTexture(that.type,that.texture);gl.texImage2D(that.type,0,that.format,that.format,gl.UNSIGNED_BYTE,tex._video);if(that.genMipMaps){gl.generateMipmap(that.type);}\ngl.bindTexture(that.type,null);that.texture.ready=true;doc.needRender=true;};var startVideo=function(){tex._video.play();tex._intervalID=setInterval(updateMovie,16);};var videoDone=function(){clearInterval(tex._intervalID);if(tex._vf.loop===true){tex._video.play();tex._intervalID=setInterval(updateMovie,16);}};tex._video.addEventListener(\"canplaythrough\",startVideo,true);tex._video.addEventListener(\"ended\",videoDone,true);}else if(x3dom.isa(tex,x3dom.nodeTypes.X3DEnvironmentTextureNode)){this.texture=this.cache.getTextureCube(gl,doc,tex.getTexUrl(),false,tex._vf.crossOrigin,tex._vf.scale,this.genMipMaps,tex._vf.flipY);}else{this.texture=this.cache.getTexture2D(gl,doc,tex._nameSpace.getURL(tex._vf.url[0]),false,tex._vf.crossOrigin,tex._vf.scale,this.genMipMaps,tex._vf.flipY);}};x3dom.Texture.prototype.updateText=function(){var gl=this.gl;this.wrapS=gl.CLAMP_TO_EDGE;this.wrapT=gl.CLAMP_TO_EDGE;this.type=gl.TEXTURE_2D;this.format=gl.RGBA;this.magFilter=gl.LINEAR;this.minFilter=gl.LINEAR;var fontStyleNode=this.node._cf.fontStyle.node;var font_family='serif';var font_style='normal';var font_justify='left';var font_size=1.0;var font_spacing=1.0;var font_horizontal=true;var font_language=\"\";var oversample=2.0;var minor_alignment='FIRST';if(fontStyleNode!==null){var fonts=fontStyleNode._vf.family.toString();fonts=fonts.trim().replace(/\\'/g,'').replace(/\\,/,' ');fonts=fonts.split(\" \");font_family=Array.map(fonts,function(s){if(s=='SANS'){return'sans-serif';}\nelse if(s=='SERIF'){return'serif';}\nelse if(s=='TYPEWRITER'){return'monospace';}\nelse{return''+s+'';}}).join(\",\");font_style=fontStyleNode._vf.style.toString().replace(/\\'/g,'');switch(font_style.toUpperCase()){case'PLAIN':font_style='normal';break;case'BOLD':font_style='bold';break;case'ITALIC':font_style='italic';break;case'BOLDITALIC':font_style='italic bold';break;default:font_style='normal';}\nvar leftToRight=fontStyleNode._vf.leftToRight?'ltr':'rtl';var topToBottom=fontStyleNode._vf.topToBottom;var beginAlign=leftToRight=='ltr'?'left':'right';var endAlign=leftToRight=='ltr'?'right':'left';font_justify=fontStyleNode._vf.justify[0].toString().replace(/\\'/g,'');switch(font_justify.toUpperCase()){case'BEGIN':font_justify=beginAlign;break;case'END':font_justify=endAlign;break;case'FIRST':font_justify=beginAlign;break;case'MIDDLE':font_justify='center';break;default:font_justify=beginAlign;break;}\nif(fontStyleNode._vf.justify[1]===undefined){minor_alignment='FIRST';}else{minor_alignment=fontStyleNode._vf.justify[1].toString().replace(/\\'/g,'');switch(minor_alignment.toUpperCase()){case'BEGIN':minor_alignment='BEGIN';break;case'FIRST':minor_alignment='FIRST';break;case'MIDDLE':minor_alignment='MIDDLE';break;case'END':minor_alignment='END';break;default:minor_alignment='FIRST';break;}}\nfont_size=fontStyleNode._vf.size;font_spacing=fontStyleNode._vf.spacing;font_horizontal=fontStyleNode._vf.horizontal;font_language=fontStyleNode._vf.language;oversample=fontStyleNode._vf.quality;oversample=Math.max(x3dom.Texture.minFontQuality,oversample);oversample=Math.min(x3dom.Texture.maxFontQuality,oversample);if(font_size<0.1)font_size=0.1;if(x3dom.Texture.clampFontSize&&font_size>2.3){font_size=2.3;}}\nvar textX,textY;var paragraph=this.node._vf.string;var maxExtent=this.node._vf.maxExtent;var lengths=[];var text_canvas=document.createElement('canvas');text_canvas.dir=leftToRight;var x3dToPx=42;var textHeight=font_size*x3dToPx;var textAlignment=font_justify;document.body.appendChild(text_canvas);var text_ctx=text_canvas.getContext('2d');text_ctx.font=font_style+\" \"+textHeight+\"px \"+font_family;var maxWidth=0,pWidth,pLength;var i,j;for(i=0;i<paragraph.length;i++){pWidth=text_ctx.measureText(paragraph[i]).width;if(pWidth>maxWidth){maxWidth=pWidth;}\npLength=this.node._vf.length[i]|0;if(maxExtent>0&&(pLength>maxExtent||pLength==0)){pLength=maxExtent;}\nlengths[i]=pLength<=0?pWidth:pLength*x3dToPx;}\nvar canvas_extra=0.25*textHeight;var txtW=maxWidth;var txtH=textHeight*font_spacing*paragraph.length+canvas_extra;textX=0;textY=0;var x_offset=0,y_offset=0,baseLine='top';switch(font_justify){case\"center\":x_offset=-txtW/2;textX=txtW/2;break;case\"left\":x_offset=0;textX=0;break;case\"right\":x_offset=-txtW;textX=txtW;break;}\nswitch(minor_alignment){case\"MIDDLE\":y_offset=txtH/2-canvas_extra/2;break;case\"BEGIN\":y_offset=topToBottom?0:txtH-canvas_extra;baseLine=topToBottom?'top':'bottom';textY=topToBottom?0:textHeight;break;case\"FIRST\":y_offset=topToBottom?textHeight:txtH-canvas_extra;baseLine=topToBottom?'alphabetic':'bottom';textY=topToBottom?textHeight:textHeight;break;case\"END\":y_offset=topToBottom?txtH-canvas_extra:0;baseLine=topToBottom?'bottom':'top';textY=topToBottom?textHeight:0;break;}\nvar pxToX3d=1/42.0;var w=txtW*pxToX3d;var h=txtH*pxToX3d;x_offset*=pxToX3d;y_offset*=pxToX3d;text_canvas.width=txtW*oversample;text_canvas.height=txtH*oversample;text_canvas.dir=leftToRight;text_ctx.scale(oversample,oversample);text_ctx.fillStyle='rgba(0,0,0,0)';text_ctx.fillRect(0,0,text_ctx.canvas.width,text_ctx.canvas.height);text_ctx.fillStyle='white';text_ctx.textBaseline=baseLine;text_ctx.font=font_style+\" \"+textHeight+\"px \"+font_family;text_ctx.textAlign=textAlignment;for(i=0;i<paragraph.length;i++){j=topToBottom?i:paragraph.length-1-i;if(leftToRight=='rtl')paragraph[j]='\\u202e'+paragraph[j];text_ctx.fillText(paragraph[j],textX,textY,lengths[j]);textY+=textHeight*font_spacing;}\nif(this.texture===null){this.texture=gl.createTexture();}\ngl.bindTexture(this.type,this.texture);gl.texImage2D(this.type,0,this.format,this.format,gl.UNSIGNED_BYTE,text_canvas);gl.bindTexture(this.type,null);document.body.removeChild(text_canvas);this.node._mesh._positions[0]=[0+x_offset,-h+y_offset,0,w+x_offset,-h+y_offset,0,w+x_offset,0+y_offset,0,0+x_offset,0+y_offset,0];this.node.invalidateVolume();Array.forEach(this.node._parentNodes,function(node){node.setAllDirty();});};x3dom.X3DDocument=function(canvas,ctx,settings){this.canvas=canvas;this.ctx=ctx;this.properties=settings;this.needRender=true;this._x3dElem=null;this._scene=null;this._viewarea=null;this.downloadCount=0;this.previousDownloadCount=0;this._nodeBag={timer:[],lights:[],clipPlanes:[],followers:[],trans:[],renderTextures:[],viewarea:[],affectedPointingSensors:[]};this.onload=function(){};this.onerror=function(){};};x3dom.X3DDocument.prototype.load=function(uri,sceneElemPos){var uri_docs={};var queued_uris=[uri];var doc=this;function next_step(){if(queued_uris.length===0){doc._setup(uri_docs[uri],uri_docs,sceneElemPos);doc.onload();return;}\nvar next_uri=queued_uris.shift();if(x3dom.isX3DElement(next_uri)&&(next_uri.localName.toLowerCase()==='x3d'||next_uri.localName.toLowerCase()==='websg'))\n{uri_docs[next_uri]=next_uri;doc._x3dElem=next_uri;next_step();}}\nnext_step();};x3dom.findScene=function(x3dElem){var sceneElems=[];for(var i=0;i<x3dElem.childNodes.length;i++){var sceneElem=x3dElem.childNodes[i];if(sceneElem&&sceneElem.localName&&sceneElem.localName.toLowerCase()===\"scene\"){sceneElems.push(sceneElem);}}\nif(sceneElems.length>1){x3dom.debug.logError(\"X3D element has more than one Scene child (has \"+\nx3dElem.childNodes.length+\").\");}\nelse{return sceneElems[0];}\nreturn null;};x3dom.X3DDocument.prototype._setup=function(sceneDoc,uriDocs,sceneElemPos){var doc=this;function cleanNodeBag(bag,node){for(var i=0,n=bag.length;i<n;i++){if(bag[i]===node){bag.splice(i,1);break;}}}\nfunction removeX3DOMBackendGraph(domNode){var children=domNode.childNodes;for(var i=0,n=children.length;i<n;i++){removeX3DOMBackendGraph(children[i]);}\nif(domNode._x3domNode){var node=domNode._x3domNode;var nameSpace=node._nameSpace;if(x3dom.isa(node,x3dom.nodeTypes.X3DShapeNode)){if(node._cleanupGLObjects){node._cleanupGLObjects(true);}\nif(x3dom.nodeTypes.Shape.idMap.nodeID[node._objectID]){delete x3dom.nodeTypes.Shape.idMap.nodeID[node._objectID];}}\nelse if(x3dom.isa(node,x3dom.nodeTypes.TimeSensor)){cleanNodeBag(doc._nodeBag.timer,node);}\nelse if(x3dom.isa(node,x3dom.nodeTypes.X3DLightNode)){cleanNodeBag(doc._nodeBag.lights,node);}\nelse if(x3dom.isa(node,x3dom.nodeTypes.X3DFollowerNode)){cleanNodeBag(doc._nodeBag.followers,node);}\nelse if(x3dom.isa(node,x3dom.nodeTypes.X3DTransformNode)){cleanNodeBag(doc._nodeBag.trans,node);}\nelse if(x3dom.isa(node,x3dom.nodeTypes.RenderedTexture)){cleanNodeBag(doc._nodeBag.renderTextures,node);if(node._cleanupGLObjects){node._cleanupGLObjects();}}\nelse if(x3dom.isa(node,x3dom.nodeTypes.X3DPointingDeviceSensorNode)){cleanNodeBag(doc._nodeBag.affectedPointingSensors,node);}\nelse if(x3dom.isa(node,x3dom.nodeTypes.Texture)){node.shutdown();}\nelse if(x3dom.isa(node,x3dom.nodeTypes.AudioClip)){node.shutdown();}\nelse if(x3dom.isa(node,x3dom.nodeTypes.X3DBindableNode)){var stack=node._stack;if(stack){node.bind(false);cleanNodeBag(stack._bindBag,node);}\nif(node._cleanupGLObjects){node._cleanupGLObjects();}}\nelse if(x3dom.isa(node,x3dom.nodeTypes.Scene)){if(node._webgl){node._webgl=null;}}\nif(nameSpace&&!(domNode.getAttribute('use')||domNode.getAttribute('USE')))\n{nameSpace.removeNode(node._DEF);}\nnode._xmlNode=null;delete domNode._x3domNode;}}\nfunction getParentNode(domNode){var parentNode=domNode.parentNode;if(parentNode.localName.toLowerCase()==\"x3dommetagroup\"){parentNode=getParentNode(parentNode);}\nreturn parentNode;}\nvar domEventListener={onAttrModified:function(e){if('_x3domNode'in e.target){var attrToString={1:\"MODIFICATION\",2:\"ADDITION\",3:\"REMOVAL\"};e.target._x3domNode.updateField(e.attrName,e.newValue);doc.needRender=true;}},onNodeRemoved:function(e){var domNode=e.target;if(!domNode)\nreturn;var parentNode=getParentNode(domNode);if('_x3domNode'in parentNode&&'_x3domNode'in domNode){var parent=parentNode._x3domNode;var child=domNode._x3domNode;if(parent&&child){parent.removeChild(child);parent.nodeChanged();removeX3DOMBackendGraph(domNode);if(doc._viewarea&&doc._viewarea._scene){doc._viewarea._scene.nodeChanged();doc._viewarea._scene.updateVolume();doc.needRender=true;}}}\nelse if(domNode.localName&&domNode.localName.toUpperCase()==\"ROUTE\"&&domNode._nodeNameSpace){var fromNode=domNode._nodeNameSpace.defMap[domNode.getAttribute('fromNode')];var toNode=domNode._nodeNameSpace.defMap[domNode.getAttribute('toNode')];if(fromNode&&toNode){fromNode.removeRoute(domNode.getAttribute('fromField'),toNode,domNode.getAttribute('toField'));}}\nelse if(domNode.localName&&domNode.localName.toUpperCase()==\"X3D\"){var runtime=domNode.runtime;if(runtime&&runtime.canvas&&runtime.canvas.doc&&runtime.canvas.doc._scene){var sceneNode=runtime.canvas.doc._scene._xmlNode;removeX3DOMBackendGraph(sceneNode);for(var i=0;i<x3dom.canvases.length;i++){if(x3dom.canvases[i]===runtime.canvas){x3dom.canvases[i].doc.shutdown(x3dom.canvases[i].gl);x3dom.canvases.splice(i,1);break;}}\nruntime.canvas.doc._scene=null;runtime.canvas.doc._viewarea=null;runtime.canvas.doc=null;runtime.canvas=null;runtime=null;domNode.context=null;domNode.runtime=null;}}},onNodeInserted:function(e){var child=e.target;var parentNode=getParentNode(child);if('_x3domNode'in parentNode){if(parentNode.tagName&&parentNode.tagName.toLowerCase()=='inline'||parentNode.tagName.toLowerCase()=='multipart'){}\nelse{var parent=parentNode._x3domNode;if(parent&&parent._nameSpace&&(child instanceof Element)){if(x3dom.caps.DOMNodeInsertedEvent_perSubtree)\n{removeX3DOMBackendGraph(child);}\nvar newNode=parent._nameSpace.setupTree(child);parent.addChild(newNode,child.getAttribute(\"containerField\"));parent.nodeChanged();var grandParentNode=parentNode.parentNode;if(grandParentNode&&grandParentNode._x3domNode)\ngrandParentNode._x3domNode.nodeChanged();if(doc._viewarea&&doc._viewarea._scene){doc._viewarea._scene.nodeChanged();doc._viewarea._scene.updateVolume();doc.needRender=true;}}\nelse{x3dom.debug.logWarning(\"No _nameSpace in onNodeInserted\");}}}}};sceneDoc.addEventListener('DOMNodeRemoved',domEventListener.onNodeRemoved,true);sceneDoc.addEventListener('DOMNodeInserted',domEventListener.onNodeInserted,true);if((x3dom.userAgentFeature.supportsDOMAttrModified===true)){sceneDoc.addEventListener('DOMAttrModified',domEventListener.onAttrModified,true);}\nvar sceneElem=x3dom.findScene(sceneDoc);this._bindableBag=new x3dom.BindableBag(this);var nameSpace=new x3dom.NodeNameSpace(\"scene\",doc);var scene=nameSpace.setupTree(sceneElem);this._scene=scene;this._bindableBag.setRefNode(scene);this._viewarea=new x3dom.Viewarea(this,scene);this._viewarea._width=this.canvas.width;this._viewarea._height=this.canvas.height;};x3dom.X3DDocument.prototype.advanceTime=function(t){var i=0;if(this._nodeBag.timer.length){for(i=0;i<this._nodeBag.timer.length;i++)\n{this.needRender|=this._nodeBag.timer[i].tick(t);}}\nif(this._nodeBag.followers.length){for(i=0;i<this._nodeBag.followers.length;i++)\n{this.needRender|=this._nodeBag.followers[i].tick(t);}}\nif(this._nodeBag.trans.length){for(i=0;i<this._nodeBag.trans.length;i++)\n{this.needRender|=this._nodeBag.trans[i].tick(t);}}\nif(this._nodeBag.viewarea.length){for(i=0;i<this._nodeBag.viewarea.length;i++)\n{this.needRender|=this._nodeBag.viewarea[i].tick(t);}}};x3dom.X3DDocument.prototype.render=function(ctx,vrFrameData,vrDisplay){if(!ctx||!this._viewarea){return;}\nthis._viewarea.setVRFrameData(vrFrameData);this._viewarea.updateGamepads(vrDisplay);ctx.renderScene(this._viewarea);};x3dom.X3DDocument.prototype.onPick=function(ctx,x,y){if(!ctx||!this._viewarea){return;}\nctx.pickValue(this._viewarea,x,y,1);};x3dom.X3DDocument.prototype.onPickRect=function(ctx,x1,y1,x2,y2){if(!ctx||!this._viewarea){return[];}\nreturn ctx.pickRect(this._viewarea,x1,y1,x2,y2);};x3dom.X3DDocument.prototype.onMove=function(ctx,x,y,buttonState){if(!ctx||!this._viewarea){return;}\nif(this._viewarea._scene._vf.doPickPass)\nctx.pickValue(this._viewarea,x,y,buttonState);this._viewarea.onMove(x,y,buttonState);};x3dom.X3DDocument.prototype.onMoveView=function(ctx,evt,touches,translation,rotation){if(!ctx||!this._viewarea){return;}\nthis._scene.getNavigationInfo()._impl.onTouchDrag(this._viewarea,evt,touches,translation,rotation);};x3dom.X3DDocument.prototype.onDrag=function(ctx,x,y,buttonState){if(!ctx||!this._viewarea){return;}\nif(this._viewarea._scene._vf.doPickPass&&!this._viewarea._isMoving)\nctx.pickValue(this._viewarea,x,y,buttonState);this._viewarea.onDrag(x,y,buttonState);};x3dom.X3DDocument.prototype.onWheel=function(ctx,x,y,originalY){if(!ctx||!this._viewarea){return;}\nif(this._viewarea._scene._vf.doPickPass)\nctx.pickValue(this._viewarea,x,originalY,0);this._viewarea.onDrag(x,y,2);};x3dom.X3DDocument.prototype.onMousePress=function(ctx,x,y,buttonState){if(!ctx||!this._viewarea){return;}\nthis._viewarea._scene.updateVolume();ctx.pickValue(this._viewarea,x,y,buttonState);this._viewarea.onMousePress(x,y,buttonState);};x3dom.X3DDocument.prototype.onMouseRelease=function(ctx,x,y,buttonState,prevButton){if(!ctx||!this._viewarea){return;}\nvar button=(prevButton<<8)|buttonState;ctx.pickValue(this._viewarea,x,y,button);this._viewarea.onMouseRelease(x,y,buttonState,prevButton);};x3dom.X3DDocument.prototype.onMouseOver=function(ctx,x,y,buttonState){if(!ctx||!this._viewarea){return;}\nctx.pickValue(this._viewarea,x,y,buttonState);this._viewarea.onMouseOver(x,y,buttonState);};x3dom.X3DDocument.prototype.onMouseOut=function(ctx,x,y,buttonState){if(!ctx||!this._viewarea){return;}\nctx.pickValue(this._viewarea,x,y,buttonState);this._viewarea.onMouseOut(x,y,buttonState);};x3dom.X3DDocument.prototype.onDoubleClick=function(ctx,x,y){if(!ctx||!this._viewarea){return;}\nthis._viewarea.onDoubleClick(x,y);};x3dom.X3DDocument.prototype.onKeyDown=function(keyCode)\n{switch(keyCode){case 37:this._viewarea.strafeLeft();break;case 38:this._viewarea.moveFwd();break;case 39:this._viewarea.strafeRight();break;case 40:this._viewarea.moveBwd();break;default:}};x3dom.X3DDocument.prototype.onKeyUp=function(keyCode)\n{var stack=null;switch(keyCode){case 13:x3dom.toggleFullScreen();break;case 33:stack=this._scene.getViewpoint()._stack;if(stack){stack.switchTo('prev');}\nelse{x3dom.debug.logError('No valid ViewBindable stack.');}\nbreak;case 34:stack=this._scene.getViewpoint()._stack;if(stack){stack.switchTo('next');}\nelse{x3dom.debug.logError('No valid ViewBindable stack.');}\nbreak;case 35:stack=this._scene.getViewpoint()._stack;if(stack){stack.switchTo('last');}\nelse{x3dom.debug.logError('No valid ViewBindable stack.');}\nbreak;case 36:stack=this._scene.getViewpoint()._stack;if(stack){stack.switchTo('first');}\nelse{x3dom.debug.logError('No valid ViewBindable stack.');}\nbreak;case 37:break;case 38:break;case 39:break;case 40:break;default:}};x3dom.X3DDocument.prototype.onKeyPress=function(charCode)\n{var nav=this._scene.getNavigationInfo();var env=this._scene.getEnvironment();switch(charCode)\n{case 32:var states=this.canvas.parent.stateViewer;if(states){states.display();}\nx3dom.debug.logInfo(\"a: show all | d: show helper buffers | s: small feature culling | t: light view | \"+\"m: toggle render mode | c: frustum culling | p: intersect type | r: reset view | \\n\"+\"e: examine mode | f: fly mode | y: freefly mode | w: walk mode | h: helicopter mode | \"+\"l: lookAt mode | o: lookaround | g: game mode | n: turntable | u: upright position | \\n\"+\"v: print viewpoint info | pageUp: next view | pageDown: prev. view | \"+\"+: increase speed | -: decrease speed \");break;case 43:nav._vf.speed=2*nav._vf.speed;x3dom.debug.logInfo(\"Changed navigation speed to \"+nav._vf.speed);break;case 45:nav._vf.speed=0.5*nav._vf.speed;x3dom.debug.logInfo(\"Changed navigation speed to \"+nav._vf.speed);break;case 51:x3dom.nodeTypes.PopGeometry.ErrorToleranceFactor+=0.5;x3dom.debug.logInfo(\"Changed POP error tolerance to \"+x3dom.nodeTypes.PopGeometry.ErrorToleranceFactor);break;case 52:x3dom.nodeTypes.PopGeometry.ErrorToleranceFactor-=0.5;x3dom.debug.logInfo(\"Changed POP error tolerance to \"+x3dom.nodeTypes.PopGeometry.ErrorToleranceFactor);break;case 54:nav._vf.typeParams[1]+=1.0;nav._heliUpdated=false;x3dom.debug.logInfo(\"Changed helicopter height to \"+nav._vf.typeParams[1]);break;case 55:nav._vf.typeParams[1]-=1.0;nav._heliUpdated=false;x3dom.debug.logInfo(\"Changed helicopter height to \"+nav._vf.typeParams[1]);break;case 56:nav._vf.typeParams[0]-=0.02;nav._heliUpdated=false;x3dom.debug.logInfo(\"Changed helicopter angle to \"+nav._vf.typeParams[0]);break;case 57:nav._vf.typeParams[0]+=0.02;nav._heliUpdated=false;x3dom.debug.logInfo(\"Changed helicopter angle to \"+nav._vf.typeParams[0]);break;case 97:this._viewarea.showAll();break;case 99:env._vf.frustumCulling=!env._vf.frustumCulling;x3dom.debug.logInfo(\"Viewfrustum culling \"+(env._vf.frustumCulling?\"on\":\"off\"));break;case 100:if(this._viewarea._visDbgBuf===undefined){this._viewarea._visDbgBuf=(this._x3dElem.getAttribute(\"showLog\")==='true');}\nthis._viewarea._visDbgBuf=!this._viewarea._visDbgBuf;x3dom.debug.logContainer.style.display=(this._viewarea._visDbgBuf==true)?\"block\":\"none\";break;case 101:nav.setType(\"examine\",this._viewarea);break;case 102:nav.setType(\"fly\",this._viewarea);break;case 103:nav.setType(\"game\",this._viewarea);break;case 104:nav.setType(\"helicopter\",this._viewarea);break;case 105:this._viewarea.fit(this._scene._lastMin,this._scene._lastMax);break;case 108:nav.setType(\"lookat\",this._viewarea);break;case 109:this._viewarea._points=++this._viewarea._points%2;break;case 110:nav.setType(\"turntable\",this._viewarea);break;case 111:nav.setType(\"lookaround\",this._viewarea);break;case 112:switch(this._scene._vf.pickMode.toLowerCase())\n{case\"idbuf\":this._scene._vf.pickMode=\"color\";break;case\"color\":this._scene._vf.pickMode=\"texCoord\";break;case\"texcoord\":this._scene._vf.pickMode=\"box\";break;default:this._scene._vf.pickMode=\"idBuf\";break;}\nx3dom.debug.logInfo(\"Switch pickMode to '\"+this._scene._vf.pickMode+\"'.\");break;case 114:this._viewarea.resetView();break;case 115:env._vf.smallFeatureCulling=!env._vf.smallFeatureCulling;x3dom.debug.logInfo(\"Small feature culling \"+(env._vf.smallFeatureCulling?\"on\":\"off\"));break;case 116:if(this._nodeBag.lights.length>0){this._viewarea.animateTo(this._viewarea.getLightMatrix()[0],this._scene.getViewpoint());}\nbreak;case 117:this._viewarea.uprightView();break;case 118:var that=this;(function(){var viewpoint=that._viewarea._scene.getViewpoint();var mat_view=that._viewarea.getViewMatrix().inverse();var rotation=new x3dom.fields.Quaternion(0,0,1,0);rotation.setValue(mat_view);var rot=rotation.toAxisAngle();var translation=mat_view.e3();var center=viewpoint.getCenterOfRotation();x3dom.debug.logInfo('\\n&lt;Viewpoint position=\"'+translation.x.toFixed(5)+' '\n+translation.y.toFixed(5)+' '+translation.z.toFixed(5)+'\" '+'orientation=\"'+rot[0].x.toFixed(5)+' '+rot[0].y.toFixed(5)+' '\n+rot[0].z.toFixed(5)+' '+rot[1].toFixed(5)+'\" \\n\\t'+'zNear=\"'+viewpoint.getNear().toFixed(5)+'\" '+'zFar=\"'+viewpoint.getFar().toFixed(5)+'\" '+'centerOfRotation=\"'+center.x.toFixed(5)+' '+center.y.toFixed(5)+' '+center.z.toFixed(5)+'\" '+'fieldOfView=\"'+viewpoint.getFieldOfView().toFixed(5)+'\" '+'description=\"'+viewpoint._vf.description+'\"&gt;'+'&lt;/Viewpoint&gt;');})();break;case 119:nav.setType(\"walk\",this._viewarea);break;case 121:nav.setType(\"freefly\",this._viewarea);break;default:}};x3dom.X3DDocument.prototype.shutdown=function(ctx)\n{if(!ctx){return;}\nctx.shutdown(this._viewarea);};x3dom.X3DDocument.prototype.hasAnimationStateChanged=function(){if(!this._viewarea){return false;}\nreturn this._viewarea.hasAnimationStateChanged();};x3dom.X3DDocument.prototype.isAnimating=function(){if(!this._viewarea){return false;}\nreturn this._viewarea.isAnimating();};x3dom.X3DDocument.prototype.incrementDownloads=function()\n{this.downloadCount++;}\nx3dom.X3DDocument.prototype.decrementDownloads=function()\n{this.downloadCount--;}\nx3dom.MatrixMixer=function(beginTime,endTime){this.beginTime=beginTime||0;this.endTime=endTime||1;this.isMixing=false;this._beginMat=x3dom.fields.SFMatrix4f.identity();this._beginInvMat=x3dom.fields.SFMatrix4f.identity();this._beginLogMat=x3dom.fields.SFMatrix4f.identity();this._endMat=x3dom.fields.SFMatrix4f.identity();this._endLogMat=x3dom.fields.SFMatrix4f.identity();this._beginRot=new x3dom.fields.Quaternion();this._endRot=new x3dom.fields.Quaternion();this._beginPos=new x3dom.fields.SFVec3f();this._endPos=new x3dom.fields.SFVec3f();this._result=x3dom.fields.SFMatrix4f.identity();this._useQuaternion=false;};x3dom.MatrixMixer.prototype._calcFraction=function(time){var fraction=(time-this.beginTime)/(this.endTime-this.beginTime);return(Math.sin((fraction*Math.PI)-(Math.PI/2))+1)/2.0;};x3dom.MatrixMixer.prototype._isValid=function(){var angles=this._beginMat.inverse().mult(this._endMat).getEulerAngles();return(Math.abs(angles[0])!=Math.PI&&Math.abs(angles[1])!=Math.PI&&Math.abs(angles[2])!=Math.PI);};x3dom.MatrixMixer.prototype._prepareQuaternionAnimation=function(){this._beginRot.setValue(this._beginMat);this._endRot.setValue(this._endMat);this._beginPos=this._beginMat.e3();this._endPos=this._endMat.e3();this._useQuaternion=true;};x3dom.MatrixMixer.prototype.reset=function(){this.beginTime=0;this.endTime=0;this._useQuaternion=false;this.isMixing=false;};x3dom.MatrixMixer.prototype.isActive=function(){return(this.beginTime>0);};x3dom.MatrixMixer.prototype.setBeginMatrix=function(mat){this._beginMat.setValues(mat);this._beginInvMat=mat.inverse();this._beginLogMat=x3dom.fields.SFMatrix4f.zeroMatrix();};x3dom.MatrixMixer.prototype.getBeginMatrix=function(mat){return this._beginMat;};x3dom.MatrixMixer.prototype.setEndMatrix=function(mat){this._endMat.setValues(mat);if(!this._isValid()){this._prepareQuaternionAnimation();}\nthis._endLogMat=this._endMat.mult(this._beginInvMat).log();this._logDiffMat=this._endLogMat.addScaled(this._beginLogMat,-1);};x3dom.MatrixMixer.prototype.getEndMatrix=function(mat){return this._endMat;};x3dom.MatrixMixer.prototype._mixQuaternion=function(fraction){var rotation=this._beginRot.slerp(this._endRot,fraction);var translation=this._beginPos.addScaled(this._endPos.subtract(this._beginPos),fraction);this._result.setRotate(rotation);this._result.setTranslate(translation);return this._result.copy();};x3dom.MatrixMixer.prototype._mixMatrix=function(fraction){return this._logDiffMat.multiply(fraction).add(this._beginLogMat).exp().mult(this._beginMat);};x3dom.MatrixMixer.prototype.mix=function(time){if(time<=this.beginTime){return this._beginMat;}else if(time>=this.endTime){this.reset();return this._endMat;}else{this.isMixing=true;var fraction=this._calcFraction(time);if(this._useQuaternion){return this._mixQuaternion(fraction);}else{return this._mixMatrix(fraction);}}};x3dom.InputTypes={NAVIGATION:1,INTERACTION:2};x3dom.Viewarea=function(document,scene){this._doc=document;this._scene=scene;document._nodeBag.viewarea.push(this);this._pickingInfo={pickPos:new x3dom.fields.SFVec3f(0,0,0),pickNorm:new x3dom.fields.SFVec3f(0,0,1),pickObj:null,firstObj:null,lastObj:null,lastClickObj:null,shadowObjectId:-1};this._currentInputType=x3dom.InputTypes.NAVIGATION;this._rotMat=x3dom.fields.SFMatrix4f.identity();this._transMat=x3dom.fields.SFMatrix4f.identity();this._movement=new x3dom.fields.SFVec3f(0,0,0);this._needNavigationMatrixUpdate=true;this._deltaT=0;this._flyMat=null;this._pitch=0;this._yaw=0;this._eyePos=new x3dom.fields.SFVec3f(0,0,0);this._width=400;this._height=300;this._dx=0;this._dy=0;this._lastX=-1;this._lastY=-1;this._pressX=-1;this._pressY=-1;this._lastButton=0;this._points=0;this._numRenderedNodes=0;this._pick=new x3dom.fields.SFVec3f(0,0,0);this._pickNorm=new x3dom.fields.SFVec3f(0,0,1);this._isAnimating=false;this._isMoving=false;this._lastTS=0;this._mixer=new x3dom.MatrixMixer();this._interpolator=new x3dom.FieldInterpolator();this._animationStateChanged=false;this.vrFrameData=null;this.gamepads=null;this.vrLeftViewMatrix=new x3dom.fields.SFMatrix4f();this.vrRightViewMatrix=new x3dom.fields.SFMatrix4f();this.vrLeftProjMatrix=new x3dom.fields.SFMatrix4f();this.vrRightProjMatrix=new x3dom.fields.SFMatrix4f();this.vrControllerManager=new x3dom.VRControllerManager();this._inverseDevicePixelRatio=1.0/window.devicePixelRatio;this.arc=null;};x3dom.Viewarea.prototype.setVRFrameData=function(vrFrameData)\n{this.vrFrameData=vrFrameData;if(this.vrFrameData)\n{this.vrLeftViewMatrix.setFromArray(this.vrFrameData.leftViewMatrix),this.vrRightViewMatrix.setFromArray(this.vrFrameData.rightViewMatrix)}};x3dom.Viewarea.prototype.updateGamepads=function(vrDisplay)\n{this.vrControllerManager.update(this,vrDisplay);};x3dom.Viewarea.prototype.tick=function(timeStamp){var needMixAnim=false;var env=this._scene.getEnvironment();if(env._vf.enableARC&&this.arc==null){this.arc=new x3dom.arc.AdaptiveRenderControl(this._scene);}\nif(this._mixer.isActive()){var mat=this._mixer.mix(timeStamp);this._scene.getViewpoint().setView(mat);}\nif(this._interpolator.isActive()){var value=this._interpolator.interpolate(timeStamp);this._scene.getViewpoint().setZoom(value);}\nvar needNavAnim=this.navigateTo(timeStamp);var lastIsAnimating=this._isAnimating;this._lastTS=timeStamp;this._isAnimating=(this._mixer.isMixing||this._interpolator.isInterpolating||needNavAnim);if(this._isAnimating!=lastIsAnimating){this._animationStateChanged=true;}else{this._animationStateChanged=false;}\nif(this.arc!=null){this.arc.update(this.isMovingOrAnimating()?1:0,this._doc._x3dElem.runtime.getFPS());}\nreturn(this._isAnimating||lastIsAnimating);};x3dom.Viewarea.prototype.isMoving=function(){return this._isMoving;};x3dom.Viewarea.prototype.isAnimating=function(){return this._isAnimating;};x3dom.Viewarea.prototype.hasAnimationStateChanged=function(){return this._animationStateChanged;};x3dom.Viewarea.prototype.isMovingOrAnimating=function(){return(this._isMoving||this._isAnimating);};x3dom.Viewarea.prototype.navigateTo=function(timeStamp){var navi=this._scene.getNavigationInfo();return navi._impl.navigateTo(this,timeStamp);};x3dom.Viewarea.prototype.moveFwd=function(){var navi=this._scene.getNavigationInfo();navi._impl.moveForward(this);};x3dom.Viewarea.prototype.moveBwd=function(){var navi=this._scene.getNavigationInfo();navi._impl.moveBackwards(this);};x3dom.Viewarea.prototype.strafeRight=function(){var navi=this._scene.getNavigationInfo();navi._impl.strafeRight(this);};x3dom.Viewarea.prototype.strafeLeft=function(){var navi=this._scene.getNavigationInfo();navi._impl.strafeLeft(this);};x3dom.Viewarea.prototype.animateTo=function(target,prev,dur){var navi=this._scene.getNavigationInfo();navi._impl.animateTo(this,target,prev,dur);};x3dom.Viewarea.prototype.orthoAnimateTo=function(target,prev,duration){var navi=this._scene.getNavigationInfo();navi._impl.orthoAnimateTo(this,target,prev,duration);};x3dom.Viewarea.prototype.zoom=function(zoomAmount){var navi=this._scene.getNavigationInfo();navi._impl.zoom(this,zoomAmount);};x3dom.Viewarea.prototype.getLights=function(){var enabledLights=[];for(var i=0;i<this._doc._nodeBag.lights.length;i++){if(this._doc._nodeBag.lights[i]._vf.on==true){enabledLights.push(this._doc._nodeBag.lights[i]);}}\nreturn enabledLights;};x3dom.Viewarea.prototype.getLightsShadow=function(){var lights=this._doc._nodeBag.lights;for(var l=0;l<lights.length;l++){if(lights[l]._vf.shadowIntensity>0.0){return true;}}\nreturn false;};x3dom.Viewarea.prototype.hasPhysicalEnvironmentLight=function(){var light;for(var i=0;i<this._doc._nodeBag.lights.length;i++)\n{var light=this._doc._nodeBag.lights[i];if(x3dom.isa(light,x3dom.nodeTypes.PhysicalEnvironmentLight)&&light._vf.on)\n{return true;}}\nreturn false;};x3dom.Viewarea.prototype.updateSpecialNavigation=function(viewpoint,mat_viewpoint){var navi=this._scene.getNavigationInfo();var navType=navi.getType();if(navType==\"helicopter\"&&!navi._heliUpdated){var typeParams=navi.getTypeParams();var theta=typeParams[0];var currViewMat=viewpoint.getViewMatrix().mult(mat_viewpoint.inverse()).inverse();this._from=currViewMat.e3();this._at=this._from.subtract(currViewMat.e2());this._up=new x3dom.fields.SFVec3f(0,1,0);this._from.y=typeParams[1];this._at.y=this._from.y;var sv=currViewMat.e0();var q=x3dom.fields.Quaternion.axisAngle(sv,theta);var temp=q.toMatrix();var fin=x3dom.fields.SFMatrix4f.translation(this._from);fin=fin.mult(temp);temp=x3dom.fields.SFMatrix4f.translation(this._from.negate());fin=fin.mult(temp);this._at=fin.multMatrixPnt(this._at);this._flyMat=x3dom.fields.SFMatrix4f.lookAt(this._from,this._at,this._up);this._scene.getViewpoint().setView(this._flyMat.inverse());navi._heliUpdated=true;}};x3dom.Viewarea.prototype.getViewpointMatrix=function(){var viewpoint=this._scene.getViewpoint();var mat_viewpoint=viewpoint.getCurrentTransform();this.updateSpecialNavigation(viewpoint,mat_viewpoint);return viewpoint.getViewMatrix().mult(mat_viewpoint.inverse());};x3dom.Viewarea.prototype.getViewMatrix=function()\n{if(this.vrFrameData)\n{return this.vrLeftViewMatrix;}\nelse\n{return this.getViewpointMatrix().mult(this._transMat).mult(this._rotMat);}};x3dom.Viewarea.prototype.getViewMatrices=function()\n{if(this.vrFrameData){return[this.vrLeftViewMatrix,this.vrRightViewMatrix];}else{var viewMatrix=this.getViewpointMatrix().mult(this._transMat).mult(this._rotMat);return[viewMatrix,viewMatrix]}};x3dom.Viewarea.prototype.getLightMatrix=function(){var lights=this._doc._nodeBag.lights;var i,n=lights.length;if(n>0){var vol=this._scene.getVolume();if(vol.isValid()){var min=x3dom.fields.SFVec3f.MAX();var max=x3dom.fields.SFVec3f.MIN();vol.getBounds(min,max);var l_arr=[];var viewpoint=this._scene.getViewpoint();var fov=viewpoint.getFieldOfView();var dia=max.subtract(min);var dist1=(dia.y/2.0)/Math.tan(fov/2.0)+(dia.z/2.0);var dist2=(dia.x/2.0)/Math.tan(fov/2.0)+(dia.z/2.0);dia=min.add(dia.multiply(0.5));for(i=0;i<n;i++){if(x3dom.isa(lights[i],x3dom.nodeTypes.PointLight)){var wcLoc=lights[i].getCurrentTransform().multMatrixPnt(lights[i]._vf.location);dia=dia.subtract(wcLoc).normalize();}else{var dir=lights[i].getCurrentTransform().multMatrixVec(lights[i]._vf.direction);dir=dir.normalize().negate();dia=dia.add(dir.multiply(1.2*(dist1>dist2?dist1:dist2)));}\nl_arr[i]=lights[i].getViewMatrix(dia);}\nreturn l_arr;}}\nreturn[this.getViewMatrix()];};x3dom.Viewarea.prototype.getWCtoLCMatrix=function(lMat){var proj=this.getProjectionMatrix();var view;if(arguments.length===0){view=this.getLightMatrix()[0];}else{view=lMat;}\nreturn proj.mult(view);};x3dom.Viewarea.prototype.getWCtoLCMatricesPointLight=function(view,lightNode,mat_proj){var zNear=lightNode._vf.zNear;var zFar=lightNode._vf.zFar;var proj=this.getLightProjectionMatrix(view,zNear,zFar,false,mat_proj);proj._00=1;proj._11=1;var matrices=[];matrices[0]=proj.mult(view);var rotationMatrix;for(var i=1;i<=3;i++){rotationMatrix=x3dom.fields.SFMatrix4f.rotationY(i*Math.PI/2);matrices[i]=proj.mult(rotationMatrix.mult(view));}\nrotationMatrix=x3dom.fields.SFMatrix4f.rotationX(Math.PI/2);matrices[4]=proj.mult(rotationMatrix.mult(view));rotationMatrix=x3dom.fields.SFMatrix4f.rotationX(3*Math.PI/2);matrices[5]=proj.mult(rotationMatrix.mult(view));return matrices;};x3dom.Viewarea.prototype.getWCtoLCMatricesCascaded=function(view,lightNode,mat_proj){var numCascades=Math.max(1,Math.min(lightNode._vf.shadowCascades,6));var splitFactor=Math.max(0,Math.min(lightNode._vf.shadowSplitFactor,1));var splitOffset=Math.max(0,Math.min(lightNode._vf.shadowSplitOffset,1));var isSpotLight=x3dom.isa(lightNode,x3dom.nodeTypes.SpotLight);var zNear=lightNode._vf.zNear;var zFar=lightNode._vf.zFar;var proj=this.getLightProjectionMatrix(view,zNear,zFar,true,mat_proj);if(isSpotLight){proj._00=1;proj._11=1;}\nvar viewProj=proj.mult(view);var matrices=[];if(numCascades==1){matrices[0]=viewProj;return matrices;}\nvar cascadeSplits=this.getShadowSplitDepths(numCascades,splitFactor,splitOffset,true,mat_proj);for(var i=0;i<numCascades;i++){var fittingMat=this.getLightFittingMatrix(viewProj,cascadeSplits[i],cascadeSplits[i+1],mat_proj);matrices[i]=fittingMat.mult(viewProj);}\nreturn matrices;};x3dom.Viewarea.prototype.getLightProjectionMatrix=function(lMat,zNear,zFar,highPrecision,mat_proj){var proj=x3dom.fields.SFMatrix4f.copy(mat_proj);if(!highPrecision||zNear>0||zFar>0){var lightPos=lMat.inverse().e3();var nearScale=0.8;var farScale=1.2;var min=x3dom.fields.SFVec3f.copy(this._scene._lastMin);var max=x3dom.fields.SFVec3f.copy(this._scene._lastMax);var dia=max.subtract(min);var sRad=dia.length()/2;var sCenter=min.add(dia.multiply(0.5));var vDist=(lightPos.subtract(sCenter)).length();var near,far;if(sRad){if(vDist>sRad)\nnear=(vDist-sRad)*nearScale;else\nnear=1;far=(vDist+sRad)*farScale;}\nif(zNear>0)near=zNear;if(zFar>0)far=zFar;proj._22=-(far+near)/(far-near);proj._23=-2.0*far*near/(far-near);return proj;}else{var cropMatrix=this.getLightCropMatrix(proj.mult(lMat));return cropMatrix.mult(proj);}};x3dom.Viewarea.prototype.getProjectionMatrix=function(){if(this.vrFrameData){return this.vrLeftProjMatrix.setFromArray(this.vrFrameData.leftProjectionMatrix);}else{var viewpoint=this._scene.getViewpoint();return viewpoint.getProjectionMatrix(this._width/this._height);}};x3dom.Viewarea.prototype.getProjectionMatrices=function()\n{if(this.vrFrameData)\n{return[this.vrLeftProjMatrix.setFromArray(this.vrFrameData.leftProjectionMatrix),this.vrRightProjMatrix.setFromArray(this.vrFrameData.rightProjectionMatrix)];}\nelse\n{var viewpoint=this._scene.getViewpoint();var projectionMatrix=viewpoint.getProjectionMatrix(this._width/this._height);return[projectionMatrix,projectionMatrix]}};x3dom.Viewarea.prototype.getViewfrustum=function(clipMat){var env=this._scene.getEnvironment();if(env._vf.frustumCulling==true){if(arguments.length==0){var proj=this.getProjectionMatrix();var view=this.getViewMatrix();return new x3dom.fields.FrustumVolume(proj.mult(view));}else{return new x3dom.fields.FrustumVolume(clipMat);}}\nreturn null;};x3dom.Viewarea.prototype.getWCtoCCMatrix=function(){var view=this.getViewMatrix();var proj=this.getProjectionMatrix();return proj.mult(view);};x3dom.Viewarea.prototype.getCCtoWCMatrix=function(){var mat=this.getWCtoCCMatrix();return mat.inverse();};x3dom.Viewarea.prototype.calcViewRay=function(x,y,mat){var cctowc=mat?mat:this.getCCtoWCMatrix();var rx=x/(this._width-1.0)*2.0-1.0;var ry=(this._height-1.0-y)/(this._height-1.0)*2.0-1.0;var from=cctowc.multFullMatrixPnt(new x3dom.fields.SFVec3f(rx,ry,-1));var at=cctowc.multFullMatrixPnt(new x3dom.fields.SFVec3f(rx,ry,1));var dir=at.subtract(from);return new x3dom.fields.Ray(from,dir);};x3dom.Viewarea.prototype.showAll=function(axis,updateCenterOfRotation){if(axis===undefined)\naxis=\"negZ\";if(updateCenterOfRotation===undefined){updateCenterOfRotation=false;}\nvar scene=this._scene;scene.updateVolume();var min=x3dom.fields.SFVec3f.copy(scene._lastMin);var max=x3dom.fields.SFVec3f.copy(scene._lastMax);var x=\"x\",y=\"y\",z=\"z\";var sign=1;var to,from=new x3dom.fields.SFVec3f(0,0,-1);switch(axis){case\"posX\":sign=-1;case\"negX\":z=\"x\";x=\"y\";y=\"z\";to=new x3dom.fields.SFVec3f(sign,0,0);break;case\"posY\":sign=-1;case\"negY\":z=\"y\";x=\"z\";y=\"x\";to=new x3dom.fields.SFVec3f(0,sign,0);break;case\"posZ\":sign=-1;case\"negZ\":default:to=new x3dom.fields.SFVec3f(0,0,-sign);break;}\nvar viewpoint=scene.getViewpoint();var fov=viewpoint.getFieldOfView();var isOrtho=x3dom.isa(viewpoint,x3dom.nodeTypes.OrthoViewpoint);var dia=max.subtract(min);var dia2=dia.multiply(0.5);var center=min.add(dia2);if(updateCenterOfRotation){viewpoint.setCenterOfRotation(center);}\nvar aspect=Math.min(this._width/this._height,1);var diaz2=dia[z]/2.0,tanfov2=Math.tan(fov/2.0);var dist1=(dia[y]/2.0)/tanfov2+diaz2;var dist2=(dia[x]/2.0)/tanfov2+diaz2;dia=min.add(dia.multiply(0.5));if(isOrtho){dia[z]+=sign*(dist1>dist2?dist1:dist2)*3.01;}else{dia[z]+=sign*(dist1>dist2?dist1:dist2)*1.01;}\ndia[z]/=aspect;var quat=x3dom.fields.Quaternion.rotateFromTo(from,to);var viewmat=quat.toMatrix();viewmat=viewmat.mult(x3dom.fields.SFMatrix4f.translation(dia.negate()));if(isOrtho){this.orthoAnimateTo(dist1,Math.abs(viewpoint._fieldOfView[0]));this.animateTo(viewmat,viewpoint);}else{this.animateTo(viewmat,viewpoint);}};x3dom.Viewarea.prototype.fit=function(min,max,updateCenterOfRotation){if(updateCenterOfRotation===undefined){updateCenterOfRotation=true;}\nvar dia2=max.subtract(min).multiply(0.5);var center=min.add(dia2);var bsr=dia2.length();var viewpoint=this._scene.getViewpoint();var fov=viewpoint.getFieldOfView();var viewmat=x3dom.fields.SFMatrix4f.copy(this.getViewMatrix());var rightDir=new x3dom.fields.SFVec3f(viewmat._00,viewmat._01,viewmat._02);var upDir=new x3dom.fields.SFVec3f(viewmat._10,viewmat._11,viewmat._12);var viewDir=new x3dom.fields.SFVec3f(viewmat._20,viewmat._21,viewmat._22);var aspect=Math.min(this._width/this._height,1);var tanfov2=Math.tan(fov/2.0);var dist=bsr/tanfov2/aspect;var eyePos=center.add(viewDir.multiply(dist));viewmat._03=-rightDir.dot(eyePos);viewmat._13=-upDir.dot(eyePos);viewmat._23=-viewDir.dot(eyePos);if(updateCenterOfRotation){viewpoint.setCenterOfRotation(center);}\nif(x3dom.isa(viewpoint,x3dom.nodeTypes.OrthoViewpoint)){this.orthoAnimateTo(dist/2.01,Math.abs(viewpoint._fieldOfView[0]));this.animateTo(viewmat,viewpoint);}else{this.animateTo(viewmat,viewpoint);}};x3dom.Viewarea.prototype.resetView=function(){var navi=this._scene.getNavigationInfo();navi._impl.resetView(this);};x3dom.Viewarea.prototype.resetNavHelpers=function(){this._rotMat=x3dom.fields.SFMatrix4f.identity();this._transMat=x3dom.fields.SFMatrix4f.identity();this._movement=new x3dom.fields.SFVec3f(0,0,0);this._needNavigationMatrixUpdate=true;};x3dom.Viewarea.prototype.uprightView=function(){var mat=this.getViewMatrix().inverse();var from=mat.e3();var at=from.subtract(mat.e2());var up=new x3dom.fields.SFVec3f(0,1,0);var s=mat.e2().cross(up).normalize();var v=s.cross(up).normalize();at=from.add(v);mat=x3dom.fields.SFMatrix4f.lookAt(from,at,up);mat=mat.inverse();this.animateTo(mat,this._scene.getViewpoint());};x3dom.Viewarea.prototype.callEvtHandler=function(node,eventType,event){if(!node||!node._xmlNode)\nreturn null;try{var attrib=node._xmlNode[eventType];if(typeof(attrib)===\"function\"){attrib.call(node._xmlNode,event);}else{var funcStr=node._xmlNode.getAttribute(eventType);var func=new Function('event',funcStr);func.call(node._xmlNode,event);}\nvar list=node._listeners[event.type];if(list){for(var it=0;it<list.length;it++){list[it].call(node._xmlNode,event);}}}catch(e){x3dom.debug.logException(e);}\nreturn event.cancelBubble;};x3dom.Viewarea.prototype.checkEvents=function(obj,x,y,buttonState,eventType){var that=this;var needRecurse=true;var childNode;var i,n;var target=(obj&&obj._xmlNode)?obj._xmlNode:{};var affectedPointingSensorsList=this._doc._nodeBag.affectedPointingSensors;var event={viewarea:that,target:target,type:eventType.substr(2,eventType.length-2),button:buttonState,layerX:x*this._inverseDevicePixelRatio,layerY:y*this._inverseDevicePixelRatio,worldX:that._pick.x,worldY:that._pick.y,worldZ:that._pick.z,normalX:that._pickNorm.x,normalY:that._pickNorm.y,normalZ:that._pickNorm.z,hitPnt:that._pick.toGL(),hitObject:target,shadowObjectId:that._pickingInfo.shadowObjectId,cancelBubble:false,stopPropagation:function(){this.cancelBubble=true;},preventDefault:function(){this.cancelBubble=true;}};try{var anObj=obj;if(anObj&&anObj._xmlNode&&anObj._cf.geometry&&!anObj._xmlNode[eventType]&&!anObj._xmlNode.hasAttribute(eventType)&&!anObj._listeners[event.type]){anObj=anObj._cf.geometry.node;}\nif(anObj&&that.callEvtHandler(anObj,eventType,event)===true){needRecurse=false;}}catch(e){x3dom.debug.logException(e);}\nvar recurse=function(obj){Array.forEach(obj._parentNodes,function(node){if(node._xmlNode&&(node._xmlNode[eventType]||node._xmlNode.hasAttribute(eventType)||node._listeners[event.type])){if(that.callEvtHandler(node,eventType,event)===true){needRecurse=false;}}\nif(buttonState==0&&affectedPointingSensorsList.length==0&&(eventType=='onmousemove'||eventType=='onmouseover'||eventType=='onmouseout')){n=node._childNodes.length;for(i=0;i<n;++i){childNode=node._childNodes[i];if(x3dom.isa(childNode,x3dom.nodeTypes.X3DPointingDeviceSensorNode)&&childNode._vf.enabled&&affectedPointingSensorsList.indexOf(childNode)==-1)\n{affectedPointingSensorsList.push(childNode);}}}\nif(x3dom.isa(node,x3dom.nodeTypes.Anchor)&&eventType==='onclick'){node.handleTouch();needRecurse=false;}\nelse if(needRecurse){recurse(node);}});};if(needRecurse&&obj){recurse(obj);}\nreturn needRecurse;};x3dom.Viewarea.prototype._notifyAffectedPointingSensors=function(event){var funcDict={\"mousedown\":\"pointerPressedOverSibling\",\"mousemove\":\"pointerMoved\",\"mouseover\":\"pointerMovedOver\",\"mouseout\":\"pointerMovedOut\"};var func=funcDict[event.type];var affectedPointingSensorsList=this._doc._nodeBag.affectedPointingSensors;var i,n=affectedPointingSensorsList.length;if(n>0&&func!==undefined){for(i=0;i<n;i++)\naffectedPointingSensorsList[i][func](event);}};x3dom.Viewarea.prototype.initMouseState=function(){this._deltaT=0;this._dx=0;this._dy=0;this._lastX=-1;this._lastY=-1;this._pressX=-1;this._pressY=-1;this._lastButton=0;this._isMoving=false;this._needNavigationMatrixUpdate=true;};x3dom.Viewarea.prototype.onMousePress=function(x,y,buttonState){this._needNavigationMatrixUpdate=true;this.prepareEvents(x,y,0,\"onmouseover\");this.prepareEvents(x,y,buttonState,\"onmousedown\");this._pickingInfo.lastClickObj=this._pickingInfo.pickObj;this._pickingInfo.firstObj=this._pickingInfo.pickObj;this._dx=0;this._dy=0;this._lastX=x;this._lastY=y;this._pressX=x;this._pressY=y;this._lastButton=buttonState;this._isMoving=false;if(this._currentInputType==x3dom.InputTypes.NAVIGATION){var navi=this._scene.getNavigationInfo();navi._impl.onMousePress(this,x,y,buttonState);}};x3dom.Viewarea.prototype.onMouseRelease=function(x,y,buttonState,prevButton){var i;var affectedPointingSensorsList=this._doc._nodeBag.affectedPointingSensors;for(i=0;i<affectedPointingSensorsList.length;++i){affectedPointingSensorsList[i].pointerReleased();}\nthis._doc._nodeBag.affectedPointingSensors=[];var tDist=3.0;var dir;var navi=this._scene.getNavigationInfo();var navType=navi.getType();if(this._scene._vf.pickMode.toLowerCase()!==\"box\"){this.prepareEvents(x,y,prevButton,\"onmouseup\");if(this._pickingInfo.pickObj&&this._pickingInfo.pickObj===this._pickingInfo.lastClickObj){this.prepareEvents(x,y,prevButton,\"onclick\");}else if(!this._pickingInfo.pickObj&&!this._pickingInfo.lastClickObj&&!this._pickingInfo.firstObj)\n{var eventType=\"backgroundClicked\";try{if(this._scene._xmlNode&&(this._scene._xmlNode[\"on\"+eventType]||this._scene._xmlNode.hasAttribute(\"on\"+eventType)||this._scene._listeners[eventType])){var event={target:this._scene._xmlNode,type:eventType,button:prevButton,layerX:x*this._inverseDevicePixelRatio,layerY:y*this._inverseDevicePixelRatio,cancelBubble:false,stopPropagation:function(){this.cancelBubble=true;},preventDefault:function(){this.cancelBubble=true;}};this._scene.callEvtHandler((\"on\"+eventType),event);}}catch(e){x3dom.debug.logException(\"backgroundClicked: \"+e);}}}else{var t0=new Date().getTime();var line=this.calcViewRay(x,y);var isect=this._scene.doIntersect(line);var obj=line.hitObject;if(isect&&obj){this._pick.setValues(line.hitPoint);this.checkEvents(obj,x,y,buttonState,\"onclick\");x3dom.debug.logInfo(\"Hit '\"+obj._xmlNode.localName+\"/ \"+\nobj._DEF+\"' at dist=\"+line.dist.toFixed(4));x3dom.debug.logInfo(\"Ray hit at position \"+this._pick);}\nvar t1=new Date().getTime()-t0;x3dom.debug.logInfo(\"Picking time (box): \"+t1+\"ms\");if(!isect){dir=this.getViewMatrix().e2().negate();var u=dir.dot(line.pos.negate())/dir.dot(line.dir);this._pick=line.pos.add(line.dir.multiply(u));}}\nthis._pickingInfo.firstObj=null;if(this._currentInputType==x3dom.InputTypes.NAVIGATION&&(this._pickingInfo.pickObj||this._pickingInfo.shadowObjectId>=0)&&navType===\"lookat\"&&this._pressX===x&&this._pressY===y){var step=(this._lastButton&2)?-1:1;var dist=this._pickingInfo.pickPos.subtract(this._from).length()/tDist;var laMat=new x3dom.fields.SFMatrix4f();laMat.setValues(this.getViewMatrix());laMat=laMat.inverse();var from=laMat.e3();var at=from.subtract(laMat.e2());var up=laMat.e1();dir=this._pickingInfo.pickPos.subtract(from);var len=dir.length();dir=dir.normalize();var newAt=from.addScaled(dir,len);var s=dir.cross(up).normalize();dir=s.cross(up).normalize();if(step<0){dist=(0.5+len+dist)*2;}\nvar newFrom=newAt.addScaled(dir,dist);laMat=x3dom.fields.SFMatrix4f.lookAt(newFrom,newAt,up);laMat=laMat.inverse();dist=newFrom.subtract(from).length();var dur=Math.max(0.5,Math.log((1+dist)/navi._vf.speed));this.animateTo(laMat,this._scene.getViewpoint(),dur);}\nthis._dx=0;this._dy=0;this._lastX=x;this._lastY=y;this._lastButton=buttonState;this._isMoving=false;};x3dom.Viewarea.prototype.onMouseOver=function(x,y,buttonState){this._dx=0;this._dy=0;this._lastButton=0;this._isMoving=false;this._lastX=x;this._lastY=y;this._deltaT=0;};x3dom.Viewarea.prototype.onMouseOut=function(x,y,buttonState){this._dx=0;this._dy=0;this._lastButton=0;this._isMoving=false;this._lastX=x;this._lastY=y;this._deltaT=0;var i;var affectedPointingSensorsList=this._doc._nodeBag.affectedPointingSensors;for(i=0;i<affectedPointingSensorsList.length;++i){affectedPointingSensorsList[i].pointerReleased();}\nthis._doc._nodeBag.affectedPointingSensors=[];};x3dom.Viewarea.prototype.onDoubleClick=function(x,y){if(this._doc._x3dElem.hasAttribute('disableDoubleClick')&&this._doc._x3dElem.getAttribute('disableDoubleClick')==='true'){return;}\nvar navi=this._scene.getNavigationInfo();navi._impl.onDoubleClick(this,x,y);};x3dom.Viewarea.prototype.handleMoveEvt=function(x,y,buttonState){if(buttonState==0){this._doc._nodeBag.affectedPointingSensors=[];}\nthis.prepareEvents(x,y,buttonState,\"onmousemove\");if(this._pickingInfo.pickObj!==this._pickingInfo.lastObj){if(this._pickingInfo.lastObj){var obj=this._pickingInfo.pickObj;this._pickingInfo.pickObj=this._pickingInfo.lastObj;this.prepareEvents(x,y,buttonState,\"onmouseout\");this._pickingInfo.pickObj=obj;}\nif(this._pickingInfo.pickObj){this.prepareEvents(x,y,buttonState,\"onmouseover\");}\nthis._pickingInfo.lastObj=this._pickingInfo.pickObj;}};x3dom.Viewarea.prototype.onMove=function(x,y,buttonState){this.handleMoveEvt(x,y,buttonState);if(this._lastX<0||this._lastY<0){this._lastX=x;this._lastY=y;}\nthis._dx=x-this._lastX;this._dy=y-this._lastY;this._lastX=x;this._lastY=y;};x3dom.Viewarea.prototype.onMoveView=function(translation,rotation){if(this._currentInputType==x3dom.InputTypes.NAVIGATION){var navi=this._scene.getNavigationInfo();var viewpoint=this._scene.getViewpoint();if(navi.getType()===\"examine\"){if(translation){var distance=(this._scene._lastMax.subtract(this._scene._lastMin)).length();distance=((distance<x3dom.fields.Eps)?1:distance)*navi._vf.speed;translation=translation.multiply(distance);this._movement=this._movement.add(translation);this._transMat=viewpoint.getViewMatrix().inverse().mult(x3dom.fields.SFMatrix4f.translation(this._movement)).mult(viewpoint.getViewMatrix());}\nif(rotation){var center=viewpoint.getCenterOfRotation();var mat=this.getViewMatrix();mat.setTranslate(new x3dom.fields.SFVec3f(0,0,0));this._rotMat=this._rotMat.mult(x3dom.fields.SFMatrix4f.translation(center)).mult(mat.inverse()).mult(rotation).mult(mat).mult(x3dom.fields.SFMatrix4f.translation(center.negate()));}\nthis._isMoving=true;}}};x3dom.Viewarea.prototype.onDrag=function(x,y,buttonState){this.handleMoveEvt(x,y,buttonState);if(this._currentInputType==x3dom.InputTypes.NAVIGATION){this._scene.getNavigationInfo()._impl.onDrag(this,x,y,buttonState);}};x3dom.Viewarea.prototype.prepareEvents=function(x,y,buttonState,eventType){var affectedPointingSensorsList=this._doc._nodeBag.affectedPointingSensors;var pickMode=this._scene._vf.pickMode.toLowerCase();var avoidTraversal=(pickMode.indexOf(\"idbuf\")==0||pickMode==\"color\"||pickMode==\"texcoord\");var obj=null;if(avoidTraversal){obj=this._pickingInfo.pickObj;if(obj){this._pick.setValues(this._pickingInfo.pickPos);this._pickNorm.setValues(this._pickingInfo.pickNorm);this.checkEvents(obj,x,y,buttonState,eventType);if(eventType===\"onclick\"){if(obj._xmlNode)\nx3dom.debug.logInfo(\"Hit \\\"\"+obj._xmlNode.localName+\"/ \"+obj._DEF+\"\\\"\");x3dom.debug.logInfo(\"Ray hit at position \"+this._pick);}}}\nvar event={viewarea:this,target:{},type:eventType.substr(2,eventType.length-2),button:buttonState,layerX:x*this._inverseDevicePixelRatio,layerY:y*this._inverseDevicePixelRatio,worldX:this._pick.x,worldY:this._pick.y,worldZ:this._pick.z,normalX:this._pickNorm.x,normalY:this._pickNorm.y,normalZ:this._pickNorm.z,hitPnt:this._pick.toGL(),hitObject:(obj&&obj._xmlNode)?obj._xmlNode:null,shadowObjectId:this._pickingInfo.shadowObjectId,cancelBubble:false,stopPropagation:function(){this.cancelBubble=true;},preventDefault:function(){this.cancelBubble=true;}};this._notifyAffectedPointingSensors(event);if(affectedPointingSensorsList.length>0){this._currentInputType=x3dom.InputTypes.INTERACTION;}else{this._currentInputType=x3dom.InputTypes.NAVIGATION;}};x3dom.Viewarea.prototype.getRenderMode=function(){return this._points;};x3dom.Viewarea.prototype.getShadowedLights=function(){var shadowedLights=[];var shadowIndex=0;var slights=this.getLights();for(var i=0;i<slights.length;i++){if(slights[i]._vf.shadowIntensity>0.0){shadowedLights[shadowIndex]=slights[i];shadowIndex++;}}\nreturn shadowedLights;};x3dom.Viewarea.prototype.getShadowSplitDepths=function(numCascades,splitFactor,splitOffset,postProject,mat_proj){var logSplit;var practSplit=[];var viewPoint=this._scene.getViewpoint();var zNear=viewPoint.getNear();var zFar=viewPoint.getFar();practSplit[0]=zNear;zNear=zNear+splitOffset*(zFar-zNear)/10;for(var i=1;i<numCascades;i++){logSplit=zNear*Math.pow((zFar/zNear),i/numCascades);practSplit[i]=splitFactor*logSplit+(1-splitFactor)*(zNear+i/(numCascades*(zNear-zFar)));}\npractSplit[numCascades]=zFar;if(!postProject)\nreturn practSplit;var postProj=[];for(var j=0;j<=numCascades;j++){postProj[j]=mat_proj.multFullMatrixPnt(new x3dom.fields.SFVec3f(0,0,-practSplit[j])).z;}\nreturn postProj;};x3dom.Viewarea.prototype.getLightCropMatrix=function(WCToLCMatrix){var sceneMin=x3dom.fields.SFVec3f.copy(this._scene._lastMin);var sceneMax=x3dom.fields.SFVec3f.copy(this._scene._lastMax);var sceneCorners=[];sceneCorners[0]=new x3dom.fields.SFVec3f(sceneMin.x,sceneMin.y,sceneMin.z);sceneCorners[1]=new x3dom.fields.SFVec3f(sceneMin.x,sceneMin.y,sceneMax.z);sceneCorners[2]=new x3dom.fields.SFVec3f(sceneMin.x,sceneMax.y,sceneMin.z);sceneCorners[3]=new x3dom.fields.SFVec3f(sceneMin.x,sceneMax.y,sceneMax.z);sceneCorners[4]=new x3dom.fields.SFVec3f(sceneMax.x,sceneMin.y,sceneMin.z);sceneCorners[5]=new x3dom.fields.SFVec3f(sceneMax.x,sceneMin.y,sceneMax.z);sceneCorners[6]=new x3dom.fields.SFVec3f(sceneMax.x,sceneMax.y,sceneMin.z);sceneCorners[7]=new x3dom.fields.SFVec3f(sceneMax.x,sceneMax.y,sceneMax.z);var i;for(i=0;i<8;i++){sceneCorners[i]=WCToLCMatrix.multFullMatrixPnt(sceneCorners[i]);}\nvar minScene=x3dom.fields.SFVec3f.copy(sceneCorners[0]);var maxScene=x3dom.fields.SFVec3f.copy(sceneCorners[0]);for(i=1;i<8;i++){minScene.z=Math.min(sceneCorners[i].z,minScene.z);maxScene.z=Math.max(sceneCorners[i].z,maxScene.z);}\nvar scaleZ=2.0/(maxScene.z-minScene.z);var offsetZ=-(scaleZ*(maxScene.z+minScene.z))/2.0;var cropMatrix=x3dom.fields.SFMatrix4f.identity();cropMatrix._22=scaleZ;cropMatrix._23=offsetZ;return cropMatrix;};x3dom.Viewarea.prototype.getLightFittingMatrix=function(WCToLCMatrix,zNear,zFar,mat_proj){var mat_view=this.getViewMatrix();var mat_view_proj=mat_proj.mult(mat_view);var mat_view_proj_inverse=mat_view_proj.inverse();var frustumCorners=[];frustumCorners[0]=new x3dom.fields.SFVec3f(-1,-1,zFar);frustumCorners[1]=new x3dom.fields.SFVec3f(-1,-1,zNear);frustumCorners[2]=new x3dom.fields.SFVec3f(-1,1,zFar);frustumCorners[3]=new x3dom.fields.SFVec3f(-1,1,zNear);frustumCorners[4]=new x3dom.fields.SFVec3f(1,-1,zFar);frustumCorners[5]=new x3dom.fields.SFVec3f(1,-1,zNear);frustumCorners[6]=new x3dom.fields.SFVec3f(1,1,zFar);frustumCorners[7]=new x3dom.fields.SFVec3f(1,1,zNear);var i;for(i=0;i<8;i++){frustumCorners[i]=mat_view_proj_inverse.multFullMatrixPnt(frustumCorners[i]);frustumCorners[i]=WCToLCMatrix.multFullMatrixPnt(frustumCorners[i]);}\nvar minFrustum=x3dom.fields.SFVec3f.copy(frustumCorners[0]);var maxFrustum=x3dom.fields.SFVec3f.copy(frustumCorners[0]);for(i=1;i<8;i++){minFrustum.x=Math.min(frustumCorners[i].x,minFrustum.x);minFrustum.y=Math.min(frustumCorners[i].y,minFrustum.y);minFrustum.z=Math.min(frustumCorners[i].z,minFrustum.z);maxFrustum.x=Math.max(frustumCorners[i].x,maxFrustum.x);maxFrustum.y=Math.max(frustumCorners[i].y,maxFrustum.y);maxFrustum.z=Math.max(frustumCorners[i].z,maxFrustum.z);}\nfunction clip(min,max){var xMin=min.x;var yMin=min.y;var zMin=min.z;var xMax=max.x;var yMax=max.y;var zMax=max.z;if(xMin>1.0||xMax<-1.0){xMin=-1.0;xMax=1.0;}else{xMin=Math.max(xMin,-1.0);xMax=Math.min(xMax,1.0);}\nif(yMin>1.0||yMax<-1.0){yMin=-1.0;yMax=1.0;}else{yMin=Math.max(yMin,-1.0);yMax=Math.min(yMax,1.0);}\nif(zMin>1.0||zMax<-1.0){zMin=-1.0;zMax=1.0;}else{zMin=Math.max(zMin,-1.0);zMax=Math.min(zMax,1.0);}\nvar minValues=new x3dom.fields.SFVec3f(xMin,yMin,zMin);var maxValues=new x3dom.fields.SFVec3f(xMax,yMax,zMax);return new x3dom.fields.BoxVolume(minValues,maxValues);}\nvar frustumBB=clip(minFrustum,maxFrustum);var scaleX=2.0/(frustumBB.max.x-frustumBB.min.x);var scaleY=2.0/(frustumBB.max.y-frustumBB.min.y);var offsetX=-(scaleX*(frustumBB.max.x+frustumBB.min.x))/2.0;var offsetY=-(scaleY*(frustumBB.max.y+frustumBB.min.y))/2.0;var fittingMatrix=x3dom.fields.SFMatrix4f.identity();fittingMatrix._00=scaleX;fittingMatrix._11=scaleY;fittingMatrix._03=offsetX;fittingMatrix._13=offsetY;return fittingMatrix;};x3dom.Mesh=function(parent){this._parent=parent;this._vol=new x3dom.fields.BoxVolume();this._invalidate=true;this._numFaces=0;this._numCoords=0;this._primType='TRIANGLES';this._positions=[];this._normals=[];this._texCoords=[];this._texCoords2=[];this._colors=[];this._indices=[];this._tangents=[];this._binormals=[];this._positions[0]=[];this._normals[0]=[];this._texCoords[0]=[];this._texCoords2[0]=[];this._colors[0]=[];this._indices[0]=[];this._tangents[0]=[];this._binormals[0]=[];};x3dom.Mesh.prototype._dynamicFields={};x3dom.Mesh.prototype._numPosComponents=3;x3dom.Mesh.prototype._numTexComponents=2;x3dom.Mesh.prototype._numTex2Components=2;x3dom.Mesh.prototype._numColComponents=3;x3dom.Mesh.prototype._numNormComponents=3;x3dom.Mesh.prototype._numTangentComponents=3;x3dom.Mesh.prototype._numBinormalComponents=3;x3dom.Mesh.prototype._lit=true;x3dom.Mesh.prototype._vol=null;x3dom.Mesh.prototype._invalidate=true;x3dom.Mesh.prototype._numFaces=0;x3dom.Mesh.prototype._numCoords=0;x3dom.Mesh.prototype.getVolume=function(){if(this._invalidate==true&&!this._vol.isValid()){var coords=this._positions[0];var n=coords.length;if(n>=3){var initVal=new x3dom.fields.SFVec3f(coords[0],coords[1],coords[2]);this._vol.setBounds(initVal,initVal);for(var i=3;i<n;i+=3){if(this._vol.min.x>coords[i]){this._vol.min.x=coords[i];}\nif(this._vol.min.y>coords[i+1]){this._vol.min.y=coords[i+1];}\nif(this._vol.min.z>coords[i+2]){this._vol.min.z=coords[i+2];}\nif(this._vol.max.x<coords[i]){this._vol.max.x=coords[i];}\nif(this._vol.max.y<coords[i+1]){this._vol.max.y=coords[i+1];}\nif(this._vol.max.z<coords[i+2]){this._vol.max.z=coords[i+2];}}\nthis._invalidate=false;}}\nreturn this._vol;};x3dom.Mesh.prototype.invalidate=function(){this._invalidate=true;this._vol.invalidate();};x3dom.Mesh.prototype.isValid=function(){return this._vol.isValid();};x3dom.Mesh.prototype.getCenter=function(){return this.getVolume().getCenter();};x3dom.Mesh.prototype.getDiameter=function(){return this.getVolume().getDiameter();};x3dom.Mesh.prototype.doIntersect=function(line){var vol=this.getVolume();var isect=line.intersect(vol.min,vol.max);if(isect&&line.enter<line.dist){line.dist=line.enter;line.hitObject=this._parent;line.hitPoint=line.pos.add(line.dir.multiply(line.enter));}\nreturn isect;};x3dom.Mesh.prototype.calcNormals=function(creaseAngle,ccw){if(ccw===undefined)\nccw=true;var multInd=this._multiIndIndices&&this._multiIndIndices.length;var idxs=multInd?this._multiIndIndices:this._indices[0];var coords=this._positions[0];var vertNormals=[];var vertFaceNormals=[];var i,j,m=coords.length;var a,b,n=null;var num=(this._posSize!==undefined&&this._posSize>m)?this._posSize/3:m/3;num=3*((num-Math.floor(num)>0)?Math.floor(num+1):num);for(i=0;i<num;++i){vertFaceNormals[i]=[];}\nnum=idxs.length;for(i=0;i<num;i+=3){var ind_i0,ind_i1,ind_i2;var t;if(!multInd){ind_i0=idxs[i]*3;ind_i1=idxs[i+1]*3;ind_i2=idxs[i+2]*3;t=new x3dom.fields.SFVec3f(coords[ind_i1],coords[ind_i1+1],coords[ind_i1+2]);a=new x3dom.fields.SFVec3f(coords[ind_i0],coords[ind_i0+1],coords[ind_i0+2]).subtract(t);b=t.subtract(new x3dom.fields.SFVec3f(coords[ind_i2],coords[ind_i2+1],coords[ind_i2+2]));ind_i0=i*3;ind_i1=(i+1)*3;ind_i2=(i+2)*3;}else{ind_i0=i*3;ind_i1=(i+1)*3;ind_i2=(i+2)*3;t=new x3dom.fields.SFVec3f(coords[ind_i1],coords[ind_i1+1],coords[ind_i1+2]);a=new x3dom.fields.SFVec3f(coords[ind_i0],coords[ind_i0+1],coords[ind_i0+2]).subtract(t);b=t.subtract(new x3dom.fields.SFVec3f(coords[ind_i2],coords[ind_i2+1],coords[ind_i2+2]));}\nn=a.cross(b).normalize();if(!ccw){n=n.negate();}\nif(creaseAngle<=x3dom.fields.Eps){vertNormals[ind_i0]=vertNormals[ind_i1]=vertNormals[ind_i2]=n.x;vertNormals[ind_i0+1]=vertNormals[ind_i1+1]=vertNormals[ind_i2+1]=n.y;vertNormals[ind_i0+2]=vertNormals[ind_i1+2]=vertNormals[ind_i2+2]=n.z;}else{vertFaceNormals[idxs[i]].push(n);vertFaceNormals[idxs[i+1]].push(n);vertFaceNormals[idxs[i+2]].push(n);}}\nif(creaseAngle>x3dom.fields.Eps){for(i=0;i<m;i+=3){var iThird=i/3;var arr;if(!multInd){arr=vertFaceNormals[iThird];}else{arr=vertFaceNormals[idxs[iThird]];}\nnum=arr.length;n=new x3dom.fields.SFVec3f(0,0,0);for(j=0;j<num;++j){n=n.add(arr[j]);}\nn=n.normalize();vertNormals[i]=n.x;vertNormals[i+1]=n.y;vertNormals[i+2]=n.z;}}\nthis._normals[0]=vertNormals;};x3dom.Mesh.prototype.splitMesh=function(primStride,checkMultiIndIndices){var pStride;var isMultiInd;if(primStride===undefined){pStride=3;}else{pStride=primStride;}\nif(checkMultiIndIndices===undefined){checkMultiIndIndices=false;}\nvar MAX=x3dom.Utils.maxIndexableCoords;MAX=Math.floor(MAX/pStride)*pStride;if(this._positions[0].length/3<=MAX&&!checkMultiIndIndices){return;}\nif(checkMultiIndIndices){isMultiInd=this._multiIndIndices&&this._multiIndIndices.length;}else{isMultiInd=false;}\nvar positions=this._positions[0];var normals=this._normals[0];var texCoords=this._texCoords[0];var colors=this._colors[0];var indices=isMultiInd?this._multiIndIndices:this._indices[0];var tangents=this._tangents[0];var binormals=this._binormals[0];var i=0;do{this._positions[i]=[];this._normals[i]=[];this._texCoords[i]=[];this._colors[i]=[];this._indices[i]=[];this._tangents[i]=[];this._binormals[i]=[];var k=(indices.length-((i+1)*MAX)>=0);if(k){this._indices[i]=indices.slice(i*MAX,(i+1)*MAX);}else{this._indices[i]=indices.slice(i*MAX);}\nif(!isMultiInd){if(i){var m=i*MAX;for(var j=0,l=this._indices[i].length;j<l;j++){this._indices[i][j]-=m;}}}else{for(var j=0,l=this._indices[i].length;j<l;j++){this._indices[i][j]=j;}}\nif(k){this._positions[i]=positions.slice(i*MAX*3,3*(i+1)*MAX);}else{this._positions[i]=positions.slice(i*MAX*3);}\nif(normals.length){if(k){this._normals[i]=normals.slice(i*MAX*3,3*(i+1)*MAX);}else{this._normals[i]=normals.slice(i*MAX*3);}}\nif(texCoords.length){if(k){this._texCoords[i]=texCoords.slice(i*MAX*this._numTexComponents,this._numTexComponents*(i+1)*MAX);}else{this._texCoords[i]=texCoords.slice(i*MAX*this._numTexComponents);}}\nif(colors.length){if(k){this._colors[i]=colors.slice(i*MAX*this._numColComponents,this._numColComponents*(i+1)*MAX);}else{this._colors[i]=colors.slice(i*MAX*this._numColComponents);}}\nif(tangents.length){if(k){this._tangents[i]=tangents.slice(i*MAX*3,3*(i+1)*MAX);}else{this._tangents[i]=tangents.slice(i*MAX*3);}}\nif(binormals.length){if(k){this._binormals[i]=binormals.slice(i*MAX*3,3*(i+1)*MAX);}else{this._binormals[i]=binormals.slice(i*MAX*3);}}}while(positions.length>++i*MAX*3);};x3dom.Mesh.prototype.calcTexCoords=function(mode){this._texCoords[0]=[];if(mode.toLowerCase()===\"sphere-local\"){for(var i=0,j=0,n=this._normals[0].length;i<n;i+=3){this._texCoords[0][j++]=0.5+this._normals[0][i]/2.0;this._texCoords[0][j++]=0.5+this._normals[0][i+1]/2.0;}}\nif(mode.toLowerCase()===\"coord\"){for(var k=0,l=0,m=this._positions[0].length;k<m;k+=3){this._texCoords[0][l++]=this._positions[0][k];this._texCoords[0][l++]=this._positions[0][k+1];}}else{var min=new x3dom.fields.SFVec3f(0,0,0),max=new x3dom.fields.SFVec3f(0,0,0);var vol=this.getVolume();vol.getBounds(min,max);var dia=max.subtract(min);var S=0,T=1;if(dia.x>=dia.y){if(dia.x>=dia.z){S=0;T=dia.y>=dia.z?1:2;}else{S=2;T=0;}}else{if(dia.y>=dia.z){S=1;T=dia.x>=dia.z?0:2;}else{S=2;T=1;}}\nvar sDenom=1,tDenom=1;var sMin=0,tMin=0;switch(S){case 0:sDenom=dia.x;sMin=min.x;break;case 1:sDenom=dia.y;sMin=min.y;break;case 2:sDenom=dia.z;sMin=min.z;break;}\nswitch(T){case 0:tDenom=dia.x;tMin=min.x;break;case 1:tDenom=dia.y;tMin=min.y;break;case 2:tDenom=dia.z;tMin=min.z;break;}\nfor(var k=0,l=0,m=this._positions[0].length;k<m;k+=3){this._texCoords[0][l++]=(this._positions[0][k+S]-sMin)/sDenom;this._texCoords[0][l++]=(this._positions[0][k+T]-tMin)/sDenom;}}};if(typeof x3dom===\"undefined\"){x3dom={extend:function(f){function G(){}\nG.prototype=f.prototype||f;return new G();},debug:{logInfo:function(msg){console.log(msg);},logWarning:function(msg){console.warn(msg);},logError:function(msg){console.error(msg);}}};if(!Array.map){Array.map=function(array,fun,thisp){var len=array.length;var res=[];for(var i=0;i<len;i++){if(i in array){res[i]=fun.call(thisp,array[i],i,array);}}\nreturn res;};}\nconsole.log(\"Using x3dom fields.js as standalone math and/or base types library.\");}\nx3dom.fields={};var VecMath=x3dom.fields;x3dom.fields.Eps=0.000001;x3dom.fields.SFMatrix4f=function(_00,_01,_02,_03,_10,_11,_12,_13,_20,_21,_22,_23,_30,_31,_32,_33){if(arguments.length===0){this._00=1;this._01=0;this._02=0;this._03=0;this._10=0;this._11=1;this._12=0;this._13=0;this._20=0;this._21=0;this._22=1;this._23=0;this._30=0;this._31=0;this._32=0;this._33=1;}else{this._00=_00;this._01=_01;this._02=_02;this._03=_03;this._10=_10;this._11=_11;this._12=_12;this._13=_13;this._20=_20;this._21=_21;this._22=_22;this._23=_23;this._30=_30;this._31=_31;this._32=_32;this._33=_33;}};x3dom.fields.SFMatrix4f.prototype.e0=function(){var baseVec=new x3dom.fields.SFVec3f(this._00,this._10,this._20);return baseVec.normalize();};x3dom.fields.SFMatrix4f.prototype.e1=function(){var baseVec=new x3dom.fields.SFVec3f(this._01,this._11,this._21);return baseVec.normalize();};x3dom.fields.SFMatrix4f.prototype.e2=function(){var baseVec=new x3dom.fields.SFVec3f(this._02,this._12,this._22);return baseVec.normalize();};x3dom.fields.SFMatrix4f.prototype.e3=function(){return new x3dom.fields.SFVec3f(this._03,this._13,this._23);};x3dom.fields.SFMatrix4f.copy=function(that){return new x3dom.fields.SFMatrix4f(that._00,that._01,that._02,that._03,that._10,that._11,that._12,that._13,that._20,that._21,that._22,that._23,that._30,that._31,that._32,that._33);};x3dom.fields.SFMatrix4f.prototype.copy=function(){return x3dom.fields.SFMatrix4f.copy(this);};x3dom.fields.SFMatrix4f.identity=function(){return new x3dom.fields.SFMatrix4f(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);};x3dom.fields.SFMatrix4f.zeroMatrix=function(){return new x3dom.fields.SFMatrix4f(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);};x3dom.fields.SFMatrix4f.translation=function(vec){return new x3dom.fields.SFMatrix4f(1,0,0,vec.x,0,1,0,vec.y,0,0,1,vec.z,0,0,0,1);};x3dom.fields.SFMatrix4f.rotationX=function(a){var c=Math.cos(a);var s=Math.sin(a);return new x3dom.fields.SFMatrix4f(1,0,0,0,0,c,-s,0,0,s,c,0,0,0,0,1);};x3dom.fields.SFMatrix4f.rotationY=function(a){var c=Math.cos(a);var s=Math.sin(a);return new x3dom.fields.SFMatrix4f(c,0,s,0,0,1,0,0,-s,0,c,0,0,0,0,1);};x3dom.fields.SFMatrix4f.rotationZ=function(a){var c=Math.cos(a);var s=Math.sin(a);return new x3dom.fields.SFMatrix4f(c,-s,0,0,s,c,0,0,0,0,1,0,0,0,0,1);};x3dom.fields.SFMatrix4f.scale=function(vec){return new x3dom.fields.SFMatrix4f(vec.x,0,0,0,0,vec.y,0,0,0,0,vec.z,0,0,0,0,1);};x3dom.fields.SFMatrix4f.lookAt=function(from,at,up){var view=from.subtract(at).normalize();var right=up.normalize().cross(view).normalize();if(right.dot(right)<x3dom.fields.Eps){x3dom.debug.logWarning(\"View matrix is linearly dependent.\");return x3dom.fields.SFMatrix4f.translation(from);}\nvar newUp=view.cross(right).normalize();var tmp=x3dom.fields.SFMatrix4f.identity();tmp.setValue(right,newUp,view,from);return tmp;};x3dom.fields.SFMatrix4f.perspectiveFrustum=function(left,right,bottom,top,near,far){return new x3dom.fields.SFMatrix4f(2*near/(right-left),0,(right+left)/(right-left),0,0,2*near/(top-bottom),(top+bottom)/(top-bottom),0,0,0,-(far+near)/(far-near),-2*far*near/(far-near),0,0,-1,0);};x3dom.fields.SFMatrix4f.perspective=function(fov,aspect,near,far){var f=1/Math.tan(fov/2);return new x3dom.fields.SFMatrix4f(f/aspect,0,0,0,0,f,0,0,0,0,(near+far)/(near-far),2*near*far/(near-far),0,0,-1,0);};x3dom.fields.SFMatrix4f.ortho=function(left,right,bottom,top,near,far,aspect){var rl=(right-left)/2;var tb=(top-bottom)/2;var fn=far-near;if(aspect===undefined)\naspect=1.0;if(aspect<(rl/tb)){tb=rl/aspect;}else{rl=tb*aspect;}\nleft=-rl;right=rl;bottom=-tb;top=tb;rl*=2;tb*=2;return new x3dom.fields.SFMatrix4f(2/rl,0,0,-(right+left)/rl,0,2/tb,0,-(top+bottom)/tb,0,0,-2/fn,-(far+near)/fn,0,0,0,1);};x3dom.fields.SFMatrix4f.prototype.setTranslate=function(vec){this._03=vec.x;this._13=vec.y;this._23=vec.z;};x3dom.fields.SFMatrix4f.prototype.setScale=function(vec){this._00=vec.x;this._11=vec.y;this._22=vec.z;};x3dom.fields.SFMatrix4f.prototype.setRotate=function(quat){var xx=quat.x*quat.x;var xy=quat.x*quat.y;var xz=quat.x*quat.z;var yy=quat.y*quat.y;var yz=quat.y*quat.z;var zz=quat.z*quat.z;var wx=quat.w*quat.x;var wy=quat.w*quat.y;var wz=quat.w*quat.z;this._00=1-2*(yy+zz);this._01=2*(xy-wz);this._02=2*(xz+wy);this._10=2*(xy+wz);this._11=1-2*(xx+zz);this._12=2*(yz-wx);this._20=2*(xz-wy);this._21=2*(yz+wx);this._22=1-2*(xx+yy);};x3dom.fields.SFMatrix4f.parseRotation=function(str){var m=/^([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)$/.exec(str);var x=+m[1],y=+m[2],z=+m[3],a=+m[4];var d=Math.sqrt(x*x+y*y+z*z);if(d===0){x=1;y=z=0;}else{x/=d;y/=d;z/=d;}\nvar c=Math.cos(a);var s=Math.sin(a);var t=1-c;return new x3dom.fields.SFMatrix4f(t*x*x+c,t*x*y+s*z,t*x*z-s*y,0,t*x*y-s*z,t*y*y+c,t*y*z+s*x,0,t*x*z+s*y,t*y*z-s*x,t*z*z+c,0,0,0,0,1).transpose();};x3dom.fields.SFMatrix4f.parse=function(str){var needTranspose=false;var val=/matrix.*\\((.+)\\)/;if(val.exec(str)){str=RegExp.$1;needTranspose=true;}\nvar arr=Array.map(str.split(/[,\\s]+/),function(n){return+n;});if(arr.length>=16){if(!needTranspose){return new x3dom.fields.SFMatrix4f(arr[0],arr[1],arr[2],arr[3],arr[4],arr[5],arr[6],arr[7],arr[8],arr[9],arr[10],arr[11],arr[12],arr[13],arr[14],arr[15]);}else{return new x3dom.fields.SFMatrix4f(arr[0],arr[4],arr[8],arr[12],arr[1],arr[5],arr[9],arr[13],arr[2],arr[6],arr[10],arr[14],arr[3],arr[7],arr[11],arr[15]);}}else if(arr.length===6){return new x3dom.fields.SFMatrix4f(arr[0],arr[1],0,arr[4],arr[2],arr[3],0,arr[5],0,0,1,0,0,0,0,1);}else{x3dom.debug.logWarning(\"SFMatrix4f - can't parse string: \"+str);return x3dom.fields.SFMatrix4f.identity();}};x3dom.fields.SFMatrix4f.prototype.mult=function(that){return new x3dom.fields.SFMatrix4f(this._00*that._00+this._01*that._10+this._02*that._20+this._03*that._30,this._00*that._01+this._01*that._11+this._02*that._21+this._03*that._31,this._00*that._02+this._01*that._12+this._02*that._22+this._03*that._32,this._00*that._03+this._01*that._13+this._02*that._23+this._03*that._33,this._10*that._00+this._11*that._10+this._12*that._20+this._13*that._30,this._10*that._01+this._11*that._11+this._12*that._21+this._13*that._31,this._10*that._02+this._11*that._12+this._12*that._22+this._13*that._32,this._10*that._03+this._11*that._13+this._12*that._23+this._13*that._33,this._20*that._00+this._21*that._10+this._22*that._20+this._23*that._30,this._20*that._01+this._21*that._11+this._22*that._21+this._23*that._31,this._20*that._02+this._21*that._12+this._22*that._22+this._23*that._32,this._20*that._03+this._21*that._13+this._22*that._23+this._23*that._33,this._30*that._00+this._31*that._10+this._32*that._20+this._33*that._30,this._30*that._01+this._31*that._11+this._32*that._21+this._33*that._31,this._30*that._02+this._31*that._12+this._32*that._22+this._33*that._32,this._30*that._03+this._31*that._13+this._32*that._23+this._33*that._33);};x3dom.fields.SFMatrix4f.prototype.multMatrixPnt=function(vec){return new x3dom.fields.SFVec3f(this._00*vec.x+this._01*vec.y+this._02*vec.z+this._03,this._10*vec.x+this._11*vec.y+this._12*vec.z+this._13,this._20*vec.x+this._21*vec.y+this._22*vec.z+this._23);};x3dom.fields.SFMatrix4f.prototype.multMatrixVec=function(vec){return new x3dom.fields.SFVec3f(this._00*vec.x+this._01*vec.y+this._02*vec.z,this._10*vec.x+this._11*vec.y+this._12*vec.z,this._20*vec.x+this._21*vec.y+this._22*vec.z);};x3dom.fields.SFMatrix4f.prototype.multFullMatrixPnt=function(vec){var w=this._30*vec.x+this._31*vec.y+this._32*vec.z+this._33;if(w){w=1.0/w;}\nreturn new x3dom.fields.SFVec3f((this._00*vec.x+this._01*vec.y+this._02*vec.z+this._03)*w,(this._10*vec.x+this._11*vec.y+this._12*vec.z+this._13)*w,(this._20*vec.x+this._21*vec.y+this._22*vec.z+this._23)*w);};x3dom.fields.SFMatrix4f.prototype.multMatrixPlane=function(plane){var normal=new x3dom.fields.SFVec3f(plane.x,plane.y,plane.z);var memberPnt=normal.multiply(-plane.w);memberPnt=this.multMatrixPnt(memberPnt);var invTranspose=this.inverse().transpose();normal=invTranspose.multMatrixVec(normal);var d=-normal.dot(memberPnt);return new x3dom.fields.SFVec4f(normal.x,normal.y,normal.z,d);};x3dom.fields.SFMatrix4f.prototype.transpose=function(){return new x3dom.fields.SFMatrix4f(this._00,this._10,this._20,this._30,this._01,this._11,this._21,this._31,this._02,this._12,this._22,this._32,this._03,this._13,this._23,this._33);};x3dom.fields.SFMatrix4f.prototype.negate=function(){return new x3dom.fields.SFMatrix4f(-this._00,-this._01,-this._02,-this._03,-this._10,-this._11,-this._12,-this._13,-this._20,-this._21,-this._22,-this._23,-this._30,-this._31,-this._32,-this._33);};x3dom.fields.SFMatrix4f.prototype.multiply=function(s){return new x3dom.fields.SFMatrix4f(s*this._00,s*this._01,s*this._02,s*this._03,s*this._10,s*this._11,s*this._12,s*this._13,s*this._20,s*this._21,s*this._22,s*this._23,s*this._30,s*this._31,s*this._32,s*this._33);};x3dom.fields.SFMatrix4f.prototype.add=function(that){return new x3dom.fields.SFMatrix4f(this._00+that._00,this._01+that._01,this._02+that._02,this._03+that._03,this._10+that._10,this._11+that._11,this._12+that._12,this._13+that._13,this._20+that._20,this._21+that._21,this._22+that._22,this._23+that._23,this._30+that._30,this._31+that._31,this._32+that._32,this._33+that._33);};x3dom.fields.SFMatrix4f.prototype.addScaled=function(that,s){return new x3dom.fields.SFMatrix4f(this._00+s*that._00,this._01+s*that._01,this._02+s*that._02,this._03+s*that._03,this._10+s*that._10,this._11+s*that._11,this._12+s*that._12,this._13+s*that._13,this._20+s*that._20,this._21+s*that._21,this._22+s*that._22,this._23+s*that._23,this._30+s*that._30,this._31+s*that._31,this._32+s*that._32,this._33+s*that._33);};x3dom.fields.SFMatrix4f.prototype.setValues=function(that){this._00=that._00;this._01=that._01;this._02=that._02;this._03=that._03;this._10=that._10;this._11=that._11;this._12=that._12;this._13=that._13;this._20=that._20;this._21=that._21;this._22=that._22;this._23=that._23;this._30=that._30;this._31=that._31;this._32=that._32;this._33=that._33;};x3dom.fields.SFMatrix4f.prototype.setValue=function(v1,v2,v3,v4){this._00=v1.x;this._01=v2.x;this._02=v3.x;this._10=v1.y;this._11=v2.y;this._12=v3.y;this._20=v1.z;this._21=v2.z;this._22=v3.z;this._30=0;this._31=0;this._32=0;if(arguments.length>3){this._03=v4.x;this._13=v4.y;this._23=v4.z;this._33=1;}};x3dom.fields.SFMatrix4f.prototype.setFromArray=function(a){this._00=a[0];this._01=a[4];this._02=a[8];this._03=a[12];this._10=a[1];this._11=a[5];this._12=a[9];this._13=a[13];this._20=a[2];this._21=a[6];this._22=a[10];this._23=a[14];this._30=a[3];this._31=a[7];this._32=a[11];this._33=a[15];return this;};x3dom.fields.SFMatrix4f.fromArray=function(a){var m=new x3dom.fields.SFMatrix4f();m._00=a[0];m._01=a[4];m._02=a[8];m._03=a[12];m._10=a[1];m._11=a[5];m._12=a[9];m._13=a[13];m._20=a[2];m._21=a[6];m._22=a[10];m._23=a[14];m._30=a[3];m._31=a[7];m._32=a[11];m._33=a[15];return m;};x3dom.fields.SFMatrix4f.prototype.fromRotationTranslationScale=function(rotation,translation,scale){translation=translation||new x3dom.fields.SFVec3f();rotation=rotation||new x3dom.fields.Quaternion();scale=scale||new x3dom.fields.SFVec3f(1,1,1);var x=rotation.x,y=rotation.y,z=rotation.z,w=rotation.w;var x2=x+x;var y2=y+y;var z2=z+z;var xx=x*x2;var xy=x*y2;var xz=x*z2;var yy=y*y2;var yz=y*z2;var zz=z*z2;var wx=w*x2;var wy=w*y2;var wz=w*z2;this._00=(1-(yy+zz))*scale.x;this._10=(xy+wz)*scale.x;this._20=(xz-wy)*scale.x;this._30=0;this._01=(xy-wz)*scale.y;this._11=(1-(xx+zz))*scale.y;this._21=(yz+wx)*scale.y;this._31=0;this._02=(xz+wy)*scale.z;this._12=(yz-wx)*scale.z;this._22=(1-(xx+yy))*scale.z;this._32=0;this._03=translation.x;this._13=translation.y;this._23=translation.z;this._33=1\nreturn this;};x3dom.fields.SFMatrix4f.fromRotationTranslationScale=function(rotation,translation,scale){translation=translation||new x3dom.fields.SFVec3f();rotation=rotation||new x3dom.fields.Quaternion();scale=scale||new x3dom.fields.SFVec3f(1,1,1);var m=new x3dom.fields.SFMatrix4f();var x=rotation.x,y=rotation.y,z=rotation.z,w=rotation.w;var x2=x+x;var y2=y+y;var z2=z+z;var xx=x*x2;var xy=x*y2;var xz=x*z2;var yy=y*y2;var yz=y*z2;var zz=z*z2;var wx=w*x2;var wy=w*y2;var wz=w*z2;m._00=(1-(yy+zz))*scale.x;m._10=(xy+wz)*scale.x;m._20=(xz-wy)*scale.x;m._30=0;m._01=(xy-wz)*scale.y;m._11=(1-(xx+zz))*scale.y;m._21=(yz+wx)*scale.y;m._31=0;m._02=(xz+wy)*scale.z;m._12=(yz-wx)*scale.z;m._22=(1-(xx+yy))*scale.z;m._32=0;m._03=translation.x;m._13=translation.y;m._23=translation.z;m._33=1\nreturn m;};x3dom.fields.SFMatrix4f.prototype.toGL=function(){return[this._00,this._10,this._20,this._30,this._01,this._11,this._21,this._31,this._02,this._12,this._22,this._32,this._03,this._13,this._23,this._33];};x3dom.fields.SFMatrix4f.fromGL=function(array){return[this._00,this._10,this._20,this._30,this._01,this._11,this._21,this._31,this._02,this._12,this._22,this._32,this._03,this._13,this._23,this._33];};x3dom.fields.SFMatrix4f.prototype.at=function(i,j){var field=\"_\"+i+j;return this[field];};x3dom.fields.SFMatrix4f.prototype.sqrt=function(){var Y=x3dom.fields.SFMatrix4f.identity();var result=x3dom.fields.SFMatrix4f.copy(this);for(var i=0;i<6;i++){var iX=result.inverse();var iY=(i==0)?x3dom.fields.SFMatrix4f.identity():Y.inverse();var rd=result.det(),yd=Y.det();var g=Math.abs(Math.pow(rd*yd,-0.125));var ig=1.0/g;result=result.multiply(g);result=result.addScaled(iY,ig);result=result.multiply(0.5);Y=Y.multiply(g);Y=Y.addScaled(iX,ig);Y=Y.multiply(0.5);}\nreturn result;};x3dom.fields.SFMatrix4f.prototype.normInfinity=function(){var t=0,m=0;if((t=Math.abs(this._00))>m){m=t;}\nif((t=Math.abs(this._01))>m){m=t;}\nif((t=Math.abs(this._02))>m){m=t;}\nif((t=Math.abs(this._03))>m){m=t;}\nif((t=Math.abs(this._10))>m){m=t;}\nif((t=Math.abs(this._11))>m){m=t;}\nif((t=Math.abs(this._12))>m){m=t;}\nif((t=Math.abs(this._13))>m){m=t;}\nif((t=Math.abs(this._20))>m){m=t;}\nif((t=Math.abs(this._21))>m){m=t;}\nif((t=Math.abs(this._22))>m){m=t;}\nif((t=Math.abs(this._23))>m){m=t;}\nif((t=Math.abs(this._30))>m){m=t;}\nif((t=Math.abs(this._31))>m){m=t;}\nif((t=Math.abs(this._32))>m){m=t;}\nif((t=Math.abs(this._33))>m){m=t;}\nreturn m;};x3dom.fields.SFMatrix4f.prototype.norm1_3x3=function(){var max=Math.abs(this._00)+\nMath.abs(this._10)+\nMath.abs(this._20);var t=0;if((t=Math.abs(this._01)+\nMath.abs(this._11)+\nMath.abs(this._21))>max){max=t;}\nif((t=Math.abs(this._02)+\nMath.abs(this._12)+\nMath.abs(this._22))>max){max=t;}\nreturn max;};x3dom.fields.SFMatrix4f.prototype.normInf_3x3=function(){var max=Math.abs(this._00)+\nMath.abs(this._01)+\nMath.abs(this._02);var t=0;if((t=Math.abs(this._10)+\nMath.abs(this._11)+\nMath.abs(this._12))>max){max=t;}\nif((t=Math.abs(this._20)+\nMath.abs(this._21)+\nMath.abs(this._22))>max){max=t;}\nreturn max;};x3dom.fields.SFMatrix4f.prototype.adjointT_3x3=function(){var result=x3dom.fields.SFMatrix4f.identity();result._00=this._11*this._22-this._12*this._21;result._01=this._12*this._20-this._10*this._22;result._02=this._10*this._21-this._11*this._20;result._10=this._21*this._02-this._22*this._01;result._11=this._22*this._00-this._20*this._02;result._12=this._20*this._01-this._21*this._00;result._20=this._01*this._12-this._02*this._11;result._21=this._02*this._10-this._00*this._12;result._22=this._00*this._11-this._01*this._10;return result;};x3dom.fields.SFMatrix4f.prototype.equals=function(that){var eps=0.000000000001;return Math.abs(this._00-that._00)<eps&&Math.abs(this._01-that._01)<eps&&Math.abs(this._02-that._02)<eps&&Math.abs(this._03-that._03)<eps&&Math.abs(this._10-that._10)<eps&&Math.abs(this._11-that._11)<eps&&Math.abs(this._12-that._12)<eps&&Math.abs(this._13-that._13)<eps&&Math.abs(this._20-that._20)<eps&&Math.abs(this._21-that._21)<eps&&Math.abs(this._22-that._22)<eps&&Math.abs(this._23-that._23)<eps&&Math.abs(this._30-that._30)<eps&&Math.abs(this._31-that._31)<eps&&Math.abs(this._32-that._32)<eps&&Math.abs(this._33-that._33)<eps;};x3dom.fields.SFMatrix4f.prototype.getTransform=function(translation,rotation,scaleFactor,scaleOrientation,center){var m=null;if(arguments.length>4){m=x3dom.fields.SFMatrix4f.translation(center.negate());m=m.mult(this);var c=x3dom.fields.SFMatrix4f.translation(center);m=m.mult(c);}else{m=x3dom.fields.SFMatrix4f.copy(this);}\nvar flip=m.decompose(translation,rotation,scaleFactor,scaleOrientation);scaleFactor.setValues(scaleFactor.multiply(flip));};x3dom.fields.SFMatrix4f.prototype.decompose=function(t,r,s,so){var A=x3dom.fields.SFMatrix4f.copy(this);var Q=x3dom.fields.SFMatrix4f.identity(),S=x3dom.fields.SFMatrix4f.identity(),SO=x3dom.fields.SFMatrix4f.identity();t.x=A._03;t.y=A._13;t.z=A._23;A._03=0.0;A._13=0.0;A._23=0.0;A._30=0.0;A._31=0.0;A._32=0.0;var det=A.polarDecompose(Q,S);var f=1.0;if(det<0.0){Q=Q.negate();f=-1.0;}\nr.setValue(Q);S.spectralDecompose(SO,s);so.setValue(SO);return f;};x3dom.fields.SFMatrix4f.prototype.polarDecompose=function(Q,S){var TOL=0.000000000001;var Mk=this.transpose();var Ek=x3dom.fields.SFMatrix4f.identity();var Mk_one=Mk.norm1_3x3();var Mk_inf=Mk.normInf_3x3();var MkAdjT;var MkAdjT_one,MkAdjT_inf;var Ek_one,Mk_det;do{MkAdjT=Mk.adjointT_3x3();Mk_det=Mk._00*MkAdjT._00+\nMk._01*MkAdjT._01+\nMk._02*MkAdjT._02;if(Mk_det==0.0){x3dom.debug.logWarning(\"polarDecompose: Mk_det == 0.0\");break;}\nMkAdjT_one=MkAdjT.norm1_3x3();MkAdjT_inf=MkAdjT.normInf_3x3();var gamma=Math.sqrt(Math.sqrt((MkAdjT_one*MkAdjT_inf)/(Mk_one*Mk_inf))/Math.abs(Mk_det));var g1=0.5*gamma;var g2=0.5/(gamma*Mk_det);Ek.setValues(Mk);Mk=Mk.multiply(g1);Mk=Mk.addScaled(MkAdjT,g2);Ek=Ek.addScaled(Mk,-1.0);Ek_one=Ek.norm1_3x3();Mk_one=Mk.norm1_3x3();Mk_inf=Mk.normInf_3x3();}while(Ek_one>(Mk_one*TOL));Q.setValues(Mk.transpose());S.setValues(Mk.mult(this));for(var i=0;i<3;++i){for(var j=i;j<3;++j){S['_'+j+i]=0.5*(S['_'+j+i]+S['_'+i+j]);S['_'+i+j]=0.5*(S['_'+j+i]+S['_'+i+j]);}}\nreturn Mk_det;};x3dom.fields.SFMatrix4f.prototype.spectralDecompose=function(SO,k){var next=[1,2,0];var maxIterations=20;var diag=[this._00,this._11,this._22];var offDiag=[this._12,this._20,this._01];for(var iter=0;iter<maxIterations;++iter){var sm=Math.abs(offDiag[0])+Math.abs(offDiag[1])+Math.abs(offDiag[2]);if(sm==0){break;}\nfor(var i=2;i>=0;--i){var p=next[i];var q=next[p];var absOffDiag=Math.abs(offDiag[i]);var g=100.0*absOffDiag;if(absOffDiag>0.0){var t=0,h=diag[q]-diag[p];var absh=Math.abs(h);if(absh+g==absh){t=offDiag[i]/h;}else{var theta=0.5*h/offDiag[i];t=1.0/(Math.abs(theta)+Math.sqrt(theta*theta+1.0));t=theta<0.0?-t:t;}\nvar c=1.0/Math.sqrt(t*t+1.0);var s=t*c;var tau=s/(c+1.0);var ta=t*offDiag[i];offDiag[i]=0.0;diag[p]-=ta;diag[q]+=ta;var offDiagq=offDiag[q];offDiag[q]-=s*(offDiag[p]+tau*offDiagq);offDiag[p]+=s*(offDiagq-tau*offDiag[p]);for(var j=2;j>=0;--j){var a=SO['_'+j+p];var b=SO['_'+j+q];SO['_'+j+p]-=s*(b+tau*a);SO['_'+j+q]+=s*(a-tau*b);}}}}\nk.x=diag[0];k.y=diag[1];k.z=diag[2];};x3dom.fields.SFMatrix4f.prototype.log=function(){var maxiter=12;var eps=1e-12;var A=x3dom.fields.SFMatrix4f.copy(this),Z=x3dom.fields.SFMatrix4f.copy(this);Z._00-=1;Z._11-=1;Z._22-=1;Z._33-=1;var k=0;while(Z.normInfinity()>0.5){A=A.sqrt();Z.setValues(A);Z._00-=1;Z._11-=1;Z._22-=1;Z._33-=1;k++;}\nA._00-=1;A._11-=1;A._22-=1;A._33-=1;A=A.negate();Z.setValues(A);var result=x3dom.fields.SFMatrix4f.copy(A);var i=1;while(Z.normInfinity()>eps&&i<maxiter){Z=Z.mult(A);i++;result=result.addScaled(Z,1.0/i);}\nreturn result.multiply(-(1<<k));};x3dom.fields.SFMatrix4f.prototype.exp=function(){var q=6;var A=x3dom.fields.SFMatrix4f.copy(this),D=x3dom.fields.SFMatrix4f.identity(),N=x3dom.fields.SFMatrix4f.identity(),result=x3dom.fields.SFMatrix4f.identity();var k=0,c=1.0;var j=1.0+parseInt(Math.log(A.normInfinity()/0.693));if(j<0){j=0;}\nA=A.multiply(1.0/(1<<j));for(k=1;k<=q;k++){c*=(q-k+1)/(k*(2*q-k+1));result=A.mult(result);N=N.addScaled(result,c);if(k%2){D=D.addScaled(result,-c);}else{D=D.addScaled(result,c);}}\nresult=D.inverse().mult(N);for(k=0;k<j;k++){result=result.mult(result);}\nreturn result;};x3dom.fields.SFMatrix4f.prototype.det3=function(a1,a2,a3,b1,b2,b3,c1,c2,c3){return((a1*b2*c3)+(a2*b3*c1)+(a3*b1*c2)-\n(a1*b3*c2)-(a2*b1*c3)-(a3*b2*c1));};x3dom.fields.SFMatrix4f.prototype.det=function(){var a1=this._00;var b1=this._10;var c1=this._20;var d1=this._30;var a2=this._01;var b2=this._11;var c2=this._21;var d2=this._31;var a3=this._02;var b3=this._12;var c3=this._22;var d3=this._32;var a4=this._03;var b4=this._13;var c4=this._23;var d4=this._33;return(a1*this.det3(b2,b3,b4,c2,c3,c4,d2,d3,d4)-\nb1*this.det3(a2,a3,a4,c2,c3,c4,d2,d3,d4)+\nc1*this.det3(a2,a3,a4,b2,b3,b4,d2,d3,d4)-\nd1*this.det3(a2,a3,a4,b2,b3,b4,c2,c3,c4));};x3dom.fields.SFMatrix4f.prototype.inverse=function(){var a1=this._00;var b1=this._10;var c1=this._20;var d1=this._30;var a2=this._01;var b2=this._11;var c2=this._21;var d2=this._31;var a3=this._02;var b3=this._12;var c3=this._22;var d3=this._32;var a4=this._03;var b4=this._13;var c4=this._23;var d4=this._33;var rDet=this.det();if(rDet==0){x3dom.debug.logWarning(\"Invert matrix: singular matrix, no inverse!\");return x3dom.fields.SFMatrix4f.identity();}\nrDet=1.0/rDet;return new x3dom.fields.SFMatrix4f(+this.det3(b2,b3,b4,c2,c3,c4,d2,d3,d4)*rDet,-this.det3(a2,a3,a4,c2,c3,c4,d2,d3,d4)*rDet,+this.det3(a2,a3,a4,b2,b3,b4,d2,d3,d4)*rDet,-this.det3(a2,a3,a4,b2,b3,b4,c2,c3,c4)*rDet,-this.det3(b1,b3,b4,c1,c3,c4,d1,d3,d4)*rDet,+this.det3(a1,a3,a4,c1,c3,c4,d1,d3,d4)*rDet,-this.det3(a1,a3,a4,b1,b3,b4,d1,d3,d4)*rDet,+this.det3(a1,a3,a4,b1,b3,b4,c1,c3,c4)*rDet,+this.det3(b1,b2,b4,c1,c2,c4,d1,d2,d4)*rDet,-this.det3(a1,a2,a4,c1,c2,c4,d1,d2,d4)*rDet,+this.det3(a1,a2,a4,b1,b2,b4,d1,d2,d4)*rDet,-this.det3(a1,a2,a4,b1,b2,b4,c1,c2,c4)*rDet,-this.det3(b1,b2,b3,c1,c2,c3,d1,d2,d3)*rDet,+this.det3(a1,a2,a3,c1,c2,c3,d1,d2,d3)*rDet,-this.det3(a1,a2,a3,b1,b2,b3,d1,d2,d3)*rDet,+this.det3(a1,a2,a3,b1,b2,b3,c1,c2,c3)*rDet);};x3dom.fields.SFMatrix4f.prototype.getEulerAngles=function(){var theta_1,theta_2,theta;var phi_1,phi_2,phi;var psi_1,psi_2,psi;var cos_theta_1,cos_theta_2;if(Math.abs((Math.abs(this._20)-1.0))>0.0001){theta_1=-Math.asin(this._20);theta_2=Math.PI-theta_1;cos_theta_1=Math.cos(theta_1);cos_theta_2=Math.cos(theta_2);psi_1=Math.atan2(this._21/cos_theta_1,this._22/cos_theta_1);psi_2=Math.atan2(this._21/cos_theta_2,this._22/cos_theta_2);phi_1=Math.atan2(this._10/cos_theta_1,this._00/cos_theta_1);phi_2=Math.atan2(this._10/cos_theta_2,this._00/cos_theta_2);return[psi_1,theta_1,phi_1,psi_2,theta_2,phi_2];}else{phi=0;if(this._20==-1.0){theta=Math.PI/2.0;psi=phi+Math.atan2(this._01,this._02);}else{theta=-(Math.PI/2.0);psi=-phi+Math.atan2(-this._01,-this._02);}\nreturn[psi,theta,phi,psi,theta,phi];}};x3dom.fields.SFMatrix4f.prototype.toString=function(){return this._00.toFixed(6)+' '+this._10.toFixed(6)+' '+\nthis._20.toFixed(6)+' '+this._30.toFixed(6)+' '+\nthis._01.toFixed(6)+' '+this._11.toFixed(6)+' '+\nthis._21.toFixed(6)+' '+this._31.toFixed(6)+' '+\nthis._02.toFixed(6)+' '+this._12.toFixed(6)+' '+\nthis._22.toFixed(6)+' '+this._32.toFixed(6)+' '+\nthis._03.toFixed(6)+' '+this._13.toFixed(6)+' '+\nthis._23.toFixed(6)+' '+this._33.toFixed(6);};x3dom.fields.SFMatrix4f.prototype.setValueByStr=function(str){var needTranspose=false;var val=/matrix.*\\((.+)\\)/;if(val.exec(str)){str=RegExp.$1;needTranspose=true;}\nvar arr=Array.map(str.split(/[,\\s]+/),function(n){return+n;});if(arr.length>=16){if(!needTranspose){this._00=arr[0];this._01=arr[1];this._02=arr[2];this._03=arr[3];this._10=arr[4];this._11=arr[5];this._12=arr[6];this._13=arr[7];this._20=arr[8];this._21=arr[9];this._22=arr[10];this._23=arr[11];this._30=arr[12];this._31=arr[13];this._32=arr[14];this._33=arr[15];}else{this._00=arr[0];this._01=arr[4];this._02=arr[8];this._03=arr[12];this._10=arr[1];this._11=arr[5];this._12=arr[9];this._13=arr[13];this._20=arr[2];this._21=arr[6];this._22=arr[10];this._23=arr[14];this._30=arr[3];this._31=arr[7];this._32=arr[11];this._33=arr[15];}}else if(arr.length===6){this._00=arr[0];this._01=arr[1];this._02=0;this._03=arr[4];this._10=arr[2];this._11=arr[3];this._12=0;this._13=arr[5];this._20=0;this._21=0;this._22=1;this._23=0;this._30=0;this._31=0;this._32=0;this._33=1;}else{x3dom.debug.logWarning(\"SFMatrix4f - can't parse string: \"+str);}\nreturn this;};x3dom.fields.SFVec2f=function(x,y){if(arguments.length===0){this.x=0;this.y=0;}else{this.x=x;this.y=y;}};x3dom.fields.SFVec2f.copy=function(v){return new x3dom.fields.SFVec2f(v.x,v.y);};x3dom.fields.SFVec2f.parse=function(str){var m=/^\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*$/.exec(str);if(m===null)return new x3dom.fields.SFVec2f();return new x3dom.fields.SFVec2f(+m[1],+m[2]);};x3dom.fields.SFVec2f.prototype.copy=function(){return x3dom.fields.SFVec2f.copy(this);};x3dom.fields.SFVec2f.prototype.setValues=function(that){this.x=that.x;this.y=that.y;};x3dom.fields.SFVec2f.prototype.at=function(i){switch(i){case 0:return this.x;case 1:return this.y;default:return this.x;}};x3dom.fields.SFVec2f.prototype.add=function(that){return new x3dom.fields.SFVec2f(this.x+that.x,this.y+that.y);};x3dom.fields.SFVec2f.prototype.subtract=function(that){return new x3dom.fields.SFVec2f(this.x-that.x,this.y-that.y);};x3dom.fields.SFVec2f.prototype.negate=function(){return new x3dom.fields.SFVec2f(-this.x,-this.y);};x3dom.fields.SFVec2f.prototype.dot=function(that){return this.x*that.x+this.y*that.y;};x3dom.fields.SFVec2f.prototype.reflect=function(n){var d2=this.dot(n)*2;return new x3dom.fields.SFVec2f(this.x-d2*n.x,this.y-d2*n.y);};x3dom.fields.SFVec2f.prototype.normalize=function(){var n=this.length();if(n){n=1.0/n;}\nreturn new x3dom.fields.SFVec2f(this.x*n,this.y*n);};x3dom.fields.SFVec2f.prototype.multComponents=function(that){return new x3dom.fields.SFVec2f(this.x*that.x,this.y*that.y);};x3dom.fields.SFVec2f.prototype.multiply=function(n){return new x3dom.fields.SFVec2f(this.x*n,this.y*n);};x3dom.fields.SFVec2f.prototype.divideComponents=function(that){return new x3dom.fields.SFVec2f(this.x/that.x,this.y/that.y);};x3dom.fields.SFVec2f.prototype.divide=function(n){var denom=n?(1.0/n):1.0;return new x3dom.fields.SFVec2f(this.x*denom,this.y*denom);};x3dom.fields.SFVec2f.prototype.equals=function(that,eps){return Math.abs(this.x-that.x)<eps&&Math.abs(this.y-that.y)<eps;};x3dom.fields.SFVec2f.prototype.length=function(){return Math.sqrt((this.x*this.x)+(this.y*this.y));};x3dom.fields.SFVec2f.prototype.toGL=function(){return[this.x,this.y];};x3dom.fields.SFVec2f.prototype.toString=function(){return this.x+\" \"+this.y;};x3dom.fields.SFVec2f.prototype.setValueByStr=function(str){var m=/^\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*$/.exec(str);m=m||[0,0,0];this.x=+m[1];this.y=+m[2];return this;};x3dom.fields.SFVec3f=function(x,y,z){if(arguments.length===0){this.x=0;this.y=0;this.z=0;}else{this.x=x;this.y=y;this.z=z;}};x3dom.fields.SFVec3f.NullVector=new x3dom.fields.SFVec3f(0,0,0);x3dom.fields.SFVec3f.OneVector=new x3dom.fields.SFVec3f(1,1,1);x3dom.fields.SFVec3f.copy=function(v){return new x3dom.fields.SFVec3f(v.x,v.y,v.z);};x3dom.fields.SFVec3f.MIN=function(){return new x3dom.fields.SFVec3f(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);};x3dom.fields.SFVec3f.MAX=function(){return new x3dom.fields.SFVec3f(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE);};x3dom.fields.SFVec3f.parse=function(str){try{var m=/^\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*$/.exec(str);return new x3dom.fields.SFVec3f(+m[1],+m[2],+m[3]);}catch(e){var c=x3dom.fields.SFColor.colorParse(str);return new x3dom.fields.SFVec3f(c.r,c.g,c.b);}};x3dom.fields.SFVec3f.prototype.copy=function(){return x3dom.fields.SFVec3f.copy(this);};x3dom.fields.SFVec3f.prototype.fromArray=function(array){this.x=array[0];this.y=array[1];this.z=array[2];return this;};x3dom.fields.SFVec3f.fromArray=function(array){return new x3dom.fields.SFVec3f(array[0],array[1],array[2]);};x3dom.fields.SFVec3f.prototype.setValues=function(that){this.x=that.x;this.y=that.y;this.z=that.z;};x3dom.fields.SFVec3f.prototype.set=function(x,y,z){this.x=x;this.y=y;this.z=z;};x3dom.fields.SFVec3f.prototype.at=function(i){switch(i){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:return this.x;}};x3dom.fields.SFVec3f.prototype.add=function(that){return new x3dom.fields.SFVec3f(this.x+that.x,this.y+that.y,this.z+that.z);};x3dom.fields.SFVec3f.prototype.addScaled=function(that,s){return new x3dom.fields.SFVec3f(this.x+s*that.x,this.y+s*that.y,this.z+s*that.z);};x3dom.fields.SFVec3f.prototype.subtract=function(that){return new x3dom.fields.SFVec3f(this.x-that.x,this.y-that.y,this.z-that.z);};x3dom.fields.SFVec3f.prototype.subtractVectors=function(a,b){return new x3dom.fields.SFVec3f(a.x-b.x,a.y-b.y,a.z-b.z);};x3dom.fields.SFVec3f.prototype.negate=function(){return new x3dom.fields.SFVec3f(-this.x,-this.y,-this.z);};x3dom.fields.SFVec3f.prototype.dot=function(that){return(this.x*that.x+this.y*that.y+this.z*that.z);};x3dom.fields.SFVec3f.prototype.cross=function(that){return new x3dom.fields.SFVec3f(this.y*that.z-this.z*that.y,this.z*that.x-this.x*that.z,this.x*that.y-this.y*that.x);};x3dom.fields.SFVec3f.prototype.reflect=function(n){var d2=this.dot(n)*2;return new x3dom.fields.SFVec3f(this.x-d2*n.x,this.y-d2*n.y,this.z-d2*n.z);};x3dom.fields.SFVec3f.prototype.length=function(){return Math.sqrt((this.x*this.x)+(this.y*this.y)+(this.z*this.z));};x3dom.fields.SFVec3f.prototype.normalize=function(){var n=this.length();if(n){n=1.0/n;}\nreturn new x3dom.fields.SFVec3f(this.x*n,this.y*n,this.z*n);};x3dom.fields.SFVec3f.prototype.multComponents=function(that){return new x3dom.fields.SFVec3f(this.x*that.x,this.y*that.y,this.z*that.z);};x3dom.fields.SFVec3f.prototype.multiply=function(n){return new x3dom.fields.SFVec3f(this.x*n,this.y*n,this.z*n);};x3dom.fields.SFVec3f.prototype.divide=function(n){var denom=n?(1.0/n):1.0;return new x3dom.fields.SFVec3f(this.x*denom,this.y*denom,this.z*denom);};x3dom.fields.SFVec3f.prototype.equals=function(that,eps){return Math.abs(this.x-that.x)<eps&&Math.abs(this.y-that.y)<eps&&Math.abs(this.z-that.z)<eps;};x3dom.fields.SFVec3f.prototype.toGL=function(){return[this.x,this.y,this.z];};x3dom.fields.SFVec3f.prototype.toString=function(){return this.x+\" \"+this.y+\" \"+this.z;};x3dom.fields.SFVec3f.prototype.setValueByStr=function(str){try{var m=/^\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*$/.exec(str);this.x=+m[1];this.y=+m[2];this.z=+m[3];}catch(e){var c=x3dom.fields.SFColor.colorParse(str);this.x=c.r;this.y=c.g;this.z=c.b;}\nreturn this;};x3dom.fields.SFVec4f=function(x,y,z,w){if(arguments.length===0){this.x=0;this.y=0;this.z=0;this.w=0;}else{this.x=x;this.y=y;this.z=z;this.w=w;}};x3dom.fields.SFVec4f.copy=function(v){return new x3dom.fields.SFVec4f(v.x,v.y,v.z,v.w);};x3dom.fields.SFVec4f.prototype.copy=function(){return x3dom.fields.SFVec4f(this);};x3dom.fields.SFVec4f.parse=function(str){var m=/^\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*$/.exec(str);if(m===null)return new x3dom.fields.SFVec4f();return new x3dom.fields.SFVec4f(+m[1],+m[2],+m[3],+m[4]);};x3dom.fields.SFVec4f.prototype.setValueByStr=function(str){var m=/^\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*$/.exec(str);m=m||[0,0,0,0,0];this.x=+m[1];this.y=+m[2];this.z=+m[3];this.w=+m[4];return this;};x3dom.fields.SFVec4f.prototype.toGL=function(){return[this.x,this.y,this.z,this.w];};x3dom.fields.SFVec4f.prototype.toString=function(){return this.x+\" \"+this.y+\" \"+this.z+\" \"+this.w;};x3dom.fields.Quaternion=function(x,y,z,w){if(arguments.length===0){this.x=0;this.y=0;this.z=0;this.w=1;}else{this.x=x;this.y=y;this.z=z;this.w=w;}};x3dom.fields.Quaternion.copy=function(v){return new x3dom.fields.Quaternion(v.x,v.y,v.z,v.w);};x3dom.fields.Quaternion.prototype.multiply=function(that){return new x3dom.fields.Quaternion(this.w*that.x+this.x*that.w+this.y*that.z-this.z*that.y,this.w*that.y+this.y*that.w+this.z*that.x-this.x*that.z,this.w*that.z+this.z*that.w+this.x*that.y-this.y*that.x,this.w*that.w-this.x*that.x-this.y*that.y-this.z*that.z);};x3dom.fields.Quaternion.prototype.fromArray=function(array){this.x=array[0];this.y=array[1];this.z=array[2];this.w=array[3];return this;};x3dom.fields.Quaternion.fromArray=function(array){return new x3dom.fields.Quaternion(array[0],array[1],array[2],array[3]);};x3dom.fields.Quaternion.parseAxisAngle=function(str){var m=/^\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*$/.exec(str);if(m===null)return new x3dom.fields.Quaternion();return x3dom.fields.Quaternion.axisAngle(new x3dom.fields.SFVec3f(+m[1],+m[2],+m[3]),+m[4]);};x3dom.fields.Quaternion.axisAngle=function(axis,a){var t=axis.length();if(t>x3dom.fields.Eps){var s=Math.sin(a/2)/t;var c=Math.cos(a/2);return new x3dom.fields.Quaternion(axis.x*s,axis.y*s,axis.z*s,c);}else{return new x3dom.fields.Quaternion(0,0,0,1);}};x3dom.fields.Quaternion.prototype.copy=function(){return x3dom.fields.Quaternion.copy(this);};x3dom.fields.Quaternion.prototype.toMatrix=function(){var xx=this.x*this.x;var xy=this.x*this.y;var xz=this.x*this.z;var yy=this.y*this.y;var yz=this.y*this.z;var zz=this.z*this.z;var wx=this.w*this.x;var wy=this.w*this.y;var wz=this.w*this.z;return new x3dom.fields.SFMatrix4f(1-2*(yy+zz),2*(xy-wz),2*(xz+wy),0,2*(xy+wz),1-2*(xx+zz),2*(yz-wx),0,2*(xz-wy),2*(yz+wx),1-2*(xx+yy),0,0,0,0,1);};x3dom.fields.Quaternion.prototype.toAxisAngle=function(){var x=0,y=0,z=0;var s=0,a=0;if(this.w>1){this.normalize();}\na=2*Math.acos(this.w);s=Math.sqrt(1-this.w*this.w);if(s==0){x=this.x;y=this.y;z=this.z;}else{x=this.x/s;y=this.y/s;z=this.z/s;}\nreturn[new x3dom.fields.SFVec3f(x,y,z),a];};x3dom.fields.Quaternion.prototype.angle=function(){return 2*Math.acos(this.w);};x3dom.fields.Quaternion.prototype.setValue=function(matrix){var tr,s=1;var qt=[0,0,0];var i=0,j=0,k=0;var nxt=[1,2,0];tr=matrix._00+matrix._11+matrix._22;if(tr>0.0){s=Math.sqrt(tr+1.0);this.w=s*0.5;s=0.5/s;this.x=(matrix._21-matrix._12)*s;this.y=(matrix._02-matrix._20)*s;this.z=(matrix._10-matrix._01)*s;}else{if(matrix._11>matrix._00){i=1;}else{i=0;}\nif(matrix._22>matrix.at(i,i)){i=2;}\nj=nxt[i];k=nxt[j];s=Math.sqrt(matrix.at(i,i)-(matrix.at(j,j)+matrix.at(k,k))+1.0);qt[i]=s*0.5;s=0.5/s;this.w=(matrix.at(k,j)-matrix.at(j,k))*s;qt[j]=(matrix.at(j,i)+matrix.at(i,j))*s;qt[k]=(matrix.at(k,i)+matrix.at(i,k))*s;this.x=qt[0];this.y=qt[1];this.z=qt[2];}\nif(this.w>1.0||this.w<-1.0){var errThreshold=1+(x3dom.fields.Eps*100);if(this.w>errThreshold||this.w<-errThreshold){x3dom.debug.logInfo(\"MatToQuat: BUG: |quat[4]| (\"+this.w+\") >> 1.0 !\");}\nif(this.w>1.0){this.w=1.0;}else{this.w=-1.0;}}};x3dom.fields.Quaternion.prototype.setFromEuler=function(alpha,beta,gamma){var sx=Math.sin(alpha*0.5);var cx=Math.cos(alpha*0.5);var sy=Math.sin(beta*0.5);var cy=Math.cos(beta*0.5);var sz=Math.sin(gamma*0.5);var cz=Math.cos(gamma*0.5);this.x=(sx*cy*cz)-(cx*sy*sz);this.y=(cx*sy*cz)+(sx*cy*sz);this.z=(cx*cy*sz)-(sx*sy*cz);this.w=(cx*cy*cz)+(sx*sy*sz);};x3dom.fields.Quaternion.prototype.dot=function(that){return this.x*that.x+this.y*that.y+this.z*that.z+this.w*that.w;};x3dom.fields.Quaternion.prototype.add=function(that){return new x3dom.fields.Quaternion(this.x+that.x,this.y+that.y,this.z+that.z,this.w+that.w);};x3dom.fields.Quaternion.prototype.subtract=function(that){return new x3dom.fields.Quaternion(this.x-that.x,this.y-that.y,this.z-that.z,this.w-that.w);};x3dom.fields.Quaternion.prototype.setValues=function(that){this.x=that.x;this.y=that.y;this.z=that.z;this.w=that.w;};x3dom.fields.Quaternion.prototype.equals=function(that,eps){return(this.dot(that)>=1.0-eps);};x3dom.fields.Quaternion.prototype.multScalar=function(s){return new x3dom.fields.Quaternion(this.x*s,this.y*s,this.z*s,this.w*s);};x3dom.fields.Quaternion.prototype.normalize=function(){var d2=this.dot(this);var id=1.0;if(d2){id=1.0/Math.sqrt(d2);}\nthis.x*=id;this.y*=id;this.z*=id;this.w*=id;return this;};x3dom.fields.Quaternion.normalize=function(that){var d2=that.dot(that);var id=1.0;if(d2){id=1.0/Math.sqrt(d2);}\nthat.x*=id;that.y*=id;that.z*=id;that.w*=id;return that;};x3dom.fields.Quaternion.prototype.negate=function(){return new x3dom.fields.Quaternion(-this.x,-this.y,-this.z,-this.w);};x3dom.fields.Quaternion.prototype.inverse=function(){return new x3dom.fields.Quaternion(-this.x,-this.y,-this.z,this.w);};x3dom.fields.Quaternion.prototype.slerp=function(that,t){var cosom=this.dot(that);var rot1;if(cosom<0.0){cosom=-cosom;rot1=that.negate();}else{rot1=new x3dom.fields.Quaternion(that.x,that.y,that.z,that.w);}\nvar scalerot0,scalerot1;if((1.0-cosom)>0.00001){var omega=Math.acos(cosom);var sinom=Math.sin(omega);scalerot0=Math.sin((1.0-t)*omega)/sinom;scalerot1=Math.sin(t*omega)/sinom;}else{scalerot0=1.0-t;scalerot1=t;}\nreturn this.multScalar(scalerot0).add(rot1.multScalar(scalerot1));};x3dom.fields.Quaternion.rotateFromTo=function(fromVec,toVec){var from=fromVec.normalize();var to=toVec.normalize();var cost=from.dot(to);if(cost>0.99999){return new x3dom.fields.Quaternion(0,0,0,1);}else if(cost<-0.99999){var cAxis=new x3dom.fields.SFVec3f(1,0,0);var tmp=from.cross(cAxis);if(tmp.length()<0.00001){cAxis.x=0;cAxis.y=1;cAxis.z=0;tmp=from.cross(cAxis);}\ntmp=tmp.normalize();return x3dom.fields.Quaternion.axisAngle(tmp,Math.PI);}\nvar axis=fromVec.cross(toVec);axis=axis.normalize();var s=Math.sqrt(0.5*(1.0-cost));axis=axis.multiply(s);s=Math.sqrt(0.5*(1.0+cost));return new x3dom.fields.Quaternion(axis.x,axis.y,axis.z,s);};x3dom.fields.Quaternion.prototype.toGL=function(){var val=this.toAxisAngle();return[val[0].x,val[0].y,val[0].z,val[1]];};x3dom.fields.Quaternion.prototype.toString=function(){return this.x+\" \"+this.y+\" \"+this.z+\", \"+this.w;};x3dom.fields.Quaternion.prototype.setValueByStr=function(str){var m=/^\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*$/.exec(str);m=m||[0,1,0,0,0];var quat=x3dom.fields.Quaternion.axisAngle(new x3dom.fields.SFVec3f(+m[1],+m[2],+m[3]),+m[4]);this.x=quat.x;this.y=quat.y;this.z=quat.z;this.w=quat.w;return this;};function _colorParse(str){var red=0.0,green=0.0,blue=0.0;var alpha=1.0;var colorNames={aliceblue:'#f0f8ff',antiquewhite:'#faebd7',aqua:'#00ffff',aquamarine:'#7fffd4',azure:'#f0ffff',beige:'#f5f5dc',bisque:'#ffe4c4',black:'#000000',blanchedalmond:'#ffebcd',blue:'#0000ff',blueviolet:'#8a2be2',brown:'#a52a2a',burlywood:'#deb887',cadetblue:'#5f9ea0',chartreuse:'#7fff00',chocolate:'#d2691e',coral:'#ff7f50',cornflowerblue:'#6495ed',cornsilk:'#fff8dc',crimson:'#dc143c',cyan:'#00ffff',darkblue:'#00008b',darkcyan:'#008b8b',darkgoldenrod:'#b8860b',darkgray:'#a9a9a9',darkgreen:'#006400',darkkhaki:'#bdb76b',darkmagenta:'#8b008b',darkolivegreen:'#556b2f',darkorange:'#ff8c00',darkorchid:'#9932cc',darkred:'#8b0000',darksalmon:'#e9967a',darkseagreen:'#8fbc8f',darkslateblue:'#483d8b',darkslategray:'#2f4f4f',darkturquoise:'#00ced1',darkviolet:'#9400d3',deeppink:'#ff1493',deepskyblue:'#00bfff',dimgray:'#696969',dodgerblue:'#1e90ff',feldspar:'#d19275',firebrick:'#b22222',floralwhite:'#fffaf0',forestgreen:'#228b22',fuchsia:'#ff00ff',gainsboro:'#dcdcdc',ghostwhite:'#f8f8ff',gold:'#ffd700',goldenrod:'#daa520',gray:'#808080',green:'#008000',greenyellow:'#adff2f',honeydew:'#f0fff0',hotpink:'#ff69b4',indianred:'#cd5c5c',indigo:'#4b0082',ivory:'#fffff0',khaki:'#f0e68c',lavender:'#e6e6fa',lavenderblush:'#fff0f5',lawngreen:'#7cfc00',lemonchiffon:'#fffacd',lightblue:'#add8e6',lightcoral:'#f08080',lightcyan:'#e0ffff',lightgoldenrodyellow:'#fafad2',lightgrey:'#d3d3d3',lightgreen:'#90ee90',lightpink:'#ffb6c1',lightsalmon:'#ffa07a',lightseagreen:'#20b2aa',lightskyblue:'#87cefa',lightslateblue:'#8470ff',lightslategray:'#778899',lightsteelblue:'#b0c4de',lightyellow:'#ffffe0',lime:'#00ff00',limegreen:'#32cd32',linen:'#faf0e6',magenta:'#ff00ff',maroon:'#800000',mediumaquamarine:'#66cdaa',mediumblue:'#0000cd',mediumorchid:'#ba55d3',mediumpurple:'#9370d8',mediumseagreen:'#3cb371',mediumslateblue:'#7b68ee',mediumspringgreen:'#00fa9a',mediumturquoise:'#48d1cc',mediumvioletred:'#c71585',midnightblue:'#191970',mintcream:'#f5fffa',mistyrose:'#ffe4e1',moccasin:'#ffe4b5',navajowhite:'#ffdead',navy:'#000080',oldlace:'#fdf5e6',olive:'#808000',olivedrab:'#6b8e23',orange:'#ffa500',orangered:'#ff4500',orchid:'#da70d6',palegoldenrod:'#eee8aa',palegreen:'#98fb98',paleturquoise:'#afeeee',palevioletred:'#d87093',papayawhip:'#ffefd5',peachpuff:'#ffdab9',peru:'#cd853f',pink:'#ffc0cb',plum:'#dda0dd',powderblue:'#b0e0e6',purple:'#800080',red:'#ff0000',rosybrown:'#bc8f8f',royalblue:'#4169e1',saddlebrown:'#8b4513',salmon:'#fa8072',sandybrown:'#f4a460',seagreen:'#2e8b57',seashell:'#fff5ee',sienna:'#a0522d',silver:'#c0c0c0',skyblue:'#87ceeb',slateblue:'#6a5acd',slategray:'#708090',snow:'#fffafa',springgreen:'#00ff7f',steelblue:'#4682b4',tan:'#d2b48c',teal:'#008080',thistle:'#d8bfd8',tomato:'#ff6347',turquoise:'#40e0d0',violet:'#ee82ee',violetred:'#d02090',wheat:'#f5deb3',white:'#ffffff',whitesmoke:'#f5f5f5',yellow:'#ffff00',yellowgreen:'#9acd32'};var rgbMatch=/^rgb\\((\\d{1,3}),\\s{0,1}(\\d{1,3}),\\s{0,1}(\\d{1,3})\\)$/.exec(str);if(rgbMatch!==null){red=rgbMatch[1]/255.0;green=rgbMatch[2]/255.0;blue=rgbMatch[3]/255.0;}\nvar rgbaMatch=/^rgba\\((\\d{1,3}),\\s{0,1}(\\d{1,3}),\\s{0,1}(\\d{1,3}),(0+\\.?\\d*|1\\.?0*)\\)$/.exec(str);if(rgbaMatch!==null){red=rgbaMatch[1]/255.0;green=rgbaMatch[2]/255.0;blue=rgbaMatch[3]/255.0;alpha=+rgbaMatch[4];}\nif(colorNames[str]){str=colorNames[str];}\nif(str.substr&&str.substr(0,1)===\"#\"){var hex=str.substr(1);var len=hex.length;if(len===8){red=parseInt(\"0x\"+hex.substr(0,2),16)/255.0;green=parseInt(\"0x\"+hex.substr(2,2),16)/255.0;blue=parseInt(\"0x\"+hex.substr(4,2),16)/255.0;alpha=parseInt(\"0x\"+hex.substr(6,2),16)/255.0;}else if(len===6){red=parseInt(\"0x\"+hex.substr(0,2),16)/255.0;green=parseInt(\"0x\"+hex.substr(2,2),16)/255.0;blue=parseInt(\"0x\"+hex.substr(4,2),16)/255.0;}else if(len===4){red=parseInt(\"0x\"+hex.substr(0,1),16)/15.0;green=parseInt(\"0x\"+hex.substr(1,1),16)/15.0;blue=parseInt(\"0x\"+hex.substr(2,1),16)/15.0;alpha=parseInt(\"0x\"+hex.substr(3,1),16)/15.0;}else if(len===3){red=parseInt(\"0x\"+hex.substr(0,1),16)/15.0;green=parseInt(\"0x\"+hex.substr(1,1),16)/15.0;blue=parseInt(\"0x\"+hex.substr(2,1),16)/15.0;}}\nreturn{r:red,g:green,b:blue,a:alpha};}\nx3dom.fields.SFColor=function(r,g,b){if(arguments.length===0){this.r=0;this.g=0;this.b=0;}else{this.r=r;this.g=g;this.b=b;}};x3dom.fields.SFColor.parse=function(str){try{var m=/^\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*$/.exec(str);return new x3dom.fields.SFColor(+m[1],+m[2],+m[3]);}\ncatch(e){return x3dom.fields.SFColor.colorParse(str);}};x3dom.fields.SFColor.copy=function(that){return new x3dom.fields.SFColor(that.r,that.g,that.b);};x3dom.fields.SFColor.prototype.copy=function(){return x3dom.fields.SFColor.copy(this);};x3dom.fields.SFColor.prototype.setHSV=function(h,s,v){x3dom.debug.logWarning(\"SFColor.setHSV() NYI\");};x3dom.fields.SFColor.prototype.getHSV=function(){var h=0,s=0,v=0;x3dom.debug.logWarning(\"SFColor.getHSV() NYI\");return[h,s,v];};x3dom.fields.SFColor.prototype.setValues=function(color){this.r=color.r;this.g=color.g;this.b=color.b;};x3dom.fields.SFColor.prototype.equals=function(that,eps){return Math.abs(this.r-that.r)<eps&&Math.abs(this.g-that.g)<eps&&Math.abs(this.b-that.b)<eps;};x3dom.fields.SFColor.prototype.add=function(that){return new x3dom.fields.SFColor(this.r+that.r,this.g+that.g,this.b+that.b);};x3dom.fields.SFColor.prototype.subtract=function(that){return new x3dom.fields.SFColor(this.r-that.r,this.g-that.g,this.b-that.b);};x3dom.fields.SFColor.prototype.multiply=function(n){return new x3dom.fields.SFColor(this.r*n,this.g*n,this.b*n);};x3dom.fields.SFColor.prototype.toGL=function(){return[this.r,this.g,this.b];};x3dom.fields.SFColor.prototype.toString=function(){return this.r+\" \"+this.g+\" \"+this.b;};x3dom.fields.SFColor.prototype.setValueByStr=function(str){try{var m=/^\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*$/.exec(str);this.r=+m[1];this.g=+m[2];this.b=+m[3];}catch(e){var c=x3dom.fields.SFColor.colorParse(str);this.r=c.r;this.g=c.g;this.b=c.b;}\nreturn this;};x3dom.fields.SFColor.colorParse=function(color){var rgb=_colorParse(color);return new x3dom.fields.SFColor(rgb.r,rgb.g,rgb.b);};x3dom.fields.SFColorRGBA=function(r,g,b,a){if(arguments.length===0){this.r=0;this.g=0;this.b=0;this.a=1;}else{this.r=r;this.g=g;this.b=b;this.a=a;}};x3dom.fields.SFColorRGBA.parse=function(str){try{var m=/^([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)$/.exec(str);return new x3dom.fields.SFColorRGBA(+m[1],+m[2],+m[3],+m[4]);}\ncatch(e){return x3dom.fields.SFColorRGBA.colorParse(str);}};x3dom.fields.SFColorRGBA.copy=function(that){return new x3dom.fields.SFColorRGBA(that.r,that.g,that.b,that.a);};x3dom.fields.SFColorRGBA.prototype.copy=function(){return x3dom.fields.SFColorRGBA.copy(this);};x3dom.fields.SFColorRGBA.prototype.setValues=function(color){this.r=color.r;this.g=color.g;this.b=color.b;this.a=color.a;};x3dom.fields.SFColorRGBA.prototype.equals=function(that,eps){return Math.abs(this.r-that.r)<eps&&Math.abs(this.g-that.g)<eps&&Math.abs(this.b-that.b)<eps&&Math.abs(this.a-that.a)<eps;};x3dom.fields.SFColorRGBA.prototype.toGL=function(){return[this.r,this.g,this.b,this.a];};x3dom.fields.SFColorRGBA.prototype.toString=function(){return this.r+\" \"+this.g+\" \"+this.b+\" \"+this.a;};x3dom.fields.SFColorRGBA.prototype.setValueByStr=function(str){try{var m=/^([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)$/.exec(str);this.r=+m[1];this.g=+m[2];this.b=+m[3];this.a=+m[4];}catch(e){var c=x3dom.fields.SFColorRGBA.colorParse(str);this.r=c.r;this.g=c.g;this.b=c.b;this.a=c.a;}\nreturn this;};x3dom.fields.SFColorRGBA.prototype.toUint=function(){return((Math.round(this.r*255)<<24)|(Math.round(this.g*255)<<16)|(Math.round(this.b*255)<<8)|Math.round(this.a*255))>>>0;};x3dom.fields.SFColorRGBA.colorParse=function(color){var rgba=_colorParse(color);return new x3dom.fields.SFColorRGBA(rgba.r,rgba.g,rgba.b,rgba.a);};x3dom.fields.SFImage=function(w,h,c,arr){if(arguments.length===0||!(arr&&arr.map)){this.width=0;this.height=0;this.comp=0;this.array=[];}else{this.width=w;this.height=h;this.comp=c;var that=this.array;arr.map(function(v){that.push(v);},this.array);}};x3dom.fields.SFImage.parse=function(str){var img=new x3dom.fields.SFImage();img.setValueByStr(str);return img;};x3dom.fields.SFImage.copy=function(that){var destination=new x3dom.fields.SFImage();destination.width=that.width;destination.height=that.height;destination.comp=that.comp;destination.setPixels(that.getPixels());return destination;};x3dom.fields.SFImage.prototype.copy=function(){return x3dom.fields.SFImage.copy(this);};x3dom.fields.SFImage.prototype.setValueByStr=function(str){var mc=str.match(/(\\w+)/g);var n=mc.length;this.array=[];if(n>2){this.width=+mc[0];this.height=+mc[1];this.comp=+mc[2];}else{this.width=0;this.height=0;this.comp=0;return;}\nvar len,i;var r,g,b,a;var radix=10;for(i=3;i<n;i++){if(!mc[i].substr)continue;if(mc[i].substr(1,1).toLowerCase()===\"x\")radix=16;var inp=parseInt(mc[i],radix);if(this.comp===1){r=inp&255;this.array.push(r);}else if(this.comp===2){r=inp>>8&255;g=inp&255;this.array.push(r,g);}else if(this.comp===3){r=inp>>16&255;g=inp>>8&255;b=inp&255;this.array.push(r,g,b);}else if(this.comp===4){r=inp>>24&255;g=inp>>16&255;b=inp>>8&255;a=inp&255;this.array.push(r,g,b,a);}}};x3dom.fields.SFImage.prototype.setPixel=function(x,y,color){var startIdx=(y*this.width+x)*this.comp;if(this.comp===1&&startIdx<this.array.length){this.array[startIdx]=color.r*255;}else if(this.comp===2&&(startIdx+1)<this.array.length){this.array[startIdx]=color.r*255;this.array[startIdx+1]=color.g*255;}else if(this.comp===3&&(startIdx+2)<this.array.length){this.array[startIdx]=color.r*255;this.array[startIdx+1]=color.g*255;this.array[startIdx+2]=color.b*255;}else if(this.comp===4&&(startIdx+3)<this.array.length){this.array[startIdx]=color.r*255;this.array[startIdx+1]=color.g*255;this.array[startIdx+2]=color.b*255;this.array[startIdx+3]=color.a*255;}};x3dom.fields.SFImage.prototype.getPixel=function(x,y){var startIdx=(y*this.width+x)*this.comp;if(this.comp===1&&startIdx<this.array.length){return new x3dom.fields.SFColorRGBA(this.array[startIdx]/255,0,0,1);}else if(this.comp===2&&(startIdx+1)<this.array.length){return new x3dom.fields.SFColorRGBA(this.array[startIdx]/255,this.array[startIdx+1]/255,0,1);}else if(this.comp===3&&(startIdx+2)<this.array.length){return new x3dom.fields.SFColorRGBA(this.array[startIdx]/255,this.array[startIdx+1]/255,this.array[startIdx+2]/255,1);}else if(this.comp===4&&(startIdx+3)<this.array.length){return new x3dom.fields.SFColorRGBA(this.array[startIdx]/255,this.array[startIdx+1]/255,this.array[startIdx+2]/255,this.array[startIdx+3]/255);}};x3dom.fields.SFImage.prototype.setPixels=function(pixels){var i,idx=0;if(this.comp===1){for(i=0;i<pixels.length;i++){this.array[idx++]=pixels[i].r*255;}}else if(this.comp===2){for(i=0;i<pixels.length;i++){this.array[idx++]=pixels[i].r*255;this.array[idx++]=pixels[i].g*255;}}else if(this.comp===3){for(i=0;i<pixels.length;i++){this.array[idx++]=pixels[i].r*255;this.array[idx++]=pixels[i].g*255;this.array[idx++]=pixels[i].b*255;}}else if(this.comp===4){for(i=0;i<pixels.length;i++){this.array[idx++]=pixels[i].r*255;this.array[idx++]=pixels[i].g*255;this.array[idx++]=pixels[i].b*255;this.array[idx++]=pixels[i].a*255;}}};x3dom.fields.SFImage.prototype.getPixels=function(){var i;var pixels=[];if(this.comp===1){for(i=0;i<this.array.length;i+=this.comp){pixels.push(new x3dom.fields.SFColorRGBA(this.array[i]/255,0,0,1));}}else if(this.comp===2){for(i=0;i<this.array.length;i+=this.comp){pixels.push(new x3dom.fields.SFColorRGBA(this.array[i]/255,this.array[i+1]/255,0,1));}}else if(this.comp===3){for(i=0;i<this.array.length;i+=this.comp){pixels.push(new x3dom.fields.SFColorRGBA(this.array[i]/255,this.array[i+1]/255,this.array[i+2]/255,1));}}else if(this.comp===4){for(i=0;i<this.array.length;i+=this.comp){pixels.push(new x3dom.fields.SFColorRGBA(this.array[i]/255,this.array[i+1]/255,this.array[i+2]/255,this.array[i+3]/255));}}\nreturn pixels;};x3dom.fields.SFImage.prototype.toGL=function(){var a=[];Array.map(this.array,function(c){a.push(c);});return a;};x3dom.fields.MFColor=function(colorArray){if(colorArray){var that=this;colorArray.map(function(c){that.push(c);},this);}};x3dom.fields.MFColor.copy=function(colorArray){var destination=new x3dom.fields.MFColor();colorArray.map(function(v){destination.push(v.copy());},this);return destination;};x3dom.fields.MFColor.prototype=x3dom.extend([]);x3dom.fields.MFColor.parse=function(str){var mc=str.match(/([+\\-0-9eE\\.]+)/g);var colors=[];for(var i=0,n=mc?mc.length:0;i<n;i+=3){colors.push(new x3dom.fields.SFColor(+mc[i+0],+mc[i+1],+mc[i+2]));}\nreturn new x3dom.fields.MFColor(colors);};x3dom.fields.MFColor.prototype.copy=function(){return x3dom.fields.MFColor.copy(this);};x3dom.fields.MFColor.prototype.setValueByStr=function(str){this.length=0;var mc=str.match(/([+\\-0-9eE\\.]+)/g);for(var i=0,n=mc?mc.length:0;i<n;i+=3){this.push(new x3dom.fields.SFColor(+mc[i+0],+mc[i+1],+mc[i+2]));}};x3dom.fields.MFColor.prototype.toGL=function(){var a=[];Array.map(this,function(c){a.push(c.r);a.push(c.g);a.push(c.b);});return a;};x3dom.fields.MFColorRGBA=function(colorArray){if(colorArray){var that=this;colorArray.map(function(c){that.push(c);},this);}};x3dom.fields.MFColorRGBA.copy=function(colorArray){var destination=new x3dom.fields.MFColorRGBA();colorArray.map(function(v){destination.push(v.copy());},this);return destination;};x3dom.fields.MFColorRGBA.prototype=x3dom.extend([]);x3dom.fields.MFColorRGBA.parse=function(str){var mc=str.match(/([+\\-0-9eE\\.]+)/g);var colors=[];for(var i=0,n=mc?mc.length:0;i<n;i+=4){colors.push(new x3dom.fields.SFColorRGBA(+mc[i+0],+mc[i+1],+mc[i+2],+mc[i+3]));}\nreturn new x3dom.fields.MFColorRGBA(colors);};x3dom.fields.MFColorRGBA.prototype.copy=function(){return x3dom.fields.MFColorRGBA.copy(this);};x3dom.fields.MFColorRGBA.prototype.setValueByStr=function(str){this.length=0;var mc=str.match(/([+\\-0-9eE\\.]+)/g);for(var i=0,n=mc?mc.length:0;i<n;i+=4){this.push(new x3dom.fields.SFColorRGBA(+mc[i+0],+mc[i+1],+mc[i+2],+mc[i+3]));}};x3dom.fields.MFColorRGBA.prototype.toGL=function(){var a=[];Array.map(this,function(c){a.push(c.r);a.push(c.g);a.push(c.b);a.push(c.a);});return a;};x3dom.fields.MFRotation=function(rotArray){if(rotArray){var that=this;rotArray.map(function(v){that.push(v);},this);}};x3dom.fields.MFRotation.prototype=x3dom.extend([]);x3dom.fields.MFRotation.copy=function(rotationArray){var destination=new x3dom.fields.MFRotation();rotationArray.map(function(v){destination.push(v.copy());},this);return destination;};x3dom.fields.MFRotation.prototype.copy=function(){return x3dom.fields.MFRotation.copy(this);};x3dom.fields.MFRotation.parse=function(str){var mc=str.match(/([+\\-0-9eE\\.]+)/g);var vecs=[];for(var i=0,n=mc?mc.length:0;i<n;i+=4){vecs.push(x3dom.fields.Quaternion.axisAngle(new x3dom.fields.SFVec3f(+mc[i+0],+mc[i+1],+mc[i+2]),+mc[i+3]));}\nreturn new x3dom.fields.MFRotation(vecs);};x3dom.fields.MFRotation.prototype.setValueByStr=function(str){this.length=0;var mc=str.match(/([+\\-0-9eE\\.]+)/g);for(var i=0,n=mc?mc.length:0;i<n;i+=4){this.push(x3dom.fields.Quaternion.axisAngle(new x3dom.fields.SFVec3f(+mc[i+0],+mc[i+1],+mc[i+2]),+mc[i+3]));}};x3dom.fields.MFRotation.prototype.toGL=function(){var a=[];Array.map(this,function(c){var val=c.toAxisAngle();a.push(val[0].x);a.push(val[0].y);a.push(val[0].z);a.push(val[1]);});return a;};x3dom.fields.MFVec3f=function(vec3Array){if(vec3Array){var that=this;vec3Array.map(function(v){that.push(v);},this);}};x3dom.fields.MFVec3f.prototype=x3dom.extend(Array);x3dom.fields.MFVec3f.copy=function(vec3Array){var destination=new x3dom.fields.MFVec3f();vec3Array.map(function(v){destination.push(v.copy());},this);return destination;};x3dom.fields.MFVec3f.parse=function(str){var mc=str.match(/([+\\-0-9eE\\.]+)/g);var vecs=[];for(var i=0,n=mc?mc.length:0;i<n;i+=3){vecs.push(new x3dom.fields.SFVec3f(+mc[i+0],+mc[i+1],+mc[i+2]));}\nreturn new x3dom.fields.MFVec3f(vecs);};x3dom.fields.MFVec3f.prototype.copy=function(){return x3dom.fields.MFVec3f.copy(this);};x3dom.fields.MFVec3f.prototype.setValueByStr=function(str){this.length=0;var mc=str.match(/([+\\-0-9eE\\.]+)/g);for(var i=0,n=mc?mc.length:0;i<n;i+=3){this.push(new x3dom.fields.SFVec3f(+mc[i+0],+mc[i+1],+mc[i+2]));}};x3dom.fields.MFVec3f.prototype.setValues=function(vec3Array){var i,n=Math.min(vec3Array.length,this.length);for(i=0;i<n;i++){this[i].setValues(vec3Array[i])}};x3dom.fields.MFVec3f.prototype.toGL=function(){var a=[];Array.map(this,function(c){a.push(c.x);a.push(c.y);a.push(c.z);});return a;};x3dom.fields.MFVec3f.prototype.toString=function(){var str=\"\";this.forEach(function(sf){str=str+sf.toString()+\" \";});return str.trim();};x3dom.fields.MFVec2f=function(vec2Array){if(vec2Array){var that=this;vec2Array.map(function(v){that.push(v);},this);}};x3dom.fields.MFVec2f.prototype=x3dom.extend([]);x3dom.fields.MFVec2f.copy=function(vec2Array){var destination=new x3dom.fields.MFVec2f();vec2Array.map(function(v){destination.push(v.copy());},this);return destination;};x3dom.fields.MFVec2f.parse=function(str){var mc=str.match(/([+\\-0-9eE\\.]+)/g);var vecs=[];for(var i=0,n=mc?mc.length:0;i<n;i+=2){vecs.push(new x3dom.fields.SFVec2f(+mc[i+0],+mc[i+1]));}\nreturn new x3dom.fields.MFVec2f(vecs);};x3dom.fields.MFVec2f.prototype.copy=function(){return x3dom.fields.MFVec2f.copy(this);};x3dom.fields.MFVec2f.prototype.setValueByStr=function(str){this.length=0;var mc=str.match(/([+\\-0-9eE\\.]+)/g);for(var i=0,n=mc?mc.length:0;i<n;i+=2){this.push(new x3dom.fields.SFVec2f(+mc[i+0],+mc[i+1]));}};x3dom.fields.MFVec2f.prototype.toGL=function(){var a=[];Array.map(this,function(v){a.push(v.x);a.push(v.y);});return a;};x3dom.fields.MFInt32=function(array){if(array){var that=this;array.map(function(v){that.push(v);},this);}};x3dom.fields.MFInt32.prototype=x3dom.extend([]);x3dom.fields.MFInt32.copy=function(intArray){var destination=new x3dom.fields.MFInt32();intArray.map(function(v){destination.push(v);},this);return destination;};x3dom.fields.MFInt32.parse=function(str){var mc=str.match(/([+\\-]?\\d+\\s*){1},?\\s*/g);var vals=[];for(var i=0,n=mc?mc.length:0;i<n;++i){vals.push(parseInt(mc[i],10));}\nreturn new x3dom.fields.MFInt32(vals);};x3dom.fields.MFInt32.prototype.copy=function(){return x3dom.fields.MFInt32.copy(this);};x3dom.fields.MFInt32.prototype.setValueByStr=function(str){this.length=0;var mc=str.match(/([+\\-]?\\d+\\s*){1},?\\s*/g);for(var i=0,n=mc?mc.length:0;i<n;++i){this.push(parseInt(mc[i],10));}};x3dom.fields.MFInt32.prototype.toGL=function(){var a=[];Array.map(this,function(v){a.push(v);});return a;};x3dom.fields.MFFloat=function(array){if(array){var that=this;array.map(function(v){that.push(v);},this);}};x3dom.fields.MFFloat.prototype=x3dom.extend([]);x3dom.fields.MFFloat.copy=function(floatArray){var destination=new x3dom.fields.MFFloat();floatArray.map(function(v){destination.push(v);},this);return destination;};x3dom.fields.MFFloat.parse=function(str){var mc=str.match(/([+\\-0-9eE\\.]+)/g);var vals=[];for(var i=0,n=mc?mc.length:0;i<n;i++){vals.push(+mc[i]);}\nreturn new x3dom.fields.MFFloat(vals);};x3dom.fields.MFFloat.prototype.copy=function(){return x3dom.fields.MFFloat.copy(this);};x3dom.fields.MFFloat.prototype.setValueByStr=function(str){this.length=0;var mc=str.match(/([+\\-0-9eE\\.]+)/g);for(var i=0,n=mc?mc.length:0;i<n;i++){this.push(+mc[i]);}};x3dom.fields.MFFloat.prototype.toGL=function(){var a=[];Array.map(this,function(v){a.push(v);});return a;};x3dom.fields.MFBoolean=function(array){if(array){var that=this;array.map(function(v){that.push(v);},this);}};x3dom.fields.MFBoolean.prototype=x3dom.extend([]);x3dom.fields.MFBoolean.copy=function(boolArray){var destination=new x3dom.fields.MFBoolean();boolArray.map(function(v){destination.push(v);},this);return destination;};x3dom.fields.MFBoolean.parse=function(str){var mc=str.match(/(true|false|1|0)/ig);var vals=[];for(var i=0,n=mc?mc.length:0;i<n;i++){vals.push((mc[i]=='1'||mc[i].toLowerCase()=='true'));}\nreturn new x3dom.fields.MFBoolean(vals);};x3dom.fields.MFBoolean.prototype.copy=function(){return x3dom.fields.MFBoolean.copy(this);};x3dom.fields.MFBoolean.prototype.setValueByStr=function(str){this.length=0;var mc=str.match(/(true|false|1|0)/ig);for(var i=0,n=mc?mc.length:0;i<n;i++){this.push((mc[i]=='1'||mc[i].toLowerCase()=='true'));}};x3dom.fields.MFBoolean.prototype.toGL=function(){var a=[];Array.map(this,function(v){a.push(v?1:0);});return a;};x3dom.fields.MFString=function(strArray){if(strArray&&strArray.map){var that=this;strArray.map(function(v){that.push(v);},this);}};x3dom.fields.MFString.prototype=x3dom.extend([]);x3dom.fields.MFString.copy=function(stringArray){var destination=new x3dom.fields.MFString();stringArray.map(function(v){destination.push(v);},this);return destination;};x3dom.fields.MFString.parse=function(str){var arr=[];str=str.trim();if(str.length&&str[0]=='\"'){var m,re=/\"((?:[^\\\\\"]|\\\\\\\\|\\\\\")*)\"/g;while((m=re.exec(str))){var s=m[1].replace(/\\\\([\\\\\"])/g,\"$1\");if(s!==undefined){arr.push(s);}}}else{arr.push(str);}\nreturn new x3dom.fields.MFString(arr);};x3dom.fields.MFString.prototype.copy=function(){return x3dom.fields.MFString.copy(this);};x3dom.fields.MFString.prototype.setValueByStr=function(str){this.length=0;if(str.length&&str[0]=='\"'){var m,re=/\"((?:[^\\\\\"]|\\\\\\\\|\\\\\")*)\"/g;while((m=re.exec(str))){var s=m[1].replace(/\\\\([\\\\\"])/,\"$1\");if(s!==undefined){this.push(s);}}}else{this.push(str);}\nreturn this;};x3dom.fields.MFString.prototype.toString=function(){var str=\"\";for(var i=0,n=this.length;i<n;i++){str=str+this[i]+\" \";}\nreturn str;};x3dom.fields.SFNode=function(type){this.type=type;this.node=null;};x3dom.fields.SFNode.prototype.hasLink=function(node){return(node?(this.node===node):this.node);};x3dom.fields.SFNode.prototype.addLink=function(node){this.node=node;return true;};x3dom.fields.SFNode.prototype.rmLink=function(node){if(this.node===node){this.node=null;return true;}else{return false;}};x3dom.fields.MFNode=function(type){this.type=type;this.nodes=[];};x3dom.fields.MFNode.prototype.hasLink=function(node){if(node){for(var i=0,n=this.nodes.length;i<n;i++){if(this.nodes[i]===node){return true;}}}else{return(this.length>0);}\nreturn false;};x3dom.fields.MFNode.prototype.addLink=function(node){this.nodes.push(node);return true;};x3dom.fields.MFNode.prototype.rmLink=function(node){for(var i=0,n=this.nodes.length;i<n;i++){if(this.nodes[i]===node){this.nodes.splice(i,1);return true;}}\nreturn false;};x3dom.fields.MFNode.prototype.length=function(){return this.nodes.length;};x3dom.fields.Line=function(pos,dir){if(arguments.length===0){this.pos=new x3dom.fields.SFVec3f(0,0,0);this.dir=new x3dom.fields.SFVec3f(0,0,1);}\nthis.pos=x3dom.fields.SFVec3f.copy(pos);this.dir=x3dom.fields.SFVec3f.copy(dir);};x3dom.fields.Line.prototype.closestPoint=function(p){var distVec=p.subtract(this.pos);var projDist=distVec.dot(this.dir);return this.pos.add(this.dir.multiply(projDist));};x3dom.fields.Line.prototype.shortestDistance=function(p){var distVec=p.subtract(this.pos);var projDist=distVec.dot(this.dir);return distVec.subtract(this.dir.multiply(projDist)).length();};x3dom.fields.Ray=function(pos,dir){if(arguments.length===0){this.pos=new x3dom.fields.SFVec3f(0,0,0);this.dir=new x3dom.fields.SFVec3f(0,0,1);}else{this.pos=new x3dom.fields.SFVec3f(pos.x,pos.y,pos.z);var n=dir.length();if(n){n=1.0/n;}\nthis.dir=new x3dom.fields.SFVec3f(dir.x*n,dir.y*n,dir.z*n);}\nthis.enter=0;this.exit=0;this.hitObject=null;this.hitPoint={};this.dist=Number.MAX_VALUE;};x3dom.fields.Ray.prototype.toString=function(){return'Ray: ['+this.pos.toString()+'; '+this.dir.toString()+']';};x3dom.fields.Ray.prototype.intersectPlane=function(p,n){var result=null;var alpha;var nDotDir=n.dot(this.dir);if(nDotDir<0.0){alpha=(p.dot(n)-this.pos.dot(n))/nDotDir;result=this.pos.addScaled(this.dir,alpha);}\nreturn result;};x3dom.fields.Ray.prototype.intersect=function(low,high){var isect=0.0;var out=Number.MAX_VALUE;var r,te,tl;if(this.dir.x>x3dom.fields.Eps){r=1.0/this.dir.x;te=(low.x-this.pos.x)*r;tl=(high.x-this.pos.x)*r;if(tl<out){out=tl;}\nif(te>isect){isect=te;}}else if(this.dir.x<-x3dom.fields.Eps){r=1.0/this.dir.x;te=(high.x-this.pos.x)*r;tl=(low.x-this.pos.x)*r;if(tl<out){out=tl;}\nif(te>isect){isect=te;}}else if(this.pos.x<low.x||this.pos.x>high.x){return false;}\nif(this.dir.y>x3dom.fields.Eps){r=1.0/this.dir.y;te=(low.y-this.pos.y)*r;tl=(high.y-this.pos.y)*r;if(tl<out){out=tl;}\nif(te>isect){isect=te;}\nif(isect-out>=x3dom.fields.Eps){return false;}}else if(this.dir.y<-x3dom.fields.Eps){r=1.0/this.dir.y;te=(high.y-this.pos.y)*r;tl=(low.y-this.pos.y)*r;if(tl<out){out=tl;}\nif(te>isect){isect=te;}\nif(isect-out>=x3dom.fields.Eps){return false;}}else if(this.pos.y<low.y||this.pos.y>high.y){return false;}\nif(this.dir.z>x3dom.fields.Eps){r=1.0/this.dir.z;te=(low.z-this.pos.z)*r;tl=(high.z-this.pos.z)*r;if(tl<out){out=tl;}\nif(te>isect){isect=te;}}else if(this.dir.z<-x3dom.fields.Eps){r=1.0/this.dir.z;te=(high.z-this.pos.z)*r;tl=(low.z-this.pos.z)*r;if(tl<out){out=tl;}\nif(te>isect){isect=te;}}else if(this.pos.z<low.z||this.pos.z>high.z){return false;}\nthis.enter=isect;this.exit=out;return(isect-out<x3dom.fields.Eps);};x3dom.fields.BoxVolume=function(min,max){if(arguments.length<2){this.min=new x3dom.fields.SFVec3f(0,0,0);this.max=new x3dom.fields.SFVec3f(0,0,0);this.valid=false;}else{this.min=x3dom.fields.SFVec3f.copy(min);this.max=x3dom.fields.SFVec3f.copy(max);this.valid=true;}\nthis.updateInternals();};x3dom.fields.BoxVolume.prototype.getScalarValue=function(){var extent=this.max.subtract(this.min);return(extent.x*extent.y*extent.z);};x3dom.fields.BoxVolume.copy=function(other){var volume=new x3dom.fields.BoxVolume(other.min,other.max);volume.valid=other.valid;return volume;};x3dom.fields.BoxVolume.prototype.equals=function(other){return(this.min.equals(other.min,0.000000000001)&&this.max.equals(other.max,0.000000000001));};x3dom.fields.BoxVolume.prototype.updateInternals=function(){this.radialVec=this.max.subtract(this.min).multiply(0.5);this.center=this.min.add(this.radialVec);this.diameter=2*this.radialVec.length();};x3dom.fields.BoxVolume.prototype.setBounds=function(min,max){this.min.setValues(min);this.max.setValues(max);this.updateInternals();this.valid=true;};x3dom.fields.BoxVolume.prototype.setBoundsByCenterSize=function(center,size){var halfSize=size.multiply(0.5);this.min=center.subtract(halfSize);this.max=center.add(halfSize);this.updateInternals();this.valid=true;};x3dom.fields.BoxVolume.prototype.extendBounds=function(min,max){if(this.valid){if(this.min.x>min.x){this.min.x=min.x;}\nif(this.min.y>min.y){this.min.y=min.y;}\nif(this.min.z>min.z){this.min.z=min.z;}\nif(this.max.x<max.x){this.max.x=max.x;}\nif(this.max.y<max.y){this.max.y=max.y;}\nif(this.max.z<max.z){this.max.z=max.z;}\nthis.updateInternals();}else{this.setBounds(min,max);}};x3dom.fields.BoxVolume.prototype.getBounds=function(min,max){min.setValues(this.min);max.setValues(this.max);};x3dom.fields.BoxVolume.prototype.getRadialVec=function(){return this.radialVec;};x3dom.fields.BoxVolume.prototype.invalidate=function(){this.valid=false;this.min=new x3dom.fields.SFVec3f(0,0,0);this.max=new x3dom.fields.SFVec3f(0,0,0);this.updateInternals();};x3dom.fields.BoxVolume.prototype.isValid=function(){return this.valid;};x3dom.fields.BoxVolume.prototype.getCenter=function(){return this.center;};x3dom.fields.BoxVolume.prototype.getDiameter=function(){return this.diameter;};x3dom.fields.BoxVolume.prototype.transform=function(m){var xmin,ymin,zmin;var xmax,ymax,zmax;xmin=xmax=m._03;ymin=ymax=m._13;zmin=zmax=m._23;var a=this.max.x*m._00;var b=this.min.x*m._00;if(a>=b){xmax+=a;xmin+=b;}else{xmax+=b;xmin+=a;}\na=this.max.y*m._01;b=this.min.y*m._01;if(a>=b){xmax+=a;xmin+=b;}else{xmax+=b;xmin+=a;}\na=this.max.z*m._02;b=this.min.z*m._02;if(a>=b){xmax+=a;xmin+=b;}else{xmax+=b;xmin+=a;}\na=this.max.x*m._10;b=this.min.x*m._10;if(a>=b){ymax+=a;ymin+=b;}else{ymax+=b;ymin+=a;}\na=this.max.y*m._11;b=this.min.y*m._11;if(a>=b){ymax+=a;ymin+=b;}else{ymax+=b;ymin+=a;}\na=this.max.z*m._12;b=this.min.z*m._12;if(a>=b){ymax+=a;ymin+=b;}else{ymax+=b;ymin+=a;}\na=this.max.x*m._20;b=this.min.x*m._20;if(a>=b){zmax+=a;zmin+=b;}else{zmax+=b;zmin+=a;}\na=this.max.y*m._21;b=this.min.y*m._21;if(a>=b){zmax+=a;zmin+=b;}else{zmax+=b;zmin+=a;}\na=this.max.z*m._22;b=this.min.z*m._22;if(a>=b){zmax+=a;zmin+=b;}else{zmax+=b;zmin+=a;}\nthis.min.x=xmin;this.min.y=ymin;this.min.z=zmin;this.max.x=xmax;this.max.y=ymax;this.max.z=zmax;this.updateInternals();};x3dom.fields.BoxVolume.prototype.transformFrom=function(m,other){var xmin,ymin,zmin;var xmax,ymax,zmax;xmin=xmax=m._03;ymin=ymax=m._13;zmin=zmax=m._23;var a=other.max.x*m._00;var b=other.min.x*m._00;if(a>=b){xmax+=a;xmin+=b;}else{xmax+=b;xmin+=a;}\na=other.max.y*m._01;b=other.min.y*m._01;if(a>=b){xmax+=a;xmin+=b;}else{xmax+=b;xmin+=a;}\na=other.max.z*m._02;b=other.min.z*m._02;if(a>=b){xmax+=a;xmin+=b;}else{xmax+=b;xmin+=a;}\na=other.max.x*m._10;b=other.min.x*m._10;if(a>=b){ymax+=a;ymin+=b;}else{ymax+=b;ymin+=a;}\na=other.max.y*m._11;b=other.min.y*m._11;if(a>=b){ymax+=a;ymin+=b;}else{ymax+=b;ymin+=a;}\na=other.max.z*m._12;b=other.min.z*m._12;if(a>=b){ymax+=a;ymin+=b;}else{ymax+=b;ymin+=a;}\na=other.max.x*m._20;b=other.min.x*m._20;if(a>=b){zmax+=a;zmin+=b;}else{zmax+=b;zmin+=a;}\na=other.max.y*m._21;b=other.min.y*m._21;if(a>=b){zmax+=a;zmin+=b;}else{zmax+=b;zmin+=a;}\na=other.max.z*m._22;b=other.min.z*m._22;if(a>=b){zmax+=a;zmin+=b;}else{zmax+=b;zmin+=a;}\nthis.min.x=xmin;this.min.y=ymin;this.min.z=zmin;this.max.x=xmax;this.max.y=ymax;this.max.z=zmax;this.updateInternals();this.valid=true;};x3dom.fields.FrustumVolume=function(clipMat){this.planeNormals=[];this.planeDistances=[];this.directionIndex=[];if(arguments.length===0){return;}\nvar planeEquation=[];for(var i=0;i<6;i++){this.planeNormals[i]=new x3dom.fields.SFVec3f(0,0,0);this.planeDistances[i]=0;this.directionIndex[i]=0;planeEquation[i]=new x3dom.fields.SFVec4f(0,0,0,0);}\nplaneEquation[0].x=clipMat._30-clipMat._00;planeEquation[0].y=clipMat._31-clipMat._01;planeEquation[0].z=clipMat._32-clipMat._02;planeEquation[0].w=clipMat._33-clipMat._03;planeEquation[1].x=clipMat._30+clipMat._00;planeEquation[1].y=clipMat._31+clipMat._01;planeEquation[1].z=clipMat._32+clipMat._02;planeEquation[1].w=clipMat._33+clipMat._03;planeEquation[2].x=clipMat._30+clipMat._10;planeEquation[2].y=clipMat._31+clipMat._11;planeEquation[2].z=clipMat._32+clipMat._12;planeEquation[2].w=clipMat._33+clipMat._13;planeEquation[3].x=clipMat._30-clipMat._10;planeEquation[3].y=clipMat._31-clipMat._11;planeEquation[3].z=clipMat._32-clipMat._12;planeEquation[3].w=clipMat._33-clipMat._13;planeEquation[4].x=clipMat._30+clipMat._20;planeEquation[4].y=clipMat._31+clipMat._21;planeEquation[4].z=clipMat._32+clipMat._22;planeEquation[4].w=clipMat._33+clipMat._23;planeEquation[5].x=clipMat._30-clipMat._20;planeEquation[5].y=clipMat._31-clipMat._21;planeEquation[5].z=clipMat._32-clipMat._22;planeEquation[5].w=clipMat._33-clipMat._23;for(i=0;i<6;i++){var vectorLength=Math.sqrt(planeEquation[i].x*planeEquation[i].x+\nplaneEquation[i].y*planeEquation[i].y+\nplaneEquation[i].z*planeEquation[i].z);planeEquation[i].x/=vectorLength;planeEquation[i].y/=vectorLength;planeEquation[i].z/=vectorLength;planeEquation[i].w/=-vectorLength;}\nvar updateDirectionIndex=function(normalVec){var ind=0;if(normalVec.x>0)ind|=1;if(normalVec.y>0)ind|=2;if(normalVec.z>0)ind|=4;return ind;};this.planeNormals[3].setValues(planeEquation[0]);this.planeDistances[3]=planeEquation[0].w;this.directionIndex[3]=updateDirectionIndex(this.planeNormals[3]);this.planeNormals[2].setValues(planeEquation[1]);this.planeDistances[2]=planeEquation[1].w;this.directionIndex[2]=updateDirectionIndex(this.planeNormals[2]);this.planeNormals[5].setValues(planeEquation[2]);this.planeDistances[5]=planeEquation[2].w;this.directionIndex[5]=updateDirectionIndex(this.planeNormals[5]);this.planeNormals[4].setValues(planeEquation[3]);this.planeDistances[4]=planeEquation[3].w;this.directionIndex[4]=updateDirectionIndex(this.planeNormals[4]);this.planeNormals[0].setValues(planeEquation[4]);this.planeDistances[0]=planeEquation[4].w;this.directionIndex[0]=updateDirectionIndex(this.planeNormals[0]);this.planeNormals[1].setValues(planeEquation[5]);this.planeDistances[1]=planeEquation[5].w;this.directionIndex[1]=updateDirectionIndex(this.planeNormals[1]);};x3dom.fields.FrustumVolume.prototype.intersect=function(vol,planeMask){if(this.planeNormals.length<6){x3dom.debug.logWarning(\"FrustumVolume not initialized!\");return false;}\nvar that=this;var min=vol.min,max=vol.max;var setDirectionIndexPoint=function(index){var pnt=new x3dom.fields.SFVec3f(0,0,0);if(index&1){pnt.x=min.x;}\nelse{pnt.x=max.x;}\nif(index&2){pnt.y=min.y;}\nelse{pnt.y=max.y;}\nif(index&4){pnt.z=min.z;}\nelse{pnt.z=max.z;}\nreturn pnt;};var pntIsInHalfSpace=function(i,pnt){var s=that.planeNormals[i].dot(pnt)-that.planeDistances[i];return(s>=0);};var isInHalfSpace=function(i){var p=setDirectionIndexPoint(that.directionIndex[i]);return pntIsInHalfSpace(i,p);};var isOutHalfSpace=function(i){var p=setDirectionIndexPoint(that.directionIndex[i]^7);return!pntIsInHalfSpace(i,p);};var mask=1;if(planeMask<0)planeMask=0;for(var i=0;i<6;i++,mask<<=1){if((planeMask&mask)!=0)\ncontinue;if(isOutHalfSpace(i))\nreturn-1;if(isInHalfSpace(i))\nplaneMask|=mask;}\nreturn planeMask;};x3dom.docs={};x3dom.docs.specURLMap={CADGeometry:\"CADGeometry.html\",Core:\"core.html\",DIS:\"dis.html\",CubeMapTexturing:\"env_texture.html\",EnvironmentalEffects:\"enveffects.html\",EnvironmentalSensor:\"envsensor.html\",Followers:\"followers.html\",Geospatial:\"geodata.html\",Geometry2D:\"geometry2D.html\",Geometry3D:\"geometry3D.html\",Grouping:\"group.html\",\"H-Anim\":\"hanim.html\",Interpolation:\"interp.html\",KeyDeviceSensor:\"keyboard.html\",Layering:\"layering.html\",Layout:\"layout.html\",Lighting:\"lighting.html\",Navigation:\"navigation.html\",Networking:\"networking.html\",NURBS:\"nurbs.html\",ParticleSystems:\"particle_systems.html\",Picking:\"picking.html\",PointingDeviceSensor:\"pointingsensor.html\",Rendering:\"rendering.html\",RigidBodyPhysics:\"rigid_physics.html\",Scripting:\"scripting.html\",Shaders:\"shaders.html\",Shape:\"shape.html\",Sound:\"sound.html\",Text:\"text.html\",Texturing3D:\"texture3D.html\",Texturing:\"texturing.html\",Time:\"time.html\",EventUtilities:\"utils.html\",VolumeRendering:\"volume.html\"};x3dom.docs.specBaseURL=\"http://www.web3d.org/x3d/specifications/ISO-IEC-19775-1.2-X3D-AbstractSpecification/Part01/components/\";x3dom.docs.getNodeTreeInfo=function(){var tn,t;var types=\"\";var objInArray=function(array,obj){for(var i=0;i<array.length;i++){if(array[i]===obj){return true;}}\nreturn false;};var dump=function(t,indent){for(var i=0;i<indent;i++){types+=\"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\";}\ntypes+=\"<a href='\"+\nx3dom.docs.specBaseURL+x3dom.docs.specURLMap[x3dom.nodeTypes[t]._compName]+\"#\"+t+\"' style='color:black; text-decoration:none; font-weight:bold;'>\"+\nt+\"</a> &nbsp; <a href='\"+\nx3dom.docs.specBaseURL+x3dom.docs.specURLMap[x3dom.nodeTypes[t]._compName]+\"' style='color:black; text-decoration:none; font-style:italic;'>\"+\nx3dom.nodeTypes[t]._compName+\"</a><br/>\";for(var i in x3dom.nodeTypes[t].childTypes[t]){dump(x3dom.nodeTypes[t].childTypes[t][i],indent+1);}};for(tn in x3dom.nodeTypes){var t=x3dom.nodeTypes[tn];if(t.childTypes===undefined){t.childTypes={};}\nwhile(t.superClass){if(t.superClass.childTypes[t.superClass._typeName]===undefined){t.superClass.childTypes[t.superClass._typeName]=[];}\nif(!objInArray(t.superClass.childTypes[t.superClass._typeName],t._typeName)){t.superClass.childTypes[t.superClass._typeName].push(t._typeName);}\nt=t.superClass;}}\ndump(\"X3DNode\",0);return\"<div class='x3dom-doc-nodes-tree'>\"+types+\"</div>\";};x3dom.docs.getComponentInfo=function(){var components=[];var component;var result=\"\";var c,cn;for(c in x3dom.components){components.push(c);}\ncomponents.sort();for(cn in components){c=components[cn];component=x3dom.components[c];result+=\"<h2><a href='\"+\nx3dom.docs.specBaseURL+x3dom.docs.specURLMap[c]+\"' style='color:black; text-decoration:none; font-style:italic;'>\"+\nc+\"</a></h2>\";result+=\"<ul style='list-style-type:circle;'>\";for(var t in component){result+=\"<li><a href='\"+\nx3dom.docs.specBaseURL+x3dom.docs.specURLMap[c]+\"#\"+t+\"' style='color:black; text-decoration:none; font-weight:bold;'>\"+\nt+\"</a></li>\";}\nresult+=\"</ul>\";}\nreturn result;};\"use strict\";x3dom.JSONParser=function(scene)\n{this.x3djsonNS=\"http://www.web3d.org/specifications/x3d-namespace\";};x3dom.JSONParser.prototype.constructor=x3dom.JSONParser;x3dom.JSONParser.prototype.parseJavaScript=function(jsobj){var child=this.CreateElement('X3D');this.ConvertToX3DOM(jsobj,\"\",child);return child;};x3dom.JSONParser.prototype.elementSetAttribute=function(element,key,value){if(key==='SON schema'){}else if(key==='ncoding'){}else{if(typeof element.setAttribute==='function'){element.setAttribute(key,value);}}};x3dom.JSONParser.prototype.ConvertChildren=function(parentkey,object,element){var key;for(key in object){if(typeof object[key]==='object'){if(isNaN(parseInt(key))){this.ConvertObject(key,object,element,parentkey.substr(1));}else{this.ConvertToX3DOM(object[key],key,element,parentkey.substr(1));}}}};x3dom.JSONParser.prototype.CreateElement=function(key,containerField){var child=null;if(typeof this.x3djsonNS==='undefined'){child=document.createElement(key);}else{child=document.createElementNS(this.x3djsonNS,key);if(child===null||typeof child==='undefined'){console.error('Trouble creating element for',key);child=document.createElement(key);}}\nif(typeof containerField!=='undefined'){this.elementSetAttribute(child,'containerField',containerField);}\nreturn child;};x3dom.JSONParser.prototype.CDATACreateFunction=function(document,element,str){var y=str.trim().replace(/\\\\\"/g,\"\\\\\\\"\").replace(/&lt;/g,\"<\").replace(/&gt;/g,\">\").replace(/&amp;/g,\"&\");do{str=y;y=str.replace(/'([^'\\r\\n]*)\\n([^']*)'/g,\"'$1\\\\n$2'\");if(str!==y){}}while(y!=str);var domParser=new DOMParser();var cdataStr='<script> <![CDATA[ '+y+' ]]> </script>';var scriptDoc=domParser.parseFromString(cdataStr,'application/xml');var cdata=scriptDoc.children[0].childNodes[1];element.appendChild(cdata);};x3dom.JSONParser.prototype.ConvertObject=function(key,object,element,containerField){var child;if(object!==null&&typeof object[key]==='object'){if(key.startsWith('@')){this.ConvertToX3DOM(object[key],key,element);}else if(key.startsWith('-')){this.ConvertChildren(key,object[key],element);}else if(key==='#comment'){for(var c in object[key]){child=document.createComment(this.CommentStringToXML(object[key][c]));element.appendChild(child);}}else if(key==='#sourceText'){this.CDATACreateFunction(document,element,object[key].join(\"\\r\\n\")+\"\\r\\n\");}else{if(key==='connect'||key==='fieldValue'||key==='field'||key==='meta'||key==='component'){for(var childkey in object[key]){if(typeof object[key][childkey]==='object'){child=this.CreateElement(key,containerField);this.ConvertToX3DOM(object[key][childkey],childkey,child);element.appendChild(child);element.appendChild(document.createTextNode(\"\\n\"));}}}else{child=this.CreateElement(key,containerField);this.ConvertToX3DOM(object[key],key,child);element.appendChild(child);element.appendChild(document.createTextNode(\"\\n\"));}}}};x3dom.JSONParser.prototype.CommentStringToXML=function(str){var y=str;str=str.replace(/\\\\\\\\/g,'\\\\');if(y!==str){}\nreturn str;};x3dom.JSONParser.prototype.SFStringToXML=function(str){var y=str;str=str.replace(/\\\\/g,'\\\\\\\\');str=str.replace(/\"/g,'\\\\\\\"');if(y!==str){}\nreturn str;};x3dom.JSONParser.prototype.JSONStringToXML=function(str){var y=str;str=str.replace(/\\\\/g,'\\\\\\\\');str=str.replace(/\\n/g,'\\\\n');if(y!==str){}\nreturn str;};x3dom.JSONParser.prototype.ConvertToX3DOM=function(object,parentkey,element,containerField){var key;var localArray=[];var isArray=false;var arrayOfStrings=false;for(key in object){if(isNaN(parseInt(key))){isArray=false;}else{isArray=true;}\nif(isArray){if(typeof object[key]==='number'){localArray.push(object[key]);}else if(typeof object[key]==='string'){localArray.push(object[key]);arrayOfStrings=true;}else if(typeof object[key]==='boolean'){localArray.push(object[key]);}else if(typeof object[key]==='object'){this.ConvertToX3DOM(object[key],key,element);}else if(typeof object[key]==='undefined'){}else{console.error(\"Unknown type found in array \"+typeof object[key]);}}else if(typeof object[key]==='object'){if(key==='X3D'){this.ConvertToX3DOM(object[key],key,element);}else{this.ConvertObject(key,object,element);}}else if(typeof object[key]==='number'){this.elementSetAttribute(element,key.substr(1),object[key]);}else if(typeof object[key]==='string'){if(key!=='#comment'){this.elementSetAttribute(element,key.substr(1),this.JSONStringToXML(object[key]));}else{var child=document.createComment(this.CommentStringToXML(object[key]));element.appendChild(child);}}else if(typeof object[key]==='boolean'){this.elementSetAttribute(element,key.substr(1),object[key]);}else if(typeof object[key]==='undefined'){}else{console.error(\"Unknown type found in object \"+typeof object[key]);console.error(object);}}\nif(isArray){if(parentkey.startsWith('@')){if(arrayOfStrings){for(var str in localArray){localArray[str]=this.SFStringToXML(localArray[str]);}\nthis.elementSetAttribute(element,parentkey.substr(1),'\"'+localArray.join('\" \"')+'\"');}else{this.elementSetAttribute(element,parentkey.substr(1),localArray.join(\" \"));}}}\nreturn element;};x3dom.PROTOS=function(){this.protos={};this.names={};this.protoField={};this.scriptField={};this.interfaceField={};this.envField={};this.scopecount=0;this.privatescope=[];this.defs={};this.founddef=null;this.SFNodes={\"-appearance\":1,\"-body\":1,\"-child\":1,\"-collidable\":1,\"-collider\":1,\"-color\":1,\"-composableRenderStyle\":1,\"-coord\":1,\"-emitter\":1,\"-fillProperties\":1,\"-fogCoord\":1,\"-fontStyle\":1,\"-geometry\":1,\"-geoOrigin\":1,\"-layout\":1,\"-lineProperties\":1,\"-massDensityModel\":1,\"-material\":1,\"-metadata\":1,\"-normal\":1,\"-nurbsCurve\":1,\"-nurbsCurve2D\":1,\"-pickingGeometry\":1,\"-renderStyle\":1,\"-shape\":1,\"-source\":1,\"-texCoord\":1,\"-texCoordNurbs\":1,\"-texCoordRamp\":1,\"-texture\":1,\"-texture2D\":1,\"-texture2DMulti\":1,\"-texture3D\":1,\"-textureProperties\":1,\"-textureTransform\":1,\"-transferFunction\":1,\"-viewport\":1};}\nx3dom.PROTOS.prototype={flattenerArray:function(object,parentArray){var newobject=[];var offset=0;for(var p in object){var possibleArray=this.flattener(object[p],newobject,object.length);if(Array.isArray(possibleArray)){for(var q in possibleArray){newobject[parseInt(p)+offset+parseInt(q)]=possibleArray[q];}\noffset+=possibleArray.length-1;}else{newobject[parseInt(p)+offset]=possibleArray;}}\nreturn newobject;},flattenerObject:function(object,parentArray,arrayLen){var newobject={};for(var p in object){var possibleArray=this.flattener(object[p],parentArray,arrayLen);if(Array.isArray(possibleArray)){if(this.SFNodes[p]){newobject[p]=possibleArray[0];if(possibleArray.length>1){parentArray[arrayLen]={\"Switch\":{\"@whichChoice\":-1,\"-children\":[{\"Group\":{\"-children\":[]}}]}};for(var i=1;i<possibleArray.length;i++){parentArray[arrayLen][\"Switch\"][\"-children\"][0][\"Group\"][\"-children\"][i-1]=possibleArray[i];}}}else{newobject[p]=possibleArray;}}else{if(this.SFNodes[p]){if(typeof possibleArray==='object'&&possibleArray[\"#comment\"]){if(newobject[\"-children\"]){newobject[p]={};newobject[\"-children\"].push(possibleArray);}else{newobject[p]={};newobject[\"-children\"]=[possibleArray];}}else{newobject[p]=possibleArray;}}else{newobject[p]=possibleArray;}}}\nreturn newobject;},flattener:function(object,parentArray,arrayLen){if(typeof object===\"object\"){if(Array.isArray(object)){var newobject=this.flattenerArray(object,parentArray);}else{var newobject=this.flattenerObject(object,parentArray,arrayLen);}\nreturn newobject;}else{return object;}},pushScope:function(s){this.privatescope.push(s);},popScope:function(){this.privatescope.pop();},saveDef:function(def){this.defs[def]=this.getScope();var d=this.getScope(def);return d;},getDef:function(def){return this.defs[def];},getField:function(scope,field){return scope+\"_\"+field;},getScope:function(def){var scope;if(def){if(this.defs[def]){scope=this.defs[def]+\"_\"+def;}else{scope=def;}}else{scope=this.privatescope.join(\"_\");}\nvar decl=scope.lastIndexOf(\"DECL\");if(decl>0){scope=scope.substring(decl);}\nreturn scope;},scopeLength:function(){return this.privatescope.length;},upScope:function(i){return this.privatescope.slice(0,this.privatescope.length-i).join(\"_\");},setValueFromInterface:function(field,object,objectfield){var fieldname_field_scope=this.getInterface(field);var prefix=\"@\";if(typeof fieldname_field_scope!='undefined'&&typeof fieldname_field_scope[0]!='undefined'){prefix=fieldname_field_scope[0].substr(0,1);}\nif(prefix==='@'&&objectfield==='children'){prefix='-';}\nif(prefix==='-'&&objectfield==='value'){prefix=\"@\";}\nobjectfield=prefix+objectfield;if(typeof fieldname_field_scope!='undefined'&&typeof fieldname_field_scope[1]!='undefined'&&typeof fieldname_field_scope[0]!='undefined'&&typeof fieldname_field_scope[1][fieldname_field_scope[0]]!='undefined'){var value=fieldname_field_scope[1][fieldname_field_scope[0]];if(Array.isArray(value)&&fieldname_field_scope[1][\"@type\"]===\"SFNode\"&&objectfield!=='-children'){console.error(\"SFNode is array, reducing\",value);value=value[0];}\nif(!Array.isArray(value)&&objectfield==='-children'){objectfield=\"@value\";}\nobject[objectfield]=value;return[fieldname_field_scope[1][\"@type\"],fieldname_field_scope[2]];}\nreturn undefined;},getObjectField:function(f,type){var objectfield=\"value\";if(type.indexOf(\"FNode\")===1){objectfield=\"children\";}\nfor(var a in f){if(a==='@value'||a==='-children'){objectfield=a.substr(1);}}\nreturn objectfield;},findFieldByName:function(fields,objectfield){for(var field in fields){var f=fields[field];var fieldname=f[\"@name\"];if(fieldname===objectfield){return f;}}\nthrow\"Can't find \"+objectfield;},getScriptFieldFieldTypeFieldByNameAttribute:function(fields,objectfield){var f=this.findFieldByName(fields,objectfield);var fieldname=f[\"@name\"];var type=f[\"@type\"];objectfield=this.getObjectField(f,type);return[f,fieldname,type,objectfield];},getScriptFieldFieldTypeField:function(fields,field){var f=fields[field];var fieldname=f[\"@name\"];var type=f[\"@type\"];var objectfield=this.getObjectField(f,type);return[f,fieldname,type,objectfield];},setScriptFields:function(fields,def){var scope=this.getScope();for(var field in fields){var field_name_field_type_objectfield_name=this.getScriptFieldFieldTypeField(fields,field);var f=field_name_field_type_objectfield_name[0];var fieldname=field_name_field_type_objectfield_name[1];var type=field_name_field_type_objectfield_name[2];var objectfield=field_name_field_type_objectfield_name[3];var type_scope=this.setValueFromInterface(fieldname,f,objectfield);this.setScriptField(scope,fieldname,f,objectfield,type,def);if(typeof type_scope!=='undefined'){this.setScriptField(type_scope[1],fieldname,f,objectfield,type,def);}}},setScriptField:function(scope,field,f,objectfield,type,def){if(typeof this.scriptField[this.getField(scope,field)]==='undefined'){this.scriptField[this.getField(scope,field)]=[];}\nthis.scriptField[this.getField(scope,field)][this.scriptField[this.getField(scope,field)].length]=[f,objectfield,type,def];},setEnv:function(scope,protoField,newobject,nodeField,type,newdef){var fieldname_field_scope=this.getInterface(protoField);if(typeof fieldname_field_scope!=='undefined'){scope=fieldname_field_scope[2];}\nif(typeof this.envField[this.getField(scope,protoField)]==='undefined'){this.envField[this.getField(scope,protoField)]=[];}\nthis.envField[this.getField(scope,protoField)][this.envField[this.getField(scope,protoField)].length]=[newobject,nodeField,type,newdef];},getEnv:function(scope,protoField){return this.envField[this.getField(scope,protoField)];},setConnectField:function(scope,field,newobject,objectfield,type,newdef){if(typeof this.protoField[this.getField(scope,field)]==='undefined'){this.protoField[this.getField(scope,field)]=[];}\nthis.protoField[this.getField(scope,field)][this.protoField[this.getField(scope,field)].length]=[newobject,objectfield,type,newdef];},setConnectFields:function(object,p,newobject){var def=object[\"@DEF\"];var newdef=this.saveDef(def);var connect=object[p][\"connect\"];var scope=this.getScope();for(var cfield in connect){var f=connect[cfield];if(f){var field=this.getScope(f[\"@protoField\"]);var objectfield=f[\"@nodeField\"];var type_scope=this.setValueFromInterface(field,newobject,objectfield);var type=undefined;if(typeof type_scope!=='undefined'){type=type_scope[0];this.setEnv(scope,field,newobject,objectfield,type,newdef);this.setConnectField(scope,field,newobject,objectfield,type,newdef);this.setConnectField(type_scope[1],field,newobject,objectfield,type,newdef);}else{this.setEnv(scope,field,newobject,objectfield,type,newdef);this.setConnectField(scope,field,newobject,objectfield,type,newdef);}}}},setScriptConnectFields:function(file,object,p,newobject){var connect=object[p][\"connect\"];var scope=this.getScope();var def=object[\"@DEF\"];newobject[\"field\"]=this.realPrototypeExpander(file,object[\"field\"],true);var newdef=newobject[\"@DEF\"];for(var cfield in connect){var f=connect[cfield];if(f){var field=this.getScope(f[\"@protoField\"]);var objectfield=f[\"@nodeField\"];var field_name_field_type_objectfield_name=this.getScriptFieldFieldTypeFieldByNameAttribute(newobject[\"field\"],objectfield);f=field_name_field_type_objectfield_name[0];var fieldname=field_name_field_type_objectfield_name[1];var type=field_name_field_type_objectfield_name[2];objectfield=field_name_field_type_objectfield_name[3];var type_scope=this.setValueFromInterface(field,f,objectfield);if(typeof type_scope!=='undefined'){type=type_scope[0];this.setScriptField(scope,field,f,objectfield,type,def);this.setScriptField(type_scope[1],field,f,objectfield,type,def);}else{this.setScriptField(scope,field,f,objectfield,type,def);}}}},getInterface:function(field){for(var i=0;i<this.scopeLength();i++){var scope=this.upScope(i);if(!scope){break;}\nvar fieldname_field_scope=this.interfaceField[this.getField(scope,field)];if(fieldname_field_scope){return fieldname_field_scope;}}},setInterface:function(field,fieldname){var scope=this.getScope();this.interfaceField[this.getField(scope,field[\"@name\"])]=[fieldname,field,scope];},clearScope:function(field,object){var scope=this.getScope();delete this.scriptField[this.getField(scope,field)];delete this.protoField[this.getField(scope,field)];this.zap(field,object);},extractConnectedDef:function(scope,field){var defobj;for(var sf in this.scriptField[this.getField(scope,field)]){if(typeof defobj==='undefined'){var obj=this.scriptField[this.getField(scope,field)][sf];if(typeof obj!=='undefined'){if(typeof obj[3]!=='undefined'){var f=this.getField(scope,obj[3]);if(f.indexOf(\"DECL\",1)==-1){defobj=[f,obj[0][\"@name\"]];}}}}}\nif(typeof defobj==='undefined'){for(var pf in this.protoField[this.getField(scope,field)]){var obj2=this.protoField[this.getField(scope,field)][pf];if(typeof obj2!=='undefined'){defobj=[obj2[3],obj2[1]];}}}\nif(typeof defobj==='undefined'){for(var pf2 in this.protoField[this.getField(scope,\"__DEF_FIELD__\")]){var obj3=this.protoField[this.getField(scope,\"__DEF_FIELD__\")][pf2];if(typeof obj3!=='undefined'){defobj=[obj3[3],field];}}}\nif(typeof defobj==='undefined'){defobj=[scope,field];}\nreturn defobj;},setObjectValues:function(scope,field,fieldOrNode,value){var foundOther=false;for(var pf in this.protoField[this.getField(scope,field)]){var obj=this.protoField[this.getField(scope,field)][pf];if(typeof obj!=='undefined'){this.setObjectValue(scope,field,obj,fieldOrNode,value);foundOther=true;}else{}}\nfor(var sf in this.scriptField[this.getField(scope,field)]){var obj2=this.scriptField[this.getField(scope,field)][sf];if(typeof obj2!=='undefined'){this.setObjectValue(scope,field,obj2,fieldOrNode,value);foundOther=true;}else{}}\nif(foundOther){return;}\nfor(var i=0;i<this.scopeLength();i++){var parentScope=this.upScope(i);if(!parentScope){break;}\nvar envs=this.getEnv(parentScope,field);for(var e in envs){var obj3=envs[e];if(typeof obj3!=='undefined'&&obj3[3].indexOf(parentScope)===obj3[3].lastIndexOf(parentScope)){this.setObjectValue(parentScope,obj3[1],obj3,fieldOrNode,value);}}}},setObjectValue:function(scope,field,obj,fieldOrNode,value){if(Array.isArray(value)&&typeof obj[2]!=='undefined'){if(obj[2]===\"SFNode\"){value=value[0];}else if(obj[2]===\"MFNode\"){}}\nvar prefix=obj[1].substr(0,1);if(prefix!=='-'&&prefix!=='@'){prefix=fieldOrNode.substr(0,1);}else{prefix=\"\";}\nif(prefix==='@'&&obj[1]==='children'){prefix='-';}\nif(prefix==='-'&&obj[1]==='value'){prefix=\"@\";}\nif(!Array.isArray(value)&&obj[1]==='children'){value=[value];}\nobj[0][prefix+obj[1]]=value;},zap:function(field,object){var p;if(typeof object===\"object\"){for(p in object){if(p.toLowerCase()==='is'){var connect=object[p][\"connect\"];for(var fld in connect){var f=connect[fld];if(f&&f[\"@protoField\"]===field){delete connect[fld];}}}else{this.zap(field,object[p]);}}}\nreturn object;},zapIs:function(object){var p;if(typeof object===\"object\"){for(p in object){if(p.toLowerCase()==='is'){delete object[p];}else{this.zapIs(object[p]);}}}\nreturn object;},prototypeExpander:function(file,object){this.protos={};this.names={};this.protoField={};this.scriptField={};this.interfaceField={};this.envField={};this.scopecount=0;this.privatescope=[];this.defs={};this.founddef=null;object=this.externalPrototypeExpander(file,object);object=this.realPrototypeExpander(file,object,false);this.zapIs(object);object=this.flattener(object);return object;},readCode:function(data,fileExt,protoexp,done,p,newobject){if(typeof data!=='undefined'){newobject[p][\"#sourceText\"]=data.split(/\\r?\\n/);delete newobject[p][\"@url\"];}},handleScript:function(file,object,p,newobject){newobject[p]=this.realPrototypeExpander(file,object[p],true);this.setScriptFields(newobject[p][\"field\"],newobject[p][\"@DEF\"]);var url=newobject[p][\"@url\"];this.loadURLs(file,url,this.readCode,null,function(){},p,newobject);},handleProtoDeclare:function(file,object,p){var name=object[p][\"@name\"];var def=object[p][\"@DEF\"];this.protos[name]=object[p];this.saveDef(def);if(typeof object[p][\"@appinfo\"]!=='undefined'){this.protos[name][\"@appinfo\"]=object[p][\"@appinfo\"];}\nif(typeof object[p][\"@documentation\"]!=='undefined'){this.protos[name][\"@documentation\"]=object[p][\"@documentation\"];}\nthis.pushScope(\"DECL\"+name);this.names[def]=name;this.realPrototypeExpander(file,object[p],false);this.popScope();return object;},handleProtoInterface:function(file,object,p){var fields=object[p][\"field\"];for(var field in fields){var f=fields[field];if(typeof f[\"@value\"]!=='undefined'){this.setInterface(f,\"@value\");}else if(typeof f[\"-children\"]!=='undefined'){this.setInterface(f,\"-children\");}else{this.setInterface(f);}}\nreturn object;},handleProtoInstance:function(file,object,p){var name=object[p][\"@name\"];var def=object[p][\"@DEF\"];var use=object[p][\"@USE\"];this.names[def]=name;if(typeof name==='undefined'&&typeof use!=='undefined'){name=this.names[use];}\nthis.pushScope(\"DECL\"+name);var instance={};if(typeof def==='undefined'&&typeof use==='undefined'){def=\"INSTANCE\";}\nif(this.getDef(def)&&typeof use==='undefined'){this.scopecount+=1000;def+=\"\"+this.scopecount;}else{}\nif(typeof def!=='undefined'){var newdef=this.saveDef(def);this.pushScope(def);}\nvar bodydef;if(typeof this.protos[name]==='undefined'||typeof this.protos[name]['ProtoBody']==='undefined'){console.error(\"ProtoBody undefined for\",name);}else{var children=this.protos[name]['ProtoBody']['-children'];for(var child in children){var ch=children[child];for(var objkey in ch){if(typeof bodydef==='undefined'){bodydef=ch[objkey][\"@DEF\"];if(typeof use!=='undefined'){var iuse=this.saveDef(use);this.pushScope(use);}}}}\ninstance=JSON.parse(JSON.stringify(children));}\nvar firstobj=instance;while(Array.isArray(firstobj)){if(firstobj[0]===null||typeof firstobj[0]==='undefined'){break;}\nfirstobj=firstobj[0];}\nif(typeof use!=='undefined'&&typeof firstobj==='object'){var newobject={};newobject[objkey]={};newobject[objkey][\"@USE\"]=this.getScope();if(typeof bodydef!=='undefined'){this.popScope();}}else{var newobject=this.realPrototypeExpander(file,instance,false);var fieldValue=object[p][\"fieldValue\"];for(var field in fieldValue){var fv=fieldValue[field];var protoField=fv[\"@name\"];var fieldOrNode=\"@value\";var value=fv[fieldOrNode];for(var nv in fv){if(nv==='@name'){continue;}\nfieldOrNode=nv;value=fv[fieldOrNode];this.pushScope(\"FIELD\"+protoField);if(typeof firstobj==='object'&&typeof firstobj[objkey]!=='undefined'){firstobj[objkey][\"@DEF\"]=this.getScope();}\nvalue=this.realPrototypeExpander(file,value,false);this.popScope();this.getInterface(protoField);this.setObjectValues(this.getScope(),protoField,fieldOrNode,value);}}}\nif(typeof use!=='undefined'){this.popScope();}\nif(typeof def!=='undefined'){this.popScope();}\nthis.popScope();return newobject;},realPrototypeExpander:function(file,object,inScript){if(typeof object===\"object\"){var newobject=null;if(Array.isArray(object)){newobject=[];}else{newobject={};}\nfor(var p in object){var plc=p.toLowerCase();if(plc==='script'){this.handleScript(file,object,p,newobject);}else if(plc==='protodeclare'){this.handleProtoDeclare(file,object,p);}else if(plc==='protointerface'){this.handleProtoInterface(file,object,p);}else if(plc==='protobody'){this.realPrototypeExpander(file,object[p],inScript);}else if(plc==='protoinstance'){newobject=this.handleProtoInstance(file,object,p);}else if(plc==='connect'){this.realPrototypeExpander(file,object[p],inScript);}else if(plc==='fieldvalue'){this.realPrototypeExpander(file,object[p],inScript);}else if(plc==='field'){newobject[p]=this.realPrototypeExpander(file,object[p],inScript);}else if(plc==='@value'){newobject[p]=this.realPrototypeExpander(file,object[p],inScript);}else if(plc==='-children'){newobject[p]=this.realPrototypeExpander(file,object[p],inScript);}else if(plc==='is'){if(inScript){this.setScriptConnectFields(file,object,p,newobject);}else{this.setConnectFields(object,p,newobject);}\nthis.realPrototypeExpander(file,object[p],inScript);}else if(plc==='route'){newobject[p]={};var envFrom=this.extractConnectedDef(this.getScope(object[p][\"@fromNode\"]),object[p][\"@fromField\"]);newobject[p][\"@fromNode\"]=envFrom[0];newobject[p][\"@fromField\"]=envFrom[1];var envTo=this.extractConnectedDef(this.getScope(object[p][\"@toNode\"]),object[p][\"@toField\"]);newobject[p][\"@toNode\"]=envTo[0];newobject[p][\"@toField\"]=envTo[1];}else if(plc==='@name'){newobject[p]=object[p];}else if(plc==='@def'){newobject[p]=this.saveDef(object[p]);this.setConnectField(this.getScope(),\"__DEF_FIELD__\",newobject,object[p],\"SFString\",newobject[p]);}else if(plc==='@use'){newobject[p]=this.getScope(object[p]);}else{newobject[p]=this.realPrototypeExpander(file,object[p],inScript);}}\nreturn newobject;}else{return object;}},searchForProtoDeclare:function(object,name){var p;var found;if(typeof alert==='function'){}\nif(typeof object===\"object\"){for(p in object){if(p==='ProtoDeclare'){if(object[p][\"@name\"]===name){found=object;}\nif(typeof found==='undefined'&&this.founddef===null){if(typeof alert==='function'){}\nthis.founddef=object;}}\nif(typeof found==='undefined'){found=this.searchForProtoDeclare(object[p],name);}}}\nif(typeof found!=='undefined'){}\nreturn found;},searchAndReplaceProto:function(filename,json,protoname,founddef,obj,objret){if(typeof alert==='function'){}\nvar newobj=this.searchForProtoDeclare(json,protoname);if(typeof newobj==='undefined'){newobj=founddef;}\nif(newobj===null||typeof newobj.ProtoDeclare==='undefined'){if(typeof alert==='function'){}\nconsole.error(\"ProtoDeclare is still null or undefined\",filename,protoname,JSON.stringify(json));}else{var name=obj[\"@name\"];var appinfo=obj[\"@appinfo\"];var description=obj[\"@description\"];newobj[\"ProtoDeclare\"][\"@name\"]=name;newobj[\"ProtoDeclare\"][\"@appinfo\"]=appinfo;newobj[\"ProtoDeclare\"][\"@description\"]=description;}\nif(typeof alert==='function'){}\nobjret(newobj);},loadedProto:function(data,protoname,obj,filename,protoexp,objret){if(typeof data!=='undefined'){try{this.founddef=null;var json={};try{json=JSON.parse(data);protoexp.searchAndReplaceProto(filename,json,protoname,protoexp.founddef,obj,objret);}catch(e){if(typeof DOM2JSONSerializer==='function'){if(typeof alert==='function'){}\ntry{var serializer=new DOM2JSONSerializer();var str=serializer.serializeToString(null,data.firstElementChild,filename,mapToMethod,fieldTypes);protoexp.searchAndReplaceProto(filename,JSON.parse(str),protoname,protoexp.founddef,obj,objret);}catch(e){if(typeof alert==='function'){alert(e);}\nconsole.error(\"Convert failed\",e);}}else{if(typeof alert==='function'){}\nconsole.error(\"Did not convert XML to JSON.  Oops!\");}}}catch(e){console.error(\"Failed to parse JSON in \",filename,e);}}else{console.error(\"data is undefined for file\",filename);}},doLoad:function(data,u,protoexp,done,p,obj){var name=obj[\"@name\"];var nameIndex=u.indexOf(\"#\");var protoname=name;if(nameIndex>=0){protoname=u.substring(nameIndex+1);}\ntry{protoexp.loadedProto(data,protoname,obj,u,protoexp,function(nuobject){if(typeof alert==='function'){}\ndone(p,nuobject,protoexp);});}catch(e){console.error(\"Error searching for proto\",e);}},processURLs:function(localArray,path){var url;for(url in localArray){if(localArray[url].indexOf(\"http://\")===0||localArray[url].indexOf(\"https://\")===0){}else if(localArray[url].indexOf(\"urn:web3d:media:textures/panoramas/\")===0){var ls=localArray[url].lastIndexOf(\"/\");if(ls>0){localArray[url]='examples/Basic/UniversalMediaPanoramas/'+localArray[url].substring(ls+1);}}else{var p=localArray[url].indexOf('#');var pe=path.lastIndexOf('/');var pc=path;if(pe>=0){pc=path.substring(0,pe);}\nwhile(localArray[url].startsWith(\"../\")){localArray[url]=localArray[url].substr(3);var pe=pc.lastIndexOf('/');if(pe>=0){pc=pc.substring(0,pe);}else{pc=\"\";}}\nif(p==0){localArray[url]=path+localArray[url];}else{localArray[url]=pc+\"/\"+localArray[url];}}\nvar h=localArray[url].lastIndexOf(\"#\");var hash=\"\";if(h>=0){hash=localArray[url].substring(h);localArray[url]=localArray[url].substring(0,h);}\nvar wrl=localArray[url].lastIndexOf(\".wrl\");if(wrl===localArray[url].length-4){localArray[url]=localArray[url].substring(0,wrl)+\".json\"+hash;}\nvar wrz=localArray[url].lastIndexOf(\".wrz\");if(wrz===localArray[url].length-4){localArray[url]=localArray[url].substring(0,wrz)+\".json\"+hash;}}\nreturn localArray;},loadURLs:function(loadpath,urls,loadedCallback,protoexp,done,externProtoDeclare,obj){if(typeof urls!=='undefined'){urls=this.processURLs(urls,loadpath);for(var u in urls){try{var url=urls[u];(function(url){var p=url.indexOf(\"://\");var protocol=\"file\";var host=\"localhost\";var path=\"/\"+loadpath;if(p>0){protocol=url.substring(0,p);var pa=url.indexOf(\"/\",p+3);host=url.substring(p+3,pa);path=url.substring(pa);}\nif(protocol===\"http\"){if(typeof http!=='undefined'){http.get({host:host,path:path},function(res){var data='';res.on('data',function(d){data+=d;});res.on('end',function(){loadedCallback(data,url,protoexp,done,externProtoDeclare,obj);});});}else{var request=new XMLHttpRequest();request.open('GET',url,false);request.send(null);if(request.status===200){var data=request.responseText;loadedCallback(data,url,protoexp,done,externProtoDeclare,obj);}}}else if(protocol===\"https\"){if(typeof https!=='undefined'){https.get({host:host,path:path},function(res){var data='';res.on('data',function(d){data+=d;});res.on('end',function(){loadedCallback(data,url,protoexp,done,externProtoDeclare,obj);});});}else{var request=new XMLHttpRequest();request.open('GET',url,false);request.send(null);if(request.status===200){var data=request.responseText;loadedCallback(data,url,protoexp,done,externProtoDeclare,obj);}}}else if(typeof fs!=='undefined'&&!protocol.startsWith(\"http\")){var hash=url.indexOf(\"#\");if(hash>0){url=url.substring(0,hash);}\ntry{var data=fs.readFileSync(url);loadedCallback(data.toString(),url,protoexp,done,externProtoDeclare,obj);}catch(e){var filename=url;if(filename.endsWith(\".json\")){filename=filename.substring(0,filename.lastIndexOf(\".\"))+\".x3d\";if(typeof runAndSend==='function'){runAndSend(['---silent',filename],function(jsobj){data=JSON.stringify(jsobj);loadedCallback(data,filename,protoexp,done,externProtoDeclare,obj);});}}}}else{var request=new XMLHttpRequest();request.open('GET',url,false);request.send(null);if(request.status===200){var data=request.responseText;loadedCallback(data,url,protoexp,done,externProtoDeclare,obj);}else{console.error(\"Didn't load\",url,\".  No file system or http request.\");}}})(url);}catch(e){console.error(e);}}}},load:function(p,file,object,protoexp,done){var obj=object[p];var url=obj[\"@url\"];this.loadURLs(file,url,protoexp.doLoad,protoexp,done,p,obj);},externalPrototypeExpander:function(file,object){if(typeof object===\"object\"){var newobject=null;if(Array.isArray(object)){newobject=[];}else{newobject={};}\nfor(var p in object){if(p===\"ExternProtoDeclare\"){this.load(p,file,object,this,function(p,newobj,protoexp){if(newobj!=null&&typeof newobj!='undefined'){newobject[\"ProtoDeclare\"]=protoexp.externalPrototypeExpander(file,newobj)[\"ProtoDeclare\"];}});}else{newobject[p]=this.externalPrototypeExpander(file,object[p]);}}\nvar expectedreturn=Object.keys(object).length;while(expectedreturn>Object.keys(newobject).length+1);{setTimeout(function(){},50);}\nreturn newobject;}else{return object;}}};x3dom.protoExpander=new x3dom.PROTOS();x3dom.shader={};x3dom.shader.PICKING=\"picking\";x3dom.shader.PICKING_24=\"picking24\";x3dom.shader.PICKING_ID=\"pickingId\";x3dom.shader.PICKING_COLOR=\"pickingColor\";x3dom.shader.PICKING_TEXCOORD=\"pickingTexCoord\";x3dom.shader.FRONTGROUND_TEXTURE=\"frontgroundTexture\";x3dom.shader.BACKGROUND_TEXTURE=\"backgroundTexture\";x3dom.shader.BACKGROUND_SKYTEXTURE=\"backgroundSkyTexture\";x3dom.shader.BACKGROUND_CUBETEXTURE=\"backgroundCubeTexture\";x3dom.shader.BACKGROUND_CUBETEXTURE_DDS=\"backgroundCubeTextureDDS\";x3dom.shader.BLUR=\"blur\";x3dom.shader.DEPTH=\"depth\";x3dom.shader.NORMAL=\"normal\";x3dom.shader.TEXTURE_REFINEMENT=\"textureRefinement\";x3dom.shader.SSAO=\"ssao\";x3dom.shader.material=function(){var shaderPart=\"uniform vec3  diffuseColor;\\n\"+\"uniform vec3  specularColor;\\n\"+\"uniform vec3  emissiveColor;\\n\"+\"uniform float shininess;\\n\"+\"uniform float transparency;\\n\"+\"uniform float ambientIntensity;\\n\";return shaderPart;};x3dom.shader.physicalMaterial=function(){var shaderPart=\"uniform vec3  baseColorFacor;\\n\"+\"uniform vec3  emissiveFactor;\\n\"+\"uniform float metallicFactor;\\n\"+\"uniform float roughnessFactor;\\n\";return shaderPart;};x3dom.shader.twoSidedMaterial=function(){var shaderPart=\"uniform vec3  backDiffuseColor;\\n\"+\"uniform vec3  backSpecularColor;\\n\"+\"uniform vec3  backEmissiveColor;\\n\"+\"uniform float backShininess;\\n\"+\"uniform float backTransparency;\\n\"+\"uniform float backAmbientIntensity;\\n\";return shaderPart;};x3dom.shader.fog=function(){var shaderPart=\"uniform vec3  fogColor;\\n\"+\"uniform float fogType;\\n\"+\"uniform float fogRange;\\n\"+\"varying vec3 fragEyePosition;\\n\"+\"float calcFog(in vec3 eye) {\\n\"+\"   float f0 = 0.0;\\n\"+\"   if(fogType == 0.0) {\\n\"+\"       if(length(eye) < fogRange){\\n\"+\"           f0 = (fogRange-length(eye)) / fogRange;\\n\"+\"       }\\n\"+\"   }else{\\n\"+\"       if(length(eye) < fogRange){\\n\"+\"           f0 = exp(-length(eye) / (fogRange-length(eye) ) );\\n\"+\"       }\\n\"+\"   }\\n\"+\"   f0 = clamp(f0, 0.0, 1.0);\\n\"+\"   return f0;\\n\"+\"}\\n\";return shaderPart;};x3dom.shader.clipPlanes=function(numClipPlanes){var shaderPart=\"\",c;for(c=0;c<numClipPlanes;c++){shaderPart+=\"uniform vec4 clipPlane\"+c+\"_Plane;\\n\";shaderPart+=\"uniform float clipPlane\"+c+\"_CappingStrength;\\n\";shaderPart+=\"uniform vec3 clipPlane\"+c+\"_CappingColor;\\n\";}\nshaderPart+=\"vec3 calculateClipPlanes() {\\n\";for(c=0;c<numClipPlanes;c++){shaderPart+=\"vec4 clipPlane\"+c+\";\\n\";shaderPart+=\"if(fragEyeIdx == 1.0){\\n\"\nshaderPart+=\"    clipPlane\"+c+\" = clipPlane\"+c+\"_Plane * viewMatrixInverse2;\\n\";shaderPart+=\"}else{\\n\";shaderPart+=\"    clipPlane\"+c+\" = clipPlane\"+c+\"_Plane * viewMatrixInverse;\\n\";shaderPart+=\"}\\n\";shaderPart+=\"float dist\"+c+\" = dot(fragPosition, clipPlane\"+c+\");\\n\";}\nshaderPart+=\"    if( \";for(c=0;c<numClipPlanes;c++){if(c!=0){shaderPart+=\" || \";}\nshaderPart+=\"dist\"+c+\" < 0.0\";}\nshaderPart+=\" ) \";shaderPart+=\"{ discard; }\\n\";for(c=0;c<numClipPlanes;c++){shaderPart+=\"    if( abs(dist\"+c+\") < clipPlane\"+c+\"_CappingStrength ) \";shaderPart+=\"{ return clipPlane\"+c+\"_CappingColor; }\\n\";}\nshaderPart+=\"    return vec3(-1.0, -1.0, -1.0);\\n\";shaderPart+=\"}\\n\";return shaderPart;};x3dom.shader.gammaCorrectionDecl=function(properties){var shaderPart=\"\";if(properties.GAMMACORRECTION===\"none\"){}else if(properties.GAMMACORRECTION===\"fastlinear\"){shaderPart+=\"vec4 gammaEncode(vec4 color){\\n\"+\"  vec4 tmp = sqrt(color);\\n\"+\"  return vec4(tmp.rgb, color.a);\\n\"+\"}\\n\";shaderPart+=\"vec4 gammaDecode(vec4 color){\\n\"+\"  vec4 tmp = color * color;\\n\"+\"  return vec4(tmp.rgb, color.a);\\n\"+\"}\\n\";shaderPart+=\"vec3 gammaEncode(vec3 color){\\n\"+\"  return sqrt(color);\\n\"+\"}\\n\";shaderPart+=\"vec3 gammaDecode(vec3 color){\\n\"+\"  return (color * color);\\n\"+\"}\\n\";}else{shaderPart+=\"const vec4 gammaEncode4Vector = vec4(0.4545454545454545, 0.4545454545454545, 0.4545454545454545, 1.0);\\n\";shaderPart+=\"const vec4 gammaDecode4Vector = vec4(2.2, 2.2, 2.2, 1.0);\\n\";shaderPart+=\"vec4 gammaEncode(vec4 color){\\n\"+\"    return pow(abs(color), gammaEncode4Vector);\\n\"+\"}\\n\";shaderPart+=\"vec4 gammaDecode(vec4 color){\\n\"+\"    return pow(abs(color), gammaDecode4Vector);\\n\"+\"}\\n\";shaderPart+=\"const vec3 gammaEncode3Vector = vec3(0.4545454545454545, 0.4545454545454545, 0.4545454545454545);\\n\";shaderPart+=\"const vec3 gammaDecode3Vector = vec3(2.2, 2.2, 2.2);\\n\";shaderPart+=\"vec3 gammaEncode(vec3 color){\\n\"+\"    return pow(abs(color), gammaEncode3Vector);\\n\"+\"}\\n\";shaderPart+=\"vec3 gammaDecode(vec3 color){\\n\"+\"    return pow(abs(color), gammaDecode3Vector);\\n\"+\"}\\n\";}\nreturn shaderPart;};x3dom.shader.encodeGamma=function(properties,expr){if(properties.GAMMACORRECTION===\"none\"){return expr;}else{return\"gammaEncode (\"+expr+\")\";}};x3dom.shader.decodeGamma=function(properties,expr){if(properties.GAMMACORRECTION===\"none\"){return expr;}else{return\"gammaDecode (\"+expr+\")\";}};x3dom.shader.rgbaPacking=function(){var shaderPart=\"\";shaderPart+=\"vec4 packDepth(float depth){\\n\"+\" depth = (depth + 1.0)*0.5;\\n\"+\" vec4 outVal = vec4(1.0, 255.0, 65025.0, 160581375.0) * depth;\\n\"+\" outVal = fract(outVal);\\n\"+\"   outVal -= outVal.yzww * vec4(1.0/255.0, 1.0/255.0, 1.0/255.0, 0.0);\\n\"+\"   return outVal;\\n\"+\"}\\n\";shaderPart+=\"float unpackDepth(vec4 color){\\n\"+\" float depth = dot(color, vec4(1.0, 1.0/255.0, 1.0/65025.0, 1.0/160581375.0));\\n\"+\" return (2.0*depth - 1.0);\\n\"+\"}\\n\";return shaderPart;};x3dom.shader.calcMipLevel=function(){var shaderPart=\"\";shaderPart+=\"vec2 dirToCubeUV( vec3 dir ) {\\n\"+\"    vec2 uv = vec2(0.0);\\n\"+\"    vec3 absDir = abs(dir);\\n\"+\"    if( absDir.x >= absDir.y && absDir.x >= absDir.z) {\\n\"+\"     if(dir.x < 0.0) {\\n\"+\"     uv.x = 1.0 - (((dir.z/absDir.x) + 1.0) * 0.5);\\n\"+\"     uv.y = 1.0 - (((-dir.y/absDir.x) + 1.0) * 0.5);\\n\"+\"    } else {\\n\"+\"     uv.x = 1.0 - (((-dir.z/absDir.x) + 1.0) * 0.5);\\n\"+\"     uv.y = 1.0 - (((-dir.y/absDir.x) + 1.0) * 0.5);\\n\"+\"    }\\n\"+\"   } else if( absDir.y >= absDir.x && absDir.y >= absDir.z) {\\n\"+\"    if(dir.y < 0.0) {\\n\"+\"     uv.x = ((dir.x/absDir.y) + 1.0) * 0.5;\\n\"+\"     uv.y = ((-dir.z/absDir.y) + 1.0) * 0.5;\\n\"+\"    } else {\\n\"+\"     uv.x = ((dir.x/absDir.y) + 1.0) * 0.5;\\n\"+\"     uv.y = ((dir.z/absDir.y) + 1.0) * 0.5;\\n\"+\"if(uv.y == 0.0) { uv.x = 1.0; uv.y = 0.0; }\\n\"+\"    }\\n\"+\"   } else if( absDir.z >= absDir.x && absDir.z >= absDir.y) {\\n\"+\"    if(dir.z < 0.0) {\\n\"+\"     uv.x = (((-dir.x/absDir.z) + 1.0) * 0.5);\\n\"+\"     uv.y = 1.0 - (((-dir.y/absDir.z) + 1.0) * 0.5);\\n\"+\"    } else {\\n\"+\"     uv.x = ((dir.x/absDir.z) + 1.0) * 0.5;\\n\"+\"     uv.y = 1.0 - (((-dir.y/absDir.z) + 1.0) * 0.5);\\n\"+\"    }\\n\"+\"   }\\n\"+\"   float a = pow(64.0,2.0) / pow(64.0,3.0);\\n\"+\" uv.x = a * pow(uv.x, 3.0) + uv.x;\\n\"+\" uv.y = a * pow(uv.y, 3.0) + uv.y;\\n\"+\"   return uv;\\n\"+\"}\\n\";shaderPart+=\"float calcMipLevel( vec2 uv ) {\\n\"+\" vec2  dx_vtc        = dFdx(uv) * 64.0;\\n\"+\" vec2  dy_vtc        = dFdy(uv) * 64.0;\\n\"+\" float delta_max_sqr = max(dot(dx_vtc, dx_vtc), dot(dy_vtc, dy_vtc));\\n\"+\" return 0.5 * log2(delta_max_sqr);\\n\"+\"}\\n\";shaderPart+=\"vec3 fixSeams(vec3 vec, float mipmapIndex) {\\n\"+\" float scale = 1.0 - exp2(mipmapIndex) / 64.0;\\n\"+\" float M = max(max(abs(vec.x), abs(vec.y)), abs(vec.z));\\n\"+\" if (abs(vec.x) != M) vec.x *= scale;\\n\"+\" if (abs(vec.y) != M) vec.y *= scale;\\n\"+\" if (abs(vec.z) != M) vec.z *= scale;\\n\"+\" return vec;\\n\"+\"}\"\nreturn shaderPart;};x3dom.shader.shadowRendering=function(){var shaderPart=\"\";shaderPart+=\"float getLightInfluence(float lType, float lShadowIntensity, float lOn, vec3 lLocation, vec3 lDirection, \"+\"float lCutOffAngle, float lBeamWidth, vec3 lAttenuation, float lRadius, vec3 eyeCoords) {\\n\"+\" if (lOn == 0.0 || lShadowIntensity == 0.0){ return 0.0;\\n\"+\" } else if (lType == 0.0) {\\n\"+\"  return 1.0;\\n\"+\" } else {\\n\"+\"    float attenuation = 0.0;\\n\"+\"    vec3 lightVec = (lLocation - (eyeCoords));\\n\"+\"    float distance = length(lightVec);\\n\"+\"  lightVec = normalize(lightVec);\\n\"+\"  eyeCoords = normalize(-eyeCoords);\\n\"+\"    if(lRadius == 0.0 || distance <= lRadius) {\\n\"+\"        attenuation = 1.0 / max(lAttenuation.x + lAttenuation.y * distance + lAttenuation.z * (distance * distance), 1.0);\\n\"+\"  }\\n\"+\"   if (lType == 1.0) return attenuation;\\n\"+\"    float spotAngle = acos(max(0.0, dot(-lightVec, normalize(lDirection))));\\n\"+\"    if(spotAngle >= lCutOffAngle) return 0.0;\\n\"+\"    else if(spotAngle <= lBeamWidth) return attenuation;\\n\"+\"    else return attenuation * (spotAngle - lCutOffAngle) / (lBeamWidth - lCutOffAngle);\\n\"+\" }\\n\"+\"}\\n\";shaderPart+=\"void getShadowValues(inout vec4 shadowMapValues, inout float viewSampleDepth, in mat4 lightMatrix, in vec4 worldCoords, in sampler2D shadowMap){\\n\"+\" vec4 lightSpaceCoords = lightMatrix*worldCoords;\\n\"+\" vec3 lightSpaceCoordsCart = lightSpaceCoords.xyz / lightSpaceCoords.w;\\n\"+\" vec2 textureCoords = (lightSpaceCoordsCart.xy + 1.0)*0.5;\\n\"+\" viewSampleDepth = lightSpaceCoordsCart.z;\\n\"+\" shadowMapValues = texture2D(shadowMap, textureCoords);\\n\";if(!x3dom.caps.FP_TEXTURES||x3dom.caps.MOBILE)\nshaderPart+=\" shadowMapValues = vec4(1.0,1.0,unpackDepth(shadowMapValues),1.0);\\n\";shaderPart+=\"}\\n\";shaderPart+=\"void getShadowValuesPointLight(inout vec4 shadowMapValues, inout float viewSampleDepth, in vec3 lLocation, in vec4 worldCoords, in mat4 lightViewMatrix,\"+\"in mat4 lMatrix_0, in mat4 lMatrix_1, in mat4 lMatrix_2, in mat4 lMatrix_3, in mat4 lMatrix_4, in mat4 lMatrix_5,\"+\"in sampler2D shadowMap_0, in sampler2D shadowMap_1, in sampler2D shadowMap_2, in sampler2D shadowMap_3,\"+\"in sampler2D shadowMap_4, in sampler2D shadowMap_5){\\n\"+\" vec4 transformed = lightViewMatrix * worldCoords;\\n\"+\" vec3 lightVec = normalize(transformed.xyz/transformed.w);\\n\"+\" vec3 lightVecAbs = abs(lightVec);\\n\"+\" float maximum = max(max(lightVecAbs.x, lightVecAbs.y),lightVecAbs.z);\\n\"+\" if (lightVecAbs.x == maximum) {\\n\"+\"  if (lightVec.x < 0.0) getShadowValues(shadowMapValues, viewSampleDepth, lMatrix_3,worldCoords,shadowMap_3);\\n\"+\"  else getShadowValues(shadowMapValues, viewSampleDepth, lMatrix_1,worldCoords,shadowMap_1);\\n\"+\" }\\n\"+\" else if (lightVecAbs.y == maximum) {\\n\"+\"  if (lightVec.y < 0.0) getShadowValues(shadowMapValues, viewSampleDepth, lMatrix_4,worldCoords,shadowMap_4);\\n\"+\"  else getShadowValues(shadowMapValues, viewSampleDepth, lMatrix_5,worldCoords,shadowMap_5);\\n\"+\" }\\n\"+\" else if (lightVec.z < 0.0) getShadowValues(shadowMapValues, viewSampleDepth, lMatrix_0,worldCoords,shadowMap_0);\\n\"+\" else getShadowValues(shadowMapValues, viewSampleDepth, lMatrix_2,worldCoords,shadowMap_2);\\n\"+\"}\\n\";shaderPart+=\"void getShadowValuesCascaded(inout vec4 shadowMapValues, inout float viewSampleDepth, in vec4 worldCoords, in float eyeDepth, in mat4 lMatrix_0, in mat4 lMatrix_1, in mat4 lMatrix_2,\"+\"in mat4 lMatrix_3, in mat4 lMatrix_4, in mat4 lMatrix_5, in sampler2D shadowMap_0, in sampler2D shadowMap_1, in sampler2D shadowMap_2,\"+\"in sampler2D shadowMap_3, in sampler2D shadowMap_4, in sampler2D shadowMap_5, in float split_0, in float split_1, in float split_2, in float split_3, in float split_4){\\n\"+\" if (eyeDepth < split_0) getShadowValues(shadowMapValues, viewSampleDepth, lMatrix_0, worldCoords, shadowMap_0);\\n\"+\" else if (eyeDepth < split_1) getShadowValues(shadowMapValues, viewSampleDepth, lMatrix_1, worldCoords, shadowMap_1);\\n\"+\" else if (eyeDepth < split_2) getShadowValues(shadowMapValues, viewSampleDepth, lMatrix_2, worldCoords, shadowMap_2);\\n\"+\" else if (eyeDepth < split_3) getShadowValues(shadowMapValues, viewSampleDepth, lMatrix_3, worldCoords, shadowMap_3);\\n\"+\" else if (eyeDepth < split_4) getShadowValues(shadowMapValues, viewSampleDepth, lMatrix_4, worldCoords, shadowMap_4);\\n\"+\" else getShadowValues(shadowMapValues, viewSampleDepth, lMatrix_5, worldCoords, shadowMap_5);\\n\"+\"}\\n\";shaderPart+=\"float ESM(float shadowMapDepth, float viewSampleDepth, float offset){\\n\";if(!x3dom.caps.FP_TEXTURES||x3dom.caps.MOBILE)\nshaderPart+=\" return exp(-80.0*(1.0-offset)*(viewSampleDepth - shadowMapDepth));\\n\";else shaderPart+=\" return shadowMapDepth * exp(-80.0*(1.0-offset)*viewSampleDepth);\\n\";shaderPart+=\"}\\n\";shaderPart+=\"float VSM(vec2 moments, float viewSampleDepth, float offset){\\n\"+\" viewSampleDepth = (viewSampleDepth + 1.0) * 0.5;\\n\"+\" if (viewSampleDepth <= moments.x) return 1.0;\\n\"+\" float variance = moments.y - moments.x * moments.x;\\n\"+\" variance = max(variance, 0.00002 + offset*0.01);\\n\"+\" float d = viewSampleDepth - moments.x;\\n\"+\" return variance/(variance + d*d);\\n\"+\"}\\n\";return shaderPart;};x3dom.shader.light=function(numLights){var shaderPart=\"\";for(var l=0;l<numLights;l++){shaderPart+=\"uniform float light\"+l+\"_On;\\n\"+\"uniform float light\"+l+\"_Type;\\n\"+\"uniform vec3  light\"+l+\"_Location;\\n\"+\"uniform vec3  light\"+l+\"_Direction;\\n\"+\"uniform vec3  light\"+l+\"_Color;\\n\"+\"uniform vec3  light\"+l+\"_Attenuation;\\n\"+\"uniform float light\"+l+\"_Radius;\\n\"+\"uniform float light\"+l+\"_Intensity;\\n\"+\"uniform float light\"+l+\"_AmbientIntensity;\\n\"+\"uniform float light\"+l+\"_BeamWidth;\\n\"+\"uniform float light\"+l+\"_CutOffAngle;\\n\"+\"uniform float light\"+l+\"_ShadowIntensity;\\n\";}\nshaderPart+=\"void lighting(in float lType, in vec3 lLocation, in vec3 lDirection, in vec3 lColor, in vec3 lAttenuation, \"+\"in float lRadius, in float lIntensity, in float lAmbientIntensity, in float lBeamWidth, \"+\"in float lCutOffAngle, in vec3 positionVS, in vec3 N, in vec3 V, float shin, float ambIntensity, vec3 reflectivity, \"+\"inout vec3 ambient, inout vec3 diffuse, inout vec3 specular)\\n\"+\"{\\n\"+\"   vec3 L;\\n\"+\"   float spot = 1.0, attentuation = 0.0;\\n\"+\"   if(lType == 0.0) {\\n\"+\"       L = -normalize(lDirection);\\n\"+\"  V = normalize(V);\\n\"+\"  attentuation = 1.0;\\n\"+\"   } else{\\n\"+\"       L = (lLocation - (-V));\\n\"+\"       float d = length(L);\\n\"+\"  L = normalize(L);\\n\"+\"  V = normalize(V);\\n\"+\"       if(lRadius == 0.0 || d <= lRadius) {\\n\"+\"        attentuation = 1.0 / max(lAttenuation.x + lAttenuation.y * d + lAttenuation.z * (d * d), 1.0);\\n\"+\"  }\\n\"+\"       if(lType == 2.0) {\\n\"+\"           float spotAngle = acos(max(0.0, dot(-L, normalize(lDirection))));\\n\"+\"           if(spotAngle >= lCutOffAngle) spot = 0.0;\\n\"+\"           else if(spotAngle <= lBeamWidth) spot = 1.0;\\n\"+\"           else spot = (spotAngle - lCutOffAngle ) / (lBeamWidth - lCutOffAngle);\\n\"+\"       }\\n\"+\"   }\\n\"+\"   vec3  H = normalize( L + V );\\n\"+\"   float NdotL = clamp(dot(L, N), 0.0, 1.0);\\n\"+\"   float NdotH = clamp(dot(H, N), 0.0, 1.0);\\n\"+\"   float ambientFactor  = lAmbientIntensity * ambIntensity;\\n\"+\"   float diffuseFactor  = lIntensity * NdotL;\\n\"+\"   float specularFactor = lIntensity * pow(NdotH, shin*128.0);\\n\"+\"   ambient  += lColor * ambientFactor * attentuation * spot;\\n\"+\"   diffuse  += lColor * diffuseFactor * attentuation * spot;\\n\"+\"   specular += lColor * specularFactor * attentuation * spot;\\n\"+\"}\\n\";return shaderPart;};x3dom.shader.lightPBR=function(numLights){var shaderPart=\"\";for(var l=0;l<numLights;l++){shaderPart+=\"uniform float light\"+l+\"_On;\\n\"+\"uniform float light\"+l+\"_Type;\\n\"+\"uniform vec3  light\"+l+\"_Location;\\n\"+\"uniform vec3  light\"+l+\"_Direction;\\n\"+\"uniform vec3  light\"+l+\"_Color;\\n\"+\"uniform vec3  light\"+l+\"_Attenuation;\\n\"+\"uniform float light\"+l+\"_Radius;\\n\"+\"uniform float light\"+l+\"_Intensity;\\n\"+\"uniform float light\"+l+\"_AmbientIntensity;\\n\"+\"uniform float light\"+l+\"_BeamWidth;\\n\"+\"uniform float light\"+l+\"_CutOffAngle;\\n\"+\"uniform float light\"+l+\"_ShadowIntensity;\\n\";}\nshaderPart+=\"void lighting(in float lType, in vec3 lLocation, in vec3 lDirection, in vec3 lColor, in vec3 lAttenuation, \"+\"in float lRadius, in float lIntensity, in float lAmbientIntensity, in float lBeamWidth, \"+\"in float lCutOffAngle, in vec3 positionVS, in vec3 N, in vec3 V, float shin, float ambIntensity, vec3 reflectivity, \"+\"inout vec3 ambient, inout vec3 diffuse, inout vec3 specular)\\n\"+\"{\\n\"+\"   vec3 L;\\n\"+\"   float spot = 1.0, attentuation = 0.0;\\n\"+\"   if(lType == 0.0) {\\n\"+\"       L = -normalize(lDirection);\\n\"+\"  V = normalize(V);\\n\"+\"  attentuation = 1.0;\\n\"+\"   } else{\\n\"+\"       L = (lLocation - (-V));\\n\"+\"       float d = length(L);\\n\"+\"  L = normalize(L);\\n\"+\"  V = normalize(V);\\n\"+\"       if(lRadius == 0.0 || d <= lRadius) {\\n\"+\"        attentuation = 1.0 / max(lAttenuation.x + lAttenuation.y * d + lAttenuation.z * (d * d), 1.0);\\n\"+\"  }\\n\"+\"       if(lType == 2.0) {\\n\"+\"           float spotAngle = acos(max(0.0, dot(-L, normalize(lDirection))));\\n\"+\"           if(spotAngle >= lCutOffAngle) spot = 0.0;\\n\"+\"           else if(spotAngle <= lBeamWidth) spot = 1.0;\\n\"+\"           else spot = (spotAngle - lCutOffAngle ) / (lBeamWidth - lCutOffAngle);\\n\"+\"       }\\n\"+\"   }\\n\"+\"   vec3  fresnel = vec3(1.0, 1.0, 1.0);\\n\"+\"   vec3  H = normalize( L + V );\\n\"+\"   float NoL = clamp( dot( N, L ), 0.0, 1.0 );\\n\"+\"   float NoH = clamp( dot( N, H ), 0.0, 1.0 );\\n\"+\"   float NoV = clamp( dot( N, V ), 0.0, 1.0 );\\n\"+\"   float VoH = clamp( dot( V, H ), 0.0, 1.0 );\\n\"+\"   float ambientFactor  = lAmbientIntensity * ambIntensity;\\n\"+\"   float diffuseFactor  = lIntensity * NoL;\\n\"+\"   float spec  = lIntensity * NoL;\\n\"+\"   float roughness = 1.0 - shin;\\n\"+\"   float a = max( roughness * roughness, 5e-4 );\\n\"+\"   float a2 = a * a;\\n\"+\"   float denom = NoH * NoH * ( a2 - 1.0 ) + 1.0;\\n\"+\"   float D = a2 / ( denom * denom );\\n\"+\"   float k = a / 2.0;\\n\"+\"   float G_V = ( NoV * ( 1.0 - k ) + k );\\n\"+\"   float G_L = ( NoL * ( 1.0 - k ) + k );\\n\"+\"   float G = 0.25 / ( G_V * G_L );\\n\"+\"   vec3 F = reflectivity + (fresnel - fresnel*reflectivity) * exp2( (-5.55473 * VoH - 6.98316) * VoH );\\n\"+\"   vec3 specularFactor = (D * G) * (F * spec);\\n\"+\"   ambient  += lColor * ambientFactor * attentuation * spot;\\n\"+\"   diffuse  += lColor * diffuseFactor * attentuation * spot;\\n\"+\"   specular += lColor * specularFactor * attentuation * spot;\\n\"+\"}\\n\";return shaderPart;};x3dom.shader.TBNCalculation=function(){var shaderPart=\"\";shaderPart+=\"mat3 cotangent_frame(vec3 N, vec3 p, vec2 uv)\\n\"+\"{\\n\"+\"    // get edge vectors of the pixel triangle\\n\"+\"    vec3 dp1 = dFdx( p );\\n\"+\"    vec3 dp2 = dFdy( p );\\n\"+\"    vec2 duv1 = dFdx( uv );\\n\"+\"    vec2 duv2 = dFdy( uv );\\n\"+\"\\n\"+\"    // solve the linear system\\n\"+\"    vec3 dp2perp = cross( dp2, N );\\n\"+\"    vec3 dp1perp = cross( N, dp1 );\\n\"+\"    vec3 T = dp2perp * duv1.x + dp1perp * duv2.x;\\n\"+\"    vec3 B = dp2perp * duv1.y + dp1perp * duv2.y;\\n\"+\"\\n\"+\"    // construct a scale-invariant frame\\n\"+\"    float invmax = inversesqrt( max( dot(T,T), dot(B,B) ) );\\n\"+\"    return mat3( T * invmax, B * invmax, N );\\n\"+\"}\\n\\n\";shaderPart+=\"vec3 perturb_normal( vec3 N, vec3 V, vec2 texcoord, vec3 bias )\\n\"+\"{\\n\"+\"    // assume N, the interpolated vertex normal and\\n\"+\"    // V, the view vector (vertex to eye)\\n\"+\"    vec3 map = texture2D(normalMap, texcoord ).xyz;\\n\"+\"    map = 2.0 * map - 1.0;\\n\"+\"    map = map * bias;\\n\"+\"    mat3 TBN = cotangent_frame(N, -V, texcoord);\\n\"+\"    return normalize(TBN * map);\\n\"+\"}\\n\\n\";return shaderPart;};x3dom.shader.toneMapping=function(){var shaderPart=\"\";shaderPart+=\"uniform float tonemappingOperator;\\n\";shaderPart+=\"vec3 tonemapReinhard(vec3 color) { \\n\"+\" return color / (color + vec3(1.0));\\n\"+\"}\\n\\n\";shaderPart+=\"vec3 uncharted2Tonemap(vec3 color) { \\n\"+\" float A = 0.15;\\n\"+\" float B = 0.50;\\n\"+\" float C = 0.10;\\n\"+\" float D = 0.20;\\n\"+\" float E = 0.02;\\n\"+\" float F = 0.30;\\n\"+\" return ((color*(A*color+C*B)+D*E)/(color*(A*color+B)+D*F))-E/F;\\n\"+\"}\\n\\n\";shaderPart+=\"vec3 tonemapUncharted2(vec3 color) { \\n\"+\" float W = 11.2;\\n\"+\"   float exposureBias = 2.0;\\n\"+\" vec3 curr = uncharted2Tonemap(exposureBias * color);\\n\"+\" vec3 whiteScale = 1.0 / uncharted2Tonemap(vec3(W));\\n\"+\" return curr * whiteScale;\\n\"+\"}\\n\\n\";shaderPart+=\"vec3 tonemapeFilmic(vec3 color) { \\n\"+\" const float a = 2.51;\\n\"+\" const float b = 0.03;\\n\"+\" const float c = 2.43;\\n\"+\" const float d = 0.59;\\n\"+\" const float e = 0.14;\\n\"+\" return clamp((color * (a * color + b)) / (color * (c * color + d ) + e), 0.0, 1.0);\\n\"+\"}\\n\\n\";shaderPart+=\"vec3 tonemap(vec3 color) { \\n\"+\" if(tonemappingOperator == 0.0) {\\n\"+\"    return color;\\n\"+\" }\\n\"+\" if(tonemappingOperator == 1.0) {\\n\"+\"    return tonemapReinhard(color);\\n\"+\" }\\n\"+\" if(tonemappingOperator == 2.0) {\\n\"+\"    return tonemapUncharted2(color);\\n\"+\" }\\n\"+\" if(tonemappingOperator == 3.0) {\\n\"+\"    return tonemapeFilmic(color);\\n\"+\" }\\n\"+\"}\\n\\n\";return shaderPart;};x3dom.shader.DynamicShader=function(gl,properties)\n{this.program=gl.createProgram();var vertexShader=this.generateVertexShader(gl,properties,x3dom.caps.WEBGL_VERSION);var fragmentShader=this.generateFragmentShader(gl,properties,x3dom.caps.WEBGL_VERSION);gl.attachShader(this.program,vertexShader);gl.attachShader(this.program,fragmentShader);gl.bindAttribLocation(this.program,0,\"position\");gl.linkProgram(this.program);return this.program;};x3dom.shader.DynamicShader.prototype.generateVertexShader=function(gl,properties,version)\n{var shader=\"\";shader+=\"uniform mat4 modelMatrix;\\n\";shader+=\"uniform mat4 modelViewMatrix;\\n\";shader+=\"uniform mat4 modelViewProjectionMatrix;\\n\";shader+=\"uniform mat4 modelViewMatrix2;\\n\";shader+=\"uniform mat4 modelViewProjectionMatrix2;\\n\";shader+=\"uniform float isVR;\\n\";shader+=\"attribute float eyeIdx;\\n\";shader+=\"varying float vrOffset;\\n\";shader+=\"varying float fragEyeIdx;\\n\";if(properties.POSCOMPONENTS==3){shader+=\"attribute vec3 position;\\n\";}else if(properties.POSCOMPONENTS==4){shader+=\"attribute vec4 position;\\n\";}\nif(properties.IMAGEGEOMETRY){shader+=\"uniform vec3 IG_bboxMin;\\n\";shader+=\"uniform vec3 IG_bboxMax;\\n\";shader+=\"uniform float IG_coordTextureWidth;\\n\";shader+=\"uniform float IG_coordTextureHeight;\\n\";shader+=\"uniform vec2 IG_implicitMeshSize;\\n\";for(var i=0;i<properties.IG_PRECISION;i++){shader+=\"uniform sampler2D IG_coords\"+i+\"\\n;\";}\nif(properties.IG_INDEXED){shader+=\"uniform sampler2D IG_index;\\n\";shader+=\"uniform float IG_indexTextureWidth;\\n\";shader+=\"uniform float IG_indexTextureHeight;\\n\";}}\nif(properties.POPGEOMETRY){shader+=\"uniform float PG_precisionLevel;\\n\";shader+=\"uniform float PG_powPrecision;\\n\";shader+=\"uniform vec3 PG_maxBBSize;\\n\";shader+=\"uniform vec3 PG_bbMin;\\n\";shader+=\"uniform vec3 PG_bbMaxModF;\\n\";shader+=\"uniform vec3 PG_bboxShiftVec;\\n\";shader+=\"uniform float PG_numAnchorVertices;\\n\";shader+=\"attribute float PG_vertexID;\\n\";}\nif(properties.LIGHTS||properties.PBR_MATERIAL){if(properties.NORMALMAP&&properties.NORMALSPACE==\"OBJECT\"){}else{shader+=\"varying vec3 fragNormal;\\n\";shader+=\"uniform mat4 normalMatrix;\\n\";shader+=\"uniform mat4 normalMatrix2;\\n\";if(properties.IMAGEGEOMETRY){shader+=\"uniform sampler2D IG_normals;\\n\";}else{if(properties.NORCOMPONENTS==2){if(properties.POSCOMPONENTS!=4){shader+=\"attribute vec2 normal;\\n\";}}else if(properties.NORCOMPONENTS==3){shader+=\"attribute vec3 normal;\\n\";}}}}\nif(properties.VERTEXCOLOR){if(properties.IMAGEGEOMETRY){shader+=\"uniform sampler2D IG_colors;\\n\";if(properties.COLCOMPONENTS==3){shader+=\"varying vec3 fragColor;\\n\";}else if(properties.COLCOMPONENTS==4){shader+=\"varying vec4 fragColor;\\n\";}}else{if(properties.COLCOMPONENTS==3){shader+=\"attribute vec3 color;\\n\";shader+=\"varying vec3 fragColor;\\n\";}else if(properties.COLCOMPONENTS==4){shader+=\"attribute vec4 color;\\n\";shader+=\"varying vec4 fragColor;\\n\";}}}\nif(properties.TEXTURED){shader+=\"varying vec2 fragTexcoord;\\n\";if(properties.MULTITEXCOORD)\n{shader+=\"varying vec2 fragTexcoord2;\\n\";}\nif(!properties.SPHEREMAPPING){if(properties.IMAGEGEOMETRY){shader+=\"uniform sampler2D IG_texCoords;\\n\";}else if(!properties.IS_PARTICLE){shader+=\"attribute vec2 texcoord;\\n\";if(properties.MULTITEXCOORD)\n{shader+=\"attribute vec2 texcoord2;\\n\";}}}\nif(properties.TEXTRAFO){shader+=\"uniform mat4 texTrafoMatrix;\\n\";}\nif(properties.NORMALMAP&&properties.NORMALSPACE==\"TANGENT\"){if(!properties.TANGENTDATA&&!x3dom.caps.STD_DERIVATIVES)\n{x3dom.debug.logWarning(\"Your System doesn't support the 'OES_STANDARD_DERIVATIVES' Extension. \"+\"You must set tangents and binormals manually via the FloatVertexAttribute-Node \"+\"to use normal maps\");}\nshader+=\"attribute vec3 tangent;\\n\";shader+=\"attribute vec3 binormal;\\n\";shader+=\"varying vec3 fragTangent;\\n\";shader+=\"varying vec3 fragBinormal;\\n\";}\nif(properties.DISPLACEMENTMAP){shader+=\"uniform sampler2D displacementMap;\\n\";shader+=\"uniform float displacementFactor;\\n\";shader+=\"uniform float displacementWidth;\\n\";shader+=\"uniform float displacementHeight;\\n\";shader+=\"uniform float displacementAxis;\\n\";}\nif(properties.DIFFPLACEMENTMAP){shader+=\"uniform sampler2D diffuseDisplacementMap;\\n\";shader+=\"uniform float displacementFactor;\\n\";shader+=\"uniform float displacementWidth;\\n\";shader+=\"uniform float displacementHeight;\\n\";shader+=\"uniform float displacementAxis;\\n\";}}\nif(properties.CUBEMAP||properties.PBR_MATERIAL){shader+=\"varying vec3 fragViewDir;\\n\";shader+=\"uniform mat4 viewMatrix;\\n\";shader+=\"uniform mat4 viewMatrix2;\\n\";}\nif(properties.VERTEXID){shader+=\"attribute float id;\\n\";shader+=\"varying float fragID;\\n\";}\nif(properties.IS_PARTICLE){shader+=\"attribute vec3 particleSize;\\n\";}\nif(properties.LIGHTS||properties.FOG||properties.CLIPPLANES){shader+=\"uniform vec3 eyePosition;\\n\";shader+=\"varying vec4 fragPosition;\\n\";shader+=\"varying vec4 fragPositionWS;\\n\";if(properties.FOG){shader+=\"varying vec3 fragEyePosition;\\n\";}}\nif(properties.REQUIREBBOX){shader+=\"uniform vec3 bgCenter;\\n\";shader+=\"uniform vec3 bgSize;\\n\";shader+=\"uniform float bgPrecisionMax;\\n\";}\nif(properties.REQUIREBBOXNOR){shader+=\"uniform float bgPrecisionNorMax;\\n\";}\nif(properties.REQUIREBBOXCOL){shader+=\"uniform float bgPrecisionColMax;\\n\";}\nif(properties.REQUIREBBOXTEX){shader+=\"uniform float bgPrecisionTexMax;\\n\";}\nshader+=\"void main(void) {\\n\";shader+=\"mat4 mat_mvp = modelViewProjectionMatrix;\\n\"\nshader+=\"mat4 mat_mv  = modelViewMatrix;\\n\"\nshader+=\"fragEyeIdx = eyeIdx;\\n\";if(properties.CUBEMAP||properties.PBR_MATERIAL){shader+=\"mat4 mat_v   = viewMatrix;\\n\"}\nif(properties.LIGHTS||properties.PBR_MATERIAL)\n{if(properties.NORMALMAP&&properties.NORMALSPACE==\"OBJECT\"){}\nelse\n{shader+=\"mat4 mat_n   = normalMatrix;\\n\"}}\nshader+=\"if(eyeIdx == 1.0){\\n\"\nshader+=\"    mat_mvp = modelViewProjectionMatrix2;\\n\";if(properties.CUBEMAP||properties.PBR_MATERIAL){shader+=\"    mat_v   = viewMatrix2;\\n\";}\nif(properties.LIGHTS||properties.PBR_MATERIAL)\n{if(properties.NORMALMAP&&properties.NORMALSPACE==\"OBJECT\"){}\nelse\n{shader+=\"mat4 mat_n   = normalMatrix2;\\n\"}}\nshader+=\"}\\n\";if(properties.IMAGEGEOMETRY){if(properties.IG_INDEXED){shader+=\"vec2 halfPixel = vec2(0.5/IG_indexTextureWidth,0.5/IG_indexTextureHeight);\\n\";shader+=\"vec2 IG_texCoord = vec2(position.x*(IG_implicitMeshSize.x/IG_indexTextureWidth), position.y*(IG_implicitMeshSize.y/IG_indexTextureHeight)) + halfPixel;\\n\";shader+=\"vec2 IG_indices = texture2D( IG_index, IG_texCoord ).rg;\\n\";shader+=\"halfPixel = vec2(0.5/IG_coordTextureWidth,0.5/IG_coordTextureHeight);\\n\";shader+=\"IG_texCoord = (IG_indices * 0.996108948) + halfPixel;\\n\";}else{shader+=\"vec2 halfPixel = vec2(0.5/IG_coordTextureWidth, 0.5/IG_coordTextureHeight);\\n\";shader+=\"vec2 IG_texCoord = vec2(position.x*(IG_implicitMeshSize.x/IG_coordTextureWidth), position.y*(IG_implicitMeshSize.y/IG_coordTextureHeight)) + halfPixel;\\n\";}\nshader+=\"vec3 temp = vec3(0.0, 0.0, 0.0);\\n\";shader+=\"vec3 vertPosition = vec3(0.0, 0.0, 0.0);\\n\";for(var i=0;i<properties.IG_PRECISION;i++){shader+=\"temp = 255.0 * texture2D( IG_coords\"+i+\", IG_texCoord ).rgb;\\n\";shader+=\"vertPosition *= 256.0;\\n\";shader+=\"vertPosition += temp;\\n\";}\nshader+=\"vertPosition /= (pow(2.0, 8.0 * \"+properties.IG_PRECISION+\".0) - 1.0);\\n\";shader+=\"vertPosition = vertPosition * (IG_bboxMax - IG_bboxMin) + IG_bboxMin;\\n\";if(properties.LIGHTS){shader+=\"vec3 vertNormal = texture2D( IG_normals, IG_texCoord ).rgb;\\n\";shader+=\"vertNormal = vertNormal * 2.0 - 1.0;\\n\";}\nif(properties.VERTEXCOLOR){if(properties.COLCOMPONENTS==3){shader+=\"fragColor = texture2D( IG_colors, IG_texCoord ).rgb;\\n\";}else if(properties.COLCOMPONENTS==4){shader+=\"fragColor = texture2D( IG_colors, IG_texCoord ).rgba;\\n\";}}\nif(properties.TEXTURED){shader+=\"vec4 IG_doubleTexCoords = texture2D( IG_texCoords, IG_texCoord );\\n\";shader+=\"vec2 vertTexCoord;\";shader+=\"vertTexCoord.r = (IG_doubleTexCoords.r * 0.996108948) + (IG_doubleTexCoords.b * 0.003891051);\\n\";shader+=\"vertTexCoord.g = (IG_doubleTexCoords.g * 0.996108948) + (IG_doubleTexCoords.a * 0.003891051);\\n\";}}else{shader+=\"vec3 vertPosition = position.xyz;\\n\";if(properties.POPGEOMETRY){shader+=\"vec3 offsetVec = step(vertPosition / bgPrecisionMax, PG_bbMaxModF) * PG_bboxShiftVec;\\n\";shader+=\"if ((PG_precisionLevel <= 2.0) || PG_vertexID >= PG_numAnchorVertices) {\\n\";shader+=\"   vertPosition = floor(vertPosition / PG_powPrecision) * PG_powPrecision;\\n\";shader+=\"   vertPosition /= (65536.0 - PG_powPrecision);\\n\";shader+=\"}\\n\";shader+=\"else {\\n\";shader+=\"   vertPosition /= bgPrecisionMax;\\n\";shader+=\"}\\n\";shader+=\"vertPosition = (vertPosition + offsetVec + PG_bbMin) * PG_maxBBSize;\\n\";}\nelse if(properties.REQUIREBBOX){shader+=\"vertPosition = bgCenter + bgSize * vertPosition / bgPrecisionMax;\\n\";}\nif(properties.LIGHTS){if(properties.NORCOMPONENTS==2){if(properties.POSCOMPONENTS==4){shader+=\"vec3 vertNormal = vec3(position.w / 256.0); \\n\";shader+=\"vertNormal.x = floor(vertNormal.x) / 255.0; \\n\";shader+=\"vertNormal.y = fract(vertNormal.y) * 1.00392156862745; \\n\";}\nelse if(properties.REQUIREBBOXNOR){shader+=\"vec3 vertNormal = vec3(normal.xy, 0.0) / bgPrecisionNorMax;\\n\";}\nshader+=\"vec2 thetaPhi = 3.14159265358979 * vec2(vertNormal.x, vertNormal.y*2.0-1.0); \\n\";shader+=\"vec4 sinCosThetaPhi = sin( vec4(thetaPhi, thetaPhi + 1.5707963267949) ); \\n\";shader+=\"vertNormal.x = sinCosThetaPhi.x * sinCosThetaPhi.w; \\n\";shader+=\"vertNormal.y = sinCosThetaPhi.x * sinCosThetaPhi.y; \\n\";shader+=\"vertNormal.z = sinCosThetaPhi.z; \\n\";}else{if(properties.NORMALMAP&&properties.NORMALSPACE==\"OBJECT\"){}else{shader+=\"vec3 vertNormal = normal;\\n\";if(properties.REQUIREBBOXNOR){shader+=\"vertNormal = vertNormal / bgPrecisionNorMax;\\n\";}\nif(properties.POPGEOMETRY){shader+=\"vertNormal = 2.0*vertNormal - 1.0;\\n\";}}}}\nif(properties.VERTEXCOLOR){shader+=\"fragColor = color;\\n\";if(properties.REQUIREBBOXCOL){shader+=\"fragColor = fragColor / bgPrecisionColMax;\\n\";}}\nif((properties.TEXTURED)&&!properties.SPHEREMAPPING){if(properties.IS_PARTICLE){shader+=\"vec2 vertTexCoord = vec2(0.0);\\n\";}\nelse{shader+=\"vec2 vertTexCoord = texcoord;\\n\";if(properties.MULTITEXCOORD)\n{shader+=\"vec2 vertTexCoord2 = texcoord2;\\n\";}\nif(properties.REQUIREBBOXTEX){shader+=\"vertTexCoord = vertTexCoord / bgPrecisionTexMax;\\n\";}}}}\nif(properties.LIGHTS){if((properties.DISPLACEMENTMAP||properties.DIFFPLACEMENTMAP)&&!properties.NORMALMAP){shader+=\"float dx = 1.0 / displacementWidth;\\n\";shader+=\"float dy = 1.0 / displacementHeight;\\n\";if(properties.DISPLACEMENTMAP)\n{shader+=\"float s1 = texture2D(displacementMap, vec2(vertTexCoord.x - dx, 1.0 - vertTexCoord.y)).r;\\n\";shader+=\"float s2 = texture2D(displacementMap, vec2(vertTexCoord.x, 1.0 - vertTexCoord.y - dy)).r;\\n\";shader+=\"float s3 = texture2D(displacementMap, vec2(vertTexCoord.x + dx, 1.0 - vertTexCoord.y)).r;\\n\";shader+=\"float s4 = texture2D(displacementMap, vec2(vertTexCoord.x, 1.0 - vertTexCoord.y + dy)).r;\\n\";}\nelse if(properties.DIFFPLACEMENTMAP)\n{shader+=\"float s1 = texture2D(diffuseDisplacementMap, vec2(vertTexCoord.x - dx, 1.0 - vertTexCoord.y)).a;\\n\";shader+=\"float s2 = texture2D(diffuseDisplacementMap, vec2(vertTexCoord.x, 1.0 - vertTexCoord.y - dy)).a;\\n\";shader+=\"float s3 = texture2D(diffuseDisplacementMap, vec2(vertTexCoord.x + dx, 1.0 - vertTexCoord.y)).a;\\n\";shader+=\"float s4 = texture2D(diffuseDisplacementMap, vec2(vertTexCoord.x, 1.0 - vertTexCoord.y + dy)).a;\\n\";}\nshader+=\"float coef = displacementFactor;\\n\";shader+=\"vec3 calcNormal;\\n\";shader+=\"if (displacementAxis == 0.0) {\\n\";shader+=\"calcNormal = vec3((s1 - s3) * coef, -5.0, (s2 - s4) * coef);\\n\";shader+=\"} else if(displacementAxis == 1.0) {\\n\";shader+=\"calcNormal = vec3((s1 - s3) * coef, -5.0, (s2 - s4) * coef);\\n\";shader+=\"} else {\\n\";shader+=\"calcNormal = vec3((s1 - s3) * coef, -(s2 - s4) * coef, 5.0);\\n\";shader+=\"}\\n\";shader+=\"calcNormal = normalize(calcNormal);\\n\";shader+=\"fragNormal = (mat_n * vec4(calcNormal, 0.0)).xyz;\\n\";}\nelse if(properties.NORMALMAP&&properties.NORMALSPACE==\"OBJECT\"){}\nelse\n{shader+=\"fragNormal = (mat_n * vec4(vertNormal, 0.0)).xyz;\\n\";}}\nif(properties.CUBEMAP||properties.PBR_MATERIAL){shader+=\"fragViewDir = (mat_v[3].xyz);\\n\";}\nif(properties.TEXTURED){if(properties.SPHEREMAPPING){shader+=\" fragTexcoord = 0.5 + fragNormal.xy / 2.0;\\n\";if(properties.TEXTRAFO){shader+=\" fragTexcoord = (texTrafoMatrix * vec4(fragTexcoord, 1.0, 1.0)).xy;\\n\";}}else if(properties.TEXTRAFO){shader+=\" fragTexcoord = (texTrafoMatrix * vec4(vertTexCoord, 1.0, 1.0)).xy;\\n\";}else{shader+=\" fragTexcoord = vertTexCoord;\\n\";if(properties.MULTITEXCOORD)\n{shader+=\" fragTexcoord2 = vertTexCoord2;\\n\";}\nif(properties.POPGEOMETRY&&x3dom.debug.usePrecisionLevelAsTexCoord===true)\nshader+=\"fragTexcoord = vec2(0.03125 + 0.9375 * (PG_precisionLevel / 16.0), 1.0);\";}\nif(properties.NORMALMAP&&properties.NORMALSPACE==\"TANGENT\"){if(properties.TANGENTDATA)\n{shader+=\"fragTangent  = (mat_n * vec4(tangent, 0.0)).xyz;\\n\";shader+=\"fragBinormal = (mat_n * vec4(binormal, 0.0)).xyz;\\n\";}}}\nif(properties.LIGHTS||properties.FOG||properties.CLIPPLANES){shader+=\"fragPosition = (mat_mv * vec4(vertPosition, 1.0));\\n\";shader+=\"fragPositionWS = (modelMatrix * vec4(vertPosition, 1.0));\\n\";if(properties.FOG){shader+=\"fragEyePosition = eyePosition - fragPosition.xyz;\\n\";}}\nif(properties.MULTIDIFFALPMAP){shader+=\"fragID = id;\\n\";}\nif(properties.DISPLACEMENTMAP){shader+=\"vertPosition += normalize(vertNormal) * texture2D(displacementMap, vec2(fragTexcoord.x, 1.0-fragTexcoord.y)).r * displacementFactor;\\n\";}\nelse if(properties.DIFFPLACEMENTMAP)\n{shader+=\"vertPosition += normalize(vertNormal) * texture2D(diffuseDisplacementMap, vec2(fragTexcoord.x, 1.0-fragTexcoord.y)).a * displacementFactor;\\n\";}\nshader+=\"gl_Position = mat_mvp * vec4(vertPosition, 1.0);\\n\";shader+=\"if(isVR == 1.0){\\n\";shader+=\"    vrOffset = eyeIdx * 0.5;\\n\";shader+=\"    gl_Position.x *= 0.5;\\n\";shader+=\"    gl_Position.x += vrOffset * gl_Position.w;\\n\";shader+=\"}\\n\";if(properties.IS_PARTICLE){shader+=\"float spriteDist = (gl_Position.w > 0.000001) ? gl_Position.w : 0.000001;\\n\";shader+=\"float pointSize = floor(length(particleSize) * 256.0 / spriteDist + 0.5);\\n\";shader+=\"gl_PointSize = clamp(pointSize, 2.0, 256.0);\\n\";}\nelse{shader+=\"gl_PointSize = 2.0;\\n\";}\nshader+=\"}\\n\";if(version==2)\n{shader=x3dom.shader.convertVertexShader(shader);}\nvar vertexShader=gl.createShader(gl.VERTEX_SHADER);gl.shaderSource(vertexShader,shader);gl.compileShader(vertexShader);if(!gl.getShaderParameter(vertexShader,gl.COMPILE_STATUS)){x3dom.debug.logInfo(\"VERTEX:\\n\"+shader);x3dom.debug.logError(\"VertexShader \"+gl.getShaderInfoLog(vertexShader));}\nreturn vertexShader;};x3dom.shader.DynamicShader.prototype.generateFragmentShader=function(gl,properties,version)\n{var shader=\"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n\";shader+=\" precision highp float;\\n\";shader+=\"#else\\n\";shader+=\" precision mediump float;\\n\";shader+=\"#endif\\n\\n\";if(properties.PBR_MATERIAL&&x3dom.caps.TEXTURE_LOD)\n{shader+=\"#extension GL_EXT_shader_texture_lod : enable\\n\";}\nif((properties.PBR_MATERIAL||properties.NORMALMAP)&&x3dom.caps.STD_DERIVATIVES)\n{shader+=\"#extension GL_OES_standard_derivatives:enable\\n\";}\nshader+=\"//@insertFragColor\\n\";shader+=\"uniform float isVR;\\n\";shader+=\"varying float vrOffset;\\n\";shader+=\"varying float fragEyeIdx;\\n\";shader+=\"uniform float screenWidth;\\n\";shader+=\"uniform vec3 cameraPosWS;\\n\";shader+=\"uniform float alphaCutoff;\\n\";shader+=x3dom.shader.material();shader+=x3dom.shader.toneMapping()\nif(properties.PBR_MATERIAL&&!x3dom.caps.TEXTURE_LOD&&x3dom.caps.WEBGL_VERSION==1)\n{shader+=x3dom.shader.calcMipLevel();}\nif(properties.TWOSIDEDMAT){shader+=x3dom.shader.twoSidedMaterial();}\nif(properties.PBR_MATERIAL)\n{if(properties.ISROUGHNESSMETALLIC)\n{shader+=\"uniform float metallicFactor;\\n\";}\nshader+=\"uniform sampler2D brdfMap;\\n\";shader+=\"uniform samplerCube diffuseEnvironmentMap;\\n\";shader+=\"uniform samplerCube specularEnvironmentMap;\\n\";}\nif(properties.VERTEXCOLOR){if(properties.COLCOMPONENTS==3){shader+=\"varying vec3 fragColor;  \\n\";}else if(properties.COLCOMPONENTS==4){shader+=\"varying vec4 fragColor;  \\n\";}}\nif(properties.CUBEMAP||properties.CLIPPLANES||properties.PBR_MATERIAL)\n{shader+=\"uniform mat4 viewMatrixInverse;\\n\";shader+=\"uniform mat4 viewMatrixInverse2;\\n\";shader+=\"uniform mat4 modelViewMatrixInverse;\\n\";shader+=\"uniform mat4 modelViewMatrixInverse2;\\n\";}\nif(properties.VERTEXID){shader+=\"varying float fragID;\\n\";if(properties.MULTIDIFFALPMAP){shader+=\"uniform sampler2D multiDiffuseAlphaMap;\\n\";shader+=\"uniform float multiDiffuseAlphaWidth;\\n\";shader+=\"uniform float multiDiffuseAlphaHeight;\\n\";}\nif(properties.MULTIEMIAMBMAP){shader+=\"uniform sampler2D multiEmissiveAmbientMap;\\n\";shader+=\"uniform float multiEmissiveAmbientWidth;\\n\";shader+=\"uniform float multiEmissiveAmbientHeight;\\n\";}\nif(properties.MULTISPECSHINMAP){shader+=\"uniform sampler2D multiSpecularShininessMap;\\n\";shader+=\"uniform float multiSpecularShininessWidth;\\n\";shader+=\"uniform float multiSpecularShininessHeight;\\n\";}\nif(properties.MULTIVISMAP){shader+=\"uniform sampler2D multiVisibilityMap;\\n\";shader+=\"uniform float multiVisibilityWidth;\\n\";shader+=\"uniform float multiVisibilityHeight;\\n\";}}\nif(properties.TEXTURED){shader+=\"varying vec2 fragTexcoord;\\n\";if(properties.MULTITEXCOORD)\n{shader+=\"varying vec2 fragTexcoord2;\\n\";}\nif((properties.TEXTURED||properties.DIFFUSEMAP)){shader+=\"uniform sampler2D diffuseMap;\\n\";}\nif(properties.CUBEMAP||properties.PBR_MATERIAL){shader+=\"uniform samplerCube environmentMap;\\n\";shader+=\"varying vec3 fragViewDir;\\n\";if(properties.CSSHADER){shader+=\"uniform float environmentFactor;\\n\";}}\nif(properties.EMISSIVEMAP){shader+=\"uniform sampler2D emissiveMap;\\n\";}\nif(properties.OCCLUSIONMAP){shader+=\"uniform sampler2D occlusionMap;\\n\";}\nif(properties.ROUGHNESSMETALLICMAP){shader+=\"uniform sampler2D roughnessMetallicMap;\\n\";}\nif(properties.SPECULARGLOSSINESSMAP)\n{shader+=\"uniform sampler2D specularGlossinessMap;\\n\";}\nif(properties.OCCLUSIONROUGHNESSMETALLICMAP){shader+=\"uniform sampler2D occlusionRoughnessMetallicMap;\\n\";}\nif(properties.SPECMAP){shader+=\"uniform sampler2D specularMap;\\n\";}\nif(properties.SHINMAP){shader+=\"uniform sampler2D shininessMap;\\n\";}\nif(properties.DISPLACEMENTMAP){shader+=\"uniform sampler2D displacementMap;\\n\";shader+=\"uniform float displacementWidth;\\n\";shader+=\"uniform float displacementHeight;\\n\";}\nif(properties.DIFFPLACEMENTMAP){shader+=\"uniform sampler2D diffuseDisplacementMap;\\n\";shader+=\"uniform float displacementWidth;\\n\";shader+=\"uniform float displacementHeight;\\n\";}\nif(properties.NORMALMAP){shader+=\"uniform sampler2D normalMap;\\n\";shader+=\"uniform vec3 normalBias;\\n\";if(properties.NORMALSPACE==\"TANGENT\"){if(x3dom.caps.STD_DERIVATIVES||x3dom.caps.WEBGL_VERSION==2){shader+=x3dom.shader.TBNCalculation();}else{shader+=\"varying vec3 fragTangent;\\n\";shader+=\"varying vec3 fragBinormal;\\n\";}}else if(properties.NORMALSPACE==\"OBJECT\"){shader+=\"uniform mat4 normalMatrix;\\n\";shader+=\"uniform mat4 normalMatrix2;\\n\";}}}\nif(properties.FOG){shader+=x3dom.shader.fog();}\nif(properties.LIGHTS||properties.CLIPPLANES)\n{shader+=\"varying vec4 fragPosition;\\n\";shader+=\"varying vec4 fragPositionWS;\\n\";shader+=\"uniform float isOrthoView;\\n\";}\nif(properties.LIGHTS){if(properties.NORMALMAP&&properties.NORMALSPACE==\"OBJECT\"){}else{shader+=\"varying vec3 fragNormal;\\n\";}\nvar numLights=properties.LIGHTS;if(properties.PHYSICALENVLIGHT)\n{numLights--;}\nif(properties.PBR_MATERIAL&&numLights)\n{shader+=x3dom.shader.lightPBR(properties.LIGHTS);}\nelse if(numLights)\n{shader+=x3dom.shader.light(properties.LIGHTS);}}\nif(properties.CLIPPLANES){shader+=x3dom.shader.clipPlanes(properties.CLIPPLANES);}\nshader+=x3dom.shader.gammaCorrectionDecl(properties);shader+=\"void main(void) {\\n\";if(properties.CUBEMAP||properties.CLIPPLANES||properties.PBR_MATERIAL)\n{shader+=\"mat4 mat_mvi = modelViewMatrixInverse;\\n\";shader+=\"mat4 mat_vi  = viewMatrixInverse;\\n\";}\nif(properties.NORMALSPACE==\"OBJECT\")\n{shader+=\"mat4 mat_n = normalMatrix;\\n\"}\nshader+=\"if(fragEyeIdx == 1.0){\\n\"\nif(properties.CUBEMAP||properties.CLIPPLANES){shader+=\"    mat_mvi   = modelViewMatrixInverse2;\\n\";shader+=\"    mat_vi    = viewMatrixInverse2;\\n\";}\nif(properties.NORMALSPACE==\"OBJECT\")\n{shader+=\"    mat_n   = normalMatrix2;\\n\";}\nshader+=\"}\\n\";shader+=\"if ( isVR == 1.0) {\\n\";shader+=\"    if ( ( step( 0.5, gl_FragCoord.x / screenWidth ) - 0.5 ) * vrOffset < 0.0 ) discard;\\n\";shader+=\"}\\n\";if(properties.CLIPPLANES)\n{shader+=\"vec3 cappingColor = calculateClipPlanes();\\n\";}\nshader+=\"vec4 color;\\n\";shader+=\"vec4 texColor;\\n\";shader+=\"color.rgb = diffuseColor;\\n\";shader+=\"color.a = 1.0 - transparency;\\n\";shader+=\"vec3 _emissiveColor     = emissiveColor;\\n\";shader+=\"float _shininess        = shininess;\\n\";shader+=\"vec3 _specularColor     = specularColor;\\n\";shader+=\"float _ambientIntensity = ambientIntensity;\\n\";shader+=\"float _transparency     = transparency;\\n\";shader+=\"float _occlusion        = 1.0;\\n\";if(properties.ALPHAMODE==\"OPAQUE\")\n{shader+=\"color.a = 1.0;\\n\";}\nif(properties.PBR_MATERIAL&&properties.ISROUGHNESSMETALLIC)\n{shader+=\"float _metallic         = metallicFactor;\\n\";}\nif(properties.SEPARATEBACKMAT)\n{shader+=\"  if(!gl_FrontFacing) {\\n\";shader+=\"    color.rgb = backDiffuseColor;\\n\";shader+=\"    color.a = 1.0 - backTransparency;\\n\";shader+=\"    _transparency = 1.0 - backTransparency;\\n\";shader+=\"    _shininess = backShininess;\\n\";shader+=\"    _emissiveColor = backEmissiveColor;\\n\";shader+=\"    _specularColor = backSpecularColor;\\n\";shader+=\"    _ambientIntensity = backAmbientIntensity;\\n\";shader+=\"  }\\n\";}\nif(properties.MULTIVISMAP||properties.MULTIDIFFALPMAP||properties.MULTISPECSHINMAP||properties.MULTIEMIAMBMAP){shader+=\"vec2 idCoord;\\n\";shader+=\"float roundedIDVisibility = floor(fragID+0.5);\\n\";shader+=\"float roundedIDMaterial = floor(fragID+0.5);\\n\";shader+=\"if(!gl_FrontFacing) {\\n\";shader+=\"    roundedIDMaterial = floor(fragID + (multiDiffuseAlphaWidth*multiDiffuseAlphaWidth) + 0.5);\\n\";shader+=\"}\\n\";}\nif(properties.MULTIVISMAP){shader+=\"idCoord.x = mod(roundedIDVisibility, multiVisibilityWidth) * (1.0 / multiVisibilityWidth) + (0.5 / multiVisibilityWidth);\\n\";shader+=\"idCoord.y = floor(roundedIDVisibility / multiVisibilityWidth) * (1.0 / multiVisibilityHeight) + (0.5 / multiVisibilityHeight);\\n\";shader+=\"vec4 visibility = texture2D( multiVisibilityMap, idCoord );\\n\";shader+=\"if (visibility.r < 1.0) discard; \\n\";}\nif(properties.MULTIDIFFALPMAP){shader+=\"idCoord.x = mod(roundedIDMaterial, multiDiffuseAlphaWidth) * (1.0 / multiDiffuseAlphaWidth) + (0.5 / multiDiffuseAlphaWidth);\\n\";shader+=\"idCoord.y = floor(roundedIDMaterial / multiDiffuseAlphaWidth) * (1.0 / multiDiffuseAlphaHeight) + (0.5 / multiDiffuseAlphaHeight);\\n\";shader+=\"vec4 diffAlpha = texture2D( multiDiffuseAlphaMap, idCoord );\\n\";shader+=\"color.rgb = \"+x3dom.shader.decodeGamma(properties,\"diffAlpha.rgb\")+\";\\n\";shader+=\"_transparency = 1.0 - diffAlpha.a;\\n\";shader+=\"color.a = diffAlpha.a;\\n\";}\nif(properties.MULTIEMIAMBMAP){shader+=\"idCoord.x = mod(roundedIDMaterial, multiDiffuseAlphaWidth) * (1.0 / multiDiffuseAlphaWidth) + (0.5 / multiDiffuseAlphaWidth);\\n\";shader+=\"idCoord.y = floor(roundedIDMaterial / multiDiffuseAlphaWidth) * (1.0 / multiDiffuseAlphaHeight) + (0.5 / multiDiffuseAlphaHeight);\\n\";shader+=\"vec4 emiAmb = texture2D( multiEmissiveAmbientMap, idCoord );\\n\";shader+=\"_emissiveColor = emiAmb.rgb;\\n\";shader+=\"_ambientIntensity = emiAmb.a;\\n\";}\nif(properties.VERTEXCOLOR)\n{if((properties.COLCOMPONENTS===3||properties.ALPHAMODE==\"OPAQUE\")&&properties.PBR_MATERIAL)\n{shader+=\"color.rgb *= fragColor.rgb;\\n\";}\nelse if(properties.COLCOMPONENTS===3&&!properties.PBR_MATERIAL)\n{shader+=\"color.rgb = fragColor.rgb;\\n\";}\nelse if(properties.COLCOMPONENTS===4&&properties.PBR_MATERIAL)\n{shader+=\"color *= fragColor;\\n\";}\nelse if(properties.COLCOMPONENTS===4&&!properties.PBR_MATERIAL)\n{shader+=\"color = fragColor;\\n\";}}\nif(properties.UNLIT)\n{if(properties.DIFFUSEMAP)\n{if(properties.DIFFUSEMAPCHANNEL)\n{shader+=\"texColor = \"+x3dom.shader.decodeGamma(properties,\"texture2D(diffuseMap, vec2(fragTexcoord2.x, 1.0 - fragTexcoord2.y))\")+\";\\n\";}\nelse\n{shader+=\"texColor = \"+x3dom.shader.decodeGamma(properties,\"texture2D(diffuseMap, vec2(fragTexcoord.x, 1.0 - fragTexcoord.y))\")+\";\\n\";}\nif(properties.ALPHAMODE==\"OPAQUE\")\n{shader+=\"texColor.a = 1.0;\\n\";}\nshader+=\"color *= texColor;\\n\";}}\nelse if(properties.LIGHTS)\n{shader+=\"vec3 ambient   = vec3(0.0, 0.0, 0.0);\\n\";shader+=\"vec3 diffuse   = vec3(0.0, 0.0, 0.0);\\n\";shader+=\"vec3 specular  = vec3(0.0, 0.0, 0.0);\\n\";shader+=\"vec3 eye;\\n\";shader+=\"vec3 positionVS = fragPosition.rgb;\\n\";shader+=\"if ( isOrthoView > 0.0 ) {\\n\";shader+=\"    eye = vec3(0.0, 0.0, 1.0);\\n\";shader+=\"} else {\\n\";shader+=\"    eye = -fragPosition.xyz;\\n\";shader+=\"}\\n\";if(properties.NORMALMAP){shader+=\"vec3 _normalBias = normalBias;\\n\";}\nif(properties.NORMALMAP&&properties.NORMALSPACE==\"OBJECT\"){shader+=\"vec3 normal = vec3(0.0, 0.0, 0.0);\\n\";}else{shader+=\"vec3 normal = normalize(fragNormal);\\n\";}\nif(!properties.SOLID||properties.TWOSIDEDMAT){shader+=\"if (dot(normalize(fragNormal), eye) < 0.0) {\\n\";shader+=\"  normal *= -1.0;\\n\";if(properties.NORMALMAP){shader+=\"  _normalBias = _normalBias * _normalBias;\\n\";}\nshader+=\"}\\n\";}\nif(properties.TEXTURED)\n{if(properties.NORMALMAP){if(properties.NORMALSPACE==\"TANGENT\"){shader+=\"vec3 n = normal;\\n\";if(!properties.TANGENTDATA&&(x3dom.caps.STD_DERIVATIVES||x3dom.caps.WEBGL_VERSION==2)){shader+=\"normal = perturb_normal( n, fragPosition.xyz, vec2(fragTexcoord.x, 1.0 - fragTexcoord.y), _normalBias);\\n\";}else{shader+=\"vec3 t = normalize( fragTangent );\\n\";shader+=\"vec3 b = normalize( fragBinormal );\\n\";shader+=\"mat3 tangentToWorld = mat3(t, b, n);\\n\";shader+=\"normal = texture2D( normalMap, vec2(fragTexcoord.x, 1.0-fragTexcoord.y) ).rgb;\\n\";shader+=\"normal = 2.0 * normal - 1.0;\\n\";shader+=\"normal = normalize( normal * tangentToWorld );\\n\";}}else if(properties.NORMALSPACE==\"OBJECT\"){shader+=\"normal = texture2D( normalMap, vec2(fragTexcoord.x, 1.0-fragTexcoord.y) ).rgb;\\n\";shader+=\"normal = 2.0 * normal - 1.0;\\n\";shader+=\"normal = (mat_n * vec4(normal, 0.0)).xyz;\\n\";shader+=\"normal = normalize(normal);\\n\";}}\nif(properties.CUBEMAP){shader+=\"vec3 viewDir = normalize(fragViewDir);\\n\";shader+=\"vec3 reflected = reflect(-eye, normal);\\n\";shader+=\"reflected = (mat_mvi * vec4(reflected, 0.0)).xyz;\\n\";shader+=\"texColor = \"+x3dom.shader.decodeGamma(properties,\"textureCube(environmentMap, reflected)\")+\";\\n\";}\nelse if(properties.DIFFPLACEMENTMAP)\n{shader+=\"texColor = texture2D(diffuseDisplacementMap, vec2(fragTexcoord.x, 1.0-fragTexcoord.y));\\n\";}\nelse if(properties.DIFFUSEMAP||properties.TEXT)\n{if(properties.PIXELTEX){if(properties.DIFFUSEMAPCHANNEL)\n{shader+=\"texColor = \"+x3dom.shader.decodeGamma(properties,\"texture2D(diffuseMap, fragTexcoord2)\")+\";\\n\";}\nelse\n{shader+=\"texColor = \"+x3dom.shader.decodeGamma(properties,\"texture2D(diffuseMap, fragTexcoord)\")+\";\\n\";}}else{if(properties.DIFFUSEMAPCHANNEL)\n{shader+=\"texColor = \"+x3dom.shader.decodeGamma(properties,\"texture2D(diffuseMap, vec2(fragTexcoord2.x, 1.0 - fragTexcoord2.y))\")+\";\\n\";}\nelse\n{shader+=\"texColor = \"+x3dom.shader.decodeGamma(properties,\"texture2D(diffuseMap, vec2(fragTexcoord.x, 1.0 - fragTexcoord.y))\")+\";\\n\";}}}\nif(properties.ALPHAMODE==\"OPAQUE\")\n{shader+=\"texColor.a = 1.0;\\n\";}\nif(properties.BLENDING&&(properties.DIFFUSEMAP||properties.TEXT||properties.DIFFPLACEMENTMAP||properties.CUBEMAP))\n{if(properties.CUBEMAP&&properties.CSSHADER){shader+=\"color.rgb *= mix(vec3(1.0,1.0,1.0), texColor.rgb, environmentFactor);\\n\";}\nelse\n{shader+=\"color *= texColor;\\n\";}}\nelse if(!properties.BLENDING&&(properties.DIFFUSEMAP||properties.TEXT||properties.DIFFPLACEMENTMAP||properties.CUBEMAP))\n{shader+=\"color = texColor;\\n\";}\nif(properties.SHINMAP){shader+=\"_shininess *= texture2D( shininessMap, vec2(fragTexcoord.x, 1.0-fragTexcoord.y) ).r;\\n\";}\nif(properties.SPECMAP){shader+=\"_specularColor = texture2D(specularMap, vec2(fragTexcoord.x, 1.0-fragTexcoord.y)).rgb;\\n\";}\nif(properties.EMISSIVEMAP)\n{if(properties.EMISSIVEMAPCHANNEL)\n{shader+=\"_emissiveColor = _emissiveColor * texture2D(emissiveMap, vec2(fragTexcoord2.x, 1.0-fragTexcoord2.y)).rgb;\\n\";}\nelse\n{shader+=\"_emissiveColor = _emissiveColor * texture2D(emissiveMap, vec2(fragTexcoord.x, 1.0-fragTexcoord.y)).rgb;\\n\";}}\nif(properties.ROUGHNESSMETALLICMAP){if(properties.ROUGHNESSMETALLICMAPCHANNEL)\n{shader+=\"vec3 roughnessMetallic = texture2D(roughnessMetallicMap, vec2(fragTexcoord2.x, 1.0-fragTexcoord2.y)).rgb;\\n\";}\nelse\n{shader+=\"vec3 roughnessMetallic = texture2D(roughnessMetallicMap, vec2(fragTexcoord.x, 1.0-fragTexcoord.y)).rgb;\\n\";}\nshader+=\"_shininess = 1.0 - (roughnessMetallic.g * (1.0 - _shininess));\\n\";shader+=\"_metallic  = roughnessMetallic.b * metallicFactor;\\n\";}\nif(properties.SPECULARGLOSSINESSMAP)\n{if(properties.SPECULARGLOSSINESSMAPCHANNEL)\n{shader+=\"vec4 specularGlossiness = \"+x3dom.shader.decodeGamma(properties,\"texture2D(specularGlossinessMap, vec2(fragTexcoord2.x, 1.0 - fragTexcoord2.y))\")+\";\\n\";}\nelse\n{shader+=\"vec4 specularGlossiness = \"+x3dom.shader.decodeGamma(properties,\"texture2D(specularGlossinessMap, vec2(fragTexcoord.x, 1.0 - fragTexcoord.y))\")+\";\\n\";}\nshader+=\"_shininess = specularGlossiness.a * _shininess;\\n\";}\nif(properties.OCCLUSIONROUGHNESSMETALLICMAP){if(properties.OCCLUSIONROUGHNESSMETALLICMAPCHANNEL)\n{shader+=\"vec3 occlusionRoughnessMetallic = texture2D(occlusionRoughnessMetallicMap, vec2(fragTexcoord2.x, 1.0-fragTexcoord2.y)).rgb;\\n\";}\nelse\n{shader+=\"vec3 occlusionRoughnessMetallic = texture2D(occlusionRoughnessMetallicMap, vec2(fragTexcoord.x, 1.0-fragTexcoord.y)).rgb;\\n\";}\nshader+=\"_occlusion = occlusionRoughnessMetallic.r;\\n\";shader+=\"_shininess = 1.0 - occlusionRoughnessMetallic.g;\\n\";shader+=\"_metallic  = occlusionRoughnessMetallic.b;\\n\";}\nif(properties.OCCLUSIONMAP){if(properties.OCCLUSIONMAPCHANNEL)\n{shader+=\"_occlusion = texture2D(occlusionMap, vec2(fragTexcoord2.x, 1.0-fragTexcoord2.y)).r;\\n\";}\nelse\n{shader+=\"_occlusion = texture2D(occlusionMap, vec2(fragTexcoord.x, 1.0-fragTexcoord.y)).r;\\n\";}}\nif(properties.MULTISPECSHINMAP){shader+=\"idCoord.x = mod(roundedIDMaterial, multiSpecularShininessWidth) * (1.0 / multiSpecularShininessWidth) + (0.5 / multiSpecularShininessWidth);\\n\";shader+=\"idCoord.y = floor(roundedIDMaterial / multiSpecularShininessWidth) * (1.0 / multiSpecularShininessHeight) + (0.5 / multiSpecularShininessHeight);\\n\";shader+=\"vec4 specShin = texture2D( multiSpecularShininessMap, idCoord );\\n\";shader+=\"_specularColor = specShin.rgb;\\n\";shader+=\"_shininess = specShin.a;\\n\";}}\nif(properties.PBR_MATERIAL&&properties.ISROUGHNESSMETALLIC)\n{shader+=\"_specularColor = mix(vec3(0.04, 0.04, 0.04), color.rgb, _metallic);\\n\";shader+=\"color.rgb *= (1.0 - _metallic);\\n\";}\nelse if(properties.PBR_MATERIAL&&properties.SPECULARGLOSSINESSMAP)\n{shader+=\"_specularColor = specularGlossiness.rgb * _specularColor;\\n\";}\nif(numLights){for(var l=0;l<numLights;l++){var lightCol=\"light\"+l+\"_Color\";shader+=\" lighting(light\"+l+\"_Type, \"+\"light\"+l+\"_Location, \"+\"light\"+l+\"_Direction, \"+\nlightCol+\", \"+\"light\"+l+\"_Attenuation, \"+\"light\"+l+\"_Radius, \"+\"light\"+l+\"_Intensity, \"+\"light\"+l+\"_AmbientIntensity, \"+\"light\"+l+\"_BeamWidth, \"+\"light\"+l+\"_CutOffAngle, \"+\"positionVS, normal, eye, _shininess, _ambientIntensity, _specularColor, ambient, diffuse, specular);\\n\";}\nshader+=\"ambient = max(ambient, 0.0);\\n\";shader+=\"diffuse = max(diffuse, 0.0);\\n\";shader+=\"specular = max(specular, 0.0);\\n\";}\nif(properties.PBR_MATERIAL)\n{if(properties.PHYSICALENVLIGHT)\n{shader+=\"float camDistance = length(cameraPosWS.xyz - fragPositionWS.xyz);\\n\";shader+=\"vec3 N = (mat_vi * vec4(normal, 0.0)).rgb;\\n\";shader+=\"vec3 V = normalize ( cameraPosWS.xyz - fragPositionWS.xyz );\\n\";shader+=\"vec3 R = normalize( reflect ( -V, N ) );\\n\";shader+=\"float roughness  =  1.0 - _shininess;\\n\";shader+=\"float NoV = clamp(dot( N, V ), 0.0, 1.0);\\n\";shader+=\"float lod = roughness * 6.0;\"\nshader+=\"diffuse = textureCube( diffuseEnvironmentMap, N ).rgb;\\n\";if(x3dom.caps.TEXTURE_LOD||x3dom.caps.WEBGL_VERSION==2)\n{shader+=\"specular = textureCubeLodEXT( specularEnvironmentMap, R, lod ).rgb;\\n\";}\nelse\n{shader+=\"float level = calcMipLevel(dirToCubeUV(R));\\n\";shader+=\"float bias  = lod - level;\\n\";shader+=\"specular    = textureCube( specularEnvironmentMap, R, bias ).rgb;\\n\";}\nshader+=\"vec3 brdf      = texture2D( brdfMap, vec2( NoV, roughness ) ).rgb;\\n\";shader+=\"_specularColor = ( _specularColor * brdf.x + brdf.y );\\n\";}}\nshader+=\"color.rgb = _emissiveColor + ((ambient + diffuse) * color.rgb + specular * _specularColor) * _occlusion;\\n\";}else{if(properties.APPMAT&&!properties.VERTEXCOLOR&&!properties.TEXTURED&&!properties.PBR_MATERIAL){shader+=\"color = vec4(0.0, 0.0, 0.0, 1.0 - _transparency);\\n\";}\nif(properties.TEXTURED&&(properties.DIFFUSEMAP||properties.DIFFPLACEMENTMAP||properties.TEXT)){if(properties.PIXELTEX){shader+=\"vec2 texCoord = fragTexcoord;\\n\";}else{shader+=\"vec2 texCoord = vec2(fragTexcoord.x, 1.0-fragTexcoord.y);\\n\";}\nif(properties.IS_PARTICLE){shader+=\"texCoord = clamp(gl_PointCoord, 0.01, 0.99);\\n\";}\nshader+=\"texColor = \"+x3dom.shader.decodeGamma(properties,\"texture2D(diffuseMap, texCoord)\")+\";\\n\";shader+=\"color.a = texColor.a;\\n\";if(properties.BLENDING||properties.IS_PARTICLE){shader+=\"color.rgb += _emissiveColor.rgb;\\n\";shader+=\"color.rgb *= texColor.rgb;\\n\";}else{shader+=\"color = texColor;\\n\";}}else if(!properties.VERTEXCOLOR&&!properties.PBR_MATERIAL&&!properties.POINTLINE2D){shader+=\"color.rgb += _emissiveColor;\\n\";}else if(!properties.VERTEXCOLOR&&!properties.PBR_MATERIAL&&properties.POINTLINE2D){shader+=\"color.rgb = _emissiveColor;\\n\";if(properties.IS_PARTICLE){shader+=\"float pAlpha = 1.0 - clamp(length((gl_PointCoord - 0.5) * 2.0), 0.0, 1.0);\\n\";shader+=\"color.rgb *= vec3(pAlpha);\\n\";shader+=\"color.a = pAlpha;\\n\";}}else if(properties.IS_PARTICLE){shader+=\"float pAlpha = 1.0 - clamp(length((gl_PointCoord - 0.5) * 2.0), 0.0, 1.0);\\n\";shader+=\"color.rgb *= vec3(pAlpha);\\n\";shader+=\"color.a = pAlpha;\\n\";}}\nif(properties.CLIPPLANES)\n{shader+=\"if (cappingColor.r != -1.0) {\\n\";shader+=\"    color.rgb = cappingColor;\\n\";shader+=\"}\\n\";}\nif(properties.TEXT){shader+=\"if (color.a <= 0.5) discard;\\n\";}\nelse if(properties.ALPHAMASK)\n{shader+=\"if (color.a <= alphaCutoff) discard;\\n\";shader+=\"color.a = 1.0;\\n\";}\nelse\n{shader+=\"if (color.a <= 0.01) discard;\\n\";}\nshader+=\"if(tonemappingOperator == 1.0) {\\n\";shader+=\"    color.rgb = tonemapReinhard(color.rgb);\\n\";shader+=\" }\\n\";shader+=\" if(tonemappingOperator == 2.0) {\\n\";shader+=\"    color.rgb = tonemapUncharted2(color.rgb);\\n\";shader+=\" }\\n\";shader+=\" if(tonemappingOperator == 3.0) {\\n\";shader+=\"    color.rgb = tonemapeFilmic(color.rgb);\\n\";shader+=\" }\\n\";shader+=\"color = \"+x3dom.shader.encodeGamma(properties,\"color\")+\";\\n\";if(properties.FOG){shader+=\"float f0 = calcFog(fragEyePosition);\\n\";shader+=\"color.rgb = fogColor * (1.0-f0) + f0 * (color.rgb);\\n\";}\nshader+=\"gl_FragColor = color;\\n\";shader+=\"}\\n\";if(version==2)\n{shader=x3dom.shader.convertFragmentShader(shader);}\nvar fragmentShader=gl.createShader(gl.FRAGMENT_SHADER);gl.shaderSource(fragmentShader,shader);gl.compileShader(fragmentShader);if(!gl.getShaderParameter(fragmentShader,gl.COMPILE_STATUS)){x3dom.debug.logInfo(\"FRAGMENT:\\n\"+shader);x3dom.debug.logError(\"FragmentShader \"+gl.getShaderInfoLog(fragmentShader));}\nreturn fragmentShader;};x3dom.shader.DynamicMobileShader=function(gl,properties)\n{this.program=gl.createProgram();var vertexShader=this.generateVertexShader(gl,properties);var fragmentShader=this.generateFragmentShader(gl,properties);gl.attachShader(this.program,vertexShader);gl.attachShader(this.program,fragmentShader);gl.bindAttribLocation(this.program,0,\"position\");gl.linkProgram(this.program);return this.program;};x3dom.shader.DynamicMobileShader.prototype.generateVertexShader=function(gl,properties)\n{var shader=\"\";shader+=x3dom.shader.material();if(properties.TWOSIDEDMAT){shader+=x3dom.shader.twoSidedMaterial();}\nshader+=\"uniform mat4 normalMatrix;\\n\";shader+=\"uniform mat4 modelViewMatrix;\\n\";shader+=\"uniform mat4 modelViewProjectionMatrix;\\n\";if(properties.POSCOMPONENTS==3){shader+=\"attribute vec3 position;\\n\";}else if(properties.POSCOMPONENTS==4){shader+=\"attribute vec4 position;\\n\";}\nif(properties.IMAGEGEOMETRY){shader+=\"uniform vec3 IG_bboxMin;\\n\";shader+=\"uniform vec3 IG_bboxMax;\\n\";shader+=\"uniform float IG_coordTextureWidth;\\n\";shader+=\"uniform float IG_coordTextureHeight;\\n\";shader+=\"uniform vec2 IG_implicitMeshSize;\\n\";for(var i=0;i<properties.IG_PRECISION;i++){shader+=\"uniform sampler2D IG_coords\"+i+\"\\n;\";}\nif(properties.IG_INDEXED){shader+=\"uniform sampler2D IG_index;\\n\";shader+=\"uniform float IG_indexTextureWidth;\\n\";shader+=\"uniform float IG_indexTextureHeight;\\n\";}}\nif(properties.POPGEOMETRY){shader+=\"uniform float PG_precisionLevel;\\n\";shader+=\"uniform float PG_powPrecision;\\n\";shader+=\"uniform vec3 PG_maxBBSize;\\n\";shader+=\"uniform vec3 PG_bbMin;\\n\";shader+=\"uniform vec3 PG_bbMaxModF;\\n\";shader+=\"uniform vec3 PG_bboxShiftVec;\\n\";shader+=\"uniform float PG_numAnchorVertices;\\n\";shader+=\"attribute float PG_vertexID;\\n\";}\nif(!properties.POINTLINE2D){if(properties.IMAGEGEOMETRY){shader+=\"uniform sampler2D IG_normals;\\n\";}else{if(properties.NORCOMPONENTS==2){if(properties.POSCOMPONENTS!=4){shader+=\"attribute vec2 normal;\\n\";}}else if(properties.NORCOMPONENTS==3){shader+=\"attribute vec3 normal;\\n\";}}}\nshader+=\"varying vec4 fragColor;\\n\";if(properties.VERTEXCOLOR){if(properties.IMAGEGEOMETRY){shader+=\"uniform sampler2D IG_colors;\";}else{if(properties.COLCOMPONENTS==3){shader+=\"attribute vec3 color;\";}else if(properties.COLCOMPONENTS==4){shader+=\"attribute vec4 color;\";}}}\nif(properties.TEXTURED){shader+=\"varying vec2 fragTexcoord;\\n\";if(properties.IMAGEGEOMETRY){shader+=\"uniform sampler2D IG_texCoords;\";}else{shader+=\"attribute vec2 texcoord;\\n\";}\nif(properties.TEXTRAFO){shader+=\"uniform mat4 texTrafoMatrix;\\n\";}\nif(!properties.BLENDING){shader+=\"varying vec3 fragAmbient;\\n\";shader+=\"varying vec3 fragDiffuse;\\n\";}\nif(properties.CUBEMAP){shader+=\"varying vec3 fragViewDir;\\n\";shader+=\"varying vec3 fragNormal;\\n\";shader+=\"uniform mat4 viewMatrix;\\n\";}}\nif(properties.FOG){shader+=x3dom.shader.fog();}\nif(properties.LIGHTS){shader+=x3dom.shader.light(properties.LIGHTS);}\nif(properties.REQUIREBBOX){shader+=\"uniform vec3 bgCenter;\\n\";shader+=\"uniform vec3 bgSize;\\n\";shader+=\"uniform float bgPrecisionMax;\\n\";}\nif(properties.REQUIREBBOXNOR){shader+=\"uniform float bgPrecisionNorMax;\\n\";}\nif(properties.REQUIREBBOXCOL){shader+=\"uniform float bgPrecisionColMax;\\n\";}\nif(properties.REQUIREBBOXTEX){shader+=\"uniform float bgPrecisionTexMax;\\n\";}\nshader+=\"void main(void) {\\n\";shader+=\"gl_PointSize = 2.0;\\n\";if(properties.IMAGEGEOMETRY){if(properties.IG_INDEXED){shader+=\"vec2 halfPixel = vec2(0.5/IG_indexTextureWidth,0.5/IG_indexTextureHeight);\\n\";shader+=\"vec2 IG_texCoord = vec2(position.x*(IG_implicitMeshSize.x/IG_indexTextureWidth), position.y*(IG_implicitMeshSize.y/IG_indexTextureHeight)) + halfPixel;\\n\";shader+=\"vec2 IG_indices = texture2D( IG_index, IG_texCoord ).rg;\\n\";shader+=\"halfPixel = vec2(0.5/IG_coordTextureWidth,0.5/IG_coordTextureHeight);\\n\";shader+=\"IG_texCoord = (IG_indices * 0.996108948) + halfPixel;\\n\";}else{shader+=\"vec2 halfPixel = vec2(0.5/IG_coordTextureWidth, 0.5/IG_coordTextureHeight);\\n\";shader+=\"vec2 IG_texCoord = vec2(position.x*(IG_implicitMeshSize.x/IG_coordTextureWidth), position.y*(IG_implicitMeshSize.y/IG_coordTextureHeight)) + halfPixel;\\n\";}\nshader+=\"vec3 temp = vec3(0.0, 0.0, 0.0);\\n\";shader+=\"vec3 vertPosition = vec3(0.0, 0.0, 0.0);\\n\";for(var i=0;i<properties.IG_PRECISION;i++){shader+=\"temp = 255.0 * texture2D( IG_coords\"+i+\", IG_texCoord ).rgb;\\n\";shader+=\"vertPosition *= 256.0;\\n\";shader+=\"vertPosition += temp;\\n\";}\nshader+=\"vertPosition /= (pow(2.0, 8.0 * \"+properties.IG_PRECISION+\".0) - 1.0);\\n\";shader+=\"vertPosition = vertPosition * (IG_bboxMax - IG_bboxMin) + IG_bboxMin;\\n\";if(!properties.POINTLINE2D){shader+=\"vec3 vertNormal = texture2D( IG_normals, IG_texCoord ).rgb;\\n\";shader+=\"vertNormal = vertNormal * 2.0 - 1.0;\\n\";}\nif(properties.VERTEXCOLOR){if(properties.COLCOMPONENTS==3){shader+=\"vec3 vertColor = texture2D( IG_colors, IG_texCoord ).rgb;\";}else if(properties.COLCOMPONENTS==4){shader+=\"vec4 vertColor = texture2D( IG_colors, IG_texCoord ).rgba;\";}}\nif(properties.TEXTURED){shader+=\"vec4 IG_doubleTexCoords = texture2D( IG_texCoords, IG_texCoord );\\n\";shader+=\"vec2 vertTexCoord;\";shader+=\"vertTexCoord.r = (IG_doubleTexCoords.r * 0.996108948) + (IG_doubleTexCoords.b * 0.003891051);\\n\";shader+=\"vertTexCoord.g = (IG_doubleTexCoords.g * 0.996108948) + (IG_doubleTexCoords.a * 0.003891051);\\n\";}}else{shader+=\"vec3 vertPosition = position.xyz;\\n\";if(properties.POPGEOMETRY){shader+=\"vec3 offsetVec = step(vertPosition / bgPrecisionMax, PG_bbMaxModF) * PG_bboxShiftVec;\\n\";shader+=\"if ((PG_precisionLevel <= 2.0) || PG_vertexID >= PG_numAnchorVertices) {\\n\";shader+=\"   vertPosition = floor(vertPosition / PG_powPrecision) * PG_powPrecision;\\n\";shader+=\"   vertPosition /= (65536.0 - PG_powPrecision);\\n\";shader+=\"}\\n\";shader+=\"else {\\n\";shader+=\"   vertPosition /= bgPrecisionMax;\\n\";shader+=\"}\\n\";shader+=\"vertPosition = (vertPosition + offsetVec + PG_bbMin) * PG_maxBBSize;\\n\";}\nelse if(properties.REQUIREBBOX){shader+=\"vertPosition = bgCenter + bgSize * vertPosition / bgPrecisionMax;\\n\";}\nif(!properties.POINTLINE2D){if(properties.NORCOMPONENTS==2){if(properties.POSCOMPONENTS==4){shader+=\"vec3 vertNormal = vec3(position.w / 256.0); \\n\";shader+=\"vertNormal.x = floor(vertNormal.x) / 255.0; \\n\";shader+=\"vertNormal.y = fract(vertNormal.y) * 1.00392156862745; \\n\";}else if(properties.REQUIREBBOXNOR){shader+=\"vec3 vertNormal = vec3(normal.xy, 0.0) / bgPrecisionNorMax;\\n\";}else{shader+=\"vec3 vertNormal = vec3(normal.xy, 0.0);\\n\";}\nshader+=\"vec2 thetaPhi = 3.14159265358979 * vec2(vertNormal.x, vertNormal.y*2.0-1.0); \\n\";shader+=\"vec4 sinCosThetaPhi = vec4(thetaPhi, thetaPhi + 1.5707963267949); \\n\";shader+=\"vec4 thetaPhiPow2 = sinCosThetaPhi * sinCosThetaPhi; \\n\";shader+=\"vec4 thetaPhiPow3 =  thetaPhiPow2  * sinCosThetaPhi; \\n\";shader+=\"vec4 thetaPhiPow5 =  thetaPhiPow3  * thetaPhiPow2; \\n\";shader+=\"vec4 thetaPhiPow7 =  thetaPhiPow5  * thetaPhiPow2; \\n\";shader+=\"vec4 thetaPhiPow9 =  thetaPhiPow7  * thetaPhiPow2; \\n\";shader+=\"sinCosThetaPhi +=  -0.16666666667   * thetaPhiPow3; \\n\";shader+=\"sinCosThetaPhi +=   0.00833333333   * thetaPhiPow5; \\n\";shader+=\"sinCosThetaPhi +=  -0.000198412698  * thetaPhiPow7; \\n\";shader+=\"sinCosThetaPhi +=   0.0000027557319 * thetaPhiPow9; \\n\";shader+=\"vertNormal.x = sinCosThetaPhi.x * sinCosThetaPhi.w; \\n\";shader+=\"vertNormal.y = sinCosThetaPhi.x * sinCosThetaPhi.y; \\n\";shader+=\"vertNormal.z = sinCosThetaPhi.z; \\n\";}else{shader+=\"vec3 vertNormal = normal;\\n\";if(properties.REQUIREBBOXNOR){shader+=\"vertNormal = vertNormal / bgPrecisionNorMax;\\n\";}\nif(properties.POPGEOMETRY){shader+=\"vertNormal = 2.0*vertNormal - 1.0;\\n\";}}}\nif(properties.VERTEXCOLOR){if(properties.COLCOMPONENTS==3){shader+=\"vec3 vertColor = color;\";}else if(properties.COLCOMPONENTS==4){shader+=\"vec4 vertColor = color;\";}\nif(properties.REQUIREBBOXCOL){shader+=\"vertColor = vertColor / bgPrecisionColMax;\\n\";}}\nif(properties.TEXTURED){shader+=\"vec2 vertTexCoord = texcoord;\\n\";if(properties.REQUIREBBOXTEX){shader+=\"vertTexCoord = vertTexCoord / bgPrecisionTexMax;\\n\";}}}\nshader+=\"vec3 positionMV = (modelViewMatrix * vec4(vertPosition, 1.0)).xyz;\\n\";if(!properties.POINTLINE2D){shader+=\"vec3 normalMV = normalize( (normalMatrix * vec4(vertNormal, 0.0)).xyz );\\n\";}\nshader+=\"vec3 eye = -positionMV;\\n\";if(properties.VERTEXCOLOR){shader+=\"vec3 rgb = vertColor.rgb;\\n\";if(properties.COLCOMPONENTS==4){shader+=\"float alpha = vertColor.a;\\n\";}else if(properties.COLCOMPONENTS==3){shader+=\"float alpha = 1.0 - transparency;\\n\";}}else{shader+=\"vec3 rgb = diffuseColor;\\n\";shader+=\"float alpha = 1.0 - transparency;\\n\";}\nif(properties.TEXTURED){if(properties.CUBEMAP){shader+=\"fragViewDir = viewMatrix[3].xyz;\\n\";shader+=\"fragNormal = normalMV;\\n\";}else if(properties.SPHEREMAPPING){shader+=\" fragTexcoord = 0.5 + normalMV.xy / 2.0;\\n\";}else if(properties.TEXTRAFO){shader+=\" fragTexcoord = (texTrafoMatrix * vec4(vertTexCoord, 1.0, 1.0)).xy;\\n\";}else{shader+=\" fragTexcoord = vertTexCoord;\\n\";if(properties.POPGEOMETRY&&x3dom.debug.usePrecisionLevelAsTexCoord===true)\nshader+=\"fragTexcoord = vec2(0.03125 + 0.9375 * (PG_precisionLevel / 16.0), 1.0);\";}}\nif(properties.LIGHTS){shader+=\"vec3 ambient   = vec3(0.0, 0.0, 0.0);\\n\";shader+=\"vec3 diffuse   = vec3(0.0, 0.0, 0.0);\\n\";shader+=\"vec3 specular  = vec3(0.0, 0.0, 0.0);\\n\";shader+=\"float _shininess     = shininess;\\n\";shader+=\"vec3 _specularColor  = specularColor;\\n\";shader+=\"vec3 _emissiveColor  = emissiveColor;\\n\";shader+=\"float _ambientIntensity = ambientIntensity;\\n\";if(!properties.SOLID||properties.TWOSIDEDMAT){shader+=\"if (dot(normalMV, eye) < 0.0) {\\n\";shader+=\"  normalMV *= -1.0;\\n\";if(properties.SEPARATEBACKMAT){shader+=\"    rgb = backDiffuseColor;\\n\";shader+=\"    alpha = 1.0 - backTransparency;\\n\";shader+=\"    _shininess = backShininess;\\n\";shader+=\"    _emissiveColor = backEmissiveColor;\\n\";shader+=\"    _specularColor = backSpecularColor;\\n\";shader+=\"    _ambientIntensity = backAmbientIntensity;\\n\";}\nshader+=\"  }\\n\";}\nif(properties.LIGHTS){shader+=\"vec3 ads;\\n\";for(var l=0;l<properties.LIGHTS;l++){var lightCol=\"light\"+l+\"_Color\";shader+=\"ads = lighting(light\"+l+\"_Type, \"+\"light\"+l+\"_Location, \"+\"light\"+l+\"_Direction, \"+\nlightCol+\", \"+\"light\"+l+\"_Attenuation, \"+\"light\"+l+\"_Radius, \"+\"light\"+l+\"_Intensity, \"+\"light\"+l+\"_AmbientIntensity, \"+\"light\"+l+\"_BeamWidth, \"+\"light\"+l+\"_CutOffAngle, \"+\"normalMV, eye, _shininess, _ambientIntensity);\\n\";shader+=\"   ambient  += \"+lightCol+\" * ads.r;\\n\"+\"   diffuse  += \"+lightCol+\" * ads.g;\\n\"+\"   specular += \"+lightCol+\" * ads.b;\\n\";}\nshader+=\"ambient = max(ambient, 0.0);\\n\";shader+=\"diffuse = max(diffuse, 0.0);\\n\";shader+=\"specular = max(specular, 0.0);\\n\";}\nif(properties.TEXTURED&&!properties.BLENDING){shader+=\"fragAmbient = ambient;\\n\";shader+=\"fragDiffuse = diffuse;\\n\";shader+=\"fragColor.rgb = (_emissiveColor + specular*_specularColor);\\n\";shader+=\"fragColor.a = alpha;\\n\";}else{shader+=\"fragColor.rgb = (_emissiveColor + max(ambient + diffuse, 0.0) * rgb + specular*_specularColor);\\n\";shader+=\"fragColor.a = alpha;\\n\";}}else{if(properties.APPMAT&&!properties.VERTEXCOLOR){shader+=\"rgb = vec3(0.0, 0.0, 0.0);\\n\";}\nif(properties.TEXTURED&&!properties.BLENDING){shader+=\"fragAmbient = vec3(0.0);\\n\";shader+=\"fragDiffuse = vec3(1.0);\\n\";shader+=\"fragColor.rgb = vec3(0.0);\\n\";shader+=\"fragColor.a = alpha;\\n\";}else if(!properties.VERTEXCOLOR&&properties.POINTLINE2D){shader+=\"fragColor.rgb = emissiveColor;\\n\";shader+=\"fragColor.a = alpha;\\n\";}else{shader+=\"fragColor.rgb = rgb + emissiveColor;\\n\";shader+=\"fragColor.a = alpha;\\n\";}}\nif(properties.FOG){shader+=\"float f0 = calcFog(-positionMV);\\n\";shader+=\"fragColor.rgb = fogColor * (1.0-f0) + f0 * (fragColor.rgb);\\n\";}\nshader+=\"gl_Position = modelViewProjectionMatrix * vec4(vertPosition, 1.0);\\n\";shader+=\"}\\n\";var vertexShader=gl.createShader(gl.VERTEX_SHADER);gl.shaderSource(vertexShader,shader);gl.compileShader(vertexShader);if(!gl.getShaderParameter(vertexShader,gl.COMPILE_STATUS)){x3dom.debug.logError(\"[DynamicMobileShader] VertexShader \"+gl.getShaderInfoLog(vertexShader));}\nreturn vertexShader;};x3dom.shader.DynamicMobileShader.prototype.generateFragmentShader=function(gl,properties)\n{var shader=\"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n\";shader+=\"precision highp float;\\n\";shader+=\"#else\\n\";shader+=\" precision mediump float;\\n\";shader+=\"#endif\\n\\n\";shader+=\"varying vec4 fragColor;\\n\";if(properties.TEXTURED){if(properties.CUBEMAP){shader+=\"uniform samplerCube cubeMap;\\n\";shader+=\"varying vec3 fragViewDir;\\n\";shader+=\"varying vec3 fragNormal;\\n\";shader+=\"uniform mat4 modelViewMatrixInverse;\\n\";}else{shader+=\"uniform sampler2D diffuseMap;           \\n\";shader+=\"varying vec2 fragTexcoord;       \\n\";}\nif(!properties.BLENDING){shader+=\"varying vec3 fragAmbient;\\n\";shader+=\"varying vec3 fragDiffuse;\\n\";}}\nshader+=\"void main(void) {\\n\";shader+=\"vec4 color = fragColor;\\n\";if(properties.TEXTURED){if(properties.CUBEMAP){shader+=\"vec3 normal = normalize(fragNormal);\\n\";shader+=\"vec3 viewDir = normalize(fragViewDir);\\n\";shader+=\"vec3 reflected = reflect(viewDir, normal);\\n\";shader+=\"reflected = (modelViewMatrixInverse * vec4(reflected,0.0)).xyz;\\n\";shader+=\"vec4 texColor = textureCube(cubeMap, reflected);\\n\";}else{shader+=\"vec4 texColor = texture2D(diffuseMap, vec2(fragTexcoord.s, 1.0-fragTexcoord.t));\\n\";}\nif(properties.BLENDING){if(properties.CUBEMAP){shader+=\"color.rgb = mix(color.rgb, texColor.rgb, vec3(0.75));\\n\";shader+=\"color.a = texColor.a;\\n\";}else{shader+=\"color.rgb *= texColor.rgb;\\n\";shader+=\"color.a *= texColor.a;\\n\";}}else{shader+=\"color.rgb += max(fragAmbient + fragDiffuse, 0.0) * texColor.rgb;\\n\";shader+=\"color.a *= texColor.a;\\n\";}}\nif(properties.TEXT){shader+=\"if (color.a <= 0.5) discard;\\n\";}else{shader+=\"if (color.a <= 0.1) discard;\\n\";}\nshader+=\"gl_FragColor = clamp(color, 0.0, 1.0);\\n\";shader+=\"}\\n\";var fragmentShader=gl.createShader(gl.FRAGMENT_SHADER);gl.shaderSource(fragmentShader,shader);gl.compileShader(fragmentShader);if(!gl.getShaderParameter(fragmentShader,gl.COMPILE_STATUS)){x3dom.debug.logError(\"[DynamicMobileShader] FragmentShader \"+gl.getShaderInfoLog(fragmentShader));}\nreturn fragmentShader;};x3dom.shader.DynamicShaderPicking=function(gl,properties,pickMode)\n{this.program=gl.createProgram();var vertexShader=this.generateVertexShader(gl,properties,pickMode);var fragmentShader=this.generateFragmentShader(gl,properties,pickMode);gl.attachShader(this.program,vertexShader);gl.attachShader(this.program,fragmentShader);gl.bindAttribLocation(this.program,0,\"position\");gl.linkProgram(this.program);return this.program;};x3dom.shader.DynamicShaderPicking.prototype.generateVertexShader=function(gl,properties,pickMode)\n{var shader=\"\";shader+=\"uniform mat4 modelMatrix;\\n\";shader+=\"uniform mat4 modelViewProjectionMatrix;\\n\";shader+=\"uniform mat4 modelMatrix2;\\n\";shader+=\"uniform mat4 modelViewProjectionMatrix2;\\n\";shader+=\"uniform float isVR;\\n\";shader+=\"attribute float eyeIdx;\\n\";shader+=\"varying float vrOffset;\\n\";shader+=\"varying float fragEyeIdx;\\n\";shader+=\"attribute vec3 position;\\n\";shader+=\"uniform vec3 from;\\n\";shader+=\"varying vec3 worldCoord;\\n\";if(pickMode==1){shader+=\"attribute vec3 color;\\n\";shader+=\"varying vec3 fragColor;\\n\";}else if(pickMode==2){shader+=\"attribute vec2 texcoord;\\n\";shader+=\"varying vec3 fragColor;\\n\";}\nif(properties.REQUIREBBOX){shader+=\"uniform vec3 bgCenter;\\n\";shader+=\"uniform vec3 bgSize;\\n\";shader+=\"uniform float bgPrecisionMax;\\n\";}\nif(properties.REQUIREBBOXCOL){shader+=\"uniform float bgPrecisionColMax;\\n\";}\nif(properties.REQUIREBBOXTEX){shader+=\"uniform float bgPrecisionTexMax;\\n\";}\nif(properties.VERTEXID){shader+=\"uniform float shadowIDs;\\n\";if(pickMode==3){shader+=\"varying vec3 idCoord;\\n\";}else{shader+=\"varying vec2 idCoord;\\n\";}\nshader+=\"varying float fragID;\\n\";shader+=\"attribute float id;\\n\";}\nif(properties.IMAGEGEOMETRY){shader+=\"uniform vec3 IG_bboxMin;\\n\";shader+=\"uniform vec3 IG_bboxMax;\\n\";shader+=\"uniform float IG_coordTextureWidth;\\n\";shader+=\"uniform float IG_coordTextureHeight;\\n\";shader+=\"uniform vec2 IG_implicitMeshSize;\\n\";for(var i=0;i<properties.IG_PRECISION;i++){shader+=\"uniform sampler2D IG_coords\"+i+\"\\n;\";}\nif(properties.IG_INDEXED){shader+=\"uniform sampler2D IG_index;\\n\";shader+=\"uniform float IG_indexTextureWidth;\\n\";shader+=\"uniform float IG_indexTextureHeight;\\n\";}}\nif(properties.POPGEOMETRY){shader+=\"uniform float PG_precisionLevel;\\n\";shader+=\"uniform float PG_powPrecision;\\n\";shader+=\"uniform vec3 PG_maxBBSize;\\n\";shader+=\"uniform vec3 PG_bbMin;\\n\";shader+=\"uniform vec3 PG_bbMaxModF;\\n\";shader+=\"uniform vec3 PG_bboxShiftVec;\\n\";shader+=\"uniform float PG_numAnchorVertices;\\n\";shader+=\"attribute float PG_vertexID;\\n\";}\nif(properties.CLIPPLANES){shader+=\"uniform mat4 modelViewMatrix;\\n\";shader+=\"uniform mat4 modelViewMatrix2;\\n\";shader+=\"varying vec4 fragPosition;\\n\";}\nshader+=\"void main(void) {\\n\";shader+=\"fragEyeIdx = eyeIdx;\\n\";shader+=\"gl_PointSize = 2.0;\\n\";shader+=\"vec3 pos = position;\\n\";if(properties.VERTEXID){if(pickMode==0){shader+=\"idCoord = vec2((id + shadowIDs) / 256.0);\\n\";shader+=\"idCoord.x = floor(idCoord.x) / 255.0;\\n\";shader+=\"idCoord.y = fract(idCoord.y) * 1.00392156862745;\\n\";shader+=\"fragID = id;\\n\";}else if(pickMode==3){shader+=\"float ID = id + shadowIDs;\\n\";shader+=\"float h = floor(ID / 256.0);\\n\";shader+=\"idCoord.x = ID - (h * 256.0);\\n\";shader+=\"idCoord.z = floor(h / 256.0);\\n\";shader+=\"idCoord.y = h - (idCoord.z * 256.0);\\n\";shader+=\"idCoord = idCoord.zyx / 255.0;\\n\";shader+=\"fragID = id;\\n\";}else if(pickMode==4){shader+=\"idCoord = vec2((id + shadowIDs) / 256.0);\\n\";shader+=\"idCoord.x = floor(idCoord.x) / 255.0;\\n\";shader+=\"idCoord.y = fract(idCoord.y) * 1.00392156862745;\\n\";shader+=\"fragID = id;\\n\";}}\nif(properties.IMAGEGEOMETRY){if(properties.IG_INDEXED){shader+=\"vec2 halfPixel = vec2(0.5/IG_indexTextureWidth,0.5/IG_indexTextureHeight);\\n\";shader+=\"vec2 IG_texCoord = vec2(position.x*(IG_implicitMeshSize.x/IG_indexTextureWidth), position.y*(IG_implicitMeshSize.y/IG_indexTextureHeight)) + halfPixel;\\n\";shader+=\"vec2 IG_indices = texture2D( IG_index, IG_texCoord ).rg;\\n\";shader+=\"halfPixel = vec2(0.5/IG_coordTextureWidth,0.5/IG_coordTextureHeight);\\n\";shader+=\"IG_texCoord = (IG_indices * 0.996108948) + halfPixel;\\n\";}else{shader+=\"vec2 halfPixel = vec2(0.5/IG_coordTextureWidth, 0.5/IG_coordTextureHeight);\\n\";shader+=\"vec2 IG_texCoord = vec2(position.x*(IG_implicitMeshSize.x/IG_coordTextureWidth), position.y*(IG_implicitMeshSize.y/IG_coordTextureHeight)) + halfPixel;\\n\";}\nshader+=\"pos = texture2D( IG_coordinateTexture, IG_texCoord ).rgb;\\n\";shader+=\"pos = pos * (IG_bboxMax - IG_bboxMin) + IG_bboxMin;\\n\";}else if(properties.POPGEOMETRY){shader+=\"vec3 offsetVec = step(pos / bgPrecisionMax, PG_bbMaxModF) * PG_bboxShiftVec;\\n\";shader+=\"if (PG_precisionLevel <= 2.0) {\\n\";shader+=\"pos = floor(pos / PG_powPrecision) * PG_powPrecision;\\n\";shader+=\"pos /= (65536.0 - PG_powPrecision);\\n\";shader+=\"}\\n\";shader+=\"else {\\n\";shader+=\"pos /= bgPrecisionMax;\\n\";shader+=\"}\\n\";shader+=\"pos = (pos + offsetVec + PG_bbMin) * PG_maxBBSize;\\n\";}else{if(properties.REQUIREBBOX){shader+=\"pos = bgCenter + bgSize * pos / bgPrecisionMax;\\n\";}\nif(pickMode==1&&!properties.REQUIREBBOXCOL){shader+=\"fragColor = color;\\n\";}else if(pickMode==1&&properties.REQUIREBBOXCOL){shader+=\"fragColor = color / bgPrecisionColMax;\\n\";}else if(pickMode==2&&!properties.REQUIREBBOXTEX){shader+=\"fragColor = vec3(abs(texcoord.x), abs(texcoord.y), 0.0);\\n\";}else if(pickMode==2&&properties.REQUIREBBOXTEX){shader+=\"vec2 texCoord = texcoord / bgPrecisionTexMax;\\n\";shader+=\"fragColor = vec3(abs(texCoord.x), abs(texCoord.y), 0.0);\\n\";}}\nif(properties.CLIPPLANES){shader+=\"if(eyeIdx == 1.0){\\n\"\nshader+=\"    fragPosition = (modelViewMatrix2 * vec4(pos, 1.0));\\n\";shader+=\"}else{\\n\";shader+=\"    fragPosition = (modelViewMatrix * vec4(pos, 1.0));\\n\";shader+=\"}\\n\";}\nshader+=\"worldCoord = (modelMatrix * vec4(pos, 1.0)).xyz - from;\\n\";shader+=\"if(eyeIdx == 1.0){\\n\"\nshader+=\"    gl_Position = modelViewProjectionMatrix2 * vec4(pos, 1.0);\\n\";shader+=\"}else{\\n\";shader+=\"    gl_Position = modelViewProjectionMatrix * vec4(pos, 1.0);\\n\";shader+=\"}\\n\";shader+=\"if(isVR == 1.0){\\n\";shader+=\"    vrOffset = eyeIdx * 0.5;\\n\";shader+=\"    gl_Position.x *= 0.5;\\n\";shader+=\"    gl_Position.x += vrOffset * gl_Position.w;\\n\";shader+=\"}\\n\";shader+=\"}\\n\";var vertexShader=gl.createShader(gl.VERTEX_SHADER);gl.shaderSource(vertexShader,shader);gl.compileShader(vertexShader);if(!gl.getShaderParameter(vertexShader,gl.COMPILE_STATUS)){x3dom.debug.logInfo(\"VERTEX:\\n\"+shader);x3dom.debug.logError(\"VertexShader \"+gl.getShaderInfoLog(vertexShader));}\nreturn vertexShader;};x3dom.shader.DynamicShaderPicking.prototype.generateFragmentShader=function(gl,properties,pickMode)\n{var shader=\"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n\";shader+=\" precision highp float;\\n\";shader+=\"#else\\n\";shader+=\" precision mediump float;\\n\";shader+=\"#endif\\n\\n\";shader+=\"uniform float highBit;\\n\";shader+=\"uniform float lowBit;\\n\";shader+=\"uniform float sceneSize;\\n\";shader+=\"varying vec3 worldCoord;\\n\";shader+=\"uniform float isVR;\\n\";shader+=\"varying float vrOffset;\\n\";shader+=\"varying float fragEyeIdx;\\n\";shader+=\"uniform float screenWidth;\\n\";if(pickMode==1||pickMode==2){shader+=\"varying vec3 fragColor;\\n\";}\nif(properties.VERTEXID){if(pickMode==3){shader+=\"varying vec3 idCoord;\\n\";}else{shader+=\"varying vec2 idCoord;\\n\";}\nshader+=\"varying float fragID;\\n\";}\nif(properties.CLIPPLANES){shader+=\"uniform mat4 viewMatrixInverse;\\n\";shader+=\"uniform mat4 viewMatrixInverse2;\\n\";shader+=\"varying vec4 fragPosition;\\n\";}\nif(properties.MULTIVISMAP){shader+=\"uniform sampler2D multiVisibilityMap;\\n\";shader+=\"uniform float multiVisibilityWidth;\\n\";shader+=\"uniform float multiVisibilityHeight;\\n\";}\nif(properties.CLIPPLANES){shader+=x3dom.shader.clipPlanes(properties.CLIPPLANES);}\nshader+=\"void main(void) {\\n\";shader+=\"if ( isVR == 1.0) {\\n\";shader+=\"    if ( ( step( 0.5, gl_FragCoord.x / screenWidth ) - 0.5 ) * vrOffset < 0.0 ) discard;\\n\";shader+=\"}\\n\";if(properties.CLIPPLANES)\n{shader+=\"calculateClipPlanes();\\n\";}\nif(pickMode==1||pickMode==2){shader+=\"vec4 color = vec4(fragColor, lowBit);\\n\";}else if(pickMode==4){shader+=\"vec4 color = vec4(highBit, lowBit, 0.0, 0.0);\\n\";}else{shader+=\"vec4 color = vec4(0.0, 0.0, highBit, lowBit);\\n\";}\nif(properties.VERTEXID){if(pickMode==0||pickMode==4){shader+=\"color.ba = idCoord;\\n\";}else if(pickMode==3){shader+=\"color.gba = idCoord;\\n\";}\nif(properties.MULTIVISMAP){shader+=\"vec2 idTexCoord;\\n\";shader+=\"float roundedID = floor(fragID+0.5);\\n\";shader+=\"idTexCoord.x = (mod(roundedID, multiVisibilityWidth)) * (1.0 / multiVisibilityWidth) + (0.5 / multiVisibilityWidth);\\n\";shader+=\"idTexCoord.y = (floor(roundedID / multiVisibilityHeight)) * (1.0 / multiVisibilityHeight) + (0.5 / multiVisibilityHeight);\\n\";shader+=\"vec4 visibility = texture2D( multiVisibilityMap, idTexCoord );\\n\";shader+=\"if (visibility.r < 1.0) discard; \\n\";}}\nif(pickMode!=1&&pickMode!=2){shader+=\"float d = length(worldCoord) / sceneSize;\\n\";}\nif(pickMode==0){shader+=\"vec2 comp = fract(d * vec2(256.0, 1.0));\\n\";shader+=\"color.rg = comp - (comp.rr * vec2(0.0, 1.0/256.0));\\n\";}else if(pickMode==3){shader+=\"color.r = d;\\n\";}\nshader+=\"gl_FragColor = color;\\n\";shader+=\"}\\n\";var fragmentShader=gl.createShader(gl.FRAGMENT_SHADER);gl.shaderSource(fragmentShader,shader);gl.compileShader(fragmentShader);if(!gl.getShaderParameter(fragmentShader,gl.COMPILE_STATUS)){x3dom.debug.logInfo(\"FRAGMENT:\\n\"+shader);x3dom.debug.logError(\"FragmentShader \"+gl.getShaderInfoLog(fragmentShader));}\nreturn fragmentShader;};x3dom.shader.DynamicShadowShader=function(gl,properties)\n{this.program=gl.createProgram();var vertexShader=this.generateVertexShader(gl,properties);var fragmentShader=this.generateFragmentShader(gl,properties);gl.attachShader(this.program,vertexShader);gl.attachShader(this.program,fragmentShader);gl.bindAttribLocation(this.program,0,\"position\");gl.linkProgram(this.program);return this.program;};x3dom.shader.DynamicShadowShader.prototype.generateVertexShader=function(gl,properties)\n{var shader=\"\";shader+=\"attribute vec3 position;\\n\";shader+=\"uniform mat4 modelViewProjectionMatrix;\\n\";shader+=\"varying vec4 projCoords;\\n\";if(properties.VERTEXID){shader+=\"varying float fragID;\\n\";shader+=\"attribute float id;\\n\";}\nif(properties.REQUIREBBOX){shader+=\"uniform vec3 bgCenter;\\n\";shader+=\"uniform vec3 bgSize;\\n\";shader+=\"uniform float bgPrecisionMax;\\n\";}\nif(properties.IMAGEGEOMETRY){shader+=\"uniform vec3 IG_bboxMin;\\n\";shader+=\"uniform vec3 IG_bboxMax;\\n\";shader+=\"uniform float IG_coordTextureWidth;\\n\";shader+=\"uniform float IG_coordTextureHeight;\\n\";shader+=\"uniform vec2 IG_implicitMeshSize;\\n\";for(var i=0;i<properties.IG_PRECISION;i++){shader+=\"uniform sampler2D IG_coords\"+i+\"\\n;\";}\nif(properties.IG_INDEXED){shader+=\"uniform sampler2D IG_index;\\n\";shader+=\"uniform float IG_indexTextureWidth;\\n\";shader+=\"uniform float IG_indexTextureHeight;\\n\";}}\nif(properties.POPGEOMETRY){shader+=\"uniform float PG_precisionLevel;\\n\";shader+=\"uniform float PG_powPrecision;\\n\";shader+=\"uniform vec3 PG_maxBBSize;\\n\";shader+=\"uniform vec3 PG_bbMin;\\n\";shader+=\"uniform vec3 PG_bbMaxModF;\\n\";shader+=\"uniform vec3 PG_bboxShiftVec;\\n\";shader+=\"uniform float PG_numAnchorVertices;\\n\";shader+=\"attribute float PG_vertexID;\\n\";}\nif(properties.CLIPPLANES){shader+=\"uniform mat4 modelViewMatrix;\\n\";shader+=\"varying vec4 fragPosition;\\n\";}\nshader+=\"void main(void) {\\n\";shader+=\"    vec3 pos = position;\\n\";if(properties.IMAGEGEOMETRY){if(properties.IG_INDEXED){shader+=\"    vec2 halfPixel = vec2(0.5/IG_indexTextureWidth,0.5/IG_indexTextureHeight);\\n\";shader+=\"    vec2 IG_texCoord = vec2(position.x*(IG_implicitMeshSize.x/IG_indexTextureWidth), position.y*(IG_implicitMeshSize.y/IG_indexTextureHeight)) + halfPixel;\\n\";shader+=\"    vec2 IG_indices = texture2D( IG_index, IG_texCoord ).rg;\\n\";shader+=\"    halfPixel = vec2(0.5/IG_coordTextureWidth,0.5/IG_coordTextureHeight);\\n\";shader+=\"    IG_texCoord = (IG_indices * 0.996108948) + halfPixel;\\n\";}else{shader+=\"    vec2 halfPixel = vec2(0.5/IG_coordTextureWidth, 0.5/IG_coordTextureHeight);\\n\";shader+=\"    vec2 IG_texCoord = vec2(position.x*(IG_implicitMeshSize.x/IG_coordTextureWidth), position.y*(IG_implicitMeshSize.y/IG_coordTextureHeight)) + halfPixel;\\n\";}\nshader+=\"    pos = texture2D( IG_coordinateTexture, IG_texCoord ).rgb;\\n\";shader+=\"    pos = pos * (IG_bboxMax - IG_bboxMin) + IG_bboxMin;\\n\";}else if(properties.POPGEOMETRY){shader+=\"    vec3 offsetVec = step(pos / bgPrecisionMax, PG_bbMaxModF) * PG_bboxShiftVec;\\n\";shader+=\"    if (PG_precisionLevel <= 2.0) {\\n\";shader+=\"        pos = floor(pos / PG_powPrecision) * PG_powPrecision;\\n\";shader+=\"        pos /= (65536.0 - PG_powPrecision);\\n\";shader+=\"    }\\n\";shader+=\"    else {\\n\";shader+=\"        pos /= bgPrecisionMax;\\n\";shader+=\"    }\\n\";shader+=\"    pos = (pos + offsetVec + PG_bbMin) * PG_maxBBSize;\\n\";}else{if(properties.REQUIREBBOX){shader+=\"    pos = bgCenter + bgSize * pos / bgPrecisionMax;\\n\";}}\nif(properties.VERTEXID){shader+=\"    fragID = id;\\n\";}\nif(properties.CLIPPLANES){shader+=\"    fragPosition = (modelViewMatrix * vec4(pos, 1.0));\\n\";}\nshader+=\"    projCoords = modelViewProjectionMatrix * vec4(pos, 1.0);\\n\";shader+=\"    gl_Position = projCoords;\\n\";shader+=\"}\\n\";var vertexShader=gl.createShader(gl.VERTEX_SHADER);gl.shaderSource(vertexShader,shader);gl.compileShader(vertexShader);if(!gl.getShaderParameter(vertexShader,gl.COMPILE_STATUS)){x3dom.debug.logError(\"[ShadowShader] VertexShader \"+gl.getShaderInfoLog(vertexShader));}\nreturn vertexShader;};x3dom.shader.DynamicShadowShader.prototype.generateFragmentShader=function(gl,properties)\n{var shader=\"\";shader+=\"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n\";shader+=\"    precision highp float;\\n\";shader+=\"#else\\n\";shader+=\"    precision mediump float;\\n\";shader+=\"#endif\\n\\n\";shader+=\"varying vec4 projCoords;\\n\";shader+=\"uniform float offset;\\n\";shader+=\"uniform bool cameraView;\\n\";if(properties.VERTEXID){shader+=\"varying float fragID;\\n\";}\nif(properties.MULTIVISMAP){shader+=\"uniform sampler2D multiVisibilityMap;\\n\";shader+=\"uniform float multiVisibilityWidth;\\n\";shader+=\"uniform float multiVisibilityHeight;\\n\";}\nif(properties.CLIPPLANES){shader+=\"uniform mat4 viewMatrixInverse;\\n\";shader+=\"varying vec4 fragPosition;\\n\";shader+=x3dom.shader.clipPlanes(properties.CLIPPLANES);}\nif(!x3dom.caps.FP_TEXTURES){shader+=x3dom.shader.rgbaPacking();}\nshader+=\"void main(void) {\\n\";if(properties.CLIPPLANES)\n{shader+=\"calculateClipPlanes();\\n\";}\nif(properties.MULTIVISMAP){shader+=\"    vec2 idTexCoord;\\n\";shader+=\"    float roundedID = floor(fragID+0.5);\\n\";shader+=\"    idTexCoord.x = (mod(roundedID, multiVisibilityWidth)) * (1.0 / multiVisibilityWidth) + (0.5 / multiVisibilityWidth);\\n\";shader+=\"    idTexCoord.y = (floor(roundedID / multiVisibilityHeight)) * (1.0 / multiVisibilityHeight) + (0.5 / multiVisibilityHeight);\\n\";shader+=\"    vec4 visibility = texture2D( multiVisibilityMap, idTexCoord );\\n\";shader+=\"    if (visibility.r < 1.0) discard; \\n\";}\nshader+=\"    vec3 proj = (projCoords.xyz / projCoords.w);\\n\";if(!x3dom.caps.FP_TEXTURES){shader+=\"    gl_FragColor = packDepth(proj.z);\\n\";}else{shader+=\"    if (!cameraView){\\n\";shader+=\"     proj.z = (proj.z + 1.0)*0.5;\\n\";shader+=\"     proj.y = proj.z * proj.z;\\n\";shader+=\"    }\\n\";shader+=\"    gl_FragColor = vec4(proj, 1.0);\\n\";}\nshader+=\"}\\n\";var fragmentShader=gl.createShader(gl.FRAGMENT_SHADER);gl.shaderSource(fragmentShader,shader);gl.compileShader(fragmentShader);if(!gl.getShaderParameter(fragmentShader,gl.COMPILE_STATUS)){x3dom.debug.logError(\"[ShadowShader] FragmentShader \"+gl.getShaderInfoLog(fragmentShader));}\nreturn fragmentShader;};x3dom.shader.ComposedShader=function(gl,shape)\n{this.program=gl.createProgram();var vertexShader=this.generateVertexShader(gl,shape);var fragmentShader=this.generateFragmentShader(gl,shape);gl.attachShader(this.program,vertexShader);gl.attachShader(this.program,fragmentShader);gl.bindAttribLocation(this.program,0,\"position\");gl.linkProgram(this.program);return this.program;};x3dom.shader.ComposedShader.prototype.generateVertexShader=function(gl,shape)\n{var shader=shape._cf.appearance.node._shader._vertex._vf.url[0];shader=this.injectVRPartsVS(shader);var vertexShader=gl.createShader(gl.VERTEX_SHADER);gl.shaderSource(vertexShader,shader);gl.compileShader(vertexShader);if(!gl.getShaderParameter(vertexShader,gl.COMPILE_STATUS)){x3dom.debug.logError(\"[ComposedShader] VertexShader \"+gl.getShaderInfoLog(vertexShader));}\nreturn vertexShader;};x3dom.shader.ComposedShader.prototype.generateFragmentShader=function(gl,shape)\n{var shader=shape._cf.appearance.node._shader._fragment._vf.url[0];shader=this.injectVRPartsFS(shader);var fragmentShader=gl.createShader(gl.FRAGMENT_SHADER);gl.shaderSource(fragmentShader,shader);gl.compileShader(fragmentShader);if(!gl.getShaderParameter(fragmentShader,gl.COMPILE_STATUS)){x3dom.debug.logError(\"[ComposedShader] FragmentShader \"+gl.getShaderInfoLog(fragmentShader));}\nreturn fragmentShader;};x3dom.shader.ComposedShader.prototype.injectVRPartsVS=function(shader)\n{var vrPart01=\"attribute float eyeIdx;\\n\"+\"uniform   float isVR;\\n\"+\"uniform   mat4  modelViewProjectionMatrix2;\\n\"+\"uniform   mat4  modelViewProjectionInverseMatrix;\\n\"+\"varying   float vrOffset;\\n\"+\"varying   float fragEyeIdx;\\n\";var vrPart02=\"fragEyeIdx = eyeIdx;\\n\"+\"if(isVR == 1.0)\\n\"+\"{\\n\"+\"    vec4 webVRPos = modelViewProjectionInverseMatrix * gl_Position;\\n\"+\"    webVRPos.xyz = webVRPos.xyz / webVRPos.w;\\n\"+\"    if(fragEyeIdx == 1.0) {\\n\"+\"        gl_Position = modelViewProjectionMatrix2 * webVRPos;\\n\"+\"    } else {\\n\"+\"        gl_Position = modelViewProjectionMatrix  * webVRPos;\\n\"+\"    }\\n\"+\"    vrOffset = fragEyeIdx * 0.5;\\n\"+\"    gl_Position.x *= 0.5;\\n\"+\"    gl_Position.x += vrOffset * gl_Position.w;\\n\"+\"}\";var sections=this.extractShaderSections(shader);return sections.before+\nvrPart01+\nsections.mainStart+\nsections.main+\nvrPart02+\nsections.mainEnd;};x3dom.shader.ComposedShader.prototype.injectVRPartsFS=function(shader)\n{var vrPart01=\"uniform   float isVR;\\n\"+\"uniform   float screenWidth;\\n\"+\"varying   float vrOffset;\\n\"+\"varying   float fragEyeIdx;\\n\";var vrPart02=\"if ( isVR == 1.0) {\\n\"+\"    if ( ( step( 0.5, gl_FragCoord.x / screenWidth ) - 0.5 ) * vrOffset < 0.0 ) discard;\\n\"+\"}\\n\";var sections=this.extractShaderSections(shader);return sections.before+\nvrPart01+\nsections.mainStart+\nvrPart02+\nsections.main+\nsections.mainEnd;};x3dom.shader.ComposedShader.prototype.extractShaderSections=function(shader)\n{var regex=/void\\s*main\\s*\\(\\s*(?:void)?\\s*\\)\\s*{[\\s\\S]*}/;var match=regex.exec(shader);var start=match[0].indexOf(\"{\")+match.index+1;var end=match[0].lastIndexOf(\"}\")+match.index;var before=shader.substring(0,match.index);var mainStart=shader.substring(match.index,start);var main=shader.substring(start,end);var mainEnd=shader.substring(end,shader.length);return{before:before,mainStart:mainStart,main:main,mainEnd:mainEnd};};x3dom.shader.NormalShader=function(gl)\n{this.program=gl.createProgram();var vertexShader=this.generateVertexShader(gl);var fragmentShader=this.generateFragmentShader(gl);gl.attachShader(this.program,vertexShader);gl.attachShader(this.program,fragmentShader);gl.bindAttribLocation(this.program,0,\"position\");gl.linkProgram(this.program);return this.program;};x3dom.shader.NormalShader.prototype.generateVertexShader=function(gl)\n{var shader=\"attribute vec3 position;\\n\"+\"attribute vec3 normal;\\n\"+\"uniform vec3 bgCenter;\\n\"+\"uniform vec3 bgSize;\\n\"+\"uniform float bgPrecisionMax;\\n\"+\"uniform float bgPrecisionNorMax;\\n\"+\"uniform mat4 normalMatrix;\\n\"+\"uniform mat4 modelViewProjectionMatrix;\\n\"+\"varying vec3 fragNormal;\\n\"+\"void main(void) {\\n\"+\"    vec3 pos = bgCenter + bgSize * position / bgPrecisionMax;\\n\"+\"    fragNormal = (normalMatrix * vec4(normal / bgPrecisionNorMax, 0.0)).xyz;\\n\"+\"    gl_Position = modelViewProjectionMatrix * vec4(pos, 1.0);\\n\"+\"}\\n\";var vertexShader=gl.createShader(gl.VERTEX_SHADER);gl.shaderSource(vertexShader,shader);gl.compileShader(vertexShader);if(!gl.getShaderParameter(vertexShader,gl.COMPILE_STATUS)){x3dom.debug.logError(\"[NormalShader] VertexShader \"+gl.getShaderInfoLog(vertexShader));}\nreturn vertexShader;};x3dom.shader.NormalShader.prototype.generateFragmentShader=function(gl)\n{var shader=\"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n\";shader+=\"precision highp float;\\n\";shader+=\"#else\\n\";shader+=\" precision mediump float;\\n\";shader+=\"#endif\\n\\n\";shader+=\"varying vec3 fragNormal;\\n\"+\"void main(void) {\\n\"+\"    gl_FragColor = vec4(normalize(fragNormal) / 2.0 + 0.5, 1.0);\\n\"+\"}\\n\";var fragmentShader=gl.createShader(gl.FRAGMENT_SHADER);gl.shaderSource(fragmentShader,shader);gl.compileShader(fragmentShader);if(!gl.getShaderParameter(fragmentShader,gl.COMPILE_STATUS)){x3dom.debug.logError(\"[NormalShader] FragmentShader \"+gl.getShaderInfoLog(fragmentShader));}\nreturn fragmentShader;};x3dom.shader.FrontgroundTextureShader=function(gl)\n{this.program=gl.createProgram();var vertexShader=this.generateVertexShader(gl);var fragmentShader=this.generateFragmentShader(gl);gl.attachShader(this.program,vertexShader);gl.attachShader(this.program,fragmentShader);gl.bindAttribLocation(this.program,0,\"position\");gl.linkProgram(this.program);return this.program;};x3dom.shader.FrontgroundTextureShader.prototype.generateVertexShader=function(gl)\n{var shader=\"attribute vec3 position;\\n\"+\"varying vec2 fragTexCoord;\\n\"+\"\\n\"+\"void main(void) {\\n\"+\"    vec2 texCoord = (position.xy + 1.0) * 0.5;\\n\"+\"    fragTexCoord = texCoord;\\n\"+\"    gl_Position = vec4(position.xy, 0.0, 1.0);\\n\"+\"}\\n\";var vertexShader=gl.createShader(gl.VERTEX_SHADER);gl.shaderSource(vertexShader,shader);gl.compileShader(vertexShader);if(!gl.getShaderParameter(vertexShader,gl.COMPILE_STATUS)){x3dom.debug.logError(\"[FrontgroundTextureShader] VertexShader \"+gl.getShaderInfoLog(vertexShader));}\nreturn vertexShader;};x3dom.shader.FrontgroundTextureShader.prototype.generateFragmentShader=function(gl)\n{var shader=\"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n\";shader+=\"precision highp float;\\n\";shader+=\"#else\\n\";shader+=\" precision mediump float;\\n\";shader+=\"#endif\\n\\n\";shader+=\"uniform sampler2D tex;\\n\"+\"varying vec2 fragTexCoord;\\n\"+\"\\n\"+\"void main(void) {\\n\"+\"    vec4 col = texture2D(tex, fragTexCoord);\\n\"+\"    gl_FragColor = vec4(col.rgb, 1.0);\\n\"+\"}\\n\";var fragmentShader=gl.createShader(gl.FRAGMENT_SHADER);gl.shaderSource(fragmentShader,shader);gl.compileShader(fragmentShader);if(!gl.getShaderParameter(fragmentShader,gl.COMPILE_STATUS)){x3dom.debug.logError(\"[FrontgroundTextureShader] FragmentShader \"+gl.getShaderInfoLog(fragmentShader));}\nreturn fragmentShader;};x3dom.shader.BackgroundTextureShader=function(gl)\n{this.program=gl.createProgram();var vertexShader=this.generateVertexShader(gl);var fragmentShader=this.generateFragmentShader(gl);gl.attachShader(this.program,vertexShader);gl.attachShader(this.program,fragmentShader);gl.bindAttribLocation(this.program,0,\"position\");gl.linkProgram(this.program);return this.program;};x3dom.shader.BackgroundTextureShader.prototype.generateVertexShader=function(gl)\n{var shader=\"attribute vec3 position;\\n\"+\"varying vec2 fragTexCoord;\\n\"+\"uniform vec2 scale;\\n\"+\"uniform vec2 translation;\\n\"+\"uniform float isVR;\\n\"+\"attribute float eyeIdx;\\n\"+\"varying float vrOffset;\\n\"+\"varying float fragEyeIdx;\\n\"+\"\\n\"+\"void main(void) {\\n\"+\"   vec2 texCoord = (position.xy + 1.0) * 0.5;\\n\"+\"   fragTexCoord = texCoord * scale + translation;\\n\"+\" fragEyeIdx = eyeIdx;\\n\"+\"   gl_Position = vec4(position.xy, 0.0, 1.0);\\n\"+\" if(isVR == 1.0){\\n\"+\"     vrOffset = eyeIdx * 0.5;\\n\"+\"     gl_Position.x *= 0.5;\\n\"+\"     gl_Position.x += vrOffset * gl_Position.w;\\n\"+\" }\\n\"+\"}\\n\";var vertexShader=gl.createShader(gl.VERTEX_SHADER);gl.shaderSource(vertexShader,shader);gl.compileShader(vertexShader);if(!gl.getShaderParameter(vertexShader,gl.COMPILE_STATUS)){x3dom.debug.logError(\"[BackgroundTextureShader] VertexShader \"+gl.getShaderInfoLog(vertexShader));}\nreturn vertexShader;};x3dom.shader.BackgroundTextureShader.prototype.generateFragmentShader=function(gl)\n{var shader=\"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n\";shader+=\"precision highp float;\\n\";shader+=\"#else\\n\";shader+=\" precision mediump float;\\n\";shader+=\"#endif\\n\\n\";shader+=\"uniform float isVR;\\n\"+\"varying float vrOffset;\\n\"+\"varying float fragEyeIdx;\\n\"+\"uniform float screenWidth;\\n\"+\"uniform sampler2D tex;\\n\"+\"varying vec2 fragTexCoord;\\n\"+\"\\n\"+\"void main(void) {\\n\"+\"    if ( isVR == 1.0 ) {\\n\"+\"        if ( ( step( 0.5, gl_FragCoord.x / screenWidth ) - 0.5 ) * vrOffset < 0.0 ) discard;\\n\"+\"    }\\n\"+\"    gl_FragColor = texture2D(tex, fragTexCoord);\\n\"+\"}\";var fragmentShader=gl.createShader(gl.FRAGMENT_SHADER);gl.shaderSource(fragmentShader,shader);gl.compileShader(fragmentShader);if(!gl.getShaderParameter(fragmentShader,gl.COMPILE_STATUS)){x3dom.debug.logError(\"[BackgroundTextureShader] FragmentShader \"+gl.getShaderInfoLog(fragmentShader));}\nreturn fragmentShader;};x3dom.shader.BackgroundSkyTextureShader=function(gl)\n{this.program=gl.createProgram();var vertexShader=this.generateVertexShader(gl);var fragmentShader=this.generateFragmentShader(gl);gl.attachShader(this.program,vertexShader);gl.attachShader(this.program,fragmentShader);gl.bindAttribLocation(this.program,0,\"position\");gl.linkProgram(this.program);return this.program;};x3dom.shader.BackgroundSkyTextureShader.prototype.generateVertexShader=function(gl)\n{var shader=\"attribute vec3 position;\\n\"+\"attribute vec2 texcoord;\\n\"+\"uniform mat4 modelViewProjectionMatrix;\\n\"+\"uniform mat4 modelViewProjectionMatrix2;\\n\"+\"varying vec2 fragTexCoord;\\n\"+\"uniform float isVR;\\n\"+\"attribute float eyeIdx;\\n\"+\"varying float vrOffset;\\n\"+\"varying float fragEyeIdx;\\n\"+\"\\n\"+\"void main(void) {\\n\"+\"    fragTexCoord = texcoord;\\n\"+\"  fragEyeIdx = eyeIdx;\\n\"+\"  if(eyeIdx == 1.0){\\n\"+\"    gl_Position = modelViewProjectionMatrix2 * vec4(position, 1.0);\\n\"+\"  } else {\\n\"+\"    gl_Position = modelViewProjectionMatrix * vec4(position, 1.0);\\n\"+\"  }\\n\"+\"  if(isVR == 1.0){\\n\"+\"     vrOffset = eyeIdx * 0.5;\\n\"+\"     gl_Position.x *= 0.5;\\n\"+\"     gl_Position.x += vrOffset * gl_Position.w;\\n\"+\"  }\\n\"+\"}\\n\";var vertexShader=gl.createShader(gl.VERTEX_SHADER);gl.shaderSource(vertexShader,shader);gl.compileShader(vertexShader);if(!gl.getShaderParameter(vertexShader,gl.COMPILE_STATUS)){x3dom.debug.logError(\"[BackgroundSkyTextureShader] VertexShader \"+gl.getShaderInfoLog(vertexShader));}\nreturn vertexShader;};x3dom.shader.BackgroundSkyTextureShader.prototype.generateFragmentShader=function(gl)\n{var shader=\"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n\";shader+=\"precision highp float;\\n\";shader+=\"#else\\n\";shader+=\" precision mediump float;\\n\";shader+=\"#endif\\n\\n\";shader+=\"uniform float isVR;\\n\"+\"varying float vrOffset;\\n\"+\"varying float fragEyeIdx;\\n\"+\"uniform float screenWidth;\\n\"+\"uniform sampler2D tex;\\n\"+\"varying vec2 fragTexCoord;\\n\"+\"\\n\"+\"void main(void) {\\n\"+\"    if ( isVR == 1.0 ) {\\n\"+\"        if ( ( step( 0.5, gl_FragCoord.x / screenWidth ) - 0.5 ) * vrOffset < 0.0 ) discard;\\n\"+\"    }\\n\"+\"    gl_FragColor = texture2D(tex, fragTexCoord);\\n\"+\"}\\n\";var fragmentShader=gl.createShader(gl.FRAGMENT_SHADER);gl.shaderSource(fragmentShader,shader);gl.compileShader(fragmentShader);if(!gl.getShaderParameter(fragmentShader,gl.COMPILE_STATUS)){x3dom.debug.logError(\"[BackgroundSkyTextureShader] FragmentShader \"+gl.getShaderInfoLog(fragmentShader));}\nreturn fragmentShader;};x3dom.shader.BackgroundCubeTextureShader=function(gl)\n{this.program=gl.createProgram();var vertexShader=this.generateVertexShader(gl);var fragmentShader=this.generateFragmentShader(gl);gl.attachShader(this.program,vertexShader);gl.attachShader(this.program,fragmentShader);gl.bindAttribLocation(this.program,0,\"position\");gl.linkProgram(this.program);return this.program;};x3dom.shader.BackgroundCubeTextureShader.prototype.generateVertexShader=function(gl)\n{var shader=\"attribute vec3 position;\\n\"+\"uniform mat4 modelViewProjectionMatrix;\\n\"+\"varying vec3 fragNormal;\\n\"+\"\\n\"+\"void main(void) {\\n\"+\"    fragNormal = normalize(position);\\n\"+\"    gl_Position = modelViewProjectionMatrix * vec4(position, 1.0);\\n\"+\"}\\n\";var vertexShader=gl.createShader(gl.VERTEX_SHADER);gl.shaderSource(vertexShader,shader);gl.compileShader(vertexShader);if(!gl.getShaderParameter(vertexShader,gl.COMPILE_STATUS)){x3dom.debug.logError(\"[BackgroundCubeTextureShader] VertexShader \"+gl.getShaderInfoLog(vertexShader));}\nreturn vertexShader;};x3dom.shader.BackgroundCubeTextureShader.prototype.generateFragmentShader=function(gl)\n{var shader=\"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n\";shader+=\"precision highp float;\\n\";shader+=\"#else\\n\";shader+=\" precision mediump float;\\n\";shader+=\"#endif\\n\\n\";shader+=\"uniform samplerCube tex;\\n\"+\"varying vec3 fragNormal;\\n\"+\"\\n\"+\"float magn(float val) {\\n\"+\"    return ((val >= 0.0) ? val : -1.0 * val);\\n\"+\"}\"+\"\\n\"+\"void main(void) {\\n\"+\"    gl_FragColor = textureCube(tex, fragNormal);\\n\"+\"}\\n\";var fragmentShader=gl.createShader(gl.FRAGMENT_SHADER);gl.shaderSource(fragmentShader,shader);gl.compileShader(fragmentShader);if(!gl.getShaderParameter(fragmentShader,gl.COMPILE_STATUS)){x3dom.debug.logError(\"[BackgroundCubeTextureShader] FragmentShader \"+gl.getShaderInfoLog(fragmentShader));}\nreturn fragmentShader;};x3dom.shader.BackgroundCubeTextureDDSShader=function(gl)\n{this.program=gl.createProgram();var vertexShader=this.generateVertexShader(gl);var fragmentShader=this.generateFragmentShader(gl);gl.attachShader(this.program,vertexShader);gl.attachShader(this.program,fragmentShader);gl.bindAttribLocation(this.program,0,\"position\");gl.linkProgram(this.program);if(!gl.getProgramParameter(this.program,gl.LINK_STATUS)){throw(\"Error linking shaders:\"+gl.getProgramInfoLog(this.program));}\nreturn this.program;};x3dom.shader.BackgroundCubeTextureDDSShader.prototype.generateVertexShader=function(gl)\n{var shader=\"attribute vec3 position;\\n\"+\"uniform mat4 modelViewProjectionMatrix;\\n\"+\"uniform mat4 modelViewProjectionMatrix2;\\n\"+\"varying vec3 fragNormal;\\n\"+\"uniform float isVR;\\n\"+\"attribute float eyeIdx;\\n\"+\"varying float vrOffset;\\n\"+\"varying float fragEyeIdx;\\n\"+\"\\n\"+\"void main(void) {\\n\"+\" fragEyeIdx = eyeIdx;\\n\"+\"   fragNormal = normalize(position);\\n\"+\" if(eyeIdx == 1.0){\\n\"+\"    gl_Position = modelViewProjectionMatrix2 * vec4(position, 1.0);\\n\"+\" } else {\\n\"+\"    gl_Position = modelViewProjectionMatrix * vec4(position, 1.0);\\n\"+\" }\\n\"+\" if(isVR == 1.0){\\n\"+\"     vrOffset = eyeIdx * 0.5;\\n\"+\"     gl_Position.x *= 0.5;\\n\"+\"     gl_Position.x += vrOffset * gl_Position.w;\\n\"+\" }\\n\"+\"}\\n\";var vertexShader=gl.createShader(gl.VERTEX_SHADER);gl.shaderSource(vertexShader,shader);gl.compileShader(vertexShader);if(!gl.getShaderParameter(vertexShader,gl.COMPILE_STATUS)){x3dom.debug.logError(\"[BackgroundCubeTextureShader] VertexShader \"+gl.getShaderInfoLog(vertexShader));}\nreturn vertexShader;};x3dom.shader.BackgroundCubeTextureDDSShader.prototype.generateFragmentShader=function(gl)\n{var shader=\"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n\";shader+=\"precision highp float;\\n\";shader+=\"#else\\n\";shader+=\" precision mediump float;\\n\";shader+=\"#endif\\n\\n\";shader+=x3dom.shader.toneMapping();shader+=x3dom.shader.gammaCorrectionDecl({});shader+=\"uniform float isVR;\\n\"+\"varying float vrOffset;\\n\"+\"varying float fragEyeIdx;\\n\"+\"uniform float screenWidth;\\n\"+\"uniform samplerCube tex;\\n\"+\"varying vec3 fragNormal;\\n\"+\"\\n\"+\"void main(void) {\\n\"+\" if ( isVR == 1.0 ) {\\n\"+\"    if ( ( step( 0.5, gl_FragCoord.x / screenWidth ) - 0.5 ) * vrOffset < 0.0 ) discard;\\n\"+\" }\\n\"+\"   vec4 color = textureCube(tex, fragNormal);\\n\"+\" if(tonemappingOperator == 1.0) {\\n\"+\"    color.rgb = tonemapReinhard(color.rgb);\\n\"+\" }\\n\"+\" if(tonemappingOperator == 2.0) {\\n\"+\"    color.rgb = tonemapUncharted2(color.rgb);\\n\"+\" }\\n\"+\" if(tonemappingOperator == 3.0) {\\n\"+\"    color.rgb = tonemapeFilmic(color.rgb);\\n\"+\" }\\n\"+\"   color = \"+x3dom.shader.encodeGamma({},\"color\")+\";\\n\"+\"   gl_FragColor = color;\\n\"+\"}\\n\";var fragmentShader=gl.createShader(gl.FRAGMENT_SHADER);gl.shaderSource(fragmentShader,shader);gl.compileShader(fragmentShader);if(!gl.getShaderParameter(fragmentShader,gl.COMPILE_STATUS)){x3dom.debug.logError(\"[BackgroundCubeTextureShader] FragmentShader \"+gl.getShaderInfoLog(fragmentShader));}\nreturn fragmentShader;};x3dom.shader.ShadowRenderingShader=function(gl,shadowedLights)\n{this.program=gl.createProgram();var vertexShader=this.generateVertexShader(gl);var fragmentShader=this.generateFragmentShader(gl,shadowedLights);gl.attachShader(this.program,vertexShader);gl.attachShader(this.program,fragmentShader);gl.bindAttribLocation(this.program,0,\"position\");gl.linkProgram(this.program);return this.program;};x3dom.shader.ShadowRenderingShader.prototype.generateVertexShader=function(gl)\n{var shader=\"\";shader+=\"attribute vec2 position;\\n\";shader+=\"varying vec2 vPosition;\\n\";shader+=\"void main(void) {\\n\";shader+=\" vPosition = position;\\n\";shader+=\" gl_Position = vec4(position, -1.0, 1.0);\\n\";shader+=\"}\\n\";var vertexShader=gl.createShader(gl.VERTEX_SHADER);gl.shaderSource(vertexShader,shader);gl.compileShader(vertexShader);if(!gl.getShaderParameter(vertexShader,gl.COMPILE_STATUS)){x3dom.debug.logError(\"[ShadowRendering] VertexShader \"+gl.getShaderInfoLog(vertexShader));}\nreturn vertexShader;};x3dom.shader.ShadowRenderingShader.prototype.generateFragmentShader=function(gl,shadowedLights)\n{var shader=\"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n\";shader+=\"precision highp float;\\n\";shader+=\"#else\\n\";shader+=\" precision mediump float;\\n\";shader+=\"#endif\\n\\n\";shader+=\"uniform mat4 inverseViewProj;\\n\";shader+=\"uniform mat4 inverseProj;\\n\";shader+=\"varying vec2 vPosition;\\n\";shader+=\"uniform sampler2D sceneMap;\\n\";for(var i=0;i<5;i++)\nshader+=\"uniform float cascade\"+i+\"_Depth;\\n\";for(var l=0;l<shadowedLights.length;l++){shader+=\"uniform float light\"+l+\"_On;\\n\"+\"uniform float light\"+l+\"_Type;\\n\"+\"uniform vec3  light\"+l+\"_Location;\\n\"+\"uniform vec3  light\"+l+\"_Direction;\\n\"+\"uniform vec3  light\"+l+\"_Attenuation;\\n\"+\"uniform float light\"+l+\"_Radius;\\n\"+\"uniform float light\"+l+\"_BeamWidth;\\n\"+\"uniform float light\"+l+\"_CutOffAngle;\\n\"+\"uniform float light\"+l+\"_ShadowIntensity;\\n\"+\"uniform float light\"+l+\"_ShadowOffset;\\n\"+\"uniform mat4 light\"+l+\"_ViewMatrix;\\n\";for(var j=0;j<6;j++){shader+=\"uniform mat4 light\"+l+\"_\"+j+\"_Matrix;\\n\";shader+=\"uniform sampler2D light\"+l+\"_\"+j+\"_ShadowMap;\\n\";}\nfor(var j=0;j<5;j++)\nshader+=\"uniform float light\"+l+\"_\"+j+\"_Split;\\n\";}\nif(!x3dom.caps.FP_TEXTURES||x3dom.caps.MOBILE)\nshader+=x3dom.shader.rgbaPacking();shader+=x3dom.shader.shadowRendering();shader+=x3dom.shader.gammaCorrectionDecl({});shader+=\"void main(void) {\\n\"+\" float shadowValue = 1.0;\\n\"+\" vec2 texCoordsSceneMap = (vPosition + 1.0)*0.5;\\n\"+\" vec4 projCoords = texture2D(sceneMap, texCoordsSceneMap);\\n\"+\" if (projCoords != vec4(1.0,1.0,1.0,0.0)){\\n\";if(!x3dom.caps.FP_TEXTURES||x3dom.caps.MOBILE){shader+=\" projCoords.z = unpackDepth(projCoords);\\n\"+\" projCoords.w = 1.0;\\n\";}\nshader+=\" projCoords = projCoords / projCoords.w;\\n\"+\" projCoords.xy = vPosition;\\n\"+\" vec4 eyeCoords = inverseProj*projCoords;\\n\"+\" vec4 worldCoords = inverseViewProj*projCoords;\\n\"+\" float lightInfluence = 0.0;\\n\";for(var l=0;l<shadowedLights.length;l++){shader+=\" lightInfluence = getLightInfluence(light\"+l+\"_Type, light\"+l+\"_ShadowIntensity, light\"+l+\"_On, light\"+l+\"_Location, light\"+l+\"_Direction, \"+\"light\"+l+\"_CutOffAngle, light\"+l+\"_BeamWidth, light\"+l+\"_Attenuation, light\"+l+\"_Radius, eyeCoords.xyz/eyeCoords.w);\\n\"+\" if (lightInfluence != 0.0){\\n\"+\"  vec4 shadowMapValues;\\n\"+\"  float viewSampleDepth;\\n\";if(!x3dom.isa(shadowedLights[l],x3dom.nodeTypes.PointLight)){shader+=\"  getShadowValuesCascaded(shadowMapValues, viewSampleDepth, worldCoords, -eyeCoords.z/eyeCoords.w,\"+\"light\"+l+\"_0_Matrix,light\"+l+\"_1_Matrix,light\"+l+\"_2_Matrix,light\"+l+\"_3_Matrix,light\"+l+\"_4_Matrix,light\"+l+\"_5_Matrix,\"+\"light\"+l+\"_0_ShadowMap,light\"+l+\"_1_ShadowMap,light\"+l+\"_2_ShadowMap,light\"+l+\"_3_ShadowMap,\"+\"light\"+l+\"_4_ShadowMap,light\"+l+\"_5_ShadowMap, light\"+l+\"_0_Split, light\"+l+\"_1_Split, light\"+l+\"_2_Split, light\"+l+\"_3_Split, \\n\"+\"light\"+l+\"_4_Split);\\n\";}else{shader+=\"  getShadowValuesPointLight(shadowMapValues, viewSampleDepth, light\"+l+\"_Location, worldCoords, light\"+l+\"_ViewMatrix, \"+\"light\"+l+\"_0_Matrix,light\"+l+\"_1_Matrix,light\"+l+\"_2_Matrix,light\"+l+\"_3_Matrix,light\"+l+\"_4_Matrix,light\"+l+\"_5_Matrix,\"+\"light\"+l+\"_0_ShadowMap,light\"+l+\"_1_ShadowMap,light\"+l+\"_2_ShadowMap,light\"+l+\"_3_ShadowMap,\"+\"light\"+l+\"_4_ShadowMap,light\"+l+\"_5_ShadowMap);\\n\";}\nif(!x3dom.caps.FP_TEXTURES||x3dom.caps.MOBILE)\nshader+=\" shadowValue *= clamp(ESM(shadowMapValues.z, viewSampleDepth, light\"+l+\"_ShadowOffset), \"+\"    1.0 - light\"+l+\"_ShadowIntensity*lightInfluence, 1.0);\\n\";else\nshader+=\"  shadowValue *= clamp(VSM(shadowMapValues.zy, viewSampleDepth, light\"+l+\"_ShadowOffset), \"+\"    1.0 - light\"+l+\"_ShadowIntensity*lightInfluence, 1.0);\\n\";shader+=\" }\\n\";}\nshader+=\"}\\n\"+\" gl_FragColor = \"+x3dom.shader.encodeGamma({},\"vec4(shadowValue, shadowValue, shadowValue, 1.0)\")+\";\\n\"+\"}\\n\";var fragmentShader=gl.createShader(gl.FRAGMENT_SHADER);gl.shaderSource(fragmentShader,shader);gl.compileShader(fragmentShader);if(!gl.getShaderParameter(fragmentShader,gl.COMPILE_STATUS)){x3dom.debug.logError(\"[ShadowRendering] FragmentShader \"+gl.getShaderInfoLog(fragmentShader));}\nreturn fragmentShader;};x3dom.shader.TextureRefinementShader=function(gl){this.program=gl.createProgram();var vertexShader=this.generateVertexShader(gl);var fragmentShader=this.generateFragmentShader(gl);gl.attachShader(this.program,vertexShader);gl.attachShader(this.program,fragmentShader);gl.bindAttribLocation(this.program,0,\"position\");gl.linkProgram(this.program);return this.program;};x3dom.shader.TextureRefinementShader.prototype.generateVertexShader=function(gl){var shader=\"attribute vec2 position;\\n\"+\"varying vec2 fragTexCoord;\\n\"+\"\\n\"+\"void main(void) {\\n\"+\"    fragTexCoord = (position.xy + 1.0) / 2.0;\\n\"+\"    gl_Position = vec4(position, -1.0, 1.0);\\n\"+\"}\\n\";var vertexShader=gl.createShader(gl.VERTEX_SHADER);gl.shaderSource(vertexShader,shader);gl.compileShader(vertexShader);if(!gl.getShaderParameter(vertexShader,gl.COMPILE_STATUS)){x3dom.debug.logError(\"[TextureRefinementShader] VertexShader \"+gl.getShaderInfoLog(vertexShader));}\nreturn vertexShader;};x3dom.shader.TextureRefinementShader.prototype.generateFragmentShader=function(gl){var shader=\"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n\"+\" precision highp float;\\n\"+\"#else\\n\"+\" precision mediump float;\\n\"+\"#endif\\n\\n\";shader+=\"uniform sampler2D stamp;\\n\"+\"uniform sampler2D lastTex;\\n\"+\"uniform sampler2D curTex;\\n\"+\"uniform int mode;\\n\"+\"uniform vec2 repeat;\\n\"+\"varying vec2 fragTexCoord;\\n\"+\"\\n\"+\"void init(void);\\n\"+\"void refine(void);\\n\"+\"\\n\"+\"void main(void) {\\n\"+\"    if (mode == 0) { init(); }\\n\"+\"    else { refine(); }\\n\"+\"}\\n\"+\"\\n\"+\"void init(void) {\\n\"+\"    gl_FragColor = texture2D(curTex, fragTexCoord);\\n\"+\"}\\n\"+\"\\n\"+\"void refine(void) {\\n\"+\"    vec3 red = texture2D(stamp, repeat * fragTexCoord).rgb;\\n\"+\"    vec3 v1  = texture2D(lastTex, fragTexCoord).rgb;\\n\"+\"    vec3 v2  = texture2D(curTex, fragTexCoord).rgb;\\n\"+\"    if (red.r <= 0.5) {\\n\"+\"        gl_FragColor = vec4(v1, 1.0);\\n\"+\"    }\\n\"+\"    else {\\n\"+\"        gl_FragColor = vec4(v2, 1.0);\\n\"+\"    }\\n\"+\"}\\n\";var fragmentShader=gl.createShader(gl.FRAGMENT_SHADER);gl.shaderSource(fragmentShader,shader);gl.compileShader(fragmentShader);if(!gl.getShaderParameter(fragmentShader,gl.COMPILE_STATUS)){x3dom.debug.logError(\"[TextureRefinementShader] FragmentShader \"+gl.getShaderInfoLog(fragmentShader));}\nreturn fragmentShader;};x3dom.shader.BlurShader=function(gl)\n{this.program=gl.createProgram();var vertexShader=this.generateVertexShader(gl);var fragmentShader=this.generateFragmentShader(gl);gl.attachShader(this.program,vertexShader);gl.attachShader(this.program,fragmentShader);gl.bindAttribLocation(this.program,0,\"position\");gl.linkProgram(this.program);return this.program;};x3dom.shader.BlurShader.prototype.generateVertexShader=function(gl)\n{var shader=\"\";shader+=\"attribute vec2 position;\\n\";shader+=\"varying vec2 vPosition;\\n\";shader+=\"void main(void) {\\n\";shader+=\" vPosition = position;\\n\";shader+=\" gl_Position = vec4(position, -1.0, 1.0);\\n\";shader+=\"}\\n\";var vertexShader=gl.createShader(gl.VERTEX_SHADER);gl.shaderSource(vertexShader,shader);gl.compileShader(vertexShader);if(!gl.getShaderParameter(vertexShader,gl.COMPILE_STATUS)){x3dom.debug.logError(\"[BlurShader] VertexShader \"+gl.getShaderInfoLog(vertexShader));}\nreturn vertexShader;};x3dom.shader.BlurShader.prototype.generateFragmentShader=function(gl)\n{var shader=\"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n\";shader+=\"precision highp float;\\n\";shader+=\"#else\\n\";shader+=\" precision mediump float;\\n\";shader+=\"#endif\\n\\n\";shader+=\"varying vec2 vPosition;\\n\"+\"uniform sampler2D texture;\\n\"+\"uniform bool horizontal;\\n\"+\"uniform float pixelSizeHor;\\n\"+\"uniform float pixelSizeVert;\\n\"+\"uniform int filterSize;\\n\";if(!x3dom.caps.FP_TEXTURES||x3dom.caps.MOBILE){shader+=x3dom.shader.rgbaPacking()+\"void main(void) {\\n\"+\" vec2 texCoords = (vPosition + 1.0)*0.5;\\n\"+\" vec2 offset;\\n\"+\" if (horizontal) offset = vec2(pixelSizeHor, 0.0);\\n\"+\" else offset = vec2(0.0, pixelSizeVert);\\n\"+\" float depth = unpackDepth(texture2D(texture, texCoords));\\n\"+\" if (filterSize == 3){\\n\"+\"  depth = depth * 0.3844;\\n\"+\"  depth += 0.3078*unpackDepth(texture2D(texture, texCoords-offset));\\n\"+\"  depth += 0.3078*unpackDepth(texture2D(texture, texCoords+offset));\\n\"+\" } else if (filterSize == 5){\\n\"+\"  depth = depth * 0.2921;\\n\"+\"  depth += 0.2339*unpackDepth(texture2D(texture, texCoords-offset));\\n\"+\"  depth += 0.2339*unpackDepth(texture2D(texture, texCoords+offset));\\n\"+\"  depth += 0.1201*unpackDepth(texture2D(texture, texCoords-2.0*offset));\\n\"+\"  depth += 0.1201*unpackDepth(texture2D(texture, texCoords+2.0*offset));\\n\"+\" } else if (filterSize == 7){\\n\"+\"  depth = depth * 0.2161;\\n\"+\"  depth += 0.1907*unpackDepth(texture2D(texture, texCoords-offset));\\n\"+\"  depth += 0.1907*unpackDepth(texture2D(texture, texCoords+offset));\\n\"+\"  depth += 0.1311*unpackDepth(texture2D(texture, texCoords-2.0*offset));\\n\"+\"  depth += 0.1311*unpackDepth(texture2D(texture, texCoords+2.0*offset));\\n\"+\"  depth += 0.0702*unpackDepth(texture2D(texture, texCoords-3.0*offset));\\n\"+\"  depth += 0.0702*unpackDepth(texture2D(texture, texCoords+3.0*offset));\\n\"+\" }\\n\"+\" gl_FragColor = packDepth(depth);\\n\"+\"}\\n\";}else{shader+=\"void main(void) {\\n\"+\" vec2 texCoords = (vPosition + 1.0)*0.5;\\n\"+\" vec2 offset;\\n\"+\" if (horizontal) offset = vec2(pixelSizeHor, 0.0);\\n\"+\" else offset = vec2(0.0, pixelSizeVert);\\n\"+\" vec4 color = texture2D(texture, texCoords);\\n\"+\" if (filterSize == 3){\\n\"+\"  color = color * 0.3844;\\n\"+\"  color += 0.3078*texture2D(texture, texCoords-offset);\\n\"+\"  color += 0.3078*texture2D(texture, texCoords+offset);\\n\"+\" } else if (filterSize == 5){\\n\"+\"  color = color * 0.2921;\\n\"+\"  color += 0.2339*texture2D(texture, texCoords-offset);\\n\"+\"  color += 0.2339*texture2D(texture, texCoords+offset);\\n\"+\"  color += 0.1201*texture2D(texture, texCoords-2.0*offset);\\n\"+\"  color += 0.1201*texture2D(texture, texCoords+2.0*offset);\\n\"+\" } else if (filterSize == 7){\\n\"+\"  color = color * 0.2161;\\n\"+\"  color += 0.1907*texture2D(texture, texCoords-offset);\\n\"+\"  color += 0.1907*texture2D(texture, texCoords+offset);\\n\"+\"  color += 0.1311*texture2D(texture, texCoords-2.0*offset);\\n\"+\"  color += 0.1311*texture2D(texture, texCoords+2.0*offset);\\n\"+\"  color += 0.0702*texture2D(texture, texCoords-3.0*offset);\\n\"+\"  color += 0.0702*texture2D(texture, texCoords+3.0*offset);\\n\"+\" }\\n\"+\" gl_FragColor = color;\\n\"+\"}\\n\";}\nvar fragmentShader=gl.createShader(gl.FRAGMENT_SHADER);gl.shaderSource(fragmentShader,shader);gl.compileShader(fragmentShader);if(!gl.getShaderParameter(fragmentShader,gl.COMPILE_STATUS)){x3dom.debug.logError(\"[BlurShader] FragmentShader \"+gl.getShaderInfoLog(fragmentShader));}\nreturn fragmentShader;};x3dom.shader.KHRMaterialCommonsShader=function(gl,properties)\n{this.program=gl.createProgram();var vertexShader=this.generateVertexShader(gl);var fragmentShader=this.generateFragmentShader(gl,properties);gl.attachShader(this.program,vertexShader);gl.attachShader(this.program,fragmentShader);gl.bindAttribLocation(this.program,0,\"position\");gl.linkProgram(this.program);return this.program;};x3dom.shader.KHRMaterialCommonsShader.prototype.generateVertexShader=function(gl)\n{var shader=\"precision highp float;\\n\"+\"attribute vec3 position;\"+\"attribute vec3 normal;\"+\"attribute vec3 texcoord;\"+\"varying vec3 v_eye;\"+\"varying vec3 v_normal;\"+\"varying vec3 v_texcoord;\"+\"uniform mat4 modelViewProjectionMatrix;\"+\"uniform mat4 modelViewMatrix;\"+\"uniform mat4 normalMatrix;\"+\"void main (void)\"+\"{\"+\"    vec4 pos = modelViewProjectionMatrix * vec4(position, 1.0);\"+\"    v_eye = (modelViewMatrix * vec4(position, 1.0)).xyz;\"+\"    v_normal = normalize((normalMatrix * vec4(normal,1.0)).xyz);\"+\"    v_texcoord = texcoord;\"+\"    gl_Position = pos;\"+\"}\";var vertexShader=gl.createShader(gl.VERTEX_SHADER);gl.shaderSource(vertexShader,shader);gl.compileShader(vertexShader);if(!gl.getShaderParameter(vertexShader,gl.COMPILE_STATUS)){x3dom.debug.logError(\"[KHRMaterialCommonsShader] VertexShader \"+gl.getShaderInfoLog(vertexShader));}\nreturn vertexShader;};x3dom.shader.KHRMaterialCommonsShader.prototype.generateFragmentShader=function(gl,properties)\n{var shader=\"precision highp float;\\n\"+\"varying vec3 v_eye;\\n\"+\"varying vec3 v_normal;\\n\"+\"varying vec3 v_texcoord;\\n\"+\"uniform vec4 lightVector;\\n\"+\"uniform vec4 ambient;\\n\";if(properties.LIGHTS||properties.CLIPPLANES)\n{shader+=\"varying vec4 fragPosition;\\n\";shader+=\"uniform float isOrthoView;\\n\";}\nif(properties.LIGHTS){if(properties.NORMALMAP&&properties.NORMALSPACE==\"OBJECT\"){}else{shader+=\"varying vec3 fragNormal;\\n\";}\nshader+=x3dom.shader.light(properties.LIGHTS);}\nif(properties.USE_DIFFUSE_TEX==0)\nshader+=\"uniform vec4 diffuse;\\n\";else\nshader+=\"uniform sampler2D diffuseTex;\\n\";if(properties.USE_EMISSION_TEX==0)\nshader+=\"uniform vec4 emission;\\n\";else\nshader+=\"uniform sampler2D emissionTex;\\n\";if(properties.USE_SPECULAR_TEX==0)\nshader+=\"uniform vec4 specular;\\n\";else\nshader+=\"uniform sampler2D specularTex;\\n\";shader+=\"uniform float shininess;\\n\"+\"uniform float transparency;\\n\"+\"uniform float ambientIntensity;\\n\"+\"uniform vec4 ambientLight;\\n\"+\"uniform int technique;\\n\"+\"void main(void)\\n\"+\"{\\n\"+\"vec4 I = -vec4(normalize(v_eye),1.0);\\n\"+\"vec4 N = vec4(v_normal,1.0);\\n\"+\"vec4 al = ambientLight;\\n\"+\"vec4 L = normalize(lightVector-vec4(v_eye,1.0));\\n\";if(properties.USE_DIFFUSE_TEX==0)\nshader+=\"vec4 _diffuse = diffuse;\\n\";else\nshader+=\"vec4 _diffuse = texture2D(diffuseTex, v_texcoord.xy);\\n\";if(properties.USE_SPECULAR_TEX==0)\nshader+=\"vec4 _specularColor = specular;\\n\";else\nshader+=\"vec4 _specularColor = texture2D(specularTex, v_texcoord.xy);\\n\";if(properties.USE_EMISSION_TEX==0)\nshader+=\"vec4 _emission = emission;\\n\";else\nshader+=\"vec4 _emission = texture2D(emissionTex, v_texcoord.xy);\\n\";shader+=\"vec4 color;\\n\"+\"if(technique == 0) // BLINN\\n\"+\"{\\n\"+\"vec4 H = normalize(I+L);\\n\"+\"color = _emission + ambient * al + _diffuse * max(dot(N,L),0.0) + _specularColor * pow(max(dot(H,N),0.0),shininess);\\n\"+\"}\\n\"+\"else if(technique==1) // PHONG\\n\"+\"{\\n\"+\"vec4 R = -reflect(L,N);\\n\"+\"color = _emission + ambient * al + _diffuse * max(dot(N,L),0.0) + _specularColor * pow(max(dot(R,I),0.0),shininess);\\n\"+\"}\\n\"+\"else if(technique==2) // LAMBERT\\n\"+\"{\\n\"+\"color = _emission + ambient * al + _diffuse * max(dot(N,L), 0.0);\\n\"+\"}\\n\"+\"else if(technique==3) // CONSTANT\\n\"+\"{\\n\"+\"color = _emission + ambient * al;\\n\"+\"}\\n\";if(properties.LIGHTS){shader+=\"vec3 ambient   = vec3(0.0, 0.0, 0.0);\\n\";shader+=\"vec3 diffuse   = vec3(0.0, 0.0, 0.0);\\n\";shader+=\"vec3 specular  = vec3(0.0, 0.0, 0.0);\\n\";shader+=\"vec3 eye;\\n\";shader+=\"if ( isOrthoView > 0.0 ) {\\n\";shader+=\"    eye = vec3(0.0, 0.0, 1.0);\\n\";shader+=\"} else {\\n\";shader+=\"    eye = -v_eye.xyz;\\n\";shader+=\"}\\n\";shader+=\"float _shininess = shininess * 0.0078125;\\n\";shader+=\"vec3 ads;\\n\";for(var l=0;l<properties.LIGHTS;l++){var lightCol=\"light\"+l+\"_Color\";shader+=\"ads = lighting(light\"+l+\"_Type, \"+\"light\"+l+\"_Location, \"+\"light\"+l+\"_Direction, \"+\nlightCol+\", \"+\"light\"+l+\"_Attenuation, \"+\"light\"+l+\"_Radius, \"+\"light\"+l+\"_Intensity, \"+\"light\"+l+\"_AmbientIntensity, \"+\"light\"+l+\"_BeamWidth, \"+\"light\"+l+\"_CutOffAngle, \"+\"v_normal, eye, _shininess, ambientIntensity);\\n\";shader+=\"ambient  += \"+lightCol+\" * ads.r;\\n\"+\"diffuse  += \"+lightCol+\" * ads.g;\\n\"+\"specular += \"+lightCol+\" * ads.b;\\n\";}\nshader+=\"ambient = max(ambient, 0.0);\\n\";shader+=\"diffuse = max(diffuse, 0.0);\\n\";shader+=\"specular = max(specular, 0.0);\\n\";shader+=\"color.rgb = (_emission.rgb + max(ambient + diffuse, 0.0) * color.rgb + specular*_specularColor.rgb);\\n\";}\nshader+=\"gl_FragColor = vec4(color.rgb, transparency);\\n\"+\"}\";var fragmentShader=gl.createShader(gl.FRAGMENT_SHADER);gl.shaderSource(fragmentShader,shader);gl.compileShader(fragmentShader);if(!gl.getShaderParameter(fragmentShader,gl.COMPILE_STATUS)){x3dom.debug.logError(\"[KHRMaterialCommonsShader] FragmentShader \"+gl.getShaderInfoLog(fragmentShader));}\nreturn fragmentShader;};x3dom.shader.SSAOShader=function(gl)\n{this.program=gl.createProgram();var vertexShader=this.generateVertexShader(gl);var fragmentShader=this.generateFragmentShader(gl);gl.attachShader(this.program,vertexShader);gl.attachShader(this.program,fragmentShader);gl.bindAttribLocation(this.program,0,\"position\");gl.linkProgram(this.program);return this.program;};x3dom.shader.SSAOShader.prototype.generateVertexShader=function(gl)\n{var shader=\"attribute vec3 position;\\n\"+\"varying vec2 depthTexCoord;\\n\"+\"varying vec2 randomTexCoord;\\n\"+\"uniform vec2 randomTextureTilingFactor;\\n\"+\"\\n\"+\"void main(void) {\\n\"+\"    vec2 texCoord = (position.xy + 1.0) * 0.5;\\n\"+\"    depthTexCoord = texCoord;\\n\"+\"  randomTexCoord = randomTextureTilingFactor*texCoord;\\n\"+\"    gl_Position = vec4(position.xy, 0.0, 1.0);\\n\"+\"}\\n\";var vertexShader=gl.createShader(gl.VERTEX_SHADER);gl.shaderSource(vertexShader,shader);gl.compileShader(vertexShader);if(!gl.getShaderParameter(vertexShader,gl.COMPILE_STATUS)){x3dom.debug.logError(\"[SSAOShader] VertexShader \"+gl.getShaderInfoLog(vertexShader));}\nreturn vertexShader;};x3dom.shader.SSAOShader.depthReconsructionFunctionCode=function()\n{var code=\"uniform float depthReconstructionConstantA;\\n\"+\"uniform float depthReconstructionConstantB;\\n\";if(!x3dom.caps.FP_TEXTURES||x3dom.caps.MOBILE)\ncode+=x3dom.shader.rgbaPacking();code+=\"float getDepth(vec2 depthTexCoord) {\\n\"+\"    vec4 col = texture2D(depthTexture, depthTexCoord);\\n\"+\"    float d;\\n\";if(!x3dom.caps.FP_TEXTURES||x3dom.caps.MOBILE){code+=\"    d = unpackDepth(col);\\n\";}else{code+=\"    d = col.b;\\n\"}\ncode+=\"    return depthReconstructionConstantB/(depthReconstructionConstantA+d);\\n\";code+=\"}\\n\";return code;}\nx3dom.shader.SSAOShader.prototype.generateFragmentShader=function(gl)\n{var shader=\"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n\";shader+=\"precision highp float;\\n\";shader+=\"#else\\n\";shader+=\" precision mediump float;\\n\";shader+=\"#endif\\n\\n\";shader+=\"uniform sampler2D depthTexture;\\n\"+\"uniform sampler2D randomTexture;\\n\"+\"uniform float nearPlane;\\n\"+\"uniform float farPlane;\\n\"+\"uniform float radius;\\n\"+\"uniform float depthBufferEpsilon;\\n\"+\"uniform vec3 samples[16];\\n\"+\"varying vec2 depthTexCoord;\\n\"+\"varying vec2 randomTexCoord;\\n\";shader+=x3dom.shader.SSAOShader.depthReconsructionFunctionCode();shader+=\"void main(void) {\\n\"+\"    float referenceDepth = getDepth(depthTexCoord);\\n\"+\"    if(referenceDepth == 1.0)\\n\"+\"    {\\n\"+\"        gl_FragColor = vec4(1.0,1.0,1.0, 1.0);\\n\"+\"        return;\\n\"+\"    }\\n\"+\"    int numOcclusions = 0;\\n\"+\"    for(int i = 0; i<16; ++i){\\n\"+\"        float scale  = 1.0/referenceDepth;\\n\"+\"        vec3 samplepos = reflect(samples[i],texture2D(randomTexture,randomTexCoord).xyz*2.0-vec3(1.0,1.0,1.0));\\n\"+\"        float sampleDepth = getDepth(depthTexCoord+samplepos.xy*scale*radius);\\n\"+\"        //if(abs(sampleDepth-referenceDepth)<=radius*(1.0/nearPlane))\\n\"+\"        if( sampleDepth < referenceDepth-depthBufferEpsilon) {\\n\"+\"            ++numOcclusions;\\n\"+\"        }\\n\"+\"    }\\n\"+\"    float r = 1.0-float(numOcclusions)/16.0;\\n\"+\"    r*=2.0;\\n\"+\"    gl_FragColor = vec4(r,r,r, 1.0);\\n\"+\"}\\n\";var fragmentShader=gl.createShader(gl.FRAGMENT_SHADER);gl.shaderSource(fragmentShader,shader);gl.compileShader(fragmentShader);if(!gl.getShaderParameter(fragmentShader,gl.COMPILE_STATUS)){x3dom.debug.logError(\"[SSAOhader] FragmentShader \"+gl.getShaderInfoLog(fragmentShader));}\nreturn fragmentShader;};x3dom.shader.SSAOBlurShader=function(gl)\n{this.program=gl.createProgram();var vertexShader=this.generateVertexShader(gl);var fragmentShader=this.generateFragmentShader(gl);gl.attachShader(this.program,vertexShader);gl.attachShader(this.program,fragmentShader);gl.bindAttribLocation(this.program,0,\"position\");gl.linkProgram(this.program);return this.program;};x3dom.shader.SSAOBlurShader.prototype.generateVertexShader=function(gl)\n{var shader=\"attribute vec3 position;\\n\"+\"varying vec2 fragTexCoord;\\n\"+\"\\n\"+\"void main(void) {\\n\"+\"    vec2 texCoord = (position.xy + 1.0) * 0.5;\\n\"+\"    fragTexCoord = texCoord;\\n\"+\"    gl_Position = vec4(position.xy, 0.0, 1.0);\\n\"+\"}\\n\";var vertexShader=gl.createShader(gl.VERTEX_SHADER);gl.shaderSource(vertexShader,shader);gl.compileShader(vertexShader);if(!gl.getShaderParameter(vertexShader,gl.COMPILE_STATUS)){x3dom.debug.logError(\"[SSAOShader] VertexShader \"+gl.getShaderInfoLog(vertexShader));}\nreturn vertexShader;};x3dom.shader.SSAOBlurShader.prototype.generateFragmentShader=function(gl)\n{var shader=\"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n\";shader+=\"precision highp float;\\n\";shader+=\"#else\\n\";shader+=\" precision mediump float;\\n\";shader+=\"#endif\\n\\n\";shader+=\"uniform sampler2D SSAOTexture;\\n\"+\"uniform sampler2D depthTexture;\\n\"+\"uniform float nearPlane;\\n\"+\"uniform float farPlane;\\n\"+\"uniform float amount;\\n\"+\"uniform vec2 pixelSize;\\n\"+\"uniform float depthThreshold;\\n\"+\"varying vec2 fragTexCoord;\\n\";shader+=x3dom.shader.SSAOShader.depthReconsructionFunctionCode();shader+=\"void main(void) {\\n\"+\"    float sum = 0.0;\\n\"+\"    float numSamples = 0.0;\\n\"+\"    float referenceDepth = getDepth(fragTexCoord);\\n\"+\"    for(int i = -2; i<2;i++){\\n\"+\"        for(int j = -2; j<2;j++){\\n\"+\"            vec2 sampleTexCoord = fragTexCoord+vec2(pixelSize.x*float(i),pixelSize.y*float(j));\\n\"+\"            if(abs(referenceDepth - getDepth(sampleTexCoord))<depthThreshold){\\n\"+\"                sum+= texture2D(SSAOTexture,sampleTexCoord).r;\\n\"+\"                numSamples++;\\n\"+\"    }}}\\n\"+\"    float intensity = mix(1.0,sum/numSamples,amount);\\n\"+\"    gl_FragColor = vec4(intensity,intensity,intensity,1.0);\\n\"+\"}\\n\";var fragmentShader=gl.createShader(gl.FRAGMENT_SHADER);gl.shaderSource(fragmentShader,shader);gl.compileShader(fragmentShader);if(!gl.getShaderParameter(fragmentShader,gl.COMPILE_STATUS)){x3dom.debug.logError(\"[SSAOhader] FragmentShader \"+gl.getShaderInfoLog(fragmentShader));}\nreturn fragmentShader;};x3dom.shader.FRAG_COLOR=\"x3dom_fragColor\";x3dom.shader.convertVertexShader=function(shader)\n{shader=shader.replace(/attribute/g,\"in\");shader=shader.replace(/varying/g,\"out\");shader=shader.replace(/texture2D/g,\"texture\");return\"#version 300 es\\n\"+shader;}\nx3dom.shader.convertFragmentShader=function(shader)\n{shader=shader.replace(/varying/g,\"in\");shader=shader.replace(/textureCubeLodEXT/g,\"textureLod\");shader=shader.replace(/texture2D|textureCube/g,\"texture\");shader=shader.replace(/\\/\\/@insertFragColor/g,\"out vec4 \"+x3dom.shader.FRAG_COLOR+\";\\n\");shader=shader.replace(/gl_FragColor/g,x3dom.shader.FRAG_COLOR);return\"#version 300 es\\n\"+shader;}\nx3dom.SSAO={};x3dom.SSAO.isEnabled=function(scene){return scene.getEnvironment()._vf.SSAO};x3dom.SSAO.reinitializeShadersIfNecessary=function(gl){if(x3dom.SSAO.shaderProgram===undefined){x3dom.SSAO.shaderProgram=x3dom.Utils.wrapProgram(gl,new x3dom.shader.SSAOShader(gl),\"ssao\");}\nif(x3dom.SSAO.blurShaderProgram===undefined){x3dom.SSAO.blurShaderProgram=x3dom.Utils.wrapProgram(gl,new x3dom.shader.SSAOBlurShader(gl),\"ssao-blur\");}};x3dom.SSAO.reinitializeRandomTextureIfNecessary=function(gl,scene){var sizeHasChanged=scene.getEnvironment()._vf.SSAOrandomTextureSize!=x3dom.SSAO.currentRandomTextureSize;if(x3dom.SSAO.randomTexture===undefined){x3dom.SSAO.randomTexture=gl.createTexture();}\nif(x3dom.SSAO.randomTexture===undefined||sizeHasChanged){gl.bindTexture(gl.TEXTURE_2D,x3dom.SSAO.randomTexture);var rTexSize=x3dom.SSAO.currentRandomTextureSize=scene.getEnvironment()._vf.SSAOrandomTextureSize;var randomImageBuffer=new ArrayBuffer(rTexSize*rTexSize*4);var randomImageView=new Uint8Array(randomImageBuffer);for(var i=0;i<rTexSize*rTexSize;++i){var x=Math.random()*2.0-1.0;var y=Math.random()*2.0-1.0;var z=0;var length=Math.sqrt(x*x+y*y+z*z);x/=length;y/=length;randomImageView[4*i]=(x+1.0)*0.5*255.0;randomImageView[4*i+1]=(y+1.0)*0.5*255.0;randomImageView[4*i+2]=(z+1.0)*0.5*255.0;randomImageView[4*i+3]=255;}\ngl.texImage2D(gl.TEXTURE_2D,0,gl.RGBA,rTexSize,rTexSize,0,gl.RGBA,gl.UNSIGNED_BYTE,randomImageView);gl.bindTexture(gl.TEXTURE_2D,null);}};x3dom.SSAO.reinitializeFBOIfNecessary=function(gl,canvas){var dimensionsHaveChanged=x3dom.SSAO.currentFBOWidth!=canvas.width||x3dom.SSAO.currentFBOHeight!=canvas.height;if(x3dom.SSAO.fbo===undefined||dimensionsHaveChanged){x3dom.SSAO.currentFBOWidth=canvas.width;x3dom.SSAO.currentFBOHeight=canvas.height;var oldfbo=gl.getParameter(gl.FRAMEBUFFER_BINDING);if(x3dom.SSAO.fbo===undefined){x3dom.SSAO.fbo=gl.createFramebuffer();}\ngl.bindFramebuffer(gl.FRAMEBUFFER,x3dom.SSAO.fbo);if(x3dom.SSAO.fbotex===undefined){x3dom.SSAO.fbotex=gl.createTexture();}\ngl.bindTexture(gl.TEXTURE_2D,x3dom.SSAO.fbotex);gl.texImage2D(gl.TEXTURE_2D,0,gl.RGBA,x3dom.SSAO.currentFBOWidth,x3dom.SSAO.currentFBOHeight,0,gl.RGBA,gl.UNSIGNED_BYTE,null);gl.bindTexture(gl.TEXTURE_2D,null);gl.framebufferTexture2D(gl.FRAMEBUFFER,gl.COLOR_ATTACHMENT0,gl.TEXTURE_2D,x3dom.SSAO.fbotex,0);gl.bindFramebuffer(gl.FRAMEBUFFER,oldfbo);}};x3dom.SSAO.render=function(stateManager,gl,scene,tex,canvas,fbo){var oldfbo=gl.getParameter(gl.FRAMEBUFFER_BINDING);if(fbo!=null){gl.bindFramebuffer(gl.FRAMEBUFFER,fbo);}\nstateManager.frontFace(gl.CCW);stateManager.disable(gl.CULL_FACE);stateManager.disable(gl.DEPTH_TEST);var sp=x3dom.SSAO.shaderProgram;stateManager.useProgram(sp);sp.depthTexture=0;sp.randomTexture=1;sp.radius=scene.getEnvironment()._vf.SSAOradius;sp.randomTextureTilingFactor=[canvas.width/x3dom.SSAO.currentRandomTextureSize,canvas.height/x3dom.SSAO.currentRandomTextureSize];var viewpoint=scene.getViewpoint();var nearPlane=viewpoint.getNear();var farPlane=viewpoint.getFar();sp.nearPlane=nearPlane;sp.farPlane=farPlane;sp.depthReconstructionConstantA=(farPlane+nearPlane)/(nearPlane-farPlane);sp.depthReconstructionConstantB=(2.0*farPlane*nearPlane)/(nearPlane-farPlane);sp.depthBufferEpsilon=0.0001*(farPlane-nearPlane);sp.samples=[0.03800223814729654,0.10441029119843426,-0.04479934806797181,-0.03800223814729654,-0.10441029119843426,0.04479934806797181,-0.17023209847088397,0.1428416910414532,0.6154407640895228,0.17023209847088397,-0.1428416910414532,-0.6154407640895228,-0.288675134594813,-0.16666666666666646,-0.3774214123135722,0.288675134594813,0.16666666666666646,0.3774214123135722,0.07717696785196887,-0.43769233467209245,-0.5201284112706428,-0.07717696785196887,0.43769233467209245,0.5201284112706428,0.5471154183401156,-0.09647120981496134,-0.15886420745887797,-0.5471154183401156,0.09647120981496134,0.15886420745887797,0.3333333333333342,0.5773502691896253,-0.8012446019636266,-0.3333333333333342,-0.5773502691896253,0.8012446019636266,-0.49994591864508653,0.5958123446480936,-0.15385106176844343,0.49994591864508653,-0.5958123446480936,0.15385106176844343,-0.8352823295874743,-0.3040179051783715,0.7825440557226517,0.8352823295874743,0.3040179051783715,-0.7825440557226517];if(!sp.tex){sp.tex=0;}\ngl.activeTexture(gl.TEXTURE0);gl.bindTexture(gl.TEXTURE_2D,tex);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.LINEAR);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.LINEAR);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE);gl.activeTexture(gl.TEXTURE1);gl.bindTexture(gl.TEXTURE_2D,x3dom.SSAO.randomTexture);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.NEAREST);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.NEAREST);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,gl.REPEAT);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,gl.REPEAT);gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER,scene._fgnd._webgl.buffers[x3dom.BUFFER_IDX.INDEX]);gl.bindBuffer(gl.ARRAY_BUFFER,scene._fgnd._webgl.buffers[x3dom.BUFFER_IDX.POSITION]);gl.vertexAttribPointer(sp.position,3,gl.FLOAT,false,0,0);gl.enableVertexAttribArray(sp.position);gl.drawElements(scene._fgnd._webgl.primType,scene._fgnd._webgl.indexes.length,gl.UNSIGNED_SHORT,0);gl.disableVertexAttribArray(sp.position);gl.activeTexture(gl.TEXTURE0);gl.bindTexture(gl.TEXTURE_2D,null);gl.activeTexture(gl.TEXTURE1);gl.bindTexture(gl.TEXTURE_2D,null);if(fbo!=null){gl.bindFramebuffer(gl.FRAMEBUFFER,oldfbo);}};x3dom.SSAO.blur=function(stateManager,gl,scene,ssaoTexture,depthTexture,canvas,fbo){var oldfbo=gl.getParameter(gl.FRAMEBUFFER_BINDING);if(fbo!=null){gl.bindFramebuffer(gl.FRAMEBUFFER,fbo);}\nstateManager.frontFace(gl.CCW);stateManager.disable(gl.CULL_FACE);stateManager.disable(gl.DEPTH_TEST);var sp=x3dom.SSAO.blurShaderProgram;stateManager.useProgram(sp);sp.SSAOTexture=0;sp.depthTexture=1;sp.depthThreshold=scene.getEnvironment()._vf.SSAOblurDepthTreshold;var viewpoint=scene.getViewpoint();var nearPlane=viewpoint.getNear();var farPlane=viewpoint.getFar();sp.nearPlane=nearPlane;sp.farPlane=farPlane;sp.depthReconstructionConstantA=(farPlane+nearPlane)/(nearPlane-farPlane);sp.depthReconstructionConstantB=(2.0*farPlane*nearPlane)/(nearPlane-farPlane);sp.pixelSize=[1.0/canvas.width,1.0/canvas.height];sp.amount=scene.getEnvironment()._vf.SSAOamount;gl.activeTexture(gl.TEXTURE0);gl.bindTexture(gl.TEXTURE_2D,ssaoTexture);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.LINEAR);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.LINEAR);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE);gl.activeTexture(gl.TEXTURE1);gl.bindTexture(gl.TEXTURE_2D,depthTexture);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.NEAREST);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.NEAREST);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE);gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER,scene._fgnd._webgl.buffers[x3dom.BUFFER_IDX.INDEX]);gl.bindBuffer(gl.ARRAY_BUFFER,scene._fgnd._webgl.buffers[x3dom.BUFFER_IDX.POSITION]);gl.vertexAttribPointer(sp.position,3,gl.FLOAT,false,0,0);gl.enableVertexAttribArray(sp.position);gl.drawElements(scene._fgnd._webgl.primType,scene._fgnd._webgl.indexes.length,gl.UNSIGNED_SHORT,0);gl.disableVertexAttribArray(sp.position);gl.activeTexture(gl.TEXTURE0);gl.bindTexture(gl.TEXTURE_2D,null);gl.activeTexture(gl.TEXTURE1);gl.bindTexture(gl.TEXTURE_2D,null);if(fbo!=null){gl.bindFramebuffer(gl.FRAMEBUFFER,oldfbo);}};x3dom.SSAO.renderSSAO=function(stateManager,gl,scene,canvas){this.reinitializeShadersIfNecessary(gl);this.reinitializeRandomTextureIfNecessary(gl,scene);this.reinitializeFBOIfNecessary(gl,canvas);stateManager.viewport(0,0,canvas.width,canvas.height);this.render(stateManager,gl,scene,scene._webgl.fboScene.tex,canvas,x3dom.SSAO.fbo);gl.enable(gl.BLEND);gl.blendFunc(gl.DST_COLOR,gl.ONE_MINUS_SRC_ALPHA);this.blur(stateManager,gl,scene,x3dom.SSAO.fbotex,scene._webgl.fboScene.tex,canvas,null);gl.disable(gl.BLEND);};x3dom.gfx_webgl=(function(){\"use strict\";function Context(ctx3d,canvas,name,x3dElem){this.ctx3d=ctx3d;this.canvas=canvas;this.name=name;this.x3dElem=x3dElem;this.IG_PositionBuffer=null;this.cache=new x3dom.Cache();this.stateManager=new x3dom.StateManager(ctx3d);this.VRMode=1;this.vrFrameData=null;this.BUFFER_IDX={INDEX:0,POSITION:1,NORMAL:2,TEXCOORD:3,TEXCOORD_0:3,COLOR:4,TANGENT:6,BITANGENT:7,TEXCOORD_1:8,ID:9};}\nContext.prototype.getName=function(){return this.name;};function setupContext(canvas,forbidMobileShaders,forceMobileShaders,tryWebGL2,x3dElem){var validContextNames=['webgl2','webgl','experimental-webgl','moz-webgl','webkit-3d'];if(tryWebGL2){validContextNames=['webgl2','experimental-webgl2'].concat(validContextNames);}\nvar isAppleDevice=(/mac|ip(hone|od|ad)/i).test(navigator.platform);var isSafariBrowser=(/safari/i).test(navigator.userAgent);if(isAppleDevice)\n{validContextNames.splice(0,1);}\nvar ctx=null;var envNodes=x3dElem.getElementsByTagName(\"Environment\");var ssaoEnabled=(envNodes&&envNodes[0]&&envNodes[0].hasAttribute(\"SSAO\")&&envNodes[0].getAttribute(\"SSAO\").toLowerCase()==='true')?true:false;var ctxAttribs={alpha:true,depth:true,stencil:true,antialias:!ssaoEnabled,premultipliedAlpha:false,preserveDrawingBuffer:true,failIfMajorPerformanceCaveat:true};for(var i=0;i<validContextNames.length;i++){try{x3dom.caps.RENDERMODE=\"HARDWARE (\"+validContextNames[i]+\")\";ctx=canvas.getContext(validContextNames[i],ctxAttribs);if(!ctx){x3dom.caps.RENDERMODE=\"SOFTWARE\";ctxAttribs.failIfMajorPerformanceCaveat=false;ctx=canvas.getContext(validContextNames[i],ctxAttribs);ctxAttribs.failIfMajorPerformanceCaveat=true;}\nif(ctx){var newCtx=new Context(ctx,canvas,'webgl',x3dElem);try{x3dom.caps.VENDOR=ctx.getParameter(ctx.VENDOR);x3dom.caps.VERSION=ctx.getParameter(ctx.VERSION);x3dom.caps.WEBGL_VERSION=(x3dom.caps.VERSION.indexOf(\"WebGL 2.0\")===-1)?1:2\nx3dom.caps.RENDERER=ctx.getParameter(ctx.RENDERER);x3dom.caps.SHADING_LANGUAGE_VERSION=ctx.getParameter(ctx.SHADING_LANGUAGE_VERSION);x3dom.caps.RED_BITS=ctx.getParameter(ctx.RED_BITS);x3dom.caps.GREEN_BITS=ctx.getParameter(ctx.GREEN_BITS);x3dom.caps.BLUE_BITS=ctx.getParameter(ctx.BLUE_BITS);x3dom.caps.ALPHA_BITS=ctx.getParameter(ctx.ALPHA_BITS);x3dom.caps.DEPTH_BITS=ctx.getParameter(ctx.DEPTH_BITS);x3dom.caps.MAX_VERTEX_ATTRIBS=ctx.getParameter(ctx.MAX_VERTEX_ATTRIBS);x3dom.caps.MAX_VERTEX_TEXTURE_IMAGE_UNITS=ctx.getParameter(ctx.MAX_VERTEX_TEXTURE_IMAGE_UNITS);x3dom.caps.MAX_VARYING_VECTORS=ctx.getParameter(ctx.MAX_VARYING_VECTORS);x3dom.caps.MAX_VERTEX_UNIFORM_VECTORS=ctx.getParameter(ctx.MAX_VERTEX_UNIFORM_VECTORS);x3dom.caps.MAX_COMBINED_TEXTURE_IMAGE_UNITS=ctx.getParameter(ctx.MAX_COMBINED_TEXTURE_IMAGE_UNITS);x3dom.caps.MAX_TEXTURE_SIZE=ctx.getParameter(ctx.MAX_TEXTURE_SIZE);x3dom.caps.MAX_TEXTURE_IMAGE_UNITS=ctx.getParameter(ctx.MAX_TEXTURE_IMAGE_UNITS);x3dom.caps.MAX_CUBE_MAP_TEXTURE_SIZE=ctx.getParameter(ctx.MAX_CUBE_MAP_TEXTURE_SIZE);x3dom.caps.COMPRESSED_TEXTURE_FORMATS=ctx.getParameter(ctx.COMPRESSED_TEXTURE_FORMATS);x3dom.caps.MAX_RENDERBUFFER_SIZE=ctx.getParameter(ctx.MAX_RENDERBUFFER_SIZE);x3dom.caps.MAX_VIEWPORT_DIMS=ctx.getParameter(ctx.MAX_VIEWPORT_DIMS);x3dom.caps.ALIASED_LINE_WIDTH_RANGE=ctx.getParameter(ctx.ALIASED_LINE_WIDTH_RANGE);x3dom.caps.ALIASED_POINT_SIZE_RANGE=ctx.getParameter(ctx.ALIASED_POINT_SIZE_RANGE);x3dom.caps.SAMPLES=ctx.getParameter(ctx.SAMPLES);x3dom.caps.COMPRESSED_TEXTURE=ctx.getExtension('WEBGL_compressed_texture_s3tc');x3dom.caps.INDEX_UINT=ctx.getExtension(\"OES_element_index_uint\");x3dom.caps.FP_TEXTURES=ctx.getExtension(\"OES_texture_float\");x3dom.caps.FPL_TEXTURES=ctx.getExtension(\"OES_texture_float_linear\");x3dom.caps.HFP_TEXTURES=ctx.getExtension(\"OES_texture_half_float\");x3dom.caps.COLOR_BUFFER_FLOAT=ctx.getExtension(\"WEBGL_color_buffer_float\");x3dom.caps.HFPL_TEXTURES=ctx.getExtension(\"OES_texture_half_float_linear\");x3dom.caps.STD_DERIVATIVES=ctx.getExtension(\"OES_standard_derivatives\");x3dom.caps.DRAW_BUFFERS=ctx.getExtension(\"WEBGL_draw_buffers\");x3dom.caps.DEPTH_TEXTURE=ctx.getExtension(\"WEBGL_depth_texture\");x3dom.caps.DEBUGRENDERINFO=ctx.getExtension(\"WEBGL_debug_renderer_info\");x3dom.caps.ANISOTROPIC=ctx.getExtension(\"EXT_texture_filter_anisotropic\");x3dom.caps.TEXTURE_LOD=ctx.getExtension(\"EXT_shader_texture_lod\");x3dom.caps.INSTANCED_ARRAYS=ctx.getExtension(\"ANGLE_instanced_arrays\");if(x3dom.caps.ANISOTROPIC){x3dom.caps.MAX_ANISOTROPY=ctx.getParameter(x3dom.caps.ANISOTROPIC.MAX_TEXTURE_MAX_ANISOTROPY_EXT);}\nx3dom.caps.EXTENSIONS=ctx.getSupportedExtensions();if(x3dom.Utils.isWebGL2Enabled())\n{x3dom.caps.DEPTH_TEXTURE=null;x3dom.caps.INDEX_UINT=true}\nif(x3dom.caps.DEBUGRENDERINFO){x3dom.caps.UNMASKED_RENDERER_WEBGL=ctx.getParameter(x3dom.caps.DEBUGRENDERINFO.UNMASKED_RENDERER_WEBGL);x3dom.caps.UNMASKED_VENDOR_WEBGL=ctx.getParameter(x3dom.caps.DEBUGRENDERINFO.UNMASKED_VENDOR_WEBGL);}else{x3dom.caps.UNMASKED_RENDERER_WEBGL=\"\";x3dom.caps.UNMASKED_VENDOR_WEBGL=\"\";}\nvar extString=x3dom.caps.EXTENSIONS.toString().replace(/,/g,\", \");x3dom.debug.logInfo(validContextNames[i]+\" context found\\nVendor: \"+x3dom.caps.VENDOR+\" \"+x3dom.caps.UNMASKED_VENDOR_WEBGL+\", Renderer: \"+x3dom.caps.RENDERER+\" \"+x3dom.caps.UNMASKED_RENDERER_WEBGL+\", \"+\"Version: \"+x3dom.caps.VERSION+\", \"+\"ShadingLangV.: \"+x3dom.caps.SHADING_LANGUAGE_VERSION\n+\", MSAA samples: \"+x3dom.caps.SAMPLES+\"\\nExtensions: \"+extString);if(x3dom.caps.INDEX_UINT){x3dom.Utils.maxIndexableCoords=4294967295;}\nx3dom.caps.MOBILE=(function(a){return(/android.+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|symbian|treo|up\\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/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|e\\-|e\\/|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(di|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|xda(\\-|2|g)|yas\\-|your|zeto|zte\\-/i.test(a.substr(0,4)))})(navigator.userAgent||navigator.vendor||window.opera);if(x3dom.caps.RENDERER.indexOf(\"PowerVR\")>=0||navigator.appVersion.indexOf(\"Mobile\")>-1||x3dom.caps.MAX_VARYING_VECTORS<=8||x3dom.caps.MAX_VERTEX_TEXTURE_IMAGE_UNITS<2){x3dom.caps.MOBILE=true;}\nx3dom.caps.MOBILE=false;if(isAppleDevice)\n{x3dom.caps.HFP_TEXTURES=false;}\nif(isSafariBrowser)\n{x3dom.caps.TEXTURE_LOD=false;}\nif(x3dom.caps.MOBILE){if(forbidMobileShaders){x3dom.caps.MOBILE=false;x3dom.debug.logWarning(\"Detected mobile graphics card! \"+\"But being forced to desktop shaders which might not work!\");}else{x3dom.debug.logWarning(\"Detected mobile graphics card! \"+\"Using low quality shaders without ImageGeometry support!\");}}else{if(forceMobileShaders){x3dom.caps.MOBILE=true;x3dom.debug.logWarning(\"Detected desktop graphics card! \"+\"But being forced to mobile shaders with lower quality!\");}}}catch(ex){x3dom.debug.logWarning(\"Your browser probably supports an older WebGL version. \"+\"Please try the old mobile runtime instead:\\n\"+\"http://www.x3dom.org/x3dom/src_mobile/x3dom.js\");newCtx=null;}\nreturn newCtx;}}catch(e){x3dom.debug.logWarning(e);}}\nreturn null;}\nContext.prototype.setupShape=function(gl,drawable,viewarea){var q=0,q6;var textures,t;var vertices,positionBuffer;var texCoords,texCoordBuffer;var tangents,tangentBuffer;var binormals,binormalBuffer;var indicesBuffer,indexArray;var normals,normalBuffer;var colors,colorBuffer;var shape=drawable.shape;var geoNode=shape._cf.geometry.node;if(shape._webgl!==undefined){var needFullReInit=false;if(shape._dirty.colors===true&&shape._webgl.shader.color===undefined&&geoNode._mesh._colors[0].length){needFullReInit=true;}\nif(needFullReInit&&shape._cleanupGLObjects){shape._cleanupGLObjects(true,false);}\nif(shape._dirty.texture===true){if(shape._webgl.texture.length!=shape.getTextures().length){for(t=0;t<shape._webgl.texture.length;++t){shape._webgl.texture.pop();}\ntextures=shape.getTextures();for(t=0;t<textures.length;++t){shape._webgl.texture.push(new x3dom.Texture(gl,shape._nameSpace.doc,this.cache,textures[t]));}\nshape._dirty.shader=true;if(shape._webgl.shader.texcoord===undefined)\nshape._dirty.texcoords=true;}else{textures=shape.getTextures();for(t=0;t<textures.length;++t){if(textures[t]===shape._webgl.texture[t].node){shape._webgl.texture[t].update();}else{shape._webgl.texture[t].texture=null;shape._webgl.texture[t].node=textures[t];shape._webgl.texture[t].update();}}}\nshape._dirty.texture=false;}\nshape._webgl.shader=this.cache.getShaderByProperties(gl,shape,shape.getShaderProperties(viewarea));if(!needFullReInit&&shape._webgl.binaryGeometry==0&&shape._webgl.bufferGeometry==0){for(q=0;q<shape._webgl.positions.length;q++){q6=6*q;if(shape._dirty.positions==true||shape._dirty.indexes==true){if(shape._webgl.shader.position!==undefined){shape._webgl.indexes[q]=geoNode._mesh._indices[q];gl.deleteBuffer(shape._webgl.buffers[q6+x3dom.BUFFER_IDX.INDEX]);indicesBuffer=gl.createBuffer();shape._webgl.buffers[q6+x3dom.BUFFER_IDX.INDEX]=indicesBuffer;if(x3dom.caps.INDEX_UINT&&(geoNode._mesh._positions[0].length/3>65535)){indexArray=new Uint32Array(shape._webgl.indexes[q]);shape._webgl.indexType=gl.UNSIGNED_INT;}else{indexArray=new Uint16Array(shape._webgl.indexes[q]);shape._webgl.indexType=gl.UNSIGNED_SHORT;}\ngl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER,indicesBuffer);gl.bufferData(gl.ELEMENT_ARRAY_BUFFER,indexArray,gl.STATIC_DRAW);indexArray=null;shape._webgl.positions[q]=geoNode._mesh._positions[q];gl.deleteBuffer(shape._webgl.buffers[q6+x3dom.BUFFER_IDX.POSITION]);positionBuffer=gl.createBuffer();shape._webgl.buffers[q6+x3dom.BUFFER_IDX.POSITION]=positionBuffer;gl.bindBuffer(gl.ARRAY_BUFFER,positionBuffer);gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER,shape._webgl.buffers[q6+x3dom.BUFFER_IDX.INDEX]);vertices=new Float32Array(shape._webgl.positions[q]);gl.bufferData(gl.ARRAY_BUFFER,vertices,gl.STATIC_DRAW);gl.bindBuffer(gl.ARRAY_BUFFER,positionBuffer);gl.vertexAttribPointer(shape._webgl.shader.position,geoNode._mesh._numPosComponents,shape._webgl.coordType,false,shape._coordStrideOffset[0],shape._coordStrideOffset[1]);vertices=null;}\nshape._dirty.positions=false;shape._dirty.indexes=false;}\nif(shape._dirty.colors==true){if(shape._webgl.shader.color!==undefined){shape._webgl.colors[q]=geoNode._mesh._colors[q];gl.deleteBuffer(shape._webgl.buffers[q6+x3dom.BUFFER_IDX.COLOR]);colorBuffer=gl.createBuffer();shape._webgl.buffers[q6+x3dom.BUFFER_IDX.COLOR]=colorBuffer;colors=new Float32Array(shape._webgl.colors[q]);gl.bindBuffer(gl.ARRAY_BUFFER,colorBuffer);gl.bufferData(gl.ARRAY_BUFFER,colors,gl.STATIC_DRAW);gl.vertexAttribPointer(shape._webgl.shader.color,geoNode._mesh._numColComponents,shape._webgl.colorType,false,shape._colorStrideOffset[0],shape._colorStrideOffset[1]);colors=null;}\nshape._dirty.colors=false;}\nif(shape._dirty.normals==true){if(shape._webgl.shader.normal!==undefined){shape._webgl.normals[q]=geoNode._mesh._normals[q];gl.deleteBuffer(shape._webgl.buffers[q6+x3dom.BUFFER_IDX.NORMAL]);normalBuffer=gl.createBuffer();shape._webgl.buffers[q6+x3dom.BUFFER_IDX.NORMAL]=normalBuffer;normals=new Float32Array(shape._webgl.normals[q]);gl.bindBuffer(gl.ARRAY_BUFFER,normalBuffer);gl.bufferData(gl.ARRAY_BUFFER,normals,gl.STATIC_DRAW);gl.vertexAttribPointer(shape._webgl.shader.normal,geoNode._mesh._numNormComponents,shape._webgl.normalType,false,shape._normalStrideOffset[0],shape._normalStrideOffset[1]);normals=null;}\nshape._dirty.normals=false;}\nif(shape._dirty.texcoords==true){if(shape._webgl.shader.texcoord!==undefined){shape._webgl.texcoords[q]=geoNode._mesh._texCoords[q];gl.deleteBuffer(shape._webgl.buffers[q6+x3dom.BUFFER_IDX.TEXCOORD]);texCoordBuffer=gl.createBuffer();shape._webgl.buffers[q6+x3dom.BUFFER_IDX.TEXCOORD]=texCoordBuffer;texCoords=new Float32Array(shape._webgl.texcoords[q]);gl.bindBuffer(gl.ARRAY_BUFFER,texCoordBuffer);gl.bufferData(gl.ARRAY_BUFFER,texCoords,gl.STATIC_DRAW);gl.vertexAttribPointer(shape._webgl.shader.texCoord,geoNode._mesh._numTexComponents,shape._webgl.texCoordType,false,shape._texCoordStrideOffset[0],shape._texCoordStrideOffset[1]);texCoords=null;}\nshape._dirty.texcoords=false;}\nif(shape._dirty.specialAttribs==true){if(shape._webgl.shader.particleSize!==undefined){var szArr=geoNode._vf.size.toGL();if(szArr.length){gl.deleteBuffer(shape._webgl.buffers[q6+x3dom.BUFFER_IDX.ID]);shape._webgl.buffers[q6+x3dom.BUFFER_IDX.ID]=gl.createBuffer();gl.bindBuffer(gl.ARRAY_BUFFER,shape._webgl.buffers[q6+x3dom.BUFFER_IDX.ID]);gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(szArr),gl.STATIC_DRAW);}\nshape._dirty.specialAttribs=false;}}}}else{}\nif(shape._webgl.imageGeometry!=0){for(t=0;t<shape._webgl.texture.length;++t){shape._webgl.texture[t].updateTexture();}\ngeoNode.unsetGeoDirty();shape.unsetGeoDirty();}\nif(!needFullReInit){return;}}\nelse if(!(x3dom.isa(geoNode,x3dom.nodeTypes.Text)||x3dom.isa(geoNode,x3dom.nodeTypes.BinaryGeometry)||x3dom.isa(geoNode,x3dom.nodeTypes.PopGeometry)||x3dom.isa(geoNode,x3dom.nodeTypes.BufferGeometry)||x3dom.isa(geoNode,x3dom.nodeTypes.ExternalGeometry)||x3dom.isa(shape,x3dom.nodeTypes.ExternalShape))&&(!geoNode||geoNode._mesh._positions[0].length<1))\n{if(x3dom.caps.MAX_VERTEX_TEXTURE_IMAGE_UNITS<2&&x3dom.isa(geoNode,x3dom.nodeTypes.ImageGeometry)){x3dom.debug.logError(\"Can't render ImageGeometry nodes with only \"+\nx3dom.caps.MAX_VERTEX_TEXTURE_IMAGE_UNITS+\" vertex texture units. Please upgrade your GPU!\");}else{x3dom.debug.logError(\"NO VALID MESH OR NO VERTEX POSITIONS SET!\");}\nreturn;}\nshape.unsetDirty();if(!shape._cleanupGLObjects){shape._cleanupGLObjects=function(force,delGL){if(this._webgl&&((arguments.length>0&&force)||this._parentNodes.length==0)){var sp=this._webgl.shader;for(var q=0;q<this._webgl.positions.length;q++){var q6=6*q;if(sp.position!==undefined){gl.deleteBuffer(this._webgl.buffers[q6+x3dom.BUFFER_IDX.INDEX]);gl.deleteBuffer(this._webgl.buffers[q6+x3dom.BUFFER_IDX.POSITION]);}\nif(sp.normal!==undefined){gl.deleteBuffer(this._webgl.buffers[q6+x3dom.BUFFER_IDX.NORMAL]);}\nif(sp.texcoord!==undefined){gl.deleteBuffer(this._webgl.buffers[q6+x3dom.BUFFER_IDX.TEXCOORD]);}\nif(sp.color!==undefined){gl.deleteBuffer(this._webgl.buffers[q6+x3dom.BUFFER_IDX.COLOR]);}\nif(sp.id!==undefined){gl.deleteBuffer(this._webgl.buffers[q6+x3dom.BUFFER_IDX.ID]);}\nif(sp.tangent!==undefined){gl.deleteBuffer(this._webgl.buffers[q6+x3dom.BUFFER_IDX.TANGENT]);}\nif(sp.binormal!==undefined){gl.deleteBuffer(this._webgl.buffers[q6+x3dom.BUFFER_IDX.BITANGENT]);}}\nfor(var df=0;df<this._webgl.dynamicFields.length;df++){var attrib=this._webgl.dynamicFields[df];if(sp[attrib.name]!==undefined){gl.deleteBuffer(attrib.buf);}}\nif(delGL===undefined)\ndelGL=true;if(delGL){delete this._webgl;x3dom.BinaryContainerLoader.outOfMemory=false;}}};}\nshape._webgl={positions:geoNode._mesh._positions,normals:geoNode._mesh._normals,texcoords:geoNode._mesh._texCoords,colors:geoNode._mesh._colors,tangents:geoNode._mesh._tangents,binormals:geoNode._mesh._binormals,indexes:geoNode._mesh._indices,indexType:gl.UNSIGNED_SHORT,coordType:gl.FLOAT,normalType:gl.FLOAT,texCoordType:gl.FLOAT,texCoord2Type:gl.FLOAT,colorType:gl.FLOAT,tangentType:gl.FLOAT,binormalType:gl.FLOAT,coordNormalized:false,normalNormalized:false,texCoordNormalized:false,texCoord2Normalized:false,colorNormalized:false,tangentNormalized:false,binormalNormalized:false,texture:[],dirtyLighting:x3dom.Utils.checkDirtyLighting(viewarea),imageGeometry:0,binaryGeometry:0,popGeometry:0,externalGeometry:0,bufferGeometry:0};textures=shape.getTextures();for(t=0;t<textures.length;++t){shape._webgl.texture.push(new x3dom.Texture(gl,shape._nameSpace.doc,this.cache,textures[t]));}\nshape._webgl.shader=this.cache.getShaderByProperties(gl,shape,shape.getShaderProperties(viewarea));var sp=shape._webgl.shader;var currAttribs=0;shape._webgl.buffers=[];shape._webgl.dynamicFields=[];if(x3dom.isa(geoNode,x3dom.nodeTypes.X3DBinaryContainerGeometryNode)){shape._webgl.primType=[];for(var primCnt=0;primCnt<geoNode._vf.primType.length;++primCnt){shape._webgl.primType.push(x3dom.Utils.primTypeDic(gl,geoNode._vf.primType[primCnt]));}}else{shape._webgl.primType=x3dom.Utils.primTypeDic(gl,geoNode._mesh._primType);}\nif(x3dom.isa(geoNode,x3dom.nodeTypes.ExternalGeometry)){geoNode.update(shape,sp,gl,viewarea,this);}else if(x3dom.isa(shape,x3dom.nodeTypes.ExternalShape)){shape.update(shape,sp,gl,viewarea,this);}else if(x3dom.isa(geoNode,x3dom.nodeTypes.BinaryGeometry)){x3dom.BinaryContainerLoader.setupBinGeo(shape,sp,gl,viewarea,this);}else if(x3dom.isa(geoNode,x3dom.nodeTypes.BufferGeometry)){x3dom.BinaryContainerLoader.setupBufferGeo(shape,sp,gl,viewarea,this);}else if(x3dom.isa(geoNode,x3dom.nodeTypes.PopGeometry)){x3dom.BinaryContainerLoader.setupPopGeo(shape,sp,gl,viewarea,this);}else if(x3dom.isa(geoNode,x3dom.nodeTypes.ImageGeometry)){x3dom.inryContainerLoader.setupImgGeo(shape,sp,gl,viewarea,this);}else{for(q=0;q<shape._webgl.positions.length;q++){q6=6*q;if(sp.position!==undefined){indicesBuffer=gl.createBuffer();shape._webgl.buffers[q6+x3dom.BUFFER_IDX.INDEX]=indicesBuffer;if(x3dom.caps.INDEX_UINT&&(shape._webgl.positions[0].length/3>65535)){indexArray=new Uint32Array(shape._webgl.indexes[q]);shape._webgl.indexType=gl.UNSIGNED_INT;}else{indexArray=new Uint16Array(shape._webgl.indexes[q]);shape._webgl.indexType=gl.UNSIGNED_SHORT;}\ngl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER,indicesBuffer);gl.bufferData(gl.ELEMENT_ARRAY_BUFFER,indexArray,gl.STATIC_DRAW);indexArray=null;positionBuffer=gl.createBuffer();shape._webgl.buffers[q6+x3dom.BUFFER_IDX.POSITION]=positionBuffer;gl.bindBuffer(gl.ARRAY_BUFFER,positionBuffer);vertices=new Float32Array(shape._webgl.positions[q]);gl.bufferData(gl.ARRAY_BUFFER,vertices,gl.STATIC_DRAW);gl.bindBuffer(gl.ARRAY_BUFFER,positionBuffer);gl.vertexAttribPointer(sp.position,geoNode._mesh._numPosComponents,shape._webgl.coordType,false,shape._coordStrideOffset[0],shape._coordStrideOffset[1]);gl.enableVertexAttribArray(sp.position);vertices=null;}\nif(sp.normal!==undefined||shape._webgl.normals[q]){normalBuffer=gl.createBuffer();shape._webgl.buffers[q6+x3dom.BUFFER_IDX.NORMAL]=normalBuffer;var normals=new Float32Array(shape._webgl.normals[q]);gl.bindBuffer(gl.ARRAY_BUFFER,normalBuffer);gl.bufferData(gl.ARRAY_BUFFER,normals,gl.STATIC_DRAW);gl.vertexAttribPointer(sp.normal,geoNode._mesh._numNormComponents,shape._webgl.normalType,false,shape._normalStrideOffset[0],shape._normalStrideOffset[1]);gl.enableVertexAttribArray(sp.normal);normals=null;}\nif(sp.texcoord!==undefined){var texcBuffer=gl.createBuffer();shape._webgl.buffers[q6+x3dom.BUFFER_IDX.TEXCOORD]=texcBuffer;var texCoords=new Float32Array(shape._webgl.texcoords[q]);gl.bindBuffer(gl.ARRAY_BUFFER,texcBuffer);gl.bufferData(gl.ARRAY_BUFFER,texCoords,gl.STATIC_DRAW);gl.vertexAttribPointer(sp.texcoord,geoNode._mesh._numTexComponents,shape._webgl.texCoordType,false,shape._texCoordStrideOffset[0],shape._texCoordStrideOffset[1]);gl.enableVertexAttribArray(sp.texcoord);texCoords=null;}\nif(sp.color!==undefined){colorBuffer=gl.createBuffer();shape._webgl.buffers[q6+x3dom.BUFFER_IDX.COLOR]=colorBuffer;var colors=new Float32Array(shape._webgl.colors[q]);gl.bindBuffer(gl.ARRAY_BUFFER,colorBuffer);gl.bufferData(gl.ARRAY_BUFFER,colors,gl.STATIC_DRAW);gl.vertexAttribPointer(sp.color,geoNode._mesh._numColComponents,shape._webgl.colorType,false,shape._colorStrideOffset[0],shape._colorStrideOffset[1]);gl.enableVertexAttribArray(sp.color);colors=null;}\nif(sp.particleSize!==undefined){var sizeArr=geoNode._vf.size.toGL();if(sizeArr.length){var sizeBuffer=gl.createBuffer();shape._webgl.buffers[q6+x3dom.BUFFER_IDX.ID]=sizeBuffer;gl.bindBuffer(gl.ARRAY_BUFFER,sizeBuffer);gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(sizeArr),gl.STATIC_DRAW);}}\nif(sp.tangent!==undefined){tangentBuffer=gl.createBuffer();shape._webgl.buffers[q6+x3dom.BUFFER_IDX.TANGENT]=tangentBuffer;var tangents=new Float32Array(shape._webgl.tangents[q]);gl.bindBuffer(gl.ARRAY_BUFFER,tangentBuffer);gl.bufferData(gl.ARRAY_BUFFER,tangents,gl.STATIC_DRAW);gl.vertexAttribPointer(sp.tangent,geoNode._mesh._numTangentComponents,shape._webgl.tangentType,false,shape._tangentStrideOffset[0],shape._tangentStrideOffset[1]);gl.enableVertexAttribArray(sp.tangent);tangents=null;}\nif(sp.binormal!==undefined){binormalBuffer=gl.createBuffer();shape._webgl.buffers[q6+x3dom.BUFFER_IDX.BITANGENT]=binormalBuffer;var binormals=new Float32Array(shape._webgl.binormals[q]);gl.bindBuffer(gl.ARRAY_BUFFER,binormalBuffer);gl.bufferData(gl.ARRAY_BUFFER,binormals,gl.STATIC_DRAW);gl.vertexAttribPointer(sp.binormal,geoNode._mesh._numBinormalComponents,shape._webgl.binormalType,false,shape._binormalStrideOffset[0],shape._binormalStrideOffset[1]);gl.enableVertexAttribArray(sp.tangent);binormals=null;}}\nfor(var df in geoNode._mesh._dynamicFields){if(!geoNode._mesh._dynamicFields.hasOwnProperty(df))\ncontinue;var attrib=geoNode._mesh._dynamicFields[df];shape._webgl.dynamicFields[currAttribs]={buf:{},name:df,numComponents:attrib.numComponents};if(sp[df]!==undefined){var attribBuffer=gl.createBuffer();shape._webgl.dynamicFields[currAttribs++].buf=attribBuffer;var attribs=new Float32Array(attrib.value);gl.bindBuffer(gl.ARRAY_BUFFER,attribBuffer);gl.bufferData(gl.ARRAY_BUFFER,attribs,gl.STATIC_DRAW);gl.vertexAttribPointer(sp[df],attrib.numComponents,gl.FLOAT,false,0,0);attribs=null;}}}};Context.prototype.setupScene=function(gl,bgnd){var sphere=null;var texture=null;var that=this;if(bgnd._webgl!==undefined){if(!bgnd._dirty){return;}\nif(bgnd._webgl.texture!==undefined&&bgnd._webgl.texture){gl.deleteTexture(bgnd._webgl.texture);}\nif(bgnd._cleanupGLObjects){bgnd._cleanupGLObjects();}\nbgnd._webgl={};}\nbgnd._dirty=false;var url=bgnd.getTexUrl();var i=0;var w=1,h=1;if(url.length>0&&url[0].length>0){if((url.length>=6&&url[1].length>0&&url[2].length>0&&url[3].length>0&&url[4].length>0&&url[5].length>0)||url[0].indexOf(\".dds\")!=-1){sphere=new x3dom.nodeTypes.Sphere();bgnd._webgl={positions:sphere._mesh._positions[0],indexes:sphere._mesh._indices[0],buffers:[{},{}]};bgnd._webgl.primType=gl.TRIANGLES;if(url[0].indexOf(\".dds\")!=-1){bgnd._webgl.shader=this.cache.getShader(gl,x3dom.shader.BACKGROUND_CUBETEXTURE_DDS);bgnd._webgl.texture=x3dom.Utils.createTextureCube(gl,bgnd._nameSpace.doc,[url[0]],false,bgnd._vf.crossOrigin,true,false,false);}else{bgnd._webgl.shader=this.cache.getShader(gl,x3dom.shader.BACKGROUND_CUBETEXTURE_DDS);bgnd._webgl.texture=x3dom.Utils.createTextureCube(gl,bgnd._nameSpace.doc,url,false,bgnd._vf.crossOrigin,true,false);}}\nelse{bgnd._webgl={positions:[-w,-h,0,-w,h,0,w,-h,0,w,h,0],indexes:[0,1,2,3],buffers:[{},{}]};url=bgnd._nameSpace.getURL(url[0]);bgnd._webgl.texture=x3dom.Utils.createTexture2D(gl,bgnd._nameSpace.doc,url,true,bgnd._vf.crossOrigin,false,false);bgnd._webgl.primType=gl.TRIANGLE_STRIP;bgnd._webgl.shader=that.cache.getShader(gl,x3dom.shader.BACKGROUND_TEXTURE);}}else{if(bgnd.getSkyColor().length>1||bgnd.getGroundColor().length){sphere=new x3dom.nodeTypes.Sphere();texture=gl.createTexture();bgnd._webgl={positions:sphere._mesh._positions[0],texcoords:sphere._mesh._texCoords[0],indexes:sphere._mesh._indices[0],buffers:[{},{},{}],texture:texture,primType:gl.TRIANGLES};var N=x3dom.Utils.nextHighestPowerOfTwo(bgnd.getSkyColor().length+bgnd.getGroundColor().length+2);N=(N<512)?512:N;var n=bgnd._vf.groundAngle.length;var tmp=[],arr=[];var colors=[],sky=[0];for(i=0;i<bgnd._vf.skyColor.length;i++){colors[i]=bgnd._vf.skyColor[i];}\nfor(i=0;i<bgnd._vf.skyAngle.length;i++){sky[i+1]=bgnd._vf.skyAngle[i];}\nif(n>0||bgnd._vf.groundColor.length==1){if(sky[sky.length-1]<Math.PI/2){sky[sky.length]=Math.PI/2-x3dom.fields.Eps;colors[colors.length]=colors[colors.length-1];}\nfor(i=n-1;i>=0;i--){if((i==n-1)&&(Math.PI-bgnd._vf.groundAngle[i]<=Math.PI/2)){sky[sky.length]=Math.PI/2;colors[colors.length]=bgnd._vf.groundColor[bgnd._vf.groundColor.length-1];}\nsky[sky.length]=Math.PI-bgnd._vf.groundAngle[i];colors[colors.length]=bgnd._vf.groundColor[i+1];}\nif(n==0&&bgnd._vf.groundColor.length==1){sky[sky.length]=Math.PI/2;colors[colors.length]=bgnd._vf.groundColor[0];}\nsky[sky.length]=Math.PI;colors[colors.length]=bgnd._vf.groundColor[0];}else{if(sky[sky.length-1]<Math.PI){sky[sky.length]=Math.PI;colors[colors.length]=colors[colors.length-1];}}\nfor(i=0;i<sky.length;i++){sky[i]/=Math.PI;}\nif(sky.length!=colors.length){x3dom.debug.logError(\"Number of background colors and corresponding angles are different!\");var minArrayLength=(sky.length<colors.length)?sky.length:colors.length;sky.length=minArrayLength;colors.length=minArrayLength;}\nvar interp=new x3dom.nodeTypes.ColorInterpolator();interp._vf.key=new x3dom.fields.MFFloat(sky);interp._vf.keyValue=new x3dom.fields.MFColor(colors);for(i=0;i<N;i++){interp._vf.set_fraction=i/(N-1.0);interp.fieldChanged(\"set_fraction\");tmp[i]=interp._vf.value_changed;}\ntmp.reverse();var alpha=Math.floor((1.0-bgnd.getTransparency())*255);for(i=0;i<tmp.length;i++){arr.push(Math.floor(tmp[i].r*255),Math.floor(tmp[i].g*255),Math.floor(tmp[i].b*255),alpha);}\nvar pixels=new Uint8Array(arr);var format=gl.RGBA;N=pixels.length/4;gl.bindTexture(gl.TEXTURE_2D,texture);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.LINEAR);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.LINEAR);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE);gl.pixelStorei(gl.UNPACK_ALIGNMENT,1);gl.texImage2D(gl.TEXTURE_2D,0,format,1,N,0,format,gl.UNSIGNED_BYTE,pixels);gl.bindTexture(gl.TEXTURE_2D,null);bgnd._webgl.shader=that.cache.getShader(gl,x3dom.shader.BACKGROUND_SKYTEXTURE);}else{bgnd._webgl={};}}\nif(bgnd._webgl.shader){var sp=bgnd._webgl.shader;var positionBuffer=gl.createBuffer();bgnd._webgl.buffers[x3dom.BUFFER_IDX.POSITION]=positionBuffer;gl.bindBuffer(gl.ARRAY_BUFFER,positionBuffer);var vertices=new Float32Array(bgnd._webgl.positions);gl.bufferData(gl.ARRAY_BUFFER,vertices,gl.STATIC_DRAW);gl.bindBuffer(gl.ARRAY_BUFFER,positionBuffer);gl.vertexAttribPointer(sp.position,3,gl.FLOAT,false,0,0);gl.enableVertexAttribArray(sp.position);var indicesBuffer=gl.createBuffer();bgnd._webgl.buffers[x3dom.BUFFER_IDX.INDEX]=indicesBuffer;var indexArray=new Uint16Array(bgnd._webgl.indexes);gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER,indicesBuffer);gl.bufferData(gl.ELEMENT_ARRAY_BUFFER,indexArray,gl.STATIC_DRAW);vertices=null;indexArray=null;if(sp.texcoord!==undefined){var texcBuffer=gl.createBuffer();bgnd._webgl.buffers[x3dom.BUFFER_IDX.TEXCOORD]=texcBuffer;var texcoords=new Float32Array(bgnd._webgl.texcoords);gl.bindBuffer(gl.ARRAY_BUFFER,texcBuffer);gl.bufferData(gl.ARRAY_BUFFER,texcoords,gl.STATIC_DRAW);gl.vertexAttribPointer(sp.texcoord,2,gl.FLOAT,false,0,0);gl.enableVertexAttribArray(sp.texcoord);texcoords=null;}\nbgnd._cleanupGLObjects=function(){var sp=this._webgl.shader;if(sp.position!==undefined){gl.deleteBuffer(this._webgl.buffers[x3dom.BUFFER_IDX.INDEX]);gl.deleteBuffer(this._webgl.buffers[x3dom.BUFFER_IDX.POSITION]);}\nif(sp.texcoord!==undefined){gl.deleteBuffer(this._webgl.buffers[x3dom.BUFFER_IDX.TEXCOORD]);}};}\nbgnd._webgl.render=function(gl,mat_view,mat_proj,viewarea){var sp=bgnd._webgl.shader;var alpha=1.0-bgnd.getTransparency();var mat_scene=null;var projMatrix_22=mat_proj._22,projMatrix_23=mat_proj._23;var camPos=mat_view.e3();if((sp!==undefined&&sp!==null)&&(sp.texcoord!==undefined&&sp.texcoord!==null)&&(bgnd._webgl.texture!==undefined&&bgnd._webgl.texture!==null)){gl.clearColor(0,0,0,alpha);gl.clearDepth(1.0);gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT|gl.STENCIL_BUFFER_BIT);that.stateManager.frontFace(gl.CCW);that.stateManager.disable(gl.CULL_FACE);that.stateManager.disable(gl.DEPTH_TEST);that.stateManager.disable(gl.BLEND);that.stateManager.useProgram(sp);if(!sp.tex){sp.tex=0;}\nmat_proj._22=100001/99999;mat_proj._23=200000/99999;mat_view._03=0;mat_view._13=0;mat_view._23=0;mat_scene=mat_proj.mult(mat_view);sp.modelViewProjectionMatrix=mat_scene.toGL();mat_view._03=camPos.x;mat_view._13=camPos.y;mat_view._23=camPos.z;mat_proj._22=projMatrix_22;mat_proj._23=projMatrix_23;gl.activeTexture(gl.TEXTURE0);gl.bindTexture(gl.TEXTURE_2D,bgnd._webgl.texture);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.LINEAR);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.LINEAR);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE);gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER,bgnd._webgl.buffers[x3dom.BUFFER_IDX.INDEX]);gl.bindBuffer(gl.ARRAY_BUFFER,bgnd._webgl.buffers[x3dom.BUFFER_IDX.POSITION]);gl.vertexAttribPointer(sp.position,3,gl.FLOAT,false,0,0);gl.enableVertexAttribArray(sp.position);gl.bindBuffer(gl.ARRAY_BUFFER,bgnd._webgl.buffers[x3dom.BUFFER_IDX.TEXCOORD]);gl.vertexAttribPointer(sp.texcoord,2,gl.FLOAT,false,0,0);gl.enableVertexAttribArray(sp.texcoord);that.setVertexAttribEyeIdx(gl,sp);that.drawElements(gl,bgnd._webgl.primType,bgnd._webgl.indexes.length,gl.UNSIGNED_SHORT,0);gl.activeTexture(gl.TEXTURE0);gl.bindTexture(gl.TEXTURE_2D,null);gl.disableVertexAttribArray(sp.position);gl.disableVertexAttribArray(sp.texcoord);that.disableVertexAttribEyeIdx(gl,sp);gl.clear(gl.DEPTH_BUFFER_BIT);}else if(!sp||!bgnd._webgl.texture||(bgnd._webgl.texture.textureCubeReady!==undefined&&bgnd._webgl.texture.textureCubeReady!==true)){var bgCol=bgnd.getSkyColor().toGL();gl.clearColor(bgCol[0],bgCol[1],bgCol[2],alpha);gl.clearDepth(1.0);gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT|gl.STENCIL_BUFFER_BIT);}else{gl.clearColor(0,0,0,alpha);gl.clearDepth(1.0);gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT|gl.STENCIL_BUFFER_BIT);that.stateManager.frontFace(gl.CCW);that.stateManager.disable(gl.CULL_FACE);that.stateManager.disable(gl.DEPTH_TEST);that.stateManager.disable(gl.BLEND);that.stateManager.useProgram(sp);if(!sp.tex){sp.tex=0;}\nif(bgnd._webgl.texture.textureCubeReady){mat_proj._22=100001/99999;mat_proj._23=200000/99999;mat_view._03=0;mat_view._13=0;mat_view._23=0;mat_scene=mat_proj.mult(mat_view);sp.modelViewProjectionMatrix=mat_scene.toGL();mat_view._03=camPos.x;mat_view._13=camPos.y;mat_view._23=camPos.z;mat_proj._22=projMatrix_22;mat_proj._23=projMatrix_23;gl.activeTexture(gl.TEXTURE0);gl.bindTexture(gl.TEXTURE_CUBE_MAP,bgnd._webgl.texture);gl.texParameteri(gl.TEXTURE_CUBE_MAP,gl.TEXTURE_MIN_FILTER,gl.LINEAR);gl.texParameteri(gl.TEXTURE_CUBE_MAP,gl.TEXTURE_MAG_FILTER,gl.LINEAR);gl.texParameteri(gl.TEXTURE_CUBE_MAP,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE);gl.texParameteri(gl.TEXTURE_CUBE_MAP,gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE);}else{gl.activeTexture(gl.TEXTURE0);gl.bindTexture(gl.TEXTURE_2D,bgnd._webgl.texture);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.LINEAR);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.LINEAR);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE);if(bgnd._vf.scaling&&bgnd._webgl.texture.ready){var ratio=1.0;var viewport=new x3dom.fields.SFVec2f(that.canvas.width,that.canvas.height);var texture=new x3dom.fields.SFVec2f(bgnd._webgl.texture.width,bgnd._webgl.texture.height);if(viewport.x>viewport.y){ratio=viewport.x/texture.x;texture.x=viewport.x;texture.y=texture.y*ratio;}else{ratio=viewport.y/texture.y;texture.y=viewport.y;texture.x=texture.x*ratio;}\nvar scale=viewport.divideComponents(texture);var translation=texture.subtract(viewport).multiply(0.5).divideComponents(texture);}else{var scale=new x3dom.fields.SFVec2f(1.0,1.0);var translation=new x3dom.fields.SFVec2f(0.0,0.0);}\nsp.scale=scale.toGL();sp.translation=translation.toGL();}\nsp.isVR=-1.0;sp.screenWidth=that.canvas.width;that.setTonemappingOperator(viewarea,sp);if(that.VRMode==2)\n{var mat_view_R=viewarea.getViewMatrices()[1];var camPosR=mat_view_R.e3();mat_view_R._03=0;mat_view_R._13=0;mat_view_R._23=0;var mat_proj_R=viewarea.getProjectionMatrices()[1];var mat_scene_R=mat_proj_R.mult(mat_view_R);sp.modelViewProjectionMatrix2=mat_scene_R.toGL();mat_view_R._03=camPosR.x;mat_view_R._13=camPosR.y;mat_view_R._23=camPosR.z;sp.isVR=1.0;}\nthat.setVertexAttribEyeIdx(gl,sp);gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER,bgnd._webgl.buffers[x3dom.BUFFER_IDX.INDEX]);gl.bindBuffer(gl.ARRAY_BUFFER,bgnd._webgl.buffers[x3dom.BUFFER_IDX.POSITION]);gl.vertexAttribPointer(sp.position,3,gl.FLOAT,false,0,0);gl.enableVertexAttribArray(sp.position);that.drawElements(gl,bgnd._webgl.primType,bgnd._webgl.indexes.length,gl.UNSIGNED_SHORT,0);gl.disableVertexAttribArray(sp.position);that.disableVertexAttribEyeIdx(gl,sp);gl.activeTexture(gl.TEXTURE0);if(bgnd._webgl.texture.textureCubeReady){gl.bindTexture(gl.TEXTURE_CUBE_MAP,null);}else{gl.bindTexture(gl.TEXTURE_2D,null);}\ngl.clear(gl.DEPTH_BUFFER_BIT);}};};Context.prototype.setupFgnds=function(gl,scene){if(scene._fgnd!==undefined){return;}\nvar that=this;var w=1,h=1;scene._fgnd={};scene._fgnd._webgl={positions:[-w,-h,0,-w,h,0,w,-h,0,w,h,0],indexes:[0,1,2,3],buffers:[{},{}]};scene._fgnd._webgl.primType=gl.TRIANGLE_STRIP;scene._fgnd._webgl.shader=this.cache.getShader(gl,x3dom.shader.FRONTGROUND_TEXTURE);var sp=scene._fgnd._webgl.shader;var positionBuffer=gl.createBuffer();scene._fgnd._webgl.buffers[x3dom.BUFFER_IDX.POSITION]=positionBuffer;gl.bindBuffer(gl.ARRAY_BUFFER,positionBuffer);var vertices=new Float32Array(scene._fgnd._webgl.positions);gl.bufferData(gl.ARRAY_BUFFER,vertices,gl.STATIC_DRAW);gl.bindBuffer(gl.ARRAY_BUFFER,positionBuffer);gl.vertexAttribPointer(sp.position,3,gl.FLOAT,false,0,0);var indicesBuffer=gl.createBuffer();scene._fgnd._webgl.buffers[x3dom.BUFFER_IDX.INDEX]=indicesBuffer;var indexArray=new Uint16Array(scene._fgnd._webgl.indexes);gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER,indicesBuffer);gl.bufferData(gl.ELEMENT_ARRAY_BUFFER,indexArray,gl.STATIC_DRAW);vertices=null;indexArray=null;scene._fgnd._webgl.render=function(gl,tex){scene._fgnd._webgl.texture=tex;that.stateManager.frontFace(gl.CCW);that.stateManager.disable(gl.CULL_FACE);that.stateManager.disable(gl.DEPTH_TEST);that.stateManager.useProgram(sp);if(!sp.tex){sp.tex=0;}\ngl.activeTexture(gl.TEXTURE0);gl.bindTexture(gl.TEXTURE_2D,scene._fgnd._webgl.texture);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.NEAREST);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.NEAREST);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE);gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER,scene._fgnd._webgl.buffers[x3dom.BUFFER_IDX.INDEX]);gl.bindBuffer(gl.ARRAY_BUFFER,scene._fgnd._webgl.buffers[x3dom.BUFFER_IDX.POSITION]);gl.vertexAttribPointer(sp.position,3,gl.FLOAT,false,0,0);gl.enableVertexAttribArray(sp.position);that.drawElements(gl,scene._fgnd._webgl.primType,scene._fgnd._webgl.indexes.length,gl.UNSIGNED_SHORT,0,1);gl.disableVertexAttribArray(sp.position);gl.activeTexture(gl.TEXTURE0);gl.bindTexture(gl.TEXTURE_2D,null);};};Context.prototype.renderShadowPass=function(gl,viewarea,mat_scene,mat_view,targetFbo,camOffset,isCameraView){var scene=viewarea._scene;var indicesReady=false;this.stateManager.bindFramebuffer(gl.FRAMEBUFFER,targetFbo.fbo);this.stateManager.viewport(0,0,targetFbo.width,targetFbo.height);gl.clearColor(1.0,1.0,1.0,0.0);gl.clearDepth(1.0);gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT);this.stateManager.depthFunc(gl.LEQUAL);this.stateManager.enable(gl.DEPTH_TEST);this.stateManager.enable(gl.CULL_FACE);this.stateManager.disable(gl.BLEND);var bgCenter=x3dom.fields.SFVec3f.NullVector.toGL();var bgSize=x3dom.fields.SFVec3f.OneVector.toGL();var env=scene.getEnvironment();var excludeTrans=env._vf.shadowExcludeTransparentObjects;var i,n=scene.drawableCollection.length;for(i=0;i<n;i++){var drawable=scene.drawableCollection.get(i);var trafo=drawable.transform;var shape=drawable.shape;var s_gl=shape._webgl;if(!s_gl||(excludeTrans&&drawable.sortType=='transparent')){continue;}\nvar s_geo=shape._cf.geometry.node;var s_app=shape._cf.appearance.node;var s_msh=s_geo._mesh;var properties=shape.getShaderProperties(viewarea);var sp=this.cache.getShaderByProperties(gl,shape,properties,null,true);if(!sp){return;}\nthis.stateManager.useProgram(sp);sp.cameraView=isCameraView;sp.offset=camOffset;sp.modelViewProjectionMatrix=mat_scene.mult(trafo).toGL();if(s_gl.coordType!=gl.FLOAT){if(!s_gl.popGeometry&&(x3dom.Utils.isUnsignedType(s_geo._vf.coordType))){sp.bgCenter=s_geo.getMin().toGL();}else{sp.bgCenter=s_geo._vf.position.toGL();}\nsp.bgSize=s_geo._vf.size.toGL();sp.bgPrecisionMax=s_geo.getPrecisionMax('coordType');}\nif(shape._clipPlanes){sp.modelViewMatrix=mat_view.mult(trafo).toGL();sp.viewMatrixInverse=mat_view.inverse().toGL();for(var cp=0;cp<shape._clipPlanes.length;cp++){var clip_plane=shape._clipPlanes[cp].plane;var clip_trafo=shape._clipPlanes[cp].trafo;sp['clipPlane'+cp+'_Plane']=clip_trafo.multMatrixPlane(clip_plane._vf.plane).toGL();sp['clipPlane'+cp+'_CappingStrength']=clip_plane._vf.cappingStrength;sp['clipPlane'+cp+'_CappingColor']=clip_plane._vf.cappingColor.toGL();}}\nif(s_gl.imageGeometry!=0&&!x3dom.caps.MOBILE){sp.IG_bboxMin=s_geo.getMin().toGL();sp.IG_bboxMax=s_geo.getMax().toGL();sp.IG_implicitMeshSize=s_geo._vf.implicitMeshSize.toGL();var coordTex=x3dom.Utils.findTextureByName(s_gl.texture,\"IG_coords0\");if(coordTex){sp.IG_coordTextureWidth=coordTex.texture.width;sp.IG_coordTextureHeight=coordTex.texture.height;}\nif(s_gl.imageGeometry==1){var indexTex=x3dom.Utils.findTextureByName(s_gl.texture,\"IG_index\");if(indexTex){sp.IG_indexTextureWidth=indexTex.texture.width;sp.IG_indexTextureHeight=indexTex.texture.height;}\ngl.activeTexture(gl.TEXTURE0);gl.bindTexture(gl.TEXTURE_2D,indexTex.texture);gl.activeTexture(gl.TEXTURE1);gl.bindTexture(gl.TEXTURE_2D,coordTex.texture);}else{gl.activeTexture(gl.TEXTURE0);gl.bindTexture(gl.TEXTURE_2D,coordTex.texture);}\ngl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.NEAREST);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.NEAREST);var texUnit=0;if(s_geo.getIndexTexture()){if(!sp.IG_indexTexture){sp.IG_indexTexture=texUnit++;}}\nif(s_geo.getCoordinateTexture(0)){if(!sp.IG_coordinateTexture){sp.IG_coordinateTexture=texUnit++;}}}else if((s_gl.binaryGeometry!=0||s_gl.externalGeometry!=0)&&s_geo._vf[\"idsPerVertex\"]==true){var shader=s_app._shader;if(shader&&x3dom.isa(s_app._shader,x3dom.nodeTypes.CommonSurfaceShader)){if(shader.getMultiVisibilityMap()){sp.multiVisibilityMap=0;var visTex=x3dom.Utils.findTextureByName(s_gl.texture,\"multiVisibilityMap\");sp.multiVisibilityWidth=visTex.texture.width;sp.multiVisibilityHeight=visTex.texture.height;gl.activeTexture(gl.TEXTURE0);gl.bindTexture(gl.TEXTURE_2D,visTex.texture);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.NEAREST);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.NEAREST);}}}\nif(shape.isSolid()){this.stateManager.enable(gl.CULL_FACE);if(shape.isCCW()){this.stateManager.frontFace(gl.CCW);}else{this.stateManager.frontFace(gl.CW);}}else{this.stateManager.disable(gl.CULL_FACE);}\nvar depthMode=s_app?s_app._cf.depthMode.node:null;if(depthMode){if(depthMode._vf.enableDepthTest){this.stateManager.enable(gl.DEPTH_TEST);this.stateManager.depthMask(!depthMode._vf.readOnly);this.stateManager.depthFunc(x3dom.Utils.depthFunc(gl,depthMode._vf.depthFunc));this.stateManager.depthRange(depthMode._vf.zNearRange,depthMode._vf.zFarRange);}else{this.stateManager.disable(gl.DEPTH_TEST);}}else{this.stateManager.enable(gl.DEPTH_TEST);this.stateManager.depthMask(true);this.stateManager.depthFunc(gl.LEQUAL);}\nif(s_gl.popGeometry){var model_view=mat_view.mult(trafo);this.updatePopState(drawable,s_geo,sp,s_gl,scene,model_view,viewarea,this.x3dElem.runtime.fps);}\nvar q_n;if(s_gl.externalGeometry!=0){q_n=shape.meshes.length;}else{q_n=s_gl.positions.length;}\nfor(var q=0;q<q_n;q++){var q6=6*q;var v,v_n,offset;if(s_gl.externalGeometry!=0){var mesh=shape.meshes[q];mesh.bindVertexAttribPointerPosition(gl,sp,false);mesh.render(gl,null);}else if(!(sp.position!==undefined&&s_gl.buffers[q6+x3dom.BUFFER_IDX.POSITION]&&s_gl.indexes[q]))\ncontinue;indicesReady=false;if(s_gl.externalGeometry==0){if(s_gl.buffers[q6+x3dom.BUFFER_IDX.INDEX]){gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER,s_gl.buffers[q6+x3dom.BUFFER_IDX.INDEX]);indicesReady=true;}\nthis.setVertexAttribPointerPosition(gl,shape,q6,q);if(sp.id!==undefined&&s_gl.buffers[q6+x3dom.BUFFER_IDX.ID]){gl.bindBuffer(gl.ARRAY_BUFFER,s_gl.buffers[q6+x3dom.BUFFER_IDX.ID]);if((s_gl.binaryGeometry!=0||s_gl.externalGeometry!=0)&&s_geo._vf[\"idsPerVertex\"]==true){gl.vertexAttribPointer(sp.id,1,gl.FLOAT,false,4,0);gl.enableVertexAttribArray(sp.id);}else{}}\nif(indicesReady&&(s_gl.binaryGeometry>0||s_gl.popGeometry>0)){for(v=0,offset=0,v_n=s_geo._vf.vertexCount.length;v<v_n;v++){this.drawElements(gl,s_gl.primType[v],s_geo._vf.vertexCount[v],s_gl.indexType,x3dom.Utils.getByteAwareOffset(offset,s_gl.indexType,gl));offset+=s_geo._vf.vertexCount[v];}}else if(s_gl.binaryGeometry<0||s_gl.popGeometry<0||s_gl.imageGeometry){for(v=0,offset=0,v_n=s_geo._vf.vertexCount.length;v<v_n;v++){this.drawArrays(gl,s_gl.primType[v],offset,s_geo._vf.vertexCount[v]);offset+=s_geo._vf.vertexCount[v];}}else if(s_geo.hasIndexOffset()){var indOff=shape.tessellationProperties();for(v=0,v_n=indOff.length;v<v_n;v++){this.drawElements(gl,s_gl.primType,indOff[v].count,s_gl.indexType,indOff[v].offset*x3dom.Utils.getOffsetMultiplier(s_gl.indexType,gl));}}\nelse if(s_gl.indexes[q].length==0){this.drawArrays(gl,s_gl.primType,0,s_gl.positions[q].length/3);}else{this.drawElements(gl,s_gl.primType,s_gl.indexes[q].length,s_gl.indexType,0);}}\ngl.disableVertexAttribArray(sp.position);if(sp.texcoord!==undefined&&s_gl.buffers[q6+x3dom.BUFFER_IDX.TEXCOORD]){gl.disableVertexAttribArray(sp.texcoord);}\nif(sp.color!==undefined&&s_gl.buffers[q6+x3dom.BUFFER_IDX.COLOR]){gl.disableVertexAttribArray(sp.color);}\nif(sp.id!==undefined&&s_gl.buffers[q6+x3dom.BUFFER_IDX.ID]){gl.disableVertexAttribArray(sp.id);}}\nif(s_gl.imageGeometry!=0&&!x3dom.caps.MOBILE){gl.activeTexture(gl.TEXTURE0);gl.bindTexture(gl.TEXTURE_2D,null);if(s_gl.imageGeometry==1){gl.activeTexture(gl.TEXTURE1);gl.bindTexture(gl.TEXTURE_2D,null);}}}\nif(x3dom.Utils.needLineWidth){this.stateManager.lineWidth(1);}\nif(depthMode){this.stateManager.enable(gl.DEPTH_TEST);this.stateManager.depthMask(true);this.stateManager.depthFunc(gl.LEQUAL);this.stateManager.depthRange(0,1);}\ngl.flush();this.stateManager.bindFramebuffer(gl.FRAMEBUFFER,null);};Context.prototype.renderPickingPass=function(gl,scene,mat_view,mat_scene,from,sceneSize,pickMode,lastX,lastY,width,height){var ps=scene._webgl.pickScale;var bufHeight=scene._webgl.fboPick.height;var x=lastX*ps;var y=(bufHeight-1)-lastY*ps;var indicesReady=false;this.stateManager.bindFramebuffer(gl.FRAMEBUFFER,scene._webgl.fboPick.fbo);this.stateManager.viewport(0,0,scene._webgl.fboPick.width,bufHeight);gl.clearColor(0.0,0.0,0.0,0.0);gl.clearDepth(1.0);gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT);var viewarea=scene.drawableCollection.viewarea;var env=scene.getEnvironment();var n=scene.drawableCollection.length;if(env._vf.smallFeatureCulling&&env._lowPriorityThreshold<1&&viewarea.isMovingOrAnimating()){n=Math.floor(n*env._lowPriorityThreshold);if(!n&&scene.drawableCollection.length)\nn=1;}\nvar bgCenter=x3dom.fields.SFVec3f.NullVector.toGL();var bgSize=x3dom.fields.SFVec3f.OneVector.toGL();this.stateManager.depthFunc(gl.LEQUAL);this.stateManager.enable(gl.DEPTH_TEST);this.stateManager.enable(gl.CULL_FACE);this.stateManager.disable(gl.BLEND);if(x3dom.Utils.needLineWidth){this.stateManager.lineWidth(2);}\nfor(var i=0;i<n;i++){var drawable=scene.drawableCollection.get(i);var trafo=drawable.transform;var shape=drawable.shape;var s_gl=shape._webgl;if(!s_gl||shape._objectID<1||!shape._vf.isPickable){continue;}\nvar s_geo=shape._cf.geometry.node;var s_app=shape._cf.appearance.node;var s_msh=s_geo._mesh;var properties=shape.getShaderProperties(viewarea);var sp=this.cache.getShaderByProperties(gl,shape,properties,pickMode);if(!sp){return;}\ns_gl.shader=sp;this.stateManager.useProgram(sp);sp.screenWidth=this.canvas.width*scene._webgl.pickScale;sp.modelMatrix=trafo.toGL();sp.modelViewProjectionMatrix=mat_scene.mult(trafo).toGL();sp.isVR=-1.0;if(this.VRMode==2)\n{var mat_view_R=viewarea.getViewMatrices()[1];var mat_proj_R=viewarea.getProjectionMatrices()[1];var mat_scene_R=mat_proj_R.mult(mat_view_R);sp.modelViewProjectionMatrix2=mat_scene_R.mult(trafo).toGL();sp.isVR=1.0;}\nsp.lowBit=(shape._objectID&255)/255.0;sp.highBit=(shape._objectID>>>8)/255.0;sp.from=from.toGL();sp.sceneSize=sceneSize;if((s_gl.binaryGeometry!=0||s_gl.externalGeometry!=0)&&s_geo._vf[\"idsPerVertex\"]==true){sp.shadowIDs=(shape._vf.idOffset+x3dom.nodeTypes.Shape.objectID+2);}\nif(s_gl.coordType!=gl.FLOAT){if(!s_gl.popGeometry&&(x3dom.Utils.isUnsignedType(s_geo._vf.coordType))){sp.bgCenter=s_geo.getMin().toGL();}else{sp.bgCenter=s_geo._vf.position.toGL();}\nsp.bgSize=s_geo._vf.size.toGL();sp.bgPrecisionMax=s_geo.getPrecisionMax('coordType');}\nif(pickMode==1&&s_gl.colorType!=gl.FLOAT){sp.bgPrecisionColMax=s_geo.getPrecisionMax('colorType');}\nif(pickMode==2&&s_gl.texCoordType!=gl.FLOAT){sp.bgPrecisionTexMax=s_geo.getPrecisionMax('texCoordType');}\nif(shape._clipPlanes){sp.modelViewMatrix=mat_view.mult(trafo).toGL();sp.viewMatrixInverse=mat_view.inverse().toGL();if(this.VRMode==2)\n{sp.modelViewMatrix2=mat_view_R.mult(trafo).toGL();sp.viewMatrixInverse2=mat_view_R.inverse().toGL();}\nfor(var cp=0;cp<shape._clipPlanes.length;cp++){var clip_plane=shape._clipPlanes[cp].plane;var clip_trafo=shape._clipPlanes[cp].trafo;sp['clipPlane'+cp+'_Plane']=clip_trafo.multMatrixPlane(clip_plane._vf.plane).toGL();sp['clipPlane'+cp+'_CappingStrength']=clip_plane._vf.cappingStrength;sp['clipPlane'+cp+'_CappingColor']=clip_plane._vf.cappingColor.toGL();}}\nif(s_gl.imageGeometry!=0&&!x3dom.caps.MOBILE)\n{sp.IG_bboxMin=s_geo.getMin().toGL();sp.IG_bboxMax=s_geo.getMax().toGL();sp.IG_implicitMeshSize=s_geo._vf.implicitMeshSize.toGL();var coordTex=x3dom.Utils.findTextureByName(s_gl.texture,\"IG_coords0\");if(coordTex){sp.IG_coordTextureWidth=coordTex.texture.width;sp.IG_coordTextureHeight=coordTex.texture.height;}\nif(s_gl.imageGeometry==1){var indexTex=x3dom.Utils.findTextureByName(s_gl.texture,\"IG_index\");if(indexTex){sp.IG_indexTextureWidth=indexTex.texture.width;sp.IG_indexTextureHeight=indexTex.texture.height;}\ngl.activeTexture(gl.TEXTURE0);gl.bindTexture(gl.TEXTURE_2D,indexTex.texture);gl.activeTexture(gl.TEXTURE1);gl.bindTexture(gl.TEXTURE_2D,coordTex.texture);}else{gl.activeTexture(gl.TEXTURE0);gl.bindTexture(gl.TEXTURE_2D,coordTex.texture);}\ngl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.NEAREST);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.NEAREST);var texUnit=0;if(s_geo.getIndexTexture()){if(!sp.IG_indexTexture){sp.IG_indexTexture=texUnit++;}}\nif(s_geo.getCoordinateTexture(0)){if(!sp.IG_coordinateTexture){sp.IG_coordinateTexture=texUnit++;}}}else if((s_gl.binaryGeometry!=0||s_gl.externalGeometry!=0)&&s_geo._vf[\"idsPerVertex\"]==true){var shader=s_app._shader;if(shader&&x3dom.isa(s_app._shader,x3dom.nodeTypes.CommonSurfaceShader)){if(shader.getMultiVisibilityMap()){sp.multiVisibilityMap=0;var visTex=x3dom.Utils.findTextureByName(s_gl.texture,\"multiVisibilityMap\");sp.multiVisibilityWidth=visTex.texture.width;sp.multiVisibilityHeight=visTex.texture.height;gl.activeTexture(gl.TEXTURE0);gl.bindTexture(gl.TEXTURE_2D,visTex.texture);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.NEAREST);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.NEAREST);}}}\nif(shape.isSolid()){this.stateManager.enable(gl.CULL_FACE);if(shape.isCCW()){this.stateManager.frontFace(gl.CCW);}else{this.stateManager.frontFace(gl.CW);}}else{this.stateManager.disable(gl.CULL_FACE);}\nvar depthMode=s_app?s_app._cf.depthMode.node:null;if(depthMode){if(depthMode._vf.enableDepthTest){this.stateManager.enable(gl.DEPTH_TEST);this.stateManager.depthMask(!depthMode._vf.readOnly);this.stateManager.depthFunc(x3dom.Utils.depthFunc(gl,depthMode._vf.depthFunc));this.stateManager.depthRange(depthMode._vf.zNearRange,depthMode._vf.zFarRange);}else{this.stateManager.disable(gl.DEPTH_TEST);}}else{this.stateManager.enable(gl.DEPTH_TEST);this.stateManager.depthMask(true);this.stateManager.depthFunc(gl.LEQUAL);}\nif(s_gl.popGeometry){var model_view=mat_view.mult(trafo);this.updatePopState(drawable,s_geo,sp,s_gl,scene,model_view,viewarea,this.x3dElem.runtime.fps);}\nvar q_n;if(s_gl.externalGeometry!=0){q_n=shape.meshes.length;}else{q_n=s_gl.positions.length;}\nfor(var q=0;q<q_n;q++){var q6=6*q;var v,v_n,offset;if(s_gl.externalGeometry!=0){var mesh=shape.meshes[q];mesh.bindVertexAttribPointerPosition(gl,sp,false);mesh.render(gl,null);}else if(!(sp.position!==undefined&&s_gl.buffers[q6+x3dom.BUFFER_IDX.POSITION]&&s_gl.indexes[q]))\ncontinue;indicesReady=false;if(s_gl.externalGeometry==0){if(s_gl.buffers[q6+x3dom.BUFFER_IDX.INDEX]){gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER,s_gl.buffers[q6+x3dom.BUFFER_IDX.INDEX]);indicesReady=true;}\nthis.setVertexAttribEyeIdx(gl,sp);this.setVertexAttribPointerPosition(gl,shape,q6,q);if(pickMode==1){this.setVertexAttribPointerColor(gl,shape,q6,q);}\nif(pickMode==2&&sp.texcoord!==undefined&&s_gl.buffers[q6+x3dom.BUFFER_IDX.TEXCOORD]){this.setVertexAttribPointerTexCoord(gl,shape,q6,q);}\nif(sp.id!==undefined&&s_gl.buffers[q6+x3dom.BUFFER_IDX.ID]){gl.bindBuffer(gl.ARRAY_BUFFER,s_gl.buffers[q6+x3dom.BUFFER_IDX.ID]);if((s_gl.binaryGeometry!=0||s_gl.externalGeometry!=0)&&s_geo._vf[\"idsPerVertex\"]==true){gl.vertexAttribPointer(sp.id,1,gl.FLOAT,false,4,0);gl.enableVertexAttribArray(sp.id);}else{}}\nif(indicesReady&&(s_gl.binaryGeometry>0||s_gl.popGeometry>0)){for(v=0,offset=0,v_n=s_geo._vf.vertexCount.length;v<v_n;v++){this.drawElements(gl,s_gl.primType[v],s_geo._vf.vertexCount[v],s_gl.indexType,x3dom.Utils.getByteAwareOffset(offset,s_gl.indexType,gl));offset+=s_geo._vf.vertexCount[v];}}else if(s_gl.binaryGeometry<0||s_gl.popGeometry<0||s_gl.imageGeometry){for(v=0,offset=0,v_n=s_geo._vf.vertexCount.length;v<v_n;v++){gl.drawArrays(gl,s_gl.primType[v],offset,s_geo._vf.vertexCount[v]);offset+=s_geo._vf.vertexCount[v];}}else if(indicesReady&&(s_gl.bufferGeometry>0)){this.drawElements(gl,s_gl.primType[0],s_geo._vf.vertexCount[0],s_gl.indexType,shape._indexOffset);}else if(s_gl.bufferGeometry<0){this.drawArrays(gl,s_gl.primType[0],0,s_geo._vf.vertexCount[0]);}else if(s_geo.hasIndexOffset()){var indOff=shape.tessellationProperties();for(v=0,v_n=indOff.length;v<v_n;v++){this.drawElements(gl,s_gl.primType,indOff[v].count,s_gl.indexType,indOff[v].offset*x3dom.Utils.getOffsetMultiplier(s_gl.indexType,gl));}}else if(s_gl.indexes[q].length==0){this.drawArrays(gl,s_gl.primType,0,s_gl.positions[q].length/3);}else{this.drawElements(gl,s_gl.primType,s_gl.indexes[q].length,s_gl.indexType,0);}}\ngl.disableVertexAttribArray(sp.position);if(sp.texcoord!==undefined&&s_gl.buffers[q6+x3dom.BUFFER_IDX.TEXCOORD]){gl.disableVertexAttribArray(sp.texcoord);}\nif(sp.color!==undefined&&s_gl.buffers[q6+x3dom.BUFFER_IDX.COLOR]){gl.disableVertexAttribArray(sp.color);}\nif(sp.id!==undefined&&s_gl.buffers[q6+x3dom.BUFFER_IDX.ID]){gl.disableVertexAttribArray(sp.id);}\nthis.disableVertexAttribEyeIdx(gl,sp);}\nif(s_gl.imageGeometry!=0&&!x3dom.caps.MOBILE){gl.activeTexture(gl.TEXTURE0);gl.bindTexture(gl.TEXTURE_2D,null);if(s_gl.imageGeometry==1){gl.activeTexture(gl.TEXTURE1);gl.bindTexture(gl.TEXTURE_2D,null);}}}\nif(x3dom.Utils.needLineWidth){this.stateManager.lineWidth(1);}\nif(depthMode){this.stateManager.enable(gl.DEPTH_TEST);this.stateManager.depthMask(true);this.stateManager.depthFunc(gl.LEQUAL);this.stateManager.depthRange(0,1);}\ngl.flush();try{var data=new Uint8Array(4*width*height);gl.readPixels(x,y,width,height,gl.RGBA,gl.UNSIGNED_BYTE,data);scene._webgl.fboPick.pixelData=data;}\ncatch(se){scene._webgl.fboPick.pixelData=[];x3dom.debug.logException(se+\" (cannot pick)\");}\nthis.stateManager.bindFramebuffer(gl.FRAMEBUFFER,null);};Context.prototype.renderShape=function(drawable,viewarea,slights,numLights,mat_view,mat_scene,mat_light,mat_proj,gl){var indicesReady=false;var shape=drawable.shape;var transform=drawable.transform;if(!shape||!shape._webgl||!transform){x3dom.debug.logError(\"[Context|RenderShape] No valid Shape!\");return;}\nvar s_gl=shape._webgl;var sp=s_gl.shader;if(!sp){x3dom.debug.logError(\"[Context|RenderShape] No Shader is set!\");return;}\nvar changed=this.stateManager.useProgram(sp);var s_app=shape._cf.appearance.node;var s_geo=shape._cf.geometry.node;var s_msh=s_geo._mesh;var scene=viewarea._scene;var tex=null;if(s_gl.coordType!=gl.FLOAT){if(!s_gl.popGeometry&&(x3dom.Utils.isUnsignedType(s_geo._vf.coordType))){sp.bgCenter=s_geo.getMin().toGL();}else{sp.bgCenter=s_geo._vf.position.toGL();}\nsp.bgSize=s_geo._vf.size.toGL();sp.bgPrecisionMax=s_geo.getPrecisionMax('coordType');}else{sp.bgCenter=[0,0,0];sp.bgSize=[1,1,1];sp.bgPrecisionMax=1;}\nif(s_gl.colorType!=gl.FLOAT){sp.bgPrecisionColMax=s_geo.getPrecisionMax('colorType');}else{sp.bgPrecisionColMax=1;}\nif(s_gl.texCoordType!=gl.FLOAT){sp.bgPrecisionTexMax=s_geo.getPrecisionMax('texCoordType');}else{sp.bgPrecisionTexMax=1;}\nif(s_gl.normalType!=gl.FLOAT){sp.bgPrecisionNorMax=s_geo.getPrecisionMax('normalType');}else{sp.bgPrecisionNorMax=1;}\nif(s_gl.tangentType!=gl.FLOAT){sp.bgPrecisionTangentMax=s_geo.getPrecisionMax('tangentType');}\nelse{sp.bgPrecisionTangentMax=1;}\nif(s_gl.binormalType!=gl.FLOAT){sp.bgPrecisionBinormalMax=s_geo.getPrecisionMax('binormalType');}\nelse{sp.bgPrecisionBinormalMax=1;}\nif(s_gl.imageGeometry!=0){sp.IG_bboxMin=s_geo.getMin().toGL();sp.IG_bboxMax=s_geo.getMax().toGL();sp.IG_implicitMeshSize=s_geo._vf.implicitMeshSize.toGL();tex=x3dom.Utils.findTextureByName(s_gl.texture,\"IG_coords0\");if(tex){sp.IG_coordTextureWidth=tex.texture.width;sp.IG_coordTextureHeight=tex.texture.height;}\nif(s_gl.imageGeometry==1){tex=x3dom.Utils.findTextureByName(s_gl.texture,\"IG_index\");if(tex){sp.IG_indexTextureWidth=tex.texture.width;sp.IG_indexTextureHeight=tex.texture.height;}}\ntex=null;}\nvar fog=scene.getFog();if(fog&&changed){sp.fogColor=fog._vf.color.toGL();sp.fogRange=fog._vf.visibilityRange;sp.fogType=(fog._vf.fogType==\"LINEAR\")?0.0:1.0;}\nvar mat=s_app?s_app._cf.material.node:null;var shader=s_app?s_app._shader:null;var twoSidedMat=false;var isUserDefinedShader=shader&&x3dom.isa(shader,x3dom.nodeTypes.ComposedShader);if(s_gl.csshader){sp.diffuseColor=shader._vf.diffuseFactor.toGL();sp.specularColor=shader._vf.specularFactor.toGL();sp.emissiveColor=shader._vf.emissiveFactor.toGL();sp.shininess=shader._vf.shininessFactor;sp.ambientIntensity=(shader._vf.ambientFactor.x+\nshader._vf.ambientFactor.y+\nshader._vf.ambientFactor.z)/3;sp.transparency=1.0-shader._vf.alphaFactor;sp.environmentFactor=shader._vf.environmentFactor.x;sp.normalBias=shader._vf.normalBias.toGL();if(shader.getDisplacementMap()){tex=x3dom.Utils.findTextureByName(s_gl.texture,\"displacementMap\");sp.displacementWidth=tex.texture.width;sp.displacementHeight=tex.texture.height;sp.displacementFactor=shader._vf.displacementFactor;sp.displacementAxis=(shader._vf.displacementAxis==\"x\")?0.0:(shader._vf.displacementAxis==\"y\")?1.0:2.0;}else if(shader.getDiffuseDisplacementMap()){tex=x3dom.Utils.findTextureByName(s_gl.texture,\"diffuseDisplacementMap\");sp.displacementWidth=tex.texture.width;sp.displacementHeight=tex.texture.height;sp.displacementFactor=shader._vf.displacementFactor;sp.displacementAxis=(shader._vf.displacementAxis==\"x\")?0.0:(shader._vf.displacementAxis==\"y\")?1.0:2.0;}\nif(shader.getMultiDiffuseAlphaMap()){tex=x3dom.Utils.findTextureByName(s_gl.texture,\"multiDiffuseAlphaMap\");sp.multiDiffuseAlphaWidth=tex.texture.width;sp.multiDiffuseAlphaHeight=tex.texture.height;}\nif(shader.getMultiEmissiveAmbientMap()){tex=x3dom.Utils.findTextureByName(s_gl.texture,\"multiEmissiveAmbientMap\");sp.multiEmissiveAmbientWidth=tex.texture.width;sp.multiEmissiveAmbientHeight=tex.texture.height;}\nif(shader.getMultiSpecularShininessMap()){tex=x3dom.Utils.findTextureByName(s_gl.texture,\"multiSpecularShininessMap\");sp.multiSpecularShininessWidth=tex.texture.width;sp.multiSpecularShininessHeight=tex.texture.height;}\nif(shader.getMultiVisibilityMap()){tex=x3dom.Utils.findTextureByName(s_gl.texture,\"multiVisibilityMap\");sp.multiVisibilityWidth=tex.texture.width;sp.multiVisibilityHeight=tex.texture.height;}}\nelse if(mat&&x3dom.isa(mat,x3dom.nodeTypes.PhysicalMaterial)){if(mat._vf.model==\"roughnessMetallic\"){sp.diffuseColor=[mat._vf.baseColorFactor.r,mat._vf.baseColorFactor.g,mat._vf.baseColorFactor.b];sp.specularColor=[x3dom.Utils.lerp(0.04,mat._vf.baseColorFactor.r,mat._vf.metallicFactor),x3dom.Utils.lerp(0.04,mat._vf.baseColorFactor.g,mat._vf.metallicFactor),x3dom.Utils.lerp(0.04,mat._vf.baseColorFactor.b,mat._vf.metallicFactor)];sp.shininess=1.0-mat._vf.roughnessFactor;sp.metallicFactor=mat._vf.metallicFactor;sp.transparency=1.0-mat._vf.baseColorFactor.a;}else{sp.diffuseColor=[mat._vf.diffuseFactor.r,mat._vf.diffuseFactor.g,mat._vf.diffuseFactor.b];sp.specularColor=[mat._vf.specularFactor.r,mat._vf.specularFactor.g,mat._vf.specularFactor.b];sp.shininess=mat._vf.glossinessFactor;sp.transparency=1.0-mat._vf.diffuseFactor.a;}\nsp.emissiveColor=mat._vf.emissiveFactor.toGL();sp.normalBias=mat._vf.normalBias.toGL();sp.ambientIntensity=1.0;sp.alphaCutoff=mat._vf.alphaCutoff;}else if(mat){sp.diffuseColor=mat._vf.diffuseColor.toGL();sp.specularColor=mat._vf.specularColor.toGL();sp.emissiveColor=mat._vf.emissiveColor.toGL();sp.shininess=mat._vf.shininess;sp.ambientIntensity=mat._vf.ambientIntensity;sp.transparency=mat._vf.transparency;sp.environmentFactor=0.0;sp.alphaCutoff=s_app._vf.alphaClipThreshold.toFixed(2);if(x3dom.isa(mat,x3dom.nodeTypes.TwoSidedMaterial)){twoSidedMat=true;sp.backDiffuseColor=mat._vf.backDiffuseColor.toGL();sp.backSpecularColor=mat._vf.backSpecularColor.toGL();sp.backEmissiveColor=mat._vf.backEmissiveColor.toGL();sp.backShininess=mat._vf.backShininess;sp.backAmbientIntensity=mat._vf.backAmbientIntensity;sp.backTransparency=mat._vf.backTransparency;}}else{sp.diffuseColor=[1.0,1.0,1.0];sp.specularColor=[0.0,0.0,0.0];sp.emissiveColor=[0.0,0.0,0.0];sp.shininess=0.0;sp.ambientIntensity=1.0;sp.transparency=0.0;sp.alphaCutoff=0.1}\nif(shader){if(isUserDefinedShader){for(var fName in shader._vf){if(shader._vf.hasOwnProperty(fName)&&fName!=='language'){var field=shader._vf[fName];if(field!==undefined&&field!==null){if(field.toGL){sp[fName]=field.toGL();}else{sp[fName]=field;}}}}}else if(x3dom.isa(shader,x3dom.nodeTypes.CommonSurfaceShader)){s_gl.csshader=shader;}}\nvar physicalEnvironmentLight;for(var p=0;p<numLights&&changed;p++){var light_transform=mat_view.mult(slights[p].getCurrentTransform());if(x3dom.isa(slights[p],x3dom.nodeTypes.DirectionalLight)){sp['light'+p+'_Type']=0.0;sp['light'+p+'_On']=(slights[p]._vf.on)?1.0:0.0;sp['light'+p+'_Color']=slights[p]._vf.color.toGL();sp['light'+p+'_Intensity']=slights[p]._vf.intensity;sp['light'+p+'_AmbientIntensity']=slights[p]._vf.ambientIntensity;sp['light'+p+'_Direction']=light_transform.multMatrixVec(slights[p]._vf.direction).toGL();sp['light'+p+'_Attenuation']=[1.0,1.0,1.0];sp['light'+p+'_Location']=[1.0,1.0,1.0];sp['light'+p+'_Radius']=0.0;sp['light'+p+'_BeamWidth']=0.0;sp['light'+p+'_CutOffAngle']=0.0;sp['light'+p+'_ShadowIntensity']=slights[p]._vf.shadowIntensity;}else if(x3dom.isa(slights[p],x3dom.nodeTypes.PointLight)){sp['light'+p+'_Type']=1.0;sp['light'+p+'_On']=(slights[p]._vf.on)?1.0:0.0;sp['light'+p+'_Color']=slights[p]._vf.color.toGL();sp['light'+p+'_Intensity']=slights[p]._vf.intensity;sp['light'+p+'_AmbientIntensity']=slights[p]._vf.ambientIntensity;sp['light'+p+'_Direction']=[1.0,1.0,1.0];sp['light'+p+'_Attenuation']=slights[p]._vf.attenuation.toGL();sp['light'+p+'_Location']=light_transform.multMatrixPnt(slights[p]._vf.location).toGL();sp['light'+p+'_Radius']=slights[p]._vf.radius;sp['light'+p+'_BeamWidth']=0.0;sp['light'+p+'_CutOffAngle']=0.0;sp['light'+p+'_ShadowIntensity']=slights[p]._vf.shadowIntensity;}else if(x3dom.isa(slights[p],x3dom.nodeTypes.SpotLight)){sp['light'+p+'_Type']=2.0;sp['light'+p+'_On']=(slights[p]._vf.on)?1.0:0.0;sp['light'+p+'_Color']=slights[p]._vf.color.toGL();sp['light'+p+'_Intensity']=slights[p]._vf.intensity;sp['light'+p+'_AmbientIntensity']=slights[p]._vf.ambientIntensity;sp['light'+p+'_Direction']=light_transform.multMatrixVec(slights[p]._vf.direction).toGL();sp['light'+p+'_Attenuation']=slights[p]._vf.attenuation.toGL();sp['light'+p+'_Location']=light_transform.multMatrixPnt(slights[p]._vf.location).toGL();sp['light'+p+'_Radius']=slights[p]._vf.radius;sp['light'+p+'_BeamWidth']=slights[p]._vf.beamWidth;sp['light'+p+'_CutOffAngle']=slights[p]._vf.cutOffAngle;sp['light'+p+'_ShadowIntensity']=slights[p]._vf.shadowIntensity;}\nelse if(x3dom.isa(slights[p],x3dom.nodeTypes.PhysicalEnvironmentLight)){physicalEnvironmentLight=slights[p];numLights--;}}\nvar nav=scene.getNavigationInfo();if(nav._vf.headlight&&changed){numLights=(numLights)?numLights:0;sp['light'+numLights+'_Type']=0.0;sp['light'+numLights+'_On']=1.0;sp['light'+numLights+'_Color']=[1.0,1.0,1.0];sp['light'+numLights+'_Intensity']=1.0;sp['light'+numLights+'_AmbientIntensity']=0.0;sp['light'+numLights+'_Direction']=[0.0,0.0,-1.0];sp['light'+numLights+'_Attenuation']=[1.0,1.0,1.0];sp['light'+numLights+'_Location']=[1.0,1.0,1.0];sp['light'+numLights+'_Radius']=0.0;sp['light'+numLights+'_BeamWidth']=0.0;sp['light'+numLights+'_CutOffAngle']=0.0;sp['light'+numLights+'_ShadowIntensity']=0.0;}\nif(shape._clipPlanes){for(var cp=0;cp<shape._clipPlanes.length;cp++){var clip_plane=shape._clipPlanes[cp].plane;var clip_trafo=shape._clipPlanes[cp].trafo;sp['clipPlane'+cp+'_Plane']=clip_trafo.multMatrixPlane(clip_plane._vf.plane).toGL();sp['clipPlane'+cp+'_CappingStrength']=clip_plane._vf.cappingStrength;sp['clipPlane'+cp+'_CappingColor']=clip_plane._vf.cappingColor.toGL();}}\nvar depthMode=s_app?s_app._cf.depthMode.node:null;if(depthMode){if(depthMode._vf.enableDepthTest){this.stateManager.enable(gl.DEPTH_TEST);this.stateManager.depthMask(!depthMode._vf.readOnly);this.stateManager.depthFunc(x3dom.Utils.depthFunc(gl,depthMode._vf.depthFunc));this.stateManager.depthRange(depthMode._vf.zNearRange,depthMode._vf.zFarRange);}else{this.stateManager.disable(gl.DEPTH_TEST);}}else{this.stateManager.enable(gl.DEPTH_TEST);this.stateManager.depthMask(true);this.stateManager.depthFunc(gl.LEQUAL);}\nvar blendMode=s_app?s_app._cf.blendMode.node:null;if(blendMode){var srcFactor=x3dom.Utils.blendFunc(gl,blendMode._vf.srcFactor);var destFactor=x3dom.Utils.blendFunc(gl,blendMode._vf.destFactor);if(srcFactor&&destFactor){this.stateManager.enable(gl.BLEND);this.stateManager.blendFuncSeparate(srcFactor,destFactor,gl.ONE,gl.ONE);this.stateManager.blendColor(blendMode._vf.color.r,blendMode._vf.color.g,blendMode._vf.color.b,1.0-blendMode._vf.colorTransparency);this.stateManager.blendEquation(x3dom.Utils.blendEquation(gl,blendMode._vf.equation));}else{this.stateManager.disable(gl.BLEND);}}else{if(mat&&x3dom.isa(mat,x3dom.nodeTypes.PhysicalMaterial))\n{if(mat._vf.alphaMode==\"BLEND\")\n{this.stateManager.enable(gl.BLEND);this.stateManager.blendFuncSeparate(gl.SRC_ALPHA,gl.ONE_MINUS_SRC_ALPHA,gl.ONE,gl.ONE);}\nelse\n{this.stateManager.disable(gl.BLEND);}}\nelse\n{this.stateManager.enable(gl.BLEND);this.stateManager.blendFuncSeparate(gl.SRC_ALPHA,gl.ONE_MINUS_SRC_ALPHA,gl.ONE,gl.ONE);}}\nvar colorMaskMode=s_app?s_app._cf.colorMaskMode.node:null;if(colorMaskMode){this.stateManager.colorMask(colorMaskMode._vf.maskR,colorMaskMode._vf.maskG,colorMaskMode._vf.maskB,colorMaskMode._vf.maskA);}else{this.stateManager.colorMask(true,true,true,true);}\nvar lineProperties=s_app?s_app._cf.lineProperties.node:null;if(lineProperties){this.stateManager.lineWidth(lineProperties._vf.linewidthScaleFactor);}else if(x3dom.Utils.needLineWidth){this.stateManager.lineWidth(1);}\nif(shape.isSolid()&&!twoSidedMat){this.stateManager.enable(gl.CULL_FACE);if(shape.isCCW()){this.stateManager.frontFace(gl.CCW);}else{this.stateManager.frontFace(gl.CW);}}else{this.stateManager.disable(gl.CULL_FACE);}\nvar model_view=mat_view.mult(transform);var model_view_inv=model_view.inverse();sp.screenWidth=this.canvas.width;sp.isOrthoView=(mat_proj._33==1)?1.0:0.0;sp.modelMatrix=transform.toGL();sp.modelViewMatrix=model_view.toGL();sp.viewMatrix=mat_view.toGL();sp.normalMatrix=model_view_inv.transpose().toGL();sp.modelViewMatrixInverse=model_view_inv.toGL();sp.modelViewProjectionMatrix=mat_scene.mult(transform).toGL();sp.modelViewProjectionInverseMatrix=mat_scene.mult(transform).inverse().toGL();sp.viewMatrixInverse=mat_view.inverse().toGL();sp.cameraPosWS=mat_view.inverse().e3().toGL();this.setTonemappingOperator(viewarea,sp);if(isUserDefinedShader||s_gl.externalGeometry!=0){sp.model=transform.toGL();sp.projectionMatrix=mat_proj.toGL();sp.worldMatrix=transform.toGL();sp.worldInverseTranspose=transform.inverse().transpose().toGL();}\nif(this.VRMode==2)\n{var mat_view_R=viewarea.getViewMatrices()[1];var mat_proj_R=viewarea.getProjectionMatrices()[1];var mat_scene_R=mat_proj_R.mult(mat_view_R);var model_view_R=mat_view_R.mult(transform);var model_view_R_inv=model_view_R.inverse();sp.viewMatrix2=mat_view_R.toGL();sp.modelViewMatrix2=model_view_R.toGL();sp.normalMatrix2=model_view_R_inv.transpose().toGL();sp.modelViewMatrixInverse2=model_view_R_inv.toGL();sp.modelViewProjectionMatrix2=mat_scene_R.mult(transform).toGL();sp.isVR=1.0;}\nelse\n{sp.isVR=0.0}\nif(s_gl.popGeometry){this.updatePopState(drawable,s_geo,sp,s_gl,scene,model_view,viewarea,this.x3dElem.runtime.fps);}\nfor(var cnt=0,cnt_n=s_gl.texture.length;cnt<cnt_n;cnt++){tex=s_gl.texture[cnt];gl.activeTexture(gl.TEXTURE0+cnt);gl.bindTexture(tex.type,tex.texture);gl.texParameteri(tex.type,gl.TEXTURE_WRAP_S,tex.wrapS);gl.texParameteri(tex.type,gl.TEXTURE_WRAP_T,tex.wrapT);gl.texParameteri(tex.type,gl.TEXTURE_MAG_FILTER,tex.magFilter);gl.texParameteri(tex.type,gl.TEXTURE_MIN_FILTER,tex.minFilter);if(x3dom.caps.ANISOTROPIC){gl.texParameterf(tex.type,x3dom.caps.ANISOTROPIC.TEXTURE_MAX_ANISOTROPY_EXT,tex.anisotropicDegree);}\nif(!shader||!isUserDefinedShader){if(!sp[tex.samplerName])\nsp[tex.samplerName]=cnt;}}\nif(x3dom.isa(mat,x3dom.nodeTypes.PhysicalMaterial)&&physicalEnvironmentLight!=undefined&&physicalEnvironmentLight._vf.diffuse!=\"\"&&physicalEnvironmentLight._vf.specular!=\"\")\n{var diffuseURL=physicalEnvironmentLight._nameSpace.getURL(physicalEnvironmentLight._vf.diffuse);var specularURL=physicalEnvironmentLight._nameSpace.getURL(physicalEnvironmentLight._vf.specular);var brdfURL=x3dom.BRDF_LUT\nvar brdf_lut=this.cache.getTexture2D(gl,shape._nameSpace.doc,brdfURL,false,'anonymous',false,false,true);var diffuse=this.cache.getTextureCube(gl,shape._nameSpace.doc,[diffuseURL],false,'anonymous',false,false,true);var specular=this.cache.getTextureCube(gl,shape._nameSpace.doc,[specularURL],false,'anonymous',false,false,true);gl.activeTexture(gl.TEXTURE0+cnt_n);gl.bindTexture(gl.TEXTURE_2D,brdf_lut);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.LINEAR);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.LINEAR);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE);sp.brdfMap=cnt_n++;if(diffuse.ready)\n{gl.activeTexture(gl.TEXTURE0+cnt_n);gl.bindTexture(gl.TEXTURE_CUBE_MAP,diffuse);gl.texParameteri(gl.TEXTURE_CUBE_MAP,gl.TEXTURE_MIN_FILTER,gl.LINEAR);gl.texParameteri(gl.TEXTURE_CUBE_MAP,gl.TEXTURE_MAG_FILTER,gl.LINEAR);gl.texParameteri(gl.TEXTURE_CUBE_MAP,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE);gl.texParameteri(gl.TEXTURE_CUBE_MAP,gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE);sp.diffuseEnvironmentMap=cnt_n++;}\nif(specular.ready)\n{gl.activeTexture(gl.TEXTURE0+cnt_n);gl.bindTexture(gl.TEXTURE_CUBE_MAP,specular);gl.texParameteri(gl.TEXTURE_CUBE_MAP,gl.TEXTURE_MIN_FILTER,gl.LINEAR_MIPMAP_LINEAR);gl.texParameteri(gl.TEXTURE_CUBE_MAP,gl.TEXTURE_MAG_FILTER,gl.LINEAR);gl.texParameteri(gl.TEXTURE_CUBE_MAP,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE);gl.texParameteri(gl.TEXTURE_CUBE_MAP,gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE);sp.specularEnvironmentMap=cnt_n++;}}\nif(s_app&&s_app._cf.textureTransform.node){var texTrafo=s_app.texTransformMatrix();sp.texTrafoMatrix=texTrafo.toGL();}\nvar attrib=null;var df,df_n=s_gl.dynamicFields.length;for(df=0;df<df_n;df++){attrib=s_gl.dynamicFields[df];if(sp[attrib.name]!==undefined){gl.bindBuffer(gl.ARRAY_BUFFER,attrib.buf);gl.vertexAttribPointer(sp[attrib.name],attrib.numComponents,gl.FLOAT,false,0,0);gl.enableVertexAttribArray(sp[attrib.name]);}}\nvar v,v_n,offset,q_n;var isParticleSet=false;if(x3dom.isa(s_geo,x3dom.nodeTypes.ParticleSet)){isParticleSet=true;}\nif(s_gl.externalGeometry!=0){q_n=shape.meshes.length;}else{q_n=s_gl.positions.length;}\nfor(var q=0;q<q_n;q++){var q6=6*q;if(s_gl.externalGeometry!=0){var mesh=shape.meshes[q];var exGeomShaderProgram=sp;var model=transform.mult(mesh.transform);sp.model=sp.worldMatrix=model.toGL();sp.viewMatrix=mat_view.toGL();model_view=mat_view.mult(model);model_view_inv=model_view.inverse();sp.modelViewMatrix=model_view.toGL();sp.normalMatrix=model_view_inv.transpose().toGL();sp.modelViewMatrixInverse=model_view_inv.toGL();sp.modelViewProjectionMatrix=mat_scene.mult(model).toGL();sp.modelViewProjectionInverseMatrix=mat_scene.mult(model).inverse().toGL();sp.worldInverseTranspose=model.inverse().transpose().toGL();if(mesh.material!=null){if(mesh.material.setShader!=null)\nmesh.material.setShader(gl,this.cache,shape,shape.getShaderProperties(viewarea));mesh.material.bind(gl,sp,this.cache,shape.getShaderProperties(viewarea));if(mesh.material.program!=null){exGeomShaderProgram=mesh.material.program;}}\nmesh.bindVertexAttribPointer(gl,exGeomShaderProgram);var renderMode=viewarea.getRenderMode();var polyMode=null;if(renderMode>0)\npolyMode=(renderMode==1)?gl.POINTS:gl.LINES;mesh.render(gl,polyMode);}else if(!(sp.position!==undefined&&s_gl.buffers[q6+x3dom.BUFFER_IDX.POSITION]&&s_gl.indexes[q])){continue;}else{indicesReady=false;if(!(sp.position!==undefined&&s_gl.buffers[q6+x3dom.BUFFER_IDX.POSITION]&&(s_gl.indexes[q])))\ncontinue;if(s_gl.buffers[q6+x3dom.BUFFER_IDX.INDEX]){if(isParticleSet&&s_geo.drawOrder()!=\"any\"){var indexArray,zPos=[];var pnts=s_geo._cf.coord.node.getPoints();var pn=(pnts.length==s_gl.indexes[q].length)?s_gl.indexes[q].length:0;for(var i=0;i<pn;i++){var center=model_view.multMatrixPnt(pnts[i]);zPos.push([i,center.z]);}\nif(s_geo.drawOrder()==\"backtofront\"){zPos.sort(function(a,b){return a[1]-b[1];});}else{zPos.sort(function(b,a){return a[1]-b[1];});}\nfor(i=0;i<pn;i++){shape._webgl.indexes[q][i]=zPos[i][0];}\nif(x3dom.caps.INDEX_UINT&&(pn>65535)){indexArray=new Uint32Array(shape._webgl.indexes[q]);shape._webgl.indexType=gl.UNSIGNED_INT;}else{indexArray=new Uint16Array(shape._webgl.indexes[q]);shape._webgl.indexType=gl.UNSIGNED_SHORT;}\ngl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER,s_gl.buffers[q6+x3dom.BUFFER_IDX.INDEX]);gl.bufferData(gl.ELEMENT_ARRAY_BUFFER,indexArray,gl.DYNAMIC_DRAW);indexArray=null;}\ngl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER,s_gl.buffers[q6+x3dom.BUFFER_IDX.INDEX]);indicesReady=true;}\nthis.setVertexAttribEyeIdx(gl,sp);this.setVertexAttribPointerPosition(gl,shape,q6,q);this.setVertexAttribPointerNormal(gl,shape,q6,q);this.setVertexAttribPointerTexCoord(gl,shape,q6,q);this.setVertexAttribPointerTexCoord2(gl,shape,q6,q);this.setVertexAttribPointerColor(gl,shape,q6,q);this.setVertexAttribPointerTangent(gl,shape,q6,q);this.setVertexAttribPointerBinormal(gl,shape,q6,q);if((sp.id!==undefined||sp.particleSize!==undefined)&&shape._webgl.buffers[q6+x3dom.BUFFER_IDX.ID]){gl.bindBuffer(gl.ARRAY_BUFFER,shape._webgl.buffers[q6+x3dom.BUFFER_IDX.ID]);if((s_gl.binaryGeometry!=0||s_gl.externalGeometry!=0)&&s_geo._vf[\"idsPerVertex\"]==true){gl.vertexAttribPointer(sp.id,1,gl.FLOAT,false,4,0);gl.enableVertexAttribArray(sp.id);}else if(isParticleSet){gl.vertexAttribPointer(sp.particleSize,3,gl.FLOAT,false,0,0);gl.enableVertexAttribArray(sp.particleSize);}}\nif(s_gl.popGeometry!=0&&s_gl.buffers[q6+x3dom.BUFFER_IDX.ID]){gl.bindBuffer(gl.ARRAY_BUFFER,s_gl.buffers[q6+x3dom.BUFFER_IDX.ID]);gl.vertexAttribPointer(sp.PG_vertexID,1,gl.FLOAT,false,4,0);gl.enableVertexAttribArray(sp.PG_vertexID);}\nvar indOff,renderMode=viewarea.getRenderMode();if(renderMode>0){var polyMode=(renderMode==1)?gl.POINTS:gl.LINES;if(indicesReady&&(s_gl.binaryGeometry>0||s_gl.popGeometry>0)){for(v=0,offset=0,v_n=s_geo._vf.vertexCount.length;v<v_n;v++){this.drawElements(gl,polyMode,s_geo._vf.vertexCount[v],s_gl.indexType,x3dom.Utils.getByteAwareOffset(offset,s_gl.indexType,gl));offset+=s_geo._vf.vertexCount[v];}}else if(s_gl.binaryGeometry<0||s_gl.popGeometry<0||s_gl.imageGeometry){for(v=0,offset=0,v_n=s_geo._vf.vertexCount.length;v<v_n;v++){this.drawArrays(gl,polyMode,offset,s_geo._vf.vertexCount[v]);offset+=s_geo._vf.vertexCount[v];}}\nelse if(indicesReady&&(s_gl.bufferGeometry>0)){this.drawElements(gl,s_gl.primType[0],s_geo._vf.vertexCount[0],s_gl.indexType,shape._indexOffset);}else if(s_gl.bufferGeometry<0){this.drawArrays(gl,s_gl.primType[0],0,s_geo._vf.vertexCount[0]);}else if(s_geo.hasIndexOffset()){indOff=shape.tessellationProperties();for(v=0,v_n=indOff.length;v<v_n;v++){this.drawElements(gl,polyMode,indOff[v].count,s_gl.indexType,indOff[v].offset*x3dom.Utils.getOffsetMultiplier(s_gl.indexType,gl));}}else if(s_gl.indexes[q].length==0){this.drawArrays(gl,polyMode,0,s_gl.positions[q].length/3);}else{this.drawElements(gl,polyMode,s_gl.indexes[q].length,s_gl.indexType,0);}}else{if(indicesReady&&(s_gl.binaryGeometry>0||s_gl.popGeometry>0)){for(v=0,offset=0,v_n=s_geo._vf.vertexCount.length;v<v_n;v++){this.drawElements(gl,s_gl.primType[v],s_geo._vf.vertexCount[v],s_gl.indexType,x3dom.Utils.getByteAwareOffset(offset,s_gl.indexType,gl));offset+=s_geo._vf.vertexCount[v];}}else if(s_gl.binaryGeometry<0||s_gl.popGeometry<0||s_gl.imageGeometry){for(v=0,offset=0,v_n=s_geo._vf.vertexCount.length;v<v_n;v++){this.drawArrays(gl,s_gl.primType[v],offset,s_geo._vf.vertexCount[v]);offset+=s_geo._vf.vertexCount[v];}}else if(indicesReady&&(s_gl.bufferGeometry>0)){this.drawElements(gl,s_gl.primType[0],s_geo._vf.vertexCount[0],s_gl.indexType,shape._indexOffset);}else if(s_gl.bufferGeometry<0){this.drawArrays(gl,s_gl.primType[0],0,s_geo._vf.vertexCount[0]);}else if(s_geo.hasIndexOffset()){indOff=shape.tessellationProperties();for(v=0,v_n=indOff.length;v<v_n;v++){this.drawElements(gl,s_gl.primType,indOff[v].count,s_gl.indexType,indOff[v].offset*x3dom.Utils.getOffsetMultiplier(s_gl.indexType,gl));}}else if(s_gl.indexes[q].length==0){this.drawArrays(gl,s_gl.primType,0,s_gl.positions[q].length/3);}else{this.drawElements(gl,s_gl.primType,s_gl.indexes[q].length,s_gl.indexType,0);}}}\ngl.disableVertexAttribArray(sp.position);if(sp.normal!==undefined){gl.disableVertexAttribArray(sp.normal);}\nthis.disableVertexAttribEyeIdx(gl,sp);if(sp.texcoord!==undefined){gl.disableVertexAttribArray(sp.texcoord);}\nif(sp.texcoord2!==undefined){gl.disableVertexAttribArray(sp.texcoord2);}\nif(sp.color!==undefined){gl.disableVertexAttribArray(sp.color);}\nif(sp.tangent!==undefined){gl.disableVertexAttribArray(sp.tangent);}\nif(sp.binormal!==undefined){gl.disableVertexAttribArray(sp.binormal);}\nif(s_gl.buffers[q6+x3dom.BUFFER_IDX.ID]){if(sp.id!==undefined){gl.disableVertexAttribArray(sp.id);}else if(sp.particleSize!==undefined){gl.disableVertexAttribArray(sp.particleSize);}}\nif(s_gl.popGeometry!=0&&sp.PG_vertexID!==undefined){gl.disableVertexAttribArray(sp.PG_vertexID);}}\nfor(df=0;df<df_n;df++){attrib=s_gl.dynamicFields[df];if(sp[attrib.name]!==undefined){gl.disableVertexAttribArray(sp[attrib.name]);}}\nif(s_gl.imageGeometry){v_n=s_geo._vf.vertexCount.length;this.numDrawCalls+=v_n;for(v=0;v<v_n;v++){if(s_gl.primType[v]==gl.TRIANGLE_STRIP){this.numFaces+=(s_geo._vf.vertexCount[v]-2);}else{this.numFaces+=(s_geo._vf.vertexCount[v]/3);}\nthis.numCoords+=s_geo._vf.vertexCount[v];}}else{this.numCoords+=s_msh._numCoords;this.numFaces+=s_msh._numFaces;if(s_gl.binaryGeometry||s_gl.popGeometry||s_gl.bufferGeometry){this.numDrawCalls+=s_geo._vf.vertexCount.length;}else if(s_geo.hasIndexOffset()){this.numDrawCalls+=shape.tessellationProperties().length;}else{this.numDrawCalls+=q_n;}}\nif(depthMode){this.stateManager.enable(gl.DEPTH_TEST);this.stateManager.depthMask(true);this.stateManager.depthFunc(gl.LEQUAL);this.stateManager.depthRange(0,1);}\nif(blendMode){this.stateManager.enable(gl.BLEND);this.stateManager.blendFuncSeparate(gl.SRC_ALPHA,gl.ONE_MINUS_SRC_ALPHA,gl.ONE,gl.ONE);this.stateManager.blendColor(1,1,1,1);this.stateManager.blendEquation(gl.FUNC_ADD);}\nif(colorMaskMode){this.stateManager.colorMask(true,true,true,true);}\nif(lineProperties){this.stateManager.lineWidth(1);}\nvar s_gl_tex=s_gl.texture;cnt_n=s_gl_tex?s_gl_tex.length:0;for(cnt=0;cnt<cnt_n;cnt++){if(!s_gl_tex[cnt])\ncontinue;if(s_app&&s_app._cf.texture.node){tex=s_app._cf.texture.node.getTexture(cnt);gl.activeTexture(gl.TEXTURE0+cnt);if(x3dom.isa(tex,x3dom.nodeTypes.X3DEnvironmentTextureNode)){gl.bindTexture(gl.TEXTURE_CUBE_MAP,null);}else{gl.bindTexture(gl.TEXTURE_2D,null);}}}};Context.prototype.updatePopState=function(drawable,popGeo,sp,s_gl,scene,model_view,viewarea,currFps){var tol=x3dom.nodeTypes.PopGeometry.ErrorToleranceFactor*popGeo._vf.precisionFactor;if(currFps<=1||viewarea.isMovingOrAnimating()){tol*=x3dom.nodeTypes.PopGeometry.PrecisionFactorOnMove;}\nvar currentLOD=16;if(tol>0){var viewpoint=scene.getViewpoint();var imgPlaneHeightAtDistOne=viewpoint.getImgPlaneHeightAtDistOne();var near=viewpoint.getNear();var center=model_view.multMatrixPnt(popGeo._vf.position);var tightRad=model_view.multMatrixVec(popGeo._vf.size).length()*0.5;var largestRad=model_view.multMatrixVec(popGeo._vf.maxBBSize).length()*0.5;var dist=Math.max(-center.z-tightRad,near);var projPixelLength=dist*(imgPlaneHeightAtDistOne/viewarea._height);var arg=(2*largestRad)/(tol*projPixelLength);currentLOD=Math.ceil(Math.log(arg)/0.693147180559945);currentLOD=(currentLOD<1)?1:((currentLOD>16)?16:currentLOD);}\nvar minPrec=popGeo._vf.minPrecisionLevel,maxPrec=popGeo._vf.maxPrecisionLevel;currentLOD=(minPrec!=-1&&currentLOD<minPrec)?minPrec:currentLOD;currentLOD=(maxPrec!=-1&&currentLOD>maxPrec)?maxPrec:currentLOD;var currentLOD_min=(s_gl.levelsAvailable<currentLOD)?s_gl.levelsAvailable:currentLOD;currentLOD=currentLOD_min;if(tol<=1)\ncurrentLOD=(currentLOD==popGeo.getNumLevels())?16:currentLOD;var hasIndex=popGeo._vf.indexedRendering;var p_msh=popGeo._mesh;p_msh._numCoords=0;p_msh._numFaces=0;for(var i=0;i<currentLOD_min;++i){var numVerticesAtLevel_i=s_gl.numVerticesAtLevel[i];p_msh._numCoords+=numVerticesAtLevel_i;p_msh._numFaces+=(hasIndex?popGeo.getNumIndicesByLevel(i):numVerticesAtLevel_i)/3;}\nx3dom.nodeTypes.PopGeometry.numRenderedVerts+=p_msh._numCoords;x3dom.nodeTypes.PopGeometry.numRenderedTris+=p_msh._numFaces;p_msh.currentLOD=currentLOD;popGeo.adaptVertexCount(hasIndex?p_msh._numFaces*3:p_msh._numCoords);sp.PG_maxBBSize=popGeo._vf.maxBBSize.toGL();sp.PG_bbMin=popGeo._bbMinBySize;sp.PG_numAnchorVertices=popGeo._vf.numAnchorVertices;sp.PG_bbMaxModF=popGeo._vf.bbMaxModF.toGL();sp.PG_bboxShiftVec=popGeo._vf.bbShiftVec.toGL();sp.PG_precisionLevel=currentLOD;sp.PG_powPrecision=x3dom.nodeTypes.PopGeometry.powLUT[currentLOD-1];};Context.prototype.pickValue=function(viewarea,x,y,buttonState,viewMat,sceneMat){x3dom.Utils.startMeasure(\"picking\");var scene=viewarea._scene;var gl=this.ctx3d;if(!gl||!scene||!scene._webgl||!scene.drawableCollection){return false;}\nvar pm=scene._vf.pickMode.toLowerCase();var pickMode=0;switch(pm){case\"box\":return false;case\"idbuf\":pickMode=0;break;case\"idbuf24\":pickMode=3;break;case\"idbufid\":pickMode=4;break;case\"color\":pickMode=1;break;case\"texcoord\":pickMode=2;break;}\nvar mat_view,mat_scene;if(arguments.length>4){mat_view=viewMat;mat_scene=sceneMat;}else{mat_view=viewarea._last_mat_view;mat_scene=viewarea._last_mat_scene;}\nvar min=x3dom.fields.SFVec3f.copy(scene._lastMin);var max=x3dom.fields.SFVec3f.copy(scene._lastMax);var from=mat_view.inverse().e3();var _min=x3dom.fields.SFVec3f.copy(from);var _max=x3dom.fields.SFVec3f.copy(from);if(_min.x>min.x){_min.x=min.x;}\nif(_min.y>min.y){_min.y=min.y;}\nif(_min.z>min.z){_min.z=min.z;}\nif(_max.x<max.x){_max.x=max.x;}\nif(_max.y<max.y){_max.y=max.y;}\nif(_max.z<max.z){_max.z=max.z;}\nscene._lastMin.setValues(_min);scene._lastMax.setValues(_max);var sceneSize=scene._lastMax.subtract(scene._lastMin).length();if(scene.getViewpoint().getFar())\n{sceneSize=Math.min(sceneSize,scene.getViewpoint().getFar());}\nvar cctowc=viewarea.getCCtoWCMatrix();scene._lastMin.setValues(min);scene._lastMax.setValues(max);var baseID=x3dom.nodeTypes.Shape.objectID+2;this.renderPickingPass(gl,scene,mat_view,mat_scene,from,sceneSize,pickMode,x,y,2,2);var pixelData=scene._webgl.fboPick.pixelData;if(pixelData&&pixelData.length){var pickPos=new x3dom.fields.SFVec3f(0,0,0);var pickNorm=new x3dom.fields.SFVec3f(0,0,1);var index=0;var objId=pixelData[index+3],shapeId;var pixelOffset=1.0/scene._webgl.pickScale;var denom=1.0/256.0;var dist,line,lineoff,right,up;if(pickMode==0){objId+=256*pixelData[index+2];dist=(pixelData[index]/255.0)*denom+\n(pixelData[index+1]/255.0);line=viewarea.calcViewRay(x,y,cctowc);pickPos=from.add(line.dir.multiply(dist*sceneSize));index=4;dist=(pixelData[index]/255.0)*denom+\n(pixelData[index+1]/255.0);lineoff=viewarea.calcViewRay(x+pixelOffset,y,cctowc);right=from.add(lineoff.dir.multiply(dist*sceneSize));right=right.subtract(pickPos).normalize();index=8;dist=(pixelData[index]/255.0)*denom+\n(pixelData[index+1]/255.0);lineoff=viewarea.calcViewRay(x,y-pixelOffset,cctowc);up=from.add(lineoff.dir.multiply(dist*sceneSize));up=up.subtract(pickPos).normalize();pickNorm=right.cross(up).normalize();}else if(pickMode==3){objId+=256*pixelData[index+2]+\n65536*pixelData[index+1];dist=pixelData[index]/255.0;line=viewarea.calcViewRay(x,y,cctowc);pickPos=from.add(line.dir.multiply(dist*sceneSize));index=4;dist=pixelData[index]/255.0;lineoff=viewarea.calcViewRay(x+pixelOffset,y,cctowc);right=from.add(lineoff.dir.multiply(dist*sceneSize));right=right.subtract(pickPos).normalize();index=8;dist=pixelData[index]/255.0;lineoff=viewarea.calcViewRay(x,y-pixelOffset,cctowc);up=from.add(lineoff.dir.multiply(dist*sceneSize));up=up.subtract(pickPos).normalize();pickNorm=right.cross(up).normalize();}else if(pickMode==4){objId+=256*pixelData[index+2];shapeId=pixelData[index+1];shapeId+=256*pixelData[index];if(objId==0&&(shapeId>0&&shapeId<baseID)){objId=shapeId;}}else{pickPos.x=pixelData[index];pickPos.y=pixelData[index+1];pickPos.z=pixelData[index+2];}\nvar eventType=\"shadowObjectIdChanged\";var shadowObjectIdChanged,event;var button=Math.max(buttonState>>>8,buttonState&255);if(objId>=baseID){objId-=baseID;var hitObject;var layerX=x*viewarea._inverseDevicePixelRatio;var layerY=y*viewarea._inverseDevicePixelRatio;if(pickMode!=4){viewarea._pickingInfo.pickPos=pickPos;viewarea._pick.setValues(pickPos);viewarea._pickingInfo.pickNorm=pickNorm;viewarea._pickNorm.setValues(pickNorm);viewarea._pickingInfo.pickObj=null;viewarea._pickingInfo.lastClickObj=null;hitObject=scene._xmlNode;}else{viewarea._pickingInfo.pickObj=x3dom.nodeTypes.Shape.idMap.nodeID[shapeId];hitObject=viewarea._pickingInfo.pickObj._xmlNode;}\nif(scene._multiPartMap){var mp,multiPart;for(mp=0;mp<scene._multiPartMap.multiParts.length;mp++){multiPart=scene._multiPartMap.multiParts[mp];if(objId>=multiPart._minId&&objId<=multiPart._maxId){hitObject=multiPart._xmlNode;event={target:multiPart._xmlNode,button:button,mouseup:((buttonState>>>8)>0),layerX:layerX,layerY:layerY,pickedId:objId,worldX:pickPos.x,worldY:pickPos.y,worldZ:pickPos.z,normalX:pickNorm.x,normalY:pickNorm.y,normalZ:pickNorm.z,hitPnt:pickPos.toGL(),hitObject:hitObject,cancelBubble:false,stopPropagation:function(){this.cancelBubble=true;},preventDefault:function(){this.cancelBubble=true;}};multiPart.handleEvents(event);}else{event={target:multiPart._xmlNode,button:button,mouseup:((buttonState>>>8)>0),layerX:layerX,layerY:layerY,pickedId:-1,cancelBubble:false,stopPropagation:function(){this.cancelBubble=true;},preventDefault:function(){this.cancelBubble=true;}};multiPart.handleEvents(event);}}}\nshadowObjectIdChanged=(viewarea._pickingInfo.shadowObjectId!=objId);viewarea._pickingInfo.lastShadowObjectId=viewarea._pickingInfo.shadowObjectId;viewarea._pickingInfo.shadowObjectId=objId;if((shadowObjectIdChanged||button)&&scene._xmlNode&&(scene._xmlNode[\"on\"+eventType]||scene._xmlNode.hasAttribute(\"on\"+eventType)||scene._listeners[eventType])){event={target:scene._xmlNode,type:eventType,button:button,mouseup:((buttonState>>>8)>0),layerX:layerX,layerY:layerY,shadowObjectId:objId,worldX:pickPos.x,worldY:pickPos.y,worldZ:pickPos.z,normalX:pickNorm.x,normalY:pickNorm.y,normalZ:pickNorm.z,hitPnt:pickPos.toGL(),hitObject:hitObject,cancelBubble:false,stopPropagation:function(){this.cancelBubble=true;},preventDefault:function(){this.cancelBubble=true;}};scene.callEvtHandler((\"on\"+eventType),event);}\nif(scene._shadowIdMap&&scene._shadowIdMap.mapping&&objId<scene._shadowIdMap.mapping.length){var shIds=scene._shadowIdMap.mapping[objId].usage;var n,c,shObj;if(!line){line=viewarea.calcViewRay(x,y,cctowc);}\nfor(c=0;c<shIds.length;c++){shObj=scene._nameSpace.defMap[shIds[c]];if(shObj&&shObj.doIntersect(line)){viewarea._pickingInfo.pickObj=shObj;break;}}\nfor(n=0;n<scene._nameSpace.childSpaces.length;n++){for(c=0;c<shIds.length;c++){shObj=scene._nameSpace.childSpaces[n].defMap[shIds[c]];if(shObj&&shObj.doIntersect(line)){viewarea._pickingInfo.pickObj=shObj;break;}}}}}else{if(scene._multiPartMap){for(mp=0;mp<scene._multiPartMap.multiParts.length;mp++){multiPart=scene._multiPartMap.multiParts[mp];event={target:multiPart._xmlNode,button:button,mouseup:((buttonState>>>8)>0),layerX:layerX,layerY:layerY,pickedId:-1,cancelBubble:false,stopPropagation:function(){this.cancelBubble=true;},preventDefault:function(){this.cancelBubble=true;}};multiPart.handleEvents(event);}}\nshadowObjectIdChanged=(viewarea._pickingInfo.shadowObjectId!=-1);viewarea._pickingInfo.shadowObjectId=-1;if(shadowObjectIdChanged&&scene._xmlNode&&(scene._xmlNode[\"on\"+eventType]||scene._xmlNode.hasAttribute(\"on\"+eventType)||scene._listeners[eventType])){event={target:scene._xmlNode,type:eventType,button:button,mouseup:((buttonState>>>8)>0),layerX:layerX,layerY:layerY,shadowObjectId:viewarea._pickingInfo.shadowObjectId,cancelBubble:false,stopPropagation:function(){this.cancelBubble=true;},preventDefault:function(){this.cancelBubble=true;}};scene.callEvtHandler((\"on\"+eventType),event);}\nif(objId>0){viewarea._pickingInfo.pickPos=pickPos;viewarea._pickingInfo.pickNorm=pickNorm;viewarea._pickingInfo.pickObj=x3dom.nodeTypes.Shape.idMap.nodeID[objId];}else{viewarea._pickingInfo.pickObj=null;viewarea._pickingInfo.lastClickObj=null;}}}\nvar pickTime=x3dom.Utils.stopMeasure(\"picking\");this.x3dElem.runtime.addMeasurement('PICKING',pickTime);return true;};Context.prototype.pickRect=function(viewarea,x1,y1,x2,y2,fromMultipartAPI){var gl=this.ctx3d;var scene=viewarea?viewarea._scene:null;fromMultipartAPI=(fromMultipartAPI!=undefined)?fromMultipartAPI:false;if(!gl||!scene||!scene._webgl||!scene.drawableCollection)\nreturn false;var from=viewarea._last_mat_view.inverse().e3();var sceneSize=scene._lastMax.subtract(scene._lastMin).length();var x=(x1<=x2)?x1:x2;var y=(y1>=y2)?y1:y2;var width=(1+Math.abs(x2-x1))*scene._webgl.pickScale;var height=(1+Math.abs(y2-y1))*scene._webgl.pickScale;this.renderPickingPass(gl,scene,viewarea._last_mat_view,viewarea._last_mat_scene,from,sceneSize,0,x,y,(width<1)?1:width,(height<1)?1:height);var index;var pickedObjects=[];for(index=0;scene._webgl.fboPick.pixelData&&index<scene._webgl.fboPick.pixelData.length;index+=4){var objId=scene._webgl.fboPick.pixelData[index+3]+\nscene._webgl.fboPick.pixelData[index+2]*256;if(objId>0)\npickedObjects.push(objId);}\npickedObjects.sort();var pickedObjectsTemp=(function(arr){var a=[],l=arr.length;for(var i=0;i<l;i++){for(var j=i+1;j<l;j++){if(arr[i]===arr[j])\nj=++i;}\na.push(arr[i]);}\nreturn a;})(pickedObjects);pickedObjects=pickedObjectsTemp;var pickedNode,pickedNodes=[];var hitObject;var baseID=x3dom.nodeTypes.Shape.objectID+2;var partIDs=[];for(index=0;index<pickedObjects.length;index++){objId=pickedObjects[index];if(objId>=baseID){objId-=baseID;if(scene._multiPartMap){var mp,multiPart,colorMap,emissiveMap,specularMap,visibilityMap,partID;for(mp=0;mp<scene._multiPartMap.multiParts.length;mp++){multiPart=scene._multiPartMap.multiParts[mp];colorMap=multiPart._inlineNamespace.defMap[\"MultiMaterial_ColorMap\"];emissiveMap=multiPart._inlineNamespace.defMap[\"MultiMaterial_EmissiveMap\"];specularMap=multiPart._inlineNamespace.defMap[\"MultiMaterial_SpecularMap\"];visibilityMap=multiPart._inlineNamespace.defMap[\"MultiMaterial_VisibilityMap\"];if(objId>=multiPart._minId&&objId<=multiPart._maxId){partIDs.push(objId);partID=multiPart._idMap.mapping[objId-multiPart._minId].name;hitObject=new x3dom.Parts(multiPart,[objId],colorMap,emissiveMap,specularMap,visibilityMap);pickedNode={\"partID\":partID,\"part\":hitObject};pickedNodes.push(pickedNode);}}}}else{hitObject=x3dom.nodeTypes.Shape.idMap.nodeID[objId];hitObject=(hitObject&&hitObject._xmlNode)?hitObject._xmlNode:null;if(hitObject)\npickedNodes.push(hitObject);}}\nif(fromMultipartAPI&&partIDs.length){pickedNodes=new x3dom.Parts(multiPart,partIDs,colorMap,emissiveMap,specularMap,visibilityMap);}\nreturn pickedNodes;};Context.prototype.renderScene=function(viewarea,vrFrameData)\n{var gl=this.ctx3d;var scene=viewarea._scene;if(gl===null||scene===null){return;}\nvar rentex=viewarea._doc._nodeBag.renderTextures;var rt_tex,rtl_i,rtl_n=rentex.length;var texProp=null;var type=gl.UNSIGNED_BYTE;var shadowType=gl.UNSIGNED_BYTE;var nearestFilt=false;if(x3dom.caps.FP_TEXTURES&&!x3dom.caps.MOBILE){type=gl.FLOAT;shadowType=gl.FLOAT;if(!x3dom.caps.FPL_TEXTURES){nearestFilt=true;}}\nvar shadowedLights,numShadowMaps;var i,j,n,size,sizeAvailable;var texType,refinementPos;var vertices=[-1,-1,1,-1,-1,1,-1,1,1,-1,1,1];scene.updateVolume();if(!scene._webgl){scene._webgl={};this.setupFgnds(gl,scene);scene._webgl.pickScale=0.5;scene._webgl._currFboWidth=Math.round(this.canvas.width*scene._webgl.pickScale);scene._webgl._currFboHeight=Math.round(this.canvas.height*scene._webgl.pickScale);scene._webgl.fboPick=x3dom.Utils.initFBO(gl,scene._webgl._currFboWidth,scene._webgl._currFboHeight,gl.UNSIGNED_BYTE,false,true);scene._webgl.fboPick.pixelData=null;scene._webgl.normalShader=this.cache.getShader(gl,x3dom.shader.NORMAL);scene._webgl.fboShadow=[];shadowedLights=viewarea.getShadowedLights();n=shadowedLights.length;for(i=0;i<n;i++){size=shadowedLights[i]._vf.shadowMapSize;if(!x3dom.isa(shadowedLights[i],x3dom.nodeTypes.PointLight)){numShadowMaps=Math.max(1,Math.min(shadowedLights[i]._vf.shadowCascades,6));}else{numShadowMaps=6;}\nscene._webgl.fboShadow[i]=[];for(j=0;j<numShadowMaps;j++)\nscene._webgl.fboShadow[i][j]=x3dom.Utils.initFBO(gl,size,size,shadowType,false,true);}\nif(scene._webgl.fboShadow.length>0||x3dom.SSAO.isEnabled(scene))\nscene._webgl.fboScene=x3dom.Utils.initFBO(gl,this.canvas.width,this.canvas.height,shadowType,false,true);scene._webgl.fboBlur=[];for(i=0;i<n;i++){size=scene._webgl.fboShadow[i][0].height;sizeAvailable=false;for(j=0;j<scene._webgl.fboBlur.length;j++){if(size==scene._webgl.fboBlur[j].height)\nsizeAvailable=true;}\nif(!sizeAvailable)\nscene._webgl.fboBlur[scene._webgl.fboBlur.length]=x3dom.Utils.initFBO(gl,size,size,shadowType,false,true);}\nscene._webgl.ppBuffer=gl.createBuffer();gl.bindBuffer(gl.ARRAY_BUFFER,scene._webgl.ppBuffer);gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(vertices),gl.STATIC_DRAW);scene._webgl.refinement={stamps:new Array(2),positionBuffer:gl.createBuffer()};gl.bindBuffer(gl.ARRAY_BUFFER,scene._webgl.refinement.positionBuffer);gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(vertices),gl.STATIC_DRAW);for(rtl_i=0;rtl_i<rtl_n;rtl_i++){rt_tex=rentex[rtl_i];texProp=rt_tex._cf.textureProperties.node;texType=rt_tex.requirePingPong()?gl.UNSIGNED_BYTE:type;rt_tex._webgl={};rt_tex._webgl.fbo=x3dom.Utils.initFBO(gl,rt_tex._vf.dimensions[0],rt_tex._vf.dimensions[1],texType,(texProp&&texProp._vf.generateMipMaps),rt_tex._vf.depthMap||!rt_tex.requirePingPong());rt_tex._cleanupGLObjects=function(retainTex){if(!retainTex)\ngl.deleteTexture(this._webgl.fbo.tex);if(this._webgl.fbo.dtex)\ngl.deleteTexture(this._webgl.fbo.dtex);if(this._webgl.fbo.rbo)\ngl.deleteFramebuffer(this._webgl.fbo.rbo);gl.bindFramebuffer(gl.FRAMEBUFFER,null);gl.deleteFramebuffer(this._webgl.fbo.fbo);this._webgl.fbo.rbo=null;this._webgl.fbo.fbo=null;};if(rt_tex.requirePingPong()){refinementPos=rt_tex._vf.dimensions[0]+\"x\"+rt_tex._vf.dimensions[1];if(scene._webgl.refinement[refinementPos]===undefined){scene._webgl.refinement[refinementPos]=x3dom.Utils.initFBO(gl,rt_tex._vf.dimensions[0],rt_tex._vf.dimensions[1],texType,false,false);}\nrt_tex._webgl.texture=null;}}\nviewarea._last_mat_view=x3dom.fields.SFMatrix4f.identity();viewarea._last_mat_proj=x3dom.fields.SFMatrix4f.identity();viewarea._last_mat_scene=x3dom.fields.SFMatrix4f.identity();this._calledViewpointChangedHandler=false;}else{var fboWidth=Math.round(this.canvas.width*scene._webgl.pickScale);var fboHeight=Math.round(this.canvas.height*scene._webgl.pickScale);if(scene._webgl._currFboWidth!==fboWidth||scene._webgl._currFboHeight!==fboHeight){scene._webgl._currFboWidth=fboWidth;scene._webgl._currFboHeight=fboHeight;scene._webgl.fboPick=x3dom.Utils.initFBO(gl,fboWidth,fboHeight,scene._webgl.fboPick.type,false,true);scene._webgl.fboPick.pixelData=null;x3dom.debug.logInfo(\"Refreshed picking FBO to size (\"+fboWidth+\", \"+fboHeight+\")\");}\nfor(rtl_i=0;rtl_i<rtl_n;rtl_i++){rt_tex=rentex[rtl_i];if(rt_tex._webgl&&rt_tex._webgl.fbo&&rt_tex._webgl.fbo.width==rt_tex._vf.dimensions[0]&&rt_tex._webgl.fbo.height==rt_tex._vf.dimensions[1])\ncontinue;rt_tex.invalidateGLObject();if(rt_tex._cleanupGLObjects){rt_tex._cleanupGLObjects();}else{rt_tex._cleanupGLObjects=function(retainTex){if(!retainTex)\ngl.deleteTexture(this._webgl.fbo.tex);if(this._webgl.fbo.dtex)\ngl.deleteTexture(this._webgl.fbo.dtex);if(this._webgl.fbo.rbo)\ngl.deleteRenderbuffer(this._webgl.fbo.rbo);gl.bindFramebuffer(gl.FRAMEBUFFER,null);gl.deleteFramebuffer(this._webgl.fbo.fbo);this._webgl.fbo.rbo=null;this._webgl.fbo.fbo=null;};}\ntexProp=rt_tex._cf.textureProperties.node;texType=rt_tex.requirePingPong()?gl.UNSIGNED_BYTE:type;rt_tex._webgl={};rt_tex._webgl.fbo=x3dom.Utils.initFBO(gl,rt_tex._vf.dimensions[0],rt_tex._vf.dimensions[1],texType,(texProp&&texProp._vf.generateMipMaps),rt_tex._vf.depthMap||!rt_tex.requirePingPong());if(rt_tex.requirePingPong()){refinementPos=rt_tex._vf.dimensions[0]+\"x\"+rt_tex._vf.dimensions[1];if(scene._webgl.refinement[refinementPos]===undefined){scene._webgl.refinement[refinementPos]=x3dom.Utils.initFBO(gl,rt_tex._vf.dimensions[0],rt_tex._vf.dimensions[1],texType,false,false);}\nrt_tex._webgl.texture=null;}\nx3dom.debug.logInfo(\"Init/resize RenderedTexture_\"+rtl_i+\" to size \"+\nrt_tex._vf.dimensions[0]+\" x \"+rt_tex._vf.dimensions[1]);}\nshadowedLights=viewarea.getShadowedLights();n=shadowedLights.length;for(i=0;i<n;i++){size=shadowedLights[i]._vf.shadowMapSize;if(!x3dom.isa(shadowedLights[i],x3dom.nodeTypes.PointLight)){numShadowMaps=Math.max(1,Math.min(shadowedLights[i]._vf.shadowCascades,6));}else{numShadowMaps=6;}\nif(typeof scene._webgl.fboShadow[i]===\"undefined\"||scene._webgl.fboShadow[i].length!=numShadowMaps||scene._webgl.fboShadow[i][0].height!=size){scene._webgl.fboShadow[i]=[];for(j=0;j<numShadowMaps;j++){scene._webgl.fboShadow[i][j]=x3dom.Utils.initFBO(gl,size,size,shadowType,false,true);}}}\nfor(i=0;i<n;i++){size=scene._webgl.fboShadow[i][0].height;sizeAvailable=false;for(j=0;j<scene._webgl.fboBlur.length;j++){if(size==scene._webgl.fboBlur[j].height)\nsizeAvailable=true;}\nif(!sizeAvailable)\nscene._webgl.fboBlur[scene._webgl.fboBlur.length]=x3dom.Utils.initFBO(gl,size,size,shadowType,false,true);}\nif((x3dom.SSAO.isEnabled(scene)||scene._webgl.fboShadow.length>0)&&typeof scene._webgl.fboScene==\"undefined\"||scene._webgl.fboScene&&(this.canvas.width!=scene._webgl.fboScene.width||this.canvas.height!=scene._webgl.fboScene.height)){scene._webgl.fboScene=x3dom.Utils.initFBO(gl,this.canvas.width,this.canvas.height,shadowType,false,true);}}\nvar env=scene.getEnvironment();env.checkSanity();var bgnd=scene.getBackground();this.setupScene(gl,bgnd);this.numFaces=0;this.numCoords=0;this.numDrawCalls=0;var mat_proj=viewarea.getProjectionMatrix();var mat_view=viewarea.getViewMatrix();if(!this._calledViewpointChangedHandler||!viewarea._last_mat_view.equals(mat_view)){var e_viewpoint=scene.getViewpoint();var e_eventType=\"viewpointChanged\";try\n{if(e_viewpoint.hasEventListener(e_eventType)||scene.hasEventListener(e_eventType))\n{var e_viewtrafo=e_viewpoint.getCurrentTransform();e_viewtrafo=e_viewtrafo.inverse().mult(mat_view);var e_mat=e_viewtrafo.inverse();var e_rotation=new x3dom.fields.Quaternion(0,0,1,0);e_rotation.setValue(e_mat);var e_translation=e_mat.e3();var e_event={target:e_viewpoint._xmlNode,type:e_eventType,matrix:e_viewtrafo,position:e_translation,orientation:e_rotation.toAxisAngle(),cancelBubble:false,stopPropagation:function(){this.cancelBubble=true;},preventDefault:function(){this.cancelBubble=true;}};if(e_viewpoint.hasEventListener(e_eventType))\n{e_viewpoint.callEvtHandler((\"on\"+e_eventType),e_event);}\nif(scene.hasEventListener(e_eventType))\n{scene.callEvtHandler((\"on\"+e_eventType),e_event);}\ne_viewpoint.callEvtHandler((\"on\"+e_eventType),e_event);this._calledViewpointChangedHandler=true;}}\ncatch(e_e)\n{x3dom.debug.logException(e_e);}}\nviewarea._last_mat_view=mat_view;viewarea._last_mat_proj=mat_proj;var mat_scene=mat_proj.mult(mat_view);viewarea._last_mat_scene=mat_scene;scene.drawableCollection=null;if(!scene.drawableCollection){var drawableCollectionConfig={viewArea:viewarea,sortTrans:env._vf.sortTrans,viewMatrix:mat_view,projMatrix:mat_proj,sceneMatrix:mat_scene,frustumCulling:true,smallFeatureThreshold:env._smallFeatureThreshold,context:this,gl:gl};scene.drawableCollection=new x3dom.DrawableCollection(drawableCollectionConfig);x3dom.Utils.startMeasure('traverse');scene.collectDrawableObjects(x3dom.fields.SFMatrix4f.identity(),scene.drawableCollection,true,false,0,[]);var traverseTime=x3dom.Utils.stopMeasure('traverse');this.x3dElem.runtime.addMeasurement('TRAVERSE',traverseTime);}\nx3dom.Utils.startMeasure('sorting');scene.drawableCollection.sort();var sortTime=x3dom.Utils.stopMeasure('sorting');this.x3dElem.runtime.addMeasurement('SORT',sortTime);var slights=viewarea.getLights();var numLights=slights.length;var mat_light;var WCToLCMatrices=[];var lMatrices=[];var shadowCount=0;x3dom.Utils.startMeasure('shadow');for(var p=0;p<numLights;p++){if(slights[p]._vf.shadowIntensity>0.0){var lightMatrix=viewarea.getLightMatrix()[p];var shadowMaps=scene._webgl.fboShadow[shadowCount];var offset=Math.max(0.0,Math.min(1.0,slights[p]._vf.shadowOffset));if(!x3dom.isa(slights[p],x3dom.nodeTypes.PointLight)){var numCascades=Math.max(1,Math.min(slights[p]._vf.shadowCascades,6));mat_light=viewarea.getWCtoLCMatricesCascaded(lightMatrix,slights[p],mat_proj);for(i=0;i<numCascades;i++){this.renderShadowPass(gl,viewarea,mat_light[i],mat_view,shadowMaps[i],offset,false);}}else{mat_light=viewarea.getWCtoLCMatricesPointLight(lightMatrix,slights[p],mat_proj);for(i=0;i<6;i++){this.renderShadowPass(gl,viewarea,mat_light[i],mat_view,shadowMaps[i],offset,false);}}\nshadowCount++;WCToLCMatrices[WCToLCMatrices.length]=mat_light;lMatrices[lMatrices.length]=lightMatrix;}}\nif(shadowCount>0||x3dom.SSAO.isEnabled(scene)){this.renderShadowPass(gl,viewarea,mat_scene,mat_view,scene._webgl.fboScene,0.0,true);var shadowTime=x3dom.Utils.stopMeasure('shadow');this.x3dElem.runtime.addMeasurement('SHADOW',shadowTime);}else{this.x3dElem.runtime.removeMeasurement('SHADOW');}\nmat_light=viewarea.getWCtoLCMatrix(viewarea.getLightMatrix()[0]);for(rtl_i=0;rtl_i<rtl_n;rtl_i++){this.renderRTPass(gl,viewarea,rentex[rtl_i]);}\nx3dom.Utils.startMeasure('render');this.stateManager.viewport(0,0,this.canvas.width,this.canvas.height);bgnd._webgl.render(gl,mat_view,mat_proj,viewarea);x3dom.nodeTypes.PopGeometry.numRenderedVerts=0;x3dom.nodeTypes.PopGeometry.numRenderedTris=0;n=scene.drawableCollection.length;if(env._vf.smallFeatureCulling&&env._lowPriorityThreshold<1&&viewarea.isMovingOrAnimating()){n=Math.floor(n*env._lowPriorityThreshold);if(!n&&scene.drawableCollection.length)\nn=1;}\nthis.stateManager.unsetProgram();for(i=0;i<n;i++){var drawable=scene.drawableCollection.get(i);this.renderShape(drawable,viewarea,slights,numLights,mat_view,mat_scene,mat_light,mat_proj,gl);}\nif(shadowCount>0)\nthis.renderShadows(gl,viewarea,shadowedLights,WCToLCMatrices,lMatrices,mat_view,mat_proj,mat_scene);this.stateManager.disable(gl.BLEND);this.stateManager.disable(gl.DEPTH_TEST);viewarea._numRenderedNodes=n;if(x3dom.SSAO.isEnabled(scene))\nx3dom.SSAO.renderSSAO(this.stateManager,gl,scene,this.canvas);if(viewarea._visDbgBuf!==undefined&&viewarea._visDbgBuf){var pm=scene._vf.pickMode.toLowerCase();if(pm.indexOf(\"idbuf\")==0||pm==\"color\"||pm==\"texcoord\"){this.stateManager.viewport(0,3*this.canvas.height/4,this.canvas.width/4,this.canvas.height/4);scene._fgnd._webgl.render(gl,scene._webgl.fboPick.tex);}\nif(shadowCount>0||x3dom.SSAO.isEnabled(scene)){this.stateManager.viewport(this.canvas.width/4,3*this.canvas.height/4,this.canvas.width/4,this.canvas.height/4);scene._fgnd._webgl.render(gl,scene._webgl.fboScene.tex);}\nvar row=3,col=2;for(i=0;i<shadowCount;i++){var shadowMaps=scene._webgl.fboShadow[i];for(j=0;j<shadowMaps.length;j++){this.stateManager.viewport(col*this.canvas.width/4,row*this.canvas.height/4,this.canvas.width/4,this.canvas.height/4);scene._fgnd._webgl.render(gl,shadowMaps[j].tex);if(col<2){col++;}else{col=0;row--;}}}\nfor(rtl_i=0;rtl_i<rtl_n;rtl_i++){rt_tex=rentex[rtl_i];if(!rt_tex._webgl.fbo.fbo)\ncontinue;this.stateManager.viewport(rtl_i*this.canvas.width/8,5*this.canvas.height/8,this.canvas.width/8,this.canvas.height/8);scene._fgnd._webgl.render(gl,rt_tex._webgl.fbo.tex);}}\ngl.finish();var renderTime=x3dom.Utils.stopMeasure('render');this.x3dElem.runtime.addMeasurement('RENDER',renderTime);this.x3dElem.runtime.addMeasurement('DRAW',(n?renderTime/n:0));this.x3dElem.runtime.addInfo('#NODES:',scene.drawableCollection.numberOfNodes);this.x3dElem.runtime.addInfo('#SHAPES:',viewarea._numRenderedNodes);this.x3dElem.runtime.addInfo(\"#DRAWS:\",this.numDrawCalls);this.x3dElem.runtime.addInfo(\"#POINTS:\",this.numCoords);this.x3dElem.runtime.addInfo(\"#TRIS:\",this.numFaces);};Context.prototype.renderPingPongPass=function(gl,viewarea,rt){var scene=viewarea._scene;var refinementPos=rt._vf.dimensions[0]+\"x\"+rt._vf.dimensions[1];var refinementFbo=scene._webgl.refinement[refinementPos];if(rt._currLoadLevel==0&&(!scene._webgl.refinement.stamps[0]||!scene._webgl.refinement.stamps[1])){scene._webgl.refinement.stamps[0]=this.cache.getTexture2D(gl,rt._nameSpace.doc,rt._nameSpace.getURL(rt._vf.stamp0),false,'anonymous',false,false);scene._webgl.refinement.stamps[1]=this.cache.getTexture2D(gl,rt._nameSpace.doc,rt._nameSpace.getURL(rt._vf.stamp1),false,'anonymous',false,false);}\nif(rt._currLoadLevel<rt._loadLevel){rt._currLoadLevel++;if(rt._webgl.texture)\ngl.deleteTexture(rt._webgl.texture);var filename=rt._vf.url[0]+\"/\"+rt._currLoadLevel+\".\"+rt._vf.format;rt._webgl.texture=x3dom.Utils.createTexture2D(gl,rt._nameSpace.doc,rt._nameSpace.getURL(filename),false,'anonymous',false,false);if(rt._vf.iterations%2===0){(rt._currLoadLevel%2!==0)?rt._repeat.x*=2.0:rt._repeat.y*=2.0;}else{(rt._currLoadLevel%2===0)?rt._repeat.x*=2.0:rt._repeat.y*=2.0;}}\nif(!rt._webgl.texture.ready||!scene._webgl.refinement.stamps[0].ready||!scene._webgl.refinement.stamps[1].ready)\nreturn;this.stateManager.bindFramebuffer(gl.FRAMEBUFFER,refinementFbo.fbo);this.stateManager.viewport(0,0,refinementFbo.width,refinementFbo.height);this.stateManager.disable(gl.BLEND);this.stateManager.disable(gl.CULL_FACE);this.stateManager.disable(gl.DEPTH_TEST);gl.clearColor(0,0,0,1);gl.clearDepth(1);gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT);var sp=this.cache.getShader(gl,x3dom.shader.TEXTURE_REFINEMENT);this.stateManager.useProgram(sp);gl.bindBuffer(gl.ARRAY_BUFFER,scene._webgl.refinement.positionBuffer);gl.vertexAttribPointer(sp.position,2,gl.FLOAT,false,0,0);gl.enableVertexAttribArray(sp.position);sp.stamp=0;gl.activeTexture(gl.TEXTURE0);gl.bindTexture(gl.TEXTURE_2D,scene._webgl.refinement.stamps[(rt._currLoadLevel+1)%2]);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.NEAREST);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.NEAREST);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,gl.REPEAT);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,gl.REPEAT);if(rt._currLoadLevel>1){sp.lastTex=1;gl.activeTexture(gl.TEXTURE1);gl.bindTexture(gl.TEXTURE_2D,rt._webgl.fbo.tex);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.NEAREST);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.NEAREST);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE);}\nsp.curTex=2;gl.activeTexture(gl.TEXTURE2);gl.bindTexture(gl.TEXTURE_2D,rt._webgl.texture);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.NEAREST);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.NEAREST);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE);sp.mode=rt._currLoadLevel-1;sp.repeat=rt._repeat.toGL();gl.drawArrays(gl.TRIANGLES,0,6);this.stateManager.bindFramebuffer(gl.FRAMEBUFFER,rt._webgl.fbo.fbo);gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT);sp.mode=0;sp.curTex=2;gl.activeTexture(gl.TEXTURE2);gl.bindTexture(gl.TEXTURE_2D,refinementFbo.tex);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.NEAREST);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.NEAREST);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE);gl.drawArrays(gl.TRIANGLES,0,6);gl.activeTexture(gl.TEXTURE0);gl.bindTexture(gl.TEXTURE_2D,null);gl.disableVertexAttribArray(sp.position);this.stateManager.bindFramebuffer(gl.FRAMEBUFFER,null);this.stateManager.viewport(0,0,this.canvas.width,this.canvas.height);if(rt._vf.autoRefinement)\nrt.nextLevel();if(rt._currLoadLevel==rt._vf.maxLevel)\nrt._currLoadLevel++;if(rt._webgl.fbo.mipMap){gl.bindTexture(gl.TEXTURE_2D,rt._webgl.fbo.tex);gl.generateMipmap(gl.TEXTURE_2D);gl.bindTexture(gl.TEXTURE_2D,null);}\nif(!rt.requirePingPong()){gl.deleteTexture(rt._webgl.texture);delete rt._webgl.texture;rt._cleanupGLObjects(true);}\nrt._renderedImage++;};Context.prototype.renderRTPass=function(gl,viewarea,rt){if(x3dom.isa(rt,x3dom.nodeTypes.RefinementTexture)){if(rt.requirePingPong()){this.renderPingPongPass(gl,viewarea,rt);}\nreturn;}\nswitch(rt._vf.update.toUpperCase()){case\"NONE\":return;case\"NEXT_FRAME_ONLY\":if(!rt._needRenderUpdate){return;}\nrt._needRenderUpdate=false;break;case\"ALWAYS\":default:break;}\nvar scene=viewarea._scene;var bgnd=null;var mat_view=rt.getViewMatrix();var mat_proj=rt.getProjectionMatrix();var mat_scene=mat_proj.mult(mat_view);var lightMatrix=viewarea.getLightMatrix()[0];var mat_light=viewarea.getWCtoLCMatrix(lightMatrix);var i,n,m=rt._cf.excludeNodes.nodes.length;var arr=new Array(m);for(i=0;i<m;i++){var render=rt._cf.excludeNodes.nodes[i]._vf.render;if(render===undefined){arr[i]=-1;}else{if(render===true){arr[i]=1;}else{arr[i]=0;}}\nrt._cf.excludeNodes.nodes[i]._vf.render=false;}\nthis.stateManager.bindFramebuffer(gl.FRAMEBUFFER,rt._webgl.fbo.fbo);this.stateManager.viewport(0,0,rt._webgl.fbo.width,rt._webgl.fbo.height);if(rt._cf.background.node===null){gl.clearColor(0,0,0,1);gl.clearDepth(1.0);gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT|gl.STENCIL_BUFFER_BIT);}else if(rt._cf.background.node===scene.getBackground()){bgnd=scene.getBackground();bgnd._webgl.render(gl,mat_view,mat_proj,viewarea);}else{bgnd=rt._cf.background.node;this.setupScene(gl,bgnd);bgnd._webgl.render(gl,mat_view,mat_proj,viewarea);}\nthis.stateManager.depthFunc(gl.LEQUAL);this.stateManager.enable(gl.DEPTH_TEST);this.stateManager.enable(gl.CULL_FACE);this.stateManager.blendFuncSeparate(gl.SRC_ALPHA,gl.ONE_MINUS_SRC_ALPHA,gl.ONE,gl.ONE);this.stateManager.enable(gl.BLEND);var slights=viewarea.getLights();var numLights=slights.length;var transform,shape,drawable;var locScene=rt._cf.scene.node;if(!locScene||locScene===scene){n=scene.drawableCollection.length;if(rt._vf.showNormals){this.renderNormals(gl,scene,scene._webgl.normalShader,mat_view,mat_scene);}else{this.stateManager.unsetProgram();for(i=0;i<n;i++){drawable=scene.drawableCollection.get(i);this.renderShape(drawable,viewarea,slights,numLights,mat_view,mat_scene,mat_light,mat_proj,gl);}}}else{var env=scene.getEnvironment();var drawableCollectionConfig={viewArea:viewarea,sortTrans:env._vf.sortTrans,viewMatrix:mat_view,projMatrix:mat_proj,sceneMatrix:mat_scene,frustumCulling:false,smallFeatureThreshold:1,context:this,gl:gl};locScene.numberOfNodes=0;locScene.drawableCollection=new x3dom.DrawableCollection(drawableCollectionConfig);locScene.collectDrawableObjects(x3dom.fields.SFMatrix4f.identity(),locScene.drawableCollection,true,false,0,[]);locScene.drawableCollection.sort();n=locScene.drawableCollection.length;if(rt._vf.showNormals){this.renderNormals(gl,locScene,scene._webgl.normalShader,mat_view,mat_scene);}else{this.stateManager.unsetProgram();for(i=0;i<n;i++){drawable=locScene.drawableCollection.get(i);if(!drawable.shape._vf.render){continue;}\nthis.renderShape(drawable,viewarea,slights,numLights,mat_view,mat_scene,mat_light,mat_proj,gl);}}}\nthis.stateManager.disable(gl.BLEND);this.stateManager.disable(gl.DEPTH_TEST);gl.flush();this.stateManager.bindFramebuffer(gl.FRAMEBUFFER,null);if(rt._webgl.fbo.mipMap){gl.bindTexture(gl.TEXTURE_2D,rt._webgl.fbo.tex);gl.generateMipmap(gl.TEXTURE_2D);gl.bindTexture(gl.TEXTURE_2D,null);}\nfor(i=0;i<m;i++){if(arr[i]!==0){rt._cf.excludeNodes.nodes[i]._vf.render=true;}}};Context.prototype.renderNormals=function(gl,scene,sp,mat_view,mat_scene){if(!sp||!scene){return;}\nthis.stateManager.depthFunc(gl.LEQUAL);this.stateManager.enable(gl.DEPTH_TEST);this.stateManager.enable(gl.CULL_FACE);this.stateManager.disable(gl.BLEND);this.stateManager.useProgram(sp);var bgCenter=x3dom.fields.SFVec3f.NullVector.toGL();var bgSize=x3dom.fields.SFVec3f.OneVector.toGL();for(var i=0,n=scene.drawableCollection.length;i<n;i++){var drawable=scene.drawableCollection.get(i);var trafo=drawable.transform;var shape=drawable.shape;var s_gl=shape._webgl;if(!s_gl||!shape||!shape._vf.render){continue;}\nvar s_geo=shape._cf.geometry.node;var s_msh=s_geo._mesh;var model_view_inv=mat_view.mult(trafo).inverse();sp.normalMatrix=model_view_inv.transpose().toGL();sp.modelViewProjectionMatrix=mat_scene.mult(trafo).toGL();sp.imageGeometry=s_gl.imageGeometry;if(s_gl.coordType!=gl.FLOAT){if(s_gl.popGeometry!=0||(s_msh._numPosComponents==4&&x3dom.Utils.isUnsignedType(s_geo._vf.coordType))){sp.bgCenter=s_geo.getMin().toGL();}else{sp.bgCenter=s_geo._vf.position.toGL();}\nsp.bgSize=s_geo._vf.size.toGL();sp.bgPrecisionMax=s_geo.getPrecisionMax('coordType');}else{sp.bgCenter=bgCenter;sp.bgSize=bgSize;sp.bgPrecisionMax=1;}\nif(s_gl.normalType!=gl.FLOAT){sp.bgPrecisionNorMax=s_geo.getPrecisionMax('normalType');}else{sp.bgPrecisionNorMax=1;}\nif(shape.isSolid()){this.stateManager.enable(gl.CULL_FACE);if(shape.isCCW()){this.stateManager.frontFace(gl.CCW);}else{this.stateManager.frontFace(gl.CW);}}else{this.stateManager.disable(gl.CULL_FACE);}\nfor(var q=0,q_n=s_gl.positions.length;q<q_n;q++){var q6=6*q;var v,v_n,offset;if(s_gl.externalGeometry!=0){var mesh=shape.meshes[q];mesh.bindVertexAttribPointer(gl,sp);mesh.render(gl);}else if(!(sp.position!==undefined&&s_gl.buffers[q6+x3dom.BUFFER_IDX.POSITION]&&s_gl.indexes[q]))\ncontinue;if(s_gl.buffers[q6+x3dom.BUFFER_IDX.INDEX]){gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER,s_gl.buffers[q6+x3dom.BUFFER_IDX.INDEX]);}\nthis.setVertexAttribPointerPosition(gl,shape,q6,q);this.setVertexAttribPointerNormal(gl,shape,q6,q);if(s_gl.binaryGeometry>0||s_gl.popGeometry>0){for(v=0,offset=0,v_n=s_geo._vf.vertexCount.length;v<v_n;v++){this.drawElements(gl,s_gl.primType[v],s_geo._vf.vertexCount[v],s_gl.indexType,x3dom.Utils.getByteAwareOffset(offset,s_gl.indexType,gl));offset+=s_geo._vf.vertexCount[v];}}else if(s_gl.binaryGeometry<0||s_gl.popGeometry<0||s_gl.imageGeometry){for(v=0,offset=0,v_n=s_geo._vf.vertexCount.length;v<v_n;v++){this.drawArrays(gl,s_gl.primType[v],offset,s_geo._vf.vertexCount[v]);offset+=s_geo._vf.vertexCount[v];}}else if(indicesReady&&(s_gl.bufferGeometry>0)){this.drawElements(gl,s_gl.primType[0],s_geo._vf.vertexCount[0],s_gl.indexType,shape._indexOffset);}else if(s_gl.bufferGeometry<0){this.drawArrays(gl,s_gl.primType[0],0,s_geo._vf.vertexCount[0]);}else if(s_geo.hasIndexOffset()){var indOff=shape.tessellationProperties();for(v=0,v_n=indOff.length;v<v_n;v++){this.drawElements(gl,s_gl.primType,indOff[v].count,s_gl.indexType,indOff[v].offset*x3dom.Utils.getOffsetMultiplier(s_gl.indexType,gl));}}else if(s_gl.indexes[q].length==0){this.drawArrays(gl,s_gl.primType,0,s_gl.positions[q].length/3);}else{this.drawElements(gl,s_gl.primType,s_gl.indexes[q].length,s_gl.indexType,0);}\ngl.disableVertexAttribArray(sp.position);if(sp.normal!==undefined){gl.disableVertexAttribArray(sp.normal);}}}};Context.prototype.shutdown=function(viewarea){var gl=this.ctx3d;var scene=viewarea._scene;if(gl==null||!scene){return;}\nvar bgnd=scene.getBackground();if(bgnd._webgl.position!==undefined){gl.deleteBuffer(bgnd._webgl.buffers[x3dom.BUFFER_IDX.INDEX]);gl.deleteBuffer(bgnd._webgl.buffers[x3dom.BUFFER_IDX.POSITION]);}\nvar fgnd=scene._fgnd;if(fgnd._webgl.position!==undefined){gl.deleteBuffer(fgnd._webgl.buffers[x3dom.BUFFER_IDX.INDEX]);gl.deleteBuffer(fgnd._webgl.buffers[x3dom.BUFFER_IDX.POSITION]);}\nvar n=scene.drawableCollection?scene.drawableCollection.length:0;for(var i=0;i<n;i++){var shape=scene.drawableCollection.get(i).shape;if(shape._cleanupGLObjects)\nshape._cleanupGLObjects(true);}\nthis.cache.Release(gl);};Context.prototype.renderShadows=function(gl,viewarea,shadowedLights,wctolc,lMatrices,mat_view,mat_proj,mat_scene){var scene=viewarea._scene;var texLimit=x3dom.caps.MAX_TEXTURE_IMAGE_UNITS;if(texLimit<7)\nreturn;var texUnits=1;var renderSplit=[0];var shadowMaps,numShadowMaps;var i,j,k;for(i=0;i<shadowedLights.length;i++){var filterSize=shadowedLights[i]._vf.shadowFilterSize;shadowMaps=scene._webgl.fboShadow[i];numShadowMaps=shadowMaps.length;for(j=0;j<numShadowMaps;j++){this.blurTex(gl,scene,shadowMaps[j],filterSize);}\ntexUnits+=6;if(texUnits>texLimit){renderSplit[renderSplit.length]=i;texUnits=7;}}\nrenderSplit[renderSplit.length]=shadowedLights.length;var n=renderSplit.length-1;var mat_proj_inv=mat_proj.inverse();var mat_scene_inv=mat_scene.inverse();this.stateManager.enable(gl.BLEND);this.stateManager.blendFunc(gl.DST_COLOR,gl.ZERO);for(var s=0;s<n;s++){var startIndex=renderSplit[s];var endIndex=renderSplit[s+1];var currentLights=[];for(k=startIndex;k<endIndex;k++)\ncurrentLights[currentLights.length]=shadowedLights[k];var sp=this.cache.getShadowRenderingShader(gl,currentLights);this.stateManager.useProgram(sp);gl.bindBuffer(gl.ARRAY_BUFFER,scene._webgl.ppBuffer);gl.vertexAttribPointer(sp.position,2,gl.FLOAT,false,0,0);gl.enableVertexAttribArray(sp.position);sp.sceneMap=0;gl.activeTexture(gl.TEXTURE0);gl.bindTexture(gl.TEXTURE_2D,scene._webgl.fboScene.tex);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.LINEAR);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.LINEAR);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE);sp.inverseProj=mat_proj_inv.toGL();sp.inverseViewProj=mat_scene_inv.toGL();var mat_light;var lightMatrix;var shadowIndex=0;for(var p=0,pn=currentLights.length;p<pn;p++){lightMatrix=lMatrices[p+startIndex];mat_light=wctolc[p+startIndex];shadowMaps=scene._webgl.fboShadow[p+startIndex];numShadowMaps=mat_light.length;for(i=0;i<numShadowMaps;i++){gl.activeTexture(gl.TEXTURE1+shadowIndex);gl.bindTexture(gl.TEXTURE_2D,shadowMaps[i].tex);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.LINEAR);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.LINEAR);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE);sp['light'+p+'_'+i+'_ShadowMap']=shadowIndex+1;sp['light'+p+'_'+i+'_Matrix']=mat_light[i].toGL();shadowIndex++;}\nsp['light'+p+'_ViewMatrix']=lightMatrix.toGL();if(!x3dom.isa(currentLights[p],x3dom.nodeTypes.PointLight)){for(j=0;j<numShadowMaps;j++){var numCascades=Math.max(1,Math.min(currentLights[p]._vf.shadowCascades,6));var splitFactor=Math.max(0,Math.min(currentLights[p]._vf.shadowSplitFactor,1));var splitOffset=Math.max(0,Math.min(currentLights[p]._vf.shadowSplitOffset,1));var splitDepths=viewarea.getShadowSplitDepths(numCascades,splitFactor,splitOffset,false,mat_proj);sp['light'+p+'_'+j+'_Split']=splitDepths[j+1];}}\nvar light_transform=mat_view.mult(currentLights[p].getCurrentTransform());if(x3dom.isa(currentLights[p],x3dom.nodeTypes.DirectionalLight)){sp['light'+p+'_Type']=0.0;sp['light'+p+'_On']=(currentLights[p]._vf.on)?1.0:0.0;sp['light'+p+'_Direction']=light_transform.multMatrixVec(currentLights[p]._vf.direction).toGL();sp['light'+p+'_Attenuation']=[1.0,1.0,1.0];sp['light'+p+'_Location']=[1.0,1.0,1.0];sp['light'+p+'_Radius']=0.0;sp['light'+p+'_BeamWidth']=0.0;sp['light'+p+'_CutOffAngle']=0.0;sp['light'+p+'_ShadowIntensity']=currentLights[p]._vf.shadowIntensity;sp['light'+p+'_ShadowCascades']=currentLights[p]._vf.shadowCascades;sp['light'+p+'_ShadowOffset']=Math.max(0.0,Math.min(1.0,currentLights[p]._vf.shadowOffset));}else if(x3dom.isa(currentLights[p],x3dom.nodeTypes.PointLight)){sp['light'+p+'_Type']=1.0;sp['light'+p+'_On']=(currentLights[p]._vf.on)?1.0:0.0;sp['light'+p+'_Direction']=[1.0,1.0,1.0];sp['light'+p+'_Attenuation']=currentLights[p]._vf.attenuation.toGL();sp['light'+p+'_Location']=light_transform.multMatrixPnt(currentLights[p]._vf.location).toGL();sp['light'+p+'_Radius']=currentLights[p]._vf.radius;sp['light'+p+'_BeamWidth']=0.0;sp['light'+p+'_CutOffAngle']=0.0;sp['light'+p+'_ShadowIntensity']=currentLights[p]._vf.shadowIntensity;sp['light'+p+'_ShadowOffset']=Math.max(0.0,Math.min(1.0,currentLights[p]._vf.shadowOffset));}else if(x3dom.isa(currentLights[p],x3dom.nodeTypes.SpotLight)){sp['light'+p+'_Type']=2.0;sp['light'+p+'_On']=(currentLights[p]._vf.on)?1.0:0.0;sp['light'+p+'_Direction']=light_transform.multMatrixVec(currentLights[p]._vf.direction).toGL();sp['light'+p+'_Attenuation']=currentLights[p]._vf.attenuation.toGL();sp['light'+p+'_Location']=light_transform.multMatrixPnt(currentLights[p]._vf.location).toGL();sp['light'+p+'_Radius']=currentLights[p]._vf.radius;sp['light'+p+'_BeamWidth']=currentLights[p]._vf.beamWidth;sp['light'+p+'_CutOffAngle']=currentLights[p]._vf.cutOffAngle;sp['light'+p+'_ShadowIntensity']=currentLights[p]._vf.shadowIntensity;sp['light'+p+'_ShadowCascades']=currentLights[p]._vf.shadowCascades;sp['light'+p+'_ShadowOffset']=Math.max(0.0,Math.min(1.0,currentLights[p]._vf.shadowOffset));}}\ngl.drawArrays(gl.TRIANGLES,0,6);var nk=shadowIndex+1;for(k=0;k<nk;k++){gl.activeTexture(gl.TEXTURE0+k);gl.bindTexture(gl.TEXTURE_2D,null);}\ngl.disableVertexAttribArray(sp.position);}\nthis.stateManager.blendFunc(gl.SRC_ALPHA,gl.ONE_MINUS_SRC_ALPHA);};Context.prototype.blurTex=function(gl,scene,targetFbo,filterSize){if(filterSize<=0){return;}else if(filterSize<5){filterSize=3;}else if(filterSize<7){filterSize=5;}else{filterSize=7;}\nvar width=targetFbo.width;var height=targetFbo.height;var fboBlur=null;for(var i=0,n=scene._webgl.fboBlur.length;i<n;i++)\nif(height==scene._webgl.fboBlur[i].height){fboBlur=scene._webgl.fboBlur[i];break;}\nthis.stateManager.bindFramebuffer(gl.FRAMEBUFFER,fboBlur.fbo);this.stateManager.viewport(0,0,width,height);this.stateManager.enable(gl.BLEND);this.stateManager.blendFunc(gl.ONE,gl.ZERO);this.stateManager.disable(gl.CULL_FACE);this.stateManager.disable(gl.DEPTH_TEST);gl.clearColor(1.0,1.0,1.0,0.0);gl.clearDepth(1.0);gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT);var sp=this.cache.getShader(gl,x3dom.shader.BLUR);this.stateManager.useProgram(sp);gl.bindBuffer(gl.ARRAY_BUFFER,scene._webgl.ppBuffer);gl.vertexAttribPointer(sp.position,2,gl.FLOAT,false,0,0);gl.enableVertexAttribArray(sp.position);sp.pixelSizeHor=1.0/width;sp.pixelSizeVert=1.0/height;sp.filterSize=filterSize;sp.horizontal=true;sp.texture=0;gl.activeTexture(gl.TEXTURE0);gl.bindTexture(gl.TEXTURE_2D,targetFbo.tex);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.LINEAR);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.LINEAR);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE);gl.drawArrays(gl.TRIANGLES,0,6);this.stateManager.bindFramebuffer(gl.FRAMEBUFFER,targetFbo.fbo);gl.clearColor(1.0,1.0,1.0,0.0);gl.clearDepth(1.0);gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT);sp.horizontal=false;gl.activeTexture(gl.TEXTURE0);gl.bindTexture(gl.TEXTURE_2D,fboBlur.tex);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.LINEAR);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.LINEAR);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE);gl.drawArrays(gl.TRIANGLES,0,6);gl.activeTexture(gl.TEXTURE0);gl.bindTexture(gl.TEXTURE_2D,null);gl.disableVertexAttribArray(sp.position);gl.flush();this.stateManager.blendFunc(gl.SRC_ALPHA,gl.ONE_MINUS_SRC_ALPHA);this.stateManager.bindFramebuffer(gl.FRAMEBUFFER,null);this.stateManager.viewport(0,0,this.canvas.width,this.canvas.height);};Context.prototype.drawElements=function(gl,mode,count,type,offset,instanceCount)\n{instanceCount=(instanceCount==undefined)?1:instanceCount;instanceCount*=this.VRMode;if(x3dom.caps.WEBGL_VERSION==2)\n{gl.drawElementsInstanced(mode,count,type,offset,instanceCount);}\nelse if(x3dom.caps.INSTANCED_ARRAYS)\n{var instancedArrays=this.ctx3d.getExtension(\"ANGLE_instanced_arrays\");instancedArrays.drawElementsInstancedANGLE(mode,count,type,offset,instanceCount);}\nelse\n{gl.drawElements(mode,count,type,offset);}};Context.prototype.drawArrays=function(gl,mode,first,count,instanceCount)\n{instanceCount=(instanceCount==undefined)?1:instanceCount;instanceCount*=this.VRMode;if(x3dom.caps.WEBGL_VERSION==2)\n{gl.drawArraysInstanced(mode,first,count,instanceCount);}\nelse if(x3dom.caps.INSTANCED_ARRAYS)\n{var instancedArrays=this.ctx3d.getExtension(\"ANGLE_instanced_arrays\");instancedArrays.drawArraysInstancedANGLE(mode,first,count,instanceCount);}\nelse\n{gl.drawArrays(mode,first,count);}};Context.prototype.setVertexAttribEyeIdx=function(gl,sp)\n{if(x3dom.caps.WEBGL_VERSION==2&&sp.eyeIdx!=undefined)\n{if(!this.eyeIdxBuffer)\n{this.eyeIdxBuffer=gl.createBuffer();gl.bindBuffer(gl.ARRAY_BUFFER,this.eyeIdxBuffer);gl.bufferData(gl.ARRAY_BUFFER,new Float32Array([-1.0,1.0]),gl.STATIC_DRAW);gl.vertexAttribPointer(sp.eyeIdx,1,gl.FLOAT,false,0,0);gl.enableVertexAttribArray(sp.eyeIdx);gl.vertexAttribDivisor(sp.eyeIdx,1);}\nelse\n{gl.bindBuffer(gl.ARRAY_BUFFER,this.eyeIdxBuffer);gl.vertexAttribPointer(sp.eyeIdx,1,gl.FLOAT,false,0,0);gl.enableVertexAttribArray(sp.eyeIdx);gl.vertexAttribDivisor(sp.eyeIdx,1);}}\nelse if(x3dom.caps.INSTANCED_ARRAYS&&sp.eyeIdx!=undefined)\n{var instancedArrays=this.ctx3d.getExtension(\"ANGLE_instanced_arrays\");if(!this.eyeIdxBuffer)\n{this.eyeIdxBuffer=gl.createBuffer();gl.bindBuffer(gl.ARRAY_BUFFER,this.eyeIdxBuffer);gl.bufferData(gl.ARRAY_BUFFER,new Float32Array([-1.0,1.0]),gl.STATIC_DRAW);gl.vertexAttribPointer(sp.eyeIdx,1,gl.FLOAT,false,0,0);gl.enableVertexAttribArray(sp.eyeIdx);instancedArrays.vertexAttribDivisorANGLE(sp.eyeIdx,1);}\nelse\n{gl.bindBuffer(gl.ARRAY_BUFFER,this.eyeIdxBuffer);gl.vertexAttribPointer(sp.eyeIdx,1,gl.FLOAT,false,0,0);gl.enableVertexAttribArray(sp.eyeIdx);instancedArrays.vertexAttribDivisorANGLE(sp.eyeIdx,1);}}};Context.prototype.disableVertexAttribEyeIdx=function(gl,sp)\n{if(x3dom.caps.WEBGL_VERSION==2&&sp.eyeIdx!=undefined)\n{gl.disableVertexAttribArray(sp.eyeIdx);gl.vertexAttribDivisor(sp.eyeIdx,0);}\nelse if(x3dom.caps.INSTANCED_ARRAYS&&sp.eyeIdx!=undefined)\n{var instancedArrays=this.ctx3d.getExtension(\"ANGLE_instanced_arrays\");gl.disableVertexAttribArray(sp.eyeIdx);instancedArrays.vertexAttribDivisorANGLE(sp.eyeIdx,0);}};Context.prototype.setVertexAttribPointerPosition=function(gl,shape,q6,q)\n{var sp=shape._webgl.shader;if(sp.position!==undefined&&shape._webgl.buffers[q6+x3dom.BUFFER_IDX.POSITION]){var s_geo=shape._cf.geometry.node;gl.bindBuffer(gl.ARRAY_BUFFER,shape._webgl.buffers[q6+x3dom.BUFFER_IDX.POSITION]);gl.vertexAttribPointer(sp.position,s_geo._mesh._numPosComponents,shape._webgl.coordType,shape._webgl.coordNormalized,shape._coordStrideOffset[0],shape._coordStrideOffset[1]);gl.enableVertexAttribArray(sp.position);}};Context.prototype.setVertexAttribPointerNormal=function(gl,shape,q6,q)\n{var sp=shape._webgl.shader;if(sp.normal!==undefined&&shape._webgl.buffers[q6+x3dom.BUFFER_IDX.NORMAL]){var s_geo=shape._cf.geometry.node;gl.bindBuffer(gl.ARRAY_BUFFER,shape._webgl.buffers[q6+x3dom.BUFFER_IDX.NORMAL]);gl.vertexAttribPointer(sp.normal,s_geo._mesh._numNormComponents,shape._webgl.normalType,shape._webgl.normalNormalized,shape._normalStrideOffset[0],shape._normalStrideOffset[1]);gl.enableVertexAttribArray(sp.normal);}};Context.prototype.setVertexAttribPointerTexCoord=function(gl,shape,q6,q){var sp=shape._webgl.shader;if(sp.texcoord!==undefined&&shape._webgl.buffers[q6+x3dom.BUFFER_IDX.TEXCOORD]){var s_geo=shape._cf.geometry.node;gl.bindBuffer(gl.ARRAY_BUFFER,shape._webgl.buffers[q6+x3dom.BUFFER_IDX.TEXCOORD]);gl.vertexAttribPointer(sp.texcoord,s_geo._mesh._numTexComponents,shape._webgl.texCoordType,shape._webgl.texCoordNormalized,shape._texCoordStrideOffset[0],shape._texCoordStrideOffset[1]);gl.enableVertexAttribArray(sp.texcoord);}};Context.prototype.setVertexAttribPointerTexCoord2=function(gl,shape,q6,q){var sp=shape._webgl.shader;if(sp.texcoord2!==undefined&&shape._webgl.buffers[q6+x3dom.BUFFER_IDX.TEXCOORD_1]){var s_geo=shape._cf.geometry.node;gl.bindBuffer(gl.ARRAY_BUFFER,shape._webgl.buffers[q6+x3dom.BUFFER_IDX.TEXCOORD_1]);gl.vertexAttribPointer(sp.texcoord2,s_geo._mesh._numTex2Components,shape._webgl.texCoord2Type,shape._webgl.texCoord2Normalized,shape._texCoord2StrideOffset[0],shape._texCoord2StrideOffset[1]);gl.enableVertexAttribArray(sp.texcoord2);}};Context.prototype.setVertexAttribPointerColor=function(gl,shape,q6,q){var sp=shape._webgl.shader;if(sp.color!==undefined&&shape._webgl.buffers[q6+x3dom.BUFFER_IDX.COLOR]){var s_geo=shape._cf.geometry.node;gl.bindBuffer(gl.ARRAY_BUFFER,shape._webgl.buffers[q6+x3dom.BUFFER_IDX.COLOR]);gl.vertexAttribPointer(sp.color,s_geo._mesh._numColComponents,shape._webgl.colorType,shape._webgl.colorNormalized,shape._colorStrideOffset[0],shape._colorStrideOffset[1]);gl.enableVertexAttribArray(sp.color);}};Context.prototype.setVertexAttribPointerTangent=function(gl,shape,q6,q)\n{var sp=shape._webgl.shader;if(sp.tangent!==undefined&&shape._webgl.buffers[q6+x3dom.BUFFER_IDX.TANGENT])\n{var s_geo=shape._cf.geometry.node;gl.bindBuffer(gl.ARRAY_BUFFER,shape._webgl.buffers[q6+x3dom.BUFFER_IDX.TANGENT]);gl.vertexAttribPointer(sp.tangent,s_geo._mesh._numTangentComponents,shape._webgl.tangentType,shape._webgl.tangentNormalized,shape._tangentStrideOffset[0],shape._tangentStrideOffset[1]);gl.enableVertexAttribArray(sp.tangent);}};Context.prototype.setVertexAttribPointerBinormal=function(gl,shape,q6,q)\n{var sp=shape._webgl.shader;if(sp.binormal!==undefined&&shape._webgl.buffers[q6+x3dom.BUFFER_IDX.BITANGENT])\n{var s_geo=shape._cf.geometry.node;gl.bindBuffer(gl.ARRAY_BUFFER,shape._webgl.buffers[q6+x3dom.BUFFER_IDX.BITANGENT]);gl.vertexAttribPointer(sp.binormal,s_geo._mesh._numBinormalComponents,shape._webgl.binormalType,shape._webgl.binormalNormalized,shape._binormalStrideOffset[0],shape._binormalStrideOffset[1]);gl.enableVertexAttribArray(sp.binormal);}};Context.prototype.setTonemappingOperator=function(viewarea,sp)\n{var scene=viewarea._scene;var env=scene.getEnvironment();switch(env._vf.tonemapping)\n{case\"none\":sp.tonemappingOperator=0.0;break;case\"reinhard\":sp.tonemappingOperator=1.0;break;case\"uncharted\":sp.tonemappingOperator=2.0;break;case\"filmic\":sp.tonemappingOperator=3.0;break;default:sp.tonemappingOperator=0.0;break;}}\nreturn setupContext;})();x3dom.NodeNameSpace=function(name,document){this.name=name;this.doc=document;this.baseURL=\"\";this.defMap={};this.parent=null;this.childSpaces=[];};x3dom.NodeNameSpace.prototype.addNode=function(node,name){this.defMap[name]=node;node._nameSpace=this;};x3dom.NodeNameSpace.prototype.removeNode=function(name){var node=name?this.defMap[name]:null;if(node){delete this.defMap[name];node._nameSpace=null;}};x3dom.NodeNameSpace.prototype.getNamedNode=function(name){return this.defMap[name];};x3dom.NodeNameSpace.prototype.getNamedElement=function(name){var node=this.defMap[name];return(node?node._xmlNode:null);};x3dom.NodeNameSpace.prototype.addSpace=function(space){this.childSpaces.push(space);space.parent=this;};x3dom.NodeNameSpace.prototype.removeSpace=function(space){space.parent=null;for(var it=0;it<this.childSpaces.length;it++){if(this.childSpaces[it]==space){this.childSpaces.splice(it,1);}}};x3dom.NodeNameSpace.prototype.setBaseURL=function(url){var i=url.lastIndexOf(\"/\");this.baseURL=(i>=0)?url.substr(0,i+1):\"\";x3dom.debug.logInfo(\"setBaseURL: \"+this.baseURL);};x3dom.NodeNameSpace.prototype.getURL=function(url){if(url===undefined||!url.length){return\"\";}else{return((url[0]==='/')||(url.indexOf(\":\")>=0))?url:(this.baseURL+url);}};x3dom.hasElementAttribute=function(attrName){var ok=this.__hasAttribute(attrName);if(!ok&&attrName){ok=this.__hasAttribute(attrName.toLowerCase());}\nreturn ok;};x3dom.getElementAttribute=function(attrName){var attrib=this.__getAttribute(attrName);if(!attrib&&attrib!=\"\"&&attrName){attrib=this.__getAttribute(attrName.toLowerCase());}\nif(attrib||!this._x3domNode){return attrib;}else{return this._x3domNode._vf[attrName];}};x3dom.setElementAttribute=function(attrName,newVal){this.__setAttribute(attrName,newVal);var x3dNode=this._x3domNode;if(x3dNode){x3dNode.updateField(attrName,newVal);x3dNode._nameSpace.doc.needRender=true;}};x3dom.getFieldValue=function(fieldName){var x3dNode=this._x3domNode;if(x3dNode&&(x3dNode._vf[fieldName]!==undefined)){var fieldValue=x3dNode._vf[fieldName];if(fieldValue instanceof Object&&'copy'in fieldValue){return x3dNode._vf[fieldName].copy();}else{return x3dNode._vf[fieldName];}}\nreturn null;};x3dom.setFieldValue=function(fieldName,fieldvalue){var x3dNode=this._x3domNode;if(x3dNode&&(x3dNode._vf[fieldName]!==undefined)){if(fieldvalue instanceof Object&&'copy'in fieldvalue){x3dNode._vf[fieldName]=fieldvalue.copy();}else{x3dNode._vf[fieldName]=fieldvalue;}\nx3dNode.fieldChanged(fieldName);x3dNode._nameSpace.doc.needRender=true;}};x3dom.requestFieldRef=function(fieldName){var x3dNode=this._x3domNode;if(x3dNode&&x3dNode._vf[fieldName]){return x3dNode._vf[fieldName];}\nreturn null;};x3dom.releaseFieldRef=function(fieldName){var x3dNode=this._x3domNode;if(x3dNode&&x3dNode._vf[fieldName]){x3dNode.fieldChanged(fieldName);x3dNode._nameSpace.doc.needRender=true;}};x3dom.NodeNameSpace.prototype.setupTree=function(domNode,parent){var n=null;parent=parent||null;if(x3dom.isX3DElement(domNode)){if(domNode._x3domNode){x3dom.debug.logWarning('Tree is already initialized');return null;}\nif((domNode.tagName!==undefined)&&(!domNode.__addEventListener)&&(!domNode.__removeEventListener)){domNode.__addEventListener=domNode.addEventListener;domNode.addEventListener=function(type,func,phase){if(!this._x3domNode._listeners[type]){this._x3domNode._listeners[type]=[];}\nthis._x3domNode._listeners[type].push(func);this.__addEventListener(type,func,phase);};domNode.__removeEventListener=domNode.removeEventListener;domNode.removeEventListener=function(type,func,phase){var list=this._x3domNode._listeners[type];if(list){for(var it=0;it<list.length;it++){if(list[it]==func){list.splice(it,1);}}}\nthis.__removeEventListener(type,func,phase);};}\nif(domNode.hasAttribute('USE')||domNode.hasAttribute('use')){if(!domNode.hasAttribute('USE')){domNode.setAttribute('USE',domNode.getAttribute('use'));}\nn=this.defMap[domNode.getAttribute('USE')];if(!n){var nsName=domNode.getAttribute('USE').split('__');if(nsName.length>=2){var otherNS=this;while(otherNS){if(otherNS.name==nsName[0])\nn=otherNS.defMap[nsName[1]];if(n){otherNS=null;}else{otherNS=otherNS.parent;}}\nif(!n){n=null;x3dom.debug.logWarning('Could not USE: '+domNode.getAttribute('USE'));}}}\nif(n){domNode._x3domNode=n;}\nreturn n;}else{if(domNode.localName.toLowerCase()==='route'){var route=domNode;var fnAtt=route.getAttribute('fromNode')||route.getAttribute('fromnode');var tnAtt=route.getAttribute('toNode')||route.getAttribute('tonode');var fromNode=this.defMap[fnAtt];var toNode=this.defMap[tnAtt];if(!(fromNode&&toNode)){x3dom.debug.logWarning(\"Broken route - can't find all DEFs for \"+fnAtt+\" -> \"+tnAtt);}else{fnAtt=route.getAttribute('fromField')||route.getAttribute('fromfield');tnAtt=route.getAttribute('toField')||route.getAttribute('tofield');fromNode.setupRoute(fnAtt,toNode,tnAtt);route._nodeNameSpace=this;}\nreturn null;}\ndomNode.requestFieldRef=x3dom.requestFieldRef;domNode.releaseFieldRef=x3dom.releaseFieldRef;domNode.getFieldValue=x3dom.getFieldValue;domNode.setFieldValue=x3dom.setFieldValue;var nodeType=x3dom.nodeTypesLC[domNode.localName.toLowerCase()];if(nodeType===undefined){x3dom.debug.logWarning(\"Unrecognised X3D element &lt;\"+domNode.localName+\"&gt;.\");}else{if((x3dom.userAgentFeature.supportsDOMAttrModified===false)&&(domNode instanceof Element)){if(domNode.setAttribute&&!domNode.__setAttribute){domNode.__setAttribute=domNode.setAttribute;domNode.setAttribute=x3dom.setElementAttribute;}\nif(domNode.getAttribute&&!domNode.__getAttribute){domNode.__getAttribute=domNode.getAttribute;domNode.getAttribute=x3dom.getElementAttribute;}\nif(domNode.hasAttribute&&!domNode.__hasAttribute){domNode.__hasAttribute=domNode.hasAttribute;domNode.hasAttribute=x3dom.hasElementAttribute;}}\nvar ctx={doc:this.doc,xmlNode:domNode,nameSpace:this};n=new nodeType(ctx);if(domNode.hasAttribute('DEF')){n._DEF=domNode.getAttribute('DEF');this.defMap[n._DEF]=n;}else{if(domNode.hasAttribute('id')){n._DEF=domNode.getAttribute('id');this.defMap[n._DEF]=n;}}\nif(domNode.highlight===undefined){domNode.highlight=function(enable,colorStr){var color=x3dom.fields.SFColor.parse(colorStr);this._x3domNode.highlight(enable,color);this._x3domNode._nameSpace.doc.needRender=true;};}\nn._xmlNode=domNode;domNode._x3domNode=n;var that=this;Array.forEach(domNode.childNodes,function(childDomNode){var c=that.setupTree(childDomNode,n);if(c){n.addChild(c,childDomNode.getAttribute(\"containerField\"));}});n.nodeChanged();return n;}}}else if(domNode.localName){if(parent&&domNode.localName.toLowerCase()==\"x3dommetagroup\"){Array.forEach(domNode.childNodes,function(childDomNode){var c=this.setupTree(childDomNode,parent);if(c){parent.addChild(c,childDomNode.getAttribute(\"containerField\"));}}.bind(this));}else{x3dom.debug.logWarning(\"Unrecognised X3D element &lt;\"+domNode.localName+\"&gt;.\");n=null;}}\nreturn n;};x3dom.registerNodeType(\"X3DNode\",\"Core\",defineClass(null,function(ctx){this._xmlNode=null;this._DEF=null;this._nameSpace=(ctx&&ctx.nameSpace)?ctx.nameSpace:null;this._vf={};this._vfFieldTypes={};this._cf={};this._cfFieldTypes={};this._fieldWatchers={};this._routes={};this._listeners={};this._parentNodes=[];this._childNodes=[];this.addField_SFNode('metadata',x3dom.nodeTypes.X3DMetadataObject);},{type:function(){return this.constructor;},typeName:function(){return this.constructor._typeName;},addChild:function(node,containerFieldName){if(node){var field=null;if(containerFieldName){field=this._cf[containerFieldName];}\nelse{for(var fieldName in this._cf){if(this._cf.hasOwnProperty(fieldName)){var testField=this._cf[fieldName];if(x3dom.isa(node,testField.type)){field=testField;break;}}}}\nif(field&&field.addLink(node)){node._parentNodes.push(this);this._childNodes.push(node);node.parentAdded(this);return true;}}\nreturn false;},removeChild:function(node){if(node){for(var fieldName in this._cf){if(this._cf.hasOwnProperty(fieldName)){var field=this._cf[fieldName];if(field.rmLink(node)){for(var i=node._parentNodes.length-1;i>=0;i--){if(node._parentNodes[i]===this){node._parentNodes.splice(i,1);node.parentRemoved(this);}}\nfor(var j=this._childNodes.length-1;j>=0;j--){if(this._childNodes[j]===node){node.onRemove();this._childNodes.splice(j,1);return true;}}}}}}\nreturn false;},onRemove:function(){},parentAdded:function(parent){},parentRemoved:function(parent){for(var i=0,n=this._childNodes.length;i<n;i++){if(this._childNodes[i]){this._childNodes[i].parentRemoved(this);}}},getCurrentTransform:function(){if(this._parentNodes.length>=1){return this.transformMatrix(this._parentNodes[0].getCurrentTransform());}\nelse{return x3dom.fields.SFMatrix4f.identity();}},transformMatrix:function(transform){return transform;},getVolume:function(){return null;},invalidateVolume:function(){},invalidateCache:function(){},volumeValid:function(){return false;},collectDrawableObjects:function(transform,drawableCollection,singlePath,invalidateCache,planeMask,clipPlanes){},highlight:function(enable,color)\n{if(this._vf.hasOwnProperty(\"diffuseColor\"))\n{if(enable){if(this._actDiffuseColor===undefined){this._actDiffuseColor=new x3dom.fields.SFColor();this._highlightOn=false;}\nif(!this._highlightOn){this._actDiffuseColor.setValues(this._vf.diffuseColor);this._highlightOn=true;}\nthis._vf.diffuseColor.setValues(color);}\nelse{if(this._actDiffuseColor!==undefined){this._vf.diffuseColor.setValues(this._actDiffuseColor);this._highlightOn=false;delete this._actDiffuseColor;}}}\nfor(var i=0,n=this._childNodes.length;i<n;i++)\n{if(this._childNodes[i])\nthis._childNodes[i].highlight(enable,color);}},findX3DDoc:function(){return this._nameSpace.doc;},doIntersect:function(line){var isect=false;for(var i=0;i<this._childNodes.length;i++){if(this._childNodes[i]){isect=this._childNodes[i].doIntersect(line)||isect;}}\nreturn isect;},postMessage:function(field,msg){this._vf[field]=msg;var listeners=this._fieldWatchers[field];var that=this;if(listeners){Array.forEach(listeners,function(l){l.call(that,msg);});}\nvar eventObject={target:that._xmlNode,type:\"outputchange\",fieldName:field,value:msg};this.callEvtHandler(\"onoutputchange\",eventObject);},updateField:function(field,msg){var f=this._vf[field];if(f===undefined){for(var key in this._vf){if(key.toLowerCase()==field){field=key;f=this._vf[field];break;}}\nvar pre=\"set_\";if(f===undefined&&field.indexOf(pre)==0){var fieldName=field.substr(pre.length,field.length-1);if(this._vf[fieldName]!==undefined){field=fieldName;f=this._vf[field];}}\nif(f===undefined){f=null;this._vf[field]=f;}}\nif(f!==null){try{this._vf[field].setValueByStr(msg);}\ncatch(exc1){try{switch((typeof(this._vf[field])).toString()){case\"number\":if(typeof(msg)==\"number\")\nthis._vf[field]=msg;else\nthis._vf[field]=+msg;break;case\"boolean\":if(typeof(msg)==\"boolean\")\nthis._vf[field]=msg;else\nthis._vf[field]=(msg.toLowerCase()==\"true\");break;case\"string\":this._vf[field]=msg;break;}}\ncatch(exc2){x3dom.debug.logError(\"updateField: setValueByStr() NYI for \"+typeof(f));}}\nthis.fieldChanged(field);}},setupRoute:function(fromField,toNode,toField){var pos;var fieldName;var pre=\"set_\",post=\"_changed\";if(!this._vf[fromField]){pos=fromField.indexOf(pre);if(pos===0){fieldName=fromField.substr(pre.length,fromField.length-1);if(this._vf[fieldName]!==undefined){fromField=fieldName;}}else{pos=fromField.indexOf(post);if(pos>0){fieldName=fromField.substr(0,fromField.length-post.length);if(this._vf[fieldName]!==undefined){fromField=fieldName;}}}}\nif(!toNode._vf[toField]){pos=toField.indexOf(pre);if(pos===0){fieldName=toField.substr(pre.length,toField.length-1);if(toNode._vf[fieldName]!==undefined){toField=fieldName;}}\nelse{pos=toField.indexOf(post);if(pos>0){fieldName=toField.substr(0,toField.length-post.length);if(toNode._vf[fieldName]!==undefined){toField=fieldName;}}}}\nvar where=this._DEF+\"&\"+fromField+\"&\"+toNode._DEF+\"&\"+toField;if(!this._routes[where]){if(!this._fieldWatchers[fromField]){this._fieldWatchers[fromField]=[];}\nthis._fieldWatchers[fromField].push(function(msg){toNode.postMessage(toField,msg);});if(!toNode._fieldWatchers[toField]){toNode._fieldWatchers[toField]=[];}\ntoNode._fieldWatchers[toField].push(function(msg){toNode._vf[toField]=msg;toNode.fieldChanged(toField);});this._routes[where]={from:this._fieldWatchers[fromField].length-1,to:toNode._fieldWatchers[toField].length-1};}},removeRoute:function(fromField,toNode,toField){var pos;var fieldName;var pre=\"set_\",post=\"_changed\";if(!this._vf[fromField]){pos=fromField.indexOf(pre);if(pos===0){fieldName=fromField.substr(pre.length,fromField.length-1);if(this._vf[fieldName]!==undefined){fromField=fieldName;}}else{pos=fromField.indexOf(post);if(pos>0){fieldName=fromField.substr(0,fromField.length-post.length);if(this._vf[fieldName]!==undefined){fromField=fieldName;}}}}\nif(!toNode._vf[toField]){pos=toField.indexOf(pre);if(pos===0){fieldName=toField.substr(pre.length,toField.length-1);if(toNode._vf[fieldName]!==undefined){toField=fieldName;}}\nelse{pos=toField.indexOf(post);if(pos>0){fieldName=toField.substr(0,toField.length-post.length);if(toNode._vf[fieldName]!==undefined){toField=fieldName;}}}}\nvar where=this._DEF+\"&\"+fromField+\"&\"+toNode._DEF+\"&\"+toField;if(this._routes[where]){this._fieldWatchers[fromField].splice(this._routes[where].from,1);toNode._fieldWatchers[toField].splice(this._routes[where].to,1);delete this._routes[where];}},fieldChanged:function(fieldName){},nodeChanged:function(){},callEvtHandler:function(eventType,event){var node=this;if(!node._xmlNode){return event.cancelBubble;}\nif(!node._xmlNode.getAttribute(eventType)&&!node._xmlNode[eventType]&&!node._listeners[event.type])\n{return event.cancelBubble;}\ntry{var attrib=node._xmlNode[eventType];event.target=node._xmlNode;if(typeof(attrib)===\"function\"){attrib.call(node._xmlNode,event);}\nelse{var funcStr=node._xmlNode.getAttribute(eventType);var func=new Function('event',funcStr);func.call(node._xmlNode,event);}\nvar list=node._listeners[event.type];if(list){for(var it=0;it<list.length;it++){list[it].call(node._xmlNode,event);}}}\ncatch(ex){x3dom.debug.logException(ex);}\nreturn event.cancelBubble;},hasEventListener:function(eventType)\n{return(this._xmlNode&&(this._xmlNode[\"on\"+eventType]||this._xmlNode.hasAttribute(\"on\"+eventType)||this._listeners[eventType]));},initSetter:function(xmlNode,name){if(!xmlNode||!name)\nreturn;var nameLC=name.toLowerCase();if(xmlNode.__defineSetter__&&xmlNode.__defineGetter__){xmlNode.__defineSetter__(name,function(value){xmlNode.setAttribute(name,value);});xmlNode.__defineGetter__(name,function(){return xmlNode.getAttribute(name);});if(nameLC!=name){xmlNode.__defineSetter__(nameLC,function(value){xmlNode.setAttribute(name,value);});xmlNode.__defineGetter__(nameLC,function(){return xmlNode.getAttribute(name);});}}\nelse{Object.defineProperty(xmlNode,name,{set:function(value){xmlNode.setAttribute(name,value);},get:function(){return xmlNode.getAttribute(name);},configurable:true,enumerable:true});}\nif(this._vf[name]&&!xmlNode.attributes[name]&&!xmlNode.attributes[name.toLowerCase()]){var str=\"\";try{if(this._vf[name].toGL)\nstr=this._vf[name].toGL().toString();else\nstr=this._vf[name].toString();}\ncatch(e){str=this._vf[name].toString();}\nif(!str){str=\"\";}\nxmlNode.setAttribute(name,str);}},addField_SFInt32:function(ctx,name,n){this._vf[name]=ctx&&ctx.xmlNode&&ctx.xmlNode.hasAttribute(name)?parseInt(ctx.xmlNode.getAttribute(name),10):n;if(ctx&&ctx.xmlNode){this.initSetter(ctx.xmlNode,name);}\nthis._vfFieldTypes[name]=\"SFInt32\";},addField_SFFloat:function(ctx,name,n){this._vf[name]=ctx&&ctx.xmlNode&&ctx.xmlNode.hasAttribute(name)?+ctx.xmlNode.getAttribute(name):n;if(ctx&&ctx.xmlNode){this.initSetter(ctx.xmlNode,name);}\nthis._vfFieldTypes[name]=\"SFFloat\";},addField_SFDouble:function(ctx,name,n){this._vf[name]=ctx&&ctx.xmlNode&&ctx.xmlNode.hasAttribute(name)?+ctx.xmlNode.getAttribute(name):n;if(ctx&&ctx.xmlNode){this.initSetter(ctx.xmlNode,name);}\nthis._vfFieldTypes[name]=\"SFDouble\";},addField_SFTime:function(ctx,name,n){this._vf[name]=ctx&&ctx.xmlNode&&ctx.xmlNode.hasAttribute(name)?+ctx.xmlNode.getAttribute(name):n;if(ctx&&ctx.xmlNode){this.initSetter(ctx.xmlNode,name);}\nthis._vfFieldTypes[name]=\"SFTime\";},addField_SFBool:function(ctx,name,n){this._vf[name]=ctx&&ctx.xmlNode&&ctx.xmlNode.hasAttribute(name)?ctx.xmlNode.getAttribute(name).toLowerCase()===\"true\":n;if(ctx&&ctx.xmlNode){this.initSetter(ctx.xmlNode,name);}\nthis._vfFieldTypes[name]=\"SFBool\";},addField_SFString:function(ctx,name,n){this._vf[name]=ctx&&ctx.xmlNode&&ctx.xmlNode.hasAttribute(name)?ctx.xmlNode.getAttribute(name):n;if(ctx&&ctx.xmlNode){this.initSetter(ctx.xmlNode,name);}\nthis._vfFieldTypes[name]=\"SFString\";},addField_SFColor:function(ctx,name,r,g,b){this._vf[name]=ctx&&ctx.xmlNode&&ctx.xmlNode.hasAttribute(name)?x3dom.fields.SFColor.parse(ctx.xmlNode.getAttribute(name)):new x3dom.fields.SFColor(r,g,b);if(ctx&&ctx.xmlNode){this.initSetter(ctx.xmlNode,name);}\nthis._vfFieldTypes[name]=\"SFColor\";},addField_SFColorRGBA:function(ctx,name,r,g,b,a){this._vf[name]=ctx&&ctx.xmlNode&&ctx.xmlNode.hasAttribute(name)?x3dom.fields.SFColorRGBA.parse(ctx.xmlNode.getAttribute(name)):new x3dom.fields.SFColorRGBA(r,g,b,a);if(ctx&&ctx.xmlNode){this.initSetter(ctx.xmlNode,name);}\nthis._vfFieldTypes[name]=\"SFColorRGBA\";},addField_SFVec2f:function(ctx,name,x,y){this._vf[name]=ctx&&ctx.xmlNode&&ctx.xmlNode.hasAttribute(name)?x3dom.fields.SFVec2f.parse(ctx.xmlNode.getAttribute(name)):new x3dom.fields.SFVec2f(x,y);if(ctx&&ctx.xmlNode){this.initSetter(ctx.xmlNode,name);}\nthis._vfFieldTypes[name]=\"SFVec2f\";},addField_SFVec3f:function(ctx,name,x,y,z){this._vf[name]=ctx&&ctx.xmlNode&&ctx.xmlNode.hasAttribute(name)?x3dom.fields.SFVec3f.parse(ctx.xmlNode.getAttribute(name)):new x3dom.fields.SFVec3f(x,y,z);if(ctx&&ctx.xmlNode){this.initSetter(ctx.xmlNode,name);}\nthis._vfFieldTypes[name]=\"SFVec3f\";},addField_SFVec4f:function(ctx,name,x,y,z,w){this._vf[name]=ctx&&ctx.xmlNode&&ctx.xmlNode.hasAttribute(name)?x3dom.fields.SFVec4f.parse(ctx.xmlNode.getAttribute(name)):new x3dom.fields.SFVec4f(x,y,z,w);if(ctx&&ctx.xmlNode){this.initSetter(ctx.xmlNode,name);}\nthis._vfFieldTypes[name]=\"SFVec4f\";},addField_SFVec3d:function(ctx,name,x,y,z){this.addField_SFVec3f(ctx,name,x,y,z);this._vfFieldTypes[name]=\"SFVec3d\";},addField_SFRotation:function(ctx,name,x,y,z,a){this._vf[name]=ctx&&ctx.xmlNode&&ctx.xmlNode.hasAttribute(name)?x3dom.fields.Quaternion.parseAxisAngle(ctx.xmlNode.getAttribute(name)):x3dom.fields.Quaternion.axisAngle(new x3dom.fields.SFVec3f(x,y,z),a);if(ctx&&ctx.xmlNode){this.initSetter(ctx.xmlNode,name);}\nthis._vfFieldTypes[name]=\"SFRotation\";},addField_SFMatrix4f:function(ctx,name,_00,_01,_02,_03,_10,_11,_12,_13,_20,_21,_22,_23,_30,_31,_32,_33){this._vf[name]=ctx&&ctx.xmlNode&&ctx.xmlNode.hasAttribute(name)?x3dom.fields.SFMatrix4f.parse(ctx.xmlNode.getAttribute(name)):new x3dom.fields.SFMatrix4f(_00,_01,_02,_03,_10,_11,_12,_13,_20,_21,_22,_23,_30,_31,_32,_33);if(ctx&&ctx.xmlNode){this.initSetter(ctx.xmlNode,name);}\nthis._vfFieldTypes[name]=\"SFMatrix4f\";},addField_SFImage:function(ctx,name,def){this._vf[name]=ctx&&ctx.xmlNode&&ctx.xmlNode.hasAttribute(name)?x3dom.fields.SFImage.parse(ctx.xmlNode.getAttribute(name)):new x3dom.fields.SFImage(def);if(ctx&&ctx.xmlNode){this.initSetter(ctx.xmlNode,name);}\nthis._vfFieldTypes[name]=\"SFImage\";},addField_MFString:function(ctx,name,def){this._vf[name]=ctx&&ctx.xmlNode&&ctx.xmlNode.hasAttribute(name)?x3dom.fields.MFString.parse(ctx.xmlNode.getAttribute(name)):new x3dom.fields.MFString(def);if(ctx&&ctx.xmlNode){this.initSetter(ctx.xmlNode,name);}\nthis._vfFieldTypes[name]=\"MFString\";},addField_MFBoolean:function(ctx,name,def){this._vf[name]=ctx&&ctx.xmlNode&&ctx.xmlNode.hasAttribute(name)?x3dom.fields.MFBoolean.parse(ctx.xmlNode.getAttribute(name)):new x3dom.fields.MFBoolean(def);if(ctx&&ctx.xmlNode){this.initSetter(ctx.xmlNode,name);}\nthis._vfFieldTypes[name]=\"MFBoolean\";},addField_MFInt32:function(ctx,name,def){this._vf[name]=ctx&&ctx.xmlNode&&ctx.xmlNode.hasAttribute(name)?x3dom.fields.MFInt32.parse(ctx.xmlNode.getAttribute(name)):new x3dom.fields.MFInt32(def);if(ctx&&ctx.xmlNode){this.initSetter(ctx.xmlNode,name);}\nthis._vfFieldTypes[name]=\"MFInt32\";},addField_MFFloat:function(ctx,name,def){this._vf[name]=ctx&&ctx.xmlNode&&ctx.xmlNode.hasAttribute(name)?x3dom.fields.MFFloat.parse(ctx.xmlNode.getAttribute(name)):new x3dom.fields.MFFloat(def);if(ctx&&ctx.xmlNode){this.initSetter(ctx.xmlNode,name);}\nthis._vfFieldTypes[name]=\"MFFloat\";},addField_MFDouble:function(ctx,name,def){this._vf[name]=ctx&&ctx.xmlNode&&ctx.xmlNode.hasAttribute(name)?x3dom.fields.MFFloat.parse(ctx.xmlNode.getAttribute(name)):new x3dom.fields.MFFloat(def);if(ctx&&ctx.xmlNode){this.initSetter(ctx.xmlNode,name);}\nthis._vfFieldTypes[name]=\"MFDouble\";},addField_MFColor:function(ctx,name,def){this._vf[name]=ctx&&ctx.xmlNode&&ctx.xmlNode.hasAttribute(name)?x3dom.fields.MFColor.parse(ctx.xmlNode.getAttribute(name)):new x3dom.fields.MFColor(def);if(ctx&&ctx.xmlNode){this.initSetter(ctx.xmlNode,name);}\nthis._vfFieldTypes[name]=\"MFColor\";},addField_MFColorRGBA:function(ctx,name,def){this._vf[name]=ctx&&ctx.xmlNode&&ctx.xmlNode.hasAttribute(name)?x3dom.fields.MFColorRGBA.parse(ctx.xmlNode.getAttribute(name)):new x3dom.fields.MFColorRGBA(def);if(ctx&&ctx.xmlNode){this.initSetter(ctx.xmlNode,name);}\nthis._vfFieldTypes[name]=\"MFColorRGBA\";},addField_MFVec2f:function(ctx,name,def){this._vf[name]=ctx&&ctx.xmlNode&&ctx.xmlNode.hasAttribute(name)?x3dom.fields.MFVec2f.parse(ctx.xmlNode.getAttribute(name)):new x3dom.fields.MFVec2f(def);if(ctx&&ctx.xmlNode){this.initSetter(ctx.xmlNode,name);}\nthis._vfFieldTypes[name]=\"MFVec2f\";},addField_MFVec3f:function(ctx,name,def){this._vf[name]=ctx&&ctx.xmlNode&&ctx.xmlNode.hasAttribute(name)?x3dom.fields.MFVec3f.parse(ctx.xmlNode.getAttribute(name)):new x3dom.fields.MFVec3f(def);if(ctx&&ctx.xmlNode){this.initSetter(ctx.xmlNode,name);}\nthis._vfFieldTypes[name]=\"MFVec3f\";},addField_MFVec3d:function(ctx,name,def){this.addField_MFVec3f(ctx,name,def);this._vfFieldTypes[name]=\"MFVec3d\";},addField_MFRotation:function(ctx,name,def){this._vf[name]=ctx&&ctx.xmlNode&&ctx.xmlNode.hasAttribute(name)?x3dom.fields.MFRotation.parse(ctx.xmlNode.getAttribute(name)):new x3dom.fields.MFRotation(def);if(ctx&&ctx.xmlNode){this.initSetter(ctx.xmlNode,name);}\nthis._vfFieldTypes[name]=\"MFRotation\";},addField_SFNode:function(name,type){this._cf[name]=new x3dom.fields.SFNode(type);this._cfFieldTypes[name]=\"SFNode\";},addField_MFNode:function(name,type){this._cf[name]=new x3dom.fields.MFNode(type);this._cfFieldTypes[name]=\"MFNode\";}}));x3dom.registerNodeType(\"X3DMetadataObject\",\"Core\",defineClass(x3dom.nodeTypes.X3DNode,function(ctx){x3dom.nodeTypes.X3DMetadataObject.superClass.call(this,ctx);this.addField_SFString(ctx,'name',\"\");this.addField_SFString(ctx,'reference',\"\");}));x3dom.registerNodeType(\"MetadataBoolean\",\"Core\",defineClass(x3dom.nodeTypes.X3DMetadataObject,function(ctx){x3dom.nodeTypes.MetadataBoolean.superClass.call(this,ctx);this.addField_MFBoolean(ctx,'value',[]);}));x3dom.registerNodeType(\"MetadataDouble\",\"Core\",defineClass(x3dom.nodeTypes.X3DMetadataObject,function(ctx){x3dom.nodeTypes.MetadataDouble.superClass.call(this,ctx);this.addField_MFDouble(ctx,'value',[]);}));x3dom.registerNodeType(\"MetadataFloat\",\"Core\",defineClass(x3dom.nodeTypes.X3DMetadataObject,function(ctx){x3dom.nodeTypes.MetadataFloat.superClass.call(this,ctx);this.addField_MFFloat(ctx,'value',[]);}));x3dom.registerNodeType(\"MetadataInteger\",\"Core\",defineClass(x3dom.nodeTypes.X3DMetadataObject,function(ctx){x3dom.nodeTypes.MetadataInteger.superClass.call(this,ctx);this.addField_MFInt32(ctx,'value',[]);}));x3dom.registerNodeType(\"MetadataSet\",\"Core\",defineClass(x3dom.nodeTypes.X3DMetadataObject,function(ctx){x3dom.nodeTypes.MetadataSet.superClass.call(this,ctx);this.addField_MFNode('value',x3dom.nodeTypes.X3DMetadataObject);}));x3dom.registerNodeType(\"MetadataString\",\"Core\",defineClass(x3dom.nodeTypes.X3DMetadataObject,function(ctx){x3dom.nodeTypes.MetadataString.superClass.call(this,ctx);this.addField_MFString(ctx,'value',[]);}));x3dom.registerNodeType(\"Field\",\"Core\",defineClass(x3dom.nodeTypes.X3DNode,function(ctx){x3dom.nodeTypes.Field.superClass.call(this,ctx);this.addField_SFString(ctx,'name',\"\");this.addField_SFString(ctx,'type',\"\");this.addField_SFString(ctx,'value',\"\");},{fieldChanged:function(fieldName){var that=this;if(fieldName==='value'){Array.forEach(this._parentNodes,function(node){node.fieldChanged(that._vf.name);});}}}));x3dom.registerNodeType(\"X3DChildNode\",\"Core\",defineClass(x3dom.nodeTypes.X3DNode,function(ctx){x3dom.nodeTypes.X3DChildNode.superClass.call(this,ctx);}));x3dom.registerNodeType(\"X3DBindableNode\",\"Core\",defineClass(x3dom.nodeTypes.X3DChildNode,function(ctx){x3dom.nodeTypes.X3DBindableNode.superClass.call(this,ctx);this.addField_SFBool(ctx,'bind',false);this.addField_SFString(ctx,'description',\"\");this.addField_SFBool(ctx,'isActive',false);this._autoGen=(ctx&&ctx.autoGen?true:false);if(this._autoGen)\nthis._vf.description=\"default\"+this.constructor.superClass._typeName;this._stack=null;this._bindAnimation=true;},{bind:function(value){if(this._stack){if(value){this._stack.push(this);}\nelse{this._stack.pop(this);}}\nelse{x3dom.debug.logError('No BindStack in '+this.typeName()+'Bindable');}},activate:function(prev){this.postMessage('isActive',true);x3dom.debug.logInfo('activate '+this.typeName()+'Bindable '+\nthis._DEF+'/'+this._vf.description);},deactivate:function(prev){this.postMessage('isActive',false);x3dom.debug.logInfo('deactivate '+this.typeName()+'Bindable '+\nthis._DEF+'/'+this._vf.description);},fieldChanged:function(fieldName){if(fieldName.indexOf(\"bind\")>=0){this.bind(this._vf.bind);}},nodeChanged:function(){this._stack=this._nameSpace.doc._bindableBag.addBindable(this);}}));x3dom.registerNodeType(\"X3DInfoNode\",\"Core\",defineClass(x3dom.nodeTypes.X3DChildNode,function(ctx){x3dom.nodeTypes.X3DInfoNode.superClass.call(this,ctx);}));x3dom.registerNodeType(\"WorldInfo\",\"Core\",defineClass(x3dom.nodeTypes.X3DInfoNode,function(ctx){x3dom.nodeTypes.WorldInfo.superClass.call(this,ctx);this.addField_MFString(ctx,'info',[]);this.addField_SFString(ctx,'title',\"\");x3dom.debug.logInfo(this._vf.info);x3dom.debug.logInfo(this._vf.title);}));x3dom.registerNodeType(\"X3DSensorNode\",\"Core\",defineClass(x3dom.nodeTypes.X3DChildNode,function(ctx){x3dom.nodeTypes.X3DSensorNode.superClass.call(this,ctx);this.addField_SFBool(ctx,'enabled',true);}));x3dom.registerNodeType(\"Param\",\"Core\",defineClass(x3dom.nodeTypes.X3DNode,function(ctx){x3dom.nodeTypes.Param.superClass.call(this,ctx);x3dom.debug.logWarning('DEPRECATED: Param element needs to be child of X3D element '\n+'[<a href=\"http://x3dom.org/docs/latest/configuration.html\">DOCS</a>]');}));x3dom.registerNodeType(\"X3DBoundedObject\",\"Grouping\",defineClass(x3dom.nodeTypes.X3DChildNode,function(ctx){x3dom.nodeTypes.X3DBoundedObject.superClass.call(this,ctx);this.addField_SFBool(ctx,'render',true);this.addField_SFVec3f(ctx,'bboxCenter',0,0,0);this.addField_SFVec3f(ctx,'bboxSize',-1,-1,-1);this._graph={boundedNode:this,localMatrix:x3dom.fields.SFMatrix4f.identity(),globalMatrix:null,volume:new x3dom.fields.BoxVolume(),lastVolume:new x3dom.fields.BoxVolume(),worldVolume:new x3dom.fields.BoxVolume(),center:new x3dom.fields.SFVec3f(0,0,0),coverage:-1,needCulling:true};},{fieldChanged:function(fieldName){if(this._vf.hasOwnProperty(fieldName)){this.invalidateVolume();}},nodeChanged:function(){this.invalidateVolume();},parentAdded:function(parent){this.invalidateVolume();},getVolume:function()\n{var vol=this._graph.volume;if(!this.volumeValid()&&this._vf.render)\n{for(var i=0,n=this._childNodes.length;i<n;i++)\n{var child=this._childNodes[i];if(!child||child._vf.render!==true)\ncontinue;var childVol=child.getVolume();if(childVol&&childVol.isValid())\nvol.extendBounds(childVol.min,childVol.max);}}\nif(!vol.equals(this._graph.lastVolume))\n{this._graph.lastVolume=x3dom.fields.BoxVolume.copy(vol);var event={target:this._xmlNode,type:\"volumechanged\",volume:x3dom.fields.BoxVolume.copy(vol)};this.callEvtHandler(\"onvolumechanged\",event);}\nreturn vol;},invalidateVolume:function()\n{var graph=this._graph;graph.volume.invalidate();graph.worldVolume.invalidate();graph.globalMatrix=null;for(var i=0,n=this._parentNodes.length;i<n;i++){var node=this._parentNodes[i];if(node)\nnode.invalidateVolume();}},invalidateCache:function()\n{var graph=this._graph;graph.worldVolume.invalidate();graph.globalMatrix=null;},cacheInvalid:function()\n{return(this._graph.globalMatrix==null||!this._graph.worldVolume.isValid());},volumeValid:function()\n{return this._graph.volume.isValid();},graphState:function()\n{return this._graph;},forceUpdateCoverage:function()\n{return false;}}));x3dom.registerNodeType(\"X3DGroupingNode\",\"Grouping\",defineClass(x3dom.nodeTypes.X3DBoundedObject,function(ctx){x3dom.nodeTypes.X3DGroupingNode.superClass.call(this,ctx);this.addField_MFNode('children',x3dom.nodeTypes.X3DChildNode);},{collectDrawableObjects:function(transform,drawableCollection,singlePath,invalidateCache,planeMask,clipPlanes)\n{if(singlePath&&(this._parentNodes.length>1))\nsinglePath=false;if(singlePath&&(invalidateCache=invalidateCache||this.cacheInvalid()))\nthis.invalidateCache();planeMask=drawableCollection.cull(transform,this.graphState(),singlePath,planeMask);if(planeMask<0){return;}\nvar cnode,childTransform;if(singlePath){if(!this._graph.globalMatrix){this._graph.globalMatrix=this.transformMatrix(transform);}\nchildTransform=this._graph.globalMatrix;}\nelse{childTransform=this.transformMatrix(transform);}\nvar n=this._childNodes.length;if(x3dom.nodeTypes.ClipPlane.count>0){var localClipPlanes=[];for(var j=0;j<n;j++){if((cnode=this._childNodes[j])){if(x3dom.isa(cnode,x3dom.nodeTypes.ClipPlane)&&cnode._vf.on&&cnode._vf.enabled){localClipPlanes.push({plane:cnode,trafo:childTransform});}}}\nclipPlanes=localClipPlanes.concat(clipPlanes);}\nfor(var i=0;i<n;i++){if((cnode=this._childNodes[i])){cnode.collectDrawableObjects(childTransform,drawableCollection,singlePath,invalidateCache,planeMask,clipPlanes);}}}}));x3dom.registerNodeType(\"Switch\",\"Grouping\",defineClass(x3dom.nodeTypes.X3DGroupingNode,function(ctx){x3dom.nodeTypes.Switch.superClass.call(this,ctx);this.addField_SFInt32(ctx,'whichChoice',-1);},{fieldChanged:function(fieldName){if(fieldName==\"whichChoice\"){this.invalidateVolume();}},getVolume:function()\n{var vol=this._graph.volume;if(!this.volumeValid()&&this._vf.render)\n{if(this._vf.whichChoice>=0&&this._vf.whichChoice<this._childNodes.length)\n{var child=this._childNodes[this._vf.whichChoice];var childVol=(child&&child._vf.render===true)?child.getVolume():null;if(childVol&&childVol.isValid())\nvol.extendBounds(childVol.min,childVol.max);}}\nreturn vol;},collectDrawableObjects:function(transform,drawableCollection,singlePath,invalidateCache,planeMask,clipPlanes)\n{if(singlePath&&(this._parentNodes.length>1))\nsinglePath=false;if(singlePath&&(invalidateCache=invalidateCache||this.cacheInvalid()))\nthis.invalidateCache();if(this._vf.whichChoice<0||this._vf.whichChoice>=this._childNodes.length||(planeMask=drawableCollection.cull(transform,this.graphState(),singlePath,planeMask))<0){return;}\nvar cnode,childTransform;if(singlePath){if(!this._graph.globalMatrix){this._graph.globalMatrix=this.transformMatrix(transform);}\nchildTransform=this._graph.globalMatrix;}\nelse{childTransform=this.transformMatrix(transform);}\nif((cnode=this._childNodes[this._vf.whichChoice])){cnode.collectDrawableObjects(childTransform,drawableCollection,singlePath,invalidateCache,planeMask,clipPlanes);}},doIntersect:function(line)\n{if(this._vf.whichChoice<0||this._vf.whichChoice>=this._childNodes.length){return false;}\nvar child=this._childNodes[this._vf.whichChoice];if(child){return child.doIntersect(line);}\nreturn false;}}));x3dom.registerNodeType(\"X3DTransformNode\",\"Grouping\",defineClass(x3dom.nodeTypes.X3DGroupingNode,function(ctx){x3dom.nodeTypes.X3DTransformNode.superClass.call(this,ctx);if(ctx)\nctx.doc._nodeBag.trans.push(this);else\nx3dom.debug.logWarning(\"X3DTransformNode: No runtime context found!\");this._trafo=null;this._needCssStyleUpdates=true;},{tick:function(t)\n{var dom=this._xmlNode;if(dom&&(dom['ontransform']||dom.hasAttribute('ontransform')||this._listeners['transform'])){var transMatrix=this.getCurrentTransform();var event={target:dom,type:'transform',worldX:transMatrix._03,worldY:transMatrix._13,worldZ:transMatrix._23,cancelBubble:false,stopPropagation:function(){this.cancelBubble=true;}};this.callEvtHandler(\"ontransform\",event);}\nif(this._needCssStyleUpdates&&dom){var trans=x3dom.getStyle(dom,\"-webkit-transform\")||x3dom.getStyle(dom,\"-moz-transform\")||x3dom.getStyle(dom,\"-ms-transform\")||x3dom.getStyle(dom,\"transform\");if(trans&&(trans!='none')){this._trafo.setValueByStr(trans);this.invalidateVolume();return true;}\nthis._needCssStyleUpdates=false;}\nreturn false;},transformMatrix:function(transform){return transform.mult(this._trafo);},getVolume:function()\n{var vol=this._graph.volume;if(!this.volumeValid()&&this._vf.render)\n{this._graph.localMatrix=this._trafo;for(var i=0,n=this._childNodes.length;i<n;i++)\n{var child=this._childNodes[i];if(!child||child._vf.render!==true)\ncontinue;var childVol=child.getVolume();if(childVol&&childVol.isValid())\nvol.extendBounds(childVol.min,childVol.max);}\nif(vol.isValid())\nvol.transform(this._trafo);}\nreturn vol;},doIntersect:function(line)\n{var isect=false;var mat=this._trafo.inverse();var tmpPos=new x3dom.fields.SFVec3f(line.pos.x,line.pos.y,line.pos.z);var tmpDir=new x3dom.fields.SFVec3f(line.dir.x,line.dir.y,line.dir.z);line.pos=mat.multMatrixPnt(line.pos);line.dir=mat.multMatrixVec(line.dir);if(line.hitObject){line.dist*=line.dir.length();}\nfor(var i=0;i<this._childNodes.length;i++)\n{if(this._childNodes[i]){isect=this._childNodes[i].doIntersect(line)||isect;}}\nline.pos.setValues(tmpPos);line.dir.setValues(tmpDir);if(isect){line.hitPoint=this._trafo.multMatrixPnt(line.hitPoint);line.dist*=line.dir.length();}\nreturn isect;},parentRemoved:function(parent)\n{var i,n;if(this._parentNodes.length==0){var doc=this.findX3DDoc();for(i=0,n=doc._nodeBag.trans.length;i<n;i++){if(doc._nodeBag.trans[i]===this){doc._nodeBag.trans.splice(i,1);}}}\nfor(i=0,n=this._childNodes.length;i<n;i++){if(this._childNodes[i]){this._childNodes[i].parentRemoved(this);}}}}));x3dom.registerNodeType(\"Transform\",\"Grouping\",defineClass(x3dom.nodeTypes.X3DTransformNode,function(ctx){x3dom.nodeTypes.Transform.superClass.call(this,ctx);this.addField_SFVec3f(ctx,'center',0,0,0);this.addField_SFVec3f(ctx,'translation',0,0,0);this.addField_SFRotation(ctx,'rotation',0,0,1,0);this.addField_SFVec3f(ctx,'scale',1,1,1);this.addField_SFRotation(ctx,'scaleOrientation',0,0,1,0);this._trafo=x3dom.fields.SFMatrix4f.translation(this._vf.translation.add(this._vf.center)).mult(this._vf.rotation.toMatrix()).mult(this._vf.scaleOrientation.toMatrix()).mult(x3dom.fields.SFMatrix4f.scale(this._vf.scale)).mult(this._vf.scaleOrientation.toMatrix().inverse()).mult(x3dom.fields.SFMatrix4f.translation(this._vf.center.negate()));},{fieldChanged:function(fieldName)\n{if(fieldName==\"center\"||fieldName==\"translation\"||fieldName==\"rotation\"||fieldName==\"scale\"||fieldName==\"scaleOrientation\")\n{this._trafo=x3dom.fields.SFMatrix4f.translation(this._vf.translation.add(this._vf.center)).mult(this._vf.rotation.toMatrix()).mult(this._vf.scaleOrientation.toMatrix()).mult(x3dom.fields.SFMatrix4f.scale(this._vf.scale)).mult(this._vf.scaleOrientation.toMatrix().inverse()).mult(x3dom.fields.SFMatrix4f.translation(this._vf.center.negate()));this.invalidateVolume();}\nelse if(fieldName==\"render\"){this.invalidateVolume();}}}));x3dom.registerNodeType(\"MatrixTransform\",\"Grouping\",defineClass(x3dom.nodeTypes.X3DTransformNode,function(ctx){x3dom.nodeTypes.MatrixTransform.superClass.call(this,ctx);this.addField_SFMatrix4f(ctx,'matrix',1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);this._trafo=this._vf.matrix.transpose();},{fieldChanged:function(fieldName){if(fieldName==\"matrix\"){this._trafo=this._vf.matrix.transpose();this.invalidateVolume();}\nelse if(fieldName==\"render\"){this.invalidateVolume();}}}));x3dom.registerNodeType(\"Group\",\"Grouping\",defineClass(x3dom.nodeTypes.X3DGroupingNode,function(ctx){x3dom.nodeTypes.Group.superClass.call(this,ctx);}));x3dom.registerNodeType(\"Block\",\"Grouping\",defineClass(x3dom.nodeTypes.X3DGroupingNode,function(ctx){x3dom.nodeTypes.Block.superClass.call(this,ctx);this.addField_MFString(ctx,'nameSpaceName',[]);}));x3dom.registerNodeType(\"StaticGroup\",\"Grouping\",defineClass(x3dom.nodeTypes.X3DGroupingNode,function(ctx){x3dom.nodeTypes.StaticGroup.superClass.call(this,ctx);x3dom.debug.logWarning(\"StaticGroup erroneously also bakes parent transforms, if happens use Group node!\");this.addField_SFBool(ctx,'debug',false);this.addField_SFBool(ctx,'showDebugBoxVolumes',false);this.addField_SFString(ctx,'bvhType','jsBIH');this.addField_SFInt32(ctx,'maxObjectsPerNode',1);this.addField_SFInt32(ctx,'maxDepth',-1);this.addField_SFFloat(ctx,'minRelativeBBoxSize',0.01);this.needBvhRebuild=true;this.drawableCollection=null;this.bvh=null;},{getMaxDepth:function()\n{if(this._vf.maxDepth==-1)\n{return(this._vf.bvhType==('jsBIH'||'BIH'))?50:4;}\nreturn this._vf.maxDepth;},collectDrawableObjects:function(transform,drawableCollection,singlePath,invalidateCache,planeMask,clipPlanes)\n{if(singlePath&&(this._parentNodes.length>1))\nsinglePath=false;if(singlePath&&(invalidateCache=invalidateCache||this.cacheInvalid()))\nthis.invalidateCache();planeMask=drawableCollection.cull(transform,this.graphState(),singlePath,planeMask);if(planeMask<0){return;}\nvar cnode,childTransform;if(singlePath){if(!this._graph.globalMatrix){this._graph.globalMatrix=this.transformMatrix(transform);}\nchildTransform=this._graph.globalMatrix;}\nelse{childTransform=this.transformMatrix(transform);}\nif(this.needBvhRebuild)\n{var drawableCollectionConfig={viewArea:drawableCollection.viewarea,sortTrans:drawableCollection.sortTrans,viewMatrix:drawableCollection.viewMatrix,projMatrix:drawableCollection.projMatrix,sceneMatrix:drawableCollection.sceneMatrix,frustumCulling:false,smallFeatureThreshold:0,context:drawableCollection.context};this.drawableCollection=new x3dom.DrawableCollection(drawableCollectionConfig);var i,n=this._childNodes.length;for(i=0;i<n;i++){if((cnode=this._childNodes[i])){cnode.collectDrawableObjects(childTransform,this.drawableCollection,singlePath,invalidateCache,planeMask,clipPlanes);}}\nthis.drawableCollection.concat();var scene=this._nameSpace.doc._scene;var bvhSettings=new x3dom.bvh.Settings(this._vf.debug,this._vf.showDebugBoxVolumes,this._vf.bvhType,this._vf.maxObjectsPerNode,this.getMaxDepth(),this._vf.minRelativeBBoxSize);this.bvh=(this._vf.bvhType=='jsBIH')?new x3dom.bvh.BIH(scene,bvhSettings):new x3dom.bvh.Culler(this.drawableCollection,scene,bvhSettings);if(this._vf.debug||this._vf.showDebugBoxVolumes)\nthis.bvh=new x3dom.bvh.DebugDecorator(this.bvh,scene,bvhSettings);n=this.drawableCollection.length;for(i=0;i<n;i++)\n{this.bvh.addDrawable(this.drawableCollection.get(i));}\nthis.bvh.compile();if(this._vf.debug)\nthis.bvh.showCompileStats();this.needBvhRebuild=false;}\nx3dom.Utils.startMeasure('bvhTraverse');this.bvh.collectDrawables(drawableCollection);var dt=x3dom.Utils.stopMeasure('bvhTraverse');this._nameSpace.doc.ctx.x3dElem.runtime.addMeasurement('BVH',dt);this.bvh.showTraverseStats(this._nameSpace.doc.ctx.x3dElem.runtime);}}));x3dom.registerNodeType(\"RemoteSelectionGroup\",\"Grouping\",defineClass(x3dom.nodeTypes.X3DGroupingNode,function(ctx){x3dom.nodeTypes.RemoteSelectionGroup.superClass.call(this,ctx);this.addField_MFString(ctx,'url',[\"ws://localhost:35668/cstreams/0\"]);this.addField_MFString(ctx,'label',[]);this.addField_SFInt32(ctx,'maxRenderedIds',-1);this.addField_SFBool(ctx,'reconnect',true);this.addField_SFFloat(ctx,'scaleRenderedIdsOnMove',1.0);this.addField_SFBool(ctx,'enableCulling',true);this.addField_MFString(ctx,'invisibleNodes',[]);this._idList=[];this._websocket=null;this._nameObjMap={};this._createTime=[];this._visibleList=[];if(ctx)\nthis.initializeSocket();else\nx3dom.debug.logWarning(\"RemoteSelectionGroup: No runtime context found!\");},{initializeSocket:function()\n{var that=this;if(\"WebSocket\"in window)\n{var wsUrl=\"ws://localhost:35668/cstreams/0\";if(this._vf.url.length&&this._vf.url[0].length)\nwsUrl=this._vf.url[0];this._websocket=new WebSocket(wsUrl);this._websocket._lastMsg=null;this._websocket._lastData=\"\";this._websocket.onopen=function(evt)\n{x3dom.debug.logInfo(\"WS Connected\");var view=that._nameSpace.doc._viewarea.getViewMatrix();this._lastMsg=view.toGL().toString();view=that._nameSpace.doc._viewarea.getProjectionMatrix();this._lastMsg+=(\",\"+view.toGL().toString());this.send(this._lastMsg);x3dom.debug.logInfo(\"WS Sent: \"+this._lastMsg);this._lastMsg=\"\";this._lastData=\"\";};this._websocket.onclose=function(evt)\n{x3dom.debug.logInfo(\"WS Disconnected\");if(that._vf.reconnect)\n{window.setTimeout(function(){that.initializeSocket();},2000);}};this._websocket.onmessage=function(evt)\n{if(that._vf.maxRenderedIds<0)\n{that._idList=x3dom.fields.MFString.parse(evt.data);}\nelse if(that._vf.maxRenderedIds>0)\n{that._idList=[];var arr=x3dom.fields.MFString.parse(evt.data);var n=Math.min(arr.length,Math.abs(that._vf.maxRenderedIds));for(var i=0;i<n;++i){that._idList[i]=arr[i];}}\nif(that._vf.maxRenderedIds!=0&&this._lastData!=evt.data)\n{this._lastData=evt.data;that._nameSpace.doc.needRender=true;that.invalidateVolume();}};this._websocket.onerror=function(evt)\n{x3dom.debug.logError(evt.data);};this._websocket.updateCamera=function()\n{var view=that._nameSpace.doc._viewarea.getViewMatrix();var message=view.toGL().toString();view=that._nameSpace.doc._viewarea.getProjectionMatrix();message+=(\",\"+view.toGL().toString());if(this._lastMsg!=null&&this._lastMsg!=message)\n{this._lastMsg=message;this.send(message);}};}\nelse\n{x3dom.debug.logError(\"Browser has no WebSocket support!\");}},nodeChanged:function()\n{var n=this._vf.label.length;this._nameObjMap={};this._createTime=new Array(n);this._visibleList=new Array(n);for(var i=0;i<n;++i)\n{var shape=this._childNodes[i];if(shape&&x3dom.isa(shape,x3dom.nodeTypes.X3DShapeNode))\n{this._nameObjMap[this._vf.label[i]]={shape:shape,pos:i};this._visibleList[i]=true;}\nelse{this._visibleList[i]=false;x3dom.debug.logError(\"Invalid children: \"+this._vf.label[i]);}\nthis._createTime[i]=0;}\nthis.invalidateVolume();x3dom.debug.logInfo(\"RemoteSelectionGroup has \"+n+\" entries.\");},fieldChanged:function(fieldName)\n{if(fieldName==\"url\")\n{if(this._websocket){this._websocket.close();this._websocket=null;}\nthis.initializeSocket();}\nelse if(fieldName==\"invisibleNodes\")\n{for(var i=0,n=this._vf.label.length;i<n;++i)\n{var shape=this._childNodes[i];if(shape&&x3dom.isa(shape,x3dom.nodeTypes.X3DShapeNode))\n{this._visibleList[i]=true;for(var j=0,numInvis=this._vf.invisibleNodes.length;j<numInvis;++j)\n{var nodeName=this._vf.invisibleNodes[j];var starInd=nodeName.lastIndexOf('*');var matchNameBegin=false;if(starInd>0){nodeName=nodeName.substring(0,starInd);matchNameBegin=true;}\nif(nodeName.length<=1)\ncontinue;if((matchNameBegin&&this._vf.label[i].indexOf(nodeName)==0)||this._vf.label[i]==nodeName){this._visibleList[i]=false;break;}}}\nelse{this._visibleList[i]=false;}}\nthis.invalidateVolume();}\nelse if(fieldName==\"render\"){this.invalidateVolume();}},getNumRenderedObjects:function(len,isMoving)\n{var n=len;if(this._vf.maxRenderedIds>0)\n{var num=Math.max(this._vf.maxRenderedIds,16);var scale=1;if(isMoving)\nscale=Math.min(this._vf.scaleRenderedIdsOnMove,1);num=Math.max(Math.round(scale*num),0);n=Math.min(n,num);}\nreturn n;},collectDrawableObjects:function(transform,drawableCollection,singlePath,invalidateCache,planeMask,clipPlanes)\n{if(singlePath&&(this._parentNodes.length>1))\nsinglePath=false;if(singlePath&&(invalidateCache=invalidateCache||this.cacheInvalid()))\nthis.invalidateCache();planeMask=drawableCollection.cull(transform,this.graphState(),singlePath,planeMask);if(planeMask<=0){return;}\nvar viewarea=this._nameSpace.doc._viewarea;var isMoving=viewarea.isMovingOrAnimating();var ts=new Date().getTime();var maxLiveTime=10000;var i,n,numChild=this._childNodes.length;if(!this._vf.enableCulling)\n{n=this.getNumRenderedObjects(numChild,isMoving);var cnt=0;for(i=0;i<numChild;i++)\n{var shape=this._childNodes[i];if(shape)\n{var needCleanup=true;if(this._visibleList[i]&&cnt<n&&shape.collectDrawableObjects(transform,drawableCollection,singlePath,invalidateCache,planeMask,clipPlanes))\n{this._createTime[i]=ts;cnt++;needCleanup=false;}\nif(needCleanup&&!isMoving&&this._createTime[i]>0&&ts-this._createTime[i]>maxLiveTime&&shape._cleanupGLObjects)\n{shape._cleanupGLObjects(true);this._createTime[i]=0;}}}\nreturn;}\nif(this._websocket)\nthis._websocket.updateCamera();if(this._vf.label.length)\n{n=this.getNumRenderedObjects(this._idList.length,isMoving);for(i=0;i<n;i++)\n{var obj=this._nameObjMap[this._idList[i]];if(obj&&obj.shape){obj.shape.collectDrawableObjects(transform,drawableCollection,singlePath,invalidateCache,planeMask,clipPlanes);this._createTime[obj.pos]=ts;}\nelse\nx3dom.debug.logError(\"Invalid label: \"+this._idList[i]);}\nfor(i=0;i<this._childNodes.length;i++)\n{if(this._childNodes[i]&&!isMoving&&this._createTime[i]>0&&ts-this._createTime[i]>maxLiveTime&&this._childNodes[i]._cleanupGLObjects)\n{this._childNodes[i]._cleanupGLObjects(true);this._createTime[i]=0;}}}}}));x3dom.registerNodeType(\"Scene\",\"Grouping\",defineClass(x3dom.nodeTypes.X3DGroupingNode,function(ctx){x3dom.nodeTypes.Scene.superClass.call(this,ctx);this.addField_SFString(ctx,'pickMode',\"idBuf\");this.addField_SFBool(ctx,'doPickPass',true);this.addField_SFString(ctx,'shadowObjectIdMapping',\"\");this._lastMin=new x3dom.fields.SFVec3f(0,0,0);this._lastMax=new x3dom.fields.SFVec3f(1,1,1);this._shadowIdMap=null;this.loadMapping();this._multiPartMap=null;},{fieldChanged:function(fieldName)\n{if(fieldName==\"shadowObjectIdMapping\")\n{this.loadMapping();}},updateVolume:function()\n{var vol=this.getVolume();if(vol.isValid())\n{this._lastMin=x3dom.fields.SFVec3f.copy(vol.min);this._lastMax=x3dom.fields.SFVec3f.copy(vol.max);}},loadMapping:function()\n{this._shadowIdMap=null;if(this._vf.shadowObjectIdMapping.length==0){return;}\nvar that=this;var xhr=new XMLHttpRequest();xhr.open(\"GET\",this._nameSpace.getURL(this._vf.shadowObjectIdMapping),true);x3dom.RequestManager.addRequest(xhr);xhr.onload=function()\n{that._shadowIdMap=eval(\"(\"+xhr.response+\")\");if(!that._shadowIdMap||!that._shadowIdMap.mapping){x3dom.debug.logWarning(\"Invalid ID map: \"+that._vf.shadowObjectIdMapping);}\nelse{x3dom.debug.assert(that._shadowIdMap.maxID<=that._shadowIdMap.mapping.length,\"Too few ID map entries in \"+that._vf.shadowObjectIdMapping+\", \"+\"length of mapping array is only \"+that._shadowIdMap.mapping.length+\" instead of \"+that._shadowIdMap.ids.length+\"!\");}};}}));x3dom.BindableStack=function(doc,type,defaultType,getter){this._doc=doc;this._type=type;this._defaultType=defaultType;this._defaultRoot=null;this._getter=getter;this._bindBag=[];this._bindStack=[];};x3dom.BindableStack.prototype.top=function(){return((this._bindStack.length>0)?this._bindStack[this._bindStack.length-1]:null);};x3dom.BindableStack.prototype.push=function(bindable){var top=this.top();if(top===bindable){return;}\nif(top){top.deactivate();}\nthis._bindStack.push(bindable);bindable.activate(top);};x3dom.BindableStack.prototype.replaceTop=function(bindable){var top=this.top();if(top===bindable){return;}\nif(top){top.deactivate();this._bindStack[this._bindStack.length-1]=bindable;bindable.activate(top);}};x3dom.BindableStack.prototype.pop=function(bindable){var top;if(bindable){top=this.top();if(bindable!==top){return null;}}\ntop=this._bindStack.pop();if(top){top.deactivate();}\nreturn top;};x3dom.BindableStack.prototype.switchTo=function(target){var last=this.getActive();var n=this._bindBag.length;var toBind=0;var i=0,lastIndex=-1;if(n<=1){return;}\nswitch(target){case'first':toBind=this._bindBag[0];break;case'last':toBind=this._bindBag[n-1];break;default:for(i=0;i<n;i++){if(this._bindBag[i]==last){lastIndex=i;break;}}\nif(lastIndex>=0){i=lastIndex;while(!toBind){if(target=='next'){i=(i<(n-1))?(i+1):0;}else{i=(i>0)?(i-1):(n-1);}\nif(i==lastIndex){break;}\nif(this._bindBag[i]._vf.description.length>=0){toBind=this._bindBag[i];}}}\nbreak;}\nif(toBind){this.replaceTop(toBind);}else{x3dom.debug.logWarning('Cannot switch bindable; no other bindable with description found.');}};x3dom.BindableStack.prototype.getActive=function(){if(this._bindStack.length===0){if(this._bindBag.length===0){if(this._defaultRoot){x3dom.debug.logInfo('create new '+this._defaultType._typeName+' for '+this._type._typeName+'-stack');var obj=new this._defaultType({doc:this._doc,nameSpace:this._defaultRoot._nameSpace,autoGen:true});this._defaultRoot.addChild(obj);obj.nodeChanged();}else{x3dom.debug.logError('stack without defaultRoot');}}else{x3dom.debug.logInfo('activate first '+this._type._typeName+' for '+this._type._typeName+'-stack');}\nthis._bindStack.push(this._bindBag[0]);this._bindBag[0].activate();}\nreturn this._bindStack[this._bindStack.length-1];};x3dom.BindableBag=function(doc){this._stacks=[];this.addType(\"X3DViewpointNode\",\"Viewpoint\",\"getViewpoint\",doc);this.addType(\"X3DNavigationInfoNode\",\"NavigationInfo\",\"getNavigationInfo\",doc);this.addType(\"X3DBackgroundNode\",\"Background\",\"getBackground\",doc);this.addType(\"X3DFogNode\",\"Fog\",\"getFog\",doc);this.addType(\"X3DEnvironmentNode\",\"Environment\",\"getEnvironment\",doc);};x3dom.BindableBag.prototype.addType=function(typeName,defaultTypeName,getter,doc){var type=x3dom.nodeTypes[typeName];var defaultType=x3dom.nodeTypes[defaultTypeName];if(type&&defaultType){var stack=new x3dom.BindableStack(doc,type,defaultType,getter);this._stacks.push(stack);}else{x3dom.debug.logWarning('Invalid Bindable type/defaultType: '+\ntypeName+'/'+defaultType);}};x3dom.BindableBag.prototype.setRefNode=function(node){Array.forEach(this._stacks,function(stack){stack._defaultRoot=node;node[stack._getter]=function(){return stack.getActive();};});};x3dom.BindableBag.prototype.addBindable=function(node){for(var i=0,n=this._stacks.length;i<n;i++){var stack=this._stacks[i];if(x3dom.isa(node,stack._type)){x3dom.debug.logInfo('register '+node.typeName()+'Bindable '+\nnode._DEF+'/'+node._vf.description);stack._bindBag.push(node);var top=stack.top();if(top&&top._autoGen){stack.replaceTop(node);for(var j=0,m=stack._bindBag.length;j<m;j++){if(stack._bindBag[j]===top){stack._bindBag.splice(j,1);break;}}\nstack._defaultRoot.removeChild(top);}\nreturn stack;}}\nx3dom.debug.logError(node.typeName()+' is not a valid bindable');return null;};x3dom.registerNodeType(\"X3DGeometryNode\",\"Rendering\",defineClass(x3dom.nodeTypes.X3DNode,function(ctx){x3dom.nodeTypes.X3DGeometryNode.superClass.call(this,ctx);this.addField_SFBool(ctx,'solid',true);this.addField_SFBool(ctx,'ccw',true);this.addField_SFBool(ctx,'useGeoCache',this._nameSpace?this._nameSpace.doc.properties.getProperty(\"useGeoCache\",\"true\").toLowerCase()=='true':false);this.addField_SFBool(ctx,'lit',true);this._mesh=new x3dom.Mesh(this);},{getVolume:function(){return this._mesh.getVolume();},invalidateVolume:function(){this._mesh.invalidate();},getCenter:function(){return this._mesh.getCenter();},getDiameter:function(){return this._mesh.getDiameter();},doIntersect:function(line){return this._mesh.doIntersect(line);},forceUpdateCoverage:function(){return false;},hasIndexOffset:function(){return false;},getColorTexture:function(){return null;},getColorTextureURL:function(){return null;},parentAdded:function(parent){if(x3dom.isa(parent,x3dom.nodeTypes.X3DShapeNode)){if(parent._cleanupGLObjects){parent._cleanupGLObjects(true);}\nparent.setAllDirty();parent.invalidateVolume();}},needLighting:function(){var hasTris=this._mesh._primType.indexOf(\"TRIANGLE\")>=0;return(this._vf.lit&&hasTris);}}));x3dom.registerNodeType(\"Mesh\",\"Rendering\",defineClass(x3dom.nodeTypes.X3DGeometryNode,function(ctx){x3dom.nodeTypes.Mesh.superClass.call(this,ctx);this.addField_SFString(ctx,'primType',\"triangle\");this.addField_MFInt32(ctx,'index',[]);this.addField_MFNode('vertexAttributes',x3dom.nodeTypes.X3DVertexAttributeNode);},{nodeChanged:function()\n{var time0=new Date().getTime();var i,n=this._cf.vertexAttributes.nodes.length;for(i=0;i<n;i++)\n{var name=this._cf.vertexAttributes.nodes[i]._vf.name;switch(name.toLowerCase())\n{case\"position\":this._mesh._positions[0]=this._cf.vertexAttributes.nodes[i]._vf.value.toGL();break;case\"normal\":this._mesh._normals[0]=this._cf.vertexAttributes.nodes[i]._vf.value.toGL();break;case\"texcoord\":this._mesh._texCoords[0]=this._cf.vertexAttributes.nodes[i]._vf.value.toGL();break;case\"color\":this._mesh._colors[0]=this._cf.vertexAttributes.nodes[i]._vf.value.toGL();break;default:this._mesh._dynamicFields[name]={};this._mesh._dynamicFields[name].numComponents=this._cf.vertexAttributes.nodes[i]._vf.numComponents;this._mesh._dynamicFields[name].value=this._cf.vertexAttributes.nodes[i]._vf.value.toGL();break;}}\nthis._mesh._indices[0]=this._vf.index.toGL();this.invalidateVolume();this._mesh._numFaces=this._mesh._indices[0].length/3;this._mesh._numCoords=this._mesh._positions[0].length/3;var time1=new Date().getTime()-time0;x3dom.debug.logWarning(\"Mesh load time: \"+time1+\" ms\");}}));x3dom.registerNodeType(\"PointSet\",\"Rendering\",defineClass(x3dom.nodeTypes.X3DGeometryNode,function(ctx){x3dom.nodeTypes.PointSet.superClass.call(this,ctx);this.addField_SFNode('coord',x3dom.nodeTypes.X3DCoordinateNode);this.addField_SFNode('color',x3dom.nodeTypes.X3DColorNode);this._mesh._primType='POINTS';},{nodeChanged:function()\n{var time0=new Date().getTime();var coordNode=this._cf.coord.node;x3dom.debug.assert(coordNode,\"PointSet without coord node!\");var positions=coordNode.getPoints();var numColComponents=3;var colorNode=this._cf.color.node;var colors=new x3dom.fields.MFColor();if(colorNode){colors=colorNode._vf.color;x3dom.debug.assert(positions.length==colors.length,\"Size of color and coord array differs!\");if(x3dom.isa(colorNode,x3dom.nodeTypes.ColorRGBA)){numColComponents=4;}}\nthis._mesh._numColComponents=numColComponents;this._mesh._lit=false;this._mesh._indices[0]=[];this._mesh._positions[0]=positions.toGL();this._mesh._colors[0]=colors.toGL();this._mesh._normals[0]=[];this._mesh._texCoords[0]=[];this.invalidateVolume();this._mesh._numCoords=this._mesh._positions[0].length/3;var time1=new Date().getTime()-time0;},fieldChanged:function(fieldName)\n{var pnts=null;if(fieldName==\"coord\")\n{pnts=this._cf.coord.node.getPoints();this._mesh._positions[0]=pnts.toGL();this.invalidateVolume();Array.forEach(this._parentNodes,function(node){node._dirty.positions=true;node.invalidateVolume();});}\nelse if(fieldName==\"color\")\n{pnts=this._cf.color.node._vf.color;this._mesh._colors[0]=pnts.toGL();Array.forEach(this._parentNodes,function(node){node._dirty.colors=true;});}}}));x3dom.registerNodeType(\"X3DComposedGeometryNode\",\"Rendering\",defineClass(x3dom.nodeTypes.X3DGeometryNode,function(ctx){x3dom.nodeTypes.X3DComposedGeometryNode.superClass.call(this,ctx);this.addField_SFBool(ctx,'colorPerVertex',true);this.addField_SFBool(ctx,'normalPerVertex',true);this.addField_SFString(ctx,'normalUpdateMode','fast');this.addField_MFNode('attrib',x3dom.nodeTypes.X3DVertexAttributeNode);this.addField_SFNode('coord',x3dom.nodeTypes.X3DCoordinateNode);this.addField_SFNode('normal',x3dom.nodeTypes.Normal);this.addField_SFNode('color',x3dom.nodeTypes.X3DColorNode);this.addField_SFNode('texCoord',x3dom.nodeTypes.X3DTextureCoordinateNode);},{handleAttribs:function()\n{var i,n=this._cf.attrib.nodes.length;for(i=0;i<n;i++)\n{var name=this._cf.attrib.nodes[i]._vf.name;switch(name.toLowerCase())\n{case\"position\":this._mesh._positions[0]=this._cf.attrib.nodes[i]._vf.value.toGL();break;case\"normal\":this._mesh._normals[0]=this._cf.attrib.nodes[i]._vf.value.toGL();break;case\"texcoord\":this._mesh._texCoords[0]=this._cf.attrib.nodes[i]._vf.value.toGL();break;case\"color\":this._mesh._colors[0]=this._cf.attrib.nodes[i]._vf.value.toGL();break;default:this._mesh._dynamicFields[name]={};this._mesh._dynamicFields[name].numComponents=this._cf.attrib.nodes[i]._vf.numComponents;this._mesh._dynamicFields[name].value=this._cf.attrib.nodes[i]._vf.value.toGL();break;}}}}));x3dom.registerNodeType(\"LineSet\",\"Rendering\",defineClass(x3dom.nodeTypes.X3DGeometryNode,function(ctx){x3dom.nodeTypes.LineSet.superClass.call(this,ctx);this.addField_MFInt32(ctx,'vertexCount',[]);this.addField_MFNode('attrib',x3dom.nodeTypes.X3DVertexAttributeNode);this.addField_SFNode('coord',x3dom.nodeTypes.X3DCoordinateNode);this.addField_SFNode('color',x3dom.nodeTypes.X3DColorNode);this._mesh._primType=\"LINES\";x3dom.Utils.needLineWidth=true;},{nodeChanged:function(){var coordNode=this._cf.coord.node;x3dom.debug.assert(coordNode);var positions=coordNode.getPoints();this._mesh._positions[0]=positions.toGL();var colorNode=this._cf.color.node;if(colorNode){var colors=colorNode._vf.color;this._mesh._colors[0]=colors.toGL();this._mesh._numColComponents=3;if(x3dom.isa(colorNode,x3dom.nodeTypes.ColorRGBA)){this._mesh._numColComponents=4;}}\nvar cnt=0;this._mesh._indices[0]=[];for(var i=0,n=this._vf.vertexCount.length;i<n;i++){var vc=this._vf.vertexCount[i];if(vc<2){x3dom.debug.logError(\"LineSet.vertexCount must not be smaller than 2!\");break;}\nfor(var j=vc-2;j>=0;j--){this._mesh._indices[0].push(cnt++,cnt);if(j==0)cnt++;}}},fieldChanged:function(fieldName){if(fieldName==\"coord\"){var pnts=this._cf.coord.node.getPoints();this._mesh._positions[0]=pnts.toGL();this.invalidateVolume();Array.forEach(this._parentNodes,function(node){node._dirty.positions=true;node.invalidateVolume();});}\nelse if(fieldName==\"color\"){var cols=this._cf.color.node._vf.color;this._mesh._colors[0]=cols.toGL();Array.forEach(this._parentNodes,function(node){node._dirty.colors=true;});}}}));x3dom.registerNodeType(\"IndexedLineSet\",\"Rendering\",defineClass(x3dom.nodeTypes.X3DGeometryNode,function(ctx){x3dom.nodeTypes.IndexedLineSet.superClass.call(this,ctx);this.addField_SFBool(ctx,'colorPerVertex',true);this.addField_MFNode('attrib',x3dom.nodeTypes.X3DVertexAttributeNode);this.addField_SFNode('coord',x3dom.nodeTypes.X3DCoordinateNode);this.addField_SFNode('color',x3dom.nodeTypes.X3DColorNode);this.addField_MFInt32(ctx,'coordIndex',[]);this.addField_MFInt32(ctx,'colorIndex',[]);this._mesh._primType='LINES';x3dom.Utils.needLineWidth=true;},{_buildGeometry:function()\n{var time0=new Date().getTime();var indexes=this._vf.coordIndex;var colorInd=this._vf.colorIndex;var hasColor=false,hasColorInd=false;var colPerVert=this._vf.colorPerVertex;if(colorInd.length==indexes.length)\n{hasColorInd=true;}\nvar positions,colors;var coordNode=this._cf.coord.node;x3dom.debug.assert(coordNode);positions=coordNode.getPoints();var numColComponents=3;var colorNode=this._cf.color.node;if(colorNode)\n{hasColor=true;colors=colorNode._vf.color;if(x3dom.isa(colorNode,x3dom.nodeTypes.ColorRGBA)){numColComponents=4;}}\nelse{hasColor=false;}\nthis._mesh._indices[0]=[];this._mesh._positions[0]=[];this._mesh._colors[0]=[];var i,t,cnt,lineCnt;var p0,p1,c0,c1;if((hasColor&&hasColorInd)||positions.length>x3dom.Utils.maxIndexableCoords)\n{t=0;cnt=0;lineCnt=0;for(i=0;i<indexes.length;++i)\n{if(indexes[i]>positions.length-1)\n{continue;}\nif(indexes[i]===-1){t=0;continue;}\nif(hasColorInd){x3dom.debug.assert(colorInd[i]!=-1);}\nswitch(t)\n{case 0:p0=+indexes[i];if(hasColorInd&&colPerVert){c0=+colorInd[i];}\nelse{c0=p0;}\nt=1;break;case 1:p1=+indexes[i];if(hasColorInd&&colPerVert){c1=+colorInd[i];}\nelse if(hasColorInd&&!colPerVert){c1=+colorInd[lineCnt];}\nelse{c1=p1;}\nthis._mesh._indices[0].push(cnt++,cnt++);this._mesh._positions[0].push(positions[p0].x);this._mesh._positions[0].push(positions[p0].y);this._mesh._positions[0].push(positions[p0].z);this._mesh._positions[0].push(positions[p1].x);this._mesh._positions[0].push(positions[p1].y);this._mesh._positions[0].push(positions[p1].z);if(hasColor){if(!colPerVert){c0=c1;}\nthis._mesh._colors[0].push(colors[c0].r);this._mesh._colors[0].push(colors[c0].g);this._mesh._colors[0].push(colors[c0].b);this._mesh._colors[0].push(colors[c1].r);this._mesh._colors[0].push(colors[c1].g);this._mesh._colors[0].push(colors[c1].b);}\nt=2;lineCnt++;break;case 2:p0=p1;c0=c1;p1=+indexes[i];if(hasColorInd&&colPerVert){c1=+colorInd[i];}\nelse if(hasColorInd&&!colPerVert){c1=+colorInd[lineCnt];}\nelse{c1=p1;}\nthis._mesh._indices[0].push(cnt++,cnt++);this._mesh._positions[0].push(positions[p0].x);this._mesh._positions[0].push(positions[p0].y);this._mesh._positions[0].push(positions[p0].z);this._mesh._positions[0].push(positions[p1].x);this._mesh._positions[0].push(positions[p1].y);this._mesh._positions[0].push(positions[p1].z);if(hasColor){if(!colPerVert){c0=c1;}\nthis._mesh._colors[0].push(colors[c0].r);this._mesh._colors[0].push(colors[c0].g);this._mesh._colors[0].push(colors[c0].b);this._mesh._colors[0].push(colors[c1].r);this._mesh._colors[0].push(colors[c1].g);this._mesh._colors[0].push(colors[c1].b);}\nlineCnt++;break;default:}}\nif(positions.length>x3dom.Utils.maxIndexableCoords)\nthis._mesh.splitMesh(2);}\nelse\n{var n=indexes.length;t=0;for(i=0;i<n;++i)\n{if(indexes[i]==-1){t=0;continue;}\nswitch(t){case 0:p0=+indexes[i];t=1;break;case 1:p1=+indexes[i];t=2;this._mesh._indices[0].push(p0,p1);break;case 2:p0=p1;p1=+indexes[i];this._mesh._indices[0].push(p0,p1);break;}}\nthis._mesh._positions[0]=positions.toGL();if(hasColor){this._mesh._colors[0]=colors.toGL();this._mesh._numColComponents=numColComponents;}}\nthis.invalidateVolume();this._mesh._numCoords=0;for(i=0;i<this._mesh._indices.length;i++){this._mesh._numCoords+=this._mesh._positions[i].length/3;}\nvar time1=new Date().getTime()-time0;},nodeChanged:function()\n{this._buildGeometry();},fieldChanged:function(fieldName)\n{var pnts=null;if(fieldName==\"coord\")\n{this._buildGeometry();Array.forEach(this._parentNodes,function(node){node._dirty.positions=true;node.invalidateVolume();});}\nelse if(fieldName==\"color\")\n{this._buildGeometry();Array.forEach(this._parentNodes,function(node){node._dirty.colors=true;});}\nelse if(fieldName==\"coordIndex\"){this._buildGeometry();Array.forEach(this._parentNodes,function(node){node._dirty.indexes=true;node.invalidateVolume();});}\nelse if(fieldName==\"colorIndex\"){this._buildGeometry();Array.forEach(this._parentNodes,function(node){node._dirty.colors=true;node.invalidateVolume();});}}}));x3dom.registerNodeType(\"IndexedTriangleSet\",\"Rendering\",defineClass(x3dom.nodeTypes.X3DComposedGeometryNode,function(ctx){x3dom.nodeTypes.IndexedTriangleSet.superClass.call(this,ctx);this.addField_MFInt32(ctx,'index',[]);},{nodeChanged:function()\n{var time0=new Date().getTime();this.handleAttribs();var colPerVert=this._vf.colorPerVertex;var normPerVert=this._vf.normalPerVertex;var ccw=this._vf.ccw;var indexes=this._vf.index;var hasNormal=false,hasTexCoord=false,hasColor=false;var positions,normals,texCoords,colors;var coordNode=this._cf.coord.node;x3dom.debug.assert(coordNode);positions=coordNode._vf.point;var normalNode=this._cf.normal.node;if(normalNode){hasNormal=true;normals=normalNode._vf.vector;}\nelse{hasNormal=false;}\nvar texMode=\"\",numTexComponents=2;var texCoordNode=this._cf.texCoord.node;if(x3dom.isa(texCoordNode,x3dom.nodeTypes.MultiTextureCoordinate)){if(texCoordNode._cf.texCoord.nodes.length)\ntexCoordNode=texCoordNode._cf.texCoord.nodes[0];}\nif(texCoordNode){if(texCoordNode._vf.point){hasTexCoord=true;texCoords=texCoordNode._vf.point;if(x3dom.isa(texCoordNode,x3dom.nodeTypes.TextureCoordinate3D)){numTexComponents=3;}}\nelse if(texCoordNode._vf.mode){texMode=texCoordNode._vf.mode;}}\nelse{hasTexCoord=false;}\nvar numColComponents=3;var colorNode=this._cf.color.node;if(colorNode){hasColor=true;colors=colorNode._vf.color;if(x3dom.isa(colorNode,x3dom.nodeTypes.ColorRGBA)){numColComponents=4;}}\nelse{hasColor=false;}\nthis._mesh._indices[0]=[];this._mesh._positions[0]=[];this._mesh._normals[0]=[];this._mesh._texCoords[0]=[];this._mesh._colors[0]=[];var i,t,cnt,faceCnt,posMax;var p0,p1,p2,n0,n1,n2,t0,t1,t2,c0,c1,c2;while(positions.length%3>0){positions.push(positions.length-1);}\nposMax=positions.length;if(!normPerVert||!colPerVert||posMax>x3dom.Utils.maxIndexableCoords)\n{t=0;cnt=0;faceCnt=0;this._mesh._multiIndIndices=[];this._mesh._posSize=positions.length;for(i=0;i<indexes.length;++i)\n{if((i>0)&&(i%3===0)){t=0;faceCnt++;}\nswitch(t)\n{case 0:p0=+indexes[i];if(normPerVert){n0=p0;}else if(!normPerVert){n0=faceCnt;}\nt0=p0;if(colPerVert){c0=p0;}else if(!colPerVert){c0=faceCnt;}\nt=1;break;case 1:p1=+indexes[i];if(normPerVert){n1=p1;}else if(!normPerVert){n1=faceCnt;}\nt1=p1;if(colPerVert){c1=p1;}else if(!colPerVert){c1=faceCnt;}\nt=2;break;case 2:p2=+indexes[i];if(normPerVert){n2=p2;}else if(!normPerVert){n2=faceCnt;}\nt2=p2;if(colPerVert){c2=p2;}else if(!colPerVert){c2=faceCnt;}\nt=3;this._mesh._indices[0].push(cnt++,cnt++,cnt++);this._mesh._positions[0].push(positions[p0].x);this._mesh._positions[0].push(positions[p0].y);this._mesh._positions[0].push(positions[p0].z);this._mesh._positions[0].push(positions[p1].x);this._mesh._positions[0].push(positions[p1].y);this._mesh._positions[0].push(positions[p1].z);this._mesh._positions[0].push(positions[p2].x);this._mesh._positions[0].push(positions[p2].y);this._mesh._positions[0].push(positions[p2].z);if(hasNormal){this._mesh._normals[0].push(normals[n0].x);this._mesh._normals[0].push(normals[n0].y);this._mesh._normals[0].push(normals[n0].z);this._mesh._normals[0].push(normals[n1].x);this._mesh._normals[0].push(normals[n1].y);this._mesh._normals[0].push(normals[n1].z);this._mesh._normals[0].push(normals[n2].x);this._mesh._normals[0].push(normals[n2].y);this._mesh._normals[0].push(normals[n2].z);}\nelse{this._mesh._multiIndIndices.push(p0,p1,p2);}\nif(hasColor){this._mesh._colors[0].push(colors[c0].r);this._mesh._colors[0].push(colors[c0].g);this._mesh._colors[0].push(colors[c0].b);if(numColComponents===4){this._mesh._colors[0].push(colors[c0].a);}\nthis._mesh._colors[0].push(colors[c1].r);this._mesh._colors[0].push(colors[c1].g);this._mesh._colors[0].push(colors[c1].b);if(numColComponents===4){this._mesh._colors[0].push(colors[c1].a);}\nthis._mesh._colors[0].push(colors[c2].r);this._mesh._colors[0].push(colors[c2].g);this._mesh._colors[0].push(colors[c2].b);if(numColComponents===4){this._mesh._colors[0].push(colors[c2].a);}}\nif(hasTexCoord){this._mesh._texCoords[0].push(texCoords[t0].x);this._mesh._texCoords[0].push(texCoords[t0].y);if(numTexComponents===3){this._mesh._texCoords[0].push(texCoords[t0].z);}\nthis._mesh._texCoords[0].push(texCoords[t1].x);this._mesh._texCoords[0].push(texCoords[t1].y);if(numTexComponents===3){this._mesh._texCoords[0].push(texCoords[t1].z);}\nthis._mesh._texCoords[0].push(texCoords[t2].x);this._mesh._texCoords[0].push(texCoords[t2].y);if(numTexComponents===3){this._mesh._texCoords[0].push(texCoords[t2].z);}}\nbreak;default:}}\nif(!hasNormal){this._mesh.calcNormals(normPerVert?Math.PI:0);}\nif(!hasTexCoord){this._mesh.calcTexCoords(texMode);}\nthis._mesh.splitMesh();}\nelse\n{faceCnt=0;for(i=0;i<indexes.length;i++)\n{if((i>0)&&(i%3===0)){faceCnt++;}\nthis._mesh._indices[0].push(indexes[i]);if(!normPerVert&&hasNormal){this._mesh._normals[0].push(normals[faceCnt].x);this._mesh._normals[0].push(normals[faceCnt].y);this._mesh._normals[0].push(normals[faceCnt].z);}\nif(!colPerVert&&hasColor){this._mesh._colors[0].push(colors[faceCnt].r);this._mesh._colors[0].push(colors[faceCnt].g);this._mesh._colors[0].push(colors[faceCnt].b);if(numColComponents===4){this._mesh._colors[0].push(colors[faceCnt].a);}}}\nthis._mesh._positions[0]=positions.toGL();if(hasNormal){this._mesh._normals[0]=normals.toGL();}\nelse{this._mesh.calcNormals(normPerVert?Math.PI:0,ccw);}\nif(hasTexCoord){this._mesh._texCoords[0]=texCoords.toGL();this._mesh._numTexComponents=numTexComponents;}\nelse{this._mesh.calcTexCoords(texMode);}\nif(hasColor&&colPerVert){this._mesh._colors[0]=colors.toGL();this._mesh._numColComponents=numColComponents;}}\nthis.invalidateVolume();this._mesh._numFaces=0;this._mesh._numCoords=0;for(i=0;i<this._mesh._indices.length;i++){this._mesh._numFaces+=this._mesh._indices[i].length/3;this._mesh._numCoords+=this._mesh._positions[i].length/3;}\nvar time1=new Date().getTime()-time0;},fieldChanged:function(fieldName)\n{var pnts=this._cf.coord.node._vf.point;if(pnts.length>x3dom.Utils.maxIndexableCoords)\n{x3dom.debug.logWarning(\"IndexedTriangleSet: fieldChanged with \"+\"too many coordinates not yet implemented!\");return;}\nif(fieldName==\"coord\")\n{this._mesh._positions[0]=pnts.toGL();this.invalidateVolume();Array.forEach(this._parentNodes,function(node){node._dirty.positions=true;node.invalidateVolume();});}\nelse if(fieldName==\"color\")\n{pnts=this._cf.color.node._vf.color;if(this._vf.colorPerVertex){this._mesh._colors[0]=pnts.toGL();}else if(!this._vf.colorPerVertex){var faceCnt=0;var numColComponents=3;if(x3dom.isa(this._cf.color.node,x3dom.nodeTypes.ColorRGBA)){numColComponents=4;}\nthis._mesh._colors[0]=[];var indexes=this._vf.index;for(var i=0;i<indexes.length;++i)\n{if((i>0)&&(i%3===0)){faceCnt++;}\nthis._mesh._colors[0].push(pnts[faceCnt].r);this._mesh._colors[0].push(pnts[faceCnt].g);this._mesh._colors[0].push(pnts[faceCnt].b);if(numColComponents===4){this._mesh._colors[0].push(pnts[faceCnt].a);}}}\nArray.forEach(this._parentNodes,function(node){node._dirty.colors=true;});}\nelse if(fieldName==\"normal\")\n{pnts=this._cf.normal.node._vf.vector;if(this._vf.normalPerVertex){this._mesh._normals[0]=pnts.toGL();}else if(!this._vf.normalPerVertex){var indexes=this._vf.index;this._mesh._normals[0]=[];var faceCnt=0;for(var i=0;i<indexes.length;++i)\n{if((i>0)&&(i%3===0)){faceCnt++;}\nthis._mesh._normals[0].push(pnts[faceCnt].x);this._mesh._normals[0].push(pnts[faceCnt].y);this._mesh._normals[0].push(pnts[faceCnt].z);}}\nArray.forEach(this._parentNodes,function(node){node._dirty.normals=true;});}\nelse if(fieldName==\"texCoord\")\n{var texCoordNode=this._cf.texCoord.node;if(x3dom.isa(texCoordNode,x3dom.nodeTypes.MultiTextureCoordinate)){if(texCoordNode._cf.texCoord.nodes.length)\ntexCoordNode=texCoordNode._cf.texCoord.nodes[0];}\npnts=texCoordNode._vf.point;this._mesh._texCoords[0]=pnts.toGL();Array.forEach(this._parentNodes,function(node){node._dirty.texcoords=true;});}}}));x3dom.registerNodeType(\"IndexedTriangleStripSet\",\"Rendering\",defineClass(x3dom.nodeTypes.X3DComposedGeometryNode,function(ctx){x3dom.nodeTypes.IndexedTriangleStripSet.superClass.call(this,ctx);this.addField_MFInt32(ctx,'index',[]);this._hasIndexOffset=false;this._indexOffset=null;},{hasIndexOffset:function(){return this._hasIndexOffset;},nodeChanged:function()\n{this.handleAttribs();var hasNormal=false,hasTexCoord=false,hasColor=false;var colPerVert=this._vf.colorPerVertex;var normPerVert=this._vf.normalPerVertex;var indexes=this._vf.index;if(indexes.length&&indexes[indexes.length-1]!=-1)\n{indexes.push(-1);}\nvar positions,normals,texCoords,colors;var coordNode=this._cf.coord.node;x3dom.debug.assert(coordNode);positions=coordNode._vf.point;var normalNode=this._cf.normal.node;if(normalNode){hasNormal=true;normals=normalNode._vf.vector;}\nelse{hasNormal=false;}\nvar texMode=\"\",numTexComponents=2;var texCoordNode=this._cf.texCoord.node;if(x3dom.isa(texCoordNode,x3dom.nodeTypes.MultiTextureCoordinate)){if(texCoordNode._cf.texCoord.nodes.length)\ntexCoordNode=texCoordNode._cf.texCoord.nodes[0];}\nif(texCoordNode){if(texCoordNode._vf.point){hasTexCoord=true;texCoords=texCoordNode._vf.point;if(x3dom.isa(texCoordNode,x3dom.nodeTypes.TextureCoordinate3D)){numTexComponents=3;}}\nelse if(texCoordNode._vf.mode){texMode=texCoordNode._vf.mode;}}\nelse{hasTexCoord=false;}\nthis._mesh._numTexComponents=numTexComponents;var numColComponents=3;var colorNode=this._cf.color.node;if(colorNode){hasColor=true;colors=colorNode._vf.color;if(x3dom.isa(colorNode,x3dom.nodeTypes.ColorRGBA)){numColComponents=4;}}\nelse{hasColor=false;}\nthis._mesh._numColComponents=numColComponents;this._mesh._indices[0]=[];this._mesh._positions[0]=[];this._mesh._normals[0]=[];this._mesh._texCoords[0]=[];this._mesh._colors[0]=[];this.invalidateVolume();this._mesh._numFaces=0;this._mesh._numCoords=0;var faceCnt=0,cnt=0;if(hasNormal&&positions.length<=x3dom.Utils.maxIndexableCoords)\n{this._hasIndexOffset=true;this._indexOffset=[];this._mesh._primType='TRIANGLESTRIP';var i,indexOffset=[0];for(i=0;i<indexes.length;i++)\n{if(indexes[i]==-1){faceCnt++;indexOffset.push(this._mesh._indices[0].length);}\nelse{this._mesh._indices[0].push(+indexes[i]);if(!normPerVert){this._mesh._normals[0].push(normals[faceCnt].x);this._mesh._normals[0].push(normals[faceCnt].y);this._mesh._normals[0].push(normals[faceCnt].z);}\nif(!colPerVert){this._mesh._colors[0].push(colors[faceCnt].r);this._mesh._colors[0].push(colors[faceCnt].g);this._mesh._colors[0].push(colors[faceCnt].b);if(numColComponents===4){this._mesh._colors[0].push(colors[faceCnt].a);}}}}\nthis._mesh._positions[0]=positions.toGL();if(normPerVert){this._mesh._normals[0]=normals.toGL();}\nif(hasTexCoord){this._mesh._texCoords[0]=texCoords.toGL();this._mesh._numTexComponents=numTexComponents;}\nelse{x3dom.debug.logWarning(\"IndexedTriangleStripSet: no texCoords given and won't calculate!\");}\nif(hasColor){if(colPerVert){this._mesh._colors[0]=colors.toGL();}\nthis._mesh._numColComponents=numColComponents;}\nfor(i=1;i<indexOffset.length;i++){var triCnt=indexOffset[i]-indexOffset[i-1];this._indexOffset.push({count:triCnt,offset:2*indexOffset[i-1]});this._mesh._numFaces+=(triCnt-2);}\nthis._mesh._numCoords=this._mesh._positions[0].length/3;}\nelse\n{this._hasIndexOffset=false;var p1,p2,p3,n1,n2,n3,t1,t2,t3,c1,c2,c3;var swapOrder=false;for(var i=1;i<indexes.length-2;++i)\n{if(indexes[i+1]==-1){i=i+2;faceCnt++;continue;}\nif(swapOrder){p1=indexes[i];p2=indexes[i-1];p3=indexes[i+1];}\nelse{p1=indexes[i-1];p2=indexes[i];p3=indexes[i+1];}\nswapOrder=!swapOrder;if(normPerVert){n1=p1;n2=p2;n3=p3;}else\n{n1=n2=n3=faceCnt;}\nt1=p1;t2=p2;t3=p3;if(colPerVert){c1=p1;c2=p2;c3=p3;}else\n{c1=c2=c3=faceCnt;}\nthis._mesh._indices[0].push(cnt++,cnt++,cnt++);this._mesh._positions[0].push(positions[p1].x);this._mesh._positions[0].push(positions[p1].y);this._mesh._positions[0].push(positions[p1].z);this._mesh._positions[0].push(positions[p2].x);this._mesh._positions[0].push(positions[p2].y);this._mesh._positions[0].push(positions[p2].z);this._mesh._positions[0].push(positions[p3].x);this._mesh._positions[0].push(positions[p3].y);this._mesh._positions[0].push(positions[p3].z);if(hasNormal){this._mesh._normals[0].push(normals[n1].x);this._mesh._normals[0].push(normals[n1].y);this._mesh._normals[0].push(normals[n1].z);this._mesh._normals[0].push(normals[n2].x);this._mesh._normals[0].push(normals[n2].y);this._mesh._normals[0].push(normals[n2].z);this._mesh._normals[0].push(normals[n3].x);this._mesh._normals[0].push(normals[n3].y);this._mesh._normals[0].push(normals[n3].z);}\nif(hasColor){this._mesh._colors[0].push(colors[c1].r);this._mesh._colors[0].push(colors[c1].g);this._mesh._colors[0].push(colors[c1].b);if(numColComponents===4){this._mesh._colors[0].push(colors[c1].a);}\nthis._mesh._colors[0].push(colors[c2].r);this._mesh._colors[0].push(colors[c2].g);this._mesh._colors[0].push(colors[c2].b);if(numColComponents===4){this._mesh._colors[0].push(colors[c2].a);}\nthis._mesh._colors[0].push(colors[c3].r);this._mesh._colors[0].push(colors[c3].g);this._mesh._colors[0].push(colors[c3].b);if(numColComponents===4){this._mesh._colors[0].push(colors[c3].a);}}\nif(hasTexCoord){this._mesh._texCoords[0].push(texCoords[t1].x);this._mesh._texCoords[0].push(texCoords[t1].y);if(numTexComponents===3){this._mesh._texCoords[0].push(texCoords[t1].z);}\nthis._mesh._texCoords[0].push(texCoords[t2].x);this._mesh._texCoords[0].push(texCoords[t2].y);if(numTexComponents===3){this._mesh._texCoords[0].push(texCoords[t2].z);}\nthis._mesh._texCoords[0].push(texCoords[t3].x);this._mesh._texCoords[0].push(texCoords[t3].y);if(numTexComponents===3){this._mesh._texCoords[0].push(texCoords[t3].z);}}}\nif(!hasNormal){this._mesh.calcNormals(Math.PI);}\nif(!hasTexCoord){this._mesh.calcTexCoords(texMode);}\nthis._mesh.splitMesh();this.invalidateVolume();for(i=0;i<this._mesh._indices.length;i++){this._mesh._numFaces+=this._mesh._indices[i].length/3;this._mesh._numCoords+=this._mesh._positions[i].length/3;}}},fieldChanged:function(fieldName)\n{if(fieldName!=\"coord\"&&fieldName!=\"normal\"&&fieldName!=\"texCoord\"&&fieldName!=\"color\")\n{x3dom.debug.logWarning(\"IndexedTriangleStripSet: fieldChanged for \"+\nfieldName+\" not yet implemented!\");return;}\nvar pnts=this._cf.coord.node._vf.point;if((this._cf.normal.node===null)||(pnts.length>x3dom.Utils.maxIndexableCoords))\n{if(fieldName==\"coord\"){this._mesh._positions[0]=[];this._mesh._indices[0]=[];this._mesh._normals[0]=[];this._mesh._texCoords[0]=[];var hasNormal=false,hasTexCoord=false,hasColor=false;var colPerVert=this._vf.colorPerVertex;var normPerVert=this._vf.normalPerVertex;var indexes=this._vf.index;var positions,normals,texCoords,colors;var coordNode=this._cf.coord.node;x3dom.debug.assert(coordNode);positions=coordNode._vf.point;var normalNode=this._cf.normal.node;if(normalNode){hasNormal=true;normals=normalNode._vf.vector;}\nelse{hasNormal=false;}\nvar texMode=\"\",numTexComponents=2;var texCoordNode=this._cf.texCoord.node;if(x3dom.isa(texCoordNode,x3dom.nodeTypes.MultiTextureCoordinate)){if(texCoordNode._cf.texCoord.nodes.length)\ntexCoordNode=texCoordNode._cf.texCoord.nodes[0];}\nif(texCoordNode){if(texCoordNode._vf.point){hasTexCoord=true;texCoords=texCoordNode._vf.point;if(x3dom.isa(texCoordNode,x3dom.nodeTypes.TextureCoordinate3D)){numTexComponents=3;}}\nelse if(texCoordNode._vf.mode){texMode=texCoordNode._vf.mode;}}\nelse{hasTexCoord=false;}\nthis._mesh._numTexComponents=numTexComponents;var numColComponents=3;var colorNode=this._cf.color.node;if(colorNode){hasColor=true;colors=colorNode._vf.color;if(x3dom.isa(colorNode,x3dom.nodeTypes.ColorRGBA)){numColComponents=4;}}\nelse{hasColor=false;}\nthis._mesh._numColComponents=numColComponents;this._mesh._indices[0]=[];this._mesh._positions[0]=[];this._mesh._normals[0]=[];this._mesh._texCoords[0]=[];this._mesh._colors[0]=[];var faceCnt=0,cnt=0;var p1,p2,p3,n1,n2,n3,t1,t2,t3,c1,c2,c3;var swapOrder=false;if(hasNormal||hasTexCoord||hasColor){for(var i=1;i<indexes.length-2;++i)\n{if(indexes[i+1]==-1){i=i+2;faceCnt++;continue;}\nif(swapOrder){p1=indexes[i];p2=indexes[i-1];p3=indexes[i+1];}\nelse{p1=indexes[i-1];p2=indexes[i];p3=indexes[i+1];}\nswapOrder=!swapOrder;if(normPerVert){n1=p1;n2=p2;n3=p3;}else\n{n1=n2=n3=faceCnt;}\nt1=p1;t2=p2;t3=p3;if(colPerVert){c1=p1;c2=p2;c3=p3;}else\n{c1=c2=c3=faceCnt;}\nthis._mesh._indices[0].push(cnt++,cnt++,cnt++);this._mesh._positions[0].push(positions[p1].x);this._mesh._positions[0].push(positions[p1].y);this._mesh._positions[0].push(positions[p1].z);this._mesh._positions[0].push(positions[p2].x);this._mesh._positions[0].push(positions[p2].y);this._mesh._positions[0].push(positions[p2].z);this._mesh._positions[0].push(positions[p3].x);this._mesh._positions[0].push(positions[p3].y);this._mesh._positions[0].push(positions[p3].z);if(hasNormal){this._mesh._normals[0].push(normals[n1].x);this._mesh._normals[0].push(normals[n1].y);this._mesh._normals[0].push(normals[n1].z);this._mesh._normals[0].push(normals[n2].x);this._mesh._normals[0].push(normals[n2].y);this._mesh._normals[0].push(normals[n2].z);this._mesh._normals[0].push(normals[n3].x);this._mesh._normals[0].push(normals[n3].y);this._mesh._normals[0].push(normals[n3].z);}\nif(hasColor){this._mesh._colors[0].push(colors[c1].r);this._mesh._colors[0].push(colors[c1].g);this._mesh._colors[0].push(colors[c1].b);if(numColComponents===4){this._mesh._colors[0].push(colors[c1].a);}\nthis._mesh._colors[0].push(colors[c2].r);this._mesh._colors[0].push(colors[c2].g);this._mesh._colors[0].push(colors[c2].b);if(numColComponents===4){this._mesh._colors[0].push(colors[c2].a);}\nthis._mesh._colors[0].push(colors[c3].r);this._mesh._colors[0].push(colors[c3].g);this._mesh._colors[0].push(colors[c3].b);if(numColComponents===4){this._mesh._colors[0].push(colors[c3].a);}}\nif(hasTexCoord){this._mesh._texCoords[0].push(texCoords[t1].x);this._mesh._texCoords[0].push(texCoords[t1].y);if(numTexComponents===3){this._mesh._texCoords[0].push(texCoords[t1].z);}\nthis._mesh._texCoords[0].push(texCoords[t2].x);this._mesh._texCoords[0].push(texCoords[t2].y);if(numTexComponents===3){this._mesh._texCoords[0].push(texCoords[t2].z);}\nthis._mesh._texCoords[0].push(texCoords[t3].x);this._mesh._texCoords[0].push(texCoords[t3].y);if(numTexComponents===3){this._mesh._texCoords[0].push(texCoords[t3].z);}}}\nif(!hasNormal){this._mesh.calcNormals(Math.PI);}\nif(!hasTexCoord){this._mesh.calcTexCoords(texMode);}\nthis._mesh.splitMesh();}else{var swapOrder=false;for(var i=1;i<indexes.length;++i)\n{if(indexes[i+1]==-1){i=i+2;continue;}\nif(swapOrder){this._mesh._indices[0].push(indexes[i]);this._mesh._indices[0].push(indexes[i-1]);this._mesh._indices[0].push(indexes[i+1]);}\nelse{this._mesh._indices[0].push(indexes[i-1]);this._mesh._indices[0].push(indexes[i]);this._mesh._indices[0].push(indexes[i+1]);}\nswapOrder=!swapOrder;}\nthis._mesh._positions[0]=positions.toGL();this._mesh.calcNormals(Math.PI);this._mesh.calcTexCoords(texMode);}\nthis.invalidateVolume();this._mesh._numFaces=0;this._mesh._numCoords=0;for(i=0;i<this._mesh._indices.length;i++){this._mesh._numFaces+=this._mesh._indices[i].length/3;this._mesh._numCoords+=this._mesh._positions[i].length/3;}\nArray.forEach(this._parentNodes,function(node){node.setAllDirty();node.invalidateVolume();});}\nelse if(fieldName==\"color\"){var col=this._cf.color.node._vf.color;var faceCnt=0;var c1=c2=c3=0;var numColComponents=3;if(x3dom.isa(this._cf.color.node,x3dom.nodeTypes.ColorRGBA)){numColComponents=4;}\nthis._mesh._colors[0]=[];var indexes=this._vf.index;var swapOrder=false;for(i=1;i<indexes.length-2;++i)\n{if(indexes[i+1]==-1){i=i+2;faceCnt++;continue;}\nif(this._vf.colorPerVertex){if(swapOrder){c1=indexes[i];c2=indexes[i-1];c3=indexes[i+1];}\nelse{c1=indexes[i-1];c2=indexes[i];c3=indexes[i+1];}\nswapOrder=!swapOrder;}else if(!this._vf.colorPerVertex){c1=c2=c3=faceCnt;}\nthis._mesh._colors[0].push(col[c1].r);this._mesh._colors[0].push(col[c1].g);this._mesh._colors[0].push(col[c1].b);if(numColComponents===4){this._mesh._colors[0].push(col[c1].a);}\nthis._mesh._colors[0].push(col[c2].r);this._mesh._colors[0].push(col[c2].g);this._mesh._colors[0].push(col[c2].b);if(numColComponents===4){this._mesh._colors[0].push(col[c2].a);}\nthis._mesh._colors[0].push(col[c3].r);this._mesh._colors[0].push(col[c3].g);this._mesh._colors[0].push(col[c3].b);if(numColComponents===4){this._mesh._colors[0].push(col[c3].a);}}\nArray.forEach(this._parentNodes,function(node){node._dirty.colors=true;});}\nelse if(fieldName==\"normal\"){var nor=this._cf.normal.node._vf.vector;var faceCnt=0;var n1=n2=n3=0;this._mesh._normals[0]=[];var indexes=this._vf.index;var swapOrder=false;for(i=1;i<indexes.length-2;++i)\n{if(indexes[i+1]==-1){i=i+2;faceCnt++;continue;}\nif(this._vf.normalPerVertex){if(swapOrder){n1=indexes[i];n2=indexes[i-1];n3=indexes[i+1];}\nelse{n1=indexes[i-1];n2=indexes[i];n3=indexes[i+1];}\nswapOrder=!swapOrder;}else if(!this._vf.normalPerVertex){n1=n2=n3=faceCnt;}\nthis._mesh._normals[0].push(nor[n1].x);this._mesh._normals[0].push(nor[n1].y);this._mesh._normals[0].push(nor[n1].z);this._mesh._normals[0].push(nor[n2].x);this._mesh._normals[0].push(nor[n2].y);this._mesh._normals[0].push(nor[n2].z);this._mesh._normals[0].push(nor[n3].x);this._mesh._normals[0].push(nor[n3].y);this._mesh._normals[0].push(nor[n3].z);}\nArray.forEach(this._parentNodes,function(node){node._dirty.normals=true;});}\nelse if(fieldName==\"texCoord\"){var texCoordNode=this._cf.texCoord.node;if(x3dom.isa(texCoordNode,x3dom.nodeTypes.MultiTextureCoordinate)){if(texCoordNode._cf.texCoord.nodes.length)\ntexCoordNode=texCoordNode._cf.texCoord.nodes[0];}\nvar tex=texCoordNode._vf.point;var t1=t2=t3=0;var numTexComponents=2;if(x3dom.isa(texCoordNode,x3dom.nodeTypes.TextureCoordinate3D)){numTexComponents=3;}\nthis._mesh._texCoords[0]=[];var indexes=this._vf.index;var swapOrder=false;for(i=1;i<indexes.length-2;++i)\n{if(indexes[i+1]==-1){i=i+2;continue;}\nif(swapOrder){t1=indexes[i];t2=indexes[i-1];t3=indexes[i+1];}\nelse{t1=indexes[i-1];t2=indexes[i];t3=indexes[i+1];}\nswapOrder=!swapOrder;this._mesh._texCoords[0].push(tex[t1].x);this._mesh._texCoords[0].push(tex[t1].y);if(numTexComponents===3){this._mesh._texCoords[0].push(tex[t1].z);}\nthis._mesh._texCoords[0].push(tex[t2].x);this._mesh._texCoords[0].push(tex[t2].y);if(numTexComponents===3){this._mesh._texCoords[0].push(tex[t2].z);}\nthis._mesh._texCoords[0].push(tex[t3].x);this._mesh._texCoords[0].push(tex[t3].y);if(numTexComponents===3){this._mesh._texCoords[0].push(tex[t3].z);}}\nArray.forEach(this._parentNodes,function(node){node._dirty.texcoords=true;});}}\nelse\n{if(fieldName==\"coord\")\n{this._mesh._positions[0]=pnts.toGL();this.invalidateVolume();Array.forEach(this._parentNodes,function(node){node._dirty.positions=true;node.invalidateVolume();});}\nelse if(fieldName==\"color\")\n{pnts=this._cf.color.node._vf.color;if(this._vf.colorPerVertex){this._mesh._colors[0]=pnts.toGL();}else if(!this._vf.colorPerVertex){var faceCnt=0;var numColComponents=3;if(x3dom.isa(this._cf.color.node,x3dom.nodeTypes.ColorRGBA)){numColComponents=4;}\nthis._mesh._colors[0]=[];var indexes=this._vf.index;for(i=0;i<indexes.length;++i)\n{if(indexes[i]==-1){faceCnt++;continue;}\nthis._mesh._colors[0].push(pnts[faceCnt].r);this._mesh._colors[0].push(pnts[faceCnt].g);this._mesh._colors[0].push(pnts[faceCnt].b);if(numColComponents===4){this._mesh._colors[0].push(pnts[faceCnt].a);}}}\nArray.forEach(this._parentNodes,function(node){node._dirty.colors=true;});}\nelse if(fieldName==\"normal\")\n{pnts=this._cf.normal.node._vf.vector;if(this._vf.normalPerVertex){this._mesh._normals[0]=pnts.toGL();}else if(!this._vf.normalPerVertex){var indexes=this._vf.index;this._mesh._normals[0]=[];var faceCnt=0;for(i=0;i<indexes.length;++i)\n{if(indexes[i]==-1){faceCnt++;continue;}\nthis._mesh._normals[0].push(pnts[faceCnt].x);this._mesh._normals[0].push(pnts[faceCnt].y);this._mesh._normals[0].push(pnts[faceCnt].z);}}\nArray.forEach(this._parentNodes,function(node){node._dirty.normals=true;});}\nelse if(fieldName==\"texCoord\")\n{var texCoordNode=this._cf.texCoord.node;if(x3dom.isa(texCoordNode,x3dom.nodeTypes.MultiTextureCoordinate)){if(texCoordNode._cf.texCoord.nodes.length)\ntexCoordNode=texCoordNode._cf.texCoord.nodes[0];}\npnts=texCoordNode._vf.point;this._mesh._texCoords[0]=pnts.toGL();Array.forEach(this._parentNodes,function(node){node._dirty.texcoords=true;});}}}}));x3dom.registerNodeType(\"TriangleSet\",\"Rendering\",defineClass(x3dom.nodeTypes.X3DComposedGeometryNode,function(ctx){x3dom.nodeTypes.TriangleSet.superClass.call(this,ctx);},{_buildGeometry:function()\n{var colPerVert=this._vf.colorPerVertex;var normPerVert=this._vf.normalPerVertex;var ccw=this._vf.ccw;var hasNormal=false,hasTexCoord=false,hasColor=false;var positions,normals,texCoords,colors;var coordNode=this._cf.coord.node;x3dom.debug.assert(coordNode);if(!coordNode||coordNode._vf.point.length<3)\n{this._vf.render=false;return;}\npositions=coordNode._vf.point;var normalNode=this._cf.normal.node;if(normalNode){hasNormal=true;normals=normalNode._vf.vector;}\nelse{hasNormal=false;}\nvar texMode=\"\",numTexComponents=2;var texCoordNode=this._cf.texCoord.node;if(x3dom.isa(texCoordNode,x3dom.nodeTypes.MultiTextureCoordinate)){if(texCoordNode._cf.texCoord.nodes.length)\ntexCoordNode=texCoordNode._cf.texCoord.nodes[0];}\nif(texCoordNode){if(texCoordNode._vf.point){hasTexCoord=true;texCoords=texCoordNode._vf.point;if(x3dom.isa(texCoordNode,x3dom.nodeTypes.TextureCoordinate3D)){numTexComponents=3;}}\nelse if(texCoordNode._vf.mode){texMode=texCoordNode._vf.mode;}}\nelse{hasTexCoord=false;}\nvar numColComponents=3;var colorNode=this._cf.color.node;if(colorNode){hasColor=true;colors=colorNode._vf.color;if(x3dom.isa(colorNode,x3dom.nodeTypes.ColorRGBA)){numColComponents=4;}}\nelse{hasColor=false;}\nwhile(positions.length%3>0){positions.pop();}\nthis._mesh._indices[0]=new Array(positions.length);this._mesh._positions[0]=[];this._mesh._normals[0]=[];this._mesh._texCoords[0]=[];this._mesh._colors[0]=[];var posMax=positions.length/3;var faceCnt,i=0;for(faceCnt=0;faceCnt<posMax;faceCnt++)\n{this._mesh._indices[0][i]=i++;this._mesh._indices[0][i]=i++;this._mesh._indices[0][i]=i++;if(!normPerVert&&hasNormal){this._mesh._normals[0].push(normals[faceCnt].x);this._mesh._normals[0].push(normals[faceCnt].y);this._mesh._normals[0].push(normals[faceCnt].z);}\nif(!colPerVert&&hasColor){this._mesh._colors[0].push(colors[faceCnt].r);this._mesh._colors[0].push(colors[faceCnt].g);this._mesh._colors[0].push(colors[faceCnt].b);if(numColComponents===4){this._mesh._colors[0].push(colors[faceCnt].a);}}}\nthis._mesh._positions[0]=positions.toGL();if(hasNormal){this._mesh._normals[0]=normals.toGL();}\nelse{this._mesh.calcNormals(normPerVert?Math.PI:0,ccw);}\nif(hasTexCoord){this._mesh._texCoords[0]=texCoords.toGL();this._mesh._numTexComponents=numTexComponents;}\nelse{this._mesh.calcTexCoords(texMode);}\nif(hasColor&&colPerVert){this._mesh._colors[0]=colors.toGL();this._mesh._numColComponents=numColComponents;}\nthis._mesh._numFaces=posMax;this._mesh._numCoords=positions.length;this.invalidateVolume();},nodeChanged:function()\n{this._buildGeometry();},fieldChanged:function(fieldName)\n{if(fieldName==\"coord\")\n{this._buildGeometry();Array.forEach(this._parentNodes,function(node){node._dirty.positions=true;node.invalidateVolume();});}\nelse if(fieldName==\"color\")\n{this._buildGeometry();Array.forEach(this._parentNodes,function(node){node._dirty.colors=true;});}\nelse if(fieldName==\"normal\")\n{this._buildGeometry();Array.forEach(this._parentNodes,function(node){node._dirty.normals=true;});}\nelse if(fieldName==\"texCoord\")\n{this._buildGeometry();Array.forEach(this._parentNodes,function(node){node._dirty.texcoords=true;});}}}));x3dom.registerNodeType(\"X3DGeometricPropertyNode\",\"Rendering\",defineClass(x3dom.nodeTypes.X3DNode,function(ctx){x3dom.nodeTypes.X3DGeometricPropertyNode.superClass.call(this,ctx);}));x3dom.registerNodeType(\"X3DCoordinateNode\",\"Rendering\",defineClass(x3dom.nodeTypes.X3DGeometricPropertyNode,function(ctx){x3dom.nodeTypes.X3DCoordinateNode.superClass.call(this,ctx);},{fieldChanged:function(fieldName){if(fieldName===\"coord\"||fieldName===\"point\"){Array.forEach(this._parentNodes,function(node){node.fieldChanged(\"coord\");});}},parentAdded:function(parent){if(parent._mesh&&parent._cf.coord&&parent._cf.coord.node!==this){parent.fieldChanged(\"coord\");}}}));x3dom.registerNodeType(\"Coordinate\",\"Rendering\",defineClass(x3dom.nodeTypes.X3DCoordinateNode,function(ctx){x3dom.nodeTypes.Coordinate.superClass.call(this,ctx);this.addField_MFVec3f(ctx,'point',[]);},{getPoints:function(){return this._vf.point;}}));x3dom.registerNodeType(\"CoordinateDouble\",\"Nurbs\",defineClass(x3dom.nodeTypes.X3DCoordinateNode,function(ctx){x3dom.nodeTypes.CoordinateDouble.superClass.call(this,ctx);this.addField_MFVec3d(ctx,'point',[]);},{getPoints:function(){return this._vf.point;}}));x3dom.registerNodeType(\"Normal\",\"Rendering\",defineClass(x3dom.nodeTypes.X3DGeometricPropertyNode,function(ctx){x3dom.nodeTypes.Normal.superClass.call(this,ctx);this.addField_MFVec3f(ctx,'vector',[]);},{fieldChanged:function(fieldName){if(fieldName===\"normal\"||fieldName===\"vector\"){Array.forEach(this._parentNodes,function(node){node.fieldChanged(\"normal\");});}},parentAdded:function(parent){if(parent._mesh&&parent._cf.normal.node!==this){parent.fieldChanged(\"normal\");}}}));x3dom.registerNodeType(\"X3DColorNode\",\"Rendering\",defineClass(x3dom.nodeTypes.X3DGeometricPropertyNode,function(ctx){x3dom.nodeTypes.X3DColorNode.superClass.call(this,ctx);},{fieldChanged:function(fieldName){if(fieldName===\"color\"){Array.forEach(this._parentNodes,function(node){node.fieldChanged(\"color\");});}},parentAdded:function(parent){if(parent._mesh&&parent._cf.color.node!==this){parent.fieldChanged(\"color\");}}}));x3dom.registerNodeType(\"Color\",\"Rendering\",defineClass(x3dom.nodeTypes.X3DColorNode,function(ctx){x3dom.nodeTypes.Color.superClass.call(this,ctx);this.addField_MFColor(ctx,'color',[]);}));x3dom.registerNodeType(\"ColorRGBA\",\"Rendering\",defineClass(x3dom.nodeTypes.X3DColorNode,function(ctx){x3dom.nodeTypes.ColorRGBA.superClass.call(this,ctx);this.addField_MFColorRGBA(ctx,'color',[]);}));x3dom.registerNodeType(\"ParticleSet\",\"Rendering\",defineClass(x3dom.nodeTypes.PointSet,function(ctx){x3dom.nodeTypes.ParticleSet.superClass.call(this,ctx);this.addField_SFString(ctx,'mode','ViewDirQuads');this.addField_SFString(ctx,'drawOrder','Any');this.addField_SFNode('normal',x3dom.nodeTypes.Normal);this.addField_MFVec3f(ctx,'size',[]);this.addField_MFInt32(ctx,'index',[]);this.addField_MFFloat(ctx,'textureZ',[]);this._mesh._primType='POINTS';},{drawOrder:function(){return this._vf.drawOrder.toLowerCase();},nodeChanged:function()\n{var coordNode=this._cf.coord.node;x3dom.debug.assert(coordNode,\"ParticleSet without coord node!\");var positions=coordNode.getPoints();var numColComponents=3;var colorNode=this._cf.color.node;var colors=new x3dom.fields.MFColor();if(colorNode){colors=colorNode._vf.color;x3dom.debug.assert(positions.length==colors.length,\"Size of color and coord array differs!\");if(x3dom.isa(colorNode,x3dom.nodeTypes.ColorRGBA)){numColComponents=4;}}\nvar normalNode=this._cf.normal.node;var normals=new x3dom.fields.MFVec3f();if(normalNode){normals=normalNode._vf.vector;}\nvar indices=[];if(this.drawOrder()!=\"any\"){indices=this._vf.index.toGL();if(indices.length==0){var i,n=positions.length;indices=new Array(n);for(i=0;i<n;i++){indices[i]=i;}}}\nthis._mesh._numColComponents=numColComponents;this._mesh._lit=false;this._mesh._indices[0]=indices;this._mesh._positions[0]=positions.toGL();this._mesh._colors[0]=colors.toGL();this._mesh._normals[0]=normals.toGL();this._mesh._texCoords[0]=[];this.invalidateVolume();this._mesh._numCoords=this._mesh._positions[0].length/3;},fieldChanged:function(fieldName)\n{var pnts=null;if(fieldName==\"index\")\n{this._mesh._indices[0]=this._vf.index.toGL();Array.forEach(this._parentNodes,function(node){node._dirty.indexes=true;});}\nelse if(fieldName==\"size\")\n{Array.forEach(this._parentNodes,function(node){node._dirty.specialAttribs=true;});}\nelse if(fieldName==\"coord\")\n{pnts=this._cf.coord.node.getPoints();this._mesh._positions[0]=pnts.toGL();var indices=[];if(this.drawOrder()!=\"any\"){indices=this._vf.index.toGL();if(indices.length==0){var i,n=pnts.length;indices=new Array(n);for(i=0;i<n;i++){indices[i]=i;}}}\nthis._mesh._indices[0]=indices;this.invalidateVolume();Array.forEach(this._parentNodes,function(node){node._dirty.positions=true;node._dirty.indexes=true;node.invalidateVolume();});}\nelse if(fieldName==\"color\")\n{pnts=this._cf.color.node._vf.color;this._mesh._colors[0]=pnts.toGL();Array.forEach(this._parentNodes,function(node){node._dirty.colors=true;});}}}));x3dom.registerNodeType(\"ClipPlane\",\"Rendering\",defineClass(x3dom.nodeTypes.X3DChildNode,function(ctx){x3dom.nodeTypes.ClipPlane.superClass.call(this,ctx);this.addField_SFBool(ctx,'enabled',true);this.addField_SFVec4f(ctx,'plane',0,1,0,0);this.addField_SFFloat(ctx,'cappingStrength',0.0);this.addField_SFColor(ctx,'cappingColor',1.0,1.0,1.0);this.addField_SFBool(ctx,'on',true);},{fieldChanged:function(fieldName){if(fieldName==\"enabled\"||fieldName==\"on\"){}},nodeChanged:function(){x3dom.nodeTypes.ClipPlane.count++;},onRemove:function(){x3dom.nodeTypes.ClipPlane.count--;},parentAdded:function(parent){},parentRemoved:function(parent){}}));x3dom.nodeTypes.ClipPlane.count=0;x3dom.registerNodeType(\"X3DAppearanceNode\",\"Shape\",defineClass(x3dom.nodeTypes.X3DNode,function(ctx){x3dom.nodeTypes.X3DAppearanceNode.superClass.call(this,ctx);}));x3dom.registerNodeType(\"Appearance\",\"Shape\",defineClass(x3dom.nodeTypes.X3DAppearanceNode,function(ctx){x3dom.nodeTypes.Appearance.superClass.call(this,ctx);this.addField_SFNode('material',x3dom.nodeTypes.X3DMaterialNode);this.addField_SFNode('texture',x3dom.nodeTypes.X3DTextureNode);this.addField_SFNode('textureTransform',x3dom.nodeTypes.X3DTextureTransformNode);this.addField_SFNode('lineProperties',x3dom.nodeTypes.LineProperties);this.addField_SFNode('colorMaskMode',x3dom.nodeTypes.ColorMaskMode);this.addField_SFNode('blendMode',x3dom.nodeTypes.BlendMode);this.addField_SFNode('depthMode',x3dom.nodeTypes.DepthMode);this.addField_MFNode('shaders',x3dom.nodeTypes.X3DShaderNode);this.addField_SFString(ctx,'sortType','auto');this.addField_SFInt32(ctx,'sortKey',0);this.addField_SFFloat(ctx,'alphaClipThreshold',0.1);this._shader=null;},{fieldChanged:function(fieldName){if(fieldName==\"alphaClipThreshold\"){Array.forEach(this._parentNodes,function(shape){shape.setAppDirty();});}},nodeChanged:function(){if(!this._cf.material.node){}\nif(this._cf.shaders.nodes.length){this._shader=this._cf.shaders.nodes[0];}\nelse if(this._shader)\nthis._shader=null;Array.forEach(this._parentNodes,function(shape){shape.setAppDirty();});this.checkSortType();},checkSortType:function(){if(this._vf.sortType=='auto'){if(this._cf.material.node&&(this._cf.material.node._vf.transparency>0||this._cf.material.node._vf.backTransparency&&this._cf.material.node._vf.backTransparency>0)){this._vf.sortType='transparent';}\nelse if(this._cf.texture.node&&this._cf.texture.node._vf.url.length){if(this._cf.texture.node._vf.url[0].toLowerCase().indexOf('.'+'png')>=0){this._vf.sortType='transparent';}\nelse{this._vf.sortType='opaque';}}\nelse if(x3dom.isa(this._cf.material.node,x3dom.nodeTypes.PhysicalMaterial))\n{var material=this._cf.material.node;if(material._vf.alphaMode==\"OPAQUE\")\n{this._vf.sortType='opaque';}\nelse if(material._vf.alphaMode==\"BLEND\"||material._vf.alphaMode==\"MASK\")\n{this._vf.sortType='transparent';}\nvar baseColorTexture=material._cf.baseColorTexture.node;if(this._vf.sortType=='opaque'&&baseColorTexture&&baseColorTexture._vf.url.length&&baseColorTexture._vf.url[0].toLowerCase().indexOf('.png')>=0)\n{this._vf.sortType='transparent';}}\nelse{this._vf.sortType='opaque';}}},texTransformMatrix:function(){if(this._cf.textureTransform.node===null){return x3dom.fields.SFMatrix4f.identity();}\nelse{return this._cf.textureTransform.node.texTransformMatrix();}},parentAdded:function(parent){if(this!=x3dom.nodeTypes.Appearance._defaultNode){parent.setAppDirty();}}}));x3dom.nodeTypes.Appearance.defaultNode=function(){if(!x3dom.nodeTypes.Appearance._defaultNode){x3dom.nodeTypes.Appearance._defaultNode=new x3dom.nodeTypes.Appearance();x3dom.nodeTypes.Appearance._defaultNode.nodeChanged();}\nreturn x3dom.nodeTypes.Appearance._defaultNode;};x3dom.registerNodeType(\"X3DAppearanceChildNode\",\"Shape\",defineClass(x3dom.nodeTypes.X3DNode,function(ctx){x3dom.nodeTypes.X3DAppearanceChildNode.superClass.call(this,ctx);}));x3dom.registerNodeType(\"BlendMode\",\"Shape\",defineClass(x3dom.nodeTypes.X3DAppearanceChildNode,function(ctx){x3dom.nodeTypes.BlendMode.superClass.call(this,ctx);this.addField_SFString(ctx,'srcFactor',\"src_alpha\");this.addField_SFString(ctx,'destFactor',\"one_minus_src_alpha\");this.addField_SFColor(ctx,'color',1,1,1);this.addField_SFFloat(ctx,'colorTransparency',0);this.addField_SFString(ctx,'alphaFunc',\"none\");this.addField_SFFloat(ctx,'alphaFuncValue',0);this.addField_SFString(ctx,'equation',\"none\");}));x3dom.registerNodeType(\"DepthMode\",\"Shape\",defineClass(x3dom.nodeTypes.X3DAppearanceChildNode,function(ctx){x3dom.nodeTypes.DepthMode.superClass.call(this,ctx);this.addField_SFBool(ctx,'enableDepthTest',true);this.addField_SFString(ctx,'depthFunc',\"none\");this.addField_SFBool(ctx,'readOnly',false);this.addField_SFFloat(ctx,'zNearRange',-1);this.addField_SFFloat(ctx,'zFarRange',-1);}));x3dom.registerNodeType(\"ColorMaskMode\",\"Shape\",defineClass(x3dom.nodeTypes.X3DAppearanceChildNode,function(ctx){x3dom.nodeTypes.ColorMaskMode.superClass.call(this,ctx);this.addField_SFBool(ctx,'maskR',true);this.addField_SFBool(ctx,'maskG',true);this.addField_SFBool(ctx,'maskB',true);this.addField_SFBool(ctx,'maskA',true);}));x3dom.registerNodeType(\"LineProperties\",\"Shape\",defineClass(x3dom.nodeTypes.X3DAppearanceChildNode,function(ctx){x3dom.nodeTypes.LineProperties.superClass.call(this,ctx);this.addField_SFBool(ctx,'applied',true);this.addField_SFInt32(ctx,'linetype',1);this.addField_SFFloat(ctx,'linewidthScaleFactor',0);}));x3dom.registerNodeType(\"X3DMaterialNode\",\"Shape\",defineClass(x3dom.nodeTypes.X3DAppearanceChildNode,function(ctx){x3dom.nodeTypes.X3DMaterialNode.superClass.call(this,ctx);}));x3dom.registerNodeType(\"Material\",\"Shape\",defineClass(x3dom.nodeTypes.X3DMaterialNode,function(ctx){x3dom.nodeTypes.Material.superClass.call(this,ctx);this.addField_SFFloat(ctx,'ambientIntensity',0.2);this.addField_SFColor(ctx,'diffuseColor',0.8,0.8,0.8);this.addField_SFColor(ctx,'emissiveColor',0,0,0);this.addField_SFFloat(ctx,'shininess',0.2);this.addField_SFColor(ctx,'specularColor',0,0,0);this.addField_SFFloat(ctx,'transparency',0);},{fieldChanged:function(fieldName){if(fieldName==\"ambientIntensity\"||fieldName==\"diffuseColor\"||fieldName==\"emissiveColor\"||fieldName==\"shininess\"||fieldName==\"specularColor\"||fieldName==\"transparency\")\n{Array.forEach(this._parentNodes,function(app){Array.forEach(app._parentNodes,function(shape){shape._dirty.material=true;});app.checkSortType();});}}}));x3dom.nodeTypes.Material.defaultNode=function(){if(!x3dom.nodeTypes.Material._defaultNode){x3dom.nodeTypes.Material._defaultNode=new x3dom.nodeTypes.Material();x3dom.nodeTypes.Material._defaultNode.nodeChanged();}\nreturn x3dom.nodeTypes.Material._defaultNode;};x3dom.registerNodeType(\"TwoSidedMaterial\",\"Shape\",defineClass(x3dom.nodeTypes.Material,function(ctx){x3dom.nodeTypes.TwoSidedMaterial.superClass.call(this,ctx);this.addField_SFFloat(ctx,'backAmbientIntensity',0.2);this.addField_SFColor(ctx,'backDiffuseColor',0.8,0.8,0.8);this.addField_SFColor(ctx,'backEmissiveColor',0,0,0);this.addField_SFFloat(ctx,'backShininess',0.2);this.addField_SFColor(ctx,'backSpecularColor',0,0,0);this.addField_SFFloat(ctx,'backTransparency',0);this.addField_SFBool(ctx,'separateBackColor',false);},{fieldChanged:function(fieldName){if(fieldName==\"ambientIntensity\"||fieldName==\"diffuseColor\"||fieldName==\"emissiveColor\"||fieldName==\"shininess\"||fieldName==\"specularColor\"||fieldName==\"transparency\"||fieldName==\"backAmbientIntensity\"||fieldName==\"backDiffuseColor\"||fieldName==\"backEmissiveColor\"||fieldName==\"backShininess\"||fieldName==\"backSpecularColor\"||fieldName==\"backTransparency\"||fieldName==\"separateBackColor\")\n{Array.forEach(this._parentNodes,function(app){Array.forEach(app._parentNodes,function(shape){shape._dirty.material=true;});app.checkSortType();});}}}));x3dom.registerNodeType(\"PhysicalMaterial\",\"Shape\",defineClass(x3dom.nodeTypes.X3DMaterialNode,function(ctx){x3dom.nodeTypes.X3DMaterialNode.superClass.call(this,ctx);this.addField_SFString(ctx,'model',\"roughnessMetallic\");this.addField_SFColorRGBA(ctx,'baseColorFactor',1,1,1,1);this.addField_SFFloat(ctx,'metallicFactor',0);this.addField_SFFloat(ctx,'roughnessFactor',0.2);this.addField_SFColorRGBA(ctx,'diffuseFactor',1,1,1,1);this.addField_SFColor(ctx,'specularFactor',1,1,1);this.addField_SFFloat(ctx,'glossinessFactor',1);this.addField_SFColor(ctx,'emissiveFactor',0,0,0);this.addField_SFString(ctx,'normalSpace','TANGENT');this.addField_SFString(ctx,'alphaMode','OPAQUE');this.addField_SFFloat(ctx,'alphaCutoff',0.5);this.addField_SFVec3f(ctx,'normalBias',-1,-1,1);this.addField_SFFloat(ctx,'normalScale',1);this.addField_SFBool(ctx,'unlit',false);this.addField_SFNode('baseColorTexture',x3dom.nodeTypes.X3DTextureNode);this.addField_SFNode('emissiveTexture',x3dom.nodeTypes.X3DTextureNode);this.addField_SFNode('roughnessMetallicTexture',x3dom.nodeTypes.X3DTextureNode);this.addField_SFNode('specularGlossinessTexture',x3dom.nodeTypes.X3DTextureNode);this.addField_SFNode('occlusionRoughnessMetallicTexture',x3dom.nodeTypes.X3DTextureNode);this.addField_SFNode('normalTexture',x3dom.nodeTypes.X3DTextureNode);this.addField_SFNode('occlusionTexture',x3dom.nodeTypes.X3DTextureNode);},{fieldChanged:function(fieldName)\n{if(fieldName==\"baseColorFactor\"||fieldName==\"metallicFactor\"||fieldName==\"roughnessFactor\"||fieldName==\"emissiveFactor\")\n{Array.forEach(this._parentNodes,function(app){Array.forEach(app._parentNodes,function(shape){shape._dirty.material=true;});app.checkSortType();});}\nif(fieldName==\"alphaMode\")\n{Array.forEach(this._parentNodes,function(app){Array.forEach(app._parentNodes,function(shape){shape._dirty.shader=true;});app.checkSortType();});}},hasTextures:function()\n{return(this._cf.baseColorTexture.node||this._cf.normalTexture.node||this._cf.occlusionTexture.node||this._cf.emissiveTexture.node||this._cf.roughnessMetallicTexture.node);},getTextures:function()\n{var textures=[];if(this._cf.baseColorTexture.node)\n{this._cf.baseColorTexture.node._type=\"diffuseMap\";textures.push(this._cf.baseColorTexture.node);}\nif(this._cf.normalTexture.node)\n{this._cf.normalTexture.node._type=\"normalMap\";textures.push(this._cf.normalTexture.node);}\nif(this._cf.occlusionTexture.node)\n{this._cf.occlusionTexture.node._type=\"occlusionMap\";textures.push(this._cf.occlusionTexture.node);}\nif(this._cf.emissiveTexture.node)\n{this._cf.emissiveTexture.node._type=\"emissiveMap\";textures.push(this._cf.emissiveTexture.node);}\nif(this._cf.roughnessMetallicTexture.node)\n{this._cf.roughnessMetallicTexture.node._type=\"roughnessMetallicMap\";textures.push(this._cf.roughnessMetallicTexture.node);}\nif(this._cf.specularGlossinessTexture.node)\n{this._cf.specularGlossinessTexture.node._type=\"specularGlossinessMap\";textures.push(this._cf.specularGlossinessTexture.node);}\nif(this._cf.occlusionRoughnessMetallicTexture.node)\n{this._cf.occlusionRoughnessMetallicTexture.node._type=\"occlusionRoughnessMetallicMap\";textures.push(this._cf.occlusionRoughnessMetallicTexture.node);}\nreturn textures;}}));x3dom.registerNodeType(\"X3DShapeNode\",\"Shape\",defineClass(x3dom.nodeTypes.X3DBoundedObject,function(ctx){x3dom.nodeTypes.X3DShapeNode.superClass.call(this,ctx);this.addField_SFBool(ctx,'isPickable',true);this.addField_SFInt32(ctx,'idOffset',0);this.addField_SFNode('appearance',x3dom.nodeTypes.X3DAppearanceNode);this.addField_SFNode('geometry',x3dom.nodeTypes.X3DGeometryNode);this._objectID=0;this._shaderProperties=null;this._clipPlanes=[];this._cleanupGLObjects=null;this._dirty={positions:true,normals:true,texcoords:true,colors:true,tangents:true,binormals:true,specialAttribs:true,indexes:true,texture:true,material:true,text:true,shader:true,ids:true};this._indexOffset=0;this._coordStrideOffset=[0,0];this._normalStrideOffset=[0,0];this._texCoordStrideOffset=[0,0];this._texCoord2StrideOffset=[0,0];this._colorStrideOffset=[0,0];this._idStrideOffset=[0,0];this._tangentStrideOffset=[0,0];this._binormalStrideOffset=[0,0];this._tessellationProperties=[];},{collectDrawableObjects:function(transform,drawableCollection,singlePath,invalidateCache,planeMask,clipPlanes)\n{var graphState=this.graphState();if(singlePath&&(this._parentNodes.length>1))\nsinglePath=false;if(singlePath&&(invalidateCache=invalidateCache||this.cacheInvalid()))\nthis.invalidateCache();if(!this._cf.geometry.node||drawableCollection.cull(transform,graphState,singlePath,planeMask)<=0){return false;}\nif(singlePath&&!this._graph.globalMatrix)\nthis._graph.globalMatrix=transform;if(this._clipPlanes.length!=clipPlanes.length)\n{this._dirty.shader=true;}\nthis._clipPlanes=clipPlanes;drawableCollection.addShape(this,transform,graphState);return true;},getVolume:function()\n{var vol=this._graph.volume;if(!this.volumeValid()&&this._vf.render)\n{var geo=this._cf.geometry.node;var childVol=geo?geo.getVolume():null;if(childVol&&childVol.isValid())\nvol.extendBounds(childVol.min,childVol.max);}\nreturn vol;},getCenter:function(){var geo=this._cf.geometry.node;return(geo?geo.getCenter():new x3dom.fields.SFVec3f(0,0,0));},getDiameter:function(){var geo=this._cf.geometry.node;return(geo?geo.getDiameter():0);},doIntersect:function(line){return this._cf.geometry.node.doIntersect(line);},forceUpdateCoverage:function()\n{var geo=this._cf.geometry.node;return(geo?geo.forceUpdateCoverage():false);},tessellationProperties:function()\n{var geo=this._cf.geometry.node;if(geo&&geo._indexOffset)\nreturn geo._indexOffset;else\nreturn this._tessellationProperties;},isLit:function(){return this._cf.geometry.node._vf.lit;},isSolid:function(){var twoSidedMat=(this._cf.appearance.node&&this._cf.appearance.node._cf.material.node&&x3dom.isa(this._cf.appearance.node._cf.material.node,x3dom.nodeTypes.TwoSidedMaterial));return this._cf.geometry.node._vf.solid&&!twoSidedMat;},isCCW:function(){return this._cf.geometry.node._vf.ccw;},parentRemoved:function(parent){for(var i=0,n=this._childNodes.length;i<n;i++){var child=this._childNodes[i];if(child){child.parentRemoved(this);}}\nif(parent)\nparent.invalidateVolume();if(this._parentNodes.length>0)\nthis.invalidateVolume();if(this._cleanupGLObjects){this._cleanupGLObjects();}},unsetDirty:function(){this._dirty.positions=false;this._dirty.normals=false;this._dirty.texcoords=false;this._dirty.colors=false;this._dirty.tangents=false;this._dirty.binormals=false;this._dirty.specialAttribs=false;this._dirty.indexes=false;this._dirty.texture=false;this._dirty.material=false;this._dirty.text=false;this._dirty.shader=false;},unsetGeoDirty:function(){this._dirty.positions=false;this._dirty.normals=false;this._dirty.texcoords=false;this._dirty.colors=false;this._dirty.tangents=false;this._dirty.binormals=false;this._dirty.specialAttribs=false;this._dirty.indexes=false;},setAllDirty:function(){this._dirty.positions=true;this._dirty.normals=true;this._dirty.texcoords=true;this._dirty.colors=true;this._dirty.tangents=true;this._dirty.binormals=true;this._dirty.specialAttribs=true;this._dirty.indexes=true;this._dirty.texture=true;this._dirty.material=true;this._dirty.text=true;this._dirty.shader=true;this.invalidateVolume();},setAppDirty:function(){this._dirty.texture=true;this._dirty.material=true;this._dirty.shader=true;},setGeoDirty:function(){this._dirty.positions=true;this._dirty.normals=true;this._dirty.texcoords=true;this._dirty.colors=true;this._dirty.tangents=true;this._dirty.binormals=true;this._dirty.specialAttribs=true;this._dirty.indexes=true;this.invalidateVolume();},getShaderProperties:function(viewarea)\n{if(this._shaderProperties==null||this._dirty.shader==true||x3dom.Utils.checkDirtyEnvironment(viewarea,this._shaderProperties)||x3dom.Utils.checkDirtyPhysicalEnvironmentLight(viewarea,this._shaderProperties)||(this._webgl!==undefined&&this._webgl.dirtyLighting!=x3dom.Utils.checkDirtyLighting(viewarea)))\n{this._shaderProperties=x3dom.Utils.generateProperties(viewarea,this);this._dirty.shader=false;if(this._webgl!==undefined)\n{this._webgl.dirtyLighting=x3dom.Utils.checkDirtyLighting(viewarea);}}\nreturn this._shaderProperties;},getTextures:function(){var textures=[];var appearance=this._cf.appearance.node;if(appearance){var tex=appearance._cf.texture.node;if(tex){if(x3dom.isa(tex,x3dom.nodeTypes.MultiTexture)){textures=textures.concat(tex.getTextures());}\nelse{textures.push(tex);}}\nvar shader=appearance._cf.shaders.nodes[0];if(shader){if(x3dom.isa(shader,x3dom.nodeTypes.CommonSurfaceShader)){textures=textures.concat(shader.getTextures());}}\nvar material=appearance._cf.material.node;if(material){if(x3dom.isa(material,x3dom.nodeTypes.PhysicalMaterial)){textures=textures.concat(material.getTextures());}}}\nvar geometry=this._cf.geometry.node;if(geometry){if(x3dom.isa(geometry,x3dom.nodeTypes.ImageGeometry)){textures=textures.concat(geometry.getTextures());}\nelse if(x3dom.isa(geometry,x3dom.nodeTypes.Text)){textures=textures.concat(geometry);}}\nreturn textures;}}));x3dom.registerNodeType(\"Shape\",\"Shape\",defineClass(x3dom.nodeTypes.X3DShapeNode,function(ctx){x3dom.nodeTypes.Shape.superClass.call(this,ctx);},{nodeChanged:function(){if(!this._cf.appearance.node){}\nif(!this._cf.geometry.node){if(this._DEF)\nx3dom.debug.logError(\"No geometry given in Shape/\"+this._DEF);}\nelse if(!this._objectID){this._objectID=++x3dom.nodeTypes.Shape.objectID;x3dom.nodeTypes.Shape.idMap.nodeID[this._objectID]=this;}\nthis.setAllDirty();}}));x3dom.nodeTypes.Shape.shaderPartID=0;x3dom.nodeTypes.Shape.objectID=0;x3dom.nodeTypes.Shape.idMap={nodeID:{},remove:function(obj){for(var prop in this.nodeID){if(this.nodeID.hasOwnProperty(prop)){var val=this.nodeID[prop];if(val._objectID&&obj._objectID&&val._objectID===obj._objectID)\n{delete this.nodeID[prop];x3dom.debug.logInfo(\"Unreg \"+val._objectID);}}}}};x3dom.registerNodeType(\"ExternalShape\",\"Shape\",defineClass(x3dom.nodeTypes.X3DShapeNode,function(ctx){x3dom.nodeTypes.ExternalShape.superClass.call(this,ctx);this.addField_MFString(ctx,'url',[]);this._currentURLIdx=0;this._cf.geometry.node=new x3dom.nodeTypes.X3DSpatialGeometryNode(ctx);this.loaded=false;},{update:function(shape,shaderProgram,gl,viewarea,context){var that=this;if(this._vf['url'].length==0||this._currentURLIdx>=this._vf['url'].length)\n{return;}\nvar url=this._nameSpace.getURL(this._vf['url'][this._currentURLIdx]);var encoding=(url.indexOf(\"glb\")!=-1)?\"binary\":\"ascii\";var baseURL=this._nameSpace.baseURL;var index=url.lastIndexOf(\"/\");if(index!=-1)\n{baseURL+=url.substr(0,index+1);}\nvar xhr=new XMLHttpRequest();xhr.open(\"GET\",this._nameSpace.getURL(this._vf['url'][this._currentURLIdx]),true);xhr.responseType=(encoding==\"binary\")?\"arraybuffer\":\"json\";xhr.send(null);xhr.onerror=function(){x3dom.debug.logError(\"Unable to load SRC data from URL \\\"\"+that._vf['url'][that._currentURLIdx]+\"\\\"\");};xhr.onload=function(){if((xhr.status==200||xhr.status==0)){var glTF=new x3dom.glTF.glTFLoader(false,encoding,baseURL);glTF.load(xhr.response,function()\n{if(glTF.header.sceneLength>0)\n{that.glTF=glTF;var url=that._vf['url'][that._currentURLIdx];if(url.includes('#'))\n{var split=url.split('#');var meshName=split[split.length-1];glTF.getMesh(shape,shaderProgram,gl,meshName);}\nelse\n{glTF.getScene(shape,shaderProgram,gl);}\nfor(var key in glTF._mesh){if(!glTF._mesh.hasOwnProperty(key))continue;that._cf.geometry.node._mesh[key]=glTF._mesh[key];}}\nelse\n{if((that._currentURLIdx+1)<that._vf['url'].length)\n{x3dom.debug.logWarning(\"Invalid SRC data, loaded from URL \\\"\"+\nthat._vf['url'][that._currentURLIdx]+\"\\\", trying next specified URL\");++that._currentURLIdx;that.update(shape,shaderProgram,gl,viewarea,context);}\nelse\n{x3dom.debug.logError(\"Invalid SRC data, loaded from URL \\\"\"+\nthat._vf['url'][that._currentURLIdx]+\"\\\",\"+\" no other URLs left to try.\");}}\nvar theScene=that._nameSpace.doc._scene;if(theScene){theScene.invalidateVolume();window.setTimeout(function(){that.invalidateVolume();theScene.updateVolume();that._nameSpace.doc.needRender=true;});}});}\nelse\n{if((that._currentURLIdx+1)<that._vf['url'].length)\n{x3dom.debug.logWarning(\"Invalid SRC data, loaded from URL \\\"\"+\nthat._vf['url'][that._currentURLIdx]+\"\\\", trying next specified URL\");++that._currentURLIdx;that.update(shape,shaderProgram,gl,viewarea,context);}\nelse\n{x3dom.debug.logError(\"Invalid SRC data, loaded from URL \\\"\"+\nthat._vf['url'][that._currentURLIdx]+\"\\\",\"+\" no other URLs left to try.\");}}};},collectDrawableObjects:function(transform,drawableCollection,singlePath,invalidateCache,planeMask,clipPlanes)\n{var graphState=this.graphState();if(singlePath&&(this._parentNodes.length>1))\nsinglePath=false;if(singlePath&&(invalidateCache=invalidateCache||this.cacheInvalid()))\nthis.invalidateCache();if(singlePath&&!this._graph.globalMatrix)\nthis._graph.globalMatrix=transform;if(this._clipPlanes.length!=clipPlanes.length)\n{this._dirty.shader=true;}\nthis._clipPlanes=clipPlanes;drawableCollection.addShape(this,transform,graphState);return true;},getShaderProperties:function(viewarea)\n{var properties=x3dom.Utils.generateProperties(viewarea,this);properties.CSHADER=-1;properties.LIGHTS=viewarea.getLights().length+(viewarea._scene.getNavigationInfo()._vf.headlight);properties.EMPTY_SHADER=1;return properties;},nodeChanged:function()\n{if(!this._objectID){this._objectID=++x3dom.nodeTypes.Shape.objectID;x3dom.nodeTypes.Shape.idMap.nodeID[this._objectID]=this;}}}));x3dom.registerNodeType(\"X3DLightNode\",\"Lighting\",defineClass(x3dom.nodeTypes.X3DChildNode,function(ctx){x3dom.nodeTypes.X3DLightNode.superClass.call(this,ctx);if(ctx)\nctx.doc._nodeBag.lights.push(this);else\nx3dom.debug.logWarning(\"X3DLightNode: No runtime context found!\");this._lightID=0;this._dirty=true;this.addField_SFFloat(ctx,'ambientIntensity',0);this.addField_SFColor(ctx,'color',1,1,1);this.addField_SFFloat(ctx,'intensity',1);this.addField_SFBool(ctx,'global',false);this.addField_SFBool(ctx,'on',true);this.addField_SFFloat(ctx,'shadowIntensity',0);this.addField_SFInt32(ctx,'shadowMapSize',1024);this.addField_SFInt32(ctx,'shadowFilterSize',0);this.addField_SFFloat(ctx,'shadowOffset',0);this.addField_SFFloat(ctx,'zNear',-1);this.addField_SFFloat(ctx,'zFar',-1);},{getViewMatrix:function(vec){return x3dom.fields.SFMatrix4f.identity;},nodeChanged:function(){if(!this._lightID){this._lightID=++x3dom.nodeTypes.X3DLightNode.lightID;}},fieldChanged:function(fieldName)\n{if(this._vf.hasOwnProperty(fieldName)){this._dirty=true;}},parentRemoved:function(parent)\n{if(this._parentNodes.length===1&&this._parentNodes[0]==parent){var doc=this.findX3DDoc();for(var i=0,n=doc._nodeBag.lights.length;i<n;i++){if(doc._nodeBag.lights[i]===this){doc._nodeBag.lights.splice(i,1);}}}},onRemove:function()\n{}}));x3dom.nodeTypes.X3DLightNode.lightID=0;x3dom.registerNodeType(\"DirectionalLight\",\"Lighting\",defineClass(x3dom.nodeTypes.X3DLightNode,function(ctx){x3dom.nodeTypes.DirectionalLight.superClass.call(this,ctx);this.addField_SFVec3f(ctx,'direction',0,0,-1);this.addField_SFInt32(ctx,'shadowCascades',1);this.addField_SFFloat(ctx,'shadowSplitFactor',1);this.addField_SFFloat(ctx,'shadowSplitOffset',0.1);},{getViewMatrix:function(vec){var dir=this.getCurrentTransform().multMatrixVec(this._vf.direction).normalize();var orientation=x3dom.fields.Quaternion.rotateFromTo(new x3dom.fields.SFVec3f(0,0,-1),dir);return orientation.toMatrix().transpose().mult(x3dom.fields.SFMatrix4f.translation(vec.negate()));}}));x3dom.registerNodeType(\"PointLight\",\"Lighting\",defineClass(x3dom.nodeTypes.X3DLightNode,function(ctx){x3dom.nodeTypes.PointLight.superClass.call(this,ctx);this.addField_SFVec3f(ctx,'attenuation',1,0,0);this.addField_SFVec3f(ctx,'location',0,0,0);this.addField_SFFloat(ctx,'radius',100);this._vf.global=true;},{getViewMatrix:function(vec){var pos=this.getCurrentTransform().multMatrixPnt(this._vf.location);var orientation=x3dom.fields.Quaternion.rotateFromTo(new x3dom.fields.SFVec3f(0,0,-1),vec);return orientation.toMatrix().transpose().mult(x3dom.fields.SFMatrix4f.translation(pos.negate()));}}));x3dom.registerNodeType(\"SpotLight\",\"Lighting\",defineClass(x3dom.nodeTypes.X3DLightNode,function(ctx){x3dom.nodeTypes.SpotLight.superClass.call(this,ctx);this.addField_SFVec3f(ctx,'direction',0,0,-1);this.addField_SFVec3f(ctx,'attenuation',1,0,0);this.addField_SFVec3f(ctx,'location',0,0,0);this.addField_SFFloat(ctx,'radius',100);this.addField_SFFloat(ctx,'beamWidth',1.5707963);this.addField_SFFloat(ctx,'cutOffAngle',1.5707963);this.addField_SFInt32(ctx,'shadowCascades',1);this.addField_SFFloat(ctx,'shadowSplitFactor',1);this.addField_SFFloat(ctx,'shadowSplitOffset',0.1);this._vf.global=true;},{getViewMatrix:function(vec){var pos=this.getCurrentTransform().multMatrixPnt(this._vf.location);var dir=this.getCurrentTransform().multMatrixVec(this._vf.direction).normalize();var orientation=x3dom.fields.Quaternion.rotateFromTo(new x3dom.fields.SFVec3f(0,0,-1),dir);return orientation.toMatrix().transpose().mult(x3dom.fields.SFMatrix4f.translation(pos.negate()));}}));x3dom.registerNodeType(\"PhysicalEnvironmentLight\",\"Lighting\",defineClass(x3dom.nodeTypes.X3DLightNode,function(ctx){x3dom.nodeTypes.PhysicalEnvironmentLight.superClass.call(this,ctx);this.addField_SFVec3f(ctx,'direction',0,0,-1);this.addField_SFString(ctx,'diffuse',\"https://x3dom.org/download/assets/pbr/papermillDiffuse.dds\");this.addField_SFString(ctx,'specular',\"https://x3dom.org/download/assets/pbr/papermillSpecular.dds\");this.addField_SFInt32(ctx,'shadowCascades',1);this.addField_SFFloat(ctx,'shadowSplitFactor',1);this.addField_SFFloat(ctx,'shadowSplitOffset',0.1);},{fieldChanged:function(fieldName)\n{if(fieldName==\"diffuse\"||fieldName==\"specular\"){}},getViewMatrix:function(vec){var dir=this.getCurrentTransform().multMatrixVec(this._vf.direction).normalize();var orientation=x3dom.fields.Quaternion.rotateFromTo(new x3dom.fields.SFVec3f(0,0,-1),dir);return orientation.toMatrix().transpose().mult(x3dom.fields.SFMatrix4f.translation(vec.negate()));}}));x3dom.registerNodeType(\"X3DFollowerNode\",\"Followers\",defineClass(x3dom.nodeTypes.X3DChildNode,function(ctx){x3dom.nodeTypes.X3DFollowerNode.superClass.call(this,ctx);if(ctx)\nctx.doc._nodeBag.followers.push(this);else\nx3dom.debug.logWarning(\"X3DFollowerNode: No runtime context found!\");this.addField_SFBool(ctx,'isActive',false);this._eps=x3dom.fields.Eps;},{parentRemoved:function(parent)\n{if(this._parentNodes.length===0){var doc=this.findX3DDoc();for(var i=0,n=doc._nodeBag.followers.length;i<n;i++){if(doc._nodeBag.followers[i]===this){doc._nodeBag.followers.splice(i,1);}}}},tick:function(t){return false;},stepResponse:function(t)\n{if(t<=0){return 0;}\nif(t>=this._vf.duration){return 1;}\nreturn this.stepResponseCore(t/this._vf.duration);},stepResponseCore:function(T)\n{return 0.5-0.5*Math.cos(T*Math.PI);}}));x3dom.registerNodeType(\"X3DChaserNode\",\"Followers\",defineClass(x3dom.nodeTypes.X3DFollowerNode,function(ctx){x3dom.nodeTypes.X3DChaserNode.superClass.call(this,ctx);this.addField_SFTime(ctx,'duration',1);this._initDone=false;this._stepTime=0;this._currTime=0;this._bufferEndTime=0;this._numSupports=60;}));x3dom.registerNodeType(\"X3DDamperNode\",\"Followers\",defineClass(x3dom.nodeTypes.X3DFollowerNode,function(ctx){x3dom.nodeTypes.X3DDamperNode.superClass.call(this,ctx);this.addField_SFTime(ctx,'tau',0.3);this.addField_SFFloat(ctx,'tolerance',-1);this.addField_SFInt32(ctx,'order',3);this._eps=this._vf.tolerance<0?this._eps:this._vf.tolerance;this._lastTick=0;}));x3dom.registerNodeType(\"ColorChaser\",\"Followers\",defineClass(x3dom.nodeTypes.X3DChaserNode,function(ctx){x3dom.nodeTypes.ColorChaser.superClass.call(this,ctx);this.addField_SFColor(ctx,'initialDestination',0.8,0.8,0.8);this.addField_SFColor(ctx,'initialValue',0.8,0.8,0.8);this.addField_SFColor(ctx,'value',0,0,0);this.addField_SFColor(ctx,'destination',0,0,0);this._buffer=new x3dom.fields.MFColor();this._previousValue=new x3dom.fields.SFColor(0,0,0);this._value=new x3dom.fields.SFColor(0,0,0);this.initialize();},{fieldChanged:function(fieldName)\n{if(fieldName.indexOf(\"destination\")>=0)\n{this.initialize();this.updateBuffer(this._currTime);if(!this._vf.isActive){this.postMessage('isActive',true);}}\nelse if(fieldName.indexOf(\"value\")>=0)\n{this.initialize();this._previousValue.setValues(this._vf.value);for(var C=1;C<this._buffer.length;C++){this._buffer[C].setValues(this._vf.value);}\nthis.postMessage('value',this._vf.value);if(!this._vf.isActive){this.postMessage('isActive',true);}}},initialize:function()\n{if(!this._initDone)\n{this._initDone=true;this._vf.destination=this._vf.initialDestination;this._buffer.length=this._numSupports;this._buffer[0]=this._vf.initialDestination;for(var C=1;C<this._buffer.length;C++){this._buffer[C]=this._vf.initialValue;}\nthis._previousValue=this._vf.initialValue;this._stepTime=this._vf.duration/this._numSupports;var active=!this._buffer[0].equals(this._buffer[1],this._eps);if(this._vf.isActive!==active){this.postMessage('isActive',active);}}},tick:function(now)\n{this.initialize();this._currTime=now;if(!this._bufferEndTime)\n{this._bufferEndTime=now;this._value=this._vf.initialValue;this.postMessage('value',this._value);return true;}\nvar Frac=this.updateBuffer(now);var Output=this._previousValue;var DeltaIn=this._buffer[this._buffer.length-1].subtract(this._previousValue);var DeltaOut=DeltaIn.multiply(this.stepResponse((this._buffer.length-1+Frac)*this._stepTime));Output=Output.add(DeltaOut);for(var C=this._buffer.length-2;C>=0;C--)\n{DeltaIn=this._buffer[C].subtract(this._buffer[C+1]);DeltaOut=DeltaIn.multiply(this.stepResponse((C+Frac)*this._stepTime));Output=Output.add(DeltaOut);}\nif(!Output.equals(this._value,this._eps)){this._value.setValues(Output);this.postMessage('value',this._value);}\nelse{this.postMessage('isActive',false);}\nreturn this._vf.isActive;},updateBuffer:function(now)\n{var Frac=(now-this._bufferEndTime)/this._stepTime;var C;var NumToShift;var Alpha;if(Frac>=1)\n{NumToShift=Math.floor(Frac);Frac-=NumToShift;if(NumToShift<this._buffer.length)\n{this._previousValue=this._buffer[this._buffer.length-NumToShift];for(C=this._buffer.length-1;C>=NumToShift;C--){this._buffer[C]=this._buffer[C-NumToShift];}\nfor(C=0;C<NumToShift;C++)\n{Alpha=C/NumToShift;this._buffer[C]=this._buffer[NumToShift].multiply(Alpha).add(this._vf.destination.multiply((1-Alpha)));}}\nelse\n{this._previousValue=(NumToShift==this._buffer.length)?this._buffer[0]:this._vf.destination;for(C=0;C<this._buffer.length;C++){this._buffer[C]=this._vf.destination;}}\nthis._bufferEndTime+=NumToShift*this._stepTime;}\nreturn Frac;}}));x3dom.registerNodeType(\"ColorDamper\",\"Followers\",defineClass(x3dom.nodeTypes.X3DDamperNode,function(ctx){x3dom.nodeTypes.ColorDamper.superClass.call(this,ctx);this.addField_SFColor(ctx,'initialDestination',0.8,0.8,0.8);this.addField_SFColor(ctx,'initialValue',0.8,0.8,0.8);this.addField_SFColor(ctx,'value',0,0,0);this.addField_SFColor(ctx,'destination',0,0,0);this._value0=new x3dom.fields.SFColor(0,0,0);this._value1=new x3dom.fields.SFColor(0,0,0);this._value2=new x3dom.fields.SFColor(0,0,0);this._value3=new x3dom.fields.SFColor(0,0,0);this._value4=new x3dom.fields.SFColor(0,0,0);this._value5=new x3dom.fields.SFColor(0,0,0);this.initialize();},{fieldChanged:function(fieldName)\n{if(fieldName===\"tolerance\")\n{this._eps=this._vf.tolerance<0?0.001:this._vf.tolerance;}\nelse if(fieldName.indexOf(\"destination\")>=0)\n{if(!this._value0.equals(this._vf.destination,this._eps)){this._value0=this._vf.destination;if(!this._vf.isActive){this.postMessage('isActive',true);}}}\nelse if(fieldName.indexOf(\"value\")>=0)\n{this._value1.setValues(this._vf.value);this._value2.setValues(this._vf.value);this._value3.setValues(this._vf.value);this._value4.setValues(this._vf.value);this._value5.setValues(this._vf.value);this._lastTick=0;this.postMessage('value',this._value5);if(!this._vf.isActive){this._lastTick=0;this.postMessage('isActive',true);}}},initialize:function()\n{this._value0.setValues(this._vf.initialDestination);this._value1.setValues(this._vf.initialValue);this._value2.setValues(this._vf.initialValue);this._value3.setValues(this._vf.initialValue);this._value4.setValues(this._vf.initialValue);this._value5.setValues(this._vf.initialValue);this._lastTick=0;var active=!this._value0.equals(this._value1,this._eps);if(this._vf.isActive!==active){this.postMessage('isActive',active);}},distance:function(a,b)\n{var diff=a.subtract(b);return Math.sqrt(diff.r*diff.r+diff.g*diff.g+diff.b*diff.b);},tick:function(now)\n{if(!this._lastTick)\n{this._lastTick=now;return false;}\nvar delta=now-this._lastTick;var alpha=Math.exp(-delta/this._vf.tau);this._value1=this._vf.order>0&&this._vf.tau?this._value0.add(this._value1.subtract(this._value0).multiply(alpha)):new x3dom.fields.SFColor(this._value0.r,this._value0.g,this._value0.b);this._value2=this._vf.order>1&&this._vf.tau?this._value1.add(this._value2.subtract(this._value1).multiply(alpha)):new x3dom.fields.SFColor(this._value1.r,this._value1.g,this._value1.b);this._value3=this._vf.order>2&&this._vf.tau?this._value2.add(this._value3.subtract(this._value2).multiply(alpha)):new x3dom.fields.SFColor(this._value2.r,this._value2.g,this._value2.b);this._value4=this._vf.order>3&&this._vf.tau?this._value3.add(this._value4.subtract(this._value3).multiply(alpha)):new x3dom.fields.SFColor(this._value3.r,this._value3.g,this._value3.b);this._value5=this._vf.order>4&&this._vf.tau?this._value4.add(this._value5.subtract(this._value4).multiply(alpha)):new x3dom.fields.SFColor(this._value4.r,this._value4.g,this._value4.b);var dist=this.distance(this._value1,this._value0);if(this._vf.order>1)\n{var dist2=this.distance(this._value2,this._value1);if(dist2>dist){dist=dist2;}}\nif(this._vf.order>2)\n{var dist3=this.distance(this._value3,this._value2);if(dist3>dist){dist=dist3;}}\nif(this._vf.order>3)\n{var dist4=this.distance(this._value4,this._value3);if(dist4>dist){dist=dist4;}}\nif(this._vf.order>4)\n{var dist5=this.distance(this._value5,this._value4);if(dist5>dist){dist=dist5;}}\nif(dist<=this._eps)\n{this._value1.setValues(this._value0);this._value2.setValues(this._value0);this._value3.setValues(this._value0);this._value4.setValues(this._value0);this._value5.setValues(this._value0);this.postMessage('value',this._value0);this.postMessage('isActive',false);this._lastTick=0;return false;}\nthis.postMessage('value',this._value5);this._lastTick=now;return true;}}));x3dom.registerNodeType(\"OrientationChaser\",\"Followers\",defineClass(x3dom.nodeTypes.X3DChaserNode,function(ctx){x3dom.nodeTypes.OrientationChaser.superClass.call(this,ctx);this.addField_SFRotation(ctx,'initialDestination',0,1,0,0);this.addField_SFRotation(ctx,'initialValue',0,1,0,0);this.addField_SFRotation(ctx,'value',0,1,0,0);this.addField_SFRotation(ctx,'destination',0,1,0,0);this._numSupports=30;this._buffer=new x3dom.fields.MFRotation();this._previousValue=new x3dom.fields.Quaternion(0,1,0,0);this._value=new x3dom.fields.Quaternion(0,1,0,0);this.initialize();},{fieldChanged:function(fieldName)\n{if(fieldName.indexOf(\"destination\")>=0)\n{this.initialize();this.updateBuffer(this._currTime);if(!this._vf.isActive){this.postMessage('isActive',true);}}\nelse if(fieldName.indexOf(\"value\")>=0)\n{this.initialize();this._previousValue.setValues(this._vf.value);for(var C=1;C<this._buffer.length;C++){this._buffer[C].setValues(this._vf.value);}\nthis.postMessage('value',this._vf.value);if(!this._vf.isActive){this.postMessage('isActive',true);}}},initialize:function()\n{if(!this._initDone)\n{this._initDone=true;this._vf.destination=x3dom.fields.Quaternion.copy(this._vf.initialDestination);this._buffer.length=this._numSupports;this._buffer[0]=x3dom.fields.Quaternion.copy(this._vf.initialDestination);for(var C=1;C<this._buffer.length;C++){this._buffer[C]=x3dom.fields.Quaternion.copy(this._vf.initialValue);}\nthis._previousValue=x3dom.fields.Quaternion.copy(this._vf.initialValue);this._stepTime=this._vf.duration/this._numSupports;var active=!this._buffer[0].equals(this._buffer[1],this._eps);if(this._vf.isActive!==active){this.postMessage('isActive',active);}}},tick:function(now)\n{this.initialize();this._currTime=now;if(!this._bufferEndTime)\n{this._bufferEndTime=now;this._value=x3dom.fields.Quaternion.copy(this._vf.initialValue);this.postMessage('value',this._value);return true;}\nvar Frac=this.updateBuffer(now);var Output=x3dom.fields.Quaternion.copy(this._previousValue);var DeltaIn=this._previousValue.inverse().multiply(this._buffer[this._buffer.length-1]);Output=Output.slerp(Output.multiply(DeltaIn),this.stepResponse((this._buffer.length-1+Frac)*this._stepTime));for(var C=this._buffer.length-2;C>=0;C--)\n{DeltaIn=this._buffer[C+1].inverse().multiply(this._buffer[C]);Output=Output.slerp(Output.multiply(DeltaIn),this.stepResponse((C+Frac)*this._stepTime));}\nif(!Output.equals(this._value,this._eps)){Output=Output.normalize(Output);this._value.setValues(Output);this.postMessage('value',this._value);}\nelse{this.postMessage('isActive',false);}\nreturn this._vf.isActive;},updateBuffer:function(now)\n{var Frac=(now-this._bufferEndTime)/this._stepTime;var C;var NumToShift;var Alpha;if(Frac>=1)\n{NumToShift=Math.floor(Frac);Frac-=NumToShift;if(NumToShift<this._buffer.length)\n{this._previousValue=x3dom.fields.Quaternion.copy(this._buffer[this._buffer.length-NumToShift]);for(C=this._buffer.length-1;C>=NumToShift;C--){this._buffer[C]=x3dom.fields.Quaternion.copy(this._buffer[C-NumToShift]);}\nfor(C=0;C<NumToShift;C++)\n{Alpha=C/NumToShift;this._buffer[C]=this._vf.destination.slerp(this._buffer[NumToShift],Alpha);}}\nelse\n{this._previousValue=x3dom.fields.Quaternion.copy((NumToShift==this._buffer.length)?this._buffer[0]:this._vf.destination);for(C=0;C<this._buffer.length;C++){this._buffer[C]=x3dom.fields.Quaternion.copy(this._vf.destination);}}\nthis._bufferEndTime+=NumToShift*this._stepTime;}\nreturn Frac;}}));x3dom.registerNodeType(\"OrientationDamper\",\"Followers\",defineClass(x3dom.nodeTypes.X3DDamperNode,function(ctx){x3dom.nodeTypes.OrientationDamper.superClass.call(this,ctx);this.addField_SFRotation(ctx,'initialDestination',0,1,0,0);this.addField_SFRotation(ctx,'initialValue',0,1,0,0);this.addField_SFRotation(ctx,'value',0,1,0,0);this.addField_SFRotation(ctx,'destination',0,1,0,0);this._value0=new x3dom.fields.Quaternion(0,1,0,0);this._value1=new x3dom.fields.Quaternion(0,1,0,0);this._value2=new x3dom.fields.Quaternion(0,1,0,0);this._value3=new x3dom.fields.Quaternion(0,1,0,0);this._value4=new x3dom.fields.Quaternion(0,1,0,0);this._value5=new x3dom.fields.Quaternion(0,1,0,0);this.initialize();},{fieldChanged:function(fieldName)\n{if(fieldName===\"tolerance\")\n{this._eps=this._vf.tolerance<0?0.001:this._vf.tolerance;}\nelse if(fieldName.indexOf(\"destination\")>=0)\n{if(!this._value0.equals(this._vf.destination,this._eps)){this._value0=this._vf.destination;if(!this._vf.isActive){this.postMessage('isActive',true);}}}\nelse if(fieldName.indexOf(\"value\")>=0)\n{this._value1.setValues(this._vf.value);this._value2.setValues(this._vf.value);this._value3.setValues(this._vf.value);this._value4.setValues(this._vf.value);this._value5.setValues(this._vf.value);this._lastTick=0;this.postMessage('value',this._value5);if(!this._vf.isActive){this._lastTick=0;this.postMessage('isActive',true);}}},initialize:function()\n{this._value0.setValues(this._vf.initialDestination);this._value1.setValues(this._vf.initialValue);this._value2.setValues(this._vf.initialValue);this._value3.setValues(this._vf.initialValue);this._value4.setValues(this._vf.initialValue);this._value5.setValues(this._vf.initialValue);this._lastTick=0;var active=!this._value0.equals(this._value1,this._eps);if(this._vf.isActive!==active){this.postMessage('isActive',active);}},tick:function(now)\n{if(!this._lastTick)\n{this._lastTick=now;return false;}\nvar delta=now-this._lastTick;var alpha=Math.exp(-delta/this._vf.tau);this._value1=this._vf.order>0&&this._vf.tau?this._value0.slerp(this._value1,alpha):new x3dom.fields.Quaternion(this._value0.x,this._value0.y,this._value0.z,this._value0.w);this._value2=this._vf.order>1&&this._vf.tau?this._value1.slerp(this._value2,alpha):new x3dom.fields.Quaternion(this._value1.x,this._value1.y,this._value1.z,this._value1.w);this._value3=this._vf.order>2&&this._vf.tau?this._value2.slerp(this._value3,alpha):new x3dom.fields.Quaternion(this._value2.x,this._value2.y,this._value2.z,this._value2.w);this._value4=this._vf.order>3&&this._vf.tau?this._value3.slerp(this._value4,alpha):new x3dom.fields.Quaternion(this._value3.x,this._value3.y,this._value3.z,this._value3.w);this._value5=this._vf.order>4&&this._vf.tau?this._value4.slerp(this._value5,alpha):new x3dom.fields.Quaternion(this._value4.x,this._value4.y,this._value4.z,this._value4.w);var dist=Math.abs(this._value1.inverse().multiply(this._value0).angle());if(this._vf.order>1)\n{var dist2=Math.abs(this._value2.inverse().multiply(this._value1).angle());if(dist2>dist){dist=dist2;}}\nif(this._vf.order>2)\n{var dist3=Math.abs(this._value3.inverse().multiply(this._value2).angle());if(dist3>dist){dist=dist3;}}\nif(this._vf.order>3)\n{var dist4=Math.abs(this._value4.inverse().multiply(this._value3).angle());if(dist4>dist){dist=dist4;}}\nif(this._vf.order>4)\n{var dist5=Math.abs(this._value5.inverse().multiply(this._value4).angle());if(dist5>dist){dist=dist5;}}\nif(dist<=this._eps)\n{this._value1.setValues(this._value0);this._value2.setValues(this._value0);this._value3.setValues(this._value0);this._value4.setValues(this._value0);this._value5.setValues(this._value0);this.postMessage('value',this._value0);this.postMessage('isActive',false);this._lastTick=0;return false;}\nthis.postMessage('value',this._value5);this._lastTick=now;return true;}}));x3dom.registerNodeType(\"PositionChaser\",\"Followers\",defineClass(x3dom.nodeTypes.X3DChaserNode,function(ctx){x3dom.nodeTypes.PositionChaser.superClass.call(this,ctx);this.addField_SFVec3f(ctx,'initialDestination',0,0,0);this.addField_SFVec3f(ctx,'initialValue',0,0,0);this.addField_SFVec3f(ctx,'value',0,0,0);this.addField_SFVec3f(ctx,'destination',0,0,0);this._buffer=new x3dom.fields.MFVec3f();this._previousValue=new x3dom.fields.SFVec3f(0,0,0);this._value=new x3dom.fields.SFVec3f(0,0,0);this.initialize();},{fieldChanged:function(fieldName)\n{if(fieldName.indexOf(\"destination\")>=0)\n{this.initialize();this.updateBuffer(this._currTime);if(!this._vf.isActive){this.postMessage('isActive',true);}}\nelse if(fieldName.indexOf(\"value\")>=0)\n{this.initialize();this._previousValue.setValues(this._vf.value);for(var C=1;C<this._buffer.length;C++){this._buffer[C].setValues(this._vf.value);}\nthis.postMessage('value',this._vf.value);if(!this._vf.isActive){this.postMessage('isActive',true);}}},initialize:function()\n{if(!this._initDone)\n{this._initDone=true;this._vf.destination=x3dom.fields.SFVec3f.copy(this._vf.initialDestination);this._buffer.length=this._numSupports;this._buffer[0]=x3dom.fields.SFVec3f.copy(this._vf.initialDestination);for(var C=1;C<this._buffer.length;C++){this._buffer[C]=x3dom.fields.SFVec3f.copy(this._vf.initialValue);}\nthis._previousValue=x3dom.fields.SFVec3f.copy(this._vf.initialValue);this._stepTime=this._vf.duration/this._numSupports;var active=!this._buffer[0].equals(this._buffer[1],this._eps);if(this._vf.isActive!==active){this.postMessage('isActive',active);}}},tick:function(now)\n{this.initialize();this._currTime=now;if(!this._bufferEndTime)\n{this._bufferEndTime=now;this._value=x3dom.fields.SFVec3f.copy(this._vf.initialValue);this.postMessage('value',this._value);return true;}\nvar Frac=this.updateBuffer(now);var Output=x3dom.fields.SFVec3f.copy(this._previousValue);var DeltaIn=this._buffer[this._buffer.length-1].subtract(this._previousValue);var DeltaOut=DeltaIn.multiply(this.stepResponse((this._buffer.length-1+Frac)*this._stepTime));Output=Output.add(DeltaOut);for(var C=this._buffer.length-2;C>=0;C--)\n{DeltaIn=this._buffer[C].subtract(this._buffer[C+1]);DeltaOut=DeltaIn.multiply(this.stepResponse((C+Frac)*this._stepTime));Output=Output.add(DeltaOut);}\nif(!Output.equals(this._value,this._eps)){this._value.setValues(Output);this.postMessage('value',this._value);}\nelse{this.postMessage('isActive',false);}\nreturn this._vf.isActive;},updateBuffer:function(now)\n{var Frac=(now-this._bufferEndTime)/this._stepTime;var C;var NumToShift;var Alpha;if(Frac>=1)\n{NumToShift=Math.floor(Frac);Frac-=NumToShift;if(NumToShift<this._buffer.length)\n{this._previousValue=x3dom.fields.SFVec3f.copy(this._buffer[this._buffer.length-NumToShift]);for(C=this._buffer.length-1;C>=NumToShift;C--){this._buffer[C]=x3dom.fields.SFVec3f.copy(this._buffer[C-NumToShift]);}\nfor(C=0;C<NumToShift;C++)\n{Alpha=C/NumToShift;this._buffer[C]=this._buffer[NumToShift].multiply(Alpha).add(this._vf.destination.multiply((1-Alpha)));}}\nelse\n{this._previousValue=x3dom.fields.SFVec3f.copy((NumToShift==this._buffer.length)?this._buffer[0]:this._vf.destination);for(C=0;C<this._buffer.length;C++){this._buffer[C]=x3dom.fields.SFVec3f.copy(this._vf.destination);}}\nthis._bufferEndTime+=NumToShift*this._stepTime;}\nreturn Frac;}}));x3dom.registerNodeType(\"PositionChaser2D\",\"Followers\",defineClass(x3dom.nodeTypes.X3DChaserNode,function(ctx){x3dom.nodeTypes.PositionChaser2D.superClass.call(this,ctx);this.addField_SFVec2f(ctx,'initialDestination',0,0);this.addField_SFVec2f(ctx,'initialValue',0,0);this.addField_SFVec2f(ctx,'value',0,0);this.addField_SFVec2f(ctx,'destination',0,0);this._buffer=new x3dom.fields.MFVec2f();this._previousValue=new x3dom.fields.SFVec2f(0,0);this._value=new x3dom.fields.SFVec2f(0,0);this.initialize();},{fieldChanged:function(fieldName)\n{if(fieldName.indexOf(\"destination\")>=0)\n{this.initialize();this.updateBuffer(this._currTime);if(!this._vf.isActive){this.postMessage('isActive',true);}}\nelse if(fieldName.indexOf(\"value\")>=0)\n{this.initialize();this._previousValue.setValues(this._vf.value);for(var C=1;C<this._buffer.length;C++){this._buffer[C].setValues(this._vf.value);}\nthis.postMessage('value',this._vf.value);if(!this._vf.isActive){this.postMessage('isActive',true);}}},initialize:function()\n{if(!this._initDone)\n{this._initDone=true;this._vf.destination=x3dom.fields.SFVec2f.copy(this._vf.initialDestination);this._buffer.length=this._numSupports;this._buffer[0]=x3dom.fields.SFVec2f.copy(this._vf.initialDestination);for(var C=1;C<this._buffer.length;C++){this._buffer[C]=x3dom.fields.SFVec2f.copy(this._vf.initialValue);}\nthis._previousValue=x3dom.fields.SFVec2f.copy(this._vf.initialValue);this._stepTime=this._vf.duration/this._numSupports;var active=!this._buffer[0].equals(this._buffer[1],this._eps);if(this._vf.isActive!==active){this.postMessage('isActive',active);}}},tick:function(now)\n{this.initialize();this._currTime=now;if(!this._bufferEndTime)\n{this._bufferEndTime=now;this._value=x3dom.fields.SFVec2f.copy(this._vf.initialValue);this.postMessage('value',this._value);return true;}\nvar Frac=this.updateBuffer(now);var Output=x3dom.fields.SFVec2f.copy(this._previousValue);var DeltaIn=this._buffer[this._buffer.length-1].subtract(this._previousValue);var DeltaOut=DeltaIn.multiply(this.stepResponse((this._buffer.length-1+Frac)*this._stepTime));Output=Output.add(DeltaOut);for(var C=this._buffer.length-2;C>=0;C--)\n{DeltaIn=this._buffer[C].subtract(this._buffer[C+1]);DeltaOut=DeltaIn.multiply(this.stepResponse((C+Frac)*this._stepTime));Output=Output.add(DeltaOut);}\nif(!Output.equals(this._value,this._eps)){this._value.setValues(Output);this.postMessage('value',this._value);}\nelse{this.postMessage('isActive',false);}\nreturn this._vf.isActive;},updateBuffer:function(now)\n{var Frac=(now-this._bufferEndTime)/this._stepTime;var C;var NumToShift;var Alpha;if(Frac>=1)\n{NumToShift=Math.floor(Frac);Frac-=NumToShift;if(NumToShift<this._buffer.length)\n{this._previousValue=x3dom.fields.SFVec2f.copy(this._buffer[this._buffer.length-NumToShift]);for(C=this._buffer.length-1;C>=NumToShift;C--){this._buffer[C]=x3dom.fields.SFVec2f.copy(this._buffer[C-NumToShift]);}\nfor(C=0;C<NumToShift;C++)\n{Alpha=C/NumToShift;this._buffer[C]=this._buffer[NumToShift].multiply(Alpha).add(this._vf.destination.multiply((1-Alpha)));}}\nelse\n{this._previousValue=x3dom.fields.SFVec2f.copy((NumToShift==this._buffer.length)?this._buffer[0]:this._vf.destination);for(C=0;C<this._buffer.length;C++){this._buffer[C]=x3dom.fields.SFVec2f.copy(this._vf.destination);}}\nthis._bufferEndTime+=NumToShift*this._stepTime;}\nreturn Frac;}}));x3dom.registerNodeType(\"PositionDamper\",\"Followers\",defineClass(x3dom.nodeTypes.X3DDamperNode,function(ctx){x3dom.nodeTypes.PositionDamper.superClass.call(this,ctx);this.addField_SFVec3f(ctx,'initialDestination',0,0,0);this.addField_SFVec3f(ctx,'initialValue',0,0,0);this.addField_SFVec3f(ctx,'value',0,0,0);this.addField_SFVec3f(ctx,'destination',0,0,0);this._value0=new x3dom.fields.SFVec3f(0,0,0);this._value1=new x3dom.fields.SFVec3f(0,0,0);this._value2=new x3dom.fields.SFVec3f(0,0,0);this._value3=new x3dom.fields.SFVec3f(0,0,0);this._value4=new x3dom.fields.SFVec3f(0,0,0);this._value5=new x3dom.fields.SFVec3f(0,0,0);this.initialize();},{fieldChanged:function(fieldName)\n{if(fieldName===\"tolerance\")\n{this._eps=this._vf.tolerance<0?0.001:this._vf.tolerance;}\nelse if(fieldName.indexOf(\"destination\")>=0)\n{if(!this._value0.equals(this._vf.destination,this._eps)){this._value0=this._vf.destination;if(!this._vf.isActive){this.postMessage('isActive',true);}}}\nelse if(fieldName.indexOf(\"value\")>=0)\n{this._value1.setValues(this._vf.value);this._value2.setValues(this._vf.value);this._value3.setValues(this._vf.value);this._value4.setValues(this._vf.value);this._value5.setValues(this._vf.value);this._lastTick=0;this.postMessage('value',this._value5);if(!this._vf.isActive){this._lastTick=0;this.postMessage('isActive',true);}}},initialize:function()\n{this._value0.setValues(this._vf.initialDestination);this._value1.setValues(this._vf.initialValue);this._value2.setValues(this._vf.initialValue);this._value3.setValues(this._vf.initialValue);this._value4.setValues(this._vf.initialValue);this._value5.setValues(this._vf.initialValue);this._lastTick=0;var active=!this._value0.equals(this._value1,this._eps);if(this._vf.isActive!==active){this.postMessage('isActive',active);}},tick:function(now)\n{if(!this._lastTick)\n{this._lastTick=now;return false;}\nvar delta=now-this._lastTick;var alpha=Math.exp(-delta/this._vf.tau);this._value1=this._vf.order>0&&this._vf.tau?this._value0.add(this._value1.subtract(this._value0).multiply(alpha)):new x3dom.fields.SFVec3f(this._value0.x,this._value0.y,this._value0.z);this._value2=this._vf.order>1&&this._vf.tau?this._value1.add(this._value2.subtract(this._value1).multiply(alpha)):new x3dom.fields.SFVec3f(this._value1.x,this._value1.y,this._value1.z);this._value3=this._vf.order>2&&this._vf.tau?this._value2.add(this._value3.subtract(this._value2).multiply(alpha)):new x3dom.fields.SFVec3f(this._value2.x,this._value2.y,this._value2.z);this._value4=this._vf.order>3&&this._vf.tau?this._value3.add(this._value4.subtract(this._value3).multiply(alpha)):new x3dom.fields.SFVec3f(this._value3.x,this._value3.y,this._value3.z);this._value5=this._vf.order>4&&this._vf.tau?this._value4.add(this._value5.subtract(this._value4).multiply(alpha)):new x3dom.fields.SFVec3f(this._value4.x,this._value4.y,this._value4.z);var dist=this._value1.subtract(this._value0).length();if(this._vf.order>1)\n{var dist2=this._value2.subtract(this._value1).length();if(dist2>dist){dist=dist2;}}\nif(this._vf.order>2)\n{var dist3=this._value3.subtract(this._value2).length();if(dist3>dist){dist=dist3;}}\nif(this._vf.order>3)\n{var dist4=this._value4.subtract(this._value3).length();if(dist4>dist){dist=dist4;}}\nif(this._vf.order>4)\n{var dist5=this._value5.subtract(this._value4).length();if(dist5>dist){dist=dist5;}}\nif(dist<=this._eps)\n{this._value1.setValues(this._value0);this._value2.setValues(this._value0);this._value3.setValues(this._value0);this._value4.setValues(this._value0);this._value5.setValues(this._value0);this.postMessage('value',this._value0);this.postMessage('isActive',false);this._lastTick=0;return false;}\nthis.postMessage('value',this._value5);this._lastTick=now;return true;}}));x3dom.registerNodeType(\"PositionDamper2D\",\"Followers\",defineClass(x3dom.nodeTypes.X3DDamperNode,function(ctx){x3dom.nodeTypes.PositionDamper2D.superClass.call(this,ctx);this.addField_SFVec2f(ctx,'initialDestination',0,0);this.addField_SFVec2f(ctx,'initialValue',0,0);this.addField_SFVec2f(ctx,'value',0,0);this.addField_SFVec2f(ctx,'destination',0,0);this._value0=new x3dom.fields.SFVec2f(0,0);this._value1=new x3dom.fields.SFVec2f(0,0);this._value2=new x3dom.fields.SFVec2f(0,0);this._value3=new x3dom.fields.SFVec2f(0,0);this._value4=new x3dom.fields.SFVec2f(0,0);this._value5=new x3dom.fields.SFVec2f(0,0);this.initialize();},{fieldChanged:function(fieldName)\n{if(fieldName===\"tolerance\")\n{this._eps=this._vf.tolerance<0?0.001:this._vf.tolerance;}\nelse if(fieldName.indexOf(\"destination\")>=0)\n{if(!this._value0.equals(this._vf.destination,this._eps)){this._value0=this._vf.destination;if(!this._vf.isActive){this.postMessage('isActive',true);}}}\nelse if(fieldName.indexOf(\"value\")>=0)\n{this._value1.setValues(this._vf.value);this._value2.setValues(this._vf.value);this._value3.setValues(this._vf.value);this._value4.setValues(this._vf.value);this._value5.setValues(this._vf.value);this._lastTick=0;this.postMessage('value',this._value5);if(!this._vf.isActive){this._lastTick=0;this.postMessage('isActive',true);}}},initialize:function()\n{this._value0.setValues(this._vf.initialDestination);this._value1.setValues(this._vf.initialValue);this._value2.setValues(this._vf.initialValue);this._value3.setValues(this._vf.initialValue);this._value4.setValues(this._vf.initialValue);this._value5.setValues(this._vf.initialValue);this._lastTick=0;var active=!this._value0.equals(this._value1,this._eps);if(this._vf.isActive!==active){this.postMessage('isActive',active);}},tick:function(now)\n{if(!this._lastTick)\n{this._lastTick=now;return false;}\nvar delta=now-this._lastTick;var alpha=Math.exp(-delta/this._vf.tau);this._value1=this._vf.order>0&&this._vf.tau?this._value0.add(this._value1.subtract(this._value0).multiply(alpha)):new x3dom.fields.SFVec2f(this._value0.x,this._value0.y,this._value0.z);this._value2=this._vf.order>1&&this._vf.tau?this._value1.add(this._value2.subtract(this._value1).multiply(alpha)):new x3dom.fields.SFVec2f(this._value1.x,this._value1.y,this._value1.z);this._value3=this._vf.order>2&&this._vf.tau?this._value2.add(this._value3.subtract(this._value2).multiply(alpha)):new x3dom.fields.SFVec2f(this._value2.x,this._value2.y,this._value2.z);this._value4=this._vf.order>3&&this._vf.tau?this._value3.add(this._value4.subtract(this._value3).multiply(alpha)):new x3dom.fields.SFVec2f(this._value3.x,this._value3.y,this._value3.z);this._value5=this._vf.order>4&&this._vf.tau?this._value4.add(this._value5.subtract(this._value4).multiply(alpha)):new x3dom.fields.SFVec2f(this._value4.x,this._value4.y,this._value4.z);var dist=this._value1.subtract(this._value0).length();if(this._vf.order>1)\n{var dist2=this._value2.subtract(this._value1).length();if(dist2>dist){dist=dist2;}}\nif(this._vf.order>2)\n{var dist3=this._value3.subtract(this._value2).length();if(dist3>dist){dist=dist3;}}\nif(this._vf.order>3)\n{var dist4=this._value4.subtract(this._value3).length();if(dist4>dist){dist=dist4;}}\nif(this._vf.order>4)\n{var dist5=this._value5.subtract(this._value4).length();if(dist5>dist){dist=dist5;}}\nif(dist<=this._eps)\n{this._value1.setValues(this._value0);this._value2.setValues(this._value0);this._value3.setValues(this._value0);this._value4.setValues(this._value0);this._value5.setValues(this._value0);this.postMessage('value',this._value0);this.postMessage('isActive',false);this._lastTick=0;return false;}\nthis.postMessage('value',this._value5);this._lastTick=now;return true;}}));x3dom.registerNodeType(\"ScalarChaser\",\"Followers\",defineClass(x3dom.nodeTypes.X3DChaserNode,function(ctx){x3dom.nodeTypes.ScalarChaser.superClass.call(this,ctx);this.addField_SFFloat(ctx,'initialDestination',0);this.addField_SFFloat(ctx,'initialValue',0);this.addField_SFFloat(ctx,'value',0);this.addField_SFFloat(ctx,'destination',0);this._buffer=[];this._previousValue=0;this._value=0;this.initialize();},{fieldChanged:function(fieldName)\n{if(fieldName.indexOf(\"destination\")>=0)\n{this.initialize();this.updateBuffer(this._currTime);if(!this._vf.isActive){this.postMessage('isActive',true);}}\nelse if(fieldName.indexOf(\"value\")>=0)\n{this.initialize();this._previousValue=this._vf.value;for(var C=1;C<this._buffer.length;C++){this._buffer[C]=this._vf.value;}\nthis.postMessage('value',this._vf.value);if(!this._vf.isActive){this.postMessage('isActive',true);}}},initialize:function()\n{if(!this._initDone)\n{this._initDone=true;this._vf.destination=this._vf.initialDestination;this._buffer.length=this._numSupports;this._buffer[0]=this._vf.initialDestination;for(var C=1;C<this._buffer.length;C++){this._buffer[C]=this._vf.initialValue;}\nthis._previousValue=this._vf.initialValue;this._stepTime=this._vf.duration/this._numSupports;var active=(Math.abs(this._buffer[0]-this._buffer[1])>this._eps);if(this._vf.isActive!==active){this.postMessage('isActive',active);}}},tick:function(now)\n{this.initialize();this._currTime=now;if(!this._bufferEndTime)\n{this._bufferEndTime=now;this._value=this._vf.initialValue;this.postMessage('value',this._value);return true;}\nvar Frac=this.updateBuffer(now);var Output=this._previousValue;var DeltaIn=this._buffer[this._buffer.length-1]-this._previousValue;var DeltaOut=DeltaIn*(this.stepResponse((this._buffer.length-1+Frac)*this._stepTime));Output=Output+DeltaOut;for(var C=this._buffer.length-2;C>=0;C--)\n{DeltaIn=this._buffer[C]-this._buffer[C+1];DeltaOut=DeltaIn*(this.stepResponse((C+Frac)*this._stepTime));Output=Output+DeltaOut;}\nif(Math.abs(Output-this._value)>this._eps){this._value=Output;this.postMessage('value',this._value);}\nelse{this.postMessage('isActive',false);}\nreturn this._vf.isActive;},updateBuffer:function(now)\n{var Frac=(now-this._bufferEndTime)/this._stepTime;var C;var NumToShift;var Alpha;if(Frac>=1)\n{NumToShift=Math.floor(Frac);Frac-=NumToShift;if(NumToShift<this._buffer.length)\n{this._previousValue=this._buffer[this._buffer.length-NumToShift];for(C=this._buffer.length-1;C>=NumToShift;C--){this._buffer[C]=this._buffer[C-NumToShift];}\nfor(C=0;C<NumToShift;C++)\n{Alpha=C/NumToShift;this._buffer[C]=this._buffer[NumToShift]*Alpha+this._vf.destination*(1-Alpha);}}\nelse\n{this._previousValue=(NumToShift==this._buffer.length)?this._buffer[0]:this._vf.destination;for(C=0;C<this._buffer.length;C++){this._buffer[C]=this._vf.destination;}}\nthis._bufferEndTime+=NumToShift*this._stepTime;}\nreturn Frac;}}));x3dom.registerNodeType(\"ScalarDamper\",\"Followers\",defineClass(x3dom.nodeTypes.X3DDamperNode,function(ctx){x3dom.nodeTypes.ScalarDamper.superClass.call(this,ctx);this.addField_SFFloat(ctx,'initialDestination',0);this.addField_SFFloat(ctx,'initialValue',0);this.addField_SFFloat(ctx,'value',0);this.addField_SFFloat(ctx,'destination',0);this._value0=0;this._value1=0;this._value2=0;this._value3=0;this._value4=0;this._value5=0;this.initialize();},{fieldChanged:function(fieldName)\n{if(fieldName===\"tolerance\")\n{this._eps=this._vf.tolerance<0?0.001:this._vf.tolerance;}\nelse if(fieldName.indexOf(\"destination\")>=0)\n{if(Math.abs(this._value0-this._vf.destination)>this._eps){this._value0=this._vf.destination;if(!this._vf.isActive){this.postMessage('isActive',true);}}}\nelse if(fieldName.indexOf(\"value\")>=0)\n{this._value1=this._vf.value;this._value2=this._vf.value;this._value3=this._vf.value;this._value4=this._vf.value;this._value5=this._vf.value;this._lastTick=0;this.postMessage('value',this._value5);if(!this._vf.isActive){this._lastTick=0;this.postMessage('isActive',true);}}},initialize:function()\n{this._value0=this._vf.initialDestination;this._value1=this._vf.initialValue;this._value2=this._vf.initialValue;this._value3=this._vf.initialValue;this._value4=this._vf.initialValue;this._value5=this._vf.initialValue;this._lastTick=0;var active=(Math.abs(this._value0-this._value1)>this._eps);if(this._vf.isActive!==active){this.postMessage('isActive',active);}},tick:function(now)\n{if(!this._lastTick)\n{this._lastTick=now;return false;}\nvar delta=now-this._lastTick;var alpha=Math.exp(-delta/this._vf.tau);this._value1=this._vf.order>0&&this._vf.tau?this._value0+alpha*(this._value1-this._value0):this._value0;this._value2=this._vf.order>1&&this._vf.tau?this._value1+alpha*(this._value2-this._value1):this._value1;this._value3=this._vf.order>2&&this._vf.tau?this._value2+alpha*(this._value3-this._value2):this._value2;this._value4=this._vf.order>3&&this._vf.tau?this._value3+alpha*(this._value4-this._value3):this._value3;this._value5=this._vf.order>4&&this._vf.tau?this._value4+alpha*(this._value5-this._value4):this._value4;var dist=Math.abs(this._value1-this._value0);if(this._vf.order>1)\n{var dist2=Math.abs(this._value2-this._value1);if(dist2>dist){dist=dist2;}}\nif(this._vf.order>2)\n{var dist3=Math.abs(this._value3-this._value2);if(dist3>dist){dist=dist3;}}\nif(this._vf.order>3)\n{var dist4=Math.abs(this._value4-this._value3);if(dist4>dist){dist=dist4;}}\nif(this._vf.order>4)\n{var dist5=Math.abs(this._value5-this._value4);if(dist5>dist){dist=dist5;}}\nif(dist<=this._eps)\n{this._value1=this._value0;this._value2=this._value0;this._value3=this._value0;this._value4=this._value0;this._value5=this._value0;this.postMessage('value',this._value0);this.postMessage('isActive',false);this._lastTick=0;return false;}\nthis.postMessage('value',this._value5);this._lastTick=now;return true;}}));x3dom.registerNodeType(\"CoordinateDamper\",\"Followers\",defineClass(x3dom.nodeTypes.X3DDamperNode,function(ctx){x3dom.nodeTypes.CoordinateDamper.superClass.call(this,ctx);this.addField_MFVec3f(ctx,'initialDestination',[]);this.addField_MFVec3f(ctx,'initialValue',[]);this.addField_MFVec3f(ctx,'value',[]);this.addField_MFVec3f(ctx,'destination',[]);x3dom.debug.logWarning(\"CoordinateDamper NYI\");}));x3dom.registerNodeType(\"TexCoordDamper2D\",\"Followers\",defineClass(x3dom.nodeTypes.X3DDamperNode,function(ctx){x3dom.nodeTypes.TexCoordDamper2D.superClass.call(this,ctx);this.addField_MFVec2f(ctx,'initialDestination',[]);this.addField_MFVec2f(ctx,'initialValue',[]);this.addField_MFVec2f(ctx,'value',[]);this.addField_MFVec2f(ctx,'destination',[]);x3dom.debug.logWarning(\"TexCoordDamper2D NYI\");}));x3dom.registerNodeType(\"X3DInterpolatorNode\",\"Interpolation\",defineClass(x3dom.nodeTypes.X3DChildNode,function(ctx){x3dom.nodeTypes.X3DInterpolatorNode.superClass.call(this,ctx);this.addField_MFFloat(ctx,'key',[]);this.addField_SFFloat(ctx,'set_fraction',0);this.addField_SFString(ctx,'buffer',\"\");this.addField_SFString(ctx,'interpolation',\"LINEAR\");this.addField_SFFloat(ctx,'duration',0);this.addField_MFNode('views',x3dom.nodeTypes.BufferView);this.addField_MFNode('accessors',x3dom.nodeTypes.BufferAccessor);this._lastValue=undefined;this.normalizeFromType={\"5120\":function(c){return Math.max(c/127.0,-1.0)},\"5121\":function(c){return c/255.0;},\"5122\":function(c){return Math.max(c/32767.0,-1.0)},\"5123\":function(c){return c/65535.0;},\"5125\":function(c){return c/4294967295;},\"5126\":function(c){return c;},};},{nodeChanged:function()\n{if(this._vf.buffer)\n{x3dom.BinaryContainerLoader.setupBufferInterpolator(this);}},linearInterp:function(time,interp)\n{if(this._vf.key.length==0)\n{return;}\nif(time<=this._vf.key[0])\n{return this._vf.keyValue[0];}\nelse if(time>=this._vf.key[this._vf.key.length-1])\n{return this._vf.keyValue[this._vf.key.length-1];}\nfor(var i=0,n=this._vf.key.length-1;i<n;++i)\n{if((this._vf.key[i]<time)&&(time<=this._vf.key[i+1]))\n{return interp(this._vf.keyValue[i],this._vf.keyValue[i+1],(time-this._vf.key[i])/(this._vf.key[i+1]-this._vf.key[i]));}}\nreturn this._vf.keyValue[0];},cubicSplineInterp:function(time,interp)\n{if(this._vf.key.length==0)\n{return;}\nvar i,i3,interval,basis,t,intervalInSeconds;if(time<=this._vf.key[0])\n{return this._vf.keyValue[1];}\nelse if(time>=this._vf.key[this._vf.key.length-1])\n{return this._vf.keyValue[this._vf.keyValue.length-2];}\nfor(i=0,n=this._vf.key.length-1;i<n;++i)\n{if((this._vf.key[i]<time)&&(time<=this._vf.key[i+1]))\n{i3=i*3;interval=this._vf.key[i+1]-this._vf.key[i];t=(time-this._vf.key[i])/interval;intervalInSeconds=interval*this._vf.duration;basis=this.cubicSplineBasis(t,intervalInSeconds);return interp(this._vf.keyValue[i3+2],this._vf.keyValue[i3+1],this._vf.keyValue[i3+3],this._vf.keyValue[i3+4],basis.h00,basis.h10,basis.h01,basis.h11);}}\nreturn this._vf.keyValue[0];},cubicSplineBasis:function(t,intervalInSeconds)\n{var t2=t*t;var t3=t2*t;var h01=-2*t3+3*t2;var h11=t3-t2;var h00=1-h01;var h10=h11-t2+t;return{'h00':h00,'h10':intervalInSeconds*h10,'h01':h01,'h11':intervalInSeconds*h11};},keyValueFromArray:function(array)\n{return array;}}));x3dom.XHRCache={};x3dom.registerNodeType(\"OrientationInterpolator\",\"Interpolation\",defineClass(x3dom.nodeTypes.X3DInterpolatorNode,function(ctx){x3dom.nodeTypes.OrientationInterpolator.superClass.call(this,ctx);this.addField_MFRotation(ctx,'keyValue',[]);},{fieldChanged:function(fieldName)\n{if(fieldName===\"set_fraction\")\n{var value;if(this._vf.interpolation===\"CUBICSPLINE\")\n{value=this.cubicSplineInterp(this._vf.set_fraction,function(startInTangent,start,endOutTangent,end,h00,h10,h01,h11){function _applyBasis(axis)\n{return h00*start[axis]+h10*startInTangent[axis]+h01*end[axis]+h11*endOutTangent[axis];}\nvar result=new x3dom.fields.Quaternion(0,0,0,0);result.x=_applyBasis('x');result.y=_applyBasis('y');result.z=_applyBasis('z');result.w=_applyBasis('w');var s=Math.sqrt(1/result.dot(result));result.x*=s;result.y*=s;result.z*=s;result.w*=s;return result;});}\nelse\n{value=this.linearInterp(this._vf.set_fraction,function(a,b,t){return a.slerp(b,t);});}\nif(value!=undefined&&value!=this._lastValue)\n{this._lastValue=value;this.postMessage('value_changed',value);}}},keyValueFromAccessor:function(array,type)\n{var keyValue=new x3dom.fields.MFRotation();var normalize=this.normalizeFromType[type];array.forEach(function(val,i)\n{if(i%4==3){keyValue.push(new x3dom.fields.Quaternion(normalize(array[i-3]),normalize(array[i-2]),normalize(array[i-1]),normalize(val)));}})\nreturn keyValue;}}));x3dom.registerNodeType(\"PositionInterpolator\",\"Interpolation\",defineClass(x3dom.nodeTypes.X3DInterpolatorNode,function(ctx){x3dom.nodeTypes.PositionInterpolator.superClass.call(this,ctx);this.addField_MFVec3f(ctx,'keyValue',[]);},{fieldChanged:function(fieldName)\n{if(fieldName===\"set_fraction\")\n{var value;if(this._vf.interpolation==='CUBICSPLINE')\n{value=this.cubicSplineInterp(this._vf.set_fraction,function(startInTangent,start,endOutTangent,end,h00,h10,h01,h11){function _applyBasis(axis)\n{return h00*start[axis]+h10*startInTangent[axis]+h01*end[axis]+h11*endOutTangent[axis];}\nvar result=new x3dom.fields.SFVec3f();result.x=_applyBasis('x');result.y=_applyBasis('y');result.z=_applyBasis('z');return result;});}\nelse\n{value=this.linearInterp(this._vf.set_fraction,function(a,b,t){var result=a.multiply(1.0-t);result.x+=t*b.x;result.y+=t*b.y;result.z+=t*b.z;return result;});}\nif(value!=undefined&&value!=this._lastValue)\n{this._lastValue=value;this.postMessage('value_changed',value);}}},keyValueFromAccessor:function(array)\n{keyValue=new x3dom.fields.MFVec3f();array.forEach(function(val,i)\n{if(i%3==2){keyValue.push(new x3dom.fields.SFVec3f(array[i-2],array[i-1],val));}})\nreturn keyValue;}}));x3dom.registerNodeType(\"PositionInterpolator2D\",\"Interpolation\",defineClass(x3dom.nodeTypes.X3DInterpolatorNode,function(ctx){x3dom.nodeTypes.PositionInterpolator2D.superClass.call(this,ctx);this.addField_MFVec2f(ctx,'keyValue',[]);},{fieldChanged:function(fieldName)\n{if(fieldName===\"set_fraction\")\n{var value=this.linearInterp(this._vf.set_fraction,function(a,b,t){return a.multiply(1.0-t).add(b.multiply(t));});this.postMessage('value_changed',value);}}}));x3dom.registerNodeType(\"NormalInterpolator\",\"Interpolation\",defineClass(x3dom.nodeTypes.X3DInterpolatorNode,function(ctx){x3dom.nodeTypes.NormalInterpolator.superClass.call(this,ctx);this.addField_MFVec3f(ctx,'keyValue',[]);},{fieldChanged:function(fieldName)\n{if(fieldName===\"set_fraction\")\n{var value=this.linearInterp(this._vf.set_fraction,function(a,b,t){return a.multiply(1.0-t).add(b.multiply(t)).normalize();});if(value!=undefined&&value!=this._lastValue)\n{this._lastValue=value;this.postMessage('value_changed',value);}}}}));x3dom.registerNodeType(\"ColorInterpolator\",\"Interpolation\",defineClass(x3dom.nodeTypes.X3DInterpolatorNode,function(ctx){x3dom.nodeTypes.ColorInterpolator.superClass.call(this,ctx);this.addField_MFColor(ctx,'keyValue',[]);},{fieldChanged:function(fieldName)\n{if(fieldName===\"set_fraction\")\n{var value=this.linearInterp(this._vf.set_fraction,function(a,b,t){return a.multiply(1.0-t).add(b.multiply(t));});if(value!=undefined&&value!=this._lastValue)\n{this._lastValue=value;this.postMessage('value_changed',value);}}}}));x3dom.registerNodeType(\"ScalarInterpolator\",\"Interpolation\",defineClass(x3dom.nodeTypes.X3DInterpolatorNode,function(ctx){x3dom.nodeTypes.ScalarInterpolator.superClass.call(this,ctx);this.addField_MFFloat(ctx,'keyValue',[]);},{fieldChanged:function(fieldName)\n{if(fieldName===\"set_fraction\")\n{var value;if(this._vf.interpolation==='CUBICSPLINE')\n{var scope=this;value=this.cubicSplineInterp(this._vf.set_fraction,function(startInTangent,start,endOutTangent,end,h00,h10,h01,h11){return h00*start+h10*startInTangent+h01*end+h11*endOutTangent;});}\nelse\n{value=this.linearInterp(this._vf.set_fraction,function(a,b,t){return(1.0-t)*a+t*b;});}\nif(value!=undefined&&value!=this._lastValue)\n{this._lastValue=value;this.postMessage('value_changed',value);}}},keyValueFromAccessor:function(array,type)\n{var normalize=this.normalizeFromType[type];return array.map(function(val)\n{return normalize(val);});}}));x3dom.registerNodeType(\"CoordinateInterpolator\",\"Interpolation\",defineClass(x3dom.nodeTypes.X3DInterpolatorNode,function(ctx){x3dom.nodeTypes.CoordinateInterpolator.superClass.call(this,ctx);this.addField_MFVec3f(ctx,'keyValue',[]);if(ctx&&ctx.xmlNode.hasAttribute('keyValue')){this._vf.keyValue=[];var arr=x3dom.fields.MFVec3f.parse(ctx.xmlNode.getAttribute('keyValue'));var key=this._vf.key.length>0?this._vf.key.length:1;var len=arr.length/key;for(var i=0;i<key;i++){var val=new x3dom.fields.MFVec3f();for(var j=0;j<len;j++){val.push(arr[i*len+j]);}\nthis._vf.keyValue.push(val);}}},{fieldChanged:function(fieldName)\n{if(fieldName===\"set_fraction\")\n{var value=this.linearInterp(this._vf.set_fraction,function(a,b,t){var val=new x3dom.fields.MFVec3f();for(var i=0;i<a.length;i++)\nval.push(a[i].multiply(1.0-t).add(b[i].multiply(t)));return val;});if(value!=undefined&&value!=this._lastValue)\n{this._lastValue=value;this.postMessage('value_changed',value);}}}}));x3dom.registerNodeType(\"SplinePositionInterpolator\",\"Interpolation\",defineClass(x3dom.nodeTypes.X3DInterpolatorNode,function(ctx){x3dom.nodeTypes.SplinePositionInterpolator.superClass.call(this,ctx);this.addField_MFVec3f(ctx,'keyValue',[]);this.addField_MFVec3f(ctx,'keyVelocity',[]);this.addField_SFBool(ctx,'closed',false);this.addField_SFBool(ctx,'normalizeVelocity',false);this.dtot=0.0;this.T0=[];this.T1=[];this.checkSanity=function(){var sane=(this._vf.key.length==this._vf.keyValue.length)&&((this._vf.key.length==this._vf.keyVelocity.length)||(this._vf.keyVelocity.length==2&&this._vf.key.length>=2)||(this._vf.keyVelocity.length==0));if(!sane)\nx3dom.debug.logWarning(\"SplinePositionInterpolator Node: 'key' , 'keyValue' and/or 'keyVelocity' fields have inappropriate sizes\");};this.calcDtot=function()\n{this.dtot=0.0;for(var i=0;i<this._vf.key.length-1;i++)\n{this.dtot+=Math.abs(this._vf.key[i]-this._vf.key[i+1]);}};this.calcAdjustedKeyVelocity=function()\n{var i,Ti,F_plus_i,F_minus_i;var N=this._vf.key.length;if(this._vf.keyVelocity.length==N)\n{for(i=0;i<N;i++)\n{Ti=this._vf.keyVelocity[i];if(this._vf.normalizeVelocity)\nTi=Ti.multiply(this.dtot/Ti.length());F_plus_i=(i==0||i==N-1)?1.0:2.0*(this._vf.key[i]-this._vf.key[i-1])/(this._vf.key[i+1]-this._vf.key[i-1]);F_minus_i=(i==0||i==N-1)?1.0:2.0*(this._vf.key[i+1]-this._vf.key[i])/(this._vf.key[i+1]-this._vf.key[i-1]);this.T0[i]=Ti.multiply(F_plus_i);this.T1[i]=Ti.multiply(F_minus_i);}}\nelse if(this._vf.keyVelocity.length==2&&N>2)\n{for(i=0;i<N;i++)\n{if(i==0)\nTi=this._vf.keyVelocity[0];else if(i==N-1)\nTi=this._vf.keyVelocity[1];else\nTi=this._vf.keyValue[i+1].subtract(this._vf.keyValue[i-1]).multiply(0.5);if(this._vf.normalizeVelocity)\nTi=Ti.multiply(this.dtot/Ti.length());F_plus_i=(i==0||i==N-1)?1.0:2.0*(this._vf.key[i]-this._vf.key[i-1])/(this._vf.key[i+1]-this._vf.key[i-1]);F_minus_i=(i==0||i==N-1)?1.0:2.0*(this._vf.key[i+1]-this._vf.key[i])/(this._vf.key[i+1]-this._vf.key[i-1]);this.T0[i]=Ti.multiply(F_plus_i);this.T1[i]=Ti.multiply(F_minus_i);}}\nelse\n{var closed=this._vf.closed&&this._vf.keyValue[0].equals(this._vf.keyValue[N-1],0.00001);for(i=0;i<N;i++)\n{if((i==0||i==N-1)&&!closed)\n{this.T0[i]=new x3dom.fields.SFVec3f(0,0,0);this.T1[i]=new x3dom.fields.SFVec3f(0,0,0);continue;}\nelse if((i==0||i==N-1)&&closed)\n{Ti=this._vf.keyValue[1].subtract(this._vf.keyValue[N-2]).multiply(0.5);if(i==0){F_plus_i=2.0*(this._vf.key[0]-this._vf.key[N-2])/(this._vf.key[1]-this._vf.key[N-2]);F_minus_i=2.0*(this._vf.key[1]-this._vf.key[0])/(this._vf.key[1]-this._vf.key[N-2]);}\nelse{F_plus_i=2.0*(this._vf.key[N-1]-this._vf.key[N-2])/(this._vf.key[1]-this._vf.key[N-2]);F_minus_i=2.0*(this._vf.key[1]-this._vf.key[N-1])/(this._vf.key[1]-this._vf.key[N-2]);}\nF_plus_i=2.0*(this._vf.key[N-1]-this._vf.key[N-2])/(this._vf.key[N-2]-this._vf.key[1]);F_minus_i=2.0*(this._vf.key[1]-this._vf.key[0])/(this._vf.key[N-2]-this._vf.key[1]);}\nelse\n{Ti=this._vf.keyValue[i+1].subtract(this._vf.keyValue[i-1]).multiply(0.5);F_plus_i=2.0*(this._vf.key[i]-this._vf.key[i-1])/(this._vf.key[i+1]-this._vf.key[i-1]);F_minus_i=2.0*(this._vf.key[i+1]-this._vf.key[i])/(this._vf.key[i+1]-this._vf.key[i-1]);}\nthis.T0[i]=Ti.multiply(F_plus_i);this.T1[i]=Ti.multiply(F_minus_i);}}};this.checkSanity();this.calcDtot();this.calcAdjustedKeyVelocity();},{fieldChanged:function(fieldName)\n{switch(fieldName)\n{case'key':case'keyValue':case'keyVelocity':{this.checkSanity();this.calcDtot();this.calcAdjustedKeyVelocity();break;}\ncase'closed':case'normalizeVelocity':{this.calcAdjustedKeyVelocity();break;}\ncase'set_fraction':{var value;if(this._vf.key.length>0.0){if(this._vf.set_fraction<=this._vf.key[0])\nvalue=x3dom.fields.SFVec3f.copy(this._vf.keyValue[0]);else if(this._vf.set_fraction>=this._vf.key[this._vf.key.length-1])\nvalue=x3dom.fields.SFVec3f.copy(this._vf.keyValue[this._vf.key.length-1]);}\nfor(var i=0;i<this._vf.key.length-1;i++){if((this._vf.key[i]<this._vf.set_fraction)&&(this._vf.set_fraction<=this._vf.key[i+1])){var s=(this._vf.set_fraction-this._vf.key[i])/(this._vf.key[i+1]-this._vf.key[i]);var S_H=new x3dom.fields.SFVec4f(2.0*s*s*s-3.0*s*s+1.0,-2.0*s*s*s+3.0*s*s,s*s*s-2.0*s*s+s,s*s*s-s*s);value=new x3dom.fields.SFVec3f(S_H.x*this._vf.keyValue[i].x+S_H.y*this._vf.keyValue[i+1].x+S_H.z*this.T0[i].x+S_H.w*this.T1[i+1].x,S_H.x*this._vf.keyValue[i].y+S_H.y*this._vf.keyValue[i+1].y+S_H.z*this.T0[i].y+S_H.w*this.T1[i+1].y,S_H.x*this._vf.keyValue[i].z+S_H.y*this._vf.keyValue[i+1].z+S_H.z*this.T0[i].z+S_H.w*this.T1[i+1].z);break;}}\nif(value!=undefined&&value!=this._lastValue)\n{this._lastValue=value;this.postMessage('value_changed',value);}}}}}));x3dom.registerNodeType(\"TimeSensor\",\"Time\",defineClass(x3dom.nodeTypes.X3DSensorNode,function(ctx){x3dom.nodeTypes.TimeSensor.superClass.call(this,ctx);if(ctx)\nctx.doc._nodeBag.timer.push(this);else\nx3dom.debug.logWarning(\"TimeSensor: No runtime context found!\");this.addField_SFTime(ctx,'cycleInterval',1);this.addField_SFBool(ctx,'loop',false);this.addField_SFTime(ctx,'startTime',0);this.addField_SFTime(ctx,'stopTime',0);this.addField_SFTime(ctx,'pauseTime',0);this.addField_SFTime(ctx,'resumeTime',0);this.addField_SFTime(ctx,'cycleTime',0);this.addField_SFTime(ctx,'elapsedTime',0);this.addField_SFFloat(ctx,'fraction_changed',0);this.addField_SFBool(ctx,'isActive',false);this.addField_SFBool(ctx,'isPaused',false);this.addField_SFTime(ctx,'time',0);this.addField_SFBool(ctx,'first',true);this.addField_SFFloat(ctx,'firstCycle',0.0);this._prevCycle=-1;this._lastTime=0;this._cycleStopTime=0;this._activatedTime=0;if(this._vf.startTime>0){this._updateCycleStopTime();}\nthis._backupStartTime=this._vf.startTime;this._backupStopTime=this._vf.stopTime;this._backupCycleInterval=this._vf.cycleInterval;},{tick:function(time)\n{if(!this._vf.enabled){this._lastTime=time;return false;}\nvar isActive=(this._vf.cycleInterval>0&&time>=this._vf.startTime&&(time<this._vf.stopTime||this._vf.stopTime<=this._vf.startTime)&&(this._vf.loop==true||(this._vf.loop==false&&time<this._cycleStopTime)));if(isActive&&!this._vf.isActive){this.postMessage('isActive',true);this._activatedTime=time;}\nif(isActive||this._vf.isActive){this.postMessage('elapsedTime',time-this._activatedTime);var isPaused=(time>=this._vf.pauseTime&&this._vf.pauseTime>this._vf.resumeTime);if(isPaused&&!this._vf.isPaused){this.postMessage('isPaused',true);this.postMessage('pauseTime',time);}else if(!isPaused&&this._vf.isPaused){this.postMessage('isPaused',false);this.postMessage('resumeTime',time);}\nif(!isPaused){var cycleFrac=this._getCycleAt(time);var cycle=Math.floor(cycleFrac);var cycleTime=this._vf.startTime+cycle*this._vf.cycleInterval;var adjustTime=0;if(this._vf.stopTime>this._vf.startTime&&this._lastTime<this._vf.stopTime&&time>=this._vf.stopTime)\nadjustTime=this._vf.stopTime;else if(this._lastTime<cycleTime&&time>=cycleTime)\nadjustTime=cycleTime;if(adjustTime>0){time=adjustTime;cycleFrac=this._getCycleAt(time);cycle=Math.floor(cycleFrac);}\nvar fraction=cycleFrac-cycle;if(fraction<x3dom.fields.Eps){fraction=(this._lastTime<this._vf.startTime?0.0:1.0);this.postMessage('cycleTime',time);}\nthis.postMessage('fraction_changed',fraction);this.postMessage('time',time);}}\nif(!isActive&&this._vf.isActive)\nthis.postMessage('isActive',false);this._lastTime=time;return true;},fieldChanged:function(fieldName)\n{if(fieldName==\"enabled\"){if(!this._vf.enabled&&this._vf.isActive){this.postMessage('isActive',false);}}\nelse if(fieldName==\"startTime\"){if(this._vf.isActive){this._vf.startTime=this._backupStartTime;return;}\nthis._backupStartTime=this._vf.startTime;this._updateCycleStopTime();}\nelse if(fieldName==\"stopTime\"){if(this._vf.isActive&&this._vf.stopTime<=this._vf.startTime){this._vf.stopTime=this._backupStopTime;return;}\nthis._backupStopTime=this._vf.stopTime;}\nelse if(fieldName==\"cycleInterval\"){if(this._vf.isActive){this._vf.cycleInterval=this._backupCycleInterval;return;}\nthis._backupCycleInterval=this._vf.cycleInterval;}\nelse if(fieldName==\"loop\"){this._updateCycleStopTime();}},parentRemoved:function(parent)\n{if(this._parentNodes.length===0){var doc=this.findX3DDoc();for(var i=0,n=doc._nodeBag.timer.length;i<n;i++){if(doc._nodeBag.timer[i]===this){doc._nodeBag.timer.splice(i,1);}}}},_getCycleAt:function(time)\n{return Math.max(0.0,time-this._vf.startTime)/this._vf.cycleInterval;},_updateCycleStopTime:function()\n{if(this._vf.loop==false){var now=new Date().getTime()/1000;var cycleToStop=Math.floor(this._getCycleAt(now))+1;this._cycleStopTime=this._vf.startTime+cycleToStop*this._vf.cycleInterval;}\nelse{this._cycleStopTime=0;}}}));x3dom.registerNodeType(\"X3DTimeDependentNode\",\"Time\",defineClass(x3dom.nodeTypes.X3DChildNode,function(ctx){x3dom.nodeTypes.X3DTimeDependentNode.superClass.call(this,ctx);this.addField_SFBool(ctx,'loop',false);}));x3dom.registerNodeType(\"Anchor\",\"Networking\",defineClass(x3dom.nodeTypes.X3DGroupingNode,function(ctx){x3dom.nodeTypes.Anchor.superClass.call(this,ctx);this.addField_MFString(ctx,'url',[]);this.addField_MFString(ctx,'parameter',[]);this.addField_SFString(ctx,'description',\"\");},{doIntersect:function(line){var isect=false;for(var i=0;i<this._childNodes.length;i++){if(this._childNodes[i]){isect=this._childNodes[i].doIntersect(line)||isect;}}\nreturn isect;},handleTouch:function(){var url=this._vf.url.length?this._vf.url[0]:\"\";var aPos=url.search(\"#\");var anchor=\"\";if(aPos>=0)\nanchor=url.slice(aPos+1);var param=this._vf.parameter.length?this._vf.parameter[0]:\"\";var tPos=param.search(\"target=\");var target=\"\";if(tPos>=0)\ntarget=param.slice(tPos+7);x3dom.debug.logInfo(\"Anchor url=\"+url+\", target=\"+target+\", #viewpoint=\"+anchor);if(target.length!=0||target!=\"_self\"){window.open(this._nameSpace.getURL(url),target);}\nelse{window.location=this._nameSpace.getURL(url);}}}));x3dom.registerNodeType(\"Inline\",\"Networking\",defineClass(x3dom.nodeTypes.X3DGroupingNode,function(ctx){x3dom.nodeTypes.Inline.superClass.call(this,ctx);this.addField_MFString(ctx,'url',[]);this.addField_SFBool(ctx,'load',true);this.addField_MFString(ctx,'nameSpaceName',[]);this.addField_SFString(ctx,'contentType',\"\");this.addField_SFBool(ctx,'mapDEFToID',false);this.initDone=false;this.count=0;this.numRetries=x3dom.nodeTypes.Inline.MaximumRetries;this.ContentType={X3D:\"model/x3d+xml\",GLTF:\"model/gltf+json\",GLB:\"model/gltf-binary\",X3DJ:\"model/x3d+json\"};},{fieldChanged:function(fieldName)\n{if(fieldName==\"url\"||fieldName==\"load\"){for(var i=0;i<this._childNodes.length;i++)\n{this.removeChild(this._childNodes[i]);}\nif(this._vf.nameSpaceName.length!=0){var node=this._xmlNode;if(node&&node.hasChildNodes())\n{while(node.childNodes.length>=1)\n{node.removeChild(node.firstChild);}}}\nthis.loadInline();}\nelse if(fieldName==\"render\"){this.invalidateVolume();}},nodeChanged:function()\n{if(!this.initDone){this.initDone=true;this.loadInline();}},fireEvents:function(eventType)\n{if(this._xmlNode&&(this._xmlNode['on'+eventType]||this._xmlNode.hasAttribute('on'+eventType)||this._listeners[eventType]))\n{var event={target:this._xmlNode,type:eventType,error:(eventType==\"error\")?\"XMLHttpRequest Error\":\"\",cancelBubble:false,stopPropagation:function(){this.cancelBubble=true;}};try{var attrib=this._xmlNode[\"on\"+eventType];if(typeof(attrib)===\"function\"){attrib.call(this._xmlNode,event);}\nelse{var funcStr=this._xmlNode.getAttribute(\"on\"+eventType);var func=new Function('event',funcStr);func.call(this._xmlNode,event);}\nvar list=this._listeners[eventType];if(list){for(var i=0;i<list.length;i++){list[i].call(this._xmlNode,event);}}}\ncatch(ex){x3dom.debug.logException(ex);}}},isValidContentType:function(contentType)\n{for(var type in this.ContentType)\n{if(contentType===this.ContentType[type])\n{return true;}}\nreturn false;},getContentType:function()\n{if(this._vf.contentType!=\"\"&&this.isValidContentType(this._vf.contentType))\n{return this._vf.contentType;}\nif(this._vf.url.length&&this._vf.url[0].length)\n{var lastPointIndex=this._vf.url[0].lastIndexOf(\".\");if(lastPointIndex!=-1)\n{var suffix=this._vf.url[0].substr(lastPointIndex).toLowerCase();switch(suffix)\n{case\".x3d\":return this.ContentType.X3D;case\".gltf\":return this.ContentType.GLTF;case\".glb\":return this.ContentType.GLB;case\".json\":return this.ContentType.X3DJ;}}}},loadX3D:function(inlScene,nameSpace)\n{if(!this._vf.load){x3dom.debug.logInfo('Inline: load field prevented loading of '+this._vf.url[0]);return;}\nvar that=this;var newScene=null;if(inlScene)\n{newScene=nameSpace.setupTree(inlScene);if(that._vf.nameSpaceName.length!=0)\n{while(inlScene.children.length){var childDomNode=inlScene.children[0];setNamespace(that._vf.nameSpaceName,childDomNode,that._vf.mapDEFToID);that._xmlNode.appendChild(childDomNode);}}}\nelse{x3dom.debug.logError('No Scene in resource');}\nvar global=x3dom.getGlobal();if(that._childNodes.length>0&&that._childNodes[0]&&that._childNodes[0]._nameSpace)\nthat._nameSpace.removeSpace(that._childNodes[0]._nameSpace);while(that._childNodes.length!==0)\nglobal['_remover']=that.removeChild(that._childNodes[0]);delete global['_remover'];if(newScene)\n{that.addChild(newScene);that.invalidateVolume();var theScene=that._nameSpace.doc._scene;if(theScene){theScene.invalidateVolume();window.setTimeout(function(){that.invalidateVolume();theScene.updateVolume();that._nameSpace.doc.needRender=true;that._nameSpace.doc.decrementDownloads();that._nameSpace.doc.needRender=true;x3dom.debug.logInfo('Inline: added '+that._vf.url[0]+' to scene.');},1000);}\nthat.fireEvents(\"load\");}\nnewScene=null;nameSpace=null;inlScene=null;xml=null;},loadInline:function()\n{var that=this;var contentType=this.getContentType();var isBinary=false;var xhr=new window.XMLHttpRequest();xhr.onreadystatechange=function()\n{if(xhr.readyState==4)\n{if(xhr.status===x3dom.nodeTypes.Inline.AwaitTranscoding)\n{if(that.count<that.numRetries)\n{that.count++;var refreshTime=+xhr.getResponseHeader(\"Refresh\")||5;x3dom.debug.logInfo('XHR status: '+xhr.status+' - Await Transcoding ('+that.count+'/'+that.numRetries+'): '+'Next request in '+refreshTime+' seconds');window.setTimeout(function(){that._nameSpace.doc.decrementDownloads();;that.loadInline();},refreshTime*1000);}\nelse\n{x3dom.debug.logError('XHR status: '+xhr.status+' - Await Transcoding ('+that.count+'/'+that.numRetries+'): '+'No Retries left');that._nameSpace.doc.decrementDownloads();;that.count=0;}}\nelse if(xhr.status==200||xhr.status==0)\n{x3dom.debug.logInfo('Inline: downloading '+that._vf.url[0]+' done.');if(contentType==undefined)\n{contentType=xhr.getResponseHeader(\"Content-Type\");}\nthat.count=0;var inlineScene;var namespace=that.addNameSpace();if(contentType==that.ContentType.GLTF||contentType==that.ContentType.GLB)\n{if(xhr.response)\n{var loader=new x3dom.glTF2Loader(namespace);inlineScene=loader.load(xhr.response,isBinary);that.loadX3D(inlineScene,namespace);}\nelse\n{x3dom.debug.logError('Invalide XHR Response');that.fireEvents(\"error\");that._nameSpace.doc.decrementDownloads();;that.count=0;}}\nelse if(contentType==that.ContentType.X3DJ)\n{if(xhr.response)\n{var json=x3dom.protoExpander.prototypeExpander(xhr.responseURL,xhr.response);var parser=new x3dom.JSONParser();var xml=parser.parseJavaScript(json);if(xml!==undefined&&xml!==null)\n{inlineScene=xml.getElementsByTagName('Scene')[0]||xml.getElementsByTagName('scene')[0];that.loadX3D(inlineScene,namespace);}\nelse\n{that.fireEvents(\"error\");that._nameSpace.doc.decrementDownloads();that.count=0;}}\nelse\n{x3dom.debug.logError('Invalide XHR Response');that.fireEvents(\"error\");that._nameSpace.doc.decrementDownloads();that.count=0;}}\nelse if(contentType==that.ContentType.X3D)\n{var xml;if(navigator.appName==\"Microsoft Internet Explorer\")\n{xml=new DOMParser().parseFromString(xhr.responseText,\"text/xml\");}\nelse\n{xml=xhr.responseXML;}\nif(xml!==undefined&&xml!==null)\n{inlineScene=xml.getElementsByTagName('Scene')[0]||xml.getElementsByTagName('scene')[0];that.loadX3D(inlineScene,namespace);}\nelse\n{that.fireEvents(\"error\");that._nameSpace.doc.decrementDownloads();that.count=0;}}}\nelse\n{x3dom.debug.logError('XHR status: '+xhr.status+' - XMLHttpRequest requires web server running!');that.fireEvents(\"error\");that._nameSpace.doc.decrementDownloads();that.count=0;}}};if(this._vf.url.length&&this._vf.url[0].length)\n{var xhrURI=this._nameSpace.getURL(this._vf.url[0]);xhr.open('GET',xhrURI,true);xhr.setRequestHeader('Accept','model/x3d+xml; q=1.0, model/gltf+json; q=0.5, model/gltf-binary; q=0.5');if(xhr.overrideMimeType)\n{if(contentType==this.ContentType.X3D)\n{xhr.overrideMimeType('text/xml');}\nif(contentType==this.ContentType.X3DJ)\n{xhr.overrideMimeType('application/json');xhr.responseType=\"json\";}\nelse if(contentType==this.ContentType.GLTF)\n{isBinary=false;xhr.responseType=\"json\";}\nelse if(contentType==this.ContentType.GLB)\n{isBinary=true;xhr.responseType=\"arraybuffer\";}}\ntry\n{this._nameSpace.doc.incrementDownloads();x3dom.RequestManager.addRequest(xhr);}\ncatch(ex){this.fireEvents(\"error\");x3dom.debug.logError(this._vf.url[0]+\": \"+ex);this._nameSpace.doc.decrementDownloads();}}},addNameSpace:function()\n{var nsName=(this._vf.nameSpaceName.length!=0)?this._vf.nameSpaceName.toString().replace(' ',''):\"\";var nameSpace=new x3dom.NodeNameSpace(nsName,this._nameSpace.doc);var url=this._vf.url.length?this._vf.url[0]:\"\";if((url[0]==='/')||(url.indexOf(\":\")>=0))\n{nameSpace.setBaseURL(url);}\nelse\n{nameSpace.setBaseURL(this._nameSpace.baseURL+url);}\nthis._nameSpace.addSpace(nameSpace);return nameSpace;}}));x3dom.nodeTypes.Inline.AwaitTranscoding=202;x3dom.nodeTypes.Inline.MaximumRetries=15;function setNamespace(prefix,childDomNode,mapDEFToID)\n{if(childDomNode instanceof Element&&childDomNode.__setAttribute!==undefined){if(childDomNode.hasAttribute('id')){childDomNode.__setAttribute('id',prefix.toString().replace(' ','')+'__'+childDomNode.getAttribute('id'));}else if(childDomNode.hasAttribute('DEF')&&mapDEFToID){childDomNode.__setAttribute('id',prefix.toString().replace(' ','')+'__'+childDomNode.getAttribute('DEF'));if(!childDomNode.id)\nchildDomNode.id=childDomNode.__getAttribute('id');}}\nif(childDomNode.hasChildNodes()){Array.forEach(childDomNode.childNodes,function(children){setNamespace(prefix,children,mapDEFToID);});}}\nx3dom.registerNodeType(\"MultiPart\",\"Networking\",defineClass(x3dom.nodeTypes.Inline,function(ctx){x3dom.nodeTypes.MultiPart.superClass.call(this,ctx);this.addField_MFString(ctx,'urlIDMap',[]);this.addField_SFBool(ctx,'isPickable',true);this.addField_SFString(ctx,'sortType','auto');this.addField_SFBool(ctx,'solid',false);this.addField_SFInt32(ctx,'sortKey',0);this.addField_SFString(ctx,'initialVisibility','auto');this._idMap=null;this._inlineNamespace=null;this._highlightedParts=[];this._minId=0;this._maxId=0;this._lastId=-1;this._lastClickedId=-1;this._lastButton=0;this._identifierToPartId=[];this._identifierToAppId=[];this._visiblePartsPerShape=[];this._partVolume=[];this._partVisibility=[];this._originalColor=[];this._materials=[];},{fieldChanged:function(fieldName)\n{if(fieldName==\"url\"){if(this._vf.nameSpaceName.length!=0){var node=this._xmlNode;if(node&&node.hasChildNodes())\n{while(node.childNodes.length>=1)\n{node.removeChild(node.firstChild);}}}\nthis.loadInline();}\nelse if(fieldName==\"render\"){this.invalidateVolume();}},nodeChanged:function()\n{if(!this.initDone){this.initDone=true;this.loadIDMap();}},getVolume:function()\n{var vol=this._graph.volume;if(!this.volumeValid()&&this._vf.render)\n{for(var i=0;i<this._partVisibility.length;i++)\n{if(!this._partVisibility[i])\ncontinue;var childVol=this._partVolume[i];if(childVol&&childVol.isValid())\nvol.extendBounds(childVol.min,childVol.max);}}\nif(!vol.equals(this._graph.lastVolume))\n{this._graph.lastVolume=x3dom.fields.BoxVolume.copy(vol);var event={target:this._xmlNode,type:\"volumechanged\",volume:x3dom.fields.BoxVolume.copy(vol)};this.callEvtHandler(\"onvolumechanged\",event);}\nreturn vol;},handleEvents:function(e)\n{if(this._inlineNamespace){var colorMap=this._inlineNamespace.defMap[\"MultiMaterial_ColorMap\"];var emissiveMap=this._inlineNamespace.defMap[\"MultiMaterial_EmissiveMap\"];var specularMap=this._inlineNamespace.defMap[\"MultiMaterial_SpecularMap\"];var visibilityMap=this._inlineNamespace.defMap[\"MultiMaterial_VisibilityMap\"];if(e.pickedId==-1&&e.button!=0){this._lastClickedId=-1;this._lastButton=e.button;}else if(e.pickedId==-1&&e.button==0){this._lastClickedId=-1;this._lastButton=0;}\nif(e.pickedId!=-1){e.part=new x3dom.Parts(this,[e.pickedId-this._minId],colorMap,emissiveMap,specularMap,visibilityMap);e.partID=this._idMap.mapping[e.pickedId-this._minId].name;e.type=\"mousemove\";this.callEvtHandler(\"onmousemove\",e);e.type=\"mouseover\";this.callEvtHandler(\"onmouseover\",e);if(!e.mouseup&&e.button&&e.button!=this._lastButton){e.type=\"mousedown\";this._lastButton=e.button;if(this._lastClickedId==-1){this._lastClickedId=e.pickedId;}\nthis.callEvtHandler(\"onmousedown\",e);}\nif(e.mouseup||(this._lastButton!=0&&e.button==0)){e.type=\"mouseup\";this.callEvtHandler(\"onmouseup\",e);this._lastButton=0;if(e.pickedId==this._lastClickedId){this._lastClickedId=-1;e.type=\"click\";this.callEvtHandler(\"onclick\",e);}\nthis._lastClickedId=-1;}\nif(e.pickedId!=this._lastId){if(this._lastId!=-1){e.part=new x3dom.Parts(this,[this._lastId-this._minId],colorMap,emissiveMap,specularMap,visibilityMap);e.partID=this._idMap.mapping[this._lastId-this._minId].name;e.type=\"mouseleave\";this.callEvtHandler(\"onmouseleave\",e);}\ne.part=new x3dom.Parts(this,[e.pickedId-this._minId],colorMap,emissiveMap,specularMap,visibilityMap);e.partID=this._idMap.mapping[e.pickedId-this._minId].name;e.type=\"mouseenter\";this.callEvtHandler(\"onmouseenter\",e);this._lastId=e.pickedId;}\nthis._lastId=e.pickedId;}\nelse if(this._lastId!=-1){e.part=new x3dom.Parts(this,[this._lastId-this._minId],colorMap,emissiveMap,specularMap,visibilityMap);e.partID=this._idMap.mapping[this._lastId-this._minId].name;e.type=\"mouseout\";this.callEvtHandler(\"onmouseout\",e);e.type=\"mouseleave\";this.callEvtHandler(\"onmouseleave\",e);this._lastId=-1;}}},loadIDMap:function()\n{if(this._vf.urlIDMap.length&&this._vf.urlIDMap[0].length)\n{var i;var that=this;var idMapURI=this._nameSpace.getURL(this._vf.urlIDMap[0]);var xhr=new XMLHttpRequest();xhr.open(\"GET\",idMapURI,true);xhr.onload=function()\n{that._idMap=JSON.parse(this.responseText);if(that._nameSpace.doc._scene._multiPartMap==null){that._nameSpace.doc._scene._multiPartMap={numberOfIds:0,multiParts:[]};}\nthat._minId=that._nameSpace.doc._scene._multiPartMap.numberOfIds;that._maxId=that._minId+that._idMap.numberOfIDs-1;that._nameSpace.doc._scene._multiPartMap.numberOfIds+=that._idMap.numberOfIDs;that._nameSpace.doc._scene._multiPartMap.multiParts.push(that);for(i=0;i<that._idMap.mapping.length;i++)\n{if(!that._identifierToPartId[that._idMap.mapping[i].name]){that._identifierToPartId[that._idMap.mapping[i].name]=[];}\nif(!that._identifierToPartId[that._idMap.mapping[i].appearance]){that._identifierToPartId[that._idMap.mapping[i].appearance]=[];}\nthat._identifierToPartId[that._idMap.mapping[i].name].push(i);that._identifierToPartId[that._idMap.mapping[i].appearance].push(i);if(!that._partVolume[i]){var min=x3dom.fields.SFVec3f.parse(that._idMap.mapping[i].min);var max=x3dom.fields.SFVec3f.parse(that._idMap.mapping[i].max);that._partVolume[i]=new x3dom.fields.BoxVolume(min,max);}}\nfor(i=0;i<that._idMap.appearance.length;i++)\n{that._identifierToAppId[that._idMap.appearance[i].name]=i;}\nthat.loadInline();};x3dom.RequestManager.addRequest(xhr);}},createMaterialData:function()\n{var diffuseColor,transparency,specularColor,shininess,emissiveColor,ambientIntensity;var backDiffuseColor,backTransparency,backSpecularColor,backShininess,backEmissiveColor,backAmbientIntensity;var rgba_DT=\"\",rgba_SS=\"\",rgba_EA=\"\";var rgba_DT_B=\"\",rgba_SS_B=\"\",rgba_EA_B=\"\";var size=Math.ceil(Math.sqrt(this._idMap.numberOfIDs));size=x3dom.Utils.nextHighestPowerOfTwo(size);var sizeTwo=size*2.0;var diffuseTransparencyData=size+\" \"+sizeTwo+\" 4\";var specularShininessData=size+\" \"+sizeTwo+\" 4\";var emissiveAmbientIntensityData=size+\" \"+sizeTwo+\" 4\";for(var i=0;i<size*size;i++)\n{if(i<this._idMap.mapping.length)\n{var appName=this._idMap.mapping[i].appearance;var appID=this._identifierToAppId[appName];if(this._idMap.appearance[appID].material.ambientIntensity){ambientIntensity=this._idMap.appearance[appID].material.ambientIntensity}else{ambientIntensity=\"0.2\";}\nif(this._idMap.appearance[appID].material.backAmbientIntensity){backAmbientIntensity=this._idMap.appearance[appID].material.backAmbientIntensity}else{backAmbientIntensity=ambientIntensity;}\nif(this._idMap.appearance[appID].material.diffuseColor){diffuseColor=this._idMap.appearance[appID].material.diffuseColor}else{diffuseColor=\"0.8 0.8 0.8\";}\nif(this._idMap.appearance[appID].material.backDiffuseColor){backDiffuseColor=this._idMap.appearance[appID].material.backDiffuseColor}else{backDiffuseColor=diffuseColor;}\nif(this._idMap.appearance[appID].material.emissiveColor){emissiveColor=this._idMap.appearance[appID].material.emissiveColor}else{emissiveColor=\"0.0 0.0 0.0\";}\nif(this._idMap.appearance[appID].material.backEmissiveColor){backEmissiveColor=this._idMap.appearance[appID].material.backEmissiveColor}else{backEmissiveColor=emissiveColor;}\nif(this._idMap.appearance[appID].material.shininess){shininess=this._idMap.appearance[appID].material.shininess;}else{shininess=\"0.2\";}\nif(this._idMap.appearance[appID].material.backShininess){backShininess=this._idMap.appearance[appID].material.backShininess;}else{backShininess=shininess;}\nif(this._idMap.appearance[appID].material.specularColor){specularColor=this._idMap.appearance[appID].material.specularColor;}else{specularColor=\"0 0 0\";}\nif(this._idMap.appearance[appID].material.backSpecularColor){backSpecularColor=this._idMap.appearance[appID].material.backSpecularColor;}else{backSpecularColor=specularColor;}\nif(this._idMap.appearance[appID].material.transparency){transparency=this._idMap.appearance[appID].material.transparency;}else{transparency=0.0;}\nif(this._idMap.appearance[appID].material.backTransparency){backTransparency=this._idMap.appearance[appID].material.backTransparency;}else{backTransparency=transparency;}\nrgba_DT+=\" \"+x3dom.fields.SFColorRGBA.parse(diffuseColor+\" \"+(1.0-transparency)).toUint();rgba_SS+=\" \"+x3dom.fields.SFColorRGBA.parse(specularColor+\" \"+shininess).toUint();rgba_EA+=\" \"+x3dom.fields.SFColorRGBA.parse(emissiveColor+\" \"+ambientIntensity).toUint();rgba_DT_B+=\" \"+x3dom.fields.SFColorRGBA.parse(backDiffuseColor+\" \"+(1.0-backTransparency)).toUint();rgba_SS_B+=\" \"+x3dom.fields.SFColorRGBA.parse(backSpecularColor+\" \"+backShininess).toUint();rgba_EA_B+=\" \"+x3dom.fields.SFColorRGBA.parse(backEmissiveColor+\" \"+backAmbientIntensity).toUint();this._originalColor[i]=rgba_DT;this._materials[i]=new x3dom.MultiMaterial({\"ambientIntensity\":ambientIntensity,\"diffuseColor\":x3dom.fields.SFColor.parse(diffuseColor),\"emissiveColor\":x3dom.fields.SFColor.parse(emissiveColor),\"shininess\":shininess,\"specularColor\":x3dom.fields.SFColor.parse(specularColor),\"transparency\":transparency,\"backAmbientIntensity\":backAmbientIntensity,\"backDiffuseColor\":x3dom.fields.SFColor.parse(backDiffuseColor),\"backEmissiveColor\":x3dom.fields.SFColor.parse(backEmissiveColor),\"backShininess\":backShininess,\"backSpecularColor\":x3dom.fields.SFColor.parse(backSpecularColor),\"backTransparency\":backTransparency});}\nelse\n{rgba_DT+=\" 255\";rgba_SS+=\" 255\";rgba_EA+=\" 255\";rgba_DT_B+=\" 255\";rgba_SS_B+=\" 255\";rgba_EA_B+=\" 255\";}}\ndiffuseTransparencyData+=rgba_DT+rgba_DT_B;specularShininessData+=rgba_SS+rgba_SS_B;emissiveAmbientIntensityData+=rgba_EA+rgba_EA_B;return{\"diffuseTransparency\":diffuseTransparencyData,\"specularShininess\":specularShininessData,\"emissiveAmbientIntensity\":emissiveAmbientIntensityData};},createVisibilityData:function()\n{var i,j;var size=Math.ceil(Math.sqrt(this._idMap.numberOfIDs));size=x3dom.Utils.nextHighestPowerOfTwo(size);var visibilityData=size+\" \"+size+\" 1\";for(i=0;i<size*size;i++)\n{if(i<this._idMap.mapping.length)\n{if(this._vf.initialVisibility=='auto')\n{visibilityData+=\" 255\";if(!this._partVisibility[i]){this._partVisibility[i]=true;}\nfor(j=0;j<this._idMap.mapping[i].usage.length;j++)\n{if(!this._visiblePartsPerShape[this._idMap.mapping[i].usage[j]]){this._visiblePartsPerShape[this._idMap.mapping[i].usage[j]]={val:0,max:0};}\nthis._visiblePartsPerShape[this._idMap.mapping[i].usage[j]].val++;this._visiblePartsPerShape[this._idMap.mapping[i].usage[j]].max++;}}\nelse if(this._vf.initialVisibility=='visible')\n{visibilityData+=\" 255\";if(!this._partVisibility[i]){this._partVisibility[i]=true;}\nfor(j=0;j<this._idMap.mapping[i].usage.length;j++)\n{if(!this._visiblePartsPerShape[this._idMap.mapping[i].usage[j]]){this._visiblePartsPerShape[this._idMap.mapping[i].usage[j]]={val:0,max:0};}\nthis._visiblePartsPerShape[this._idMap.mapping[i].usage[j]].val++;this._visiblePartsPerShape[this._idMap.mapping[i].usage[j]].max++;}}\nelse if(this._vf.initialVisibility=='invisible')\n{visibilityData+=\" 0\";if(!this._partVisibility[i]){this._partVisibility[i]=false;}\nfor(j=0;j<this._idMap.mapping[i].usage.length;j++)\n{if(!this._visiblePartsPerShape[this._idMap.mapping[i].usage[j]]){this._visiblePartsPerShape[this._idMap.mapping[i].usage[j]]={val:0,max:0};}\nthis._visiblePartsPerShape[this._idMap.mapping[i].usage[j]].max++;}}}\nelse\n{visibilityData+=\" 0\";}}\nreturn visibilityData;},replaceMaterials:function(inlScene)\n{var css,shapeDEF,materialData,visibilityData,appearance;var firstMat=true;if(inlScene&&inlScene.hasChildNodes())\n{materialData=this.createMaterialData();visibilityData=this.createVisibilityData();var shapes=inlScene.getElementsByTagName(\"Shape\");for(var s=0;s<shapes.length;s++)\n{shapeDEF=shapes[s].getAttribute(\"DEF\")||shapes[s].getAttribute(\"def\");if(shapeDEF&&this._visiblePartsPerShape[shapeDEF]&&this._visiblePartsPerShape[shapeDEF].val==0)\n{shapes[s].setAttribute(\"render\",\"false\");}\nshapes[s].setAttribute(\"idOffset\",this._minId);shapes[s].setAttribute(\"isPickable\",this._vf.isPickable);var geometries=shapes[s].getElementsByTagName(\"BinaryGeometry\");if(geometries&&geometries.length){for(var g=0;g<geometries.length;g++){geometries[g].setAttribute(\"solid\",this._vf.solid);}}\nvar appearances=shapes[s].getElementsByTagName(\"Appearance\");if(appearances.length)\n{for(var a=0;a<appearances.length;a++)\n{appearances[a].removeAttribute(\"DEF\");appearances[a].removeAttribute(\"USE\");appearances[a].setAttribute(\"sortType\",this._vf.sortType);appearances[a].setAttribute(\"sortKey\",this._vf.sortKey);var materials=appearances[a].getElementsByTagName(\"Material\");if(materials.length)\n{if(firstMat){firstMat=false;css=document.createElement(\"CommonSurfaceShader\");css.setAttribute(\"DEF\",\"MultiMaterial\");var ptDA=document.createElement(\"PixelTexture\");ptDA.setAttribute(\"containerField\",\"multiDiffuseAlphaTexture\");ptDA.setAttribute(\"id\",\"MultiMaterial_ColorMap\");ptDA.setAttribute(\"image\",materialData.diffuseTransparency);var ptEA=document.createElement(\"PixelTexture\");ptEA.setAttribute(\"containerField\",\"multiEmissiveAmbientTexture\");ptEA.setAttribute(\"id\",\"MultiMaterial_EmissiveMap\");ptEA.setAttribute(\"image\",materialData.emissiveAmbientIntensity);var ptSS=document.createElement(\"PixelTexture\");ptSS.setAttribute(\"containerField\",\"multiSpecularShininessTexture\");ptSS.setAttribute(\"id\",\"MultiMaterial_SpecularMap\");ptSS.setAttribute(\"image\",materialData.specularShininess);var ptV=document.createElement(\"PixelTexture\");ptV.setAttribute(\"containerField\",\"multiVisibilityTexture\");ptV.setAttribute(\"id\",\"MultiMaterial_VisibilityMap\");ptV.setAttribute(\"image\",visibilityData);css.appendChild(ptDA);css.appendChild(ptEA);css.appendChild(ptSS);css.appendChild(ptV);}\nelse\n{css=document.createElement(\"CommonSurfaceShader\");css.setAttribute(\"USE\",\"MultiMaterial\");}\nappearances[a].replaceChild(css,materials[0]);}\nelse\n{if(firstMat){firstMat=false;css=document.createElement(\"CommonSurfaceShader\");css.setAttribute(\"DEF\",\"MultiMaterial\");var ptDA=document.createElement(\"PixelTexture\");ptDA.setAttribute(\"containerField\",\"multiDiffuseAlphaTexture\");ptDA.setAttribute(\"id\",\"MultiMaterial_ColorMap\");ptDA.setAttribute(\"image\",materialData.diffuseTransparency);var ptEA=document.createElement(\"PixelTexture\");ptEA.setAttribute(\"containerField\",\"multiEmissiveAmbientTexture\");ptEA.setAttribute(\"id\",\"MultiMaterial_EmissiveMap\");ptEA.setAttribute(\"image\",materialData.emissiveAmbientIntensity);var ptSS=document.createElement(\"PixelTexture\");ptSS.setAttribute(\"containerField\",\"multiSpecularShininessTexture\");ptSS.setAttribute(\"id\",\"MultiMaterial_SpecularMap\");ptSS.setAttribute(\"image\",materialData.specularShininess);var ptV=document.createElement(\"PixelTexture\");ptV.setAttribute(\"containerField\",\"multiVisibilityTexture\");ptV.setAttribute(\"id\",\"MultiMaterial_VisibilityMap\");ptV.setAttribute(\"image\",visibilityData);css.appendChild(ptDA);css.appendChild(ptEA);css.appendChild(ptSS);css.appendChild(ptV);}\nelse\n{css=document.createElement(\"CommonSurfaceShader\");css.setAttribute(\"USE\",\"MultiMaterial\");}\nappearances[a].appendChild(css);}}}\nelse\n{appearance=document.createElement(\"Appearance\");if(firstMat){firstMat=false;css=document.createElement(\"CommonSurfaceShader\");css.setAttribute(\"DEF\",\"MultiMaterial\");var ptDA=document.createElement(\"PixelTexture\");ptDA.setAttribute(\"containerField\",\"multiDiffuseAlphaTexture\");ptDA.setAttribute(\"id\",\"MultiMaterial_ColorMap\");ptDA.setAttribute(\"image\",materialData.diffuseTransparency);var ptEA=document.createElement(\"PixelTexture\");ptEA.setAttribute(\"containerField\",\"multiEmissiveAmbientTexture\");ptEA.setAttribute(\"id\",\"MultiMaterial_EmissiveMap\");ptEA.setAttribute(\"image\",materialData.emissiveAmbientIntensity);var ptSS=document.createElement(\"PixelTexture\");ptSS.setAttribute(\"containerField\",\"multiSpecularShininessTexture\");ptSS.setAttribute(\"id\",\"MultiMaterial_SpecularMap\");ptSS.setAttribute(\"image\",materialData.specularShininess);var ptV=document.createElement(\"PixelTexture\");ptV.setAttribute(\"containerField\",\"multiVisibilityTexture\");ptV.setAttribute(\"id\",\"MultiMaterial_VisibilityMap\");ptV.setAttribute(\"image\",visibilityData);css.appendChild(ptDA);css.appendChild(ptEA);css.appendChild(ptSS);css.appendChild(ptV);}\nelse\n{css=document.createElement(\"CommonSurfaceShader\");css.setAttribute(\"USE\",\"MultiMaterial\");}\nappearance.appendChild(css);geometries[g].appendChild(appearance);}}}},getPartsByRect_Pixel:function(left,right,bottom,top)\n{var canvas=this._nameSpace.doc._x3dElem.runtime.canvas;var ctx=canvas.gl;var viewarea=canvas.doc._viewarea;if(!ctx||!viewarea){return[];}\nreturn ctx.pickRect(viewarea,left,top,right,bottom,true);},getPartsByRect_Volume:function(left,right,bottom,top,mode)\n{mode=(mode!=undefined)?mode:0;var viewarea=this._nameSpace.doc._viewarea;var viewpoint=viewarea._scene.getViewpoint();var origViewMatrix=viewarea.getViewMatrix();var origProjMatrix=viewarea.getProjectionMatrix();var upDir=new x3dom.fields.SFVec3f(origViewMatrix._01,origViewMatrix._11,origViewMatrix._21);var viewDir=new x3dom.fields.SFVec3f(origViewMatrix._02,origViewMatrix._12,origViewMatrix._22);var pos=new x3dom.fields.SFVec3f(origViewMatrix._03,origViewMatrix._13,origViewMatrix._23);var normalizedLeft=(left-viewarea._width/2)/(viewarea._width/2);var normalizedRight=(right-viewarea._width/2)/(viewarea._width/2);var normalizedTop=(top-viewarea._height/2)/(viewarea._height/2);var normalizedBottom=(bottom-viewarea._height/2)/(viewarea._height/2);var zNear=viewpoint._zNear;var zFar=viewpoint._zFar;var aspect=viewpoint._lastAspect;var fov=viewpoint.getFieldOfView();var factorH=Math.tan(fov/2)*zNear;var factorW=Math.tan(fov/2)*aspect*zNear;var projMatrix,viewMatrix,factor;if(x3dom.isa(viewpoint,x3dom.nodeTypes.OrthoViewpoint))\n{aspect=(right-left)/(bottom-top);factor=Math.max(normalizedLeft,normalizedRight,normalizedTop,normalizedBottom)*viewpoint._fieldOfView[2];viewMatrix=origViewMatrix;projMatrix=x3dom.fields.SFMatrix4f.ortho(-factor,factor,-factor,factor,zNear,zFar,aspect);}\nelse\n{left=normalizedLeft*factorW;right=normalizedRight*factorW;bottom=normalizedBottom*factorH;top=normalizedTop*factorH;projMatrix=x3dom.fields.SFMatrix4f.perspectiveFrustum(left,right,bottom,top,zNear,zFar);viewMatrix=x3dom.fields.SFMatrix4f.lookAt(pos,pos.subtract(viewDir.multiply(5.0)),upDir);}\nvar frustum=new x3dom.fields.FrustumVolume(projMatrix.mult(viewMatrix));var selection=[];var id,volumes=this._partVolume;for(id in volumes){if(!volumes.hasOwnProperty(id))\ncontinue;var intersect=frustum.intersect(volumes[id],0);if(mode==0&&intersect>0)\n{selection.push(+id);}\nelse if(mode==1&&intersect==63)\n{selection.push(+id);}}\nvar colorMap=this._inlineNamespace.defMap[\"MultiMaterial_ColorMap\"];var emissiveMap=this._inlineNamespace.defMap[\"MultiMaterial_EmissiveMap\"];var specularMap=this._inlineNamespace.defMap[\"MultiMaterial_SpecularMap\"];var visibilityMap=this._inlineNamespace.defMap[\"MultiMaterial_VisibilityMap\"];if(selection.length==0){return null;}else{return new x3dom.Parts(this,selection,colorMap,emissiveMap,specularMap,visibilityMap);}},appendAPI:function()\n{var multiPart=this;this._xmlNode.getIdList=function()\n{var i,ids=[];for(i=0;i<multiPart._idMap.mapping.length;i++){ids.push(multiPart._idMap.mapping[i].name);}\nreturn ids;};this._xmlNode.getAppearanceIdList=function()\n{var i,ids=[];for(i=0;i<multiPart._idMap.appearance.length;i++){ids.push(multiPart._idMap.appearance[i].name);}\nreturn ids;};this._xmlNode.getParts=function(selector)\n{var i,m;var selection=[];if(selector==undefined){for(m=0;m<multiPart._idMap.mapping.length;m++){selection.push(m);}}else if(selector instanceof Array){for(i=0;i<selector.length;i++){if(multiPart._identifierToPartId[selector[i]]){selection=selection.concat(multiPart._identifierToPartId[selector[i]]);}}}else if(selector instanceof RegExp){for(var key in multiPart._identifierToPartId){if(key.match(selector)){selection=selection.concat(multiPart._identifierToPartId[key]);}}}\nvar colorMap=multiPart._inlineNamespace.defMap[\"MultiMaterial_ColorMap\"];var emissiveMap=multiPart._inlineNamespace.defMap[\"MultiMaterial_EmissiveMap\"];var specularMap=multiPart._inlineNamespace.defMap[\"MultiMaterial_SpecularMap\"];var visibilityMap=multiPart._inlineNamespace.defMap[\"MultiMaterial_VisibilityMap\"];if(selection.length==0){return null;}else{return new x3dom.Parts(multiPart,selection,colorMap,emissiveMap,specularMap,visibilityMap);}};this._xmlNode.getPartsByRect=function(left,right,bottom,top,technique,mode)\n{var parts;technique=(technique!=undefined)?technique:\"volume\";mode=(mode!=undefined)?mode:0;if(technique==\"volume\")\n{parts=multiPart.getPartsByRect_Volume(left,right,bottom,top,mode);}\nelse if(technique==\"pixel\")\n{parts=multiPart.getPartsByRect_Pixel(left,right,bottom,top);}\nreturn parts;}},loadInline:function()\n{var that=this;var xhr=new window.XMLHttpRequest();if(xhr.overrideMimeType)\nxhr.overrideMimeType('text/xml');xhr.onreadystatechange=function()\n{if(xhr.readyState!=4){return xhr;}\nif(xhr.status===x3dom.nodeTypes.Inline.AwaitTranscoding){if(that.count<that.numRetries)\n{that.count++;var refreshTime=+xhr.getResponseHeader(\"Refresh\")||5;x3dom.debug.logInfo('XHR status: '+xhr.status+' - Await Transcoding ('+that.count+'/'+that.numRetries+'): '+'Next request in '+refreshTime+' seconds');window.setTimeout(function(){that._nameSpace.doc.decrementDownloads();that.loadInline();},refreshTime*1000);return xhr;}\nelse\n{x3dom.debug.logError('XHR status: '+xhr.status+' - Await Transcoding ('+that.count+'/'+that.numRetries+'): '+'No Retries left');that._nameSpace.doc.decrementDownloads();that.count=0;return xhr;}}\nelse if((xhr.status!==200)&&(xhr.status!==0)){that.fireEvents(\"error\");x3dom.debug.logError('XHR status: '+xhr.status+' - XMLHttpRequest requires web server running!');that._nameSpace.doc.decrementDownloads();that.count=0;return xhr;}\nelse if((xhr.status==200)||(xhr.status==0)){that.count=0;}\nx3dom.debug.logInfo('Inline: downloading '+that._vf.url[0]+' done.');var inlScene=null,newScene=null,nameSpace=null,xml=null;if(navigator.appName!=\"Microsoft Internet Explorer\")\nxml=xhr.responseXML;else\nxml=new DOMParser().parseFromString(xhr.responseText,\"text/xml\");if(xml!==undefined&&xml!==null)\n{inlScene=xml.getElementsByTagName('Scene')[0]||xml.getElementsByTagName('scene')[0];}\nelse{that.fireEvents(\"error\");}\nif(inlScene)\n{var nsDefault=\"ns\"+that._nameSpace.childSpaces.length;var nsName=(that._vf.nameSpaceName.length!=0)?that._vf.nameSpaceName.toString().replace(' ',''):nsDefault;that._inlineNamespace=new x3dom.NodeNameSpace(nsName,that._nameSpace.doc);var url=that._vf.url.length?that._vf.url[0]:\"\";if((url[0]==='/')||(url.indexOf(\":\")>=0))\n{that._inlineNamespace.setBaseURL(url);}\nelse\n{that._inlineNamespace.setBaseURL(that._nameSpace.baseURL+url);}\nthat.replaceMaterials(inlScene);newScene=that._inlineNamespace.setupTree(inlScene);that._nameSpace.addSpace(that._inlineNamespace);if(that._vf.nameSpaceName.length!=0)\n{Array.forEach(inlScene.childNodes,function(childDomNode)\n{if(childDomNode instanceof Element)\n{setNamespace(that._vf.nameSpaceName,childDomNode,that._vf.mapDEFToID);that._xmlNode.appendChild(childDomNode);}});}}\nelse{if(xml&&xml.localName){x3dom.debug.logError('No Scene in '+xml.localName);}else{x3dom.debug.logError('No Scene in resource');}}\nvar global=x3dom.getGlobal();if(that._childNodes.length>0&&that._childNodes[0]&&that._childNodes[0]._nameSpace){that._nameSpace.removeSpace(that._childNodes[0]._nameSpace);}\nwhile(that._childNodes.length!==0){global['_remover']=that.removeChild(that._childNodes[0]);}\ndelete global['_remover'];if(newScene)\n{that.addChild(newScene);that.invalidateVolume();that._nameSpace.doc.decrementDownloads();that._nameSpace.doc.needRender=true;x3dom.debug.logInfo('Inline: added '+that._vf.url[0]+' to scene.');var theScene=that._nameSpace.doc._scene;if(theScene){theScene.invalidateVolume();window.setTimeout(function(){that.invalidateVolume();theScene.updateVolume();that._nameSpace.doc.needRender=true;},1000);}\nthat.appendAPI();that.fireEvents(\"load\");}\nnewScene=null;inlScene=null;xml=null;return xhr;};if(this._vf.url.length&&this._vf.url[0].length)\n{var xhrURI=this._nameSpace.getURL(this._vf.url[0]);xhr.open('GET',xhrURI,true);this._nameSpace.doc.incrementDownloads();try{x3dom.RequestManager.addRequest(xhr);}\ncatch(ex){this.fireEvents(\"error\");x3dom.debug.logError(this._vf.url[0]+\": \"+ex);}}}}));x3dom.registerNodeType(\"X3DBackgroundNode\",\"EnvironmentalEffects\",defineClass(x3dom.nodeTypes.X3DBindableNode,function(ctx){x3dom.nodeTypes.X3DBackgroundNode.superClass.call(this,ctx);var trans=(ctx&&ctx.autoGen)?1:0;this.addField_SFString(ctx,'crossOrigin','');this.addField_MFColor(ctx,'groundColor',[]);this.addField_MFFloat(ctx,'groundAngle',[]);this.addField_MFColor(ctx,'skyColor',[new x3dom.fields.SFColor(0,0,0)]);this.addField_MFFloat(ctx,'skyAngle',[]);this.addField_SFFloat(ctx,'transparency',trans);this._dirty=true;},{getSkyColor:function(){return new x3dom.fields.SFColor(0,0,0);},getTransparency:function(){return 0;},getTexUrl:function(){return[];}}));x3dom.registerNodeType(\"X3DFogNode\",\"EnvironmentalEffects\",defineClass(x3dom.nodeTypes.X3DBindableNode,function(ctx){x3dom.nodeTypes.X3DFogNode.superClass.call(this,ctx);this.addField_SFColor(ctx,'color',1,1,1);this.addField_SFString(ctx,'fogType',\"LINEAR\");this.addField_SFFloat(ctx,'visibilityRange',0);},{}));x3dom.registerNodeType(\"Fog\",\"EnvironmentalEffects\",defineClass(x3dom.nodeTypes.X3DFogNode,function(ctx){x3dom.nodeTypes.Fog.superClass.call(this,ctx);},{}));x3dom.registerNodeType(\"Background\",\"EnvironmentalEffects\",defineClass(x3dom.nodeTypes.X3DBackgroundNode,function(ctx){x3dom.nodeTypes.Background.superClass.call(this,ctx);this.addField_MFString(ctx,'backUrl',[]);this.addField_MFString(ctx,'bottomUrl',[]);this.addField_MFString(ctx,'frontUrl',[]);this.addField_MFString(ctx,'leftUrl',[]);this.addField_MFString(ctx,'rightUrl',[]);this.addField_MFString(ctx,'topUrl',[]);this.addField_SFBool(ctx,'scaling',false);},{fieldChanged:function(fieldName)\n{if(fieldName.indexOf(\"Url\")>0||fieldName==\"transparency\"||fieldName.search(\"sky\")>=0||fieldName.search(\"ground\")>=0){this._dirty=true;}\nelse if(fieldName.indexOf(\"bind\")>=0){this.bind(this._vf.bind);}},getSkyColor:function(){return this._vf.skyColor;},getGroundColor:function(){return this._vf.groundColor;},getTransparency:function(){return this._vf.transparency;},getTexUrl:function(){return[this._nameSpace.getURL(this._vf.backUrl[0]),this._nameSpace.getURL(this._vf.frontUrl[0]),this._nameSpace.getURL(this._vf.bottomUrl[0]),this._nameSpace.getURL(this._vf.topUrl[0]),this._nameSpace.getURL(this._vf.leftUrl[0]),this._nameSpace.getURL(this._vf.rightUrl[0])];}}));x3dom.registerNodeType(\"X3DEnvironmentNode\",\"EnvironmentalEffects\",defineClass(x3dom.nodeTypes.X3DBindableNode,function(ctx){x3dom.nodeTypes.X3DEnvironmentNode.superClass.call(this,ctx);}));x3dom.registerNodeType(\"Environment\",\"EnvironmentalEffects\",defineClass(x3dom.nodeTypes.X3DEnvironmentNode,function(ctx){x3dom.nodeTypes.Environment.superClass.call(this,ctx);this.addField_SFBool(ctx,'sortTrans',true);this.addField_SFBool(ctx,'shadowExcludeTransparentObjects',false);this.addField_SFString(ctx,'gammaCorrectionDefault',\"linear\");this.addField_SFString(ctx,'tonemapping',\"none\");this.addField_SFBool(ctx,'frustumCulling',true);this.addField_SFBool(ctx,'smallFeatureCulling',false);this.addField_SFFloat(ctx,'smallFeatureThreshold',1.0);this.addField_SFBool(ctx,'occlusionCulling',false);this.addField_SFFloat(ctx,'occlusionVisibilityThreshold',0.0);this.addField_SFBool(ctx,'lowPriorityCulling',false);this.addField_SFFloat(ctx,'lowPriorityThreshold',1.0);this.addField_SFBool(ctx,'tessellationDetailCulling',false);this.addField_SFFloat(ctx,'tessellationErrorThreshold',0.0);this.addField_SFBool(ctx,'enableARC',false);this.addField_SFFloat(ctx,'minFrameRate',1.0);this.addField_SFFloat(ctx,'maxFrameRate',62.5);this.addField_SFFloat(ctx,'userDataFactor',-1);this.addField_SFFloat(ctx,'smallFeatureFactor',-1);this.addField_SFFloat(ctx,'occlusionVisibilityFactor',-1);this.addField_SFFloat(ctx,'lowPriorityFactor',-1);this.addField_SFFloat(ctx,'tessellationErrorFactor',-1);this.addField_SFBool(ctx,'SSAO',false);this.addField_SFFloat(ctx,'SSAOradius',0.7);this.addField_SFFloat(ctx,'SSAOamount',0.3);this.addField_SFInt32(ctx,'SSAOrandomTextureSize',4);this.addField_SFInt32(ctx,'SSAOblurDepthTreshold',1);this._validGammaCorrectionTypes=[\"none\",\"fastlinear\",\"linear\"];this.checkSanity();},{checkSanity:function()\n{var checkParam=function(flag,value,defaultOn,defaultOff)\n{if(flag&&(value==defaultOff))\nreturn defaultOn;if(!flag&&(value!=defaultOff))\nreturn defaultOff;return value;};this._smallFeatureThreshold=checkParam(this._vf.smallFeatureCulling,this._vf.smallFeatureThreshold,10,0);this._lowPriorityThreshold=checkParam(this._vf.lowPriorityCulling,this._vf.lowPriorityThreshold,0.5,1);this._occlusionVisibilityThreshold=checkParam(this._vf.occlusionCulling,this._vf.occlusionVisibilityThreshold,1,0);this._tessellationErrorThreshold=checkParam(this._vf.tessellationDetailCulling,this._vf.tessellationErrorThreshold,1,0);var checkGamma=function(field,that){field=field.toLowerCase();if(that._validGammaCorrectionTypes.indexOf(field)>-1){return field;}\nelse{x3dom.debug.logWarning(field+\" gammaCorrectionDefault may only be linear (default), fastLinear, or none\");return that._validGammaCorrectionTypes[0];}};this._vf.gammaCorrectionDefault=checkGamma(this._vf.gammaCorrectionDefault,this);}}));x3dom.registerNodeType(\"X3DViewpointNode\",\"Navigation\",defineClass(x3dom.nodeTypes.X3DBindableNode,function(ctx){x3dom.nodeTypes.X3DViewpointNode.superClass.call(this,ctx);if(ctx&&ctx.xmlNode){var domNode=ctx.xmlNode;if(!domNode.resetView&&!domNode.getFieldOfView&&!domNode.getNear&&!domNode.getFar)\n{domNode.resetView=function(){var that=this._x3domNode;that.resetView();that._nameSpace.doc.needRender=true;};domNode.getFieldOfView=function(){return this._x3domNode.getFieldOfView();};domNode.getNear=function(){return this._x3domNode.getNear();};domNode.getFar=function(){return this._x3domNode.getFar();};}}},{activate:function(prev){var viewarea=this._nameSpace.doc._viewarea;if(prev&&this._bindAnimation){viewarea.animateTo(this,prev._autoGen?null:prev);}\nviewarea._needNavigationMatrixUpdate=true;x3dom.nodeTypes.X3DBindableNode.prototype.activate.call(this,prev);},deactivate:function(prev){x3dom.nodeTypes.X3DBindableNode.prototype.deactivate.call(this,prev);},getTransformation:function(){return this.getCurrentTransform();},getCenterOfRotation:function(){return new x3dom.fields.SFVec3f(0,0,0);},setCenterOfRotation:function(cor){this._vf.centerOfRotation.setValues(cor);},getFieldOfView:function(){return 1.57079633;},setView:function(newView){var mat=this.getCurrentTransform();this._viewMatrix=newView.mult(mat);},setViewAbsolute:function(newView)\n{this._viewMatrix=newView;},setProjectionMatrix:function(matrix)\n{},resetView:function(){},getNear:function(){return 0.1;},getFar:function(){return 10000;},getImgPlaneHeightAtDistOne:function(){return 2.0;},getViewMatrix:function(){return null;},getProjectionMatrix:function(aspect){return null;},setZoom:function(value){}}));x3dom.registerNodeType(\"Viewpoint\",\"Navigation\",defineClass(x3dom.nodeTypes.X3DViewpointNode,function(ctx){x3dom.nodeTypes.Viewpoint.superClass.call(this,ctx);this.addField_SFFloat(ctx,'fieldOfView',0.785398);this.addField_SFVec3f(ctx,'position',0,0,10);this.addField_SFRotation(ctx,'orientation',0,0,1,0);this.addField_SFVec3f(ctx,'centerOfRotation',0,0,0);this.addField_SFFloat(ctx,'zNear',-1);this.addField_SFFloat(ctx,'zFar',-1);this._viewMatrix=x3dom.fields.SFMatrix4f.translation(this._vf.position).mult(this._vf.orientation.toMatrix()).inverse();this._projMatrix=null;this._lastAspect=1.0;this._zRatio=10000;this._zNear=this._vf.zNear;this._zFar=this._vf.zFar;this._imgPlaneHeightAtDistOne=2.0*Math.tan(this._vf.fieldOfView/2.0);},{fieldChanged:function(fieldName){if(fieldName==\"position\"||fieldName==\"orientation\"){this.resetView();}\nelse if(fieldName==\"fieldOfView\"||fieldName==\"zNear\"||fieldName==\"zFar\"){this._projMatrix=null;this._zNear=this._vf.zNear;this._zFar=this._vf.zFar;this._imgPlaneHeightAtDistOne=2.0*Math.tan(this._vf.fieldOfView/2.0);}\nelse if(fieldName.indexOf(\"bind\")>=0){this.bind(this._vf.bind);}},setProjectionMatrix:function(matrix)\n{this._projMatrix=matrix;},getCenterOfRotation:function(){return this._vf.centerOfRotation;},getViewMatrix:function(){return this._viewMatrix;},getFieldOfView:function(){return this._vf.fieldOfView;},resetView:function(){this._viewMatrix=x3dom.fields.SFMatrix4f.translation(this._vf.position).mult(this._vf.orientation.toMatrix()).inverse();if(this._vf.isActive&&this._nameSpace&&this._nameSpace.doc._viewarea){this._nameSpace.doc._viewarea.resetNavHelpers();}},getNear:function(){return this._zNear;},getFar:function(){return this._zFar;},getImgPlaneHeightAtDistOne:function(){return this._imgPlaneHeightAtDistOne;},getProjectionMatrix:function(aspect)\n{var fovy=this._vf.fieldOfView;var zfar=this._vf.zFar;var znear=this._vf.zNear;if(znear<=0||zfar<=0)\n{var nearScale=0.8,farScale=1.2;var viewarea=this._nameSpace.doc._viewarea;var scene=viewarea._scene;var min=x3dom.fields.SFVec3f.copy(scene._lastMin);var max=x3dom.fields.SFVec3f.copy(scene._lastMax);var dia=max.subtract(min);var sRad=dia.length()/2;var mat=viewarea.getViewMatrix().inverse();var vp=mat.e3();var translation=new x3dom.fields.SFVec3f(0,0,0),scaleFactor=new x3dom.fields.SFVec3f(1,1,1);var rotation=new x3dom.fields.Quaternion(0,0,1,0),scaleOrientation=new x3dom.fields.Quaternion(0,0,1,0);mat.getTransform(translation,rotation,scaleFactor,scaleOrientation);var minScal=scaleFactor.x,maxScal=scaleFactor.x;if(maxScal<scaleFactor.y)maxScal=scaleFactor.y;if(minScal>scaleFactor.y)minScal=scaleFactor.y;if(maxScal<scaleFactor.z)maxScal=scaleFactor.z;if(minScal>scaleFactor.z)minScal=scaleFactor.z;if(maxScal>1)\nnearScale/=maxScal;else if(minScal>x3dom.fields.Eps&&minScal<1)\nfarScale/=minScal;var sCenter=min.add(dia.multiply(0.5));var vDist=(vp.subtract(sCenter)).length();if(sRad){if(vDist>sRad)\nznear=(vDist-sRad)*nearScale;else\nznear=0;zfar=(vDist+sRad)*farScale;}\nelse{znear=0.1;zfar=100000;}\nvar zNearLimit=zfar/this._zRatio;znear=Math.max(znear,Math.max(x3dom.fields.Eps,zNearLimit));if(zfar>this._vf.zNear&&this._vf.zNear>0)\nznear=this._vf.zNear;if(this._vf.zFar>znear)\nzfar=this._vf.zFar;if(zfar<=znear)\nzfar=znear+1;}\nif(this._projMatrix==null)\n{this._projMatrix=x3dom.fields.SFMatrix4f.perspective(fovy,aspect,znear,zfar);}\nelse if(this._zNear!=znear||this._zFar!=zfar)\n{var div=znear-zfar;this._projMatrix._22=(znear+zfar)/div;this._projMatrix._23=2*znear*zfar/div;}\nelse if(this._lastAspect!=aspect)\n{this._projMatrix._00=(1/Math.tan(fovy/2))/aspect;this._lastAspect=aspect;}\nthis._zNear=znear;this._zFar=zfar;return this._projMatrix;}}));x3dom.registerNodeType(\"OrthoViewpoint\",\"Navigation\",defineClass(x3dom.nodeTypes.X3DViewpointNode,function(ctx){x3dom.nodeTypes.OrthoViewpoint.superClass.call(this,ctx);this.addField_MFFloat(ctx,'fieldOfView',[-1,-1,1,1]);this.addField_SFVec3f(ctx,'position',0,0,10);this.addField_SFRotation(ctx,'orientation',0,0,0,1);this.addField_SFVec3f(ctx,'centerOfRotation',0,0,0);this.addField_SFFloat(ctx,'zNear',-1);this.addField_SFFloat(ctx,'zFar',-1);this._viewMatrix=null;this._projMatrix=null;this._lastAspect=1.0;this._zRatio=10000;this._zNear=this._vf.zNear;this._zFar=this._vf.zFar;this._fieldOfView=this._vf.fieldOfView.slice(0);this.resetView();},{fieldChanged:function(fieldName){if(fieldName==\"position\"||fieldName==\"orientation\"){this.resetView();}\nelse if(fieldName==\"fieldOfView\")\n{this._fieldOfView=this._vf.fieldOfView;this._projMatrix=null;}\nelse if(fieldName==\"zNear\"||fieldName==\"zFar\"){this._projMatrix=null;this.resetView();}\nelse if(fieldName.indexOf(\"bind\")>=0){this.bind(this._vf.bind);}},getCenterOfRotation:function(){return this.getCurrentTransform().multMatrixPnt(this._vf.centerOfRotation);},getViewMatrix:function(){return this._viewMatrix;},resetView:function(){var offset=x3dom.fields.SFMatrix4f.translation(new x3dom.fields.SFVec3f((this._vf.fieldOfView[0]+this._vf.fieldOfView[2])/2,(this._vf.fieldOfView[1]+this._vf.fieldOfView[3])/2,0));this._viewMatrix=x3dom.fields.SFMatrix4f.translation(this._vf.position).mult(this._vf.orientation.toMatrix());this._viewMatrix=this._viewMatrix.inverse();this._projMatrix=null;if(this._vf.isActive&&this._nameSpace&&this._nameSpace.doc._viewarea){this._nameSpace.doc._viewarea.resetNavHelpers();}},getNear:function(){return this._vf.zNear;},getFar:function(){return this._vf.zFar;},getFieldOfView:function(){return 0.785;},setZoom:function(value){this._fieldOfView[0]=-value;this._fieldOfView[1]=-value;this._fieldOfView[2]=value;this._fieldOfView[3]=value;this._projMatrix=null;},getZoom:function(value){return this._fieldOfView;},getProjectionMatrix:function(aspect)\n{var fov=this.getFieldOfView();var zfar=this._vf.zFar;var znear=this._vf.zNear;if(znear<=0||zfar<=0)\n{var scene=this._nameSpace.doc._viewarea._scene;var min=x3dom.fields.SFVec3f.copy(scene._lastMin);var max=x3dom.fields.SFVec3f.copy(scene._lastMax);var dia=max.subtract(min);var tanfov2=Math.tan(fov/2.0);var dist1=((dia.y/2.0)/tanfov2+dia.z)+this._fieldOfView[2];var dist2=((dia.x/2.0)/tanfov2+dia.z)+this._fieldOfView[2];var dist=(dist1>dist2)?dist1:dist2;zfar=dist*4;znear=0.0001;this._viewMatrix._23=-(dist*2);}\nif(this._projMatrix==null||this._lastAspect!=aspect||this._zNear!=znear||this._zFar!=zfar)\n{var near=this._zNear=znear;var far=this._zFar=zfar;var left=this._fieldOfView[0];var bottom=this._fieldOfView[1];var right=this._fieldOfView[2];var top=this._fieldOfView[3];this._projMatrix=x3dom.fields.SFMatrix4f.ortho(left,right,bottom,top,near,far,aspect);}\nthis._lastAspect=aspect;return this._projMatrix;}}));x3dom.registerNodeType(\"Viewfrustum\",\"Navigation\",defineClass(x3dom.nodeTypes.X3DViewpointNode,function(ctx){x3dom.nodeTypes.Viewfrustum.superClass.call(this,ctx);this.addField_SFMatrix4f(ctx,'modelview',1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);this.addField_SFMatrix4f(ctx,'projection',1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);this._viewMatrix=this._vf.modelview.transpose().inverse();this._projMatrix=this._vf.projection.transpose();this._centerOfRotation=new x3dom.fields.SFVec3f(0,0,0);},{fieldChanged:function(fieldName){if(fieldName==\"modelview\"){this.resetView();}\nelse if(fieldName==\"projection\"){this._projMatrix=this._vf.projection.transpose();}\nelse if(fieldName.indexOf(\"bind\")>=0){this.bind(this._vf.bind);}},getCenterOfRotation:function(){return this.getCurrentTransform().multMatrixPnt(this._centerOfRotation);},setCenterOfRotation:function(cor){this._centerOfRotation.setValues(cor);},getViewMatrix:function(){return this._viewMatrix;},getFieldOfView:function(){return(2.0*Math.atan(1.0/this._projMatrix._11));},getImgPlaneHeightAtDistOne:function(){return 2.0/this._projMatrix._11;},resetView:function(){this._viewMatrix=this._vf.modelview.transpose().inverse();this._centerOfRotation=new x3dom.fields.SFVec3f(0,0,0);},getProjectionMatrix:function(aspect){return this._projMatrix;}}));x3dom.registerNodeType(\"X3DNavigationInfoNode\",\"Navigation\",defineClass(x3dom.nodeTypes.X3DBindableNode,function(ctx){x3dom.nodeTypes.X3DNavigationInfoNode.superClass.call(this,ctx);}));x3dom.registerNodeType(\"NavigationInfo\",\"Navigation\",defineClass(x3dom.nodeTypes.X3DNavigationInfoNode,function(ctx){x3dom.nodeTypes.NavigationInfo.superClass.call(this,ctx);this.addField_SFBool(ctx,'headlight',true);this.addField_SFBool(ctx,'reverseScroll',false);this.addField_MFString(ctx,'type',[\"EXAMINE\",\"ANY\"]);this.addField_MFFloat(ctx,'typeParams',[-0.4,60,0.05,2.8]);this.addField_SFString(ctx,'explorationMode','all');this.addField_MFFloat(ctx,'avatarSize',[0.25,1.6,0.75]);this.addField_SFFloat(ctx,'walkDamping',2.0);this.addField_SFFloat(ctx,'visibilityLimit',0.0);this.addField_SFFloat(ctx,'speed',1.0);this.addField_SFTime(ctx,'transitionTime',1.0);this.addField_MFString(ctx,'transitionType',[\"LINEAR\"]);this._validTypes=[\"none\",\"examine\",\"turntable\",\"fly\",\"freefly\",\"lookat\",\"lookaround\",\"walk\",\"game\",\"helicopter\",\"any\"];this._typeMapping={\"default\":x3dom.DefaultNavigation,\"turntable\":x3dom.TurntableNavigation,\"walk\":x3dom.WalkNavigation};this._heliUpdated=false;var type=this.setType(this.getType());x3dom.debug.logInfo(\"NavType: \"+type);},{fieldChanged:function(fieldName){if(fieldName==\"typeParams\"){this._heliUpdated=false;}\nelse if(fieldName==\"type\"){this.setType(this.getType());}\nelse if(fieldName.indexOf(\"bind\")>=0){this.bind(this._vf.bind);}},setType:function(type,viewarea){var navType=this.checkType(type.toLowerCase());var oldType=this.checkType(this.getType());if(oldType!==navType||this._impl==null){if(this._typeMapping[navType]==null)\nthis._impl=new this._typeMapping['default'](this);else\nthis._impl=new this._typeMapping[navType](this);switch(navType){case'game':if(viewarea)\nviewarea.initMouseState();else\nthis._nameSpace.doc._viewarea.initMouseState();break;case'helicopter':this._heliUpdated=false;break;case\"turntable\":if(viewarea){viewarea.initMouseState();}\nelse if(this._nameSpace.doc._viewarea){this._nameSpace.doc._viewarea.initMouseState();}\nbreak;default:break;}\nif(this._nameSpace.doc._viewarea)\nthis._impl.init(this._nameSpace.doc._viewarea,false);}\nthis._vf.type[0]=navType;x3dom.debug.logInfo(\"Switch to \"+navType+\" mode.\");},getType:function(){var type=this._vf.type[0].toLowerCase();if(type.length<=1)\ntype=\"none\";else if(type==\"any\")\ntype=\"examine\";return type;},getTypeParams:function(){var length=this._vf.typeParams.length;var theta=(length>=1)?this._vf.typeParams[0]:-0.4;var height=(length>=2)?this._vf.typeParams[1]:60.0;var minAngle=(length>=3)?this._vf.typeParams[2]:x3dom.fields.Eps;var maxAngle=(length>=4)?this._vf.typeParams[3]:Math.PI-x3dom.fields.Eps;var params=[theta,height,minAngle,maxAngle];if(length>=5)\n{params=params.concat(this._vf.typeParams.slice(4));}\nreturn params;},setTypeParams:function(params){for(var i=0;i<params.length;i++){this._vf.typeParams[i]=params[i];}},checkType:function(type){if(this._validTypes.indexOf(type)>-1){return type;}\nelse{x3dom.debug.logWarning(type+\" is no valid navigation type, use one of \"+\nthis._validTypes.toString());return\"examine\";}},getExplorationMode:function(){switch(this._vf.explorationMode.toLowerCase()){case\"all\":return 7;case\"rotate\":return 1;case\"zoom\":return 2;case\"pan\":return 4;case\"none\":return 0;default:return 7;}}}));x3dom.registerNodeType(\"Billboard\",\"Navigation\",defineClass(x3dom.nodeTypes.X3DGroupingNode,function(ctx){x3dom.nodeTypes.Billboard.superClass.call(this,ctx);this.addField_SFVec3f(ctx,'axisOfRotation',0,1,0);this._eye=new x3dom.fields.SFVec3f(0,0,0);this._eyeViewUp=new x3dom.fields.SFVec3f(0,0,0);this._eyeLook=new x3dom.fields.SFVec3f(0,0,0);},{collectDrawableObjects:function(transform,drawableCollection,singlePath,invalidateCache,planeMask,clipPlanes)\n{if(singlePath&&(this._parentNodes.length>1))\nsinglePath=false;if(singlePath&&(invalidateCache=invalidateCache||this.cacheInvalid()))\nthis.invalidateCache();planeMask=drawableCollection.cull(transform,this.graphState(),singlePath,planeMask);if(planeMask<0){return;}\nsinglePath=false;var vol=this.getVolume();var min=x3dom.fields.SFVec3f.MAX();var max=x3dom.fields.SFVec3f.MIN();vol.getBounds(min,max);var mat_view=drawableCollection.viewMatrix;var center=new x3dom.fields.SFVec3f(0,0,0);center=mat_view.inverse().multMatrixPnt(center);var mat_view_model=mat_view.mult(transform);this._eye=transform.inverse().multMatrixPnt(center);this._eyeViewUp=new x3dom.fields.SFVec3f(mat_view_model._10,mat_view_model._11,mat_view_model._12);this._eyeLook=new x3dom.fields.SFVec3f(mat_view_model._20,mat_view_model._21,mat_view_model._22);var rotMat=x3dom.fields.SFMatrix4f.identity();var mid=max.add(min).multiply(0.5);var billboard_to_viewer=this._eye.subtract(mid);if(this._vf.axisOfRotation.equals(new x3dom.fields.SFVec3f(0,0,0),x3dom.fields.Eps)){var rot1=x3dom.fields.Quaternion.rotateFromTo(billboard_to_viewer,new x3dom.fields.SFVec3f(0,0,1));rotMat=rot1.toMatrix().transpose();var yAxis=rotMat.multMatrixPnt(new x3dom.fields.SFVec3f(0,1,0)).normalize();var zAxis=rotMat.multMatrixPnt(new x3dom.fields.SFVec3f(0,0,1)).normalize();if(!this._eyeViewUp.equals(new x3dom.fields.SFVec3f(0,0,0),x3dom.fields.Eps)){var rot2=x3dom.fields.Quaternion.rotateFromTo(this._eyeLook,zAxis);var rotatedyAxis=rot2.toMatrix().transpose().multMatrixVec(yAxis);var rot3=x3dom.fields.Quaternion.rotateFromTo(this._eyeViewUp,rotatedyAxis);rotMat=rot2.toMatrix().transpose().mult(rotMat);rotMat=rot3.toMatrix().transpose().mult(rotMat);}}\nelse{var normalPlane=this._vf.axisOfRotation.cross(billboard_to_viewer).normalize();if(this._eye.z<0){normalPlane=normalPlane.multiply(-1);}\nvar degreesToRotate=Math.asin(normalPlane.dot(new x3dom.fields.SFVec3f(0,0,1)));if(this._eye.z<0){degreesToRotate+=Math.PI;}\nrotMat=x3dom.fields.SFMatrix4f.parseRotation(this._vf.axisOfRotation.x+\", \"+this._vf.axisOfRotation.y+\", \"+\nthis._vf.axisOfRotation.z+\", \"+degreesToRotate*(-1));}\nvar childTransform=this.transformMatrix(transform.mult(rotMat));for(var i=0,i_n=this._childNodes.length;i<i_n;i++)\n{var cnode=this._childNodes[i];if(cnode){cnode.collectDrawableObjects(childTransform,drawableCollection,singlePath,invalidateCache,planeMask,clipPlanes);}}}}));x3dom.registerNodeType(\"Collision\",\"Navigation\",defineClass(x3dom.nodeTypes.X3DGroupingNode,function(ctx){x3dom.nodeTypes.Collision.superClass.call(this,ctx);this.addField_SFBool(ctx,\"enabled\",true);this.addField_SFNode(\"proxy\",x3dom.nodeTypes.X3DGroupingNode);this.addField_SFTime(ctx,\"collideTime\",0);this.addField_SFBool(ctx,\"isActive\",true);},{collectDrawableObjects:function(transform,drawableCollection,singlePath,invalidateCache,planeMask,clipPlanes)\n{if(singlePath&&(this._parentNodes.length>1))\nsinglePath=false;if(singlePath&&(invalidateCache=invalidateCache||this.cacheInvalid()))\nthis.invalidateCache();planeMask=drawableCollection.cull(transform,this.graphState(),singlePath,planeMask);if(planeMask<0){return;}\nvar cnode,childTransform;if(singlePath){if(!this._graph.globalMatrix){this._graph.globalMatrix=this.transformMatrix(transform);}\nchildTransform=this._graph.globalMatrix;}\nelse{childTransform=this.transformMatrix(transform);}\nfor(var i=0,n=this._childNodes.length;i<n;i++)\n{if((cnode=this._childNodes[i])&&(cnode!==this._cf.proxy.node)){cnode.collectDrawableObjects(childTransform,drawableCollection,singlePath,invalidateCache,planeMask,clipPlanes);}}}}));x3dom.registerNodeType(\"X3DLODNode\",\"Navigation\",defineClass(x3dom.nodeTypes.X3DGroupingNode,function(ctx){x3dom.nodeTypes.X3DLODNode.superClass.call(this,ctx);this.addField_SFBool(ctx,\"forceTransitions\",false);this.addField_SFVec3f(ctx,\"center\",0,0,0);this._eye=new x3dom.fields.SFVec3f(0,0,0);},{collectDrawableObjects:function(transform,drawableCollection,singlePath,invalidateCache,planeMask,clipPlanes)\n{if(singlePath&&(this._parentNodes.length>1))\nsinglePath=false;if(singlePath&&(invalidateCache=invalidateCache||this.cacheInvalid()))\nthis.invalidateCache();planeMask=drawableCollection.cull(transform,this.graphState(),singlePath,planeMask);if(planeMask<0){return;}\nsinglePath=false;this.visitChildren(transform,drawableCollection,singlePath,invalidateCache,planeMask,clipPlanes);},visitChildren:function(transform,drawableCollection,singlePath,invalidateCache,planeMask,clipPlanes){}}));x3dom.registerNodeType(\"LOD\",\"Navigation\",defineClass(x3dom.nodeTypes.X3DLODNode,function(ctx){x3dom.nodeTypes.LOD.superClass.call(this,ctx);this.addField_MFFloat(ctx,\"range\",[]);this.addField_SFInt32(ctx,\"level_changed\",0);this._lastRangePos=-1;},{visitChildren:function(transform,drawableCollection,singlePath,invalidateCache,planeMask,clipPlanes)\n{var i=0,n=this._childNodes.length;var mat_view=drawableCollection.viewMatrix;var center=new x3dom.fields.SFVec3f(0,0,0);center=mat_view.inverse().multMatrixPnt(center);this._eye=transform.inverse().multMatrixPnt(center);var len=this._vf.center.subtract(this._eye).length();while(i<this._vf.range.length&&len>this._vf.range[i]){i++;}\nif(i&&i>=n){i=n-1;}\nif(i!==this._lastRangePos){this.postMessage('level_changed',i);}\nthis._lastRangePos=i;var cnode=this._childNodes[i];if(n&&cnode)\n{var childTransform=this.transformMatrix(transform);cnode.collectDrawableObjects(childTransform,drawableCollection,singlePath,invalidateCache,planeMask,clipPlanes);}},getVolume:function()\n{var vol=this._graph.volume;if(!this.volumeValid()&&this._vf.render)\n{var child,childVol;if(this._lastRangePos>=0){child=this._childNodes[this._lastRangePos];childVol=(child&&child._vf.render===true)?child.getVolume():null;if(childVol&&childVol.isValid())\nvol.extendBounds(childVol.min,childVol.max);}\nelse{for(var i=0,n=this._childNodes.length;i<n;i++)\n{if(!(child=this._childNodes[i])||child._vf.render!==true)\ncontinue;childVol=child.getVolume();if(childVol&&childVol.isValid())\nvol.extendBounds(childVol.min,childVol.max);}}}\nreturn vol;},nodeChanged:function(){this.invalidateVolume();},fieldChanged:function(fieldName){if(fieldName==\"render\"||fieldName==\"center\"||fieldName==\"range\"){this.invalidateVolume();}}}));x3dom.registerNodeType(\"DynamicLOD\",\"Navigation\",defineClass(x3dom.nodeTypes.X3DLODNode,function(ctx){x3dom.nodeTypes.DynamicLOD.superClass.call(this,ctx);this.addField_SFFloat(ctx,'subScale',0.5);this.addField_SFVec2f(ctx,'size',2,2);this.addField_SFVec2f(ctx,'subdivision',1,1);this.addField_SFNode('root',x3dom.nodeTypes.X3DShapeNode);this.addField_SFString(ctx,'urlHead',\"http://r\");this.addField_SFString(ctx,'urlCenter',\".ortho.tiles.virtualearth.net/tiles/h\");this.addField_SFString(ctx,'urlTail',\".png?g=-1\");this.rootGeometry=new x3dom.nodeTypes.Plane(ctx);this.level=0;this.quadrant=4;this.cell=\"\";},{nodeChanged:function()\n{var root=this._cf.root.node;if(root==null||root._cf.geometry.node!=null)\nreturn;this.rootGeometry._vf.size.setValues(this._vf.size);this.rootGeometry._vf.subdivision.setValues(this._vf.subdivision);this.rootGeometry._vf.center.setValues(this._vf.center);this.rootGeometry.fieldChanged(\"subdivision\");this._cf.root.node.addChild(this.rootGeometry);this.rootGeometry.nodeChanged();this._cf.root.node.nodeChanged();this._nameSpace.doc.needRender=true;},visitChildren:function(transform,drawableCollection,singlePath,invalidateCache,planeMask,clipPlanes)\n{var root=this._cf.root.node;if(root==null)\nreturn;var mat_view=drawableCollection.viewMatrix;var center=new x3dom.fields.SFVec3f(0,0,0);center=mat_view.inverse().multMatrixPnt(center);this._eye=transform.inverse().multMatrixPnt(center);var l,len=this._vf.center.subtract(this._eye).length();if(len>x3dom.fields.Eps&&len*this._vf.subScale<=this._vf.size.length()){if(this._childNodes.length<=1){var offset=new Array(new x3dom.fields.SFVec3f(-0.25*this._vf.size.x,0.25*this._vf.size.y,0),new x3dom.fields.SFVec3f(0.25*this._vf.size.x,0.25*this._vf.size.y,0),new x3dom.fields.SFVec3f(-0.25*this._vf.size.x,-0.25*this._vf.size.y,0),new x3dom.fields.SFVec3f(0.25*this._vf.size.x,-0.25*this._vf.size.y,0));for(l=0;l<4;l++){var node=new x3dom.nodeTypes.DynamicLOD();node._nameSpace=this._nameSpace;node._eye.setValues(this._eye);node.level=this.level+1;node.quadrant=l;node.cell=this.cell+l;node._vf.urlHead=this._vf.urlHead;node._vf.urlCenter=this._vf.urlCenter;node._vf.urlTail=this._vf.urlTail;node._vf.center=this._vf.center.add(offset[l]);node._vf.size=this._vf.size.multiply(0.5);node._vf.subdivision.setValues(this._vf.subdivision);var app=new x3dom.nodeTypes.Appearance();var tex=new x3dom.nodeTypes.ImageTexture();tex._nameSpace=this._nameSpace;tex._vf.url[0]=this._vf.urlHead+node.quadrant+this._vf.urlCenter+node.cell+this._vf.urlTail;app.addChild(tex);tex.nodeChanged();var shape=new x3dom.nodeTypes.Shape();shape._nameSpace=this._nameSpace;shape.addChild(app);app.nodeChanged();node.addChild(shape,\"root\");shape.nodeChanged();this.addChild(node);node.nodeChanged();}}\nelse{for(l=1;l<this._childNodes.length;l++){this._childNodes[l].collectDrawableObjects(transform,drawableCollection,singlePath,invalidateCache,planeMask,clipPlanes);}}}\nelse{root.collectDrawableObjects(transform,drawableCollection,singlePath,invalidateCache,planeMask,clipPlanes);}},getVolume:function(){var vol=this._graph.volume;if(!vol.isValid()){vol.min.setValues(this._vf.center);vol.min.x-=0.5*this._vf.size.x;vol.min.y-=0.5*this._vf.size.y;vol.min.z-=x3dom.fields.Eps;vol.max.setValues(this._vf.center);vol.max.x+=0.5*this._vf.size.x;vol.max.y+=0.5*this._vf.size.y;vol.max.z+=x3dom.fields.Eps;}\nreturn vol;}}));x3dom.DefaultNavigation=function(navigationNode)\n{this.navi=navigationNode;};x3dom.DefaultNavigation.prototype.onMousePress=function(view,x,y,buttonState)\n{};x3dom.DefaultNavigation.prototype.onMouseReleased=function(view,x,y,buttonState,prevButton)\n{};x3dom.DefaultNavigation.prototype.init=function(view,flyTo)\n{};x3dom.DefaultNavigation.prototype.zoom=function(view,zoomAmount)\n{var navi=this.navi;var viewpoint=view._scene.getViewpoint();var d=(view._scene._lastMax.subtract(view._scene._lastMin)).length();d=Math.min(d,viewpoint.getFar());d=((d<x3dom.fields.Eps)?1:d)*navi._vf.speed;var vec=new x3dom.fields.SFVec3f(0,0,d*(zoomAmount)/view._height);if(x3dom.isa(viewpoint,x3dom.nodeTypes.OrthoViewpoint))\n{viewpoint.setZoom(Math.abs(viewpoint._fieldOfView[0])-vec.z);}\n{if(navi._vf.typeParams.length>=6){var min=-navi._vf.typeParams[5];var max=navi._vf.typeParams[4];view._movement.z=Math.min(Math.max(view._movement.z,min),max);}\nview._movement=view._movement.add(vec);var mat=view.getViewpointMatrix().mult(view._transMat);view._transMat=mat.inverse().mult(x3dom.fields.SFMatrix4f.translation(view._movement)).mult(mat);}};x3dom.DefaultNavigation.prototype.moveForward=function(view)\n{var navi=this.navi;if(navi.getType()===\"game\")\n{var avatarRadius=0.25;if(navi._vf.avatarSize.length>2){avatarRadius=navi._vf.avatarSize[0];}\nvar speed=5*view._deltaT*navi._vf.speed;var yRotRad=(view._yaw/180*Math.PI);var xRotRad=(view._pitch/180*Math.PI);var dist=0;var fMat=view._flyMat.inverse();view._scene._nameSpace.doc.ctx.pickValue(view,view._width/2,view._height/2,view._lastButton);if(view._pickingInfo.pickObj)\n{dist=view._pickingInfo.pickPos.subtract(fMat.e3()).length();if(dist<=2*avatarRadius){}\nelse{view._eyePos.x-=Math.sin(yRotRad)*speed;view._eyePos.z+=Math.cos(yRotRad)*speed;view._eyePos.y+=Math.sin(xRotRad)*speed;}}}};x3dom.DefaultNavigation.prototype.moveBackwards=function(view)\n{var navi=this.navi;if(navi.getType()===\"game\")\n{var speed=5*view._deltaT*navi._vf.speed;var yRotRad=(view._yaw/180*Math.PI);var xRotRad=(view._pitch/180*Math.PI);view._eyePos.x+=Math.sin(yRotRad)*speed;view._eyePos.z-=Math.cos(yRotRad)*speed;view._eyePos.y-=Math.sin(xRotRad)*speed;}};x3dom.DefaultNavigation.prototype.strafeLeft=function(view)\n{var navi=this.navi;if(navi.getType()===\"game\")\n{var speed=5*view._deltaT*navi._vf.speed;var yRotRad=(view._yaw/180*Math.PI);view._eyePos.x+=Math.cos(yRotRad)*speed;view._eyePos.z+=Math.sin(yRotRad)*speed;}};x3dom.DefaultNavigation.prototype.strafeRight=function(view)\n{var navi=this.navi;if(navi.getType()===\"game\")\n{var speed=5*view._deltaT*navi._vf.speed;var yRotRad=(view._yaw/180*Math.PI);view._eyePos.x-=Math.cos(yRotRad)*speed;view._eyePos.z-=Math.sin(yRotRad)*speed;}};x3dom.DefaultNavigation.prototype.navigateTo=function(view,timeStamp)\n{var navi=this.navi;var navType=navi.getType();var savedPickingInfo=null;var needNavAnim=(view._currentInputType==x3dom.InputTypes.NAVIGATION)&&(navType===\"game\"||(view._lastButton>0&&(navType.indexOf(\"fly\")>=0||navType===\"walk\"||navType===\"helicopter\"||navType.substr(0,5)===\"looka\")));view._deltaT=timeStamp-view._lastTS;var removeZeroMargin=function(val,offset){if(val>0){if(val<=offset){return 0;}else{return val-offset;}}else if(val<=0){if(val>=-offset){return 0;}else{return val+offset;}}};var humanizeDiff=function(scale,diff){return((diff<0)?-1:1)*Math.pow(scale*Math.abs(diff),1.65);};if(needNavAnim)\n{if(view._pickingInfo.pickObj!==null){savedPickingInfo={pickPos:view._pickingInfo.pickPos,pickNorm:view._pickingInfo.pickNorm,pickObj:view._pickingInfo.pickObj,firstObj:view._pickingInfo.firstObj,lastObj:view._pickingInfo.lastObj,lastClickObj:view._pickingInfo.lastClickObj,shadowObjectId:view._pickingInfo.shadowObjectId};}\nvar avatarRadius=0.25;var avatarHeight=1.6;var avatarKnee=0.75;if(navi._vf.avatarSize.length>2){avatarRadius=navi._vf.avatarSize[0];avatarHeight=navi._vf.avatarSize[1];avatarKnee=navi._vf.avatarSize[2];}\nvar currViewMat=view.getViewMatrix();var dist=0;var screenSize=Math.min(view._width,view._height);var rdeltaX=removeZeroMargin((view._pressX-view._lastX)/screenSize,0.01);var rdeltaY=removeZeroMargin((view._pressY-view._lastY)/screenSize,0.01);var userXdiff=humanizeDiff(1,rdeltaX);var userYdiff=humanizeDiff(1,rdeltaY);var step=(view._lastButton&2)?-1:1;step*=(view._deltaT*navi._vf.speed);var userXstep=view._deltaT*navi._vf.speed*userXdiff;var userYstep=view._deltaT*navi._vf.speed*userYdiff;var phi=Math.PI*view._deltaT*userXdiff;var theta=Math.PI*view._deltaT*userYdiff;if(view._needNavigationMatrixUpdate===true)\n{view._needNavigationMatrixUpdate=false;view._rotMat=x3dom.fields.SFMatrix4f.identity();view._transMat=x3dom.fields.SFMatrix4f.identity();view._movement=new x3dom.fields.SFVec3f(0,0,0);var angleX=0;var angleY=Math.asin(currViewMat._02);var C=Math.cos(angleY);if(Math.abs(C)>0.0001){angleX=Math.atan2(-currViewMat._12/C,currViewMat._22/C);}\nview._flyMat=currViewMat.inverse();view._from=view._flyMat.e3();view._at=view._from.subtract(view._flyMat.e2());if(navType===\"helicopter\")\nview._at.y=view._from.y;view._up=view._flyMat.e1();view._pitch=angleX*180/Math.PI;view._yaw=angleY*180/Math.PI;view._eyePos=view._from.negate();}\nvar tmpAt=null,tmpUp=null,tmpMat=null;var q,temp,fin;var lv,sv,up;if(navType===\"game\")\n{view._pitch+=view._dy;view._yaw+=view._dx;if(view._pitch>=89)view._pitch=89;if(view._pitch<=-89)view._pitch=-89;if(view._yaw>=360)view._yaw-=360;if(view._yaw<0)view._yaw=360+view._yaw;view._dx=0;view._dy=0;var xMat=x3dom.fields.SFMatrix4f.rotationX(view._pitch/180*Math.PI);var yMat=x3dom.fields.SFMatrix4f.rotationY(view._yaw/180*Math.PI);var fPos=x3dom.fields.SFMatrix4f.translation(view._eyePos);view._flyMat=xMat.mult(yMat).mult(fPos);var flyMat=view._flyMat.inverse();var tmpFrom=flyMat.e3();tmpUp=new x3dom.fields.SFVec3f(0,-1,0);tmpAt=tmpFrom.add(tmpUp);tmpUp=flyMat.e0().cross(tmpUp).normalize();tmpMat=x3dom.fields.SFMatrix4f.lookAt(tmpFrom,tmpAt,tmpUp);tmpMat=tmpMat.inverse();view._scene._nameSpace.doc.ctx.pickValue(view,view._width/2,view._height/2,view._lastButton,tmpMat,view.getProjectionMatrix().mult(tmpMat));if(view._pickingInfo.pickObj)\n{dist=view._pickingInfo.pickPos.subtract(tmpFrom).length();tmpFrom.y+=(avatarHeight-dist);flyMat.setTranslate(tmpFrom);view._eyePos=flyMat.e3().negate();view._flyMat=flyMat.inverse();view._pickingInfo.pickObj=null;}\nview._scene.getViewpoint().setView(view._flyMat);return needNavAnim;}\nelse if(navType===\"helicopter\"){var typeParams=navi.getTypeParams();if(view._lastButton&2)\n{var stepUp=200*userYstep;typeParams[1]+=stepUp;navi.setTypeParams(typeParams);}\nif(view._lastButton&1){step=300*userYstep;}\nelse{step=0;}\ntheta=typeParams[0];view._from.y=typeParams[1];view._at.y=view._from.y;q=x3dom.fields.Quaternion.axisAngle(view._up,phi);temp=q.toMatrix();fin=x3dom.fields.SFMatrix4f.translation(view._from);fin=fin.mult(temp);temp=x3dom.fields.SFMatrix4f.translation(view._from.negate());fin=fin.mult(temp);view._at=fin.multMatrixPnt(view._at);lv=view._at.subtract(view._from).normalize();sv=lv.cross(view._up).normalize();up=sv.cross(lv).normalize();lv=lv.multiply(step);view._from=view._from.add(lv);view._at=view._at.add(lv);q=x3dom.fields.Quaternion.axisAngle(sv,theta);temp=q.toMatrix();fin=x3dom.fields.SFMatrix4f.translation(view._from);fin=fin.mult(temp);temp=x3dom.fields.SFMatrix4f.translation(view._from.negate());fin=fin.mult(temp);var at=fin.multMatrixPnt(view._at);view._flyMat=x3dom.fields.SFMatrix4f.lookAt(view._from,at,up);view._scene.getViewpoint().setView(view._flyMat.inverse());return needNavAnim;}\nq=x3dom.fields.Quaternion.axisAngle(view._up,phi);temp=q.toMatrix();fin=x3dom.fields.SFMatrix4f.translation(view._from);fin=fin.mult(temp);temp=x3dom.fields.SFMatrix4f.translation(view._from.negate());fin=fin.mult(temp);view._at=fin.multMatrixPnt(view._at);lv=view._at.subtract(view._from).normalize();sv=lv.cross(view._up).normalize();up=sv.cross(lv).normalize();q=x3dom.fields.Quaternion.axisAngle(sv,theta);temp=q.toMatrix();fin=x3dom.fields.SFMatrix4f.translation(view._from);fin=fin.mult(temp);temp=x3dom.fields.SFMatrix4f.translation(view._from.negate());fin=fin.mult(temp);view._at=fin.multMatrixPnt(view._at);if(navType.substr(0,5)!==\"looka\")\n{var currProjMat=view.getProjectionMatrix();if(navType!==\"freefly\"){if(step<0){tmpMat=new x3dom.fields.SFMatrix4f();tmpMat.setValue(view._last_mat_view.e0(),view._last_mat_view.e1(),view._last_mat_view.e2().negate(),view._last_mat_view.e3());view._scene._nameSpace.doc.ctx.pickValue(view,view._width/2,view._height/2,view._lastButton,tmpMat,currProjMat.mult(tmpMat));}\nelse{view._scene._nameSpace.doc.ctx.pickValue(view,view._width/2,view._height/2,view._lastButton);}\nif(view._pickingInfo.pickObj)\n{dist=view._pickingInfo.pickPos.subtract(view._from).length();if(dist<=avatarRadius){step=0;}}}\nlv=view._at.subtract(view._from).normalize().multiply(step);view._at=view._at.add(lv);view._from=view._from.add(lv);if(navType===\"walk\")\n{up.x=0.0;up.y=1.0;up.z=0.0;tmpAt=view._from.addScaled(up,-1.0);tmpUp=sv.cross(up.negate()).normalize();tmpMat=x3dom.fields.SFMatrix4f.lookAt(view._from,tmpAt,tmpUp);tmpMat=tmpMat.inverse();view._scene._nameSpace.doc.ctx.pickValue(view,view._width/2,view._height/2,view._lastButton,tmpMat,currProjMat.mult(tmpMat));if(view._pickingInfo.pickObj)\n{dist=view._pickingInfo.pickPos.subtract(view._from).length();dist=(avatarHeight-dist)/navi._vf.walkDamping;view._at=view._at.add(up.multiply(dist));view._from=view._from.add(up.multiply(dist));}}\nview._pickingInfo.pickObj=null;}\nview._flyMat=x3dom.fields.SFMatrix4f.lookAt(view._from,view._at,up);view._scene.getViewpoint().setView(view._flyMat.inverse());if(savedPickingInfo!==null){view._pickingInfo=savedPickingInfo;}}\nreturn needNavAnim;};x3dom.DefaultNavigation.prototype.animateTo=function(view,target,prev,dur)\n{var navi=this.navi;var prevTargetMat;var prevMat;if(x3dom.isa(target,x3dom.nodeTypes.X3DViewpointNode))\n{target=target.getViewMatrix().mult(target.getCurrentTransform().inverse());}\nif(navi._vf.transitionType[0].toLowerCase()!==\"teleport\"&&dur!=0&&navi.getType()!==\"game\")\n{if(prev&&x3dom.isa(prev,x3dom.nodeTypes.X3DViewpointNode))\n{prevMat=prev.getViewMatrix().mult(prev.getCurrentTransform().inverse()).mult(view._transMat).mult(view._rotMat);if(view._mixer.isActive())\n{prev.setView(view._mixer.getEndMatrix());view._mixer.reset();}\nview._mixer.beginTime=view._lastTS;if(arguments.length>=4&&arguments[3]!=null)\n{view._mixer.endTime=view._lastTS+dur;}\nelse\n{view._mixer.endTime=view._lastTS+navi._vf.transitionTime;}\nview._mixer.setBeginMatrix(prevMat);view._mixer.setEndMatrix(target);view._scene.getViewpoint().setView(prevMat);}\nelse\n{view._scene.getViewpoint().setView(target);}}\nelse\n{view._scene.getViewpoint().setView(target);}\nview._rotMat=x3dom.fields.SFMatrix4f.identity();view._transMat=x3dom.fields.SFMatrix4f.identity();view._movement=new x3dom.fields.SFVec3f(0,0,0);view._needNavigationMatrixUpdate=true;};x3dom.DefaultNavigation.prototype.orthoAnimateTo=function(view,target,prev,duration)\n{var navi=this.navi;duration=duration||navi._vf.transitionTime;view._interpolator.beginValue=prev;view._interpolator.endValue=target;view._interpolator.beginTime=view._lastTS;view._interpolator.endTime=view._lastTS+duration;};x3dom.DefaultNavigation.prototype.resetView=function(view)\n{var navi=this.navi;if(navi._vf.transitionType[0].toLowerCase()!==\"teleport\"&&navi.getType()!==\"game\")\n{var viewpoint=view._scene.getViewpoint();view._mixer.beginTime=view._lastTS;view._mixer.endTime=view._lastTS+navi._vf.transitionTime;view._mixer.setBeginMatrix(view.getViewMatrix());if(x3dom.isa(viewpoint,x3dom.nodeTypes.OrthoViewpoint))\n{this.orthoAnimateTo(view,Math.abs(viewpoint._vf.fieldOfView[0]),Math.abs(viewpoint._fieldOfView[0]));}\nvar target=view._scene.getViewpoint();target.resetView();target=target.getViewMatrix().mult(target.getCurrentTransform().inverse());view._mixer.setEndMatrix(target);}\nelse\n{view._scene.getViewpoint().resetView();}\nview.resetNavHelpers();navi._heliUpdated=false;};x3dom.DefaultNavigation.prototype.onDrag=function(view,x,y,buttonState)\n{var navi=this.navi;var navType=navi.getType();var navRestrict=navi.getExplorationMode();if(navType===\"none\"||navRestrict==0){return;}\nvar viewpoint=view._scene.getViewpoint();var dx=x-view._lastX;var dy=y-view._lastY;view._dx=dx;view._dy=dy;view._lastX=x;view._lastY=y;if(navType!==\"examine\"){return;}\nvar d,vec,cor,mat=null;var alpha,beta;buttonState=buttonState&navRestrict;if(buttonState&1)\n{alpha=(dy*2*Math.PI)/view._width;beta=(dx*2*Math.PI)/view._height;mat=view.getViewMatrix();var mx=x3dom.fields.SFMatrix4f.rotationX(alpha);var my=x3dom.fields.SFMatrix4f.rotationY(beta);var center=viewpoint.getCenterOfRotation();mat.setTranslate(new x3dom.fields.SFVec3f(0,0,0));view._rotMat=view._rotMat.mult(x3dom.fields.SFMatrix4f.translation(center)).mult(mat.inverse()).mult(mx).mult(my).mult(mat).mult(x3dom.fields.SFMatrix4f.translation(center.negate()));}\nif(buttonState&4)\n{d=(view._scene._lastMax.subtract(view._scene._lastMin)).length();d=Math.min(d,viewpoint.getFar());d=((d<x3dom.fields.Eps)?1:d)*navi._vf.speed;vec=new x3dom.fields.SFVec3f(d*dx/view._width,d*(-dy)/view._height,0);view._movement=view._movement.add(vec);mat=view.getViewpointMatrix().mult(view._transMat);view._transMat=mat.inverse().mult(x3dom.fields.SFMatrix4f.translation(view._movement)).mult(mat);}\nif(buttonState&2)\n{d=(view._scene._lastMax.subtract(view._scene._lastMin)).length();d=Math.min(d,viewpoint.getFar());d=((d<x3dom.fields.Eps)?1:d)*navi._vf.speed;vec=new x3dom.fields.SFVec3f(0,0,d*(dx+dy)/view._height);if(x3dom.isa(viewpoint,x3dom.nodeTypes.OrthoViewpoint))\n{viewpoint.setZoom(Math.abs(viewpoint._fieldOfView[0])-vec.z);}\n{if(navi._vf.typeParams.length>=6){var min=-navi._vf.typeParams[5];var max=navi._vf.typeParams[4];view._movement.z=Math.min(Math.max(view._movement.z,min),max);}\nview._movement=view._movement.add(vec);mat=view.getViewpointMatrix().mult(view._transMat);view._transMat=mat.inverse().mult(x3dom.fields.SFMatrix4f.translation(view._movement)).mult(mat);}}\nview._isMoving=true;};x3dom.DefaultNavigation.prototype.onTouchStart=function(view,evt,touches)\n{};x3dom.DefaultNavigation.prototype.onTouchDrag=function(view,evt,touches,translation,rotation)\n{if(view._currentInputType==x3dom.InputTypes.NAVIGATION)\n{var navi=this.navi;var viewpoint=view._scene.getViewpoint();var navRestrict=navi.getExplorationMode();if(navi.getType()===\"examine\"&&navRestrict!==0)\n{if(translation&&navRestrict&4)\n{var distance=(view._scene._lastMax.subtract(view._scene._lastMin)).length();distance=Math.min(distance,viewpoint.getFar());distance=((distance<x3dom.fields.Eps)?1:distance)*navi._vf.speed;translation=translation.multiply(distance);if(x3dom.isa(viewpoint,x3dom.nodeTypes.OrthoViewpoint))\n{viewpoint.setZoom(Math.abs(viewpoint._fieldOfView[0])-translation.z);translation.z=0;}\nview._movement=view._movement.add(translation);view._transMat=viewpoint.getViewMatrix().inverse().mult(x3dom.fields.SFMatrix4f.translation(view._movement)).mult(viewpoint.getViewMatrix());}\nif(rotation&&navRestrict&1)\n{var center=viewpoint.getCenterOfRotation();var mat=view.getViewMatrix();mat.setTranslate(new x3dom.fields.SFVec3f(0,0,0));view._rotMat=view._rotMat.mult(x3dom.fields.SFMatrix4f.translation(center)).mult(mat.inverse()).mult(rotation).mult(mat).mult(x3dom.fields.SFMatrix4f.translation(center.negate()));}\nview._isMoving=true;}}};x3dom.DefaultNavigation.prototype.onTouchEnd=function(evt,touches)\n{};x3dom.DefaultNavigation.prototype.onDoubleClick=function(view,x,y)\n{if(view._doc._x3dElem.hasAttribute('disableDoubleClick')&&view._doc._x3dElem.getAttribute('disableDoubleClick')==='true'){return;}\nvar navi=view._scene.getNavigationInfo();if(navi.getType()==\"none\"){return;}\nvar pickMode=view._scene._vf.pickMode.toLowerCase();if((pickMode==\"color\"||pickMode==\"texcoord\")){return;}\nvar viewpoint=view._scene.getViewpoint();viewpoint.setCenterOfRotation(view._pick);x3dom.debug.logInfo(\"New center of Rotation:  \"+view._pick);var mat=view.getViewMatrix().inverse();var from=mat.e3();var at=view._pick;var up=mat.e1();var norm=mat.e0().cross(up).normalize();var dist=norm.dot(view._pick.subtract(from));from=at.addScaled(norm,-dist);mat=x3dom.fields.SFMatrix4f.lookAt(from,at,up);x3dom.debug.logInfo(\"New camera position:  \"+from);view.animateTo(mat.inverse(),viewpoint);};x3dom.TurntableNavigation=function(navigationNode)\n{x3dom.DefaultNavigation.call(this,navigationNode);this.panAxisX=null;this.panAxisY=null;this.panEnabled=true;};x3dom.TurntableNavigation.prototype=Object.create(x3dom.DefaultNavigation.prototype);x3dom.TurntableNavigation.prototype.constructor=x3dom.TurntableNavigation;x3dom.TurntableNavigation.prototype.onDrag=function(view,x,y,buttonState)\n{var navi=this.navi;if(!view._flyMat)\nthis.initTurnTable(view,false);var navType=navi.getType();var navRestrict=navi.getExplorationMode();if(navType===\"none\"||navRestrict==0){return;}\nvar dx=x-view._lastX;var dy=y-view._lastY;var d=null;var alpha,beta;buttonState=(!navRestrict||(navRestrict!=7&&buttonState==1))?navRestrict:buttonState;if(buttonState&1)\n{alpha=(dy*2*Math.PI)/view._height;beta=(dx*2*Math.PI)/view._width;this.rotate(view,alpha,beta);}\nelse if(buttonState&2)\n{d=(view._scene._lastMax.subtract(view._scene._lastMin)).length();d=((d<x3dom.fields.Eps)?1:d)*navi._vf.speed;var zoomAmount=d*(dx+dy)/view._height;this.zoom(view,zoomAmount);}\nelse if((buttonState&4)&&this.panEnabled==true)\n{d=(view._scene._lastMax.subtract(view._scene._lastMin)).length();d=((d<x3dom.fields.Eps)?1:d)*navi._vf.speed*0.75;var tx=-d*dx/view._width;var ty=d*dy/view._height;this.pan(view,tx,ty);}\nview._isMoving=true;view._dx=dx;view._dy=dy;view._lastX=x;view._lastY=y;};x3dom.TurntableNavigation.prototype.pan=function(view,tx,ty)\n{var viewpoint=view._scene.getViewpoint();if(this.target!=null){var target=this.target;var bbox=target._x3domNode.getVolume();view._up=view._flyMat.e1();view._from=view._flyMat.e3();var cor=view._at;cor=cor.addScaled(this.panAxisY,ty);var temp=cor;if(cor.y>bbox.max.y||cor.y<bbox.min.y)\ntemp=view._at;else\nview._from=view._from.addScaled(this.panAxisY,ty);cor=temp.addScaled(this.panAxisX,tx);if(cor.x>bbox.max.x||cor.x<bbox.min.x)\ncor=temp;else\nview._from=view._from.addScaled(this.panAxisX,tx);view._at=cor;view._flyMat=x3dom.fields.SFMatrix4f.lookAt(view._from,cor,view._up);viewpoint.setViewAbsolute(view._flyMat.inverse());}else if(this.panAxisX!=null&&this.panAxisY!=null){view._up=view._flyMat.e1();view._from=view._flyMat.e3();var cor=view._at;cor=cor.addScaled(this.panAxisY,ty);var temp=cor;view._from=view._from.addScaled(this.panAxisY,ty);cor=temp.addScaled(this.panAxisX,tx);view._from=view._from.addScaled(this.panAxisX,tx);view._at=cor;view._flyMat=x3dom.fields.SFMatrix4f.lookAt(view._from,cor,view._up);viewpoint.setViewAbsolute(view._flyMat.inverse());}else{view._up=view._flyMat.e1();view._from=view._flyMat.e3();var xAxis=view._up.cross(view._from).normalize();var yAxis=view._from.cross(xAxis).normalize();var cor=view._at;cor=cor.addScaled(yAxis,ty);var temp=cor;view._from=view._from.addScaled(yAxis,ty);cor=temp.addScaled(xAxis,tx);view._from=view._from.addScaled(xAxis,tx);view._at=cor;view._flyMat=x3dom.fields.SFMatrix4f.lookAt(view._from,cor,view._up);viewpoint.setViewAbsolute(view._flyMat.inverse());}};x3dom.TurntableNavigation.prototype.rotate=function(view,alpha,beta)\n{var viewpoint=view._scene.getViewpoint();view._flyMat=this.calcOrbit(view,alpha,beta);viewpoint.setView(view._flyMat.inverse());};x3dom.TurntableNavigation.prototype.zoom=function(view,zoomAmount)\n{var navi=this.navi;var viewpoint=view._scene.getViewpoint();view._up=view._flyMat.e1();view._from=view._flyMat.e3();var cor=view._at;var lastDir=cor.subtract(view._from);var lastDirL=lastDir.length();lastDir=lastDir.normalize();var newDist=zoomAmount;if(navi._vf.typeParams[6])\nnewDist=Math.min(zoomAmount,lastDirL-navi._vf.typeParams[6]);if(navi._vf.typeParams[7])\nnewDist=Math.max(newDist,lastDirL-navi._vf.typeParams[7]);view._from=view._from.addScaled(lastDir,newDist);view._flyMat=x3dom.fields.SFMatrix4f.lookAt(view._from,cor,view._up);viewpoint.setViewAbsolute(view._flyMat.inverse());};x3dom.TurntableNavigation.prototype.calcOrbit=function(view,alpha,beta,absolute)\n{var navi=this.navi;view._up=view._flyMat.e1();view._from=view._flyMat.e3();var offset=view._from.subtract(view._at);var phi;var theta;if(absolute==true){phi=beta;theta=alpha;}else{phi=Math.atan2(offset.x,offset.z);theta=Math.atan2(Math.sqrt(offset.x*offset.x+offset.z*offset.z),offset.y);phi-=beta;theta-=alpha;}\ntheta=Math.max(navi._vf.typeParams[2],Math.min(navi._vf.typeParams[3],theta));if(navi._vf.typeParams[4]<=navi._vf.typeParams[5])\nphi=Math.max(navi._vf.typeParams[4],Math.min(navi._vf.typeParams[5],phi));else{if(beta>0&&phi<navi._vf.typeParams[4]&&phi>navi._vf.typeParams[5])phi=navi._vf.typeParams[4];else if(beta<0&&phi>navi._vf.typeParams[5]&&phi<navi._vf.typeParams[4])phi=navi._vf.typeParams[5];}\nvar radius=offset.length();var rSinPhi=radius*Math.sin(theta);offset.x=rSinPhi*Math.sin(phi);offset.y=radius*Math.cos(theta);offset.z=rSinPhi*Math.cos(phi);offset=view._at.add(offset);theta-=Math.PI/2;var sinPhi=Math.sin(theta);var cosPhi=Math.cos(theta);var up=new x3dom.fields.SFVec3f(sinPhi*Math.sin(phi),cosPhi,sinPhi*Math.cos(phi));if(up.y<0)\nup=up.negate();return x3dom.fields.SFMatrix4f.lookAt(offset,view._at,up);};x3dom.TurntableNavigation.prototype.initTurnTable=function(view,flyTo)\n{var navi=this.navi;flyTo=(flyTo==undefined)?true:flyTo;var currViewMat=view.getViewMatrix();view._rotMat=x3dom.fields.SFMatrix4f.identity();view._transMat=x3dom.fields.SFMatrix4f.identity();var viewpoint=view._scene.getViewpoint();var center=x3dom.fields.SFVec3f.copy(viewpoint.getCenterOfRotation());view._flyMat=currViewMat.inverse();view._from=viewpoint._vf.position;view._at=center;view._up=new x3dom.fields.SFVec3f(0,1,0);view._flyMat=x3dom.fields.SFMatrix4f.lookAt(view._from,view._at,view._up);var _from=currViewMat.inverse().e3();var offset=_from.subtract(view._at);var phi=Math.atan2(offset.x,offset.z);var theta=Math.atan2(Math.sqrt(offset.x*offset.x+offset.z*offset.z),offset.y);view._flyMat=this.calcOrbit(view,theta,phi,true);var dur=0.0;if(flyTo){dur=0.2/navi._vf.speed;this.animateTo(view,view._flyMat.inverse(),currViewMat,dur);}\nview.resetNavHelpers();};x3dom.TurntableNavigation.prototype.onMousePress=function(view,x,y,buttonState)\n{if(!view._flyMat)\nthis.initTurnTable(view,false);};x3dom.TurntableNavigation.prototype.init=function(view,flyTo)\n{this.initTurnTable(view,true);};x3dom.TurntableNavigation.prototype.resetView=function(view)\n{view._mixer.beginTime=view._lastTS;view._mixer.endTime=view._lastTS+this.navi._vf.transitionTime;view._mixer.setBeginMatrix(view.getViewMatrix());var target=view._scene.getViewpoint();target.resetView();target=x3dom.fields.SFMatrix4f.lookAt(target._vf.position,target.getCenterOfRotation(),new x3dom.fields.SFVec3f(0,1,0));view._mixer.setEndMatrix(target.inverse());this.updateFlyMat(view);};x3dom.TurntableNavigation.prototype.updateFlyMat=function(view,nextViewpoint,overrideMat)\n{if(!view._flyMat)\nthis.initTurnTable(view,false);var currViewMat=view.getViewMatrix();var viewpoint=nextViewpoint;if(viewpoint==null||!x3dom.isa(viewpoint,x3dom.nodeTypes.X3DViewpointNode))\nviewpoint=view._scene.getViewpoint();var center=x3dom.fields.SFVec3f.copy(viewpoint.getCenterOfRotation());view._flyMat=currViewMat.inverse();if(overrideMat)\nview._from=overrideMat.inverse().e3();else\nview._from=viewpoint._vf.position;view._at=center;view._up=new x3dom.fields.SFVec3f(0,1,0);view._flyMat=x3dom.fields.SFMatrix4f.lookAt(view._from,view._at,view._up);var _from=currViewMat.inverse().e3();var offset=_from.subtract(view._at);var phi=Math.atan2(offset.x,offset.z);var theta=Math.atan2(Math.sqrt(offset.x*offset.x+offset.z*offset.z),offset.y);view._flyMat=this.calcOrbit(view,theta,phi,true);};x3dom.TurntableNavigation.prototype.animateTo=function(view,target,prev,dur)\n{var navi=this.navi;var targetMat;if(x3dom.isa(target,x3dom.nodeTypes.X3DViewpointNode)){targetMat=x3dom.fields.SFMatrix4f.lookAt(target._vf.position,target.getCenterOfRotation(),new x3dom.fields.SFVec3f(0,1,0));}else\ntargetMat=target;if(navi._vf.transitionType[0].toLowerCase()!==\"teleport\"&&dur!=0&&navi.getType()!==\"game\")\n{if(prev&&x3dom.isa(prev,x3dom.nodeTypes.X3DViewpointNode)){prev=prev.getViewMatrix().mult(prev.getCurrentTransform().inverse()).mult(view._transMat).mult(view._rotMat);view._mixer.beginTime=view._lastTS;if(arguments.length>=4&&arguments[3]!=null){view._mixer.endTime=view._lastTS+dur;}\nelse{view._mixer.endTime=view._lastTS+navi._vf.transitionTime;}\nview._mixer.setBeginMatrix(prev);view._mixer.setEndMatrix(targetMat);view._scene.getViewpoint().setViewAbsolute(prev);}\nelse if(prev){view._mixer.beginTime=view._lastTS;if(arguments.length>=4&&arguments[3]!=null){view._mixer.endTime=view._lastTS+dur;}\nelse{view._mixer.endTime=view._lastTS+navi._vf.transitionTime;}\nview._mixer.setBeginMatrix(prev);view._mixer.setEndMatrix(targetMat);view._scene.getViewpoint().setViewAbsolute(prev);}else{view._scene.getViewpoint().setViewAbsolute(targetMat);}}\nelse\n{view._scene.getViewpoint().setViewAbsolute(target);}\nview._rotMat=x3dom.fields.SFMatrix4f.identity();view._transMat=x3dom.fields.SFMatrix4f.identity();view._movement=new x3dom.fields.SFVec3f(0,0,0);view._needNavigationMatrixUpdate=true;this.updateFlyMat(view,target,targetMat);};x3dom.TurntableNavigation.prototype.onTouchStart=function(view,evt,touches)\n{view._numTouches=evt.touches.length;view._lastX=evt.touches[0].screenX;view._lastY=evt.touches[0].screenY;};x3dom.TurntableNavigation.prototype.onTouchDrag=function(view,evt,touches,translation,rotation)\n{if(view._currentInputType==x3dom.InputTypes.NAVIGATION)\n{if(evt.touches.length==1)\n{var dx=(evt.touches[0].screenX-view._lastX);var dy=(evt.touches[0].screenY-view._lastY);var alpha=(dy*2*Math.PI)/view._height;var beta=(dx*2*Math.PI)/view._width;this.rotate(view,alpha,beta);view._lastX=evt.touches[0].screenX;view._lastY=evt.touches[0].screenY;}\nelse if(evt.touches.length>=2)\n{if(this.panEnabled==true)\nthis.pan(view,-translation.x*4.0,-translation.y*4.0);this.zoom(view,translation.z*4.0);}}};x3dom.TurntableNavigation.prototype.onTouchEnd=function(view,evt,touches)\n{if(view._numTouches==2&&evt.touches.length==1){view._lastX=evt.touches[0].screenX;view._lastY=evt.touches[0].screenY;}\nview._numTouches=evt.touches.length;};x3dom.TurntableNavigation.prototype.setPanTarget=function(target)\n{this.target=target;};x3dom.TurntableNavigation.prototype.setPanAxis=function(a,b)\n{this.panAxisX=a;this.panAxisY=b;};x3dom.TurntableNavigation.prototype.setPanEnabled=function(enabled)\n{this.panEnabled=enabled;};x3dom.TurntableNavigation.prototype.onDoubleClick=function(view,x,y)\n{if(view._doc._x3dElem.hasAttribute('disableDoubleClick')&&view._doc._x3dElem.getAttribute('disableDoubleClick')==='true'){return;}\nvar navi=view._scene.getNavigationInfo();if(navi.getType()==\"none\"){return;}\nvar pickMode=view._scene._vf.pickMode.toLowerCase();if((pickMode==\"color\"||pickMode==\"texcoord\")){return;}\nvar viewpoint=view._scene.getViewpoint();viewpoint.setCenterOfRotation(view._pick);x3dom.debug.logInfo(\"New center of Rotation:  \"+view._pick);var mat=view.getViewMatrix().inverse();view._from=mat.e3();view._up=mat.e1();view._at=view._pick;view._flyMat=x3dom.fields.SFMatrix4f.lookAt(view._from,view._at,view._up);var offset=view._from.subtract(view._at);var phi=Math.atan2(offset.x,offset.z);var theta=Math.atan2(Math.sqrt(offset.x*offset.x+offset.z*offset.z),offset.y);view._flyMat=this.calcOrbit(view,theta,phi,true);x3dom.debug.logInfo(\"New camera position:  \"+view._from);this.animateTo(view,view._flyMat.inverse(),view.getViewMatrix());};x3dom.WalkNavigation=function(navigationNode)\n{x3dom.DefaultNavigation.call(this,navigationNode);};x3dom.WalkNavigation.prototype=Object.create(x3dom.DefaultNavigation.prototype);x3dom.WalkNavigation.prototype.constructor=x3dom.WalkNavigation;x3dom.WalkNavigation.prototype.onDrag=function(view,x,y,buttonState)\n{var navi=this.navi;var navType=navi.getType();var navRestrict=navi.getExplorationMode();if(navRestrict===0){return;}\nvar viewpoint=view._scene.getViewpoint();var dx=x-view._lastX;var dy=y-view._lastY;view._dx=dx;view._dy=dy;view._lastX=x;view._lastY=y;if(navType===\"walk\"){return;}\nconsole.log(\"#### CHECK: in WalkNavigation but nav. type is not walk !\");};x3dom.registerNodeType(\"X3DFontStyleNode\",\"Text\",defineClass(x3dom.nodeTypes.X3DNode,function(ctx){x3dom.nodeTypes.X3DFontStyleNode.superClass.call(this,ctx);}));x3dom.registerNodeType(\"FontStyle\",\"Text\",defineClass(x3dom.nodeTypes.X3DFontStyleNode,function(ctx){x3dom.nodeTypes.FontStyle.superClass.call(this,ctx);this.addField_MFString(ctx,'family',['SERIF']);this.addField_SFBool(ctx,'horizontal',true);this.addField_MFString(ctx,'justify',['MIDDLE','MIDDLE']);this.addField_SFString(ctx,'language',\"\");this.addField_SFBool(ctx,'leftToRight',true);this.addField_SFFloat(ctx,'size',1.0);this.addField_SFFloat(ctx,'spacing',1.0);this.addField_SFString(ctx,'style',\"PLAIN\");this.addField_SFBool(ctx,'topToBottom',true);this.addField_SFFloat(ctx,'quality',2.0);},{fieldChanged:function(fieldName){if(fieldName=='family'||fieldName=='horizontal'||fieldName=='justify'||fieldName=='language'||fieldName=='leftToRight'||fieldName=='size'||fieldName=='spacing'||fieldName=='style'||fieldName=='topToBottom'){Array.forEach(this._parentNodes,function(node){Array.forEach(node._parentNodes,function(textnode){textnode.setAllDirty();});});}}}));x3dom.nodeTypes.FontStyle.defaultNode=function(){if(!x3dom.nodeTypes.FontStyle._defaultNode){x3dom.nodeTypes.FontStyle._defaultNode=new x3dom.nodeTypes.FontStyle();x3dom.nodeTypes.FontStyle._defaultNode.nodeChanged();}\nreturn x3dom.nodeTypes.FontStyle._defaultNode;};x3dom.registerNodeType(\"Text\",\"Text\",defineClass(x3dom.nodeTypes.X3DGeometryNode,function(ctx){x3dom.nodeTypes.Text.superClass.call(this,ctx);this.addField_MFString(ctx,'string',[]);this.addField_MFFloat(ctx,'length',[]);this.addField_SFFloat(ctx,'maxExtent',0.0);this.addField_SFNode('fontStyle',x3dom.nodeTypes.X3DFontStyleNode);this._mesh._positions[0]=[0,0,0,1,0,0,1,1,0,0,1,0];this._mesh._normals[0]=[0,0,1,0,0,1,0,0,1,0,0,1];this._mesh._texCoords[0]=[0,0,1,0,1,1,0,1];this._mesh._colors[0]=[];this._mesh._indices[0]=[0,1,2,2,3,0];this._mesh._invalidate=true;this._mesh._numFaces=2;this._mesh._numCoords=4;},{nodeChanged:function(){if(!this._cf.fontStyle.node){this.addChild(x3dom.nodeTypes.FontStyle.defaultNode());}\nthis.invalidateVolume();},fieldChanged:function(fieldName){if(fieldName=='string'||fieldName=='length'||fieldName=='maxExtent'){this.invalidateVolume();Array.forEach(this._parentNodes,function(node){node.setAllDirty();});}},validateGLObject:function()\n{Array.forEach(this._parentNodes,function(node){node._dirty.texture=false;});this._nameSpace.doc.needRender=true;}}));x3dom.registerNodeType(\"X3DSoundNode\",\"Sound\",defineClass(x3dom.nodeTypes.X3DChildNode,function(ctx){x3dom.nodeTypes.X3DSoundNode.superClass.call(this,ctx);}));x3dom.registerNodeType(\"Sound\",\"Sound\",defineClass(x3dom.nodeTypes.X3DSoundNode,function(ctx){x3dom.nodeTypes.Sound.superClass.call(this,ctx);this.addField_SFNode('source',x3dom.nodeTypes.X3DSoundSourceNode);},{nodeChanged:function()\n{if(this._cf.source.node||!this._xmlNode){return;}\nx3dom.debug.logInfo(\"No AudioClip child node given, searching for &lt;audio&gt; elements...\");try{Array.forEach(this._xmlNode.childNodes,function(childDomNode){if(childDomNode.nodeType===1)\n{x3dom.debug.logInfo(\"### Found &lt;\"+childDomNode.nodeName+\"&gt; tag.\");if(childDomNode.localName.toLowerCase()===\"audio\")\n{var loop=childDomNode.getAttribute(\"loop\");loop=loop?(loop.toLowerCase()===\"loop\"):false;var newNode=childDomNode.cloneNode(false);childDomNode.parentNode.removeChild(childDomNode);childDomNode=null;if(navigator.appName!=\"Microsoft Internet Explorer\"){document.body.appendChild(newNode);}\nvar startAudio=function(){newNode.play();};var audioDone=function(){if(loop){newNode.play();}};newNode.addEventListener(\"canplaythrough\",startAudio,true);newNode.addEventListener(\"ended\",audioDone,true);}}});}\ncatch(e){x3dom.debug.logException(e);}}}));x3dom.registerNodeType(\"X3DSoundSourceNode\",\"Sound\",defineClass(x3dom.nodeTypes.X3DTimeDependentNode,function(ctx){x3dom.nodeTypes.X3DSoundSourceNode.superClass.call(this,ctx);}));x3dom.registerNodeType(\"AudioClip\",\"Sound\",defineClass(x3dom.nodeTypes.X3DSoundSourceNode,function(ctx){x3dom.nodeTypes.AudioClip.superClass.call(this,ctx);this.addField_MFString(ctx,'url',[]);this.addField_SFBool(ctx,'enabled',false);this.addField_SFBool(ctx,'loop',false);this._audio=document.createElement('audio');if(navigator.appName!=\"Microsoft Internet Explorer\"){document.body.appendChild(this._audio);}\nthis._sources=[];},{nodeChanged:function()\n{this._createSources=function()\n{this._sources=[];for(var i=0;i<this._vf.url.length;i++)\n{var audioUrl=this._nameSpace.getURL(this._vf.url[i]);x3dom.debug.logInfo('Adding sound file: '+audioUrl);var src=document.createElement('source');src.setAttribute('src',audioUrl);this._sources.push(src);this._audio.appendChild(src);}};var that=this;this._startAudio=function()\n{that._audio.loop=that._vf.loop?\"loop\":\"\";if(that._vf.enabled===true)\n{that._audio.play();}};this._stopAudio=function()\n{that._audio.pause();};this._audioEnded=function()\n{if(that._vf.enabled===true&&that._vf.loop===true)\n{that._startAudio();}};var log=function(e)\n{x3dom.debug.logWarning(\"MediaEvent error:\"+e);};this._audio.addEventListener(\"canplaythrough\",this._startAudio,true);this._audio.addEventListener(\"ended\",this._audioEnded,true);this._audio.addEventListener(\"error\",log,true);this._audio.addEventListener(\"pause\",this._audioEnded,true);this._createSources();},fieldChanged:function(fieldName)\n{if(fieldName===\"enabled\")\n{if(this._vf.enabled===true)\n{this._startAudio();}\nelse\n{this._stopAudio();}}\nelse if(fieldName===\"loop\")\n{}\nelse if(fieldName===\"url\")\n{this._stopAudio();while(this._audio.hasChildNodes())\n{this._audio.removeChild(this._audio.firstChild);}\nfor(var i=0;i<this._vf.url.length;i++)\n{var audioUrl=this._nameSpace.getURL(this._vf.url[i]);x3dom.debug.logInfo('Adding sound file: '+audioUrl);var src=document.createElement('source');src.setAttribute('src',audioUrl);this._audio.appendChild(src);}}},shutdown:function(){if(this._audio){this._audio.pause();while(this._audio.hasChildNodes()){this._audio.removeChild(this._audio.firstChild);}\ndocument.body.removeChild(this._audio);this._audio=null;}}}));x3dom.registerNodeType(\"X3DTextureTransformNode\",\"Texturing\",defineClass(x3dom.nodeTypes.X3DAppearanceChildNode,function(ctx){x3dom.nodeTypes.X3DTextureTransformNode.superClass.call(this,ctx);},{texTransformMatrix:function(){return this._trafo;}}));x3dom.registerNodeType(\"TextureTransform\",\"Texturing\",defineClass(x3dom.nodeTypes.X3DTextureTransformNode,function(ctx){x3dom.nodeTypes.TextureTransform.superClass.call(this,ctx);this.addField_SFVec2f(ctx,'center',0,0);this.addField_SFFloat(ctx,'rotation',0);this.addField_SFVec2f(ctx,'scale',1,1);this.addField_SFVec2f(ctx,'translation',0,0);this._calcTrafo();},{fieldChanged:function(fieldName){if(fieldName=='center'||fieldName=='rotation'||fieldName=='scale'||fieldName=='translation'){this._calcTrafo();}},_calcTrafo:function(){var negCenter=new x3dom.fields.SFVec3f(-this._vf.center.x,-this._vf.center.y,0);var posCenter=new x3dom.fields.SFVec3f(this._vf.center.x,this._vf.center.y,0);var trans3=new x3dom.fields.SFVec3f(this._vf.translation.x,this._vf.translation.y,0);var scale3=new x3dom.fields.SFVec3f(this._vf.scale.x,this._vf.scale.y,0);this._trafo=x3dom.fields.SFMatrix4f.translation(negCenter).mult(x3dom.fields.SFMatrix4f.scale(scale3)).mult(x3dom.fields.SFMatrix4f.rotationZ(this._vf.rotation)).mult(x3dom.fields.SFMatrix4f.translation(posCenter.add(trans3)));}}));x3dom.registerNodeType(\"MatrixTextureTransform\",\"Texturing\",defineClass(x3dom.nodeTypes.X3DTextureTransformNode,function(ctx){x3dom.nodeTypes.MatrixTextureTransform.superClass.call(this,ctx);this.addField_SFMatrix4f(ctx,'matrix',1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);this._trafo=this._vf.matrix.transpose();},{fieldChanged:function(fieldName){if(fieldName==\"matrix\"){this._trafo=this._vf.matrix.transpose();}}}));x3dom.registerNodeType(\"TextureProperties\",\"Texturing\",defineClass(x3dom.nodeTypes.X3DNode,function(ctx){x3dom.nodeTypes.TextureProperties.superClass.call(this,ctx);this.addField_SFFloat(ctx,'anisotropicDegree',1.0);this.addField_SFColorRGBA(ctx,'borderColor',0,0,0,0);this.addField_SFInt32(ctx,'borderWidth',0);this.addField_SFString(ctx,'boundaryModeS',\"REPEAT\");this.addField_SFString(ctx,'boundaryModeT',\"REPEAT\");this.addField_SFString(ctx,'boundaryModeR',\"REPEAT\");this.addField_SFString(ctx,'magnificationFilter',\"FASTEST\");this.addField_SFString(ctx,'minificationFilter',\"FASTEST\");this.addField_SFString(ctx,'textureCompression',\"FASTEST\");this.addField_SFFloat(ctx,'texturePriority',0);this.addField_SFBool(ctx,'generateMipMaps',false);},{fieldChanged:function(fieldName)\n{if(this._vf.hasOwnProperty(fieldName)){Array.forEach(this._parentNodes,function(texture){Array.forEach(texture._parentNodes,function(app){Array.forEach(app._parentNodes,function(shape){shape._dirty.texture=true;});});});this._nameSpace.doc.needRender=true;}}}));x3dom.registerNodeType(\"X3DTextureNode\",\"Texturing\",defineClass(x3dom.nodeTypes.X3DAppearanceChildNode,function(ctx){x3dom.nodeTypes.X3DTextureNode.superClass.call(this,ctx);this.addField_SFInt32(ctx,'origChannelCount',0);this.addField_MFString(ctx,'url',[]);this.addField_SFBool(ctx,'repeatS',true);this.addField_SFBool(ctx,'repeatT',true);this.addField_SFBool(ctx,'scale',true);this.addField_SFString(ctx,'crossOrigin','');this.addField_SFNode('textureProperties',x3dom.nodeTypes.TextureProperties);this.addField_SFBool(ctx,'flipY',false);this.addField_SFInt32(ctx,'channel',0);this._needPerFrameUpdate=false;this._isCanvas=false;this._type=\"diffuseMap\";this._blending=(this._vf.origChannelCount==1||this._vf.origChannelCount==2);},{invalidateGLObject:function()\n{Array.forEach(this._parentNodes,function(app){Array.forEach(app._parentNodes,function(shape){if(x3dom.isa(shape,x3dom.nodeTypes.X3DShapeNode)){shape._dirty.texture=true;}\nelse{Array.forEach(shape._parentNodes,function(realShape){if(x3dom.isa(realShape,x3dom.nodeTypes.X3DShapeNode)){realShape._dirty.texture=true;}else{Array.forEach(realShape._parentNodes,function(realShape2){if(x3dom.isa(realShape2,x3dom.nodeTypes.X3DShapeNode)){realShape2._dirty.texture=true;}});}});}});});this._nameSpace.doc.needRender=true;},validateGLObject:function()\n{Array.forEach(this._parentNodes,function(app){Array.forEach(app._parentNodes,function(shape){if(x3dom.isa(shape,x3dom.nodeTypes.X3DShapeNode)){shape._dirty.texture=false;}\nelse{Array.forEach(shape._parentNodes,function(realShape){if(x3dom.isa(realShape,x3dom.nodeTypes.X3DShapeNode)){realShape._dirty.texture=false;}else{Array.forEach(realShape._parentNodes,function(realShape2){if(x3dom.isa(realShape2,x3dom.nodeTypes.X3DShapeNode)){realShape2._dirty.texture=false;}});}});}});});this._nameSpace.doc.needRender=true;},parentAdded:function(parent)\n{Array.forEach(parent._parentNodes,function(shape){if(x3dom.isa(shape,x3dom.nodeTypes.Shape)){shape._dirty.texture=true;}\nelse{Array.forEach(shape._parentNodes,function(realShape){realShape._dirty.texture=true;});}});},parentRemoved:function(parent)\n{Array.forEach(parent._parentNodes,function(shape){if(x3dom.isa(shape,x3dom.nodeTypes.X3DShapeNode)){shape._dirty.texture=true;}\nelse{Array.forEach(shape._parentNodes,function(realShape){realShape._dirty.texture=true;});}});},fieldChanged:function(fieldName)\n{if(fieldName==\"url\"||fieldName==\"origChannelCount\"||fieldName==\"repeatS\"||fieldName==\"repeatT\"||fieldName==\"scale\"||fieldName==\"crossOrigin\")\n{var that=this;Array.forEach(this._parentNodes,function(app){if(x3dom.isa(app,x3dom.nodeTypes.X3DAppearanceNode)){app.nodeChanged();Array.forEach(app._parentNodes,function(shape){shape._dirty.texture=true;});}\nelse if(x3dom.isa(app,x3dom.nodeTypes.MultiTexture)){Array.forEach(app._parentNodes,function(realApp){realApp.nodeChanged();Array.forEach(realApp._parentNodes,function(shape){shape._dirty.texture=true;});});}\nelse if(x3dom.isa(app,x3dom.nodeTypes.ComposedCubeMapTexture)){Array.forEach(app._parentNodes,function(realApp){realApp.nodeChanged();Array.forEach(realApp._parentNodes,function(shape){shape._dirty.texture=true;});});}\nelse if(x3dom.isa(app,x3dom.nodeTypes.PhysicalMaterial)){Array.forEach(app._parentNodes,function(realApp){realApp.nodeChanged();Array.forEach(realApp._parentNodes,function(shape){shape._dirty.texture=true;});});}\nelse if(x3dom.isa(app,x3dom.nodeTypes.ImageGeometry)){var cf=null;if(that._xmlNode&&that._xmlNode.hasAttribute('containerField')){cf=that._xmlNode.getAttribute('containerField');app._dirty[cf]=true;}}\nelse if(x3dom.nodeTypes.X3DVolumeDataNode!==undefined){if(x3dom.isa(app,x3dom.nodeTypes.X3DVolumeRenderStyleNode)){if(that._xmlNode&&that._xmlNode.hasAttribute('containerField')){if(app._volumeDataParent){app._volumeDataParent._dirty.texture=true;}else{var volumeDataParent=app._parentNodes[0];while(!x3dom.isa(volumeDataParent,x3dom.nodeTypes.X3DVolumeDataNode)&&x3dom.isa(volumeDataParent,x3dom.nodeTypes.X3DNode)){volumeDataParent=volumeDataParent._parentNodes[0];}\nif(x3dom.isa(volumeDataParent,x3dom.nodeTypes.X3DNode)){volumeDataParent._dirty.texture=true;}}}}else if(x3dom.isa(app,x3dom.nodeTypes.X3DVolumeDataNode)){if(that._xmlNode&&that._xmlNode.hasAttribute('containerField')){app._dirty.texture=true;}}}});}},getTexture:function(pos){if(pos===0){return this;}\nreturn null;},size:function(){return 1;}}));x3dom.registerNodeType(\"MultiTexture\",\"Texturing\",defineClass(x3dom.nodeTypes.X3DTextureNode,function(ctx){x3dom.nodeTypes.MultiTexture.superClass.call(this,ctx);this.addField_MFNode('texture',x3dom.nodeTypes.X3DTextureNode);},{getTexture:function(pos){if(pos>=0&&pos<this._cf.texture.nodes.length){return this._cf.texture.nodes[pos];}\nreturn null;},getTextures:function(){return this._cf.texture.nodes;},size:function(){return this._cf.texture.nodes.length;}}));x3dom.registerNodeType(\"Texture\",\"Texturing\",defineClass(x3dom.nodeTypes.X3DTextureNode,function(ctx){x3dom.nodeTypes.Texture.superClass.call(this,ctx);this.addField_SFBool(ctx,'hideChildren',true);this._video=null;this._intervalID=0;this._canvas=null;},{nodeChanged:function()\n{if((this._vf.url.length&&this._vf.url[0].length)||!this._xmlNode){return;}\nx3dom.debug.logInfo(\"No Texture URL given, searching for &lt;img&gt; elements...\");var that=this;try{Array.forEach(this._xmlNode.childNodes,function(childDomNode){if(childDomNode.nodeType===1){var url=childDomNode.getAttribute(\"src\");if(url){that._vf.url.push(url);x3dom.debug.logInfo(that._vf.url[that._vf.url.length-1]);if(childDomNode.localName.toLowerCase()===\"video\"){that._needPerFrameUpdate=true;that._video=document.createElement('video');that._video.setAttribute('preload','auto');that._video.setAttribute('muted','muted');var p=document.getElementsByTagName('body')[0];p.appendChild(that._video);that._video.style.display=\"none\";that._video.style.visibility=\"hidden\";}}\nelse if(childDomNode.localName.toLowerCase()===\"canvas\"){that._needPerFrameUpdate=true;that._isCanvas=true;that._canvas=childDomNode;}\nif(childDomNode.style&&that._vf.hideChildren){childDomNode.style.display=\"none\";childDomNode.style.visibility=\"hidden\";}\nx3dom.debug.logInfo(\"### Found &lt;\"+childDomNode.nodeName+\"&gt; tag.\");}});}\ncatch(e){x3dom.debug.logException(e);}},shutdown:function(){if(this._video){this._video.pause();while(this._video.hasChildNodes()){this._video.removeChild(this._video.firstChild);}\ndocument.body.removeChild(this._video);this._video=null;}}}));x3dom.registerNodeType(\"RenderedTexture\",\"Texturing\",defineClass(x3dom.nodeTypes.X3DTextureNode,function(ctx){x3dom.nodeTypes.RenderedTexture.superClass.call(this,ctx);if(ctx)\nctx.doc._nodeBag.renderTextures.push(this);else\nx3dom.debug.logWarning(\"RenderedTexture: No runtime context found!\");this.addField_SFNode('viewpoint',x3dom.nodeTypes.X3DViewpointNode);this.addField_SFNode('background',x3dom.nodeTypes.X3DBackgroundNode);this.addField_SFNode('fog',x3dom.nodeTypes.X3DFogNode);this.addField_SFNode('scene',x3dom.nodeTypes.X3DNode);this.addField_MFNode('excludeNodes',x3dom.nodeTypes.X3DNode);this.addField_MFInt32(ctx,'dimensions',[128,128,4]);this.addField_SFString(ctx,'update','NONE');this.addField_SFBool(ctx,'showNormals',false);this.addField_SFString(ctx,'stereoMode','NONE');this.addField_SFFloat(ctx,'interpupillaryDistance',0.064);this.addField_SFFloat(ctx,'eyeToScreenDistance',0.041);this.addField_SFFloat(ctx,'vScreenSize',0.07074);this.addField_SFVec3f(ctx,'lensCenter',0.15197,0,0);this.addField_SFBool(ctx,'depthMap',false);this.addField_SFBool(ctx,'oculusRiftVersion',1);x3dom.debug.assert(this._vf.dimensions.length>=3,\"RenderedTexture.dimensions requires at least 3 entries.\");this._clearParents=true;this._needRenderUpdate=true;this.checkDepthTextureSupport=function(){if(this._vf.depthMap&&x3dom.caps.DEPTH_TEXTURE===null)\nx3dom.debug.logWarning(\"RenderedTexture Node: depth texture extension not supported\");};this.checkDepthTextureSupport();},{nodeChanged:function()\n{this._clearParents=true;this._needRenderUpdate=true;},fieldChanged:function(fieldName)\n{switch(fieldName)\n{case\"excludeNodes\":this._clearParents=true;break;case\"update\":if(this._vf.update.toUpperCase()==\"NEXT_FRAME_ONLY\"||this._vf.update.toUpperCase()==\"ALWAYS\"){this._needRenderUpdate=true;}\nbreak;case\"depthMap\":this.checkDepthTextureSupport();this._x3domTexture.updateTexture();this._needRenderUpdate=true;default:break;}},getViewMatrix:function()\n{if(this._clearParents&&this._cf.excludeNodes.nodes.length){var that=this;Array.forEach(this._cf.excludeNodes.nodes,function(node){for(var i=0,n=node._parentNodes.length;i<n;i++){if(node._parentNodes[i]===that){node._parentNodes.splice(i,1);node.parentRemoved(that);}}});this._clearParents=false;}\nvar locScene=this._cf.scene.node;var scene=this._nameSpace.doc._scene;var vbP=scene.getViewpoint();var view=this._cf.viewpoint.node;var ret_mat=null;if(view===null||view===vbP){ret_mat=this._nameSpace.doc._viewarea.getViewMatrix();}\nelse if(locScene&&locScene!==scene){ret_mat=view.getViewMatrix();}\nelse{var mat_viewpoint=view.getCurrentTransform();ret_mat=view.getViewMatrix().mult(mat_viewpoint.inverse());}\nvar stereoMode=this._vf.stereoMode.toUpperCase();if(stereoMode!=\"NONE\"){var d=this._vf.interpupillaryDistance/2;if(stereoMode==\"RIGHT_EYE\"){d=-d;}\nvar modifier=new x3dom.fields.SFMatrix4f(1,0,0,d,0,1,0,0,0,0,1,0,0,0,0,1);ret_mat=modifier.mult(ret_mat);}\nreturn ret_mat;},getProjectionMatrix:function()\n{var doc=this._nameSpace.doc;var vbP=doc._scene.getViewpoint();var view=this._cf.viewpoint.node;var ret_mat=null;var f,w=this._vf.dimensions[0],h=this._vf.dimensions[1];var stereoMode=this._vf.stereoMode.toUpperCase();var stereo=(stereoMode!=\"NONE\");if(view===null||view===vbP){ret_mat=x3dom.fields.SFMatrix4f.copy(doc._viewarea.getProjectionMatrix());if(stereo){f=2*Math.atan(this._vf.vScreenSize/(2*this._vf.eyeToScreenDistance));f=1/Math.tan(f/2);}\nelse{f=1/Math.tan(vbP._vf.fieldOfView/2);}\nret_mat._00=f/(w/h);ret_mat._11=f;}\nelse{ret_mat=view.getProjectionMatrix(w/h);}\nif(stereo){var lensCenter=this._vf.lensCenter.copy();if(stereoMode==\"RIGHT_EYE\"){lensCenter.x=-lensCenter.x;}\nvar modifier=new x3dom.fields.SFMatrix4f(1,0,0,lensCenter.x,0,1,0,lensCenter.y,0,0,1,lensCenter.z,0,0,0,1);ret_mat=modifier.mult(ret_mat);}\nreturn ret_mat;},getWCtoCCMatrix:function()\n{var view=this.getViewMatrix();var proj=this.getProjectionMatrix();return proj.mult(view);},parentRemoved:function(parent)\n{if(this._parentNodes.length===0){var doc=this.findX3DDoc();for(var i=0,n=doc._nodeBag.renderTextures.length;i<n;i++){if(doc._nodeBag.renderTextures[i]===this){doc._nodeBag.renderTextures.splice(i,1);}}}\nif(this._cf.scene.node){this._cf.scene.node.parentRemoved(this);}},requirePingPong:function()\n{return false;}}));x3dom.registerNodeType(\"RefinementTexture\",\"Texturing\",defineClass(x3dom.nodeTypes.RenderedTexture,function(ctx){x3dom.nodeTypes.RefinementTexture.superClass.call(this,ctx);this.addField_SFString(ctx,'stamp0',\"gpuii/stamps/0.gif\");this.addField_SFString(ctx,'stamp1',\"gpuii/stamps/1.gif\");this.addField_SFBool(ctx,'autoRefinement',true);this.addField_SFString(ctx,'format','jpg');this.addField_SFInt32(ctx,'iterations',7);this.addField_SFInt32(ctx,'maxLevel',this._vf.iterations);if(this._vf.iterations%2===0){var temp=this._vf.stamp0;this._vf.stamp0=this._vf.stamp1;this._vf.stamp1=temp;}\nthis._vf.iterations=(this._vf.iterations>11)?11:this._vf.iterations;this._vf.iterations=(this._vf.iterations<3)?3:this._vf.iterations;this._vf.maxLevel=(this._vf.maxLevel>11)?11:this._vf.maxLevel;this._vf.maxLevel=(this._vf.maxLevel<3)?3:this._vf.maxLevel;this._vf.maxLevel=(this._vf.maxLevel>this._vf.iterations)?this._vf.iterations:this._vf.maxLevel;var repeatConfig=[{x:4,y:8},{x:8,y:8},{x:8,y:16},{x:16,y:16},{x:16,y:32},{x:32,y:32},{x:32,y:64},{x:64,y:64},{x:64,y:128}];this._repeat=new x3dom.fields.SFVec2f(this._vf.dimensions[0]/repeatConfig[this._vf.iterations-3].x,this._vf.dimensions[1]/repeatConfig[this._vf.iterations-3].y);this._renderedImage=0;this._currLoadLevel=0;this._loadLevel=1;},{nextLevel:function(){if(this._loadLevel<this._vf.maxLevel){this._loadLevel++;this._nameSpace.doc.needRender=true;}},requirePingPong:function(){return(this._currLoadLevel<=this._vf.maxLevel&&this._renderedImage<this._loadLevel);}}));x3dom.registerNodeType(\"PixelTexture\",\"Texturing\",defineClass(x3dom.nodeTypes.X3DTextureNode,function(ctx){x3dom.nodeTypes.PixelTexture.superClass.call(this,ctx);this.addField_SFImage(ctx,'image',0,0,0);},{fieldChanged:function(fieldName)\n{if(fieldName==\"image\"){this.invalidateGLObject();}},getWidth:function(){return this._vf.image.width;},getHeight:function(){return this._vf.image.height;},getComponents:function(){return this._vf.image.comp;},setPixel:function(x,y,color,update){update=(update==undefined)?true:update;if(this._x3domTexture){this._x3domTexture.setPixel(x,y,[color.r*255,color.g*255,color.b*255,color.a*255],update);this._vf.image.setPixel(x,y,color);}\nelse\n{this._vf.image.setPixel(x,y,color);if(update){this.invalidateGLObject();}}},getPixel:function(x,y){return this._vf.image.getPixel(x,y);},setPixels:function(pixels,update){update=(update==undefined)?true:update;this._vf.image.setPixels(pixels);if(update){this.invalidateGLObject();}},getPixels:function(){return this._vf.image.getPixels();}}));x3dom.registerNodeType(\"ImageTexture\",\"Texturing\",defineClass(x3dom.nodeTypes.Texture,function(ctx){x3dom.nodeTypes.ImageTexture.superClass.call(this,ctx);}));x3dom.registerNodeType(\"MovieTexture\",\"Texturing\",defineClass(x3dom.nodeTypes.Texture,function(ctx){x3dom.nodeTypes.MovieTexture.superClass.call(this,ctx);this.addField_SFBool(ctx,'loop',false);this.addField_SFFloat(ctx,'speed',1.0);this.addField_SFTime(ctx,'pauseTime',0);this.addField_SFFloat(ctx,'pitch',1.0);this.addField_SFTime(ctx,'resumeTime',0);this.addField_SFTime(ctx,'startTime',0);this.addField_SFTime(ctx,'stopTime',0);}));x3dom.registerNodeType(\"X3DTextureCoordinateNode\",\"Texturing\",defineClass(x3dom.nodeTypes.X3DGeometricPropertyNode,function(ctx){x3dom.nodeTypes.X3DTextureCoordinateNode.superClass.call(this,ctx);},{fieldChanged:function(fieldName){if(fieldName===\"texCoord\"||fieldName===\"point\"||fieldName===\"parameter\"||fieldName===\"mode\")\n{Array.forEach(this._parentNodes,function(node){node.fieldChanged(\"texCoord\");});}},parentAdded:function(parent){if(parent._mesh&&parent._cf.texCoord.node!==this){parent.fieldChanged(\"texCoord\");}}}));x3dom.registerNodeType(\"TextureCoordinate\",\"Texturing\",defineClass(x3dom.nodeTypes.X3DTextureCoordinateNode,function(ctx){x3dom.nodeTypes.TextureCoordinate.superClass.call(this,ctx);this.addField_MFVec2f(ctx,'point',[]);}));x3dom.registerNodeType(\"TextureCoordinateGenerator\",\"Texturing\",defineClass(x3dom.nodeTypes.X3DTextureCoordinateNode,function(ctx){x3dom.nodeTypes.TextureCoordinateGenerator.superClass.call(this,ctx);this.addField_SFString(ctx,'mode',\"SPHERE\");this.addField_MFFloat(ctx,'parameter',[]);}));x3dom.registerNodeType(\"MultiTextureCoordinate\",\"Texturing\",defineClass(x3dom.nodeTypes.X3DTextureCoordinateNode,function(ctx){x3dom.nodeTypes.MultiTextureCoordinate.superClass.call(this,ctx);this.addField_MFNode('texCoord',x3dom.nodeTypes.X3DTextureCoordinateNode);}));x3dom.registerNodeType(\"ImageTextureAtlas\",\"Texturing\",defineClass(x3dom.nodeTypes.Texture,function(ctx){x3dom.nodeTypes.ImageTextureAtlas.superClass.call(this,ctx);this.addField_SFInt32(ctx,'numberOfSlices',0);this.addField_SFInt32(ctx,'slicesOverX',0);this.addField_SFInt32(ctx,'slicesOverY',0);}));x3dom.registerNodeType(\"X3DEnvironmentTextureNode\",\"CubeMapTexturing\",defineClass(x3dom.nodeTypes.X3DTextureNode,function(ctx){x3dom.nodeTypes.X3DEnvironmentTextureNode.superClass.call(this,ctx);},{getTexUrl:function(){return[];},getTexSize:function(){return-1;}}));x3dom.registerNodeType(\"ComposedCubeMapTexture\",\"CubeMapTexturing\",defineClass(x3dom.nodeTypes.X3DEnvironmentTextureNode,function(ctx){x3dom.nodeTypes.ComposedCubeMapTexture.superClass.call(this,ctx);this.addField_SFNode('back',x3dom.nodeTypes.Texture);this.addField_SFNode('front',x3dom.nodeTypes.Texture);this.addField_SFNode('bottom',x3dom.nodeTypes.Texture);this.addField_SFNode('top',x3dom.nodeTypes.Texture);this.addField_SFNode('left',x3dom.nodeTypes.Texture);this.addField_SFNode('right',x3dom.nodeTypes.Texture);this._type=\"environmentMap\";},{getTexUrl:function(){return[this._nameSpace.getURL(this._cf.back.node._vf.url[0]),this._nameSpace.getURL(this._cf.front.node._vf.url[0]),this._nameSpace.getURL(this._cf.bottom.node._vf.url[0]),this._nameSpace.getURL(this._cf.top.node._vf.url[0]),this._nameSpace.getURL(this._cf.left.node._vf.url[0]),this._nameSpace.getURL(this._cf.right.node._vf.url[0])];}}));x3dom.registerNodeType(\"GeneratedCubeMapTexture\",\"CubeMapTexturing\",defineClass(x3dom.nodeTypes.X3DEnvironmentTextureNode,function(ctx){x3dom.nodeTypes.GeneratedCubeMapTexture.superClass.call(this,ctx);this.addField_SFInt32(ctx,'size',128);this.addField_SFString(ctx,'update','NONE');this._type=\"cubeMap\";x3dom.debug.logWarning(\"GeneratedCubeMapTexture NYI\");},{getTexSize:function(){return this._vf.size;}}));x3dom.registerNodeType(\"Uniform\",\"Shaders\",defineClass(x3dom.nodeTypes.Field,function(ctx){x3dom.nodeTypes.Uniform.superClass.call(this,ctx);}));x3dom.registerNodeType(\"SurfaceShaderTexture\",\"Shaders\",defineClass(x3dom.nodeTypes.X3DTextureNode,function(ctx){x3dom.nodeTypes.SurfaceShaderTexture.superClass.call(this,ctx);this.addField_SFInt32(ctx,'textureCoordinatesId',0);this.addField_SFString(ctx,'channelMask',\"DEFAULT\");this.addField_SFBool(ctx,'isSRGB',false);this.addField_SFNode('texture',x3dom.nodeTypes.X3DTextureNode);this.addField_SFNode('textureTransform',x3dom.nodeTypes.X3DTextureTransformNode);}));x3dom.registerNodeType(\"X3DShaderNode\",\"Shaders\",defineClass(x3dom.nodeTypes.X3DAppearanceChildNode,function(ctx){x3dom.nodeTypes.X3DShaderNode.superClass.call(this,ctx);this.addField_SFString(ctx,'language',\"\");}));x3dom.registerNodeType(\"CommonSurfaceShader\",\"Shaders\",defineClass(x3dom.nodeTypes.X3DShaderNode,function(ctx){x3dom.nodeTypes.CommonSurfaceShader.superClass.call(this,ctx);this.addField_SFInt32(ctx,'tangentTextureCoordinatesId',-1);this.addField_SFInt32(ctx,'binormalTextureCoordinatesId',-1);this.addField_SFVec3f(ctx,'emissiveFactor',0,0,0);this.addField_SFInt32(ctx,'emissiveTextureId',-1);this.addField_SFInt32(ctx,'emissiveTextureCoordinatesId',0);this.addField_SFString(ctx,'emissiveTextureChannelMask','rgb');this.addField_SFVec3f(ctx,'ambientFactor',0.2,0.2,0.2);this.addField_SFInt32(ctx,'ambientTextureId',-1);this.addField_SFInt32(ctx,'ambientTextureCoordinatesId',0);this.addField_SFString(ctx,'ambientTextureChannelMask','rgb');this.addField_SFVec3f(ctx,'diffuseFactor',0.8,0.8,0.8);this.addField_SFInt32(ctx,'diffuseTextureId',-1);this.addField_SFInt32(ctx,'diffuseTextureCoordinatesId',0);this.addField_SFString(ctx,'diffuseTextureChannelMask','rgb');this.addField_SFVec3f(ctx,'specularFactor',0,0,0);this.addField_SFInt32(ctx,'specularTextureId',-1);this.addField_SFInt32(ctx,'specularTextureCoordinatesId',0);this.addField_SFString(ctx,'specularTextureChannelMask','rgb');this.addField_SFFloat(ctx,'shininessFactor',0.2);this.addField_SFInt32(ctx,'shininessTextureId',-1);this.addField_SFInt32(ctx,'shininessTextureCoordinatesId',0);this.addField_SFString(ctx,'shininessTextureChannelMask','a');this.addField_SFString(ctx,'normalFormat','UNORM');this.addField_SFString(ctx,'normalSpace','TANGENT');this.addField_SFInt32(ctx,'normalTextureId',-1);this.addField_SFInt32(ctx,'normalTextureCoordinatesId',0);this.addField_SFString(ctx,'normalTextureChannelMask','rgb');this.addField_SFVec3f(ctx,'reflectionFactor',0,0,0);this.addField_SFInt32(ctx,'reflectionTextureId',-1);this.addField_SFInt32(ctx,'reflectionTextureCoordinatesId',0);this.addField_SFString(ctx,'reflectionTextureChannelMask','rgb');this.addField_SFVec3f(ctx,'transmissionFactor',0,0,0);this.addField_SFInt32(ctx,'transmissionTextureId',-1);this.addField_SFInt32(ctx,'transmissionTextureCoordinatesId',0);this.addField_SFString(ctx,'transmissionTextureChannelMask','rgb');this.addField_SFVec3f(ctx,'environmentFactor',1,1,1);this.addField_SFInt32(ctx,'environmentTextureId',-1);this.addField_SFInt32(ctx,'environmentTextureCoordinatesId',0);this.addField_SFString(ctx,'environmentTextureChannelMask','rgb');this.addField_SFFloat(ctx,'relativeIndexOfRefraction',1);this.addField_SFFloat(ctx,'fresnelBlend',0);this.addField_SFString(ctx,'displacementAxis','y');this.addField_SFFloat(ctx,'displacementFactor',255.0);this.addField_SFInt32(ctx,'displacementTextureId',-1);this.addField_SFInt32(ctx,'displacementTextureCoordinatesId',0);this.addField_SFNode('emissiveTexture',x3dom.nodeTypes.X3DTextureNode);this.addField_SFNode('ambientTexture',x3dom.nodeTypes.X3DTextureNode);this.addField_SFNode('diffuseTexture',x3dom.nodeTypes.X3DTextureNode);this.addField_SFNode('specularTexture',x3dom.nodeTypes.X3DTextureNode);this.addField_SFNode('shininessTexture',x3dom.nodeTypes.X3DTextureNode);this.addField_SFNode('normalTexture',x3dom.nodeTypes.X3DTextureNode);this.addField_SFNode('reflectionTexture',x3dom.nodeTypes.X3DTextureNode);this.addField_SFNode('transmissionTexture',x3dom.nodeTypes.X3DTextureNode);this.addField_SFNode('environmentTexture',x3dom.nodeTypes.X3DTextureNode);this.addField_SFNode('displacementTexture',x3dom.nodeTypes.X3DTextureNode);this.addField_SFNode('diffuseDisplacementTexture',x3dom.nodeTypes.X3DTextureNode);this.addField_SFNode('multiDiffuseAlphaTexture',x3dom.nodeTypes.X3DTextureNode);this.addField_SFNode('multiSpecularShininessTexture',x3dom.nodeTypes.X3DTextureNode);this.addField_SFNode('multiEmissiveAmbientTexture',x3dom.nodeTypes.X3DTextureNode);this.addField_SFNode('multiVisibilityTexture',x3dom.nodeTypes.X3DTextureNode);this.addField_SFVec3f(ctx,'normalScale',2,2,2);this.addField_SFVec3f(ctx,'normalBias',-1,-1,1);this.addField_SFFloat(ctx,'alphaFactor',1);this.addField_SFBool(ctx,'invertAlphaTexture',false);this.addField_SFInt32(ctx,'alphaTextureId',-1);this.addField_SFInt32(ctx,'alphaTextureCoordinatesId',0);this.addField_SFString(ctx,'alphaTextureChannelMask','a');this.addField_SFNode('alphaTexture',x3dom.nodeTypes.X3DTextureNode);this._dirty={};},{getDiffuseMap:function()\n{if(this._cf.diffuseTexture.node){if(x3dom.isa(this._cf.diffuseTexture.node,x3dom.nodeTypes.SurfaceShaderTexture)){this._cf.diffuseTexture.node._cf.texture.node._type=\"diffuseMap\";return this._cf.diffuseTexture.node._cf.texture.node;}else{this._cf.diffuseTexture.node._type=\"diffuseMap\";return this._cf.diffuseTexture.node;}}else{return null;}},getEnvironmentMap:function()\n{if(this._cf.environmentTexture.node){if(x3dom.isa(this._cf.environmentTexture.node,x3dom.nodeTypes.SurfaceShaderTexture)){this._cf.environmentTexture.node._cf.texture.node._type=\"environmentMap\";return this._cf.environmentTexture.node._cf.texture.node;}else{this._cf.environmentTexture.node._type=\"environmentMap\";return this._cf.environmentTexture.node;}}else{return null;}},getNormalMap:function()\n{if(this._cf.normalTexture.node){if(x3dom.isa(this._cf.normalTexture.node,x3dom.nodeTypes.SurfaceShaderTexture)){this._cf.normalTexture.node._cf.texture.node._type=\"normalMap\";return this._cf.normalTexture.node._cf.texture.node;}else{this._cf.normalTexture.node._type=\"normalMap\";return this._cf.normalTexture.node;}}else{return null;}},getAmbientMap:function()\n{if(this._cf.ambientTexture.node){if(x3dom.isa(this._cf.ambientTexture.node,x3dom.nodeTypes.SurfaceShaderTexture)){this._cf.ambientTexture.node._cf.texture.node._type=\"ambientMap\";return this._cf.ambientTexture.node._cf.texture.node;}else{this._cf.ambientTexture.node._type=\"ambientMap\";return this._cf.ambientTexture.node;}}else{return null;}},getSpecularMap:function()\n{if(this._cf.specularTexture.node){if(x3dom.isa(this._cf.specularTexture.node,x3dom.nodeTypes.SurfaceShaderTexture)){this._cf.specularTexture.node._cf.texture.node._type=\"specularMap\";return this._cf.specularTexture.node._cf.texture.node;}else{this._cf.specularTexture.node._type=\"specularMap\";return this._cf.specularTexture.node;}}else{return null;}},getShininessMap:function()\n{if(this._cf.shininessTexture.node){if(x3dom.isa(this._cf.shininessTexture.node,x3dom.nodeTypes.SurfaceShaderTexture)){this._cf.shininessTexture.node._cf.texture.node._type=\"shininessMap\";return this._cf.shininessTexture.node._cf.texture.node;}else{this._cf.shininessTexture.node._type=\"shininessMap\";return this._cf.shininessTexture.node;}}else{return null;}},getAlphaMap:function()\n{if(this._cf.alphaTexture.node){if(x3dom.isa(this._cf.alphaTexture.node,x3dom.nodeTypes.SurfaceShaderTexture)){this._cf.alphaTexture.node._cf.texture.node._type=\"alphaMap\";return this._cf.alphaTexture.node._cf.texture.node;}else{this._cf.alphaTexture.node._type=\"alphaMap\";return this._cf.alphaTexture.node;}}else{return null;}},getDisplacementMap:function()\n{if(this._cf.displacementTexture.node){if(x3dom.isa(this._cf.displacementTexture.node,x3dom.nodeTypes.SurfaceShaderTexture)){this._cf.displacementTexture.node._cf.texture.node._type=\"displacementMap\";return this._cf.displacementTexture.node._cf.texture.node;}else{this._cf.displacementTexture.node._type=\"displacementMap\";return this._cf.displacementTexture.node;}}else{return null;}},getDiffuseDisplacementMap:function()\n{if(this._cf.diffuseDisplacementTexture.node){if(x3dom.isa(this._cf.diffuseDisplacementTexture.node,x3dom.nodeTypes.SurfaceShaderTexture)){this._cf.diffuseDisplacementTexture.node._cf.texture.node._type=\"diffuseDisplacementMap\";return this._cf.diffuseDisplacementTexture.node._cf.texture.node;}else{this._cf.diffuseDisplacementTexture.node._type=\"diffuseDisplacementMap\";return this._cf.diffuseDisplacementTexture.node;}}else{return null;}},getMultiDiffuseAlphaMap:function()\n{if(this._cf.multiDiffuseAlphaTexture.node){if(x3dom.isa(this._cf.multiDiffuseAlphaTexture.node,x3dom.nodeTypes.SurfaceShaderTexture)){this._cf.multiDiffuseAlphaTexture.node._cf.texture.node._type=\"multiDiffuseAlphaMap\";return this._cf.multiDiffuseAlphaTexture.node._cf.texture.node;}else{this._cf.multiDiffuseAlphaTexture.node._type=\"multiDiffuseAlphaMap\";return this._cf.multiDiffuseAlphaTexture.node;}}else{return null;}},getMultiEmissiveAmbientMap:function()\n{if(this._cf.multiEmissiveAmbientTexture.node){if(x3dom.isa(this._cf.multiEmissiveAmbientTexture.node,x3dom.nodeTypes.SurfaceShaderTexture)){this._cf.multiEmissiveAmbientTexture.node._cf.texture.node._type=\"multiEmissiveAmbientMap\";return this._cf.multiEmissiveAmbientTexture.node._cf.texture.node;}else{this._cf.multiEmissiveAmbientTexture.node._type=\"multiEmissiveAmbientMap\";return this._cf.multiEmissiveAmbientTexture.node;}}else{return null;}},getMultiSpecularShininessMap:function()\n{if(this._cf.multiSpecularShininessTexture.node){if(x3dom.isa(this._cf.multiSpecularShininessTexture.node,x3dom.nodeTypes.SurfaceShaderTexture)){this._cf.multiSpecularShininessTexture.node._cf.texture.node._type=\"multiSpecularShininessMap\";return this._cf.multiSpecularShininessTexture.node._cf.texture.node;}else{this._cf.multiSpecularShininessTexture.node._type=\"multiSpecularShininessMap\";return this._cf.multiSpecularShininessTexture.node;}}else{return null;}},getMultiVisibilityMap:function()\n{if(this._cf.multiVisibilityTexture.node){if(x3dom.isa(this._cf.multiVisibilityTexture.node,x3dom.nodeTypes.SurfaceShaderTexture)){this._cf.multiVisibilityTexture.node._cf.texture.node._type=\"multiVisibilityMap\";return this._cf.multiVisibilityTexture.node._cf.texture.node;}else{this._cf.multiVisibilityTexture.node._type=\"multiVisibilityMap\";return this._cf.multiVisibilityTexture.node;}}else{return null;}},getTextures:function()\n{var textures=[];var diff=this.getDiffuseMap();if(diff)textures.push(diff);var norm=this.getNormalMap();if(norm)textures.push(norm);var spec=this.getSpecularMap();if(spec)textures.push(spec);var shin=this.getShininessMap();if(shin)textures.push(shin);var env=this.getEnvironmentMap();if(env)textures.push(env);var displacement=this.getDisplacementMap();if(displacement)textures.push(displacement);var diffuseDisplacement=this.getDiffuseDisplacementMap();if(diffuseDisplacement)textures.push(diffuseDisplacement);var multiDiffuseAlpha=this.getMultiDiffuseAlphaMap();if(multiDiffuseAlpha)textures.push(multiDiffuseAlpha);var multiEmissiveAmbient=this.getMultiEmissiveAmbientMap();if(multiEmissiveAmbient)textures.push(multiEmissiveAmbient);var multiSpecularShininess=this.getMultiSpecularShininessMap();if(multiSpecularShininess)textures.push(multiSpecularShininess);var multiVisibility=this.getMultiVisibilityMap();if(multiVisibility)textures.push(multiVisibility);return textures;},needTexcoords:function()\n{return(this.getDiffuseMap()||this.getNormalMap()||this.getSpecularMap()||this.getShininessMap()||this.getDisplacementMap()||this.getDiffuseDisplacementMap()||this.getEnvironmentMap())?true:false;}}));x3dom.registerNodeType(\"ComposedShader\",\"Shaders\",defineClass(x3dom.nodeTypes.X3DShaderNode,function(ctx){x3dom.nodeTypes.ComposedShader.superClass.call(this,ctx);this.addField_MFNode('fields',x3dom.nodeTypes.Field);this.addField_MFNode('parts',x3dom.nodeTypes.ShaderPart);this._vertex=null;this._fragment=null;this._id=null;if(!x3dom.nodeTypes.ComposedShader.ShaderInfoMsgShown){x3dom.debug.logInfo(\"Current ComposedShader node implementation limitations:\\n\"+\"Vertex attributes (if given in the standard X3D fields 'coord', 'color', \"+\"'normal', 'texCoord'), matrices and texture are provided as follows...\\n\"+\"(see also <a href='http://x3dom.org/x3dom/doc/help/composedShader.html'>\"+\"http://x3dom.org/x3dom/doc/help/composedShader.html</a>)\\n\"+\"    attribute vec3 position;\\n\"+\"    attribute vec3 normal;\\n\"+\"    attribute vec2 texcoord;\\n\"+\"    attribute vec3 color;\\n\"+\"    uniform mat4 modelViewProjectionMatrix;\\n\"+\"    uniform mat4 modelViewMatrix;\\n\"+\"    uniform mat4 normalMatrix;\\n\"+\"    uniform mat4 viewMatrix;\\n\"+\"    uniform sampler2D tex;\\n\");x3dom.nodeTypes.ComposedShader.ShaderInfoMsgShown=true;}},{nodeChanged:function()\n{var i,n=this._cf.parts.nodes.length;for(i=0;i<n;i++)\n{if(this._cf.parts.nodes[i]._vf.type.toLowerCase()=='vertex'){this._vertex=this._cf.parts.nodes[i];this._id=this._cf.parts.nodes[i]._id;}\nelse if(this._cf.parts.nodes[i]._vf.type.toLowerCase()=='fragment'){this._fragment=this._cf.parts.nodes[i];this._id+=\" - \"+this._cf.parts.nodes[i]._id;}}\nvar ctx={};n=this._cf.fields.nodes.length;for(i=0;i<n;i++)\n{var fieldName=this._cf.fields.nodes[i]._vf.name;ctx.xmlNode=this._cf.fields.nodes[i]._xmlNode;var needNode=false;if(ctx.xmlNode===undefined||ctx.xmlNode===null){ctx.xmlNode=document.createElement(\"field\");needNode=true;}\nctx.xmlNode.setAttribute(fieldName,this._cf.fields.nodes[i]._vf.value);var funcName=\"this.addField_\"+this._cf.fields.nodes[i]._vf.type+\"(ctx, name);\";var func=new Function('ctx','name',funcName);func.call(this,ctx,fieldName);if(needNode){ctx.xmlNode=null;}}\nArray.forEach(this._parentNodes,function(app){Array.forEach(app._parentNodes,function(shape){if(shape._cleanupGLObjects)\nshape._cleanupGLObjects();shape.setAllDirty();});});},fieldChanged:function(fieldName)\n{var i,n=this._cf.fields.nodes.length;for(i=0;i<n;i++)\n{var field=this._cf.fields.nodes[i]._vf.name;if(field===fieldName)\n{var msg=this._cf.fields.nodes[i]._vf.value;try{this._vf[field].setValueByStr(msg);}\ncatch(exc1){try{switch((typeof(this._vf[field])).toString()){case\"number\":this._vf[field]=+msg;break;case\"boolean\":this._vf[field]=(msg.toLowerCase()===\"true\");break;case\"string\":this._vf[field]=msg;break;}}\ncatch(exc2){x3dom.debug.logError(\"setValueByStr() NYI for \"+typeof(this._vf[field]));}}\nbreak;}}\nif(fieldName==='url')\n{for(i=0;i<n;i++)\n{if(this._cf.parts.nodes[i]._vf.type.toLowerCase()=='vertex'){this._vertex=this._cf.parts.nodes[i];this._id=this._cf.parts.nodes[i]._id;}\nelse if(this._cf.parts.nodes[i]._vf.type.toLowerCase()=='fragment'){this._fragment=this._cf.parts.nodes[i];this._id+=\" - \"+this._cf.parts.nodes[i]._id;}}\nArray.forEach(this._parentNodes,function(app){Array.forEach(app._parentNodes,function(shape){if(shape._cleanupGLObjects)\n{shape._cleanupGLObjects();}\nshape.setAllDirty();});});}},parentAdded:function(parent)\n{parent.nodeChanged();}}));x3dom.nodeTypes.ComposedShader.ShaderInfoMsgShown=false;x3dom.registerNodeType(\"ShaderPart\",\"Shaders\",defineClass(x3dom.nodeTypes.X3DNode,function(ctx){x3dom.nodeTypes.ShaderPart.superClass.call(this,ctx);this.addField_MFString(ctx,'url',[]);this.addField_SFString(ctx,'type',\"VERTEX\");this._id=(ctx&&ctx.xmlNode&&ctx.xmlNode.id!=\"\")?ctx.xmlNode.id:++x3dom.nodeTypes.Shape.shaderPartID;x3dom.debug.assert(this._vf.type.toLowerCase()=='vertex'||this._vf.type.toLowerCase()=='fragment',\"Unknown shader part type!\");},{nodeChanged:function()\n{var ctx={};ctx.xmlNode=this._xmlNode;if(ctx.xmlNode!==undefined&&ctx.xmlNode!==null)\n{var that=this;if(that._vf.url.length&&that._vf.url[0].indexOf('\\n')==-1)\n{var xhr=new XMLHttpRequest(),url=that._nameSpace.getURL(that._vf.url[0]);originalID=that._id;that._id=\"default\";that._vf.url=new x3dom.fields.MFString([this._getDefaultShader()]);xhr.open(\"GET\",url,false);xhr.onload=function(){that._vf.url=new x3dom.fields.MFString([]);that._vf.url.push(xhr.response);that._id=originalID;that.fieldChanged(\"url\");};xhr.onerror=function(){x3dom.debug.logError(\"Could not load file '\"+that._vf.url[0]+\"'.\");};x3dom.RequestManager.addRequest(xhr);}\nelse\n{if(that._vf.url.length){that._vf.url=new x3dom.fields.MFString([]);}\ntry{that._vf.url.push(ctx.xmlNode.childNodes[1].nodeValue);ctx.xmlNode.removeChild(ctx.xmlNode.childNodes[1]);}\ncatch(e){Array.forEach(ctx.xmlNode.childNodes,function(childDomNode){if(childDomNode.nodeType===3){that._vf.url.push(childDomNode.nodeValue);}\nelse if(childDomNode.nodeType===4){that._vf.url.push(childDomNode.data);}\nchildDomNode.parentNode.removeChild(childDomNode);});}}}\nArray.forEach(this._parentNodes,function(shader){shader.nodeChanged();});},fieldChanged:function(fieldName)\n{if(fieldName===\"url\"){Array.forEach(this._parentNodes,function(shader){shader.fieldChanged(\"url\");});}},parentAdded:function(parent)\n{parent.nodeChanged();},_getDefaultShader:function()\n{if(this._vf.type.toLowerCase()=='vertex')\n{return\"attribute vec3 position;\\n\"+\"uniform mat4 modelViewProjectionMatrix;\\n\"+\"void main(void) {\\n\"+\"    gl_Position = modelViewProjectionMatrix * vec4(position, 1.0);\\n\"+\"}\\n\";}\nif(this._vf.type.toLowerCase()=='fragment')\n{return\"precision highp float;\\n\"+\"void main(void) {\\n\"+\"    gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\\n\"+\"}\\n\";}}}));x3dom.registerNodeType(\"X3DVertexAttributeNode\",\"Shaders\",defineClass(x3dom.nodeTypes.X3DGeometricPropertyNode,function(ctx){x3dom.nodeTypes.X3DVertexAttributeNode.superClass.call(this,ctx);this.addField_SFString(ctx,'name',\"\");}));x3dom.registerNodeType(\"FloatVertexAttribute\",\"Shaders\",defineClass(x3dom.nodeTypes.X3DVertexAttributeNode,function(ctx){x3dom.nodeTypes.FloatVertexAttribute.superClass.call(this,ctx);this.addField_SFInt32(ctx,'numComponents',4);this.addField_MFFloat(ctx,'value',[]);}));x3dom.registerNodeType(\"X3DSpatialGeometryNode\",\"Geometry3D\",defineClass(x3dom.nodeTypes.X3DGeometryNode,function(ctx){x3dom.nodeTypes.X3DSpatialGeometryNode.superClass.call(this,ctx);}));x3dom.registerNodeType(\"Plane\",\"Geometry3D\",defineClass(x3dom.nodeTypes.X3DSpatialGeometryNode,function(ctx){x3dom.nodeTypes.Plane.superClass.call(this,ctx);this.addField_SFVec2f(ctx,'size',2,2);this.addField_SFVec2f(ctx,'subdivision',1,1);this.addField_SFVec3f(ctx,'center',0,0,0);this.addField_MFString(ctx,'primType',['TRIANGLES']);if(this._vf.primType.length)\nthis._mesh._primType=this._vf.primType[0];var sx=this._vf.size.x,sy=this._vf.size.y;var subx=this._vf.subdivision.x,suby=this._vf.subdivision.y;var geoCacheID='Plane_'+sx+'-'+sy+'-'+subx+'-'+suby+'-'+\nthis._vf.center.x+'-'+this._vf.center.y+'-'+this._vf.center.z;if(ctx&&this._vf.useGeoCache&&x3dom.geoCache[geoCacheID]!==undefined){this._mesh=x3dom.geoCache[geoCacheID];}\nelse{var x=0,y=0;var xstep=sx/subx;var ystep=sy/suby;sx/=2;sy/=2;for(y=0;y<=suby;y++){for(x=0;x<=subx;x++){this._mesh._positions[0].push(this._vf.center.x+x*xstep-sx);this._mesh._positions[0].push(this._vf.center.y+y*ystep-sy);this._mesh._positions[0].push(this._vf.center.z);this._mesh._normals[0].push(0);this._mesh._normals[0].push(0);this._mesh._normals[0].push(1);this._mesh._texCoords[0].push(x/subx);this._mesh._texCoords[0].push(y/suby);}}\nfor(y=1;y<=suby;y++){for(x=0;x<subx;x++){this._mesh._indices[0].push((y-1)*(subx+1)+x);this._mesh._indices[0].push((y-1)*(subx+1)+x+1);this._mesh._indices[0].push(y*(subx+1)+x);this._mesh._indices[0].push(y*(subx+1)+x);this._mesh._indices[0].push((y-1)*(subx+1)+x+1);this._mesh._indices[0].push(y*(subx+1)+x+1);}}\nthis._mesh._invalidate=true;this._mesh._numFaces=this._mesh._indices[0].length/3;this._mesh._numCoords=this._mesh._positions[0].length/3;x3dom.geoCache[geoCacheID]=this._mesh;}},{fieldChanged:function(fieldName){if(fieldName==\"size\"||fieldName==\"center\"){this._mesh._positions[0]=[];var sx=this._vf.size.x,sy=this._vf.size.y;var subx=this._vf.subdivision.x,suby=this._vf.subdivision.y;var x=0,y=0;var xstep=sx/subx;var ystep=sy/suby;sx/=2;sy/=2;for(y=0;y<=suby;y++){for(x=0;x<=subx;x++){this._mesh._positions[0].push(this._vf.center.x+x*xstep-sx);this._mesh._positions[0].push(this._vf.center.y+y*ystep-sy);this._mesh._positions[0].push(this._vf.center.z);}}\nthis.invalidateVolume();this._mesh._numCoords=this._mesh._positions[0].length/3;Array.forEach(this._parentNodes,function(node){node._dirty.positions=true;node.invalidateVolume();});}\nelse if(fieldName==\"subdivision\"){this._mesh._positions[0]=[];this._mesh._indices[0]=[];this._mesh._normals[0]=[];this._mesh._texCoords[0]=[];var sx=this._vf.size.x,sy=this._vf.size.y;var subx=this._vf.subdivision.x,suby=this._vf.subdivision.y;var x=0,y=0;var xstep=sx/subx;var ystep=sy/suby;sx/=2;sy/=2;for(y=0;y<=suby;y++){for(x=0;x<=subx;x++){this._mesh._positions[0].push(this._vf.center.x+x*xstep-sx);this._mesh._positions[0].push(this._vf.center.y+y*ystep-sy);this._mesh._positions[0].push(this._vf.center.z);this._mesh._normals[0].push(0);this._mesh._normals[0].push(0);this._mesh._normals[0].push(1);this._mesh._texCoords[0].push(x/subx);this._mesh._texCoords[0].push(y/suby);}}\nfor(y=1;y<=suby;y++){for(x=0;x<subx;x++){this._mesh._indices[0].push((y-1)*(subx+1)+x);this._mesh._indices[0].push((y-1)*(subx+1)+x+1);this._mesh._indices[0].push(y*(subx+1)+x);this._mesh._indices[0].push(y*(subx+1)+x);this._mesh._indices[0].push((y-1)*(subx+1)+x+1);this._mesh._indices[0].push(y*(subx+1)+x+1);}}\nthis.invalidateVolume();this._mesh._numFaces=this._mesh._indices[0].length/3;this._mesh._numCoords=this._mesh._positions[0].length/3;Array.forEach(this._parentNodes,function(node){node.setAllDirty();node.invalidateVolume();});}}}));x3dom.registerNodeType(\"Box\",\"Geometry3D\",defineClass(x3dom.nodeTypes.X3DSpatialGeometryNode,function(ctx){x3dom.nodeTypes.Box.superClass.call(this,ctx);this.addField_SFVec3f(ctx,'size',2,2,2);this.addField_SFBool(ctx,'hasHelperColors',false);var sx=this._vf.size.x,sy=this._vf.size.y,sz=this._vf.size.z;var geoCacheID='Box_'+sx+'-'+sy+'-'+sz;if(this._vf.useGeoCache&&x3dom.geoCache[geoCacheID]!==undefined)\n{this._mesh=x3dom.geoCache[geoCacheID];}\nelse\n{sx/=2;sy/=2;sz/=2;this._mesh._positions[0]=[-sx,-sy,-sz,-sx,sy,-sz,sx,sy,-sz,sx,-sy,-sz,-sx,-sy,sz,-sx,sy,sz,sx,sy,sz,sx,-sy,sz,-sx,-sy,-sz,-sx,-sy,sz,-sx,sy,sz,-sx,sy,-sz,sx,-sy,-sz,sx,-sy,sz,sx,sy,sz,sx,sy,-sz,-sx,sy,-sz,-sx,sy,sz,sx,sy,sz,sx,sy,-sz,-sx,-sy,-sz,-sx,-sy,sz,sx,-sy,sz,sx,-sy,-sz];this._mesh._normals[0]=[0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,1,0,0,1,0,0,1,0,0,1,-1,0,0,-1,0,0,-1,0,0,-1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0];this._mesh._texCoords[0]=[1,0,1,1,0,1,0,0,0,0,0,1,1,1,1,0,0,0,1,0,1,1,0,1,1,0,0,0,0,1,1,1,0,1,0,0,1,0,1,1,0,0,0,1,1,1,1,0];if(this._vf.hasHelperColors){this._mesh._colors[0]=[0,0,0,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,1,1,1,1,0,1,0,0,0,0,0,1,0,1,1,0,1,0,1,0,0,1,0,1,1,1,1,1,1,0,0,1,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,0,1,1,0,0];}\nthis._mesh._indices[0]=[0,1,2,2,3,0,4,7,5,5,7,6,8,9,10,10,11,8,12,14,13,14,12,15,16,17,18,18,19,16,20,22,21,22,20,23];this._mesh._invalidate=true;this._mesh._numFaces=12;this._mesh._numCoords=24;x3dom.geoCache[geoCacheID]=this._mesh;}},{fieldChanged:function(fieldName)\n{if(fieldName===\"size\"){var sx=this._vf.size.x/2,sy=this._vf.size.y/2,sz=this._vf.size.z/2;this._mesh._positions[0]=[-sx,-sy,-sz,-sx,sy,-sz,sx,sy,-sz,sx,-sy,-sz,-sx,-sy,sz,-sx,sy,sz,sx,sy,sz,sx,-sy,sz,-sx,-sy,-sz,-sx,-sy,sz,-sx,sy,sz,-sx,sy,-sz,sx,-sy,-sz,sx,-sy,sz,sx,sy,sz,sx,sy,-sz,-sx,sy,-sz,-sx,sy,sz,sx,sy,sz,sx,sy,-sz,-sx,-sy,-sz,-sx,-sy,sz,sx,-sy,sz,sx,-sy,-sz];this.invalidateVolume();Array.forEach(this._parentNodes,function(node){node._dirty.positions=true;node.invalidateVolume();});}\nelse if(fieldName===\"hasHelperColors\"){if(this._vf.hasHelperColors){this._mesh._colors[0]=[0,0,0,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,1,1,1,1,0,1,0,0,0,0,0,1,0,1,1,0,1,0,1,0,0,1,0,1,1,1,1,1,1,0,0,1,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,0,1,1,0,0];}\nelse{this._mesh._colors[0]=[];}\nArray.forEach(this._parentNodes,function(node){node._dirty.colors=true;});}}}));x3dom.registerNodeType(\"Sphere\",\"Geometry3D\",defineClass(x3dom.nodeTypes.X3DSpatialGeometryNode,function(ctx){x3dom.nodeTypes.Sphere.superClass.call(this,ctx);this.addField_SFFloat(ctx,'radius',ctx?1:1000);this.addField_SFVec2f(ctx,'subdivision',24,24);this._qfactors={\"low\":0.3,\"medium\":0.5,\"high\":1.0};if(ctx===undefined)this.nodeChanged();},{nodeChanged:function()\n{var qfactor=1.0;if(this._nameSpace){qfactor=this._nameSpace.doc.properties.getProperty(\"PrimitiveQuality\",\"Medium\");}\nif(x3dom.Utils.isNumber(qfactor)){qfactor=parseFloat(qfactor);}\nelse{qfactor=this._qfactors[qfactor.toLowerCase()]||0.5;}\nthis._quality=qfactor;var r=this._vf.radius;var subx=this._vf.subdivision.x,suby=this._vf.subdivision.y;var geoCacheID='Sphere_'+r+'-'+subx+'-'+suby;if(this._vf.useGeoCache&&x3dom.geoCache[geoCacheID]!==undefined){this._mesh=x3dom.geoCache[geoCacheID];return;}\nthis._regenerateMesh();this._mesh._invalidate=true;this._mesh._numFaces=this._mesh._indices[0].length/3;this._mesh._numCoords=this._mesh._positions[0].length/3;x3dom.geoCache[geoCacheID]=this._mesh;},_regenerateMesh:function()\n{this._mesh._positions[0]=[];this._mesh._indices[0]=[];this._mesh._normals[0]=[];this._mesh._texCoords[0]=[];var r=this._vf.radius;var subx=this._vf.subdivision.x,suby=this._vf.subdivision.y;var latNumber,longNumber;var latitudeBands=Math.floor(subx*this._quality);var longitudeBands=Math.floor(suby*this._quality);var theta,sinTheta,cosTheta;var phi,sinPhi,cosPhi;var coord,u,v;for(latNumber=0;latNumber<=latitudeBands;latNumber++){theta=(latNumber*Math.PI)/latitudeBands;sinTheta=Math.sin(theta);cosTheta=Math.cos(theta);for(longNumber=0;longNumber<=longitudeBands;longNumber++){coord=this._calcXYZ(longNumber,longitudeBands,sinTheta,cosTheta);u=this._uFromlong(longNumber,longitudeBands);v=latNumber/latitudeBands;this._mesh._positions[0].push(r*coord.x);this._mesh._positions[0].push(r*coord.y);this._mesh._positions[0].push(r*coord.z);this._mesh._normals[0].push(coord.x);this._mesh._normals[0].push(coord.y);this._mesh._normals[0].push(coord.z);this._mesh._texCoords[0].push(u);this._mesh._texCoords[0].push(v);}}\nvar first,second;for(latNumber=0;latNumber<latitudeBands;latNumber++){for(longNumber=0;longNumber<longitudeBands;longNumber++){first=(latNumber*(longitudeBands+1))+longNumber;second=first+longitudeBands+1;this._mesh._indices[0].push(first);this._mesh._indices[0].push(second);this._mesh._indices[0].push(first+1);this._mesh._indices[0].push(second);this._mesh._indices[0].push(second+1);this._mesh._indices[0].push(first+1);}}},_calcXYZ:function(longNumber,longitudeBands,sinTheta,cosTheta)\n{var phi=0.5*Math.PI+(longNumber*2.0*Math.PI)/longitudeBands;var x=-Math.cos(phi)*sinTheta;var y=-cosTheta;var z=-Math.sin(phi)*sinTheta;return{x:x,y:y,z:z};},_uFromlong:function(longNumber,longitudeBands)\n{return 1.0-(longNumber/longitudeBands);},fieldChanged:function(fieldName){if(fieldName===\"radius\"){this._mesh._positions[0]=[];var r=this._vf.radius;var subx=this._vf.subdivision.x,suby=this._vf.subdivision.y;var qfactor=this._quality;var latNumber,longNumber;var latitudeBands=Math.floor(subx*qfactor);var longitudeBands=Math.floor(suby*qfactor);var theta,sinTheta,cosTheta;var phi,sinPhi,cosPhi;var coord;for(latNumber=0;latNumber<=latitudeBands;latNumber++){theta=(latNumber*Math.PI)/latitudeBands;sinTheta=Math.sin(theta);cosTheta=Math.cos(theta);for(longNumber=0;longNumber<=longitudeBands;longNumber++){coord=this._calcXYZ(longNumber,longitudeBands,sinTheta,cosTheta);this._mesh._positions[0].push(r*coord.x);this._mesh._positions[0].push(r*coord.y);this._mesh._positions[0].push(r*coord.z);}}\nthis.invalidateVolume();this._mesh._numCoords=this._mesh._positions[0].length/3;Array.forEach(this._parentNodes,function(node){node._dirty.positions=true;node.invalidateVolume();});}\nelse if(fieldName===\"subdivision\"){this._regenerateMesh();this.invalidateVolume();this._mesh._numFaces=this._mesh._indices[0].length/3;this._mesh._numCoords=this._mesh._positions[0].length/3;var r=this._vf.radius;var subx=this._vf.subdivision.x,suby=this._vf.subdivision.y;var geoCacheID='Sphere_'+r+'-'+subx+'-'+suby;x3dom.geoCache[geoCacheID]=this._mesh;Array.forEach(this._parentNodes,function(node){node.setAllDirty();node.invalidateVolume();});}}}));x3dom.registerNodeType(\"Torus\",\"Geometry3D\",defineClass(x3dom.nodeTypes.X3DSpatialGeometryNode,function(ctx){x3dom.nodeTypes.Torus.superClass.call(this,ctx);var twoPi=2.0*Math.PI;this.addField_SFFloat(ctx,'innerRadius',0.5);this.addField_SFFloat(ctx,'outerRadius',1.0);this.addField_SFFloat(ctx,'angle',twoPi);this.addField_SFBool(ctx,'caps',true);this.addField_SFVec2f(ctx,'subdivision',24,24);this.addField_SFBool(ctx,'insideOutsideRadius',false);if(this._vf.angle<0)\nthis._vf.angle=0;else if(this._vf.angle>twoPi)\nthis._vf.angle=twoPi;this._origCCW=this._vf.ccw;var innerRadius=this._vf.innerRadius;var outerRadius=this._vf.outerRadius;if(this._vf.insideOutsideRadius==true)\n{if(innerRadius>outerRadius){var tmp=innerRadius;innerRadius=outerRadius;outerRadius=tmp;}\nvar rad=(outerRadius-innerRadius)/2;outerRadius=innerRadius+rad;innerRadius=rad;this._vf.ccw=!this._origCCW;}\nvar rings=this._vf.subdivision.x,sides=this._vf.subdivision.y;rings=Math.max(3,Math.round((this._vf.angle/twoPi)*rings));var geoCacheID='Torus_'+innerRadius+'_'+outerRadius+'_'+this._vf.angle+'_'+\nthis._vf.subdivision+'-'+this._vf.caps;if(this._vf.useGeoCache&&x3dom.geoCache[geoCacheID]!==undefined)\n{this._mesh=x3dom.geoCache[geoCacheID];}\nelse\n{var ringDelta=this._vf.angle/rings;var sideDelta=twoPi/sides;var a,b,theta,phi;var cosTheta,sinTheta,cosPhi,sinPhi,dist;for(a=0,theta=0;a<=rings;a++,theta+=ringDelta)\n{cosTheta=Math.cos(theta);sinTheta=Math.sin(theta);for(b=0,phi=0;b<=sides;b++,phi+=sideDelta)\n{cosPhi=Math.cos(phi);sinPhi=Math.sin(phi);dist=outerRadius+innerRadius*cosPhi;if(this._vf.insideOutsideRadius){this._mesh._positions[0].push(cosTheta*dist,innerRadius*sinPhi,-sinTheta*dist);this._mesh._normals[0].push(cosTheta*cosPhi,sinPhi,-sinTheta*cosPhi);}\nelse{this._mesh._positions[0].push(cosTheta*dist,-sinTheta*dist,innerRadius*sinPhi);this._mesh._normals[0].push(cosTheta*cosPhi,-sinTheta*cosPhi,sinPhi);}\nthis._mesh._texCoords[0].push(-a/rings,b/sides);}}\nfor(a=0;a<sides;a++)\n{for(b=0;b<rings;b++)\n{this._mesh._indices[0].push(b*(sides+1)+a);this._mesh._indices[0].push(b*(sides+1)+a+1);this._mesh._indices[0].push((b+1)*(sides+1)+a);this._mesh._indices[0].push(b*(sides+1)+a+1);this._mesh._indices[0].push((b+1)*(sides+1)+a+1);this._mesh._indices[0].push((b+1)*(sides+1)+a);}}\nif(this._vf.angle<twoPi&&this._vf.caps==true)\n{var origPos=this._mesh._positions[0].length/3;if(this._vf.insideOutsideRadius){this._mesh._positions[0].push(outerRadius,0,0);this._mesh._normals[0].push(0,0,1);}\nelse{this._mesh._positions[0].push(outerRadius,0,0);this._mesh._normals[0].push(0,1,0);}\nthis._mesh._texCoords[0].push(0.5,0.5);for(b=0,phi=0;b<=sides;b++,phi+=sideDelta)\n{cosPhi=Math.cos(phi);sinPhi=Math.sin(phi);dist=outerRadius+innerRadius*cosPhi;if(this._vf.insideOutsideRadius){this._mesh._positions[0].push(dist,sinPhi*innerRadius,0);this._mesh._normals[0].push(0,0,1);}\nelse{this._mesh._positions[0].push(dist,0,sinPhi*innerRadius);this._mesh._normals[0].push(0,1,0);}\nthis._mesh._texCoords[0].push((1+cosPhi)*0.5,(1-sinPhi)*0.5);if(b>0){this._mesh._indices[0].push(origPos);this._mesh._indices[0].push(origPos+b);this._mesh._indices[0].push(origPos+b-1);}\nif(b==sides){this._mesh._indices[0].push(origPos);this._mesh._indices[0].push(origPos+1);this._mesh._indices[0].push(origPos+b);}}\ncosTheta=Math.cos(this._vf.angle);sinTheta=Math.sin(this._vf.angle);origPos=this._mesh._positions[0].length/3;var nx=-sinTheta,ny=-cosTheta;if(this._vf.insideOutsideRadius){this._mesh._positions[0].push(cosTheta*outerRadius,0,-sinTheta*outerRadius);this._mesh._normals[0].push(nx,0,ny);}\nelse{this._mesh._positions[0].push(cosTheta*outerRadius,-sinTheta*outerRadius,0);this._mesh._normals[0].push(nx,ny,0);}\nthis._mesh._texCoords[0].push(0.5,0.5);for(b=0,phi=0;b<=sides;b++,phi+=sideDelta)\n{cosPhi=Math.cos(phi);sinPhi=Math.sin(phi);dist=outerRadius+innerRadius*cosPhi;if(this._vf.insideOutsideRadius){this._mesh._positions[0].push(cosTheta*dist,sinPhi*innerRadius,-sinTheta*dist);this._mesh._normals[0].push(nx,0,ny);}\nelse{this._mesh._positions[0].push(cosTheta*dist,-sinTheta*dist,sinPhi*innerRadius);this._mesh._normals[0].push(nx,ny,0);}\nthis._mesh._texCoords[0].push(1-(1+cosPhi)*0.5,(1-sinPhi)*0.5);if(b>0){this._mesh._indices[0].push(origPos);this._mesh._indices[0].push(origPos+b-1);this._mesh._indices[0].push(origPos+b);}\nif(b==sides){this._mesh._indices[0].push(origPos);this._mesh._indices[0].push(origPos+b);this._mesh._indices[0].push(origPos+1);}}}\nthis._mesh._invalidate=true;this._mesh._numFaces=this._mesh._indices[0].length/3;this._mesh._numCoords=this._mesh._positions[0].length/3;x3dom.geoCache[geoCacheID]=this._mesh;}},{fieldChanged:function(fieldName)\n{if(fieldName==\"innerRadius\"||fieldName==\"outerRadius\"||fieldName==\"subdivision\"||fieldName==\"angle\"||fieldName==\"insideOutsideRadius\"||fieldName==\"caps\")\n{var twoPi=2.0*Math.PI;if(this._vf.angle<0)\nthis._vf.angle=0;else if(this._vf.angle>twoPi)\nthis._vf.angle=twoPi;var innerRadius=this._vf.innerRadius;var outerRadius=this._vf.outerRadius;if(this._vf.insideOutsideRadius==true)\n{if(innerRadius>outerRadius){var tmp=innerRadius;innerRadius=outerRadius;outerRadius=tmp;}\nvar rad=(outerRadius-innerRadius)/2;outerRadius=innerRadius+rad;innerRadius=rad;this._vf.ccw=!this._origCCW;}\nelse\nthis._vf.ccw=this._origCCW;var rings=this._vf.subdivision.x,sides=this._vf.subdivision.y;rings=Math.max(3,Math.round((this._vf.angle/twoPi)*rings));var ringDelta=this._vf.angle/rings;var sideDelta=twoPi/sides;var a,b,theta,phi;var cosTheta,sinTheta,cosPhi,sinPhi,dist;this._mesh._positions[0]=[];this._mesh._normals[0]=[];this._mesh._texCoords[0]=[];this._mesh._indices[0]=[];for(a=0,theta=0;a<=rings;a++,theta+=ringDelta)\n{cosTheta=Math.cos(theta);sinTheta=Math.sin(theta);for(b=0,phi=0;b<=sides;b++,phi+=sideDelta)\n{cosPhi=Math.cos(phi);sinPhi=Math.sin(phi);dist=outerRadius+innerRadius*cosPhi;if(this._vf.insideOutsideRadius){this._mesh._positions[0].push(cosTheta*dist,innerRadius*sinPhi,-sinTheta*dist);this._mesh._normals[0].push(cosTheta*cosPhi,sinPhi,-sinTheta*cosPhi);}\nelse{this._mesh._positions[0].push(cosTheta*dist,-sinTheta*dist,innerRadius*sinPhi);this._mesh._normals[0].push(cosTheta*cosPhi,-sinTheta*cosPhi,sinPhi);}\nthis._mesh._texCoords[0].push(-a/rings,b/sides);}}\nfor(a=0;a<sides;a++)\n{for(b=0;b<rings;b++)\n{this._mesh._indices[0].push(b*(sides+1)+a);this._mesh._indices[0].push(b*(sides+1)+a+1);this._mesh._indices[0].push((b+1)*(sides+1)+a);this._mesh._indices[0].push(b*(sides+1)+a+1);this._mesh._indices[0].push((b+1)*(sides+1)+a+1);this._mesh._indices[0].push((b+1)*(sides+1)+a);}}\nif(this._vf.angle<twoPi&&this._vf.caps==true)\n{var origPos=this._mesh._positions[0].length/3;if(this._vf.insideOutsideRadius){this._mesh._positions[0].push(outerRadius,0,0);this._mesh._normals[0].push(0,0,1);}\nelse{this._mesh._positions[0].push(outerRadius,0,0);this._mesh._normals[0].push(0,1,0);}\nthis._mesh._texCoords[0].push(0.5,0.5);for(b=0,phi=0;b<=sides;b++,phi+=sideDelta)\n{cosPhi=Math.cos(phi);sinPhi=Math.sin(phi);dist=outerRadius+innerRadius*cosPhi;if(this._vf.insideOutsideRadius){this._mesh._positions[0].push(dist,sinPhi*innerRadius,0);this._mesh._normals[0].push(0,0,1);}\nelse{this._mesh._positions[0].push(dist,0,sinPhi*innerRadius);this._mesh._normals[0].push(0,1,0);}\nthis._mesh._texCoords[0].push((1+cosPhi)*0.5,(1-sinPhi)*0.5);if(b>0){this._mesh._indices[0].push(origPos);this._mesh._indices[0].push(origPos+b);this._mesh._indices[0].push(origPos+b-1);}\nif(b==sides){this._mesh._indices[0].push(origPos);this._mesh._indices[0].push(origPos+1);this._mesh._indices[0].push(origPos+b);}}\ncosTheta=Math.cos(this._vf.angle);sinTheta=Math.sin(this._vf.angle);origPos=this._mesh._positions[0].length/3;var nx=-sinTheta,ny=-cosTheta;if(this._vf.insideOutsideRadius){this._mesh._positions[0].push(cosTheta*outerRadius,0,-sinTheta*outerRadius);this._mesh._normals[0].push(nx,0,ny);}\nelse{this._mesh._positions[0].push(cosTheta*outerRadius,-sinTheta*outerRadius,0);this._mesh._normals[0].push(nx,ny,0);}\nthis._mesh._texCoords[0].push(0.5,0.5);for(b=0,phi=0;b<=sides;b++,phi+=sideDelta)\n{cosPhi=Math.cos(phi);sinPhi=Math.sin(phi);dist=outerRadius+innerRadius*cosPhi;if(this._vf.insideOutsideRadius){this._mesh._positions[0].push(cosTheta*dist,sinPhi*innerRadius,-sinTheta*dist);this._mesh._normals[0].push(nx,0,ny);}\nelse{this._mesh._positions[0].push(cosTheta*dist,-sinTheta*dist,sinPhi*innerRadius);this._mesh._normals[0].push(nx,ny,0);}\nthis._mesh._texCoords[0].push(1-(1+cosPhi)*0.5,(1-sinPhi)*0.5);if(b>0){this._mesh._indices[0].push(origPos);this._mesh._indices[0].push(origPos+b-1);this._mesh._indices[0].push(origPos+b);}\nif(b==sides){this._mesh._indices[0].push(origPos);this._mesh._indices[0].push(origPos+b);this._mesh._indices[0].push(origPos+1);}}}\nthis.invalidateVolume();this._mesh._numFaces=this._mesh._indices[0].length/3;this._mesh._numCoords=this._mesh._positions[0].length/3;Array.forEach(this._parentNodes,function(node){node.setAllDirty();node.invalidateVolume();});}}}));x3dom.registerNodeType(\"Cone\",\"Geometry3D\",defineClass(x3dom.nodeTypes.X3DSpatialGeometryNode,function(ctx){x3dom.nodeTypes.Cone.superClass.call(this,ctx);this.addField_SFFloat(ctx,'bottomRadius',1.0);this.addField_SFFloat(ctx,'topRadius',0);this.addField_SFFloat(ctx,'height',2.0);this.addField_SFBool(ctx,'bottom',true);this.addField_SFBool(ctx,'side',true);this.addField_SFBool(ctx,'top',true);this.addField_SFFloat(ctx,'subdivision',32);var geoCacheID='Cone_'+this._vf.bottomRadius+'_'+this._vf.height+'_'+this._vf.top+'_'+\nthis._vf.bottom+'_'+this._vf.side+'_'+this._vf.topRadius+'_'+this._vf.subdivision;if(this._vf.useGeoCache&&x3dom.geoCache[geoCacheID]!==undefined){this._mesh=x3dom.geoCache[geoCacheID];}\nelse{var bottomRadius=this._vf.bottomRadius,height=this._vf.height;var topRadius=this._vf.topRadius,sides=this._vf.subdivision;var beta,x,z;var delta=2.0*Math.PI/sides;var incl=(bottomRadius-topRadius)/height;var nlen=1.0/Math.sqrt(1.0+incl*incl);var j=0,k=0;var h,base;if(this._vf.side&&height>0){var px=0,pz=0;for(j=0,k=0;j<=sides;j++){beta=j*delta;x=Math.sin(beta);z=-Math.cos(beta);if(topRadius>x3dom.fields.Eps){px=x*topRadius;pz=z*topRadius;}\nthis._mesh._positions[0].push(px,height/2,pz);this._mesh._normals[0].push(x/nlen,incl/nlen,z/nlen);this._mesh._texCoords[0].push(1.0-j/sides,1);this._mesh._positions[0].push(x*bottomRadius,-height/2,z*bottomRadius);this._mesh._normals[0].push(x/nlen,incl/nlen,z/nlen);this._mesh._texCoords[0].push(1.0-j/sides,0);if(j>0){this._mesh._indices[0].push(k);this._mesh._indices[0].push(k+2);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k+2);this._mesh._indices[0].push(k+3);k+=2;}}}\nif(this._vf.bottom&&bottomRadius>0){base=this._mesh._positions[0].length/3;for(j=sides-1;j>=0;j--){beta=j*delta;x=bottomRadius*Math.sin(beta);z=-bottomRadius*Math.cos(beta);this._mesh._positions[0].push(x,-height/2,z);this._mesh._normals[0].push(0,-1,0);this._mesh._texCoords[0].push(x/bottomRadius/2+0.5,z/bottomRadius/2+0.5);}\nh=base+1;for(j=2;j<sides;j++){this._mesh._indices[0].push(h);this._mesh._indices[0].push(base);h=base+j;this._mesh._indices[0].push(h);}}\nif(this._vf.top&&topRadius>x3dom.fields.Eps){base=this._mesh._positions[0].length/3;for(j=sides-1;j>=0;j--){beta=j*delta;x=topRadius*Math.sin(beta);z=-topRadius*Math.cos(beta);this._mesh._positions[0].push(x,height/2,z);this._mesh._normals[0].push(0,1,0);this._mesh._texCoords[0].push(x/topRadius/2+0.5,1.0-z/topRadius/2+0.5);}\nh=base+1;for(j=2;j<sides;j++){this._mesh._indices[0].push(base);this._mesh._indices[0].push(h);h=base+j;this._mesh._indices[0].push(h);}}\nthis._mesh._invalidate=true;this._mesh._numFaces=this._mesh._indices[0].length/3;this._mesh._numCoords=this._mesh._positions[0].length/3;x3dom.geoCache[geoCacheID]=this._mesh;}},{fieldChanged:function(fieldName)\n{if(fieldName==\"bottomRadius\"||fieldName==\"topRadius\"||fieldName==\"height\"||fieldName==\"subdivision\"||fieldName==\"bottom\"||fieldName==\"top\"||fieldName==\"side\")\n{this._mesh._positions[0]=[];this._mesh._indices[0]=[];this._mesh._normals[0]=[];this._mesh._texCoords[0]=[];var bottomRadius=this._vf.bottomRadius,height=this._vf.height;var topRadius=this._vf.topRadius,sides=this._vf.subdivision;var beta,x,z;var delta=2.0*Math.PI/sides;var incl=(bottomRadius-topRadius)/height;var nlen=1.0/Math.sqrt(1.0+incl*incl);var j=0,k=0;var h,base;if(this._vf.side&&height>0)\n{var px=0,pz=0;for(j=0,k=0;j<=sides;j++){beta=j*delta;x=Math.sin(beta);z=-Math.cos(beta);if(topRadius>x3dom.fields.Eps){px=x*topRadius;pz=z*topRadius;}\nthis._mesh._positions[0].push(px,height/2,pz);this._mesh._normals[0].push(x/nlen,incl/nlen,z/nlen);this._mesh._texCoords[0].push(1.0-j/sides,1);this._mesh._positions[0].push(x*bottomRadius,-height/2,z*bottomRadius);this._mesh._normals[0].push(x/nlen,incl/nlen,z/nlen);this._mesh._texCoords[0].push(1.0-j/sides,0);if(j>0){this._mesh._indices[0].push(k);this._mesh._indices[0].push(k+2);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k+2);this._mesh._indices[0].push(k+3);k+=2;}}}\nif(this._vf.bottom&&bottomRadius>0)\n{base=this._mesh._positions[0].length/3;for(j=sides-1;j>=0;j--){beta=j*delta;x=bottomRadius*Math.sin(beta);z=-bottomRadius*Math.cos(beta);this._mesh._positions[0].push(x,-height/2,z);this._mesh._normals[0].push(0,-1,0);this._mesh._texCoords[0].push(x/bottomRadius/2+0.5,z/bottomRadius/2+0.5);}\nh=base+1;for(j=2;j<sides;j++){this._mesh._indices[0].push(h);this._mesh._indices[0].push(base);h=base+j;this._mesh._indices[0].push(h);}}\nif(this._vf.top&&topRadius>x3dom.fields.Eps)\n{base=this._mesh._positions[0].length/3;for(j=sides-1;j>=0;j--){beta=j*delta;x=topRadius*Math.sin(beta);z=-topRadius*Math.cos(beta);this._mesh._positions[0].push(x,height/2,z);this._mesh._normals[0].push(0,1,0);this._mesh._texCoords[0].push(x/topRadius/2+0.5,1.0-z/topRadius/2+0.5);}\nh=base+1;for(j=2;j<sides;j++){this._mesh._indices[0].push(base);this._mesh._indices[0].push(h);h=base+j;this._mesh._indices[0].push(h);}}\nthis.invalidateVolume();this._mesh._numFaces=this._mesh._indices[0].length/3;this._mesh._numCoords=this._mesh._positions[0].length/3;Array.forEach(this._parentNodes,function(node){node.setAllDirty();node.invalidateVolume();});}}}));x3dom.registerNodeType(\"Cylinder\",\"Geometry3D\",defineClass(x3dom.nodeTypes.X3DSpatialGeometryNode,function(ctx){x3dom.nodeTypes.Cylinder.superClass.call(this,ctx);this.addField_SFFloat(ctx,'radius',1.0);this.addField_SFFloat(ctx,'height',2.0);this.addField_SFBool(ctx,'bottom',true);this.addField_SFBool(ctx,'top',true);this.addField_SFFloat(ctx,'subdivision',32);this.addField_SFBool(ctx,'side',true);var sides=this._vf.subdivision;var geoCacheID='Cylinder_'+this._vf.radius+'_'+this._vf.height+'_'+this._vf.bottom+'_'+this._vf.top+'_'+\nthis._vf.side+'_'+this._vf.subdivision;if(this._vf.useGeoCache&&x3dom.geoCache[geoCacheID]!==undefined)\n{this._mesh=x3dom.geoCache[geoCacheID];}\nelse\n{var radius=this._vf.radius;var height=this._vf.height/2;var beta,x,z;var delta=2.0*Math.PI/sides;var j,k;if(this._vf.side)\n{for(j=0,k=0;j<=sides;j++)\n{beta=j*delta;x=Math.sin(beta);z=-Math.cos(beta);this._mesh._positions[0].push(x*radius,-height,z*radius);this._mesh._normals[0].push(x,0,z);this._mesh._texCoords[0].push(1.0-j/sides,0);this._mesh._positions[0].push(x*radius,height,z*radius);this._mesh._normals[0].push(x,0,z);this._mesh._texCoords[0].push(1.0-j/sides,1);if(j>0)\n{this._mesh._indices[0].push(k);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k+2);this._mesh._indices[0].push(k+2);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k+3);k+=2;}}}\nif(radius>0)\n{var h,base=this._mesh._positions[0].length/3;if(this._vf.top)\n{for(j=sides-1;j>=0;j--)\n{beta=j*delta;x=radius*Math.sin(beta);z=-radius*Math.cos(beta);this._mesh._positions[0].push(x,height,z);this._mesh._normals[0].push(0,1,0);this._mesh._texCoords[0].push(x/radius/2+0.5,-z/radius/2+0.5);}\nh=base+1;for(j=2;j<sides;j++)\n{this._mesh._indices[0].push(base);this._mesh._indices[0].push(h);h=base+j;this._mesh._indices[0].push(h);}\nbase=this._mesh._positions[0].length/3;}\nif(this._vf.bottom)\n{for(j=sides-1;j>=0;j--)\n{beta=j*delta;x=radius*Math.sin(beta);z=-radius*Math.cos(beta);this._mesh._positions[0].push(x,-height,z);this._mesh._normals[0].push(0,-1,0);this._mesh._texCoords[0].push(x/radius/2+0.5,z/radius/2+0.5);}\nh=base+1;for(j=2;j<sides;j++)\n{this._mesh._indices[0].push(h);this._mesh._indices[0].push(base);h=base+j;this._mesh._indices[0].push(h);}}}\nthis._mesh._invalidate=true;this._mesh._numFaces=this._mesh._indices[0].length/3;this._mesh._numCoords=this._mesh._positions[0].length/3;x3dom.geoCache[geoCacheID]=this._mesh;}},{fieldChanged:function(fieldName){if(fieldName===\"radius\"||fieldName===\"height\")\n{this._mesh._positions[0]=[];var radius=this._vf.radius,height=this._vf.height/2;var sides=this._vf.subdivision;var beta,x,z,j;var delta=2.0*Math.PI/sides;if(this._vf.side)\n{for(j=0;j<=sides;j++)\n{beta=j*delta;x=Math.sin(beta);z=-Math.cos(beta);this._mesh._positions[0].push(x*radius,-height,z*radius);this._mesh._positions[0].push(x*radius,height,z*radius);}}\nif(radius>0)\n{var h,base=this._mesh._positions[0].length/3;if(this._vf.top)\n{for(j=sides-1;j>=0;j--)\n{beta=j*delta;x=radius*Math.sin(beta);z=-radius*Math.cos(beta);this._mesh._positions[0].push(x,height,z);}}}\nif(this._vf.bottom)\n{for(j=sides-1;j>=0;j--)\n{beta=j*delta;x=radius*Math.sin(beta);z=-radius*Math.cos(beta);this._mesh._positions[0].push(x,-height,z);}}\nthis.invalidateVolume();this._mesh._numCoords=this._mesh._positions[0].length/3;Array.forEach(this._parentNodes,function(node){node._dirty.positions=true;node.invalidateVolume();});}\nelse if(fieldName===\"subdivision\"||fieldName===\"bottom\"||fieldName===\"top\"||fieldName===\"side\")\n{this._mesh._positions[0]=[];this._mesh._indices[0]=[];this._mesh._normals[0]=[];this._mesh._texCoords[0]=[];var radius=this._vf.radius,height=this._vf.height/2;var sides=this._vf.subdivision;var beta,x,z,j;var delta=2.0*Math.PI/sides;var k=0;if(this._vf.side)\n{for(j=0,k=0;j<=sides;j++)\n{beta=j*delta;x=Math.sin(beta);z=-Math.cos(beta);this._mesh._positions[0].push(x*radius,-height,z*radius);this._mesh._normals[0].push(x,0,z);this._mesh._texCoords[0].push(1.0-j/sides,0);this._mesh._positions[0].push(x*radius,height,z*radius);this._mesh._normals[0].push(x,0,z);this._mesh._texCoords[0].push(1.0-j/sides,1);if(j>0)\n{this._mesh._indices[0].push(k+0);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k+2);this._mesh._indices[0].push(k+2);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k+3);k+=2;}}}\nif(radius>0)\n{var h,base=this._mesh._positions[0].length/3;if(this._vf.top)\n{for(j=sides-1;j>=0;j--)\n{beta=j*delta;x=radius*Math.sin(beta);z=-radius*Math.cos(beta);this._mesh._positions[0].push(x,height,z);this._mesh._normals[0].push(0,1,0);this._mesh._texCoords[0].push(x/radius/2+0.5,-z/radius/2+0.5);}\nh=base+1;for(j=2;j<sides;j++)\n{this._mesh._indices[0].push(base);this._mesh._indices[0].push(h);h=base+j;this._mesh._indices[0].push(h);}\nbase=this._mesh._positions[0].length/3;}\nif(this._vf.bottom)\n{for(j=sides-1;j>=0;j--)\n{beta=j*delta;x=radius*Math.sin(beta);z=-radius*Math.cos(beta);this._mesh._positions[0].push(x,-height,z);this._mesh._normals[0].push(0,-1,0);this._mesh._texCoords[0].push(x/radius/2+0.5,z/radius/2+0.5);}\nh=base+1;for(j=2;j<sides;j++)\n{this._mesh._indices[0].push(h);this._mesh._indices[0].push(base);h=base+j;this._mesh._indices[0].push(h);}}}\nthis.invalidateVolume();this._mesh._numFaces=this._mesh._indices[0].length/3;this._mesh._numCoords=this._mesh._positions[0].length/3;Array.forEach(this._parentNodes,function(node){node.setAllDirty();node.invalidateVolume();});}}}));x3dom.registerNodeType(\"ExternalGeometry\",\"Geometry3D\",defineClass(x3dom.nodeTypes.X3DSpatialGeometryNode,function(ctx){x3dom.nodeTypes.ExternalGeometry.superClass.call(this,ctx);this.addField_MFString(ctx,'url',[]);this._mesh._invalidate=false;this._mesh._numCoords=0;this._mesh._numFaces=0;this._currentURLIdx=0;},{update:function(shape,shaderProgram,gl,viewarea,context){var that=this;var xhr;if(this._vf['url'].length==0||this._currentURLIdx>=this._vf['url'].length)\n{return;}\nvar currentURL=shape._nameSpace.getURL(this._vf['url'][this._currentURLIdx]);var urlSuffix=currentURL.substr(currentURL.lastIndexOf('.'));if(urlSuffix.substr(0,4)=='.src')\n{var srcUsedWarnMessage=\"Legacy SRC format used for content for \\\"\"+currentURL+\"\\\". \"+\"It is recommended to use a binary-glTF-conformant .glb container instead.\";x3dom.debug.logWarning(srcUsedWarnMessage);console.warn(srcUsedWarnMessage);ExternalGeometrySRC.updateRenderData(shape,shaderProgram,gl,viewarea,context,this._mesh,this._vf['url'],this._currentURLIdx);return;}\nif(x3dom.BinaryContainerLoader.outOfMemory){return;}\nshape._webgl.internalDownloadCount=1;shape._nameSpace.doc.incrementDownloads();xhr=new XMLHttpRequest();var encoding=(currentURL.indexOf(\".glb\")!=-1)?\"binary\":\"ascii\";var xhr=new XMLHttpRequest();xhr.open(\"GET\",this._nameSpace.getURL(this._vf['url'][this._currentURLIdx]),true);xhr.responseType=(encoding==\"binary\")?\"arraybuffer\":\"json\";x3dom.RequestManager.addRequest(xhr);xhr.onerror=function(){x3dom.debug.logError(\"Unable to load GLB data from URL \\\"\"+currentURL+\"\\\"\");};xhr.onload=function(){shape._webgl.internalDownloadCount=0;shape._nameSpace.doc.decrementDownloads();shape._webgl.primType=[];shape._webgl.indexOffset=[];shape._webgl.drawCount=[];if((xhr.status==200||xhr.status==0)){var glTF=new x3dom.glTF.glTFLoader(true);glTF.load(xhr.response,function()\n{if(glTF.header.sceneLength>0)\n{glTF.loaded={};glTF.loaded.meshes={};glTF.loaded.meshCount=0;if(currentURL.includes('#'))\n{var split=currentURL.split('#');var meshName=split[split.length-1];glTF.getMesh(shape,shaderProgram,gl,meshName);}\nelse\n{glTF.getScene(shape,shaderProgram,gl);}\nfor(var key in glTF._mesh){if(!glTF._mesh.hasOwnProperty(key))continue;that._mesh[key]=glTF._mesh[key];}}\nelse\n{if((that._currentURLIdx+1)<that._vf['url'].length)\n{x3dom.debug.logWarning(\"Invalid GLB data, loaded from URL \\\"\"+\ncurrentURL+\"\\\", trying next specified URL\");++that._currentURLIdx;that.update(shape,shaderProgram,gl,viewarea,context);}\nelse\n{x3dom.debug.logError(\"Invalid GLB data, loaded from URL \\\"\"+\ncurrentURL+\"\\\",\"+\" no other URLs left to try.\");}}\nvar theScene=that._nameSpace.doc._scene;if(theScene){theScene.invalidateVolume();window.setTimeout(function(){that.invalidateVolume();theScene.updateVolume();that._nameSpace.doc.needRender=true;},1000);}});}\nelse\n{if((that._currentURLIdx+1)<that._vf['url'].length)\n{x3dom.debug.logWarning(\"Invalid GLB data, loaded from URL \\\"\"+\ncurrentURL+\"\\\", trying next specified URL\");++that._currentURLIdx;that.update(shape,shaderProgram,gl,viewarea,context);}\nelse\n{x3dom.debug.logError(\"Invalid GLB data, loaded from URL \\\"\"+\ncurrentURL+\"\\\",\"+\" no other URLs left to try.\");}}};},getVolume:function()\n{var vol=this._mesh._vol;var shapeNode;if(!vol.isValid())\n{shapeNode=this._parentNodes[0];if(typeof shapeNode._vf[\"bboxCenter\"]!='undefined'&&typeof shapeNode._vf[\"bboxSize\"]!='undefined')\n{vol.setBoundsByCenterSize(shapeNode._vf[\"bboxCenter\"],shapeNode._vf[\"bboxSize\"]);}\nelse\n{}}\nreturn vol;}}));var ExternalGeometrySRC={updateRenderData:function(shape,shaderProgram,gl,viewarea,context,x3domMesh,urls,currentURLIndex)\n{var xhr;if(urls.length==0||currentURLIndex>=urls.length)\n{return;}\nif(x3dom.BinaryContainerLoader.outOfMemory){return;}\nshape._webgl.internalDownloadCount=1;shape._nameSpace.doc.incrementDownloads();xhr=new XMLHttpRequest();xhr.open(\"GET\",shape._nameSpace.getURL(urls[currentURLIndex]),true);xhr.responseType=\"arraybuffer\";xhr.send(null);xhr.onerror=function(){x3dom.debug.logError(\"Unable to load SRC data from URL \\\"\"+urls[currentURLIndex]+\"\\\"\");};xhr.onload=function(){shape._webgl.internalDownloadCount=0;shape._nameSpace.doc.decrementDownloads();var responseBeginUint32=new Uint32Array(xhr.response,0,12);var srcHeaderSize,srcBodySize,srcBodyOffset;var srcHeaderView,srcBodyView;var srcHeaderObj;if((xhr.status==200||xhr.status==0)&&responseBeginUint32.length>=3){srcHeaderSize=responseBeginUint32[2];srcBodyOffset=srcHeaderSize+12;srcBodySize=xhr.response.byteLength-srcBodyOffset;if(srcHeaderSize>0&&srcBodySize>=0)\n{srcHeaderView=new Uint8Array(xhr.response,12,srcHeaderSize);srcBodyView=new Uint8Array(xhr.response,srcBodyOffset,srcBodySize);try\n{srcHeaderObj=JSON.parse(String.fromCharCode.apply(null,srcHeaderView));}\ncatch(exc)\n{x3dom.debug.logError(\"Unable to parse SRC header: \"+exc);return;}\nExternalGeometrySRC._updateRenderDataFromSRC(shape,shaderProgram,gl,srcHeaderObj,srcBodyView,x3domMesh);}\nelse\n{if((currentURLIndex+1)<urls.length)\n{x3dom.debug.logWarning(\"Invalid SRC data, loaded from URL \\\"\"+\nurls[currentURLIndex]+\"\\\", trying next specified URL\");++currentURLIndex;ExternalGeometrySRC.updateRenderData(shape,shaderProgram,gl,viewarea,context,urls,currentURLIndex);}\nelse\n{x3dom.debug.logError(\"Invalid SRC data, loaded from URL \\\"\"+\nurls[currentURLIndex]+\"\\\",\"+\" no other URLs left to try.\");}}}\nelse\n{if((currentURLIndex+1)<urls.length)\n{x3dom.debug.logWarning(\"Invalid SRC data, loaded from URL \\\"\"+\nurls[currentURLIndex]+\"\\\", trying next specified URL\");++currentURLIndex;ExternalGeometrySRC.updateRenderData(shape,shaderProgram,gl,viewarea,context,urls,currentURLIndex);}\nelse\n{x3dom.debug.logError(\"Invalid SRC data, loaded from URL \\\"\"+\nurls[currentURLIndex]+\"\\\",\"+\" no other URLs left to try.\");}}};},_updateRenderDataFromSRC:function(shape,shaderProgram,gl,srcHeaderObj,srcBodyView,x3domMesh)\n{shape.meshes=[];var MAX_NUM_BUFFERS_PER_DRAW=6;var indexViews=srcHeaderObj[\"accessors\"][\"indexViews\"];var indexViewID,indexView;var attributeViews=srcHeaderObj[\"accessors\"][\"attributeViews\"];var attributes;var attributeID,attributeView;var x3domTypeID,x3domShortTypeID,numComponents;var meshes=srcHeaderObj[\"meshes\"];var mesh,meshID;var meshIdx,bufferOffset;var viewIDsToGLBufferIDs={};var indexViewBufferIDs={};for(indexViewID in indexViews)\n{indexView=indexViews[indexViewID];indexViewBufferIDs[indexView[\"bufferView\"]]=true;}\nExternalGeometrySRC._createGLBuffersFromSRCChunks(gl,srcHeaderObj[\"bufferChunks\"],srcHeaderObj[\"bufferViews\"],srcBodyView,indexViewBufferIDs,viewIDsToGLBufferIDs);for(indexViewID in indexViews)\n{indexView=indexViews[indexViewID];if(indexView[\"componentType\"]!=gl.UNSIGNED_SHORT)\n{x3dom.debug.logWarning(\"SRC index componentType \"+indexView[\"componentType\"]+\" is not UNSIGNED_SHORT. \"+\"Ignoring given value and assuming UNSIGNED_SHORT indices.\");}\nshape._webgl.indexType=gl.UNSIGNED_SHORT;}\nmeshIdx=0;bufferOffset=0;x3domMesh._numCoords=0;x3domMesh._numFaces=0;for(meshID in meshes)\n{var renderMesh=new x3dom.glTF.glTFMesh();mesh=meshes[meshID];indexViewID=mesh[\"indices\"];if(indexViewID!=\"\")\n{shape._webgl.externalGeometry=1;indexView=indexViews[indexViewID];renderMesh.indexOffset=indexView[\"byteOffset\"];renderMesh.drawCount=indexView[\"count\"];renderMesh.numFaces=indexView[\"count\"]/3;x3domMesh._numFaces+=indexView[\"count\"]/3;renderMesh.buffers[x3dom.BUFFER_IDX.INDEX+bufferOffset]={};renderMesh.buffers[x3dom.BUFFER_IDX.INDEX+bufferOffset].offset=indexView[\"byteOffset\"];renderMesh.buffers[x3dom.BUFFER_IDX.INDEX+bufferOffset].type=indexView[\"componentType\"];renderMesh.buffers[x3dom.BUFFER_IDX.INDEX+bufferOffset].idx=viewIDsToGLBufferIDs[indexView[\"bufferView\"]];}\nelse\n{shape._webgl.externalGeometry=-1;}\nrenderMesh.primitiveType=mesh[\"primitive\"];attributes=mesh[\"attributes\"];for(attributeID in attributes)\n{attributeView=attributeViews[attributes[attributeID]];var idx=0;switch(attributeID)\n{case\"position\":x3domTypeID=\"coord\";x3domShortTypeID=\"Pos\";idx=x3dom.BUFFER_IDX.POSITION+bufferOffset;if(mesh[\"indices\"]==\"\")\n{renderMesh.drawCount[meshIdx]=attributeView[\"count\"];x3domMesh._numFaces+=attributeView[\"count\"]/3;renderMesh.numFaces=attributeView[\"count\"]/3;}\nx3domMesh._numCoords+=attributeView[\"count\"];break;case\"normal\":x3domTypeID=\"normal\";x3domShortTypeID=\"Norm\";idx=x3dom.BUFFER_IDX.NORMAL+bufferOffset;break;case\"texcoord\":x3domTypeID=\"texCoord\";x3domShortTypeID=\"Tex\";idx=x3dom.BUFFER_IDX.TEXCOORD+bufferOffset;break;case\"color\":x3domTypeID=\"color\";x3domShortTypeID=\"Col\";idx=x3dom.BUFFER_IDX.COLOR+bufferOffset;break;case\"id\":x3domTypeID=\"id\";x3domShortTypeID=\"Id\";idx=x3dom.BUFFER_IDX.ID+bufferOffset;shape._cf.geometry.node._vf.idsPerVertex=true;break;}\nshape[\"_\"+x3domTypeID+\"StrideOffset\"][0]=attributeView[\"byteStride\"];shape[\"_\"+x3domTypeID+\"StrideOffset\"][1]=attributeView[\"byteOffset\"];shape._webgl[x3domTypeID+\"Type\"]=attributeView[\"componentType\"];numComponents=ExternalGeometrySRC._findNumComponentsForSRCAccessorType(attributeView[\"type\"]);x3domMesh[\"_num\"+x3domShortTypeID+\"Components\"]=numComponents;renderMesh.buffers[idx]={};renderMesh.buffers[idx].idx=viewIDsToGLBufferIDs[attributeView[\"bufferView\"]];renderMesh.buffers[idx].offset=attributeView[\"byteOffset\"];renderMesh.buffers[idx].stride=attributeView[\"byteStride\"];renderMesh.buffers[idx].type=attributeView[\"componentType\"];renderMesh.buffers[idx].numComponents=numComponents;}\n++meshIdx;bufferOffset+=MAX_NUM_BUFFERS_PER_DRAW;shape.meshes.push(renderMesh);}\nshape._dirty.shader=true;shape._nameSpace.doc.needRender=true;x3dom.BinaryContainerLoader.checkError(gl);},_createGLBuffersFromSRCChunks:function(gl,bufferChunksObj,bufferViewsObj,srcBodyView,indexViewBufferIDs,viewIDsToGLBufferIDs)\n{var i;var bufferView;var chunkIDList;var bufferType;var chunk;var newBuffer;var chunkDataView;var currentChunkDataOffset;for(var bufferViewID in bufferViewsObj)\n{bufferType=(typeof indexViewBufferIDs[bufferViewID]!=='undefined')?gl.ELEMENT_ARRAY_BUFFER:gl.ARRAY_BUFFER;bufferView=bufferViewsObj[bufferViewID];chunkIDList=bufferView[\"chunks\"];if(chunkIDList.length==1)\n{chunk=bufferChunksObj[chunkIDList[0]];chunkDataView=new Uint8Array(srcBodyView.buffer,srcBodyView.byteOffset+chunk[\"byteOffset\"],chunk[\"byteLength\"]);newBuffer=gl.createBuffer();gl.bindBuffer(bufferType,newBuffer);gl.bufferData(bufferType,chunkDataView,gl.STATIC_DRAW);viewIDsToGLBufferIDs[bufferViewID]=newBuffer;}\nelse\n{newBuffer=gl.createBuffer();gl.bindBuffer(bufferType,newBuffer);gl.bufferData(bufferType,bufferView[\"byteLength\"],gl.STATIC_DRAW);currentChunkDataOffset=0;for(i=0;i<chunkIDList.length;++i)\n{chunk=bufferChunksObj[chunkIDList[i]];chunkDataView=new Uint8Array(srcBodyView.buffer,srcBodyView.byteOffset+chunk[\"byteOffset\"],chunk[\"byteLength\"]);gl.bufferSubData(bufferType,currentChunkDataOffset,chunkDataView);currentChunkDataOffset+=chunk[\"byteLength\"];}\nviewIDsToGLBufferIDs[bufferViewID]=newBuffer;}}},_findNumComponentsForSRCAccessorType:function(type)\n{switch(type)\n{case\"SCALAR\":return 1;case\"VEC2\":return 2;case\"VEC3\":return 3;case\"VEC4\":return 4;default:return 0;}}};x3dom.registerNodeType(\"X3DBinaryContainerGeometryNode\",\"Geometry3D\",defineClass(x3dom.nodeTypes.X3DSpatialGeometryNode,function(ctx){x3dom.nodeTypes.X3DBinaryContainerGeometryNode.superClass.call(this,ctx);this.addField_SFVec3f(ctx,'position',0,0,0);this.addField_SFVec3f(ctx,'size',1,1,1);this.addField_MFInt32(ctx,'vertexCount',[0]);this.addField_MFString(ctx,'primType',['TRIANGLES']);this._mesh._invalidate=false;this._mesh._numCoords=0;this._mesh._numFaces=0;this._diameter=this._vf.size.length();},{getMin:function(){var vol=this._mesh._vol;if(!vol.isValid()){vol.setBoundsByCenterSize(this._vf.position,this._vf.size);}\nreturn vol.min;},getMax:function(){var vol=this._mesh._vol;if(!vol.isValid()){vol.setBoundsByCenterSize(this._vf.position,this._vf.size);}\nreturn vol.max;},getVolume:function(){var vol=this._mesh._vol;if(!vol.isValid()){vol.setBoundsByCenterSize(this._vf.position,this._vf.size);}\nreturn vol;},invalidateVolume:function(){},getCenter:function(){return this._vf.position;},getDiameter:function(){return this._diameter;},needLighting:function(){var hasTris=(this._vf.primType.length&&this._vf.primType[0].indexOf(\"TRIANGLE\")>=0);return(this._vf.lit&&hasTris);}}));x3dom.registerNodeType(\"BinaryGeometry\",\"Geometry3D\",defineClass(x3dom.nodeTypes.X3DBinaryContainerGeometryNode,function(ctx){x3dom.nodeTypes.BinaryGeometry.superClass.call(this,ctx);this.addField_SFString(ctx,'index',\"\");this.addField_SFString(ctx,'coord',\"\");this.addField_SFString(ctx,'normal',\"\");this.addField_SFString(ctx,'texCoord',\"\");this.addField_SFString(ctx,'color',\"\");this.addField_SFString(ctx,'tangent',\"\");this.addField_SFString(ctx,'binormal',\"\");this.addField_SFString(ctx,'indexType',\"Uint16\");this.addField_SFString(ctx,'coordType',\"Float32\");this.addField_SFString(ctx,'normalType',\"Float32\");this.addField_SFString(ctx,'texCoordType',\"Float32\");this.addField_SFString(ctx,'colorType',\"Float32\");this.addField_SFString(ctx,'tangentType',\"Float32\");this.addField_SFString(ctx,'binormalType',\"Float32\");this.addField_SFBool(ctx,'normalAsSphericalCoordinates',false);this.addField_SFBool(ctx,'rgbaColors',false);this.addField_SFInt32(ctx,'numTexCoordComponents',2);this.addField_SFBool(ctx,'normalPerVertex',true);this.addField_SFBool(ctx,'idsPerVertex',false);this.addField_SFBool(ctx,'compressed',false);this._hasStrideOffset=false;this._mesh._numPosComponents=this._vf.normalAsSphericalCoordinates?4:3;this._mesh._numTexComponents=this._vf.numTexCoordComponents;this._mesh._numColComponents=this._vf.rgbaColors?4:3;this._mesh._numNormComponents=this._vf.normalAsSphericalCoordinates?2:3;this._vertexCountSum=0;for(var i=0;i<this._vf.vertexCount.length;++i){this._vertexCountSum+=this._vf.vertexCount[i];}},{parentAdded:function(parent)\n{var offsetInd,strideInd,offset,stride;offsetInd=this._vf.coord.lastIndexOf('#');strideInd=this._vf.coord.lastIndexOf('+');if(offsetInd>=0&&strideInd>=0){offset=+this._vf.coord.substring(++offsetInd,strideInd);stride=+this._vf.coord.substring(strideInd);parent._coordStrideOffset=[stride,offset];this._hasStrideOffset=true;if((offset/8)-Math.floor(offset/8)==0){this._mesh._numPosComponents=4;}}\nelse if(strideInd>=0){stride=+this._vf.coord.substring(strideInd);parent._coordStrideOffset=[stride,0];if((stride/8)-Math.floor(stride/8)==0){this._mesh._numPosComponents=4;}}\noffsetInd=this._vf.normal.lastIndexOf('#');strideInd=this._vf.normal.lastIndexOf('+');if(offsetInd>=0&&strideInd>=0){offset=+this._vf.normal.substring(++offsetInd,strideInd);stride=+this._vf.normal.substring(strideInd);parent._normalStrideOffset=[stride,offset];}\nelse if(strideInd>=0){stride=+this._vf.normal.substring(strideInd);parent._normalStrideOffset=[stride,0];}\noffsetInd=this._vf.texCoord.lastIndexOf('#');strideInd=this._vf.texCoord.lastIndexOf('+');if(offsetInd>=0&&strideInd>=0){offset=+this._vf.texCoord.substring(++offsetInd,strideInd);stride=+this._vf.texCoord.substring(strideInd);parent._texCoordStrideOffset=[stride,offset];}\nelse if(strideInd>=0){stride=+this._vf.texCoord.substring(strideInd);parent._texCoordStrideOffset=[stride,0];}\noffsetInd=this._vf.color.lastIndexOf('#');strideInd=this._vf.color.lastIndexOf('+');if(offsetInd>=0&&strideInd>=0){offset=+this._vf.color.substring(++offsetInd,strideInd);stride=+this._vf.color.substring(strideInd);parent._colorStrideOffset=[stride,offset];}\nelse if(strideInd>=0){stride=+this._vf.color.substring(strideInd);parent._colorStrideOffset=[stride,0];}\nif(this._vf.indexType!=\"Uint16\"&&!x3dom.caps.INDEX_UINT)\nx3dom.debug.logWarning(\"Index type \"+this._vf.indexType+\" problematic\");},doIntersect:function(line)\n{var min=this.getMin();var max=this.getMax();var isect=line.intersect(min,max);if(isect&&line.enter<line.dist){line.dist=line.enter;line.hitObject=this;line.hitPoint=line.pos.add(line.dir.multiply(line.enter));return true;}\nelse{return false;}},getPrecisionMax:function(type)\n{switch(this._vf[type])\n{case\"Int8\":return 127.0;case\"Uint8\":return 255.0;case\"Int16\":return 32767.0;case\"Uint16\":return 65535.0;case\"Int32\":return 2147483647.0;case\"Uint32\":return 4294967295.0;case\"Float32\":case\"Float64\":default:return 1.0;}}}));x3dom.registerNodeType(\"PopGeometryLevel\",\"Geometry3D\",defineClass(x3dom.nodeTypes.X3DGeometricPropertyNode,function(ctx){x3dom.nodeTypes.PopGeometryLevel.superClass.call(this,ctx);this.addField_SFString(ctx,'src',\"\");this.addField_SFInt32(ctx,'numIndices',0);this.addField_SFInt32(ctx,'vertexDataBufferOffset',0);},{getSrc:function(){return this._vf.src;},getNumIndices:function(){return this._vf.numIndices;},getVertexDataBufferOffset:function(){return this._vf.vertexDataBufferOffset;}}));x3dom.registerNodeType(\"PopGeometry\",\"Geometry3D\",defineClass(x3dom.nodeTypes.X3DBinaryContainerGeometryNode,function(ctx){x3dom.nodeTypes.PopGeometry.superClass.call(this,ctx);this.addField_SFVec3f(ctx,'tightSize',1,1,1);this.addField_SFVec3f(ctx,'maxBBSize',1,1,1);this.addField_SFVec3f(ctx,'bbMinModF',0,0,0);this.addField_SFVec3f(ctx,'bbMaxModF',1,1,1);this.addField_SFVec3f(ctx,'bbMin',0,0,0);this.addField_SFVec3f(ctx,'bbShiftVec',0,0,0);if(this._vf.bbMinModF.x>this._vf.bbMaxModF.x)\nthis._vf.bbShiftVec.x=1.0;if(this._vf.bbMinModF.y>this._vf.bbMaxModF.y)\nthis._vf.bbShiftVec.y=1.0;if(this._vf.bbMinModF.z>this._vf.bbMaxModF.z)\nthis._vf.bbShiftVec.z=1.0;this.addField_MFNode('levels',x3dom.nodeTypes.PopGeometryLevel);this.addField_SFInt32(ctx,'attributeStride',0);this.addField_SFInt32(ctx,'positionOffset',0);this.addField_SFInt32(ctx,'normalOffset',0);this.addField_SFInt32(ctx,'texcoordOffset',0);this.addField_SFInt32(ctx,'colorOffset',0);this.addField_SFInt32(ctx,'numAnchorVertices',0);this.addField_SFInt32(ctx,'positionPrecision',2);this.addField_SFInt32(ctx,'normalPrecision',1);this.addField_SFInt32(ctx,'texcoordPrecision',2);this.addField_SFInt32(ctx,'colorPrecision',1);this.addField_SFInt32(ctx,'minPrecisionLevel',-1);this.addField_SFInt32(ctx,'maxPrecisionLevel',-1);this.addField_SFFloat(ctx,'precisionFactor',1.0);this.addField_SFString(ctx,'coordType',\"Uint16\");this.addField_SFString(ctx,'normalType',\"Uint8\");this.addField_SFString(ctx,'texCoordType',\"Uint16\");this.addField_SFString(ctx,'colorType',\"Uint8\");this.addField_SFInt32(ctx,'vertexBufferSize',0);this.addField_SFBool(ctx,'indexedRendering',true);this.addField_SFBool(ctx,'sphericalNormals',false);this.addField_MFInt32(ctx,'originalVertexCount',[0]);for(var i=0;i<this._vf.vertexCount.length;++i){this._vf.originalVertexCount[i]=this._vf.vertexCount[i];}\nthis._vf.maxBBSize=x3dom.fields.SFVec3f.copy(this._vf.size);this._vf.size=this._vf.tightSize;this._diameter=this._vf.size.length();this._bbMinBySize=[Math.floor(this._vf.bbMin.x/this._vf.maxBBSize.x),Math.floor(this._vf.bbMin.y/this._vf.maxBBSize.y),Math.floor(this._vf.bbMin.z/this._vf.maxBBSize.z)];this._volRadius=this._vf.size.length()/2;this._volLargestRadius=this._vf.maxBBSize.length()/2;this._mesh._numPosComponents=this._vf.sphericalNormals?4:3;this._mesh._numNormComponents=this._vf.sphericalNormals?2:3;this._mesh._numTexComponents=2;this._mesh._numColComponents=3;x3dom.nodeTypes.PopGeometry.numTotalVerts+=this.getVertexCount();x3dom.nodeTypes.PopGeometry.numTotalTris+=(this.hasIndex()?this.getTotalNumberOfIndices():this.getVertexCount())/3;},{forceUpdateCoverage:function(){return true;},getBBoxShiftVec:function(){return this._vf.bbShiftVec;},getBBoxSize:function(){return this._vf.size;},hasIndex:function(){return this._vf.indexedRendering;},getTotalNumberOfIndices:function(){if(this._vf.indexedRendering){var sum=0;for(var i=0;i<this._vf.originalVertexCount.length;++i){sum+=this._vf.originalVertexCount[i];}\nreturn sum;}\nelse{return 0;}},getVertexCount:function(){var sum=0;for(var i=0;i<this._vf.originalVertexCount.length;++i){sum+=this._vf.originalVertexCount[i];}\nreturn sum;},adaptVertexCount:function(numVerts){var verts=0;for(var i=0;i<this._vf.originalVertexCount.length;++i){if((this._vf.originalVertexCount[i]+verts)<=numVerts){this._vf.vertexCount[i]=this._vf.originalVertexCount[i];verts+=this._vf.originalVertexCount[i];}\nelse{this._vf.vertexCount[i]=numVerts-verts;break;}}},hasNormal:function(){return(this._vf.normalOffset!=0)&&!this._vf.sphericalNormals;},hasTexCoord:function(){return(this._vf.texcoordOffset!=0);},hasColor:function(){return(this._vf.colorOffset!=0);},getPositionPrecision:function(){return this._vf.positionPrecision;},getNormalPrecision:function(){return this._vf.normalPrecision;},getTexCoordPrecision:function(){return this._vf.texcoordPrecision;},getColorPrecision:function(){return this._vf.colorPrecision;},getAttributeStride:function(){return this._vf.attributeStride;},getPositionOffset:function(){return this._vf.positionOffset;},getNormalOffset:function(){return this._vf.normalOffset;},getTexCoordOffset:function(){return this._vf.texcoordOffset;},getColorOffset:function(){return this._vf.colorOffset;},getBufferTypeStringFromByteCount:function(bytes){switch(bytes)\n{case 1:return\"Uint8\";case 2:return\"Uint16\";default:return 0;}},getDataURLs:function(){var urls=[];for(var i=0;i<this._cf.levels.nodes.length;++i){urls.push(this._cf.levels.nodes[i].getSrc());}\nreturn urls;},getNumIndicesByLevel:function(lvl){return this._cf.levels.nodes[lvl].getNumIndices();},getNumLevels:function(lvl){return this._cf.levels.nodes.length;},getVertexDataBufferOffset:function(lvl){return this._cf.levels.nodes[lvl].getVertexDataBufferOffset();},getPrecisionMax:function(type){switch(this._vf[type])\n{case\"Uint8\":return 255.0;case\"Uint16\":return 65535.0;default:return 1.0;}}}));x3dom.nodeTypes.PopGeometry.ErrorToleranceFactor=1;x3dom.nodeTypes.PopGeometry.PrecisionFactorOnMove=1;x3dom.nodeTypes.PopGeometry.numRenderedVerts=0;x3dom.nodeTypes.PopGeometry.numRenderedTris=0;x3dom.nodeTypes.PopGeometry.numTotalVerts=0;x3dom.nodeTypes.PopGeometry.numTotalTris=0;x3dom.nodeTypes.PopGeometry.powLUT=[32768,16384,8192,4096,2048,1024,512,256,128,64,32,16,8,4,2,1];x3dom.registerNodeType(\"ImageGeometry\",\"Geometry3D\",defineClass(x3dom.nodeTypes.X3DBinaryContainerGeometryNode,function(ctx){x3dom.nodeTypes.ImageGeometry.superClass.call(this,ctx);this.addField_SFVec2f(ctx,'implicitMeshSize',256,256);this.addField_SFInt32(ctx,'numColorComponents',3);this.addField_SFInt32(ctx,'numTexCoordComponents',2);this.addField_SFNode('index',x3dom.nodeTypes.X3DTextureNode);this.addField_MFNode('coord',x3dom.nodeTypes.X3DTextureNode);this.addField_SFNode('normal',x3dom.nodeTypes.X3DTextureNode);this.addField_SFNode('texCoord',x3dom.nodeTypes.X3DTextureNode);this.addField_SFNode('color',x3dom.nodeTypes.X3DTextureNode);this._mesh._numColComponents=this._vf.numColorComponents;this._mesh._numTexComponents=this._vf.numTexCoordComponents;if(this._vf.implicitMeshSize.y==0)\nthis._vf.implicitMeshSize.y=this._vf.implicitMeshSize.x;if(x3dom.caps.BACKEND=='webgl'&&x3dom.caps.MAX_VERTEX_TEXTURE_IMAGE_UNITS>0){var geoCacheID='ImageGeometry_'+this._vf.implicitMeshSize.x+'_'+this._vf.implicitMeshSize.y;if(this._vf.useGeoCache&&x3dom.geoCache[geoCacheID]!==undefined)\n{this._mesh=x3dom.geoCache[geoCacheID];}\nelse\n{for(var y=0;y<this._vf.implicitMeshSize.y;y++)\n{for(var x=0;x<this._vf.implicitMeshSize.x;x++)\n{this._mesh._positions[0].push(x/this._vf.implicitMeshSize.x,y/this._vf.implicitMeshSize.y,0);}}\nthis._mesh._numFaces=this._mesh._indices[0].length/3;this._mesh._numCoords=this._mesh._positions[0].length/3;x3dom.geoCache[geoCacheID]=this._mesh;}}\nthis._vol=new x3dom.fields.BoxVolume();this._dirty={coord:true,normal:true,texCoord:true,color:true,index:true};},{setGeoDirty:function(){this._dirty.coord=true;this._dirty.normal=true;this._dirty.texCoords=true;this._dirty.color=true;this._dirty.index=true;},unsetGeoDirty:function(){this._dirty.coord=false;this._dirty.normal=false;this._dirty.texCoords=false;this._dirty.color=false;this._dirty.index=false;},nodeChanged:function()\n{Array.forEach(this._parentNodes,function(node){node._dirty.positions=true;node._dirty.normals=true;node._dirty.texcoords=true;node._dirty.colors=true;});this._vol.invalidate();},fieldChanged:function(fieldName)\n{if(fieldName==\"index\"||fieldName==\"coord\"||fieldName==\"normal\"||fieldName==\"texCoord\"||fieldName==\"color\"){this._dirty[fieldName]=true;this._vol.invalidate();}\nelse if(fieldName==\"implicitMeshSize\"){this._vol.invalidate();}},getMin:function(){var vol=this._vol;if(!vol.isValid()){vol.setBoundsByCenterSize(this._vf.position,this._vf.size);}\nreturn vol.min;},getMax:function(){var vol=this._vol;if(!vol.isValid()){vol.setBoundsByCenterSize(this._vf.position,this._vf.size);}\nreturn vol.max;},getVolume:function(){var vol=this._vol;if(!vol.isValid()){vol.setBoundsByCenterSize(this._vf.position,this._vf.size);}\nreturn vol;},numCoordinateTextures:function()\n{return this._cf.coord.nodes.length;},getIndexTexture:function()\n{if(this._cf.index.node){this._cf.index.node._type=\"IG_index\";return this._cf.index.node;}else{return null;}},getIndexTextureURL:function()\n{if(this._cf.index.node){return this._cf.index.node._vf.url;}else{return null;}},getCoordinateTexture:function(pos)\n{if(this._cf.coord.nodes[pos]){this._cf.coord.nodes[pos]._type=\"IG_coords\"+pos;return this._cf.coord.nodes[pos];}else{return null;}},getCoordinateTextureURL:function(pos)\n{if(this._cf.coord.nodes[pos]){return this._cf.coord.nodes[pos]._vf.url;}else{return null;}},getCoordinateTextureURLs:function()\n{var urls=[];for(var i=0;i<this._cf.coord.nodes.length;i++)\n{urls.push(this._cf.coord.nodes[i]._vf.url);}\nreturn urls;},getNormalTexture:function()\n{if(this._cf.normal.node){this._cf.normal.node._type=\"IG_normals\";return this._cf.normal.node;}else{return null;}},getNormalTextureURL:function()\n{if(this._cf.normal.node){return this._cf.normal.node._vf.url;}else{return null;}},getTexCoordTexture:function()\n{if(this._cf.texCoord.node){this._cf.texCoord.node._type=\"IG_texCoords\";return this._cf.texCoord.node;}else{return null;}},getTexCoordTextureURL:function()\n{if(this._cf.texCoord.node){return this._cf.texCoord.node._vf.url;}else{return null;}},getColorTexture:function()\n{if(this._cf.color.node){this._cf.color.node._type=\"IG_colors\";return this._cf.color.node;}else{return null;}},getColorTextureURL:function()\n{if(this._cf.color.node){return this._cf.color.node._vf.url;}else{return null;}},getTextures:function()\n{var textures=[];var i,index=this.getIndexTexture();if(index)textures.push(index);for(i=0;i<this.numCoordinateTextures();i++){var coord=this.getCoordinateTexture(i);if(coord)textures.push(coord);}\nvar normal=this.getNormalTexture();if(normal)textures.push(normal);var texCoord=this.getTexCoordTexture();if(texCoord)textures.push(texCoord);var color=this.getColorTexture();if(color)textures.push(color);return textures;}}));x3dom.registerNodeType(\"IndexedFaceSet\",\"Geometry3D\",defineClass(x3dom.nodeTypes.X3DComposedGeometryNode,function(ctx){x3dom.nodeTypes.IndexedFaceSet.superClass.call(this,ctx);this.addField_SFFloat(ctx,'creaseAngle',0);this.addField_SFBool(ctx,'convex',true);this.addField_MFInt32(ctx,'coordIndex',[]);this.addField_MFInt32(ctx,'normalIndex',[]);this.addField_MFInt32(ctx,'colorIndex',[]);this.addField_MFInt32(ctx,'texCoordIndex',[]);},{nodeChanged:function()\n{var time0=new Date().getTime();this.handleAttribs();var indexes=this._vf.coordIndex;if(indexes.length&&indexes[indexes.length-1]!=-1)\n{indexes.push(-1);}\nvar normalInd=this._vf.normalIndex;var texCoordInd=this._vf.texCoordIndex;var colorInd=this._vf.colorIndex;var hasNormal=false,hasNormalInd=false;var hasTexCoord=false,hasTexCoordInd=false;var hasColor=false,hasColorInd=false;var colPerVert=this._vf.colorPerVertex;var normPerVert=this._vf.normalPerVertex;if(normalInd.length>0)\n{hasNormalInd=true;}\nif(texCoordInd.length>0)\n{hasTexCoordInd=true;}\nif(colorInd.length>0)\n{hasColorInd=true;}\nvar positions,normals,texCoords,colors;var coordNode=this._cf.coord.node;x3dom.debug.assert(coordNode);positions=coordNode.getPoints();var normalNode=this._cf.normal.node;if(normalNode)\n{hasNormal=true;normals=normalNode._vf.vector;}\nelse{hasNormal=false;}\nvar texMode=\"\",numTexComponents=2;var texCoordNode=this._cf.texCoord.node;if(x3dom.isa(texCoordNode,x3dom.nodeTypes.MultiTextureCoordinate)){if(texCoordNode._cf.texCoord.nodes.length)\ntexCoordNode=texCoordNode._cf.texCoord.nodes[0];}\nif(texCoordNode)\n{if(texCoordNode._vf.point){hasTexCoord=true;texCoords=texCoordNode._vf.point;if(!hasTexCoordInd)\n{var i,lastTexCoord=texCoords.length;for(i=lastTexCoord;i<positions.length;i++)\n{texCoords.push(texCoords[i%lastTexCoord]);}}\nif(x3dom.isa(texCoordNode,x3dom.nodeTypes.TextureCoordinate3D)){numTexComponents=3;}}\nelse if(texCoordNode._vf.mode){texMode=texCoordNode._vf.mode;}}\nelse{hasTexCoord=false;}\nthis._mesh._numTexComponents=numTexComponents;var numColComponents=3;var colorNode=this._cf.color.node;if(colorNode)\n{hasColor=true;colors=colorNode._vf.color;if(x3dom.isa(colorNode,x3dom.nodeTypes.ColorRGBA)){numColComponents=4;}}\nelse{hasColor=false;}\nthis._mesh._numColComponents=numColComponents;this._mesh._indices[0]=[];this._mesh._positions[0]=[];this._mesh._normals[0]=[];this._mesh._texCoords[0]=[];this._mesh._colors[0]=[];var i,j,t,cnt,faceCnt;var p0,p1,p2,n0,n1,n2,t0,t1,t2,c0,c1,c2;if((this._vf.creaseAngle<=x3dom.fields.Eps)||(positions.length>x3dom.Utils.maxIndexableCoords)||(hasNormal&&hasNormalInd)||(hasTexCoord&&hasTexCoordInd)||(hasColor&&hasColorInd))\n{if(this._vf.creaseAngle<=x3dom.fields.Eps)\nx3dom.debug.logWarning('Fallback to inefficient multi-index mode since creaseAngle=0.');if(this._vf.convex){t=0;cnt=0;faceCnt=0;this._mesh._multiIndIndices=[];this._mesh._posSize=positions.length;for(i=0;i<indexes.length;++i)\n{if(indexes[i]==-1){t=0;faceCnt++;continue;}\nif(hasNormalInd){x3dom.debug.assert(normalInd[i]!=-1);}\nif(hasTexCoordInd){x3dom.debug.assert(texCoordInd[i]!=-1);}\nif(hasColorInd){x3dom.debug.assert(colorInd[i]!=-1);}\nswitch(t)\n{case 0:p0=+indexes[i];if(hasNormalInd&&normPerVert){n0=+normalInd[i];}\nelse if(hasNormalInd&&!normPerVert){n0=+normalInd[faceCnt];}\nelse if(normPerVert){n0=p0;}\nelse{n0=faceCnt;}\nif(hasTexCoordInd){t0=+texCoordInd[i];}\nelse{t0=p0;}\nif(hasColorInd&&colPerVert){c0=+colorInd[i];}\nelse if(hasColorInd&&!colPerVert){c0=+colorInd[faceCnt];}\nelse if(colPerVert){c0=p0;}\nelse{c0=faceCnt;}\nt=1;break;case 1:p1=+indexes[i];if(hasNormalInd&&normPerVert){n1=+normalInd[i];}\nelse if(hasNormalInd&&!normPerVert){n1=+normalInd[faceCnt];}\nelse if(normPerVert){n1=p1;}\nelse{n1=faceCnt;}\nif(hasTexCoordInd){t1=+texCoordInd[i];}\nelse{t1=p1;}\nif(hasColorInd&&colPerVert){c1=+colorInd[i];}\nelse if(hasColorInd&&!colPerVert){c1=+colorInd[faceCnt];}\nelse if(colPerVert){c1=p1;}\nelse{c1=faceCnt;}\nt=2;break;case 2:p2=+indexes[i];if(hasNormalInd&&normPerVert){n2=+normalInd[i];}\nelse if(hasNormalInd&&!normPerVert){n2=+normalInd[faceCnt];}\nelse if(normPerVert){n2=p2;}\nelse{n2=faceCnt;}\nif(hasTexCoordInd){t2=+texCoordInd[i];}\nelse{t2=p2;}\nif(hasColorInd&&colPerVert){c2=+colorInd[i];}\nelse if(hasColorInd&&!colPerVert){c2=+colorInd[faceCnt];}\nelse if(colPerVert){c2=p2;}\nelse{c2=faceCnt;}\nt=3;this._mesh._positions[0].push(positions[p0].x);this._mesh._positions[0].push(positions[p0].y);this._mesh._positions[0].push(positions[p0].z);this._mesh._positions[0].push(positions[p1].x);this._mesh._positions[0].push(positions[p1].y);this._mesh._positions[0].push(positions[p1].z);this._mesh._positions[0].push(positions[p2].x);this._mesh._positions[0].push(positions[p2].y);this._mesh._positions[0].push(positions[p2].z);if(hasNormal){this._mesh._normals[0].push(normals[n0].x);this._mesh._normals[0].push(normals[n0].y);this._mesh._normals[0].push(normals[n0].z);this._mesh._normals[0].push(normals[n1].x);this._mesh._normals[0].push(normals[n1].y);this._mesh._normals[0].push(normals[n1].z);this._mesh._normals[0].push(normals[n2].x);this._mesh._normals[0].push(normals[n2].y);this._mesh._normals[0].push(normals[n2].z);}\nthis._mesh._multiIndIndices.push(p0,p1,p2);if(hasColor){this._mesh._colors[0].push(colors[c0].r);this._mesh._colors[0].push(colors[c0].g);this._mesh._colors[0].push(colors[c0].b);if(numColComponents===4){this._mesh._colors[0].push(colors[c0].a);}\nthis._mesh._colors[0].push(colors[c1].r);this._mesh._colors[0].push(colors[c1].g);this._mesh._colors[0].push(colors[c1].b);if(numColComponents===4){this._mesh._colors[0].push(colors[c1].a);}\nthis._mesh._colors[0].push(colors[c2].r);this._mesh._colors[0].push(colors[c2].g);this._mesh._colors[0].push(colors[c2].b);if(numColComponents===4){this._mesh._colors[0].push(colors[c2].a);}}\nif(hasTexCoord){this._mesh._texCoords[0].push(texCoords[t0].x);this._mesh._texCoords[0].push(texCoords[t0].y);if(numTexComponents===3){this._mesh._texCoords[0].push(texCoords[t0].z);}\nthis._mesh._texCoords[0].push(texCoords[t1].x);this._mesh._texCoords[0].push(texCoords[t1].y);if(numTexComponents===3){this._mesh._texCoords[0].push(texCoords[t1].z);}\nthis._mesh._texCoords[0].push(texCoords[t2].x);this._mesh._texCoords[0].push(texCoords[t2].y);if(numTexComponents===3){this._mesh._texCoords[0].push(texCoords[t2].z);}}\nbreak;case 3:p1=p2;t1=t2;if(normPerVert){n1=n2;}\nif(colPerVert){c1=c2;}\np2=+indexes[i];if(hasNormalInd&&normPerVert){n2=+normalInd[i];}else if(hasNormalInd&&!normPerVert){}else if(normPerVert){n2=p2;}else{n2=faceCnt;}\nif(hasTexCoordInd){t2=+texCoordInd[i];}else{t2=p2;}\nif(hasColorInd&&colPerVert){c2=+colorInd[i];}else if(hasColorInd&&!colPerVert){}else if(colPerVert){c2=p2;}else{c2=faceCnt;}\nthis._mesh._positions[0].push(positions[p0].x);this._mesh._positions[0].push(positions[p0].y);this._mesh._positions[0].push(positions[p0].z);this._mesh._positions[0].push(positions[p1].x);this._mesh._positions[0].push(positions[p1].y);this._mesh._positions[0].push(positions[p1].z);this._mesh._positions[0].push(positions[p2].x);this._mesh._positions[0].push(positions[p2].y);this._mesh._positions[0].push(positions[p2].z);if(hasNormal){this._mesh._normals[0].push(normals[n0].x);this._mesh._normals[0].push(normals[n0].y);this._mesh._normals[0].push(normals[n0].z);this._mesh._normals[0].push(normals[n1].x);this._mesh._normals[0].push(normals[n1].y);this._mesh._normals[0].push(normals[n1].z);this._mesh._normals[0].push(normals[n2].x);this._mesh._normals[0].push(normals[n2].y);this._mesh._normals[0].push(normals[n2].z);}\nthis._mesh._multiIndIndices.push(p0,p1,p2);if(hasColor){this._mesh._colors[0].push(colors[c0].r);this._mesh._colors[0].push(colors[c0].g);this._mesh._colors[0].push(colors[c0].b);if(numColComponents===4){this._mesh._colors[0].push(colors[c0].a);}\nthis._mesh._colors[0].push(colors[c1].r);this._mesh._colors[0].push(colors[c1].g);this._mesh._colors[0].push(colors[c1].b);if(numColComponents===4){this._mesh._colors[0].push(colors[c1].a);}\nthis._mesh._colors[0].push(colors[c2].r);this._mesh._colors[0].push(colors[c2].g);this._mesh._colors[0].push(colors[c2].b);if(numColComponents===4){this._mesh._colors[0].push(colors[c2].a);}}\nif(hasTexCoord){this._mesh._texCoords[0].push(texCoords[t0].x);this._mesh._texCoords[0].push(texCoords[t0].y);if(numTexComponents===3){this._mesh._texCoords[0].push(texCoords[t0].z);}\nthis._mesh._texCoords[0].push(texCoords[t1].x);this._mesh._texCoords[0].push(texCoords[t1].y);if(numTexComponents===3){this._mesh._texCoords[0].push(texCoords[t1].z);}\nthis._mesh._texCoords[0].push(texCoords[t2].x);this._mesh._texCoords[0].push(texCoords[t2].y);if(numTexComponents===3){this._mesh._texCoords[0].push(texCoords[t2].z);}}\nbreak;default:}}}\nelse{var linklist=new x3dom.DoublyLinkedList();var data={};cnt=0;faceCnt=0;for(i=0;i<indexes.length;++i)\n{if(indexes[i]==-1){var multi_index_data=x3dom.EarClipping.getMultiIndexes(linklist);for(j=0;j<multi_index_data.indices.length;j++)\n{this._mesh._indices[0].push(cnt);cnt++;this._mesh._positions[0].push(multi_index_data.point[j].x,multi_index_data.point[j].y,multi_index_data.point[j].z);if(hasNormal){this._mesh._normals[0].push(multi_index_data.normals[j].x,multi_index_data.normals[j].y,multi_index_data.normals[j].z);}\nif(hasColor){this._mesh._colors[0].push(multi_index_data.colors[j].r,multi_index_data.colors[j].g,multi_index_data.colors[j].b);if(numColComponents===4){this._mesh._colors[0].push(multi_index_data.colors[j].a);}}\nif(hasTexCoord){this._mesh._texCoords[0].push(multi_index_data.texCoords[j].x,multi_index_data.texCoords[j].y);if(numTexComponents===3){this._mesh._texCoords[0].push(multi_index_data.texCoords[j].z);}}}\nlinklist=new x3dom.DoublyLinkedList();faceCnt++;continue;}\nif(hasNormal){if(hasNormalInd&&normPerVert){data.normals=normals[normalInd[i]];}else if(hasNormalInd&&!normPerVert){data.normals=normals[normalInd[faceCnt]];}else{data.normals=normals[indexes[i]];}}\nif(hasColor){if(hasColorInd&&colPerVert){data.colors=colors[colorInd[i]];}else if(hasColorInd&&!colPerVert){data.colors=colors[colorInd[faceCnt]];}else if(colPerVert){data.colors=colors[indexes[i]];}else{data.colors=colors[faceCnt];}}\nif(hasTexCoord){if(hasTexCoordInd){data.texCoords=texCoords[texCoordInd[i]];}else{data.texCoords=texCoords[indexes[i]];}}\nlinklist.appendNode(new x3dom.DoublyLinkedList.ListNode(positions[indexes[i]],indexes[i],data.normals,data.colors,data.texCoords));}\nthis._mesh.splitMesh();}\nif(!hasNormal){this._mesh.calcNormals(this._vf.creaseAngle,this._vf.ccw);}\nif(!hasTexCoord){this._mesh.calcTexCoords(texMode);}}\nelse\n{t=0;if(this._vf.convex){for(i=0;i<indexes.length;++i)\n{if(indexes[i]==-1){t=0;continue;}\nswitch(t){case 0:n0=+indexes[i];t=1;break;case 1:n1=+indexes[i];t=2;break;case 2:n2=+indexes[i];t=3;this._mesh._indices[0].push(n0,n1,n2);break;case 3:n1=n2;n2=+indexes[i];this._mesh._indices[0].push(n0,n1,n2);break;}}}\nelse{linklist=new x3dom.DoublyLinkedList();for(i=0;i<indexes.length;++i)\n{if(indexes[i]==-1){var linklist_indices=x3dom.EarClipping.getIndexes(linklist);for(j=0;j<linklist_indices.length;j++){this._mesh._indices[0].push(linklist_indices[j]);}\nlinklist=new x3dom.DoublyLinkedList();continue;}\nlinklist.appendNode(new x3dom.DoublyLinkedList.ListNode(positions[indexes[i]],indexes[i]));}}\nthis._mesh._positions[0]=positions.toGL();if(hasNormal){this._mesh._normals[0]=normals.toGL();}\nelse{this._mesh.calcNormals(this._vf.creaseAngle,this._vf.ccw);}\nif(hasTexCoord){this._mesh._texCoords[0]=texCoords.toGL();this._mesh._numTexComponents=numTexComponents;}\nelse{this._mesh.calcTexCoords(texMode);}\nif(hasColor){this._mesh._colors[0]=colors.toGL();this._mesh._numColComponents=numColComponents;}}\nthis.invalidateVolume();this._mesh._numFaces=0;this._mesh._numCoords=0;for(i=0;i<this._mesh._positions.length;i++){var indexLength=this._mesh._indices[i].length;var numCoords=this._mesh._positions[i].length/3;this._mesh._numCoords+=numCoords;if(indexLength>0)\nthis._mesh._numFaces+=indexLength/3;else\nthis._mesh._numFaces+=numCoords/3;}},fieldChanged:function(fieldName)\n{if(fieldName!=\"coord\"&&fieldName!=\"normal\"&&fieldName!=\"texCoord\"&&fieldName!=\"color\"&&fieldName!=\"coordIndex\")\n{x3dom.debug.logWarning(\"IndexedFaceSet: fieldChanged for \"+\nfieldName+\" not yet implemented!\");return;}\nvar pnts=this._cf.coord.node._vf.point;var n=pnts.length;var texCoordNode=this._cf.texCoord.node;if(x3dom.isa(texCoordNode,x3dom.nodeTypes.MultiTextureCoordinate)){if(texCoordNode._cf.texCoord.nodes.length)\ntexCoordNode=texCoordNode._cf.texCoord.nodes[0];}\nif(((this._vf.creaseAngle<=x3dom.fields.Eps)||(n>x3dom.Utils.maxIndexableCoords)||(this._vf.normalIndex.length>0&&this._cf.normal.node)||(this._vf.texCoordIndex.length>0&&texCoordNode)||(this._vf.colorIndex.length>0&&this._cf.color.node))&&this._mesh._multiIndIndices)\n{var needNormals=!this._cf.normal.node&&this._vf.normalUpdateMode.toLowerCase()!='none';n=this._mesh._multiIndIndices.length;this._mesh._positions[0]=[];this._mesh._indices[0]=[];if(fieldName==\"coord\"&&n)\n{if(needNormals){this._mesh._normals[0]=[];}\nfor(i=0;i<n;i+=3){var ind0=this._mesh._multiIndIndices[i];var ind1=this._mesh._multiIndIndices[i+1];var ind2=this._mesh._multiIndIndices[i+2];var pos0=pnts[ind0];var pos1=pnts[ind1];var pos2=pnts[ind2];this._mesh._positions[0].push(pos0.x,pos0.y,pos0.z);this._mesh._positions[0].push(pos1.x,pos1.y,pos1.z);this._mesh._positions[0].push(pos2.x,pos2.y,pos2.z);if(needNormals){var a=pos0.subtract(pos1);var b=pos1.subtract(pos2);var norm=a.cross(b).normalize();if(!this._vf.ccw)\nnorm=norm.negate();this._mesh._normals[0].push(norm.x,norm.y,norm.z);this._mesh._normals[0].push(norm.x,norm.y,norm.z);this._mesh._normals[0].push(norm.x,norm.y,norm.z);}}\nthis.invalidateVolume();Array.forEach(this._parentNodes,function(node){node._dirty.positions=true;if(needNormals)\nnode._dirty.normals=true;});return;}\nthis._mesh._normals[0]=[];this._mesh._texCoords[0]=[];this._mesh._colors[0]=[];var indexes=this._vf.coordIndex;var normalInd=this._vf.normalIndex;var texCoordInd=this._vf.texCoordIndex;var colorInd=this._vf.colorIndex;var hasNormal=false,hasNormalInd=false;var hasTexCoord=false,hasTexCoordInd=false;var hasColor=false,hasColorInd=false;var colPerVert=this._vf.colorPerVertex;var normPerVert=this._vf.normalPerVertex;if(normalInd.length>0)\n{hasNormalInd=true;}\nif(texCoordInd.length>0)\n{hasTexCoordInd=true;}\nif(colorInd.length>0)\n{hasColorInd=true;}\nvar positions,normals,texCoords,colors;var coordNode=this._cf.coord.node;x3dom.debug.assert(coordNode);positions=coordNode.getPoints();var normalNode=this._cf.normal.node;if(normalNode)\n{hasNormal=true;normals=normalNode._vf.vector;}\nelse{hasNormal=false;}\nvar texMode=\"\",numTexComponents=2;texCoordNode=this._cf.texCoord.node;if(x3dom.isa(texCoordNode,x3dom.nodeTypes.MultiTextureCoordinate)){if(texCoordNode._cf.texCoord.nodes.length)\ntexCoordNode=texCoordNode._cf.texCoord.nodes[0];}\nif(texCoordNode)\n{if(texCoordNode._vf.point){hasTexCoord=true;texCoords=texCoordNode._vf.point;if(!hasTexCoordInd)\n{var i,lastTexCoord=texCoords.length;for(i=lastTexCoord;i<positions.length;i++)\n{texCoords.push(texCoords[i%lastTexCoord]);}}\nif(x3dom.isa(texCoordNode,x3dom.nodeTypes.TextureCoordinate3D)){numTexComponents=3;}}\nelse if(texCoordNode._vf.mode){texMode=texCoordNode._vf.mode;}}\nelse{hasTexCoord=false;}\nthis._mesh._numTexComponents=numTexComponents;var numColComponents=3;var colorNode=this._cf.color.node;if(colorNode)\n{hasColor=true;colors=colorNode._vf.color;if(x3dom.isa(colorNode,x3dom.nodeTypes.ColorRGBA)){numColComponents=4;}}\nelse{hasColor=false;}\nthis._mesh._numColComponents=numColComponents;var i,j,t,cnt,faceCnt;var p0,p1,p2,n0,n1,n2,t0,t1,t2,c0,c1,c2;if(this._vf.convex){t=0;cnt=0;faceCnt=0;this._mesh._multiIndIndices=[];this._mesh._posSize=positions.length;for(i=0;i<indexes.length;++i)\n{if(indexes[i]==-1){t=0;faceCnt++;continue;}\nif(hasNormalInd){x3dom.debug.assert(normalInd[i]!=-1);}\nif(hasTexCoordInd){x3dom.debug.assert(texCoordInd[i]!=-1);}\nif(hasColorInd){x3dom.debug.assert(colorInd[i]!=-1);}\nswitch(t)\n{case 0:p0=+indexes[i];if(hasNormalInd&&normPerVert){n0=+normalInd[i];}\nelse if(hasNormalInd&&!normPerVert){n0=+normalInd[faceCnt];}\nelse if(normPerVert){n0=p0;}\nelse{n0=faceCnt;}\nif(hasTexCoordInd){t0=+texCoordInd[i];}\nelse{t0=p0;}\nif(hasColorInd&&colPerVert){c0=+colorInd[i];}\nelse if(hasColorInd&&!colPerVert){c0=+colorInd[faceCnt];}\nelse if(colPerVert){c0=p0;}\nelse{c0=faceCnt;}\nt=1;break;case 1:p1=+indexes[i];if(hasNormalInd&&normPerVert){n1=+normalInd[i];}\nelse if(hasNormalInd&&!normPerVert){n1=+normalInd[faceCnt];}\nelse if(normPerVert){n1=p1;}\nelse{n1=faceCnt;}\nif(hasTexCoordInd){t1=+texCoordInd[i];}\nelse{t1=p1;}\nif(hasColorInd&&colPerVert){c1=+colorInd[i];}\nelse if(hasColorInd&&!colPerVert){c1=+colorInd[faceCnt];}\nelse if(colPerVert){c1=p1;}\nelse{c1=faceCnt;}\nt=2;break;case 2:p2=+indexes[i];if(hasNormalInd&&normPerVert){n2=+normalInd[i];}\nelse if(hasNormalInd&&!normPerVert){n2=+normalInd[faceCnt];}\nelse if(normPerVert){n2=p2;}\nelse{n2=faceCnt;}\nif(hasTexCoordInd){t2=+texCoordInd[i];}\nelse{t2=p2;}\nif(hasColorInd&&colPerVert){c2=+colorInd[i];}\nelse if(hasColorInd&&!colPerVert){c2=+colorInd[faceCnt];}\nelse if(colPerVert){c2=p2;}\nelse{c2=faceCnt;}\nt=3;this._mesh._positions[0].push(positions[p0].x);this._mesh._positions[0].push(positions[p0].y);this._mesh._positions[0].push(positions[p0].z);this._mesh._positions[0].push(positions[p1].x);this._mesh._positions[0].push(positions[p1].y);this._mesh._positions[0].push(positions[p1].z);this._mesh._positions[0].push(positions[p2].x);this._mesh._positions[0].push(positions[p2].y);this._mesh._positions[0].push(positions[p2].z);if(hasNormal){this._mesh._normals[0].push(normals[n0].x);this._mesh._normals[0].push(normals[n0].y);this._mesh._normals[0].push(normals[n0].z);this._mesh._normals[0].push(normals[n1].x);this._mesh._normals[0].push(normals[n1].y);this._mesh._normals[0].push(normals[n1].z);this._mesh._normals[0].push(normals[n2].x);this._mesh._normals[0].push(normals[n2].y);this._mesh._normals[0].push(normals[n2].z);}\nthis._mesh._multiIndIndices.push(p0,p1,p2);if(hasColor){this._mesh._colors[0].push(colors[c0].r);this._mesh._colors[0].push(colors[c0].g);this._mesh._colors[0].push(colors[c0].b);if(numColComponents===4){this._mesh._colors[0].push(colors[c0].a);}\nthis._mesh._colors[0].push(colors[c1].r);this._mesh._colors[0].push(colors[c1].g);this._mesh._colors[0].push(colors[c1].b);if(numColComponents===4){this._mesh._colors[0].push(colors[c1].a);}\nthis._mesh._colors[0].push(colors[c2].r);this._mesh._colors[0].push(colors[c2].g);this._mesh._colors[0].push(colors[c2].b);if(numColComponents===4){this._mesh._colors[0].push(colors[c2].a);}}\nif(hasTexCoord){this._mesh._texCoords[0].push(texCoords[t0].x);this._mesh._texCoords[0].push(texCoords[t0].y);if(numTexComponents===3){this._mesh._texCoords[0].push(texCoords[t0].z);}\nthis._mesh._texCoords[0].push(texCoords[t1].x);this._mesh._texCoords[0].push(texCoords[t1].y);if(numTexComponents===3){this._mesh._texCoords[0].push(texCoords[t1].z);}\nthis._mesh._texCoords[0].push(texCoords[t2].x);this._mesh._texCoords[0].push(texCoords[t2].y);if(numTexComponents===3){this._mesh._texCoords[0].push(texCoords[t2].z);}}\nbreak;case 3:p1=p2;t1=t2;if(normPerVert){n1=n2;}\nif(colPerVert){c1=c2;}\np2=+indexes[i];if(hasNormalInd&&normPerVert){n2=+normalInd[i];}else if(hasNormalInd&&!normPerVert){}else if(normPerVert){n2=p2;}else{n2=faceCnt;}\nif(hasTexCoordInd){t2=+texCoordInd[i];}else{t2=p2;}\nif(hasColorInd&&colPerVert){c2=+colorInd[i];}else if(hasColorInd&&!colPerVert){}else if(colPerVert){c2=p2;}else{c2=faceCnt;}\nthis._mesh._positions[0].push(positions[p0].x);this._mesh._positions[0].push(positions[p0].y);this._mesh._positions[0].push(positions[p0].z);this._mesh._positions[0].push(positions[p1].x);this._mesh._positions[0].push(positions[p1].y);this._mesh._positions[0].push(positions[p1].z);this._mesh._positions[0].push(positions[p2].x);this._mesh._positions[0].push(positions[p2].y);this._mesh._positions[0].push(positions[p2].z);if(hasNormal){this._mesh._normals[0].push(normals[n0].x);this._mesh._normals[0].push(normals[n0].y);this._mesh._normals[0].push(normals[n0].z);this._mesh._normals[0].push(normals[n1].x);this._mesh._normals[0].push(normals[n1].y);this._mesh._normals[0].push(normals[n1].z);this._mesh._normals[0].push(normals[n2].x);this._mesh._normals[0].push(normals[n2].y);this._mesh._normals[0].push(normals[n2].z);}\nthis._mesh._multiIndIndices.push(p0,p1,p2);if(hasColor){this._mesh._colors[0].push(colors[c0].r);this._mesh._colors[0].push(colors[c0].g);this._mesh._colors[0].push(colors[c0].b);if(numColComponents===4){this._mesh._colors[0].push(colors[c0].a);}\nthis._mesh._colors[0].push(colors[c1].r);this._mesh._colors[0].push(colors[c1].g);this._mesh._colors[0].push(colors[c1].b);if(numColComponents===4){this._mesh._colors[0].push(colors[c1].a);}\nthis._mesh._colors[0].push(colors[c2].r);this._mesh._colors[0].push(colors[c2].g);this._mesh._colors[0].push(colors[c2].b);if(numColComponents===4){this._mesh._colors[0].push(colors[c2].a);}}\nif(hasTexCoord){this._mesh._texCoords[0].push(texCoords[t0].x);this._mesh._texCoords[0].push(texCoords[t0].y);if(numTexComponents===3){this._mesh._texCoords[0].push(texCoords[t0].z);}\nthis._mesh._texCoords[0].push(texCoords[t1].x);this._mesh._texCoords[0].push(texCoords[t1].y);if(numTexComponents===3){this._mesh._texCoords[0].push(texCoords[t1].z);}\nthis._mesh._texCoords[0].push(texCoords[t2].x);this._mesh._texCoords[0].push(texCoords[t2].y);if(numTexComponents===3){this._mesh._texCoords[0].push(texCoords[t2].z);}}\nbreak;default:}}}\nelse{var linklist=new x3dom.DoublyLinkedList();var data={};cnt=0;faceCnt=0;for(i=0;i<indexes.length;++i)\n{if(indexes[i]==-1){var multi_index_data=x3dom.EarClipping.getMultiIndexes(linklist);for(j=0;j<multi_index_data.indices.length;j++)\n{this._mesh._indices[0].push(cnt);cnt++;this._mesh._positions[0].push(multi_index_data.point[j].x,multi_index_data.point[j].y,multi_index_data.point[j].z);if(hasNormal){this._mesh._normals[0].push(multi_index_data.normals[j].x,multi_index_data.normals[j].y,multi_index_data.normals[j].z);}\nif(hasColor){this._mesh._colors[0].push(multi_index_data.colors[j].r,multi_index_data.colors[j].g,multi_index_data.colors[j].b);if(numColComponents===4){this._mesh._colors[0].push(multi_index_data.colors[j].a);}}\nif(hasTexCoord){this._mesh._texCoords[0].push(multi_index_data.texCoords[j].x,multi_index_data.texCoords[j].y);if(numTexComponents===3){this._mesh._texCoords[0].push(multi_index_data.texCoords[j].z);}}}\nlinklist=new x3dom.DoublyLinkedList();faceCnt++;continue;}\nif(hasNormal){if(hasNormalInd&&normPerVert){data.normals=normals[normalInd[i]];}else if(hasNormalInd&&!normPerVert){data.normals=normals[normalInd[faceCnt]];}else{data.normals=normals[indexes[i]];}}\nif(hasColor){if(hasColorInd&&colPerVert){data.colors=colors[colorInd[i]];}else if(hasColorInd&&!colPerVert){data.colors=colors[colorInd[faceCnt]];}else{data.colors=colors[indexes[i]];}}\nif(hasTexCoord){if(hasTexCoordInd){data.texCoords=texCoords[texCoordInd[i]];}else{data.texCoords=texCoords[indexes[i]];}}\nlinklist.appendNode(new x3dom.DoublyLinkedList.ListNode(positions[indexes[i]],indexes[i],data.normals,data.colors,data.texCoords));}\nthis._mesh.splitMesh();}\nif(!hasNormal){this._mesh.calcNormals(this._vf.creaseAngle,this._vf.ccw);}\nif(!hasTexCoord){this._mesh.calcTexCoords(texMode);}\nthis.invalidateVolume();this._mesh._numFaces=0;this._mesh._numCoords=0;for(i=0;i<this._mesh._positions.length;i++){var indexLength=this._mesh._indices[i].length;var numCoords=this._mesh._positions[i].length/3;this._mesh._numCoords+=numCoords;if(indexLength>0)\nthis._mesh._numFaces+=indexLength/3;else\nthis._mesh._numFaces+=numCoords/3;}\nArray.forEach(this._parentNodes,function(node){node.setGeoDirty();});}\nelse{if(fieldName==\"coord\")\n{var needNormals=!this._cf.normal.node&&this._vf.normalUpdateMode.toLowerCase()!='none';this._mesh._positions[0]=pnts.toGL();if(needNormals){this._mesh.calcNormals(this._vf.creaseAngle,this._vf.ccw);}\nthis.invalidateVolume();Array.forEach(this._parentNodes,function(node){node._dirty.positions=true;if(needNormals)\nnode._dirty.normals=true;node.invalidateVolume();});}\nelse if(fieldName==\"color\")\n{pnts=this._cf.color.node._vf.color;this._mesh._colors[0]=pnts.toGL();Array.forEach(this._parentNodes,function(node){node._dirty.colors=true;});}\nelse if(fieldName==\"normal\")\n{pnts=this._cf.normal.node._vf.vector;this._mesh._normals[0]=pnts.toGL();Array.forEach(this._parentNodes,function(node){node._dirty.normals=true;});}\nelse if(fieldName==\"texCoord\")\n{texCoordNode=this._cf.texCoord.node;if(x3dom.isa(texCoordNode,x3dom.nodeTypes.MultiTextureCoordinate)){if(texCoordNode._cf.texCoord.nodes.length)\ntexCoordNode=texCoordNode._cf.texCoord.nodes[0];}\npnts=texCoordNode._vf.point;this._mesh._texCoords[0]=pnts.toGL();Array.forEach(this._parentNodes,function(node){node._dirty.texcoords=true;});}\nelse if(fieldName==\"coordIndex\")\n{needNormals=!this._cf.normal.node&&this._vf.normalUpdateMode.toLowerCase()!='none';indexes=this._vf.coordIndex;t=0;n=indexes.length;this._mesh._indices[0]=[];for(i=0;i<n;++i){if(indexes[i]==-1){t=0;}\nelse{switch(t){case 0:p0=+indexes[i];t=1;break;case 1:p1=+indexes[i];t=2;break;case 2:p2=+indexes[i];t=3;this._mesh._indices[0].push(p0,p1,p2);break;case 3:p1=p2;p2=+indexes[i];this._mesh._indices[0].push(p0,p1,p2);break;}}}\nif(needNormals){this._mesh.calcNormals(this._vf.creaseAngle,this._vf.ccw);}\nArray.forEach(this._parentNodes,function(node){node._dirty.indexes=true;if(needNormals)\nnode._dirty.normals=true;});}}}}));x3dom.registerNodeType(\"BufferGeometry\",\"Geometry3D\",defineClass(x3dom.nodeTypes.X3DBinaryContainerGeometryNode,function(ctx){x3dom.nodeTypes.BufferGeometry.superClass.call(this,ctx);this.addField_SFString(ctx,'buffer',\"\");this.addField_MFNode('views',x3dom.nodeTypes.BufferView);this.addField_MFNode('accessors',x3dom.nodeTypes.BufferAccessor);this._hasColor=false;this._hasMultiTexCoord=false;this._indexed=false;},{parentAdded:function(parent)\n{},nodeChanged:function()\n{},doIntersect:function(line)\n{var min=this.getMin();var max=this.getMax();var isect=line.intersect(min,max);if(isect&&line.enter<line.dist){line.dist=line.enter;line.hitObject=this;line.hitPoint=line.pos.add(line.dir.multiply(line.enter));return true;}\nelse{return false;}},hasColor:function(){return this._hasColor;},hasMultiTexCoord:function(){return this._hasMultiTexCoord;},getPrecisionMax:function(type)\n{switch(this._vf[type])\n{case\"Int8\":return 127.0;case\"Uint8\":return 255.0;case\"Int16\":return 32767.0;case\"Uint16\":return 65535.0;case\"Int32\":return 2147483647.0;case\"Uint32\":return 4294967295.0;case\"Float32\":case\"Float64\":default:return 1.0;}}}));x3dom.registerNodeType(\"BufferView\",\"Geometry3D\",defineClass(x3dom.nodeTypes.X3DNode,function(ctx){x3dom.nodeTypes.BufferView.superClass.call(this,ctx);this.addField_SFInt32(ctx,'target',34962);this.addField_SFInt32(ctx,'byteOffset',0);this.addField_SFInt32(ctx,'byteStride',0);this.addField_SFInt32(ctx,'byteLength',0);this.addField_SFInt32(ctx,'id',0);},{parentAdded:function(parent)\n{}}));x3dom.registerNodeType(\"BufferAccessor\",\"Geometry3D\",defineClass(x3dom.nodeTypes.X3DNode,function(ctx){x3dom.nodeTypes.BufferAccessor.superClass.call(this,ctx);this.addField_SFString(ctx,'bufferType',\"\");this.addField_SFInt32(ctx,'view',0);this.addField_SFInt32(ctx,'byteOffset',0);this.addField_SFInt32(ctx,'byteStride',0);this.addField_SFInt32(ctx,'components',0);this.addField_SFInt32(ctx,'componentType',5126);this.addField_SFInt32(ctx,'count',0);this.addField_SFBool(ctx,'normalized',false);},{parentAdded:function(parent)\n{switch(this._vf.bufferType)\n{case\"COLOR_0\":case\"COLOR\":parent._hasColor=true;break;case\"INDEX\":parent._indexed=true;break;case\"TEXCOORD_1\":parent._hasMultiTexCoord=true;break;}}}));x3dom.registerNodeType(\"X3DTexture3DNode\",\"Texturing3D\",defineClass(x3dom.nodeTypes.X3DTextureNode,function(ctx){x3dom.nodeTypes.X3DTexture3DNode.superClass.call(this,ctx);}));x3dom.registerNodeType(\"ComposedTexture3D\",\"Texturing3D\",defineClass(x3dom.nodeTypes.X3DTexture3DNode,function(ctx){x3dom.nodeTypes.ComposedTexture3D.superClass.call(this,ctx);this.addField_MFNode('texture',x3dom.nodeTypes.X3DTexture3DNode);}));x3dom.registerNodeType(\"ImageTexture3D\",\"Texturing3D\",defineClass(x3dom.nodeTypes.X3DTexture3DNode,function(ctx){x3dom.nodeTypes.ImageTexture3D.superClass.call(this,ctx);}));x3dom.registerNodeType(\"PixelTexture3D\",\"Texturing3D\",defineClass(x3dom.nodeTypes.X3DTexture3DNode,function(ctx){x3dom.nodeTypes.PixelTexture3D.superClass.call(this,ctx);}));x3dom.registerNodeType(\"TextureCoordinate3D\",\"Texturing3D\",defineClass(x3dom.nodeTypes.X3DTextureCoordinateNode,function(ctx){x3dom.nodeTypes.TextureCoordinate3D.superClass.call(this,ctx);this.addField_MFVec3f(ctx,'point',[]);}));x3dom.registerNodeType(\"TextureTransform3D\",\"Texturing3D\",defineClass(x3dom.nodeTypes.X3DTextureTransformNode,function(ctx){x3dom.nodeTypes.TextureTransform3D.superClass.call(this,ctx);this.addField_SFVec3f(ctx,'center',0,0,0);this.addField_SFRotation(ctx,'rotation',0,0,1,0);this.addField_SFVec3f(ctx,'scale',1,1,1);this.addField_SFVec3f(ctx,'translation',0,0,0);this.addField_SFRotation(ctx,'scaleOrientation',0,0,1,0);}));x3dom.registerNodeType(\"TextureTransformMatrix3D\",\"Texturing3D\",defineClass(x3dom.nodeTypes.X3DTextureTransformNode,function(ctx){x3dom.nodeTypes.TextureTransformMatrix3D.superClass.call(this,ctx);this.addField_SFMatrix4f(ctx,'matrix',1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);}));x3dom.registerNodeType(\"X3DPointingDeviceSensorNode\",\"PointingDeviceSensor\",defineClass(x3dom.nodeTypes.X3DSensorNode,function(ctx)\n{x3dom.nodeTypes.X3DPointingDeviceSensorNode.superClass.call(this,ctx);this._isOver=false;},{pointerPressedOverSibling:function(event)\n{if(this._vf.enabled)\n{this._vf.isActive=true;this.postMessage('isActive',true);this._isOver=true;}},pointerMoved:function(event)\n{},pointerMovedOver:function(event)\n{if(this._vf.enabled)\n{this.postMessage('isOver',true);}},pointerMovedOut:function(event)\n{if(this._vf.enabled)\n{this.postMessage('isOver',false);this._isOver=false;}},pointerReleased:function()\n{if(this._vf.enabled)\n{this._vf.isActive=false;this.postMessage('isActive',false);if(this._isOver)\nthis.postMessage('touchTime',Date.now()/1000);}}}));x3dom.registerNodeType(\"X3DDragSensorNode\",\"PointingDeviceSensor\",defineClass(x3dom.nodeTypes.X3DPointingDeviceSensorNode,function(ctx)\n{x3dom.nodeTypes.X3DDragSensorNode.superClass.call(this,ctx);this.addField_SFBool(ctx,'autoOffset',true);this._lastX=-1;this._lastY=-1;},{pointerPressedOverSibling:function(event)\n{x3dom.nodeTypes.X3DPointingDeviceSensorNode.prototype.pointerPressedOverSibling.call(this,event);this._lastX=event.layerX;this._lastY=event.layerY;this._startDragging(event.viewarea,event.layerX,event.layerX,event.worldX,event.worldY,event.worldZ);},pointerMoved:function(event)\n{x3dom.nodeTypes.X3DPointingDeviceSensorNode.prototype.pointerMoved.call(this,event);if(this._vf.isActive&&this._vf.enabled)\n{this._process2DDrag(event.layerX,event.layerY,event.layerX-this._lastX,event.layerY-this._lastY);}},pointerReleased:function()\n{x3dom.nodeTypes.X3DPointingDeviceSensorNode.prototype.pointerReleased.call(this);this._stopDragging();},_startDragging:function(viewarea,x,y,wx,wy,wz)\n{},_process2DDrag:function(x,y,dx,dy)\n{},_stopDragging:function()\n{}}));x3dom.registerNodeType(\"X3DTouchSensorNode\",\"PointingDeviceSensor\",defineClass(x3dom.nodeTypes.X3DPointingDeviceSensorNode,function(ctx)\n{x3dom.nodeTypes.X3DTouchSensorNode.superClass.call(this,ctx);},{}));x3dom.registerNodeType(\"TouchSensor\",\"PointingDeviceSensor\",defineClass(x3dom.nodeTypes.X3DTouchSensorNode,function(ctx)\n{x3dom.nodeTypes.TouchSensor.superClass.call(this,ctx);},{}));x3dom.registerNodeType(\"PlaneSensor\",\"PointingDeviceSensor\",defineClass(x3dom.nodeTypes.X3DDragSensorNode,function(ctx)\n{x3dom.nodeTypes.PlaneSensor.superClass.call(this,ctx);this.addField_SFRotation(ctx,'axisRotation',0,0,1,0);this.addField_SFVec2f(ctx,'minPosition',0,0);this.addField_SFVec2f(ctx,'maxPosition',-1,-1);this.addField_SFVec3f(ctx,'offset',0,0,0);this.addField_SFString(ctx,'planeOrientation','XY');this._rotationMatrix=this._vf.axisRotation.toMatrix();this._worldToLocalMatrix=null;this._initialPlaneIntersection=null;this._planeNormal=null;this._viewArea=null;this._currentTranslation=new x3dom.fields.SFVec3f(0.0,0.0,0.0);this._lineModeAxis=null;if(this._vf.minPosition.x==this._vf.maxPosition.x)\nthis._lineModeAxis=new x3dom.fields.SFVec3f(0,1,0);if(this._vf.minPosition.y==this._vf.maxPosition.y)\nthis._lineModeAxis=new x3dom.fields.SFVec3f(1,0,0);},{getCurrentTransform:function()\n{var parentTransform=x3dom.nodeTypes.X3DDragSensorNode.prototype.getCurrentTransform.call(this);return this._rotationMatrix.mult(parentTransform);},_startDragging:function(viewarea,x,y,wx,wy,wz)\n{x3dom.nodeTypes.X3DDragSensorNode.prototype._startDragging.call(this,viewarea,x,y,wx,wy,wz);this._viewArea=viewarea;this._viewMat=this._viewArea.getViewMatrix();this._viewMatInv=this._viewMat.inverse();this._currentTranslation=new x3dom.fields.SFVec3f(0.0,0.0,0.0).add(this._vf.offset);this._localToWorldMatrix=this.getCurrentTransform();this._worldToLocalMatrix=this._localToWorldMatrix.inverse();this._initialPlaneIntersection=this._worldToLocalMatrix.multMatrixPnt(new x3dom.fields.SFVec3f(wx,wy,wz));this._planeNormal=new x3dom.fields.SFVec3f(0.0,0.0,1.0);var viewRay;if(this._vf.planeOrientation=='screen'){viewRay=viewarea.calcViewRay(viewarea._width/2,viewarea._height/2);this._planeNormal=this._worldToLocalMatrix.multMatrixVec(viewRay.dir.normalize());}\nelse if(this._lineModeAxis){viewRay=viewarea.calcViewRay(x,y);var viewDir=this._worldToLocalMatrix.multMatrixVec(viewRay.dir.normalize());var axis=this._lineModeAxis;this._planeNormal=axis.cross(axis.cross(viewDir));}},_process2DDrag:function(x,y,dx,dy)\n{x3dom.nodeTypes.X3DDragSensorNode.prototype._process2DDrag.call(this,x,y,dx,dy);var intersectionPoint=null;var minPos,maxPos;if(this._initialPlaneIntersection)\n{var viewRay=this._viewArea.calcViewRay(x,y);viewRay.pos=this._worldToLocalMatrix.multMatrixPnt(viewRay.pos);viewRay.dir=this._worldToLocalMatrix.multMatrixVec(viewRay.dir.normalize());if(Math.abs(this._planeNormal.dot(viewRay.dir))<0.1)return;intersectionPoint=viewRay.intersectPlane(this._initialPlaneIntersection,this._planeNormal);if(!intersectionPoint)\n{intersectionPoint=viewRay.intersectPlane(this._initialPlaneIntersection,this._planeNormal.negate());}\nif(intersectionPoint)\n{this._currentTranslation=intersectionPoint.subtract(this._initialPlaneIntersection);this._currentTranslation=this._currentTranslation.add(this._vf.offset);minPos=this._vf.minPosition;maxPos=this._vf.maxPosition;if(this._vf.planeOrientation=='screen')\n{if(minPos.x<=maxPos.x||minPos.y<=maxPos.y)\n{var screenTranslation=this._localToWorldMatrix.multMatrixVec(this._currentTranslation);screenTranslation=this._viewMat.multMatrixVec(screenTranslation);_clampTranslation(screenTranslation,minPos,maxPos);screenTranslation=this._viewMatInv.multMatrixVec(screenTranslation);this._currentTranslation=this._worldToLocalMatrix.multMatrixVec(screenTranslation);}}\nelse{_clampTranslation(this._currentTranslation,minPos,maxPos);this._currentTranslation.z=0;}\nthis.postMessage('translation_changed',x3dom.fields.SFVec3f.copy(this._currentTranslation));this.postMessage('trackPoint_changed',intersectionPoint);}}\nfunction _clampTranslation(translation,minPos,maxPos)\n{if(minPos.x<=maxPos.x)\n{translation.x=Math.min(translation.x,maxPos.x);translation.x=Math.max(translation.x,minPos.x);}\nif(minPos.y<=maxPos.y)\n{translation.y=Math.min(translation.y,maxPos.y);translation.y=Math.max(translation.y,minPos.y);}}},_stopDragging:function()\n{x3dom.nodeTypes.X3DDragSensorNode.prototype._stopDragging.call(this);if(this._vf.autoOffset)\n{this._vf.offset=x3dom.fields.SFVec3f.copy(this._currentTranslation);this.postMessage('offset_changed',this._vf.offset);}}}));x3dom.registerNodeType(\"SphereSensor\",\"PointingDeviceSensor\",defineClass(x3dom.nodeTypes.X3DDragSensorNode,function(ctx)\n{x3dom.nodeTypes.SphereSensor.superClass.call(this,ctx);this.addField_SFRotation(ctx,'offset',0,1,0,0);this._currentRotation=null;this._rotationMatrix=this._vf.offset.toMatrix();},{getCurrentTransform:function()\n{var parentTransform=x3dom.nodeTypes.X3DDragSensorNode.prototype.getCurrentTransform.call(this);return parentTransform.mult(this._rotationMatrix);},_startDragging:function(viewarea,x,y,wx,wy,wz)\n{x3dom.nodeTypes.X3DDragSensorNode.prototype._startDragging.call(this,viewarea,x,y,wx,wy,wz);this._currentRotation=new x3dom.fields.Quaternion();this._viewArea=viewarea;this._localOrigin=new x3dom.fields.SFVec3f(0.0,0.0,0.0);this._inverseToWorldMatrix=this.getCurrentTransform().inverse();var firstIntersection=this._inverseToWorldMatrix.multMatrixPnt(new x3dom.fields.SFVec3f(wx,wy,wz));this._initialSphereIntersectionVector=firstIntersection.subtract(this._localOrigin);this._sphereRadius=this._initialSphereIntersectionVector.length();this._initialSphereIntersectionVector=this._initialSphereIntersectionVector.normalize();},_process2DDrag:function(x,y,dx,dy)\n{x3dom.nodeTypes.X3DDragSensorNode.prototype._process2DDrag.call(this,x,y,dx,dy);var viewRay=this._viewArea.calcViewRay(x,y);viewRay.pos=this._inverseToWorldMatrix.multMatrixPnt(viewRay.pos);viewRay.dir=this._inverseToWorldMatrix.multMatrixVec(viewRay.dir);var A=viewRay.dir.dot(viewRay.dir);var B=2.0*(viewRay.dir.dot(viewRay.pos.subtract(this._localOrigin)));var C=viewRay.pos.dot(viewRay.pos)-2.0*this._localOrigin.dot(viewRay.pos)+\nthis._localOrigin.dot(this._localOrigin)-this._sphereRadius*this._sphereRadius;var determinant=(B*B)-(4.0*A*C);var alpha_1;var alpha_2;if(determinant>=0.0){alpha_1=(-B+Math.sqrt(determinant))/(2.0*A);alpha_2=(-B-Math.sqrt(determinant))/(2.0*A);alpha_1=Math.min(alpha_1,alpha_2);if(alpha_1>=1.0){var hitPoint=viewRay.pos.add(viewRay.dir.multiply(alpha_1));var vecToHitPoint=hitPoint.subtract(this._localOrigin).normalize();this._currentRotation=x3dom.fields.Quaternion.rotateFromTo(this._initialSphereIntersectionVector,vecToHitPoint);this._currentRotation=this._currentRotation.multiply(this._vf.offset);this.postMessage('rotation_changed',this._currentRotation);}}\nelse{}},_stopDragging:function()\n{x3dom.nodeTypes.X3DDragSensorNode.prototype._stopDragging.call(this);if(this._vf.autoOffset)\n{this._vf.offset=this._currentRotation;this.postMessage('offset_changed',this._vf.offset);}\nthis._currentRotation=new x3dom.fields.Quaternion();}}));x3dom.registerNodeType(\"CylinderSensor\",\"PointingDeviceSensor\",defineClass(x3dom.nodeTypes.X3DDragSensorNode,function(ctx)\n{x3dom.nodeTypes.CylinderSensor.superClass.call(this,ctx);this.addField_SFFloat(ctx,'offset',0);this.addField_SFRotation(ctx,'axisRotation',0,1,0,0);this.addField_SFFloat(ctx,'diskAngle',0.262);this.addField_SFFloat(ctx,'minAngle',0);this.addField_SFFloat(ctx,'maxAngle',-1);this._rotationMatrix=this._vf.axisRotation.toMatrix();this._inverseToWorldMatrix=null;this._initialCylinderIntersectionVector=null;this._viewArea=null;this._cylinderRadius=0.0;this._yAxisLine=null;this._cylinderMode=true;this._currentRotationAngle=0.0;},{getCurrentTransform:function()\n{var parentTransform=x3dom.nodeTypes.X3DDragSensorNode.prototype.getCurrentTransform.call(this);return parentTransform.mult(this._rotationMatrix);},_startDragging:function(viewarea,x,y,wx,wy,wz)\n{x3dom.nodeTypes.X3DDragSensorNode.prototype._startDragging.call(this,viewarea,x,y,wx,wy,wz);this._currentRotation=new x3dom.fields.Quaternion();this._viewArea=viewarea;this._yAxisLine=new x3dom.fields.Line(new x3dom.fields.SFVec3f(0.0,0.0,0.0),new x3dom.fields.SFVec3f(0.0,1.0,0.0));this._inverseToWorldMatrix=this.getCurrentTransform().inverse();var firstIntersection=this._inverseToWorldMatrix.multMatrixPnt(new x3dom.fields.SFVec3f(wx,wy,wz));var closestPointOnYAxis=this._yAxisLine.closestPoint(firstIntersection);this._initialCylinderIntersectionVector=firstIntersection.subtract(closestPointOnYAxis);this._cylinderRadius=this._initialCylinderIntersectionVector.length();this._initialCylinderIntersectionVector=this._initialCylinderIntersectionVector.normalize();},_process2DDrag:function(x,y,dx,dy)\n{x3dom.nodeTypes.X3DDragSensorNode.prototype._process2DDrag.call(this,x,y,dx,dy);if(this._cylinderMode)\n{var viewRay=this._viewArea.calcViewRay(x,y);viewRay.pos=this._inverseToWorldMatrix.multMatrixPnt(viewRay.pos);viewRay.dir=this._inverseToWorldMatrix.multMatrixVec(viewRay.dir);var A=viewRay.dir.subtract(this._yAxisLine.dir.multiply(viewRay.dir.dot(this._yAxisLine.dir)));var B=viewRay.pos.subtract(this._yAxisLine.pos).add(this._yAxisLine.dir.multiply(this._yAxisLine.dir.dot(this._yAxisLine.pos.subtract(viewRay.pos))));var p=2*A.dot(B)/A.dot(A);var q=(B.dot(B)-this._cylinderRadius*this._cylinderRadius)/A.dot(A);var sqrt_part=p*p*0.25-q;var alpha_1;var alpha_2;if(sqrt_part>=0)\n{sqrt_part=Math.sqrt(sqrt_part);alpha_1=-p*0.5+sqrt_part;alpha_2=-p*0.5-sqrt_part;alpha_1=Math.min(alpha_1,alpha_2);if(alpha_1>0.0)\n{var hitPoint=viewRay.pos.add(viewRay.dir.multiply(alpha_1));var closestPointOnYAxis=this._yAxisLine.closestPoint(hitPoint);var vecToHitPoint=hitPoint.subtract(closestPointOnYAxis).normalize();this._currentRotation=x3dom.fields.Quaternion.rotateFromTo(this._initialCylinderIntersectionVector,vecToHitPoint);var offsetQuat=x3dom.fields.Quaternion.axisAngle(this._yAxisLine.dir,this._vf.offset);this._currentRotation=this._currentRotation.multiply(offsetQuat);this.postMessage('rotation_changed',this._currentRotation);}}}\nelse\n{}},_stopDragging:function()\n{x3dom.nodeTypes.X3DDragSensorNode.prototype._stopDragging.call(this);if(this._vf.autoOffset)\n{this._vf.offset=this._currentRotation.angle();this.postMessage('offset_changed',this._vf.offset);}}}));x3dom.registerNodeType(\"X3DSequencerNode\",\"EventUtilities\",defineClass(x3dom.nodeTypes.X3DChildNode,function(ctx){x3dom.nodeTypes.X3DSequencerNode.superClass.call(this,ctx);this.addField_SFBool(ctx,'next',false);this.addField_SFBool(ctx,'previous',false);this.addField_MFFloat(ctx,'key',[]);this.addField_SFFloat(ctx,'set_fraction',0);this._keyIndex=-1;this._key_changed=false;this._keyValue_changed=false;},{findInterval:function(time){var keyLength=this._vf.key.length-1;if(time<this._vf.key[0]){return 0;}\nelse if(time>=this._vf.key[keyLength]){return keyLength;}\nfor(var i=0;i<keyLength;++i){if((this._vf.key[i]<=time)&&(time<this._vf.key[i+1])){return i;}}\nreturn 0;},fieldChanged:function(fieldName)\n{if(fieldName===\"set_fraction\")\n{var keyIndex=this.findInterval(this._vf.set_fraction);if(keyIndex!==this._keyIndex){this._keyIndex=keyIndex;this.postMessage('value_changed',this._vf.keyValue[keyIndex]);}\nreturn;}\nif(fieldName===\"next\"&&this._vf.next)\n{this._keyIndex=(this._keyIndex+1)%(this._vf.key.length);this.postMessage('value_changed',this._vf.keyValue[this._keyIndex]);return;}\nif(fieldName===\"previous\"&&this._vf.previous)\n{this._keyIndex=(this._keyIndex-1+this._vf.key.length)%(this._vf.key.length);this.postMessage('value_changed',this._vf.keyValue[this._keyIndex]);return;}\nif(fieldName===\"key\")\n{if(this._key_changed){this._key_changed=false;return;}\nthis._key_changed=true;this.postMessage('key',this._vf.key);return;}\nif(fieldName===\"keyValue\")\n{if(this._keyValue_changed){this._keyValue_changed=false;return;}\nthis._keyValue_changed=true;this.postMessage('keyValue',this._vf.keyValue);return;}}}));x3dom.registerNodeType(\"X3DTriggerNode\",\"EventUtilities\",defineClass(x3dom.nodeTypes.X3DChildNode,function(ctx){x3dom.nodeTypes.X3DTriggerNode.superClass.call(this,ctx);}));x3dom.registerNodeType(\"BooleanFilter\",\"EventUtilities\",defineClass(x3dom.nodeTypes.X3DChildNode,function(ctx){x3dom.nodeTypes.BooleanFilter.superClass.call(this,ctx);this.addField_SFBool(ctx,'set_boolean');this.addField_SFBool(ctx,'inputFalse');this.addField_SFBool(ctx,'inputTrue');this.addField_SFBool(ctx,'inputNegate');},{fieldChanged:function(fieldName)\n{if(fieldName==='set_boolean'){var input=this._vf.set_boolean;this._vf.inputNegate=!input;this.postMessage('inputNegate',!input);if(input){this._vf.inputTrue=true;this.postMessage('inputTrue',true);return;}\nthis._vf.inputFalse=false;this.postMessage('inputFalse',false);return;}}}));x3dom.registerNodeType(\"BooleanSequencer\",\"EventUtilities\",defineClass(x3dom.nodeTypes.X3DSequencerNode,function(ctx){x3dom.nodeTypes.BooleanSequencer.superClass.call(this,ctx);this.addField_MFBoolean(ctx,'keyValue',[]);},{}));x3dom.registerNodeType(\"BooleanToggle\",\"EventUtilities\",defineClass(x3dom.nodeTypes.X3DChildNode,function(ctx){x3dom.nodeTypes.BooleanToggle.superClass.call(this,ctx);this.addField_SFBool(ctx,'set_boolean');this.addField_SFBool(ctx,'toggle',false);},{fieldChanged:function(fieldName)\n{if(fieldName==='set_boolean'){if(this._vf.set_boolean){var toggled=!this._vf.toggle;this._vf.toggle=toggled;this.postMessage('toggle',toggled);}\nreturn;}}}));x3dom.registerNodeType(\"BooleanTrigger\",\"EventUtilities\",defineClass(x3dom.nodeTypes.X3DTriggerNode,function(ctx){x3dom.nodeTypes.BooleanTrigger.superClass.call(this,ctx);this.addField_SFTime(ctx,'set_triggerTime');},{fieldChanged:function(fieldName)\n{if(fieldName==='set_triggerTime'){this.postMessage('triggerTrue',true);}\nreturn;}}));x3dom.registerNodeType(\"IntegerSequencer\",\"EventUtilities\",defineClass(x3dom.nodeTypes.X3DSequencerNode,function(ctx){x3dom.nodeTypes.IntegerSequencer.superClass.call(this,ctx);this.addField_MFInt32(ctx,'keyValue',[]);},{}));x3dom.registerNodeType(\"IntegerTrigger\",\"EventUtilities\",defineClass(x3dom.nodeTypes.X3DTriggerNode,function(ctx){x3dom.nodeTypes.IntegerTrigger.superClass.call(this,ctx);this.addField_SFBool(ctx,'set_boolean');this.addField_SFInt32(ctx,'integerKey',-1);},{fieldChanged:function(fieldName)\n{if(fieldName==='set_boolean'){this.postMessage('triggerValue',this._vf.integerKey);}\nreturn;}}));x3dom.registerNodeType(\"TimeTrigger\",\"EventUtilities\",defineClass(x3dom.nodeTypes.X3DTriggerNode,function(ctx){x3dom.nodeTypes.TimeTrigger.superClass.call(this,ctx);this.addField_SFBool(ctx,'set_boolean');},{fieldChanged:function(fieldName)\n{if(fieldName==='set_boolean'){this.postMessage('triggerTime',Date.now()/1000);}\nreturn;}}));x3dom.registerNodeType(\"GeoCoordinate\",\"Geospatial\",defineClass(x3dom.nodeTypes.X3DCoordinateNode,function(ctx){x3dom.nodeTypes.GeoCoordinate.superClass.call(this,ctx);this.addField_MFVec3f(ctx,'point',[]);this.addField_MFString(ctx,'geoSystem',['GD','WE']);this.addField_SFNode('geoOrigin',x3dom.nodeTypes.GeoOrigin);},{elipsoideParameters:{'AA':['Airy 1830','6377563.396','299.3249646'],'AM':['Modified Airy','6377340.189','299.3249646'],'AN':['Australian National','6378160','298.25'],'BN':['Bessel 1841 (Namibia)','6377483.865','299.1528128'],'BR':['Bessel 1841 (Ethiopia Indonesia...)','6377397.155','299.1528128'],'CC':['Clarke 1866','6378206.4','294.9786982'],'CD':['Clarke 1880','6378249.145','293.465'],'EA':['Everest (India 1830)','6377276.345','300.8017'],'EB':['Everest (Sabah & Sarawak)','6377298.556','300.8017'],'EC':['Everest (India 1956)','6377301.243','300.8017'],'ED':['Everest (W. Malaysia 1969)','6377295.664','300.8017'],'EE':['Everest (W. Malaysia & Singapore 1948)','6377304.063','300.8017'],'EF':['Everest (Pakistan)','6377309.613','300.8017'],'FA':['Modified Fischer 1960','6378155','298.3'],'HE':['Helmert 1906','6378200','298.3'],'HO':['Hough 1960','6378270','297'],'ID':['Indonesian 1974','6378160','298.247'],'IN':['International 1924','6378388','297'],'KA':['Krassovsky 1940','6378245','298.3'],'RF':['Geodetic Reference System 1980 (GRS 80)','6378137','298.257222101'],'SA':['South American 1969','6378160','298.25'],'WD':['WGS 72','6378135','298.26'],'WE':['WGS 84','6378137','298.257223563']},fieldChanged:function(fieldName){if(fieldName==\"point\"||fieldName==\"geoSystem\"){Array.forEach(this._parentNodes,function(node){node.fieldChanged(\"coord\");});}},isLogitudeFirst:function(geoSystem){for(var i=0;i<geoSystem.length;++i)\nif(geoSystem[i]=='longitude_first')\nreturn true;return false;},getElipsoideCode:function(geoSystem)\n{for(var i=0;i<geoSystem.length;++i)\n{var code=geoSystem[i];if(this.elipsoideParameters[code])\nreturn code;}\nreturn'WE';},getElipsoide:function(geoSystem)\n{return this.elipsoideParameters[this.getElipsoideCode(geoSystem)];},getReferenceFrame:function(geoSystem)\n{for(var i=0;i<geoSystem.length;++i)\n{var code=geoSystem[i];if(code=='GD'||code=='GDC')\nreturn'GD';if(code=='GC'||code=='GCC')\nreturn'GC';if(code=='UTM')\nreturn'UTM';else\nx3dom.debug.logError('Unknown GEO system: ['+geoSystem+']');}\nreturn'GD';},getUTMZone:function(geoSystem)\n{for(var i=0;i<geoSystem.length;++i)\n{var code=geoSystem[i];if(code[0]=='Z')\nreturn code.substring(1);}\nx3dom.debug.logError('no UTM zone but is required:'+geoSystem);},getUTMHemisphere:function(geoSystem)\n{for(var i=0;i<geoSystem.length;++i)\n{var code=geoSystem[i];if(code=='S')\nreturn code;}\nreturn'N';},isUTMEastingFirst:function(geoSystem)\n{for(var i=0;i<geoSystem.length;++i)\n{var code=geoSystem[i];if(code=='easting_first')\nreturn true;}\nreturn false;},UTMtoGC:function(geoSystem,coords)\n{var utmzone=this.getUTMZone(geoSystem);if(utmzone<1||utmzone>60||utmzone===undefined)\nreturn x3dom.debug.logError('invalid UTM zone: '+utmzone+' in geosystem '+geoSystem);var hemisphere=this.getUTMHemisphere(geoSystem);var eastingFirst=this.isUTMEastingFirst(geoSystem);var elipsoide=this.getElipsoide(geoSystem);var a=elipsoide[1];var f=1/elipsoide[2];var k0=0.9996;var b=a*(1-f);var esq=(1-(b/a)*(b/a));var e=Math.sqrt(esq);var e0=e/Math.sqrt(1-esq);var e0sq=esq/(1-esq);var zcm=3+6*(utmzone-1)-180;var e1=(1-Math.sqrt(1-esq))/(1+Math.sqrt(1-esq));var e1sq=e1*e1;var output=new x3dom.fields.MFVec3f();var rad2deg=180/Math.PI;var f3o64=3/64;var f5o256=5/256;var f27o32=27/32;var f21o16=21/16;var f55o32=55/32;var f151o96=151/96;var f1097o512=1097/512;var fmua=1-esq*(0.25+esq*(f3o64+f5o256*esq));var fphi11=e1*(1.5-f27o32*e1sq);var fphi12=e1sq*(f21o16-f55o32*e1sq);var current,x,y,z,M,mu,phi1,cosphi1,C1,tanphi1,T1,T1sq;var esinphi1,oneesinphi1,N1,R1,D,Dsq,C1sq,phi,lng;for(var i=0;i<coords.length;++i)\n{x=(eastingFirst?coords[i].x:coords[i].y);y=(eastingFirst?coords[i].y:coords[i].x);M=(hemisphere==\"S\"?(y-10000000):y)/k0;mu=M/(a*fmua);phi1=mu+fphi11*Math.sin(2*mu)+fphi12*Math.sin(4*mu);phi1=phi1+e1*(e1sq*(Math.sin(6*mu)*f151o96+Math.sin(8*mu)*f1097o512));cosphi1=Math.cos(phi1);C1=e0sq*cosphi1*cosphi1;tanphi1=Math.tan(phi1);T1=tanphi1*tanphi1;T1sq=T1*T1;esinphi1=e*Math.sin(phi1);oneesinphi1=1-esinphi1*esinphi1;N1=a/Math.sqrt(oneesinphi1);R1=N1*(1-esq)/oneesinphi1;D=(x-500000)/(N1*k0);Dsq=D*D;C1sq=C1*C1;phi=Dsq*(0.5-Dsq*(5+3*T1+10*C1-4*C1sq-9*e0sq)/24);phi=phi+Math.pow(D,6)*(61+90*T1+298*C1+45*T1sq-252*e0sq-3*C1sq)/720;phi=phi1-(N1*tanphi1/R1)*phi;lng=D*(1+Dsq*((-1-2*T1-C1)/6+Dsq*(5-2*C1+28*T1-3*C1sq+8*e0sq+24*T1sq)/120))/cosphi1;current=new x3dom.fields.SFVec3f();current.x=zcm+rad2deg*lng;current.y=rad2deg*phi;current.z=coords[i].z;output.push(current);}\nvar GDgeoSystem=new x3dom.fields.MFString();GDgeoSystem.push(\"GD\");GDgeoSystem.push(this.getElipsoideCode(geoSystem));GDgeoSystem.push(\"longitude_first\");return this.GDtoGC(GDgeoSystem,output);},GCtoUTM:function(geoSystem,coords){var coordsGD=this.GCtoGD(geoSystem,coords);var utmzone=this.getUTMZone(geoSystem);if(utmzone<1||utmzone>60||utmzone===undefined)\nreturn x3dom.debug.logError('invalid UTM zone: '+utmzone+' in geosystem '+geoSystem);var hemisphere=this.getUTMHemisphere(geoSystem);var eastingFirst=this.isUTMEastingFirst(geoSystem);var elipsoide=this.getElipsoide(geoSystem);var a=elipsoide[1];var f=1/elipsoide[2];var k0=0.9996;var b=a*(1-f);var esq=(1-(b/a)*(b/a));var e=Math.sqrt(esq);var e0sq=esq/(1-esq);var M0=0;var deg2rad=Math.PI/180;var zcmrad=(3+6*(utmzone-1)-180)*deg2rad;var coordsUTM=new x3dom.fields.MFVec3f();var N,T,C,A,M,x,y,phi,lng,cosphi,tanphi,Asq;var i,current;var fMphi=1-esq*(1/4+esq*(3/64+5*esq/256));var fM2phi=esq*(3/8+esq*(3/32+45*esq/1024));var fM4phi=esq*esq*(15/256+esq*45/1024);var fM6phi=esq*esq*esq*(35/3072);for(i=0;i<coordsGD.length;++i){current=new x3dom.fields.SFVec3f();phi=coordsGD[i].y*deg2rad;lng=coordsGD[i].x*deg2rad;cosphi=Math.cos(phi);tanphi=Math.tan(phi);N=a/Math.sqrt(1-Math.pow(e*Math.sin(phi),2));T=Math.pow(tanphi,2);C=e0sq*Math.pow(cosphi,2);A=(lng-zcmrad)*cosphi;M=phi*fMphi;M=M-Math.sin(2*phi)*fM2phi;M=M+Math.sin(4*phi)*fM4phi;M=M-Math.sin(6*phi)*fM6phi;M=M*a;Asq=A*A;x=k0*N*A*(1+Asq*((1-T+C)/6+Asq*(5-T*(18+T)+72*C-58*e0sq)/120));x=x+500000;y=k0*(M-M0+N*tanphi*(Asq*(0.5+Asq*((5-T+9*C+4*C*C)/24+Asq*(61-T*(58+T)+600*C-330*e0sq)/720))));if(y<0){if(hemisphere==\"N\"){x3dom.debug.logError('UTM zone in northern hemisphere but coordinates in southern!');}\ny=10000000+y;}\ncurrent.x=eastingFirst?x:y;current.y=eastingFirst?y:x;current.z=coordsGD[i].z;coordsUTM.push(current);}\nreturn coordsUTM;},GDtoGC:function(geoSystem,coords){var output=new x3dom.fields.MFVec3f();var elipsoide=this.getElipsoide(geoSystem);var A=elipsoide[1];var eccentricity=elipsoide[2];var longitudeFirst=this.isLogitudeFirst(geoSystem);var A2=A*A;var F=1.0/eccentricity;var C=A*(1.0-F);var C2=C*C;var C2oA2=C2/A2;var Eps2=F*(2.0-F);var radiansPerDegree=0.0174532925199432957692;var i,current,source_lat,source_lon,slat,slat2,clat,Rn,RnPh;for(i=0;i<coords.length;++i)\n{current=new x3dom.fields.SFVec3f();source_lat=radiansPerDegree*(longitudeFirst==true?coords[i].y:coords[i].x);source_lon=radiansPerDegree*(longitudeFirst==true?coords[i].x:coords[i].y);slat=Math.sin(source_lat);slat2=slat*slat;clat=Math.cos(source_lat);Rn=A/Math.sqrt(1.0-Eps2*slat2);RnPh=Rn+coords[i].z;current.x=RnPh*clat*Math.cos(source_lon);current.y=RnPh*clat*Math.sin(source_lon);current.z=(C2oA2*Rn+coords[i].z)*slat;output.push(current);}\nreturn output;},GCtoGD:function(geoSystem,coords){var output=new x3dom.fields.MFVec3f();var rad2deg=180/Math.PI;var ellipsoide=this.getElipsoide(geoSystem);var a=ellipsoide[1];var f=1/ellipsoide[2];var b=a*(1-f);var esq=(1-(b/a)*(b/a));var eps=esq/(1-esq);var i,current,x,y,z,p,q,lat,nu,elev,lon;for(i=0;i<coords.length;++i){x=coords[i].x;y=coords[i].y;z=coords[i].z;p=Math.sqrt(x*x+y*y);q=Math.atan((z*a)/(p*b));lat=Math.atan((z+eps*b*Math.pow(Math.sin(q),3))/(p-esq*a*Math.pow(Math.cos(q),3)));nu=a/Math.sqrt(1-esq*Math.pow(Math.sin(lat),2));elev=p/Math.cos(lat)-nu;lon=Math.atan2(y,x);current=new x3dom.fields.SFVec3f();current.x=lon*rad2deg;current.y=lat*rad2deg;current.z=elev;output.push(current);}\nreturn output;},GEOtoGC:function(geoSystem,geoOrigin,coords){var referenceFrame=this.getReferenceFrame(geoSystem);if(referenceFrame=='GD')\nreturn this.GDtoGC(geoSystem,coords);else if(referenceFrame=='UTM')\nreturn this.UTMtoGC(geoSystem,coords);else if(referenceFrame=='GC')\n{if(geoOrigin.node)\n{var copy=new x3dom.fields.MFVec3f();for(var i=0;i<coords.length;++i)\n{var current=new x3dom.fields.SFVec3f();current.x=coords[i].x;current.y=coords[i].y;current.z=coords[i].z;copy.push(current);}\nreturn copy;}\nelse\nreturn coords;}\nelse{x3dom.debug.logError('Unknown geoSystem: '+geoSystem[0]);return new x3dom.fields.MFVec3f();}},GCtoGEO:function(geoSystem,geoOrigin,coords){var referenceFrame=this.getReferenceFrame(geoSystem);if(referenceFrame=='GD'){var coordsGD=this.GCtoGD(geoSystem,coords);if(!this.isLogitudeFirst(geoSystem)){var currentx;for(var i=0;i<coordsGD.length;++i){currentx=coordsGD[i].x;coordsGD[i].x=coordsGD[i].y;coordsGD[i].y=currentx;}}\nreturn coordsGD;}\nelse if(referenceFrame=='UTM')\nreturn this.GCtoUTM(geoSystem,coords);else if(referenceFrame=='GC')\n{if(geoOrigin.node)\n{var copy=new x3dom.fields.MFVec3f();for(var i=0;i<coords.length;++i)\n{var current=new x3dom.fields.SFVec3f();current.x=coords[i].x;current.y=coords[i].y;current.z=coords[i].z;copy.push(current);}\nreturn copy;}\nelse\nreturn coords;}\nelse{x3dom.debug.logError('Unknown geoSystem: '+geoSystem[0]);return new x3dom.fields.MFVec3f();}},OriginToGC:function(geoOrigin)\n{var geoCoords=geoOrigin.node._vf.geoCoords;var geoSystem=geoOrigin.node._vf.geoSystem;var point=new x3dom.fields.SFVec3f();point.x=geoCoords.x;point.y=geoCoords.y;point.z=geoCoords.z;var temp=new x3dom.fields.MFVec3f();temp.push(point);var origin=this.GEOtoGC(geoSystem,geoOrigin,temp);return origin[0];},GCtoX3D:function(geoSystem,geoOrigin,coords)\n{var gc=coords;if(geoOrigin.node)\n{var origin=this.OriginToGC(geoOrigin);var matrix=x3dom.fields.SFMatrix4f.translation(origin.negate());if(geoOrigin.node._vf.rotateYUp)\n{var rotmat=x3dom.nodeTypes.GeoLocation.prototype.getGeoRotMat(geoSystem,origin).inverse();matrix=rotmat.mult(matrix);}\nfor(var i=0;i<coords.length;++i)\ngc[i]=matrix.multMatrixPnt(coords[i]);}\nreturn gc;},GEOtoX3D:function(geoSystem,geoOrigin,coords)\n{var gc=this.GEOtoGC(geoSystem,geoOrigin,coords);return this.GCtoX3D(geoSystem,geoOrigin,gc);},getPoints:function()\n{return this.GEOtoX3D(this._vf.geoSystem,this._cf.geoOrigin,this._vf.point);}}));x3dom.registerNodeType(\"GeoElevationGrid\",\"Geospatial\",defineClass(x3dom.nodeTypes.X3DGeometryNode,function(ctx){x3dom.nodeTypes.GeoElevationGrid.superClass.call(this,ctx);this.addField_SFNode('texCoord',x3dom.nodeTypes.X3DTextureCoordinateNode);this.addField_MFString(ctx,'geoSystem',['GD','WE']);this.addField_SFVec3f(ctx,'geoGridOrigin',0,0,0);this.addField_MFDouble(ctx,'height',0,0);this.addField_SFBool(ctx,'ccw',true);this.addField_SFDouble(ctx,'creaseAngle',0);this.addField_SFInt32(ctx,'xDimension',0);this.addField_SFDouble(ctx,'xSpacing',1.0);this.addField_SFFloat(ctx,'yScale',1);this.addField_SFInt32(ctx,'zDimension',0);this.addField_SFDouble(ctx,'zSpacing',1.0);this.addField_SFNode('geoOrigin',x3dom.nodeTypes.GeoOrigin);this.addField_SFBool(ctx,'lit',true);},{nodeChanged:function()\n{var geoSystem=this._vf.geoSystem;var geoOrigin=this._cf.geoOrigin;var height=this._vf.height;var yScale=this._vf.yScale;var xDimension=this._vf.xDimension;var zDimension=this._vf.zDimension;var xSpacing=this._vf.xSpacing;var zSpacing=this._vf.zSpacing;var geoGridOrigin=this._vf.geoGridOrigin;if(height.length!==(xDimension*zDimension))\nx3dom.debug.logError('GeoElevationGrid: height.length('+height.length+') != x/zDimension('+xDimension+'*'+zDimension+')');var longitude_first=x3dom.nodeTypes.GeoCoordinate.prototype.isLogitudeFirst(geoSystem);var easting_first=x3dom.nodeTypes.GeoCoordinate.prototype.isUTMEastingFirst(geoSystem);var ccw=this._vf.ccw;var delta_x=1/(xDimension-1);var delta_z=1/(zDimension-1);var numTexComponents=2;var texCoordNode=this._cf.texCoord.node;var texPoints;if(x3dom.isa(texCoordNode,x3dom.nodeTypes.MultiTextureCoordinate)){if(texCoordNode._cf.texCoord.nodes.length)\ntexCoordNode=texCoordNode._cf.texCoord.nodes[0];}\nif(texCoordNode){if(texCoordNode._vf.point){texPoints=texCoordNode._vf.point;if(x3dom.isa(texCoordNode,x3dom.nodeTypes.TextureCoordinate3D)){numTexComponents=3;}}}\nvar positions=new x3dom.fields.MFVec3f();var texCoords=new x3dom.fields.MFVec2f();for(var z=0;z<zDimension;++z)\nfor(var x=0;x<xDimension;++x)\n{var tex_coord=new x3dom.fields.SFVec2f();tex_coord.x=x*delta_x;tex_coord.y=z*delta_z;texCoords.push(tex_coord);var coord=new x3dom.fields.SFVec3f();if(longitude_first||easting_first)\n{coord.x=x*xSpacing;coord.y=z*zSpacing;}\nelse\n{coord.x=z*zSpacing;coord.y=x*xSpacing;}\ncoord.z=height[(z*xDimension)+x]*yScale;coord=coord.add(geoGridOrigin);positions.push(coord);}\nvar indices=new x3dom.fields.MFInt32();for(var z=0;z<(zDimension-1);z++)\n{for(var x=0;x<(xDimension-1);x++)\n{var p0=x+(z*xDimension);var p1=x+(z*xDimension)+1;var p2=x+((z+1)*xDimension)+1;var p3=x+((z+1)*xDimension);if(ccw)\n{indices.push(p0);indices.push(p1);indices.push(p2);indices.push(p0);indices.push(p2);indices.push(p3);}\nelse\n{indices.push(p0);indices.push(p3);indices.push(p2);indices.push(p0);indices.push(p2);indices.push(p1);}}}\nvar transformed=x3dom.nodeTypes.GeoCoordinate.prototype.GEOtoX3D(geoSystem,geoOrigin,positions);if(this._vf.creaseAngle<=x3dom.fields.Eps){var that=this;(function(){var indicesFlat=new x3dom.fields.MFInt32(),positionsFlat=new x3dom.fields.MFVec3f(),texCoordsFlat=new x3dom.fields.MFVec2f();if(texPoints){that.generateNonIndexedTriangleData(indices,transformed,null,texPoints,null,positionsFlat,null,texCoordsFlat,null);}\nelse{that.generateNonIndexedTriangleData(indices,transformed,null,texCoords,null,positionsFlat,null,texCoordsFlat,null);}\nfor(var i=0;i<positionsFlat.length;++i){indicesFlat.push(i);}\nthat._mesh._indices[0]=indicesFlat.toGL();that._mesh._positions[0]=positionsFlat.toGL();that._mesh._texCoords[0]=texCoordsFlat.toGL();that._mesh._numTexComponents=2;})();this._mesh.calcNormals(0);}\nelse{this._mesh._indices[0]=indices.toGL();this._mesh._positions[0]=transformed.toGL();if(texPoints){this._mesh._texCoords[0]=texPoints.toGL();}\nelse{this._mesh._texCoords[0]=texCoords.toGL();}\nthis._mesh._numTexComponents=numTexComponents;this._mesh.calcNormals(Math.PI);}\nthis._mesh._invalidate=true;this._mesh._numFaces=this._mesh._indices[0].length/3;this._mesh._numCoords=this._mesh._positions[0].length/3;},generateNonIndexedTriangleData:function(indices,positions,normals,texCoords,colors,newPositions,newNormals,newTexCoords,newColors)\n{for(var i=0;i<indices.length;i+=3){var i0=indices[i],i1=indices[i+1],i2=indices[i+2];if(positions){var p0=new x3dom.fields.SFVec3f(),p1=new x3dom.fields.SFVec3f(),p2=new x3dom.fields.SFVec3f();p0.setValues(positions[i0]);p1.setValues(positions[i1]);p2.setValues(positions[i2]);newPositions.push(p0);newPositions.push(p1);newPositions.push(p2);}\nif(normals){var n0=new x3dom.fields.SFVec3f(),n1=new x3dom.fields.SFVec3f(),n2=new x3dom.fields.SFVec3f();n0.setValues(normals[i0]);n1.setValues(normals[i1]);n2.setValues(normals[i2]);newNormals.push(n0);newNormals.push(n1);newNormals.push(n2);}\nif(texCoords){var t0=new x3dom.fields.SFVec2f(),t1=new x3dom.fields.SFVec2f(),t2=new x3dom.fields.SFVec2f();t0.setValues(texCoords[i0]);t1.setValues(texCoords[i1]);t2.setValues(texCoords[i2]);newTexCoords.push(t0);newTexCoords.push(t1);newTexCoords.push(t2);}\nif(colors){var c0=new x3dom.fields.SFVec3f(),c1=new x3dom.fields.SFVec3f(),c2=new x3dom.fields.SFVec3f();c0.setValues(texCoords[i0]);c1.setValues(texCoords[i1]);c1.setValues(texCoords[i2]);newColors.push(c0);newColors.push(c1);newColors.push(c2);}}}}));x3dom.registerNodeType(\"GeoLOD\",\"Geospatial\",defineClass(x3dom.nodeTypes.X3DBoundedObject,function(ctx){x3dom.nodeTypes.GeoLOD.superClass.call(this,ctx);this.addField_MFString(ctx,'geoSystem',['GD','WE']);this.addField_MFString(ctx,'rootUrl',[]);this.addField_MFString(ctx,'child1Url',[]);this.addField_MFString(ctx,'child2Url',[]);this.addField_MFString(ctx,'child3Url',[]);this.addField_MFString(ctx,'child4Url',[]);this.addField_SFFloat(ctx,'range',10);this.addField_SFInt32(ctx,\"level_changed\",0);this.addField_SFString(ctx,'referenceBindableDescription',[]);this.addField_SFNode('geoOrigin',x3dom.nodeTypes.GeoOrigin);this.addField_MFNode('rootNode',x3dom.nodeTypes.X3DChildNode);this.addField_SFVec3f(ctx,\"center\",0,0,0);this._eye=new x3dom.fields.SFVec3f(0,0,0);this._x3dcenter=new x3dom.fields.SFVec3f(0,0,0);this._child1added=false;this._child2added=false;this._child3added=false;this._child4added=false;this._rootNodeLoaded=true;this._childUrlNodes=new x3dom.fields.MFNode(x3dom.nodeTypes.X3DChildNode);this._lastRangePos=-1;},{collectDrawableObjects:function(transform,drawableCollection,singlePath,invalidateCache,planeMask,clipPlanes)\n{if(singlePath&&(this._parentNodes.length>1))\nsinglePath=false;if(singlePath&&(invalidateCache=invalidateCache||this.cacheInvalid()))\nthis.invalidateCache();planeMask=drawableCollection.cull(transform,this.graphState(),singlePath,planeMask);if(planeMask<=0){return;}\nsinglePath=false;this.visitChildren(transform,drawableCollection,singlePath,invalidateCache,planeMask,clipPlanes);},visitChildren:function(transform,drawableCollection,singlePath,invalidateCache,planeMask,clipPlanes)\n{var i=0,n=0,cnodes,cnode;var mat_view=drawableCollection.viewMatrix;var center=new x3dom.fields.SFVec3f(0,0,0);center=mat_view.inverse().multMatrixPnt(center);this._eye=transform.inverse().multMatrixPnt(center);var len=this._x3dcenter.subtract(this._eye).length();if(len>this._vf.range){i=0;if(!this._rootNodeLoaded){this._rootNodeLoaded=true;}\ncnodes=this._cf.rootNode.nodes;}\nelse{i=1;if(!this._child1added){this._child1added=true;this.addInlineChild(this._vf.child1Url);}\nif(!this._child2added){this._child2added=true;this.addInlineChild(this._vf.child2Url);}\nif(!this._child3added){this._child3added=true;this.addInlineChild(this._vf.child3Url);}\nif(!this._child4added){this._child4added=true;this.addInlineChild(this._vf.child4Url);}\nif(this._rootNodeLoaded){this._rootNodeLoaded=false;}\ncnodes=this._childUrlNodes.nodes;}\nif(i!==this._lastRangePos){this.postMessage('level_changed',i);}\nthis._lastRangePos=i;n=cnodes.length;if(n&&cnodes)\n{var childTransform=this.transformMatrix(transform);for(i=0;i<n;i++){if((cnode=cnodes[i])){cnode.collectDrawableObjects(childTransform,drawableCollection,singlePath,invalidateCache,planeMask,clipPlanes);}}}},addInlineChild:function(url)\n{var inline=this.newInlineNode(url);this._childUrlNodes.addLink(inline);},newInlineNode:function(url)\n{var inline=new x3dom.nodeTypes.Inline();inline._vf.url=url;inline._nameSpace=this._nameSpace;x3dom.debug.logInfo(\"add url: \"+url);inline.nodeChanged();return inline;},getVolume:function()\n{var vol=this._graph.volume;if(!this.volumeValid()&&this._vf.render)\n{var child,childVol;for(var i=0,n=this._childNodes.length;i<n;i++)\n{if(!(child=this._childNodes[i])||child._vf.render!==true)\ncontinue;childVol=child.getVolume();if(childVol&&childVol.isValid())\nvol.extendBounds(childVol.min,childVol.max);}}\nreturn vol;},nodeChanged:function(){var coords=new x3dom.fields.MFVec3f();coords.push(this._vf.center);this._x3dcenter=x3dom.nodeTypes.GeoCoordinate.prototype.GEOtoX3D(this._vf.geoSystem,this._cf.geoOrigin,coords)[0];if(!this._cf.rootNode.nodes.length){var inline=this.newInlineNode(this._vf.rootUrl);this._cf.rootNode.addLink(inline);}\nthis.invalidateVolume();},fieldChanged:function(fieldName){if(fieldName==\"render\"||fieldName==\"range\"){this.invalidateVolume();}\nif(fieldname==\"center\"){var coords=new x3dom.fields.MFVec3f();coords.push(this._vf.center);this._x3dcenter=x3dom.nodeTypes.GeoCoordinate.prototype.GEOtoX3D(this._vf.geoSystem,this._cf.geoOrigin,coords)[0];this.invalidateVolume();}}}));x3dom.registerNodeType(\"GeoLocation\",\"Geospatial\",defineClass(x3dom.nodeTypes.X3DTransformNode,function(ctx){x3dom.nodeTypes.GeoLocation.superClass.call(this,ctx);this.addField_MFString(ctx,'geoSystem',['GD','WE']);this.addField_SFVec3d(ctx,'geoCoords',0,0,0);this.addField_SFNode('geoOrigin',x3dom.nodeTypes.GeoOrigin);},{nodeChanged:function()\n{var position=this._vf.geoCoords;var geoSystem=this._vf.geoSystem;var geoOrigin=this._cf.geoOrigin;this._trafo=this.getGeoTransRotMat(geoSystem,geoOrigin,position);},getGeoRotMat:function(geoSystem,positionGC)\n{var coords=new x3dom.fields.MFVec3f();coords.push(positionGC);var positionGD=x3dom.nodeTypes.GeoCoordinate.prototype.GCtoGD(geoSystem,coords)[0];var Xaxis=new x3dom.fields.SFVec3f(1,0,0);var rotlat=180-positionGD.y;var deg2rad=Math.PI/180;var rotUpQuat=x3dom.fields.Quaternion.axisAngle(Xaxis,rotlat*deg2rad);var Zaxis=new x3dom.fields.SFVec3f(0,0,1);var rotlon=90+positionGD.x;var rotZQuat=x3dom.fields.Quaternion.axisAngle(Zaxis,rotlon*deg2rad);return rotZQuat.multiply(rotUpQuat).toMatrix();},getGeoTransRotMat:function(geoSystem,geoOrigin,position)\n{var coords=new x3dom.fields.MFVec3f();coords.push(position);var transformed=x3dom.nodeTypes.GeoCoordinate.prototype.GEOtoGC(geoSystem,geoOrigin,coords)[0];var rotMat=this.getGeoRotMat(geoSystem,transformed);if(geoOrigin.node)\n{var origin=x3dom.nodeTypes.GeoCoordinate.prototype.OriginToGC(geoOrigin);if(geoOrigin.node._vf.rotateYUp)\n{var rotMatOrigin=this.getGeoRotMat(geoSystem,origin);return rotMatOrigin.inverse().mult(x3dom.fields.SFMatrix4f.translation(transformed.subtract(origin)).mult(rotMat));}\nreturn x3dom.fields.SFMatrix4f.translation(transformed.subtract(origin)).mult(rotMat);}\nelse\n{return x3dom.fields.SFMatrix4f.translation(transformed).mult(rotMat);}},fieldChanged:function(fieldName)\n{if(fieldName==\"geoSystem\"||fieldName==\"geoCoords\"||fieldName==\"geoOrigin\")\n{var position=this._vf.geoCoords;var geoSystem=this._vf.geoSystem;var geoOrigin=this._cf.geoOrigin;this._trafo=this.getGeoTransRotMat(geoSystem,geoOrigin,position);this.invalidateVolume();}\nelse if(fieldName==\"render\"){this.invalidateVolume();}}}));x3dom.registerNodeType(\"GeoMetadata\",\"Geospatial\",defineClass(x3dom.nodeTypes.X3DInfoNode,function(ctx){x3dom.nodeTypes.GeoMetadata.superClass.call(this,ctx);this.addField_MFString(ctx,'url',[]);this.addField_MFNode('data',x3dom.nodeTypes.X3DInfoNode);this.addField_MFString(ctx,'summary',[]);}));x3dom.registerNodeType(\"GeoOrigin\",\"Geospatial\",defineClass(x3dom.nodeTypes.X3DNode,function(ctx){x3dom.nodeTypes.GeoOrigin.superClass.call(this,ctx);this.addField_MFString(ctx,'geoSystem',['GD','WE']);this.addField_SFVec3d(ctx,'geoCoords',0,0,0);this.addField_SFBool(ctx,'rotateYUp',false);}));x3dom.registerNodeType(\"GeoPositionInterpolator\",\"Geospatial\",defineClass(x3dom.nodeTypes.X3DInterpolatorNode,function(ctx){x3dom.nodeTypes.GeoPositionInterpolator.superClass.call(this,ctx);this.addField_MFString(ctx,'geoSystem',['GD','WE']);this.addField_MFVec3f(ctx,'keyValue',[]);this.addField_SFNode('geoOrigin',x3dom.nodeTypes.GeoOrigin);this.addField_SFBool(ctx,'onGreatCircle',false);},{linearInterpHintKeyValue:function(time,keyHint,key,keyValue,interp){var keylength=key.length;if(time<=key[0])\nreturn[0,keyValue[0]];else if(time>=key[keylength-1])\nreturn[keylength-1,keyValue[keylength-1]];var keyIndexStart=keyHint;var i;for(var ii=0;ii<keylength-1;++ii){i=(keyIndexStart+ii)%keylength;if((key[i]<time)&&(time<=key[i+1]))\nreturn[i,interp(keyValue[i],keyValue[i+1],(time-key[i])/(key[i+1]-key[i]))];i=(keyIndexStart-ii+keylength)%keylength;if((key[i]<time)&&(time<=key[i+1]))\nreturn[i,interp(keyValue[i],keyValue[i+1],(time-key[i])/(key[i+1]-key[i]))];}\nreturn[0,keyValue[0]];},slerp:function(a,b,t){var cosom=a.dot(b)/(a.length()*b.length());var rot1;{rot1=new x3dom.fields.SFVec3f(b.x,b.y,b.z);}\nvar scalerot0,scalerot1;if((1.0-cosom)>0.00001)\n{var omega=Math.acos(cosom);var sinom=Math.sin(omega);scalerot0=Math.sin((1.0-t)*omega)/sinom;scalerot1=Math.sin(t*omega)/sinom;}\nelse\n{scalerot0=1.0-t;scalerot1=t;}\nreturn a.multiply(scalerot0).add(rot1.multiply(scalerot1));},nodeChanged:function(){this._keyValueGC=x3dom.nodeTypes.GeoCoordinate.prototype.GEOtoGC(this._vf.geoSystem,this._cf.geoOrigin,this._vf.keyValue);this._keyHint=0;},fieldChanged:function(fieldName)\n{if(fieldName===\"set_fraction\"){var value,indexValue,valueGC,valueX3D,coords;if(this._vf.onGreatCircle){indexValue=this.linearInterpHintKeyValue(this._vf.set_fraction,this._keyHint,this._vf.key,this._keyValueGC,x3dom.nodeTypes.GeoPositionInterpolator.prototype.slerp);this._keyHint=indexValue[0];valueGC=indexValue[1];coords=new x3dom.fields.MFVec3f();coords.push(valueGC);value=x3dom.nodeTypes.GeoCoordinate.prototype.GCtoGEO(this._vf.geoSystem,this._cf.geoOrigin,coords)[0];}\nelse{indexValue=this.linearInterpHintKeyValue(this._vf.set_fraction,this._keyHint,this._vf.key,this._vf.keyValue,function(a,b,t){return a.multiply(1.0-t).add(b.multiply(t));});this._keyHint=indexValue[0];value=indexValue[1];coords=new x3dom.fields.MFVec3f();coords.push(value);valueGC=x3dom.nodeTypes.GeoCoordinate.prototype.GEOtoGC(this._vf.geoSystem,this._cf.geoOrigin,coords)[0];}\ncoords=new x3dom.fields.MFVec3f();coords.push(valueGC);var GCgeoSystem=new x3dom.fields.MFString();GCgeoSystem.push(\"GC\");GCgeoSystem.push(x3dom.nodeTypes.GeoCoordinate.prototype.getElipsoideCode(this._vf.geoSystem));valueX3D=x3dom.nodeTypes.GeoCoordinate.prototype.GCtoX3D(GCgeoSystem,this._cf.geoOrigin,coords)[0];this.postMessage('value_changed',valueX3D);this.postMessage('geovalue_changed',value);}}}));x3dom.registerNodeType(\"GeoTransform\",\"Geospatial\",defineClass(x3dom.nodeTypes.X3DTransformNode,function(ctx){x3dom.nodeTypes.GeoTransform.superClass.call(this,ctx);this.addField_SFVec3d(ctx,'geoCenter',0,0,0);this.addField_SFRotation(ctx,'rotation',0,0,1,0);this.addField_SFVec3f(ctx,'scale',1,1,1);this.addField_SFRotation(ctx,'scaleOrientation',0,0,1,0);this.addField_SFVec3f(ctx,'translation',0,0,0);this.addField_SFNode('geoOrigin',x3dom.nodeTypes.GeoOrigin);this.addField_MFString(ctx,'geoSystem',['GD','WE']);this.addField_SFBool(ctx,'globalGeoOrigin',false);},{nodeChanged:function()\n{this._trafo=this.getGeoTransform();},getGeoTransform:function()\n{var geoCenterRotMat,geoCenter,skipGO,scaleOrientMat,geoTransform,coords,geoCenterGC,geoSystem,geoOrigin;geoSystem=this._vf.geoSystem;geoOrigin=this._cf.geoOrigin;geoCenter=this._vf.geoCenter;skipGO=this._vf.globalGeoOrigin;scaleOrientMat=this._vf.scaleOrientation.toMatrix();coords=new x3dom.fields.MFVec3f();coords.push(geoCenter);geoCenterGC=x3dom.nodeTypes.GeoCoordinate.prototype.GEOtoGC(geoSystem,geoOrigin,coords)[0];geoCenterRotMat=x3dom.nodeTypes.GeoLocation.prototype.getGeoRotMat(geoSystem,geoCenterGC);geoTransform=x3dom.fields.SFMatrix4f.translation(geoCenterGC).mult(geoCenterRotMat).mult(x3dom.fields.SFMatrix4f.translation(this._vf.translation)).mult(this._vf.rotation.toMatrix()).mult(scaleOrientMat).mult(x3dom.fields.SFMatrix4f.scale(this._vf.scale)).mult(scaleOrientMat.inverse()).mult(geoCenterRotMat.inverse()).mult(x3dom.fields.SFMatrix4f.translation(geoCenterGC.negate()));if(geoOrigin.node)\n{var originGC=x3dom.nodeTypes.GeoCoordinate.prototype.OriginToGC(geoOrigin);if(!skipGO)\n{geoTransform=geoTransform.mult(x3dom.fields.SFMatrix4f.translation(originGC));}\nif(geoOrigin.node._vf.rotateYUp)\n{var rotMatOrigin=x3dom.nodeTypes.GeoLocation.prototype.getGeoRotMat(geoSystem,originGC);if(!skipGO)\n{geoTransform=geoTransform.mult(rotMatOrigin);}}\ngeoTransform=x3dom.fields.SFMatrix4f.translation(originGC.negate()).mult(geoTransform);if(geoOrigin.node._vf.rotateYUp)\n{geoTransform=rotMatOrigin.inverse().mult(geoTransform);}}\nreturn geoTransform;},fieldChanged:function(fieldName)\n{if(fieldName==\"geoCenter\"||fieldName==\"translation\"||fieldName==\"rotation\"||fieldName==\"scale\"||fieldName==\"scaleOrientation\")\n{this._trafo=this.getGeoTransform();this.invalidateVolume();}\nelse if(fieldName==\"render\"){this.invalidateVolume();}}}));x3dom.registerNodeType(\"GeoViewpoint\",\"Geospatial\",defineClass(x3dom.nodeTypes.X3DViewpointNode,function(ctx){x3dom.nodeTypes.GeoViewpoint.superClass.call(this,ctx);this.addField_MFString(ctx,'geoSystem',['GD','WE']);this.addField_SFFloat(ctx,'fieldOfView',0.785398);this.addField_SFRotation(ctx,'orientation',0,0,1,0);this.addField_SFVec3f(ctx,'centerOfRotation',0,0,0);this.addField_SFVec3d(ctx,'position',0,0,100000);this.addField_SFBool(ctx,'headlight',undefined);this.addField_MFString(ctx,'navType',undefined);this.addField_SFFloat(ctx,'speedFactor',1.0);this.addField_SFFloat(ctx,'zNear',-1);this.addField_SFFloat(ctx,'zFar',-1);this.addField_SFBool(ctx,'elevationScaling',true);this.addField_SFNode('geoOrigin',x3dom.nodeTypes.GeoOrigin);this._geoCenterOfRotation=this._vf.centerOfRotation;this._viewMatrix=x3dom.fields.SFMatrix4f.identity();},{activate:function(prev){var viewarea=this._nameSpace.doc._viewarea;if(prev){viewarea.animateTo(this,prev._autoGen?null:prev);}\nviewarea._needNavigationMatrixUpdate=true;x3dom.nodeTypes.X3DBindableNode.prototype.activate.call(this,prev);var navi=viewarea._scene.getNavigationInfo();this._initSpeed=navi._vf.speed;this._examineSpeed=navi._vf.speed;this._lastSpeed=navi._vf.speed;this._userSpeedFactor=1.0;this._lastNavType=navi.getType();x3dom.debug.logInfo(\"initial navigation speed: \"+this._initSpeed);if(this._vf.headlight!==undefined){navi._vf.headlight=this._vf.headlight;}\nif(this._vf.navType!==undefined){navi._vf.navType=this._vf.navType;}},deactivate:function(prev){var viewarea=this._nameSpace.doc._viewarea;var navi=viewarea._scene.getNavigationInfo();navi._vf.speed=this._examineSpeed;x3dom.debug.logInfo(\"navigation speed restored to: \"+this._examineSpeed);x3dom.nodeTypes.X3DBindableNode.prototype.deactivate.call(this,prev);},nodeChanged:function(){this._stack=this._nameSpace.doc._bindableBag.addBindable(this);this._geoOrigin=this._cf.geoOrigin;this._geoSystem=this._vf.geoSystem;this._position=this._vf.position;this._orientation=this._vf.orientation;this._viewMatrix=this.getInitViewMatrix(this._orientation,this._geoSystem,this._geoOrigin,this._position);this._vf.centerOfRotation=this.getGeoCenterOfRotation(this._geoSystem,this._geoOrigin,this._geoCenterOfRotation);this._projMatrix=null;this._lastAspect=1.0;this._zRatio=10000;this._zNear=this._vf.zNear;this._zFar=this._vf.zFar;this._imgPlaneHeightAtDistOne=2.0*Math.tan(this._vf.fieldOfView/2.0);},fieldChanged:function(fieldName){if(fieldName==\"position\"||fieldName==\"orientation\"){this.resetView();}\nelse if(fieldName==\"fieldOfView\"||fieldName==\"zNear\"||fieldName==\"zFar\"){this._projMatrix=null;this._zNear=this._vf.zNear;this._zFar=this._vf.zFar;this._imgPlaneHeightAtDistOne=2.0*Math.tan(this._vf.fieldOfView/2.0);}\nelse if(fieldName.indexOf(\"bind\")>=0){this.bind(this._vf.bind);}},setProjectionMatrix:function(matrix)\n{this._projMatrix=matrix;},getCenterOfRotation:function(){return this.getCurrentTransform().multMatrixPnt(this._vf.centerOfRotation);},getGeoCenterOfRotation:function(geoSystem,geoOrigin,geoCenterOfRotation){var coords=new x3dom.fields.MFVec3f();coords.push(geoCenterOfRotation);var transformed=x3dom.nodeTypes.GeoCoordinate.prototype.GEOtoX3D(geoSystem,geoOrigin,coords);return transformed[0];},isExamineMode:function(navType){return(navType=='examine'||navType=='turntable'||navType=='lookaround'||navType=='lookat');},getViewMatrix:function(){if(this._vf.isActive&&this._vf.elevationScaling){var viewarea=this._nameSpace.doc._viewarea;var navi=viewarea._scene.getNavigationInfo();var navType=navi.getType();if(this.isExamineMode(navType)){if(!this.isExamineMode(this._lastNavType)){navi._vf.speed=this._examineSpeed;}\nthis._lastNavType=navType;}\nelse{if(this.isExamineMode(this._lastNavType)){this._examineSpeed=navi._vf.speed;x3dom.debug.logInfo(\"back from examine mode, resume speed: \"+this._lastSpeed);navi._vf.speed=this._lastSpeed;}\nthis._lastNavType=navType;if(navi._vf.speed!=this._lastSpeed){this._userSpeedFactor*=navi._vf.speed/this._lastSpeed;x3dom.debug.logInfo(\"interactive speed factor changed: \"+this._userSpeedFactor);}\nvar viewtrafo=viewarea._scene.getViewpoint().getCurrentTransform();viewtrafo=viewtrafo.inverse().mult(this._viewMatrix);var position=viewtrafo.inverse().e3();var geoOrigin=this._geoOrigin;var geoSystem=this._geoSystem;var positionGC=position;if(geoOrigin.node){var origin=x3dom.nodeTypes.GeoCoordinate.prototype.OriginToGC(geoOrigin);if(geoOrigin.node._vf.rotateYUp){var rotmat=x3dom.nodeTypes.GeoLocation.prototype.getGeoRotMat(geoSystem,origin);positionGC=rotmat.multMatrixPnt(position);}\npositionGC=positionGC.add(origin);}\nvar coords=new x3dom.fields.MFVec3f();coords.push(positionGC);var positionGD=x3dom.nodeTypes.GeoCoordinate.prototype.GCtoGD(geoSystem,coords)[0];var elevationSpeed=Math.abs(positionGD.z/10);elevationSpeed=elevationSpeed>1?elevationSpeed:1;navi._vf.speed=elevationSpeed*this._vf.speedFactor*this._userSpeedFactor;this._lastSpeed=navi._vf.speed;}}\nreturn this._viewMatrix;},getInitViewMatrix:function(orientation,geoSystem,geoOrigin,position){var coords=new x3dom.fields.MFVec3f();coords.push(position);var positionGC=x3dom.nodeTypes.GeoCoordinate.prototype.GEOtoGC(geoSystem,geoOrigin,coords)[0];var orientMatrix=orientation.toMatrix();var rotMat=x3dom.nodeTypes.GeoLocation.prototype.getGeoRotMat(geoSystem,positionGC);var rotOrient=rotMat.mult(orientMatrix);if(geoOrigin.node){if(geoOrigin.node._vf.rotateYUp){var origin=x3dom.nodeTypes.GeoCoordinate.prototype.OriginToGC(geoOrigin);var rotMatOrigin=x3dom.nodeTypes.GeoLocation.prototype.getGeoRotMat(geoSystem,origin);rotOrient=rotMatOrigin.inverse().mult(rotOrient);}}\nvar positionX3D=x3dom.nodeTypes.GeoCoordinate.prototype.GEOtoX3D(geoSystem,geoOrigin,coords)[0];return x3dom.fields.SFMatrix4f.translation(positionX3D).mult(rotOrient).inverse();},getFieldOfView:function(){return this._vf.fieldOfView;},resetView:function(){this._viewMatrix=this.getInitViewMatrix(this._vf.orientation,this._vf.geoSystem,this._cf.geoOrigin,this._vf.position);this._vf.centerOfRotation=this.getGeoCenterOfRotation(this._vf.geoSystem,this._cf.geoOrigin,this._geoCenterOfRotation);if(this._nameSpace.doc._viewarea){this._nameSpace.doc._viewarea.resetNavHelpers();}},getNear:function(){return this._zNear;},getFar:function(){return this._zFar;},getImgPlaneHeightAtDistOne:function(){return this._imgPlaneHeightAtDistOne;},getProjectionMatrix:function(aspect)\n{var fovy=this._vf.fieldOfView;var zfar=this._vf.zFar;var znear=this._vf.zNear;if(znear<=0||zfar<=0)\n{var nearScale=0.8,farScale=1.2;var viewarea=this._nameSpace.doc._viewarea;var scene=viewarea._scene;var min=x3dom.fields.SFVec3f.copy(scene._lastMin);var max=x3dom.fields.SFVec3f.copy(scene._lastMax);var dia=max.subtract(min);var sRad=dia.length()/2;var mat=viewarea.getViewMatrix().inverse();var vp=mat.e3();var translation=new x3dom.fields.SFVec3f(0,0,0),scaleFactor=new x3dom.fields.SFVec3f(1,1,1);var rotation=new x3dom.fields.Quaternion(0,0,1,0),scaleOrientation=new x3dom.fields.Quaternion(0,0,1,0);mat.getTransform(translation,rotation,scaleFactor,scaleOrientation);var minScal=scaleFactor.x,maxScal=scaleFactor.x;if(maxScal<scaleFactor.y)maxScal=scaleFactor.y;if(minScal>scaleFactor.y)minScal=scaleFactor.y;if(maxScal<scaleFactor.z)maxScal=scaleFactor.z;if(minScal>scaleFactor.z)minScal=scaleFactor.z;if(maxScal>1)\nnearScale/=maxScal;else if(minScal>x3dom.fields.Eps&&minScal<1)\nfarScale/=minScal;var sCenter=min.add(dia.multiply(0.5));var vDist=(vp.subtract(sCenter)).length();if(sRad){if(vDist>sRad)\nznear=(vDist-sRad)*nearScale;else\nznear=0;zfar=(vDist+sRad)*farScale;}\nelse{znear=0.1;zfar=100000;}\nvar zNearLimit=zfar/this._zRatio;znear=Math.max(znear,Math.max(x3dom.fields.Eps,zNearLimit));if(zfar>this._vf.zNear&&this._vf.zNear>0)\nznear=this._vf.zNear;if(this._vf.zFar>znear)\nzfar=this._vf.zFar;if(zfar<=znear)\nzfar=znear+1;}\nif(this._projMatrix==null)\n{this._projMatrix=x3dom.fields.SFMatrix4f.perspective(fovy,aspect,znear,zfar);}\nelse if(this._zNear!=znear||this._zFar!=zfar)\n{var div=znear-zfar;this._projMatrix._22=(znear+zfar)/div;this._projMatrix._23=2*znear*zfar/div;}\nelse if(this._lastAspect!=aspect)\n{this._projMatrix._00=(1/Math.tan(fovy/2))/aspect;this._lastAspect=aspect;}\nthis._zNear=znear;this._zFar=zfar;return this._projMatrix;}}));x3dom.registerNodeType(\"ScreenGroup\",\"Layout\",defineClass(x3dom.nodeTypes.X3DGroupingNode,function(ctx){x3dom.nodeTypes.ScreenGroup.superClass.call(this,ctx);},{collectDrawableObjects:function(transform,drawableCollection,singlePath,invalidateCache,planeMask,clipPlanes)\n{if(singlePath&&(this._parentNodes.length>1))\nsinglePath=false;if(singlePath&&(invalidateCache=invalidateCache||this.cacheInvalid()))\nthis.invalidateCache();planeMask=drawableCollection.cull(transform,this.graphState(),singlePath,planeMask);if(planeMask<0){return;}\nsinglePath=false;var doc,vp,minus_one,zero,viewport_height,one_to_one_pixel_depth,view_transform,view_direction,model_transform,camera_position,screengroup_position,viewpoint_to_screengroup,ratio,scale_matrix;doc=this._nameSpace.doc;vp=doc._scene.getViewpoint();viewport_height=doc._x3dElem.clientHeight;one_to_one_pixel_depth=viewport_height/vp.getImgPlaneHeightAtDistOne();minus_one=new x3dom.fields.SFVec3f(0,0,-1.0);zero=new x3dom.fields.SFVec3f(0,0,0);view_transform=drawableCollection.viewMatrix;model_transform=transform;view_direction=minus_one;camera_position=zero;screengroup_position=view_transform.multMatrixPnt(model_transform.multMatrixPnt(zero));viewpoint_to_screengroup=screengroup_position.subtract(camera_position);ratio=view_direction.dot(viewpoint_to_screengroup)/one_to_one_pixel_depth;scale_matrix=x3dom.fields.SFMatrix4f.scale(new x3dom.fields.SFVec3f(ratio,ratio,ratio));var childTransform=this.transformMatrix(model_transform.mult(scale_matrix));for(var i=0,i_n=this._childNodes.length;i<i_n;i++)\n{var cnode=this._childNodes[i];if(cnode){cnode.collectDrawableObjects(childTransform,drawableCollection,singlePath,invalidateCache,planeMask,clipPlanes);}}}}));x3dom.registerNodeType(\"X3DPlanarGeometryNode\",\"Geometry2D\",defineClass(x3dom.nodeTypes.X3DGeometryNode,function(ctx){x3dom.nodeTypes.X3DPlanarGeometryNode.superClass.call(this,ctx);}));x3dom.registerNodeType(\"Arc2D\",\"Geometry2D\",defineClass(x3dom.nodeTypes.X3DPlanarGeometryNode,function(ctx){x3dom.nodeTypes.Arc2D.superClass.call(this,ctx);this.addField_SFFloat(ctx,'radius',1);this.addField_SFFloat(ctx,'startAngle',0);this.addField_SFFloat(ctx,'endAngle',1.570796);this.addField_SFFloat(ctx,'subdivision',32);this._mesh._primType='LINES';var r=this._vf.radius;var start=this._vf.startAngle;var end=this._vf.endAngle;var Pi2=Math.PI*2.0;start-=Math.floor(start/Pi2)*Pi2;end-=Math.floor(end/Pi2)*Pi2;if(end<=start)\nend+=Pi2;var geoCacheID='Arc2D_'+r+start+end;if(this._vf.useGeoCache&&x3dom.geoCache[geoCacheID]!==undefined){this._mesh=x3dom.geoCache[geoCacheID];}else{var anzahl=this._vf.subdivision;var t=(end-start)/anzahl;var theta=start;for(var i=0;i<=anzahl+1;i++){var x=Math.cos(theta)*r;var y=Math.sin(theta)*r;this._mesh._positions[0].push(x);this._mesh._positions[0].push(y);this._mesh._positions[0].push(0.0);theta+=t;}\nfor(var j=0;j<anzahl;j++){this._mesh._indices[0].push(j);this._mesh._indices[0].push(j+1);}\nthis._mesh._invalidate=true;this._mesh._numFaces=this._mesh._indices[0].length/2;this._mesh._numCoords=this._mesh._positions[0].length/3;x3dom.geoCache[geoCacheID]=this._mesh;}},{fieldChanged:function(fieldName){if(fieldName==\"radius\"||fieldName==\"subdivision\"||fieldName==\"startAngle\"||fieldName==\"endAngle\"){this._mesh._positions[0]=[];this._mesh._indices[0]=[];var r=this._vf.radius;var start=this._vf.startAngle;var end=this._vf.endAngle;var anzahl=this._vf.subdivision;var Pi2=Math.PI*2.0;start-=Math.floor(start/Pi2)*Pi2;end-=Math.floor(end/Pi2)*Pi2;if(end<=start)\nend+=Pi2;var t=(end-start)/anzahl;var theta=start;for(var i=0;i<=anzahl+1;i++){var x=Math.cos(theta)*r;var y=Math.sin(theta)*r;this._mesh._positions[0].push(x);this._mesh._positions[0].push(y);this._mesh._positions[0].push(0.0);theta+=t;}\nfor(var j=0;j<anzahl;j++){this._mesh._indices[0].push(j);this._mesh._indices[0].push(j+1);}\nthis.invalidateVolume();this._mesh._numFaces=this._mesh._indices[0].length/2;this._mesh._numCoords=this._mesh._positions[0].length/3;Array.forEach(this._parentNodes,function(node){node._dirty.positions=true;node._dirty.indexes=true;node.invalidateVolume();});}}}));x3dom.registerNodeType(\"ArcClose2D\",\"Geometry2D\",defineClass(x3dom.nodeTypes.X3DPlanarGeometryNode,function(ctx){x3dom.nodeTypes.ArcClose2D.superClass.call(this,ctx);this.addField_SFString(ctx,'closureType',\"PIE\");this.addField_SFFloat(ctx,'radius',1);this.addField_SFFloat(ctx,'startAngle',0);this.addField_SFFloat(ctx,'endAngle',1.570796);this.addField_SFFloat(ctx,'subdivision',32);var r=this._vf.radius;var start=this._vf.startAngle;var end=this._vf.endAngle;var anzahl=this._vf.subdivision;var Pi2=Math.PI*2.0;start-=Math.floor(start/Pi2)*Pi2;end-=Math.floor(end/Pi2)*Pi2;if(end<=start)\nend+=Pi2;var geoCacheID='ArcClose2D_'+r+start+end+this._vf.closureType;if(this._vf.useGeoCache&&x3dom.geoCache[geoCacheID]!==undefined){this._mesh=x3dom.geoCache[geoCacheID];}else{var t=(end-start)/anzahl;var theta=start;if(this._vf.closureType.toUpperCase()=='PIE'){this._mesh._positions[0].push(0.0);this._mesh._positions[0].push(0.0);this._mesh._positions[0].push(0.0);this._mesh._normals[0].push(0);this._mesh._normals[0].push(0);this._mesh._normals[0].push(1);this._mesh._texCoords[0].push(0.5);this._mesh._texCoords[0].push(0.5);for(var i=0;i<=anzahl;i++){var x=Math.cos(theta)*r;var y=Math.sin(theta)*r;this._mesh._positions[0].push(x);this._mesh._positions[0].push(y);this._mesh._positions[0].push(0.0);this._mesh._normals[0].push(0);this._mesh._normals[0].push(0);this._mesh._normals[0].push(1);this._mesh._texCoords[0].push((x+r)/(2*r));this._mesh._texCoords[0].push((y+r)/(2*r));theta+=t;}\nfor(var j=1;j<=anzahl;j++){this._mesh._indices[0].push(j+1);this._mesh._indices[0].push(0);this._mesh._indices[0].push(j);}}else{for(var i=0;i<=anzahl;i++){var x=Math.cos(theta)*r;var y=Math.sin(theta)*r;this._mesh._positions[0].push(x);this._mesh._positions[0].push(y);this._mesh._positions[0].push(0.0);this._mesh._normals[0].push(0);this._mesh._normals[0].push(0);this._mesh._normals[0].push(1);this._mesh._texCoords[0].push((x+r)/(2*r));this._mesh._texCoords[0].push((y+r)/(2*r));theta+=t;}\nvar x=(this._mesh._positions[0][0]+this._mesh._positions[0][this._mesh._positions[0].length-3])/2;var y=(this._mesh._positions[0][1]+this._mesh._positions[0][this._mesh._positions[0].length-2])/2;this._mesh._positions[0].push(x);this._mesh._positions[0].push(y);this._mesh._positions[0].push(0.0);this._mesh._normals[0].push(0);this._mesh._normals[0].push(0);this._mesh._normals[0].push(1);this._mesh._texCoords[0].push((x+r)/(2*r));this._mesh._texCoords[0].push((y+r)/(2*r));for(var j=0;j<anzahl;j++){this._mesh._indices[0].push(j+1);this._mesh._indices[0].push(anzahl+1);this._mesh._indices[0].push(j);}}\nthis._mesh._numTexComponents=2;this._mesh._invalidate=true;this._mesh._numFaces=this._mesh._indices[0].length/2;this._mesh._numCoords=this._mesh._positions[0].length/3;x3dom.geoCache[geoCacheID]=this._mesh;}},{fieldChanged:function(fieldName){var r=this._vf.radius;var start=this._vf.startAngle;var end=this._vf.endAngle;var anzahl=this._vf.subdivision;var Pi2=Math.PI*2.0;start-=Math.floor(start/Pi2)*Pi2;end-=Math.floor(end/Pi2)*Pi2;if(end<=start)\nend+=Pi2;var t=(end-start)/anzahl;var theta=start;if(fieldName===\"radius\"){this._mesh._positions[0]=[];if(this._vf.closureType.toUpperCase()=='PIE'){this._mesh._positions[0].push(0.0);this._mesh._positions[0].push(0.0);this._mesh._positions[0].push(0.0);for(var i=0;i<=anzahl;i++){var x=Math.cos(theta)*r;var y=Math.sin(theta)*r;this._mesh._positions[0].push(x);this._mesh._positions[0].push(y);this._mesh._positions[0].push(0.0);theta+=t;}}else{for(var i=0;i<=anzahl;i++){var x=Math.cos(theta)*r;var y=Math.sin(theta)*r;this._mesh._positions[0].push(x);this._mesh._positions[0].push(y);this._mesh._positions[0].push(0.0);theta+=t;}\nvar x=(this._mesh._positions[0][0]+this._mesh._positions[0][this._mesh._positions[0].length-3])/2;var y=(this._mesh._positions[0][1]+this._mesh._positions[0][this._mesh._positions[0].length-2])/2;this._mesh._positions[0].push(x);this._mesh._positions[0].push(y);this._mesh._positions[0].push(0.0);}\nthis.invalidateVolume();this._mesh._numCoords=this._mesh._positions[0].length/3;Array.forEach(this._parentNodes,function(node){node._dirty.positions=true;node.invalidateVolume();});}else if(fieldName==\"closureType\"||fieldName==\"subdivision\"||fieldName==\"startAngle\"||fieldName==\"endAngle\"){this._mesh._positions[0]=[];this._mesh._indices[0]=[];this._mesh._normals[0]=[];this._mesh._texCoords[0]=[];if(this._vf.closureType.toUpperCase()=='PIE'){this._mesh._positions[0].push(0.0);this._mesh._positions[0].push(0.0);this._mesh._positions[0].push(0.0);this._mesh._normals[0].push(0);this._mesh._normals[0].push(0);this._mesh._normals[0].push(1);this._mesh._texCoords[0].push(0.5);this._mesh._texCoords[0].push(0.5);for(var i=0;i<=anzahl;i++){var x=Math.cos(theta)*r;var y=Math.sin(theta)*r;this._mesh._positions[0].push(x);this._mesh._positions[0].push(y);this._mesh._positions[0].push(0.0);this._mesh._normals[0].push(0);this._mesh._normals[0].push(0);this._mesh._normals[0].push(1);this._mesh._texCoords[0].push((x+r)/(2*r));this._mesh._texCoords[0].push((y+r)/(2*r));theta+=t;}\nfor(var j=1;j<=anzahl;j++){this._mesh._indices[0].push(j+1);this._mesh._indices[0].push(0);this._mesh._indices[0].push(j);}}else{for(var i=0;i<=anzahl;i++){var x=Math.cos(theta)*r;var y=Math.sin(theta)*r;this._mesh._positions[0].push(x);this._mesh._positions[0].push(y);this._mesh._positions[0].push(0.0);this._mesh._normals[0].push(0);this._mesh._normals[0].push(0);this._mesh._normals[0].push(1);this._mesh._texCoords[0].push((x+r)/(2*r));this._mesh._texCoords[0].push((y+r)/(2*r));theta+=t;}\nvar x=(this._mesh._positions[0][0]+this._mesh._positions[0][this._mesh._positions[0].length-3])/2;var y=(this._mesh._positions[0][1]+this._mesh._positions[0][this._mesh._positions[0].length-2])/2;this._mesh._positions[0].push(x);this._mesh._positions[0].push(y);this._mesh._positions[0].push(0.0);this._mesh._normals[0].push(0);this._mesh._normals[0].push(0);this._mesh._normals[0].push(1);this._mesh._texCoords[0].push((x+r)/(2*r));this._mesh._texCoords[0].push((y+r)/(2*r));for(var j=0;j<anzahl;j++){this._mesh._indices[0].push(j+1);this._mesh._indices[0].push(anzahl+1);this._mesh._indices[0].push(j);}}\nthis._mesh._numTexComponents=2;this.invalidateVolume();this._mesh._numFaces=this._mesh._indices[0].length/2;this._mesh._numCoords=this._mesh._positions[0].length/3;Array.forEach(this._parentNodes,function(node){node.setAllDirty();});}}}));x3dom.registerNodeType(\"Circle2D\",\"Geometry2D\",defineClass(x3dom.nodeTypes.X3DPlanarGeometryNode,function(ctx){x3dom.nodeTypes.Circle2D.superClass.call(this,ctx);this.addField_SFFloat(ctx,'radius',1);this.addField_SFFloat(ctx,'subdivision',32);this._mesh._primType='LINES';var r=this._vf.radius;var geoCacheID='Circle2D_'+r;if(this._vf.useGeoCache&&x3dom.geoCache[geoCacheID]!==undefined){this._mesh=x3dom.geoCache[geoCacheID];}else{var anzahl=this._vf.subdivision;for(var i=0;i<=anzahl;i++){var theta=i*((2*Math.PI)/anzahl);var x=Math.cos(theta)*r;var y=Math.sin(theta)*r;this._mesh._positions[0].push(x);this._mesh._positions[0].push(y);this._mesh._positions[0].push(0.0);}\nfor(i=0;i<anzahl;i++){this._mesh._indices[0].push(i);if((i+1)==anzahl){this._mesh._indices[0].push(0);}else{this._mesh._indices[0].push(i+1);}}\nthis._mesh._invalidate=true;this._mesh._numFaces=this._mesh._indices[0].length/2;this._mesh._numCoords=this._mesh._positions[0].length/3;x3dom.geoCache[geoCacheID]=this._mesh;}},{fieldChanged:function(fieldName){if(fieldName==\"radius\"||fieldName==\"subdivision\"){var r=this._vf.radius;var anzahl=this._vf.subdivision;this._mesh._positions[0]=[];this._mesh._indices[0]=[];for(var i=0;i<=anzahl;i++){var theta=i*((2*Math.PI)/anzahl);var x=Math.cos(theta)*r;var y=Math.sin(theta)*r;this._mesh._positions[0].push(x);this._mesh._positions[0].push(y);this._mesh._positions[0].push(0.0);}\nfor(i=0;i<anzahl;i++){this._mesh._indices[0].push(i);if((i+1)==anzahl){this._mesh._indices[0].push(0);}else{this._mesh._indices[0].push(i+1);}}\nthis.invalidateVolume();this._mesh._numFaces=this._mesh._indices[0].length/2;this._mesh._numCoords=this._mesh._positions[0].length/3;Array.forEach(this._parentNodes,function(node){node._dirty.positions=true;node._dirty.indexes=true;node.invalidateVolume();});}}}));x3dom.registerNodeType(\"Disk2D\",\"Geometry2D\",defineClass(x3dom.nodeTypes.X3DPlanarGeometryNode,function(ctx){x3dom.nodeTypes.Disk2D.superClass.call(this,ctx);this.addField_SFFloat(ctx,'innerRadius',0);this.addField_SFFloat(ctx,'outerRadius',1);this.addField_SFFloat(ctx,'subdivision',32);var ir=this._vf.innerRadius;var or=this._vf.outerRadius;var geoCacheID='Disk2D_'+ir+or;if(this._vf.useGeoCache&&x3dom.geoCache[geoCacheID]!==undefined){this._mesh=x3dom.geoCache[geoCacheID];}else{var anzahl=this._vf.subdivision;for(var i=0;i<=anzahl;i++){var theta=i*((2*Math.PI)/anzahl);var ox=Math.cos(theta)*or;var oy=Math.sin(theta)*or;var ix=Math.cos(theta)*ir;var iy=Math.sin(theta)*ir;this._mesh._positions[0].push(ox);this._mesh._positions[0].push(oy);this._mesh._positions[0].push(0.0);this._mesh._normals[0].push(0);this._mesh._normals[0].push(0);this._mesh._normals[0].push(1);this._mesh._texCoords[0].push((ox+or)/(2*or));this._mesh._texCoords[0].push((oy+or)/(2*or));this._mesh._positions[0].push(ix);this._mesh._positions[0].push(iy);this._mesh._positions[0].push(0.0);this._mesh._normals[0].push(0);this._mesh._normals[0].push(0);this._mesh._normals[0].push(1);this._mesh._texCoords[0].push((ix+or)/(2*or));this._mesh._texCoords[0].push((iy+or)/(2*or));}\nfor(i=0;i<anzahl*2;i=i+2){if(i==(anzahl*2)-2){this._mesh._indices[0].push(i+1);this._mesh._indices[0].push(i);this._mesh._indices[0].push(1);this._mesh._indices[0].push(1);this._mesh._indices[0].push(i);this._mesh._indices[0].push(0);}else{this._mesh._indices[0].push(i+1);this._mesh._indices[0].push(i);this._mesh._indices[0].push(i+3);this._mesh._indices[0].push(i+3);this._mesh._indices[0].push(i);this._mesh._indices[0].push(i+2);}}\nthis._mesh._numTexComponents=2;this._mesh._invalidate=true;this._mesh._numFaces=this._mesh._indices[0].length/2;this._mesh._numCoords=this._mesh._positions[0].length/3;x3dom.geoCache[geoCacheID]=this._mesh;}},{fieldChanged:function(fieldName){if(fieldName==\"innerRadius\"||fieldName==\"outerRadius\"||fieldName==\"subdivision\"){this._mesh._positions[0]=[];this._mesh._indices[0]=[];this._mesh._normals[0]=[];this._mesh._texCoords[0]=[];var ir=this._vf.innerRadius;var or=this._vf.outerRadius;var anzahl=this._vf.subdivision;for(var i=0;i<=anzahl;i++){var theta=i*((2*Math.PI)/anzahl);var ox=Math.cos(theta)*or;var oy=Math.sin(theta)*or;var ix=Math.cos(theta)*ir;var iy=Math.sin(theta)*ir;this._mesh._positions[0].push(ox);this._mesh._positions[0].push(oy);this._mesh._positions[0].push(0.0);this._mesh._normals[0].push(0);this._mesh._normals[0].push(0);this._mesh._normals[0].push(1);this._mesh._texCoords[0].push((ox+or)/(2*or));this._mesh._texCoords[0].push((oy+or)/(2*or));this._mesh._positions[0].push(ix);this._mesh._positions[0].push(iy);this._mesh._positions[0].push(0.0);this._mesh._normals[0].push(0);this._mesh._normals[0].push(0);this._mesh._normals[0].push(1);this._mesh._texCoords[0].push((ix+or)/(2*or));this._mesh._texCoords[0].push((iy+or)/(2*or));}\nfor(i=0;i<anzahl*2;i=i+2){if(i==(anzahl*2)-2){this._mesh._indices[0].push(i+1);this._mesh._indices[0].push(i);this._mesh._indices[0].push(1);this._mesh._indices[0].push(1);this._mesh._indices[0].push(i);this._mesh._indices[0].push(0);}else{this._mesh._indices[0].push(i+1);this._mesh._indices[0].push(i);this._mesh._indices[0].push(i+3);this._mesh._indices[0].push(i+3);this._mesh._indices[0].push(i);this._mesh._indices[0].push(i+2);}}\nthis._mesh._numTexComponents=2;this.invalidateVolume();this._mesh._numFaces=this._mesh._indices[0].length/3;this._mesh._numCoords=this._mesh._positions[0].length/3;Array.forEach(this._parentNodes,function(node){node.setAllDirty();});}}}));x3dom.registerNodeType(\"Polyline2D\",\"Geometry2D\",defineClass(x3dom.nodeTypes.X3DPlanarGeometryNode,function(ctx){x3dom.nodeTypes.Polyline2D.superClass.call(this,ctx);this.addField_MFVec2f(ctx,'lineSegments',[]);this._mesh._primType='LINES';var x=0,y=0;if(this._vf.lineSegments.length){x=this._vf.lineSegments[0].x;y=this._vf.lineSegments[0].y;}\nvar geoCacheID='Polyline2D_'+x+'-'+y;if(this._vf.useGeoCache&&x3dom.geoCache[geoCacheID]!==undefined){this._mesh=x3dom.geoCache[geoCacheID];}\nelse{for(var i=0;i<this._vf.lineSegments.length;i++){x=this._vf.lineSegments[i].x;y=this._vf.lineSegments[i].y;this._mesh._positions[0].push(x);this._mesh._positions[0].push(y);this._mesh._positions[0].push(0.0);}\nfor(var j=0;j<this._vf.lineSegments.length-1;j++){this._mesh._indices[0].push(j);this._mesh._indices[0].push(j+1);}\nthis._mesh._invalidate=true;this._mesh._numFaces=this._mesh._indices[0].length/2;this._mesh._numCoords=this._mesh._positions[0].length/3;x3dom.geoCache[geoCacheID]=this._mesh;}},{fieldChanged:function(fieldName){if(fieldName==\"lineSegments\"){var x,y;this._mesh._positions[0]=[];this._mesh._indices[0]=[];for(var i=0;i<this._vf.lineSegments.length;i++){x=this._vf.lineSegments[i].x;y=this._vf.lineSegments[i].y;this._mesh._positions[0].push(x);this._mesh._positions[0].push(y);this._mesh._positions[0].push(0.0);}\nfor(var j=0;j<this._vf.lineSegments.length-1;j++){this._mesh._indices[0].push(j);this._mesh._indices[0].push(j+1);}\nthis.invalidateVolume();this._mesh._numFaces=this._mesh._indices[0].length/2;this._mesh._numCoords=this._mesh._positions[0].length/3;Array.forEach(this._parentNodes,function(node){node._dirty.positions=true;node._dirty.indexes=true;node.invalidateVolume();});}}}));x3dom.registerNodeType(\"Polypoint2D\",\"Geometry2D\",defineClass(x3dom.nodeTypes.X3DPlanarGeometryNode,function(ctx){x3dom.nodeTypes.Polypoint2D.superClass.call(this,ctx);this.addField_MFVec2f(ctx,'point',[]);this._mesh._primType='POINTS';var x=0,y=0;if(this._vf.point.length){x=this._vf.point[0].x;y=this._vf.point[0].y;}\nvar geoCacheID='Polypoint2D_'+x+'-'+y;if(this._vf.useGeoCache&&x3dom.geoCache[geoCacheID]!==undefined){this._mesh=x3dom.geoCache[geoCacheID];}\nelse{for(var i=0;i<this._vf.point.length;i++){x=this._vf.point[i].x;y=this._vf.point[i].y;this._mesh._positions[0].push(x);this._mesh._positions[0].push(y);this._mesh._positions[0].push(0.0);}\nthis._mesh._invalidate=true;this._mesh._numCoords=this._mesh._positions[0].length/3;x3dom.geoCache[geoCacheID]=this._mesh;}},{fieldChanged:function(fieldName){if(fieldName==\"point\"){this._mesh._positions[0]=[];this._mesh._indices[0]=[];for(var i=0;i<this._vf.point.length;i++){var x=this._vf.point[i].x;var y=this._vf.point[i].y;this._mesh._positions[0].push(x);this._mesh._positions[0].push(y);this._mesh._positions[0].push(0.0);}\nthis.invalidateVolume();this._mesh._numCoords=this._mesh._positions[0].length/3;Array.forEach(this._parentNodes,function(node){node._dirty.positions=true;node.invalidateVolume();});}}}));x3dom.registerNodeType(\"Rectangle2D\",\"Geometry2D\",defineClass(x3dom.nodeTypes.X3DPlanarGeometryNode,function(ctx){x3dom.nodeTypes.Rectangle2D.superClass.call(this,ctx);this.addField_SFVec2f(ctx,'size',2,2);this.addField_SFVec2f(ctx,'subdivision',1,1);var sx=this._vf.size.x,sy=this._vf.size.y;var partx=this._vf.subdivision.x,party=this._vf.subdivision.y;var geoCacheID='Rectangle2D_'+sx+'-'+sy;if(this._vf.useGeoCache&&x3dom.geoCache[geoCacheID]!==undefined){this._mesh=x3dom.geoCache[geoCacheID];}\nelse{var xstep=sx/partx;var ystep=sy/party;sx/=2;sy/=2;for(var i=0;i<=partx;i++){for(var j=0;j<=party;j++){this._mesh._positions[0].push(i*xstep-sx,j*ystep-sy,0);this._mesh._normals[0].push(0,0,1);this._mesh._texCoords[0].push(i/partx,j/party);}}\nfor(var i=1;i<=party;i++){for(var j=0;j<partx;j++){this._mesh._indices[0].push((i-1)*(partx+1)+j+1);this._mesh._indices[0].push((i-1)*(partx+1)+j);this._mesh._indices[0].push(i*(partx+1)+j);this._mesh._indices[0].push((i-1)*(partx+1)+j+1);this._mesh._indices[0].push(i*(partx+1)+j);this._mesh._indices[0].push(i*(partx+1)+j+1);}}\nthis._mesh._invalidate=true;this._mesh._numFaces=this._mesh._indices[0].length/3;this._mesh._numCoords=this._mesh._positions[0].length/3;x3dom.geoCache[geoCacheID]=this._mesh;}},{fieldChanged:function(fieldName){if(fieldName==\"size\"){this._mesh._positions[0]=[];var size=this._vf.size;var sx=size.x/2;var sy=size.y/2;var partx=this._vf.subdivision.x,party=this._vf.subdivision.y;var xstep=sx/partx;var ystep=sy/party;sx/=2;sy/=2;for(var i=0;i<=partx;i++){for(var j=0;j<=party;j++){this._mesh._positions[0].push(i*xstep-sx,j*ystep-sy,0);}}\nthis.invalidateVolume();this._mesh._numCoords=this._mesh._positions[0].length/3;Array.forEach(this._parentNodes,function(node){node.setAllDirty();});}else if(fieldName==\"subdivision\"){this._mesh._positions[0]=[];this._mesh._indices[0]=[];this._mesh._normals[0]=[];this._mesh._texCoords[0]=[];var sx=this._vf.size.x/2;var sy=this._vf.size.y/2;var partx=this._vf.subdivision.x,party=this._vf.subdivision.y;var xstep=sx/partx;var ystep=sy/party;sx/=2;sy/=2;for(var i=0;i<=partx;i++){for(var j=0;j<=party;j++){this._mesh._positions[0].push(i*xstep-sx,j*ystep-sy,0);this._mesh._normals[0].push(0,0,1);this._mesh._texCoords[0].push(i/partx,j/party);}}\nfor(var i=1;i<=party;i++){for(var j=0;j<partx;j++){this._mesh._indices[0].push((i-1)*(partx+1)+j+1);this._mesh._indices[0].push((i-1)*(partx+1)+j);this._mesh._indices[0].push(i*(partx+1)+j);this._mesh._indices[0].push((i-1)*(partx+1)+j+1);this._mesh._indices[0].push(i*(partx+1)+j);this._mesh._indices[0].push(i*(partx+1)+j+1);}}\nthis.invalidateVolume();this._mesh._numFaces=this._mesh._indices[0].length/3;this._mesh._numCoords=this._mesh._positions[0].length/3;Array.forEach(this._parentNodes,function(node){node.setAllDirty();});}}}));x3dom.registerNodeType(\"TriangleSet2D\",\"Geometry2D\",defineClass(x3dom.nodeTypes.X3DPlanarGeometryNode,function(ctx){x3dom.nodeTypes.TriangleSet2D.superClass.call(this,ctx);this.addField_MFVec2f(ctx,'vertices',[]);var x=0,y=0;if(this._vf.vertices.length){x=this._vf.vertices[0].x;y=this._vf.vertices[0].y;}\nvar geoCacheID='TriangleSet2D_'+x+'-'+y;if(this._vf.useGeoCache&&x3dom.geoCache[geoCacheID]!==undefined){this._mesh=x3dom.geoCache[geoCacheID];}\nelse{var minx=0,miny=0,maxx=0,maxy=0;if(this._vf.vertices.length){minx=this._vf.vertices[0].x;miny=this._vf.vertices[0].y;maxx=this._vf.vertices[0].x;maxy=this._vf.vertices[0].y;}\nfor(var i=0;i<this._vf.vertices.length;i++){if(this._vf.vertices[i].x<minx){minx=this._vf.vertices[i].x}\nif(this._vf.vertices[i].y<miny){miny=this._vf.vertices[i].y}\nif(this._vf.vertices[i].x>maxx){maxx=this._vf.vertices[i].x}\nif(this._vf.vertices[i].y>maxy){maxy=this._vf.vertices[i].y}}\nfor(var i=0;i<this._vf.vertices.length;i++){x=this._vf.vertices[i].x;y=this._vf.vertices[i].y;this._mesh._positions[0].push(x);this._mesh._positions[0].push(y);this._mesh._positions[0].push(0.0);this._mesh._normals[0].push(0);this._mesh._normals[0].push(0);this._mesh._normals[0].push(1);this._mesh._texCoords[0].push((x-minx)/(maxx-minx));this._mesh._texCoords[0].push((y-miny)/(maxy-miny));}\nfor(var j=0;j<this._vf.vertices.length;j+=3){this._mesh._indices[0].push(j);this._mesh._indices[0].push(j+2);this._mesh._indices[0].push(j+1);}\nthis._mesh._numTexComponents=2;this._mesh._invalidate=true;this._mesh._numFaces=this._mesh._indices[0].length/3;this._mesh._numCoords=this._mesh._positions[0].length/3;x3dom.geoCache[geoCacheID]=this._mesh;}},{fieldChanged:function(fieldName){if(fieldName==\"vertices\"){this._mesh._positions[0]=[];this._mesh._indices[0]=[];this._mesh._normals[0]=[];this._mesh._texCoords[0]=[];var minx=this._vf.vertices[0].x;var miny=this._vf.vertices[0].y;var maxx=this._vf.vertices[0].x;var maxy=this._vf.vertices[0].y;for(var i=0;i<this._vf.vertices.length;i++){if(this._vf.vertices[i].x<minx){minx=this._vf.vertices[i].x}\nif(this._vf.vertices[i].y<miny){miny=this._vf.vertices[i].y}\nif(this._vf.vertices[i].x>maxx){maxx=this._vf.vertices[i].x}\nif(this._vf.vertices[i].y>maxy){maxy=this._vf.vertices[i].y}}\nfor(var i=0;i<this._vf.vertices.length;i++){var x=this._vf.vertices[i].x;var y=this._vf.vertices[i].y;this._mesh._positions[0].push(x);this._mesh._positions[0].push(y);this._mesh._positions[0].push(0.0);this._mesh._normals[0].push(0);this._mesh._normals[0].push(0);this._mesh._normals[0].push(1);this._mesh._texCoords[0].push((x-minx)/(maxx-minx));this._mesh._texCoords[0].push((y-miny)/(maxy-miny));}\nfor(var j=0;j<this._vf.vertices.length;j+=3){this._mesh._indices[0].push(j);this._mesh._indices[0].push(j+2);this._mesh._indices[0].push(j+1);}\nthis._mesh._numTexComponents=2;this.invalidateVolume();this._mesh._numFaces=this._mesh._indices[0].length/3;this._mesh._numCoords=this._mesh._positions[0].length/3;Array.forEach(this._parentNodes,function(node){node.setAllDirty();});}}}));x3dom.registerNodeType(\"X3DVolumeDataNode\",\"VolumeRendering\",defineClass(x3dom.nodeTypes.X3DShapeNode,function(ctx){x3dom.nodeTypes.X3DVolumeDataNode.superClass.call(this,ctx);this.addField_SFVec3f(ctx,'dimensions',1,1,1);this.addField_SFNode('voxels',x3dom.nodeTypes.Texture);this.addField_SFBool(ctx,'allowViewpointInside',true);this._textureID=0;this._first=true;this._styleList=[];this.surfaceNormalsNeeded=false;this.normalTextureProvided=false;this.fragmentPreamble=\"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n\"+\"  precision highp float;\\n\"+\"#else\\n\"+\"  precision mediump float;\\n\"+\"#endif\\n\\n\";},{getTextureSize:function(texture){var size={w:0,h:0,valid:false};var texBag=this._webgl?this._webgl.texture:null;var t,n=(texture&&texBag)?texBag.length:0;for(t=0;t<n;t++){if(texture==texBag[t].node&&texBag[t].texture){size.w=texBag[t].texture.width;size.h=texBag[t].texture.height;if(size.w&&size.h){size.valid=true;}\nbreak;}}\nreturn size;},vertexShaderText:function(needEyePosition){var shader=\"attribute vec3 position;\\n\"+\"uniform vec3 dimensions;\\n\"+\"uniform mat4 modelViewProjectionMatrix;\\n\"+\"varying vec4 vertexPosition;\\n\"+\"varying vec4 pos;\\n\";if(x3dom.nodeTypes.X3DLightNode.lightID>0||(needEyePosition===true)){shader+=\"uniform mat4 modelViewMatrix;\\n\"+\"varying vec4 position_eye;\\n\";}\nshader+=\"\\n\"+\"void main()\\n\"+\"{\\n\"+\"  vertexPosition = modelViewProjectionMatrix * vec4(position, 1.0);\\n\";if(x3dom.nodeTypes.X3DLightNode.lightID>0||(needEyePosition===true)){shader+=\"  position_eye = modelViewMatrix * vec4(position, 1.0);\\n\";}\nshader+=\"  pos = vec4((position/dimensions)+0.5, 1.0);\\n\"+\"  gl_Position = vertexPosition;\\n\"+\"}\";return shader;},defaultUniformsShaderText:function(numberOfSlices,slicesOverX,slicesOverY,needEyePosition){var uniformsText=\"uniform sampler2D uVolData;\\n\"+\"uniform vec3 dimensions;\\n\"+\"uniform vec3 offset;\\n\"+\"uniform mat4 modelViewMatrix;\\n\"+\"uniform mat4 modelViewMatrixInverse;\\n\"+\"varying vec4 vertexPosition;\\n\"+\"varying vec4 pos;\\n\";if(x3dom.nodeTypes.X3DLightNode.lightID>0||(needEyePosition===true)){uniformsText+=\"varying vec4 position_eye;\\n\";}\nfor(var l=0;l<x3dom.nodeTypes.X3DLightNode.lightID;l++){uniformsText+=\"uniform float light\"+l+\"_On;\\n\"+\"uniform float light\"+l+\"_Type;\\n\"+\"uniform vec3  light\"+l+\"_Location;\\n\"+\"uniform vec3  light\"+l+\"_Direction;\\n\"+\"uniform vec3  light\"+l+\"_Color;\\n\"+\"uniform vec3  light\"+l+\"_Attenuation;\\n\"+\"uniform float light\"+l+\"_Radius;\\n\"+\"uniform float light\"+l+\"_Intensity;\\n\"+\"uniform float light\"+l+\"_AmbientIntensity;\\n\"+\"uniform float light\"+l+\"_BeamWidth;\\n\"+\"uniform float light\"+l+\"_CutOffAngle;\\n\"+\"uniform float light\"+l+\"_ShadowIntensity;\\n\";}\nuniformsText+=\"const float Steps = 85.0;\\n\"+\"const float numberOfSlices = \"+numberOfSlices.toPrecision(5)+\";\\n\"+\"const float slicesOverX = \"+slicesOverX.toPrecision(5)+\";\\n\"+\"const float slicesOverY = \"+slicesOverY.toPrecision(5)+\";\\n\";return uniformsText;},texture3DFunctionShaderText:\"vec4 cTexture3D(sampler2D vol, vec3 volpos, float nS, float nX, float nY)\\n\"+\"{\\n\"+\"  float s1,s2;\\n\"+\"  float dx1,dy1;\\n\"+\"  float dx2,dy2;\\n\"+\"  vec2 texpos1,texpos2;\\n\"+\"  s1 = floor(volpos.z*nS);\\n\"+\"  s2 = s1+1.0;\\n\"+\"  dx1 = fract(s1/nX);\\n\"+\"  dy1 = floor(s1/nX)/nY;\\n\"+\"  dx2 = fract(s2/nX);\\n\"+\"  dy2 = floor(s2/nX)/nY;\\n\"+\"  texpos1.x = dx1+(volpos.x/nX);\\n\"+\"  texpos1.y = dy1+(volpos.y/nY);\\n\"+\"  texpos2.x = dx2+(volpos.x/nX);\\n\"+\"  texpos2.y = dy2+(volpos.y/nY);\\n\"+\"  return mix( texture2D(vol,texpos1), texture2D(vol,texpos2), (volpos.z*nS)-s1);\\n\"+\"}\\n\"+\"\\n\",normalFunctionShaderText:function(){if(this.surfaceNormalsNeeded){return\"vec4 getNormalFromTexture(sampler2D sampler, vec3 pos, float nS, float nX, float nY) {\\n\"+\"   vec4 n = (2.0*cTexture3D(sampler, pos, nS, nX, nY)-1.0);\\n\"+\"   return vec4(normalize(n.xyz), length(n.xyz));\\n\"+\"}\\n\"+\"\\n\"+\"vec4 getNormalOnTheFly(sampler2D sampler, vec3 voxPos, float nS, float nX, float nY){\\n\"+\"   float v0 = cTexture3D(sampler, voxPos + vec3(offset.x, 0, 0), nS, nX, nY).r;\\n\"+\"   float v1 = cTexture3D(sampler, voxPos - vec3(offset.x, 0, 0), nS, nX, nY).r;\\n\"+\"   float v2 = cTexture3D(sampler, voxPos + vec3(0, offset.y, 0), nS, nX, nY).r;\\n\"+\"   float v3 = cTexture3D(sampler, voxPos - vec3(0, offset.y, 0), nS, nX, nY).r;\\n\"+\"   float v4 = cTexture3D(sampler, voxPos + vec3(0, 0, offset.z), nS, nX, nY).r;\\n\"+\"   float v5 = cTexture3D(sampler, voxPos - vec3(0, 0, offset.z), nS, nX, nY).r;\\n\"+\"   vec3 grad = vec3(v0-v1, v2-v3, v4-v5)*0.5;\\n\"+\"   return vec4(normalize(grad), length(grad));\\n\"+\"}\\n\"+\"\\n\";}else{return\"\";}},defaultLoopFragmentShaderText:function(inlineShaderText,inlineLightAssigment,initializeValues){initializeValues=typeof initializeValues!=='undefined'?initializeValues:\"\";var shaderLoop=\"void main()\\n\"+\"{\\n\"+\"  vec3 cam_pos = vec3(modelViewMatrixInverse[3][0], modelViewMatrixInverse[3][1], modelViewMatrixInverse[3][2]);\\n\"+\"  vec3 cam_cube = cam_pos/dimensions+0.5;\\n\"+\"  vec3 dir = normalize(pos.xyz-cam_cube);\\n\";if(this._vf.allowViewpointInside){shaderLoop+=\"  float cam_inside = float(all(bvec2(all(lessThan(cam_cube, vec3(1.0))),all(greaterThan(cam_cube, vec3(0.0))))));\\n\"+\"  vec3 ray_pos = mix(pos.xyz, cam_cube, cam_inside);\\n\";}else{shaderLoop+=\"  vec3 ray_pos = pos.xyz;\\n\";}\nshaderLoop+=\"  vec4 accum  = vec4(0.0, 0.0, 0.0, 0.0);\\n\"+\"  vec4 sample = vec4(0.0, 0.0, 0.0, 0.0);\\n\"+\"  vec4 value  = vec4(0.0, 0.0, 0.0, 0.0);\\n\"+\"  float cont = 0.0;\\n\"+\"  vec3 step_size = (dir*1.4142)/Steps;\\n\";if(x3dom.nodeTypes.X3DLightNode.lightID>0){shaderLoop+=\"  vec3 ambient = vec3(0.0, 0.0, 0.0);\\n\"+\"  vec3 diffuse = vec3(0.0, 0.0, 0.0);\\n\"+\"  vec3 specular = vec3(0.0, 0.0, 0.0);\\n\"+\"  vec4 step_eye = modelViewMatrix * vec4(step_size, 0.0);\\n\"+\"  vec4 positionE = position_eye;\\n\"+\"  float lightFactor = 1.0;\\n\";}else{shaderLoop+=\"  float lightFactor = 1.2;\\n\";}\nshaderLoop+=initializeValues+\"  float opacityFactor = 10.0;\\n\"+\"  float t_near;\\n\"+\"  float t_far;\\n\"+\"  for(float i = 0.0; i < Steps; i+=1.0)\\n\"+\"  {\\n\"+\"    value = cTexture3D(uVolData, ray_pos, numberOfSlices, slicesOverX, slicesOverY);\\n\"+\"    value = value.rgbr;\\n\";if(this.surfaceNormalsNeeded){if(this.normalTextureProvided){shaderLoop+=\"    vec4 gradEye = getNormalFromTexture(uSurfaceNormals, ray_pos, numberOfSlices, slicesOverX, slicesOverY);\\n\";}else{shaderLoop+=\"    vec4 gradEye = getNormalOnTheFly(uVolData, ray_pos, numberOfSlices, slicesOverX, slicesOverY);\\n\";}\nshaderLoop+=\"    vec4 grad = vec4((modelViewMatrix * vec4(gradEye.xyz, 0.0)).xyz, gradEye.a);\\n\";}\nshaderLoop+=inlineShaderText;if(x3dom.nodeTypes.X3DLightNode.lightID>0){shaderLoop+=inlineLightAssigment;}\nshaderLoop+=\"    sample.a = value.a * opacityFactor * (1.0/Steps);\\n\"+\"    sample.rgb = value.rgb * sample.a * lightFactor;\\n\"+\"    accum.rgb += (1.0 - accum.a) * sample.rgb;\\n\"+\"    accum.a += (1.0 - accum.a) * sample.a;\\n\"+\"    ray_pos.xyz += step_size;\\n\";if(x3dom.nodeTypes.X3DLightNode.lightID>0){shaderLoop+=\"    positionE += step_eye;\\n\";}\nshaderLoop+=\"    if(accum.a >= 1.0 || ray_pos.x < 0.0 || ray_pos.y < 0.0 || ray_pos.z < 0.0 || ray_pos.x > 1.0 || ray_pos.y > 1.0 || ray_pos.z > 1.0)\\n\"+\"      break;\\n\"+\"  }\\n\"+\"  gl_FragColor = accum;\\n\"+\"}\";return shaderLoop;}}));x3dom.registerNodeType(\"X3DVolumeRenderStyleNode\",\"VolumeRendering\",defineClass(x3dom.nodeTypes.X3DNode,function(ctx){x3dom.nodeTypes.X3DVolumeRenderStyleNode.superClass.call(this,ctx);this.addField_SFBool(ctx,'enabled',true);this._styleID=0;this._first=false;this._volumeDataParent=null;},{nodeChanged:function(){if(!this._styleID){this._styleID=++x3dom.nodeTypes.X3DVolumeRenderStyleNode.styleID;}},updateProperties:function(volumeData){if(this._cf.renderStyle){if(this._cf.renderStyle.nodes){for(var i=0;i<this._cf.renderStyle.nodes.length;i++){if(this._cf.renderStyle.nodes[i].updateProperties!=undefined){this._cf.renderStyle.nodes[i].updateProperties(volumeData);}}}else if(this._cf.renderStyle.node){this._cf.renderStyle.node.updateProperties(volumeData);}}\nthis._volumeDataParent=volumeData;if(this._volumeDataParent._styleList.indexOf(this.typeName())!=-1){this._first=false;}else{this._first=true;this._volumeDataParent._styleList.push(this.typeName());}},initializeValues:function(){return\"\";},styleUniformsShaderText:function(){return\"\";},styleShaderText:function(){return\"\";},inlineStyleShaderText:function(){return\"\";},lightAssigment:function(){var shaderText=\"\";for(var l=0;l<x3dom.nodeTypes.X3DLightNode.lightID;l++){shaderText+=\"    lighting(light\"+l+\"_Type, \"+\"light\"+l+\"_Location, \"+\"light\"+l+\"_Direction, \"+\"light\"+l+\"_Color, \"+\"light\"+l+\"_Attenuation, \"+\"light\"+l+\"_Radius, \"+\"light\"+l+\"_Intensity, \"+\"light\"+l+\"_AmbientIntensity, \"+\"light\"+l+\"_BeamWidth, \"+\"light\"+l+\"_CutOffAngle, \"+\"grad.xyz, positionE.xyz, ambient, diffuse, specular);\\n\";}\nshaderText+=\"    value.rgb = ambient*value.rgb + diffuse*value.rgb + specular;\\n\";return shaderText;},lightEquationShaderText:function(){if(x3dom.nodeTypes.X3DLightNode.lightID>0){return\"void lighting(in float lType, in vec3 lLocation, in vec3 lDirection, in vec3 lColor, in vec3 lAttenuation, \"+\"in float lRadius, in float lIntensity, in float lAmbientIntensity, in float lBeamWidth, \"+\"in float lCutOffAngle, in vec3 N, in vec3 V, inout vec3 ambient, inout vec3 diffuse, \"+\"inout vec3 specular)\\n\"+\"{\\n\"+\"   vec3 L;\\n\"+\"   float spot = 1.0, attentuation = 0.0;\\n\"+\"   if(lType == 0.0) {\\n\"+\"       L = -normalize(lDirection);\\n\"+\"       V = normalize(V);\\n\"+\"       attentuation = 1.0;\\n\"+\"   } else{\\n\"+\"       L = (lLocation - (-V));\\n\"+\"       float d = length(L);\\n\"+\"       L = normalize(L);\\n\"+\"       V = normalize(V);\\n\"+\"       if(lRadius == 0.0 || d <= lRadius) {\\n\"+\"           attentuation = 1.0 / max(lAttenuation.x + lAttenuation.y * d + lAttenuation.z * (d * d), 1.0);\\n\"+\"       }\\n\"+\"       if(lType == 2.0) {\\n\"+\"           float spotAngle = acos(max(0.0, dot(-L, normalize(lDirection))));\\n\"+\"           if(spotAngle >= lCutOffAngle) spot = 0.0;\\n\"+\"           else if(spotAngle <= lBeamWidth) spot = 1.0;\\n\"+\"           else spot = (spotAngle - lCutOffAngle ) / (lBeamWidth - lCutOffAngle);\\n\"+\"       }\\n\"+\"   }\\n\"+\"   vec3  H = normalize( L + V );\\n\"+\"   float NdotL = max(0.0, dot(L, N));\\n\"+\"   float NdotH = max(0.0, dot(H, N));\\n\"+\"   float ambientFactor  = lAmbientIntensity;\\n\"+\"   float diffuseFactor  = lIntensity * NdotL;\\n\"+\"   float specularFactor = lIntensity * pow(NdotH,128.0);\\n\"+\"   ambient  += lColor * ambientFactor * attentuation * spot;\\n\"+\"   diffuse  += lColor * diffuseFactor * attentuation * spot;\\n\"+\"   specular += lColor * specularFactor * attentuation * spot;\\n\"+\"}\\n\"+\"\\n\";}else{return\"\";}}}));x3dom.nodeTypes.X3DVolumeRenderStyleNode.styleID=0;x3dom.registerNodeType(\"X3DComposableVolumeRenderStyleNode\",\"VolumeRendering\",defineClass(x3dom.nodeTypes.X3DVolumeRenderStyleNode,function(ctx){x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode.superClass.call(this,ctx);this.addField_SFNode('surfaceNormals',x3dom.nodeTypes.Texture);},{}));x3dom.registerNodeType(\"BlendedVolumeStyle\",\"VolumeRendering\",defineClass(x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode,function(ctx){x3dom.nodeTypes.BlendedVolumeStyle.superClass.call(this,ctx);this.addField_SFNode('renderStyle',x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode);this.addField_SFNode('voxels',x3dom.nodeTypes.X3DVolumeDataNode);this.addField_SFFloat(ctx,'weightConstant1',0.5);this.addField_SFFloat(ctx,'weightConstant2',0.5);this.addField_SFString(ctx,'weightFunction1',\"CONSTANT\");this.addField_SFString(ctx,'weightFunction2',\"CONSTANT\");this.addField_SFNode('weightTransferFunction1',x3dom.nodeTypes.X3DTexture2DNode);this.addField_SFNode('weightTransferFunction2',x3dom.nodeTypes.X3DTexture2DNode);this.uniformFloatWeightConstant1=new x3dom.nodeTypes.Uniform(ctx);this.uniformFloatWeightConstant2=new x3dom.nodeTypes.Uniform(ctx);this.uniformSampler2DVoxels=new x3dom.nodeTypes.Uniform(ctx);this.uniformSampler2DWeightTransferFunction1=new x3dom.nodeTypes.Uniform(ctx);this.uniformSampler2DWeightTransferFunction2=new x3dom.nodeTypes.Uniform(ctx);},{fieldChanged:function(fieldName){switch(fieldName){case'weightConstant1':this.uniformFloatWeightConstant1._vf.value=this._vf.weightConstant1;this.uniformFloatWeightConstant1.fieldChanged(\"value\");break;case'weightConstant2':this.uniformFloatWeightConstant2._vf.value=this._vf.weightConstant2;this.uniformFloatWeightConstant2.fieldChanged(\"value\");break;case'weightFunction1':break;case'weightFunction2':break;}},uniforms:function(){var unis=[];if(this._cf.voxels.node||this._cf.weightTransferFunction1.node||this._cf.weightTransferFunction2.node){this.uniformSampler2DVoxels._vf.name='uVolBlendData';this.uniformSampler2DVoxels._vf.type='SFInt32';this.uniformSampler2DVoxels._vf.value=this._volumeDataParent._textureID++;unis.push(this.uniformSampler2DVoxels);if(this._cf.weightTransferFunction1.node){this.uniformSampler2DWeightTransferFunction1._vf.name='uWeightTransferFunctionA';this.uniformSampler2DWeightTransferFunction1._vf.type='SFInt32';this.uniformSampler2DWeightTransferFunction1._vf.value=this._volumeDataParent._textureID++;unis.push(this.uniformSampler2DWeightTransferFunction1);}\nif(this._cf.weightTransferFunction2.node){this.uniformSampler2DWeightTransferFunction2._vf.name='uWeightTransferFunctionB';this.uniformSampler2DWeightTransferFunction2._vf.type='SFInt32';this.uniformSampler2DWeightTransferFunction2._vf.value=this._volumeDataParent._textureID++;unis.push(this.uniformSampler2DWeightTransferFunction2);}}\nthis.uniformFloatWeightConstant1._vf.name='uWeightConstantA';this.uniformFloatWeightConstant1._vf.type='SFFloat';this.uniformFloatWeightConstant1._vf.value=this._vf.weightConstant1;unis.push(this.uniformFloatWeightConstant1);this.uniformFloatWeightConstant2._vf.name='uWeightConstantB';this.uniformFloatWeightConstant2._vf.type='SFFloat';this.uniformFloatWeightConstant2._vf.value=this._vf.weightConstant2;unis.push(this.uniformFloatWeightConstant2);if(this._cf.renderStyle.node){var renderStyleUniforms=this._cf.renderStyle.node.uniforms();Array.forEach(renderStyleUniforms,function(uni){uni._vf.name=uni._vf.name.replace(/uSurfaceNormals/,\"uBlendSurfaceNormals\")});unis=unis.concat(renderStyleUniforms);}\nreturn unis;},textures:function(){var texs=[];if(this._cf.voxels.node){var tex=this._cf.voxels.node;tex._vf.repeatS=false;tex._vf.repeatT=false;texs.push(tex);}\nif(this._cf.weightTransferFunction1.node){var tex=this._cf.weightTransferFunction1.node;tex._vf.repeatS=false;tex._vf.repeatT=false;texs.push(tex);}\nif(this._cf.weightTransferFunction2.node){var tex=this._cf.weightTransferFunction2.node;tex._vf.repeatS=false;tex._vf.repeatT=false;texs.push(tex);}\nif(this._cf.renderStyle.node){var renderStyleTextures=this._cf.renderStyle.node.textures();texs=texs.concat(renderStyleTextures);}\nreturn texs;},initializeValues:function(){var initialValues=\"\";if(x3dom.nodeTypes.X3DLightNode.lightID>0){initialValues+=\"  vec3 ambientBlend = vec3(0.0, 0.0, 0.0);\\n\"+\"  vec3 diffuseBlend = vec3(0.0, 0.0, 0.0);\\n\"+\"  vec3 specularBlend = vec3(0.0, 0.0, 0.0);\\n\";}\nreturn initialValues;},styleUniformsShaderText:function(){var uniformsText=\"uniform float uWeightConstantA;\\n\"+\"uniform float uWeightConstantB;\\n\"+\"uniform sampler2D uBlendSurfaceNormals;\\n\";if(this._cf.voxels.node){uniformsText+=\"uniform sampler2D uVolBlendData;\\n\";}\nif(this._cf.weightTransferFunction1.node){uniformsText+=\"uniform sampler2D uWeightTransferFunctionA;\\n\";}\nif(this._cf.weightTransferFunction2.node){uniformsText+=\"uniform sampler2D uWeightTransferFunctionB;\\n\";}\nif(this._cf.renderStyle.node){uniformsText+=this._cf.renderStyle.node.styleUniformsShaderText();}\nreturn uniformsText;},styleShaderText:function(){var styleText=\"\";if(this._cf.renderStyle.node&&this._cf.renderStyle.node.styleShaderText!=undefined){styleText+=this._cf.renderStyle.node.styleShaderText();}\nreturn styleText;},inlineStyleShaderText:function(){var nSlices=this._cf.voxels.node._vf.numberOfSlices.toPrecision(5);var xSlices=this._cf.voxels.node._vf.slicesOverX.toPrecision(5);var ySlices=this._cf.voxels.node._vf.slicesOverY.toPrecision(5);var inlineText=\"    vec4 blendValue = cTexture3D(uVolBlendData, ray_pos, \"+nSlices+\", \"+xSlices+\", \"+ySlices+\");\\n\"+\"    blendValue = vec4(blendValue.rgb,(0.299*blendValue.r)+(0.587*blendValue.g)+(0.114*blendValue.b));\\n\";if(this._cf.renderStyle.node&&this._cf.renderStyle.node._cf.surfaceNormals.node){inlineText+=\"    vec4 blendGradEye = getNormalFromTexture(uBlendSurfaceNormals, ray_pos, \"+nSlices+\", \"+xSlices+\", \"+ySlices+\");\\n\";}else{inlineText+=\"    vec4 blendGradEye = getNormalOnTheFly(uVolBlendData, ray_pos, \"+nSlices+\", \"+xSlices+\", \"+ySlices+\");\\n\";}\ninlineText+=\"    vec4 blendGrad = vec4((modelViewMatrix * vec4(blendGradEye.xyz, 0.0)).xyz, blendGradEye.a);\\n\";if(this._cf.renderStyle.node){var tempText=this._cf.renderStyle.node.inlineStyleShaderText().replace(/value/gm,\"blendValue\").replace(/grad/gm,\"blendGrad\");inlineText+=tempText.replace(/ambient/gm,\"ambientBlend\").replace(/diffuse/gm,\"diffuseBlend\").replace(/specular/gm,\"specularBlend\");}\nswitch(this._vf.weightFunction1.toUpperCase()){case\"CONSTANT\":inlineText+=\"    float wA = uWeightConstantA;\\n\";break;case\"ALPHA0\":inlineText+=\"    float wA = value.a;\\n\";break;case\"ALPHA1\":inlineText+=\"    float wA = blendValue.a;\\n\";break;case\"ONE_MINUS_ALPHA0\":inlineText+=\"    float wA = 1.0 - value.a;\\n\";break;case\"ONE_MINUS_ALPHA1\":inlineText+=\"    float wA = 1.0 - blendValue.a;\\n\";break;case\"TABLE\":if(this._cf.weightTransferFunction1){inlineText+=\"    float wA = texture2D(uWeightTransferFunctionA, vec2(value.a, blendValue.a));\\n\";}else{inlineText+=\"    float wA = value.a;\\n\";x3dom.debug.logWarning('[VolumeRendering][BlendedVolumeStyle] TABLE specified on weightFunction1 but not weightTrnafer function provided, using ALPHA0.');}\nbreak;}\nswitch(this._vf.weightFunction2.toUpperCase()){case\"CONSTANT\":inlineText+=\"    float wB = uWeightConstantB;\\n\";break;case\"ALPHA0\":inlineText+=\"    float wB = value.a;\\n\";break;case\"ALPHA1\":inlineText+=\"    float wB = blendValue.a;\\n\";break;case\"ONE_MINUS_ALPHA0\":inlineText+=\"    float wB = 1.0 - value.a;\\n\";break;case\"ONE_MINUS_ALPHA1\":inlineText+=\"    float wB = 1.0 - blendValue.a;\\n\";break;case\"TABLE\":if(this._cf.weightTransferFunction2){inlineText+=\"    float wB = texture2D(uWeightTransferFunctionB, vec2(value.a, blendValue.a));\\n\";}else{inlineText+=\"    float wB = value.a;\\n\";x3dom.debug.logWarning('[VolumeRendering][BlendedVolumeStyle] TABLE specified on weightFunction2 but not weightTrasnferFunction provided, using ALPHA0.');}\nbreak;}\nif(x3dom.nodeTypes.X3DLightNode.lightID==0){inlineText+=\"    value = clamp(value * wA + blendValue * wB, 0.0, 1.0);\\n\";}\nreturn inlineText;},lightAssigment:function(){var inlineText=\"\";if(x3dom.nodeTypes.X3DLightNode.lightID>0){if(this._cf.renderStyle.node){var tempText=this._cf.renderStyle.node.lightAssigment().replace(/value/gm,\"blendValue\").replace(/grad/gm,\"blendGrad\");inlineText+=tempText.replace(/ambient/gm,\"ambientBlend\").replace(/diffuse/gm,\"diffuseBlend\").replace(/specular/gm,\"specularBlend\");}else{for(var l=0;l<x3dom.nodeTypes.X3DLightNode.lightID;l++){inlineText+=\"    lighting(light\"+l+\"_Type, \"+\"light\"+l+\"_Location, \"+\"light\"+l+\"_Direction, \"+\"light\"+l+\"_Color, \"+\"light\"+l+\"_Attenuation, \"+\"light\"+l+\"_Radius, \"+\"light\"+l+\"_Intensity, \"+\"light\"+l+\"_AmbientIntensity, \"+\"light\"+l+\"_BeamWidth, \"+\"light\"+l+\"_CutOffAngle, \"+\"blendGradEye.xyz, -positionE.xyz, ambientBlend, diffuseBlend, specularBlend);\\n\";}\ninlineText+=\"    blendValue.rgb = ambientBlend*blendValue.rgb + diffuseBlend*blendValue.rgb + specularBlend;\\n\";}}\ninlineText+=\"    value.rgb = clamp(value.rgb * wA + blendValue.rgb * wB, 0.0, 1.0);\\n\"+\"    value.a = clamp(value.a * wA + blendValue.a * wB, 0.0, 1.0);\\n\";return inlineText;}}));x3dom.registerNodeType(\"BoundaryEnhancementVolumeStyle\",\"VolumeRendering\",defineClass(x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode,function(ctx){x3dom.nodeTypes.BoundaryEnhancementVolumeStyle.superClass.call(this,ctx);this.addField_SFFloat(ctx,'retainedOpacity',1);this.addField_SFFloat(ctx,'boundaryOpacity',0);this.addField_SFFloat(ctx,'opacityFactor',1);this.uniformFloatRetainedOpacity=new x3dom.nodeTypes.Uniform(ctx);this.uniformFloatBoundaryOpacity=new x3dom.nodeTypes.Uniform(ctx);this.uniformFloatOpacityFactor=new x3dom.nodeTypes.Uniform(ctx);this.uniformSampler2DSurfaceNormals=new x3dom.nodeTypes.Uniform(ctx);this.uniformBoolEnableBoundary=new x3dom.nodeTypes.Uniform(ctx);},{fieldChanged:function(fieldName){switch(fieldName){case'retainedOpacity':this.uniformFloatRetainedOpacity._vf.value=this._vf.retainedOpacity;this.uniformFloatRetainedOpacity.fieldChanged(\"value\");break;case'boundaryOpacity':this.uniformFloatBoundaryOpacity._vf.value=this._vf.boundaryOpacity;this.uniformFloatBoundaryOpacity.fieldChanged(\"value\");break;case'opacityFactor':this.uniformFloatOpacityFactor._vf.value=this._vf.opacityFactor;this.uniformFloatOpacityFactor.fieldChanged(\"value\");break;}},uniforms:function(){var unis=[];if(this._cf.surfaceNormals.node){var volumeDataParent=this._parentNodes[0];while(!x3dom.isa(volumeDataParent,x3dom.nodeTypes.X3DVolumeDataNode)||!x3dom.isa(volumeDataParent,x3dom.nodeTypes.X3DNode)){volumeDataParent=volumeDataParent._parentNodes[0];}\nif(x3dom.isa(volumeDataParent,x3dom.nodeTypes.X3DVolumeDataNode)==false){x3dom.debug.logError(\"[VolumeRendering][BoundaryEnhancementVolumeStyle] Not VolumeData parent found!\");volumeDataParent=null;}\nthis.uniformSampler2DSurfaceNormals._vf.name='uSurfaceNormals';this.uniformSampler2DSurfaceNormals._vf.type='SFInt32';this.uniformSampler2DSurfaceNormals._vf.value=volumeDataParent._textureID++;unis.push(this.uniformSampler2DSurfaceNormals);}\nthis.uniformFloatRetainedOpacity._vf.name='uRetainedOpacity'+this._styleID;this.uniformFloatRetainedOpacity._vf.type='SFFloat';this.uniformFloatRetainedOpacity._vf.value=this._vf.retainedOpacity;unis.push(this.uniformFloatRetainedOpacity);this.uniformFloatBoundaryOpacity._vf.name='uBoundaryOpacity'+this._styleID;this.uniformFloatBoundaryOpacity._vf.type='SFFloat';this.uniformFloatBoundaryOpacity._vf.value=this._vf.boundaryOpacity;unis.push(this.uniformFloatBoundaryOpacity);this.uniformFloatOpacityFactor._vf.name='uOpacityFactor'+this._styleID;this.uniformFloatOpacityFactor._vf.type='SFFloat';this.uniformFloatOpacityFactor._vf.value=this._vf.opacityFactor;unis.push(this.uniformFloatOpacityFactor);this.uniformBoolEnableBoundary._vf.name='uEnableBoundary'+this._styleID;this.uniformBoolEnableBoundary._vf.type='SFBool';this.uniformBoolEnableBoundary._vf.value=this._vf.enabled;unis.push(this.uniformBoolEnableBoundary);return unis;},textures:function(){var texs=[];if(!(this._cf.surfaceNormals.node==null)){var tex=this._cf.surfaceNormals.node;tex._vf.repeatS=false;tex._vf.repeatT=false;texs.push(tex)}\nreturn texs;},styleUniformsShaderText:function(){return\"uniform float uRetainedOpacity\"+this._styleID+\";\\n\"+\"uniform float uBoundaryOpacity\"+this._styleID+\";\\n\"+\"uniform float uOpacityFactor\"+this._styleID+\";\\n\"+\"uniform bool uEnableBoundary\"+this._styleID+\";\\n\";},styleShaderText:function(){if(this._first){return\"void boundaryEnhancement(inout vec4 original_color, in float gradientMagnitude, in float retainedOpacity, in float boundaryOpacity, in float opacityFactor){\\n\"+\"   original_color.a = original_color.a * (retainedOpacity + (boundaryOpacity * pow(gradientMagnitude, opacityFactor)));\\n\"+\"}\\n\";}else{return\"\";}},inlineStyleShaderText:function(){var inlineText=\"    if(uEnableBoundary\"+this._styleID+\"){\\n\"+\"    boundaryEnhancement(value, grad.w, uRetainedOpacity\"+this._styleID+\", uBoundaryOpacity\"+this._styleID+\", uOpacityFactor\"+this._styleID+\");\\n\"+\"}\\n\";return inlineText;}}));x3dom.registerNodeType(\"CartoonVolumeStyle\",\"VolumeRendering\",defineClass(x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode,function(ctx){x3dom.nodeTypes.CartoonVolumeStyle.superClass.call(this,ctx);this.addField_SFColor(ctx,'parallelColor',0,0,0);this.addField_SFColor(ctx,'orthogonalColor',1,1,1);this.addField_SFInt32(ctx,'colorSteps',4);this.uniformParallelColor=new x3dom.nodeTypes.Uniform(ctx);this.uniformOrthogonalColor=new x3dom.nodeTypes.Uniform(ctx);this.uniformIntColorSteps=new x3dom.nodeTypes.Uniform(ctx);this.uniformSampler2DSurfaceNormals=new x3dom.nodeTypes.Uniform(ctx);this.uniformBoolEnableCartoon=new x3dom.nodeTypes.Uniform(ctx);},{fieldChanged:function(fieldName){switch(fieldName){case'parallelColor':this.uniformParallelColor._vf.value=this._vf.parallelColor;this.uniformParallelColor.fieldChanged(\"value\");break;case'orthogonalColor':this.uniformOrthogonalColor._vf.value=this._vf.orthogonalColor;this.uniformOrthogonalColor.fieldChanged(\"value\");break;case'colorSteps':this.uniformIntColorSteps._vf.value=this._vf.colorSteps;this.uniformIntColorSteps.fieldChanged(\"value\");break;}},uniforms:function(){var unis=[];if(this._cf.surfaceNormals.node){this.uniformSampler2DSurfaceNormals._vf.name='uSurfaceNormals';this.uniformSampler2DSurfaceNormals._vf.type='SFInt32';this.uniformSampler2DSurfaceNormals._vf.value=this._volumeDataParent._textureID++;unis.push(this.uniformSampler2DSurfaceNormals);}\nthis.uniformParallelColor._vf.name='uParallelColor'+this._styleID;this.uniformParallelColor._vf.type='SFColor';this.uniformParallelColor._vf.value=this._vf.parallelColor;unis.push(this.uniformParallelColor);this.uniformOrthogonalColor._vf.name='uOrthogonalColor'+this._styleID;this.uniformOrthogonalColor._vf.type='SFColor';this.uniformOrthogonalColor._vf.value=this._vf.orthogonalColor;unis.push(this.uniformOrthogonalColor);this.uniformIntColorSteps._vf.name='uColorSteps'+this._styleID;this.uniformIntColorSteps._vf.type='SFInt32';this.uniformIntColorSteps._vf.value=this._vf.colorSteps;unis.push(this.uniformIntColorSteps);this.uniformBoolEnableCartoon._vf.name='uEnableCartoon'+this._styleID;this.uniformBoolEnableCartoon._vf.type='SFBool';this.uniformBoolEnableCartoon._vf.value=this._vf.enabled;unis.push(this.uniformBoolEnableCartoon);return unis;},textures:function(){var texs=[];if(this._cf.surfaceNormals.node){var tex=this._cf.surfaceNormals.node;tex._vf.repeatS=false;tex._vf.repeatT=false;texs.push(tex);}\nreturn texs;},styleShaderText:function(){if(this._first){return\"//Convert RGBA color to HSVA\\n\"+\"vec4 rgba2hsva(vec4 rgba){\\n\"+\"   float zat, izen;\\n\"+\"   float R = rgba.r, G = rgba.g, B = rgba.b;\\n\"+\"   float minim = min(R, min(G, B)), maxim = max(R, max(G, B));\\n\"+\"   float delta = maxim-minim;\\n\"+\"   if(minim == maxim){\\n\"+\"       return vec4(0.0, 0.0, maxim, rgba.a);\\n\"+\"   }else{\\n\"+\"       zat = (R == maxim) ? G - B : ((G == maxim) ? B - R : R - G);\\n\"+\"       izen = (R == maxim) ? ((G<B) ? 6.0 : 0.0) : ((G == maxim) ? 2.0 : 4.0);\\n\"+\"        return vec4((zat/delta + izen)/6.0, delta/maxim, maxim, rgba.a);\\n\"+\"    }\\n\"+\"}\\n\"+\"\\n\"+\"//Convert RGB color to HSV\\n\"+\"vec3 rgb2hsv(vec3 rgb){\\n\"+\"    return rgba2hsva(vec4(rgb, 1.0)).rgb;\\n\"+\"}\\n\"+\"\\n\"+\"//Convert HSVA color to RGBA\\n\"+\"vec4 hsva2rgba(vec4 hsva){\\n\"+\"   float r, g, b;\\n\"+\"   float h=hsva.x, s=hsva.y, v=hsva.z;\\n\"+\"   float i = floor(h * 6.0);\\n\"+\"   float f = h * 6.0 - i;\\n\"+\"   float p = v * (1.0 - s);\\n\"+\"   float q = v * (1.0 - f * s);\\n\"+\"   float t = v * (1.0 - (1.0 - f) * s);\\n\"+\"   i = mod(i,6.0);\\n\"+\"   if( i == 6.0 || i == 0.0 ) r = v, g = t, b = p;\\n\"+\"   else if( i == 1.0) r = q, g = v, b = p;\\n\"+\"   else if( i == 2.0) r = p, g = v, b = t;\\n\"+\"   else if( i == 3.0) r = p, g = q, b = v;\\n\"+\"   else if( i == 4.0) r = t, g = p, b = v;\\n\"+\"   else if( i == 5.0) r = v, g = p, b = q;\\n\"+\"   return vec4(r,g,b,hsva.w);\\n\"+\"}\\n\"+\"\\n\"+\"//Convert HSV color to RGB\\n\"+\"vec3 hsv2rgb(vec3 hsv){\\n\"+\"   return hsva2rgba(vec4(hsv, 1.0)).rgb;\\n\"+\"}\\n\"+\"void getCartoonStyle(inout vec4 outputColor, vec3 orthogonalColor, vec3 parallelColor, int colorSteps, vec4 surfNormal, vec3 V)\\n\"+\"{\\n\"+\"   float steps = clamp(float(colorSteps), 1.0,64.0);\\n\"+\"   float range_size = pi_half / steps;\\n\"+\"   float cos_angle = abs(dot(surfNormal.xyz, V));\\n\"+\"   float interval = clamp(floor(cos_angle / range_size),0.0,steps);\\n\"+\"   float ang = interval * range_size;\\n\"+\"   outputColor.rgb = hsv2rgb(mix(orthogonalColor, parallelColor, ang));\\n\"+\"}\\n\"+\"\\n\";}else{return\"\";}},styleUniformsShaderText:function(){var styleText=\"uniform vec3 uParallelColor\"+this._styleID+\";\\n\"+\"uniform vec3 uOrthogonalColor\"+this._styleID+\";\\n\"+\"uniform int uColorSteps\"+this._styleID+\";\\n\"+\"uniform bool uEnableCartoon\"+this._styleID+\";\\n\";if(this._first){styleText+=\"const float pi_half = \"+(Math.PI/2.0).toPrecision(5)+\";\\n\";}\nreturn styleText;},inlineStyleShaderText:function(){var inlineText=\"  if(uEnableCartoon\"+this._styleID+\"){\\n\"+\"      getCartoonStyle(value, rgb2hsv(uOrthogonalColor\"+this._styleID+\"), rgb2hsv(uParallelColor\"+this._styleID+\"), uColorSteps\"+this._styleID+\", gradEye, dir);\\n\"+\"  }\\n\";return inlineText;}}));x3dom.registerNodeType(\"ComposedVolumeStyle\",\"VolumeRendering\",defineClass(x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode,function(ctx){x3dom.nodeTypes.ComposedVolumeStyle.superClass.call(this,ctx);this.addField_MFNode('renderStyle',x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode);this.normalTextureProvided=false;},{uniforms:function(){var unis=[];var i,n=this._cf.renderStyle.nodes.length;for(i=0;i<n;i++){var that=this;Array.forEach(this._cf.renderStyle.nodes[i].uniforms(),function(uniform){var contains_uniform=false;Array.forEach(unis,function(accum){if(accum._vf.name==uniform._vf.name){contains_uniform=true;}});if(contains_uniform==false){unis=unis.concat(uniform);}});}\nreturn unis;},textures:function(){var texs=[];var i,n=this._cf.renderStyle.nodes.length;for(i=0;i<n;i++){Array.forEach(this._cf.renderStyle.nodes[i].textures(),function(texture){var contains_texture=false;Array.forEach(texs,function(accum){if(accum._vf.url[0]==texture._vf.url[0]){contains_texture=true;}});if(contains_texture==false){texs=texs.concat(texture);}});}\nreturn texs;},initializeValues:function(){var initialValues=\"\";var n=this._cf.renderStyle.nodes.length;for(var i=0;i<n;i++){if(this._cf.renderStyle.nodes[i].initializeValues!=undefined){initialValues+=this._cf.renderStyle.nodes[i].initializeValues()+\"\\n\";}}\nreturn initialValues;},styleUniformsShaderText:function(){var styleText=\"\";var n=this._cf.renderStyle.nodes.length;if(n==1&&!x3dom.isa(this._cf.renderStyle.nodes[0],x3dom.nodeTypes.OpacityMapVolumeStyle)){this.surfaceNormalsNeeded=true;}\nfor(var i=0;i<n;i++){styleText+=this._cf.renderStyle.nodes[i].styleUniformsShaderText()+\"\\n\";if(this._cf.renderStyle.nodes[i]._cf.surfaceNormals&&this._cf.renderStyle.nodes[i]._cf.surfaceNormals.node!=null){this.normalTextureProvided=true;this._cf.surfaceNormals.node=this._cf.renderStyle.nodes[i]._cf.surfaceNormals.node;}}\nreturn styleText;},styleShaderText:function(){var styleText=\"\";var n=this._cf.renderStyle.nodes.length;for(var i=0;i<n;i++){if(this._cf.renderStyle.nodes[i].styleShaderText!=undefined){styleText+=this._cf.renderStyle.nodes[i].styleShaderText()+\"\\n\";}}\nreturn styleText;},inlineStyleShaderText:function(){var inlineText=\"\";var n=this._cf.renderStyle.nodes.length;for(var i=0;i<n;i++){inlineText+=this._cf.renderStyle.nodes[i].inlineStyleShaderText();}\nreturn inlineText;},lightAssigment:function(){var isBlendedStyle=false;var blendedLightAssigmentText;Array.forEach(this._cf.renderStyle.nodes,function(style){if(x3dom.isa(style,x3dom.nodeTypes.BlendedVolumeStyle)){isBlendedStyle=true;blendedLightAssigmentText=style.lightAssigment();}});if(!isBlendedStyle){return this._cf.renderStyle.nodes[0].lightAssigment();}else{return this._cf.renderStyle.nodes[0].lightAssigment()+blendedLightAssigmentText;}},lightEquationShaderText:function(){return this._cf.renderStyle.nodes[0].lightEquationShaderText();}}));x3dom.registerNodeType(\"EdgeEnhancementVolumeStyle\",\"VolumeRendering\",defineClass(x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode,function(ctx){x3dom.nodeTypes.EdgeEnhancementVolumeStyle.superClass.call(this,ctx);this.addField_SFColor(ctx,'edgeColor',0,0,0);this.addField_SFFloat(ctx,'gradientThreshold',0.4);this.uniformColorEdgeColor=new x3dom.nodeTypes.Uniform(ctx);this.uniformFloatGradientThreshold=new x3dom.nodeTypes.Uniform(ctx);this.uniformSampler2DSurfaceNormals=new x3dom.nodeTypes.Uniform(ctx);this.uniformBoolEdgeEnable=new x3dom.nodeTypes.Uniform(ctx);},{fieldChanged:function(fieldName){if(fieldName==\"edgeColor\"){this.uniformColorEdgeColor._vf.value=this._vf.edgeColor;this.uniformColorEdgeColor.fieldChanged(\"value\");}else if(fieldName==\"gradientThreshold\"){this.uniformFloatGradientThreshold._vf.value=this._vf.gradientThreshold;this.uniformFloatGradientThreshold.fieldChanged(\"value\");}},uniforms:function(){var unis=[];if(this._cf.surfaceNormals.node){this.uniformSampler2DSurfaceNormals._vf.name='uSurfaceNormals';this.uniformSampler2DSurfaceNormals._vf.type='SFInt32';this.uniformSampler2DSurfaceNormals._vf.value=this._volumeDataParent._textureID++;unis.push(this.uniformSampler2DSurfaceNormals);}\nthis.uniformColorEdgeColor._vf.name='uEdgeColor'+this._styleID;this.uniformColorEdgeColor._vf.type='SFColor';this.uniformColorEdgeColor._vf.value=this._vf.edgeColor;unis.push(this.uniformColorEdgeColor);this.uniformFloatGradientThreshold._vf.name='uGradientThreshold'+this._styleID;this.uniformFloatGradientThreshold._vf.type='SFFloat';this.uniformFloatGradientThreshold._vf.value=this._vf.gradientThreshold;unis.push(this.uniformFloatGradientThreshold);this.uniformBoolEdgeEnable._vf.name='uEnableEdge'+this._styleID;this.uniformBoolEdgeEnable._vf.type='SFBool';this.uniformBoolEdgeEnable._vf.value=this._vf.enabled;unis.push(this.uniformBoolEdgeEnable);return unis;},textures:function(){var texs=[];if(this._cf.surfaceNormals.node){var tex=this._cf.surfaceNormals.node;tex._vf.repeatS=false;tex._vf.repeatT=false;texs.push(tex)}\nreturn texs;},styleUniformsShaderText:function(){return\"uniform vec3 uEdgeColor\"+this._styleID+\";\\n\"+\"uniform float uGradientThreshold\"+this._styleID+\";\\n\"+\"uniform bool uEnableEdge\"+this._styleID+\";\\n\";},styleShaderText:function(){if(this._first){return\"void edgeEnhancement(inout vec4 originalColor, in vec4 gradient, in vec3 V, in vec3 edgeColor, in float gradientT)\\n\"+\"{\\n\"+\"   if(gradient.a > 0.05){\\n\"+\"       float angle_dif = abs(dot(gradient.xyz,V));\\n\"+\"       if(angle_dif > cos(gradientT)){\\n\"+\"           originalColor.rgb = mix(edgeColor, originalColor.rgb, angle_dif);\\n\"+\"       }\\n\"+\"   }\\n\"+\"}\\n\";}else{return\"\";}},inlineStyleShaderText:function(){var inlineText=\"   if(uEnableEdge\"+this._styleID+\"){\\n\"+\"       edgeEnhancement(value, gradEye, dir, uEdgeColor\"+this._styleID+\", uGradientThreshold\"+this._styleID+\");\\n\"+\"   }\\n\";return inlineText;}}));x3dom.registerNodeType(\"IsoSurfaceVolumeData\",\"VolumeRendering\",defineClass(x3dom.nodeTypes.X3DVolumeDataNode,function(ctx){x3dom.nodeTypes.IsoSurfaceVolumeData.superClass.call(this,ctx);this.addField_MFNode('renderStyle',x3dom.nodeTypes.X3DVolumeRenderStyleNode);this.addField_SFNode('gradients',x3dom.nodeTypes.Texture);this.addField_MFFloat(ctx,'surfaceValues',[0.0]);this.addField_SFFloat(ctx,'contourStepSize',0);this.addField_SFFloat(ctx,'surfaceTolerance',0);this.uniformSampler2DGradients=new x3dom.nodeTypes.Uniform(ctx);this.uniformFloatContourStepSize=new x3dom.nodeTypes.Uniform(ctx);this.uniformFloatSurfaceTolerance=new x3dom.nodeTypes.Uniform(ctx);this.uniformFloatArraySurfaceValues=new x3dom.nodeTypes.Uniform(ctx);this.vrcMultiTexture=new x3dom.nodeTypes.MultiTexture(ctx);this.vrcVolumeTexture=null;this.vrcSinglePassShader=new x3dom.nodeTypes.ComposedShader(ctx);this.vrcSinglePassShaderVertex=new x3dom.nodeTypes.ShaderPart(ctx);this.vrcSinglePassShaderFragment=new x3dom.nodeTypes.ShaderPart(ctx);this.vrcSinglePassShaderFieldVolData=new x3dom.nodeTypes.Field(ctx);this.vrcSinglePassShaderFieldOffset=new x3dom.nodeTypes.Field(ctx);this.vrcSinglePassShaderFieldDimensions=new x3dom.nodeTypes.Field(ctx);},{fieldChanged:function(fieldName){switch(fieldName){case'surfaceValues':this.uniformFloatArraySurfaceValues._vf.value=this._vf.surfaceValues;this.uniformFloatArraySurfaceValues.fieldChanged(\"value\");break;case'surfaceTolerance':this.uniformFloatSurfaceTolerance._vf.value=this._vf.surfaceTolerance;this.uniformFloatSurfaceTolerance.fieldChanged(\"value\");break;case'contourStepSize':break;}},uniforms:function(){var unis=[];if(this._cf.gradients.node){this.uniformSampler2DGradients._vf.name='uSurfaceNormals';this.uniformSampler2DGradients._vf.type='SFInt32';this.uniformSampler2DGradients._vf.value=this._textureID++;unis.push(this.uniformSampler2DGradients);}\nthis.uniformFloatArraySurfaceValues._vf.name='uSurfaceValues';this.uniformFloatArraySurfaceValues._vf.type='MFFloat';this.uniformFloatArraySurfaceValues._vf.value=this._vf.surfaceValues;unis.push(this.uniformFloatArraySurfaceValues);this.uniformFloatSurfaceTolerance._vf.name='uSurfaceTolerance';this.uniformFloatSurfaceTolerance._vf.type='MFFloat';this.uniformFloatSurfaceTolerance._vf.value=this._vf.surfaceTolerance;unis.push(this.uniformFloatSurfaceTolerance);if(this._cf.renderStyle.nodes){var n=this._cf.renderStyle.nodes.length;for(var i=0;i<n;i++){Array.forEach(this._cf.renderStyle.nodes[i].uniforms(),function(uniform){var contains_uniform=false;Array.forEach(unis,function(accum){if(accum._vf.name==uniform._vf.name){contains_uniform=true;}});if(contains_uniform==false){unis=unis.concat(uniform);}});}}\nreturn unis;},textures:function(){var texs=[];if(this._cf.gradients.node){var tex=this._cf.gradients.node;tex._vf.repeatS=false;tex._vf.repeatT=false;texs.push(tex);}\nvar i,n=this._cf.renderStyle.nodes.length;for(i=0;i<n;i++){Array.forEach(this._cf.renderStyle.nodes[i].textures(),function(texture){var contains_texture=false;Array.forEach(texs,function(accum){if(accum._vf.url[0]==texture._vf.url[0]){contains_texture=true;}});if(contains_texture==false){texs=texs.concat(texture);}});}\nreturn texs;},initializeValues:function(){var initialValues=\"  float previous_value = 0.0;\\n\";var n=this._cf.renderStyle.nodes.length;for(var i=0;i<n;i++){if(this._cf.renderStyle.nodes[i].initializeValues!=undefined){initialValues+=this._cf.renderStyle.nodes[i].initializeValues()+\"\\n\";}}\nreturn initialValues;},styleUniformsShaderText:function(){var styleText=\"uniform float uSurfaceTolerance;\\n\"+\"uniform float uSurfaceValues[\"+this._vf.surfaceValues.length+\"];\\n\";if(this._cf.gradients.node){styleText+=\"uniform sampler2D uSurfaceNormals;\\n\";}\nvar n=this._cf.renderStyle.nodes.length;for(var i=0;i<n;i++){styleText+=this._cf.renderStyle.nodes[i].styleUniformsShaderText()+\"\\n\";if(this._cf.renderStyle.nodes[i]._cf.surfaceNormals&&this._cf.renderStyle.nodes[i]._cf.surfaceNormals.node!=null){this.normalTextureProvided=true;this.surfaceNormals=this._cf.renderStyle.nodes[i]._cf.surfaceNormals.node;}}\nthis.surfaceNormalsNeeded=true;return styleText;},inlineStyleShaderText:function(){var inlineText=\"    sample = value.r;\\n\";if(this._vf.surfaceValues.length==1){if(this._vf.contourStepSize==0.0){inlineText+=\"   if(((sample>=uSurfaceValues[0] && previous_value<uSurfaceValues[0])||(sample<uSurfaceValues[0] && previous_value>=uSurfaceValues[0])) && (grad.a>=uSurfaceTolerance)){\\n\"+\"       value = vec4(vec3(uSurfaceValues[0]),1.0);\\n\";if(this._cf.renderStyle.nodes){inlineText+=this._cf.renderStyle.nodes[0].inlineStyleShaderText();}\ninlineText+=\"       accum.rgb += (1.0 - accum.a) * (value.rgb * value.a);\\n\"+\"       accum.a += (1.0 - accum.a) * value.a;\\n\"+\"   }\\n\";}else{var tmp=this._vf.surfaceValues[0];var positive_range=[tmp];var negative_range=[];var range=[];while(tmp+this._vf.contourStepSize<=1.0){tmp+=this._vf.contourStepSize;positive_range.push(tmp);}\ntmp=this._vf.surfaceValues[0];while(tmp-this._vf.contourStepSize>=0.0){tmp-=this._vf.contourStepSize;negative_range.unshift(tmp);}\nrange=negative_range.concat(positive_range);for(var i=0;i<=range.length-1;i++){var s_value=range[i].toPrecision(3);inlineText+=\" if(((sample>=\"+s_value+\" && previous_value<\"+s_value+\")||(sample<\"+s_value+\" && previous_value>=\"+s_value+\")) && (grad.a>=uSurfaceTolerance)){\\n\"+\"       value = vec4(vec3(\"+s_value+\"),1.0);\\n\";if(this._cf.renderStyle.nodes){inlineText+=this._cf.renderStyle.nodes[0].inlineStyleShaderText();}\ninlineText+=\"       accum.rgb += (1.0 - accum.a) * (value.rgb * value.a);\\n\"+\"       accum.a += (1.0 - accum.a) * value.a;\\n\"+\"   }\\n\";};}}else{var n_styles=this._cf.renderStyle.nodes.length-1;var s_values=this._vf.surfaceValues.length;for(var i=0;i<s_values;i++){var index=Math.min(i,n_styles);inlineText+=\"   if(((sample>=uSurfaceValues[\"+i+\"] && previous_value<uSurfaceValues[\"+i+\"])||(sample<uSurfaceValues[\"+i+\"] && previous_value>=uSurfaceValues[\"+i+\"])) && (grad.a>=uSurfaceTolerance)){\\n\"+\"       value = vec4(vec3(uSurfaceValues[\"+i+\"]),1.0);\\n\";if(this._cf.renderStyle.nodes){inlineText+=this._cf.renderStyle.nodes[index].inlineStyleShaderText();}\ninlineText+=\"   accum.rgb += (1.0 - accum.a) * (value.rgb * value.a);\\n\"+\"   accum.a += (1.0 - accum.a) * value.a;\\n\"+\"   }\\n\";}}\ninlineText+=\"    previous_value = sample;\\n\";return inlineText;},styleShaderText:function(){var styleText=\"\";var n=this._cf.renderStyle.nodes.length;for(var i=0;i<n;i++){if(this._cf.renderStyle.nodes[i].styleShaderText!=undefined){styleText+=this._cf.renderStyle.nodes[i].styleShaderText()+\"\\n\";}}\nreturn styleText;},lightAssigment:function(){return this._cf.renderStyle.nodes[0].lightAssigment();},lightEquationShaderText:function(){return this._cf.renderStyle.nodes[0].lightEquationShaderText();},nodeChanged:function()\n{if(!this._cf.appearance.node)\n{var i;this.addChild(new x3dom.nodeTypes.Appearance());this.vrcVolumeTexture=this._cf.voxels.node;this.vrcVolumeTexture._vf.repeatS=false;this.vrcVolumeTexture._vf.repeatT=false;this.vrcMultiTexture._nameSpace=this._nameSpace;this.vrcMultiTexture.addChild(this.vrcVolumeTexture,'texture');this.vrcVolumeTexture.nodeChanged();var styleTextures=this.textures();for(i=0;i<styleTextures.length;i++)\n{this.vrcMultiTexture.addChild(styleTextures[i],'texture');this.vrcVolumeTexture.nodeChanged();}\nthis._cf.appearance.node.addChild(this.vrcMultiTexture);this.vrcMultiTexture.nodeChanged();for(var i=0;i<this._cf.renderStyle.nodes.length;i++){this._cf.renderStyle.nodes[i].updateProperties(this);}\nthis.vrcSinglePassShaderVertex._vf.type='vertex';this.vrcSinglePassShaderVertex._vf.url[0]=this.vertexShaderText();;this.vrcSinglePassShaderFragment._vf.type='fragment';var shaderText=this.fragmentPreamble+\nthis.defaultUniformsShaderText(this.vrcVolumeTexture._vf.numberOfSlices,this.vrcVolumeTexture._vf.slicesOverX,this.vrcVolumeTexture._vf.slicesOverY)+\nthis.styleUniformsShaderText()+\nthis.styleShaderText()+\nthis.texture3DFunctionShaderText+\nthis.normalFunctionShaderText()+\nthis.lightEquationShaderText();shaderText+=\"void main()\\n\"+\"{\\n\"+\"  vec3 cam_pos = vec3(modelViewMatrixInverse[3][0], modelViewMatrixInverse[3][1], modelViewMatrixInverse[3][2]);\\n\"+\"  vec3 cam_cube = cam_pos/dimensions+0.5;\\n\"+\"  vec3 dir = normalize(pos.xyz-cam_cube);\\n\";if(this._vf.allowViewpointInside){shaderText+=\"  float cam_inside = float(all(bvec2(all(lessThan(cam_cube, vec3(1.0))),all(greaterThan(cam_cube, vec3(0.0))))));\\n\"+\"  vec3 ray_pos = mix(pos.xyz, cam_cube, cam_inside);\\n\";}else{shaderText+=\"  vec3 ray_pos = pos.xyz;\\n\";}\nshaderText+=\"  vec4 accum  = vec4(0.0, 0.0, 0.0, 0.0);\\n\"+\"  float sample = 0.0;\\n\"+\"  vec4 value  = vec4(0.0, 0.0, 0.0, 0.0);\\n\"+\"  float cont = 0.0;\\n\"+\"  vec3 step = dir/Steps;\\n\";if(x3dom.nodeTypes.X3DLightNode.lightID>0){shaderText+=\"  vec3 ambient = vec3(0.0, 0.0, 0.0);\\n\"+\"  vec3 diffuse = vec3(0.0, 0.0, 0.0);\\n\"+\"  vec3 specular = vec3(0.0, 0.0, 0.0);\\n\"+\"  vec4 step_eye = modelViewMatrix * vec4(step, 0.0);\\n\"+\"  vec4 positionE = position_eye;\\n\"+\"  float lightFactor = 1.0;\\n\";}else{shaderText+=\"  float lightFactor = 1.2;\\n\";}\nshaderText+=this.initializeValues()+\"  float opacityFactor = 6.0;\\n\"+\"  float t_near;\\n\"+\"  float t_far;\\n\"+\"  for(float i = 0.0; i < Steps; i+=1.0)\\n\"+\"  {\\n\"+\"    value = cTexture3D(uVolData, ray_pos, numberOfSlices, slicesOverX, slicesOverY);\\n\"+\"    value = value.rgbr;\\n\";if(this._cf.gradients.node){shaderText+=\"    vec4 gradEye = getNormalFromTexture(uSurfaceNormals, ray_pos, numberOfSlices, slicesOverX, slicesOverY);\\n\";}else{shaderText+=\"    vec4 gradEye = getNormalOnTheFly(uVolData, ray_pos, numberOfSlices, slicesOverX, slicesOverY);\\n\";}\nshaderText+=\"    vec4 grad = vec4((modelViewMatrix * vec4(gradEye.xyz, 0.0)).xyz, gradEye.a);\\n\";for(var l=0;l<x3dom.nodeTypes.X3DLightNode.lightID;l++){shaderText+=\"    lighting(light\"+l+\"_Type, \"+\"light\"+l+\"_Location, \"+\"light\"+l+\"_Direction, \"+\"light\"+l+\"_Color, \"+\"light\"+l+\"_Attenuation, \"+\"light\"+l+\"_Radius, \"+\"light\"+l+\"_Intensity, \"+\"light\"+l+\"_AmbientIntensity, \"+\"light\"+l+\"_BeamWidth, \"+\"light\"+l+\"_CutOffAngle, \"+\"grad.xyz, positionE.xyz, ambient, diffuse, specular);\\n\";}\nshaderText+=this.inlineStyleShaderText();if(x3dom.nodeTypes.X3DLightNode.lightID>0){shaderText+=this.lightAssigment();}\nshaderText+=\"    //advance the current position\\n\"+\"    ray_pos.xyz += step;\\n\";if(x3dom.nodeTypes.X3DLightNode.lightID>0){shaderText+=\"    positionE += step_eye;\\n\";}\nshaderText+=\"    //break if the position is greater than <1, 1, 1>\\n\"+\"    if(ray_pos.x > 1.0 || ray_pos.y > 1.0 || ray_pos.z > 1.0 || ray_pos.x <= 0.0 || ray_pos.y <= 0.0 || ray_pos.z <= 0.0 || accum.a>=1.0)\\n\"+\"      break;\\n\"+\"  }\\n\"+\"  gl_FragColor = accum;\\n\"+\"}\";this.vrcSinglePassShaderFragment._vf.url[0]=shaderText;this.vrcSinglePassShader.addChild(this.vrcSinglePassShaderVertex,'parts');this.vrcSinglePassShaderVertex.nodeChanged();this.vrcSinglePassShader.addChild(this.vrcSinglePassShaderFragment,'parts');this.vrcSinglePassShaderFragment.nodeChanged();this.vrcSinglePassShaderFieldVolData._vf.name='uVolData';this.vrcSinglePassShaderFieldVolData._vf.type='SFInt32';this.vrcSinglePassShaderFieldVolData._vf.value=this._textureID++;this.vrcSinglePassShaderFieldDimensions._vf.name='dimensions';this.vrcSinglePassShaderFieldDimensions._vf.type='SFVec3f';this.vrcSinglePassShaderFieldDimensions._vf.value=this._vf.dimensions;this.vrcSinglePassShaderFieldOffset._vf.name='offset';this.vrcSinglePassShaderFieldOffset._vf.type='SFVec3f';this.vrcSinglePassShaderFieldOffset._vf.value=\"0.01 0.01 0.01\";this.vrcSinglePassShader.addChild(this.vrcSinglePassShaderFieldVolData,'fields');this.vrcSinglePassShaderFieldVolData.nodeChanged();this.vrcSinglePassShader.addChild(this.vrcSinglePassShaderFieldDimensions,'fields');this.vrcSinglePassShaderFieldDimensions.nodeChanged();this.vrcSinglePassShader.addChild(this.vrcSinglePassShaderFieldOffset,'fields');this.offsetInterval=window.setInterval((function(aTex,obj){return function(){x3dom.debug.logInfo('[VolumeRendering][IsoSurfaceVolumeData] Looking for Volume Texture size...');var s=obj.getTextureSize(aTex);if(s.valid){clearInterval(obj.offsetInterval);obj.vrcSinglePassShaderFieldOffset._vf.value=new x3dom.fields.SFVec3f(1.0/(s.w/aTex._vf.slicesOverX),1.0/(s.h/aTex._vf.slicesOverY),1.0/aTex._vf.numberOfSlices);obj.vrcSinglePassShader.nodeChanged();x3dom.debug.logInfo('[VolumeRendering][IsoSurfaceVolumeData] Volume Texture size obtained');}}})(this.vrcVolumeTexture,this),1000);var ShaderUniforms=this.uniforms();for(i=0;i<ShaderUniforms.length;i++)\n{this.vrcSinglePassShader.addChild(ShaderUniforms[i],'fields');}\nthis._cf.appearance.node.addChild(this.vrcSinglePassShader);this.vrcSinglePassShader.nodeChanged();this._cf.appearance.node.nodeChanged();}\nif(!this._cf.geometry.node){this.addChild(new x3dom.nodeTypes.Box());this._cf.geometry.node._vf.solid=false;this._cf.geometry.node._vf.hasHelperColors=false;this._cf.geometry.node._vf.size=new x3dom.fields.SFVec3f(this._vf.dimensions.x,this._vf.dimensions.y,this._vf.dimensions.z);this._cf.geometry.node.fieldChanged(\"size\");}}}));x3dom.registerNodeType(\"MPRVolumeStyle\",\"VolumeRendering\",defineClass(x3dom.nodeTypes.X3DVolumeRenderStyleNode,function(ctx){x3dom.nodeTypes.MPRVolumeStyle.superClass.call(this,ctx);this.addField_SFNode('transferFunction',x3dom.nodeTypes.Texture);this.addField_SFBool(ctx,'forceOpaque',true);this.addField_MFNode('planes',x3dom.nodeTypes.MPRPlane);this.uniformSampler2DTransferFunction=new x3dom.nodeTypes.Uniform(ctx);this.uniformBoolForceOpaque=new x3dom.nodeTypes.Uniform(ctx);},{fieldChanged:function(fieldName){switch(fieldName){case'forceOpaque':this.uniformBoolForceOpaque._vf.value=this._vf.forceOpaque;this.uniformBoolForceOpaque.fieldChanged(\"value\");break;}},uniforms:function(){var unis=[];if(this._cf.transferFunction.node){this.uniformSampler2DTransferFunction._vf.name='uTransferFunction';this.uniformSampler2DTransferFunction._vf.type='SFInt32';this.uniformSampler2DTransferFunction._vf.value=this._volumeDataParent._textureID++;unis.push(this.uniformSampler2DTransferFunction);}\nthis.uniformBoolForceOpaque._vf.name='forceOpaque';this.uniformBoolForceOpaque._vf.type='SFBool';this.uniformBoolForceOpaque._vf.value=this._vf.forceOpaque;unis.push(this.uniformBoolForceOpaque);var i,n=this._cf.planes.nodes.length;for(i=0;i<n;i++){var that=this;Array.forEach(this._cf.planes.nodes[i].uniforms(),function(uniform){var contains_uniform=false;Array.forEach(unis,function(accum){if(accum._vf.name==uniform._vf.name){contains_uniform=true;}});if(contains_uniform==false){unis=unis.concat(uniform);}});}\nreturn unis;},textures:function(){var texs=[];var tex=this._cf.transferFunction.node;if(tex){tex._vf.repeatS=false;tex._vf.repeatT=false;texs.push(tex);}\nreturn texs;},styleUniformsShaderText:function(){var uniformShaderText=\"uniform bool forceOpaque;\\n\";if(this._cf.transferFunction.node){uniformShaderText+=\"uniform sampler2D uTransferFunction;\\n\";}\nfor(let i=0;i<this._cf.planes.nodes.length;i++){uniformShaderText+=this._cf.planes.nodes[i].styleUniformsShaderText();}\nreturn uniformShaderText;},fragmentShaderText:function(numberOfSlices,slicesOverX,slicesOverY){var shader=this._parentNodes[0].fragmentPreamble+\nthis._parentNodes[0].defaultUniformsShaderText(numberOfSlices,slicesOverX,slicesOverY)+\nthis.styleUniformsShaderText()+\nthis._parentNodes[0].texture3DFunctionShaderText+\"void main()\\n\"+\"{\\n\"+\"  vec3 cam_pos = vec3(modelViewMatrixInverse[3][0], modelViewMatrixInverse[3][1], modelViewMatrixInverse[3][2]);\\n\"+\"  cam_pos = cam_pos/dimensions+0.5;\\n\"+\"  vec3 dir = normalize(pos.xyz-cam_pos);\\n\"+\"  float cam_inside = float(all(bvec2(all(lessThan(cam_pos, vec3(1.0))),all(greaterThan(cam_pos, vec3(0.0))))));\\n\"+\"  vec3 ray_pos = mix(pos.xyz, cam_pos, cam_inside);\\n\"+\"  float d = 1000.0;\";for(let i=0;i<this._cf.planes.nodes.length;i++){shader+=this._cf.planes.nodes[i].styleShaderText();}\nshader+=\"  vec4 color = vec4(0.0,0.0,0.0,0.0);\\n\"+\"  vec3 pos = d*dir+ray_pos;\\n\"+\"  if (!(any(bvec2(any(lessThan(pos.xyz, vec3(0.0))),any(greaterThan(pos.xyz, vec3(1.0))))))){\\n\"+\"    pos = clamp(pos, vec3(0.0), vec3(1.0));\\n\"+\"    vec4 intesity = cTexture3D(uVolData,pos.rgb,numberOfSlices,slicesOverX,slicesOverY);\\n\";if(this._cf.transferFunction.node){shader+=\"    if (forceOpaque){\\n\"+\"      color = vec4(texture2D(uTransferFunction, vec2(intesity.r,0.5)).rgb, 1.0);\\n\"+\"    }else{\\n\"+\"      color = texture2D(uTransferFunction, vec2(intesity.r,0.5)).rgba;\\n\"+\"    }\\n\";}else{shader+=\"    if (forceOpaque){\\n\"+\"      color = vec4(intesity.rgb,1.0);\\n\"+\"    }else{\\n\"+\"      color = intesity;\\n\"+\"    }\\n\";}\nshader+=\"  }\\n\"+\"  gl_FragColor = color;\\n\"+\"}\";return shader;}}));x3dom.registerNodeType(\"MPRPlane\",\"VolumeRendering\",defineClass(x3dom.nodeTypes.X3DNode,function(ctx){x3dom.nodeTypes.MPRPlane.superClass.call(this,ctx);this.addField_SFBool(ctx,'enabled',true);this.addField_SFVec3f(ctx,'normal',0.0,1.0,0.0);this.addField_SFFloat(ctx,'position',0.5);this.uniformBooleanEnabled=new x3dom.nodeTypes.Uniform(ctx);this.uniformVec3fNormal=new x3dom.nodeTypes.Uniform(ctx);this.uniformFloatPosition=new x3dom.nodeTypes.Uniform(ctx);this._planeID=0;},{nodeChanged:function(){if(!this._planeID){this._planeID=++x3dom.nodeTypes.MPRPlane.planeID;}},fieldChanged:function(fieldName){switch(fieldName){case'enabled':this.uniformBooleanEnabled._vf.value=this._vf.enabled.toString();this.uniformBooleanEnabled.fieldChanged(\"value\");break;case'position':this.uniformFloatPosition._vf.value=Math.min(Math.max(this._vf.position,0.001),0.999);this.uniformFloatPosition.fieldChanged(\"value\");break;case'normal':this.uniformVec3fNormal._vf.value=this._vf.normal;this.uniformVec3fNormal.fieldChanged(\"value\");break;}},uniforms:function(){var unis=[];this.uniformBooleanEnabled._vf.name='enabledPlane'+this._planeID;this.uniformBooleanEnabled._vf.type='SFBool';this.uniformBooleanEnabled._vf.value=this._vf.enabled;unis.push(this.uniformBooleanEnabled);this.uniformVec3fNormal._vf.name='normalPlane'+this._planeID;this.uniformVec3fNormal._vf.type='SFVec3f';this.uniformVec3fNormal._vf.value=this._vf.normal;unis.push(this.uniformVec3fNormal);this.uniformFloatPosition._vf.name='positionPlane'+this._planeID;this.uniformFloatPosition._vf.type='SFFloat';this.uniformFloatPosition._vf.value=this._vf.position;unis.push(this.uniformFloatPosition);return unis;},styleUniformsShaderText:function(){var uniformShaderText=\"uniform vec3 normalPlane\"+this._planeID+\";\\n\"+\"uniform float positionPlane\"+this._planeID+\";\\n\"+\"uniform bool enabledPlane\"+this._planeID+\";\\n\";return uniformShaderText;},styleShaderText:function(){var shaderText=\"  if(enabledPlane\"+this._planeID+\"){\\n\"+\"   vec3 pointLine\"+this._planeID+\" = normalPlane\"+this._planeID+\"*positionPlane\"+this._planeID+\";\\n\"+\"   float d\"+this._planeID+\" = dot(pointLine\"+this._planeID+\"-ray_pos,normalPlane\"+this._planeID+\")/dot(dir,normalPlane\"+this._planeID+\");\\n\"+\"   float f\"+this._planeID+\" = step(0.0, d\"+this._planeID+\");\\n\"+\"   d\"+this._planeID+\" = (1.0 - f\"+this._planeID+\") * 1000.0 + f\"+this._planeID+\" * d\"+this._planeID+\";\\n\"+\"   d = min(d\"+this._planeID+\",d);\\n\"+\"  }\\n\";return shaderText;}}));x3dom.nodeTypes.MPRPlane.planeID=0;x3dom.registerNodeType(\"OpacityMapVolumeStyle\",\"VolumeRendering\",defineClass(x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode,function(ctx){x3dom.nodeTypes.OpacityMapVolumeStyle.superClass.call(this,ctx);this.addField_SFNode('transferFunction',x3dom.nodeTypes.Texture);this.addField_SFString(ctx,'type',\"simple\");this.addField_SFFloat(ctx,'opacityFactor',6.0);this.addField_SFFloat(ctx,'lightFactor',1.2);this.uniformFloatOpacityFactor=new x3dom.nodeTypes.Uniform(ctx);this.uniformFloatLightFactor=new x3dom.nodeTypes.Uniform(ctx);this.uniformSampler2DTransferFunction=new x3dom.nodeTypes.Uniform(ctx);this.uniformBoolEnableOpacityMap=new x3dom.nodeTypes.Uniform(ctx);},{fieldChanged:function(fieldName){switch(fieldName){case'opacityFactor':this.uniformFloatOpacityFactor._vf.value=this._vf.opacityFactor;this.uniformFloatOpacityFactor.fieldChanged(\"value\");break;case'lightFactor':this.uniformFloatLightFactor._vf.value=this._vf.lightFactor;this.uniformFloatLightFactor.fieldChanged(\"value\");break;}},uniforms:function(){var unis=[];if(this._cf.transferFunction.node){this.uniformSampler2DTransferFunction._vf.name='uTransferFunction'+this._styleID;this.uniformSampler2DTransferFunction._vf.type='SFInt32';this.uniformSampler2DTransferFunction._vf.value=this._volumeDataParent._textureID++;unis.push(this.uniformSampler2DTransferFunction);}\nthis.uniformFloatOpacityFactor._vf.name='uOpacityFactor'+this._styleID;this.uniformFloatOpacityFactor._vf.type='SFFloat';this.uniformFloatOpacityFactor._vf.value=this._vf.opacityFactor;unis.push(this.uniformFloatOpacityFactor);this.uniformFloatLightFactor._vf.name='uLightFactor'+this._styleID;this.uniformFloatLightFactor._vf.type='SFFloat';this.uniformFloatLightFactor._vf.value=this._vf.lightFactor;unis.push(this.uniformFloatLightFactor);this.uniformBoolEnableOpacityMap._vf.name='uEnableOpacityMap'+this._styleID;this.uniformBoolEnableOpacityMap._vf.type='SFBool';this.uniformBoolEnableOpacityMap._vf.value=this._vf.enabled;unis.push(this.uniformBoolEnableOpacityMap);return unis;},textures:function(){var texs=[];var tex=this._cf.transferFunction.node;if(tex){tex._vf.repeatS=false;tex._vf.repeatT=false;texs.push(tex);}\nreturn texs;},styleUniformsShaderText:function(){var uniformsText=\"uniform float uOpacityFactor\"+this._styleID+\";\\n\"+\"uniform float uLightFactor\"+this._styleID+\";\\n\"+\"uniform bool uEnableOpacityMap\"+this._styleID+\";\\n\";if(this._cf.transferFunction.node){uniformsText+=\"uniform sampler2D uTransferFunction\"+this._styleID+\";\\n\";}\nreturn uniformsText;},inlineStyleShaderText:function(){var shaderText=\"    if(uEnableOpacityMap\"+this._styleID+\"){\\n\"+\"       opacityFactor = uOpacityFactor\"+this._styleID+\";\\n\"+\"       lightFactor = uLightFactor\"+this._styleID+\";\\n\";if(this._cf.transferFunction.node){shaderText+=\"       value = texture2D(uTransferFunction\"+this._styleID+\",vec2(value.r,0.5));\\n\";}\nshaderText+=\"    }\\n\";return shaderText;}}));x3dom.registerNodeType(\"ProjectionVolumeStyle\",\"VolumeRendering\",defineClass(x3dom.nodeTypes.X3DVolumeRenderStyleNode,function(ctx){x3dom.nodeTypes.ProjectionVolumeStyle.superClass.call(this,ctx);this.addField_SFFloat(ctx,'intensityThreshold',0);this.addField_SFString(ctx,'type',\"MAX\");this.uniformIntensityThreshold=new x3dom.nodeTypes.Uniform(ctx);},{fieldChanged:function(fieldName){if(fieldName==='intensityThreshold'){this.uniformIntensityThreshold._vf.value=this._vf.intensityThreshold;this.uniformIntensityThreshold.fieldChanged(\"value\");}else if(fieldName==='type'){}},uniforms:function(){var unis=[];this.uniformIntensityThreshold._vf.name='uIntensityThreshold';this.uniformIntensityThreshold._vf.type='SFFloat';this.uniformIntensityThreshold._vf.value=this._vf.intensityThreshold;unis.push(this.uniformIntensityThreshold);return unis;},styleUniformsShaderText:function(){return\"uniform int uType;\\n\"+\"uniform float uIntensityThreshold;\\n\";},fragmentShaderText:function(numberOfSlices,slicesOverX,slicesOverY){var shader=this._parentNodes[0].fragmentPreamble+\nthis._parentNodes[0].defaultUniformsShaderText(numberOfSlices,slicesOverX,slicesOverY)+\nthis.styleUniformsShaderText()+\nthis._parentNodes[0].texture3DFunctionShaderText+\"void main()\\n\"+\"{\\n\"+\"  vec3 cam_pos = vec3(modelViewMatrixInverse[3][0], modelViewMatrixInverse[3][1], modelViewMatrixInverse[3][2]);\\n\"+\"  cam_pos = cam_pos/dimensions+0.5;\\n\"+\"  vec3 dir = normalize(pos.xyz-cam_pos);\\n\"+\"  vec3 ray_pos = pos.xyz;\\n\"+\"  vec4 accum  = vec4(0.0, 0.0, 0.0, 0.0);\\n\"+\"  vec4 sample = vec4(0.0, 0.0, 0.0, 0.0);\\n\"+\"  vec4 value  = vec4(0.0, 0.0, 0.0, 0.0);\\n\"+\"  vec4 color  = vec4(0.0);\\n\";if(this._vf.type.toLowerCase()===\"max\"){shader+=\"vec2 previous_value = vec2(0.0);\\n\";}else{shader+=\"vec2 previous_value = vec2(1.0);\\n\";}\nshader+=\"  float cont = 0.0;\\n\"+\"  vec3 step_size = (dir*1.4142)/Steps;\\n\"+\"  const float lightFactor = 1.3;\\n\"+\"  const float opacityFactor = 3.0;\\n\"+\"  for(float i = 0.0; i < Steps; i+=1.0)\\n\"+\"  {\\n\"+\"    value = cTexture3D(uVolData,ray_pos,numberOfSlices,slicesOverX,slicesOverY);\\n\"+\"    value = vec4(value.rgb,(0.299*value.r)+(0.587*value.g)+(0.114*value.b));\\n\"+\"    //Process the volume sample\\n\"+\"    sample.a = value.a * opacityFactor * (1.0/Steps);\\n\"+\"    sample.rgb = value.rgb * sample.a * lightFactor;\\n\"+\"    accum.a += (1.0-accum.a)*sample.a;\\n\";if(this._vf.enabled){switch(this._vf.type.toLowerCase()){case\"max\":shader+=\"if(value.r > uIntensityThreshold && value.r <= previous_value.x){\\n\"+\"   break;\\n\"+\"}\\n\"+\"color.rgb = vec3(max(value.r, previous_value.x));\\n\"+\"color.a = (value.r > previous_value.x) ? accum.a : previous_value.y;\\n\";break;case\"min\":shader+=\"if(value.r < uIntensityThreshold && value.r >= previous_value.x){\\n\"+\"   break;\\n\"+\"}\\n\"+\"color.rgb = vec3(min(value.r, previous_value.x));\\n\"+\"color.a = (value.r < previous_value.x) ? accum.a : previous_value.y;\\n\";break;case\"average\":shader+=\"color.rgb += (1.0 - accum.a) * sample.rgb;\\n\"+\"color.a = accum.a;\\n\";break;}}\nshader+=\"    //update the previous value and keeping the accumulated alpha\\n\"+\"    previous_value.x = color.r;\\n\"+\"    previous_value.y = accum.a;\\n\"+\"    //advance the current position\\n\"+\"    ray_pos.xyz += step_size;\\n\"+\"    //break if the position is greater than <1, 1, 1>\\n\"+\"    if(ray_pos.x > 1.0 || ray_pos.y > 1.0 || ray_pos.z > 1.0 || ray_pos.x <= 0.0 || ray_pos.y <= 0.0 || ray_pos.z <= 0.0 || accum.a>=1.0){\\n\";if(this._vf.type.toLowerCase()==\"average\"&&this._vf.enabled){shader+=\"     if((i > 0.0) && (i < Steps-1.0)){\\n\"+\"color.rgb = color.rgb/i;\\n\"+\"}\\n\";}\nshader+=\"      break;\\n\"+\"    }\\n\"+\" }\\n\"+\" gl_FragColor = color;\\n\"+\"}\";return shader;}}));x3dom.registerNodeType(\"SegmentedVolumeData\",\"VolumeRendering\",defineClass(x3dom.nodeTypes.X3DVolumeDataNode,function(ctx){x3dom.nodeTypes.SegmentedVolumeData.superClass.call(this,ctx);this.addField_MFNode('renderStyle',x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode);this.addField_SFNode('segmentIdentifiers',x3dom.nodeTypes.Texture);this.addField_SFFloat(ctx,'numberOfMaxSegments',10.0);this.uniformSampler2DSegmentIdentifiers=new x3dom.nodeTypes.Uniform(ctx);this.normalTextureProvided=false;this.vrcMultiTexture=new x3dom.nodeTypes.MultiTexture(ctx);this.vrcVolumeTexture=null;this.vrcSinglePassShader=new x3dom.nodeTypes.ComposedShader(ctx);this.vrcSinglePassShaderVertex=new x3dom.nodeTypes.ShaderPart(ctx);this.vrcSinglePassShaderFragment=new x3dom.nodeTypes.ShaderPart(ctx);this.vrcSinglePassShaderFieldBackCoord=new x3dom.nodeTypes.Field(ctx);this.vrcSinglePassShaderFieldVolData=new x3dom.nodeTypes.Field(ctx);this.vrcSinglePassShaderFieldOffset=new x3dom.nodeTypes.Field(ctx);this.vrcSinglePassShaderFieldDimensions=new x3dom.nodeTypes.Field(ctx);},{fieldChanged:function(fieldName){if(fieldName===\"numberOfMaxSegments\"||fieldname===\"segmentIdentifiers\"){}},uniforms:function(){var unis=[];if(this._cf.segmentIdentifiers.node){this.uniformSampler2DSegmentIdentifiers._vf.name='uSegmentIdentifiers';this.uniformSampler2DSegmentIdentifiers._vf.type='SFInt32';this.uniformSampler2DSegmentIdentifiers._vf.value=this._textureID++;unis.push(this.uniformSampler2DSegmentIdentifiers);}\nif(this._cf.renderStyle.nodes){var i,n=this._cf.renderStyle.nodes.length;for(i=0;i<n;i++){var that=this;Array.forEach(this._cf.renderStyle.nodes[i].uniforms(),function(uniform){var contains_uniform=false;Array.forEach(unis,function(accum){if(accum._vf.name==uniform._vf.name){contains_uniform=true;}});if(contains_uniform==false){unis=unis.concat(uniform);}});}}\nreturn unis;},textures:function(){var texs=[];if(this._cf.segmentIdentifiers.node){var tex=this._cf.segmentIdentifiers.node;tex._vf.repeatS=false;tex._vf.repeatT=false;texs.push(tex);}\nvar i,n=this._cf.renderStyle.nodes.length;for(i=0;i<n;i++){Array.forEach(this._cf.renderStyle.nodes[i].textures(),function(texture){var contains_texture=false;Array.forEach(texs,function(accum){if(accum._vf.url[0]==texture._vf.url[0]){contains_texture=true;}});if(contains_texture==false){texs=texs.concat(texture);}});}\nreturn texs;},initializeValues:function(){var initialValues=\"\";var n=this._cf.renderStyle.nodes.length;for(var i=0;i<n;i++){if(this._cf.renderStyle.nodes[i].initializeValues!=undefined){initialValues+=this._cf.renderStyle.nodes[i].initializeValues()+\"\\n\";}}\nreturn initialValues;},styleUniformsShaderText:function(){var styleText=\"const float maxSegments = \"+this._vf.numberOfMaxSegments.toPrecision(3)+\";\\n\"+\"uniform sampler2D uSegmentIdentifiers;\\n\";var n=this._cf.renderStyle.nodes.length;for(var i=0;i<n;i++){styleText+=this._cf.renderStyle.nodes[i].styleUniformsShaderText()+\"\\n\";if(this._cf.renderStyle.nodes[i]._cf.surfaceNormals&&this._cf.renderStyle.nodes[i]._cf.surfaceNormals.node!=null){styleText+=\"uniform sampler2D uSurfaceNormals;\\n\";this.normalTextureProvided=true;this.surfaceNormals=this._cf.renderStyle.nodes[i]._cf.surfaceNormals.node;}\nif(!x3dom.isa(this._cf.renderStyle.nodes[i],x3dom.nodeTypes.OpacityMapVolumeStyle)){this.surfaceNormalsNeeded=true;}}\nreturn styleText;},styleShaderText:function(){var styleText=\"\";var n=this._cf.renderStyle.nodes.length;for(var i=0;i<n;i++){if(this._cf.renderStyle.nodes[i].styleShaderText!=undefined){styleText+=this._cf.renderStyle.nodes[i].styleShaderText()+\"\\n\";}}\nreturn styleText;},inlineStyleShaderText:function(){var inlineText=\"\";if(this._cf.segmentIdentifiers.node){inlineText+=\"    float t_id = cTexture3D(uSegmentIdentifiers, ray_pos, numberOfSlices, slicesOverX, slicesOverY).r;\\n\"+\"    int s_id = int(clamp(floor(t_id*maxSegments-0.5),0.0,maxSegments));\\n\"+\"    opacityFactor = 10.0;\\n\";if(x3dom.nodeTypes.X3DLightNode.lightID>0){inlineText+=\"    lightFactor = 1.0;\\n\";}else{inlineText+=\"    lightFactor = 1.2;\\n\";}}else{inlineText+=\"    int s_id = 0;\\n\";}\nvar n=this._cf.renderStyle.nodes.length;for(var i=0;i<n;i++){inlineText+=\"    if (s_id == \"+i+\"){\\n\"+\nthis._cf.renderStyle.nodes[i].inlineStyleShaderText()+\"    }\\n\";}\nreturn inlineText;},lightAssigment:function(){return this._cf.renderStyle.nodes[0].lightAssigment();},lightEquationShaderText:function(){return this._cf.renderStyle.nodes[0].lightEquationShaderText();},nodeChanged:function()\n{if(!this._cf.appearance.node)\n{var i;this.addChild(new x3dom.nodeTypes.Appearance());this.vrcVolumeTexture=this._cf.voxels.node;this.vrcVolumeTexture._vf.repeatS=false;this.vrcVolumeTexture._vf.repeatT=false;this.vrcMultiTexture._nameSpace=this._nameSpace;this.vrcMultiTexture.addChild(this.vrcVolumeTexture,'texture');this.vrcVolumeTexture.nodeChanged();var styleTextures=this.textures();for(i=0;i<styleTextures.length;i++)\n{this.vrcMultiTexture.addChild(styleTextures[i],'texture');this.vrcVolumeTexture.nodeChanged();}\nthis._cf.appearance.node.addChild(this.vrcMultiTexture);this.vrcMultiTexture.nodeChanged();for(var i=0;i<this._cf.renderStyle.nodes.length;i++){this._cf.renderStyle.nodes[i].updateProperties(this);}\nthis.vrcSinglePassShaderVertex._vf.type='vertex';this.vrcSinglePassShaderVertex._vf.url[0]=this.vertexShaderText();this.vrcSinglePassShaderFragment._vf.type='fragment';var shaderText=this.fragmentPreamble+\nthis.defaultUniformsShaderText(this.vrcVolumeTexture._vf.numberOfSlices,this.vrcVolumeTexture._vf.slicesOverX,this.vrcVolumeTexture._vf.slicesOverY)+\nthis.styleUniformsShaderText()+\nthis.styleShaderText()+\nthis.texture3DFunctionShaderText+\nthis.normalFunctionShaderText()+\nthis.lightEquationShaderText()+\nthis.defaultLoopFragmentShaderText(this.inlineStyleShaderText(),this.lightAssigment(),this.initializeValues());this.vrcSinglePassShaderFragment._vf.url[0]=shaderText;this.vrcSinglePassShader.addChild(this.vrcSinglePassShaderVertex,'parts');this.vrcSinglePassShaderVertex.nodeChanged();this.vrcSinglePassShader.addChild(this.vrcSinglePassShaderFragment,'parts');this.vrcSinglePassShaderFragment.nodeChanged();this.vrcSinglePassShaderFieldVolData._vf.name='uVolData';this.vrcSinglePassShaderFieldVolData._vf.type='SFInt32';this.vrcSinglePassShaderFieldVolData._vf.value=this._textureID++;this.vrcSinglePassShaderFieldDimensions._vf.name='dimensions';this.vrcSinglePassShaderFieldDimensions._vf.type='SFVec3f';this.vrcSinglePassShaderFieldDimensions._vf.value=this._vf.dimensions;this.vrcSinglePassShaderFieldOffset._vf.name='offset';this.vrcSinglePassShaderFieldOffset._vf.type='SFVec3f';this.vrcSinglePassShaderFieldOffset._vf.value=\"0.01 0.01 0.01\";this.vrcSinglePassShader.addChild(this.vrcSinglePassShaderFieldVolData,'fields');this.vrcSinglePassShaderFieldVolData.nodeChanged();this.vrcSinglePassShader.addChild(this.vrcSinglePassShaderFieldDimensions,'fields');this.vrcSinglePassShaderFieldDimensions.nodeChanged();this.vrcSinglePassShader.addChild(this.vrcSinglePassShaderFieldOffset,'fields');this.offsetInterval=window.setInterval((function(aTex,obj){return function(){x3dom.debug.logInfo('[VolumeRendering][SegmentedVolumeData] Looking for Volume Texture size...');var s=obj.getTextureSize(aTex);if(s.valid){clearInterval(obj.offsetInterval);obj.vrcSinglePassShaderFieldOffset._vf.value=new x3dom.fields.SFVec3f(1.0/(s.w/aTex._vf.slicesOverX),1.0/(s.h/aTex._vf.slicesOverY),1.0/aTex._vf.numberOfSlices);obj.vrcSinglePassShader.nodeChanged();x3dom.debug.logInfo('[VolumeRendering][SegmentedVolumeData] Volume Texture size obtained');}}})(this.vrcVolumeTexture,this),1000);var ShaderUniforms=this.uniforms();for(i=0;i<ShaderUniforms.length;i++)\n{this.vrcSinglePassShader.addChild(ShaderUniforms[i],'fields');}\nthis._cf.appearance.node.addChild(this.vrcSinglePassShader);this.vrcSinglePassShader.nodeChanged();this._cf.appearance.node.nodeChanged();}\nif(!this._cf.geometry.node){this.addChild(new x3dom.nodeTypes.Box());this._cf.geometry.node._vf.solid=false;this._cf.geometry.node._vf.hasHelperColors=false;this._cf.geometry.node._vf.size=new x3dom.fields.SFVec3f(this._vf.dimensions.x,this._vf.dimensions.y,this._vf.dimensions.z);this._cf.geometry.node.fieldChanged(\"size\");}}}));x3dom.registerNodeType(\"ShadedVolumeStyle\",\"VolumeRendering\",defineClass(x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode,function(ctx){x3dom.nodeTypes.ShadedVolumeStyle.superClass.call(this,ctx);this.addField_SFNode('material',x3dom.nodeTypes.X3DMaterialNode);this.addField_SFBool(ctx,'lighting',false);this.addField_SFBool(ctx,'shadows',false);this.addField_SFString(ctx,'phaseFunction',\"Henyey-Greenstein\");this.uniformBoolLigthning=new x3dom.nodeTypes.Uniform(ctx);this.uniformBoolShadows=new x3dom.nodeTypes.Uniform(ctx);this.uniformSampler2DSurfaceNormals=new x3dom.nodeTypes.Uniform(ctx);this.uniformColorSpecular=new x3dom.nodeTypes.Uniform(ctx);this.uniformFloatAmbientIntensity=new x3dom.nodeTypes.Uniform(ctx);this.uniformFloatShininess=new x3dom.nodeTypes.Uniform(ctx);this.uniformFloatTransparency=new x3dom.nodeTypes.Uniform(ctx);this.uniformColorEmissive=new x3dom.nodeTypes.Uniform(ctx);this.uniformColorDiffuse=new x3dom.nodeTypes.Uniform(ctx);this.uniformBoolEnableShaded=new x3dom.nodeTypes.Uniform(ctx);},{fieldChanged:function(fieldName){switch(fieldName){case'lightning':this.uniformBoolLightning._vf.value=this._vf.lightning;this.uniformBoolLightning.fieldChanged(\"value\");break;case'shadows':this.uniformBoolShadows._vf.value=this._vf.shadows;this.uniformBoolShadows.fieldChanged(\"value\");break;default:break;}},uniforms:function(){var unis=[];if(this._cf.surfaceNormals.node){this.uniformSampler2DSurfaceNormals._vf.name='uSurfaceNormals';this.uniformSampler2DSurfaceNormals._vf.type='SFInt32';this.uniformSampler2DSurfaceNormals._vf.value=this._volumeDataParent._textureID++;unis.push(this.uniformSampler2DSurfaceNormals);}\nthis.uniformBoolLigthning._vf.name='uLightning'+this._styleID;this.uniformBoolLigthning._vf.type='SFBool';this.uniformBoolLigthning._vf.value=this._vf.lighting;unis.push(this.uniformBoolLigthning);this.uniformBoolShadows._vf.name='uShadows'+this._styleID;this.uniformBoolShadows._vf.type='SFBool';this.uniformBoolShadows._vf.value=this._vf.shadows;unis.push(this.uniformBoolShadows);if(this._cf.material.node!=null){this.uniformColorSpecular._vf.name='specularColor'+this._styleID;this.uniformColorSpecular._vf.type='SFColor';this.uniformColorSpecular._vf.value=this._cf.material.node._vf.specularColor;unis.push(this.uniformColorSpecular);this.uniformColorDiffuse._vf.name='diffuseColor'+this._styleID;this.uniformColorDiffuse._vf.type='SFColor';this.uniformColorDiffuse._vf.value=this._cf.material.node._vf.diffuseColor;unis.push(this.uniformColorDiffuse);this.uniformColorEmissive._vf.name='emissiveColor'+this._styleID;this.uniformColorEmissive._vf.type='SFColor';this.uniformColorEmissive._vf.value=this._cf.material.node._vf.emissiveColor;unis.push(this.uniformColorEmissive);this.uniformFloatAmbientIntensity._vf.name='ambientIntensity'+this._styleID;this.uniformFloatAmbientIntensity._vf.type='SFFloat';this.uniformFloatAmbientIntensity._vf.value=this._cf.material.node._vf.ambientIntensity;unis.push(this.uniformFloatAmbientIntensity);this.uniformFloatShininess._vf.name='shininess'+this._styleID;this.uniformFloatShininess._vf.type='SFFloat';this.uniformFloatShininess._vf.value=this._cf.material.node._vf.shininess;unis.push(this.uniformFloatShininess);this.uniformFloatTransparency._vf.name='transparency'+this._styleID;this.uniformFloatTransparency._vf.type='SFFloat';this.uniformFloatTransparency._vf.value=this._cf.material.node._vf.transperency;unis.push(this.uniformFloatTransparency);}\nthis.uniformBoolEnableShaded._vf.name='uEnableShaded'+this._styleID;this.uniformBoolEnableShaded._vf.type='SFBool';this.uniformBoolEnableShaded._vf.value=this._vf.enabled;unis.push(this.uniformBoolEnableShaded);return unis;},textures:function(){var texs=[];if(this._cf.surfaceNormals.node){var tex=this._cf.surfaceNormals.node;tex._vf.repeatS=false;tex._vf.repeatT=false;texs.push(tex)}\nreturn texs;},styleUniformsShaderText:function(){var uniformText=\"uniform bool uLightning\"+this._styleID+\";\\n\"+\"uniform bool uShadows\"+this._styleID+\";\\n\"+\"uniform float fogRange;\\n\"+\"uniform vec3 fogColor;\\n\"+\"uniform float fogType;\\n\"+\"uniform bool uEnableShaded\"+this._styleID+\";\\n\";if(this._cf.material.node){uniformText+=\"uniform vec3  diffuseColor\"+this._styleID+\";\\n\"+\"uniform vec3  specularColor\"+this._styleID+\";\\n\"+\"uniform vec3  emissiveColor\"+this._styleID+\";\\n\"+\"uniform float shininess\"+this._styleID+\";\\n\"+\"uniform float transparency\"+this._styleID+\";\\n\"+\"uniform float ambientIntensity\"+this._styleID+\";\\n\";}\nreturn uniformText;},styleShaderText:function(){if(this._first){return\"float computeFogInterpolant(float distanceFromPoint)\\n\"+\"{\\n\"+\"  if (distanceFromPoint > fogRange){\\n\"+\"    return 0.0;\\n\"+\"  }else if (fogType == 0.0){\\n\"+\"    return clamp((fogRange-distanceFromPoint) / fogRange, 0.0, 1.0);\\n\"+\"  }else{\\n\"+\"    return clamp(exp(-distanceFromPoint / (fogRange-distanceFromPoint)), 0.0, 1.0);\\n\"+\"  }\\n\"+\"}\\n\";}else{return\"\";}},lightEquationShaderText:function(){if(this._first){return\"void lighting(in float lType, in vec3 lLocation, in vec3 lDirection, in vec3 lColor, in vec3 lAttenuation, \"+\"in float lRadius, in float lIntensity, in float lAmbientIntensity, in float lBeamWidth, \"+\"in float lCutOffAngle, in float ambientIntensity, in float shininess, in vec3 N, in vec3 V, inout vec3 ambient, inout vec3 diffuse, \"+\"inout vec3 specular)\\n\"+\"{\\n\"+\"   vec3 L;\\n\"+\"   float spot = 1.0, attentuation = 0.0;\\n\"+\"   if(lType == 0.0) {\\n\"+\"       L = -normalize(lDirection);\\n\"+\"       V = normalize(V);\\n\"+\"       attentuation = 1.0;\\n\"+\"   } else{\\n\"+\"       L = (lLocation - (-V));\\n\"+\"       float d = length(L);\\n\"+\"       L = normalize(L);\\n\"+\"       V = normalize(V);\\n\"+\"       if(lRadius == 0.0 || d <= lRadius) {\\n\"+\"           attentuation = 1.0 / max(lAttenuation.x + lAttenuation.y * d + lAttenuation.z * (d * d), 1.0);\\n\"+\"       }\\n\"+\"       if(lType == 2.0) {\\n\"+\"           float spotAngle = acos(max(0.0, dot(-L, normalize(lDirection))));\\n\"+\"           if(spotAngle >= lCutOffAngle) spot = 0.0;\\n\"+\"           else if(spotAngle <= lBeamWidth) spot = 1.0;\\n\"+\"           else spot = (spotAngle - lCutOffAngle ) / (lBeamWidth - lCutOffAngle);\\n\"+\"       }\\n\"+\"   }\\n\"+\"   vec3 H = normalize( L + V );\\n\"+\"   float NdotL = max(0.0, dot(L, N));\\n\"+\"   float NdotH = max(0.0, dot(H, N));\\n\"+\"   float ambientFactor = lAmbientIntensity * ambientIntensity;\\n\"+\"   float diffuseFactor = lIntensity * NdotL;\\n\"+\"   float specularFactor = lIntensity * pow(NdotH, shininess*128.0);\\n\"+\"   ambient += lColor * ambientFactor * attentuation * spot;\\n\"+\"   diffuse += lColor * diffuseFactor * attentuation * spot;\\n\"+\"   specular += lColor * specularFactor * attentuation * spot;\\n\"+\"}\\n\";}else{return\"\";}},inlineStyleShaderText:function(){if(this._first){return\"    float fogFactor = computeFogInterpolant(length(cam_pos-ray_pos));\\n\";}else{return\"\";}},lightAssigment:function(){var shaderText=\"    if(uEnableShaded\"+this._styleID+\"){\\n\";for(var l=0;l<x3dom.nodeTypes.X3DLightNode.lightID;l++){shaderText+=\"    lighting(light\"+l+\"_Type, \"+\"light\"+l+\"_Location, \"+\"light\"+l+\"_Direction, \"+\"light\"+l+\"_Color, \"+\"light\"+l+\"_Attenuation, \"+\"light\"+l+\"_Radius, \"+\"light\"+l+\"_Intensity, \"+\"light\"+l+\"_AmbientIntensity, \"+\"light\"+l+\"_BeamWidth, \"+\"light\"+l+\"_CutOffAngle, \"+\"ambientIntensity\"+this._styleID+\", \"+\"shininess\"+this._styleID+\", \"+\"grad.xyz, positionE.xyz, ambient, diffuse, specular);\\n\";}\nif(this._vf.lighting==true){if(this._cf.material.node){shaderText+=\"      value.rgb = (fogColor*(1.0-fogFactor))+fogFactor*(emissiveColor\"+this._styleID+\" + ambient*value.rgb + diffuse*diffuseColor\"+this._styleID+\"*value.rgb + specular*specularColor\"+this._styleID+\");\\n\"+\"      value.a = value.a*(1.0-transparency\"+this._styleID+\");\\n\";}else{shaderText+=\"      value.rgb = (fogColor*(1.0-fogFactor))+fogFactor*(ambient*value.rgb + diffuse*value.rgb + specular);\\n\";}}\nshaderText+=\"    }\\n\";return shaderText;}}));x3dom.registerNodeType(\"SilhouetteEnhancementVolumeStyle\",\"VolumeRendering\",defineClass(x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode,function(ctx){x3dom.nodeTypes.SilhouetteEnhancementVolumeStyle.superClass.call(this,ctx);this.addField_SFFloat(ctx,'silhouetteBoundaryOpacity',0);this.addField_SFFloat(ctx,'silhouetteRetainedOpacity',1);this.addField_SFFloat(ctx,'silhouetteSharpness',0.5);this.uniformFloatBoundaryOpacity=new x3dom.nodeTypes.Uniform(ctx);this.uniformFloatRetainedOpacity=new x3dom.nodeTypes.Uniform(ctx);this.uniformFloatSilhouetteSharpness=new x3dom.nodeTypes.Uniform(ctx);this.uniformSampler2DSurfaceNormals=new x3dom.nodeTypes.Uniform(ctx);this.uniformBoolEnableSilhouette=new x3dom.nodeTypes.Uniform(ctx);},{fieldChanged:function(fieldName){switch(fieldName){case'silhouetteBoundaryOpacity':this.uniformFloatBoundaryOpacity._vf.value=this._vf.silhouetteBoundaryOpacity;this.uniformFloatBoundaryOpacity.fieldChanged(\"value\");break;case'silhouetteRetainedOpacity':this.uniformFloatRetainedOpacity._vf.value=this._vf.silhouetteRetainedOpacity;this.uniformFloatRetainedOpacity.fieldChanged(\"value\");break;case'silhouetteSharpness':this.uniformFloatSilhouetteSharpness._vf.value=this._vf.silhouetteSharpness;this.uniformFloatSilhouetteSharpness.fieldChanged(\"value\");break;}},uniforms:function(){var unis=[];if(this._cf.surfaceNormals.node){this.uniformSampler2DSurfaceNormals._vf.name='uSurfaceNormals';this.uniformSampler2DSurfaceNormals._vf.type='SFInt32';this.uniformSampler2DSurfaceNormals._vf.value=this._volumeDataParent._textureID++;unis.push(this.uniformSampler2DSurfaceNormals);}\nthis.uniformFloatBoundaryOpacity._vf.name='uSilhouetteBoundaryOpacity'+this._styleID;this.uniformFloatBoundaryOpacity._vf.type='SFFloat';this.uniformFloatBoundaryOpacity._vf.value=this._vf.silhouetteBoundaryOpacity;unis.push(this.uniformFloatBoundaryOpacity);this.uniformFloatRetainedOpacity._vf.name='uSilhouetteRetainedOpacity'+this._styleID;this.uniformFloatRetainedOpacity._vf.type='SFFloat';this.uniformFloatRetainedOpacity._vf.value=this._vf.silhouetteRetainedOpacity;unis.push(this.uniformFloatRetainedOpacity);this.uniformFloatSilhouetteSharpness._vf.name='uSilhouetteSharpness'+this._styleID;this.uniformFloatSilhouetteSharpness._vf.type='SFFloat';this.uniformFloatSilhouetteSharpness._vf.value=this._vf.silhouetteSharpness;unis.push(this.uniformFloatSilhouetteSharpness);this.uniformBoolEnableSilhouette._vf.name='uEnableSilhouette'+this._styleID;this.uniformBoolEnableSilhouette._vf.type='SFBool';this.uniformBoolEnableSilhouette._vf.value=this._vf.enabled;unis.push(this.uniformBoolEnableSilhouette);return unis;},textures:function(){var texs=[];if(!(this._cf.surfaceNormals.node==null)){var tex=this._cf.surfaceNormals.node;tex._vf.repeatS=false;tex._vf.repeatT=false;texs.push(tex)}\nreturn texs;},styleUniformsShaderText:function(){return\"uniform float uSilhouetteBoundaryOpacity\"+this._styleID+\";\\n\"+\"uniform float uSilhouetteRetainedOpacity\"+this._styleID+\";\\n\"+\"uniform float uSilhouetteSharpness\"+this._styleID+\";\\n\"+\"uniform bool uEnableSilhouette\"+this._styleID+\";\\n\";},styleShaderText:function(){if(this._first){return\"void silhouetteEnhancement(inout vec4 orig_color, in vec4 normal, in vec3 V, in float sBoundary, in float sRetained, in float sSharpness)\\n\"+\"{\\n\"+\"   if(normal.w > 0.02){\\n\"+\"       orig_color.a = orig_color.a * (sRetained + sBoundary * pow((1.0-abs(dot(normal.xyz, V))), sSharpness));\\n\"+\"   }\\n\"+\"}\\n\"+\"\\n\";}else{return\"\";}},inlineStyleShaderText:function(){var inlineText=\"  if(uEnableSilhouette\"+this._styleID+\"){\\n\"+\"       silhouetteEnhancement(value, gradEye, dir, uSilhouetteBoundaryOpacity\"+this._styleID+\", uSilhouetteRetainedOpacity\"+this._styleID+\", uSilhouetteSharpness\"+this._styleID+\");\\n\"+\"   }\\n\";return inlineText;}}));x3dom.registerNodeType(\"StippleVolumeStyle\",\"VolumeRendering\",defineClass(x3dom.nodeTypes.X3DVolumeRenderStyleNode,function(ctx){x3dom.nodeTypes.StippleVolumeStyle.superClass.call(this,ctx);this.addField_SFFloat(ctx,'distanceFactor',1);this.addField_SFFloat(ctx,'interiorFactor',1);this.addField_SFFloat(ctx,'lightingFactor',1);this.addField_SFFloat(ctx,'gradientThreshold',0.4);this.addField_SFFloat(ctx,'gradientRetainedOpacity',1);this.addField_SFFloat(ctx,'gradientBoundaryOpacity',0);this.addField_SFFloat(ctx,'gradientOpacityFactor',1);this.addField_SFFloat(ctx,'silhouetteRetainedOpacity',1);this.addField_SFFloat(ctx,'silhouetteBoundaryOpacity',0);this.addField_SFFloat(ctx,'silhouetteOpacityFactor',1);this.addField_SFFloat(ctx,'resolutionFactor',1);}));x3dom.registerNodeType(\"ToneMappedVolumeStyle\",\"VolumeRendering\",defineClass(x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode,function(ctx){x3dom.nodeTypes.ToneMappedVolumeStyle.superClass.call(this,ctx);this.addField_SFColor(ctx,'coolColor',0,0,1);this.addField_SFColor(ctx,'warmColor',1,1,0);this.uniformCoolColor=new x3dom.nodeTypes.Uniform(ctx);this.uniformWarmColor=new x3dom.nodeTypes.Uniform(ctx);this.uniformSampler2DSurfaceNormals=new x3dom.nodeTypes.Uniform(ctx);this.uniformBoolEnableToneMapped=new x3dom.nodeTypes.Uniform(ctx);},{fieldChanged:function(fieldName){switch(fieldName){case'coolColor':this.uniformCoolColor._vf.value=this._vf.coolColor;this.uniformCoolColor.fieldChanged(\"value\");break;case'warmColor':this.uniformWarmColor._vf.value=this._vf.warmColor;this.uniformWarmColor.fieldChanged(\"value\");break;}},uniforms:function(){var unis=[];if(this._cf.surfaceNormals.node){this.uniformSampler2DSurfaceNormals._vf.name='uSurfaceNormals';this.uniformSampler2DSurfaceNormals._vf.type='SFInt32';this.uniformSampler2DSurfaceNormals._vf.value=this._volumeDataParent._textureID++;unis.push(this.uniformSampler2DSurfaceNormals);}\nthis.uniformCoolColor._vf.name='uCoolColor'+this._styleID;this.uniformCoolColor._vf.type='SFColor';this.uniformCoolColor._vf.value=this._vf.coolColor;unis.push(this.uniformCoolColor);this.uniformWarmColor._vf.name='uWarmColor'+this._styleID;this.uniformWarmColor._vf.type='SFColor';this.uniformWarmColor._vf.value=this._vf.warmColor;unis.push(this.uniformWarmColor);this.uniformBoolEnableToneMapped._vf.name='uEnableToneMapped'+this._styleID;this.uniformBoolEnableToneMapped._vf.type='SFBool';this.uniformBoolEnableToneMapped._vf.value=this._vf.enabled;unis.push(this.uniformBoolEnableToneMapped);return unis;},textures:function(){var texs=[];if(this._cf.surfaceNormals.node){var tex=this._cf.surfaceNormals.node;tex._vf.repeatS=false;tex._vf.repeatT=false;texs.push(tex)}\nreturn texs;},styleUniformsShaderText:function(){return\"uniform vec3 uCoolColor\"+this._styleID+\";\\n\"+\"uniform vec3 uWarmColor\"+this._styleID+\";\\n\"+\"uniform bool uEnableToneMapped\"+this._styleID+\";\\n\";},styleShaderText:function(){if(this._first){return\"void toneMapped(inout vec4 original_color, inout vec3 accum_color, in vec4 surfNormal, in vec3 lightDir, in vec3 cColor, in vec3 wColor)\\n\"+\"{\\n\"+\"   if(surfNormal.a > 0.02){\\n\"+\"       float color_factor = (1.0 + dot(lightDir, surfNormal.xyz))*0.5;\\n\"+\"       accum_color += mix(wColor, cColor, color_factor);\\n\"+\"       original_color.rgb = accum_color;\\n\"+\"   }else{\\n\"+\"       accum_color += mix(wColor, cColor, 0.5);\\n\"+\"       original_color.rgb = accum_color;\\n\"+\"   }\\n\"+\"}\\n\";}else{return\"\";}},inlineStyleShaderText:function(){var shaderText=\"    if(uEnableToneMapped\"+this._styleID+\"){\\n\"+\"       vec3 toneColor = vec3(0.0, 0.0, 0.0);\\n\"+\"       vec3 L = vec3(0.0, 0.0, 0.0);\\n\";for(var l=0;l<x3dom.nodeTypes.X3DLightNode.lightID;l++){shaderText+=\"       L = (light\"+l+\"_Type == 1.0) ? normalize(light\"+l+\"_Location - positionE.xyz) : -light\"+l+\"_Direction;\\n\"+\"       toneMapped(value, toneColor, grad, L, uCoolColor\"+this._styleID+\", uWarmColor\"+this._styleID+\");\\n\";}\nshaderText+=\"    }\\n\";return shaderText;},lightAssigment:function(){return\"\";}}));x3dom.registerNodeType(\"RadarVolumeStyle\",\"VolumeRendering\",defineClass(x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode,function(ctx){x3dom.nodeTypes.RadarVolumeStyle.superClass.call(this,ctx);this.addField_SFNode('transferFunction',x3dom.nodeTypes.Texture);this.addField_SFString(ctx,'type',\"simple\");this.addField_SFFloat(ctx,'opacityFactor',6.0);this.addField_SFFloat(ctx,'lightFactor',1.2);this.uniformFloatOpacityFactor=new x3dom.nodeTypes.Uniform(ctx);this.uniformFloatLightFactor=new x3dom.nodeTypes.Uniform(ctx);this.uniformSampler2DTransferFunction=new x3dom.nodeTypes.Uniform(ctx);this.uniformBoolEnableOpacityMap=new x3dom.nodeTypes.Uniform(ctx);},{fieldChanged:function(fieldName){switch(fieldName){case'opacityFactor':this.uniformFloatOpacityFactor._vf.value=this._vf.opacityFactor;this.uniformFloatOpacityFactor.fieldChanged(\"value\");break;case'lightFactor':this.uniformFloatLightFactor._vf.value=this._vf.lightFactor;this.uniformFloatLightFactor.fieldChanged(\"value\");break;}},uniforms:function(){var unis=[];if(this._cf.transferFunction.node){this.uniformSampler2DTransferFunction._vf.name='uTransferFunction'+this._styleID;this.uniformSampler2DTransferFunction._vf.type='SFInt32';this.uniformSampler2DTransferFunction._vf.value=this._volumeDataParent._textureID++;unis.push(this.uniformSampler2DTransferFunction);}\nthis.uniformFloatOpacityFactor._vf.name='uOpacityFactor'+this._styleID;this.uniformFloatOpacityFactor._vf.type='SFFloat';this.uniformFloatOpacityFactor._vf.value=this._vf.opacityFactor;unis.push(this.uniformFloatOpacityFactor);this.uniformFloatLightFactor._vf.name='uLightFactor'+this._styleID;this.uniformFloatLightFactor._vf.type='SFFloat';this.uniformFloatLightFactor._vf.value=this._vf.lightFactor;unis.push(this.uniformFloatLightFactor);this.uniformBoolEnableOpacityMap._vf.name='uEnableOpacityMap'+this._styleID;this.uniformBoolEnableOpacityMap._vf.type='SFBool';this.uniformBoolEnableOpacityMap._vf.value=this._vf.enabled;unis.push(this.uniformBoolEnableOpacityMap);return unis;},textures:function(){var texs=[];var tex=this._cf.transferFunction.node;if(tex){tex._vf.repeatS=false;tex._vf.repeatT=false;texs.push(tex);}\nreturn texs;},styleUniformsShaderText:function(){var uniformsText=\"uniform float uOpacityFactor\"+this._styleID+\";\\n\"+\"uniform float uLightFactor\"+this._styleID+\";\\n\"+\"uniform bool uEnableOpacityMap\"+this._styleID+\";\\n\";if(this._cf.transferFunction.node){uniformsText+=\"uniform sampler2D uTransferFunction\"+this._styleID+\";\\n\";}\nreturn uniformsText;},inlineStyleShaderText:function(){var shaderText=\"    if(uEnableOpacityMap\"+this._styleID+\"){\\n\"+\"       opacityFactor = uOpacityFactor\"+this._styleID+\";\\n\"+\"       lightFactor = uLightFactor\"+this._styleID+\";\\n\";if(this._cf.transferFunction.node){shaderText+=\"       if(value.r > 0.3){\\n\";shaderText+=\"         value = texture2D(uTransferFunction\"+this._styleID+\",vec2(value.r,0.5));\\n\";shaderText+=\"       }else{\\n\"\nshaderText+=\"         value.a = 0.0;\\n\";shaderText+=\"       }\\n\"}\nshaderText+=\"    }\\n\";return shaderText;}}));x3dom.registerNodeType(\"VolumeData\",\"VolumeRendering\",defineClass(x3dom.nodeTypes.X3DVolumeDataNode,function(ctx){x3dom.nodeTypes.VolumeData.superClass.call(this,ctx);this.addField_SFNode('renderStyle',x3dom.nodeTypes.X3DVolumeRenderStyleNode);this.vrcMultiTexture=new x3dom.nodeTypes.MultiTexture(ctx);this.vrcVolumeTexture=null;this.vrcSinglePassShader=new x3dom.nodeTypes.ComposedShader(ctx);this.vrcSinglePassShaderVertex=new x3dom.nodeTypes.ShaderPart(ctx);this.vrcSinglePassShaderFragment=new x3dom.nodeTypes.ShaderPart(ctx);this.vrcSinglePassShaderFieldBackCoord=new x3dom.nodeTypes.Field(ctx);this.vrcSinglePassShaderFieldVolData=new x3dom.nodeTypes.Field(ctx);this.vrcSinglePassShaderFieldOffset=new x3dom.nodeTypes.Field(ctx);this.vrcSinglePassShaderFieldDimensions=new x3dom.nodeTypes.Field(ctx);},{initializeValues:function(){var initialValues=\"\";if(this._cf.renderStyle.node.initializeValues!=undefined){initialValues+=this._cf.renderStyle.node.initializeValues();}\nreturn initialValues;},styleUniformsShaderText:function(){var styleUniformsText=this._cf.renderStyle.node.styleUniformsShaderText();this.surfaceNormalsNeeded=true;if(this._cf.renderStyle.node._cf.surfaceNormals&&this._cf.renderStyle.node._cf.surfaceNormals.node!=null){styleUniformsText+=\"uniform sampler2D uSurfaceNormals;\\n\";this.normalTextureProvided=true;this.surfaceNormals=this._cf.renderStyle.node._cf.surfaceNormals.node;}else if(x3dom.isa(this._cf.renderStyle.node,x3dom.nodeTypes.OpacityMapVolumeStyle)){this.surfaceNormalsNeeded=false;this.normalTextureProvided=false;}\nreturn styleUniformsText;},styleShaderText:function(){var styleText=\"\";if(this._cf.renderStyle.node.styleShaderText!=undefined){styleText+=this._cf.renderStyle.node.styleShaderText();}\nreturn styleText;},inlineStyleShaderText:function(){return this._cf.renderStyle.node.inlineStyleShaderText();},lightAssigment:function(){return this._cf.renderStyle.node.lightAssigment();},lightEquationShaderText:function(){return this._cf.renderStyle.node.lightEquationShaderText();},nodeChanged:function()\n{if(!this._cf.appearance.node)\n{var i;this.addChild(new x3dom.nodeTypes.Appearance());this.vrcVolumeTexture=this._cf.voxels.node;this.vrcVolumeTexture._vf.repeatS=false;this.vrcVolumeTexture._vf.repeatT=false;this.vrcMultiTexture._nameSpace=this._nameSpace;this.vrcMultiTexture.addChild(this.vrcVolumeTexture,'texture');this.vrcVolumeTexture.nodeChanged();if(this._cf.renderStyle.node.textures){var styleTextures=this._cf.renderStyle.node.textures();for(i=0;i<styleTextures.length;i++)\n{this.vrcMultiTexture.addChild(styleTextures[i],'texture');this.vrcVolumeTexture.nodeChanged();}}\nthis._cf.appearance.node.addChild(this.vrcMultiTexture);this.vrcMultiTexture.nodeChanged();this._cf.renderStyle.node.updateProperties(this);this.vrcSinglePassShaderVertex._vf.type='vertex';this.vrcSinglePassShaderVertex._vf.url[0]=this.vertexShaderText(x3dom.isa(this._cf.renderStyle.node,x3dom.nodeTypes.RadarVolumeStyle));this.vrcSinglePassShaderFragment._vf.type='fragment';var shaderText=\"\";if(x3dom.isa(this._cf.renderStyle.node,x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode)){shaderText+=this.fragmentPreamble+\nthis.defaultUniformsShaderText(this.vrcVolumeTexture._vf.numberOfSlices,this.vrcVolumeTexture._vf.slicesOverX,this.vrcVolumeTexture._vf.slicesOverY)+\nthis.styleUniformsShaderText()+\nthis.styleShaderText()+\nthis.texture3DFunctionShaderText+\nthis.normalFunctionShaderText()+\nthis.lightEquationShaderText()+\nthis.defaultLoopFragmentShaderText(this.inlineStyleShaderText(),this.lightAssigment(),this.initializeValues());}else{shaderText+=this._cf.renderStyle.node.fragmentShaderText(this.vrcVolumeTexture._vf.numberOfSlices,this.vrcVolumeTexture._vf.slicesOverX,this.vrcVolumeTexture._vf.slicesOverY);}\nthis.vrcSinglePassShaderFragment._vf.url[0]=shaderText;this.vrcSinglePassShader.addChild(this.vrcSinglePassShaderVertex,'parts');this.vrcSinglePassShaderVertex.nodeChanged();this.vrcSinglePassShader.addChild(this.vrcSinglePassShaderFragment,'parts');this.vrcSinglePassShaderFragment.nodeChanged();this.vrcSinglePassShaderFieldVolData._vf.name='uVolData';this.vrcSinglePassShaderFieldVolData._vf.type='SFInt32';this.vrcSinglePassShaderFieldVolData._vf.value=this._textureID++;this.vrcSinglePassShaderFieldDimensions._vf.name='dimensions';this.vrcSinglePassShaderFieldDimensions._vf.type='SFVec3f';this.vrcSinglePassShaderFieldDimensions._vf.value=this._vf.dimensions;this.vrcSinglePassShaderFieldOffset._vf.name='offset';this.vrcSinglePassShaderFieldOffset._vf.type='SFVec3f';this.vrcSinglePassShaderFieldOffset._vf.value=\"0.01 0.01 0.01\";this.vrcSinglePassShader.addChild(this.vrcSinglePassShaderFieldVolData,'fields');this.vrcSinglePassShaderFieldVolData.nodeChanged();this.vrcSinglePassShader.addChild(this.vrcSinglePassShaderFieldDimensions,'fields');this.vrcSinglePassShaderFieldDimensions.nodeChanged();this.vrcSinglePassShader.addChild(this.vrcSinglePassShaderFieldOffset,'fields');this.offsetInterval=window.setInterval((function(aTex,obj){return function(){x3dom.debug.logInfo('[VolumeRendering][VolumeData] Looking for Volume Texture size...');var s=obj.getTextureSize(aTex);if(s.valid){clearInterval(obj.offsetInterval);obj.vrcSinglePassShaderFieldOffset._vf.value=new x3dom.fields.SFVec3f(1.0/(s.w/aTex._vf.slicesOverX),1.0/(s.h/aTex._vf.slicesOverY),1.0/aTex._vf.numberOfSlices);obj.vrcSinglePassShader.nodeChanged();x3dom.debug.logInfo('[VolumeRendering][VolumeData] Volume Texture size obtained');}}})(this.vrcVolumeTexture,this),1000);var ShaderUniforms=this._cf.renderStyle.node.uniforms();for(i=0;i<ShaderUniforms.length;i++)\n{this.vrcSinglePassShader.addChild(ShaderUniforms[i],'fields');}\nthis._cf.appearance.node.addChild(this.vrcSinglePassShader);this.vrcSinglePassShader.nodeChanged();this._cf.appearance.node.nodeChanged();}\nif(!this._cf.geometry.node){this.addChild(new x3dom.nodeTypes.Box());this._cf.geometry.node._vf.solid=false;this._cf.geometry.node._vf.hasHelperColors=false;this._cf.geometry.node._vf.size=new x3dom.fields.SFVec3f(this._vf.dimensions.x,this._vf.dimensions.y,this._vf.dimensions.z);this._cf.geometry.node.fieldChanged(\"size\");}}}));x3dom.registerNodeType(\"IndexedQuadSet\",\"CADGeometry\",defineClass(x3dom.nodeTypes.X3DComposedGeometryNode,function(ctx){x3dom.nodeTypes.IndexedQuadSet.superClass.call(this,ctx);this.addField_MFInt32(ctx,'index',[]);},{nodeChanged:function()\n{var time0=new Date().getTime();this.handleAttribs();var colPerVert=this._vf.colorPerVertex;var normPerVert=this._vf.normalPerVertex;var indexes=this._vf.index;var hasNormal=false,hasTexCoord=false,hasColor=false;var positions,normals,texCoords,colors;var coordNode=this._cf.coord.node;x3dom.debug.assert(coordNode);positions=coordNode._vf.point;var normalNode=this._cf.normal.node;if(normalNode){hasNormal=true;normals=normalNode._vf.vector;}\nelse{hasNormal=false;}\nvar texMode=\"\",numTexComponents=2;var texCoordNode=this._cf.texCoord.node;if(x3dom.isa(texCoordNode,x3dom.nodeTypes.MultiTextureCoordinate)){if(texCoordNode._cf.texCoord.nodes.length)\ntexCoordNode=texCoordNode._cf.texCoord.nodes[0];}\nif(texCoordNode){if(texCoordNode._vf.point){hasTexCoord=true;texCoords=texCoordNode._vf.point;if(x3dom.isa(texCoordNode,x3dom.nodeTypes.TextureCoordinate3D)){numTexComponents=3;}}\nelse if(texCoordNode._vf.mode){texMode=texCoordNode._vf.mode;}}\nelse{hasTexCoord=false;}\nvar numColComponents=3;var colorNode=this._cf.color.node;if(colorNode){hasColor=true;colors=colorNode._vf.color;if(x3dom.isa(colorNode,x3dom.nodeTypes.ColorRGBA)){numColComponents=4;}}\nelse{hasColor=false;}\nthis._mesh._indices[0]=[];this._mesh._positions[0]=[];this._mesh._normals[0]=[];this._mesh._texCoords[0]=[];this._mesh._colors[0]=[];var i,t,cnt,faceCnt,posMax;var p0,p1,p2,n0,n1,n2,t0,t1,t2,c0,c1,c2;while(positions.length%4>0){positions.push(positions.length-1);}\nposMax=positions.length;{faceCnt=0;for(i=0;i<indexes.length;i++)\n{if((i>0)&&(i%4===3)){faceCnt++;this._mesh._indices[0].push(indexes[i-3]);this._mesh._indices[0].push(indexes[i-1]);this._mesh._indices[0].push(indexes[i]);}\nelse{this._mesh._indices[0].push(indexes[i]);}\nif(!normPerVert&&hasNormal){this._mesh._normals[0].push(normals[faceCnt].x);this._mesh._normals[0].push(normals[faceCnt].y);this._mesh._normals[0].push(normals[faceCnt].z);}\nif(!colPerVert&&hasColor){this._mesh._colors[0].push(colors[faceCnt].r);this._mesh._colors[0].push(colors[faceCnt].g);this._mesh._colors[0].push(colors[faceCnt].b);if(numColComponents===4){this._mesh._colors[0].push(colors[faceCnt].a);}}}\nthis._mesh._positions[0]=positions.toGL();if(hasNormal){this._mesh._normals[0]=normals.toGL();}\nelse{this._mesh.calcNormals(normPerVert?Math.PI:0);}\nif(hasTexCoord){this._mesh._texCoords[0]=texCoords.toGL();this._mesh._numTexComponents=numTexComponents;}\nelse{this._mesh.calcTexCoords(texMode);}\nif(hasColor&&colPerVert){this._mesh._colors[0]=colors.toGL();this._mesh._numColComponents=numColComponents;}}\nthis.invalidateVolume();this._mesh._numFaces=0;this._mesh._numCoords=0;for(i=0;i<this._mesh._indices.length;i++){this._mesh._numFaces+=this._mesh._indices[i].length/3;this._mesh._numCoords+=this._mesh._positions[i].length/3;}\nvar time1=new Date().getTime()-time0;},fieldChanged:function(fieldName)\n{var pnts=this._cf.coord.node._vf.point;if(pnts.length>x3dom.Utils.maxIndexableCoords)\n{x3dom.debug.logWarning(\"IndexedQuadSet: fieldChanged with \"+\"too many coordinates not yet implemented!\");return;}\nif(fieldName==\"coord\")\n{this._mesh._positions[0]=pnts.toGL();this.invalidateVolume();Array.forEach(this._parentNodes,function(node){node._dirty.positions=true;node.invalidateVolume();});}\nelse if(fieldName==\"color\")\n{pnts=this._cf.color.node._vf.color;if(this._vf.colorPerVertex){this._mesh._colors[0]=pnts.toGL();}else if(!this._vf.colorPerVertex){var faceCnt=0;var numColComponents=3;if(x3dom.isa(this._cf.color.node,x3dom.nodeTypes.ColorRGBA)){numColComponents=4;}\nthis._mesh._colors[0]=[];var i,indexes=this._vf.index;for(i=0;i<indexes.length;++i)\n{if((i>0)&&(i%3===0)){faceCnt++;}\nthis._mesh._colors[0].push(pnts[faceCnt].r);this._mesh._colors[0].push(pnts[faceCnt].g);this._mesh._colors[0].push(pnts[faceCnt].b);if(numColComponents===4){this._mesh._colors[0].push(pnts[faceCnt].a);}}}\nArray.forEach(this._parentNodes,function(node){node._dirty.colors=true;});}\nelse if(fieldName==\"normal\")\n{pnts=this._cf.normal.node._vf.vector;if(this._vf.normalPerVertex){this._mesh._normals[0]=pnts.toGL();}else if(!this._vf.normalPerVertex){var indexes=this._vf.index;this._mesh._normals[0]=[];var faceCnt=0;for(i=0;i<indexes.length;++i)\n{if((i>0)&&(i%3===0)){faceCnt++;}\nthis._mesh._normals[0].push(pnts[faceCnt].x);this._mesh._normals[0].push(pnts[faceCnt].y);this._mesh._normals[0].push(pnts[faceCnt].z);}}\nArray.forEach(this._parentNodes,function(node){node._dirty.normals=true;});}\nelse if(fieldName==\"texCoord\")\n{var texCoordNode=this._cf.texCoord.node;if(x3dom.isa(texCoordNode,x3dom.nodeTypes.MultiTextureCoordinate)){if(texCoordNode._cf.texCoord.nodes.length)\ntexCoordNode=texCoordNode._cf.texCoord.nodes[0];}\npnts=texCoordNode._vf.point;this._mesh._texCoords[0]=pnts.toGL();Array.forEach(this._parentNodes,function(node){node._dirty.texcoords=true;});}}}));x3dom.registerNodeType(\"QuadSet\",\"CADGeometry\",defineClass(x3dom.nodeTypes.X3DComposedGeometryNode,function(ctx){x3dom.nodeTypes.QuadSet.superClass.call(this,ctx);},{nodeChanged:function()\n{var time0=new Date().getTime();this.handleAttribs();var colPerVert=this._vf.colorPerVertex;var normPerVert=this._vf.normalPerVertex;var hasNormal=false,hasTexCoord=false,hasColor=false;var positions,normals,texCoords,colors;var coordNode=this._cf.coord.node;x3dom.debug.assert(coordNode);positions=coordNode._vf.point;var normalNode=this._cf.normal.node;if(normalNode){hasNormal=true;normals=normalNode._vf.vector;}\nelse{hasNormal=false;}\nvar texMode=\"\",numTexComponents=2;var texCoordNode=this._cf.texCoord.node;if(x3dom.isa(texCoordNode,x3dom.nodeTypes.MultiTextureCoordinate)){if(texCoordNode._cf.texCoord.nodes.length)\ntexCoordNode=texCoordNode._cf.texCoord.nodes[0];}\nif(texCoordNode){if(texCoordNode._vf.point){hasTexCoord=true;texCoords=texCoordNode._vf.point;if(x3dom.isa(texCoordNode,x3dom.nodeTypes.TextureCoordinate3D)){numTexComponents=3;}}\nelse if(texCoordNode._vf.mode){texMode=texCoordNode._vf.mode;}}\nelse{hasTexCoord=false;}\nvar numColComponents=3;var colorNode=this._cf.color.node;if(colorNode){hasColor=true;colors=colorNode._vf.color;if(x3dom.isa(colorNode,x3dom.nodeTypes.ColorRGBA)){numColComponents=4;}}\nelse{hasColor=false;}\nthis._mesh._indices[0]=[];this._mesh._positions[0]=[];this._mesh._normals[0]=[];this._mesh._texCoords[0]=[];this._mesh._colors[0]=[];var i,t,cnt,faceCnt,posMax;var p0,p1,p2,n0,n1,n2,t0,t1,t2,c0,c1,c2;while(positions.length%4>0){positions.push(positions.length-1);}\nposMax=positions.length;if(1)\n{faceCnt=0;for(i=0;i<positions.length;i++)\n{if((i>0)&&(i%4===3)){faceCnt++;this._mesh._indices[0].push(i-3);this._mesh._indices[0].push(i-1);this._mesh._indices[0].push(i);}\nelse{this._mesh._indices[0].push(i);}\nif(!normPerVert&&hasNormal){this._mesh._normals[0].push(normals[faceCnt].x);this._mesh._normals[0].push(normals[faceCnt].y);this._mesh._normals[0].push(normals[faceCnt].z);}\nif(!colPerVert&&hasColor){this._mesh._colors[0].push(colors[faceCnt].r);this._mesh._colors[0].push(colors[faceCnt].g);this._mesh._colors[0].push(colors[faceCnt].b);if(numColComponents===4){this._mesh._colors[0].push(colors[faceCnt].a);}}}\nthis._mesh._positions[0]=positions.toGL();if(hasNormal){this._mesh._normals[0]=normals.toGL();}\nelse{this._mesh.calcNormals(normPerVert?Math.PI:0);}\nif(hasTexCoord){this._mesh._texCoords[0]=texCoords.toGL();this._mesh._numTexComponents=numTexComponents;}\nelse{this._mesh.calcTexCoords(texMode);}\nif(hasColor&&colPerVert){this._mesh._colors[0]=colors.toGL();this._mesh._numColComponents=numColComponents;}}\nthis.invalidateVolume();this._mesh._numFaces=0;this._mesh._numCoords=0;for(i=0;i<this._mesh._indices.length;i++){this._mesh._numFaces+=this._mesh._indices[i].length/3;this._mesh._numCoords+=this._mesh._positions[i].length/3;}\nvar time1=new Date().getTime()-time0;},fieldChanged:function(fieldName)\n{var pnts=this._cf.coord.node._vf.point;if(pnts.length>x3dom.Utils.maxIndexableCoords)\n{x3dom.debug.logWarning(\"QuadSet: fieldChanged with \"+\"too many coordinates not yet implemented!\");return;}\nif(fieldName==\"coord\")\n{this._mesh._positions[0]=pnts.toGL();this.invalidateVolume();Array.forEach(this._parentNodes,function(node){node._dirty.positions=true;node.invalidateVolume();});}\nelse if(fieldName==\"color\")\n{pnts=this._cf.color.node._vf.color;if(this._vf.colorPerVertex){this._mesh._colors[0]=pnts.toGL();}else if(!this._vf.colorPerVertex){var faceCnt=0;var numColComponents=3;if(x3dom.isa(this._cf.color.node,x3dom.nodeTypes.ColorRGBA)){numColComponents=4;}\nthis._mesh._colors[0]=[];var i,indexes=this._vf.index;for(i=0;i<indexes.length;++i)\n{if((i>0)&&(i%3===0)){faceCnt++;}\nthis._mesh._colors[0].push(pnts[faceCnt].r);this._mesh._colors[0].push(pnts[faceCnt].g);this._mesh._colors[0].push(pnts[faceCnt].b);if(numColComponents===4){this._mesh._colors[0].push(pnts[faceCnt].a);}}}\nArray.forEach(this._parentNodes,function(node){node._dirty.colors=true;});}\nelse if(fieldName==\"normal\")\n{pnts=this._cf.normal.node._vf.vector;if(this._vf.normalPerVertex){this._mesh._normals[0]=pnts.toGL();}else if(!this._vf.normalPerVertex){var indexes=this._vf.index;this._mesh._normals[0]=[];var faceCnt=0;for(i=0;i<indexes.length;++i)\n{if((i>0)&&(i%3===0)){faceCnt++;}\nthis._mesh._normals[0].push(pnts[faceCnt].x);this._mesh._normals[0].push(pnts[faceCnt].y);this._mesh._normals[0].push(pnts[faceCnt].z);}}\nArray.forEach(this._parentNodes,function(node){node._dirty.normals=true;});}\nelse if(fieldName==\"texCoord\")\n{var texCoordNode=this._cf.texCoord.node;if(x3dom.isa(texCoordNode,x3dom.nodeTypes.MultiTextureCoordinate)){if(texCoordNode._cf.texCoord.nodes.length)\ntexCoordNode=texCoordNode._cf.texCoord.nodes[0];}\npnts=texCoordNode._vf.point;this._mesh._texCoords[0]=pnts.toGL();Array.forEach(this._parentNodes,function(node){node._dirty.texcoords=true;});}}}));x3dom.registerNodeType(\"CADLayer\",\"CADGeometry\",defineClass(x3dom.nodeTypes.X3DGroupingNode,function(ctx){x3dom.nodeTypes.CADLayer.superClass.call(this,ctx);this.addField_SFString(ctx,'name',\"\");}));x3dom.registerNodeType(\"CADAssembly\",\"CADGeometry\",defineClass(x3dom.nodeTypes.X3DGroupingNode,function(ctx){x3dom.nodeTypes.CADAssembly.superClass.call(this,ctx);this.addField_SFString(ctx,'name',\"\");}));x3dom.registerNodeType(\"CADPart\",\"CADGeometry\",defineClass(x3dom.nodeTypes.Transform,function(ctx){x3dom.nodeTypes.CADPart.superClass.call(this,ctx);this.addField_SFString(ctx,'name',\"\");}));x3dom.registerNodeType(\"CADFace\",\"CADGeometry\",defineClass(x3dom.nodeTypes.X3DGroupingNode,function(ctx){x3dom.nodeTypes.CADFace.superClass.call(this,ctx);this.addField_SFString(ctx,'name',\"\");this.addField_SFNode('shape',x3dom.nodeTypes.X3DShapeNode);},{getVolume:function()\n{var vol=this._graph.volume;if(!this.volumeValid()&&this._vf.render)\n{var child=this._cf.shape.node;var childVol=(child&&child._vf.render===true)?child.getVolume():null;if(childVol&&childVol.isValid())\nvol.extendBounds(childVol.min,childVol.max);}\nreturn vol;},collectDrawableObjects:function(transform,drawableCollection,singlePath,invalidateCache,planeMask,clipPlanes)\n{if(singlePath&&(this._parentNodes.length>1))\nsinglePath=false;if(singlePath&&(invalidateCache=invalidateCache||this.cacheInvalid()))\nthis.invalidateCache();if(!this._cf.shape.node||(planeMask=drawableCollection.cull(transform,this.graphState(),singlePath,planeMask))<0){return;}\nvar cnode,childTransform;if(singlePath){if(!this._graph.globalMatrix){this._graph.globalMatrix=this.transformMatrix(transform);}\nchildTransform=this._graph.globalMatrix;}\nelse{childTransform=this.transformMatrix(transform);}\nif((cnode=this._cf.shape.node)){cnode.collectDrawableObjects(childTransform,drawableCollection,singlePath,invalidateCache,planeMask,clipPlanes);}}}));x3dom.registerNodeType(\"Patch\",\"BVHRefiner\",defineClass(x3dom.nodeTypes.X3DSpatialGeometryNode,function(ctx){x3dom.nodeTypes.Patch.superClass.call(this,ctx);this.addField_SFVec2f(ctx,'size',2,2);this.addField_SFVec2f(ctx,'subdivision',1,1);this.addField_SFVec3f(ctx,'center',0,0,0);this.addField_MFString(ctx,'primType',['TRIANGLES']);var sx=this._vf.size.x,sy=this._vf.size.y;var subx=this._vf.subdivision.x,suby=this._vf.subdivision.y;this._indexBufferTriangulationParts=[];var x=0,y=0;var xstep=sx/subx/2;var ystep=sy/suby/2;sx/=2;sy/=2;var countX=subx*2+1;var countY=suby*2+1;for(y=0;y<=suby*2;y++){for(x=0;x<=subx*2;x++){this._mesh._positions[0].push(this._vf.center.x+x*xstep-sx);this._mesh._positions[0].push(this._vf.center.y+y*ystep-sy);this._mesh._positions[0].push(this._vf.center.z);this._mesh._normals[0].push(0);this._mesh._normals[0].push(0);this._mesh._normals[0].push(1);this._mesh._texCoords[0].push(x/(subx*2));this._mesh._texCoords[0].push(y/(suby*2));}}\nfor(y=0;y<countY-2;y+=2){for(x=0;x<countX-2;x+=2){this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x)+y*countX);this._mesh._indices[0].push((x)+y*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);}}\nthis._indexBufferTriangulationParts.push({offset:0,count:subx*suby*6});for(y=0;y<countY-2;y+=2){for(x=0;x<2;x+=2){this._mesh._indices[0].push((x)+y*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x)+(y+1)*countX);this._mesh._indices[0].push((x)+(y+1)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x)+y*countX);}}\nfor(y=0;y<countY-2;y+=2){for(x=2;x<countX-2;x+=2){this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x)+y*countX);this._mesh._indices[0].push((x)+y*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);}}\nthis._indexBufferTriangulationParts.push({offset:this._indexBufferTriangulationParts[this._indexBufferTriangulationParts.length-1].offset+\nthis._indexBufferTriangulationParts[this._indexBufferTriangulationParts.length-1].count*2,count:subx*suby*6+suby*9});for(y=0;y<countY-2;y+=2){for(x=countX-3;x<countX-2;x+=2){this._mesh._indices[0].push((x)+y*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+2)+(y+1)*countX);this._mesh._indices[0].push((x+2)+(y+1)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x)+y*countX);}}\nfor(y=0;y<countY-2;y+=2){for(x=0;x<countX-4;x+=2){this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x)+y*countX);this._mesh._indices[0].push((x)+y*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);}}\nthis._indexBufferTriangulationParts.push({offset:this._indexBufferTriangulationParts[this._indexBufferTriangulationParts.length-1].offset+\nthis._indexBufferTriangulationParts[this._indexBufferTriangulationParts.length-1].count*2,count:subx*suby*6+suby*9});for(y=2;y<countY-2;y+=2){for(x=0;x<countX-2;x+=2){this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x)+y*countX);this._mesh._indices[0].push((x)+y*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);}}\nfor(y=0;y<2;y+=2){for(x=0;x<countX-2;x+=2){this._mesh._indices[0].push((x)+y*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+1)+y*countX);this._mesh._indices[0].push((x+1)+y*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x)+y*countX);}}\nthis._indexBufferTriangulationParts.push({offset:this._indexBufferTriangulationParts[this._indexBufferTriangulationParts.length-1].offset+\nthis._indexBufferTriangulationParts[this._indexBufferTriangulationParts.length-1].count*2,count:subx*suby*6+subx*9});for(y=countY-3;y<countY-2;y+=2){for(x=0;x<countX-2;x+=2){this._mesh._indices[0].push((x)+y*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+1)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x)+y*countX);}}\nfor(y=0;y<countY-4;y+=2){for(x=0;x<countX-2;x+=2){this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x)+y*countX);this._mesh._indices[0].push((x)+y*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);}}\nthis._indexBufferTriangulationParts.push({offset:this._indexBufferTriangulationParts[this._indexBufferTriangulationParts.length-1].offset+\nthis._indexBufferTriangulationParts[this._indexBufferTriangulationParts.length-1].count*2,count:subx*suby*6+subx*9});for(y=countY-3;y<countY-2;y+=2){for(x=countX-3;x<countX-2;x+=2){this._mesh._indices[0].push((x)+y*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+1)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+2)+(y+1)*countX);this._mesh._indices[0].push((x+2)+(y+1)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x)+y*countX);}}\nfor(y=0;y<countY-4;y+=2){for(x=0;x<countX-4;x+=2){this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x)+y*countX);this._mesh._indices[0].push((x)+y*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);}}\nfor(y=0;y<countY-4;y+=2){for(x=countX-3;x<countX-2;x+=2){this._mesh._indices[0].push((x)+y*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+2)+(y+1)*countX);this._mesh._indices[0].push((x+2)+(y+1)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x)+y*countX);}}\nfor(y=countY-3;y<countY-2;y+=2){for(x=0;x<countX-4;x+=2){this._mesh._indices[0].push((x)+y*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+1)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x)+y*countX);}}\nthis._indexBufferTriangulationParts.push({offset:this._indexBufferTriangulationParts[this._indexBufferTriangulationParts.length-1].offset+\nthis._indexBufferTriangulationParts[this._indexBufferTriangulationParts.length-1].count*2,count:subx*suby*6+subx*9+(suby-1)*9+3});for(y=countY-3;y<countY-2;y+=2){for(x=0;x<2;x+=2){this._mesh._indices[0].push((x)+y*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x)+(y+1)*countX);this._mesh._indices[0].push((x)+(y+1)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+1)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x)+y*countX);}}\nfor(y=0;y<countY-4;y+=2){for(x=2;x<countX-2;x+=2){this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x)+y*countX);this._mesh._indices[0].push((x)+y*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);}}\nfor(y=countY-3;y<countY-2;y+=2){for(x=2;x<countX-2;x+=2){this._mesh._indices[0].push((x)+y*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+1)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x)+y*countX);}}\nfor(y=0;y<countY-4;y+=2){for(x=0;x<2;x+=2){this._mesh._indices[0].push((x)+y*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x)+(y+1)*countX);this._mesh._indices[0].push((x)+(y+1)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x)+y*countX);}}\nthis._indexBufferTriangulationParts.push({offset:this._indexBufferTriangulationParts[this._indexBufferTriangulationParts.length-1].offset+\nthis._indexBufferTriangulationParts[this._indexBufferTriangulationParts.length-1].count*2,count:subx*suby*6+subx*9+(suby-1)*9+3});for(y=0;y<2;y+=2){for(x=0;x<2;x+=2){this._mesh._indices[0].push((x)+y*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x)+(y+1)*countX);this._mesh._indices[0].push((x)+(y+1)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+1)+y*countX);this._mesh._indices[0].push((x+1)+y*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x)+y*countX);}}\nfor(y=2;y<countY-2;y+=2){for(x=2;x<countX-2;x+=2){this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x)+y*countX);this._mesh._indices[0].push((x)+y*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);}}\nfor(y=2;y<countY-2;y+=2){for(x=0;x<2;x+=2){this._mesh._indices[0].push((x)+y*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x)+(y+1)*countX);this._mesh._indices[0].push((x)+(y+1)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x)+y*countX);}}\nfor(y=0;y<2;y+=2){for(x=2;x<countX-2;x+=2){this._mesh._indices[0].push((x)+y*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+1)+y*countX);this._mesh._indices[0].push((x+1)+y*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x)+y*countX);}}\nthis._indexBufferTriangulationParts.push({offset:this._indexBufferTriangulationParts[this._indexBufferTriangulationParts.length-1].offset+\nthis._indexBufferTriangulationParts[this._indexBufferTriangulationParts.length-1].count*2,count:subx*suby*6+subx*9+(suby-1)*9+3});for(y=0;y<2;y+=2){for(x=countX-3;x<countX-2;x+=2){this._mesh._indices[0].push((x)+y*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+2)+(y+1)*countX);this._mesh._indices[0].push((x+2)+(y+1)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+1)+y*countX);this._mesh._indices[0].push((x+1)+y*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x)+y*countX);}}\nfor(y=2;y<countY-2;y+=2){for(x=0;x<countX-4;x+=2){this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x)+y*countX);this._mesh._indices[0].push((x)+y*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);}}\nfor(y=2;y<countY-2;y+=2){for(x=countX-3;x<countX-2;x+=2){this._mesh._indices[0].push((x)+y*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+2)+(y+1)*countX);this._mesh._indices[0].push((x+2)+(y+1)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x)+y*countX);}}\nfor(y=0;y<2;y+=2){for(x=0;x<countX-4;x+=2){this._mesh._indices[0].push((x)+y*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x+2)+(y+2)*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+2)+y*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x+1)+y*countX);this._mesh._indices[0].push((x+1)+y*countX);this._mesh._indices[0].push((x+1)+(y+1)*countX);this._mesh._indices[0].push((x)+y*countX);}}\nthis._indexBufferTriangulationParts.push({offset:this._indexBufferTriangulationParts[this._indexBufferTriangulationParts.length-1].offset+\nthis._indexBufferTriangulationParts[this._indexBufferTriangulationParts.length-1].count*2,count:subx*suby*6+subx*9+(suby-1)*9+3});this._mesh._invalidate=true;this._mesh._numFaces=this._mesh._indices[0].length/3;this._mesh._numCoords=this._mesh._positions[0].length/3;},{hasIndexOffset:function(){return true;},getTriangulationAttributes:function(triangulationIndex){return this._indexBufferTriangulationParts[triangulationIndex];}}));x3dom.registerNodeType(\"BVHRefiner\",\"BVHRefiner\",defineClass(x3dom.nodeTypes.X3DLODNode,function(ctx){x3dom.nodeTypes.BVHRefiner.superClass.call(this,ctx);this.addField_SFFloat(ctx,'factor',1.0);this.addField_SFInt32(ctx,'maxDepth',3);this.addField_SFInt32(ctx,'minDepth',0);this.addField_SFInt32(ctx,'smoothLoading',1);this.addField_SFInt32(ctx,'interactionDepth',this._vf.maxDepth);this.addField_SFVec2f(ctx,'size',1,1);this.addField_SFVec3f(ctx,'octSize',1,1,1);this.addField_SFVec2f(ctx,'subdivision',1,1);this.addField_SFString(ctx,'url',\"\");this.addField_SFString(ctx,'elevationUrl',\"\");this.addField_SFString(ctx,'textureUrl',\"\");this.addField_SFString(ctx,'normalUrl',\"\");this.addField_SFString(ctx,'mode',\"3d\");this.addField_SFString(ctx,'subMode',\"wmts\");this.addField_SFString(ctx,'elevationFormat',\"png\");this.addField_SFString(ctx,'textureFormat',\"png\");this.addField_SFString(ctx,'normalFormat',\"png\");this.addField_SFFloat(ctx,'maxElevation',1.0);this.addField_SFBool(ctx,'useNormals',true);this.addField_SFBool(ctx,'lit',true);this.addField_SFInt32(ctx,'bvhCount',8);this.creationSmooth=0;this.togglePoints=true;this.nodeProducer=new NodeProducer();var nodeListSize=0;for(var x=0;x<=this._vf.maxDepth;x++){nodeListSize+=Math.pow(4,x);}\nthis.nodeList=new Array(nodeListSize);if(this._vf.mode===\"bin\"){this.rootNode=new QuadtreeNodeBin(ctx,this,0,0,0,null);}\nelse if(this._vf.mode===\"3d\"||this._vf.mode===\"2d\"){var geometry=new x3dom.nodeTypes.Plane(ctx);geometry._vf.subdivision.setValues(this._vf.subdivision);geometry.fieldChanged(\"subdivision\");geometry._vf.size.setValues(this._vf.size);if(this._vf.mode===\"2d\"){if(this._vf.subMode===\"wmts\"){this.rootNode=new QuadtreeNode2dWMTS(ctx,this,0,0,x3dom.fields.SFMatrix4f.identity(),0,0,geometry);}\nelse{this.rootNode=new QuadtreeNode2D(ctx,this,0,0,x3dom.fields.SFMatrix4f.identity(),0,0,geometry,\"/\",1);}}\nelse{if(this._vf.subMode===\"32bit\"){this.rootNode=new QuadtreeNode3D_32bit(ctx,this,0,0,x3dom.fields.SFMatrix4f.identity(),0,0,geometry);}\nelse{geometry=new x3dom.nodeTypes.Patch(ctx);this.rootNode=new QuadtreeNode3D(ctx,this,0,0,x3dom.fields.SFMatrix4f.identity(),0,0,geometry);}}}\nelse if(this._vf.mode===\"bvh\"){this.rootNode=new BVHNode(ctx,this,0,\"/\",1,this._vf.bvhCount);}\nelse{x3dom.debug.logError(\"Error attribute mode. Value: '\"+this._vf.mode+\"' isn't conform. Please use type 'bin', '2d' or '3d'\");}},{visitChildren:function(transform,drawableCollection,singlePath,invalidateCache,planeMask){var x3dElement=this._nameSpace.doc._x3dElem;if(this._vf.mode===\"oct\"){if(x3dElement.runtime.isReady&&this.togglePoints){x3dElement.runtime.togglePoints();this.togglePoints=false;this.view=drawableCollection.viewarea;}\nthis.creationSmooth++;singlePath=false;invalidateCache=true;this.rootNode.collectDrawables(transform,drawableCollection,singlePath,invalidateCache,planeMask);if(!this.view.isMovingOrAnimating()&&((this.creationSmooth%this._vf.smoothLoading)===0)){this.nodeProducer.CreateNewNode();}}\nelse{if(x3dElement.runtime.isReady&&this.togglePoints){this.view=x3dElement.runtime.canvas.doc._viewarea;this.togglePoints=false;}\nthis.createChildren=0;this.creationSmooth++;singlePath=false;invalidateCache=true;this.rootNode.collectDrawables(transform,drawableCollection,singlePath,invalidateCache,planeMask);if(!this.view.isMovingOrAnimating()&&((this.creationSmooth%this._vf.smoothLoading)===0)){this.nodeProducer.CreateNewNode();}}},getVolume:function()\n{var vol=this._graph.volume;if(!this.volumeValid()&&this._vf.render)\n{var childVol=this.rootNode.getVolume();if(childVol&&childVol.isValid())\nvol.extendBounds(childVol.min,childVol.max);}\nreturn vol;}}));function NodeProducer()\n{var nextNode=null;var nearestDistance=1000000;var smallestDepth=1000000;this.AddNewNode=function(node,distance){if(node.Level()<smallestDepth){smallestDepth=node.Level();nextNode=node;}\nif(node.Level()===smallestDepth){if(distance<nearestDistance){distance=nearestDistance;nextNode=node;}}};this.CreateNewNode=function(){if(nextNode!==null){nextNode.CreateChildren();}\nnextNode=null;smallestDepth=1000;};}\nfunction QuadtreeNode2dWMTS(ctx,bvhRefiner,level,nodeNumber,nodeTransformation,columnNr,rowNr,geometry)\n{var children=[];var shape=new x3dom.nodeTypes.Shape();var position=null;var readyState=false;var childrenReadyState=false;var url=bvhRefiner._vf.textureUrl+\"/\"+level+\"/\"+columnNr+\"/\"+rowNr+\".\"+(bvhRefiner._vf.textureFormat).toLowerCase();var resizeFac=(bvhRefiner._vf.size.x+bvhRefiner._vf.size.y)/2.0;var cullObject={};function initialize(){var appearance=new x3dom.nodeTypes.Appearance(ctx);var texture=new x3dom.nodeTypes.ImageTexture(ctx);shape._nameSpace=bvhRefiner._nameSpace;var texProp=new x3dom.nodeTypes.TextureProperties(ctx);texProp._vf.boundaryModeS=\"CLAMP_TO_EDGE\";texProp._vf.boundaryModeT=\"CLAMP_TO_EDGE\";texProp._vf.boundaryModeR=\"CLAMP_TO_EDGE\";texProp._vf.minificationFilter=\"LINEAR\";texProp._vf.magnificationFilter=\"LINEAR\";texture.addChild(texProp,\"textureProperties\");texture.nodeChanged();texture._nameSpace=bvhRefiner._nameSpace;texture._vf.url[0]=url;position=nodeTransformation.e3();appearance.addChild(texture);texture.nodeChanged();shape.addChild(appearance);appearance.nodeChanged();shape.addChild(geometry);geometry.nodeChanged();bvhRefiner.addChild(shape);shape.nodeChanged();cullObject.boundedNode=shape;cullObject.volume=shape.getVolume();}\nthis.CreateChildren=function(){create();};function create(){var deltaR=Math.sqrt(Math.pow(4,level));var deltaR1=Math.sqrt(Math.pow(4,level+1));var lt=Math.floor(nodeNumber/deltaR)*4*deltaR+\n(nodeNumber%deltaR)*2;var rt=lt+1;var lb=lt+deltaR1;var rb=lb+1;var s=(bvhRefiner._vf.size).multiply(0.25);children.push(new QuadtreeNode2dWMTS(ctx,bvhRefiner,(level+1),lt,nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(new x3dom.fields.SFVec3f(-s.x,s.y,0.0))).mult(x3dom.fields.SFMatrix4f.scale(new x3dom.fields.SFVec3f(0.5,0.5,1.0))),(columnNr*2),(rowNr*2),geometry));children.push(new QuadtreeNode2dWMTS(ctx,bvhRefiner,(level+1),rt,nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(new x3dom.fields.SFVec3f(s.x,s.y,0.0))).mult(x3dom.fields.SFMatrix4f.scale(new x3dom.fields.SFVec3f(0.5,0.5,1.0))),(columnNr*2+1),(rowNr*2),geometry));children.push(new QuadtreeNode2dWMTS(ctx,bvhRefiner,(level+1),lb,nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(new x3dom.fields.SFVec3f(-s.x,-s.y,0.0))).mult(x3dom.fields.SFMatrix4f.scale(new x3dom.fields.SFVec3f(0.5,0.5,1.0))),(columnNr*2),(rowNr*2+1),geometry));children.push(new QuadtreeNode2dWMTS(ctx,bvhRefiner,(level+1),rb,nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(new x3dom.fields.SFVec3f(s.x,-s.y,0.0))).mult(x3dom.fields.SFMatrix4f.scale(new x3dom.fields.SFVec3f(0.5,0.5,1.0))),(columnNr*2+1),(rowNr*2+1),geometry));}\nthis.Shape=function(){return shape;};this.Ready=function(){if(shape._webgl!==undefined&&shape._webgl.texture!==undefined){return ready();}\nreturn false;};function ready(){readyState=true;for(var i=0;i<shape._webgl.texture.length;i++){if(!shape._webgl.texture[i].texture.ready){readyState=false;}}\nreturn readyState;}\nfunction updateLoadingState(drawableCollection,transform){childrenReadyState=true;for(var i=0;i<children.length;i++){if(!children[i].Ready()){childrenReadyState=false;}}\nif(children.length<4){childrenReadyState=false;}\nelse if(childrenReadyState){for(var i=0;i<children.length;i++){children[i].Shape()._vf.render=true;}}\nif(shape._webgl===undefined||shape._webgl.texture===undefined){drawableCollection.context.setupShape(drawableCollection.gl,{shape:shape,transform:transform},drawableCollection.viewarea);}\nelse{ready();}}\nthis.collectDrawables=function(transform,drawableCollection,singlePath,invalidateCache,planeMask){cullObject.localMatrix=nodeTransformation;planeMask=drawableCollection.cull(nodeTransformation,cullObject,singlePath,planeMask);if(!readyState||!childrenReadyState)\nupdateLoadingState(drawableCollection,nodeTransformation);if(readyState&&planeMask>=0){var mat_view=drawableCollection.viewMatrix;var vPos=mat_view.multMatrixPnt(nodeTransformation.multMatrixPnt(position));var distanceToCamera=Math.sqrt(Math.pow(vPos.x,2)+Math.pow(vPos.y,2)+Math.pow(vPos.z,2));if((distanceToCamera<Math.pow((bvhRefiner._vf.maxDepth-level),2)*resizeFac/bvhRefiner._vf.factor)||level<bvhRefiner._vf.minDepth){if(bvhRefiner.view.isMovingOrAnimating()&&children.length===0||bvhRefiner.view.isMovingOrAnimating()&&level>=bvhRefiner._vf.interactionDepth){shape.collectDrawableObjects(nodeTransformation,drawableCollection,singlePath,invalidateCache,planeMask,[]);}\nelse{if(children.length===0){bvhRefiner.nodeProducer.AddNewNode(that,distanceToCamera);shape.collectDrawableObjects(nodeTransformation,drawableCollection,singlePath,invalidateCache,planeMask,[]);}\nelse{if(childrenReadyState){for(var i=0;i<children.length;i++){children[i].collectDrawables(nodeTransformation,drawableCollection,singlePath,invalidateCache,planeMask);}}\nelse{shape.collectDrawableObjects(nodeTransformation,drawableCollection,singlePath,invalidateCache,planeMask,[]);for(var i=0;i<children.length;i++){children[i].collectDrawables(nodeTransformation,drawableCollection,singlePath,invalidateCache,planeMask);children[i].Shape()._vf.render=false;}}}}}\nelse{shape.collectDrawableObjects(nodeTransformation,drawableCollection,singlePath,invalidateCache,planeMask,[]);}}};this.getVolume=function(){return shape.getVolume();};this.Level=function(){return level;};var that=this;initialize();}\nfunction QuadtreeNode2D(ctx,bvhRefiner,level,nodeNumber,nodeTransformation,columnNr,rowNr,geometry,path,imgNumber)\n{var children=[];var shape=new x3dom.nodeTypes.Shape();var position=null;var readyState=false;var childrenReadyState=false;var exists=true;var url=bvhRefiner._vf.textureUrl+path+imgNumber+\".\"+bvhRefiner._vf.textureFormat;var resizeFac=(bvhRefiner._vf.size.x+bvhRefiner._vf.size.y)/2.0;var cullObject={};function initialize(){var appearance=new x3dom.nodeTypes.Appearance(ctx);var texture=new x3dom.nodeTypes.ImageTexture(ctx);shape._nameSpace=bvhRefiner._nameSpace;var texProp=new x3dom.nodeTypes.TextureProperties(ctx);texProp._vf.boundaryModeS=\"CLAMP_TO_EDGE\";texProp._vf.boundaryModeT=\"CLAMP_TO_EDGE\";texProp._vf.boundaryModeR=\"CLAMP_TO_EDGE\";texProp._vf.minificationFilter=\"LINEAR\";texProp._vf.magnificationFilter=\"LINEAR\";texture.addChild(texProp,\"textureProperties\");texture.nodeChanged();texture._nameSpace=bvhRefiner._nameSpace;texture._vf.url[0]=url;position=nodeTransformation.e3();appearance.addChild(texture);texture.nodeChanged();shape.addChild(appearance);appearance.nodeChanged();shape.addChild(geometry);geometry.nodeChanged();bvhRefiner.addChild(shape);shape.nodeChanged();cullObject.boundedNode=shape;cullObject.volume=shape.getVolume();}\nthis.CreateChildren=function(){create();};function create(){var deltaR=Math.sqrt(Math.pow(4,level));var deltaR1=Math.sqrt(Math.pow(4,level+1));var lt=Math.floor(nodeNumber/deltaR)*4*deltaR+\n(nodeNumber%deltaR)*2;var rt=lt+1;var lb=lt+deltaR1;var rb=lb+1;var s=(bvhRefiner._vf.size).multiply(0.25);children.push(new QuadtreeNode2D(ctx,bvhRefiner,(level+1),lt,nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(new x3dom.fields.SFVec3f(-s.x,s.y,0.0))).mult(x3dom.fields.SFMatrix4f.scale(new x3dom.fields.SFVec3f(0.5,0.5,1.0))),(columnNr*2),(rowNr*2),geometry,path+imgNumber+\"/\",1));children.push(new QuadtreeNode2D(ctx,bvhRefiner,(level+1),rt,nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(new x3dom.fields.SFVec3f(s.x,s.y,0.0))).mult(x3dom.fields.SFMatrix4f.scale(new x3dom.fields.SFVec3f(0.5,0.5,1.0))),(columnNr*2+1),(rowNr*2),geometry,path+imgNumber+\"/\",3));children.push(new QuadtreeNode2D(ctx,bvhRefiner,(level+1),lb,nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(new x3dom.fields.SFVec3f(-s.x,-s.y,0.0))).mult(x3dom.fields.SFMatrix4f.scale(new x3dom.fields.SFVec3f(0.5,0.5,1.0))),(columnNr*2),(rowNr*2+1),geometry,path+imgNumber+\"/\",2));children.push(new QuadtreeNode2D(ctx,bvhRefiner,(level+1),rb,nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(new x3dom.fields.SFVec3f(s.x,-s.y,0.0))).mult(x3dom.fields.SFMatrix4f.scale(new x3dom.fields.SFVec3f(0.5,0.5,1.0))),(columnNr*2+1),(rowNr*2+1),geometry,path+imgNumber+\"/\",4));}\nthis.Shape=function(){return shape;};this.Ready=function(){if(shape._webgl!==undefined&&shape._webgl.texture!==undefined){return ready();}\nreturn false;};function ready(){readyState=true;for(var i=0;i<shape._webgl.texture.length;i++){if(!shape._webgl.texture[i].texture.ready){readyState=false;}}\nreturn readyState;}\nfunction updateLoadingState(drawableCollection,transform){childrenReadyState=true;for(var i=0;i<children.length;i++){if(!children[i].Ready()){childrenReadyState=false;}}\nif(children.length<4){childrenReadyState=false;}\nelse if(childrenReadyState){for(var i=0;i<children.length;i++){children[i].Shape()._vf.render=true;}}\nif(shape._webgl===undefined||shape._webgl.texture===undefined){drawableCollection.context.setupShape(drawableCollection.gl,{shape:shape,transform:transform},drawableCollection.viewarea);}\nelse{ready();}}\nthis.collectDrawables=function(transform,drawableCollection,singlePath,invalidateCache,planeMask){cullObject.localMatrix=nodeTransformation;if(!readyState||!childrenReadyState){updateLoadingState(drawableCollection,nodeTransformation);}\nif(readyState&&(planeMask=drawableCollection.cull(nodeTransformation,cullObject,singlePath,planeMask))>0){var mat_view=drawableCollection.viewMatrix;var vPos=mat_view.multMatrixPnt(nodeTransformation.multMatrixPnt(position));var distanceToCamera=Math.sqrt(Math.pow(vPos.x,2)+Math.pow(vPos.y,2)+Math.pow(vPos.z,2));if((distanceToCamera<Math.pow((bvhRefiner._vf.maxDepth-level),2)*resizeFac/bvhRefiner._vf.factor)||level<bvhRefiner._vf.minDepth){if(bvhRefiner.view.isMovingOrAnimating()&&children.length===0||bvhRefiner.view.isMovingOrAnimating()&&level>=bvhRefiner._vf.interactionDepth){shape.collectDrawableObjects(nodeTransformation,drawableCollection,singlePath,invalidateCache,planeMask,[]);}\nelse{if(children.length===0){bvhRefiner.nodeProducer.AddNewNode(that,distanceToCamera);shape.collectDrawableObjects(nodeTransformation,drawableCollection,singlePath,invalidateCache,planeMask,[]);}\nelse{if(childrenReadyState){for(var i=0;i<children.length;i++){children[i].collectDrawables(nodeTransformation,drawableCollection,singlePath,invalidateCache,planeMask);}}\nelse{shape.collectDrawableObjects(nodeTransformation,drawableCollection,singlePath,invalidateCache,planeMask,[]);for(var i=0;i<children.length;i++){children[i].collectDrawables(nodeTransformation,drawableCollection,singlePath,invalidateCache,planeMask);children[i].Shape()._vf.render=false;}}}}}\nelse{shape.collectDrawableObjects(nodeTransformation,drawableCollection,singlePath,invalidateCache,planeMask,[]);}}};this.getVolume=function(){return shape.getVolume();};this.Level=function(){return level;};var that=this;initialize();}\nfunction QuadtreeNode3D(ctx,bvhRefiner,level,nodeNumber,nodeTransformation,columnNr,rowNr,geometry)\n{var children=[];var neighbors=[];var shape=new x3dom.nodeTypes.Shape();var position=null;var imageAddressColor=bvhRefiner._vf.textureUrl+\"/\"+level+\"/\"+\ncolumnNr+\"/\"+rowNr+\".\"+\n(bvhRefiner._vf.textureFormat).toLowerCase();var imageAddressHeight=bvhRefiner._vf.elevationUrl+\"/\"+level+\"/\"+\ncolumnNr+\"/\"+rowNr+\".\"+\n(bvhRefiner._vf.elevationFormat).toLowerCase();if(bvhRefiner._vf.normalUrl!==\"\")\nvar imageAddressNormal=bvhRefiner._vf.normalUrl+\"/\"+level+\"/\"+\ncolumnNr+\"/\"+rowNr+\".\"+\n(bvhRefiner._vf.normalFormat).toLowerCase();var readyState=false;var childrenReadyState=false;var resizeFac=(bvhRefiner._vf.size.x+bvhRefiner._vf.size.y)/2.0;var cullObject={};var lastIndice=0;var triangulationAttributes=null;function initialize(){var appearance=new x3dom.nodeTypes.Appearance(ctx);var textures=new x3dom.nodeTypes.MultiTexture(ctx);var colorTexture=new x3dom.nodeTypes.ImageTexture(ctx);var heightTexture=new x3dom.nodeTypes.ImageTexture(ctx);var normalTexture=new x3dom.nodeTypes.ImageTexture(ctx);var composedShader=new x3dom.nodeTypes.ComposedShader(ctx);shape._nameSpace=bvhRefiner._nameSpace;position=nodeTransformation.e3();position.z=bvhRefiner._vf.maxElevation/2;var vertexShader=new x3dom.nodeTypes.ShaderPart(ctx);vertexShader._vf.type='vertex';vertexShader._vf.url[0]=createVertexShader();var fragmentShader=new x3dom.nodeTypes.ShaderPart(ctx);fragmentShader._vf.type='fragment';fragmentShader._vf.url[0]=createFragmentShader();composedShader.addChild(vertexShader,'parts');composedShader.addChild(fragmentShader,'parts');var colorTexProp=new x3dom.nodeTypes.TextureProperties(ctx);colorTexProp._vf.boundaryModeS=\"CLAMP_TO_EDGE\";colorTexProp._vf.boundaryModeT=\"CLAMP_TO_EDGE\";colorTexProp._vf.boundaryModeR=\"CLAMP_TO_EDGE\";colorTexProp._vf.minificationFilter=\"LINEAR\";colorTexProp._vf.magnificationFilter=\"LINEAR\";colorTexture.addChild(colorTexProp,\"textureProperties\");colorTexture.nodeChanged();colorTexture._nameSpace=bvhRefiner._nameSpace;colorTexture._vf.url[0]=imageAddressColor;colorTexture._vf.repeatT=false;colorTexture._vf.repeatS=false;textures.addChild(colorTexture,'texture');colorTexture.nodeChanged();var colorTextureField=new x3dom.nodeTypes.Field(ctx);colorTextureField._vf.name='texColor';colorTextureField._vf.type='SFInt32';colorTextureField._vf.value=0;composedShader.addChild(colorTextureField,'fields');colorTextureField.nodeChanged();var heightTexProp=new x3dom.nodeTypes.TextureProperties(ctx);heightTexProp._vf.boundaryModeS=\"CLAMP_TO_EDGE\";heightTexProp._vf.boundaryModeT=\"CLAMP_TO_EDGE\";heightTexProp._vf.boundaryModeR=\"CLAMP_TO_EDGE\";heightTexProp._vf.minificationFilter=\"NEAREST\";heightTexProp._vf.magnificationFilter=\"NEAREST\";heightTexture.addChild(heightTexProp,\"textureProperties\");heightTexture.nodeChanged();heightTexture._nameSpace=bvhRefiner._nameSpace;heightTexture._vf.url[0]=imageAddressHeight;heightTexture._vf.repeatT=false;heightTexture._vf.repeatS=false;heightTexture._vf.scale=false;textures.addChild(heightTexture,'texture');heightTexture.nodeChanged();var heightTextureField=new x3dom.nodeTypes.Field(ctx);heightTextureField._vf.name='texHeight';heightTextureField._vf.type='SFInt32';heightTextureField._vf.value=1;composedShader.addChild(heightTextureField,'fields');heightTextureField.nodeChanged();if(bvhRefiner._vf.normalUrl!==\"\"){var normalTexProp=new x3dom.nodeTypes.TextureProperties(ctx);normalTexProp._vf.boundaryModeS=\"CLAMP_TO_EDGE\";normalTexProp._vf.boundaryModeT=\"CLAMP_TO_EDGE\";normalTexProp._vf.boundaryModeR=\"CLAMP_TO_EDGE\";normalTexProp._vf.minificationFilter=\"LINEAR\";normalTexProp._vf.magnificationFilter=\"LINEAR\";normalTexture.addChild(normalTexProp,\"textureProperties\");normalTexture.nodeChanged();normalTexture._nameSpace=bvhRefiner._nameSpace;normalTexture._vf.url[0]=imageAddressNormal;normalTexture._vf.repeatT=false;normalTexture._vf.repeatS=false;textures.addChild(normalTexture,'texture');normalTexture.nodeChanged();var normalTextureField=new x3dom.nodeTypes.Field(ctx);normalTextureField._vf.name='texNormal';normalTextureField._vf.type='SFInt32';normalTextureField._vf.value=2;composedShader.addChild(normalTextureField,'fields');normalTextureField.nodeChanged();}\nvar maxHeight=new x3dom.nodeTypes.Field(ctx);maxHeight._vf.name='maxElevation';maxHeight._vf.type='SFFloat';maxHeight._vf.value=bvhRefiner._vf.maxElevation;composedShader.addChild(maxHeight,'fields');maxHeight.nodeChanged();appearance.addChild(textures);textures.nodeChanged();appearance.addChild(composedShader);composedShader.nodeChanged();shape.addChild(appearance);appearance.nodeChanged();shape.addChild(geometry);bvhRefiner.addChild(shape);shape.nodeChanged();cullObject.boundedNode=shape;cullObject.volume=shape.getVolume();cullObject.volume.max.z=bvhRefiner._vf.maxElevation;cullObject.volume.min.z=0;cullObject.volume.center=cullObject.volume.min.add(cullObject.volume.max).multiply(0.5);cullObject.volume.transform(nodeTransformation);calculateNeighborhood();}\nfunction calculateNeighborhood(){var levelStartID=0;for(var i=0;i<level;i++){levelStartID+=Math.pow(4,i);}\nvar sid=levelStartID+nodeNumber;bvhRefiner.nodeList[sid]=that;var c=Math.sqrt(Math.pow(4,level));neighbors[0]=levelStartID+(Math.ceil(((nodeNumber+1)/c)-1)*c+((nodeNumber+(c-1))%c));neighbors[1]=levelStartID+(Math.ceil(((nodeNumber+1)/c)-1)*c+((nodeNumber+1)%c));neighbors[3]=levelStartID+(nodeNumber+(c*(c-1)))%(Math.pow(4,level));neighbors[2]=levelStartID+(nodeNumber+c)%(Math.pow(4,level));if(columnNr===0){neighbors[0]=-1;}\nif(rowNr===0){neighbors[3]=-1;}\nif(columnNr===c-1){neighbors[1]=-1;}\nif(rowNr===c-1){neighbors[2]=-1;}}\nfunction createVertexShader(){if(bvhRefiner._vf.normalUrl!==\"\")\nreturn\"attribute vec3 position;\\n\"+\"attribute vec3 texcoord;\\n\"+\"uniform mat4 modelViewMatrix;\\n\"+\"uniform mat4 modelViewProjectionMatrix;\\n\"+\"uniform sampler2D texColor;\\n\"+\"uniform sampler2D texHeight;\\n\"+\"uniform float maxElevation;\\n\"+\"uniform sampler2D texNormal;\\n\"+\"varying vec2 texC;\\n\"+\"varying vec3 vLight;\\n\"+\"const float shininess = 32.0;\\n\"+\"\\n\"+\"void main(void) {\\n\"+\"    vec3 uLightPosition = vec3(160.0, -9346.0, 4806.0);\\n\"+\"    vec4 colr = texture2D(texColor, vec2(texcoord[0], 1.0-texcoord[1]));\\n\"+\"    vec3 uAmbientMaterial = vec3(1.0, 1.0, 0.9);\"+\"    vec3 uAmbientLight = vec3(0.5, 0.5, 0.5);\"+\"    vec3 uDiffuseMaterial = vec3(0.7, 0.7, 0.7);\"+\"    vec3 uDiffuseLight = vec3(1.0, 1.0, 1.0);\"+\"    vec4 vertexPositionEye4 = modelViewMatrix * vec4(position, 1.0);\"+\"    vec3 vertexPositionEye3 = vec3((modelViewMatrix * vec4(vertexPositionEye4.xyz, 1.0)).xyz);\"+\"    vec3 vectorToLightSource = normalize(uLightPosition - vertexPositionEye3);\"+\"    vec4 height = texture2D(texHeight, vec2(texcoord[0], 1.0 - texcoord[1]));\\n\"+\"    vec4 normalEye = 2.0 * texture2D(texNormal, vec2(texcoord[0], 1.0-texcoord[1])) - 1.0;\\n\"+\"    float diffuseLightWeighting = max(dot(normalEye.xyz, vectorToLightSource), 0.0);\"+\"    texC = vec2(texcoord[0], 1.0-texcoord[1]);\\n\"+\"    vec3 diffuseReflectance = uDiffuseMaterial * uDiffuseLight * diffuseLightWeighting;\"+\"    vec3 uSpecularMaterial = vec3(0.0, 0.0, 0.0);\"+\"    vec3 uSpecularLight = vec3(1.0, 1.0, 1.0);\"+\"    vec3 reflectionVector = normalize(reflect(-vectorToLightSource, normalEye.xyz));\"+\"    vec3 viewVectorEye = -normalize(vertexPositionEye3);\"+\"    float rdotv = max(dot(reflectionVector, viewVectorEye), 0.0);\"+\"    float specularLightWeight = pow(rdotv, shininess);\"+\"    vec3 specularReflection = uSpecularMaterial * uSpecularLight * specularLightWeight;\"+\"    vLight = vec4(uAmbientMaterial * uAmbientLight + diffuseReflectance + specularReflection, 1.0).xyz;\"+\"    gl_Position = modelViewProjectionMatrix * vec4(position.xy, height.x * maxElevation, 1.0);\\n\"+\"}\\n\";else\nreturn\"attribute vec3 position;\\n\"+\"attribute vec3 texcoord;\\n\"+\"uniform mat4 modelViewProjectionMatrix;\\n\"+\"uniform sampler2D texHeight;\\n\"+\"uniform float maxElevation;\\n\"+\"varying vec2 texC;\\n\"+\"\\n\"+\"void main(void) {\\n\"+\"    vec4 height = texture2D(texHeight, vec2(texcoord[0], 1.0 - texcoord[1]));\\n\"+\"    texC = vec2(texcoord[0], 1.0-texcoord[1]);\\n\"+\"    gl_Position = modelViewProjectionMatrix * vec4(position.xy, height.x * maxElevation, 1.0);\\n\"+\"}\\n\";}\nfunction createFragmentShader(){if(bvhRefiner._vf.normalUrl!==\"\")\nreturn\"#ifdef GL_ES\\n\"+\"precision highp float;\\n\"+\"#endif\\n\"+\"uniform sampler2D texColor;\\n\"+\"uniform sampler2D texNormal;\\n\"+\"varying vec2 texC;\\n\"+\"varying vec3 vLight;\\n\"+\"\\n\"+\"\\n\"+\"void main(void) {\\n\"+\"    vec4 normal = 2.0 * texture2D(texNormal, texC) - 1.0;\\n\"+\"    vec4 colr = texture2D(texColor, texC);\\n\"+\"    gl_FragColor = vec4(colr.xyz * vLight, colr.w);\\n\"+\"}\\n\";else\nreturn\"#ifdef GL_ES\\n\"+\"precision highp float;\\n\"+\"#endif\\n\"+\"uniform sampler2D texColor;\\n\"+\"varying vec2 texC;\\n\"+\"\\n\"+\"\\n\"+\"void main(void) {\\n\"+\"    gl_FragColor = texture2D(texColor, texC);\\n\"+\"}\\n\";}\nthis.CreateChildren=function(){create();};function create(){var deltaR=Math.sqrt(Math.pow(4,level));var deltaR1=Math.sqrt(Math.pow(4,level+1));var lt=Math.floor(nodeNumber/deltaR)*4*deltaR+\n(nodeNumber%deltaR)*2;var rt=lt+1;var lb=lt+deltaR1;var rb=lb+1;var s=(bvhRefiner._vf.size).multiply(0.25);children.push(new QuadtreeNode3D(ctx,bvhRefiner,(level+1),lt,nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(new x3dom.fields.SFVec3f(-s.x,s.y,0.0))).mult(x3dom.fields.SFMatrix4f.scale(new x3dom.fields.SFVec3f(0.5,0.5,1.0))),(columnNr*2),(rowNr*2),geometry));children.push(new QuadtreeNode3D(ctx,bvhRefiner,(level+1),rt,nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(new x3dom.fields.SFVec3f(s.x,s.y,0.0))).mult(x3dom.fields.SFMatrix4f.scale(new x3dom.fields.SFVec3f(0.5,0.5,1.0))),(columnNr*2+1),(rowNr*2),geometry));children.push(new QuadtreeNode3D(ctx,bvhRefiner,(level+1),lb,nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(new x3dom.fields.SFVec3f(-s.x,-s.y,0.0))).mult(x3dom.fields.SFMatrix4f.scale(new x3dom.fields.SFVec3f(0.5,0.5,1.0))),(columnNr*2),(rowNr*2+1),geometry));children.push(new QuadtreeNode3D(ctx,bvhRefiner,(level+1),rb,nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(new x3dom.fields.SFVec3f(s.x,-s.y,0.0))).mult(x3dom.fields.SFMatrix4f.scale(new x3dom.fields.SFVec3f(0.5,0.5,1.0))),(columnNr*2+1),(rowNr*2+1),geometry));}\nthis.Shape=function(){return shape;};this.ChildrenReady=function(){return childrenReadyState;};this.Ready=function(){if(shape._webgl!==undefined&&shape._webgl.texture!==undefined){return ready();}\nreturn false;};function ready(){readyState=true;for(var i=0;i<shape._webgl.texture.length;i++){if(!shape._webgl.texture[i].texture.ready){readyState=false;}}\nreturn readyState;}\nfunction updateLoadingState(drawableCollection,transform){childrenReadyState=true;for(var i=0;i<children.length;i++){if(!children[i].Ready()){childrenReadyState=false;}}\nif(children.length<4){childrenReadyState=false;}\nelse if(childrenReadyState){for(var i=0;i<children.length;i++){children[i].Shape()._vf.render=true;}}\nif(shape._webgl===undefined||shape._webgl.texture===undefined){drawableCollection.context.setupShape(drawableCollection.gl,{shape:shape,transform:transform},drawableCollection.viewarea);}\nelse{ready();}}\nthis.collectDrawables=function(transform,drawableCollection,singlePath,invalidateCache,planeMask){drawableCollection.frustumCulling=false;cullObject.localMatrix=nodeTransformation;if(!readyState||!childrenReadyState){updateLoadingState(drawableCollection,nodeTransformation);}\nvar mat_view=drawableCollection.viewMatrix;var vPos=mat_view.multMatrixPnt(nodeTransformation.multMatrixPnt(position));var distanceToCamera=Math.sqrt(Math.pow(vPos.x,2)+Math.pow(vPos.y,2)+Math.pow(vPos.z,2));if(readyState&&vPos.z-(cullObject.volume.diameter/2)<0){if((distanceToCamera<Math.pow((bvhRefiner._vf.maxDepth-level),2)*resizeFac/bvhRefiner._vf.factor)||level<bvhRefiner._vf.minDepth){if(bvhRefiner.view.isMovingOrAnimating()&&(children.length==0||level>=bvhRefiner._vf.interactionDepth)){render(nodeTransformation,drawableCollection,singlePath,invalidateCache,planeMask);}\nelse{if(children.length===0){bvhRefiner.nodeProducer.AddNewNode(that,distanceToCamera);render(nodeTransformation,drawableCollection,singlePath,invalidateCache,planeMask);}\nelse{if(childrenReadyState){for(var i=0;i<children.length;i++){children[i].collectDrawables(nodeTransformation,drawableCollection,singlePath,invalidateCache,planeMask);}}\nelse{render(nodeTransformation,drawableCollection,singlePath,invalidateCache,planeMask);for(var i=0;i<children.length;i++){children[i].collectDrawables(nodeTransformation,drawableCollection,singlePath,invalidateCache,planeMask);children[i].Shape()._vf.render=false;}}}}}\nelse{render(nodeTransformation,drawableCollection,singlePath,invalidateCache,planeMask);}}};this.hasHigherRenderLevel=function(drawableCollection){var mat_view=drawableCollection.viewMatrix;var vPos=mat_view.multMatrixPnt(nodeTransformation.multMatrixPnt(position));var distanceToCamera=Math.sqrt(Math.pow(vPos.x,2)+Math.pow(vPos.y,2)+Math.pow(vPos.z,2));if(distanceToCamera<Math.pow((bvhRefiner._vf.maxDepth-level),2)*resizeFac/bvhRefiner._vf.factor){return true;}\nreturn false;};function render(transform,drawableCollection,singlePath,invalidateCache,planeMask){var hasNeighborHigherResolution=[];for(var i=0;i<neighbors.length;i++){if(bvhRefiner.nodeList[neighbors[i]]!==undefined){if(bvhRefiner.nodeList[neighbors[i]].ChildrenReady()&&bvhRefiner.nodeList[neighbors[i]].hasHigherRenderLevel(drawableCollection))\nhasNeighborHigherResolution.push(true);else\nhasNeighborHigherResolution.push(false);}\nelse{hasNeighborHigherResolution.push(false);}}\nvar indiceNumber=0;if(hasNeighborHigherResolution[3]){if(hasNeighborHigherResolution[1]){indiceNumber=5;}\nelse if(hasNeighborHigherResolution[0]){indiceNumber=6;}\nelse{indiceNumber=4;}}\nelse if(hasNeighborHigherResolution[2]){if(hasNeighborHigherResolution[1]){indiceNumber=8;}\nelse if(hasNeighborHigherResolution[0]){indiceNumber=7;}\nelse{indiceNumber=3;}}\nelse if(hasNeighborHigherResolution[0]){indiceNumber=1;}\nelse if(hasNeighborHigherResolution[1]){indiceNumber=2;}\nif(lastIndice!==indiceNumber||triangulationAttributes===null){triangulationAttributes=shape._cf.geometry.node.getTriangulationAttributes(indiceNumber);lastIndice=indiceNumber;}\nshape._tessellationProperties=[triangulationAttributes];shape.collectDrawableObjects(nodeTransformation,drawableCollection,singlePath,invalidateCache,planeMask,[]);}\nthis.getVolume=function(){return shape.getVolume();};this.Level=function(){return level;};var that=this;initialize();}\nfunction QuadtreeNodeBin(ctx,bvhRefiner,level,columnNr,rowNr,resizeFac)\n{var cullObject={};var mat_view;var vPos;var distanceToCamera;var fac=((1/4*Math.pow(level,2)+1.5)*0.1)*bvhRefiner._vf.factor;var children=[];var childrenExist=false;var readyState=false;var childrenReadyState=false;var path=bvhRefiner._vf.url+\"/\"+level+\"/\"+columnNr+\"/\";var file=path+rowNr+\".x3d\";var position=new x3dom.fields.SFVec3f(0.0,0.0,0.0);var exists=false;var shape=new x3dom.nodeTypes.Shape(ctx);var xhr=new XMLHttpRequest();xhr.open(\"GET\",file,false);try{x3dom.RequestManager.addRequest(xhr);var xmlDoc=xhr.responseXML;if(xmlDoc!==null){var replacer=new RegExp(\"\\\"\",\"g\");createGeometry(shape);initialize();exists=true;}}\ncatch(exp){x3dom.debug.logException(\"Error loading file '\"+file+\"': \"+exp);}\nthis.Exists=function(){return exists;};this.Shape=function(){return shape;};function createGeometry(parent){this._nameSpace=new x3dom.NodeNameSpace(\"\",bvhRefiner._nameSpace.doc);this._nameSpace.setBaseURL(bvhRefiner._nameSpace.baseURL+path);var tempShape=xmlDoc.getElementsByTagName(\"Shape\")[0];shape=this._nameSpace.setupTree(tempShape);if(!bvhRefiner._vf.useNormals){var appearance=new x3dom.nodeTypes.Appearance(ctx);var material=new x3dom.nodeTypes.Material(ctx);appearance.addChild(material);shape._cf.appearance=appearance;}\nposition=x3dom.fields.SFVec3f.copy(shape._cf.geometry.node._vf.position);}\nfunction initialize(){cullObject.boundedNode=shape;cullObject.volume=shape.getVolume();}\nthis.CreateChildren=function(){create();};function create(){children.push(new QuadtreeNodeBin(ctx,bvhRefiner,(level+1),(columnNr*2),(rowNr*2),resizeFac));children.push(new QuadtreeNodeBin(ctx,bvhRefiner,(level+1),(columnNr*2+1),(rowNr*2),resizeFac));children.push(new QuadtreeNodeBin(ctx,bvhRefiner,(level+1),(columnNr*2),(rowNr*2+1),resizeFac));children.push(new QuadtreeNodeBin(ctx,bvhRefiner,(level+1),(columnNr*2+1),(rowNr*2+1),resizeFac));}\nthis.Ready=function(){if(shape._webgl!==undefined&&shape._webgl.internalDownloadCount!==undefined){return ready();}\nreturn false;};function ready(){readyState=true;if(shape._webgl.internalDownloadCount>0){readyState=false;}\nreturn readyState;}\nfunction updateLoadingState(drawableCollection,transform){childrenReadyState=true;for(var i=0;i<children.length;i++){if(!children[i].Ready()){childrenReadyState=false;}}\nif(childrenReadyState){for(var i=0;i<children.length;i++){children[i].Shape()._vf.render=true;}}\nif(shape._cf.geometry.node!==null){if(shape._webgl===undefined||shape._webgl.internalDownloadCount===undefined){drawableCollection.context.setupShape(drawableCollection.gl,{shape:shape,transform:transform},drawableCollection.viewarea);}\nelse{ready();}}}\nthis.collectDrawables=function(transform,drawableCollection,singlePath,invalidateCache,planeMask){fac=((1/4*Math.pow(level,2)+1.5)*0.1)*bvhRefiner._vf.factor;cullObject.localMatrix=transform;if(!readyState||!childrenReadyState){updateLoadingState(drawableCollection,transform);}\nif(readyState&&exists&&(planeMask=drawableCollection.cull(transform,cullObject,singlePath,planeMask))>0){mat_view=drawableCollection.viewMatrix;vPos=mat_view.multMatrixPnt(transform.multMatrixPnt(position));distanceToCamera=Math.sqrt(Math.pow(vPos.x,2)+Math.pow(vPos.y,2)+Math.pow(vPos.z,2));if((distanceToCamera<Math.pow((bvhRefiner._vf.maxDepth-level),2)/fac*1000)||level<bvhRefiner._vf.minDepth){if(bvhRefiner.view.isMovingOrAnimating()&&level>=bvhRefiner._vf.interactionDepth){shape.collectDrawableObjects(transform,drawableCollection,singlePath,invalidateCache,planeMask,[]);}\nelse{if(children.length===0){bvhRefiner.nodeProducer.AddNewNode(that,distanceToCamera);shape.collectDrawableObjects(transform,drawableCollection,singlePath,invalidateCache,planeMask,[]);}\nelse if(children.length===0&&bvhRefiner.createChildren>0){shape.collectDrawableObjects(transform,drawableCollection,singlePath,invalidateCache,planeMask,[]);}\nelse{if(!childrenExist){for(var i=0;i<children.length;i++){if(children[i].Exists()){childrenExist=true;break;}}}\nif(childrenExist&&childrenReadyState){for(var i=0;i<children.length;i++){children[i].collectDrawables(transform,drawableCollection,singlePath,invalidateCache,planeMask);}}\nelse{for(var i=0;i<children.length;i++){children[i].collectDrawables(transform,drawableCollection,singlePath,invalidateCache,planeMask);children[i].Shape()._vf.render=false;}\nshape.collectDrawableObjects(transform,drawableCollection,singlePath,invalidateCache,planeMask,[]);}}}}\nelse{shape.collectDrawableObjects(transform,drawableCollection,singlePath,invalidateCache,planeMask,[]);}}};this.getVolume=function(){return shape.getVolume();};this.Level=function(){return level;};var that=this;initialize();}\nfunction BVHNode(ctx,bvhRefiner,level,path,imgNumber,count)\n{var cullObject={};var mat_view;var vPos;var distanceToCamera;var fac=((1/4*Math.pow(level,2)+1.5)*0.1)*bvhRefiner._vf.factor;var children=[];var childrenExist=false;var readyState=false;var childrenReadyState=false;var file=bvhRefiner._vf.url+path+imgNumber+\".x3d\";var position=new x3dom.fields.SFVec3f(0.0,0.0,0.0);var exists=false;var shape=new x3dom.nodeTypes.Shape(ctx);this.RecalcFactor=function(){fac=((1/4*Math.pow(level,2)+1.5)*0.1)*bvhRefiner._vf.factor;for(var i=0;i<children.length;i++){children[i].RecalcFactor();}};var xhr=new XMLHttpRequest();xhr.open(\"GET\",file,false);try{x3dom.RequestManager.addRequest(xhr);var xmlDoc=xhr.responseXML;if(xmlDoc!==null){var replacer=new RegExp(\"\\\"\",\"g\");createGeometry(shape);initialize();exists=true;}}\ncatch(exp){x3dom.debug.logException(\"Error loading file '\"+file+\"': \"+exp);}\nthis.Exists=function()\n{return exists;};this.Shape=function(){return shape;};function createGeometry(parent){this._nameSpace=new x3dom.NodeNameSpace(\"\",bvhRefiner._nameSpace.doc);this._nameSpace.setBaseURL(bvhRefiner._nameSpace.baseURL+bvhRefiner._vf.url+path);var tempShape=xmlDoc.getElementsByTagName(\"Shape\")[0];shape=this._nameSpace.setupTree(tempShape);if(!bvhRefiner._vf.useNormals){var appearance=new x3dom.nodeTypes.Appearance(ctx);var material=new x3dom.nodeTypes.Material(ctx);appearance.addChild(material);shape._cf.appearance=appearance;}\nposition=x3dom.fields.SFVec3f.copy(shape._cf.geometry.node._vf.position);}\nfunction initialize(){cullObject.boundedNode=shape;cullObject.volume=shape.getVolume();}\nthis.CreateChildren=function(){create();};function create(){for(var i=0;i<count;i++){children.push(new BVHNode(ctx,bvhRefiner,(level+1),path+imgNumber+\"/\",i+1,count));}}\nthis.Ready=function(){if(shape._webgl!==undefined&&shape._webgl.internalDownloadCount!==undefined){return ready();}\nreturn false;};function ready(){return(shape._webgl.internalDownloadCount<=0);}\nfunction updateLoadingState(drawableCollection,transform){for(var i=0;i<children.length;i++){childrenReadyState=true;if(!children[i].Ready()){childrenReadyState=false;}\nelse{children[i].Shape()._vf.render=true;}}\nif(shape._cf.geometry.node!==null){if(shape._webgl===undefined||shape._webgl.internalDownloadCount===undefined){drawableCollection.context.setupShape(drawableCollection.gl,{shape:shape,transform:transform},drawableCollection.viewarea);}\nelse{ready();}}}\nthis.collectDrawables=function(transform,drawableCollection,singlePath,invalidateCache,planeMask){fac=((1/4*Math.pow(level,2)+1.5)*0.1)*bvhRefiner._vf.factor;cullObject.localMatrix=transform;if(!readyState||!childrenReadyState){updateLoadingState(drawableCollection,transform);}\nif(readyState&&exists&&(planeMask=drawableCollection.cull(transform,cullObject,singlePath,planeMask))>0){mat_view=drawableCollection.viewMatrix;vPos=mat_view.multMatrixPnt(transform.multMatrixPnt(position));distanceToCamera=Math.sqrt(Math.pow(vPos.x,2)+Math.pow(vPos.y,2)+Math.pow(vPos.z,2));if((distanceToCamera<Math.pow((bvhRefiner._vf.maxDepth-level),2)/fac)||level<bvhRefiner._vf.minDepth){if(bvhRefiner.view.isMovingOrAnimating()&&level>=bvhRefiner._vf.interactionDepth){shape.collectDrawableObjects(transform,drawableCollection,singlePath,invalidateCache,planeMask,[]);}\nelse{if(children.length===0){bvhRefiner.nodeProducer.AddNewNode(that,distanceToCamera);shape.collectDrawableObjects(transform,drawableCollection,singlePath,invalidateCache,planeMask,[]);}\nelse if(children.length===0&&bvhRefiner.createChildren>0){shape.collectDrawableObjects(transform,drawableCollection,singlePath,invalidateCache,planeMask,[]);}\nelse{if(!childrenExist){for(var i=0;i<children.length;i++){if(children[i].Exists()){childrenExist=true;break;}}}\nif(childrenExist&&childrenReadyState){for(var i=0;i<children.length;i++){children[i].collectDrawables(transform,drawableCollection,singlePath,invalidateCache,planeMask);}}\nelse{for(var i=0;i<children.length;i++){children[i].collectDrawables(transform,drawableCollection,singlePath,invalidateCache,planeMask);children[i].Shape()._vf.render=false;}\nshape.collectDrawableObjects(transform,drawableCollection,singlePath,invalidateCache,planeMask,[]);}}}}\nelse{shape.collectDrawableObjects(transform,drawableCollection,singlePath,invalidateCache,planeMask,[]);}}};this.getVolume=function(){return shape.getVolume();};this.Level=function(){return level;};var that=this;initialize();}\nfunction QuadtreeNode3D_NEW(ctx,bvhRefiner,level,nodeNumber,nodeTransformation,columnNr,rowNr,geometry)\n{var children=[];var shape=new x3dom.nodeTypes.Shape();var position=null;var imageAddressColor=bvhRefiner._vf.textureUrl+\"/\"+level+\"/\"+\ncolumnNr+\"/\"+rowNr+\".\"+\n(bvhRefiner._vf.textureFormat).toLowerCase();var imageAddressHeight=bvhRefiner._vf.elevationUrl+\"/\"+level+\"/\"+\ncolumnNr+\"/\"+rowNr+\".\"+\n(bvhRefiner._vf.elevationFormat).toLowerCase();var imageAddressNormal=bvhRefiner._vf.normalUrl+\"/\"+level+\"/\"+\ncolumnNr+\"/\"+rowNr+\".\"+\n(bvhRefiner._vf.normalFormat).toLowerCase();var exists=true;var resizeFac=(bvhRefiner._vf.size.x+bvhRefiner._vf.size.y)/2.0;var cullObject={};function initialize(){var appearance=new x3dom.nodeTypes.Appearance(ctx);var shader=new x3dom.nodeTypes.CommonSurfaceShader(ctx);var ssTexColor=new x3dom.nodeTypes.SurfaceShaderTexture(ctx);var colorTexture=new x3dom.nodeTypes.ImageTexture(ctx);var ssTexDisplace=new x3dom.nodeTypes.SurfaceShaderTexture(ctx);var heightTexture=new x3dom.nodeTypes.ImageTexture(ctx);shape._nameSpace=bvhRefiner._nameSpace;position=nodeTransformation.e3();shader._vf.displacementFactor=bvhRefiner._vf.maxElevation;colorTexture._nameSpace=bvhRefiner._nameSpace;colorTexture._vf.url[0]=imageAddressColor;colorTexture._vf.repeatT=false;colorTexture._vf.repeatS=false;ssTexColor.addChild(colorTexture,'texture');colorTexture.nodeChanged();shader.addChild(ssTexColor,'diffuseTexture');ssTexColor.nodeChanged();heightTexture._nameSpace=bvhRefiner._nameSpace;heightTexture._vf.url[0]=imageAddressHeight;heightTexture._vf.repeatT=false;heightTexture._vf.repeatS=false;ssTexDisplace.addChild(heightTexture,'texture');heightTexture.nodeChanged();shader.addChild(ssTexDisplace,'displacementTexture');heightTexture.nodeChanged();appearance.addChild(shader,'shaders');shader.nodeChanged();shape.addChild(appearance);appearance.nodeChanged();shape.addChild(geometry);geometry.nodeChanged();bvhRefiner.addChild(shape);shape.nodeChanged();cullObject.boundedNode=shape;cullObject.volume=shape.getVolume();cullObject.volume.max.z=Math.round(bvhRefiner._vf.maxElevation/2);cullObject.volume.min.z=-cullObject.volume.max.z;}\nfunction createVertexShader(){return\"attribute vec3 position;\\n\"+\"attribute vec3 texcoord;\\n\"+\"uniform mat4 modelViewMatrix;\\n\"+\"uniform mat4 modelViewProjectionMatrix;\\n\"+\"uniform sampler2D texColor;\\n\"+\"uniform sampler2D texHeight;\\n\"+\"uniform float maxElevation;\\n\"+\"uniform sampler2D texNormal;\\n\"+\"varying vec2 texC;\\n\"+\"varying vec3 vLight;\\n\"+\"const float shininess = 32.0;\\n\"+\"\\n\"+\"void main(void) {\\n\"+\"    vec3 uLightPosition = vec3(160.0, -9346.0, 4806.0);\\n\"+\"    vec4 colr = texture2D(texColor, vec2(texcoord[0], 1.0-texcoord[1]));\\n\"+\"    vec3 uAmbientMaterial = vec3(1.0, 1.0, 0.9);\"+\"    vec3 uAmbientLight = vec3(0.5, 0.5, 0.5);\"+\"    vec3 uDiffuseMaterial = vec3(0.7, 0.7, 0.7);\"+\"    vec3 uDiffuseLight = vec3(1.0, 1.0, 1.0);\"+\"    vec4 vertexPositionEye4 = modelViewMatrix * vec4(position, 1.0);\"+\"    vec3 vertexPositionEye3 = vec3((modelViewMatrix * vec4(vertexPositionEye4.xyz, 1.0)).xyz);\"+\"    vec3 vectorToLightSource = normalize(uLightPosition - vertexPositionEye3);\"+\"    vec4 height = texture2D(texHeight, vec2(texcoord[0], 1.0 - texcoord[1]));\\n\"+\"    vec4 normalEye = 2.0 * texture2D(texNormal, vec2(texcoord[0], 1.0-texcoord[1])) - 1.0;\\n\"+\"    float diffuseLightWeighting = max(dot(normalEye.xyz, vectorToLightSource), 0.0);\"+\"    texC = vec2(texcoord[0], 1.0-texcoord[1]);\\n\"+\"    vec3 diffuseReflectance = uDiffuseMaterial * uDiffuseLight * diffuseLightWeighting;\"+\"    vec3 uSpecularMaterial = vec3(0.0, 0.0, 0.0);\"+\"    vec3 uSpecularLight = vec3(1.0, 1.0, 1.0);\"+\"    vec3 reflectionVector = normalize(reflect(-vectorToLightSource, normalEye.xyz));\"+\"    vec3 viewVectorEye = -normalize(vertexPositionEye3);\"+\"    float rdotv = max(dot(reflectionVector, viewVectorEye), 0.0);\"+\"    float specularLightWeight = pow(rdotv, shininess);\"+\"    vec3 specularReflection = uSpecularMaterial * uSpecularLight * specularLightWeight;\"+\"    vLight = vec4(uAmbientMaterial * uAmbientLight + diffuseReflectance + specularReflection, 1.0).xyz;\"+\"    gl_Position = modelViewProjectionMatrix * vec4(position.xy, height.x * maxElevation, 1.0);\\n\"+\"}\\n\";}\nfunction createFragmentShader(){return\"#ifdef GL_ES\\n\"+\"precision highp float;\\n\"+\"#endif\\n\"+\"uniform sampler2D texColor;\\n\"+\"uniform sampler2D texNormal;\\n\"+\"varying vec2 texC;\\n\"+\"varying vec3 vLight;\\n\"+\"\\n\"+\"\\n\"+\"void main(void) {\\n\"+\"    vec4 normal = 2.0 * texture2D(texNormal, texC) - 1.0;\\n\"+\"    vec4 colr = texture2D(texColor, texC);\\n\"+\"    gl_FragColor = vec4(colr.xyz * vLight, colr.w);\\n\"+\"}\\n\";}\nfunction create(){var deltaR=Math.sqrt(Math.pow(4,level));var deltaR1=Math.sqrt(Math.pow(4,level+1));var lt=Math.floor(nodeNumber/deltaR)*4*deltaR+\n(nodeNumber%deltaR)*2;var rt=lt+1;var lb=lt+deltaR1;var rb=lb+1;var s=(bvhRefiner._vf.size).multiply(0.25);children.push(new QuadtreeNode3D_NEW(ctx,bvhRefiner,(level+1),lt,nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(new x3dom.fields.SFVec3f(-s.x,s.y,0.0))).mult(x3dom.fields.SFMatrix4f.scale(new x3dom.fields.SFVec3f(0.5,0.5,1.0))),(columnNr*2),(rowNr*2),geometry));children.push(new QuadtreeNode3D_NEW(ctx,bvhRefiner,(level+1),rt,nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(new x3dom.fields.SFVec3f(s.x,s.y,0.0))).mult(x3dom.fields.SFMatrix4f.scale(new x3dom.fields.SFVec3f(0.5,0.5,1.0))),(columnNr*2+1),(rowNr*2),geometry));children.push(new QuadtreeNode3D_NEW(ctx,bvhRefiner,(level+1),lb,nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(new x3dom.fields.SFVec3f(-s.x,-s.y,0.0))).mult(x3dom.fields.SFMatrix4f.scale(new x3dom.fields.SFVec3f(0.5,0.5,1.0))),(columnNr*2),(rowNr*2+1),geometry));children.push(new QuadtreeNode3D_NEW(ctx,bvhRefiner,(level+1),rb,nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(new x3dom.fields.SFVec3f(s.x,-s.y,0.0))).mult(x3dom.fields.SFMatrix4f.scale(new x3dom.fields.SFVec3f(0.5,0.5,1.0))),(columnNr*2+1),(rowNr*2+1),geometry));}\nthis.collectDrawables=function(transform,drawableCollection,singlePath,invalidateCache,planeMask){cullObject.localMatrix=nodeTransformation;if(exists&&(planeMask=drawableCollection.cull(transform,cullObject,singlePath,planeMask))>0){var mat_view=drawableCollection.viewMatrix;var vPos=mat_view.multMatrixPnt(transform.multMatrixPnt(position));var distanceToCamera=Math.sqrt(Math.pow(vPos.x,2)+Math.pow(vPos.y,2)+Math.pow(vPos.z,2));if((distanceToCamera<Math.pow((bvhRefiner._vf.maxDepth-level),2)*resizeFac/bvhRefiner._vf.factor)){if(children.length===0&&bvhRefiner.createChildren===0){bvhRefiner.createChildren++;create();shape.collectDrawableObjects(nodeTransformation,drawableCollection,singlePath,invalidateCache,planeMask,[]);}\nelse if(children.length===0&&bvhRefiner.createChildren>0){shape.collectDrawableObjects(nodeTransformation,drawableCollection,singlePath,invalidateCache,planeMask,[]);}\nelse{for(var i=0;i<children.length;i++){children[i].collectDrawables(nodeTransformation,drawableCollection,singlePath,invalidateCache,planeMask);}}}\nelse{shape.collectDrawableObjects(nodeTransformation,drawableCollection,singlePath,invalidateCache,planeMask,[]);}}};this.getVolume=function(){return shape.getVolume();};initialize();}\nfunction OctreeNode(ctx,bvhRefiner,level,nodeTransformation)\n{var children=[];var position=nodeTransformation.e3();var shape=new x3dom.nodeTypes.Shape(ctx);var cullObject={};var resizeFac=(bvhRefiner._vf.octSize.x+bvhRefiner._vf.octSize.y+bvhRefiner._vf.octSize.z)/3.0;function initialize(){var appearance=new x3dom.nodeTypes.Appearance(ctx);var geometry=new x3dom.nodeTypes.Box(ctx);geometry._vf.size=bvhRefiner._vf.octSize;geometry.fieldChanged('size');shape._nameSpace=new x3dom.NodeNameSpace(\"\",bvhRefiner._nameSpace.doc);shape._nameSpace.setBaseURL(bvhRefiner._nameSpace.baseURL);shape.addChild(appearance);appearance.nodeChanged();shape.addChild(geometry);geometry.nodeChanged();shape.nodeChanged();cullObject.boundedNode=shape;cullObject.volume=shape.getVolume();}\nfunction create(){var s=bvhRefiner._vf.octSize.multiply(0.25);children.push(new OctreeNode(ctx,bvhRefiner,(level+1),nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(new x3dom.fields.SFVec3f(-s.x,s.y,s.z))).mult(x3dom.fields.SFMatrix4f.scale(new x3dom.fields.SFVec3f(0.5,0.5,0.5)))));children.push(new OctreeNode(ctx,bvhRefiner,(level+1),nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(new x3dom.fields.SFVec3f(s.x,s.y,s.z))).mult(x3dom.fields.SFMatrix4f.scale(new x3dom.fields.SFVec3f(0.5,0.5,0.5)))));children.push(new OctreeNode(ctx,bvhRefiner,(level+1),nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(new x3dom.fields.SFVec3f(-s.x,-s.y,s.z))).mult(x3dom.fields.SFMatrix4f.scale(new x3dom.fields.SFVec3f(0.5,0.5,0.5)))));children.push(new OctreeNode(ctx,bvhRefiner,(level+1),nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(new x3dom.fields.SFVec3f(s.x,-s.y,s.z))).mult(x3dom.fields.SFMatrix4f.scale(new x3dom.fields.SFVec3f(0.5,0.5,0.5)))));children.push(new OctreeNode(ctx,bvhRefiner,(level+1),nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(new x3dom.fields.SFVec3f(-s.x,s.y,-s.z))).mult(x3dom.fields.SFMatrix4f.scale(new x3dom.fields.SFVec3f(0.5,0.5,0.5)))));children.push(new OctreeNode(ctx,bvhRefiner,(level+1),nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(new x3dom.fields.SFVec3f(s.x,s.y,-s.z))).mult(x3dom.fields.SFMatrix4f.scale(new x3dom.fields.SFVec3f(0.5,0.5,0.5)))));children.push(new OctreeNode(ctx,bvhRefiner,(level+1),nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(new x3dom.fields.SFVec3f(-s.x,-s.y,-s.z))).mult(x3dom.fields.SFMatrix4f.scale(new x3dom.fields.SFVec3f(0.5,0.5,0.5)))));children.push(new OctreeNode(ctx,bvhRefiner,(level+1),nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(new x3dom.fields.SFVec3f(s.x,-s.y,-s.z))).mult(x3dom.fields.SFMatrix4f.scale(new x3dom.fields.SFVec3f(0.5,0.5,0.5)))));}\nthis.collectDrawables=function(transform,drawableCollection,singlePath,invalidateCache,planeMask){cullObject.localMatrix=nodeTransformation;if((planeMask=drawableCollection.cull(transform,cullObject,singlePath,planeMask))>0){var mat_view=drawableCollection.viewMatrix;var vPos=mat_view.multMatrixPnt(transform.multMatrixPnt(position));var distanceToCamera=Math.sqrt(Math.pow(vPos.x,2)+Math.pow(vPos.y,2)+Math.pow(vPos.z,2));if((distanceToCamera<Math.pow((bvhRefiner._vf.maxDepth-level),2)*resizeFac/bvhRefiner._vf.factor)){if(children.length===0){create();}\nelse{for(var i=0;i<children.length;i++){children[i].collectDrawables(nodeTransformation,drawableCollection,singlePath,invalidateCache,planeMask);}}}\nelse{shape.collectDrawableObjects(nodeTransformation,drawableCollection,singlePath,invalidateCache,planeMask,[]);}}};this.getVolume=function(){return shape.getVolume();};initialize();}\nfunction QuadtreeNode3D_32bit(ctx,bvhRefiner,level,nodeNumber,nodeTransformation,columnNr,rowNr,geometry)\n{var children=[];var shape=new x3dom.nodeTypes.Shape();var position=null;var imageAddressColor=bvhRefiner._vf.textureUrl+\"/\"+level+\"/\"+\ncolumnNr+\"/\"+rowNr+\".\"+\n(bvhRefiner._vf.textureFormat).toLowerCase();var imageAddressHeight=bvhRefiner._vf.elevationUrl+\"/\"+level+\"/\"+\ncolumnNr+\"/\"+rowNr+\".\"+\n(bvhRefiner._vf.elevationFormat).toLowerCase();var imageAddressNormal=bvhRefiner._vf.normalUrl+\"/\"+level+\"/\"+\ncolumnNr+\"/\"+rowNr+\".\"+\n(bvhRefiner._vf.normalFormat).toLowerCase();var exists=true;var resizeFac=(bvhRefiner._vf.size.x+bvhRefiner._vf.size.y)/2.0;var cullObject={};function initialize(){var appearance=new x3dom.nodeTypes.Appearance(ctx);var textures=new x3dom.nodeTypes.MultiTexture(ctx);var colorTexture=new x3dom.nodeTypes.ImageTexture(ctx);var heightTexture=new x3dom.nodeTypes.ImageTexture(ctx);var normalTexture=new x3dom.nodeTypes.ImageTexture(ctx);var composedShader=new x3dom.nodeTypes.ComposedShader(ctx);shape._nameSpace=bvhRefiner._nameSpace;position=nodeTransformation.e3();var vertexShader=new x3dom.nodeTypes.ShaderPart(ctx);vertexShader._vf.type='vertex';vertexShader._vf.url[0]=createVertexShader();var fragmentShader=new x3dom.nodeTypes.ShaderPart(ctx);fragmentShader._vf.type='fragment';fragmentShader._vf.url[0]=createFragmentShader();composedShader.addChild(vertexShader,'parts');composedShader.addChild(fragmentShader,'parts');colorTexture._nameSpace=bvhRefiner._nameSpace;colorTexture._vf.url[0]=imageAddressColor;colorTexture._vf.repeatT=false;colorTexture._vf.repeatS=false;colorTexture._vf.generateMipMaps=false;textures.addChild(colorTexture,'texture');colorTexture.nodeChanged();var colorTextureField=new x3dom.nodeTypes.Field(ctx);colorTextureField._vf.name='texColor';colorTextureField._vf.type='SFInt32';colorTextureField._vf.value=0;composedShader.addChild(colorTextureField,'fields');colorTextureField.nodeChanged();heightTexture._nameSpace=bvhRefiner._nameSpace;heightTexture._vf.url[0]=imageAddressHeight;heightTexture._vf.repeatT=false;heightTexture._vf.repeatS=false;textures.addChild(heightTexture,'texture');heightTexture.nodeChanged();var heightTextureField=new x3dom.nodeTypes.Field(ctx);heightTextureField._vf.name='texHeight';heightTextureField._vf.type='SFInt32';heightTextureField._vf.value=1;composedShader.addChild(heightTextureField,'fields');heightTextureField.nodeChanged();normalTexture._nameSpace=bvhRefiner._nameSpace;normalTexture._vf.url[0]=imageAddressNormal;normalTexture._vf.repeatT=false;normalTexture._vf.repeatS=false;textures.addChild(normalTexture,'texture');normalTexture.nodeChanged();var normalTextureField=new x3dom.nodeTypes.Field(ctx);normalTextureField._vf.name='texNormal';normalTextureField._vf.type='SFInt32';normalTextureField._vf.value=2;composedShader.addChild(normalTextureField,'fields');normalTextureField.nodeChanged();var maxHeight=new x3dom.nodeTypes.Field(ctx);maxHeight._vf.name='maxElevation';maxHeight._vf.type='SFFloat';maxHeight._vf.value=bvhRefiner._vf.maxElevation;composedShader.addChild(maxHeight,'fields');maxHeight.nodeChanged();appearance.addChild(textures);textures.nodeChanged();appearance.addChild(composedShader);composedShader.nodeChanged();shape.addChild(appearance);appearance.nodeChanged();shape.addChild(geometry);geometry.nodeChanged();bvhRefiner.addChild(shape);shape.nodeChanged();cullObject.boundedNode=shape;cullObject.volume=shape.getVolume();cullObject.volume.max.z=Math.round(bvhRefiner._vf.maxElevation);cullObject.volume.min.z=-cullObject.volume.max.z;}\nfunction createVertexShader(){return\"attribute vec3 position;\\n\"+\"attribute vec3 texcoord;\\n\"+\"uniform mat4 modelViewMatrix;\\n\"+\"uniform mat4 modelViewProjectionMatrix;\\n\"+\"uniform sampler2D texColor;\\n\"+\"uniform sampler2D texHeight;\\n\"+\"uniform float maxElevation;\\n\"+\"uniform sampler2D texNormal;\\n\"+\"varying vec2 texC;\\n\"+\"varying vec3 vLight;\\n\"+\"const float shininess = 32.0;\\n\"+\"\\n\"+\"void main(void) {\\n\"+\"    vec3 uLightPosition = vec3(160.0, -9346.0, 4806.0);\\n\"+\"    vec4 colr = texture2D(texColor, vec2(texcoord[0], 1.0-texcoord[1]));\\n\"+\"    vec3 uAmbientMaterial = vec3(1.0, 1.0, 0.9);\"+\"    vec3 uAmbientLight = vec3(0.5, 0.5, 0.5);\"+\"    vec3 uDiffuseMaterial = vec3(0.7, 0.7, 0.7);\"+\"    vec3 uDiffuseLight = vec3(1.0, 1.0, 1.0);\"+\"    vec4 vertexPositionEye4 = modelViewMatrix * vec4(position, 1.0);\"+\"    vec3 vertexPositionEye3 = vec3((modelViewMatrix * vec4(vertexPositionEye4.xyz, 1.0)).xyz);\"+\"    vec3 vectorToLightSource = normalize(uLightPosition - vertexPositionEye3);\"+\"    vec4 height = texture2D(texHeight, vec2(texcoord[0], 1.0 - texcoord[1]));\\n\"+\"    vec4 normalEye = 2.0 * texture2D(texNormal, vec2(texcoord[0], 1.0-texcoord[1])) - 1.0;\\n\"+\"    float diffuseLightWeighting = max(dot(normalEye.xyz, vectorToLightSource), 0.0);\"+\"    texC = vec2(texcoord[0], 1.0-texcoord[1]);\\n\"+\"    vec3 diffuseReflectance = uDiffuseMaterial * uDiffuseLight * diffuseLightWeighting;\"+\"    vec3 uSpecularMaterial = vec3(0.0, 0.0, 0.0);\"+\"    vec3 uSpecularLight = vec3(1.0, 1.0, 1.0);\"+\"    vec3 reflectionVector = normalize(reflect(-vectorToLightSource, normalEye.xyz));\"+\"    vec3 viewVectorEye = -normalize(vertexPositionEye3);\"+\"    float rdotv = max(dot(reflectionVector, viewVectorEye), 0.0);\"+\"    float specularLightWeight = pow(rdotv, shininess);\"+\"    vec3 specularReflection = uSpecularMaterial * uSpecularLight * specularLightWeight;\"+\"    vLight = vec4(uAmbientMaterial * uAmbientLight + diffuseReflectance + specularReflection, 1.0).xyz;\"+\"    gl_Position = modelViewProjectionMatrix * vec4(position.xy, ((height.g * 256.0)+height.b) * maxElevation, 1.0);\\n\"+\"}\\n\";}\nfunction createFragmentShader(){return\"#ifdef GL_ES\\n\"+\"precision highp float;\\n\"+\"#endif\\n\"+\"uniform sampler2D texColor;\\n\"+\"uniform sampler2D texNormal;\\n\"+\"varying vec2 texC;\\n\"+\"varying vec3 vLight;\\n\"+\"\\n\"+\"\\n\"+\"void main(void) {\\n\"+\"    vec4 normal = 2.0 * texture2D(texNormal, texC) - 1.0;\\n\"+\"    vec4 colr = texture2D(texColor, texC);\\n\"+\"    float coler = ((colr.g * 256.0)+colr.b);\"+\"    gl_FragColor = vec4(vLight * coler, 1.0);\\n\"+\"}\\n\";}\nfunction create(){var deltaR=Math.sqrt(Math.pow(4,level));var deltaR1=Math.sqrt(Math.pow(4,level+1));var lt=Math.floor(nodeNumber/deltaR)*4*deltaR+\n(nodeNumber%deltaR)*2;var rt=lt+1;var lb=lt+deltaR1;var rb=lb+1;var s=(bvhRefiner._vf.size).multiply(0.25);children.push(new QuadtreeNode3D_32bit(ctx,bvhRefiner,(level+1),lt,nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(new x3dom.fields.SFVec3f(-s.x,s.y,0.0))).mult(x3dom.fields.SFMatrix4f.scale(new x3dom.fields.SFVec3f(0.5,0.5,1.0))),(columnNr*2),(rowNr*2),geometry));children.push(new QuadtreeNode3D_32bit(ctx,bvhRefiner,(level+1),rt,nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(new x3dom.fields.SFVec3f(s.x,s.y,0.0))).mult(x3dom.fields.SFMatrix4f.scale(new x3dom.fields.SFVec3f(0.5,0.5,1.0))),(columnNr*2+1),(rowNr*2),geometry));children.push(new QuadtreeNode3D_32bit(ctx,bvhRefiner,(level+1),lb,nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(new x3dom.fields.SFVec3f(-s.x,-s.y,0.0))).mult(x3dom.fields.SFMatrix4f.scale(new x3dom.fields.SFVec3f(0.5,0.5,1.0))),(columnNr*2),(rowNr*2+1),geometry));children.push(new QuadtreeNode3D_32bit(ctx,bvhRefiner,(level+1),rb,nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(new x3dom.fields.SFVec3f(s.x,-s.y,0.0))).mult(x3dom.fields.SFMatrix4f.scale(new x3dom.fields.SFVec3f(0.5,0.5,1.0))),(columnNr*2+1),(rowNr*2+1),geometry));}\nthis.collectDrawables=function(transform,drawableCollection,singlePath,invalidateCache,planeMask){cullObject.localMatrix=nodeTransformation;if(exists&&(planeMask=drawableCollection.cull(transform,cullObject,singlePath,planeMask))>0){var mat_view=drawableCollection.viewMatrix;var vPos=mat_view.multMatrixPnt(transform.multMatrixPnt(position));var distanceToCamera=Math.sqrt(Math.pow(vPos.x,2)+Math.pow(vPos.y,2)+Math.pow(vPos.z,2));if((distanceToCamera<Math.pow((bvhRefiner._vf.maxDepth-level),2)*resizeFac/bvhRefiner._vf.factor)){if(children.length===0&&bvhRefiner.createChildren===0){bvhRefiner.createChildren++;create();shape.collectDrawableObjects(nodeTransformation,drawableCollection,singlePath,invalidateCache,planeMask,[]);}\nelse if(children.length===0&&bvhRefiner.createChildren>0){shape.collectDrawableObjects(nodeTransformation,drawableCollection,singlePath,invalidateCache,planeMask,[]);}\nelse{for(var i=0;i<children.length;i++){children[i].collectDrawables(nodeTransformation,drawableCollection,singlePath,invalidateCache,planeMask);}}}\nelse{shape.collectDrawableObjects(nodeTransformation,drawableCollection,singlePath,invalidateCache,planeMask,[]);}}};this.getVolume=function(){return shape.getVolume();};initialize();}\nx3dom.registerNodeType(\"Snout\",\"Geometry3DExt\",defineClass(x3dom.nodeTypes.X3DSpatialGeometryNode,function(ctx){x3dom.nodeTypes.Snout.superClass.call(this,ctx);this.addField_SFFloat(ctx,'dbottom',1.0);this.addField_SFFloat(ctx,'dtop',0.5);this.addField_SFFloat(ctx,'height',1.0);this.addField_SFFloat(ctx,'xoff',0.25);this.addField_SFFloat(ctx,'yoff',0.25);this.addField_SFBool(ctx,'bottom',true);this.addField_SFBool(ctx,'top',true);this.addField_SFFloat(ctx,'subdivision',32);this.rebuildGeometry();},{rebuildGeometry:function()\n{this._mesh._positions[0]=[];this._mesh._normals[0]=[];this._mesh._texCoords[0]=[];this._mesh._indices[0]=[];var bottomRadius=this._vf.dbottom/2,height=this._vf.height;var topRadius=this._vf.dtop/2,sides=this._vf.subdivision;var beta,x,z;var delta=2.0*Math.PI/sides;var incl=(bottomRadius-topRadius)/height;var nlen=1.0/Math.sqrt(1.0+incl*incl);var j=0,k=0;var h,base;if(height>0){var px=0,pz=0;for(j=0,k=0;j<=sides;j++){beta=j*delta;x=Math.sin(beta);z=-Math.cos(beta);px=x*topRadius+this._vf.xoff;pz=z*topRadius+this._vf.yoff;this._mesh._positions[0].push(px,height/2,pz);this._mesh._normals[0].push(x/nlen,incl/nlen,z/nlen);this._mesh._texCoords[0].push(1.0-j/sides,1);this._mesh._positions[0].push(x*bottomRadius,-height/2,z*bottomRadius);this._mesh._normals[0].push(x/nlen,incl/nlen,z/nlen);this._mesh._texCoords[0].push(1.0-j/sides,0);if(j>0){this._mesh._indices[0].push(k);this._mesh._indices[0].push(k+2);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k+2);this._mesh._indices[0].push(k+3);k+=2;}}}\nif(bottomRadius>0&&this._vf.bottom){base=this._mesh._positions[0].length/3;for(j=sides-1;j>=0;j--){beta=j*delta;x=bottomRadius*Math.sin(beta);z=-bottomRadius*Math.cos(beta);this._mesh._positions[0].push(x,-height/2,z);this._mesh._normals[0].push(0,-1,0);this._mesh._texCoords[0].push(x/bottomRadius/2+0.5,z/bottomRadius/2+0.5);}\nh=base+1;for(j=2;j<sides;j++){this._mesh._indices[0].push(h);this._mesh._indices[0].push(base);h=base+j;this._mesh._indices[0].push(h);}}\nif(topRadius>x3dom.fields.Eps&&this._vf.top){base=this._mesh._positions[0].length/3;for(j=sides-1;j>=0;j--){beta=j*delta;x=topRadius*Math.sin(beta);z=-topRadius*Math.cos(beta);this._mesh._positions[0].push(x+this._vf.xoff,height/2,z+this._vf.yoff);this._mesh._normals[0].push(0,1,0);this._mesh._texCoords[0].push(x/topRadius/2+0.5,1.0-z/topRadius/2+0.5);}\nh=base+1;for(j=2;j<sides;j++){this._mesh._indices[0].push(base);this._mesh._indices[0].push(h);h=base+j;this._mesh._indices[0].push(h);}}\nthis.invalidateVolume();this._mesh._numFaces=this._mesh._indices[0].length/3;this._mesh._numCoords=this._mesh._positions[0].length/3;},fieldChanged:function(fieldName)\n{if(fieldName==\"dtop\"||fieldName==\"dbottom\"||fieldName==\"height\"||fieldName==\"subdivision\"||fieldName==\"xoff\"||fieldName==\"yoff\"||fieldName==\"bottom\"||fieldName==\"top\")\n{this.rebuildGeometry();Array.forEach(this._parentNodes,function(node){node.setAllDirty();node.invalidateVolume();});}}}));x3dom.registerNodeType(\"Dish\",\"Geometry3DExt\",defineClass(x3dom.nodeTypes.X3DSpatialGeometryNode,function(ctx){x3dom.nodeTypes.Dish.superClass.call(this,ctx);this.addField_SFFloat(ctx,'diameter',2);this.addField_SFFloat(ctx,'height',1);this.addField_SFFloat(ctx,'radius',this._vf.diameter/2);this.addField_SFBool(ctx,'bottom',true);this.addField_SFVec2f(ctx,'subdivision',24,24);this.rebuildGeometry();},{rebuildGeometry:function()\n{this._mesh._positions[0]=[];this._mesh._normals[0]=[];this._mesh._texCoords[0]=[];this._mesh._indices[0]=[];var twoPi=Math.PI*2,halfPi=Math.PI/2;var halfDia=this._vf.diameter/2;var r=this._vf.radius;r=(r==0||Math.abs(halfDia-r)<=x3dom.fields.Eps)?halfDia:r;var h=Math.min(this._vf.height,r);var offset=r-h;var a=halfDia;var b=r;var c=halfDia;var latitudeBands=this._vf.subdivision.x,longitudeBands=this._vf.subdivision.y;var latNumber,longNumber;var segTheta=halfPi-Math.asin(1-h/r);var segL=Math.ceil(latitudeBands/halfPi*segTheta);var theta,sinTheta,cosTheta;var phi,sinPhi,cosPhi;var x,y,z,u,v;var tmpPosArr=[],tmpTcArr=[];for(latNumber=0;latNumber<=latitudeBands;latNumber++){if(segL==latNumber){theta=segTheta;}\nelse{theta=(latNumber*halfPi)/latitudeBands;}\nsinTheta=Math.sin(theta);cosTheta=Math.cos(theta);for(longNumber=0;longNumber<=longitudeBands;longNumber++){phi=(longNumber*twoPi)/longitudeBands;sinPhi=Math.sin(phi);cosPhi=Math.cos(phi);x=a*(-cosPhi*sinTheta);y=b*cosTheta;z=c*(-sinPhi*sinTheta);u=0.25-(longNumber/longitudeBands);v=latNumber/latitudeBands;this._mesh._positions[0].push(x,y-offset,z);this._mesh._texCoords[0].push(u,v);this._mesh._normals[0].push(x/(a*a),y/(b*b),z/(c*c));if((latNumber==latitudeBands)||(segL==latNumber)){tmpPosArr.push(x,y-offset,z);tmpTcArr.push(u,v);}}\nif(segL==latNumber)\nbreak;}\nfor(latNumber=0;latNumber<latitudeBands;latNumber++){if(segL==latNumber)\nbreak;for(longNumber=0;longNumber<longitudeBands;longNumber++){var first=(latNumber*(longitudeBands+1))+longNumber;var second=first+longitudeBands+1;this._mesh._indices[0].push(first+1);this._mesh._indices[0].push(second);this._mesh._indices[0].push(first);this._mesh._indices[0].push(first+1);this._mesh._indices[0].push(second+1);this._mesh._indices[0].push(second);}}\nif(this._vf.bottom)\n{var origPos=this._mesh._positions[0].length/3;var t=origPos+1;for(var i=0,m=tmpPosArr.length/3;i<m;i++){var j=3*i;this._mesh._positions[0].push(tmpPosArr[j]);this._mesh._positions[0].push(tmpPosArr[j+1]);this._mesh._positions[0].push(tmpPosArr[j+2]);j=2*i;this._mesh._texCoords[0].push(tmpTcArr[j]);this._mesh._texCoords[0].push(tmpTcArr[j+1]);this._mesh._normals[0].push(0,-1,0);if(i>=2){this._mesh._indices[0].push(origPos);this._mesh._indices[0].push(t);t=origPos+i;this._mesh._indices[0].push(t);}}}\nthis.invalidateVolume();this._mesh._numFaces=this._mesh._indices[0].length/3;this._mesh._numCoords=this._mesh._positions[0].length/3;},fieldChanged:function(fieldName)\n{if(fieldName==\"radius\"||fieldName==\"height\"||fieldName==\"diameter\"||fieldName==\"subdivision\"||fieldName==\"bottom\")\n{this.rebuildGeometry();Array.forEach(this._parentNodes,function(node){node.setAllDirty();node.invalidateVolume();});}}}));x3dom.registerNodeType(\"Pyramid\",\"Geometry3DExt\",defineClass(x3dom.nodeTypes.X3DSpatialGeometryNode,function(ctx){x3dom.nodeTypes.Pyramid.superClass.call(this,ctx);this.addField_SFFloat(ctx,'xbottom',1);this.addField_SFFloat(ctx,'ybottom',1);this.addField_SFFloat(ctx,'xtop',0.5);this.addField_SFFloat(ctx,'ytop',0.5);this.addField_SFFloat(ctx,'height',1);this.addField_SFFloat(ctx,'xoff',0.25);this.addField_SFFloat(ctx,'yoff',0.25);var xTop=this._vf.xtop/2;var yTop=this._vf.ytop/2;var xBot=this._vf.xbottom/2;var yBot=this._vf.ybottom/2;var xOff=this._vf.xoff;var yOff=this._vf.yoff;var sy=this._vf.height/2;this._mesh._positions[0]=[-xBot,-sy,-yBot,-xTop+xOff,sy,-yTop+yOff,xTop+xOff,sy,-yTop+yOff,xBot,-sy,-yBot,-xBot,-sy,yBot,-xTop+xOff,sy,yTop+yOff,xTop+xOff,sy,yTop+yOff,xBot,-sy,yBot,-xBot,-sy,-yBot,-xBot,-sy,yBot,-xTop+xOff,sy,yTop+yOff,-xTop+xOff,sy,-yTop+yOff,xBot,-sy,-yBot,xBot,-sy,yBot,xTop+xOff,sy,yTop+yOff,xTop+xOff,sy,-yTop+yOff,-xTop+xOff,sy,-yTop+yOff,-xTop+xOff,sy,yTop+yOff,xTop+xOff,sy,yTop+yOff,xTop+xOff,sy,-yTop+yOff,-xBot,-sy,-yBot,-xBot,-sy,yBot,xBot,-sy,yBot,xBot,-sy,-yBot];this._mesh._texCoords[0]=[1,0,1,1,0,1,0,0,0,0,0,1,1,1,1,0,0,0,1,0,1,1,0,1,1,0,0,0,0,1,1,1,0,1,0,0,1,0,1,1,0,0,0,1,1,1,1,0];this._mesh._indices[0]=[0,1,2,2,3,0,6,5,4,4,7,6,8,9,10,10,11,8,12,15,14,14,13,12,16,17,18,18,19,16,20,23,22,22,21,20];this._mesh.calcNormals(Math.PI,this._vf.ccw);this._mesh._invalidate=true;this._mesh._numFaces=12;this._mesh._numCoords=24;},{fieldChanged:function(fieldName)\n{if(fieldName==\"xbottom\"||fieldName==\"ybottom\"||fieldName==\"xtop\"||fieldName==\"ytop\"||fieldName==\"xoff\"||fieldName==\"yoff\"||fieldName==\"height\")\n{var xTop=this._vf.xtop/2;var yTop=this._vf.ytop/2;var xBot=this._vf.xbottom/2;var yBot=this._vf.ybottom/2;var xOff=this._vf.xoff;var yOff=this._vf.yoff;var sy=this._vf.height/2;this._mesh._positions[0]=[-xBot,-sy,-yBot,-xTop+xOff,sy,-yTop+yOff,xTop+xOff,sy,-yTop+yOff,xBot,-sy,-yBot,-xBot,-sy,yBot,-xTop+xOff,sy,yTop+yOff,xTop+xOff,sy,yTop+yOff,xBot,-sy,yBot,-xBot,-sy,-yBot,-xBot,-sy,yBot,-xTop+xOff,sy,yTop+yOff,-xTop+xOff,sy,-yTop+yOff,xBot,-sy,-yBot,xBot,-sy,yBot,xTop+xOff,sy,yTop+yOff,xTop+xOff,sy,-yTop+yOff,-xTop+xOff,sy,-yTop+yOff,-xTop+xOff,sy,yTop+yOff,xTop+xOff,sy,yTop+yOff,xTop+xOff,sy,-yTop+yOff,-xBot,-sy,-yBot,-xBot,-sy,yBot,xBot,-sy,yBot,xBot,-sy,-yBot];this._mesh._normals[0]=[];this._mesh.calcNormals(Math.PI,this._vf.ccw);this.invalidateVolume();Array.forEach(this._parentNodes,function(node){node.setAllDirty();node.invalidateVolume();});}}}));x3dom.registerNodeType(\"RectangularTorus\",\"Geometry3DExt\",defineClass(x3dom.nodeTypes.X3DSpatialGeometryNode,function(ctx){x3dom.nodeTypes.RectangularTorus.superClass.call(this,ctx);this.addField_SFFloat(ctx,'innerRadius',0.5);this.addField_SFFloat(ctx,'outerRadius',1);this.addField_SFFloat(ctx,'height',1);this.addField_SFFloat(ctx,'angle',2*Math.PI);this.addField_SFBool(ctx,'caps',true);this.addField_SFFloat(ctx,'subdivision',32);this._origCCW=this._vf.ccw;this.rebuildGeometry();},{rebuildGeometry:function()\n{this._mesh._positions[0]=[];this._mesh._normals[0]=[];this._mesh._texCoords[0]=[];this._mesh._indices[0]=[];var twoPi=2.0*Math.PI;this._vf.ccw=!this._origCCW;if(this._vf.angle<0)\nthis._vf.angle=0;else if(this._vf.angle>twoPi)\nthis._vf.angle=twoPi;if(this._vf.innerRadius>this._vf.outerRadius)\n{var tmp=this._vf.innerRadius;this._vf.innerRadius=this._vf.outerRadius;this._vf.outerRadius=tmp;}\nvar innerRadius=this._vf.innerRadius;var outerRadius=this._vf.outerRadius;var height=this._vf.height/2;var angle=this._vf.angle;var sides=this._vf.subdivision;var beta,x,z,k,j,nx,nz;var delta=angle/sides;for(j=0,k=0;j<=sides;j++)\n{beta=j*delta;nx=Math.cos(beta);nz=-Math.sin(beta);x=outerRadius*nx;z=outerRadius*nz;this._mesh._positions[0].push(x,-height,z);this._mesh._normals[0].push(nx,0,nz);this._mesh._positions[0].push(x,height,z);this._mesh._normals[0].push(nx,0,nz);if(j>0)\n{this._mesh._indices[0].push(k);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k+2);this._mesh._indices[0].push(k+2);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k+3);k+=2;}}\nfor(j=0,k=k+2;j<=sides;j++)\n{beta=j*delta;nx=Math.cos(beta);nz=-Math.sin(beta);x=innerRadius*nx;z=innerRadius*nz;this._mesh._positions[0].push(x,-height,z);this._mesh._normals[0].push(-nx,0,-nz);this._mesh._positions[0].push(x,height,z);this._mesh._normals[0].push(-nx,0,-nz);if(j>0)\n{this._mesh._indices[0].push(k+2);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k);this._mesh._indices[0].push(k+3);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k+2);k+=2;}}\nfor(j=0,k=k+2;j<=sides;j++)\n{beta=j*delta;nx=Math.cos(beta);nz=-Math.sin(beta);x=outerRadius*nx;z=outerRadius*nz;this._mesh._positions[0].push(x,height,z);this._mesh._normals[0].push(0,1,0);x=innerRadius*nx;z=innerRadius*nz;this._mesh._positions[0].push(x,height,z);this._mesh._normals[0].push(0,1,0);if(j>0)\n{this._mesh._indices[0].push(k);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k+2);this._mesh._indices[0].push(k+2);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k+3);k+=2;}}\nfor(j=0,k=k+2;j<=sides;j++)\n{beta=j*delta;nx=Math.cos(beta);nz=-Math.sin(beta);x=outerRadius*nx;z=outerRadius*nz;this._mesh._positions[0].push(x,-height,z);this._mesh._normals[0].push(0,-1,0);x=innerRadius*nx;z=innerRadius*nz;this._mesh._positions[0].push(x,-height,z);this._mesh._normals[0].push(0,-1,0);if(j>0)\n{this._mesh._indices[0].push(k+2);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k);this._mesh._indices[0].push(k+3);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k+2);k+=2;}}\nif(angle<twoPi&&this._vf.caps==true)\n{k+=2;x=outerRadius;z=0;this._mesh._positions[0].push(x,height,z);this._mesh._normals[0].push(0,0,1);this._mesh._positions[0].push(x,-height,z);this._mesh._normals[0].push(0,0,1);x=innerRadius;z=0;this._mesh._positions[0].push(x,height,z);this._mesh._normals[0].push(0,0,1);this._mesh._positions[0].push(x,-height,z);this._mesh._normals[0].push(0,0,1);this._mesh._indices[0].push(k);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k+2);this._mesh._indices[0].push(k+2);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k+3);k+=4;nx=Math.cos(angle);nz=-Math.sin(angle);x=outerRadius*nx;z=outerRadius*nz;this._mesh._positions[0].push(x,height,z);this._mesh._normals[0].push(nz,0,-nx);this._mesh._positions[0].push(x,-height,z);this._mesh._normals[0].push(nz,0,-nx);x=innerRadius*nx;z=innerRadius*nz;this._mesh._positions[0].push(x,height,z);this._mesh._normals[0].push(nz,0,-nx);this._mesh._positions[0].push(x,-height,z);this._mesh._normals[0].push(nz,0,-nx);this._mesh._indices[0].push(k+2);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k);this._mesh._indices[0].push(k+3);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k+2);}\nthis.invalidateVolume();this._mesh._numFaces=this._mesh._indices[0].length/3;this._mesh._numCoords=this._mesh._positions[0].length/3;},fieldChanged:function(fieldName)\n{if(fieldName==\"innerRadius\"||fieldName==\"outerRadius\"||fieldName==\"height\"||fieldName==\"angle\"||fieldName==\"subdivision\"||fieldName==\"caps\")\n{this.rebuildGeometry();Array.forEach(this._parentNodes,function(node){node.setAllDirty();node.invalidateVolume();});}}}));x3dom.registerNodeType(\"SlopedCylinder\",\"Geometry3DExt\",defineClass(x3dom.nodeTypes.X3DSpatialGeometryNode,function(ctx){x3dom.nodeTypes.SlopedCylinder.superClass.call(this,ctx);this.addField_SFFloat(ctx,'radius',1.0);this.addField_SFFloat(ctx,'height',2.0);this.addField_SFBool(ctx,'bottom',true);this.addField_SFBool(ctx,'top',true);this.addField_SFFloat(ctx,'xtshear',0.26179);this.addField_SFFloat(ctx,'ytshear',0.0);this.addField_SFFloat(ctx,'xbshear',0.26179);this.addField_SFFloat(ctx,'ybshear',0.0);this.addField_SFFloat(ctx,'subdivision',32);this.rebuildGeometry();},{rebuildGeometry:function()\n{this._mesh._positions[0]=[];this._mesh._normals[0]=[];this._mesh._texCoords[0]=[];this._mesh._indices[0]=[];var topSlopeX=this._vf.xtshear;var topSlopeY=this._vf.ytshear;var botSlopeX=this._vf.xbshear;var botSlopeY=this._vf.ybshear;var sides=this._vf.subdivision;var radius=this._vf.radius;var height=this._vf.height/2;var delta=2.0*Math.PI/sides;var beta,x,y,z;var j,k;for(j=0,k=0;j<=sides;j++)\n{beta=j*delta;x=Math.sin(beta);z=-Math.cos(beta);this._mesh._positions[0].push(x*radius,-height+x*botSlopeX+z*botSlopeY,z*radius);this._mesh._texCoords[0].push(1.0-j/sides,0);this._mesh._positions[0].push(x*radius,height+x*topSlopeX+z*topSlopeY,z*radius);this._mesh._texCoords[0].push(1.0-j/sides,1);if(j>0)\n{this._mesh._indices[0].push(k);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k+2);this._mesh._indices[0].push(k+2);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k+3);k+=2;}}\nvar h,base;if(this._vf.top&&radius>0)\n{base=this._mesh._positions[0].length/3;for(j=sides-1;j>=0;j--)\n{k=6*j;x=this._mesh._positions[0][k+3];y=this._mesh._positions[0][k+4];z=this._mesh._positions[0][k+5];this._mesh._positions[0].push(x,y,z);this._mesh._texCoords[0].push(x/2+0.5,-z/2+0.5);}\nh=base+1;for(j=2;j<sides;j++)\n{this._mesh._indices[0].push(base);this._mesh._indices[0].push(h);h=base+j;this._mesh._indices[0].push(h);}}\nif(this._vf.bottom&&radius>0)\n{base=this._mesh._positions[0].length/3;for(j=sides-1;j>=0;j--)\n{k=6*j;x=this._mesh._positions[0][k];y=this._mesh._positions[0][k+1];z=this._mesh._positions[0][k+2];this._mesh._positions[0].push(x,y,z);this._mesh._texCoords[0].push(x/2+0.5,z/2+0.5);}\nh=base+1;for(j=2;j<sides;j++)\n{this._mesh._indices[0].push(h);this._mesh._indices[0].push(base);h=base+j;this._mesh._indices[0].push(h);}}\nthis._mesh.calcNormals(Math.PI,this._vf.ccw);var n0b=new x3dom.fields.SFVec3f(this._mesh._normals[0][0],this._mesh._normals[0][1],this._mesh._normals[0][2]);var n0t=new x3dom.fields.SFVec3f(this._mesh._normals[0][3],this._mesh._normals[0][4],this._mesh._normals[0][5]);k=6*sides;var n1b=new x3dom.fields.SFVec3f(this._mesh._normals[0][k],this._mesh._normals[0][k+1],this._mesh._normals[0][k+2]);var n1t=new x3dom.fields.SFVec3f(this._mesh._normals[0][k+3],this._mesh._normals[0][k+4],this._mesh._normals[0][k+5]);var nb=n0b.add(n1b).normalize();var nt=n0t.add(n1t).normalize();this._mesh._normals[0][0]=nb.x;this._mesh._normals[0][1]=nb.y;this._mesh._normals[0][2]=nb.z;this._mesh._normals[0][3]=nt.x;this._mesh._normals[0][4]=nt.y;this._mesh._normals[0][5]=nt.z;this._mesh._normals[0][k]=nb.x;this._mesh._normals[0][k+1]=nb.y;this._mesh._normals[0][k+2]=nb.z;this._mesh._normals[0][k+3]=nt.x;this._mesh._normals[0][k+4]=nt.y;this._mesh._normals[0][k+5]=nt.z;this.invalidateVolume();this._mesh._numFaces=this._mesh._indices[0].length/3;this._mesh._numCoords=this._mesh._positions[0].length/3;},fieldChanged:function(fieldName)\n{if(fieldName==\"xtshear\"||fieldName==\"ytshear\"||fieldName==\"xbshear\"||fieldName==\"ybshear\"||fieldName==\"radius\"||fieldName==\"height\"||fieldName==\"bottom\"||fieldName==\"top\"||fieldName==\"subdivision\")\n{this.rebuildGeometry();Array.forEach(this._parentNodes,function(node){node.setAllDirty();node.invalidateVolume();});}}}));x3dom.registerNodeType(\"Nozzle\",\"Geometry3DExt\",defineClass(x3dom.nodeTypes.X3DSpatialGeometryNode,function(ctx){x3dom.nodeTypes.Nozzle.superClass.call(this,ctx);this.addField_SFFloat(ctx,'nozzleHeight',0.1);this.addField_SFFloat(ctx,'nozzleRadius',0.6);this.addField_SFFloat(ctx,'height',1.0);this.addField_SFFloat(ctx,'outerRadius',0.5);this.addField_SFFloat(ctx,'innerRadius',0.4);this.addField_SFFloat(ctx,'subdivision',32);this.rebuildGeometry();},{rebuildGeometry:function()\n{this._mesh._positions[0]=[];this._mesh._normals[0]=[];this._mesh._texCoords[0]=[];this._mesh._indices[0]=[];var twoPi=2.0*Math.PI;var sides=this._vf.subdivision;var height=this._vf.height;var center=height/2;if(this._vf.innerRadius>this._vf.outerRadius)\n{var tmp=this._vf.innerRadius;this._vf.innerRadius=this._vf.outerRadius;this._vf.outerRadius=tmp;}\nvar innerRadius=this._vf.innerRadius;var outerRadius=this._vf.outerRadius;if(this._vf.nozzleRadius<outerRadius)\n{this._vf.nozzleRadius=outerRadius;}\nvar nozzleRadius=this._vf.nozzleRadius;if(this._vf.nozzleHeight>height)\n{this._vf.nozzleHeight=height;}\nvar nozzleHeight=this._vf.nozzleHeight;var beta,delta,x,z,k,j,nx,nz;delta=twoPi/sides;for(j=0,k=0;j<=sides;j++)\n{beta=j*delta;nx=Math.sin(beta);nz=-Math.cos(beta);x=outerRadius*nx;z=outerRadius*nz;this._mesh._positions[0].push(x,-center,z);this._mesh._normals[0].push(nx,0,nz);this._mesh._positions[0].push(x,(height-nozzleHeight)-center,z);this._mesh._normals[0].push(nx,0,nz);if(j>0)\n{this._mesh._indices[0].push(k);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k+2);this._mesh._indices[0].push(k+2);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k+3);k+=2;}}\nfor(j=0,k=k+2;j<=sides;j++)\n{beta=j*delta;nx=Math.sin(beta);nz=-Math.cos(beta);x=innerRadius*nx;z=innerRadius*nz;this._mesh._positions[0].push(x,-center,z);this._mesh._normals[0].push(-nx,0,-nz);this._mesh._positions[0].push(x,(height-nozzleHeight)-center,z);this._mesh._normals[0].push(-nx,0,-nz);if(j>0)\n{this._mesh._indices[0].push(k+2);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k);this._mesh._indices[0].push(k+3);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k+2);k+=2;}}\nfor(j=0,k=k+2;j<=sides;j++)\n{beta=j*delta;nx=Math.sin(beta);nz=-Math.cos(beta);x=outerRadius*nx;z=outerRadius*nz;this._mesh._positions[0].push(x,-center,z);this._mesh._normals[0].push(0,-1,0);x=innerRadius*nx;z=innerRadius*nz;this._mesh._positions[0].push(x,-center,z);this._mesh._normals[0].push(0,-1,0);if(j>0)\n{this._mesh._indices[0].push(k+2);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k);this._mesh._indices[0].push(k+3);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k+2);k+=2;}}\nfor(j=0,k=k+2;j<=sides;j++)\n{beta=j*delta;nx=Math.sin(beta);nz=-Math.cos(beta);x=nozzleRadius*nx;z=nozzleRadius*nz;this._mesh._positions[0].push(x,(height-nozzleHeight)-center,z);this._mesh._normals[0].push(nx,0,nz);this._mesh._positions[0].push(x,center,z);this._mesh._normals[0].push(nx,0,nz);if(j>0)\n{this._mesh._indices[0].push(k);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k+2);this._mesh._indices[0].push(k+2);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k+3);k+=2;}}\nfor(j=0,k=k+2;j<=sides;j++)\n{beta=j*delta;nx=Math.sin(beta);nz=-Math.cos(beta);x=innerRadius*nx;z=innerRadius*nz;this._mesh._positions[0].push(x,(height-nozzleHeight)-center,z);this._mesh._normals[0].push(-nx,0,-nz);this._mesh._positions[0].push(x,center,z);this._mesh._normals[0].push(-nx,0,-nz);if(j>0)\n{this._mesh._indices[0].push(k+2);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k);this._mesh._indices[0].push(k+3);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k+2);k+=2;}}\nfor(j=0,k=k+2;j<=sides;j++)\n{beta=j*delta;nx=Math.sin(beta);nz=-Math.cos(beta);x=nozzleRadius*nx;z=nozzleRadius*nz;this._mesh._positions[0].push(x,(height-nozzleHeight)-center,z);this._mesh._normals[0].push(0,-1,0);x=outerRadius*nx;z=outerRadius*nz;this._mesh._positions[0].push(x,(height-nozzleHeight)-center,z);this._mesh._normals[0].push(0,-1,0);if(j>0)\n{this._mesh._indices[0].push(k+2);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k);this._mesh._indices[0].push(k+3);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k+2);k+=2;}}\nfor(j=0,k=k+2;j<=sides;j++)\n{beta=j*delta;nx=Math.sin(beta);nz=-Math.cos(beta);x=nozzleRadius*nx;z=nozzleRadius*nz;this._mesh._positions[0].push(x,center,z);this._mesh._normals[0].push(0,1,0);x=innerRadius*nx;z=innerRadius*nz;this._mesh._positions[0].push(x,center,z);this._mesh._normals[0].push(0,1,0);if(j>0)\n{this._mesh._indices[0].push(k);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k+2);this._mesh._indices[0].push(k+2);this._mesh._indices[0].push(k+1);this._mesh._indices[0].push(k+3);k+=2;}}\nthis.invalidateVolume();this._mesh._numFaces=this._mesh._indices[0].length/3;this._mesh._numCoords=this._mesh._positions[0].length/3;},fieldChanged:function(fieldName)\n{if(fieldName==\"nozzleHeight\"||fieldName==\"nozzleRadius\"||fieldName==\"height\"||fieldName==\"outerRadius\"||fieldName==\"innerRadius\"||fieldName==\"subdivision\")\n{this.rebuildGeometry();Array.forEach(this._parentNodes,function(node){node.setAllDirty();node.invalidateVolume();});}}}));x3dom.registerNodeType(\"SolidOfRevolution\",\"Geometry3DExt\",defineClass(x3dom.nodeTypes.X3DGeometryNode,function(ctx){x3dom.nodeTypes.SolidOfRevolution.superClass.call(this,ctx);this.addField_SFFloat(ctx,'creaseAngle',0);this.addField_MFVec2f(ctx,'crossSection',[]);this.addField_SFFloat(ctx,'angle',2*Math.PI);this.addField_SFBool(ctx,'caps',true);this.addField_SFFloat(ctx,'subdivision',32);this._origCCW=this._vf.ccw;this.rebuildGeometry();},{rebuildGeometry:function()\n{this._mesh._positions[0]=[];this._mesh._normals[0]=[];this._mesh._texCoords[0]=[];this._mesh._indices[0]=[];var twoPi=2.0*Math.PI;if(this._vf.angle<-twoPi)\nthis._vf.angle=-twoPi;else if(this._vf.angle>twoPi)\nthis._vf.angle=twoPi;var crossSection=this._vf.crossSection,angle=this._vf.angle,steps=this._vf.subdivision;var i,j,k,l,m,n=crossSection.length;if(n<1){x3dom.debug.logWarning(\"SolidOfRevolution requires crossSection curve.\");return;}\nvar loop=(n>2)?crossSection[0].equals(crossSection[n-1],x3dom.fields.Eps):false;var fullRevolution=(twoPi-Math.abs(angle)<=x3dom.fields.Eps);var alpha,delta=angle/steps;var positions=[],baseCurve=[];this._vf.ccw=(angle<0)?this._origCCW:!this._origCCW;if(!loop)\n{if(Math.abs(crossSection[n-1].y)>x3dom.fields.Eps){crossSection.push(new x3dom.fields.SFVec2f(crossSection[n-1].x,0));}\nif(Math.abs(crossSection[0].y)>x3dom.fields.Eps){crossSection.unshift(new x3dom.fields.SFVec2f(crossSection[0].x,0));}\nn=crossSection.length;}\nvar pos=null,lastPos=null,penultimatePos=null;var duplicate=[];for(j=0;j<n;j++)\n{if(pos){if(lastPos){penultimatePos=lastPos;}\nlastPos=pos;}\npos=new x3dom.fields.SFVec3f(crossSection[j].x,0,crossSection[j].y);if(j>=2)\n{alpha=pos.subtract(lastPos).normalize();alpha=alpha.dot(lastPos.subtract(penultimatePos).normalize());alpha=Math.abs(Math.cos(alpha));if(alpha>this._vf.creaseAngle)\n{baseCurve.push(x3dom.fields.SFVec3f.copy(lastPos));duplicate.push(true);}}\nbaseCurve.push(pos);duplicate.push(false);}\nn=baseCurve.length;for(i=0,alpha=0;i<=steps;i++,alpha+=delta)\n{var mat=x3dom.fields.SFMatrix4f.rotationX(alpha);for(j=0;j<n;j++)\n{pos=mat.multMatrixPnt(baseCurve[j]);positions.push(pos);this._mesh._positions[0].push(pos.x,pos.y,pos.z);if(i>0&&j>0)\n{this._mesh._indices[0].push((i-1)*n+(j-1),(i-1)*n+j,i*n+j);this._mesh._indices[0].push(i*n+j,i*n+(j-1),(i-1)*n+(j-1));}}}\nif(!fullRevolution&&this._vf.caps==true)\n{var linklist=new x3dom.DoublyLinkedList();m=this._mesh._positions[0].length/3;for(j=0,i=0;j<n;j++)\n{if(!duplicate[j])\n{linklist.appendNode(new x3dom.DoublyLinkedList.ListNode(positions[j],i++));pos=positions[j];this._mesh._positions[0].push(pos.x,pos.y,pos.z);}}\nvar linklist_indices=x3dom.EarClipping.getIndexes(linklist);for(j=linklist_indices.length-1;j>=0;j--)\n{this._mesh._indices[0].push(m+linklist_indices[j]);}\nm=this._mesh._positions[0].length/3;for(j=0;j<n;j++)\n{if(!duplicate[j])\n{pos=positions[n*steps+j];this._mesh._positions[0].push(pos.x,pos.y,pos.z);}}\nfor(j=0;j<linklist_indices.length;j++)\n{this._mesh._indices[0].push(m+linklist_indices[j]);}}\nthis._mesh.calcNormals(Math.PI,this._vf.ccw);if(fullRevolution)\n{m=3*n*steps;for(j=0;j<n;j++)\n{k=3*j;this._mesh._normals[0][m+k]=this._mesh._normals[0][k];this._mesh._normals[0][m+k+1]=this._mesh._normals[0][k+1];this._mesh._normals[0][m+k+2]=this._mesh._normals[0][k+2];}}\nthis._mesh.calcTexCoords(\"\");this.invalidateVolume();this._mesh._numFaces=this._mesh._indices[0].length/3;this._mesh._numCoords=this._mesh._positions[0].length/3;},fieldChanged:function(fieldName)\n{if(fieldName==\"crossSection\"||fieldName==\"angle\"||fieldName==\"caps\"||fieldName==\"subdivision\"||fieldName==\"creaseAngle\")\n{this.rebuildGeometry();Array.forEach(this._parentNodes,function(node){node.setAllDirty();node.invalidateVolume();});}}}));x3dom.registerNodeType(\"SphereSegment\",\"Geometry3DExt\",defineClass(x3dom.nodeTypes.X3DSpatialGeometryNode,function(ctx){x3dom.nodeTypes.SphereSegment.superClass.call(this,ctx);this.addField_SFFloat(ctx,'radius',1);this.addField_MFFloat(ctx,'longitude',[]);this.addField_MFFloat(ctx,'latitude',[]);this.addField_SFVec2f(ctx,'stepSize',1,1);var r=this._vf.radius;var longs=this._vf.longitude;var lats=this._vf.latitude;var subx=longs.length,suby=lats.length;var first,second;var latNumber,longNumber;var latitudeBands=suby;var longitudeBands=subx;var theta,sinTheta,cosTheta;var phi,sinPhi,cosPhi;var x,y,z,u,v;for(latNumber=0;latNumber<=latitudeBands;latNumber++){theta=((lats[latNumber]+90)*Math.PI)/180;sinTheta=Math.sin(theta);cosTheta=Math.cos(theta);for(longNumber=0;longNumber<=longitudeBands;longNumber++){phi=((longs[longNumber])*Math.PI)/180;sinPhi=Math.sin(phi);cosPhi=Math.cos(phi);x=-cosPhi*sinTheta;y=-cosTheta;z=-sinPhi*sinTheta;u=longNumber/(longitudeBands-1);v=latNumber/(latitudeBands-1);this._mesh._positions[0].push(r*x,r*y,r*z);this._mesh._normals[0].push(x,y,z);this._mesh._texCoords[0].push(u,v);}}\nfor(latNumber=0;latNumber<latitudeBands;latNumber++){for(longNumber=0;longNumber<longitudeBands;longNumber++){first=(latNumber*(longitudeBands+1))+longNumber;second=first+longitudeBands+1;this._mesh._indices[0].push(first);this._mesh._indices[0].push(second);this._mesh._indices[0].push(first+1);this._mesh._indices[0].push(second);this._mesh._indices[0].push(second+1);this._mesh._indices[0].push(first+1);}}\nthis._mesh._invalidate=true;this._mesh._numFaces=this._mesh._indices[0].length/3;this._mesh._numCoords=this._mesh._positions[0].length/3;}));x3dom.registerNodeType(\"ElevationGrid\",\"Geometry3DExt\",defineClass(x3dom.nodeTypes.X3DGeometryNode,function(ctx){x3dom.nodeTypes.ElevationGrid.superClass.call(this,ctx);this.addField_SFBool(ctx,'colorPerVertex',true);this.addField_SFBool(ctx,'normalPerVertex',true);this.addField_SFFloat(ctx,'creaseAngle',0);this.addField_MFNode('attrib',x3dom.nodeTypes.X3DVertexAttributeNode);this.addField_SFNode('normal',x3dom.nodeTypes.Normal);this.addField_SFNode('color',x3dom.nodeTypes.X3DColorNode);this.addField_SFNode('texCoord',x3dom.nodeTypes.X3DTextureCoordinateNode);this.addField_MFFloat(ctx,'height',[]);this.addField_SFInt32(ctx,'xDimension',0);this.addField_SFFloat(ctx,'xSpacing',1.0);this.addField_SFInt32(ctx,'zDimension',0);this.addField_SFFloat(ctx,'zSpacing',1.0);},{nodeChanged:function()\n{this._mesh._indices[0]=[];this._mesh._positions[0]=[];this._mesh._normals[0]=[];this._mesh._texCoords[0]=[];this._mesh._colors[0]=[];var x=0,y=0;var subx=this._vf.xDimension-1;var suby=this._vf.zDimension-1;var h=this._vf.height;x3dom.debug.assert((h.length>=this._vf.xDimension*this._vf.zDimension),\"Too few height values for given x/zDimension!\");var normals=null,texCoords=null,colors=null;if(this._cf.normal.node){normals=this._cf.normal.node._vf.vector;}\nvar numTexComponents=2;var texMode;var texCoordNode=this._cf.texCoord.node;if(x3dom.isa(texCoordNode,x3dom.nodeTypes.MultiTextureCoordinate)){if(texCoordNode._cf.texCoord.nodes.length)\ntexCoordNode=texCoordNode._cf.texCoord.nodes[0];}\nif(texCoordNode){if(texCoordNode._vf.point){texCoords=texCoordNode._vf.point;if(x3dom.isa(texCoordNode,x3dom.nodeTypes.TextureCoordinate3D)){numTexComponents=3;}}\nelse if(texCoordNode._vf.mode){texMode=texCoordNode._vf.mode;}}\nvar numColComponents=3;if(this._cf.color.node){colors=this._cf.color.node._vf.color;if(x3dom.isa(this._cf.color.node,x3dom.nodeTypes.ColorRGBA)){numColComponents=4;}}\nvar c=0;var faceCnt=0;for(y=0;y<=suby;y++)\n{for(x=0;x<=subx;x++)\n{this._mesh._positions[0].push(x*this._vf.xSpacing);this._mesh._positions[0].push(h[c]);this._mesh._positions[0].push(y*this._vf.zSpacing);if(normals){if(this._vf.normalPerVertex){this._mesh._normals[0].push(normals[c].x);this._mesh._normals[0].push(normals[c].y);this._mesh._normals[0].push(normals[c].z);}}\nif(texCoords){this._mesh._texCoords[0].push(texCoords[c].x);this._mesh._texCoords[0].push(texCoords[c].y);if(numTexComponents===3){this._mesh._texCoords[0].push(texCoords[c].z);}}\nelse{this._mesh._texCoords[0].push(x/subx);this._mesh._texCoords[0].push(y/suby);}\nif(colors){if(this._vf.colorPerVertex){this._mesh._colors[0].push(colors[c].r);this._mesh._colors[0].push(colors[c].g);this._mesh._colors[0].push(colors[c].b);if(numColComponents===4){this._mesh._colors[0].push(colors[c].a);}}}\nc++;}}\nfor(y=1;y<=suby;y++){for(x=0;x<subx;x++){this._mesh._indices[0].push((y-1)*(subx+1)+x);this._mesh._indices[0].push(y*(subx+1)+x);this._mesh._indices[0].push((y-1)*(subx+1)+x+1);this._mesh._indices[0].push(y*(subx+1)+x);this._mesh._indices[0].push(y*(subx+1)+x+1);this._mesh._indices[0].push((y-1)*(subx+1)+x+1);}}\nif(!normals)\nthis._mesh.calcNormals(Math.PI,this._vf.ccw);if(texMode){this._mesh.calcTexCoords(texMode);}\nthis.invalidateVolume();this._mesh._numTexComponents=numTexComponents;this._mesh._numColComponents=numColComponents;this._mesh._numFaces=this._mesh._indices[0].length/3;this._mesh._numCoords=this._mesh._positions[0].length/3;},fieldChanged:function(fieldName)\n{var i,n;var normals=null;if(this._cf.normal.node){normals=this._cf.normal.node._vf.vector;}\nif(fieldName==\"height\")\n{n=this._mesh._positions[0].length/3;var h=this._vf.height;for(i=0;i<n;i++){this._mesh._positions[0][3*i+1]=h[i];}\nif(!normals){this._mesh._normals[0]=[];this._mesh.calcNormals(Math.PI,this._vf.ccw);}\nthis.invalidateVolume();Array.forEach(this._parentNodes,function(node){node._dirty.positions=true;if(!normals)\nnode._dirty.normals=true;node.invalidateVolume();});}\nelse if(fieldName==\"xSpacing\"||fieldName==\"zSpacing\")\n{for(var y=0;y<this._vf.zDimension;y++){for(var x=0;x<this._vf.xDimension;x++){var j=3*(y*this._vf.xDimension+x);this._mesh._positions[0][j]=x*this._vf.xSpacing;this._mesh._positions[0][j+2]=y*this._vf.zSpacing;}}\nif(!normals){this._mesh._normals[0]=[];this._mesh.calcNormals(Math.PI,this._vf.ccw);}\nthis.invalidateVolume();Array.forEach(this._parentNodes,function(node){node._dirty.positions=true;if(!normals)\nnode._dirty.normals=true;node.invalidateVolume();});}\nelse if(fieldName==\"xDimension\"||fieldName==\"zDimension\")\n{this.nodeChanged();Array.forEach(this._parentNodes,function(node){node.setGeoDirty();node.invalidateVolume();});}\nelse if(fieldName==\"color\")\n{n=this._mesh._colors[0].length/3;var c=this._cf.color.node._vf.color;for(i=0;i<n;i++){this._mesh._colors[0][i*3]=c[i].r;this._mesh._colors[0][i*3+1]=c[i].g;this._mesh._colors[0][i*3+2]=c[i].b;}\nArray.forEach(this._parentNodes,function(node){node._dirty.colors=true;});}}}));x3dom.registerNodeType(\"Extrusion\",\"Geometry3DExt\",defineClass(x3dom.nodeTypes.X3DGeometryNode,function(ctx){x3dom.nodeTypes.Extrusion.superClass.call(this,ctx);this.addField_SFBool(ctx,'beginCap',true);this.addField_SFBool(ctx,'endCap',true);this.addField_SFBool(ctx,'convex',true);this.addField_SFFloat(ctx,'creaseAngle',0);this.addField_MFVec2f(ctx,'crossSection',[new x3dom.fields.SFVec2f(1,1),new x3dom.fields.SFVec2f(1,-1),new x3dom.fields.SFVec2f(-1,-1),new x3dom.fields.SFVec2f(-1,1),new x3dom.fields.SFVec2f(1,1)]);this.addField_MFRotation(ctx,'orientation',[new x3dom.fields.Quaternion(0,0,0,1)]);this.addField_MFVec2f(ctx,'scale',[new x3dom.fields.SFVec2f(1,1)]);this.addField_MFVec3f(ctx,'spine',[new x3dom.fields.SFVec3f(0,0,0),new x3dom.fields.SFVec3f(0,1,0)]);this.addField_SFFloat(ctx,'height',0);this.rebuildGeometry();},{rebuildGeometry:function()\n{this._mesh._positions[0]=[];this._mesh._normals[0]=[];this._mesh._texCoords[0]=[];this._mesh._indices[0]=[];var i,j,n,m,len,sx=1,sy=1;var spine=this._vf.spine,scale=this._vf.scale,orientation=this._vf.orientation,crossSection=this._vf.crossSection;var positions=[],index=0;m=spine.length;n=crossSection.length;if(this._vf.height>0){spine[0]=new x3dom.fields.SFVec3f(0,0,0);spine[1]=new x3dom.fields.SFVec3f(0,this._vf.height,0);m=2;}\nvar x,y,z;var last_z=new x3dom.fields.SFVec3f(0,0,1);if(m>2){for(i=1;i<m-1;i++){var last_z_candidate=spine[i+1].subtract(spine[i]).cross(spine[i-1].subtract(spine[i]));if(last_z_candidate.length()>x3dom.fields.Eps){last_z=x3dom.fields.SFVec3f.copy(last_z_candidate.normalize());break;}}}\nvar texCoordV=0;var texCoordsV=[0];for(i=1;i<m;i++){var v=spine[i].subtract(spine[i-1]).length();texCoordV=texCoordV+v;texCoordsV[i]=texCoordV;}\nvar texCoordU=0;var texCoordsU=[0];var maxTexU_x=0,minTexU_x=0;var maxTexU_z=0,minTexU_z=0;for(j=1;j<n;j++){var u=crossSection[j].subtract(crossSection[j-1]).length();texCoordU=texCoordU+u;texCoordsU[j]=texCoordU;if(j==1){maxTexU_x=minTexU_x=crossSection[j-1].x;maxTexU_z=minTexU_z=crossSection[j-1].y;}\nif(maxTexU_x<crossSection[j].x){maxTexU_x=crossSection[j].x;}\nif(minTexU_x>crossSection[j].x){minTexU_x=crossSection[j].x;}\nif(maxTexU_z<crossSection[j].y){maxTexU_z=crossSection[j].y;}\nif(minTexU_z>crossSection[j].y){minTexU_z=crossSection[j].y;}}\nif(Math.abs(maxTexU_x-minTexU_x)<Math.abs(maxTexU_z-minTexU_z)){var helpMax=maxTexU_x;var helpMin=minTexU_x;maxTexU_x=maxTexU_z;minTexU_x=minTexU_z;maxTexU_z=helpMax;minTexU_z=helpMin;}\nvar diffTexU_x=Math.abs(maxTexU_x-minTexU_x);var diffTexU_z=Math.abs(maxTexU_z-minTexU_z);var spineClosed=(m>2)?spine[0].equals(spine[spine.length-1],x3dom.fields.Eps):false;for(i=0;i<m;i++){if((len=scale.length)>0){if(i<len){sx=scale[i].x;sy=scale[i].y;}\nelse{sx=scale[len-1].x;sy=scale[len-1].y;}}\nfor(j=0;j<n;j++){var pos=new x3dom.fields.SFVec3f(crossSection[j].x*sx+spine[i].x,spine[i].y,crossSection[j].y*sy+spine[i].z);if(m>2){if(i==0){if(spineClosed){y=spine[1].subtract(spine[m-2]);z=spine[1].subtract(spine[0]).cross(spine[m-2].subtract(spine[0]));}\nelse{y=spine[1].subtract(spine[0]);z=spine[2].subtract(spine[1]).cross(spine[0].subtract(spine[1]));}\nif(z.length()>x3dom.fields.Eps){last_z=x3dom.fields.SFVec3f.copy(z);}}\nelse if(i==m-1){if(spineClosed){y=spine[1].subtract(spine[m-2]);z=spine[1].subtract(spine[0]).cross(spine[m-2].subtract(spine[0]));}\nelse{y=spine[m-1].subtract(spine[m-2]);z=x3dom.fields.SFVec3f.copy(last_z);}}\nelse{y=spine[i+1].subtract(spine[i-1]);z=y.cross(spine[i-1].subtract(spine[i]));}\nif(z.dot(last_z)<0){z=z.negate();}\ny=y.normalize();z=z.normalize();if(z.length()<=x3dom.fields.Eps){z=x3dom.fields.SFVec3f.copy(last_z);}\nif(i!=0){last_z=x3dom.fields.SFVec3f.copy(z);}\nx=y.cross(z).normalize();var baseMat=x3dom.fields.SFMatrix4f.identity();baseMat.setValue(x,y,z);var rotMat=(i<orientation.length)?orientation[i].toMatrix():((orientation.length>0)?orientation[orientation.length-1].toMatrix():x3dom.fields.SFMatrix4f.identity());pos=pos.subtract(spine[i]);pos=baseMat.multMatrixPnt(rotMat.multMatrixPnt(pos));pos=pos.add(spine[i]);}\npos.crossSection=crossSection[j];positions.push(pos);if(this._vf.creaseAngle<=x3dom.fields.Eps){if(i>0&&j>0){var iPos=(i-1)*n+(j-1);this._mesh._positions[0].push(positions[iPos].x,positions[iPos].y,positions[iPos].z);this._mesh._texCoords[0].push(texCoordsU[j-1]/texCoordU,texCoordsV[i-1]/texCoordV);iPos=(i-1)*n+j;this._mesh._positions[0].push(positions[iPos].x,positions[iPos].y,positions[iPos].z);this._mesh._texCoords[0].push(texCoordsU[j]/texCoordU,texCoordsV[i-1]/texCoordV);iPos=i*n+j;this._mesh._positions[0].push(positions[iPos].x,positions[iPos].y,positions[iPos].z);this._mesh._texCoords[0].push(texCoordsU[j]/texCoordU,texCoordsV[i]/texCoordV);this._mesh._indices[0].push(index++,index++,index++);this._mesh._positions[0].push(positions[iPos].x,positions[iPos].y,positions[iPos].z);this._mesh._texCoords[0].push(texCoordsU[j]/texCoordU,texCoordsV[i]/texCoordV);iPos=i*n+(j-1);this._mesh._positions[0].push(positions[iPos].x,positions[iPos].y,positions[iPos].z);this._mesh._texCoords[0].push(texCoordsU[j-1]/texCoordU,texCoordsV[i]/texCoordV);iPos=(i-1)*n+(j-1);this._mesh._positions[0].push(positions[iPos].x,positions[iPos].y,positions[iPos].z);this._mesh._texCoords[0].push(texCoordsU[j-1]/texCoordU,texCoordsV[i-1]/texCoordV);this._mesh._indices[0].push(index++,index++,index++);}}\nelse{this._mesh._positions[0].push(pos.x,pos.y,pos.z);this._mesh._texCoords[0].push(texCoordsU[j]/texCoordU,texCoordsV[i]/texCoordV);if(i>0&&j>0){this._mesh._indices[0].push((i-1)*n+(j-1),(i-1)*n+j,i*n+j);this._mesh._indices[0].push(i*n+j,i*n+(j-1),(i-1)*n+(j-1));}}}\nif(i==m-1){var p0,l,startPos;var linklist,linklist_indices;if(this._vf.beginCap){linklist=new x3dom.DoublyLinkedList();l=this._mesh._positions[0].length/3;for(j=0;j<n;j++){linklist.appendNode(new x3dom.DoublyLinkedList.ListNode(positions[j],j));if(this._vf.creaseAngle>x3dom.fields.Eps){p0=positions[j];this._mesh._positions[0].push(p0.x,p0.y,p0.z);this._mesh._texCoords[0].push((p0.crossSection.x-minTexU_x)/diffTexU_x,(p0.crossSection.y-minTexU_z)/diffTexU_z);}}\nif(this._vf.ccw==false)\nlinklist.invert();linklist_indices=x3dom.EarClipping.getIndexes(linklist);for(j=linklist_indices.length-1;j>=0;j--){if(this._vf.creaseAngle>x3dom.fields.Eps){this._mesh._indices[0].push(l+linklist_indices[j]);}\nelse{p0=positions[linklist_indices[j]];this._mesh._positions[0].push(p0.x,p0.y,p0.z);this._mesh._texCoords[0].push((p0.crossSection.x-minTexU_x)/diffTexU_x,(p0.crossSection.y-minTexU_z)/diffTexU_z);this._mesh._indices[0].push(index++);}}}\nif(this._vf.endCap){linklist=new x3dom.DoublyLinkedList();startPos=(m-1)*n;l=this._mesh._positions[0].length/3;for(j=0;j<n;j++){linklist.appendNode(new x3dom.DoublyLinkedList.ListNode(positions[startPos+j],startPos+j));if(this._vf.creaseAngle>x3dom.fields.Eps){p0=positions[startPos+j];this._mesh._positions[0].push(p0.x,p0.y,p0.z);this._mesh._texCoords[0].push((p0.crossSection.x-minTexU_x)/diffTexU_x,(p0.crossSection.y-minTexU_z)/diffTexU_z);}}\nif(this._vf.ccw==false)\nlinklist.invert();linklist_indices=x3dom.EarClipping.getIndexes(linklist);for(j=0;j<linklist_indices.length;j++){if(this._vf.creaseAngle>x3dom.fields.Eps){this._mesh._indices[0].push(l+(linklist_indices[j]-startPos));}\nelse{p0=positions[linklist_indices[j]];this._mesh._positions[0].push(p0.x,p0.y,p0.z);this._mesh._texCoords[0].push((p0.crossSection.x-minTexU_x)/diffTexU_x,(p0.crossSection.y-minTexU_z)/diffTexU_z);this._mesh._indices[0].push(index++);}}}}}\nthis._mesh.calcNormals(this._vf.creaseAngle,this._vf.ccw);this.invalidateVolume();this._mesh._numFaces=this._mesh._indices[0].length/3;this._mesh._numCoords=this._mesh._positions[0].length/3;},fieldChanged:function(fieldName)\n{if(fieldName==\"beginCap\"||fieldName==\"endCap\"||fieldName==\"crossSection\"||fieldName==\"orientation\"||fieldName==\"scale\"||fieldName==\"spine\"||fieldName==\"height\"||fieldName==\"creaseAngle\")\n{this.rebuildGeometry();Array.forEach(this._parentNodes,function(node){node.setAllDirty();node.invalidateVolume();});}}}));x3dom.registerNodeType(\"HAnimDisplacer\",\"H-Anim\",defineClass(x3dom.nodeTypes.X3DGeometricPropertyNode,function(ctx){x3dom.nodeTypes.HAnimDisplacer.superClass.call(this,ctx);this.addField_SFString(ctx,'name',\"\");this.addField_SFFloat(ctx,'weight',0);this.addField_MFInt32(ctx,'coordIndex',[]);this.addField_MFVec3f(ctx,'displacements',[]);x3dom.debug.logWarning(\"HAnimDisplacer in Segments NYI.\");}));x3dom.registerNodeType(\"HAnimJoint\",\"H-Anim\",defineClass(x3dom.nodeTypes.Transform,function(ctx){x3dom.nodeTypes.HAnimJoint.superClass.call(this,ctx);this.addField_SFString(ctx,'name',\"\");this.addField_MFNode('displacers',x3dom.nodeTypes.HAnimDisplacer);this.addField_SFRotation(ctx,'limitOrientation','0 0 1 0');this.addField_MFFloat(ctx,'llimit',[]);this.addField_MFFloat(ctx,'ulimit',[]);this.addField_MFInt32(ctx,'skinCoordIndex',[]);this.addField_MFFloat(ctx,'skinCoordWeight',[]);this.addField_MFFloat(ctx,'stiffness',[0,0,0]);},{nodeChanged:function()\n{this._humanoid=_findRoot(this._xmlNode);function _findRoot(domNode){var parent=domNode.parentNode._x3domNode;if(x3dom.isa(parent,x3dom.nodeTypes.Scene))return false\nif(x3dom.isa(parent,x3dom.nodeTypes.HAnimHumanoid))return parent\nreturn _findRoot(parent._xmlNode);}},collectDrawableObjects:function(transform,drawableCollection,singlePath,invalidateCache,planeMask,clipPlanes)\n{if(singlePath&&(this._parentNodes.length>1))\nsinglePath=false;if(singlePath&&(invalidateCache=invalidateCache||this.cacheInvalid()))\nthis.invalidateCache();planeMask=drawableCollection.cull(transform,this.graphState(),singlePath,planeMask);var skinCoord=this._humanoid._cf.skinCoord.node;if(planeMask<0&&!skinCoord){return;}\nvar cnode,childTransform;if(singlePath){if(!this._graph.globalMatrix){this._graph.globalMatrix=this.transformMatrix(transform);}\nchildTransform=this._graph.globalMatrix;}\nelse{childTransform=this.transformMatrix(transform);}\nvar n=this._childNodes.length;if(x3dom.nodeTypes.ClipPlane.count>0){var localClipPlanes=[];for(var j=0;j<n;j++){if((cnode=this._childNodes[j])){if(x3dom.isa(cnode,x3dom.nodeTypes.ClipPlane)&&cnode._vf.on&&cnode._vf.enabled){localClipPlanes.push({plane:cnode,trafo:childTransform});}}}\nclipPlanes=localClipPlanes.concat(clipPlanes);}\nvar skinCoordIndex,skinCoordWeight,humanoid,trafo,displacers;if(skinCoord){humanoid=this._humanoid;trafo=humanoid.getCurrentTransform().inverse().mult(childTransform);displacers=this._cf.displacers.nodes;if(displacers.length!==0){displacers.forEach(function(displacer){var weight=displacer._vf.weight;var MFdisplacements=displacer._vf.displacements;var offsets=MFdisplacements.length;if(offsets!==0){displacer._vf.coordIndex.forEach(function(coordIndex,i){skinCoord._vf.point[coordIndex]=skinCoord._vf.point[coordIndex].addScaled(trafo.multMatrixVec(MFdisplacements[i%offsets]),weight);});}});}\nskinCoordIndex=this._vf.skinCoordIndex;if(skinCoordIndex.length!==0){skinCoordWeight=this._vf.skinCoordWeight;skinCoordIndex.forEach(function(coordIndex,i){var restCoord=humanoid._restCoords[coordIndex];skinCoord._vf.point[coordIndex]=skinCoord._vf.point[coordIndex].add(trafo.multMatrixPnt(restCoord).subtract(restCoord).multiply(skinCoordWeight[Math.min(i,skinCoordWeight.length-1)]));});}}\nvar skinNormal=this._humanoid._cf.skinNormal.node;if(skinNormal){skinCoordIndex=this._vf.skinCoordIndex;if(skinCoordIndex.length!==0){skinCoordWeight=this._vf.skinCoordWeight;humanoid=this._humanoid;trafo=humanoid.getCurrentTransform().inverse().mult(childTransform).inverse().transpose();skinCoordIndex.forEach(function(coordIndex,i){var restNormal=humanoid._restNormals[coordIndex];skinNormal._vf.vector[coordIndex]=skinNormal._vf.vector[coordIndex].add(trafo.multMatrixVec(restNormal).subtract(restNormal).multiply(skinCoordWeight[Math.min(i,skinCoordWeight.length-1)]));});}}\nfor(var i=0;i<n;i++){if((cnode=this._childNodes[i])){cnode.collectDrawableObjects(childTransform,drawableCollection,singlePath,invalidateCache,planeMask,clipPlanes);}}}}));x3dom.registerNodeType(\"HAnimSegment\",\"H-Anim\",defineClass(x3dom.nodeTypes.X3DGroupingNode,function(ctx){x3dom.nodeTypes.HAnimSegment.superClass.call(this,ctx);this.addField_SFString(ctx,'name',\"\");this.addField_SFVec3f(ctx,'centerOfMass',0,0,0);this.addField_SFFloat(ctx,'mass',0);this.addField_MFFloat(ctx,'momentsOfInertia',[0,0,0,0,0,0,0,0,0]);this.addField_SFNode('coord',x3dom.nodeTypes.X3DCoordinateNode);this.addField_MFNode('displacers',x3dom.nodeTypes.HAnimDisplacer);},{}));x3dom.registerNodeType(\"HAnimSite\",\"H-Anim\",defineClass(x3dom.nodeTypes.Transform,function(ctx){x3dom.nodeTypes.HAnimSite.superClass.call(this,ctx);this.addField_SFString(ctx,'name',\"\");}));x3dom.registerNodeType(\"HAnimHumanoid\",\"H-Anim\",defineClass(x3dom.nodeTypes.Transform,function(ctx){x3dom.nodeTypes.HAnimHumanoid.superClass.call(this,ctx);this.addField_SFString(ctx,'name',\"\");this.addField_SFString(ctx,'version',\"\");this.addField_MFString(ctx,'info',[]);this.addField_MFNode('joints',x3dom.nodeTypes.HAnimJoint);this.addField_MFNode('segments',x3dom.nodeTypes.HAnimSegment);this.addField_MFNode('sites',x3dom.nodeTypes.HAnimSite);this.addField_MFNode('skeleton',x3dom.nodeTypes.HAnimJoint);this.addField_MFNode('skin',x3dom.nodeTypes.X3DChildNode);this.addField_SFNode('skinCoord',x3dom.nodeTypes.X3DCoordinateNode);this.addField_SFNode('skinNormal',x3dom.nodeTypes.X3DNormalNode);this.addField_MFNode('viewpoints',x3dom.nodeTypes.HAnimSite);this.addField_SFString(ctx,'skeletalConfiguration','BASIC');this.addField_MFVec3f(ctx,'jointBindingPositions',[0,0,0]);this.addField_MFRotation(ctx,'jointBindingRotations',[0,0,1,0]);this.addField_MFVec3f(ctx,'jointBindingScales',[1,1,1]);this.addField_MFVec3f(ctx,'skinBindingCoords',[]);this.addField_MFVec3f(ctx,'skinBindingNormals',[]);},{collectDrawableObjects:function(transform,drawableCollection,singlePath,invalidateCache,planeMask,clipPlanes)\n{if(singlePath&&(this._parentNodes.length>1))\nsinglePath=false;if(singlePath&&(invalidateCache=invalidateCache||this.cacheInvalid()))\nthis.invalidateCache();planeMask=drawableCollection.cull(transform,this.graphState(),singlePath,planeMask);if(planeMask<0){return;}\nvar cnode,childTransform;if(singlePath){if(!this._graph.globalMatrix){this._graph.globalMatrix=this.transformMatrix(transform);}\nchildTransform=this._graph.globalMatrix;}\nelse{childTransform=this.transformMatrix(transform);}\nvar n=this._childNodes.length;if(x3dom.nodeTypes.ClipPlane.count>0){var localClipPlanes=[];for(var j=0;j<n;j++){if((cnode=this._childNodes[j])){if(x3dom.isa(cnode,x3dom.nodeTypes.ClipPlane)&&cnode._vf.on&&cnode._vf.enabled){localClipPlanes.push({plane:cnode,trafo:childTransform});}}}\nclipPlanes=localClipPlanes.concat(clipPlanes);}\nif(this._cf.skinCoord.node)\nthis._cf.skinCoord.node._vf.point.setValues(this._restCoords);if(this._cf.skinNormal.node)\nthis._cf.skinNormal.node._vf.vector.setValues(this._restNormals);this._cf.skeleton.nodes.forEach(function(cnode){cnode.collectDrawableObjects(childTransform,drawableCollection,singlePath,invalidateCache,planeMask,clipPlanes);});this._cf.skin.nodes.forEach(function(cnode){cnode.collectDrawableObjects(childTransform,drawableCollection,singlePath,invalidateCache,planeMask,clipPlanes);});if(this._cf.skinCoord.node){this._cf.skinCoord.node._parentNodes.forEach(function(node){node.fieldChanged('coord');});}},nodeChanged:function()\n{if(this._cf.skinCoord.node)\nthis._restCoords=this._cf.skinCoord.node._vf.point.copy();if(this._cf.skinNormal.node)\nthis._restNormals=this._cf.skinNormal.node._vf.vector.copy();}}));x3dom.registerNodeType(\"X3DParametricGeometryNode\",\"NURBS\",defineClass(x3dom.nodeTypes.X3DGeometryNode,function(ctx){x3dom.nodeTypes.X3DParametricGeometryNode.superClass.call(this,ctx);},{}));x3dom.registerNodeType(\"X3DNurbsSurfaceGeometryNode\",\"NURBS\",defineClass(x3dom.nodeTypes.X3DParametricGeometryNode,function(ctx){x3dom.nodeTypes.X3DParametricGeometryNode.superClass.call(this,ctx);this.addField_SFInt32(ctx,'uDimension',0);this.addField_SFInt32(ctx,'vDimension',0);this.addField_SFInt32(ctx,'uOrder',3);this.addField_SFInt32(ctx,'vOrder',3);this.addField_SFFloat(ctx,'uTessellation',0.0);this.addField_SFFloat(ctx,'vTessellation',0.0);this.addField_MFDouble(ctx,'uKnot',[]);this.addField_MFDouble(ctx,'vKnot',[]);this.addField_MFDouble(ctx,'weight',[]);this.addField_SFNode('controlPoint',x3dom.nodeTypes.X3DCoordinateNode);this.addField_SFBool(ctx,'uClosed',false);this.addField_SFBool(ctx,'vClosed',false);this.addField_SFNode('texCoord',x3dom.nodeTypes.X3DTextureCoordinateNode);this.addField_SFBool(ctx,'solid',false);this.addField_SFBool(ctx,'normalPerVertex',true);this._needReRender=true;this.basisFunsCache=new Map();this.uv=[];this.lastTime=-1;},{nodeChanged:function(){this._needReRender=true;this._vf.ccw=false;this._vf.solid=false;this._vf.useGeoCache=false;if(!this._hasCoarseMesh){var its=this.createCoarseITS(this);this._mesh=its._mesh;this._hasCoarseMesh=true;}\nif(this._vf.uKnot.length!==this._vf.uDimension+this._vf.uOrder)\nthis._vf.uKnot=this.createDefaultKnots(this._vf.uDimension,this._vf.uOrder);if(this._vf.vKnot.length!==this._vf.vDimension+this._vf.vOrder)\nthis._vf.vKnot=this.createDefaultKnots(this._vf.vDimension,this._vf.vOrder);var T=[];if(this._cf.trimmingContour&&this._cf.trimmingContour.nodes.length){var len=this._cf.trimmingContour.nodes.length;for(var i=0;i<len;i++){var c2dnode=this._cf.trimmingContour.nodes[i];if(c2dnode._cf.children){T[i]=[];var trim=c2dnode._cf.children.nodes;for(var j=0;j<trim.length;j++){var tc=trim[j];if(!tc._vf.order){tc._vf.order=2;}\nif(!tc._vf.knot){var knots=[];knots.push(0);knots.push(0);for(var k=2;k<tc._vf.controlPoint.length;k++)\nknots.push(k-1);knots.push(knots[knots.length-1]+1);knots.push(knots[knots.length-1]);tc._vf.knot=knots;}\nT[i].push([tc._vf.controlPoint.length-1,tc._vf.order-1,tc._vf.knot,tc._vf.controlPoint,tc._vf.weight]);}}}}\nvar onmessage=function(e){if(e.data.length>=3&&e.data[5]>this.caller.lastTime){if(this.caller.uv.length){var data=e.data[1];var point=new x3dom.fields.MFVec3f();for(var i=0;i<data.length;i++)\npoint.push(new x3dom.fields.SFVec3f(data[i][0],data[i][1],data[i][2]));this.caller._mesh._positions[0]=point.toGL();}else{var its=this.caller.createITS(e.data,this.caller);this.caller.workerTask=null;this.caller._mesh=its._mesh;if(this.caller._nameSpace){var tasks=x3dom.tessWorkerPool.taskQueue.length;var x3de=this.caller._nameSpace.doc._x3dElem;x3de.runtime.canvas.progressText=tasks==0?\"\":\"Tesselation tasks: \"+tasks;}}\nif(this.caller._cleanupGLObjects)\nthis.caller._cleanupGLObjects(true);Array.forEach(this.caller._parentNodes,function(node){node.setAllDirty();});this.caller.basisFunsCache=e.data[3];this.caller.uv=e.data[4];this.caller.lastTime=e.data[5];}}\nvar coordNode=this._cf.controlPoint.node;var startmessage=[this._vf.uDimension-1,this._vf.vDimension-1,this._vf.uOrder-1,this._vf.vOrder-1,this._vf.uKnot,this._vf.vKnot,coordNode.getPoints(),this._vf.weight,this._vf.uTessellation,this._vf.vTessellation,T,this.basisFunsCache,this.uv,performance.now()];if(this.workerTask)\nthis.workerTask.discard=true;this.workerTask=new x3dom.WorkerTask(x3dom.tessWorkerScript,this,onmessage,startmessage);x3dom.tessWorkerPool.addWorkerTask(this.workerTask);},fieldChanged:function(fieldName){if(fieldName=='order'||fieldName=='knot'||fieldName.includes('Tessellation')){this.basisFunsCache=new Map();this.uv=[];this.nodeChanged();return}else if(this.uv.length)\nthis.nodeChanged();},createDefaultKnots:function(n,o){var knots=Array(n+o).fill(0);for(var k=o;k<n;k++)\nknots[k]=(k-1)/(n-1);for(var k=knots.length-o;k<knots.length;k++)\nknots[k]=1;return knots;},createCoarseITS:function(node){var w=node._vf.uDimension;var h=node._vf.vDimension;var coordNode=node._cf.controlPoint.node;var its=new x3dom.nodeTypes.IndexedTriangleSet();its._nameSpace=node._nameSpace;its._vf.solid=false;its._vf.ccw=false;its._cf.texCoord=node._cf.texCoord;var ind=[],i1=0,i2=w;for(var i=0;i<h-1;i++){for(var j=0;j<w-1;j++){ind.push(i1);ind.push(i1+1);ind.push(i2);ind.push(i2);ind.push(i1+1);ind.push(i2+1);i1++;i2++;}\ni1++;i2++;}\nits._vf.index=ind;its.addChild(coordNode);its.nodeChanged();its._xmlNode=node._xmlNode;return its;},createITS:function(data,node){var its=new x3dom.nodeTypes.IndexedTriangleSet();its._nameSpace=node._nameSpace;its._vf.normalPerVertex=node._vf.normalPerVertex;its._vf.solid=false;its._vf.ccw=false;its._vf.index=data[0];var co=new x3dom.nodeTypes.Coordinate();co._nameSpace=node._nameSpace;co._vf.point=new x3dom.fields.MFVec3f();for(var i=0;i<data[1].length;i++)\nco._vf.point.push(new x3dom.fields.SFVec3f(data[1][i][0],data[1][i][1],data[1][i][2]));its.addChild(co);if(node._cf.texCoord.node!==null)its._cf.texCoord=node._cf.texCoord;else{var tc=new x3dom.nodeTypes.TextureCoordinate();tc._nameSpace=node._nameSpace;tc._vf.point=new x3dom.fields.MFVec2f();for(var i=0;i<data[2].length;i++)\ntc._vf.point.push(new x3dom.fields.SFVec2f(data[2][i][0],data[2][i][1]));its.addChild(tc);}\nits.nodeChanged();its._xmlNode=node._xmlNode;return its;}}));x3dom.registerNodeType(\"NurbsPatchSurface\",\"NURBS\",defineClass(x3dom.nodeTypes.X3DNurbsSurfaceGeometryNode,function(ctx){x3dom.nodeTypes.NurbsPatchSurface.superClass.call(this,ctx);this._needReRender=true;},{nodeChanged:function(){x3dom.nodeTypes.NurbsTrimmedSurface.prototype.nodeChanged.call(this);return;}}));x3dom.registerNodeType(\"NurbsCurve\",\"NURBS\",defineClass(x3dom.nodeTypes.X3DParametricGeometryNode,function(ctx){x3dom.nodeTypes.NurbsCurve.superClass.call(this,ctx);this.addField_SFInt32(ctx,'order',3);this.addField_MFDouble(ctx,'knot',[]);this.addField_SFNode('controlPoint',x3dom.nodeTypes.X3DCoordinateNode);this.addField_MFDouble(ctx,'weight',[]);this.addField_SFInt32(ctx,'tessellation',0);this.addField_SFBool(ctx,'closed',false);this.points=[];this.uList=[];this.basisFunsCache={};this.ils=new x3dom.nodeTypes.IndexedLineSet();this.ils.addChild(new x3dom.nodeTypes.Coordinate());},{nodeChanged:function(){this._needReRender=true;this._vf.useGeoCache=false;if(!this._hasCoarseMesh){var ils=this.createCoarseILS(this);this._mesh=ils._mesh;this._hasCoarseMesh=true;}\nthis.generateGeometry();},fieldChanged:function(fieldName){Array.forEach(this._parentNodes,function(node){node._dirty.positions=true;node.invalidateVolume();});switch(fieldName){case'tessellation':this.uList=[];break;case'knot':case'order':case'closed':this.uList=[];this.basisFunsCache={};break;}\nthis.generateGeometry();},generateGeometry:function(){this.points=this._cf.controlPoint.node._vf.point;var points=this.points.length;if(this._vf.knot.length!==points+this._vf.order)this.createDefaultKnots();if(this._vf.weight.length!=points)this._vf.weight=Array(points).fill(1.0);var tessPoints=this.calcTessPoints(this._vf.tessellation,points);if(this.uList.length==0)this.uList=this.listPoints(tessPoints,this._vf.knot);var data=this.tessellate();this.createILS(data,this);this._mesh=this.ils._mesh;return;},createDefaultKnots:function(){var knots=Array(this.points.length+this._vf.order).fill(0);for(var k=this._vf.order;k<this.points.length;k++)\nknots[k]=k-1;for(var k=knots.length-this._vf.order;k<knots.length;k++)\nknots[k]=this.points.length-1;this._vf.knot=knots;},calcTessPoints:function(tess,controls){if(tess>0)return tess+1;if(tess==0)return 2*controls+1;return-tess*controls+1;},listPoints:function(points,knots){var step=knots[knots.length-1]-knots[0];step=step/(points-1);var list=[];for(var i=0;i<points;i++)list.push(knots[0]+i*step);return list;},tessellate:function(){var nurb={dimension:this.points.length-1,u:this.uList,degree:this._vf.order-1,knots:this._vf.knot,points:this.points,weights:this._vf.weight,closed:this._vf.closed};return nurb.u.map(function(u){return this.curvePoint3DH(nurb.dimension,nurb.degree,nurb.knots,nurb.points,nurb.weights,u);},this);},curvePoint3DH:function(n,p,U,P,W,u){var spanu,indu,k,i;var Nu,temp=[0,0,0,0];spanu=this.findSpan(n,p,u,U);Nu=this.basisFuns(spanu,u,p,U);indu=spanu-p;for(k=0;k<=p;k++){i=indu+k;temp[0]+=Nu[k]*P[i].x;temp[1]+=Nu[k]*P[i].y;temp[2]+=Nu[k]*P[i].z;temp[3]+=Nu[k]*W[i];}\nreturn new x3dom.fields.SFVec3f(temp[0]/temp[3],temp[1]/temp[3],temp[2]/temp[3]);},findSpan:function(n,p,u,U){var low,mid,high;if(u>=U[n])return n;if(u<=U[p])return p;low=0;high=n+1;mid=Math.floor((low+high)/2);while(u<U[mid]||u>=U[mid+1]){if(u<U[mid])high=mid;else low=mid;mid=Math.floor((low+high)/2);}\nreturn mid;},basisFuns:function(i,u,p,U){var uKey=Math.floor(u*10e10);if(this.basisFunsCache[uKey])return this.basisFunsCache[uKey];var N=[],left=[],right=[],saved,temp;var j,r;N[0]=1.0;for(j=0;j<=p;j++){left[j]=0;right[j]=0;}\nfor(j=1;j<=p;j++){left[j]=u-U[i+1-j];right[j]=U[i+j]-u;saved=0.0;for(r=0;r<j;r++){temp=N[r]/(right[r+1]+left[j-r]);N[r]=saved+right[r+1]*temp;saved=left[j-r]*temp;}\nN[j]=saved;}\nthis.basisFunsCache[uKey]=N;return N;},createCoarseILS:function(node){var coordNode=node._cf.controlPoint.node;var ils=new x3dom.nodeTypes.IndexedLineSet();ils._nameSpace=node._nameSpace;var ind=[];for(var i=0;i<coordNode._vf.point.length;i++){ind.push(i);}\nind.push(-1);ils._vf.coordIndex=ind;ils.addChild(coordNode);ils.nodeChanged();ils._xmlNode=node._xmlNode;return ils;},createILS:function(data,node){this.ils._nameSpace=node._nameSpace;this.ils._vf.coordIndex=[];var co=this.ils._cf.coord.node;co._nameSpace=node._nameSpace;co._vf.point=new x3dom.fields.MFVec3f();for(var i=0;i<data.length;i++){co._vf.point.push(data[i]);this.ils._vf.coordIndex.push(i);}\nthis.ils.nodeChanged();this.ils._xmlNode=node._xmlNode;return this.ils;}}));x3dom.registerNodeType(\"NurbsPositionInterpolator\",\"NURBS\",defineClass(x3dom.nodeTypes.X3DChildNode,function(ctx){x3dom.nodeTypes.NurbsPositionInterpolator.superClass.call(this,ctx);this.addField_SFInt32(ctx,'order',3);this.addField_MFDouble(ctx,'knot',[]);this.addField_SFNode('controlPoint',x3dom.nodeTypes.X3DCoordinateNode);this.addField_MFDouble(ctx,'weight',[]);this.addField_SFFloat(ctx,'set_fraction',0);this.points=[];},{fieldChanged:function(fieldName){if(fieldName===\"set_fraction\")\n{var value=this.getValue(this._vf.set_fraction);this.postMessage('value_changed',value);}},getValue:function(u){this.points=this._cf.controlPoint.node._vf.point;var points=this.points.length;if(this._vf.knot.length!==points+this._vf.order)this.createDefaultKnots();if(this._vf.weight.length!=points)this._vf.weight=Array(points).fill(1.0);return this.curvePoint(u);},createDefaultKnots:function(){var points=this.points.length;var knots=Array(points+this._vf.order).fill(0);for(var k=this._vf.order;k<points;k++)\nknots[k]=(k-1)/(points-1);for(var k=knots.length-this._vf.order;k<knots.length;k++)\nknots[k]=1;this._vf.knot=knots;},curvePoint:function(u){var nurb={dimension:this.points.length-1,degree:this._vf.order-1,knots:this._vf.knot,points:this.points,weights:this._vf.weight};return x3dom.nodeTypes.NurbsCurve.prototype.curvePoint3DH.call(this,nurb.dimension,nurb.degree,nurb.knots,nurb.points,nurb.weights,u);},findSpan:function(n,p,u,U){return x3dom.nodeTypes.NurbsCurve.prototype.findSpan(n,p,u,U);},basisFuns:function(i,u,p,U){var N=[],left=[],right=[],saved,temp;var j,r;N[0]=1.0;for(j=0;j<=p;j++){left[j]=0;right[j]=0;}\nfor(j=1;j<=p;j++){left[j]=u-U[i+1-j];right[j]=U[i+j]-u;saved=0.0;for(r=0;r<j;r++){temp=N[r]/(right[r+1]+left[j-r]);N[r]=saved+right[r+1]*temp;saved=left[j-r]*temp;}\nN[j]=saved;}\nreturn N;}}));x3dom.registerNodeType(\"NurbsOrientationInterpolator\",\"NURBS\",defineClass(x3dom.nodeTypes.X3DChildNode,function(ctx){x3dom.nodeTypes.NurbsOrientationInterpolator.superClass.call(this,ctx);this.addField_SFInt32(ctx,'order',3);this.addField_MFDouble(ctx,'knot',[]);this.addField_SFNode('controlPoint',x3dom.nodeTypes.X3DCoordinateNode);this.addField_MFDouble(ctx,'weight',[]);this.addField_SFFloat(ctx,'set_fraction',0);this.points=[];this._fractionalShift=0.01;this._downZ=new x3dom.fields.SFVec3f(0,0,-1);},{fieldChanged:function(fieldName){if(fieldName===\"set_fraction\")\n{var value=this.getValue(this._vf.set_fraction);this.postMessage('value_changed',value);}},getValue:function(u){this.points=this._cf.controlPoint.node._vf.point;var points=this.points.length;var knot=this._vf.knot;if(knot.length!==points+this._vf.order)\nx3dom.nodeTypes.NurbsPositionInterpolator.prototype.createDefaultKnots.call(this);if(this._vf.weight.length!=points)\nthis._vf.weight=Array(points).fill(1.0);var uShift=(knot[knot.length-1]-knot[0])*this._fractionalShift;var diff=this.curvePoint(u).subtract(this.curvePoint(u+uShift));return x3dom.fields.Quaternion.rotateFromTo(this._downZ,diff);},curvePoint:function(u){return x3dom.nodeTypes.NurbsPositionInterpolator.prototype.curvePoint.call(this,u);},findSpan:function(n,p,u,U){return x3dom.nodeTypes.NurbsCurve.prototype.findSpan(n,p,u,U);},basisFuns:function(i,u,p,U){return x3dom.nodeTypes.NurbsPositionInterpolator.prototype.basisFuns(i,u,p,U);}}));x3dom.registerNodeType(\"NurbsSurfaceInterpolator\",\"NURBS\",defineClass(x3dom.nodeTypes.X3DChildNode,function(ctx){x3dom.nodeTypes.NurbsSurfaceInterpolator.superClass.call(this,ctx);this.addField_SFInt32(ctx,'uDimension',0);this.addField_SFInt32(ctx,'vDimension',0);this.addField_MFDouble(ctx,'uKnot',[]);this.addField_MFDouble(ctx,'vKnot',[]);this.addField_SFInt32(ctx,'uOrder',3);this.addField_SFInt32(ctx,'vOrder',3);this.addField_SFNode('controlPoint',x3dom.nodeTypes.X3DCoordinateNode);this.addField_MFDouble(ctx,'weight',[]);this.addField_SFVec2f(ctx,'set_fraction',0,0);this.points=[];this._fractionalShift=0.01;},{nodeChanged:function(){this.points=this._cf.controlPoint.node._vf.point;this.pointsLength=this.points.length;},fieldChanged:function(fieldName){if(fieldName===\"set_fraction\"){var value=this.getValue(this._vf.set_fraction);this.postMessage('position_changed',value.position);this.postMessage('normal_changed',value.normal);}},getValue:function(uv){var u=uv.x,v=uv.y;this.points=this._cf.controlPoint.node._vf.point;var uKnot=this._vf.uKnot;var vKnot=this._vf.vKnot;if(uKnot.length!==this._vf.uDimension+this._vf.uOrder)\nuKnot=this.createDefaultKnots(this._vf.uDimension,this._vf.uOrder);if(vKnot.length!==this._vf.vDimension+this._vf.vOrder)\nvKnot=this.createDefaultKnots(this._vf.vDimension,this._vf.vOrder);if(this._vf.weight.length!=this.pointsLength)\nthis._vf.weight=Array(this.pointsLength).fill(1.0);var uShift=(uKnot[uKnot.length-1]-uKnot[0])*this._fractionalShift;var vShift=(vKnot[vKnot.length-1]-vKnot[0])*this._fractionalShift;var uDiff=this.surfacePoint(u+uShift,v).subtract(this.surfacePoint(u,v));var vDiff=this.surfacePoint(u,v+vShift).subtract(this.surfacePoint(u,v));return{position:this.surfacePoint(u,v),normal:uDiff.cross(vDiff).normalize()}},createDefaultKnots:function(n,o){var knots=Array(n+o).fill(0);for(var k=o;k<n;k++)\nknots[k]=(k-1)/(n-1);for(var k=knots.length-o;k<knots.length;k++)\nknots[k]=1;return knots;},surfacePoint:function(u,v){return this.surfacePoint3DH(this._vf.uDimension-1,this._vf.vDimension-1,this._vf.uOrder-1,this._vf.vOrder-1,this._vf.uKnot,this._vf.vKnot,this.points,this._vf.weight,u,v);},findSpan:function(n,p,u,U){return x3dom.nodeTypes.NurbsCurve.prototype.findSpan(n,p,u,U);},basisFuns:function(i,u,p,U){return x3dom.nodeTypes.NurbsPositionInterpolator.prototype.basisFuns(i,u,p,U);},surfacePoint3DH:function(n,m,p,q,U,V,P,W,u,v)\n{var spanu,spanv,indu,indv,l,k,i,j=0;var Nu,Nv,C=[],Cw=[0.0,0.0,0.0,0.0],temp=[];spanu=this.findSpan(n,p,u,U);Nu=this.basisFuns(spanu,u,p,U);spanv=this.findSpan(m,q,v,V);Nv=this.basisFuns(spanv,v,q,V);indu=spanu-p;for(l=0;l<=q;l++)\n{indv=spanv-q+l;for(k=0;k<4;k++)\ntemp[j+k]=0.0;for(k=0;k<=p;k++)\n{i=indu+k+(indv*(n+1));temp[j+0]+=Nu[k]*P[i].x;temp[j+1]+=Nu[k]*P[i].y;temp[j+2]+=Nu[k]*P[i].z;temp[j+3]+=Nu[k]*W[i];}\nj+=4;}\nj=0;for(l=0;l<=q;l++)\n{Cw[0]+=Nv[l]*temp[j+0];Cw[1]+=Nv[l]*temp[j+1];Cw[2]+=Nv[l]*temp[j+2];Cw[3]+=Nv[l]*temp[j+3];j+=4;}\nfor(j=0;j<3;j++)\nC[j]=Cw[j]/Cw[3];return new x3dom.fields.SFVec3f(C[0],C[1],C[2]);}}));x3dom.registerNodeType(\"NurbsCurve2D\",\"NURBS\",defineClass(x3dom.nodeTypes.X3DGroupingNode,function(ctx){x3dom.nodeTypes.NurbsCurve2D.superClass.call(this,ctx);this.addField_SFInt32(ctx,'order',3);this.addField_MFDouble(ctx,'knot',[]);this.addField_MFVec2f(ctx,'controlPoint',[]);this.addField_MFDouble(ctx,'weight',[]);this.addField_SFBool(ctx,'closed',false);},{}));x3dom.registerNodeType(\"NurbsTrimmedSurface\",\"NURBS\",defineClass(x3dom.nodeTypes.X3DNurbsSurfaceGeometryNode,function(ctx){x3dom.nodeTypes.NurbsTrimmedSurface.superClass.call(this,ctx);this.addField_MFNode('trimmingContour',x3dom.nodeTypes.Contour2D);this._needReRender=true;},{}));x3dom.registerNodeType(\"ContourPolyline2D\",\"NURBS\",defineClass(x3dom.nodeTypes.X3DGroupingNode,function(ctx){x3dom.nodeTypes.ContourPolyline2D.superClass.call(this,ctx);this.addField_MFVec2f(ctx,'controlPoint',[]);},{}));x3dom.registerNodeType(\"Contour2D\",\"NURBS\",defineClass(x3dom.nodeTypes.X3DGroupingNode,function(ctx){x3dom.nodeTypes.Contour2D.superClass.call(this,ctx);this.addField_MFNode('children',x3dom.nodeTypes.X3DChildNode);},{}));(function(){x3dom.tessWorkerScript=URL.createObjectURL(new Blob(['('+tessWorker.toString()+')()'],{type:'application/javascript'}));function tessWorker(){onmessage=function(e){if(e.data[11]){basisFunsCache=e.data[11];}else{basisFunsCache=new Map();}\nvar tess=new Tessellator(e.data);if(e.data[12]&&e.data[12].length){tess.deform();}\nelse{tess.adjustThresholds(e.data[8],e.data[9]);if(e.data[10]&&e.data[10].length){tess.initTrims();}else{tess.tloops=null;}\ntess.tessellate();}\nif(tess.have_transferables){var indices=new Uint32Array(tess.indices.length);for(var i=0;i<tess.indices.length;i++)\nindices[i]=tess.indices[i];postMessage(indices.buffer,[indices.buffer]);var coords=new Float64Array(tess.coordinates.length);for(var i=0;i<tess.coordinates.length;i++)\ncoords[i]=tess.coordinates[i];postMessage(coords.buffer,[coords.buffer]);var tcoords=new Float64Array(tess.texcoords.length);for(var i=0;i<tess.texcoords.length;i++)\ntcoords[i]=tess.texcoords[i];postMessage(tcoords.buffer,[tcoords.buffer]);}else{postMessage([tess.indices,tess.coordinates,tess.texcoords,basisFunsCache,tess.uv,e.data[13]]);}\nclose();}\nfunction findSpan(n,p,u,U)\n{var low,mid,high;if(u>=U[n])\nreturn n;if(u<=U[p])\nreturn p;low=0;high=n+1;mid=Math.floor((low+high)/2);while(u<U[mid]||u>=U[mid+1])\n{if(u<U[mid])\nhigh=mid;else\nlow=mid;mid=Math.floor((low+high)/2);}\nreturn mid;}\nfunction basisFuns(i,u,p,U)\n{var uHash=Object.values(U).toString()+Math.floor(u*10e10);if(basisFunsCache.has(uHash))return basisFunsCache.get(uHash);var N=[],left=[],right=[],saved,temp;var j,r;N[0]=1.0;for(j=0;j<=p;j++){left[j]=0;right[j]=0;}\nfor(j=1;j<=p;j++)\n{left[j]=u-U[i+1-j];right[j]=U[i+j]-u;saved=0.0;for(r=0;r<j;r++)\n{temp=N[r]/(right[r+1]+left[j-r]);N[r]=saved+right[r+1]*temp;saved=left[j-r]*temp;}\nN[j]=saved;}\nbasisFunsCache.set(uHash,N);return N;}\nfunction surfacePoint3DH(n,m,p,q,U,V,P,W,u,v)\n{var spanu,spanv,indu,indv,l,k,i,j=0;var Nu,Nv,C=[],Cw=[0.0,0.0,0.0,0.0],temp=[];spanu=findSpan(n,p,u,U);Nu=basisFuns(spanu,u,p,U);spanv=findSpan(m,q,v,V);Nv=basisFuns(spanv,v,q,V);indu=spanu-p;for(l=0;l<=q;l++)\n{indv=spanv-q+l;for(k=0;k<4;k++)\ntemp[j+k]=0.0;for(k=0;k<=p;k++)\n{i=indu+k+(indv*(n+1));temp[j+0]+=Nu[k]*P[i].x;temp[j+1]+=Nu[k]*P[i].y;temp[j+2]+=Nu[k]*P[i].z;temp[j+3]+=Nu[k]*W[i];}\nj+=4;}\nj=0;for(l=0;l<=q;l++)\n{Cw[0]+=Nv[l]*temp[j+0];Cw[1]+=Nv[l]*temp[j+1];Cw[2]+=Nv[l]*temp[j+2];Cw[3]+=Nv[l]*temp[j+3];j+=4;}\nfor(j=0;j<3;j++)\nC[j]=Cw[j]/Cw[3];return C;}\nfunction surfacePoint3D(n,m,p,q,U,V,P,u,v)\n{var spanu,spanv,indu,indv,l,k,i,j=0;var Nu,Nv,C=[0.0,0.0,0.0],temp=[];spanu=findSpan(n,p,u,U);Nu=basisFuns(spanu,u,p,U);spanv=findSpan(m,q,v,V);Nv=basisFuns(spanv,v,q,V);indu=spanu-p;for(l=0;l<=q;l++)\n{indv=spanv-q+l;temp[j+0]=0.0;temp[j+1]=0.0;temp[j+2]=0.0;for(k=0;k<=p;k++)\n{i=indu+k+(indv*(n+1));temp[j+0]+=Nu[k]*P[i].x;temp[j+1]+=Nu[k]*P[i].y;temp[j+2]+=Nu[k]*P[i].z;}\nj+=3;}\nj=0;for(l=0;l<=q;l++)\n{C[0]+=Nv[l]*temp[j+0];C[1]+=Nv[l]*temp[j+1];C[2]+=Nv[l]*temp[j+2];j+=3;}\nreturn C;}\nfunction curvePoint2DH(n,p,U,P,W,u)\n{var span,j,k;var N=[],Cw0=0.0,Cw1=0.0,Cw2=0.0;span=findSpan(n,p,u,U);N=basisFuns(span,u,p,U);for(j=0;j<=p;j++)\n{k=(span-p+j);Cw0+=N[j]*P[k].x;Cw1+=N[j]*P[k].y;Cw2+=N[j]*W[k];}\nreturn[Cw0/Cw2,Cw1/Cw2];}\nfunction curvePoint2D(n,p,U,P,u)\n{var span,j,k;var N=[],C0=0.0,C1=0.0;span=findSpan(n,p,u,U);N=basisFuns(span,u,p,U);for(j=0;j<=p;j++)\n{k=(span-p+j);C0+=N[j]*P[k].x;C1+=N[j]*P[k].y;}\nreturn[C0,C1];}\nfunction Tessellator(nurb){this.bbox_split=4.0;this.use_objectspace=true;this.edge_thresh=0.1;this.trim_thresh=0.1;this.split_bias=0.5;this.skew_thresh=0.01;this.max_rec=5;this.w=nurb[0];this.h=nurb[1];this.p=nurb[2];this.q=nurb[3];this.U=nurb[4];this.V=nurb[5];this.P=nurb[6];this.W=nurb[7];this.tloops=nurb[10];this.useUV=nurb[12];this.surfaceHash=[];this.indexHash=[];this.curveHash=null;this.coordinates=[];this.texcoords=[];this.indices=[];this.uv=[];this.coordIndex=0;this.deform=function(){this.useUV.forEach(function(uv){this.computeSurface(uv,false);},this);}\nthis.tessellate=function(){if(this.W&&this.W.length!=(this.w+1)*(this.h+1))\nthis.W={};var u0=this.U[this.p];var u1=this.U[this.U.length-this.p-1];var u05=(u0+u1)*0.5;var v0=this.V[this.q];var v1=this.V[this.V.length-this.q-1];var v05=(v0+v1)*0.5;this.tessTri([[u0,v0],[u0,v05],[u05,v0]]);this.tessTri([[u0,v05],[u05,v05],[u05,v0]]);this.tessTri([[u0,v05],[u0,v1],[u05,v05]]);this.tessTri([[u0,v1],[u05,v1],[u05,v05]]);this.tessTri([[u05,v0],[u05,v05],[u1,v0]]);this.tessTri([[u05,v05],[u1,v05],[u1,v0]]);this.tessTri([[u05,v05],[u05,v1],[u1,v05]]);this.tessTri([[u05,v1],[u1,v1],[u1,v05]]);}\nthis.adjustThresholds=function(uparam,vparam){if(uparam<0){this.use_objectspace=false;if(vparam>=0.0)\nvparam=uparam;var ul=2.0/(this.w+1);var vl=2.0/(this.h+1);ul*=(this.U[this.U.length-this.p-1]-this.U[this.p]);vl*=(this.V[this.V.length-this.q-1]-this.V[this.q]);this.edge_thresh_u=-uparam*ul;this.edge_thresh_v=-vparam*vl;}else{var mi=Number.MAX_VALUE;var mx=-Number.MAX_VALUE;var bb=[mi,mi,mi,mx,mx,mx];for(var i=0;i<this.P.length;i++){if(this.P[i].x<bb[0])bb[0]=this.P[i].x;if(this.P[i].y<bb[1])bb[1]=this.P[i].y;if(this.P[i].z<bb[2])bb[2]=this.P[i].z;if(this.P[i].x>bb[3])bb[3]=this.P[i].x;if(this.P[i].y>bb[4])bb[4]=this.P[i].y;if(this.P[i].z>bb[5])bb[5]=this.P[i].z;}\nvar ex=Math.sqrt((bb[0]-bb[3])*(bb[0]-bb[3])+\n(bb[1]-bb[4])*(bb[1]-bb[4])+\n(bb[2]-bb[5])*(bb[2]-bb[5]))/this.bbox_split;if(uparam<=10e-6)\nuparam=1.0;this.edge_thresh*=ex*uparam;this.trim_thresh*=ex*uparam;}}\nthis.tessTri=function(tri){var work=[tri];while(work.length){var cur=work.splice(0,1);var pieces=this.refineTri(cur[0]);work=pieces.concat(work);}}\nthis.refineTri=function(tri){if(this.tloops&&this.inOut(tri)<0)\nreturn[];var area=tri[0][0]*tri[1][1]-tri[1][0]*tri[0][1]+\ntri[1][0]*tri[2][1]-tri[2][0]*tri[1][1]+\ntri[2][0]*tri[0][1]-tri[0][0]*tri[2][1];if(area<0)\narea=-area;var a=[],b=[];a[0]=tri[0][0]-tri[1][0];a[1]=tri[0][1]-tri[1][1];var max_ed=a[0]*a[0]+a[1]*a[1];a[0]=tri[1][0]-tri[2][0];a[1]=tri[1][1]-tri[2][1];max_ed+=a[0]*a[0]+a[1]*a[1];a[0]=tri[2][0]-tri[0][0];a[1]=tri[2][1]-tri[0][1];max_ed+=a[0]*a[0]+a[1]*a[1];area/=max_ed;if(area<=this.skew_thresh){this.diceTri(tri);return[];}\nvar eds=[];max_ed=0.0;for(var i=0;i<3;i++){var j0=(i+1)%3;var j1=(i+2)%3;a=tri[j0];b=tri[j1];eds[i]=this.splitEdge(a,b);if(eds[i]>max_ed)\nmax_ed=eds[i];}\nmax_ed*=this.split_bias;var m=[],mv=[],co=0;for(var i=0;i<3;i++){var j0=(i+1)%3;var j1=(i+2)%3;if((eds[i]>this.edge_thresh)&&(eds[i]>=max_ed)){co++;mv[i]=[];mv[i][0]=0.5*(tri[j0][0]+tri[j1][0]);mv[i][1]=0.5*(tri[j0][1]+tri[j1][1]);m[i]=i-3;}else{if(eds[j0]>eds[j1]){mv[i]=tri[j0];m[i]=j0;}else{mv[i]=tri[j1];m[i]=j1;}}}\nvar res=[];if(co){co++;var j=co;for(var i=0;i<3;i++){var j0=(i+1)%3;var j1=(i+2)%3;if((m[j1]!=i)&&(m[j0]!=i)){res[--j]=[tri[i],mv[j1],mv[j0]];}}\nif(j){if((m[0]==m[1])||(m[1]==m[2])||(m[2]==m[0])){return[];}\nres[0]=[mv[0],mv[1],mv[2]];}\nreturn res;}\nthis.trimFinal(tri);return[];}\nthis.diceTri=function(tri){var cv=[];cv[0]=(tri[0][0]+tri[1][0]+tri[2][0])/3.0;cv[1]=(tri[0][1]+tri[1][1]+tri[2][1])/3.0;this.computeSurface(cv);for(var ed=0;ed<3;ed++){var divs=[],d=[];var e1=(ed+1)%3;d[0]=tri[e1][0]-tri[ed][0];d[1]=tri[e1][1]-tri[ed][1];divs[0]=1.0;var beg=0.0;while(divs.length){var a=[],b=[];var end=divs[0];a[0]=tri[ed][0]+d[0]*beg;a[1]=tri[ed][1]+d[1]*beg;b[0]=tri[ed][0]+d[0]*end;b[1]=tri[ed][1]+d[1]*end;if(this.splitEdge(a,b)>this.edge_thresh){divs.splice(0,0,0.5*(beg+end));}else{this.computeSurface(a);this.computeSurface(b);var slice=[cv,a,b];this.trimFinal(slice);divs.splice(0,1);beg=end;}}}}\nthis.computeSurface=function(uv,nooutput){var indu=Math.floor(uv[0]*10e10);var indv=Math.floor(uv[1]*10e10);if(this.surfaceHash[indu]){var memoizedPoint=this.surfaceHash[indu][indv];if(memoizedPoint)\nreturn memoizedPoint;}\nvar pnt;if(Object.keys(this.W).length){pnt=surfacePoint3DH(this.w,this.h,this.p,this.q,this.U,this.V,this.P,this.W,uv[0],uv[1]);}else{pnt=surfacePoint3D(this.w,this.h,this.p,this.q,this.U,this.V,this.P,uv[0],uv[1]);}\nif(this.curveHash)\nreturn pnt;if(!this.surfaceHash[indu])\nthis.surfaceHash[indu]=[];this.surfaceHash[indu][indv]=pnt;if(nooutput)\nreturn pnt;if(!this.indexHash[indu])\nthis.indexHash[indu]=[];this.indexHash[indu][indv]=this.coordIndex;this.coordIndex++;this.coordinates.push(pnt);this.texcoords.push([uv[0],uv[1]]);this.uv.push(uv);return pnt;}\nthis.computeCurve=function(loop,seg,u){var indu=Math.floor(u*10e10);if(this.curveHash[loop][seg]){var memoizedPoint=this.curveHash[loop][seg][indu];if(memoizedPoint)\nreturn memoizedPoint;}\nvar pnt,crv=this.tloops[loop][seg];if(crv[4]&&crv[4].length){pnt=curvePoint2DH(crv[0],crv[1],crv[2],crv[3],crv[4],u);}else{pnt=curvePoint2D(crv[0],crv[1],crv[2],crv[3],u);}\nif(!this.curveHash[loop][seg])\nthis.curveHash[loop][seg]=[];this.curveHash[loop][seg][indu]=pnt;return pnt;}\nthis.splitEdge=function(a,b){var pa=this.computeSurface(a);var pb=this.computeSurface(b);if(!this.use_objectspace){var dist=Math.sqrt((a[0]-b[0])*(a[0]-b[0])/this.edge_thresh_u+\n(a[1]-b[1])*(a[1]-b[1])/this.edge_thresh_v);return dist;}\nif(Math.abs(pa[0]-pb[0])>10e-6||Math.abs(pa[1]-pb[1])>10e-6||Math.abs(pa[2]-pb[2])>10e-6){var lab=Math.sqrt((pa[0]-pb[0])*(pa[0]-pb[0])+\n(pa[1]-pb[1])*(pa[1]-pb[1])+\n(pa[2]-pb[2])*(pa[2]-pb[2]));if(lab<this.edge_thresh){var m=[a[0]+(b[0]-a[0])*0.5,a[1]+(b[1]-a[1])*0.5];var pm=this.computeSurface(m,false);var lamb=0.0;if(Math.abs(pa[0]-pm[0])>10e-6||Math.abs(pa[1]-pm[1])>10e-6||Math.abs(pa[2]-pm[2])>10e-6){lamb+=Math.sqrt((pa[0]-pm[0])*(pa[0]-pm[0])+\n(pa[1]-pm[1])*(pa[1]-pm[1])+\n(pa[2]-pm[2])*(pa[2]-pm[2]))}\nif(Math.abs(pb[0]-pm[0])>10e-6||Math.abs(pb[1]-pm[1])>10e-6||Math.abs(pb[2]-pm[2])>10e-6){lamb+=Math.sqrt((pb[0]-pm[0])*(pb[0]-pm[0])+\n(pb[1]-pm[1])*(pb[1]-pm[1])+\n(pb[2]-pm[2])*(pb[2]-pm[2]))}\nif(lamb>lab*1.01)\nlab+=lamb;}\nreturn lab;}\nelse\nreturn 0.0;}\nthis.splitCenter=function(tri){var cv=[];this.curveHash=[];cv[0]=(tri[0][0]+tri[1][0]+tri[2][0])/3.0;cv[1]=(tri[0][1]+tri[1][1]+tri[2][1])/3.0;var ed=0.0;for(var i=0;i<3;i++)\ned+=this.splitEdge(tri[i],cv);this.curveHash=null;if(ed*0.5>this.edge_thresh){this.computeSurface(cv);return true;}\nreturn false;}\nthis.renderFinal=function(tri){for(var i=0;i<3;i++){var uv=tri[i];var indu=Math.floor(uv[0]*10e10);var indv=Math.floor(uv[1]*10e10);if(this.indexHash[indu])\nthis.indices.push(this.indexHash[indu][indv]);}}\nthis.intersectTrim=function(p1,p2,prev){var sl=0,ss=0;if(prev){sl=prev[2];ss=prev[3]+1;}\nfor(var ilp=sl;ilp<this.ttloops.length;ilp++){var lp=this.ttloops[ilp];for(var k=ss;k<lp.length-1;k++){var p3=lp[k];var p4=lp[k+1];if(((Math.abs(p1[0]-p3[0])<10e-6)&&(Math.abs(p1[1]-p3[1])<10e-6))||((Math.abs(p1[0]-p4[0])<10e-6)&&(Math.abs(p1[1]-p4[1])<10e-6)))\nreturn[];if(((Math.abs(p2[0]-p3[0])<10e-6)&&(Math.abs(p2[1]-p3[1])<10e-6))||((Math.abs(p2[0]-p4[0])<10e-6)&&(Math.abs(p2[1]-p4[1])<10e-6)))\nreturn[];var den=((p2[0]-p1[0])*(p4[1]-p3[1])-\n(p2[1]-p1[1])*(p4[0]-p3[0]));if(Math.abs(den)<10e-6){continue;}\nvar r=((p1[1]-p3[1])*(p4[0]-p3[0])-\n(p1[0]-p3[0])*(p4[1]-p3[1]))/den;if((r<10e-6)||(r>(1.0-10e-6)))\ncontinue;var s=((p1[1]-p3[1])*(p2[0]-p1[0])-\n(p1[0]-p3[0])*(p2[1]-p1[1]))/den;if((s<10e-6)||(s>(1.0-10e-6)))\ncontinue;return[p1[0]+r*(p2[0]-p1[0]),p1[1]+r*(p2[1]-p1[1]),ilp,k];}\nif(prev)\nreturn[];}\nreturn[];}\nthis.renderDiced=function(p0,p1,p2,tm,ip0,ip1){var ip0s=ip0;var ip1s=ip1;if(((p0[0]-ip0[0])*(p0[0]-ip0[0])+(p0[1]-ip0[1])*(p0[1]-ip0[1]))>((p0[0]-ip1[0])*(p0[0]-ip1[0])+(p0[1]-ip1[1])*(p0[1]-ip1[1]))){ip0s=ip1;ip1s=ip0;}\nthis.renderFinal([p0,tm,p2]);this.renderFinal([p0,ip0s,tm]);this.renderFinal([p1,p2,tm]);this.renderFinal([p1,tm,ip1s]);}\nthis.renderComplex=function(tri,ip0,ip1,ip2){this.diceTri([tri[0],ip0,ip2]);this.diceTri([ip0,tri[1],ip1]);this.diceTri([ip0,ip1,ip2]);this.diceTri([ip2,ip1,tri[2]]);}\nthis.renderTrimmed=function(tri){var t=0.3;var ip0=this.intersectTrim(tri[0],tri[1]);var ip1=this.intersectTrim(tri[1],tri[2]);var ip2=this.intersectTrim(tri[2],tri[0]);var len=(ip0.length>0)+(ip1.length>0)+(ip2.length>0);if(len==1){var ip=[ip0,ip1,ip2];for(var i=0;i<3;i++)\nif(ip[i].length){if(((Math.abs(tri[i][0]-ip[i][0])<10e-6)&&(Math.abs(tri[i][1]-ip[i][1])<10e-6))||((Math.abs(tri[(i+1)%3][0]-ip[i][0])<10e-6)&&(Math.abs(tri[(i+1)%3][1]-ip[i][1])<10e-6))){this.renderFinal(tri);return;}}\nif(ip0.length){var ip01=this.intersectTrim(tri[0],tri[1],ip0);if(ip01.length){var tm=this.ttloops[ip01[2]][ip01[3]];this.computeSurface(tm);this.computeSurface(ip0);this.computeSurface(ip01);if(this.inOut([tri[2],[tri[2][0]+(tri[1][0]-tri[2][0])*t,tri[2][1]+(tri[1][1]-tri[2][1])*t],[tri[2][0]+(tri[0][0]-tri[2][0])*t,tri[2][1]+(tri[0][1]-tri[2][1])*t]])>0){this.renderDiced(tri[0],tri[1],tri[2],tm,ip0,ip01);}else{this.renderFinal([ip0,tm,ip01]);}\nreturn;}}else if(ip1.length){var ip11=this.intersectTrim(tri[1],tri[2],ip1);if(ip11.length){var tm=this.ttloops[ip11[2]][ip11[3]];this.computeSurface(tm);this.computeSurface(ip1);this.computeSurface(ip11);if(this.inOut([tri[0],[tri[0][0]+(tri[1][0]-tri[0][0])*t,tri[0][1]+(tri[1][1]-tri[0][1])*t],[tri[0][0]+(tri[2][0]-tri[0][0])*t,tri[0][1]+(tri[2][1]-tri[0][1])*t]])>0){this.renderDiced(tri[1],tri[2],tri[0],tm,ip1,ip11);}else{this.renderFinal([ip1,tm,ip11]);}\nreturn;}}else if(ip2.length){var ip21=this.intersectTrim(tri[2],tri[0],ip2);if(ip21.length){var tm=this.ttloops[ip21[2]][ip21[3]];this.computeSurface(tm);this.computeSurface(ip2);this.computeSurface(ip21);if(this.inOut([tri[1],[tri[1][0]+(tri[0][0]-tri[1][0])*t,tri[1][1]+(tri[0][1]-tri[1][1])*t],[tri[1][0]+(tri[2][0]-tri[1][0])*t,tri[1][1]+(tri[2][1]-tri[1][1])*t]])>0){this.renderDiced(tri[2],tri[0],tri[1],tm,ip2,ip21);}else{this.renderFinal([ip2,tm,ip21]);}\nreturn;}}\nif(this.max_rec){this.max_rec--;this.diceTri(tri);this.max_rec++;return;}}\nif(len!=2){if(len==3){this.renderComplex(tri,ip0,ip1,ip2);return;}else{var out=0;if(this.inOut([tri[0],[tri[0][0]+(tri[1][0]-tri[0][0])*t,tri[0][1]+(tri[1][1]-tri[0][1])*t],[tri[0][0]+(tri[2][0]-tri[0][0])*t,tri[0][1]+(tri[2][1]-tri[0][1])*t]])<0)\nout++;if(this.inOut([tri[1],[tri[1][0]+(tri[0][0]-tri[1][0])*t,tri[1][1]+(tri[0][1]-tri[1][1])*t],[tri[1][0]+(tri[2][0]-tri[1][0])*t,tri[1][1]+(tri[2][1]-tri[1][1])*t]])<0)\nout++;if(this.inOut([tri[2],[tri[2][0]+(tri[1][0]-tri[2][0])*t,tri[2][1]+(tri[1][1]-tri[2][1])*t],[tri[2][0]+(tri[0][0]-tri[2][0])*t,tri[2][1]+(tri[0][1]-tri[2][1])*t]])<0)\nout++;if(out>0){return;}\nthis.renderFinal(tri);}}else{if(!ip0.length){this.computeSurface(ip1);this.computeSurface(ip2);if(this.inOut([tri[2],[tri[2][0]+(ip2[0]-tri[2][0])*t,tri[2][1]+(ip2[1]-tri[2][1])*t],[tri[2][0]+(ip1[0]-tri[2][0])*t,tri[2][1]+(ip1[1]-tri[2][1])*t]])<=0){this.renderFinal([tri[0],ip1,ip2]);this.renderFinal([tri[0],tri[1],ip1]);}else{this.renderFinal([tri[2],ip2,ip1]);}}else{if(!ip1.length){this.computeSurface(ip0);this.computeSurface(ip2);if(this.inOut([tri[0],[tri[0][0]+(ip2[0]-tri[0][0])*t,tri[0][1]+(ip2[1]-tri[0][1])*t],[tri[0][0]+(ip0[0]-tri[0][0])*t,tri[0][1]+(ip0[1]-tri[0][1])*t]])<=0){this.renderFinal([tri[1],ip2,ip0]);this.renderFinal([tri[1],tri[2],ip2]);}else{this.renderFinal([tri[0],ip0,ip2]);}}else{this.computeSurface(ip0);this.computeSurface(ip1);if(this.inOut([tri[1],[tri[1][0]+(ip0[0]-tri[1][0])*t,tri[1][1]+(ip0[1]-tri[1][1])*t],[tri[1][0]+(ip1[0]-tri[1][0])*t,tri[1][1]+(ip1[1]-tri[1][1])*t]])<=0){this.renderFinal([tri[0],ip0,ip1]);this.renderFinal([tri[0],ip1,tri[2]]);}else{this.renderFinal([tri[1],ip1,ip0]);}}}}\nreturn;}\nthis.inOut=function(tri){var a=[],ad=[];var cl=[];var cg=[];var ndx=[];for(var i=0;i<3;i++){a[i]=[];var va=tri[i];var vb=tri[(i+1)%3];a[i][0]=va[1]-vb[1];a[i][1]=vb[0]-va[0];ad[i]=a[i][0]*va[0]+a[i][1]*va[1];cl[i]=cg[i]=0;ndx[i]=(Math.abs(a[i][0])>Math.abs(a[i][1]))?1:0;}\nfor(var ilp=0;ilp<this.ttloops.length;ilp++){var lp=this.ttloops[ilp];for(var k=0;k<lp.length-1;k++){var p0=lp[k];var p1=lp[k+1];var ni=0;for(var i=0;i<3;i++){var d0=p0[0]*a[i][0]+p0[1]*a[i][1]-ad[i];var d1=p1[0]*a[i][0]+p1[1]*a[i][1]-ad[i];ni+=(d0<0)?1:-1;if((d0<0)?(d1<0):(d1>=0))\ncontinue;var ip=(p1[ndx[i]]*d0-p0[ndx[i]]*d1)/(d0-d1);var ba=ip<tri[i][ndx[i]];var bb=ip<tri[(i+1)%3][ndx[i]];if(ba&&bb){cl[i]++;}else{if(!(ba||bb)){cg[i]++;}else{return 0;}}}\nif((ni==3)||(ni==-3))\nreturn 0;}}\nif((cl[0]&1)&&(cl[1]&1)&&(cl[2]&1))return 1;if(!((cl[0]&1)||(cl[1]&1)||(cl[2]&1)))return-1;return 0;}\nthis.refineTrim=function(loop,u1,u2){var pa=this.computeCurve(loop,Math.floor(u1),u1);var pb=this.computeCurve(loop,Math.floor(u2),u2);return(this.splitEdge(pa,pb)>this.edge_thresh);}\nthis.initTrims=function(){this.ttloops=[];this.curveHash=[];var edt=this.edge_thresh;this.edge_thresh=this.trim_thresh;for(var ilp=0;ilp<this.tloops.length;ilp++){var lp=this.tloops[ilp];this.curveHash[ilp]=[];this.ttloops[ilp]=[];var ttus=[];var pnts=[];var ue;for(var j=0;j<lp.length;j++){var U=lp[j][2];var uf=1.0/(U[U.length-1]-U[0]);if(Math.abs(1.0-uf)>10e-12)\nfor(var i=0;i<U.length;i++)\nU[i]=(U[i]*uf);var ud=U[0]-j;if(Math.abs(ud)>10e-12)\nfor(var i=0;i<U.length;i++)\nU[i]=(U[i]-ud);var ui=lp[j][1];var u=U[ui];ue=U[(U.length-ui-1)];while(u<ue){this.ttloops[ilp].push(this.computeCurve(ilp,j,u));ttus.push(u);ui++;while(Math.abs(u-U[ui])<10e-6)\nui++;u=U[ui];}}\nvar tlp=this.ttloops[ilp];var x=0;while(x<tlp.length){var p0u=ttus[x];var p0seg=Math.floor(p0u);var y=x+1;if(y==tlp.length){y=0;}\nvar p1u=ttus[y];if(lp[p0seg][1]>1&&this.refineTrim(ilp,p0u,p1u)){var um;if(y==0){um=0.5*(p0u+ue);y=x+1;}else{um=0.5*(p0u+p1u);}\nvar v=this.computeCurve(ilp,p0seg,um);tlp.splice(y,0,v)\nttus.splice(y,0,um);}else{if(y==0)\nbreak;x=y;}}\ntlp.push(tlp[0]);}\nthis.curveHash=null;this.edge_thresh=edt;}\nthis.trimFinal=function(tri){if(this.tloops){if(this.inOut(tri)>=0){this.renderTrimmed(tri);return;}else{var t=0.3;var out=0;if(this.inOut([tri[0],[tri[0][0]+(tri[1][0]-tri[0][0])*t,tri[0][1]+(tri[1][1]-tri[0][1])*t],[tri[0][0]+(tri[2][0]-tri[0][0])*t,tri[0][1]+(tri[2][1]-tri[0][1])*t]])<0)\nout++;if(this.inOut([tri[1],[tri[1][0]+(tri[0][0]-tri[1][0])*t,tri[1][1]+(tri[0][1]-tri[1][1])*t],[tri[1][0]+(tri[2][0]-tri[1][0])*t,tri[1][1]+(tri[2][1]-tri[1][1])*t]])<0)\nout++;if(this.inOut([tri[2],[tri[2][0]+(tri[1][0]-tri[2][0])*t,tri[2][1]+(tri[1][1]-tri[2][1])*t],[tri[2][0]+(tri[0][0]-tri[2][0])*t,tri[2][1]+(tri[0][1]-tri[2][1])*t]])<0)\nout++;if(out>0){return;}}}\nthis.renderFinal(tri);}}}})();x3dom.WorkerPool=function(size){var _this=this;this.taskQueue=[];this.workerQueue=[];this.poolSize=size;this.init=function(){for(var i=0;i<this.poolSize;i++){_this.workerQueue.push(new x3dom.WorkerThread(_this));}}\nthis.addWorkerTask=function(workerTask){if(_this.workerQueue.length>0){var workerThread=_this.workerQueue.shift();workerThread.run(workerTask);}else{_this.taskQueue.push(workerTask);}}\nthis.freeWorkerThread=function(workerThread){if(_this.taskQueue.length>0){var workerTask=_this.taskQueue.shift();if(workerTask.discard)\nreturn this.freeWorkerThread(workerThread);workerThread.run(workerTask);}else{_this.workerQueue.push(workerThread);}}};x3dom.WorkerThread=function(workerPool){var _this=this;this.workerPool=workerPool;this.workerTask={};this.run=function(workerTask){_this.workerTask=workerTask;var worker=new Worker(workerTask.script);worker.caller=workerTask.caller;worker.onmessage=function(e){_this.workerTask.callback(e);_this.workerPool.freeWorkerThread(_this);}\nworker.postMessage(workerTask.startMessage);}};x3dom.WorkerTask=function(script,caller,callback,msg){this.script=script;this.caller=caller;this.callback=callback;this.startMessage=msg;};(function(){var poolSize=1;if(navigator.hardwareConcurrency){poolSize=Math.max(1,navigator.hardwareConcurrency-1);}\nx3dom.tessWorkerPool=new x3dom.WorkerPool(poolSize);x3dom.tessWorkerPool.init();})();x3dom.versionInfo={version:'1.8.1',revision:'0c742a1a981f8c0a9cbb7059f36c3a6c4cb9fec6',date:'Fri Sep 27 18:22:15 2019 +0200'};","/** X3DOM Runtime, http://www.x3dom.org/ 1.8.1 - 0c742a1a981f8c0a9cbb7059f36c3a6c4cb9fec6 - Fri Sep 27 18:22:15 2019 +0200 *//*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * Philip Taylor: http://philip.html5.org\n */\n\n// Add some JS1.6 Array functions:\n// (This only includes the non-prototype versions, because otherwise it messes up 'for in' loops)\n\nif (!Array.forEach) {\n\t/*\n\t *\tFunction: Array.forEach\n\t *\n\t *\tJavascript array forEach() method calls a function for each element in the array.\n\t * \n\t *  Parameters:\n\t *\n\t *   \tarray - The array\n\t *\t\tfun   - Function to test each element of the array\n\t *      thisp - Object to use as __this__ when executing callback\n\t *\n\t *\tReturns:\n\t *\n\t * \t\tThe created array\n\t */\n\tArray.forEach = function (array, fun, thisp) {\n        var len = array.length;\n        for (var i = 0; i < len; i++) {\n            if (i in array) {\n                fun.call(thisp, array[i], i, array);\n            }\n        }\n    };\n}\n\nif (!Array.map) {\n    Array.map = function(array, fun, thisp) {\n        var len = array.length;\n        var res = [];\n        for (var i = 0; i < len; i++) {\n            if (i in array) {\n                res[i] = fun.call(thisp, array[i], i, array);\n            }\n        }\n        return res;\n    };\n}\n\nif (!Array.filter) {\n    Array.filter = function(array, fun, thisp) {\n        var len = array.length;\n        var res = [];\n        for (var i = 0; i < len; i++) {\n            if (i in array) {\n                var val = array[i];\n                if (fun.call(thisp, val, i, array)) {\n                    res.push(val);\n                }\n            }\n        }\n        return res;\n    };\n}\n\n/**\r\n * X3DOM JavaScript Library\r\n * http://www.x3dom.org\r\n *\r\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\r\n * Dual licensed under the MIT and GPL\r\n *\r\n * Based on code originally provided by\r\n * Philip Taylor: http://philip.html5.org\r\n */\r\n\r\n/**\r\n * The Namespace container for x3dom objects.\r\n * @namespace x3dom\r\n */\r\nvar x3dom = {\r\n    canvases: [],\r\n    x3dNS:    'http://www.web3d.org/specifications/x3d-namespace',\r\n    x3dextNS: 'http://philip.html5.org/x3d/ext',\r\n    xsltNS:   'http://www.w3.org/1999/XSL/x3dom.Transform',\r\n    xhtmlNS:  'http://www.w3.org/1999/xhtml'\r\n};\r\n\r\n/**\r\n * The x3dom.nodeTypes namespace.\r\n * @namespace x3dom.nodeTypes\r\n */\r\nx3dom.nodeTypes = {};\r\n\r\n/**\r\n * The x3dom.nodeTypesLC namespace. Stores nodetypes in lowercase\r\n * @namespace x3dom.nodeTypesLC\r\n */\r\nx3dom.nodeTypesLC = {};\r\n\r\n/**\r\n * The x3dom.components namespace.\r\n * @namespace x3dom.components\r\n */\r\nx3dom.components = {};\r\n\r\n/**\r\n * Cache for primitive nodes (Box, Sphere, etc.)\r\n */\r\nx3dom.geoCache = [];\r\n\r\n/**\r\n * Global indices for the vertex/index buffers\r\n */\r\nx3dom.BUFFER_IDX =\r\n{\r\n    INDEX: 0,\r\n    POSITION: 1,\r\n    NORMAL: 2,\r\n    TEXCOORD: 3,\r\n    TEXCOORD_0 : 3,\r\n    COLOR: 4,\r\n    COLOR_0: 4,\r\n    ID: 5,\r\n    TANGENT: 6,\r\n    BITANGENT: 7,\r\n    TEXCOORD_1: 8\r\n};\r\n\r\nx3dom.BRDF_LUT = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAIAAADTED8xAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAMAdJREFUeNrsXduWIruOlGjOzP8/zdceNA+QmbZ19yVJKFh79a6ChKqCkBQRkm38v/8QABBA++/zf+JD2r8k35/4lqIXd1zA/yj7i/ij7rP67jy+psRP77vszG87Lph4T3PnHYEIAAGe/x43BCAoH9L+bZ4i/jwMfotAAEjqxfx+7QL5pvyGAP6vHbxSfFb8TuPXDl6fe0O6bvYH+lm3OwDxP+b1L1ZYtN+O4ykAREJ45MKA5Efj8aB+UcTYCKTc546C3gzd6ZhLfVjfdLvjRj1Q/Ds3uPjpX/m0moujb7SZ8zrTfwBP9iu7d/b9PtFXiBXY8Ye+6eaW/IMCyRndKwUqO5KekgsDPCTBtPSfp0PjibwbakJgZCjc75aoAOBmd6yIjV8E2FN6wkD6vAfTf/X0us7YL5hK/30EabqM+Zo8Pfd1ysteGkAEdIt1swTLgcG4UDoMMMrXc+nffM86IuHMm1uQfyGRqQBIouKUEx7KesBiR5hzdWxNnAN3UDzob3b8p0RKQfeLrJC5XxAS4ueWveyO8AKXQVcqrOspUw2MsKtja+Jp7F/SG81veBqkOl+ECaS/kK0X2qANw7GKAABKesCRyJKrk9XEWfsyl85jkFpI7rOv6eHuL/g8HaS/ubNygUqGYxUB6SVdXqSx+WAYpOhQVteKxS0eCRFet4TefEjujfyaEeoyAvewC1TD1BLHUrSArSX0LO6GgUuHhtJ/GaUgx/ZFbsHu+9/RuINFoHKBIvalKB/99O+J2mD55pR9PP2DWWemOKFrQ+hKemB1VI5zHqECNIiJ6IHyymZ6x30WgN+I9dN211RPoqtlomoEaktgem4d6Phps1jQINz5nS0FEh1P3yE1ZbE8DTE+8DNgj4ZgnfycO1L+YPUImrmfGxIj7mfwzpYCiY5nX5vMLgKaNZRj7fsVU9N/pJEXB/ofmbqZImqny1w3BhQKVDqe0nyy2yazGVHjO6VYUMeL9KT/OkovzX8WFIHmld6rtEcaXu7Tj3Foi7dguk0WGhbSraF0WQh3ynoiIdAmO0f++q92JVNoYhFYFwN3ROIDYeJcWkO4I1c66V+hsClCb9SBCenffAuz4D5pyP6UGOhmL1erA3cEEr1/UJpfEZnrzlbYTCbO5u06MCf91y++qBM8ORjyYHSf0YfvuUogHgMQt0FfFKhe+KIGA/p6wPBSfSibxk4oNsw6MLq2K7kk5a+tR5lo7AzGgHEn8DXBoLSBNTIQbZMxWRxcRSDO6CcaXoGJhr61XWVUD/KfKxqTa2rCXLtzPAYsFwikHCy3ycB3SJufxhFg1IG4uanWAVDdm9GVK4Hx6bVKdwaET2tmnW/sBOnQ8/6jDwDS5KbjkJI/xalxodDq9QAdsrvF9sxF/+B+QQXH+c/C4rBYmZ7Qqc3GACTvF/oA4K1isWWxyoUgP8gZpkNqSIy5+FZUrNlh5Qtcy7md2j5YazHDrxf6AM38fYcsttwhmrBkMWIQiXVgSvofzK9n7zjyjs7AxE7t3FLAr69EMOj4TsliSxjEhswm1gGAznnJ0KCOwoWm7AQxLTwQgE71MVNRMSUGIM+IYG+EacxE4+IRWawVAU5LosMO4O/gYN2pW0OjwPUk+yX4j4SdiVAeIUJTRG1HeMCxHkBKsVoODspiZxJOn97p3sFBxHGbrcGSBCNffwYdOlfprmMy2fuNhzYKtBn2YEytgWqq2Du6qePQ5ghQig7FHdK+9e8hKAeI1jshHgPyCT4m5lP4xJQP9aP359cYyMoa/mzZ4PSAPYUanJiIe/waUueQoiuNjgr4YHe9y8ecldpTWBefWItgPStr7EWbbLM3eRYlQYIOJeuA28zqWIAyzoWm859Q7zbw6w16OOendluFORpA6AN4qtddzKUNURvEye55RWRxpA5oBk7WCApyoSuq4V65ssLZnMvmIykfon0AXfVCYfvY7qfdA6b6LylfMCQG2Pva0+tFNYRGqfyw+270vD/Cs4dwP2uEzXeTHygpENW/BG6ywO/doi+LxXk4FaAYGuDh6bZ/B8LAUEPnQ2vU9hwX30N9Kn7Hzc1uQPdlfWaD5l2XlCzevwmN9Gxdm4TFqdSBxL77kBCviYcCA+FvY0fF77aoHdvn5Xez+b5IuCMS2JkeR2UxxVwmg5n4bk+YzGR7um/hQleeHTpBuXaHQZb/FDboxoSCxwoZF1jUJbyRSdm0iro9Sjc68bW5gWk2GAa3spvMecR7uopAx/3TmU+Q3kQuKGzQ7eMX9EDhoGFggNmhTBD1fLR5ZutZNfMebOhO4y3DJ3y9awExnihbB1N+POu3LhAERm6ie1HpFwQbuoI7lPE6I32uoInZf8hf+LSbcwjPyQ3akYdGMnqqLFQuEBRpHlyyHpHFEHWHBMTH2Lnb59LqQKgUTG3oTvRG36KGu2NgJN+PpPzgNSA2wg62ow/qaIXCjZNIPVHZOYQvDidyI4pse3TkBFjIdN86wq+nOzsWAyt8GwgtjM2VBfHKdkmk6EiqjQJ3fs51h2pkOwDN9q3MiQxfznad++2zrNjpyydQ/WxB6iM2S12dbMrn8dCuB4AU6XedzYA7xPU3/01AmoQL1QGQV8MEywJ46547w8NrYL9BFgeKwAiDn+jqDKZ8QQTjpgNaIrTLUMO3Maeag+5QDtkd8wtdkgC8tT4d1eAt3mi0CIRjYApveVfKB74ksoSp2AoINQp08wdMd6iJJaBY0ypr+SclgVsKAIZ3ibuGJu4QuIOcZ6LY7Uj5zfX1KMSW7CFAVHih2OErCwOvA9AkeJECgb60JeLtGHwm62N2SNXIFkNLLVEf6/UVgyjHDBxn5XvQd6mRKZAwDKcAfVajwF3hDjodAqVL4EcLqwOQQn+NiAj6ozs6Xr4OwIwwWEdp4qOs4vsvu0AgAX1KowCCC4JrxgVd+zKodSO2WEfGcYwLnTbMPAvoYA6K4hitT0VC6spsvhf6AE8vU/Ze9F5VX6MAUguCixlSyHQJQkS/q907iwulBPGZm5DaMQAzwqAvEqbke1AXxSsuEBRADzYK0iYpKZpboUOQlLkW1Ylt7WhAlpSKHFmnLw5On1MlzlG3Hcm7L99nWxmCDQqKCyRyHrtRAMr8HOR3ebDpUFYWy4ERntcHs1WcRf+VTSEILB2eGwaD4LYPQ3Fv9SyQ5AKJnCfbKNA6yhpfgjAdgkG7k0WX+Fwwd7nLoj9+HtlbigDEls9Pd2+WPl0NgGoaVLdW7OVa4Gpfl+1IezC2+EZrrgH0OgBuqyusiUGa7SE9geF0bJ5YB2aZmCegufs9O2xQzQVqc7bRL9uWEUNg7EcIA4lNAbvGlcVQV4yovwl+KZDvUWZ7Utumu8elTVS6iUArxr0m+jaD1k13sie5AiCVxAbqtgiS4r4XcGlrhdFGMAsFKLNx7fsbk8XcITW4U7e9o3EhGATuQB1YsatPH7JpHoinFEVUK4DE77VSYHAeCM76m+6QyMEEkgPt0IRdMaIUX6E0vuHj7YvYERWX2lV3UNTSAuxOiZNiFMIOAz08IqI51UbgvlOcDgmMSK8DcjAwSkOKYce5ENC80/LOOu0UkjugTMnutPLPSQdA9Yaj0xAAj/NAeI8TS1KD3LI16JBtj4p1AAIjD5By+qXZHujeYaU3BiYO+msP4xiUp2uA7pu8JBJADwPR9VeYkmaDNu4QgKOMwaRDXL/KoQKW6w9MPwCFEn+HhE2UhcsYo9fhOdmbXfaPUYjWCyrIX/WQDmjOlFyHxx5BBWl/RZmd6znbdv2tHB+z+UFZkQxeQ75jd62lgLaSenhr9Sskdfe3asehgdEbkAb0K5sIQyUiKprdRWF1UZK1AcvZsjI2M3QLTXPkwRK1+nLK8VR3wi4SS42XS4VHQYFQxro6KRS4v3vIVAwDkQ5xWdxRB4xSAOGRB9FQSkFfveasImBxmwVk7Arjse2+QAB6GIiTQub92SHTRvi60zsgcf2OOuAkeO9igwsZfeJcXu89oX4FUi+4t8tQBRDYvxgGhV42+mIgrRGzPaVoUDFxAp4stug+ayb00XqH0MdOIQilw/x205OztvTOXz8e0KkASKWBI4pgw5apwoPd7w6ZWoJBCipg202DJ4st6RzI7uUfyD9tiihdc0+4HBPII/oEG+n6Z4D7FIhPfZRsnmNdS/kQGJ2whQQq3o5gt0lNAOjg+kp2d1kNxJu+kh6As1a6zIwB/B4ChC0Fqr38yvBRGJEA98DoRERIiN6OAXFQDOko148JVjHwohk9owcs9L9DEH8ElPsrQLM5TJwRlaMQEB6d6AkPxQN1ZbFooaZiybBHU2SGzMjJKYT3xsCJvblTKBBbEwwMwSIjErEL5UhF12SRWyVkh86FuDfdAMoBTWBakxEyY3ij/eL4M+sAXu/n3kuG0WR30LpjXARr2K0XDYM7cWSEB2v3gpSVyXDuItMNYYoPXkZXX8SDYVQh9MbALOvmUtq3+5epG2F6GDSsQywFMna1UpCcOAL2asIHiepDYh3Q4gQlgMhPQfXK7glefB9iousbzy0luPI1722bT+f6bWoUw4AFjI1py2wFVf5SvYslSIxfpfJ6HQBlvt/5GFBwDty339Abb+Q0b0/qePqr3Xe0IqPUwDZPdRmRSGPAG52wTFJtdk2iQ6D3blN1wAiVSOUJMXucN21Db4IqfRjWfQ0ghkGEEQEwYeBJiJCpKr24C1CxlAmPgjzkA6Zm7WP2dAEi8UcyevYVBA0QCQMkwY4US0F8pMI1SWUuxKqAQWNA2Y4KTLeHKPYZKGXHpU/fVATwMnAPPp1tiyJuEs/XBogJXsrWqtgVA8Y0SdVFwEqfNZLpQd/TAerqFFKxqMoP+MoYmI17PPGJ2GiAhr0MMaLgZJEYMLpJymU3KEfeAlfGpL9fbqHQJUeHyxmBL83OptfE/flw79EAPYyo7hCDO1lEEJ1IBd2qr8Op/ePRcjZDete8pjsGtI3505/9+iIwvlDhNMTHr69mgQTzR7szyIjEySKd/YOyAobne9TYtrEUK1YHLAYf7mHFkYHvg+O7dOeKJ3ZHiDALpFGd6k7tMuptIOiKWagPEtumiDhz6wB4aR7lImNH1FIev4gpnQ99fEeE3J+5lHOYHQokKTzSLlOeKIcBObC2oqgOJBd8RnjYJF4g/bhyXxsaQ9v59vyYF7QO9DkXSJSzArEJJ34xqCKuEXhzFqIkEJBalxLUH7KDZGgWbYYg/ghVmno6rnnlvti4N+ILuY7ksWEm/khgGK4RGNsBoWUBYZaxhCVBUFGsSJA9KDyXSi1i6njWC975/r8o2imS1SMi3uFIumsEZoOZ6wdgQ3LiB49d5z7bEM/xjbwYGDxKHrtWTvZfH/hx+A7ch88HkGZksYbaolJgcyTQesBaB5fd739CykNRiC+LARielsPPuRjPfamKAlUcgfFmIbPybB2RCvHAIIvh8KIBwbm0rjpgPErBEJpnCmES/vEysgL9sy5bHRuv8wFI0YjqyA1XCxhzjcizfQINOJv9U8fZ5/kY6HE8OwYlrsSkz7zstPh5USBN+1YI5jkJWQyES4EYXSiBOH5nxZFAn1ugOTEw2cHMvGa8IY0r02fHz5oCfZz3FxXbo3PSz7M4ClIBQA4DUjIfSRyX+CwA+31U9m84oSms98ZAQhMHTl8cun4lVlZfc86vio4LJLEdTenailksBRqtiiNeZv/a1Kc2Y4Nn14HUMoBpJCeQmN8Cu9QFS3+BdlE8mWEgWkCVYg4/RaRVTQeA6zltfI0M4ThQB1bN24QVKgZ+4mAMDGLXDexpr7/m6ffm067EQFD7lpgWn0KybaIpbI1WtYgXkYqyNSSrWCMGIKqYO92ejCDGwRiAVQGwFJ3nVJW75L3XH3+M8FiY1sWxpgFA3ASFI17XLRjEtJG3hl2jifbiGzkGvgPfpz16Vw8B9MLAuEB2jXRxDGx1vAZloVyANMmcgXuqVYzJGLA+mNSUxAibH2BBK9L/W2IV1D4AL+cBlKNGu5sLXEYk8h9TaYCijIWkK82EynDvA7qd6QcEMa5RtHhiAJyM/u63JUCBlDA4crl4vRckbRiQqXpR4DntHlgBZONAHYijPG74YJd27Pmwe4sAnhVO57/m86G7uq4kS4p6gwR0vlSpXuUVWmSDpRziOsGlK0GUR+bSMN7wCqiLuQ/hKWF2fuIHcVG8pl9HwsCylZo+cRDi5HF9/jGkaE/WMnLf65gmjkKtOwZMdK6+/7TIzL5m1QeglAK2SY5N63UHCVC1WW18O75nvA5497v1oZuiZD/v1Rn9veg/RwofIphcFsS+pdml4AgYCMWMJgnUGAA/MNDGdLZudJlCGJbOWYqC9IYA6MDraYzoDkg0zPUhjGwycKxLYVDazG5UhJxQPd9jRp5i19KC8ZS8Ltn3vHJyBRxOwnH3s+4UFMFj6b+KgdiVgir1QE+uYtE+JG0BMYbvjPDs/DgdxnCGJwbACbzoTL50lzaw9b+lJO45lNVS4KZ2jArlbHHA2J0YM4U6SUg8BvrAmilr41Fx2YBRbNBAGFAv7kdLgf1tng7ZHTEMeKYY2H1oIT8JhMoKWL9LLUx3iiQbVDtUmmK4B+lgo1mlIGZMWfjurQPoiVEMUOFoidAKUW8dwKmvv45uwbldZxRsUAYvCoI7kv7NUjCU++PfBu0j3Wm1gZ6Ao2v4hNcZI00IiSvXikWmEHIbFNwuWDAMhkMC5oYEpCsDmtICTbCG6kMvTCNXdpaFCwfAUlPoTkhZ/ycdBjbWx7SE8S2GK0Mw4xpYR685gFkGrxhKCSkyzII6YZ1vOb9xVPsurTPXv+3I5YPhEX+oXBIZsJKMxhmaHqiB9RxHChCYWRl9YhWa/tz3UqM7pCoA6lIhgG+0wyOIewPHtkNqz2sEFILBhbAXfNiVSkP65EQW9JYAmBIbVgUgCOds9zIWKjjGlJBmgD48aGQQGLSjxQZojOdEwJR+kQB3mh4Apxmj8ddMaoA+vEpflycHp8oCBioGdtmjGKgMGCgOCJmiYWtl3TON1IrxsnCOhp4eG10uUFwDzPua3FLA5+TM3I9JphS6XpO/ItwzBCkE0GAMTCkLU6MC3jpkColG2HgF6Pi6KAUYKx2YLwsaU0J3JC7AhXJw1wiSRqgmCQbrnoB4WKR63+4RHQFw7Aw6owKgB/fj63K8IvBERHN8mgJ8RqkDGNAPOfmriwE1BmyUhyPkVwSyj97103d7sjvxkIiVAtLojac6gkDnayblgQWvUKASFWJlmBIbg9/CR/XO4JTFBtDaoPYs0BjJqfa+FbN7ETzo1g27LMSArj4rzIWQHCKk3hmuGwZNMlhWUC1MCZLviIE76bNAEbijwVsUGxRRDRhq8GrGA9rx0EBKgnWU6ihkSQSoCM34lVPU82nU6OTAWMGF6vUABhfiX7MEf0hSsywQVwt1kGBANkRCEc3wQH0gz54dMICCMcKj1gQ7NgZoknqPubDmy2JAvEDZFiXChQxzU8SlpBYSBSTiCJGX+1kdwGDF4PhT2gVoWqXBwOivA33TqZesA7BgdIJfwxphWRkgGjhSiUBFIWDszlQ8oEFyFKvHAJOxHiAkBlLFQUHwirGL1YIY3jcmHS8FhQh2+Y/B7EUzVCkLzaNiKaBGKrh0SMn9/tecC5HOfCIWEI+BmBoO1QFPP9gPrSsLl5W5vg1KcRu0uB9NUlQd/qU8isGsH0z/ZUfMqwOoyNwITdLcGEf7Fi/iB4bImuJfe+vlL7uqZrXlb4pgrnTBGWEAN/HXA3Aq4pWsT8R2gsBMly1TBxLhYRcQE8GpL1wTaRYv6sb3BUegOx5VOsH619id+HdNrJcCkp7YxoMOd2x+AVJNTxmpnlQYigFPDXeaql8aAzDc4cosiMkIX1IkASqJv6ElxEhLUwpKoMtKQOs089Re21BIFtDtzlRq1CdI8UckgdtTy64Q6GYvOCOvvysMChcoXAQQ5QtKUoQ1ESL2RKr5ukp+eAwkdQKyIBRJP2rxoF3m6VH5gqQSUCNKm7NY7xHBslloWDP67z66uUDVMSxWJMjsv/FwpLIghgGWiZ+TH1ZVUIM+7wx42gB1XiTA1GQ+cUfIevFBbXAiFxpc1w/L+lxdGsB2gQJsp0R8Ew+k3IMSI9ISP6HUTdPTPzIZYNQBzMaDIRvM3BxsGI9A/4IxcD4p6uoDuC6QXQS4umWh0ihgoso12ktBSABQJtOLEI9gPR4DWQM07hHF9In7c8+MAbjMqHNGA2RcoNYO4kWgRnYbBnaaV3hRhCC17N+2RPXc79YEx7bPGzgYiIpxXmQ9NHV98MlhEIyEGAXS0Y+iwa8UAarv2SsGsqgoS8FOdQzO416DXh2wuZCGxT5eZFuiMDIx0SsDpi8tOC0MphQEkwKZuZ+UvOsznzLl11Hxem5RCqgMhjoqIEWHlDrQjgxpuR+8YMjLWf/O7MTEjLHqifbopbJ+PBgyNqgJ+mDKbzI9NCSnDIb9M64viEAfxfQvwl3M/Z4Y8OFolog4U5rfIsiHBLx7hHMW1vUTYjwb1KD7otgFOjL6/i2x+5ErYAnrlftZl45UQVA3bVZyvy+IPfY/x9Lp9oimbuAF15tkHmRBCQ3QRkj5I5UuGEkXvI5I0kh/A26G9ZYOeZUBdVKEujAQxYAtlDGia/UpUZfxdwTVoi7BpUweHEj8jALZGoBdcOhdVijEIqDleFKCobm/GpdQKoMtA9wOGnr8R1YCnjCYZefbsuH8zgCcOPYzy/GURTCJfQAT9AL1B8n8aaKiJkL7o7SphQbllQaoE7/cEi5/pUAwIKkQ56YnatESEAaWbPW6BJCZfZjmir6JAk3HeuSyYk2wSISK+0kKjCrrb5xn/xZLoxMq9IulgOpHoagbtL0yRrDeZRnZBSEaA0bHoIvApJjMIAWCc+c9p3P6juCpKVCA/GhZ//BzoBC+LM2/mL0eDMe/hTawwB2IAXTTv14QUM/xIWpku0NroJxaYAnTpyFobWrHqSGxdYJN8iM6oVRXDBTdT2hJDtSJvMzuFcOpU75QH2IxgLFGgRMVGqAjitlN/4E2mQXlgTXEbxmIWIf1vp9rukD68wnaakAFKZKLAFToL1VBBXTOcCS4t7JYa4FJvhBqsxKxyiAHhlEHYqNE012dJUcWTBUDE+38/grwOineSP8c+vVDIuk/agIrAkcpAAH9PNmLVaKZIHK5kGyJSpDVugSi44kdyvhEZ/PkLRZP6FtNf+VKA4h+P2rdADHfVz6KUATEUnDgHiSqwwSx4IfqMYCiHoAQERLfOEMNq9XAtINsd+hquJ+e/nENyoPPkkQwqwTG65LIguocDzWsIY77/TIQ7pRVr9QxEPSAQoRsMeCr4aQd1NHZjcP3XbjHE7HeFw/l05U+gKEEGsSz65scDzWNYXAV2E7b/4Kj+cC1csggAkseoDQogZrbYw7SYdgOmrX4azXQ32uDToQ7dlYAqSHAXSCUtEETD1D7ntq/UJcFC/di/0siP/LaAGVWFO1qIBEVNFXBiDIOxUD+pNR1hwZo21MvyuuDFSBEgbJxVpmepSBuFC0I/0JdFoAZpvIzQbkTVCmMPP2DUA2y9ija1SOT/kV/8/zsvm5JwDlwR0bmcTwAkI0AkXmlcBwRV8BlB0BHv3oPKCHFq4Fcm/SQsP91G2crm8R9kF19cv24Elhh/2vXJAPAaBIzlq8GA1VKtG0LBNBv1o465eslQqsGnLVDV8PYrQPckgo2iadg+swDjt7ojc4OADApfo1CMc0TquSlVRw687Hs/xLTjdgFtRqgdiJGpBpkGFEHKQraoxMhPuUEu3NGncefOFkDaOlfrgY17QFkU9OlL+XWAZF4iaFSuorKrI5q1dtKQGkCRFjQii1PBvGdzegng36EKZFgg07FfQVCVgRAckXLqekG6JUfWpQaUpK9JkSw6QlA5YoiWcwkogpQ7zH3qOE1O8AtpDc0H/HjTr99fxEAkdSdvTXmKecsrHEGRRsB6soAzbAQqNRfJj/1L4Hkn6fdOJXojQxB2BcCZTVmqhQMiuNu4n6FWf9ZT1QqgGKcD0K/6QaU6wQEuBeVQaT+7WZB5MkAcYfnRisXuDTaAoO+kLHFUDYexhnRuodWMJ+5BYHaAHDhXp7l2A195qWWd4IYCSKb9ywgLR5ki10KEnT3CLJ9oUk9gaEwkNpkI7g8DfHjTa7IbyJUAOr+VaQmlwx9adkASN8CG4iIjANFY0DUwWCKYIjqgQ4vqD8e8vuhT4Tj3M06z+Q/LQUihfyQMh0J/vIBOeu3W+7WA9VQr7hHluxbI8htArgpsxAGqi9k20RZ9n9KKYA1s/vv4vrjNUGqALfXmmDyaA/EhuWcHykuHthfTdpXq0n8AE4TQF4GILmiSObyK00EKztBOCyoY2MVTyfA7O7YEDWnyfCdDnfLBSL3pK0I7qWMq27hXIhgkNYWNz+SlJCwNADIygEz8cBlq7tXSjD3h2akxw7Me72fM1z8cwTr+WXhTvuKsJgCPlZjZd+OhudIewo1/ma743QThYGBUM3xbBCj7scWWMgiGjvo1Q0V9L3by8Hipth0OJ5sd6oB8GAuEFcC2OiBOhgaHBpVoZmaRk15K0ctubsAWatkvHGJ0hL1DzKS2sBGZ2CWGIAZKwRg8VLGCz59gggGa7fc9F9C7IVC2/8HggH1BTHI6BAGTqV2UzIGUinapuqy4dCoDFi8kckb4R7YFsUVwdsrESlekLJ8lvTHQ22E3mDQlkTyIQjREhWYj0HKk/a/saoYxoaCYFJHrLMO0CVSe9fmuE8NYBzAKPEfLRhIX05OQbjrl2E4GHA3NGGoFJSEB/XTwZxI0PjSAP+B2c3gcTsIAzltqZ8zRwOQ6P9gfZiFJEFdDV0x/noNcSgqlMMn7WBAUJcEIFscg8rYXBCymgzotoMGhe/S/XzeOL8w96XudCMojsjQ0j8V+YwYdGjgHZFX1pN6RB9456XyL7DJ+nVgJzZX215E7A+ELFGvN3w2+59SCugSubzvBe+EdPSepDqAzPARcK9syBN6Z0rjv+wBl5ke2AllYpDY8bCnc0btsLlG+dqpA4FRuRW5f8oGJ7Ms0aXdqxW/Q9UHIPAsoHrzWpEUdfyKpN1fdgCUQ4udOxW3FJvQbRhR7HAKdRqCb69i7kWXmgmdboAuZf/X5P21BmhcIIUxU5EFX3cbW88y28SumdU6Hdb2OpYKkH+Id4QRlcUNFakDsaOtnd1Cpe6bhtEhCkRv6IKt6GTR6RHVukAEVieVH1pBKB0wEFtFgGKmB2UCFHS4d4dBaQoVvxWC5IrGuVBwJmLgnMmZdWBwGdfUEaBzoI+iC0QgEQaQFbDQ/bWPbpd+A95fg2IqjgZCAmHjOSh8YW2SlTy8ETNtAQg7nlMWhZ3UAbieEkhqgBsd3KNsBjNP0DikWqBD4u9Fer5uVoGJoFfDpYW+XQ2wzPpiN0BfjKvOBZkQH6RAsHICYhb0161foZVxdYhg4ohhAqDsc1mHtkvpH9kf0wKVbwax/0QonB+OeyhmhzKkCMVugNT/EtdPinyGd0VmzcCNoH/F9lUjoLxOPXmJ4KMCSJOV5cnV1eFFcfTv1qqOSQB5QxRBGUn3oBFkniQQw0DMvsi+iAsAF53zBQBN9fsHQHkFe3SsAkC9v+cWDx3odxxLFgNUDmyhWRpJFhlcEkTCAClGPML7BkzZJhrm9r9oDPr0kaDvrQD8+Lr6yF4EuD2f5aJ/DyotBkA/tgyU9M8iAUtJAHIrANmHhqSuCoj2AcwD9rJFoC8SYPZiSHxfsndt0/kVgGriW1WAmvY8q8GOvwfBra4DGvqNNS0gCYBgJBzA1QsCsAPi0dwgqFLGxo5DpthN7Qk3vfv7ESJ4nTwg/Sn3x+04I4zENbgS/9nZf6X5Gh+JJKJRGKkAiqNa62BoRu7YH4f1H9dm/ZgqQN4QkHx6DYuR5le2CPSZPx/n/5zAlKwjkp59gHYagg1Ocv5Tsf8CVQ+CG7WRR1C8TmA7HzWUiZ3XYgYDb3ghSDaozumD/gzE1DCYQ/+QCYl16I/inq6O+2gfgEqoFL5n0wFoKgCHflUEOO4pAXShFAQ5IBPEuIkBnvux+K8xLuXVYSYK4woy2wKbjv4LDkFcQgST2QEopyl36r9n01vTOd5wv08ZNf9i7F8Z6KhT5GaoAXV3SLSA2HmSNkCNVoCxK1a3+zlk+AxD/5tw34rgfQ6CmiEzKvZzplr17imfAAAehQVU4j6+l2Ekr6Mu/rkSEOSP+K2yHgBA2DNUHjuLnK43y/+hEPrFlb74g75YAY7cTK0MePmVBfkpK8CtJj9UU38j5avC13Z+gjeSHBg4rEwsOwOSUYN6SJTeaLN6OCUos7Ab9EZwAJ34ybhHzzA9KBDVew9Cc6xvLX9x07soSt69b1D8SwT4sGb1y33PSVsqmZKJxfoy1JZuspUAwgvqpifGFHCHBkjEEvVEmruXm7vj5WWhj+FIwMoFwkIHw5bR6xWuSC3zAYAHwo0AaPN/CqunSf90AySgh2L8o2KGdg9DkRQPCilCtJDkQjaS/iO+p5v+xYWawfiMw/SzJh2y5ZGqrRFvVCKVk5Vj9qFI/4fwpWpLFQIF+iXibwAPdicox+9J9xsGnLzlGypKWiwpmg7W/VC7CMQ/rXOOAsCvgP6s0/JaDXD0gwvyo6X/XfiWuZ+o4j8786kQfwN8tGmekA3/xJZOIqf+qKrqtg8Agg7ua8TaB7BiBvQ59NNfGfpfMg59BABTwK9ca6b/ffaBisCBWuk+mQ80YYB1SHDIRsY/NW9USu0I7cQoApuDYEemanUgWARScO+oA7Nyf3ab148GfR0Az10hip1riapzTp8BYKR/ourf44tHRYGarF9+y8HtLHwBITz8T1cnQuJgXGrUDDN2ZFxazEK/7SjgZeB4/g/aNEChgGnDRGuAbmtkm/T/ALgpiX+nQLAxn1IB70vAqlUvbJcUeRy6secjEHE3dYzr4LD7GUHtRPSvoz34RaAXKFAlghsLqI6BGxQDP2LiL0C/5/4D98+IaWwfEj58kvYLculQAiJKX0xsbEFgU1RV/ga2/oQxq74bQHgBXL7XQaoDgB8wuslZ3KjMYwuDp/v5jIQjAB4F6IvcX+KeNvZ/8H4Oeopt/WB4vCYVRpQaYfyJ3vEtEc6d9UBHZh84w5k/9kPfgHs9AGo9i4UGaLUvVbSHdpJTCIDXt4+6DuzBUKOAwNz0E6qFv4gSwzb7fihOB4G0HqAbhZjrLqVG3+ZQ/3cz/qsNRygBIPGfZ8d3b3tRnf5fvmdRAYA2oCuIL++vOsGBMBDn21Qb1FYCiokZFcHF2GzfmuAV9uXqY/C+APosAJomAFS5/yA/JJCfw/O5bU+vs/6L9jTf7l9gbVDWYYB8U2iOe7TqPrqfTOGKGppY7Z3NRUByqymcDbU/An0pAEDuAb9Gx+jA/e78EFSknxMe2n2iB0uJpGZLKhcf2tWAUyDqQb8K+phXA/ktISa0wLr3+qResNI3gN4LADgWNJZF4EB/k/tJhv4O+j39H5HAw0Acj9aOgQFhe4lqjx3wmwMGZRdXw3SI4O5MGV/5fsHbp0C/DQBBAW8B8BK+qKO/lrzP6kCPNv2/ug0ohQEq9UE7+xFixzCR7gKBPAc6KEa75W+niTk1JeOfwX0RAEivDM0DoGH/oKN/4z9PuJcV4FkQKnqzh0ED+uAKseYQbN0eFXtkfKGMOMODxoowVHdjHpmEC5Gf3p1of+jXA+AfqwClBdSwf3yZP3uENOh/8Z993nPDghwGDfQj8QCsU8GA2zGqjjNy+Yh78/ZFJ/jHcK9SIGrYP7TaF4oi8HgAaui/HdVgJzzUMB9eCqiOByUGWn0sDbSlabq0MqZsEcR7BRpQUpNwTcrv3vF87uj/FyAeOwLgtSCY4AYy86Gd6hTo37P+qxRsib/aX5O2e6i6BylWBzRFa7qithpGvYwM+j/dLhCk0D+pOn0T6I2/ogoA4v4P1MIXZPTDrXgUigpQZv2dDpVwL6OCXo+iXgGQrFNc+XnuQDn0Z72Xjq1QDHsRp0JwhXb/Gty3AfAobdDS/4HD+jy6Yxv6oYyKnfBsoKfS7akjgeoi8LyH9uOHXRZk7MUb6wygtjLmAwGBp6GfPhvragA8mj5AwXwe2xe3Iv0/4FjtRQXRf/0LB/pf8dBk+oYFlRkd/cO6q7+5tINI5jNNGGhzmhh2Y1IsqE/+4rIIjDunf6TncAQA1R0ALCgQNfynVAIb7WkrAFTor4gQ1iexamGAlv+DeltAZeropLTgid88eKZYRhN5/AUHga6G+yMA/nsTbNDD/YSa/Ijsf0v8bQWQ8n17PzFe4p31qxEh9Gj9oMWJfwMcfwf6sgvUBABAJX8fzwGhh5L+66z/+oKFBP+iTf/SWUYGEYr0ht872bto6/Dph/7iX4K+LIKxCAAh/Re4hwL6O+F5wb3kFw9WChoOYhQE4/gZJSRQapD1W9146gJwW3uMDCB9qJlzwq99f/yjB1Ui+LD/odK+Le8vsv6L9O9hwNI8oQR3VOx8+2yvsJXZw4WGtzDp6wBMWQ18/tafXxBvmwimgwId9j9UCyMfexGAog7AK/2XfEYgOTX0CaVIiBSBshXQrETxNnaekoZX6Nd1q4FntoHpq3BvBgBL/4+S/2wN4z33U/0uEbWYfu27yENCfGMxWgQwaMgofS6dl01OddONoGvi7FOnQV8uUB0APP03FOiA1KNoY+E26gzbRkPifyIGRUaE8k5VhgZwmQ+OLaG61kbhlzmk8ZOnQbcKAEUA7HtFvdL/Rvpb86c5EpIEhlPxfqj9UPsdnaEEctZ+hgX1yYAsO4o8hH8PtesDoCgCuIvg3QDdSH+T41/9AU0MgLTvZrAOBNbmvjeHjaNw2iAQjVL5PxU/mwu07WkOVCzfZRYQfwePQToGYmKnqlMzEBH5UOw5H3v8gaL2zjoc4DeC5ptKx/2/N6IyALYYeDYHKu0rkh/aeL844CkO/XMZoFGgSKZ3y0X8czUm/s0jU0+60Q/9iygQHcsAsNy5sJl/Lpyfg+5vtKf5r6XDfEkIFh+o2xwA1eX8iE/3gjuJ4w/9WgDcSmLTCIDN+TncT2LpHyXLHyQZgJlFGbQeMvRX0DBZV3xZAOxZtu0BF6T/+RWh6XXicfhkdQ9oB7lkZEBAGaPHcK7I2mk5vn/mjxIAsG0DsW+NVUw9EBXof0L/Vq1lUQc/QaBDBOZJLPHEHH60xw+dVXZWps+f2T9NBEPNf16zbUXn60j8BfRLqnP8B4XN3/Af5b2Ux4SSo/mrP+lZczXRIQj6ExB8dwX4R49HvYE9vtB/+D8I9NzZakP/EQM3tqkJKto3u09sN9BHisZAhMxHpyf3f/EwiQJtyeYGQE/0YzHz8zh0MBToVxc6gh4D7NMj6BrH0U+m+FCViX9Mel40AJ5YxNIFeobB45jwKT0fOQb4WS/NF31rq5I7M+c2hjgFf3jJ2PvLAqAKAISaxO8bnOzmD722PxEGnkEy9Wv0O4MymMfbKSMSkWDAzwHNjzXJLtDrRIkbIEJ5XkZ1dliNftIt/wM2UrKvJiri++/QepRfGzQ/7K4JAKTHDQDghi9z81giTLXrT2arC1tLlDp2QMYzTJ5O9NEPlF9MgZ6ew+3Ys/a16HEvBXyJo05aqGFEwDgShDfbd9G/ZvE7nhB4P417HQqECHSDx22rA0X6LxO/trMVRVhwatVJqg8wDlb8jZr9UfZ1fzwbYQjwb6sA9QKx47SLjuF+7b0csYOW8Zkf7P6oBqDbqwLQv+KcvMdB/ZtdPl+mTb3bM/0+zOv/6T/SpVWA2z+gfwD/XvznmALiEz6QP98Hp6LpHcMRPxR+cwWAGzz+AT5j4Hl7yBPOO/pFh4c6ZMBbNxzs2BTkR0u+LQDoRgRwuwHdNw+UXjM/RNW+bny68yUTxI0eapFwwaznD1DQZcLvV0lWV4AX/2nO/tWnO334hB+ibvh80Tbfv9s7AwAR6A7077VrOT3UBS6q3p27QdTv9hMt51Gg5y64/14BANvYc+X5iFResjIp/2a+PRB+kfjnK8A/uN0B/lUbPRCf75+BF/zzSPzF2+UqAN5fCvg4JFjr7zaLevuO/7wAdP4mCn+xJwfAUwHv6wD2ESDgQ84LWOLPzPih+d0B8J9XB0CWvyjrV+r6WOgzEfZD21eL4DvAv4r/0C9bf+jt9wmlA+BG9FTAj3JTON30/CXD3+2rAuBOcA8MNv9uv9tXBgDcCe7F9ugS+SWXF//C5qe2P7UC/E+5Ibr1BtDv/f3dvrAC/C8dO538UPnL1n8wAMiF/q8F9SE3+r3BPRrgd/vd/m4A/CP475vOU/7dfrf3i+DXaXi/2+/2NyvAr3n4u/3pAMBfAPxuf/f2/wMAQAlQpLLpCe4AAAAASUVORK5CYII=\";\r\n\r\n/**\r\n * Stores information about Browser and hardware capabilities\r\n */\r\nx3dom.caps = { PLATFORM: navigator.platform, AGENT: navigator.userAgent, RENDERMODE: \"HARDWARE\" };\r\n\r\n/**\r\n * Registers the node defined by @p nodeDef.\r\n * The node is registered with the given @p nodeTypeName and @p componentName.\r\n *\r\n * @param nodeTypeName the name of the node type (e.g. Material, Shape, ...)\r\n * @param componentName the name of the component the node type belongs to\r\n * @param nodeDef the definition of the node type\r\n */\r\nx3dom.registerNodeType = function(nodeTypeName, componentName, nodeDef) {\r\n    // console.log(\"Registering nodetype [\" + nodeTypeName + \"] in component [\" + componentName + \"]\");\r\n    if (x3dom.components[componentName] === undefined) {\r\n        x3dom.components[componentName] = {};\r\n    }\r\n    nodeDef._typeName = nodeTypeName;\r\n    nodeDef._compName = componentName;\r\n    x3dom.components[componentName][nodeTypeName] = nodeDef;\r\n    x3dom.nodeTypes[nodeTypeName] = nodeDef;\r\n    x3dom.nodeTypesLC[nodeTypeName.toLowerCase()] = nodeDef;\r\n};\r\n\r\n/**\r\n * Test if node is registered X3D element\r\n *\r\n * @param node\r\n */\r\nx3dom.isX3DElement = function(node) {\r\n    // x3dom.debug.logInfo(\"node=\" + node + \"node.nodeType=\" + node.nodeType + \", node.localName=\" + node.localName + \", \");\r\n    var name = (node.nodeType === Node.ELEMENT_NODE && node.localName) ? node.localName.toLowerCase() : null;\r\n    return (name && (x3dom.nodeTypes[node.localName] || x3dom.nodeTypesLC[name] ||\r\n        name == \"x3d\" || name == \"websg\" || name == \"route\"));\r\n};\r\n\r\n/**\r\n * Function: x3dom.extend\r\n *\r\n * Returns a prototype object suitable for extending the given class\r\n * _f_. Rather than constructing a new instance of _f_ to serve as\r\n * the prototype (which unnecessarily runs the constructor on the created\r\n * prototype object, potentially polluting it), an anonymous function is\r\n * generated internally that shares the same prototype:\r\n *\r\n * @param f - Method f a constructor\r\n * @returns A suitable prototype object\r\n *\r\n * @see Douglas Crockford's essay on <prototypical inheritance at http://javascript.crockford.com/prototypal.html>.\r\n * @todo unify with defineClass, which does basically the same\r\n */\r\nx3dom.extend = function(f) {\r\n    function G() {}\r\n\r\n    G.prototype = f.prototype || f;\r\n    return new G();\r\n};\r\n\r\n/**\r\n * Function x3dom.getStyle\r\n *\r\n * Computes the value of the specified CSS property <tt>p</tt> on the\r\n * specified element <tt>e</tt>.\r\n *\r\n * @param oElm       - The element on which to compute the CSS property\r\n * @param strCssRule - The name of the CSS property\r\n *\r\n * @eturn - The computed value of the CSS property\r\n */\r\nx3dom.getStyle = function(oElm, strCssRule) {\r\n    var strValue = \"\";\r\n    var style = document.defaultView.getComputedStyle ? document.defaultView.getComputedStyle(oElm, null) : null;\r\n    if (style) {\r\n        strValue = style.getPropertyValue(strCssRule);\r\n    } else if (oElm.currentStyle) {\r\n        strCssRule = strCssRule.replace(/\\-(\\w)/g, function(strMatch, p1) { return p1.toUpperCase(); });\r\n        strValue = oElm.currentStyle[strCssRule];\r\n    }\r\n\r\n    return strValue;\r\n};\r\n\r\n/**\r\n * Utility function for defining a new class.\r\n *\r\n * @param parent the parent class of the new class\r\n * @param ctor the constructor of the new class\r\n * @param methods an object literal containing the methods of the new class\r\n *\r\n * @returns the constructor function of the new class\r\n */\r\nfunction defineClass(parent, ctor, methods) {\r\n    if (parent) {\r\n        function Inheritance() {}\r\n\r\n        Inheritance.prototype = parent.prototype;\r\n\r\n        ctor.prototype = new Inheritance();\r\n        ctor.prototype.constructor = ctor;\r\n        ctor.superClass = parent;\r\n    }\r\n\r\n    if (methods) {\r\n        for (var m in methods) {\r\n            ctor.prototype[m] = methods[m];\r\n        }\r\n    }\r\n\r\n    return ctor;\r\n}\r\n\r\n/**\r\n * Utility function for testing a node type.\r\n *\r\n * @param object the object to test\r\n * @param clazz the type of the class\r\n * @returns true or false\r\n */\r\nx3dom.isa = function(object, clazz) {\r\n    /*\r\n    if (!object || !object.constructor || object.constructor.superClass === undefined) {\r\n        return false;\r\n    }\r\n    if (object.constructor === clazz) {\r\n        return true;\r\n    }\r\n\r\n    function f(c) {\r\n        if (c === clazz) {\r\n            return true;\r\n        }\r\n        if (c.prototype && c.prototype.constructor && c.prototype.constructor.superClass) {\r\n            return f(c.prototype.constructor.superClass);\r\n        }\r\n        return false;\r\n    }\r\n\r\n    return f(object.constructor.superClass);\r\n    */\r\n\r\n    return (object instanceof clazz);\r\n};\r\n\r\n/**\r\n * Get Global Helper\r\n *\r\n * @returns {*}\r\n */\r\nx3dom.getGlobal = function() {\r\n    return (function() {\r\n        return this;\r\n    }).call(null);\r\n};\r\n\r\n/**\r\n * Load javascript file either by performing an synchronous jax request\r\n * an eval'ing the response or by dynamically creating a <script> tag.\r\n *\r\n * CAUTION: This function is a possible source for Cross-Site\r\n *          Scripting Attacks.\r\n *\r\n * @param  src  The location of the source file relative to\r\n *              path_prefix. If path_prefix is omitted, the\r\n *              current directory (relative to the HTML document)\r\n *              is used instead.\r\n * @param  path_prefix A prefix URI to add to the resource to be loaded.\r\n *                     The URI must be given in normalized path form ending in a\r\n *                     path separator (i.e. src/nodes/). It can be in absolute\r\n *                     URI form (http://somedomain.tld/src/nodes/)\r\n * @param  blocking    By default the lookup is done via blocking jax request.\r\n *                     set to false to use the script i\r\n */\r\nx3dom.loadJS = function(src, path_prefix, blocking) {\r\n    blocking = (blocking === false) ? blocking : true;   // default to true\r\n\r\n    if (blocking) {\r\n        var url = (path_prefix) ? path_prefix.trim() + src : src;\r\n        var req = new XMLHttpRequest();\r\n\r\n        if (req) {\r\n            // third parameter false = synchronous/blocking call\r\n            // need this to load the JS before onload completes\r\n            req.open(\"GET\", url, false);\r\n            req.send(null); // blocking\r\n\r\n            // maybe consider global eval\r\n            // http://perfectionkills.com/global-eval-what-are-the-options/#indirect_eval_call_examples\r\n            eval(req.responseText);\r\n        }\r\n    } else {\r\n        var head = document.getElementsByTagName('HEAD').item(0);\r\n        var script = document.createElement(\"script\");\r\n        var loadpath = (path_prefix) ? path_prefix.trim() + src : src;\r\n        if (head) {\r\n            x3dom.debug.logError(\"Trying to load external JS file: \" + loadpath);\r\n            // alert(\"Trying to load external JS file: \" + loadpath);\r\n            script.type = \"text/javascript\";\r\n            script.src = loadpath;\r\n            head.appendChild(script);\r\n        } else {\r\n            alert(\"No document object found. Can't load components!\");\r\n            // x3dom.debug.logError(\"No document object found. Can't load components\");\r\n        }\r\n    }\r\n};\r\n\r\n/**\r\n * Array to Object Helper\r\n */\r\nfunction array_to_object(a) {\r\n    var o = {};\r\n    for (var i = 0; i < a.length; i++) {\r\n        o[a[i]] = '';\r\n    }\r\n    return o;\r\n}\r\n\r\n/**\r\n * Provides requestAnimationFrame in a cross browser way.\r\n *\r\n * @see https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/demos/common/webgl-utils.js\r\n */\r\nwindow.requestAnimFrame = (function() {\r\n    return window.requestAnimationFrame ||\r\n        window.webkitRequestAnimationFrame ||\r\n        window.mozRequestAnimationFrame ||\r\n        window.oRequestAnimationFrame ||\r\n        window.msRequestAnimationFrame ||\r\n        function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {\r\n            window.setTimeout(callback, 16);\r\n        };\r\n})();\r\n\r\n/**\r\n * Toggle full-screen mode\r\n */\r\nx3dom.toggleFullScreen = function() {\r\n    if (document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen) {\r\n        if (document.cancelFullScreen) {\r\n            document.cancelFullScreen();\r\n        } else if (document.mozCancelFullScreen) {\r\n            document.mozCancelFullScreen();\r\n        } else if (document.webkitCancelFullScreen) {\r\n            document.webkitCancelFullScreen();\r\n        }\r\n    } else {\r\n        var docElem = document.documentElement;\r\n        if (docElem.requestFullScreen) {\r\n            docElem.requestFullScreen();\r\n        } else if (docElem.mozRequestFullScreen) {\r\n            docElem.mozRequestFullScreen();\r\n        } else if (docElem.webkitRequestFullScreen) {\r\n            docElem.webkitRequestFullScreen();\r\n        }\r\n    }\r\n};\r\n\n/**\r\n * X3DOM JavaScript Library\r\n * http://www.x3dom.org\r\n *\r\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\r\n * Dual licensed under the MIT and GPL\r\n *\r\n * Based on code originally provided by\r\n * Philip Taylor: http://philip.html5.org\r\n */\r\n\r\nx3dom.debug = {\r\n    INFO:      \"INFO\",\r\n    WARNING:   \"WARNING\",\r\n    ERROR:     \"ERROR\",\r\n    EXCEPTION: \"EXCEPTION\",\r\n\r\n    // determines whether debugging/logging is active. If set to \"false\"\r\n    // no debugging messages will be logged.\r\n    isActive: false,\r\n\r\n    // stores if firebug is available\r\n    isFirebugAvailable: false,\r\n\r\n    // stores if the x3dom.debug object is initialized already\r\n    isSetup: false,\r\n\r\n    // stores if x3dom.debug object is append already (Need for IE integration)\r\n    isAppend: false,\r\n\r\n    // stores the number of lines logged\r\n    numLinesLogged: 0,\r\n\r\n    // the maximum number of lines to log in order to prevent\r\n    // the browser to slow down\r\n    maxLinesToLog: 10000,\r\n\r\n    // the container div for the logging messages\r\n    logContainer: null,\r\n\r\n    /**\r\n     * @brief Setup the x3dom.debug object.\r\n     *\r\n     * Checks for firebug and creates the container div for the logging messages.\r\n     */\r\n    setup: function() {\r\n        // If debugging is already setup simply return\r\n        if (x3dom.debug.isSetup) {\r\n            return;\r\n        }\r\n\r\n        // Check for firebug console\r\n        try {\r\n            if (window.console.firebug !== undefined) {\r\n                x3dom.debug.isFirebugAvailable = true;\r\n            }\r\n        }\r\n        catch (err) {\r\n            x3dom.debug.isFirebugAvailable = false;\r\n        }\r\n\r\n        x3dom.debug.setupLogContainer();\r\n\r\n        // setup should be setup only once, thus store if we done that already\r\n        x3dom.debug.isSetup = true;\r\n    },\r\n\r\n    /**\r\n     * @brief Activates the log\r\n     *\r\n     * @param visible\r\n     */\r\n    activate: function(visible) {\r\n        x3dom.debug.isActive = true;\r\n        x3dom.debug.logContainer.style.display = (visible) ? \"block\" : \"none\";\r\n    },\r\n\r\n    /**\r\n     * @brief Inserts a container div for the logging messages into the HTML page\r\n     *\r\n     */\r\n    setupLogContainer: function() {\r\n        x3dom.debug.logContainer = document.createElement(\"div\");\r\n        x3dom.debug.logContainer.setAttribute(\"class\", \"x3dom-log\");\r\n    },\r\n\r\n    appendElement: function(x3dElement)\r\n    {\r\n        x3dElement.appendChild(x3dom.debug.logContainer);\r\n    },\r\n\r\n    /**\r\n     * @brief Generic logging function which does all the work.\r\n     *\r\n     * @param msg the log message\r\n     * @param logType the type of the log message. One of INFO, WARNING, ERROR or EXCEPTION.\r\n     */\r\n    doLog: function(msg, logType) {\r\n\r\n        // If logging is deactivated do nothing and simply return\r\n        if (!x3dom.debug.isActive) {\r\n            return;\r\n        }\r\n\r\n        // If we have reached the maximum number of logged lines output\r\n        // a warning message\r\n        if (x3dom.debug.numLinesLogged === x3dom.debug.maxLinesToLog) {\r\n            msg = \"Maximum number of log lines (=\" + x3dom.debug.maxLinesToLog +\r\n                \") reached. Deactivating logging...\";\r\n        }\r\n\r\n        // If the maximum number of log lines is exceeded do not log anything\r\n        // but simply return\r\n        if (x3dom.debug.numLinesLogged > x3dom.debug.maxLinesToLog) {\r\n            return;\r\n        }\r\n\r\n        // Output a log line to the HTML page\r\n        var node = document.createElement(\"p\");\r\n        node.style.margin = 0;\r\n        switch (logType) {\r\n            case x3dom.debug.INFO:\r\n                node.style.color = \"#00ff00\";\r\n                break;\r\n            case x3dom.debug.WARNING:\r\n                node.style.color = \"#cd853f\";\r\n                break;\r\n            case x3dom.debug.ERROR:\r\n                node.style.color = \"#ff4500\";\r\n                break;\r\n            case x3dom.debug.EXCEPTION:\r\n                node.style.color = \"#ffff00\";\r\n                break;\r\n            default:\r\n                node.style.color = \"#00ff00\";\r\n                break;\r\n        }\r\n\r\n        // not sure if try/catch solves problem http://sourceforge.net/apps/trac/x3dom/ticket/52\r\n        // but due to no avail of ATI gfxcard can't test\r\n        try {\r\n            node.innerHTML = logType + \": \" + msg;\r\n            x3dom.debug.logContainer.insertBefore(node, x3dom.debug.logContainer.firstChild);\r\n        } catch (err) {\r\n            if (window.console.firebug !== undefined) {\r\n                window.console.warn(msg);\r\n            }\r\n        }\r\n\r\n        // Use firebug's console if available\r\n        if (x3dom.debug.isFirebugAvailable) {\r\n            switch (logType) {\r\n                case x3dom.debug.INFO:\r\n                    window.console.info(msg);\r\n                    break;\r\n                case x3dom.debug.WARNING:\r\n                    window.console.warn(msg);\r\n                    break;\r\n                case x3dom.debug.ERROR:\r\n                    window.console.error(msg);\r\n                    break;\r\n                case x3dom.debug.EXCEPTION:\r\n                    window.console.debug(msg);\r\n                    break;\r\n                default:\r\n                    break;\r\n            }\r\n        }\r\n\r\n        x3dom.debug.numLinesLogged++;\r\n    },\r\n\r\n    /**\r\n     * @brief Log an info message.\r\n     *\r\n     * @param msg\r\n     */\r\n    logInfo: function(msg) {\r\n        x3dom.debug.doLog(msg, x3dom.debug.INFO);\r\n    },\r\n\r\n    /**\r\n     * @brief Log a warning message.\r\n     *\r\n     * @param msg\r\n     */\r\n    logWarning: function(msg) {\r\n        x3dom.debug.doLog(msg, x3dom.debug.WARNING);\r\n    },\r\n\r\n    /**\r\n     * @brief Log an error message.\r\n     *\r\n     * @param msg\r\n     */\r\n    logError: function(msg) {\r\n        x3dom.debug.doLog(msg, x3dom.debug.ERROR);\r\n    },\r\n\r\n    /**\r\n     * @brief Log an exception message.\r\n     *\r\n     * @param msg\r\n     */\r\n    logException: function(msg) {\r\n        x3dom.debug.doLog(msg, x3dom.debug.EXCEPTION);\r\n    },\r\n\r\n    /**\r\n     * @brief Log an assertion.\r\n     *\r\n     * @param c\r\n     * @param msg\r\n     */\r\n    assert: function(c, msg) {\r\n        if (!c) {\r\n            x3dom.debug.doLog(\"Assertion failed in \" +\r\n                x3dom.debug.assert.caller.name + ': ' +\r\n                msg, x3dom.debug.ERROR);\r\n        }\r\n    },\r\n\r\n    /**\r\n     * @brief Checks the type of a given object.\r\n     *\r\n     * @param obj the object to check.\r\n     * @returns one of; \"boolean\", \"number\", \"string\", \"object\", \"function\", or \"null\".\r\n     */\r\n    typeOf: function(obj) {\r\n        var type = typeof obj;\r\n        return type === \"object\" && !obj ? \"null\" : type;\r\n    },\r\n\r\n    /**\r\n     * @brief Checks if a property of a specified object has the given type.\r\n     *\r\n     * @param obj the object to check.\r\n     * @param name the property name.\r\n     * @param type the property type (optional, default is \"function\").\r\n     * @returns true if the property exists and has the specified type, otherwise false.\r\n     */\r\n    exists: function(obj, name, type) {\r\n        type = type || \"function\";\r\n        return (obj ? this.typeOf(obj[name]) : \"null\") === type;\r\n    },\r\n\r\n    /**\r\n     * @brief Dumps all members of the given object.\r\n     *\r\n     * @param node\r\n     */\r\n    dumpFields: function(node) {\r\n        var str = \"\";\r\n        for (var fName in node) {\r\n            str += (fName + \", \");\r\n        }\r\n        str += '\\n';\r\n        x3dom.debug.logInfo(str);\r\n        return str;\r\n    }\r\n};\r\n\r\n// Call the setup function to... umm, well, setup x3dom.debug\r\nx3dom.debug.setup();\n/*\r\n * X3DOM JavaScript Library\r\n * http://www.x3dom.org\r\n *\r\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\r\n * Dual licensed under the MIT and GPL\r\n *\r\n * Based on code originally provided by\r\n * Philip Taylor: http://philip.html5.org\r\n */\r\n\r\n//---------------------------------------------------------------------------------------------------------------------\r\n\r\nx3dom.arc = {};\r\nx3dom.arc.instance = null;\r\n\r\nx3dom.arc.Limits = function(min, max, initial)\r\n{\r\n    this._min = min;\r\n    this._max = max;\r\n\r\n    this.getValue = function(value)\r\n    {\r\n        value = this._min + (this._max - this._min) * value;\r\n        return this._max >= value ? (this._min <= value ? value : this._min ) : this._max;\r\n    };\r\n};\r\n\r\n//---------------------------------------------------------------------------------------------------------------------\r\n\r\nx3dom.arc.ARF = function(name, min, max, dirFac, factorGetterFunc, factorSetterFunc, getterFunc, setterFunc)\r\n{\r\n    this._name = name;\r\n    //start with average\r\n    this._stateValue = [ 0.5, 0.5 ];\r\n\r\n    this._limits = new x3dom.arc.Limits(min, max);\r\n    this._factorGetterFunc = factorGetterFunc;\r\n    this._factorSetterFunc = factorSetterFunc;\r\n    this._setterFunc = setterFunc;\r\n    this._getterFunc = getterFunc;\r\n    this._dirFac = dirFac;\r\n\r\n    this.getFactor = function()\r\n    {\r\n        return this._factorGetterFunc();\r\n    };\r\n\r\n    this.update = function(state, step)\r\n    {\r\n        var stateVal = this._stateValue[state] + step * this._dirFac;\r\n        this._stateValue[state] =  0 <= stateVal ? ( 1 >= stateVal ? stateVal : 1 ) : 0;\r\n        this._setterFunc(this._limits.getValue(this._stateValue[state]));\r\n    };\r\n\r\n    this.reset = function()\r\n    {\r\n        this._stateValue[0] = 0.5;\r\n        this._stateValue[1] = 0.5;\r\n    };\r\n};\r\n\r\n//---------------------------------------------------------------------------------------------------------------------\r\n\r\nx3dom.arc.AdaptiveRenderControl = defineClass(\r\n    null,\r\n    function(scene)\r\n    {\r\n        x3dom.arc.instance = this;\r\n\r\n        this._scene = scene;\r\n        this._targetFrameRate = [];\r\n        this._targetFrameRate[0] = this._scene._vf.minFrameRate;\r\n        this._targetFrameRate[1] = this._scene._vf.maxFrameRate;\r\n\r\n        this._currentState = 0;\r\n\r\n        var that = this;\r\n        var environment = that._scene.getEnvironment();\r\n\r\n        this._arfs = [];\r\n\r\n        this._arfs.push(\r\n            new x3dom.arc.ARF(\"smallFeatureCulling\",\r\n                0, 10, -1,\r\n                function()\r\n                {\r\n                    return environment._vf.smallFeatureFactor;\r\n                },\r\n                function(value)\r\n                {\r\n                    environment._vf.smallFeatureFactor = value;\r\n                },\r\n                function()\r\n                {\r\n                    return  environment._vf.smallFeatureThreshold;\r\n                },\r\n                function(value)\r\n                {\r\n                    environment._vf.smallFeatureThreshold = value;\r\n                }\r\n            )\r\n        );\r\n\r\n        this._arfs.push(\r\n            new x3dom.arc.ARF(\"lowPriorityCulling\",\r\n                0,100,1,\r\n                function()\r\n                {\r\n                    return environment._vf.lowPriorityFactor;\r\n                },\r\n                function(value)\r\n                {\r\n                    environment._vf.lowPriorityFactor = value;\r\n                },\r\n                function()\r\n                {\r\n                    return environment._vf.lowPriorityThreshold * 100;\r\n                },\r\n                function(value)\r\n                {\r\n                    environment._vf.lowPriorityThreshold = value / 100;\r\n                }\r\n            )\r\n        );\r\n\r\n        this._arfs.push(\r\n            new x3dom.arc.ARF(\"tessellationDetailCulling\",\r\n                1,12,-1,\r\n                function()\r\n                {\r\n                    return environment._vf.tessellationErrorFactor;\r\n                },\r\n                function(value)\r\n                {\r\n                    environment._vf.tessellationErrorFactor = value;\r\n                },\r\n                //@todo: this factor is a static member of PopGeo... should it belong to scene instead?\r\n                function()\r\n                {\r\n                    return environment.tessellationErrorThreshold;\r\n                },\r\n                function(value)\r\n                {\r\n                    environment.tessellationErrorThreshold = value;\r\n                }\r\n            )\r\n        );\r\n\r\n        this._stepWidth = 0.1;\r\n    },\r\n    {\r\n        update : function(state, fps) // state: 0 = static, 1 : moving\r\n        {\r\n            this._currentState = state;\r\n            var delta =  fps - this._targetFrameRate[state];\r\n\r\n            //to prevent flickering\r\n            this._stepWidth = Math.abs(delta) > 10 ? 0.1 : 0.01;\r\n\r\n            /*if( (delta > 0 && state == 1) || (delta < 0 && state == 0))\r\n                return;\r\n            */\r\n\r\n            var factorSum = 0;\r\n            var normFactors = [];\r\n\r\n            //normalize factors\r\n            var i, n = this._arfs.length;\r\n\r\n            for(i = 0; i < n; ++i)\r\n            {\r\n                normFactors[i] = this._arfs[i].getFactor();\r\n                if(normFactors[i] > 0)\r\n                    factorSum += normFactors[i];\r\n            }\r\n\r\n            var dirFac = delta < 0 ? -1 : 1;\r\n            for(i = 0; i < n; ++i)\r\n            {\r\n                if(normFactors[i] > 0)\r\n                {\r\n                    normFactors[i] /= factorSum;\r\n                    this._arfs[i].update(state, this._stepWidth * normFactors[i] * dirFac);\r\n                }\r\n            }\r\n        },\r\n\r\n        reset: function()\r\n        {\r\n            for( var i = 0, n = this._arfs.length; i < n; ++i)\r\n            {\r\n                this._arfs[i].reset();\r\n            }\r\n        }\r\n    }\r\n);\r\n\r\n//---------------------------------------------------------------------------------------------------------------------\r\n\r\n\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * Philip Taylor: http://philip.html5.org\n */\n \n \n /**\n * Class: x3dom.DownloadManager\n *\n * Simple priority-based download manager.\n * Before objects of priority n+1 are available,\n * all objects of priority n must have been already delivered.\n * The highest priority key is 0.\n * \n */\n\n/// a small Request class\nx3dom.Request = function(url, onloadCallback, priority){\n\tthis.url \t  \t\t     = url;\t\n\tthis.priority \t\t   = priority;\n\tthis.xhr \t  \t\t     = new XMLHttpRequest();\n\tthis.onloadCallbacks = [onloadCallback];\n\t\n\tvar self = this;\n\n\tthis.xhr.onload = function() {\t\t\n\t\tif (x3dom.DownloadManager.debugOutput) {\n\t\t\tx3dom.debug.logInfo('Download manager received data for URL \\'' + self.url + '\\'.');\n\t\t}\n\t\t\n\t\t--x3dom.DownloadManager.activeDownloads;\n\t\n    if ((x3dom.DownloadManager.stallToKeepOrder === false ) || (x3dom.DownloadManager.resultGetsStalled(self.priority) === false)) {\n      var i;\n      for (i = 0; i < self.onloadCallbacks.length; ++i) {\t\t\t\n        self.onloadCallbacks[i](self.xhr.response);\n      }\n      \n      x3dom.DownloadManager.removeDownload(self);\n      \n      x3dom.DownloadManager.updateStalledResults();\n    }\n    else if (x3dom.DownloadManager.debugOutput) {\n\t\t\tx3dom.debug.logInfo('Download manager stalled downloaded result for URL \\'' + self.url + '\\'.');\n\t\t}\n    \n\t\tx3dom.DownloadManager.tryNextDownload();\n\t};\n};\n\n\nx3dom.Request.prototype.send = function() {\n\tthis.xhr.open('GET', encodeURI(this.url), true); //asynchronous\t\n\t\n\t//at the moment, ArrayBuffer is the only possible return type\n\tthis.xhr.responseType = 'arraybuffer';\n\t\n\tthis.xhr.send(null);\n\t\n\tif (x3dom.DownloadManager.debugOutput) {\n\t\tx3dom.debug.logInfo('Download manager posted XHR for URL \\'' + this.url + '\\'.');\n\t}\n};\n\n\nx3dom.DownloadManager = {\n\n    requests \t\t     : [], //map priority->[requests]\n\n    maxDownloads \t   : 6,  //number of max. concurrent downloads\n\n    activeDownloads  : 0,  //number of active downloads\n\n    debugOutput\t\t   : false,\n\n    stallToKeepOrder : false,\n\n\n    toggleDebugOutput : function(flag) {\n        this.debugOutput = flag;\t\n    },\n\n\n    toggleStrictReturnOrder : function(flag) {\n      //@todo: this is not working properly yet!\n      this.stallToKeepOrder = false;\n      //this.stallToKeepOrder = flag;\n    },\n\n\n    removeDownload : function(req) {\n        var i, j;\n        var done = false;\n\n        for (i = 0; i < this.requests.length && !done; ++i) {\t\n            if (this.requests[i]){\t\t\t\n                for (j = 0; j < this.requests[i].length; ++j) {\n                    if (this.requests[i][j] === req) {\n                        this.requests[i].splice(j, 1);\n                        done = true;\n                        break;\n                    }\n                }\n            }\n        }\n    },\n\n\n    tryNextDownload : function() {\n        var firstRequest;\n        var i, j;\n            \n        //if there are less then maxDownloads running, start a new one,\n        //otherwise do nothing\n        if (this.activeDownloads < this.maxDownloads) {\t\n            //remove first queue element, if any\n            for (i = 0; i < this.requests.length && !firstRequest; ++i) {\n                //find the request queue with the highest priority\n                if (this.requests[i]) {\n                    //remove first unsent request from the queue, if any\n                    for (j = 0; j < this.requests[i].length; ++j) {\t\t\t\t\t\n                        if (this.requests[i][j].xhr.readyState === XMLHttpRequest.UNSENT) {\n                            firstRequest = this.requests[i][j];\n                            break;\t\t\t\t\t\t\n                        }\n                    }\n                }\n            }\n            \n            if (firstRequest) {\t\t\n                firstRequest.send();\t\t\t\n                \n                ++this.activeDownloads;\n            }\n        }\n    },\n\n\n    resultGetsStalled : function(priority) {\n      var i;\n      \n      for (i = 0; i < priority; ++i) {\n        if (this.requests[i] && this.requests[i].length) {\n          return true;\n        }\n      }\n      \n      return false;\n    },\n\n\n    updateStalledResults : function() {\n      if (x3dom.DownloadManager.stallToKeepOrder) {  \n        var i, j, k;\n        var req, pendingRequestFound = false;\n        \n        for (i = 0; i < this.requests.length && !pendingRequestFound; ++i) {\n        \n          if (this.requests[i]) {\n            for (j = 0; j < this.requests[i].length; ++j) {\n              //check if there is a stalled result and relase it, if so\n              req = this.requests[i][j];\n              \n              if (req.xhr.readyState === XMLHttpRequest.DONE) {\n              \n                if (x3dom.DownloadManager.debugOutput) {\n                  x3dom.debug.logInfo('Download manager releases stalled result for URL \\'' + req.url + '\\'.');\n                }\n                \n                for (k = 0; k < req.onloadCallbacks.length; ++k) {\n                  req.onloadCallbacks[k](req.xhr.response);\n                }\n                \n                //remove request from the list\n                this.requests[i].splice(j, 1);          \n              }\n              //if there is an unfinished result, stop releasing results of lower priorities\n              else {\n                pendingRequestFound = true;\t\n              }\n            }\n          }\n          \n        }\n      }\n    },\n\n\n    /**\n     * Requests a download from the given URL, with the given onloadCallback and priority.\n     * The callback function will be invoked with a JSON object as parameter, where the\n     * 'arrayBuffer' member contains a reference to the requested data and the 'url' member\n     * contains the original user-given URL of the object.\n     * \n     * If there is no data from the given url available, but there is already a registered request\n     * for it, the new callback is just appended to the old registered request object. Note that,\n     * in this special case, the priority of the old request is not changed, i.e. the priority\n     * of the new request to the same url is ignored.\n     */\n    get : function(urls, onloadCallbacks, priorities) {\n      var i, j, k, r;\n      var found = false;\n      var url, onloadCallback, priority;\n      \n      if (urls.length !== onloadCallbacks.length || urls.length !== priorities.length)\n      {\n        x3dom.debug.logError('DownloadManager: The number of given urls, onload callbacks and priorities is not equal. Ignoring requests.');\n        return;\n      }\n      \n      //insert requests\n      for (k = 0; k < urls.length; ++k) {\n        if (onloadCallbacks[k] == undefined || priorities[k] == undefined) { // == also checks for null\n          x3dom.debug.logError('DownloadManager: No onload callback and / or priority specified. Ignoring request for \\\"' + urls[k] + '\\\"');\n          continue;\n        }\n        else {\n          url            = urls[k];\n          onloadCallback = onloadCallbacks[k];\n          priority       = priorities[k];\n          \n          //enqueue request priority-based or append callback to a matching active request\t\t\n          \n          //check if there is already an enqueued or sent request for the given url\n          for (i = 0; i < this.requests.length && !found; ++i) {\n            if (this.requests[i]) {\t\t\t\n              for (j = 0; j < this.requests[i].length; ++j) {\n                if (this.requests[i][j].url === url) {\n                  this.requests[i][j].onloadCallbacks.push(onloadCallback);\n                  \n                  if (x3dom.DownloadManager.debugOutput) {\n                    x3dom.debug.logInfo('Download manager appended onload callback for URL \\'' + url + '\\' to a registered request using the same URL.');\n                  }\n                  \n                  found = true;\n                  break;\n                }\n              }\n            }\n          }\n        \n          if (!found) {\n            r = new x3dom.Request(url, onloadCallback, priority);\n            \n            if (this.requests[priority] != undefined) {\n              this.requests[priority].push(r);\n            }\n            else {\n              this.requests[priority] = [r];\n            }\n          }\n        }\n      }\n      \n      //try to download data\n      for (i = 0; i < urls.length && this.activeDownloads < this.maxDownloads; ++i) {\n        this.tryNextDownload();    \n      }\n    },\n\n    abortAllDownloads : function()\n    {\n        var request;\n        \n        for ( var i = 0; i < this.requests.length; i++ )\n        {\n            if ( this.requests[ i ] != undefined )\n            {\n                for ( var j = 0; j < this.requests[ i ].length; j++ )\n                {\n                    //Get Request\n                    request = this.requests[i][j];\n                    \n                    //Abort XHR\n                    request.xhr.abort();\n                    \n                    //Remove Request\n                    this.removeDownload( request );\n                }\n            }\n        }\n    }\n\t\n};\n\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * Philip Taylor: http://philip.html5.org\n */\n\n /**\n * Class: x3dom.RequestManager\n */\n\nx3dom.RequestManager = {};\n\n/**\n *\n * @type {number}\n */\nx3dom.RequestManager.requests = [];\n\n/**\n *\n * @type {number}\n */\nx3dom.RequestManager.maxParallelRequests = 50;\n\n/**\n *\n * @type {number}\n */\nx3dom.RequestManager.failedRequests = 0;\n\n/**\n *\n * @type {number}\n */\nx3dom.RequestManager.loadedRequests = 0;\n\n/**\n *\n * @type {number}\n */\nx3dom.RequestManager.totalRequests = 0;\n\n\n/**\n *\n * @type {number}\n */\nx3dom.RequestManager.activeRequests = [];\n\n/**\n *\n * @type {number}\n */\nx3dom.RequestManager.requestHeaders = [];\n\n/**\n *\n * @type {number}\n */\nx3dom.RequestManager.withCredentials = false;\n\n\nx3dom.RequestManager.onSendRequest = function( counters ) {}; \nx3dom.RequestManager.onAbortAllRequests = function( counters ) {}; \n\n\n/**\n *\n * @param header\n * @param value\n */\nx3dom.RequestManager.addRequestHeader = function( header, value )\n{\n    this.requestHeaders.push( { header: header, value : value } );\n};\n\n/**\n *\n * @private\n */\nx3dom.RequestManager._sendRequest = function()\n{       \n    this.onSendRequest( this._getCounters() );\n\n    //Check if we have reached the maximum parallel request limit\n    if ( this.activeRequests.length > this.maxParallelRequests )\n    {\n        return;\n    }\n\n    //Get next available request\n    var request = this.requests.pop();\n\n    //Check if the request is valid\n    if ( request )\n    {\n        this.activeRequests.push( request );\n\n        //Send request\n        request.send( null );\n\n        //Trigger next request sending\n        this._sendRequest();\n    }\n};\n\n/**\n *\n */\nx3dom.RequestManager._getCounters = function () \n{\n    return {\n        loaded: this.loadedRequests,\n        active: this.activeRequests.length,\n        failed: this.failedRequests,\n        total: this.totalRequests,\n    };\n};\n\n/**\n *\n * @param request\n */\nx3dom.RequestManager.addRequest = function( request )\n{\n    //Return if request is not a valid XMLHttpRequest\n    if ( !( request instanceof XMLHttpRequest ) )\n    {\n        return;\n    }\n\n    //Increment total request counter\n    this.totalRequests++;\n\n    //Set withCredentials property\n    request.withCredentials = this.withCredentials;\n\n    //Set available request headers\n    for ( var i = 0; i < this.requestHeaders.length; i++ )\n    {\n        var header = this.requestHeaders[ i ].header;\n        var value = this.requestHeaders[ i ].value;\n\n        request.setRequestHeader( header, value );\n    }\n\n    //Listen for onLoad\n    request.addEventListener( \"load\", this._onLoadHandler.bind( this ) );\n\n    //Listen for onError\n    request.addEventListener( \"error\", this._onErrorHandler.bind( this ) );\n\n    //Push it to the list\n    this.requests.push( request );\n\n    //Send next available request\n    this._sendRequest();\n};\n\n/**\n *\n */\nx3dom.RequestManager.abortAllRequests = function()\n{\n    for ( var i = 0; i < this.activeRequests.length; i++ )\n    {\n        this.activeRequests[ i ].abort();\n    }\n\n    this.requests = [];\n    this.activeRequests = [];\n    this.failedRequests = 0;\n    this.loadedRequests = 0;\n    this.totalRequests = 0;\n\n    this.onAbortAllRequests( this._getCounters() );\n};\n\n/**\n *\n */\nx3dom.RequestManager._removeActiveRequest = function( request )\n{\n    var idx = this.activeRequests.indexOf( request );\n\n    return this.activeRequests.splice( idx, 1 );\n};\n\n/**\n *\n * @param e\n * @private\n */\nx3dom.RequestManager._onLoadHandler = function( e )\n{\n    //Decrement active request counter\n    this._removeActiveRequest( e.target );\n\n    //Increment loaded request counter\n    this.loadedRequests++;\n\n    //Send next available request\n    this._sendRequest();\n};\n\n/**\n *\n * @param e\n * @private\n */\nx3dom.RequestManager._onErrorHandler = function( e )\n{\n    //Decrement active request counter\n    this._removeActiveRequest( e.target );\n\n    //Increment loaded request counter\n    this.failedRequests++;\n\n    //Send next available request\n    this._sendRequest();\n};\n\n/**\n * Created by tsturm on 30.10.2014.\n */\n/**\n *  Parts Object is return\n */\nx3dom.MultiMaterial = function( params )\n{\n    this._origAmbientIntensity      = params.ambientIntensity;\n    this._origDiffuseColor          = params.diffuseColor;\n    this._origEmissiveColor         = params.emissiveColor;\n    this._origShininess             = params.shininess;\n    this._origSpeclarColor          = params.specularColor;\n    this._origTransparency          = params.transparency;\n\n    this._origBackAmbientIntensity  = params.backAmbientIntensity;\n    this._origBackDiffuseColor      = params.backDiffuseColor;\n    this._origBackEmissiveColor     = params.backEmissiveColor;\n    this._origBackShininess         = params.backShininess;\n    this._origBackSpecularColor     = params.backSpecularColor;\n    this._origBackTransparency      = params.backTransparency;\n\n    this._ambientIntensity          = params.ambientIntensity;\n    this._diffuseColor              = params.diffuseColor;\n    this._emissiveColor             = params.emissiveColor;\n    this._shininess                 = params.shininess;\n    this._specularColor             = params.specularColor;\n    this._transparency              = params.transparency;\n\n    this._backAmbientIntensity      = params.backAmbientIntensity;\n    this._backDiffuseColor          = params.backDiffuseColor;\n    this._backEmissiveColor         = params.backEmissiveColor;\n    this._backShininess             = params.backShininess;\n    this._backSpecularColor         = params.backSpecularColor;\n    this._backTransparency          = params.backTransparency;\n\n    this._highlighted               = false;\n\n    this.reset = function () {\n        this._ambientIntensity      = this._origAmbientIntensity;\n        this._diffuseColor          = this._origDiffuseColor;\n        this._emissiveColor         = this._origEmissiveColor;\n        this._shininess             = this._origShininess;\n        this._specularColor         = this._origSpeclarColor;\n        this._transparency          = this._origTransparency;\n        this._backAmbientIntensity  = this._origBackAmbientIntensity;\n        this._backDiffuseColor      = this._origBackDiffuseColor;\n        this._backEmissiveColor     = this._origBackEmissiveColor;\n        this._backShininess         = this._origBackShininess;\n        this._backSpecularColor     = this._origBackSpecularColor;\n        this._backTransparency      = this._origBackTransparency;\n    };\n\n};\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * Philip Taylor: http://philip.html5.org\n */\n\n\n/**\n *  Parts Object is return\n */\nx3dom.Parts = function(multiPart, ids, colorMap, emissiveMap, specularMap, visibilityMap)\n{\n    var parts = this;\n    this.multiPart = multiPart;\n    this.ids = ids;\n    this.colorMap = colorMap;\n    this.emissiveMap = emissiveMap;\n    this.specularMap = specularMap;\n    this.visibilityMap = visibilityMap;\n    this.width = parts.colorMap.getWidth();\n    this.widthTwo =  this.width * this.width;\n\n    /**\n     *\n     * @param color\n     * @param frontSide\n     */\n    this.setDiffuseColor = function(color, side)\n    {\n        var i, partID, pixelIDFront, pixelIDBack;\n\n        if(side == undefined && side != \"front\" && side != \"back\" && side != \"both\") {\n            side = \"both\";\n        }\n\n        color = x3dom.fields.SFColor.parse( color );\n\n        if (ids.length && ids.length > 1) //Multi select\n        {\n            //Get original pixels\n            var pixels = parts.colorMap.getPixels();\n\n            for ( i=0; i < parts.ids.length; i++ )\n            {\n                partID = parts.ids[i];\n                pixelIDFront = partID;\n                pixelIDBack = partID + this.widthTwo;\n\n                //Check for front/back\n                if (side == \"front\")\n                {\n                    this.multiPart._materials[partID]._diffuseColor = color;\n                }\n                else if(side == \"back\")\n                {\n                    this.multiPart._materials[partID]._backDiffuseColor = color;\n                }\n                else if(side == \"both\")\n                {\n                    this.multiPart._materials[partID]._diffuseColor = color;\n                    this.multiPart._materials[partID]._backDiffuseColor = color;\n                }\n\n                //If part is not highlighted update the pixel\n                if ( !this.multiPart._materials[partID]._highlighted )\n                {\n                    if (side == \"front\") {\n                        pixels[pixelIDFront].r = color.r;\n                        pixels[pixelIDFront].g = color.g;\n                        pixels[pixelIDFront].b = color.b;\n                    } else if(side == \"back\") {\n                        pixels[pixelIDBack].r = color.r;\n                        pixels[pixelIDBack].g = color.g;\n                        pixels[pixelIDBack].b = color.b;\n                    } else if(side == \"both\") {\n                        pixels[pixelIDFront].r = color.r;\n                        pixels[pixelIDFront].g = color.g;\n                        pixels[pixelIDFront].b = color.b;\n                        pixels[pixelIDBack].r = color.r;\n                        pixels[pixelIDBack].g = color.g;\n                        pixels[pixelIDBack].b = color.b;\n                    }\n                }\n            }\n\n            parts.colorMap.setPixels(pixels);\n        }\n        else\n        {\n            var xFront, yFront, xBack, yBack, pixelFront, pixelBack;\n\n            partID = parts.ids[0];\n            pixelIDFront = partID;\n            pixelIDBack = partID + this.widthTwo;\n\n            //Check for front/back\n            if (side == \"front\")\n            {\n                xFront = pixelIDFront % this.width;\n                yFront = Math.floor(pixelIDFront / this.width);\n                pixelFront = parts.colorMap.getPixel(xFront, yFront);\n                this.multiPart._materials[partID]._diffuseColor = color;\n            }\n            else if(side == \"back\")\n            {\n                xBack = pixelIDBack % this.width;\n                yBack = Math.floor(pixelIDBack / this.width);\n                pixelBack = parts.colorMap.getPixel(xBack, yBack);\n                this.multiPart._materials[partID]._backDiffuseColor = color;\n            }\n            else if(side == \"both\")\n            {\n                xFront = pixelIDFront % this.width;\n                yFront = Math.floor(pixelIDFront / this.width);\n                xBack = pixelIDBack % this.width;\n                yBack = Math.floor(pixelIDBack / this.width);\n                pixelFront = parts.colorMap.getPixel(xFront, yFront);\n                pixelBack = parts.colorMap.getPixel(xBack, yBack);\n                this.multiPart._materials[partID]._diffuseColor = color;\n                this.multiPart._materials[partID]._backDiffuseColor = color;\n            }\n\n            //If part is not highlighted update the pixel\n            if ( !this.multiPart._materials[partID]._highlighted )\n            {\n                if (side == \"front\")\n                {\n                    pixelFront.r = color.r;\n                    pixelFront.g = color.g;\n                    pixelFront.b = color.b;\n\n                    parts.colorMap.setPixel(xFront, yFront, pixelFront);\n                }\n                else if(side == \"back\")\n                {\n                    pixelBack.r = color.r;\n                    pixelBack.g = color.g;\n                    pixelBack.b = color.b;\n\n                    parts.colorMap.setPixel(xBack, yBack, pixelBack);\n                }\n                else if(side == \"both\")\n                {\n                    pixelFront.r = color.r;\n                    pixelFront.g = color.g;\n                    pixelFront.b = color.b;\n                    pixelBack.r = color.r;\n                    pixelBack.g = color.g;\n                    pixelBack.b = color.b;\n\n                    parts.colorMap.setPixel(xFront, yFront, pixelFront);\n                    parts.colorMap.setPixel(xBack, yBack, pixelBack);\n                }\n            }\n        }\n    };\n\n    /**\n     *\n     * @param frontSide\n     * @returns {*}\n     */\n    this.getDiffuseColor = function(side)\n    {\n        var i, partID;\n\n        if(side == undefined && side != \"front\" && side != \"back\") {\n            side = \"front\";\n        }\n\n        if (ids.length && ids.length > 1) //Multi select\n        {\n            var diffuseColors = [];\n\n            for ( i=0; i < parts.ids.length; i++ )\n            {\n                partID = parts.ids[i];\n\n                if(side == \"front\")\n                {\n                    diffuseColors.push(this.multiPart._materials[partID]._diffuseColor);\n                }\n                else if(side == \"back\")\n                {\n                    diffuseColors.push(this.multiPart._materials[partID]._backDiffuseColor);\n                }\n            }\n            return diffuseColors;\n        }\n        else\n        {\n            partID = parts.ids[0];\n\n            if(side == \"front\")\n            {\n                return this.multiPart._materials[partID]._diffuseColor;\n            }\n            else if(side == \"back\")\n            {\n                return this.multiPart._materials[partID]._backDiffuseColor;\n            }\n        }\n    };\n\n    /**\n     *\n     * @param color\n     * @param side\n     */\n    this.setEmissiveColor = function(color, side)\n    {\n        var i, partID, pixelIDFront, pixelIDBack;\n\n        if(side == undefined && side != \"front\" && side != \"back\" && side != \"both\") {\n            side = \"both\";\n        }\n\n        color = x3dom.fields.SFColor.parse( color );\n\n        if (ids.length && ids.length > 1) //Multi select\n        {\n            //Get original pixels\n            var pixels = parts.emissiveMap.getPixels();\n\n            for ( i=0; i < parts.ids.length; i++ )\n            {\n                partID = parts.ids[i];\n                pixelIDFront = partID;\n                pixelIDBack = partID + this.widthTwo;\n\n                //Check for front/back\n                if (side == \"front\")\n                {\n                    this.multiPart._materials[partID]._emissiveColor = color;\n                }\n                else if(side == \"back\")\n                {\n                    this.multiPart._materials[partID]._backEmissiveColor = color;\n                }\n                else if(side == \"both\")\n                {\n                    this.multiPart._materials[partID]._emissiveColor = color;\n                    this.multiPart._materials[partID]._backEmissiveColor = color;\n                }\n\n                //If part is not highlighted update the pixel\n                if ( !this.multiPart._materials[partID]._highlighted )\n                {\n                    if (side == \"front\") {\n                        pixels[pixelIDFront].r = color.r;\n                        pixels[pixelIDFront].g = color.g;\n                        pixels[pixelIDFront].b = color.b;\n                    } else if(side == \"back\") {\n                        pixels[pixelIDBack].r = color.r;\n                        pixels[pixelIDBack].g = color.g;\n                        pixels[pixelIDBack].b = color.b;\n                    } else if(side == \"both\") {\n                        pixels[pixelIDFront].r = color.r;\n                        pixels[pixelIDFront].g = color.g;\n                        pixels[pixelIDFront].b = color.b;\n                        pixels[pixelIDBack].r = color.r;\n                        pixels[pixelIDBack].g = color.g;\n                        pixels[pixelIDBack].b = color.b;\n                    }\n                }\n            }\n\n            parts.emissiveMap.setPixels(pixels);\n        }\n        else\n        {\n            var xFront, yFront, xBack, yBack, pixelFront, pixelBack;\n\n            partID = parts.ids[0];\n            pixelIDFront = partID;\n            pixelIDBack = partID + this.widthTwo;\n\n            //Check for front/back\n            if (side == \"front\")\n            {\n                xFront = pixelIDFront % this.width;\n                yFront = Math.floor(pixelIDFront / this.width);\n                pixelFront = parts.emissiveMap.getPixel(xFront, yFront);\n                this.multiPart._materials[partID]._emissiveColor = color;\n            }\n            else if(side == \"back\")\n            {\n                xBack = pixelIDBack % this.width;\n                yBack = Math.floor(pixelIDBack / this.width);\n                pixelBack = parts.emissiveMap.getPixel(xBack, yBack);\n                this.multiPart._materials[partID]._backEmissiveColor = color;\n            }\n            else if(side == \"both\")\n            {\n                xFront = pixelIDFront % this.width;\n                yFront = Math.floor(pixelIDFront / this.width);\n                xBack = pixelIDBack % this.width;\n                yBack = Math.floor(pixelIDBack / this.width);\n                pixelFront = parts.emissiveMap.getPixel(xFront, yFront);\n                pixelBack = parts.emissiveMap.getPixel(xBack, yBack);\n                this.multiPart._materials[partID]._emissiveColor = color;\n                this.multiPart._materials[partID]._backEmissiveColor = color;\n            }\n\n            //If part is not highlighted update the pixel\n            if ( !this.multiPart._materials[partID]._highlighted )\n            {\n                if (side == \"front\")\n                {\n                    pixelFront.r = color.r;\n                    pixelFront.g = color.g;\n                    pixelFront.b = color.b;\n\n                    parts.emissiveMap.setPixel(xFront, yFront, pixelFront);\n                }\n                else if(side == \"back\")\n                {\n                    pixelBack.r = color.r;\n                    pixelBack.g = color.g;\n                    pixelBack.b = color.b;\n\n                    parts.emissiveMap.setPixel(xBack, yBack, pixelBack);\n                }\n                else if(side == \"both\")\n                {\n                    pixelFront.r = color.r;\n                    pixelFront.g = color.g;\n                    pixelFront.b = color.b;\n                    pixelBack.r = color.r;\n                    pixelBack.g = color.g;\n                    pixelBack.b = color.b;\n\n                    parts.emissiveMap.setPixel(xFront, yFront, pixelFront);\n                    parts.emissiveMap.setPixel(xBack, yBack, pixelBack);\n                }\n            }\n        }\n    };\n\n    /**\n     *\n     * @param side\n     * @returns {*}\n     */\n    this.getEmissiveColor = function(side)\n    {\n        var i, partID;\n\n        if(side == undefined && side != \"front\" && side != \"back\") {\n            side = \"front\";\n        }\n\n        if (ids.length && ids.length > 1) //Multi select\n        {\n            var emissiveColors = [];\n\n            for ( i=0; i < parts.ids.length; i++ )\n            {\n                partID = parts.ids[i];\n\n                if(side == \"front\")\n                {\n                    emissiveColors.push(this.multiPart._materials[partID]._emissiveColor);\n                }\n                else if(side == \"back\")\n                {\n                    emissiveColors.push(this.multiPart._materials[partID]._backEmissiveColor);\n                }\n            }\n            return emissiveColors;\n        }\n        else\n        {\n            partID = parts.ids[0];\n\n            if(side == \"front\")\n            {\n                return this.multiPart._materials[partID]._emissiveColor;\n            }\n            else if(side == \"back\")\n            {\n                return this.multiPart._materials[partID]._backEmissiveColor;\n            }\n        }\n    };\n\n    /**\n     *\n     * @param color\n     * @param side\n     */\n    this.setSpecularColor = function(color, side)\n    {\n        var i, partID, pixelIDFront, pixelIDBack;\n\n        if(side == undefined && side != \"front\" && side != \"back\" && side != \"both\") {\n            side = \"both\";\n        }\n\n        color = x3dom.fields.SFColor.parse( color );\n\n        if (ids.length && ids.length > 1) //Multi select\n        {\n            //Get original pixels\n            var pixels = parts.specularMap.getPixels();\n\n            for ( i=0; i < parts.ids.length; i++ )\n            {\n                partID = parts.ids[i];\n                pixelIDFront = partID;\n                pixelIDBack = partID + this.widthTwo;\n\n                //Check for front/back\n                if (side == \"front\")\n                {\n                    this.multiPart._materials[partID]._specularColor = color;\n                }\n                else if(side == \"back\")\n                {\n                    this.multiPart._materials[partID]._backSpecularColor = color;\n                }\n                else if(side == \"both\")\n                {\n                    this.multiPart._materials[partID]._specularColor = color;\n                    this.multiPart._materials[partID]._backSpecularColor = color;\n                }\n\n                //If part is not highlighted update the pixel\n                if ( !this.multiPart._materials[partID]._highlighted )\n                {\n                    if (side == \"front\") {\n                        pixels[pixelIDFront].r = color.r;\n                        pixels[pixelIDFront].g = color.g;\n                        pixels[pixelIDFront].b = color.b;\n                    } else if(side == \"back\") {\n                        pixels[pixelIDBack].r = color.r;\n                        pixels[pixelIDBack].g = color.g;\n                        pixels[pixelIDBack].b = color.b;\n                    } else if(side == \"both\") {\n                        pixels[pixelIDFront].r = color.r;\n                        pixels[pixelIDFront].g = color.g;\n                        pixels[pixelIDFront].b = color.b;\n                        pixels[pixelIDBack].r = color.r;\n                        pixels[pixelIDBack].g = color.g;\n                        pixels[pixelIDBack].b = color.b;\n                    }\n                }\n            }\n\n            parts.specularMap.setPixels(pixels);\n        }\n        else\n        {\n            var xFront, yFront, xBack, yBack, pixelFront, pixelBack;\n\n            partID = parts.ids[0];\n            pixelIDFront = partID;\n            pixelIDBack = partID + this.widthTwo;\n\n            //Check for front/back\n            if (side == \"front\")\n            {\n                xFront = pixelIDFront % this.width;\n                yFront = Math.floor(pixelIDFront / this.width);\n                pixelFront = parts.specularMap.getPixel(xFront, yFront);\n                this.multiPart._materials[partID]._specularColor = color;\n            }\n            else if(side == \"back\")\n            {\n                xBack = pixelIDBack % this.width;\n                yBack = Math.floor(pixelIDBack / this.width);\n                pixelBack = parts.specularMap.getPixel(xBack, yBack);\n                this.multiPart._materials[partID]._backSpecularColor = color;\n            }\n            else if(side == \"both\")\n            {\n                xFront = pixelIDFront % this.width;\n                yFront = Math.floor(pixelIDFront / this.width);\n                xBack = pixelIDBack % this.width;\n                yBack = Math.floor(pixelIDBack / this.width);\n                pixelFront = parts.specularMap.getPixel(xFront, yFront);\n                pixelBack = parts.specularMap.getPixel(xBack, yBack);\n                this.multiPart._materials[partID]._specularColor = color;\n                this.multiPart._materials[partID]._backSpecularColor = color;\n            }\n\n            //If part is not highlighted update the pixel\n            if ( !this.multiPart._materials[partID]._highlighted )\n            {\n                if (side == \"front\")\n                {\n                    pixelFront.r = color.r;\n                    pixelFront.g = color.g;\n                    pixelFront.b = color.b;\n\n                    parts.specularMap.setPixel(xFront, yFront, pixelFront);\n                }\n                else if(side == \"back\")\n                {\n                    pixelBack.r = color.r;\n                    pixelBack.g = color.g;\n                    pixelBack.b = color.b;\n\n                    parts.specularMap.setPixel(xBack, yBack, pixelBack);\n                }\n                else if(side == \"both\")\n                {\n                    pixelFront.r = color.r;\n                    pixelFront.g = color.g;\n                    pixelFront.b = color.b;\n                    pixelBack.r = color.r;\n                    pixelBack.g = color.g;\n                    pixelBack.b = color.b;\n\n                    parts.specularMap.setPixel(xFront, yFront, pixelFront);\n                    parts.specularMap.setPixel(xBack, yBack, pixelBack);\n                }\n            }\n        }\n    };\n\n\n    /**\n     *\n     * @param side\n     * @returns {*}\n     */\n    this.getSpecularColor = function(side)\n    {\n        var i, partID;\n\n        if(side == undefined && side != \"front\" && side != \"back\") {\n            side = \"front\";\n        }\n\n        if (ids.length && ids.length > 1) //Multi select\n        {\n            var specularColors = [];\n\n            for ( i=0; i < parts.ids.length; i++ )\n            {\n                partID = parts.ids[i];\n\n                if(side == \"front\")\n                {\n                    specularColors.push(this.multiPart._materials[partID]._specularColor);\n                }\n                else if(side == \"back\")\n                {\n                    specularColors.push(this.multiPart._materials[partID]._backSpecularColor);\n                }\n            }\n            return specularColors;\n        }\n        else\n        {\n            partID = parts.ids[0];\n\n            if(side == \"front\")\n            {\n                return this.multiPart._materials[partID]._specularColor;\n            }\n            else if(side == \"back\")\n            {\n                return this.multiPart._materials[partID]._backSpecularColor;\n            }\n        }\n    };\n\n    /**\n     *\n     * @param transparency\n     * @param side\n     */\n    this.setTransparency = function(transparency, side)\n    {\n        var i, partID, pixelIDFront, pixelIDBack;\n\n        if(side == undefined && side != \"front\" && side != \"back\" && side != \"both\") {\n            side = \"both\";\n        }\n\n        if (ids.length && ids.length > 1) //Multi select\n        {\n            //Get original pixels\n            var pixels = parts.colorMap.getPixels();\n\n            for ( i=0; i < parts.ids.length; i++ )\n            {\n                partID = parts.ids[i];\n                pixelIDFront = partID;\n                pixelIDBack = partID + this.widthTwo;\n\n                //Check for front/back\n                if (side == \"front\")\n                {\n                    this.multiPart._materials[partID]._transparency = transparency;\n                }\n                else if(side == \"back\")\n                {\n                    this.multiPart._materials[partID]._backTransparency = transparency;\n                }\n                else if(side == \"both\")\n                {\n                    this.multiPart._materials[partID]._transparency = transparency;\n                    this.multiPart._materials[partID]._backTransparency = transparency;\n                }\n\n                //If part is not highlighted update the pixel\n                if ( !this.multiPart._materials[partID]._highlighted )\n                {\n                    if (side == \"front\") {\n                        pixels[pixelIDFront].a = 1.0 - transparency;\n                    } else if(side == \"back\") {\n                        pixels[pixelIDBack].a = 1.0 - transparency;\n                    } else if(side == \"both\") {\n                        pixels[pixelIDFront].a = 1.0 - transparency;\n                        pixels[pixelIDBack].a = 1.0 - transparency;\n                    }\n                }\n            }\n\n            parts.colorMap.setPixels(pixels);\n        }\n        else\n        {\n            var xFront, yFront, xBack, yBack, pixelFront, pixelBack;\n\n            partID = parts.ids[0];\n            pixelIDFront = partID;\n            pixelIDBack = partID + this.widthTwo;\n\n            //Check for front/back\n            if (side == \"front\")\n            {\n                xFront = pixelIDFront % this.width;\n                yFront = Math.floor(pixelIDFront / this.width);\n                pixelFront = parts.colorMap.getPixel(xFront, yFront);\n                this.multiPart._materials[partID]._transparency = transparency;\n            }\n            else if(side == \"back\")\n            {\n                xBack = pixelIDBack % this.width;\n                yBack = Math.floor(pixelIDBack / this.width);\n                pixelBack = parts.colorMap.getPixel(xBack, yBack);\n                this.multiPart._materials[partID]._backTransparency = transparency;\n            }\n            else if(side == \"both\")\n            {\n                xFront = pixelIDFront % this.width;\n                yFront = Math.floor(pixelIDFront / this.width);\n                xBack = pixelIDBack % this.width;\n                yBack = Math.floor(pixelIDBack / this.width);\n                pixelFront = parts.colorMap.getPixel(xFront, yFront);\n                pixelBack = parts.colorMap.getPixel(xBack, yBack);\n                this.multiPart._materials[partID]._transparency = transparency;\n                this.multiPart._materials[partID]._backTransparency = transparency;\n            }\n\n            //If part is not highlighted update the pixel\n            if ( !this.multiPart._materials[partID]._highlighted )\n            {\n                if (side == \"front\")\n                {\n                    pixelFront.a = 1.0 - transparency;\n\n                    parts.colorMap.setPixel(xFront, yFront, pixelFront);\n                }\n                else if(side == \"back\")\n                {\n                    pixelBack.a = 1.0 - transparency;\n\n                    parts.colorMap.setPixel(xBack, yBack, pixelBack);\n                }\n                else if(side == \"both\")\n                {\n                    pixelFront.a = 1.0 - transparency;\n                    pixelBack.a = 1.0 - transparency;\n\n                    parts.colorMap.setPixel(xFront, yFront, pixelFront);\n                    parts.colorMap.setPixel(xBack, yBack, pixelBack);\n                }\n            }\n        }\n    };\n\n\n    /**\n     *\n     * @param side\n     * @returns {*}\n     */\n    this.getTransparency = function(side)\n    {\n        var i, partID;\n\n        if(side == undefined && side != \"front\" && side != \"back\") {\n            side = \"front\";\n        }\n\n        if (ids.length && ids.length > 1) //Multi select\n        {\n            var transparencies = [];\n\n            for ( i=0; i < parts.ids.length; i++ )\n            {\n                partID = parts.ids[i];\n\n                if(side == \"front\")\n                {\n                    transparencies.push(this.multiPart._materials[partID]._transparency);\n                }\n                else if(side == \"back\")\n                {\n                    transparencies.push(this.multiPart._materials[partID]._backTransparency);\n                }\n            }\n            return transparencies;\n        }\n        else\n        {\n            partID = parts.ids[0];\n\n            if(side == \"front\")\n            {\n                return this.multiPart._materials[partID]._transparency;\n            }\n            else if(side == \"back\")\n            {\n                return this.multiPart._materials[partID]._backTransparency;\n            }\n        }\n    };\n\n    /**\n     *\n     * @param shininess\n     * @param frontSide\n     */\n    this.setShininess = function(shininess, side)\n    {\n        var i, partID, pixelIDFront, pixelIDBack;\n\n        if(side == undefined && side != \"front\" && side != \"back\" && side != \"both\") {\n            side = \"both\";\n        }\n\n        if (ids.length && ids.length > 1) //Multi select\n        {\n            //Get original pixels\n            var pixels = parts.specularMap.getPixels();\n\n            for ( i=0; i < parts.ids.length; i++ )\n            {\n                partID = parts.ids[i];\n                pixelIDFront = partID;\n                pixelIDBack = partID + this.widthTwo;\n\n                //Check for front/back\n                if (side == \"front\")\n                {\n                    this.multiPart._materials[partID]._shininess = shininess;\n                }\n                else if(side == \"back\")\n                {\n                    this.multiPart._materials[partID]._backShininess = shininess;\n                }\n                else if(side == \"both\")\n                {\n                    this.multiPart._materials[partID]._shininess = shininess;\n                    this.multiPart._materials[partID]._backShininess = shininess;\n                }\n\n                //If part is not highlighted update the pixel\n                if ( !this.multiPart._materials[partID]._highlighted )\n                {\n                    if (side == \"front\") {\n                        pixels[pixelIDFront].a = shininess;\n                    } else if(side == \"back\") {\n                        pixels[pixelIDBack].a = shininess;\n                    } else if(side == \"both\") {\n                        pixels[pixelIDFront].a = shininess;\n                        pixels[pixelIDBack].a = shininess;\n                    }\n                }\n            }\n\n            parts.specularMap.setPixels(pixels);\n        }\n        else\n        {\n            var xFront, yFront, xBack, yBack, pixelFront, pixelBack;\n\n            partID = parts.ids[0];\n            pixelIDFront = partID;\n            pixelIDBack = partID + this.widthTwo;\n\n            //Check for front/back\n            if (side == \"front\")\n            {\n                xFront = pixelIDFront % this.width;\n                yFront = Math.floor(pixelIDFront / this.width);\n                pixelFront = parts.specularMap.getPixel(xFront, yFront);\n                this.multiPart._materials[partID]._shininess = shininess;\n            }\n            else if(side == \"back\")\n            {\n                xBack = pixelIDBack % this.width;\n                yBack = Math.floor(pixelIDBack / this.width);\n                pixelBack = parts.specularMap.getPixel(xBack, yBack);\n                this.multiPart._materials[partID]._backShininess = shininess;\n            }\n            else if(side == \"both\")\n            {\n                xFront = pixelIDFront % this.width;\n                yFront = Math.floor(pixelIDFront / this.width);\n                xBack = pixelIDBack % this.width;\n                yBack = Math.floor(pixelIDBack / this.width);\n                pixelFront = parts.specularMap.getPixel(xFront, yFront);\n                pixelBack = parts.specularMap.getPixel(xBack, yBack);\n                this.multiPart._materials[partID]._shininess = shininess;\n                this.multiPart._materials[partID]._backShininess = shininess;\n            }\n\n            //If part is not highlighted update the pixel\n            if ( !this.multiPart._materials[partID]._highlighted )\n            {\n                if (side == \"front\")\n                {\n                    pixelFront.a = shininess;\n\n                    parts.specularMap.setPixel(xFront, yFront, pixelFront);\n                }\n                else if(side == \"back\")\n                {\n                    pixelBack.a = shininess;\n\n                    parts.specularMap.setPixel(xBack, yBack, pixelBack);\n                }\n                else if(side == \"both\")\n                {\n                    pixelFront.a = shininess;\n                    pixelBack.a = shininess;\n\n                    parts.specularMap.setPixel(xFront, yFront, pixelFront);\n                    parts.specularMap.setPixel(xBack, yBack, pixelBack);\n                }\n            }\n        }\n    };\n\n\n    /**\n     *\n     * @param side\n     * @returns {*}\n     */\n    this.getShininess = function(side)\n    {\n        var i, partID;\n\n        if(side == undefined && side != \"front\" && side != \"back\") {\n            side = \"front\";\n        }\n\n        if (ids.length && ids.length > 1) //Multi select\n        {\n            var shininesses = [];\n\n            for ( i=0; i < parts.ids.length; i++ )\n            {\n                partID = parts.ids[i];\n\n                if(side == \"front\")\n                {\n                    shininesses.push(this.multiPart._materials[partID]._shininess);\n                }\n                else if(side == \"back\")\n                {\n                    shininesses.push(this.multiPart._materials[partID]._backShininess);\n                }\n            }\n            return shininesses;\n        }\n        else\n        {\n            partID = parts.ids[0];\n\n            if(side == \"front\")\n            {\n                return this.multiPart._materials[partID]._shininess;\n            }\n            else if(side == \"back\")\n            {\n                return this.multiPart._materials[partID]._backShininess;\n            }\n        }\n    };\n\n    /**\n     *\n     * @param ambientIntensity\n     * @param side\n     */\n    this.setAmbientIntensity = function(ambientIntensity, side)\n    {\n        var i, partID, pixelIDFront, pixelIDBack;\n\n        if(side == undefined && side != \"front\" && side != \"back\" && side != \"both\") {\n            side = \"both\";\n        }\n\n        if (ids.length && ids.length > 1) //Multi select\n        {\n            //Get original pixels\n            var pixels = parts.emissiveMap.getPixels();\n\n            for ( i=0; i < parts.ids.length; i++ )\n            {\n                partID = parts.ids[i];\n                pixelIDFront = partID;\n                pixelIDBack = partID + this.widthTwo;\n\n                //Check for front/back\n                if (side == \"front\")\n                {\n                    this.multiPart._materials[partID]._ambientIntensity = ambientIntensity;\n                }\n                else if(side == \"back\")\n                {\n                    this.multiPart._materials[partID]._backAmbientIntensity = ambientIntensity;\n                }\n                else if(side == \"both\")\n                {\n                    this.multiPart._materials[partID]._ambientIntensity = ambientIntensity;\n                    this.multiPart._materials[partID]._backAmbientIntensity = ambientIntensity;\n                }\n\n                //If part is not highlighted update the pixel\n                if ( !this.multiPart._materials[partID]._highlighted )\n                {\n                    if (side == \"front\") {\n                        pixels[pixelIDFront].a = ambientIntensity;\n                    } else if(side == \"back\") {\n                        pixels[pixelIDBack].a = ambientIntensity;\n                    } else if(side == \"both\") {\n                        pixels[pixelIDFront].a = ambientIntensity;\n                        pixels[pixelIDBack].a = ambientIntensity;\n                    }\n                }\n            }\n\n            parts.emissiveMap.setPixels(pixels);\n        }\n        else\n        {\n            var xFront, yFront, xBack, yBack, pixelFront, pixelBack;\n\n            partID = parts.ids[0];\n            pixelIDFront = partID;\n            pixelIDBack = partID + this.widthTwo;\n\n            //Check for front/back\n            if (side == \"front\")\n            {\n                xFront = pixelIDFront % this.width;\n                yFront = Math.floor(pixelIDFront / this.width);\n                pixelFront = parts.emissiveMap.getPixel(xFront, yFront);\n                this.multiPart._materials[partID]._ambientIntensity = ambientIntensity;\n            }\n            else if(side == \"back\")\n            {\n                xBack = pixelIDBack % this.width;\n                yBack = Math.floor(pixelIDBack / this.width);\n                pixelBack = parts.emissiveMap.getPixel(xBack, yBack);\n                this.multiPart._materials[partID]._backAmbientIntensity = ambientIntensity;\n            }\n            else if(side == \"both\")\n            {\n                xFront = pixelIDFront % this.width;\n                yFront = Math.floor(pixelIDFront / this.width);\n                xBack = pixelIDBack % this.width;\n                yBack = Math.floor(pixelIDBack / this.width);\n                pixelFront = parts.emissiveMap.getPixel(xFront, yFront);\n                pixelBack = parts.emissiveMap.getPixel(xBack, yBack);\n                this.multiPart._materials[partID]._ambientIntensity = ambientIntensity;\n                this.multiPart._materials[partID]._backAmbientIntensity = ambientIntensity;\n            }\n\n            //If part is not highlighted update the pixel\n            if ( !this.multiPart._materials[partID]._highlighted )\n            {\n                if (side == \"front\")\n                {\n                    pixelFront.a = ambientIntensity;\n\n                    parts.emissiveMap.setPixel(xFront, yFront, pixelFront);\n                }\n                else if(side == \"back\")\n                {\n                    pixelBack.a = ambientIntensity;\n\n                    parts.emissiveMap.setPixel(xBack, yBack, pixelBack);\n                }\n                else if(side == \"both\")\n                {\n                    pixelFront.a = ambientIntensity;\n                    pixelBack.a = ambientIntensity;\n\n                    parts.emissiveMap.setPixel(xFront, yFront, pixelFront);\n                    parts.emissiveMap.setPixel(xBack, yBack, pixelBack);\n                }\n            }\n        }\n    };\n\n\n    /**\n     *\n     * @param side\n     * @returns {*}\n     */\n    this.getAmbientIntensity = function(side)\n    {\n        var i, partID;\n\n        if(side == undefined && side != \"front\" && side != \"back\") {\n            side = \"front\";\n        }\n\n        if (ids.length && ids.length > 1) //Multi select\n        {\n            var ambientIntensities = [];\n\n            for ( i=0; i < parts.ids.length; i++ )\n            {\n                partID = parts.ids[i];\n\n                if(side == \"front\")\n                {\n                    ambientIntensities.push(this.multiPart._materials[partID]._ambientIntensity);\n                }\n                else if(side == \"back\")\n                {\n                    ambientIntensities.push(this.multiPart._materials[partID]._backAmbientIntensity);\n                }\n            }\n            return ambientIntensities;\n        }\n        else\n        {\n            partID = parts.ids[0];\n\n            if(side == \"front\")\n            {\n                return this.multiPart._materials[partID]._ambientIntensity;\n            }\n            else if(side == \"back\")\n            {\n                return this.multiPart._materials[partID]._backAmbientIntensity;\n            }\n        }\n    };\n\n    /**\n     *\n     * @param color\n     */\n    this.highlight = function (color)\n    {\n        var i, partID, pixelIDFront, pixelIDBack, dtColor, eaColor, ssColor;\n\n        color = x3dom.fields.SFColor.parse( color );\n\n        if (ids.length && ids.length > 1) //Multi select\n        {\n            var hasChanged = false;\n\n            //Get original pixels\n            var dtPixels = parts.colorMap.getPixels();\n            var eaPixels = parts.emissiveMap.getPixels();\n            var ssPixels = parts.specularMap.getPixels();\n\n            dtColor = new x3dom.fields.SFColorRGBA(0, 0, 0, 1.0);\n            eaColor = new x3dom.fields.SFColorRGBA(color.r, color.g, color.b, 0);\n            ssColor = new x3dom.fields.SFColorRGBA(0, 0, 0, 0);\n\n            for ( i=0; i < parts.ids.length; i++ ) {\n                partID = parts.ids[i];\n                pixelIDFront = partID;\n                pixelIDBack  = (parseInt(partID) + parseInt(this.widthTwo)).toString();\n\n                if( !this.multiPart._materials[partID]._highlighted )\n                {\n                    hasChanged = true;\n\n                    this.multiPart._materials[partID]._highlighted = true;\n\n                    dtPixels[pixelIDFront] = dtColor;\n                    eaPixels[pixelIDFront] = eaColor;\n                    ssPixels[pixelIDFront] = ssColor;\n\n                    dtPixels[pixelIDBack] = dtColor;\n                    eaPixels[pixelIDBack] = eaColor;\n                    ssPixels[pixelIDBack] = ssColor;\n                }\n            }\n\n            if( hasChanged ) {\n                this.colorMap.setPixels(dtPixels, false);\n                this.emissiveMap.setPixels(eaPixels, false);\n                this.specularMap.setPixels(ssPixels, true);\n            }\n        }\n        else\n        {\n            partID = parts.ids[0];\n            pixelIDFront = partID;\n            pixelIDBack  = partID + this.widthTwo;\n\n            var xFront = pixelIDFront % this.width;\n            var yFront = Math.floor(pixelIDFront / this.width);\n\n            var xBack = pixelIDBack % this.width;\n            var yBack = Math.floor(pixelIDBack / this.width);\n\n            //If part is not highlighted update the pixel\n            if ( !this.multiPart._materials[partID]._highlighted )\n            {\n                this.multiPart._materials[partID]._highlighted = true;\n\n                dtColor = new x3dom.fields.SFColorRGBA(0, 0, 0, 1);\n                eaColor = new x3dom.fields.SFColorRGBA(color.r, color.g, color.b, 0);\n                ssColor = new x3dom.fields.SFColorRGBA(0, 0, 0, 0);\n\n                this.colorMap.setPixel(xFront, yFront, dtColor, false);\n                this.emissiveMap.setPixel(xFront, yFront, eaColor, false);\n                this.specularMap.setPixel(xFront, yFront, ssColor, false);\n\n                this.colorMap.setPixel(xBack, yBack, dtColor, false);\n                this.emissiveMap.setPixel(xBack, yBack, eaColor, false);\n                this.specularMap.setPixel(xBack, yBack, ssColor, true);\n            }\n        }\n    };\n\n    this.unhighlight = function() {\n        var i, partID, pixelIDFront, pixelIDBack, material;\n        var dtColorFront, eaColorFront, ssColorFront;\n        var dtColorBack, eaColorBack, ssColorBack;\n\n        if (ids.length && ids.length > 1) //Multi select\n        {\n            var hasChanged = false;\n\n            //Get original pixels\n            var dtPixels = parts.colorMap.getPixels();\n            var eaPixels = parts.emissiveMap.getPixels();\n            var ssPixels = parts.specularMap.getPixels();\n\n            for ( i=0; i < parts.ids.length; i++ ) {\n                partID = parts.ids[i];\n                pixelIDFront = partID;\n                pixelIDBack  = partID + this.widthTwo;\n\n                material = this.multiPart._materials[partID];\n\n                if( material._highlighted )\n                {\n                    hasChanged = true;\n\n                    material._highlighted = false;\n\n                    dtPixels[pixelIDFront] = new x3dom.fields.SFColorRGBA(material._diffuseColor.r, material._diffuseColor.g,\n                                                                          material._diffuseColor.b, 1.0 - material._transparency);\n                    eaPixels[pixelIDFront] = new x3dom.fields.SFColorRGBA(material._emissiveColor.r, material._emissiveColor.g,\n                                                                          material._emissiveColor.b, material._ambientIntensity);\n                    ssPixels[pixelIDFront] = new x3dom.fields.SFColorRGBA(material._specularColor.r, material._specularColor.g,\n                                                                          material._specularColor.b, material._shininess);\n\n                    dtPixels[pixelIDBack] = new x3dom.fields.SFColorRGBA(material._backDiffuseColor.r, material._backDiffuseColor.g,\n                                                                         material._backDiffuseColor.b, 1.0 - material._backTransparency);\n                    eaPixels[pixelIDBack] = new x3dom.fields.SFColorRGBA(material._backEmissiveColor.r, material._backEmissiveColor.g,\n                                                                         material._backEmissiveColor.b, material._backAmbientIntensity);\n                    ssPixels[pixelIDBack] = new x3dom.fields.SFColorRGBA(material._backSpecularColor.r, material._backSpecularColor.g,\n                                                                         material._backSpecularColor.b, material._backShininess);\n                }\n            }\n\n            if( hasChanged )\n            {\n                this.colorMap.setPixels(dtPixels, false);\n                this.emissiveMap.setPixels(eaPixels, false);\n                this.specularMap.setPixels(ssPixels, true);\n            }\n\n        }\n        else\n        {\n            partID = parts.ids[0];\n            pixelIDFront = partID;\n            pixelIDBack  = partID + this.widthTwo;\n\n            var xFront = pixelIDFront % this.width;\n            var yFront = Math.floor(pixelIDFront / this.width);\n\n            var xBack = pixelIDBack % this.width;\n            var yBack = Math.floor(pixelIDBack / this.width);\n\n            material = this.multiPart._materials[partID];\n\n            //If part is not highlighted update the pixel\n            if ( material._highlighted )\n            {\n                material._highlighted = false;\n\n                dtColorFront = new x3dom.fields.SFColorRGBA(material._diffuseColor.r, material._diffuseColor.g,\n                                                            material._diffuseColor.b, 1.0 - material._transparency);\n                eaColorFront = new x3dom.fields.SFColorRGBA(material._emissiveColor.r, material._emissiveColor.g,\n                                                            material._emissiveColor.b, material._ambientIntensity);\n                ssColorFront = new x3dom.fields.SFColorRGBA(material._specularColor.r, material._specularColor.g,\n                                                            material._specularColor.b, material._shininess);\n\n                dtColorBack = new x3dom.fields.SFColorRGBA(material._backDiffuseColor.r, material._backDiffuseColor.g,\n                                                           material._backDiffuseColor.b, 1.0 - material._backTransparency);\n                eaColorBack = new x3dom.fields.SFColorRGBA(material._backEmissiveColor.r, material._backEmissiveColor.g,\n                                                           material._backEmissiveColor.b, material._backAmbientIntensity);\n                ssColorBack = new x3dom.fields.SFColorRGBA(material._backSpecularColor.r, material._backSpecularColor.g,\n                                                           material._backSpecularColor.b, material._backShininess);\n\n                this.colorMap.setPixel(xFront, yFront, dtColorFront, false);\n                this.emissiveMap.setPixel(xFront, yFront, eaColorFront, false);\n                this.specularMap.setPixel(xFront, yFront, ssColorFront, false);\n\n                this.colorMap.setPixel(xBack, yBack, dtColorBack, false);\n                this.emissiveMap.setPixel(xBack, yBack, eaColorBack, false);\n                this.specularMap.setPixel(xBack, yBack, ssColorBack, true);\n            }\n        }\n    };\n\n\n    /**\n     *\n     * @param color\n     */\n    this.toggleHighlight = function ( color ) {\n        for ( var i=0; i < parts.ids.length; i++ ) {\n            if ( this.multiPart._materials[parts.ids[i]]._highlighted ) {\n                this.unhighlight();\n            } else {\n                this.highlight(color);\n            }\n        }\n    };\n\n\n    /**\n     *\n     * @param color\n     * @param side\n     */\n    this.setColor = function(color, side) {\n        this.setDiffuseColor(color, side);\n    };\n\n\n    /**\n     * Returns the RGB string representation of a color\n     * @returns {String}\n     */\n    this.getColorRGB = function() {\n        var str = this.getColorRGBA();\n\n        var values = str.split(\" \");\n\n        return values[0] + \" \" + values[1] + \" \" + values[2];\n    };\n\n    /**\n     * Returns the RGBA string representation of a color\n     * @returns {String}\n     */\n    this.getColorRGBA = function() {\n        var x, y;\n\n        //in case of multi select, this function returns the color of the first object\n        var colorRGBA = this.multiPart._originalColor[parts.ids[0]];\n\n        if (this.multiPart._highlightedParts[parts.ids[0]]){\n            colorRGBA = this.multiPart._highlightedParts[parts.ids[0]];\n        } else {\n            x = parts.ids[0] % parts.colorMap.getWidth();\n            y = Math.floor(parts.ids[0] / parts.colorMap.getWidth());\n            colorRGBA = parts.colorMap.getPixel(x, y);\n        }\n\n        return colorRGBA.toString();\n    };\n\n\t/**\n     *\n     */\n    this.resetColor = function() {\n\n        var i, partID, pixelIDFront, pixelIDBack, material;\n        var dtColorFront, eaColorFront, ssColorFront;\n        var dtColorBack, eaColorBack, ssColorBack;\n\t\t\n        if (ids.length && ids.length > 1) //Multi select\n        {\n            //Get original pixels\n            var dtPixels = parts.colorMap.getPixels();\n            var eaPixels = parts.emissiveMap.getPixels();\n            var ssPixels = parts.specularMap.getPixels();\n\n            for ( i=0; i < parts.ids.length; i++ ) {\n                partID = parts.ids[i];\n                pixelIDFront = partID;\n                pixelIDBack  = partID + this.widthTwo;\n\n                material = this.multiPart._materials[partID];\n\n                material.reset();\n\n                if( !material._highlighted )\n                {\n                    dtPixels[pixelIDFront] = new x3dom.fields.SFColorRGBA(material._diffuseColor.r, material._diffuseColor.g,\n                                                                          material._diffuseColor.b, 1.0 - material._transparency);\n                    eaPixels[pixelIDFront] = new x3dom.fields.SFColorRGBA(material._emissiveColor.r, material._emissiveColor.g,\n                                                                          material._emissiveColor.b, material._ambientIntensity);\n                    ssPixels[pixelIDFront] = new x3dom.fields.SFColorRGBA(material._specularColor.r, material._specularColor.g,\n                                                                          material._specularColor.b, material._shininess);\n\n                    dtPixels[pixelIDBack] = new x3dom.fields.SFColorRGBA(material._backDiffuseColor.r, material._backDiffuseColor.g,\n                                                                         material._backDiffuseColor.b, 1.0 - material._backTransparency);\n                    eaPixels[pixelIDBack] = new x3dom.fields.SFColorRGBA(material._backEmissiveColor.r, material._backEmissiveColor.g,\n                                                                         material._backEmissiveColor.b, material._backAmbientIntensity);\n                    ssPixels[pixelIDBack] = new x3dom.fields.SFColorRGBA(material._backSpecularColor.r, material._backSpecularColor.g,\n                                                                         material._backSpecularColor.b, material._backShininess);\n                }\n            }\n\n            this.colorMap.setPixels(dtPixels, false);\n            this.emissiveMap.setPixels(eaPixels, false);\n            this.specularMap.setPixels(ssPixels, true);\n        }\n        else //Single select\n        {\n            partID = parts.ids[0];\n            pixelIDFront = partID;\n            pixelIDBack  = partID + this.widthTwo;\n\n            var xFront = pixelIDFront % this.width;\n            var yFront = Math.floor(pixelIDFront / this.width);\n\n            var xBack = pixelIDBack % this.width;\n            var yBack = Math.floor(pixelIDBack / this.width);\n\n            material = this.multiPart._materials[partID];\n\n            material.reset();\n\n            //If part is not highlighted update the pixel\n            if ( !material._highlighted )\n            {\n                dtColorFront = new x3dom.fields.SFColorRGBA(material._diffuseColor.r, material._diffuseColor.g,\n                                                            material._diffuseColor.b, 1.0 - material._transparency);\n                eaColorFront = new x3dom.fields.SFColorRGBA(material._emissiveColor.r, material._emissiveColor.g,\n                                                            material._emissiveColor.b, material._ambientIntensity);\n                ssColorFront = new x3dom.fields.SFColorRGBA(material._specularColor.r, material._specularColor.g,\n                                                            material._specularColor.b, material._shininess);\n\n                dtColorBack = new x3dom.fields.SFColorRGBA(material._backDiffuseColor.r, material._backDiffuseColor.g,\n                                                           material._backDiffuseColor.b, 1.0 - material._backTransparency);\n                eaColorBack = new x3dom.fields.SFColorRGBA(material._backEmissiveColor.r, material._backEmissiveColor.g,\n                                                           material._backEmissiveColor.b, material._backAmbientIntensity);\n                ssColorBack = new x3dom.fields.SFColorRGBA(material._backSpecularColor.r, material._backSpecularColor.g,\n                                                           material._backSpecularColor.b, material._backShininess);\n\n                this.colorMap.setPixel(xFront, yFront, dtColorFront, false);\n                this.emissiveMap.setPixel(xFront, yFront, eaColorFront, false);\n                this.specularMap.setPixel(xFront, yFront, ssColorFront, false);\n\n                this.colorMap.setPixel(xBack, yBack, dtColorBack, false);\n                this.emissiveMap.setPixel(xBack, yBack, eaColorBack, false);\n                this.specularMap.setPixel(xBack, yBack, ssColorBack, true);\n            }\n        }\n    };\n\n    /**\n     *\n     * @param visibility\n     */\n    this.setVisibility = function(visibility) {\n\n        var i, j, x, y, usage, visibleCount, visibilityAsInt;\n\n        if (!(ids.length && ids.length > 1)) {\n            x = parts.ids[0] % parts.colorMap.getWidth();\n            y = Math.floor(parts.ids[0] / parts.colorMap.getWidth());\n\n            var pixel = parts.visibilityMap.getPixel(x, y);\n\n            visibilityAsInt = (visibility) ? 1 : 0;\n\n            if (pixel.r != visibilityAsInt) {\n                pixel.r = visibilityAsInt;\n\n                this.multiPart._partVisibility[parts.ids[0]] = visibility;\n                \n                //get used shapes\n                usage = this.multiPart._idMap.mapping[parts.ids[0]].usage;\n\n                //Change the shapes render flag\n                for (j = 0; j < usage.length; j++) {\n                    visibleCount = this.multiPart._visiblePartsPerShape[usage[j]];\n                    if (visibility && visibleCount.val < visibleCount.max) {\n                        visibleCount.val++;\n                    } else if (!visibility && visibleCount.val > 0) {\n                        visibleCount.val--;\n                    }\n\n                    if (visibleCount.val) {\n                        this.multiPart._inlineNamespace.defMap[usage[j]]._vf.render = true;\n                    } else {\n                        this.multiPart._inlineNamespace.defMap[usage[j]]._vf.render = false;\n                    }\n                }\n\n                parts.visibilityMap.setPixel(x, y, pixel);\n                this.multiPart.invalidateVolume();\n            }\n        }\n        else\n        {\n            var hasChange = false;\n\n            var pixels = parts.visibilityMap.getPixels();\n\n            for (i = 0; i < parts.ids.length; i++) {\n\n                visibilityAsInt = (visibility) ? 1 : 0;\n\n                if (pixels[parts.ids[i]].r != visibilityAsInt) {\n                    pixels[parts.ids[i]].r = visibilityAsInt;\n\n                    hasChange = true;\n\n                    this.multiPart._partVisibility[parts.ids[i]] = visibility;\n\n                    //get used shapes\n                    usage = this.multiPart._idMap.mapping[parts.ids[i]].usage;\n\n                    //Change the shapes render flag\n                    for (j = 0; j < usage.length; j++) {\n                        visibleCount = this.multiPart._visiblePartsPerShape[usage[j]];\n                        if (visibility && visibleCount.val < visibleCount.max) {\n                            visibleCount.val++;\n                        } else if (!visibility && visibleCount.val > 0) {\n                            visibleCount.val--;\n                        }\n\n                        if (visibleCount.val) {\n                            this.multiPart._inlineNamespace.defMap[usage[j]]._vf.render = true;\n                        } else {\n                            this.multiPart._inlineNamespace.defMap[usage[j]]._vf.render = false;\n                        }\n                    }\n                }\n            }\n\n            if(hasChange)\n            {\n                parts.visibilityMap.setPixels(pixels);\n                this.multiPart.invalidateVolume();\n            }\n        }\n    };\n\n\n    /**\n     * get bounding volume\n     *\n     */\n    this.getVolume = function() {\n\n        var volume;\n        var transmat = this.multiPart.getCurrentTransform();\n\n        if (ids.length && ids.length > 1) //Multi select\n        {\n            volume = new x3dom.fields.BoxVolume();\n\n            for(var i=0; i<parts.ids.length; i++) {\n                volume.extendBounds(this.multiPart._partVolume[parts.ids[i]].min, this.multiPart._partVolume[parts.ids[i]].max);\n            }\n\n            volume.transform(transmat);\n\n            return volume;\n        }\n        else\n        {\n            volume = x3dom.fields.BoxVolume.copy(this.multiPart._partVolume[parts.ids[0]]);\n            volume.transform(transmat);\n            return volume;\n        }\n    };\n\n    /**\n     * Fit the selected Parts to the screen\n     * @param updateCenterOfRotation\n     */\n    this.fit = function (updateCenterOfRotation) {\n\n        var volume = this.getVolume();\n\n        this.multiPart._nameSpace.doc._viewarea.fit(volume.min, volume.max, updateCenterOfRotation);\n    };\n};\n/*\r\n * X3DOM JavaScript Library\r\n * http://www.x3dom.org\r\n *\r\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\r\n * Dual licensed under the MIT and GPL\r\n *\r\n * Based on code originally provided by\r\n * Philip Taylor: http://philip.html5.org\r\n */\r\n\r\n\r\nx3dom.Properties = function() {\r\n    this.properties = {};\r\n};\r\n\r\nx3dom.Properties.prototype.setProperty = function(name, value) {\r\n    x3dom.debug.logInfo(\"Properties: Setting property '\"+ name + \"' to value '\" + value + \"'\");\r\n    this.properties[name] = value;\r\n};\r\n\r\nx3dom.Properties.prototype.getProperty = function(name, def) {\r\n    if (this.properties[name]) {\r\n        return this.properties[name]\r\n    } else {\r\n        return def;\r\n    }\r\n};\r\n\r\nx3dom.Properties.prototype.merge = function(other) {\r\n    for (var attrname in other.properties) {\r\n        this.properties[attrname] = other.properties[attrname];\r\n    }\r\n};\r\n\r\nx3dom.Properties.prototype.toString = function() {\r\n    var str = \"\";\r\n    for (var name in this.properties) {\r\n        str += \"Name: \" + name + \" Value: \" + this.properties[name] + \"\\n\";\r\n    }\r\n    return str;\r\n};\r\n\n/*\r\n * X3DOM JavaScript Library\r\n * http://www.x3dom.org\r\n *\r\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\r\n * Dual licensed under the MIT and GPL\r\n *\r\n * Based on code originally provided by\r\n * Philip Taylor: http://philip.html5.org\r\n */\r\n\r\nx3dom.DoublyLinkedList = function() {\r\n\tthis.length = 0;\r\n\tthis.first = null;\r\n\tthis.last = null;\r\n};\r\n\r\nx3dom.DoublyLinkedList.ListNode = function(point, point_index, normals, colors, texCoords) {\r\n\tthis.point = point;\r\n\tthis.point_index = point_index;\r\n\tthis.normals = normals;\r\n\tthis.colors = colors;\r\n\tthis.texCoords = texCoords;\r\n\tthis.next = null;\r\n\tthis.prev = null;\r\n};\r\n\r\nx3dom.DoublyLinkedList.prototype.appendNode = function(node) {\r\n  \tif (this.first === null) {\r\n    \tnode.prev = node;\r\n    \tnode.next = node;\r\n    \tthis.first = node;\r\n    \tthis.last = node;\r\n  \t} else {\r\n   \t \tnode.prev = this.last;\r\n   \t \tnode.next = this.first;\r\n   \t \tthis.first.prev = node;\r\n    \tthis.last.next = node;\r\n    \tthis.last = node;\r\n  \t}\r\n  \tthis.length++;\r\n};\r\n\r\nx3dom.DoublyLinkedList.prototype.insertAfterNode = function(node, newNode) {\r\n  \tnewNode.prev = node;\r\n \tnewNode.next = node.next;\r\n  \tnode.next.prev = newNode;\r\n  \tnode.next = newNode;\r\n  \tif (newNode.prev == this.last) { \r\n\t\tthis.last = newNode;\r\n\t}\r\n  \tthis.length++;\r\n};\r\n\r\nx3dom.DoublyLinkedList.prototype.deleteNode = function(node) {\r\n \tif (this.length > 1) {\r\n\t\tnode.prev.next = node.next;\r\n\t\tnode.next.prev = node.prev;\r\n\t\tif (node == this.first) {\r\n\t\t\tthis.first = node.next;\r\n\t\t}\r\n\t\tif (node == this.last) {\r\n\t\t\tthis.last = node.prev;\r\n\t\t}\r\n\t} else {\r\n\t\tthis.first = null;\r\n\t\tthis.last = null;\r\n\t}\r\n\tnode.prev = null;\r\n\tnode.next = null;\r\n\tthis.length--;\r\n};\r\n\r\nx3dom.DoublyLinkedList.prototype.getNode = function(index) {\r\n\tvar node = null;\r\n\tif(index > this.length) {\r\n\t\treturn node;\r\n\t}\r\n\tfor(var i = 0; i < this.length; i++) {\r\n\t\tif(i == 0) {\r\n\t\t\tnode = this.first;\r\n\t\t} else {\r\n\t\t\tnode = node.next;\r\n\t\t}\r\n\t\tif(i == index) {\r\n\t\t\treturn node;\r\n\t\t}\r\n\t}\r\n    return null;\r\n};\r\n\r\nx3dom.DoublyLinkedList.prototype.invert = function() {\r\n\tvar tmp = null;\r\n\tvar node = this.first;\r\n\t\r\n\tfor(var i = 0; i < this.length; i++) {\r\n\t\ttmp = node.prev;\r\n\t\tnode.prev =\tnode.next;\r\n\t\tnode.next = tmp;\r\n\t\tnode = node.prev;\r\n\t}\r\n\ttmp = this.first;\r\n\tthis.first = this.last;\r\n\tthis.last = tmp;\r\n};\r\n\n/*\r\n * X3DOM JavaScript Library\r\n * http://www.x3dom.org\r\n *\r\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\r\n * Dual licensed under the MIT and GPL\r\n *\r\n * Based on code originally provided by\r\n * Philip Taylor: http://philip.html5.org\r\n */\r\n\r\nx3dom.EarClipping = {\r\n\t\r\n\tgetIndexes: function (linklist) {\r\n\t\t\r\n\t\tvar node = linklist.first.next;\r\n\t\tvar plane = this.identifyPlane(node.prev.point, node.point, node.next.point);\r\n\t\tvar i, points, point_indexes, x, y;\r\n\t\tpoints = [];\r\n\t\tpoint_indexes = [];\r\n\t\t\r\n\t\tfor (i = 0; i < linklist.length; i++) {\r\n\t\t\tnode = linklist.getNode(i);\r\n\t\t\tswitch (plane) {\r\n\t\t\t\tcase \"XY\": { x = node.point.x; y = node.point.y; break; }\r\n\t\t\t\tcase \"XZ\": { x = node.point.z; y = node.point.x; break; }\r\n\t\t\t\tdefault: { x = node.point.y; y = node.point.z; }\r\n\t\t\t}\r\n\t\t\tpoints.push(y);\r\n\t\t\tpoints.push(x);\r\n\t\t\tpoint_indexes.push(node.point_index);\r\n\t\t}\r\n\t\tvar triangles = x3dom.EarCut.triangulate(points, null, 2);\r\n\t\ttriangles = triangles.map(function(m) {return point_indexes[m];}) ;\r\n\t\treturn triangles;\r\n\t},\r\n\r\n\tgetMultiIndexes: function (linklist) {\r\n\t\tvar node = linklist.first.next;\r\n\t\tvar plane = this.identifyPlane(node.prev.point, node.point, node.next.point);\r\n\t\tvar data = {};\r\n\t\tdata.indices = [];\r\n\t\tdata.point = [];\r\n\t\tdata.normals = [];\r\n\t\tdata.colors = [];\r\n\t\tdata.texCoords = [];\r\n\t\tvar mapped = {};\r\n\t\tmapped.indices = [];\r\n\t\tmapped.point = [];\r\n\t\tmapped.normals = [];\r\n\t\tmapped.colors = [];\r\n\t\tmapped.texCoords = [];\r\n\t\t\r\n\t\tvar points = [];\r\n\t\tvar i, x, y;\r\n\t\tfor (i = 0; i < linklist.length; i++) {\r\n\t\t\tnode = linklist.getNode(i);\r\n\t\t\tswitch (plane) {\r\n\t\t\t\tcase \"XY\": { x = node.point.x; y = node.point.y; break; }\r\n\t\t\t\tcase \"XZ\": { x = node.point.z; y = node.point.x; break; }\r\n\t\t\t\tdefault: { x = node.point.y; y = node.point.z; }\r\n\t\t\t}\r\n\t\t\tpoints.push(y);\r\n\t\t\tpoints.push(x);\r\n\t\t\tmapped.indices.push(node.point_index);\r\n\t\t\tmapped.point.push(node.point);\r\n\t\t\tif (node.normals) mapped.normals.push(node.normals);\r\n\t\t\tif (node.colors) mapped.colors.push(node.colors);\r\n\t\t\tif (node.texCoords) mapped.texCoords.push(node.texCoords);\r\n\t\t}\r\n\t\t\r\n\t\tvar triangles = x3dom.EarCut.triangulate(points, null, 2);\r\n\t\tdata.indices = triangles.map(function(m) {return mapped.indices[m];}) ;\r\n\t\tdata.point = triangles.map(function(m) {return mapped.point[m];}) ;\r\n\t\tif (node.normals) data.normals = triangles.map(function(m) {return mapped.normals[m];}) ;\r\n\t\tif (node.colors) data.colors = triangles.map(function(m) {return mapped.colors[m];}) ;\r\n\t\tif (node.texCoords) data.texCoords = triangles.map(function(m) {return mapped.texCoords[m];}) ;\r\n\t\treturn data;\r\n\t}, \r\n\t\r\n\tidentifyPlane: function(p1, p2, p3) {\r\n\t\tvar v1x, v1y, v1z;\r\n\t\tvar v2x, v2y, v2z;\r\n\t\tvar v3x, v3y, v3z;\r\n\t\r\n\t\tv1x = p2.x - p1.x; v1y = p2.y - p1.y; v1z = p2.z - p1.z;\r\n\t\tv2x = p3.x - p1.x; v2y = p3.y - p1.y; v2z = p3.z - p1.z;\r\n\t\t\r\n\t\tv3x = Math.abs(v1y*v2z - v1z*v2y);\r\n\t\tv3y = Math.abs(v1z*v2x - v1x*v2z);\r\n\t\tv3z = Math.abs(v1x*v2y - v1y*v2x);\r\n\t\t\r\n\t\tvar angle = Math.max(v3x, v3y, v3z);\r\n\t\t\r\n\t\tif(angle == v3x) {\r\n\t\t\treturn 'YZ';\r\n\t\t} else if(angle == v3y) {\r\n\t\t\treturn 'XZ';\r\n\t\t} else if(angle == v3z) {\r\n\t\t\treturn 'XY';\r\n\t\t} else {\r\n\t\t\treturn 'XZ';    // error\r\n\t\t}\r\n\t}\r\n};\r\n\r\n//TODO: adjust to directly use x3dom linked list\r\n//      move to separate file\r\nx3dom.EarCut = {\r\n\r\n\ttriangulate: function mapEarcut (data, holes, dim) {\r\n\t\treturn earcut(data, holes, dim);\r\n\r\n/*\r\nThe following code is\r\nCopyright (c) 2015, Mapbox\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any purpose\r\nwith or without fee is hereby granted, provided that the above copyright notice\r\nand this permission notice appear in all copies.\r\n*/\r\n\r\nfunction earcut(data, holeIndices, dim) {\r\n\r\n    dim = dim || 2;\r\n\r\n    var hasHoles = holeIndices && holeIndices.length,\r\n        outerLen = hasHoles ? holeIndices[0] * dim : data.length,\r\n        //outerNode = filterPoints(linkedList(data, 0, outerLen, dim, true, clockwise)),\r\n        //AP: remember winding order\r\n        clockwise = windingOrder(data, 0, outerLen, dim),\r\n        outerNode = linkedList(data, 0, outerLen, dim, true, clockwise),\r\n        triangles = [];\r\n        \r\n\tif (!outerNode) return triangles;\r\n\r\n    var minX, minY, maxX, maxY, x, y, size;\r\n\r\n    if (hasHoles) outerNode = eliminateHoles(data, holeIndices, outerNode, dim);\r\n\r\n    // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox\r\n    if (data.length > 80 * dim) {\r\n        minX = maxX = data[0];\r\n        minY = maxY = data[1];\r\n\r\n        for (var i = dim; i < outerLen; i += dim) {\r\n            x = data[i];\r\n            y = data[i + 1];\r\n            if (x < minX) minX = x;\r\n            if (y < minY) minY = y;\r\n            if (x > maxX) maxX = x;\r\n            if (y > maxY) maxY = y;\r\n        }\r\n\r\n        // minX, minY and size are later used to transform coords into integers for z-order calculation\r\n        size = Math.max(maxX - minX, maxY - minY);\r\n    }\r\n\tearcutLinked(outerNode, triangles, dim, minX, minY, size);\r\n\t//AP: preserve winding order\r\n\tif (clockwise === false) {triangles.reverse();}\r\n\treturn triangles;\r\n}\r\n\r\n// calculate original winding order of a polygon ring\r\n// AP: separated to get original winding order\r\nfunction windingOrder(data, start, end, dim) {\r\n\tvar sum = 0;\r\n\tvar i, j;\r\n    for (i = start, j = end - dim; i < end; i += dim) {\r\n        sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]);\r\n        j = i;\r\n    }\r\n\t//true for clockwise\r\n\treturn sum > 0;\r\n}\r\n\r\n// create a circular doubly linked list from polygon points in the specified winding order\r\n// AP: oclockwise = original winding order\r\nfunction linkedList(data, start, end, dim, clockwise, oclockwise) {\r\n    var i, j, last;\r\n\r\n    // link points into circular doubly-linked list in the specified winding order\r\n    if (clockwise === oclockwise) {\r\n        for (i = start; i < end; i += dim) last = insertNode(i, data[i], data[i + 1], last);\r\n    } else {\r\n        for (i = end - dim; i >= start; i -= dim) last = insertNode(i, data[i], data[i + 1], last);\r\n    }\r\n\r\n    return last;\r\n}\r\n// eliminate colinear or duplicate points\r\nfunction filterPoints(start, end) {\r\n    if (!start) return start;\r\n    if (!end) end = start;\r\n\r\n    var p = start,\r\n        again;\r\n    do {\r\n        again = false;\r\n\r\n        if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {\r\n            removeNode(p);\r\n            p = end = p.prev;\r\n            if (p === p.next) return null;\r\n            again = true;\r\n\r\n        } else {\r\n            p = p.next;\r\n        }\r\n    } while (again || p !== end);\r\n\r\n    return end;\r\n}\r\n\r\n// main ear slicing loop which triangulates a polygon (given as a linked list)\r\nfunction earcutLinked(ear, triangles, dim, minX, minY, size, pass) {\r\n    if (!ear) return;\r\n\r\n    // interlink polygon nodes in z-order\r\n    if (!pass && size) indexCurve(ear, minX, minY, size);\r\n\r\n    var stop = ear,\r\n        prev, next;\r\n\r\n    // iterate through ears, slicing them one by one\r\n    while (ear.prev !== ear.next) {\r\n        prev = ear.prev;\r\n        next = ear.next;\r\n\r\n        if (size ? isEarHashed(ear, minX, minY, size) : isEar(ear)) {\r\n            // cut off the triangle\r\n            triangles.push(prev.i / dim);\r\n            triangles.push(ear.i / dim);\r\n            triangles.push(next.i / dim);\r\n\r\n            removeNode(ear);\r\n\r\n            // skipping the next vertice leads to less sliver triangles\r\n            ear = next.next;\r\n            stop = next.next;\r\n\r\n            continue;\r\n        }\r\n\r\n        ear = next;\r\n\r\n        // if we looped through the whole remaining polygon and can't find any more ears\r\n        if (ear === stop) {\r\n            // try filtering points and slicing again\r\n            if (!pass) {\r\n                earcutLinked(filterPoints(ear), triangles, dim, minX, minY, size, 1);\r\n\r\n            // if this didn't work, try curing all small self-intersections locally\r\n            } else if (pass === 1) {\r\n                ear = cureLocalIntersections(ear, triangles, dim);\r\n                earcutLinked(ear, triangles, dim, minX, minY, size, 2);\r\n\r\n            // as a last resort, try splitting the remaining polygon into two\r\n            } else if (pass === 2) {\r\n                splitEarcut(ear, triangles, dim, minX, minY, size);\r\n            }\r\n\r\n            break;\r\n        }\r\n    }\r\n}\r\n\r\n// check whether a polygon node forms a valid ear with adjacent nodes\r\nfunction isEar(ear) {\r\n    var a = ear.prev,\r\n        b = ear,\r\n        c = ear.next;\r\n\r\n    if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\r\n\r\n    // now make sure we don't have other points inside the potential ear\r\n    var p = ear.next.next;\r\n\r\n    while (p !== ear.prev) {\r\n        if (pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&\r\n            area(p.prev, p, p.next) >= 0) return false;\r\n        p = p.next;\r\n    }\r\n\r\n    return true;\r\n}\r\n\r\nfunction isEarHashed(ear, minX, minY, size) {\r\n    var a = ear.prev,\r\n        b = ear,\r\n        c = ear.next;\r\n\r\n    if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\r\n\r\n    // triangle bbox; min & max are calculated like this for speed\r\n    var minTX = a.x < b.x ? (a.x < c.x ? a.x : c.x) : (b.x < c.x ? b.x : c.x),\r\n        minTY = a.y < b.y ? (a.y < c.y ? a.y : c.y) : (b.y < c.y ? b.y : c.y),\r\n        maxTX = a.x > b.x ? (a.x > c.x ? a.x : c.x) : (b.x > c.x ? b.x : c.x),\r\n        maxTY = a.y > b.y ? (a.y > c.y ? a.y : c.y) : (b.y > c.y ? b.y : c.y);\r\n\r\n    // z-order range for the current triangle bbox;\r\n    var minZ = zOrder(minTX, minTY, minX, minY, size),\r\n        maxZ = zOrder(maxTX, maxTY, minX, minY, size);\r\n\r\n    // first look for points inside the triangle in increasing z-order\r\n    var p = ear.nextZ;\r\n\r\n    while (p && p.z <= maxZ) {\r\n        if (p !== ear.prev && p !== ear.next &&\r\n            pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&\r\n            area(p.prev, p, p.next) >= 0) return false;\r\n        p = p.nextZ;\r\n    }\r\n\r\n    // then look for points in decreasing z-order\r\n    p = ear.prevZ;\r\n\r\n    while (p && p.z >= minZ) {\r\n        if (p !== ear.prev && p !== ear.next &&\r\n            pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&\r\n            area(p.prev, p, p.next) >= 0) return false;\r\n        p = p.prevZ;\r\n    }\r\n\r\n    return true;\r\n}\r\n\r\n// go through all polygon nodes and cure small local self-intersections\r\nfunction cureLocalIntersections(start, triangles, dim) {\r\n    var p = start;\r\n    do {\r\n        var a = p.prev,\r\n            b = p.next.next;\r\n\r\n        // a self-intersection where edge (v[i-1],v[i]) intersects (v[i+1],v[i+2])\r\n        if (intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) {\r\n\r\n            triangles.push(a.i / dim);\r\n            triangles.push(p.i / dim);\r\n            triangles.push(b.i / dim);\r\n\r\n            // remove two nodes involved\r\n            removeNode(p);\r\n            removeNode(p.next);\r\n\r\n            p = start = b;\r\n        }\r\n        p = p.next;\r\n    } while (p !== start);\r\n\r\n    return p;\r\n}\r\n\r\n// try splitting polygon into two and triangulate them independently\r\nfunction splitEarcut(start, triangles, dim, minX, minY, size) {\r\n    // look for a valid diagonal that divides the polygon into two\r\n    var a = start;\r\n    do {\r\n        var b = a.next.next;\r\n        while (b !== a.prev) {\r\n            if (a.i !== b.i && isValidDiagonal(a, b)) {\r\n                // split the polygon in two by the diagonal\r\n                var c = splitPolygon(a, b);\r\n\r\n                // filter colinear points around the cuts\r\n                a = filterPoints(a, a.next);\r\n                c = filterPoints(c, c.next);\r\n\r\n                // run earcut on each half\r\n                earcutLinked(a, triangles, dim, minX, minY, size);\r\n                earcutLinked(c, triangles, dim, minX, minY, size);\r\n                return;\r\n            }\r\n            b = b.next;\r\n        }\r\n        a = a.next;\r\n    } while (a !== start);\r\n}\r\n\r\n// link every hole into the outer loop, producing a single-ring polygon without holes\r\nfunction eliminateHoles(data, holeIndices, outerNode, dim) {\r\n    var queue = [],\r\n        i, len, start, end, list;\r\n\r\n    for (i = 0, len = holeIndices.length; i < len; i++) {\r\n        start = holeIndices[i] * dim;\r\n        end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\r\n        list = linkedList(data, start, end, dim, false);\r\n        if (list === list.next) list.steiner = true;\r\n        //list = filterPoints(list);\r\n        //if (list)\r\n        queue.push(getLeftmost(list));\r\n    }\r\n\r\n    queue.sort(compareX);\r\n\r\n    // process holes from left to right\r\n    for (i = 0; i < queue.length; i++) {\r\n        eliminateHole(queue[i], outerNode);\r\n        outerNode = filterPoints(outerNode, outerNode.next);\r\n    }\r\n\r\n    return outerNode;\r\n}\r\n\r\nfunction compareX(a, b) {\r\n    return a.x - b.x;\r\n}\r\n\r\n// find a bridge between vertices that connects hole with an outer ring and and link it\r\nfunction eliminateHole(hole, outerNode) {\r\n    outerNode = findHoleBridge(hole, outerNode);\r\n    if (outerNode) {\r\n        var b = splitPolygon(outerNode, hole);\r\n        filterPoints(b, b.next);\r\n    }\r\n}\r\n\r\n// David Eberly's algorithm for finding a bridge between hole and outer polygon\r\nfunction findHoleBridge(hole, outerNode) {\r\n    var p = outerNode,\r\n        hx = hole.x,\r\n        hy = hole.y,\r\n        qx = -Infinity,\r\n        m;\r\n\r\n    // find a segment intersected by a ray from the hole's leftmost point to the left;\r\n    // segment's endpoint with lesser x will be potential connection point\r\n    do {\r\n        if (hy <= p.y && hy >= p.next.y) {\r\n            var x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y);\r\n            if (x <= hx && x > qx) {\r\n                qx = x;\r\n                m = p.x < p.next.x ? p : p.next;\r\n            }\r\n        }\r\n        p = p.next;\r\n    } while (p !== outerNode);\r\n\r\n    if (!m) return null;\r\n\r\n    // look for points inside the triangle of hole point, segment intersection and endpoint;\r\n    // if there are no points found, we have a valid connection;\r\n    // otherwise choose the point of the minimum angle with the ray as connection point\r\n\r\n    var stop = m,\r\n        tanMin = Infinity,\r\n        tan;\r\n\r\n    p = m.next;\r\n\r\n    while (p !== stop) {\r\n        if (hx >= p.x && p.x >= m.x &&\r\n                pointInTriangle(hy < m.y ? hx : qx, hy, m.x, m.y, hy < m.y ? qx : hx, hy, p.x, p.y)) {\r\n\r\n            tan = Math.abs(hy - p.y) / (hx - p.x); // tangential\r\n\r\n            if ((tan < tanMin || (tan === tanMin && p.x > m.x)) && locallyInside(p, hole)) {\r\n                m = p;\r\n                tanMin = tan;\r\n            }\r\n        }\r\n\r\n        p = p.next;\r\n    }\r\n\r\n    return m;\r\n}\r\n\r\n// interlink polygon nodes in z-order\r\nfunction indexCurve(start, minX, minY, size) {\r\n    var p = start;\r\n    do {\r\n        if (p.z === null) p.z = zOrder(p.x, p.y, minX, minY, size);\r\n        p.prevZ = p.prev;\r\n        p.nextZ = p.next;\r\n        p = p.next;\r\n    } while (p !== start);\r\n\r\n    p.prevZ.nextZ = null;\r\n    p.prevZ = null;\r\n\r\n    sortLinked(p);\r\n}\r\n\r\n// Simon Tatham's linked list merge sort algorithm\r\n// http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html\r\nfunction sortLinked(list) {\r\n    var i, p, q, e, tail, numMerges, pSize, qSize,\r\n        inSize = 1;\r\n\r\n    do {\r\n        p = list;\r\n        list = null;\r\n        tail = null;\r\n        numMerges = 0;\r\n\r\n        while (p) {\r\n            numMerges++;\r\n            q = p;\r\n            pSize = 0;\r\n            for (i = 0; i < inSize; i++) {\r\n                pSize++;\r\n                q = q.nextZ;\r\n                if (!q) break;\r\n            }\r\n\r\n            qSize = inSize;\r\n\r\n            while (pSize > 0 || (qSize > 0 && q)) {\r\n\r\n                if (pSize === 0) {\r\n                    e = q;\r\n                    q = q.nextZ;\r\n                    qSize--;\r\n                } else if (qSize === 0 || !q) {\r\n                    e = p;\r\n                    p = p.nextZ;\r\n                    pSize--;\r\n                } else if (p.z <= q.z) {\r\n                    e = p;\r\n                    p = p.nextZ;\r\n                    pSize--;\r\n                } else {\r\n                    e = q;\r\n                    q = q.nextZ;\r\n                    qSize--;\r\n                }\r\n\r\n                if (tail) tail.nextZ = e;\r\n                else list = e;\r\n\r\n                e.prevZ = tail;\r\n                tail = e;\r\n            }\r\n\r\n            p = q;\r\n        }\r\n\r\n        tail.nextZ = null;\r\n        inSize *= 2;\r\n\r\n    } while (numMerges > 1);\r\n\r\n    return list;\r\n}\r\n\r\n// z-order of a point given coords and size of the data bounding box\r\nfunction zOrder(x, y, minX, minY, size) {\r\n    // coords are transformed into non-negative 15-bit integer range\r\n    x = 32767 * (x - minX) / size;\r\n    y = 32767 * (y - minY) / size;\r\n\r\n    x = (x | (x << 8)) & 0x00FF00FF;\r\n    x = (x | (x << 4)) & 0x0F0F0F0F;\r\n    x = (x | (x << 2)) & 0x33333333;\r\n    x = (x | (x << 1)) & 0x55555555;\r\n\r\n    y = (y | (y << 8)) & 0x00FF00FF;\r\n    y = (y | (y << 4)) & 0x0F0F0F0F;\r\n    y = (y | (y << 2)) & 0x33333333;\r\n    y = (y | (y << 1)) & 0x55555555;\r\n\r\n    return x | (y << 1);\r\n}\r\n\r\n// find the leftmost node of a polygon ring\r\nfunction getLeftmost(start) {\r\n    var p = start,\r\n        leftmost = start;\r\n    do {\r\n        if (p.x < leftmost.x) leftmost = p;\r\n        p = p.next;\r\n    } while (p !== start);\r\n\r\n    return leftmost;\r\n}\r\n\r\n// check if a point lies within a convex triangle\r\nfunction pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\r\n    return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\r\n           (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\r\n           (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\r\n}\r\n\r\n// check if a diagonal between two polygon nodes is valid (lies in polygon interior)\r\nfunction isValidDiagonal(a, b) {\r\n    return equals(a, b) || a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) &&\r\n           locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b);\r\n}\r\n\r\n// signed area of a triangle\r\nfunction area(p, q, r) {\r\n    return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\r\n}\r\n\r\n// check if two points are equal\r\nfunction equals(p1, p2) {\r\n    return p1.x === p2.x && p1.y === p2.y;\r\n}\r\n\r\n// check if two segments intersect\r\nfunction intersects(p1, q1, p2, q2) {\r\n    return area(p1, q1, p2) > 0 !== area(p1, q1, q2) > 0 &&\r\n           area(p2, q2, p1) > 0 !== area(p2, q2, q1) > 0;\r\n}\r\n\r\n// check if a polygon diagonal intersects any polygon segments\r\nfunction intersectsPolygon(a, b) {\r\n    var p = a;\r\n    do {\r\n        if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i &&\r\n                intersects(p, p.next, a, b)) return true;\r\n        p = p.next;\r\n    } while (p !== a);\r\n\r\n    return false;\r\n}\r\n\r\n// check if a polygon diagonal is locally inside the polygon\r\nfunction locallyInside(a, b) {\r\n    return area(a.prev, a, a.next) < 0 ?\r\n        area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 :\r\n        area(a, b, a.prev) < 0 || area(a, a.next, b) < 0;\r\n}\r\n\r\n// check if the middle point of a polygon diagonal is inside the polygon\r\nfunction middleInside(a, b) {\r\n    var p = a,\r\n        inside = false,\r\n        px = (a.x + b.x) / 2,\r\n        py = (a.y + b.y) / 2;\r\n    do {\r\n        if (((p.y > py) !== (p.next.y > py)) && (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\r\n            inside = !inside;\r\n        p = p.next;\r\n    } while (p !== a);\r\n\r\n    return inside;\r\n}\r\n\r\n// link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two;\r\n// if one belongs to the outer ring and another to a hole, it merges it into a single ring\r\nfunction splitPolygon(a, b) {\r\n    var a2 = new Node(a.i, a.x, a.y),\r\n        b2 = new Node(b.i, b.x, b.y),\r\n        an = a.next,\r\n        bp = b.prev;\r\n\r\n    a.next = b;\r\n    b.prev = a;\r\n\r\n    a2.next = an;\r\n    an.prev = a2;\r\n\r\n    b2.next = a2;\r\n    a2.prev = b2;\r\n\r\n    bp.next = b2;\r\n    b2.prev = bp;\r\n\r\n    return b2;\r\n}\r\n\r\n// create a node and optionally link it with previous one (in a circular doubly linked list)\r\nfunction insertNode(i, x, y, last) {\r\n    var p = new Node(i, x, y);\r\n\r\n    if (!last) {\r\n        p.prev = p;\r\n        p.next = p;\r\n\r\n    } else {\r\n        p.next = last.next;\r\n        p.prev = last;\r\n        last.next.prev = p;\r\n        last.next = p;\r\n    }\r\n    return p;\r\n}\r\n\r\nfunction removeNode(p) {\r\n    p.next.prev = p.prev;\r\n    p.prev.next = p.next;\r\n\r\n    if (p.prevZ) p.prevZ.nextZ = p.nextZ;\r\n    if (p.nextZ) p.nextZ.prevZ = p.prevZ;\r\n}\r\n\r\nfunction Node(i, x, y) {\r\n    // vertice index in coordinates array\r\n    this.i = i;\r\n\r\n    // vertex coordinates\r\n    this.x = x;\r\n    this.y = y;\r\n\r\n    // previous and next vertice nodes in a polygon ring\r\n    this.prev = null;\r\n    this.next = null;\r\n\r\n    // z-order curve value\r\n    this.z = null;\r\n\r\n    // previous and next nodes in z-order\r\n    this.prevZ = null;\r\n    this.nextZ = null;\r\n\r\n    // indicates whether this is a steiner point\r\n    this.steiner = false;\r\n}\r\n}\r\n}\r\n\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * Philip Taylor: http://philip.html5.org\n */\n\nx3dom.FieldInterpolator = function( beginTime, endTime, beginValue, endValue )\n{\n\tthis.beginTime = beginTime || 0;\n\tthis.endTime   = endTime || 1;\n\tthis.beginValue = beginValue || 0;\n\tthis.endValue   = endValue || 0;\n\tthis.isInterpolating = false;\n};\n\nx3dom.FieldInterpolator.prototype.isActive = function()\n{\n    return ( this.beginTime > 0 );\n};\n\nx3dom.FieldInterpolator.prototype.calcFraction = function(time)\n{\n    var fraction = ( time - this.beginTime ) / ( this.endTime - this.beginTime );\n    return ( Math.sin( ( fraction * Math.PI ) - ( Math.PI / 2 ) ) + 1 ) / 2.0;\n};\n\nx3dom.FieldInterpolator.prototype.reset = function()\n{\n\tthis.isInterpolating = false;\n    this.beginTime = 0;\n    this.endTime = 1;\n\tthis.beginValue = 0;\n\tthis.endValue   = 0;\n};\n\nx3dom.FieldInterpolator.prototype.interpolate = function( time )\n{\n\tif ( time < this.beginTime )\n\t{\n\t\treturn this.beginValue;\n\t}\n\telse if ( time >= this.endTime )\n\t{\n\t\tvar endValue = this.endValue;\n\t\t\n\t\tthis.reset();\n\t\t\n\t\treturn endValue;\n\t}\n\telse\n\t{\n\t\tthis.isInterpolating = true;\n\t\treturn this.beginValue + ( this.endValue - this.beginValue ) * this.calcFraction( time );\n\t}\n};\n\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * Philip Taylor: http://philip.html5.org\n */\n\n/*****************************************************************************\n* Utils class holds utility functions for renderer\n*****************************************************************************/\nx3dom.Utils = {};\n\nx3dom.Utils.maxIndexableCoords = 65535;\nx3dom.Utils.needLineWidth = false;  // lineWidth not impl. in IE11\nx3dom.Utils.measurements = [];\n\n\n// http://gent.ilcore.com/2012/06/better-timer-for-javascript.html\nwindow.performance = window.performance || {};\nperformance.now = (function () {\n    return performance.now ||\n           performance.mozNow ||\n           performance.msNow ||\n           performance.oNow ||\n           performance.webkitNow ||\n           function () {\n               return new Date().getTime();\n           };\n})();\n\nx3dom.Utils.startMeasure = function (name) {\n    var uname = name.toUpperCase();\n    if (!x3dom.Utils.measurements[uname]) {\n        if (performance && performance.now) {\n            x3dom.Utils.measurements[uname] = performance.now();\n        } else {\n            x3dom.Utils.measurements[uname] = new Date().getTime();\n        }\n    }\n};\n\nx3dom.Utils.stopMeasure = function (name) {\n    var uname = name.toUpperCase();\n    if (x3dom.Utils.measurements[uname]) {\n        var startTime = x3dom.Utils.measurements[uname];\n        delete x3dom.Utils.measurements[uname];\n        if (performance && performance.now) {\n            return performance.now() - startTime;\n        } else {\n            return new Date().getTime() - startTime;\n        }\n    }\n    return 0;\n};\n\n/*****************************************************************************\n *\n *****************************************************************************/\nx3dom.Utils.isNumber = function(n) {\n    return !isNaN(parseFloat(n)) && isFinite(n);\n};\n\n/*****************************************************************************\n*\n*****************************************************************************/\nx3dom.Utils.createTexture2D = function(gl, doc, src, bgnd, crossOrigin, scale, genMipMaps, flipY)\n{\n    flipY = flipY || false;\n\n\tvar texture = gl.createTexture();\n\n    //Create a black 4 pixel texture to prevent 'texture not complete' warning\n    var data = new Uint8Array([0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255]);\n    gl.bindTexture(gl.TEXTURE_2D, texture);\n    gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 2, 2, 0, gl.RGBA, gl.UNSIGNED_BYTE, data);\n    if (genMipMaps) {\n        gl.generateMipmap(gl.TEXTURE_2D);\n    }\n    gl.bindTexture(gl.TEXTURE_2D, null);\n\n    texture.ready = false;\n\n\tif (src == null || src == '')\n\t    return texture;\n\n\tvar image = new Image();\n\n    switch(crossOrigin.toLowerCase()) {\n        case 'anonymous': {\n            image.crossOrigin = 'anonymous';\n        } break;\n        case 'use-credentials': {\n            image.crossOrigin = 'use-credentials';\n        } break;\n        case 'none': {\n            //this is needed to omit the default case, if default is none, erase this and the default case\n        } break;\n        default: {\n            if(x3dom.Utils.forbiddenBySOP(src)) {\n                image.crossOrigin = 'anonymous';\n            }\n        }\n    }\n\n\timage.src = src;\n\n\tdoc.incrementDownloads();\n\n\timage.onload = function() {\n\t\t\n\t\ttexture.originalWidth  = image.width;\n\t\ttexture.originalHeight = image.height;\n\t\t\n        if (scale)\n\t\t    image = x3dom.Utils.scaleImage( image );\n\n\t\tif(bgnd == true || flipY == true) {\n\t\t\tgl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n\t\t}\n\t\tgl.bindTexture(gl.TEXTURE_2D, texture);\n\t\t//gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\n\t\tgl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);\n        if (genMipMaps) {\n            gl.generateMipmap(gl.TEXTURE_2D);\n        }\n\t\tgl.bindTexture(gl.TEXTURE_2D, null);\n\t\tif(bgnd == true || flipY == true) {\n\t\t\tgl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);\n\t\t}\n\n\t\t//Save image size\n\t\ttexture.width  = image.width;\n\t\ttexture.height = image.height;\n\t\ttexture.ready = true;\n\n\t\tdoc.decrementDownloads();\n\t\tdoc.needRender = true;\n\t};\n\n    image.onerror = function(error)\n    {\n        x3dom.Utils.tryDDSLoading(texture, gl, doc, src, genMipMaps, flipY).then( function() {\n            doc.decrementDownloads();\n            doc.needRender = true;\n        }, function() {\n            x3dom.debug.logError(\"[Utils|createTexture2D] Can't load Image: \" + src);\n            doc.decrementDownloads();\n        });\n\t};\n\n\treturn texture;\n};\n\nx3dom.Utils.tryDDSLoading = function(texture, gl, doc, src, genMipMaps, flipY)\n{\n    return x3dom.DDSLoader.load(src).then( function( dds ) {\n\n        if (!dds || (dds.isCompressed && !x3dom.caps.COMPRESSED_TEXTURE) )\n        {\n            return;\n        }\n\n        gl.bindTexture(dds.type, texture);\n\n        flipY = false;\n\n\t\tif ( flipY )\n\t\t{\n\t\t\tgl.pixelStorei( gl.UNPACK_FLIP_Y_WEBGL, true );\n\t\t}\n\n\t\tif ( !x3dom.Utils.isPowerOfTwo( dds.width ) && !x3dom.Utils.isPowerOfTwo( dds.height ) )\n\t\t{\n\t\t\tgl.texParameteri( dds.type, gl.TEXTURE_MAG_FILTER, gl.LINEAR \t        );\n\t\t\tgl.texParameteri( dds.type, gl.TEXTURE_MIN_FILTER, gl.LINEAR \t        );\n\t\t\tgl.texParameteri( dds.type, gl.TEXTURE_WRAP_S, \tgl.CLAMP_TO_EDGE \t);\n\t\t\tgl.texParameteri( dds.type, gl.TEXTURE_WRAP_T, \tgl.CLAMP_TO_EDGE \t);\n\n\t\t\tdds.generateMipmaps = false;\n\t\t}\n\t\telse if (dds.generateMipmaps )\n\t\t{\n\t\t\tgl.texParameteri( dds.type, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_LINEAR );\n\t\t}\n\n        for ( var target in dds.data )\n        {\n\t\t\tvar width  = dds.width;\n\t\t\tvar height = dds.height;\n\n\t\t\tvar levels = dds.data[ target ];\n\n\t\t\tfor ( var l = 0; l < levels.length; l++ )\n\t\t\t{\n\t\t\t\tif ( l != 0 )\n\t\t\t\t{\n\t\t\t\t\twidth  = Math.max( width  * 0.5, 1 );\n\t\t\t\t\theight = Math.max( height * 0.5, 1 );\n\t\t\t\t}\n\n\t\t\t\tif ( dds.format.internal < 33776 || dds.format.internal > 33779 )\n\t\t\t\t{\n\t\t\t\t\tgl.texImage2D( +target, l, dds.format.internal, width, height, 0, dds.format.format, dds.format.type, levels[ l ] );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tgl.compressedTexImage2D( +target, l, dds.format.internal, width, height, 0, levels[ l ] );\n\t\t\t\t\tdds.generateMipmaps = false;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\tif ( dds.generateMipmaps )\n\t\t{\n\t\t\tgl.generateMipmap( dds.type );\n\t\t}\n\n\t\tif ( flipY )\n\t\t{\n\t\t\tgl.pixelStorei( gl.UNPACK_FLIP_Y_WEBGL, false );\n\t\t}\n\n        gl.bindTexture(dds.type, null);\n\n\t\ttexture.width  = dds.width;\n\t\ttexture.height = dds.height;\n        texture.ready = true;\n        texture.textureCubeReady = true;\n    });\n};\n\n/*****************************************************************************\n*\n*****************************************************************************/\nx3dom.Utils.createTextureCube = function(gl, doc, src, bgnd, crossOrigin, scale, genMipMaps, flipY)\n{\n    //Create a black 4 pixel texture to prevent 'texture not complete' warning\n    var data = new Uint8Array([0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255]);\n\n    var texture = gl.createTexture();\n\n\tvar faces;\n\tif (bgnd) {\n\t\tfaces = [gl.TEXTURE_CUBE_MAP_POSITIVE_Z, gl.TEXTURE_CUBE_MAP_NEGATIVE_Z,\n\t\t\t\t gl.TEXTURE_CUBE_MAP_POSITIVE_Y, gl.TEXTURE_CUBE_MAP_NEGATIVE_Y,\n\t\t\t\t gl.TEXTURE_CUBE_MAP_POSITIVE_X, gl.TEXTURE_CUBE_MAP_NEGATIVE_X];\n\t}\n\telse\n\t{\n\t\t//       back, front, bottom, top, left, right\n\t\tfaces = [gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, gl.TEXTURE_CUBE_MAP_POSITIVE_Z,\n\t\t\t\t gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, gl.TEXTURE_CUBE_MAP_POSITIVE_Y,\n\t\t\t\t gl.TEXTURE_CUBE_MAP_NEGATIVE_X, gl.TEXTURE_CUBE_MAP_POSITIVE_X];\n    }\n\n\n\n    texture.ready = false;\n    texture.pendingTextureLoads = -1;\n    texture.textureCubeReady = false;\n\n    var width = 0, height = 0;\n\n    for (var i=0; i<faces.length; i++)\n    {\n        gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture);\n        gl.texImage2D(faces[i], 0, gl.RGBA, 2, 2, 0, gl.RGBA, gl.UNSIGNED_BYTE, data);\n        gl.bindTexture(gl.TEXTURE_CUBE_MAP, null);\n    }\n\n    if ( src.length == 1 )\n    {\n        doc.incrementDownloads();\n\n        x3dom.Utils.tryDDSLoading(texture, gl, doc, src[0], genMipMaps, flipY).then( function() {\n            doc.decrementDownloads();\n            doc.needRender = true;\n        }, function() {\n            x3dom.debug.logError(\"[Utils|createTexture2D] Can't load Image: \" + src);\n            doc.decrementDownloads();\n        });\n    }\n    else if ( src.length == 6 )\n    {\n        for (var i=0; i<faces.length; i++)\n        {\n            var face = faces[i];\n\n            var image = new Image();\n\n            switch(crossOrigin.toLowerCase()) {\n                case 'anonymous': {\n                    image.crossOrigin = 'anonymous';\n                } break;\n                case 'use-credentials': {\n                    image.crossOrigin = 'use-credentials';\n                } break;\n                case 'none': {\n                    //this is needed to omit the default case, if default is none, erase this and the default case\n                } break;\n                default: {\n                    if(x3dom.Utils.forbiddenBySOP(src[i])) {\n                        image.crossOrigin = 'anonymous';\n                    }\n                }\n            }\n\n            texture.pendingTextureLoads++;\n            doc.incrementDownloads();\n\n            image.onload = (function(texture, face, image, swap) {\n                return function() {\n                    if (width == 0 && height == 0) {\n                        width = image.width;\n                        height = image.height;\n                    }\n                    else if (scale && (width != image.width || height != image.height)) {\n                        x3dom.debug.logWarning(\"[Utils|createTextureCube] Rescaling CubeMap images, which are of different size!\");\n                        image = x3dom.Utils.rescaleImage(image, width, height);\n                    }\n\n                    gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, swap);\n\n                    gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture);\n                    gl.texImage2D(face, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);\n                    gl.bindTexture(gl.TEXTURE_CUBE_MAP, null);\n                    gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);\n\n                    texture.pendingTextureLoads--;\n                    doc.decrementDownloads();\n\n                    if (texture.pendingTextureLoads < 0) {\n                        //Save image size also for cube tex\n                        texture.width  = width;\n                        texture.height = height;\n                        texture.textureCubeReady = true;\n\n                        if (genMipMaps) {\n                            gl.bindTexture(gl.TEXTURE_CUBE_MAP, texture);\n                            gl.generateMipmap(gl.TEXTURE_CUBE_MAP);\n                            gl.bindTexture(gl.TEXTURE_CUBE_MAP, null);\n                        }\n\n                        x3dom.debug.logInfo(\"[Utils|createTextureCube] Loading CubeMap finished...\");\n                        doc.needRender = true;\n                    }\n                };\n            })( texture, face, image, bgnd );\n\n            image.onerror = function()\n            {\n                doc.decrementDownloads();\n\n                x3dom.debug.logError(\"[Utils|createTextureCube] Can't load CubeMap!\");\n            };\n\n            // backUrl, frontUrl, bottomUrl, topUrl, leftUrl, rightUrl (for bgnd)\n            image.src = src[i];\n        }\n    }\n\n\treturn texture;\n};\n\n/*****************************************************************************\n * Initialize framebuffer object and associated texture(s)\n *****************************************************************************/\nx3dom.Utils.initFBO = function(gl, w, h, type, mipMap, needDepthBuf, numMrt) {\n    \n\tvar tex = gl.createTexture();\n    tex.width  = w;\n    tex.height = h;\n\n    gl.bindTexture(gl.TEXTURE_2D, tex);\n    gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, w, h, 0, gl.RGBA, type, null);\n    if (mipMap)\n        gl.generateMipmap(gl.TEXTURE_2D);\n    gl.bindTexture(gl.TEXTURE_2D, null);\n\n    var i, mrts = null;\n\n    if (x3dom.caps.DRAW_BUFFERS && numMrt !== undefined) {\n        mrts = [ tex ];\n\n        for (i=1; i<numMrt; i++) {\n            mrts[i] = gl.createTexture();\n            mrts[i].width  = w;\n            mrts[i].height = h;\n\n            gl.bindTexture(gl.TEXTURE_2D, mrts[i]);\n            gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, w, h, 0, gl.RGBA, type, null);\n            if (mipMap)\n                gl.generateMipmap(gl.TEXTURE_2D);\n            gl.bindTexture(gl.TEXTURE_2D, null);\n        }\n    }\n\n    var fbo = gl.createFramebuffer();\n    var dtex = null;\n    var rb = null;\n\n    if (needDepthBuf) {\n        if(x3dom.caps.DEPTH_TEXTURE !== null) {\n            dtex = gl.createTexture();\n            gl.bindTexture(gl.TEXTURE_2D, dtex);\n            gl.texImage2D(gl.TEXTURE_2D, 0, gl.DEPTH_COMPONENT, w, h, 0, gl.DEPTH_COMPONENT, gl.UNSIGNED_SHORT, null);\n            if(mipMap)\n                gl.generateMipmap(gl.TEXTURE_2D);\n            gl.bindTexture(gl.TEXTURE_2D, null);\n            dtex.width = w;\n            dtex.height = h;\n        }\n        else {\n            rb = gl.createRenderbuffer();\n            \n            gl.bindRenderbuffer(gl.RENDERBUFFER, rb);\n            gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, w, h);\n            gl.bindRenderbuffer(gl.RENDERBUFFER, null);\n        }\n    }\n\n    gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);\n\n    gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0);\n    if (x3dom.caps.DRAW_BUFFERS && numMrt !== undefined) {\n        for (i=1; i<numMrt; i++) {\n            gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + i, gl.TEXTURE_2D, mrts[i], 0);\n        }\n    }\n    \n    if(needDepthBuf && x3dom.caps.DEPTH_TEXTURE !== null) {\n        gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.TEXTURE_2D, dtex, 0);\n    }\n    else {\n        gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, rb);\n    }\n\n    var status = gl.checkFramebufferStatus(gl.FRAMEBUFFER);\n\t\n    if (status != gl.FRAMEBUFFER_COMPLETE) {\n        x3dom.debug.logWarning(\"[Utils|InitFBO] FBO-Status: \" + status);\n    }\n\n    gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n\t\n    return {\n        fbo: fbo, dtex: dtex, rbo: rb,\n        tex: tex, texTargets: mrts,\n        width: w, height: h,\n        type: type, mipMap: mipMap\n    };\n};\n\n/*****************************************************************************\n*\n*****************************************************************************/\nx3dom.Utils.getFileName = function(url)\n{\n\tvar filename;\n\n\tif( url.lastIndexOf(\"/\") > -1 ) {\n\t\tfilename = url.substr( url.lastIndexOf(\"/\") + 1 );\n\t}\n\telse if( url.lastIndexOf(\"\\\\\") > -1 ) {\n\t\tfilename = url.substr( url.lastIndexOf(\"\\\\\") + 1 );\n\t}\n\telse {\n\t\tfilename = url;\n\t}\n\n\treturn filename;\n};\n\n/*****************************************************************************\n*\n*****************************************************************************/\nx3dom.Utils.isWebGL2Enabled = function()\n{\n\tvar canvas = document.createElement(\"canvas\");\n\t\n\tvar webgl2 = canvas.getContext(\"webgl2\") || canvas.getContext(\"experimental-webgl2\");\n\t\n\treturn ( webgl2 ) ? true : false;\n};\n\n/*****************************************************************************\n*\n*****************************************************************************/\nx3dom.Utils.findTextureByName = function(texture, name)\n{\n\tfor ( var i=0; i<texture.length; ++i )\n\t{\n\t\tif ( name == texture[i].samplerName )\n\t\t\treturn texture[i];\n\t}\n\treturn false;\n};\n\n/*****************************************************************************\n* Rescale image to given size\n*****************************************************************************/\nx3dom.Utils.rescaleImage = function(image, width, height)\n{\n\tvar canvas = document.createElement(\"canvas\");\n\tcanvas.width = width; canvas.height = height;\n\tcanvas.getContext(\"2d\").drawImage(image,\n\t\t\t\t0, 0, image.width, image.height,\n\t\t\t\t0, 0, canvas.width, canvas.height);\n\treturn canvas;\n};\n\n/*****************************************************************************\n* Scale image to next best power of two\n*****************************************************************************/\nx3dom.Utils.scaleImage = function(image)\n{\n\tif (!x3dom.Utils.isPowerOfTwo(image.width) || !x3dom.Utils.isPowerOfTwo(image.height)) {\n\t\tvar canvas = document.createElement(\"canvas\");\n\t\tcanvas.width = x3dom.Utils.nextHighestPowerOfTwo(image.width);\n\t\tcanvas.height = x3dom.Utils.nextHighestPowerOfTwo(image.height);\n\t\tvar ctx = canvas.getContext(\"2d\");\n\t\tctx.drawImage(image,\n\t\t\t\t\t  0, 0, image.width, image.height,\n\t\t\t\t\t  0, 0, canvas.width, canvas.height);\n\t\timage = canvas;\n\t}\n\treturn image;\n};\n\n\n/*****************************************************************************\n* Check if value is power of two\n*****************************************************************************/\nx3dom.Utils.isPowerOfTwo = function(x)\n{\n\treturn ((x & (x - 1)) === 0);\n};\n\n\n/*****************************************************************************\n* Return next highest power of two\n*****************************************************************************/\nx3dom.Utils.nextHighestPowerOfTwo = function(x)\n{\n\t--x;\n\tfor (var i = 1; i < 32; i <<= 1) {\n\t\tx = x | x >> i;\n\t}\n\treturn (x + 1);\n};\n\n\n/*****************************************************************************\n* Return next best power of two\n*****************************************************************************/\nx3dom.Utils.nextBestPowerOfTwo = function(x)\n{\n    // use precomputed log(2.0) = 0.693147180559945\n\tvar log2x = Math.log(x) / 0.693147180559945;\n\treturn Math.pow(2, Math.round(log2x));\n};\n\n/*****************************************************************************\n* Return data type size in byte\n*****************************************************************************/\nx3dom.Utils.getDataTypeSize = function(type)\n{\n\tswitch(type)\n\t{\n\t\tcase \"Int8\":\n\t\tcase \"Uint8\":\n\t\t\treturn 1;\n\t\tcase \"Int16\":\n\t\tcase \"Uint16\":\n\t\t\treturn 2;\n\t\tcase \"Int32\":\n\t\tcase \"Uint32\":\n\t\tcase \"Float32\":\n\t\t\treturn 4;\n\t\tcase \"Float64\":\n\t\tdefault:\n\t\t\treturn 8;\n\t}\n};\n\n/*****************************************************************************\n * Return offset multiplier (Uint32 is twice as big as Uint16)\n *****************************************************************************/\nx3dom.Utils.getOffsetMultiplier = function(indexType, gl)\n{\n    switch(indexType)\n    {\n        case gl.UNSIGNED_SHORT:\n            return 1;\n        case gl.UNSIGNED_INT:\n            return 2;\n        case gl.UNSIGNED_BYTE:\n            return 0.5;\n        default:\n            return 1;\n    }\n};\n\n/*****************************************************************************\n * Return byte aware offset\n *****************************************************************************/\nx3dom.Utils.getByteAwareOffset = function(offset, indexType, gl)\n{\n    switch(indexType)\n    {\n        case gl.UNSIGNED_SHORT:\n            return 2 * offset;\n        case gl.UNSIGNED_INT:\n            return 4 * offset;\n        case gl.UNSIGNED_BYTE:\n            return offset;\n        default:\n            return 2 * offset;\n    }\n};\n\n/*****************************************************************************\n* Return this.gl-Type\n*****************************************************************************/\nx3dom.Utils.getVertexAttribType = function(type, gl)\n{\n\tvar dataType = gl.NONE;\n\n\tswitch(type)\n\t{\n\t\tcase \"Int8\":\n\t\t\tdataType = gl.BYTE;\n\t\t\tbreak;\n\t\tcase \"Uint8\":\n\t\t\tdataType = gl.UNSIGNED_BYTE;\n\t\t\tbreak;\n\t\tcase \"Int16\":\n\t\t\tdataType = gl.SHORT;\n\t\t\tbreak;\n\t\tcase \"Uint16\":\n\t\t\tdataType = gl.UNSIGNED_SHORT;\n\t\t\tbreak;\n\t\tcase \"Int32\":\n\t\t\tdataType = gl.INT;\n\t\t\tbreak;\n\t\tcase \"Uint32\":\n\t\t\tdataType = gl.UNSIGNED_INT;\n\t\t\tbreak;\n\t\tcase \"Float32\":\n\t\t\tdataType = gl.FLOAT;\n\t\t\tbreak;\n\t\tcase \"Float64\":\n\t\tdefault:\n\t\t\tx3dom.debug.logError(\"Can't find this.gl data type for \" + type + \", getting FLOAT...\");\n\t\t\tdataType = gl.FLOAT;\n\t\t\tbreak;\n\t}\n\n\treturn dataType;\n};\n\n/*****************************************************************************\n* Return TypedArray View\n*****************************************************************************/\nx3dom.Utils.getArrayBufferView = function(type, buffer)\n{\n\tvar array = null;\n\n\tswitch(type)\n\t{\n\t\tcase \"Int8\":\n\t\t\tarray = new Int8Array(buffer);\n\t\t\tbreak;\n\t\tcase \"Uint8\":\n\t\t\tarray = new Uint8Array(buffer);\n\t\t\tbreak;\n\t\tcase \"Int16\":\n\t\t\tarray = new Int16Array(buffer);\n\t\t\tbreak;\n\t\tcase \"Uint16\":\n\t\t\tarray = new Uint16Array(buffer);\n\t\t\tbreak;\n\t\tcase \"Int32\":\n\t\t\tarray = new Int32Array(buffer);\n\t\t\tbreak;\n\t\tcase \"Uint32\":\n\t\t\tarray = new Uint32Array(buffer);\n\t\t\tbreak;\n\t\tcase \"Float32\":\n\t\t\tarray = new Float32Array(buffer);\n\t\t\tbreak;\n\t\tcase \"Float64\":\n\t\t\tarray = new Float64Array(buffer);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tx3dom.debug.logError(\"Can't create typed array view of type \" + type + \", trying Float32...\");\n\t\t\tarray = new Float32Array(buffer);\n\t\t\tbreak;\n\t}\n\n\treturn array;\n};\n\n/*****************************************************************************\n* Checks whether a TypedArray View Type with the given name string is unsigned\n*****************************************************************************/\nx3dom.Utils.isUnsignedType = function (str)\n{\n  return (str == \"Uint8\" || str == \"Uint16\" || str == \"Uint16\" || str == \"Uint32\");\n};\n\n\n/*****************************************************************************\n* Checks for lighting\n*****************************************************************************/\nx3dom.Utils.checkDirtyLighting = function(viewarea)\n{\n\treturn (viewarea.getLights().length + viewarea._scene.getNavigationInfo()._vf.headlight);\n};\n\n/*****************************************************************************\n * Checks for PhysicalEnvironmentLight change\n *****************************************************************************/\nx3dom.Utils.checkDirtyPhysicalEnvironmentLight = function(viewarea, shaderProperties)\n{\n    return (!!shaderProperties.PHYSICALENVLIGHT != viewarea.hasPhysicalEnvironmentLight());\n};\n\n/*****************************************************************************\n * Checks for environment\n *****************************************************************************/\nx3dom.Utils.checkDirtyEnvironment = function(viewarea, shaderProperties)\n{\n    var environment = viewarea._scene.getEnvironment();\n\n    return (shaderProperties.GAMMACORRECTION != environment._vf.gammaCorrectionDefault);\n};\n\n/*****************************************************************************\n* Get GL min filter\n*****************************************************************************/\nx3dom.Utils.minFilterDic = function(gl, minFilter)\n{\n\tswitch(minFilter.toUpperCase())\n\t{\n\t\tcase \"NEAREST\":                      return gl.NEAREST;\n\t\tcase \"LINEAR\":                       return gl.LINEAR;\n\t\tcase \"NEAREST_MIPMAP_NEAREST\":       return gl.NEAREST_MIPMAP_NEAREST;\n\t\tcase \"NEAREST_MIPMAP_LINEAR\":        return gl.NEAREST_MIPMAP_LINEAR;\n\t\tcase \"LINEAR_MIPMAP_NEAREST\":        return gl.LINEAR_MIPMAP_NEAREST;\n\t\tcase \"LINEAR_MIPMAP_LINEAR\":         return gl.LINEAR_MIPMAP_LINEAR;\n\t\tcase \"AVG_PIXEL\":                    return gl.LINEAR;\n\t\tcase \"AVG_PIXEL_AVG_MIPMAP\":         return gl.LINEAR_MIPMAP_LINEAR;\n\t\tcase \"AVG_PIXEL_NEAREST_MIPMAP\":     return gl.LINEAR_MIPMAP_NEAREST;\n\t\tcase \"DEFAULT\":                      return gl.LINEAR_MIPMAP_LINEAR;\n\t\tcase \"FASTEST\":                      return gl.NEAREST;\n\t\tcase \"NEAREST_PIXEL\":                return gl.NEAREST;\n\t\tcase \"NEAREST_PIXEL_AVG_MIPMAP\":     return gl.NEAREST_MIPMAP_LINEAR;\n\t\tcase \"NEAREST_PIXEL_NEAREST_MIPMAP\": return gl.NEAREST_MIPMAP_NEAREST;\n\t\tcase \"NICEST\":                       return gl.LINEAR_MIPMAP_LINEAR;\n\t\tdefault:\t\t\t\t\t\t\t return gl.LINEAR;\n\t}\n};\n\n/*****************************************************************************\n* Get GL min filter\n*****************************************************************************/\nx3dom.Utils.minFilterDicX3D = function(minFilter)\n{\n\tswitch(minFilter)\n\t{\n\t\tcase 9728: return \"NEAREST\";\n\t\tcase 9729: return \"LINEAR\";\n        case 9984: return \"NEAREST_MIPMAP_NEAREST\";\n        case 9985: return \"LINEAR_MIPMAP_NEAREST\";\n\t\tcase 9986: return \"NEAREST_MIPMAP_LINEAR\";\n        case 9987: return \"LINEAR_MIPMAP_LINEAR\";\n        default:   return \"LINEAR_MIPMAP_LINEAR\";\n\t}\n};\n\n/*****************************************************************************\n* Get GL mag filter\n*****************************************************************************/\nx3dom.Utils.magFilterDic = function(gl, magFilter)\n{\n\tswitch(magFilter.toUpperCase())\n\t{\n\t\tcase \"NEAREST\": \t\treturn gl.NEAREST;\n\t\tcase \"LINEAR\":\t\t\treturn gl.LINEAR;\n\t\tcase \"AVG_PIXEL\":\t\treturn gl.LINEAR;\n\t\tcase \"DEFAULT\":\t\t\treturn gl.LINEAR;\n\t\tcase \"FASTEST\":\t\t\treturn gl.NEAREST;\n\t\tcase \"NEAREST_PIXEL\":\treturn gl.NEAREST;\n\t\tcase \"NICEST\":\t\t\treturn gl.LINEAR;\n\t\tdefault:\t\t\t\treturn gl.LINEAR;\n\t}\n};\n\n/*****************************************************************************\n* Get X3D mag filter\n*****************************************************************************/\nx3dom.Utils.magFilterDicX3D = function(magFilter)\n{\n\tswitch(magFilter)\n\t{\n\t\tcase 9728: return \"NEAREST\";\n\t\tcase 9729: return \"LINEAR\";\n\t\tdefault:   return \"LINEAR\";\n\t}\n};\n\n/*****************************************************************************\n* Get GL boundary mode\n*****************************************************************************/\nx3dom.Utils.boundaryModesDicX3D = function(mode)\n{\n\tswitch(mode)\n\t{\n\n        case 10497: return \"REPEAT\";\n\t\tcase 33071: return \"CLAMP_TO_EDGE\";\n\t\tcase 33648: return \"MIRRORED_REPEAT\";\n\t\tdefault:    return \"REPEAT\";\n\t}\n};\n\n/*****************************************************************************\n* Get GL boundary mode\n*****************************************************************************/\nx3dom.Utils.boundaryModesDic = function(gl, mode)\n{\n\tswitch(mode.toUpperCase())\n\t{\n\t\tcase \"CLAMP\":             return gl.CLAMP_TO_EDGE;\n\t\tcase \"CLAMP_TO_EDGE\":     return gl.CLAMP_TO_EDGE;\n\t\tcase \"CLAMP_TO_BOUNDARY\": return gl.CLAMP_TO_EDGE;\n\t\tcase \"MIRRORED_REPEAT\":   return gl.MIRRORED_REPEAT;\n\t\tcase \"REPEAT\":            return gl.REPEAT;\n\t\tdefault:\t\t\t\t  return gl.REPEAT;\n\t}\n};\n\n/*****************************************************************************\n * Get GL primitive type\n *****************************************************************************/\nx3dom.Utils.primTypeDic = function(gl, type)\n{\n    switch(type.toUpperCase())\n    {\n        case \"POINTS\":        return gl.POINTS;\n        case \"LINES\":         return gl.LINES;\n        case \"LINELOOP\":      return gl.LINE_LOOP;\n        case \"LINESTRIP\":     return gl.LINE_STRIP;\n        case \"TRIANGLES\":     return gl.TRIANGLES;\n        case \"TRIANGLESTRIP\": return gl.TRIANGLE_STRIP;\n        case \"TRIANGLEFAN\":   return gl.TRIANGLE_FAN;\n        default:              return gl.TRIANGLES;\n    }\n};\n\n/*****************************************************************************\n* Get GL depth function\n*****************************************************************************/\nx3dom.Utils.depthFunc = function(gl, func)\n{\n\tswitch(func.toUpperCase())\n\t{\n\t\tcase \"NEVER\":             return gl.NEVER;\n\t\tcase \"ALWAYS\":            return gl.ALWAYS;\n\t\tcase \"LESS\":              return gl.LESS;\n\t\tcase \"EQUAL\":             return gl.EQUAL;\n\t\tcase \"LEQUAL\":            return gl.LEQUAL;\n        case \"GREATER\":           return gl.GREATER;\n        case \"GEQUAL\":            return gl.GEQUAL;\n        case \"NOTEQUAL\":          return gl.NOTEQUAL;\n\t\tdefault:\t\t\t\t  return gl.LEQUAL;\n\t}\n};\n\n/*****************************************************************************\n * Get GL blend function\n *****************************************************************************/\nx3dom.Utils.blendFunc = function(gl, func)\n{\n    switch(func.toLowerCase())\n    {\n        case \"zero\":                        return gl.ZERO;\n        case \"one\":                         return gl.ONE;\n        case \"dst_color\":                   return gl.DST_COLOR;\n        case \"dst_alpha\":                   return gl.DST_ALPHA;\n        case \"src_color\":                   return gl.SRC_COLOR;\n        case \"src_alpha\":                   return gl.SRC_ALPHA;\n        case \"one_minus_dst_color\":         return gl.ONE_MINUS_DST_COLOR;\n        case \"one_minus_dst_alpha\":         return gl.ONE_MINUS_DST_ALPHA;\n        case \"one_minus_src_color\":         return gl.ONE_MINUS_SRC_COLOR;\n        case \"one_minus_src_alpha\":         return gl.ONE_MINUS_SRC_ALPHA;\n        case \"src_alpha_saturate\":          return gl.SRC_ALPHA_SATURATE;\n        case \"constant_color\":              return gl.CONSTANT_COLOR;\n        case \"constant_alpha\":              return gl.CONSTANT_ALPHA;\n        case \"one_minus_constant_color\":    return gl.ONE_MINUS_CONSTANT_COLOR;\n        case \"one_minus_constant_alpha\":    return gl.ONE_MINUS_CONSTANT_ALPHA;\n        default:\t\t\t\t            return 0;\n    }\n};\n\n/*****************************************************************************\n * Get GL blend equations\n *****************************************************************************/\nx3dom.Utils.blendEquation = function(gl, func)\n{\n    switch(func.toLowerCase())\n    {\n        case \"func_add\":                return gl.FUNC_ADD;\n        case \"func_subtract\":           return gl.FUNC_SUBTRACT;\n        case \"func_reverse_subtract\":   return gl.FUNC_REVERSE_SUBTRACT;\n        case \"min\":                     return 0;  //Not supported yet\n        case \"max\":                     return 0;  //Not supported yet\n        case \"logic_op\":                return 0;  //Not supported yet\n        default:\t\t\t\t        return 0;\n    }\n};\n\n/*****************************************************************************\n * Try to gunzip arraybuffer, otherwise return unmodified arraybuffer\n *****************************************************************************/\nx3dom.Utils.gunzip = function (arraybuffer)\n{\n    var byteArray = new Uint8Array(arraybuffer);\n\n    try {\n        arraybuffer = new Zlib.Gunzip(byteArray).decompress().buffer;\n    } catch (e) {\n        //Decompression failed, file is not compressed.\n    }\n\n    return arraybuffer;\n};\n\n/*****************************************************************************\n*\n*****************************************************************************/\nx3dom.Utils.generateProperties = function (viewarea, shape)\n{\n\tvar property = {};\n\n\tvar geometry \t= shape._cf.geometry.node;\n\tvar appearance \t= shape._cf.appearance.node;\n\tvar texture \t= appearance ? appearance._cf.texture.node : null;\n\tvar material    = appearance ? appearance._cf.material.node : null;\n    var environment = viewarea._scene.getEnvironment();\n\n\t//Check if it's a composed shader\n\tif (appearance && appearance._shader &&\n        x3dom.isa(appearance._shader, x3dom.nodeTypes.ComposedShader)) {\n\n\t\tproperty.CSHADER          = appearance._shader._id; //shape._objectID;\n\t}\n    else if (geometry) {\n\n        property.CSHADER          = -1;\n        property.APPMAT           = (appearance && (material || property.CSSHADER) ) ? 1 : 0;\n        property.SOLID            = (shape.isSolid()) ? 1 : 0;\n        property.TEXT             = (x3dom.isa(geometry, x3dom.nodeTypes.Text)) ? 1 : 0;\n        property.POPGEOMETRY      = (x3dom.isa(geometry, x3dom.nodeTypes.PopGeometry)) ? 1 : 0;\n        property.BUFFERGEOMETRY      = (x3dom.isa(geometry, x3dom.nodeTypes.BufferGeometry)) ? 1 : 0;\n        property.IMAGEGEOMETRY    = (x3dom.isa(geometry, x3dom.nodeTypes.ImageGeometry))  ? 1 : 0;\n        property.BINARYGEOMETRY   = (x3dom.isa(geometry, x3dom.nodeTypes.BinaryGeometry))  ? 1 : 0;\n\t\tproperty.EXTERNALGEOMETRY = (x3dom.isa(geometry, x3dom.nodeTypes.ExternalGeometry))  ? 1 : 0;\n        property.IG_PRECISION     = (property.IMAGEGEOMETRY) ? geometry.numCoordinateTextures() : 0;\n        property.IG_INDEXED       = (property.IMAGEGEOMETRY && geometry.getIndexTexture() != null) ? 1 : 0;\n        property.POINTLINE2D      = !geometry.needLighting() ? 1 : 0;\n        property.VERTEXID         = ((property.BINARYGEOMETRY || property.EXTERNALGEOMETRY) && geometry._vf.idsPerVertex) ? 1 : 0;\n        property.IS_PARTICLE      = (x3dom.isa(geometry, x3dom.nodeTypes.ParticleSet)) ? 1 : 0;\n        property.TANGENTDATA      = (geometry._mesh._tangents[0].length > 0 && geometry._mesh._binormals[0].length > 0) ? 1 : 0;\n\n        property.PBR_MATERIAL     = ( property.APPMAT && x3dom.isa(material, x3dom.nodeTypes.PhysicalMaterial)) ? 1 : 0;\n        property.TWOSIDEDMAT      = ( property.APPMAT && x3dom.isa(material, x3dom.nodeTypes.TwoSidedMaterial)) ? 1 : 0;\n        property.SEPARATEBACKMAT  = ( property.TWOSIDEDMAT && material._vf.separateBackColor) ? 1 : 0;\n        property.SHADOW           = (viewarea.getLightsShadow()) ? 1 : 0;\n        property.FOG              = (viewarea._scene.getFog()._vf.visibilityRange > 0) ? 1 : 0;\n        property.CSSHADER         = (appearance && appearance._shader &&\n                                     x3dom.isa(appearance._shader, x3dom.nodeTypes.CommonSurfaceShader)) ? 1 : 0;\n\n        property.LIGHTS           = (!property.POINTLINE2D && appearance && shape.isLit() && (material || property.CSSHADER)) ?\n                                     viewarea.getLights().length + (viewarea._scene.getNavigationInfo()._vf.headlight) : 0;\n        property.TEXTURED         = (texture || property.TEXT || ( property.CSSHADER && appearance._shader.needTexcoords() ) ||\n                                    (property.PBR_MATERIAL && material.hasTextures())) ? 1 : 0;\n        property.CUBEMAP          = (texture && x3dom.isa(texture, x3dom.nodeTypes.X3DEnvironmentTextureNode)) ||\n                                    (property.CSSHADER && appearance._shader.getEnvironmentMap()) ? 1 : 0;\n        property.PIXELTEX         = (texture && x3dom.isa(texture, x3dom.nodeTypes.PixelTexture)) ? 1 : 0;\n        property.TEXTRAFO         = (appearance && appearance._cf.textureTransform.node) ? 1 : 0;\n        property.DIFFUSEMAP       = (texture && !x3dom.isa(texture, x3dom.nodeTypes.X3DEnvironmentTextureNode) ) ||\n                                    (property.CSSHADER && appearance._shader.getDiffuseMap()) ||\n                                    (property.PBR_MATERIAL && material._cf.baseColorTexture.node) ? 1 : 0;\n        property.NORMALMAP        = (property.CSSHADER && appearance._shader.getNormalMap()) ||\n                                    (property.PBR_MATERIAL && material._cf.normalTexture.node) ? 1 : 0;\n        property.SPECMAP          = (property.CSSHADER && appearance._shader.getSpecularMap()) ? 1 : 0;\n        property.SHINMAP          = (property.CSSHADER && appearance._shader.getShininessMap()) ? 1 : 0;\n        property.EMISSIVEMAP      = (property.PBR_MATERIAL && material._cf.emissiveTexture.node) ? 1 : 0;\n        property.OCCLUSIONMAP     = (property.PBR_MATERIAL && material._cf.occlusionTexture.node) ? 1 : 0;\n        property.DISPLACEMENTMAP  = (property.CSSHADER && appearance._shader.getDisplacementMap()) ? 1 : 0;\n        property.DIFFPLACEMENTMAP = (property.CSSHADER && appearance._shader.getDiffuseDisplacementMap()) ? 1 : 0;\n        property.MULTIDIFFALPMAP  = (property.VERTEXID && property.CSSHADER && appearance._shader.getMultiDiffuseAlphaMap()) ? 1 : 0;\n        property.MULTIEMIAMBMAP   = (property.VERTEXID && property.CSSHADER && appearance._shader.getMultiEmissiveAmbientMap()) ? 1 : 0;\n        property.MULTISPECSHINMAP = (property.VERTEXID && property.CSSHADER && appearance._shader.getMultiSpecularShininessMap()) ? 1 : 0;\n        property.MULTIVISMAP      = (property.VERTEXID && property.CSSHADER && appearance._shader.getMultiVisibilityMap()) ? 1 : 0;\n\n        property.ALPHAMODE            = (property.PBR_MATERIAL) ? material._vf.alphaMode : \"BLEND\";\n        property.ISROUGHNESSMETALLIC  = (property.PBR_MATERIAL && material._vf.model == \"roughnessMetallic\") ? 1 : 0;\n        property.ROUGHNESSMETALLICMAP = (property.PBR_MATERIAL && material._cf.roughnessMetallicTexture.node) ? 1 : 0;\n        property.SPECULARGLOSSINESSMAP = (property.PBR_MATERIAL && material._cf.specularGlossinessTexture.node) ? 1 : 0;\n        property.OCCLUSIONROUGHNESSMETALLICMAP = (property.PBR_MATERIAL && material._cf.occlusionRoughnessMetallicTexture.node) ? 1 : 0;\n        property.PHYSICALENVLIGHT = viewarea.hasPhysicalEnvironmentLight() ? 1 : 0;\n\n        property.NORMALSPACE      = (property.NORMALMAP && property.CSSHADER) ? appearance._shader._vf.normalSpace.toUpperCase() :\n                                    (property.NORMALMAP && property.PBR_MATERIAL) ? material._vf.normalSpace.toUpperCase() : \"TANGENT\";\n\n        property.BLENDING         = (property.TEXT || property.CUBEMAP || property.CSSHADER || (property.PBR_MATERIAL)|| (texture && texture._blending)) ? 1 : 0;\n        property.REQUIREBBOX      = (geometry._vf.coordType !== undefined && geometry._vf.coordType != \"Float32\") ? 1 : 0;\n        property.REQUIREBBOXNOR   = (geometry._vf.normalType !== undefined && geometry._vf.normalType != \"Float32\") ? 1 : 0;\n        property.REQUIREBBOXCOL   = (geometry._vf.colorType !== undefined && geometry._vf.colorType != \"Float32\") ? 1 : 0;\n        property.REQUIREBBOXTEX   = (geometry._vf.texCoordType !== undefined && geometry._vf.texCoordType != \"Float32\") ? 1 : 0;\n        property.COLCOMPONENTS    = geometry._mesh._numColComponents;\n        property.NORCOMPONENTS    = geometry._mesh._numNormComponents;\n        property.POSCOMPONENTS    = geometry._mesh._numPosComponents;\n        property.SPHEREMAPPING    = (geometry._cf.texCoord !== undefined && geometry._cf.texCoord.node !== null &&\n                                     geometry._cf.texCoord.node._vf.mode &&\n                                     geometry._cf.texCoord.node._vf.mode.toLowerCase() == \"sphere\") ? 1 : 0;\n        property.VERTEXCOLOR      = (geometry._mesh._colors[0].length > 0 ||\n                                     (property.IMAGEGEOMETRY  && geometry.getColorTexture()) ||\n                                     (property.POPGEOMETRY    && geometry.hasColor()) ||\n                                     (property.BUFFERGEOMETRY && geometry.hasColor()) ||\n                                     (geometry._vf.color !== undefined && geometry._vf.color.length > 0)) ? 1 : 0;\n        property.CLIPPLANES       = shape._clipPlanes.length;\n        property.ALPHATHRESHOLD\t  = (appearance) ? appearance._vf.alphaClipThreshold.toFixed(2) : 0.1;\n        property.MULTITEXCOORD\t  = (property.BUFFERGEOMETRY && geometry.hasMultiTexCoord()) ? 1 : 0;\n\n\n        property.DIFFUSEMAPCHANNEL = (property.PBR_MATERIAL && property.DIFFUSEMAP && material._cf.baseColorTexture.node._vf.channel === 1) ? 1 : 0;\n        property.NORMALMAPCHANNEL  = (property.PBR_MATERIAL && property.NORMALMAP && material._cf.normalTexture.node._vf.channel === 1) ? 1 : 0;\n        property.EMISSIVEMAPCHANNEL = (property.PBR_MATERIAL && property.EMISSIVEMAP && material._cf.emissiveTexture.node._vf.channel === 1) ? 1 : 0;\n        property.OCCLUSIONMAPCHANNEL = (property.PBR_MATERIAL && property.OCCLUSIONMAP && material._cf.occlusionTexture.node._vf.channel === 1) ? 1 : 0;\n        property.ROUGHNESSMETALLICMAPCHANNEL = (property.PBR_MATERIAL && property.ROUGHNESSMETALLICMAP && material._cf.roughnessMetallicTexture.node._vf.channel === 1) ? 1 : 0;\n        property.OCCLUSIONROUGHNESSMETALLICMAPCHANNEL = (property.PBR_MATERIAL && property.OCCLUSIONROUGHNESSMETALLICMAP && material._cf.occlusionRoughnessMetallicTexture.node._vf.channel === 1) ? 1 : 0;\n        property.SPECULARGLOSSINESSMAPCHANNEL = (property.PBR_MATERIAL && property.SPECULARGLOSSINESSMAP && material._cf.specularGlossinessTexture.node._vf.channel === 1) ? 1 : 0;\n        property.ALPHAMASK                    = (property.PBR_MATERIAL && material._vf.alphaMode == \"MASK\") ? 1 : 0;\n        property.UNLIT = (property.PBR_MATERIAL && material._vf.unlit) ? 1 : 0;\n\n        property.GAMMACORRECTION  = environment._vf.gammaCorrectionDefault;\n\n        property.KHR_MATERIAL_COMMONS = 0;\n\t}\n\n\tproperty.toIdentifier = function() {\n        delete this.id;\n\t\tvar id = \"\";\n\t\tfor(var p in this) {\n\t\t\tif(this[p] != this.toIdentifier && this[p] != this.toString) {\n\t\t\t\tid += this[p];\n\t\t\t}\n\t\t}\n        this.id = id;\n\t\treturn id;\n\t};\n\n\tproperty.toString = function() {\n\t\tvar str = \"\";\n\t\tfor(var p in this) {\n\t\t\tif(this[p] != this.toIdentifier && this[p] != this.toString) {\n\t\t\t\tstr += p + \": \" + this[p] + \", \";\n\t\t\t}\n\t\t}\n\t\treturn str;\n\t};\n\n    property.toIdentifier();\n\n\treturn property;\n};\n\n/*****************************************************************************\n* Returns the linear interpolations between two values\n*****************************************************************************/\nx3dom.Utils.lerp = function (value1, value2, amount)\n{\n    amount = amount < 0 ? 0 : amount;\n    amount = amount > 1 ? 1 : amount;\n    return value1 + (value2 - value1) * amount;\n}\n\n/*****************************************************************************\n* Returns \"shader\" such that \"shader.foo = [1,2,3]\" magically sets the\n* appropriate uniform\n*****************************************************************************/\nx3dom.Utils.wrapProgram = function (gl, program, shaderID)\n{\n\tvar shader = {\n        shaderID: shaderID,\n        program: program\n    };\n\n\tshader.bind = function () {\n\t\tgl.useProgram(program);\n\t};\n\n\tvar loc = null;\n\tvar obj = null;\n\tvar i, glErr;\n\n    // get uniforms\n\tvar numUniforms = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS);\n\n\tfor (i=0; i < numUniforms; ++i) {\n\t\ttry {\n\t\t\tobj = gl.getActiveUniform(program, i);\n\t\t}\n\t\tcatch (eu) {\n            if (!obj) continue;\n        }\n\n        glErr = gl.getError();\n        if (glErr) {\n            x3dom.debug.logError(\"GL-Error (on searching uniforms): \" + glErr);\n        }\n\n\t\tloc = gl.getUniformLocation(program, obj.name);\n\n\t\tswitch (obj.type) {\n\t\t\tcase gl.SAMPLER_2D:\n\t\t\t\tshader.__defineSetter__(obj.name,\n\t\t\t\t\t(function (loc) { return function (val) { gl.uniform1i(loc, val); }; })(loc));\n\t\t\t\tbreak;\n\t\t\tcase gl.SAMPLER_CUBE:\n\t\t\t\tshader.__defineSetter__(obj.name,\n\t\t\t\t\t(function (loc) { return function (val) { gl.uniform1i(loc, val); }; })(loc));\n\t\t\t\tbreak;\n\t\t\tcase gl.BOOL:\n\t\t\t\tshader.__defineSetter__(obj.name,\n\t\t\t\t\t(function (loc) { return function (val) { gl.uniform1i(loc, val); }; })(loc));\n\t\t\t\tbreak;\n\t\t\tcase gl.FLOAT:\n                /*\n                 * Passing a MFFloat type into uniform.\n                 * by Sofiane Benchaa, 2012.\n                 *\n                 * Based on OpenGL specification.\n                 * url: http://www.opengl.org/sdk/docs/man/xhtml/glGetUniformLocation.xml\n                 *\n                 * excerpt : Except if the last part of name indicates a uniform variable array,\n                 * the location of the first element of an array can be retrieved by using the name of the array,\n                 * or by using the name appended by \"[0]\".\n                 *\n                 * Detecting the float array and extracting its uniform name without the brackets.\n                 */\n\t\t\t\tif (obj.name.indexOf(\"[0]\") != -1)\n\t\t\t\t\tshader.__defineSetter__(obj.name.substring(0, obj.name.length-3),\n\t\t\t\t\t\t(function (loc) { return function (val) { gl.uniform1fv(loc, new Float32Array(val)); }; })(loc));\n\t\t\t\telse\n\t\t\t\t\tshader.__defineSetter__(obj.name,\n\t\t\t\t\t\t(function (loc) { return function (val) { gl.uniform1f(loc, val); }; })(loc));\n                break;\n\t\t\tcase gl.FLOAT_VEC2:\n\t\t\t\tshader.__defineSetter__(obj.name,\n\t\t\t\t\t(function (loc) { return function (val) { gl.uniform2f(loc, val[0], val[1]); }; })(loc));\n\t\t\t\tbreak;\n\t\t\tcase gl.FLOAT_VEC3:\n\t\t\t\t/* Passing arrays of vec3. see above.*/\n\t\t\t\tif (obj.name.indexOf(\"[0]\") != -1)\n\t\t\t\t\tshader.__defineSetter__(obj.name.substring(0, obj.name.length-3),\n\t\t\t\t\t\t(function (loc) { return function (val) { gl.uniform3fv(loc, new Float32Array(val)); }; })(loc));\n\t\t\t\telse\n\t\t\t\t\tshader.__defineSetter__(obj.name,\n\t\t\t\t\t\t(function (loc) { return function (val) { gl.uniform3f(loc, val[0], val[1], val[2]); }; })(loc));\n\t\t\t\tbreak;\n\t\t\tcase gl.FLOAT_VEC4:\n\t\t\t\tshader.__defineSetter__(obj.name,\n\t\t\t\t\t(function (loc) { return function (val) { gl.uniform4f(loc, val[0], val[1], val[2], val[3]); }; })(loc));\n\t\t\t\tbreak;\n\t\t\tcase gl.FLOAT_MAT2:\n\t\t\t\tshader.__defineSetter__(obj.name,\n\t\t\t\t\t(function (loc) { return function (val) { gl.uniformMatrix2fv(loc, false, new Float32Array(val)); }; })(loc));\n\t\t\t\tbreak;\n\t\t\tcase gl.FLOAT_MAT3:\n\t\t\t\tshader.__defineSetter__(obj.name,\n\t\t\t\t\t(function (loc) { return function (val) { gl.uniformMatrix3fv(loc, false, new Float32Array(val)); }; })(loc));\n\t\t\t\tbreak;\n\t\t\tcase gl.FLOAT_MAT4:\n\t\t\t\tshader.__defineSetter__(obj.name,\n\t\t\t\t\t(function (loc) { return function (val) { gl.uniformMatrix4fv(loc, false, new Float32Array(val)); }; })(loc));\n\t\t\t\tbreak;\n\t\t\tcase gl.INT:\n\t\t\t\tshader.__defineSetter__(obj.name,\n\t\t\t\t\t(function (loc) { return function (val) { gl.uniform1i(loc, val); }; }) (loc));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tx3dom.debug.logWarning('GLSL program variable '+obj.name+' has unknown type '+obj.type);\n\t\t}\n\t}\n\n    // get attributes\n\tvar numAttribs = gl.getProgramParameter(program, gl.ACTIVE_ATTRIBUTES);\n\n\tfor (i=0; i < numAttribs; ++i) {\n\t\ttry {\n\t\t\tobj = gl.getActiveAttrib(program, i);\n\t\t}\n\t\tcatch (ea) {\n            if (!obj) continue;\n        }\n\n        glErr = gl.getError();\n        if (glErr) {\n            x3dom.debug.logError(\"GL-Error (on searching attributes): \" + glErr);\n        }\n\n\t\tloc = gl.getAttribLocation(program, obj.name);\n\t\tshader[obj.name] = loc;\n\t}\n\n\treturn shader;\n};\n\n/**\n * Converts a UTF-8 Uint8Array to a string\n * @param {String} uri_string\n * @returns {boolean}\n */\nx3dom.Utils.arrayBufferToJSON = function( array, offset, length )\n{\n    offset = ( offset != undefined ) ? offset : 0;\n    length = ( length != undefined ) ? length : array.length;\n\n    var out, i, len, c;\n    var char2, char3;\n\n    out = \"\";\n    len = length;\n    i = offset;\n\n    while( i < len )\n    {\n        c = array[i++];\n\n        switch(c >> 4)\n        {\n          case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7:\n            // 0xxxxxxx\n            out += String.fromCharCode(c);\n            break;\n          case 12: case 13:\n            // 110x xxxx   10xx xxxx\n            char2 = array[i++];\n            out += String.fromCharCode(((c & 0x1F) << 6) | (char2 & 0x3F));\n            break;\n          case 14:\n            // 1110 xxxx  10xx xxxx  10xx xxxx\n            char2 = array[i++];\n            char3 = array[i++];\n            out += String.fromCharCode(((c & 0x0F) << 12) |\n                           ((char2 & 0x3F) << 6) |\n                           ((char3 & 0x3F) << 0));\n            break;\n        }\n    }\n\n    return JSON.parse(out);\n}\n\nx3dom.Utils.arrayBufferToObjectURL = function( buffer, mimetype )\n{\n    return URL.createObjectURL(new Blob([new Uint8Array(buffer)], {type: mimetype}));\n}\n\nx3dom.Utils.dataURIToObjectURL = function( dataURI )\n{\n    if ( dataURI.indexOf(\"data:\") == -1 )\n    {\n        return dataURI;\n    }\n\n    var parts        = dataURI.split(\",\");\n    var mimetype     = parts[0].split(':')[1].split(';')[0];\n    var data         = parts[1];\n    var binaryString = window.atob(data);\n    var byteLength   = binaryString.length;\n    var bytes        = new Uint8Array( byteLength );\n\n    for (var i = 0; i < byteLength; i++)\n    {\n        bytes[i] = binaryString.charCodeAt(i);\n    }\n\n    return URL.createObjectURL(new Blob([bytes], {type: mimetype}));\n}\n\nx3dom.Utils.arrayBufferToDataURL = function( buffer, mimetype )\n{\n    var binary = '';\n\n    var bytes = new Uint8Array( buffer );\n\n    for (var i = 0; i < bytes.byteLength; i++)\n    {\n        binary += String.fromCharCode( bytes[ i ] );\n    }\n\n    return \"data:\" + mimetype + \";base64,\" + window.btoa( binary );\n}\n\n\n/**\n * Matches a given URI with document.location. If domain, port and protocol are the same SOP won't forbid access to the resource.\n * @param {String} uri_string\n * @returns {boolean}\n */\nx3dom.Utils.forbiddenBySOP = function (uri_string) {\n\n    uri_string = uri_string.toLowerCase();\n    // scheme \":\" hier-part [ \"?\" query ] [ \"#\" fragment ]\n    var Scheme_AuthorityPQF = uri_string.split('//'); //Scheme and AuthorityPathQueryFragment\n    var Scheme;\n    var AuthorityPQF;\n    var Authority;\n    var UserInfo_HostPort;\n    var HostPort;\n    var Host_Port;\n    var Port;\n    var Host;\n    var originPort = document.location.port === \"\" ? \"80\" : document.location.port;\n\n    if (Scheme_AuthorityPQF.length === 2) { // if there is '//' authority is given;\n        Scheme = Scheme_AuthorityPQF[0];\n        AuthorityPQF = Scheme_AuthorityPQF[1];\n\n        /*\n         * The authority component is preceded by a double slash (\"//\") and is\n         * terminated by the next slash (\"/\"), question mark (\"?\"), or number\n         * sign (\"#\") character, or by the end of the URI.\n         */\n        Authority = AuthorityPQF.split('/')[0].split('?')[0].split('#')[0];\n\n        //authority   = [ userinfo \"@\" ] host [ \":\" port ]\n        UserInfo_HostPort = Authority.split('@');\n        if (UserInfo_HostPort.length === 1) { //No Userinfo given\n            HostPort = UserInfo_HostPort[0];\n        } else {\n            HostPort = UserInfo_HostPort[1];\n        }\n\n        Host_Port = HostPort.split(':');\n        Host = Host_Port[0];\n        Port = Host_Port[1];\n    } // else will return false for an invalid URL or URL without authority\n\n    Port = Port || originPort;\n    Host = Host || document.location.host;\n    Scheme = Scheme || document.location.protocol;\n    return !(Port === originPort && Host === document.location.host && Scheme === document.location.protocol);\n};\n\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * Philip Taylor: http://philip.html5.org\n */\n\n/**\n * States namespace\n */\nx3dom.States = function (x3dElem) {\n    var that = this;\n    this.active = false;\n\n    this.viewer = document.createElement('div');\n    this.viewer.id = 'x3dom-state-viewer';\n\n    var title = document.createElement('div');\n    title.className = 'x3dom-states-head';\n    title.appendChild(document.createTextNode('x3dom'));\n\n    var subTitle = document.createElement('span');\n    subTitle.className = 'x3dom-states-head2';\n    subTitle.appendChild(document.createTextNode('stats'));\n    title.appendChild(subTitle);\n\n    this.renderMode = document.createElement('div');\n    this.renderMode.className = 'x3dom-states-rendermode-hardware';\n\n    this.measureList = document.createElement('ul');\n    this.measureList.className = 'x3dom-states-list';\n\n    this.infoList = document.createElement('ul');\n    this.infoList.className = 'x3dom-states-list';\n\n    this.requestList = document.createElement('ul');\n    this.requestList.className = 'x3dom-states-list';\n\n    //this.viewer.appendChild(title);\n    this.viewer.appendChild(this.renderMode);\n    this.viewer.appendChild(this.measureList);\n    this.viewer.appendChild(this.infoList);\n    this.viewer.appendChild(this.requestList);\n\n    /**\n     * Disable the context menu\n     */\n    this.disableContextMenu = function (e) {\n        e.preventDefault();\n        e.stopPropagation();\n        e.returnValue = false;\n        return false;\n    };\n\n    /**\n     * Add a seperator for thousands to the string\n     */\n    this.thousandSeperator = function (value) {\n        return value.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n    };\n\n    /**\n     * Return numerical value to fixed length\n     */\n    this.toFixed = function (value) {\n        var fixed = (value < 1) ? 2 : (value < 10) ? 2 : 2;\n        return value.toFixed(fixed);\n    };\n\n    /**\n     *\n     */\n    this.addItem = function ( list, key, value ) {\n        var item = document.createElement('li');\n        item.className = 'x3dom-states-item';\n\n        var keyDiv = document.createElement('div');\n        keyDiv.className = 'x3dom-states-item-title';\n        keyDiv.appendChild(document.createTextNode(key));\n\n        var valueDiv = document.createElement('div');\n        valueDiv.className = 'x3dom-states-item-value';\n        valueDiv.appendChild(document.createTextNode(value));\n\n        item.appendChild(keyDiv);\n        item.appendChild(valueDiv);\n\n        list.appendChild(item);\n    };\n\n    /**\n     * Update the states.\n     */\n    this.update = function () {\n        if (!x3dElem.runtime && this.updateMethodID !== undefined) {\n            clearInterval(this.updateMethodID);\n            return;\n        }\n\n        var infos = x3dElem.runtime.states.infos;\n        var measurements = x3dElem.runtime.states.measurements;\n\n        var renderMode = x3dom.caps.RENDERMODE;\n\n        if ( renderMode == \"HARDWARE\" ) {\n            this.renderMode.innerHTML = \"Hardware-Rendering\";\n            this.renderMode.className = 'x3dom-states-rendermode-hardware';\n        } else if ( renderMode == \"SOFTWARE\" ) {\n            this.renderMode.innerHTML = \"Software-Rendering\";\n            this.renderMode.className = 'x3dom-states-rendermode-software';\n        }\n\n\n        //Clear measure list\n        this.measureList.innerHTML = \"\";\n\n        //Create list items\n        for (var m in measurements)\n        {\n\t\t\tif( measurements.hasOwnProperty( m ) )\n\t\t\t{\n\t\t\t    this.addItem(this.measureList, m, this.toFixed(measurements[m]) );\n\t\t\t}\n        }\n\n        //Clear info list\n        this.infoList.innerHTML = \"\";\n\n        //Create list items\n        for (var i in infos)\n        {\n\t\t\tif( infos.hasOwnProperty( i ) )\n\t\t\t{\n                this.addItem(this.infoList, i, this.thousandSeperator(infos[i]) );\n\t\t\t}\n        }\n\n        //Clear request list\n        this.requestList.innerHTML = \"\";\n\n        this.addItem(this.requestList, \"#ACTIVE\", x3dom.RequestManager.activeRequests.length );\n        this.addItem(this.requestList, \"#TOTAL\",  x3dom.RequestManager.totalRequests  );\n        this.addItem(this.requestList, \"#LOADED\", x3dom.RequestManager.loadedRequests );\n        this.addItem(this.requestList, \"#FAILED\", x3dom.RequestManager.failedRequests );\n    };\n\n    this.updateMethodID = window.setInterval(function () {\n        that.update();\n    }, 1000);\n\n    this.viewer.addEventListener(\"contextmenu\", that.disableContextMenu);\n};\n\n/**\n * Display the states\n */\nx3dom.States.prototype.display = function (value) {\n    this.active = (value !== undefined) ? value : !this.active;\n    this.viewer.style.display = (this.active) ? \"block\" : \"none\";\n};\n\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * Philip Taylor: http://philip.html5.org\n */\n\n/**\n * Manage all the GL-States and try to reduce the state changes\n */\nx3dom.StateManager = function (ctx3d)\n{\n    //Our GL-Context\n    this.gl = ctx3d;\n\n    //Hold all the active states\n    this.states = [];\n\n    //Initialize States\n    this.initStates();\n};\n\n/*\n * Initialize States\n */\nx3dom.StateManager.prototype.initStates = function ()\n{\n    //Initialize Shader states\n    this.states['shaderID'] = null;\n\n    //Initialize Framebuffer-Operation states\n    this.states['colorMask'] = {red: null, green: null, blue: null, alpha: null};\n    this.states['depthMask'] = null;\n    this.states['stencilMask'] = null;\n\n    //Initialize Rasterization states\n    this.states['cullFace'] = null;\n    this.states['frontFace'] = null;\n    this.states['lineWidth'] = null;\n\n    //Initialize Per-Fragment-Operation states\n    this.states['blendColor'] = {red: null, green: null, blue: null, alpha: null};\n    this.states['blendEquation'] = null;\n    this.states['blendEquationSeparate'] = {modeRGB: null, modeAlpha: null};\n    this.states['blendFunc'] = {sfactor: null, dfactor: null};\n    this.states['blendFuncSeparate'] = {srcRGB: null, dstRGB: null, srcAlpha: null, dstAlpha: null};\n    this.states['depthFunc'] = null;\n\n    //Initialize View and Clip states\n    this.states['viewport'] = {x: null, y: null, width: null, height: null};\n    this.states['depthRange'] = {zNear: null, zFar: null};\n\n    //TODO more states (e.g. stencil, texture, ...)\n};\n\n/*\n * Only bind program if different (returns true if changed)\n */\nx3dom.StateManager.prototype.useProgram = function (shader)\n{\n    if (this.states['shaderID'] != shader.shaderID)\n    {\n        this.gl.useProgram(shader.program);\n        this.states['shaderID'] = shader.shaderID;\n        return true;\n    }\n    return false;\n};\n\n/*\n * Unset active program for clean init state\n */\nx3dom.StateManager.prototype.unsetProgram = function ()\n{\n    this.states['shaderID'] = null;\n};\n\n/*\n * Enable GL capabilities\n */\nx3dom.StateManager.prototype.enable = function (cap)\n{\n    if (this.states[cap] !== true)\n    {\n        this.gl.enable(cap);\n        this.states[cap] = true;\n    }\n};\n\n/*\n * Disable GL capabilities\n */\nx3dom.StateManager.prototype.disable = function (cap)\n{\n    if (this.states[cap] !== false)\n    {\n        this.gl.disable(cap);\n        this.states[cap] = false;\n    }\n};\n\n/*\n * Enable and disable writing of frame buffer color components\n */\nx3dom.StateManager.prototype.colorMask = function (red, green, blue, alpha)\n{\n    if (this.states['colorMask'].red != red ||\n        this.states['colorMask'].green != green ||\n        this.states['colorMask'].blue != blue ||\n        this.states['colorMask'].alpha != alpha)\n    {\n        this.gl.colorMask(red, green, blue, alpha);\n        this.states['colorMask'].red = red;\n        this.states['colorMask'].green = green;\n        this.states['colorMask'].blue = blue;\n        this.states['colorMask'].alpha = alpha;\n    }\n};\n\n/*\n * Sets whether or not you can write to the depth buffer.\n */\nx3dom.StateManager.prototype.depthMask = function (flag)\n{\n    if (this.states['depthMask'] != flag)\n    {\n        this.gl.depthMask(flag);\n        this.states['depthMask'] = flag;\n    }\n};\n\n/*\n * Control the front and back writing of individual bits in the stencil planes\n */\nx3dom.StateManager.prototype.stencilMask = function (mask)\n{\n    if (this.states['stencilMask'] != mask)\n    {\n        this.gl.stencilMask(mask);\n        this.states['stencilMask'] = mask;\n    }\n};\n\n/*\n * Specify whether front- or back-facing facets can be culled\n */\nx3dom.StateManager.prototype.cullFace = function (mode)\n{\n    if (this.states['cullFace'] != mode)\n    {\n        this.gl.cullFace(mode);\n        this.states['cullFace'] = mode;\n    }\n};\n\n/*\n * Define front- and back-facing polygons\n */\nx3dom.StateManager.prototype.frontFace = function (mode)\n{\n    if (this.states['frontFace'] != mode)\n    {\n        this.gl.frontFace(mode);\n        this.states['frontFace'] = mode;\n    }\n};\n\n/*\n * Specify the width of rasterized lines\n */\nx3dom.StateManager.prototype.lineWidth = function (width)\n{\n    width = (width <= 1) ? 1 : width;\n\n    if (this.states['lineWidth'] != width)\n    {\n        this.gl.lineWidth(width);\n        this.states['lineWidth'] = width;\n    }\n};\n\n/*\n * Set the blend color\n */\nx3dom.StateManager.prototype.blendColor = function (red, green, blue, alpha)\n{\n    if (this.states['blendColor'].red != red ||\n        this.states['blendColor'].green != green ||\n        this.states['blendColor'].blue != blue ||\n        this.states['blendColor'].alpha != alpha)\n    {\n        this.gl.blendColor(red, green, blue, alpha);\n        this.states['blendColor'].red = red;\n        this.states['blendColor'].green = green;\n        this.states['blendColor'].blue = blue;\n        this.states['blendColor'].alpha = alpha;\n    }\n};\n\n/*\n * Specify the equation used for both the RGB blend equation and the Alpha blend equation\n */\nx3dom.StateManager.prototype.blendEquation = function (mode)\n{\n    if (mode && this.states['blendEquation'] != mode)\n    {\n        this.gl.blendEquation(mode);\n        this.states['blendEquation'] = mode;\n    }\n};\n\n/*\n * set the RGB blend equation and the alpha blend equation separately\n */\nx3dom.StateManager.prototype.blendEquationSeparate = function (modeRGB, modeAlpha)\n{\n    if (this.states['blendEquationSeparate'].modeRGB != modeRGB ||\n        this.states['blendEquationSeparate'].modeAlpha != modeAlpha)\n    {\n        this.gl.blendEquationSeparate(modeRGB, modeAlpha);\n        this.states['blendEquationSeparate'].modeRGB = modeRGB;\n        this.states['blendEquationSeparate'].modeAlpha = modeAlpha;\n    }\n};\n\n/*\n * Specify pixel arithmetic\n */\nx3dom.StateManager.prototype.blendFunc = function (sfactor, dfactor)\n{\n    if (this.states['blendFunc'].sfactor != sfactor ||\n        this.states['blendFunc'].dfactor != dfactor)\n    {\n        this.gl.blendFunc(sfactor, dfactor);\n        this.states['blendFunc'].sfactor = sfactor;\n        this.states['blendFunc'].dfactor = dfactor;\n    }\n};\n\n/*\n * Specify pixel arithmetic for RGB and alpha components separately\n */\nx3dom.StateManager.prototype.blendFuncSeparate = function (srcRGB, dstRGB, srcAlpha, dstAlpha)\n{\n    if (this.states['blendFuncSeparate'].srcRGB != srcRGB ||\n        this.states['blendFuncSeparate'].dstRGB != dstRGB ||\n        this.states['blendFuncSeparate'].srcAlpha != srcAlpha ||\n        this.states['blendFuncSeparate'].dstAlpha != dstAlpha)\n    {\n        this.gl.blendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);\n        this.states['blendFuncSeparate'].srcRGB = srcRGB;\n        this.states['blendFuncSeparate'].dstRGB = dstRGB;\n        this.states['blendFuncSeparate'].srcAlpha = srcAlpha;\n        this.states['blendFuncSeparate'].dstAlpha = dstAlpha;\n    }\n};\n\n/*\n * Specify the value used for depth buffer comparisons\n */\nx3dom.StateManager.prototype.depthFunc = function (func)\n{\n    if (this.states['depthFunc'] != func)\n    {\n        this.gl.depthFunc(func);\n        this.states['depthFunc'] = func;\n    }\n};\n\n/*\n * Specify the value used for depth buffer comparisons\n */\nx3dom.StateManager.prototype.depthRange = function (zNear, zFar)\n{\n    if (zNear < 0 || zFar < 0 || zNear > zFar)\n    {\n        return;   // do noting and leave default values\n    }\n\n    zNear = (zNear > 1) ? 1 : zNear;\n    zFar  = (zFar  > 1) ? 1 : zFar;\n\n    if (this.states['depthRange'].zNear != zNear || this.states['depthRange'].zFar != zFar)\n    {\n        this.gl.depthRange(zNear, zFar);\n        this.states['depthRange'].zNear = zNear;\n        this.states['depthRange'].zFar = zFar;\n    }\n};\n\n/*\n * Set the viewport\n */\nx3dom.StateManager.prototype.viewport = function (x, y, width, height)\n{\n    if (this.states['viewport'].x != x ||\n        this.states['viewport'].y != y ||\n        this.states['viewport'].width != width ||\n        this.states['viewport'].height != height)\n    {\n        this.gl.viewport(x, y, width, height);\n        this.states['viewport'].x = x;\n        this.states['viewport'].y = y;\n        this.states['viewport'].width = width;\n        this.states['viewport'].height = height;\n    }\n};\n\n/*\n * Bind a framebuffer to a framebuffer target\n */\nx3dom.StateManager.prototype.bindFramebuffer = function (target, framebuffer)\n{\n    this.gl.bindFramebuffer(target, framebuffer);\n    this.initStates();\n};\n\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * Philip Taylor: http://philip.html5.org\n */\n\n\n/** used from within gfx_webgl.js */\nx3dom.BinaryContainerLoader = {\n    outOfMemory: false,     // try to prevent browser crashes\n\n    checkError: function(gl) {\n        var glErr = gl.getError();\n        if (glErr) {\n            if (glErr == gl.OUT_OF_MEMORY) {\n                this.outOfMemory = true;\n                x3dom.debug.logError(\"GL-Error \" + glErr + \" on loading binary container (out of memory).\");\n                console.error(\"WebGL: OUT_OF_MEMORY\");\n            }\n            else {\n                x3dom.debug.logError(\"GL-Error \" + glErr + \" on loading binary container.\");\n            }\n        }\n    }\n};\n\n\n/** setup/download binary geometry */\nx3dom.BinaryContainerLoader.setupBinGeo = function(shape, sp, gl, viewarea, currContext)\n{\n    if (this.outOfMemory) {\n        return;\n    }\n\n    var t00 = new Date().getTime();\n    var that = this;\n\n    var binGeo = shape._cf.geometry.node;\n\n    // 0 := no BG, 1 := indexed BG, -1 := non-indexed BG\n    shape._webgl.binaryGeometry = -1;\n\n    shape._webgl.internalDownloadCount = ((binGeo._vf.index.length > 0) ? 1 : 0) +\n        ((binGeo._hasStrideOffset && binGeo._vf.coord.length > 0) ? 1 : 0) +\n        ((!binGeo._hasStrideOffset && binGeo._vf.coord.length > 0) ? 1 : 0) +\n        ((!binGeo._hasStrideOffset && binGeo._vf.normal.length > 0) ? 1 : 0) +\n        ((!binGeo._hasStrideOffset && binGeo._vf.texCoord.length > 0) ? 1 : 0) +\n        ((!binGeo._hasStrideOffset && binGeo._vf.color.length > 0) ? 1 : 0);\n\n    var createTriangleSoup = (binGeo._vf.normalPerVertex == false) ||\n                              ((binGeo._vf.index.length > 0) && (binGeo._vf.indexType == \"Int32\" ||\n                                (binGeo._vf.indexType == \"Uint32\" && !x3dom.caps.INDEX_UINT)));\n\n    shape._webgl.makeSeparateTris = {\n        index: null,\n        coord: null,\n        normal: null,\n        texCoord: null,\n        color: null,\n\n        pushBuffer: function(name, buf) {\n            this[name] = buf;\n\n            if (--shape._webgl.internalDownloadCount == 0) {\n                if (this.coord)\n                    this.createMesh();\n                shape._nameSpace.doc.needRender = true;\n            }\n            if (--shape._nameSpace.doc.downloadCount == 0)\n                shape._nameSpace.doc.needRender = true;\n        },\n\n        createMesh: function() {\n            var geoNode = binGeo;\n\n            if (geoNode._hasStrideOffset) {\n                x3dom.debug.logError(geoNode._vf.indexType +\n                    \" index type and per-face normals not supported for interleaved arrays.\");\n                return;\n            }\n\n            for (var k=0; k<shape._webgl.primType.length; k++) {\n                if (shape._webgl.primType[k] == gl.TRIANGLE_STRIP) {\n                    x3dom.debug.logError(\"makeSeparateTris: triangle strips not yet supported for per-face normals.\");\n                    return;\n                }\n            }\n\n            var attribTypeStr = geoNode._vf.coordType;\n            shape._webgl.coordType = x3dom.Utils.getVertexAttribType(attribTypeStr, gl);\n\n            // remap vertex data\n            var bgCenter, bgSize, bgPrecisionMax;\n\n            if (shape._webgl.coordType != gl.FLOAT)\n            {\n                if (geoNode._mesh._numPosComponents == 4 &&\n                    x3dom.Utils.isUnsignedType(geoNode._vf.coordType))\n                    bgCenter = x3dom.fields.SFVec3f.copy(geoNode.getMin());\n                else\n                    bgCenter = x3dom.fields.SFVec3f.copy(geoNode._vf.position);\n\n                bgSize = x3dom.fields.SFVec3f.copy(geoNode._vf.size);\n                bgPrecisionMax = geoNode.getPrecisionMax('coordType');\n            }\n            else\n            {\n                bgCenter = new x3dom.fields.SFVec3f(0, 0, 0);\n                bgSize = new x3dom.fields.SFVec3f(1, 1, 1);\n                bgPrecisionMax = 1.0;\n            }\n\n            // check types\n            var dataLen = shape._coordStrideOffset[0] / x3dom.Utils.getDataTypeSize(geoNode._vf.coordType);\n            dataLen = (dataLen == 0) ? 3 : dataLen;\n\n            x3dom.debug.logWarning(\"makeSeparateTris.createMesh called with coord length \" + dataLen);\n\n            if (this.color && dataLen != shape._colorStrideOffset[0] / x3dom.Utils.getDataTypeSize(geoNode._vf.colorType))\n            {\n                this.color = null;\n                x3dom.debug.logWarning(\"Color format not supported.\");\n            }\n\n            var texDataLen = this.texCoord ? (shape._texCoordStrideOffset[0] /\n                                              x3dom.Utils.getDataTypeSize(geoNode._vf.texCoordType)) : 0;\n\n            // set data types\n            //geoNode._vf.coordType = \"Float32\";\n            geoNode._vf.normalType = \"Float32\";\n\n            //shape._webgl.coordType = gl.FLOAT;\n            shape._webgl.normalType = gl.FLOAT;\n\n            //geoNode._mesh._numPosComponents = 3;\n            geoNode._mesh._numNormComponents = 3;\n\n            //shape._coordStrideOffset = [0, 0];\n            shape._normalStrideOffset = [0, 0];\n\n            // create non-indexed mesh\n            var posBuf = [], normBuf = [], texcBuf = [], colBuf = [];\n            var i, j, l, n = this.index ? (this.index.length - 2) : (this.coord.length / 3 - 2);\n\n            for (i=0; i<n; i+=3)\n            {\n                j = dataLen * (this.index ? this.index[i] : i);\n                var p0 = new x3dom.fields.SFVec3f(bgSize.x * this.coord[j  ] / bgPrecisionMax,\n                                                  bgSize.y * this.coord[j+1] / bgPrecisionMax,\n                                                  bgSize.z * this.coord[j+2] / bgPrecisionMax);\n                // offset irrelevant for normal calculation\n                //p0 = bgCenter.add(p0);\n\n                posBuf.push(this.coord[j  ]);\n                posBuf.push(this.coord[j+1]);\n                posBuf.push(this.coord[j+2]);\n                if (dataLen > 3) posBuf.push(this.coord[j+3]);\n\n                if (this.color) {\n                    colBuf.push(this.color[j  ]);\n                    colBuf.push(this.color[j+1]);\n                    colBuf.push(this.color[j+2]);\n                    if (dataLen > 3) colBuf.push(this.color[j+3]);\n                }\n\n                if (this.texCoord) {\n                    l = texDataLen * (this.index ? this.index[i] : i);\n\n                    texcBuf.push(this.texCoord[l  ]);\n                    texcBuf.push(this.texCoord[l+1]);\n                    if (texDataLen > 3) {\n                        texcBuf.push(this.texCoord[l+2]);\n                        texcBuf.push(this.texCoord[l+3]);\n                    }\n                }\n\n                j = dataLen * (this.index ? this.index[i+1] : i+1);\n                var p1 = new x3dom.fields.SFVec3f(bgSize.x * this.coord[j  ] / bgPrecisionMax,\n                                                  bgSize.y * this.coord[j+1] / bgPrecisionMax,\n                                                  bgSize.z * this.coord[j+2] / bgPrecisionMax);\n                //p1 = bgCenter.add(p1);\n\n                posBuf.push(this.coord[j  ]);\n                posBuf.push(this.coord[j+1]);\n                posBuf.push(this.coord[j+2]);\n                if (dataLen > 3) posBuf.push(this.coord[j+3]);\n\n                if (this.color) {\n                    colBuf.push(this.color[j  ]);\n                    colBuf.push(this.color[j+1]);\n                    colBuf.push(this.color[j+2]);\n                    if (dataLen > 3) colBuf.push(this.color[j+3]);\n                }\n\n                if (this.texCoord) {\n                    l = texDataLen * (this.index ? this.index[i+1] : i+1);\n\n                    texcBuf.push(this.texCoord[l  ]);\n                    texcBuf.push(this.texCoord[l+1]);\n                    if (texDataLen > 3) {\n                        texcBuf.push(this.texCoord[l+2]);\n                        texcBuf.push(this.texCoord[l+3]);\n                    }\n                }\n\n                j = dataLen * (this.index ? this.index[i+2] : i+2);\n                var p2 = new x3dom.fields.SFVec3f(bgSize.x * this.coord[j  ] / bgPrecisionMax,\n                                                  bgSize.y * this.coord[j+1] / bgPrecisionMax,\n                                                  bgSize.z * this.coord[j+2] / bgPrecisionMax);\n                //p2 = bgCenter.add(p2);\n\n                posBuf.push(this.coord[j  ]);\n                posBuf.push(this.coord[j+1]);\n                posBuf.push(this.coord[j+2]);\n                if (dataLen > 3) posBuf.push(this.coord[j+3]);\n\n                if (this.color) {\n                    colBuf.push(this.color[j  ]);\n                    colBuf.push(this.color[j+1]);\n                    colBuf.push(this.color[j+2]);\n                    if (dataLen > 3) colBuf.push(this.color[j+3]);\n                }\n\n                if (this.texCoord) {\n                    l = texDataLen * (this.index ? this.index[i+2] : i+2);\n\n                    texcBuf.push(this.texCoord[l  ]);\n                    texcBuf.push(this.texCoord[l+1]);\n                    if (texDataLen > 3) {\n                        texcBuf.push(this.texCoord[l+2]);\n                        texcBuf.push(this.texCoord[l+3]);\n                    }\n                }\n\n                var a = p0.subtract(p1);\n                var b = p1.subtract(p2);\n                var norm = a.cross(b).normalize();\n\n                for (j=0; j<3; j++) {\n                    normBuf.push(norm.x);\n                    normBuf.push(norm.y);\n                    normBuf.push(norm.z);\n                }\n            }\n\n            // coordinates\n            var buffer = gl.createBuffer();\n            shape._webgl.buffers[x3dom.BUFFER_IDX.POSITION] = buffer;\n\n            gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n            gl.bufferData(gl.ARRAY_BUFFER,\n                x3dom.Utils.getArrayBufferView(geoNode._vf.coordType, posBuf), gl.STATIC_DRAW);\n\n            gl.vertexAttribPointer(sp.position, geoNode._mesh._numPosComponents,\n                shape._webgl.coordType, false,\n                shape._coordStrideOffset[0], shape._coordStrideOffset[1]);\n            gl.enableVertexAttribArray(sp.position);\n\n            // normals\n            buffer = gl.createBuffer();\n            shape._webgl.buffers[x3dom.BUFFER_IDX.NORMAL] = buffer;\n\n            gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n            gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(normBuf), gl.STATIC_DRAW);\n\n            gl.vertexAttribPointer(sp.normal, geoNode._mesh._numNormComponents,\n                shape._webgl.normalType, false,\n                shape._normalStrideOffset[0], shape._normalStrideOffset[1]);\n            gl.enableVertexAttribArray(sp.normal);\n\n            // tex coords\n            if (this.texCoord)\n            {\n                buffer = gl.createBuffer();\n                shape._webgl.buffers[x3dom.BUFFER_IDX.TEXCOORD] = buffer;\n\n                gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n                gl.bufferData(gl.ARRAY_BUFFER,\n                    x3dom.Utils.getArrayBufferView(geoNode._vf.texCoordType, texcBuf),\n                    gl.STATIC_DRAW);\n\n                gl.vertexAttribPointer(sp.texcoord, geoNode._mesh._numTexComponents,\n                    shape._webgl.texCoordType, false,\n                    shape._texCoordStrideOffset[0], shape._texCoordStrideOffset[1]);\n                gl.enableVertexAttribArray(sp.texcoord);\n            }\n\n            // colors\n            if (this.color)\n            {\n                buffer = gl.createBuffer();\n                shape._webgl.buffers[x3dom.BUFFER_IDX.COLOR] = buffer;\n\n                gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n                gl.bufferData(gl.ARRAY_BUFFER,\n                    x3dom.Utils.getArrayBufferView(geoNode._vf.colorType, colBuf),\n                    gl.STATIC_DRAW);\n\n                gl.vertexAttribPointer(sp.color, geoNode._mesh._numColComponents,\n                    shape._webgl.colorType, false,\n                    shape._colorStrideOffset[0], shape._colorStrideOffset[1]);\n                gl.enableVertexAttribArray(sp.color);\n            }\n\n            // adjust sizes\n            geoNode._vf.vertexCount = [];\n            geoNode._vf.vertexCount[0] = posBuf.length / dataLen;\n\n            geoNode._mesh._numCoords = geoNode._vf.vertexCount[0];\n            geoNode._mesh._numFaces = geoNode._vf.vertexCount[0] / 3;\n\n            shape._webgl.primType = [];\n            shape._webgl.primType[0] = gl.TRIANGLES;\n\n            // cleanup\n            posBuf = null;\n            normBuf = null;\n            texcBuf = null;\n            colBuf = null;\n\n            this.index = null;\n            this.coord = null;\n            this.normal = null;\n            this.texCoord = null;\n            this.color = null;\n\n            that.checkError(gl);\n\n            // recreate shader\n            delete shape._webgl.shader;\n            shape._webgl.shader = currContext.cache.getDynamicShader(gl, viewarea, shape);\n        }\n    };\n\n    // index\n    if (binGeo._vf.index.length > 0)\n    {\n        shape._webgl.binaryGeometry = 1;    // indexed BG\n\n        var xmlhttp0 = new XMLHttpRequest();\n        xmlhttp0.open(\"GET\", shape._nameSpace.getURL(binGeo._vf.index), true);\n        xmlhttp0.responseType = \"arraybuffer\";\n\n        shape._nameSpace.doc.incrementDownloads();\n\n        //xmlhttp0.send(null);\n        x3dom.RequestManager.addRequest( xmlhttp0 );\n\n        xmlhttp0.onload = function()\n        {\n            shape._nameSpace.doc.decrementDownloads();\n            shape._webgl.internalDownloadCount -= 1;\n\n            if (xmlhttp0.status != 200) {\n                x3dom.debug.logError( \"XHR1/ index load failed with status: \" + xmlhttp0.status );\n                return;\n            }\n\n            if (!shape._webgl)\n                return;\n\n            var XHR_buffer = binGeo._vf.compressed == true ? x3dom.Utils.gunzip(xmlhttp0.response) : xmlhttp0.response;\n\n            var geoNode = binGeo;\n            var attribTypeStr = geoNode._vf.indexType;  //\"Uint16\"\n\n            var indexArray = x3dom.Utils.getArrayBufferView(attribTypeStr, XHR_buffer);\n\n            if (createTriangleSoup) {\n                shape._webgl.makeSeparateTris.pushBuffer(\"index\", indexArray);\n                return;\n            }\n\n            var indicesBuffer = gl.createBuffer();\n\n\n            if (x3dom.caps.INDEX_UINT && attribTypeStr == \"Uint32\") {\n                //indexArray is Uint32Array\n                shape._webgl.indexType = gl.UNSIGNED_INT;\n            }\n            else {\n                //indexArray is Uint16Array\n                shape._webgl.indexType = gl.UNSIGNED_SHORT;\n            }\n\n            gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indicesBuffer);\n            gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indexArray, gl.STATIC_DRAW);\n            gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);\n\n            // Test reading Data\n            //x3dom.debug.logWarning(\"arraybuffer[0]=\"+indexArray[0]+\"; n=\"+indexArray.length);\n\n            if (geoNode._vf.vertexCount[0] == 0)\n                geoNode._vf.vertexCount[0] = indexArray.length;\n\n            geoNode._mesh._numFaces = 0;\n\n            for (var i=0; i<geoNode._vf.vertexCount.length; i++) {\n                if (shape._webgl.primType[i] == gl.TRIANGLE_STRIP)\n                    geoNode._mesh._numFaces += geoNode._vf.vertexCount[i] - 2;\n                else\n                    geoNode._mesh._numFaces += geoNode._vf.vertexCount[i] / 3;\n            }\n\n            indexArray = null;\n\n            if (shape._webgl.internalDownloadCount == 0)\n            {\n                shape._nameSpace.doc.needRender = true;\n            }\n\n            that.checkError(gl);\n\n            var t11 = new Date().getTime() - t00;\n            x3dom.debug.logInfo(\"XHR0/ index load time: \" + t11 + \" ms\");\n\n            shape._webgl.buffers[x3dom.BUFFER_IDX.INDEX] = indicesBuffer;\n        };\n    }\n\n    // interleaved array -- assume all attributes are given in one single array buffer\n    if (binGeo._hasStrideOffset && binGeo._vf.coord.length > 0)\n    {\n        var xmlhttp = new XMLHttpRequest();\n        xmlhttp.open(\"GET\", shape._nameSpace.getURL(binGeo._vf.coord), true);\n        xmlhttp.responseType = \"arraybuffer\";\n\n        shape._nameSpace.doc.incrementDownloads();\n\n        //xmlhttp.send(null);\n        x3dom.RequestManager.addRequest( xmlhttp );\n\n        xmlhttp.onload = function()\n        {\n            shape._nameSpace.doc.decrementDownloads();\n            shape._webgl.internalDownloadCount -= 1;\n\n            if (xmlhttp.status != 200) {\n                x3dom.debug.logError( \"XHR1/ interleaved array load failed with status: \" + xmlhttp.status );\n                return;\n            }\n\n            if (!shape._webgl)\n                return;\n\n            var XHR_buffer = binGeo._vf.compressed == true ? x3dom.Utils.gunzip(xmlhttp.response) : xmlhttp.response;\n\n            var geoNode = binGeo;\n            var attribTypeStr = geoNode._vf.coordType;\n\n            // assume same data type for all attributes (but might be wrong)\n            shape._webgl.coordType    = x3dom.Utils.getVertexAttribType(attribTypeStr, gl);\n            shape._webgl.normalType   = shape._webgl.coordType;\n            shape._webgl.texCoordType = shape._webgl.coordType;\n            shape._webgl.colorType    = shape._webgl.coordType;\n\n            var attributes = x3dom.Utils.getArrayBufferView(attribTypeStr, XHR_buffer);\n\n            // calculate number of single data packages by including stride and type size\n            var dataLen = shape._coordStrideOffset[0] / x3dom.Utils.getDataTypeSize(attribTypeStr);\n            if (dataLen)\n                geoNode._mesh._numCoords = attributes.length / dataLen;\n\n            if (geoNode._vf.index.length == 0) {\n                for (var i=0; i<geoNode._vf.vertexCount.length; i++) {\n                    if (shape._webgl.primType[i] == gl.TRIANGLE_STRIP)\n                        geoNode._mesh._numFaces += geoNode._vf.vertexCount[i] - 2;\n                    else\n                        geoNode._mesh._numFaces += geoNode._vf.vertexCount[i] / 3;\n                }\n            }\n\n            var buffer = gl.createBuffer();\n\n            gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n            gl.bufferData(gl.ARRAY_BUFFER, attributes, gl.STATIC_DRAW);\n\n            gl.vertexAttribPointer(sp.position, geoNode._mesh._numPosComponents,\n                shape._webgl.coordType, false,\n                shape._coordStrideOffset[0], shape._coordStrideOffset[1]);\n            gl.enableVertexAttribArray(sp.position);\n\n            if (geoNode._vf.normal.length > 0)\n            {\n                shape._webgl.buffers[x3dom.BUFFER_IDX.NORMAL] = buffer;\n\n                gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n                gl.bufferData(gl.ARRAY_BUFFER, attributes, gl.STATIC_DRAW);\n\n                gl.vertexAttribPointer(sp.normal, geoNode._mesh._numNormComponents,\n                    shape._webgl.normalType, false,\n                    shape._normalStrideOffset[0], shape._normalStrideOffset[1]);\n                gl.enableVertexAttribArray(sp.normal);\n            }\n\n            if (geoNode._vf.texCoord.length > 0)\n            {\n                shape._webgl.buffers[x3dom.BUFFER_IDX.TEXCOORD] = buffer;\n\n                gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n                gl.bufferData(gl.ARRAY_BUFFER, attributes, gl.STATIC_DRAW);\n\n                gl.vertexAttribPointer(sp.texcoord, geoNode._mesh._numTexComponents,\n                    shape._webgl.texCoordType, false,\n                    shape._texCoordStrideOffset[0], shape._texCoordStrideOffset[1]);\n                gl.enableVertexAttribArray(sp.texcoord);\n            }\n\n            if (geoNode._vf.color.length > 0)\n            {\n                shape._webgl.buffers[x3dom.BUFFER_IDX.COLOR] = buffer;\n\n                gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n                gl.bufferData(gl.ARRAY_BUFFER, attributes, gl.STATIC_DRAW);\n\n                gl.vertexAttribPointer(sp.color, geoNode._mesh._numColComponents,\n                    shape._webgl.colorType, false,\n                    shape._colorStrideOffset[0], shape._colorStrideOffset[1]);\n                gl.enableVertexAttribArray(sp.color);\n            }\n\n            attributes = null;  // delete data block in CPU memory\n\n            if (shape._webgl.internalDownloadCount == 0)\n            {\n                shape._nameSpace.doc.needRender = true;\n            }\n\n            that.checkError(gl);\n\n            var t11 = new Date().getTime() - t00;\n            x3dom.debug.logInfo(\"XHR/ interleaved array load time: \" + t11 + \" ms\");\n\n            shape._webgl.buffers[x3dom.BUFFER_IDX.POSITION] = buffer;\n\n        };\n    }\n\n    // coord\n    if (!binGeo._hasStrideOffset && binGeo._vf.coord.length > 0)\n    {\n        var xmlhttp1 = new XMLHttpRequest();\n        xmlhttp1.open(\"GET\", shape._nameSpace.getURL(binGeo._vf.coord), true);\n        xmlhttp1.responseType = \"arraybuffer\";\n\n        shape._nameSpace.doc.incrementDownloads();\n\n        //xmlhttp1.send(null);\n        x3dom.RequestManager.addRequest( xmlhttp1 );\n\n        xmlhttp1.onload = function()\n        {\n            shape._nameSpace.doc.decrementDownloads();\n            shape._webgl.internalDownloadCount -= 1;\n\n            if (xmlhttp1.status != 200) {\n                x3dom.debug.logError( \"XHR1/ coord load failed with status: \" + xmlhttp1.status );\n                return;\n            }\n\n            if (!shape._webgl)\n                return;\n\n            var XHR_buffer = binGeo._vf.compressed == true ? x3dom.Utils.gunzip(xmlhttp1.response) : xmlhttp1.response;\n\n            var geoNode = binGeo;\n            var i = 0;\n\n            var attribTypeStr = geoNode._vf.coordType;\n            shape._webgl.coordType = x3dom.Utils.getVertexAttribType(attribTypeStr, gl);\n\n            var vertices = x3dom.Utils.getArrayBufferView(attribTypeStr, XHR_buffer);\n\n            if (createTriangleSoup) {\n                shape._webgl.makeSeparateTris.pushBuffer(\"coord\", vertices);\n                return;\n            }\n\n            gl.bindAttribLocation(sp.program, 0, \"position\");\n\n            var positionBuffer = gl.createBuffer();\n            gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);\n            gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);\n            gl.bindBuffer(gl.ARRAY_BUFFER, null);\n\n            geoNode._mesh._numCoords = vertices.length / geoNode._mesh._numPosComponents;\n\n            if (geoNode._vf.index.length == 0) {\n                for (i=0; i<geoNode._vf.vertexCount.length; i++) {\n                    if (shape._webgl.primType[i] == gl.TRIANGLE_STRIP)\n                        geoNode._mesh._numFaces += geoNode._vf.vertexCount[i] - 2;\n                    else\n                        geoNode._mesh._numFaces += geoNode._vf.vertexCount[i] / 3;\n                }\n            }\n\n            // Test reading Data\n            //x3dom.debug.logWarning(\"arraybuffer[0].vx=\"+vertices[0]);\n\n            if ((attribTypeStr == \"Float32\") &&\n                (shape._vf.bboxSize.x < 0 || shape._vf.bboxSize.y < 0 || shape._vf.bboxSize.z < 0))\n            {\n                var min = new x3dom.fields.SFVec3f(vertices[0],vertices[1],vertices[2]);\n                var max = new x3dom.fields.SFVec3f(vertices[0],vertices[1],vertices[2]);\n\n                for (i=3; i<vertices.length; i+=3)\n                {\n                    if (min.x > vertices[i+0]) { min.x = vertices[i+0]; }\n                    if (min.y > vertices[i+1]) { min.y = vertices[i+1]; }\n                    if (min.z > vertices[i+2]) { min.z = vertices[i+2]; }\n\n                    if (max.x < vertices[i+0]) { max.x = vertices[i+0]; }\n                    if (max.y < vertices[i+1]) { max.y = vertices[i+1]; }\n                    if (max.z < vertices[i+2]) { max.z = vertices[i+2]; }\n                }\n\n                // TODO; move to mesh for all cases?\n                shape._vf.bboxCenter.setValues(min.add(max).multiply(0.5));\n                shape._vf.bboxSize.setValues(max.subtract(min));\n            }\n\n            vertices = null;\n\n            if (shape._webgl.internalDownloadCount == 0)\n            {\n                shape._nameSpace.doc.needRender = true;\n            }\n\n            that.checkError(gl);\n\n            var t11 = new Date().getTime() - t00;\n            x3dom.debug.logInfo(\"XHR1/ coord load time: \" + t11 + \" ms\");\n\n            shape._webgl.buffers[x3dom.BUFFER_IDX.POSITION] = positionBuffer;\n        };\n    }\n\n    // normal\n    if (!binGeo._hasStrideOffset && binGeo._vf.normal.length > 0)\n    {\n        var xmlhttp2 = new XMLHttpRequest();\n        xmlhttp2.open(\"GET\", shape._nameSpace.getURL(binGeo._vf.normal), true);\n        xmlhttp2.responseType = \"arraybuffer\";\n\n        shape._nameSpace.doc.incrementDownloads();\n\n        //xmlhttp2.send(null);\n        x3dom.RequestManager.addRequest( xmlhttp2 );\n\n        xmlhttp2.onload = function()\n        {\n            shape._nameSpace.doc.decrementDownloads();\n            shape._webgl.internalDownloadCount -= 1;\n\n            if (xmlhttp2.status != 200) {\n                x3dom.debug.logError( \"XHR2/ normal load failed with status: \" + xmlhttp2.status );\n                return;\n            }\n\n            if (!shape._webgl)\n                return;\n\n            var XHR_buffer = binGeo._vf.compressed == true ? x3dom.Utils.gunzip(xmlhttp2.response) : xmlhttp2.response;\n\n            var attribTypeStr = binGeo._vf.normalType;\n            shape._webgl.normalType = x3dom.Utils.getVertexAttribType(attribTypeStr, gl);\n\n            var normals = x3dom.Utils.getArrayBufferView(attribTypeStr, XHR_buffer);\n\n            if (createTriangleSoup) {\n                shape._webgl.makeSeparateTris.pushBuffer(\"normal\", normals);\n                return;\n            }\n\n            var normalBuffer = gl.createBuffer();\n\n            gl.bindBuffer(gl.ARRAY_BUFFER, normalBuffer);\n            gl.bufferData(gl.ARRAY_BUFFER, normals, gl.STATIC_DRAW);\n            gl.bindBuffer(gl.ARRAY_BUFFER, null);\n\n            // Test reading Data\n            //x3dom.debug.logWarning(\"arraybuffer[0].nx=\"+normals[0]);\n\n            normals = null;\n\n            if (shape._webgl.internalDownloadCount == 0)\n            {\n                shape._nameSpace.doc.needRender = true;\n            }\n\n            that.checkError(gl);\n\n            var t11 = new Date().getTime() - t00;\n            x3dom.debug.logInfo(\"XHR2/ normal load time: \" + t11 + \" ms\");\n\n            shape._webgl.buffers[x3dom.BUFFER_IDX.NORMAL] = normalBuffer;\n        };\n    }\n\n    // texCoord\n    if (!binGeo._hasStrideOffset && binGeo._vf.texCoord.length > 0)\n    {\n        var xmlhttp3 = new XMLHttpRequest();\n        xmlhttp3.open(\"GET\", shape._nameSpace.getURL(binGeo._vf.texCoord), true);\n        xmlhttp3.responseType = \"arraybuffer\";\n\n        shape._nameSpace.doc.incrementDownloads();\n\n        //xmlhttp3.send(null);\n        x3dom.RequestManager.addRequest( xmlhttp3 );\n\n        xmlhttp3.onload = function()\n        {\n            var i, j;\n            var tmp;\n\n            shape._nameSpace.doc.decrementDownloads();\n            shape._webgl.internalDownloadCount -= 1;\n\n            if (xmlhttp3.status != 200) {\n                x3dom.debug.logError( \"XHR3/ texcoord load failed with status: \" + xmlhttp3.status );\n                return;\n            }\n\n            if (!shape._webgl)\n                return;\n\n            var XHR_buffer = binGeo._vf.compressed == true ? x3dom.Utils.gunzip(xmlhttp3.response) : xmlhttp3.response;\n\n            var attribTypeStr = binGeo._vf.texCoordType;\n            shape._webgl.texCoordType = x3dom.Utils.getVertexAttribType(attribTypeStr, gl);\n\n            var texCoords = x3dom.Utils.getArrayBufferView(attribTypeStr, XHR_buffer);\n\n            if (createTriangleSoup) {\n                shape._webgl.makeSeparateTris.pushBuffer(\"texCoord\", texCoords);\n                return;\n            }\n\n\n            //if IDs are given in texture coordinates, interpret texcoords as ID buffer\n            if (binGeo._vf[\"idsPerVertex\"])\n            {\n                var idBuffer = gl.createBuffer();\n\n                gl.bindBuffer(gl.ARRAY_BUFFER, idBuffer);\n\n                //Create a buffer for the ids with half size of the texccoord buffer\n                var ids = x3dom.Utils.getArrayBufferView(\"Float32\", texCoords.length/2);\n\n                //swap x and y, in order to interpret tex coords as FLOAT later on\n                for (i = 0, j= 0; i < texCoords.length; i+=2, j++)\n                {\n                    ids[j] = texCoords[i+1] * 65536 + texCoords[i];\n                }\n\n                gl.bufferData(gl.ARRAY_BUFFER, ids, gl.STATIC_DRAW);\n                gl.bindBuffer(gl.ARRAY_BUFFER, null);\n\n                shape._webgl.buffers[x3dom.BUFFER_IDX.ID] = idBuffer;\n            }\n            else\n            {\n                var texcBuffer = gl.createBuffer();\n\n                gl.bindBuffer(gl.ARRAY_BUFFER, texcBuffer);\n                gl.bufferData(gl.ARRAY_BUFFER, texCoords, gl.STATIC_DRAW);\n                gl.bindBuffer(gl.ARRAY_BUFFER, null);\n\n                shape._webgl.buffers[x3dom.BUFFER_IDX.TEXCOORD] = texcBuffer;\n            }\n            // Test reading Data\n            //x3dom.debug.logWarning(\"arraybuffer[0].tx=\"+texCoords[0]);\n\n            texCoords = null;\n\n            if (shape._webgl.internalDownloadCount == 0)\n            {\n                shape._nameSpace.doc.needRender = true;\n            }\n\n            that.checkError(gl);\n\n            var t11 = new Date().getTime() - t00;\n            x3dom.debug.logInfo(\"XHR3/ texCoord load time: \" + t11 + \" ms\");\n        };\n    }\n\n    // color\n    if (!binGeo._hasStrideOffset && binGeo._vf.color.length > 0)\n    {\n        var xmlhttp4 = new XMLHttpRequest();\n        xmlhttp4.open(\"GET\", shape._nameSpace.getURL(binGeo._vf.color), true);\n        xmlhttp4.responseType = \"arraybuffer\";\n\n        shape._nameSpace.doc.incrementDownloads();\n\n        //xmlhttp4.send(null);\n        x3dom.RequestManager.addRequest( xmlhttp4 );\n\n        xmlhttp4.onload = function()\n        {\n            shape._nameSpace.doc.decrementDownloads();\n            shape._webgl.internalDownloadCount -= 1;\n\n            if (xmlhttp4.status != 200) {\n                x3dom.debug.logError( \"XHR4/ color load failed with status: \" + xmlhttp4.status );\n                return;\n            }\n\n            if (!shape._webgl)\n                return;\n\n            var XHR_buffer = binGeo._vf.compressed == true ? x3dom.Utils.gunzip(xmlhttp4.response) : xmlhttp4.response;\n\n            var attribTypeStr = binGeo._vf.colorType;\n            shape._webgl.colorType = x3dom.Utils.getVertexAttribType(attribTypeStr, gl);\n\n            var colors = x3dom.Utils.getArrayBufferView(attribTypeStr, XHR_buffer);\n\n            if (createTriangleSoup) {\n                shape._webgl.makeSeparateTris.pushBuffer(\"color\", colors);\n                return;\n            }\n\n            var colorBuffer = gl.createBuffer();\n\n            gl.bindBuffer(gl.ARRAY_BUFFER, colorBuffer);\n            gl.bufferData(gl.ARRAY_BUFFER, colors, gl.STATIC_DRAW);\n            gl.bindBuffer(gl.ARRAY_BUFFER, null);\n\n            // Test reading Data\n            //x3dom.debug.logWarning(\"arraybuffer[0].cx=\"+colors[0]);\n\n            colors = null;\n\n            if (shape._webgl.internalDownloadCount == 0)\n            {\n                shape._nameSpace.doc.needRender = true;\n            }\n\n            that.checkError(gl);\n\n            var t11 = new Date().getTime() - t00;\n            x3dom.debug.logInfo(\"XHR4/ color load time: \" + t11 + \" ms\");\n\n            shape._webgl.buffers[x3dom.BUFFER_IDX.COLOR] = colorBuffer;\n        };\n    }\n\n    // tangents\n    if (!binGeo._hasStrideOffset && binGeo._vf.tangent.length > 0)\n    {\n        var xmlhttp5 = new XMLHttpRequest();\n        xmlhttp5.open(\"GET\", shape._nameSpace.getURL(binGeo._vf.normal), true);\n        xmlhttp5.responseType = \"arraybuffer\";\n\n        shape._nameSpace.doc.incrementDownloads();\n\n        //xmlhttp2.send(null);\n        x3dom.RequestManager.addRequest( xmlhttp5 );\n\n        xmlhttp5.onload = function()\n        {\n            shape._nameSpace.doc.decrementDownloads();\n            shape._webgl.internalDownloadCount -= 1;\n\n            if (xmlhttp5.status != 200) {\n                x3dom.debug.logError( \"XHR2/ normal load failed with status: \" + xmlhttp5.status );\n                return;\n            }\n\n            if (!shape._webgl)\n                return;\n\n            var XHR_buffer = binGeo._vf.compressed == true ? x3dom.Utils.gunzip(xmlhttp5.response) : xmlhttp5.response;\n\n            var attribTypeStr = binGeo._vf.tangentType;\n            shape._webgl.tangentType = x3dom.Utils.getVertexAttribType(attribTypeStr, gl);\n\n            var tangents = x3dom.Utils.getArrayBufferView(attribTypeStr, XHR_buffer);\n\n            if (createTriangleSoup) {\n                shape._webgl.makeSeparateTris.pushBuffer(\"tangent\", tangents);\n                return;\n            }\n\n            var tangentBuffer = gl.createBuffer();\n\n            gl.bindBuffer(gl.ARRAY_BUFFER, tangentBuffer);\n            gl.bufferData(gl.ARRAY_BUFFER, tangents, gl.STATIC_DRAW);\n            gl.bindBuffer(gl.ARRAY_BUFFER, null);\n\n            // Test reading Data\n            //x3dom.debug.logWarning(\"arraybuffer[0].nx=\"+normals[0]);\n\n            tangents = null;\n\n            if (shape._webgl.internalDownloadCount == 0)\n            {\n                shape._nameSpace.doc.needRender = true;\n            }\n\n            that.checkError(gl);\n\n            var t11 = new Date().getTime() - t00;\n            x3dom.debug.logInfo(\"XHR5/ normal load time: \" + t11 + \" ms\");\n\n            shape._webgl.buffers[x3dom.BUFFER_IDX.TANGENT] = tangentBuffer;\n        };\n    }\n\n    // bitangents\n    if (!binGeo._hasStrideOffset && binGeo._vf.binormal.length > 0)\n    {\n        var xmlhttp6 = new XMLHttpRequest();\n        xmlhttp6.open(\"GET\", shape._nameSpace.getURL(binGeo._vf.normal), true);\n        xmlhttp6.responseType = \"arraybuffer\";\n\n        shape._nameSpace.doc.incrementDownloads();\n\n        //xmlhttp2.send(null);\n        x3dom.RequestManager.addRequest( xmlhttp6 );\n\n        xmlhttp6.onload = function()\n        {\n            shape._nameSpace.doc.decrementDownloads();\n            shape._webgl.internalDownloadCount -= 1;\n\n            if (xmlhttp6.status != 200) {\n                x3dom.debug.logError( \"XHR6/ normal load failed with status: \" + xmlhttp6.status );\n                return;\n            }\n\n            if (!shape._webgl)\n                return;\n\n            var XHR_buffer = binGeo._vf.compressed == true ? x3dom.Utils.gunzip(xmlhttp6.response) : xmlhttp6.response;\n\n            var attribTypeStr = binGeo._vf.binormalType;\n            shape._webgl.binormalType = x3dom.Utils.getVertexAttribType(attribTypeStr, gl);\n\n            var binormals = x3dom.Utils.getArrayBufferView(attribTypeStr, XHR_buffer);\n\n            if (createTriangleSoup) {\n                shape._webgl.makeSeparateTris.pushBuffer(\"binormal\", binormals);\n                return;\n            }\n\n            var binormalBuffer = gl.createBuffer();\n\n            gl.bindBuffer(gl.ARRAY_BUFFER, binormalBuffer);\n            gl.bufferData(gl.ARRAY_BUFFER, binormals, gl.STATIC_DRAW);\n            gl.bindBuffer(gl.ARRAY_BUFFER, null);\n\n            // Test reading Data\n            //x3dom.debug.logWarning(\"arraybuffer[0].nx=\"+normals[0]);\n\n            binormals = null;\n\n            if (shape._webgl.internalDownloadCount == 0)\n            {\n                shape._nameSpace.doc.needRender = true;\n            }\n\n            that.checkError(gl);\n\n            var t11 = new Date().getTime() - t00;\n            x3dom.debug.logInfo(\"XHR6/ normal load time: \" + t11 + \" ms\");\n\n            shape._webgl.buffers[x3dom.BUFFER_IDX.BITANGENT] = binormalBuffer;\n        };\n    }\n};\n\n/** setup/download pop geometry */\nx3dom.BinaryContainerLoader.setupPopGeo = function(shape, sp, gl, viewarea, currContext)\n{\n    if (this.outOfMemory) {\n        return;\n    }\n\n    var popGeo = shape._cf.geometry.node;\n\n    //reserve space for vertex buffer (and index buffer if any) on the gpu\n    if (popGeo.hasIndex()) {\n        shape._webgl.popGeometry = 1;\n\n        shape._webgl.buffers[x3dom.BUFFER_IDX.INDEX] = gl.createBuffer();\n\n        gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, shape._webgl.buffers[x3dom.BUFFER_IDX.INDEX]);\n        gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, popGeo.getTotalNumberOfIndices()*2, gl.STATIC_DRAW);\n\n        //this is a workaround to mimic gl_VertexID\n        shape._webgl.buffers[x3dom.BUFFER_IDX.ID] = gl.createBuffer();\n\n        var idBuffer = new Float32Array(popGeo._vf.vertexBufferSize);\n\n        (function(){ for (var i = 0; i < idBuffer.length; ++i) idBuffer[i] = i; })();\n\n        gl.bindBuffer(gl.ARRAY_BUFFER, shape._webgl.buffers[x3dom.BUFFER_IDX.ID]);\n        gl.bufferData(gl.ARRAY_BUFFER, idBuffer, gl.STATIC_DRAW);\n    }\n    else {\n        shape._webgl.popGeometry = -1;\n    }\n\n    shape._webgl.buffers[x3dom.BUFFER_IDX.POSITION] = gl.createBuffer();\n\n    gl.bindBuffer(gl.ARRAY_BUFFER, shape._webgl.buffers[x3dom.BUFFER_IDX.POSITION]);\n    gl.bufferData(gl.ARRAY_BUFFER, (popGeo._vf.attributeStride * popGeo._vf.vertexBufferSize), gl.STATIC_DRAW);\n\n\n    //setup general render settings\n    var attribTypeStr      = popGeo._vf.coordType;\n    shape._webgl.coordType = x3dom.Utils.getVertexAttribType(attribTypeStr, gl);\n\n    shape._coordStrideOffset[0] = popGeo.getAttributeStride();\n    shape._coordStrideOffset[1] = popGeo.getPositionOffset();\n\n    gl.vertexAttribPointer(sp.position, shape._cf.geometry.node._mesh._numPosComponents, shape._webgl.coordType,\n                           false, shape._coordStrideOffset[0], shape._coordStrideOffset[1]);\n    gl.enableVertexAttribArray(sp.position);\n\n    if (popGeo.hasNormal()) {\n        attribTypeStr           = popGeo._vf.normalType;\n        shape._webgl.normalType = x3dom.Utils.getVertexAttribType(attribTypeStr, gl);\n\n        shape._normalStrideOffset[0] = popGeo.getAttributeStride();\n        shape._normalStrideOffset[1] = popGeo.getNormalOffset();\n\n        shape._webgl.buffers[x3dom.BUFFER_IDX.NORMAL] = shape._webgl.buffers[x3dom.BUFFER_IDX.POSITION]; //use interleaved vertex data buffer\n\n        gl.vertexAttribPointer(sp.normal, shape._cf.geometry.node._mesh._numNormComponents, shape._webgl.normalType,\n                               false, shape._normalStrideOffset[0], shape._normalStrideOffset[1]);\n        gl.enableVertexAttribArray(sp.normal);\n    }\n    if (popGeo.hasTexCoord()) {\n        attribTypeStr             = popGeo._vf.texCoordType;\n        shape._webgl.texCoordType = x3dom.Utils.getVertexAttribType(attribTypeStr, gl);\n\n        shape._webgl.buffers[x3dom.BUFFER_IDX.TEXCOORD] = shape._webgl.buffers[x3dom.BUFFER_IDX.POSITION]; //use interleaved vertex data buffer\n\n        shape._texCoordStrideOffset[0] = popGeo.getAttributeStride();\n        shape._texCoordStrideOffset[1] = popGeo.getTexCoordOffset();\n\n        gl.vertexAttribPointer(sp.texcoord, shape._cf.geometry.node._mesh._numTexComponents, shape._webgl.texCoordType,\n                               false, shape._texCoordStrideOffset[0], shape._texCoordStrideOffset[1]);\n        gl.enableVertexAttribArray(sp.texcoord);\n    }\n    if (popGeo.hasColor()) {\n        attribTypeStr          = popGeo._vf.colorType;\n        shape._webgl.colorType = x3dom.Utils.getVertexAttribType(attribTypeStr, gl);\n\n        shape._webgl.buffers[x3dom.BUFFER_IDX.COLOR] = shape._webgl.buffers[x3dom.BUFFER_IDX.POSITION]; //use interleaved vertex data buffer\n\n        shape._colorStrideOffset[0] = popGeo.getAttributeStride();\n        shape._colorStrideOffset[1] = popGeo.getColorOffset();\n\n        gl.vertexAttribPointer(sp.color, shape._cf.geometry.node._mesh._numColComponents, shape._webgl.colorType,\n                               false, shape._colorStrideOffset[0], shape._colorStrideOffset[1]);\n        gl.enableVertexAttribArray(sp.color);\n    }\n\n    shape._webgl.currentNumIndices  = 0;\n    shape._webgl.currentNumVertices = 0;\n    shape._webgl.numVerticesAtLevel = [];\n    shape._webgl.levelsAvailable    = 0;\n\n    this.checkError(gl);\n\n    shape._webgl.levelLoaded = [];\n    (function() {\n        for (var i = 0; i < popGeo.getNumLevels(); ++i)\n            shape._webgl.levelLoaded.push(false);\n    })();\n\n    //download callback, used to simply upload received vertex data to the GPU\n    var uploadDataToGPU = function(data, lvl) {\n        //x3dom.debug.logInfo(\"PopGeometry: Received data for level \" + lvl + \" !\\n\");\n\n        shape._webgl.levelLoaded[lvl] = true;\n        shape._webgl.numVerticesAtLevel[lvl] = 0;\n\n        if (data) {\n            //perform gpu data upload\n            var indexDataLengthInBytes = 0;\n            var redrawNeeded = false;\n\n            if (popGeo.hasIndex()) {\n                indexDataLengthInBytes = popGeo.getNumIndicesByLevel(lvl)*2;\n\n                if (indexDataLengthInBytes > 0) {\n                    redrawNeeded = true;\n\n                    var indexDataView = new Uint8Array(data, 0, indexDataLengthInBytes);\n\n                    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, shape._webgl.buffers[x3dom.BUFFER_IDX.INDEX]);\n                    //index data is always placed where it belongs, as we have to keep the order of rendering\n                    (function() {\n                        var indexDataOffset = 0;\n\n                        for (var i = 0; i < lvl; ++i) { indexDataOffset += popGeo.getNumIndicesByLevel(i); }\n\n                        gl.bufferSubData(gl.ELEMENT_ARRAY_BUFFER, indexDataOffset*2, indexDataView);\n                    })();\n                }\n            }\n\n            var vertexDataLengthInBytes = data.byteLength - indexDataLengthInBytes;\n\n            if (vertexDataLengthInBytes > 0) {\n                redrawNeeded = true;\n\n                var attributeDataView = new Uint8Array(data, indexDataLengthInBytes, vertexDataLengthInBytes);\n\n                gl.bindBuffer(gl.ARRAY_BUFFER, shape._webgl.buffers[x3dom.BUFFER_IDX.POSITION]);\n                if (!popGeo.hasIndex()) {\n                    //on non-indexed rendering, vertex data is just appended, the order of vertex data packages doesn't matter\n                    gl.bufferSubData(gl.ARRAY_BUFFER, shape._webgl.currentNumVertices       * popGeo.getAttributeStride(),\n                                     attributeDataView);\n                }\n                else {\n                    //on indexed rendering, vertex data is always placed where it belongs, as we have to keep the indexed order\n                    gl.bufferSubData(gl.ARRAY_BUFFER,popGeo.getVertexDataBufferOffset(lvl) * popGeo.getAttributeStride(),\n                                     attributeDataView);\n                }\n\n                //adjust render settings: vertex data\n                shape._webgl.numVerticesAtLevel[lvl] = vertexDataLengthInBytes / popGeo.getAttributeStride();\n                shape._webgl.currentNumVertices += shape._webgl.numVerticesAtLevel[lvl];\n            }\n\n            //compute number of valid indices\n            (function() {\n                var numValidIndices = 0;\n\n                for (var i = shape._webgl.levelsAvailable; i < popGeo.getNumLevels(); ++i) {\n                    if (shape._webgl.levelLoaded[i] === false) {\n                        break;\n                    }\n                    else {\n                        numValidIndices += popGeo.getNumIndicesByLevel(i);\n                        ++shape._webgl.levelsAvailable;\n                    }\n                }\n\n                //adjust render settings: index data\n                shape._webgl.currentNumIndices = numValidIndices;\n            })();\n\n            //here, we tell X3DOM how many faces / vertices get displayed in the stats\n            popGeo._mesh._numCoords = shape._webgl.currentNumVertices;\n            //@todo: this assumes pure TRIANGLES data\n            popGeo._mesh._numFaces  = (popGeo.hasIndex() ? shape._webgl.currentNumIndices : shape._webgl.currentNumVertices) / 3;\n\n            //here, we tell X3DOM how many vertices get rendered\n            //@todo: this assumes pure TRIANGLES data\n            popGeo.adaptVertexCount(popGeo.hasIndex() ? popGeo._mesh._numFaces * 3 : popGeo._mesh._numCoords);\n            //x3dom.debug.logInfo(\"PopGeometry: Loaded level \" + lvl + \" data to gpu, model has now \" +\n            //    popGeo._mesh._numCoords + \" vertices and \" + popGeo._mesh._numFaces + \" triangles, \" +\n            //    (new Date().getTime() - shape._webgl.downloadStartTimer) + \" ms after posting download requests\");\n\n            //request redraw, if necessary\n            if (redrawNeeded) {\n                shape._nameSpace.doc.needRender = true;\n            }\n        }\n    };\n\n    //post XHRs\n    var dataURLs = popGeo.getDataURLs();\n\n    var downloadCallbacks = [];\n    var priorities        = [];\n\n    shape._webgl.downloadStartTimer = new Date().getTime();\n\n    //CODE WITH DL MANAGER\n    //use the DownloadManager to prioritize loading\n\n    for (var i = 0; i < dataURLs.length; ++i) {\n        shape._nameSpace.doc.incrementDownloads();\n\n        (function(idx) {\n            downloadCallbacks.push(function(data) {\n                shape._nameSpace.doc.decrementDownloads();\n                return uploadDataToGPU(data, idx);\n            });\n        })(i);\n\n        priorities.push(i);\n    }\n\n    x3dom.DownloadManager.get(dataURLs, downloadCallbacks, priorities);\n    //END CODE WITH DL MANAGER\n};\n\n/** setup/download image geometry */\nx3dom.BinaryContainerLoader.setupImgGeo = function(shape, sp, gl, viewarea, currContext)\n{\n    if (this.outOfMemory) {\n        return;\n    }\n\n    var imageGeometry = shape._cf.geometry.node;\n\n    if ( imageGeometry.getIndexTexture() ) {\n        shape._webgl.imageGeometry = 1;\n    } else {\n        shape._webgl.imageGeometry = -1;\n    }\n\n    imageGeometry.unsetGeoDirty();\n\n    if (currContext.IG_PositionBuffer == null) {\n        currContext.IG_PositionBuffer = gl.createBuffer();\n    }\n\n    shape._webgl.buffers[x3dom.BUFFER_IDX.POSITION] = currContext.IG_PositionBuffer;\n    gl.bindBuffer(gl.ARRAY_BUFFER, currContext.IG_PositionBuffer);\n\n    var vertices = new Float32Array(shape._webgl.positions[0]);\n\n    gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);\n    gl.bindBuffer(gl.ARRAY_BUFFER, currContext.IG_PositionBuffer);\n\n    gl.vertexAttribPointer(sp.position, imageGeometry._mesh._numPosComponents,\n        shape._webgl.coordType, false,\n        shape._coordStrideOffset[0], shape._coordStrideOffset[1]);\n    gl.enableVertexAttribArray(sp.position);\n\n    vertices = null;\n\n    this.checkError(gl);\n};\n\nx3dom.BinaryContainerLoader.bufferGeoCache = {};\n\n/** setup/download buffer geometry */\nx3dom.BinaryContainerLoader.setupBufferGeo = function(shape, sp, gl, viewarea, currContext)\n{\n    var URL;\n    var isDataURL = false;\n    var bufferGeo = shape._cf.geometry.node;\n    var idxAccessor = null;\n    var posAccessor = null;\n    var needNormalComputation = true;\n\n    // 0 := no BG, 1 := indexed BG, -1 := non-indexed BG\n    shape._webgl.bufferGeometry = (bufferGeo._indexed) ? 1 : -1;\n\n    bufferGeo._mesh._numCoords = bufferGeo._vf.vertexCount[0];\n    bufferGeo._mesh._numFaces = bufferGeo._vf.vertexCount[0] / 3;\n    \n    var initAccessors = function()\n    {\n        var accessors = bufferGeo._cf.accessors.nodes;\n\n        for(var i = 0; i < accessors.length; i++)\n        {\n            var accessor = accessors[i];\n\n            var byteOffset = accessor._vf.byteOffset;\n            var byteStride = accessor._vf.byteStride;\n            var bufferType = accessor._vf.bufferType;\n            var components = accessor._vf.components;\n            var componentType = accessor._vf.componentType;\n            var normalized = accessor._vf.normalized;\n            var view = accessor._vf.view;\n\n            switch(bufferType)\n            {\n                case \"INDEX\":\n                    idxAccessor = accessor;\n                    shape._webgl.indexType = componentType;\n                    shape._indexOffset = byteOffset;\n                    break;\n                case \"POSITION\":\n                    posAccessor = accessor;\n                    shape._coordStrideOffset = [byteStride, byteOffset];\n                    shape._webgl.coordType = componentType;\n                    shape._webgl.coordNormalized = normalized;\n                    bufferGeo._mesh._numPosComponents = components;\n                    break;\n                case \"NORMAL\":\n                    needNormalComputation = false;\n                    shape._normalStrideOffset = [byteStride, byteOffset];\n                    shape._webgl.normalType = componentType;\n                    shape._webgl.normalNormalized = normalized;\n                    bufferGeo._mesh._numNormComponents = components;\n                    break;\n                case \"TEXCOORD_0\":\n                case \"TEXCOORD\":\n                    shape._texCoordStrideOffset = [byteStride, byteOffset];\n                    shape._webgl.texCoordType = componentType;\n                    shape._webgl.texCoordNormalized = normalized;\n                    bufferGeo._mesh._numTexComponents = components;\n                    break;\n                case \"TEXCOORD_1\":\n                    shape._texCoord2StrideOffset = [byteStride, byteOffset];\n                    shape._webgl.texCoord2Type = componentType;\n                    shape._webgl.texCoord2Normalized = normalized;\n                    bufferGeo._mesh._numTex2Components = components;\n                    break;\n                case \"COLOR\":\n                case \"COLOR_0\":\n                    shape._colorStrideOffset = [byteStride, byteOffset];\n                    shape._webgl.colorType = componentType;\n                    shape._webgl.colorNormalized = normalized;\n                    bufferGeo._mesh._numColComponents = components;\n                    break;\n                case \"TANGENT\":\n                    shape._tangentStrideOffset = [byteStride, byteOffset];\n                    shape._webgl.tangentType = componentType;\n                    shape._webgl.tangentNormalized = normalized;\n                    bufferGeo._mesh._numTangentComponents = components;\n                    break;\n                case \"BITANGENT\":\n                    shape._binormalStrideOffset = [byteStride, byteOffset];\n                    shape._webgl.binormalType = componentType;\n                    shape._webgl.binormalNormalized = normalized;\n                    bufferGeo._mesh._numBinormalComponents = components;\n                    break;\n            }\n\n            var bufferIdx = x3dom.BUFFER_IDX[ accessor._vf.bufferType ];\n\n            var bufferViewID = bufferGeo._cf.views.nodes[view]._vf.id;\n\n            shape._webgl.buffers[bufferIdx] = x3dom.BinaryContainerLoader.bufferGeoCache[URL].buffers[bufferViewID];\n        }\n    }\n\n    var initBufferViews = function(arraybuffer)\n    {\n        var views = bufferGeo._cf.views.nodes;\n\n        for(var i = 0; i < views.length; i++)\n        {\n            var view = views[i];\n\n            var bufferID   = view._vf.id;\n            var byteOffset = view._vf.byteOffset;\n            var byteLength = view._vf.byteLength;\n\n            if(x3dom.BinaryContainerLoader.bufferGeoCache[URL].buffers[bufferID] == undefined || \n               !gl.isBuffer(x3dom.BinaryContainerLoader.bufferGeoCache[URL].buffers[bufferID]))\n            {\n                var bufferData = new Uint8Array(arraybuffer, byteOffset, byteLength);\n\n                var buffer = gl.createBuffer();\n    \n                gl.bindBuffer(view._vf.target, buffer);\n                gl.bufferData(view._vf.target, bufferData, gl.STATIC_DRAW);\n                gl.bindBuffer(view._vf.target, null);\n    \n                x3dom.BinaryContainerLoader.bufferGeoCache[URL].buffers[bufferID] = buffer;\n            }\n        }\n    };\n\n    var getPositions = function(arraybuffer)\n    {\n        var positions\n\n        if(posAccessor)\n        {\n            var posView = bufferGeo._cf.views.nodes[posAccessor._vf.view];\n\n            var byteOffset = posAccessor._vf.byteOffset + posView._vf.byteOffset;\n            var byteLength = posAccessor._vf.count * posAccessor._vf.components;\n\n            positions = x3dom.BinaryContainerLoader.getArrayBufferFromType(posAccessor._vf.componentType, \n                                                                           arraybuffer,\n                                                                           byteOffset,\n                                                                           byteLength);\n        }\n\n        return positions;\n    };\n\n    var getIndices = function(arraybuffer)\n    {\n        var indices;\n\n        if(idxAccessor)\n        {\n            var idxView = bufferGeo._cf.views.nodes[idxAccessor._vf.view];\n\n            var byteOffset = idxAccessor._vf.byteOffset + idxView._vf.byteOffset;\n            var byteLength = idxAccessor._vf.count * idxAccessor._vf.components;\n\n            indices = x3dom.BinaryContainerLoader.getArrayBufferFromType(idxAccessor._vf.componentType, \n                                                                         arraybuffer,\n                                                                         byteOffset,\n                                                                         byteLength);\n        }\n\n        return indices;\n    };\n\n    var computeNormals = function(arraybuffer)\n    {\n        if(needNormalComputation == false)\n        {\n            return;\n        }\n\n        var positions = getPositions(arraybuffer),\n            indices   = getIndices(arraybuffer),\n            normals   = new Float32Array(posAccessor._vf.count * 3);\n        \n        var vA = new x3dom.fields.SFVec3f(), \n            vB = new x3dom.fields.SFVec3f(), \n            vC = new x3dom.fields.SFVec3f();\n        \n        var ab = new x3dom.fields.SFVec3f(), \n            cb = new x3dom.fields.SFVec3f();\n        \n        if ( indices )\n        {         \n            var i0, i1, i2;\n            \n            for ( var i = 0; i < indices.length; i += 3 )\n            {\n                i0 = indices[ i     ] * 3;\n                i1 = indices[ i + 1 ] * 3;\n                i2 = indices[ i + 2 ] * 3;\n                \n                vA.set( positions[ i0 ], positions[ i0 + 1 ], positions[ i0 + 2 ] );     \n                vB.set( positions[ i1 ], positions[ i1 + 1 ], positions[ i1 + 2 ] );\n                vC.set( positions[ i2 ], positions[ i2 + 1 ], positions[ i2 + 2 ] );\n                \n                ab = ab.subtractVectors( vA, vB );\n                cb = cb.subtractVectors( vC, vB );\n                cb = cb.cross( ab );\n\n                cb = cb.normalize();\n                \n                normals[ i0     ] = normals[ i1     ] = normals[ i2     ] = cb.x;\n                normals[ i0 + 1 ] = normals[ i1 + 1 ] = normals[ i2 + 1 ] = cb.y;\n                normals[ i0 + 2 ] = normals[ i1 + 2 ] = normals[ i2 + 2 ] = cb.z;\n            }\n        }\n        else if( positions )\n        {\n            for ( var i = 0; i < positions.length; i += 9 )\n            {              \n                vA.set( positions[ i     ], positions[ i + 1 ], positions[ i + 2 ] );     \n                vB.set( positions[ i + 3 ], positions[ i + 4 ], positions[ i + 5 ] );\n                vC.set( positions[ i + 6 ], positions[ i + 7 ], positions[ i + 8 ] );\n                \n                ab = ab.subtractVectors( vA, vB );\n                cb = cb.subtractVectors( vC, vB );\n                cb = cb.cross( ab );\n\n                cb = cb.normalize();\n                \n                normals[ i     ] = normals[ i + 3 ] = normals[ i + 6 ] = cb.x;\n                normals[ i + 1 ] = normals[ i + 4 ] = normals[ i + 7 ] = cb.y;\n                normals[ i + 2 ] = normals[ i + 5 ] = normals[ i + 8 ] = cb.z;          \n            }      \n        }\n\n        var buffer = gl.createBuffer();\n    \n        gl.bindBuffer(34962, buffer);\n        gl.bufferData(34962, normals, gl.STATIC_DRAW);\n        gl.bindBuffer(34962, null);\n\n        shape._webgl.buffers[x3dom.BUFFER_IDX.NORMAL] = buffer;\n        shape._normalStrideOffset = [12, 0];\n        shape._webgl.normalType = 5126;\n        bufferGeo._mesh._numNormComponents = 3;\n    }\n\n    if(bufferGeo._vf.buffer != \"\")\n    {\n        URL = shape._nameSpace.getURL(bufferGeo._vf.buffer);\n\n        if(x3dom.BinaryContainerLoader.bufferGeoCache[URL] == undefined)\n        {\n            shape._nameSpace.doc.incrementDownloads();\n\n            x3dom.BinaryContainerLoader.bufferGeoCache[URL] = {};\n            x3dom.BinaryContainerLoader.bufferGeoCache[URL].buffers = [];\n            x3dom.BinaryContainerLoader.bufferGeoCache[URL].decrementDownload = true;\n            x3dom.BinaryContainerLoader.bufferGeoCache[URL].promise = new Promise(function(resolve, reject) {\n\n                var xhr = new XMLHttpRequest();\n\n                xhr.open(\"GET\", URL);\n        \n                xhr.responseType = \"arraybuffer\";\n        \n                xhr.onload = function(e)\n                {\n                    if(xhr.status != 200)\n                    {\n                        reject();\n                    }\n                    else\n                    {\n                        resolve(xhr.response);\n                    }\n                }\n        \n                xhr.onerror = function(e)\n                {\n                    reject();\n                }\n        \n                x3dom.RequestManager.addRequest( xhr );\n            });    \n        }\n\n        x3dom.BinaryContainerLoader.bufferGeoCache[URL].promise.then( function(arraybuffer) {\n\n            if(shape._webgl == undefined)\n            {\n                x3dom.BinaryContainerLoader.bufferGeoCache[URL] = undefined;\n                return;\n            }\n\n            initBufferViews(arraybuffer);\n            initAccessors();\n            computeNormals(arraybuffer);\n\n            if( x3dom.BinaryContainerLoader.bufferGeoCache[URL].decrementDownload )\n            {\n                x3dom.BinaryContainerLoader.bufferGeoCache[URL].decrementDownload = false;\n                shape._nameSpace.doc.decrementDownloads();\n                shape._nameSpace.doc.needRender = true;\n            }\n\n        }).catch(function()\n        {\n            if( x3dom.BinaryContainerLoader.bufferGeoCache[URL].decrementDownload )\n            {\n                x3dom.BinaryContainerLoader.bufferGeoCache[URL].decrementDownload = false;\n                shape._nameSpace.doc.decrementDownloads();\n            }\n        });     \n    }\n};\n\n/** setup/download buffer geometry */\nx3dom.BinaryContainerLoader.setupBufferInterpolator = function(interpolator)\n{\n    var getKeys = function(interpolator, accessor, arraybuffer)\n    {\n        var view          = interpolator._cf.views.nodes[accessor._vf.view];\n        var byteOffset    = accessor._vf.byteOffset + view._vf.byteOffset;\n        var byteLength    = accessor._vf.count * accessor._vf.components;\n        var componentType = accessor._vf.componentType;\n\n        var data = x3dom.BinaryContainerLoader.getArrayBufferFromType(componentType, \n                                                                      arraybuffer,\n                                                                      byteOffset,\n                                                                      byteLength);\n\n        for( var i = 0, n = data.length; i < n; i++)\n        {\n            data[i] = data[i] / interpolator._vf.duration\n        }\n\n        return new x3dom.fields.MFFloat( data );\n    };\n\n    var getKeyValues = function(interpolator, accessor, arraybuffer)\n    {\n        var view          = interpolator._cf.views.nodes[accessor._vf.view];\n        var byteOffset    = accessor._vf.byteOffset + view._vf.byteOffset;\n        var byteLength    = accessor._vf.count * accessor._vf.components;\n        var componentType = accessor._vf.componentType;\n\n        var data = x3dom.BinaryContainerLoader.getArrayBufferFromType(componentType, \n                                                                      arraybuffer,\n                                                                      byteOffset,\n                                                                      byteLength);\n\n        return interpolator.keyValueFromAccessor(data, componentType);\n    };\n\n    var initAccessors = function(arraybuffer)\n    {\n        var key;\n        var keyValue;\n        var accessors  = interpolator._cf.accessors.nodes;\n        \n        for(var i = 0; i < accessors.length; i++)\n        {\n            var accessor = accessors[i];\n\n            switch(accessor._vf.bufferType)\n            {\n                case \"SAMPLER_INPUT\":\n                    key = getKeys(interpolator, accessor, arraybuffer);\n                    break;\n                case \"SAMPLER_OUTPUT\":\n                    keyValue = getKeyValues(interpolator, accessor, arraybuffer);\n                    break;\n            }\n        }\n\n\n        //modify for STEP\n        if (interpolator._vf.interpolation === \"STEP\")\n        {\n            var stepKey   = key.copy();\n            var stepValue = keyValue.copy();\n\n            for(var i = 1, n = key.length; i<n; i++)\n            {\n                stepKey.splice(i*2, 0, key[i]);\n            }\n\n            for(var i = 0, n = keyValue.length; i<n; i++)\n            {\n                stepValue.splice(i*2+1, 0, keyValue[i]);\n            }\n\n            key = stepKey;\n            keyValue = stepValue;\n        }\n\n        interpolator._vf.key = key;\n        interpolator._vf.keyValue = keyValue;\n    };\n\n    var URL = interpolator._nameSpace.getURL(interpolator._vf.buffer);\n\n    if(x3dom.BinaryContainerLoader.bufferGeoCache[URL] == undefined)\n    {\n        interpolator._nameSpace.doc.incrementDownloads();\n\n        x3dom.BinaryContainerLoader.bufferGeoCache[URL] = {};\n        x3dom.BinaryContainerLoader.bufferGeoCache[URL].buffers = [];\n        x3dom.BinaryContainerLoader.bufferGeoCache[URL].decrementDownload = true;\n        x3dom.BinaryContainerLoader.bufferGeoCache[URL].promise = new Promise(function(resolve, reject) {\n\n            var xhr = new XMLHttpRequest();\n\n            xhr.open(\"GET\", URL);\n\n            xhr.responseType = \"arraybuffer\";\n\n            xhr.onload = function(e)\n            {\n                if(xhr.status != 200)\n                {\n                    reject();\n                }\n                else\n                {\n                    resolve(xhr.response);\n                } \n            }\n    \n            xhr.onerror = function(e)\n            {\n                reject();\n            }\n    \n            x3dom.RequestManager.addRequest( xhr );\n        });\n    }\n\n    x3dom.BinaryContainerLoader.bufferGeoCache[URL].promise.then( function(arraybuffer)\n    {\n        if(interpolator == undefined)\n        {\n            x3dom.BinaryContainerLoader.bufferGeoCache[URL] = undefined;\n            return;\n        }\n\n        initAccessors(arraybuffer);\n\n        if( x3dom.BinaryContainerLoader.bufferGeoCache[URL].decrementDownload )\n        {\n            x3dom.BinaryContainerLoader.bufferGeoCache[URL].decrementDownload = false;\n            interpolator._nameSpace.doc.decrementDownloads();\n            interpolator._nameSpace.doc.needRender = true;\n        }\n        \n    }).catch( function()\n    {\n        if( x3dom.BinaryContainerLoader.bufferGeoCache[URL].decrementDownload )\n        {\n            x3dom.BinaryContainerLoader.bufferGeoCache[URL].decrementDownload = false;\n            interpolator._nameSpace.doc.decrementDownloads();\n        }\n    });\n};\n\nx3dom.BinaryContainerLoader.getArrayBufferFromType = function(componentType, arraybuffer, byteOffset, byteLength)\n{\n    switch(componentType)\n    {\n        case 5120: return new Int8Array(arraybuffer, byteOffset, byteLength);\n        case 5121: return new Uint8Array(arraybuffer, byteOffset, byteLength);\n        case 5122: return new Int16Array(arraybuffer, byteOffset, byteLength);\n        case 5123: return new Uint16Array(arraybuffer, byteOffset, byteLength);\n        case 5125: return new Uint32Array(arraybuffer, byteOffset, byteLength);\n        case 5126: return new Float32Array(arraybuffer, byteOffset, byteLength);\n    }\n}\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * Philip Taylor: http://philip.html5.org\n */\n\n\n/**\n * c'tor\n */\nx3dom.DrawableCollection = function (drawableCollectionConfig) {\n    this.collection = [];\n\n    this.viewMatrix = drawableCollectionConfig.viewMatrix;\n    this.projMatrix = drawableCollectionConfig.projMatrix;\n    this.sceneMatrix = drawableCollectionConfig.sceneMatrix;\n\n    this.viewarea = drawableCollectionConfig.viewArea;\n\n    var scene = this.viewarea._scene;\n    var env = scene.getEnvironment();\n    var viewpoint = scene.getViewpoint();\n\n    this.near = viewpoint.getNear();\n    this.pixelHeightAtDistOne = viewpoint.getImgPlaneHeightAtDistOne() / this.viewarea._height;\n\n    this.context = drawableCollectionConfig.context;\n    this.gl = drawableCollectionConfig.gl;\n\n    this.viewFrustum = this.viewarea.getViewfrustum(this.sceneMatrix);\n    this.worldVol = new x3dom.fields.BoxVolume();     // helper\n\n    this.frustumCulling = drawableCollectionConfig.frustumCulling && (this.viewFrustum != null);\n    this.smallFeatureThreshold = drawableCollectionConfig.smallFeatureThreshold;\n\n    // if (lowPriorityThreshold < 1) sort all potentially visible objects according to priority\n    this.sortOpaque = (this.smallFeatureThreshold > 0 && env._lowPriorityThreshold < 1);\n    this.sortTrans = drawableCollectionConfig.sortTrans;\n\n    this.prioLevels = 10;\n    this.maxTreshold = 100;\n\n    this.sortBySortKey = false;\n    this.sortByPriority = false;\n\n    this.numberOfNodes = 0;\n\n    this.length = 0;\n};\n\n/**\n * Returns the result of the culling process, including view frustum culling and small feature culling.\n * A value > 0 identifies a plane mask, indicating that the object is inside the frustum with respect to\n * the respective planes (and large enough), -1 means the object was culled\n * \"0\" is a rare case, indicating that the object intersects with all planes of the frustum\n *  graphState = {\n *     boundedNode:  backref to bounded node object\n *     localMatrix:  mostly identity\n *     globalMatrix: current transform\n *     volume:       local bbox\n *     worldVolume:  global bbox\n *     center:       center in eye coords\n *     coverage:     currently approx. number of pixels on screen\n *  };\n */\nx3dom.DrawableCollection.prototype.cull = function (transform, graphState, singlePath, planeMask) {\n    var node = graphState.boundedNode;  // get ref to SG node\n\n    if (!node || !node._vf.render) {\n        return -1;\n    }\n\n    var volume = node.getVolume();      // create on request\n    var MASK_SET = 63;  // 2^6-1, i.e. all sides of the volume\n\n    if (this.frustumCulling && graphState.needCulling) {\n        var wvol;\n\n        if (singlePath && !graphState.worldVolume.isValid()) {\n            graphState.worldVolume.transformFrom(transform, volume);\n            wvol = graphState.worldVolume;  // use opportunity to update if necessary\n        }\n        else if (planeMask < MASK_SET) {\n            this.worldVol.transformFrom(transform, volume);\n            wvol = this.worldVol;\n        }\n\n        if (planeMask < MASK_SET)\n            planeMask = this.viewFrustum.intersect(wvol, planeMask);\n\n        //-1 indicates that the object has been culled\n        if (planeMask == -1)\n        {\n            return -1;\n        }\n    }\n    else {\n        planeMask = MASK_SET;\n    }\n\n    graphState.coverage = -1;    // if -1 then ignore value later on\n\n    // TODO: save the coverage only for drawables, which are unique (shapes can be shared!)\n    if (this.smallFeatureThreshold > 0 || node.forceUpdateCoverage()) {\n        var modelViewMat = this.viewMatrix.mult(transform);\n\n        graphState.center = modelViewMat.multMatrixPnt(volume.getCenter());\n\n        var rVec = modelViewMat.multMatrixVec(volume.getRadialVec());\n        var r    = rVec.length();\n\n        var dist = Math.max(-graphState.center.z - r, this.near);\n        var projPixelLength = dist * this.pixelHeightAtDistOne;\n\n        graphState.coverage = (r * 2.0) / projPixelLength;\n\n        if (this.smallFeatureThreshold > 0 && graphState.coverage < this.smallFeatureThreshold && \n            graphState.needCulling) {\n            return -1;\n        }\n    }\n\n    // not culled, incr node cnt\n    this.numberOfNodes++;\n    \n    return planeMask;   // >= 0 means inside or overlap\n};\n\n/**\n * A drawable is basically a unique pair of a shape node and a global transformation.\n */\nx3dom.DrawableCollection.prototype.addShape = function (shape, transform, graphState) {\n    //Create a new drawable object\n    var drawable = {};\n\n    //Set the shape\n    drawable.shape = shape;\n\n    //Set the transform\n    drawable.transform = transform;\n\n    drawable.localTransform = graphState.localMatrix;\n\n    //Set the local bounding box (reference, can be shared amongst shapes)\n    drawable.localVolume = graphState.volume;\n\n    //Set the global bbox (needs to be cloned since shape can be shared)\n    drawable.worldVolume = x3dom.fields.BoxVolume.copy(graphState.worldVolume);\n\n    //Calculate the magical object priority (though currently not very magic)\n    drawable.priority = Math.max(0, graphState.coverage);\n    //drawable.priority = this.calculatePriority(graphState);\n\n    //Get shaderID from shape\n    drawable.shaderID = shape.getShaderProperties(this.viewarea).id;\n\n    var appearance = shape._cf.appearance.node;\n\n    drawable.sortType = appearance ? appearance._vf.sortType.toLowerCase() : \"opaque\";\n    drawable.sortKey = appearance ? appearance._vf.sortKey : 0;\n\n    if (drawable.sortType == 'transparent') {\n        if (this.smallFeatureThreshold > 0) {\n            // TODO: center was previously set in cull, which is called first, but this\n            // might be problematic if scene is traversed in parallel and node is shared\n            // (though currently traversal is sequential, so everything is fine)\n            drawable.zPos = graphState.center.z;\n        }\n        else {\n            //Calculate the z-Pos for transparent object sorting\n            //if the center of the box is not available\n            var center = transform.multMatrixPnt(shape.getCenter());\n            center = this.viewMatrix.multMatrixPnt(center);\n            drawable.zPos = center.z;\n        }\n    }\n\n    //Look for sorting by sortKey\n    if (!this.sortBySortKey && drawable.sortKey != 0) {\n        this.sortBySortKey = true;\n    }\n\n    //Generate separate array for sortType if not exists\n    if (this.collection[drawable.sortType] === undefined) {\n        this.collection[drawable.sortType] = [];\n    }\n\n    //Push drawable to the collection\n    this.collection[drawable.sortType].push(drawable);\n    //this.collection[drawable.sortType][drawable.sortKey][drawable.priority][drawable.shaderID].push(drawable);\n\n    //Increment collection length\n    this.length++;\n\n    //Finally setup shape directly here to avoid another loop of O(n)\n    if (this.context && this.gl) {\n        this.context.setupShape(this.gl, drawable, this.viewarea);\n    }\n    //TODO: what about Flash? Shall we also setup structures here?\n};\n\n/**\n * A drawable is basically a unique pair of a shape node and a global transformation.\n */\nx3dom.DrawableCollection.prototype.addDrawable = function (drawable) {\n    //Calculate the magical object priority (though currently not very magic)\n    //drawable.priority = this.calculatePriority(graphState);\n\n    //Get shaderID from shape\n    drawable.shaderID = drawable.shape.getShaderProperties(this.viewarea).id;\n\n    var appearance = drawable.shape._cf.appearance.node;\n\n    drawable.sortType = appearance ? appearance._vf.sortType.toLowerCase() : \"opaque\";\n    drawable.sortKey = appearance ? appearance._vf.sortKey : 0;\n\n    if (drawable.sortType == 'transparent') {\n        //TODO set zPos for drawable for z-sorting\n        //Calculate the z-Pos for transparent object sorting\n        //if the center of the box is not available\n        var center = drawable.transform.multMatrixPnt(drawable.shape.getCenter());\n        center = this.viewMatrix.multMatrixPnt(center);\n        drawable.zPos = center.z;\n    }\n\n    //Look for sorting by sortKey\n    if (!this.sortBySortKey && drawable.sortKey != 0) {\n        this.sortBySortKey = true;\n    }\n\n    //Generate separate array for sortType if not exists\n    if (this.collection[drawable.sortType] === undefined) {\n        this.collection[drawable.sortType] = [];\n    }\n\n    //Push drawable to the collection\n    this.collection[drawable.sortType].push(drawable);\n    //this.collection[drawable.sortType][drawable.sortKey][drawable.priority][drawable.shaderID].push(drawable);\n\n    //Increment collection length\n    this.length++;\n\n    //Finally setup shape directly here to avoid another loop of O(n)\n    if (this.context && this.gl) {\n        this.context.setupShape(this.gl, drawable, this.viewarea);\n    }\n};\n\n\n/**\n * Calculate the magical object priority (though currently not very magic).\n */\nx3dom.DrawableCollection.prototype.calculatePriority = function (graphState) {\n    //Use coverage as priority\n    var priority = Math.max(0, graphState.coverage);\n\n    //Classify the priority level\n    var pl = this.prioLevels - 1;   // Can this be <= 0? Then FIXME!\n    priority = Math.min( Math.round(priority / (this.maxTreshold / pl)), pl );\n\n    return priority;\n};\n\n/**\n *  Concatenate opaque and transparent drawables\n */\nx3dom.DrawableCollection.prototype.concat = function () {\n    var opaque = (this.collection['opaque'] !== undefined) ? this.collection['opaque'] : [];\n    var transparent = (this.collection['transparent'] !== undefined) ? this.collection['transparent'] : [];\n\n    //Merge opaque and transparent drawables to a single array\n    this.collection = opaque.concat(transparent);\n};\n\n/**\n *  Get drawable for id\n */\nx3dom.DrawableCollection.prototype.get = function (idx) {\n    return this.collection[idx];\n};\n\n/**\n * Sort the DrawableCollection\n */\nx3dom.DrawableCollection.prototype.sort = function () {\n    var opaque = [];\n    var transparent = [];\n    var that = this;\n\n    //Sort opaque drawables\n    if (this.collection['opaque'] !== undefined) {\n        // never call this for very big scenes, getting very slow; try binning approach\n        if (this.sortOpaque) {\n            this.collection['opaque'].sort(function (a, b) {\n                if (a.sortKey == b.sortKey || !that.sortBySortKey) {\n                    //Second sort criteria (priority)\n                    return b.priority - a.priority;\n                }\n                //First sort criteria (sortKey)\n                return a.sortKey - b.sortKey;\n            });\n        }\n        opaque = this.collection['opaque'];\n    }\n\n    //Sort transparent drawables\n    if (this.collection['transparent'] !== undefined) {\n        if (this.sortTrans) {\n            this.collection['transparent'].sort(function (a, b) {\n                if (a.sortKey == b.sortKey || !that.sortBySortKey) {\n                    if (a.priority == b.priority || !that.sortByPriority) {\n                        //Third sort criteria (zPos)\n                        return a.zPos - b.zPos;\n                    }\n                    //Second sort criteria (priority)\n                    return b.priority - a.priority;\n                }\n                //First sort criteria (sortKey)\n                return a.sortKey - b.sortKey;\n            });\n        }\n        transparent = this.collection['transparent'];\n    }\n\n    //Merge opaque and transparent drawables to a single array (slow operation)\n    this.collection = opaque.concat(transparent);\n};\n\nx3dom.DrawableCollection.prototype.forEach = function (fnc, maxPriority) {\n    //Set maximal priority\n    maxPriority = (maxPriority !== undefined) ? Math.min(maxPriority, this.prioLevels) : this.prioLevels;\n\n    //Define run variables\n    var sortKey, priority, shaderID, drawable;\n\n    //First traverse Opaque drawables\n    // TODO; FIXME; this is wrong, sortKey can also be negative!\n    for (sortKey=0; sortKey<this.collection['opaque'].length; ++sortKey)\n    {\n        if (this.collection['opaque'][sortKey] !== undefined)\n        {\n            for (priority=this.collection['opaque'][sortKey].length; priority>0; --priority)\n            {\n                if (this.collection['opaque'][sortKey][priority] !== undefined)\n                {\n                    for (shaderID in this.collection['opaque'][sortKey][priority])\n                    {\n                        for (drawable=0; drawable<this.collection['opaque'][sortKey][priority][shaderID].length; ++drawable)\n                        {\n                            fnc( this.collection['opaque'][sortKey][priority][shaderID][drawable] );\n                        }\n                    }\n                }\n            }\n        }\n    }\n\n    //Next traverse transparent drawables\n    // TODO; FIXME; this is wrong, sortKey can also be negative!\n    for (sortKey=0; sortKey<this.collection['transparent'].length; ++sortKey)\n    {\n        if (this.collection['transparent'][sortKey] !== undefined)\n        {\n            for (priority=this.collection['transparent'][sortKey].length; priority>0; --priority)\n            {\n                if (this.collection['transparent'][sortKey][priority] !== undefined)\n                {\n                    for (var shaderId in this.collection['transparent'][sortKey][priority])\n                    {\n                        //Sort transparent drawables by z-Pos\n                        this.collection['transparent'][sortKey][priority][shaderId].sort(function(a, b) {\n                            return a.zPos - b.zPos\n                        });\n\n                        for (drawable=0; drawable<this.collection['transparent'][sortKey][priority][shaderId].length; ++drawable)\n                        {\n                            fnc( this.collection['transparent'][sortKey][priority][shaderId][drawable] );\n                        }\n                    }\n                }\n            }\n        }\n    }\n};\n\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * Philip Taylor: http://philip.html5.org\n */\n\n\n/**\n *  Moveable interface, wraps x3d bounded node with SpaceSensor-like movement functionality,\n *  therefore attaches event handlers, thus to be called earliest in document.onload method.\n *\n *  Cleanup backrefs and listeners on delete by explicitly calling detachHandlers()\n */\nx3dom.Moveable = function(x3domElem, boundedObj, callback, gridSize, mode) {\n    this._x3domRoot = x3domElem;\n    this._runtime = x3domElem.runtime;\n\n    // callback function for notifying changes\n    this._callback = callback;\n\n    // snap to grid of given size (0, no grid, if undefined)\n    this._gridSize = gridSize ? gridSize : 0;\n\n    this._moveable = boundedObj;\n    this._drag = false;\n\n    this._w = 0;\n    this._h = 0;\n\n    this._uPlane = null;\n    this._vPlane = null;\n    this._pPlane = null;\n\n    this._isect = null;\n\n    this._translationOffset = null;\n    this._rotationOffset = null;\n    this._scaleOffset = null;\n\n    this._lastX = 0;\n    this._lastY = 0;\n    this._buttonState = 0;\n\n    this._mode = (mode && mode.length) ? mode.toLowerCase() : \"translation\"; //\"all\";\n\n    this._firstRay = null;\n    this._matrixTrafo = null;\n\n    this._navType = \"examine\";\n\n    this.attachHandlers();\n};\n\n// grid size setter, for snapping\nx3dom.Moveable.prototype.setGridSize = function(gridSize) {\n    this._gridSize = gridSize;\n};\n\n// interaction mode setter, for translation and/or rotation\nx3dom.Moveable.prototype.setMode = function(mode) {\n    this._mode = mode.toLowerCase();\n};\n\nx3dom.Moveable.prototype.attachHandlers = function() {\n    // add backref to movable object (for member access and wrapping)\n    this._moveable._iMove = this;\n\n    // add backref to <x3d> element\n    if (!this._x3domRoot._iMove)\n        this._x3domRoot._iMove = [];\n    this._x3domRoot._iMove.push(this);\n\n    // mouse events\n    this._moveable.addEventListener('mousedown', this.start, false);\n    this._moveable.addEventListener('mouseover', this.over, false);\n    this._moveable.addEventListener('mouseout', this.out, false);\n\n    if (this._x3domRoot._iMove.length == 1) {\n        // more mouse events\n        this._x3domRoot.addEventListener('mouseup', this.stop, false);\n        this._x3domRoot.addEventListener('mouseout', this.stop, false);\n        this._x3domRoot.addEventListener('mousemove', this.move, true);\n\n        if (!this._runtime.canvas.disableTouch) {\n            // mozilla touch events\n            this._x3domRoot.addEventListener('MozTouchDown', this.touchStartHandlerMoz, false);\n            this._x3domRoot.addEventListener('MozTouchMove', this.touchMoveHandlerMoz, true);\n            this._x3domRoot.addEventListener('MozTouchUp', this.touchEndHandlerMoz, false);\n            // w3c / apple touch events\n            this._x3domRoot.addEventListener('touchstart', this.touchStartHandler, false);\n            this._x3domRoot.addEventListener('touchmove', this.touchMoveHandler, true);\n            this._x3domRoot.addEventListener('touchend', this.touchEndHandler, false);\n        }\n    }\n};\n\nx3dom.Moveable.prototype.detachHandlers = function() {\n    // remove backref to <x3d> element\n    var iMove = this._x3domRoot._iMove;\n    if (iMove) {\n        for (var i=0, n=iMove.length; i<n; i++) {\n            if (iMove[i] == this) {\n                iMove.splice(i, 1);\n                break;\n            }\n        }\n    }\n\n    // mouse events\n    this._moveable.removeEventListener('mousedown', this.start, false);\n    this._moveable.removeEventListener('mouseover', this.over, false);\n    this._moveable.removeEventListener('mouseout', this.out, false);\n\n    if (iMove.length == 0) {\n        // more mouse events\n        this._x3domRoot.removeEventListener('mouseup', this.stop, false);\n        this._x3domRoot.removeEventListener('mouseout', this.stop, false);\n        this._x3domRoot.removeEventListener('mousemove', this.move, true);\n\n        if (!this._runtime.canvas.disableTouch) {\n            // touch events\n            this._x3domRoot.removeEventListener('MozTouchDown', this.touchStartHandlerMoz, false);\n            this._x3domRoot.removeEventListener('MozTouchMove', this.touchMoveHandlerMoz, true);\n            this._x3domRoot.removeEventListener('MozTouchUp', this.touchEndHandlerMoz, false);\n            // mozilla version\n            this._x3domRoot.removeEventListener('touchstart', this.touchStartHandler, false);\n            this._x3domRoot.removeEventListener('touchmove', this.touchMoveHandler, true);\n            this._x3domRoot.removeEventListener('touchend', this.touchEndHandler, false);\n        }\n    }\n\n    // finally remove backref to movable object\n    if (this._moveable._iMove)\n        delete this._moveable._iMove;\n};\n\n// calculate viewing plane\nx3dom.Moveable.prototype.calcViewPlane = function(origin) {\n    // init width and height\n    this._w = this._runtime.getWidth();\n    this._h = this._runtime.getHeight();\n\n    //bottom left of viewarea\n    var ray = this._runtime.getViewingRay(0, this._h - 1);\n    var r = ray.pos.add(ray.dir);\n\n    //bottom right of viewarea\n    ray = this._runtime.getViewingRay(this._w - 1, this._h - 1);\n    var s = ray.pos.add(ray.dir);\n\n    //top left of viewarea\n    ray = this._runtime.getViewingRay(0, 0);\n    var t = ray.pos.add(ray.dir);\n\n    this._uPlane = s.subtract(r).normalize();\n    this._vPlane = t.subtract(r).normalize();\n\n    if (arguments.length === 0)\n        this._pPlane = r;\n    else\n        this._pPlane = x3dom.fields.SFVec3f.copy(origin);\n};\n\n// helper method to obtain determinant\nx3dom.Moveable.prototype.det = function(mat) {\n    return mat[0][0] * mat[1][1] * mat[2][2] + mat[0][1] * mat[1][2] * mat[2][0] +\n           mat[0][2] * mat[2][1] * mat[1][0] - mat[2][0] * mat[1][1] * mat[0][2] -\n           mat[0][0] * mat[2][1] * mat[1][2] - mat[1][0] * mat[0][1] * mat[2][2];\n};\n\n// Translation along plane parallel to viewing plane E:x=p+t*u+s*v\nx3dom.Moveable.prototype.translateXY = function(l) {\n    var track = null;\n    var z = [], n = [];\n\n    for (var i = 0; i < 3; i++) {\n        z[i] = [];\n        n[i] = [];\n\n        z[i][0] = this._uPlane.at(i);\n        n[i][0] = z[i][0];\n\n        z[i][1] = this._vPlane.at(i);\n        n[i][1] = z[i][1];\n\n        z[i][2] = (l.pos.subtract(this._pPlane)).at(i);\n        n[i][2] = -l.dir.at(i);\n    }\n\n    // get intersection line-plane with Cramer's rule\n    var s = this.det(n);\n\n    if (s !== 0) {\n        var t = this.det(z) / s;\n        track = l.pos.addScaled(l.dir, t);\n    }\n\n    if (track) {\n        if (this._isect) {\n            // calc offset from first click position\n            track = track.subtract(this._isect);\n        }\n        track = track.add(this._translationOffset);\n    }\n\n    return track;\n};\n\n// Translation along picking ray\nx3dom.Moveable.prototype.translateZ = function(l, currY) {\n    var vol = this._runtime.getSceneBBox();\n\n    var sign = (currY < this._lastY) ? 1 : -1;\n    var fact = sign * (vol.max.subtract(vol.min)).length() / 100;\n\n    this._translationOffset = this._translationOffset.addScaled(l.dir, fact);\n\n    return this._translationOffset;\n};\n\nx3dom.Moveable.prototype.rotate = function(posX, posY) {\n    var twoPi = 2 * Math.PI;\n    var alpha = ((posY - this._lastY) * twoPi) / this._w;\n    var beta  = ((posX - this._lastX) * twoPi) / this._h;\n\n    var q = x3dom.fields.Quaternion.axisAngle(this._uPlane, alpha);\n    var h = q.toMatrix();\n    this._rotationOffset = h.mult(this._rotationOffset);\n\n    q = x3dom.fields.Quaternion.axisAngle(this._vPlane, beta);\n    h = q.toMatrix();\n    this._rotationOffset = h.mult(this._rotationOffset);\n\n    var mat = this._rotationOffset.mult(x3dom.fields.SFMatrix4f.scale(this._scaleOffset));\n    var rot = new x3dom.fields.Quaternion(0, 0, 1, 0);\n    rot.setValue(mat);\n\n    return rot;\n};\n\nx3dom.Moveable.prototype.over = function(event) {\n    var that = this._iMove;\n\n    that._runtime.getCanvas().style.cursor = \"crosshair\";\n};\n\nx3dom.Moveable.prototype.out = function(event) {\n    var that = this._iMove;\n\n    if (!that._drag)\n        that._runtime.getCanvas().style.cursor = \"pointer\";\n};\n\n// start object movement, switch from navigation to interaction\nx3dom.Moveable.prototype.start = function(event) {\n    var that = this._iMove;\n\n    // use mouse button to distinguish between parallel or orthogonal movement or rotation\n    switch (that._mode) {\n        case \"translation\":\n            that._buttonState = (event.button == 4) ? 1 : (event.button & 3);\n            break;\n        case \"rotation\":\n            that._buttonState = 4;\n            break;\n        case \"all\":\n        default:\n            that._buttonState = event.button;\n            break;\n    }\n\n    if (!that._drag && that._buttonState) {\n        that._lastX = event.layerX;\n        that._lastY = event.layerY;\n\n        that._drag = true;\n\n        // temporarily disable navigation\n        that._navType = that._runtime.navigationType();\n        that._runtime.noNav();\n\n        // calc view-aligned plane through original pick position\n        that._isect = new x3dom.fields.SFVec3f(event.worldX, event.worldY, event.worldZ);\n        that.calcViewPlane(that._isect);\n\n        that._firstRay = that._runtime.getViewingRay(event.layerX, event.layerY);\n\n        var mTrans = that._moveable.getAttribute(\"translation\");\n        that._matrixTrafo = null;\n\n        if (mTrans) {\n            that._translationOffset = x3dom.fields.SFVec3f.parse(mTrans);\n\n            var mRot = that._moveable.getAttribute(\"rotation\");\n            mRot = mRot ? x3dom.fields.Quaternion.parseAxisAngle(mRot) : new x3dom.fields.Quaternion(0,0,1,0);\n            that._rotationOffset = mRot.toMatrix();\n\n            var mScal = that._moveable.getAttribute(\"scale\");\n            that._scaleOffset = mScal ? x3dom.fields.SFVec3f.parse(mScal) : new x3dom.fields.SFVec3f(1, 1, 1);\n        }\n        else {\n            mTrans = that._moveable.getAttribute(\"matrix\");\n\n            if (mTrans) {\n                that._matrixTrafo = x3dom.fields.SFMatrix4f.parse(mTrans).transpose();\n\n                var translation = new x3dom.fields.SFVec3f(0,0,0),\n                    scaleFactor = new x3dom.fields.SFVec3f(1,1,1);\n                var rotation = new x3dom.fields.Quaternion(0,0,1,0),\n                    scaleOrientation = new x3dom.fields.Quaternion(0,0,1,0);\n\n                that._matrixTrafo.getTransform(translation, rotation, scaleFactor, scaleOrientation);\n\n                //that._translationOffset = that._matrixTrafo.e3();\n                that._translationOffset = translation;\n                that._rotationOffset = rotation.toMatrix();\n                that._scaleOffset = scaleFactor;\n            }\n            else {\n                that._translationOffset = new x3dom.fields.SFVec3f(0, 0, 0);\n                that._rotationOffset = new x3dom.fields.SFMatrix4f();\n                that._scaleOffset = new x3dom.fields.SFVec3f(1, 1, 1);\n            }\n        }\n\n        that._runtime.getCanvas().style.cursor = \"crosshair\";\n    }\n};\n\nx3dom.Moveable.prototype.move = function(event) {\n    for (var i=0, n=this._iMove.length; i<n; i++) {\n        var that = this._iMove[i];\n\n        if (that._drag) {\n            var pos = that._runtime.mousePosition(event);\n            var ray = that._runtime.getViewingRay(pos[0], pos[1]);\n\n            var track = null;\n\n            // zoom with right mouse button (2), pan with left (1)\n            if (that._buttonState == 2)\n                track = that.translateZ(that._firstRay, pos[1]);\n            else if (that._buttonState == 1)\n                track = that.translateXY(ray);\n            else  // middle button: 4\n                track = that.rotate(pos[0], pos[1]);\n\n            if (track) {\n                if (that._gridSize > 0 && that._buttonState != 4) {\n                    var x = that._gridSize * Math.round(track.x / that._gridSize);\n                    var y = that._gridSize * Math.round(track.y / that._gridSize);\n                    var z = that._gridSize * Math.round(track.z / that._gridSize);\n                    track = new x3dom.fields.SFVec3f(x, y, z);\n                }\n\n                if (!that._matrixTrafo) {\n                    if (that._buttonState == 4) {\n                        that._moveable.setAttribute(\"rotation\", track.toAxisAngle().toString());\n                    }\n                    else {\n                        that._moveable.setAttribute(\"translation\", track.toString());\n                    }\n                }\n                else {\n                    if (that._buttonState == 4) {\n                        that._matrixTrafo.setRotate(track);\n                    }\n                    else {\n                        that._matrixTrafo.setTranslate(track);\n                    }\n                    that._moveable.setAttribute(\"matrix\", that._matrixTrafo.toGL().toString());\n                }\n\n                if (that._callback) {\n                    that._callback(that._moveable, track);\n                }\n            }\n\n            that._lastX = pos[0];\n            that._lastY = pos[1];\n        }\n    }\n};\n\n// stop object movement, switch from interaction to navigation\nx3dom.Moveable.prototype.stop = function(event) {\n    for (var i=0, n=this._iMove.length; i<n; i++) {\n        var that = this._iMove[i];\n\n        if (that._drag) {\n            that._lastX = event.layerX;\n            that._lastY = event.layerY;\n\n            that._isect = null;\n            that._drag = false;\n\n            // we're done, re-enable navigation\n            var navi = that._runtime.canvas.doc._scene.getNavigationInfo();\n            navi.setType(that._navType);\n\n            that._runtime.getCanvas().style.cursor = \"pointer\";\n        }\n    }\n};\n\n// TODO: impl. special (multi-)touch event stuff\n// === Touch Start (W3C) ===\nx3dom.Moveable.prototype.touchStartHandler = function (evt) {\n    evt.preventDefault();\n};\n\n// === Touch Start Moz (Firefox has other touch interface) ===\nx3dom.Moveable.prototype.touchStartHandlerMoz = function (evt) {\n    evt.preventDefault();\n};\n\n// === Touch Move ===\nx3dom.Moveable.prototype.touchMoveHandler = function (evt) {\n    evt.preventDefault();\n};\n\n// === Touch Move Moz ===\nx3dom.Moveable.prototype.touchMoveHandlerMoz = function (evt) {\n    evt.preventDefault();\n};\n\n// === Touch End ===\nx3dom.Moveable.prototype.touchEndHandler = function (evt) {\n    if (this._iMove.length) {\n        var that = this._iMove[0];\n        // mouse start code is called, but not stop\n        that.stop.apply(that._x3domRoot, [evt]);\n    }\n    evt.preventDefault();\n};\n\n// === Touch End Moz ===\nx3dom.Moveable.prototype.touchEndHandlerMoz = function (evt) {\n    if (this._iMove.length) {\n        var that = this._iMove[0];\n        that.stop.apply(that._x3domRoot, [evt]);\n    }\n    evt.preventDefault();\n};\n\n/** @license zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */(function() {'use strict';function q(b){throw b;}var t=void 0,u=!0,aa=this;function A(b,a){var c=b.split(\".\"),d=aa;!(c[0]in d)&&d.execScript&&d.execScript(\"var \"+c[0]);for(var e;c.length&&(e=c.shift());)!c.length&&a!==t?d[e]=a:d=d[e]?d[e]:d[e]={}};var B=\"undefined\"!==typeof Uint8Array&&\"undefined\"!==typeof Uint16Array&&\"undefined\"!==typeof Uint32Array&&\"undefined\"!==typeof DataView;function F(b,a){this.index=\"number\"===typeof a?a:0;this.m=0;this.buffer=b instanceof(B?Uint8Array:Array)?b:new (B?Uint8Array:Array)(32768);2*this.buffer.length<=this.index&&q(Error(\"invalid index\"));this.buffer.length<=this.index&&this.f()}F.prototype.f=function(){var b=this.buffer,a,c=b.length,d=new (B?Uint8Array:Array)(c<<1);if(B)d.set(b);else for(a=0;a<c;++a)d[a]=b[a];return this.buffer=d};\nF.prototype.d=function(b,a,c){var d=this.buffer,e=this.index,f=this.m,g=d[e],k;c&&1<a&&(b=8<a?(H[b&255]<<24|H[b>>>8&255]<<16|H[b>>>16&255]<<8|H[b>>>24&255])>>32-a:H[b]>>8-a);if(8>a+f)g=g<<a|b,f+=a;else for(k=0;k<a;++k)g=g<<1|b>>a-k-1&1,8===++f&&(f=0,d[e++]=H[g],g=0,e===d.length&&(d=this.f()));d[e]=g;this.buffer=d;this.m=f;this.index=e};F.prototype.finish=function(){var b=this.buffer,a=this.index,c;0<this.m&&(b[a]<<=8-this.m,b[a]=H[b[a]],a++);B?c=b.subarray(0,a):(b.length=a,c=b);return c};\nvar ba=new (B?Uint8Array:Array)(256),ca;for(ca=0;256>ca;++ca){for(var K=ca,da=K,ea=7,K=K>>>1;K;K>>>=1)da<<=1,da|=K&1,--ea;ba[ca]=(da<<ea&255)>>>0}var H=ba;function ja(b,a,c){var d,e=\"number\"===typeof a?a:a=0,f=\"number\"===typeof c?c:b.length;d=-1;for(e=f&7;e--;++a)d=d>>>8^O[(d^b[a])&255];for(e=f>>3;e--;a+=8)d=d>>>8^O[(d^b[a])&255],d=d>>>8^O[(d^b[a+1])&255],d=d>>>8^O[(d^b[a+2])&255],d=d>>>8^O[(d^b[a+3])&255],d=d>>>8^O[(d^b[a+4])&255],d=d>>>8^O[(d^b[a+5])&255],d=d>>>8^O[(d^b[a+6])&255],d=d>>>8^O[(d^b[a+7])&255];return(d^4294967295)>>>0}\nvar ka=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,\n2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,\n2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,\n2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,\n3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,\n936918E3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],O=B?new Uint32Array(ka):ka;function P(){}P.prototype.getName=function(){return this.name};P.prototype.getData=function(){return this.data};P.prototype.Y=function(){return this.Z};A(\"Zlib.GunzipMember\",P);A(\"Zlib.GunzipMember.prototype.getName\",P.prototype.getName);A(\"Zlib.GunzipMember.prototype.getData\",P.prototype.getData);A(\"Zlib.GunzipMember.prototype.getMtime\",P.prototype.Y);function la(b){this.buffer=new (B?Uint16Array:Array)(2*b);this.length=0}la.prototype.getParent=function(b){return 2*((b-2)/4|0)};la.prototype.push=function(b,a){var c,d,e=this.buffer,f;c=this.length;e[this.length++]=a;for(e[this.length++]=b;0<c;)if(d=this.getParent(c),e[c]>e[d])f=e[c],e[c]=e[d],e[d]=f,f=e[c+1],e[c+1]=e[d+1],e[d+1]=f,c=d;else break;return this.length};\nla.prototype.pop=function(){var b,a,c=this.buffer,d,e,f;a=c[0];b=c[1];this.length-=2;c[0]=c[this.length];c[1]=c[this.length+1];for(f=0;;){e=2*f+2;if(e>=this.length)break;e+2<this.length&&c[e+2]>c[e]&&(e+=2);if(c[e]>c[f])d=c[f],c[f]=c[e],c[e]=d,d=c[f+1],c[f+1]=c[e+1],c[e+1]=d;else break;f=e}return{index:b,value:a,length:this.length}};function ma(b){var a=b.length,c=0,d=Number.POSITIVE_INFINITY,e,f,g,k,h,l,s,p,m,n;for(p=0;p<a;++p)b[p]>c&&(c=b[p]),b[p]<d&&(d=b[p]);e=1<<c;f=new (B?Uint32Array:Array)(e);g=1;k=0;for(h=2;g<=c;){for(p=0;p<a;++p)if(b[p]===g){l=0;s=k;for(m=0;m<g;++m)l=l<<1|s&1,s>>=1;n=g<<16|p;for(m=l;m<e;m+=h)f[m]=n;++k}++g;k<<=1;h<<=1}return[f,c,d]};function na(b,a){this.k=qa;this.I=0;this.input=B&&b instanceof Array?new Uint8Array(b):b;this.b=0;a&&(a.lazy&&(this.I=a.lazy),\"number\"===typeof a.compressionType&&(this.k=a.compressionType),a.outputBuffer&&(this.a=B&&a.outputBuffer instanceof Array?new Uint8Array(a.outputBuffer):a.outputBuffer),\"number\"===typeof a.outputIndex&&(this.b=a.outputIndex));this.a||(this.a=new (B?Uint8Array:Array)(32768))}var qa=2,ra={NONE:0,v:1,o:qa,ba:3},sa=[],S;\nfor(S=0;288>S;S++)switch(u){case 143>=S:sa.push([S+48,8]);break;case 255>=S:sa.push([S-144+400,9]);break;case 279>=S:sa.push([S-256+0,7]);break;case 287>=S:sa.push([S-280+192,8]);break;default:q(\"invalid literal: \"+S)}\nna.prototype.g=function(){var b,a,c,d,e=this.input;switch(this.k){case 0:c=0;for(d=e.length;c<d;){a=B?e.subarray(c,c+65535):e.slice(c,c+65535);c+=a.length;var f=a,g=c===d,k=t,h=t,l=t,s=t,p=t,m=this.a,n=this.b;if(B){for(m=new Uint8Array(this.a.buffer);m.length<=n+f.length+5;)m=new Uint8Array(m.length<<1);m.set(this.a)}k=g?1:0;m[n++]=k|0;h=f.length;l=~h+65536&65535;m[n++]=h&255;m[n++]=h>>>8&255;m[n++]=l&255;m[n++]=l>>>8&255;if(B)m.set(f,n),n+=f.length,m=m.subarray(0,n);else{s=0;for(p=f.length;s<p;++s)m[n++]=\nf[s];m.length=n}this.b=n;this.a=m}break;case 1:var r=new F(B?new Uint8Array(this.a.buffer):this.a,this.b);r.d(1,1,u);r.d(1,2,u);var v=ta(this,e),x,Q,y;x=0;for(Q=v.length;x<Q;x++)if(y=v[x],F.prototype.d.apply(r,sa[y]),256<y)r.d(v[++x],v[++x],u),r.d(v[++x],5),r.d(v[++x],v[++x],u);else if(256===y)break;this.a=r.finish();this.b=this.a.length;break;case qa:var E=new F(B?new Uint8Array(this.a.buffer):this.a,this.b),Ka,R,X,Y,Z,pb=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],fa,La,ga,Ma,oa,wa=Array(19),\nNa,$,pa,C,Oa;Ka=qa;E.d(1,1,u);E.d(Ka,2,u);R=ta(this,e);fa=ua(this.W,15);La=va(fa);ga=ua(this.V,7);Ma=va(ga);for(X=286;257<X&&0===fa[X-1];X--);for(Y=30;1<Y&&0===ga[Y-1];Y--);var Pa=X,Qa=Y,J=new (B?Uint32Array:Array)(Pa+Qa),w,L,z,ha,I=new (B?Uint32Array:Array)(316),G,D,M=new (B?Uint8Array:Array)(19);for(w=L=0;w<Pa;w++)J[L++]=fa[w];for(w=0;w<Qa;w++)J[L++]=ga[w];if(!B){w=0;for(ha=M.length;w<ha;++w)M[w]=0}w=G=0;for(ha=J.length;w<ha;w+=L){for(L=1;w+L<ha&&J[w+L]===J[w];++L);z=L;if(0===J[w])if(3>z)for(;0<\nz--;)I[G++]=0,M[0]++;else for(;0<z;)D=138>z?z:138,D>z-3&&D<z&&(D=z-3),10>=D?(I[G++]=17,I[G++]=D-3,M[17]++):(I[G++]=18,I[G++]=D-11,M[18]++),z-=D;else if(I[G++]=J[w],M[J[w]]++,z--,3>z)for(;0<z--;)I[G++]=J[w],M[J[w]]++;else for(;0<z;)D=6>z?z:6,D>z-3&&D<z&&(D=z-3),I[G++]=16,I[G++]=D-3,M[16]++,z-=D}b=B?I.subarray(0,G):I.slice(0,G);oa=ua(M,7);for(C=0;19>C;C++)wa[C]=oa[pb[C]];for(Z=19;4<Z&&0===wa[Z-1];Z--);Na=va(oa);E.d(X-257,5,u);E.d(Y-1,5,u);E.d(Z-4,4,u);for(C=0;C<Z;C++)E.d(wa[C],3,u);C=0;for(Oa=b.length;C<\nOa;C++)if($=b[C],E.d(Na[$],oa[$],u),16<=$){C++;switch($){case 16:pa=2;break;case 17:pa=3;break;case 18:pa=7;break;default:q(\"invalid code: \"+$)}E.d(b[C],pa,u)}var Ra=[La,fa],Sa=[Ma,ga],N,Ta,ia,za,Ua,Va,Wa,Xa;Ua=Ra[0];Va=Ra[1];Wa=Sa[0];Xa=Sa[1];N=0;for(Ta=R.length;N<Ta;++N)if(ia=R[N],E.d(Ua[ia],Va[ia],u),256<ia)E.d(R[++N],R[++N],u),za=R[++N],E.d(Wa[za],Xa[za],u),E.d(R[++N],R[++N],u);else if(256===ia)break;this.a=E.finish();this.b=this.a.length;break;default:q(\"invalid compression type\")}return this.a};\nfunction xa(b,a){this.length=b;this.Q=a}\nvar ya=function(){function b(a){switch(u){case 3===a:return[257,a-3,0];case 4===a:return[258,a-4,0];case 5===a:return[259,a-5,0];case 6===a:return[260,a-6,0];case 7===a:return[261,a-7,0];case 8===a:return[262,a-8,0];case 9===a:return[263,a-9,0];case 10===a:return[264,a-10,0];case 12>=a:return[265,a-11,1];case 14>=a:return[266,a-13,1];case 16>=a:return[267,a-15,1];case 18>=a:return[268,a-17,1];case 22>=a:return[269,a-19,2];case 26>=a:return[270,a-23,2];case 30>=a:return[271,a-27,2];case 34>=a:return[272,\na-31,2];case 42>=a:return[273,a-35,3];case 50>=a:return[274,a-43,3];case 58>=a:return[275,a-51,3];case 66>=a:return[276,a-59,3];case 82>=a:return[277,a-67,4];case 98>=a:return[278,a-83,4];case 114>=a:return[279,a-99,4];case 130>=a:return[280,a-115,4];case 162>=a:return[281,a-131,5];case 194>=a:return[282,a-163,5];case 226>=a:return[283,a-195,5];case 257>=a:return[284,a-227,5];case 258===a:return[285,a-258,0];default:q(\"invalid length: \"+a)}}var a=[],c,d;for(c=3;258>=c;c++)d=b(c),a[c]=d[2]<<24|d[1]<<\n16|d[0];return a}(),Aa=B?new Uint32Array(ya):ya;\nfunction ta(b,a){function c(a,c){var b=a.Q,d=[],e=0,f;f=Aa[a.length];d[e++]=f&65535;d[e++]=f>>16&255;d[e++]=f>>24;var g;switch(u){case 1===b:g=[0,b-1,0];break;case 2===b:g=[1,b-2,0];break;case 3===b:g=[2,b-3,0];break;case 4===b:g=[3,b-4,0];break;case 6>=b:g=[4,b-5,1];break;case 8>=b:g=[5,b-7,1];break;case 12>=b:g=[6,b-9,2];break;case 16>=b:g=[7,b-13,2];break;case 24>=b:g=[8,b-17,3];break;case 32>=b:g=[9,b-25,3];break;case 48>=b:g=[10,b-33,4];break;case 64>=b:g=[11,b-49,4];break;case 96>=b:g=[12,b-\n65,5];break;case 128>=b:g=[13,b-97,5];break;case 192>=b:g=[14,b-129,6];break;case 256>=b:g=[15,b-193,6];break;case 384>=b:g=[16,b-257,7];break;case 512>=b:g=[17,b-385,7];break;case 768>=b:g=[18,b-513,8];break;case 1024>=b:g=[19,b-769,8];break;case 1536>=b:g=[20,b-1025,9];break;case 2048>=b:g=[21,b-1537,9];break;case 3072>=b:g=[22,b-2049,10];break;case 4096>=b:g=[23,b-3073,10];break;case 6144>=b:g=[24,b-4097,11];break;case 8192>=b:g=[25,b-6145,11];break;case 12288>=b:g=[26,b-8193,12];break;case 16384>=\nb:g=[27,b-12289,12];break;case 24576>=b:g=[28,b-16385,13];break;case 32768>=b:g=[29,b-24577,13];break;default:q(\"invalid distance\")}f=g;d[e++]=f[0];d[e++]=f[1];d[e++]=f[2];var h,k;h=0;for(k=d.length;h<k;++h)m[n++]=d[h];v[d[0]]++;x[d[3]]++;r=a.length+c-1;p=null}var d,e,f,g,k,h={},l,s,p,m=B?new Uint16Array(2*a.length):[],n=0,r=0,v=new (B?Uint32Array:Array)(286),x=new (B?Uint32Array:Array)(30),Q=b.I,y;if(!B){for(f=0;285>=f;)v[f++]=0;for(f=0;29>=f;)x[f++]=0}v[256]=1;d=0;for(e=a.length;d<e;++d){f=k=0;\nfor(g=3;f<g&&d+f!==e;++f)k=k<<8|a[d+f];h[k]===t&&(h[k]=[]);l=h[k];if(!(0<r--)){for(;0<l.length&&32768<d-l[0];)l.shift();if(d+3>=e){p&&c(p,-1);f=0;for(g=e-d;f<g;++f)y=a[d+f],m[n++]=y,++v[y];break}0<l.length?(s=Ba(a,d,l),p?p.length<s.length?(y=a[d-1],m[n++]=y,++v[y],c(s,0)):c(p,-1):s.length<Q?p=s:c(s,0)):p?c(p,-1):(y=a[d],m[n++]=y,++v[y])}l.push(d)}m[n++]=256;v[256]++;b.W=v;b.V=x;return B?m.subarray(0,n):m}\nfunction Ba(b,a,c){var d,e,f=0,g,k,h,l,s=b.length;k=0;l=c.length;a:for(;k<l;k++){d=c[l-k-1];g=3;if(3<f){for(h=f;3<h;h--)if(b[d+h-1]!==b[a+h-1])continue a;g=f}for(;258>g&&a+g<s&&b[d+g]===b[a+g];)++g;g>f&&(e=d,f=g);if(258===g)break}return new xa(f,a-e)}\nfunction ua(b,a){var c=b.length,d=new la(572),e=new (B?Uint8Array:Array)(c),f,g,k,h,l;if(!B)for(h=0;h<c;h++)e[h]=0;for(h=0;h<c;++h)0<b[h]&&d.push(h,b[h]);f=Array(d.length/2);g=new (B?Uint32Array:Array)(d.length/2);if(1===f.length)return e[d.pop().index]=1,e;h=0;for(l=d.length/2;h<l;++h)f[h]=d.pop(),g[h]=f[h].value;k=Ca(g,g.length,a);h=0;for(l=f.length;h<l;++h)e[f[h].index]=k[h];return e}\nfunction Ca(b,a,c){function d(b){var c=h[b][l[b]];c===a?(d(b+1),d(b+1)):--g[c];++l[b]}var e=new (B?Uint16Array:Array)(c),f=new (B?Uint8Array:Array)(c),g=new (B?Uint8Array:Array)(a),k=Array(c),h=Array(c),l=Array(c),s=(1<<c)-a,p=1<<c-1,m,n,r,v,x;e[c-1]=a;for(n=0;n<c;++n)s<p?f[n]=0:(f[n]=1,s-=p),s<<=1,e[c-2-n]=(e[c-1-n]/2|0)+a;e[0]=f[0];k[0]=Array(e[0]);h[0]=Array(e[0]);for(n=1;n<c;++n)e[n]>2*e[n-1]+f[n]&&(e[n]=2*e[n-1]+f[n]),k[n]=Array(e[n]),h[n]=Array(e[n]);for(m=0;m<a;++m)g[m]=c;for(r=0;r<e[c-1];++r)k[c-\n1][r]=b[r],h[c-1][r]=r;for(m=0;m<c;++m)l[m]=0;1===f[c-1]&&(--g[0],++l[c-1]);for(n=c-2;0<=n;--n){v=m=0;x=l[n+1];for(r=0;r<e[n];r++)v=k[n+1][x]+k[n+1][x+1],v>b[m]?(k[n][r]=v,h[n][r]=a,x+=2):(k[n][r]=b[m],h[n][r]=m,++m);l[n]=0;1===f[n]&&d(n)}return g}\nfunction va(b){var a=new (B?Uint16Array:Array)(b.length),c=[],d=[],e=0,f,g,k,h;f=0;for(g=b.length;f<g;f++)c[b[f]]=(c[b[f]]|0)+1;f=1;for(g=16;f<=g;f++)d[f]=e,e+=c[f]|0,e<<=1;f=0;for(g=b.length;f<g;f++){e=d[b[f]];d[b[f]]+=1;k=a[f]=0;for(h=b[f];k<h;k++)a[f]=a[f]<<1|e&1,e>>>=1}return a};function Da(b,a){this.input=b;this.b=this.c=0;this.i={};a&&(a.flags&&(this.i=a.flags),\"string\"===typeof a.filename&&(this.filename=a.filename),\"string\"===typeof a.comment&&(this.A=a.comment),a.deflateOptions&&(this.l=a.deflateOptions));this.l||(this.l={})}\nDa.prototype.g=function(){var b,a,c,d,e,f,g,k,h=new (B?Uint8Array:Array)(32768),l=0,s=this.input,p=this.c,m=this.filename,n=this.A;h[l++]=31;h[l++]=139;h[l++]=8;b=0;this.i.fname&&(b|=Ea);this.i.fcomment&&(b|=Fa);this.i.fhcrc&&(b|=Ga);h[l++]=b;a=(Date.now?Date.now():+new Date)/1E3|0;h[l++]=a&255;h[l++]=a>>>8&255;h[l++]=a>>>16&255;h[l++]=a>>>24&255;h[l++]=0;h[l++]=Ha;if(this.i.fname!==t){g=0;for(k=m.length;g<k;++g)f=m.charCodeAt(g),255<f&&(h[l++]=f>>>8&255),h[l++]=f&255;h[l++]=0}if(this.i.comment){g=\n0;for(k=n.length;g<k;++g)f=n.charCodeAt(g),255<f&&(h[l++]=f>>>8&255),h[l++]=f&255;h[l++]=0}this.i.fhcrc&&(c=ja(h,0,l)&65535,h[l++]=c&255,h[l++]=c>>>8&255);this.l.outputBuffer=h;this.l.outputIndex=l;e=new na(s,this.l);h=e.g();l=e.b;B&&(l+8>h.buffer.byteLength?(this.a=new Uint8Array(l+8),this.a.set(new Uint8Array(h.buffer)),h=this.a):h=new Uint8Array(h.buffer));d=ja(s,t,t);h[l++]=d&255;h[l++]=d>>>8&255;h[l++]=d>>>16&255;h[l++]=d>>>24&255;k=s.length;h[l++]=k&255;h[l++]=k>>>8&255;h[l++]=k>>>16&255;h[l++]=\nk>>>24&255;this.c=p;B&&l<h.length&&(this.a=h=h.subarray(0,l));return h};var Ha=255,Ga=2,Ea=8,Fa=16;A(\"Zlib.Gzip\",Da);A(\"Zlib.Gzip.prototype.compress\",Da.prototype.g);function T(b,a){this.p=[];this.q=32768;this.e=this.j=this.c=this.u=0;this.input=B?new Uint8Array(b):b;this.w=!1;this.r=Ia;this.M=!1;if(a||!(a={}))a.index&&(this.c=a.index),a.bufferSize&&(this.q=a.bufferSize),a.bufferType&&(this.r=a.bufferType),a.resize&&(this.M=a.resize);switch(this.r){case Ja:this.b=32768;this.a=new (B?Uint8Array:Array)(32768+this.q+258);break;case Ia:this.b=0;this.a=new (B?Uint8Array:Array)(this.q);this.f=this.U;this.B=this.R;this.s=this.T;break;default:q(Error(\"invalid inflate mode\"))}}\nvar Ja=0,Ia=1,Ya={O:Ja,N:Ia};\nT.prototype.h=function(){for(;!this.w;){var b=U(this,3);b&1&&(this.w=u);b>>>=1;switch(b){case 0:var a=this.input,c=this.c,d=this.a,e=this.b,f=a.length,g=t,k=t,h=d.length,l=t;this.e=this.j=0;c+1>=f&&q(Error(\"invalid uncompressed block header: LEN\"));g=a[c++]|a[c++]<<8;c+1>=f&&q(Error(\"invalid uncompressed block header: NLEN\"));k=a[c++]|a[c++]<<8;g===~k&&q(Error(\"invalid uncompressed block header: length verify\"));c+g>a.length&&q(Error(\"input buffer is broken\"));switch(this.r){case Ja:for(;e+g>d.length;){l=\nh-e;g-=l;if(B)d.set(a.subarray(c,c+l),e),e+=l,c+=l;else for(;l--;)d[e++]=a[c++];this.b=e;d=this.f();e=this.b}break;case Ia:for(;e+g>d.length;)d=this.f({F:2});break;default:q(Error(\"invalid inflate mode\"))}if(B)d.set(a.subarray(c,c+g),e),e+=g,c+=g;else for(;g--;)d[e++]=a[c++];this.c=c;this.b=e;this.a=d;break;case 1:this.s(Za,$a);break;case 2:ab(this);break;default:q(Error(\"unknown BTYPE: \"+b))}}return this.B()};\nvar bb=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],cb=B?new Uint16Array(bb):bb,db=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258],eb=B?new Uint16Array(db):db,fb=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],gb=B?new Uint8Array(fb):fb,hb=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],ib=B?new Uint16Array(hb):hb,jb=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,\n10,11,11,12,12,13,13],kb=B?new Uint8Array(jb):jb,lb=new (B?Uint8Array:Array)(288),V,mb;V=0;for(mb=lb.length;V<mb;++V)lb[V]=143>=V?8:255>=V?9:279>=V?7:8;var Za=ma(lb),nb=new (B?Uint8Array:Array)(30),ob,qb;ob=0;for(qb=nb.length;ob<qb;++ob)nb[ob]=5;var $a=ma(nb);function U(b,a){for(var c=b.j,d=b.e,e=b.input,f=b.c,g=e.length,k;d<a;)f>=g&&q(Error(\"input buffer is broken\")),c|=e[f++]<<d,d+=8;k=c&(1<<a)-1;b.j=c>>>a;b.e=d-a;b.c=f;return k}\nfunction rb(b,a){for(var c=b.j,d=b.e,e=b.input,f=b.c,g=e.length,k=a[0],h=a[1],l,s;d<h&&!(f>=g);)c|=e[f++]<<d,d+=8;l=k[c&(1<<h)-1];s=l>>>16;b.j=c>>s;b.e=d-s;b.c=f;return l&65535}\nfunction ab(b){function a(a,b,c){var d,e=this.J,f,g;for(g=0;g<a;)switch(d=rb(this,b),d){case 16:for(f=3+U(this,2);f--;)c[g++]=e;break;case 17:for(f=3+U(this,3);f--;)c[g++]=0;e=0;break;case 18:for(f=11+U(this,7);f--;)c[g++]=0;e=0;break;default:e=c[g++]=d}this.J=e;return c}var c=U(b,5)+257,d=U(b,5)+1,e=U(b,4)+4,f=new (B?Uint8Array:Array)(cb.length),g,k,h,l;for(l=0;l<e;++l)f[cb[l]]=U(b,3);if(!B){l=e;for(e=f.length;l<e;++l)f[cb[l]]=0}g=ma(f);k=new (B?Uint8Array:Array)(c);h=new (B?Uint8Array:Array)(d);\nb.J=0;b.s(ma(a.call(b,c,g,k)),ma(a.call(b,d,g,h)))}T.prototype.s=function(b,a){var c=this.a,d=this.b;this.C=b;for(var e=c.length-258,f,g,k,h;256!==(f=rb(this,b));)if(256>f)d>=e&&(this.b=d,c=this.f(),d=this.b),c[d++]=f;else{g=f-257;h=eb[g];0<gb[g]&&(h+=U(this,gb[g]));f=rb(this,a);k=ib[f];0<kb[f]&&(k+=U(this,kb[f]));d>=e&&(this.b=d,c=this.f(),d=this.b);for(;h--;)c[d]=c[d++-k]}for(;8<=this.e;)this.e-=8,this.c--;this.b=d};\nT.prototype.T=function(b,a){var c=this.a,d=this.b;this.C=b;for(var e=c.length,f,g,k,h;256!==(f=rb(this,b));)if(256>f)d>=e&&(c=this.f(),e=c.length),c[d++]=f;else{g=f-257;h=eb[g];0<gb[g]&&(h+=U(this,gb[g]));f=rb(this,a);k=ib[f];0<kb[f]&&(k+=U(this,kb[f]));d+h>e&&(c=this.f(),e=c.length);for(;h--;)c[d]=c[d++-k]}for(;8<=this.e;)this.e-=8,this.c--;this.b=d};\nT.prototype.f=function(){var b=new (B?Uint8Array:Array)(this.b-32768),a=this.b-32768,c,d,e=this.a;if(B)b.set(e.subarray(32768,b.length));else{c=0;for(d=b.length;c<d;++c)b[c]=e[c+32768]}this.p.push(b);this.u+=b.length;if(B)e.set(e.subarray(a,a+32768));else for(c=0;32768>c;++c)e[c]=e[a+c];this.b=32768;return e};\nT.prototype.U=function(b){var a,c=this.input.length/this.c+1|0,d,e,f,g=this.input,k=this.a;b&&(\"number\"===typeof b.F&&(c=b.F),\"number\"===typeof b.P&&(c+=b.P));2>c?(d=(g.length-this.c)/this.C[2],f=258*(d/2)|0,e=f<k.length?k.length+f:k.length<<1):e=k.length*c;B?(a=new Uint8Array(e),a.set(k)):a=k;return this.a=a};\nT.prototype.B=function(){var b=0,a=this.a,c=this.p,d,e=new (B?Uint8Array:Array)(this.u+(this.b-32768)),f,g,k,h;if(0===c.length)return B?this.a.subarray(32768,this.b):this.a.slice(32768,this.b);f=0;for(g=c.length;f<g;++f){d=c[f];k=0;for(h=d.length;k<h;++k)e[b++]=d[k]}f=32768;for(g=this.b;f<g;++f)e[b++]=a[f];this.p=[];return this.buffer=e};\nT.prototype.R=function(){var b,a=this.b;B?this.M?(b=new Uint8Array(a),b.set(this.a.subarray(0,a))):b=this.a.subarray(0,a):(this.a.length>a&&(this.a.length=a),b=this.a);return this.buffer=b};function sb(b){this.input=b;this.c=0;this.t=[];this.D=!1}sb.prototype.X=function(){this.D||this.h();return this.t.slice()};\nsb.prototype.h=function(){for(var b=this.input.length;this.c<b;){var a=new P,c=t,d=t,e=t,f=t,g=t,k=t,h=t,l=t,s=t,p=this.input,m=this.c;a.G=p[m++];a.H=p[m++];(31!==a.G||139!==a.H)&&q(Error(\"invalid file signature:\"+a.G+\",\"+a.H));a.z=p[m++];switch(a.z){case 8:break;default:q(Error(\"unknown compression method: \"+a.z))}a.n=p[m++];l=p[m++]|p[m++]<<8|p[m++]<<16|p[m++]<<24;a.Z=new Date(1E3*l);a.fa=p[m++];a.ea=p[m++];0<(a.n&4)&&(a.aa=p[m++]|p[m++]<<8,m+=a.aa);if(0<(a.n&Ea)){h=[];for(k=0;0<(g=p[m++]);)h[k++]=\nString.fromCharCode(g);a.name=h.join(\"\")}if(0<(a.n&Fa)){h=[];for(k=0;0<(g=p[m++]);)h[k++]=String.fromCharCode(g);a.A=h.join(\"\")}0<(a.n&Ga)&&(a.S=ja(p,0,m)&65535,a.S!==(p[m++]|p[m++]<<8)&&q(Error(\"invalid header crc16\")));c=p[p.length-4]|p[p.length-3]<<8|p[p.length-2]<<16|p[p.length-1]<<24;p.length-m-4-4<512*c&&(f=c);d=new T(p,{index:m,bufferSize:f});a.data=e=d.h();m=d.c;a.ca=s=(p[m++]|p[m++]<<8|p[m++]<<16|p[m++]<<24)>>>0;ja(e,t,t)!==s&&q(Error(\"invalid CRC-32 checksum: 0x\"+ja(e,t,t).toString(16)+\n\" / 0x\"+s.toString(16)));a.da=c=(p[m++]|p[m++]<<8|p[m++]<<16|p[m++]<<24)>>>0;(e.length&4294967295)!==c&&q(Error(\"invalid input size: \"+(e.length&4294967295)+\" / \"+c));this.t.push(a);this.c=m}this.D=u;var n=this.t,r,v,x=0,Q=0,y;r=0;for(v=n.length;r<v;++r)Q+=n[r].data.length;if(B){y=new Uint8Array(Q);for(r=0;r<v;++r)y.set(n[r].data,x),x+=n[r].data.length}else{y=[];for(r=0;r<v;++r)y[r]=n[r].data;y=Array.prototype.concat.apply([],y)}return y};A(\"Zlib.Gunzip\",sb);A(\"Zlib.Gunzip.prototype.decompress\",sb.prototype.h);A(\"Zlib.Gunzip.prototype.getMembers\",sb.prototype.X);function tb(b){if(\"string\"===typeof b){var a=b.split(\"\"),c,d;c=0;for(d=a.length;c<d;c++)a[c]=(a[c].charCodeAt(0)&255)>>>0;b=a}for(var e=1,f=0,g=b.length,k,h=0;0<g;){k=1024<g?1024:g;g-=k;do e+=b[h++],f+=e;while(--k);e%=65521;f%=65521}return(f<<16|e)>>>0};function ub(b,a){var c,d;this.input=b;this.c=0;if(a||!(a={}))a.index&&(this.c=a.index),a.verify&&(this.$=a.verify);c=b[this.c++];d=b[this.c++];switch(c&15){case vb:this.method=vb;break;default:q(Error(\"unsupported compression method\"))}0!==((c<<8)+d)%31&&q(Error(\"invalid fcheck flag:\"+((c<<8)+d)%31));d&32&&q(Error(\"fdict flag is not supported\"));this.L=new T(b,{index:this.c,bufferSize:a.bufferSize,bufferType:a.bufferType,resize:a.resize})}\nub.prototype.h=function(){var b=this.input,a,c;a=this.L.h();this.c=this.L.c;this.$&&(c=(b[this.c++]<<24|b[this.c++]<<16|b[this.c++]<<8|b[this.c++])>>>0,c!==tb(a)&&q(Error(\"invalid adler-32 checksum\")));return a};var vb=8;function wb(b,a){this.input=b;this.a=new (B?Uint8Array:Array)(32768);this.k=W.o;var c={},d;if((a||!(a={}))&&\"number\"===typeof a.compressionType)this.k=a.compressionType;for(d in a)c[d]=a[d];c.outputBuffer=this.a;this.K=new na(this.input,c)}var W=ra;\nwb.prototype.g=function(){var b,a,c,d,e,f,g,k=0;g=this.a;b=vb;switch(b){case vb:a=Math.LOG2E*Math.log(32768)-8;break;default:q(Error(\"invalid compression method\"))}c=a<<4|b;g[k++]=c;switch(b){case vb:switch(this.k){case W.NONE:e=0;break;case W.v:e=1;break;case W.o:e=2;break;default:q(Error(\"unsupported compression type\"))}break;default:q(Error(\"invalid compression method\"))}d=e<<6|0;g[k++]=d|31-(256*c+d)%31;f=tb(this.input);this.K.b=k;g=this.K.g();k=g.length;B&&(g=new Uint8Array(g.buffer),g.length<=\nk+4&&(this.a=new Uint8Array(g.length+4),this.a.set(g),g=this.a),g=g.subarray(0,k+4));g[k++]=f>>24&255;g[k++]=f>>16&255;g[k++]=f>>8&255;g[k++]=f&255;return g};function xb(b,a){var c,d,e,f;if(Object.keys)c=Object.keys(a);else for(d in c=[],e=0,a)c[e++]=d;e=0;for(f=c.length;e<f;++e)d=c[e],A(b+\".\"+d,a[d])};A(\"Zlib.Inflate\",ub);A(\"Zlib.Inflate.prototype.decompress\",ub.prototype.h);xb(\"Zlib.Inflate.BufferType\",{ADAPTIVE:Ya.N,BLOCK:Ya.O});A(\"Zlib.Deflate\",wb);A(\"Zlib.Deflate.compress\",function(b,a){return(new wb(b,a)).g()});A(\"Zlib.Deflate.prototype.compress\",wb.prototype.g);xb(\"Zlib.Deflate.CompressionType\",{NONE:W.NONE,FIXED:W.v,DYNAMIC:W.o});}).call(this);\n\n!function(t,e){e()}(this,function(){\"use strict\";function t(t){var e=typeof t;return null!==t&&(\"object\"===e||\"function\"===e)}function e(t){return\"function\"==typeof t}function n(t){B=t}function r(t){G=t}function o(){return function(){return process.nextTick(a)}}function i(){return\"undefined\"!=typeof z?function(){z(a)}:c()}function s(){var t=0,e=new J(a),n=document.createTextNode(\"\");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function u(){var t=new MessageChannel;return t.port1.onmessage=a,function(){return t.port2.postMessage(0)}}function c(){var t=setTimeout;return function(){return t(a,1)}}function a(){for(var t=0;t<W;t+=2){var e=V[t],n=V[t+1];e(n),V[t]=void 0,V[t+1]=void 0}W=0}function f(){try{var t=Function(\"return this\")().require(\"vertx\");return z=t.runOnLoop||t.runOnContext,i()}catch(e){return c()}}function l(t,e){var n=this,r=new this.constructor(p);void 0===r[Z]&&O(r);var o=n._state;if(o){var i=arguments[o-1];G(function(){return P(o,r,i,n._result)})}else E(n,r,t,e);return r}function h(t){var e=this;if(t&&\"object\"==typeof t&&t.constructor===e)return t;var n=new e(p);return g(n,t),n}function p(){}function v(){return new TypeError(\"You cannot resolve a promise with itself\")}function d(){return new TypeError(\"A promises callback cannot return that same promise.\")}function _(t){try{return t.then}catch(e){return nt.error=e,nt}}function y(t,e,n,r){try{t.call(e,n,r)}catch(o){return o}}function m(t,e,n){G(function(t){var r=!1,o=y(n,e,function(n){r||(r=!0,e!==n?g(t,n):S(t,n))},function(e){r||(r=!0,j(t,e))},\"Settle: \"+(t._label||\" unknown promise\"));!r&&o&&(r=!0,j(t,o))},t)}function b(t,e){e._state===tt?S(t,e._result):e._state===et?j(t,e._result):E(e,void 0,function(e){return g(t,e)},function(e){return j(t,e)})}function w(t,n,r){n.constructor===t.constructor&&r===l&&n.constructor.resolve===h?b(t,n):r===nt?(j(t,nt.error),nt.error=null):void 0===r?S(t,n):e(r)?m(t,n,r):S(t,n)}function g(e,n){e===n?j(e,v()):t(n)?w(e,n,_(n)):S(e,n)}function A(t){t._onerror&&t._onerror(t._result),T(t)}function S(t,e){t._state===$&&(t._result=e,t._state=tt,0!==t._subscribers.length&&G(T,t))}function j(t,e){t._state===$&&(t._state=et,t._result=e,G(A,t))}function E(t,e,n,r){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+tt]=n,o[i+et]=r,0===i&&t._state&&G(T,t)}function T(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,o=void 0,i=t._result,s=0;s<e.length;s+=3)r=e[s],o=e[s+n],r?P(n,r,o,i):o(i);t._subscribers.length=0}}function M(t,e){try{return t(e)}catch(n){return nt.error=n,nt}}function P(t,n,r,o){var i=e(r),s=void 0,u=void 0,c=void 0,a=void 0;if(i){if(s=M(r,o),s===nt?(a=!0,u=s.error,s.error=null):c=!0,n===s)return void j(n,d())}else s=o,c=!0;n._state!==$||(i&&c?g(n,s):a?j(n,u):t===tt?S(n,s):t===et&&j(n,s))}function x(t,e){try{e(function(e){g(t,e)},function(e){j(t,e)})}catch(n){j(t,n)}}function C(){return rt++}function O(t){t[Z]=rt++,t._state=void 0,t._result=void 0,t._subscribers=[]}function k(){return new Error(\"Array Methods must be provided an Array\")}function F(t){return new ot(this,t).promise}function Y(t){var e=this;return new e(U(t)?function(n,r){for(var o=t.length,i=0;i<o;i++)e.resolve(t[i]).then(n,r)}:function(t,e){return e(new TypeError(\"You must pass an array to race.\"))})}function q(t){var e=this,n=new e(p);return j(n,t),n}function D(){throw new TypeError(\"You must pass a resolver function as the first argument to the promise constructor\")}function K(){throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\")}function L(){var t=void 0;if(\"undefined\"!=typeof global)t=global;else if(\"undefined\"!=typeof self)t=self;else try{t=Function(\"return this\")()}catch(e){throw new Error(\"polyfill failed because global object is unavailable in this environment\")}var n=t.Promise;if(n){var r=null;try{r=Object.prototype.toString.call(n.resolve())}catch(e){}if(\"[object Promise]\"===r&&!n.cast)return}t.Promise=it}var N=void 0;N=Array.isArray?Array.isArray:function(t){return\"[object Array]\"===Object.prototype.toString.call(t)};var U=N,W=0,z=void 0,B=void 0,G=function(t,e){V[W]=t,V[W+1]=e,W+=2,2===W&&(B?B(a):X())},H=\"undefined\"!=typeof window?window:void 0,I=H||{},J=I.MutationObserver||I.WebKitMutationObserver,Q=\"undefined\"==typeof self&&\"undefined\"!=typeof process&&\"[object process]\"==={}.toString.call(process),R=\"undefined\"!=typeof Uint8ClampedArray&&\"undefined\"!=typeof importScripts&&\"undefined\"!=typeof MessageChannel,V=new Array(1e3),X=void 0;X=Q?o():J?s():R?u():void 0===H&&\"function\"==typeof require?f():c();var Z=Math.random().toString(36).substring(2),$=void 0,tt=1,et=2,nt={error:null},rt=0,ot=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(p),this.promise[Z]||O(this.promise),U(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?S(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&S(this.promise,this._result))):j(this.promise,k())}return t.prototype._enumerate=function(t){for(var e=0;this._state===$&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===h){var o=_(t);if(o===l&&t._state!==$)this._settledAt(t._state,e,t._result);else if(\"function\"!=typeof o)this._remaining--,this._result[e]=t;else if(n===it){var i=new n(p);w(i,t,o),this._willSettleAt(i,e)}else this._willSettleAt(new n(function(e){return e(t)}),e)}else this._willSettleAt(r(t),e)},t.prototype._settledAt=function(t,e,n){var r=this.promise;r._state===$&&(this._remaining--,t===et?j(r,n):this._result[e]=n),0===this._remaining&&S(r,this._result)},t.prototype._willSettleAt=function(t,e){var n=this;E(t,void 0,function(t){return n._settledAt(tt,e,t)},function(t){return n._settledAt(et,e,t)})},t}(),it=function(){function t(e){this[Z]=C(),this._result=this._state=void 0,this._subscribers=[],p!==e&&(\"function\"!=typeof e&&D(),this instanceof t?x(this,e):K())}return t.prototype[\"catch\"]=function(t){return this.then(null,t)},t.prototype[\"finally\"]=function(t){var e=this,n=e.constructor;return e.then(function(e){return n.resolve(t()).then(function(){return e})},function(e){return n.resolve(t()).then(function(){throw e})})},t}();return it.prototype.then=l,it.all=F,it.race=Y,it.resolve=h,it.reject=q,it._setScheduler=n,it._setAsap=r,it._asap=G,it.polyfill=L,it.Promise=it,it.polyfill(),it});\n/**\n * Created by Sven Kluge on 27.06.2016.\n */\n\nif(x3dom.glTF == null)\n    x3dom.glTF = {};\n\nx3dom.glTF.glTFLoader = function(response, meshOnly)\n{\n    this.meshOnly = meshOnly;\n\n    this.header = this.readHeader(response);\n\n    if (this.header.sceneLength > 0) {\n        this.scene = this.readScene(response, this.header);\n        this.body = this.readBody(response, this.header);\n    }\n\n    this._mesh = {};\n};\n\nx3dom.glTF.glTFLoader.prototype.getScene = function(shape,shaderProgram, gl, sceneName)\n{\n    this.reset(shape,gl);\n\n    if(sceneName == null)\n    {\n        sceneName = this.scene[\"scene\"];\n\n    }\n    var scene = this.scene.scenes[sceneName];\n\n    this.updateScene(shape, shaderProgram, gl, scene);\n};\n\nx3dom.glTF.glTFLoader.prototype.getMesh = function(shape, shaderProgram, gl, meshName)\n{\n    this.reset(shape,gl);\n\n    var mesh;\n    if (meshName == null)\n    {\n        mesh = Object.keys(this.scene.meshes)[0];\n    } else\n    {\n        for(var key in this.scene.meshes){\n            if(this.scene.meshes.hasOwnProperty(key)\n                && key == meshName)\n            {\n                mesh = this.scene.meshes[key];\n                break;\n            }\n        }\n    }\n    this.updateMesh(shape, shaderProgram, gl, mesh, new x3dom.fields.SFMatrix4f());\n};\n\nx3dom.glTF.glTFLoader.prototype.reset = function(shape, gl)\n{\n    this._mesh._numCoords = 0;\n    this._mesh._numFaces = 0;\n\n    shape._webgl.externalGeometry = -1;\n\n    if(this.loaded.bufferViews==null)\n        this.loaded.bufferViews = this.loadBufferViews(shape, gl);\n};\n\nx3dom.glTF.glTFLoader.prototype.updateScene = function(shape, shaderProgram, gl, scene)\n{\n    var nodes = scene[\"nodes\"];\n\n    for(var i = 0; i<nodes.length;++i)\n    {\n        var nodeID = nodes[i];\n        var worldTransform = new x3dom.fields.SFMatrix4f(); // identity\n        this.traverseNode(shape, shaderProgram, gl, this.scene.nodes[nodeID], worldTransform);\n    }\n};\n\n\nx3dom.glTF.glTFLoader.prototype.traverseNode = function(shape, shaderProgram, gl, node, transform)\n{\n    var worldTransform = transform.mult(this.getTransform(node));\n    var children = node[\"children\"];\n    if(children != null)\n        for(var i = 0; i<children.length;++i)\n        {\n            var childID = children[i];\n            this.traverseNode(shape, shaderProgram, gl, this.scene.nodes[childID], worldTransform);\n        }\n\n    var meshes = node[\"meshes\"];\n    if(meshes != null && meshes.length > 0)\n        for (var i = 0; i < meshes.length; ++i) {\n            var meshID = meshes[i];\n            //if (this.loaded.meshes[meshID] == null)\n            {\n                this.updateMesh(shape, shaderProgram, gl, this.scene.meshes[meshID], worldTransform);\n                this.loaded.meshes[meshID] = 1;\n            }\n        }\n};\n\n\nx3dom.glTF.glTFLoader.prototype.getTransform = function (node) {\n    var transform = new x3dom.fields.SFMatrix4f();// start with identity\n    if ( node.matrix ) {\n        transform.setFromArray(node.matrix);\n        return transform;\n    }\n    if ( node.scale && node.scale.length == 3) {\n        var s = node.scale;\n        transform.setScale(new x3dom.fields.SFVec3f(s[0], s[1], s[2]));\n    }\n    if ( node.rotation && node.rotation.length == 4) {\n        var r = node.rotation;\n        var rotationMatrix = new x3dom.fields.SFMatrix4f();\n        rotationMatrix.setRotate(\n            new x3dom.fields.Quaternion(r[0], r[1], r[2], r[3]));\n        transform = rotationMatrix.mult(transform);\n    }\n    if ( node.translation && node.translation.length == 3 ) {\n        var t = node.translation;\n        var translationMatrix = x3dom.fields.SFMatrix4f.translation(\n            new x3dom.fields.SFVec3f(t[0], t[1], t[2]));\n        transform = translationMatrix.mult(transform);\n    }\n    return transform;\n};\n\nx3dom.glTF.glTFLoader.prototype.updateMesh = function(shape, shaderProgram, gl, mesh, worldTransform)\n{\n    var primitives = mesh[\"primitives\"];\n    for(var i = 0; i<primitives.length; ++i){\n        this.loadglTFMesh(shape, shaderProgram, gl, primitives[i], worldTransform);\n    }\n};\n\nx3dom.glTF.glTFLoader.prototype.loadPrimitive =  function(shape, shaderProgram, gl, primitive)\n{\n    var INDEX_BUFFER_IDX    = 0;\n    var POSITION_BUFFER_IDX = 1;\n    var NORMAL_BUFFER_IDX   = 2;\n    var TEXCOORD_BUFFER_IDX = 3;\n    var COLOR_BUFFER_IDX    = 4;\n\n    var x3domTypeID, x3domShortTypeID;\n\n    var meshIdx = this.loaded.meshCount;\n    var bufferOffset = meshIdx * 6;\n    shape._webgl.primType[meshIdx] = primitive[\"mode\"];\n\n    var indexed = (primitive.indices != null && primitive.indices != \"\");\n\n    if(indexed == true){\n        var indicesAccessor = this.scene.accessors[primitive.indices];\n\n        shape._webgl.indexOffset[meshIdx] = indicesAccessor[\"byteOffset\"];\n        shape._webgl.drawCount[meshIdx]   = indicesAccessor[\"count\"];\n\n        shape._webgl.buffers[INDEX_BUFFER_IDX + bufferOffset] =\n            this.loaded.bufferViews[indicesAccessor[\"bufferView\"]];\n\n        //TODO: add support for LINES and POINTS\n        this._mesh._numFaces += indicesAccessor[\"count\"] / 3;\n    }\n\n    var attributes = primitive[\"attributes\"];\n\n    for (var attributeID in attributes)\n    {\n        var accessorName = attributes[attributeID];\n        var accessor = this.scene.accessors[accessorName];\n\n        //the current renderer does not support generic vertex attributes, so simply look for useable cases\n        switch (attributeID)\n        {\n            case \"POSITION\":\n                x3domTypeID      = \"coord\";\n                x3domShortTypeID = \"Pos\";\n                shape._webgl.buffers[POSITION_BUFFER_IDX + bufferOffset] =\n                    this.loaded.bufferViews[accessor[\"bufferView\"]];\n                //for non-indexed rendering, we assume that all attributes have the same count\n                if (indexed == false)\n                {\n                    shape._webgl.drawCount[meshIdx] = accessor[\"count\"];\n                    //TODO: add support for LINES and POINTS\n                    this._mesh._numFaces += accessor[\"count\"] / 3;\n                }\n                this._mesh._numCoords += accessor[\"count\"];\n                break;\n\n            case \"NORMAL\":\n                x3domTypeID      = \"normal\";\n                x3domShortTypeID = \"Norm\";\n                shape._webgl.buffers[NORMAL_BUFFER_IDX + bufferOffset] =\n                    this.loaded.bufferViews[accessor[\"bufferView\"]];\n                break;\n\n            case \"TEXCOORD_0\":\n                x3domTypeID      = \"texCoord\";\n                x3domShortTypeID = \"Tex\";\n                shape._webgl.buffers[TEXCOORD_BUFFER_IDX + bufferOffset] =\n                    this.loaded.bufferViews[accessor[\"bufferView\"]];\n                break;\n\n            case \"COLOR\":\n                x3domTypeID      = \"color\";\n                x3domShortTypeID = \"Col\";\n                shape._webgl.buffers[COLOR_BUFFER_IDX + bufferOffset] =\n                    this.loaded.bufferViews[accessor[\"bufferView\"]];\n                break;\n        }\n\n        if(x3domTypeID != null){\n            shape[\"_\" + x3domTypeID + \"StrideOffset\"][meshIdx] = [];\n\n            shape[\"_\" + x3domTypeID + \"StrideOffset\"][meshIdx][0] = accessor[\"byteStride\"];\n            shape[\"_\" + x3domTypeID + \"StrideOffset\"][meshIdx][1] = accessor[\"byteOffset\"];\n            shape._webgl[x3domTypeID + \"Type\"]           = accessor[\"componentType\"];\n\n            this._mesh[\"_num\" + x3domShortTypeID + \"Components\"] = this.getNumComponentsForType(accessor[\"type\"]);\n        }\n    }\n\n    this.loaded.meshCount += 1;\n\n    shape._dirty.shader = true;\n    shape._nameSpace.doc.needRender = true;\n    x3dom.BinaryContainerLoader.checkError(gl);\n};\n\nx3dom.glTF.glTFLoader.prototype.loadglTFMesh =  function(shape, shaderProgram, gl, primitive, worldTransform)\n{\n    \"use strict\";\n\n    var mesh = new x3dom.glTF.glTFMesh();\n\n    mesh.primitiveType = primitive[\"mode\"];\n\n    var indexed = (primitive.indices != null && primitive.indices != \"\");\n\n    if(indexed == true){\n        var indicesAccessor = this.scene.accessors[primitive.indices];\n\n        mesh.buffers[glTF_BUFFER_IDX.INDEX] = {};\n        mesh.buffers[glTF_BUFFER_IDX.INDEX].offset = indicesAccessor[\"byteOffset\"];\n        mesh.buffers[glTF_BUFFER_IDX.INDEX].type =  indicesAccessor[\"componentType\"];\n        mesh.buffers[glTF_BUFFER_IDX.INDEX].idx = this.loaded.bufferViews[indicesAccessor[\"bufferView\"]];\n\n        mesh.drawCount = indicesAccessor[\"count\"];\n        this._mesh._numFaces += indicesAccessor[\"count\"] / 3;\n    }\n\n    var attributes = primitive[\"attributes\"];\n\n    for (var attributeID in attributes)\n    {\n        var accessorName = attributes[attributeID];\n        var accessor = this.scene.accessors[accessorName];\n\n        var idx = null;\n\n        //the current renderer does not support generic vertex attributes, so simply look for useable cases\n        switch (attributeID)\n        {\n            case \"POSITION\":\n                idx = glTF_BUFFER_IDX.POSITION;\n\n                //for non-indexed rendering, we assume that all attributes have the same count\n                if (indexed == false)\n                {\n                    mesh.drawCount = accessor[\"count\"];\n                    this._mesh._numFaces += accessor[\"count\"] / 3;\n                }\n                this._mesh.numCoords += accessor[\"count\"];\n                break;\n\n            case \"NORMAL\":\n                idx = glTF_BUFFER_IDX.NORMAL;\n                break;\n\n            case \"TEXCOORD_0\":\n                idx = glTF_BUFFER_IDX.TEXCOORD;\n                break;\n\n            case \"COLOR\":\n                idx = glTF_BUFFER_IDX.COLOR;\n                break;\n        }\n\n        if(idx != null){\n            mesh.buffers[idx] = {};\n            mesh.buffers[idx].idx = this.loaded.bufferViews[accessor[\"bufferView\"]];\n            mesh.buffers[idx].offset = accessor[\"byteOffset\"];\n            mesh.buffers[idx].stride = accessor[\"byteStride\"];\n\n            mesh.buffers[idx].type = accessor[\"componentType\"];\n            mesh.buffers[idx].numComponents = this.getNumComponentsForType(accessor[\"type\"]);\n        }\n    }\n\n    this.loaded.meshCount += 1;\n\n    shape._dirty.shader = true;\n    shape._nameSpace.doc.needRender = true;\n    x3dom.BinaryContainerLoader.checkError(gl);\n\n    if(primitive.material != null && !this.meshOnly) {\n        mesh.material = this.loadMaterial(gl, this.scene.materials[primitive.material]);\n        mesh.material.worldTransform = worldTransform;\n    }\n\n    if(shape.meshes == null)\n        shape.meshes = [];\n    shape.meshes.push(mesh);\n};\n\nx3dom.glTF.glTFLoader.prototype.loadBufferViews = function(shape, gl)\n{\n    var buffers = {};\n\n    var bufferViews = this.scene.bufferViews;\n    for(var bufferId in bufferViews)\n    {\n        if(!bufferViews.hasOwnProperty(bufferId)) continue;\n\n        var bufferView = bufferViews[bufferId];\n\n        // do not use Buffer for Skin or animation data\n        if(bufferView.target == null && bufferView.target != gl.ARRAY_BUFFER && bufferView.target != gl.ELEMENT_ARRAY_BUFFER)\n            continue;\n\n        shape._webgl.externalGeometry = 1;\n\n        var data = new Uint8Array(this.body.buffer,\n            this.header.bodyOffset + bufferView[\"byteOffset\"],\n            bufferView[\"byteLength\"]);\n\n        var newBuffer = gl.createBuffer();\n        gl.bindBuffer(bufferView[\"target\"], newBuffer);\n\n        //upload all chunk data to GPU\n        gl.bufferData(bufferView[\"target\"], data, gl.STATIC_DRAW);\n\n        buffers[bufferId] = newBuffer;\n    }\n\n\n\n    return buffers;\n};\n\nx3dom.glTF.glTFLoader.prototype.readHeader = function(response)\n{\n    var header = {};\n    var magicBytes = new Uint8Array(response, 0, 4);\n    var versionBytes = new Uint32Array(response, 4, 1);\n    var lengthBytes = new Uint32Array(response, 8, 1);\n    var sceneLengthBytes = new Uint32Array(response, 12, 1);\n    var sceneFormatBytes = new Uint32Array(response, 16, 1);\n\n    header.magic = new TextDecoder(\"ascii\").decode(magicBytes);\n    if(versionBytes[0] == 1)\n        header.version = \"Version 1\";\n\n    header.length = lengthBytes[0];\n    header.sceneLength = sceneLengthBytes[0];\n\n    if(sceneFormatBytes[0] == 0)\n        header.sceneFormat = \"JSON\";\n\n\n    header.bodyOffset = header.sceneLength + 20;\n\n    return header;\n};\n\nx3dom.glTF.glTFLoader.prototype.readScene = function(response,header)\n{\n    var sceneBytes = new Uint8Array(response, 20, header.sceneLength);\n\n    var json = JSON.parse(new TextDecoder(\"utf-8\").decode(sceneBytes));\n\n    return json;\n};\n\nx3dom.glTF.glTFLoader.prototype.readBody = function(response, header)\n{\n    var offset = header.sceneLength + 20;\n    var body = new Uint8Array(response, offset, header.length-offset);\n\n    return body;\n};\n\nx3dom.glTF.glTFLoader.prototype.getNumComponentsForType = function(type)\n{\n    switch (type)\n    {\n        case \"SCALAR\": return 1;\n        case \"VEC2\":   return 2;\n        case \"VEC3\":   return 3;\n        case \"VEC4\":   return 4;\n        default:       return 0;\n    }\n};\n\n\nx3dom.glTF.glTFLoader.prototype.loadImage = function(imageNodeName, mimeType)\n{\n    if(this.loaded.images == null)\n        this.loaded.images = {};\n\n    if(this.loaded.images[imageNodeName]!=null)\n        return this.loaded.images[imageNodeName];\n\n    var imageNode = this.scene.images[imageNodeName];\n    if (imageNode.extensions != null && imageNode.extensions.KHR_binary_glTF != null)\n    {\n        var ext = imageNode.extensions.KHR_binary_glTF;\n        var bufferView = this.scene.bufferViews[ext.bufferView];\n        var uint8Array = new Uint8Array(this.body.buffer, this.header.bodyOffset + bufferView.byteOffset, bufferView.byteLength);\n\n        var blob = new Blob([uint8Array], {\n            type : ext.mimeType\n        });\n        var blobUrl = window.URL.createObjectURL(blob);\n\n        var image = new Image();\n\n        image.src = blobUrl;\n\n        this.loaded.images[imageNodeName] = image;\n\n        return image;\n    }\n    //untested\n    if (imageNode.uri != null)\n    {\n        var image = new Image();\n\n        image.src = imageNode.uri;\n\n        this.loaded.images[imageNodeName] = image;\n\n        return image;\n    }\n\n    return null;\n};\n\nx3dom.glTF.glTFLoader.prototype.loadTexture = function(gl, textureNodeName)\n{\n    if(this.loaded.textures == null)\n        this.loaded.textures = {};\n\n    if(this.loaded.textures[textureNodeName]!=null)\n        return this.loaded.textures[textureNodeName];\n\n    var textureNode = this.scene.textures[textureNodeName];\n\n    var format = textureNode.format;\n    var internalFormat = textureNode.internalFormat;\n    var sampler = {};\n\n    var samplerNode = this.scene.samplers[textureNode.sampler];\n    if(samplerNode!=null)\n    {\n        for(var key in samplerNode){\n            if(samplerNode.hasOwnProperty(key))\n                sampler[key] = samplerNode[key];\n        }\n    }\n\n    var image = this.loadImage(textureNode.source);\n    var target = textureNode.target;\n    var type = textureNode.type;\n\n    var glTFTexture = new x3dom.glTF.glTFTexture(gl, format, internalFormat, sampler, target, type, image);\n\n    this.loaded.textures[textureNodeName] = glTFTexture;\n\n    return glTFTexture;\n};\n\nx3dom.glTF.glTFLoader.prototype.loadMaterial = function(gl, materialNode)\n{\n    if(materialNode){\n        if(materialNode.extensions != null && materialNode.extensions.KHR_materials_common != null)\n        {\n            materialNode = materialNode.extensions.KHR_materials_common;\n\n            var material = new x3dom.glTF.glTFKHRMaterialCommons();\n\n            material.technique = glTF_KHR_MATERIAL_COMMON_TECHNIQUE[materialNode.technique];\n            material.doubleSided = materialNode.doubleSided;\n\n            for(var key in materialNode.values)\n                if(materialNode.values.hasOwnProperty(key))\n                {\n                    var value = materialNode.values[key];\n                    if(typeof value === 'string')\n                    {\n                        material[key+\"Tex\"] = this.loadTexture(gl, value);\n                    }\n                    else\n                    {\n                        material[key] = value;\n                    }\n                }\n\n            return material;\n        }else\n        {\n            var technique = this.scene.techniques[materialNode.technique];\n            var program = this.loadShaderProgram(gl, technique.program);\n\n            var material = new x3dom.glTF.glTFMaterial(technique);\n            material.program = program;\n\n            for(var key in technique.parameters) {\n                if (!technique.parameters.hasOwnProperty(key)) continue;\n\n                var parameter = technique.parameters[key];\n                if(parameter.value != null){\n                    material.values[key] = parameter.value;\n                }\n            }\n\n            for(var key in materialNode.values)\n                if(materialNode.values.hasOwnProperty(key))\n                {\n                    var value = materialNode.values[key];\n                    if(typeof value === 'string')\n                    {\n                        material.textures[key] = this.loadTexture(gl, value);\n                    }\n                    else\n                    {\n                        material.values[key] = value;\n                    }\n                }\n\n            return material;\n        }\n    }\n\n    return new x3dom.glTF.glTFKHRMaterialCommons();\n};\n\nx3dom.glTF.glTFLoader.prototype.loadShaderProgram = function(gl, shaderProgramName)\n{\n    if(this.loaded.programs == null)\n        this.loaded.programs = {};\n\n    if(this.loaded.programs[shaderProgramName] != null)\n        return this.loaded.programs[shaderProgramName];\n\n    var shaderProgramNode = this.scene.programs[shaderProgramName];\n\n    var vertexShaderNode = this.scene.shaders[shaderProgramNode.vertexShader];\n    var vertexShaderSrc = this._loadShaderSource(vertexShaderNode);\n\n    var fragmentShaderNode = this.scene.shaders[shaderProgramNode.fragmentShader];\n    var fragmentShaderSrc = this._loadShaderSource(fragmentShaderNode);\n\n    var program = gl.createProgram();\n\n    var vertexShader = gl.createShader(gl.VERTEX_SHADER);\n    gl.shaderSource(vertexShader, vertexShaderSrc);\n    gl.compileShader(vertexShader);\n\n    if(!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)){\n        x3dom.debug.logError(\"[glTF binary] VertexShader \" + gl.getShaderInfoLog(vertexShader));\n    }\n\n    var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n    gl.shaderSource(fragmentShader, fragmentShaderSrc);\n    gl.compileShader(fragmentShader);\n\n    if(!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)){\n        x3dom.debug.logError(\"[glTF binary] FragmentShader \" + gl.getShaderInfoLog(fragmentShader));\n    }\n\n    gl.attachShader(program, vertexShader);\n    gl.attachShader(program, fragmentShader);\n\n    // optional, but position should be at location 0 for performance reasons\n    gl.bindAttribLocation(program, 0, \"position\");\n\n    gl.linkProgram(program);\n\n    var program = x3dom.Utils.wrapProgram(gl, program);\n\n    this.loaded.programs[shaderProgramName] = program;\n\n    return program;\n};\n\nx3dom.glTF.glTFLoader.prototype._loadShaderSource = function(shaderNode)\n{\n    if(shaderNode.extensions != null && shaderNode.extensions.KHR_binary_glTF != null)\n    {\n        var bufferView = this.scene.bufferViews[shaderNode.extensions.KHR_binary_glTF.bufferView];\n\n        var shaderBytes = new Uint8Array(this.body.buffer, this.header.bodyOffset+bufferView.byteOffset, bufferView.byteLength);\n        var src = new TextDecoder(\"ascii\").decode(shaderBytes);\n        return src;\n    }\n    else\n    {\n        var dataURL = /^data\\:([^]*?)(?:;([^]*?))?(;base64)?,([^]*)$/;\n        var result = dataURL .exec (shaderNode.uri);\n        if (result)\n        {\n            //var mimeType = result [1];\n            var data = result [4];\n\n            if (result [2] === \"base64\")\n                data = atob (data);\n            else\n                data = unescape (data);\n\n            return data;\n        }\n        x3dom.debug.logError('no shader found');\n    }\n};\n\n/**\n *\n * @param {Object} gltf\n * @param {NodeNameSpace} nameSpace\n */\nx3dom.glTF2Loader = function(nameSpace)\n{\n    this._nameSpace = nameSpace;\n    this._definitions = {};\n}\n\n/**\n * Starts the loading/parsing of the glTF-Object\n * @param {Object} gltf\n */\nx3dom.glTF2Loader.prototype.load = function(input, binary)\n{\n    this._gltf = this._getGLTF(input, binary);\n\n    //generate X3D scene\n    var x3dScene = this._generateX3DScene();\n    \n    //Get the scene ID\n    var sceneID = this._gltf.scene || 0;\n\n    //Get the scene\n    var scene = this._gltf.scenes[ sceneID ];\n    \n    //generate worldinfo from asset properties and extras\n    this._generateX3DWorldInfo(scene, x3dScene);\n\n    // Get the nodes\n    for( var i = 0; i < scene.nodes.length; i++ )\n    {\n        var node = this._gltf.nodes[ scene.nodes[ i ] ];\n\n        this._traverseNodes(node, x3dScene, scene.nodes[ i ] );\n    }\n\n    //Get the animations\n    if ( this._gltf.animations )\n    { \n        for( var i = 0; i < this._gltf.animations.length; i++)\n        {\n            var animation   = this._gltf.animations[i];\n            var animationID = \"glTF_ANIMATION_\" + i;\n\n            this._generateX3DAnimationNodes( x3dScene, animation, animationID );  \n        }\n    }\n\n    return x3dScene;\n};\n\n/**\n * extract asset properties, extras and append as WorldInfo, metadata\n * @param {Object} scene - A gltf scene node\n * @param {X3DNode} parent - A X3D-Node\n */\nx3dom.glTF2Loader.prototype._generateX3DWorldInfo = function(scene, parent)\n{\n    \n    if (this._gltf.asset) //should always exist\n    {\n        var asset = this._gltf.asset;\n        var assetProperties = ['copyright', 'generator', 'version', 'minversion'];\n        var worldInfo = document.createElement(\"worldinfo\");\n\n        var info = new x3dom.fields.MFString();\n        var property, i;\n        for(i = 0; i < assetProperties.length; i++)\n        {\n            property = assetProperties[i];\n            if (asset[property]) {\n                info.push('\"' + assetProperties[i] + \":\" + asset[property] + '\"');  //toString() does not put in quotes\n            }\n        }\n        worldInfo.setAttribute('info', info.toString());\n        \n        if (asset.extras && asset.extras.title)\n        {\n            worldInfo.setAttribute('title', asset.extras.title);\n        }\n        \n        //need holder for both asset and scene extras\n        var metadata = document.createElement('MetadataSet');\n        metadata.setAttribute('name', 'global');\n        metadata.setAttribute('containerfield', 'metadata');\n        \n        this._generateX3DMetadata(asset, metadata, \"asset_extras\", \"value\");\n        this._generateX3DMetadata(scene, metadata, \"scene_extras\", \"value\");\n        \n        if (metadata.hasChildNodes()) { worldInfo.appendChild(metadata); }\n        \n        parent.appendChild(worldInfo);\n    }\n};\n\n/**\n * append metadata nodes from extras\n * @param {Object} node - A glTF node with extras\n * @param {X3DNode} parent - A X3D-Node\n * @param {X3DNode} name - name for name field\n */\nx3dom.glTF2Loader.prototype._generateX3DMetadata = function(node, parent, name, containerfield)\n{\n    if (!node.extras) { return; }\n    \n    name = name || \"extras\";\n    containerfield = containerfield || \"metadata\";\n    \n    var metadata = _generateMetadata (name, node.extras, containerfield);\n    \n    parent.appendChild(metadata);\n    \n    return;\n    \n    function _generateMetadata (name, value, cf) {\n        \n        var type = typeof value;\n\n        if (type == 'string' || value === null || type == 'undefined')\n        {\n            return _generateX3DMetadataNode('MetadataString', name, JSON.stringify(value), cf);\n        }\n        else if (type == 'number')  { return _generateX3DMetadataNode('MetadataFloat', name, value, cf); }\n        else if (type == 'boolean') { return _generateX3DMetadataNode('MetadataBoolean', name, value, cf); }\n        else if (type == 'object')  { return _generateX3DMetadataSetNode(name, value, cf); }\n        return _generateX3DMetadataNode('MetadataString', name, value, cf); // should never happen\n    }\n    \n    function _generateX3DMetadataNode (nodename, name, value, cf) {\n        var x3dnode = document.createElement(nodename);\n        x3dnode.setAttribute('name', name);\n        x3dnode.setAttribute('value', value);\n        x3dnode.setAttribute('containerfield', cf);\n        return x3dnode;\n    }\n    \n    function _generateX3DMetadataSetNode (name, value, cf) {\n        var x3dnode = document.createElement('MetadataSet');\n        x3dnode.setAttribute('name', name);\n        x3dnode.setAttribute('containerfield', cf);\n        var keys = Object.keys(value), key, i;\n        for (i=0; i < keys.length; i++)\n        {\n            key = keys[i];\n            x3dnode.appendChild( _generateMetadata(key, value[key], \"value\") );\n        }\n        return x3dnode;\n     }\n};\n/**\n * Traverses all glTF nodes\n * @param {Object} node - A glTF-Node\n * @param {X3DNode} parent - A X3D-Node\n */\nx3dom.glTF2Loader.prototype._traverseNodes = function(node, parent, index)\n{\n    var x3dNode = this._generateX3DNode(node, index);\n\n    parent.appendChild(x3dNode);\n\n    if (node.children)\n    {\n        for(var i = 0; i < node.children.length; i++)\n        {\n            var child = this._gltf.nodes[ node.children[i] ];\n\n            this._traverseNodes(child, x3dNode, node.children[i]);\n        }\n    }\n};\n\n/**\n * Generates a X3D node from a glTF node\n * @param {Object} node - A glTF-Node\n */\nx3dom.glTF2Loader.prototype._generateX3DNode = function(node, index)\n{\n    var x3dNode;\n    \n    node.name = (node.name) ? node.name : index;\n\n    if( node.matrix != undefined )\n    {\n        x3dNode = this._generateX3DMatrixTransform(node);\n    }\n    else if( node.translation != undefined ||\n             node.rotation    != undefined ||\n             node.scale       != undefined)\n    {\n        x3dNode = this._generateX3DTransform(node);\n    }\n    else\n    {\n        x3dNode = this._generateX3DTransform(node); // always use Transform in case of animations\n    }\n    \n    this._generateX3DMetadata(node, x3dNode);\n    \n    if( node.mesh != undefined )\n    {\n        var mesh = this._gltf.meshes[node.mesh];\n\n        for( var i = 0; i < mesh.primitives.length; i++ )\n        {\n            x3dNode.appendChild(this._generateX3DShape(mesh.primitives[i]));\n        }\n    }\n\n    if( node.model != undefined )\n    {\n        var model = this._gltf.models[node.model];\n\n        if ( model.uri != undefined )\n        {\n            x3dNode.appendChild(this._generateX3DInline(model));\n        }\n    }\n\n    if( node.camera != undefined )\n    {\n        x3dNode.appendChild(this._generateX3DViewpoint(node));\n    }\n\n    return x3dNode;\n};\n\n/**\n * Generates a X3D scene node\n */\nx3dom.glTF2Loader.prototype._generateX3DScene = function()\n{\n    var scene = document.createElement( \"scene\" );\n\n    return scene;\n};\n\n/**\n * Generates a X3D transform node\n * @param {Object} node - A glTF-Node\n */\nx3dom.glTF2Loader.prototype._generateX3DTransform = function(node)\n{\n    var transform = document.createElement(\"transform\");\n\n    if( node.translation != undefined )\n    {\n        transform.setAttribute(\"translation\", node.translation.join(\" \"));\n    }\n\n    if( node.rotation != undefined )\n    {\n        transform.setAttribute(\"rotation\", this._toAxisAngle(node.rotation).join(\" \"));\n    }\n\n    if( node.scale != undefined )\n    {\n        transform.setAttribute(\"scale\", node.scale.join(\" \"));\n    }\n\n    if( node.name != undefined )\n    {\n        transform.setAttribute( \"DEF\", \"glTF_NODE_\" + node.name );\n    }\n\n    return transform;\n};\n\n/**\n * Generates a X3D matrix transform node\n * @param {Object} node - A glTF-Node\n * @return {MatrixTransform}\n */\nx3dom.glTF2Loader.prototype._generateX3DMatrixTransform = function(node)\n{\n    var matrixTransform = document.createElement(\"matrixtransform\");\n\n    if( node.matrix != undefined )\n    {\n        matrixTransform.setAttribute(\"matrix\", node.matrix.join(\" \") );\n    }\n\n    if( node.name != undefined )\n    {\n        matrixTransform.setAttribute( \"DEF\", \"glTF_NODE_\" + node.name );\n    }\n\n    return matrixTransform;\n};\n\n/**\n * Generates a X3D group node\n * @param {Object} node - A glTF-Node\n * @return {Group}\n */\nx3dom.glTF2Loader.prototype._generateX3DGroup = function(node)\n{\n    return document.createElement(\"group\");\n};\n\n/**\n * Generates a X3D inline node\n * @param {Object} model - A glTF-Model\n * @return {Group}\n */\nx3dom.glTF2Loader.prototype._generateX3DInline = function(model)\n{\n    var inline =  document.createElement(\"inline\");\n\n    inline.setAttribute(\"url\", model.uri);\n\n    if ( model.mimeType != undefined )\n    {\n        inline.setAttribute(\"contentType\", model.mimeType);\n    }\n\n    return inline;\n};\n\n/**\n * Generates a X3D viewpoint or orthoviepoint node\n * @private\n * @param {Object} camera - A glTF camera node\n * @return {Viewpoint}\n */\nx3dom.glTF2Loader.prototype._generateX3DViewpoint = function(node)\n{\n    var camera = this._gltf.cameras[node.camera];\n    var cameraID = \"glTF_CAMERA_\" + node.camera;\n\n    switch(camera.type)\n    {\n        case \"orthographic\":\n            return this._generateX3DOrthoViewpoint(cameraID, camera.orthographic);\n        case \"perspective\":\n            return this._generateX3DPerspectiveViewpoint(cameraID, camera.perspective);\n        default:\n            return this._generateX3DPerspectiveViewpoint(cameraID, camera.perspective);\n    }\n};\n\n/**\n * Generates a X3D viewpoint node\n * @private\n * @param {Object} camera - A glTF camera node\n * @return {Viewpoint}\n */\nx3dom.glTF2Loader.prototype._generateX3DPerspectiveViewpoint = function(id, camera)\n{\n    var viewpoint = document.createElement(\"viewpoint\");\n    \n    this._generateX3DMetadata(camera, viewpoint);\n\n    var fov   = camera.yfov  || 0.785398;\n    var znear = camera.znear || -1;\n    var zfar  = camera.zfar  || -1;\n    \n    var _zratio = 100000;\n    if ( zfar / znear > _zratio) { zfar = znear = -1; }\n\n    viewpoint.setAttribute(\"DEF\", id);\n    viewpoint.setAttribute(\"fieldOfView\", fov);\n    viewpoint.setAttribute(\"zNear\", znear);\n    viewpoint.setAttribute(\"zFar\", zfar);\n    viewpoint.setAttribute(\"position\", \"0 0 0\");\n\n    return viewpoint;\n};\n\n/**\n * Generates a X3D orthoviewpoint node\n * @private\n * @param {Object} camera - A glTF camera node\n * @return {OrthoViewpoint}\n */\nx3dom.glTF2Loader.prototype._generateX3DOrthoViewpoint = function(id, camera)\n{\n    var viewpoint = document.createElement(\"orthoviewpoint\");\n    \n    this._generateX3DMetadata(camera, viewpoint);\n\n    var xmag  = camera.xmag  ||  1;\n    var ymag  = camera.ymag  ||  1;\n    var znear = camera.znear || -1;\n    var zfar  = camera.zfar  || -1;\n    var fov   = [-xmag, -ymag, xmag, ymag];\n\n    viewpoint.setAttribute(\"DEF\", id);\n    viewpoint.setAttribute(\"fieldOfView\", fov);\n    viewpoint.setAttribute(\"zNear\", znear);\n    viewpoint.setAttribute(\"zFar\", zfar);\n    viewpoint.setAttribute(\"position\", \"0 0 0\");\n\n    return viewpoint;\n};\n\n/**\n * Generates a X3D shape node\n * @private\n * @param {Object} primitive - A glTF primitive node\n * @return {Shape}\n */\nx3dom.glTF2Loader.prototype._generateX3DShape = function(primitive)\n{\n    var shape = document.createElement(\"shape\");\n    \n    this._generateX3DMetadata(primitive, shape);\n\n    var material = (primitive.material != undefined) ? this._gltf.materials[ primitive.material ] : {};\n\n    shape.appendChild(this._generateX3DAppearance( material ));\n\n    shape.appendChild(this._generateX3DBufferGeometry(primitive));\n\n    return shape;\n};\n\n/**\n * Generates a X3D appearance node\n * @private\n * @param {Object} primitive - A glTF material node\n * @return {Appearance}\n */\nx3dom.glTF2Loader.prototype._generateX3DAppearance = function(material)\n{\n    var appearance = document.createElement(\"appearance\");\n    \n    this._generateX3DMetadata(material, appearance);\n\n    if(material.alphaMode === \"BLEND\")\n    {\n        appearance.setAttribute(\"sortType\", \"transparent\");\n    }\n    else\n    {\n        appearance.setAttribute(\"sortType\", \"opaque\");\n    }\n\n    appearance.appendChild(this._generateX3DPhysicalMaterial(material));\n\n    if(this._textureTransform)\n    {\n        appearance.appendChild(this._textureTransform);\n        this._textureTransform = undefined;\n    }\n\n    return appearance;\n};\n\nx3dom.glTF2Loader.prototype._generateX3DPhysicalMaterial = function(material)\n{\n    var mat = document.createElement(\"physicalmaterial\");\n\n    if( this._USEorDEF( mat, \"glTF_MATERIAL_\" + material.name ) )\n    {\n        return mat;\n    }\n\n    var texture;\n    var baseColorFactor   = [1,1,1,1];\n    var emissiveFactor    = material.emissiveFactor || [0,0,0];\n    var metallicFactor    = 1;\n    var roughnessFactor   = 1;\n    var alphaMode         = material.alphaMode || \"OPAQUE\";\n    var alphaCutoff       = material.alphaCutoff || 0.5;\n    var seperateOcclusion = true\n    var model             = undefined;\n    var pbr               = undefined;\n    var channel           = 0;  \n    var transform;\n\n    if( material.pbrMetallicRoughness )\n    {\n        pbr = material.pbrMetallicRoughness;\n        model = \"roughnessMetallic\";\n    }\n    else if(material.extensions && material.extensions.KHR_materials_pbrSpecularGlossiness)\n    {\n        pbr = material.extensions.KHR_materials_pbrSpecularGlossiness;\n        model = \"specularGlossiness\";\n    }\n\n    if( model == \"roughnessMetallic\" )\n    {\n        var baseColorFactor = pbr.baseColorFactor || [1,1,1,1];\n        var metallicFactor  = (pbr.metallicFactor  != undefined) ? pbr.metallicFactor  : 1;\n        var roughnessFactor = (pbr.roughnessFactor != undefined) ? pbr.roughnessFactor : 1;\n\n        if(pbr.baseColorTexture)\n        {\n            channel = (pbr.baseColorTexture.texCoord) ? 1 : 0;\n            texture = this._gltf.textures[pbr.baseColorTexture.index];\n            transform = (pbr.baseColorTexture.extensions && pbr.baseColorTexture.extensions.KHR_texture_transform) ? \n                         pbr.baseColorTexture.extensions.KHR_texture_transform : undefined;\n            mat.appendChild(this._generateX3DImageTexture(texture, \"baseColorTexture\", channel, transform));\n        }\n\n        if(pbr.metallicRoughnessTexture)\n        {\n            channel = (pbr.metallicRoughnessTexture.texCoord) ? 1 : 0;\n            texture = this._gltf.textures[pbr.metallicRoughnessTexture.index];\n            transform = (pbr.metallicRoughnessTexture.extensions && pbr.metallicRoughnessTexture.extensions.KHR_texture_transform) ? \n                         pbr.metallicRoughnessTexture.extensions.KHR_texture_transform : undefined;\n\n            if( material.occlusionTexture && material.occlusionTexture.index == pbr.metallicRoughnessTexture.index)\n            {\n                seperateOcclusion = false;        \n                mat.appendChild(this._generateX3DImageTexture(texture, \"occlusionRoughnessMetallicTexture\", channel, transform));\n            }\n            else\n            {\n                mat.appendChild(this._generateX3DImageTexture(texture, \"roughnessMetallicTexture\", channel, transform));\n            }\n        }\n\n        mat.setAttribute(\"baseColorFactor\", baseColorFactor.join(\" \"));\n        mat.setAttribute(\"metallicFactor\",  metallicFactor);\n        mat.setAttribute(\"roughnessFactor\", roughnessFactor);\n    }\n    else if ( model == \"specularGlossiness\" )\n    {\n        var diffuseFactor    = pbr.diffuseFactor || [ 1, 1, 1, 1 ];\n        var specularFactor   = pbr.specularFactor || [ 1, 1, 1 ];\n        var glossinessFactor = (pbr.glossinessFactor != undefined) ? pbr.glossinessFactor : 1;\n\n        if ( pbr.diffuseTexture )\n        {\n            channel = (pbr.diffuseTexture.texCoord) ? 1 : 0;\n            texture = this._gltf.textures[pbr.diffuseTexture.index];\n            transform = (pbr.diffuseTexture.extensions && pbr.diffuseTexture.extensions.KHR_texture_transform) ? \n                         pbr.diffuseTexture.extensions.KHR_texture_transform : undefined;\n            mat.appendChild(this._generateX3DImageTexture(texture, \"baseColorTexture\", channel, transform));\n        }\n\n        if ( pbr.specularGlossinessTexture )\n        {\n            channel = (pbr.specularGlossinessTexture.texCoord) ? 1 : 0;\n            texture = this._gltf.textures[pbr.specularGlossinessTexture.index];\n            transform = (pbr.specularGlossinessTexture.extensions && pbr.specularGlossinessTexture.extensions.KHR_texture_transform) ? \n                         pbr.specularGlossinessTexture.extensions.KHR_texture_transform : undefined;\n            mat.appendChild(this._generateX3DImageTexture(texture, \"specularGlossinessTexture\", channel, transform));\n        }\n\n        mat.setAttribute(\"diffuseFactor\", diffuseFactor.join(\" \"));\n        mat.setAttribute(\"specularFactor\",  specularFactor.join(\" \"));\n        mat.setAttribute(\"glossinessFactor\", glossinessFactor);\n    }\n\n    if(material.normalTexture)\n    {\n        channel = (material.normalTexture.texCoord) ? 1 : 0;\n        texture = this._gltf.textures[material.normalTexture.index];\n        transform = (material.normalTexture.extensions && material.normalTexture.extensions.KHR_texture_transform) ? \n                     material.normalTexture.extensions.KHR_texture_transform : undefined;\n        mat.appendChild(this._generateX3DImageTexture(texture, \"normalTexture\", channel, transform));\n    }\n\n    if(material.emissiveTexture)\n    {\n        channel = (material.emissiveTexture.texCoord) ? 1 : 0;\n        texture = this._gltf.textures[material.emissiveTexture.index];\n        transform = (material.emissiveTexture.extensions && material.emissiveTexture.extensions.KHR_texture_transform) ? \n                     material.emissiveTexture.extensions.KHR_texture_transform : undefined;\n        mat.appendChild(this._generateX3DImageTexture(texture, \"emissiveTexture\", channel, transform));\n    }\n\n    if(material.occlusionTexture && seperateOcclusion)\n    {\n        channel = (material.occlusionTexture.texCoord) ? 1 : 0;\n        texture = this._gltf.textures[material.occlusionTexture.index];\n        transform = (material.occlusionTexture.extensions && material.occlusionTexture.extensions.KHR_texture_transform) ? \n                     material.occlusionTexture.extensions.KHR_texture_transform : undefined;\n        mat.appendChild(this._generateX3DImageTexture(texture, \"occlusionTexture\", channel, transform));\n    }\n\n    if(material.extensions && material.extensions.KHR_materials_unlit)\n    {\n        mat.setAttribute(\"unlit\", true);\n    }\n\n    mat.setAttribute(\"emissiveFactor\",  emissiveFactor.join(\" \"));\n    mat.setAttribute(\"alphaMode\",  alphaMode);\n    mat.setAttribute(\"alphaCutoff\", alphaCutoff);\n    mat.setAttribute(\"model\", model);\n\n    return mat;\n};\n\n/**\n * Generates a X3D image texture node\n * @private\n * @param {Object} image - A glTF image node\n * @return {Imagetexture}\n */\nx3dom.glTF2Loader.prototype._generateX3DImageTexture = function(texture, containerField, channel, transform)\n{\n    var image   = this._gltf.images[texture.source];\n\n    var imagetexture = document.createElement(\"imagetexture\");\n    \n    this._generateX3DMetadata(texture, imagetexture);\n\n    imagetexture.setAttribute(\"origChannelCount\", \"2\");\n    imagetexture.setAttribute(\"flipY\", \"true\");\n\n    if(containerField)\n    {\n        imagetexture.setAttribute(\"containerField\", containerField);\n    }\n\n    if(image.uri != undefined)\n    {\n        imagetexture.setAttribute(\"url\", x3dom.Utils.dataURIToObjectURL(image.uri));\n    }\n\n    if(texture.sampler != undefined)\n    {\n        var sampler = this._gltf.samplers[texture.sampler];\n        imagetexture.appendChild(this._createX3DTextureProperties(sampler));\n    }\n\n    if(channel)\n    {\n        imagetexture.setAttribute(\"channel\", \"1\");\n    }\n\n    if(transform)\n    {\n        this._textureTransform = this._createX3DTextureTransform(imagetexture, transform);\n    }\n\n    return imagetexture;\n};\n\n/**\n * Generates a X3D TextureProperties node\n * @private\n * @param {Object} primitive - A glTF sampler node\n * @return {TextureProperties}\n */\nx3dom.glTF2Loader.prototype._createX3DTextureProperties = function(sampler)\n{\n    var textureproperties = document.createElement(\"textureproperties\");\n\n    textureproperties.setAttribute(\"boundaryModeS\", x3dom.Utils.boundaryModesDicX3D(sampler.wrapS));\n    textureproperties.setAttribute(\"boundaryModeT\", x3dom.Utils.boundaryModesDicX3D(sampler.wrapT));\n\n    textureproperties.setAttribute(\"magnificationFilter\", x3dom.Utils.magFilterDicX3D(sampler.magFilter));\n    textureproperties.setAttribute(\"minificationFilter\",  x3dom.Utils.minFilterDicX3D(sampler.minFilter));\n\n    if(sampler.minFilter == undefined || (sampler.minFilter >= 9984 && sampler.minFilter <= 9987) )\n    {\n        textureproperties.setAttribute(\"generateMipMaps\", \"true\");\n    }\n\n    return textureproperties;\n};\n\n/**\n * Generates a X3D TextureTransform node\n * @private\n * @param {Object} transform - A glTF texture transform node\n * @return {TextureTransform}\n */\nx3dom.glTF2Loader.prototype._createX3DTextureTransform = function(imagetexture, transform)\n{\n    var texturetransform = document.createElement(\"matrixtexturetransform\");\n\n    var offset   = transform.offset || [0, 0];\n    var rotation = transform.rotation || 0;\n    var scale    = transform.scale || [1, 1] ;\n    // var center = transform.center || [0 0] ;\n\n    var negCenter = new x3dom.fields.SFVec3f(-0, -0, 0); // in case of a future gltf pivot\n    var posCenter = new x3dom.fields.SFVec3f(0, 0, 0);\n    var trans3 = new x3dom.fields.SFVec3f(offset[0], offset[1], 0);\n    var scale3 = new x3dom.fields.SFVec3f(scale[0], scale[1], 0);\n\n    var trafo = \n        x3dom.fields.SFMatrix4f.translation(posCenter.add(trans3)).\n        mult(x3dom.fields.SFMatrix4f.rotationZ(rotation * -1.0)).\n        mult(x3dom.fields.SFMatrix4f.scale(scale3)).\n        mult(x3dom.fields.SFMatrix4f.translation(negCenter)); // center is not used in gltf\n    \n    texturetransform.setAttribute(\"matrix\", trafo.toString());     \n    \n    if(transform.texCoord)\n    {\n        imagetexture.setAttribute(\"channel\", texCoord);\n    }\n    \n    return texturetransform;\n};\n\n/**\n * Generates a X3D BufferGeometry node\n * @private\n * @param {Object} primitive - A glTF primitive node\n * @return {BufferGeometry}\n */\nx3dom.glTF2Loader.prototype._generateX3DBufferGeometry = function(primitive)\n{\n    var views = [];\n    var bufferGeometry = document.createElement(\"buffergeometry\");\n    var centerAndSize = this._getCenterAndSize(primitive);\n\n    bufferGeometry.setAttribute(\"buffer\", this._bufferURI(primitive));\n    bufferGeometry.setAttribute(\"position\", centerAndSize.center.join( \" \" ));\n    bufferGeometry.setAttribute(\"size\", centerAndSize.size.join( \" \" ));\n    bufferGeometry.setAttribute(\"vertexCount\", this._getVertexCount(primitive));\n    bufferGeometry.setAttribute(\"primType\", this._primitiveType(primitive.mode));\n\n    //Check Material for double sided rendering\n    if(primitive.material != undefined)\n    {\n        var material = this._gltf.materials[ primitive.material ];\n\n        if(material.doubleSided)\n        {\n            bufferGeometry.setAttribute(\"solid\", \"false\");\n        }\n    }\n\n    //Check for indices\n    if(primitive.indices != undefined)\n    {\n        var accessor = this._gltf.accessors[primitive.indices];\n\n        var view = this._gltf.bufferViews[accessor.bufferView];\n        view.id = accessor.bufferView;\n        view.target = 34963;\n\n        var viewID = views.indexOf(view)\n\n        if(view.target != undefined && viewID == -1)\n        {\n            viewID = views.push(view) - 1;\n        }\n\n        bufferGeometry.appendChild( this._generateX3DBufferAccessor(\"INDEX\", accessor, viewID) );\n    }\n\n    for(var attribute in primitive.attributes)\n    {\n        var accessor = this._gltf.accessors[ primitive.attributes[attribute] ];\n\n        var view = this._gltf.bufferViews[accessor.bufferView];\n        view.target = 34962;\n        view.id = accessor.bufferView;\n\n        var viewID = views.indexOf(view)\n\n        if(view.target != undefined && viewID == -1)\n        {\n            viewID = views.push(view) - 1;\n        }\n\n        bufferGeometry.appendChild( this._generateX3DBufferAccessor(attribute, accessor, viewID) );\n    }\n\n    for(var i = 0; i < views.length; i++)\n    {\n        bufferGeometry.appendChild(this._generateX3DBufferView(views[i]));\n    }\n\n    return bufferGeometry;\n}\n\nx3dom.glTF2Loader.prototype._generateX3DBufferView = function(view)\n{\n    var bufferView = document.createElement( \"bufferview\" );\n\n    bufferView.setAttribute(\"target\",     view.target);\n    bufferView.setAttribute(\"byteOffset\", view.byteOffset || 0);\n    bufferView.setAttribute(\"byteLength\", view.byteLength);\n    bufferView.setAttribute(\"id\", view.id);\n\n    return bufferView;\n};\n\nx3dom.glTF2Loader.prototype._generateX3DBufferAccessor = function(buffer, accessor, viewID)\n{\n    var components = this._componentsOf(accessor.type);\n\n    var bufferView = this._gltf.bufferViews[accessor.bufferView];\n\n    var byteOffset = accessor.byteOffset;\n\n    var bufferAccessor = document.createElement( \"bufferaccessor\" );\n\n    bufferAccessor.setAttribute(\"bufferType\", buffer.replace(\"_0\", \"\"));\n    bufferAccessor.setAttribute(\"view\", viewID);\n    bufferAccessor.setAttribute(\"byteOffset\", byteOffset || 0);\n    bufferAccessor.setAttribute(\"byteStride\", bufferView.byteStride || 0);\n    bufferAccessor.setAttribute(\"normalized\", accessor.normalized || false);\n\n    bufferAccessor.setAttribute(\"components\", components);\n    bufferAccessor.setAttribute(\"componentType\", accessor.componentType);\n    bufferAccessor.setAttribute(\"count\", accessor.count);\n\n    return bufferAccessor;\n};\n\n/**\n * generate necessary animation nodes\n * @param {X3DNode} x3dScene - A X3D-Node\n * @param {Node} animation - animatio node\n * @param {Number} a_i - animation index\n */\nx3dom.glTF2Loader.prototype._generateX3DAnimationNodes = function(x3dScene, animation, animationID)\n{\n    var duration     = this._animationDuration( animation );\n    var timeSensorID = animationID + \"_TIMESENSOR\";\n    \n    x3dScene.appendChild(this._generateX3DTimeSensor(timeSensorID, duration));\n    \n    for(var i = 0; i < animation.channels.length; i++)\n    {\n        var channel        = animation.channels[i];\n        var path           = channel.target.path;\n        var node           = channel.target.node;  \n        var sampler        = animation.samplers[channel.sampler];\n        var targetID       = \"glTF_NODE_\" + this._gltf.nodes[node].name;\n        var interpolatorID = animationID + \"_INTERPOLATOR_\" + i;\n\n        x3dScene.appendChild(this._generateX3DInterpolator(interpolatorID,\n                                                           path,\n                                                           sampler,\n                                                           duration));\n\n        x3dScene.appendChild(this._createX3DRoute(\"fraction_changed\", \n                                                  timeSensorID,\n                                                  \"set_fraction\",\n                                                  interpolatorID));\n\n        x3dScene.appendChild(this._createX3DRoute(\"value_changed\",\n                                                  interpolatorID,\n                                                  \"set_\" + path,\n                                                  targetID));\n    }\n};\n\n/**\n * generate and  append TimeSensor\n * @param {X3DNode} parent - A X3D-Node\n * @param {Number} duration - cycle interval\n * @param {String} aniID - DEF name\n */\nx3dom.glTF2Loader.prototype._generateX3DTimeSensor = function(id, duration)\n{\n    var clock = document.createElement('TimeSensor');\n\n    clock.setAttribute('loop','true');\n    clock.setAttribute('cycleInterval', duration);\n    clock.setAttribute('DEF', id);\n\n    return clock;\n};\n\n/**\n * generate and  append ROUTE, Interpolator, TimeSensor combos\n * @param {X3DNode} parent - A X3D-Node\n * @param {Number} duration - cycle interval, for normalization\n * @param {Object} sampler - glTF sampler\n * @param {Object} target - glTF target\n * @param {String} animID - animation name\n * @param {String} chID - channel name, for DEF construction\n */\nx3dom.glTF2Loader.prototype._generateX3DInterpolator = function(id, path, sampler, duration)\n{\n    var interpolator;\n    var interpolation  = sampler.interpolation || \"LINEAR\";\n    var accessorInput  = this._gltf.accessors[sampler.input];\n    var accessorOutput = this._gltf.accessors[sampler.output];\n    var viewInput      = this._gltf.bufferViews[accessorInput.bufferView];\n    var viewOutput     = this._gltf.bufferViews[accessorOutput.bufferView];\n\n    switch(path)\n    {\n        case \"scale\":\n        case \"translation\":\n            interpolator = document.createElement(\"PositionInterpolator\");\n            break;\n        case \"rotation\":\n            interpolator = document.createElement(\"OrientationInterpolator\");\n            break;\n        case \"weights\":\n            interpolator = document.createElement(\"ScalarInterpolator\");\n            break;\n    }\n\n    interpolator.setAttribute('DEF', id);\n    interpolator.setAttribute(\"buffer\", this._bufferURI(sampler));\n    interpolator.setAttribute(\"interpolation\", interpolation);\n    interpolator.setAttribute(\"duration\", duration);\n\n    interpolator.appendChild(this._generateX3DBufferAccessor('SAMPLER_INPUT', accessorInput, 0)); \n    interpolator.appendChild(this._generateX3DBufferAccessor('SAMPLER_OUTPUT', accessorOutput, 1));\n    \n    interpolator.appendChild(this._generateX3DBufferView(viewInput));\n    interpolator.appendChild(this._generateX3DBufferView(viewOutput));\n\n    return interpolator;\n};\n\n/**\n * Traverses all glTF nodes\n * @param {Object} node - A glTF-Node\n * @param {X3DNode} parent - A X3D-Node\n */\nx3dom.glTF2Loader.prototype._createX3DRoute = function(fromField, fromNode, toField, toNode)\n{\n    var route = document.createElement('ROUTE');\n\n    route.setAttribute('fromField', fromField);\n    route.setAttribute('fromNode', fromNode);\n    route.setAttribute('toField', toField);\n    route.setAttribute('toNode', toNode);\n\n    return route;\n}\n\n/**\n */\nx3dom.glTF2Loader.prototype._getCenterAndSize = function(primitive)\n{\n    var size = [1, 1, 1];\n    var center = [0, 0, 0];\n\n    if(primitive.attributes.POSITION != undefined)\n    {\n        var accessor = this._gltf.accessors[primitive.attributes.POSITION];\n\n        size[0] = accessor.max[0] - accessor.min[0];\n        size[1] = accessor.max[1] - accessor.min[1];\n        size[2] = accessor.max[2] - accessor.min[2];\n\n        center[0] = accessor.min[0] + size[0] * 0.5;\n        center[1] = accessor.min[1] + size[1] * 0.5;\n        center[2] = accessor.min[2] + size[2] * 0.5;\n    }\n\n    return {center: center, size: size};\n};\n\nx3dom.glTF2Loader.prototype._getVertexCount = function(primitive)\n{\n    var vertexCount = 0;\n    var accessor;\n\n    if(primitive.indices != undefined)\n    {\n        accessor = this._gltf.accessors[primitive.indices];\n        vertexCount = accessor.count;\n    }\n    else if(primitive.attributes.POSITION != undefined)\n    {\n        accessor = this._gltf.accessors[primitive.attributes.POSITION];\n        vertexCount = accessor.count;\n    }\n\n    return vertexCount;\n}\n\nx3dom.glTF2Loader.prototype._sizeInBytes = function(componentType)\n{\n    switch(componentType)\n    {\n        case 5120: return 1;\n        case 5121: return 1;\n        case 5122: return 2;\n        case 5123: return 2;\n        case 5125: return 4;\n        case 5126: return 4;\n    }\n};\n\nx3dom.glTF2Loader.prototype._componentsOf = function(type)\n{\n    switch(type)\n    {\n        case \"SCALAR\": return 1;\n        case \"VEC2\":   return 2;\n        case \"VEC3\":   return 3;\n        case \"VEC4\":   return 4;\n        case \"MAT2\":   return 4;\n        case \"MAT3\":   return 9;\n        case \"MAT4\":   return 16;\n    }\n};\n\nx3dom.glTF2Loader.prototype._bufferURI = function(value)\n{\n    var uri = \"\",\n        accessorIdx;\n\n    if(value.attributes != undefined && value.attributes.POSITION != undefined)\n    {\n        accessorIdx = value.attributes.POSITION;    \n    }\n    else if(value.input)\n    {\n        accessorIdx = value.input;\n    }\n\n    if(accessorIdx != undefined)\n    {\n        var accessor = this._gltf.accessors[accessorIdx];\n        var bufferView = this._gltf.bufferViews[accessor.bufferView];\n        var buffer     = this._gltf.buffers[bufferView.buffer];\n\n        uri = x3dom.Utils.dataURIToObjectURL(buffer.uri);\n    }\n\n    return uri;\n};\n\nx3dom.glTF2Loader.prototype._USEorDEF = function( node, value )\n{\n    if ( this._definitions[ value ] != undefined )\n    {\n        node.setAttribute( \"USE\", value );\n        return true;\n    }\n    else\n    {\n        node.setAttribute( \"DEF\", value );\n        this._definitions[ value ] = value;\n        return false;\n    }\n}\n\nx3dom.glTF2Loader.prototype._primitiveType = function(mode)\n{\n    switch(mode)\n    {\n        case 0: return \"POINTS\";\n        case 1: return \"LINES\";\n        case 2: return \"LINE_LOOP\";\n        case 3: return \"LINE_STRIP\";\n        case 4: return \"TRIANGLES\";\n        case 5: return \"TRIANGLE_STRIP\";\n        case 6: return \"TRIANGLE_FAN\";\n        default: return \"TRIANGLES\";\n    }\n};\n\nx3dom.glTF2Loader.prototype._isDefaultSampler = function(sampler)\n{\n    return ( sampler.wrapS     == 10497 && sampler.wrapS     == 10497 &&\n             sampler.magFilter == 9729  && sampler.minFilter == 9729 );\n};\n\nx3dom.glTF2Loader.prototype._toAxisAngle = function(quat)\n{\n    var result = [];\n    var quat = new x3dom.fields.Quaternion(quat[0], quat[1], quat[2], quat[3]);\n    var axisAngle = quat.toAxisAngle();\n\n    result[0] = axisAngle[0].x;\n    result[1] = axisAngle[0].y;\n    result[2] = axisAngle[0].z;\n    result[3] = axisAngle[1];\n\n    return result;\n};\n\n/**\n */\nx3dom.glTF2Loader.prototype._getGLTF = function(input, binary)\n{\n    if(!binary)\n    {\n        return (typeof input == \"string\") ? JSON.parse(input) : input;\n    }\n\n    var byteOffset = 0;\n\n    var header = new Uint32Array(input, byteOffset, 3);\n\n    if (header[0] == 1179937895 || header[1] == 2)\n    {\n        byteOffset += 12;\n\n        var jsonHeader = new Uint32Array(input, byteOffset, 2);\n\n        if (jsonHeader[1] == 1313821514)\n        {\n            byteOffset += 8;\n\n            var jsonData = new Uint8Array(input, byteOffset, jsonHeader[0]);\n\n            byteOffset += jsonHeader[0];\n\n            var binaryHeader = new Uint32Array(input, byteOffset, 2);\n\n            if (binaryHeader[1] == 5130562)\n            {\n                byteOffset += 8;\n\n                var binaryData = new Uint8Array(input, byteOffset, binaryHeader[0]);\n\n                var gltf = x3dom.Utils.arrayBufferToJSON(jsonData);\n\n                gltf.buffers[0].uri = x3dom.Utils.arrayBufferToObjectURL(binaryData, \"application/octet-stream\");\n\n                this._convertBinaryImages(gltf, input, byteOffset);\n\n                return gltf;\n            }\n        }\n    }\n};\n\nx3dom.glTF2Loader.prototype._convertBinaryImages = function(gltf, buffer, byteOffset)\n{\n    if(gltf.images != undefined)\n    {\n        for(var i = 0; i < gltf.images.length; i++)\n        {\n            var image = gltf.images[i];\n\n            if( image.bufferView != undefined )\n            {\n                var bufferView = gltf.bufferViews[image.bufferView];\n                bufferView.byteOffset = bufferView.byteOffset || 0;\n\n                var imageData = new Uint8Array(buffer, byteOffset + bufferView.byteOffset, bufferView.byteLength);\n\n                image.uri = x3dom.Utils.arrayBufferToObjectURL(imageData, image.mimeType);\n            }\n        }\n    }\n};\n\n/**\n * find animation input with longest duration \n * @param {Node} animation - the animation node\n */\nx3dom.glTF2Loader.prototype._animationDuration = function (animation)\n{   \n    var duration = -1;\n\n    for( var i = 0; i < animation.channels.length; i++)\n    {\n        var channel  = animation.channels[i];\n        var sampler  = animation.samplers[channel.sampler];\n        var accessor = this._gltf.accessors[sampler.input];\n\n        duration = Math.max(accessor.max[0], duration);\n    }\n\n    return duration;\n};\n\n/**\n * Created by skluge on 27.06.2016.\n */\nif(x3dom.glTF == null)\n    x3dom.glTF = {};\n\nglTF_BUFFER_IDX =\n{\n    INDEX : 0,\n    POSITION : 1,\n    NORMAL : 2,\n    TEXCOORD : 3,\n    COLOR : 4,\n    TANGENT : 6,\n    BITANGENT : 7\n};\n\nglTF_KHR_MATERIAL_COMMON_TECHNIQUE =\n{\n    BLINN : 0,\n    PHONG : 1,\n    LAMBERT : 2,\n    CONSTANT : 3\n};\n\nPBR_MATERIAL_TECHNIQUE =\n{\n    METALLICROUGHNESS : 0,\n    SPECULARGLOSSINESS : 1\n};\n\nx3dom.glTF.glTFMesh = function()\n{\n    this.indexOffset = 0;\n    this.drawCount = 0;\n\n    this.numFaces = 0;\n    this.primitiveType = 0;\n\n    this.numCoords = 0;\n\n    this.buffers = {};\n    \n    this.transform = new x3dom.fields.SFMatrix4f();\n\n    this.material = null;\n};\n\nx3dom.glTF.glTFMesh.prototype.bindVertexAttribPointer = function(gl, shaderProgram)\n{\n    if(this.buffers[x3dom.BUFFER_IDX.INDEX]){\n        gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.buffers[x3dom.BUFFER_IDX.INDEX].idx);\n    }\n\n    if(this.material != null && this.material.attributeMapping != null)\n    {\n        var mapping = this.material.attributeMapping;\n        this._bindVertexAttribPointer(gl, this.material.program[mapping[x3dom.BUFFER_IDX.POSITION]], this.buffers[x3dom.BUFFER_IDX.POSITION]);\n        this._bindVertexAttribPointer(gl, this.material.program[mapping[x3dom.BUFFER_IDX.NORMAL]], this.buffers[x3dom.BUFFER_IDX.NORMAL]);\n        this._bindVertexAttribPointer(gl, this.material.program[mapping[x3dom.BUFFER_IDX.TEXCOORD]], this.buffers[x3dom.BUFFER_IDX.TEXCOORD]);\n        this._bindVertexAttribPointer(gl, this.material.program[mapping[x3dom.BUFFER_IDX.COLOR]], this.buffers[x3dom.BUFFER_IDX.COLOR]);\n        this._bindVertexAttribPointer(gl, this.material.program[mapping[x3dom.BUFFER_IDX.TANGENT]], this.buffers[x3dom.BUFFER_IDX.TANGENT]);\n        this._bindVertexAttribPointer(gl, this.material.program[mapping[x3dom.BUFFER_IDX.BITANGENT]], this.buffers[x3dom.BUFFER_IDX.BITANGENT]);\n    }\n    else\n    {\n        this._bindVertexAttribPointer(gl, shaderProgram.position, this.buffers[x3dom.BUFFER_IDX.POSITION]);\n        this._bindVertexAttribPointer(gl, shaderProgram.normal, this.buffers[x3dom.BUFFER_IDX.NORMAL]);\n        this._bindVertexAttribPointer(gl, shaderProgram.texcoord, this.buffers[x3dom.BUFFER_IDX.TEXCOORD]);\n        this._bindVertexAttribPointer(gl, shaderProgram.color, this.buffers[x3dom.BUFFER_IDX.COLOR]);\n        this._bindVertexAttribPointer(gl, shaderProgram.tangent, this.buffers[x3dom.BUFFER_IDX.TANGENT]);\n        this._bindVertexAttribPointer(gl, shaderProgram.bitangent, this.buffers[x3dom.BUFFER_IDX.BITANGENT]);\n    }\n};\n\nx3dom.glTF.glTFMesh.prototype.bindVertexAttribPointerPosition = function(gl, shaderProgram, useMaterial)\n{\n    if(this.buffers[x3dom.BUFFER_IDX.INDEX]){\n        gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.buffers[x3dom.BUFFER_IDX.INDEX].idx);\n    }\n\n    if(useMaterial == true && this.material != null && this.material.attributeMapping != null)\n    {\n        var mapping = this.material.attributeMapping;\n        this._bindVertexAttribPointer(gl, this.material.program[mapping[x3dom.BUFFER_IDX.POSITION]], this.buffers[x3dom.BUFFER_IDX.POSITION]);\n    }\n    else\n    {\n        this._bindVertexAttribPointer(gl, shaderProgram.position, this.buffers[x3dom.BUFFER_IDX.POSITION]);\n    }\n};\n\nx3dom.glTF.glTFMesh.prototype._bindVertexAttribPointer = function(gl, shaderPosition, buffer)\n{\n    if(shaderPosition!=null)\n    {\n        if(buffer != null){\n        gl.bindBuffer(gl.ARRAY_BUFFER, buffer.idx);\n\n        gl.vertexAttribPointer(shaderPosition,\n            buffer.numComponents, buffer.type, false,\n            buffer.stride, buffer.offset);\n        gl.enableVertexAttribArray(shaderPosition);\n        }else{\n            gl.disableVertexAttribArray(shaderPosition);\n        }\n    }\n};\n\nx3dom.glTF.glTFMesh.prototype.render = function(gl, polyMode)\n{\n    if(this.material != null && !this.material.created())\n        return;\n\n    if(polyMode == null || polyMode > this.primitiveType)\n        polyMode = this.primitiveType;\n\n    if(this.buffers[x3dom.BUFFER_IDX.INDEX])\n        gl.drawElements(polyMode, this.drawCount, this.buffers[x3dom.BUFFER_IDX.INDEX].type, this.buffers[x3dom.BUFFER_IDX.INDEX].offset);\n    else\n        gl.drawArrays(polyMode, 0, this.drawCount);\n\n};\n\nx3dom.glTF.glTFTexture = function(gl, format, internalFormat, sampler, target, type, image, flip)\n{\n    this.format = format;\n    this.internalFormat = internalFormat;\n    this.sampler = sampler;\n    this.target = target;\n    this.type = type;\n    this.image = image;\n    this.flip = flip;\n\n    this.created = false;\n\n    this.create(gl);\n};\n\nx3dom.glTF.glTFTexture.prototype.needsPowerOfTwo = function(gl)\n{\n    var resize = true;\n    resize &= (this.sampler.magFilter == gl.LINEAR || this.sampler.magFilter == gl.NEAREST);\n    resize &= (this.sampler.minFilter == gl.LINEAR || this.sampler.minFilter == gl.NEAREST);\n    resize &= (this.sampler.wrapS == gl.CLAMP_TO_EDGE);\n    resize &= (this.sampler.wrapT == gl.CLAMP_TO_EDGE);\n\n    return !resize;\n};\n\nx3dom.glTF.glTFTexture.prototype.needsMipMaps = function(gl)\n{\n    var need = true;\n    need &= (this.sampler.magFilter == gl.LINEAR || this.sampler.magFilter == gl.NEAREST);\n    need &= (this.sampler.minFilter == gl.LINEAR || this.sampler.minFilter == gl.NEAREST);\n\n    return !need;\n};\n\nx3dom.glTF.glTFTexture.prototype.create = function(gl)\n{   \n    if(this.image.complete == false)\n        return;\n\n    this.glTexture = gl.createTexture();\n\n    var imgSrc = this.image;\n\n    if(this.needsPowerOfTwo(gl)){\n        var width = this.image.width;\n        var height = this.image.height;\n\n        var aspect = width / height;\n\n        imgSrc = x3dom.Utils.scaleImage(this.image);\n\n        var aspect2 = imgSrc.width / imgSrc.height;\n\n        if(Math.abs(aspect - aspect2) > 0.01){\n            console.warn(\"Image \"+this.image.src+\" was resized to power of two, but has unsupported aspect ratio and may be distorted!\");\n        }\n    }\n    \n    if (this.flip)\n    {\n        gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n    }\n\n    gl.bindTexture(gl.TEXTURE_2D, this.glTexture);\n    gl.texImage2D(gl.TEXTURE_2D, 0, this.internalFormat, this.format, this.type, imgSrc);\n\n\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, this.sampler.magFilter);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, this.sampler.minFilter);\n\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, this.sampler.wrapS);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, this.sampler.wrapT);\n\n    \n\n    if(this.needsMipMaps(gl))\n    {\n        gl.generateMipmap(gl.TEXTURE_2D);\n    }\n        \n    if (this.flip)\n    {\n        gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);\n    }\n    \n    gl.bindTexture(gl.TEXTURE_2D, null);\n\n    this.created = true;\n};\n\nx3dom.glTF.glTFTexture.prototype.bind = function(gl, textureUnit, shaderProgram, uniformName)\n{\n    gl.activeTexture(gl.TEXTURE0+textureUnit);\n\n    if(!this.created)\n        this.create(gl);\n\n    gl.bindTexture(gl.TEXTURE_2D, this.glTexture);\n    gl.uniform1i(gl.getUniformLocation(shaderProgram, uniformName), textureUnit);\n};\n\nx3dom.glTF.PBRMaterial = function()\n{\n    this.baseColorFactor = [0.3,0.1,0.1,1];\n    this.baseColorTex = null;\n\n    this.metallicFactor = 0;\n    this.metallicTex = null;\n\n    this.roughnessFactor = 0.2;\n    this.roughnessTex = null;\n\n    this.normalTex = null;\n    this.occlusionTex = null;\n\n    this.doubleSided = false;\n\n    this.technique = PBR_MATERIAL_TECHNIQUE.METALLICROUGHNESS;\n\n    this.attributeMapping = {};\n    this.attributeMapping[x3dom.BUFFER_IDX.POSITION] = \"position\";\n    this.attributeMapping[x3dom.BUFFER_IDX.NORMAL] = \"normal\";\n    this.attributeMapping[x3dom.BUFFER_IDX.TEXCOORD] = \"texcoord\";\n    this.attributeMapping[x3dom.BUFFER_IDX.TANGENT] = \"tangent\";\n    this.attributeMapping[x3dom.BUFFER_IDX.BITANGENT] = \"bitangent\";\n};\n\nx3dom.glTF.PBRMaterial.prototype.created = function()\n{\n    if(this.baseColorTex != null && this.baseColorTex.created != true)\n        return false;\n\n    if(this.metallicTex != null && this.metallicTex.created != true)\n        return false;\n\n    if(this.roughnessTex != null && this.roughnessTex.created != true)\n        return false;\n\n    if(this.normalTex != null && this.normalTex.created != true)\n        return false;\n\n    if(this.occlusionTex != null && this.occlusionTex.created != true)\n        return false;\n\n    return true;\n};\n\nx3dom.glTF.PBRMaterial.prototype.setShader = function(gl, cache, shape, properties)\n{\n\n    properties.EMPTY_SHADER = 0;\n\n    properties.PBR_MATERIAL = 1;\n\n    if(this.baseColorTex != null)\n        properties.USE_BASECOLOR_TEX = 1;\n    else\n        properties.USE_BASECOLOR_TEX = 0;\n\n    if(this.metallicTex != null)\n        properties.USE_METALLIC_TEX = 1;\n    else\n        properties.USE_METALLIC_TEX = 0;\n\n    if(this.roughnessTex != null)\n        properties.USE_ROUGHNESS_TEX = 1;\n    else\n        properties.USE_ROUGHNESS_TEX = 0;\n\n    if(this.normalTex != null)\n        properties.USE_NORMAL_TEX = 1;\n    else\n        properties.USE_NORMAL_TEX = 0;\n\n    if(this.occlusionTex != null)\n        properties.USE_OCCLUSION_TEX = 1;\n    else\n        properties.USE_OCCLUSION_TEX = 0;\n\n    properties.toIdentifier();\n\n    this.program = cache.getShaderByProperties(gl, shape, properties);\n\n};\n\nx3dom.glTF.PBRMaterial.prototype.bind = function(gl, shaderProgram)\n{\n    this.program.bind();\n\n    // set all used Shader Parameter\n    for(var key in shaderProgram){\n        if(!shaderProgram.hasOwnProperty(key))\n            continue;\n\n        if(this.program.hasOwnProperty(key))\n            this.program[key] = shaderProgram[key];\n    }\n\n    if(this.baseColorTex != null)\n        this.baseColorTex.bind(gl, 0, this.program.program, \"baseColorTex\");\n\n    if(this.metallicTex != null)\n        this.metallicTex.bind(gl, 1, this.program.program, \"metallicTex\");\n\n    if(this.roughnessTex != null)\n        this.roughnessTex.bind(gl, 2, this.program.program, \"roughnessTex\");\n\n    if(this.normalTex != null)\n        this.normalTex.bind(gl, 3, this.program.program, \"normalTex\");\n\n    if(this.occlusionTex != null)\n        this.occlusionTex.bind(gl, 4, this.program.program, \"occlusionTex\");\n\n    this.program.baseColorFactor = this.baseColorFactor;\n    this.program.metallicFactor = this.metallicFactor;\n    this.program.roughnessFactor = this.roughnessFactor;\n\n    this.program.technique = this.technique;\n};\n\n\nx3dom.glTF.glTFKHRMaterialCommons = function()\n{\n    this.diffuse = [0.3,0.1,0.1,1];\n    this.diffuseTex = null;\n\n    this.emission = [0.0,0.0,0.0,1];\n    this.emissionTex = null;\n\n    this.specular = [0.8,0.8,0.8,1];\n    this.specularTex = null;\n\n    this.ambient = [0,0,0,1];\n\n    this.shininess = 2;\n    this.transparency = 0.0;\n\n    this.globalAmbient = [0,0,0,1];\n    this.lightVector = [1,0,0,1];\n\n    this.doubleSided = false;\n\n    this.technique = glTF_KHR_MATERIAL_COMMON_TECHNIQUE.PHONG;\n\n    this.attributeMapping = {};\n    this.attributeMapping[x3dom.BUFFER_IDX.POSITION] = \"position\";\n    this.attributeMapping[x3dom.BUFFER_IDX.NORMAL] = \"normal\";\n    this.attributeMapping[x3dom.BUFFER_IDX.TEXCOORD] = \"texcoord\";\n    this.attributeMapping[x3dom.BUFFER_IDX.COLOR] = \"color\";\n};\n\nx3dom.glTF.glTFKHRMaterialCommons.prototype.created = function()\n{\n    if(this.diffuseTex != null && this.diffuseTex.created != true)\n        return false;\n\n    if(this.emissionTex != null && this.emissionTex.created != true)\n        return false;\n\n    if(this.specularTex != null && this.specularTex.created != true)\n        return false;\n\n    return true;\n};\n\nx3dom.glTF.glTFKHRMaterialCommons.prototype.setShader = function(gl, cache, shape, properties)\n{\n\n    properties.EMPTY_SHADER = 0;\n\n    properties.KHR_MATERIAL_COMMONS = 1;\n\n    if(this.diffuseTex != null)\n        properties.USE_DIFFUSE_TEX = 1;\n    else\n        properties.USE_DIFFUSE_TEX = 0;\n\n    if(this.emissionTex != null)\n        properties.USE_SPECULAR_TEX = 1;\n    else\n        properties.USE_SPECULAR_TEX = 0;\n\n    if(this.specularTex != null)\n        properties.USE_EMISSION_TEX = 1;\n    else\n        properties.USE_EMISSION_TEX = 0;\n\n    properties.toIdentifier();\n\n    this.program = cache.getShaderByProperties(gl, shape, properties);\n\n};\n\nx3dom.glTF.glTFKHRMaterialCommons.prototype.bind = function(gl, shaderProgram)\n{\n    this.program.bind();\n\n    // set all used Shader Parameter\n    for(var key in shaderProgram){\n        if(!shaderProgram.hasOwnProperty(key))\n            continue;\n\n        if(this.program.hasOwnProperty(key))\n            this.program[key] = this.updateTransforms(key, shaderProgram[key]);\n    }\n\n    if(this.diffuseTex != null)\n        this.diffuseTex.bind(gl, 0, this.program.program, \"diffuseTex\");\n    else\n        this.program.diffuse = this.diffuse;\n\n    if(this.emissionTex != null)\n        this.emissionTex.bind(gl, 0, this.program.program, \"emissionTex\");\n    else\n        this.program.emission = this.emission;\n\n    if(this.specularTex != null)\n        this.specularTex.bind(gl, 0, this.program.program, \"specularTex\");\n    else\n        this.program.specular = this.specular;\n\n    this.program.shininess = this.shininess;\n    this.program.transparency = this.transparency;\n    this.program.globalAmbient = this.globalAmbient;\n    this.program.lightVector = this.lightVector;\n    this.program.lightVector = this.lightVector;\n\n    this.program.technique = this.technique;\n};\n\nx3dom.glTF.glTFKHRMaterialCommons.prototype.updateTransforms = function(uniform, value)\n{\n    var matrix4f = new x3dom.fields.SFMatrix4f();\n    \n    function glMultMatrix4 (gl, m) {\n        matrix4f.setFromArray(gl);\n        return matrix4f.mult(m).toGL(); //optimize by multiplying gl matrixes directly\n    };\n    \n    switch(uniform){\n        case \"modelViewInverseTransposeMatrix\":\n            //do modelviewinverse\n            var worldInverse = this.worldTransform.inverse();\n            matrix4f.setFromArray(value);\n            //mult in, transpose and to GL\n            var mat = worldInverse.mult(matrix4f).transpose().toGL();\n            var model_view_inv_gl = [\n                mat[0], mat[1], mat[2],\n                mat[4],mat[5],mat[6],\n                mat[8],mat[9],mat[10]];\n            return model_view_inv_gl;\n            break;\n        case \"modelViewInverseMatrix\":\n            // work with worldTransform.inverse\n            // (VM x W)-1 = W-1 x VM-1\n            var worldInverse = this.worldTransform.inverse();\n            matrix4f.setFromArray(value);\n            return worldInverse.mult(matrix4f);\n            break;\n        case \"modelViewMatrix\":\n        case \"modelViewProjectionMatrix\":\n        case \"modelMatrix\":\n        case \"model\":\n            return glMultMatrix4(value, this.worldTransform);\n            break;\n        case \"viewMatrix\":\n        case \"projectionMatrix\":\n            return value;\n            break;\n        default:\n            return value;\n            break;\n    }\n    \n\tconsole.warn(\"switch default not encountered ?\");\n\treturn value;\n};\n\nx3dom.glTF.glTFMaterial = function(technique)\n{\n    this.technique = technique;\n    this.values = {};\n    this.semanticMapping = {};\n    this.attributeMapping = {};\n    this.textures = {};\n\n    for(var key in this.technique.uniforms)\n    {\n        if(this.technique.uniforms.hasOwnProperty(key))\n        {\n            var parameter = this.technique.parameters[this.technique.uniforms[key]];\n            if(parameter.semantic != null)\n                switch(parameter.semantic)\n                {\n                    case \"MODELVIEW\":\n                        this.semanticMapping[key] = \"modelViewMatrix\";\n                        break;\n                    case \"MODELVIEWINVERSETRANSPOSE\":\n                        this.semanticMapping[key] = \"modelViewInverseTransposeMatrix\";\n                        break;\n                    case \"PROJECTION\":\n                        this.semanticMapping[key] = \"projectionMatrix\";\n                        break;\n                    case \"MODEL\":\n                        this.semanticMapping[key] = \"modelMatrix\";\n                        break;\n                    case \"MODELVIEWPROJECTION\":\n                        this.semanticMapping[key] = \"modelViewProjectionMatrix\";\n                        break;\n                    case \"VIEW\":\n                        this.semanticMapping[key] = \"viewMatrix\";\n                        break;\n                    case \"MODELVIEWINVERSE\":\n                        this.semanticMapping[key] = \"modelViewInverseMatrix\";\n                        break;\n                    default:\n                        break;\n                }\n        }\n    }\n\n    for(var key in this.technique.attributes) {\n        if (this.technique.attributes.hasOwnProperty(key)) {\n            var parameter = this.technique.parameters[this.technique.attributes[key]];\n            if (parameter.semantic != null)\n                switch (parameter.semantic) {\n                    case \"POSITION\":\n                        this.attributeMapping[x3dom.BUFFER_IDX.POSITION] = key;\n                        break;\n                    case \"NORMAL\":\n                        this.attributeMapping[x3dom.BUFFER_IDX.NORMAL] = key;\n                        break;\n                    case \"TEXCOORD_0\":\n                        this.attributeMapping[x3dom.BUFFER_IDX.TEXCOORD] = key;\n                        break;\n                    case \"COLOR\":\n                        this.attributeMapping[x3dom.BUFFER_IDX.COLOR] = key;\n                        break;\n                    default:\n                        break;\n                }\n        }\n    }\n};\n\nx3dom.glTF.glTFMaterial.prototype.created = function()\n{\n    for(var key in this.textures){\n      if(!this.textures.hasOwnProperty(key)) continue;\n\n      if(this.textures[key].created != true)\n          return false;\n    }\n\n    return true;\n};\n\nx3dom.glTF.glTFMaterial.prototype.bind = function(gl, shaderParameter)\n{\n    if(this.program != null)\n        this.program.bind();\n\n    this.updateTransforms(shaderParameter);\n\n    var texUnit = 0;\n\n    for(var key in this.technique.uniforms)\n        if(this.technique.uniforms.hasOwnProperty(key))\n        {\n            var uniformName = this.technique.uniforms[key];\n            if(this.textures[uniformName] != null){\n                var texture = this.textures[uniformName];\n                texture.bind(gl, texUnit, this.program.program, key);\n                texUnit++;\n            }\n            else if(this.values[uniformName] != null)\n                this.program[key] = this.values[uniformName];\n        }\n};\n\nx3dom.glTF.glTFMaterial.prototype.updateTransforms = function(shaderParameter)\n{\n    var matrix4f = new x3dom.fields.SFMatrix4f();\n    \n    function glMultMatrix4 (gl, m) {\n        matrix4f.setFromArray(gl);\n        return matrix4f.mult(m).toGL(); //optimize by multiplying gl matrixes directly\n    }\n    \n    if(this.program !== null)\n    {\n        this.program.bind();\n\n        for(var key in this.semanticMapping){\n            if(!this.semanticMapping.hasOwnProperty(key))continue;\n\n            var worldInverse;\n            var mapping = this.semanticMapping[key];\n\n            switch(mapping){\n                case \"modelViewMatrix\":\n                    this.program[key] = shaderParameter.modelViewMatrix;\n                    break;\n                case \"viewMatrix\":\n                    this.program[key] = shaderParameter.viewMatrix;\n                    break;\n                case \"modelViewInverseTransposeMatrix\":\n                    //var mat = shaderParameter.normalMatrix;\n                    //do modelviewinverse\n                    worldInverse = this.worldTransform.inverse();\n                    matrix4f.setFromArray(shaderParameter.modelViewMatrixInverse);\n                    //mult in, transpose and to GL\n                    var mat = worldInverse.mult(matrix4f).transpose().toGL();\n\n                    var model_view_inv_gl =\n                        [mat[0], mat[1], mat[2],\n                            mat[4],mat[5],mat[6],\n                            mat[8],mat[9],mat[10]];\n\n                    this.program[key] = model_view_inv_gl;\n                    break;\n                case \"modelViewInverseMatrix\":\n                    // work with worldTransform.inverse\n                    // (VM x W)-1 = W-1 x VM-1\n                    worldInverse = shaderParameter.model.inverse();\n                    matrix4f.setFromArray(shaderParameter.modelViewMatrixInverse);\n                    this.program[key] = worldInverse.mult(matrix4f);\n                    break;\n                case \"modelViewProjectionMatrix\":\n                    this.program[key] = shaderParameter.modelViewProjectionMatrix;\n                    break;\n                case \"modelMatrix\":\n                    this.program[key] = shaderParameter.model;\n                    break;\n                case \"projectionMatrix\":\n                    this.program[key] = shaderParameter.projectionMatrix;\n                    break;\n                default:\n                    break;\n            }\n        }\n    }\n};\n\n\nx3dom.DDSLoader = {};\n\nx3dom.DDSLoader.load = function( src )\n{\n    return new Promise( function( resolve, reject ) {\n\n        var xhr = new XMLHttpRequest();\n\n        xhr.open('GET', src, true);\n\n        xhr.responseType = \"arraybuffer\";\n\n        xhr.onload = function()\n        {\n            var dds = x3dom.DDSLoader._read( xhr.response );\n\n            if ( dds )\n            {\n                resolve( dds );\n            }\n            else\n            {\n                reject( dds );\n            }\n        };\n  \n        xhr.onerror = function()\n        {\n            reject();\n        };\n    \n        //ddsXhr.send(null);\n        x3dom.RequestManager.addRequest(xhr);\n\n    });\n}\n\nx3dom.DDSLoader._read = function( source )\n{\n    if ( source === undefined || source.byteLength < 128 )\n    {\n        return;\n    }\n    \n    let dds = \n    {\n        isCompressed  : false,\n        isVolume      : false,\n        isCubeMap     : false,\n        targets       : [],\n        data          : []\n    };\n\n    let int32Buffer = new Uint32Array( source, 0, 32 );\n    \n    //Parse DDS Header\n    dds.header = x3dom.DDSLoader._readHeader( int32Buffer );\n    \n    int32Buffer = new Uint32Array( source, 128, 5 );\n    \n    //Parse DDS Header\n    dds.header10 = x3dom.DDSLoader._readHeader10( dds, int32Buffer );\n    \n    //Check if the magic number is present\n    if ( dds.header.dwMagic != 0x20534444 )\n    {\n        return;\n    }\n    \n    //Check if the header size is correct\n    if ( dds.header.dwSize != 0x7C )\n    {\n        return;\n    }   \n    \n    //Parse resource format\n    if ( !x3dom.DDSLoader._readFormat( dds ) )\n    {\n        return;\n    }    \n    \n    x3dom.DDSLoader._readMipmapCount( dds );\n    \n    x3dom.DDSLoader._readType( dds );\n\n    this._readData( dds, source );\n\n    return dds;\n}\n\nx3dom.DDSLoader._readHeader = function( buffer )\n{\n    return {\n        dwMagic             : buffer[ 0 ],\n        dwSize              : buffer[ 1 ],\n        dwFlags             : x3dom.DDSLoader._readDDSFlags( buffer[ 2 ] ),\n        dwHeight            : buffer[ 3 ],\n        dwWidth             : buffer[ 4 ],\n        dwPitchOrLinearSize : buffer[ 5 ],\n        dwDepth             : buffer[ 6 ],\n        dwMipMapCount       : buffer[ 7 ],\n        dwReserved1         : \"UNUSED\",\n        ddspf               : {\n            dwSize              : buffer[ 19 ],\n            dwFlags             : x3dom.DDSLoader._readPFFlags( buffer[ 20 ] ),\n            dwFourCC            : x3dom.DDSLoader.int32ToFourCC( buffer[ 21 ] ),\n            dwRGBBitCount       : buffer[ 22 ],\n            dwRBitMask          : buffer[ 23 ],\n            dwGBitMask          : buffer[ 24 ],\n            dwBBitMask          : buffer[ 25 ],\n            dwABitMask          : buffer[ 26 ]\n        },\n        dwCaps              : x3dom.DDSLoader._readCapsFlags( buffer[ 27 ] ),\n        dwCaps2             : x3dom.DDSLoader._readCaps2Flags( buffer[ 28 ] ),\n        dwCaps3             : \"UNUSED\",\n        dwCaps4             : \"UNUSED\",\n        dwReserved2         : \"UNUSED\"   \n    }\n};\n\nx3dom.DDSLoader._readHeader10 = function( dds, buffer )\n{\n    if ( dds.header.ddspf.dwFourCC != \"DX10\" )\n    {\n        return null;\n    }\n\n    return {\n        dxgiFormat          : buffer[ 0 ],\n        resourceDimension   : x3dom.DDSLoader._readResourceDimension( buffer[ 1 ] ),\n        miscFlags           : x3dom.DDSLoader._readMiscFlags( buffer[ 2 ] ),\n        arraySize           : buffer[ 3 ],\n        miscFlags2          : x3dom.DDSLoader._readMiscFlags2( buffer[ 4 ] ),       \n    }\n};\n\nx3dom.DDSLoader._readMipmapCount = function( dds )\n{\n    dds.numberOfMipmaps = ( dds.header.dwFlags.DDSD_MIPMAPCOUNT ) ? dds.header.dwMipMapCount : 1;\n}\n\nx3dom.DDSLoader._readType = function( dds )\n{\n    if ( dds.header.dwFlags.DDSD_DEPTH && dds.header.dwCaps2.DDSCAPS2_VOLUME )\n    {\n        dds.type = 32879;\n        \n        dds.numberOfImages = dds.header.dwCaps.DDSD_DEPTH;\n    }\n    else if ( dds.header.dwCaps2.DDSCAPS2_CUBEMAP )\n    {\n        dds.type = 34067;\n        \n        if ( dds.header.dwCaps2.DDSCAPS2_CUBEMAP_POSITIVEX )\n        { \n            dds.targets.push( 34069 );\n        }\n        if ( dds.header.dwCaps2.DDSCAPS2_CUBEMAP_NEGATIVEX )\n        {    \n            dds.targets.push( 34070 );\n        }    \n        if ( dds.header.dwCaps2.DDSCAPS2_CUBEMAP_POSITIVEY )\n        { \n            dds.targets.push( 34071 );\n        }\n        if ( dds.header.dwCaps2.DDSCAPS2_CUBEMAP_NEGATIVEY )\n        {     \n            dds.targets.push( 34072 );\n        }\n        if ( dds.header.dwCaps2.DDSCAPS2_CUBEMAP_POSITIVEZ )\n        {\n            dds.targets.push( 34073 );\n        }\n        if ( dds.header.dwCaps2.DDSCAPS2_CUBEMAP_NEGATIVEZ )\n        { \n            dds.targets.push( 34074 );\n        }\n\n        dds.numberOfImages = dds.targets.length;\n\n    }\n    else\n    {   \n        dds.type = 3553;\n        \n        dds.targets.push( 3553 );\n        \n        dds.numberOfImages = dds.targets.length;           \n    }\n    \n};\n\nx3dom.DDSLoader._readDDSFlags = function( dwFlags ) \n{\n    return  { \n        DDSD_CAPS           : ( dwFlags & 0x1      ) ? true : false,\n        DDSD_HEIGHT         : ( dwFlags & 0x2      ) ? true : false,\n        DDSD_WIDTH          : ( dwFlags & 0x4      ) ? true : false,\n        DDSD_PITCH          : ( dwFlags & 0x8      ) ? true : false,\n        DDSD_PIXELFORMAT    : ( dwFlags & 0x1000   ) ? true : false,\n        DDSD_MIPMAPCOUNT    : ( dwFlags & 0x20000  ) ? true : false,\n        DDSD_LINEARSIZE     : ( dwFlags & 0x80000  ) ? true : false,\n        DDSD_DEPTH          : ( dwFlags & 0x800000 )  ? true : false\n    }\n}\n\nx3dom.DDSLoader._readPFFlags = function( dwFlags )\n{\n    return  {\n        DDPF_ALPHAPIXELS    : ( dwFlags & 0x1     ) ? true : false,\n        DDPF_ALPHA          : ( dwFlags & 0x2     ) ? true : false,\n        DDPF_FOURCC         : ( dwFlags & 0x4     ) ? true : false,\n        DDPF_RGB            : ( dwFlags & 0x40    ) ? true : false,\n        DDPF_YUV            : ( dwFlags & 0x200   ) ? true : false,\n        DDPF_LUMINANCE      : ( dwFlags & 0x20000 ) ? true : false\n    }  \n}\n\nx3dom.DDSLoader._readCapsFlags = function( dwFlags )\n{\n    return  { \n        DDSCAPS_COMPLEX : ( dwFlags & 0x8      ) ? true : false,\n        DDSCAPS_MIPMAP  : ( dwFlags & 0x400000 ) ? true : false,\n        DDSCAPS_TEXTURE : ( dwFlags & 0x1000   ) ? true : false\n    }  \n}\n\nx3dom.DDSLoader._readCaps2Flags = function( dwFlags )\n{\n    return  {   \n        DDSCAPS2_CUBEMAP            : ( dwFlags & 0x200   ) ? true : false,\n        DDSCAPS2_CUBEMAP_POSITIVEX  : ( dwFlags & 0x400   ) ? true : false,\n        DDSCAPS2_CUBEMAP_NEGATIVEX  : ( dwFlags & 0x800   ) ? true : false,\n        DDSCAPS2_CUBEMAP_POSITIVEY  : ( dwFlags & 0x1000  ) ? true : false,\n        DDSCAPS2_CUBEMAP_NEGATIVEY  : ( dwFlags & 0x2000  ) ? true : false,\n        DDSCAPS2_CUBEMAP_POSITIVEZ  : ( dwFlags & 0x4000  ) ? true : false,\n        DDSCAPS2_CUBEMAP_NEGATIVEZ  : ( dwFlags & 0x8000  ) ? true : false,\n        DDSCAPS2_VOLUME             : ( dwFlags & 0x20000 ) ? true : false\n    }\n}\n\nx3dom.DDSLoader._readResourceDimension = function( resourceDimension )\n{\n    switch ( resourceDimension )\n    {\n        case 0x0: return \"D3D10_RESOURCE_DIMENSION_UNKNOWN\";\n        case 0x1: return \"D3D10_RESOURCE_DIMENSION_BUFFER\";\n        case 0x2: return \"D3D10_RESOURCE_DIMENSION_TEXTURE1D\";\n        case 0x3: return \"D3D10_RESOURCE_DIMENSION_TEXTURE2D\";\n        case 0x4: return \"D3D10_RESOURCE_DIMENSION_TEXTURE3D\";\n    }\n}\n\nx3dom.DDSLoader._readMiscFlags = function( miscFlag )\n{\n    return {\n        D3D11_RESOURCE_MISC_GENERATE_MIPS                   : ( miscFlag & 0x1     ) ? true : false,\n        D3D11_RESOURCE_MISC_SHARED                          : ( miscFlag & 0x2     ) ? true : false,\n        D3D11_RESOURCE_MISC_TEXTURECUBE                     : ( miscFlag & 0x4     ) ? true : false,\n        D3D11_RESOURCE_MISC_DRAWINDIRECT_ARGS               : ( miscFlag & 0x10    ) ? true : false,\n        D3D11_RESOURCE_MISC_BUFFER_ALLOW_RAW_VIEWS          : ( miscFlag & 0x20    ) ? true : false,\n        D3D11_RESOURCE_MISC_BUFFER_STRUCTURED               : ( miscFlag & 0x40    ) ? true : false,\n        D3D11_RESOURCE_MISC_RESOURCE_CLAMP                  : ( miscFlag & 0x80    ) ? true : false,\n        D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX               : ( miscFlag & 0x100   ) ? true : false,\n        D3D11_RESOURCE_MISC_GDI_COMPATIBLE                  : ( miscFlag & 0x200   ) ? true : false,\n        D3D11_RESOURCE_MISC_SHARED_NTHANDLE                 : ( miscFlag & 0x800   ) ? true : false,\n        D3D11_RESOURCE_MISC_RESTRICTED_CONTENT              : ( miscFlag & 0x1000  ) ? true : false,\n        D3D11_RESOURCE_MISC_RESTRICT_SHARED_RESOURCE        : ( miscFlag & 0x2000  ) ? true : false,\n        D3D11_RESOURCE_MISC_RESTRICT_SHARED_RESOURCE_DRIVER : ( miscFlag & 0x4000  ) ? true : false,\n        D3D11_RESOURCE_MISC_GUARDED                         : ( miscFlag & 0x8000  ) ? true : false,\n        D3D11_RESOURCE_MISC_TILE_POOL                       : ( miscFlag & 0x20000 ) ? true : false,\n        D3D11_RESOURCE_MISC_TILED                           : ( miscFlag & 0x40000 ) ? true : false,\n        D3D11_RESOURCE_MISC_HW_PROTECTED                    : ( miscFlag & 0x80000 ) ? true : false,\n    }    \n}\n\nx3dom.DDSLoader._readMiscFlags2 = function( miscFlag )\n{\n    let miscFlags2 = {};\n    \n    switch ( miscFlag )\n    {\n        case 0x0: \n            miscFlags2.alphaMode = \"DDS_ALPHA_MODE_UNKNOWN\";\n            break;\n        case 0x1: \n            miscFlags2.alphaMode = \"DDS_ALPHA_MODE_UNKNOWN\";\n            break;\n        case 0x2: \n            miscFlags2.alphaMode = \"DDS_ALPHA_MODE_UNKNOWN\";\n            break;\n        case 0x3: \n            miscFlags2.alphaMode = \"DDS_ALPHA_MODE_UNKNOWN\";\n            break;\n        case 0x4: \n            miscFlags2.alphaMode = \"DDS_ALPHA_MODE_UNKNOWN\";\n            break;\n    }\n    \n    return miscFlags2;      \n}\n\nx3dom.DDSLoader._readData = function( dds, buffer, texture, options )\n{\n    var offset = (dds.header10) ? 148 : 128;\n    \n    var byteArray, width, height;\n    \n    dds.width = dds.header.dwWidth;\n    dds.height = dds.header.dwHeight;\n    dds.generateMipmaps = ( dds.numberOfMipmaps <= 1 && !dds.isCompressed );\n    \n    for ( let i = 0; i < dds.numberOfImages; i++ )\n    {\n        width = dds.header.dwWidth;\n        height = dds.header.dwHeight;\n        \n        dds.data[ dds.targets[ i ] ] = [];\n        \n        for ( var m = 0; m < dds.numberOfMipmaps; m++ )\n        {      \n            if ( m != 0 )\n            {\n                width  = Math.max( width  * 0.5, 1 );\n                height = Math.max( height * 0.5, 1 );\n            }\n    \n            if ( dds.isCompressed )\n            {\n                byteArray = this._readCompressedData( buffer, width, height, offset, dds.blockSize );\n                \n                dds.data[ dds.targets[ i ] ][ m ] = byteArray;\n            }\n            else\n            {\n                byteArray = this._readUncompressedData( buffer, width, height, offset, dds.format );\n                \n                dds.data[ dds.targets[ i ] ][ m ] = byteArray;\n            }\n    \n            offset += byteArray.length * byteArray.BYTES_PER_ELEMENT * dds.format.bytesPerElementFactor;\n\n        }\n    }\n\n    if(dds.format.overwriteType)\n    {\n        dds.format.type = dds.format.overwriteType;\n    }\n\n    if(dds.format.overwriteInternalType)\n    {\n        dds.format.internal = dds.format.overwriteInternalType;\n    }\n    \n    return dds;\n\n};\n\nx3dom.DDSLoader._readCompressedData = function( buffer, width, height, offset, blockSize )\n{\n    let length = Math.max( 1, parseInt( ( width + 3 ) / 4 ) ) * Math.max( 1, parseInt( ( height + 3 ) / 4 ) ) * blockSize;\n\n    return new Uint8Array( buffer.slice( offset, offset + length ) );\n}\n\nx3dom.DDSLoader._readUncompressedData = function( buffer, width, height, offset, format, type )\n{\n    format.bytesPerElementFactor = 1;\n\n    if ( format.internal == 6406 )\n    {\n        return new Uint8Array( buffer.slice( offset, offset + width * height ) );\n    }\n    else if ( format.internal == 6409 )\n    {\n        return new Uint8Array( buffer.slice( offset, offset + width * height ) );\n    }\n    else if ( format.internal == 6410 )\n    {\n        return new Uint8Array( buffer.slice( offset, offset + width * height * 2 ) );\n    }\n    else if ( format.internal == 6407 )\n    {\n        return x3dom.DDSLoader.R8G8B8_To_B8G8R8( new Uint8Array( buffer.slice( offset, offset + width * height * 3 ) ) );\n    }\n    else if ( format.internal == 36194 )\n    {\n        return new Uint16Array( buffer.slice( offset, offset + width * height * 2 ) );\n    }\n    else if ( format.internal == 6408 && format.type != 36193 && format.type != 5126 )\n    {\n        return x3dom.DDSLoader.A8R8G8B8_To_A8B8G8R8( new Uint8Array( buffer.slice( offset, offset + width * height * 4 ) ) );\n    }\n    else if ( format.internal == 32854)\n    {\n        return x3dom.DDSLoader.A4R4G4B4_To_A4B4G4R4( new Uint16Array( buffer.slice( offset, offset + width * height * 2 ) ) );\n    }\n    else if ( format.internal == 32855 )\n    {\n        return x3dom.DDSLoader.A1R5G5B5_To_A1B5G5R5( new Uint16Array( buffer.slice( offset, offset + width * height * 2 ) ) );\n    }\n    else if ( format.internal == 34842 || format.type == 36193 )\n    {\n        if( x3dom.caps.HFP_TEXTURES || x3dom.caps.WEBGL_VERSION == 2)\n        {\n            return new Uint16Array( buffer.slice( offset, offset + width * height * 4 * 2 ) );\n        }\n        else if( x3dom.caps.FP_TEXTURES )\n        {\n            format.overwriteType = 5126;\n            format.overwriteInternalType = (x3dom.caps.WEBGL_VERSION == 2) ? 34836 : 6408;\n            format.bytesPerElementFactor = 0.5;\n\n            return x3dom.DDSLoader.UI16_To_F32( new Uint16Array( buffer.slice( offset, offset + width * height * 4 * 2 ) ));\n        }\n        else\n        {\n            format.overwriteType = 5121;\n            format.overwriteInternalType = 6408;\n            format.bytesPerElementFactor = 2;\n\n            return x3dom.DDSLoader.UI16_To_UI8( new Uint16Array( buffer.slice( offset, offset + width * height * 4 * 2 ) ));\n        }\n    }\n    else if ( format.internal == 34836 || format.type == 5126)\n    {\n        if( x3dom.caps.FP_TEXTURES || x3dom.caps.WEBGL_VERSION == 2)\n        {\n            return new Float32Array( buffer.slice( offset, offset + width * height * 4 * 4 ) );\n        }\n        else\n        {\n\n        }\n        \n    }\n    else if ( format.internal == 35898 )\n    {\n        return new Uint8Array( buffer.slice( offset, offset + width * height * 3 ) );\n    }\n};\n\nx3dom.DDSLoader._readFormat = function( dds )\n{\n    let pixelFormat = dds.header.ddspf;\n\n    if ( pixelFormat.dwFlags.DDPF_FOURCC )\n    {\n        if ( pixelFormat.dwFourCC == \"DXT1\" )\n        {\n            dds.blockSize = 8;\n            dds.isCompressed = true;\n            dds.format = { internal: 33776, format: 6407, type: 5121 };\n        }\n        else if ( pixelFormat.dwFourCC == \"DXT3\" )\n        {\n            dds.blockSize = 16;\n            dds.isCompressed = true;\n            dds.format = { internal: 33778, format: 6408, type: 5121 };\n        }\n        else if ( pixelFormat.dwFourCC == \"DXT5\" )\n        {\n            dds.blockSize = 16;\n            dds.isCompressed = true;\n            dds.format = { internal: 33779, format: 6408, type: 5121 };\n        }\n        else if ( pixelFormat.dwFourCC == \"t\" )\n        {\n            if(x3dom.caps.WEBGL_VERSION == 2)\n            {\n                dds.format = { internal: 34836, format: 6408, type: 5126 };\n            }\n            else\n            {\n                dds.format = { internal: 6408, format: 6408, type: 5126 };\n            }\n        }\n        else if ( pixelFormat.dwFourCC == \"q\"  || pixelFormat.dwFourCC == \"$\" )\n        {\n            if(x3dom.caps.WEBGL_VERSION == 2)\n            {\n                dds.format = { internal: 34842, format: 6408, type: 5131 };\n            }\n            else\n            {\n                dds.format = { internal: 6408, format: 6408, type: 36193 };\n            }\n        }\n        else\n        {\n            return false;\n        }\n    }\n    else if ( pixelFormat.dwFlags.DDPF_RGB && !pixelFormat.dwFlags.DDPF_ALPHAPIXELS )\n    {\n        if ( pixelFormat.dwRGBBitCount == 24  && pixelFormat.dwRBitMask == 0xff0000 &&\n                pixelFormat.dwGBitMask == 0xff00 && pixelFormat.dwBBitMask == 0xff )\n        {\n            dds.format = { internal: 6407, format: 6407, type: 5121 };\n        }\n        else if ( pixelFormat.dwRGBBitCount == 16 && pixelFormat.dwRBitMask == 0xf800 &&\n                    pixelFormat.dwGBitMask == 0x7e0 && pixelFormat.dwBBitMask == 0x1f )\n        {\n            dds.format = { internal: 36194, format: 6407, type: 33635 };\n        }\n        else\n        {\n            return false;\n        }\n    }\n    else if ( pixelFormat.dwFlags.DDPF_RGB && pixelFormat.dwFlags.DDPF_ALPHAPIXELS )\n    {\n        if ( pixelFormat.dwRGBBitCount == 32  && pixelFormat.dwRBitMask == 0xff0000 &&\n                pixelFormat.dwGBitMask == 0xff00 && pixelFormat.dwBBitMask == 0xff &&\n                pixelFormat.dwABitMask == 0xff000000 )\n        {\n            dds.format = { internal: 6408, format: 6408, type: 5121 };\n        }\n        else if ( pixelFormat.dwRGBBitCount == 16 && pixelFormat.dwRBitMask == 0xf00 &&\n                    pixelFormat.dwGBitMask == 0xf0  && pixelFormat.dwBBitMask == 0xf &&\n                    pixelFormat.dwABitMask == 0xf000 )\n        {\n            dds.format = { internal: 32854, format: 6408, type: 32819 };\n        }\n        else if ( pixelFormat.dwRGBBitCount == 16 && pixelFormat.dwRBitMask == 0x7C00 &&\n                    pixelFormat.dwGBitMask == 0x3E0 && pixelFormat.dwBBitMask == 0x1F &&\n                    pixelFormat.dwABitMask == 0x8000 )\n        {\n            dds.format = { internal: 32855, format: 6408, type: 32820 };\n        }\n        else\n        {\n            return false;\n        }\n    }\n    else if ( pixelFormat.dwFlags.DDPF_LUMINANCE && !pixelFormat.dwFlags.DDPF_ALPHAPIXELS )\n    {\n        if ( pixelFormat.dwRGBBitCount == 8 && pixelFormat.dwRBitMask == 0xff )\n        {\n            dds.format = { internal: 6409, format: 6409, type: 5121 };\n        }\n        else\n        {\n            return false;\n        }\n    }\n    else if ( pixelFormat.dwFlags.DDPF_LUMINANCE && pixelFormat.dwFlags.DDPF_ALPHAPIXELS )\n    {\n        if ( pixelFormat.dwRGBBitCount == 16 && pixelFormat.dwRBitMask == 0xff &&\n                pixelFormat.dwABitMask == 0xff00 )\n        {\n            dds.format = { internal: 6410, format: 6410, type: 5121 };\n        }\n        else\n        {\n            return false;\n        }\n    }\n    else if ( pixelFormat.dwFlags.DDPF_ALPHA )\n    {\n        if ( pixelFormat.dwRGBBitCount == 8 && pixelFormat.dwABitMask == 0xff )\n        {\n            dds.format = { internal: 6406, format: 6406, type: 5121 };\n        }\n        else\n        {\n            return false;\n        }\n    }\n    else\n    {\n        return false;\n    }\n\n    return true; \n};\n\nx3dom.DDSLoader.int32ToFourCC = function ( value ) \n{\n    return String.fromCharCode (\n\n        ( value       ) & 0xff,\n        ( value >> 8  ) & 0xff,\n        ( value >> 16 ) & 0xff,\n        ( value >> 24 ) & 0xff\n\n    ).replace( /[\\x00]/g, \"\" );\n};\n\nx3dom.DDSLoader.R8G8B8_To_B8G8R8 = function ( src )\n{\n    var dst = new Uint8Array( src.length );\n\n    for ( var i = 0; i < src.length; i += 3 )\n    {\n        dst[ i     ] = src[ i + 1 ];\n        dst[ i + 1 ] = src[ i + 0 ];\n        dst[ i + 2 ] = src[ i + 2 ];\n    }\n\n    return dst;\n};\n\nx3dom.DDSLoader.A8R8G8B8_To_A8B8G8R8 = function ( src )\n{\n    var dst = new Uint8Array( src.length );\n\n    for ( var i = 0; i < src.length; i += 4 )\n    {\n        dst[ i     ] = src[ i + 2 ];\n        dst[ i + 1 ] = src[ i + 1 ];\n        dst[ i + 2 ] = src[ i + 0 ];\n        dst[ i + 3 ] = src[ i + 3 ];\n    }\n\n    return dst;\n};\n\nx3dom.DDSLoader.UI16_To_UI8 = function ( src )\n{\n    var dst = new Uint8Array( src.length );\n\n    for ( var i = 0; i < src.length; i += 4 )\n    {\n        dst[ i     ] = x3dom.DDSLoader.UI16_To_UI8_2(src[ i     ]) * 255;\n        dst[ i + 1 ] = x3dom.DDSLoader.UI16_To_UI8_2(src[ i + 1 ]) * 255;\n        dst[ i + 2 ] = x3dom.DDSLoader.UI16_To_UI8_2(src[ i + 2 ]) * 255;\n        dst[ i + 3 ] = x3dom.DDSLoader.UI16_To_UI8_2(src[ i + 3 ]) * 255;\n    }\n\n    return dst;\n};\n\nx3dom.DDSLoader.UI16_To_F32 = function ( src )\n{\n    var dst = new Float32Array( src.length );\n\n    for ( var i = 0; i < src.length; i += 4 )\n    {\n        dst[ i     ] = x3dom.DDSLoader.UI16_To_F16(src[ i     ]);\n        dst[ i + 1 ] = x3dom.DDSLoader.UI16_To_F16(src[ i + 1 ]);\n        dst[ i + 2 ] = x3dom.DDSLoader.UI16_To_F16(src[ i + 2 ]);\n        dst[ i + 3 ] = x3dom.DDSLoader.UI16_To_F16(src[ i + 3 ]);\n    }\n\n    return dst;\n};\n\nx3dom.DDSLoader.UI16_To_F16 = function( interger )\n{\n    var sign     = (interger >> 15) & 0x1;\n    var exponent = (interger >> 10) & 0x3ff;\n    var fraction = interger & (Math.pow(2, 10) - 1);\n    var result;\n\n    if (exponent === 0)\n    {\n        if( fraction === 0 )\n        {\n            result = 0.0;\n        }\n        else\n        {\n            result = Math.pow(-1, sign) * fraction / Math.pow(2,10) * Math.pow(2,-14)\n        }\n    }\n\n    result = Math.pow(-1, sign) * (1 + fraction / Math.pow(2,10)) * Math.pow(2, exponent - 15);\n\n    return result;\n}\n\nx3dom.DDSLoader.UI16_To_UI8_2 = function( interger )\n{\n    var float = x3dom.DDSLoader.UI16_To_F16(interger)\n\n    return float / (float + 1);\n}\n\nx3dom.DDSLoader.A4R4G4B4_To_A4B4G4R4 = function ( src ) {\n\n    var a, r, g, b;\n\n    var dst = new Uint16Array( src.length );\n\n    for ( var i = 0; i < src.length; i++ )\n    {\n        a = ( src[ i ] >> 12 ) & 0xf;\n        r = ( src[ i ] >> 8  ) & 0xf;\n        g = ( src[ i ] >> 4  ) & 0xf;\n        b = ( src[ i ]       ) & 0xf;\n\n        var test = ( r << 12 ) & ( g << 8 ) & ( b << 4 ) & ( a );\n\n        dst[ i ] = ( r << 12 ) & ( g << 8 ) & ( b << 4 ) & ( a );\n    }\n\n    return dst;\n\n};\n\nx3dom.DDSLoader.A1R5G5B5_To_A1B5G5R5 = function ( src )\n{\n    var a, r, g, b;\n\n    var dst = new Uint16Array( src.length );\n\n    for ( var i = 0; i < src.length; i++ )\n    {\n        a = ( src[ i ] >> 15 ) & 0x1;\n        r = ( src[ i ] >> 10 ) & 0x1f;\n        g = ( src[ i ] >> 5  ) & 0x5f;\n        b = ( src[ i ]       ) & 0x5f;\n\n        dst[ i ] = ( r << 11 ) & ( g << 6 ) & ( b << 1 ) & ( a );\n    }\n\n    return dst;\n};\nx3dom.VRControllerManager = function()\n{\n    this.leftInline     = undefined;\n    this.leftTransform  = undefined;\n    this.rightInline    = undefined;\n    this.rightTransform = undefined;\n\n    this.leftGamepadIdx  = undefined;\n    this.rightGamepadIdx = undefined;\n    this.vrDisplay       = undefined;\n    this.wasPresenting   = false;\n\n    this.controllers = {\n        \"HTC Vive MV\" : {\n            left  : \"https://x3dom.org/download/assets/vr/vive.glb\",\n            right : \"https://x3dom.org/download/assets/vr/vive.glb\",\n            scaleFactor : new x3dom.fields.SFVec3f(40, 40, 40),\n            offset : new x3dom.fields.SFVec3f(),\n            axesScale : [1,1]\n        },\n        \"Oculus Oculus Rift CV1\" : {\n            left  : \"https://x3dom.org/download/assets/vr/oculus-touch-left.glb\",\n            right : \"https://x3dom.org/download/assets/vr/oculus-touch-right.glb\",\n            scaleFactor : new x3dom.fields.SFVec3f(39.5, 39.5, 39.5),\n            offset : new x3dom.fields.SFVec3f(),\n            axesScale : [1,1]\n        },\n        \"Oculus Go\" : {\n            left  : \"https://x3dom.org/download/assets/vr/oculus-go.glb\",\n            right : \"https://x3dom.org/download/assets/vr/oculus-go.glb\",\n            scaleFactor : new x3dom.fields.SFVec3f(1, 1, 1),\n            offset : new x3dom.fields.SFVec3f(0.2, -0.3, -0.3),\n            axesScale : [1,-1]\n        },\n        \"Emulated HTC Vive DVT\" : {\n            left  : \"https://x3dom.org/download/assets/vr/vive.glb\",\n            right : \"https://x3dom.org/download/assets/vr/vive.glb\",\n            scaleFactor : new x3dom.fields.SFVec3f(40, 40, 40),\n            offset : new x3dom.fields.SFVec3f(),\n            axesScale : [1,1]\n        },\n        \"WindowsMR DELL VISOR VR118\" : {\n            left  : \"https://x3dom.org/download/assets/vr/microsoft-left.glb\",\n            right : \"https://x3dom.org/download/assets/vr/microsoft-right.glb\",\n            scaleFactor : new x3dom.fields.SFVec3f(40, 40, 40),\n            offset : new x3dom.fields.SFVec3f(),\n            axesScale : [1,1]\n        }\n    }\n\n    this._addInlines();\n    this._addGamePadListeners();\n};\n\nx3dom.VRControllerManager.prototype._addGamePadListeners = function()\n{\n    window.addEventListener(\"gamepadconnected\", this._onGamePadConnected.bind(this));\n    window.addEventListener(\"gamepaddisconnected\", this._onGamePadDisconnected.bind(this));\n}\n\nx3dom.VRControllerManager.prototype._onGamePadConnected = function( e )\n{\n    var gamepad = e.gamepad;\n\n    navigator.getVRDisplays().then( function( displays ) {\n\n        var display = displays[0];\n\n        if(display && gamepad.displayId == display.displayId)\n        {\n            var controller = this.controllers[ display.displayName ];\n\n            if(!controller)\n            {\n                return;\n            }\n\n            if ( gamepad.hand == \"left\" )\n            {\n                this.leftGamepadIdx = gamepad.index;\n                this.leftInline.setAttribute( \"url\", controller.left );\n            }\n            else if ( gamepad.hand == \"right\" )\n            {\n                this.rightGamepadIdx = gamepad.index;\n                this.rightInline.setAttribute( \"url\", controller.right, controller.scaleFactor );\n            }\n        }\n\n    }.bind(this));\n}\n\nx3dom.VRControllerManager.prototype._onGamePadDisconnected = function( e )\n{\n    console.log( e );\n}\n\nx3dom.VRControllerManager.prototype._addInlines = function()\n{\n    var x3dScene = document.querySelector(\"scene\") || document.querySelector(\"Scene\")\n\n    if( x3dScene )\n    {\n        this.leftTransform  = document.createElement(\"matrixtransform\");\n        this.leftInline     = document.createElement(\"inline\");\n    \n        this.rightTransform  = document.createElement(\"matrixtransform\");\n        this.rightInline     = document.createElement(\"inline\");\n\n        this.leftInline.setAttribute(\"render\", \"false\");\n        this.rightInline.setAttribute(\"render\", \"false\");\n    \n        this.leftTransform.appendChild(this.leftInline);\n        this.rightTransform.appendChild(this.rightInline);\n\n        x3dScene.appendChild(this.leftTransform);\n        x3dScene.appendChild(this.rightTransform);\n    }\n}\nx3dom.VRControllerManager.prototype.fit = function( viewarea, vrDisplay )\n{\n    var min = viewarea._scene._lastMin;\n    var max = viewarea._scene._lastMax;\n\n    var dia2 = max.subtract(min).multiply(0.5);    // half diameter\n    var bsr = dia2.length();                       // bounding sphere radius\n\n    var viewDir = viewarea.vrLeftViewMatrix.e2();\n\n    var aspect =  Math.min(viewarea._width/viewarea._height, 1);\n\n    var tanfov2 = Math.tan(1.57 / 2.0);\n    var dist = bsr / tanfov2 / aspect;\n\n    viewarea._movement = viewDir.multiply(-dist)\n}\n\n\nx3dom.VRControllerManager.prototype.update = function( viewarea, vrDisplay )\n{\n    if ( !vrDisplay || (vrDisplay && !vrDisplay.isPresenting) )\n    {\n        if(this.wasPresenting)\n        {\n            this.leftInline.setAttribute(\"render\", \"false\");\n            this.rightInline.setAttribute(\"render\", \"false\");\n    \n            this.wasPresenting = false;\n        }\n        \n        return;\n    }\n    else\n    {\n        if(!this.wasPresenting)\n        {\n            this.leftInline.setAttribute(\"render\", \"true\");\n            this.rightInline.setAttribute(\"render\", \"true\");\n\n            this.fit(viewarea, vrDisplay);\n        }\n\n        this.wasPresenting = true;\n    }\n\n    var gamepads = navigator.getGamepads();\n    var controller = {};\n\n    if (this.leftGamepadIdx != undefined && gamepads[ this.leftGamepadIdx ] )\n    {\n        var gamepad = gamepads[ this.leftGamepadIdx ];\n        controller.left = gamepad;\n    }\n\n    if (this.rightGamepadIdx != undefined && gamepads[ this.rightGamepadIdx ] )\n    {\n        var gamepad = gamepads[ this.rightGamepadIdx ];\n        controller.right = gamepad;\n    }\n\n    this.onUpdate( viewarea, vrDisplay, controller );\n}\n\nx3dom.VRControllerManager.prototype.onUpdate = function( viewarea, vrDisplay, controllers )\n{\n    var transMat = new x3dom.fields.SFMatrix4f();\n    var rotMat = new x3dom.fields.SFMatrix4f();\n    var axes = [0, 0];\n    var axesScale = this.controllers[vrDisplay.displayName].axesScale;\n\n    if(controllers.left)\n    {   \n        axes[0] += controllers.left.axes[0] * axesScale[0];\n        axes[1] += controllers.left.axes[1] * axesScale[1];\n\n        if(controllers.left.buttons[1].pressed)\n        {\n            this.fit(viewarea);\n        }\n    }\n    \n    if(controllers.right)\n    {\n        axes[0] += controllers.right.axes[0] * axesScale[0];\n        axes[1] += controllers.right.axes[1] * axesScale[1];\n\n        if(controllers.right.buttons[1].pressed)\n        {\n            this.fit(viewarea);\n        }\n    }\n\n    var dx = axes[0] * 5;\n    var dy = axes[1] * 5;\n\n    var viewDir = viewarea.vrLeftViewMatrix.e2();\n    var rightDir = viewarea.vrLeftViewMatrix.e0();\n\n    var d = (viewarea._scene._lastMax.subtract(viewarea._scene._lastMin)).length();\n    d = ((d < x3dom.fields.Eps) ? 1 : d);\n\n    viewDir  = new x3dom.fields.SFVec3f(-viewDir.x,  -viewDir.y,  viewDir.z ).multiply(d * (dy/viewarea._height));\n    rightDir = new x3dom.fields.SFVec3f(-rightDir.x, -rightDir.y, rightDir.z).multiply(d * (dx/viewarea._width) );\n\n    viewarea._movement = viewarea._movement.add(rightDir).add(viewDir);\n    transMat = x3dom.fields.SFMatrix4f.translation(viewarea._movement);\n\n    viewarea.vrLeftViewMatrix  = viewarea.vrLeftViewMatrix.mult(transMat).mult(rotMat);\n    viewarea.vrRightViewMatrix = viewarea.vrRightViewMatrix.mult(transMat).mult(rotMat);\n\n    //Enable default Mouse Navigation\n    // viewarea.vrLeftViewMatrix  = viewarea.vrLeftViewMatrix.mult(viewarea._transMat).mult(viewarea._rotMat);\n    // viewarea.vrRightViewMatrix = viewarea.vrRightViewMatrix.mult(viewarea._transMat).mult(viewarea._rotMat);\n\n    this._updateControllerModels(viewarea, vrDisplay, controllers);\n}\n\nx3dom.VRControllerManager.prototype._updateControllerModels = function( viewarea, vrDisplay, controllers )\n{\n    if ( !vrDisplay || (vrDisplay && !vrDisplay.isPresenting) )\n    {\n        this.leftInline.setAttribute(\"render\", \"false\");\n        this.rightInline.setAttribute(\"render\", \"false\");\n        return;\n    }\n    else\n    {\n        this.leftInline.setAttribute(\"render\", \"true\");\n        this.rightInline.setAttribute(\"render\", \"true\");\n    }\n\n    if(controllers.left)\n    {\n        var pose = controllers.left.pose;\n        var rotation = (pose.orientation) ? x3dom.fields.Quaternion.fromArray(pose.orientation) : new x3dom.fields.Quaternion();\n        var position = (pose.position) ? x3dom.fields.SFVec3f.fromArray(pose.position) : this.controllers[ vrDisplay.displayName ].offset;\n        var scale    = this.controllers[ vrDisplay.displayName ].scaleFactor;\n\n        position = position.subtract(viewarea._movement);\n\n        var matrix = x3dom.fields.SFMatrix4f.fromRotationTranslationScale(rotation, position, scale);\n\n        this.leftTransform.setAttribute(\"matrix\", matrix.toString());\n    }\n\n    if(controllers.right)\n    {\n        var pose = controllers.right.pose;\n        var rotation = (pose.orientation) ? x3dom.fields.Quaternion.fromArray(pose.orientation) : new x3dom.fields.Quaternion();\n        var position = (pose.position) ? x3dom.fields.SFVec3f.fromArray(pose.position) : this.controllers[ vrDisplay.displayName ].offset;\n        var scale    = this.controllers[ vrDisplay.displayName ].scaleFactor;\n\n        position = position.subtract(viewarea._movement);\n\n        var matrix = x3dom.fields.SFMatrix4f.fromRotationTranslationScale(rotation, position, scale);\n\n        this.rightTransform.setAttribute(\"matrix\", matrix.toString());\n    }\n\n};\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * Philip Taylor: http://philip.html5.org\n */\n\n/**\n * The canvas object wraps the HTML canvas x3dom draws\n * @constructs x3dom.X3DCanvas\n * @param {Object} [x3dElement] - x3d element rendering into the canvas\n * @param {String} [canvasIdx] - id of HTML canvas\n */\nx3dom.X3DCanvas = function(x3dElem, canvasIdx)\n{\n    var that = this;\n\n    /**\n     * The index of the HTML canvas\n     * @member {String} _canvasIdx\n     */\n    this._canvasIdx = canvasIdx;\n\n    /**\n     * The X3D Element\n     * @member {X3DElement} x3dElem\n     */\n    this.x3dElem = x3dElem;\n\n    /**\n     * The current canvas dimensions\n     * @member {Array} _current_dim\n     */\n    this._current_dim = [0, 0];\n\n    // for FPS measurements\n    this.fps_t0 = new Date().getTime();\n    this.lastTimeFPSWasTaken = 0;\n    this.framesSinceLastTime = 0;\n\n    this._totalTime = 0;\n    this._elapsedTime = 0;\n\n    this.doc = null;\n\n    this.vrDisplay = null;\n    this.vrDisplayPromise = null;\n    this.vrFrameData = null;\n\n    this.devicePixelRatio = window.devicePixelRatio || 1;\n\n    this.lastMousePos = { x: 0, y: 0 };\n    //try to determine behavior of certain DOMNodeInsertedEvent:\n    //IE11 dispatches one event for each node in an inserted subtree, other browsers use a single event per subtree\n    x3dom.caps.DOMNodeInsertedEvent_perSubtree = !(navigator.userAgent.indexOf('MSIE')    != -1 ||\n                                                   navigator.userAgent.indexOf('Trident') != -1 );\n\n    // allow listening for (size) changes\n    x3dElem.__setAttribute = x3dElem.setAttribute;\n\n    //adds setAttribute function for width and height to the X3D element\n    x3dElem.setAttribute = function(attrName, newVal)\n    {\n        this.__setAttribute(attrName, newVal);\n\n        // scale resolution so device pixel are used rather then css pixels\n        newVal = parseInt(newVal);\n\n        switch(attrName) {\n\n            case \"width\":\n                that.canvas.setAttribute(\"width\", newVal * that.devicePixelRatio);\n                if (that.doc && that.doc._viewarea) {\n                    that.doc._viewarea._width = parseInt(that.canvas.getAttribute(\"width\"), 0);\n                    that.doc.needRender = true;\n                }\n                break;\n\n            case \"height\":\n                that.canvas.setAttribute(\"height\", newVal * that.devicePixelRatio);\n                if (that.doc && that.doc._viewarea) {\n                    that.doc._viewarea._height = parseInt(that.canvas.getAttribute(\"height\"), 0);\n                    that.doc.needRender = true;\n                }\n                break;\n\n            default:\n                break;\n        }\n    };\n\n\n    x3dom.caps.MOBILE = (navigator.appVersion.indexOf(\"Mobile\") > -1);\n\n    this.backend = this.x3dElem.getAttribute('backend');\n\t\n    this.backend = ( this.backend ) ? this.backend.toLowerCase() : 'none';\n        \n    this.canvas = this._createHTMLCanvas( x3dElem );\n\n    x3dom.debug.appendElement(x3dElem);\n\t\n\tthis.canvas.parent = this;\n\t\n\tthis.gl = this._initContext( this.canvas, (this.backend.search(\"desktop\") >= 0),\n\t\t(this.backend.search(\"mobile\") >= 0),\n\t\t(this.backend.search(\"webgl2\") >= 0));\n\tthis.backend = 'webgl';\n\t\n\tif (this.gl == null)\n\t{\n\t\tthis.hasRuntime = false;\n\t\tthis._createInitFailedDiv(x3dElem);\n\t\treturn;\n\t}\n\n    x3dom.caps.BACKEND = this.backend;\n\n    var runtimeEnabled = x3dElem.getAttribute(\"runtimeEnabled\");\n\n    if (runtimeEnabled !== null)\n\t{\n        this.hasRuntime = (runtimeEnabled.toLowerCase() == \"true\");\n    }\n\telse\n\t{\n        this.hasRuntime = x3dElem.hasRuntime;\n    }\n\n\t/**\n\t * STATS VIEWER STUFF\n\t * TODO MOVE IT TO MAIN.JS\n\t */\n    this.showStat = x3dElem.getAttribute(\"showStat\");\n    this.stateViewer = new x3dom.States(x3dElem);\n\t\n\tif (this.showStat !== null && this.showStat == \"true\")\n\t{\n\t\tthis.stateViewer.display(true);\n\t}\n\n    this.x3dElem.appendChild(this.stateViewer.viewer);\n\n\t\n\t\n    // progress bar\n    this.showProgress = x3dElem.getAttribute(\"showProgress\");\n    this.progressDiv = this._createProgressDiv();\n    this.progressDiv.style.display = (this.showProgress !== null && this.showProgress == \"true\") ? \"flex\" : \"none\";\n    this.x3dElem.appendChild(this.progressDiv);\n\n    // vr button\n    this.vrDiv = this._createVRDiv();\n    this.x3dElem.appendChild(this.vrDiv);\n\n    // touch visualization\n    this.showTouchpoints = x3dElem.getAttribute(\"showTouchpoints\");\n    this.showTouchpoints = this.showTouchpoints ? this.showTouchpoints : false;\n\n    // disable touch events\n    this.disableTouch = x3dElem.getAttribute(\"disableTouch\");\n    this.disableTouch = this.disableTouch ? (this.disableTouch.toLowerCase() == \"true\") : false;\n\t\n\tthis.disableKeys = x3dElem.getAttribute(\"disableKeys\");\n\tthis.disableKeys = this.disableKeys ? (this.disableKeys.toLowerCase() == \"true\") : false;\n\t\n\tthis.disableRightDrag = x3dElem.getAttribute(\"disableRightDrag\");\n\tthis.disableRightDrag = this.disableRightDrag ? (this.disableRightDrag.toLowerCase() == \"true\") : false;\n\t\n\tthis.disableLeftDrag = x3dElem.getAttribute(\"disableLeftDrag\");\n\tthis.disableLeftDrag = this.disableLeftDrag ? (this.disableLeftDrag.toLowerCase() == \"true\") : false;\n\t\n\tthis.disableMiddleDrag = x3dElem.getAttribute(\"disableMiddleDrag\");\n\tthis.disableMiddleDrag = this.disableMiddleDrag ? (this.disableMiddleDrag.toLowerCase() == \"true\") : false;\n\n    this.bindEventListeners();\n};\n\n\nx3dom.X3DCanvas.prototype.bindEventListeners = function() {\n    var that = this;\n\n    this.onMouseDown = function (evt) {\n        if(!this.isMulti) {\n            this.focus();\n            this.classList.add('x3dom-canvas-mousedown');\n\n            switch(evt.button) {\n                case 0:  this.mouse_button = 1; break;  //left\n                case 1:  this.mouse_button = 4; break;  //middle\n                case 2:  this.mouse_button = 2; break;  //right\n                default: this.mouse_button = 0; break;\n            }\n\n            if (evt.shiftKey) { this.mouse_button = 1; }\n            if (evt.ctrlKey)  { this.mouse_button = 4; }\n            if (evt.altKey)   { this.mouse_button = 2; }\n\n            var pos = this.parent.mousePosition(evt);\n            this.mouse_drag_x = pos.x;\n            this.mouse_drag_y = pos.y;\n\n            this.mouse_dragging = true;\n\n            this.parent.doc.onMousePress(that.gl, this.mouse_drag_x, this.mouse_drag_y, this.mouse_button);\n            this.parent.doc.needRender = true;\n        }\n    }\n\n    this.onMouseUp = function (evt) {\n        if(!this.isMulti) {\n            var prev_mouse_button = this.mouse_button;\n            this.classList.remove('x3dom-canvas-mousedown');\n\n            this.mouse_button = 0;\n            this.mouse_dragging = false;\n\n            this.parent.doc.onMouseRelease(that.gl, this.mouse_drag_x, this.mouse_drag_y, this.mouse_button, prev_mouse_button);\n            this.parent.doc.needRender = true;\n        }\n    }\n\n    this.onMouseOver = function (evt) {\n        if(!this.isMulti) {\n            this.mouse_button = 0;\n            this.mouse_dragging = false;\n\n            this.parent.doc.onMouseOver(that.gl, this.mouse_drag_x, this.mouse_drag_y, this.mouse_button);\n            this.parent.doc.needRender = true;\n        }\n    }\n\n    this.onMouseAlt = function (evt) {\n        if(!this.isMulti) {\n            this.mouse_button = 0;\n            this.mouse_dragging = false;\n            this.classList.remove('x3dom-canvas-mousedown');\n\n            this.parent.doc.onMouseOut(that.gl, this.mouse_drag_x, this.mouse_drag_y, this.mouse_button);\n            this.parent.doc.needRender = true;\n        }\n    }\n\n    this.onDoubleClick = function (evt) {\n        if(!this.isMulti) {\n            this.mouse_button = 0;\n\n            var pos = this.parent.mousePosition(evt);\n            this.mouse_drag_x = pos.x;\n            this.mouse_drag_y = pos.y;\n\n            this.mouse_dragging = false;\n\n            this.parent.doc.onDoubleClick(that.gl, this.mouse_drag_x, this.mouse_drag_y);\n            this.parent.doc.needRender = true;\n        }\n    }\n\n    this.onMouseMove = function (evt) {\n        if(!this.isMulti) {\n\n            var pos = this.parent.mousePosition(evt);\n            \n            if ( pos.x != that.lastMousePos.x || pos.y != that.lastMousePos.y ) {\n                that.lastMousePos = pos;\n                \n                this.mouse_drag_x = pos.x;\n                this.mouse_drag_y = pos.y;\n\n                if (this.mouse_dragging) {\n                    \n                    if (evt.shiftKey) { this.mouse_button = 1; }\n                    if (evt.ctrlKey)  { this.mouse_button = 4; }\n                    if (evt.altKey)   { this.mouse_button = 2; }\n                    \n                    if ( this.mouse_button == 1 && !this.parent.disableLeftDrag ||\n                         this.mouse_button == 2 && !this.parent.disableRightDrag ||\n                         this.mouse_button == 4 && !this.parent.disableMiddleDrag ) \n                    {\n                        this.parent.doc.onDrag(that.gl, this.mouse_drag_x, this.mouse_drag_y, this.mouse_button);\n                    }\n                }\n                else {\n                    this.parent.doc.onMove(that.gl, this.mouse_drag_x, this.mouse_drag_y, this.mouse_button);\n                }\n\n                this.parent.doc.needRender = true;\n\n                // deliberately different for performance reasons\n                evt.preventDefault();\n                evt.stopPropagation();\n            }\n        }\n    }\n\n    this.onDOMMouseScroll = function (evt) {\n        if(!this.isMulti) {\n            this.focus();\n\n            var originalY = this.parent.mousePosition(evt).y;\n            if(this.parent.doc._scene.getNavigationInfo()._vf.reverseScroll == true){\n                this.mouse_drag_y -= 2 * evt.detail;\n            }\n            else{\n                this.mouse_drag_y += 2 * evt.detail;\n            }\n\n            this.parent.doc.onWheel(that.gl, this.mouse_drag_x, this.mouse_drag_y, originalY);\n            this.parent.doc.needRender = true;\n\n            evt.preventDefault();\n            evt.stopPropagation();\n        }\n    }\n\n    this.onKeyPress = function (evt) {\n        if (!this.parent.disableKeys) {\n            evt.preventDefault();\n            this.parent.doc.onKeyPress(evt.charCode);\n        }\n        this.parent.doc.needRender = true;\n    }\n\n    this.onMouseWheel = function (evt) {\n        if(!this.isMulti) {\n            this.focus();\n\n            var originalY = this.parent.mousePosition(evt).y;\n            \n            if(this.parent.doc._scene.getNavigationInfo()._vf.reverseScroll == true){\n                this.mouse_drag_y += 0.1 * evt.wheelDelta;\n            }\n            else{\n                this.mouse_drag_y -= 0.1 * evt.wheelDelta;\n            }\n\n            this.parent.doc.onWheel(that.gl, this.mouse_drag_x, this.mouse_drag_y, originalY);\n            this.parent.doc.needRender = true;\n\n            evt.preventDefault();\n            evt.stopPropagation();\n        }\n    }\n\n    this.onKeyUp = function (evt) {\n        if (!this.parent.disableKeys) {\n            this.parent.doc.onKeyUp(evt.keyCode);\n        }\n        this.parent.doc.needRender = true;\n    }\n\n    this.onKeyDown = function (evt) {\n        if (!this.parent.disableKeys) {\n            this.parent.doc.onKeyDown(evt.keyCode);\n        }\n        this.parent.doc.needRender = true;\n    }\n\n    this.onVrDisplayPresentChange = function(evt) {\n        if(this.vrDisplay && this.vrDisplay.isPresenting)\n        {\n            var leftEye = this.vrDisplay.getEyeParameters('left');\n            var rightEye = this.vrDisplay.getEyeParameters('right');\n\n            this._oldCanvasWidth  = this.canvas.width;\n            this._oldCanvasHeight = this.canvas.height;\n\n            this.canvas.width = Math.max(leftEye.renderWidth, rightEye.renderWidth) * 2;\n            this.canvas.height = Math.max(leftEye.renderHeight, rightEye.renderHeight);\n\n            this.gl.VRMode = 2;\n            this.doc.needRender = true;\n        }\n        else if(this.vrDisplay && !this.vrDisplay.isPresenting)\n        {\n            this.canvas.width  = this._oldCanvasWidth;\n            this.canvas.height = this._oldCanvasHeight;\n\n            this.vrFrameData = null;\n\n            this.gl.VRMode = 1;\n            this.doc.needRender = true;\n        }\n    };\n\n    if (this.canvas !== null && this.gl !== null && this.hasRuntime) {\n        // event handler for mouse interaction\n        this.canvas.mouse_dragging = false;\n        this.canvas.mouse_button = 0;\n        this.canvas.mouse_drag_x = 0;\n        this.canvas.mouse_drag_y = 0;\n\n        this.canvas.isMulti = false;    // don't interfere with multi-touch\n\n        this.canvas.oncontextmenu = function(evt) {\n            evt.preventDefault();\n            evt.stopPropagation();\n            return false;\n        };\n\n        // TODO: handle context lost events properly\n        this.canvas.addEventListener(\"webglcontextlost\", function(event) {\n            x3dom.debug.logError(\"WebGL context lost\");\n            event.preventDefault();\n        }, false);\n\n        this.canvas.addEventListener(\"webglcontextrestored\", function(event) {\n            x3dom.debug.logError(\"recover WebGL state and resources on context lost NYI\");\n            event.preventDefault();\n        }, false);\n\n        // VR Events\n        window.addEventListener('vrdisplaypresentchange', this.onVrDisplayPresentChange.bind(this), false);\n\n        // Mouse Events\n        this.canvas.addEventListener('mousedown', this.onMouseDown , false);\n\n        this.canvas.addEventListener('mouseup', this.onMouseUp, false);\n\n        this.canvas.addEventListener('mouseover', this.onMouseOver, false);\n\n        this.canvas.addEventListener('mouseout', this.onMouseOut, false);\n\n        this.canvas.addEventListener('dblclick', this.onDoubleClick, false);\n\n        this.canvas.addEventListener('mousemove', this.onMouseMove, false);\n\n        this.canvas.addEventListener('DOMMouseScroll', this.onDOMMouseScroll, false);\n\n        this.canvas.addEventListener('mousewheel', this.onMouseWheel, false);\n\n\n        // Key Events\n        this.canvas.addEventListener('keypress', this.onKeyPress, true);\n\n        // in webkit special keys are only handled on key-up\n        this.canvas.addEventListener('keyup', this.onKeyUp, true);\n\n        this.canvas.addEventListener('keydown', this.onKeyDown, true);\n\n\n        // Multitouch Events\n        var touches =\n        {\n            numTouches : 0,\n\n            firstTouchTime: new Date().getTime(),\n            firstTouchPoint: new x3dom.fields.SFVec2f(0,0),\n\n            lastPos : new x3dom.fields.SFVec2f(),\n            lastDrag : new x3dom.fields.SFVec2f(),\n\n            lastMiddle : new x3dom.fields.SFVec2f(),\n            lastSquareDistance : 0,\n            lastAngle : 0,\n            lastLayer : [],\n\n            examineNavType: 1,\n\n            calcAngle : function(vector)\n            {\n                var rotation = vector.normalize().dot(new x3dom.fields.SFVec2f(1,0));\n                rotation = Math.acos(rotation);\n\n                if(vector.y < 0)\n                    rotation = Math.PI + (Math.PI - rotation);\n\n                return rotation;\n            },\n\n            disableTouch: this.disableTouch,\n            // set a marker in HTML so we can track the position of the finger visually\n            visMarker: this.showTouchpoints,\n            visMarkerBag: [],\n\n            visualizeTouches: function(evt)\n            {\n                if (!this.visMarker)\n                    return;\n\n                var touchBag = [];\n                var marker = null;\n\n                for (var i=0; i<evt.touches.length; i++) {\n                    var id = evt.touches[i].identifier || evt.touches[i].streamId;\n                    if (!id) id = 0;\n\n                    var index = this.visMarkerBag.indexOf(id);\n\n                    if (index >= 0) {\n                        marker = document.getElementById(\"visMarker\" + id);\n\n                        marker.style.left = (evt.touches[i].pageX) + \"px\";\n                        marker.style.top  = (evt.touches[i].pageY) + \"px\";\n                    }\n                    else {\n                        marker = document.createElement(\"div\");\n\n                        marker.appendChild(document.createTextNode(\"#\" + id));\n                        marker.id = \"visMarker\" + id;\n                        marker.className = \"x3dom-touch-marker\";\n                        document.body.appendChild(marker);\n\n                        index = this.visMarkerBag.length;\n                        this.visMarkerBag[index] = id;\n                    }\n\n                    touchBag.push(id);\n                }\n\n                for (var j=this.visMarkerBag.length-1; j>=0; j--) {\n                    var oldId = this.visMarkerBag[j];\n\n                    if (touchBag.indexOf(oldId) < 0) {\n                        this.visMarkerBag.splice(j, 1);\n                        marker = document.getElementById(\"visMarker\" + oldId);\n                        document.body.removeChild(marker);\n                    }\n                }\n            }\n        };\n\n        // === Touch Start ===\n        var touchStartHandler = function(evt, doc)\n        {\n            this.isMulti = true;\n            evt.preventDefault();\n            touches.visualizeTouches(evt);\n\n            this.focus();\n\n            if (doc == null)\n                doc = this.parent.doc;\n\n            var navi = doc._scene.getNavigationInfo();\n\n            switch(navi.getType()) {\n                case \"examine\":\n                    touches.examineNavType = 1;\n                    break;\n                case \"turntable\":\n                    touches.examineNavType = 2;\n                    break;\n                default:\n                    touches.examineNavType = 0;\n                    break;\n            }\n\n            touches.lastLayer = [];\n\n            var i, pos;\n            for(i = 0; i < evt.touches.length; i++) {\n                pos = this.parent.mousePosition(evt.touches[i]);\n                touches.lastLayer.push([evt.touches[i].identifier, new x3dom.fields.SFVec2f(pos.x,pos.y)]);\n            }\n\n            if(touches.numTouches < 1 && evt.touches.length == 1) {\n\n                touches.numTouches = 1;\n                touches.lastDrag = new x3dom.fields.SFVec2f(evt.touches[0].screenX, evt.touches[0].screenY);\n            }\n            else if(touches.numTouches < 2 && evt.touches.length >= 2) {\n\n                touches.numTouches = 2;\n\n                var touch0 = new x3dom.fields.SFVec2f(evt.touches[0].screenX, evt.touches[0].screenY);\n                var touch1 = new x3dom.fields.SFVec2f(evt.touches[1].screenX, evt.touches[1].screenY);\n\n                var distance = touch1.subtract(touch0);\n                var middle = distance.multiply(0.5).add(touch0);\n                var squareDistance = distance.dot(distance);\n\n                touches.lastMiddle = middle;\n                touches.lastSquareDistance = squareDistance;\n                touches.lastAngle = touches.calcAngle(distance);\n\n                touches.lastPos = this.parent.mousePosition(evt.touches[0]);\n            }\n\n            // update scene bbox\n            doc._scene.updateVolume();\n\n            if (touches.examineNavType == 1) {\n                for(i = 0; i < evt.touches.length; i++) {\n                    pos = this.parent.mousePosition(evt.touches[i]);\n                    doc.onPick(that.gl, pos.x, pos.y);\n\n                    //Trigger onmouseover to collect affected X3DPointingDeviceSensorNodes \n                    doc._viewarea.prepareEvents(pos.x, pos.y, 0, \"onmouseover\");\n                    doc._viewarea.prepareEvents(pos.x, pos.y, 1, \"onmousedown\");\n\n                    doc._viewarea._pickingInfo.lastClickObj = doc._viewarea._pickingInfo.pickObj;\n                }\n            }\n            else if (evt.touches.length) {\n                pos = this.parent.mousePosition(evt.touches[0]);\n                doc.onMousePress(that.gl, pos.x, pos.y, 1);     // 1 means left mouse button\n            }\n\n            doc.needRender = true;\n\n        };\n\n        // === Touch Move ===\n        var touchMoveHandler = function(evt, doc)\n        {\n            evt.preventDefault();\n            touches.visualizeTouches(evt);\n\n            if (doc == null)\n                doc = this.parent.doc;\n\n            var pos = null;\n            var rotMatrix = null;\n\n            var touch0, touch1, distance, middle, squareDistance, deltaMiddle, deltaZoom, deltaMove;\n\n            if (touches.examineNavType == 1) {\n\n                // one finger: x/y rotation\n                if(evt.touches.length == 1) {\n                    var currentDrag = new x3dom.fields.SFVec2f(evt.touches[0].screenX, evt.touches[0].screenY);\n\n                    var deltaDrag = currentDrag.subtract(touches.lastDrag);\n                    touches.lastDrag = currentDrag;\n\n                    var mx = x3dom.fields.SFMatrix4f.rotationY(deltaDrag.x / 100);\n                    var my = x3dom.fields.SFMatrix4f.rotationX(deltaDrag.y / 100);\n                    rotMatrix = mx.mult(my);\n\n                    doc.onMoveView(that.gl, evt, touches, null, rotMatrix);\n\n                    //Trigger onmousemove to notify X3DPointingDeviceSensorNodes \n                    pos = this.parent.mousePosition(evt.touches[0]);\n                    doc.onPick(that.gl, pos.x, pos.y);\n                    doc._viewarea.prepareEvents(pos.x, pos.y, 1, \"onmousemove\");\n                }\n                // two fingers: scale, translation, rotation around view (z) axis\n                else if(evt.touches.length >= 2) {\n                    touch0 = new x3dom.fields.SFVec2f(evt.touches[0].screenX, evt.touches[0].screenY);\n                    touch1 = new x3dom.fields.SFVec2f(evt.touches[1].screenX, evt.touches[1].screenY);\n\n                    distance = touch1.subtract(touch0);\n                    middle = distance.multiply(0.5).add(touch0);\n                    squareDistance = distance.dot(distance);\n\n                    deltaMiddle = middle.subtract(touches.lastMiddle);\n                    deltaZoom = squareDistance - touches.lastSquareDistance;\n\n                    deltaMove = new x3dom.fields.SFVec3f(\n                                deltaMiddle.x / screen.width, -deltaMiddle.y / screen.height,\n                                deltaZoom / (screen.width * screen.height * 0.2));\n\n                    var rotation = touches.calcAngle(distance);\n                    var angleDelta = touches.lastAngle - rotation;\n                    touches.lastAngle = rotation;\n\n                    rotMatrix = x3dom.fields.SFMatrix4f.rotationZ(angleDelta);\n\n                    touches.lastMiddle = middle;\n                    touches.lastSquareDistance = squareDistance;\n\n                    doc.onMoveView(that.gl, evt, touches, deltaMove, rotMatrix);\n                }\n            }\n            else if (evt.touches.length) {\n                if (touches.examineNavType == 2 && evt.touches.length >= 2) {\n                    touch0 = new x3dom.fields.SFVec2f(evt.touches[0].screenX, evt.touches[0].screenY);\n                    touch1 = new x3dom.fields.SFVec2f(evt.touches[1].screenX, evt.touches[1].screenY);\n\n                    distance = touch1.subtract(touch0);\n                    squareDistance = distance.dot(distance);\n                    deltaZoom = (squareDistance - touches.lastSquareDistance) / (0.1 * (screen.width + screen.height));\n\n                    touches.lastPos.y += deltaZoom;\n                    touches.lastSquareDistance = squareDistance;\n\n                    doc.onDrag(that.gl, touches.lastPos.x, touches.lastPos.y, 2);\n                }\n                else {\n                    pos = this.parent.mousePosition(evt.touches[0]);\n\n                    doc.onDrag(that.gl, pos.x, pos.y, 1);\n                }\n            }\n\n            doc.needRender = true;\n        };\n\n        // === Touch end ===\n        var touchEndHandler = function(evt, doc)\n        {\n            this.isMulti = false;\n            evt.preventDefault();\n            touches.visualizeTouches(evt);\n\n            if (doc == null)\n                doc = this.parent.doc;\n\n            doc._viewarea._isMoving = false;\n\n            // reinit first finger for rotation\n            if (touches.numTouches == 2 && evt.touches.length == 1)\n                touches.lastDrag = new x3dom.fields.SFVec2f(evt.touches[0].screenX, evt.touches[0].screenY);\n\n\n            // if all touches are released, reset the list of currently affected pointing sensors\n            if(evt.touches.length == 0)\n            {   \n                var affectedPointingSensorsList = doc._nodeBag.affectedPointingSensors;\n                for (var i = 0; i < affectedPointingSensorsList.length; ++i)\n                {\n                    affectedPointingSensorsList[i].pointerReleased();\n                }\n\n                doc._nodeBag.affectedPointingSensors = [];\n            }\n\n            var dblClick = false;\n\n            if (evt.touches.length < 2) {\n                if (touches.numTouches == 1)\n                    dblClick = true;\n                touches.numTouches = evt.touches.length;\n            }\n\n            if (touches.examineNavType == 1) {\n                for(var i = 0; i < touches.lastLayer.length; i++) {\n                    var pos = touches.lastLayer[i][1];\n\n                    doc.onPick(that.gl, pos.x, pos.y);\n\n                    if (doc._scene._vf.pickMode.toLowerCase() !== \"box\") {\n                        doc._viewarea.prepareEvents(pos.x, pos.y, 1, \"onmouseup\");\n                        doc._viewarea._pickingInfo.lastClickObj = doc._viewarea._pickingInfo.pickObj;\n\n                        // click means that mousedown _and_ mouseup were detected on same element\n                        if (doc._viewarea._pickingInfo.pickObj &&\n                            doc._viewarea._pickingInfo.pickObj ===\n                                doc._viewarea._pickingInfo.lastClickObj) {\n\n                            doc._viewarea.prepareEvents(pos.x, pos.y, 1, \"onclick\");\n                        }\n                    }\n                    else {\n                        var line = doc._viewarea.calcViewRay(pos.x, pos.y);\n                        var isect = doc._scene.doIntersect(line);\n                        var obj = line.hitObject;\n\n                        if (isect && obj) {\n                            doc._viewarea._pick.setValues(line.hitPoint);\n                            doc._viewarea.checkEvents(obj, pos.x, pos.y, 1, \"onclick\");\n\n                            x3dom.debug.logInfo(\"Hit '\" + obj._xmlNode.localName + \"/ \" +\n                                obj._DEF + \"' at pos \" + doc._viewarea._pick);\n                        }\n                    }\n                }\n\n                if (dblClick) {\n                    var now = new Date().getTime();\n                    var dist = touches.firstTouchPoint.subtract(touches.lastDrag).length();\n\n                    if (dist < 18 && now - touches.firstTouchTime < 180)\n                        doc.onDoubleClick(that.gl, 0, 0);\n\n                    touches.firstTouchTime = now;\n                    touches.firstTouchPoint = touches.lastDrag;\n                }\n            }\n            else if (touches.lastLayer.length) {\n                pos = touches.lastLayer[0][1];\n                doc.onMouseRelease(that.gl, pos.x, pos.y, 0, 1);\n            }\n\n            doc.needRender = true;\n        };\n\n        if (!this.disableTouch)\n        {\n            // w3c / apple touch events (in Chrome via chrome://flags)\n            this.canvas.addEventListener('touchstart',    touchStartHandler, true);\n            this.canvas.addEventListener('touchmove',     touchMoveHandler,  true);\n            this.canvas.addEventListener('touchend',      touchEndHandler,   true);\n        }\n    }\n};\n\n\n//----------------------------------------------------------------------------------------------------------------------\n\n/**\n * Creates the WebGL context and returns it\n * @returns {WebGLContext} gl\n * @param {HTMLCanvas} canvas\n * @param {Boolean} forbidMobileShaders - no mobile shaders allowed\n * @param {Boolean} forceMobileShaders - force mobile shaders\n * @param {Boolean} forceFlashForIE - force flash backend for internet explorer\n * @param {Boolean} tryWebGL2 - try to retrieve a WebGL2 context\n */\nx3dom.X3DCanvas.prototype._initContext = function(canvas, forbidMobileShaders, forceMobileShaders, tryWebGL2)\n{\n    x3dom.debug.logInfo(\"Initializing X3DCanvas for [\" + canvas.id + \"]\");\n    var gl = x3dom.gfx_webgl(canvas, forbidMobileShaders, forceMobileShaders, tryWebGL2, this.x3dElem);\n\n    if (!gl)\n    {\n        x3dom.debug.logError(\"No 3D context found...\");\n        this.x3dElem.removeChild(canvas);\n        return null;\n    }\n    else\n    {\n        var webglVersion = parseFloat(x3dom.caps.VERSION.match(/\\d+\\.\\d+/)[0]);\n        if (webglVersion < 1.0) {\n\t\t\tx3dom.debug.logError(\"WebGL version \" + x3dom.caps.VERSION +\n\t\t\t\t\" lacks important WebGL/GLSL features needed for shadows, special vertex attribute types, etc.!\");\n        }\n    }\n\n    return gl;\n};\n\n//----------------------------------------------------------------------------------------------------------------------\n\n/**\n * Creates a param node and adds it to the target node's children\n * @param {String} node - the target node\n * @param {String} name - the name for the parameter\n * @param {String} value - the value for the parameter\n */\nx3dom.X3DCanvas.prototype.appendParam = function(node, name, value) {\n    var param = document.createElement('param');\n    param.setAttribute('name', name);\n    param.setAttribute('value', value);\n    node.appendChild( param );\n};\n\n//----------------------------------------------------------------------------------------------------------------------\n\n/**\n * Creates a div to inform the user that the initialization failed\n * @param {String} x3dElem - the X3D element\n */\nx3dom.X3DCanvas.prototype._createInitFailedDiv = function(x3dElem) {\n    var div = document.createElement('div');\n    div.setAttribute(\"id\", \"x3dom-create-init-failed\");\n    div.style.width = x3dElem.getAttribute(\"width\");\n    div.style.height = x3dElem.getAttribute(\"height\");\n    div.style.backgroundColor = \"#C00\";\n    div.style.color = \"#FFF\";\n    div.style.fontSize = \"20px\";\n    div.style.fontWidth = \"bold\";\n    div.style.padding = \"10px 10px 10px 10px\";\n    div.style.display = \"inline-block\";\n    div.style.fontFamily = \"Helvetica\";\n    div.style.textAlign = \"center\";\n\n    div.appendChild(document.createTextNode('Your Browser does not support X3DOM'));\n    div.appendChild(document.createElement('br'));\n    div.appendChild(document.createTextNode('Read more about Browser support on:'));\n    div.appendChild(document.createElement('br'));\n\n    var link = document.createElement('a');\n    link.setAttribute('href', 'http://www.x3dom.org/?page_id=9');\n    link.appendChild( document.createTextNode('X3DOM | Browser Support'));\n    div.appendChild(link);\n\n    // check if \"altImg\" is specified on x3d element and if so use it as background\n    var altImg = x3dElem.getAttribute(\"altImg\") || null;\n    if (altImg) {\n        var altImgObj = new Image();\n        altImgObj.src = altImg;\n        div.style.backgroundImage = \"url(\"+altImg+\")\";\n        div.style.backgroundRepeat = \"no-repeat\";\n        div.style.backgroundPosition = \"50% 50%\";\n    }\n\n    x3dElem.appendChild(div);\n\n    x3dom.debug.logError(\"Your Browser does not support X3DOM!\");\n};\n\n//----------------------------------------------------------------------------------------------------------------------\n\n/**\n * Creates the HTML canvas used as render target\n * @returns {HTMLCanvas} - the created canvas\n * @param {HTMLNode} x3dElem - the X3D root node\n */\nx3dom.X3DCanvas.prototype._createHTMLCanvas = function(x3dElem)\n{\n    x3dom.debug.logInfo(\"Creating canvas for (X)3D element...\");\n    var canvas = document.createElement('canvas');\n    canvas.setAttribute(\"class\", \"x3dom-canvas\");\n\n    // check if user wants to style the X3D element\n    var userStyle = x3dElem.getAttribute(\"style\");\n    if (userStyle) {\n        x3dom.debug.logInfo(\"Inline X3D styles detected\");\n    }\n\n    // check if user wants to attach events to the X3D element\n    var evtArr = [\n        \"onmousedown\",\n        \"onmousemove\",\n        \"onmouseout\",\n        \"onmouseover\",\n        \"onmouseup\",\n        \"onclick\",\n        \"ondblclick\",\n        \"onkeydown\",\n        \"onkeypress\",\n        \"onkeyup\",\n\n        // w3c touch: http://www.w3.org/TR/2011/WD-touch-events-20110505/\n        \"ontouchstart\",\n        \"ontouchmove\",\n        \"ontouchend\",\n        \"ontouchcancel\",\n        \"ontouchleave\",\n        \"ontouchenter\",\n\n        // drag and drop, requires 'draggable' source property set true (usually of an img)\n        \"ondragstart\",\n        \"ondrop\",\n        \"ondragover\"\n    ];\n\n    // TODO; handle attribute event handlers dynamically during runtime\n    //this step is necessary because of some weird behavior in some browsers:\n    //we need a canvas element on startup to make every callback (e.g., 'onmousemove') work,\n    //which was previously set for the canvas' outer elements\n    for (var i=0; i < evtArr.length; i++)\n    {\n        var evtName = evtArr[i];\n        var userEvt = x3dElem.getAttribute(evtName);\n        if (userEvt) {\n            x3dom.debug.logInfo(evtName +\", \"+ userEvt);\n\n            canvas.setAttribute(evtName, userEvt);\n\n            //remove the event attribute from the X3D element to prevent duplicate callback invocation\n            x3dElem.removeAttribute(evtName);\n        }\n    }\n\n    var userProp = x3dElem.getAttribute(\"draggable\");\n    if (userProp) {\n        x3dom.debug.logInfo(\"draggable=\" + userProp);\n        canvas.setAttribute(\"draggable\", userProp);\n    }\n\n    // workaround since one cannot find out which handlers are registered\n    if (!x3dElem.__addEventListener && !x3dElem.__removeEventListener)\n    {\n        x3dElem.__addEventListener = x3dElem.addEventListener;\n        x3dElem.__removeEventListener = x3dElem.removeEventListener;\n\n        // helpers to propagate the element's listeners\n        x3dElem.addEventListener = function(type, func, phase) {\n            var j, found = false;\n            for (j=0; j < evtArr.length && !found; j++) {\n                if (evtArr[j] === type) {\n                    found = true;\n                }\n            }\n\n            if (found) {\n                x3dom.debug.logInfo('addEventListener for div.on' + type);\n                canvas.addEventListener(type, func, phase);\n            } else {\n                x3dom.debug.logInfo('addEventListener for X3D.on' + type);\n                this.__addEventListener(type, func, phase);\n            }\n        };\n\n        x3dElem.removeEventListener = function(type, func, phase) {\n            var j, found = false;\n            for (j=0; j<evtArr.length && !found; j++) {\n                if (evtArr[j] === type) {\n                    found = true;\n                }\n            }\n\n            if (found) {\n                x3dom.debug.logInfo('removeEventListener for div.on' + type);\n                canvas.removeEventListener(type, func, phase);\n            } else {\n                x3dom.debug.logInfo('removeEventListener for X3D.on' + type);\n                this.__removeEventListener(type, func, phase);\n            }\n        };\n    }\n\n    //add element-specific (global) events for the X3D tag\n    if (x3dElem.hasAttribute(\"ondownloadsfinished\"))\n    {\n        x3dElem.addEventListener(\"downloadsfinished\",\n            function()\n            {\n                var eventObject = {\n                    target: x3dElem,\n                    type: \"downloadsfinished\"\n                };\n\n                var funcStr = x3dElem.getAttribute(\"ondownloadsfinished\");\n                var func = new Function('event', funcStr);\n                func.call(x3dElem, eventObject);\n            },\n            true);\n    }\n\n    x3dElem.appendChild(canvas);\n\n    // If the X3D element has an id attribute, append \"_canvas\"\n    // to it and and use that as the id for the canvas\n    var id = x3dElem.getAttribute(\"id\");\n    if (id !== null) {\n        canvas.id = \"x3dom-\" + id + \"-canvas\";\n    } else {\n        // If the X3D element does not have an id... do what?\n        // For now check the date for creating a (hopefully) unique id\n        var index = new Date().getTime();\n        canvas.id = \"x3dom-\" + index + \"-canvas\";\n    }\n\n    // Apply the width and height of the X3D element to the canvas\n    var w, h;\n\n    if ((w = x3dElem.getAttribute(\"width\")) !== null) {\n        //Attention: pbuffer dim is _not_ derived from style attribs!\n        if (w.indexOf(\"%\") >= 0) {\n            x3dom.debug.logWarning(\"The width attribute is to be specified in pixels not in percent.\");\n        }\n        canvas.style.width = w;\n        x3dElem.style.width = w;\n        canvas.setAttribute(\"width\", w);\n    }\n\n    if ((h = x3dElem.getAttribute(\"height\")) !== null) {\n        //Attention: pbuffer dim is _not_ derived from style attribs!\n        if (h.indexOf(\"%\") >= 0) {\n            x3dom.debug.logWarning(\"The height attribute is to be specified in pixels not in percent.\");\n        }\n        canvas.style.height = h;\n        x3dElem.style.height = h;\n        canvas.setAttribute(\"height\", h);\n    }\n\n    // http://snook.ca/archives/accessibility_and_usability/elements_focusable_with_tabindex\n    canvas.setAttribute(\"tabindex\", \"0\");\n    // canvas.focus(); ???why - it is necessary - makes touch events break???\n\n    return canvas;\n};\n\n/**\n * Watches for a resize of the canvas and sets the current dimensions\n */\nx3dom.X3DCanvas.prototype._watchForResize = function() {\n\n    if(this.vrDisplay && this.vrDisplay.isPresenting)\n    {\n        return;\n    }\n\n    var new_dim = [\n        parseInt(x3dom.getStyle(this.canvas, \"width\")),\n        parseInt(x3dom.getStyle(this.canvas, \"height\"))\n    ];\n\n    if ((this._current_dim[0] != new_dim[0]) || (this._current_dim[1] != new_dim[1])) {\n        this._current_dim = new_dim;\n        this.x3dElem.setAttribute(\"width\", new_dim[0]+\"px\");\n        this.x3dElem.setAttribute(\"height\", new_dim[1]+\"px\");\n    }\n};\n\n//----------------------------------------------------------------------------------------------------------------------\n\n/**\n * Creates the div for progression visualization\n */\nx3dom.X3DCanvas.prototype._createProgressDiv = function() {\n    var progressDiv = document.createElement('div');\n    progressDiv.setAttribute(\"class\", \"x3dom-progress\");\n\n    var spinnerDiv = document.createElement('div');\n    spinnerDiv.setAttribute(\"class\", \"x3dom-progress-spinner\");\n    progressDiv.appendChild(spinnerDiv);\n\n    var text = document.createElement('div');\n    text.setAttribute(\"id\", \"x3domProgessCount\");\n    text.appendChild(document.createTextNode('Loading...'));\n    progressDiv.appendChild(text);\n\n    progressDiv.oncontextmenu = progressDiv.onmousedown = function(evt) {\n        evt.preventDefault();\n        evt.stopPropagation();\n        return false;\n    };\n    return progressDiv;\n};\n\n/**\n * Creates the div for progression visualization\n */\nx3dom.X3DCanvas.prototype._createVRDiv = function() {\n    var vrDiv = document.createElement('div');\n    vrDiv.setAttribute(\"class\", \"x3dom-vr\");\n\n    vrDiv.onclick = function()\n    {\n        this.x3dElem.runtime.toggleVR();\n    }.bind(this);\n\n    vrDiv.oncontextmenu = function(evt) {\n        evt.preventDefault();\n        evt.stopPropagation();\n        return false;\n    };\n\n    return vrDiv;\n};\n\n//----------------------------------------------------------------------------------------------------------------------\n\n/** Helper that converts a point from node coordinates to page coordinates\n FIXME: does NOT work when x3dom.css is not included so that x3d element is not floating\n */\nx3dom.X3DCanvas.prototype.mousePosition = function( evt )\n{\n    var rect = evt.target.getBoundingClientRect();\n\n    var offsetX = Math.round( evt.clientX - rect.left ) * this.devicePixelRatio;\n    var offsetY = Math.round( evt.clientY - rect.top  ) * this.devicePixelRatio;\n\n    return new x3dom.fields.SFVec2f( offsetX, offsetY );\n};\n\n//----------------------------------------------------------------------------------------------------------------------\n\n/** Is called in the main loop after every frame\n */\nx3dom.X3DCanvas.prototype.tick = function(timestamp)\n{\n    var that = this;\n\n    this._elapsedTime = (this._totalTime) ? timestamp - this._totalTime : 0;\n\n    this._totalTime = timestamp;\n\n    var runtime = this.x3dElem.runtime;\n    var d = new Date().getTime();\n    var diff = d - this.lastTimeFPSWasTaken;\n\n    var fps = 1000.0 / (d - this.fps_t0);\n    this.fps_t0 = d;\n\n    // update routes and stuff\n    this.doc.advanceTime(d / 1000.0);\n    var animD = new Date().getTime() - d;\n\n    if ( this.doc.hasAnimationStateChanged() )\n    {\n        if (this.doc.isAnimating())\n        {\n            runtime.onAnimationStarted();\n        }\n        else\n        {\n            runtime.onAnimationFinished();\n        }\n    }\n\n    if (this.doc.needRender) {\n        // calc average frames per second\n        if (diff >= 1000) {\n            runtime.fps = this.framesSinceLastTime / (diff / 1000.0);\n            runtime.addMeasurement('FPS', runtime.fps);\n\n            this.framesSinceLastTime = 0;\n            this.lastTimeFPSWasTaken = d;\n        }\n        this.framesSinceLastTime++;\n\n        runtime.addMeasurement('ANIM', animD);\n\n        if (runtime.isReady == false) {\n            runtime.ready();\n            runtime.isReady = true;\n        }\n\n        runtime.enterFrame( {\"total\": this._totalTime, \"elapsed\": this._elapsedTime} );\n\n        if(this.vrDisplay && this.vrDisplay.isPresenting)\n        {\n            if(!this.vrFrameData)\n            {\n                this.vrFrameData = new VRFrameData();\n            }\n\n            this.vrDisplay.getFrameData(this.vrFrameData);\n        }\n        else\n        {\n            this.doc.needRender = false;\n        }\n\n\t\t// picking might require another pass\n\n\t\tthis.doc.render(this.gl, this.vrFrameData, this.vrDisplay);\n\n\t\tif (!this.doc._scene._vf.doPickPass)\n\t\t{\n\t\t\truntime.removeMeasurement('PICKING');\n\t\t}\n                \n\n        runtime.exitFrame( {\"total\": this._totalTime, \"elapsed\": this._elapsedTime} );\n\n        if(this.vrDisplay && this.vrDisplay.isPresenting)\n        {\n            this.vrDisplay.submitFrame();\n        }\n    }\n\n    if (this.progressDiv) {\n        if (this.doc.downloadCount > 0) {\n            runtime.addInfo(\"#LOADS:\", this.doc.downloadCount);\n        } else {\n            runtime.removeInfo(\"#LOADS:\");\n        }\n\n        if (this.doc.properties.getProperty(\"showProgress\") !== 'false') {\n            if (this.progressDiv) {\n                var count = Math.max(+this.doc.downloadCount, 0);\n                this.progressDiv.childNodes[1].textContent = \"\" + count;\n                if (this.doc.downloadCount > 0) {\n                    this.progressDiv.style.opacity = '1';\n                } else {\n                    this.progressDiv.style.opacity = '0';\n                }\n            }\n        } else {\n            this.progressDiv.style.opacity = '0';\n        }\n    }\n\n    //fire downloadsfinished event, if necessary\n    if (this.doc.downloadCount <= 0 && this.doc.previousDownloadCount > 0)\n    {\n        var evt;\n        if (document.createEvent) {\n            evt = document.createEvent(\"Events\");\n            evt.initEvent(\"downloadsfinished\", true, true);\n            that.x3dElem.dispatchEvent(evt);\n        } else if (document.createEventObject) {\n            evt = document.createEventObject();\n            // http://stackoverflow.com/questions/1874866/how-to-fire-onload-event-on-document-in-ie\n            that.x3dElem.fireEvent(\"ondownloadsfinished\", evt);\n        }\n    }\n\n    this.doc.previousDownloadCount = this.doc.downloadCount;\n};\n\n//----------------------------------------------------------------------------------------------------------------------\n\n/** Loads the given @p uri.\n * @param uri can be a uri or an X3D node\n * @param sceneElemPos\n * @param settings properties\n */\nx3dom.X3DCanvas.prototype.load = function(uri, sceneElemPos, settings) {\n    this.doc = new x3dom.X3DDocument(this.canvas, this.gl, settings);\n    var x3dCanvas = this;\n\n    this.doc.onload = function () {\n        //x3dom.debug.logInfo(\"loaded '\" + uri + \"'\");\n\n        if (x3dCanvas.hasRuntime) {\n\n\t\t\t// requestAnimationFrame https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/demos/common/webgl-utils.js\n\t\t\t(function mainloop(timestamp){\n                if (x3dCanvas.doc && x3dCanvas.x3dElem.runtime) {\n                    x3dCanvas._watchForResize();\n                    x3dCanvas.tick(timestamp);\n\n                    if(navigator.getVRDisplays)\n                    {\n                        if(x3dCanvas.vrDisplay)\n                        {\n                            x3dCanvas.vrDisplay.requestAnimationFrame(mainloop, x3dCanvas);\n                        }\n                        else\n                        {\n                            if(!this.vrDisplayPromise)\n                            {\n                                this.vrDisplayPromise = navigator.getVRDisplays();\n                            }\n\n                            this.vrDisplayPromise.then( function (displays) {\n\n                                x3dCanvas.vrDisplay = displays[0];\n\n                                if(x3dCanvas.vrDisplay)\n                                {\n                                    x3dCanvas.vrDisplay.requestAnimationFrame(mainloop, x3dCanvas);\n\n                                    x3dCanvas.vrDiv.style.display = \"block\";\n                                }\n                                else\n                                {\n                                    window.requestAnimFrame(mainloop, x3dCanvas);\n                                }\n                            });\n                        }\n                    }\n                    else\n                    {\n                        window.requestAnimFrame(mainloop, x3dCanvas);\n                    }\n                }\n\t\t    })();\n\n        } else {\n            x3dCanvas.tick();\n        }\n    };\n\n    this.x3dElem.render = function() {\n        if (x3dCanvas.hasRuntime) {\n            x3dCanvas.doc.needRender = true;\n        } else {\n            x3dCanvas.doc.render(x3dCanvas.gl);\n        }\n    };\n\n    this.x3dElem.context = x3dCanvas.gl.ctx3d;\n\n    this.doc.onerror = function () {\n        alert('Failed to load X3D document');\n    };\n\n    this.doc.load(uri, sceneElemPos);\n};\n\n/**\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * Philip Taylor: http://philip.html5.org\n */\n\n/**\n * Namespace container for Runtime module\n * @namespace x3dom.runtime\n */\nx3dom.runtime = {};\n\n/**\n * Runtime\n *\n * Runtime proxy object to get and set runtime parameters. This object\n * is attached to each X3D element and can be used in the following manner:\n *\n * > var e = document.getElementById('the_x3delement');\n * > e.runtime.showAll();\n * > e.runtime.resetView();\n * > ...\n *\n * @param doc\n * @param canvas\n * @constructor\n */\nx3dom.Runtime = function(doc, canvas) {\n    this.doc = doc;\n    this.canvas = canvas;\n    this.config = {};\n    this.isReady = false;\n    this.fps = 0;\n\n    this.VRMode = false;\n\n    this.states = { measurements: [], infos: [] };\n};\n\n/**\n * Add Measurement\n *\n * @param title\n * @param value\n */\nx3dom.Runtime.prototype.addMeasurement = function (title, value) {\n    this.states.measurements[title] = value;\n};\n\n/**\n * Remove Measurement\n *\n * @param title\n */\nx3dom.Runtime.prototype.removeMeasurement = function (title) {\n    if (this.states.measurements[title]) {\n        delete this.states.measurements[title];\n    }\n};\n\n/**\n * Add Info\n *\n * @param title\n * @param value\n */\nx3dom.Runtime.prototype.addInfo = function (title, value) {\n    this.states.infos[title] = value;\n};\n\n/**\n * Remove Info\n *\n * @param title\n */\nx3dom.Runtime.prototype.removeInfo = function (title) {\n    delete this.states.infos[title];\n};\n\n/**\n * Initialize\n *\n * @param doc\n * @param canvas\n */\nx3dom.Runtime.prototype.initialize = function(doc, canvas) {\n    this.doc = doc;\n    this.canvas = canvas;\n\n    // place to hold configuration data, i.e. flash backend path, etc.\n    // format and structure needs to be decided.\n    this.config = {};\n    this.isReady = false;\n\n    this.fps = 0;\n};\n\n/**\n * APIFunction: noBackendFound\n *\n * This method is called once the system initialized and is not ready to\n * render the first time because there is no backend found. By default this\n * method noop. You can however override it with your own implementation.\n *\n * > x3dom.runtime.noBackendFound = function() {\n * >    alert(\"Dingel Dingel Ding Dong...\");\n * > }\n *\n * It is important to create this override before the document onLoad event has\n * fired. Therefore putting it directly under the inclusion of x3dom.js is the\n * preferred way to ensure overloading of this function.\n */\nx3dom.Runtime.prototype.noBackendFound = function() {\n    x3dom.debug.logInfo('No backend found. Unable to render.');\n};\n\n/**\n * APIFunction: ready\n *\n * This method is called once the system initialized and is ready to render\n * the first time. It is therefore possible to execute custom\n * action by overriding this method in your code:\n *\n * > x3dom.runtime.ready = function() {\n * >    alert(\"About to render something the first time\");\n * > }\n *\n * It is important to create this override before the document onLoad event has fired.\n * Therefore putting it directly under the inclusion of x3dom.js is the preferred\n * way to ensure overloading of this function.\n *\n * Parameters:\n * \t\telement - The x3d element this handler is acting upon\n */\nx3dom.Runtime.prototype.ready = function() {\n    x3dom.debug.logInfo('System ready.');\n};\n\n/**\n * APIFunction: enterFrame\n *\n * This method is called just before the next frame is\n * rendered. It is therefore possible to execute custom\n * action by overriding this method in your code:\n *\n * > var element = document.getElementById('my_element');\n * > element.runtime.enterFrame = function() {\n *     alert('hello custom enter frame');\n * };\n *\n * If you have more than one X3D element in your HTML\n * During initialization, just after ready() executed and before the very first frame\n * is rendered, only the global override of this method works. If you need to execute\n * code before the first frame renders, it is therefore best to use the ready()\n * function instead.\n *\n * Parameters:\n * \t\telement - The x3d element this handler is acting upon\n */\nx3dom.Runtime.prototype.enterFrame = function() {\n    //x3dom.debug.logInfo('Render frame imminent');\n    // to be overwritten by user\n};\n\n/**\n * APIFunction: exitFrame\n *\n * This method is called just after the current frame was\n * rendered. It is therefore possible to execute custom\n * action by overriding this method in your code:\n *\n * > var element = document.getElementById('my_element');\n * > element.runtime.exitFrame = function() {\n *     alert('hello custom exit frame');\n * };\n *\n * Parameters:\n * \t\telement - The x3d element this handler is acting upon\n */\nx3dom.Runtime.prototype.exitFrame = function() {\n    //x3dom.debug.logInfo('Render frame finished');\n    // to be overwritten by user\n};\n\n/**\n * APIFunction: triggerRedraw\n *\n * Triggers a redraw of the scene.\n */\nx3dom.Runtime.prototype.triggerRedraw = function() {\n    this.canvas.doc.needRender = true;\n};\n\n/**\n * APIFunction: getActiveBindable\n *\n * Returns the currently active bindable DOM element of the given type.\n * typeName must be a valid Bindable node (e.g. Viewpoint, Background, etc.).\n *\n * For example:\n *\n *   > var element, bindable;\n *   > element = document.getElementById('the_x3delement');\n *   > bindable = element.runtime.getActiveBindable('background');\n *   > bindable.setAttribute('bind', 'false');\n *\n * @param typeName - Bindable type name\n *\n * @returns The active DOM element\n */\nx3dom.Runtime.prototype.getActiveBindable = function(typeName) {\n    var stacks;\n    var i, current, result;\n    var type;\n\n    stacks = this.canvas.doc._bindableBag._stacks;\n    result = [];\n\n    type = x3dom.nodeTypesLC[typeName.toLowerCase()];\n\n    if (!type) {\n        x3dom.debug.logError('No node of type \"' + typeName + '\" found.');\n        return null;\n    }\n\n    for (i = 0; i < stacks.length; i++) {\n        current = stacks[i].getActive();\n        if (current._xmlNode !== undefined && x3dom.isa(current, type)) {\n            result.push(current);\n        }\n    }\n    return result[0] ? result[0]._xmlNode : null;\n};\n\n/**\n * APIFunction: nextView\n *\n * Navigates to the next viewpoint.\n */\nx3dom.Runtime.prototype.nextView = function() {\n    var stack = this.canvas.doc._scene.getViewpoint()._stack;\n    if (stack) {\n        stack.switchTo('next');\n    } else {\n        x3dom.debug.logError('No valid ViewBindable stack.');\n    }\n};\n\n/**\n * APIFunction: prevView\n *\n * Navigates tho the previous viewpoint.\n */\nx3dom.Runtime.prototype.prevView = function() {\n    var stack = this.canvas.doc._scene.getViewpoint()._stack;\n    if (stack) {\n        stack.switchTo('prev');\n    } else {\n        x3dom.debug.logError('No valid ViewBindable stack.');\n    }\n};\n\n/**\n * Function: viewpoint\n *\n * Returns the current viewpoint.\n *\n * @returns The viewpoint\n */\nx3dom.Runtime.prototype.viewpoint = function() {\n    return this.canvas.doc._scene.getViewpoint();\n};\n\n/**\n * Function: viewMatrix\n *\n * Returns the current view matrix.\n *\n * @returns Matrix object\n */\nx3dom.Runtime.prototype.viewMatrix = function() {\n    return this.canvas.doc._viewarea.getViewMatrix();\n};\n\n/**\n * Function: projectionMatrix\n *\n * Returns the current projection matrix.\n *\n * Returns:\n * \t\tMatrix object\n */\nx3dom.Runtime.prototype.projectionMatrix = function() {\n    return this.canvas.doc._viewarea.getProjectionMatrix();\n};\n\n/**\n * Function: getWorldToCameraCoordinatesMatrix\n *\n * Returns the current world to camera coordinates matrix.\n *\n * @returns Matrix object\n */\nx3dom.Runtime.prototype.getWorldToCameraCoordinatesMatrix = function() {\n    return this.canvas.doc._viewarea.getWCtoCCMatrix();\n};\n\n/**\n * Function: getCameraToWorldCoordinatesMatrix\n *\n * Returns the current camera to world coordinates matrix.\n *\n * @returns Matrix object\n */\nx3dom.Runtime.prototype.getCameraToWorldCoordinatesMatrix = function() {\n    return this.canvas.doc._viewarea.getCCtoWCMatrix();\n};\n\n/**\n * Function: getViewingRay\n *\n * Returns the viewing ray for a given (x, y) position.\n *\n * @returns Ray object\n */\nx3dom.Runtime.prototype.getViewingRay = function(x, y) {\n    return this.canvas.doc._viewarea.calcViewRay(x, y);\n};\n\n/**\n * Function: shootRay\n *\n * Returns pickPosition, pickNormal, and pickObject for a given (x, y) position.\n *\n * @param x\n * @param y\n *\n * @returns {{pickPosition: *, pickNormal: *, pickObject: null}}\n */\nx3dom.Runtime.prototype.shootRay = function(x, y) {\n    var doc = this.canvas.doc;\n    var info = doc._viewarea._pickingInfo;\n\n    doc.onPick(this.canvas.gl, x, y);\n\n    return {\n        pickPosition: info.pickObj ? info.pickPos : null,\n        pickNormal: info.pickObj ? info.pickNorm : null,\n        pickObject: info.pickObj ? info.pickObj._xmlNode : null\n    };\n};\n\n/**\n * Function: getWidth\n *\n * @returns the width of the canvas element.\n */\nx3dom.Runtime.prototype.getWidth = function() {\n    return this.canvas.doc._viewarea._width;\n};\n\n/**\n * Function: getHeight\n *\n * Returns the width of the canvas element.\n */\nx3dom.Runtime.prototype.getHeight = function() {\n    return this.canvas.doc._viewarea._height;\n};\n\n/**\n * Function: mousePosition\n *\n * Returns the 2d canvas layer position [x, y] for a given mouse event, i.e.,\n * the mouse cursor's x and y positions relative to the canvas (x3d) element.\n */\nx3dom.Runtime.prototype.mousePosition = function(event) {\n    var pos = this.canvas.mousePosition(event);\n\n    return [pos.x, pos.y];\n};\n\n/**\n * Function: calcCanvasPos\n *\n * Returns the 2d screen position [cx, cy] for a given point [wx, wy, wz] in world coordinates.\n *\n * @param wx\n * @param wy\n * @param wz\n * @returns {*[]}\n */\nx3dom.Runtime.prototype.calcCanvasPos = function(wx, wy, wz) {\n    var DPR = window.devicePixelRatio || 1;\n\n    var pnt = new x3dom.fields.SFVec3f(wx, wy, wz);\n\n    var mat = this.canvas.doc._viewarea.getWCtoCCMatrix();\n    var pos = mat.multFullMatrixPnt(pnt);\n\n    var w = this.canvas.doc._viewarea._width / DPR;\n    var h = this.canvas.doc._viewarea._height / DPR;\n\n    var x = Math.round((pos.x + 1) * (w - 1) / 2);\n    var y = Math.round((h - 1) * (1 - pos.y) / 2);\n\n    return [x, y];\n};\n\n/**\n * Function: getBBoxPoints\n *\n * @returns The eight point of the scene bounding box\n */\nx3dom.Runtime.prototype.getBBoxPoints = function() {\n    var scene = this.canvas.doc._scene;\n    scene.updateVolume();\n\n    return [\n        { x: scene._lastMin.x, y: scene._lastMin.y, z: scene._lastMin.z },\n        { x: scene._lastMax.x, y: scene._lastMin.y, z: scene._lastMin.z },\n        { x: scene._lastMin.x, y: scene._lastMax.y, z: scene._lastMin.z },\n        { x: scene._lastMax.x, y: scene._lastMax.y, z: scene._lastMin.z },\n        { x: scene._lastMin.x, y: scene._lastMin.y, z: scene._lastMax.z },\n        { x: scene._lastMax.x, y: scene._lastMin.y, z: scene._lastMax.z },\n        { x: scene._lastMin.x, y: scene._lastMax.y, z: scene._lastMax.z },\n        { x: scene._lastMax.x, y: scene._lastMax.y, z: scene._lastMax.z },\n    ];\n\n};\n\n/**\n * Function: calcPagePos\n *\n * @returns The 2d rect of the scene volume\n */\nx3dom.Runtime.prototype.getSceneBRect = function() {\n    var min = { x: Number.MAX_VALUE, y: Number.MAX_VALUE };\n    var max = { x: Number.MIN_VALUE, y: Number.MIN_VALUE };\n\n    var points = this.getBBoxPoints();\n\n    for (var i = 0; i < points.length; i++) {\n        var pos2D = this.calcCanvasPos(points[i].x, points[i].y, points[i].z);\n\n        min.x = (pos2D[0] < min.x) ? pos2D[0] : min.x;\n        min.y = (pos2D[1] < min.y) ? pos2D[1] : min.y;\n\n        max.x = (pos2D[0] > max.x) ? pos2D[0] : max.x;\n        max.y = (pos2D[1] > max.y) ? pos2D[1] : max.y;\n    }\n\n    var rect = {\n        x: min.x,\n        y: min.y,\n        width: max.x - min.x,\n        height: max.y - min.y\n    };\n\n    return rect;\n};\n\n/**\n * Function: calcClientPos\n *\n * Returns the 2d client (returns the mouse coordinates relative to the window) position [cx, cy]\n * for a given point [wx, wy, wz] in world coordinates.\n *\n * @param wx\n * @param wy\n * @param wz\n * @returns {*}\n */\nx3dom.Runtime.prototype.calcClientPos = function(wx, wy, wz) {\n    var elem = this.canvas.canvas.offsetParent;\n\n    if (!elem) {\n        x3dom.debug.logError(\"Can't calc client pos without offsetParent.\");\n        return [0, 0];\n    }\n\n    var canvasPos = elem.getBoundingClientRect();\n    var mousePos = this.calcCanvasPos(wx, wy, wz);\n\n    var compStyle = document.defaultView.getComputedStyle(elem, null);\n\n    var paddingLeft = parseFloat(compStyle.getPropertyValue('padding-left'));\n    var borderLeftWidth = parseFloat(compStyle.getPropertyValue('border-left-width'));\n\n    var paddingTop = parseFloat(compStyle.getPropertyValue('padding-top'));\n    var borderTopWidth = parseFloat(compStyle.getPropertyValue('border-top-width'));\n\n    var x = canvasPos.left + paddingLeft + borderLeftWidth + mousePos[0];\n    var y = canvasPos.top + paddingTop + borderTopWidth + mousePos[1];\n\n    return [x, y];\n};\n\n/**\n * Function: getScreenshot\n *\n * Returns a Base64 encoded png image consisting of the current rendering.\n *\n * @eturns The Base64 encoded PNG image string\n */\nx3dom.Runtime.prototype.getScreenshot = function() {\n    var url = \"\";\n    var backend = this.canvas.backend;\n    var canvas = this.canvas.canvas;\n\n    if (canvas) {\n        if (backend == \"flash\") {\n            url = canvas.getScreenshot();\n        } else {\n            // first flip along y axis\n            var canvas2d = document.createElement(\"canvas\");\n            canvas2d.width = canvas.width;\n            canvas2d.height = canvas.height;\n\n            var ctx = canvas2d.getContext(\"2d\");\n            ctx.drawImage(canvas, 0, 0, canvas.width, canvas.height);\n            ctx.scale(1, -1);\n            ctx.translate(0, -canvas.height);\n\n            url = canvas2d.toDataURL();\n        }\n    }\n\n    return url;\n};\n\n/**\n * Function: getCanvas\n *\n * Returns the internal canvas element (only valid for WebGL backend)\n *\n * @returns The internal canvas element\n */\nx3dom.Runtime.prototype.getCanvas = function() {\n    return this.canvas.canvas;\n};\n\n/**\n * Function: lightMatrix\n *\n * Returns the current light matrix.\n *\n * @returns The light matrix\n */\nx3dom.Runtime.prototype.lightMatrix = function() {\n    this.canvas.doc._viewarea.getLightMatrix();\n};\n\n/**\n * APIFunction: resetView\n *\n * Resets the view to initial.\n */\nx3dom.Runtime.prototype.resetView = function() {\n    this.canvas.doc._viewarea.resetView();\n};\n\n/**\n * Function: lightView\n *\n * Navigates to the first light, if any.\n *\n * @returns True if navigation was possible, false otherwise.\n */\nx3dom.Runtime.prototype.lightView = function() {\n    if (this.canvas.doc._nodeBag.lights.length > 0) {\n        this.canvas.doc._viewarea.animateTo(this.canvas.doc._viewarea.getLightMatrix()[0],\n            this.canvas.doc._scene.getViewpoint());\n        return true;\n    } else {\n        x3dom.debug.logInfo(\"No lights to navigate to.\");\n        return false;\n    }\n};\n\n/**\n * APIFunction: uprightView\n *\n * Navigates to upright view\n */\nx3dom.Runtime.prototype.uprightView = function() {\n    this.canvas.doc._viewarea.uprightView();\n};\n\n/**\n * APIFunction: fitAll\n *\n * Zooms so that all objects are fully visible. Without change the actual Viewpoint orientation\n *\n * @param updateCenterOfRotation - a boolean value that specifies if the new center of rotation is set.\n */\nx3dom.Runtime.prototype.fitAll = function(updateCenterOfRotation) {\n    if (updateCenterOfRotation === undefined) {\n        updateCenterOfRotation = true;\n    }\n\n    var scene = this.canvas.doc._scene;\n    scene.updateVolume();\n\n    this.canvas.doc._viewarea.fit(scene._lastMin, scene._lastMax, updateCenterOfRotation);\n};\n\n/**\n * APIFunction: fitObject\n *\n * Zooms so that a given object are fully visible. Without change the actual Viewpoint orientation\n *\n * @param obj\n * @param updateCenterOfRotation - a boolean value that specifies if the new center of rotation is set\n */\nx3dom.Runtime.prototype.fitObject = function(obj, updateCenterOfRotation) {\n    if (obj && obj._x3domNode) {\n        if (updateCenterOfRotation === undefined) {\n            updateCenterOfRotation = true;\n        }\n\n        var min = x3dom.fields.SFVec3f.MAX();\n        var max = x3dom.fields.SFVec3f.MIN();\n\n        var vol = obj._x3domNode.getVolume();\n        vol.getBounds(min, max);\n\n        var mat = obj._x3domNode.getCurrentTransform();\n\n        min = mat.multMatrixPnt(min);\n        max = mat.multMatrixPnt(max);\n\n        // TODO: revise separation of \"getVolume\" and \"getCurrentTransform\"\n        //      for the transform nodes - currently, both \"overlap\" because\n        //      both include the transform's own matrix\n        //      but which is what you usually expect from both methods...\n        if (x3dom.isa(obj._x3domNode, x3dom.nodeTypes.X3DTransformNode)) {\n            var invMat = obj._x3domNode._trafo.inverse();\n            min = invMat.multMatrixPnt(min);\n            max = invMat.multMatrixPnt(max);\n        }\n\n        this.canvas.doc._viewarea.fit(min, max, updateCenterOfRotation);\n    }\n};\n\n/**\n * APIFunction: showAll\n *\n * Zooms so that all objects are fully visible.\n *\n * @param axis - the axis as string: posX, negX, posY, negY, posZ, negZ\n * @param updateCenterOfRotation - sets the center of rotation to the center of the scene volume\n */\nx3dom.Runtime.prototype.showAll = function(axis, updateCenterOfRotation) {\n    this.canvas.doc._viewarea.showAll(axis, updateCenterOfRotation);\n};\n\n/**\n * APIFunction: showObject\n *\n * Zooms so that a given object is fully visible in the middle of the screen.\n *\n * @param obj  - the scene-graph element on which to focus\n * @param axis - the axis as string: posX, negX, posY, negY, posZ, negZ\n */\nx3dom.Runtime.prototype.showObject = function(obj, axis) {\n    if (obj && obj._x3domNode) {\n        if (axis === undefined) axis = \"negZ\";\n        var min = x3dom.fields.SFVec3f.MAX();\n        var max = x3dom.fields.SFVec3f.MIN();\n\n        var vol = obj._x3domNode.getVolume();\n        vol.getBounds(min, max);\n\n        var mat = obj._x3domNode.getCurrentTransform();\n\n        min = mat.multMatrixPnt(min);\n        max = mat.multMatrixPnt(max);\n\n        var viewarea = this.canvas.doc._viewarea;\n\n        // assume FOV_smaller as camera's fovMode\n        var focalLen = (viewarea._width < viewarea._height) ?\n            viewarea._width : viewarea._height;\n\n        var n0;    // facingDir\n\n        switch(axis) {\n            case \"posX\": n0 = new x3dom.fields.SFVec3f( 1,  0,  0); break;\n            case \"negX\": n0 = new x3dom.fields.SFVec3f(-1,  0,  0); break;\n            case \"posY\": n0 = new x3dom.fields.SFVec3f( 0,  1,  0); break;\n            case \"negY\": n0 = new x3dom.fields.SFVec3f( 1, -1,  0); break;\n            case \"posZ\": n0 = new x3dom.fields.SFVec3f( 0,  0,  1); break;\n            case \"negZ\": n0 = new x3dom.fields.SFVec3f( 0,  0, -1); break;\n        }\n\n        var viewpoint = this.canvas.doc._scene.getViewpoint();\n        var fov = viewpoint.getFieldOfView() / 2.0;\n        var ta = Math.tan(fov);\n\n        if (Math.abs(ta) > x3dom.fields.Eps) {\n            focalLen /= ta;\n        }\n\n        var w = viewarea._width - 1;\n        var h = viewarea._height - 1;\n\n        var frame = 0.25;\n        var minScreenPos = new x3dom.fields.SFVec2f(frame * w, frame * h);\n\n        frame = 0.75;\n        var maxScreenPos = new x3dom.fields.SFVec2f(frame * w, frame * h);\n\n        var dia2 = max.subtract(min).multiply(0.5);     // half diameter\n        var rw = dia2.length();                         // approx radius\n\n        var pc = min.add(dia2);                         // center in wc\n        var vc = maxScreenPos.subtract(minScreenPos).multiply(0.5);\n\n        var rs = 1.5 * vc.length();\n        vc = vc.add(minScreenPos);\n\n        var dist = 1.0;\n        if (rs > x3dom.fields.Eps) {\n            dist = (rw / rs) * Math.sqrt(vc.x*vc.x + vc.y*vc.y + focalLen*focalLen);\n        }\n\n        n0 = mat.multMatrixVec(n0).normalize();\n        n0 = n0.multiply(dist);\n        var p0 = pc.add(n0);\n\n        var qDir = x3dom.fields.Quaternion.rotateFromTo(new x3dom.fields.SFVec3f(0, 0, 1), n0);\n        var R = qDir.toMatrix();\n\n        var T = x3dom.fields.SFMatrix4f.translation(p0.negate());\n        var M = x3dom.fields.SFMatrix4f.translation(p0);\n\n        M = M.mult(R).mult(T).mult(M);\n        var viewmat = M.inverse();\n\n        viewarea.animateTo(viewmat, viewpoint);\n    }\n};\n\n/**\n * APIMethod animateViewpointTo\n *\n * Animates the current viewpoint to a new location.\n *\n * @param target - The taget view matrix or a viewpoint node\n * @param duration - The animation duration\n */\nx3dom.Runtime.prototype.animateViewpointTo = function( target, duration ) {\n    \n    var viewarea  = this.canvas.doc._viewarea;\n    var viewpoint = this.canvas.doc._scene.getViewpoint();\n\n    if( target._x3domNode != undefined )\n    {\n        target = target._x3domNode\n    }\n\n    viewarea.animateTo( target, viewpoint, duration );\n};\n\n/**\n * APIMethod getCenter\n *\n * Returns the center of a X3DShapeNode or X3DGeometryNode.\n *\n * @param domNode - the node for which its center shall be returned\n *\n * @returns Node center (or null if no Shape or Geometry)\n */\nx3dom.Runtime.prototype.getCenter = function(domNode) {\n    if (domNode && domNode._x3domNode &&\n        (this.isA(domNode, \"X3DShapeNode\") || this.isA(domNode, \"X3DGeometryNode\"))) {\n        return domNode._x3domNode.getCenter();\n    }\n\n    return null;\n};\n\n/**\n * APIMethod getCurrentTransform\n *\n * Returns the current to world transformation of a node.\n *\n * @param domNode - the node for which its transformation shall be returned\n *\n * @returns Transformation matrix (or null no valid node is given)\n */\nx3dom.Runtime.prototype.getCurrentTransform = function(domNode) {\n    if (domNode && domNode._x3domNode) {\n        return domNode._x3domNode.getCurrentTransform();\n    }\n\n    return null;\n};\n\n/**\n * APIMethod getBBox\n *\n * Returns the bounding box of a node.\n *\n * @param domNode - the node for which its volume shall be returned\n *\n * @returns The min and max positions of the node's bounding box.\n */\nx3dom.Runtime.prototype.getBBox = function(domNode) {\n    if (domNode && domNode._x3domNode && this.isA(domNode, \"X3DBoundedObject\")) {\n        var vol = domNode._x3domNode.getVolume();\n\n        return {\n            min: x3dom.fields.SFVec3f.copy(vol.min),\n            max: x3dom.fields.SFVec3f.copy(vol.max)\n        }\n    }\n\n    return null;\n};\n\n/**\n * APIMethod getSceneBBox\n *\n * Returns the bounding box of the scene.\n *\n * @returns The min and max positions of the scene's bounding box.\n */\nx3dom.Runtime.prototype.getSceneBBox = function() {\n    var scene = this.canvas.doc._scene;\n    scene.updateVolume();\n\n    return {\n        min: x3dom.fields.SFVec3f.copy(scene._lastMin),\n        max: x3dom.fields.SFVec3f.copy(scene._lastMax)\n    }\n};\n\n/**\n * APIFunction: debug\n *\n * Displays or hides the debug window. If parameter is omitted,\n * the current visibility status is returned.\n *\n * @param show - true to show debug window, false to hide\n *\n * @returns Current visibility status of debug window (true=visible, false=hidden)\n */\nx3dom.Runtime.prototype.debug = function(show) {\n    var doc = this.canvas.doc;\n    if (doc._viewarea._visDbgBuf === undefined) {\n        doc._viewarea._visDbgBuf = (doc._x3dElem.getAttribute(\"showLog\") === 'true');\n    }\n\n    if (arguments.length > 0) {\n        if (show === true) {\n            doc._viewarea._visDbgBuf = true;\n            x3dom.debug.logContainer.style.display = \"block\";\n        } else {\n            doc._viewarea._visDbgBuf = false;\n            x3dom.debug.logContainer.style.display = \"none\";\n        }\n    } else {\n        doc._viewarea._visDbgBuf = !doc._viewarea._visDbgBuf;\n        x3dom.debug.logContainer.style.display = (doc._viewarea._visDbgBuf == true) ? \"block\" : \"none\";\n    }\n    doc.needRender = true;\n\n    return doc._viewarea._visDbgBuf;\n};\n\n/**\n * APIFunction: navigationType\n *\n * Readout of the currently active navigation.\n *\n * @returns A string representing the active navigation type\n */\nx3dom.Runtime.prototype.navigationType = function() {\n    return this.canvas.doc._scene.getNavigationInfo().getType();\n};\n\n/**\n * APIFunction: noNav\n *\n * Switches to noNav mode\n */\nx3dom.Runtime.prototype.noNav = function() {\n    this.canvas.doc._scene.getNavigationInfo().setType(\"none\");\n};\n\n/**\n * APIFunction: examine\n *\n * Switches to examine mode\n */\nx3dom.Runtime.prototype.examine = function() {\n    this.canvas.doc._scene.getNavigationInfo().setType(\"examine\");\n};\n\n/**\n * APIFunction: turnTable\n *\n * Switches to turnTable mode\n */\nx3dom.Runtime.prototype.turnTable = function() {\n    this.canvas.doc._scene.getNavigationInfo().setType(\"turntable\");\n};\n\n/**\n * APIFunction: fly\n *\n * Switches to fly mode\n */\nx3dom.Runtime.prototype.fly = function() {\n    this.canvas.doc._scene.getNavigationInfo().setType(\"fly\");\n};\n\n/**\n * APIFunction: freeFly\n *\n * Switches to freeFly mode\n */\nx3dom.Runtime.prototype.freeFly = function() {\n    this.canvas.doc._scene.getNavigationInfo().setType(\"freefly\");\n};\n\n/**\n * APIFunction: lookAt\n *\n * Switches to lookAt mode\n */\nx3dom.Runtime.prototype.lookAt = function() {\n    this.canvas.doc._scene.getNavigationInfo().setType(\"lookat\");\n};\n/**\n * APIFunction: lookAround\n *\n * Switches to lookAround mode\n */\nx3dom.Runtime.prototype.lookAround = function() {\n    this.canvas.doc._scene.getNavigationInfo().setType(\"lookaround\");\n};\n\n/**\n * APIFunction: walk\n *\n * Switches to walk mode\n */\nx3dom.Runtime.prototype.walk = function() {\n    this.canvas.doc._scene.getNavigationInfo().setType(\"walk\");\n};\n\n/**\n * APIFunction: game\n *\n * Switches to game mode\n */\nx3dom.Runtime.prototype.game = function() {\n    this.canvas.doc._scene.getNavigationInfo().setType(\"game\");\n};\n\n/**\n * APIFunction: helicopter\n *\n * Switches to helicopter mode\n */\nx3dom.Runtime.prototype.helicopter = function() {\n    this.canvas.doc._scene.getNavigationInfo().setType(\"helicopter\");\n};\n\n/**\n * Function: resetExamin\n *\n * Resets all variables required by examine mode to init state\n */\nx3dom.Runtime.prototype.resetExamin = function() {\n    var viewarea = this.canvas.doc._viewarea;\n    viewarea._rotMat = x3dom.fields.SFMatrix4f.identity();\n    viewarea._transMat = x3dom.fields.SFMatrix4f.identity();\n    viewarea._movement = new x3dom.fields.SFVec3f(0, 0, 0);\n    viewarea._needNavigationMatrixUpdate = true;\n    this.canvas.doc.needRender = true;\n};\n\n/**\n * APIFunction: disableKeys\n *\n * Disable keys\n */\nx3dom.Runtime.prototype.disableKeys = function() {\n    this.canvas.disableKeys = true;\n};\n\n/**\n * APIFunction: enableKeys\n *\n * Enable keys\n */\nx3dom.Runtime.prototype.enableKeys = function() {\n    this.canvas.disableKeys = false;\n};\n\n/**\n * APIFunction: disableLeftDrag\n *\n * Disable left drag\n */\nx3dom.Runtime.prototype.disableLeftDrag = function() {\n    this.canvas.disableLeftDrag = true;\n};\n\n/**\n * APIFunction: enableLeftDrag\n *\n * Enable left drag\n */\nx3dom.Runtime.prototype.enableLeftDrag = function() {\n    this.canvas.disableLeftDrag = false;\n};\n\n/**\n * APIFunction: disableRightDrag\n *\n * Disable right drag\n */\nx3dom.Runtime.prototype.disableRightDrag = function() {\n    this.canvas.disableRightDrag = true;\n};\n\n/**\n * APIFunction: enableRightDrag\n *\n * Enable right drag\n */\nx3dom.Runtime.prototype.enableRightDrag = function() {\n    this.canvas.disableRightDrag = false;\n};\n\n/**\n * APIFunction: disableMiddleDrag\n *\n * Disable middle drag\n */\nx3dom.Runtime.prototype.disableMiddleDrag = function() {\n    this.canvas.disableMiddleDrag = true;\n};\n\n/**\n * APIFunction: enableMiddleDrag\n *\n * Enable right drag\n */\nx3dom.Runtime.prototype.enableMiddleDrag = function() {\n    this.canvas.disableMiddleDrag = false;\n};\n\n/**\n * Function: togglePoints\n *\n * Toggles points attribute\n *\n * @param lines\n * @returns {*}\n */\nx3dom.Runtime.prototype.togglePoints = function(lines) {\n    var doc = this.canvas.doc;\n    var mod = (lines === true) ? 3 : 2;\n\n    doc._viewarea._points = ++doc._viewarea._points % mod;\n    doc.needRender = true;\n\n    return doc._viewarea._points;\n};\n\n/**\n * Function: pickRect\n *\n * Returns an array of all shape elements that are within the picked rectangle\n * defined by (x1, y1) and (x2, y2) in canvas coordinates\n *\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n * @returns {*}\n */\nx3dom.Runtime.prototype.pickRect = function(x1, y1, x2, y2) {\n    return this.canvas.doc.onPickRect(this.canvas.gl, x1, y1, x2, y2);\n};\n\n/**\n * Function: pickMode\n *\n * Get the current pickMode intersect type\n *\n * @param internal - true/false. If given return the internal representation.\n *                 Only use for debugging.\n *\n * @returns The current intersect type value suitable to use with changePickMode\n *      If parameter is, given, provide with internal representation.\n */\nx3dom.Runtime.prototype.pickMode = function(options) {\n    if (options && options.internal === true) {\n        return this.canvas.doc._scene._vf.pickMode;\n    }\n    return this.canvas.doc._scene._vf.pickMode.toLowerCase();\n};\n\n/**\n * Function: changePickMode\n *\n * Alter the value of intersect type. Can be one of: box, idBuf, idBuf24, idBufId, color, texCoord.\n * Other values are ignored.\n *\n * @param type - The new intersect type: box, idBuf, idBuf24, idBufId, color, texCoord\n *\n * @returns true if the type has been changed, false otherwise\n */\nx3dom.Runtime.prototype.changePickMode = function(type) {\n    // pick type one of : box, idBuf, idBuf24, idBufId, color, texCoord\n    type = type.toLowerCase();\n\n    switch(type) {\n        case 'idbuf':    type = 'idBuf';    break;\n        case 'idbuf24':  type = 'idBuf24';  break;\n        case 'idbufid':  type = 'idBufId';  break;\n        case 'texcoord': type = 'texCoord'; break;\n        case 'color':    type = 'color';    break;\n        case 'box':      type = 'box';      break;\n        default:\n            x3dom.debug.logWarning(\"Switch pickMode to \"+ type + ' unknown intersect type');\n            type = undefined;\n    }\n\n    if (type !== undefined) {\n        this.canvas.doc._scene._vf.pickMode = type;\n        x3dom.debug.logInfo(\"Switched pickMode to '\" + type + \"'.\");\n        return true;\n    }\n\n    return false;\n};\n\n/**\n * APIFunction: speed\n *\n * Get the current speed value. If parameter is given the new speed value is set.\n *\n * @param newSpeed - The new speed value (optional)\n *\n * @returns The current speed value\n */\nx3dom.Runtime.prototype.speed = function(newSpeed) {\n    var navi = this.canvas.doc._scene.getNavigationInfo();\n    if (newSpeed) {\n        navi._vf.speed = newSpeed;\n        x3dom.debug.logInfo(\"Changed navigation speed to \" + navi._vf.speed);\n    }\n    return navi._vf.speed;\n};\n\n/**\n * APIFunction: zoom\n *\n * Modifies the zoom of current viewpoint with the specified zoom value.\n *\n * @param zoomAmount - The zoom amount\n */\nx3dom.Runtime.prototype.zoom = function(zoomAmount) {\n    this.canvas.doc._viewarea.zoom( zoomAmount );\n    this.canvas.doc.needRender = true;\n};\n\n/**\n * APIFunction: statistics\n *\n * Get or set statistics info. If parameter is omitted, this method\n * only returns the the visibility status of the statistics info overlay.\n *\n * @param mode - true or false. To enable or disable the statistics info\n *\n * @returns The current visibility of the statistics info (true = visible, false = invisible)\n */\nx3dom.Runtime.prototype.statistics = function(mode) {\n    var states = this.canvas.stateViewer;\n    if (states) {\n        this.canvas.doc.needRender = true;\n        if (mode === true) {\n            states.display(mode);\n            return true;\n        } else if (mode === false) {\n            states.display(mode);\n            return false;\n        } else {\n            states.display(!states.active);\n            // if no parameter is given return current status (false = not visible, true = visible)\n            return states.active;\n        }\n    }\n    return false;\n};\n\n/**\n * Function: processIndicator\n *\n * Enable or disable the process indicator. If parameter is omitted, this method\n * only returns the the visibility status of the progress bar overlay.\n *\n * @param mode - true or false. To enable or disable the progress indicator\n *\n * @returns The current visibility of the progress indicator info (true = visible, false = invisible)\n */\nx3dom.Runtime.prototype.processIndicator = function(mode) {\n    var processDiv = this.canvas.progressDiv;\n    if (processDiv) {\n        if (mode === true) {\n            processDiv.style.display = 'flex';\n            return true;\n        } else if (mode === false) {\n            processDiv.style.display = 'none';\n            return false;\n        }\n\n        // if no parameter is given return current status (false = not visible, true = visible)\n        return processDiv.style.display != 'none'\n    }\n    return false;\n};\n\n/**\n * Get properties\n *\n * @returns {*}\n */\nx3dom.Runtime.prototype.properties = function() {\n    return this.canvas.doc.properties;\n};\n\n/**\n * Get current backend name\n *\n * @returns {*}\n */\nx3dom.Runtime.prototype.backendName = function() {\n    return this.canvas.backend;\n};\n\n/**\n * Get current framerate\n *\n * @returns {number}\n */\nx3dom.Runtime.prototype.getFPS = function() {\n    return this.fps;\n};\n\n/**\n * APIMethod isA\n *\n * Test a DOM node object against a node type string. This method\n * can be used to determine the \"type\" of a DOM node.\n *\n * @param domNode - the node to test for\n * @param nodeType - node name to test domNode against\n *\n * @returns True or false\n */\nx3dom.Runtime.prototype.isA = function(domNode, nodeType) {\n    var inherits = false;\n\n    if (nodeType && domNode && domNode._x3domNode) {\n        if (nodeType === \"\") {\n            nodeType = \"X3DNode\";\n        }\n        inherits = x3dom.isa(domNode._x3domNode,\n            x3dom.nodeTypesLC[nodeType.toLowerCase()]);\n    }\n\n    return inherits;\n};\n\n/**\n * APIMethod getPixelScale\n *\n * Returns the virtual scale of one pixel for the current orthographic viewpoint.\n * The returned vector contains scale values for the x and y direction. The z value is always null.\n *\n * @returns x3dom.fields.SFVec3f or null if non orthographic view\n */\nx3dom.Runtime.prototype.getPixelScale = function() {\n    var vp = this.viewpoint();\n    if (!x3dom.isa(vp, x3dom.nodeTypes.OrthoViewpoint)) {\n        x3dom.debug.logError(\"getPixelScale is only implemented for orthographic Viewpoints\");\n        return null;\n    }\n\n    var zoomLevel = vp.getZoom();\n\n    var left = zoomLevel[0];\n    var bottom = zoomLevel[1];\n    var right = zoomLevel[2];\n    var top = zoomLevel[3];\n\n    var x = right - left;\n    var y = top - bottom;\n\n    var pixelScaleX = x / this.getWidth();\n    var pixelScaleY = y / this.getHeight();\n\n    return new x3dom.fields.SFVec3f(pixelScaleX, pixelScaleY, 0.0);\n};\n\n/**\n * APIMethod onAnimationStarted\n *\n */\nx3dom.Runtime.prototype.onAnimationStarted = function() {\n    //x3dom.debug.logInfo('Render frame finished');\n    // to be overwritten by user\n};\n\n/**\n * APIMethod onAnimationFinished\n *\n */\nx3dom.Runtime.prototype.onAnimationFinished = function() {\n    //x3dom.debug.logInfo('Render frame finished');\n    // to be overwritten by user\n};\n\nx3dom.Runtime.prototype.enterVR = function() {\n\n    if(this.canvas.vrDisplay && !this.canvas.vrDisplay.isPresenting)\n    {\n        this.canvas.vrDisplay.requestPresent([{ source: this.canvas.canvas }]).then(function() {\n            this.canvas.doc.needRender = true;\n        }.bind(this));\n    }\n};\n\nx3dom.Runtime.prototype.exitVR = function() {\n    if(this.canvas.vrDisplay && this.canvas.vrDisplay.isPresenting)\n    {\n        this.canvas.vrDisplay.exitPresent();\n    }\n};\n\nx3dom.Runtime.prototype.toggleVR = function() {\n    if(this.canvas.vrDisplay && !this.canvas.vrDisplay.isPresenting)\n    {\n        this.enterVR();\n    }\n    else if(this.canvas.vrDisplay && this.canvas.vrDisplay.isPresenting)\n    {\n        this.exitVR();\n    }\n};\n\n/**\n * APIMethod toggleProjection\n *\n * @param perspViewID\n * @param orthoViewID\n * @returns {number}\n */\nx3dom.Runtime.prototype.toggleProjection = function( perspViewID, orthoViewID ) {\n    var dist;\n    var factor = 2.2;\n    var runtime = document.getElementById(\"x3d\").runtime;\n    var navInfo = runtime.canvas.doc._scene.getNavigationInfo();\n    var speed = navInfo._vf.transitionTime;\n    var persp = document.getElementById(perspViewID)._x3domNode;\n    var ortho = document.getElementById(orthoViewID)._x3domNode;\n\n    navInfo._vf.transitionTime = 0;\n\n    ortho._bindAnimation = false;\n    persp._bindAnimation = false;\n\n    if (persp._vf.isActive) {\n        ortho._viewMatrix = persp._viewMatrix;\n\n        document.getElementById(orthoViewID).setAttribute(\"set_bind\", \"true\");\n\n        dist = persp._viewMatrix.e3().length() / factor;\n\n        ortho.setZoom(dist);\n    } else if (ortho._vf.isActive) {\n        persp._viewMatrix = ortho._viewMatrix;\n\n        document.getElementById(perspViewID).setAttribute(\"set_bind\", \"true\");\n\n        dist = ortho._fieldOfView[2] * -factor;\n\n        var translation = ortho._viewMatrix.e2().normalize().multiply(dist);\n\n        persp._viewMatrix.setTranslate(translation);\n    }\n\n    navInfo._vf.transitionTime = speed;\n\n    ortho._bindAnimation = true;\n    persp._bindAnimation = true;\n\n    return (persp._vf.isActive) ? 0 : 1;\n};\n\n/**\n * APIFunction: replaceWorld\n *\n * Replaces the current scene element\n *\n * For example:\n *   > var element, x3d, jsobject, optionalUrl;\n *   > element = document.getElementById('the_x3delement');\n *   > x3d = element.runtime.createX3DFromJS(jsobject, optionalUrl);\n *   > element.runtime.replaceWorld(x3d);\n *\n * @param scene - scene element to substitute\n *\n * @note replaceWorld replaces the current x3d element. It is\n *       therefore necessary to get the replaced x3d element\n *       each time to access the new runtime.\n */\nx3dom.Runtime.prototype.replaceWorld = function(scene) {\n    var x3dElement = this.doc.cloneNode(false);\n    var child, name;\n    while (child = scene.firstChild) {\n        name = child.nodeType === 1 ? child.localName.toUpperCase() : null;\n        if (name == 'HEAD' || name == 'SCENE') x3dElement.appendChild(child);\n        else {\n            child.remove();\n        }\n    }\n    this.doc.parentNode.replaceChild(x3dElement, this.doc);\n    this.doc = x3dElement;\n    x3dom.reload();\n    return;\n};\n\n/**\n * APIFunction: createX3DFromJS\n *\n * Creates a x3d element from a JSON JavaScript X3D object\n *\n * For example:\n *   > var element, x3d, jsobject, optionalUrl;\n *   > element = document.getElementById('the_x3delement');\n *   > x3d = element.runtime.createX3DFromJS(jsobject, optionalUrl);\n *   > element.runtime.replaceWorld(x3d);\n *\n * @param jsobject - JavaScript JSON object of X3D object\n * @param optionalURL - if specified, does a PROTO expansion on jsobject.\n *                      JSON ExternProtoDeclare's are loaded relative to this URL.\n *\n * @returns The x3d element\n */\nx3dom.Runtime.prototype.createX3DFromJS = function(jsobject, optionalURL) {\n    if (optionalURL) {\n        jsobject = x3dom.protoExpander.prototypeExpander(optionalURL, jsobject);\n    }\n    var jsonParser = new x3dom.JSONParser();\n    return jsonParser.parseJavaScript(jsobject);\n};\n\n/**\n * APIFunction: createX3DFromString\n *\n * Creates a x3d element from a JSON or XML String\n *\n * For example:\n *\n *   > var element, x3d, jsonOrXML, optionalUrl;\n *   > element = document.getElementById('the_x3delement');\n *   > x3d = element.runtime.createX3DFromString(jsonOrXML, optionalUrl);\n *   > element.runtime.replaceWorld(x3d);\n *\n * @param jsonOrXML - JSON or XML of X3D object\n * @param optionalURL - if specified, does a PROTO expansion on json.\n * \t\t\t            JSON ExternProtoDeclare's are loaded relative to this URL.\n *\n * @returns The x3d element\n */\nx3dom.Runtime.prototype.createX3DFromString = function(jsonOrXML, optionalURL) {\n    try {\n        var jsobject = JSON.parse(jsonOrXML);\n        return this.createX3DFromJS(jsobject, optionalURL);\n    } catch (e) {\n        var parser = new DOMParser();\n        var doc = parser.parseFromString(jsonOrXML, 'application/xml');\n        var scene = doc.querySelector('X3D');\n        if (scene == null) {\n            doc = parser.parseFromString(jsonOrXML, 'text/html');\n            scene = doc.querySelector('X3D');\n        }\n        return scene;\n    }\n};\n\n/**\n * APIFunction: createX3DFromURLPromise\n *\n * Creates a Promise resolved to the x3d element from a Url\n *\n * For example:\n *   > var element, x3d, json, optionalUrl;\n *   > element = document.getElementById('the_x3delement');\n *   > x3d = element.runtime.createX3DFromURK(Url, optionalUrl);\n *   > element.runtime.replaceWorld(x3d);\n *\n * @param url - url of XML or JSON of X3D object\n * @param optionalURL - if specified, does a PROTO expansion on json, only.\n * \t\t\t            JSON ExternProtoDeclare's are loaded relative to this URL.\n *\n * @returns A Promise resolved to the x3d element\n */\nx3dom.Runtime.prototype.createX3DFromURLPromise = function(url, optionalURL) {\n    this.canvas.doc.incrementDownloads();\n    that = this;\n    return fetch(url)\n        .then(function(r) { return r.text(); })\n        .then(function(text) {\n            that.canvas.doc.decrementDownloads();\n            return that.createX3DFromString(text, optionalURL);\n        })\n        .catch(function(r) {\n            that.canvas.doc.decrementDownloads();\n            x3dom.debug.logError('fetch failed: ' + r);\n            return null;\n        });\n};\n\n/**\n * APIFunction: loadURL\n *\n * loads asynchronuously a scene from a URL with json or xml content.\n * The function returns before the world is loaded. Use events or .ready\n * to determine when the scene is available.\n * For more control use .createX3DFromURLPromise(url, optionalURL).\n *\n * Example:\n *   > var element, url , optionalUrl;\n *   > element.runtime.loadURL(url, optionalUrl);\n *\n * @param url - url of XML or JSON of X3D object\n * @param optionalURL - if specified, does a PROTO expansion on json, only.\n * \t\t\t            JSON ExternProtoDeclare's are loaded relative to this URL.\n *\n * @returns undefined\n *\n * @note replaceWorld replaces the current x3d element. It is\n *       therefore necessary to get the replaced x3d element\n *       each time to access the new runtime.\n */\nx3dom.Runtime.prototype.loadURL = function(url, optionalURL) {\n    that = this;\n    this.createX3DFromURLPromise(url, optionalURL)\n        .then(function(x3d) {\n            if (x3d != null) that.replaceWorld(x3d);\n            else x3dom.debug.logError(\"loadURL: could not fetch or parse \" + url);\n        });\n};\n\n/**\r\n * X3DOM JavaScript Library\r\n * http://www.x3dom.org\r\n *\r\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\r\n * Dual licensed under the MIT and GPL\r\n *\r\n * Based on code originally provided by\r\n * Philip Taylor: http://philip.html5.org\r\n */\r\n\r\n/**\r\n * Holds the UserAgent feature\r\n */\r\nx3dom.userAgentFeature = {\r\n    supportsDOMAttrModified: false\r\n};\r\n\r\n(function loadX3DOM() {\r\n    \"use strict\";\r\n\r\n    var onload = function() {\r\n        var i, j;  // counters\r\n\r\n        // Search all X3D elements in the page\r\n        var x3ds_unfiltered = document.getElementsByTagName('X3D');\r\n        var x3ds = [];\r\n\r\n        // check if element already has been processed\r\n        for (i = 0; i < x3ds_unfiltered.length; i++) {\r\n            if (x3ds_unfiltered[i].hasRuntime === undefined)\r\n                x3ds.push(x3ds_unfiltered[i]);\r\n        }\r\n\r\n        // Components and params\r\n        var params;\r\n        var settings = new x3dom.Properties();  // stores the stuff in <param>\r\n        var validParams = array_to_object([\r\n            'showLog',\r\n            'showStat',\r\n            'showProgress',\r\n            'PrimitiveQuality',\r\n            'components',\r\n            'loadpath',\r\n            'disableDoubleClick',\r\n            'backend',\r\n            'altImg',\r\n            'runtimeEnabled',\r\n            'disableKeys',\r\n            'showTouchpoints',\r\n            'disableTouch',\r\n            'maxActiveDownloads',\r\n            'useGeoCache'\r\n        ]);\r\n        var components, prefix;\r\n        var showLoggingConsole = false;\r\n\r\n        // for each X3D element\r\n        for (i = 0; i < x3ds.length; i++) {\r\n\r\n            // default parameters\r\n            settings.setProperty(\"showLog\", x3ds[i].getAttribute(\"showLog\") || 'false');\r\n            settings.setProperty(\"showStat\", x3ds[i].getAttribute(\"showStat\") || 'false');\r\n            settings.setProperty(\"showProgress\", x3ds[i].getAttribute(\"showProgress\") || 'true');\r\n            settings.setProperty(\"PrimitiveQuality\", x3ds[i].getAttribute(\"PrimitiveQuality\") || 'High');\r\n            settings.setProperty(\"useGeoCache\", x3ds[i].getAttribute(\"useGeoCache\") || 'true');\r\n\r\n            // for each param element inside the X3D element\r\n            // add settings to properties object\r\n            params = x3ds[i].getElementsByTagName('PARAM');\r\n            for (j = 0; j < params.length; j++) {\r\n                if (params[j].getAttribute('name') in validParams) {\r\n                    settings.setProperty(params[j].getAttribute('name'), params[j].getAttribute('value'));\r\n                } else {\r\n                    // x3dom.debug.logError(\"Unknown parameter: \" + params[j].getAttribute('name'));\r\n                }\r\n            }\r\n\r\n            // enable log\r\n            if (settings.getProperty('showLog') === 'true') {\r\n                showLoggingConsole = true;\r\n            }\r\n\r\n            if (typeof X3DOM_SECURITY_OFF != 'undefined' && X3DOM_SECURITY_OFF === true) {\r\n                // load components from params or default to x3d attribute\r\n                components = settings.getProperty('components', x3ds[i].getAttribute(\"components\"));\r\n                if (components) {\r\n                    prefix = settings.getProperty('loadpath', x3ds[i].getAttribute(\"loadpath\"));\r\n                    components = components.trim().split(',');\r\n                    for (j = 0; j < components.length; j++) {\r\n                        x3dom.loadJS(components[j] + \".js\", prefix);\r\n                    }\r\n                }\r\n\r\n                // src=foo.x3d adding inline node, not a good idea, but...\r\n                if (x3ds[i].getAttribute(\"src\")) {\r\n                    var _scene = document.createElement(\"scene\");\r\n                    var _inl = document.createElement(\"Inline\");\r\n                    _inl.setAttribute(\"url\", x3ds[i].getAttribute(\"src\"));\r\n                    _scene.appendChild(_inl);\r\n                    x3ds[i].appendChild(_scene);\r\n                }\r\n            }\r\n        }\r\n\r\n        if (showLoggingConsole == true) {\r\n            x3dom.debug.activate(true);\r\n        } else {\r\n            x3dom.debug.activate(false);\r\n        }\r\n\r\n        // Convert the collection into a simple array (is this necessary?)\r\n        x3ds = Array.map(x3ds, function(n) {\r\n            n.hasRuntime = true;\r\n            return n;\r\n        });\r\n\r\n        if (x3dom.versionInfo !== undefined) {\r\n            x3dom.debug.logInfo(\"X3DOM version \" + x3dom.versionInfo.version + \", \" +\r\n                \"Revison <a href='https://github.com/x3dom/x3dom/tree/\" + x3dom.versionInfo.revision + \"'>\"\r\n                + x3dom.versionInfo.revision + \"</a>, \" +\r\n                \"Date \" + x3dom.versionInfo.date);\r\n        }\r\n\r\n        x3dom.debug.logInfo(\"Found \" + x3ds.length + \" X3D and nodes...\");\r\n\r\n        // Create a HTML canvas for every X3D scene and wrap it with\r\n        // an X3D canvas and load the content\r\n        var x3d_element;\r\n        var x3dcanvas;\r\n        var altDiv, altP, aLnk, altImg;\r\n        var t0, t1;\r\n\r\n        for (i = 0; i < x3ds.length; i++) {\r\n            x3d_element = x3ds[i];\r\n\r\n            x3dcanvas = new x3dom.X3DCanvas(x3d_element, x3dom.canvases.length);\r\n\r\n            x3dom.canvases.push(x3dcanvas);\r\n\r\n            if (x3dcanvas.gl === null) {\r\n\r\n                altDiv = document.createElement(\"div\");\r\n                altDiv.setAttribute(\"class\", \"x3dom-nox3d\");\r\n                altDiv.setAttribute(\"id\", \"x3dom-nox3d\");\r\n\r\n                altP = document.createElement(\"p\");\r\n                altP.appendChild(document.createTextNode(\"WebGL is not yet supported in your browser. \"));\r\n                aLnk = document.createElement(\"a\");\r\n                aLnk.setAttribute(\"href\", \"http://www.x3dom.org/?page_id=9\");\r\n                aLnk.appendChild(document.createTextNode(\"Follow link for a list of supported browsers... \"));\r\n\r\n                altDiv.appendChild(altP);\r\n                altDiv.appendChild(aLnk);\r\n\r\n                x3dcanvas.x3dElem.appendChild(altDiv);\r\n\r\n                // remove the stats div (it's not added when WebGL doesn't work)\r\n                if (x3dcanvas.stateViewer) {\r\n                    x3d_element.removeChild(x3dcanvas.stateViewer.viewer);\r\n                }\r\n\r\n                continue;\r\n            }\r\n\r\n            t0 = new Date().getTime();\r\n\r\n            x3ds[i].runtime = new x3dom.Runtime(x3ds[i], x3dcanvas);\r\n            x3ds[i].runtime.initialize(x3ds[i], x3dcanvas);\r\n\r\n            if (x3dom.runtime.ready) {\r\n                x3ds[i].runtime.ready = x3dom.runtime.ready;\r\n            }\r\n\r\n            // no backend found method system wide call\r\n            if (x3dcanvas.backend == '') {\r\n                x3dom.runtime.noBackendFound();\r\n            }\r\n\r\n            x3dcanvas.load(x3ds[i], i, settings);\r\n\r\n            // show or hide statistics based on param/x3d attribute settings\r\n            if (settings.getProperty('showStat') === 'true') {\r\n                x3ds[i].runtime.statistics(true);\r\n            } else {\r\n                x3ds[i].runtime.statistics(false);\r\n            }\r\n\r\n            if (settings.getProperty('showProgress') === 'true') {\r\n                if (settings.getProperty('showProgress') === 'bar') {\r\n                    x3dcanvas.progressDiv.setAttribute(\"class\", \"x3dom-progress bar\");\r\n                }\r\n                x3ds[i].runtime.processIndicator(true);\r\n            } else {\r\n                x3ds[i].runtime.processIndicator(false);\r\n            }\r\n\r\n            t1 = new Date().getTime() - t0;\r\n            x3dom.debug.logInfo(\"Time for setup and init of GL element no. \" + i + \": \" + t1 + \" ms.\");\r\n        }\r\n\r\n        var ready = (function(eventType) {\r\n            var evt = null;\r\n\r\n            if (document.createEvent) {\r\n                evt = document.createEvent(\"Events\");\r\n                evt.initEvent(eventType, true, true);\r\n                document.dispatchEvent(evt);\r\n            } else if (document.createEventObject) {\r\n                evt = document.createEventObject();\r\n                // http://stackoverflow.com/questions/1874866/how-to-fire-onload-event-on-document-in-ie\r\n                document.body.fireEvent('on' + eventType, evt);\r\n            }\r\n        })('load');\r\n    };\r\n\r\n    var onunload = function() {\r\n        if (x3dom.canvases) {\r\n            for (var i = 0; i < x3dom.canvases.length; i++) {\r\n                x3dom.canvases[i].doc.shutdown(x3dom.canvases[i].gl);\r\n            }\r\n            x3dom.canvases = [];\r\n        }\r\n    };\r\n\r\n    // Initializes an <x3d> root element that was added after document load.\r\n    x3dom.reload = function() {\r\n        onload();\r\n    };\r\n\r\n    if (window.addEventListener) {\r\n        window.addEventListener('load', onload, false);\r\n        window.addEventListener('unload', onunload, false);\r\n        window.addEventListener('reload', onunload, false);\r\n    } else if (window.attachEvent) {\r\n        window.attachEvent('onload', onload);\r\n        window.attachEvent('onunload', onunload);\r\n        window.attachEvent('onreload', onunload);\r\n    }\r\n\r\n    // Initialize if we were loaded after 'DOMContentLoaded' already fired.\r\n    // This can happen if the script was loaded by other means.\r\n    if (document.readyState === \"complete\") {\r\n        window.setTimeout(function() { onload(); }, 20);\r\n    }\r\n})();\r\n\n/**\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * Philip Taylor: http://philip.html5.org\n */\n\n/**\n * Cache Constructor\n *\n * @constructor\n */\nx3dom.Cache = function() {\n    this.textures = [];\n    this.shaders = [];\n};\n\n/**\n * Returns a Texture 2D\n *\n * @param gl\n * @param doc\n * @param url\n * @param bgnd\n * @param crossOrigin\n * @param scale\n * @param genMipMaps\n *\n * @returns {*}\n */\nx3dom.Cache.prototype.getTexture2D = function (gl, doc, url, bgnd, crossOrigin, scale, genMipMaps, flipY) {\n    var textureIdentifier = url;\n\n    if (this.textures[textureIdentifier] === undefined) {\n        this.textures[textureIdentifier] = x3dom.Utils.createTexture2D(\n                                           gl, doc, url, bgnd, crossOrigin, scale, genMipMaps, flipY);\n    }\n\n    return this.textures[textureIdentifier];\n};\n\n/**\n * Returns a Texture 2D\n *\n * @param gl\n * @param nameSpace\n * @param def\n *\n * @returns {*}\n */\nx3dom.Cache.prototype.getTexture2DByDEF = function(gl, nameSpace, def) {\n    var textureIdentifier = nameSpace.name + \"_\" + def;\n\n    if (this.textures[textureIdentifier] === undefined) {\n        this.textures[textureIdentifier] = gl.createTexture();\n    }\n\n    return this.textures[textureIdentifier];\n};\n\n/**\n * Returns a Cube Texture\n *\n * @param gl\n * @param doc\n * @param url\n * @param bgnd\n * @param crossOrigin\n * @param scale\n * @param genMipMaps\n *\n * @returns {*}\n */\nx3dom.Cache.prototype.getTextureCube = function (gl, doc, url, bgnd, crossOrigin, scale, genMipMaps, flipY) {\n    var textureIdentifier = \"\";\n\n    for (var i = 0; i < url.length; ++i) {\n        textureIdentifier += url[i] + \"|\";\n    }\n\n    if (this.textures[textureIdentifier] === undefined) {\n        this.textures[textureIdentifier] = x3dom.Utils.createTextureCube(\n                                           gl, doc, url, bgnd, crossOrigin, scale, genMipMaps, flipY);\n    }\n\n    return this.textures[textureIdentifier];\n};\n\n/**\n * Returns one of the default shader programs\n *\n * @param gl\n * @param shaderIdentifier\n *\n * @returns {*}\n */\nx3dom.Cache.prototype.getShader = function(gl, shaderIdentifier) {\n    var program = null;\n\n    // Check if shader is in cache\n    if (this.shaders[shaderIdentifier] === undefined) {\n        // Choose shader based on identifier\n        switch (shaderIdentifier) {\n            case x3dom.shader.PICKING:\n                program = new x3dom.shader.PickingShader(gl);\n                break;\n            case x3dom.shader.PICKING_24:\n                program = new x3dom.shader.Picking24Shader(gl);\n                break;\n            case x3dom.shader.PICKING_ID:\n                program = new x3dom.shader.PickingIdShader(gl);\n                break;\n            case x3dom.shader.PICKING_COLOR:\n                program = new x3dom.shader.PickingColorShader(gl);\n                break;\n            case x3dom.shader.PICKING_TEXCOORD:\n                program = new x3dom.shader.PickingTexcoordShader(gl);\n                break;\n            case x3dom.shader.FRONTGROUND_TEXTURE:\n                program = new x3dom.shader.FrontgroundTextureShader(gl);\n                break;\n            case x3dom.shader.BACKGROUND_TEXTURE:\n                program = new x3dom.shader.BackgroundTextureShader(gl);\n                break;\n            case x3dom.shader.BACKGROUND_SKYTEXTURE:\n                program = new x3dom.shader.BackgroundSkyTextureShader(gl);\n                break;\n            case x3dom.shader.BACKGROUND_CUBETEXTURE:\n                program = new x3dom.shader.BackgroundCubeTextureShader(gl);\n                break;\n            case x3dom.shader.BACKGROUND_CUBETEXTURE_DDS:\n                program = new x3dom.shader.BackgroundCubeTextureDDSShader(gl);\n                break;\n            case x3dom.shader.SHADOW:\n                program = new x3dom.shader.ShadowShader(gl);\n                break;\n            case x3dom.shader.BLUR:\n                program = new x3dom.shader.BlurShader(gl);\n                break;\n            case x3dom.shader.DEPTH:\n                // program = new x3dom.shader.DepthShader(gl);\n                break;\n            case x3dom.shader.NORMAL:\n                program = new x3dom.shader.NormalShader(gl);\n                break;\n            case x3dom.shader.TEXTURE_REFINEMENT:\n                program = new x3dom.shader.TextureRefinementShader(gl);\n                break;\n            default:\n                break;\n        }\n\n        if (program) {\n            this.shaders[shaderIdentifier] = x3dom.Utils.wrapProgram(gl, program, shaderIdentifier);\n        } else {\n            x3dom.debug.logError(\"Couldn't create shader: \" + shaderIdentifier);\n        }\n    }\n\n    return this.shaders[shaderIdentifier];\n};\n\n/**\n * Returns a dynamic generated shader program by viewarea and shape\n *\n * @param gl\n * @param viewarea\n * @param shape\n */\nx3dom.Cache.prototype.getDynamicShader = function(gl, viewarea, shape) {\n    // Generate Properties\n    var properties = x3dom.Utils.generateProperties(viewarea, shape);\n\n    var shaderID = properties.id;\n\n    if (this.shaders[shaderID] === undefined) {\n        var program = null;\n        if (properties.CSHADER != -1) {\n            program = new x3dom.shader.ComposedShader(gl, shape);\n        } else {\n            program = (x3dom.caps.MOBILE && !properties.CSSHADER) ?\n                new x3dom.shader.DynamicMobileShader(gl, properties) :\n                new x3dom.shader.DynamicShader(gl, properties);\n        }\n        this.shaders[shaderID] = x3dom.Utils.wrapProgram(gl, program, shaderID);\n    }\n\n    return this.shaders[shaderID];\n};\n\n/**\n * Returns a dynamic generated shader program by properties\n *\n * @param gl\n * @param shape\n * @param properties\n * @param pickMode\n * @param shadows\n */\nx3dom.Cache.prototype.getShaderByProperties = function(gl, shape, properties, pickMode, shadows) {\n\n    // Get shaderID\n    var shaderID = properties.id;\n\n    if (pickMode !== undefined && pickMode !== null) {\n        shaderID += pickMode;\n    }\n\n    if (shadows !== undefined && shadows !== null) {\n        shaderID += \"S\";\n    }\n\n    if (this.shaders[shaderID] === undefined) {\n        var program = null;\n\n        if (pickMode !== undefined && pickMode !== null) {\n            program = new x3dom.shader.DynamicShaderPicking(gl, properties, pickMode);\n        } else if (shadows !== undefined && shadows !== null) {\n            program = new x3dom.shader.DynamicShadowShader(gl, properties);\n        } else if (properties.CSHADER != -1) {\n            program = new x3dom.shader.ComposedShader(gl, shape);\n        } else if (properties.KHR_MATERIAL_COMMONS != null && properties.KHR_MATERIAL_COMMONS != 0) {\n            program = new x3dom.shader.KHRMaterialCommonsShader(gl, properties);\n        } else if (properties.EMPTY_SHADER != null && properties.EMPTY_SHADER != 0) {\n            return { \"shaderID\": shaderID };\n        } else {\n            program = (x3dom.caps.MOBILE && !properties.CSSHADER) ?\n                new x3dom.shader.DynamicMobileShader(gl, properties) :\n                new x3dom.shader.DynamicShader(gl, properties);\n        }\n\n        this.shaders[shaderID] = x3dom.Utils.wrapProgram(gl, program, shaderID);\n    }\n\n    return this.shaders[shaderID];\n};\n\n/**\n * Returns the dynamically created shadow rendering shader\n *\n * @param gl\n * @param shadowedLights\n *\n * @returns {*}\n */\nx3dom.Cache.prototype.getShadowRenderingShader = function(gl, shadowedLights) {\n    var ID = \"shadow\";\n    for (var i = 0; i < shadowedLights.length; i++) {\n        if (x3dom.isa(shadowedLights[i], x3dom.nodeTypes.SpotLight)) {\n            ID += \"S\";\n        } else if (x3dom.isa(shadowedLights[i], x3dom.nodeTypes.PointLight)) {\n            ID += \"P\";\n        } else {\n            ID += \"D\";\n        }\n    }\n\n    if (this.shaders[ID] === undefined) {\n        var program = new x3dom.shader.ShadowRenderingShader(gl, shadowedLights);\n        this.shaders[ID] = x3dom.Utils.wrapProgram(gl, program, ID);\n    }\n    return this.shaders[ID];\n};\n\n/**\n * Release texture and shader resources\n *\n * @param gl\n * @constructor\n */\nx3dom.Cache.prototype.Release = function(gl) {\n    for (var texture in this.textures) {\n        gl.deleteTexture(this.textures[texture]);\n    }\n    this.textures = [];\n\n    for (var shaderId in this.shaders) {\n        var shader = this.shaders[shaderId];\n        var glShaders = gl.getAttachedShaders(shader.program);\n        for (var i = 0; i < glShaders.length; ++i) {\n            gl.detachShader(shader.program, glShaders[i]);\n            gl.deleteShader(glShaders[i]);\n        }\n        gl.deleteProgram(shader.program)\n    }\n    this.shaders = [];\n};\n\n/**\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * Philip Taylor: http://philip.html5.org\n */\n\n/**\n * Start Dash Video\n *\n * @param recurl\n * @param texturediv\n */\nfunction startDashVideo(recurl, texturediv) {\n    var vars = function() {\n            var vars = {};\n            var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m, key, value) {\n                vars[key] = value;\n            });\n            return vars;\n        },\n        url = recurl,\n        video,\n        context,\n        player;\n\n    if (vars && vars.hasOwnProperty(\"url\")) {\n        url = vars.url;\n    }\n\n    video = document.querySelector(texturediv);\n    context = new Dash.di.DashContext();\n    player = new MediaPlayer(context);\n\n    player.startup();\n\n    player.attachView(video);\n    player.setAutoPlay(false);\n\n    player.attachSource(url);\n}\n\n/**\n * Texture\n *\n * @param gl\n * @param doc\n * @param cache\n * @param node\n * @constructor\n */\nx3dom.Texture = function (gl, doc, cache, node) {\n    this.gl = gl;\n    this.doc = doc;\n    this.cache = cache;\n    this.node = node;\n\n    this.samplerName = \"diffuseMap\";\n    this.type = gl.TEXTURE_2D;\n    this.format = gl.RGBA;\n    this.magFilter = gl.LINEAR;\n    this.minFilter = gl.LINEAR;\n    this.wrapS = gl.REPEAT;\n    this.wrapT = gl.REPEAT;\n    this.genMipMaps = false;\n    this.texture = null;\n    this.ready = false;\n    this.anisotropicDegree = 1.0;\n\n    this.dashtexture = false;\n\n    var tex = this.node;\n    var suffix = \"mpd\";\n\n    this.node._x3domTexture = this;\n\n    if (x3dom.isa(tex, x3dom.nodeTypes.MovieTexture)) {\n        // for dash we are lazy and check only the first url\n        if (tex._vf.url[0].indexOf(suffix, tex._vf.url[0].length - suffix.length) !== -1) {\n            this.dashtexture = true;\n            // we need to initially place the script for the dash player once in the document,\n            // but insert this additional script only, if really needed and Dash is requested!\n            var js = document.getElementById(\"AdditionalDashVideoScript\");\n            if (!js) {\n                js = document.createElement(\"script\");\n                js.setAttribute(\"type\", \"text/javascript\");\n                js.setAttribute(\"src\", x3dom.Texture.dashVideoScriptFile);\n                js.setAttribute(\"id\", \"AdditionalDashVideoScript\");\n                js.onload = function() {\n                    var texObj;\n                    while ((texObj = x3dom.Texture.loadDashVideos.pop())) {\n                        x3dom.Texture.textNum++;\n                        texObj.update();\n                    }\n                    js.ready = true;\n                };\n                document.getElementsByTagName('head')[0].appendChild(js);\n            }\n            if (js.ready === true) {\n                // count dash players and add this number to the class name for future reference\n                // (append in id too, for play, pause etc)\n                x3dom.Texture.textNum++;\n                // update can be directly called as script is already loaded\n                this.update();\n            }\n            else {\n                // push to stack and process later when script has loaded\n                x3dom.Texture.loadDashVideos.push(this);\n            }\n        }\n    }\n\n    if (!this.dashtexture) {\n        this.update();\n    }\n};\n\nx3dom.Texture.dashVideoScriptFile = \"dash.all.js\";\nx3dom.Texture.loadDashVideos = [];\nx3dom.Texture.textNum = 0;\nx3dom.Texture.clampFontSize = false;\nx3dom.Texture.minFontQuality = 0.5;\nx3dom.Texture.maxFontQuality = 10;\n\n/**\n * Update\n *\n */\nx3dom.Texture.prototype.update = function() {\n\tif ( x3dom.isa(this.node, x3dom.nodeTypes.Text) ) {\n\t\tthis.updateText();\n\t} else {\n\t\tthis.updateTexture();\n\t}\n\n    this.node.validateGLObject();\n};\n\n/**\n * Set Pixel\n *\n * @param x\n * @param y\n * @param pixel\n * @param update\n */\nx3dom.Texture.prototype.setPixel = function(x, y, pixel, update) {\n    var gl = this.gl;\n\n    var pixels = new Uint8Array(pixel);\n\n    gl.bindTexture(this.type, this.texture);\n\n    gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1);\n\n    gl.texSubImage2D(this.type, 0, x, y, 1, 1, this.format, gl.UNSIGNED_BYTE, pixels);\n\n    gl.bindTexture(this.type, null);\n\n    if (update) {\n        this.doc.needRender = true;\n    }\n};\n\n/**\n * Update Texture\n *\n */\nx3dom.Texture.prototype.updateTexture = function() {\n    var gl = this.gl;\n    var doc = this.doc;\n    var tex = this.node;\n\n    // Set sampler\n    this.samplerName = tex._type;\n\n    // Set texture type\n    if (x3dom.isa(tex, x3dom.nodeTypes.X3DEnvironmentTextureNode)) {\n        this.type = gl.TEXTURE_CUBE_MAP;\n    } else {\n        this.type = gl.TEXTURE_2D;\n    }\n\n    // Set texture format\n    if (x3dom.isa(tex, x3dom.nodeTypes.PixelTexture)) {\n        switch (tex._vf.image.comp) {\n            case 1:\n                this.format = gl.LUMINANCE;\n                break;\n            case 2:\n                this.format = gl.LUMINANCE_ALPHA;\n                break;\n            case 3:\n                this.format = gl.RGB;\n                break;\n            case 4:\n                this.format = gl.RGBA;\n                break;\n        }\n    } else {\n        this.format = gl.RGBA;\n    }\n\n    // Set texture min, mag, wrapS and wrapT\n    if (tex._cf.textureProperties.node !== null) {\n        var texProp = tex._cf.textureProperties.node;\n\n        this.wrapS = x3dom.Utils.boundaryModesDic(gl, texProp._vf.boundaryModeS);\n        this.wrapT = x3dom.Utils.boundaryModesDic(gl, texProp._vf.boundaryModeT);\n\n        this.minFilter = x3dom.Utils.minFilterDic(gl, texProp._vf.minificationFilter);\n        this.magFilter = x3dom.Utils.magFilterDic(gl, texProp._vf.magnificationFilter);\n\n        this.anisotropicDegree = Math.min(Math.max(texProp._vf.anisotropicDegree, 1.0), x3dom.caps.MAX_ANISOTROPY);\n\n        if (texProp._vf.generateMipMaps === true) {\n            this.genMipMaps = true;\n\n            if (this.minFilter == gl.NEAREST) {\n                this.minFilter = gl.NEAREST_MIPMAP_NEAREST;\n            } else if (this.minFilter == gl.LINEAR) {\n                this.minFilter = gl.LINEAR_MIPMAP_LINEAR;\n            }\n\n            if (this.texture && (this.texture.ready || this.texture.textureCubeReady)) {\n                gl.bindTexture(this.type, this.texture);\n                gl.generateMipmap(this.type);\n                gl.bindTexture(this.type, null);\n            }\n        } else {\n            this.genMipMaps = false;\n\n            if ((this.minFilter == gl.LINEAR_MIPMAP_LINEAR) ||\n                (this.minFilter == gl.LINEAR_MIPMAP_NEAREST)) {\n                this.minFilter = gl.LINEAR;\n            } else if ((this.minFilter == gl.NEAREST_MIPMAP_LINEAR) ||\n                (this.minFilter == gl.NEAREST_MIPMAP_NEAREST)) {\n                this.minFilter = gl.NEAREST;\n            }\n        }\n    } else {\n        if (tex._vf.repeatS == false) {\n            this.wrapS = gl.CLAMP_TO_EDGE;\n        } else {\n            this.wrapS = gl.REPEAT;\n        }\n\n        if (tex._vf.repeatT == false) {\n            this.wrapT = gl.CLAMP_TO_EDGE;\n        } else {\n            this.wrapT = gl.REPEAT;\n        }\n\n        if (this.samplerName == \"displacementMap\" ||\n            this.samplerName == \"multiDiffuseAlphaMap\" ||\n            this.samplerName == \"multiVisibilityMap\" ||\n            this.samplerName == \"multiEmissiveAmbientMap\" ||\n            this.samplerName == \"multiSpecularShininessMap\") {\n            this.wrapS = gl.CLAMP_TO_EDGE;\n            this.wrapT = gl.CLAMP_TO_EDGE;\n            this.minFilter = gl.NEAREST;\n            this.magFilter = gl.NEAREST;\n        }\n    }\n\n    // Looking for child texture\n    var childTex = (tex._video && tex._needPerFrameUpdate === true);\n\n    // Set texture\n    if (tex._isCanvas && tex._canvas) {\n        if (this.texture == null) {\n            this.texture = gl.createTexture();\n        }\n        this.texture.width = tex._canvas.width;\n        this.texture.height = tex._canvas.height;\n        this.texture.ready = true;\n\n        gl.bindTexture(this.type, this.texture);\n        gl.texImage2D(this.type, 0, this.format, this.format, gl.UNSIGNED_BYTE, tex._canvas);\n        if (this.genMipMaps) {\n            gl.generateMipmap(this.type);\n        }\n        gl.bindTexture(this.type, null);\n    }\n\n    else if (x3dom.isa(tex, x3dom.nodeTypes.RenderedTexture)) {\n        if (tex._webgl && tex._webgl.fbo) {\n            if (tex._webgl.fbo.dtex && tex._vf.depthMap) {\n                this.texture = tex._webgl.fbo.dtex;\n            } else {\n                this.texture = tex._webgl.fbo.tex;\n            }\n\n        } else {\n            this.texture = null;\n            x3dom.debug.logError(\"Try updating RenderedTexture without FBO initialized!\");\n        }\n        if (this.texture) {\n            this.texture.ready = true;\n        }\n    }\n    else if (x3dom.isa(tex, x3dom.nodeTypes.PixelTexture)) {\n        if (this.texture == null) {\n            if (this.node._DEF) {\n                this.texture = this.cache.getTexture2DByDEF(gl, this.node._nameSpace, this.node._DEF);\n\n            } else {\n                this.texture = gl.createTexture();\n            }\n        }\n        this.texture.width = tex._vf.image.width;\n        this.texture.height = tex._vf.image.height;\n        this.texture.ready = true;\n\n        var pixelArr = tex._vf.image.array;\n        var pixelArrfont_size = tex._vf.image.width * tex._vf.image.height * tex._vf.image.comp;\n\n        var pixels = new Uint8Array(pixelArrfont_size);\n\n        pixels.set(pixelArr);\n\n        gl.bindTexture(this.type, this.texture);\n        gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1);\n        gl.texImage2D(this.type, 0, this.format,\n            tex._vf.image.width, tex._vf.image.height, 0,\n            this.format, gl.UNSIGNED_BYTE, pixels);\n        if (this.genMipMaps) {\n            gl.generateMipmap(this.type);\n        }\n        gl.bindTexture(this.type, null);\n    } else if (x3dom.isa(tex, x3dom.nodeTypes.MovieTexture) || childTex) {\n        var that = this;\n        var p = document.getElementsByTagName('body')[0];\n\n        if (this.texture == null) {\n            this.texture = gl.createTexture();\n        }\n\n        if (this.dashtexture) {\n            var element_vid = document.createElement('div');\n            element_vid.setAttribute('class', 'dash-video-player' + x3dom.Texture.textNum);\n            tex._video = document.createElement('video');\n            tex._video.setAttribute('preload', 'auto');\n            tex._video.setAttribute('muted', 'muted');\n\n            var scriptToRun = document.createElement('script');\n            scriptToRun.setAttribute('type', 'text/javascript');\n            scriptToRun.innerHTML = 'startDashVideo(\"' + tex._vf.url[0] +\n                '\",\".dash-video-player' + x3dom.Texture.textNum + ' video\")';\n            element_vid.appendChild(scriptToRun);\n            element_vid.appendChild(tex._video);\n            p.appendChild(element_vid);\n            tex._video.style.visibility = \"hidden\";\n            tex._video.style.display = \"none\";\n\n        } else {\n            if (!childTex) {\n                tex._video = document.createElement('video');\n                tex._video.setAttribute('preload', 'auto');\n                tex._video.setAttribute('muted', 'muted');\n                p.appendChild(tex._video);\n                tex._video.style.visibility = \"hidden\";\n                tex._video.style.display = \"none\";\n            }\n\n            for (var i = 0; i < tex._vf.url.length; i++) {\n                var videoUrl = tex._nameSpace.getURL(tex._vf.url[i]);\n                x3dom.debug.logInfo('Adding video file: ' + videoUrl);\n                var src = document.createElement('source');\n                src.setAttribute('src', videoUrl);\n                tex._video.appendChild(src);\n            }\n        }\n\n        var updateMovie = function() {\n            gl.bindTexture(that.type, that.texture);\n            gl.texImage2D(that.type, 0, that.format, that.format, gl.UNSIGNED_BYTE, tex._video);\n            if (that.genMipMaps) {\n                gl.generateMipmap(that.type);\n            }\n            gl.bindTexture(that.type, null);\n            that.texture.ready = true;\n            doc.needRender = true;\n        };\n\n        var startVideo = function() {\n            tex._video.play();\n            tex._intervalID = setInterval(updateMovie, 16);\n        };\n\n        var videoDone = function() {\n            clearInterval(tex._intervalID);\n            if (tex._vf.loop === true) {\n                tex._video.play();\n                tex._intervalID = setInterval(updateMovie, 16);\n            }\n        };\n\n        // Start listening for the canplaythrough event, so we do not\n        // start playing the video until we can do so without stuttering\n        tex._video.addEventListener(\"canplaythrough\", startVideo, true);\n\n\t\t// Start listening for the ended event, so we can stop the\n\t\t// texture update when the video is finished playing\n\t\ttex._video.addEventListener(\"ended\", videoDone, true);\n\t} else if (x3dom.isa(tex, x3dom.nodeTypes.X3DEnvironmentTextureNode)) {\n\t\tthis.texture = this.cache.getTextureCube(gl, doc, tex.getTexUrl(), false,\n\t\t                                         tex._vf.crossOrigin, tex._vf.scale, this.genMipMaps, tex._vf.flipY);\n\t} else {\n\t\tthis.texture = this.cache.getTexture2D(gl, doc, tex._nameSpace.getURL(tex._vf.url[0]),\n\t\t                                       false, tex._vf.crossOrigin, tex._vf.scale, this.genMipMaps, tex._vf.flipY);\n\t}\n};\n\n/**\n * Update Text\n *\n */\nx3dom.Texture.prototype.updateText = function() {\n    var gl = this.gl;\n\n    this.wrapS = gl.CLAMP_TO_EDGE;\n    this.wrapT = gl.CLAMP_TO_EDGE;\n    this.type = gl.TEXTURE_2D;\n    this.format = gl.RGBA;\n    this.magFilter = gl.LINEAR;\n    this.minFilter = gl.LINEAR;\n\n    var fontStyleNode = this.node._cf.fontStyle.node; // should always exist?\n\n    var font_family = 'serif'; // should be dealt with by default fontStyleNode?\n    var font_style = 'normal';\n    var font_justify = 'left';\n    var font_size = 1.0;\n    var font_spacing = 1.0;\n    var font_horizontal = true;\n    var font_language = \"\";\n    var oversample = 2.0;\n    var minor_alignment = 'FIRST';\n\n    if (fontStyleNode !== null) {\n        var fonts = fontStyleNode._vf.family.toString();\n\n        // clean attribute values and split in array\n        fonts = fonts.trim().replace(/\\'/g, '').replace(/\\,/, ' ');\n        fonts = fonts.split(\" \");\n\n        font_family = Array.map(fonts, function(s) {\n            if (s == 'SANS') {\n                return 'sans-serif';\n            }\n            else if (s == 'SERIF') {\n                return 'serif';\n            }\n            else if (s == 'TYPEWRITER') {\n                return 'monospace';\n            }\n            else {\n                return '' + s + '';\n            }  // 'Verdana'\n        }).join(\",\");\n\n        font_style = fontStyleNode._vf.style.toString().replace(/\\'/g, '');\n        switch (font_style.toUpperCase()) {\n            case 'PLAIN':\n                font_style = 'normal';\n                break;\n            case 'BOLD':\n                font_style = 'bold';\n                break;\n            case 'ITALIC':\n                font_style = 'italic';\n                break;\n            case 'BOLDITALIC':\n                font_style = 'italic bold';\n                break;\n            default:\n                font_style = 'normal';\n        }\n\n        var leftToRight = fontStyleNode._vf.leftToRight ? 'ltr' : 'rtl';\n        var topToBottom = fontStyleNode._vf.topToBottom;\n    \n        var beginAlign = leftToRight == 'ltr' ? 'left' : 'right';\n        var endAlign = leftToRight == 'ltr' ? 'right' : 'left';\n\n        font_justify = fontStyleNode._vf.justify[0].toString().replace(/\\'/g, '');\n        switch (font_justify.toUpperCase()) {\n            case 'BEGIN':\n                font_justify = beginAlign;\n                break;\n            case 'END':\n                font_justify = endAlign;\n                break;\n            case 'FIRST':\n                font_justify = beginAlign;\n                break; // relevant only in justify[1], eg. minor alignment\n            case 'MIDDLE':\n                font_justify = 'center';\n                break;\n            default:\n                font_justify = beginAlign;\n                break;\n        }\n\n        if (fontStyleNode._vf.justify[1] === undefined) {\n            minor_alignment = 'FIRST';\n        } else {\n            minor_alignment = fontStyleNode._vf.justify[1].toString().replace(/\\'/g, '');\n            switch (minor_alignment.toUpperCase()) {\n                case 'BEGIN':\n                    minor_alignment = 'BEGIN';\n                    break;\n                case 'FIRST':\n                    minor_alignment = 'FIRST';\n                    break;\n                case 'MIDDLE':\n                    minor_alignment = 'MIDDLE';\n                    break;\n                case 'END':\n                    minor_alignment = 'END';\n                    break;\n                default:\n                    minor_alignment = 'FIRST';\n                    break;\n            }\n        }\n\n        font_size = fontStyleNode._vf.size;\n        font_spacing = fontStyleNode._vf.spacing;\n        font_horizontal = fontStyleNode._vf.horizontal; //TODO: vertical needs canvas support\n        font_language = fontStyleNode._vf.language;\n        oversample = fontStyleNode._vf.quality;\n        oversample = Math.max(x3dom.Texture.minFontQuality, oversample);\n        oversample = Math.min(x3dom.Texture.maxFontQuality, oversample);\n\n        if (font_size < 0.1) font_size = 0.1;\n        if (x3dom.Texture.clampFontSize && font_size > 2.3) {\n            font_size = 2.3;\n        }\n    }\n\n    var textX, textY;\n    var paragraph = this.node._vf.string;\n    var maxExtent = this.node._vf.maxExtent;\n    var lengths = [];\n    var text_canvas = document.createElement('canvas');\n    text_canvas.dir = leftToRight;\n    var x3dToPx = 42;\n    var textHeight = font_size * x3dToPx; // pixel size relative to local coordinate system\n    var textAlignment = font_justify;\n\n    // needed to make webfonts work\n    document.body.appendChild(text_canvas);\n    var text_ctx = text_canvas.getContext('2d');\n\n    text_ctx.font = font_style + \" \" + textHeight + \"px \" + font_family;\n\n    var maxWidth = 0, pWidth, pLength;\n    var i, j;\n\n    // calculate maxWidth and length scaling; sanitize lengths\n    for (i = 0; i < paragraph.length; i++) {\n\n        pWidth = text_ctx.measureText(paragraph[i]).width;\n        if (pWidth > maxWidth) {\n            maxWidth = pWidth;\n        }\n\n        pLength = this.node._vf.length[i] | 0;\n        if (maxExtent > 0 && (pLength > maxExtent || pLength == 0)) {\n            pLength = maxExtent;\n        }\n        lengths[i] = pLength <= 0 ? pWidth : pLength * x3dToPx;\n    }\n\n    var canvas_extra = 0.25 * textHeight; // single line, some fonts are higher than textHeight\n    var txtW = maxWidth;\n    var txtH = textHeight * font_spacing * paragraph.length + canvas_extra;\n\n    textX = 0;\n    textY = 0;\n\n    var x_offset = 0, y_offset = 0, baseLine = 'top';\n\n    // x_offset and starting X\n    switch (font_justify) {\n        case \"center\":\n            x_offset = -txtW / 2;\n            textX = txtW / 2;\n            break;\n        case \"left\":\n            x_offset = 0;\n            textX = 0;\n            break;\n        case \"right\":\n            x_offset = -txtW;\n            textX = txtW;\n            break;\n    }\n\n    // y_offset, baseline and first Y\n    switch (minor_alignment) {\n        case \"MIDDLE\":\n            y_offset = txtH / 2 - canvas_extra / 2;\n            break;\n        case \"BEGIN\":\n            y_offset = topToBottom ? 0 : txtH - canvas_extra;\n            baseLine = topToBottom ? 'top' : 'bottom';\n            textY = topToBottom ? 0 : textHeight; // adjust for baseline\n            break;\n        case \"FIRST\":\n            //special case of BEGIN\n            y_offset = topToBottom ? textHeight : txtH - canvas_extra;\n            baseLine = topToBottom ? 'alphabetic' : 'bottom';\n            textY = topToBottom ? textHeight : textHeight;\n            break;\n        case \"END\":\n            y_offset = topToBottom ? txtH - canvas_extra : 0;\n            baseLine = topToBottom ? 'bottom' : 'top';\n            textY = topToBottom ? textHeight : 0;\n            break;\n    }\n\n    var pxToX3d = 1 / 42.0;\n    var w = txtW * pxToX3d;\n    var h = txtH * pxToX3d;\n\n    x_offset *= pxToX3d;\n    y_offset *= pxToX3d;\n\n    text_canvas.width = txtW * oversample;\n    text_canvas.height = txtH * oversample;\n    text_canvas.dir = leftToRight;\n\n    text_ctx.scale(oversample, oversample);\n\n    // transparent background\n    text_ctx.fillStyle = 'rgba(0,0,0,0)';\n    text_ctx.fillRect(0, 0, text_ctx.canvas.width, text_ctx.canvas.height);\n\n    // write white text with black border\n    text_ctx.fillStyle = 'white';\n    text_ctx.textBaseline = baseLine;\n\n    text_ctx.font = font_style + \" \" + textHeight + \"px \" + font_family;\n    text_ctx.textAlign = textAlignment;\n\n    // create the multiline text always top down\n    for (i = 0; i < paragraph.length; i++) {\n        j = topToBottom ? i : paragraph.length - 1 - i;\n        if (leftToRight == 'rtl') paragraph[j] = '\\u202e' + paragraph[j]; //force rtl unicode mark\n        text_ctx.fillText(paragraph[j], textX, textY, lengths[j]);\n        textY += textHeight * font_spacing;\n    }\n\n    if (this.texture === null) {\n        this.texture = gl.createTexture();\n    }\n\n    gl.bindTexture(this.type, this.texture);\n    gl.texImage2D(this.type, 0, this.format, this.format, gl.UNSIGNED_BYTE, text_canvas);\n    gl.bindTexture(this.type, null);\n\n    //remove canvas after Texture creation\n    document.body.removeChild(text_canvas);\n\n    this.node._mesh._positions[0] = [\n        0 + x_offset, -h + y_offset, 0,\n        w + x_offset, -h + y_offset, 0,\n        w + x_offset, 0 + y_offset, 0,\n        0 + x_offset, 0 + y_offset, 0];\n\n    this.node.invalidateVolume();\n    Array.forEach(this.node._parentNodes, function(node) {\n        node.setAllDirty();\n    });\n};\n\n/*\r\n * X3DOM JavaScript Library\r\n * http://www.x3dom.org\r\n *\r\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\r\n * Dual licensed under the MIT and GPL\r\n *\r\n * Based on code originally provided by\r\n * Philip Taylor: http://philip.html5.org\r\n */\r\n\r\n\r\n// ### X3DDocument ###\r\nx3dom.X3DDocument = function(canvas, ctx, settings) {\r\n    this.canvas = canvas;       // The <canvas> elem\r\n    this.ctx = ctx;             // WebGL context object, AKA gl\r\n    this.properties = settings; // showStat, showLog, etc.\r\n    this.needRender = true;     // Trigger redraw if true\r\n    this._x3dElem = null;       // Backref to <X3D> root element (set on parsing)\r\n    this._scene = null;         // Scene root element\r\n    this._viewarea = null;      // Viewport, handles rendering and interaction\r\n    this.downloadCount = 0;     // Counter for objects to be loaded\r\n    this.previousDownloadCount = 0;\r\n\r\n    // bag for pro-active (or multi-core-like) elements\r\n    this._nodeBag = {\r\n        timer: [],                // TimeSensor (tick)\r\n        lights: [],               // Light\r\n        clipPlanes: [],           // ClipPlane\r\n        followers: [],            // X3DFollowerNode\r\n        trans: [],                // X3DTransformNode (for listening to CSS changes)\r\n        renderTextures: [],       // RenderedTexture\r\n        viewarea: [],             // Viewport (for updating camera navigation)\r\n        affectedPointingSensors: [] // all X3DPointingDeviceSensor currently activated (i.e., used for interaction),\r\n                                    // this list is maintained for efficient update / deactivation\r\n    };\r\n\r\n    this.onload = function () {};\r\n    this.onerror = function () {};\r\n};\r\n\r\nx3dom.X3DDocument.prototype.load = function (uri, sceneElemPos) {\r\n    // Load uri. Get sceneDoc, list of sub-URIs.\r\n    // For each URI, get docs[uri] = whatever, extend list of sub-URIs.\r\n\r\n    var uri_docs = {};\r\n    var queued_uris = [uri];\r\n    var doc = this;\r\n\r\n    function next_step() {\r\n        // TODO: detect circular inclusions\r\n        // TODO: download in parallel where possible\r\n\r\n        if (queued_uris.length === 0) {\r\n            // All done\r\n            doc._setup(uri_docs[uri], uri_docs, sceneElemPos);\r\n            doc.onload();\r\n            return;\r\n        }\r\n        var next_uri = queued_uris.shift();\r\n\r\n        if ( x3dom.isX3DElement(next_uri) &&\r\n            (next_uri.localName.toLowerCase() === 'x3d' || next_uri.localName.toLowerCase() === 'websg') )\r\n        {\r\n            // Special case, when passed an X3D node instead of a URI string\r\n            uri_docs[next_uri] = next_uri;\r\n            doc._x3dElem = next_uri;\r\n            next_step();\r\n        }\r\n    }\r\n\r\n    next_step();\r\n};\r\n\r\nx3dom.findScene = function(x3dElem) {\r\n    var sceneElems = [];\r\n\r\n    for (var i=0; i<x3dElem.childNodes.length; i++) {\r\n        var sceneElem = x3dElem.childNodes[i];\r\n\r\n        if (sceneElem && sceneElem.localName && sceneElem.localName.toLowerCase() === \"scene\") {\r\n            sceneElems.push(sceneElem);\r\n        }\r\n    }\r\n\r\n    if (sceneElems.length > 1) {\r\n        x3dom.debug.logError(\"X3D element has more than one Scene child (has \" +\r\n                             x3dElem.childNodes.length + \").\");\r\n    }\r\n    else {\r\n        return sceneElems[0];\r\n    }\r\n    return null;\r\n};\r\n\r\n\r\nx3dom.X3DDocument.prototype._setup = function (sceneDoc, uriDocs, sceneElemPos) {\r\n    var doc = this;\r\n\r\n    function cleanNodeBag(bag, node) {\r\n        for (var i=0, n=bag.length; i<n; i++) {\r\n            if (bag[i] === node) {\r\n                bag.splice(i, 1);\r\n                break;\r\n            }\r\n        }\r\n    }\r\n\r\n    function removeX3DOMBackendGraph(domNode) {\r\n        var children = domNode.childNodes;\r\n\r\n        for (var i=0, n=children.length; i<n; i++) {\r\n            removeX3DOMBackendGraph(children[i]);\r\n        }\r\n\r\n        if (domNode._x3domNode) {\r\n            var node = domNode._x3domNode;\r\n            var nameSpace = node._nameSpace;\r\n\r\n            if (x3dom.isa(node, x3dom.nodeTypes.X3DShapeNode)) {\r\n                if (node._cleanupGLObjects) {\r\n                    node._cleanupGLObjects(true);\r\n                    // TODO: more cleanups, e.g. texture/shader cache?\r\n                }\r\n                if (x3dom.nodeTypes.Shape.idMap.nodeID[node._objectID]) {\r\n                    delete x3dom.nodeTypes.Shape.idMap.nodeID[node._objectID];\r\n                }\r\n            }\r\n            else if (x3dom.isa(node, x3dom.nodeTypes.TimeSensor)) {\r\n                cleanNodeBag(doc._nodeBag.timer, node);\r\n            }\r\n            else if (x3dom.isa(node, x3dom.nodeTypes.X3DLightNode)) {\r\n                cleanNodeBag(doc._nodeBag.lights, node);\r\n            }\r\n            else if (x3dom.isa(node, x3dom.nodeTypes.X3DFollowerNode)) {\r\n                cleanNodeBag(doc._nodeBag.followers, node);\r\n            }\r\n            else if (x3dom.isa(node, x3dom.nodeTypes.X3DTransformNode)) {\r\n                cleanNodeBag(doc._nodeBag.trans, node);\r\n            }\r\n            else if (x3dom.isa(node, x3dom.nodeTypes.RenderedTexture)) {\r\n                cleanNodeBag(doc._nodeBag.renderTextures, node);\r\n                if (node._cleanupGLObjects) {\r\n                    node._cleanupGLObjects();\r\n                }\r\n            }\r\n            else if (x3dom.isa(node, x3dom.nodeTypes.X3DPointingDeviceSensorNode)) {\r\n                cleanNodeBag(doc._nodeBag.affectedPointingSensors, node);\r\n            }\r\n            else if (x3dom.isa(node, x3dom.nodeTypes.Texture)) {\r\n                node.shutdown();    // general texture might have video\r\n            }\r\n            else if (x3dom.isa(node, x3dom.nodeTypes.AudioClip)) {\r\n                node.shutdown();\r\n            }\r\n            else if (x3dom.isa(node, x3dom.nodeTypes.X3DBindableNode)) {\r\n                var stack = node._stack;\r\n                if (stack) {\r\n                    node.bind(false);\r\n                    cleanNodeBag(stack._bindBag, node);\r\n                }\r\n                // Background may have geometry\r\n                if (node._cleanupGLObjects) {\r\n                    node._cleanupGLObjects();\r\n                }\r\n            }\r\n            else if (x3dom.isa(node, x3dom.nodeTypes.Scene)) {\r\n                if (node._webgl) {\r\n                    node._webgl = null;\r\n                    // TODO; explicitly delete all gl objects\r\n                }\r\n            }\r\n\r\n            //do not remove node from namespace if it was only \"USE\"d\r\n            if (nameSpace && !(domNode.getAttribute('use') || domNode.getAttribute('USE')))\r\n            {\r\n                nameSpace.removeNode(node._DEF);\r\n            }\r\n            node._xmlNode = null;\r\n\r\n            delete domNode._x3domNode;\r\n        }\r\n    }\r\n\r\n    function getParentNode(domNode) {\r\n        var parentNode = domNode.parentNode;\r\n\r\n        // move dom up if parent is metagroup\r\n        if ( parentNode.localName.toLowerCase() == \"x3dommetagroup\" ) {\r\n            parentNode = getParentNode(parentNode);\r\n        }\r\n\r\n        return parentNode;\r\n    }\r\n\r\n    // Test capturing DOM mutation events on the X3D subscene\r\n    var domEventListener = {\r\n        onAttrModified: function(e) {\r\n            if ('_x3domNode' in e.target) {\r\n                var attrToString = {\r\n                    1: \"MODIFICATION\",\r\n                    2: \"ADDITION\",\r\n                    3: \"REMOVAL\"\r\n                };\r\n                //x3dom.debug.logInfo(\"MUTATION: \" + e.attrName + \", \" + e.type + \", attrChange=\" + attrToString[e.attrChange]);\r\n                e.target._x3domNode.updateField(e.attrName, e.newValue);\r\n                doc.needRender = true;\r\n            }\r\n        },\r\n\r\n        onNodeRemoved: function(e) {\r\n            var domNode = e.target;\r\n            if (!domNode)\r\n                return;\r\n\r\n            var parentNode = getParentNode(domNode);\r\n\r\n            if ('_x3domNode' in parentNode && '_x3domNode' in domNode) {\r\n                var parent = parentNode._x3domNode;\r\n                var child = domNode._x3domNode;\r\n\r\n                if (parent && child) {\r\n                    parent.removeChild(child);\r\n                    parent.nodeChanged();\r\n\r\n                    removeX3DOMBackendGraph(domNode);\r\n\r\n                    if (doc._viewarea && doc._viewarea._scene) {\r\n                        doc._viewarea._scene.nodeChanged();\r\n                        doc._viewarea._scene.updateVolume();\r\n                        doc.needRender = true;\r\n                    }\r\n                }\r\n            }\r\n            else if (domNode.localName && domNode.localName.toUpperCase() == \"ROUTE\" && domNode._nodeNameSpace) {\r\n                var fromNode = domNode._nodeNameSpace.defMap[domNode.getAttribute('fromNode')];\r\n                var toNode = domNode._nodeNameSpace.defMap[domNode.getAttribute('toNode')];\r\n\r\n                if (fromNode && toNode) {\r\n                    fromNode.removeRoute(domNode.getAttribute('fromField'), toNode, domNode.getAttribute('toField'));\r\n                }\r\n            }\r\n            else if (domNode.localName && domNode.localName.toUpperCase() == \"X3D\") {\r\n                var runtime = domNode.runtime;\r\n\r\n                if (runtime && runtime.canvas && runtime.canvas.doc && runtime.canvas.doc._scene) {\r\n                    var sceneNode = runtime.canvas.doc._scene._xmlNode;\r\n\r\n                    removeX3DOMBackendGraph(sceneNode);\r\n\r\n                    // also clear corresponding X3DCanvas element\r\n                    for (var i=0; i<x3dom.canvases.length; i++) {\r\n                        if (x3dom.canvases[i] === runtime.canvas) {\r\n                            x3dom.canvases[i].doc.shutdown(x3dom.canvases[i].gl);\r\n                            x3dom.canvases.splice(i, 1);\r\n                            break;\r\n                        }\r\n                    }\r\n\r\n                    runtime.canvas.doc._scene = null;\r\n                    runtime.canvas.doc._viewarea = null;\r\n                    runtime.canvas.doc = null;\r\n                    runtime.canvas = null;\r\n                    runtime = null;\r\n\r\n                    domNode.context = null;\r\n                    domNode.runtime = null;\r\n                }\r\n            }\r\n        },\r\n\r\n        onNodeInserted: function(e) {\r\n            var child = e.target;\r\n            var parentNode = getParentNode(child);\r\n\r\n            // only act on x3dom nodes, ignore regular HTML\r\n            if ('_x3domNode' in parentNode) {\r\n\t\t\t\tif (parentNode.tagName && parentNode.tagName.toLowerCase() == 'inline' ||\r\n                    parentNode.tagName.toLowerCase() == 'multipart') {\r\n                    // do nothing\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tvar parent = parentNode._x3domNode;\r\n\r\n\t\t\t\t\tif (parent && parent._nameSpace && (child instanceof Element)) {\r\n\r\n                        if (x3dom.caps.DOMNodeInsertedEvent_perSubtree)\r\n                        {\r\n                            removeX3DOMBackendGraph(child);    // not really necessary...\r\n                        }\r\n\r\n                        var newNode = parent._nameSpace.setupTree(child);\r\n\r\n                        parent.addChild(newNode, child.getAttribute(\"containerField\"));\r\n                        parent.nodeChanged();\r\n\r\n                        var grandParentNode = parentNode.parentNode;\r\n                        if (grandParentNode && grandParentNode._x3domNode)\r\n                            grandParentNode._x3domNode.nodeChanged();\r\n\r\n                        if (doc._viewarea && doc._viewarea._scene) {\r\n                            doc._viewarea._scene.nodeChanged();\r\n                            doc._viewarea._scene.updateVolume();\r\n                            doc.needRender = true;\r\n                        }\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tx3dom.debug.logWarning(\"No _nameSpace in onNodeInserted\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n            }\r\n        }\r\n    };\r\n\r\n    //sceneDoc.addEventListener('DOMCharacterDataModified', domEventListener.onAttrModified, true);\r\n    sceneDoc.addEventListener('DOMNodeRemoved', domEventListener.onNodeRemoved, true);\r\n    sceneDoc.addEventListener('DOMNodeInserted', domEventListener.onNodeInserted, true);\r\n    if ( (x3dom.userAgentFeature.supportsDOMAttrModified === true ) ) {\r\n        sceneDoc.addEventListener('DOMAttrModified', domEventListener.onAttrModified, true);\r\n    }\r\n\r\n    // sceneDoc is the X3D element here...\r\n    var sceneElem = x3dom.findScene(sceneDoc);\r\n\r\n    // create and add BindableBag that holds all bindable stacks\r\n    this._bindableBag = new x3dom.BindableBag(this);\r\n\r\n    // create and add the NodeNameSpace\r\n    var nameSpace = new x3dom.NodeNameSpace(\"scene\", doc);\r\n\r\n    var scene = nameSpace.setupTree(sceneElem);\r\n\r\n    // link scene\r\n    this._scene = scene;\r\n    this._bindableBag.setRefNode(scene);\r\n\r\n    // create view\r\n    this._viewarea = new x3dom.Viewarea (this, scene);\r\n\r\n    this._viewarea._width = this.canvas.width;\r\n    this._viewarea._height = this.canvas.height;\r\n};\r\n\r\nx3dom.X3DDocument.prototype.advanceTime = function (t) {\r\n    var i = 0;\r\n\r\n    if (this._nodeBag.timer.length) {\r\n        for (i=0; i < this._nodeBag.timer.length; i++)\r\n            { this.needRender |= this._nodeBag.timer[i].tick(t); }\r\n    }\r\n    if (this._nodeBag.followers.length) {\r\n        for (i=0; i < this._nodeBag.followers.length; i++)\r\n            { this.needRender |= this._nodeBag.followers[i].tick(t); }\r\n    }\r\n    // just a temporary tricker solution to update the CSS transforms\r\n    if (this._nodeBag.trans.length) {\r\n        for (i=0; i < this._nodeBag.trans.length; i++)\r\n            { this.needRender |= this._nodeBag.trans[i].tick(t); }\r\n    }\r\n    if (this._nodeBag.viewarea.length) {\r\n        for (i=0; i < this._nodeBag.viewarea.length; i++)\r\n            { this.needRender |= this._nodeBag.viewarea[i].tick(t); }\r\n    }\r\n};\r\n\r\nx3dom.X3DDocument.prototype.render = function (ctx, vrFrameData, vrDisplay) {\r\n    if (!ctx || !this._viewarea) {\r\n        return;\r\n    }\r\n\r\n    this._viewarea.setVRFrameData(vrFrameData);\r\n    this._viewarea.updateGamepads(vrDisplay);\r\n\r\n    ctx.renderScene(this._viewarea);\r\n};\r\n\r\nx3dom.X3DDocument.prototype.onPick = function (ctx, x, y) {\r\n    if (!ctx || !this._viewarea) {\r\n        return;\r\n    }\r\n\r\n    ctx.pickValue(this._viewarea, x, y, 1);\r\n};\r\n\r\nx3dom.X3DDocument.prototype.onPickRect = function (ctx, x1, y1, x2, y2) {\r\n    if (!ctx || !this._viewarea) {\r\n        return [];\r\n    }\r\n\r\n    return ctx.pickRect(this._viewarea, x1, y1, x2, y2);\r\n};\r\n\r\nx3dom.X3DDocument.prototype.onMove = function (ctx, x, y, buttonState) {\r\n    if (!ctx || !this._viewarea) {\r\n        return;\r\n    }\r\n\r\n    if (this._viewarea._scene._vf.doPickPass)\r\n        ctx.pickValue(this._viewarea, x, y, buttonState);\r\n    this._viewarea.onMove(x, y, buttonState);\r\n};\r\n\r\nx3dom.X3DDocument.prototype.onMoveView = function (ctx,evt, touches, translation, rotation) {\r\n    if (!ctx || !this._viewarea) {\r\n        return;\r\n    }\r\n\r\n    this._scene.getNavigationInfo()._impl.onTouchDrag(this._viewarea, evt, touches, translation, rotation);\r\n};\r\n\r\nx3dom.X3DDocument.prototype.onDrag = function (ctx, x, y, buttonState) {\r\n    if (!ctx || !this._viewarea) {\r\n        return;\r\n    }\r\n\r\n    if (this._viewarea._scene._vf.doPickPass && !this._viewarea._isMoving)\r\n        ctx.pickValue(this._viewarea, x, y, buttonState);\r\n    this._viewarea.onDrag(x, y, buttonState);\r\n};\r\n\r\nx3dom.X3DDocument.prototype.onWheel = function (ctx, x, y, originalY) {\r\n    if (!ctx || !this._viewarea) {\r\n        return;\r\n    }\r\n\r\n    if (this._viewarea._scene._vf.doPickPass)\r\n        ctx.pickValue(this._viewarea, x, originalY, 0);\r\n    this._viewarea.onDrag(x, y, 2);\r\n};\r\n\r\nx3dom.X3DDocument.prototype.onMousePress = function (ctx, x, y, buttonState) {\r\n    if (!ctx || !this._viewarea) {\r\n        return;\r\n    }\r\n\r\n    // update volume only on click since expensive!\r\n    this._viewarea._scene.updateVolume();\r\n\r\n    ctx.pickValue(this._viewarea, x, y, buttonState);\r\n    this._viewarea.onMousePress(x, y, buttonState);\r\n};\r\n\r\nx3dom.X3DDocument.prototype.onMouseRelease = function (ctx, x, y, buttonState, prevButton) {\r\n    if (!ctx || !this._viewarea) {\r\n        return;\r\n    }\r\n\r\n    var button = (prevButton << 8) | buttonState;   // for shadowObjectIdChanged\r\n    ctx.pickValue(this._viewarea, x, y, button);\r\n    this._viewarea.onMouseRelease(x, y, buttonState, prevButton);\r\n};\r\n\r\nx3dom.X3DDocument.prototype.onMouseOver = function (ctx, x, y, buttonState) {\r\n    if (!ctx || !this._viewarea) {\r\n        return;\r\n    }\r\n\r\n    ctx.pickValue(this._viewarea, x, y, buttonState);\r\n    this._viewarea.onMouseOver(x, y, buttonState);\r\n};\r\n\r\nx3dom.X3DDocument.prototype.onMouseOut = function (ctx, x, y, buttonState) {\r\n    if (!ctx || !this._viewarea) {\r\n        return;\r\n    }\r\n\r\n    ctx.pickValue(this._viewarea, x, y, buttonState);\r\n    this._viewarea.onMouseOut(x, y, buttonState);\r\n};\r\n\r\nx3dom.X3DDocument.prototype.onDoubleClick = function (ctx, x, y) {\r\n    if (!ctx || !this._viewarea) {\r\n        return;\r\n    }\r\n\r\n    this._viewarea.onDoubleClick(x, y);\r\n};\r\n\r\n\r\nx3dom.X3DDocument.prototype.onKeyDown = function(keyCode)\r\n{\r\n    //x3dom.debug.logInfo(\"pressed key \" + keyCode);\r\n    switch (keyCode) {\r\n        case 37: /* left */\r\n            this._viewarea.strafeLeft();\r\n            break;\r\n        case 38: /* up */\r\n            this._viewarea.moveFwd();\r\n            break;\r\n        case 39: /* right */\r\n            this._viewarea.strafeRight();\r\n            break;\r\n        case 40: /* down */\r\n            this._viewarea.moveBwd();\r\n            break;\r\n        default:\r\n    }\r\n};\r\n\r\nx3dom.X3DDocument.prototype.onKeyUp = function(keyCode)\r\n{\r\n    //x3dom.debug.logInfo(\"released key \" + keyCode);\r\n    var stack = null;\r\n\r\n    switch (keyCode) {\r\n        case 13: /* return */\r\n            x3dom.toggleFullScreen();\r\n            break;\r\n        case 33: /* page up */\r\n            stack = this._scene.getViewpoint()._stack;\r\n\r\n            if (stack) {\r\n                stack.switchTo('prev');\r\n            }\r\n            else {\r\n                x3dom.debug.logError ('No valid ViewBindable stack.');\r\n            }\r\n            break;\r\n        case 34: /* page down */\r\n            stack = this._scene.getViewpoint()._stack;\r\n\r\n            if (stack) {\r\n                stack.switchTo('next');\r\n            }\r\n            else {\r\n                x3dom.debug.logError ('No valid ViewBindable stack.');\r\n            }\r\n            break;\r\n        case 35: /* end */\r\n            stack = this._scene.getViewpoint()._stack;\r\n\r\n            if (stack) {\r\n                stack.switchTo('last');\r\n            }\r\n            else {\r\n                x3dom.debug.logError ('No valid ViewBindable stack.');\r\n            }\r\n            break;\r\n        case 36: /* home */\r\n            stack = this._scene.getViewpoint()._stack;\r\n\r\n            if (stack) {\r\n                stack.switchTo('first');\r\n            }\r\n            else {\r\n                x3dom.debug.logError ('No valid ViewBindable stack.');\r\n            }\r\n            break;\r\n        case 37: /* left */\r\n            break;\r\n        case 38: /* up */\r\n            break;\r\n        case 39: /* right */\r\n            break;\r\n        case 40: /* down */\r\n            break;\r\n        default:\r\n    }\r\n};\r\n\r\nx3dom.X3DDocument.prototype.onKeyPress = function(charCode)\r\n{\r\n    //x3dom.debug.logInfo(\"pressed key \" + charCode);\r\n    var nav = this._scene.getNavigationInfo();\r\n    var env = this._scene.getEnvironment();\r\n\r\n    switch (charCode)\r\n    {\r\n        case  32: /* space */\r\n            var states = this.canvas.parent.stateViewer;\r\n\t\t\tif (states) {\r\n\t\t\t\tstates.display();\r\n\t\t\t}\r\n            x3dom.debug.logInfo(\"a: show all | d: show helper buffers | s: small feature culling | t: light view | \" +\r\n                                \"m: toggle render mode | c: frustum culling | p: intersect type | r: reset view | \\n\" +\r\n                                \"e: examine mode | f: fly mode | y: freefly mode | w: walk mode | h: helicopter mode | \" +\r\n                                \"l: lookAt mode | o: lookaround | g: game mode | n: turntable | u: upright position | \\n\" +\r\n                                \"v: print viewpoint info | pageUp: next view | pageDown: prev. view | \" +\r\n                                \"+: increase speed | -: decrease speed \");\r\n            break;\r\n        case  43: /* + (incr. speed) */\r\n            nav._vf.speed = 2 * nav._vf.speed;\r\n            x3dom.debug.logInfo(\"Changed navigation speed to \" + nav._vf.speed);\r\n            break;\r\n        case  45: /* - (decr. speed) */\r\n            nav._vf.speed = 0.5 * nav._vf.speed;\r\n            x3dom.debug.logInfo(\"Changed navigation speed to \" + nav._vf.speed);\r\n            break;\r\n        case  51: /* 3 (decr pg error tol) */\r\n            x3dom.nodeTypes.PopGeometry.ErrorToleranceFactor += 0.5;\r\n            x3dom.debug.logInfo(\"Changed POP error tolerance to \" + x3dom.nodeTypes.PopGeometry.ErrorToleranceFactor);\r\n            break;\r\n        case  52: /* 4 (incr pg error tol) */\r\n            x3dom.nodeTypes.PopGeometry.ErrorToleranceFactor -= 0.5;\r\n            x3dom.debug.logInfo(\"Changed POP error tolerance to \" + x3dom.nodeTypes.PopGeometry.ErrorToleranceFactor);\r\n            break;\r\n        case  54: /* 6 (incr height) */\r\n            nav._vf.typeParams[1] += 1.0;\r\n            nav._heliUpdated = false;\r\n            x3dom.debug.logInfo(\"Changed helicopter height to \" + nav._vf.typeParams[1]);\r\n            break;\r\n        case  55: /* 7 (decr height) */\r\n            nav._vf.typeParams[1] -= 1.0;\r\n            nav._heliUpdated = false;\r\n            x3dom.debug.logInfo(\"Changed helicopter height to \" + nav._vf.typeParams[1]);\r\n            break;\r\n        case  56: /* 8 (decr angle) */\r\n            nav._vf.typeParams[0] -= 0.02;\r\n            nav._heliUpdated = false;\r\n            x3dom.debug.logInfo(\"Changed helicopter angle to \" + nav._vf.typeParams[0]);\r\n            break;\r\n        case  57: /* 9 (incr angle) */\r\n            nav._vf.typeParams[0] += 0.02;\r\n            nav._heliUpdated = false;\r\n            x3dom.debug.logInfo(\"Changed helicopter angle to \" + nav._vf.typeParams[0]);\r\n            break;\r\n        case  97: /* a, view all */\r\n            this._viewarea.showAll();\r\n            break;\r\n        case  99: /* c, toggle frustum culling */\r\n            env._vf.frustumCulling = !env._vf.frustumCulling;\r\n            x3dom.debug.logInfo(\"Viewfrustum culling \" + (env._vf.frustumCulling ? \"on\" : \"off\"));\r\n            break;\r\n        case  100: /* d, switch on/off buffer view for dbg */\r\n            if (this._viewarea._visDbgBuf === undefined) {\r\n                this._viewarea._visDbgBuf = (this._x3dElem.getAttribute(\"showLog\") === 'true');\r\n            }\r\n            this._viewarea._visDbgBuf = !this._viewarea._visDbgBuf;\r\n            x3dom.debug.logContainer.style.display = (this._viewarea._visDbgBuf == true) ? \"block\" : \"none\";\r\n            break;\r\n        case 101: /* e, examine mode */\r\n            nav.setType(\"examine\", this._viewarea);\r\n            break;\r\n        case 102: /* f, fly mode */\r\n            nav.setType(\"fly\", this._viewarea);\r\n            break;\r\n        case 103: /* g, game mode */\r\n            nav.setType(\"game\", this._viewarea);\r\n            break;\r\n        case 104: /* h, helicopter mode */\r\n            nav.setType(\"helicopter\", this._viewarea);\r\n            break;\r\n        case 105: /* i, fit all */\r\n            this._viewarea.fit(this._scene._lastMin, this._scene._lastMax);\r\n            break;\r\n        case 108: /* l, lookAt mode */\r\n            nav.setType(\"lookat\", this._viewarea);\r\n            break;\r\n        case 109: /* m, toggle \"points\" attribute */\r\n            //\"0\" = triangles\r\n            //\"1\" = points\r\n            //\"2\" = lines\r\n\t    //TODO: here, as option \"2\", we originally rendered triangle meshes as lines\r\n            //\t    instead, we should create a separate line buffer and render it\r\n            this._viewarea._points = ++this._viewarea._points % 2;\r\n            break;\r\n        case 110: /* n, turntable */\r\n            nav.setType(\"turntable\", this._viewarea);\r\n            break;\r\n        case 111: /* o, look around like in fly, but don't move */\r\n            nav.setType(\"lookaround\", this._viewarea);\r\n            break;\r\n        case 112: /* p, switch intersect type */\r\n            switch(this._scene._vf.pickMode.toLowerCase())\r\n            {\r\n                case \"idbuf\":\r\n                    this._scene._vf.pickMode = \"color\";\r\n                    break;\r\n                case \"color\":\r\n                    this._scene._vf.pickMode = \"texCoord\";\r\n                    break;\r\n                case \"texcoord\":\r\n                    this._scene._vf.pickMode = \"box\";\r\n                    break;\r\n                default:\r\n                    this._scene._vf.pickMode = \"idBuf\";\r\n                    break;\r\n            }\r\n            x3dom.debug.logInfo(\"Switch pickMode to '\" + this._scene._vf.pickMode + \"'.\");\r\n            break;\r\n        case 114: /* r, reset view */\r\n            this._viewarea.resetView();\r\n            break;\r\n        case 115: /* s, toggle small feature culling */\r\n            env._vf.smallFeatureCulling = !env._vf.smallFeatureCulling;\r\n            x3dom.debug.logInfo(\"Small feature culling \" + (env._vf.smallFeatureCulling ? \"on\" : \"off\"));\r\n            break;\r\n        case 116: /* t, light view */\r\n            if (this._nodeBag.lights.length > 0) {\r\n                this._viewarea.animateTo(this._viewarea.getLightMatrix()[0], this._scene.getViewpoint());\r\n            }\r\n            break;\r\n        case 117: /* u, upright position */\r\n            this._viewarea.uprightView();\r\n            break;\r\n        case 118: /* v, print viewpoint position/orientation */\r\n            var that = this;\r\n            (function() {\r\n                var viewpoint = that._viewarea._scene.getViewpoint();\r\n                var mat_view = that._viewarea.getViewMatrix().inverse();\r\n\r\n    \t\t\tvar rotation = new x3dom.fields.Quaternion(0, 0, 1, 0);\r\n    \t\t\trotation.setValue(mat_view);\r\n    \t\t\tvar rot = rotation.toAxisAngle();\r\n                var translation = mat_view.e3();\r\n                var center = viewpoint.getCenterOfRotation();\r\n\r\n    \t\t\tx3dom.debug.logInfo('\\n&lt;Viewpoint position=\"' + translation.x.toFixed(5) + ' '\r\n    \t\t\t                    + translation.y.toFixed(5) + ' ' + translation.z.toFixed(5) + '\" ' +\r\n    \t\t\t\t\t\t\t\t'orientation=\"' + rot[0].x.toFixed(5) + ' ' + rot[0].y.toFixed(5) + ' '\r\n    \t\t\t\t\t\t\t\t+ rot[0].z.toFixed(5) + ' ' + rot[1].toFixed(5) + '\" \\n\\t' +\r\n                                    'zNear=\"' + viewpoint.getNear().toFixed(5) + '\" ' +\r\n                                    'zFar=\"' + viewpoint.getFar().toFixed(5) + '\" ' +\r\n                                    'centerOfRotation=\"' + center.x.toFixed(5) + ' ' + center.y.toFixed(5) +  ' ' + center.z.toFixed(5) + '\" ' +\r\n                                    'fieldOfView=\"' + viewpoint.getFieldOfView().toFixed(5) + '\" ' +\r\n    \t\t\t\t\t\t\t\t'description=\"' + viewpoint._vf.description + '\"&gt;' +\r\n                                    '&lt;/Viewpoint&gt;');\r\n            })();\r\n            break;\r\n        case 119: /* w, walk mode */\r\n            nav.setType(\"walk\", this._viewarea);\r\n            break;\r\n        case 121: /* y, freefly mode */\r\n            nav.setType(\"freefly\", this._viewarea);\r\n            break;\r\n        default:\r\n    }\r\n};\r\n\r\nx3dom.X3DDocument.prototype.shutdown = function(ctx)\r\n{\r\n    if (!ctx) {\r\n        return;\r\n    }\r\n    ctx.shutdown(this._viewarea);\r\n};\r\n\r\nx3dom.X3DDocument.prototype.hasAnimationStateChanged = function () {\r\n    if (!this._viewarea) {\r\n        return false;\r\n    }\r\n\r\n    return this._viewarea.hasAnimationStateChanged();\r\n};\r\n\r\nx3dom.X3DDocument.prototype.isAnimating = function () {\r\n    if (!this._viewarea) {\r\n        return false;\r\n    }\r\n\r\n    return this._viewarea.isAnimating();\r\n};\r\n\r\nx3dom.X3DDocument.prototype.incrementDownloads = function()\r\n{\r\n    this.downloadCount++;\r\n}\r\n\r\nx3dom.X3DDocument.prototype.decrementDownloads = function()\r\n{\r\n    this.downloadCount--;\r\n}\r\n\n/**\r\n * X3DOM JavaScript Library\r\n * http://www.x3dom.org\r\n *\r\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\r\n * Dual licensed under the MIT and GPL\r\n *\r\n * Based on code originally provided by\r\n * Philip Taylor: http://philip.html5.org\r\n */\r\n\r\n/**\r\n * MatrixMixer Constructor\r\n *\r\n * @param beginTime\r\n * @param endTime\r\n * @constructor\r\n */\r\nx3dom.MatrixMixer = function(beginTime, endTime) {\r\n    this.beginTime = beginTime || 0;\r\n    this.endTime = endTime || 1;\r\n    this.isMixing = false;\r\n\r\n    this._beginMat = x3dom.fields.SFMatrix4f.identity();\r\n    this._beginInvMat = x3dom.fields.SFMatrix4f.identity();\r\n    this._beginLogMat = x3dom.fields.SFMatrix4f.identity();\r\n    this._endMat = x3dom.fields.SFMatrix4f.identity();\r\n    this._endLogMat = x3dom.fields.SFMatrix4f.identity();\r\n\r\n    this._beginRot = new x3dom.fields.Quaternion();\r\n    this._endRot = new x3dom.fields.Quaternion();\r\n\r\n    this._beginPos = new x3dom.fields.SFVec3f();\r\n    this._endPos = new x3dom.fields.SFVec3f();\r\n    this._result = x3dom.fields.SFMatrix4f.identity();\r\n\r\n    this._useQuaternion = false;\r\n};\r\n\r\n/**\r\n * MatrixMixer Calculate Fraction\r\n *\r\n * @param time\r\n * @returns {number}\r\n * @private\r\n */\r\nx3dom.MatrixMixer.prototype._calcFraction = function(time) {\r\n    var fraction = (time - this.beginTime) / (this.endTime - this.beginTime);\r\n\r\n    return (Math.sin((fraction * Math.PI) - (Math.PI / 2)) + 1) / 2.0;\r\n};\r\n\r\n/**\r\n * MatrixMixer Is Valid?\r\n *\r\n * @returns {boolean}\r\n * @private\r\n */\r\nx3dom.MatrixMixer.prototype._isValid = function() {\r\n    var angles = this._beginMat.inverse().mult(this._endMat).getEulerAngles();\r\n\r\n    return (Math.abs(angles[0]) != Math.PI &&\r\n        Math.abs(angles[1]) != Math.PI &&\r\n        Math.abs(angles[2]) != Math.PI);\r\n};\r\n\r\n/**\r\n * MatrixMixer Prepare Quaternion Animation\r\n *\r\n * @private\r\n */\r\nx3dom.MatrixMixer.prototype._prepareQuaternionAnimation = function() {\r\n    this._beginRot.setValue(this._beginMat);\r\n    this._endRot.setValue(this._endMat);\r\n\r\n    this._beginPos = this._beginMat.e3();\r\n    this._endPos = this._endMat.e3();\r\n\r\n    this._useQuaternion = true;\r\n};\r\n\r\n/**\r\n * MatrixMixer Reset\r\n *\r\n * @private\r\n */\r\nx3dom.MatrixMixer.prototype.reset = function() {\r\n    this.beginTime = 0;\r\n    this.endTime = 0;\r\n    this._useQuaternion = false;\r\n    this.isMixing = false;\r\n};\r\n\r\n/**\r\n * MatrixMixer Is Active?\r\n *\r\n * @returns {boolean}\r\n */\r\nx3dom.MatrixMixer.prototype.isActive = function() {\r\n    return (this.beginTime > 0);\r\n};\r\n\r\n/**\r\n * MatrixMixer Set Begin Matrix\r\n *\r\n * @param mat\r\n */\r\nx3dom.MatrixMixer.prototype.setBeginMatrix = function(mat) {\r\n    this._beginMat.setValues(mat);\r\n    this._beginInvMat = mat.inverse();\r\n    this._beginLogMat = x3dom.fields.SFMatrix4f.zeroMatrix();\r\n};\r\n\r\n/**\r\n * MatrixMixer get End Matrix\r\n *\r\n * @return mat\r\n */\r\nx3dom.MatrixMixer.prototype.getBeginMatrix = function(mat) {\r\n    return this._beginMat;\r\n};\r\n\r\n/**\r\n * MatrixMixer Set End Matrix\r\n *\r\n * @param mat\r\n */\r\nx3dom.MatrixMixer.prototype.setEndMatrix = function(mat) {\r\n    this._endMat.setValues(mat);\r\n\r\n    if (!this._isValid()) {\r\n        this._prepareQuaternionAnimation();\r\n    }\r\n\r\n    this._endLogMat = this._endMat.mult(this._beginInvMat).log();\r\n    this._logDiffMat = this._endLogMat.addScaled(this._beginLogMat, -1);\r\n};\r\n\r\n/**\r\n * MatrixMixer get End Matrix\r\n *\r\n * @return mat\r\n */\r\nx3dom.MatrixMixer.prototype.getEndMatrix = function(mat) {\r\n    return this._endMat;\r\n};\r\n\r\n/**\r\n * MatrixMixer Mix Quaternion\r\n *\r\n * @param fraction\r\n * @returns {*}\r\n * @private\r\n */\r\nx3dom.MatrixMixer.prototype._mixQuaternion = function(fraction) {\r\n    var rotation = this._beginRot.slerp(this._endRot, fraction);\r\n    var translation = this._beginPos.addScaled(this._endPos.subtract(this._beginPos), fraction);\r\n\r\n    this._result.setRotate(rotation);\r\n    this._result.setTranslate(translation);\r\n\r\n    return this._result.copy();\r\n};\r\n\r\n/**\r\n * MatrixMixer Mix Matrix\r\n *\r\n * @param fraction\r\n * @returns {x3dom.fields.SFMatrix4f|*|void}\r\n * @private\r\n */\r\nx3dom.MatrixMixer.prototype._mixMatrix = function(fraction) {\r\n    return this._logDiffMat.multiply(fraction).add(this._beginLogMat).exp().mult(this._beginMat);\r\n};\r\n\r\n/**\r\n * MatrixMixer Mix\r\n *\r\n * @param time\r\n * @returns {*}\r\n */\r\nx3dom.MatrixMixer.prototype.mix = function(time) {\r\n    if (time <= this.beginTime) {\r\n        return this._beginMat;\r\n    } else if (time >= this.endTime) {\r\n        this.reset();\r\n        return this._endMat;\r\n    } else {\r\n        this.isMixing = true;\r\n\r\n        var fraction = this._calcFraction(time);\r\n\r\n        if (this._useQuaternion) {\r\n            return this._mixQuaternion(fraction);\r\n        } else {\r\n            return this._mixMatrix(fraction);\r\n        }\r\n    }\r\n};\r\n\n/**\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * Philip Taylor: http://philip.html5.org\n */\n\n\n/**\n * Input types - X3DOM allows either navigation or interaction.\n * During each frame, only interaction of the current type is being processed, it is not possible to\n * perform interaction (for instance, selecting or dragging objects) and navigation at the same time\n */\nx3dom.InputTypes = {\n    NAVIGATION: 1,\n    INTERACTION: 2\n};\n\n/**\n * Viewarea Constructor.\n *\n * @class represents a view area\n * @param {x3dom.X3DDocument} document - the target X3DDocument\n * @param {Object} scene - the scene\n */\nx3dom.Viewarea = function(document, scene) {\n    this._doc = document; // x3ddocument\n    this._scene = scene; // FIXME: updates ?!\n\n    document._nodeBag.viewarea.push(this);\n\n    /**\n     * picking informations containing\n     * pickingpos, pickNorm, pickObj, firstObj, lastObj, lastClickObj, shadowObjId\n     * @var {Object} _pickingInfo\n     * @memberof x3dom.Viewarea\n     * @instance\n     * @protected\n     */\n    this._pickingInfo = {\n        pickPos: new x3dom.fields.SFVec3f(0, 0, 0),\n        pickNorm: new x3dom.fields.SFVec3f(0, 0, 1),\n        pickObj: null,\n        firstObj: null,\n        lastObj: null,\n        lastClickObj: null,\n        shadowObjectId: -1\n    };\n\n    this._currentInputType = x3dom.InputTypes.NAVIGATION;\n\n    /**\n     * rotation matrix\n     * @var {x3dom.fields.SFMatrix4f} _rotMat\n     * @memberof x3dom.Viewarea\n     * @instance\n     * @protected\n     */\n    this._rotMat = x3dom.fields.SFMatrix4f.identity();\n\n    /**\n     * translation matrix\n     * @var {x3dom.fields.SFMatrix4f} _transMat\n     * @memberof x3dom.Viewarea\n     * @instance\n     * @protected\n     */\n    this._transMat = x3dom.fields.SFMatrix4f.identity();\n\n    /**\n     * movement vector\n     * @var {x3dom.fields.SFVec3f} _movement\n     * @memberof x3dom.Viewarea\n     * @instance\n     * @protected\n     */\n    this._movement = new x3dom.fields.SFVec3f(0, 0, 0);\n\n    /**\n     * flag to signal a needed NavigationMatrixUpdate\n     * @var {Boolean} _needNavigationMatrixUpdate\n     * @memberof x3dom.Viewarea\n     * @instance\n     * @protected\n     */\n    this._needNavigationMatrixUpdate = true;\n\n    /**\n     * time passed since last update\n     * @var {Number} _deltaT\n     * @memberof x3dom.Viewarea\n     * @instance\n     * @protected\n     */\n    this._deltaT = 0;\n\n    this._flyMat = null;\n\n    this._pitch = 0;\n    this._yaw = 0;\n\n    /**\n     * eye position of the view area\n     * @var {x3dom.fields.SFVec3f} _eyePos\n     * @memberof x3dom.Viewarea\n     * @instance\n     * @protected\n     */\n    this._eyePos = new x3dom.fields.SFVec3f(0, 0, 0);\n\n    /**\n     * width of the view area\n     * @var {Number} _width\n     * @memberof x3dom.Viewarea\n     * @instance\n     * @protected\n     */\n    this._width = 400;\n\n    /**\n     * height of the view area\n     * @var {Number} _height\n     * @memberof x3dom.Viewarea\n     * @instance\n     * @protected\n     */\n    this._height = 300;\n\n    this._dx = 0;\n    this._dy = 0;\n    this._lastX = -1;\n    this._lastY = -1;\n    this._pressX = -1;\n    this._pressY = -1;\n    this._lastButton = 0;\n\n    this._points = 0;   // old render mode flag (but think of better name!)\n    this._numRenderedNodes = 0;\n\n    this._pick = new x3dom.fields.SFVec3f(0, 0, 0);\n    this._pickNorm = new x3dom.fields.SFVec3f(0, 0, 1);\n\n    this._isAnimating = false;\n    this._isMoving = false;\n    this._lastTS = 0;\n    this._mixer = new x3dom.MatrixMixer();\n    this._interpolator = new x3dom.FieldInterpolator();\n    this._animationStateChanged = false;\n\n    this.vrFrameData = null;\n    this.gamepads = null;\n    this.vrLeftViewMatrix = new x3dom.fields.SFMatrix4f();\n    this.vrRightViewMatrix = new x3dom.fields.SFMatrix4f();\n\n    this.vrLeftProjMatrix = new x3dom.fields.SFMatrix4f();\n    this.vrRightProjMatrix = new x3dom.fields.SFMatrix4f();\n\n    this.vrControllerManager = new x3dom.VRControllerManager();\n    \n    this._inverseDevicePixelRatio = 1.0 / window.devicePixelRatio;\n\n    this.arc = null;\n};\n\nx3dom.Viewarea.prototype.setVRFrameData = function(vrFrameData)\n{\n    this.vrFrameData = vrFrameData;\n\n    if(this.vrFrameData)\n    {\n        this.vrLeftViewMatrix.setFromArray(this.vrFrameData.leftViewMatrix),\n        this.vrRightViewMatrix.setFromArray(this.vrFrameData.rightViewMatrix)\n    }\n};\n\nx3dom.Viewarea.prototype.updateGamepads = function(vrDisplay)\n{\n    this.vrControllerManager.update(this, vrDisplay);\n\n    // var allGamepads = navigator.getGamepads();\n    // var gamepads = [];\n\n    // for(var i = 0; i < allGamepads.length; i++ )\n    // {\n    //     if(allGamepads[i] && allGamepads[i].displayId != undefined && allGamepads[i].displayId == vrDisplay.displayId)\n    //     {\n    //         gamepads.push(allGamepads[i]);\n    //     }\n    // }\n\n    // if(gamepads.length)\n    // {\n    //     var axes = gamepads[0].axes;\n\n    //     var dx = axes[0];\n    //     var dy = axes[1];\n\n    //     var d = (this._scene._lastMax.subtract(this._scene._lastMin)).length();\n    //     d = ((d < x3dom.fields.Eps) ? 1 : d) * 5;\n\n    //     var viewDir = this.vrLeftViewMatrix.e2();\n    //     var rightDir = this.vrLeftViewMatrix.e0();\n\n    //     viewDir = new x3dom.fields.SFVec3f(-viewDir.x, -viewDir.y, viewDir.z).multiply(d*(dy)/this._height);\n    //     rightDir = new x3dom.fields.SFVec3f(-rightDir.x, -rightDir.y, rightDir.z).multiply((d*dx/this._width));\n\n    //     this._movement = this._movement.add(rightDir).add(viewDir);\n    //     this._transMat = x3dom.fields.SFMatrix4f.translation(this._movement);\n    // }\n};\n\n/**\n * Method gets called every frame with the current timestamp\n *\n * @param {Number} timeStamp - current time stamp\n * @returns {Boolean} view area animation state\n */\nx3dom.Viewarea.prototype.tick = function(timeStamp) {\n    var needMixAnim = false;\n    var env = this._scene.getEnvironment();\n\n    if (env._vf.enableARC && this.arc == null) {\n        this.arc = new x3dom.arc.AdaptiveRenderControl(this._scene);\n    }\n\n    if (this._mixer.isActive()) {\n        var mat = this._mixer.mix(timeStamp);\n        this._scene.getViewpoint().setView(mat);\n    }\n\n    if (this._interpolator.isActive()) {\n        var value = this._interpolator.interpolate(timeStamp);\n        this._scene.getViewpoint().setZoom(value);\n    }\n\n    var needNavAnim = this.navigateTo(timeStamp);\n\n    var lastIsAnimating = this._isAnimating;\n\n    this._lastTS = timeStamp;\n    this._isAnimating = (this._mixer.isMixing || this._interpolator.isInterpolating || needNavAnim);\n\n    if (this._isAnimating != lastIsAnimating) {\n        this._animationStateChanged = true;\n    } else {\n        this._animationStateChanged = false;\n    }\n\n    if (this.arc != null) {\n        this.arc.update(this.isMovingOrAnimating() ? 1 : 0, this._doc._x3dElem.runtime.getFPS());\n    }\n\n    return (this._isAnimating || lastIsAnimating);\n};\n\n/**\n * Returns moving state of view are\n *\n * @returns {Boolean} moving state of view area\n */\nx3dom.Viewarea.prototype.isMoving = function() {\n    return this._isMoving;\n};\n\n/**\n * Returns animation state of view area\n *\n * @returns {Boolean} animation state of view area\n */\nx3dom.Viewarea.prototype.isAnimating = function() {\n    return this._isAnimating;\n};\n\n/**\n * Returns if the animation state has changed since the last update\n *\n * @returns {Boolean} animation state of view area\n */\nx3dom.Viewarea.prototype.hasAnimationStateChanged = function() {\n    return this._animationStateChanged;\n};\n\n/**\n * is view area moving or animating\n *\n * @returns {Boolean} view area moving or animating state\n */\nx3dom.Viewarea.prototype.isMovingOrAnimating = function() {\n    return (this._isMoving || this._isAnimating);\n};\n\n/**\n * triggers view area to move to something by passing the timestamp\n * returning a flag if the view area needs a navigation animation\n *\n * @returns {Boolean} flag if the view area need a navigation state\n */\nx3dom.Viewarea.prototype.navigateTo = function(timeStamp) {\n    var navi = this._scene.getNavigationInfo();\n    return navi._impl.navigateTo(this, timeStamp);\n};\n\n/**\n * Move Forward\n *\n */\nx3dom.Viewarea.prototype.moveFwd = function() {\n    var navi = this._scene.getNavigationInfo();\n    navi._impl.moveForward(this);\n};\n\n/**\n * Move Backwards\n *\n */\nx3dom.Viewarea.prototype.moveBwd = function() {\n    var navi = this._scene.getNavigationInfo();\n    navi._impl.moveBackwards(this);\n};\n\n/**\n * Strafe Right\n *\n */\nx3dom.Viewarea.prototype.strafeRight = function() {\n    var navi = this._scene.getNavigationInfo();\n    navi._impl.strafeRight(this);\n};\n\n/**\n * Strafe Left\n *\n */\nx3dom.Viewarea.prototype.strafeLeft = function() {\n    var navi = this._scene.getNavigationInfo();\n    navi._impl.strafeLeft(this);\n};\n\n/**\n * Animate To\n *\n * @param target\n * @param prev\n * @param dur\n */\nx3dom.Viewarea.prototype.animateTo = function(target, prev, dur) {\n    var navi = this._scene.getNavigationInfo();\n    navi._impl.animateTo(this, target, prev, dur);\n};\n\n/**\n * Ortho Animate To\n *\n * @param target\n * @param prev\n * @param duration\n */\nx3dom.Viewarea.prototype.orthoAnimateTo = function(target, prev, duration) {\n    var navi = this._scene.getNavigationInfo();\n    navi._impl.orthoAnimateTo(this, target, prev, duration);\n};\n\n/**\n * Zoom\n *\n * @param zoomAmount\n */\nx3dom.Viewarea.prototype.zoom = function(zoomAmount) {\n    var navi = this._scene.getNavigationInfo();\n    navi._impl.zoom(this, zoomAmount);\n};\n\n/**\n * Get Lights\n *\n * @returns {Array}\n */\nx3dom.Viewarea.prototype.getLights = function() {\n    var enabledLights = [];\n    for (var i = 0; i < this._doc._nodeBag.lights.length; i++) {\n        if (this._doc._nodeBag.lights[i]._vf.on == true) {\n            enabledLights.push(this._doc._nodeBag.lights[i]);\n        }\n    }\n\n    return enabledLights;\n};\n\n/**\n * Get Lights Shadow\n *\n * @returns {boolean}\n */\nx3dom.Viewarea.prototype.getLightsShadow = function() {\n    var lights = this._doc._nodeBag.lights;\n    for (var l = 0; l < lights.length; l++) {\n        if (lights[l]._vf.shadowIntensity > 0.0) {\n            return true;\n        }\n    }\n    return false;\n};\n\n/**\n * Check if there is a PhysicalEnvironmentLight\n *\n * @returns {boolean}\n */\nx3dom.Viewarea.prototype.hasPhysicalEnvironmentLight = function () {\n    var light;\n    for (var i=0; i<this._doc._nodeBag.lights.length; i++)\n    {\n        var light = this._doc._nodeBag.lights[i];\n        if (x3dom.isa(light, x3dom.nodeTypes.PhysicalEnvironmentLight) &&\n           light._vf.on)\n        {\n            return true;\n        }\n    }\n    return false;\n};\n\n/**\n * Update Special Navigation\n *\n * @param viewpoint\n * @param mat_viewpoint\n */\nx3dom.Viewarea.prototype.updateSpecialNavigation = function(viewpoint, mat_viewpoint) {\n    var navi = this._scene.getNavigationInfo();\n    var navType = navi.getType();\n\n    // helicopter mode needs to manipulate view matrix specially\n    if (navType == \"helicopter\" && !navi._heliUpdated) {\n        var typeParams = navi.getTypeParams();\n        var theta = typeParams[0];\n        var currViewMat = viewpoint.getViewMatrix().mult(mat_viewpoint.inverse()).inverse();\n\n        this._from = currViewMat.e3();\n        this._at = this._from.subtract(currViewMat.e2());\n        this._up = new x3dom.fields.SFVec3f(0, 1, 0);\n\n        this._from.y = typeParams[1];\n        this._at.y = this._from.y;\n\n        var sv = currViewMat.e0();\n        var q = x3dom.fields.Quaternion.axisAngle(sv, theta);\n        var temp = q.toMatrix();\n\n        var fin = x3dom.fields.SFMatrix4f.translation(this._from);\n        fin = fin.mult(temp);\n\n        temp = x3dom.fields.SFMatrix4f.translation(this._from.negate());\n        fin = fin.mult(temp);\n\n        this._at = fin.multMatrixPnt(this._at);\n\n        this._flyMat = x3dom.fields.SFMatrix4f.lookAt(this._from, this._at, this._up);\n        this._scene.getViewpoint().setView(this._flyMat.inverse());\n\n        navi._heliUpdated = true;\n    }\n};\n\n/**\n * Get the view areas view point matrix\n *\n * @returns {x3dom.fields.SFMatrix4f} view areas view point matrix\n */\nx3dom.Viewarea.prototype.getViewpointMatrix = function() {\n    var viewpoint = this._scene.getViewpoint();\n    var mat_viewpoint = viewpoint.getCurrentTransform();\n\n    this.updateSpecialNavigation(viewpoint, mat_viewpoint);\n\n    return viewpoint.getViewMatrix().mult(mat_viewpoint.inverse());\n};\n\n/**\n * Get the view areas view matrix\n *\n * @returns {x3dom.fields.SFMatrix4f} view areas view matrix\n */\nx3dom.Viewarea.prototype.getViewMatrix = function ()\n{\n    if(this.vrFrameData)\n    {\n        return this.vrLeftViewMatrix;\n    }\n    else\n    {\n        return this.getViewpointMatrix().mult(this._transMat).mult(this._rotMat);\n    }\n};\n\nx3dom.Viewarea.prototype.getViewMatrices = function()\n{\n    if(this.vrFrameData) {\n        return [this.vrLeftViewMatrix,\n                this.vrRightViewMatrix];\n    } else {\n        var viewMatrix = this.getViewpointMatrix().mult(this._transMat).mult(this._rotMat);\n        return [viewMatrix, viewMatrix]\n    }\n};\n\n/**\n * Get Light Matrix\n *\n * @returns {*}\n */\nx3dom.Viewarea.prototype.getLightMatrix = function() {\n    var lights = this._doc._nodeBag.lights;\n    var i, n = lights.length;\n\n    if (n > 0) {\n        var vol = this._scene.getVolume();\n\n        if (vol.isValid()) {\n            var min = x3dom.fields.SFVec3f.MAX();\n            var max = x3dom.fields.SFVec3f.MIN();\n            vol.getBounds(min, max);\n\n            var l_arr = [];\n            var viewpoint = this._scene.getViewpoint();\n            var fov = viewpoint.getFieldOfView();\n\n            var dia = max.subtract(min);\n            var dist1 = (dia.y / 2.0) / Math.tan(fov / 2.0) + (dia.z / 2.0);\n            var dist2 = (dia.x / 2.0) / Math.tan(fov / 2.0) + (dia.z / 2.0);\n\n            dia = min.add(dia.multiply(0.5));\n\n            for (i = 0; i < n; i++) {\n                if (x3dom.isa(lights[i], x3dom.nodeTypes.PointLight)) {\n                    var wcLoc = lights[i].getCurrentTransform().multMatrixPnt(lights[i]._vf.location);\n                    dia = dia.subtract(wcLoc).normalize();\n                } else {\n                    var dir = lights[i].getCurrentTransform().multMatrixVec(lights[i]._vf.direction);\n                    dir = dir.normalize().negate();\n                    dia = dia.add(dir.multiply(1.2 * (dist1 > dist2 ? dist1 : dist2)));\n                }\n\n                l_arr[i] = lights[i].getViewMatrix(dia);\n            }\n\n            return l_arr;\n        }\n    }\n\n    // TODO: this is only for testing\n    return [this.getViewMatrix()];\n};\n\n/**\n * Get WC to LC Matrix\n *\n * @param lMat\n * @returns {x3dom.fields.SFMatrix4f|*|void}\n */\nx3dom.Viewarea.prototype.getWCtoLCMatrix = function(lMat) {\n    var proj = this.getProjectionMatrix();\n    var view;\n\n    if (arguments.length === 0) {\n        view = this.getLightMatrix()[0];\n    } else {\n        view = lMat;\n    }\n\n    return proj.mult(view);\n};\n\n/**\n * Get six WCtoLCMatrices for point light\n *\n * @param {x3dom.fields.SFMatrix4f} view - the view matrix\n * @param {x3dom.nodeTypes.X3DNode} lightNode - the light node\n * @param {x3dom.fields.SFMatrix4f} mat_proj - the projection matrix\n * @returns {Array} six WCtoLCMatrices\n */\nx3dom.Viewarea.prototype.getWCtoLCMatricesPointLight = function(view, lightNode, mat_proj) {\n    var zNear = lightNode._vf.zNear;\n    var zFar = lightNode._vf.zFar;\n\n    var proj = this.getLightProjectionMatrix(view, zNear, zFar, false, mat_proj);\n\n    // set projection matrix to 90 degrees FOV (vertical and horizontal)\n    proj._00 = 1;\n    proj._11 = 1;\n\n    var matrices = [];\n\n    // create six matrices to cover all directions of point light\n    matrices[0] = proj.mult(view);\n\n    var rotationMatrix;\n\n    // y-rotation\n    for (var i = 1; i <= 3; i++) {\n        rotationMatrix = x3dom.fields.SFMatrix4f.rotationY(i * Math.PI / 2);\n        matrices[i] = proj.mult(rotationMatrix.mult(view));\n    }\n\n    //x-rotation\n    rotationMatrix = x3dom.fields.SFMatrix4f.rotationX(Math.PI / 2);\n    matrices[4] = proj.mult(rotationMatrix.mult(view));\n\n    rotationMatrix = x3dom.fields.SFMatrix4f.rotationX(3 * Math.PI / 2);\n    matrices[5] = proj.mult(rotationMatrix.mult(view));\n\n    return matrices;\n};\n\n/**\n * Get WCToLCMatrices for cascaded light\n *\n * @param view\n * @param lightNode\n * @param mat_proj\n * @returns {Array}\n */\nx3dom.Viewarea.prototype.getWCtoLCMatricesCascaded = function(view, lightNode, mat_proj) {\n    var numCascades = Math.max(1, Math.min(lightNode._vf.shadowCascades, 6));\n    var splitFactor = Math.max(0, Math.min(lightNode._vf.shadowSplitFactor, 1));\n    var splitOffset = Math.max(0, Math.min(lightNode._vf.shadowSplitOffset, 1));\n\n    var isSpotLight = x3dom.isa(lightNode, x3dom.nodeTypes.SpotLight);\n    var zNear = lightNode._vf.zNear;\n    var zFar = lightNode._vf.zFar;\n\n    var proj = this.getLightProjectionMatrix(view, zNear, zFar, true, mat_proj);\n\n    if (isSpotLight) {\n        //set FOV to 90 degrees\n        proj._00 = 1;\n        proj._11 = 1;\n    }\n\n    // get view projection matrix\n    var viewProj = proj.mult(view);\n\n    var matrices = [];\n\n    if (numCascades == 1) {\n        //return if only one cascade\n        matrices[0] = viewProj;\n        return matrices;\n    }\n\n    // compute split positions of view frustum\n    var cascadeSplits = this.getShadowSplitDepths(numCascades, splitFactor, splitOffset, true, mat_proj);\n\n    // calculate fitting matrices and multiply with view projection\n    for (var i = 0; i < numCascades; i++) {\n        var fittingMat = this.getLightFittingMatrix(viewProj, cascadeSplits[i], cascadeSplits[i + 1], mat_proj);\n        matrices[i] = fittingMat.mult(viewProj);\n    }\n\n    return matrices;\n};\n\n/**\n * Get Light Projection Matrix\n *\n * @param lMat\n * @param zNear\n * @param zFar\n * @param highPrecision\n * @param mat_proj\n * @returns {*}\n */\nx3dom.Viewarea.prototype.getLightProjectionMatrix = function(lMat, zNear, zFar, highPrecision, mat_proj) {\n    var proj = x3dom.fields.SFMatrix4f.copy(mat_proj);\n\n    if (!highPrecision || zNear > 0 || zFar > 0) {\n        //replace near and far plane of projection matrix\n        //by values adapted to the light position\n\n        var lightPos = lMat.inverse().e3();\n\n        var nearScale = 0.8;\n        var farScale = 1.2;\n\n        var min = x3dom.fields.SFVec3f.copy(this._scene._lastMin);\n        var max = x3dom.fields.SFVec3f.copy(this._scene._lastMax);\n\n        var dia = max.subtract(min);\n        var sRad = dia.length() / 2;\n\n        var sCenter = min.add(dia.multiply(0.5));\n        var vDist = (lightPos.subtract(sCenter)).length();\n\n        var near, far;\n\n        if (sRad) {\n            if (vDist > sRad)\n                near = (vDist - sRad) * nearScale;\n            else\n                near = 1;\n            far = (vDist + sRad) * farScale;\n        }\n        if (zNear > 0) near = zNear;\n        if (zFar > 0) far = zFar;\n\n        proj._22 = -(far + near) / (far - near);\n        proj._23 = -2.0 * far * near / (far - near);\n\n        return proj;\n    } else {\n        //should be more accurate, but also more expensive\n        var cropMatrix = this.getLightCropMatrix(proj.mult(lMat));\n\n        return cropMatrix.mult(proj);\n    }\n};\n\n/**\n * Get Projection Matrix\n *\n * @returns {*}\n */\nx3dom.Viewarea.prototype.getProjectionMatrix = function () {\n    if(this.vrFrameData) {\n        return this.vrLeftProjMatrix.setFromArray(this.vrFrameData.leftProjectionMatrix);\n    } else {\n        var viewpoint = this._scene.getViewpoint();\n\n        return viewpoint.getProjectionMatrix(this._width/this._height);\n    }\n};\n/**\n * Get Projection Matrices for both eyes\n *\n * @returns {*}\n */\nx3dom.Viewarea.prototype.getProjectionMatrices = function()\n{\n    if(this.vrFrameData)\n    {\n        return [this.vrLeftProjMatrix.setFromArray(this.vrFrameData.leftProjectionMatrix),\n            this.vrRightProjMatrix.setFromArray(this.vrFrameData.rightProjectionMatrix)];\n    }\n    else\n    {\n        var viewpoint = this._scene.getViewpoint();\n        var projectionMatrix = viewpoint.getProjectionMatrix(this._width/this._height);\n\n        return [projectionMatrix, projectionMatrix]\n    }\n};\n\n/**\n * Get the view frustum for a given clipping matrix\n *\n * @param {x3dom.fields.SFMatrix4f} clipMat - the clipping matrix\n * @returns {x3dom.fields.FrustumVolume} the resulting view frustum\n */\nx3dom.Viewarea.prototype.getViewfrustum = function(clipMat) {\n    var env = this._scene.getEnvironment();\n\n    if (env._vf.frustumCulling == true) {\n        if (arguments.length == 0) {\n            var proj = this.getProjectionMatrix();\n            var view = this.getViewMatrix();\n\n            return new x3dom.fields.FrustumVolume(proj.mult(view));\n\n        } else {\n\n            return new x3dom.fields.FrustumVolume(clipMat);\n        }\n    }\n\n    return null;\n};\n\n/**\n * Get the world coordinates to clipping coordinates matrix by multiplying the projection and view matrices\n *\n * @returns {x3dom.fields.SFMatrix4f} world coordinates to clipping coordinates matrix\n */\nx3dom.Viewarea.prototype.getWCtoCCMatrix = function() {\n    var view = this.getViewMatrix();\n    var proj = this.getProjectionMatrix();\n\n    return proj.mult(view);\n};\n\n/**\n * Get the clipping coordinates to world coordinates matrix by multiplying the projection and view matrices\n *\n * @returns {x3dom.fields.SFMatrix4f} clipping coordinates to world coordinates  matrix\n */\nx3dom.Viewarea.prototype.getCCtoWCMatrix = function() {\n    var mat = this.getWCtoCCMatrix();\n\n    return mat.inverse();\n};\n\n/**\n * Calculate View Ray\n *\n * @param x\n * @param y\n * @param mat\n * @returns {x3dom.fields.Ray}\n */\nx3dom.Viewarea.prototype.calcViewRay = function(x, y, mat) {\n    var cctowc = mat ? mat : this.getCCtoWCMatrix();\n\n    var rx = x / (this._width - 1.0) * 2.0 - 1.0;\n    var ry = (this._height - 1.0 - y) / (this._height - 1.0) * 2.0 - 1.0;\n\n    var from = cctowc.multFullMatrixPnt(new x3dom.fields.SFVec3f(rx, ry, -1));\n    var at = cctowc.multFullMatrixPnt(new x3dom.fields.SFVec3f(rx, ry, 1));\n    var dir = at.subtract(from);\n\n    return new x3dom.fields.Ray(from, dir);\n};\n\n/**\n * Show All\n *\n * @param axis\n * @param updateCenterOfRotation\n */\nx3dom.Viewarea.prototype.showAll = function(axis, updateCenterOfRotation) {\n    if (axis === undefined)\n        axis = \"negZ\";\n\n    if (updateCenterOfRotation === undefined) {\n        updateCenterOfRotation = false;\n    }\n\n    var scene = this._scene;\n    scene.updateVolume();\n\n    var min = x3dom.fields.SFVec3f.copy(scene._lastMin);\n    var max = x3dom.fields.SFVec3f.copy(scene._lastMax);\n\n    var x = \"x\", y = \"y\", z = \"z\";\n    var sign = 1;\n    var to, from = new x3dom.fields.SFVec3f(0, 0, -1);\n\n    switch (axis) {\n        case \"posX\":\n            sign = -1;\n        case \"negX\":\n            z = \"x\";\n            x = \"y\";\n            y = \"z\";\n            to = new x3dom.fields.SFVec3f(sign, 0, 0);\n            break;\n        case \"posY\":\n            sign = -1;\n        case \"negY\":\n            z = \"y\";\n            x = \"z\";\n            y = \"x\";\n            to = new x3dom.fields.SFVec3f(0, sign, 0);\n            break;\n        case \"posZ\":\n            sign = -1;\n        case \"negZ\":\n        default:\n            to = new x3dom.fields.SFVec3f(0, 0, -sign);\n            break;\n    }\n\n    var viewpoint = scene.getViewpoint();\n    var fov = viewpoint.getFieldOfView();\n\n    var isOrtho = x3dom.isa(viewpoint, x3dom.nodeTypes.OrthoViewpoint);\n\n    var dia = max.subtract(min);\n    var dia2 = dia.multiply(0.5);\n    var center = min.add(dia2);\n\n    if (updateCenterOfRotation) {\n        viewpoint.setCenterOfRotation(center);\n    }\n\n    var aspect =  Math.min(this._width/this._height, 1);\n\n    var diaz2 = dia[z] / 2.0, tanfov2 = Math.tan(fov / 2.0);\n\n    var dist1 = (dia[y] / 2.0) / tanfov2 + diaz2;\n    var dist2 = (dia[x] / 2.0) / tanfov2 + diaz2;\n\n    dia = min.add(dia.multiply(0.5));\n\n    if (isOrtho) {\n        dia[z] += sign * (dist1 > dist2 ? dist1 : dist2) * 3.01;\n    } else {\n        dia[z] += sign * (dist1 > dist2 ? dist1 : dist2) * 1.01;\n    }\n\n    dia[z] /= aspect;\n\n    var quat = x3dom.fields.Quaternion.rotateFromTo(from, to);\n    var viewmat = quat.toMatrix();\n\n    viewmat = viewmat.mult(x3dom.fields.SFMatrix4f.translation(dia.negate()));\n\n    if (isOrtho) {\n        this.orthoAnimateTo(dist1, Math.abs(viewpoint._fieldOfView[0]));\n\n        this.animateTo(viewmat, viewpoint);\n    } else {\n        this.animateTo(viewmat, viewpoint);\n    }\n};\n\n/**\n * Fit View\n *\n * @param min\n * @param max\n * @param updateCenterOfRotation\n */\nx3dom.Viewarea.prototype.fit = function(min, max, updateCenterOfRotation) {\n    if (updateCenterOfRotation === undefined) {\n        updateCenterOfRotation = true;\n    }\n\n    var dia2 = max.subtract(min).multiply(0.5);    // half diameter\n    var center = min.add(dia2);                    // center in wc\n    var bsr = dia2.length();                       // bounding sphere radius\n\n    var viewpoint = this._scene.getViewpoint();\n    var fov = viewpoint.getFieldOfView();\n\n    var viewmat = x3dom.fields.SFMatrix4f.copy(this.getViewMatrix());\n\n    var rightDir = new x3dom.fields.SFVec3f(viewmat._00, viewmat._01, viewmat._02);\n    var upDir = new x3dom.fields.SFVec3f(viewmat._10, viewmat._11, viewmat._12);\n    var viewDir = new x3dom.fields.SFVec3f(viewmat._20, viewmat._21, viewmat._22);\n\n    var aspect =  Math.min(this._width/this._height, 1);\n\n    var tanfov2 = Math.tan(fov / 2.0);\n    var dist = bsr / tanfov2 / aspect;\n\n    var eyePos = center.add(viewDir.multiply(dist));\n\n    viewmat._03 = -rightDir.dot(eyePos);\n    viewmat._13 = -upDir.dot(eyePos);\n    viewmat._23 = -viewDir.dot(eyePos);\n\n    if (updateCenterOfRotation) {\n        viewpoint.setCenterOfRotation(center);\n    }\n\n    if (x3dom.isa(viewpoint, x3dom.nodeTypes.OrthoViewpoint)) {\n        this.orthoAnimateTo(dist / 2.01, Math.abs(viewpoint._fieldOfView[0]));\n        this.animateTo(viewmat, viewpoint);\n    } else {\n        this.animateTo(viewmat, viewpoint);\n    }\n};\n\n/**\n * Reset View\n *\n */\nx3dom.Viewarea.prototype.resetView = function() {\n    var navi = this._scene.getNavigationInfo();\n    navi._impl.resetView(this);\n};\n\n/**\n * Reset Navigation Helpers\n *\n */\nx3dom.Viewarea.prototype.resetNavHelpers = function() {\n    this._rotMat = x3dom.fields.SFMatrix4f.identity();\n    this._transMat = x3dom.fields.SFMatrix4f.identity();\n    this._movement = new x3dom.fields.SFVec3f(0, 0, 0);\n    this._needNavigationMatrixUpdate = true;\n};\n\n/**\n * Upright View\n *\n */\nx3dom.Viewarea.prototype.uprightView = function() {\n    var mat = this.getViewMatrix().inverse();\n\n    var from = mat.e3();\n    var at = from.subtract(mat.e2());\n    var up = new x3dom.fields.SFVec3f(0, 1, 0);\n\n    var s = mat.e2().cross(up).normalize();\n    var v = s.cross(up).normalize();\n    at = from.add(v);\n\n    mat = x3dom.fields.SFMatrix4f.lookAt(from, at, up);\n    mat = mat.inverse();\n\n    this.animateTo(mat, this._scene.getViewpoint());\n};\n\n/**\n * Call Event Handler\n *\n * @param node\n * @param eventType\n * @param event\n * @returns {*}\n */\nx3dom.Viewarea.prototype.callEvtHandler = function(node, eventType, event) {\n    if (!node || !node._xmlNode)\n        return null;\n\n    try {\n        var attrib = node._xmlNode[eventType];\n\n        if (typeof(attrib) === \"function\") {\n            attrib.call(node._xmlNode, event);\n        } else {\n            var funcStr = node._xmlNode.getAttribute(eventType);\n            var func = new Function('event', funcStr);\n            func.call(node._xmlNode, event);\n        }\n\n        var list = node._listeners[event.type];\n        if (list) {\n            for (var it = 0; it < list.length; it++) {\n                list[it].call(node._xmlNode, event);\n            }\n        }\n    } catch (e) {\n        x3dom.debug.logException(e);\n    }\n\n    return event.cancelBubble;\n};\n\n/**\n * Check Events\n *\n * @param obj\n * @param x\n * @param y\n * @param buttonState\n * @param eventType\n * @returns {boolean}\n */\nx3dom.Viewarea.prototype.checkEvents = function(obj, x, y, buttonState, eventType) {\n    var that = this;\n    var needRecurse = true;\n    var childNode;\n    var i, n;\n    var target = (obj && obj._xmlNode) ? obj._xmlNode : {};\n\n    var affectedPointingSensorsList = this._doc._nodeBag.affectedPointingSensors;\n\n    var event = {\n        viewarea: that,\n        target: target,\n        type: eventType.substr(2, eventType.length - 2),\n        button: buttonState,\n        layerX: x * this._inverseDevicePixelRatio,\n        layerY: y * this._inverseDevicePixelRatio,\n        worldX: that._pick.x,\n        worldY: that._pick.y,\n        worldZ: that._pick.z,\n        normalX: that._pickNorm.x,\n        normalY: that._pickNorm.y,\n        normalZ: that._pickNorm.z,\n        hitPnt: that._pick.toGL(), // for convenience\n        hitObject: target,         // deprecated, remove!\n        shadowObjectId: that._pickingInfo.shadowObjectId,\n        cancelBubble: false,\n        stopPropagation: function() { this.cancelBubble = true; },\n        preventDefault: function() { this.cancelBubble = true; }\n    };\n\n    try {\n        var anObj = obj;\n\n        if (anObj && anObj._xmlNode && anObj._cf.geometry &&\n            !anObj._xmlNode[eventType] &&\n            !anObj._xmlNode.hasAttribute(eventType) &&\n            !anObj._listeners[event.type]) {\n            anObj = anObj._cf.geometry.node;\n        }\n\n        if (anObj && that.callEvtHandler(anObj, eventType, event) === true) {\n            needRecurse = false;\n        }\n    } catch (e) {\n        x3dom.debug.logException(e);\n    }\n\n    var recurse = function(obj) {\n        Array.forEach(obj._parentNodes, function(node) {\n            if (node._xmlNode && (node._xmlNode[eventType] ||\n                node._xmlNode.hasAttribute(eventType) ||\n                node._listeners[event.type])) {\n                if (that.callEvtHandler(node, eventType, event) === true) {\n                    needRecurse = false;\n                }\n            }\n\n            // find the lowest pointing device sensors in the hierarchy that might be affected\n            // (note that, for X3DTouchSensors, 'affected' does not necessarily mean 'activated')\n            if (buttonState == 0 && affectedPointingSensorsList.length == 0 &&\n                (eventType == 'onmousemove' || eventType == 'onmouseover' || eventType == 'onmouseout')) {\n                n = node._childNodes.length;\n\n                for (i = 0; i < n; ++i) {\n                    childNode = node._childNodes[i];\n\n                    if ( x3dom.isa(childNode, x3dom.nodeTypes.X3DPointingDeviceSensorNode) && \n                         childNode._vf.enabled &&\n                         affectedPointingSensorsList.indexOf(childNode) == -1 )\n                    {\n                        affectedPointingSensorsList.push(childNode);\n                    }\n                }\n            }\n\n            if (x3dom.isa(node, x3dom.nodeTypes.Anchor) && eventType === 'onclick') {\n                node.handleTouch();\n                needRecurse = false;\n            }\n            else if (needRecurse) {\n                recurse(node);\n            }\n        });\n    };\n\n    if (needRecurse && obj) {\n        recurse(obj);\n    }\n\n    return needRecurse;\n};\n\n\n/**\n * Notifies all pointing device sensors that are currently affected by mouse events, if any, about the given event\n *\n * @param {DOMEvent} event - a mouse event, enriched by X3DOM-specific members\n */\nx3dom.Viewarea.prototype._notifyAffectedPointingSensors = function(event) {\n    var funcDict = {\n        \"mousedown\": \"pointerPressedOverSibling\",\n        \"mousemove\": \"pointerMoved\",\n        \"mouseover\": \"pointerMovedOver\",\n        \"mouseout\": \"pointerMovedOut\"\n    };\n\n    var func = funcDict[event.type];\n    var affectedPointingSensorsList = this._doc._nodeBag.affectedPointingSensors;\n    var i, n = affectedPointingSensorsList.length;\n\n    if (n > 0 && func !== undefined) {\n        for (i = 0; i < n; i++)\n            affectedPointingSensorsList[i][func](event);\n    }\n};\n\n/**\n * Initialise Mouse State\n *\n */\nx3dom.Viewarea.prototype.initMouseState = function() {\n    this._deltaT = 0;\n    this._dx = 0;\n    this._dy = 0;\n    this._lastX = -1;\n    this._lastY = -1;\n    this._pressX = -1;\n    this._pressY = -1;\n    this._lastButton = 0;\n    this._isMoving = false;\n    this._needNavigationMatrixUpdate = true;\n};\n\n/**\n * On Mouse Press\n *\n * @param x\n * @param y\n * @param buttonState\n */\nx3dom.Viewarea.prototype.onMousePress = function(x, y, buttonState) {\n    this._needNavigationMatrixUpdate = true;\n\n    // simulate move first, in case mouse not moved after last click\n    this.prepareEvents(x, y, 0, \"onmouseover\");\n    // touchsensor isActive is invoked now since in affectedPointingSensorList\n    this.prepareEvents(x, y, buttonState, \"onmousedown\");\n    this._pickingInfo.lastClickObj = this._pickingInfo.pickObj;\n    this._pickingInfo.firstObj = this._pickingInfo.pickObj;\n\n    this._dx = 0;\n    this._dy = 0;\n    this._lastX = x;\n    this._lastY = y;\n    this._pressX = x;\n    this._pressY = y;\n    this._lastButton = buttonState;\n    this._isMoving = false;\n\n    if (this._currentInputType == x3dom.InputTypes.NAVIGATION) {\n        var navi = this._scene.getNavigationInfo();\n        navi._impl.onMousePress(this, x, y, buttonState);\n    }\n};\n\n/**\n * On Mouse Release\n *\n * @param x\n * @param y\n * @param buttonState\n * @param prevButton\n */\nx3dom.Viewarea.prototype.onMouseRelease = function(x, y, buttonState, prevButton) {\n    var i;\n    // if the mouse is released, reset the list of currently affected pointing sensors\n    var affectedPointingSensorsList = this._doc._nodeBag.affectedPointingSensors;\n    for (i = 0; i < affectedPointingSensorsList.length; ++i) {\n        affectedPointingSensorsList[i].pointerReleased();\n    }\n    this._doc._nodeBag.affectedPointingSensors = [];\n\n    var tDist = 3.0;  // distance modifier for lookat, could be param\n    var dir;\n    var navi = this._scene.getNavigationInfo();\n    var navType = navi.getType();\n\n    if (this._scene._vf.pickMode.toLowerCase() !== \"box\") {\n        this.prepareEvents(x, y, prevButton, \"onmouseup\");\n\n        // click means that mousedown _and_ mouseup were detected on same element\n        if (this._pickingInfo.pickObj &&\n            this._pickingInfo.pickObj === this._pickingInfo.lastClickObj) {\n            this.prepareEvents(x, y, prevButton, \"onclick\");\n\n        } else if (!this._pickingInfo.pickObj && !this._pickingInfo.lastClickObj &&\n            !this._pickingInfo.firstObj)   // press and release outside object\n        {\n            var eventType = \"backgroundClicked\";\n            try {\n                if (this._scene._xmlNode &&\n                    (this._scene._xmlNode[\"on\" + eventType] ||\n                        this._scene._xmlNode.hasAttribute(\"on\" + eventType) ||\n                        this._scene._listeners[eventType])) {\n                    var event = {\n                        target: this._scene._xmlNode, type: eventType,\n                        button: prevButton, \n                        layerX: x * this._inverseDevicePixelRatio,\n                        layerY: y * this._inverseDevicePixelRatio,\n                        cancelBubble: false,\n                        stopPropagation: function() { this.cancelBubble = true; },\n                        preventDefault: function() { this.cancelBubble = true; }\n                    };\n                    this._scene.callEvtHandler((\"on\" + eventType), event);\n                }\n            } catch (e) {\n                x3dom.debug.logException(\"backgroundClicked: \" + e);\n            }\n        }\n    } else {\n        var t0 = new Date().getTime();\n        var line = this.calcViewRay(x, y);\n        var isect = this._scene.doIntersect(line);\n        var obj = line.hitObject;\n\n        if (isect && obj) {\n            this._pick.setValues(line.hitPoint);\n\n            this.checkEvents(obj, x, y, buttonState, \"onclick\");\n\n            x3dom.debug.logInfo(\"Hit '\" + obj._xmlNode.localName + \"/ \" +\n                obj._DEF + \"' at dist=\" + line.dist.toFixed(4));\n            x3dom.debug.logInfo(\"Ray hit at position \" + this._pick);\n        }\n\n        var t1 = new Date().getTime() - t0;\n        x3dom.debug.logInfo(\"Picking time (box): \" + t1 + \"ms\");\n\n        if (!isect) {\n            dir = this.getViewMatrix().e2().negate();\n            var u = dir.dot(line.pos.negate()) / dir.dot(line.dir);\n            this._pick = line.pos.add(line.dir.multiply(u));\n            // x3dom.debug.logInfo(\"No hit at position \" + this._pick);\n        }\n    }\n    this._pickingInfo.firstObj = null;\n\n    if (this._currentInputType == x3dom.InputTypes.NAVIGATION &&\n        (this._pickingInfo.pickObj || this._pickingInfo.shadowObjectId >= 0) &&\n        navType === \"lookat\" && this._pressX === x && this._pressY === y) {\n        var step = (this._lastButton & 2) ? -1 : 1;\n        var dist = this._pickingInfo.pickPos.subtract(this._from).length() / tDist;\n\n        var laMat = new x3dom.fields.SFMatrix4f();\n        laMat.setValues(this.getViewMatrix());\n        laMat = laMat.inverse();\n\n        var from = laMat.e3();\n        var at = from.subtract(laMat.e2());\n        var up = laMat.e1();\n\n        dir = this._pickingInfo.pickPos.subtract(from);\n        var len = dir.length();\n        dir = dir.normalize();\n\n        // var newUp = new x3dom.fields.SFVec3f(0, 1, 0);\n        var newAt = from.addScaled(dir, len);\n\n        var s = dir.cross(up).normalize();\n        dir = s.cross(up).normalize();\n\n        if (step < 0) {\n            dist = (0.5 + len + dist) * 2;\n        }\n        var newFrom = newAt.addScaled(dir, dist);\n\n        laMat = x3dom.fields.SFMatrix4f.lookAt(newFrom, newAt, up);\n        laMat = laMat.inverse();\n\n        dist = newFrom.subtract(from).length();\n        var dur = Math.max(0.5, Math.log((1 + dist) / navi._vf.speed));\n\n        this.animateTo(laMat, this._scene.getViewpoint(), dur);\n    }\n\n    this._dx = 0;\n    this._dy = 0;\n    this._lastX = x;\n    this._lastY = y;\n    this._lastButton = buttonState;\n    this._isMoving = false;\n};\n\n/**\n * On Mouse Over\n *\n * @param x\n * @param y\n * @param buttonState\n */\nx3dom.Viewarea.prototype.onMouseOver = function(x, y, buttonState) {\n    this._dx = 0;\n    this._dy = 0;\n    this._lastButton = 0;\n    this._isMoving = false;\n    this._lastX = x;\n    this._lastY = y;\n    this._deltaT = 0;\n};\n\n/**\n * On Mouse Out\n *\n * @param x\n * @param y\n * @param buttonState\n */\nx3dom.Viewarea.prototype.onMouseOut = function(x, y, buttonState) {\n    this._dx = 0;\n    this._dy = 0;\n    this._lastButton = 0;\n    this._isMoving = false;\n    this._lastX = x;\n    this._lastY = y;\n    this._deltaT = 0;\n\n    // if the mouse is moved out of the canvas, reset the list of currently affected pointing sensors\n    // (this behaves similar to a mouse release inside the canvas)\n    var i;\n    var affectedPointingSensorsList = this._doc._nodeBag.affectedPointingSensors;\n    for (i = 0; i < affectedPointingSensorsList.length; ++i) {\n        affectedPointingSensorsList[i].pointerReleased();\n    }\n    this._doc._nodeBag.affectedPointingSensors = [];\n};\n\n/**\n * On Double Click\n *\n * @param x\n * @param y\n */\nx3dom.Viewarea.prototype.onDoubleClick = function(x, y) {\n    if (this._doc._x3dElem.hasAttribute('disableDoubleClick') &&\n        this._doc._x3dElem.getAttribute('disableDoubleClick') === 'true') {\n        return;\n    }\n\n    var navi = this._scene.getNavigationInfo();\n    navi._impl.onDoubleClick(this, x, y);\n};\n\n/**\n * Handle Mouse Event\n *\n * @param x\n * @param y\n * @param buttonState\n */\nx3dom.Viewarea.prototype.handleMoveEvt = function(x, y, buttonState) {\n    // pointing sensors might still be in use, if the mouse has previously been pressed over sensor geometry\n    // (in general, transitions between INTERACTION and NAVIGATION require that the mouse is not pressed)\n    if (buttonState == 0) {\n        this._doc._nodeBag.affectedPointingSensors = [];\n    }\n\n    this.prepareEvents(x, y, buttonState, \"onmousemove\");\n\n    if (this._pickingInfo.pickObj !== this._pickingInfo.lastObj) {\n        if (this._pickingInfo.lastObj) {\n            var obj = this._pickingInfo.pickObj;\n            this._pickingInfo.pickObj = this._pickingInfo.lastObj;\n\n            // call event for lastObj\n            this.prepareEvents(x, y, buttonState, \"onmouseout\");\n            this._pickingInfo.pickObj = obj;\n        }\n\n        if (this._pickingInfo.pickObj) {\n            // call event for pickObj\n            this.prepareEvents(x, y, buttonState, \"onmouseover\");\n        }\n\n        this._pickingInfo.lastObj = this._pickingInfo.pickObj;\n    }\n};\n\n/**\n * On Move\n *\n * @param x\n * @param y\n * @param buttonState\n */\nx3dom.Viewarea.prototype.onMove = function(x, y, buttonState) {\n    this.handleMoveEvt(x, y, buttonState);\n\n    if (this._lastX < 0 || this._lastY < 0) {\n        this._lastX = x;\n        this._lastY = y;\n    }\n    this._dx = x - this._lastX;\n    this._dy = y - this._lastY;\n    this._lastX = x;\n    this._lastY = y;\n};\n\n/**\n * On Mouse Move\n * multi-touch version of examine mode, called from X3DCanvas.js\n *\n * @param translation\n * @param rotation\n */\nx3dom.Viewarea.prototype.onMoveView = function(translation, rotation) {\n    if (this._currentInputType == x3dom.InputTypes.NAVIGATION) {\n        var navi = this._scene.getNavigationInfo();\n        var viewpoint = this._scene.getViewpoint();\n\n        if (navi.getType() === \"examine\") {\n            if (translation) {\n                var distance = (this._scene._lastMax.subtract(this._scene._lastMin)).length();\n                distance = ((distance < x3dom.fields.Eps) ? 1 : distance) * navi._vf.speed;\n\n                translation = translation.multiply(distance);\n                this._movement = this._movement.add(translation);\n\n                this._transMat = viewpoint.getViewMatrix().inverse().mult(x3dom.fields.SFMatrix4f.translation(this._movement)).mult(viewpoint.getViewMatrix());\n            }\n\n            if (rotation) {\n                var center = viewpoint.getCenterOfRotation();\n                var mat = this.getViewMatrix();\n                mat.setTranslate(new x3dom.fields.SFVec3f(0, 0, 0));\n\n                this._rotMat = this._rotMat.mult(x3dom.fields.SFMatrix4f.translation(center)).mult(mat.inverse()).mult(rotation).mult(mat).mult(x3dom.fields.SFMatrix4f.translation(center.negate()));\n            }\n\n            this._isMoving = true;\n        }\n    }\n};\n\n/**\n * On Drag\n *\n * @param x\n * @param y\n * @param buttonState\n */\nx3dom.Viewarea.prototype.onDrag = function(x, y, buttonState) {\n    // should onmouseover/-out be handled on drag?\n    this.handleMoveEvt(x, y, buttonState);\n\n    if (this._currentInputType == x3dom.InputTypes.NAVIGATION) {\n        this._scene.getNavigationInfo()._impl.onDrag(this, x, y, buttonState);\n    }\n};\n\n/**\n * Prepare Events\n *\n * @param x\n * @param y\n * @param buttonState\n * @param eventType\n */\nx3dom.Viewarea.prototype.prepareEvents = function(x, y, buttonState, eventType) {\n    var affectedPointingSensorsList = this._doc._nodeBag.affectedPointingSensors;\n    var pickMode = this._scene._vf.pickMode.toLowerCase();\n    var avoidTraversal = (pickMode.indexOf(\"idbuf\") == 0 ||\n        pickMode == \"color\" || pickMode == \"texcoord\");\n\n    var obj = null;\n\n    if (avoidTraversal) {\n        obj = this._pickingInfo.pickObj;\n\n        if (obj) {\n            this._pick.setValues(this._pickingInfo.pickPos);\n            this._pickNorm.setValues(this._pickingInfo.pickNorm);\n\n            this.checkEvents(obj, x, y, buttonState, eventType);\n\n            if (eventType === \"onclick\") {  // debug\n                if (obj._xmlNode)\n                    x3dom.debug.logInfo(\"Hit \\\"\" + obj._xmlNode.localName + \"/ \" + obj._DEF + \"\\\"\");\n                x3dom.debug.logInfo(\"Ray hit at position \" + this._pick);\n            }\n        }\n    }\n\n    // TODO: this is pretty redundant - but from where should we obtain this event object?\n    //      this also needs to work if there is no picked object, and independent from \"avoidTraversal\"?\n\n    // FIXME:  avoidTraversal is only to distinguish between the ancient box and the other render-based pick modes,\n    //         thus it seems the cleanest thing to just remove the old traversal-based and non-functional box mode.\n    //         Concerning background: what about if we unify the onbackgroundClicked event such that there is also\n    //         an onbackgroundMoved event etc?\n\n    var event = {\n        viewarea: this,\n        target: {},     // should be hit xml element\n        type: eventType.substr(2, eventType.length - 2),\n        button: buttonState,\n        layerX: x * this._inverseDevicePixelRatio,\n        layerY: y * this._inverseDevicePixelRatio,\n        worldX: this._pick.x,\n        worldY: this._pick.y,\n        worldZ: this._pick.z,\n        normalX: this._pickNorm.x,\n        normalY: this._pickNorm.y,\n        normalZ: this._pickNorm.z,\n        hitPnt: this._pick.toGL(), // for convenience\n        hitObject: (obj && obj._xmlNode) ? obj._xmlNode : null,\n        shadowObjectId: this._pickingInfo.shadowObjectId,\n        cancelBubble: false,\n        stopPropagation: function() { this.cancelBubble = true; },\n        preventDefault: function() { this.cancelBubble = true; }\n    };\n\n    // forward event to affected pointing device sensors\n    this._notifyAffectedPointingSensors(event);\n\n    // switch between navigation and interaction\n    if (affectedPointingSensorsList.length > 0) {\n        this._currentInputType = x3dom.InputTypes.INTERACTION;\n    } else {\n        this._currentInputType = x3dom.InputTypes.NAVIGATION;\n    }\n};\n\n/**\n * Get Render Mode\n *\n * @returns {number}\n */\nx3dom.Viewarea.prototype.getRenderMode = function() {\n    // this._points == 0 ? TRIANGLES or TRIANGLE_STRIP\n    // this._points == 1 ? gl.POINTS\n    // this._points == 2 ? gl.LINES\n    // TODO: 3 :== surface with additional wireframe render mode\n    return this._points;\n};\n\n/**\n * Get Shadowed Lights\n *\n * @returns {Array}\n */\nx3dom.Viewarea.prototype.getShadowedLights = function() {\n    var shadowedLights = [];\n    var shadowIndex = 0;\n    var slights = this.getLights();\n    for (var i = 0; i < slights.length; i++) {\n        if (slights[i]._vf.shadowIntensity > 0.0) {\n            shadowedLights[shadowIndex] = slights[i];\n            shadowIndex++;\n        }\n    }\n    return shadowedLights;\n};\n\n/**\n * Calculate view frustum split positions for the given number of cascades\n *\n * @param {Number} numCascades - the number of cascades\n * @param {Number} splitFactor - the splitting factor\n * @param {Number} splitOffset - the offset for the splits\n * @param {Array} postProject - the post projection something\n * @param {x3dom.fields.SFMatrix4f} mat_proj - the projection matrix\n * @returns {Array} the post projection something\n */\nx3dom.Viewarea.prototype.getShadowSplitDepths = function(numCascades, splitFactor, splitOffset, postProject, mat_proj) {\n    var logSplit;\n    var practSplit = [];\n\n    var viewPoint = this._scene.getViewpoint();\n\n    var zNear = viewPoint.getNear();\n    var zFar = viewPoint.getFar();\n\n    practSplit[0] = zNear;\n\n    // pseudo near plane for bigger cascades near camera\n    zNear = zNear + splitOffset * (zFar - zNear) / 10;\n\n    // calculate split depths according to \"practical split scheme\"\n    for (var i = 1; i < numCascades; i++) {\n        logSplit = zNear * Math.pow((zFar / zNear), i / numCascades);\n        practSplit[i] = splitFactor * logSplit + (1 - splitFactor) * (zNear + i / (numCascades * (zNear - zFar)));\n    }\n    practSplit[numCascades] = zFar;\n\n    // return in view coords\n    if (!postProject)\n        return practSplit;\n\n    // return in post projective coords\n    var postProj = [];\n\n    for (var j = 0; j <= numCascades; j++) {\n        postProj[j] = mat_proj.multFullMatrixPnt(new x3dom.fields.SFVec3f(0, 0, -practSplit[j])).z;\n    }\n\n    return postProj;\n};\n\n/**\n * Calculate a matrix to enhance the placement of\n * the near and far planes of the light projection matrix\n *\n * @param WCToLCMatrix\n * @returns {x3dom.fields.SFMatrix4f}\n */\nx3dom.Viewarea.prototype.getLightCropMatrix = function(WCToLCMatrix) {\n    // get corner points of scene bounds\n    var sceneMin = x3dom.fields.SFVec3f.copy(this._scene._lastMin);\n    var sceneMax = x3dom.fields.SFVec3f.copy(this._scene._lastMax);\n\n    var sceneCorners = [];\n    sceneCorners[0] = new x3dom.fields.SFVec3f(sceneMin.x, sceneMin.y, sceneMin.z);\n    sceneCorners[1] = new x3dom.fields.SFVec3f(sceneMin.x, sceneMin.y, sceneMax.z);\n    sceneCorners[2] = new x3dom.fields.SFVec3f(sceneMin.x, sceneMax.y, sceneMin.z);\n    sceneCorners[3] = new x3dom.fields.SFVec3f(sceneMin.x, sceneMax.y, sceneMax.z);\n    sceneCorners[4] = new x3dom.fields.SFVec3f(sceneMax.x, sceneMin.y, sceneMin.z);\n    sceneCorners[5] = new x3dom.fields.SFVec3f(sceneMax.x, sceneMin.y, sceneMax.z);\n    sceneCorners[6] = new x3dom.fields.SFVec3f(sceneMax.x, sceneMax.y, sceneMin.z);\n    sceneCorners[7] = new x3dom.fields.SFVec3f(sceneMax.x, sceneMax.y, sceneMax.z);\n\n    // transform scene bounds into light space\n    var i;\n    for (i = 0; i < 8; i++) {\n        sceneCorners[i] = WCToLCMatrix.multFullMatrixPnt(sceneCorners[i]);\n    }\n\n    // determine min and max values in light space\n    var minScene = x3dom.fields.SFVec3f.copy(sceneCorners[0]);\n    var maxScene = x3dom.fields.SFVec3f.copy(sceneCorners[0]);\n\n    for (i = 1; i < 8; i++) {\n        minScene.z = Math.min(sceneCorners[i].z, minScene.z);\n        maxScene.z = Math.max(sceneCorners[i].z, maxScene.z);\n    }\n\n    var scaleZ = 2.0 / (maxScene.z - minScene.z);\n    var offsetZ = -(scaleZ * (maxScene.z + minScene.z)) / 2.0;\n\n    // var scaleZ = 1.0 / (maxScene.z - minScene.z);\n    // var offsetZ = -minScene.z * scaleZ;\n\n    var cropMatrix = x3dom.fields.SFMatrix4f.identity();\n\n    cropMatrix._22 = scaleZ;\n    cropMatrix._23 = offsetZ;\n\n    return cropMatrix;\n};\n\n/**\n * Calculate a matrix to fit the given wctolc-matrix to the split boundaries\n *\n * @param WCToLCMatrix\n * @param zNear\n * @param zFar\n * @param mat_proj\n * @returns {x3dom.fields.SFMatrix4f}\n */\nx3dom.Viewarea.prototype.getLightFittingMatrix = function(WCToLCMatrix, zNear, zFar, mat_proj) {\n    var mat_view = this.getViewMatrix();\n    var mat_view_proj = mat_proj.mult(mat_view);\n    var mat_view_proj_inverse = mat_view_proj.inverse();\n\n    // define view frustum corner points in post perspective view space\n    var frustumCorners = [];\n    frustumCorners[0] = new x3dom.fields.SFVec3f(-1, -1, zFar);\n    frustumCorners[1] = new x3dom.fields.SFVec3f(-1, -1, zNear);\n    frustumCorners[2] = new x3dom.fields.SFVec3f(-1, 1, zFar);\n    frustumCorners[3] = new x3dom.fields.SFVec3f(-1, 1, zNear);\n    frustumCorners[4] = new x3dom.fields.SFVec3f(1, -1, zFar);\n    frustumCorners[5] = new x3dom.fields.SFVec3f(1, -1, zNear);\n    frustumCorners[6] = new x3dom.fields.SFVec3f(1, 1, zFar);\n    frustumCorners[7] = new x3dom.fields.SFVec3f(1, 1, zNear);\n\n    // transform corner points into post perspective light space\n    var i;\n    for (i = 0; i < 8; i++) {\n        frustumCorners[i] = mat_view_proj_inverse.multFullMatrixPnt(frustumCorners[i]);\n        frustumCorners[i] = WCToLCMatrix.multFullMatrixPnt(frustumCorners[i]);\n    }\n\n    // calculate minimum and maximum values\n    var minFrustum = x3dom.fields.SFVec3f.copy(frustumCorners[0]);\n    var maxFrustum = x3dom.fields.SFVec3f.copy(frustumCorners[0]);\n\n    for (i = 1; i < 8; i++) {\n        minFrustum.x = Math.min(frustumCorners[i].x, minFrustum.x);\n        minFrustum.y = Math.min(frustumCorners[i].y, minFrustum.y);\n        minFrustum.z = Math.min(frustumCorners[i].z, minFrustum.z);\n\n        maxFrustum.x = Math.max(frustumCorners[i].x, maxFrustum.x);\n        maxFrustum.y = Math.max(frustumCorners[i].y, maxFrustum.y);\n        maxFrustum.z = Math.max(frustumCorners[i].z, maxFrustum.z);\n    }\n\n    // clip values to box (-1,-1,-1),(1,1,1)\n    function clip(min, max) {\n        var xMin = min.x;\n        var yMin = min.y;\n        var zMin = min.z;\n        var xMax = max.x;\n        var yMax = max.y;\n        var zMax = max.z;\n\n        if (xMin > 1.0 || xMax < -1.0) {\n            xMin = -1.0;\n            xMax = 1.0;\n        } else {\n            xMin = Math.max(xMin, -1.0);\n            xMax = Math.min(xMax, 1.0);\n        }\n\n        if (yMin > 1.0 || yMax < -1.0) {\n            yMin = -1.0;\n            yMax = 1.0;\n        } else {\n            yMin = Math.max(yMin, -1.0);\n            yMax = Math.min(yMax, 1.0);\n        }\n\n        if (zMin > 1.0 || zMax < -1.0) {\n            zMin = -1.0;\n            zMax = 1.0;\n        } else {\n            zMin = Math.max(zMin, -1.0);\n            zMax = Math.min(zMax, 1.0);\n        }\n        var minValues = new x3dom.fields.SFVec3f(xMin, yMin, zMin);\n        var maxValues = new x3dom.fields.SFVec3f(xMax, yMax, zMax);\n\n        return new x3dom.fields.BoxVolume(minValues, maxValues);\n    }\n\n    var frustumBB = clip(minFrustum, maxFrustum);\n\n    // define fitting matrix\n    var scaleX = 2.0 / (frustumBB.max.x - frustumBB.min.x);\n    var scaleY = 2.0 / (frustumBB.max.y - frustumBB.min.y);\n    var offsetX = -(scaleX * (frustumBB.max.x + frustumBB.min.x)) / 2.0;\n    var offsetY = -(scaleY * (frustumBB.max.y + frustumBB.min.y)) / 2.0;\n\n    var fittingMatrix = x3dom.fields.SFMatrix4f.identity();\n\n    fittingMatrix._00 = scaleX;\n    fittingMatrix._11 = scaleY;\n    fittingMatrix._03 = offsetX;\n    fittingMatrix._13 = offsetY;\n\n    return fittingMatrix;\n};\n\n/**\r\n * X3DOM JavaScript Library\r\n * http://www.x3dom.org\r\n *\r\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\r\n * Dual licensed under the MIT and GPL\r\n *\r\n * Based on code originally provided by\r\n * Philip Taylor: http://philip.html5.org\r\n */\r\n\r\n\r\n/**\r\n * @class x3dom.Mesh\r\n */\r\nx3dom.Mesh = function(parent) {\r\n    this._parent = parent;\r\n\r\n    this._vol = new x3dom.fields.BoxVolume();\r\n\r\n    this._invalidate = true;\r\n    this._numFaces = 0;\r\n    this._numCoords = 0;\r\n\r\n    // cp. x3dom.Utils.primTypeDic for type list\r\n    this._primType = 'TRIANGLES';\r\n\r\n    this._positions = [];\r\n    this._normals = [];\r\n    this._texCoords = [];\r\n    this._texCoords2 = [];\r\n    this._colors    = [];\r\n    this._indices   = [];\r\n    this._tangents  = [];\r\n    this._binormals = [];\r\n\r\n    this._positions[0] = [];\r\n    this._normals[0] = [];\r\n    this._texCoords[0] = [];\r\n    this._texCoords2[0] = [];\r\n    this._colors[0]    = [];\r\n    this._indices[0]   = [];\r\n    this._tangents[0]  = [];\r\n    this._binormals[0] = [];\r\n};\r\n\r\nx3dom.Mesh.prototype._dynamicFields = {};   // can hold X3DVertexAttributeNodes\r\n/*\r\nx3dom.Mesh.prototype._positions = [];\r\nx3dom.Mesh.prototype._normals   = [];\r\nx3dom.Mesh.prototype._texCoords = [];\r\nx3dom.Mesh.prototype._colors    = [];\r\nx3dom.Mesh.prototype._indices   = [];\r\n*/\r\n\r\nx3dom.Mesh.prototype._numPosComponents = 3;\r\nx3dom.Mesh.prototype._numTexComponents = 2;\r\nx3dom.Mesh.prototype._numTex2Components = 2;\r\nx3dom.Mesh.prototype._numColComponents = 3;\r\nx3dom.Mesh.prototype._numNormComponents = 3;\r\nx3dom.Mesh.prototype._numTangentComponents = 3;\r\nx3dom.Mesh.prototype._numBinormalComponents = 3;\r\nx3dom.Mesh.prototype._lit = true;\r\n\r\nx3dom.Mesh.prototype._vol = null;\r\nx3dom.Mesh.prototype._invalidate = true;\r\nx3dom.Mesh.prototype._numFaces = 0;\r\nx3dom.Mesh.prototype._numCoords = 0;\r\n\r\n/**\r\n * Get Volume\r\n *\r\n * @returns {null}\r\n */\r\nx3dom.Mesh.prototype.getVolume = function() {\r\n    if (this._invalidate == true && !this._vol.isValid()) {\r\n        var coords = this._positions[0];\r\n        var n = coords.length;\r\n\r\n        if (n >= 3) {\r\n            var initVal = new x3dom.fields.SFVec3f(coords[0], coords[1], coords[2]);\r\n            this._vol.setBounds(initVal, initVal);\r\n\r\n            for (var i = 3; i < n; i += 3) {\r\n                if (this._vol.min.x > coords[i  ]) { this._vol.min.x = coords[i  ]; }\r\n                if (this._vol.min.y > coords[i+1]) { this._vol.min.y = coords[i+1]; }\r\n                if (this._vol.min.z > coords[i+2]) { this._vol.min.z = coords[i+2]; }\r\n\r\n                if (this._vol.max.x < coords[i  ]) { this._vol.max.x = coords[i  ]; }\r\n                if (this._vol.max.y < coords[i+1]) { this._vol.max.y = coords[i+1]; }\r\n                if (this._vol.max.z < coords[i+2]) { this._vol.max.z = coords[i+2]; }\r\n            }\r\n            this._invalidate = false;\r\n        }\r\n    }\r\n\r\n    return this._vol;\r\n};\r\n\r\n/**\r\n * Invalidate\r\n *\r\n */\r\nx3dom.Mesh.prototype.invalidate = function() {\r\n    this._invalidate = true;\r\n    this._vol.invalidate();\r\n};\r\n\r\n/**\r\n * Is Valid?\r\n *\r\n * @returns {*|boolean}\r\n */\r\nx3dom.Mesh.prototype.isValid = function() {\r\n    return this._vol.isValid();\r\n};\r\n\r\n/**\r\n * Get Center\r\n *\r\n * @returns {*}\r\n */\r\nx3dom.Mesh.prototype.getCenter = function() {\r\n    return this.getVolume().getCenter();\r\n};\r\n\r\n/**\r\n * Get Diameter\r\n *\r\n * @returns {*}\r\n */\r\nx3dom.Mesh.prototype.getDiameter = function() {\r\n    return this.getVolume().getDiameter();\r\n};\r\n\r\n/**\r\n * Do Intersect\r\n *\r\n * @param line\r\n * @returns {*}\r\n */\r\nx3dom.Mesh.prototype.doIntersect = function(line) {\r\n    var vol = this.getVolume();\r\n    var isect = line.intersect(vol.min, vol.max);\r\n\r\n    //TODO: iterate over all faces!\r\n    if (isect && line.enter < line.dist) {\r\n        //x3dom.debug.logInfo(\"Hit \\\"\" + this._parent._xmlNode.localName + \"/ \" +\r\n        //                    this._parent._DEF + \"\\\" at dist=\" + line.enter.toFixed(4));\r\n\r\n        line.dist = line.enter;\r\n        line.hitObject = this._parent;\r\n        line.hitPoint = line.pos.add(line.dir.multiply(line.enter));\r\n    }\r\n\r\n    return isect;\r\n};\r\n\r\n/**\r\n * Calculate Normals\r\n *\r\n * @param creaseAngle\r\n * @param ccw\r\n */\r\nx3dom.Mesh.prototype.calcNormals = function(creaseAngle, ccw) {\r\n    if (ccw === undefined)\r\n        ccw = true;\r\n\r\n    var multInd = this._multiIndIndices && this._multiIndIndices.length;\r\n    var idxs = multInd ? this._multiIndIndices : this._indices[0];\r\n    var coords = this._positions[0];\r\n\r\n    var vertNormals = [];\r\n    var vertFaceNormals = [];\r\n\r\n    var i, j, m = coords.length;\r\n    var a, b, n = null;\r\n\r\n    var num = (this._posSize !== undefined && this._posSize > m) ? this._posSize / 3 : m / 3;\r\n    num = 3 * ((num - Math.floor(num) > 0) ? Math.floor(num + 1) : num);\r\n\r\n    for (i = 0; i < num; ++i) {\r\n        vertFaceNormals[i] = [];\r\n    }\r\n\r\n    num = idxs.length;\r\n\r\n    for (i = 0; i < num; i += 3) {\r\n        var ind_i0, ind_i1, ind_i2;\r\n        var t;\r\n\r\n        if (!multInd) {\r\n            ind_i0 = idxs[i] * 3;\r\n            ind_i1 = idxs[i + 1] * 3;\r\n            ind_i2 = idxs[i + 2] * 3;\r\n\r\n            t = new x3dom.fields.SFVec3f(coords[ind_i1], coords[ind_i1 + 1], coords[ind_i1 + 2]);\r\n            a = new x3dom.fields.SFVec3f(coords[ind_i0], coords[ind_i0 + 1], coords[ind_i0 + 2]).subtract(t);\r\n            b = t.subtract(new x3dom.fields.SFVec3f(coords[ind_i2], coords[ind_i2 + 1], coords[ind_i2 + 2]));\r\n\r\n            // this is needed a few lines below\r\n            ind_i0 = i * 3;\r\n            ind_i1 = (i + 1) * 3;\r\n            ind_i2 = (i + 2) * 3;\r\n        } else {\r\n            ind_i0 = i * 3;\r\n            ind_i1 = (i + 1) * 3;\r\n            ind_i2 = (i + 2) * 3;\r\n\r\n            t = new x3dom.fields.SFVec3f(coords[ind_i1], coords[ind_i1 + 1], coords[ind_i1 + 2]);\r\n            a = new x3dom.fields.SFVec3f(coords[ind_i0], coords[ind_i0 + 1], coords[ind_i0 + 2]).subtract(t);\r\n            b = t.subtract(new x3dom.fields.SFVec3f(coords[ind_i2], coords[ind_i2 + 1], coords[ind_i2 + 2]));\r\n        }\r\n\r\n        n = a.cross(b).normalize();\r\n        if (!ccw) {\r\n            n = n.negate();\r\n        }\r\n\r\n        if (creaseAngle <= x3dom.fields.Eps) {\r\n            vertNormals[ind_i0] = vertNormals[ind_i1] = vertNormals[ind_i2] = n.x;\r\n            vertNormals[ind_i0 + 1] = vertNormals[ind_i1 + 1] = vertNormals[ind_i2 + 1] = n.y;\r\n            vertNormals[ind_i0 + 2] = vertNormals[ind_i1 + 2] = vertNormals[ind_i2 + 2] = n.z;\r\n        } else {\r\n            vertFaceNormals[idxs[i]].push(n);\r\n            vertFaceNormals[idxs[i + 1]].push(n);\r\n            vertFaceNormals[idxs[i + 2]].push(n);\r\n        }\r\n    }\r\n\r\n    // TODO: allow generic creaseAngle\r\n    if (creaseAngle > x3dom.fields.Eps) {\r\n        for (i = 0; i < m; i += 3) {\r\n            var iThird = i / 3;\r\n            var arr;\r\n\r\n            if (!multInd) {\r\n                arr = vertFaceNormals[iThird];\r\n            } else {\r\n                arr = vertFaceNormals[idxs[iThird]];\r\n            }\r\n            num = arr.length;\r\n\r\n            n = new x3dom.fields.SFVec3f(0, 0, 0);\r\n\r\n            for (j = 0; j < num; ++j) {\r\n                n = n.add(arr[j]);\r\n            }\r\n            n = n.normalize();\r\n\r\n            vertNormals[i] = n.x;\r\n            vertNormals[i + 1] = n.y;\r\n            vertNormals[i + 2] = n.z;\r\n        }\r\n    }\r\n\r\n    this._normals[0] = vertNormals;\r\n};\r\n\r\n/**\r\n * Split Mesh\r\n *\r\n * @param primStride Number of index entries per primitive, for example 3 for TRIANGLES\r\n */\r\nx3dom.Mesh.prototype.splitMesh = function(primStride, checkMultiIndIndices) {\r\n    var pStride;\r\n    var isMultiInd;\r\n\r\n    if (primStride === undefined) {\r\n        pStride = 3;\r\n    } else {\r\n        pStride = primStride;\r\n    }\r\n\r\n    if (checkMultiIndIndices === undefined) {\r\n        checkMultiIndIndices = false;\r\n    }\r\n\r\n    var MAX = x3dom.Utils.maxIndexableCoords;\r\n\r\n    //adapt MAX to match the primitive stride\r\n    MAX = Math.floor(MAX / pStride) * pStride;\r\n\r\n    if (this._positions[0].length / 3 <= MAX && !checkMultiIndIndices) {\r\n        return;\r\n    }\r\n\r\n    if (checkMultiIndIndices) {\r\n        isMultiInd = this._multiIndIndices && this._multiIndIndices.length;\r\n    } else {\r\n        isMultiInd = false;\r\n    }\r\n\r\n    var positions = this._positions[0];\r\n    var normals = this._normals[0];\r\n    var texCoords = this._texCoords[0];\r\n    var colors = this._colors[0];\r\n    var indices = isMultiInd ? this._multiIndIndices : this._indices[0];\r\n    var tangents = this._tangents[0];\r\n    var binormals = this._binormals[0];\r\n\r\n    var i = 0;\r\n\r\n    do {\r\n        this._positions[i] = [];\r\n        this._normals[i]   = [];\r\n        this._texCoords[i] = [];\r\n        this._colors[i]    = [];\r\n        this._indices[i]   = [];\r\n        this._tangents[i]  = [];\r\n        this._binormals[i] = [];\r\n        \r\n        var k = (indices.length - ((i + 1) * MAX) >= 0);\r\n\r\n        if (k) {\r\n            this._indices[i] = indices.slice(i * MAX, (i + 1) * MAX);\r\n        } else {\r\n            this._indices[i] = indices.slice(i * MAX);\r\n        }\r\n\r\n        if (!isMultiInd) {\r\n            if (i) {\r\n                var m = i * MAX;\r\n                for (var j = 0, l = this._indices[i].length; j < l; j++) {\r\n                    this._indices[i][j] -= m;\r\n                }\r\n            }\r\n        } else {\r\n            for (var j = 0, l = this._indices[i].length; j < l; j++) {\r\n                this._indices[i][j] = j;\r\n            }\r\n        }\r\n\r\n        if (k) {\r\n            this._positions[i] = positions.slice(i * MAX * 3, 3 * (i + 1) * MAX);\r\n        } else {\r\n            this._positions[i] = positions.slice(i * MAX * 3);\r\n        }\r\n\r\n        if (normals.length) {\r\n            if (k) {\r\n                this._normals[i] = normals.slice(i * MAX * 3, 3 * (i + 1) * MAX);\r\n            } else {\r\n                this._normals[i] = normals.slice(i * MAX * 3);\r\n            }\r\n        }\r\n        if (texCoords.length) {\r\n            if (k) {\r\n                this._texCoords[i] = texCoords.slice(i * MAX * this._numTexComponents,\r\n                    this._numTexComponents * (i + 1) * MAX);\r\n            } else {\r\n                this._texCoords[i] = texCoords.slice(i * MAX * this._numTexComponents);\r\n            }\r\n        }\r\n        if (colors.length) {\r\n            if (k) {\r\n                this._colors[i] = colors.slice(i * MAX * this._numColComponents,\r\n                    this._numColComponents * (i + 1) * MAX);\r\n            } else {\r\n                this._colors[i] = colors.slice(i * MAX * this._numColComponents);\r\n            }\r\n        }\r\n        if (tangents.length) {\r\n            if (k) {\r\n                this._tangents[i] = tangents.slice(i * MAX * 3, 3 * (i + 1) * MAX);\r\n            } else {\r\n                this._tangents[i] = tangents.slice(i * MAX * 3);\r\n            }\r\n        }\r\n        if (binormals.length) {\r\n            if (k) {\r\n                this._binormals[i] = binormals.slice(i * MAX * 3, 3 * (i + 1) * MAX);\r\n            } else {\r\n                this._binormals[i] = binormals.slice(i * MAX * 3);\r\n            }\r\n        }\r\n    } while (positions.length > ++i * MAX * 3);\r\n\r\n};\r\n\r\nx3dom.Mesh.prototype.calcTexCoords = function(mode) {\r\n    this._texCoords[0] = [];\r\n\r\n    // TODO: impl. all modes that aren't handled in shader!\r\n    // FIXME: WebKit requires valid texCoords for texturing\r\n    if (mode.toLowerCase() === \"sphere-local\") {\r\n        for (var i = 0, j = 0, n = this._normals[0].length; i < n; i += 3) {\r\n            this._texCoords[0][j++] = 0.5 + this._normals[0][i] / 2.0;\r\n            this._texCoords[0][j++] = 0.5 + this._normals[0][i + 1] / 2.0;\r\n        }\r\n    } \r\n    if (mode.toLowerCase() === \"coord\") {\r\n        for (var k = 0, l = 0, m = this._positions[0].length; k < m; k += 3) {\r\n            this._texCoords[0][l++] = this._positions[0][k];\r\n            this._texCoords[0][l++] = this._positions[0][k + 1];\r\n        }\r\n    } else {\r\n        // \"plane\" is x3d default mapping\r\n        var min = new x3dom.fields.SFVec3f(0, 0, 0),\r\n            max = new x3dom.fields.SFVec3f(0, 0, 0);\r\n        var vol = this.getVolume();\r\n\r\n        vol.getBounds(min, max);\r\n        var dia = max.subtract(min);\r\n\r\n        var S = 0, T = 1;\r\n\r\n        if (dia.x >= dia.y) {\r\n            if (dia.x >= dia.z) {\r\n                S = 0;\r\n                T = dia.y >= dia.z ? 1 : 2;\r\n            } else {\r\n                // dia.x < dia.z\r\n                S = 2;\r\n                T = 0;\r\n            }\r\n        } else {\r\n            // dia.x < dia.y\r\n            if (dia.y >= dia.z) {\r\n                S = 1;\r\n                T = dia.x >= dia.z ? 0 : 2;\r\n            } else {\r\n                // dia.y < dia.z\r\n                S = 2;\r\n                T = 1;\r\n            }\r\n        }\r\n\r\n        var sDenom = 1, tDenom = 1;\r\n        var sMin = 0, tMin = 0;\r\n\r\n        switch(S) {\r\n            case 0: sDenom = dia.x; sMin = min.x; break;\r\n            case 1: sDenom = dia.y; sMin = min.y; break;\r\n            case 2: sDenom = dia.z; sMin = min.z; break;\r\n        }\r\n\r\n        switch(T) {\r\n            case 0: tDenom = dia.x; tMin = min.x; break;\r\n            case 1: tDenom = dia.y; tMin = min.y; break;\r\n            case 2: tDenom = dia.z; tMin = min.z; break;\r\n        }\r\n\r\n        for (var k = 0, l = 0, m = this._positions[0].length; k < m; k += 3) {\r\n            this._texCoords[0][l++] = (this._positions[0][k + S] - sMin) / sDenom;\r\n            this._texCoords[0][l++] = (this._positions[0][k + T] - tMin) / sDenom;\r\n        }\r\n    }\r\n};\r\n\n/**\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * Philip Taylor: http://philip.html5.org\n */\n\n/* If used as standalone lib, define some basics first. */\nif (typeof x3dom === \"undefined\") {\n\n    /**\n     * @namespace x3dom\n     */\n    x3dom = {\n        extend: function(f) {\n            function G() {}\n\n            G.prototype = f.prototype || f;\n            return new G();\n        },\n        debug: {\n            logInfo:    function(msg) { console.log(msg); },\n            logWarning: function(msg) { console.warn(msg); },\n            logError:   function(msg) { console.error(msg); }\n        }\n    };\n\n    if (!Array.map) {\n        Array.map = function(array, fun, thisp) {\n            var len = array.length;\n            var res = [];\n            for (var i = 0; i < len; i++) {\n                if (i in array) {\n                    res[i] = fun.call(thisp, array[i], i, array);\n                }\n            }\n            return res;\n        };\n    }\n\n    console.log(\"Using x3dom fields.js as standalone math and/or base types library.\");\n}\n\n/**\n * The x3dom.fields namespace.\n * @namespace x3dom.fields\n */\nx3dom.fields = {};\n\n// shortcut for convenience and speedup\nvar VecMath = x3dom.fields;\n\n// Epsilon\nx3dom.fields.Eps = 0.000001;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Single-Field Definitions\n///////////////////////////////////////////////////////////////////////////////\n\n/**\n * Constructor. You must either specify all argument values or no argument. In the latter case, an identity matrix will be created.\n *\n * @class Represents a 4x4 matrix in row major format.\n * @param {Number} [_00=1] - value at [0,0]\n * @param {Number} [_01=0] - value at [0,1]\n * @param {Number} [_02=0] - value at [0,2]\n * @param {Number} [_03=0] - value at [0,3]\n * @param {Number} [_10=0] - value at [1,0]\n * @param {Number} [_11=1] - value at [1,1]\n * @param {Number} [_12=0] - value at [1,2]\n * @param {Number} [_13=0] - value at [1,3]\n * @param {Number} [_20=0] - value at [2,0]\n * @param {Number} [_21=0] - value at [2,1]\n * @param {Number} [_22=1] - value at [2,2]\n * @param {Number} [_23=0] - value at [2,3]\n * @param {Number} [_30=0] - value at [3,0]\n * @param {Number} [_31=0] - value at [3,1]\n * @param {Number} [_32=0] - value at [3,2]\n * @param {Number} [_33=1] - value at [3,3]\n */\nx3dom.fields.SFMatrix4f = function(_00, _01, _02, _03,\n                                   _10, _11, _12, _13,\n                                   _20, _21, _22, _23,\n                                   _30, _31, _32, _33) {\n    if (arguments.length === 0) {\n        this._00 = 1; this._01 = 0; this._02 = 0; this._03 = 0;\n        this._10 = 0; this._11 = 1; this._12 = 0; this._13 = 0;\n        this._20 = 0; this._21 = 0; this._22 = 1; this._23 = 0;\n        this._30 = 0; this._31 = 0; this._32 = 0; this._33 = 1;\n    } else {\n        this._00 = _00; this._01 = _01; this._02 = _02; this._03 = _03;\n        this._10 = _10; this._11 = _11; this._12 = _12; this._13 = _13;\n        this._20 = _20; this._21 = _21; this._22 = _22; this._23 = _23;\n        this._30 = _30; this._31 = _31; this._32 = _32; this._33 = _33;\n    }\n};\n\n/**\n * Returns the first column vector of the matrix.\n *\n * @returns {x3dom.fields.SFVec3f} the vector\n */\nx3dom.fields.SFMatrix4f.prototype.e0 = function() {\n    var baseVec = new x3dom.fields.SFVec3f(this._00, this._10, this._20);\n    return baseVec.normalize();\n};\n\n/**\n * Returns the second column vector of the matrix.\n *\n * @returns {x3dom.fields.SFVec3f} the vector\n */\nx3dom.fields.SFMatrix4f.prototype.e1 = function() {\n    var baseVec = new x3dom.fields.SFVec3f(this._01, this._11, this._21);\n    return baseVec.normalize();\n};\n\n/**\n * Returns the third column vector of the matrix.\n *\n * @returns {x3dom.fields.SFVec3f} the vector\n */\nx3dom.fields.SFMatrix4f.prototype.e2 = function() {\n    var baseVec = new x3dom.fields.SFVec3f(this._02, this._12, this._22);\n    return baseVec.normalize();\n};\n\n/**\n * Returns the fourth column vector of the matrix.\n *\n * @returns {x3dom.fields.SFVec3f} the vector\n */\nx3dom.fields.SFMatrix4f.prototype.e3 = function() {\n    return new x3dom.fields.SFVec3f(this._03, this._13, this._23);\n};\n\n/**\n * Returns a copy of the argument matrix.\n *\n * @param {x3dom.fields.SFMatrix4f} that - the matrix to copy\n * @returns {x3dom.fields.SFMatrix4f} the copy\n */\nx3dom.fields.SFMatrix4f.copy = function(that) {\n    return new x3dom.fields.SFMatrix4f(\n        that._00, that._01, that._02, that._03,\n        that._10, that._11, that._12, that._13,\n        that._20, that._21, that._22, that._23,\n        that._30, that._31, that._32, that._33\n    );\n};\n\n/**\n * Returns a copy of the matrix.\n *\n * @returns {x3dom.fields.SFMatrix4f} the copy\n */\nx3dom.fields.SFMatrix4f.prototype.copy = function() {\n    return x3dom.fields.SFMatrix4f.copy(this);\n};\n\n/**\n * Returns a SFMatrix4f identity matrix.\n *\n * @returns {x3dom.fields.SFMatrix4f} the new identity matrix\n */\nx3dom.fields.SFMatrix4f.identity = function() {\n    return new x3dom.fields.SFMatrix4f(\n        1, 0, 0, 0,\n        0, 1, 0, 0,\n        0, 0, 1, 0,\n        0, 0, 0, 1\n    );\n};\n\n/**\n * Returns a new null matrix.\n *\n * @returns {x3dom.fields.SFMatrix4f} the new null matrix\n */\nx3dom.fields.SFMatrix4f.zeroMatrix = function() {\n    return new x3dom.fields.SFMatrix4f(\n        0, 0, 0, 0,\n        0, 0, 0, 0,\n        0, 0, 0, 0,\n        0, 0, 0, 0\n    );\n};\n\n/**\n * Returns a new translation matrix.\n *\n * @param {x3dom.fields.SFVec3f} vec - vector that describes the desired translation\n * @returns {x3dom.fields.SFMatrix4f} the new identity matrix\n */\nx3dom.fields.SFMatrix4f.translation = function(vec) {\n    return new x3dom.fields.SFMatrix4f(\n        1, 0, 0, vec.x,\n        0, 1, 0, vec.y,\n        0, 0, 1, vec.z,\n        0, 0, 0, 1\n    );\n};\n\n/**\n * Returns a new rotation matrix, rotating around the x axis.\n *\n * @param {Number} a - angle in radians\n * @returns {x3dom.fields.SFMatrix4f} the new rotation matrix\n */\nx3dom.fields.SFMatrix4f.rotationX = function(a) {\n    var c = Math.cos(a);\n    var s = Math.sin(a);\n    return new x3dom.fields.SFMatrix4f(\n        1, 0, 0, 0,\n        0, c, -s, 0,\n        0, s, c, 0,\n        0, 0, 0, 1\n    );\n};\n\n/**\n * Returns a new rotation matrix, rotating around the y axis.\n *\n * @param {Number} a - angle in radians\n * @returns {x3dom.fields.SFMatrix4f} the new rotation matrix\n */\nx3dom.fields.SFMatrix4f.rotationY = function(a) {\n    var c = Math.cos(a);\n    var s = Math.sin(a);\n    return new x3dom.fields.SFMatrix4f(\n        c, 0, s, 0,\n        0, 1, 0, 0,\n        -s, 0, c, 0,\n        0, 0, 0, 1\n    );\n};\n\n/**\n * Returns a new rotation matrix, rotating around the z axis.\n *\n * @param {Number} a - angle in radians\n * @returns {x3dom.fields.SFMatrix4f} the new rotation matrix\n */\nx3dom.fields.SFMatrix4f.rotationZ = function(a) {\n    var c = Math.cos(a);\n    var s = Math.sin(a);\n    return new x3dom.fields.SFMatrix4f(\n        c, -s, 0, 0,\n        s, c, 0, 0,\n        0, 0, 1, 0,\n        0, 0, 0, 1\n    );\n};\n\n/**\n * Returns a new scale matrix.\n *\n * @param {x3dom.fields.SFVec3f} vec - vector containing scale factors along the three main axes\n * @returns {x3dom.fields.SFMatrix4f} the new scale matrix\n */\nx3dom.fields.SFMatrix4f.scale = function(vec) {\n    return new x3dom.fields.SFMatrix4f(\n        vec.x, 0, 0, 0,\n        0, vec.y, 0, 0,\n        0, 0, vec.z, 0,\n        0, 0, 0, 1\n    );\n};\n\n/**\n * Returns a new camera matrix, using the given \"look at\" parameters.\n *\n * @param {x3dom.fields.SFVec3f} from - eye point\n * @param {x3dom.fields.SFVec3f} at - focus (\"look at\") point\n * @param {x3dom.fields.SFVec3f} up - up vector\n * @returns {x3dom.fields.SFMatrix4f} the new camera matrix\n */\nx3dom.fields.SFMatrix4f.lookAt = function(from, at, up) {\n    var view = from.subtract(at).normalize();\n    var right = up.normalize().cross(view).normalize();\n\n    // check if zero vector, i.e. linearly dependent\n    if (right.dot(right) < x3dom.fields.Eps) {\n        x3dom.debug.logWarning(\"View matrix is linearly dependent.\");\n        return x3dom.fields.SFMatrix4f.translation(from);\n    }\n\n    var newUp = view.cross(right).normalize();\n\n    var tmp = x3dom.fields.SFMatrix4f.identity();\n    tmp.setValue(right, newUp, view, from);\n\n    return tmp;\n};\n\n/**\n * Returns a new perspective projection frustum.\n *\n * @param {Number} left   - Left\n * @param {Number} right  - Right\n * @param {Number} bottom - Bottom\n * @param {Number} top    - Top\n * @param {Number} near   - near clipping distance\n * @param {Number} far    - far clipping distance\n */\nx3dom.fields.SFMatrix4f.perspectiveFrustum = function(left, right, bottom, top, near, far) {\n    return new x3dom.fields.SFMatrix4f(\n        2 * near / (right - left), 0, (right + left) / (right - left), 0,\n        0, 2 * near / (top - bottom), (top + bottom) / (top - bottom), 0,\n        0, 0, -(far + near) / (far - near), -2 * far * near / (far - near),\n        0, 0, -1, 0\n    );\n};\n\n/**\n * Returns a new perspective projection matrix.\n *\n * @param {Number} fov    - field-of-view angle in radians\n * @param {Number} aspect - aspect ratio (width / height)\n * @param {Number} near   - near clipping distance\n * @param {Number} far    - far clipping distance\n * @returns {x3dom.fields.SFMatrix4f} the new projection matrix\n */\nx3dom.fields.SFMatrix4f.perspective = function(fov, aspect, near, far) {\n    var f = 1 / Math.tan(fov / 2);\n\n    return new x3dom.fields.SFMatrix4f(\n        f / aspect, 0, 0, 0,\n        0, f, 0, 0,\n        0, 0, (near + far) / (near - far), 2 * near * far / (near - far),\n        0, 0, -1, 0\n    );\n};\n\n/**\n * Returns a new orthogonal projection matrix.\n *\n * @param {Number} left         - left border value of the view area\n * @param {Number} right        - right border value of the view area\n * @param {Number} bottom       - bottom border value of the view area\n * @param {Number} top          - top border value of the view area\n * @param {Number} near         - near clipping distance\n * @param {Number} far          - far clipping distance\n * @param {Number} [aspect=1.0] - desired aspect ratio (width / height) of the projected image\n * @returns {x3dom.fields.SFMatrix4f} the new projection matrix\n */\nx3dom.fields.SFMatrix4f.ortho = function(left, right, bottom, top, near, far, aspect) {\n    var rl = (right - left) / 2;    // hs\n    var tb = (top - bottom) / 2;    // vs\n    var fn = far - near;\n\n    if (aspect === undefined)\n        aspect = 1.0;\n\n    if (aspect < (rl / tb)) {\n        tb = rl / aspect;\n    } else {\n        rl = tb * aspect;\n    }\n\n    left = -rl;\n    right = rl;\n    bottom = -tb;\n    top = tb;\n\n    rl *= 2;\n    tb *= 2;\n\n    return new x3dom.fields.SFMatrix4f(\n        2 / rl, 0, 0, -(right + left) / rl,\n        0, 2 / tb, 0, -(top + bottom) / tb,\n        0, 0, -2 / fn, -(far + near) / fn,\n        0, 0, 0, 1\n    );\n};\n\n/**\n * Sets the translation components of a homogenous transform matrix.\n *\n * @param {x3dom.fields.SFVec3f} vec - the translation vector\n */\nx3dom.fields.SFMatrix4f.prototype.setTranslate = function(vec) {\n    this._03 = vec.x;\n    this._13 = vec.y;\n    this._23 = vec.z;\n};\n\n/**\n * Sets the scale components of a homogenous transform matrix.\n *\n * @param {x3dom.fields.SFVec3f} vec - vector containing scale factors along the three main axes\n */\nx3dom.fields.SFMatrix4f.prototype.setScale = function(vec) {\n    this._00 = vec.x;\n    this._11 = vec.y;\n    this._22 = vec.z;\n};\n\n/**\n * Sets the rotation components of a homogenous transform matrix.\n *\n * @param {x3dom.fields.Quaternion} quat - quaternion that describes the rotation\n */\nx3dom.fields.SFMatrix4f.prototype.setRotate = function(quat) {\n    var xx = quat.x * quat.x;\n    var xy = quat.x * quat.y;\n    var xz = quat.x * quat.z;\n    var yy = quat.y * quat.y;\n    var yz = quat.y * quat.z;\n    var zz = quat.z * quat.z;\n    var wx = quat.w * quat.x;\n    var wy = quat.w * quat.y;\n    var wz = quat.w * quat.z;\n\n    this._00 = 1 - 2 * (yy + zz);\n    this._01 = 2 * (xy - wz);\n    this._02 = 2 * (xz + wy);\n    this._10 = 2 * (xy + wz);\n    this._11 = 1 - 2 * (xx + zz);\n    this._12 = 2 * (yz - wx);\n    this._20 = 2 * (xz - wy);\n    this._21 = 2 * (yz + wx);\n    this._22 = 1 - 2 * (xx + yy);\n};\n\n/**\n * Creates a new matrix from a column major string representation, with values separated by commas\n *\n * @param {String} str - string to parse\n * @returns {x3dom.fields.SFMatrix4f} the new matrix\n */\nx3dom.fields.SFMatrix4f.parseRotation = function(str) {\n    var m = /^([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)$/.exec(str);\n    var x = +m[1], y = +m[2], z = +m[3], a = +m[4];\n\n    var d = Math.sqrt(x * x + y * y + z * z);\n    if (d === 0) {\n        x = 1;\n        y = z = 0;\n    } else {\n        x /= d;\n        y /= d;\n        z /= d;\n    }\n\n    var c = Math.cos(a);\n    var s = Math.sin(a);\n    var t = 1 - c;\n\n    return new x3dom.fields.SFMatrix4f(\n        t * x * x + c, t * x * y + s * z, t * x * z - s * y, 0,\n        t * x * y - s * z, t * y * y + c, t * y * z + s * x, 0,\n        t * x * z + s * y, t * y * z - s * x, t * z * z + c, 0,\n        0, 0, 0, 1\n    ).transpose();\n};\n\n/**\n * Creates a new matrix from a X3D-conformant string representation\n *\n * @param {String} str - string to parse\n * @returns {x3dom.fields.SFMatrix4f} the new rotation matrix\n */\nx3dom.fields.SFMatrix4f.parse = function(str) {\n    var needTranspose = false;\n    var val = /matrix.*\\((.+)\\)/;\n    if (val.exec(str)) {\n        str = RegExp.$1;\n        needTranspose = true;\n    }\n    var arr = Array.map(str.split(/[,\\s]+/), function(n) { return +n; });\n    if (arr.length >= 16) {\n        if (!needTranspose) {\n            return new x3dom.fields.SFMatrix4f(\n                arr[0], arr[1], arr[2], arr[3],\n                arr[4], arr[5], arr[6], arr[7],\n                arr[8], arr[9], arr[10], arr[11],\n                arr[12], arr[13], arr[14], arr[15]\n            );\n        } else {\n            return new x3dom.fields.SFMatrix4f(\n                arr[0], arr[4], arr[8], arr[12],\n                arr[1], arr[5], arr[9], arr[13],\n                arr[2], arr[6], arr[10], arr[14],\n                arr[3], arr[7], arr[11], arr[15]\n            );\n        }\n    } else if (arr.length === 6) {\n        return new x3dom.fields.SFMatrix4f(\n            arr[0], arr[1], 0, arr[4],\n            arr[2], arr[3], 0, arr[5],\n            0, 0, 1, 0,\n            0, 0, 0, 1\n        );\n    } else {\n        x3dom.debug.logWarning(\"SFMatrix4f - can't parse string: \" + str);\n        return x3dom.fields.SFMatrix4f.identity();\n    }\n};\n\n/**\n * Returns the result of multiplying this matrix with the given one, using \"post-multiplication\" / \"right multiply\".\n *\n * @param {x3dom.fields.SFMatrix4f} that - matrix to multiply with this one\n * @returns {x3dom.fields.SFMatrix4f} resulting matrix\n */\nx3dom.fields.SFMatrix4f.prototype.mult = function(that) {\n    return new x3dom.fields.SFMatrix4f(\n        this._00 * that._00 + this._01 * that._10 + this._02 * that._20 + this._03 * that._30,\n        this._00 * that._01 + this._01 * that._11 + this._02 * that._21 + this._03 * that._31,\n        this._00 * that._02 + this._01 * that._12 + this._02 * that._22 + this._03 * that._32,\n        this._00 * that._03 + this._01 * that._13 + this._02 * that._23 + this._03 * that._33,\n        this._10 * that._00 + this._11 * that._10 + this._12 * that._20 + this._13 * that._30,\n        this._10 * that._01 + this._11 * that._11 + this._12 * that._21 + this._13 * that._31,\n        this._10 * that._02 + this._11 * that._12 + this._12 * that._22 + this._13 * that._32,\n        this._10 * that._03 + this._11 * that._13 + this._12 * that._23 + this._13 * that._33,\n        this._20 * that._00 + this._21 * that._10 + this._22 * that._20 + this._23 * that._30,\n        this._20 * that._01 + this._21 * that._11 + this._22 * that._21 + this._23 * that._31,\n        this._20 * that._02 + this._21 * that._12 + this._22 * that._22 + this._23 * that._32,\n        this._20 * that._03 + this._21 * that._13 + this._22 * that._23 + this._23 * that._33,\n        this._30 * that._00 + this._31 * that._10 + this._32 * that._20 + this._33 * that._30,\n        this._30 * that._01 + this._31 * that._11 + this._32 * that._21 + this._33 * that._31,\n        this._30 * that._02 + this._31 * that._12 + this._32 * that._22 + this._33 * that._32,\n        this._30 * that._03 + this._31 * that._13 + this._32 * that._23 + this._33 * that._33\n    );\n};\n\n/**\n * Transforms a given 3D point, using this matrix as a homogenous transform matrix\n * (ignores projection part of matrix for speedup in standard cases).\n *\n * @param {x3dom.fields.SFVec3f} vec - point to transform\n * @returns {x3dom.fields.SFVec3f} resulting point\n */\nx3dom.fields.SFMatrix4f.prototype.multMatrixPnt = function(vec) {\n    return new x3dom.fields.SFVec3f(\n        this._00 * vec.x + this._01 * vec.y + this._02 * vec.z + this._03,\n        this._10 * vec.x + this._11 * vec.y + this._12 * vec.z + this._13,\n        this._20 * vec.x + this._21 * vec.y + this._22 * vec.z + this._23\n    );\n};\n\n/**\n * Transforms a given 3D vector, using this matrix as a homogenous transform matrix.\n *\n * @param {x3dom.fields.SFVec3f} vec - vector to transform\n * @returns {x3dom.fields.SFVec3f} resulting vector\n */\nx3dom.fields.SFMatrix4f.prototype.multMatrixVec = function(vec) {\n    return new x3dom.fields.SFVec3f(\n        this._00 * vec.x + this._01 * vec.y + this._02 * vec.z,\n        this._10 * vec.x + this._11 * vec.y + this._12 * vec.z,\n        this._20 * vec.x + this._21 * vec.y + this._22 * vec.z\n    );\n};\n\n/**\n * Transforms a given 3D point, using this matrix as a transform matrix\n * (also includes projection part of matrix - required for e.g. modelview-projection matrix).\n * The resulting point is normalized by a w component.\n *\n * @param {x3dom.fields.SFVec3f} vec - point to transform\n * @returns {x3dom.fields.SFVec3f} resulting point\n */\nx3dom.fields.SFMatrix4f.prototype.multFullMatrixPnt = function(vec) {\n    var w = this._30 * vec.x + this._31 * vec.y + this._32 * vec.z + this._33;\n    if (w) {\n        w = 1.0 / w;\n    }\n    return new x3dom.fields.SFVec3f(\n        (this._00 * vec.x + this._01 * vec.y + this._02 * vec.z + this._03) * w,\n        (this._10 * vec.x + this._11 * vec.y + this._12 * vec.z + this._13) * w,\n        (this._20 * vec.x + this._21 * vec.y + this._22 * vec.z + this._23) * w\n    );\n};\n\n/**\n * Transforms a given 3D point, using this matrix as a transform matrix\n * (also includes projection part of matrix - required for e.g. modelview-projection matrix).\n * The resulting point is normalized by a w component.\n *\n * @param {x3dom.fields.SFVec4f} plane - plane to transform\n * @returns {x3dom.fields.SFVec4f} resulting plane\n */\nx3dom.fields.SFMatrix4f.prototype.multMatrixPlane = function(plane) {\n\n    var normal = new x3dom.fields.SFVec3f(plane.x, plane.y, plane.z);\n\n    var memberPnt = normal.multiply(-plane.w);\n\n    memberPnt = this.multMatrixPnt(memberPnt);\n\n    var invTranspose = this.inverse().transpose();\n\n    normal = invTranspose.multMatrixVec(normal);\n\n    var d = -normal.dot(memberPnt);\n\n    return new x3dom.fields.SFVec4f(normal.x, normal.y, normal.z, d);\n};\n\n/**\n * Returns a transposed version of this matrix.\n *\n * @returns {x3dom.fields.SFMatrix4f} resulting matrix\n */\nx3dom.fields.SFMatrix4f.prototype.transpose = function() {\n    return new x3dom.fields.SFMatrix4f(\n        this._00, this._10, this._20, this._30,\n        this._01, this._11, this._21, this._31,\n        this._02, this._12, this._22, this._32,\n        this._03, this._13, this._23, this._33\n    );\n};\n\n/**\n * Returns a negated version of this matrix.\n *\n * @returns {x3dom.fields.SFMatrix4f} resulting matrix\n */\nx3dom.fields.SFMatrix4f.prototype.negate = function() {\n    return new x3dom.fields.SFMatrix4f(\n        -this._00, -this._01, -this._02, -this._03,\n        -this._10, -this._11, -this._12, -this._13,\n        -this._20, -this._21, -this._22, -this._23,\n        -this._30, -this._31, -this._32, -this._33\n    );\n};\n\n/**\n * Returns a scaled version of this matrix.\n *\n * @param {Number} s - scale factor\n * @returns {x3dom.fields.SFMatrix4f} resulting matrix\n */\nx3dom.fields.SFMatrix4f.prototype.multiply = function(s) {\n    return new x3dom.fields.SFMatrix4f(\n        s * this._00, s * this._01, s * this._02, s * this._03,\n        s * this._10, s * this._11, s * this._12, s * this._13,\n        s * this._20, s * this._21, s * this._22, s * this._23,\n        s * this._30, s * this._31, s * this._32, s * this._33\n    );\n};\n\n/**\n * Returns the result of adding the given matrix to this matrix.\n *\n * @param {x3dom.fields.SFMatrix4f} that - the other matrix\n * @returns {x3dom.fields.SFMatrix4f} resulting matrix\n */\nx3dom.fields.SFMatrix4f.prototype.add = function(that) {\n    return new x3dom.fields.SFMatrix4f(\n        this._00 + that._00, this._01 + that._01, this._02 + that._02, this._03 + that._03,\n        this._10 + that._10, this._11 + that._11, this._12 + that._12, this._13 + that._13,\n        this._20 + that._20, this._21 + that._21, this._22 + that._22, this._23 + that._23,\n        this._30 + that._30, this._31 + that._31, this._32 + that._32, this._33 + that._33\n    );\n};\n\n/**\n * Returns the result of adding the given matrix to this matrix\n * using an additional scale factor for the argument matrix.\n *\n * @param {x3dom.fields.SFMatrix4f} that - the other matrix\n * @param {Number} s - the scale factor\n * @returns {x3dom.fields.SFMatrix4f} resulting matrix\n */\nx3dom.fields.SFMatrix4f.prototype.addScaled = function(that, s) {\n    return new x3dom.fields.SFMatrix4f(\n        this._00 + s * that._00, this._01 + s * that._01, this._02 + s * that._02, this._03 + s * that._03,\n        this._10 + s * that._10, this._11 + s * that._11, this._12 + s * that._12, this._13 + s * that._13,\n        this._20 + s * that._20, this._21 + s * that._21, this._22 + s * that._22, this._23 + s * that._23,\n        this._30 + s * that._30, this._31 + s * that._31, this._32 + s * that._32, this._33 + s * that._33\n    );\n};\n\n/**\n * Fills the values of this matrix with the values of the other one.\n *\n * @param {x3dom.fields.SFMatrix4f} that - the other matrix\n */\nx3dom.fields.SFMatrix4f.prototype.setValues = function(that) {\n    this._00 = that._00;\n    this._01 = that._01;\n    this._02 = that._02;\n    this._03 = that._03;\n    this._10 = that._10;\n    this._11 = that._11;\n    this._12 = that._12;\n    this._13 = that._13;\n    this._20 = that._20;\n    this._21 = that._21;\n    this._22 = that._22;\n    this._23 = that._23;\n    this._30 = that._30;\n    this._31 = that._31;\n    this._32 = that._32;\n    this._33 = that._33;\n};\n\n/**\n * Fills the upper left 3x3 or 3x4 values of this matrix, using the given (three or four) column vectors.\n *\n * @param {x3dom.fields.SFVec3f} v1             - first column vector\n * @param {x3dom.fields.SFVec3f} v2             - second column vector\n * @param {x3dom.fields.SFVec3f} v3             - third column vector\n * @param {x3dom.fields.SFVec3f} [v4=undefined] - fourth column vector\n */\nx3dom.fields.SFMatrix4f.prototype.setValue = function(v1, v2, v3, v4) {\n    this._00 = v1.x;\n    this._01 = v2.x;\n    this._02 = v3.x;\n    this._10 = v1.y;\n    this._11 = v2.y;\n    this._12 = v3.y;\n    this._20 = v1.z;\n    this._21 = v2.z;\n    this._22 = v3.z;\n    this._30 = 0;\n    this._31 = 0;\n    this._32 = 0;\n\n    if (arguments.length > 3) {\n        this._03 = v4.x;\n        this._13 = v4.y;\n        this._23 = v4.z;\n        this._33 = 1;\n    }\n};\n\n/**\n * Fills the values of this matrix, using the given array.\n *\n * @param {Number[]} a - array, the first 16 values will be used to initialize the matrix\n */\nx3dom.fields.SFMatrix4f.prototype.setFromArray = function (a) {\n    this._00 = a[0];\n    this._01 = a[4];\n    this._02 = a[8];\n    this._03 = a[12];\n    this._10 = a[1];\n    this._11 = a[5];\n    this._12 = a[9];\n    this._13 = a[13];\n    this._20 = a[2];\n    this._21 = a[6];\n    this._22 = a[10];\n    this._23 = a[14];\n    this._30 = a[3];\n    this._31 = a[7];\n    this._32 = a[11];\n    this._33 = a[15];\n\n    return this;\n};\n\n/**\n * Fills the values of this matrix, using the given array.\n * @param {Number[]} a - array, the first 16 values will be used to initialize the matrix\n */\nx3dom.fields.SFMatrix4f.fromArray = function (a) {\n    var m = new x3dom.fields.SFMatrix4f();\n\n    m._00 = a[0]; m._01 = a[4]; m._02 = a[ 8]; m._03 = a[12];\n    m._10 = a[1]; m._11 = a[5]; m._12 = a[ 9]; m._13 = a[13];\n    m._20 = a[2]; m._21 = a[6]; m._22 = a[10]; m._23 = a[14];\n    m._30 = a[3]; m._31 = a[7]; m._32 = a[11]; m._33 = a[15];\n\n    return m;\n};\n\n/**\n * Fills the values of this matrix, using the given array.\n * @param {Number[]} a - array, the first 16 values will be used to initialize the matrix\n */\nx3dom.fields.SFMatrix4f.prototype.fromRotationTranslationScale = function (rotation, translation, scale) {\n\n    translation    = translation || new x3dom.fields.SFVec3f(); //[ 0.2, -0.3, -0.3 ];\n    rotation = rotation || new x3dom.fields.Quaternion();\n    scale       = scale || new x3dom.fields.SFVec3f(1,1,1);\n\n    var x = rotation.x,\n        y = rotation.y,\n        z = rotation.z,\n        w = rotation.w;\n\n    var x2 = x + x;\n    var y2 = y + y;\n    var z2 = z + z;\n    var xx = x * x2;\n    var xy = x * y2;\n    var xz = x * z2;\n    var yy = y * y2;\n    var yz = y * z2;\n    var zz = z * z2;\n    var wx = w * x2;\n    var wy = w * y2;\n    var wz = w * z2;\n\n    this._00 = (1 - (yy + zz)) * scale.x;\n    this._10 = (xy + wz) * scale.x;\n    this._20 = (xz - wy) * scale.x;\n    this._30 = 0;\n    this._01 = (xy - wz) * scale.y;\n    this._11 = (1 - (xx + zz)) * scale.y;\n    this._21 = (yz + wx) * scale.y;\n    this._31 = 0;\n    this._02 = (xz + wy) * scale.z;\n    this._12 = (yz - wx) * scale.z;\n    this._22 = (1 - (xx + yy)) * scale.z;\n    this._32 = 0;\n    this._03 = translation.x;\n    this._13 = translation.y;\n    this._23 = translation.z;\n    this._33 = 1\n\n    return this;\n};\n\n/**\n * Fills the values of this matrix, using the given array.\n * @param {Number[]} a - array, the first 16 values will be used to initialize the matrix\n */\nx3dom.fields.SFMatrix4f.fromRotationTranslationScale = function (rotation, translation, scale) {\n\n    translation = translation || new x3dom.fields.SFVec3f(); //[ 0.2, -0.3, -0.3 ];\n    rotation    = rotation || new x3dom.fields.Quaternion();\n    scale       = scale || new x3dom.fields.SFVec3f(1,1,1);\n    var m       = new x3dom.fields.SFMatrix4f();\n\n    var x = rotation.x,\n        y = rotation.y,\n        z = rotation.z,\n        w = rotation.w;\n\n    var x2 = x + x;\n    var y2 = y + y;\n    var z2 = z + z;\n    var xx = x * x2;\n    var xy = x * y2;\n    var xz = x * z2;\n    var yy = y * y2;\n    var yz = y * z2;\n    var zz = z * z2;\n    var wx = w * x2;\n    var wy = w * y2;\n    var wz = w * z2;\n\n    m._00 = (1 - (yy + zz)) * scale.x;\n    m._10 = (xy + wz) * scale.x;\n    m._20 = (xz - wy) * scale.x;\n    m._30 = 0;\n    m._01 = (xy - wz) * scale.y;\n    m._11 = (1 - (xx + zz)) * scale.y;\n    m._21 = (yz + wx) * scale.y;\n    m._31 = 0;\n    m._02 = (xz + wy) * scale.z;\n    m._12 = (yz - wx) * scale.z;\n    m._22 = (1 - (xx + yy)) * scale.z;\n    m._32 = 0;\n    m._03 = translation.x;\n    m._13 = translation.y;\n    m._23 = translation.z;\n    m._33 = 1\n\n    return m;\n};\n\n/**\n * Returns a column major version of this matrix, packed into a single array.\n *\n * @returns {Number[]} resulting array of 16 values\n */\nx3dom.fields.SFMatrix4f.prototype.toGL = function() {\n    return [\n        this._00, this._10, this._20, this._30,\n        this._01, this._11, this._21, this._31,\n        this._02, this._12, this._22, this._32,\n        this._03, this._13, this._23, this._33\n    ];\n};\n\n/**\n * Returns a column major version of this matrix, packed into a single array.\n * @returns {Number[]} resulting array of 16 values\n */\nx3dom.fields.SFMatrix4f.fromGL = function (array) {\n    return [\n        this._00, this._10, this._20, this._30,\n        this._01, this._11, this._21, this._31,\n        this._02, this._12, this._22, this._32,\n        this._03, this._13, this._23, this._33\n    ];\n};\n\n/**\n * Returns the value of this matrix at a given position.\n *\n * @param {Number} i - row index (starting with 0)\n * @param {Number} j - column index (starting with 0)\n * @returns {Number} the value\n */\nx3dom.fields.SFMatrix4f.prototype.at = function(i, j) {\n    var field = \"_\" + i + j;\n    return this[field];\n};\n\n/**\n * Computes the square root of the matrix, assuming that its determinant is greater than zero.\n *\n * @returns {SFMatrix4f} a matrix containing the result\n */\nx3dom.fields.SFMatrix4f.prototype.sqrt = function() {\n    var Y = x3dom.fields.SFMatrix4f.identity();\n    var result = x3dom.fields.SFMatrix4f.copy(this);\n\n    for (var i = 0; i < 6; i++) {\n        var iX = result.inverse();\n        var iY = (i == 0) ? x3dom.fields.SFMatrix4f.identity() : Y.inverse();\n\n        var rd = result.det(), yd = Y.det();\n\n        var g = Math.abs(Math.pow(rd * yd, -0.125));\n        var ig = 1.0 / g;\n\n        result = result.multiply(g);\n        result = result.addScaled(iY, ig);\n        result = result.multiply(0.5);\n\n        Y = Y.multiply(g);\n        Y = Y.addScaled(iX, ig);\n        Y = Y.multiply(0.5);\n    }\n\n    return result;\n};\n\n/**\n * Returns the largest absolute value of all entries in the matrix.\n * This is only a helper for calculating log and not the usual Infinity-norm for matrices.\n *\n * @returns {Number} the largest absolute value\n */\nx3dom.fields.SFMatrix4f.prototype.normInfinity = function() {\n    var t = 0, m = 0;\n\n    if ((t = Math.abs(this._00)) > m) {\n        m = t;\n    }\n    if ((t = Math.abs(this._01)) > m) {\n        m = t;\n    }\n    if ((t = Math.abs(this._02)) > m) {\n        m = t;\n    }\n    if ((t = Math.abs(this._03)) > m) {\n        m = t;\n    }\n    if ((t = Math.abs(this._10)) > m) {\n        m = t;\n    }\n    if ((t = Math.abs(this._11)) > m) {\n        m = t;\n    }\n    if ((t = Math.abs(this._12)) > m) {\n        m = t;\n    }\n    if ((t = Math.abs(this._13)) > m) {\n        m = t;\n    }\n    if ((t = Math.abs(this._20)) > m) {\n        m = t;\n    }\n    if ((t = Math.abs(this._21)) > m) {\n        m = t;\n    }\n    if ((t = Math.abs(this._22)) > m) {\n        m = t;\n    }\n    if ((t = Math.abs(this._23)) > m) {\n        m = t;\n    }\n    if ((t = Math.abs(this._30)) > m) {\n        m = t;\n    }\n    if ((t = Math.abs(this._31)) > m) {\n        m = t;\n    }\n    if ((t = Math.abs(this._32)) > m) {\n        m = t;\n    }\n    if ((t = Math.abs(this._33)) > m) {\n        m = t;\n    }\n\n    return m;\n};\n\n/**\n * Returns the 1-norm of the upper left 3x3 part of this matrix.\n * The 1-norm is also known as maximum absolute column sum norm.\n *\n * @returns {Number} the resulting number\n */\nx3dom.fields.SFMatrix4f.prototype.norm1_3x3 = function() {\n    var max = Math.abs(this._00) +\n              Math.abs(this._10) +\n              Math.abs(this._20);\n    var t = 0;\n\n    if ((t = Math.abs(this._01) +\n             Math.abs(this._11) +\n             Math.abs(this._21)) > max) {\n        max = t;\n    }\n\n    if ((t = Math.abs(this._02) +\n             Math.abs(this._12) +\n             Math.abs(this._22)) > max) {\n        max = t;\n    }\n\n    return max;\n};\n\n/**\n * Returns the infinity-norm of the upper left 3x3 part of this matrix.\n * The infinity-norm is also known as maximum absolute row sum norm.\n *\n * @returns {Number} the resulting number\n */\nx3dom.fields.SFMatrix4f.prototype.normInf_3x3 = function() {\n    var max = Math.abs(this._00) +\n              Math.abs(this._01) +\n              Math.abs(this._02);\n    var t = 0;\n\n    if ((t = Math.abs(this._10) +\n             Math.abs(this._11) +\n             Math.abs(this._12)) > max) {\n        max = t;\n    }\n\n    if ((t = Math.abs(this._20) +\n             Math.abs(this._21) +\n             Math.abs(this._22)) > max) {\n        max = t;\n    }\n\n    return max;\n};\n\n/**\n * Computes the transposed adjoint of the upper left 3x3 part of this matrix,\n * and stores it in the upper left part of a new 4x4 identity matrix.\n *\n * @returns {x3dom.fields.SFMatrix4f} the resulting matrix\n */\nx3dom.fields.SFMatrix4f.prototype.adjointT_3x3 = function() {\n    var result = x3dom.fields.SFMatrix4f.identity();\n\n    result._00 = this._11 * this._22 - this._12 * this._21;\n    result._01 = this._12 * this._20 - this._10 * this._22;\n    result._02 = this._10 * this._21 - this._11 * this._20;\n\n    result._10 = this._21 * this._02 - this._22 * this._01;\n    result._11 = this._22 * this._00 - this._20 * this._02;\n    result._12 = this._20 * this._01 - this._21 * this._00;\n\n    result._20 = this._01 * this._12 - this._02 * this._11;\n    result._21 = this._02 * this._10 - this._00 * this._12;\n    result._22 = this._00 * this._11 - this._01 * this._10;\n\n    return result;\n};\n\n/**\n * Checks whether this matrix equals another matrix.\n *\n * @param {x3dom.fields.SFMatrix4f} that - the other matrix\n * @returns {Boolean}\n */\nx3dom.fields.SFMatrix4f.prototype.equals = function(that) {\n    var eps = 0.000000000001;\n    return Math.abs(this._00 - that._00) < eps && Math.abs(this._01 - that._01) < eps &&\n           Math.abs(this._02 - that._02) < eps && Math.abs(this._03 - that._03) < eps &&\n           Math.abs(this._10 - that._10) < eps && Math.abs(this._11 - that._11) < eps &&\n           Math.abs(this._12 - that._12) < eps && Math.abs(this._13 - that._13) < eps &&\n           Math.abs(this._20 - that._20) < eps && Math.abs(this._21 - that._21) < eps &&\n           Math.abs(this._22 - that._22) < eps && Math.abs(this._23 - that._23) < eps &&\n           Math.abs(this._30 - that._30) < eps && Math.abs(this._31 - that._31) < eps &&\n           Math.abs(this._32 - that._32) < eps && Math.abs(this._33 - that._33) < eps;\n};\n\n/**\n * Decomposes the matrix into a translation, rotation, scale,\n * and scale orientation. Any projection information is discarded.\n * The decomposition depends upon choice of center point for rotation and scaling,\n * which is optional as the last parameter.\n *\n * @param {x3dom.fields.SFVec3f} translation         - 3D vector to be filled with the translation values\n * @param {x3dom.fields.Quaternion} rotation         - quaternion to be filled with the rotation values\n * @param {x3dom.fields.SFVec3f} scaleFactor         - 3D vector to be filled with the scale factors\n * @param {x3dom.fields.Quaternion} scaleOrientation - rotation (quaternion) to be applied before scaling\n * @param {x3dom.fields.SFVec3f} [center=undefined]  - center point for rotation and scaling, if not origin\n */\nx3dom.fields.SFMatrix4f.prototype.getTransform = function(\n    translation, rotation, scaleFactor, scaleOrientation, center) {\n    var m = null;\n\n    if (arguments.length > 4) {\n        m = x3dom.fields.SFMatrix4f.translation(center.negate());\n        m = m.mult(this);\n\n        var c = x3dom.fields.SFMatrix4f.translation(center);\n        m = m.mult(c);\n    } else {\n        m = x3dom.fields.SFMatrix4f.copy(this);\n    }\n\n    var flip = m.decompose(translation, rotation, scaleFactor, scaleOrientation);\n\n    scaleFactor.setValues(scaleFactor.multiply(flip));\n};\n\n/**\n * Computes the decomposition of the given 4x4 affine matrix M as M = T F R SO S SO^t,\n * where T is a translation matrix, F is +/- I (a reflection), R is a rotation matrix,\n * SO is a rotation matrix and S is a (nonuniform) scale matrix.\n *\n * @param {x3dom.fields.SFVec3f} t     - 3D vector to be filled with the translation values\n * @param {x3dom.fields.Quaternion} r  - quaternion to be filled with the rotation values\n * @param {x3dom.fields.SFVec3f} s     - 3D vector to be filled with the scale factors\n * @param {x3dom.fields.Quaternion} so - rotation (quaternion) to be applied before scaling\n * @returns {Number} signum of determinant of the transposed adjoint upper 3x3 matrix\n */\nx3dom.fields.SFMatrix4f.prototype.decompose = function(t, r, s, so) {\n    var A  = x3dom.fields.SFMatrix4f.copy(this);\n\n    var Q  = x3dom.fields.SFMatrix4f.identity(),\n        S  = x3dom.fields.SFMatrix4f.identity(),\n        SO = x3dom.fields.SFMatrix4f.identity();\n\n    t.x = A._03;\n    t.y = A._13;\n    t.z = A._23;\n\n    A._03 = 0.0;\n    A._13 = 0.0;\n    A._23 = 0.0;\n\n    A._30 = 0.0;\n    A._31 = 0.0;\n    A._32 = 0.0;\n\n    var det = A.polarDecompose(Q, S);\n    var f = 1.0;\n\n    if (det < 0.0) {\n        Q = Q.negate();\n        f = -1.0;\n    }\n\n    r.setValue(Q);\n\n    S.spectralDecompose(SO, s);\n\n    so.setValue(SO);\n\n    return f;\n};\n\n/**\n * Performs a polar decomposition of this matrix A into two matrices Q and S, so that A = QS\n *\n * @param {x3dom.fields.SFMatrix4f} Q - first resulting matrix\n * @param {x3dom.fields.SFMatrix4f} S - first resulting matrix\n * @returns {Number} determinant of the transposed adjoint upper 3x3 matrix\n */\nx3dom.fields.SFMatrix4f.prototype.polarDecompose = function(Q, S) {\n    var TOL = 0.000000000001;\n\n    var Mk = this.transpose();\n    var Ek = x3dom.fields.SFMatrix4f.identity();\n\n    var Mk_one = Mk.norm1_3x3();\n    var Mk_inf = Mk.normInf_3x3();\n\n    var MkAdjT;\n    var MkAdjT_one, MkAdjT_inf;\n    var Ek_one, Mk_det;\n\n    do {\n        // compute transpose of adjoint\n        MkAdjT = Mk.adjointT_3x3();\n\n        // Mk_det = det(Mk) -- computed from the adjoint\n        Mk_det = Mk._00 * MkAdjT._00 +\n            Mk._01 * MkAdjT._01 +\n            Mk._02 * MkAdjT._02;\n\n        // TODO: should this be a close to zero test ?\n        if (Mk_det == 0.0) {\n            x3dom.debug.logWarning(\"polarDecompose: Mk_det == 0.0\");\n            break;\n        }\n\n        MkAdjT_one = MkAdjT.norm1_3x3();\n        MkAdjT_inf = MkAdjT.normInf_3x3();\n\n        // compute update factors\n        var gamma = Math.sqrt(Math.sqrt((MkAdjT_one * MkAdjT_inf) /\n            (Mk_one * Mk_inf)) / Math.abs(Mk_det));\n\n        var g1 = 0.5 * gamma;\n        var g2 = 0.5 / (gamma * Mk_det);\n\n        Ek.setValues(Mk);\n\n        Mk = Mk.multiply(g1);         // this does:\n        Mk = Mk.addScaled(MkAdjT, g2); // Mk = g1 * Mk + g2 * MkAdjT\n        Ek = Ek.addScaled(Mk, -1.0);   // Ek -= Mk;\n\n        Ek_one = Ek.norm1_3x3();\n        Mk_one = Mk.norm1_3x3();\n        Mk_inf = Mk.normInf_3x3();\n\n    } while (Ek_one > (Mk_one * TOL));\n\n    Q.setValues(Mk.transpose());\n    S.setValues(Mk.mult(this));\n\n    for (var i = 0; i < 3; ++i) {\n        for (var j = i; j < 3; ++j) {\n            S['_' + j + i] = 0.5 * (S['_' + j + i] + S['_' + i + j]);\n            S['_' + i + j] = 0.5 * (S['_' + j + i] + S['_' + i + j]);\n        }\n    }\n\n    return Mk_det;\n};\n\n/**\n * Performs a spectral decomposition of this matrix.\n *\n * @param {x3dom.fields.SFMatrix4f} SO - resulting matrix\n * @param {x3dom.fields.SFVec3f} k - resulting vector\n */\nx3dom.fields.SFMatrix4f.prototype.spectralDecompose = function(SO, k) {\n    var next = [1, 2, 0];\n    var maxIterations = 20;\n    var diag = [this._00, this._11, this._22];\n    var offDiag = [this._12, this._20, this._01];\n\n    for (var iter = 0; iter < maxIterations; ++iter) {\n        var sm = Math.abs(offDiag[0]) + Math.abs(offDiag[1]) + Math.abs(offDiag[2]);\n\n        if (sm == 0) {\n            break;\n        }\n\n        for (var i = 2; i >= 0; --i) {\n            var p = next[i];\n            var q = next[p];\n\n            var absOffDiag = Math.abs(offDiag[i]);\n            var g = 100.0 * absOffDiag;\n\n            if (absOffDiag > 0.0) {\n                var t = 0, h = diag[q] - diag[p];\n                var absh = Math.abs(h);\n\n                if (absh + g == absh) {\n                    t = offDiag[i] / h;\n                } else {\n                    var theta = 0.5 * h / offDiag[i];\n                    t = 1.0 / (Math.abs(theta) + Math.sqrt(theta * theta + 1.0));\n\n                    t = theta < 0.0 ? -t : t;\n                }\n\n                var c = 1.0 / Math.sqrt(t * t + 1.0);\n                var s = t * c;\n\n                var tau = s / (c + 1.0);\n                var ta = t * offDiag[i];\n\n                offDiag[i] = 0.0;\n\n                diag[p] -= ta;\n                diag[q] += ta;\n\n                var offDiagq = offDiag[q];\n\n                offDiag[q] -= s * (offDiag[p] + tau * offDiagq);\n                offDiag[p] += s * (offDiagq - tau * offDiag[p]);\n\n                for (var j = 2; j >= 0; --j) {\n                    var a = SO['_' + j + p];\n                    var b = SO['_' + j + q];\n\n                    SO['_' + j + p] -= s * (b + tau * a);\n                    SO['_' + j + q] += s * (a - tau * b);\n                }\n            }\n        }\n    }\n\n    k.x = diag[0];\n    k.y = diag[1];\n    k.z = diag[2];\n};\n\n/**\n * Computes the logarithm of this matrix, assuming that its determinant is greater than zero.\n *\n * @returns {x3dom.fields.SFMatrix4f} log of matrix\n */\nx3dom.fields.SFMatrix4f.prototype.log = function() {\n    var maxiter = 12;\n    var eps = 1e-12;\n\n    var A = x3dom.fields.SFMatrix4f.copy(this),\n        Z = x3dom.fields.SFMatrix4f.copy(this);\n\n    // Take repeated square roots to reduce spectral radius\n    Z._00 -= 1;\n    Z._11 -= 1;\n    Z._22 -= 1;\n    Z._33 -= 1;\n\n    var k = 0;\n\n    while (Z.normInfinity() > 0.5) {\n        A = A.sqrt();\n        Z.setValues(A);\n\n        Z._00 -= 1;\n        Z._11 -= 1;\n        Z._22 -= 1;\n        Z._33 -= 1;\n\n        k++;\n    }\n\n    A._00 -= 1;\n    A._11 -= 1;\n    A._22 -= 1;\n    A._33 -= 1;\n\n    A = A.negate();\n    Z.setValues(A);\n\n    var result = x3dom.fields.SFMatrix4f.copy(A);\n    var i = 1;\n\n    while (Z.normInfinity() > eps && i < maxiter) {\n        Z = Z.mult(A);\n        i++;\n\n        result = result.addScaled(Z, 1.0 / i);\n    }\n\n    return result.multiply(-(1 << k));\n};\n\n/**\n * Computes the exponential of this matrix.\n *\n * @returns {x3dom.fields.SFMatrix4f} exp of matrix\n */\nx3dom.fields.SFMatrix4f.prototype.exp = function() {\n    var q = 6;\n    var A = x3dom.fields.SFMatrix4f.copy(this),\n        D = x3dom.fields.SFMatrix4f.identity(),\n        N = x3dom.fields.SFMatrix4f.identity(),\n        result = x3dom.fields.SFMatrix4f.identity();\n    var k = 0, c = 1.0;\n\n    var j = 1.0 + parseInt(Math.log(A.normInfinity() / 0.693));\n    // var j = 1.0 + (Math.log(A.normInfinity() / 0.693) | 0);\n\n    if (j < 0) {\n        j = 0;\n    }\n\n    A = A.multiply(1.0 / (1 << j));\n\n    for (k = 1; k <= q; k++) {\n        c *= (q - k + 1) / (k * (2 * q - k + 1));\n\n        result = A.mult(result);\n\n        N = N.addScaled(result, c);\n\n        if (k % 2) {\n            D = D.addScaled(result, -c);\n        } else {\n            D = D.addScaled(result, c);\n        }\n    }\n\n    result = D.inverse().mult(N);\n\n    for (k = 0; k < j; k++) {\n        result = result.mult(result);\n    }\n\n    return result;\n};\n\n/**\n * Computes a determinant for a 3x3 matrix m, given as values in row major order.\n *\n * @param {Number} a1 - value of m at (0,0)\n * @param {Number} a2 - value of m at (0,1)\n * @param {Number} a3 - value of m at (0,2)\n * @param {Number} b1 - value of m at (1,0)\n * @param {Number} b2 - value of m at (1,1)\n * @param {Number} b3 - value of m at (1,2)\n * @param {Number} c1 - value of m at (2,0)\n * @param {Number} c2 - value of m at (2,1)\n * @param {Number} c3 - value of m at (2,2)\n * @returns {Number} determinant\n */\nx3dom.fields.SFMatrix4f.prototype.det3 = function(a1, a2, a3, b1, b2, b3, c1, c2, c3) {\n    return ((a1 * b2 * c3) + (a2 * b3 * c1) + (a3 * b1 * c2) -\n        (a1 * b3 * c2) - (a2 * b1 * c3) - (a3 * b2 * c1));\n};\n\n/**\n * Computes the determinant of this matrix.\n *\n * @returns {Number} determinant\n */\nx3dom.fields.SFMatrix4f.prototype.det = function() {\n    var a1 = this._00;\n    var b1 = this._10;\n    var c1 = this._20;\n    var d1 = this._30;\n\n    var a2 = this._01;\n    var b2 = this._11;\n    var c2 = this._21;\n    var d2 = this._31;\n\n    var a3 = this._02;\n    var b3 = this._12;\n    var c3 = this._22;\n    var d3 = this._32;\n\n    var a4 = this._03;\n    var b4 = this._13;\n    var c4 = this._23;\n    var d4 = this._33;\n\n    return (a1 * this.det3(b2, b3, b4, c2, c3, c4, d2, d3, d4) -\n        b1 * this.det3(a2, a3, a4, c2, c3, c4, d2, d3, d4) +\n        c1 * this.det3(a2, a3, a4, b2, b3, b4, d2, d3, d4) -\n        d1 * this.det3(a2, a3, a4, b2, b3, b4, c2, c3, c4));\n};\n\n/**\n * Computes the inverse of this matrix, given that it is not singular.\n *\n * @returns {x3dom.fields.SFMatrix4f}\n */\nx3dom.fields.SFMatrix4f.prototype.inverse = function() {\n    var a1 = this._00;\n    var b1 = this._10;\n    var c1 = this._20;\n    var d1 = this._30;\n\n    var a2 = this._01;\n    var b2 = this._11;\n    var c2 = this._21;\n    var d2 = this._31;\n\n    var a3 = this._02;\n    var b3 = this._12;\n    var c3 = this._22;\n    var d3 = this._32;\n\n    var a4 = this._03;\n    var b4 = this._13;\n    var c4 = this._23;\n    var d4 = this._33;\n\n    var rDet = this.det();\n\n    // if (Math.abs(rDet) < 1e-30)\n    if (rDet == 0) {\n        x3dom.debug.logWarning(\"Invert matrix: singular matrix, no inverse!\");\n        return x3dom.fields.SFMatrix4f.identity();\n    }\n\n    rDet = 1.0 / rDet;\n\n    return new x3dom.fields.SFMatrix4f(\n        +this.det3(b2, b3, b4, c2, c3, c4, d2, d3, d4) * rDet,\n        -this.det3(a2, a3, a4, c2, c3, c4, d2, d3, d4) * rDet,\n        +this.det3(a2, a3, a4, b2, b3, b4, d2, d3, d4) * rDet,\n        -this.det3(a2, a3, a4, b2, b3, b4, c2, c3, c4) * rDet,\n        -this.det3(b1, b3, b4, c1, c3, c4, d1, d3, d4) * rDet,\n        +this.det3(a1, a3, a4, c1, c3, c4, d1, d3, d4) * rDet,\n        -this.det3(a1, a3, a4, b1, b3, b4, d1, d3, d4) * rDet,\n        +this.det3(a1, a3, a4, b1, b3, b4, c1, c3, c4) * rDet,\n        +this.det3(b1, b2, b4, c1, c2, c4, d1, d2, d4) * rDet,\n        -this.det3(a1, a2, a4, c1, c2, c4, d1, d2, d4) * rDet,\n        +this.det3(a1, a2, a4, b1, b2, b4, d1, d2, d4) * rDet,\n        -this.det3(a1, a2, a4, b1, b2, b4, c1, c2, c4) * rDet,\n        -this.det3(b1, b2, b3, c1, c2, c3, d1, d2, d3) * rDet,\n        +this.det3(a1, a2, a3, c1, c2, c3, d1, d2, d3) * rDet,\n        -this.det3(a1, a2, a3, b1, b2, b3, d1, d2, d3) * rDet,\n        +this.det3(a1, a2, a3, b1, b2, b3, c1, c2, c3) * rDet\n    );\n};\n\n/**\n * Returns an array of 2*3 = 6 euler angles (in radians), assuming that this is a rotation matrix.\n * The first three and the second three values are alternatives for the three euler angles,\n * where each of the two cases leads to the same resulting rotation.\n * @returns {Number[]}\n */\nx3dom.fields.SFMatrix4f.prototype.getEulerAngles = function() {\n    var theta_1, theta_2, theta;\n    var phi_1, phi_2, phi;\n    var psi_1, psi_2, psi;\n    var cos_theta_1, cos_theta_2;\n\n    if (Math.abs((Math.abs(this._20) - 1.0)) > 0.0001) {\n        theta_1 = -Math.asin(this._20);\n        theta_2 = Math.PI - theta_1;\n\n        cos_theta_1 = Math.cos(theta_1);\n        cos_theta_2 = Math.cos(theta_2);\n\n        psi_1 = Math.atan2(this._21 / cos_theta_1, this._22 / cos_theta_1);\n        psi_2 = Math.atan2(this._21 / cos_theta_2, this._22 / cos_theta_2);\n\n        phi_1 = Math.atan2(this._10 / cos_theta_1, this._00 / cos_theta_1);\n        phi_2 = Math.atan2(this._10 / cos_theta_2, this._00 / cos_theta_2);\n\n        return [psi_1, theta_1, phi_1,\n            psi_2, theta_2, phi_2];\n    } else {\n        phi = 0;\n\n        if (this._20 == -1.0) {\n            theta = Math.PI / 2.0;\n            psi = phi + Math.atan2(this._01, this._02);\n        } else {\n            theta = -(Math.PI / 2.0);\n            psi = -phi + Math.atan2(-this._01, -this._02);\n        }\n\n        return [psi, theta, phi,\n            psi, theta, phi];\n    }\n};\n\n/**\n * Converts this matrix to a string representation, where all entries are separated by commas,\n * and where rows are additionally separated by linebreaks.\n *\n * @returns {String}\n */\nx3dom.fields.SFMatrix4f.prototype.toString = function () {\n    return this._00.toFixed(6)+' '+this._10.toFixed(6)+' '+\n\t\t   this._20.toFixed(6)+' '+this._30.toFixed(6)+' '+\n           this._01.toFixed(6)+' '+this._11.toFixed(6)+' '+\n\t\t   this._21.toFixed(6)+' '+this._31.toFixed(6)+' '+\n           this._02.toFixed(6)+' '+this._12.toFixed(6)+' '+\n\t\t   this._22.toFixed(6)+' '+this._32.toFixed(6)+' '+\n           this._03.toFixed(6)+' '+this._13.toFixed(6)+' '+\n\t\t   this._23.toFixed(6)+' '+this._33.toFixed(6);\n};\n\n/**\n * Fills the values of this matrix from a string, where the entries are separated\n * by commas and given in column-major order.\n *\n * @param {String} str - the string representation\n */\nx3dom.fields.SFMatrix4f.prototype.setValueByStr = function(str) {\n    var needTranspose = false;\n    var val = /matrix.*\\((.+)\\)/;\n    // check if matrix is set via CSS string\n    if (val.exec(str)) {\n        str = RegExp.$1;\n        needTranspose = true;\n    }\n    var arr = Array.map(str.split(/[,\\s]+/), function(n) { return +n; });\n    if (arr.length >= 16) {\n        if (!needTranspose) {\n            this._00 = arr[0];  this._01 = arr[1];  this._02 = arr[2];  this._03 = arr[3];\n            this._10 = arr[4];  this._11 = arr[5];  this._12 = arr[6];  this._13 = arr[7];\n            this._20 = arr[8];  this._21 = arr[9];  this._22 = arr[10]; this._23 = arr[11];\n            this._30 = arr[12]; this._31 = arr[13]; this._32 = arr[14]; this._33 = arr[15];\n        } else {\n            this._00 = arr[0];  this._01 = arr[4];  this._02 = arr[8];  this._03 = arr[12];\n            this._10 = arr[1];  this._11 = arr[5];  this._12 = arr[9];  this._13 = arr[13];\n            this._20 = arr[2];  this._21 = arr[6];  this._22 = arr[10]; this._23 = arr[14];\n            this._30 = arr[3];  this._31 = arr[7];  this._32 = arr[11]; this._33 = arr[15];\n        }\n    } else if (arr.length === 6) {\n        this._00 = arr[0]; this._01 = arr[1]; this._02 = 0; this._03 = arr[4];\n        this._10 = arr[2]; this._11 = arr[3]; this._12 = 0; this._13 = arr[5];\n        this._20 = 0; this._21 = 0; this._22 = 1; this._23 = 0;\n        this._30 = 0; this._31 = 0; this._32 = 0; this._33 = 1;\n    } else {\n        x3dom.debug.logWarning(\"SFMatrix4f - can't parse string: \" + str);\n    }\n\n    return this;\n};\n\n/**\n * SFVec2f constructor.\n *\n * @class Represents a SFVec2f\n */\nx3dom.fields.SFVec2f = function(x, y) {\n    if (arguments.length === 0) {\n        this.x = 0;\n        this.y = 0;\n    } else {\n        this.x = x;\n        this.y = y;\n    }\n};\n\nx3dom.fields.SFVec2f.copy = function(v) {\n    return new x3dom.fields.SFVec2f(v.x, v.y);\n};\n\nx3dom.fields.SFVec2f.parse = function(str) {\n    var m = /^\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*$/.exec(str);\n    if (m === null) return new x3dom.fields.SFVec2f();\n    return new x3dom.fields.SFVec2f(+m[1], +m[2]);\n};\n\nx3dom.fields.SFVec2f.prototype.copy = function() {\n    return x3dom.fields.SFVec2f.copy(this);\n};\n\nx3dom.fields.SFVec2f.prototype.setValues = function(that) {\n    this.x = that.x;\n    this.y = that.y;\n};\n\nx3dom.fields.SFVec2f.prototype.at = function(i) {\n    switch (i) {\n        case 0:  return this.x;\n        case 1:  return this.y;\n        default: return this.x;\n    }\n};\n\nx3dom.fields.SFVec2f.prototype.add = function(that) {\n    return new x3dom.fields.SFVec2f(this.x + that.x, this.y + that.y);\n};\n\nx3dom.fields.SFVec2f.prototype.subtract = function(that) {\n    return new x3dom.fields.SFVec2f(this.x - that.x, this.y - that.y);\n};\n\nx3dom.fields.SFVec2f.prototype.negate = function() {\n    return new x3dom.fields.SFVec2f(-this.x, -this.y);\n};\n\nx3dom.fields.SFVec2f.prototype.dot = function(that) {\n    return this.x * that.x + this.y * that.y;\n};\n\nx3dom.fields.SFVec2f.prototype.reflect = function(n) {\n    var d2 = this.dot(n) * 2;\n    return new x3dom.fields.SFVec2f(this.x - d2 * n.x, this.y - d2 * n.y);\n};\n\nx3dom.fields.SFVec2f.prototype.normalize = function() {\n    var n = this.length();\n    if (n) { n = 1.0 / n; }\n    return new x3dom.fields.SFVec2f(this.x * n, this.y * n);\n};\n\nx3dom.fields.SFVec2f.prototype.multComponents = function(that) {\n    return new x3dom.fields.SFVec2f(this.x * that.x, this.y * that.y);\n};\n\nx3dom.fields.SFVec2f.prototype.multiply = function(n) {\n    return new x3dom.fields.SFVec2f(this.x * n, this.y * n);\n};\n\nx3dom.fields.SFVec2f.prototype.divideComponents = function(that) {\n    return new x3dom.fields.SFVec2f(this.x / that.x, this.y / that.y);\n};\n\nx3dom.fields.SFVec2f.prototype.divide = function(n) {\n    var denom = n ? (1.0 / n) : 1.0;\n    return new x3dom.fields.SFVec2f(this.x * denom, this.y * denom);\n};\n\nx3dom.fields.SFVec2f.prototype.equals = function(that, eps) {\n    return Math.abs(this.x - that.x) < eps &&\n        Math.abs(this.y - that.y) < eps;\n};\n\nx3dom.fields.SFVec2f.prototype.length = function() {\n    return Math.sqrt((this.x * this.x) + (this.y * this.y));\n};\n\nx3dom.fields.SFVec2f.prototype.toGL = function() {\n    return [this.x, this.y];\n};\n\nx3dom.fields.SFVec2f.prototype.toString = function() {\n    return this.x + \" \" + this.y;\n};\n\nx3dom.fields.SFVec2f.prototype.setValueByStr = function(str) {\n    var m = /^\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*$/.exec(str);\n    m = m || [0, 0, 0];\n    this.x = +m[1];\n    this.y = +m[2];\n    return this;\n};\n\n/**\n * SFVec3f constructor.\n *\n * @class Represents a SFVec3f\n */\nx3dom.fields.SFVec3f = function(x, y, z) {\n    if (arguments.length === 0) {\n        this.x = 0;\n        this.y = 0;\n        this.z = 0;\n    } else {\n        this.x = x;\n        this.y = y;\n        this.z = z;\n    }\n};\n\nx3dom.fields.SFVec3f.NullVector = new x3dom.fields.SFVec3f(0, 0, 0);\nx3dom.fields.SFVec3f.OneVector = new x3dom.fields.SFVec3f(1, 1, 1);\n\nx3dom.fields.SFVec3f.copy = function(v) {\n    return new x3dom.fields.SFVec3f(v.x, v.y, v.z);\n};\n\nx3dom.fields.SFVec3f.MIN = function() {\n    return new x3dom.fields.SFVec3f(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);\n};\n\nx3dom.fields.SFVec3f.MAX = function() {\n    return new x3dom.fields.SFVec3f(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);\n};\n\nx3dom.fields.SFVec3f.parse = function(str) {\n    try {\n        var m = /^\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*$/.exec(str);\n        return new x3dom.fields.SFVec3f(+m[1], +m[2], +m[3]);\n    } catch (e) {\n        // allow automatic type conversion as is convenient for shaders\n        var c = x3dom.fields.SFColor.colorParse(str);\n        return new x3dom.fields.SFVec3f(c.r, c.g, c.b);\n    }\n};\n\nx3dom.fields.SFVec3f.prototype.copy = function() {\n    return x3dom.fields.SFVec3f.copy(this);\n};\n\nx3dom.fields.SFVec3f.prototype.fromArray = function(array) {\n    this.x = array[0];\n    this.y = array[1];\n    this.z = array[2];\n\n    return this;\n};\n\nx3dom.fields.SFVec3f.fromArray = function(array) {\n    return new x3dom.fields.SFVec3f(array[0],array[1],array[2]);\n};\n\nx3dom.fields.SFVec3f.prototype.setValues = function (that) {\n    this.x = that.x;\n    this.y = that.y;\n    this.z = that.z;\n};\n\nx3dom.fields.SFVec3f.prototype.set = function (x, y, z) {\n    this.x = x;\n    this.y = y;\n    this.z = z;\n};\n\nx3dom.fields.SFVec3f.prototype.at = function (i) {\n\tswitch(i) {\n\t    case 0:  return this.x;\n\t    case 1:  return this.y;\n\t    case 2:  return this.z;\n\t    default: return this.x;\n\t}\n};\n\nx3dom.fields.SFVec3f.prototype.add = function(that) {\n    return new x3dom.fields.SFVec3f(this.x + that.x, this.y + that.y, this.z + that.z);\n};\n\nx3dom.fields.SFVec3f.prototype.addScaled = function(that, s) {\n    return new x3dom.fields.SFVec3f(this.x + s * that.x, this.y + s * that.y, this.z + s * that.z);\n};\n\nx3dom.fields.SFVec3f.prototype.subtract = function(that) {\n    return new x3dom.fields.SFVec3f(this.x - that.x, this.y - that.y, this.z - that.z);\n};\n\nx3dom.fields.SFVec3f.prototype.subtractVectors = function (a, b) {\n    return new x3dom.fields.SFVec3f(a.x - b.x, a.y - b.y, a.z - b.z);\n};\n\nx3dom.fields.SFVec3f.prototype.negate = function() {\n    return new x3dom.fields.SFVec3f(-this.x, -this.y, -this.z);\n};\n\nx3dom.fields.SFVec3f.prototype.dot = function(that) {\n    return (this.x * that.x + this.y * that.y + this.z * that.z);\n};\n\nx3dom.fields.SFVec3f.prototype.cross = function(that) {\n    return new x3dom.fields.SFVec3f(this.y * that.z - this.z * that.y,\n        this.z * that.x - this.x * that.z,\n        this.x * that.y - this.y * that.x);\n};\n\nx3dom.fields.SFVec3f.prototype.reflect = function(n) {\n    var d2 = this.dot(n) * 2;\n    return new x3dom.fields.SFVec3f(this.x - d2 * n.x, this.y - d2 * n.y, this.z - d2 * n.z);\n};\n\nx3dom.fields.SFVec3f.prototype.length = function() {\n    return Math.sqrt((this.x * this.x) + (this.y * this.y) + (this.z * this.z));\n};\n\nx3dom.fields.SFVec3f.prototype.normalize = function() {\n    var n = this.length();\n    if (n) { n = 1.0 / n; }\n    return new x3dom.fields.SFVec3f(this.x * n, this.y * n, this.z * n);\n};\n\nx3dom.fields.SFVec3f.prototype.multComponents = function(that) {\n    return new x3dom.fields.SFVec3f(this.x * that.x, this.y * that.y, this.z * that.z);\n};\n\nx3dom.fields.SFVec3f.prototype.multiply = function(n) {\n    return new x3dom.fields.SFVec3f(this.x * n, this.y * n, this.z * n);\n};\n\nx3dom.fields.SFVec3f.prototype.divide = function(n) {\n    var denom = n ? (1.0 / n) : 1.0;\n    return new x3dom.fields.SFVec3f(this.x * denom, this.y * denom, this.z * denom);\n};\n\nx3dom.fields.SFVec3f.prototype.equals = function(that, eps) {\n    return Math.abs(this.x - that.x) < eps &&\n        Math.abs(this.y - that.y) < eps &&\n        Math.abs(this.z - that.z) < eps;\n};\n\nx3dom.fields.SFVec3f.prototype.toGL = function() {\n    return [this.x, this.y, this.z];\n};\n\nx3dom.fields.SFVec3f.prototype.toString = function() {\n    return this.x + \" \" + this.y + \" \" + this.z;\n};\n\nx3dom.fields.SFVec3f.prototype.setValueByStr = function(str) {\n    try {\n        var m = /^\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*$/.exec(str);\n        this.x = +m[1];\n        this.y = +m[2];\n        this.z = +m[3];\n    } catch (e) {\n        // allow automatic type conversion as is convenient for shaders\n        var c = x3dom.fields.SFColor.colorParse(str);\n        this.x = c.r;\n        this.y = c.g;\n        this.z = c.b;\n    }\n    return this;\n};\n\n/**\n * SFVec4f constructor.\n *\n * @class Represents a SFVec4f\n */\nx3dom.fields.SFVec4f = function(x, y, z, w) {\n    if (arguments.length === 0) {\n        this.x = 0;\n        this.y = 0;\n        this.z = 0;\n        this.w = 0;\n    } else {\n        this.x = x;\n        this.y = y;\n        this.z = z;\n        this.w = w;\n    }\n};\n\nx3dom.fields.SFVec4f.copy = function(v) {\n    return new x3dom.fields.SFVec4f(v.x, v.y, v.z, v.w);\n};\n\nx3dom.fields.SFVec4f.prototype.copy = function() {\n    return x3dom.fields.SFVec4f(this);\n};\n\nx3dom.fields.SFVec4f.parse = function(str) {\n    var m = /^\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*$/.exec(str);\n    if (m === null) return new x3dom.fields.SFVec4f();\n    return new x3dom.fields.SFVec4f(+m[1], +m[2], +m[3], +m[4]);\n};\n\nx3dom.fields.SFVec4f.prototype.setValueByStr = function(str) {\n    var m = /^\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*$/.exec(str);\n    m = m || [0, 0, 0, 0, 0];\n    this.x = +m[1];\n    this.y = +m[2];\n    this.z = +m[3];\n    this.w = +m[4];\n    return this;\n};\n\nx3dom.fields.SFVec4f.prototype.toGL = function() {\n    return [this.x, this.y, this.z, this.w];\n};\n\nx3dom.fields.SFVec4f.prototype.toString = function() {\n    return this.x + \" \" + this.y + \" \" + this.z + \" \" + this.w;\n};\n\n/**\n * Quaternion constructor.\n *\n * @class Represents a Quaternion\n */\nx3dom.fields.Quaternion = function(x, y, z, w) {\n    if (arguments.length === 0) {\n        this.x = 0;\n        this.y = 0;\n        this.z = 0;\n        this.w = 1;\n    } else {\n        this.x = x;\n        this.y = y;\n        this.z = z;\n        this.w = w;\n    }\n};\n\nx3dom.fields.Quaternion.copy = function(v) {\n    return new x3dom.fields.Quaternion(v.x, v.y, v.z, v.w);\n};\n\nx3dom.fields.Quaternion.prototype.multiply = function(that) {\n    return new x3dom.fields.Quaternion(\n        this.w * that.x + this.x * that.w + this.y * that.z - this.z * that.y,\n        this.w * that.y + this.y * that.w + this.z * that.x - this.x * that.z,\n        this.w * that.z + this.z * that.w + this.x * that.y - this.y * that.x,\n        this.w * that.w - this.x * that.x - this.y * that.y - this.z * that.z\n    );\n};\n\nx3dom.fields.Quaternion.prototype.fromArray = function(array) {\n    this.x = array[0];\n    this.y = array[1];\n    this.z = array[2];\n    this.w = array[3];\n\n    return this;\n};\n\nx3dom.fields.Quaternion.fromArray = function(array) {\n    return new x3dom.fields.Quaternion(array[0],array[1],array[2],array[3]);\n};\n\nx3dom.fields.Quaternion.parseAxisAngle = function(str) {\n    var m = /^\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*$/.exec(str);\n    if (m === null) return new x3dom.fields.Quaternion();\n\n    return x3dom.fields.Quaternion.axisAngle(new x3dom.fields.SFVec3f(+m[1], +m[2], +m[3]), +m[4]);\n};\n\nx3dom.fields.Quaternion.axisAngle = function(axis, a) {\n    var t = axis.length();\n\n    if (t > x3dom.fields.Eps) {\n        var s = Math.sin(a / 2) / t;\n        var c = Math.cos(a / 2);\n        return new x3dom.fields.Quaternion(axis.x * s, axis.y * s, axis.z * s, c);\n    } else {\n        return new x3dom.fields.Quaternion(0, 0, 0, 1);\n    }\n};\n\nx3dom.fields.Quaternion.prototype.copy = function() {\n    return x3dom.fields.Quaternion.copy(this);\n};\n\nx3dom.fields.Quaternion.prototype.toMatrix = function() {\n    var xx = this.x * this.x;\n    var xy = this.x * this.y;\n    var xz = this.x * this.z;\n    var yy = this.y * this.y;\n    var yz = this.y * this.z;\n    var zz = this.z * this.z;\n    var wx = this.w * this.x;\n    var wy = this.w * this.y;\n    var wz = this.w * this.z;\n\n    return new x3dom.fields.SFMatrix4f(\n        1 - 2 * (yy + zz), 2 * (xy - wz), 2 * (xz + wy), 0,\n        2 * (xy + wz), 1 - 2 * (xx + zz), 2 * (yz - wx), 0,\n        2 * (xz - wy), 2 * (yz + wx), 1 - 2 * (xx + yy), 0,\n        0, 0, 0, 1\n    );\n};\n\nx3dom.fields.Quaternion.prototype.toAxisAngle = function() {\n    var x = 0, y = 0, z = 0;\n    var s = 0, a = 0;\n\n    if (this.w > 1) {\n        this.normalize();\n    }\n\n    a = 2 * Math.acos(this.w);\n    s = Math.sqrt(1 - this.w * this.w);\n\n    if (s == 0) {  //< x3dom.fields.Eps )\n        x = this.x;\n        y = this.y;\n        z = this.z;\n    } else {\n        x = this.x / s;\n        y = this.y / s;\n        z = this.z / s;\n    }\n\n    return [new x3dom.fields.SFVec3f(x, y, z), a];\n};\n\nx3dom.fields.Quaternion.prototype.angle = function() {\n    return 2 * Math.acos(this.w);\n};\n\nx3dom.fields.Quaternion.prototype.setValue = function(matrix) {\n    var tr, s = 1;\n    var qt = [0, 0, 0];\n\n    var i = 0, j = 0, k = 0;\n    var nxt = [1, 2, 0];\n\n    tr = matrix._00 + matrix._11 + matrix._22;\n\n    if (tr > 0.0) {\n        s = Math.sqrt(tr + 1.0);\n\n        this.w = s * 0.5;\n\n        s = 0.5 / s;\n\n        this.x = (matrix._21 - matrix._12) * s;\n        this.y = (matrix._02 - matrix._20) * s;\n        this.z = (matrix._10 - matrix._01) * s;\n    } else {\n        if (matrix._11 > matrix._00) {\n            i = 1;\n        } else {\n            i = 0;\n        }\n\n        if (matrix._22 > matrix.at(i, i)) {\n            i = 2;\n        }\n\n        j = nxt[i];\n        k = nxt[j];\n\n        s = Math.sqrt(matrix.at(i, i) - (matrix.at(j, j) + matrix.at(k, k)) + 1.0);\n\n        qt[i] = s * 0.5;\n        s = 0.5 / s;\n\n        this.w = (matrix.at(k, j) - matrix.at(j, k)) * s;\n\n        qt[j] = (matrix.at(j, i) + matrix.at(i, j)) * s;\n        qt[k] = (matrix.at(k, i) + matrix.at(i, k)) * s;\n\n        this.x = qt[0];\n        this.y = qt[1];\n        this.z = qt[2];\n    }\n\n    if (this.w > 1.0 || this.w < -1.0) {\n        var errThreshold = 1 + (x3dom.fields.Eps * 100);\n\n        if (this.w > errThreshold || this.w < -errThreshold) {\n            // When copying, then everything, incl. the famous OpenSG MatToQuat bug\n            x3dom.debug.logInfo(\"MatToQuat: BUG: |quat[4]| (\" + this.w + \") >> 1.0 !\");\n        }\n\n        if (this.w > 1.0) {\n            this.w = 1.0;\n        } else {\n            this.w = -1.0;\n        }\n    }\n};\n\nx3dom.fields.Quaternion.prototype.setFromEuler = function(alpha, beta, gamma) {\n    var sx = Math.sin(alpha * 0.5);\n    var cx = Math.cos(alpha * 0.5);\n    var sy = Math.sin(beta * 0.5);\n    var cy = Math.cos(beta * 0.5);\n    var sz = Math.sin(gamma * 0.5);\n    var cz = Math.cos(gamma * 0.5);\n\n    this.x = (sx * cy * cz) - (cx * sy * sz);\n    this.y = (cx * sy * cz) + (sx * cy * sz);\n    this.z = (cx * cy * sz) - (sx * sy * cz);\n    this.w = (cx * cy * cz) + (sx * sy * sz);\n};\n\nx3dom.fields.Quaternion.prototype.dot = function(that) {\n    return this.x * that.x + this.y * that.y + this.z * that.z + this.w * that.w;\n};\n\nx3dom.fields.Quaternion.prototype.add = function(that) {\n    return new x3dom.fields.Quaternion(this.x + that.x, this.y + that.y, this.z + that.z, this.w + that.w);\n};\n\nx3dom.fields.Quaternion.prototype.subtract = function(that) {\n    return new x3dom.fields.Quaternion(this.x - that.x, this.y - that.y, this.z - that.z, this.w - that.w);\n};\n\nx3dom.fields.Quaternion.prototype.setValues = function(that) {\n    this.x = that.x;\n    this.y = that.y;\n    this.z = that.z;\n    this.w = that.w;\n};\n\nx3dom.fields.Quaternion.prototype.equals = function(that, eps) {\n    return (this.dot(that) >= 1.0 - eps);\n};\n\nx3dom.fields.Quaternion.prototype.multScalar = function(s) {\n    return new x3dom.fields.Quaternion(this.x * s, this.y * s, this.z * s, this.w * s);\n};\n\nx3dom.fields.Quaternion.prototype.normalize = function() {\n    var d2 = this.dot(this);\n    var id = 1.0;\n    if (d2) {\n        id = 1.0 / Math.sqrt(d2);\n    }\n\n    this.x *= id;\n    this.y *= id;\n    this.z *= id;\n    this.w *= id;\n\n    return this;\n};\n\nx3dom.fields.Quaternion.normalize = function(that) {\n    var d2 = that.dot(that);\n    var id = 1.0;\n    if (d2) {\n        id = 1.0 / Math.sqrt(d2);\n    }\n\n    that.x *= id;\n    that.y *= id;\n    that.z *= id;\n    that.w *= id;\n\n    return that;\n};\n\nx3dom.fields.Quaternion.prototype.negate = function() {\n    return new x3dom.fields.Quaternion(-this.x, -this.y, -this.z, -this.w);\n};\n\nx3dom.fields.Quaternion.prototype.inverse = function() {\n    return new x3dom.fields.Quaternion(-this.x, -this.y, -this.z, this.w);\n};\n\nx3dom.fields.Quaternion.prototype.slerp = function(that, t) {\n    // calculate the cosine\n    var cosom = this.dot(that);\n    var rot1;\n\n    // adjust signs if necessary\n    if (cosom < 0.0) {\n        cosom = -cosom;\n        rot1 = that.negate();\n    } else {\n        rot1 = new x3dom.fields.Quaternion(that.x, that.y, that.z, that.w);\n    }\n\n    // calculate interpolating coeffs\n    var scalerot0, scalerot1;\n\n    if ((1.0 - cosom) > 0.00001) {\n        // standard case\n        var omega = Math.acos(cosom);\n        var sinom = Math.sin(omega);\n        scalerot0 = Math.sin((1.0 - t) * omega) / sinom;\n        scalerot1 = Math.sin(t * omega) / sinom;\n    } else {\n        // rot0 and rot1 very close - just do linear interp.\n        scalerot0 = 1.0 - t;\n        scalerot1 = t;\n    }\n\n    // build the new quaternion\n    return this.multScalar(scalerot0).add(rot1.multScalar(scalerot1));\n};\n\nx3dom.fields.Quaternion.rotateFromTo = function(fromVec, toVec) {\n    var from = fromVec.normalize();\n    var to = toVec.normalize();\n    var cost = from.dot(to);\n\n    // check for degeneracies\n    if (cost > 0.99999) {\n        // vectors are parallel\n        return new x3dom.fields.Quaternion(0, 0, 0, 1);\n    } else if (cost < -0.99999) {\n        // vectors are opposite\n        // find an axis to rotate around, which should be\n        // perpendicular to the original axis\n        // Try cross product with (1,0,0) first, if that's one of our\n        // original vectors then try  (0,1,0).\n        var cAxis = new x3dom.fields.SFVec3f(1, 0, 0);\n\n        var tmp = from.cross(cAxis);\n\n        if (tmp.length() < 0.00001) {\n            cAxis.x = 0;\n            cAxis.y = 1;\n            cAxis.z = 0;\n\n            tmp = from.cross(cAxis);\n        }\n        tmp = tmp.normalize();\n\n        return x3dom.fields.Quaternion.axisAngle(tmp, Math.PI);\n    }\n\n    var axis = fromVec.cross(toVec);\n    axis = axis.normalize();\n\n    // use half-angle formulae\n    // sin^2 t = ( 1 - cos (2t) ) / 2\n    var s = Math.sqrt(0.5 * (1.0 - cost));\n    axis = axis.multiply(s);\n\n    // scale the axis by the sine of half the rotation angle to get\n    // the normalized quaternion\n    // cos^2 t = ( 1 + cos (2t) ) / 2\n    // w part is cosine of half the rotation angle\n    s = Math.sqrt(0.5 * (1.0 + cost));\n\n    return new x3dom.fields.Quaternion(axis.x, axis.y, axis.z, s);\n};\n\nx3dom.fields.Quaternion.prototype.toGL = function() {\n    var val = this.toAxisAngle();\n    return [val[0].x, val[0].y, val[0].z, val[1]];\n};\n\nx3dom.fields.Quaternion.prototype.toString = function() {\n    return this.x + \" \" + this.y + \" \" + this.z + \", \" + this.w;\n};\n\nx3dom.fields.Quaternion.prototype.setValueByStr = function(str) {\n    var m = /^\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*$/.exec(str);\n    m = m || [0, 1, 0, 0, 0];\n    var quat = x3dom.fields.Quaternion.axisAngle(new x3dom.fields.SFVec3f(+m[1], +m[2], +m[3]), +m[4]);\n    this.x = quat.x;\n    this.y = quat.y;\n    this.z = quat.z;\n    this.w = quat.w;\n    return this;\n};\n\nfunction _colorParse(str) {\n    var red = 0.0, green = 0.0, blue = 0.0;\n    var alpha = 1.0;\n\n    // Definition of CSS color names\n    var colorNames = {\n      aliceblue: '#f0f8ff',          antiquewhite: '#faebd7',         aqua: '#00ffff',\n      aquamarine: '#7fffd4',         azure: '#f0ffff',                beige: '#f5f5dc',\n      bisque: '#ffe4c4',             black: '#000000',                blanchedalmond: '#ffebcd',\n      blue: '#0000ff',               blueviolet: '#8a2be2',           brown: '#a52a2a',\n      burlywood: '#deb887',          cadetblue: '#5f9ea0',            chartreuse: '#7fff00',\n      chocolate: '#d2691e',          coral: '#ff7f50',                cornflowerblue: '#6495ed',\n      cornsilk: '#fff8dc',           crimson: '#dc143c',              cyan: '#00ffff',\n      darkblue: '#00008b',           darkcyan: '#008b8b',             darkgoldenrod: '#b8860b',\n      darkgray: '#a9a9a9',           darkgreen: '#006400',            darkkhaki: '#bdb76b',\n      darkmagenta: '#8b008b',        darkolivegreen: '#556b2f',       darkorange: '#ff8c00',\n      darkorchid: '#9932cc',         darkred: '#8b0000',              darksalmon: '#e9967a',\n      darkseagreen: '#8fbc8f',       darkslateblue: '#483d8b',        darkslategray: '#2f4f4f',\n      darkturquoise: '#00ced1',      darkviolet: '#9400d3',           deeppink: '#ff1493',\n      deepskyblue: '#00bfff',        dimgray: '#696969',              dodgerblue: '#1e90ff',\n      feldspar: '#d19275',           firebrick: '#b22222',            floralwhite: '#fffaf0',\n      forestgreen: '#228b22',        fuchsia: '#ff00ff',              gainsboro: '#dcdcdc',\n      ghostwhite: '#f8f8ff',         gold: '#ffd700',                 goldenrod: '#daa520',\n      gray: '#808080',               green: '#008000',                greenyellow: '#adff2f',\n      honeydew: '#f0fff0',           hotpink: '#ff69b4',              indianred : '#cd5c5c',\n      indigo : '#4b0082',            ivory: '#fffff0',                khaki: '#f0e68c',\n      lavender: '#e6e6fa',           lavenderblush: '#fff0f5',        lawngreen: '#7cfc00',\n      lemonchiffon: '#fffacd',       lightblue: '#add8e6',            lightcoral: '#f08080',\n      lightcyan: '#e0ffff',          lightgoldenrodyellow: '#fafad2', lightgrey: '#d3d3d3',\n      lightgreen: '#90ee90',         lightpink: '#ffb6c1',            lightsalmon: '#ffa07a',\n      lightseagreen: '#20b2aa',      lightskyblue: '#87cefa',         lightslateblue: '#8470ff',\n      lightslategray: '#778899',     lightsteelblue: '#b0c4de',       lightyellow: '#ffffe0',\n      lime: '#00ff00',               limegreen: '#32cd32',            linen: '#faf0e6',\n      magenta: '#ff00ff',            maroon: '#800000',               mediumaquamarine: '#66cdaa',\n      mediumblue: '#0000cd',         mediumorchid: '#ba55d3',         mediumpurple: '#9370d8',\n      mediumseagreen: '#3cb371',     mediumslateblue: '#7b68ee',      mediumspringgreen: '#00fa9a',\n      mediumturquoise: '#48d1cc',    mediumvioletred: '#c71585',      midnightblue: '#191970',\n      mintcream: '#f5fffa',          mistyrose: '#ffe4e1',            moccasin: '#ffe4b5',\n      navajowhite: '#ffdead',        navy: '#000080',                 oldlace: '#fdf5e6',\n      olive: '#808000',              olivedrab: '#6b8e23',            orange: '#ffa500',\n      orangered: '#ff4500',          orchid: '#da70d6',               palegoldenrod: '#eee8aa',\n      palegreen: '#98fb98',          paleturquoise: '#afeeee',        palevioletred: '#d87093',\n      papayawhip: '#ffefd5',         peachpuff: '#ffdab9',            peru: '#cd853f',\n      pink: '#ffc0cb',               plum: '#dda0dd',                 powderblue: '#b0e0e6',\n      purple: '#800080',             red: '#ff0000',                  rosybrown: '#bc8f8f',\n      royalblue: '#4169e1',          saddlebrown: '#8b4513',          salmon: '#fa8072',\n      sandybrown: '#f4a460',         seagreen: '#2e8b57',             seashell: '#fff5ee',\n      sienna: '#a0522d',             silver: '#c0c0c0',               skyblue: '#87ceeb',\n      slateblue: '#6a5acd',          slategray: '#708090',            snow: '#fffafa',\n      springgreen: '#00ff7f',        steelblue: '#4682b4',            tan: '#d2b48c',\n      teal: '#008080',               thistle: '#d8bfd8',              tomato: '#ff6347',\n      turquoise: '#40e0d0',          violet: '#ee82ee',               violetred: '#d02090',\n      wheat: '#f5deb3',              white: '#ffffff',                whitesmoke: '#f5f5f5',\n      yellow: '#ffff00',             yellowgreen: '#9acd32'\n    };\n\n    // Matches CSS rgb() function\n    var rgbMatch = /^rgb\\((\\d{1,3}),\\s{0,1}(\\d{1,3}),\\s{0,1}(\\d{1,3})\\)$/.exec(str);\n    if (rgbMatch !== null) {\n        red   = rgbMatch[1] / 255.0;\n        green = rgbMatch[2] / 255.0;\n        blue  = rgbMatch[3] / 255.0;\n    }\n\n    // Matches CSS rgba() function\n    var rgbaMatch = /^rgba\\((\\d{1,3}),\\s{0,1}(\\d{1,3}),\\s{0,1}(\\d{1,3}),(0+\\.?\\d*|1\\.?0*)\\)$/.exec(str);\n    if (rgbaMatch !== null) {\n        red   = rgbaMatch[1] / 255.0;\n        green = rgbaMatch[2] / 255.0;\n        blue  = rgbaMatch[3] / 255.0;\n        alpha = +rgbaMatch[4];\n    }\n\n    // Matches CSS color name\n    if (colorNames[str]) {\n        str = colorNames[str];\n    }\n\n    // Hexadecimal color codes\n    if (str.substr && str.substr(0, 1) === \"#\") {\n        var hex = str.substr(1);\n        var len = hex.length;\n\n        if (len === 8) {\n            red   = parseInt(\"0x\" + hex.substr(0, 2), 16) / 255.0;\n            green = parseInt(\"0x\" + hex.substr(2, 2), 16) / 255.0;\n            blue  = parseInt(\"0x\" + hex.substr(4, 2), 16) / 255.0;\n            alpha = parseInt(\"0x\" + hex.substr(6, 2), 16) / 255.0;\n        } else if (len === 6) {\n            red   = parseInt(\"0x\" + hex.substr(0, 2), 16) / 255.0;\n            green = parseInt(\"0x\" + hex.substr(2, 2), 16) / 255.0;\n            blue  = parseInt(\"0x\" + hex.substr(4, 2), 16) / 255.0;\n        } else if (len === 4) {\n            red   = parseInt(\"0x\" + hex.substr(0, 1), 16) / 15.0;\n            green = parseInt(\"0x\" + hex.substr(1, 1), 16) / 15.0;\n            blue  = parseInt(\"0x\" + hex.substr(2, 1), 16) / 15.0;\n            alpha = parseInt(\"0x\" + hex.substr(3, 1), 16) / 15.0;\n        } else if (len === 3) {\n            red   = parseInt(\"0x\" + hex.substr(0, 1), 16) / 15.0;\n            green = parseInt(\"0x\" + hex.substr(1, 1), 16) / 15.0;\n            blue  = parseInt(\"0x\" + hex.substr(2, 1), 16) / 15.0;\n        }\n    }\n\n    return { r: red, g: green, b: blue, a: alpha };\n}\n\n/**\n * SFColor constructor.\n *\n * @class Represents a SFColor\n */\nx3dom.fields.SFColor = function(r, g, b) {\n    if (arguments.length === 0) {\n        this.r = 0;\n        this.g = 0;\n        this.b = 0;\n    } else {\n        this.r = r;\n        this.g = g;\n        this.b = b;\n    }\n};\n\nx3dom.fields.SFColor.parse = function(str) {\n    try {\n        var m = /^\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*$/.exec(str);\n        return new x3dom.fields.SFColor(+m[1], +m[2], +m[3]);\n    }\n    catch (e) {\n        return x3dom.fields.SFColor.colorParse(str);\n    }\n};\n\nx3dom.fields.SFColor.copy = function(that) {\n    return new x3dom.fields.SFColor(that.r, that.g, that.b);\n};\n\nx3dom.fields.SFColor.prototype.copy = function() {\n    return x3dom.fields.SFColor.copy(this);\n};\n\nx3dom.fields.SFColor.prototype.setHSV = function(h, s, v) {\n    x3dom.debug.logWarning(\"SFColor.setHSV() NYI\");\n};\n\nx3dom.fields.SFColor.prototype.getHSV = function() {\n    var h = 0, s = 0, v = 0;\n    x3dom.debug.logWarning(\"SFColor.getHSV() NYI\");\n    return [h, s, v];\n};\n\nx3dom.fields.SFColor.prototype.setValues = function(color) {\n    this.r = color.r;\n    this.g = color.g;\n    this.b = color.b;\n};\n\nx3dom.fields.SFColor.prototype.equals = function(that, eps) {\n    return Math.abs(this.r - that.r) < eps &&\n        Math.abs(this.g - that.g) < eps &&\n        Math.abs(this.b - that.b) < eps;\n};\n\nx3dom.fields.SFColor.prototype.add = function(that) {\n    return new x3dom.fields.SFColor(this.r + that.r, this.g + that.g, this.b + that.b);\n};\n\nx3dom.fields.SFColor.prototype.subtract = function(that) {\n    return new x3dom.fields.SFColor(this.r - that.r, this.g - that.g, this.b - that.b);\n};\n\nx3dom.fields.SFColor.prototype.multiply = function(n) {\n    return new x3dom.fields.SFColor(this.r * n, this.g * n, this.b * n);\n};\n\nx3dom.fields.SFColor.prototype.toGL = function() {\n    return [this.r, this.g, this.b];\n};\n\nx3dom.fields.SFColor.prototype.toString = function() {\n    return this.r + \" \" + this.g + \" \" + this.b;\n};\n\nx3dom.fields.SFColor.prototype.setValueByStr = function(str) {\n    try {\n        var m = /^\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*$/.exec(str);\n        this.r = +m[1];\n        this.g = +m[2];\n        this.b = +m[3];\n    } catch (e) {\n        var c = x3dom.fields.SFColor.colorParse(str);\n        this.r = c.r;\n        this.g = c.g;\n        this.b = c.b;\n    }\n    return this;\n};\n\nx3dom.fields.SFColor.colorParse = function(color) {\n    var rgb = _colorParse(color);\n    return new x3dom.fields.SFColor(rgb.r, rgb.g, rgb.b);\n};\n\n/**\n * SFColorRGBA constructor.\n *\n * @class Represents a SFColorRGBA\n */\nx3dom.fields.SFColorRGBA = function(r, g, b, a) {\n    if (arguments.length === 0) {\n        this.r = 0;\n        this.g = 0;\n        this.b = 0;\n        this.a = 1;\n    } else {\n        this.r = r;\n        this.g = g;\n        this.b = b;\n        this.a = a;\n    }\n};\n\nx3dom.fields.SFColorRGBA.parse = function(str) {\n    try {\n        var m = /^([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)$/.exec(str);\n        return new x3dom.fields.SFColorRGBA(+m[1], +m[2], +m[3], +m[4]);\n    }\n    catch (e) {\n        return x3dom.fields.SFColorRGBA.colorParse(str);\n    }\n};\n\nx3dom.fields.SFColorRGBA.copy = function(that) {\n    return new x3dom.fields.SFColorRGBA(that.r, that.g, that.b, that.a);\n};\n\nx3dom.fields.SFColorRGBA.prototype.copy = function() {\n    return x3dom.fields.SFColorRGBA.copy(this);\n};\n\nx3dom.fields.SFColorRGBA.prototype.setValues = function(color) {\n    this.r = color.r;\n    this.g = color.g;\n    this.b = color.b;\n    this.a = color.a;\n};\n\nx3dom.fields.SFColorRGBA.prototype.equals = function(that, eps) {\n    return Math.abs(this.r - that.r) < eps &&\n           Math.abs(this.g - that.g) < eps &&\n           Math.abs(this.b - that.b) < eps &&\n           Math.abs(this.a - that.a) < eps;\n};\n\nx3dom.fields.SFColorRGBA.prototype.toGL = function() {\n    return [this.r, this.g, this.b, this.a];\n};\n\nx3dom.fields.SFColorRGBA.prototype.toString = function() {\n    return this.r + \" \" + this.g + \" \" + this.b + \" \" + this.a;\n};\n\nx3dom.fields.SFColorRGBA.prototype.setValueByStr = function(str) {\n    try {\n        var m = /^([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)\\s*,?\\s*([+\\-]?\\d*\\.*\\d*[eE]?[+\\-]?\\d*?)$/.exec(str);\n        this.r = +m[1];\n        this.g = +m[2];\n        this.b = +m[3];\n        this.a = +m[4];\n    } catch (e) {\n        var c = x3dom.fields.SFColorRGBA.colorParse(str);\n        this.r = c.r;\n        this.g = c.g;\n        this.b = c.b;\n        this.a = c.a;\n    }\n\n    return this;\n};\n\nx3dom.fields.SFColorRGBA.prototype.toUint = function() {\n    return ((Math.round(this.r * 255) << 24) |\n        (Math.round(this.g * 255) << 16) |\n        (Math.round(this.b * 255) << 8) |\n        Math.round(this.a * 255)) >>> 0;\n};\n\nx3dom.fields.SFColorRGBA.colorParse = function(color) {\n    var rgba = _colorParse(color);\n    return new x3dom.fields.SFColorRGBA(rgba.r, rgba.g, rgba.b, rgba.a);\n};\n\n/**\n * SFImage constructor.\n *\n * @class Represents an SFImage\n */\nx3dom.fields.SFImage = function(w, h, c, arr) {\n    if (arguments.length === 0 || !(arr && arr.map)) {\n        this.width = 0;\n        this.height = 0;\n        this.comp = 0;\n        this.array = [];\n    } else {\n        this.width = w;\n        this.height = h;\n        this.comp = c;\n        var that = this.array;\n        arr.map(function(v) { that.push(v); }, this.array);\n    }\n};\n\nx3dom.fields.SFImage.parse = function(str) {\n    var img = new x3dom.fields.SFImage();\n    img.setValueByStr(str);\n    return img;\n};\n\nx3dom.fields.SFImage.copy = function(that) {\n    var destination = new x3dom.fields.SFImage();\n    destination.width = that.width;\n    destination.height = that.height;\n    destination.comp = that.comp;\n    // use instead slice?\n    // destination.array = that.array.slice();\n    destination.setPixels(that.getPixels());\n    return destination;\n};\n\nx3dom.fields.SFImage.prototype.copy = function() {\n    return x3dom.fields.SFImage.copy(this);\n};\n\nx3dom.fields.SFImage.prototype.setValueByStr = function(str) {\n    var mc = str.match(/(\\w+)/g);\n    var n = mc.length;\n    \n    this.array = [];\n\n    if (n > 2) {\n        this.width = +mc[0];\n        this.height = +mc[1];\n        this.comp = +mc[2];\n    } else {\n        this.width = 0;\n        this.height = 0;\n        this.comp = 0;\n        return;\n    }\n\n    var len, i;\n    var r, g, b, a;\n    var radix = 10;\n    \n    for (i = 3; i < n; i++) {\n        if (!mc[i].substr) continue;\n\n        if (mc[i].substr(1, 1).toLowerCase() === \"x\") radix = 16;\n        // Maybe optimize by directly parsing value!\n        var inp = parseInt(mc[i], radix);\n\t// just coercing should also work:\n\t// var inp = mc[i];\n        // check for NaN ?\n        if (this.comp === 1) {\n            r = inp & 255;\n            this.array.push(r);\n        } else if (this.comp === 2) {\n            r = inp >> 8 & 255;\n            g = inp & 255;\n            this.array.push(r, g);\n        } else if (this.comp === 3) {\n            r = inp >> 16 & 255;\n            g = inp >> 8 & 255;\n            b = inp & 255;\n            this.array.push(r, g, b);\n        } else if (this.comp === 4) {\n            r = inp >> 24 & 255;\n            g = inp >> 16 & 255;\n            b = inp >> 8 & 255;\n            a = inp & 255;\n            this.array.push(r, g, b, a);\n        }\n    }\n};\n\nx3dom.fields.SFImage.prototype.setPixel = function(x, y, color) {\n    var startIdx = (y * this.width + x) * this.comp;\n\n    if (this.comp === 1 && startIdx < this.array.length) {\n        this.array[startIdx] = color.r * 255;\n    } else if (this.comp === 2 && (startIdx + 1) < this.array.length) {\n        this.array[startIdx] = color.r * 255;\n        this.array[startIdx + 1] = color.g * 255;\n    } else if (this.comp === 3 && (startIdx + 2) < this.array.length) {\n        this.array[startIdx] = color.r * 255;\n        this.array[startIdx + 1] = color.g * 255;\n        this.array[startIdx + 2] = color.b * 255;\n    } else if (this.comp === 4 && (startIdx + 3) < this.array.length) {\n        this.array[startIdx] = color.r * 255;\n        this.array[startIdx + 1] = color.g * 255;\n        this.array[startIdx + 2] = color.b * 255;\n        this.array[startIdx + 3] = color.a * 255;\n    }\n};\n\nx3dom.fields.SFImage.prototype.getPixel = function(x, y) {\n    var startIdx = (y * this.width + x) * this.comp;\n\n    if (this.comp === 1 && startIdx < this.array.length) {\n        return new x3dom.fields.SFColorRGBA(this.array[startIdx] / 255,\n            0,\n            0,\n            1);\n    } else if (this.comp === 2 && (startIdx + 1) < this.array.length) {\n        return new x3dom.fields.SFColorRGBA(this.array[startIdx] / 255,\n            this.array[startIdx + 1] / 255,\n            0,\n            1);\n    } else if (this.comp === 3 && (startIdx + 2) < this.array.length) {\n        return new x3dom.fields.SFColorRGBA(this.array[startIdx] / 255,\n            this.array[startIdx + 1] / 255,\n            this.array[startIdx + 2] / 255,\n            1);\n    } else if (this.comp === 4 && (startIdx + 3) < this.array.length) {\n        return new x3dom.fields.SFColorRGBA(this.array[startIdx] / 255,\n            this.array[startIdx + 1] / 255,\n            this.array[startIdx + 2] / 255,\n            this.array[startIdx + 3] / 255);\n    }\n};\n\nx3dom.fields.SFImage.prototype.setPixels = function(pixels) {\n    var i, idx = 0;\n\n    if (this.comp === 1) {\n        for (i = 0; i < pixels.length; i++) {\n            this.array[idx++] = pixels[i].r * 255;\n        }\n    } else if (this.comp === 2) {\n        for (i = 0; i < pixels.length; i++) {\n            this.array[idx++] = pixels[i].r * 255;\n            this.array[idx++] = pixels[i].g * 255;\n        }\n    } else if (this.comp === 3) {\n        for (i = 0; i < pixels.length; i++) {\n            this.array[idx++] = pixels[i].r * 255;\n            this.array[idx++] = pixels[i].g * 255;\n            this.array[idx++] = pixels[i].b * 255;\n        }\n    } else if (this.comp === 4) {\n        for (i = 0; i < pixels.length; i++) {\n            this.array[idx++] = pixels[i].r * 255;\n            this.array[idx++] = pixels[i].g * 255;\n            this.array[idx++] = pixels[i].b * 255;\n            this.array[idx++] = pixels[i].a * 255;\n        }\n    }\n};\n\nx3dom.fields.SFImage.prototype.getPixels = function() {\n    var i;\n    var pixels = [];\n\n    if (this.comp === 1) {\n        for (i = 0; i < this.array.length; i += this.comp) {\n            pixels.push(new x3dom.fields.SFColorRGBA(this.array[i] / 255,\n                0,\n                0,\n                1));\n        }\n    } else if (this.comp === 2) {\n        for (i = 0; i < this.array.length; i += this.comp) {\n            pixels.push(new x3dom.fields.SFColorRGBA(this.array[i] / 255,\n                this.array[i + 1] / 255,\n                0,\n                1));\n        }\n    } else if (this.comp === 3) {\n        for (i = 0; i < this.array.length; i += this.comp) {\n            pixels.push(new x3dom.fields.SFColorRGBA(this.array[i] / 255,\n                this.array[i + 1] / 255,\n                this.array[i + 2] / 255,\n                1));\n        }\n    } else if (this.comp === 4) {\n        for (i = 0; i < this.array.length; i += this.comp) {\n            pixels.push(new x3dom.fields.SFColorRGBA(this.array[i] / 255,\n                this.array[i + 1] / 255,\n                this.array[i + 2] / 255,\n                this.array[i + 3] / 255));\n        }\n    }\n\n    return pixels;\n};\n\nx3dom.fields.SFImage.prototype.toGL = function() {\n    var a = [];\n\n    Array.map(this.array, function(c) {\n        a.push(c);\n    });\n\n    return a;\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Multi-Field Definitions\n///////////////////////////////////////////////////////////////////////////////\n\n/**\n * MFColor constructor.\n * @class Represents a MFColor\n */\nx3dom.fields.MFColor = function(colorArray) {\n\n    if (colorArray) {\n        var that = this;\n        colorArray.map(function(c) { that.push(c); }, this);\n    }\n};\n\nx3dom.fields.MFColor.copy = function(colorArray) {\n    var destination = new x3dom.fields.MFColor();\n    colorArray.map(function(v) { destination.push(v.copy()); }, this);\n    return destination;\n};\n\nx3dom.fields.MFColor.prototype = x3dom.extend([]);\n\nx3dom.fields.MFColor.parse = function(str) {\n    var mc = str.match(/([+\\-0-9eE\\.]+)/g);\n    var colors = [];\n    for (var i = 0, n = mc ? mc.length : 0; i < n; i += 3) {\n        colors.push(new x3dom.fields.SFColor(+mc[i + 0], +mc[i + 1], +mc[i + 2]));\n    }\n\n    return new x3dom.fields.MFColor(colors);\n};\n\nx3dom.fields.MFColor.prototype.copy = function() {\n    return x3dom.fields.MFColor.copy(this);\n};\n\nx3dom.fields.MFColor.prototype.setValueByStr = function(str) {\n    this.length = 0;\n    var mc = str.match(/([+\\-0-9eE\\.]+)/g);\n    for (var i = 0, n = mc ? mc.length : 0; i < n; i += 3) {\n        this.push(new x3dom.fields.SFColor(+mc[i + 0], +mc[i + 1], +mc[i + 2]));\n    }\n};\n\nx3dom.fields.MFColor.prototype.toGL = function() {\n    var a = [];\n\n    Array.map(this, function(c) {\n        a.push(c.r);\n        a.push(c.g);\n        a.push(c.b);\n    });\n\n    return a;\n};\n\n/**\n * MFColorRGBA constructor.\n *\n * @class Represents a MFColorRGBA\n */\nx3dom.fields.MFColorRGBA = function(colorArray) {\n    if (colorArray) {\n        var that = this;\n        colorArray.map(function(c) { that.push(c); }, this);\n    }\n};\n\nx3dom.fields.MFColorRGBA.copy = function(colorArray) {\n    var destination = new x3dom.fields.MFColorRGBA();\n    colorArray.map(function(v) { destination.push(v.copy()); }, this);\n    return destination;\n};\n\nx3dom.fields.MFColorRGBA.prototype = x3dom.extend([]);\n\nx3dom.fields.MFColorRGBA.parse = function(str) {\n    var mc = str.match(/([+\\-0-9eE\\.]+)/g);\n    var colors = [];\n    for (var i = 0, n = mc ? mc.length : 0; i < n; i += 4) {\n        colors.push(new x3dom.fields.SFColorRGBA(+mc[i + 0], +mc[i + 1], +mc[i + 2], +mc[i + 3]));\n    }\n\n    return new x3dom.fields.MFColorRGBA(colors);\n};\n\nx3dom.fields.MFColorRGBA.prototype.copy = function() {\n    return x3dom.fields.MFColorRGBA.copy(this);\n};\n\nx3dom.fields.MFColorRGBA.prototype.setValueByStr = function(str) {\n    this.length = 0;\n    var mc = str.match(/([+\\-0-9eE\\.]+)/g);\n    for (var i = 0, n = mc ? mc.length : 0; i < n; i += 4) {\n        this.push(new x3dom.fields.SFColorRGBA(+mc[i + 0], +mc[i + 1], +mc[i + 2], +mc[i + 3]));\n    }\n};\n\nx3dom.fields.MFColorRGBA.prototype.toGL = function() {\n    var a = [];\n\n    Array.map(this, function(c) {\n        a.push(c.r);\n        a.push(c.g);\n        a.push(c.b);\n        a.push(c.a);\n    });\n\n    return a;\n};\n\n/**\n * MFRotation constructor.\n *\n * @class Represents a MFRotation\n */\nx3dom.fields.MFRotation = function(rotArray) {\n    if (rotArray) {\n        var that = this;\n        rotArray.map(function(v) { that.push(v); }, this);\n    }\n};\n\nx3dom.fields.MFRotation.prototype = x3dom.extend([]);\n\nx3dom.fields.MFRotation.copy = function(rotationArray) {\n    var destination = new x3dom.fields.MFRotation();\n    rotationArray.map(function(v) { destination.push(v.copy()); }, this);\n    return destination;\n};\n\nx3dom.fields.MFRotation.prototype.copy = function() {\n    return x3dom.fields.MFRotation.copy(this);\n};\n\nx3dom.fields.MFRotation.parse = function(str) {\n    var mc = str.match(/([+\\-0-9eE\\.]+)/g);\n    var vecs = [];\n    for (var i = 0, n = mc ? mc.length : 0; i < n; i += 4) {\n        vecs.push(x3dom.fields.Quaternion.axisAngle(new x3dom.fields.SFVec3f(+mc[i + 0], +mc[i + 1], +mc[i + 2]), +mc[i + 3]));\n    }\n\n    // holds the quaternion representation as needed by interpolators etc.\n    return new x3dom.fields.MFRotation(vecs);\n};\n\nx3dom.fields.MFRotation.prototype.setValueByStr = function(str) {\n    this.length = 0;\n    var mc = str.match(/([+\\-0-9eE\\.]+)/g);\n    for (var i = 0, n = mc ? mc.length : 0; i < n; i += 4) {\n        this.push(x3dom.fields.Quaternion.axisAngle(new x3dom.fields.SFVec3f(+mc[i + 0], +mc[i + 1], +mc[i + 2]), +mc[i + 3]));\n    }\n};\n\nx3dom.fields.MFRotation.prototype.toGL = function() {\n    var a = [];\n\n    Array.map(this, function(c) {\n        var val = c.toAxisAngle();\n        a.push(val[0].x);\n        a.push(val[0].y);\n        a.push(val[0].z);\n        a.push(val[1]);\n    });\n\n    return a;\n};\n\n/**\n * MFVec3f constructor.\n *\n * @class Represents a MFVec3f\n */\nx3dom.fields.MFVec3f = function(vec3Array) {\n    if (vec3Array) {\n        var that = this;\n        vec3Array.map(function(v) { that.push(v); }, this);\n    }\n};\n\nx3dom.fields.MFVec3f.prototype = x3dom.extend(Array);\n\nx3dom.fields.MFVec3f.copy = function(vec3Array) {\n    var destination = new x3dom.fields.MFVec3f();\n    vec3Array.map(function(v) { destination.push(v.copy()); }, this);\n    return destination;\n};\n\nx3dom.fields.MFVec3f.parse = function(str) {\n    var mc = str.match(/([+\\-0-9eE\\.]+)/g);\n    var vecs = [];\n    for (var i = 0, n = mc ? mc.length : 0; i < n; i += 3) {\n        vecs.push(new x3dom.fields.SFVec3f(+mc[i + 0], +mc[i + 1], +mc[i + 2]));\n    }\n\n    return new x3dom.fields.MFVec3f(vecs);\n};\n\nx3dom.fields.MFVec3f.prototype.copy = function() {\n    return x3dom.fields.MFVec3f.copy(this);\n};\n\nx3dom.fields.MFVec3f.prototype.setValueByStr = function(str) {\n    this.length = 0;\n    var mc = str.match(/([+\\-0-9eE\\.]+)/g);\n    for (var i = 0, n = mc ? mc.length : 0; i < n; i += 3) {\n        this.push(new x3dom.fields.SFVec3f(+mc[i + 0], +mc[i + 1], +mc[i + 2]));\n    }\n};\n\nx3dom.fields.MFVec3f.prototype.setValues = function(vec3Array) {\n    var i,\n        n = Math.min(vec3Array.length, this.length);\n\n    for (i=0; i<n; i++) {\n        this[i].setValues( vec3Array[i] )\n    }\n};\n\nx3dom.fields.MFVec3f.prototype.toGL = function() {\n    var a = [];\n\n    Array.map(this, function(c) {\n        a.push(c.x);\n        a.push(c.y);\n        a.push(c.z);\n    });\n\n    return a;\n};\n\nx3dom.fields.MFVec3f.prototype.toString = function() {\n    var str = \"\";\n\n    this.forEach(function(sf) {\n        str = str + sf.toString() + \" \";\n    });\n    return str.trim();\n};\n\n/**\n * MFVec2f constructor.\n *\n * @class Represents a MFVec2f\n */\nx3dom.fields.MFVec2f = function(vec2Array) {\n    if (vec2Array) {\n        var that = this;\n        vec2Array.map(function(v) { that.push(v); }, this);\n    }\n};\n\nx3dom.fields.MFVec2f.prototype = x3dom.extend([]);\n\nx3dom.fields.MFVec2f.copy = function(vec2Array) {\n    var destination = new x3dom.fields.MFVec2f();\n    vec2Array.map(function(v) { destination.push(v.copy()); }, this);\n    return destination;\n};\n\nx3dom.fields.MFVec2f.parse = function(str) {\n    var mc = str.match(/([+\\-0-9eE\\.]+)/g);\n    var vecs = [];\n    for (var i = 0, n = mc ? mc.length : 0; i < n; i += 2) {\n        vecs.push(new x3dom.fields.SFVec2f(+mc[i + 0], +mc[i + 1]));\n    }\n\n    return new x3dom.fields.MFVec2f(vecs);\n};\n\nx3dom.fields.MFVec2f.prototype.copy = function() {\n    return x3dom.fields.MFVec2f.copy(this);\n};\n\nx3dom.fields.MFVec2f.prototype.setValueByStr = function(str) {\n    this.length = 0;\n    var mc = str.match(/([+\\-0-9eE\\.]+)/g);\n    for (var i = 0, n = mc ? mc.length : 0; i < n; i += 2) {\n        this.push(new x3dom.fields.SFVec2f(+mc[i + 0], +mc[i + 1]));\n    }\n};\n\nx3dom.fields.MFVec2f.prototype.toGL = function() {\n    var a = [];\n\n    Array.map(this, function(v) {\n        a.push(v.x);\n        a.push(v.y);\n    });\n\n    return a;\n};\n\n/**\n * MFInt32 constructor.\n *\n * @class Represents a MFInt32\n */\nx3dom.fields.MFInt32 = function(array) {\n    if (array) {\n        var that = this;\n        array.map(function(v) { that.push(v); }, this);\n    }\n};\n\nx3dom.fields.MFInt32.prototype = x3dom.extend([]);\n\nx3dom.fields.MFInt32.copy = function(intArray) {\n    var destination = new x3dom.fields.MFInt32();\n    intArray.map(function(v) { destination.push(v); }, this);\n    return destination;\n};\n\nx3dom.fields.MFInt32.parse = function(str) {\n    var mc = str.match(/([+\\-]?\\d+\\s*){1},?\\s*/g);\n    var vals = [];\n    for (var i = 0, n = mc ? mc.length : 0; i < n; ++i) {\n        vals.push(parseInt(mc[i], 10));\n    }\n\n    return new x3dom.fields.MFInt32(vals);\n};\n\nx3dom.fields.MFInt32.prototype.copy = function() {\n    return x3dom.fields.MFInt32.copy(this);\n};\n\nx3dom.fields.MFInt32.prototype.setValueByStr = function(str) {\n    this.length = 0;\n    var mc = str.match(/([+\\-]?\\d+\\s*){1},?\\s*/g);\n    for (var i = 0, n = mc ? mc.length : 0; i < n; ++i) {\n        this.push(parseInt(mc[i], 10));\n    }\n};\n\nx3dom.fields.MFInt32.prototype.toGL = function() {\n    var a = [];\n\n    Array.map(this, function(v) {\n        a.push(v);\n    });\n\n    return a;\n};\n\n/**\n * MFFloat constructor.\n *\n * @class Represents a MFFloat\n */\nx3dom.fields.MFFloat = function(array) {\n    if (array) {\n        var that = this;\n        array.map(function(v) { that.push(v); }, this);\n    }\n};\n\nx3dom.fields.MFFloat.prototype = x3dom.extend([]);\n\nx3dom.fields.MFFloat.copy = function(floatArray) {\n    var destination = new x3dom.fields.MFFloat();\n    floatArray.map(function(v) { destination.push(v); }, this);\n    return destination;\n};\n\nx3dom.fields.MFFloat.parse = function(str) {\n    var mc = str.match(/([+\\-0-9eE\\.]+)/g);\n    var vals = [];\n    for (var i = 0, n = mc ? mc.length : 0; i < n; i++) {\n        vals.push(+mc[i]);\n    }\n\n    return new x3dom.fields.MFFloat(vals);\n};\n\nx3dom.fields.MFFloat.prototype.copy = function() {\n    return x3dom.fields.MFFloat.copy(this);\n};\n\nx3dom.fields.MFFloat.prototype.setValueByStr = function(str) {\n    this.length = 0;\n    var mc = str.match(/([+\\-0-9eE\\.]+)/g);\n    for (var i = 0, n = mc ? mc.length : 0; i < n; i++) {\n        this.push(+mc[i]);\n    }\n};\n\nx3dom.fields.MFFloat.prototype.toGL = function() {\n    var a = [];\n\n    Array.map(this, function(v) {\n        a.push(v);\n    });\n\n    return a;\n};\n\n/**\n * MFBoolean constructor.\n *\n * @class Represents a MFBoolean\n */\nx3dom.fields.MFBoolean = function(array) {\n    if (array) {\n        var that = this;\n        array.map(function(v) { that.push(v); }, this);\n    }\n};\n\nx3dom.fields.MFBoolean.prototype = x3dom.extend([]);\n\nx3dom.fields.MFBoolean.copy = function(boolArray) {\n    var destination = new x3dom.fields.MFBoolean();\n    boolArray.map(function(v) { destination.push(v); }, this);\n    return destination;\n};\n\nx3dom.fields.MFBoolean.parse = function(str) {\n    var mc = str.match(/(true|false|1|0)/ig);\n    var vals = [];\n    for (var i = 0, n = mc ? mc.length : 0; i < n; i++) {\n        vals.push((mc[i] == '1' || mc[i].toLowerCase() == 'true'));\n    }\n\n    return new x3dom.fields.MFBoolean(vals);\n};\n\nx3dom.fields.MFBoolean.prototype.copy = function() {\n    return x3dom.fields.MFBoolean.copy(this);\n};\n\nx3dom.fields.MFBoolean.prototype.setValueByStr = function(str) {\n    this.length = 0;\n    var mc = str.match(/(true|false|1|0)/ig);\n    for (var i = 0, n = mc ? mc.length : 0; i < n; i++) {\n        this.push((mc[i] == '1' || mc[i].toLowerCase() == 'true'));\n    }\n};\n\nx3dom.fields.MFBoolean.prototype.toGL = function() {\n    var a = [];\n\n    Array.map(this, function(v) {\n        a.push(v ? 1 : 0);\n    });\n\n    return a;\n};\n\n/**\n * MFString constructor.\n *\n * @class Represents a MFString\n */\nx3dom.fields.MFString = function(strArray) {\n    if (strArray && strArray.map) {\n        var that = this;\n        strArray.map(function(v) { that.push(v); }, this);\n    }\n};\n\nx3dom.fields.MFString.prototype = x3dom.extend([]);\n\nx3dom.fields.MFString.copy = function(stringArray) {\n    var destination = new x3dom.fields.MFString();\n    stringArray.map(function(v) { destination.push(v); }, this);\n    return destination;\n};\n\nx3dom.fields.MFString.parse = function(str) {\n    var arr = [];\n    str = str.trim();\n    // ignore leading whitespace?\n    if (str.length && str[0] == '\"') {\n        var m, re = /\"((?:[^\\\\\"]|\\\\\\\\|\\\\\")*)\"/g;\n        while ((m = re.exec(str))) {\n            var s = m[1].replace(/\\\\([\\\\\"])/g, \"$1\");\n            if (s !== undefined) {\n                arr.push(s);\n            }\n        }\n    } else {\n        arr.push(str);\n    }\n    return new x3dom.fields.MFString(arr);\n};\n\nx3dom.fields.MFString.prototype.copy = function() {\n    return x3dom.fields.MFString.copy(this);\n};\n\nx3dom.fields.MFString.prototype.setValueByStr = function(str) {\n    this.length = 0;\n    // ignore leading whitespace?\n    if (str.length && str[0] == '\"') {\n        var m, re = /\"((?:[^\\\\\"]|\\\\\\\\|\\\\\")*)\"/g;\n        while ((m = re.exec(str))) {\n            var s = m[1].replace(/\\\\([\\\\\"])/, \"$1\");\n            if (s !== undefined) {\n                this.push(s);\n            }\n        }\n    } else {\n        this.push(str);\n    }\n    return this;\n};\n\nx3dom.fields.MFString.prototype.toString = function() {\n    var str = \"\";\n    for (var i = 0, n = this.length; i < n; i++) {\n        str = str + this[i] + \" \";\n    }\n    return str;\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Single-/Multi-Field Node Definitions\n///////////////////////////////////////////////////////////////////////////////\n\n/**\n * SFNode constructor.\n *\n * @class Represents a SFNode\n */\nx3dom.fields.SFNode = function(type) {\n    this.type = type;\n    this.node = null;\n};\n\nx3dom.fields.SFNode.prototype.hasLink = function(node) {\n    return (node ? (this.node === node) : this.node);\n};\n\nx3dom.fields.SFNode.prototype.addLink = function(node) {\n    this.node = node;\n    return true;\n};\n\nx3dom.fields.SFNode.prototype.rmLink = function(node) {\n    if (this.node === node) {\n        this.node = null;\n        return true;\n    } else {\n        return false;\n    }\n};\n\n/**\n * MFNode constructor.\n *\n * @class Represents a MFNode\n */\nx3dom.fields.MFNode = function(type) {\n    this.type = type;\n    this.nodes = [];\n};\n\nx3dom.fields.MFNode.prototype.hasLink = function(node) {\n    if (node) {\n        for (var i = 0, n = this.nodes.length; i < n; i++) {\n            if (this.nodes[i] === node) {\n                return true;\n            }\n        }\n    } else {\n        return (this.length > 0);\n    }\n    return false;\n};\n\nx3dom.fields.MFNode.prototype.addLink = function(node) {\n    this.nodes.push(node);\n    return true;\n};\n\nx3dom.fields.MFNode.prototype.rmLink = function(node) {\n    for (var i = 0, n = this.nodes.length; i < n; i++) {\n        if (this.nodes[i] === node) {\n            this.nodes.splice(i, 1);\n            return true;\n        }\n    }\n    return false;\n};\n\nx3dom.fields.MFNode.prototype.length = function() {\n    return this.nodes.length;\n};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// Math Helper Class Definitions\n///////////////////////////////////////////////////////////////////////////////\n\n/**\n * Line constructor.\n *\n * @param {SFVec3f} pos - anchor point of the line\n * @param {SFVec3f} dir - direction of the line, must be normalized\n * @class Represents a Line (as internal helper).\n *        A line has an origin and a vector that describes a direction, it is infinite in both directions.\n */\nx3dom.fields.Line = function(pos, dir) {\n    if (arguments.length === 0) {\n        this.pos = new x3dom.fields.SFVec3f(0, 0, 0);\n        this.dir = new x3dom.fields.SFVec3f(0, 0, 1);\n    }\n\n    this.pos = x3dom.fields.SFVec3f.copy(pos);\n    this.dir = x3dom.fields.SFVec3f.copy(dir);\n};\n\n/**\n * For a given point, this function returns the closest point on this line.\n *\n * @param p {x3dom.fields.SFVec3f} - the point\n * @returns {x3dom.fields.SFVec3f} the closest point\n */\nx3dom.fields.Line.prototype.closestPoint = function(p) {\n    var distVec = p.subtract(this.pos);\n\n    // project the distance vector on the line\n    var projDist = distVec.dot(this.dir);\n\n    return this.pos.add(this.dir.multiply(projDist));\n};\n\n/**\n * For a given point, this function returns the distance to the closest point on this line.\n *\n * @param p {x3dom.fields.SFVec3f} - the point\n * @returns {Number} the distance to the closest point\n */\nx3dom.fields.Line.prototype.shortestDistance = function(p) {\n    var distVec = p.subtract(this.pos);\n\n    // project the distance vector on the line\n    var projDist = distVec.dot(this.dir);\n\n    // subtract the projected distance vector, to obtain the part that is orthogonal to this line\n    return distVec.subtract(this.dir.multiply(projDist)).length();\n};\n\n\n/**\n * Ray constructor.\n *\n * @param {SFVec3f} pos - anchor point of the ray\n * @param {SFVec3f} dir - direction of the ray, must be normalized\n * @class Represents a Ray (as internal helper).\n *        A ray is a special line that extends to only one direction from its origin.\n */\nx3dom.fields.Ray = function(pos, dir) {\n    if (arguments.length === 0) {\n        this.pos = new x3dom.fields.SFVec3f(0, 0, 0);\n        this.dir = new x3dom.fields.SFVec3f(0, 0, 1);\n    } else {\n        this.pos = new x3dom.fields.SFVec3f(pos.x, pos.y, pos.z);\n\n        var n = dir.length();\n        if (n) { n = 1.0 / n; }\n\n        this.dir = new x3dom.fields.SFVec3f(dir.x * n, dir.y * n, dir.z * n);\n    }\n\n    this.enter = 0;\n    this.exit = 0;\n    this.hitObject = null;\n    this.hitPoint = {};\n    this.dist = Number.MAX_VALUE;\n};\n\nx3dom.fields.Ray.prototype.toString = function() {\n    return 'Ray: [' + this.pos.toString() + '; ' + this.dir.toString() + ']';\n};\n\n/**\n * Intersects this ray with a plane, defined by the given anchor point and normal.\n * The result returned is the point of intersection, if any. If no point of intersection exists, null is returned.\n * Null is also returned in case there is an infinite number of solutions (, i.e., if the ray origin lies in the plane).\n *\n * @param {x3dom.fields.SFVec3f} p - anchor point\n * @param {x3dom.fields.SFVec3f} n - plane normal\n * @returns {x3dom.fields.SFVec3f} the point of intersection, can be null\n */\nx3dom.fields.Ray.prototype.intersectPlane = function(p, n) {\n    var result = null;\n\n    var alpha; // ray parameter, should be computed\n\n    var nDotDir = n.dot(this.dir);\n\n    // if the ray hits the plane, the plane normal and ray direction must be facing each other\n    if (nDotDir < 0.0) {\n        alpha = (p.dot(n) - this.pos.dot(n)) / nDotDir;\n\n        result = this.pos.addScaled(this.dir, alpha);\n    }\n\n    return result;\n};\n\n/**\n * Intersect line with box volume given by low and high\n *\n * @param {number} low\n * @param {number} high\n */\nx3dom.fields.Ray.prototype.intersect = function(low, high) {\n    var isect = 0.0;\n    var out = Number.MAX_VALUE;\n    var r, te, tl;\n\n    if (this.dir.x > x3dom.fields.Eps) {\n        r = 1.0 / this.dir.x;\n\n        te = (low.x - this.pos.x) * r;\n        tl = (high.x - this.pos.x) * r;\n\n        if (tl < out) {\n            out = tl;\n        }\n\n        if (te > isect) {\n            isect = te;\n        }\n    } else if (this.dir.x < -x3dom.fields.Eps) {\n        r = 1.0 / this.dir.x;\n\n        te = (high.x - this.pos.x) * r;\n        tl = (low.x - this.pos.x) * r;\n\n        if (tl < out) {\n            out = tl;\n        }\n\n        if (te > isect) {\n            isect = te;\n        }\n    } else if (this.pos.x < low.x || this.pos.x > high.x) {\n        return false;\n    }\n\n    if (this.dir.y > x3dom.fields.Eps) {\n        r = 1.0 / this.dir.y;\n\n        te = (low.y - this.pos.y) * r;\n        tl = (high.y - this.pos.y) * r;\n\n        if (tl < out) {\n            out = tl;\n        }\n\n        if (te > isect) {\n            isect = te;\n        }\n\n        if (isect - out >= x3dom.fields.Eps) {\n            return false;\n        }\n    } else if (this.dir.y < -x3dom.fields.Eps) {\n        r = 1.0 / this.dir.y;\n\n        te = (high.y - this.pos.y) * r;\n        tl = (low.y - this.pos.y) * r;\n\n        if (tl < out) {\n            out = tl;\n        }\n\n        if (te > isect) {\n            isect = te;\n        }\n\n        if (isect - out >= x3dom.fields.Eps) {\n            return false;\n        }\n    } else if (this.pos.y < low.y || this.pos.y > high.y) {\n        return false;\n    }\n\n    if (this.dir.z > x3dom.fields.Eps) {\n        r = 1.0 / this.dir.z;\n\n        te = (low.z - this.pos.z) * r;\n        tl = (high.z - this.pos.z) * r;\n\n        if (tl < out) {\n            out = tl;\n        }\n\n        if (te > isect) {\n            isect = te;\n        }\n    } else if (this.dir.z < -x3dom.fields.Eps) {\n        r = 1.0 / this.dir.z;\n\n        te = (high.z - this.pos.z) * r;\n        tl = (low.z - this.pos.z) * r;\n\n        if (tl < out) {\n            out = tl;\n        }\n\n        if (te > isect) {\n            isect = te;\n        }\n    } else if (this.pos.z < low.z || this.pos.z > high.z) {\n        return false;\n    }\n\n    this.enter = isect;\n    this.exit = out;\n\n    return (isect - out < x3dom.fields.Eps);\n};\n\n/**\n * BoxVolume constructor.\n *\n * @class Represents a box volume (as internal helper).\n */\nx3dom.fields.BoxVolume = function(min, max) {\n    if (arguments.length < 2) {\n        this.min = new x3dom.fields.SFVec3f(0, 0, 0);\n        this.max = new x3dom.fields.SFVec3f(0, 0, 0);\n        this.valid = false;\n    } else {\n        // compiler enforced type check for min/max would be nice\n        this.min = x3dom.fields.SFVec3f.copy(min);\n        this.max = x3dom.fields.SFVec3f.copy(max);\n        this.valid = true;\n    }\n\n    this.updateInternals();\n};\n\n/**\n * Box Volume Get Scalar Value\n *\n * @returns {number}\n */\nx3dom.fields.BoxVolume.prototype.getScalarValue = function() {\n    var extent = this.max.subtract(this.min);\n\n    return (extent.x * extent.y * extent.z);\n};\n\n/**\n * Box Volume Copy\n *\n * @param other\n * @returns {x3dom.fields.BoxVolume}\n */\nx3dom.fields.BoxVolume.copy = function(other) {\n    var volume = new x3dom.fields.BoxVolume(other.min, other.max);\n    volume.valid = other.valid;\n    return volume;\n};\n\n/**\n * Box Volume Equals\n *\n * @param other\n * @returns {*}\n */\nx3dom.fields.BoxVolume.prototype.equals = function(other) {\n    return (this.min.equals(other.min, 0.000000000001) && this.max.equals(other.max, 0.000000000001));\n};\n\n/**\n * Box Volume Update Internals\n *\n */\nx3dom.fields.BoxVolume.prototype.updateInternals = function() {\n    this.radialVec = this.max.subtract(this.min).multiply(0.5);\n    this.center = this.min.add(this.radialVec);\n    this.diameter = 2 * this.radialVec.length();\n};\n\n/**\n * Box Volume Set Bounds\n *\n * @param min\n * @param max\n */\nx3dom.fields.BoxVolume.prototype.setBounds = function(min, max) {\n    this.min.setValues(min);\n    this.max.setValues(max);\n\n    this.updateInternals();\n    this.valid = true;\n};\n\n/**\n * Box Volume Set Bounds By Center Size\n *\n * @param center\n * @param size\n */\nx3dom.fields.BoxVolume.prototype.setBoundsByCenterSize = function(center, size) {\n    var halfSize = size.multiply(0.5);\n    this.min = center.subtract(halfSize);\n    this.max = center.add(halfSize);\n\n    this.updateInternals();\n    this.valid = true;\n};\n\n/**\n * Box Volume Extend Bounds\n *\n * @param min\n * @param max\n */\nx3dom.fields.BoxVolume.prototype.extendBounds = function(min, max) {\n    if (this.valid) {\n        if (this.min.x > min.x) { this.min.x = min.x; }\n        if (this.min.y > min.y) { this.min.y = min.y; }\n        if (this.min.z > min.z) { this.min.z = min.z; }\n\n        if (this.max.x < max.x) { this.max.x = max.x; }\n        if (this.max.y < max.y) { this.max.y = max.y; }\n        if (this.max.z < max.z) { this.max.z = max.z; }\n\n        this.updateInternals();\n    } else {\n        this.setBounds(min, max);\n    }\n};\n\n/**\n * Box Volume Get Bounds\n *\n * @param min\n * @param max\n */\nx3dom.fields.BoxVolume.prototype.getBounds = function(min, max) {\n    min.setValues(this.min);\n    max.setValues(this.max);\n};\n\n/**\n * Box Volume Get Radial Vector\n *\n * @returns {*}\n */\nx3dom.fields.BoxVolume.prototype.getRadialVec = function() {\n    return this.radialVec;\n};\n\n/**\n * Box Volume Invalidate\n *\n */\nx3dom.fields.BoxVolume.prototype.invalidate = function() {\n    this.valid = false;\n    this.min = new x3dom.fields.SFVec3f(0, 0, 0);\n    this.max = new x3dom.fields.SFVec3f(0, 0, 0);\n    this.updateInternals();\n};\n\n/**\n * Box Volume Is Valid?\n *\n * @returns {boolean}\n */\nx3dom.fields.BoxVolume.prototype.isValid = function() {\n    return this.valid;\n};\n\n/**\n * Box Volume Get Center\n *\n * @returns {*}\n */\nx3dom.fields.BoxVolume.prototype.getCenter = function() {\n    return this.center;\n};\n\n/**\n * Box Volume Get Diameter\n *\n * @returns {number|*}\n */\nx3dom.fields.BoxVolume.prototype.getDiameter = function() {\n    return this.diameter;\n};\n\n/**\n * Box Volume Transform\n *\n * @param m\n */\nx3dom.fields.BoxVolume.prototype.transform = function(m) {\n    var xmin, ymin, zmin;\n    var xmax, ymax, zmax;\n\n    xmin = xmax = m._03;\n    ymin = ymax = m._13;\n    zmin = zmax = m._23;\n\n    // calculate xmin and xmax of new transformed BBox\n    var a = this.max.x * m._00;\n    var b = this.min.x * m._00;\n\n    if (a >= b) {\n        xmax += a;\n        xmin += b;\n    } else {\n        xmax += b;\n        xmin += a;\n    }\n\n    a = this.max.y * m._01;\n    b = this.min.y * m._01;\n\n    if (a >= b) {\n        xmax += a;\n        xmin += b;\n    } else {\n        xmax += b;\n        xmin += a;\n    }\n\n    a = this.max.z * m._02;\n    b = this.min.z * m._02;\n\n    if (a >= b) {\n        xmax += a;\n        xmin += b;\n    } else {\n        xmax += b;\n        xmin += a;\n    }\n\n    // calculate ymin and ymax of new transformed BBox\n    a = this.max.x * m._10;\n    b = this.min.x * m._10;\n\n    if (a >= b) {\n        ymax += a;\n        ymin += b;\n    } else {\n        ymax += b;\n        ymin += a;\n    }\n\n    a = this.max.y * m._11;\n    b = this.min.y * m._11;\n\n    if (a >= b) {\n        ymax += a;\n        ymin += b;\n    } else {\n        ymax += b;\n        ymin += a;\n    }\n\n    a = this.max.z * m._12;\n    b = this.min.z * m._12;\n\n    if (a >= b) {\n        ymax += a;\n        ymin += b;\n    } else {\n        ymax += b;\n        ymin += a;\n    }\n\n    // calculate zmin and zmax of new transformed BBox\n    a = this.max.x * m._20;\n    b = this.min.x * m._20;\n\n    if (a >= b) {\n        zmax += a;\n        zmin += b;\n    } else {\n        zmax += b;\n        zmin += a;\n    }\n\n    a = this.max.y * m._21;\n    b = this.min.y * m._21;\n\n    if (a >= b) {\n        zmax += a;\n        zmin += b;\n    } else {\n        zmax += b;\n        zmin += a;\n    }\n\n    a = this.max.z * m._22;\n    b = this.min.z * m._22;\n\n    if (a >= b) {\n        zmax += a;\n        zmin += b;\n    } else {\n        zmax += b;\n        zmin += a;\n    }\n\n    this.min.x = xmin;\n    this.min.y = ymin;\n    this.min.z = zmin;\n\n    this.max.x = xmax;\n    this.max.y = ymax;\n    this.max.z = zmax;\n\n    this.updateInternals();\n};\n\n/**\n * Box Volume Transform Form\n *\n * @param m\n * @param other\n */\nx3dom.fields.BoxVolume.prototype.transformFrom = function(m, other) {\n    var xmin, ymin, zmin;\n    var xmax, ymax, zmax;\n\n    xmin = xmax = m._03;\n    ymin = ymax = m._13;\n    zmin = zmax = m._23;\n\n    // calculate xmin and xmax of new transformed BBox\n    var a = other.max.x * m._00;\n    var b = other.min.x * m._00;\n\n    if (a >= b) {\n        xmax += a;\n        xmin += b;\n    } else {\n        xmax += b;\n        xmin += a;\n    }\n\n    a = other.max.y * m._01;\n    b = other.min.y * m._01;\n\n    if (a >= b) {\n        xmax += a;\n        xmin += b;\n    } else {\n        xmax += b;\n        xmin += a;\n    }\n\n    a = other.max.z * m._02;\n    b = other.min.z * m._02;\n\n    if (a >= b) {\n        xmax += a;\n        xmin += b;\n    } else {\n        xmax += b;\n        xmin += a;\n    }\n\n    // calculate ymin and ymax of new transformed BBox\n    a = other.max.x * m._10;\n    b = other.min.x * m._10;\n\n    if (a >= b) {\n        ymax += a;\n        ymin += b;\n    } else {\n        ymax += b;\n        ymin += a;\n    }\n\n    a = other.max.y * m._11;\n    b = other.min.y * m._11;\n\n    if (a >= b) {\n        ymax += a;\n        ymin += b;\n    } else {\n        ymax += b;\n        ymin += a;\n    }\n\n    a = other.max.z * m._12;\n    b = other.min.z * m._12;\n\n    if (a >= b) {\n        ymax += a;\n        ymin += b;\n    } else {\n        ymax += b;\n        ymin += a;\n    }\n\n    // calculate zmin and zmax of new transformed BBox\n    a = other.max.x * m._20;\n    b = other.min.x * m._20;\n\n    if (a >= b) {\n        zmax += a;\n        zmin += b;\n    } else {\n        zmax += b;\n        zmin += a;\n    }\n\n    a = other.max.y * m._21;\n    b = other.min.y * m._21;\n\n    if (a >= b) {\n        zmax += a;\n        zmin += b;\n    } else {\n        zmax += b;\n        zmin += a;\n    }\n\n    a = other.max.z * m._22;\n    b = other.min.z * m._22;\n\n    if (a >= b) {\n        zmax += a;\n        zmin += b;\n    } else {\n        zmax += b;\n        zmin += a;\n    }\n\n    this.min.x = xmin;\n    this.min.y = ymin;\n    this.min.z = zmin;\n\n    this.max.x = xmax;\n    this.max.y = ymax;\n    this.max.z = zmax;\n\n    this.updateInternals();\n    this.valid = true;\n};\n\n/**\n * FrustumVolume constructor.\n *\n * @param clipMat\n * @class Represents a frustum (as internal helper).\n */\nx3dom.fields.FrustumVolume = function(clipMat) {\n    this.planeNormals = [];\n    this.planeDistances = [];\n    this.directionIndex = [];\n\n    if (arguments.length === 0) {\n        return;\n    }\n\n    var planeEquation = [];\n\n    for (var i = 0; i < 6; i++) {\n        this.planeNormals[i] = new x3dom.fields.SFVec3f(0, 0, 0);\n        this.planeDistances[i] = 0;\n        this.directionIndex[i] = 0;\n\n        planeEquation[i] = new x3dom.fields.SFVec4f(0, 0, 0, 0);\n    }\n\n    planeEquation[0].x = clipMat._30 - clipMat._00;\n    planeEquation[0].y = clipMat._31 - clipMat._01;\n    planeEquation[0].z = clipMat._32 - clipMat._02;\n    planeEquation[0].w = clipMat._33 - clipMat._03;\n\n    planeEquation[1].x = clipMat._30 + clipMat._00;\n    planeEquation[1].y = clipMat._31 + clipMat._01;\n    planeEquation[1].z = clipMat._32 + clipMat._02;\n    planeEquation[1].w = clipMat._33 + clipMat._03;\n\n    planeEquation[2].x = clipMat._30 + clipMat._10;\n    planeEquation[2].y = clipMat._31 + clipMat._11;\n    planeEquation[2].z = clipMat._32 + clipMat._12;\n    planeEquation[2].w = clipMat._33 + clipMat._13;\n\n    planeEquation[3].x = clipMat._30 - clipMat._10;\n    planeEquation[3].y = clipMat._31 - clipMat._11;\n    planeEquation[3].z = clipMat._32 - clipMat._12;\n    planeEquation[3].w = clipMat._33 - clipMat._13;\n\n    planeEquation[4].x = clipMat._30 + clipMat._20;\n    planeEquation[4].y = clipMat._31 + clipMat._21;\n    planeEquation[4].z = clipMat._32 + clipMat._22;\n    planeEquation[4].w = clipMat._33 + clipMat._23;\n\n    planeEquation[5].x = clipMat._30 - clipMat._20;\n    planeEquation[5].y = clipMat._31 - clipMat._21;\n    planeEquation[5].z = clipMat._32 - clipMat._22;\n    planeEquation[5].w = clipMat._33 - clipMat._23;\n\n    for (i = 0; i < 6; i++) {\n        var vectorLength = Math.sqrt(planeEquation[i].x * planeEquation[i].x +\n            planeEquation[i].y * planeEquation[i].y +\n            planeEquation[i].z * planeEquation[i].z);\n\n        planeEquation[i].x /= vectorLength;\n        planeEquation[i].y /= vectorLength;\n        planeEquation[i].z /= vectorLength;\n        planeEquation[i].w /= -vectorLength;\n    }\n\n    var updateDirectionIndex = function(normalVec) {\n        var ind = 0;\n        if (normalVec.x > 0) ind |= 1;\n        if (normalVec.y > 0) ind |= 2;\n        if (normalVec.z > 0) ind |= 4;\n        return ind;\n    };\n\n    // right\n    this.planeNormals[3].setValues(planeEquation[0]);\n    this.planeDistances[3] = planeEquation[0].w;\n    this.directionIndex[3] = updateDirectionIndex(this.planeNormals[3]);\n\n    // left\n    this.planeNormals[2].setValues(planeEquation[1]);\n    this.planeDistances[2] = planeEquation[1].w;\n    this.directionIndex[2] = updateDirectionIndex(this.planeNormals[2]);\n\n    // bottom\n    this.planeNormals[5].setValues(planeEquation[2]);\n    this.planeDistances[5] = planeEquation[2].w;\n    this.directionIndex[5] = updateDirectionIndex(this.planeNormals[5]);\n\n    // top\n    this.planeNormals[4].setValues(planeEquation[3]);\n    this.planeDistances[4] = planeEquation[3].w;\n    this.directionIndex[4] = updateDirectionIndex(this.planeNormals[4]);\n\n    // near\n    this.planeNormals[0].setValues(planeEquation[4]);\n    this.planeDistances[0] = planeEquation[4].w;\n    this.directionIndex[0] = updateDirectionIndex(this.planeNormals[0]);\n\n    // far\n    this.planeNormals[1].setValues(planeEquation[5]);\n    this.planeDistances[1] = planeEquation[5].w;\n    this.directionIndex[1] = updateDirectionIndex(this.planeNormals[1]);\n};\n\n/**\n * Check the volume against the frustum.\n * Return values > 0 indicate a plane mask that was used to identify\n * the object as \"inside\".\n * Return value -1 means the object has been culled (i.e., is outside\n * with respect to at least one plane).\n * Return value 0 is a rare case, indicating that the object intersects\n * with all planes of the frustum.\n *\n * @param vol\n * @param planeMask\n */\nx3dom.fields.FrustumVolume.prototype.intersect = function(vol, planeMask) {\n    if (this.planeNormals.length < 6) {\n        x3dom.debug.logWarning(\"FrustumVolume not initialized!\");\n        return false;\n    }\n\n    var that = this;\n    var min = vol.min, max = vol.max;\n\n    var setDirectionIndexPoint = function(index) {\n        var pnt = new x3dom.fields.SFVec3f(0, 0, 0);\n        if (index & 1) { pnt.x = min.x; }\n        else           { pnt.x = max.x; }\n        if (index & 2) { pnt.y = min.y; }\n        else           { pnt.y = max.y; }\n        if (index & 4) { pnt.z = min.z; }\n        else           { pnt.z = max.z; }\n        return pnt;\n    };\n\n    // Check if the point is in the halfspace\n    var pntIsInHalfSpace = function(i, pnt) {\n        var s = that.planeNormals[i].dot(pnt) - that.planeDistances[i];\n        return (s >= 0);\n    };\n\n    // Check if the box formed by min/max is fully inside the halfspace\n    var isInHalfSpace = function(i) {\n        var p = setDirectionIndexPoint(that.directionIndex[i]);\n        return pntIsInHalfSpace(i, p);\n    };\n\n    // Check if the box formed by min/max is fully outside the halfspace\n    var isOutHalfSpace = function(i) {\n        var p = setDirectionIndexPoint(that.directionIndex[i] ^ 7);\n        return !pntIsInHalfSpace(i, p);\n    };\n\n    // Check each point of the box to the 6 planes\n    var mask = 1;\n    if (planeMask < 0) planeMask = 0;\n\n    for (var i = 0; i < 6; i++, mask <<= 1) {\n        if ((planeMask & mask) != 0)\n            continue;\n\n        if (isOutHalfSpace(i))\n            return -1;\n\n        if (isInHalfSpace(i))\n            planeMask |= mask;\n    }\n\n    return planeMask;\n};\n\n/**\r\n * X3DOM JavaScript Library\r\n * http://www.x3dom.org\r\n *\r\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\r\n * Dual licensed under the MIT and GPL\r\n *\r\n * Based on code originally provided by\r\n * Philip Taylor: http://philip.html5.org\r\n */\r\n\r\n/* This module adds documentation related functionality to the library. */\r\n\r\n/**\r\n * The x3dom.docs namespace.\r\n * @namespace x3dom.docs\r\n */\r\nx3dom.docs = {};\r\n\r\nx3dom.docs.specURLMap = {\r\n    CADGeometry: \"CADGeometry.html\",\r\n    Core: \"core.html\",\r\n    DIS: \"dis.html\",\r\n    CubeMapTexturing: \"env_texture.html\",\r\n    EnvironmentalEffects: \"enveffects.html\",\r\n    EnvironmentalSensor: \"envsensor.html\",\r\n    Followers: \"followers.html\",\r\n    Geospatial: \"geodata.html\",\r\n    Geometry2D: \"geometry2D.html\",\r\n    Geometry3D: \"geometry3D.html\",\r\n    Grouping: \"group.html\",\r\n    \"H-Anim\": \"hanim.html\",\r\n    Interpolation: \"interp.html\",\r\n    KeyDeviceSensor: \"keyboard.html\",\r\n    Layering: \"layering.html\",\r\n    Layout: \"layout.html\",\r\n    Lighting: \"lighting.html\",\r\n    Navigation: \"navigation.html\",\r\n    Networking: \"networking.html\",\r\n    NURBS: \"nurbs.html\",\r\n    ParticleSystems: \"particle_systems.html\",\r\n    Picking: \"picking.html\",\r\n    PointingDeviceSensor: \"pointingsensor.html\",\r\n    Rendering: \"rendering.html\",\r\n    RigidBodyPhysics: \"rigid_physics.html\",\r\n    Scripting: \"scripting.html\",\r\n    Shaders: \"shaders.html\",\r\n    Shape: \"shape.html\",\r\n    Sound: \"sound.html\",\r\n    Text: \"text.html\",\r\n    Texturing3D: \"texture3D.html\",\r\n    Texturing: \"texturing.html\",\r\n    Time: \"time.html\",\r\n    EventUtilities: \"utils.html\",\r\n    VolumeRendering: \"volume.html\"\r\n};\r\n\r\nx3dom.docs.specBaseURL = \"http://www.web3d.org/x3d/specifications/ISO-IEC-19775-1.2-X3D-AbstractSpecification/Part01/components/\";\r\n\r\n/**\r\n * The dump-nodetype tree functionality in a function\r\n *\r\n * @returns {string} HTML Node Type List.\r\n */\r\nx3dom.docs.getNodeTreeInfo = function() {\r\n\r\n    // Create the nodetype hierarchy\r\n    var tn, t;\r\n    var types = \"\";\r\n\r\n    var objInArray = function(array, obj) {\r\n        for (var i = 0; i < array.length; i++) {\r\n            if (array[i] === obj) {\r\n                return true;\r\n            }\r\n        }\r\n        return false;\r\n    };\r\n\r\n    var dump = function(t, indent) {\r\n        for (var i = 0; i < indent; i++) {\r\n            types += \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\";\r\n        }\r\n\r\n        types += \"<a href='\" +\r\n            x3dom.docs.specBaseURL + x3dom.docs.specURLMap[x3dom.nodeTypes[t]._compName] + \"#\" + t +\r\n            \"' style='color:black; text-decoration:none; font-weight:bold;'>\" +\r\n            t + \"</a> &nbsp; <a href='\" +\r\n            x3dom.docs.specBaseURL + x3dom.docs.specURLMap[x3dom.nodeTypes[t]._compName] +\r\n            \"' style='color:black; text-decoration:none; font-style:italic;'>\" +\r\n            x3dom.nodeTypes[t]._compName + \"</a><br/>\";\r\n\r\n        for (var i in x3dom.nodeTypes[t].childTypes[t]) {\r\n            dump(x3dom.nodeTypes[t].childTypes[t][i], indent + 1);\r\n        }\r\n    };\r\n\r\n    for (tn in x3dom.nodeTypes) {\r\n        var t = x3dom.nodeTypes[tn];\r\n        if (t.childTypes === undefined) {\r\n            t.childTypes = {};\r\n        }\r\n\r\n        while (t.superClass) {\r\n            if (t.superClass.childTypes[t.superClass._typeName] === undefined) {\r\n                t.superClass.childTypes[t.superClass._typeName] = [];\r\n            }\r\n            if (!objInArray(t.superClass.childTypes[t.superClass._typeName], t._typeName)) {\r\n                t.superClass.childTypes[t.superClass._typeName].push(t._typeName);\r\n            }\r\n            t = t.superClass;\r\n        }\r\n    }\r\n\r\n    dump(\"X3DNode\", 0);\r\n\r\n    return \"<div class='x3dom-doc-nodes-tree'>\" + types + \"</div>\";\r\n};\r\n\r\n/**\r\n * Get Component Info\r\n *\r\n * @returns {string} HTML Component List.\r\n */\r\nx3dom.docs.getComponentInfo = function() {\r\n    // Dump nodetypes by component\r\n    // but first sort alphabetically\r\n    var components = [];\r\n    var component;\r\n    var result = \"\";\r\n    var c, cn;\r\n\r\n    for (c in x3dom.components) {\r\n        components.push(c);\r\n    }\r\n    components.sort();\r\n\r\n    // for (var c in x3dom.components) {\r\n    for (cn in components) {\r\n        c = components[cn];\r\n        component = x3dom.components[c];\r\n        result += \"<h2><a href='\" +\r\n            x3dom.docs.specBaseURL + x3dom.docs.specURLMap[c] +\r\n            \"' style='color:black; text-decoration:none; font-style:italic;'>\" +\r\n            c + \"</a></h2>\";\r\n\r\n        result += \"<ul style='list-style-type:circle;'>\";\r\n\r\n        // var $ul = $(\"#components ul:last\");\r\n        for (var t in component) {\r\n            result += \"<li><a href='\" +\r\n                x3dom.docs.specBaseURL + x3dom.docs.specURLMap[c] + \"#\" + t +\r\n                \"' style='color:black; text-decoration:none; font-weight:bold;'>\" +\r\n                t + \"</a></li>\";\r\n        }\r\n        result += \"</ul>\";\r\n    }\r\n\r\n    return result;\r\n};\r\n\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2018 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * John Carlson https://coderextreme.net/X3DJSONLD\n */\n\n\"use strict\";\n\nx3dom.JSONParser = function(scene)\n{\n\tthis.x3djsonNS = \"http://www.web3d.org/specifications/x3d-namespace\";\n};\n\nx3dom.JSONParser.prototype.constructor = x3dom.JSONParser;\n\n\t/**\n\t * Load X3D JSON into an element.\n\t * jsobj - the JavaScript object to convert to DOM.\n\t */\nx3dom.JSONParser.prototype.parseJavaScript = function(jsobj) {\n\t\tvar child = this.CreateElement('X3D');\n\t\tthis.ConvertToX3DOM(jsobj, \"\", child);\n\t\t// console.log(jsobj, child);\n\t\treturn child;\n\t};\n\n\t// 'http://www.web3d.org/specifications/x3d-namespace'\n\n\t// Load X3D JavaScript object into XML or DOM\n\n\t/**\n\t * Yet another way to set an attribute on an element.  does not allow you to\n\t * set JSON schema or encoding.\n\t */\nx3dom.JSONParser.prototype.elementSetAttribute = function(element, key, value) {\n\t\tif (key === 'SON schema') {\n\t\t\t// JSON Schema\n\t\t} else if (key === 'ncoding') {\n\t\t\t// encoding, UTF-8, UTF-16 or UTF-32\n\t\t} else {\n\t\t\tif (typeof element.setAttribute === 'function') {\n\t\t\t\telement.setAttribute(key, value);\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * converts children of object to DOM.\n\t */\nx3dom.JSONParser.prototype.ConvertChildren = function(parentkey, object, element) {\n\t\tvar key;\n\n\t\tfor (key in object) {\n\t\t\tif (typeof object[key] === 'object') {\n\t\t\t\tif (isNaN(parseInt(key))) {\n\t\t\t\t\tthis.ConvertObject(key, object, element, parentkey.substr(1));\n\t\t\t\t} else {\n\t\t\t\t\tthis.ConvertToX3DOM(object[key], key, element, parentkey.substr(1));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * a method to create and element with tagnam key to DOM in a namespace.  If\n\t * containerField is set, then the containerField is set in the elemetn.\n\t */\nx3dom.JSONParser.prototype.CreateElement = function(key, containerField) {\n\t\tvar child = null;\n\t\tif (typeof this.x3djsonNS === 'undefined') {\n\t\t\tchild = document.createElement(key);\n\t\t} else {\n\t\t\tchild = document.createElementNS(this.x3djsonNS, key);\n\t\t\tif (child === null || typeof child === 'undefined') {\n\t\t\t\tconsole.error('Trouble creating element for', key);\n\t\t\t\tchild = document.createElement(key);\n\t\t\t}\n\t\t}\n\t\tif (typeof containerField !== 'undefined') {\n\t\t\tthis.elementSetAttribute(child, 'containerField', containerField);\n\t\t}\n\t\treturn child;\n\t};\n\n\t/**\n\t * a way to create a CDATA function or script in HTML, by using a DOM parser.\n\t */\nx3dom.JSONParser.prototype.CDATACreateFunction = function(document, element, str) {\n\t\tvar y = str.trim().replace(/\\\\\"/g, \"\\\\\\\"\")\n\t\t\t.replace(/&lt;/g, \"<\")\n\t\t\t.replace(/&gt;/g, \">\")\n\t\t\t.replace(/&amp;/g, \"&\");\n\t\tdo {\n\t\t\tstr = y;\n\t\t\ty = str.replace(/'([^'\\r\\n]*)\\n([^']*)'/g, \"'$1\\\\n$2'\");\n\t\t\tif (str !== y) {\n\t\t\t\t// console.log(\"CDATA Replacing\",str,\"with\",y);\n\t\t\t}\n\t\t} while (y != str);\n\t\tvar domParser = new DOMParser();\n\t\tvar cdataStr = '<script> <![CDATA[ ' + y + ' ]]> </script>'; // has to be wrapped into an element\n\t\tvar scriptDoc = domParser .parseFromString (cdataStr, 'application/xml');\n\t\tvar cdata = scriptDoc .children[0] .childNodes[1]; // space after script is childNode[0]\n\t\telement .appendChild(cdata);\n\t};\n\n\t/**\n\t * convert the object at object[key] to DOM.\n\t */\nx3dom.JSONParser.prototype.ConvertObject = function(key, object, element, containerField) {\n\t\tvar child;\n\t\tif (object !== null && typeof object[key] === 'object') {\n\t\t\tif (key.startsWith('@')) {\n\t\t\t\tthis.ConvertToX3DOM(object[key], key, element);\n\t\t\t} else if (key.startsWith('-')) {\n\t\t\t\tthis.ConvertChildren(key, object[key], element);\n\t\t\t} else if (key === '#comment') {\n\t\t\t\tfor (var c in object[key]) {\n\t\t\t\t\tchild = document.createComment(this.CommentStringToXML(object[key][c]));\n\t\t\t\t\telement.appendChild(child);\n\t\t\t\t}\n\t\t\t} else if (key === '#sourceText') {\n\t\t\t\tthis.CDATACreateFunction(document, element, object[key].join(\"\\r\\n\")+\"\\r\\n\");\n\t\t\t} else {\n\t\t\t\tif (key === 'connect' || key === 'fieldValue' || key === 'field' || key === 'meta' || key === 'component') {\n\t\t\t\t\tfor (var childkey in object[key]) {  // for each field\n\t\t\t\t\t\tif (typeof object[key][childkey] === 'object') {\n\t\t\t\t\t\t\tchild = this.CreateElement(key, containerField);\n\t\t\t\t\t\t\tthis.ConvertToX3DOM(object[key][childkey], childkey, child);\n\t\t\t\t\t\t\telement.appendChild(child);\n\t\t\t\t\t\t\telement.appendChild(document.createTextNode(\"\\n\"));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tchild = this.CreateElement(key, containerField);\n\t\t\t\t\tthis.ConvertToX3DOM(object[key], key, child);\n\t\t\t\t\telement.appendChild(child);\n\t\t\t\t\telement.appendChild(document.createTextNode(\"\\n\"));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * convert a comment string in JavaScript to XML.  Pass the string\n\t */\nx3dom.JSONParser.prototype.CommentStringToXML = function(str) {\n\t\tvar y = str;\n\t\tstr = str.replace(/\\\\\\\\/g, '\\\\');\n\t\tif (y !== str) {\n\t\t\t// console.log(\"X3DJSONLD <!-> replacing\", y, \"with\", str);\n\t\t}\n\t\treturn str;\n\t};\n\n\t/**\n\t * convert an SFString to XML.\n\t */\nx3dom.JSONParser.prototype.SFStringToXML = function(str) {\n\t\tvar y = str;\n\t\t/*\n\t\tstr = (\"\"+str).replace(/\\\\\\\\/g, '\\\\\\\\');\n\t\tstr = str.replace(/\\\\\\\\\\\\\\\\/g, '\\\\\\\\');\n\t\tstr = str.replace(/(\\\\+)\"/g, '\\\\\"');\n\t\t*/\n\t\tstr = str.replace(/\\\\/g, '\\\\\\\\');\n\t\tstr = str.replace(/\"/g, '\\\\\\\"');\n\t\tif (y !== str) {\n\t\t\t// console.log(\"X3DJSONLD [] replacing\", y, \"with\", str);\n\t\t}\n\t\treturn str;\n\t};\n\n\t/**\n\t * convert a JSON String to XML.\n\t */\nx3dom.JSONParser.prototype.JSONStringToXML = function(str) {\n\t\tvar y = str;\n\t\tstr = str.replace(/\\\\/g, '\\\\\\\\');\n\t\tstr = str.replace(/\\n/g, '\\\\n');\n\t\tif (y !== str) {\n\t\t\t// console.log(\"X3DJSONLD replacing\", y, \"with\", str);\n\t\t}\n\t\treturn str;\n\t};\n\n\t/**\n\t * main routine for converting a JavaScript object to DOM.\n\t * object is the object to convert.\n\t * parentkey is the key of the object in the parent.\n\t * element is the parent element.\n\t * containerField is a possible containerField.\n\t */\nx3dom.JSONParser.prototype.ConvertToX3DOM = function(object, parentkey, element, containerField) {\n\t\tvar key;\n\t\tvar localArray = [];\n\t\tvar isArray = false;\n\t\tvar arrayOfStrings = false;\n\t\tfor (key in object) {\n\t\t\tif (isNaN(parseInt(key))) {\n\t\t\t\tisArray = false;\n\t\t\t} else {\n\t\t\t\tisArray = true;\n\t\t\t}\n\t\t\tif (isArray) {\n\t\t\t\tif (typeof object[key] === 'number') {\n\t\t\t\t\tlocalArray.push(object[key]);\n\t\t\t\t} else if (typeof object[key] === 'string') {\n\t\t\t\t\tlocalArray.push(object[key]);\n\t\t\t\t\tarrayOfStrings = true;\n\t\t\t\t} else if (typeof object[key] === 'boolean') {\n\t\t\t\t\tlocalArray.push(object[key]);\n\t\t\t\t} else if (typeof object[key] === 'object') {\n\t\t\t\t\t/*\n\t\t\t\t\tif (object[key] != null && typeof object[key].join === 'function') {\n\t\t\t\t\t\tlocalArray.push(object[key].join(\" \"));\n\t\t\t\t\t}\n\t\t\t\t\t*/\n\t\t\t\t\tthis.ConvertToX3DOM(object[key], key, element);\n\t\t\t\t} else if (typeof object[key] === 'undefined') {\n\t\t\t\t} else {\n\t\t\t\t\tconsole.error(\"Unknown type found in array \"+typeof object[key]);\n\t\t\t\t}\n\t\t\t} else if (typeof object[key] === 'object') {\n\t\t\t\t// This is where the whole thing starts\n\t\t\t\tif (key === 'X3D') {\n\t\t\t\t\tthis.ConvertToX3DOM(object[key], key, element);\n\t\t\t\t} else {\n\t\t\t\t\tthis.ConvertObject(key, object, element);\n\t\t\t\t}\n\t\t\t} else if (typeof object[key] === 'number') {\n\t\t\t\tthis.elementSetAttribute(element, key.substr(1),object[key]);\n\t\t\t} else if (typeof object[key] === 'string') {\n\t\t\t\tif (key !== '#comment') {\n\t\t\t\t\t// ordinary string attributes\n\t\t\t\t\tthis.elementSetAttribute(element, key.substr(1), this.JSONStringToXML(object[key]));\n\t\t\t\t} else {\n\t\t\t\t\tvar child = document.createComment(this.CommentStringToXML(object[key]));\n\t\t\t\t\telement.appendChild(child);\n\t\t\t\t}\n\t\t\t} else if (typeof object[key] === 'boolean') {\n\t\t\t\tthis.elementSetAttribute(element, key.substr(1),object[key]);\n\t\t\t} else if (typeof object[key] === 'undefined') {\n\t\t\t} else {\n\t\t\t\tconsole.error(\"Unknown type found in object \"+typeof object[key]);\n\t\t\t\tconsole.error(object);\n\t\t\t}\n\t\t}\n\t\tif (isArray) {\n\t\t\tif (parentkey.startsWith('@')) {\n\t\t\t\tif (arrayOfStrings) {\n\t\t\t\t\tfor (var str in localArray) {\n\t\t\t\t\t\tlocalArray[str] = this.SFStringToXML(localArray[str]);\n\t\t\t\t\t}\n\t\t\t\t\tthis.elementSetAttribute(element, parentkey.substr(1),'\"'+localArray.join('\" \"')+'\"');\n\t\t\t\t} else {\n\t\t\t\t\t// if non string array\n\t\t\t\t\tthis.elementSetAttribute(element, parentkey.substr(1),localArray.join(\" \"));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn element;\n\t};\n\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2018 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * John Carlson https://coderextreme.net/X3DJSONLD\n */\n\nx3dom.PROTOS = function() {\n\tthis.protos = {};\n\tthis.names = {};\n\tthis.protoField = {};\n\tthis.scriptField = {};\n\tthis.interfaceField = {};\n\tthis.envField = {};\n\tthis.scopecount = 0;\n\tthis.privatescope = [];\n\tthis.defs = {};\n\tthis.founddef = null;\n\tthis.SFNodes = {\n\t\t\"-appearance\" : 1,\n\t\t\"-body\" : 1,\n\t\t\"-child\" : 1,\n\t\t\"-collidable\" : 1,\n\t\t\"-collider\" : 1,\n\t\t\"-color\" : 1,\n\t\t\"-composableRenderStyle\" : 1,\n\t\t\"-coord\" : 1,\n\t\t\"-emitter\" : 1,\n\t\t\"-fillProperties\" : 1,\n\t\t\"-fogCoord\" : 1,\n\t\t\"-fontStyle\" : 1,\n\t\t\"-geometry\" : 1,\n\t\t\"-geoOrigin\" : 1,\n\t\t\"-layout\" : 1,\n\t\t\"-lineProperties\" : 1,\n\t\t\"-massDensityModel\" : 1,\n\t\t\"-material\" : 1,\n\t\t\"-metadata\" : 1,\n\t\t\"-normal\" : 1,\n\t\t\"-nurbsCurve\" : 1,\n\t\t\"-nurbsCurve2D\" : 1,\n\t\t\"-pickingGeometry\" : 1,\n\t\t\"-renderStyle\" : 1,\n\t\t\"-shape\" : 1,\n\t\t\"-source\" : 1,\n\t\t\"-texCoord\" : 1,\n\t\t\"-texCoordNurbs\" : 1,\n\t\t\"-texCoordRamp\" : 1,\n\t\t\"-texture\" : 1,\n\t\t\"-texture2D\" : 1,\n\t\t\"-texture2DMulti\" : 1,\n\t\t\"-texture3D\" : 1,\n\t\t\"-textureProperties\" : 1,\n\t\t\"-textureTransform\" : 1,\n\t\t\"-transferFunction\" : 1,\n\t\t\"-viewport\" : 1\n\t};\n}\n\nx3dom.PROTOS.prototype = {\n\tflattenerArray : function(object, parentArray) {\n\t\tvar newobject = [];\n\t\tvar offset = 0;\n\t\tfor (var p in object) {\n\t\t\tvar possibleArray = this.flattener(object[p], newobject, object.length);\n\t\t\tif (Array.isArray(possibleArray)) {\n\t\t\t\tfor (var q in possibleArray) {\n\t\t\t\t\tnewobject[parseInt(p)+offset+parseInt(q)] = possibleArray[q];\n\t\t\t\t}\n\t\t\t\toffset += possibleArray.length-1;\n\t\t\t} else {\n\t\t\t\tnewobject[parseInt(p)+offset] = possibleArray;\n\t\t\t}\n\t\t}\n\t\treturn newobject;\n\t},\n\tflattenerObject : function(object, parentArray, arrayLen) {\n\t\tvar newobject = {};\n\t\tfor (var p in object) {\n\t\t\tvar possibleArray = this.flattener(object[p], parentArray, arrayLen);\n\t\t\tif (Array.isArray(possibleArray)) {\n\t\t\t\tif (this.SFNodes[p]) {\n\t\t\t\t\t// this.SFNodes should only have one child\n\t\t\t\t\tnewobject[p] = possibleArray[0];\n\t\t\t\t\t// handle extra nodes brought in from proto\n\t\t\t\t\tif (possibleArray.length > 1) {\n\t\t\t\t\t\tparentArray[arrayLen] = { \"Switch\" : {\n\t\t\t\t\t\t\t\t\t\"@whichChoice\": -1,\n\t\t\t\t\t\t\t\t\t\"-children\" : [\n\t\t\t\t\t\t\t\t\t\t{\"Group\" : {\n\t\t\t\t\t\t\t\t\t\t\"-children\" : [\n\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (var i = 1; i < possibleArray.length; i++) {\n\t\t\t\t\t\t\tparentArray[arrayLen][\"Switch\"][\"-children\"][0][\"Group\"][\"-children\"][i-1] = possibleArray[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tnewobject[p] = possibleArray;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (this.SFNodes[p]) {\n\t\t\t\t\tif (typeof possibleArray === 'object' && possibleArray[\"#comment\"]) {\n\t\t\t\t\t\tif (newobject[\"-children\"]) {\n\t\t\t\t\t\t\tnewobject[p] = {};\n\t\t\t\t\t\t\tnewobject[\"-children\"].push(possibleArray);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnewobject[p] = {};\n\t\t\t\t\t\t\tnewobject[\"-children\"] = [ possibleArray ];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnewobject[p] = possibleArray;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tnewobject[p] = possibleArray;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn newobject;\n\t},\n\tflattener : function(object, parentArray, arrayLen) {\n\t\tif (typeof object === \"object\") {\n\t\t\tif (Array.isArray(object)) {\n\t\t\t\tvar newobject = this.flattenerArray(object, parentArray);\n\t\t\t} else {\n\t\t\t\tvar newobject = this.flattenerObject(object, parentArray, arrayLen);\n\t\t\t}\n\t\t\treturn newobject;\n\t\t} else {\n\t\t\treturn object;\n\t\t}\n\t},\n\n\tpushScope: function (s) {\n\t\t// console.error(\"PUSH\", s);\n\t\tthis.privatescope.push(s);\n\t},\n\n\tpopScope: function () {\n\t\t// console.error(\"POP\", this.privatescope[this.privatescope.length-1]);\n\t\tthis.privatescope.pop();\n\t},\n\n\tsaveDef: function (def) {\n\t\tthis.defs[def] = this.getScope();\n\t\tvar d = this.getScope(def);\n\t\t// console.error(\"DEF SAVED\", d, this.defs[def]);\n\t\treturn d;\n\t},\n\n\tgetDef: function (def) {\n\t\t// console.error(\"SCOPE OF DEF\", def, this.defs[def]);\n\t\treturn this.defs[def];\n\t},\n\n\tgetField: function (scope, field) {\n\t\treturn scope + \"_\" + field;\n\t},\n\n\tgetScope: function (def) {\n\t\tvar scope;\n\t\tif (def) {\n\t\t\tif (this.defs[def]) {\n\t\t\t\tscope = this.defs[def] + \"_\" + def;\n\t\t\t} else {\n\t\t\t\tscope = def;\n\t\t\t}\n\t\t} else {\n\t\t\tscope = this.privatescope.join(\"_\");\n\t\t}\n\t\t// console.error(\"GET\", [def], scope);\n\t\tvar decl = scope.lastIndexOf(\"DECL\");\n\t\tif (decl > 0) {\n\t\t\tscope = scope.substring(decl);\n\t\t}\n\t\treturn scope;\n\t},\n\n\tscopeLength: function () {\n\t\treturn this.privatescope.length;\n\t},\n\n\tupScope: function (i) {\n\t\treturn this.privatescope.slice(0, this.privatescope.length - i).join(\"_\");\n\t},\n\tsetValueFromInterface: function (field, object, objectfield) {\n\t\t// copy the default interface value;\n\t\tvar fieldname_field_scope = this.getInterface(field);\n\t\t// default to \"@\".  - might need to be specified for children, see setter.\n\t\tvar prefix = \"@\";\n\t\tif (typeof fieldname_field_scope != 'undefined' && typeof fieldname_field_scope[0] != 'undefined') {\n\t\t\tprefix = fieldname_field_scope[0].substr(0, 1);\n\t\t}\n\t\tif (prefix === '@' && objectfield === 'children') {\n\t\t\tprefix = '-';\n\t\t}\n\t\tif (prefix === '-' && objectfield === 'value') {\n\t\t\tprefix = \"@\";\n\t\t}\n\t\tobjectfield = prefix + objectfield;\n\t\tif (typeof fieldname_field_scope != 'undefined' && typeof fieldname_field_scope[1] != 'undefined' && typeof fieldname_field_scope[0] != 'undefined' && typeof fieldname_field_scope[1][fieldname_field_scope[0]] != 'undefined') {\n\t\t\t// just grab the one value out of the interface.  We may want more later for typechecking\n\t\t\tvar value = fieldname_field_scope[1][fieldname_field_scope[0]];\n\t\t\tif (Array.isArray(value) && fieldname_field_scope[1][\"@type\"] === \"SFNode\" && objectfield !== '-children') {\n\t\t\t\t// and some SF fields are arrays, so we have to explicitly test for SFNode\n\t\t\t\t// can't shove an array into an SFNode, so take the first element, per Roy Walmsley\n\t\t\t\tconsole.error(\"SFNode is array, reducing\", value);\n\t\t\t\tvalue = value[0];\n\t\t\t\t// console.error(\"SFNode array[0]=\", value);\n\t\t\t}\n\t\t\tif (!Array.isArray(value) && objectfield === '-children') {\n\t\t\t\tobjectfield = \"@value\";\n\t\t\t}\n\t\t\tobject[objectfield] = value;\n\t\t\treturn [fieldname_field_scope[1][\"@type\"], fieldname_field_scope[2]];\n\t\t}\n\t\treturn undefined;\n\t},\n\n\tgetObjectField: function (f, type) {\n\t\tvar objectfield = \"value\";\n\t\tif (type.indexOf(\"FNode\") === 1) {\n\t\t\tobjectfield = \"children\";\n\t\t}\n\t\tfor (var a in f) {\n\t\t\tif (a === '@value' || a === '-children') {\n\t\t\t\t// console.error(\"===========attribute\", a);\n\t\t\t\tobjectfield = a.substr(1);\n\t\t\t}\n\t\t}\n\t\treturn objectfield;\n\t},\n\n\tfindFieldByName: function (fields, objectfield) {\n\t\tfor (var field in fields) {\n\t\t\tvar f = fields[field];\n\t\t\tvar fieldname = f[\"@name\"];\n\t\t\tif (fieldname === objectfield) {\n\t\t\t\t// console.error(\"Found\", fieldname);\n\t\t\t\treturn f;\n\t\t\t}\n\t\t}\n\t\tthrow \"Can't find \" + objectfield;\n\t},\n\n\tgetScriptFieldFieldTypeFieldByNameAttribute: function (fields, objectfield) {\n\t\t// console.error(\"Searching\", fields);\n\t\tvar f = this.findFieldByName(fields, objectfield);\n\t\tvar fieldname = f[\"@name\"];\n\t\tvar type = f[\"@type\"];\n\t\tobjectfield = this.getObjectField(f, type);\n\t\treturn [f, fieldname, type, objectfield];\n\t},\n\n\tgetScriptFieldFieldTypeField: function (fields, field) {\n\t\tvar f = fields[field];\n\t\tvar fieldname = f[\"@name\"];\n\t\tvar type = f[\"@type\"];\n\t\tvar objectfield = this.getObjectField(f, type);\n\t\treturn [f, fieldname, type, objectfield];\n\t},\n\n\tsetScriptFields: function (fields, def) {\n\t\tvar scope = this.getScope();\n\t\tfor (var field in fields) {\n\t\t\tvar field_name_field_type_objectfield_name = this.getScriptFieldFieldTypeField(fields, field);\n\t\t\tvar f = field_name_field_type_objectfield_name[0];\n\t\t\tvar fieldname = field_name_field_type_objectfield_name[1];\n\t\t\tvar type = field_name_field_type_objectfield_name[2];\n\t\t\tvar objectfield = field_name_field_type_objectfield_name[3];\n\t\t\tvar type_scope = this.setValueFromInterface(fieldname, f, objectfield);\n\t\t\t// console.error(\"SSF1\", scope, fieldname, f, objectfield, type, def);\n\t\t\tthis.setScriptField(scope, fieldname, f, objectfield, type, def);\n\t\t\tif (typeof type_scope !== 'undefined') {\n\t\t\t\t// console.error(\"SSF2\", type_scope[1], fieldname, f, objectfield, type, def);\n\t\t\t\tthis.setScriptField(type_scope[1], fieldname, f, objectfield, type, def);\n\t\t\t}\n\n\t\t}\n\n\t},\n\n\tsetScriptField: function (scope, field, f, objectfield, type, def) {\n\t\tif (typeof this.scriptField[this.getField(scope, field)] === 'undefined') {\n\t\t\tthis.scriptField[this.getField(scope, field)] = [];\n\t\t}\n\t\t// set another reference\n\t\tthis.scriptField[this.getField(scope, field)][this.scriptField[this.getField(scope, field)].length] = [f, objectfield, type, def];\n\t},\n\n\tsetEnv: function (scope, protoField, newobject, nodeField, type, newdef) {\n\t\tvar fieldname_field_scope = this.getInterface(protoField);\n\t\tif (typeof fieldname_field_scope !== 'undefined') {\n\t\t\tscope = fieldname_field_scope[2];\n\t\t}\n\t\tif (typeof this.envField[this.getField(scope, protoField)] === 'undefined') {\n\t\t\tthis.envField[this.getField(scope, protoField)] = [];\n\t\t}\n\t\t// set another reference\n\t\tthis.envField[this.getField(scope, protoField)][this.envField[this.getField(scope, protoField)].length] = [newobject, nodeField, type, newdef];\n\t\t// console.error(\"setconnenv\", this.envField[this.getField(scope,protoField)].length, scope, protoField, JSON.stringify(newobject), nodeField, type, newdef);\n\t},\n\n\tgetEnv: function (scope, protoField) {\n\t\t// console.error(\">>>>>>\", scope, protoField, JSON.stringify(this.envField[this.getField(scope,protoField)]));\n\t\treturn this.envField[this.getField(scope, protoField)];\n\t},\n\n\tsetConnectField: function (scope, field, newobject, objectfield, type, newdef) {\n\t\t// console.error(\"setconn\", scope, field, JSON.stringify(newobject), type, newdef);\n\t\tif (typeof this.protoField[this.getField(scope, field)] === 'undefined') {\n\t\t\tthis.protoField[this.getField(scope, field)] = [];\n\t\t}\n\t\tthis.protoField[this.getField(scope, field)][this.protoField[this.getField(scope, field)].length] = [newobject, objectfield, type, newdef];\n\t},\n\n\t// In the ProtoBody (for the instance)\n\t// p === \"IS\"\n\tsetConnectFields: function (object, p, newobject) {\n\t\tvar def = object[\"@DEF\"]; // at same level as IS\n\t\tvar newdef = this.saveDef(def);\n\t\tvar connect = object[p][\"connect\"];\n\t\tvar scope = this.getScope();\n\t\tfor (var cfield in connect) {\n\t\t\tvar f = connect[cfield];\n\t\t\t// console.error(\"Connect field\", field, f);\n\t\t\tif (f) {\n\t\t\t\tvar field = this.getScope(f[\"@protoField\"]);\n\t\t\t\tvar objectfield = f[\"@nodeField\"];\n\t\t\t\t// console.error(\"Node field is\", objectfield);\n\t\t\t\tvar type_scope = this.setValueFromInterface(field, newobject, objectfield);\n\t\t\t\tvar type = undefined;\n\t\t\t\tif (typeof type_scope !== 'undefined') {\n\t\t\t\t\ttype = type_scope[0];\n\t\t\t\t\tthis.setEnv(scope, field, newobject, objectfield, type, newdef);\n\t\t\t\t\tthis.setConnectField(scope, field, newobject, objectfield, type, newdef);\n\t\t\t\t\tthis.setConnectField(type_scope[1], field, newobject, objectfield, type, newdef);\n\t\t\t\t} else {\n\t\t\t\t\tthis.setEnv(scope, field, newobject, objectfield, type, newdef);\n\t\t\t\t\tthis.setConnectField(scope, field, newobject, objectfield, type, newdef);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\tsetScriptConnectFields: function (file, object, p, newobject) {\n\t\tvar connect = object[p][\"connect\"];\n\t\tvar scope = this.getScope();\n\t\tvar def = object[\"@DEF\"];\n\t\tnewobject[\"field\"] = this.realPrototypeExpander(file, object[\"field\"], true);\n\t\tvar newdef = newobject[\"@DEF\"]; // at same level as IS\n\t\tfor (var cfield in connect) {\n\t\t\tvar f = connect[cfield];\n\t\t\tif (f) {\n\t\t\t\tvar field = this.getScope(f[\"@protoField\"]);\n\t\t\t\tvar objectfield = f[\"@nodeField\"];\n\t\t\t\t// console.error(\"Connect field\", field, objectfield);\n\t\t\t\tvar field_name_field_type_objectfield_name = this.getScriptFieldFieldTypeFieldByNameAttribute(newobject[\"field\"], objectfield);\n\t\t\t\tf = field_name_field_type_objectfield_name[0];\n\t\t\t\tvar fieldname = field_name_field_type_objectfield_name[1];\n\t\t\t\tvar type = field_name_field_type_objectfield_name[2];\n\t\t\t\tobjectfield = field_name_field_type_objectfield_name[3];\n\t\t\t\t// console.error(\"Node field is\", objectfield);\n\t\t\t\tvar type_scope = this.setValueFromInterface(field, f, objectfield);\n\t\t\t\tif (typeof type_scope !== 'undefined') {\n\t\t\t\t\ttype = type_scope[0];\n\t\t\t\t\t// this.setEnv(scope, field, newobject, objectfield, type, newdef);\n\t\t\t\t\t// console.error(\"SSF3\", scope, field, f, objectfield, type, def);\n\t\t\t\t\tthis.setScriptField(scope, field, f, objectfield, type, def);\n\t\t\t\t\t// console.error(\"SSF4\", type_scope[1], field, f, objectfield, type, def);\n\t\t\t\t\tthis.setScriptField(type_scope[1], field, f, objectfield, type, def);\n\t\t\t\t} else {\n\t\t\t\t\t// this.setEnv(scope, field, newobject, objectfield, type, newdef);\n\t\t\t\t\t// console.error(\"SSF5\", scope, field, f, objectfield, type, def);\n\t\t\t\t\tthis.setScriptField(scope, field, f, objectfield, type, def);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\tgetInterface: function (field) {\n\t\tfor (var i = 0; i < this.scopeLength(); i++) {\n\t\t\tvar scope = this.upScope(i);\n\t\t\tif (!scope) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tvar fieldname_field_scope = this.interfaceField[this.getField(scope, field)];\n\t\t\t//console.error(\"getinter\", scope, field, fieldnamefield);\n\t\t\tif (fieldname_field_scope) {\n\t\t\t\treturn fieldname_field_scope;\n\t\t\t}\n\t\t\t//console.error(\"looping\", i);\n\t\t}\n\t},\n\n\tsetInterface: function (field, fieldname) {\n\t\tvar scope = this.getScope();\n\t\tthis.interfaceField[this.getField(scope, field[\"@name\"])] = [fieldname, field, scope];\n\t\t// console.error(\"setinter\", scope, field[\"@name\"], fieldname, field[fieldname]);\n\t},\n\n\tclearScope: function (field, object) {\n\t\tvar scope = this.getScope();\n\t\tdelete this.scriptField[this.getField(scope, field)];\n\t\tdelete this.protoField[this.getField(scope, field)];\n\t\tthis.zap(field, object);\n\t},\n\n\textractConnectedDef: function (scope, field) {\n\t\tvar defobj;\n\t\t// console.error(\"extracting def from script, proto, or otherwise:\", scope, field, this.getField(scope, field), this.getField(scope, \"__DEF_FIELD__\"), this.scriptField[this.getField(scope, field)], this.protoField[this.getField(scope, field)], this.protoField[this.getField(scope, \"__DEF_FIELD__\")]);\n\t\tfor (var sf in this.scriptField[this.getField(scope, field)]) {\n\t\t\t// just grab first one, the others may be bad\n\t\t\tif (typeof defobj === 'undefined') {\n\t\t\t\tvar obj = this.scriptField[this.getField(scope, field)][sf];\n\t\t\t\tif (typeof obj !== 'undefined') {\n\t\t\t\t\tif (typeof obj[3] !== 'undefined') {\n\t\t\t\t\t\tvar f = this.getField(scope, obj[3]);\n\t\t\t\t\t\tif (f.indexOf(\"DECL\", 1) == -1) {\n\t\t\t\t\t\t\tdefobj = [f,  obj[0][\"@name\"]];\n\t\t\t\t\t\t\t// console.error(\"def5 is\", defobj);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (typeof defobj === 'undefined') {\n\t\t\tfor (var pf in this.protoField[this.getField(scope, field)]) {\n\t\t\t\tvar obj2 = this.protoField[this.getField(scope, field)][pf];\n\t\t\t\tif (typeof obj2 !== 'undefined') {\n\t\t\t\t\tdefobj = [obj2[3], obj2[1]];\n\t\t\t\t\t// console.error(\"def2 is\", defobj);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (typeof defobj === 'undefined') {\n\t\t\tfor (var pf2 in this.protoField[this.getField(scope, \"__DEF_FIELD__\")]) {\n\t\t\t\tvar obj3 = this.protoField[this.getField(scope, \"__DEF_FIELD__\")][pf2];\n\t\t\t\tif (typeof obj3 !== 'undefined') {\n\t\t\t\t\tdefobj = [obj3[3], field];\n\t\t\t\t\t// console.error(\"def3 is\", defobj);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (typeof defobj === 'undefined') {\n\t\t\tdefobj = [scope, field];\n\t\t\t// console.error(\"def4 is\", defobj);\n\t\t}\n\t\treturn defobj;\n\t},\n\n\tsetObjectValues: function (scope, field, fieldOrNode, value) {\n\t\t// console.error(\"resolve\", scope, field, fieldOrNode, JSON.stringify(value));\n\t\tvar foundOther = false;\n\t\t// branch out across children of a proto declare\n\t\tfor (var pf in this.protoField[this.getField(scope, field)]) {\n\t\t\tvar obj = this.protoField[this.getField(scope, field)][pf];\n\t\t\tif (typeof obj !== 'undefined') {\n\t\t\t\t// console.error(\"\\t\\tfoundprotovalue\", scope, field, JSON.stringify(obj), fieldOrNode, JSON.stringify(value));\n\t\t\t\tthis.setObjectValue(scope, field, obj, fieldOrNode, value);\n\t\t\t\tfoundOther = true;\n\t\t\t\t// console.error(\"\\t\\tresultprotovalue\", JSON.stringify(obj));\n\t\t\t} else {\n\t\t\t\t// console.error(\"protoundef\", scope, field);\n\t\t\t}\n\t\t}\n\n\t\t// look for script fields\n\t\tfor (var sf in this.scriptField[this.getField(scope, field)]) {\n\t\t\tvar obj2 = this.scriptField[this.getField(scope, field)][sf];\n\t\t\tif (typeof obj2 !== 'undefined') {\n\t\t\t\t// console.error(\"\\t\\tfoundscriptvalue\", scope, field, JSON.stringify(obj2), fieldOrNode, JSON.stringify(value));\n\t\t\t\tthis.setObjectValue(scope, field, obj2, fieldOrNode, value);\n\t\t\t\tfoundOther = true;\n\t\t\t\t// console.error(\"\\t\\tresultscriptvalue\", JSON.stringify(obj2));\n\t\t\t} else {\n\t\t\t\t// console.error(\"scriptundef\", scope, field);\n\t\t\t}\n\t\t}\n\n\t\tif (foundOther) {\n\t\t\treturn;\n\t\t}\n\n\t\t// find prototype up the scope stream\n\t\tfor (var i = 0; i < this.scopeLength(); i++) {\n\t\t\tvar parentScope = this.upScope(i);\n\t\t\tif (!parentScope) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tvar envs = this.getEnv(parentScope, field);\n\t\t\t// console.error(i, parentScope, field, JSON.stringify(envs), JSON.stringify(value));\n\t\t\tfor (var e in envs) {\n\t\t\t\tvar obj3 = envs[e];\n\t\t\t\t// console.error(\"newobject\", JSON.stringify(obj3[0]));\n\t\t\t\t// console.error(\"nodeField\", JSON.stringify(obj3[1]));\n\t\t\t\t// console.error(\"type\", JSON.stringify(obj3[2]));\n\t\t\t\t// console.error(\"newdef\", JSON.stringify(obj3[3]));\n\t\t\t\t// console.error(\"parentscope\", JSON.stringify(parentScope));\n\t\t\t\tif (typeof obj3 !== 'undefined' && obj3[3].indexOf(parentScope) === obj3[3].lastIndexOf(parentScope)) {\n\t\t\t\t\t// console.error(\"\\t\\tfoundenvvalue\", parentScope, obj3[1], JSON.stringify(obj3), fieldOrNode, JSON.stringify(value));\n\t\t\t\t\tthis.setObjectValue(parentScope, obj3[1], obj3, fieldOrNode, value);\n\t\t\t\t\t// console.error(\"\\t\\tresultenvvalue\", JSON.stringify(obj3));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\tsetObjectValue: function (scope, field, obj, fieldOrNode, value) {\n\t\t// console.error(\"SOV\", scope, field, obj, fieldOrNode, value);\n\t\tif (Array.isArray(value) && typeof obj[2] !== 'undefined') {\n\t\t\t// and some SF fields are arrays, so we have to explicitly test for SFNode\n\t\t\tif (obj[2] === \"SFNode\") {\n\t\t\t\t// can't shove an array into an SF, so take the first element, per Roy Walmsley\n\t\t\t\t// console.error(\"SFNode is array=\", value);\n\t\t\t\tvalue = value[0];\n\t\t\t\t// console.error(\"SFNode array[0]=\", value);\n\t\t\t} else if (obj[2] === \"MFNode\") {\n\t\t\t\t// value = { \"Group\" : { \"-children\" : value }};\n\t\t\t\t// console.error(\"MFNode\", value);\n\t\t\t}\n\t\t}\n\t\t// if the recursion didn't set it, set it now\n\t\tvar prefix = obj[1].substr(0, 1);\n\t\tif (prefix !== '-' && prefix !== '@') {\n\t\t\tprefix = fieldOrNode.substr(0, 1);\n\t\t} else {\n\t\t\tprefix = \"\";\n\t\t}\n\t\tif (prefix === '@' && obj[1] === 'children') {\n\t\t\tprefix = '-';\n\t\t}\n\t\tif (prefix === '-' && obj[1] === 'value') {\n\t\t\tprefix = \"@\";\n\t\t}\n\t\tif (!Array.isArray(value) && obj[1] === 'children') {\n\t\t\tvalue = [value];\n\t\t}\n\t\t// console.error(\"SOVobjI\", JSON.stringify(obj));\n\t\t// console.error(\"SOVobj0I\", JSON.stringify(obj[0]));\n\t\t// console.error(\"SOVobj1I\", JSON.stringify(obj[1]));\n\t\t// console.error(\"SOVobj2I\", JSON.stringify(obj[2]));\n\t\t// console.error(\"SOVobj3I\", JSON.stringify(obj[3]));\n\t\t// console.error(\"SOVlsI\", JSON.stringify(obj[0][prefix+obj[1]]));\n\t\t// console.error(\"SOVrsI\", JSON.stringify(value));\n\t\tobj[0][prefix + obj[1]] = value;// JSON.parse(JSON.stringify(value));\n\t\t// console.error(\"SOVvalueO\", JSON.stringify(value));\n\t\t// console.error(\"SOVobj3O\", JSON.stringify(obj[3]));\n\t\t// console.error(\"SOVobj2O\", JSON.stringify(obj[2]));\n\t\t// console.error(\"SOVobj1O\", JSON.stringify(obj[1]));\n\t\t// console.error(\"SOVobj0O\", JSON.stringify(obj[0]));\n\t\t// console.error(\"SOVobjO\", JSON.stringify(obj));\n\t\t// console.error(\"setresult\", obj[0], \"[\", prefix, obj[1], \"]\", '=', value, 'alt', fieldOrNode);\n\t},\n\n\tzap: function (field, object) {\n\t\tvar p;\n\t\tif (typeof object === \"object\") {\n\t\t\tfor (p in object) {\n\t\t\t\tif (p.toLowerCase() === 'is') {\n\t\t\t\t\tvar connect = object[p][\"connect\"];\n\t\t\t\t\tfor (var fld in connect) {\n\t\t\t\t\t\tvar f = connect[fld];\n\t\t\t\t\t\tif (f && f[\"@protoField\"] === field) {\n\t\t\t\t\t\t\t// console.error(\"zapping\", field);\n\t\t\t\t\t\t\tdelete connect[fld];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.zap(field, object[p]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn object;\n\t},\n\tzapIs: function (object) {\n\t\tvar p;\n\t\tif (typeof object === \"object\") {\n\t\t\tfor (p in object) {\n\t\t\t\tif (p.toLowerCase() === 'is') {\n\t\t\t\t\tdelete object[p];\n\t\t\t\t} else {\n\t\t\t\t\tthis.zapIs(object[p]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn object;\n\t},\n\n\tprototypeExpander: function (file, object) {\n\t\tthis.protos = {};\n\t\tthis.names = {};\n\t\tthis.protoField = {};\n\t\tthis.scriptField = {};\n\t\tthis.interfaceField = {};\n\t\tthis.envField = {};\n\t\tthis.scopecount = 0;\n\t\tthis.privatescope = [];\n\t\tthis.defs = {};\n\t\tthis.founddef = null;\n\t\tobject = this.externalPrototypeExpander(file, object);\n\t\tobject = this.realPrototypeExpander(file, object, false);\n\t\tthis.zapIs(object);\n\t\tobject = this.flattener(object);\n\t\t// console.error(\"SCRIPTS\", JSON.stringify(this.scriptField));\n\t\t// console.error(\"PROTOS\", JSON.stringify(this.protoField, null, 2));\n\t\treturn object;\n\t},\n\n\treadCode : function (data, fileExt, protoexp, done, p, newobject) {\n\t\tif (typeof data !== 'undefined') {\n\t\t\tnewobject[p][\"#sourceText\"] = data.split(/\\r?\\n/);\n\t\t\tdelete newobject[p][\"@url\"];\n\t\t}\n\t},\n\n\thandleScript: function (file, object, p, newobject) {\n\t\tnewobject[p] = this.realPrototypeExpander(file, object[p], true);\n\t\t// console.error(\"DEF is\", newobject[p][\"@DEF\"]);\n\t\tthis.setScriptFields(newobject[p][\"field\"], newobject[p][\"@DEF\"]);\n\t\tvar url = newobject[p][\"@url\"];\n\t\tthis.loadURLs(file, url, this.readCode, null, function(){}, p, newobject);\n\t},\n\n\thandleProtoDeclare: function (file, object, p) {\n\t\tvar name = object[p][\"@name\"];\n\t\tvar def = object[p][\"@DEF\"];\n\t\tthis.protos[name] = object[p];\n\t\tthis.saveDef(def);\n\t\t// don't need to save def\n\t\tif (typeof object[p][\"@appinfo\"] !== 'undefined') {\n\t\t\tthis.protos[name][\"@appinfo\"] = object[p][\"@appinfo\"];\n\t\t}\n\t\tif (typeof object[p][\"@documentation\"] !== 'undefined') {\n\t\t\tthis.protos[name][\"@documentation\"] = object[p][\"@documentation\"];\n\t\t}\n\t\tthis.pushScope(\"DECL\" + name);\n\t\tthis.names[def] = name;\n\t\tthis.realPrototypeExpander(file, object[p], false);\n\t\tthis.popScope();\n\t\treturn object;\n\t},\n\n\thandleProtoInterface: function (file, object, p) {\n\t\tvar fields = object[p][\"field\"];\n\t\tfor (var field in fields) {\n\t\t\tvar f = fields[field];\n\t\t\tif (typeof f[\"@value\"] !== 'undefined') {\n\t\t\t\tthis.setInterface(f, \"@value\");\n\t\t\t} else if (typeof f[\"-children\"] !== 'undefined') {\n\t\t\t\tthis.setInterface(f, \"-children\");\n\t\t\t} else {\n\t\t\t\tthis.setInterface(f);\n\t\t\t}\n\t\t}\n\t\treturn object;\n\t},\n\n\thandleProtoInstance: function (file, object, p) {\n\t\tvar name = object[p][\"@name\"];\n\t\tvar def = object[p][\"@DEF\"];\n\t\tvar use = object[p][\"@USE\"];\n\t\tthis.names[def] = name;\n\t\tif (typeof name === 'undefined' && typeof use !== 'undefined') {\n\t\t\tname = this.names[use];\n\t\t}\n\t\tthis.pushScope(\"DECL\" + name);\n\n\t\tvar instance = {};\n\t\tif (typeof def === 'undefined' && typeof use === 'undefined') {\n\t\t\tdef = \"INSTANCE\";\n\t\t}\n\t\tif (this.getDef(def) && typeof use === 'undefined') {\n\t\t\tthis.scopecount += 1000;\n\t\t\tdef += \"\" + this.scopecount;\n\t\t} else {\n\t\t\t// first appearance of def is left alone\n\t\t}\n\t\tif (typeof def !== 'undefined') {\n\t\t\tvar newdef = this.saveDef(def);\n\t\t\tthis.pushScope(def);\n\t\t}\n\t\tvar bodydef;\n\t\tif (typeof this.protos[name] === 'undefined' || typeof this.protos[name]['ProtoBody'] === 'undefined') {\n\t\t\tconsole.error(\"ProtoBody undefined for\", name);\n\t\t} else {\n\t\t\t// console.error(\"Copying ProtoBody\", name);\n\t\t\tvar children = this.protos[name]['ProtoBody']['-children'];\n\t\t\t//  bodydef = this.protos[name]['ProtoBody'][\"@DEF\"];\n\t\t\tfor (var child in children) {\n\t\t\t\tvar ch = children[child];\n\t\t\t\tfor (var objkey in ch) {\n\t\t\t\t\tif (typeof bodydef === 'undefined') {\n\t\t\t\t\t\tbodydef = ch[objkey][\"@DEF\"];\n\t\t\t\t\t\tif (typeof use !== 'undefined') {\n\t\t\t\t\t\t\tvar iuse = this.saveDef(use);\n\t\t\t\t\t\t\tthis.pushScope(use);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tinstance = JSON.parse(JSON.stringify(children));\n\t\t}\n\n\t\t// instance is an array.  Get the first object, no matter how\n\t\t// deep it is.\n\t\t// TODO comments\n\n\t\tvar firstobj = instance;\n\n\t\twhile (Array.isArray(firstobj)) {\n\t\t\tif (firstobj[0] === null || typeof firstobj[0] === 'undefined') {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tfirstobj = firstobj[0];\n\t\t}\n\t\tif (typeof use !== 'undefined' && typeof firstobj === 'object') {\n\t\t\t/*\n\t\t\tif (typeof bodydef !== 'undefined') {\n\t\t\t\tvar bdef = this.saveDef(bodydef);\n\t\t\t\tthis.pushScope(bodydef);\n\t\t\t}\n\t\t\t*/\n\t\t\tvar newobject = {};\n\t\t\tnewobject[objkey] = {};\n\t\t\t// replace ProtoInstance with the first item from the ProtoBody\n\t\t\tnewobject[objkey][\"@USE\"] = this.getScope();\n\t\t\tif (typeof bodydef !== 'undefined') {\n\t\t\t\tthis.popScope();\n\t\t\t}\n\n\t\t} else {\n\t\t\tvar newobject = this.realPrototypeExpander(file, instance, false);\n\n\t\t\tvar fieldValue = object[p][\"fieldValue\"];\n\t\t\tfor (var field in fieldValue) {\n\t\t\t\tvar fv = fieldValue[field];\n\t\t\t\tvar protoField = fv[\"@name\"];\n\t\t\t\tvar fieldOrNode = \"@value\";\n\t\t\t\tvar value = fv[fieldOrNode];\n\t\t\t\tfor (var nv in fv) {\n\t\t\t\t\tif (nv === '@name') {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tfieldOrNode = nv;\n\t\t\t\t\tvalue = fv[fieldOrNode];\n\t\t\t\t\tthis.pushScope(\"FIELD\" + protoField);\n\t\tif (typeof firstobj === 'object' && typeof firstobj[objkey] !== 'undefined') {\n\t\t\tfirstobj[objkey][\"@DEF\"] = this.getScope();\n\t\t}\n\t\t\t\t\tvalue = this.realPrototypeExpander(file, value, false);\n\t\t\t\t\tthis.popScope();\n\t\t\t\t\tthis.getInterface(protoField);\n\t\t\t\t\tthis.setObjectValues(this.getScope(),\n\t\t\t\t\t\tprotoField,\n\t\t\t\t\t\tfieldOrNode,\n\t\t\t\t\t\tvalue);\n\t\t\t\t}\n\t\t\t\t// this.clearScope(fieldname, newobject);\n\t\t\t}\n\t\t}\n\n\t\tif (typeof use !== 'undefined') {\n\t\t\tthis.popScope();\n\t\t}\n\t\tif (typeof def !== 'undefined') {\n\t\t\tthis.popScope();\n\t\t}\n\t\tthis.popScope();\n\t\treturn newobject;\n\t},\n\n\trealPrototypeExpander: function (file, object, inScript) {\n\t\tif (typeof object === \"object\") {\n\t\t\tvar newobject = null;\n\t\t\tif (Array.isArray(object)) {\n\t\t\t\tnewobject = [];\n\t\t\t} else {\n\t\t\t\tnewobject = {};\n\t\t\t}\n\t\t\tfor (var p in object) {\n\t\t\t\tvar plc = p.toLowerCase();\n\t\t\t\tif (plc === 'script') {\n\t\t\t\t\tthis.handleScript(file, object, p, newobject);\n\t\t\t\t} else if (plc === 'protodeclare') {\n\t\t\t\t\tthis.handleProtoDeclare(file, object, p);\n\t\t\t\t} else if (plc === 'protointerface') {\n\t\t\t\t\tthis.handleProtoInterface(file, object, p);\n\t\t\t\t} else if (plc === 'protobody') {\n\t\t\t\t\tthis.realPrototypeExpander(file, object[p], inScript);\n\t\t\t\t} else if (plc === 'protoinstance') {\n\t\t\t\t\tnewobject = this.handleProtoInstance(file, object, p);\n\t\t\t\t} else if (plc === 'connect') {\n\t\t\t\t\tthis.realPrototypeExpander(file, object[p], inScript);\n\t\t\t\t} else if (plc === 'fieldvalue') {\n\t\t\t\t\tthis.realPrototypeExpander(file, object[p], inScript);\n\t\t\t\t} else if (plc === 'field') {\n\t\t\t\t\tnewobject[p] = this.realPrototypeExpander(file, object[p], inScript);\n\t\t\t\t} else if (plc === '@value') {\n\t\t\t\t\tnewobject[p] = this.realPrototypeExpander(file, object[p], inScript);\n\t\t\t\t\t// console.error(\"@value is \", newobject[p]);\n\t\t\t\t} else if (plc === '-children') {\n\t\t\t\t\tnewobject[p] = this.realPrototypeExpander(file, object[p], inScript);\n\t\t\t\t\t// console.error(\"-children is \", newobject[p]);\n\t\t\t\t} else if (plc === 'is') {\n\t\t\t\t\tif (inScript) {\n\t\t\t\t\t\tthis.setScriptConnectFields(file, object, p, newobject);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.setConnectFields(object, p, newobject);\n\t\t\t\t\t}\n\t\t\t\t\tthis.realPrototypeExpander(file, object[p], inScript);\n\t\t\t\t} else if (plc === 'route') {\n\t\t\t\t\tnewobject[p] = {};\n\t\t\t\t\tvar envFrom = this.extractConnectedDef(this.getScope(object[p][\"@fromNode\"]), object[p][\"@fromField\"]);\n\t\t\t\t\tnewobject[p][\"@fromNode\"] = envFrom[0];\n\t\t\t\t\tnewobject[p][\"@fromField\"] = envFrom[1];\n\t\t\t\t\tvar envTo = this.extractConnectedDef(this.getScope(object[p][\"@toNode\"]), object[p][\"@toField\"]);\n\t\t\t\t\tnewobject[p][\"@toNode\"] = envTo[0];\n\t\t\t\t\tnewobject[p][\"@toField\"] = envTo[1];\n\t\t\t\t} else if (plc === '@name') {\n\t\t\t\t\tnewobject[p] = object[p];\n\t\t\t\t} else if (plc === '@def') {\n\t\t\t\t\tnewobject[p] = this.saveDef(object[p]);\n\t\t\t\t\t/*\n\t\t\t\t\tif (typeof process != 'undefined') {\n\t\t\t\t\t\tprocess.stderr.write(\"d3 \");\n\t\t\t\t\t}\n\t\t\t\t\t*/\n\t\t\t\t\tthis.setConnectField(this.getScope(), \"__DEF_FIELD__\", newobject, object[p], \"SFString\", newobject[p]);\n\t\t\t\t} else if (plc === '@use') {\n\t\t\t\t\tnewobject[p] = this.getScope(object[p]);\n\t\t\t\t\t// console.error(\"USE for\", object[p], \"is\", newobject[p]);\n\t\t\t\t} else {\n\t\t\t\t\tnewobject[p] = this.realPrototypeExpander(file, object[p], inScript);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn newobject;\n\t\t} else {\n\t\t\treturn object;\n\t\t}\n\t},\n\n\tsearchForProtoDeclare: function (object, name) {\n\t\tvar p;\n\t\tvar found;\n\t\tif (typeof alert === 'function') {\n\t\t\t// alert(\"searching for \"+ name+\" in \"+JSON.stringify(object));\n\t\t}\n\t\tif (typeof object === \"object\") {\n\t\t\tfor (p in object) {\n\t\t\t\tif (p === 'ProtoDeclare') {\n\t\t\t\t\t// console.error(\"looked at\", object[p][\"@name\"], \"for\", name);\n\t\t\t\t\tif (object[p][\"@name\"] === name) {\n\t\t\t\t\t\t// console.error(\"Found equal names\");\n\t\t\t\t\t\tfound = object;\n\t\t\t\t\t}\n\t\t\t\t\t// find the first one if none match\n\t\t\t\t\tif (typeof found === 'undefined' && this.founddef === null) {\n\t\t\t\t\t\tif (typeof alert === 'function') {\n\t\t\t\t\t\t\t// alert(\"First default found\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// console.error(\"First default found\");\n\t\t\t\t\t\tthis.founddef = object;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (typeof found === 'undefined') {\n\t\t\t\t\tfound = this.searchForProtoDeclare(object[p], name);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (typeof found !== 'undefined') {\n\t\t\t// console.error(\"defaulted to\", found[\"ProtoDeclare\"][\"@name\"]);\n\t\t}\n\t\treturn found;\n\t},\n\n\n\tsearchAndReplaceProto: function (filename, json, protoname, founddef, obj, objret) {\n\t\tif (typeof alert === 'function') {\n\t\t\t// alert(\"finished converting\"+ filename);\n\t\t}\n\t\t// console.error(\"finished converting\"+ filename);\n\t\tvar newobj = this.searchForProtoDeclare(json, protoname);\n\t\tif (typeof newobj === 'undefined') {\n\t\t\tnewobj = founddef;\n\t\t}\n\t\tif (newobj === null || typeof newobj.ProtoDeclare === 'undefined') {\n\t\t\tif (typeof alert === 'function') {\n\t\t\t\t// alert(\"ProtoDeclare is still null or undefined \",filename + \" \" + protoname + \" \" + JSON.stringify(json));\n\t\t\t}\n\t\t\tconsole.error(\"ProtoDeclare is still null or undefined\",filename, protoname, JSON.stringify(json));\n\t\t} else {\n\t\t\tvar name = obj[\"@name\"];\n\t\t\tvar appinfo = obj[\"@appinfo\"];\n\t\t\tvar description = obj[\"@description\"];\n\t\t\tnewobj[\"ProtoDeclare\"][\"@name\"] = name;\n\t\t\tnewobj[\"ProtoDeclare\"][\"@appinfo\"] = appinfo;\n\t\t\tnewobj[\"ProtoDeclare\"][\"@description\"] = description;\n\t\t}\n\t\tif (typeof alert === 'function') {\n\t\t\t// alert(\"returning \"+ JSON.stringify(newobj));\n\t\t\t// console.log(\"returning \", JSON.stringify(newobj));\n\t\t}\n\t\tobjret(newobj);\n\t},\n\n\n\tloadedProto: function (data, protoname, obj, filename, protoexp, objret) {\n\t\tif (typeof data !== 'undefined') {\n\t\t\t// console.error(\"searching for\", protoname);\n\t\t\ttry {\n\t\t\t\t// can only search for one Proto at a time\n\t\t\t\tthis.founddef = null;\n\t\t\t\tvar json = {};\n\t\t\t\ttry {\n\t\t\t\t\t// console.error(\"parsing \", data);\n\t\t\t\t\t// alert(\"parsed JSON from \" + filename);\n\t\t\t\t\t// alert(\"data is \" + JSON.stringify(data));\n\t\t\t\t\t// console.error(\"parsed JSON from \" + filename);\n\t\t\t\t\tjson = JSON.parse(data);\n\t\t\t\t\tprotoexp.searchAndReplaceProto(filename, json, protoname, protoexp.founddef, obj, objret);\n\t\t\t\t} catch (e) {\n\t\t\t\t\t/*\n\t\t\t\t\tconsole.error(\"Failed to parse JSON from \" + filename);\n\t\t\t\t\tif (filename.endsWith(\".x3d\") && (typeof runAndSend === \"function\")) {\n\t\t\t\t\t\tconsole.error(\"calling run and send\");\n\t\t\t\t\t\tconsole.error(\"loadedProto converting \" + filename);\n\t\t\t\t\t\trunAndSend(['---silent', filename], function(json) {\n\t\t\t\t\t\t\tconsole.error(\"got\", json, \"from run and send, searching for\", protoname);\n\t\t\t\t\t\t\tprotoexp.searchAndReplaceProto(filename, json, protoname, protoexp.founddef, obj, objret);\n\t\t\t\t\t\t});\n\t\t\t\t\t\tconsole.error(\"async skip of run and send \" + filename);\n\t\t\t\t\t} else\n\t\t\t\t\t*/\n\t\t\t\t\tif (typeof DOM2JSONSerializer === 'function') {\n\t\t\t\t\t\tif (typeof alert === 'function') {\n\t\t\t\t\t\t\t// alert(\"calling local converter\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// console.error(\"calling local converter\");\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tvar serializer = new DOM2JSONSerializer();\n\t\t\t\t\t\t\tvar str = serializer.serializeToString(null, data.firstElementChild, filename, mapToMethod, fieldTypes);\n\t\t\t\t\t\t\tprotoexp.searchAndReplaceProto(filename, JSON.parse(str), protoname, protoexp.founddef, obj, objret);\n\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\tif (typeof alert === 'function') {\n\t\t\t\t\t\t\t\talert(e);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconsole.error(\"Convert failed\", e);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (typeof alert === 'function') {\n\t\t\t\t\t\t\t// alert(\"Did not convert XML to JSON.  Oops!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconsole.error(\"Did not convert XML to JSON.  Oops!\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\tconsole.error(\"Failed to parse JSON in \", filename, e);\n\t\t\t}\n\t\t} else {\n\t\t\tconsole.error(\"data is undefined for file\", filename);\n\t\t}\n\t},\n\n\tdoLoad : function (data, u, protoexp, done, p, obj) {\n\t\tvar name = obj[\"@name\"];\n\t\tvar nameIndex = u.indexOf(\"#\");\n\t\tvar protoname = name;\n\t\t// console.error(\"doLoad External Prototype\", u);\n\t\tif (nameIndex >= 0) {\n\t\t\tprotoname = u.substring(nameIndex + 1);\n\t\t}\n\n\t\t// console.error(\"protoname is\", protoname, protoexp);\n\t\ttry {\n\t\t\tprotoexp.loadedProto(data, protoname, obj, u, protoexp, function (nuobject) {\n\t\t\t\tif (typeof alert === 'function') {\n\t\t\t\t\t// alert(\"Done searching, found \"+JSON.stringify(nuobject));\n\t\t\t\t}\n\t\t\t\t// console.error(\"Done searching, found\", nuobject);\n\t\t\t\tdone(p, nuobject, protoexp);\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tconsole.error(\"Error searching for proto\", e);\n\t\t}\n\t},\n\n\t/**\n\t * processURLs and make them more kosher for the X3DJSONLD user inteferface to\n\t * deal with.  Pass an array of URLs and a path for the main JSON file you are\n\t * loading.\n\t */\n\tprocessURLs: function(localArray, path) {\n\t\t// console.error(\"Process URLs\", path, localArray);\n\t\tvar url;\n\t\t// No longer need to split\n\t\tfor (url in localArray) {\n\t\t\tif (localArray[url].indexOf(\"http://\") === 0\n\t\t\t || localArray[url].indexOf(\"https://\") === 0) {\n\t\t\t} else if (localArray[url].indexOf(\"urn:web3d:media:textures/panoramas/\") === 0) {\n\t\t\t\tvar ls = localArray[url].lastIndexOf(\"/\");\n\t\t\t\tif (ls > 0) {\n\t\t\t\t\tlocalArray[url] = 'examples/Basic/UniversalMediaPanoramas/'+localArray[url].substring(ls+1);\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\t/*\n\t\t\t\tvar s = localArray[url].indexOf('/');\n\t\t\t\t*/\n\t\t\t\tvar p = localArray[url].indexOf('#');\n\t\t\t\tvar pe = path.lastIndexOf('/');\n\t\t\t\tvar pc = path;\n\t\t\t\tif (pe >= 0) {\n\t\t\t\t\tpc = path.substring(0, pe);\n\t\t\t\t}\n\t\t\t\t/*\n\t\t\t\tif (s != 0 && p != 0) {\n\t\t\t\t\tif (localArray[url].indexOf(pc) != 0) {\n\t\t\t\t\t\t localArray[url] = pc+'/'+localArray[url];\n\t\t\t\t\t}\n\t\t\t\t\tif (localArray[url].indexOf('/') === 0) {\n\t\t\t\t\t\t// no webroot absolute paths.  No /'s for X_ITE shaders\n\t\t\t\t\t\tlocalArray[url] = localArray[url].substring(1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\twhile (localArray[url].startsWith(\"../\")) {\n\t\t\t\t\tlocalArray[url] = localArray[url].substr(3);\n\t\t\t\t\tvar pe = pc.lastIndexOf('/');\n\t\t\t\t\tif (pe >= 0) {\n\t\t\t\t\t\tpc = pc.substring(0, pe);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpc = \"\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (p == 0) {\n\t\t\t\t\tlocalArray[url] = path+localArray[url];\n\t\t\t\t} else {\n\t\t\t\t\tlocalArray[url] = pc+\"/\"+localArray[url];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// for server side\n\t\t\tvar h = localArray[url].lastIndexOf(\"#\") ;\n\t\t\tvar hash = \"\";\n\t\t\tif (h >= 0) {\n\t\t\t\thash = localArray[url].substring(h);\n\t\t\t\tlocalArray[url] = localArray[url].substring(0, h);\n\t\t\t}\n\t\t\t/*\n\t\t\tvar x3d = localArray[url].lastIndexOf(\".x3d\") ;\n\t\t\tif (x3d === localArray[url].length - 4) {\n\t\t\t\tlocalArray[url] = localArray[url].substring(0, x3d)+\".json\" + hash;\n\t\t\t}\n\t\t\t*/\n\t\t\tvar wrl = localArray[url].lastIndexOf(\".wrl\") ;\n\t\t\tif (wrl === localArray[url].length - 4) {\n\t\t\t\tlocalArray[url] = localArray[url].substring(0, wrl)+\".json\" + hash;\n\t\t\t}\n\t\t\tvar wrz = localArray[url].lastIndexOf(\".wrz\") ;\n\t\t\tif (wrz === localArray[url].length - 4) {\n\t\t\t\tlocalArray[url] = localArray[url].substring(0, wrz)+\".json\" + hash;\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\t// console.error(\"Processed URLs\", localArray.join(\" \"));\n\t\treturn localArray;\n\t},\n\n\t/**\n\t * Use almost any method possible to load a set of URLs.  The loadpath is the\n\t * original URL the main JSON got laoded from, Urls is the se of urls, and\n\t * the loadedCallback returns the data and the URL it was loaded from.\n\t *\n\t * The fs, http and https objects are used by server side, and not used\n\t * on the client side unless defined.\n\t */\n\tloadURLs : function(loadpath, urls, loadedCallback, protoexp, done, externProtoDeclare, obj) {\n\t\tif (typeof urls !== 'undefined') {\n\t\t\t// console.error(\"Preprocessed\", urls)\n\t\t\turls = this.processURLs(urls, loadpath);\n\t\t\t// console.error(\"Postprocessed\", urls)\n\t\t\tfor (var u in urls) {\n\t\t\t\ttry {\n\t\t\t\t\tvar url = urls[u];\n\t\t\t\t\t(function(url) {\n\t\t\t\t\t\tvar p = url.indexOf(\"://\");\n\t\t\t\t\t\tvar protocol = \"file\";\n\t\t\t\t\t\tvar host = \"localhost\";\n\t\t\t\t\t\tvar path = \"/\"+loadpath;\n\t\t\t\t\t\tif (p > 0) {\n\t\t\t\t\t\t\tprotocol = url.substring(0, p);\n\t\t\t\t\t\t\tvar pa = url.indexOf(\"/\", p+3);\n\t\t\t\t\t\t\thost = url.substring(p+3, pa);\n\t\t\t\t\t\t\tpath = url.substring(pa);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (protocol === \"http\") {\n\t\t\t\t\t\t\t// console.error(\"Loading HTTP URL\", url);\n\t\t\t\t\t\t\tif (typeof http !== 'undefined') {\n\t\t\t\t\t\t\t\thttp.get({ host: host, path: path}, function(res) {\n\t\t\t\t\t\t\t\t\tvar data = '';\n\t\t\t\t\t\t\t\t\tres.on('data', function (d) {\n\t\t\t\t\t\t\t\t\t\tdata += d;\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\tres.on('end', function() {\n\t\t\t\t\t\t\t\t\t\tloadedCallback(data, url, protoexp, done, externProtoDeclare, obj);\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tvar request = new XMLHttpRequest();\n\t\t\t\t\t\t\t\trequest.open('GET', url, false);  // `false` makes the request synchronous\n\t\t\t\t\t\t\t\trequest.send(null);\n\t\t\t\t\t\t\t\tif (request.status === 200) {\n\t\t\t\t\t\t\t\t\tvar data = request.responseText;\n\t\t\t\t\t\t\t\t\tloadedCallback(data, url, protoexp, done, externProtoDeclare, obj);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (protocol === \"https\") {\n\t\t\t\t\t\t\t// console.error(\"Loading HTTPS URL\", url);\n\t\t\t\t\t\t\tif (typeof https !== 'undefined') {\n\t\t\t\t\t\t\t\thttps.get({ host: host, path: path}, function(res) {\n\t\t\t\t\t\t\t\t\tvar data = '';\n\t\t\t\t\t\t\t\t\tres.on('data', function (d) {\n\t\t\t\t\t\t\t\t\t\tdata += d;\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\tres.on('end', function() {\n\t\t\t\t\t\t\t\t\t\tloadedCallback(data, url, protoexp, done, externProtoDeclare, obj);\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tvar request = new XMLHttpRequest();\n\t\t\t\t\t\t\t\trequest.open('GET', url, false);  // `false` makes the request synchronous\n\t\t\t\t\t\t\t\trequest.send(null);\n\t\t\t\t\t\t\t\tif (request.status === 200) {\n\t\t\t\t\t\t\t\t\tvar data = request.responseText;\n\t\t\t\t\t\t\t\t\tloadedCallback(data, url, protoexp, done, externProtoDeclare, obj);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (typeof fs !== 'undefined' && !protocol.startsWith(\"http\")) {\n\t\t\t\t\t\t\t// should be async, but out of memory\n\t\t\t\t\t\t\t// console.error(\"Loading FILE URL\", url);\n\t\t\t\t\t\t\tvar hash = url.indexOf(\"#\");\n\t\t\t\t\t\t\tif (hash > 0) {\n\t\t\t\t\t\t\t\turl = url.substring(0, hash);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tvar data = fs.readFileSync(url);\n\t\t\t\t\t\t\t\tloadedCallback(data.toString(), url, protoexp, done, externProtoDeclare, obj);\n\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\tvar filename = url;\n\t\t\t\t\t\t\t\tif (filename.endsWith(\".json\")) {\n\t\t\t\t\t\t\t\t\tfilename = filename.substring(0, filename.lastIndexOf(\".\"))+\".x3d\";\n\t\t\t\t\t\t\t\t\t// console.error(\"converting possible X3D to JSON\", filename);\n\t\t\t\t\t\t\t\t\tif (typeof runAndSend === 'function') {\n\t\t\t\t\t\t\t\t\t\trunAndSend(['---silent', filename], function(jsobj) {\n\t\t\t\t\t\t\t\t\t\t\tdata = JSON.stringify(jsobj);\n\t\t\t\t\t\t\t\t\t\t\tloadedCallback(data, filename, protoexp, done, externProtoDeclare, obj);\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar request = new XMLHttpRequest();\n\t\t\t\t\t\t\trequest.open('GET', url, false);  // `false` makes the request synchronous\n\t\t\t\t\t\t\trequest.send(null);\n\t\t\t\t\t\t\tif (request.status === 200) {\n\t\t\t\t\t\t\t\tvar data = request.responseText;\n\t\t\t\t\t\t\t\tloadedCallback(data, url, protoexp, done, externProtoDeclare, obj);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconsole.error(\"Didn't load\", url, \".  No file system or http request.\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t})(url);\n\t\t\t\t} catch (e) {\n\t\t\t\t\tconsole.error(e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\tload : function (p, file, object, protoexp, done) {\n\t\tvar obj = object[p];\n\t\tvar url = obj[\"@url\"];\n\t\t// this is a single task\n\t\t// console.error(\"loading External Prototype\", file, url);\n\t\tthis.loadURLs(file, url, protoexp.doLoad, protoexp, done, p, obj);\n\t},\n\texternalPrototypeExpander: function (file, object) {\n\t\tif (typeof object === \"object\") {\n\t\t\tvar newobject = null;\n\t\t\tif (Array.isArray(object)) {\n\t\t\t\tnewobject = [];\n\t\t\t} else {\n\t\t\t\tnewobject = {};\n\t\t\t}\n\t\t\tfor (var p in object) {\n\t\t\t\tif (p === \"ExternProtoDeclare\") {\n\t\t\t\t\tthis.load(p, file, object, this, function(p, newobj, protoexp) {\n\t\t\t\t\t\tif (newobj != null && typeof newobj != 'undefined') {\n\t\t\t\t\t\t\t// process new proto declare for additional extern proto declares\n\t\t\t\t\t\t\t// console.log(\"*******\", typeof protoexp);\n\t\t\t\t\t\t\tnewobject[\"ProtoDeclare\"] = protoexp.externalPrototypeExpander(file, newobj)[\"ProtoDeclare\"];\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\t// console.log(\"*******\", typeof this);\n\t\t\t\t\tnewobject[p] = this.externalPrototypeExpander(file, object[p]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar expectedreturn = Object.keys(object).length;\n\t\t\t// Wait for expectedreturn tasks to finish\n\t\t\twhile (expectedreturn > Object.keys(newobject).length + 1); {  // when they are equal, we exit\n\t\t\t       // console.error(expectedreturn, '=', Object.keys(newobject).length);\n\t\t\t       setTimeout(function () { }, 50);\n\t\t\t}\n\t\t\treturn newobject;\n\t\t} else {\n\t\t\treturn object;\n\t\t}\n\t}\n};\n\nx3dom.protoExpander = new x3dom.PROTOS();\n\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * Philip Taylor: http://philip.html5.org\n */\n\nx3dom.shader = {};\n\nx3dom.shader.PICKING = \"picking\";\nx3dom.shader.PICKING_24 = \"picking24\";\nx3dom.shader.PICKING_ID = \"pickingId\";\nx3dom.shader.PICKING_COLOR = \"pickingColor\";\nx3dom.shader.PICKING_TEXCOORD = \"pickingTexCoord\";\nx3dom.shader.FRONTGROUND_TEXTURE = \"frontgroundTexture\";\nx3dom.shader.BACKGROUND_TEXTURE = \"backgroundTexture\";\nx3dom.shader.BACKGROUND_SKYTEXTURE = \"backgroundSkyTexture\";\nx3dom.shader.BACKGROUND_CUBETEXTURE = \"backgroundCubeTexture\";\nx3dom.shader.BACKGROUND_CUBETEXTURE_DDS = \"backgroundCubeTextureDDS\";\nx3dom.shader.BLUR = \"blur\";\nx3dom.shader.DEPTH = \"depth\";\nx3dom.shader.NORMAL = \"normal\";\nx3dom.shader.TEXTURE_REFINEMENT = \"textureRefinement\";\nx3dom.shader.SSAO = \"ssao\";\n\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * Philip Taylor: http://philip.html5.org\n */\n \n \n/*******************************************************************************\n* Material\n********************************************************************************/\n x3dom.shader.material = function() {\n\tvar shaderPart = \"uniform vec3  diffuseColor;\\n\" +\n\t\t\t\t\t \"uniform vec3  specularColor;\\n\" +\n\t\t\t\t\t \"uniform vec3  emissiveColor;\\n\" +\n\t\t\t\t\t \"uniform float shininess;\\n\" +\n\t\t\t\t\t \"uniform float transparency;\\n\" +\n\t\t\t\t\t \"uniform float ambientIntensity;\\n\";\n\t\t\t\t\t \n\treturn shaderPart;\n};\n\n/*******************************************************************************\n* Material\n********************************************************************************/\nx3dom.shader.physicalMaterial = function() {\n\tvar shaderPart = \"uniform vec3  baseColorFacor;\\n\" +\n\t\t\t\t\t \"uniform vec3  emissiveFactor;\\n\" +\n\t\t\t\t\t \"uniform float metallicFactor;\\n\" +\n\t\t\t\t\t \"uniform float roughnessFactor;\\n\";\n\t\t\t\t\t \n\treturn shaderPart;\n};\n\n/*******************************************************************************\n * TwoSidedMaterial\n ********************************************************************************/\nx3dom.shader.twoSidedMaterial = function() {\n    var shaderPart = \"uniform vec3  backDiffuseColor;\\n\" +\n                     \"uniform vec3  backSpecularColor;\\n\" +\n                     \"uniform vec3  backEmissiveColor;\\n\" +\n                     \"uniform float backShininess;\\n\" +\n                     \"uniform float backTransparency;\\n\" +\n                     \"uniform float backAmbientIntensity;\\n\";\n\n    return shaderPart;\n};\n\t\t\t\t\t\t \n/*******************************************************************************\n* Fog\n********************************************************************************/\t\t\t\t\t\t \nx3dom.shader.fog = function() {\n\n\tvar shaderPart = \"uniform vec3  fogColor;\\n\" +\n\t\t\t\t\t \"uniform float fogType;\\n\" +\n\t\t\t\t\t \"uniform float fogRange;\\n\" +\n\t\t\t\t\t \"varying vec3 fragEyePosition;\\n\" +\n\t\t\t\t\t \"float calcFog(in vec3 eye) {\\n\" +\n\t\t\t\t\t \"   float f0 = 0.0;\\n\" +      \n\t\t\t\t\t \"   if(fogType == 0.0) {\\n\" +\n\t\t\t\t\t \"       if(length(eye) < fogRange){\\n\" +\n\t\t\t\t\t \"           f0 = (fogRange-length(eye)) / fogRange;\\n\" +\n\t\t\t\t\t \"       }\\n\" +\n\t\t\t\t\t \"   }else{\\n\" +\n\t\t\t\t\t \"       if(length(eye) < fogRange){\\n\" +\n\t\t\t\t\t \"           f0 = exp(-length(eye) / (fogRange-length(eye) ) );\\n\" +\n\t\t\t\t\t \"       }\\n\" +\n\t\t\t\t\t \"   }\\n\" +\n\t\t\t\t\t \"   f0 = clamp(f0, 0.0, 1.0);\\n\" +\n\t\t\t\t\t \"   return f0;\\n\" +\n\t\t\t\t\t \"}\\n\";\n\t\t\t\t\t \n\treturn shaderPart;\n};\n\n/*******************************************************************************\n * Clipplane\n ********************************************************************************/\nx3dom.shader.clipPlanes = function(numClipPlanes) {\n    var shaderPart = \"\", c;\n\n    for(c=0; c<numClipPlanes; c++) {\n        shaderPart += \t\"uniform vec4 clipPlane\"+c+\"_Plane;\\n\";\n        shaderPart += \t\"uniform float clipPlane\"+c+\"_CappingStrength;\\n\";\n        shaderPart += \t\"uniform vec3 clipPlane\"+c+\"_CappingColor;\\n\";\n    }\n\n    shaderPart += \"vec3 calculateClipPlanes() {\\n\";\n\n    for(c=0; c<numClipPlanes; c++) {\n\n\t\tshaderPart += \"vec4 clipPlane\" + c + \";\\n\";\n\t\tshaderPart += \"if(fragEyeIdx == 1.0){\\n\"\n    \tshaderPart += \"    clipPlane\" + c + \" = clipPlane\" + c + \"_Plane * viewMatrixInverse2;\\n\";\n    \tshaderPart += \"}else{\\n\";\n    \tshaderPart += \"    clipPlane\" + c + \" = clipPlane\" + c + \"_Plane * viewMatrixInverse;\\n\";\n    \tshaderPart += \"}\\n\";\n        shaderPart += \"float dist\" + c + \" = dot(fragPosition, clipPlane\" + c + \");\\n\";\n    }\n\n    shaderPart += \"    if( \";\n\n    for(c=0; c<numClipPlanes; c++) {\n        if(c!=0) {\n            shaderPart += \" || \";\n        }\n        shaderPart += \"dist\" + c + \" < 0.0\" ;\n    }\n\n    shaderPart += \" ) \";\n    shaderPart += \"{ discard; }\\n\";\n\n    for (c = 0; c < numClipPlanes; c++) {\n        shaderPart += \"    if( abs(dist\" + c + \") < clipPlane\" + c + \"_CappingStrength ) \";\n        shaderPart += \"{ return clipPlane\" + c + \"_CappingColor; }\\n\";\n    }\n\n    shaderPart += \"    return vec3(-1.0, -1.0, -1.0);\\n\";\n\n    shaderPart += \"}\\n\";\n\n    return shaderPart;\n};\n\n/*******************************************************************************\n* Gamma correction support: initial declaration\n********************************************************************************/\nx3dom.shader.gammaCorrectionDecl = function(properties) {\n\tvar shaderPart = \"\";\n    if (properties.GAMMACORRECTION === \"none\") {\n        // do not emit any declaration. 1.0 shall behave 'as without gamma'.\n    } else if (properties.GAMMACORRECTION === \"fastlinear\") {\n        // This is a slightly optimized gamma correction\n        // which uses a gamma of 2.0 instead of 2.2. Gamma 2.0 is less costly\n        // to encode in terms of cycles as sqrt() is usually optimized\n        // in hardware.\n        shaderPart += \"vec4 gammaEncode(vec4 color){\\n\" +\n                      \"  vec4 tmp = sqrt(color);\\n\" +\n                      \"  return vec4(tmp.rgb, color.a);\\n\" +\n                      \"}\\n\";\n\n        shaderPart += \"vec4 gammaDecode(vec4 color){\\n\" +\n                      \"  vec4 tmp = color * color;\\n\" +\n                      \"  return vec4(tmp.rgb, color.a);\\n\" +\n                      \"}\\n\";\n\n        shaderPart += \"vec3 gammaEncode(vec3 color){\\n\" +\n                      \"  return sqrt(color);\\n\" +\n                      \"}\\n\";\n\n        shaderPart += \"vec3 gammaDecode(vec3 color){\\n\" +\n                      \"  return (color * color);\\n\" +\n                      \"}\\n\";\n    } else {\n        // The preferred implementation compensating for a gamma of 2.2, which closely\n        // follows sRGB; alpha remains linear\n        // minor opt: 1.0 / 2.2 = 0.4545454545454545\n        shaderPart += \"const vec4 gammaEncode4Vector = vec4(0.4545454545454545, 0.4545454545454545, 0.4545454545454545, 1.0);\\n\";\n        shaderPart += \"const vec4 gammaDecode4Vector = vec4(2.2, 2.2, 2.2, 1.0);\\n\";\n\n        shaderPart += \"vec4 gammaEncode(vec4 color){\\n\" +\n                      \"    return pow(abs(color), gammaEncode4Vector);\\n\" +\n                      \"}\\n\";\n\n        shaderPart += \"vec4 gammaDecode(vec4 color){\\n\" +\n                      \"    return pow(abs(color), gammaDecode4Vector);\\n\" +\n                      \"}\\n\";\n\n        // RGB; minor opt: 1.0 / 2.2 = 0.4545454545454545\n        shaderPart += \"const vec3 gammaEncode3Vector = vec3(0.4545454545454545, 0.4545454545454545, 0.4545454545454545);\\n\";\n        shaderPart += \"const vec3 gammaDecode3Vector = vec3(2.2, 2.2, 2.2);\\n\";\n\n        shaderPart += \"vec3 gammaEncode(vec3 color){\\n\" +\n                      \"    return pow(abs(color), gammaEncode3Vector);\\n\" +\n                      \"}\\n\";\n\n        shaderPart += \"vec3 gammaDecode(vec3 color){\\n\" +\n                      \"    return pow(abs(color), gammaDecode3Vector);\\n\" +\n                      \"}\\n\";\n    }\n\treturn shaderPart;\n};\n\n/*******************************************************************************\n* Gamma correction support: encoding and decoding of given expressions\n* \n* Unlike other shader parts these javascript functions wrap the same-named gamma\n* correction shader functions (if applicable). When gamma correction is  not used,\n* the expression will be returned verbatim. Consequently, any terminating semicolon\n* is to be issued by the caller.\n********************************************************************************/\nx3dom.shader.encodeGamma = function(properties, expr) {\n    if (properties.GAMMACORRECTION === \"none\") {\n        // Naive implementation: no-op, return verbatim\n        return expr;\n    } else {\n        // The 2.0 and 2.2 cases are transparent at the call site\n        return \"gammaEncode (\" + expr + \")\";\n    }\n};\n\nx3dom.shader.decodeGamma = function(properties, expr) {\n    if (properties.GAMMACORRECTION === \"none\") {\n        // Naive implementation: no-op, return verbatim\n        return expr;\n    } else {\n        // The 2.0 and 2.2 cases are transparent at the call site\n        return \"gammaDecode (\" + expr + \")\";\n    }\n};\n\n/*******************************************************************************\n* Shadow\n********************************************************************************/\nx3dom.shader.rgbaPacking = function() {\n\tvar shaderPart = \"\";\n\t\tshaderPart += \t\n\t\t\t\t\t\"vec4 packDepth(float depth){\\n\" +\n\t\t\t\t\t\"\tdepth = (depth + 1.0)*0.5;\\n\" +\n\t\t\t\t\t\"\tvec4 outVal = vec4(1.0, 255.0, 65025.0, 160581375.0) * depth;\\n\" +\n\t\t\t\t\t\"\toutVal = fract(outVal);\\n\" +\n\t\t\t\t\t\"  \toutVal -= outVal.yzww * vec4(1.0/255.0, 1.0/255.0, 1.0/255.0, 0.0);\\n\" +\n\t\t\t\t\t\"  \treturn outVal;\\n\" +\n\t\t\t\t\t\"}\\n\";\n\t\t\n\t\tshaderPart += \t\n\t\t\t\t\t\"float unpackDepth(vec4 color){\\n\" +\n\t\t\t\t\t\"\tfloat depth = dot(color, vec4(1.0, 1.0/255.0, 1.0/65025.0, 1.0/160581375.0));\\n\" +\n\t\t\t\t\t\"\treturn (2.0*depth - 1.0);\\n\" + \n\t\t\t\t\t\"}\\n\";\n\treturn shaderPart;\n};\n\nx3dom.shader.calcMipLevel = function() {\n\tvar shaderPart = \"\";\n\n\tshaderPart +=\n\t\t\t\t\"vec2 dirToCubeUV( vec3 dir ) {\\n\" +\n\t\t\t\t\"    vec2 uv = vec2(0.0);\\n\" +\n\t\t\t\t\"    vec3 absDir = abs(dir);\\n\" +\n\t\t\t\t\"    if( absDir.x >= absDir.y && absDir.x >= absDir.z) {\\n\" +\n\t\t\t\t\"    \tif(dir.x < 0.0) {\\n\" +\n\t\t\t\t\"   \t\tuv.x = 1.0 - (((dir.z/absDir.x) + 1.0) * 0.5);\\n\" +\n\t\t\t\t\"   \t\tuv.y = 1.0 - (((-dir.y/absDir.x) + 1.0) * 0.5);\\n\" +\n\t\t\t\t\"   \t} else {\\n\" +\n\t\t\t\t\"   \t\tuv.x = 1.0 - (((-dir.z/absDir.x) + 1.0) * 0.5);\\n\" +\n\t\t\t\t\"   \t\tuv.y = 1.0 - (((-dir.y/absDir.x) + 1.0) * 0.5);\\n\" +\n\t\t\t\t\"   \t}\\n\" +\n\t\t\t\t\"   } else if( absDir.y >= absDir.x && absDir.y >= absDir.z) {\\n\" +\n\t\t\t\t\"   \tif(dir.y < 0.0) {\\n\" +\n\t\t\t\t\"  \t\t\tuv.x = ((dir.x/absDir.y) + 1.0) * 0.5;\\n\" +\n\t\t\t\t\"   \t\tuv.y = ((-dir.z/absDir.y) + 1.0) * 0.5;\\n\" +\n\t\t\t\t\"   \t} else {\\n\" +\n\t\t\t\t\"   \t\tuv.x = ((dir.x/absDir.y) + 1.0) * 0.5;\\n\" +\n\t\t\t\t\"   \t\tuv.y = ((dir.z/absDir.y) + 1.0) * 0.5;\\n\" +\n\t\t\t\t\"if(uv.y == 0.0) { uv.x = 1.0; uv.y = 0.0; }\\n\"+\n\t\t\t\t\"   \t}\\n\" +\n\t\t\t\t\"   } else if( absDir.z >= absDir.x && absDir.z >= absDir.y) {\\n\" +\n\t\t\t\t\"   \tif(dir.z < 0.0) {\\n\" +\n\t\t\t\t\"   \t\tuv.x = (((-dir.x/absDir.z) + 1.0) * 0.5);\\n\" +\n\t\t\t\t\"   \t\tuv.y = 1.0 - (((-dir.y/absDir.z) + 1.0) * 0.5);\\n\" +\n\t\t\t\t\"   \t} else {\\n\" +\n\t\t\t\t\"   \t\tuv.x = ((dir.x/absDir.z) + 1.0) * 0.5;\\n\" +\n\t\t\t\t\"   \t\tuv.y = 1.0 - (((-dir.y/absDir.z) + 1.0) * 0.5);\\n\" +\n\t\t\t\t\"   \t}\\n\" +\n\t\t\t\t\"   }\\n\" +\n\n\t\t\t\t\"   float a = pow(64.0,2.0) / pow(64.0,3.0);\\n\" +\n\t\t\t\t\"\tuv.x = a * pow(uv.x, 3.0) + uv.x;\\n\" +\n\t\t\t\t\"\tuv.y = a * pow(uv.y, 3.0) + uv.y;\\n\" +\n\t\t\t\t\"   return uv;\\n\" +\n\t\t\t\t\"}\\n\";   \n\n\tshaderPart +=\n\t\t\t\t\"float calcMipLevel( vec2 uv ) {\\n\" + \n\t            \"\tvec2  dx_vtc        = dFdx(uv) * 64.0;\\n\" + \n\t\t\t\t\"\tvec2  dy_vtc        = dFdy(uv) * 64.0;\\n\" + \n\t\t\t\t\"\tfloat delta_max_sqr = max(dot(dx_vtc, dx_vtc), dot(dy_vtc, dy_vtc));\\n\" + \n\t\t\t\t\"\treturn 0.5 * log2(delta_max_sqr);\\n\" + \n\t\t\t\t\"}\\n\";\n\n\tshaderPart += \n\t\t\t\t\"vec3 fixSeams(vec3 vec, float mipmapIndex) {\\n\" + \n\t\t\t\t\"\tfloat scale = 1.0 - exp2(mipmapIndex) / 64.0;\\n\" + \n\t\t\t\t\"\tfloat M = max(max(abs(vec.x), abs(vec.y)), abs(vec.z));\\n\" + \n\t\t\t\t\"\tif (abs(vec.x) != M) vec.x *= scale;\\n\" + \n\t\t\t\t\"\tif (abs(vec.y) != M) vec.y *= scale;\\n\" + \n\t\t\t\t\"\tif (abs(vec.z) != M) vec.z *= scale;\\n\" + \n\t\t\t\t\"\treturn vec;\\n\" + \n\t\t\t\t\"}\"\n\n\treturn shaderPart;\n};\n\nx3dom.shader.shadowRendering = function(){\n\t//determine if and how much a given position is influenced by given light\n\tvar shaderPart = \"\";\n\tshaderPart +=\n\t\t\t\t\"float getLightInfluence(float lType, float lShadowIntensity, float lOn, vec3 lLocation, vec3 lDirection, \" + \n\t\t\t\t\"float lCutOffAngle, float lBeamWidth, vec3 lAttenuation, float lRadius, vec3 eyeCoords) {\\n\" +\n\t\t\t\t\"\tif (lOn == 0.0 || lShadowIntensity == 0.0){ return 0.0;\\n\" +\n\t\t\t\t\"\t} else if (lType == 0.0) {\\n\" +\n\t\t\t\t\"\t\treturn 1.0;\\n\" +\n\t\t\t\t\"\t} else {\\n\" +\n\t\t\t\t\"   \tfloat attenuation = 0.0;\\n\" +\n\t\t\t\t\"   \tvec3 lightVec = (lLocation - (eyeCoords));\\n\" +\n\t\t\t\t\"   \tfloat distance = length(lightVec);\\n\" +\n\t\t\t\t\"\t\tlightVec = normalize(lightVec);\\n\" +\n\t\t\t\t\"\t\teyeCoords = normalize(-eyeCoords);\\n\" +\n\t\t\t\t\"   \tif(lRadius == 0.0 || distance <= lRadius) {\\n\" +\n\t\t\t\t\"       \tattenuation = 1.0 / max(lAttenuation.x + lAttenuation.y * distance + lAttenuation.z * (distance * distance), 1.0);\\n\" +\n\t\t\t\t\"\t\t}\\n\" +\n\t\t\t\t\" \t\tif (lType == 1.0) return attenuation;\\n\" +\n\t\t\t\t\"   \tfloat spotAngle = acos(max(0.0, dot(-lightVec, normalize(lDirection))));\\n\" +\n\t\t\t\t\"   \tif(spotAngle >= lCutOffAngle) return 0.0;\\n\" +\n\t\t\t\t\"   \telse if(spotAngle <= lBeamWidth) return attenuation;\\n\" +\n\t\t\t\t\"   \telse return attenuation * (spotAngle - lCutOffAngle) / (lBeamWidth - lCutOffAngle);\\n\" +\n\t\t\t\t\"\t}\\n\" +\n\t\t\t\t\"}\\n\";\n\t\n\t// get light space depth of view sample and all entries of the shadow map\n\tshaderPart += \t\n\t\t\t\t\"void getShadowValues(inout vec4 shadowMapValues, inout float viewSampleDepth, in mat4 lightMatrix, in vec4 worldCoords, in sampler2D shadowMap){\\n\" +\n\t\t\t\t\"\tvec4 lightSpaceCoords = lightMatrix*worldCoords;\\n\" +\n\t\t\t\t\"\tvec3 lightSpaceCoordsCart = lightSpaceCoords.xyz / lightSpaceCoords.w;\\n\" +\n\t\t\t\t\"\tvec2 textureCoords = (lightSpaceCoordsCart.xy + 1.0)*0.5;\\n\" +\n\t\t\t\t\"\tviewSampleDepth = lightSpaceCoordsCart.z;\\n\" +\t\n\t\t\t\t\"\tshadowMapValues = texture2D(shadowMap, textureCoords);\\n\";\n\tif (!x3dom.caps.FP_TEXTURES  || x3dom.caps.MOBILE)\n\t\tshaderPart +=\t\"\tshadowMapValues = vec4(1.0,1.0,unpackDepth(shadowMapValues),1.0);\\n\";\n\tshaderPart +=\"}\\n\";\n\n\t\n\t// get light space depth of view sample and all entries of the shadow map for point lights\n\tshaderPart += \t\n\t\t\t\t\"void getShadowValuesPointLight(inout vec4 shadowMapValues, inout float viewSampleDepth, in vec3 lLocation, in vec4 worldCoords, in mat4 lightViewMatrix,\" +\n\t\t\t\t\"in mat4 lMatrix_0, in mat4 lMatrix_1, in mat4 lMatrix_2, in mat4 lMatrix_3, in mat4 lMatrix_4, in mat4 lMatrix_5,\" +\n\t\t\t\t\"in sampler2D shadowMap_0, in sampler2D shadowMap_1, in sampler2D shadowMap_2, in sampler2D shadowMap_3,\"+\n\t\t\t\t\"in sampler2D shadowMap_4, in sampler2D shadowMap_5){\\n\" +\n\t\t\t\t\"\tvec4 transformed = lightViewMatrix * worldCoords;\\n\" +\n\t\t\t\t\"\tvec3 lightVec = normalize(transformed.xyz/transformed.w);\\n\"+\n\t\t\t\t\"\tvec3 lightVecAbs = abs(lightVec);\\n\" +\n\t\t\t\t\"\tfloat maximum = max(max(lightVecAbs.x, lightVecAbs.y),lightVecAbs.z);\\n\" +\n\t\t\t\t\"\tif (lightVecAbs.x == maximum) {\\n\" +\n\t\t\t\t\"\t\tif (lightVec.x < 0.0) getShadowValues(shadowMapValues, viewSampleDepth, lMatrix_3,worldCoords,shadowMap_3);\\n\"+\t\t//right\n\t\t\t\t\"\t\telse getShadowValues(shadowMapValues, viewSampleDepth, lMatrix_1,worldCoords,shadowMap_1);\\n\" +\t\t\t\t\t\t//left\n\t\t\t\t\"\t}\\n\" +\n\t\t\t\t\"\telse if (lightVecAbs.y == maximum) {\\n\" +\n\t\t\t\t\"\t\tif (lightVec.y < 0.0) getShadowValues(shadowMapValues, viewSampleDepth, lMatrix_4,worldCoords,shadowMap_4);\\n\"+\t\t//front\n\t\t\t\t\"\t\telse getShadowValues(shadowMapValues, viewSampleDepth, lMatrix_5,worldCoords,shadowMap_5);\\n\" +\t\t\t\t\t\t//back\n\t\t\t\t\"\t}\\n\" +\n\t\t\t\t\"\telse if (lightVec.z < 0.0) getShadowValues(shadowMapValues, viewSampleDepth, lMatrix_0,worldCoords,shadowMap_0);\\n\"+\t//bottom\n\t\t\t\t\"\telse getShadowValues(shadowMapValues, viewSampleDepth, lMatrix_2,worldCoords,shadowMap_2);\\n\" +\t\t\t\t\t\t\t//top\n\t\t\t\t\"}\\n\";\t\n\n\t// get light space depth of view sample and all entries of the shadow map\n\tshaderPart += \t\n\t\t\t\t\"void getShadowValuesCascaded(inout vec4 shadowMapValues, inout float viewSampleDepth, in vec4 worldCoords, in float eyeDepth, in mat4 lMatrix_0, in mat4 lMatrix_1, in mat4 lMatrix_2,\"+\n\t\t\t\t\"in mat4 lMatrix_3, in mat4 lMatrix_4, in mat4 lMatrix_5, in sampler2D shadowMap_0, in sampler2D shadowMap_1, in sampler2D shadowMap_2,\"+\n\t\t\t\t\"in sampler2D shadowMap_3, in sampler2D shadowMap_4, in sampler2D shadowMap_5, in float split_0, in float split_1, in float split_2, in float split_3, in float split_4){\\n\" +\n\t\t\t\t\"\tif (eyeDepth < split_0) getShadowValues(shadowMapValues, viewSampleDepth, lMatrix_0, worldCoords, shadowMap_0);\\n\" +\n\t\t\t\t\"\telse if (eyeDepth < split_1) getShadowValues(shadowMapValues, viewSampleDepth, lMatrix_1, worldCoords, shadowMap_1);\\n\" +\n\t\t\t\t\"\telse if (eyeDepth < split_2) getShadowValues(shadowMapValues, viewSampleDepth, lMatrix_2, worldCoords, shadowMap_2);\\n\" +\n\t\t\t\t\"\telse if (eyeDepth < split_3) getShadowValues(shadowMapValues, viewSampleDepth, lMatrix_3, worldCoords, shadowMap_3);\\n\" +\n\t\t\t\t\"\telse if (eyeDepth < split_4) getShadowValues(shadowMapValues, viewSampleDepth, lMatrix_4, worldCoords, shadowMap_4);\\n\" +\n\t\t\t\t\"\telse getShadowValues(shadowMapValues, viewSampleDepth, lMatrix_5, worldCoords, shadowMap_5);\\n\" +\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\"}\\n\";\t\n\t\t\t\t\n\tshaderPart += \t\n\t\t\t\t\"float ESM(float shadowMapDepth, float viewSampleDepth, float offset){\\n\";\n\tif (!x3dom.caps.FP_TEXTURES || x3dom.caps.MOBILE)\n\t\t\tshaderPart += \t\"\treturn exp(-80.0*(1.0-offset)*(viewSampleDepth - shadowMapDepth));\\n\";\n\telse \tshaderPart += \t\"\treturn shadowMapDepth * exp(-80.0*(1.0-offset)*viewSampleDepth);\\n\";\n\tshaderPart +=\"}\\n\";\t\n\n\n\tshaderPart += \t\n\t\t\t\t\"float VSM(vec2 moments, float viewSampleDepth, float offset){\\n\"+\n\t\t\t\t\"\tviewSampleDepth = (viewSampleDepth + 1.0) * 0.5;\\n\" +\n\t\t\t\t\"\tif (viewSampleDepth <= moments.x) return 1.0;\\n\" +\n\t\t\t\t\"\tfloat variance = moments.y - moments.x * moments.x;\\n\" +\n\t\t\t\t\"\tvariance = max(variance, 0.00002 + offset*0.01);\\n\" +\n\t\t\t\t\"\tfloat d = viewSampleDepth - moments.x;\\n\" +\n\t\t\t\t\"\treturn variance/(variance + d*d);\\n\" +\n\t\t\t\t\"}\\n\";\t\n\t\t\t\n\t\n\treturn shaderPart;\n};\n\n\n/*******************************************************************************\n* Light\n********************************************************************************/\nx3dom.shader.light = function(numLights) {\n\n\tvar shaderPart = \"\";\n\n\tfor(var l=0; l<numLights; l++) {\n\t\tshaderPart += \t\"uniform float light\"+l+\"_On;\\n\" +\n\t\t\t\t\t\t\"uniform float light\"+l+\"_Type;\\n\" +\n\t\t\t\t\t\t\"uniform vec3  light\"+l+\"_Location;\\n\" +\n\t\t\t\t\t\t\"uniform vec3  light\"+l+\"_Direction;\\n\" +\n\t\t\t\t\t\t\"uniform vec3  light\"+l+\"_Color;\\n\" +\n\t\t\t\t\t\t\"uniform vec3  light\"+l+\"_Attenuation;\\n\" +\n\t\t\t\t\t\t\"uniform float light\"+l+\"_Radius;\\n\" +\n\t\t\t\t\t\t\"uniform float light\"+l+\"_Intensity;\\n\" +\n\t\t\t\t\t\t\"uniform float light\"+l+\"_AmbientIntensity;\\n\" +\n\t\t\t\t\t\t\"uniform float light\"+l+\"_BeamWidth;\\n\" +\n\t\t\t\t\t\t\"uniform float light\"+l+\"_CutOffAngle;\\n\" +\n\t\t\t\t\t\t\"uniform float light\"+l+\"_ShadowIntensity;\\n\";\n\t}\n\t\n\tshaderPart += \t\"void lighting(in float lType, in vec3 lLocation, in vec3 lDirection, in vec3 lColor, in vec3 lAttenuation, \" +\n\t\t\t\t\t\"in float lRadius, in float lIntensity, in float lAmbientIntensity, in float lBeamWidth, \" +\n\t\t\t\t\t\"in float lCutOffAngle, in vec3 positionVS, in vec3 N, in vec3 V, float shin, float ambIntensity, vec3 reflectivity, \" +\n\t\t\t\t    \"inout vec3 ambient, inout vec3 diffuse, inout vec3 specular)\\n\" +\n\t\t\t\t\t\"{\\n\" +\n\t\t\t\t\t\"   vec3 L;\\n\" +\n\t\t\t\t\t\"   float spot = 1.0, attentuation = 0.0;\\n\" +\n\t\t\t\t\t\"   if(lType == 0.0) {\\n\" +\n\t\t\t\t\t\"       L = -normalize(lDirection);\\n\" +\n\t\t\t\t\t\"\t\tV = normalize(V);\\n\" +\n\t\t\t\t\t\"\t\tattentuation = 1.0;\\n\" +\n\t\t\t\t\t\"   } else{\\n\" +\n\t\t\t\t\t\"       L = (lLocation - (-V));\\n\" +\n\t\t\t\t\t\"       float d = length(L);\\n\" +\n\t\t\t\t\t\"\t\tL = normalize(L);\\n\" +\n\t\t\t\t\t\"\t\tV = normalize(V);\\n\" +\n\t\t\t\t\t\"       if(lRadius == 0.0 || d <= lRadius) {\\n\" +\n\t\t\t\t\t\"       \tattentuation = 1.0 / max(lAttenuation.x + lAttenuation.y * d + lAttenuation.z * (d * d), 1.0);\\n\" +\n\t\t\t\t\t\"\t\t}\\n\" +\n\t\t\t\t\t\"       if(lType == 2.0) {\\n\" +\n\t\t\t\t\t\"           float spotAngle = acos(max(0.0, dot(-L, normalize(lDirection))));\\n\" +\n\t\t\t\t\t\"           if(spotAngle >= lCutOffAngle) spot = 0.0;\\n\" +\n\t\t\t\t\t\"           else if(spotAngle <= lBeamWidth) spot = 1.0;\\n\" +\n\t\t\t\t\t\"           else spot = (spotAngle - lCutOffAngle ) / (lBeamWidth - lCutOffAngle);\\n\" +\n\t\t\t\t\t\"       }\\n\" +\n\t\t\t\t\t\"   }\\n\" +\n\t\t\t\t\t\n\t\t\t\t\t\"   vec3  H = normalize( L + V );\\n\" +\n\t\t\t\t\t\"   float NdotL = clamp(dot(L, N), 0.0, 1.0);\\n\" +\n\t\t\t\t\t\"   float NdotH = clamp(dot(H, N), 0.0, 1.0);\\n\" +\n\t\t\t\t\t\n\t\t\t\t\t\"   float ambientFactor  = lAmbientIntensity * ambIntensity;\\n\" +\n\t\t\t\t\t\"   float diffuseFactor  = lIntensity * NdotL;\\n\" +\n\t\t\t\t\t\"   float specularFactor = lIntensity * pow(NdotH, shin*128.0);\\n\" +\n\t\t\t\t\t\"   ambient  += lColor * ambientFactor * attentuation * spot;\\n\" +\n\t\t\t\t\t\"   diffuse  += lColor * diffuseFactor * attentuation * spot;\\n\" +\n\t\t\t\t\t\"   specular += lColor * specularFactor * attentuation * spot;\\n\" +\n                    \"}\\n\";\n\t\t\t\t\t\t\n\treturn shaderPart;\n};\n\n/*******************************************************************************\n* Light\n********************************************************************************/\nx3dom.shader.lightPBR = function(numLights) {\n\n\tvar shaderPart = \"\";\n\n\tfor(var l=0; l<numLights; l++) {\n\t\tshaderPart += \t\"uniform float light\"+l+\"_On;\\n\" +\n\t\t\t\t\t\t\"uniform float light\"+l+\"_Type;\\n\" +\n\t\t\t\t\t\t\"uniform vec3  light\"+l+\"_Location;\\n\" +\n\t\t\t\t\t\t\"uniform vec3  light\"+l+\"_Direction;\\n\" +\n\t\t\t\t\t\t\"uniform vec3  light\"+l+\"_Color;\\n\" +\n\t\t\t\t\t\t\"uniform vec3  light\"+l+\"_Attenuation;\\n\" +\n\t\t\t\t\t\t\"uniform float light\"+l+\"_Radius;\\n\" +\n\t\t\t\t\t\t\"uniform float light\"+l+\"_Intensity;\\n\" +\n\t\t\t\t\t\t\"uniform float light\"+l+\"_AmbientIntensity;\\n\" +\n\t\t\t\t\t\t\"uniform float light\"+l+\"_BeamWidth;\\n\" +\n\t\t\t\t\t\t\"uniform float light\"+l+\"_CutOffAngle;\\n\" +\n\t\t\t\t\t\t\"uniform float light\"+l+\"_ShadowIntensity;\\n\";\n\t}\n\t\n\tshaderPart += \t\"void lighting(in float lType, in vec3 lLocation, in vec3 lDirection, in vec3 lColor, in vec3 lAttenuation, \" +\n\t\t\t\t\t\"in float lRadius, in float lIntensity, in float lAmbientIntensity, in float lBeamWidth, \" +\n\t\t\t\t\t\"in float lCutOffAngle, in vec3 positionVS, in vec3 N, in vec3 V, float shin, float ambIntensity, vec3 reflectivity, \" +\n\t\t\t\t    \"inout vec3 ambient, inout vec3 diffuse, inout vec3 specular)\\n\" +\n\t\t\t\t\t\"{\\n\" +\n\t\t\t\t\t// Calculate some Dot-Products\t\t\n\t\t\t\t\t\n\n\t\t\t\t\t\"   vec3 L;\\n\" +\n\t\t\t\t\t\"   float spot = 1.0, attentuation = 0.0;\\n\" +\n\t\t\t\t\t\"   if(lType == 0.0) {\\n\" +\n\t\t\t\t\t\"       L = -normalize(lDirection);\\n\" +\n\t\t\t\t\t\"\t\tV = normalize(V);\\n\" +\n\t\t\t\t\t\"\t\tattentuation = 1.0;\\n\" +\n\t\t\t\t\t\"   } else{\\n\" +\n\t\t\t\t\t\"       L = (lLocation - (-V));\\n\" +\n\t\t\t\t\t\"       float d = length(L);\\n\" +\n\t\t\t\t\t\"\t\tL = normalize(L);\\n\" +\n\t\t\t\t\t\"\t\tV = normalize(V);\\n\" +\n\t\t\t\t\t\"       if(lRadius == 0.0 || d <= lRadius) {\\n\" +\n\t\t\t\t\t\"       \tattentuation = 1.0 / max(lAttenuation.x + lAttenuation.y * d + lAttenuation.z * (d * d), 1.0);\\n\" +\n\t\t\t\t\t\"\t\t}\\n\" +\n\t\t\t\t\t\"       if(lType == 2.0) {\\n\" +\n\t\t\t\t\t\"           float spotAngle = acos(max(0.0, dot(-L, normalize(lDirection))));\\n\" +\n\t\t\t\t\t\"           if(spotAngle >= lCutOffAngle) spot = 0.0;\\n\" +\n\t\t\t\t\t\"           else if(spotAngle <= lBeamWidth) spot = 1.0;\\n\" +\n\t\t\t\t\t\"           else spot = (spotAngle - lCutOffAngle ) / (lBeamWidth - lCutOffAngle);\\n\" +\n\t\t\t\t\t\"       }\\n\" +\n\t\t\t\t\t\"   }\\n\" +\n\t\t\t\t\t\n\t\t\t\t\t\"   vec3  fresnel = vec3(1.0, 1.0, 1.0);\\n\" +\n\t\t\t\t\t\"   vec3  H = normalize( L + V );\\n\" +\n\t\t\t\t\t\"   float NoL = clamp( dot( N, L ), 0.0, 1.0 );\\n\" +\n\t\t\t\t\t\"   float NoH = clamp( dot( N, H ), 0.0, 1.0 );\\n\" +\n\t\t\t\t\t\"   float NoV = clamp( dot( N, V ), 0.0, 1.0 );\\n\" +\n\t\t\t\t\t\"   float VoH = clamp( dot( V, H ), 0.0, 1.0 );\\n\" +\n\t\t\t\t\t\n\t\t\t\t\t\"   float ambientFactor  = lAmbientIntensity * ambIntensity;\\n\" +\n\t\t\t\t\t\"   float diffuseFactor  = lIntensity * NoL;\\n\" +\n\t\t\t\t\t\"   float spec  = lIntensity * NoL;\\n\" +\n\t\t\t\t\t\"   float roughness = 1.0 - shin;\\n\" +\n\t\t\t\t\t\"   float a = max( roughness * roughness, 5e-4 );\\n\" +\n\t\t\t\n\t\t\t\t\t// Distribution Function\"\n\t\t\t\t\t\"   float a2 = a * a;\\n\" +\n\t\t\t\t\t\"   float denom = NoH * NoH * ( a2 - 1.0 ) + 1.0;\\n\" +\n\t\t\t\t\t\"   float D = a2 / ( denom * denom );\\n\" +\n\t\t\t\n\t\t\t\t\t// Geometric Shadowing Term\n\t\t\t\t\t\"   float k = a / 2.0;\\n\" +\n\t\t\t\t\t\"   float G_V = ( NoV * ( 1.0 - k ) + k );\\n\" +\n\t\t\t\t\t\"   float G_L = ( NoL * ( 1.0 - k ) + k );\\n\" +\n\t\t\t\t\t\"   float G = 0.25 / ( G_V * G_L );\\n\" +\n\n\t\t\t\t\t// Fresnel\n\t\t\t\t\t\"   vec3 F = reflectivity + (fresnel - fresnel*reflectivity) * exp2( (-5.55473 * VoH - 6.98316) * VoH );\\n\" +\n\t\t\t\t\t\n\t\t\t\t\t\"   vec3 specularFactor = (D * G) * (F * spec);\\n\" +\n\n\t\t\t\t\t\"   ambient  += lColor * ambientFactor * attentuation * spot;\\n\" +\n\t\t\t\t\t\"   diffuse  += lColor * diffuseFactor * attentuation * spot;\\n\" +\n\t\t\t\t\t\"   specular += lColor * specularFactor * attentuation * spot;\\n\" +\n                    \"}\\n\";\n\t\t\t\t\t\t\n\treturn shaderPart;\n};\n\n/*******************************************************************************\n * cotangent_frame\n ********************************************************************************/\nx3dom.shader.TBNCalculation = function() {\n    var shaderPart = \"\";\n\n    shaderPart += \"mat3 cotangent_frame(vec3 N, vec3 p, vec2 uv)\\n\" +\n        \"{\\n\" +\n        \"    // get edge vectors of the pixel triangle\\n\" +\n        \"    vec3 dp1 = dFdx( p );\\n\" +\n        \"    vec3 dp2 = dFdy( p );\\n\" +\n        \"    vec2 duv1 = dFdx( uv );\\n\" +\n        \"    vec2 duv2 = dFdy( uv );\\n\" +\n        \"\\n\" +\n        \"    // solve the linear system\\n\" +\n        \"    vec3 dp2perp = cross( dp2, N );\\n\" +\n        \"    vec3 dp1perp = cross( N, dp1 );\\n\" +\n        \"    vec3 T = dp2perp * duv1.x + dp1perp * duv2.x;\\n\" +\n        \"    vec3 B = dp2perp * duv1.y + dp1perp * duv2.y;\\n\" +\n        \"\\n\" +\n        \"    // construct a scale-invariant frame\\n\" +\n        \"    float invmax = inversesqrt( max( dot(T,T), dot(B,B) ) );\\n\" +\n        \"    return mat3( T * invmax, B * invmax, N );\\n\" +\n        \"}\\n\\n\";\n\n    shaderPart += \"vec3 perturb_normal( vec3 N, vec3 V, vec2 texcoord, vec3 bias )\\n\" +\n        \"{\\n\" +\n        \"    // assume N, the interpolated vertex normal and\\n\" +\n        \"    // V, the view vector (vertex to eye)\\n\" +\n        \"    vec3 map = texture2D(normalMap, texcoord ).xyz;\\n\" +\n\t\t\"    map = 2.0 * map - 1.0;\\n\" +\n\t    \"    map = map * bias;\\n\" +\n        \"    mat3 TBN = cotangent_frame(N, -V, texcoord);\\n\" +\n        \"    return normalize(TBN * map);\\n\" +\n        \"}\\n\\n\";\n\n    return shaderPart;\n};\n\n/*******************************************************************************\n * tonemapping\n ********************************************************************************/\nx3dom.shader.toneMapping = function() {\n    var shaderPart = \"\";\n\n\tshaderPart += \"uniform float tonemappingOperator;\\n\";\n\n\tshaderPart += \"vec3 tonemapReinhard(vec3 color) { \\n\" +\n\t\"\treturn color / (color + vec3(1.0));\\n\"+ \t\n\t\"}\\n\\n\";\n\n\tshaderPart += \"vec3 uncharted2Tonemap(vec3 color) { \\n\" +\n\t\"\tfloat A = 0.15;\\n\" +\n\t\"\tfloat B = 0.50;\\n\" +\n\t\"\tfloat C = 0.10;\\n\" +\n\t\"\tfloat D = 0.20;\\n\" +\n\t\"\tfloat E = 0.02;\\n\" +\n\t\"\tfloat F = 0.30;\\n\" +\n\n\t\"\treturn ((color*(A*color+C*B)+D*E)/(color*(A*color+B)+D*F))-E/F;\\n\" +\n\t\"}\\n\\n\";\n\n\tshaderPart += \"vec3 tonemapUncharted2(vec3 color) { \\n\" +\n\t\"\tfloat W = 11.2;\\n\" +\n\t\"   float exposureBias = 2.0;\\n\" +\n\t\"\tvec3 curr = uncharted2Tonemap(exposureBias * color);\\n\" +\n\t\"\tvec3 whiteScale = 1.0 / uncharted2Tonemap(vec3(W));\\n\" +\n\t\"\treturn curr * whiteScale;\\n\" +\n\t\"}\\n\\n\";\n\n\tshaderPart += \"vec3 tonemapeFilmic(vec3 color) { \\n\" +\n\t\"\tconst float a = 2.51;\\n\" +\n\t\"\tconst float b = 0.03;\\n\" +\n\t\"\tconst float c = 2.43;\\n\" +\n\t\"\tconst float d = 0.59;\\n\" +\n\t\"\tconst float e = 0.14;\\n\" +\n\t\"\treturn clamp((color * (a * color + b)) / (color * (c * color + d ) + e), 0.0, 1.0);\\n\" +\n\t\"}\\n\\n\";\n\n\tshaderPart += \"vec3 tonemap(vec3 color) { \\n\" +\n\t\"\tif(tonemappingOperator == 0.0) {\\n\" +\n\t\"   \treturn color;\\n\" +\n\t\"\t}\\n\" +\n\t\"\tif(tonemappingOperator == 1.0) {\\n\" +\n\t\"   \treturn tonemapReinhard(color);\\n\" +\n\t\"\t}\\n\" +\n\t\"\tif(tonemappingOperator == 2.0) {\\n\" +\n\t\"   \treturn tonemapUncharted2(color);\\n\" +\n\t\"\t}\\n\" +\n\t\"\tif(tonemappingOperator == 3.0) {\\n\" +\n\t\"   \treturn tonemapeFilmic(color);\\n\" +\n\t\"\t}\\n\" +\n\t\"}\\n\\n\";\n\n    return shaderPart;\n};\n\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * Philip Taylor: http://philip.html5.org\n */\n\n/**\n * Generate the final Shader program\n */\nx3dom.shader.DynamicShader = function(gl, properties)\n{\n\tthis.program = gl.createProgram();\n\t\n\tvar vertexShader \t= this.generateVertexShader(gl, properties, x3dom.caps.WEBGL_VERSION);\n\tvar fragmentShader \t= this.generateFragmentShader(gl, properties, x3dom.caps.WEBGL_VERSION);\n\t\n\tgl.attachShader(this.program, vertexShader);\n    gl.attachShader(this.program, fragmentShader);\n    \n    // optional, but position should be at location 0 for performance reasons\n    gl.bindAttribLocation(this.program, 0, \"position\");\n    \n\tgl.linkProgram(this.program);\n\t\n\treturn this.program;\n};\n\n/**\n * Generate the vertex shader\n */\nx3dom.shader.DynamicShader.prototype.generateVertexShader = function(gl, properties, version)\n{\n\tvar shader = \"\";\n\t\n\t/*******************************************************************************\n\t* Generate dynamic attributes & uniforms & varyings\n\t********************************************************************************/\n\t\n\t//Default Matrices\n\tshader += \"uniform mat4 modelMatrix;\\n\";\n\tshader += \"uniform mat4 modelViewMatrix;\\n\";\n\tshader += \"uniform mat4 modelViewProjectionMatrix;\\n\";\n\t\t\t\n\tshader += \"uniform mat4 modelViewMatrix2;\\n\";\n\tshader += \"uniform mat4 modelViewProjectionMatrix2;\\n\";\n\t\n\tshader += \"uniform float isVR;\\n\";\n\tshader += \"attribute float eyeIdx;\\n\";\n\tshader += \"varying float vrOffset;\\n\";\n\tshader += \"varying float fragEyeIdx;\\n\";\n\n\t//Positions\n\tif(properties.POSCOMPONENTS == 3) {\n\t\tshader += \"attribute vec3 position;\\n\";\n\t} else if(properties.POSCOMPONENTS == 4) {\n\t\tshader += \"attribute vec4 position;\\n\";\n\t}\n\t\n  //IG stuff\n\tif(properties.IMAGEGEOMETRY) {\n\t\tshader += \"uniform vec3 IG_bboxMin;\\n\";\n\t\tshader += \"uniform vec3 IG_bboxMax;\\n\";\n\t\tshader += \"uniform float IG_coordTextureWidth;\\n\";\n\t\tshader += \"uniform float IG_coordTextureHeight;\\n\";\n\t\tshader += \"uniform vec2 IG_implicitMeshSize;\\n\";\n\t\t\n\t\tfor( var i = 0; i < properties.IG_PRECISION; i++ ) {\n\t\t\tshader += \"uniform sampler2D IG_coords\" + i + \"\\n;\";\n\t\t}\n\t\t\n\t\tif(properties.IG_INDEXED) {\n\t\t\tshader += \"uniform sampler2D IG_index;\\n\";\n\t\t\tshader += \"uniform float IG_indexTextureWidth;\\n\";\n\t\t\tshader += \"uniform float IG_indexTextureHeight;\\n\";\n\t\t}\n\t}\n    \n    //PG stuff\n    if (properties.POPGEOMETRY) {\n        shader += \"uniform float PG_precisionLevel;\\n\";\n        shader += \"uniform float PG_powPrecision;\\n\";\n        shader += \"uniform vec3 PG_maxBBSize;\\n\";\n        shader += \"uniform vec3 PG_bbMin;\\n\";\n        shader += \"uniform vec3 PG_bbMaxModF;\\n\";\n        shader += \"uniform vec3 PG_bboxShiftVec;\\n\";\n        shader += \"uniform float PG_numAnchorVertices;\\n\";\n        shader += \"attribute float PG_vertexID;\\n\";\n    }\n\t\n\t//Normals\n\tif(properties.LIGHTS || properties.PBR_MATERIAL) {\n\t\tif(properties.NORMALMAP && properties.NORMALSPACE == \"OBJECT\") {\n\t\t\t//do nothing\n\t\t} else {\n\t\t\tshader += \"varying vec3 fragNormal;\\n\";\n\t\t\tshader += \"uniform mat4 normalMatrix;\\n\";\n\t\t\tshader += \"uniform mat4 normalMatrix2;\\n\";\n\n            if(properties.IMAGEGEOMETRY) {\n                shader += \"uniform sampler2D IG_normals;\\n\";\n            } else {\n                if (properties.NORCOMPONENTS == 2) {\n                    if (properties.POSCOMPONENTS != 4) {\n                        shader += \"attribute vec2 normal;\\n\";\n                    }\n                } else if (properties.NORCOMPONENTS == 3) {\n                    shader += \"attribute vec3 normal;\\n\";\n                }\n            }\n\t\t}\n\t}\n\t\t\n\t//Init Colors. In the vertex shader we do not compute any color so\n    //is is safe to ignore gamma here.\n\tif(properties.VERTEXCOLOR) {\t\n\t\tif(properties.IMAGEGEOMETRY) {\n\t\t\tshader += \"uniform sampler2D IG_colors;\\n\";\n\t\t\tif(properties.COLCOMPONENTS == 3) {\n\t\t\t\tshader += \"varying vec3 fragColor;\\n\";\n\t\t\t} else if(properties.COLCOMPONENTS == 4) {\n\t\t\t\tshader += \"varying vec4 fragColor;\\n\";\n\t\t\t}\n\t\t} else {\n\t\t\tif(properties.COLCOMPONENTS == 3) {\n\t\t\t\tshader += \"attribute vec3 color;\\n\";\n\t\t\t\tshader += \"varying vec3 fragColor;\\n\";\n\t\t\t} else if(properties.COLCOMPONENTS == 4) {\n\t\t\t\tshader += \"attribute vec4 color;\\n\";\n\t\t\t\tshader += \"varying vec4 fragColor;\\n\";\n\t\t\t}\n\t\t}\n\t}\n\n\t//Textures\n\tif(properties.TEXTURED) {\n\t\tshader += \"varying vec2 fragTexcoord;\\n\";\n\n\t\tif(properties.MULTITEXCOORD)\n\t\t{\n\t\t\tshader += \"varying vec2 fragTexcoord2;\\n\";\n\t\t}\n\t\t\n\t\tif(!properties.SPHEREMAPPING) {\n\t\t\tif(properties.IMAGEGEOMETRY) {\n\t\t\t\tshader += \"uniform sampler2D IG_texCoords;\\n\";\n\t\t\t} else if (!properties.IS_PARTICLE) {\n\t\t\t\tshader += \"attribute vec2 texcoord;\\n\";\n\n\t\t\t\tif(properties.MULTITEXCOORD)\n\t\t\t\t{\n\t\t\t\t\tshader += \"attribute vec2 texcoord2;\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(properties.TEXTRAFO){\n\t\t\tshader += \"uniform mat4 texTrafoMatrix;\\n\";\n\t\t}\n\n\t\tif(properties.NORMALMAP && properties.NORMALSPACE == \"TANGENT\") {\n\n\t\t\tif(!properties.TANGENTDATA && !x3dom.caps.STD_DERIVATIVES)\n\t\t\t{\n                x3dom.debug.logWarning(\"Your System doesn't support the 'OES_STANDARD_DERIVATIVES' Extension. \" +\n                    \"You must set tangents and binormals manually via the FloatVertexAttribute-Node \" +\n                    \"to use normal maps\");\n            }\n\n            shader += \"attribute vec3 tangent;\\n\";\n            shader += \"attribute vec3 binormal;\\n\";\n            shader += \"varying vec3 fragTangent;\\n\";\n            shader += \"varying vec3 fragBinormal;\\n\";\n\t\t}\n\n        if (properties.DISPLACEMENTMAP) {\n            shader += \"uniform sampler2D displacementMap;\\n\";\n            shader += \"uniform float displacementFactor;\\n\";\n            shader += \"uniform float displacementWidth;\\n\";\n            shader += \"uniform float displacementHeight;\\n\";\n            shader += \"uniform float displacementAxis;\\n\";\n        }\n        if (properties.DIFFPLACEMENTMAP) {\n\t\t\tshader += \"uniform sampler2D diffuseDisplacementMap;\\n\";\n\t\t\tshader += \"uniform float displacementFactor;\\n\";\n\t\t\tshader += \"uniform float displacementWidth;\\n\";\n\t\t\tshader += \"uniform float displacementHeight;\\n\";\n\t\t\tshader += \"uniform float displacementAxis;\\n\";\n\t\t}\n\t}\n\n\tif(properties.CUBEMAP || properties.PBR_MATERIAL) {\n\t\tshader += \"varying vec3 fragViewDir;\\n\";\n\t\tshader += \"uniform mat4 viewMatrix;\\n\";\n\t\tshader += \"uniform mat4 viewMatrix2;\\n\";\n\t}\n\n\tif (properties.VERTEXID) {\n\t\tshader += \"attribute float id;\\n\";\n\t\tshader += \"varying float fragID;\\n\";\n\t}\n\n    if (properties.IS_PARTICLE) {\n        shader += \"attribute vec3 particleSize;\\n\";\n    }\n\t\n\t//Lights & Fog\n\tif(properties.LIGHTS || properties.FOG || properties.CLIPPLANES){\n\t\tshader += \"uniform vec3 eyePosition;\\n\";\n\t\tshader += \"varying vec4 fragPosition;\\n\";\n\t\tshader += \"varying vec4 fragPositionWS;\\n\";\n\t\tif(properties.FOG) {\n\t\t\tshader += \"varying vec3 fragEyePosition;\\n\";\n\t\t}\n\t}\n\t\n\t//Bounding Boxes\n\tif(properties.REQUIREBBOX) {\n\t\tshader += \"uniform vec3 bgCenter;\\n\";\n\t\tshader += \"uniform vec3 bgSize;\\n\";\n\t\tshader += \"uniform float bgPrecisionMax;\\n\";\n\t}\n\tif(properties.REQUIREBBOXNOR) {\n\t\tshader += \"uniform float bgPrecisionNorMax;\\n\";\n\t}\n\tif(properties.REQUIREBBOXCOL) {\n\t\tshader += \"uniform float bgPrecisionColMax;\\n\";\n\t}\n\tif(properties.REQUIREBBOXTEX) {\n\t\tshader += \"uniform float bgPrecisionTexMax;\\n\";\n\t}\n\n      \n\t/*******************************************************************************\n\t* Generate main function\n\t********************************************************************************/\n\tshader += \"void main(void) {\\n\";\n\n\t//Positions\n\tshader += \"mat4 mat_mvp = modelViewProjectionMatrix;\\n\"\n\tshader += \"mat4 mat_mv  = modelViewMatrix;\\n\"\n\tshader += \"fragEyeIdx = eyeIdx;\\n\";\n\n\n\tif(properties.CUBEMAP || properties.PBR_MATERIAL) {\n\t\tshader += \"mat4 mat_v   = viewMatrix;\\n\"\n\t}\n\n\tif(properties.LIGHTS || properties.PBR_MATERIAL)\n\t{\n\t\tif(properties.NORMALMAP && properties.NORMALSPACE == \"OBJECT\") {\n\t\t\t//do nothing\n\t\t}\n\t\telse\n\t\t{\n\t\t\tshader += \"mat4 mat_n   = normalMatrix;\\n\"\n\t\t}\n\t\t\n\t}\n\n\tshader += \"if(eyeIdx == 1.0){\\n\"\n\tshader += \"    mat_mvp = modelViewProjectionMatrix2;\\n\";\n\n\tif(properties.CUBEMAP || properties.PBR_MATERIAL) {\n\t\tshader += \"    mat_v   = viewMatrix2;\\n\";\n\t}\n\t\n\tif(properties.LIGHTS || properties.PBR_MATERIAL)\n\t{\n\t\tif(properties.NORMALMAP && properties.NORMALSPACE == \"OBJECT\") {\n\t\t\t//do nothing\n\t\t}\n\t\telse\n\t\t{\n\t\t\tshader += \"mat4 mat_n   = normalMatrix2;\\n\"\n\t\t}\n\t\t\n\t}\n\n\tshader += \"}\\n\";\n\n\t/*******************************************************************************\n\t* Start of special Geometry switch\n\t********************************************************************************/\n\tif(properties.IMAGEGEOMETRY) {\n\t\t//Indices\n\t\tif(properties.IG_INDEXED) {\n\t\t\tshader += \"vec2 halfPixel = vec2(0.5/IG_indexTextureWidth,0.5/IG_indexTextureHeight);\\n\";\n\t\t\tshader += \"vec2 IG_texCoord = vec2(position.x*(IG_implicitMeshSize.x/IG_indexTextureWidth), position.y*(IG_implicitMeshSize.y/IG_indexTextureHeight)) + halfPixel;\\n\";\n\t\t\tshader += \"vec2 IG_indices = texture2D( IG_index, IG_texCoord ).rg;\\n\";\n\t\t\tshader += \"halfPixel = vec2(0.5/IG_coordTextureWidth,0.5/IG_coordTextureHeight);\\n\";\n\t\t\tshader += \"IG_texCoord = (IG_indices * 0.996108948) + halfPixel;\\n\";\n\t\t} else {\n\t\t\tshader += \"vec2 halfPixel = vec2(0.5/IG_coordTextureWidth, 0.5/IG_coordTextureHeight);\\n\";\n\t\t\tshader += \"vec2 IG_texCoord = vec2(position.x*(IG_implicitMeshSize.x/IG_coordTextureWidth), position.y*(IG_implicitMeshSize.y/IG_coordTextureHeight)) + halfPixel;\\n\";\n\t\t}\n\t\t\n\t\t//Positions\n\t\tshader += \"vec3 temp = vec3(0.0, 0.0, 0.0);\\n\";\n\t\tshader += \"vec3 vertPosition = vec3(0.0, 0.0, 0.0);\\n\";\n\t\t\n\t\tfor(var i=0; i<properties.IG_PRECISION; i++) {\n\t\t\tshader += \"temp = 255.0 * texture2D( IG_coords\" + i + \", IG_texCoord ).rgb;\\n\";\n\t\t\tshader += \"vertPosition *= 256.0;\\n\";\n\t\t\tshader += \"vertPosition += temp;\\n\";\n\t\t}\n\t\t\n\t\tshader += \"vertPosition /= (pow(2.0, 8.0 * \" + properties.IG_PRECISION + \".0) - 1.0);\\n\";\n\t\tshader += \"vertPosition = vertPosition * (IG_bboxMax - IG_bboxMin) + IG_bboxMin;\\n\";\n\t\n\t\t//Normals\n\t\tif(properties.LIGHTS) {\n\t\t\tshader += \"vec3 vertNormal = texture2D( IG_normals, IG_texCoord ).rgb;\\n\";\n\t\t\tshader += \"vertNormal = vertNormal * 2.0 - 1.0;\\n\";\n\t\t}\n\t\t\n\t\t//Colors\n\t\tif(properties.VERTEXCOLOR) {\n\t\t\tif(properties.COLCOMPONENTS == 3) {\n\t\t\t\tshader += \"fragColor = texture2D( IG_colors, IG_texCoord ).rgb;\\n\";\n\t\t\t} else if(properties.COLCOMPONENTS == 4) {\n\t\t\t\tshader += \"fragColor = texture2D( IG_colors, IG_texCoord ).rgba;\\n\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t//TexCoords\n\t\tif(properties.TEXTURED) {\n\t\t\tshader += \"vec4 IG_doubleTexCoords = texture2D( IG_texCoords, IG_texCoord );\\n\";\n\t\t\tshader += \"vec2 vertTexCoord;\";\n\t\t\tshader += \"vertTexCoord.r = (IG_doubleTexCoords.r * 0.996108948) + (IG_doubleTexCoords.b * 0.003891051);\\n\";\n\t\t\tshader += \"vertTexCoord.g = (IG_doubleTexCoords.g * 0.996108948) + (IG_doubleTexCoords.a * 0.003891051);\\n\";\n\t\t}\n\t} else {\n\t\t//Positions\n\t\tshader += \"vec3 vertPosition = position.xyz;\\n\";\n\t\t\n        if (properties.POPGEOMETRY) {\n          //compute offset using bounding box and test if vertPosition <= PG_bbMaxModF \n          shader += \"vec3 offsetVec = step(vertPosition / bgPrecisionMax, PG_bbMaxModF) * PG_bboxShiftVec;\\n\";\n          \n          //coordinate truncation, computation of current maximum possible value\n          //PG_vertexID currently mimics use of gl_VertexID\n          shader += \"if ((PG_precisionLevel <= 2.0) || PG_vertexID >= PG_numAnchorVertices) {\\n\";\n          shader += \"   vertPosition = floor(vertPosition / PG_powPrecision) * PG_powPrecision;\\n\";\n          shader += \"   vertPosition /= (65536.0 - PG_powPrecision);\\n\";\n          shader += \"}\\n\";\n          shader += \"else {\\n\";\n          shader += \"   vertPosition /= bgPrecisionMax;\\n\";\n          shader += \"}\\n\";\n          \n          //translate coordinates, where PG_bbMin := floor(bbMin / size) \n          shader += \"vertPosition = (vertPosition + offsetVec + PG_bbMin) * PG_maxBBSize;\\n\";\n        }\n\t\telse if(properties.REQUIREBBOX) {\n          shader += \"vertPosition = bgCenter + bgSize * vertPosition / bgPrecisionMax;\\n\";\n\t\t}\n\n\t\t//Normals\n\t\tif(properties.LIGHTS) {\n\t\t\tif(properties.NORCOMPONENTS == 2) {\n\t\t\t\tif (properties.POSCOMPONENTS == 4) {\n\t\t\t\t\t// (theta, phi) encoded in low/high byte of position.w\n\t\t\t\t\tshader += \"vec3 vertNormal = vec3(position.w / 256.0); \\n\";\n\t\t\t\t\tshader += \"vertNormal.x = floor(vertNormal.x) / 255.0; \\n\";\n\t\t\t\t\tshader += \"vertNormal.y = fract(vertNormal.y) * 1.00392156862745; \\n\"; //256.0 / 255.0\n\t\t\t\t}\n\t\t\t\telse if (properties.REQUIREBBOXNOR) {\n\t\t\t\t\tshader += \"vec3 vertNormal = vec3(normal.xy, 0.0) / bgPrecisionNorMax;\\n\";                    \n\t\t\t\t}\n\n\t\t\t\tshader += \"vec2 thetaPhi = 3.14159265358979 * vec2(vertNormal.x, vertNormal.y*2.0-1.0); \\n\";\n\t\t\t\tshader += \"vec4 sinCosThetaPhi = sin( vec4(thetaPhi, thetaPhi + 1.5707963267949) ); \\n\";\n\n\t\t\t\tshader += \"vertNormal.x = sinCosThetaPhi.x * sinCosThetaPhi.w; \\n\";\n\t\t\t\tshader += \"vertNormal.y = sinCosThetaPhi.x * sinCosThetaPhi.y; \\n\";\n\t\t\t\tshader += \"vertNormal.z = sinCosThetaPhi.z; \\n\";                \n\t\t\t} else {\n\t\t\t\tif (properties.NORMALMAP && properties.NORMALSPACE == \"OBJECT\") {\n\t\t\t\t\t//Nothing to do\n\t\t\t\t} else {\n\t\t\t\t\tshader += \"vec3 vertNormal = normal;\\n\";\n\t\t\t\t\tif (properties.REQUIREBBOXNOR) {\n\t\t\t\t\t\tshader += \"vertNormal = vertNormal / bgPrecisionNorMax;\\n\";\n\t\t\t\t\t}\n\t\t\t\t\tif (properties.POPGEOMETRY) {\n\t\t\t\t\t\tshader += \"vertNormal = 2.0*vertNormal - 1.0;\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Colors\n\t\tif(properties.VERTEXCOLOR){\n\t\t\tshader += \"fragColor = color;\\n\";\n            \n\t\t\tif(properties.REQUIREBBOXCOL) {\n                shader += \"fragColor = fragColor / bgPrecisionColMax;\\n\";\n\t\t\t}                              \n\t\t}\n\t\t\n\t\t//TexCoords\n\t\tif( (properties.TEXTURED) && !properties.SPHEREMAPPING) {\n            if (properties.IS_PARTICLE) {\n                shader += \"vec2 vertTexCoord = vec2(0.0);\\n\";\n            }\n            else {\n\t\t\t\tshader += \"vec2 vertTexCoord = texcoord;\\n\";\n\t\t\t\t\n\t\t\t\tif(properties.MULTITEXCOORD)\n\t\t\t\t{\n\t\t\t\t\tshader += \"vec2 vertTexCoord2 = texcoord2;\\n\";\n\t\t\t\t}\n\n                if (properties.REQUIREBBOXTEX) {\n                    shader += \"vertTexCoord = vertTexCoord / bgPrecisionTexMax;\\n\";\n                }\n            }\n\t\t}\n\t}\n\t\n\t/*******************************************************************************\n\t* End of special Geometry switch\n\t********************************************************************************/\n\t\n\t\n\t//Normals\n\tif(properties.LIGHTS) {\n        if ((properties.DISPLACEMENTMAP || properties.DIFFPLACEMENTMAP) && !properties.NORMALMAP) {\n          //Map-Tile Size\n          shader += \"float dx = 1.0 / displacementWidth;\\n\";\n          shader += \"float dy = 1.0 / displacementHeight;\\n\";\n\n          //Get the 4 Vertex Neighbours\n          if (properties.DISPLACEMENTMAP)\n          {\n              shader += \"float s1 = texture2D(displacementMap, vec2(vertTexCoord.x - dx, 1.0 - vertTexCoord.y)).r;\\n\";\t\t //left\n              shader += \"float s2 = texture2D(displacementMap, vec2(vertTexCoord.x, 1.0 - vertTexCoord.y - dy)).r;\\n\";\t\t //bottom\n              shader += \"float s3 = texture2D(displacementMap, vec2(vertTexCoord.x + dx, 1.0 - vertTexCoord.y)).r;\\n\";\t   //right\n              shader += \"float s4 = texture2D(displacementMap, vec2(vertTexCoord.x, 1.0 - vertTexCoord.y + dy)).r;\\n\";\t\t //top\n          }\n          else if (properties.DIFFPLACEMENTMAP)\n          {\n              shader += \"float s1 = texture2D(diffuseDisplacementMap, vec2(vertTexCoord.x - dx, 1.0 - vertTexCoord.y)).a;\\n\";\t\t //left\n              shader += \"float s2 = texture2D(diffuseDisplacementMap, vec2(vertTexCoord.x, 1.0 - vertTexCoord.y - dy)).a;\\n\";\t\t //bottom\n              shader += \"float s3 = texture2D(diffuseDisplacementMap, vec2(vertTexCoord.x + dx, 1.0 - vertTexCoord.y)).a;\\n\";\t   //right\n              shader += \"float s4 = texture2D(diffuseDisplacementMap, vec2(vertTexCoord.x, 1.0 - vertTexCoord.y + dy)).a;\\n\";\t\t //top\n          }\n\n          //Coeffiecent for smooth/sharp Normals\n          shader += \"float coef = displacementFactor;\\n\";\n\n          //Calculate the Normal\n          shader += \"vec3 calcNormal;\\n\";\n\n          shader += \"if (displacementAxis == 0.0) {\\n\"; //X\n          shader += \"calcNormal = vec3((s1 - s3) * coef, -5.0, (s2 - s4) * coef);\\n\";\n          shader += \"} else if(displacementAxis == 1.0) {\\n\"; //Y\n          shader += \"calcNormal = vec3((s1 - s3) * coef, -5.0, (s2 - s4) * coef);\\n\";\n          shader += \"} else {\\n\"; //Z\n          shader += \"calcNormal = vec3((s1 - s3) * coef, -(s2 - s4) * coef, 5.0);\\n\";\n          shader += \"}\\n\";\n\n\n          //normalized Normal\n          shader += \"calcNormal = normalize(calcNormal);\\n\";\n          shader += \"fragNormal = (mat_n * vec4(calcNormal, 0.0)).xyz;\\n\";\n        }\n\t\telse if (properties.NORMALMAP && properties.NORMALSPACE == \"OBJECT\") {\n\t\t\t//Nothing to do\n\t\t}\n        else\n        {\n            shader += \"fragNormal = (mat_n * vec4(vertNormal, 0.0)).xyz;\\n\";\n        }\n\t}\n\t\n\tif(properties.CUBEMAP || properties.PBR_MATERIAL) {\n\t\tshader += \"fragViewDir = (mat_v[3].xyz);\\n\";\n\t}\n\n\t//Textures\n\tif(properties.TEXTURED){\n\t\t\n\t\tif (properties.SPHEREMAPPING) {\n\t\t\tshader += \" fragTexcoord = 0.5 + fragNormal.xy / 2.0;\\n\";\n\t\t\tif(properties.TEXTRAFO) {\n\t\t\t\tshader += \" fragTexcoord = (texTrafoMatrix * vec4(fragTexcoord, 1.0, 1.0)).xy;\\n\";\n\t\t\t}\n\t\t} else if(properties.TEXTRAFO) {\n\t\t\tshader += \" fragTexcoord = (texTrafoMatrix * vec4(vertTexCoord, 1.0, 1.0)).xy;\\n\";\n\t\t} else {\n\n\t\t\tshader += \" fragTexcoord = vertTexCoord;\\n\";\n\n\t\t\tif(properties.MULTITEXCOORD)\n\t\t\t{\n\t\t\t\tshader += \" fragTexcoord2 = vertTexCoord2;\\n\";\n\t\t\t}\n\t\t\t\n\t\t\t// LOD LUT HACK ###\n\t\t\tif (properties.POPGEOMETRY && x3dom.debug.usePrecisionLevelAsTexCoord === true)\n\t\t\t    // remap texCoords to texel middle with w = 16 and tc' := 1 / (2 * w) + tc * (w - 1) / w\n                shader += \"fragTexcoord = vec2(0.03125 + 0.9375 * (PG_precisionLevel / 16.0), 1.0);\";\n\t\t\t// LOD LUT HACK ###\n\t\t}\n\n\t\tif(properties.NORMALMAP && properties.NORMALSPACE == \"TANGENT\") {\n\t\t    if(properties.TANGENTDATA)\n            {\n                shader += \"fragTangent  = (mat_n * vec4(tangent, 0.0)).xyz;\\n\";\n                shader += \"fragBinormal = (mat_n * vec4(binormal, 0.0)).xyz;\\n\";\n            }\n\t\t}\n\t}\n\t\n\t//Lights & Fog\n\tif(properties.LIGHTS || properties.FOG || properties.CLIPPLANES){\n\t\tshader += \"fragPosition = (mat_mv * vec4(vertPosition, 1.0));\\n\";\n\t\tshader += \"fragPositionWS = (modelMatrix * vec4(vertPosition, 1.0));\\n\";\n\t\tif (properties.FOG) {\n\t\t\tshader += \"fragEyePosition = eyePosition - fragPosition.xyz;\\n\";\n\t\t}\n\t}\n\n    //Vertex ID's\n    if (properties.MULTIDIFFALPMAP) {\n        shader += \"fragID = id;\\n\";\n    }\n  \n\t//Displacement\n    if (properties.DISPLACEMENTMAP) {\n        shader += \"vertPosition += normalize(vertNormal) * texture2D(displacementMap, vec2(fragTexcoord.x, 1.0-fragTexcoord.y)).r * displacementFactor;\\n\";\n    }\n    else if (properties.DIFFPLACEMENTMAP)\n    {\n        shader += \"vertPosition += normalize(vertNormal) * texture2D(diffuseDisplacementMap, vec2(fragTexcoord.x, 1.0-fragTexcoord.y)).a * displacementFactor;\\n\";\n\t}\n\n\t//Positions\n\tshader += \"gl_Position = mat_mvp * vec4(vertPosition, 1.0);\\n\";\n\n\tshader += \"if(isVR == 1.0){\\n\";\n\tshader += \"    vrOffset = eyeIdx * 0.5;\\n\";\n\tshader += \"    gl_Position.x *= 0.5;\\n\";\n\tshader += \"    gl_Position.x += vrOffset * gl_Position.w;\\n\";\n\tshader += \"}\\n\";\n\n    //Set point size\n    if (properties.IS_PARTICLE) {\n        shader += \"float spriteDist = (gl_Position.w > 0.000001) ? gl_Position.w : 0.000001;\\n\";\n        shader += \"float pointSize = floor(length(particleSize) * 256.0 / spriteDist + 0.5);\\n\";\n        shader += \"gl_PointSize = clamp(pointSize, 2.0, 256.0);\\n\";\n    }\n    else {\n        shader += \"gl_PointSize = 2.0;\\n\";\n    }\n  \n\t//END OF SHADER\n\tshader += \"}\\n\";\n\n\tif( version == 2 )\n\t{\n\t\tshader = x3dom.shader.convertVertexShader(shader);\n\t}\n\t\n\tvar vertexShader = gl.createShader(gl.VERTEX_SHADER);\n\tgl.shaderSource(vertexShader, shader);\n    gl.compileShader(vertexShader);\n\t\t\n\tif(!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)){\n        x3dom.debug.logInfo(\"VERTEX:\\n\" + shader);\n\t\tx3dom.debug.logError(\"VertexShader \" + gl.getShaderInfoLog(vertexShader));\t\t\n\t}\n\t\n\treturn vertexShader;\n};\n\n/**\n * Generate the fragment shader\n */\nx3dom.shader.DynamicShader.prototype.generateFragmentShader = function(gl, properties, version)\n{\n\tvar shader = \"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n\";\n\tshader += \" precision highp float;\\n\";\n\tshader += \"#else\\n\";\n\tshader += \" precision mediump float;\\n\";\n\tshader += \"#endif\\n\\n\";\n\n\tif(properties.PBR_MATERIAL && x3dom.caps.TEXTURE_LOD)\n\t{\n\t\tshader += \"#extension GL_EXT_shader_texture_lod : enable\\n\";\n\t}\n\n\tif ((properties.PBR_MATERIAL || properties.NORMALMAP) && x3dom.caps.STD_DERIVATIVES)\n\t{\n\t\tshader += \"#extension GL_OES_standard_derivatives:enable\\n\";\n\t}\n\n\n\tshader += \"//@insertFragColor\\n\";\n\n\t/*******************************************************************************\n\t* Generate dynamic uniforms & varyings\n\t********************************************************************************/\n\t\n\tshader += \"uniform float isVR;\\n\";\n\tshader += \"varying float vrOffset;\\n\";\n\tshader += \"varying float fragEyeIdx;\\n\";\n\tshader += \"uniform float screenWidth;\\n\";\n\tshader += \"uniform vec3 cameraPosWS;\\n\";\n\n\tshader += \"uniform float alphaCutoff;\\n\";\n\n\t//Material\n\tshader += x3dom.shader.material();\n\n\tshader += x3dom.shader.toneMapping()\n\n\tif(properties.PBR_MATERIAL && !x3dom.caps.TEXTURE_LOD && x3dom.caps.WEBGL_VERSION == 1)\n\t{\n\t\tshader += x3dom.shader.calcMipLevel();\n\t}\n\n\tif (properties.TWOSIDEDMAT) {\n\t\tshader += x3dom.shader.twoSidedMaterial();\n\t}\n\n\tif(properties.PBR_MATERIAL)\n\t{\n\t\tif(properties.ISROUGHNESSMETALLIC)\n\t\t{\n\t\t\tshader += \"uniform float metallicFactor;\\n\";\n\t\t}\n\t\t\n\t\tshader += \"uniform sampler2D brdfMap;\\n\";\n\t\tshader += \"uniform samplerCube diffuseEnvironmentMap;\\n\";\n\t\tshader += \"uniform samplerCube specularEnvironmentMap;\\n\";\n\t}\n\n\t//Colors\n\tif(properties.VERTEXCOLOR){\n\t\tif(properties.COLCOMPONENTS == 3){\n\t\t\tshader += \"varying vec3 fragColor;  \\n\";\n\t\t}else if(properties.COLCOMPONENTS == 4){\n\t\t\tshader += \"varying vec4 fragColor;  \\n\";\n\t\t}\n\t}\n\n    if(properties.CUBEMAP || properties.CLIPPLANES || properties.PBR_MATERIAL)\n    {\n\t\tshader += \"uniform mat4 viewMatrixInverse;\\n\";\n\t\tshader += \"uniform mat4 viewMatrixInverse2;\\n\";\n\t\tshader += \"uniform mat4 modelViewMatrixInverse;\\n\";\n\t\tshader += \"uniform mat4 modelViewMatrixInverse2;\\n\";\n    }\n\n\t//VertexID\n\tif (properties.VERTEXID) {\n\t\tshader += \"varying float fragID;\\n\";\n\n\t\tif (properties.MULTIDIFFALPMAP) {\n\t\t\tshader += \"uniform sampler2D multiDiffuseAlphaMap;\\n\";\n\t\t\tshader += \"uniform float multiDiffuseAlphaWidth;\\n\";\n\t\t\tshader += \"uniform float multiDiffuseAlphaHeight;\\n\";\n\t\t}\n\t\tif (properties.MULTIEMIAMBMAP) {\n\t\t\tshader += \"uniform sampler2D multiEmissiveAmbientMap;\\n\";\n\t\t\tshader += \"uniform float multiEmissiveAmbientWidth;\\n\";\n\t\t\tshader += \"uniform float multiEmissiveAmbientHeight;\\n\";\n\t\t}\n\t\tif (properties.MULTISPECSHINMAP) {\n\t\t\tshader += \"uniform sampler2D multiSpecularShininessMap;\\n\";\n\t\t\tshader += \"uniform float multiSpecularShininessWidth;\\n\";\n\t\t\tshader += \"uniform float multiSpecularShininessHeight;\\n\";\n\t\t}\n\t\tif (properties.MULTIVISMAP) {\n\t\t\tshader += \"uniform sampler2D multiVisibilityMap;\\n\";\n\t\t\tshader += \"uniform float multiVisibilityWidth;\\n\";\n\t\t\tshader += \"uniform float multiVisibilityHeight;\\n\";\n\t\t}\n\t}\n\t\n\t//Textures\n\tif(properties.TEXTURED) {\n\t\tshader += \"varying vec2 fragTexcoord;\\n\";\n\n\t\tif(properties.MULTITEXCOORD)\n\t\t{\n\t\t\tshader += \"varying vec2 fragTexcoord2;\\n\";\n\t\t}\n\n\t\tif((properties.TEXTURED || properties.DIFFUSEMAP)) {\n\t\t\tshader += \"uniform sampler2D diffuseMap;\\n\";\n\t\t}\n        if(properties.CUBEMAP || properties.PBR_MATERIAL) {\n            shader += \"uniform samplerCube environmentMap;\\n\";\n            shader += \"varying vec3 fragViewDir;\\n\";\n            if(properties.CSSHADER) {\n                shader += \"uniform float environmentFactor;\\n\";\n            }\n\t\t}\n\t\tif(properties.EMISSIVEMAP){\n\t\t\tshader += \"uniform sampler2D emissiveMap;\\n\";\n\t\t}\n\t\tif(properties.OCCLUSIONMAP){\n\t\t\tshader += \"uniform sampler2D occlusionMap;\\n\";\n\t\t}\n\t\tif(properties.ROUGHNESSMETALLICMAP){\n\t\t\tshader += \"uniform sampler2D roughnessMetallicMap;\\n\";\n\t\t}\n\t\tif(properties.SPECULARGLOSSINESSMAP)\n\t\t{\n\t\t\tshader += \"uniform sampler2D specularGlossinessMap;\\n\";\n\t\t}\n\t\tif(properties.OCCLUSIONROUGHNESSMETALLICMAP){\n\t\t\tshader += \"uniform sampler2D occlusionRoughnessMetallicMap;\\n\";\n\t\t}\n\t\tif(properties.SPECMAP){\n\t\t\tshader += \"uniform sampler2D specularMap;\\n\";\n\t\t}\n        if(properties.SHINMAP){\n            shader += \"uniform sampler2D shininessMap;\\n\";\n        }\n        if (properties.DISPLACEMENTMAP) {\n          shader += \"uniform sampler2D displacementMap;\\n\";\n          shader += \"uniform float displacementWidth;\\n\";\n          shader += \"uniform float displacementHeight;\\n\";\n        }\n        if (properties.DIFFPLACEMENTMAP) {\n            shader += \"uniform sampler2D diffuseDisplacementMap;\\n\";\n            shader += \"uniform float displacementWidth;\\n\";\n            shader += \"uniform float displacementHeight;\\n\";\n        }\n        if(properties.NORMALMAP){\n            shader += \"uniform sampler2D normalMap;\\n\";\n            shader += \"uniform vec3 normalBias;\\n\";\n\t\t\tif(properties.NORMALSPACE == \"TANGENT\") {\n\n\t\t\t\tif (x3dom.caps.STD_DERIVATIVES || x3dom.caps.WEBGL_VERSION == 2) {\n\t\t\t\t\tshader += x3dom.shader.TBNCalculation();\n\t\t\t\t} else {\n\t\t\t\t\tshader += \"varying vec3 fragTangent;\\n\";\n\t\t\t\t\tshader += \"varying vec3 fragBinormal;\\n\";\n\t\t\t\t}\n\t\t\t} else if(properties.NORMALSPACE == \"OBJECT\") {\n\n\t\t\t\tshader += \"uniform mat4 normalMatrix;\\n\";\n\t\t\t\tshader += \"uniform mat4 normalMatrix2;\\n\";\n\t\t\t}\n        }\n\t}\n\t\n\t//Fog\n\tif(properties.FOG) {\n\t\tshader += x3dom.shader.fog();\n\t}\n\n    if(properties.LIGHTS || properties.CLIPPLANES)\n    {\n\t\tshader += \"varying vec4 fragPosition;\\n\";\n\t\tshader += \"varying vec4 fragPositionWS;\\n\";\n        shader += \"uniform float isOrthoView;\\n\";\n    }\n\n\t//Lights\n\tif(properties.LIGHTS) {\n\n\t\tif(properties.NORMALMAP && properties.NORMALSPACE == \"OBJECT\") {\n\t\t\t//do nothing\n\t\t} else {\n\t\t\tshader += \"varying vec3 fragNormal;\\n\";\n\t\t}\n\n\t\tvar numLights = properties.LIGHTS;\n\n\t\tif(properties.PHYSICALENVLIGHT)\n\t\t{\n\t\t\tnumLights--;\n\t\t}\n\n\t\tif(properties.PBR_MATERIAL && numLights)\n\t\t{\n\t\t\tshader += x3dom.shader.lightPBR(properties.LIGHTS);\n\t\t}\n\t\telse if(numLights)\n\t\t{\n\t\t\tshader += x3dom.shader.light(properties.LIGHTS);\n\t\t}\t\n\t}\n\n    if(properties.CLIPPLANES) {\n        shader += x3dom.shader.clipPlanes(properties.CLIPPLANES);\n    }\n\n    // Declare gamma correction for color computation (see property \"GAMMACORRECTION\")\n    shader += x3dom.shader.gammaCorrectionDecl(properties);\n \n \n\t/*******************************************************************************\n\t* Generate main function\n\t********************************************************************************/\n\tshader += \"void main(void) {\\n\";\n\n\tif(properties.CUBEMAP || properties.CLIPPLANES || properties.PBR_MATERIAL)\n    {\n\t\tshader += \"mat4 mat_mvi = modelViewMatrixInverse;\\n\";\n\t\tshader += \"mat4 mat_vi  = viewMatrixInverse;\\n\";\n\t}\n\t\n\tif(properties.NORMALSPACE == \"OBJECT\")\n\t{\n\t\tshader += \"mat4 mat_n = normalMatrix;\\n\"\n\t}\n\n\tshader += \"if(fragEyeIdx == 1.0){\\n\"\n\n\tif(properties.CUBEMAP || properties.CLIPPLANES) {\n\t\tshader += \"    mat_mvi   = modelViewMatrixInverse2;\\n\";\n\t\tshader += \"    mat_vi    = viewMatrixInverse2;\\n\";\n\t}\n\tif(properties.NORMALSPACE == \"OBJECT\")\n\t{\n\t\tshader += \"    mat_n   = normalMatrix2;\\n\";\n\t}\n\n\tshader += \"}\\n\";\n\n\tshader += \"if ( isVR == 1.0) {\\n\";\n\tshader += \"    if ( ( step( 0.5, gl_FragCoord.x / screenWidth ) - 0.5 ) * vrOffset < 0.0 ) discard;\\n\";\n\tshader += \"}\\n\";\n\n    if(properties.CLIPPLANES)\n    {\n        shader += \"vec3 cappingColor = calculateClipPlanes();\\n\";\n    }\n\t\n\t//Init color. In the fragment shader we are treating color linear by\n    //gamma-adjusting actively before doing lighting computations. At the end\n    //the color value is encoded again. See shader propery GAMMACORRECTION.\n\tshader += \"vec4 color;\\n\";\n\tshader += \"vec4 texColor;\\n\";\n\tshader += \"color.rgb = diffuseColor;\\n\";\n\tshader += \"color.a = 1.0 - transparency;\\n\";\n\n    shader += \"vec3 _emissiveColor     = emissiveColor;\\n\";\n\tshader += \"float _shininess        = shininess;\\n\";\n    shader += \"vec3 _specularColor     = specularColor;\\n\";\n    shader += \"float _ambientIntensity = ambientIntensity;\\n\";\n\tshader += \"float _transparency     = transparency;\\n\";\n\tshader += \"float _occlusion        = 1.0;\\n\";\n\n\tif(properties.ALPHAMODE == \"OPAQUE\")\n\t{\n\t\tshader += \"color.a = 1.0;\\n\";\n\t}\n\n\tif(properties.PBR_MATERIAL && properties.ISROUGHNESSMETALLIC)\n\t{\t\n\t\tshader += \"float _metallic         = metallicFactor;\\n\";\n\t}\n\n\tif(properties.SEPARATEBACKMAT)\n\t{\n\t\tshader += \"  if(!gl_FrontFacing) {\\n\";\n\t\tshader += \"    color.rgb = backDiffuseColor;\\n\";\n\t\tshader += \"    color.a = 1.0 - backTransparency;\\n\";\n\t\tshader += \"    _transparency = 1.0 - backTransparency;\\n\";\n\t\tshader += \"    _shininess = backShininess;\\n\";\n\t\tshader += \"    _emissiveColor = backEmissiveColor;\\n\";\n\t\tshader += \"    _specularColor = backSpecularColor;\\n\";\n\t\tshader += \"    _ambientIntensity = backAmbientIntensity;\\n\";\n\t\tshader += \"  }\\n\";\n\t}\n\n    if (properties.MULTIVISMAP || properties.MULTIDIFFALPMAP || properties.MULTISPECSHINMAP || properties.MULTIEMIAMBMAP) {\n        shader += \"vec2 idCoord;\\n\";\n        shader += \"float roundedIDVisibility = floor(fragID+0.5);\\n\";\n        shader += \"float roundedIDMaterial = floor(fragID+0.5);\\n\";\n        shader += \"if(!gl_FrontFacing) {\\n\";\n        shader += \"    roundedIDMaterial = floor(fragID + (multiDiffuseAlphaWidth*multiDiffuseAlphaWidth) + 0.5);\\n\";\n        shader += \"}\\n\";\n    }\n\n    if (properties.MULTIVISMAP) {\n        shader += \"idCoord.x = mod(roundedIDVisibility, multiVisibilityWidth) * (1.0 / multiVisibilityWidth) + (0.5 / multiVisibilityWidth);\\n\";\n        shader += \"idCoord.y = floor(roundedIDVisibility / multiVisibilityWidth) * (1.0 / multiVisibilityHeight) + (0.5 / multiVisibilityHeight);\\n\";\n        shader += \"vec4 visibility = texture2D( multiVisibilityMap, idCoord );\\n\";\n        shader += \"if (visibility.r < 1.0) discard; \\n\";\n    }\n\n    if (properties.MULTIDIFFALPMAP) {\n        shader += \"idCoord.x = mod(roundedIDMaterial, multiDiffuseAlphaWidth) * (1.0 / multiDiffuseAlphaWidth) + (0.5 / multiDiffuseAlphaWidth);\\n\";\n        shader += \"idCoord.y = floor(roundedIDMaterial / multiDiffuseAlphaWidth) * (1.0 / multiDiffuseAlphaHeight) + (0.5 / multiDiffuseAlphaHeight);\\n\";\n        shader += \"vec4 diffAlpha = texture2D( multiDiffuseAlphaMap, idCoord );\\n\";\n        shader += \"color.rgb = \" + x3dom.shader.decodeGamma(properties, \"diffAlpha.rgb\") + \";\\n\";\n\t\tshader += \"_transparency = 1.0 - diffAlpha.a;\\n\";\n        shader += \"color.a = diffAlpha.a;\\n\";\n    }\n\n    if (properties.MULTIEMIAMBMAP) {\n        shader += \"idCoord.x = mod(roundedIDMaterial, multiDiffuseAlphaWidth) * (1.0 / multiDiffuseAlphaWidth) + (0.5 / multiDiffuseAlphaWidth);\\n\";\n        shader += \"idCoord.y = floor(roundedIDMaterial / multiDiffuseAlphaWidth) * (1.0 / multiDiffuseAlphaHeight) + (0.5 / multiDiffuseAlphaHeight);\\n\";\n        shader += \"vec4 emiAmb = texture2D( multiEmissiveAmbientMap, idCoord );\\n\";\n        shader += \"_emissiveColor = emiAmb.rgb;\\n\";\n        shader += \"_ambientIntensity = emiAmb.a;\\n\";\n    }\n\t\t\t\n\tif (properties.VERTEXCOLOR)\n\t{\n\t\tif ((properties.COLCOMPONENTS === 3 || properties.ALPHAMODE == \"OPAQUE\") && properties.PBR_MATERIAL)\n\t\t{\n            shader += \"color.rgb *= fragColor.rgb;\\n\";\n\t\t}\n\t\telse if (properties.COLCOMPONENTS === 3 && !properties.PBR_MATERIAL)\n\t\t{\n            shader += \"color.rgb = fragColor.rgb;\\n\";\n\t\t}\n\t\telse if (properties.COLCOMPONENTS === 4 && properties.PBR_MATERIAL)\n\t\t{\n            shader += \"color *= fragColor;\\n\";\n\t\t}\n\t\telse if (properties.COLCOMPONENTS === 4 && !properties.PBR_MATERIAL)\n\t\t{\n            shader += \"color = fragColor;\\n\";\n        }\n    }\n\t\n\tif(properties.UNLIT)\n\t{\n\t\tif(properties.DIFFUSEMAP)\n\t\t{\n\t\t\tif(properties.DIFFUSEMAPCHANNEL)\n\t\t\t{\n\t\t\t\tshader += \"texColor = \" + x3dom.shader.decodeGamma(properties, \"texture2D(diffuseMap, vec2(fragTexcoord2.x, 1.0 - fragTexcoord2.y))\") + \";\\n\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tshader += \"texColor = \" + x3dom.shader.decodeGamma(properties, \"texture2D(diffuseMap, vec2(fragTexcoord.x, 1.0 - fragTexcoord.y))\") + \";\\n\";\n\t\t\t}\n\n\t\t\tif(properties.ALPHAMODE == \"OPAQUE\")\n\t\t\t{\n\t\t\t\tshader += \"texColor.a = 1.0;\\n\";\n\t\t\t}\n\n\t\t\tshader += \"color *= texColor;\\n\";\n\t\t}\n\t}\n\telse if(properties.LIGHTS)\n\t{\n\t\tshader += \"vec3 ambient   = vec3(0.0, 0.0, 0.0);\\n\";\n\t\tshader += \"vec3 diffuse   = vec3(0.0, 0.0, 0.0);\\n\";\n\t\tshader += \"vec3 specular  = vec3(0.0, 0.0, 0.0);\\n\";\n\t\tshader += \"vec3 eye;\\n\";\n\t\tshader += \"vec3 positionVS = fragPosition.rgb;\\n\";\n        shader += \"if ( isOrthoView > 0.0 ) {\\n\";\n        shader += \"    eye = vec3(0.0, 0.0, 1.0);\\n\";\n        shader += \"} else {\\n\";\n        shader += \"    eye = -fragPosition.xyz;\\n\";\n\t\tshader += \"}\\n\";\n\t\t\n\t\tif(properties.NORMALMAP){\n\t\t\tshader += \"vec3 _normalBias = normalBias;\\n\";\n\t\t}\n\n\t\tif(properties.NORMALMAP && properties.NORMALSPACE == \"OBJECT\") {\n\t\t\tshader += \"vec3 normal = vec3(0.0, 0.0, 0.0);\\n\";\n\t\t} else {\n\t\t\tshader += \"vec3 normal = normalize(fragNormal);\\n\";\n\t\t}\n\n\t\t//Solid\n\t\tif(!properties.SOLID || properties.TWOSIDEDMAT) {\n\t\t\tshader += \"if (dot(normalize(fragNormal), eye) < 0.0) {\\n\";\n\t\t\tshader += \"  normal *= -1.0;\\n\";\n\t\t\tif(properties.NORMALMAP){\n\t\t\t\tshader += \"  _normalBias = _normalBias * _normalBias;\\n\";\n\t\t\t}\t\n\t\t\tshader += \"}\\n\";\n\t\t}\n\n\t\tif(properties.TEXTURED)\n\t\t{\n\t\t\t//Normalmap\n\t\t\tif(properties.NORMALMAP){\n\n\t\t\t\tif(properties.NORMALSPACE == \"TANGENT\") {\n\n\t\t\t\t\tshader += \"vec3 n = normal;\\n\";\n\n\t\t\t\t\tif (!properties.TANGENTDATA && (x3dom.caps.STD_DERIVATIVES || x3dom.caps.WEBGL_VERSION == 2)) {\n\t\t\t\t\t\tshader += \"normal = perturb_normal( n, fragPosition.xyz, vec2(fragTexcoord.x, 1.0 - fragTexcoord.y), _normalBias);\\n\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\tshader += \"vec3 t = normalize( fragTangent );\\n\";\n\t\t\t\t\t\tshader += \"vec3 b = normalize( fragBinormal );\\n\";\n\t\t\t\t\t\tshader += \"mat3 tangentToWorld = mat3(t, b, n);\\n\";\n\n\t\t\t\t\t\tshader += \"normal = texture2D( normalMap, vec2(fragTexcoord.x, 1.0-fragTexcoord.y) ).rgb;\\n\";\n\t\t\t\t\t\tshader += \"normal = 2.0 * normal - 1.0;\\n\";\n\t\t\t\t\t\tshader += \"normal = normalize( normal * tangentToWorld );\\n\";\n\t\t\t\t\t}\n\n\t\t\t\t} else if(properties.NORMALSPACE == \"OBJECT\") {\n\t\t\t\t\tshader += \"normal = texture2D( normalMap, vec2(fragTexcoord.x, 1.0-fragTexcoord.y) ).rgb;\\n\";\n\t\t\t\t\t\n\t\t\t\t\tshader += \"normal = 2.0 * normal - 1.0;\\n\";\n\t\t\t\t\tshader += \"normal = (mat_n * vec4(normal, 0.0)).xyz;\\n\";\n\t\t\t\t\tshader += \"normal = normalize(normal);\\n\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(properties.CUBEMAP) {\n\t\t\t\tshader += \"vec3 viewDir = normalize(fragViewDir);\\n\";\n\t\t\t\tshader += \"vec3 reflected = reflect(-eye, normal);\\n\";\n\t\t\t\tshader += \"reflected = (mat_mvi * vec4(reflected, 0.0)).xyz;\\n\";\n\t\t\t\tshader += \"texColor = \" + x3dom.shader.decodeGamma(properties, \"textureCube(environmentMap, reflected)\") + \";\\n\";\n\t\t\t}\n\t\t\telse if (properties.DIFFPLACEMENTMAP)\n\t\t\t{\n\t\t\t\tshader += \"texColor = texture2D(diffuseDisplacementMap, vec2(fragTexcoord.x, 1.0-fragTexcoord.y));\\n\";\n\t\t\t}\n\t\t\telse if(properties.DIFFUSEMAP || properties.TEXT)\n\t\t\t{\n\t\t\t\tif (properties.PIXELTEX) {\n\t\t\t\t\tif(properties.DIFFUSEMAPCHANNEL)\n\t\t\t\t\t{\n\t\t\t\t\t\tshader += \"texColor = \" + x3dom.shader.decodeGamma(properties, \"texture2D(diffuseMap, fragTexcoord2)\") + \";\\n\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tshader += \"texColor = \" + x3dom.shader.decodeGamma(properties, \"texture2D(diffuseMap, fragTexcoord)\") + \";\\n\";\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif(properties.DIFFUSEMAPCHANNEL)\n\t\t\t\t\t{\n\t\t\t\t\t\tshader += \"texColor = \" + x3dom.shader.decodeGamma(properties, \"texture2D(diffuseMap, vec2(fragTexcoord2.x, 1.0 - fragTexcoord2.y))\") + \";\\n\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tshader += \"texColor = \" + x3dom.shader.decodeGamma(properties, \"texture2D(diffuseMap, vec2(fragTexcoord.x, 1.0 - fragTexcoord.y))\") + \";\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(properties.ALPHAMODE == \"OPAQUE\")\n\t\t\t{\n\t\t\t\tshader += \"texColor.a = 1.0;\\n\";\n\t\t\t}\n\n\t\t\tif(properties.BLENDING && (properties.DIFFUSEMAP || properties.TEXT || properties.DIFFPLACEMENTMAP || properties.CUBEMAP))\n\t\t\t{\n\t\t\t\tif(properties.CUBEMAP && properties.CSSHADER) {\n\t\t\t\t\tshader += \"color.rgb *= mix(vec3(1.0,1.0,1.0), texColor.rgb, environmentFactor);\\n\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tshader += \"color *= texColor;\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(!properties.BLENDING && (properties.DIFFUSEMAP || properties.TEXT || properties.DIFFPLACEMENTMAP || properties.CUBEMAP))\n\t\t\t{\n\t\t\t\tshader += \"color = texColor;\\n\";\n\t\t\t}\n\n        if(properties.SHINMAP){\n            shader += \"_shininess *= texture2D( shininessMap, vec2(fragTexcoord.x, 1.0-fragTexcoord.y) ).r;\\n\";\n        }\n\t\t\t\n\t\t\t//Specularmap\n\t\t\tif(properties.SPECMAP) {\n\t\t\t\tshader += \"_specularColor = texture2D(specularMap, vec2(fragTexcoord.x, 1.0-fragTexcoord.y)).rgb;\\n\";\n\t\t\t}\n\t\t\t\n\t\t\t//Specularmap\n\t\t\tif(properties.EMISSIVEMAP)\n\t\t\t{\n\t\t\t\tif(properties.EMISSIVEMAPCHANNEL)\n\t\t\t\t{\n\t\t\t\t\tshader += \"_emissiveColor = _emissiveColor * texture2D(emissiveMap, vec2(fragTexcoord2.x, 1.0-fragTexcoord2.y)).rgb;\\n\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tshader += \"_emissiveColor = _emissiveColor * texture2D(emissiveMap, vec2(fragTexcoord.x, 1.0-fragTexcoord.y)).rgb;\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Specularmap\n\t\t\tif(properties.ROUGHNESSMETALLICMAP) {\n\t\t\t\tif(properties.ROUGHNESSMETALLICMAPCHANNEL)\n\t\t\t\t{\n\t\t\t\t\tshader += \"vec3 roughnessMetallic = texture2D(roughnessMetallicMap, vec2(fragTexcoord2.x, 1.0-fragTexcoord2.y)).rgb;\\n\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tshader += \"vec3 roughnessMetallic = texture2D(roughnessMetallicMap, vec2(fragTexcoord.x, 1.0-fragTexcoord.y)).rgb;\\n\";\n\t\t\t\t}\n\t\t\t\tshader += \"_shininess = 1.0 - (roughnessMetallic.g * (1.0 - _shininess));\\n\";\n\t\t\t\tshader += \"_metallic  = roughnessMetallic.b * metallicFactor;\\n\";\t\t\t\t\n\t\t\t}\n\n\t\t\tif(properties.SPECULARGLOSSINESSMAP)\n\t\t\t{\n\t\t\t\tif(properties.SPECULARGLOSSINESSMAPCHANNEL)\n\t\t\t\t{\n\t\t\t\t\tshader += \"vec4 specularGlossiness = \" + x3dom.shader.decodeGamma(properties, \"texture2D(specularGlossinessMap, vec2(fragTexcoord2.x, 1.0 - fragTexcoord2.y))\") + \";\\n\";\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tshader += \"vec4 specularGlossiness = \" + x3dom.shader.decodeGamma(properties, \"texture2D(specularGlossinessMap, vec2(fragTexcoord.x, 1.0 - fragTexcoord.y))\") + \";\\n\";\t\n\t\t\t\t}\n\t\t\t\tshader += \"_shininess = specularGlossiness.a * _shininess;\\n\";\n\t\t\t}\n\n\t\t\t//Specularmap\n\t\t\tif(properties.OCCLUSIONROUGHNESSMETALLICMAP) {\n\n\t\t\t\tif(properties.OCCLUSIONROUGHNESSMETALLICMAPCHANNEL)\n\t\t\t\t{\n\t\t\t\t\tshader += \"vec3 occlusionRoughnessMetallic = texture2D(occlusionRoughnessMetallicMap, vec2(fragTexcoord2.x, 1.0-fragTexcoord2.y)).rgb;\\n\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tshader += \"vec3 occlusionRoughnessMetallic = texture2D(occlusionRoughnessMetallicMap, vec2(fragTexcoord.x, 1.0-fragTexcoord.y)).rgb;\\n\";\n\t\t\t\t}\n\n\t\t\t\tshader += \"_occlusion = occlusionRoughnessMetallic.r;\\n\";\n\t\t\t\tshader += \"_shininess = 1.0 - occlusionRoughnessMetallic.g;\\n\";\n\t\t\t\tshader += \"_metallic  = occlusionRoughnessMetallic.b;\\n\";\n\t\t\t}\n\n\t\t\t//Specularmap\n\t\t\tif(properties.OCCLUSIONMAP) {\n\n\t\t\t\tif(properties.OCCLUSIONMAPCHANNEL)\n\t\t\t\t{\n\t\t\t\t\tshader += \"_occlusion = texture2D(occlusionMap, vec2(fragTexcoord2.x, 1.0-fragTexcoord2.y)).r;\\n\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tshader += \"_occlusion = texture2D(occlusionMap, vec2(fragTexcoord.x, 1.0-fragTexcoord.y)).r;\\n\";\n\t\t\t\t}\t\n\t\t\t}\n\n\t\t\tif (properties.MULTISPECSHINMAP) {\n\t\t\t\tshader += \"idCoord.x = mod(roundedIDMaterial, multiSpecularShininessWidth) * (1.0 / multiSpecularShininessWidth) + (0.5 / multiSpecularShininessWidth);\\n\";\n\t\t\t\tshader += \"idCoord.y = floor(roundedIDMaterial / multiSpecularShininessWidth) * (1.0 / multiSpecularShininessHeight) + (0.5 / multiSpecularShininessHeight);\\n\";\n\t\t\t\tshader += \"vec4 specShin = texture2D( multiSpecularShininessMap, idCoord );\\n\";\n\t\t\t\tshader += \"_specularColor = specShin.rgb;\\n\";\n\t\t\t\tshader += \"_shininess = specShin.a;\\n\";\n\t\t\t}\n\t\t}\n\n\t\tif(properties.PBR_MATERIAL && properties.ISROUGHNESSMETALLIC)\n\t\t{\n\t\t\tshader += \"_specularColor = mix(vec3(0.04, 0.04, 0.04), color.rgb, _metallic);\\n\";\t\n\t\t\tshader += \"color.rgb *= (1.0 - _metallic);\\n\";\n\t\t}\n\t\telse if(properties.PBR_MATERIAL && properties.SPECULARGLOSSINESSMAP)\n\t\t{\n\t\t\tshader += \"_specularColor = specularGlossiness.rgb * _specularColor;\\n\";\n\t\t}\n\n\t\t//Calculate lights\n        if (numLights) {\n\n            for(var l=0; l<numLights; l++) {\n                var lightCol = \"light\"+l+\"_Color\";\n                shader += \" lighting(light\"+l+\"_Type, \" +\n                                    \"light\"+l+\"_Location, \" +\n                                    \"light\"+l+\"_Direction, \" +\n                                    lightCol + \", \" +\n                                    \"light\"+l+\"_Attenuation, \" +\n                                    \"light\"+l+\"_Radius, \" +\n                                    \"light\"+l+\"_Intensity, \" +\n                                    \"light\"+l+\"_AmbientIntensity, \" +\n                                    \"light\"+l+\"_BeamWidth, \" +\n                                    \"light\"+l+\"_CutOffAngle, \" +\n                                    \"positionVS, normal, eye, _shininess, _ambientIntensity, _specularColor, ambient, diffuse, specular);\\n\";\n            }\n\n            shader += \"ambient = max(ambient, 0.0);\\n\";\n            shader += \"diffuse = max(diffuse, 0.0);\\n\";\n            shader += \"specular = max(specular, 0.0);\\n\";\n\t\t}\n\t\t\n\t\tif(properties.PBR_MATERIAL)\n\t\t{\n\t\t\t//shader += \"_specularColor = vec3(1.0);\\n\";\n\t\t\tif(properties.PHYSICALENVLIGHT)\n\t\t\t{\n\t\t\t\tshader += \"float camDistance = length(cameraPosWS.xyz - fragPositionWS.xyz);\\n\";\n\t\t\t\tshader += \"vec3 N = (mat_vi * vec4(normal, 0.0)).rgb;\\n\";\n\t\t\t\tshader += \"vec3 V = normalize ( cameraPosWS.xyz - fragPositionWS.xyz );\\n\";\n\t\t\t\tshader += \"vec3 R = normalize( reflect ( -V, N ) );\\n\";\n\n\t\t\t\tshader += \"float roughness  =  1.0 - _shininess;\\n\";\n\t\t\t\tshader += \"float NoV = clamp(dot( N, V ), 0.0, 1.0);\\n\";\n\t\t\t\tshader += \"float lod = roughness * 6.0;\"\n\n\t\t\t\tshader += \"diffuse = textureCube( diffuseEnvironmentMap, N ).rgb;\\n\";\n\n\t\t\t\tif(x3dom.caps.TEXTURE_LOD || x3dom.caps.WEBGL_VERSION == 2)\n\t\t\t\t{\n\t\t\t\t\tshader += \"specular = textureCubeLodEXT( specularEnvironmentMap, R, lod ).rgb;\\n\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tshader += \"float level = calcMipLevel(dirToCubeUV(R));\\n\";\n\t\t\t\t\tshader += \"float bias  = lod - level;\\n\";\n\t\t\t\t\tshader += \"specular    = textureCube( specularEnvironmentMap, R, bias ).rgb;\\n\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Calculate specular lighting from precomputed maps\n\t\t\t\tshader += \"vec3 brdf      = texture2D( brdfMap, vec2( NoV, roughness ) ).rgb;\\n\";\n\t\t\t\tshader += \"_specularColor = ( _specularColor * brdf.x + brdf.y );\\n\";\t\t\n\t\t\t}\n\t\t}\n\n\t\tshader += \"color.rgb = _emissiveColor + ((ambient + diffuse) * color.rgb + specular * _specularColor) * _occlusion;\\n\";\t\n\t\t\n\t} else {\n\t\tif (properties.APPMAT && !properties.VERTEXCOLOR && !properties.TEXTURED && !properties.PBR_MATERIAL) {\n\t\t\tshader += \"color = vec4(0.0, 0.0, 0.0, 1.0 - _transparency);\\n\";\n\t\t}\n\t\t\n\t\tif(properties.TEXTURED && ( properties.DIFFUSEMAP || properties.DIFFPLACEMENTMAP || properties.TEXT )){\n            if (properties.PIXELTEX) {\n                shader += \"vec2 texCoord = fragTexcoord;\\n\";\n            } else {\n                shader += \"vec2 texCoord = vec2(fragTexcoord.x, 1.0-fragTexcoord.y);\\n\";\n            }\n\n            if (properties.IS_PARTICLE) {\n                shader += \"texCoord = clamp(gl_PointCoord, 0.01, 0.99);\\n\";\n            }\n            shader += \"texColor = \" + x3dom.shader.decodeGamma(properties, \"texture2D(diffuseMap, texCoord)\") + \";\\n\";\n            shader += \"color.a = texColor.a;\\n\";\n\n\t\t\tif(properties.BLENDING || properties.IS_PARTICLE){\n\t\t\t\tshader += \"color.rgb += _emissiveColor.rgb;\\n\";\n\t\t\t\tshader += \"color.rgb *= texColor.rgb;\\n\";\n\t\t\t} else {\n\t\t\t\tshader += \"color = texColor;\\n\";\n\t\t\t}\n\t\t} else if(!properties.VERTEXCOLOR && !properties.PBR_MATERIAL && !properties.POINTLINE2D){\n\t\t\tshader += \"color.rgb += _emissiveColor;\\n\";\n\t\t} else if(!properties.VERTEXCOLOR && !properties.PBR_MATERIAL && properties.POINTLINE2D){\n\t\t\tshader += \"color.rgb = _emissiveColor;\\n\";\n            if (properties.IS_PARTICLE) {\n                shader += \"float pAlpha = 1.0 - clamp(length((gl_PointCoord - 0.5) * 2.0), 0.0, 1.0);\\n\";\n                shader += \"color.rgb *= vec3(pAlpha);\\n\";\n                shader += \"color.a = pAlpha;\\n\";\n            }\n\t\t} else if (properties.IS_PARTICLE) {\n            shader += \"float pAlpha = 1.0 - clamp(length((gl_PointCoord - 0.5) * 2.0), 0.0, 1.0);\\n\";\n            shader += \"color.rgb *= vec3(pAlpha);\\n\";\n            shader += \"color.a = pAlpha;\\n\";\n        }\n\t}\n\n    if(properties.CLIPPLANES)\n    {\n        shader += \"if (cappingColor.r != -1.0) {\\n\";\n        shader += \"    color.rgb = cappingColor;\\n\";\n        shader += \"}\\n\";\n    }\n\n\t//Kill pixel\n\tif(properties.TEXT) {\n\t\tshader += \"if (color.a <= 0.5) discard;\\n\";\n\t}\n\telse if(properties.ALPHAMASK)\n\t{\n\t\tshader += \"if (color.a <= alphaCutoff) discard;\\n\";\n\t\tshader += \"color.a = 1.0;\\n\";\n\t}\n\telse\n\t{\n\t\tshader += \"if (color.a <= 0.01) discard;\\n\";\n\t}\n\n\t//Output the gamma encoded result.\n    shader += \"if(tonemappingOperator == 1.0) {\\n\";\n\tshader += \"   \tcolor.rgb = tonemapReinhard(color.rgb);\\n\";\n\tshader += \"\t}\\n\";\n\tshader += \"\tif(tonemappingOperator == 2.0) {\\n\";\n\tshader += \"   \tcolor.rgb = tonemapUncharted2(color.rgb);\\n\";\n\tshader += \"\t}\\n\";\n\tshader += \"\tif(tonemappingOperator == 3.0) {\\n\";\n\tshader += \"   \tcolor.rgb = tonemapeFilmic(color.rgb);\\n\";\n\tshader += \"\t}\\n\";\n\n    shader += \"color = \" + x3dom.shader.encodeGamma(properties, \"color\") + \";\\n\";\n\t\n\t//Fog\n\tif(properties.FOG){\n\t\tshader += \"float f0 = calcFog(fragEyePosition);\\n\";\n\t\tshader += \"color.rgb = fogColor * (1.0-f0) + f0 * (color.rgb);\\n\";\n\t}\n\n\tshader += \"gl_FragColor = color;\\n\";\n\t\n\t//End Of Shader\n\tshader += \"}\\n\";\n\n\tif( version == 2 )\n\t{\n\t\tshader = x3dom.shader.convertFragmentShader(shader);\n\t}\n\n    var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n\tgl.shaderSource(fragmentShader, shader);\n    gl.compileShader(fragmentShader);\n\t\t\n\tif(!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)){\n        x3dom.debug.logInfo(\"FRAGMENT:\\n\" + shader);\n\t\tx3dom.debug.logError(\"FragmentShader \" + gl.getShaderInfoLog(fragmentShader));\n\t}\n\n\treturn fragmentShader;\n};\n\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * Philip Taylor: http://philip.html5.org\n */\n\n/**\n * Generate the final Shader program\n */\nx3dom.shader.DynamicMobileShader = function(gl, properties)\n{\n\tthis.program = gl.createProgram();\n\t\n\tvar vertexShader \t= this.generateVertexShader(gl, properties);\n\tvar fragmentShader \t= this.generateFragmentShader(gl, properties);\n\t\n\tgl.attachShader(this.program, vertexShader);\n    gl.attachShader(this.program, fragmentShader);\n    \n    // optional, but position should be at location 0 for performance reasons\n    gl.bindAttribLocation(this.program, 0, \"position\");\n    \n\tgl.linkProgram(this.program);\n\t\n\treturn this.program;\n};\n\n/**\n * Generate the vertex shader\n */\nx3dom.shader.DynamicMobileShader.prototype.generateVertexShader = function(gl, properties)\n{\n\tvar shader = \"\";\n\t\n\t/*******************************************************************************\n\t* Generate dynamic attributes & uniforms & varyings\n\t********************************************************************************/\n\t\n\t//Material\n\tshader += x3dom.shader.material();\n\n    if (properties.TWOSIDEDMAT ) {\n        shader += x3dom.shader.twoSidedMaterial();\n    }\n\t\n\t//Default Matrices\n\tshader += \"uniform mat4 normalMatrix;\\n\";\n\tshader += \"uniform mat4 modelViewMatrix;\\n\";\n    shader += \"uniform mat4 modelViewProjectionMatrix;\\n\";\n\t\n\t//Positions\n\tif(properties.POSCOMPONENTS == 3) {\n\t\tshader += \"attribute vec3 position;\\n\";\n\t} else if(properties.POSCOMPONENTS == 4) {\n\t\tshader += \"attribute vec4 position;\\n\";\n\t}\n\t\n  //IG stuff\n\tif(properties.IMAGEGEOMETRY) {\n\t\tshader += \"uniform vec3 IG_bboxMin;\\n\";\n\t\tshader += \"uniform vec3 IG_bboxMax;\\n\";\n\t\tshader += \"uniform float IG_coordTextureWidth;\\n\";\n\t\tshader += \"uniform float IG_coordTextureHeight;\\n\";\n\t\tshader += \"uniform vec2 IG_implicitMeshSize;\\n\";\n\t\t\n\t\tfor( var i = 0; i < properties.IG_PRECISION; i++ ) {\n\t\t\tshader += \"uniform sampler2D IG_coords\" + i + \"\\n;\";\n\t\t}\n\t\t\n\t\tif(properties.IG_INDEXED) {\n\t\t\tshader += \"uniform sampler2D IG_index;\\n\";\n\t\t\tshader += \"uniform float IG_indexTextureWidth;\\n\";\n\t\t\tshader += \"uniform float IG_indexTextureHeight;\\n\";\n\t\t}\n\t}\n\t\n    //PG stuff\n    if (properties.POPGEOMETRY) {\n        shader += \"uniform float PG_precisionLevel;\\n\";\n        shader += \"uniform float PG_powPrecision;\\n\";\n        shader += \"uniform vec3 PG_maxBBSize;\\n\";\n        shader += \"uniform vec3 PG_bbMin;\\n\";\n        shader += \"uniform vec3 PG_bbMaxModF;\\n\";\n        shader += \"uniform vec3 PG_bboxShiftVec;\\n\";\n        shader += \"uniform float PG_numAnchorVertices;\\n\";\n        shader += \"attribute float PG_vertexID;\\n\";\n    }\n  \n\t//Normals\n\tif(!properties.POINTLINE2D) {\n\t\tif(properties.IMAGEGEOMETRY) {\t\t\n\t\t\tshader += \"uniform sampler2D IG_normals;\\n\";\t\n\t\t} else {\n\t\t\tif(properties.NORCOMPONENTS == 2) {\n\t\t\t\tif(properties.POSCOMPONENTS != 4) {\n\t\t\t\t\tshader += \"attribute vec2 normal;\\n\";\n\t\t\t\t}\n\t\t\t} else if(properties.NORCOMPONENTS == 3) {\n\t\t\t\tshader += \"attribute vec3 normal;\\n\";\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//Colors\n\tshader += \"varying vec4 fragColor;\\n\";\n\tif(properties.VERTEXCOLOR){\n\t\tif(properties.IMAGEGEOMETRY) {\n\t\t\tshader += \"uniform sampler2D IG_colors;\";\n\t\t} else {\n\t\t\tif(properties.COLCOMPONENTS == 3){\n\t\t\t\tshader += \"attribute vec3 color;\";\n\t\t\t} else if(properties.COLCOMPONENTS == 4) {\n\t\t\t\tshader += \"attribute vec4 color;\";\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//Textures\n\tif(properties.TEXTURED) {\n\t\tshader += \"varying vec2 fragTexcoord;\\n\";\n\t\tif(properties.IMAGEGEOMETRY) {\n\t\t\tshader += \"uniform sampler2D IG_texCoords;\";\n\t\t} else {\n\t\t\tshader += \"attribute vec2 texcoord;\\n\";\n\t\t}\n\t\tif(properties.TEXTRAFO){\n\t\t\tshader += \"uniform mat4 texTrafoMatrix;\\n\";\n\t\t}\n\t\tif(!properties.BLENDING) {\n\t\t\tshader += \"varying vec3 fragAmbient;\\n\";\n\t\t\tshader += \"varying vec3 fragDiffuse;\\n\";\n\t\t}\n\t\tif(properties.CUBEMAP) {\n\t\t\tshader += \"varying vec3 fragViewDir;\\n\";\n\t\t\tshader += \"varying vec3 fragNormal;\\n\";\n\t\t\tshader += \"uniform mat4 viewMatrix;\\n\";\n\t\t}\n\t}\n\t\n\t//Fog\n\tif(properties.FOG) {\n\t\tshader += x3dom.shader.fog();\n\t}\n\t\n\t//Lights\n\tif(properties.LIGHTS) {\n\t\tshader += x3dom.shader.light(properties.LIGHTS);\n\t}\n\t\n\t//Bounding Boxes\n\tif(properties.REQUIREBBOX) {\n\t\tshader += \"uniform vec3 bgCenter;\\n\";\n\t\tshader += \"uniform vec3 bgSize;\\n\";\n\t\tshader += \"uniform float bgPrecisionMax;\\n\";\n\t}\n\tif(properties.REQUIREBBOXNOR) {\n\t\tshader += \"uniform float bgPrecisionNorMax;\\n\";\n\t}\n\tif(properties.REQUIREBBOXCOL) {\n\t\tshader += \"uniform float bgPrecisionColMax;\\n\";\n\t}\n\tif(properties.REQUIREBBOXTEX) {\n\t\tshader += \"uniform float bgPrecisionTexMax;\\n\";\n\t}\n\n    \n\t/*******************************************************************************\n\t* Generate main function\n\t********************************************************************************/\n\tshader += \"void main(void) {\\n\";\n\t\n\t//Set point size\n\tshader += \"gl_PointSize = 2.0;\\n\";\n\t\n\t/*******************************************************************************\n\t* Start of ImageGeometry switch\n\t********************************************************************************/\n\tif(properties.IMAGEGEOMETRY) {\n\t\t//Indices\n\t\tif(properties.IG_INDEXED) {\n\t\t\tshader += \"vec2 halfPixel = vec2(0.5/IG_indexTextureWidth,0.5/IG_indexTextureHeight);\\n\";\n\t\t\tshader += \"vec2 IG_texCoord = vec2(position.x*(IG_implicitMeshSize.x/IG_indexTextureWidth), position.y*(IG_implicitMeshSize.y/IG_indexTextureHeight)) + halfPixel;\\n\";\n\t\t\tshader += \"vec2 IG_indices = texture2D( IG_index, IG_texCoord ).rg;\\n\";\n\t\t\tshader += \"halfPixel = vec2(0.5/IG_coordTextureWidth,0.5/IG_coordTextureHeight);\\n\";\n\t\t\tshader += \"IG_texCoord = (IG_indices * 0.996108948) + halfPixel;\\n\";\n\t\t} else {\n\t\t\tshader += \"vec2 halfPixel = vec2(0.5/IG_coordTextureWidth, 0.5/IG_coordTextureHeight);\\n\";\n\t\t\tshader += \"vec2 IG_texCoord = vec2(position.x*(IG_implicitMeshSize.x/IG_coordTextureWidth), position.y*(IG_implicitMeshSize.y/IG_coordTextureHeight)) + halfPixel;\\n\";\n\t\t}\n\t\t\n\t\t//Positions\n\t\tshader += \"vec3 temp = vec3(0.0, 0.0, 0.0);\\n\";\n\t\tshader += \"vec3 vertPosition = vec3(0.0, 0.0, 0.0);\\n\";\n\t\t\n\t\tfor(var i=0; i<properties.IG_PRECISION; i++) {\n\t\t\tshader += \"temp = 255.0 * texture2D( IG_coords\" + i + \", IG_texCoord ).rgb;\\n\";\n\t\t\tshader += \"vertPosition *= 256.0;\\n\";\n\t\t\tshader += \"vertPosition += temp;\\n\";\n\t\t}\n\t\t\n\t\tshader += \"vertPosition /= (pow(2.0, 8.0 * \" + properties.IG_PRECISION + \".0) - 1.0);\\n\";\n\t\tshader += \"vertPosition = vertPosition * (IG_bboxMax - IG_bboxMin) + IG_bboxMin;\\n\";\n\t\n\t\t//Normals\n\t\tif(!properties.POINTLINE2D) {\n\t\t\tshader += \"vec3 vertNormal = texture2D( IG_normals, IG_texCoord ).rgb;\\n\";\n\t\t\tshader += \"vertNormal = vertNormal * 2.0 - 1.0;\\n\";\n\t\t}\n\t\t\n\t\t//Colors\n\t\tif(properties.VERTEXCOLOR) {\n\t\t\tif(properties.COLCOMPONENTS == 3) {\n\t\t\t\tshader += \"vec3 vertColor = texture2D( IG_colors, IG_texCoord ).rgb;\";\n\t\t\t} else if(properties.COLCOMPONENTS  == 4) {\n\t\t\t\tshader += \"vec4 vertColor = texture2D( IG_colors, IG_texCoord ).rgba;\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t//TexCoords\n\t\tif(properties.TEXTURED) {\n\t\t\tshader += \"vec4 IG_doubleTexCoords = texture2D( IG_texCoords, IG_texCoord );\\n\";\n\t\t\tshader += \"vec2 vertTexCoord;\";\n\t\t\tshader += \"vertTexCoord.r = (IG_doubleTexCoords.r * 0.996108948) + (IG_doubleTexCoords.b * 0.003891051);\\n\";\n\t\t\tshader += \"vertTexCoord.g = (IG_doubleTexCoords.g * 0.996108948) + (IG_doubleTexCoords.a * 0.003891051);\\n\";\n\t\t}\n\t} else {\n\t\t//Positions\n\t\tshader += \"vec3 vertPosition = position.xyz;\\n\";\n        \n        if (properties.POPGEOMETRY) {\n          //compute offset using bounding box and test if vertPosition <= PG_bbMaxModF \n          shader += \"vec3 offsetVec = step(vertPosition / bgPrecisionMax, PG_bbMaxModF) * PG_bboxShiftVec;\\n\";\n          \n          //coordinate truncation, computation of current maximum possible value\n          //PG_vertexID currently mimics use of gl_VertexID\n          shader += \"if ((PG_precisionLevel <= 2.0) || PG_vertexID >= PG_numAnchorVertices) {\\n\";\n          shader += \"   vertPosition = floor(vertPosition / PG_powPrecision) * PG_powPrecision;\\n\";\n          shader += \"   vertPosition /= (65536.0 - PG_powPrecision);\\n\";\n          shader += \"}\\n\";\n          shader += \"else {\\n\";\n          shader += \"   vertPosition /= bgPrecisionMax;\\n\";\n          shader += \"}\\n\";\n          \n          //translate coordinates, where PG_bbMin := floor(bbMin / size) \n          shader += \"vertPosition = (vertPosition + offsetVec + PG_bbMin) * PG_maxBBSize;\\n\";\n        }\n\t\telse if(properties.REQUIREBBOX) {\n          shader += \"vertPosition = bgCenter + bgSize * vertPosition / bgPrecisionMax;\\n\";\n\t\t}\n\t\n\t\t//Normals\n\t\tif(!properties.POINTLINE2D) {\n\t\t\tif (properties.NORCOMPONENTS == 2) {\n\t\t\t\tif (properties.POSCOMPONENTS == 4) {\n\t\t\t\t\t// (theta, phi) encoded in low/high byte of position.w\n\t\t\t\t\tshader += \"vec3 vertNormal = vec3(position.w / 256.0); \\n\";\n\t\t\t\t\tshader += \"vertNormal.x = floor(vertNormal.x) / 255.0; \\n\";\n\t\t\t\t\tshader += \"vertNormal.y = fract(vertNormal.y) * 1.00392156862745; \\n\"; //256.0 / 255.0\n\t\t\t\t} else if (properties.REQUIREBBOXNOR) {\n\t\t\t\t\tshader += \"vec3 vertNormal = vec3(normal.xy, 0.0) / bgPrecisionNorMax;\\n\";\n\t\t\t\t} else {\n\t\t\t\t\tshader += \"vec3 vertNormal = vec3(normal.xy, 0.0);\\n\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tshader += \"vec2 thetaPhi = 3.14159265358979 * vec2(vertNormal.x, vertNormal.y*2.0-1.0); \\n\";\n\n\t\t\t\t// Doing approximation with Taylor series and using cos(x) = sin(x+PI/2)\n\t\t\t\tshader += \"vec4 sinCosThetaPhi = vec4(thetaPhi, thetaPhi + 1.5707963267949); \\n\";\n\n\t\t\t\tshader += \"vec4 thetaPhiPow2 = sinCosThetaPhi * sinCosThetaPhi; \\n\";\n\t\t\t\tshader += \"vec4 thetaPhiPow3 =  thetaPhiPow2  * sinCosThetaPhi; \\n\";\n\t\t\t\tshader += \"vec4 thetaPhiPow5 =  thetaPhiPow3  * thetaPhiPow2; \\n\";\n\t\t\t\tshader += \"vec4 thetaPhiPow7 =  thetaPhiPow5  * thetaPhiPow2; \\n\";\n\t\t\t\tshader += \"vec4 thetaPhiPow9 =  thetaPhiPow7  * thetaPhiPow2; \\n\";\n\n\t\t\t\tshader += \"sinCosThetaPhi +=  -0.16666666667   * thetaPhiPow3; \\n\";\n\t\t\t\tshader += \"sinCosThetaPhi +=   0.00833333333   * thetaPhiPow5; \\n\";\n\t\t\t\tshader += \"sinCosThetaPhi +=  -0.000198412698  * thetaPhiPow7; \\n\";\n\t\t\t\tshader += \"sinCosThetaPhi +=   0.0000027557319 * thetaPhiPow9; \\n\";\n\n\t\t\t\tshader += \"vertNormal.x = sinCosThetaPhi.x * sinCosThetaPhi.w; \\n\";\n\t\t\t\tshader += \"vertNormal.y = sinCosThetaPhi.x * sinCosThetaPhi.y; \\n\";\n\t\t\t\tshader += \"vertNormal.z = sinCosThetaPhi.z; \\n\";\n\t\t\t} else {\n\t\t\t\tshader += \"vec3 vertNormal = normal;\\n\";\n\t\t\t\tif (properties.REQUIREBBOXNOR) {\n                    shader += \"vertNormal = vertNormal / bgPrecisionNorMax;\\n\";\n\t\t\t\t}   \n                if (properties.POPGEOMETRY) {\n                    shader += \"vertNormal = 2.0*vertNormal - 1.0;\\n\";                    \n                }                \n\t\t\t}\n\t\t}\n\t\t\n\t\t//Colors\n\t\tif(properties.VERTEXCOLOR) {\n\t\t\tif(properties.COLCOMPONENTS == 3) {\n\t\t\t\tshader += \"vec3 vertColor = color;\";\n\t\t\t} else if(properties.COLCOMPONENTS  == 4) {\n\t\t\t\tshader += \"vec4 vertColor = color;\";\n\t\t\t}\n\t\t\tif(properties.REQUIREBBOXCOL) {\n\t\t\t\tshader += \"vertColor = vertColor / bgPrecisionColMax;\\n\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t//TexCoords\n\t\tif(properties.TEXTURED) {\n\t\t\tshader += \"vec2 vertTexCoord = texcoord;\\n\";\n\t\t\tif(properties.REQUIREBBOXTEX) {\n\t\t\t\tshader += \"vertTexCoord = vertTexCoord / bgPrecisionTexMax;\\n\";\n\t\t\t}\n\t\t}\n\t}\n\t/*******************************************************************************\n\t* End of ImageGeometry switch\n\t********************************************************************************/\n\t\n\t//positions to model-view-space\n\tshader += \"vec3 positionMV = (modelViewMatrix * vec4(vertPosition, 1.0)).xyz;\\n\";\n\t\n\t//normals to model-view-space\n\tif(!properties.POINTLINE2D) {\n\t\tshader += \"vec3 normalMV = normalize( (normalMatrix * vec4(vertNormal, 0.0)).xyz );\\n\";\n\t}\n\t\n\tshader += \"vec3 eye = -positionMV;\\n\";\n\t\n\t//Colors\n\tif (properties.VERTEXCOLOR) {\n\t\tshader += \"vec3 rgb = vertColor.rgb;\\n\";\t\n\t\tif(properties.COLCOMPONENTS == 4) {\n\t\t\tshader += \"float alpha = vertColor.a;\\n\";\n\t\t} else if(properties.COLCOMPONENTS == 3) {\n\t\t\tshader += \"float alpha = 1.0 - transparency;\\n\";\n\t\t}\n\t} else {\n\t\tshader += \"vec3 rgb = diffuseColor;\\n\";\n\t\tshader += \"float alpha = 1.0 - transparency;\\n\";\n\t}\n\t\n\t//Calc TexCoords\n\tif(properties.TEXTURED){\n\t\tif(properties.CUBEMAP) {\n\t\t\tshader += \"fragViewDir = viewMatrix[3].xyz;\\n\";\n\t\t\tshader += \"fragNormal = normalMV;\\n\";\n\t\t} else if(properties.SPHEREMAPPING) {\n\t\t\tshader += \" fragTexcoord = 0.5 + normalMV.xy / 2.0;\\n\";\n\t\t} else if(properties.TEXTRAFO) {\n\t\t\tshader += \" fragTexcoord = (texTrafoMatrix * vec4(vertTexCoord, 1.0, 1.0)).xy;\\n\";\n\t\t} else {\n\t\t\tshader += \" fragTexcoord = vertTexCoord;\\n\";\n\t\t\t\n\t\t\t// LOD LUT HACK ###\n\t\t\tif (properties.POPGEOMETRY && x3dom.debug.usePrecisionLevelAsTexCoord === true)\n\t\t\t    // remap texCoords to texel middle with w = 16 and tc' := 1 / (2 * w) + tc * (w - 1) / w\n                shader += \"fragTexcoord = vec2(0.03125 + 0.9375 * (PG_precisionLevel / 16.0), 1.0);\";\n\t\t\t// LOD LUT HACK ###\n\t\t}\n\t}\n\t\n\t//calc lighting\n\tif(properties.LIGHTS) {\n\t\tshader += \"vec3 ambient   = vec3(0.0, 0.0, 0.0);\\n\";\n\t\tshader += \"vec3 diffuse   = vec3(0.0, 0.0, 0.0);\\n\";\n\t\tshader += \"vec3 specular  = vec3(0.0, 0.0, 0.0);\\n\";\n        shader += \"float _shininess     = shininess;\\n\";\n        shader += \"vec3 _specularColor  = specularColor;\\n\";\n        shader += \"vec3 _emissiveColor  = emissiveColor;\\n\";\n        shader += \"float _ambientIntensity = ambientIntensity;\\n\";\n\t\t\n\t\t//Solid\n\t\tif(!properties.SOLID || properties.TWOSIDEDMAT) {\n\t\t\tshader += \"if (dot(normalMV, eye) < 0.0) {\\n\";\n\t\t\tshader += \"\t normalMV *= -1.0;\\n\";\n            if(properties.SEPARATEBACKMAT) {\n                shader += \"    rgb = backDiffuseColor;\\n\";\n                shader += \"    alpha = 1.0 - backTransparency;\\n\";\n                shader += \"    _shininess = backShininess;\\n\";\n                shader += \"    _emissiveColor = backEmissiveColor;\\n\";\n                shader += \"    _specularColor = backSpecularColor;\\n\";\n                shader += \"    _ambientIntensity = backAmbientIntensity;\\n\";\n            }\n            shader += \"  }\\n\";\n\t\t}\n\t\t\n\t\t//Calculate lighting\n        if (properties.LIGHTS) {\n            shader += \"vec3 ads;\\n\";\n\n            for(var l=0; l<properties.LIGHTS; l++) {\n                var lightCol = \"light\"+l+\"_Color\";\n                shader += \"ads = lighting(light\"+l+\"_Type, \" +\n                          \"light\"+l+\"_Location, \" +\n                          \"light\"+l+\"_Direction, \" +\n                          lightCol + \", \" +\n                          \"light\"+l+\"_Attenuation, \" +\n                          \"light\"+l+\"_Radius, \" +\n                          \"light\"+l+\"_Intensity, \" +\n                          \"light\"+l+\"_AmbientIntensity, \" +\n                          \"light\"+l+\"_BeamWidth, \" +\n                          \"light\"+l+\"_CutOffAngle, \" +\n                          \"normalMV, eye, _shininess, _ambientIntensity);\\n\";\n                shader += \"   ambient  += \" + lightCol + \" * ads.r;\\n\" +\n                          \"   diffuse  += \" + lightCol + \" * ads.g;\\n\" +\n                          \"   specular += \" + lightCol + \" * ads.b;\\n\";\n            }\n\n            shader += \"ambient = max(ambient, 0.0);\\n\";\n            shader += \"diffuse = max(diffuse, 0.0);\\n\";\n            shader += \"specular = max(specular, 0.0);\\n\";\n        }\n\t\t\n\t\t//Textures & blending\n\t\tif(properties.TEXTURED  && !properties.BLENDING) {\n\t\t\tshader += \"fragAmbient = ambient;\\n\";\n\t\t\tshader += \"fragDiffuse = diffuse;\\n\";\n\t\t\tshader += \"fragColor.rgb = (_emissiveColor + specular*_specularColor);\\n\";\n\t\t\tshader += \"fragColor.a = alpha;\\n\";\n\t\t} else {\n\t\t\tshader += \"fragColor.rgb = (_emissiveColor + max(ambient + diffuse, 0.0) * rgb + specular*_specularColor);\\n\";\n\t\t\tshader += \"fragColor.a = alpha;\\n\";\n\t\t}\n\t} else {\n\t\tif (properties.APPMAT && !properties.VERTEXCOLOR) {\n\t\t\tshader += \"rgb = vec3(0.0, 0.0, 0.0);\\n\";\n\t\t}\n\t\tif(properties.TEXTURED && !properties.BLENDING) {\n\t\t\tshader += \"fragAmbient = vec3(0.0);\\n\";\n\t\t\tshader += \"fragDiffuse = vec3(1.0);\\n\";\n\t\t\tshader += \"fragColor.rgb = vec3(0.0);\\n\";\n\t\t\tshader += \"fragColor.a = alpha;\\n\";\n\t\t} else if(!properties.VERTEXCOLOR && properties.POINTLINE2D){\n\t\t\tshader += \"fragColor.rgb = emissiveColor;\\n\";\n\t\t\tshader += \"fragColor.a = alpha;\\n\";\n\t\t} else {\n\t\t\tshader += \"fragColor.rgb = rgb + emissiveColor;\\n\";\n\t\t\tshader += \"fragColor.a = alpha;\\n\";\n\t\t}\n\t}\n\t\n\t//Fog\n\tif(properties.FOG) {\n\t\tshader += \"float f0 = calcFog(-positionMV);\\n\";\n\t\tshader += \"fragColor.rgb = fogColor * (1.0-f0) + f0 * (fragColor.rgb);\\n\";\n\t}\n\n\t//Output\n\tshader += \"gl_Position = modelViewProjectionMatrix * vec4(vertPosition, 1.0);\\n\";\n\t\n\t//End of shader\n\tshader += \"}\\n\";\n\n\tvar vertexShader = gl.createShader(gl.VERTEX_SHADER);\n\tgl.shaderSource(vertexShader, shader);\n    gl.compileShader(vertexShader);\n\t\t\n\tif(!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)){\n\t\tx3dom.debug.logError(\"[DynamicMobileShader] VertexShader \" + gl.getShaderInfoLog(vertexShader));\t\t\n\t}\n\t\n\treturn vertexShader;\n};\n\n/**\n * Generate the fragment shader\n */\nx3dom.shader.DynamicMobileShader.prototype.generateFragmentShader = function(gl, properties)\n{\n\tvar shader = \"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n\";\n  shader += \"precision highp float;\\n\";\n  shader += \"#else\\n\";\n  shader += \" precision mediump float;\\n\";\n  shader += \"#endif\\n\\n\";\n\t\n\t/*******************************************************************************\n\t* Generate dynamic uniforms & varyings\n\t********************************************************************************/\n\t//Colors\n\tshader += \"varying vec4 fragColor;\\n\";\n\t\n\t//Textures\n\tif(properties.TEXTURED) {\n\t\tif(properties.CUBEMAP) {\n\t\t\tshader += \"uniform samplerCube cubeMap;\\n\";\n\t\t\tshader += \"varying vec3 fragViewDir;\\n\";\n\t\t\tshader += \"varying vec3 fragNormal;\\n\";\n\t\t\tshader += \"uniform mat4 modelViewMatrixInverse;\\n\";\n\t\t} else {\n\t\t\tshader += \"uniform sampler2D diffuseMap;           \\n\";\n\t\t\tshader += \"varying vec2 fragTexcoord;       \\n\";\n\t\t}\n\t\tif(!properties.BLENDING) {\n\t\t\tshader += \"varying vec3 fragAmbient;\\n\";\n\t\t\tshader += \"varying vec3 fragDiffuse;\\n\";\n\t\t}\n\t}\n\t\n\t/*******************************************************************************\n\t* Generate main function\n\t********************************************************************************/\n\tshader += \"void main(void) {\\n\";\n\t\n\t//Colors\n\tshader += \"vec4 color = fragColor;\\n\";\n\t\n\t//Textures\n\tif(properties.TEXTURED){\n\t\tif(properties.CUBEMAP) {\n\t\t\tshader += \"vec3 normal = normalize(fragNormal);\\n\";\n\t\t\tshader += \"vec3 viewDir = normalize(fragViewDir);\\n\";\n\t\t\tshader += \"vec3 reflected = reflect(viewDir, normal);\\n\";\n\t\t\tshader += \"reflected = (modelViewMatrixInverse * vec4(reflected,0.0)).xyz;\\n\";\n\t\t\tshader += \"vec4 texColor = textureCube(cubeMap, reflected);\\n\";\n\t\t} else {\n\t\t\tshader += \"vec4 texColor = texture2D(diffuseMap, vec2(fragTexcoord.s, 1.0-fragTexcoord.t));\\n\";\n\t\t}\n\t\tif(properties.BLENDING) {\n\t\t\tif(properties.CUBEMAP) {\n\t\t\t\tshader += \"color.rgb = mix(color.rgb, texColor.rgb, vec3(0.75));\\n\";\n\t\t\t\tshader += \"color.a = texColor.a;\\n\";\n\t\t\t} else {\n\t\t\t\tshader += \"color.rgb *= texColor.rgb;\\n\";\n\t\t\t\tshader += \"color.a *= texColor.a;\\n\";\n\t\t\t}\n\t\t} else {\n\t\t\tshader += \"color.rgb += max(fragAmbient + fragDiffuse, 0.0) * texColor.rgb;\\n\";\n\t\t\tshader += \"color.a *= texColor.a;\\n\";\n\t\t}\n\t} \n\t\n\t//Kill pixel\n\tif(properties.TEXT) {\n\t\tshader += \"if (color.a <= 0.5) discard;\\n\";\n\t} else {\n\t\tshader += \"if (color.a <= 0.1) discard;\\n\";\n\t}\n\t\n\t//Output\n\tshader += \"gl_FragColor = clamp(color, 0.0, 1.0);\\n\";\n\t\n\t//End of shader\n\tshader += \"}\\n\";\n\n    var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n\tgl.shaderSource(fragmentShader, shader);\n    gl.compileShader(fragmentShader);\n\t\t\n\tif(!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)){\n\t\tx3dom.debug.logError(\"[DynamicMobileShader] FragmentShader \" + gl.getShaderInfoLog(fragmentShader));\t\t\n\t}\n\t\n\treturn fragmentShader;\n};\n\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * Philip Taylor: http://philip.html5.org\n */\n\n/**\n * Generate the final Shader program\n */\nx3dom.shader.DynamicShaderPicking = function(gl, properties, pickMode)\n{\n\tthis.program = gl.createProgram();\n\t\n\tvar vertexShader \t= this.generateVertexShader(gl, properties, pickMode);\n\tvar fragmentShader \t= this.generateFragmentShader(gl, properties, pickMode);\n\t\n\tgl.attachShader(this.program, vertexShader);\n    gl.attachShader(this.program, fragmentShader);\n    \n    // optional, but position should be at location 0 for performance reasons\n    gl.bindAttribLocation(this.program, 0, \"position\");\n    \n\tgl.linkProgram(this.program);\n\t\n\treturn this.program;\n};\n\n/**\n * Generate the vertex shader\n */\nx3dom.shader.DynamicShaderPicking.prototype.generateVertexShader = function(gl, properties, pickMode)\n{\n\tvar shader = \"\";\n\t\n\t/*******************************************************************************\n\t* Generate dynamic attributes & uniforms & varyings\n\t********************************************************************************/\n\n\t//Default Matrices\n    shader += \"uniform mat4 modelMatrix;\\n\";\n    shader += \"uniform mat4 modelViewProjectionMatrix;\\n\";\n\n    shader += \"uniform mat4 modelMatrix2;\\n\";\n    shader += \"uniform mat4 modelViewProjectionMatrix2;\\n\";\n\n    shader += \"uniform float isVR;\\n\";\n\tshader += \"attribute float eyeIdx;\\n\";\n\tshader += \"varying float vrOffset;\\n\";\n\tshader += \"varying float fragEyeIdx;\\n\";\n\n    shader += \"attribute vec3 position;\\n\";\n    shader += \"uniform vec3 from;\\n\";\n    shader += \"varying vec3 worldCoord;\\n\";\n\n    if(pickMode == 1) { // Color Picking\n        shader += \"attribute vec3 color;\\n\";\n        shader += \"varying vec3 fragColor;\\n\";\n    } else if(pickMode == 2){ //TexCoord Picking\n        shader += \"attribute vec2 texcoord;\\n\";\n        shader += \"varying vec3 fragColor;\\n\";\n    }\n\n    //Bounding stuff\n    if(properties.REQUIREBBOX) {\n        shader += \"uniform vec3 bgCenter;\\n\";\n        shader += \"uniform vec3 bgSize;\\n\";\n        shader += \"uniform float bgPrecisionMax;\\n\";\n    }\n    if(properties.REQUIREBBOXCOL) {\n        shader += \"uniform float bgPrecisionColMax;\\n\";\n    }\n    if(properties.REQUIREBBOXTEX) {\n        shader += \"uniform float bgPrecisionTexMax;\\n\";\n    }\n\n    //ShadowID stuff\n    if(properties.VERTEXID) {\n        shader += \"uniform float shadowIDs;\\n\";\n\n        if (pickMode == 3) { //24bit\n            shader += \"varying vec3 idCoord;\\n\";\n        } else {\n            shader += \"varying vec2 idCoord;\\n\";\n        }\n        shader += \"varying float fragID;\\n\";\n        shader += \"attribute float id;\\n\";\n    }\n\t\n    //ImageGeometry stuff\n\tif(properties.IMAGEGEOMETRY) {\n\t\tshader += \"uniform vec3 IG_bboxMin;\\n\";\n\t\tshader += \"uniform vec3 IG_bboxMax;\\n\";\n\t\tshader += \"uniform float IG_coordTextureWidth;\\n\";\n\t\tshader += \"uniform float IG_coordTextureHeight;\\n\";\n\t\tshader += \"uniform vec2 IG_implicitMeshSize;\\n\";\n\t\t\n\t\tfor( var i = 0; i < properties.IG_PRECISION; i++ ) {\n\t\t\tshader += \"uniform sampler2D IG_coords\" + i + \"\\n;\";\n\t\t}\n\t\t\n\t\tif(properties.IG_INDEXED) {\n\t\t\tshader += \"uniform sampler2D IG_index;\\n\";\n\t\t\tshader += \"uniform float IG_indexTextureWidth;\\n\";\n\t\t\tshader += \"uniform float IG_indexTextureHeight;\\n\";\n\t\t}\n\t}\n    \n    //PopGeometry\n    if (properties.POPGEOMETRY) {\n        shader += \"uniform float PG_precisionLevel;\\n\";\n        shader += \"uniform float PG_powPrecision;\\n\";\n        shader += \"uniform vec3 PG_maxBBSize;\\n\";\n        shader += \"uniform vec3 PG_bbMin;\\n\";\n        shader += \"uniform vec3 PG_bbMaxModF;\\n\";\n        shader += \"uniform vec3 PG_bboxShiftVec;\\n\";\n        shader += \"uniform float PG_numAnchorVertices;\\n\";\n        shader += \"attribute float PG_vertexID;\\n\";\n    }\n\n    //ClipPlane stuff\n    if(properties.CLIPPLANES) {\n        shader += \"uniform mat4 modelViewMatrix;\\n\";\n        shader += \"uniform mat4 modelViewMatrix2;\\n\";\n        shader += \"varying vec4 fragPosition;\\n\";\n    }\n\n      \n\t/*******************************************************************************\n\t* Generate main function\n\t********************************************************************************/\n\n\tshader += \"void main(void) {\\n\";\n\n    shader += \"fragEyeIdx = eyeIdx;\\n\";\n\n    shader += \"gl_PointSize = 2.0;\\n\";\n    shader += \"vec3 pos = position;\\n\";\n\n\n    if(properties.VERTEXID) {\n       if(pickMode == 0) { //Default Picking\n           shader += \"idCoord = vec2((id + shadowIDs) / 256.0);\\n\";\n           shader += \"idCoord.x = floor(idCoord.x) / 255.0;\\n\";\n           shader += \"idCoord.y = fract(idCoord.y) * 1.00392156862745;\\n\";\n           shader += \"fragID = id;\\n\";\n       } else if(pickMode == 3) { //Picking with 24bit precision\n           //composed id is at least 32 (= 2*16) bit + num bits for max-orig-shape-id\n           shader += \"float ID = id + shadowIDs;\\n\";\n           //however, let's ignore this and assume a maximum of 24 bits for all id's\n           shader += \"float h = floor(ID / 256.0);\\n\";\n           shader += \"idCoord.x = ID - (h * 256.0);\\n\";\n           shader += \"idCoord.z = floor(h / 256.0);\\n\";\n           shader += \"idCoord.y = h - (idCoord.z * 256.0);\\n\";\n           shader += \"idCoord = idCoord.zyx / 255.0;\\n\";\n           shader += \"fragID = id;\\n\";\n       } else if(pickMode == 4) { //Picking with 32bit precision\n           shader += \"idCoord = vec2((id + shadowIDs) / 256.0);\\n\";\n           shader += \"idCoord.x = floor(idCoord.x) / 255.0;\\n\";\n           shader += \"idCoord.y = fract(idCoord.y) * 1.00392156862745;\\n\";\n           shader += \"fragID = id;\\n\";\n       }\n    }\n\n    /*******************************************************************************\n     * Start of special Geometry switch\n     ********************************************************************************/\n    if(properties.IMAGEGEOMETRY) { //ImageGeometry\n        if(properties.IG_INDEXED) {\n            shader += \"vec2 halfPixel = vec2(0.5/IG_indexTextureWidth,0.5/IG_indexTextureHeight);\\n\";\n            shader += \"vec2 IG_texCoord = vec2(position.x*(IG_implicitMeshSize.x/IG_indexTextureWidth), position.y*(IG_implicitMeshSize.y/IG_indexTextureHeight)) + halfPixel;\\n\";\n            shader += \"vec2 IG_indices = texture2D( IG_index, IG_texCoord ).rg;\\n\";\n            shader += \"halfPixel = vec2(0.5/IG_coordTextureWidth,0.5/IG_coordTextureHeight);\\n\";\n            shader += \"IG_texCoord = (IG_indices * 0.996108948) + halfPixel;\\n\";\n        } else {\n            shader += \"vec2 halfPixel = vec2(0.5/IG_coordTextureWidth, 0.5/IG_coordTextureHeight);\\n\";\n            shader += \"vec2 IG_texCoord = vec2(position.x*(IG_implicitMeshSize.x/IG_coordTextureWidth), position.y*(IG_implicitMeshSize.y/IG_coordTextureHeight)) + halfPixel;\\n\";\n        }\n\n        shader += \"pos = texture2D( IG_coordinateTexture, IG_texCoord ).rgb;\\n\";\n        shader += \"pos = pos * (IG_bboxMax - IG_bboxMin) + IG_bboxMin;\\n\";\n    } else if (properties.POPGEOMETRY) { //PopGeometry\n        shader += \"vec3 offsetVec = step(pos / bgPrecisionMax, PG_bbMaxModF) * PG_bboxShiftVec;\\n\";\n            shader += \"if (PG_precisionLevel <= 2.0) {\\n\";\n            shader += \"pos = floor(pos / PG_powPrecision) * PG_powPrecision;\\n\";\n            shader += \"pos /= (65536.0 - PG_powPrecision);\\n\";\n            shader += \"}\\n\";\n            shader += \"else {\\n\";\n            shader += \"pos /= bgPrecisionMax;\\n\";\n            shader += \"}\\n\";\n            shader += \"pos = (pos + offsetVec + PG_bbMin) * PG_maxBBSize;\\n\";\n    } else {\n\n        if(properties.REQUIREBBOX) {\n            shader += \"pos = bgCenter + bgSize * pos / bgPrecisionMax;\\n\";\n        }\n\n        if(pickMode == 1 && !properties.REQUIREBBOXCOL) { //Color Picking\n            shader += \"fragColor = color;\\n\";\n        } else if(pickMode == 1 && properties.REQUIREBBOXCOL) { //Color Picking\n            shader += \"fragColor = color / bgPrecisionColMax;\\n\";\n        } else  if(pickMode == 2 && !properties.REQUIREBBOXTEX) { //TexCoord Picking\n            shader += \"fragColor = vec3(abs(texcoord.x), abs(texcoord.y), 0.0);\\n\";\n        } else if(pickMode == 2 && properties.REQUIREBBOXTEX) { //TexCoord Picking\n            shader += \"vec2 texCoord = texcoord / bgPrecisionTexMax;\\n\";\n            shader += \"fragColor = vec3(abs(texCoord.x), abs(texCoord.y), 0.0);\\n\";\n        }\n    }\n\n    if(properties.CLIPPLANES) {\n        shader += \"if(eyeIdx == 1.0){\\n\"\n        shader += \"    fragPosition = (modelViewMatrix2 * vec4(pos, 1.0));\\n\";\n        shader += \"}else{\\n\";\n        shader += \"    fragPosition = (modelViewMatrix * vec4(pos, 1.0));\\n\";\n        shader += \"}\\n\";\n    }\n\n    shader += \"worldCoord = (modelMatrix * vec4(pos, 1.0)).xyz - from;\\n\";\n\n    shader += \"if(eyeIdx == 1.0){\\n\"\n    shader += \"    gl_Position = modelViewProjectionMatrix2 * vec4(pos, 1.0);\\n\";\n    shader += \"}else{\\n\";\n    shader += \"    gl_Position = modelViewProjectionMatrix * vec4(pos, 1.0);\\n\";\n    shader += \"}\\n\";\n\n    shader += \"if(isVR == 1.0){\\n\";\n\tshader += \"    vrOffset = eyeIdx * 0.5;\\n\";\n\tshader += \"    gl_Position.x *= 0.5;\\n\";\n\tshader += \"    gl_Position.x += vrOffset * gl_Position.w;\\n\";\n\tshader += \"}\\n\";\n\n\t//END OF SHADER\n\tshader += \"}\\n\";\n\t\n\tvar vertexShader = gl.createShader(gl.VERTEX_SHADER);\n\tgl.shaderSource(vertexShader, shader);\n    gl.compileShader(vertexShader);\n\t\t\n\tif(!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)){\n        x3dom.debug.logInfo(\"VERTEX:\\n\" + shader);\n\t\tx3dom.debug.logError(\"VertexShader \" + gl.getShaderInfoLog(vertexShader));\t\t\n\t}\n\t\n\treturn vertexShader;\n};\n\n/**\n * Generate the fragment shader\n */\nx3dom.shader.DynamicShaderPicking.prototype.generateFragmentShader = function(gl, properties, pickMode)\n{\n  var shader = \"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n\";\n  shader += \" precision highp float;\\n\";\n  shader += \"#else\\n\";\n  shader += \" precision mediump float;\\n\";\n  shader += \"#endif\\n\\n\";\n\t\n\t/*******************************************************************************\n\t* Generate dynamic uniforms & varyings\n\t********************************************************************************/\n\n    shader += \"uniform float highBit;\\n\";\n    shader += \"uniform float lowBit;\\n\";\n    shader += \"uniform float sceneSize;\\n\";\n    shader += \"varying vec3 worldCoord;\\n\";\n\n    shader += \"uniform float isVR;\\n\";\n\tshader += \"varying float vrOffset;\\n\";\n\tshader += \"varying float fragEyeIdx;\\n\";\n\tshader += \"uniform float screenWidth;\\n\";\n\n    if(pickMode == 1 || pickMode == 2) {\n        shader += \"varying vec3 fragColor;\\n\";\n    }\n\n    //ShadowID stuff\n    if(properties.VERTEXID) {\n        if (pickMode == 3) { //24bit\n            shader += \"varying vec3 idCoord;\\n\";\n        } else {\n            shader += \"varying vec2 idCoord;\\n\";\n        }\n        shader += \"varying float fragID;\\n\";\n    }\n\n    //ClipPlane stuff\n    if(properties.CLIPPLANES) {\n        shader += \"uniform mat4 viewMatrixInverse;\\n\";\n        shader += \"uniform mat4 viewMatrixInverse2;\\n\";\n        shader += \"varying vec4 fragPosition;\\n\";\n    }\n\n    if (properties.MULTIVISMAP) {\n        shader += \"uniform sampler2D multiVisibilityMap;\\n\";\n        shader += \"uniform float multiVisibilityWidth;\\n\";\n        shader += \"uniform float multiVisibilityHeight;\\n\";\n    }\n\n    if(properties.CLIPPLANES) {\n        shader += x3dom.shader.clipPlanes(properties.CLIPPLANES);\n    }\n\n\t/*******************************************************************************\n\t* Generate main function\n\t********************************************************************************/\n\tshader += \"void main(void) {\\n\";\n\n    shader += \"if ( isVR == 1.0) {\\n\";\n\tshader += \"    if ( ( step( 0.5, gl_FragCoord.x / screenWidth ) - 0.5 ) * vrOffset < 0.0 ) discard;\\n\";\n\tshader += \"}\\n\";\n\n\n    if(properties.CLIPPLANES)\n    {\n        shader += \"calculateClipPlanes();\\n\";\n    }\n\n    if(pickMode == 1 || pickMode == 2) { //Picking Color || Picking TexCoord\n        shader += \"vec4 color = vec4(fragColor, lowBit);\\n\";\n    } else if(pickMode == 4) { //Picking with 32bit precision\n        shader += \"vec4 color = vec4(highBit, lowBit, 0.0, 0.0);\\n\";\n    } else {\n        shader += \"vec4 color = vec4(0.0, 0.0, highBit, lowBit);\\n\";\n    }\n\n    if(properties.VERTEXID) {\n        if(pickMode == 0 || pickMode == 4) { //Default Picking || Picking with 32bit precision\n            shader += \"color.ba = idCoord;\\n\";\n        } else if(pickMode == 3) { //Picking with 24bit precision\n            shader += \"color.gba = idCoord;\\n\";\n        }\n\n        if (properties.MULTIVISMAP) {\n            shader += \"vec2 idTexCoord;\\n\";\n            shader += \"float roundedID = floor(fragID+0.5);\\n\";\n            shader += \"idTexCoord.x = (mod(roundedID, multiVisibilityWidth)) * (1.0 / multiVisibilityWidth) + (0.5 / multiVisibilityWidth);\\n\";\n            shader += \"idTexCoord.y = (floor(roundedID / multiVisibilityHeight)) * (1.0 / multiVisibilityHeight) + (0.5 / multiVisibilityHeight);\\n\";\n            shader += \"vec4 visibility = texture2D( multiVisibilityMap, idTexCoord );\\n\";\n            shader += \"if (visibility.r < 1.0) discard; \\n\";\n        }\n    }\n\n    if(pickMode != 1 && pickMode != 2) {\n        shader += \"float d = length(worldCoord) / sceneSize;\\n\";\n    }\n\n    if(pickMode == 0) { //Default Picking\n        shader += \"vec2 comp = fract(d * vec2(256.0, 1.0));\\n\";\n        shader += \"color.rg = comp - (comp.rr * vec2(0.0, 1.0/256.0));\\n\";\n    } else if(pickMode == 3) { //Picking with 24bit precision\n        shader += \"color.r = d;\\n\";\n    }\n\n    shader += \"gl_FragColor = color;\\n\";\n\n    //END OF SHADER\n    shader += \"}\\n\";\n\n    var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n\tgl.shaderSource(fragmentShader, shader);\n    gl.compileShader(fragmentShader);\n\t\t\n\tif(!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)){\n        x3dom.debug.logInfo(\"FRAGMENT:\\n\" + shader);\n\t\tx3dom.debug.logError(\"FragmentShader \" + gl.getShaderInfoLog(fragmentShader));\n\t}\n\n\treturn fragmentShader;\n};\n\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * Philip Taylor: http://philip.html5.org\n */\n\n/**\n * Generate the final ShadowShader program\n */\nx3dom.shader.DynamicShadowShader = function(gl, properties)\n{\n\tthis.program = gl.createProgram();\n\t\n\tvar vertexShader \t= this.generateVertexShader(gl, properties);\n\tvar fragmentShader \t= this.generateFragmentShader(gl, properties);\n\t\n\tgl.attachShader(this.program, vertexShader);\n    gl.attachShader(this.program, fragmentShader);\n    \n    // optional, but position should be at location 0 for performance reasons\n    gl.bindAttribLocation(this.program, 0, \"position\");\n    \n\tgl.linkProgram(this.program);\n\t\n\treturn this.program;\n};\n\n/**\n * Generate the vertex shader\n */\nx3dom.shader.DynamicShadowShader.prototype.generateVertexShader = function(gl, properties)\n{\n\tvar shader = \"\";\n\n\t//Shadow stuff\n\tshader += \"attribute vec3 position;\\n\";\n\tshader += \"uniform mat4 modelViewProjectionMatrix;\\n\";\n\tshader += \"varying vec4 projCoords;\\n\";\n\n\t//ShadowID stuff\n\tif(properties.VERTEXID) {\n\t\tshader += \"varying float fragID;\\n\";\n\t\tshader += \"attribute float id;\\n\";\n\t}\n\n\t//Bounding stuff\n\tif(properties.REQUIREBBOX) {\n\t\tshader += \"uniform vec3 bgCenter;\\n\";\n\t\tshader += \"uniform vec3 bgSize;\\n\";\n\t\tshader += \"uniform float bgPrecisionMax;\\n\";\n\t}\n\n\t//ImageGeometry stuff\n\tif(properties.IMAGEGEOMETRY) {\n\t\tshader += \"uniform vec3 IG_bboxMin;\\n\";\n\t\tshader += \"uniform vec3 IG_bboxMax;\\n\";\n\t\tshader += \"uniform float IG_coordTextureWidth;\\n\";\n\t\tshader += \"uniform float IG_coordTextureHeight;\\n\";\n\t\tshader += \"uniform vec2 IG_implicitMeshSize;\\n\";\n\n\t\tfor( var i = 0; i < properties.IG_PRECISION; i++ ) {\n\t\t\tshader += \"uniform sampler2D IG_coords\" + i + \"\\n;\";\n\t\t}\n\n\t\tif(properties.IG_INDEXED) {\n\t\t\tshader += \"uniform sampler2D IG_index;\\n\";\n\t\t\tshader += \"uniform float IG_indexTextureWidth;\\n\";\n\t\t\tshader += \"uniform float IG_indexTextureHeight;\\n\";\n\t\t}\n\t}\n\n\t//PopGeometry stuff\n\tif (properties.POPGEOMETRY) {\n\t\tshader += \"uniform float PG_precisionLevel;\\n\";\n\t\tshader += \"uniform float PG_powPrecision;\\n\";\n\t\tshader += \"uniform vec3 PG_maxBBSize;\\n\";\n\t\tshader += \"uniform vec3 PG_bbMin;\\n\";\n\t\tshader += \"uniform vec3 PG_bbMaxModF;\\n\";\n\t\tshader += \"uniform vec3 PG_bboxShiftVec;\\n\";\n\t\tshader += \"uniform float PG_numAnchorVertices;\\n\";\n\t\tshader += \"attribute float PG_vertexID;\\n\";\n\t}\n\n\t//ClipPlane stuff\n\tif(properties.CLIPPLANES) {\n\t\tshader += \"uniform mat4 modelViewMatrix;\\n\";\n\t\tshader += \"varying vec4 fragPosition;\\n\";\n\t}\n\n\t/*******************************************************************************\n\t * Generate main function\n\t ********************************************************************************/\n\tshader += \"void main(void) {\\n\";\n\tshader += \"    vec3 pos = position;\\n\";\n\n\t/*******************************************************************************\n\t * Start of special Geometry switch\n\t ********************************************************************************/\n\tif(properties.IMAGEGEOMETRY) { //ImageGeometry\n\t\tif(properties.IG_INDEXED) {\n\t\t\tshader += \"    vec2 halfPixel = vec2(0.5/IG_indexTextureWidth,0.5/IG_indexTextureHeight);\\n\";\n\t\t\tshader += \"    vec2 IG_texCoord = vec2(position.x*(IG_implicitMeshSize.x/IG_indexTextureWidth), position.y*(IG_implicitMeshSize.y/IG_indexTextureHeight)) + halfPixel;\\n\";\n\t\t\tshader += \"    vec2 IG_indices = texture2D( IG_index, IG_texCoord ).rg;\\n\";\n\t\t\tshader += \"    halfPixel = vec2(0.5/IG_coordTextureWidth,0.5/IG_coordTextureHeight);\\n\";\n\t\t\tshader += \"    IG_texCoord = (IG_indices * 0.996108948) + halfPixel;\\n\";\n\t\t} else {\n\t\t\tshader += \"    vec2 halfPixel = vec2(0.5/IG_coordTextureWidth, 0.5/IG_coordTextureHeight);\\n\";\n\t\t\tshader += \"    vec2 IG_texCoord = vec2(position.x*(IG_implicitMeshSize.x/IG_coordTextureWidth), position.y*(IG_implicitMeshSize.y/IG_coordTextureHeight)) + halfPixel;\\n\";\n\t\t}\n\n\t\tshader += \"    pos = texture2D( IG_coordinateTexture, IG_texCoord ).rgb;\\n\";\n\t\tshader += \"    pos = pos * (IG_bboxMax - IG_bboxMin) + IG_bboxMin;\\n\";\n\t} else if (properties.POPGEOMETRY) { //PopGeometry\n\t\tshader += \"    vec3 offsetVec = step(pos / bgPrecisionMax, PG_bbMaxModF) * PG_bboxShiftVec;\\n\";\n\t\tshader += \"    if (PG_precisionLevel <= 2.0) {\\n\";\n\t\tshader += \"        pos = floor(pos / PG_powPrecision) * PG_powPrecision;\\n\";\n\t\tshader += \"        pos /= (65536.0 - PG_powPrecision);\\n\";\n\t\tshader += \"    }\\n\";\n\t\tshader += \"    else {\\n\";\n\t\tshader += \"        pos /= bgPrecisionMax;\\n\";\n\t\tshader += \"    }\\n\";\n\t\tshader += \"    pos = (pos + offsetVec + PG_bbMin) * PG_maxBBSize;\\n\";\n\t} else {\n\t\tif(properties.REQUIREBBOX) {\n\t\t\tshader += \"    pos = bgCenter + bgSize * pos / bgPrecisionMax;\\n\";\n\t\t}\n\t}\n\n\tif(properties.VERTEXID) {\n\t\tshader += \"    fragID = id;\\n\";\n\t}\n\n\tif(properties.CLIPPLANES) {\n\t\tshader += \"    fragPosition = (modelViewMatrix * vec4(pos, 1.0));\\n\";\n\t}\n\n\tshader += \"    projCoords = modelViewProjectionMatrix * vec4(pos, 1.0);\\n\";\n\tshader += \"    gl_Position = projCoords;\\n\";\n\n\tshader += \"}\\n\";\n\n\tvar vertexShader = gl.createShader(gl.VERTEX_SHADER);\n\tgl.shaderSource(vertexShader, shader);\n    gl.compileShader(vertexShader);\n\t\t\n\tif(!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)){\n\t\tx3dom.debug.logError(\"[ShadowShader] VertexShader \" + gl.getShaderInfoLog(vertexShader));\t\t\n\t}\n\t\n\treturn vertexShader;\n};\n\n/**\n * Generate the fragment shader\n */\nx3dom.shader.DynamicShadowShader.prototype.generateFragmentShader = function(gl, properties)\n{\n\tvar shader = \"\";\n\n\tshader += \"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n\";\n    shader += \"    precision highp float;\\n\";\n    shader += \"#else\\n\";\n    shader += \"    precision mediump float;\\n\";\n    shader += \"#endif\\n\\n\";\n\n\t//Shadow stuff\n\tshader += \"varying vec4 projCoords;\\n\";\n\tshader += \"uniform float offset;\\n\";\n\tshader += \"uniform bool cameraView;\\n\";\n\n\t//ShadowID stuff\n\tif(properties.VERTEXID) {\n\t\tshader += \"varying float fragID;\\n\";\n\t}\n\n\tif (properties.MULTIVISMAP) {\n\t\tshader += \"uniform sampler2D multiVisibilityMap;\\n\";\n\t\tshader += \"uniform float multiVisibilityWidth;\\n\";\n\t\tshader += \"uniform float multiVisibilityHeight;\\n\";\n\t}\n\n\t//ClipPlane stuff\n\tif(properties.CLIPPLANES) {\n\t\tshader += \"uniform mat4 viewMatrixInverse;\\n\";\n\t\tshader += \"varying vec4 fragPosition;\\n\";\n\t\tshader += x3dom.shader.clipPlanes(properties.CLIPPLANES);\n\t}\n\n\t//Import RGBA Packing stuff if FloatingPoint textures are not supported\n\tif(!x3dom.caps.FP_TEXTURES) {\n\t\tshader += x3dom.shader.rgbaPacking();\n\t}\n\n\t/*******************************************************************************\n\t * Generate main function\n\t ********************************************************************************/\n\n\tshader += \"void main(void) {\\n\";\n\n\tif(properties.CLIPPLANES)\n\t{\n\t\tshader += \"calculateClipPlanes();\\n\";\n\t}\n\n\tif (properties.MULTIVISMAP) {\n\t\tshader += \"    vec2 idTexCoord;\\n\";\n\t\tshader += \"    float roundedID = floor(fragID+0.5);\\n\";\n\t\tshader += \"    idTexCoord.x = (mod(roundedID, multiVisibilityWidth)) * (1.0 / multiVisibilityWidth) + (0.5 / multiVisibilityWidth);\\n\";\n\t\tshader += \"    idTexCoord.y = (floor(roundedID / multiVisibilityHeight)) * (1.0 / multiVisibilityHeight) + (0.5 / multiVisibilityHeight);\\n\";\n\t\tshader += \"    vec4 visibility = texture2D( multiVisibilityMap, idTexCoord );\\n\";\n\t\tshader += \"    if (visibility.r < 1.0) discard; \\n\";\n\t}\n\n\tshader += \"    vec3 proj = (projCoords.xyz / projCoords.w);\\n\";\n\n \tif(!x3dom.caps.FP_TEXTURES) {\n\t\tshader += \"    gl_FragColor = packDepth(proj.z);\\n\";\n\t} else {\n\t\t//use variance shadow maps, when not rendering from camera view\n\t\t//shader +=\t\"if (!cameraView) proj.z = exp((1.0-offset)*80.0*proj.z);\\n\";\n\t\tshader += \"\t   if (!cameraView){\\n\";\n\t\tshader += \"\t\t   proj.z = (proj.z + 1.0)*0.5;\\n\";\n\t\tshader += \"\t\t   proj.y = proj.z * proj.z;\\n\";\n\t\tshader += \"\t   }\\n\";\n\t\tshader += \"    gl_FragColor = vec4(proj, 1.0);\\n\";\n\t}\n\n\tshader += \"}\\n\";\n\n    var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n\tgl.shaderSource(fragmentShader, shader);\n    gl.compileShader(fragmentShader);\n\t\t\n\tif(!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)){\n\t\tx3dom.debug.logError(\"[ShadowShader] FragmentShader \" + gl.getShaderInfoLog(fragmentShader));\t\t\n\t}\n\t\n\treturn fragmentShader;\n};\n\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * Philip Taylor: http://philip.html5.org\n */\n\n/**\n * Generate the final Shader program\n */\nx3dom.shader.ComposedShader = function(gl, shape)\n{\n\tthis.program = gl.createProgram();\n\t\n\tvar vertexShader \t= this.generateVertexShader(gl, shape);\n\tvar fragmentShader \t= this.generateFragmentShader(gl, shape);\n\t\n\tgl.attachShader(this.program, vertexShader);\n    gl.attachShader(this.program, fragmentShader);\n    \n    // optional, but position should be at location 0 for performance reasons\n    gl.bindAttribLocation(this.program, 0, \"position\");\n    \n\tgl.linkProgram(this.program);\n\t\n\treturn this.program;\n};\n\n/**\n * Generate the vertex shader\n */\nx3dom.shader.ComposedShader.prototype.generateVertexShader = function(gl, shape)\n{\n\tvar shader = shape._cf.appearance.node._shader._vertex._vf.url[0];\n\n\tshader = this.injectVRPartsVS(shader);\t\n\n\tvar vertexShader = gl.createShader(gl.VERTEX_SHADER);\n\tgl.shaderSource(vertexShader, shader);\n    gl.compileShader(vertexShader);\n\t\t\n\tif(!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)){\n\t\tx3dom.debug.logError(\"[ComposedShader] VertexShader \" + gl.getShaderInfoLog(vertexShader));\t\t\n\t}\n\t\n\treturn vertexShader;\n};\n\n/**\n * Generate the fragment shader\n */\nx3dom.shader.ComposedShader.prototype.generateFragmentShader = function(gl, shape)\n{\n\tvar shader = shape._cf.appearance.node._shader._fragment._vf.url[0];\n\n\tshader = this.injectVRPartsFS(shader);\t\n\n    var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n\tgl.shaderSource(fragmentShader, shader);\n    gl.compileShader(fragmentShader);\n\t\t\n\tif(!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)){\n\t\tx3dom.debug.logError(\"[ComposedShader] FragmentShader \" + gl.getShaderInfoLog(fragmentShader));\t\t\n\t}\n\t\n\treturn fragmentShader;\n};\n\nx3dom.shader.ComposedShader.prototype.injectVRPartsVS = function(shader)\n{\n\tvar vrPart01 = \"attribute float eyeIdx;\\n\" +\n\t\t\t\t   \"uniform   float isVR;\\n\"+\n\t\t\t\t   \"uniform   mat4  modelViewProjectionMatrix2;\\n\" +\n\t\t\t\t   \"uniform   mat4  modelViewProjectionInverseMatrix;\\n\" +\n\t\t\t\t   \"varying   float vrOffset;\\n\"+\n\t\t\t\t   \"varying   float fragEyeIdx;\\n\";\n\t\t\t\t   \n\tvar vrPart02 = \"fragEyeIdx = eyeIdx;\\n\" +\n\n\t\t\t\t   \"if(isVR == 1.0)\\n\" +\n\t\t\t\t   \"{\\n\" +\n\t\t\t\t   \"    vec4 webVRPos = modelViewProjectionInverseMatrix * gl_Position;\\n\" +\n\t\t\t\t   \"    webVRPos.xyz = webVRPos.xyz / webVRPos.w;\\n\" +\n\t\t\t\t   \"    if(fragEyeIdx == 1.0) {\\n\" +\n\t\t\t\t   \"        gl_Position = modelViewProjectionMatrix2 * webVRPos;\\n\" +\n\t\t\t\t   \"    } else {\\n\" +\n\t\t\t\t   \"        gl_Position = modelViewProjectionMatrix  * webVRPos;\\n\" +\n                   \"    }\\n\" +\n\t\t\t\t   \"    vrOffset = fragEyeIdx * 0.5;\\n\" +\n\t\t\t\t   \"    gl_Position.x *= 0.5;\\n\" +\n\t\t\t\t   \"    gl_Position.x += vrOffset * gl_Position.w;\\n\" +\n\t\t\t\t   \"}\";\n\n    var sections = this.extractShaderSections(shader);\n\n\treturn sections.before + \n\t\t   vrPart01 + \n\t\t   sections.mainStart + \n\t\t   sections.main + \n\t\t   vrPart02 + \n\t\t   sections.mainEnd;\n};\n\nx3dom.shader.ComposedShader.prototype.injectVRPartsFS = function(shader)\n{\n\tvar vrPart01 = \"uniform   float isVR;\\n\"+\n\t\t\t\t   \"uniform   float screenWidth;\\n\" +\n\t               \"varying   float vrOffset;\\n\"+\n\t\t\t\t   \"varying   float fragEyeIdx;\\n\";\n\t\t\t\t   \n\tvar vrPart02 = \"if ( isVR == 1.0) {\\n\" +\n\t\t           \"    if ( ( step( 0.5, gl_FragCoord.x / screenWidth ) - 0.5 ) * vrOffset < 0.0 ) discard;\\n\" +\n\t\t\t\t   \"}\\n\";\n\n    var sections = this.extractShaderSections(shader);\n\n\treturn sections.before + \n\t\t   vrPart01 + \n\t\t   sections.mainStart + \n\t\t   vrPart02 + \n\t\t   sections.main + \n\t\t   sections.mainEnd;\n};\n\nx3dom.shader.ComposedShader.prototype.extractShaderSections = function(shader)\n{\n\tvar regex = /void\\s*main\\s*\\(\\s*(?:void)?\\s*\\)\\s*{[\\s\\S]*}/;\n\n\tvar match = regex.exec( shader );\n\n\tvar start = match[0].indexOf(\"{\") + match.index + 1;\n\tvar end   = match[0].lastIndexOf(\"}\") + match.index;\n\n\tvar before    = shader.substring(0, match.index);\n\tvar mainStart = shader.substring(match.index, start);\n\tvar main      = shader.substring(start, end);\n\tvar mainEnd   = shader.substring(end, shader.length);\n\n\treturn {\n\t\tbefore:\t   before,\t\n\t\tmainStart: mainStart,\n\t\tmain:      main,\n\t\tmainEnd:   mainEnd\n\t};\n};\n\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * Philip Taylor: http://philip.html5.org\n */\n\n/**\n * Generate the final Shader program\n */\nx3dom.shader.NormalShader = function(gl)\n{\n\tthis.program = gl.createProgram();\n\t\n\tvar vertexShader   = this.generateVertexShader(gl);\n\tvar fragmentShader = this.generateFragmentShader(gl);\n\t\n\tgl.attachShader(this.program, vertexShader);\n    gl.attachShader(this.program, fragmentShader);\n    \n    // optional, but position should be at location 0 for performance reasons\n    gl.bindAttribLocation(this.program, 0, \"position\");\n    \n\tgl.linkProgram(this.program);\n\t\n\treturn this.program;\n};\n\n/**\n * Generate the vertex shader\n */\nx3dom.shader.NormalShader.prototype.generateVertexShader = function(gl)\n{\n\tvar shader =    \"attribute vec3 position;\\n\" +\n                    \"attribute vec3 normal;\\n\" +\n                    \"uniform vec3 bgCenter;\\n\" +\n                    \"uniform vec3 bgSize;\\n\" +\n                    \"uniform float bgPrecisionMax;\\n\" +\n                    \"uniform float bgPrecisionNorMax;\\n\" +\n                    \"uniform mat4 normalMatrix;\\n\" +\n                    \"uniform mat4 modelViewProjectionMatrix;\\n\" +\n                    \"varying vec3 fragNormal;\\n\" +\n                    \n                    \"void main(void) {\\n\" +\n                    \"    vec3 pos = bgCenter + bgSize * position / bgPrecisionMax;\\n\" +\n                    \"    fragNormal = (normalMatrix * vec4(normal / bgPrecisionNorMax, 0.0)).xyz;\\n\" +\n                    //\"    fragNormal = normal;\\n\" +\n                    \"    gl_Position = modelViewProjectionMatrix * vec4(pos, 1.0);\\n\" +\n                    \"}\\n\";\n\n\tvar vertexShader = gl.createShader(gl.VERTEX_SHADER);\n\tgl.shaderSource(vertexShader, shader);\n    gl.compileShader(vertexShader);\n\t\t\n\tif(!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)){\n\t\tx3dom.debug.logError(\"[NormalShader] VertexShader \" + gl.getShaderInfoLog(vertexShader));\t\t\n\t}\n\t\n\treturn vertexShader;\n};\n\n/**\n * Generate the fragment shader\n */\nx3dom.shader.NormalShader.prototype.generateFragmentShader = function(gl)\n{\n  var shader = \"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n\";\n  shader += \"precision highp float;\\n\";\n  shader += \"#else\\n\";\n  shader += \" precision mediump float;\\n\";\n  shader += \"#endif\\n\\n\";\n\n\tshader += \"varying vec3 fragNormal;\\n\" +\n\t\t\t\t\t\n\t\t\t\t\t\"void main(void) {\\n\" +\n\t\t\t\t\t\"    gl_FragColor = vec4(normalize(fragNormal) / 2.0 + 0.5, 1.0);\\n\" +\n\t\t\t\t\t\"}\\n\";\n\n    var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n\tgl.shaderSource(fragmentShader, shader);\n    gl.compileShader(fragmentShader);\n\t\t\n\tif(!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)){\n\t\tx3dom.debug.logError(\"[NormalShader] FragmentShader \" + gl.getShaderInfoLog(fragmentShader));\t\t\n\t}\n\t\n\treturn fragmentShader;\n};\n\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * Philip Taylor: http://philip.html5.org\n */\n\n/**\n * Generate the final ShadowShader program\n */\nx3dom.shader.FrontgroundTextureShader = function(gl)\n{\n\tthis.program = gl.createProgram();\n\t\n\tvar vertexShader \t= this.generateVertexShader(gl);\n\tvar fragmentShader \t= this.generateFragmentShader(gl);\n\t\n\tgl.attachShader(this.program, vertexShader);\n    gl.attachShader(this.program, fragmentShader);\n    \n    // optional, but position should be at location 0 for performance reasons\n    gl.bindAttribLocation(this.program, 0, \"position\");\n    \n\tgl.linkProgram(this.program);\n\t\n\treturn this.program;\n};\n\n/**\n * Generate the vertex shader\n */\nx3dom.shader.FrontgroundTextureShader.prototype.generateVertexShader = function(gl)\n{\n\tvar shader = \t\"attribute vec3 position;\\n\" +\n\t\t\t\t\t\"varying vec2 fragTexCoord;\\n\" +\n\t\t\t\t\t\"\\n\" +\n\t\t\t\t\t\"void main(void) {\\n\" +\n\t\t\t\t\t\"    vec2 texCoord = (position.xy + 1.0) * 0.5;\\n\" +\n\t\t\t\t\t\"    fragTexCoord = texCoord;\\n\" +\n\t\t\t\t\t\"    gl_Position = vec4(position.xy, 0.0, 1.0);\\n\" +\n\t\t\t\t\t\"}\\n\";\n\n\tvar vertexShader = gl.createShader(gl.VERTEX_SHADER);\n\tgl.shaderSource(vertexShader, shader);\n    gl.compileShader(vertexShader);\n\t\t\n\tif(!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)){\n\t\tx3dom.debug.logError(\"[FrontgroundTextureShader] VertexShader \" + gl.getShaderInfoLog(vertexShader));\t\t\n\t}\n\t\n\treturn vertexShader;\n};\n\n/**\n * Generate the fragment shader\n */\nx3dom.shader.FrontgroundTextureShader.prototype.generateFragmentShader = function(gl)\n{\n  var shader = \"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n\";\n  shader += \"precision highp float;\\n\";\n  shader += \"#else\\n\";\n  shader += \" precision mediump float;\\n\";\n  shader += \"#endif\\n\\n\";\n\n\tshader += \"uniform sampler2D tex;\\n\" +\n\t\t\t\t\"varying vec2 fragTexCoord;\\n\" +\n\t\t\t\t\"\\n\" +\n\t\t\t\t\"void main(void) {\\n\" +\n\t\t\t\t\"    vec4 col = texture2D(tex, fragTexCoord);\\n\" +\n\t\t\t\t\"    gl_FragColor = vec4(col.rgb, 1.0);\\n\" +\n\t\t\t\t\"}\\n\";\n\n    var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n\tgl.shaderSource(fragmentShader, shader);\n    gl.compileShader(fragmentShader);\n\t\t\n\tif(!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)){\n\t\tx3dom.debug.logError(\"[FrontgroundTextureShader] FragmentShader \" + gl.getShaderInfoLog(fragmentShader));\t\t\n\t}\n\t\n\treturn fragmentShader;\n};\n\n\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * Philip Taylor: http://philip.html5.org\n */\n\n/**\n * Generate the final ShadowShader program\n */\nx3dom.shader.BackgroundTextureShader = function(gl)\n{\n\tthis.program = gl.createProgram();\n\t\n\tvar vertexShader \t= this.generateVertexShader(gl);\n\tvar fragmentShader \t= this.generateFragmentShader(gl);\n\t\n\tgl.attachShader(this.program, vertexShader);\n    gl.attachShader(this.program, fragmentShader);\n    \n    // optional, but position should be at location 0 for performance reasons\n    gl.bindAttribLocation(this.program, 0, \"position\");\n    \n\tgl.linkProgram(this.program);\n\t\n\treturn this.program;\n};\n\n/**\n * Generate the vertex shader\n */\nx3dom.shader.BackgroundTextureShader.prototype.generateVertexShader = function(gl)\n{\n\tvar shader = \t\"attribute vec3 position;\\n\" +\n\t\t\t\t\t\"varying vec2 fragTexCoord;\\n\" +\n\t\t\t\t\t\"uniform vec2 scale;\\n\" +\n\t\t\t\t\t\"uniform vec2 translation;\\n\" +\n\t\t\t\t\t\"uniform float isVR;\\n\" +\n\t\t\t\t\t\"attribute float eyeIdx;\\n\" +\n\t\t\t\t\t\"varying float vrOffset;\\n\" +\n\t\t\t\t\t\"varying float fragEyeIdx;\\n\" +\n\t\t\t\t\t\"\\n\" +\n\t\t\t\t\t\"void main(void) {\\n\" +\n\t\t\t\t\t\"   vec2 texCoord = (position.xy + 1.0) * 0.5;\\n\" +\n\t\t\t\t\t\"   fragTexCoord = texCoord * scale + translation;\\n\" +\n\t\t\t\t\t\"\tfragEyeIdx = eyeIdx;\\n\" +\n\t\t\t\t\t\"   gl_Position = vec4(position.xy, 0.0, 1.0);\\n\" +\n\t\t\t\t\t\"\tif(isVR == 1.0){\\n\" +\n\t\t\t\t\t\"    \tvrOffset = eyeIdx * 0.5;\\n\" +\n\t\t\t\t\t\"    \tgl_Position.x *= 0.5;\\n\" +\n\t\t\t\t\t\"    \tgl_Position.x += vrOffset * gl_Position.w;\\n\" +\n\t\t\t\t\t\"\t}\\n\" +\n\t\t\t\t\t\"}\\n\";\n\n\tvar vertexShader = gl.createShader(gl.VERTEX_SHADER);\n\tgl.shaderSource(vertexShader, shader);\n    gl.compileShader(vertexShader);\n\t\t\n\tif(!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)){\n\t\tx3dom.debug.logError(\"[BackgroundTextureShader] VertexShader \" + gl.getShaderInfoLog(vertexShader));\t\t\n\t}\n\t\n\treturn vertexShader;\n};\n\n/**\n * Generate the fragment shader\n */\nx3dom.shader.BackgroundTextureShader.prototype.generateFragmentShader = function(gl)\n{\n  var shader = \"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n\";\n  shader += \"precision highp float;\\n\";\n  shader += \"#else\\n\";\n  shader += \" precision mediump float;\\n\";\n  shader += \"#endif\\n\\n\";\n\n\tshader += \"uniform float isVR;\\n\" +\n\t          \"varying float vrOffset;\\n\" +\n\t          \"varying float fragEyeIdx;\\n\" +\n\t          \"uniform float screenWidth;\\n\" +\n\t          \"uniform sampler2D tex;\\n\" +\n\t\t\t  \"varying vec2 fragTexCoord;\\n\" +\n\t\t\t  \"\\n\" +\n\t\t\t  \"void main(void) {\\n\" +\n\t\t\t  \"\t   if ( isVR == 1.0 ) {\\n\" +\n\t\t\t  \"        if ( ( step( 0.5, gl_FragCoord.x / screenWidth ) - 0.5 ) * vrOffset < 0.0 ) discard;\\n\" +\n\t\t\t  \"\t   }\\n\"+\n\t\t\t  \"    gl_FragColor = texture2D(tex, fragTexCoord);\\n\" +\n\t\t\t  \"}\";\n\n    var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n\tgl.shaderSource(fragmentShader, shader);\n    gl.compileShader(fragmentShader);\n\t\t\n\tif(!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)){\n\t\tx3dom.debug.logError(\"[BackgroundTextureShader] FragmentShader \" + gl.getShaderInfoLog(fragmentShader));\t\t\n\t}\n\t\n\treturn fragmentShader;\n};\n\n\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * Philip Taylor: http://philip.html5.org\n */\n\n/**\n * Generate the final ShadowShader program\n */\nx3dom.shader.BackgroundSkyTextureShader = function(gl)\n{\n\tthis.program = gl.createProgram();\n\t\n\tvar vertexShader \t= this.generateVertexShader(gl);\n\tvar fragmentShader \t= this.generateFragmentShader(gl);\n\t\n\tgl.attachShader(this.program, vertexShader);\n    gl.attachShader(this.program, fragmentShader);\n    \n    // optional, but position should be at location 0 for performance reasons\n    gl.bindAttribLocation(this.program, 0, \"position\");\n    \n\tgl.linkProgram(this.program);\n\t\n\treturn this.program;\n};\n\n/**\n * Generate the vertex shader\n */\nx3dom.shader.BackgroundSkyTextureShader.prototype.generateVertexShader = function(gl)\n{\n\tvar shader = \t\"attribute vec3 position;\\n\" +\n\t\t\t\t\t\"attribute vec2 texcoord;\\n\" +\n\t\t\t\t\t\"uniform mat4 modelViewProjectionMatrix;\\n\" +\n\t\t\t\t\t\"uniform mat4 modelViewProjectionMatrix2;\\n\" +\n\t\t\t\t\t\"varying vec2 fragTexCoord;\\n\" +\n\t\t\t\t\t\"uniform float isVR;\\n\" +\n\t\t\t\t\t\"attribute float eyeIdx;\\n\" +\n\t\t\t\t\t\"varying float vrOffset;\\n\" +\n\t\t\t\t\t\"varying float fragEyeIdx;\\n\" +\n\t\t\t\t\t\"\\n\" +\n\t\t\t\t\t\"void main(void) {\\n\" +\n\t\t\t\t\t\"    fragTexCoord = texcoord;\\n\" +\n\t\t\t\t\t\"\t fragEyeIdx = eyeIdx;\\n\" +\n\t\t\t\t\t\"\t if(eyeIdx == 1.0){\\n\" +\n\t\t\t\t\t\"   \tgl_Position = modelViewProjectionMatrix2 * vec4(position, 1.0);\\n\" +\n\t\t\t\t\t\"\t } else {\\n\" +\n\t\t\t\t\t\"   \tgl_Position = modelViewProjectionMatrix * vec4(position, 1.0);\\n\" +\n\t\t\t\t\t\"\t }\\n\" +\n\t\t\t\t\t\"\t if(isVR == 1.0){\\n\" +\n\t\t\t\t\t\"    \tvrOffset = eyeIdx * 0.5;\\n\" +\n\t\t\t\t\t\"    \tgl_Position.x *= 0.5;\\n\" +\n\t\t\t\t\t\"    \tgl_Position.x += vrOffset * gl_Position.w;\\n\" +\n\t\t\t\t\t\"\t }\\n\" +\n\t\t\t\t\t\"}\\n\";\n\n\tvar vertexShader = gl.createShader(gl.VERTEX_SHADER);\n\tgl.shaderSource(vertexShader, shader);\n    gl.compileShader(vertexShader);\n\t\t\n\tif(!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)){\n\t\tx3dom.debug.logError(\"[BackgroundSkyTextureShader] VertexShader \" + gl.getShaderInfoLog(vertexShader));\t\t\n\t}\n\t\n\treturn vertexShader;\n};\n\n/**\n * Generate the fragment shader\n */\nx3dom.shader.BackgroundSkyTextureShader.prototype.generateFragmentShader = function(gl)\n{\n  var shader = \"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n\";\n  shader += \"precision highp float;\\n\";\n  shader += \"#else\\n\";\n  shader += \" precision mediump float;\\n\";\n  shader += \"#endif\\n\\n\";\n\n\tshader += \"uniform float isVR;\\n\" +\n\t          \"varying float vrOffset;\\n\" +\n\t          \"varying float fragEyeIdx;\\n\" +\n\t          \"uniform float screenWidth;\\n\" +\"uniform sampler2D tex;\\n\" +\n\t\t\t  \"varying vec2 fragTexCoord;\\n\" +\n\t\t\t  \"\\n\" +\n\t\t\t  \"void main(void) {\\n\" +\n\t\t\t  \"    if ( isVR == 1.0 ) {\\n\" +\n\t\t\t  \"        if ( ( step( 0.5, gl_FragCoord.x / screenWidth ) - 0.5 ) * vrOffset < 0.0 ) discard;\\n\" +\n\t\t\t  \"    }\\n\"+\n\t\t\t  \"    gl_FragColor = texture2D(tex, fragTexCoord);\\n\" +\n\t\t\t  \"}\\n\";\n\n    var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n\tgl.shaderSource(fragmentShader, shader);\n    gl.compileShader(fragmentShader);\n\t\t\n\tif(!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)){\n\t\tx3dom.debug.logError(\"[BackgroundSkyTextureShader] FragmentShader \" + gl.getShaderInfoLog(fragmentShader));\t\t\n\t}\n\t\n\treturn fragmentShader;\n};\n\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * Philip Taylor: http://philip.html5.org\n */\n\n/**\n * Generate the final ShadowShader program\n */\nx3dom.shader.BackgroundCubeTextureShader = function(gl)\n{\n\tthis.program = gl.createProgram();\n\t\n\tvar vertexShader \t= this.generateVertexShader(gl);\n\tvar fragmentShader \t= this.generateFragmentShader(gl);\n\t\n\tgl.attachShader(this.program, vertexShader);\n    gl.attachShader(this.program, fragmentShader);\n    \n    // optional, but position should be at location 0 for performance reasons\n    gl.bindAttribLocation(this.program, 0, \"position\");\n    \n\tgl.linkProgram(this.program);\n\t\n\treturn this.program;\n};\n\n/**\n * Generate the vertex shader\n */\nx3dom.shader.BackgroundCubeTextureShader.prototype.generateVertexShader = function(gl)\n{\n\tvar shader = \t\"attribute vec3 position;\\n\" +\n\t\t\t\t\t\"uniform mat4 modelViewProjectionMatrix;\\n\" +\n\t\t\t\t\t\"varying vec3 fragNormal;\\n\" +\n\t\t\t\t\t\"\\n\" +\n\t\t\t\t\t\"void main(void) {\\n\" +\n\t\t\t\t\t\"    fragNormal = normalize(position);\\n\" +\n\t\t\t\t\t\"    gl_Position = modelViewProjectionMatrix * vec4(position, 1.0);\\n\" +\n\t\t\t\t\t\"}\\n\";\n\n\tvar vertexShader = gl.createShader(gl.VERTEX_SHADER);\n\tgl.shaderSource(vertexShader, shader);\n    gl.compileShader(vertexShader);\n\t\t\n\tif(!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)){\n\t\tx3dom.debug.logError(\"[BackgroundCubeTextureShader] VertexShader \" + gl.getShaderInfoLog(vertexShader));\t\t\n\t}\n\t\n\treturn vertexShader;\n};\n\n/**\n * Generate the fragment shader\n */\nx3dom.shader.BackgroundCubeTextureShader.prototype.generateFragmentShader = function(gl)\n{\n  var shader = \"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n\";\n  shader += \"precision highp float;\\n\";\n  shader += \"#else\\n\";\n  shader += \" precision mediump float;\\n\";\n  shader += \"#endif\\n\\n\";\n\n\tshader +=\t\"uniform samplerCube tex;\\n\" +\n\t\t\t\t\"varying vec3 fragNormal;\\n\" +\n\t\t\t\t\"\\n\" +\n\t\t\t\t\"float magn(float val) {\\n\" +\n\t\t\t\t\"    return ((val >= 0.0) ? val : -1.0 * val);\\n\" +\n\t\t\t\t\"}\" +\n\t\t\t\t\"\\n\" +\n\t\t\t\t\"void main(void) {\\n\" +\n\t\t\t\t// \"    vec3 normal = -reflect(normalize(fragNormal), vec3(0.0,0.0,1.0));\\n\" +\n\t\t\t\t// \"    if (magn(normal.y) >= magn(normal.x) && magn(normal.y) >= magn(normal.z))\\n\" +\n\t\t\t\t// \"        normal.xz = -normal.xz;\\n\" +\n\t\t\t\t\"    gl_FragColor = textureCube(tex, fragNormal);\\n\" +\n\t\t\t\t\"}\\n\";\n\n    var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n\tgl.shaderSource(fragmentShader, shader);\n    gl.compileShader(fragmentShader);\n\t\t\n\tif(!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)){\n\t\tx3dom.debug.logError(\"[BackgroundCubeTextureShader] FragmentShader \" + gl.getShaderInfoLog(fragmentShader));\t\t\n\t}\n\t\n\treturn fragmentShader;\n};\n\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * Philip Taylor: http://philip.html5.org\n */\n\n/**\n * Generate the final ShadowShader program\n */\nx3dom.shader.BackgroundCubeTextureDDSShader = function(gl)\n{\n\tthis.program = gl.createProgram();\n\t\n\tvar vertexShader \t= this.generateVertexShader(gl);\n\tvar fragmentShader \t= this.generateFragmentShader(gl);\n\t\n\tgl.attachShader(this.program, vertexShader);\n    gl.attachShader(this.program, fragmentShader);\n    \n    // optional, but position should be at location 0 for performance reasons\n    gl.bindAttribLocation(this.program, 0, \"position\");\n    \n\tgl.linkProgram(this.program);\n\n\tif (!gl.getProgramParameter(this.program, gl.LINK_STATUS)) {\n\t\tthrow (\"Error linking shaders:\" + gl.getProgramInfoLog(this.program));\n\t}\n\t\n\treturn this.program;\n};\n\n/**\n * Generate the vertex shader\n */\nx3dom.shader.BackgroundCubeTextureDDSShader.prototype.generateVertexShader = function(gl)\n{\n\tvar shader = \t\"attribute vec3 position;\\n\" +\n\t\t\t\t\t\"uniform mat4 modelViewProjectionMatrix;\\n\" +\n\t\t\t\t\t\"uniform mat4 modelViewProjectionMatrix2;\\n\" +\n\t\t\t\t\t\"varying vec3 fragNormal;\\n\" +\n\t\t\t\t\t\"uniform float isVR;\\n\" +\n\t\t\t\t\t\"attribute float eyeIdx;\\n\" +\n\t\t\t\t\t\"varying float vrOffset;\\n\" +\n\t\t\t\t\t\"varying float fragEyeIdx;\\n\" +\n\t\t\t\t\t\"\\n\" +\n\t\t\t\t\t\"void main(void) {\\n\" +\n\t\t\t\t\t\"\tfragEyeIdx = eyeIdx;\\n\" +\n\t\t\t\t\t\"   fragNormal = normalize(position);\\n\" +\n\t\t\t\t\t\"\tif(eyeIdx == 1.0){\\n\" +\n\t\t\t\t\t\"   \tgl_Position = modelViewProjectionMatrix2 * vec4(position, 1.0);\\n\" +\n\t\t\t\t\t\"\t} else {\\n\" +\n\t\t\t\t\t\"   \tgl_Position = modelViewProjectionMatrix * vec4(position, 1.0);\\n\" +\n\t\t\t\t\t\"\t}\\n\" +\n\t\t\t\t\t\"\tif(isVR == 1.0){\\n\" +\n\t\t\t\t\t\"    \tvrOffset = eyeIdx * 0.5;\\n\" +\n\t\t\t\t\t\"    \tgl_Position.x *= 0.5;\\n\" +\n\t\t\t\t\t\"    \tgl_Position.x += vrOffset * gl_Position.w;\\n\" +\n\t\t\t\t\t\"\t}\\n\" +\n\n\t\t\t\t\t\"}\\n\";\n\n\tvar vertexShader = gl.createShader(gl.VERTEX_SHADER);\n\tgl.shaderSource(vertexShader, shader);\n    gl.compileShader(vertexShader);\n\t\t\n\tif(!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)){\n\t\tx3dom.debug.logError(\"[BackgroundCubeTextureShader] VertexShader \" + gl.getShaderInfoLog(vertexShader));\t\t\n\t}\n\t\n\treturn vertexShader;\n};\n\n/**\n * Generate the fragment shader\n */\nx3dom.shader.BackgroundCubeTextureDDSShader.prototype.generateFragmentShader = function(gl)\n{\n\tvar shader = \"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n\";\n\tshader += \"precision highp float;\\n\";\n\tshader += \"#else\\n\";\n\tshader += \" precision mediump float;\\n\";\n\tshader += \"#endif\\n\\n\";\n\n\tshader += x3dom.shader.toneMapping();\n\tshader += x3dom.shader.gammaCorrectionDecl({});\n\n\tshader +=\t\"uniform float isVR;\\n\" +\n\t\t\t\t\"varying float vrOffset;\\n\" +\n\t\t\t\t\"varying float fragEyeIdx;\\n\" +\n\t\t\t\t\"uniform float screenWidth;\\n\" +\n\t\t\t\t\"uniform samplerCube tex;\\n\" +\n\t\t\t\t\"varying vec3 fragNormal;\\n\" +\n\t\t\t\t\"\\n\" +\n\t\t\t\t\"void main(void) {\\n\" +\n\t\t\t\t\"\tif ( isVR == 1.0 ) {\\n\" +\n\t\t\t\t\"   \tif ( ( step( 0.5, gl_FragCoord.x / screenWidth ) - 0.5 ) * vrOffset < 0.0 ) discard;\\n\" +\n\t\t\t\t\"\t}\\n\"+\n\t\t\t\t\"   vec4 color = textureCube(tex, fragNormal);\\n\" +\n\n\t\t\t\t\"\tif(tonemappingOperator == 1.0) {\\n\" +\n\t\t\t\t\"   \tcolor.rgb = tonemapReinhard(color.rgb);\\n\" +\n\t\t\t\t\"\t}\\n\" +\n\t\t\t\t\"\tif(tonemappingOperator == 2.0) {\\n\" +\n\t\t\t\t\"   \tcolor.rgb = tonemapUncharted2(color.rgb);\\n\" +\n\t\t\t\t\"\t}\\n\" +\n\t\t\t\t\"\tif(tonemappingOperator == 3.0) {\\n\" +\n\t\t\t\t\"   \tcolor.rgb = tonemapeFilmic(color.rgb);\\n\" +\n\t\t\t\t\"\t}\\n\" +\n\n\t\t\t\t\"   color = \" + x3dom.shader.encodeGamma({}, \"color\") +\";\\n\" +\n\n\t\t\t\t\"   gl_FragColor = color;\\n\" +\n\t\t\t\t\"}\\n\";\n\n    var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n\tgl.shaderSource(fragmentShader, shader);\n    gl.compileShader(fragmentShader);\n\t\t\n\tif(!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)){\n\t\tx3dom.debug.logError(\"[BackgroundCubeTextureShader] FragmentShader \" + gl.getShaderInfoLog(fragmentShader));\t\t\n\t}\n\t\n\treturn fragmentShader;\n};\n\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * Philip Taylor: http://philip.html5.org\n */\n\n/**\n * Generate the final Shader program\n */\nx3dom.shader.ShadowRenderingShader = function(gl,shadowedLights)\n{\n\tthis.program = gl.createProgram();\n\tvar vertexShader \t= this.generateVertexShader(gl);\n\tvar fragmentShader \t= this.generateFragmentShader(gl,shadowedLights);\n\t\n\tgl.attachShader(this.program, vertexShader);\n    gl.attachShader(this.program, fragmentShader);\n    \n    // optional, but position should be at location 0 for performance reasons\n    gl.bindAttribLocation(this.program, 0, \"position\");\n    \n\tgl.linkProgram(this.program);\n\t\n\treturn this.program;\n};\n\n/**\n * Generate the vertex shader\n */\nx3dom.shader.ShadowRenderingShader.prototype.generateVertexShader = function(gl)\n{\n\tvar shader = \"\";\n\tshader += \"attribute vec2 position;\\n\";\n\n\tshader += \"varying vec2 vPosition;\\n\";\n\t\n\tshader += \"void main(void) {\\n\";\n\tshader += \" vPosition = position;\\n\";\n\tshader += \" gl_Position = vec4(position, -1.0, 1.0);\\n\";\n\tshader += \"}\\n\";\n\t\n\tvar vertexShader = gl.createShader(gl.VERTEX_SHADER);\n\tgl.shaderSource(vertexShader, shader);\n    gl.compileShader(vertexShader);\n\t\t\n\tif(!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)){\n\t\tx3dom.debug.logError(\"[ShadowRendering] VertexShader \" + gl.getShaderInfoLog(vertexShader));\t\t\n\t}\n\t\n\treturn vertexShader;\n};\n\n/**\n * Generate the fragment shader\n */\nx3dom.shader.ShadowRenderingShader.prototype.generateFragmentShader = function(gl,shadowedLights)\n{\n  var shader = \"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n\";\n  shader += \"precision highp float;\\n\";\n  shader += \"#else\\n\";\n  shader += \" precision mediump float;\\n\";\n  shader += \"#endif\\n\\n\";\n\n\tshader += \"uniform mat4 inverseViewProj;\\n\";\n\tshader += \"uniform mat4 inverseProj;\\n\";\n\tshader += \"varying vec2 vPosition;\\n\";\n\tshader += \"uniform sampler2D sceneMap;\\n\";  \n\tfor (var i=0; i<5; i++)\n\t\tshader += \"uniform float cascade\"+i+\"_Depth;\\n\";\n\t\n\t\n\tfor(var l=0; l<shadowedLights.length; l++) {\n\tshader +=\t\"uniform float light\"+l+\"_On;\\n\" +\n\t\t\t\t\"uniform float light\"+l+\"_Type;\\n\" +\n\t\t\t\t\"uniform vec3  light\"+l+\"_Location;\\n\" +\n\t\t\t\t\"uniform vec3  light\"+l+\"_Direction;\\n\" +\n\t\t\t\t\"uniform vec3  light\"+l+\"_Attenuation;\\n\" +\n\t\t\t\t\"uniform float light\"+l+\"_Radius;\\n\" +\n\t\t\t\t\"uniform float light\"+l+\"_BeamWidth;\\n\" +\n\t\t\t\t\"uniform float light\"+l+\"_CutOffAngle;\\n\" +\n\t\t\t\t\"uniform float light\"+l+\"_ShadowIntensity;\\n\" +\n\t\t\t\t\"uniform float light\"+l+\"_ShadowOffset;\\n\" +\n\t\t\t\t\"uniform mat4 light\"+l+\"_ViewMatrix;\\n\";\n\t\tfor (var j=0; j<6; j++){\n\t\t\tshader += \"uniform mat4 light\"+l+\"_\"+j+\"_Matrix;\\n\";\n\t\t\tshader += \"uniform sampler2D light\"+l+\"_\"+j+\"_ShadowMap;\\n\"; \n\t\t}\n\t\tfor (var j=0; j<5; j++)\n\t\t\tshader += \"uniform float light\"+l+\"_\"+j+\"_Split;\\n\"; \n\n\t\t\n\t}\n\tif (!x3dom.caps.FP_TEXTURES || x3dom.caps.MOBILE) \n\t\tshader += \tx3dom.shader.rgbaPacking();\t\t\t\t\n\t\n\tshader += x3dom.shader.shadowRendering();\n    \n    shader += x3dom.shader.gammaCorrectionDecl({});  //TODO shader properties?\n\t\n\tshader += \t\"void main(void) {\\n\" +\n\t\t\t\t\"\tfloat shadowValue = 1.0;\\n\" +\n\t\t\t\t\"\tvec2 texCoordsSceneMap = (vPosition + 1.0)*0.5;\\n\" +\n\t\t\t\t\"\tvec4 projCoords = texture2D(sceneMap, texCoordsSceneMap);\\n\" +\n\t\t\t\t\"\tif (projCoords != vec4(1.0,1.0,1.0,0.0)){\\n\";\n\tif (!x3dom.caps.FP_TEXTURES || x3dom.caps.MOBILE){ \n\t\tshader += \t\"\tprojCoords.z = unpackDepth(projCoords);\\n\" +\n\t\t\t\t\t\"\tprojCoords.w = 1.0;\\n\";\n\t}\n\t\n\t//reconstruct world and view coordinates from scene map\n\tshader += \t\"\tprojCoords = projCoords / projCoords.w;\\n\" +\n\t\t\t\t\"\tprojCoords.xy = vPosition;\\n\" +\n\t\t\t\t\"\tvec4 eyeCoords = inverseProj*projCoords;\\n\" +\n\t\t\t\t\"\tvec4 worldCoords = inverseViewProj*projCoords;\\n\" +\n\t\t\t\t\"\tfloat lightInfluence = 0.0;\\n\";\n\t\n\tfor(var l=0; l<shadowedLights.length; l++) {\n\t\tshader += \n\t\t\t\t\"\tlightInfluence = getLightInfluence(light\"+l+\"_Type, light\"+l+\"_ShadowIntensity, light\"+l+\"_On, light\"+l+\"_Location, light\"+l+\"_Direction, \" +\n\t\t\t\t\t\t\"light\"+l+\"_CutOffAngle, light\"+l+\"_BeamWidth, light\"+l+\"_Attenuation, light\"+l+\"_Radius, eyeCoords.xyz/eyeCoords.w);\\n\" +\n\t\t\t\t\"\tif (lightInfluence != 0.0){\\n\" +\n\t\t\t\t\"\t\tvec4 shadowMapValues;\\n\" +\n\t\t\t\t\"\t\tfloat viewSampleDepth;\\n\";\n\t\t\t\t\n\n\t\tif (!x3dom.isa(shadowedLights[l], x3dom.nodeTypes.PointLight)){\n\t\t\tshader += \"\t\tgetShadowValuesCascaded(shadowMapValues, viewSampleDepth, worldCoords, -eyeCoords.z/eyeCoords.w,\"+\n\t\t\t\t\t\t\t\t\"light\"+l+\"_0_Matrix,light\"+l+\"_1_Matrix,light\"+l+\"_2_Matrix,light\"+l+\"_3_Matrix,light\"+l+\"_4_Matrix,light\"+l+\"_5_Matrix,\"+\n\t\t\t\t\t\t\t\t\"light\"+l+\"_0_ShadowMap,light\"+l+\"_1_ShadowMap,light\"+l+\"_2_ShadowMap,light\"+l+\"_3_ShadowMap,\"+\n\t\t\t\t\t\t\t\t\"light\"+l+\"_4_ShadowMap,light\"+l+\"_5_ShadowMap, light\"+l+\"_0_Split, light\"+l+\"_1_Split, light\"+l+\"_2_Split, light\"+l+\"_3_Split, \\n\"+\n\t\t\t\t\t\t\t\t\"light\"+l+\"_4_Split);\\n\";\n\t\t} else {\n\t\t\tshader += \"\t\tgetShadowValuesPointLight(shadowMapValues, viewSampleDepth, light\"+l+\"_Location, worldCoords, light\"+l+\"_ViewMatrix, \"+\n\t\t\t\t\t\t\t\t\"light\"+l+\"_0_Matrix,light\"+l+\"_1_Matrix,light\"+l+\"_2_Matrix,light\"+l+\"_3_Matrix,light\"+l+\"_4_Matrix,light\"+l+\"_5_Matrix,\"+\n\t\t\t\t\t\t\t\t\"light\"+l+\"_0_ShadowMap,light\"+l+\"_1_ShadowMap,light\"+l+\"_2_ShadowMap,light\"+l+\"_3_ShadowMap,\"+\n\t\t\t\t\t\t\t\t\"light\"+l+\"_4_ShadowMap,light\"+l+\"_5_ShadowMap);\\n\";\n\t\t}\t\t\n\t\n\t\tif (!x3dom.caps.FP_TEXTURES || x3dom.caps.MOBILE)\t\n\t\t\tshader += \t\"\tshadowValue *= clamp(ESM(shadowMapValues.z, viewSampleDepth, light\"+l+\"_ShadowOffset), \"+\n\t\t\t\t\t\t\"\t\t\t\t1.0 - light\"+l+\"_ShadowIntensity*lightInfluence, 1.0);\\n\";\n\t\telse\n\t\t\tshader += \t\" \tshadowValue *= clamp(VSM(shadowMapValues.zy, viewSampleDepth, light\"+l+\"_ShadowOffset), \"+\n\t\t\t\t\t\t\"\t\t\t\t1.0 - light\"+l+\"_ShadowIntensity*lightInfluence, 1.0);\\n\";\t\t\t\t\n\t\tshader += \t\t\"\t}\\n\";\n\t\t\n\t}\n\t\t\t\t\t\n\tshader += \t\"}\\n\" + \n                // In principle we should fix the place where this is multplied in instead\n                // of overcompensating for the subsequent error from here. This way of doing\n                // gamma correction explots the rule that (a*b)^x = a^x * b^x (x being the\n                // gamma coefficient), i.e. the umbra is corrected for now, the penumbra\n                // is incorrect and full light is zero here so unaffected as well.\n\t\t\t\t\"\tgl_FragColor = \" + x3dom.shader.encodeGamma({}, \"vec4(shadowValue, shadowValue, shadowValue, 1.0)\") + \";\\n\" +\n\t\t\t\t\"}\\n\";\n\n    var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n\tgl.shaderSource(fragmentShader, shader);\n    gl.compileShader(fragmentShader);\n\t\t\n\tif(!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)){\n\t\tx3dom.debug.logError(\"[ShadowRendering] FragmentShader \" + gl.getShaderInfoLog(fragmentShader));\t\t\n\t}\n\t\n\treturn fragmentShader;\n};\n\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * Philip Taylor: http://philip.html5.org\n */\n\n/**\n * Generate the final shader program\n */\nx3dom.shader.TextureRefinementShader = function (gl) {\n    this.program = gl.createProgram();\n\n    var vertexShader = this.generateVertexShader(gl);\n    var fragmentShader = this.generateFragmentShader(gl);\n\n    gl.attachShader(this.program, vertexShader);\n    gl.attachShader(this.program, fragmentShader);\n\n    // optional, but position should be at location 0 for performance reasons\n    gl.bindAttribLocation(this.program, 0, \"position\");\n\n    gl.linkProgram(this.program);\n\n    return this.program;\n};\n\n/**\n * Generate the vertex shader\n */\nx3dom.shader.TextureRefinementShader.prototype.generateVertexShader = function (gl) {\n    var shader = \"attribute vec2 position;\\n\" +\n                 \"varying vec2 fragTexCoord;\\n\" +\n                 \"\\n\" +\n                 \"void main(void) {\\n\" +\n                 \"    fragTexCoord = (position.xy + 1.0) / 2.0;\\n\" +\n                 \"    gl_Position = vec4(position, -1.0, 1.0);\\n\" +\n                 \"}\\n\";\n\n    var vertexShader = gl.createShader(gl.VERTEX_SHADER);\n    gl.shaderSource(vertexShader, shader);\n    gl.compileShader(vertexShader);\n\n    if (!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)) {\n        x3dom.debug.logError(\"[TextureRefinementShader] VertexShader \" + gl.getShaderInfoLog(vertexShader));\n    }\n\n    return vertexShader;\n};\n\n/**\n * Generate the fragment shader\n */\nx3dom.shader.TextureRefinementShader.prototype.generateFragmentShader = function (gl) {\n    var shader = \"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n\" +\n                 \" precision highp float;\\n\" +\n                 \"#else\\n\" +\n                 \" precision mediump float;\\n\" +\n                 \"#endif\\n\\n\";\n\n    shader += \"uniform sampler2D stamp;\\n\" +\n              \"uniform sampler2D lastTex;\\n\" +\n              \"uniform sampler2D curTex;\\n\" +\n              \"uniform int mode;\\n\" +\n              \"uniform vec2 repeat;\\n\" +\n              \"varying vec2 fragTexCoord;\\n\" +\n              \"\\n\" +\n              \"void init(void);\\n\" +\n              \"void refine(void);\\n\" +\n              \"\\n\" +\n              \"void main(void) {\\n\" +\n              \"    if (mode == 0) { init(); }\\n\" +\n              \"    else { refine(); }\\n\" +\n              \"}\\n\" +\n              \"\\n\" +\n              \"void init(void) {\\n\" +\n              \"    gl_FragColor = texture2D(curTex, fragTexCoord);\\n\" +\n              \"}\\n\" +\n              \"\\n\" +\n              \"void refine(void) {\\n\" +\n              \"    vec3 red = texture2D(stamp, repeat * fragTexCoord).rgb;\\n\" +\n              \"    vec3 v1  = texture2D(lastTex, fragTexCoord).rgb;\\n\" +\n              \"    vec3 v2  = texture2D(curTex, fragTexCoord).rgb;\\n\" +\n              \"    if (red.r <= 0.5) {\\n\" +\n              \"        gl_FragColor = vec4(v1, 1.0);\\n\" +\n              \"    }\\n\" +\n              \"    else {\\n\" +\n              \"        gl_FragColor = vec4(v2, 1.0);\\n\" +\n              \"    }\\n\" +\n              \"}\\n\";\n\n    var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n    gl.shaderSource(fragmentShader, shader);\n    gl.compileShader(fragmentShader);\n\n    if (!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)) {\n        x3dom.debug.logError(\"[TextureRefinementShader] FragmentShader \" + gl.getShaderInfoLog(fragmentShader));\n    }\n\n    return fragmentShader;\n};\n\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * Philip Taylor: http://philip.html5.org\n */\n\n/**\n * Generate the final BlurShader program \n * (gaussian blur for 3x3, 5x5 and 7x7 kernels)\n */\nx3dom.shader.BlurShader = function(gl)\n{\n\tthis.program = gl.createProgram();\n\t\n\tvar vertexShader \t= this.generateVertexShader(gl);\n\tvar fragmentShader \t= this.generateFragmentShader(gl);\n\t\n\tgl.attachShader(this.program, vertexShader);\n    gl.attachShader(this.program, fragmentShader);\n    \n    // optional, but position should be at location 0 for performance reasons\n    gl.bindAttribLocation(this.program, 0, \"position\");\n    \n\tgl.linkProgram(this.program);\n\t\n\treturn this.program;\n};\n\n/**\n * Generate the vertex shader\n */\nx3dom.shader.BlurShader.prototype.generateVertexShader = function(gl)\n{\n\tvar shader = \"\";\n\tshader += \"attribute vec2 position;\\n\";\n\n\tshader += \"varying vec2 vPosition;\\n\";\n\t\n\tshader += \"void main(void) {\\n\";\n\tshader += \" vPosition = position;\\n\";\n\tshader += \" gl_Position = vec4(position, -1.0, 1.0);\\n\";\n\tshader += \"}\\n\";\n\n\tvar vertexShader = gl.createShader(gl.VERTEX_SHADER);\n\tgl.shaderSource(vertexShader, shader);\n    gl.compileShader(vertexShader);\n\t\t\n\tif(!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)){\n\t\tx3dom.debug.logError(\"[BlurShader] VertexShader \" + gl.getShaderInfoLog(vertexShader));\t\t\n\t}\n\t\n\treturn vertexShader;\n};\n\n/**\n * Generate the fragment shader\n */\nx3dom.shader.BlurShader.prototype.generateFragmentShader = function(gl)\n{\n  var shader = \"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n\";\n  shader += \"precision highp float;\\n\";\n  shader += \"#else\\n\";\n  shader += \" precision mediump float;\\n\";\n  shader += \"#endif\\n\\n\";\n\n\tshader += \"varying vec2 vPosition;\\n\" +\n\t\t\t\t\t\"uniform sampler2D texture;\\n\" +\n\t\t\t\t\t\"uniform bool horizontal;\\n\" +\n\t\t\t\t\t\"uniform float pixelSizeHor;\\n\" +\n\t\t\t\t\t\"uniform float pixelSizeVert;\\n\" +\n\t\t\t\t\t\"uniform int filterSize;\\n\";\n\n\tif (!x3dom.caps.FP_TEXTURES || x3dom.caps.MOBILE){\n\tshader +=\t\tx3dom.shader.rgbaPacking() +\n\t\n\t\t\t\t\t\"void main(void) {\\n\" +\n\t\t\t\t\t\"\tvec2 texCoords = (vPosition + 1.0)*0.5;\\n\" +\n\t\t\t\t\t\"\tvec2 offset;\\n\" +\n\t\t\t\t\t\"\tif (horizontal) offset = vec2(pixelSizeHor, 0.0);\\n\" +\n\t\t\t\t\t\"\telse offset = vec2(0.0, pixelSizeVert);\\n\" +\n\t\t\t\t\t\"\tfloat depth = unpackDepth(texture2D(texture, texCoords));\\n\" +\n\t\t\t\t\t\"\tif (filterSize == 3){\\n\" +\t\t\n\t\t\t\t\t\"\t\tdepth = depth * 0.3844;\\n\" +\n\t\t\t\t\t\"\t\tdepth += 0.3078*unpackDepth(texture2D(texture, texCoords-offset));\\n\" +\n\t\t\t\t\t\"\t\tdepth += 0.3078*unpackDepth(texture2D(texture, texCoords+offset));\\n\" +\n\t\t\t\t\t\"\t} else if (filterSize == 5){\\n\" +\t\n\t\t\t\t\t\"\t\tdepth = depth * 0.2921;\\n\" +\n\t\t\t\t\t\"\t\tdepth += 0.2339*unpackDepth(texture2D(texture, texCoords-offset));\\n\" +\n\t\t\t\t\t\"\t\tdepth += 0.2339*unpackDepth(texture2D(texture, texCoords+offset));\\n\" +\t\n\t\t\t\t\t\"\t\tdepth += 0.1201*unpackDepth(texture2D(texture, texCoords-2.0*offset));\\n\" +\n\t\t\t\t\t\"\t\tdepth += 0.1201*unpackDepth(texture2D(texture, texCoords+2.0*offset));\\n\" +\n\t\t\t\t\t\"\t} else if (filterSize == 7){\\n\" +\t\n\t\t\t\t\t\"\t\tdepth = depth * 0.2161;\\n\" +\n\t\t\t\t\t\"\t\tdepth += 0.1907*unpackDepth(texture2D(texture, texCoords-offset));\\n\" +\n\t\t\t\t\t\"\t\tdepth += 0.1907*unpackDepth(texture2D(texture, texCoords+offset));\\n\" +\t\n\t\t\t\t\t\"\t\tdepth += 0.1311*unpackDepth(texture2D(texture, texCoords-2.0*offset));\\n\" +\n\t\t\t\t\t\"\t\tdepth += 0.1311*unpackDepth(texture2D(texture, texCoords+2.0*offset));\\n\" +\n\t\t\t\t\t\"\t\tdepth += 0.0702*unpackDepth(texture2D(texture, texCoords-3.0*offset));\\n\" +\n\t\t\t\t\t\"\t\tdepth += 0.0702*unpackDepth(texture2D(texture, texCoords+3.0*offset));\\n\" +\t\t\t\t\t\n\t\t\t\t\t\"\t}\\n\" + \n\t\t\t\t\t\"\tgl_FragColor = packDepth(depth);\\n\" + \n\t\t\t\t\t\"}\\n\";\n\t} else{\n\tshader +=\t\t\"void main(void) {\\n\" +\n\t\t\t\t\t\"\tvec2 texCoords = (vPosition + 1.0)*0.5;\\n\" +\n\t\t\t\t\t\"\tvec2 offset;\\n\" +\n\t\t\t\t\t\"\tif (horizontal) offset = vec2(pixelSizeHor, 0.0);\\n\" +\n\t\t\t\t\t\"\telse offset = vec2(0.0, pixelSizeVert);\\n\" +\n\t\t\t\t\t\"\tvec4 color = texture2D(texture, texCoords);\\n\" +\n\t\t\t\t\t\"\tif (filterSize == 3){\\n\" +\t\t\n\t\t\t\t\t\"\t\tcolor = color * 0.3844;\\n\" +\n\t\t\t\t\t\"\t\tcolor += 0.3078*texture2D(texture, texCoords-offset);\\n\" +\n\t\t\t\t\t\"\t\tcolor += 0.3078*texture2D(texture, texCoords+offset);\\n\" +\n\t\t\t\t\t\"\t} else if (filterSize == 5){\\n\" +\t\n\t\t\t\t\t\"\t\tcolor = color * 0.2921;\\n\" +\n\t\t\t\t\t\"\t\tcolor += 0.2339*texture2D(texture, texCoords-offset);\\n\" +\n\t\t\t\t\t\"\t\tcolor += 0.2339*texture2D(texture, texCoords+offset);\\n\" +\t\n\t\t\t\t\t\"\t\tcolor += 0.1201*texture2D(texture, texCoords-2.0*offset);\\n\" +\n\t\t\t\t\t\"\t\tcolor += 0.1201*texture2D(texture, texCoords+2.0*offset);\\n\" +\n\t\t\t\t\t\"\t} else if (filterSize == 7){\\n\" +\t\n\t\t\t\t\t\"\t\tcolor = color * 0.2161;\\n\" +\n\t\t\t\t\t\"\t\tcolor += 0.1907*texture2D(texture, texCoords-offset);\\n\" +\n\t\t\t\t\t\"\t\tcolor += 0.1907*texture2D(texture, texCoords+offset);\\n\" +\t\n\t\t\t\t\t\"\t\tcolor += 0.1311*texture2D(texture, texCoords-2.0*offset);\\n\" +\n\t\t\t\t\t\"\t\tcolor += 0.1311*texture2D(texture, texCoords+2.0*offset);\\n\" +\n\t\t\t\t\t\"\t\tcolor += 0.0702*texture2D(texture, texCoords-3.0*offset);\\n\" +\n\t\t\t\t\t\"\t\tcolor += 0.0702*texture2D(texture, texCoords+3.0*offset);\\n\" +\t\t\t\t\t\n\t\t\t\t\t\"\t}\\n\" + \n\t\t\t\t\t\"\tgl_FragColor = color;\\n\" + \n\t\t\t\t\t\"}\\n\";\n\t}\t\t\t\t\n\n    var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n\tgl.shaderSource(fragmentShader, shader);\n    gl.compileShader(fragmentShader);\n\t\t\n\tif(!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)){\n\t\tx3dom.debug.logError(\"[BlurShader] FragmentShader \" + gl.getShaderInfoLog(fragmentShader));\t\t\n\t}\n\t\n\treturn fragmentShader;\n};\n\n/**\n * Created by Sven Kluge on 27.06.2016.\n */\n\nx3dom.shader.KHRMaterialCommonsShader = function(gl, properties)\n{\n    this.program = gl.createProgram();\n\n    var vertexShader \t= this.generateVertexShader(gl);\n    var fragmentShader \t= this.generateFragmentShader(gl, properties);\n\n    gl.attachShader(this.program, vertexShader);\n    gl.attachShader(this.program, fragmentShader);\n\n    // optional, but position should be at location 0 for performance reasons\n    gl.bindAttribLocation(this.program, 0, \"position\");\n\n    gl.linkProgram(this.program);\n\n    return this.program;\n};\n\nx3dom.shader.KHRMaterialCommonsShader.prototype.generateVertexShader = function(gl)\n{\n    var shader = \"precision highp float;\\n\"+\n                \"attribute vec3 position;\"+\n                \"attribute vec3 normal;\"+\n                \"attribute vec3 texcoord;\"+\n                \"varying vec3 v_eye;\"+\n                \"varying vec3 v_normal;\"+\n                \"varying vec3 v_texcoord;\"+\n                \"uniform mat4 modelViewProjectionMatrix;\"+\n                \"uniform mat4 modelViewMatrix;\"+\n                \"uniform mat4 normalMatrix;\"+\n                \"void main (void)\"+\n                \"{\"+\n                \"    vec4 pos = modelViewProjectionMatrix * vec4(position, 1.0);\"+\n                \"    v_eye = (modelViewMatrix * vec4(position, 1.0)).xyz;\"+\n                \"    v_normal = normalize((normalMatrix * vec4(normal,1.0)).xyz);\"+\n                \"    v_texcoord = texcoord;\"+\n                \"    gl_Position = pos;\"+\n                \"}\";\n\n    var vertexShader = gl.createShader(gl.VERTEX_SHADER);\n    gl.shaderSource(vertexShader, shader);\n    gl.compileShader(vertexShader);\n\n    if(!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)){\n        x3dom.debug.logError(\"[KHRMaterialCommonsShader] VertexShader \" + gl.getShaderInfoLog(vertexShader));\n    }\n\n    return vertexShader;\n};\n\nx3dom.shader.KHRMaterialCommonsShader.prototype.generateFragmentShader = function(gl, properties)\n{\n    var shader = \"precision highp float;\\n\"+\n    \"varying vec3 v_eye;\\n\"+\n    \"varying vec3 v_normal;\\n\"+\n    \"varying vec3 v_texcoord;\\n\"+\n    \"uniform vec4 lightVector;\\n\"+\n    \"uniform vec4 ambient;\\n\";\n\n    if(properties.LIGHTS || properties.CLIPPLANES)\n    {\n        shader += \"varying vec4 fragPosition;\\n\";\n        shader += \"uniform float isOrthoView;\\n\";\n    }\n\n    //Lights\n    if(properties.LIGHTS) {\n\n        if(properties.NORMALMAP && properties.NORMALSPACE == \"OBJECT\") {\n            //do nothing\n        } else {\n            shader += \"varying vec3 fragNormal;\\n\";\n        }\n\n        shader += x3dom.shader.light(properties.LIGHTS);\n    }\n\n    if(properties.USE_DIFFUSE_TEX == 0)\n        shader += \"uniform vec4 diffuse;\\n\";\n    else\n        shader += \"uniform sampler2D diffuseTex;\\n\";\n\n    if(properties.USE_EMISSION_TEX == 0)\n        shader += \"uniform vec4 emission;\\n\";\n    else\n        shader += \"uniform sampler2D emissionTex;\\n\";\n\n    if(properties.USE_SPECULAR_TEX == 0)\n    shader += \"uniform vec4 specular;\\n\";\n    else\n        shader += \"uniform sampler2D specularTex;\\n\";\n\n\n    shader +=\n    \"uniform float shininess;\\n\"+\n    \"uniform float transparency;\\n\"+\n    \"uniform float ambientIntensity;\\n\"+\n    \"uniform vec4 ambientLight;\\n\"+\n    \"uniform int technique;\\n\"+\n    \"void main(void)\\n\"+\n    \"{\\n\"+\n        \"vec4 I = -vec4(normalize(v_eye),1.0);\\n\"+\n        \"vec4 N = vec4(v_normal,1.0);\\n\"+\n        \"vec4 al = ambientLight;\\n\"+\n        \"vec4 L = normalize(lightVector-vec4(v_eye,1.0));\\n\";\n\n        if(properties.USE_DIFFUSE_TEX == 0)\n            shader += \"vec4 _diffuse = diffuse;\\n\";\n        else\n            shader += \"vec4 _diffuse = texture2D(diffuseTex, v_texcoord.xy);\\n\";\n\n        if(properties.USE_SPECULAR_TEX == 0)\n            shader += \"vec4 _specularColor = specular;\\n\";\n        else\n            shader += \"vec4 _specularColor = texture2D(specularTex, v_texcoord.xy);\\n\";\n\n        if(properties.USE_EMISSION_TEX == 0)\n            shader += \"vec4 _emission = emission;\\n\";\n        else\n            shader += \"vec4 _emission = texture2D(emissionTex, v_texcoord.xy);\\n\";\n\n        shader +=\n            \"vec4 color;\\n\"+\n            \"if(technique == 0) // BLINN\\n\"+\n            \"{\\n\"+\n                \"vec4 H = normalize(I+L);\\n\"+\n                \"color = _emission + ambient * al + _diffuse * max(dot(N,L),0.0) + _specularColor * pow(max(dot(H,N),0.0),shininess);\\n\"+\n            \"}\\n\"+\n            \"else if(technique==1) // PHONG\\n\"+\n            \"{\\n\"+\n                \"vec4 R = -reflect(L,N);\\n\"+\n                \"color = _emission + ambient * al + _diffuse * max(dot(N,L),0.0) + _specularColor * pow(max(dot(R,I),0.0),shininess);\\n\"+\n            \"}\\n\"+\n            \"else if(technique==2) // LAMBERT\\n\"+\n            \"{\\n\"+\n                \"color = _emission + ambient * al + _diffuse * max(dot(N,L), 0.0);\\n\"+\n            \"}\\n\"+\n            \"else if(technique==3) // CONSTANT\\n\"+\n            \"{\\n\"+\n                \"color = _emission + ambient * al;\\n\"+\n            \"}\\n\";\n\n        //Calculate lights\n        if (properties.LIGHTS) {\n            shader += \"vec3 ambient   = vec3(0.0, 0.0, 0.0);\\n\";\n            shader += \"vec3 diffuse   = vec3(0.0, 0.0, 0.0);\\n\";\n            shader += \"vec3 specular  = vec3(0.0, 0.0, 0.0);\\n\";\n            shader += \"vec3 eye;\\n\";\n            shader += \"if ( isOrthoView > 0.0 ) {\\n\";\n            shader += \"    eye = vec3(0.0, 0.0, 1.0);\\n\";\n            shader += \"} else {\\n\";\n            shader += \"    eye = -v_eye.xyz;\\n\";\n            shader += \"}\\n\";\n\n            //divide glTF shininess by 128 since it is provided premultiplied\n            shader += \"float _shininess = shininess * 0.0078125;\\n\";\n            shader += \"vec3 ads;\\n\";\n\n            for(var l=0; l<properties.LIGHTS; l++) {\n                var lightCol = \"light\"+l+\"_Color\";\n                shader += \"ads = lighting(light\"+l+\"_Type, \" +\n                    \"light\"+l+\"_Location, \" +\n                    \"light\"+l+\"_Direction, \" +\n                    lightCol + \", \" +\n                    \"light\"+l+\"_Attenuation, \" +\n                    \"light\"+l+\"_Radius, \" +\n                    \"light\"+l+\"_Intensity, \" +\n                    \"light\"+l+\"_AmbientIntensity, \" +\n                    \"light\"+l+\"_BeamWidth, \" +\n                    \"light\"+l+\"_CutOffAngle, \" +\n                    \"v_normal, eye, _shininess, ambientIntensity);\\n\";\n                shader += \"ambient  += \" + lightCol + \" * ads.r;\\n\" +\n                    \"diffuse  += \" + lightCol + \" * ads.g;\\n\" +\n                    \"specular += \" + lightCol + \" * ads.b;\\n\";\n            }\n\n            shader += \"ambient = max(ambient, 0.0);\\n\";\n            shader += \"diffuse = max(diffuse, 0.0);\\n\";\n            shader += \"specular = max(specular, 0.0);\\n\";\n\n            shader += \"color.rgb = (_emission.rgb + max(ambient + diffuse, 0.0) * color.rgb + specular*_specularColor.rgb);\\n\";\n        }\n\n        shader += \"gl_FragColor = vec4(color.rgb, transparency);\\n\"+\n    \"}\";\n\n    var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n    gl.shaderSource(fragmentShader, shader);\n    gl.compileShader(fragmentShader);\n\n    if(!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)){\n        x3dom.debug.logError(\"[KHRMaterialCommonsShader] FragmentShader \" + gl.getShaderInfoLog(fragmentShader));\n    }\n\n    return fragmentShader;\n};\n\n/**\n * Generate the final ShadowShader program\n */\nx3dom.shader.SSAOShader = function(gl)\n{\n\tthis.program = gl.createProgram();\n\t\n\tvar vertexShader \t= this.generateVertexShader(gl);\n\tvar fragmentShader \t= this.generateFragmentShader(gl);\n\t\n\tgl.attachShader(this.program, vertexShader);\n    gl.attachShader(this.program, fragmentShader);\n    \n    // optional, but position should be at location 0 for performance reasons\n    gl.bindAttribLocation(this.program, 0, \"position\");\n    \n\tgl.linkProgram(this.program);\n\treturn this.program;\n};\n\n/**\n * Generate the vertex shader\n */\nx3dom.shader.SSAOShader.prototype.generateVertexShader = function(gl)\n{\n\tvar shader = \t\"attribute vec3 position;\\n\" +\n\t\t\t\t\t\"varying vec2 depthTexCoord;\\n\" +\n\t\t\t\t\t\"varying vec2 randomTexCoord;\\n\"+\n\t\t\t\t\t\"uniform vec2 randomTextureTilingFactor;\\n\"+\n\t\t\t\t\t\"\\n\" +\n\t\t\t\t\t\"void main(void) {\\n\" +\n\t\t\t\t\t\"    vec2 texCoord = (position.xy + 1.0) * 0.5;\\n\" +\n\t\t\t\t\t\"    depthTexCoord = texCoord;\\n\" +\n\t\t\t\t\t\"\t randomTexCoord = randomTextureTilingFactor*texCoord;\\n\"+\n\t\t\t\t\t\"    gl_Position = vec4(position.xy, 0.0, 1.0);\\n\" +\n\t\t\t\t\t\"}\\n\";\n\n\tvar vertexShader = gl.createShader(gl.VERTEX_SHADER);\n\tgl.shaderSource(vertexShader, shader);\n    gl.compileShader(vertexShader);\n\t\t\n\tif(!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)){\n\t\tx3dom.debug.logError(\"[SSAOShader] VertexShader \" + gl.getShaderInfoLog(vertexShader));\t\t\n\t}\n\t\n\treturn vertexShader;\n};\n\n/**\n * Returns the code for a function \"getDepth(vec2 depthTexCoord)\" that returns the linear depth.\n * It also introduces two uniform floats depthReconstructionConstantA and depthReconstructionConstantB,\n * which are needed for the depth reconstruction.\n */\nx3dom.shader.SSAOShader.depthReconsructionFunctionCode = function()\n{\n\tvar code = \t\"uniform float depthReconstructionConstantA;\\n\"+\n\t\t\t\t\"uniform float depthReconstructionConstantB;\\n\";\n\tif (!x3dom.caps.FP_TEXTURES || x3dom.caps.MOBILE) \n\t\tcode += \tx3dom.shader.rgbaPacking();\n\t\t\n\tcode+= \t\"float getDepth(vec2 depthTexCoord) {\\n\"+\n\t\t\t\t\"    vec4 col = texture2D(depthTexture, depthTexCoord);\\n\"+\n\t\t\t\t\"    float d;\\n\";\n\t\n\tif (!x3dom.caps.FP_TEXTURES || x3dom.caps.MOBILE){\n\t\tcode+=\"    d = unpackDepth(col);\\n\";\n\t} else {\n\t\tcode+=\"    d = col.b;\\n\"\n\t}\n\tcode+=    \"    return depthReconstructionConstantB/(depthReconstructionConstantA+d);\\n\";\n\tcode+=\t\"}\\n\";\n\treturn code;\n}\n\n/**\n * Generate the fragment shader\n */\nx3dom.shader.SSAOShader.prototype.generateFragmentShader = function(gl)\n{\n  var shader = \t\"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n\";\n  shader += \t\"precision highp float;\\n\";\n  shader += \t\"#else\\n\";\n  shader += \t\" precision mediump float;\\n\";\n  shader += \t\"#endif\\n\\n\";\n\n\tshader += \t\"uniform sampler2D depthTexture;\\n\" +\n\t\t\t\t\"uniform sampler2D randomTexture;\\n\"+\n\t\t\t\t\"uniform float nearPlane;\\n\"+\n\t\t\t\t\"uniform float farPlane;\\n\"+\n\t\t\t\t\"uniform float radius;\\n\"+\n\t\t\t\t\"uniform float depthBufferEpsilon;\\n\"+\n\t\t\t\t\"uniform vec3 samples[16];\\n\"+\n\t\t\t\t\"varying vec2 depthTexCoord;\\n\" +\n\t\t\t\t\"varying vec2 randomTexCoord;\\n\";\n\n\tshader += \tx3dom.shader.SSAOShader.depthReconsructionFunctionCode();\n\t\t\n\tshader+=\t\"void main(void) {\\n\" +\n\t\t\t\t\"    float referenceDepth = getDepth(depthTexCoord);\\n\" +\n\t\t\t\t\"    if(referenceDepth == 1.0)\\n\"+ //background\n                \"    {\\n\"+\n                \"        gl_FragColor = vec4(1.0,1.0,1.0, 1.0);\\n\"+\n                \"        return;\\n\"+\n                \"    }\\n\"+\n\t\t\t\t\"    int numOcclusions = 0;\\n\"+\n\t\t\t\t\"    for(int i = 0; i<16; ++i){\\n\"+\n\t\t\t\t\"        float scale  = 1.0/referenceDepth;\\n\"+\n\t\t\t\t\"        vec3 samplepos = reflect(samples[i],texture2D(randomTexture,randomTexCoord).xyz*2.0-vec3(1.0,1.0,1.0));\\n\"+\n\t\t\t\t\"        float sampleDepth = getDepth(depthTexCoord+samplepos.xy*scale*radius);\\n\"+\n\t\t\t\t\"        //if(abs(sampleDepth-referenceDepth)<=radius*(1.0/nearPlane))\\n\"+ //leads to bright halos\n\t\t\t\t\"        if( sampleDepth < referenceDepth-depthBufferEpsilon) {\\n\"+\n\t\t\t\t\"            ++numOcclusions;\\n\"+\n\t\t\t\t\"        }\\n\"+\n\t\t\t\t\"    }\\n\"+\n\t\t\t\t\"    float r = 1.0-float(numOcclusions)/16.0;\\n\"+\n\t\t\t\t\"    r*=2.0;\\n\"+\n\t\t\t\t\"    gl_FragColor = vec4(r,r,r, 1.0);\\n\" +\n\t\t\t\t\"}\\n\";\n\n    var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n\tgl.shaderSource(fragmentShader, shader);\n    gl.compileShader(fragmentShader);\n\t\t\n\tif(!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)){\n\t\tx3dom.debug.logError(\"[SSAOhader] FragmentShader \" + gl.getShaderInfoLog(fragmentShader));\t\t\n\t}\n\t\n\treturn fragmentShader;\n};\n\n\n/**\n * Generate the final ShadowShader program\n */\nx3dom.shader.SSAOBlurShader = function(gl)\n{\n\tthis.program = gl.createProgram();\n\t\n\tvar vertexShader \t= this.generateVertexShader(gl);\n\tvar fragmentShader \t= this.generateFragmentShader(gl);\n\t\n\tgl.attachShader(this.program, vertexShader);\n    gl.attachShader(this.program, fragmentShader);\n    \n    // optional, but position should be at location 0 for performance reasons\n    gl.bindAttribLocation(this.program, 0, \"position\");\n\n    gl.linkProgram(this.program);\n\treturn this.program;\n};\n\n/**\n * Generate the vertex shader\n */\nx3dom.shader.SSAOBlurShader.prototype.generateVertexShader = function(gl)\n{\n\tvar shader = \t\"attribute vec3 position;\\n\" +\n\t\t\t\t\t\"varying vec2 fragTexCoord;\\n\" +\n\t\t\t\t\t\"\\n\" +\n\t\t\t\t\t\"void main(void) {\\n\" +\n\t\t\t\t\t\"    vec2 texCoord = (position.xy + 1.0) * 0.5;\\n\" +\n\t\t\t\t\t\"    fragTexCoord = texCoord;\\n\" +\n\t\t\t\t\t\"    gl_Position = vec4(position.xy, 0.0, 1.0);\\n\" +\n\t\t\t\t\t\"}\\n\";\n\n\tvar vertexShader = gl.createShader(gl.VERTEX_SHADER);\n\tgl.shaderSource(vertexShader, shader);\n    gl.compileShader(vertexShader);\n\t\t\n\tif(!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)){\n\t\tx3dom.debug.logError(\"[SSAOShader] VertexShader \" + gl.getShaderInfoLog(vertexShader));\t\t\n\t}\n\t\n\treturn vertexShader;\n};\n\n/**\n * Generate the fragment shader\n */\nx3dom.shader.SSAOBlurShader.prototype.generateFragmentShader = function(gl)\n{\n  var shader = \t\"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n\";\n\t  shader += \"precision highp float;\\n\";\n\t  shader += \"#else\\n\";\n\t  shader += \" precision mediump float;\\n\";\n\t  shader += \"#endif\\n\\n\";\n  \n\n\tshader += \t\"uniform sampler2D SSAOTexture;\\n\" +\n\t\t\t\t\"uniform sampler2D depthTexture;\\n\" +\n\t\t\t\t\"uniform float nearPlane;\\n\"+\n\t\t\t\t\"uniform float farPlane;\\n\"+\n\t\t\t\t\"uniform float amount;\\n\"+\n\t\t\t\t\"uniform vec2 pixelSize;\\n\"+\n\t\t\t\t\"uniform float depthThreshold;\\n\"+\n\t\t\t\t\"varying vec2 fragTexCoord;\\n\";\n\n\n\tshader += \tx3dom.shader.SSAOShader.depthReconsructionFunctionCode();\n\n\tshader+=\"void main(void) {\\n\" +\n\t\t\t\"    float sum = 0.0;\\n\"+\n\t\t\t\"    float numSamples = 0.0;\\n\"+\n\t\t\t\"    float referenceDepth = getDepth(fragTexCoord);\\n\"+\n\t\t\t\"    for(int i = -2; i<2;i++){\\n\"+\n\t\t\t\"        for(int j = -2; j<2;j++){\\n\"+\n\t\t\t\"            vec2 sampleTexCoord = fragTexCoord+vec2(pixelSize.x*float(i),pixelSize.y*float(j));\\n\"+\n\t\t\t\"            if(abs(referenceDepth - getDepth(sampleTexCoord))<depthThreshold){\\n\"+\n\t\t\t\"                sum+= texture2D(SSAOTexture,sampleTexCoord).r;\\n\"+\n\t\t\t\"                numSamples++;\\n\"+\n\t\t\t\"    }}}\\n\"+\n\t\t\t\"    float intensity = mix(1.0,sum/numSamples,amount);\\n\"+\n\t\t\t\"    gl_FragColor = vec4(intensity,intensity,intensity,1.0);\\n\"+\n\t\t\t\"}\\n\";\n\n    var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n\tgl.shaderSource(fragmentShader, shader);\n    gl.compileShader(fragmentShader);\n\t\t\n\tif(!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)){\n\t\tx3dom.debug.logError(\"[SSAOhader] FragmentShader \" + gl.getShaderInfoLog(fragmentShader));\t\t\n\t}\n\t\n\treturn fragmentShader;\n};\n\n\nx3dom.shader.FRAG_COLOR = \"x3dom_fragColor\";\n\nx3dom.shader.convertVertexShader = function ( shader )\n{\n    //Converts all \"attribute\" to \"in\"\n    shader = shader.replace(/attribute/g, \"in\");\n\n    //Converts all \"varying\" to \"out\"\n    shader = shader.replace(/varying/g, \"out\");\n\n    //Converts all \"texture2D\" to \"texture\"\n    shader = shader.replace(/texture2D/g, \"texture\");\n\n    return \"#version 300 es\\n\" + shader;\n}\n\nx3dom.shader.convertFragmentShader = function ( shader )\n{\n    shader = shader.replace(/varying/g, \"in\");\n\n    shader = shader.replace(/textureCubeLodEXT/g, \"textureLod\");\n\n    shader = shader.replace(/texture2D|textureCube/g, \"texture\");\n\n    shader = shader.replace(/\\/\\/@insertFragColor/g, \"out vec4 \" + x3dom.shader.FRAG_COLOR + \";\\n\");\n\n    shader = shader.replace(/gl_FragColor/g, x3dom.shader.FRAG_COLOR);\n\n    return \"#version 300 es\\n\" + shader;\n}\n/**\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * Philip Taylor: http://philip.html5.org\n */\n\nx3dom.SSAO = {};\n\n/**\n * Is Enabled?\n *\n * @param scene\n * @returns {{}|x3dom.fields.SFBool|string}\n */\nx3dom.SSAO.isEnabled = function(scene) {\n    return scene.getEnvironment()._vf.SSAO\n};\n\n/**\n * Reinitializes the shaders if they were not created yet or need to be updated.\n *\n * @param gl\n */\nx3dom.SSAO.reinitializeShadersIfNecessary = function(gl) {\n    if (x3dom.SSAO.shaderProgram === undefined) {\n        x3dom.SSAO.shaderProgram = x3dom.Utils.wrapProgram(gl, new x3dom.shader.SSAOShader(gl), \"ssao\");\n    }\n    if (x3dom.SSAO.blurShaderProgram === undefined) {\n        x3dom.SSAO.blurShaderProgram = x3dom.Utils.wrapProgram(gl, new x3dom.shader.SSAOBlurShader(gl), \"ssao-blur\");\n    }\n};\n\n/**\n * Reinitializes the random Texture if it was not created yet or if it's size changed.\n *\n * @param gl\n * @param scene\n */\nx3dom.SSAO.reinitializeRandomTextureIfNecessary = function(gl, scene) {\n    var sizeHasChanged = scene.getEnvironment()._vf.SSAOrandomTextureSize != x3dom.SSAO.currentRandomTextureSize;\n\n    if (x3dom.SSAO.randomTexture === undefined) {\n        // create random texture\n        x3dom.SSAO.randomTexture = gl.createTexture();\n    }\n\n    if (x3dom.SSAO.randomTexture === undefined || sizeHasChanged) {\n        gl.bindTexture(gl.TEXTURE_2D, x3dom.SSAO.randomTexture);\n        var rTexSize = x3dom.SSAO.currentRandomTextureSize = scene.getEnvironment()._vf.SSAOrandomTextureSize;\n        var randomImageBuffer = new ArrayBuffer(rTexSize * rTexSize * 4); //rTexSize^2 pixels with 4 bytes each\n        var randomImageView = new Uint8Array(randomImageBuffer);\n        // fill the image with random unit Vectors in the z-y-plane:\n        for (var i = 0; i < rTexSize * rTexSize; ++i) {\n            var x = Math.random() * 2.0 - 1.0;\n            var y = Math.random() * 2.0 - 1.0;\n            var z = 0;\n            var length = Math.sqrt(x * x + y * y + z * z);\n            x /= length;\n            y /= length;\n            randomImageView[4 * i] = (x + 1.0) * 0.5 * 255.0;\n            randomImageView[4 * i + 1] = (y + 1.0) * 0.5 * 255.0;\n            randomImageView[4 * i + 2] = (z + 1.0) * 0.5 * 255.0;\n            randomImageView[4 * i + 3] = 255;\n        }\n        gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, rTexSize, rTexSize, 0, gl.RGBA, gl.UNSIGNED_BYTE, randomImageView);\n        gl.bindTexture(gl.TEXTURE_2D, null);\n    }\n};\n\n/**\n * Reinitializes the FBO render target for the SSAO if it wasn't created yet or if the canvas size changed.\n *\n * @param gl\n * @param canvas\n */\nx3dom.SSAO.reinitializeFBOIfNecessary = function(gl, canvas) {\n    var dimensionsHaveChanged =\n        x3dom.SSAO.currentFBOWidth != canvas.width ||\n        x3dom.SSAO.currentFBOHeight != canvas.height;\n\n    if (x3dom.SSAO.fbo === undefined || dimensionsHaveChanged) {\n        x3dom.SSAO.currentFBOWidth = canvas.width;\n        x3dom.SSAO.currentFBOHeight = canvas.height;\n        var oldfbo = gl.getParameter(gl.FRAMEBUFFER_BINDING);\n        if (x3dom.SSAO.fbo === undefined) {\n            // create framebuffer\n            x3dom.SSAO.fbo = gl.createFramebuffer();\n        }\n        gl.bindFramebuffer(gl.FRAMEBUFFER, x3dom.SSAO.fbo);\n        if (x3dom.SSAO.fbotex === undefined) {\n            // create render texture\n            x3dom.SSAO.fbotex = gl.createTexture();\n        }\n        gl.bindTexture(gl.TEXTURE_2D, x3dom.SSAO.fbotex);\n        gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, x3dom.SSAO.currentFBOWidth,\n            x3dom.SSAO.currentFBOHeight, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n        gl.bindTexture(gl.TEXTURE_2D, null);\n        gl.framebufferTexture2D(gl.FRAMEBUFFER,\n            gl.COLOR_ATTACHMENT0,\n            gl.TEXTURE_2D,\n            x3dom.SSAO.fbotex,\n            0);\n        gl.bindFramebuffer(gl.FRAMEBUFFER, oldfbo);\n    }\n};\n\n/*\n * Renders a sparsely sampled Screen-Space Ambient Occlusion Factor.\n *\n * @param stateManager - x3dom webgl stateManager\n * @param gl - WebGL context\n * @param scene - Scene Node\n * @param tex - depth texture\n * @param canvas - Canvas the scene is rendered on (needed for dimensions)\n * @param fbo - FrameBufferObject handle that should be used as a target (null to use curent fbo)\n */\nx3dom.SSAO.render = function(stateManager, gl, scene, tex, canvas, fbo) {\n    // save previous fbo\n    var oldfbo = gl.getParameter(gl.FRAMEBUFFER_BINDING);\n    if (fbo != null) {\n        gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);\n    }\n\n    stateManager.frontFace(gl.CCW);\n    stateManager.disable(gl.CULL_FACE);\n    stateManager.disable(gl.DEPTH_TEST);\n\n    var sp = x3dom.SSAO.shaderProgram;\n\n    stateManager.useProgram(sp);\n\n    // set up uniforms\n    sp.depthTexture = 0;\n    sp.randomTexture = 1;\n    sp.radius = scene.getEnvironment()._vf.SSAOradius;\n    sp.randomTextureTilingFactor = [canvas.width / x3dom.SSAO.currentRandomTextureSize, canvas.height / x3dom.SSAO.currentRandomTextureSize];\n\n    var viewpoint = scene.getViewpoint();\n    var nearPlane = viewpoint.getNear();\n    var farPlane = viewpoint.getFar();\n    sp.nearPlane = nearPlane;\n    sp.farPlane = farPlane;\n    sp.depthReconstructionConstantA = (farPlane + nearPlane) / (nearPlane - farPlane);\n    sp.depthReconstructionConstantB = (2.0 * farPlane * nearPlane) / (nearPlane - farPlane);\n    sp.depthBufferEpsilon = 0.0001 * (farPlane - nearPlane);\n\n    // 16 samples with a well distributed pseudo random opposing-pairs sampling pattern:\n    sp.samples = [\n        0.03800223814729654, 0.10441029119843426, -0.04479934806797181,\n        -0.03800223814729654, -0.10441029119843426, 0.04479934806797181,\n        -0.17023209847088397, 0.1428416910414532, 0.6154407640895228,\n        0.17023209847088397, -0.1428416910414532, -0.6154407640895228,\n        -0.288675134594813, -0.16666666666666646, -0.3774214123135722,\n        0.288675134594813, 0.16666666666666646, 0.3774214123135722,\n        0.07717696785196887, -0.43769233467209245, -0.5201284112706428,\n        -0.07717696785196887, 0.43769233467209245, 0.5201284112706428,\n        0.5471154183401156, -0.09647120981496134, -0.15886420745887797,\n        -0.5471154183401156, 0.09647120981496134, 0.15886420745887797,\n        0.3333333333333342, 0.5773502691896253, -0.8012446019636266,\n        -0.3333333333333342, -0.5773502691896253, 0.8012446019636266,\n        -0.49994591864508653, 0.5958123446480936, -0.15385106176844343,\n        0.49994591864508653, -0.5958123446480936, 0.15385106176844343,\n        -0.8352823295874743, -0.3040179051783715, 0.7825440557226517,\n        0.8352823295874743, 0.3040179051783715, -0.7825440557226517\n    ];\n\n    if (!sp.tex) {\n        sp.tex = 0;\n    }\n\n    // depth texture\n    gl.activeTexture(gl.TEXTURE0);\n    gl.bindTexture(gl.TEXTURE_2D, tex);\n\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\n    // random texture:\n    gl.activeTexture(gl.TEXTURE1);\n    gl.bindTexture(gl.TEXTURE_2D, x3dom.SSAO.randomTexture);\n\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);\n\n    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, scene._fgnd._webgl.buffers[x3dom.BUFFER_IDX.INDEX]);\n    gl.bindBuffer(gl.ARRAY_BUFFER, scene._fgnd._webgl.buffers[x3dom.BUFFER_IDX.POSITION]);\n    gl.vertexAttribPointer(sp.position, 3, gl.FLOAT, false, 0, 0);\n    gl.enableVertexAttribArray(sp.position);\n\n    gl.drawElements(scene._fgnd._webgl.primType, scene._fgnd._webgl.indexes.length, gl.UNSIGNED_SHORT, 0);\n\n    gl.disableVertexAttribArray(sp.position);\n\n    gl.activeTexture(gl.TEXTURE0);\n    gl.bindTexture(gl.TEXTURE_2D, null);\n    gl.activeTexture(gl.TEXTURE1);\n    gl.bindTexture(gl.TEXTURE_2D, null);\n\n    // restore prevoius fbo\n    if (fbo != null) {\n        gl.bindFramebuffer(gl.FRAMEBUFFER, oldfbo);\n    }\n};\n\n/**\n * Applies a depth-aware averaging filter.\n *\n * @param stateManager - x3dom webgl stateManager\n * @param gl - WebGL context\n * @param scene - Scene Node\n * @param ssaoTexture - texture that contains the SSAO factor\n * @param depthTexture - depth texture\n * @param canvas - Canvas the scene is rendered on (needed for dimensions)\n * @param fbo - FrameBufferObject handle that should be used as a target (null to use curent fbo)\n */\nx3dom.SSAO.blur = function(stateManager,gl,scene,ssaoTexture,depthTexture,canvas,fbo) {\n    // save previous fbo\n    var oldfbo = gl.getParameter(gl.FRAMEBUFFER_BINDING);\n    if (fbo != null) {\n        gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);\n    }\n\n    stateManager.frontFace(gl.CCW);\n    stateManager.disable(gl.CULL_FACE);\n    stateManager.disable(gl.DEPTH_TEST);\n\n    var sp = x3dom.SSAO.blurShaderProgram;\n\n    stateManager.useProgram(sp);\n\n    sp.SSAOTexture = 0;\n    sp.depthTexture = 1;\n\n    sp.depthThreshold = scene.getEnvironment()._vf.SSAOblurDepthTreshold;\n\n    var viewpoint = scene.getViewpoint();\n    var nearPlane = viewpoint.getNear();\n    var farPlane = viewpoint.getFar();\n    sp.nearPlane = nearPlane;\n    sp.farPlane = farPlane;\n    sp.depthReconstructionConstantA = (farPlane + nearPlane) / (nearPlane - farPlane);\n    sp.depthReconstructionConstantB = (2.0 * farPlane * nearPlane) / (nearPlane - farPlane);\n    sp.pixelSize = [1.0 / canvas.width, 1.0 / canvas.height];\n    sp.amount = scene.getEnvironment()._vf.SSAOamount;\n\n    // ssao texture\n    gl.activeTexture(gl.TEXTURE0);\n    gl.bindTexture(gl.TEXTURE_2D, ssaoTexture);\n\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\n    // depth texture\n    gl.activeTexture(gl.TEXTURE1);\n    gl.bindTexture(gl.TEXTURE_2D, depthTexture);\n\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\n    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, scene._fgnd._webgl.buffers[x3dom.BUFFER_IDX.INDEX]);\n    gl.bindBuffer(gl.ARRAY_BUFFER, scene._fgnd._webgl.buffers[x3dom.BUFFER_IDX.POSITION]);\n    gl.vertexAttribPointer(sp.position, 3, gl.FLOAT, false, 0, 0);\n    gl.enableVertexAttribArray(sp.position);\n\n    gl.drawElements(scene._fgnd._webgl.primType, scene._fgnd._webgl.indexes.length, gl.UNSIGNED_SHORT, 0);\n\n    gl.disableVertexAttribArray(sp.position);\n\n    gl.activeTexture(gl.TEXTURE0);\n    gl.bindTexture(gl.TEXTURE_2D, null);\n    gl.activeTexture(gl.TEXTURE1);\n    gl.bindTexture(gl.TEXTURE_2D, null);\n\n    // restore previous fbo\n    if (fbo != null) {\n        gl.bindFramebuffer(gl.FRAMEBUFFER, oldfbo);\n    }\n};\n\n/**\n * Renders Screen-Space Ambeint Occlusion multiplicatively on top of the scene.\n *\n * @param stateManager - state manager for the WebGL context\n * @param gl - WebGL context\n * @param scene - current scene\n * @param canvas - canvas that the scene is rendered to\n */\nx3dom.SSAO.renderSSAO = function(stateManager, gl, scene, canvas) {\n    // set up resources if they are non-existent or if they are outdated:\n    this.reinitializeShadersIfNecessary(gl);\n    this.reinitializeRandomTextureIfNecessary(gl, scene);\n    this.reinitializeFBOIfNecessary(gl, canvas);\n\n    stateManager.viewport(0, 0, canvas.width, canvas.height);\n\n    // render SSAO into fbo\n    this.render(stateManager, gl, scene, scene._webgl.fboScene.tex, canvas, x3dom.SSAO.fbo);\n    // render blurred SSAO multiplicatively\n    gl.enable(gl.BLEND);\n    gl.blendFunc(gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA);\n    this.blur(stateManager, gl, scene, x3dom.SSAO.fbotex, scene._webgl.fboScene.tex, canvas, null);\n    gl.disable(gl.BLEND);\n};\n\n/**\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * Philip Taylor: http://philip.html5.org\n */\n\nx3dom.gfx_webgl = (function() {\n    \"use strict\";\n\n    /**\n     * Context constructor\n     *\n     * @param ctx3d\n     * @param canvas\n     * @param name\n     * @param x3dElem\n     * @constructor\n     */\n    function Context(ctx3d, canvas, name, x3dElem) {\n        this.ctx3d = ctx3d;\n        this.canvas = canvas;\n        this.name = name;\n        this.x3dElem = x3dElem;\n        this.IG_PositionBuffer = null;\n        this.cache = new x3dom.Cache();\n        this.stateManager = new x3dom.StateManager(ctx3d);\n        this.VRMode = 1;\n        this.vrFrameData = null;\n\n        this.BUFFER_IDX =\n            {\n                INDEX: 0,\n                POSITION: 1,\n                NORMAL: 2,\n                TEXCOORD: 3,\n                TEXCOORD_0 : 3,\n                COLOR: 4,\n                TANGENT: 6,\n                BITANGENT: 7,\n                TEXCOORD_1: 8,\n                ID: 9\n            };\n    }\n\n    /**\n     * Return context name\n     *\n     * @returns {*}\n     */\n    Context.prototype.getName = function() {\n        return this.name;\n    };\n\n    /**\n     * Setup the 3D context and init some things\n     *\n     * @param canvas\n     * @param forbidMobileShaders\n     * @param forceMobileShaders\n     * @param tryWebGL2\n     * @param x3dElem\n     *\n     * @returns {*}\n     */\n    function setupContext(canvas, forbidMobileShaders, forceMobileShaders, tryWebGL2, x3dElem) {\n        var validContextNames = ['webgl2', 'webgl', 'experimental-webgl', 'moz-webgl', 'webkit-3d'];\n\n        if (tryWebGL2) {\n            validContextNames = ['webgl2', 'experimental-webgl2'].concat(validContextNames);\n        }\n\n        var isAppleDevice   = (/mac|ip(hone|od|ad)/i).test(navigator.platform);\n        var isSafariBrowser = (/safari/i).test(navigator.userAgent);\n        \n        //Remove WebGL2 Support for Apple devices\n        if(isAppleDevice)\n        {\n            validContextNames.splice(0, 1);\n        }\n\n        var ctx = null;\n\n        // FIXME: this is an ugly hack, don't look for elements like this\n        // (e.g., Bindable nodes may only exist in backend etc.)\n        var envNodes = x3dElem.getElementsByTagName(\"Environment\");\n        var ssaoEnabled = (envNodes && envNodes[0] && envNodes[0].hasAttribute(\"SSAO\") &&\n            envNodes[0].getAttribute(\"SSAO\").toLowerCase() === 'true') ? true : false;\n\n        // Context creation params\n        var ctxAttribs = {\n            alpha: true,\n            depth: true,\n            stencil: true,\n            antialias: !ssaoEnabled,\n            premultipliedAlpha: false,\n            preserveDrawingBuffer: true,\n            failIfMajorPerformanceCaveat: true\n        };\n\n        for (var i = 0; i < validContextNames.length; i++) {\n            try {\n\n                x3dom.caps.RENDERMODE = \"HARDWARE (\" + validContextNames[i] + \")\";\n\n                ctx = canvas.getContext(validContextNames[i], ctxAttribs);\n\n                // If context creation fails, retry the creation with failIfMajorPerformanceCaveat = false\n                if (!ctx) {\n                    x3dom.caps.RENDERMODE = \"SOFTWARE\";\n                    ctxAttribs.failIfMajorPerformanceCaveat = false;\n                    ctx = canvas.getContext(validContextNames[i], ctxAttribs);\n                    ctxAttribs.failIfMajorPerformanceCaveat = true;\n                }\n\n                if (ctx) {\n                    var newCtx = new Context(ctx, canvas, 'webgl', x3dElem);\n\n                    try {\n                        // Save CAPS\n                        x3dom.caps.VENDOR = ctx.getParameter(ctx.VENDOR);\n                        x3dom.caps.VERSION = ctx.getParameter(ctx.VERSION);\n                        x3dom.caps.WEBGL_VERSION = (x3dom.caps.VERSION.indexOf(\"WebGL 2.0\") === -1) ? 1 : 2\n                        x3dom.caps.RENDERER = ctx.getParameter(ctx.RENDERER);\n                        x3dom.caps.SHADING_LANGUAGE_VERSION = ctx.getParameter(ctx.SHADING_LANGUAGE_VERSION);\n                        x3dom.caps.RED_BITS = ctx.getParameter(ctx.RED_BITS);\n                        x3dom.caps.GREEN_BITS = ctx.getParameter(ctx.GREEN_BITS);\n                        x3dom.caps.BLUE_BITS = ctx.getParameter(ctx.BLUE_BITS);\n                        x3dom.caps.ALPHA_BITS = ctx.getParameter(ctx.ALPHA_BITS);\n                        x3dom.caps.DEPTH_BITS = ctx.getParameter(ctx.DEPTH_BITS);\n                        x3dom.caps.MAX_VERTEX_ATTRIBS = ctx.getParameter(ctx.MAX_VERTEX_ATTRIBS);\n                        x3dom.caps.MAX_VERTEX_TEXTURE_IMAGE_UNITS = ctx.getParameter(ctx.MAX_VERTEX_TEXTURE_IMAGE_UNITS);\n                        x3dom.caps.MAX_VARYING_VECTORS = ctx.getParameter(ctx.MAX_VARYING_VECTORS);\n                        x3dom.caps.MAX_VERTEX_UNIFORM_VECTORS = ctx.getParameter(ctx.MAX_VERTEX_UNIFORM_VECTORS);\n                        x3dom.caps.MAX_COMBINED_TEXTURE_IMAGE_UNITS = ctx.getParameter(ctx.MAX_COMBINED_TEXTURE_IMAGE_UNITS);\n                        x3dom.caps.MAX_TEXTURE_SIZE = ctx.getParameter(ctx.MAX_TEXTURE_SIZE);\n                        x3dom.caps.MAX_TEXTURE_IMAGE_UNITS = ctx.getParameter(ctx.MAX_TEXTURE_IMAGE_UNITS);\n                        x3dom.caps.MAX_CUBE_MAP_TEXTURE_SIZE = ctx.getParameter(ctx.MAX_CUBE_MAP_TEXTURE_SIZE);\n                        x3dom.caps.COMPRESSED_TEXTURE_FORMATS = ctx.getParameter(ctx.COMPRESSED_TEXTURE_FORMATS);\n                        x3dom.caps.MAX_RENDERBUFFER_SIZE = ctx.getParameter(ctx.MAX_RENDERBUFFER_SIZE);\n                        x3dom.caps.MAX_VIEWPORT_DIMS = ctx.getParameter(ctx.MAX_VIEWPORT_DIMS);\n                        x3dom.caps.ALIASED_LINE_WIDTH_RANGE = ctx.getParameter(ctx.ALIASED_LINE_WIDTH_RANGE);\n                        x3dom.caps.ALIASED_POINT_SIZE_RANGE = ctx.getParameter(ctx.ALIASED_POINT_SIZE_RANGE);\n                        x3dom.caps.SAMPLES = ctx.getParameter(ctx.SAMPLES);\n                        x3dom.caps.COMPRESSED_TEXTURE = ctx.getExtension('WEBGL_compressed_texture_s3tc');\n                        x3dom.caps.INDEX_UINT = ctx.getExtension(\"OES_element_index_uint\");\n                        x3dom.caps.FP_TEXTURES = ctx.getExtension(\"OES_texture_float\");\n                        x3dom.caps.FPL_TEXTURES = ctx.getExtension(\"OES_texture_float_linear\");\n                        x3dom.caps.HFP_TEXTURES = ctx.getExtension(\"OES_texture_half_float\");\n                        x3dom.caps.COLOR_BUFFER_FLOAT = ctx.getExtension(\"WEBGL_color_buffer_float\");\n                        x3dom.caps.HFPL_TEXTURES = ctx.getExtension(\"OES_texture_half_float_linear\");\n                        x3dom.caps.STD_DERIVATIVES = ctx.getExtension(\"OES_standard_derivatives\");\n                        x3dom.caps.DRAW_BUFFERS = ctx.getExtension(\"WEBGL_draw_buffers\");\n                        x3dom.caps.DEPTH_TEXTURE = ctx.getExtension(\"WEBGL_depth_texture\");\n                        x3dom.caps.DEBUGRENDERINFO = ctx.getExtension(\"WEBGL_debug_renderer_info\");\n                        x3dom.caps.ANISOTROPIC = ctx.getExtension(\"EXT_texture_filter_anisotropic\");\n                        x3dom.caps.TEXTURE_LOD = ctx.getExtension(\"EXT_shader_texture_lod\");\n                        x3dom.caps.INSTANCED_ARRAYS = ctx.getExtension(\"ANGLE_instanced_arrays\");\n\n                        if (x3dom.caps.ANISOTROPIC) {\n                            x3dom.caps.MAX_ANISOTROPY = ctx.getParameter( x3dom.caps.ANISOTROPIC.MAX_TEXTURE_MAX_ANISOTROPY_EXT );\n                        }\n\n\n                        x3dom.caps.EXTENSIONS = ctx.getSupportedExtensions();\n\n                        // Enable/disable native webgl32 related caps\n                        if (x3dom.Utils.isWebGL2Enabled())\n                        {\n                            x3dom.caps.DEPTH_TEXTURE = null;\n                            x3dom.caps.INDEX_UINT = true\n                        }\n\n                        if (x3dom.caps.DEBUGRENDERINFO) {\n                            x3dom.caps.UNMASKED_RENDERER_WEBGL = ctx.getParameter(x3dom.caps.DEBUGRENDERINFO.UNMASKED_RENDERER_WEBGL);\n                            x3dom.caps.UNMASKED_VENDOR_WEBGL = ctx.getParameter(x3dom.caps.DEBUGRENDERINFO.UNMASKED_VENDOR_WEBGL);\n                        } else {\n                            x3dom.caps.UNMASKED_RENDERER_WEBGL = \"\";\n                            x3dom.caps.UNMASKED_VENDOR_WEBGL = \"\";\n                        }\n\n                        var extString = x3dom.caps.EXTENSIONS.toString().replace(/,/g, \", \");\n                        x3dom.debug.logInfo(validContextNames[i] + \" context found\\nVendor: \" + x3dom.caps.VENDOR +\n                            \" \" + x3dom.caps.UNMASKED_VENDOR_WEBGL + \", Renderer: \" + x3dom.caps.RENDERER +\n                            \" \" + x3dom.caps.UNMASKED_RENDERER_WEBGL + \", \" + \"Version: \" + x3dom.caps.VERSION + \", \" +\n                            \"ShadingLangV.: \" + x3dom.caps.SHADING_LANGUAGE_VERSION\n                            + \", MSAA samples: \" + x3dom.caps.SAMPLES + \"\\nExtensions: \" + extString);\n\n                        if (x3dom.caps.INDEX_UINT) {\n                            x3dom.Utils.maxIndexableCoords = 4294967295;\n                        }\n\n                        x3dom.caps.MOBILE = (function(a) {\n                            return (/android.+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|symbian|treo|up\\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a) || /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|e\\-|e\\/|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(di|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|xda(\\-|2|g)|yas\\-|your|zeto|zte\\-/i.test(a.substr(0, 4)))\n                        })(navigator.userAgent || navigator.vendor || window.opera);\n\n                        // explicitly disable for iPad and the like\n                        if (x3dom.caps.RENDERER.indexOf(\"PowerVR\") >= 0 ||\n                            navigator.appVersion.indexOf(\"Mobile\") > -1 ||\n                            // coarse guess to find out old SM 2.0 hardware (e.g. Intel):\n                            x3dom.caps.MAX_VARYING_VECTORS <= 8 ||\n                            x3dom.caps.MAX_VERTEX_TEXTURE_IMAGE_UNITS < 2) {\n                            x3dom.caps.MOBILE = true;\n                        }\n\n                        x3dom.caps.MOBILE = false;\n\n                        //Disable half float textures on apple devices\n                        if(isAppleDevice)\n                        {\n                            x3dom.caps.HFP_TEXTURES = false;\n                        }\n\n                        //Disable texture lod on safari browsers\n                        if(isSafariBrowser)\n                        {\n                            x3dom.caps.TEXTURE_LOD = false;\n                        }\n\n                        if (x3dom.caps.MOBILE) {\n                            if (forbidMobileShaders) {\n                                x3dom.caps.MOBILE = false;\n                                x3dom.debug.logWarning(\"Detected mobile graphics card! \" +\n                                    \"But being forced to desktop shaders which might not work!\");\n                            } else {\n                                x3dom.debug.logWarning(\"Detected mobile graphics card! \" +\n                                    \"Using low quality shaders without ImageGeometry support!\");\n                            }\n                        } else {\n                            if (forceMobileShaders) {\n                                x3dom.caps.MOBILE = true;\n                                x3dom.debug.logWarning(\"Detected desktop graphics card! \" +\n                                    \"But being forced to mobile shaders with lower quality!\");\n                            }\n                        }\n                    } catch (ex) {\n                        x3dom.debug.logWarning(\n                            \"Your browser probably supports an older WebGL version. \" +\n                            \"Please try the old mobile runtime instead:\\n\" +\n                            \"http://www.x3dom.org/x3dom/src_mobile/x3dom.js\");\n                        newCtx = null;\n                    }\n\n                    return newCtx;\n                }\n            } catch (e) {\n                x3dom.debug.logWarning(e);\n            }\n        }\n        return null;\n    }\n\n    /**\n     * Setup GL objects for given shape\n     *\n     * @param gl\n     * @param drawable\n     * @param viewarea\n     */\n    Context.prototype.setupShape = function(gl, drawable, viewarea) {\n        var q = 0, q6;\n        var textures, t;\n        var vertices, positionBuffer;\n        var texCoords, texCoordBuffer;\n        var tangents, tangentBuffer;\n        var binormals, binormalBuffer;\n        var indicesBuffer, indexArray;\n        var normals, normalBuffer;\n        var colors, colorBuffer;\n\n        var shape = drawable.shape;\n        var geoNode = shape._cf.geometry.node;\n\n        if (shape._webgl !== undefined) {\n            var needFullReInit = false;\n\n            // TODO: do same for texcoords etc.!\n            if (shape._dirty.colors === true &&\n                shape._webgl.shader.color === undefined && geoNode._mesh._colors[0].length) {\n                // required since otherwise shape._webgl.shader.color stays undefined\n                // and thus the wrong shader will be chosen although there are colors\n                needFullReInit = true;\n            }\n\n            // cleanup vertex buffer objects\n            if (needFullReInit && shape._cleanupGLObjects) {\n                shape._cleanupGLObjects(true, false);\n            }\n\n            // Check for dirty Textures\n            if (shape._dirty.texture === true) {\n                // Check for Texture add or remove\n                if (shape._webgl.texture.length != shape.getTextures().length) {\n                    // Delete old Textures\n                    for (t = 0; t < shape._webgl.texture.length; ++t) {\n                        shape._webgl.texture.pop();\n                    }\n\n                    // Generate new Textures\n                    textures = shape.getTextures();\n\n                    for (t = 0; t < textures.length; ++t) {\n                        shape._webgl.texture.push(new x3dom.Texture(gl, shape._nameSpace.doc, this.cache, textures[t]));\n                    }\n\n                    // Set dirty shader\n                    shape._dirty.shader = true;\n\n                    // Set dirty texture Coordinates\n                    if (shape._webgl.shader.texcoord === undefined)\n                        shape._dirty.texcoords = true;\n                } else {\n                    // If someone remove and append at the same time, texture count don't change\n                    // and we have to check if all nodes the same as before\n                    textures = shape.getTextures();\n\n                    for (t = 0; t < textures.length; ++t) {\n                        if (textures[t] === shape._webgl.texture[t].node) {\n                            // only update the texture\n                            shape._webgl.texture[t].update();\n                        } else {\n                            // Set texture to null for recreation\n                            shape._webgl.texture[t].texture = null;\n\n                            // Set new node\n                            shape._webgl.texture[t].node = textures[t];\n\n                            // Update new node\n                            shape._webgl.texture[t].update();\n                        }\n                    }\n                }\n                shape._dirty.texture = false;\n            }\n\n            // Check if we need a new shader\n            shape._webgl.shader = this.cache.getShaderByProperties(gl, shape, shape.getShaderProperties(viewarea));\n\n            if (!needFullReInit && shape._webgl.binaryGeometry == 0 && shape._webgl.bufferGeometry == 0) {\n                // THINKABOUTME: What about PopGeo & Co.?\n                for (q = 0; q < shape._webgl.positions.length; q++) {\n                    q6 = 6 * q;\n\n                    if (shape._dirty.positions == true || shape._dirty.indexes == true) {\n                        if (shape._webgl.shader.position !== undefined) {\n                            shape._webgl.indexes[q] = geoNode._mesh._indices[q];\n\n                            gl.deleteBuffer(shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.INDEX]);\n\n                            indicesBuffer = gl.createBuffer();\n                            shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.INDEX] = indicesBuffer;\n\n                            // explicitly check first positions array for consistency\n                            if (x3dom.caps.INDEX_UINT && (geoNode._mesh._positions[0].length / 3 > 65535)) {\n                                indexArray = new Uint32Array(shape._webgl.indexes[q]);\n                                shape._webgl.indexType = gl.UNSIGNED_INT;\n                            } else {\n                                indexArray = new Uint16Array(shape._webgl.indexes[q]);\n                                shape._webgl.indexType = gl.UNSIGNED_SHORT;\n                            }\n\n                            gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indicesBuffer);\n                            gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indexArray, gl.STATIC_DRAW);\n\n                            indexArray = null;\n\n                            // vertex positions\n                            shape._webgl.positions[q] = geoNode._mesh._positions[q];\n\n                            // TODO: don't delete VBO but use glMapBuffer() and DYNAMIC_DRAW\n                            gl.deleteBuffer(shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.POSITION]);\n\n                            positionBuffer = gl.createBuffer();\n                            shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.POSITION] = positionBuffer;\n\n                            gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);\n                            gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.INDEX]);\n\n                            vertices = new Float32Array(shape._webgl.positions[q]);\n\n                            gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);\n                            gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);\n\n                            gl.vertexAttribPointer(shape._webgl.shader.position,\n                                geoNode._mesh._numPosComponents,\n                                shape._webgl.coordType, false,\n                                shape._coordStrideOffset[0], shape._coordStrideOffset[1]);\n\n                            vertices = null;\n                        }\n\n                        shape._dirty.positions = false;\n                        shape._dirty.indexes = false;\n                    }\n\n                    if (shape._dirty.colors == true) {\n                        if (shape._webgl.shader.color !== undefined) {\n                            shape._webgl.colors[q] = geoNode._mesh._colors[q];\n\n                            gl.deleteBuffer(shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.COLOR]);\n\n                            colorBuffer = gl.createBuffer();\n                            shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.COLOR] = colorBuffer;\n\n                            colors = new Float32Array(shape._webgl.colors[q]);\n\n                            gl.bindBuffer(gl.ARRAY_BUFFER, colorBuffer);\n                            gl.bufferData(gl.ARRAY_BUFFER, colors, gl.STATIC_DRAW);\n\n                            gl.vertexAttribPointer(shape._webgl.shader.color,\n                                geoNode._mesh._numColComponents,\n                                shape._webgl.colorType, false,\n                                shape._colorStrideOffset[0], shape._colorStrideOffset[1]);\n\n                            colors = null;\n                        }\n\n                        shape._dirty.colors = false;\n                    }\n\n                    if (shape._dirty.normals == true) {\n                        if (shape._webgl.shader.normal !== undefined) {\n                            shape._webgl.normals[q] = geoNode._mesh._normals[q];\n\n                            gl.deleteBuffer(shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.NORMAL]);\n\n                            normalBuffer = gl.createBuffer();\n                            shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.NORMAL] = normalBuffer;\n\n                            normals = new Float32Array(shape._webgl.normals[q]);\n\n                            gl.bindBuffer(gl.ARRAY_BUFFER, normalBuffer);\n                            gl.bufferData(gl.ARRAY_BUFFER, normals, gl.STATIC_DRAW);\n\n                            gl.vertexAttribPointer(shape._webgl.shader.normal,\n                                geoNode._mesh._numNormComponents,\n                                shape._webgl.normalType, false,\n                                shape._normalStrideOffset[0], shape._normalStrideOffset[1]);\n\n                            normals = null;\n                        }\n\n                        shape._dirty.normals = false;\n                    }\n\n                    if (shape._dirty.texcoords == true) {\n                        if (shape._webgl.shader.texcoord !== undefined) {\n                            shape._webgl.texcoords[q] = geoNode._mesh._texCoords[q];\n\n                            gl.deleteBuffer(shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.TEXCOORD]);\n\n                            texCoordBuffer = gl.createBuffer();\n                            shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.TEXCOORD] = texCoordBuffer;\n\n                            texCoords = new Float32Array(shape._webgl.texcoords[q]);\n\n                            gl.bindBuffer(gl.ARRAY_BUFFER, texCoordBuffer);\n                            gl.bufferData(gl.ARRAY_BUFFER, texCoords, gl.STATIC_DRAW);\n\n                            gl.vertexAttribPointer(shape._webgl.shader.texCoord,\n                                geoNode._mesh._numTexComponents,\n                                shape._webgl.texCoordType, false,\n                                shape._texCoordStrideOffset[0], shape._texCoordStrideOffset[1]);\n\n                            texCoords = null;\n                        }\n\n                        shape._dirty.texcoords = false;\n                    }\n\n                    if (shape._dirty.specialAttribs == true) {\n                        if (shape._webgl.shader.particleSize !== undefined) {\n                            var szArr = geoNode._vf.size.toGL();\n\n                            if (szArr.length) {\n                                gl.deleteBuffer(shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.ID]);\n                                shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.ID] = gl.createBuffer();\n\n                                gl.bindBuffer(gl.ARRAY_BUFFER, shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.ID]);\n                                gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(szArr), gl.STATIC_DRAW);\n                            }\n\n                            shape._dirty.specialAttribs = false;\n                        }\n                        // Maybe other special attribs here, though e.g. AFAIK only BG (which not handled here) has ids.\n                    }\n                }\n            } else {\n                // TODO: does not yet work with shared objects\n                /*\n                var spOld = shape._webgl.shader;\n                if (shape._cleanupGLObjects && needFullReInit)\n                    shape._cleanupGLObjects(true, false);\n\n                // complete setup is sort of brute force, thus optimize!\n                x3dom.BinaryContainerLoader.setupBinGeo(shape, spOld, gl, viewarea, this);\n                shape.unsetGeoDirty();\n                */\n            }\n\n            if (shape._webgl.imageGeometry != 0) {\n                for (t = 0; t < shape._webgl.texture.length; ++t) {\n                    shape._webgl.texture[t].updateTexture();\n                }\n\n                geoNode.unsetGeoDirty();\n                shape.unsetGeoDirty();\n            }\n\n            if (!needFullReInit) {\n                // we're done\n                return;\n            }\n        }\n        else if (!(x3dom.isa(geoNode, x3dom.nodeTypes.Text) ||\n                   x3dom.isa(geoNode, x3dom.nodeTypes.BinaryGeometry) ||\n                   x3dom.isa(geoNode, x3dom.nodeTypes.PopGeometry)    ||\n                   x3dom.isa(geoNode, x3dom.nodeTypes.BufferGeometry)||\n                   x3dom.isa(geoNode, x3dom.nodeTypes.ExternalGeometry)||\n                   x3dom.isa(shape, x3dom.nodeTypes.ExternalShape)) &&\n                  (!geoNode || geoNode._mesh._positions[0].length < 1))\n        {\n            if (x3dom.caps.MAX_VERTEX_TEXTURE_IMAGE_UNITS < 2 &&\n                x3dom.isa(geoNode, x3dom.nodeTypes.ImageGeometry)) {\n                x3dom.debug.logError(\"Can't render ImageGeometry nodes with only \" +\n                    x3dom.caps.MAX_VERTEX_TEXTURE_IMAGE_UNITS +\n                    \" vertex texture units. Please upgrade your GPU!\");\n            } else {\n                x3dom.debug.logError(\"NO VALID MESH OR NO VERTEX POSITIONS SET!\");\n            }\n            return;\n        }\n\n        // we're on init, thus reset all dirty flags\n        shape.unsetDirty();\n\n        // dynamically attach clean-up method for GL objects\n        if (!shape._cleanupGLObjects) {\n            shape._cleanupGLObjects = function(force, delGL) {\n                // FIXME: what if complete tree is removed? Then _parentNodes.length may be greater 0.\n                if (this._webgl && ((arguments.length > 0 && force) || this._parentNodes.length == 0)) {\n                    var sp = this._webgl.shader;\n\n                    for (var q = 0; q < this._webgl.positions.length; q++) {\n                        var q6 = 6 * q;\n\n                        if (sp.position !== undefined) {\n                            gl.deleteBuffer(this._webgl.buffers[q6 + x3dom.BUFFER_IDX.INDEX]);\n                            gl.deleteBuffer(this._webgl.buffers[q6 + x3dom.BUFFER_IDX.POSITION]);\n                        }\n\n                        if (sp.normal !== undefined) {\n                            gl.deleteBuffer(this._webgl.buffers[q6 + x3dom.BUFFER_IDX.NORMAL]);\n                        }\n\n                        if (sp.texcoord !== undefined) {\n                            gl.deleteBuffer(this._webgl.buffers[q6 + x3dom.BUFFER_IDX.TEXCOORD]);\n                        }\n\n                        if (sp.color !== undefined) {\n                            gl.deleteBuffer(this._webgl.buffers[q6 + x3dom.BUFFER_IDX.COLOR]);\n                        }\n\n                        if (sp.id !== undefined) {\n                            gl.deleteBuffer(this._webgl.buffers[q6 + x3dom.BUFFER_IDX.ID]);\n                        }\n\n                        if (sp.tangent !== undefined) {\n                            gl.deleteBuffer(this._webgl.buffers[q6 + x3dom.BUFFER_IDX.TANGENT]);\n                        }\n\n                        if (sp.binormal !== undefined) {\n                            gl.deleteBuffer(this._webgl.buffers[q6 + x3dom.BUFFER_IDX.BITANGENT]);\n                        }\n                    }\n\n                    for (var df = 0; df < this._webgl.dynamicFields.length; df++) {\n                        var attrib = this._webgl.dynamicFields[df];\n\n                        if (sp[attrib.name] !== undefined) {\n                            gl.deleteBuffer(attrib.buf);\n                        }\n                    }\n\n                    if (delGL === undefined)\n                        delGL = true;\n\n                    if (delGL) {\n                        delete this._webgl;\n\n                        // be optimistic, one shape removed makes room for another one\n                        x3dom.BinaryContainerLoader.outOfMemory = false;\n                    }\n                }\n            };  // shape._cleanupGLObjects()\n        }\n\n\n        shape._webgl = {\n            positions: geoNode._mesh._positions,\n            normals: geoNode._mesh._normals,\n            texcoords: geoNode._mesh._texCoords,\n            colors: geoNode._mesh._colors,\n            tangents: geoNode._mesh._tangents,\n            binormals: geoNode._mesh._binormals,\n            indexes: geoNode._mesh._indices,\n            // indicesBuffer,positionBuffer,normalBuffer,texcBuffer,colorBuffer\n            // buffers: [{},{},{},{},{}],\n            indexType: gl.UNSIGNED_SHORT,\n            coordType: gl.FLOAT,\n            normalType: gl.FLOAT,\n            texCoordType: gl.FLOAT,\n            texCoord2Type: gl.FLOAT,\n            colorType: gl.FLOAT,\n            tangentType: gl.FLOAT,\n            binormalType: gl.FLOAT,\n            coordNormalized : false,\n            normalNormalized : false,\n            texCoordNormalized : false,\n            texCoord2Normalized : false,\n            colorNormalized : false,\n            tangentNormalized : false,\n            binormalNormalized : false,\n            texture: [],\n            dirtyLighting: x3dom.Utils.checkDirtyLighting(viewarea),\n            imageGeometry: 0,   // 0 := no IG,  1 := indexed IG, -1  := non-indexed IG\n            binaryGeometry: 0,  // 0 := no BG,  1 := indexed BG, -1  := non-indexed BG\n            popGeometry: 0,     // 0 : no PG,  1 : indexed PG, -1  : non-indexed PG\n            externalGeometry: 0, // 0 : no EG,  1 : indexed EG, -1 : non-indexed EG\n            bufferGeometry: 0 // 0 : no EG,  1 : indexed EG, -1 : non-indexed EG\n        };\n\n        // Set Textures\n        textures = shape.getTextures();\n        for (t = 0; t < textures.length; ++t) {\n            shape._webgl.texture.push(new x3dom.Texture(gl, shape._nameSpace.doc, this.cache, textures[t]));\n        }\n\n        // Set Shader\n        // shape._webgl.shader = this.cache.getDynamicShader(gl, viewarea, shape);\n        // shape._webgl.shader = this.cache.getShaderByProperties(gl, drawable.properties);\n        shape._webgl.shader = this.cache.getShaderByProperties(gl, shape, shape.getShaderProperties(viewarea));\n\n        // init vertex attribs\n        var sp = shape._webgl.shader;\n        var currAttribs = 0;\n\n        shape._webgl.buffers = [];\n        shape._webgl.dynamicFields = [];\n\n        // Set Geometry Primitive Type\n        if (x3dom.isa(geoNode, x3dom.nodeTypes.X3DBinaryContainerGeometryNode)) {\n            shape._webgl.primType = [];\n\n            for (var primCnt = 0; primCnt < geoNode._vf.primType.length; ++primCnt) {\n                shape._webgl.primType.push(x3dom.Utils.primTypeDic(gl, geoNode._vf.primType[primCnt]));\n            }\n        } else {\n            shape._webgl.primType = x3dom.Utils.primTypeDic(gl, geoNode._mesh._primType);\n        }\n\n        // Binary container geometries need special handling\n        if (x3dom.isa(geoNode, x3dom.nodeTypes.ExternalGeometry)) {\n            geoNode.update(shape, sp, gl, viewarea, this);\n        } else if (x3dom.isa(shape, x3dom.nodeTypes.ExternalShape)) {\n            shape.update(shape, sp, gl, viewarea, this);\n        } else if (x3dom.isa(geoNode, x3dom.nodeTypes.BinaryGeometry)) {\n            x3dom.BinaryContainerLoader.setupBinGeo(shape, sp, gl, viewarea, this);\n        } else if (x3dom.isa(geoNode, x3dom.nodeTypes.BufferGeometry)) {\n            x3dom.BinaryContainerLoader.setupBufferGeo(shape, sp, gl, viewarea, this);\n        } else if (x3dom.isa(geoNode, x3dom.nodeTypes.PopGeometry)) {\n            x3dom.BinaryContainerLoader.setupPopGeo(shape, sp, gl, viewarea, this);\n        } else if (x3dom.isa(geoNode, x3dom.nodeTypes.ImageGeometry)) {\n            x3dom.inryContainerLoader.setupImgGeo(shape, sp, gl, viewarea, this);\n        } else {\n            // No special BinaryMesh, but IFS or similar\n            for (q = 0; q < shape._webgl.positions.length; q++) {\n                q6 = 6 * q;\n\n                if (sp.position !== undefined) {\n                    // bind indices for drawElements() call\n                    indicesBuffer = gl.createBuffer();\n                    shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.INDEX] = indicesBuffer;\n\n                    // explicitly check first positions array for consistency\n                    if (x3dom.caps.INDEX_UINT && (shape._webgl.positions[0].length / 3 > 65535)) {\n                        indexArray = new Uint32Array(shape._webgl.indexes[q]);\n                        shape._webgl.indexType = gl.UNSIGNED_INT;\n                    } else {\n                        indexArray = new Uint16Array(shape._webgl.indexes[q]);\n                        shape._webgl.indexType = gl.UNSIGNED_SHORT;\n                    }\n\n                    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indicesBuffer);\n                    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indexArray, gl.STATIC_DRAW);\n\n                    indexArray = null;\n\n                    positionBuffer = gl.createBuffer();\n                    shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.POSITION] = positionBuffer;\n                    gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);\n\n                    vertices = new Float32Array(shape._webgl.positions[q]);\n\n                    gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);\n                    gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);\n\n                    gl.vertexAttribPointer(sp.position,\n                        geoNode._mesh._numPosComponents,\n                        shape._webgl.coordType, false,\n                        shape._coordStrideOffset[0], shape._coordStrideOffset[1]);\n                    gl.enableVertexAttribArray(sp.position);\n\n                    vertices = null;\n                }\n                if (sp.normal !== undefined || shape._webgl.normals[q]) {\n                    normalBuffer = gl.createBuffer();\n                    shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.NORMAL] = normalBuffer;\n\n                    var normals = new Float32Array(shape._webgl.normals[q]);\n\n                    gl.bindBuffer(gl.ARRAY_BUFFER, normalBuffer);\n                    gl.bufferData(gl.ARRAY_BUFFER, normals, gl.STATIC_DRAW);\n\n                    gl.vertexAttribPointer(sp.normal,\n                        geoNode._mesh._numNormComponents,\n                        shape._webgl.normalType, false,\n                        shape._normalStrideOffset[0], shape._normalStrideOffset[1]);\n                    gl.enableVertexAttribArray(sp.normal);\n\n                    normals = null;\n                }\n                if (sp.texcoord !== undefined) {\n                    var texcBuffer = gl.createBuffer();\n                    shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.TEXCOORD] = texcBuffer;\n\n                    var texCoords = new Float32Array(shape._webgl.texcoords[q]);\n\n                    gl.bindBuffer(gl.ARRAY_BUFFER, texcBuffer);\n                    gl.bufferData(gl.ARRAY_BUFFER, texCoords, gl.STATIC_DRAW);\n\n                    gl.vertexAttribPointer(sp.texcoord,\n                        geoNode._mesh._numTexComponents,\n                        shape._webgl.texCoordType, false,\n                        shape._texCoordStrideOffset[0], shape._texCoordStrideOffset[1]);\n                    gl.enableVertexAttribArray(sp.texcoord);\n\n                    texCoords = null;\n                }\n                if (sp.color !== undefined) {\n                    colorBuffer = gl.createBuffer();\n                    shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.COLOR] = colorBuffer;\n\n                    var colors = new Float32Array(shape._webgl.colors[q]);\n\n                    gl.bindBuffer(gl.ARRAY_BUFFER, colorBuffer);\n                    gl.bufferData(gl.ARRAY_BUFFER, colors, gl.STATIC_DRAW);\n\n                    gl.vertexAttribPointer(sp.color,\n                        geoNode._mesh._numColComponents,\n                        shape._webgl.colorType, false,\n                        shape._colorStrideOffset[0], shape._colorStrideOffset[1]);\n                    gl.enableVertexAttribArray(sp.color);\n\n                    colors = null;\n                }\n                if (sp.particleSize !== undefined) {\n                    var sizeArr = geoNode._vf.size.toGL();\n\n                    if (sizeArr.length) {\n                        var sizeBuffer = gl.createBuffer();\n                        shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.ID] = sizeBuffer;\n\n                        gl.bindBuffer(gl.ARRAY_BUFFER, sizeBuffer);\n                        gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(sizeArr), gl.STATIC_DRAW);\n                    }\n                }\n                if (sp.tangent !== undefined) {\n                    tangentBuffer = gl.createBuffer();\n                    shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.TANGENT] = tangentBuffer;\n\n                    var tangents = new Float32Array(shape._webgl.tangents[q]);\n\n                    gl.bindBuffer(gl.ARRAY_BUFFER, tangentBuffer);\n                    gl.bufferData(gl.ARRAY_BUFFER, tangents, gl.STATIC_DRAW);\n\n                    gl.vertexAttribPointer(sp.tangent,\n                        geoNode._mesh._numTangentComponents,\n                        shape._webgl.tangentType, false,\n                        shape._tangentStrideOffset[0], shape._tangentStrideOffset[1]);\n                    gl.enableVertexAttribArray(sp.tangent);\n\n                    tangents = null;\n                }\n                if (sp.binormal !== undefined) {\n                    binormalBuffer = gl.createBuffer();\n                    shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.BITANGENT] = binormalBuffer;\n\n                    var binormals = new Float32Array(shape._webgl.binormals[q]);\n\n                    gl.bindBuffer(gl.ARRAY_BUFFER, binormalBuffer);\n                    gl.bufferData(gl.ARRAY_BUFFER, binormals, gl.STATIC_DRAW);\n\n                    gl.vertexAttribPointer(sp.binormal,\n                        geoNode._mesh._numBinormalComponents,\n                        shape._webgl.binormalType, false,\n                        shape._binormalStrideOffset[0], shape._binormalStrideOffset[1]);\n                    gl.enableVertexAttribArray(sp.tangent);\n\n                    binormals = null;\n                }\n            }\n\n            // FIXME: handle geometry with split mesh that has dynamic fields!\n            for (var df in geoNode._mesh._dynamicFields) {\n                if (!geoNode._mesh._dynamicFields.hasOwnProperty(df))\n                    continue;\n\n                var attrib = geoNode._mesh._dynamicFields[df];\n\n                shape._webgl.dynamicFields[currAttribs] = {\n                    buf: {}, name: df, numComponents: attrib.numComponents\n                };\n\n                if (sp[df] !== undefined) {\n                    var attribBuffer = gl.createBuffer();\n                    shape._webgl.dynamicFields[currAttribs++].buf = attribBuffer;\n\n                    var attribs = new Float32Array(attrib.value);\n\n                    gl.bindBuffer(gl.ARRAY_BUFFER, attribBuffer);\n                    gl.bufferData(gl.ARRAY_BUFFER, attribs, gl.STATIC_DRAW);\n\n                    gl.vertexAttribPointer(sp[df], attrib.numComponents, gl.FLOAT, false, 0, 0);\n\n                    attribs = null;\n                }\n            }\n        } // Standard geometry\n    };\n\n    /**\n     * Mainly manages rendering of backgrounds and buffer clearing\n     *\n     * @param gl\n     * @param bgnd\n     */\n    Context.prototype.setupScene = function(gl, bgnd) {\n        var sphere = null;\n        var texture = null;\n\n        var that = this;\n\n        if (bgnd._webgl !== undefined) {\n            if (!bgnd._dirty) {\n                return;\n            }\n\n            if (bgnd._webgl.texture !== undefined && bgnd._webgl.texture) {\n                gl.deleteTexture(bgnd._webgl.texture);\n            }\n            if (bgnd._cleanupGLObjects) {\n                bgnd._cleanupGLObjects();\n            }\n            bgnd._webgl = {};\n        }\n\n        bgnd._dirty = false;\n\n        var url = bgnd.getTexUrl();\n        var i = 0;\n        var w = 1, h = 1;\n\n        if (url.length > 0 && url[0].length > 0) {\n            if ((url.length >= 6 && url[1].length > 0 && url[2].length > 0 &&\n                url[3].length > 0 && url[4].length > 0 && url[5].length > 0) ||\n                url[0].indexOf(\".dds\") != -1) {\n                sphere = new x3dom.nodeTypes.Sphere();\n\n                bgnd._webgl = {\n                    positions: sphere._mesh._positions[0],\n                    indexes: sphere._mesh._indices[0],\n                    buffers: [\n                        {}, {}\n                    ]\n                };\n\n                bgnd._webgl.primType = gl.TRIANGLES;\n\n                if(url[0].indexOf(\".dds\") != -1) {\n                    bgnd._webgl.shader = this.cache.getShader(gl, x3dom.shader.BACKGROUND_CUBETEXTURE_DDS);\n                    bgnd._webgl.texture = x3dom.Utils.createTextureCube(gl, bgnd._nameSpace.doc, [url[0]],\n                        false, bgnd._vf.crossOrigin, true, false, false);\n                } else {\n                    bgnd._webgl.shader = this.cache.getShader(gl, x3dom.shader.BACKGROUND_CUBETEXTURE_DDS);\n                    bgnd._webgl.texture = x3dom.Utils.createTextureCube(gl, bgnd._nameSpace.doc, url,\n                        false, bgnd._vf.crossOrigin, true, false);\n                }\n\n\n            }\n            else {\n                bgnd._webgl = {\n                    positions: [-w, -h, 0, -w, h, 0, w, -h, 0, w, h, 0],\n                    indexes: [0, 1, 2, 3],\n                    buffers: [\n                        {}, {}\n                    ]\n                };\n\n                url = bgnd._nameSpace.getURL(url[0]);\n\n                bgnd._webgl.texture = x3dom.Utils.createTexture2D(gl, bgnd._nameSpace.doc, url,\n                    true, bgnd._vf.crossOrigin, false, false);\n\n                bgnd._webgl.primType = gl.TRIANGLE_STRIP;\n\n                bgnd._webgl.shader = that.cache.getShader(gl, x3dom.shader.BACKGROUND_TEXTURE);\n            }\n        } else {\n            if (bgnd.getSkyColor().length > 1 || bgnd.getGroundColor().length) {\n                sphere = new x3dom.nodeTypes.Sphere();\n                texture = gl.createTexture();\n\n                bgnd._webgl = {\n                    positions: sphere._mesh._positions[0],\n                    texcoords: sphere._mesh._texCoords[0],\n                    indexes: sphere._mesh._indices[0],\n                    buffers: [\n                        {}, {}, {}\n                    ],\n                    texture: texture,\n                    primType: gl.TRIANGLES\n                };\n\n                var N = x3dom.Utils.nextHighestPowerOfTwo(\n                    bgnd.getSkyColor().length + bgnd.getGroundColor().length + 2);\n                N = (N < 512) ? 512 : N;\n\n                var n = bgnd._vf.groundAngle.length;\n                var tmp = [], arr = [];\n                var colors = [], sky = [0];\n\n                for (i = 0; i < bgnd._vf.skyColor.length; i++) {\n                    colors[i] = bgnd._vf.skyColor[i];\n                }\n\n                for (i = 0; i < bgnd._vf.skyAngle.length; i++) {\n                    sky[i + 1] = bgnd._vf.skyAngle[i];\n                }\n\n                if (n > 0 || bgnd._vf.groundColor.length == 1) {\n                    if (sky[sky.length - 1] < Math.PI / 2) {\n                        sky[sky.length] = Math.PI / 2 - x3dom.fields.Eps;\n                        colors[colors.length] = colors[colors.length - 1];\n                    }\n\n                    for (i = n - 1; i >= 0; i--) {\n                        if ((i == n - 1) && (Math.PI - bgnd._vf.groundAngle[i] <= Math.PI / 2)) {\n                            sky[sky.length] = Math.PI / 2;\n                            colors[colors.length] = bgnd._vf.groundColor[bgnd._vf.groundColor.length - 1];\n                        }\n                        sky[sky.length] = Math.PI - bgnd._vf.groundAngle[i];\n                        colors[colors.length] = bgnd._vf.groundColor[i + 1];\n                    }\n\n                    if (n == 0 && bgnd._vf.groundColor.length == 1) {\n                        sky[sky.length] = Math.PI / 2;\n                        colors[colors.length] = bgnd._vf.groundColor[0];\n                    }\n                    sky[sky.length] = Math.PI;\n                    colors[colors.length] = bgnd._vf.groundColor[0];\n                } else {\n                    if (sky[sky.length - 1] < Math.PI) {\n                        sky[sky.length] = Math.PI;\n                        colors[colors.length] = colors[colors.length - 1];\n                    }\n                }\n\n                for (i = 0; i < sky.length; i++) {\n                    sky[i] /= Math.PI;\n                }\n\n                if (sky.length != colors.length) {\n                    x3dom.debug.logError(\"Number of background colors and corresponding angles are different!\");\n                    var minArrayLength = (sky.length < colors.length) ? sky.length : colors.length;\n                    sky.length = minArrayLength;\n                    colors.length = minArrayLength;\n                }\n\n                var interp = new x3dom.nodeTypes.ColorInterpolator();\n\n                interp._vf.key = new x3dom.fields.MFFloat(sky);\n                interp._vf.keyValue = new x3dom.fields.MFColor(colors);\n\n                for (i = 0; i < N; i++) {\n                    interp._vf.set_fraction = i / (N - 1.0);\n\n                    interp.fieldChanged(\"set_fraction\");\n                    tmp[i] = interp._vf.value_changed;\n                }\n\n                tmp.reverse();\n\n                var alpha = Math.floor((1.0 - bgnd.getTransparency()) * 255);\n\n                for (i = 0; i < tmp.length; i++) {\n                    arr.push(Math.floor(tmp[i].r * 255),\n                        Math.floor(tmp[i].g * 255),\n                        Math.floor(tmp[i].b * 255),\n                        alpha);\n                }\n\n                var pixels = new Uint8Array(arr);\n                var format = gl.RGBA;\n\n                N = pixels.length / 4;\n\n                gl.bindTexture(gl.TEXTURE_2D, texture);\n                gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n                gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n                gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n                gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\n                gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1);\n                gl.texImage2D(gl.TEXTURE_2D, 0, format, 1, N, 0, format, gl.UNSIGNED_BYTE, pixels);\n                gl.bindTexture(gl.TEXTURE_2D, null);\n\n                bgnd._webgl.shader = that.cache.getShader(gl, x3dom.shader.BACKGROUND_SKYTEXTURE);\n            } else {\n                // Impl. gradient bg etc., e.g. via canvas 2d? But can be done via CSS anyway...\n                bgnd._webgl = {};\n            }\n        }\n\n        if (bgnd._webgl.shader) {\n            var sp = bgnd._webgl.shader;\n\n            var positionBuffer = gl.createBuffer();\n            bgnd._webgl.buffers[x3dom.BUFFER_IDX.POSITION] = positionBuffer;\n            gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);\n\n            var vertices = new Float32Array(bgnd._webgl.positions);\n\n            gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);\n            gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);\n\n            gl.vertexAttribPointer(sp.position, 3, gl.FLOAT, false, 0, 0);\n            gl.enableVertexAttribArray(sp.position);\n\n            var indicesBuffer = gl.createBuffer();\n            bgnd._webgl.buffers[x3dom.BUFFER_IDX.INDEX] = indicesBuffer;\n\n            var indexArray = new Uint16Array(bgnd._webgl.indexes);\n\n            gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indicesBuffer);\n            gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indexArray, gl.STATIC_DRAW);\n\n            vertices = null;\n            indexArray = null;\n\n            if (sp.texcoord !== undefined) {\n                var texcBuffer = gl.createBuffer();\n                bgnd._webgl.buffers[x3dom.BUFFER_IDX.TEXCOORD] = texcBuffer;\n\n                var texcoords = new Float32Array(bgnd._webgl.texcoords);\n\n                gl.bindBuffer(gl.ARRAY_BUFFER, texcBuffer);\n                gl.bufferData(gl.ARRAY_BUFFER, texcoords, gl.STATIC_DRAW);\n\n                gl.vertexAttribPointer(sp.texcoord, 2, gl.FLOAT, false, 0, 0);\n                gl.enableVertexAttribArray(sp.texcoord);\n\n                texcoords = null;\n            }\n\n            bgnd._cleanupGLObjects = function() {\n                var sp = this._webgl.shader;\n\n                if (sp.position !== undefined) {\n                    gl.deleteBuffer(this._webgl.buffers[x3dom.BUFFER_IDX.INDEX]);\n                    gl.deleteBuffer(this._webgl.buffers[x3dom.BUFFER_IDX.POSITION]);\n                }\n                if (sp.texcoord !== undefined) {\n                    gl.deleteBuffer(this._webgl.buffers[x3dom.BUFFER_IDX.TEXCOORD]);\n                }\n            };\n        }\n\n        bgnd._webgl.render = function (gl, mat_view, mat_proj, viewarea) {\n            var sp = bgnd._webgl.shader;\n            var alpha = 1.0 - bgnd.getTransparency();\n\n            var mat_scene = null;\n            var projMatrix_22 = mat_proj._22,\n                projMatrix_23 = mat_proj._23;\n            var camPos = mat_view.e3();\n\n            if ((sp !== undefined && sp !== null) &&\n                (sp.texcoord !== undefined && sp.texcoord !== null) &&\n                (bgnd._webgl.texture !== undefined && bgnd._webgl.texture !== null)) {\n                gl.clearColor(0, 0, 0, alpha);\n                gl.clearDepth(1.0);\n                gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);\n\n                that.stateManager.frontFace(gl.CCW);\n                that.stateManager.disable(gl.CULL_FACE);\n                that.stateManager.disable(gl.DEPTH_TEST);\n                that.stateManager.disable(gl.BLEND);\n\n                that.stateManager.useProgram(sp);\n\n                if (!sp.tex) {\n                    sp.tex = 0;\n                }\n\n                // adapt projection matrix to better near/far\n                mat_proj._22 = 100001 / 99999;\n                mat_proj._23 = 200000 / 99999;\n                // center viewpoint\n                mat_view._03 = 0;\n                mat_view._13 = 0;\n                mat_view._23 = 0;\n\n                mat_scene = mat_proj.mult(mat_view);\n                sp.modelViewProjectionMatrix = mat_scene.toGL();\n\n                mat_view._03 = camPos.x;\n                mat_view._13 = camPos.y;\n                mat_view._23 = camPos.z;\n\n                mat_proj._22 = projMatrix_22;\n                mat_proj._23 = projMatrix_23;\n\n                gl.activeTexture(gl.TEXTURE0);\n                gl.bindTexture(gl.TEXTURE_2D, bgnd._webgl.texture);\n\n                gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n                gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n                gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n                gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\n                gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, bgnd._webgl.buffers[x3dom.BUFFER_IDX.INDEX]);\n\n                gl.bindBuffer(gl.ARRAY_BUFFER, bgnd._webgl.buffers[x3dom.BUFFER_IDX.POSITION]);\n                gl.vertexAttribPointer(sp.position, 3, gl.FLOAT, false, 0, 0);\n                gl.enableVertexAttribArray(sp.position);\n\n                gl.bindBuffer(gl.ARRAY_BUFFER, bgnd._webgl.buffers[x3dom.BUFFER_IDX.TEXCOORD]);\n                gl.vertexAttribPointer(sp.texcoord, 2, gl.FLOAT, false, 0, 0);\n                gl.enableVertexAttribArray(sp.texcoord);\n                that.setVertexAttribEyeIdx(gl, sp);\n\n                that.drawElements(gl, bgnd._webgl.primType, bgnd._webgl.indexes.length, gl.UNSIGNED_SHORT, 0);\n\n                gl.activeTexture(gl.TEXTURE0);\n                gl.bindTexture(gl.TEXTURE_2D, null);\n\n                gl.disableVertexAttribArray(sp.position);\n                gl.disableVertexAttribArray(sp.texcoord);\n                that.disableVertexAttribEyeIdx(gl, sp);\n\n                gl.clear(gl.DEPTH_BUFFER_BIT);\n            } else if (!sp || !bgnd._webgl.texture ||\n                (bgnd._webgl.texture.textureCubeReady !== undefined &&\n                    bgnd._webgl.texture.textureCubeReady !== true)) {\n                var bgCol = bgnd.getSkyColor().toGL();\n\n                gl.clearColor(bgCol[0], bgCol[1], bgCol[2], alpha);\n                gl.clearDepth(1.0);\n                gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);\n            } else {\n                gl.clearColor(0, 0, 0, alpha);\n                gl.clearDepth(1.0);\n                gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);\n\n                that.stateManager.frontFace(gl.CCW);\n                that.stateManager.disable(gl.CULL_FACE);\n                that.stateManager.disable(gl.DEPTH_TEST);\n                that.stateManager.disable(gl.BLEND);\n\n                that.stateManager.useProgram(sp);\n\n                if (!sp.tex) {\n                    sp.tex = 0;\n                }\n\n                if (bgnd._webgl.texture.textureCubeReady) {\n                    // adapt projection matrix to better near/far\n                    mat_proj._22 = 100001 / 99999;\n                    mat_proj._23 = 200000 / 99999;\n                    // center viewpoint\n                    mat_view._03 = 0;\n                    mat_view._13 = 0;\n                    mat_view._23 = 0;\n\n                    mat_scene = mat_proj.mult(mat_view);\n                    sp.modelViewProjectionMatrix = mat_scene.toGL();\n\n                    mat_view._03 = camPos.x;\n                    mat_view._13 = camPos.y;\n                    mat_view._23 = camPos.z;\n\n                    mat_proj._22 = projMatrix_22;\n                    mat_proj._23 = projMatrix_23;\n\n                    gl.activeTexture(gl.TEXTURE0);\n                    gl.bindTexture(gl.TEXTURE_CUBE_MAP, bgnd._webgl.texture);\n\n                    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n                    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n                    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n                    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n                } else {\n                    gl.activeTexture(gl.TEXTURE0);\n                    gl.bindTexture(gl.TEXTURE_2D, bgnd._webgl.texture);\n\n                    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n                    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n                    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n                    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\n                    if (bgnd._vf.scaling && bgnd._webgl.texture.ready) {\n                        var ratio = 1.0;\n                        var viewport = new x3dom.fields.SFVec2f(that.canvas.width, that.canvas.height);\n                        var texture = new x3dom.fields.SFVec2f(bgnd._webgl.texture.width, bgnd._webgl.texture.height);\n\n                        if (viewport.x > viewport.y) {\n                            ratio = viewport.x / texture.x;\n                            texture.x = viewport.x;\n                            texture.y = texture.y * ratio;\n                        } else {\n                            ratio = viewport.y / texture.y;\n                            texture.y = viewport.y;\n                            texture.x = texture.x * ratio;\n                        }\n\n\t\t\t\t\t\tvar scale       = viewport.divideComponents( texture );\n\t\t\t\t\t\tvar translation = texture.subtract( viewport ).multiply( 0.5 ).divideComponents( texture );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar scale       = new x3dom.fields.SFVec2f(1.0, 1.0);\n\t\t\t\t\t\tvar translation = new x3dom.fields.SFVec2f(0.0, 0.0);\n\t\t\t\t\t}\n\n\t\t\t\t\tsp.scale = scale.toGL();\n                    sp.translation = translation.toGL();\n                }\n\n                sp.isVR = -1.0;\n                sp.screenWidth = that.canvas.width;\n\n                that.setTonemappingOperator(viewarea, sp);                \n\n                if(that.VRMode == 2)\n                {\n                    var mat_view_R = viewarea.getViewMatrices()[1];\n\n                    var camPosR = mat_view_R.e3();\n\n                    mat_view_R._03 = 0;\n                    mat_view_R._13 = 0;\n                    mat_view_R._23 = 0;\n\n                    var mat_proj_R = viewarea.getProjectionMatrices()[1];\n                    var mat_scene_R = mat_proj_R.mult(mat_view_R);\n                    sp.modelViewProjectionMatrix2 = mat_scene_R.toGL();\n\n                    mat_view_R._03 = camPosR.x;\n                    mat_view_R._13 = camPosR.y;\n                    mat_view_R._23 = camPosR.z;\n\n                    sp.isVR = 1.0;\n                }\n\n                that.setVertexAttribEyeIdx(gl, sp);\n\n                gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, bgnd._webgl.buffers[x3dom.BUFFER_IDX.INDEX]);\n                gl.bindBuffer(gl.ARRAY_BUFFER, bgnd._webgl.buffers[x3dom.BUFFER_IDX.POSITION]);\n                gl.vertexAttribPointer(sp.position, 3, gl.FLOAT, false, 0, 0);\n                gl.enableVertexAttribArray(sp.position);\n\n                that.drawElements(gl, bgnd._webgl.primType, bgnd._webgl.indexes.length, gl.UNSIGNED_SHORT, 0);\n\n                gl.disableVertexAttribArray(sp.position);\n\n                that.disableVertexAttribEyeIdx(gl, sp);\n\n                gl.activeTexture(gl.TEXTURE0);\n                if (bgnd._webgl.texture.textureCubeReady) {\n                    gl.bindTexture(gl.TEXTURE_CUBE_MAP, null);\n                } else {\n                    gl.bindTexture(gl.TEXTURE_2D, null);\n                }\n\n                gl.clear(gl.DEPTH_BUFFER_BIT);\n            }\n        };\n    };\n\n    /**\n     * Setup Frontgrounds\n     *\n     * @param gl\n     * @param scene\n     */\n    Context.prototype.setupFgnds = function(gl, scene) {\n        if (scene._fgnd !== undefined) {\n            return;\n        }\n\n        var that = this;\n\n        var w = 1, h = 1;\n        scene._fgnd = {};\n\n        scene._fgnd._webgl = {\n            positions: [-w, -h, 0, -w, h, 0, w, -h, 0, w, h, 0],\n            indexes: [0, 1, 2, 3],\n            buffers: [\n                {}, {}\n            ]\n        };\n\n        scene._fgnd._webgl.primType = gl.TRIANGLE_STRIP;\n\n        scene._fgnd._webgl.shader = this.cache.getShader(gl, x3dom.shader.FRONTGROUND_TEXTURE);\n\n        var sp = scene._fgnd._webgl.shader;\n\n        var positionBuffer = gl.createBuffer();\n        scene._fgnd._webgl.buffers[x3dom.BUFFER_IDX.POSITION] = positionBuffer;\n        gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);\n\n        var vertices = new Float32Array(scene._fgnd._webgl.positions);\n\n        gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);\n        gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);\n\n        gl.vertexAttribPointer(sp.position, 3, gl.FLOAT, false, 0, 0);\n\n        var indicesBuffer = gl.createBuffer();\n        scene._fgnd._webgl.buffers[x3dom.BUFFER_IDX.INDEX] = indicesBuffer;\n\n        var indexArray = new Uint16Array(scene._fgnd._webgl.indexes);\n\n        gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indicesBuffer);\n        gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indexArray, gl.STATIC_DRAW);\n\n        vertices = null;\n        indexArray = null;\n\n        scene._fgnd._webgl.render = function(gl, tex) {\n            scene._fgnd._webgl.texture = tex;\n\n            that.stateManager.frontFace(gl.CCW);\n            that.stateManager.disable(gl.CULL_FACE);\n            that.stateManager.disable(gl.DEPTH_TEST);\n\n            that.stateManager.useProgram(sp);\n\n            if (!sp.tex) {\n                sp.tex = 0;\n            }\n\n            // this.stateManager.enable(gl.TEXTURE_2D);\n            gl.activeTexture(gl.TEXTURE0);\n            gl.bindTexture(gl.TEXTURE_2D, scene._fgnd._webgl.texture);\n\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\n            gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, scene._fgnd._webgl.buffers[x3dom.BUFFER_IDX.INDEX]);\n            gl.bindBuffer(gl.ARRAY_BUFFER, scene._fgnd._webgl.buffers[x3dom.BUFFER_IDX.POSITION]);\n            gl.vertexAttribPointer(sp.position, 3, gl.FLOAT, false, 0, 0);\n            gl.enableVertexAttribArray(sp.position);\n\n            that.drawElements(gl, scene._fgnd._webgl.primType, scene._fgnd._webgl.indexes.length, gl.UNSIGNED_SHORT, 0, 1);\n\n            gl.disableVertexAttribArray(sp.position);\n\n            gl.activeTexture(gl.TEXTURE0);\n            gl.bindTexture(gl.TEXTURE_2D, null);\n            // this.stateManager.disable(gl.TEXTURE_2D);\n        };\n    };\n\n    /**\n     * Render Shadow-Pass\n     *\n     * @param gl\n     * @param viewarea\n     * @param mat_scene\n     * @param mat_view\n     * @param targetFbo\n     * @param camOffset\n     * @param isCameraView\n     */\n    Context.prototype.renderShadowPass = function(gl, viewarea, mat_scene, mat_view, targetFbo, camOffset, isCameraView) {\n        var scene = viewarea._scene;\n\n        var indicesReady = false;\n\n        this.stateManager.bindFramebuffer(gl.FRAMEBUFFER, targetFbo.fbo);\n        this.stateManager.viewport(0, 0, targetFbo.width, targetFbo.height);\n\n        gl.clearColor(1.0, 1.0, 1.0, 0.0);\n        gl.clearDepth(1.0);\n        gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\n        this.stateManager.depthFunc(gl.LEQUAL);\n        this.stateManager.enable(gl.DEPTH_TEST);\n        this.stateManager.enable(gl.CULL_FACE);\n        this.stateManager.disable(gl.BLEND);\n\n        var bgCenter = x3dom.fields.SFVec3f.NullVector.toGL();\n        var bgSize = x3dom.fields.SFVec3f.OneVector.toGL();\n\n        var env = scene.getEnvironment();\n        var excludeTrans = env._vf.shadowExcludeTransparentObjects;\n\n        var i, n = scene.drawableCollection.length;\n\n        for (i = 0; i < n; i++) {\n            var drawable = scene.drawableCollection.get(i);\n            var trafo = drawable.transform;\n            var shape = drawable.shape;\n\n            var s_gl = shape._webgl;\n\n            if (!s_gl || (excludeTrans && drawable.sortType == 'transparent')) {\n                continue;\n            }\n\n            var s_geo = shape._cf.geometry.node;\n            var s_app = shape._cf.appearance.node;\n            var s_msh = s_geo._mesh;\n\n            var properties = shape.getShaderProperties(viewarea);\n\n            // Generate Dynamic picking shader\n            var sp = this.cache.getShaderByProperties(gl, shape, properties, null, true);\n\n            if (!sp) {   // error\n                return;\n            }\n\n            // Bind shader\n            this.stateManager.useProgram(sp);\n\n            sp.cameraView = isCameraView;\n            sp.offset = camOffset;\n\n            sp.modelViewProjectionMatrix = mat_scene.mult(trafo).toGL();\n\n            // BoundingBox stuff\n            if (s_gl.coordType != gl.FLOAT) {\n                if (!s_gl.popGeometry && (x3dom.Utils.isUnsignedType(s_geo._vf.coordType))) {\n                    sp.bgCenter = s_geo.getMin().toGL();\n                } else {\n                    sp.bgCenter = s_geo._vf.position.toGL();\n                }\n                sp.bgSize = s_geo._vf.size.toGL();\n                sp.bgPrecisionMax = s_geo.getPrecisionMax('coordType');\n            }\n\n            // Set ClipPlanes\n            if (shape._clipPlanes) {\n                sp.modelViewMatrix = mat_view.mult(trafo).toGL();\n                sp.viewMatrixInverse = mat_view.inverse().toGL();\n                for (var cp = 0; cp < shape._clipPlanes.length; cp++) {\n                    var clip_plane = shape._clipPlanes[cp].plane;\n                    var clip_trafo = shape._clipPlanes[cp].trafo;\n\n                    sp['clipPlane' + cp + '_Plane'] = clip_trafo.multMatrixPlane(clip_plane._vf.plane).toGL();\n                    sp['clipPlane' + cp + '_CappingStrength'] = clip_plane._vf.cappingStrength;\n                    sp['clipPlane' + cp + '_CappingColor'] = clip_plane._vf.cappingColor.toGL();\n                }\n            }\n\n            // ImageGeometry stuff\n            if (s_gl.imageGeometry != 0 && !x3dom.caps.MOBILE) {\n                // FIXME: mobile errors\n                sp.IG_bboxMin = s_geo.getMin().toGL();\n                sp.IG_bboxMax = s_geo.getMax().toGL();\n                sp.IG_implicitMeshSize = s_geo._vf.implicitMeshSize.toGL();  // FIXME\n\n                var coordTex = x3dom.Utils.findTextureByName(s_gl.texture, \"IG_coords0\");\n                if (coordTex) {\n                    sp.IG_coordTextureWidth = coordTex.texture.width;\n                    sp.IG_coordTextureHeight = coordTex.texture.height;\n                }\n\n                if (s_gl.imageGeometry == 1) {\n                    var indexTex = x3dom.Utils.findTextureByName(s_gl.texture, \"IG_index\");\n                    if (indexTex) {\n                        sp.IG_indexTextureWidth = indexTex.texture.width;\n                        sp.IG_indexTextureHeight = indexTex.texture.height;\n                    }\n\n                    gl.activeTexture(gl.TEXTURE0);\n                    gl.bindTexture(gl.TEXTURE_2D, indexTex.texture);\n\n                    gl.activeTexture(gl.TEXTURE1);\n                    gl.bindTexture(gl.TEXTURE_2D, coordTex.texture);\n                } else {\n                    gl.activeTexture(gl.TEXTURE0);\n                    gl.bindTexture(gl.TEXTURE_2D, coordTex.texture);\n                }\n\n                gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n                gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n                gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n                gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n\n                var texUnit = 0;\n                if (s_geo.getIndexTexture()) {\n                    if (!sp.IG_indexTexture) {\n                        sp.IG_indexTexture = texUnit++;\n                    }\n                }\n                if (s_geo.getCoordinateTexture(0)) {\n                    if (!sp.IG_coordinateTexture) {\n                        sp.IG_coordinateTexture = texUnit++;\n                    }\n                }\n            } else if ((s_gl.binaryGeometry != 0 || s_gl.externalGeometry != 0) && s_geo._vf[\"idsPerVertex\"] == true) { // MultiPart\n                var shader = s_app._shader;\n                if (shader && x3dom.isa(s_app._shader, x3dom.nodeTypes.CommonSurfaceShader)) {\n                    if (shader.getMultiVisibilityMap()) {\n                        sp.multiVisibilityMap = 0;\n                        var visTex = x3dom.Utils.findTextureByName(s_gl.texture, \"multiVisibilityMap\");\n                        sp.multiVisibilityWidth = visTex.texture.width;\n                        sp.multiVisibilityHeight = visTex.texture.height;\n                        gl.activeTexture(gl.TEXTURE0);\n                        gl.bindTexture(gl.TEXTURE_2D, visTex.texture);\n                        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n                        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n                        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n                        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n                    }\n                }\n            }\n\n            if (shape.isSolid()) {\n                this.stateManager.enable(gl.CULL_FACE);\n\n                if (shape.isCCW()) {\n                    this.stateManager.frontFace(gl.CCW);\n                } else {\n                    this.stateManager.frontFace(gl.CW);\n                }\n            } else {\n                this.stateManager.disable(gl.CULL_FACE);\n            }\n\n            // Set DepthMode\n            var depthMode = s_app ? s_app._cf.depthMode.node : null;\n            if (depthMode) {\n                if (depthMode._vf.enableDepthTest) {\n                    // Enable Depth Test\n                    this.stateManager.enable(gl.DEPTH_TEST);\n\n                    // Set Depth Mask\n                    this.stateManager.depthMask(!depthMode._vf.readOnly);\n\n                    // Set Depth Function\n                    this.stateManager.depthFunc(x3dom.Utils.depthFunc(gl, depthMode._vf.depthFunc));\n\n                    // Set Depth Range\n                    this.stateManager.depthRange(depthMode._vf.zNearRange, depthMode._vf.zFarRange);\n                } else {\n                    // Disable Depth Test\n                    this.stateManager.disable(gl.DEPTH_TEST);\n                }\n            } else {\n                // Set Defaults\n                this.stateManager.enable(gl.DEPTH_TEST);\n                this.stateManager.depthMask(true);\n                this.stateManager.depthFunc(gl.LEQUAL);\n            }\n\n            // PopGeometry: adapt LOD and set shader variables\n            if (s_gl.popGeometry) {\n                var model_view = mat_view.mult(trafo);\n                // FIXME; viewarea's width/height twice as big as render buffer size, which leads to too high precision\n                // the correct viewarea here would be one that holds this half-sized render buffer\n                this.updatePopState(drawable, s_geo, sp, s_gl, scene, model_view, viewarea, this.x3dElem.runtime.fps);\n            }\n\n            var q_n;\n            if (s_gl.externalGeometry != 0) {\n                q_n = shape.meshes.length;\n            } else {\n                q_n = s_gl.positions.length;\n            }\n            for (var q = 0; q < q_n; q++) {\n                var q6 = 6 * q;\n                var v, v_n, offset;\n\n\n                if (s_gl.externalGeometry != 0) {\n                    var mesh = shape.meshes[q];\n\n                    mesh.bindVertexAttribPointerPosition(gl, sp, false);\n                    mesh.render(gl, null);\n                } else if (!(sp.position !== undefined && s_gl.buffers[q6 + x3dom.BUFFER_IDX.POSITION] && s_gl.indexes[q]))\n                    continue;\n\n                indicesReady = false;\n                if (s_gl.externalGeometry == 0) {\n\n                    // set buffers\n                    if (s_gl.buffers[q6 + x3dom.BUFFER_IDX.INDEX]) {\n                        gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, s_gl.buffers[q6 + x3dom.BUFFER_IDX.INDEX]);\n                        indicesReady = true;\n                    }\n\n                    this.setVertexAttribPointerPosition(gl, shape, q6, q);\n\n                    if (sp.id !== undefined && s_gl.buffers[q6 + x3dom.BUFFER_IDX.ID]) {\n\n                        gl.bindBuffer(gl.ARRAY_BUFFER, s_gl.buffers[q6 + x3dom.BUFFER_IDX.ID]);\n                        // texture coordinate hack for IDs\n                        if ((s_gl.binaryGeometry != 0 || s_gl.externalGeometry != 0) && s_geo._vf[\"idsPerVertex\"] == true) {\n                            gl.vertexAttribPointer(sp.id,\n                                1, gl.FLOAT, false,\n                                4, 0);\n                            gl.enableVertexAttribArray(sp.id);\n                        } else {\n                            /*\n                             gl.vertexAttribPointer(sp.id,\n                             1, gl.FLOAT, false,\n                             shape._idStrideOffset[0], shape._idStrideOffset[1]);\n                             gl.enableVertexAttribArray(sp.id);\n                             */\n                        }\n                    }\n\n                    // render mesh\n                    if (indicesReady && (s_gl.binaryGeometry > 0 || s_gl.popGeometry > 0)) {\n                        for (v = 0, offset = 0, v_n = s_geo._vf.vertexCount.length; v < v_n; v++) {\n                            this.drawElements(gl, s_gl.primType[v], s_geo._vf.vertexCount[v], s_gl.indexType,\n                                x3dom.Utils.getByteAwareOffset(offset, s_gl.indexType, gl));\n                            offset += s_geo._vf.vertexCount[v];\n                        }\n                    } else if (s_gl.binaryGeometry < 0 || s_gl.popGeometry < 0 || s_gl.imageGeometry) {\n                        for (v = 0, offset = 0, v_n = s_geo._vf.vertexCount.length; v < v_n; v++) {\n                            this.drawArrays(gl, s_gl.primType[v], offset, s_geo._vf.vertexCount[v]);\n                            offset += s_geo._vf.vertexCount[v];\n                        }\n                    } else if (s_geo.hasIndexOffset()) {\n                        var indOff = shape.tessellationProperties();\n                        for (v = 0, v_n = indOff.length; v < v_n; v++) {\n                            this.drawElements(gl, s_gl.primType, indOff[v].count, s_gl.indexType,\n                                indOff[v].offset * x3dom.Utils.getOffsetMultiplier(s_gl.indexType, gl));\n                        }\n                    }\n                    else if (s_gl.indexes[q].length == 0) {\n                        this.drawArrays(gl, s_gl.primType, 0, s_gl.positions[q].length / 3);\n                    } else {\n                        this.drawElements(gl, s_gl.primType, s_gl.indexes[q].length, s_gl.indexType, 0);\n                    }\n                }\n\n                gl.disableVertexAttribArray(sp.position);\n\n                if (sp.texcoord !== undefined && s_gl.buffers[q6 + x3dom.BUFFER_IDX.TEXCOORD]) {\n                    gl.disableVertexAttribArray(sp.texcoord);\n                }\n                if (sp.color !== undefined && s_gl.buffers[q6 + x3dom.BUFFER_IDX.COLOR]) {\n                    gl.disableVertexAttribArray(sp.color);\n                }\n                if (sp.id !== undefined && s_gl.buffers[q6 + x3dom.BUFFER_IDX.ID]) {\n                    gl.disableVertexAttribArray(sp.id);\n                }\n            }\n\n            // Clean Texture units for IG\n            if (s_gl.imageGeometry != 0 && !x3dom.caps.MOBILE) {\n                gl.activeTexture(gl.TEXTURE0);\n                gl.bindTexture(gl.TEXTURE_2D, null);\n                if (s_gl.imageGeometry == 1) {\n                    gl.activeTexture(gl.TEXTURE1);\n                    gl.bindTexture(gl.TEXTURE_2D, null);\n                }\n            }\n\n        }\n\n        if (x3dom.Utils.needLineWidth) {\n            this.stateManager.lineWidth(1);\n        }\n\n        if (depthMode) {\n            this.stateManager.enable(gl.DEPTH_TEST);\n            this.stateManager.depthMask(true);\n            this.stateManager.depthFunc(gl.LEQUAL);\n            this.stateManager.depthRange(0, 1);\n        }\n\n        gl.flush();\n\n        this.stateManager.bindFramebuffer(gl.FRAMEBUFFER, null);\n    };\n\n    /**\n     * Render Picking-Pass\n     *\n     * @param gl\n     * @param scene\n     * @param mat_view\n     * @param mat_scene\n     * @param from\n     * @param sceneSize\n     * @param pickMode\n     * @param lastX\n     * @param lastY\n     * @param width\n     * @param height\n     */\n    Context.prototype.renderPickingPass = function(gl, scene, mat_view, mat_scene, from, sceneSize,\n                                                   pickMode, lastX, lastY, width, height) {\n        var ps = scene._webgl.pickScale;\n        var bufHeight = scene._webgl.fboPick.height;\n        var x = lastX * ps;\n        var y = (bufHeight - 1) - lastY * ps;\n\n        var indicesReady = false;\n\n        this.stateManager.bindFramebuffer(gl.FRAMEBUFFER, scene._webgl.fboPick.fbo);\n        this.stateManager.viewport(0, 0, scene._webgl.fboPick.width, bufHeight);\n\n        // gl.scissor(x, y, width, height);\n        // gl.enable(gl.SCISSOR_TEST);\n\n        gl.clearColor(0.0, 0.0, 0.0, 0.0);\n        gl.clearDepth(1.0);\n        gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\n        var viewarea = scene.drawableCollection.viewarea;\n        var env = scene.getEnvironment();\n        var n = scene.drawableCollection.length;\n\n        if (env._vf.smallFeatureCulling && env._lowPriorityThreshold < 1 && viewarea.isMovingOrAnimating()) {\n            n = Math.floor(n * env._lowPriorityThreshold);\n            if (!n && scene.drawableCollection.length)\n                n = 1;   // render at least one object\n        }\n\n        var bgCenter = x3dom.fields.SFVec3f.NullVector.toGL();\n        var bgSize = x3dom.fields.SFVec3f.OneVector.toGL();\n\n        this.stateManager.depthFunc(gl.LEQUAL);\n        this.stateManager.enable(gl.DEPTH_TEST);\n        this.stateManager.enable(gl.CULL_FACE);\n        this.stateManager.disable(gl.BLEND);\n\n        if (x3dom.Utils.needLineWidth) {\n            this.stateManager.lineWidth(2);     // bigger lines for better picking\n        }\n\n        for (var i = 0; i < n; i++) {\n            var drawable = scene.drawableCollection.get(i);\n            var trafo = drawable.transform;\n            var shape = drawable.shape;\n            var s_gl = shape._webgl;\n\n            if (!s_gl || shape._objectID < 1 || !shape._vf.isPickable) {\n                continue;\n            }\n\n            var s_geo = shape._cf.geometry.node;\n            var s_app = shape._cf.appearance.node;\n            var s_msh = s_geo._mesh;\n\n            // Get shapes shader properties\n            var properties = shape.getShaderProperties(viewarea);\n\n            // Generate Dynamic picking shader\n            var sp = this.cache.getShaderByProperties(gl, shape, properties, pickMode);\n\n            if (!sp) {   // error\n                return;\n            }\n\n            // Save current shader\n            s_gl.shader = sp;\n\n            // Bind shader\n            this.stateManager.useProgram(sp);\n\n            sp.screenWidth = this.canvas.width * scene._webgl.pickScale;\n            sp.modelMatrix = trafo.toGL();\n            sp.modelViewProjectionMatrix = mat_scene.mult(trafo).toGL();\n\n            sp.isVR = -1.0;\n\n            if(this.VRMode == 2)\n            {\n                var mat_view_R = viewarea.getViewMatrices()[1];\n                var mat_proj_R = viewarea.getProjectionMatrices()[1];\n                var mat_scene_R = mat_proj_R.mult(mat_view_R);\n                sp.modelViewProjectionMatrix2 = mat_scene_R.mult(trafo).toGL();\n\n                sp.isVR = 1.0;\n            }\n\n\n            sp.lowBit  = (shape._objectID & 255) / 255.0;\n            sp.highBit = (shape._objectID >>> 8) / 255.0;\n\n            sp.from = from.toGL();\n            sp.sceneSize = sceneSize;\n\n            // Set shadow ids if available\n            if ((s_gl.binaryGeometry != 0 || s_gl.externalGeometry != 0) && s_geo._vf[\"idsPerVertex\"] == true) {\n                sp.shadowIDs = (shape._vf.idOffset + x3dom.nodeTypes.Shape.objectID + 2);\n            }\n\n            // BoundingBox stuff\n            if (s_gl.coordType != gl.FLOAT) {\n                if (!s_gl.popGeometry && (x3dom.Utils.isUnsignedType(s_geo._vf.coordType))) {\n                    sp.bgCenter = s_geo.getMin().toGL();\n                } else {\n                    sp.bgCenter = s_geo._vf.position.toGL();\n                }\n                sp.bgSize = s_geo._vf.size.toGL();\n                sp.bgPrecisionMax = s_geo.getPrecisionMax('coordType');\n            }\n\n            if (pickMode == 1 && s_gl.colorType != gl.FLOAT) {\n                sp.bgPrecisionColMax = s_geo.getPrecisionMax('colorType');\n            }\n\n            if (pickMode == 2 && s_gl.texCoordType != gl.FLOAT) {\n                sp.bgPrecisionTexMax = s_geo.getPrecisionMax('texCoordType');\n            }\n\n            // Set ClipPlanes\n            if (shape._clipPlanes) {\n                sp.modelViewMatrix = mat_view.mult(trafo).toGL();\n                sp.viewMatrixInverse = mat_view.inverse().toGL();\n\n                if(this.VRMode == 2)\n                {\n                    sp.modelViewMatrix2 = mat_view_R.mult(trafo).toGL();\n                    sp.viewMatrixInverse2 = mat_view_R.inverse().toGL();\n                }\n\n                for (var cp = 0; cp < shape._clipPlanes.length; cp++) {\n                    var clip_plane = shape._clipPlanes[cp].plane;\n                    var clip_trafo = shape._clipPlanes[cp].trafo;\n\n                    sp['clipPlane' + cp + '_Plane'] = clip_trafo.multMatrixPlane(clip_plane._vf.plane).toGL();\n                    sp['clipPlane' + cp + '_CappingStrength'] = clip_plane._vf.cappingStrength;\n                    sp['clipPlane' + cp + '_CappingColor'] = clip_plane._vf.cappingColor.toGL();\n                }\n            }\n\n            // ImageGeometry stuff\n            if (s_gl.imageGeometry != 0 && !x3dom.caps.MOBILE)  // FIXME: mobile errors\n            {\n                sp.IG_bboxMin = s_geo.getMin().toGL();\n                sp.IG_bboxMax = s_geo.getMax().toGL();\n                sp.IG_implicitMeshSize = s_geo._vf.implicitMeshSize.toGL();  // FIXME\n\n                var coordTex = x3dom.Utils.findTextureByName(s_gl.texture, \"IG_coords0\");\n                if (coordTex) {\n                    sp.IG_coordTextureWidth = coordTex.texture.width;\n                    sp.IG_coordTextureHeight = coordTex.texture.height;\n                }\n\n                if (s_gl.imageGeometry == 1) {\n                    var indexTex = x3dom.Utils.findTextureByName(s_gl.texture, \"IG_index\");\n                    if (indexTex) {\n                        sp.IG_indexTextureWidth = indexTex.texture.width;\n                        sp.IG_indexTextureHeight = indexTex.texture.height;\n                    }\n\n                    gl.activeTexture(gl.TEXTURE0);\n                    gl.bindTexture(gl.TEXTURE_2D, indexTex.texture);\n\n                    gl.activeTexture(gl.TEXTURE1);\n                    gl.bindTexture(gl.TEXTURE_2D, coordTex.texture);\n                } else {\n                    gl.activeTexture(gl.TEXTURE0);\n                    gl.bindTexture(gl.TEXTURE_2D, coordTex.texture);\n                }\n\n                gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n                gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n                gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n                gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n\n                var texUnit = 0;\n                if (s_geo.getIndexTexture()) {\n                    if (!sp.IG_indexTexture) {\n                        sp.IG_indexTexture = texUnit++;\n                    }\n                }\n                if (s_geo.getCoordinateTexture(0)) {\n                    if (!sp.IG_coordinateTexture) {\n                        sp.IG_coordinateTexture = texUnit++;\n                    }\n                }\n            } else if ((s_gl.binaryGeometry != 0 || s_gl.externalGeometry != 0) && s_geo._vf[\"idsPerVertex\"] == true) { // MultiPart\n                var shader = s_app._shader;\n                if (shader && x3dom.isa(s_app._shader, x3dom.nodeTypes.CommonSurfaceShader)) {\n                    if (shader.getMultiVisibilityMap()) {\n                        sp.multiVisibilityMap = 0;\n                        var visTex = x3dom.Utils.findTextureByName(s_gl.texture, \"multiVisibilityMap\");\n                        sp.multiVisibilityWidth = visTex.texture.width;\n                        sp.multiVisibilityHeight = visTex.texture.height;\n                        gl.activeTexture(gl.TEXTURE0);\n                        gl.bindTexture(gl.TEXTURE_2D, visTex.texture);\n                        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n                        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n                        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n                        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n                    }\n                }\n            }\n\n            if (shape.isSolid()) {\n                this.stateManager.enable(gl.CULL_FACE);\n\n                if (shape.isCCW()) {\n                    this.stateManager.frontFace(gl.CCW);\n                } else {\n                    this.stateManager.frontFace(gl.CW);\n                }\n            } else {\n                this.stateManager.disable(gl.CULL_FACE);\n            }\n\n            // Set DepthMode\n            var depthMode = s_app ? s_app._cf.depthMode.node : null;\n            if (depthMode) {\n                if (depthMode._vf.enableDepthTest) {\n                    // Enable Depth Test\n                    this.stateManager.enable(gl.DEPTH_TEST);\n\n                    // Set Depth Mask\n                    this.stateManager.depthMask(!depthMode._vf.readOnly);\n\n                    // Set Depth Function\n                    this.stateManager.depthFunc(x3dom.Utils.depthFunc(gl, depthMode._vf.depthFunc));\n\n                    // Set Depth Range\n                    this.stateManager.depthRange(depthMode._vf.zNearRange, depthMode._vf.zFarRange);\n                } else {\n                    // Disable Depth Test\n                    this.stateManager.disable(gl.DEPTH_TEST);\n                }\n            } else {\n                // Set Defaults\n                this.stateManager.enable(gl.DEPTH_TEST);\n                this.stateManager.depthMask(true);\n                this.stateManager.depthFunc(gl.LEQUAL);\n            }\n\n            // PopGeometry: adapt LOD and set shader variables\n            if (s_gl.popGeometry) {\n                var model_view = mat_view.mult(trafo);\n                // FIXME; viewarea's width/height twice as big as render buffer size, which leads to too high precision\n                // the correct viewarea here would be one that holds this half-sized render buffer\n                this.updatePopState(drawable, s_geo, sp, s_gl, scene, model_view, viewarea, this.x3dElem.runtime.fps);\n            }\n\n            var q_n;\n            if (s_gl.externalGeometry != 0) {\n                q_n = shape.meshes.length;\n            } else {\n                q_n = s_gl.positions.length;\n            }\n            for (var q = 0; q < q_n; q++) {\n                var q6 = 6 * q;\n                var v, v_n, offset;\n\n                if (s_gl.externalGeometry != 0) {\n                    var mesh = shape.meshes[q];\n\n                    mesh.bindVertexAttribPointerPosition(gl, sp, false);\n                    mesh.render(gl, null);\n                } else if (!(sp.position !== undefined && s_gl.buffers[q6 + x3dom.BUFFER_IDX.POSITION] && s_gl.indexes[q]))\n                    continue;\n\n                indicesReady = false;\n                if (s_gl.externalGeometry == 0) {\n\n                    // set buffers\n                    if (s_gl.buffers[q6 + x3dom.BUFFER_IDX.INDEX]) {\n                        gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, s_gl.buffers[q6 + x3dom.BUFFER_IDX.INDEX]);\n                        indicesReady = true;\n                    }\n\n                    this.setVertexAttribEyeIdx(gl, sp);\n                    this.setVertexAttribPointerPosition(gl, shape, q6, q);\n\n                    if (pickMode == 1) {\n                        this.setVertexAttribPointerColor(gl, shape, q6, q);\n                    }\n\n                    if (pickMode == 2 && sp.texcoord !== undefined && s_gl.buffers[q6 + x3dom.BUFFER_IDX.TEXCOORD]) {\n                        this.setVertexAttribPointerTexCoord(gl, shape, q6, q);\n                    }\n\n                    if (sp.id !== undefined && s_gl.buffers[q6 + x3dom.BUFFER_IDX.ID]) {\n\n                        gl.bindBuffer(gl.ARRAY_BUFFER, s_gl.buffers[q6 + x3dom.BUFFER_IDX.ID]);\n                        // texture coordinate hack for IDs\n                        if ((s_gl.binaryGeometry != 0 || s_gl.externalGeometry != 0) && s_geo._vf[\"idsPerVertex\"] == true) {\n                            gl.vertexAttribPointer(sp.id,\n                                1, gl.FLOAT, false,\n                                4, 0);\n                            gl.enableVertexAttribArray(sp.id);\n                        } else {\n                            /*\n                             gl.vertexAttribPointer(sp.id,\n                             1, gl.FLOAT, false,\n                             shape._idStrideOffset[0], shape._idStrideOffset[1]);\n                             gl.enableVertexAttribArray(sp.id);\n                             */\n                        }\n                    }\n\n                    // render mesh\n                    if (indicesReady && (s_gl.binaryGeometry > 0 || s_gl.popGeometry > 0)) {\n                        for (v = 0, offset = 0, v_n = s_geo._vf.vertexCount.length; v < v_n; v++) {\n                            this.drawElements(gl, s_gl.primType[v], s_geo._vf.vertexCount[v], s_gl.indexType,\n                                x3dom.Utils.getByteAwareOffset(offset, s_gl.indexType, gl));\n                            offset += s_geo._vf.vertexCount[v];\n                        }\n                    } else if (s_gl.binaryGeometry < 0 || s_gl.popGeometry < 0 || s_gl.imageGeometry) {\n                        for (v = 0, offset = 0, v_n = s_geo._vf.vertexCount.length; v < v_n; v++) {\n                            gl.drawArrays(gl, s_gl.primType[v], offset, s_geo._vf.vertexCount[v]);\n                            offset += s_geo._vf.vertexCount[v];\n                        }\n                    } else if (indicesReady && (s_gl.bufferGeometry > 0)) {\n                        this.drawElements(gl, s_gl.primType[0], s_geo._vf.vertexCount[0], s_gl.indexType, shape._indexOffset);\n                    } else if (s_gl.bufferGeometry < 0) {\n                        this.drawArrays(gl, s_gl.primType[0], 0, s_geo._vf.vertexCount[0]);\n                    } else if (s_geo.hasIndexOffset()) {\n                        var indOff = shape.tessellationProperties();\n                        for (v = 0, v_n = indOff.length; v < v_n; v++) {\n                            this.drawElements(gl, s_gl.primType, indOff[v].count, s_gl.indexType,\n                                indOff[v].offset * x3dom.Utils.getOffsetMultiplier(s_gl.indexType, gl));\n                        }\n                    } else if (s_gl.indexes[q].length == 0) {\n                        this.drawArrays(gl, s_gl.primType, 0, s_gl.positions[q].length / 3);\n                    } else {\n                        this.drawElements(gl, s_gl.primType, s_gl.indexes[q].length, s_gl.indexType, 0);\n                    }\n\n                }\n\n                gl.disableVertexAttribArray(sp.position);\n\n                if (sp.texcoord !== undefined && s_gl.buffers[q6 + x3dom.BUFFER_IDX.TEXCOORD]) {\n                    gl.disableVertexAttribArray(sp.texcoord);\n                }\n                if (sp.color !== undefined && s_gl.buffers[q6 + x3dom.BUFFER_IDX.COLOR]) {\n                    gl.disableVertexAttribArray(sp.color);\n                }\n                if (sp.id !== undefined && s_gl.buffers[q6 + x3dom.BUFFER_IDX.ID]) {\n                    gl.disableVertexAttribArray(sp.id);\n                }\n\n                this.disableVertexAttribEyeIdx(gl, sp);\n            }\n\n            // Clean Texture units for IG\n            if (s_gl.imageGeometry != 0 && !x3dom.caps.MOBILE) {\n                gl.activeTexture(gl.TEXTURE0);\n                gl.bindTexture(gl.TEXTURE_2D, null);\n                if (s_gl.imageGeometry == 1) {\n                    gl.activeTexture(gl.TEXTURE1);\n                    gl.bindTexture(gl.TEXTURE_2D, null);\n                }\n            }\n        }\n\n        if (x3dom.Utils.needLineWidth) {\n            this.stateManager.lineWidth(1);\n        }\n\n        if (depthMode) {\n            this.stateManager.enable(gl.DEPTH_TEST);\n            this.stateManager.depthMask(true);\n            this.stateManager.depthFunc(gl.LEQUAL);\n            this.stateManager.depthRange(0, 1);\n        }\n\n        gl.flush();\n\n        try {\n            // 4 = 1 * 1 * 4; then take width x height window (exception pickRect)\n            var data = new Uint8Array(4 * width * height);\n\n            gl.readPixels(x, y, width, height, gl.RGBA, gl.UNSIGNED_BYTE, data);\n\n            scene._webgl.fboPick.pixelData = data;\n        }\n        catch (se) {\n            scene._webgl.fboPick.pixelData = [];\n            // No Exception on file:// when starting with additional flags:\n            //    chrome.exe --disable-web-security\n            x3dom.debug.logException(se + \" (cannot pick)\");\n        }\n\n        // gl.disable(gl.SCISSOR_TEST);\n\n        this.stateManager.bindFramebuffer(gl.FRAMEBUFFER, null);\n    };\n\n    /**\n     * Render single Shape\n     *\n     * @param drawable\n     * @param viewarea\n     * @param slights\n     * @param numLights\n     * @param mat_view\n     * @param mat_scene\n     * @param mat_light\n     * @param mat_proj\n     * @param gl\n     */\n    Context.prototype.renderShape = function(drawable, viewarea, slights, numLights, mat_view, mat_scene,\n                                             mat_light, mat_proj, gl) {\n        // Variable to indicate that the indices are successful bind\n        var indicesReady = false;\n\n        var shape = drawable.shape;\n        var transform = drawable.transform;\n\n        if (!shape || !shape._webgl || !transform) {\n            x3dom.debug.logError(\"[Context|RenderShape] No valid Shape!\");\n            return;\n        }\n\n        var s_gl = shape._webgl;\n        var sp = s_gl.shader;\n\n        if (!sp) {\n            x3dom.debug.logError(\"[Context|RenderShape] No Shader is set!\");\n            return;\n        }\n\n        var changed = this.stateManager.useProgram(sp);\n\n        // Set special Geometry variables\n        var s_app = shape._cf.appearance.node;\n        var s_geo = shape._cf.geometry.node;\n        var s_msh = s_geo._mesh;\n\n        var scene = viewarea._scene;\n        var tex = null;\n\n        if (s_gl.coordType != gl.FLOAT) {\n            if (!s_gl.popGeometry && (x3dom.Utils.isUnsignedType(s_geo._vf.coordType))) {\n                sp.bgCenter = s_geo.getMin().toGL();\n            } else {\n                sp.bgCenter = s_geo._vf.position.toGL();\n            }\n            sp.bgSize = s_geo._vf.size.toGL();\n            sp.bgPrecisionMax = s_geo.getPrecisionMax('coordType');\n        } else {\n            sp.bgCenter = [0, 0, 0];\n            sp.bgSize = [1, 1, 1];\n            sp.bgPrecisionMax = 1;\n        }\n\n        if (s_gl.colorType != gl.FLOAT) {\n            sp.bgPrecisionColMax = s_geo.getPrecisionMax('colorType');\n        } else {\n            sp.bgPrecisionColMax = 1;\n        }\n\n        if (s_gl.texCoordType != gl.FLOAT) {\n            sp.bgPrecisionTexMax = s_geo.getPrecisionMax('texCoordType');\n        } else {\n            sp.bgPrecisionTexMax = 1;\n        }\n\n        if (s_gl.normalType != gl.FLOAT) {\n            sp.bgPrecisionNorMax = s_geo.getPrecisionMax('normalType');\n        } else {\n            sp.bgPrecisionNorMax = 1;\n        }\n        if (s_gl.tangentType != gl.FLOAT) {\n            sp.bgPrecisionTangentMax = s_geo.getPrecisionMax('tangentType');\n        }\n        else {\n            sp.bgPrecisionTangentMax = 1;\n        }\n        if (s_gl.binormalType != gl.FLOAT) {\n            sp.bgPrecisionBinormalMax = s_geo.getPrecisionMax('binormalType');\n        }\n        else {\n            sp.bgPrecisionBinormalMax = 1;\n        }\n\n        if (s_gl.imageGeometry != 0) {\n            sp.IG_bboxMin = s_geo.getMin().toGL();\n            sp.IG_bboxMax = s_geo.getMax().toGL();\n            sp.IG_implicitMeshSize = s_geo._vf.implicitMeshSize.toGL();  // FIXME\n\n            tex = x3dom.Utils.findTextureByName(s_gl.texture, \"IG_coords0\");\n            if (tex) {\n                sp.IG_coordTextureWidth = tex.texture.width;\n                sp.IG_coordTextureHeight = tex.texture.height;\n            }\n\n            if (s_gl.imageGeometry == 1) {\n                tex = x3dom.Utils.findTextureByName(s_gl.texture, \"IG_index\");\n                if (tex) {\n                    sp.IG_indexTextureWidth = tex.texture.width;\n                    sp.IG_indexTextureHeight = tex.texture.height;\n                }\n            }\n            tex = null;\n        }\n\n        // Set fog\n        // TODO: when no state/shader switch happens, all light/fog/... uniforms don't need to be set again\n        var fog = scene.getFog();\n\n        // THINKABOUTME: changed flag only works as long as lights and fog are global\n        if (fog && changed) {\n            sp.fogColor = fog._vf.color.toGL();\n            sp.fogRange = fog._vf.visibilityRange;\n            sp.fogType = (fog._vf.fogType == \"LINEAR\") ? 0.0 : 1.0;\n        }\n\n        // Set Material\n        var mat = s_app ? s_app._cf.material.node : null;\n        var shader = s_app ? s_app._shader : null;\n        var twoSidedMat = false;\n\n        var isUserDefinedShader = shader && x3dom.isa(shader, x3dom.nodeTypes.ComposedShader);\n\n        if (s_gl.csshader) {\n            sp.diffuseColor = shader._vf.diffuseFactor.toGL();\n            sp.specularColor = shader._vf.specularFactor.toGL();\n            sp.emissiveColor = shader._vf.emissiveFactor.toGL();\n            sp.shininess = shader._vf.shininessFactor;\n            sp.ambientIntensity = (shader._vf.ambientFactor.x +\n                shader._vf.ambientFactor.y +\n                shader._vf.ambientFactor.z) / 3;\n            sp.transparency = 1.0 - shader._vf.alphaFactor;\n            sp.environmentFactor = shader._vf.environmentFactor.x;\n            sp.normalBias = shader._vf.normalBias.toGL();\n\n            if (shader.getDisplacementMap()) {\n                tex = x3dom.Utils.findTextureByName(s_gl.texture, \"displacementMap\");\n                sp.displacementWidth = tex.texture.width;\n                sp.displacementHeight = tex.texture.height;\n                sp.displacementFactor = shader._vf.displacementFactor;\n                sp.displacementAxis = (shader._vf.displacementAxis == \"x\") ? 0.0 :\n                    (shader._vf.displacementAxis == \"y\") ? 1.0 : 2.0;\n            } else if (shader.getDiffuseDisplacementMap()) {\n                tex = x3dom.Utils.findTextureByName(s_gl.texture, \"diffuseDisplacementMap\");\n                sp.displacementWidth = tex.texture.width;\n                sp.displacementHeight = tex.texture.height;\n                sp.displacementFactor = shader._vf.displacementFactor;\n                sp.displacementAxis = (shader._vf.displacementAxis == \"x\") ? 0.0 :\n                    (shader._vf.displacementAxis == \"y\") ? 1.0 : 2.0;\n            }\n            if (shader.getMultiDiffuseAlphaMap()) {\n                tex = x3dom.Utils.findTextureByName(s_gl.texture, \"multiDiffuseAlphaMap\");\n                sp.multiDiffuseAlphaWidth = tex.texture.width;\n                sp.multiDiffuseAlphaHeight = tex.texture.height;\n            }\n            if (shader.getMultiEmissiveAmbientMap()) {\n                tex = x3dom.Utils.findTextureByName(s_gl.texture, \"multiEmissiveAmbientMap\");\n                sp.multiEmissiveAmbientWidth = tex.texture.width;\n                sp.multiEmissiveAmbientHeight = tex.texture.height;\n            }\n            if (shader.getMultiSpecularShininessMap()) {\n                tex = x3dom.Utils.findTextureByName(s_gl.texture, \"multiSpecularShininessMap\");\n                sp.multiSpecularShininessWidth = tex.texture.width;\n                sp.multiSpecularShininessHeight = tex.texture.height;\n            }\n            if (shader.getMultiVisibilityMap()) {\n                tex = x3dom.Utils.findTextureByName(s_gl.texture, \"multiVisibilityMap\");\n                sp.multiVisibilityWidth = tex.texture.width;\n                sp.multiVisibilityHeight = tex.texture.height;\n            }\n        }\n        else if (mat && x3dom.isa(mat, x3dom.nodeTypes.PhysicalMaterial)) {\n            if (mat._vf.model == \"roughnessMetallic\") {\n                sp.diffuseColor     = [mat._vf.baseColorFactor.r,\n                                       mat._vf.baseColorFactor.g,\n                                       mat._vf.baseColorFactor.b];\n\n                sp.specularColor    = [x3dom.Utils.lerp(0.04, mat._vf.baseColorFactor.r, mat._vf.metallicFactor),\n                                       x3dom.Utils.lerp(0.04, mat._vf.baseColorFactor.g, mat._vf.metallicFactor),\n                                       x3dom.Utils.lerp(0.04, mat._vf.baseColorFactor.b, mat._vf.metallicFactor)];\n\n                sp.shininess        = 1.0 - mat._vf.roughnessFactor;\n                sp.metallicFactor   = mat._vf.metallicFactor;\n                sp.transparency     = 1.0 - mat._vf.baseColorFactor.a;\n            } else {\n                sp.diffuseColor     = [mat._vf.diffuseFactor.r,\n                                       mat._vf.diffuseFactor.g,\n                                       mat._vf.diffuseFactor.b];\n\n                sp.specularColor    = [mat._vf.specularFactor.r,\n                                       mat._vf.specularFactor.g,\n                                       mat._vf.specularFactor.b];\n\n\n                sp.shininess        = mat._vf.glossinessFactor;\n                sp.transparency     = 1.0 - mat._vf.diffuseFactor.a;\n            }\n\n            sp.emissiveColor    = mat._vf.emissiveFactor.toGL();\n            sp.normalBias       = mat._vf.normalBias.toGL();\n            sp.ambientIntensity = 1.0;\n            sp.alphaCutoff      = mat._vf.alphaCutoff;\n\n        } else if (mat) {\n            sp.diffuseColor      = mat._vf.diffuseColor.toGL();\n            sp.specularColor     = mat._vf.specularColor.toGL();\n            sp.emissiveColor     = mat._vf.emissiveColor.toGL();\n            sp.shininess         = mat._vf.shininess;\n            sp.ambientIntensity  = mat._vf.ambientIntensity;\n            sp.transparency      = mat._vf.transparency;\n            sp.environmentFactor = 0.0;\n            sp.alphaCutoff       = s_app._vf.alphaClipThreshold.toFixed(2);\n            if (x3dom.isa(mat, x3dom.nodeTypes.TwoSidedMaterial)) {\n                twoSidedMat             = true;\n                sp.backDiffuseColor     = mat._vf.backDiffuseColor.toGL();\n                sp.backSpecularColor    = mat._vf.backSpecularColor.toGL();\n                sp.backEmissiveColor    = mat._vf.backEmissiveColor.toGL();\n                sp.backShininess        = mat._vf.backShininess;\n                sp.backAmbientIntensity = mat._vf.backAmbientIntensity;\n                sp.backTransparency     = mat._vf.backTransparency;\n            }\n        } else {\n            sp.diffuseColor     = [1.0, 1.0, 1.0];\n            sp.specularColor    = [0.0, 0.0, 0.0];\n            sp.emissiveColor    = [0.0, 0.0, 0.0];\n            sp.shininess        = 0.0;\n            sp.ambientIntensity = 1.0;\n            sp.transparency     = 0.0;\n            sp.alphaCutoff      = 0.1\n        }\n\n        // Look for user-defined shaders\n        if (shader) {\n            if (isUserDefinedShader) {\n                for (var fName in shader._vf) {\n                    if (shader._vf.hasOwnProperty(fName) && fName !== 'language') {\n                        var field = shader._vf[fName];\n                        if (field !== undefined && field !== null) {\n                            if (field.toGL) {\n                                sp[fName] = field.toGL();\n                            } else {\n                                sp[fName] = field;\n                            }\n                        }\n                    }\n                }\n            } else if (x3dom.isa(shader, x3dom.nodeTypes.CommonSurfaceShader)) {\n                s_gl.csshader = shader;\n            }\n        }\n\n        // Set Lights\n        //===========================================================================\n        var physicalEnvironmentLight;\n\n        for (var p = 0; p < numLights && changed; p++) {\n            // FIXME; getCurrentTransform() doesn't work for shared lights/objects!\n            var light_transform = mat_view.mult(slights[p].getCurrentTransform());\n\n            if (x3dom.isa(slights[p], x3dom.nodeTypes.DirectionalLight)) {\n                sp['light' + p + '_Type'] = 0.0;\n                sp['light' + p + '_On'] = (slights[p]._vf.on) ? 1.0 : 0.0;\n                sp['light' + p + '_Color'] = slights[p]._vf.color.toGL();\n                sp['light' + p + '_Intensity'] = slights[p]._vf.intensity;\n                sp['light' + p + '_AmbientIntensity'] = slights[p]._vf.ambientIntensity;\n                sp['light' + p + '_Direction'] = light_transform.multMatrixVec(slights[p]._vf.direction).toGL();\n                sp['light' + p + '_Attenuation'] = [1.0, 1.0, 1.0];\n                sp['light' + p + '_Location'] = [1.0, 1.0, 1.0];\n                sp['light' + p + '_Radius'] = 0.0;\n                sp['light' + p + '_BeamWidth'] = 0.0;\n                sp['light' + p + '_CutOffAngle'] = 0.0;\n                sp['light' + p + '_ShadowIntensity'] = slights[p]._vf.shadowIntensity;\n            } else if (x3dom.isa(slights[p], x3dom.nodeTypes.PointLight)) {\n                sp['light' + p + '_Type'] = 1.0;\n                sp['light' + p + '_On'] = (slights[p]._vf.on) ? 1.0 : 0.0;\n                sp['light' + p + '_Color'] = slights[p]._vf.color.toGL();\n                sp['light' + p + '_Intensity'] = slights[p]._vf.intensity;\n                sp['light' + p + '_AmbientIntensity'] = slights[p]._vf.ambientIntensity;\n                sp['light' + p + '_Direction'] = [1.0, 1.0, 1.0];\n                sp['light' + p + '_Attenuation'] = slights[p]._vf.attenuation.toGL();\n                sp['light' + p + '_Location'] = light_transform.multMatrixPnt(slights[p]._vf.location).toGL();\n                sp['light' + p + '_Radius'] = slights[p]._vf.radius;\n                sp['light' + p + '_BeamWidth'] = 0.0;\n                sp['light' + p + '_CutOffAngle'] = 0.0;\n                sp['light' + p + '_ShadowIntensity'] = slights[p]._vf.shadowIntensity;\n            } else if (x3dom.isa(slights[p], x3dom.nodeTypes.SpotLight)) {\n                sp['light' + p + '_Type'] = 2.0;\n                sp['light' + p + '_On'] = (slights[p]._vf.on) ? 1.0 : 0.0;\n                sp['light' + p + '_Color'] = slights[p]._vf.color.toGL();\n                sp['light' + p + '_Intensity'] = slights[p]._vf.intensity;\n                sp['light' + p + '_AmbientIntensity'] = slights[p]._vf.ambientIntensity;\n                sp['light' + p + '_Direction'] = light_transform.multMatrixVec(slights[p]._vf.direction).toGL();\n                sp['light' + p + '_Attenuation'] = slights[p]._vf.attenuation.toGL();\n                sp['light' + p + '_Location'] = light_transform.multMatrixPnt(slights[p]._vf.location).toGL();\n                sp['light' + p + '_Radius'] = slights[p]._vf.radius;\n                sp['light' + p + '_BeamWidth'] = slights[p]._vf.beamWidth;\n                sp['light' + p + '_CutOffAngle'] = slights[p]._vf.cutOffAngle;\n                sp['light' + p + '_ShadowIntensity'] = slights[p]._vf.shadowIntensity;\n            }\n            else if (x3dom.isa(slights[p], x3dom.nodeTypes.PhysicalEnvironmentLight)) {\n                physicalEnvironmentLight = slights[p];\n                numLights--;\n            }\n        }\n\n        // Set HeadLight\n        var nav = scene.getNavigationInfo();\n\n        if (nav._vf.headlight && changed) {\n            numLights = (numLights) ? numLights : 0;\n            sp['light' + numLights + '_Type'] = 0.0;\n            sp['light' + numLights + '_On'] = 1.0;\n            sp['light' + numLights + '_Color'] = [1.0, 1.0, 1.0];\n            sp['light' + numLights + '_Intensity'] = 1.0;\n            sp['light' + numLights + '_AmbientIntensity'] = 0.0;\n            sp['light' + numLights + '_Direction'] = [0.0, 0.0, -1.0];\n            sp['light' + numLights + '_Attenuation'] = [1.0, 1.0, 1.0];\n            sp['light' + numLights + '_Location'] = [1.0, 1.0, 1.0];\n            sp['light' + numLights + '_Radius'] = 0.0;\n            sp['light' + numLights + '_BeamWidth'] = 0.0;\n            sp['light' + numLights + '_CutOffAngle'] = 0.0;\n            sp['light' + numLights + '_ShadowIntensity'] = 0.0;\n        }\n\n        // Set ClipPlanes\n        if (shape._clipPlanes) {\n            for (var cp = 0; cp < shape._clipPlanes.length; cp++) {\n                var clip_plane = shape._clipPlanes[cp].plane;\n                var clip_trafo = shape._clipPlanes[cp].trafo;\n\n                sp['clipPlane' + cp + '_Plane'] = clip_trafo.multMatrixPlane(clip_plane._vf.plane).toGL();\n                sp['clipPlane' + cp + '_CappingStrength'] = clip_plane._vf.cappingStrength;\n                sp['clipPlane' + cp + '_CappingColor'] = clip_plane._vf.cappingColor.toGL();\n            }\n        }\n\n        // Set DepthMode\n        var depthMode = s_app ? s_app._cf.depthMode.node : null;\n        if (depthMode) {\n            if (depthMode._vf.enableDepthTest) {\n                // Enable Depth Test\n                this.stateManager.enable(gl.DEPTH_TEST);\n\n                // Set Depth Mask\n                this.stateManager.depthMask(!depthMode._vf.readOnly);\n\n                // Set Depth Function\n                this.stateManager.depthFunc(x3dom.Utils.depthFunc(gl, depthMode._vf.depthFunc));\n\n                // Set Depth Range\n                this.stateManager.depthRange(depthMode._vf.zNearRange, depthMode._vf.zFarRange);\n            } else {\n                // Disable Depth Test\n                this.stateManager.disable(gl.DEPTH_TEST);\n            }\n        } else {\n            // Set Defaults\n            this.stateManager.enable(gl.DEPTH_TEST);\n            this.stateManager.depthMask(true);\n            this.stateManager.depthFunc(gl.LEQUAL);\n        }\n\n        // Set BlendMode\n        var blendMode = s_app ? s_app._cf.blendMode.node : null;\n        if (blendMode) {\n            var srcFactor = x3dom.Utils.blendFunc(gl, blendMode._vf.srcFactor);\n            var destFactor = x3dom.Utils.blendFunc(gl, blendMode._vf.destFactor);\n\n            if (srcFactor && destFactor) {\n                // Enable Blending\n                this.stateManager.enable(gl.BLEND);\n\n                // Set Blend Function\n                this.stateManager.blendFuncSeparate(srcFactor, destFactor, gl.ONE, gl.ONE);\n\n                // Set Blend Color\n                this.stateManager.blendColor(blendMode._vf.color.r,\n                    blendMode._vf.color.g,\n                    blendMode._vf.color.b,\n                    1.0 - blendMode._vf.colorTransparency);\n\n                // Set Blend Equation\n                this.stateManager.blendEquation(x3dom.Utils.blendEquation(gl, blendMode._vf.equation));\n            } else {\n                this.stateManager.disable(gl.BLEND);\n            }\n        } else {\n            //Get it from physicalmaterial or set defaults\n            if(mat && x3dom.isa(mat, x3dom.nodeTypes.PhysicalMaterial))\n            {\n                if(mat._vf.alphaMode == \"BLEND\")\n                {\n                    this.stateManager.enable(gl.BLEND);\n                    this.stateManager.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE);\n                }\n                else\n                {\n                    this.stateManager.disable(gl.BLEND);\n                }\n            }\n            else\n            {\n                // Set Defaults\n                this.stateManager.enable(gl.BLEND);\n                this.stateManager.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE);\n            }\n        }\n\n        // Set ColorMaskMode\n        var colorMaskMode = s_app ? s_app._cf.colorMaskMode.node : null;\n        if (colorMaskMode) {\n            this.stateManager.colorMask(colorMaskMode._vf.maskR,\n                colorMaskMode._vf.maskG,\n                colorMaskMode._vf.maskB,\n                colorMaskMode._vf.maskA);\n        } else {\n            // Set Defaults\n            this.stateManager.colorMask(true, true, true, true);\n        }\n\n        // Set LineProperties (only linewidthScaleFactor, interpreted as lineWidth)\n        var lineProperties = s_app ? s_app._cf.lineProperties.node : null;\n        if (lineProperties) {\n            this.stateManager.lineWidth(lineProperties._vf.linewidthScaleFactor);\n        } else if (x3dom.Utils.needLineWidth) {\n            // Set Defaults\n            this.stateManager.lineWidth(1);\n        }\n\n        if (shape.isSolid() && !twoSidedMat) {\n            this.stateManager.enable(gl.CULL_FACE);\n\n            if (shape.isCCW()) {\n                this.stateManager.frontFace(gl.CCW);\n            } else {\n                this.stateManager.frontFace(gl.CW);\n            }\n        } else {\n            this.stateManager.disable(gl.CULL_FACE);\n        }\n\n        // transformation matrices\n        var model_view = mat_view.mult(transform);\n        var model_view_inv = model_view.inverse();\n\n        sp.screenWidth = this.canvas.width;\n\n        sp.isOrthoView = ( mat_proj._33 == 1 ) ? 1.0 : 0.0;\n\n        sp.modelMatrix = transform.toGL();\n        sp.modelViewMatrix = model_view.toGL();\n        sp.viewMatrix = mat_view.toGL();\n\n        sp.normalMatrix = model_view_inv.transpose().toGL();\n        sp.modelViewMatrixInverse = model_view_inv.toGL();\n\n        sp.modelViewProjectionMatrix = mat_scene.mult(transform).toGL();\n        sp.modelViewProjectionInverseMatrix = mat_scene.mult(transform).inverse().toGL();\n\n        sp.viewMatrixInverse = mat_view.inverse().toGL();\n\n        sp.cameraPosWS = mat_view.inverse().e3().toGL();\n\n        this.setTonemappingOperator(viewarea, sp);       \n\n        // only calculate on \"request\" (maybe of interest for users)\n        // may be used by external materials\n        if (isUserDefinedShader || s_gl.externalGeometry != 0) {\n            sp.model = transform.toGL();\n            sp.projectionMatrix = mat_proj.toGL();\n\n            sp.worldMatrix = transform.toGL();\n            sp.worldInverseTranspose = transform.inverse().transpose().toGL();\n        }\n\n        if(this.VRMode == 2)\n        {\n            var mat_view_R = viewarea.getViewMatrices()[1];\n            var mat_proj_R = viewarea.getProjectionMatrices()[1];\n            var mat_scene_R = mat_proj_R.mult(mat_view_R);\n            var model_view_R = mat_view_R.mult(transform);\n            var model_view_R_inv = model_view_R.inverse();\n\n            sp.viewMatrix2      = mat_view_R.toGL();\n            sp.modelViewMatrix2 = model_view_R.toGL();\n\n            sp.normalMatrix2 = model_view_R_inv.transpose().toGL();\n            sp.modelViewMatrixInverse2 = model_view_R_inv.toGL();\n\n            sp.modelViewProjectionMatrix2 = mat_scene_R.mult(transform).toGL();\n\n            sp.isVR = 1.0;\n        }\n        else\n        {\n            sp.isVR = 0.0\n        }\n\n        // PopGeometry: adapt LOD and set shader variables\n        if (s_gl.popGeometry) {\n            this.updatePopState(drawable, s_geo, sp, s_gl, scene, model_view, viewarea, this.x3dElem.runtime.fps);\n        }\n\n        for (var cnt = 0, cnt_n = s_gl.texture.length; cnt < cnt_n; cnt++) {\n            tex = s_gl.texture[cnt];\n\n            gl.activeTexture(gl.TEXTURE0 + cnt);\n            gl.bindTexture(tex.type, tex.texture);\n            gl.texParameteri(tex.type, gl.TEXTURE_WRAP_S, tex.wrapS);\n            gl.texParameteri(tex.type, gl.TEXTURE_WRAP_T, tex.wrapT);\n            gl.texParameteri(tex.type, gl.TEXTURE_MAG_FILTER, tex.magFilter);\n            gl.texParameteri(tex.type, gl.TEXTURE_MIN_FILTER, tex.minFilter);\n\n            if (x3dom.caps.ANISOTROPIC) {\n                gl.texParameterf(tex.type, x3dom.caps.ANISOTROPIC.TEXTURE_MAX_ANISOTROPY_EXT, tex.anisotropicDegree);\n            }\n\n            if (!shader || !isUserDefinedShader) {\n                if (!sp[tex.samplerName])\n                    sp[tex.samplerName] = cnt;\n            }\n        }\n\n        if(x3dom.isa(mat, x3dom.nodeTypes.PhysicalMaterial) &&\n           physicalEnvironmentLight != undefined &&\n           physicalEnvironmentLight._vf.diffuse != \"\" &&\n           physicalEnvironmentLight._vf.specular != \"\")\n        {\n            var diffuseURL  = physicalEnvironmentLight._nameSpace.getURL(physicalEnvironmentLight._vf.diffuse);\n            var specularURL = physicalEnvironmentLight._nameSpace.getURL(physicalEnvironmentLight._vf.specular);\n            var brdfURL     = x3dom.BRDF_LUT\n\n            //Get BRDF LUT Texture\n            var brdf_lut = this.cache.getTexture2D(gl, shape._nameSpace.doc, brdfURL, false, 'anonymous', false, false, true);\n            var diffuse  = this.cache.getTextureCube(gl, shape._nameSpace.doc, [diffuseURL], false, 'anonymous', false, false, true);\n            var specular = this.cache.getTextureCube(gl, shape._nameSpace.doc, [specularURL], false, 'anonymous', false, false, true);\n\n            gl.activeTexture(gl.TEXTURE0 + cnt_n);\n\n            gl.bindTexture(gl.TEXTURE_2D, brdf_lut);\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\n            sp.brdfMap = cnt_n++;\n\n            if(diffuse.ready)\n            {\n                gl.activeTexture(gl.TEXTURE0 + cnt_n);\n\n                gl.bindTexture(gl.TEXTURE_CUBE_MAP, diffuse);\n                gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n                gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n                gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n                gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\n                sp.diffuseEnvironmentMap = cnt_n++;\n            }\n\n            if(specular.ready)\n            {\n                gl.activeTexture(gl.TEXTURE0 + cnt_n);\n\n                gl.bindTexture(gl.TEXTURE_CUBE_MAP, specular);\n                gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_LINEAR);\n                gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n                gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n                gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\n                sp.specularEnvironmentMap = cnt_n++;\n            }\n\n        }\n\n\n        if (s_app && s_app._cf.textureTransform.node) {\n            var texTrafo = s_app.texTransformMatrix();\n            sp.texTrafoMatrix = texTrafo.toGL();\n        }\n\n\n        // FIXME: what if geometry with split mesh has dynamic fields?\n        var attrib = null;\n        var df, df_n = s_gl.dynamicFields.length;\n\n        for (df = 0; df < df_n; df++) {\n            attrib = s_gl.dynamicFields[df];\n\n            if (sp[attrib.name] !== undefined) {\n                gl.bindBuffer(gl.ARRAY_BUFFER, attrib.buf);\n\n                gl.vertexAttribPointer(sp[attrib.name], attrib.numComponents, gl.FLOAT, false, 0, 0);\n                gl.enableVertexAttribArray(sp[attrib.name]);\n            }\n        }\n\n        // render object\n        var v, v_n, offset, q_n;\n        var isParticleSet = false;\n\n        if (x3dom.isa(s_geo, x3dom.nodeTypes.ParticleSet)) {\n            isParticleSet = true;\n        }\n\n        if (s_gl.externalGeometry != 0) {\n            q_n = shape.meshes.length;\n        } else {\n            q_n = s_gl.positions.length;\n        }\n\n        for (var q = 0; q < q_n; q++) {\n            var q6 = 6 * q;\n\n            // rendering from src/glb data\n            if (s_gl.externalGeometry != 0) {\n                var mesh = shape.meshes[q];\n                var exGeomShaderProgram = sp;\n\n                var model = transform.mult(mesh.transform);\n                sp.model = sp.worldMatrix = model.toGL();\n\n                sp.viewMatrix      = mat_view.toGL();\n\n                model_view = mat_view.mult(model);\n                model_view_inv = model_view.inverse();\n\n                sp.modelViewMatrix = model_view.toGL();\n\n                sp.normalMatrix = model_view_inv.transpose().toGL();\n                sp.modelViewMatrixInverse = model_view_inv.toGL();\n\n                sp.modelViewProjectionMatrix = mat_scene.mult(model).toGL();\n\n                sp.modelViewProjectionInverseMatrix = mat_scene.mult(model).inverse().toGL();\n\n                sp.worldInverseTranspose = model.inverse().transpose().toGL();\n\n                if(mesh.material!=null){\n\n                    if(mesh.material.setShader != null)\n                        mesh.material.setShader(gl, this.cache, shape, shape.getShaderProperties(viewarea));\n\n                    mesh.material.bind(gl, sp, this.cache, shape.getShaderProperties(viewarea));\n\n                    if(mesh.material.program!=null){\n                        exGeomShaderProgram = mesh.material.program;\n                    }\n                }\n\n                mesh.bindVertexAttribPointer(gl, exGeomShaderProgram);\n                var renderMode = viewarea.getRenderMode();\n\n                var polyMode = null;\n                if (renderMode > 0)\n                    polyMode = (renderMode == 1) ? gl.POINTS : gl.LINES;\n\n                mesh.render(gl, polyMode);\n            } else if (!(sp.position !== undefined && s_gl.buffers[q6 + x3dom.BUFFER_IDX.POSITION] && s_gl.indexes[q])) {\n                continue;\n            } else {\n                indicesReady = false;\n\n                if (!(sp.position !== undefined && s_gl.buffers[q6 + x3dom.BUFFER_IDX.POSITION] && (s_gl.indexes[q])))\n                    continue;\n\n                if (s_gl.buffers[q6 + x3dom.BUFFER_IDX.INDEX]) {\n                    if (isParticleSet && s_geo.drawOrder() != \"any\") {  // sort\n                        var indexArray, zPos = [];\n                        var pnts = s_geo._cf.coord.node.getPoints();\n                        var pn = (pnts.length == s_gl.indexes[q].length) ? s_gl.indexes[q].length : 0;\n\n                        for (var i = 0; i < pn; i++) {\n                            var center = model_view.multMatrixPnt(pnts[i]);\n                            zPos.push([i, center.z]);\n                        }\n\n                        if (s_geo.drawOrder() == \"backtofront\") {\n                            zPos.sort(function(a, b) {\n                                return a[1] - b[1];\n                            });\n                        } else {\n                            zPos.sort(function(b, a) {\n                                return a[1] - b[1];\n                            });\n                        }\n\n                        for (i = 0; i < pn; i++) {\n                            shape._webgl.indexes[q][i] = zPos[i][0];\n                        }\n\n                        if (x3dom.caps.INDEX_UINT && (pn > 65535)) {\n                            indexArray = new Uint32Array(shape._webgl.indexes[q]);\n                            shape._webgl.indexType = gl.UNSIGNED_INT;\n                        } else {\n                            indexArray = new Uint16Array(shape._webgl.indexes[q]);\n                            shape._webgl.indexType = gl.UNSIGNED_SHORT;\n                        }\n\n                        gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, s_gl.buffers[q6 + x3dom.BUFFER_IDX.INDEX]);\n                        gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indexArray, gl.DYNAMIC_DRAW);\n\n                        indexArray = null;\n                    }\n\n                    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, s_gl.buffers[q6 + x3dom.BUFFER_IDX.INDEX]);\n                    indicesReady = true;\n                }\n\n                this.setVertexAttribEyeIdx(gl, sp);\n                this.setVertexAttribPointerPosition(gl, shape, q6, q);\n                this.setVertexAttribPointerNormal(gl, shape, q6, q);\n                this.setVertexAttribPointerTexCoord(gl, shape, q6, q);\n                this.setVertexAttribPointerTexCoord2(gl, shape, q6, q);\n                this.setVertexAttribPointerColor(gl, shape, q6, q);\n                this.setVertexAttribPointerTangent(gl, shape, q6, q);\n                this.setVertexAttribPointerBinormal(gl, shape, q6, q);\n\n                if ((sp.id !== undefined || sp.particleSize !== undefined) && shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.ID]) {\n                    gl.bindBuffer(gl.ARRAY_BUFFER, shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.ID]);\n                    // texture coordinate hack for IDs\n                    if ((s_gl.binaryGeometry != 0 || s_gl.externalGeometry != 0) && s_geo._vf[\"idsPerVertex\"] == true) {\n                        gl.vertexAttribPointer(sp.id,\n                            1, gl.FLOAT, false, 4, 0);\n                        gl.enableVertexAttribArray(sp.id);\n                    } else if (isParticleSet) {\n                        gl.vertexAttribPointer(sp.particleSize,\n                            3, gl.FLOAT, false, 0, 0);\n                        gl.enableVertexAttribArray(sp.particleSize);\n                    }\n                }\n                if (s_gl.popGeometry != 0 && s_gl.buffers[q6 + x3dom.BUFFER_IDX.ID]) {\n                    // special case: mimic gl_VertexID\n                    gl.bindBuffer(gl.ARRAY_BUFFER, s_gl.buffers[q6 + x3dom.BUFFER_IDX.ID]);\n\n                    gl.vertexAttribPointer(sp.PG_vertexID, 1, gl.FLOAT, false, 4, 0);\n                    gl.enableVertexAttribArray(sp.PG_vertexID);\n                }\n\n                // TODO: implement surface with additional wireframe render mode (independent from poly mode)\n                var indOff, renderMode = viewarea.getRenderMode();\n\n                if (renderMode > 0) {\n                    var polyMode = (renderMode == 1) ? gl.POINTS : gl.LINES;\n\n                    if (indicesReady && (s_gl.binaryGeometry > 0 || s_gl.popGeometry > 0)) {\n                        for (v = 0, offset = 0, v_n = s_geo._vf.vertexCount.length; v < v_n; v++) {\n                            this.drawElements(gl, polyMode, s_geo._vf.vertexCount[v], s_gl.indexType,\n                                x3dom.Utils.getByteAwareOffset(offset, s_gl.indexType, gl));\n                            offset += s_geo._vf.vertexCount[v];\n                        }\n                    } else if (s_gl.binaryGeometry < 0 || s_gl.popGeometry < 0 || s_gl.imageGeometry) {\n                        for (v = 0, offset = 0, v_n = s_geo._vf.vertexCount.length; v < v_n; v++) {\n                            this.drawArrays(gl, polyMode, offset, s_geo._vf.vertexCount[v]);\n                            offset += s_geo._vf.vertexCount[v];\n                        }\n                    }\n                    else if (indicesReady && (s_gl.bufferGeometry > 0)) {\n                        this.drawElements(gl, s_gl.primType[0], s_geo._vf.vertexCount[0], s_gl.indexType, shape._indexOffset);\n                    } else if (s_gl.bufferGeometry < 0) {\n                        this.drawArrays(gl, s_gl.primType[0], 0, s_geo._vf.vertexCount[0]);\n                    } else if (s_geo.hasIndexOffset()) {\n                        // IndexedTriangleStripSet with primType TRIANGLE_STRIP,\n                        // and Patch geometry from external BVHRefiner component\n                        indOff = shape.tessellationProperties();\n                        for (v = 0, v_n = indOff.length; v < v_n; v++) {\n                            this.drawElements(gl, polyMode, indOff[v].count, s_gl.indexType,\n                                indOff[v].offset * x3dom.Utils.getOffsetMultiplier(s_gl.indexType, gl));\n                        }\n                    } else if (s_gl.indexes[q].length == 0) {\n                        this.drawArrays(gl, polyMode, 0, s_gl.positions[q].length / 3);\n                    } else {\n                        this.drawElements(gl, polyMode, s_gl.indexes[q].length, s_gl.indexType, 0);\n                    }\n                } else {\n                    if (indicesReady && (s_gl.binaryGeometry > 0 || s_gl.popGeometry > 0)) {\n                        for (v = 0, offset = 0, v_n = s_geo._vf.vertexCount.length; v < v_n; v++) {\n                            this.drawElements(gl, s_gl.primType[v], s_geo._vf.vertexCount[v], s_gl.indexType,\n                                x3dom.Utils.getByteAwareOffset(offset, s_gl.indexType, gl));\n                            offset += s_geo._vf.vertexCount[v];\n                        }\n                    } else if (s_gl.binaryGeometry < 0 || s_gl.popGeometry < 0 || s_gl.imageGeometry) {\n                        for (v = 0, offset = 0, v_n = s_geo._vf.vertexCount.length; v < v_n; v++) {\n                            this.drawArrays(gl, s_gl.primType[v], offset, s_geo._vf.vertexCount[v]);\n                            offset += s_geo._vf.vertexCount[v];\n                        }\n                    } else if (indicesReady && (s_gl.bufferGeometry > 0)) {\n                        this.drawElements(gl, s_gl.primType[0], s_geo._vf.vertexCount[0], s_gl.indexType, shape._indexOffset);\n                    } else if (s_gl.bufferGeometry < 0) {\n                        this.drawArrays(gl, s_gl.primType[0], 0, s_geo._vf.vertexCount[0]);\n                    } else if (s_geo.hasIndexOffset()) {\n                        // IndexedTriangleStripSet with primType TRIANGLE_STRIP,\n                        // and Patch geometry from external BVHRefiner component\n                        indOff = shape.tessellationProperties();\n                        for (v = 0, v_n = indOff.length; v < v_n; v++) {\n                            this.drawElements(gl, s_gl.primType, indOff[v].count, s_gl.indexType,\n                                indOff[v].offset * x3dom.Utils.getOffsetMultiplier(s_gl.indexType, gl));\n                        }\n                    } else if (s_gl.indexes[q].length == 0) {\n                        this.drawArrays(gl, s_gl.primType, 0, s_gl.positions[q].length / 3);\n                    } else {\n                        this.drawElements(gl, s_gl.primType, s_gl.indexes[q].length, s_gl.indexType, 0);\n                    }\n                }\n            }\n\n            // disable all used vertex attributes\n            gl.disableVertexAttribArray(sp.position);\n\n            if (sp.normal !== undefined) {\n                gl.disableVertexAttribArray(sp.normal);\n            }\n\n            this.disableVertexAttribEyeIdx(gl, sp);\n\n            if (sp.texcoord !== undefined) {\n                gl.disableVertexAttribArray(sp.texcoord);\n            }\n            if (sp.texcoord2 !== undefined) {\n                gl.disableVertexAttribArray(sp.texcoord2);\n            }\n            if (sp.color !== undefined) {\n                gl.disableVertexAttribArray(sp.color);\n            }\n            if (sp.tangent !== undefined) {\n                gl.disableVertexAttribArray(sp.tangent);\n            }\n            if (sp.binormal !== undefined) {\n                gl.disableVertexAttribArray(sp.binormal);\n            }\n            if (s_gl.buffers[q6 + x3dom.BUFFER_IDX.ID]) {\n                if (sp.id !== undefined) {\n                    gl.disableVertexAttribArray(sp.id);\n                } else if (sp.particleSize !== undefined) {\n                    gl.disableVertexAttribArray(sp.particleSize);\n                }\n            }\n            if (s_gl.popGeometry != 0 && sp.PG_vertexID !== undefined) {\n                gl.disableVertexAttribArray(sp.PG_vertexID);    // mimic gl_VertexID\n            }\n        } // end for loop over attrib arrays\n\n        for (df = 0; df < df_n; df++) {\n            attrib = s_gl.dynamicFields[df];\n\n            if (sp[attrib.name] !== undefined) {\n                gl.disableVertexAttribArray(sp[attrib.name]);\n            }\n        }\n\n        // update stats\n        if (s_gl.imageGeometry) {\n            v_n = s_geo._vf.vertexCount.length;\n            this.numDrawCalls += v_n;\n\n            for (v = 0; v < v_n; v++) {\n                if (s_gl.primType[v] == gl.TRIANGLE_STRIP) {\n                    this.numFaces += (s_geo._vf.vertexCount[v] - 2);\n                } else {\n                    this.numFaces += (s_geo._vf.vertexCount[v] / 3);\n                }\n\n                this.numCoords += s_geo._vf.vertexCount[v];\n            }\n        } else {\n            this.numCoords += s_msh._numCoords;\n            this.numFaces += s_msh._numFaces;\n\n            if (s_gl.binaryGeometry || s_gl.popGeometry || s_gl.bufferGeometry) {\n                this.numDrawCalls += s_geo._vf.vertexCount.length;\n            } else if (s_geo.hasIndexOffset()) {\n                this.numDrawCalls += shape.tessellationProperties().length;\n            } else {\n                this.numDrawCalls += q_n;\n            }\n        }\n\n        // reset to default values for possibly user defined render states\n        if (depthMode) {\n            this.stateManager.enable(gl.DEPTH_TEST);\n            this.stateManager.depthMask(true);\n            this.stateManager.depthFunc(gl.LEQUAL);\n            this.stateManager.depthRange(0, 1);\n        }\n\n        if (blendMode) {\n            this.stateManager.enable(gl.BLEND);\n            this.stateManager.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE);\n            this.stateManager.blendColor(1, 1, 1, 1);\n            this.stateManager.blendEquation(gl.FUNC_ADD);\n        }\n\n        if (colorMaskMode) {\n            this.stateManager.colorMask(true, true, true, true);\n        }\n\n        if (lineProperties) {\n            this.stateManager.lineWidth(1);\n        }\n\n        // cleanup textures\n        var s_gl_tex = s_gl.texture;\n        cnt_n = s_gl_tex ? s_gl_tex.length : 0;\n\n        for (cnt = 0; cnt < cnt_n; cnt++) {\n            if (!s_gl_tex[cnt])\n                continue;\n\n            if (s_app && s_app._cf.texture.node) {\n                tex = s_app._cf.texture.node.getTexture(cnt);\n                gl.activeTexture(gl.TEXTURE0 + cnt);\n\n                if (x3dom.isa(tex, x3dom.nodeTypes.X3DEnvironmentTextureNode)) {\n                    gl.bindTexture(gl.TEXTURE_CUBE_MAP, null);\n                } else {\n                    gl.bindTexture(gl.TEXTURE_2D, null);\n                }\n            }\n        }\n    };\n\n    /**\n     * PopGeometry: adapt LOD and set shader variables\n     *\n     * @param drawable\n     * @param popGeo\n     * @param sp\n     * @param s_gl\n     * @param scene\n     * @param model_view\n     * @param viewarea\n     * @param currFps\n     */\n    Context.prototype.updatePopState = function(drawable, popGeo, sp, s_gl, scene, model_view, viewarea, currFps) {\n        var tol = x3dom.nodeTypes.PopGeometry.ErrorToleranceFactor * popGeo._vf.precisionFactor;\n\n        if (currFps <= 1 || viewarea.isMovingOrAnimating()) {\n            tol *= x3dom.nodeTypes.PopGeometry.PrecisionFactorOnMove;\n        }\n\n        var currentLOD = 16;\n\n        if (tol > 0) {\n\n            // BEGIN CLASSIC CODE\n            var viewpoint = scene.getViewpoint();\n            var imgPlaneHeightAtDistOne = viewpoint.getImgPlaneHeightAtDistOne();\n            var near = viewpoint.getNear();\n            var center = model_view.multMatrixPnt(popGeo._vf.position);\n\n            var tightRad = model_view.multMatrixVec(popGeo._vf.size).length() * 0.5;\n            var largestRad = model_view.multMatrixVec(popGeo._vf.maxBBSize).length() * 0.5;\n\n            // distance is estimated conservatively using the bounding sphere\n            var dist = Math.max(-center.z - tightRad, near);\n            var projPixelLength = dist * (imgPlaneHeightAtDistOne / viewarea._height);\n\n            // compute LOD using bounding sphere\n            var arg = (2 * largestRad) / (tol * projPixelLength);\n            // END CLASSIC CODE\n\n            // BEGIN EXPERIMENTAL CODE\n            // compute LOD using screen-space coverage of bounding sphere\n            // TODO: the coverage should be distinct from priority\n            // var cov = drawable.priority;\n            // TODO: here, we need to decide whether we want to keep the ModF-encoding with\n            //       respect to the largest bounding box... if not, change this and the shaders\n            // cov *= (popGeo._vf.maxBBSize.length() / popGeo._vf.size.length());\n            // var arg = cov / tol;\n            // END EXPERIMENTAL CODE\n\n            // use precomputed log(2.0) = 0.693147180559945\n            currentLOD = Math.ceil(Math.log(arg) / 0.693147180559945);\n            currentLOD = (currentLOD < 1) ? 1 : ((currentLOD > 16) ? 16 : currentLOD);\n        }\n\n        // take care of user-controlled min and max values\n        var minPrec = popGeo._vf.minPrecisionLevel, maxPrec = popGeo._vf.maxPrecisionLevel;\n\n        currentLOD = (minPrec != -1 && currentLOD < minPrec) ? minPrec : currentLOD;\n        currentLOD = (maxPrec != -1 && currentLOD > maxPrec) ? maxPrec : currentLOD;\n\n        // assign rendering resolution, according to currently loaded data and LOD\n        var currentLOD_min = (s_gl.levelsAvailable < currentLOD) ? s_gl.levelsAvailable : currentLOD;\n        currentLOD = currentLOD_min;\n\n        // TODO: only for demonstration purposes!!!\n        if (tol <= 1)\n            currentLOD = (currentLOD == popGeo.getNumLevels()) ? 16 : currentLOD;\n\n        // here, we tell X3DOM how many faces / vertices get displayed in the stats\n        var hasIndex = popGeo._vf.indexedRendering;\n        var p_msh = popGeo._mesh;\n\n        p_msh._numCoords = 0;\n        p_msh._numFaces = 0;\n\n        // TODO: this assumes pure TRIANGLES data (and gets overwritten from shadow/picking pass!!!)\n        for (var i = 0; i < currentLOD_min; ++i) {  // currentLOD breaks loop\n            var numVerticesAtLevel_i = s_gl.numVerticesAtLevel[i];\n            p_msh._numCoords += numVerticesAtLevel_i;\n            p_msh._numFaces += (hasIndex ? popGeo.getNumIndicesByLevel(i) : numVerticesAtLevel_i) / 3;\n        }\n\n        x3dom.nodeTypes.PopGeometry.numRenderedVerts += p_msh._numCoords;\n        x3dom.nodeTypes.PopGeometry.numRenderedTris += p_msh._numFaces;\n\n        // this field is mainly thought for the use with external statistics\n        // TODO: does not work with instances\n        p_msh.currentLOD = currentLOD;\n\n        // here, we tell X3DOM how many vertices get rendered\n        // TODO: this assumes pure TRIANGLES data\n        popGeo.adaptVertexCount(hasIndex ? p_msh._numFaces * 3 : p_msh._numCoords);\n\n        // finally set shader variables...\n        sp.PG_maxBBSize = popGeo._vf.maxBBSize.toGL();\n\n        sp.PG_bbMin = popGeo._bbMinBySize;  // floor(bbMin / maxBBSize)\n\n        sp.PG_numAnchorVertices = popGeo._vf.numAnchorVertices;\n\n        sp.PG_bbMaxModF = popGeo._vf.bbMaxModF.toGL();\n        sp.PG_bboxShiftVec = popGeo._vf.bbShiftVec.toGL();\n\n        sp.PG_precisionLevel = currentLOD;\n\n        // mimics Math.pow(2.0, 16.0 - currentLOD);\n        sp.PG_powPrecision = x3dom.nodeTypes.PopGeometry.powLUT[currentLOD - 1];\n    };\n\n    /**\n     * Render ColorBuffer-Pass for picking\n     *\n     * @param viewarea\n     * @param x\n     * @param y\n     * @param buttonState\n     * @param viewMat\n     * @param sceneMat\n     * @returns {boolean}\n     */\n    Context.prototype.pickValue = function(viewarea, x, y, buttonState, viewMat, sceneMat) {\n        x3dom.Utils.startMeasure(\"picking\");\n\n        var scene = viewarea._scene;\n\n        var gl = this.ctx3d;\n\n        // method requires that scene has already been rendered at least once\n        if (!gl || !scene || !scene._webgl || !scene.drawableCollection) {\n            return false;\n        }\n\n        var pm = scene._vf.pickMode.toLowerCase();\n        var pickMode = 0;\n\n        switch (pm) {\n            case \"box\":      return false;\n            case \"idbuf\":    pickMode = 0; break;\n            case \"idbuf24\":  pickMode = 3; break;\n            case \"idbufid\":  pickMode = 4; break;\n            case \"color\":    pickMode = 1; break;\n            case \"texcoord\": pickMode = 2; break;\n        }\n\n        // ViewMatrix and ViewProjectionMatrix\n        var mat_view, mat_scene;\n\n        if (arguments.length > 4) {\n            mat_view = viewMat;\n            mat_scene = sceneMat;\n        } else {\n            mat_view = viewarea._last_mat_view;\n            mat_scene = viewarea._last_mat_scene;\n        }\n\n        // remember correct scene bbox\n        var min = x3dom.fields.SFVec3f.copy(scene._lastMin);\n        var max = x3dom.fields.SFVec3f.copy(scene._lastMax);\n        // get current camera position\n        var from = mat_view.inverse().e3();\n\n        // get bbox of scene bbox and camera position\n        var _min = x3dom.fields.SFVec3f.copy(from);\n        var _max = x3dom.fields.SFVec3f.copy(from);\n\n        if (_min.x > min.x) { _min.x = min.x; }\n        if (_min.y > min.y) { _min.y = min.y; }\n        if (_min.z > min.z) { _min.z = min.z; }\n\n        if (_max.x < max.x) { _max.x = max.x; }\n        if (_max.y < max.y) { _max.y = max.y; }\n        if (_max.z < max.z) { _max.z = max.z; }\n\n        // temporarily set scene size to include camera\n        scene._lastMin.setValues(_min);\n        scene._lastMax.setValues(_max);\n\n        // get scalar scene size and adapted projection matrix\n        var sceneSize = scene._lastMax.subtract(scene._lastMin).length();\n        \n        //use zFar if set & closer to allow for smaller size\n        if( scene.getViewpoint().getFar() )\n        {\n            sceneSize = Math.min(sceneSize, scene.getViewpoint().getFar()); \n        }\n        \n        var cctowc = viewarea.getCCtoWCMatrix();\n\n        // restore correct scene bbox\n        scene._lastMin.setValues(min);\n        scene._lastMax.setValues(max);\n\n        // for deriving shadow ids together with shape ids\n        var baseID = x3dom.nodeTypes.Shape.objectID + 2;\n\n\n        // render to texture for reading pixel values\n        this.renderPickingPass(gl, scene, mat_view, mat_scene, from, sceneSize, pickMode, x, y, 2, 2);\n\n        // the pixel values under mouse cursor\n        var pixelData = scene._webgl.fboPick.pixelData;\n\n        if (pixelData && pixelData.length) {\n            var pickPos = new x3dom.fields.SFVec3f(0, 0, 0);\n            var pickNorm = new x3dom.fields.SFVec3f(0, 0, 1);\n\n            var index = 0;\n            var objId = pixelData[index + 3], shapeId;\n\n            var pixelOffset = 1.0 / scene._webgl.pickScale;\n            var denom = 1.0 / 256.0;\n            var dist, line, lineoff, right, up;\n\n            if (pickMode == 0) {\n                objId += 256 * pixelData[index + 2];\n\n                dist = (pixelData[index] / 255.0) * denom +\n                    (pixelData[index + 1] / 255.0);\n\n                line = viewarea.calcViewRay(x, y, cctowc);\n\n                pickPos = from.add(line.dir.multiply(dist * sceneSize));\n\n\n                index = 4;      // get right pixel\n                dist = (pixelData[index] / 255.0) * denom +\n                    (pixelData[index + 1] / 255.0);\n\n                lineoff = viewarea.calcViewRay(x + pixelOffset, y, cctowc);\n\n                right = from.add(lineoff.dir.multiply(dist * sceneSize));\n                right = right.subtract(pickPos).normalize();\n\n                index = 8;      // get top pixel\n                dist = (pixelData[index] / 255.0) * denom +\n                    (pixelData[index + 1] / 255.0);\n\n                lineoff = viewarea.calcViewRay(x, y - pixelOffset, cctowc);\n\n                up = from.add(lineoff.dir.multiply(dist * sceneSize));\n                up = up.subtract(pickPos).normalize();\n\n                pickNorm = right.cross(up).normalize();\n            } else if (pickMode == 3) {\n                objId += 256 * pixelData[index + 2] +\n                    65536 * pixelData[index + 1];\n\n                dist = pixelData[index] / 255.0;\n\n                line = viewarea.calcViewRay(x, y, cctowc);\n\n                pickPos = from.add(line.dir.multiply(dist * sceneSize));\n\n                index = 4;      // get right pixel\n                dist = pixelData[index] / 255.0;\n\n                lineoff = viewarea.calcViewRay(x + pixelOffset, y, cctowc);\n\n                right = from.add(lineoff.dir.multiply(dist * sceneSize));\n                right = right.subtract(pickPos).normalize();\n\n                index = 8;      // get top pixel\n                dist = pixelData[index] / 255.0;\n\n                lineoff = viewarea.calcViewRay(x, y - pixelOffset, cctowc);\n\n                up = from.add(lineoff.dir.multiply(dist * sceneSize));\n                up = up.subtract(pickPos).normalize();\n\n                pickNorm = right.cross(up).normalize();\n            } else if (pickMode == 4) {\n                objId += 256 * pixelData[index + 2];\n\n                shapeId = pixelData[index + 1];\n                shapeId += 256 * pixelData[index];\n\n                // check if standard shape picked without special shadow id\n                if (objId == 0 && (shapeId > 0 && shapeId < baseID)) {\n                    objId = shapeId;\n                }\n            } else {\n                pickPos.x = pixelData[index];\n                pickPos.y = pixelData[index + 1];\n                pickPos.z = pixelData[index + 2];\n            }\n            // x3dom.debug.logInfo(pickPos + \" / \" + objId);\n\n\n\n            var eventType = \"shadowObjectIdChanged\";\n            var shadowObjectIdChanged, event;\n            var button = Math.max(buttonState >>> 8, buttonState & 255);\n\n            if (objId >= baseID) {\n                objId -= baseID;\n\n                var hitObject;\n                var layerX = x * viewarea._inverseDevicePixelRatio;\t\t    \n                var layerY = y * viewarea._inverseDevicePixelRatio;\t\t    \n\n                if (pickMode != 4) {\n                    viewarea._pickingInfo.pickPos = pickPos;\n                    viewarea._pick.setValues(pickPos);\n\n                    viewarea._pickingInfo.pickNorm = pickNorm;\n                    viewarea._pickNorm.setValues(pickNorm);\n\n                    viewarea._pickingInfo.pickObj = null;\n                    viewarea._pickingInfo.lastClickObj = null;\n\n                    hitObject = scene._xmlNode;\n                } else {\n                    viewarea._pickingInfo.pickObj = x3dom.nodeTypes.Shape.idMap.nodeID[shapeId];\n\n                    hitObject = viewarea._pickingInfo.pickObj._xmlNode;\n                }\n\n                // Check if there are MultiParts\n                if (scene._multiPartMap) {\n                    var mp, multiPart;\n\n                    // Find related MultiPart\n                    for (mp = 0; mp < scene._multiPartMap.multiParts.length; mp++) {\n                        multiPart = scene._multiPartMap.multiParts[mp];\n                        if (objId >= multiPart._minId && objId <= multiPart._maxId) {\n                            hitObject = multiPart._xmlNode;\n\n                            event = {\n                                target: multiPart._xmlNode,\n                                button: button, mouseup: ((buttonState >>> 8) > 0),\n                                layerX: layerX, layerY: layerY,\n                                pickedId: objId,\n                                worldX: pickPos.x, worldY: pickPos.y, worldZ: pickPos.z,\n                                normalX: pickNorm.x, normalY: pickNorm.y, normalZ: pickNorm.z,\n                                hitPnt: pickPos.toGL(),\n                                hitObject: hitObject,\n                                cancelBubble: false,\n                                stopPropagation: function() { this.cancelBubble = true; },\n                                preventDefault: function() { this.cancelBubble = true; }\n                            };\n\n                            multiPart.handleEvents(event);\n                        } else {\n                            event = {\n                                target: multiPart._xmlNode,\n                                button: button, mouseup: ((buttonState >>> 8) > 0),\n                                layerX: layerX, layerY: layerY,\n                                pickedId: -1,\n                                cancelBubble: false,\n                                stopPropagation: function() { this.cancelBubble = true; },\n                                preventDefault: function() { this.cancelBubble = true; }\n                            };\n\n                            multiPart.handleEvents(event);\n                        }\n                    }\n                }\n\n                shadowObjectIdChanged = (viewarea._pickingInfo.shadowObjectId != objId);\n                viewarea._pickingInfo.lastShadowObjectId = viewarea._pickingInfo.shadowObjectId;\n                viewarea._pickingInfo.shadowObjectId = objId;\n                // x3dom.debug.logInfo(baseID + \" + \" + objId);\n\n                if ((shadowObjectIdChanged || button) && scene._xmlNode &&\n                    (scene._xmlNode[\"on\" + eventType] || scene._xmlNode.hasAttribute(\"on\" + eventType) ||\n                        scene._listeners[eventType])) {\n                    event = {\n                        target: scene._xmlNode,\n                        type: eventType,\n                        button: button, mouseup: ((buttonState >>> 8) > 0),\n                        layerX: layerX, layerY: layerY,\n                        shadowObjectId: objId,\n                        worldX: pickPos.x, worldY: pickPos.y, worldZ: pickPos.z,\n                        normalX: pickNorm.x, normalY: pickNorm.y, normalZ: pickNorm.z,\n                        hitPnt: pickPos.toGL(),\n                        hitObject: hitObject,\n                        cancelBubble: false,\n                        stopPropagation: function() { this.cancelBubble = true; },\n                        preventDefault: function() { this.cancelBubble = true; }\n                    };\n                    scene.callEvtHandler((\"on\" + eventType), event);\n                }\n\n                if (scene._shadowIdMap && scene._shadowIdMap.mapping &&\n                    objId < scene._shadowIdMap.mapping.length) {\n                    var shIds = scene._shadowIdMap.mapping[objId].usage;\n                    var n, c, shObj;\n\n                    if (!line) {\n                        line = viewarea.calcViewRay(x, y, cctowc);\n                    }\n                    // find corresponding dom tree object\n                    for (c = 0; c < shIds.length; c++) {\n                        shObj = scene._nameSpace.defMap[shIds[c]];\n                        // FIXME; bbox test too coarse (+ should include trafo)\n                        if (shObj && shObj.doIntersect(line)) {\n                            viewarea._pickingInfo.pickObj = shObj;\n                            break;\n                        }\n                    }\n                    // Check for other namespaces e.g. Inline/Multipart (FIXME; check recursively)\n                    for (n = 0; n < scene._nameSpace.childSpaces.length; n++) {\n                        for (c = 0; c < shIds.length; c++) {\n                            shObj = scene._nameSpace.childSpaces[n].defMap[shIds[c]];\n                            // FIXME; bbox test too coarse (+ should include trafo)\n                            if (shObj && shObj.doIntersect(line)) {\n                                viewarea._pickingInfo.pickObj = shObj;\n                                break;\n                            }\n                        }\n                    }\n                }\n            } else {\n                // Check if there are MultiParts\n                if (scene._multiPartMap) {\n\n                    // Find related MultiPart\n                    for (mp = 0; mp < scene._multiPartMap.multiParts.length; mp++) {\n                        multiPart = scene._multiPartMap.multiParts[mp];\n\n                        event = {\n                            target: multiPart._xmlNode,\n                            button: button, mouseup: ((buttonState >>> 8) > 0),\n                            layerX: layerX, layerY: layerY,\n                            pickedId: -1,\n                            cancelBubble: false,\n                            stopPropagation: function() { this.cancelBubble = true; },\n                            preventDefault: function() { this.cancelBubble = true; }\n                        };\n\n                        multiPart.handleEvents(event);\n                    }\n                }\n\n\n                shadowObjectIdChanged = (viewarea._pickingInfo.shadowObjectId != -1);\n                viewarea._pickingInfo.shadowObjectId = -1;     // nothing hit\n\n                if (shadowObjectIdChanged && scene._xmlNode &&\n                    (scene._xmlNode[\"on\" + eventType] || scene._xmlNode.hasAttribute(\"on\" + eventType) ||\n                        scene._listeners[eventType])) {\n                    event = {\n                        target: scene._xmlNode,\n                        type: eventType,\n                        button: button, mouseup: ((buttonState >>> 8) > 0),\n                        layerX: layerX, layerY: layerY,\n                        shadowObjectId: viewarea._pickingInfo.shadowObjectId,\n                        cancelBubble: false,\n                        stopPropagation: function() { this.cancelBubble = true; },\n                        preventDefault: function() { this.cancelBubble = true; }\n                    };\n                    scene.callEvtHandler((\"on\" + eventType), event);\n                }\n\n                if (objId > 0) {\n                    // x3dom.debug.logInfo(x3dom.nodeTypes.Shape.idMap.nodeID[objId]._DEF + \" // \" +\n                    //                    x3dom.nodeTypes.Shape.idMap.nodeID[objId]._xmlNode.localName);\n                    viewarea._pickingInfo.pickPos = pickPos;\n                    viewarea._pickingInfo.pickNorm = pickNorm;\n                    viewarea._pickingInfo.pickObj = x3dom.nodeTypes.Shape.idMap.nodeID[objId];\n                } else {\n                    viewarea._pickingInfo.pickObj = null;\n                    // viewarea._pickingInfo.lastObj = null;\n                    viewarea._pickingInfo.lastClickObj = null;\n                }\n            }\n        }\n        var pickTime = x3dom.Utils.stopMeasure(\"picking\");\n        this.x3dElem.runtime.addMeasurement('PICKING', pickTime);\n\n        return true;\n    };\n\n    /**\n     * Render ColorBuffer-Pass for picking sub window\n     *\n     * @param viewarea\n     * @param x1\n     * @param y1\n     * @param x2\n     * @param y2\n     * @param fromMultipartAPI\n     * @returns {*}\n     */\n    Context.prototype.pickRect = function(viewarea, x1, y1, x2, y2, fromMultipartAPI) {\n        var gl = this.ctx3d;\n        var scene = viewarea ? viewarea._scene : null;\n\n        fromMultipartAPI = (fromMultipartAPI != undefined) ? fromMultipartAPI : false;\n\n        // method requires that scene has already been rendered at least once\n        if (!gl || !scene || !scene._webgl || !scene.drawableCollection)\n            return false;\n\n        // values not fully correct but unnecessary anyway, just to feed the shader\n        var from = viewarea._last_mat_view.inverse().e3();\n        var sceneSize = scene._lastMax.subtract(scene._lastMin).length();\n\n        var x = (x1 <= x2) ? x1 : x2;\n        var y = (y1 >= y2) ? y1 : y2;\n        var width = (1 + Math.abs(x2 - x1)) * scene._webgl.pickScale;\n        var height = (1 + Math.abs(y2 - y1)) * scene._webgl.pickScale;\n\n        // render to texture for reading pixel values\n        this.renderPickingPass(gl, scene, viewarea._last_mat_view, viewarea._last_mat_scene,\n            from, sceneSize, 0, x, y, (width < 1) ? 1 : width, (height < 1) ? 1 : height);\n\n        var index;\n        var pickedObjects = [];\n\n        // get objects in rectangle\n        for (index = 0; scene._webgl.fboPick.pixelData &&\n        index < scene._webgl.fboPick.pixelData.length; index += 4) {\n            var objId = scene._webgl.fboPick.pixelData[index + 3] +\n                scene._webgl.fboPick.pixelData[index + 2] * 256;\n\n            if (objId > 0)\n                pickedObjects.push(objId);\n        }\n        pickedObjects.sort();\n\n        // make found object IDs unique\n        var pickedObjectsTemp = (function(arr) {\n            var a = [], l = arr.length;\n            for (var i = 0; i < l; i++) {\n                for (var j = i + 1; j < l; j++) {\n                    if (arr[i] === arr[j])\n                        j = ++i;\n                }\n                a.push(arr[i]);\n            }\n            return a;\n        })(pickedObjects);\n        pickedObjects = pickedObjectsTemp;\n\n        var pickedNode, pickedNodes = [];\n\n        var hitObject;\n\n        // for deriving shadow ids together with shape ids\n        var baseID = x3dom.nodeTypes.Shape.objectID + 2;\n\n        var partIDs = [];\n\n        for (index = 0; index < pickedObjects.length; index++) {\n            objId = pickedObjects[index];\n\n            if (objId >= baseID) {\n                objId -= baseID;\n\n                // Check if there are MultiParts\n                if (scene._multiPartMap) {\n                    var mp, multiPart, colorMap, emissiveMap, specularMap, visibilityMap, partID;\n\n                    // Find related MultiPart\n                    for (mp = 0; mp < scene._multiPartMap.multiParts.length; mp++) {\n                        multiPart = scene._multiPartMap.multiParts[mp];\n                        colorMap = multiPart._inlineNamespace.defMap[\"MultiMaterial_ColorMap\"];\n                        emissiveMap = multiPart._inlineNamespace.defMap[\"MultiMaterial_EmissiveMap\"];\n                        specularMap = multiPart._inlineNamespace.defMap[\"MultiMaterial_SpecularMap\"];\n                        visibilityMap = multiPart._inlineNamespace.defMap[\"MultiMaterial_VisibilityMap\"];\n                        if (objId >= multiPart._minId && objId <= multiPart._maxId) {\n\n                            partIDs.push(objId);\n\n                            partID = multiPart._idMap.mapping[objId - multiPart._minId].name;\n                            hitObject = new x3dom.Parts(multiPart, [objId], colorMap, emissiveMap, specularMap, visibilityMap);\n\n                            pickedNode = { \"partID\": partID, \"part\": hitObject };\n\n                            pickedNodes.push(pickedNode);\n                        }\n                    }\n                }\n\n            } else {\n                hitObject = x3dom.nodeTypes.Shape.idMap.nodeID[objId];\n                hitObject = (hitObject && hitObject._xmlNode) ? hitObject._xmlNode : null;\n\n                if (hitObject)\n                    pickedNodes.push(hitObject);\n            }\n        }\n\n        if (fromMultipartAPI && partIDs.length) {\n            pickedNodes = new x3dom.Parts(multiPart, partIDs, colorMap, emissiveMap, specularMap, visibilityMap);\n        }\n\n        return pickedNodes;\n    };\n\n    /**\n     * Render Scene (Main-Pass)\n     *\n     * @param viewarea\n     */\n    Context.prototype.renderScene = function (viewarea, vrFrameData)\n    {\n        var gl = this.ctx3d;\n        var scene = viewarea._scene;\n\n        if (gl === null || scene === null) {\n            return;\n        }\n\n        var rentex = viewarea._doc._nodeBag.renderTextures;\n        var rt_tex, rtl_i, rtl_n = rentex.length;\n        var texProp = null;\n\n        // for initFBO\n        var type = gl.UNSIGNED_BYTE;\n        var shadowType = gl.UNSIGNED_BYTE;\n        var nearestFilt = false;\n\n        if (x3dom.caps.FP_TEXTURES && !x3dom.caps.MOBILE) {\n            type = gl.FLOAT;\n            shadowType = gl.FLOAT;\n            if (!x3dom.caps.FPL_TEXTURES) {\n                // TODO: use correct filtering for fp-textures\n                nearestFilt = true;\n            }\n        }\n\n        var shadowedLights, numShadowMaps;\n        var i, j, n, size, sizeAvailable;\n        var texType, refinementPos;\n        var vertices = [-1, -1, 1, -1, -1, 1, -1, 1, 1, -1, 1, 1];\n\n        scene.updateVolume();\n\n        if (!scene._webgl) {\n            scene._webgl = {};\n\n            this.setupFgnds(gl, scene);\n\n            // scale factor for mouse coords and width/ height (low res for speed-up)\n            scene._webgl.pickScale = 0.5;\n\n            scene._webgl._currFboWidth = Math.round(this.canvas.width * scene._webgl.pickScale);\n            scene._webgl._currFboHeight = Math.round(this.canvas.height * scene._webgl.pickScale);\n\n            // TODO: FIXME when spec ready: readPixels not (yet?) available for float textures\n            // https://bugzilla.mozilla.org/show_bug.cgi?id=681903\n            // https://www.khronos.org/webgl/public-mailing-list/archives/1108/msg00025.html\n            scene._webgl.fboPick = x3dom.Utils.initFBO(gl,\n                scene._webgl._currFboWidth, scene._webgl._currFboHeight, gl.UNSIGNED_BYTE, false, true);\n            scene._webgl.fboPick.pixelData = null;\n\n            // Set picking shaders\n            /*\n            scene._webgl.pickShader = this.cache.getShader(gl, x3dom.shader.PICKING);\n            scene._webgl.pickShader24 = this.cache.getShader(gl, x3dom.shader.PICKING_24);\n            scene._webgl.pickShaderId = this.cache.getShader(gl, x3dom.shader.PICKING_ID);\n            scene._webgl.pickColorShader = this.cache.getShader(gl, x3dom.shader.PICKING_COLOR);\n            scene._webgl.pickTexCoordShader = this.cache.getShader(gl, x3dom.shader.PICKING_TEXCOORD);\n            */\n\n            scene._webgl.normalShader = this.cache.getShader(gl, x3dom.shader.NORMAL);\n\n            // Initialize shadow maps\n            scene._webgl.fboShadow = [];\n\n            shadowedLights = viewarea.getShadowedLights();\n            n = shadowedLights.length;\n\n            for (i = 0; i < n; i++) {\n                size = shadowedLights[i]._vf.shadowMapSize;\n\n                if (!x3dom.isa(shadowedLights[i], x3dom.nodeTypes.PointLight)) {\n                    // cascades for directional lights\n                    numShadowMaps = Math.max(1, Math.min(shadowedLights[i]._vf.shadowCascades, 6));\n                } else {\n                    // six maps for point lights\n                    numShadowMaps = 6;\n                }\n\n                scene._webgl.fboShadow[i] = [];\n\n                for (j = 0; j < numShadowMaps; j++)\n                    scene._webgl.fboShadow[i][j] = x3dom.Utils.initFBO(gl, size, size, shadowType, false, true);\n            }\n\n            if (scene._webgl.fboShadow.length > 0 || x3dom.SSAO.isEnabled(scene))\n                scene._webgl.fboScene = x3dom.Utils.initFBO(gl, this.canvas.width, this.canvas.height, shadowType, false, true);\n            scene._webgl.fboBlur = [];\n\n            // initialize blur fbo (different fbos for different sizes)\n            for (i = 0; i < n; i++) {\n                size = scene._webgl.fboShadow[i][0].height;\n                sizeAvailable = false;\n\n                for (j = 0; j < scene._webgl.fboBlur.length; j++) {\n                    if (size == scene._webgl.fboBlur[j].height)\n                        sizeAvailable = true;\n                }\n                if (!sizeAvailable)\n                    scene._webgl.fboBlur[scene._webgl.fboBlur.length] = x3dom.Utils.initFBO(gl, size, size, shadowType, false, true);\n            }\n\n            // initialize Data for post processing\n            scene._webgl.ppBuffer = gl.createBuffer();\n            gl.bindBuffer(gl.ARRAY_BUFFER, scene._webgl.ppBuffer);\n            gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);\n\n            // scene._webgl.shadowShader = this.cache.getShader(gl, x3dom.shader.SHADOW);\n\n            // TODO: cleanup on shutdown and lazily create on first use like size-dependent variables below\n            scene._webgl.refinement = {\n                stamps: new Array(2),\n                positionBuffer: gl.createBuffer()\n            };\n            gl.bindBuffer(gl.ARRAY_BUFFER, scene._webgl.refinement.positionBuffer);\n            gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);\n\n            // This must be refreshed on node change!\n            for (rtl_i = 0; rtl_i < rtl_n; rtl_i++) {\n                rt_tex = rentex[rtl_i];\n\n                texProp = rt_tex._cf.textureProperties.node;\n                texType = rt_tex.requirePingPong() ? gl.UNSIGNED_BYTE : type;\n                rt_tex._webgl = {};\n                rt_tex._webgl.fbo = x3dom.Utils.initFBO(gl,\n                    rt_tex._vf.dimensions[0], rt_tex._vf.dimensions[1], texType,\n                    (texProp && texProp._vf.generateMipMaps), rt_tex._vf.depthMap || !rt_tex.requirePingPong());\n\n                rt_tex._cleanupGLObjects = function(retainTex) {\n                    if (!retainTex)\n                        gl.deleteTexture(this._webgl.fbo.tex);\n                    if (this._webgl.fbo.dtex)\n                        gl.deleteTexture(this._webgl.fbo.dtex);\n                    if (this._webgl.fbo.rbo)\n                        gl.deleteFramebuffer(this._webgl.fbo.rbo);\n                    gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n                    gl.deleteFramebuffer(this._webgl.fbo.fbo);\n                    this._webgl.fbo.rbo = null;\n                    this._webgl.fbo.fbo = null;\n                };\n\n                if (rt_tex.requirePingPong()) {\n                    refinementPos = rt_tex._vf.dimensions[0] + \"x\" + rt_tex._vf.dimensions[1];\n                    if (scene._webgl.refinement[refinementPos] === undefined) {\n                        scene._webgl.refinement[refinementPos] = x3dom.Utils.initFBO(gl,\n                            rt_tex._vf.dimensions[0], rt_tex._vf.dimensions[1], texType, false, false);\n                    }\n                    rt_tex._webgl.texture = null;\n                }\n            }\n\n            viewarea._last_mat_view = x3dom.fields.SFMatrix4f.identity();\n            viewarea._last_mat_proj = x3dom.fields.SFMatrix4f.identity();\n            viewarea._last_mat_scene = x3dom.fields.SFMatrix4f.identity();\n\n            this._calledViewpointChangedHandler = false;\n        } else {\n            // updates needed?\n            var fboWidth = Math.round(this.canvas.width * scene._webgl.pickScale);\n            var fboHeight = Math.round(this.canvas.height * scene._webgl.pickScale);\n\n            if (scene._webgl._currFboWidth !== fboWidth ||\n                scene._webgl._currFboHeight !== fboHeight) {\n                scene._webgl._currFboWidth = fboWidth;\n                scene._webgl._currFboHeight = fboHeight;\n\n                scene._webgl.fboPick = x3dom.Utils.initFBO(gl, fboWidth, fboHeight, scene._webgl.fboPick.type, false, true);\n                scene._webgl.fboPick.pixelData = null;\n\n                x3dom.debug.logInfo(\"Refreshed picking FBO to size (\" + fboWidth + \", \" + fboHeight + \")\");\n            }\n\n            for (rtl_i = 0; rtl_i < rtl_n; rtl_i++) {\n                rt_tex = rentex[rtl_i];\n                if (rt_tex._webgl && rt_tex._webgl.fbo &&\n                    rt_tex._webgl.fbo.width == rt_tex._vf.dimensions[0] &&\n                    rt_tex._webgl.fbo.height == rt_tex._vf.dimensions[1])\n                    continue;\n\n                rt_tex.invalidateGLObject();\n                if (rt_tex._cleanupGLObjects) {\n                    rt_tex._cleanupGLObjects();\n                } else {\n                    rt_tex._cleanupGLObjects = function(retainTex) {\n                        if (!retainTex)\n                            gl.deleteTexture(this._webgl.fbo.tex);\n                        if (this._webgl.fbo.dtex)\n                            gl.deleteTexture(this._webgl.fbo.dtex);\n                        if (this._webgl.fbo.rbo)\n                            gl.deleteRenderbuffer(this._webgl.fbo.rbo);\n                        gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n                        gl.deleteFramebuffer(this._webgl.fbo.fbo);\n                        this._webgl.fbo.rbo = null;\n                        this._webgl.fbo.fbo = null;\n                    };\n                }\n\n                texProp = rt_tex._cf.textureProperties.node;\n                texType = rt_tex.requirePingPong() ? gl.UNSIGNED_BYTE : type;\n                rt_tex._webgl = {};\n                rt_tex._webgl.fbo = x3dom.Utils.initFBO(gl,\n                    rt_tex._vf.dimensions[0], rt_tex._vf.dimensions[1], texType,\n                    (texProp && texProp._vf.generateMipMaps), rt_tex._vf.depthMap || !rt_tex.requirePingPong());\n\n                if (rt_tex.requirePingPong()) {\n                    refinementPos = rt_tex._vf.dimensions[0] + \"x\" + rt_tex._vf.dimensions[1];\n                    if (scene._webgl.refinement[refinementPos] === undefined) {\n                        scene._webgl.refinement[refinementPos] = x3dom.Utils.initFBO(gl,\n                            rt_tex._vf.dimensions[0], rt_tex._vf.dimensions[1], texType, false, false);\n                    }\n                    rt_tex._webgl.texture = null;\n                }\n\n                x3dom.debug.logInfo(\"Init/resize RenderedTexture_\" + rtl_i + \" to size \" +\n                    rt_tex._vf.dimensions[0] + \" x \" + rt_tex._vf.dimensions[1]);\n            }\n\n            // reinitialize shadow fbos if necessary\n            shadowedLights = viewarea.getShadowedLights();\n            n = shadowedLights.length;\n\n            for (i = 0; i < n; i++) {\n                size = shadowedLights[i]._vf.shadowMapSize;\n\n                if (!x3dom.isa(shadowedLights[i], x3dom.nodeTypes.PointLight)) {\n                    // cascades for directional lights\n                    numShadowMaps = Math.max(1, Math.min(shadowedLights[i]._vf.shadowCascades, 6));\n                } else {\n                    // six maps for point lights\n                    numShadowMaps = 6;\n                }\n\n                if (typeof scene._webgl.fboShadow[i] === \"undefined\" ||\n                    scene._webgl.fboShadow[i].length != numShadowMaps ||\n                    scene._webgl.fboShadow[i][0].height != size) {\n                    scene._webgl.fboShadow[i] = [];\n                    for (j = 0; j < numShadowMaps; j++) {\n                        scene._webgl.fboShadow[i][j] = x3dom.Utils.initFBO(gl, size, size, shadowType, false, true);\n                    }\n                }\n            }\n\n            // reinitialize blur fbos if necessary\n            for (i = 0; i < n; i++) {\n                size = scene._webgl.fboShadow[i][0].height;\n\n                sizeAvailable = false;\n                for (j = 0; j < scene._webgl.fboBlur.length; j++) {\n                    if (size == scene._webgl.fboBlur[j].height)\n                        sizeAvailable = true;\n                }\n                if (!sizeAvailable)\n                    scene._webgl.fboBlur[scene._webgl.fboBlur.length] = x3dom.Utils.initFBO(gl, size, size, shadowType, false, true);\n            }\n\n            if ((x3dom.SSAO.isEnabled(scene) || scene._webgl.fboShadow.length > 0) && typeof scene._webgl.fboScene == \"undefined\" || scene._webgl.fboScene &&\n                (this.canvas.width != scene._webgl.fboScene.width || this.canvas.height != scene._webgl.fboScene.height)) {\n                scene._webgl.fboScene = x3dom.Utils.initFBO(gl, this.canvas.width, this.canvas.height, shadowType, false, true);\n            }\n        }\n\n        var env = scene.getEnvironment();\n        // update internal flags\n        env.checkSanity();\n\n        var bgnd = scene.getBackground();\n        // setup or update bgnd\n        this.setupScene(gl, bgnd);\n\n        this.numFaces = 0;\n        this.numCoords = 0;\n        this.numDrawCalls = 0;\n\n        var mat_proj = viewarea.getProjectionMatrix();\n        var mat_view = viewarea.getViewMatrix();\n\n        // fire viewpointChanged event\n        if (!this._calledViewpointChangedHandler || !viewarea._last_mat_view.equals(mat_view)) {\n            var e_viewpoint = scene.getViewpoint();\n            var e_eventType = \"viewpointChanged\";\n\n            try\n            {\n                if (e_viewpoint.hasEventListener(e_eventType) || scene.hasEventListener(e_eventType))\n                {\n                    var e_viewtrafo = e_viewpoint.getCurrentTransform();\n                    e_viewtrafo = e_viewtrafo.inverse().mult(mat_view);\n                    var e_mat = e_viewtrafo.inverse();\n\n                    var e_rotation = new x3dom.fields.Quaternion(0, 0, 1, 0);\n                    e_rotation.setValue(e_mat);\n                    var e_translation = e_mat.e3();\n\n                    var e_event = {\n                        target: e_viewpoint._xmlNode,\n                        type: e_eventType,\n                        matrix: e_viewtrafo,\n                        position: e_translation,\n                        orientation: e_rotation.toAxisAngle(),\n                        cancelBubble: false,\n                        stopPropagation: function() { this.cancelBubble = true; },\n                        preventDefault: function() { this.cancelBubble = true; }\n                    };\n\n                    if (e_viewpoint.hasEventListener(e_eventType))\n                    {\n                        e_viewpoint.callEvtHandler((\"on\" + e_eventType), e_event);\n                    }\n                    \n                    if (scene.hasEventListener(e_eventType))\n                    {\n                        scene.callEvtHandler((\"on\" + e_eventType), e_event);\n                    }\n\n                    e_viewpoint.callEvtHandler((\"on\" + e_eventType), e_event);\n\n                    this._calledViewpointChangedHandler = true;\n                }\n            }\n            catch (e_e)\n            {\n                x3dom.debug.logException(e_e);\n            }\n        }\n\n        viewarea._last_mat_view = mat_view;\n        viewarea._last_mat_proj = mat_proj;\n\n        var mat_scene = mat_proj.mult(mat_view);  // viewarea.getWCtoCCMatrix();\n        viewarea._last_mat_scene = mat_scene;\n\n        // Collect drawables (traverse)\n        scene.drawableCollection = null;  // Always update needed?\n\n        if (!scene.drawableCollection) {\n            var drawableCollectionConfig = {\n                viewArea: viewarea,\n                sortTrans: env._vf.sortTrans,\n                viewMatrix: mat_view,\n                projMatrix: mat_proj,\n                sceneMatrix: mat_scene,\n                frustumCulling: true,\n                smallFeatureThreshold: env._smallFeatureThreshold,\n                context: this,\n                gl: gl\n            };\n\n            scene.drawableCollection = new x3dom.DrawableCollection(drawableCollectionConfig);\n\n            x3dom.Utils.startMeasure('traverse');\n\n            scene.collectDrawableObjects(x3dom.fields.SFMatrix4f.identity(), scene.drawableCollection, true, false, 0, []);\n\n            var traverseTime = x3dom.Utils.stopMeasure('traverse');\n            this.x3dElem.runtime.addMeasurement('TRAVERSE', traverseTime);\n        }\n\n        // Sort drawables\n        x3dom.Utils.startMeasure('sorting');\n\n        scene.drawableCollection.sort();\n\n        var sortTime = x3dom.Utils.stopMeasure('sorting');\n        this.x3dElem.runtime.addMeasurement('SORT', sortTime);\n\n        // Render Shadow Pass\n        var slights = viewarea.getLights();\n        var numLights = slights.length;\n        var mat_light;\n        var WCToLCMatrices = [];\n        var lMatrices = [];\n        var shadowCount = 0;\n\n        x3dom.Utils.startMeasure('shadow');\n\n        for (var p = 0; p < numLights; p++) {\n            if (slights[p]._vf.shadowIntensity > 0.0) {\n\n                var lightMatrix = viewarea.getLightMatrix()[p];\n                var shadowMaps = scene._webgl.fboShadow[shadowCount];\n                var offset = Math.max(0.0, Math.min(1.0, slights[p]._vf.shadowOffset));\n\n                if (!x3dom.isa(slights[p], x3dom.nodeTypes.PointLight)) {\n                    // get cascade count\n                    var numCascades = Math.max(1, Math.min(slights[p]._vf.shadowCascades, 6));\n\n                    // calculate transformation matrices\n                    mat_light = viewarea.getWCtoLCMatricesCascaded(lightMatrix, slights[p], mat_proj);\n\n                    // render shadow pass\n                    for (i = 0; i < numCascades; i++) {\n                        this.renderShadowPass(gl, viewarea, mat_light[i], mat_view, shadowMaps[i], offset, false);\n                    }\n                } else {\n                    // for point lights 6 render passes\n                    mat_light = viewarea.getWCtoLCMatricesPointLight(lightMatrix, slights[p], mat_proj);\n                    for (i = 0; i < 6; i++) {\n                        this.renderShadowPass(gl, viewarea, mat_light[i], mat_view, shadowMaps[i], offset, false);\n                    }\n                }\n                shadowCount++;\n\n                // save transformations for shadow rendering\n                WCToLCMatrices[WCToLCMatrices.length] = mat_light;\n                lMatrices[lMatrices.length] = lightMatrix;\n            }\n        }\n\n        // One pass for depth of scene from camera view (to enable post-processing shading)\n        if (shadowCount > 0 || x3dom.SSAO.isEnabled(scene)) {\n            this.renderShadowPass(gl, viewarea, mat_scene, mat_view, scene._webgl.fboScene, 0.0, true);\n            var shadowTime = x3dom.Utils.stopMeasure('shadow');\n            this.x3dElem.runtime.addMeasurement('SHADOW', shadowTime);\n        } else {\n            this.x3dElem.runtime.removeMeasurement('SHADOW');\n        }\n\n        mat_light = viewarea.getWCtoLCMatrix(viewarea.getLightMatrix()[0]);\n\n        for (rtl_i = 0; rtl_i < rtl_n; rtl_i++) {\n            this.renderRTPass(gl, viewarea, rentex[rtl_i]);\n        }\n\n        // rendering\n        x3dom.Utils.startMeasure('render');\n\n        this.stateManager.viewport(0, 0, this.canvas.width, this.canvas.height);\n\n        // calls gl.clear etc. (bgnd stuff)\n        bgnd._webgl.render(gl, mat_view, mat_proj, viewarea);\n\n        x3dom.nodeTypes.PopGeometry.numRenderedVerts = 0;\n        x3dom.nodeTypes.PopGeometry.numRenderedTris = 0;\n\n        n = scene.drawableCollection.length;\n\n        // Very, very experimental priority culling, currently coupled with frustum and small feature culling\n        // TODO: what about shadows?\n        if (env._vf.smallFeatureCulling && env._lowPriorityThreshold < 1 && viewarea.isMovingOrAnimating()) {\n            n = Math.floor(n * env._lowPriorityThreshold);\n            if (!n && scene.drawableCollection.length)\n                n = 1;   // render at least one object\n        }\n\n        this.stateManager.unsetProgram();\n\n        // render all remaining shapes\n        for (i = 0; i < n; i++) {\n            var drawable = scene.drawableCollection.get(i);\n\n            this.renderShape(drawable, viewarea, slights, numLights, mat_view, mat_scene, mat_light, mat_proj, gl);\n        }\n\n        if (shadowCount > 0)\n            this.renderShadows(gl, viewarea, shadowedLights, WCToLCMatrices, lMatrices, mat_view, mat_proj, mat_scene);\n\n        this.stateManager.disable(gl.BLEND);\n        this.stateManager.disable(gl.DEPTH_TEST);\n\n        viewarea._numRenderedNodes = n;\n\n        if (x3dom.SSAO.isEnabled(scene))\n            x3dom.SSAO.renderSSAO(this.stateManager, gl, scene, this.canvas);\n\n        // if _visDbgBuf then show helper buffers in foreground for debugging\n        if (viewarea._visDbgBuf !== undefined && viewarea._visDbgBuf) {\n            var pm = scene._vf.pickMode.toLowerCase();\n\n            if (pm.indexOf(\"idbuf\") == 0 || pm == \"color\" || pm == \"texcoord\") {\n                this.stateManager.viewport(0, 3 * this.canvas.height / 4,\n                    this.canvas.width / 4, this.canvas.height / 4);\n                scene._fgnd._webgl.render(gl, scene._webgl.fboPick.tex);\n            }\n\n            if (shadowCount > 0 || x3dom.SSAO.isEnabled(scene)) {\n                this.stateManager.viewport(this.canvas.width / 4, 3 * this.canvas.height / 4,\n                    this.canvas.width / 4, this.canvas.height / 4);\n                scene._fgnd._webgl.render(gl, scene._webgl.fboScene.tex);\n            }\n\n            var row = 3, col = 2;\n            for (i = 0; i < shadowCount; i++) {\n                var shadowMaps = scene._webgl.fboShadow[i];\n                for (j = 0; j < shadowMaps.length; j++) {\n                    this.stateManager.viewport(col * this.canvas.width / 4, row * this.canvas.height / 4,\n                        this.canvas.width / 4, this.canvas.height / 4);\n                    scene._fgnd._webgl.render(gl, shadowMaps[j].tex);\n                    if (col < 2) {\n                        col++;\n                    } else {\n                        col = 0;\n                        row--;\n                    }\n                }\n            }\n\n            for (rtl_i = 0; rtl_i < rtl_n; rtl_i++) {\n                rt_tex = rentex[rtl_i];\n                if (!rt_tex._webgl.fbo.fbo) // might be deleted (--> RefinementTexture when finished)\n                    continue;\n\n                this.stateManager.viewport(rtl_i * this.canvas.width / 8, 5 * this.canvas.height / 8,\n                    this.canvas.width / 8, this.canvas.height / 8);\n                scene._fgnd._webgl.render(gl, rt_tex._webgl.fbo.tex);\n            }\n        }\n\n        gl.finish();\n        // gl.flush();\n\n        var renderTime = x3dom.Utils.stopMeasure('render');\n\n        this.x3dElem.runtime.addMeasurement('RENDER', renderTime);\n        this.x3dElem.runtime.addMeasurement('DRAW', (n ? renderTime / n : 0));\n\n        this.x3dElem.runtime.addInfo('#NODES:', scene.drawableCollection.numberOfNodes);\n        this.x3dElem.runtime.addInfo('#SHAPES:', viewarea._numRenderedNodes);\n        this.x3dElem.runtime.addInfo(\"#DRAWS:\", this.numDrawCalls);\n        this.x3dElem.runtime.addInfo(\"#POINTS:\", this.numCoords);\n        this.x3dElem.runtime.addInfo(\"#TRIS:\", this.numFaces);\n\n        // scene.drawableObjects = null;\n    };\n\n    /**\n     * Render special PingPong-Pass\n     *\n     * @param gl\n     * @param viewarea\n     * @param rt\n     */\n    Context.prototype.renderPingPongPass = function(gl, viewarea, rt) {\n        var scene = viewarea._scene;\n        var refinementPos = rt._vf.dimensions[0] + \"x\" + rt._vf.dimensions[1];\n        var refinementFbo = scene._webgl.refinement[refinementPos];\n\n        // load stamp textures\n        if (rt._currLoadLevel == 0 && (!scene._webgl.refinement.stamps[0] || !scene._webgl.refinement.stamps[1])) {\n            scene._webgl.refinement.stamps[0] = this.cache.getTexture2D(gl, rt._nameSpace.doc,\n                                    rt._nameSpace.getURL(rt._vf.stamp0), false, 'anonymous', false, false);\n            scene._webgl.refinement.stamps[1] = this.cache.getTexture2D(gl, rt._nameSpace.doc,\n                                    rt._nameSpace.getURL(rt._vf.stamp1), false, 'anonymous', false, false);\n        }\n\n        // load next level of image\n        if (rt._currLoadLevel < rt._loadLevel) {\n            rt._currLoadLevel++;\n\n            if (rt._webgl.texture)\n                gl.deleteTexture(rt._webgl.texture);\n\n            var filename = rt._vf.url[0] + \"/\" + rt._currLoadLevel + \".\" + rt._vf.format;\n\n            rt._webgl.texture = x3dom.Utils.createTexture2D(gl, rt._nameSpace.doc,\n                                rt._nameSpace.getURL(filename), false, 'anonymous', false, false);\n\n            if (rt._vf.iterations % 2 === 0) {\n                (rt._currLoadLevel % 2 !== 0) ? rt._repeat.x *= 2.0 : rt._repeat.y *= 2.0;\n            } else {\n                (rt._currLoadLevel % 2 === 0) ? rt._repeat.x *= 2.0 : rt._repeat.y *= 2.0;\n            }\n        }\n\n        if (!rt._webgl.texture.ready ||\n            !scene._webgl.refinement.stamps[0].ready || !scene._webgl.refinement.stamps[1].ready)\n            return;\n\n        // first pass\n        this.stateManager.bindFramebuffer(gl.FRAMEBUFFER, refinementFbo.fbo);\n        this.stateManager.viewport(0, 0, refinementFbo.width, refinementFbo.height);\n\n        this.stateManager.disable(gl.BLEND);\n        this.stateManager.disable(gl.CULL_FACE);\n        this.stateManager.disable(gl.DEPTH_TEST);\n\n        gl.clearColor(0, 0, 0, 1);\n        gl.clearDepth(1);\n        gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\n        var sp = this.cache.getShader(gl, x3dom.shader.TEXTURE_REFINEMENT);\n        this.stateManager.useProgram(sp);\n\n        gl.bindBuffer(gl.ARRAY_BUFFER, scene._webgl.refinement.positionBuffer);\n        gl.vertexAttribPointer(sp.position, 2, gl.FLOAT, false, 0, 0);\n        gl.enableVertexAttribArray(sp.position);\n\n        sp.stamp = 0;\n        gl.activeTexture(gl.TEXTURE0);\n        gl.bindTexture(gl.TEXTURE_2D, scene._webgl.refinement.stamps[(rt._currLoadLevel + 1) % 2]);    // draw stamp\n        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT);\n        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);\n\n        if (rt._currLoadLevel > 1) {\n            sp.lastTex = 1;\n            gl.activeTexture(gl.TEXTURE1);\n            gl.bindTexture(gl.TEXTURE_2D, rt._webgl.fbo.tex);\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n        }\n\n        sp.curTex = 2;\n        gl.activeTexture(gl.TEXTURE2);\n        gl.bindTexture(gl.TEXTURE_2D, rt._webgl.texture);    // draw level image to fbo\n        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\n        sp.mode = rt._currLoadLevel - 1;\n        sp.repeat = rt._repeat.toGL();\n\n        gl.drawArrays(gl.TRIANGLES, 0, 6);\n\n        // second pass\n        this.stateManager.bindFramebuffer(gl.FRAMEBUFFER, rt._webgl.fbo.fbo);\n        gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\n        sp.mode = 0;\n        sp.curTex = 2;\n        gl.activeTexture(gl.TEXTURE2);\n        gl.bindTexture(gl.TEXTURE_2D, refinementFbo.tex);   // draw result to fbo\n        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\n        gl.drawArrays(gl.TRIANGLES, 0, 6);\n\n        gl.activeTexture(gl.TEXTURE0);\n        gl.bindTexture(gl.TEXTURE_2D, null);\n\n        gl.disableVertexAttribArray(sp.position);\n\n        // pass done\n        this.stateManager.bindFramebuffer(gl.FRAMEBUFFER, null);\n        this.stateManager.viewport(0, 0, this.canvas.width, this.canvas.height);\n\n        if (rt._vf.autoRefinement)\n            rt.nextLevel();\n\n        if (rt._currLoadLevel == rt._vf.maxLevel)\n            rt._currLoadLevel++;\n\n        if (rt._webgl.fbo.mipMap) {\n            gl.bindTexture(gl.TEXTURE_2D, rt._webgl.fbo.tex);\n            gl.generateMipmap(gl.TEXTURE_2D);\n            gl.bindTexture(gl.TEXTURE_2D, null);\n        }\n\n        // we're finally done: cleanup/delete all helper FBOs\n        if (!rt.requirePingPong()) {\n            gl.deleteTexture(rt._webgl.texture);\n            delete rt._webgl.texture;\n\n            rt._cleanupGLObjects(true);\n        }\n\n        rt._renderedImage++;\n    };\n\n    /**\n     * Render RenderedTexture-Pass\n     *\n     * @param gl\n     * @param viewarea\n     * @param rt\n     */\n    Context.prototype.renderRTPass = function(gl, viewarea, rt) {\n        /// begin special case (progressive image refinement)\n        if (x3dom.isa(rt, x3dom.nodeTypes.RefinementTexture)) {\n            if (rt.requirePingPong()) {\n                this.renderPingPongPass(gl, viewarea, rt);\n            }\n            return;\n        }\n        /// end special case\n\n        switch (rt._vf.update.toUpperCase()) {\n            case \"NONE\":\n                return;\n            case \"NEXT_FRAME_ONLY\":\n                if (!rt._needRenderUpdate) {\n                    return;\n                }\n                rt._needRenderUpdate = false;\n                break;\n            case \"ALWAYS\":\n            default:\n                break;\n        }\n\n        var scene = viewarea._scene;\n        var bgnd = null;\n\n        var mat_view = rt.getViewMatrix();\n        var mat_proj = rt.getProjectionMatrix();\n        var mat_scene = mat_proj.mult(mat_view);\n\n        var lightMatrix = viewarea.getLightMatrix()[0];\n        var mat_light = viewarea.getWCtoLCMatrix(lightMatrix);\n\n        var i, n, m = rt._cf.excludeNodes.nodes.length;\n\n        var arr = new Array(m);\n        for (i = 0; i < m; i++) {\n            var render = rt._cf.excludeNodes.nodes[i]._vf.render;\n            if (render === undefined) {\n                arr[i] = -1;\n            } else {\n                if (render === true) {\n                    arr[i] = 1;\n                } else {\n                    arr[i] = 0;\n                }\n            }\n            rt._cf.excludeNodes.nodes[i]._vf.render = false;\n        }\n\n        this.stateManager.bindFramebuffer(gl.FRAMEBUFFER, rt._webgl.fbo.fbo);\n\n        this.stateManager.viewport(0, 0, rt._webgl.fbo.width, rt._webgl.fbo.height);\n\n        if (rt._cf.background.node === null) {\n            gl.clearColor(0, 0, 0, 1);\n            gl.clearDepth(1.0);\n            gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);\n        } else if (rt._cf.background.node === scene.getBackground()) {\n            bgnd = scene.getBackground();\n            bgnd._webgl.render(gl, mat_view, mat_proj, viewarea);\n        } else {\n            bgnd = rt._cf.background.node;\n            this.setupScene(gl, bgnd);\n            bgnd._webgl.render(gl, mat_view, mat_proj, viewarea);\n        }\n\n        this.stateManager.depthFunc(gl.LEQUAL);\n        this.stateManager.enable(gl.DEPTH_TEST);\n        this.stateManager.enable(gl.CULL_FACE);\n\n        this.stateManager.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE);\n        this.stateManager.enable(gl.BLEND);\n\n        var slights = viewarea.getLights();\n        var numLights = slights.length;\n\n        var transform, shape, drawable;\n        var locScene = rt._cf.scene.node;\n\n        if (!locScene || locScene === scene) {\n            n = scene.drawableCollection.length;\n\n            if (rt._vf.showNormals) {\n                this.renderNormals(gl, scene, scene._webgl.normalShader, mat_view, mat_scene);\n            } else {\n                this.stateManager.unsetProgram();\n\n                for (i = 0; i < n; i++) {\n                    drawable = scene.drawableCollection.get(i);\n\n                    this.renderShape(drawable, viewarea, slights, numLights,\n                        mat_view, mat_scene, mat_light, mat_proj, gl);\n                }\n            }\n        } else {\n            var env = scene.getEnvironment();\n\n            var drawableCollectionConfig = {\n                viewArea: viewarea,\n                sortTrans: env._vf.sortTrans,\n                viewMatrix: mat_view,\n                projMatrix: mat_proj,\n                sceneMatrix: mat_scene,\n                frustumCulling: false,\n                smallFeatureThreshold: 1,\n                context: this,\n                gl: gl\n            };\n\n            locScene.numberOfNodes = 0;\n            locScene.drawableCollection = new x3dom.DrawableCollection(drawableCollectionConfig);\n\n            locScene.collectDrawableObjects(x3dom.fields.SFMatrix4f.identity(),\n                locScene.drawableCollection, true, false, 0, []);\n\n            locScene.drawableCollection.sort();\n\n            n = locScene.drawableCollection.length;\n\n            if (rt._vf.showNormals) {\n                this.renderNormals(gl, locScene, scene._webgl.normalShader, mat_view, mat_scene);\n            } else {\n                this.stateManager.unsetProgram();\n\n                for (i = 0; i < n; i++) {\n                    drawable = locScene.drawableCollection.get(i);\n\n                    if (!drawable.shape._vf.render) {\n                        continue;\n                    }\n\n                    this.renderShape(drawable, viewarea, slights, numLights,\n                        mat_view, mat_scene, mat_light, mat_proj, gl);\n                }\n            }\n        }\n\n        this.stateManager.disable(gl.BLEND);\n        this.stateManager.disable(gl.DEPTH_TEST);\n\n        gl.flush();\n        this.stateManager.bindFramebuffer(gl.FRAMEBUFFER, null);\n\n        if (rt._webgl.fbo.mipMap) {\n            gl.bindTexture(gl.TEXTURE_2D, rt._webgl.fbo.tex);\n            gl.generateMipmap(gl.TEXTURE_2D);\n            gl.bindTexture(gl.TEXTURE_2D, null);\n        }\n\n        for (i = 0; i < m; i++) {\n            if (arr[i] !== 0) {\n                rt._cf.excludeNodes.nodes[i]._vf.render = true;\n            }\n        }\n    };\n\n    /**\n     * Render Normals\n     *\n     * @param gl\n     * @param scene\n     * @param sp\n     * @param mat_view\n     * @param mat_scene\n     */\n    Context.prototype.renderNormals = function(gl, scene, sp, mat_view, mat_scene) {\n        if (!sp || !scene) {  // error\n            return;\n        }\n\n        this.stateManager.depthFunc(gl.LEQUAL);\n        this.stateManager.enable(gl.DEPTH_TEST);\n        this.stateManager.enable(gl.CULL_FACE);\n        this.stateManager.disable(gl.BLEND);\n\n        this.stateManager.useProgram(sp);\n\n        var bgCenter = x3dom.fields.SFVec3f.NullVector.toGL();\n        var bgSize = x3dom.fields.SFVec3f.OneVector.toGL();\n\n        for (var i = 0, n = scene.drawableCollection.length; i < n; i++) {\n            var drawable = scene.drawableCollection.get(i);\n            var trafo = drawable.transform;\n            var shape = drawable.shape;\n            var s_gl = shape._webgl;\n\n            if (!s_gl || !shape || !shape._vf.render) {\n                continue;\n            }\n\n            var s_geo = shape._cf.geometry.node;\n            var s_msh = s_geo._mesh;\n\n            var model_view_inv = mat_view.mult(trafo).inverse();\n            sp.normalMatrix = model_view_inv.transpose().toGL();\n            sp.modelViewProjectionMatrix = mat_scene.mult(trafo).toGL();\n\n            // Set ImageGeometry switch (TODO: also impl. in Shader!)\n            sp.imageGeometry = s_gl.imageGeometry;\n\n            if (s_gl.coordType != gl.FLOAT) {\n                if (s_gl.popGeometry != 0 ||\n                    (s_msh._numPosComponents == 4 && x3dom.Utils.isUnsignedType(s_geo._vf.coordType))) {\n                    sp.bgCenter = s_geo.getMin().toGL();\n                } else {\n                    sp.bgCenter = s_geo._vf.position.toGL();\n                }\n                sp.bgSize = s_geo._vf.size.toGL();\n                sp.bgPrecisionMax = s_geo.getPrecisionMax('coordType');\n            } else {\n                sp.bgCenter = bgCenter;\n                sp.bgSize = bgSize;\n                sp.bgPrecisionMax = 1;\n            }\n            if (s_gl.normalType != gl.FLOAT) {\n                sp.bgPrecisionNorMax = s_geo.getPrecisionMax('normalType');\n            } else {\n                sp.bgPrecisionNorMax = 1;\n            }\n\n            if (shape.isSolid()) {\n                this.stateManager.enable(gl.CULL_FACE);\n\n                if (shape.isCCW()) {\n                    this.stateManager.frontFace(gl.CCW);\n                } else {\n                    this.stateManager.frontFace(gl.CW);\n                }\n            } else {\n                this.stateManager.disable(gl.CULL_FACE);\n            }\n\n            // render shape\n            for (var q = 0, q_n = s_gl.positions.length; q < q_n; q++) {\n                var q6 = 6 * q;\n                var v, v_n, offset;\n\n                if (s_gl.externalGeometry != 0) {\n                    var mesh = shape.meshes[q];\n                    mesh.bindVertexAttribPointer(gl, sp);\n\n                    mesh.render(gl);\n                } else if (!(sp.position !== undefined && s_gl.buffers[q6 + x3dom.BUFFER_IDX.POSITION] && s_gl.indexes[q]))\n                    continue;\n\n                // bind buffers\n                if (s_gl.buffers[q6 + x3dom.BUFFER_IDX.INDEX]) {\n                    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, s_gl.buffers[q6 + x3dom.BUFFER_IDX.INDEX]);\n                }\n\n                this.setVertexAttribPointerPosition(gl, shape, q6, q);\n                this.setVertexAttribPointerNormal(gl, shape, q6, q);\n\n                // draw mesh\n                if (s_gl.binaryGeometry > 0 || s_gl.popGeometry > 0) {\n                    for (v = 0, offset = 0, v_n = s_geo._vf.vertexCount.length; v < v_n; v++) {\n                        this.drawElements(gl, s_gl.primType[v], s_geo._vf.vertexCount[v], s_gl.indexType,\n                                        x3dom.Utils.getByteAwareOffset(offset, s_gl.indexType, gl));\n                        offset += s_geo._vf.vertexCount[v];\n                    }\n                } else if (s_gl.binaryGeometry < 0 || s_gl.popGeometry < 0 || s_gl.imageGeometry) {\n                    for (v = 0, offset = 0, v_n = s_geo._vf.vertexCount.length; v < v_n; v++) {\n                        this.drawArrays(gl, s_gl.primType[v], offset, s_geo._vf.vertexCount[v]);\n                        offset += s_geo._vf.vertexCount[v];\n                    }\n                } else if (indicesReady && (s_gl.bufferGeometry > 0)) {\n                    this.drawElements(gl, s_gl.primType[0], s_geo._vf.vertexCount[0], s_gl.indexType, shape._indexOffset);\n                } else if (s_gl.bufferGeometry < 0) {\n                    this.drawArrays(gl, s_gl.primType[0], 0, s_geo._vf.vertexCount[0]);\n                } else if (s_geo.hasIndexOffset()) {\n                    var indOff = shape.tessellationProperties();\n                    for (v = 0, v_n = indOff.length; v < v_n; v++) {\n                        this.drawElements(gl, s_gl.primType, indOff[v].count, s_gl.indexType,\n                            indOff[v].offset * x3dom.Utils.getOffsetMultiplier(s_gl.indexType, gl));\n                    }\n                } else if (s_gl.indexes[q].length == 0) {\n                    this.drawArrays(gl, s_gl.primType, 0, s_gl.positions[q].length / 3);\n                } else {\n                    this.drawElements(gl, s_gl.primType, s_gl.indexes[q].length, s_gl.indexType, 0);\n                }\n\n                gl.disableVertexAttribArray(sp.position);\n\n                if (sp.normal !== undefined) {\n                    gl.disableVertexAttribArray(sp.normal);\n                }\n            }\n        }\n    };\n\n    /**\n     * Cleanup\n     *\n     * @param viewarea\n     */\n    Context.prototype.shutdown = function(viewarea) {\n        var gl = this.ctx3d;\n        var scene = viewarea._scene;\n\n        if (gl == null || !scene) {\n            return;\n        }\n\n        var bgnd = scene.getBackground();\n        if (bgnd._webgl.position !== undefined) {\n            gl.deleteBuffer(bgnd._webgl.buffers[x3dom.BUFFER_IDX.INDEX]);\n            gl.deleteBuffer(bgnd._webgl.buffers[x3dom.BUFFER_IDX.POSITION]);\n        }\n        var fgnd = scene._fgnd;\n        if (fgnd._webgl.position !== undefined) {\n            gl.deleteBuffer(fgnd._webgl.buffers[x3dom.BUFFER_IDX.INDEX]);\n            gl.deleteBuffer(fgnd._webgl.buffers[x3dom.BUFFER_IDX.POSITION]);\n        }\n\n        var n = scene.drawableCollection ? scene.drawableCollection.length : 0;\n        for (var i = 0; i < n; i++) {\n            var shape = scene.drawableCollection.get(i).shape;\n\n            if (shape._cleanupGLObjects)\n                shape._cleanupGLObjects(true);\n        }\n\n        // Release Texture and Shader Resources\n        this.cache.Release(gl);\n    };\n\n    /**\n     * Draw shadows on screen\n     *\n     * @param gl\n     * @param viewarea\n     * @param shadowedLights\n     * @param wctolc\n     * @param lMatrices\n     * @param mat_view\n     * @param mat_proj\n     * @param mat_scene\n     */\n    Context.prototype.renderShadows = function(gl, viewarea, shadowedLights, wctolc, lMatrices,\n                                               mat_view, mat_proj, mat_scene) {\n        var scene = viewarea._scene;\n\n        // don't render shadows with less than 7 textures per fragment shader\n        var texLimit = x3dom.caps.MAX_TEXTURE_IMAGE_UNITS;\n\n        if (texLimit < 7)\n            return;\n\n        var texUnits = 1;\n        var renderSplit = [0];\n\n        var shadowMaps, numShadowMaps;\n        var i, j, k;\n\n        // filter shadow maps and determine, if multiple render passes are needed\n        for (i = 0; i < shadowedLights.length; i++) {\n            var filterSize = shadowedLights[i]._vf.shadowFilterSize;\n            shadowMaps = scene._webgl.fboShadow[i];\n            numShadowMaps = shadowMaps.length;\n\n            // filtering\n            for (j = 0; j < numShadowMaps; j++) {\n                this.blurTex(gl, scene, shadowMaps[j], filterSize);\n            }\n\n            // shader consumes 6 tex units per lights (even if less are bound)\n            texUnits += 6;\n\n            if (texUnits > texLimit) {\n                renderSplit[renderSplit.length] = i;\n                texUnits = 7;\n            }\n        }\n        renderSplit[renderSplit.length] = shadowedLights.length;\n\n        // render shadows for current render split\n        var n = renderSplit.length - 1;\n        var mat_proj_inv = mat_proj.inverse();\n        var mat_scene_inv = mat_scene.inverse();\n\n        // enable (multiplicative) blending\n        this.stateManager.enable(gl.BLEND);\n        this.stateManager.blendFunc(gl.DST_COLOR, gl.ZERO);\n\n        for (var s = 0; s < n; s++) {\n            var startIndex = renderSplit[s];\n            var endIndex = renderSplit[s + 1];\n\n            var currentLights = [];\n\n            for (k = startIndex; k < endIndex; k++)\n                currentLights[currentLights.length] = shadowedLights[k];\n\n            var sp = this.cache.getShadowRenderingShader(gl, currentLights);\n\n            this.stateManager.useProgram(sp);\n\n            gl.bindBuffer(gl.ARRAY_BUFFER, scene._webgl.ppBuffer);\n            gl.vertexAttribPointer(sp.position, 2, gl.FLOAT, false, 0, 0);\n            gl.enableVertexAttribArray(sp.position);\n\n            // bind depth texture (depth from camera view)\n            sp.sceneMap = 0;\n            gl.activeTexture(gl.TEXTURE0);\n            gl.bindTexture(gl.TEXTURE_2D, scene._webgl.fboScene.tex);\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\n            // compute inverse projection matrix\n            sp.inverseProj = mat_proj_inv.toGL();\n\n            // compute inverse view projection matrix\n            sp.inverseViewProj = mat_scene_inv.toGL();\n\n            var mat_light;\n            var lightMatrix;\n            var shadowIndex = 0;\n\n            for (var p = 0, pn = currentLights.length; p < pn; p++) {\n                // get light matrices and shadow maps for current light\n                lightMatrix = lMatrices[p + startIndex];\n                mat_light = wctolc[p + startIndex];\n                shadowMaps = scene._webgl.fboShadow[p + startIndex];\n\n                numShadowMaps = mat_light.length;\n\n                for (i = 0; i < numShadowMaps; i++) {\n                    gl.activeTexture(gl.TEXTURE1 + shadowIndex);\n                    gl.bindTexture(gl.TEXTURE_2D, shadowMaps[i].tex);\n                    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n                    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n                    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n                    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\n                    sp['light' + p + '_' + i + '_ShadowMap'] = shadowIndex + 1;\n                    sp['light' + p + '_' + i + '_Matrix'] = mat_light[i].toGL();\n                    shadowIndex++;\n                }\n                sp['light' + p + '_ViewMatrix'] = lightMatrix.toGL();\n\n                // cascade depths for directional and spot light\n                if (!x3dom.isa(currentLights[p], x3dom.nodeTypes.PointLight)) {\n                    for (j = 0; j < numShadowMaps; j++) {\n                        var numCascades = Math.max(1, Math.min(currentLights[p]._vf.shadowCascades, 6));\n                        var splitFactor = Math.max(0, Math.min(currentLights[p]._vf.shadowSplitFactor, 1));\n                        var splitOffset = Math.max(0, Math.min(currentLights[p]._vf.shadowSplitOffset, 1));\n\n                        var splitDepths = viewarea.getShadowSplitDepths(numCascades, splitFactor, splitOffset, false, mat_proj);\n                        sp['light' + p + '_' + j + '_Split'] = splitDepths[j + 1];\n                    }\n                }\n\n                // assign light properties\n                var light_transform = mat_view.mult(currentLights[p].getCurrentTransform());\n                if (x3dom.isa(currentLights[p], x3dom.nodeTypes.DirectionalLight)) {\n                    sp['light' + p + '_Type'] = 0.0;\n                    sp['light' + p + '_On'] = (currentLights[p]._vf.on) ? 1.0 : 0.0;\n                    sp['light' + p + '_Direction'] = light_transform.multMatrixVec(currentLights[p]._vf.direction).toGL();\n                    sp['light' + p + '_Attenuation'] = [1.0, 1.0, 1.0];\n                    sp['light' + p + '_Location'] = [1.0, 1.0, 1.0];\n                    sp['light' + p + '_Radius'] = 0.0;\n                    sp['light' + p + '_BeamWidth'] = 0.0;\n                    sp['light' + p + '_CutOffAngle'] = 0.0;\n                    sp['light' + p + '_ShadowIntensity'] = currentLights[p]._vf.shadowIntensity;\n                    sp['light' + p + '_ShadowCascades'] = currentLights[p]._vf.shadowCascades;\n                    sp['light' + p + '_ShadowOffset'] = Math.max(0.0, Math.min(1.0, currentLights[p]._vf.shadowOffset));\n                } else if (x3dom.isa(currentLights[p], x3dom.nodeTypes.PointLight)) {\n                    sp['light' + p + '_Type'] = 1.0;\n                    sp['light' + p + '_On'] = (currentLights[p]._vf.on) ? 1.0 : 0.0;\n                    sp['light' + p + '_Direction'] = [1.0, 1.0, 1.0];\n                    sp['light' + p + '_Attenuation'] = currentLights[p]._vf.attenuation.toGL();\n                    sp['light' + p + '_Location'] = light_transform.multMatrixPnt(currentLights[p]._vf.location).toGL();\n                    sp['light' + p + '_Radius'] = currentLights[p]._vf.radius;\n                    sp['light' + p + '_BeamWidth'] = 0.0;\n                    sp['light' + p + '_CutOffAngle'] = 0.0;\n                    sp['light' + p + '_ShadowIntensity'] = currentLights[p]._vf.shadowIntensity;\n                    sp['light' + p + '_ShadowOffset'] = Math.max(0.0, Math.min(1.0, currentLights[p]._vf.shadowOffset));\n                } else if (x3dom.isa(currentLights[p], x3dom.nodeTypes.SpotLight)) {\n                    sp['light' + p + '_Type'] = 2.0;\n                    sp['light' + p + '_On'] = (currentLights[p]._vf.on) ? 1.0 : 0.0;\n                    sp['light' + p + '_Direction'] = light_transform.multMatrixVec(currentLights[p]._vf.direction).toGL();\n                    sp['light' + p + '_Attenuation'] = currentLights[p]._vf.attenuation.toGL();\n                    sp['light' + p + '_Location'] = light_transform.multMatrixPnt(currentLights[p]._vf.location).toGL();\n                    sp['light' + p + '_Radius'] = currentLights[p]._vf.radius;\n                    sp['light' + p + '_BeamWidth'] = currentLights[p]._vf.beamWidth;\n                    sp['light' + p + '_CutOffAngle'] = currentLights[p]._vf.cutOffAngle;\n                    sp['light' + p + '_ShadowIntensity'] = currentLights[p]._vf.shadowIntensity;\n                    sp['light' + p + '_ShadowCascades'] = currentLights[p]._vf.shadowCascades;\n                    sp['light' + p + '_ShadowOffset'] = Math.max(0.0, Math.min(1.0, currentLights[p]._vf.shadowOffset));\n                }\n            }\n\n            gl.drawArrays(gl.TRIANGLES, 0, 6);\n\n            // cleanup\n            var nk = shadowIndex + 1;\n            for (k = 0; k < nk; k++) {\n                gl.activeTexture(gl.TEXTURE0 + k);\n                gl.bindTexture(gl.TEXTURE_2D, null);\n            }\n            gl.disableVertexAttribArray(sp.position);\n        }\n\n        this.stateManager.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\n    };\n\n    /**\n     * Blur texture associated with given fbo\n     *\n     * @param gl\n     * @param scene\n     * @param targetFbo\n     * @param filterSize\n     */\n    Context.prototype.blurTex = function(gl, scene, targetFbo, filterSize) {\n        if (filterSize <= 0) {\n            return;\n        } else if (filterSize < 5) {\n            filterSize = 3;\n        } else if (filterSize < 7) {\n            filterSize = 5;\n        } else {\n            filterSize = 7;\n        }\n\n        // first pass (horizontal blur), result stored in fboBlur\n        var width = targetFbo.width;\n        var height = targetFbo.height;\n        var fboBlur = null;\n\n        for (var i = 0, n = scene._webgl.fboBlur.length; i < n; i++)\n            if (height == scene._webgl.fboBlur[i].height) {\n                fboBlur = scene._webgl.fboBlur[i];\n                break; // THINKABOUTME\n            }\n\n        this.stateManager.bindFramebuffer(gl.FRAMEBUFFER, fboBlur.fbo);\n        this.stateManager.viewport(0, 0, width, height);\n\n        this.stateManager.enable(gl.BLEND);\n        this.stateManager.blendFunc(gl.ONE, gl.ZERO);\n        this.stateManager.disable(gl.CULL_FACE);\n        this.stateManager.disable(gl.DEPTH_TEST);\n\n        gl.clearColor(1.0, 1.0, 1.0, 0.0);\n        gl.clearDepth(1.0);\n        gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\n        var sp = this.cache.getShader(gl, x3dom.shader.BLUR);\n\n        this.stateManager.useProgram(sp);\n\n        // initialize Data for post processing\n        gl.bindBuffer(gl.ARRAY_BUFFER, scene._webgl.ppBuffer);\n        gl.vertexAttribPointer(sp.position, 2, gl.FLOAT, false, 0, 0);\n        gl.enableVertexAttribArray(sp.position);\n\n        sp.pixelSizeHor = 1.0 / width;\n        sp.pixelSizeVert = 1.0 / height;\n        sp.filterSize = filterSize;\n        sp.horizontal = true;\n\n        sp.texture = 0;\n\n        // bind texture\n        gl.activeTexture(gl.TEXTURE0);\n        gl.bindTexture(gl.TEXTURE_2D, targetFbo.tex);\n        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\n        gl.drawArrays(gl.TRIANGLES, 0, 6);\n\n        // second pass (vertical blur), result stored in targetFbo\n        this.stateManager.bindFramebuffer(gl.FRAMEBUFFER, targetFbo.fbo);\n\n        gl.clearColor(1.0, 1.0, 1.0, 0.0);\n        gl.clearDepth(1.0);\n        gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\n        sp.horizontal = false;\n\n        gl.activeTexture(gl.TEXTURE0);\n        gl.bindTexture(gl.TEXTURE_2D, fboBlur.tex);\n        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\n        gl.drawArrays(gl.TRIANGLES, 0, 6);\n\n        // cleanup\n        gl.activeTexture(gl.TEXTURE0);\n        gl.bindTexture(gl.TEXTURE_2D, null);\n        gl.disableVertexAttribArray(sp.position);\n        gl.flush();\n\n        this.stateManager.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\n        this.stateManager.bindFramebuffer(gl.FRAMEBUFFER, null);\n        this.stateManager.viewport(0, 0, this.canvas.width, this.canvas.height);\n    };\n\n    Context.prototype.drawElements = function(gl, mode, count, type, offset, instanceCount)\n    {\n        instanceCount = (instanceCount == undefined) ? 1 : instanceCount;\n\n        instanceCount *= this.VRMode;\n\n        if(x3dom.caps.WEBGL_VERSION == 2)\n        {\n            gl.drawElementsInstanced(mode, count, type, offset, instanceCount);\n        }\n        else if(x3dom.caps.INSTANCED_ARRAYS)\n        {\n            var instancedArrays = this.ctx3d.getExtension(\"ANGLE_instanced_arrays\");\n            instancedArrays.drawElementsInstancedANGLE(mode, count, type, offset, instanceCount);\n        }\n        else\n        {\n            gl.drawElements(mode, count, type, offset);\n        }\n    };\n\n    Context.prototype.drawArrays = function(gl, mode, first, count, instanceCount)\n    {\n        instanceCount = (instanceCount == undefined) ? 1 : instanceCount;\n\n        instanceCount *= this.VRMode;\n\n        if(x3dom.caps.WEBGL_VERSION == 2)\n        {\n            gl.drawArraysInstanced(mode, first, count, instanceCount);\n        }\n        else if(x3dom.caps.INSTANCED_ARRAYS)\n        {\n            var instancedArrays = this.ctx3d.getExtension(\"ANGLE_instanced_arrays\");\n            instancedArrays.drawArraysInstancedANGLE(mode, first, count, instanceCount);\n        }\n        else\n        {\n            gl.drawArrays(mode, first, count);\n        }\n    };\n\n    Context.prototype.setVertexAttribEyeIdx = function(gl, sp)\n    {\n        if(x3dom.caps.WEBGL_VERSION == 2 && sp.eyeIdx != undefined)\n        {\n            if(!this.eyeIdxBuffer)\n            {\n                this.eyeIdxBuffer = gl.createBuffer();\n                gl.bindBuffer(gl.ARRAY_BUFFER, this.eyeIdxBuffer);\n                gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1.0, 1.0]), gl.STATIC_DRAW);\n\n                gl.vertexAttribPointer(sp.eyeIdx, 1, gl.FLOAT, false, 0, 0);\n                gl.enableVertexAttribArray(sp.eyeIdx);\n                gl.vertexAttribDivisor(sp.eyeIdx, 1);\n            }\n            else\n            {\n                gl.bindBuffer(gl.ARRAY_BUFFER, this.eyeIdxBuffer);\n                gl.vertexAttribPointer(sp.eyeIdx, 1, gl.FLOAT, false, 0, 0);\n                gl.enableVertexAttribArray(sp.eyeIdx);\n                gl.vertexAttribDivisor(sp.eyeIdx, 1);\n            }\n        }\n        else if(x3dom.caps.INSTANCED_ARRAYS && sp.eyeIdx != undefined)\n        {\n            var instancedArrays = this.ctx3d.getExtension(\"ANGLE_instanced_arrays\");\n\n            if(!this.eyeIdxBuffer)\n            {\n                this.eyeIdxBuffer = gl.createBuffer();\n                gl.bindBuffer(gl.ARRAY_BUFFER, this.eyeIdxBuffer);\n                gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1.0, 1.0]), gl.STATIC_DRAW);\n\n                gl.vertexAttribPointer(sp.eyeIdx, 1, gl.FLOAT, false, 0, 0);\n                gl.enableVertexAttribArray(sp.eyeIdx);\n                instancedArrays.vertexAttribDivisorANGLE(sp.eyeIdx, 1);\n            }\n            else\n            {\n                gl.bindBuffer(gl.ARRAY_BUFFER, this.eyeIdxBuffer);\n                gl.vertexAttribPointer(sp.eyeIdx, 1, gl.FLOAT, false, 0, 0);\n                gl.enableVertexAttribArray(sp.eyeIdx);\n                instancedArrays.vertexAttribDivisorANGLE(sp.eyeIdx, 1);\n            }\n        }\n    };\n\n    Context.prototype.disableVertexAttribEyeIdx = function(gl, sp)\n    {\n        if(x3dom.caps.WEBGL_VERSION == 2 && sp.eyeIdx != undefined)\n        {\n            gl.disableVertexAttribArray(sp.eyeIdx);\n            gl.vertexAttribDivisor(sp.eyeIdx, 0);\n        }\n        else if(x3dom.caps.INSTANCED_ARRAYS && sp.eyeIdx != undefined)\n        {\n            var instancedArrays = this.ctx3d.getExtension(\"ANGLE_instanced_arrays\");\n\n            gl.disableVertexAttribArray(sp.eyeIdx);\n            instancedArrays.vertexAttribDivisorANGLE(sp.eyeIdx, 0);\n        }\n    };\n\n    /**\n     * Set Vertex Attrib Pointer Position\n     *\n     * @param gl\n     * @param shape\n     * @param q6\n     * @param q\n     */\n    Context.prototype.setVertexAttribPointerPosition = function(gl, shape, q6, q)\n    {\n        var sp = shape._webgl.shader;\n        if (sp.position !== undefined && shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.POSITION]) {\n            var s_geo = shape._cf.geometry.node;\n\n            gl.bindBuffer(gl.ARRAY_BUFFER, shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.POSITION]);\n            gl.vertexAttribPointer(sp.position,\n                s_geo._mesh._numPosComponents, shape._webgl.coordType, shape._webgl.coordNormalized,\n                shape._coordStrideOffset[0], shape._coordStrideOffset[1]);\n            gl.enableVertexAttribArray(sp.position);\n\n        }\n    };\n\n    Context.prototype.setVertexAttribPointerNormal = function(gl, shape, q6, q)\n    {\n        var sp = shape._webgl.shader;\n        if (sp.normal !== undefined && shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.NORMAL]) {\n            var s_geo = shape._cf.geometry.node;\n\n            gl.bindBuffer(gl.ARRAY_BUFFER, shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.NORMAL]);\n            gl.vertexAttribPointer(sp.normal,\n                s_geo._mesh._numNormComponents, shape._webgl.normalType, shape._webgl.normalNormalized,\n                shape._normalStrideOffset[0], shape._normalStrideOffset[1]);\n            gl.enableVertexAttribArray(sp.normal);\n\n        }\n    };\n\n    /**\n     * Set Vertex Attrib Pointer Tex Coord\n     *\n     * @param gl\n     * @param shape\n     * @param q6\n     * @param q\n     */\n    Context.prototype.setVertexAttribPointerTexCoord = function(gl, shape, q6, q) {\n        var sp = shape._webgl.shader;\n        if (sp.texcoord !== undefined && shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.TEXCOORD]) {\n            var s_geo = shape._cf.geometry.node;\n\n            gl.bindBuffer(gl.ARRAY_BUFFER, shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.TEXCOORD]);\n            gl.vertexAttribPointer(sp.texcoord,\n                s_geo._mesh._numTexComponents, shape._webgl.texCoordType, shape._webgl.texCoordNormalized,\n                shape._texCoordStrideOffset[0], shape._texCoordStrideOffset[1]);\n            gl.enableVertexAttribArray(sp.texcoord);\n\n        }\n    };\n\n    /**\n     * Set Vertex Attrib Pointer Tex Coord 2\n     *\n     * @param gl\n     * @param shape\n     * @param q6\n     * @param q\n     */\n    Context.prototype.setVertexAttribPointerTexCoord2 = function(gl, shape, q6, q) {\n        var sp = shape._webgl.shader;\n        if (sp.texcoord2 !== undefined && shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.TEXCOORD_1]) {\n            var s_geo = shape._cf.geometry.node;\n\n            gl.bindBuffer(gl.ARRAY_BUFFER, shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.TEXCOORD_1]);\n            gl.vertexAttribPointer(sp.texcoord2,\n                s_geo._mesh._numTex2Components, shape._webgl.texCoord2Type, shape._webgl.texCoord2Normalized,\n                shape._texCoord2StrideOffset[0], shape._texCoord2StrideOffset[1]);\n            gl.enableVertexAttribArray(sp.texcoord2);\n\n        }\n    };\n\n    /**\n     * Set Vertex Attrib Pointer Color\n     *\n     * @param gl\n     * @param shape\n     * @param q6\n     * @param q\n     */\n    Context.prototype.setVertexAttribPointerColor = function(gl, shape, q6, q) {\n        var sp = shape._webgl.shader;\n        if (sp.color !== undefined && shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.COLOR]) {\n            var s_geo = shape._cf.geometry.node;\n\n            gl.bindBuffer(gl.ARRAY_BUFFER, shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.COLOR]);\n            gl.vertexAttribPointer(sp.color,\n                s_geo._mesh._numColComponents, shape._webgl.colorType, shape._webgl.colorNormalized,\n                shape._colorStrideOffset[0], shape._colorStrideOffset[1]);\n            gl.enableVertexAttribArray(sp.color);\n        }\n    };\n\n    Context.prototype.setVertexAttribPointerTangent = function(gl, shape, q6, q)\n    {\n        var sp = shape._webgl.shader;\n        if (sp.tangent !== undefined && shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.TANGENT])\n        {\n            var s_geo = shape._cf.geometry.node;\n\n            gl.bindBuffer(gl.ARRAY_BUFFER, shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.TANGENT]);\n            gl.vertexAttribPointer(sp.tangent,\n                s_geo._mesh._numTangentComponents, shape._webgl.tangentType, shape._webgl.tangentNormalized,\n                shape._tangentStrideOffset[0], shape._tangentStrideOffset[1]);\n            gl.enableVertexAttribArray(sp.tangent);\n        }\n    };\n\n    Context.prototype.setVertexAttribPointerBinormal = function(gl, shape, q6, q)\n    {\n        var sp = shape._webgl.shader;\n        if (sp.binormal !== undefined && shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.BITANGENT])\n        {\n            var s_geo = shape._cf.geometry.node;\n\n            gl.bindBuffer(gl.ARRAY_BUFFER, shape._webgl.buffers[q6 + x3dom.BUFFER_IDX.BITANGENT]);\n            gl.vertexAttribPointer(sp.binormal,\n                s_geo._mesh._numBinormalComponents, shape._webgl.binormalType, shape._webgl.binormalNormalized,\n                shape._binormalStrideOffset[0], shape._binormalStrideOffset[1]);\n            gl.enableVertexAttribArray(sp.binormal);\n        }\n    };\n\n    Context.prototype.setTonemappingOperator = function(viewarea, sp)\n    {\n        var scene = viewarea._scene;\n        var env = scene.getEnvironment();\n\n        switch(env._vf.tonemapping)\n        {\n            case \"none\":\n                sp.tonemappingOperator = 0.0;\n                break;\n            case \"reinhard\":\n                sp.tonemappingOperator = 1.0;\n                break;\n            case \"uncharted\":\n                sp.tonemappingOperator = 2.0;\n                break;\n            case \"filmic\":\n                sp.tonemappingOperator = 3.0;\n                break;\n            default:\n                sp.tonemappingOperator = 0.0;\n                break;\n        }\n    }\n\n    return setupContext;\n\n})();\n\n/**\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * Philip Taylor: http://philip.html5.org\n */\n\n/**\n * NodeNameSpace constructor\n *\n * @param name\n * @param document\n * @constructor\n */\nx3dom.NodeNameSpace = function(name, document) {\n    this.name = name;\n    this.doc = document;\n    this.baseURL = \"\";\n    this.defMap = {};\n    this.parent = null;\n    this.childSpaces = [];\n};\n\n/**\n * NodeNameSpace Add Node\n *\n * @param node\n * @param name\n */\nx3dom.NodeNameSpace.prototype.addNode = function(node, name) {\n    this.defMap[name] = node;\n    node._nameSpace = this;\n};\n\n/**\n * NodeNameSpace Remove Node\n *\n * @param name\n */\nx3dom.NodeNameSpace.prototype.removeNode = function(name) {\n    var node = name ? this.defMap[name] : null;\n    if (node) {\n        delete this.defMap[name];\n        node._nameSpace = null;\n    }\n};\n\n/**\n * NodeNameSpace Get Named Node\n *\n * @param name\n * @returns {*}\n */\nx3dom.NodeNameSpace.prototype.getNamedNode = function(name) {\n    return this.defMap[name];\n};\n\n/**\n * NodeNameSpace Get Named Element\n *\n * @param name\n * @returns {null}\n */\nx3dom.NodeNameSpace.prototype.getNamedElement = function(name) {\n    var node = this.defMap[name];\n    return (node ? node._xmlNode : null);\n};\n\n/**\n * NodeNameSpace Add Space\n *\n * @param space\n */\nx3dom.NodeNameSpace.prototype.addSpace = function(space) {\n    this.childSpaces.push(space);\n    space.parent = this;\n};\n\n/**\n * NodeNameSpace Remove Space\n *\n * @param space\n */\nx3dom.NodeNameSpace.prototype.removeSpace = function(space) {\n    space.parent = null;\n    for (var it = 0; it < this.childSpaces.length; it++) {\n        if (this.childSpaces[it] == space) {\n            this.childSpaces.splice(it, 1);\n        }\n    }\n};\n\n/**\n * NodeNameSpace Set Base URL\n *\n * @param url\n */\nx3dom.NodeNameSpace.prototype.setBaseURL = function(url) {\n    var i = url.lastIndexOf(\"/\");\n    this.baseURL = (i >= 0) ? url.substr(0, i + 1) : \"\";\n\n    x3dom.debug.logInfo(\"setBaseURL: \" + this.baseURL);\n};\n\n/**\n * NodeNameSpace Get URL\n *\n * @param url\n * @returns {*}\n */\nx3dom.NodeNameSpace.prototype.getURL = function(url) {\n    if (url === undefined || !url.length) {\n        return \"\";\n    } else {\n        return ((url[0] === '/') || (url.indexOf(\":\") >= 0)) ? url : (this.baseURL + url);\n    }\n};\n\n/**\n * Helper to check an element's attribute\n *\n * @param attrName\n * @returns {*}\n */\nx3dom.hasElementAttribute = function(attrName) {\n    var ok = this.__hasAttribute(attrName);\n    if (!ok && attrName) {\n        ok = this.__hasAttribute(attrName.toLowerCase());\n    }\n    return ok;\n};\n\n/**\n * Helper to get an element's attribute\n *\n * @param attrName\n * @returns {*}\n */\nx3dom.getElementAttribute = function(attrName) {\n    var attrib = this.__getAttribute(attrName);\n    if (!attrib && attrib != \"\" && attrName) {\n        attrib = this.__getAttribute(attrName.toLowerCase());\n    }\n\n    if (attrib || !this._x3domNode) {\n        return attrib;\n    } else {\n        return this._x3domNode._vf[attrName];\n    }\n};\n\n/**\n * Helper to set an element's attribute\n *\n * @param attrName\n * @param newVal\n */\nx3dom.setElementAttribute = function(attrName, newVal) {\n    //var prevVal = this.getAttribute(attrName);\n    this.__setAttribute(attrName, newVal);\n    //newVal = this.getAttribute(attrName);\n\n    var x3dNode = this._x3domNode;\n    if (x3dNode) {\n        x3dNode.updateField(attrName, newVal);\n        x3dNode._nameSpace.doc.needRender = true;\n    }\n};\n\n/**\n * Returns the value of the field with the given name.\n * The value is returned as an object of the corresponding field type.\n *\n * @param {String} fieldName - the name of the field\n */\nx3dom.getFieldValue = function(fieldName) {\n    var x3dNode = this._x3domNode;\n\n    if (x3dNode && (x3dNode._vf[fieldName] !== undefined)) {\n\n        var fieldValue = x3dNode._vf[fieldName];\n\n        if (fieldValue instanceof Object && 'copy' in fieldValue) {\n            return x3dNode._vf[fieldName].copy();\n        } else {\n            //f.i. SFString SFBool aren't objects\n            return x3dNode._vf[fieldName];\n        }\n    }\n\n    return null;\n};\n\n/**\n * Sets the value of the field with the given name to the given value.\n * The value is specified as an object of the corresponding field type.\n *\n * @param {String} fieldName  - the name of the field where the value should be set\n * @param {String} fieldvalue - the new field value\n */\nx3dom.setFieldValue = function(fieldName, fieldvalue) {\n    var x3dNode = this._x3domNode;\n    if (x3dNode && (x3dNode._vf[fieldName] !== undefined)) {\n\n        // SF/MF object types are cloned based on a copy function\n        if (fieldvalue instanceof Object && 'copy' in fieldvalue) {\n            x3dNode._vf[fieldName] = fieldvalue.copy();\n        } else {\n            //f.i. SFString SFBool aren't objects\n            x3dNode._vf[fieldName] = fieldvalue;\n        }\n        x3dNode.fieldChanged(fieldName);\n        x3dNode._nameSpace.doc.needRender = true;\n    }\n};\n\n/**\n * Returns the field object of the field with the given name.\n * The returned object is no copy, but instead a reference to X3DOM's internal field object.\n * Changes to this object should be committed using the returnFieldRef function.\n * Note: this only works for fields with pointer types such as MultiFields!\n *\n * @param {String} fieldName - the name of the field\n */\nx3dom.requestFieldRef = function(fieldName) {\n    var x3dNode = this._x3domNode;\n    if (x3dNode && x3dNode._vf[fieldName]) {\n        return x3dNode._vf[fieldName];\n    }\n\n    return null;\n};\n\n/**\n * Commits all changes made to the internal field object of the field with the given name.\n * This must be done in order to notify X3DOM to process all related changes internally.\n *\n * @param {String} fieldName - the name of the field\n */\nx3dom.releaseFieldRef = function(fieldName) {\n    var x3dNode = this._x3domNode;\n    if (x3dNode && x3dNode._vf[fieldName]) {\n        x3dNode.fieldChanged(fieldName);\n        x3dNode._nameSpace.doc.needRender = true;\n    }\n};\n\n/**\n * NodeNameSpace Setup Tree\n *\n * @param domNode\n * @param parent\n * @returns {*}\n */\nx3dom.NodeNameSpace.prototype.setupTree = function(domNode, parent) {\n    var n = null;\n\n    parent = parent || null;\n\n    if (x3dom.isX3DElement(domNode)) {\n\n        // return if it is already initialized\n        if (domNode._x3domNode) {\n            x3dom.debug.logWarning('Tree is already initialized');\n            return null;\n        }\n\n        // workaround since one cannot find out which handlers are registered\n        if ((domNode.tagName !== undefined) &&\n            (!domNode.__addEventListener) && (!domNode.__removeEventListener)) {\n            // helper to track an element's listeners\n            domNode.__addEventListener = domNode.addEventListener;\n            domNode.addEventListener = function(type, func, phase) {\n                if (!this._x3domNode._listeners[type]) {\n                    this._x3domNode._listeners[type] = [];\n                }\n                this._x3domNode._listeners[type].push(func);\n\n                //x3dom.debug.logInfo('addEventListener for ' + this.tagName + \".on\" + type);\n                this.__addEventListener(type, func, phase);\n            };\n\n            domNode.__removeEventListener = domNode.removeEventListener;\n            domNode.removeEventListener = function(type, func, phase) {\n                var list = this._x3domNode._listeners[type];\n                if (list) {\n                    for (var it = 0; it < list.length; it++) {\n                        if (list[it] == func) {\n                            list.splice(it, 1);\n                            //x3dom.debug.logInfo('removeEventListener for ' +\n                            //                    this.tagName + \".on\" + type);\n                        }\n                    }\n                }\n\n                this.__removeEventListener(type, func, phase);\n            };\n        }\n\n        // TODO (?): dynamic update of USE attribute during runtime\n        if (domNode.hasAttribute('USE') || domNode.hasAttribute('use')) {\n            //fix usage of lowercase 'use'\n            if (!domNode.hasAttribute('USE')) {\n                domNode.setAttribute('USE', domNode.getAttribute('use'));\n            }\n\n            n = this.defMap[domNode.getAttribute('USE')];\n            if (!n) {\n                var nsName = domNode.getAttribute('USE').split('__');\n\n                if (nsName.length >= 2) {\n                    var otherNS = this;\n                    while (otherNS) {\n                        if (otherNS.name == nsName[0])\n                            n = otherNS.defMap[nsName[1]];\n                        if (n) {\n                            otherNS = null;\n                        } else {\n                            otherNS = otherNS.parent;\n                        }\n                    }\n                    if (!n) {\n                        n = null;\n                        x3dom.debug.logWarning('Could not USE: ' + domNode.getAttribute('USE'));\n                    }\n                }\n            }\n            if (n) {\n                domNode._x3domNode = n;\n            }\n            return n;\n        } else {\n            // check and create ROUTEs\n            if (domNode.localName.toLowerCase() === 'route') {\n                var route = domNode;\n                var fnAtt = route.getAttribute('fromNode') || route.getAttribute('fromnode');\n                var tnAtt = route.getAttribute('toNode') || route.getAttribute('tonode');\n                var fromNode = this.defMap[fnAtt];\n                var toNode = this.defMap[tnAtt];\n                if (!(fromNode && toNode)) {\n                    x3dom.debug.logWarning(\"Broken route - can't find all DEFs for \" + fnAtt + \" -> \" + tnAtt);\n                } else {\n                    //x3dom.debug.logInfo(\"ROUTE: from=\" + fromNode._DEF + \", to=\" + toNode._DEF);\n                    fnAtt = route.getAttribute('fromField') || route.getAttribute('fromfield');\n                    tnAtt = route.getAttribute('toField') || route.getAttribute('tofield');\n                    fromNode.setupRoute(fnAtt, toNode, tnAtt);\n                    // Store reference to namespace for being able to remove route later on\n                    route._nodeNameSpace = this;\n                }\n                return null;\n            }\n\n            // attach X3DOM's custom field interface functions\n            domNode.requestFieldRef = x3dom.requestFieldRef;\n            domNode.releaseFieldRef = x3dom.releaseFieldRef;\n            domNode.getFieldValue = x3dom.getFieldValue;\n            domNode.setFieldValue = x3dom.setFieldValue;\n\n            // find the NodeType for the given dom-node\n            var nodeType = x3dom.nodeTypesLC[domNode.localName.toLowerCase()];\n            if (nodeType === undefined) {\n                x3dom.debug.logWarning(\"Unrecognised X3D element &lt;\" + domNode.localName + \"&gt;.\");\n            } else {\n                //active workaround for missing DOMAttrModified support\n                if ((x3dom.userAgentFeature.supportsDOMAttrModified === false)\n                    && (domNode instanceof Element)) {\n                    if (domNode.setAttribute && !domNode.__setAttribute) {\n                        domNode.__setAttribute = domNode.setAttribute;\n                        domNode.setAttribute = x3dom.setElementAttribute;\n                    }\n\n                    if (domNode.getAttribute && !domNode.__getAttribute) {\n                        domNode.__getAttribute = domNode.getAttribute;\n                        domNode.getAttribute = x3dom.getElementAttribute;\n                    }\n\n                    if (domNode.hasAttribute && !domNode.__hasAttribute) {\n                        domNode.__hasAttribute = domNode.hasAttribute;\n                        domNode.hasAttribute = x3dom.hasElementAttribute;\n                    }\n                }\n\n                // create x3domNode\n                var ctx = {\n                    doc: this.doc,\n                    xmlNode: domNode,\n                    nameSpace: this\n                };\n                n = new nodeType(ctx);\n\n                // find and store/link _DEF name\n                if (domNode.hasAttribute('DEF')) {\n                    n._DEF = domNode.getAttribute('DEF');\n                    this.defMap[n._DEF] = n;\n                } else {\n                    if (domNode.hasAttribute('id')) {\n                        n._DEF = domNode.getAttribute('id');\n                        this.defMap[n._DEF] = n;\n                    }\n                }\n\n                // add experimental highlighting functionality\n                if (domNode.highlight === undefined) {\n                    domNode.highlight = function(enable, colorStr) {\n                        var color = x3dom.fields.SFColor.parse(colorStr);\n                        this._x3domNode.highlight(enable, color);\n                        this._x3domNode._nameSpace.doc.needRender = true;\n                    };\n                }\n\n                // link both DOM-Node and Scene-graph-Node\n                n._xmlNode = domNode;\n                domNode._x3domNode = n;\n\n                // call children\n                var that = this;\n                Array.forEach(domNode.childNodes, function(childDomNode) {\n                    var c = that.setupTree(childDomNode, n);\n                    if (c) {\n                        n.addChild(c, childDomNode.getAttribute(\"containerField\"));\n                    }\n                });\n\n                n.nodeChanged();\n                return n;\n            }\n        }\n    } else if (domNode.localName) {\n        if (parent && domNode.localName.toLowerCase() == \"x3dommetagroup\") {\n            Array.forEach(domNode.childNodes, function(childDomNode) {\n                var c = this.setupTree(childDomNode, parent);\n                if (c) {\n                    parent.addChild(c, childDomNode.getAttribute(\"containerField\"));\n                }\n            }.bind(this));\n        } else {\n            // be nice to users who use nodes not (yet) known to the system\n            x3dom.debug.logWarning(\"Unrecognised X3D element &lt;\" + domNode.localName + \"&gt;.\");\n            n = null;\n        }\n    }\n\n    return n;\n};\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### X3DNode ###\nx3dom.registerNodeType(\n    \"X3DNode\",\n    \"Core\",\n    defineClass(null, \n        /**\n         * Constructor for X3DNode\n         * @constructs x3dom.nodeTypes.X3DNode\n         * @x3d 3.3\n         * @component Core\n         * @status experimental\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc This abstract node type is the base type for all nodes in the X3D system.\n         */\n        function (ctx) {\n            // reference to DOM element\n            this._xmlNode = null;\n\n            // holds a link to the node name\n            this._DEF = null;\n\n            // links the nameSpace\n            this._nameSpace = (ctx && ctx.nameSpace) ? ctx.nameSpace : null;\n\n            // holds all value fields (e.g. SFFloat, MFVec3f, ...)\n            this._vf = {};\n            this._vfFieldTypes = {};\n\n            // holds all child fields ( SFNode and MFNode )\n            this._cf = {};\n            this._cfFieldTypes = {};\n\n            this._fieldWatchers = {};\n            this._routes = {};\n\n            this._listeners = {};\n\n            this._parentNodes = [];\n\n            // FIXME; should be removed and handled by _cf methods\n            this._childNodes = [];\n\n\n            /**\n             * Field to add metadata information\n             * @var {x3dom.fields.SFNode} metadata\n             * @memberof x3dom.nodeTypes.X3DNode\n             * @initvalue X3DMetadataObject\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFNode('metadata', x3dom.nodeTypes.X3DMetadataObject);\n        \n        },\n        {\n            type: function () {\n                return this.constructor;\n            },\n\n            typeName: function () {\n                return this.constructor._typeName;\n            },\n\n            addChild: function (node, containerFieldName) {\n                if (node) {\n                    var field = null;\n                    if (containerFieldName) {\n                        field = this._cf[containerFieldName];\n                    }\n                    else {\n                        for (var fieldName in this._cf) {\n                            if (this._cf.hasOwnProperty(fieldName)) {\n                                var testField = this._cf[fieldName];\n                                if (x3dom.isa(node,testField.type)) {\n                                    field = testField;\n                                    break;\n                                }\n                            }\n                        }\n                    }\n                    if (field && field.addLink(node)) {\n                        node._parentNodes.push(this);\n                        this._childNodes.push(node);\n                        node.parentAdded(this);\n                        return true;\n                    }\n                }\n                return false;\n            },\n\n            removeChild: function (node) {\n                if (node) {\n                    for (var fieldName in this._cf) {\n                        if (this._cf.hasOwnProperty(fieldName)) {\n                            var field = this._cf[fieldName];\n                            if (field.rmLink(node)) {\n                                for (var i = node._parentNodes.length - 1; i >= 0; i--) {\n                                    if (node._parentNodes[i] === this) {\n                                        node._parentNodes.splice(i, 1);\n                                        node.parentRemoved(this);\n                                    }\n                                }\n                                for (var j = this._childNodes.length - 1; j >= 0; j--) {\n                                    if (this._childNodes[j] === node) {\n                                        node.onRemove();\n                                        this._childNodes.splice(j, 1);\n                                        return true;\n                                    }\n                                }\n                            }\n                        }\n                    }\n                }\n                return false;\n            },\n\n            onRemove: function() {\n                // to be overwritten by concrete classes\n            },\n\n            parentAdded: function(parent) {\n                // to be overwritten by concrete classes\n            },\n\n            parentRemoved: function(parent) {\n                // attention: overwritten by concrete classes\n                for (var i=0, n=this._childNodes.length; i<n; i++) {\n                    if (this._childNodes[i]) {\n                        this._childNodes[i].parentRemoved(this);\n                    }\n                }\n            },\n\n            getCurrentTransform: function () {\n                if (this._parentNodes.length >= 1) {\n                    return this.transformMatrix(this._parentNodes[0].getCurrentTransform());\n                }\n                else {\n                    return x3dom.fields.SFMatrix4f.identity();\n                }\n            },\n\n            transformMatrix: function (transform) {\n                return transform;\n            },\n\n            getVolume: function () {\n                //x3dom.debug.logWarning(\"Called getVolume for unbounded node!\");\n                return null;\n            },\n\n            invalidateVolume: function() {\n                // overwritten\n            },\n\n            invalidateCache: function() {\n                // overwritten\n            },\n\n            volumeValid: function() {\n                return false;\n            },\n\n            // Collects all objects to be drawn\n            collectDrawableObjects: function (transform, drawableCollection, singlePath, invalidateCache, planeMask, clipPlanes) {\n                // explicitly do nothing on collect traversal for (most) nodes\n            },\n\n            highlight: function(enable, color)\n            {\n                if (this._vf.hasOwnProperty(\"diffuseColor\"))\n                {\n                    if (enable) {\n                        if (this._actDiffuseColor === undefined) {\n                            this._actDiffuseColor = new x3dom.fields.SFColor();\n                            this._highlightOn = false;\n                        }\n\n                        if (!this._highlightOn) {\n                            this._actDiffuseColor.setValues(this._vf.diffuseColor);\n                            this._highlightOn = true;\n                        }\n                        this._vf.diffuseColor.setValues(color);\n                    }\n                    else {\n                        if (this._actDiffuseColor !== undefined) {\n                            this._vf.diffuseColor.setValues(this._actDiffuseColor);\n                            this._highlightOn = false;\n                            // new/delete every frame can be very slow\n                            // but prevent from copying if called not only on change\n                            delete this._actDiffuseColor;\n                        }\n                    }\n                }\n\n                for (var i=0, n=this._childNodes.length; i<n; i++)\n                {\n                    if (this._childNodes[i])\n                        this._childNodes[i].highlight(enable, color);\n                }\n            },\n\n            findX3DDoc: function () {\n                return this._nameSpace.doc;\n            },\n\n            doIntersect: function(line) {\n                var isect = false;\n                for (var i=0; i<this._childNodes.length; i++) {\n                    if (this._childNodes[i]) {\n                        isect = this._childNodes[i].doIntersect(line) || isect;\n                    }\n                }\n                return isect;\n            },\n\n            postMessage: function (field, msg) {\n                // TODO: timestamps and stuff\n                this._vf[field] = msg;  // FIXME; _cf!!!\n                var listeners = this._fieldWatchers[field];\n\n                var that = this;\n                if (listeners) {\n                    Array.forEach(listeners, function (l) { l.call(that, msg); });\n                }\n\n                //for Web-style access to the output data of ROUTES, provide a callback function\n                var eventObject = {\n                    target: that._xmlNode,\n                    type: \"outputchange\",   // event only called onxxx if used as old-fashioned attribute\n                    fieldName: field,\n                    value: msg\n                };\n\n                this.callEvtHandler(\"onoutputchange\", eventObject);\n            },\n\n            // method for handling field updates\n            updateField: function (field, msg) {\n                var f = this._vf[field];\n\n                if (f === undefined) {\n                    for (var key in this._vf) {\n                        if (key.toLowerCase() == field) {\n                            field = key;\n                            f = this._vf[field];\n                            break;\n                        }\n                    }\n\n                    var pre = \"set_\";\n                    if (f === undefined && field.indexOf(pre) == 0) {\n                        var fieldName = field.substr(pre.length, field.length - 1);\n                        if (this._vf[fieldName] !== undefined) {\n                            field = fieldName;\n                            f = this._vf[field];\n                        }\n                    }\n                    if (f === undefined) {\n                        f = null;\n                        this._vf[field] = f;\n                    }\n                }\n\n                if (f !== null) {\n                    try {\n                        this._vf[field].setValueByStr(msg);\n                    }\n                    catch (exc1) {\n                        try {\n                            switch ((typeof(this._vf[field])).toString()) {\n                                case \"number\":\n                                    if (typeof(msg) == \"number\")\n                                        this._vf[field] = msg;\n                                    else\n                                        this._vf[field] = +msg;\n                                    break;\n                                case \"boolean\":\n                                    if (typeof(msg) == \"boolean\")\n                                        this._vf[field] = msg;\n                                    else\n                                        this._vf[field] = (msg.toLowerCase() == \"true\");\n                                    break;\n                                case \"string\":\n                                    this._vf[field] = msg;\n                                    break;\n                            }\n                        }\n                        catch (exc2) {\n                            x3dom.debug.logError(\"updateField: setValueByStr() NYI for \" + typeof(f));\n                        }\n                    }\n\n                    // TODO: eval fieldChanged for all nodes!\n                    this.fieldChanged(field);\n                }\n            },\n\n            setupRoute: function (fromField, toNode, toField) {\n                var pos;\n                var fieldName;\n                var pre = \"set_\", post = \"_changed\";\n\n                // build correct fromField\n                if (!this._vf[fromField]) {\n                    pos = fromField.indexOf(pre);\n                    if (pos === 0) {\n                        fieldName = fromField.substr(pre.length, fromField.length - 1);\n                        if (this._vf[fieldName] !== undefined) {\n                            fromField = fieldName;\n                        }\n                    } else {\n                        pos = fromField.indexOf(post);\n                        if (pos > 0) {\n                            fieldName = fromField.substr(0, fromField.length - post.length);\n                            if (this._vf[fieldName] !== undefined) {\n                                fromField = fieldName;\n                            }\n                        }\n                    }\n                }\n\n                // build correct toField\n                if (!toNode._vf[toField]) {\n                    pos = toField.indexOf(pre);\n                    if (pos === 0) {\n                        fieldName = toField.substr(pre.length, toField.length - 1);\n                        if (toNode._vf[fieldName] !== undefined) {\n                            toField = fieldName;\n                        }\n                    }\n                    else {\n                        pos = toField.indexOf(post);\n                        if (pos > 0) {\n                            fieldName = toField.substr(0, toField.length - post.length);\n                            if (toNode._vf[fieldName] !== undefined) {\n                                toField = fieldName;\n                            }\n                        }\n                    }\n                }\n\n                var where = this._DEF + \"&\" + fromField + \"&\" + toNode._DEF + \"&\" + toField;\n\n                if (!this._routes[where]) {\n                    if (!this._fieldWatchers[fromField]) {\n                        this._fieldWatchers[fromField] = [];\n                    }\n                    this._fieldWatchers[fromField].push(\n                        function (msg) {\n                            toNode.postMessage(toField, msg);\n                        }\n                    );\n\n                    if (!toNode._fieldWatchers[toField]) {\n                        toNode._fieldWatchers[toField] = [];\n                    }\n                    toNode._fieldWatchers[toField].push(\n                        // FIXME: THIS DOESN'T WORK FOR NODE (_cf) FIELDS\n                        function (msg) {\n                            toNode._vf[toField] = msg;\n                            toNode.fieldChanged(toField);\n                        }\n                    );\n\n                    // store this route to be able to delete it\n                    this._routes[where] = {\n                        from: this._fieldWatchers[fromField].length - 1,\n                        to: toNode._fieldWatchers[toField].length - 1\n                    };\n                }\n            },\n\n            removeRoute: function (fromField, toNode, toField) {\n                var pos;\n                var fieldName;\n                var pre = \"set_\", post = \"_changed\";\n\n                // again, build correct fromField\n                if (!this._vf[fromField]) {\n                    pos = fromField.indexOf(pre);\n                    if (pos === 0) {\n                        fieldName = fromField.substr(pre.length, fromField.length - 1);\n                        if (this._vf[fieldName] !== undefined) {\n                            fromField = fieldName;\n                        }\n                    } else {\n                        pos = fromField.indexOf(post);\n                        if (pos > 0) {\n                            fieldName = fromField.substr(0, fromField.length - post.length);\n                            if (this._vf[fieldName] !== undefined) {\n                                fromField = fieldName;\n                            }\n                        }\n                    }\n                }\n\n                // again, build correct toField\n                if (!toNode._vf[toField]) {\n                    pos = toField.indexOf(pre);\n                    if (pos === 0) {\n                        fieldName = toField.substr(pre.length, toField.length - 1);\n                        if (toNode._vf[fieldName] !== undefined) {\n                            toField = fieldName;\n                        }\n                    }\n                    else {\n                        pos = toField.indexOf(post);\n                        if (pos > 0) {\n                            fieldName = toField.substr(0, toField.length - post.length);\n                            if (toNode._vf[fieldName] !== undefined) {\n                                toField = fieldName;\n                            }\n                        }\n                    }\n                }\n\n                // finally, delete route\n                var where = this._DEF + \"&\" + fromField + \"&\" + toNode._DEF + \"&\" + toField;\n\n                if (this._routes[where]) {\n                    this._fieldWatchers[fromField].splice(this._routes[where].from, 1);\n                    toNode._fieldWatchers[toField].splice(this._routes[where].to, 1);\n\n                    delete this._routes[where];\n                }\n            },\n\n            fieldChanged: function (fieldName) {\n                // to be overwritten by concrete classes\n            },\n\n            nodeChanged: function () {\n                // to be overwritten by concrete classes\n            },\n\n            callEvtHandler: function(eventType, event) {\n                var node = this;\n\n                if (!node._xmlNode) {\n                    return event.cancelBubble;\n                }\n\n                if(!node._xmlNode.getAttribute(eventType) && \n                   !node._xmlNode[eventType] && \n                   !node._listeners[event.type])\n                {\n                    return event.cancelBubble;\n                }\n\n                try {\n                    var attrib = node._xmlNode[eventType];\n                    event.target = node._xmlNode;\n\n                    if (typeof(attrib) === \"function\") {\n                        attrib.call(node._xmlNode, event);\n                    }\n                    else {\n                        var funcStr = node._xmlNode.getAttribute(eventType);\n                        var func = new Function('event', funcStr);\n                        func.call(node._xmlNode, event);\n                    }\n\n                    var list = node._listeners[event.type];\n                    if (list) {\n                        for (var it=0; it<list.length; it++) {\n                            list[it].call(node._xmlNode, event);\n                        }\n                    }\n                }\n                catch(ex) {\n                    x3dom.debug.logException(ex);\n                }\n\n                return event.cancelBubble;\n            },\n\n            hasEventListener: function( eventType )\n            {\n                return ( this._xmlNode && (this._xmlNode[\"on\" + eventType] ||\n                                           this._xmlNode.hasAttribute(\"on\" + eventType) ||\n                                           this._listeners[eventType]));\n            },\n\n            initSetter: function (xmlNode, name) {\n                if (!xmlNode || !name)\n                    return;\n\n                var nameLC = name.toLowerCase();\n                if (xmlNode.__defineSetter__ && xmlNode.__defineGetter__) {\n                    xmlNode.__defineSetter__(name, function(value) {\n                        xmlNode.setAttribute(name, value);\n                    });\n                    xmlNode.__defineGetter__(name, function() {\n                        return xmlNode.getAttribute(name);\n                    });\n                    if (nameLC != name) {\n                        xmlNode.__defineSetter__(nameLC, function(value) {\n                            xmlNode.setAttribute(name, value);\n                        });\n                        xmlNode.__defineGetter__(nameLC, function() {\n                            return xmlNode.getAttribute(name);\n                        });\n                    }\n                }\n                else {\n                    // IE has no __define[G|S]etter__ !!!\n                    Object.defineProperty(xmlNode, name, {\n                        set: function(value) {\n                            xmlNode.setAttribute(name, value);\n                        },\n                        get: function() {\n                            return xmlNode.getAttribute(name);\n                        },\n                        configurable: true,\n                        enumerable: true\n                    });\n                }\n\n                if (this._vf[name] &&\n                    !xmlNode.attributes[name] && !xmlNode.attributes[name.toLowerCase()]) {\n                    var str = \"\";\n                    try {\n                        if (this._vf[name].toGL)\n                            str = this._vf[name].toGL().toString();\n                        else\n                            str = this._vf[name].toString();\n                    }\n                    catch (e) {\n                        str = this._vf[name].toString();\n                    }\n                    if (!str) {\n                        str = \"\";\n                    }\n                    xmlNode.setAttribute(name, str);\n                }\n            },\n\n            // single fields\n            addField_SFInt32: function (ctx, name, n) {\n                this._vf[name] = ctx && ctx.xmlNode && ctx.xmlNode.hasAttribute(name) ?\n                    parseInt(ctx.xmlNode.getAttribute(name),10) : n;\n\n                if (ctx && ctx.xmlNode) { this.initSetter(ctx.xmlNode, name); }\n                this._vfFieldTypes[name] = \"SFInt32\";\n            },\n\n            addField_SFFloat: function (ctx, name, n) {\n                this._vf[name] = ctx && ctx.xmlNode && ctx.xmlNode.hasAttribute(name) ?\n                    +ctx.xmlNode.getAttribute(name) : n;\n\n                if (ctx && ctx.xmlNode) { this.initSetter(ctx.xmlNode, name); }\n                this._vfFieldTypes[name] = \"SFFloat\";\n            },\n\n            addField_SFDouble: function (ctx, name, n) {\n                this._vf[name] = ctx && ctx.xmlNode && ctx.xmlNode.hasAttribute(name) ?\n                    +ctx.xmlNode.getAttribute(name) : n;\n\n                if (ctx && ctx.xmlNode) { this.initSetter(ctx.xmlNode, name); }\n                this._vfFieldTypes[name] = \"SFDouble\";\n            },\n\n            addField_SFTime: function (ctx, name, n) {\n                this._vf[name] = ctx && ctx.xmlNode && ctx.xmlNode.hasAttribute(name) ?\n                    +ctx.xmlNode.getAttribute(name) : n;\n\n                if (ctx && ctx.xmlNode) { this.initSetter(ctx.xmlNode, name); }\n                this._vfFieldTypes[name] = \"SFTime\";\n            },\n\n            addField_SFBool: function (ctx, name, n) {\n                this._vf[name] = ctx && ctx.xmlNode && ctx.xmlNode.hasAttribute(name) ?\n                    ctx.xmlNode.getAttribute(name).toLowerCase() === \"true\" : n;\n\n                if (ctx && ctx.xmlNode) { this.initSetter(ctx.xmlNode, name); }\n                this._vfFieldTypes[name] = \"SFBool\";\n            },\n\n            addField_SFString: function (ctx, name, n) {\n                this._vf[name] = ctx && ctx.xmlNode && ctx.xmlNode.hasAttribute(name) ?\n                    ctx.xmlNode.getAttribute(name) : n;\n\n                if (ctx && ctx.xmlNode) { this.initSetter(ctx.xmlNode, name); }\n                this._vfFieldTypes[name] = \"SFString\";\n            },\n\n            addField_SFColor: function (ctx, name, r, g, b) {\n                this._vf[name] = ctx && ctx.xmlNode && ctx.xmlNode.hasAttribute(name) ?\n                    x3dom.fields.SFColor.parse(ctx.xmlNode.getAttribute(name)) :\n                    new x3dom.fields.SFColor(r, g, b);\n\n                if (ctx && ctx.xmlNode) { this.initSetter(ctx.xmlNode, name); }\n                this._vfFieldTypes[name] = \"SFColor\";\n            },\n\n            addField_SFColorRGBA: function (ctx, name, r, g, b, a) {\n                this._vf[name] = ctx && ctx.xmlNode && ctx.xmlNode.hasAttribute(name) ?\n                    x3dom.fields.SFColorRGBA.parse(ctx.xmlNode.getAttribute(name)) :\n                    new x3dom.fields.SFColorRGBA(r, g, b, a);\n\n                if (ctx && ctx.xmlNode) { this.initSetter(ctx.xmlNode, name); }\n                this._vfFieldTypes[name] = \"SFColorRGBA\";\n            },\n\n            addField_SFVec2f: function (ctx, name, x, y) {\n                this._vf[name] = ctx && ctx.xmlNode && ctx.xmlNode.hasAttribute(name) ?\n                    x3dom.fields.SFVec2f.parse(ctx.xmlNode.getAttribute(name)) :\n                    new x3dom.fields.SFVec2f(x, y);\n\n                if (ctx && ctx.xmlNode) { this.initSetter(ctx.xmlNode, name); }\n                this._vfFieldTypes[name] = \"SFVec2f\";\n            },\n\n            addField_SFVec3f: function (ctx, name, x, y, z) {\n                this._vf[name] = ctx && ctx.xmlNode && ctx.xmlNode.hasAttribute(name) ?\n                    x3dom.fields.SFVec3f.parse(ctx.xmlNode.getAttribute(name)) :\n                    new x3dom.fields.SFVec3f(x, y, z);\n\n                if (ctx && ctx.xmlNode) { this.initSetter(ctx.xmlNode, name); }\n                this._vfFieldTypes[name] = \"SFVec3f\";\n            },\n\n            addField_SFVec4f: function (ctx, name, x, y, z, w) {\n                this._vf[name] = ctx && ctx.xmlNode && ctx.xmlNode.hasAttribute(name) ?\n                    x3dom.fields.SFVec4f.parse(ctx.xmlNode.getAttribute(name)) :\n                    new x3dom.fields.SFVec4f(x, y, z, w);\n\n                if (ctx && ctx.xmlNode) { this.initSetter(ctx.xmlNode, name); }\n                this._vfFieldTypes[name] = \"SFVec4f\";\n            },\n\n            addField_SFVec3d: function(ctx, name, x, y, z) {\n                this.addField_SFVec3f(ctx, name, x, y, z);\n                this._vfFieldTypes[name] = \"SFVec3d\";\n            },\n\n            addField_SFRotation: function (ctx, name, x, y, z, a) {\n                this._vf[name] = ctx && ctx.xmlNode && ctx.xmlNode.hasAttribute(name) ?\n                    x3dom.fields.Quaternion.parseAxisAngle(ctx.xmlNode.getAttribute(name)) :\n                    x3dom.fields.Quaternion.axisAngle(new x3dom.fields.SFVec3f(x, y, z), a);\n\n                if (ctx && ctx.xmlNode) { this.initSetter(ctx.xmlNode, name); }\n                this._vfFieldTypes[name] = \"SFRotation\";\n            },\n\n            addField_SFMatrix4f: function (ctx, name, _00, _01, _02, _03,\n                                           _10, _11, _12, _13,\n                                           _20, _21, _22, _23,\n                                           _30, _31, _32, _33) {\n                this._vf[name] = ctx && ctx.xmlNode && ctx.xmlNode.hasAttribute(name) ?\n                    x3dom.fields.SFMatrix4f.parse(ctx.xmlNode.getAttribute(name)) :\n                    new x3dom.fields.SFMatrix4f(_00, _01, _02, _03,\n                        _10, _11, _12, _13,\n                        _20, _21, _22, _23,\n                        _30, _31, _32, _33);\n\n                if (ctx && ctx.xmlNode) { this.initSetter(ctx.xmlNode, name); }\n                this._vfFieldTypes[name] = \"SFMatrix4f\";\n            },\n\n            addField_SFImage: function (ctx, name, def) {\n                this._vf[name] = ctx && ctx.xmlNode && ctx.xmlNode.hasAttribute(name) ?\n                    x3dom.fields.SFImage.parse(ctx.xmlNode.getAttribute(name)) :\n                    new x3dom.fields.SFImage(def);\n\n                if (ctx && ctx.xmlNode) { this.initSetter(ctx.xmlNode, name); }\n                this._vfFieldTypes[name] = \"SFImage\";\n            },\n\n            // multi fields\n            addField_MFString: function (ctx, name, def) {\n                this._vf[name] = ctx && ctx.xmlNode && ctx.xmlNode.hasAttribute(name) ?\n                    x3dom.fields.MFString.parse(ctx.xmlNode.getAttribute(name)) :\n                    new x3dom.fields.MFString(def);\n\n                if (ctx && ctx.xmlNode) { this.initSetter(ctx.xmlNode, name); }\n                this._vfFieldTypes[name] = \"MFString\";\n            },\n\n            addField_MFBoolean: function (ctx, name, def) {\n                this._vf[name] = ctx && ctx.xmlNode && ctx.xmlNode.hasAttribute(name) ?\n                    x3dom.fields.MFBoolean.parse(ctx.xmlNode.getAttribute(name)) :\n                    new x3dom.fields.MFBoolean(def);\n\n                if (ctx && ctx.xmlNode) { this.initSetter(ctx.xmlNode, name); }\n                this._vfFieldTypes[name] = \"MFBoolean\";\n            },\n\n            addField_MFInt32: function (ctx, name, def) {\n                this._vf[name] = ctx && ctx.xmlNode && ctx.xmlNode.hasAttribute(name) ?\n                    x3dom.fields.MFInt32.parse(ctx.xmlNode.getAttribute(name)) :\n                    new x3dom.fields.MFInt32(def);\n\n                if (ctx && ctx.xmlNode) { this.initSetter(ctx.xmlNode, name); }\n                this._vfFieldTypes[name] = \"MFInt32\";\n            },\n\n            addField_MFFloat: function (ctx, name, def) {\n                this._vf[name] = ctx && ctx.xmlNode && ctx.xmlNode.hasAttribute(name) ?\n                    x3dom.fields.MFFloat.parse(ctx.xmlNode.getAttribute(name)) :\n                    new x3dom.fields.MFFloat(def);\n\n                if (ctx && ctx.xmlNode) { this.initSetter(ctx.xmlNode, name); }\n                this._vfFieldTypes[name] = \"MFFloat\";\n            },\n\n            addField_MFDouble: function (ctx, name, def) {\n                this._vf[name] = ctx && ctx.xmlNode && ctx.xmlNode.hasAttribute(name) ?\n                    x3dom.fields.MFFloat.parse(ctx.xmlNode.getAttribute(name)) :\n                    new x3dom.fields.MFFloat(def);\n\n                if (ctx && ctx.xmlNode) { this.initSetter(ctx.xmlNode, name); }\n                this._vfFieldTypes[name] = \"MFDouble\";\n            },\n\n            addField_MFColor: function (ctx, name, def) {\n                this._vf[name] = ctx && ctx.xmlNode && ctx.xmlNode.hasAttribute(name) ?\n                    x3dom.fields.MFColor.parse(ctx.xmlNode.getAttribute(name)) :\n                    new x3dom.fields.MFColor(def);\n\n                if (ctx && ctx.xmlNode) { this.initSetter(ctx.xmlNode, name); }\n                this._vfFieldTypes[name] = \"MFColor\";\n            },\n\n            addField_MFColorRGBA: function (ctx, name, def) {\n                this._vf[name] = ctx && ctx.xmlNode && ctx.xmlNode.hasAttribute(name) ?\n                    x3dom.fields.MFColorRGBA.parse(ctx.xmlNode.getAttribute(name)) :\n                    new x3dom.fields.MFColorRGBA(def);\n\n                if (ctx && ctx.xmlNode) { this.initSetter(ctx.xmlNode, name); }\n                this._vfFieldTypes[name] = \"MFColorRGBA\";\n            },\n\n            addField_MFVec2f: function (ctx, name, def) {\n                this._vf[name] = ctx && ctx.xmlNode && ctx.xmlNode.hasAttribute(name) ?\n                    x3dom.fields.MFVec2f.parse(ctx.xmlNode.getAttribute(name)) :\n                    new x3dom.fields.MFVec2f(def);\n\n                if (ctx && ctx.xmlNode) { this.initSetter(ctx.xmlNode, name); }\n                this._vfFieldTypes[name] = \"MFVec2f\";\n            },\n\n            addField_MFVec3f: function (ctx, name, def) {\n                this._vf[name] = ctx && ctx.xmlNode && ctx.xmlNode.hasAttribute(name) ?\n                    x3dom.fields.MFVec3f.parse(ctx.xmlNode.getAttribute(name)) :\n                    new x3dom.fields.MFVec3f(def);\n\n                if (ctx && ctx.xmlNode) { this.initSetter(ctx.xmlNode, name); }\n                this._vfFieldTypes[name] = \"MFVec3f\";\n            },\n\n            addField_MFVec3d: function (ctx, name, def) {\n                this.addField_MFVec3f(ctx, name, def);\n                this._vfFieldTypes[name] = \"MFVec3d\";\n            },\n\n            addField_MFRotation: function (ctx, name, def) {\n                this._vf[name] = ctx && ctx.xmlNode && ctx.xmlNode.hasAttribute(name) ?\n                    x3dom.fields.MFRotation.parse(ctx.xmlNode.getAttribute(name)) :\n                    new x3dom.fields.MFRotation(def);\n\n                if (ctx && ctx.xmlNode) { this.initSetter(ctx.xmlNode, name); }\n                this._vfFieldTypes[name] = \"MFRotation\";\n            },\n\n            // child node fields\n            addField_SFNode: function (name, type) {\n                this._cf[name] = new x3dom.fields.SFNode(type);\n                this._cfFieldTypes[name] = \"SFNode\";\n            },\n            addField_MFNode: function (name, type) {\n                this._cf[name] = new x3dom.fields.MFNode(type);\n                this._cfFieldTypes[name] = \"MFNode\";\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### X3DMetadataObject ### */\nx3dom.registerNodeType(\n    \"X3DMetadataObject\",\n    \"Core\",\n    defineClass(x3dom.nodeTypes.X3DNode,\n        \n        /**\n         * Constructor for X3DMetadataObject\n         * @constructs x3dom.nodeTypes.X3DMetadataObject\n         * @x3d 3.3\n         * @component Core\n         * @status full\n         * @extends x3dom.nodeTypes.X3DNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc This abstract interface is the basis for all metadata nodes. The interface is inherited by\n         * all metadata nodes.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DMetadataObject.superClass.call(this, ctx);\n\n\n            /**\n             * The specification of a non-empty value for the name field is required.\n             * @var {x3dom.fields.SFString} name\n             * @memberof x3dom.nodeTypes.X3DMetadataObject\n             * @initvalue \"\"\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFString(ctx, 'name', \"\");\n\n            /**\n             * The specification of the reference field is optional. If provided, it identifies the metadata standard\n             * or other specification that defines the name field. If the reference field is not provided or is empty,\n             * the meaning of the name field is considered implicit to the characters in the string.\n             * @var {x3dom.fields.SFString} reference\n             * @memberof x3dom.nodeTypes.X3DMetadataObject\n             * @initvalue \"\"\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFString(ctx, 'reference', \"\");\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### MetadataBoolean ### */\nx3dom.registerNodeType(\n    \"MetadataBoolean\",\n    \"Core\",\n    defineClass(x3dom.nodeTypes.X3DMetadataObject,\n        \n        /**\n         * Constructor for MetadataBoolean\n         * @constructs x3dom.nodeTypes.MetadataBoolean\n         * @x3d 3.3\n         * @component Core\n         * @status full\n         * @extends x3dom.nodeTypes.X3DMetadataObject\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The metadata provided by this node is contained in the Boolean values of the value field.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.MetadataBoolean.superClass.call(this, ctx);\n\n\n            /**\n             *\n             * @var {x3dom.fields.MFBoolean} value\n             * @memberof x3dom.nodeTypes.MetadataBoolean\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFBoolean(ctx, 'value', []);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### MetadataDouble ### */\nx3dom.registerNodeType(\n    \"MetadataDouble\",\n    \"Core\",\n    defineClass(x3dom.nodeTypes.X3DMetadataObject,\n        \n        /**\n         * Constructor for MetadataDouble\n         * @constructs x3dom.nodeTypes.MetadataDouble\n         * @x3d 3.3\n         * @component Core\n         * @status full\n         * @extends x3dom.nodeTypes.X3DMetadataObject\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The metadata provided by this node is contained in the double-precision floating point numbers of\n         * the value field.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.MetadataDouble.superClass.call(this, ctx);\n\n\n            /**\n             *\n             * @var {x3dom.fields.MFDouble} value\n             * @memberof x3dom.nodeTypes.MetadataDouble\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFDouble(ctx, 'value', []);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### MetadataFloat ### */\nx3dom.registerNodeType(\n    \"MetadataFloat\",\n    \"Core\",\n    defineClass(x3dom.nodeTypes.X3DMetadataObject,\n        \n        /**\n         * Constructor for MetadataFloat\n         * @constructs x3dom.nodeTypes.MetadataFloat\n         * @x3d 3.3\n         * @component Core\n         * @status full\n         * @extends x3dom.nodeTypes.X3DMetadataObject\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The metadata provided by this node is contained in the single-precision floating point numbers of\n         * the value field.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.MetadataFloat.superClass.call(this, ctx);\n\n\n            /**\n             *\n             * @var {x3dom.fields.MFFloat} value\n             * @memberof x3dom.nodeTypes.MetadataFloat\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFFloat(ctx, 'value', []);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### MetadataInteger ### */\nx3dom.registerNodeType(\n    \"MetadataInteger\",\n    \"Core\",\n    defineClass(x3dom.nodeTypes.X3DMetadataObject,\n        \n        /**\n         * Constructor for MetadataInteger\n         * @constructs x3dom.nodeTypes.MetadataInteger\n         * @x3d 3.3\n         * @component Core\n         * @status full\n         * @extends x3dom.nodeTypes.X3DMetadataObject\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The metadata provided by this node is contained in the integers of the value field.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.MetadataInteger.superClass.call(this, ctx);\n\n\n            /**\n             *\n             * @var {x3dom.fields.MFInt32} value\n             * @memberof x3dom.nodeTypes.MetadataInteger\n             * @initvalue []\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFInt32(ctx, 'value', []);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### MetadataSet ### */\nx3dom.registerNodeType(\n    \"MetadataSet\",\n    \"Core\",\n    defineClass(x3dom.nodeTypes.X3DMetadataObject,\n        \n        /**\n         * Constructor for MetadataSet\n         * @constructs x3dom.nodeTypes.MetadataSet\n         * @x3d 3.3\n         * @component Core\n         * @status full\n         * @extends x3dom.nodeTypes.X3DMetadataObject\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The metadata provided by this node is contained in the metadata nodes of the value field.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.MetadataSet.superClass.call(this, ctx);\n\n\n            /**\n             *\n             * @var {x3dom.fields.MFNode} value\n             * @memberof x3dom.nodeTypes.MetadataSet\n             * @initvalue x3dom.nodeTypes.X3DMetadataObject\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFNode('value', x3dom.nodeTypes.X3DMetadataObject);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### MetadataString ### */\nx3dom.registerNodeType(\n    \"MetadataString\",\n    \"Core\",\n    defineClass(x3dom.nodeTypes.X3DMetadataObject,\n        \n        /**\n         * Constructor for MetadataString\n         * @constructs x3dom.nodeTypes.MetadataString\n         * @x3d 3.3\n         * @component Core\n         * @status full\n         * @extends x3dom.nodeTypes.X3DMetadataObject\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The metadata provided by this node is contained in the strings of the value field.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.MetadataString.superClass.call(this, ctx);\n\n\n            /**\n             *\n             * @var {x3dom.fields.MFString} value\n             * @memberof x3dom.nodeTypes.MetadataString\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFString(ctx, 'value', []);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### Field ### */\nx3dom.registerNodeType(\n    \"Field\",\n    \"Core\",\n    defineClass(x3dom.nodeTypes.X3DNode,\n        \n        /**\n         * Constructor for Field\n         * @constructs x3dom.nodeTypes.Field\n         * @x3d x.x\n         * @component Core\n         * @status full\n         * @extends x3dom.nodeTypes.X3DNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc Class represents a field of a node containing name, type and value\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Field.superClass.call(this, ctx);\n\n\n            /**\n             *\n             * @var {x3dom.fields.SFString} name\n             * @memberof x3dom.nodeTypes.Field\n             * @initvalue \"\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'name', \"\");\n\n            /**\n             *\n             * @var {x3dom.fields.SFString} type\n             * @memberof x3dom.nodeTypes.Field\n             * @initvalue \"\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'type', \"\");\n\n            /**\n             *\n             * @var {x3dom.fields.SFString} value\n             * @memberof x3dom.nodeTypes.Field\n             * @initvalue \"\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'value', \"\");\n        \n        },\n        {\n            fieldChanged: function(fieldName) {\n                var that = this;\n                if (fieldName === 'value') {\n                    Array.forEach(this._parentNodes, function (node) {\n                        node.fieldChanged(that._vf.name);\n                    });\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### X3DChildNode ### */\nx3dom.registerNodeType(\n    \"X3DChildNode\",\n    \"Core\",\n    defineClass(x3dom.nodeTypes.X3DNode,\n        \n        /**\n         * Constructor for X3DChildNode\n         * @constructs x3dom.nodeTypes.X3DChildNode\n         * @x3d 3.3\n         * @component Core\n         * @status full\n         * @extends x3dom.nodeTypes.X3DNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc This abstract node type indicates that the concrete nodes that are instantiated based on it may\n         * be used in children, addChildren, and removeChildren fields.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DChildNode.superClass.call(this, ctx);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### X3DBindableNode ### */\nx3dom.registerNodeType(\n    \"X3DBindableNode\",\n    \"Core\",\n    defineClass(x3dom.nodeTypes.X3DChildNode,\n        \n        /**\n         * Constructor for X3DBindableNode\n         * @constructs x3dom.nodeTypes.X3DBindableNode\n         * @x3d 3.3\n         * @component Core\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DChildNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc X3DBindableNode is the abstract base type for all bindable children nodes.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DBindableNode.superClass.call(this, ctx);\n\n\n            /**\n             * Pushes/pops the node on/from the top of the bindable stack\n             * @var {x3dom.fields.SFBool} bind\n             * @memberof x3dom.nodeTypes.X3DBindableNode\n             * @initvalue false\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'bind', false);\n\n            /**\n             * Description of the bindable node\n             * @var {x3dom.fields.SFString} description\n             * @memberof x3dom.nodeTypes.X3DBindableNode\n             * @initvalue \"\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'description', \"\");\n\n            /**\n             *\n             * @var {x3dom.fields.SFBool} isActive\n             * @memberof x3dom.nodeTypes.X3DBindableNode\n             * @initvalue false\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'isActive', false);\n\n            this._autoGen = (ctx && ctx.autoGen ? true : false);\n            if (this._autoGen)\n                this._vf.description = \"default\" + this.constructor.superClass._typeName;\n\n            // Bindable stack to register node later on\n            this._stack = null;\n            this._bindAnimation = true;\n        \n        },\n        {\n            bind: function (value) {\n                if (this._stack) {\n                    if (value) {\n                        this._stack.push (this);\n                    }\n                    else {\n                        this._stack.pop  (this);\n                    }\n                }\n                else {\n                    x3dom.debug.logError ('No BindStack in ' + this.typeName() + 'Bindable');\n                }\n            },\n\n            activate: function (prev) {\n                this.postMessage('isActive', true);\n                x3dom.debug.logInfo('activate ' + this.typeName() + 'Bindable ' +\n                    this._DEF + '/' + this._vf.description);\n            },\n\n            deactivate: function (prev) {\n                this.postMessage('isActive', false);\n                x3dom.debug.logInfo('deactivate ' + this.typeName() + 'Bindable ' +\n                    this._DEF + '/' + this._vf.description);\n            },\n\n            fieldChanged: function(fieldName) {\n                if (fieldName.indexOf(\"bind\") >= 0) {\n                    this.bind(this._vf.bind);\n                }\n            },\n\n            nodeChanged: function() {\n                this._stack = this._nameSpace.doc._bindableBag.addBindable(this);\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### X3DInfoNode ### */\nx3dom.registerNodeType(\n    \"X3DInfoNode\",\n    \"Core\",\n    defineClass(x3dom.nodeTypes.X3DChildNode,\n        \n        /**\n         * Constructor for X3DInfoNode\n         * @constructs x3dom.nodeTypes.X3DInfoNode\n         * @x3d 3.3\n         * @component Core\n         * @status full\n         * @extends x3dom.nodeTypes.X3DChildNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc This is the base node type for all nodes that contain only information without visual semantics.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DInfoNode.superClass.call(this, ctx);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### WorldInfo ### */\nx3dom.registerNodeType(\n    \"WorldInfo\",\n    \"Core\",\n    defineClass(x3dom.nodeTypes.X3DInfoNode,\n        \n        /**\n         * Constructor for WorldInfo\n         * @constructs x3dom.nodeTypes.WorldInfo\n         * @x3d 3.3\n         * @component Core\n         * @status full\n         * @extends x3dom.nodeTypes.X3DInfoNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The WorldInfo node contains information about the world. This node is strictly for documentation\n         * purposes and has no effect on the visual appearance or behaviour of the world.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.WorldInfo.superClass.call(this, ctx);\n\n\n            /**\n             * The title field is intended to store the name or title of the world so that browsers can present this to\n             * the user (perhaps in the window border).\n             * @var {x3dom.fields.MFString} info\n             * @memberof x3dom.nodeTypes.WorldInfo\n             * @initvalue []\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFString(ctx, 'info', []);\n\n            /**\n             * Information about the world can be stored in the info field, such as author information, copyright, and\n             * usage instructions.\n             * @var {x3dom.fields.SFString} title\n             * @memberof x3dom.nodeTypes.WorldInfo\n             * @initvalue \"\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'title', \"\");\n\n            x3dom.debug.logInfo(this._vf.info);\n            x3dom.debug.logInfo(this._vf.title);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### X3DSensorNode ###\nx3dom.registerNodeType(\n    \"X3DSensorNode\",\n    \"Core\",\n    defineClass(x3dom.nodeTypes.X3DChildNode,\n        \n        /**\n         * Constructor for X3DSensorNode\n         * @constructs x3dom.nodeTypes.X3DSensorNode\n         * @x3d 3.3\n         * @component Core\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DChildNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc This abstract node type is the base type for all sensors.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DSensorNode.superClass.call(this, ctx);\n        \n\t\t\n            /**\n             * Specifies whether this sensor is enabled. A disabled sensor does not produce any output.\n             * @var {x3dom.fields.SFBool} enabled\n             * @memberof x3dom.nodeTypes.X3DSensorNode\n             * @initvalue true\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'enabled', true);\n\t\t\t\n\t\t\t\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// deprecated, will be removed in 1.5\n// ### Param ###\nx3dom.registerNodeType(\n    \"Param\",\n    \"Core\",\n    defineClass(x3dom.nodeTypes.X3DNode,\n        \n        /**\n         * Constructor for Param\n         * @constructs x3dom.nodeTypes.Param\n         * @x3d x.x\n         * @component Core\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * DEPRECATED: Param element needs to be child of X3D element {@link http://x3dom.org/docs/latest/configuration.html}\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Param.superClass.call(this, ctx);\n\n            x3dom.debug.logWarning('DEPRECATED: Param element needs to be child of X3D element '\n                + '[<a href=\"http://x3dom.org/docs/latest/configuration.html\">DOCS</a>]');\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### X3DBoundedObject ### */\nx3dom.registerNodeType(\n    \"X3DBoundedObject\",\n    \"Grouping\",\n    defineClass(x3dom.nodeTypes.X3DChildNode,\n        \n        /**\n         * Constructor for X3DBoundedObject\n         * @constructs x3dom.nodeTypes.X3DBoundedObject\n         * @x3d 3.3\n         * @component Grouping\n         * @status full\n         * @extends x3dom.nodeTypes.X3DChildNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc This abstract node type is the basis for all node types that have bounds specified as part of\n         * the definition. The bboxCenter and bboxSize fields specify a bounding box that encloses the grouping node's\n         * children. This is a hint that may be used for optimization purposes.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DBoundedObject.superClass.call(this, ctx);\n\n\n            /**\n             * Flag to enable/disable rendering\n             * @var {x3dom.fields.SFBool} render\n             * @memberof x3dom.nodeTypes.X3DBoundedObject\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'render', true);\n\n            /**\n             * Center of the bounding box\n             * @var {x3dom.fields.SFVec3f} bboxCenter\n             * @memberof x3dom.nodeTypes.X3DBoundedObject\n             * @initvalue 0,0,0\n             * @range [-inf, inf]\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'bboxCenter', 0, 0, 0);\n\n            /**\n             * Size of the bounding box\n             * @var {x3dom.fields.SFVec3f} bboxSize\n             * @memberof x3dom.nodeTypes.X3DBoundedObject\n             * @initvalue -1,-1,-1\n             * @range [0, inf] or -1\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'bboxSize', -1, -1, -1);\n\n            this._graph = {\n                boundedNode:  this,    // backref to node object\n                localMatrix:  x3dom.fields.SFMatrix4f.identity(),   // usually identity\n                globalMatrix: null,    // new x3dom.fields.SFMatrix4f();\n                volume:       new x3dom.fields.BoxVolume(),     // local bbox\n                lastVolume:   new x3dom.fields.BoxVolume(),     // local bbox\n                worldVolume:  new x3dom.fields.BoxVolume(),     // global bbox\n                center:       new x3dom.fields.SFVec3f(0,0,0),  // center in eye coords\n                coverage:     -1,       // currently approx. number of pixels on screen\n                needCulling:  true      // to be able to disable culling per node\n            };\n        \n        },\n        {\n            fieldChanged: function (fieldName) {\n                // TODO; wait for sync traversal to invalidate en block\n                if (this._vf.hasOwnProperty(fieldName)) {\n                    this.invalidateVolume();\n                    //this.invalidateCache();\n                }\n            },\n\n            nodeChanged: function () {\n                // TODO; wait for sync traversal to invalidate en block\n                this.invalidateVolume();\n                //this.invalidateCache();\n            },\n\n            parentAdded: function(parent) {\n                // some default behavior if not overwitten\n                this.invalidateVolume();\n                //this.invalidateCache();\n            },\n\n            getVolume: function()\n            {\n                var vol = this._graph.volume;\n\n                if (!this.volumeValid() && this._vf.render)\n                {\n                    for (var i=0, n=this._childNodes.length; i<n; i++)\n                    {\n                        var child = this._childNodes[i];\n                        // render could be undefined, but undefined != true\n                        if (!child || child._vf.render !== true)\n                            continue;\n\n                        var childVol = child.getVolume();\n\n                        if (childVol && childVol.isValid())\n                            vol.extendBounds(childVol.min, childVol.max);\n                    }\n                }\n\n                if ( !vol.equals( this._graph.lastVolume ) )\n                {\n                    this._graph.lastVolume = x3dom.fields.BoxVolume.copy( vol );\n\n                    var event = {\n                        target: this._xmlNode,\n                        type: \"volumechanged\",   // event only called onxxx if used as old-fashioned attribute\n                        volume: x3dom.fields.BoxVolume.copy( vol )\n                    };\n\n                    this.callEvtHandler(\"onvolumechanged\", event);\n                }\n\n                return vol;\n            },\n\n            invalidateVolume: function()\n            {\n                var graph = this._graph;\n\n                graph.volume.invalidate();\n\n                // also clear cache\n                graph.worldVolume.invalidate();\n                graph.globalMatrix = null;\n\n                // set parent volumes invalid, too\n                for (var i=0, n=this._parentNodes.length; i<n; i++) {\n                    var node = this._parentNodes[i];\n                    if (node)\n                        node.invalidateVolume();\n                }\n            },\n\n            invalidateCache: function()\n            {\n                var graph = this._graph;\n\n                //if (graph.volume.isValid() &&\n                //    graph.globalMatrix == null && !graph.worldVolume.isValid())\n                //    return;     // stop here, we're already done\n\n                graph.worldVolume.invalidate();\n                graph.globalMatrix = null;\n\n                // clear children's cache, too\n                //for (var i=0, n=this._childNodes.length; i<n; i++) {\n                //    var node = this._childNodes[i];\n                //    if (node)\n                //        node.invalidateCache();\n                //}\n            },\n\n            cacheInvalid: function()\n            {\n                return ( this._graph.globalMatrix == null ||\n                    !this._graph.worldVolume.isValid() );\n            },\n\n            volumeValid: function()\n            {\n                return this._graph.volume.isValid();\n            },\n\n            graphState: function()\n            {\n                return this._graph;\n            },\n\n            forceUpdateCoverage: function()\n            {\n                return false;\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### X3DGroupingNode ###\nx3dom.registerNodeType(\n    \"X3DGroupingNode\",\n    \"Grouping\",\n    defineClass(x3dom.nodeTypes.X3DBoundedObject,\n        \n        /**\n         * Constructor for X3DGroupingNode\n         * @constructs x3dom.nodeTypes.X3DGroupingNode\n         * @x3d 3.3\n         * @component Grouping\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DBoundedObject\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc This abstract node type indicates that concrete node types derived from it contain children nodes\n         * and is the basis for all aggregation.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DGroupingNode.superClass.call(this, ctx);\n\n\n            /**\n             * Grouping nodes have a field that contains a list of children nodes. Each grouping node defines a\n             * coordinate space for its children. This coordinate space is relative to the coordinate space of the node\n             * of which the group node is a child. Such a node is called a parent node. This means that transformations\n             * accumulate down the scene graph hierarchy.\n             * @var {x3dom.fields.MFNode} children\n             * @memberof x3dom.nodeTypes.X3DGroupingNode\n             * @initvalue X3DChildNode\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFNode('children', x3dom.nodeTypes.X3DChildNode);\n            // FIXME; add addChild and removeChild slots ?\n        \n        },\n        {\n            collectDrawableObjects: function (transform, drawableCollection, singlePath, invalidateCache, planeMask, clipPlanes)\n            {\n                // check if multi parent sub-graph, don't cache in that case\n                if (singlePath && (this._parentNodes.length > 1))\n                    singlePath = false;\n\n                // an invalid world matrix or volume needs to be invalidated down the hierarchy\n                if (singlePath && (invalidateCache = invalidateCache || this.cacheInvalid()))\n                    this.invalidateCache();\n\n                // check if sub-graph can be culled away or render flag was set to false\n                planeMask = drawableCollection.cull(transform, this.graphState(), singlePath, planeMask);\n                if (planeMask < 0) {\n                    return;\n                }\n\n                var cnode, childTransform;\n\n                if (singlePath) {\n                    // rebuild cache on change and reuse world transform\n                    if (!this._graph.globalMatrix) {\n                        this._graph.globalMatrix = this.transformMatrix(transform);\n                    }\n                    childTransform = this._graph.globalMatrix;\n                }\n                else {\n                    childTransform = this.transformMatrix(transform);\n                }\n\n                var n = this._childNodes.length;\n\n                if (x3dom.nodeTypes.ClipPlane.count > 0) {\n                    var localClipPlanes = [];\n\n                    for (var j = 0; j < n; j++) {\n                        if ( (cnode = this._childNodes[j]) ) {\n                            if (x3dom.isa(cnode, x3dom.nodeTypes.ClipPlane) && cnode._vf.on && cnode._vf.enabled) {\n                                localClipPlanes.push({plane: cnode, trafo: childTransform});\n                            }\n                        }\n                    }\n\n                    clipPlanes = localClipPlanes.concat(clipPlanes);\n                }\n\n                for (var i=0; i<n; i++) {\n                    if ( (cnode = this._childNodes[i]) ) {\n                        cnode.collectDrawableObjects(childTransform, drawableCollection, singlePath, invalidateCache, planeMask, clipPlanes);\n                    }\n                }\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### Switch ###\nx3dom.registerNodeType(\n    \"Switch\",\n    \"Grouping\",\n    defineClass(x3dom.nodeTypes.X3DGroupingNode,\n        \n        /**\n         * Constructor for Switch\n         * @constructs x3dom.nodeTypes.Switch\n         * @x3d 3.3\n         * @component Grouping\n         * @status full\n         * @extends x3dom.nodeTypes.X3DGroupingNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The Switch grouping node traverses zero or one of the nodes specified in the children field.\n         * All nodes under a Switch continue to receive and send events regardless of the value of whichChoice.\n         * For example, if an active TimeSensor is contained within an inactive choice of an Switch, the TimeSensor sends events regardless of the Switch's state.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Switch.superClass.call(this, ctx);\n\n\n            /**\n             * The whichChoice field specifies the index of the child to traverse, with the first child having index 0.\n             * If whichChoice is less than zero or greater than the number of nodes in the children field, nothing is chosen.\n             * @var {x3dom.fields.SFInt32} whichChoice\n             * @memberof x3dom.nodeTypes.Switch\n             * @initvalue -1\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'whichChoice', -1);\n        \n        },\n        {\n            fieldChanged: function (fieldName) {\n                if (fieldName == \"whichChoice\") {\n                    this.invalidateVolume();\n                    //this.invalidateCache();\n                }\n            },\n\n            getVolume: function()\n            {\n                var vol = this._graph.volume;\n\n                if (!this.volumeValid() && this._vf.render)\n                {\n                    if (this._vf.whichChoice >= 0 &&\n                        this._vf.whichChoice < this._childNodes.length)\n                    {\n                        var child = this._childNodes[this._vf.whichChoice];\n\n                        var childVol = (child && child._vf.render === true) ? child.getVolume() : null;\n\n                        if (childVol && childVol.isValid())\n                            vol.extendBounds(childVol.min, childVol.max);\n                    }\n                }\n\n                return vol;\n            },\n\n            collectDrawableObjects: function (transform, drawableCollection, singlePath, invalidateCache, planeMask, clipPlanes)\n            {\n                if (singlePath && (this._parentNodes.length > 1))\n                    singlePath = false;\n\n                if (singlePath && (invalidateCache = invalidateCache || this.cacheInvalid()))\n                    this.invalidateCache();\n\n                if (this._vf.whichChoice < 0 || this._vf.whichChoice >= this._childNodes.length ||\n                    (planeMask = drawableCollection.cull(transform, this.graphState(), singlePath, planeMask)) < 0) {\n                    return;\n                }\n\n                var cnode, childTransform;\n\n                if (singlePath) {\n                    if (!this._graph.globalMatrix) {\n                        this._graph.globalMatrix = this.transformMatrix(transform);\n                    }\n                    childTransform = this._graph.globalMatrix;\n                }\n                else {\n                    childTransform = this.transformMatrix(transform);\n                }\n\n                if ( (cnode = this._childNodes[this._vf.whichChoice]) ) {\n                    cnode.collectDrawableObjects(childTransform, drawableCollection, singlePath, invalidateCache, planeMask, clipPlanes);\n                }\n            },\n\n            doIntersect: function(line)\n            {\n                if (this._vf.whichChoice < 0 ||\n                    this._vf.whichChoice >= this._childNodes.length) {\n                    return false;\n                }\n\n                var child = this._childNodes[this._vf.whichChoice];\n                if (child) {\n                    return child.doIntersect(line);\n                }\n\n                return false;\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### X3DTransformNode ###\nx3dom.registerNodeType(\n    \"X3DTransformNode\",\n    \"Grouping\",\n    defineClass(x3dom.nodeTypes.X3DGroupingNode,\n        \n        /**\n         * Constructor for X3DTransformNode\n         * @constructs x3dom.nodeTypes.X3DTransformNode\n         * @x3d x.x\n         * @component Grouping\n         * @extends x3dom.nodeTypes.X3DGroupingNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc This abstract node type is the basis for all node types that group and transform their children.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DTransformNode.superClass.call(this, ctx);\n\n            if (ctx)\n                ctx.doc._nodeBag.trans.push(this);\n            else\n                x3dom.debug.logWarning(\"X3DTransformNode: No runtime context found!\");\n\n            // holds the current matrix (local space transform)\n            this._trafo = null;\n\n            // workaround, only check on init if getStyle is necessary, since expensive\n            this._needCssStyleUpdates = true;\n        \n        },\n        {\n            tick: function (t)\n            {\n                var dom = this._xmlNode;\n\n                if (dom && (dom['ontransform'] ||\n                    dom.hasAttribute('ontransform') ||\n                    this._listeners['transform'])) {\n                    var transMatrix = this.getCurrentTransform();\n\n                    var event = {\n                        target: dom,\n                        type: 'transform',\n                        worldX: transMatrix._03,\n                        worldY: transMatrix._13,\n                        worldZ: transMatrix._23,\n                        cancelBubble: false,\n                        stopPropagation: function () {\n                            this.cancelBubble = true;\n                        }\n                    };\n\n                    this.callEvtHandler(\"ontransform\", event);\n                }\n\n                // temporary per frame update method for CSS-Transform\n                if (this._needCssStyleUpdates && dom) {\n                    var trans = x3dom.getStyle(dom, \"-webkit-transform\") ||\n                        x3dom.getStyle(dom, \"-moz-transform\") ||\n                        x3dom.getStyle(dom, \"-ms-transform\") ||\n                        x3dom.getStyle(dom, \"transform\");\n\n                    if (trans && (trans != 'none')) {\n                        this._trafo.setValueByStr(trans);\n\n                        this.invalidateVolume();\n                        //this.invalidateCache();\n\n                        return true;\n                    }\n                    this._needCssStyleUpdates = false;    // no special CSS set\n                }\n\n                return false;\n            },\n\n            transformMatrix: function(transform) {\n                return transform.mult(this._trafo);\n            },\n\n            getVolume: function()\n            {\n                var vol = this._graph.volume;\n\n                if (!this.volumeValid() && this._vf.render)\n                {\n                    this._graph.localMatrix = this._trafo;\n\n                    for (var i=0, n=this._childNodes.length; i<n; i++)\n                    {\n                        var child = this._childNodes[i];\n                        if (!child || child._vf.render !== true)\n                            continue;\n\n                        var childVol = child.getVolume();\n\n                        if (childVol && childVol.isValid())\n                            vol.extendBounds(childVol.min, childVol.max);\n                    }\n\n                    if (vol.isValid())\n                        vol.transform(this._trafo);\n                }\n\n                return vol;\n            },\n\n            doIntersect: function(line)\n            {\n                var isect = false;\n                var mat = this._trafo.inverse();\n\n                var tmpPos = new x3dom.fields.SFVec3f(line.pos.x, line.pos.y, line.pos.z);\n                var tmpDir = new x3dom.fields.SFVec3f(line.dir.x, line.dir.y, line.dir.z);\n\n                line.pos = mat.multMatrixPnt(line.pos);\n                line.dir = mat.multMatrixVec(line.dir);\n\n                if (line.hitObject) {\n                    line.dist *= line.dir.length();\n                }\n\n                // check for _nearest_ hit object and don't stop on first!\n                for (var i=0; i<this._childNodes.length; i++)\n                {\n                    if (this._childNodes[i]) {\n                        isect = this._childNodes[i].doIntersect(line) || isect;\n                    }\n                }\n\n                line.pos.setValues(tmpPos);\n                line.dir.setValues(tmpDir);\n\n                if (isect) {\n                    line.hitPoint = this._trafo.multMatrixPnt(line.hitPoint);\n                    line.dist *= line.dir.length();\n                }\n\n                return isect;\n            },\n\n            parentRemoved: function(parent)\n            {\n                var i, n;\n\n                if (this._parentNodes.length == 0) {\n                    var doc = this.findX3DDoc();\n\n                    for (i=0, n=doc._nodeBag.trans.length; i<n; i++) {\n                        if (doc._nodeBag.trans[i] === this) {\n                            doc._nodeBag.trans.splice(i, 1);\n                        }\n                    }\n                }\n\n                for (i=0, n=this._childNodes.length; i<n; i++) {\n                    if (this._childNodes[i]) {\n                        this._childNodes[i].parentRemoved(this);\n                    }\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### Transform ###\nx3dom.registerNodeType(\n    \"Transform\",\n    \"Grouping\",\n    defineClass(x3dom.nodeTypes.X3DTransformNode,\n        \n        /**\n         * Constructor for Transform\n         * @constructs x3dom.nodeTypes.Transform\n         * @x3d 3.3\n         * @component Grouping\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DTransformNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The Transform node is a grouping node that defines a coordinate system for its children that is relative to the coordinate systems of its ancestors.\n         * The translation, rotation, scale, scaleOrientation and center fields define a geometric 3D transformation.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Transform.superClass.call(this, ctx);\n\n\n            /**\n             * The center field specifies a translation offset from the origin of the local coordinate system (0,0,0).\n             * @var {x3dom.fields.SFVec3f} center\n             * @memberof x3dom.nodeTypes.Transform\n             * @initvalue 0,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'center', 0, 0, 0);\n\n            /**\n\n             * The translation field specifies a translation to the coordinate system.\n             * @var {x3dom.fields.SFVec3f} translation\n             * @memberof x3dom.nodeTypes.Transform\n             * @initvalue 0,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'translation', 0, 0, 0);\n\n            /**\n             * The rotation field specifies a rotation of the coordinate system.\n             * @var {x3dom.fields.SFRotation} rotation\n             * @memberof x3dom.nodeTypes.Transform\n             * @initvalue 0,0,1,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFRotation(ctx, 'rotation', 0, 0, 1, 0);\n\n            /**\n             * The scale field specifies a non-uniform scale of the coordinate system.\n             * Scale values may have any value: positive, negative (indicating a reflection), or zero. A value of zero indicates that any child geometry shall not be displayed.\n             * @var {x3dom.fields.SFVec3f} scale\n             * @memberof x3dom.nodeTypes.Transform\n             * @initvalue 1,1,1\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'scale', 1, 1, 1);\n\n            /**\n             * The scaleOrientation specifies a rotation of the coordinate system before the scale (to specify scales in arbitrary orientations).\n             * The scaleOrientation applies only to the scale operation.\n             * @var {x3dom.fields.SFRotation} scaleOrientation\n             * @memberof x3dom.nodeTypes.Transform\n             * @initvalue 0,0,1,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFRotation(ctx, 'scaleOrientation', 0, 0, 1, 0);\n\n            // P' = T * C * R * SR * S * -SR * -C * P\n            this._trafo = x3dom.fields.SFMatrix4f.translation(\n                this._vf.translation.add(this._vf.center)).\n                mult(this._vf.rotation.toMatrix()).\n                mult(this._vf.scaleOrientation.toMatrix()).\n                mult(x3dom.fields.SFMatrix4f.scale(this._vf.scale)).\n                mult(this._vf.scaleOrientation.toMatrix().inverse()).\n                mult(x3dom.fields.SFMatrix4f.translation(this._vf.center.negate()));\n        \n        },\n        {\n            fieldChanged: function (fieldName)\n            {\n                if (fieldName == \"center\" || fieldName == \"translation\" ||\n                    fieldName == \"rotation\" || fieldName == \"scale\" ||\n                    fieldName == \"scaleOrientation\")\n                {\n                    // P' = T * C * R * SR * S * -SR * -C * P\n                    this._trafo = x3dom.fields.SFMatrix4f.translation(\n                        this._vf.translation.add(this._vf.center)).\n                        mult(this._vf.rotation.toMatrix()).\n                        mult(this._vf.scaleOrientation.toMatrix()).\n                        mult(x3dom.fields.SFMatrix4f.scale(this._vf.scale)).\n                        mult(this._vf.scaleOrientation.toMatrix().inverse()).\n                        mult(x3dom.fields.SFMatrix4f.translation(this._vf.center.negate()));\n\n                    this.invalidateVolume();\n                    //this.invalidateCache();\n                }\n                else if (fieldName == \"render\") {\n                    this.invalidateVolume();\n                    //this.invalidateCache();\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### MatrixTransform ###\nx3dom.registerNodeType(\n    \"MatrixTransform\",\n    \"Grouping\",\n    defineClass(x3dom.nodeTypes.X3DTransformNode,\n        \n        /**\n         * Constructor for MatrixTransform\n         * @constructs x3dom.nodeTypes.MatrixTransform\n         * @x3d x.x\n         * @component Grouping\n         * @extends x3dom.nodeTypes.X3DTransformNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The MatrixTransform node is a grouping node that defines a coordinate system for its children that is relative to the coordinate systems of its ancestors.\n         * The transformation is given as a matrix.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.MatrixTransform.superClass.call(this, ctx);\n\n\n            /**\n             * Defines the transformation matrix.\n             * @var {x3dom.fields.SFMatrix4f} matrix\n             * @memberof x3dom.nodeTypes.MatrixTransform\n             * @initvalue 1,0,0,0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFMatrix4f(ctx, 'matrix',\n                1, 0, 0, 0,\n                0, 1, 0, 0,\n                0, 0, 1, 0,\n                0, 0, 0, 1);\n            this._trafo = this._vf.matrix.transpose();\n        \n        },\n        {\n            fieldChanged: function (fieldName) {\n                if (fieldName == \"matrix\") {\n                    this._trafo = this._vf.matrix.transpose();\n\n                    this.invalidateVolume();\n                    //this.invalidateCache();\n                }\n                else if (fieldName == \"render\") {\n                    this.invalidateVolume();\n                    //this.invalidateCache();\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### Group ###\nx3dom.registerNodeType(\n    \"Group\",\n    \"Grouping\",\n    defineClass(x3dom.nodeTypes.X3DGroupingNode,\n        \n        /**\n         * Constructor for Group\n         * @constructs x3dom.nodeTypes.Group\n         * @x3d 3.3\n         * @component Grouping\n         * @status full\n         * @extends x3dom.nodeTypes.X3DGroupingNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc A Group node contains children nodes without introducing a new transformation.\n         * It is equivalent to a Transform node containing an identity transform.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Group.superClass.call(this, ctx);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### Block ###\nx3dom.registerNodeType(\n    \"Block\",\n    \"Grouping\",\n    defineClass(x3dom.nodeTypes.X3DGroupingNode,\n        \n        /**\n         * Constructor for Block\n         * @constructs x3dom.nodeTypes.Block\n         * @x3d x.x\n         * @component Grouping\n         * @extends x3dom.nodeTypes.X3DGroupingNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Block.superClass.call(this, ctx);\n\n\n            /**\n             *\n             * @var {x3dom.fields.MFString} nameSpaceName\n             * @memberof x3dom.nodeTypes.Block\n             * @initvalue []\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFString(ctx, 'nameSpaceName', []);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### StaticGroup ###\nx3dom.registerNodeType(\n    \"StaticGroup\",\n    \"Grouping\",\n    defineClass(x3dom.nodeTypes.X3DGroupingNode,\n        \n        /**\n         * Constructor for StaticGroup\n         * @constructs x3dom.nodeTypes.StaticGroup\n         * @x3d 3.3\n         * @component Grouping\n         * @status full\n         * @extends x3dom.nodeTypes.X3DGroupingNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The StaticGroup node contains children nodes which cannot be modified.\n         * StaticGroup children are guaranteed to not change, send events, receive events or contain any USE references outside the StaticGroup.\n         * This allows the browser to optimize this content for faster rendering and less memory usage.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.StaticGroup.superClass.call(this, ctx);\n\n            // Node implements optimizations; no need to maintain the children node's\n            // X3D representations, as they cannot be accessed after creation time\n            x3dom.debug.logWarning(\"StaticGroup erroneously also bakes parent transforms, if happens use Group node!\"); // Blender exports to SG\n\n            /**\n             * Enables debugging.\n             * @var {x3dom.fields.SFBool} debug\n             * @memberof x3dom.nodeTypes.StaticGroup\n             * @initvalue false\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'debug', false);\n\n            /**\n             * Enable debug box volumes.\n             * @var {x3dom.fields.SFBool} showDebugBoxVolumes\n             * @memberof x3dom.nodeTypes.StaticGroup\n             * @initvalue false\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'showDebugBoxVolumes', false);\n\n            // type of bvh to use, supported are 'jsBIH', 'BIH' and 'OCTREE'\n\n            /**\n             * Defines the type of bvh to use. Supported are 'jsBIH', 'BIH' and 'OCTREE'.\n             * @var {x3dom.fields.SFString} bvhType\n             * @memberof x3dom.nodeTypes.StaticGroup\n             * @initvalue 'jsBIH'\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'bvhType', 'jsBIH');\n\n            /**\n             *\n             * @var {x3dom.fields.SFInt32} maxObjectsPerNode\n             * @memberof x3dom.nodeTypes.StaticGroup\n             * @initvalue 1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'maxObjectsPerNode', 1);\n            // -1 sets default values, other values forces maxDepth\n\n            /**\n             *\n             * @var {x3dom.fields.SFInt32} maxDepth\n             * @memberof x3dom.nodeTypes.StaticGroup\n             * @initvalue -1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'maxDepth', -1);\n\n            /**\n             *\n             * @var {x3dom.fields.SFFloat} minRelativeBBoxSize\n             * @memberof x3dom.nodeTypes.StaticGroup\n             * @initvalue 0.01\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'minRelativeBBoxSize', 0.01);\n\n            this.needBvhRebuild = true;\n            this.drawableCollection = null;\n            this.bvh = null;\n        \n        },\n        {\n            getMaxDepth : function()\n            {\n                if(this._vf.maxDepth == -1 )\n                {\n                    return (this._vf.bvhType == ('jsBIH' || 'BIH')) ? 50 : 4;\n                }\n                return this._vf.maxDepth;\n            },\n\n            collectDrawableObjects: function (transform, drawableCollection, singlePath, invalidateCache, planeMask, clipPlanes)\n            {\n                // check if multi parent sub-graph, don't cache in that case\n                if (singlePath && (this._parentNodes.length > 1))\n                    singlePath = false;\n\n                // an invalid world matrix or volume needs to be invalidated down the hierarchy\n                if (singlePath && (invalidateCache = invalidateCache || this.cacheInvalid()))\n                    this.invalidateCache();\n\n                // check if sub-graph can be culled away or render flag was set to false\n                planeMask = drawableCollection.cull(transform, this.graphState(), singlePath, planeMask);\n                if (planeMask < 0) {\n                    return;\n                }\n\n                var cnode, childTransform;\n\n                if (singlePath) {\n                    // rebuild cache on change and reuse world transform\n                    if (!this._graph.globalMatrix) {\n                        this._graph.globalMatrix = this.transformMatrix(transform);\n                    }\n                    childTransform = this._graph.globalMatrix;\n                }\n                else {\n                    childTransform = this.transformMatrix(transform);\n                }\n\n                if (this.needBvhRebuild)\n                {\n                    var drawableCollectionConfig = {\n                        viewArea: drawableCollection.viewarea,\n                        sortTrans: drawableCollection.sortTrans,\n                        viewMatrix: drawableCollection.viewMatrix,\n                        projMatrix: drawableCollection.projMatrix,\n                        sceneMatrix: drawableCollection.sceneMatrix,\n                        frustumCulling: false,\n                        smallFeatureThreshold: 0,//1,    // THINKABOUTME\n                        context: drawableCollection.context\n                    };\n\n                    this.drawableCollection = new x3dom.DrawableCollection(drawableCollectionConfig);\n\n                    var i, n = this._childNodes.length;\n                    for (i=0; i<n; i++) {\n                        if ( (cnode = this._childNodes[i]) ) {\n                            //this is only used to collect all drawables once\n                            cnode.collectDrawableObjects(childTransform, this.drawableCollection, singlePath, invalidateCache, planeMask, clipPlanes);\n                        }\n                    }\n                    this.drawableCollection.concat();\n\n                    var scene = this._nameSpace.doc._scene;\n\n                    //create settings\n                    var bvhSettings = new x3dom.bvh.Settings(\n                        this._vf.debug,\n                        this._vf.showDebugBoxVolumes,\n                        this._vf.bvhType,\n                        this._vf.maxObjectsPerNode,\n                        this.getMaxDepth(),\n                        this._vf.minRelativeBBoxSize\n                    );\n                    //create bvh type\n                    this.bvh = (this._vf.bvhType == 'jsBIH' ) ?\n                        new x3dom.bvh.BIH(scene, bvhSettings) :\n                        new x3dom.bvh.Culler(this.drawableCollection,scene, bvhSettings);\n\n                    //add decorator for debug shapes\n                    if(this._vf.debug || this._vf.showDebugBoxVolumes)\n                        this.bvh = new x3dom.bvh.DebugDecorator(this.bvh, scene, bvhSettings);\n\n                    //add drawables\n                    n = this.drawableCollection.length;\n                    for (i = 0; i < n; i++)\n                    {\n                        this.bvh.addDrawable(this.drawableCollection.get(i));\n                    }\n\n                    //compile bvh\n                    this.bvh.compile();\n\n                    if(this._vf.debug)\n                        this.bvh.showCompileStats();\n\n                    this.needBvhRebuild = false;    // TODO: re-evaluate if Inline node is child node\n                }\n\n                x3dom.Utils.startMeasure('bvhTraverse');\n                //collect drawables\n                this.bvh.collectDrawables(drawableCollection);\n                var dt = x3dom.Utils.stopMeasure('bvhTraverse');\n                this._nameSpace.doc.ctx.x3dElem.runtime.addMeasurement('BVH', dt);\n\n                //show stats\n                this.bvh.showTraverseStats(this._nameSpace.doc.ctx.x3dElem.runtime);\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### RemoteSelectionGroup ###\nx3dom.registerNodeType(\n    \"RemoteSelectionGroup\",\n    \"Grouping\",\n    defineClass(x3dom.nodeTypes.X3DGroupingNode,\n        \n        /**\n         * Constructor for RemoteSelectionGroup\n         * @constructs x3dom.nodeTypes.RemoteSelectionGroup\n         * @x3d x.x\n         * @component Grouping\n         * @extends x3dom.nodeTypes.X3DGroupingNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The RemoteSelectionGroup node uses a WebSocket connection to request the results of a a  side\n         *  culling.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.RemoteSelectionGroup.superClass.call(this, ctx);\n\n\n            /**\n             * The address for the WebSocket connection\n             * @var {x3dom.fields.MFString} url\n             * @memberof x3dom.nodeTypes.RemoteSelectionGroup\n             * @initvalue [\"ws://localhost:35668/cstreams/0\"]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFString(ctx, 'url', [\"ws://localhost:35668/cstreams/0\"]);\n\n            /**\n             * Defines a list of subsequent id/object pairs.\n             * @var {x3dom.fields.MFString} label\n             * @memberof x3dom.nodeTypes.RemoteSelectionGroup\n             * @initvalue []\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFString(ctx, 'label', []);\n\n            /**\n             * Sets the maximum number of items that are rendered.\n             * @var {x3dom.fields.SFInt32} maxRenderedIds\n             * @range -1 or [0, inf]\n             * @memberof x3dom.nodeTypes.RemoteSelectionGroup\n             * @initvalue -1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'maxRenderedIds', -1);\n\n            /**\n             * Sets whether a reconnect is attempted on a connection loss.\n             * @var {x3dom.fields.SFBool} reconnect\n             * @memberof x3dom.nodeTypes.RemoteSelectionGroup\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'reconnect', true);\n\n            /**\n             * Sets the scaling factor to reduce the number of render calls during navigation\n             * @var {x3dom.fields.SFFloat} scaleRenderedIdsOnMove\n             * @range [0, 1]\n             * @memberof x3dom.nodeTypes.RemoteSelectionGroup\n             * @initvalue 1.0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'scaleRenderedIdsOnMove', 1.0);\n\n            /**\n             * Defines whether culling is used. If culling is disabled the RemoteSelectionGroup works like a normal group.\n             * @var {x3dom.fields.SFBool} enableCulling\n             * @memberof x3dom.nodeTypes.RemoteSelectionGroup\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'enableCulling', true);\n\n            /**\n             * Defines a set of labels to disable nodes. The label must include the prefix.\n             * @var {x3dom.fields.MFString} invisibleNodes\n             * @memberof x3dom.nodeTypes.RemoteSelectionGroup\n             * @initvalue []\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFString(ctx, 'invisibleNodes', []);\n\n            this._idList = [];          // to be updated by socket connection\n            this._websocket = null;     // pointer to socket\n\n            this._nameObjMap = {};\n            this._createTime = [];\n            this._visibleList = [];\n\n            if (ctx)\n                this.initializeSocket();    // init socket connection\n            else\n                x3dom.debug.logWarning(\"RemoteSelectionGroup: No runtime context found!\");\n        \n        },\n        {\n            initializeSocket: function()\n            {\n                var that = this;\n\n                if (\"WebSocket\" in window)\n                {\n                    var wsUrl = \"ws://localhost:35668/cstreams/0\";\n\n                    if (this._vf.url.length && this._vf.url[0].length)\n                        wsUrl = this._vf.url[0];\n\n                    this._websocket = new WebSocket(wsUrl);\n\n                    this._websocket._lastMsg = null;\n                    this._websocket._lastData = \"\";\n\n                    this._websocket.onopen = function(evt)\n                    {\n                        x3dom.debug.logInfo(\"WS Connected\");\n\n                        var view = that._nameSpace.doc._viewarea.getViewMatrix();\n                        this._lastMsg = view.toGL().toString();\n\n                        view = that._nameSpace.doc._viewarea.getProjectionMatrix();\n                        this._lastMsg += (\",\" + view.toGL().toString());\n\n                        this.send(this._lastMsg);\n                        x3dom.debug.logInfo(\"WS Sent: \" + this._lastMsg);\n\n                        this._lastMsg = \"\";     // triggers first update\n                        this._lastData = \"\";\n                    };\n\n                    this._websocket.onclose = function(evt)\n                    {\n                        x3dom.debug.logInfo(\"WS Disconnected\");\n\n                        if (that._vf.reconnect)\n                        {\n                            window.setTimeout(function() {\n                                that.initializeSocket();\n                            }, 2000);\n                        }\n                    };\n\n                    this._websocket.onmessage = function(evt)\n                    {\n                        if (that._vf.maxRenderedIds < 0)\n                        {\n                            // render all sent items\n                            that._idList = x3dom.fields.MFString.parse(evt.data);\n                        }\n                        else if (that._vf.maxRenderedIds > 0)\n                        {\n                            // render #maxRenderedIds items\n                            that._idList = [];\n                            var arr = x3dom.fields.MFString.parse(evt.data);\n                            var n = Math.min(arr.length, Math.abs(that._vf.maxRenderedIds));\n\n                            for (var i=0; i<n; ++i) {\n                                that._idList[i] = arr[i];\n                            }\n                        }\n\n                        if (that._vf.maxRenderedIds != 0 && this._lastData != evt.data)\n                        {\n                            this._lastData = evt.data;\n                            that._nameSpace.doc.needRender = true;\n                            //x3dom.debug.logInfo(\"WS Response: \" + evt.data);\n\n                            that.invalidateVolume();\n                            //that.invalidateCache();\n                        }\n                    };\n\n                    this._websocket.onerror = function(evt)\n                    {\n                        x3dom.debug.logError(evt.data);\n                    };\n\n                    this._websocket.updateCamera = function()\n                    {\n                        // send again\n                        var view = that._nameSpace.doc._viewarea.getViewMatrix();\n                        var message = view.toGL().toString();\n\n                        view = that._nameSpace.doc._viewarea.getProjectionMatrix();\n                        message += (\",\" + view.toGL().toString());\n\n                        if (this._lastMsg != null && this._lastMsg != message)\n                        {\n                            this._lastMsg = message;\n                            this.send(message);\n                            //x3dom.debug.logInfo(\"WS Sent: \" + message);\n                        }\n                    };\n\n                    // if there were a d'tor this would belong there\n                    // this._websocket.close();\n                }\n                else\n                {\n                    x3dom.debug.logError(\"Browser has no WebSocket support!\");\n                }\n            },\n\n            nodeChanged: function ()\n            {\n                var n = this._vf.label.length;\n\n                this._nameObjMap = {};\n                this._createTime = new Array(n);\n                this._visibleList = new Array(n);\n\n                for (var i=0; i<n; ++i)\n                {\n                    var shape = this._childNodes[i];\n\n                    if (shape && x3dom.isa(shape, x3dom.nodeTypes.X3DShapeNode))\n                    {\n                        this._nameObjMap[this._vf.label[i]] = { shape: shape, pos: i };\n                        this._visibleList[i] = true;\n                    }\n                    else {\n                        this._visibleList[i] = false;\n                        x3dom.debug.logError(\"Invalid children: \" + this._vf.label[i]);\n                    }\n\n                    // init list that holds creation time of gl object\n                    this._createTime[i] = 0;\n                }\n\n                this.invalidateVolume();\n                //this.invalidateCache();\n\n                x3dom.debug.logInfo(\"RemoteSelectionGroup has \" + n + \" entries.\");\n            },\n\n            fieldChanged: function(fieldName)\n            {\n                if (fieldName == \"url\")\n                {\n                    if (this._websocket) {\n                        this._websocket.close();\n                        this._websocket = null;\n                    }\n                    this.initializeSocket();\n                }\n                else if (fieldName == \"invisibleNodes\")\n                {\n                    for (var i=0, n=this._vf.label.length; i<n; ++i)\n                    {\n                        var shape = this._childNodes[i];\n\n                        if (shape && x3dom.isa(shape, x3dom.nodeTypes.X3DShapeNode))\n                        {\n                            this._visibleList[i] = true;\n\n                            for (var j=0, numInvis=this._vf.invisibleNodes.length; j<numInvis; ++j)\n                            {\n                                var nodeName = this._vf.invisibleNodes[j];\n                                var starInd = nodeName.lastIndexOf('*');\n                                var matchNameBegin = false;\n\n                                if (starInd > 0) {\n                                    nodeName = nodeName.substring(0, starInd);\n                                    matchNameBegin = true;\n                                }\n                                if (nodeName.length <= 1)\n                                    continue;\n\n                                if ((matchNameBegin && this._vf.label[i].indexOf(nodeName) == 0) ||\n                                    this._vf.label[i] == nodeName) {\n                                    this._visibleList[i] = false;\n                                    break;\n                                }\n                            }\n                        }\n                        else {\n                            this._visibleList[i] = false;\n                        }\n                    }\n\n                    this.invalidateVolume();\n                    //this.invalidateCache();\n                }\n                else if (fieldName == \"render\") {\n                    this.invalidateVolume();\n                    //this.invalidateCache();\n                }\n            },\n\n            getNumRenderedObjects: function(len, isMoving)\n            {\n                var n = len;\n\n                if (this._vf.maxRenderedIds > 0)\n                {\n                    var num = Math.max(this._vf.maxRenderedIds, 16);  // set lower bound\n\n                    var scale = 1;  // scale down on move\n                    if (isMoving)\n                        scale = Math.min(this._vf.scaleRenderedIdsOnMove, 1);\n\n                    num = Math.max(Math.round(scale * num), 0);\n                    n = Math.min(n, num);\n                }\n\n                return n;\n            },\n\n            collectDrawableObjects: function (transform, drawableCollection, singlePath, invalidateCache, planeMask, clipPlanes)\n            {\n                if (singlePath && (this._parentNodes.length > 1))\n                    singlePath = false;\n\n                if (singlePath && (invalidateCache = invalidateCache || this.cacheInvalid()))\n                    this.invalidateCache();\n\n                planeMask = drawableCollection.cull(transform, this.graphState(), singlePath, planeMask);\n                if (planeMask <= 0) {\n                    return;\n                }\n\n                var viewarea = this._nameSpace.doc._viewarea;\n                var isMoving = viewarea.isMovingOrAnimating();\n\n                var ts = new Date().getTime();\n                var maxLiveTime = 10000;\n                var i, n, numChild = this._childNodes.length;\n\n                if (!this._vf.enableCulling)\n                {\n                    n = this.getNumRenderedObjects(numChild, isMoving);\n\n                    var cnt = 0;\n                    for (i=0; i<numChild; i++)\n                    {\n                        var shape = this._childNodes[i];\n\n                        if (shape)\n                        {\n                            var needCleanup = true;\n\n                            if (this._visibleList[i] && cnt < n &&\n                                shape.collectDrawableObjects(transform, drawableCollection, singlePath, invalidateCache, planeMask, clipPlanes))\n                            {\n                                this._createTime[i] = ts;\n                                cnt++;\n                                needCleanup = false;\n                            }\n\n                            if (needCleanup && !isMoving && this._createTime[i] > 0 &&\n                                ts - this._createTime[i] > maxLiveTime && shape._cleanupGLObjects)\n                            {\n                                shape._cleanupGLObjects(true);\n                                this._createTime[i] = 0;\n                            }\n                        }\n                    }\n\n                    return;\n                }\n\n                if (this._websocket)\n                    this._websocket.updateCamera();\n\n                if (this._vf.label.length)\n                {\n                    n = this.getNumRenderedObjects(this._idList.length, isMoving);\n\n                    for (i=0; i<n; i++)\n                    {\n                        var obj = this._nameObjMap[this._idList[i]];\n                        if (obj && obj.shape) {\n                            obj.shape.collectDrawableObjects(transform, drawableCollection, singlePath, invalidateCache, planeMask, clipPlanes);\n                            this._createTime[obj.pos] = ts;\n                        }\n                        else\n                            x3dom.debug.logError(\"Invalid label: \" + this._idList[i]);\n                    }\n\n                    for (i=0; i<this._childNodes.length; i++)\n                    {\n                        if (this._childNodes[i] && !isMoving && this._createTime[i] > 0 &&\n                            ts - this._createTime[i] > maxLiveTime && this._childNodes[i]._cleanupGLObjects)\n                        {\n                            this._childNodes[i]._cleanupGLObjects(true);\n                            this._createTime[i] = 0;\n                        }\n                    }\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// Not a real X3D node type\n// ### Scene ###\nx3dom.registerNodeType(\n    \"Scene\",\n    \"Grouping\",\n    defineClass(x3dom.nodeTypes.X3DGroupingNode,\n        \n        /**\n         * Constructor for Scene\n         * @constructs x3dom.nodeTypes.Scene\n         * @x3d x.x\n         * @component Core\n         * @extends x3dom.nodeTypes.X3DGroupingNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The scene node wraps the x3d scene.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Scene.superClass.call(this, ctx);\n\n            // define the experimental picking mode: box, idBuf, idBuf24, idBufId, color, texCoord\n\n            /**\n             * The picking mode for the scene\n             * @var {x3dom.fields.SFString} pickMode\n             * @memberof x3dom.nodeTypes.Scene\n             * @initvalue \"idBuf\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'pickMode', \"idBuf\");\n            // experimental field to switch off picking\n\n            /**\n             * Flag to enable/disable pick pass\n             * @var {x3dom.fields.SFBool} doPickPass\n             * @memberof x3dom.nodeTypes.Scene\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'doPickPass', true);\n\n            // another experimental field for shadow DOM remapping\n\n            /**\n             * The url of the shadow object id mapping\n             * @var {x3dom.fields.SFString} shadowObjectIdMapping\n             * @memberof x3dom.nodeTypes.Scene\n             * @initvalue \"\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'shadowObjectIdMapping', \"\");\n\n            this._lastMin = new x3dom.fields.SFVec3f(0, 0, 0);\n            this._lastMax = new x3dom.fields.SFVec3f(1, 1, 1);\n\n            this._shadowIdMap = null;\n            this.loadMapping();\n\n            this._multiPartMap = null;\n        },\n        {\n            /* Bindable getter (e.g. getViewpoint) are added automatically */\n\n            fieldChanged: function(fieldName)\n            {\n                if (fieldName == \"shadowObjectIdMapping\")\n                {\n                    this.loadMapping();\n                }\n            },\n\n            updateVolume: function()\n            {\n                var vol = this.getVolume();\n\n                if (vol.isValid())\n                {\n                    this._lastMin = x3dom.fields.SFVec3f.copy(vol.min);\n                    this._lastMax = x3dom.fields.SFVec3f.copy(vol.max);\n                }\n            },\n\n            loadMapping: function()\n            {\n                this._shadowIdMap = null;\n\n                if (this._vf.shadowObjectIdMapping.length == 0) {\n                    return;\n                }\n\n                var that = this;\n                var xhr = new XMLHttpRequest();\n\n                xhr.open(\"GET\", this._nameSpace.getURL(this._vf.shadowObjectIdMapping), true);\n                //xhr.send();\n                x3dom.RequestManager.addRequest(xhr);\n\n                xhr.onload = function()\n                {\n                    that._shadowIdMap = eval(\"(\" + xhr.response + \")\");\n\n                    if (!that._shadowIdMap || !that._shadowIdMap.mapping) {\n                        x3dom.debug.logWarning(\"Invalid ID map: \" + that._vf.shadowObjectIdMapping);\n                    }\n                    else {\n                        x3dom.debug.assert(that._shadowIdMap.maxID <= that._shadowIdMap.mapping.length,\n                                \"Too few ID map entries in \" + that._vf.shadowObjectIdMapping + \", \" +\n                                \"length of mapping array is only \" + that._shadowIdMap.mapping.length +\n                                \" instead of \" + that._shadowIdMap.ids.length + \"!\");\n                    }\n                };\n            }\n        }\n    )\n);\n\n/**\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n * Based on code originally provided by\n * Philip Taylor: http://philip.html5.org\n */\n\n/**\n * BindableStack constructor\n *\n * @param doc\n * @param type\n * @param defaultType\n * @param getter\n *\n * @constructor\n */\nx3dom.BindableStack = function(doc, type, defaultType, getter) {\n    this._doc = doc;\n    this._type = type;\n    this._defaultType = defaultType;\n    this._defaultRoot = null;\n    this._getter = getter;\n    this._bindBag = [];\n    this._bindStack = [];\n};\n\n/**\n * Bindable Stack Top\n *\n * @returns {number|null}\n */\nx3dom.BindableStack.prototype.top = function() {\n    return ((this._bindStack.length > 0) ? this._bindStack[this._bindStack.length - 1] : null);\n};\n\n/**\n * Bindable Stack Push\n *\n * @param bindable\n */\nx3dom.BindableStack.prototype.push = function(bindable) {\n    var top = this.top();\n\n    if (top === bindable) {\n        return;\n    }\n\n    if (top) {\n        top.deactivate();\n    }\n\n    this._bindStack.push(bindable);\n\n    bindable.activate(top);\n};\n\n/**\n * Bindable Stack Replace Top\n *\n * @param bindable\n */\nx3dom.BindableStack.prototype.replaceTop = function(bindable) {\n    var top = this.top();\n\n    if (top === bindable) {\n        return;\n    }\n\n    if (top) {\n        top.deactivate();\n\n        this._bindStack[this._bindStack.length - 1] = bindable;\n\n        bindable.activate(top);\n    }\n};\n\n/**\n * Bindable Stack Replace Pop\n *\n * @param bindable\n * @returns {*}\n */\nx3dom.BindableStack.prototype.pop = function(bindable) {\n    var top;\n\n    if (bindable) {\n        top = this.top();\n        if (bindable !== top) {\n            return null;\n        }\n    }\n\n    top = this._bindStack.pop();\n\n    if (top) {\n        top.deactivate();\n    }\n\n    return top;\n};\n\n/**\n * Bindable Stack Replace Switch To\n *\n * @param target\n */\nx3dom.BindableStack.prototype.switchTo = function(target) {\n    var last = this.getActive();\n    var n = this._bindBag.length;\n    var toBind = 0;\n    var i = 0, lastIndex = -1;\n\n    if (n <= 1) {\n        return;\n    }\n\n    switch (target) {\n        case 'first':\n            toBind = this._bindBag[0];\n            break;\n        case 'last':\n            toBind = this._bindBag[n - 1];\n            break;\n        default:\n            for (i = 0; i < n; i++) {\n                if (this._bindBag[i] == last) {\n                    lastIndex = i;\n                    break;\n                }\n            }\n            if (lastIndex >= 0) {\n                i = lastIndex;\n                while (!toBind) {\n                    if (target == 'next') {\n                        i = (i < (n - 1)) ? (i + 1) : 0;\n                    } else { // prev\n                        i = (i > 0) ? (i - 1) : (n - 1);\n                    }\n                    if (i == lastIndex) {\n                        break;\n                    }\n                    if (this._bindBag[i]._vf.description.length >= 0) {\n                        toBind = this._bindBag[i];\n                    }\n                }\n            }\n            break;\n    }\n\n    if (toBind) {\n        this.replaceTop(toBind);\n    } else {\n        x3dom.debug.logWarning('Cannot switch bindable; no other bindable with description found.');\n    }\n};\n\n/**\n * Get currently active bindable of given stack type, creates new if none exists\n *\n * @returns {*}\n */\nx3dom.BindableStack.prototype.getActive = function() {\n    if (this._bindStack.length === 0) {\n        if (this._bindBag.length === 0) {\n            if (this._defaultRoot) {\n                x3dom.debug.logInfo('create new ' + this._defaultType._typeName +\n                    ' for ' + this._type._typeName + '-stack');\n                var obj = new this._defaultType(\n                    { doc: this._doc, nameSpace: this._defaultRoot._nameSpace, autoGen: true });\n\n                this._defaultRoot.addChild(obj);\n                obj.nodeChanged();\n            } else {\n                x3dom.debug.logError('stack without defaultRoot');\n            }\n        } else {\n            x3dom.debug.logInfo('activate first ' + this._type._typeName +\n                ' for ' + this._type._typeName + '-stack');\n        }\n\n        this._bindStack.push(this._bindBag[0]);\n        this._bindBag[0].activate();\n    }\n\n    return this._bindStack[this._bindStack.length - 1];\n};\n\n/**\n * BindableBag constructor\n *\n * @param doc\n * @constructor\n */\nx3dom.BindableBag = function(doc) {\n    this._stacks = [];\n\n    this.addType(\"X3DViewpointNode\", \"Viewpoint\", \"getViewpoint\", doc);\n    this.addType(\"X3DNavigationInfoNode\", \"NavigationInfo\", \"getNavigationInfo\", doc);\n    this.addType(\"X3DBackgroundNode\", \"Background\", \"getBackground\", doc);\n    this.addType(\"X3DFogNode\", \"Fog\", \"getFog\", doc);\n    this.addType(\"X3DEnvironmentNode\", \"Environment\", \"getEnvironment\", doc);\n};\n\n/**\n * BindableBag Add Type\n *\n * @param typeName\n * @param defaultTypeName\n * @param getter\n * @param doc\n */\nx3dom.BindableBag.prototype.addType = function(typeName, defaultTypeName, getter, doc) {\n    var type = x3dom.nodeTypes[typeName];\n    var defaultType = x3dom.nodeTypes[defaultTypeName];\n\n    if (type && defaultType) {\n        var stack = new x3dom.BindableStack(doc, type, defaultType, getter);\n        this._stacks.push(stack);\n    } else {\n        x3dom.debug.logWarning('Invalid Bindable type/defaultType: ' +\n            typeName + '/' + defaultType);\n    }\n};\n\n/**\n * BindableBag Set Ref Node\n *\n * @param node\n */\nx3dom.BindableBag.prototype.setRefNode = function(node) {\n    Array.forEach(this._stacks, function(stack) {\n        // set reference to Scene\n        stack._defaultRoot = node;\n        node[stack._getter] = function() { return stack.getActive(); };\n    });\n};\n\n/**\n * BindableBag Add Bindable\n *\n * @param node\n * @returns {*}\n */\nx3dom.BindableBag.prototype.addBindable = function(node) {\n    for (var i = 0, n = this._stacks.length; i < n; i++) {\n        var stack = this._stacks[i];\n\n        if (x3dom.isa(node, stack._type)) {\n            x3dom.debug.logInfo('register ' + node.typeName() + 'Bindable ' +\n                node._DEF + '/' + node._vf.description);\n\n            stack._bindBag.push(node);\n\n            var top = stack.top();\n\n            if (top && top._autoGen) {\n                stack.replaceTop(node);\n\n                // remove auto-generated default bindable\n                for (var j = 0, m = stack._bindBag.length; j < m; j++) {\n                    if (stack._bindBag[j] === top) {\n                        stack._bindBag.splice(j, 1);\n                        break;\n                    }\n                }\n                stack._defaultRoot.removeChild(top);\n            }\n\n            return stack;\n        }\n    }\n\n    x3dom.debug.logError(node.typeName() + ' is not a valid bindable');\n    return null;\n};\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### X3DGeometryNode ### */\nx3dom.registerNodeType(\n    \"X3DGeometryNode\",\n    \"Rendering\",\n    defineClass(x3dom.nodeTypes.X3DNode,\n        \n        /**\n         * Constructor for X3DGeometryNode\n         * @constructs x3dom.nodeTypes.X3DGeometryNode\n         * @x3d 3.3\n         * @component Rendering\n         * @status full\n         * @extends x3dom.nodeTypes.X3DNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc This is the base node type for all geometry in X3D.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DGeometryNode.superClass.call(this, ctx);\n\n\n            /**\n             * Specifies whether backface-culling is used. If solid is TRUE only front-faces are drawn.\n             * @var {x3dom.fields.SFBool} solid\n             * @memberof x3dom.nodeTypes.X3DGeometryNode\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'solid', true);\n\n            /**\n             * The ccw field defines the ordering of the vertex coordinates of the geometry with respect to user-given or automatically generated normal vectors used in the lighting model equations.\n             * @var {x3dom.fields.SFBool} ccw\n             * @memberof x3dom.nodeTypes.X3DGeometryNode\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'ccw', true);\n\n            /**\n             * Most geo primitives use geo cache and others might later on, but one should be able to disable cache per geometry node.\n             * Defaults to global useGeoCache setting parameter. \n             * @var {x3dom.fields.SFBool} useGeoCache\n             * @memberof x3dom.nodeTypes.X3DGeometryNode\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'useGeoCache', this._nameSpace ? \n                                 this._nameSpace.doc.properties.getProperty(\"useGeoCache\", \"true\").toLowerCase() == 'true'\n                                : false);\n\n            /**\n             * Specifies whether this geometry should be rendered with or without lighting.\n             * @var {x3dom.fields.SFBool} lit\n             * @memberof x3dom.nodeTypes.X3DGeometryNode\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'lit', true);\n\n            // mesh object also holds volume (_vol)\n            this._mesh = new x3dom.Mesh(this);\n        \n        },\n        {\n            getVolume: function() {\n                // geometry doesn't hold volume, but mesh does\n                return this._mesh.getVolume();\n            },\n\n            invalidateVolume: function() {\n                this._mesh.invalidate();\n            },\n\n            getCenter: function() {\n                return this._mesh.getCenter();\n            },\n\n            getDiameter: function() {\n                return this._mesh.getDiameter();\n            },\n\n            doIntersect: function(line) {\n                return this._mesh.doIntersect(line);\n            },\n\n            forceUpdateCoverage: function() {\n                return false;\n            },\n\n            hasIndexOffset: function() {\n                return false;\n            },\n\n            getColorTexture: function() {\n                return null;\n            },\n\n            getColorTextureURL: function() {\n                return null;\n            },\n\n            parentAdded: function(parent) {\n                if (x3dom.isa(parent, x3dom.nodeTypes.X3DShapeNode)) {\n                    if (parent._cleanupGLObjects) {\n                        parent._cleanupGLObjects(true);\n                    }\n                    parent.setAllDirty();\n                    parent.invalidateVolume();\n                }\n            },\n\n            needLighting: function() {\n                var hasTris = this._mesh._primType.indexOf(\"TRIANGLE\") >= 0;\n                return (this._vf.lit && hasTris);\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### Mesh ### */\nx3dom.registerNodeType(\n    \"Mesh\",         // experimental WebSG geo node\n    \"Rendering\",\n    defineClass(x3dom.nodeTypes.X3DGeometryNode,\n        \n        /**\n         * Constructor for Mesh\n         * @constructs x3dom.nodeTypes.Mesh\n         * @x3d x.x\n         * @component Rendering\n         * @extends x3dom.nodeTypes.X3DGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc This is an experimental WebSG geo node\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Mesh.superClass.call(this, ctx);\n\n\n            /**\n             *\n             * @var {x3dom.fields.SFString} primType\n             * @memberof x3dom.nodeTypes.Mesh\n             * @initvalue \"triangle\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'primType', \"triangle\");\n\n            /**\n             *\n             * @var {x3dom.fields.MFInt32} index\n             * @memberof x3dom.nodeTypes.Mesh\n             * @initvalue []\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFInt32(ctx, 'index', []);\n\n\n            /**\n             *\n             * @var {x3dom.fields.MFNode} vertexAttributes\n             * @memberof x3dom.nodeTypes.Mesh\n             * @initvalue x3dom.nodeTypes.X3DVertexAttributeNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFNode('vertexAttributes', x3dom.nodeTypes.X3DVertexAttributeNode);\n        \n        },\n        {\n            nodeChanged: function()\n            {\n                var time0 = new Date().getTime();\n\n                var i, n = this._cf.vertexAttributes.nodes.length;\n\n                for (i=0; i<n; i++)\n                {\n                    var name = this._cf.vertexAttributes.nodes[i]._vf.name;\n\n                    switch (name.toLowerCase())\n                    {\n                        case \"position\":\n                            this._mesh._positions[0] = this._cf.vertexAttributes.nodes[i]._vf.value.toGL();\n                            break;\n                        case \"normal\":\n                            this._mesh._normals[0] = this._cf.vertexAttributes.nodes[i]._vf.value.toGL();\n                            break;\n                        case \"texcoord\":\n                            this._mesh._texCoords[0] = this._cf.vertexAttributes.nodes[i]._vf.value.toGL();\n                            break;\n                        case \"color\":\n                            this._mesh._colors[0] = this._cf.vertexAttributes.nodes[i]._vf.value.toGL();\n                            break;\n                        default:\n                            this._mesh._dynamicFields[name] = {};\n                            this._mesh._dynamicFields[name].numComponents =\n                                this._cf.vertexAttributes.nodes[i]._vf.numComponents;\n                            this._mesh._dynamicFields[name].value =\n                                this._cf.vertexAttributes.nodes[i]._vf.value.toGL();\n                            break;\n                    }\n                }\n\n                this._mesh._indices[0] = this._vf.index.toGL();\n\n                this.invalidateVolume();\n\n                this._mesh._numFaces = this._mesh._indices[0].length / 3;\n                this._mesh._numCoords = this._mesh._positions[0].length / 3;\n\n                var time1 = new Date().getTime() - time0;\n                x3dom.debug.logWarning(\"Mesh load time: \" + time1 + \" ms\");\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### PointSet ### */\nx3dom.registerNodeType(\n    \"PointSet\",\n    \"Rendering\",\n    defineClass(x3dom.nodeTypes.X3DGeometryNode,\n        \n        /**\n         * Constructor for PointSet\n         * @constructs x3dom.nodeTypes.PointSet\n         * @x3d 3.3\n         * @component Rendering\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc PointSet is a node that contains a set of colored 3D points, represented by contained Color and Coordinate nodes.\n         * Color values or a Material emissiveColor is used to draw lines and points. Hint: use a different color (or emissiveColor) than the background color.\n         * Hint: insert a Shape node before adding geometry or Appearance. You can also substitute a type-matched ProtoInstance for content.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.PointSet.superClass.call(this, ctx);\n\n\n            /**\n             * Coordinate node specifiying the vertices used by the geometry.\n             * @var {x3dom.fields.SFNode} coord\n             * @memberof x3dom.nodeTypes.PointSet\n             * @initvalue x3dom.nodeTypes.X3DCoordinateNode\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFNode('coord', x3dom.nodeTypes.X3DCoordinateNode);\n\n            /**\n             * If NULL the geometry is rendered using the Material and texture defined in the Appearance node.\n             * If not NULL the field shall contain a Color node whose colours are applied depending on the value of \"colorPerVertex\".\n             * @var {x3dom.fields.SFNode} color\n             * @memberof x3dom.nodeTypes.PointSet\n             * @initvalue x3dom.nodeTypes.X3DColorNode\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFNode('color', x3dom.nodeTypes.X3DColorNode);\n\n            this._mesh._primType = 'POINTS';\n        \n        },\n        {\n            nodeChanged: function()\n            {\n                var time0 = new Date().getTime();\n\n                var coordNode = this._cf.coord.node;\n                x3dom.debug.assert(coordNode, \"PointSet without coord node!\");\n                var positions = coordNode.getPoints();\n\n                var numColComponents = 3;\n                var colorNode = this._cf.color.node;\n                var colors = new x3dom.fields.MFColor();\n                if (colorNode) {\n                    colors = colorNode._vf.color;\n                    x3dom.debug.assert(positions.length == colors.length, \"Size of color and coord array differs!\");\n\n                    if (x3dom.isa(colorNode, x3dom.nodeTypes.ColorRGBA)) {\n                        numColComponents = 4;\n                    }\n                }\n\n                this._mesh._numColComponents = numColComponents;\n                this._mesh._lit = false;\n\n                this._mesh._indices[0] = [];\n                this._mesh._positions[0] = positions.toGL();\n                this._mesh._colors[0] = colors.toGL();\n                this._mesh._normals[0] = [];\n                this._mesh._texCoords[0] = [];\n\n                this.invalidateVolume();\n                this._mesh._numCoords = this._mesh._positions[0].length / 3;\n\n                var time1 = new Date().getTime() - time0;\n                //x3dom.debug.logInfo(\"Mesh load time: \" + time1 + \" ms\");\n            },\n\n            fieldChanged: function(fieldName)\n            {\n                var pnts = null;\n\n                if (fieldName == \"coord\")\n                {\n                    pnts = this._cf.coord.node.getPoints();\n\n                    this._mesh._positions[0] = pnts.toGL();\n\n                    this.invalidateVolume();\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.positions = true;\n                        node.invalidateVolume();\n                    });\n                }\n                else if (fieldName == \"color\")\n                {\n                    pnts = this._cf.color.node._vf.color;\n\n                    this._mesh._colors[0] = pnts.toGL();\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.colors = true;\n                    });\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### X3DComposedGeometryNode ### */\nx3dom.registerNodeType(\n    \"X3DComposedGeometryNode\",\n    \"Rendering\",\n    defineClass(x3dom.nodeTypes.X3DGeometryNode,\n        \n        /**\n         * Constructor for X3DComposedGeometryNode\n         * @constructs x3dom.nodeTypes.X3DComposedGeometryNode\n         * @x3d 3.3\n         * @component Rendering\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc This is the base node type for all composed 3D geometry in X3D.\n         * A composed geometry node type defines an abstract type that composes geometry from a set of nodes that define individual components.\n         * Composed geometry may have color, coordinates, normal and texture coordinates supplied.\n         * The rendered output of the combination of these is dependent on the concrete node definition.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DComposedGeometryNode.superClass.call(this, ctx);\n\n\n            /**\n             * If colorPerVertex is FALSE, colours are applied to each face. If colorPerVertex is true, colours are applied to each vertex.\n             * @var {x3dom.fields.SFBool} colorPerVertex\n             * @memberof x3dom.nodeTypes.X3DComposedGeometryNode\n             * @initvalue true\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'colorPerVertex', true);\n\n            /**\n             * If normalPerVertex is FALSE, normals are applied to each face. If normalPerVertex is true, normals are applied to each vertex.\n             * @var {x3dom.fields.SFBool} normalPerVertex\n             * @memberof x3dom.nodeTypes.X3DComposedGeometryNode\n             * @initvalue true\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'normalPerVertex', true);\n\n            /**\n             *\n             * @var {x3dom.fields.SFString} normalUpdateMode\n             * @memberof x3dom.nodeTypes.X3DComposedGeometryNode\n             * @initvalue 'fast'\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'normalUpdateMode', 'fast');  // none; fast; nice\n\n\n            /**\n             * If the attrib field is not empty it shall contain a list of per-vertex attribute information for programmable shaders.\n             * @var {x3dom.fields.MFNode} attrib\n             * @memberof x3dom.nodeTypes.X3DComposedGeometryNode\n             * @initvalue x3dom.nodeTypes.X3DVertexAttributeNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFNode('attrib', x3dom.nodeTypes.X3DVertexAttributeNode);\n\n\n            /**\n             * Contains a Coordinate node.\n             * @var {x3dom.fields.SFNode} coord\n             * @memberof x3dom.nodeTypes.X3DComposedGeometryNode\n             * @initvalue x3dom.nodeTypes.X3DCoordinateNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('coord', x3dom.nodeTypes.X3DCoordinateNode);\n\n            /**\n             * If the normal field is not NULL, it shall contain a Normal node whose normals are applied to the vertices or faces of the X3DComposedGeometryNode in a manner exactly equivalent to that described above for applying colours to vertices/faces (where normalPerVertex corresponds to colorPerVertex and normalIndex corresponds to colorIndex).\n             * If the normal field is NULL, the browser shall automatically generate normals in accordance with the node's definition. If the node does not define a behaviour, the default is to generate an averaged normal for all faces that share that vertex.\n             * @var {x3dom.fields.SFNode} normal\n             * @memberof x3dom.nodeTypes.X3DComposedGeometryNode\n             * @initvalue x3dom.nodeTypes.Normal\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('normal', x3dom.nodeTypes.Normal);\n\n            /**\n             * If the color field is NULL, the geometry shall be rendered normally using the Material and texture defined in the Appearance node.\n             * @var {x3dom.fields.SFNode} color\n             * @memberof x3dom.nodeTypes.X3DComposedGeometryNode\n             * @initvalue x3dom.nodeTypes.X3DColorNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('color', x3dom.nodeTypes.X3DColorNode);\n\n            /**\n             * If the texCoord field is not NULL, it shall contain a TextureCoordinate node.\n             * @var {x3dom.fields.SFNode} texCoord\n             * @memberof x3dom.nodeTypes.X3DComposedGeometryNode\n             * @initvalue x3dom.nodeTypes.X3DTextureCoordinateNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('texCoord', x3dom.nodeTypes.X3DTextureCoordinateNode);\n        \n        },\n        {\n            handleAttribs: function()\n            {\n                //var time0 = new Date().getTime();\n\n                // TODO; handle case that more than 2^16-1 attributes are to be referenced\n                var i, n = this._cf.attrib.nodes.length;\n\n                for (i=0; i<n; i++)\n                {\n                    var name = this._cf.attrib.nodes[i]._vf.name;\n\n                    switch (name.toLowerCase())\n                    {\n                        case \"position\":\n                            this._mesh._positions[0] = this._cf.attrib.nodes[i]._vf.value.toGL();\n                            break;\n                        case \"normal\":\n                            this._mesh._normals[0] = this._cf.attrib.nodes[i]._vf.value.toGL();\n                            break;\n                        case \"texcoord\":\n                            this._mesh._texCoords[0] = this._cf.attrib.nodes[i]._vf.value.toGL();\n                            break;\n                        case \"color\":\n                            this._mesh._colors[0] = this._cf.attrib.nodes[i]._vf.value.toGL();\n                            break;\n                        default:\n                            this._mesh._dynamicFields[name] = {};\n                            this._mesh._dynamicFields[name].numComponents =\n                                this._cf.attrib.nodes[i]._vf.numComponents;\n                            this._mesh._dynamicFields[name].value =\n                                this._cf.attrib.nodes[i]._vf.value.toGL();\n                            break;\n                    }\n                }\n\n                //var time1 = new Date().getTime() - time0;\n                //x3dom.debug.logInfo(\"Mesh load time: \" + time1 + \" ms\");\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### LineSet ### */\nx3dom.registerNodeType(\n    \"LineSet\",\n    \"Rendering\",\n    defineClass(x3dom.nodeTypes.X3DGeometryNode,\n        \n        /**\n         * Constructor for LineSet\n         * @constructs x3dom.nodeTypes.LineSet\n         * @x3d 3.3\n         * @component Rendering\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc LineSet is a geometry node that can contain a Color node and a Coordinate node.\n         * Color values or a Material emissiveColor is used to draw lines and points.\n         * Lines are not lit, are not texture-mapped, and do not participate in collision detection.\n         * Hint: use a different color (or emissiveColor) than the background color.\n         * Hint: if rendering Coordinate points originally defined for an IndexedFaceSet, index values may need to repeat each initial vertex to close each polygon outline.\n         * Hint: insert a Shape node before adding geometry or Appearance.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.LineSet.superClass.call(this, ctx);\n\n\n            /**\n             * vertexCount describes how many vertices are used in each polyline from Coordinate field. Coordinates are assigned to each line by taking vertexCount[n] vertices from Coordinate field.\n             * @var {x3dom.fields.MFInt32} vertexCount\n             * @range [2, inf]\n             * @memberof x3dom.nodeTypes.LineSet\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFInt32(ctx, 'vertexCount', []);\n\n\n            /**\n             * If the \"attrib\" field is not empty it shall contain a list of per-vertex attribute information for programmable shaders\n             * @var {x3dom.fields.MFNode} attrib\n             * @memberof x3dom.nodeTypes.LineSet\n             * @initvalue x3dom.nodeTypes.X3DVertexAttributeNode\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFNode('attrib', x3dom.nodeTypes.X3DVertexAttributeNode);\n\n            /**\n             * Coordinate node specifiying the vertices used by the geometry.\n             * @var {x3dom.fields.SFNode} coord\n             * @memberof x3dom.nodeTypes.LineSet\n             * @initvalue x3dom.nodeTypes.X3DCoordinateNode\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFNode('coord', x3dom.nodeTypes.X3DCoordinateNode);\n\n            /**\n             * If NULL the geometry is rendered using the Material and texture defined in the Appearance node. If not NULL the field shall contain a Color node whose colours are applied depending on the value of \"colorPerVertex\".\n             * @var {x3dom.fields.SFNode} color\n             * @memberof x3dom.nodeTypes.LineSet\n             * @initvalue x3dom.nodeTypes.X3DColorNode\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFNode('color', x3dom.nodeTypes.X3DColorNode);\n\n            this._mesh._primType = \"LINES\";\n            x3dom.Utils.needLineWidth = true;\n        \n        },\n        {\n            nodeChanged: function() {\n                var coordNode = this._cf.coord.node;\n                x3dom.debug.assert(coordNode);\n                var positions = coordNode.getPoints();\n\n                this._mesh._positions[0] = positions.toGL();\n\n                var colorNode = this._cf.color.node;\n                if (colorNode) {\n                    var colors = colorNode._vf.color;\n\n                    this._mesh._colors[0] = colors.toGL();\n\n                    this._mesh._numColComponents = 3;\n                    if (x3dom.isa(colorNode, x3dom.nodeTypes.ColorRGBA)) {\n                        this._mesh._numColComponents = 4;\n                    }\n                }\n\n                var cnt = 0;\n                this._mesh._indices[0] = [];\n\n                for (var i=0, n=this._vf.vertexCount.length; i<n; i++) {\n                    var vc = this._vf.vertexCount[i];\n                    if (vc < 2) {\n                        x3dom.debug.logError(\"LineSet.vertexCount must not be smaller than 2!\");\n                        break;\n                    }\n                    for (var j=vc-2; j>=0; j--) {\n                        this._mesh._indices[0].push(cnt++, cnt);\n                        if (j == 0) cnt++;\n                    }\n                }\n            },\n\n            fieldChanged: function(fieldName) {\n                if (fieldName == \"coord\") {\n                    var pnts = this._cf.coord.node.getPoints();\n                    this._mesh._positions[0] = pnts.toGL();\n\n                    this.invalidateVolume();\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.positions = true;\n                        node.invalidateVolume();\n                    });\n                }\n                else if (fieldName == \"color\") {\n                    var cols = this._cf.color.node._vf.color;\n                    this._mesh._colors[0] = cols.toGL();\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.colors = true;\n                    });\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### IndexedLineSet ### */\nx3dom.registerNodeType(\n    \"IndexedLineSet\",\n    \"Rendering\",\n    defineClass(x3dom.nodeTypes.X3DGeometryNode,\n        \n        /**\n         * Constructor for IndexedLineSet\n         * @constructs x3dom.nodeTypes.IndexedLineSet\n         * @x3d 3.3\n         * @component Rendering\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc IndexedLineSet is a geometry node that can contain a Color node and a Coordinate node.\n         * Color values or a Material emissiveColor is used to draw lines and points. Lines are not lit, are not texture-mapped, and do not participate in collision detection.\n         * Hint: use a different color (or emissiveColor) than the background color.\n         * Hint: if rendering Coordinate points originally defined for an IndexedFaceSet, index values may need to repeat each initial vertex to close each polygon outline.\n         * Hint: insert a Shape node before adding geometry or Appearance. You can also substitute a type-matched ProtoInstance for content.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.IndexedLineSet.superClass.call(this, ctx);\n\n\n            /**\n             * Whether Color node is applied per vertex (true) or per polygon (false).\n             * @var {x3dom.fields.SFBool} colorPerVertex\n             * @memberof x3dom.nodeTypes.IndexedLineSet\n             * @initvalue true\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'colorPerVertex', true);  // TODO\n\n\n            /**\n             * If the \"attrib\" field is not empty it shall contain a list of per-vertex attribute information for programmable shaders\n             * @var {x3dom.fields.MFNode} attrib\n             * @memberof x3dom.nodeTypes.IndexedLineSet\n             * @initvalue x3dom.nodeTypes.X3DVertexAttributeNode\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFNode('attrib', x3dom.nodeTypes.X3DVertexAttributeNode);\n\n            /**\n             * Coordinate node specifiying the vertices used by the geometry.\n             * @var {x3dom.fields.SFNode} coord\n             * @memberof x3dom.nodeTypes.IndexedLineSet\n             * @initvalue x3dom.nodeTypes.X3DCoordinateNode\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFNode('coord', x3dom.nodeTypes.X3DCoordinateNode);\n\n            /**\n             * If NULL the geometry is rendered using the Material and texture defined in the Appearance node. If not NULL the field shall contain a Color node whose colours are applied depending on the value of \"colorPerVertex\".\n             * @var {x3dom.fields.SFNode} color\n             * @memberof x3dom.nodeTypes.IndexedLineSet\n             * @initvalue x3dom.nodeTypes.X3DColorNode\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFNode('color', x3dom.nodeTypes.X3DColorNode);\n\n\n            /**\n             * coordIndex indices provide order in which coordinates are applied.\n             * Order starts at index 0, commas are optional between sets, use -1 to separate indices for each polyline.\n             * Hint: if rendering Coordinate points originally defined for an IndexedFaceSet, index values may need to repeat initial each initial vertex to close the polygons.\n             * @var {x3dom.fields.MFInt32} coordIndex\n             * @range [0, inf] or -1\n             * @memberof x3dom.nodeTypes.IndexedLineSet\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFInt32(ctx, 'coordIndex', []);\n\n            /**\n             * colorIndex indices provide order in which colors are applied.\n             * Hint: if rendering Coordinate points originally defined for an IndexedFaceSet, index values may need to repeat initial each initial vertex to close the polygons.\n             * @var {x3dom.fields.MFInt32} colorIndex\n             * @range [0, inf] or -1\n             * @memberof x3dom.nodeTypes.IndexedLineSet\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFInt32(ctx, 'colorIndex', []);\n\n            this._mesh._primType = 'LINES';\n            x3dom.Utils.needLineWidth = true;\n        \n        },\n        {\n\n            _buildGeometry: function ()\n            {\n                var time0 = new Date().getTime();\n\n                // this.handleAttribs();\n\n                var indexes = this._vf.coordIndex;\n                var colorInd = this._vf.colorIndex;\n\n                var hasColor = false, hasColorInd = false;\n\n                // TODO; implement colorPerVertex also for single index\n                var colPerVert = this._vf.colorPerVertex;\n\n                if (colorInd.length == indexes.length)\n                {\n                    hasColorInd = true;\n                }\n\n                var positions, colors;\n\n                var coordNode = this._cf.coord.node;\n                x3dom.debug.assert(coordNode);\n\n                positions = coordNode.getPoints();\n\n                var numColComponents = 3;\n                var colorNode = this._cf.color.node;\n                if (colorNode)\n                {\n                    hasColor = true;\n                    colors = colorNode._vf.color;\n\n                    if (x3dom.isa(colorNode, x3dom.nodeTypes.ColorRGBA)) {\n                        numColComponents = 4;\n                    }\n                }\n                else {\n                    hasColor = false;\n                }\n\n                this._mesh._indices[0] = [];\n                this._mesh._positions[0] = [];\n                this._mesh._colors[0] = [];\n\n                var i, t, cnt, lineCnt;\n                var p0, p1, c0, c1;\n                \n                // Found MultiIndex Mesh OR LineSet with too many vertices for 16 bit\n                if ( (hasColor && hasColorInd) || positions.length > x3dom.Utils.maxIndexableCoords )\n                {\n                    t = 0;\n                    cnt = 0;\n                    lineCnt = 0;\n\n                    for (i=0; i < indexes.length; ++i)\n                    {\n                        //Ignore out of Range Indices\n                        if(indexes[i] > positions.length-1)\n                        {\n                            continue;\n                        }\n\n                        if (indexes[i] === -1) {\n                            t = 0;\n                            continue;\n                        }\n\n                        if (hasColorInd) {\n                            x3dom.debug.assert(colorInd[i] != -1);\n                        }\n\n                        switch (t)\n                        {\n                            case 0:\n                                p0 = +indexes[i];\n                                if (hasColorInd && colPerVert) { c0 = +colorInd[i]; }\n                                else { c0 = p0; }\n                                t = 1;\n                                break;\n                            case 1:\n                                p1 = +indexes[i];\n                                if (hasColorInd && colPerVert) { c1 = +colorInd[i]; }\n                                else if (hasColorInd && !colPerVert) { c1 = +colorInd[lineCnt]; }\n                                else { c1 = p1; }\n\n                                this._mesh._indices[0].push(cnt++, cnt++);\n\n                                this._mesh._positions[0].push(positions[p0].x);\n                                this._mesh._positions[0].push(positions[p0].y);\n                                this._mesh._positions[0].push(positions[p0].z);\n                                this._mesh._positions[0].push(positions[p1].x);\n                                this._mesh._positions[0].push(positions[p1].y);\n                                this._mesh._positions[0].push(positions[p1].z);\n\n                                if (hasColor) {\n                                    if (!colPerVert) {\n                                        c0 = c1;\n                                    }\n                                    this._mesh._colors[0].push(colors[c0].r);\n                                    this._mesh._colors[0].push(colors[c0].g);\n                                    this._mesh._colors[0].push(colors[c0].b);\n                                    this._mesh._colors[0].push(colors[c1].r);\n                                    this._mesh._colors[0].push(colors[c1].g);\n                                    this._mesh._colors[0].push(colors[c1].b);\n                                }\n\n                                t = 2;\n                                lineCnt++;\n                                break;\n                            case 2:\n                                p0 = p1;\n                                c0 = c1;\n                                p1 = +indexes[i];\n                                if (hasColorInd && colPerVert) { c1 = +colorInd[i]; }\n                                else if (hasColorInd && !colPerVert) { c1 = +colorInd[lineCnt]; }\n                                else { c1 = p1; }\n\n                                this._mesh._indices[0].push(cnt++, cnt++);\n\n                                this._mesh._positions[0].push(positions[p0].x);\n                                this._mesh._positions[0].push(positions[p0].y);\n                                this._mesh._positions[0].push(positions[p0].z);\n                                this._mesh._positions[0].push(positions[p1].x);\n                                this._mesh._positions[0].push(positions[p1].y);\n                                this._mesh._positions[0].push(positions[p1].z);\n\n                                if (hasColor) {\n                                    if (!colPerVert) {\n                                        c0 = c1;\n                                    }\n                                    this._mesh._colors[0].push(colors[c0].r);\n                                    this._mesh._colors[0].push(colors[c0].g);\n                                    this._mesh._colors[0].push(colors[c0].b);\n                                    this._mesh._colors[0].push(colors[c1].r);\n                                    this._mesh._colors[0].push(colors[c1].g);\n                                    this._mesh._colors[0].push(colors[c1].b);\n                                }\n\n                                lineCnt++;\n                                break;\n                            default:\n                        }\n                    }\n\n                    //if the LineSet is too large for 16 bit indices, split it!\n                    if (positions.length > x3dom.Utils.maxIndexableCoords)\n                        this._mesh.splitMesh(2);\n                } // if isMulti\n                else\n                {\n                    var n = indexes.length;\n                    t = 0;\n\n                    for (i=0; i < n; ++i)\n                    {\n                        if (indexes[i] == -1) {\n                            t = 0;\n                            continue;\n                        }\n\n                        switch (t) {\n                            case 0: p0 = +indexes[i]; t = 1; break;\n                            case 1: p1 = +indexes[i]; t = 2; this._mesh._indices[0].push(p0, p1); break;\n                            case 2: p0 = p1; p1 = +indexes[i]; this._mesh._indices[0].push(p0, p1); break;\n                        }\n                    }\n\n                    this._mesh._positions[0] = positions.toGL();\n\n                    if (hasColor) {\n                        this._mesh._colors[0] = colors.toGL();\n                        this._mesh._numColComponents = numColComponents;\n                    }\n                }\n\n                this.invalidateVolume();\n                this._mesh._numCoords = 0;\n\n                for (i=0; i<this._mesh._indices.length; i++) {\n                    this._mesh._numCoords += this._mesh._positions[i].length / 3;\n                }\n\n                var time1 = new Date().getTime() - time0;\n                //x3dom.debug.logInfo(\"Mesh load time: \" + time1 + \" ms\");\n            },\n\n            nodeChanged: function()\n            {\n                this._buildGeometry();\n            },\n\n            fieldChanged: function(fieldName)\n            {\n                var pnts = null;\n\n                if (fieldName == \"coord\")\n                {\n                    this._buildGeometry();\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.positions = true;\n                        node.invalidateVolume();\n                    });\n                }\n                else if (fieldName == \"color\")\n                {\n                    this._buildGeometry();\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.colors = true;\n                    });\n                }\n                else if (fieldName == \"coordIndex\") {\n                    this._buildGeometry();\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.indexes = true;\n                        node.invalidateVolume();\n                    });\n                }\n                else if (fieldName == \"colorIndex\") {\n                    this._buildGeometry();\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.colors = true;\n                        node.invalidateVolume();\n                    });\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### IndexedTriangleSet ### */\nx3dom.registerNodeType(\n    \"IndexedTriangleSet\",\n    \"Rendering\",\n    defineClass(x3dom.nodeTypes.X3DComposedGeometryNode,\n        \n        /**\n         * Constructor for IndexedTriangleSet\n         * @constructs x3dom.nodeTypes.IndexedTriangleSet\n         * @x3d 3.3\n         * @component Rendering\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DComposedGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc IndexedTriangleSet is a geometry node that can contain a Color, Coordinate, Normal and TextureCoordinate node.\n         * Hint: insert a Shape node before adding geometry or Appearance.\n         * You can also substitute a type-matched ProtoInstance for content.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.IndexedTriangleSet.superClass.call(this, ctx);\n\n\n            /**\n             * index specifies triangles by connecting Coordinate vertices.\n             * @var {x3dom.fields.MFInt32} index\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.IndexedTriangleSet\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFInt32(ctx, 'index', []);\n        \n        },\n        {\n            nodeChanged: function()\n            {\n                var time0 = new Date().getTime();\n\n                this.handleAttribs();\n\n                var colPerVert  = this._vf.colorPerVertex;\n                var normPerVert = this._vf.normalPerVertex;\n                var ccw = this._vf.ccw;\n\n                var indexes = this._vf.index;\n\n                var hasNormal = false, hasTexCoord = false, hasColor = false;\n                var positions, normals, texCoords, colors;\n\n                var coordNode = this._cf.coord.node;\n                x3dom.debug.assert(coordNode);\n                positions = coordNode._vf.point;\n\n                var normalNode = this._cf.normal.node;\n                if (normalNode) {\n                    hasNormal = true;\n                    normals = normalNode._vf.vector;\n                }\n                else {\n                    hasNormal = false;\n                }\n\n                var texMode = \"\", numTexComponents = 2;\n                var texCoordNode = this._cf.texCoord.node;\n                if (x3dom.isa(texCoordNode, x3dom.nodeTypes.MultiTextureCoordinate)) {\n                    if (texCoordNode._cf.texCoord.nodes.length)\n                        texCoordNode = texCoordNode._cf.texCoord.nodes[0];\n                }\n                if (texCoordNode) {\n                    if (texCoordNode._vf.point) {\n                        hasTexCoord = true;\n                        texCoords = texCoordNode._vf.point;\n\n                        if (x3dom.isa(texCoordNode, x3dom.nodeTypes.TextureCoordinate3D)) {\n                            numTexComponents = 3;\n                        }\n                    }\n                    else if (texCoordNode._vf.mode) {\n                        texMode = texCoordNode._vf.mode;\n                    }\n                }\n                else {\n                    hasTexCoord = false;\n                }\n\n                var numColComponents = 3;\n                var colorNode = this._cf.color.node;\n                if (colorNode) {\n                    hasColor = true;\n                    colors = colorNode._vf.color;\n\n                    if (x3dom.isa(colorNode, x3dom.nodeTypes.ColorRGBA)) {\n                        numColComponents = 4;\n                    }\n                }\n                else {\n                    hasColor = false;\n                }\n\n                this._mesh._indices[0] = [];\n                this._mesh._positions[0] = [];\n                this._mesh._normals[0] = [];\n                this._mesh._texCoords[0] = [];\n                this._mesh._colors[0] = [];\n\n                var i, t, cnt, faceCnt, posMax;\n                var p0, p1, p2, n0, n1, n2, t0, t1, t2, c0, c1, c2;\n\n                // if positions array too short add degenerate triangle\n                while (positions.length % 3 > 0) {\n                    positions.push(positions.length-1);\n                }\n                posMax = positions.length;\n\n                //resolve indices, if necessary\n                if (!normPerVert || !colPerVert || posMax > x3dom.Utils.maxIndexableCoords)\n                {\n                    t = 0;\n                    cnt = 0;\n                    faceCnt = 0;\n                    this._mesh._multiIndIndices = [];\n                    this._mesh._posSize = positions.length;\n\n                    for (i=0; i < indexes.length; ++i)\n                    {\n                        // Convert non-triangular polygons to a triangle fan\n                        // (TODO: this assumes polygons are convex)\n\n                        if ((i > 0) && (i % 3 === 0 )) {\n                            t = 0;\n                            faceCnt++;\n                        }\n\n                        //TODO: OPTIMIZE but think about cache coherence regarding arrays!!!\n                        switch (t)\n                        {\n                            case 0:\n                                p0 = +indexes[i];\n                                if (normPerVert) {\n                                    n0 = p0;\n                                } else if (!normPerVert) {\n                                    n0 = faceCnt;\n                                }\n                                t0 = p0;\n                                if (colPerVert) {\n                                    c0 = p0;\n                                } else if (!colPerVert) {\n                                    c0 = faceCnt;\n                                }\n                                t = 1;\n                                break;\n                            case 1:\n                                p1 = +indexes[i];\n                                if (normPerVert) {\n                                    n1 = p1;\n                                } else if (!normPerVert) {\n                                    n1 = faceCnt;\n                                }\n                                t1 = p1;\n                                if (colPerVert) {\n                                    c1 = p1;\n                                } else if (!colPerVert) {\n                                    c1 = faceCnt;\n                                }\n                                t = 2;\n                                break;\n                            case 2:\n                                p2 = +indexes[i];\n                                if (normPerVert) {\n                                    n2 = p2;\n                                } else if (!normPerVert) {\n                                    n2 = faceCnt;\n                                }\n                                t2 = p2;\n                                if (colPerVert) {\n                                    c2 = p2;\n                                } else if (!colPerVert) {\n                                    c2 = faceCnt;\n                                }\n                                t = 3;\n\n                                this._mesh._indices[0].push(cnt++, cnt++, cnt++);\n\n                                this._mesh._positions[0].push(positions[p0].x);\n                                this._mesh._positions[0].push(positions[p0].y);\n                                this._mesh._positions[0].push(positions[p0].z);\n                                this._mesh._positions[0].push(positions[p1].x);\n                                this._mesh._positions[0].push(positions[p1].y);\n                                this._mesh._positions[0].push(positions[p1].z);\n                                this._mesh._positions[0].push(positions[p2].x);\n                                this._mesh._positions[0].push(positions[p2].y);\n                                this._mesh._positions[0].push(positions[p2].z);\n\n                                if (hasNormal) {\n                                    this._mesh._normals[0].push(normals[n0].x);\n                                    this._mesh._normals[0].push(normals[n0].y);\n                                    this._mesh._normals[0].push(normals[n0].z);\n                                    this._mesh._normals[0].push(normals[n1].x);\n                                    this._mesh._normals[0].push(normals[n1].y);\n                                    this._mesh._normals[0].push(normals[n1].z);\n                                    this._mesh._normals[0].push(normals[n2].x);\n                                    this._mesh._normals[0].push(normals[n2].y);\n                                    this._mesh._normals[0].push(normals[n2].z);\n                                }\n                                else {\n                                    this._mesh._multiIndIndices.push(p0, p1, p2);\n                                    //this._mesh._multiIndIndices.push(cnt-3, cnt-2, cnt-1);\n                                }\n\n                                if (hasColor) {\n                                    this._mesh._colors[0].push(colors[c0].r);\n                                    this._mesh._colors[0].push(colors[c0].g);\n                                    this._mesh._colors[0].push(colors[c0].b);\n                                    if (numColComponents === 4) {\n                                        this._mesh._colors[0].push(colors[c0].a);\n                                    }\n                                    this._mesh._colors[0].push(colors[c1].r);\n                                    this._mesh._colors[0].push(colors[c1].g);\n                                    this._mesh._colors[0].push(colors[c1].b);\n                                    if (numColComponents === 4) {\n                                        this._mesh._colors[0].push(colors[c1].a);\n                                    }\n                                    this._mesh._colors[0].push(colors[c2].r);\n                                    this._mesh._colors[0].push(colors[c2].g);\n                                    this._mesh._colors[0].push(colors[c2].b);\n                                    if (numColComponents === 4) {\n                                        this._mesh._colors[0].push(colors[c2].a);\n                                    }\n                                }\n\n                                if (hasTexCoord) {\n                                    this._mesh._texCoords[0].push(texCoords[t0].x);\n                                    this._mesh._texCoords[0].push(texCoords[t0].y);\n                                    if (numTexComponents === 3) {\n                                        this._mesh._texCoords[0].push(texCoords[t0].z);\n                                    }\n                                    this._mesh._texCoords[0].push(texCoords[t1].x);\n                                    this._mesh._texCoords[0].push(texCoords[t1].y);\n                                    if (numTexComponents === 3) {\n                                        this._mesh._texCoords[0].push(texCoords[t1].z);\n                                    }\n                                    this._mesh._texCoords[0].push(texCoords[t2].x);\n                                    this._mesh._texCoords[0].push(texCoords[t2].y);\n                                    if (numTexComponents === 3) {\n                                        this._mesh._texCoords[0].push(texCoords[t2].z);\n                                    }\n                                }\n\n                                //faceCnt++;\n                                break;\n                            default:\n                        }\n                    }\n\n                    if (!hasNormal) {\n                        this._mesh.calcNormals(normPerVert ? Math.PI : 0);\n                        //normalsPerFace case needs testing\n                        //this._mesh.calcNormals(normPerVert ? Math.PI : 0, ccw);\n                    }\n                    if (!hasTexCoord) {\n                        this._mesh.calcTexCoords(texMode);\n                    }\n\n                    this._mesh.splitMesh();\n\n                    //x3dom.debug.logInfo(this._mesh._indices.length);\n                } // if isMulti\n                else\n                {\n                    faceCnt = 0;\n                    for (i=0; i<indexes.length; i++)\n                    {\n                        if ((i > 0) && (i % 3 === 0 )) {\n                            faceCnt++;\n                        }\n\n                        this._mesh._indices[0].push(indexes[i]);\n\n                        if(!normPerVert && hasNormal) {\n                            this._mesh._normals[0].push(normals[faceCnt].x);\n                            this._mesh._normals[0].push(normals[faceCnt].y);\n                            this._mesh._normals[0].push(normals[faceCnt].z);\n                        }\n                        if(!colPerVert && hasColor) {\n                            this._mesh._colors[0].push(colors[faceCnt].r);\n                            this._mesh._colors[0].push(colors[faceCnt].g);\n                            this._mesh._colors[0].push(colors[faceCnt].b);\n                            if (numColComponents === 4) {\n                                this._mesh._colors[0].push(colors[faceCnt].a);\n                            }\n                        }\n                    }\n\n                    this._mesh._positions[0] = positions.toGL();\n\n                    if (hasNormal) {\n                        this._mesh._normals[0] = normals.toGL();\n                    }\n                    else {\n                        this._mesh.calcNormals(normPerVert ? Math.PI : 0, ccw);\n                    }\n\n                    if (hasTexCoord) {\n                        this._mesh._texCoords[0] = texCoords.toGL();\n                        this._mesh._numTexComponents = numTexComponents;\n                    }\n                    else {\n                        this._mesh.calcTexCoords(texMode);\n                    }\n\n                    if (hasColor && colPerVert) {\n                        this._mesh._colors[0] = colors.toGL();\n                        this._mesh._numColComponents = numColComponents;\n                    }\n                }\n\n                this.invalidateVolume();\n\n                this._mesh._numFaces = 0;\n                this._mesh._numCoords = 0;\n                for (i=0; i<this._mesh._indices.length; i++) {\n                    this._mesh._numFaces += this._mesh._indices[i].length / 3;\n                    this._mesh._numCoords += this._mesh._positions[i].length / 3;\n                }\n\n                var time1 = new Date().getTime() - time0;\n                //x3dom.debug.logInfo(\"Mesh load time: \" + time1 + \" ms\");\n            },\n\n            fieldChanged: function(fieldName)\n            {\n                var pnts = this._cf.coord.node._vf.point;\n\n                if ( pnts.length > x3dom.Utils.maxIndexableCoords )  // are there other problematic cases?\n                {\n                    // TODO; implement\n                    x3dom.debug.logWarning(\"IndexedTriangleSet: fieldChanged with \" +\n                        \"too many coordinates not yet implemented!\");\n                    return;\n                }\n\n                if (fieldName == \"coord\")\n                {\n                    this._mesh._positions[0] = pnts.toGL();\n\n                    // tells the mesh that its bbox requires update\n                    this.invalidateVolume();\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.positions = true;\n                        node.invalidateVolume();\n                    });\n                }\n                else if (fieldName == \"color\")\n                {\n                    pnts = this._cf.color.node._vf.color;\n\n                    if (this._vf.colorPerVertex) {\n\n                        this._mesh._colors[0] = pnts.toGL();\n\n                    } else if (!this._vf.colorPerVertex) {\n\n                        var faceCnt = 0;\n                        var numColComponents = 3;\n                        if (x3dom.isa(this._cf.color.node, x3dom.nodeTypes.ColorRGBA)) {\n                            numColComponents = 4;\n                        }\n\n                        this._mesh._colors[0] = [];\n\n                        var indexes = this._vf.index;\n                        for (var i=0; i < indexes.length; ++i)\n                        {\n                            if ((i > 0) && (i % 3 === 0 )) {\n                                faceCnt++;\n                            }\n\n                            this._mesh._colors[0].push(pnts[faceCnt].r);\n                            this._mesh._colors[0].push(pnts[faceCnt].g);\n                            this._mesh._colors[0].push(pnts[faceCnt].b);\n                            if (numColComponents === 4) {\n                                this._mesh._colors[0].push(pnts[faceCnt].a);\n                            }\n                        }\n                    }\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.colors = true;\n                    });\n                }\n                else if (fieldName == \"normal\")\n                {\n                    pnts = this._cf.normal.node._vf.vector;\n\n                    if (this._vf.normalPerVertex) {\n\n                        this._mesh._normals[0] = pnts.toGL();\n\n                    } else if (!this._vf.normalPerVertex) {\n\n                        var indexes = this._vf.index;\n                        this._mesh._normals[0] = [];\n\n                        var faceCnt = 0;\n                        for (var i=0; i < indexes.length; ++i)\n                        {\n                            if ((i > 0) && (i % 3 === 0 )) {\n                                faceCnt++;\n                            }\n\n                            this._mesh._normals[0].push(pnts[faceCnt].x);\n                            this._mesh._normals[0].push(pnts[faceCnt].y);\n                            this._mesh._normals[0].push(pnts[faceCnt].z);\n                        }\n                    }\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.normals = true;\n                    });\n                }\n                else if (fieldName == \"texCoord\")\n                {\n                    var texCoordNode = this._cf.texCoord.node;\n                    if (x3dom.isa(texCoordNode, x3dom.nodeTypes.MultiTextureCoordinate)) {\n                        if (texCoordNode._cf.texCoord.nodes.length)\n                            texCoordNode = texCoordNode._cf.texCoord.nodes[0];\n                    }\n                    pnts = texCoordNode._vf.point;\n\n                    this._mesh._texCoords[0] = pnts.toGL();\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.texcoords = true;\n                    });\n                }\n                // TODO: index\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### IndexedTriangleStripSet ### */\nx3dom.registerNodeType(\n    \"IndexedTriangleStripSet\",\n    \"Rendering\",\n    defineClass(x3dom.nodeTypes.X3DComposedGeometryNode,\n        \n        /**\n         * Constructor for IndexedTriangleStripSet\n         * @constructs x3dom.nodeTypes.IndexedTriangleStripSet\n         * @x3d 3.3\n         * @component Rendering\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DComposedGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc IndexedTriangleStripSet is a geometry node that can contain a Color, Coordinate, Normal and TextureCoordinate node.\n         * Hint: insert a Shape node before adding geometry or Appearance. You can also substitute a type-matched ProtoInstance for content.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.IndexedTriangleStripSet.superClass.call(this, ctx);\n\n\n            /**\n             * Index specifies triangles by connecting Coordinate vertices.\n             * @var {x3dom.fields.MFInt32} index\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.IndexedTriangleStripSet\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFInt32(ctx, 'index', []);\n\n            this._hasIndexOffset = false;\n            this._indexOffset = null;\n        \n        },\n        {\n            hasIndexOffset: function() {\n                return this._hasIndexOffset;\n            },\n\n            nodeChanged: function()\n            {\n                this.handleAttribs();   // check if method is still functional\n\n                var hasNormal = false, hasTexCoord = false, hasColor = false;\n\n                var colPerVert = this._vf.colorPerVertex;\n                var normPerVert = this._vf.normalPerVertex;\n\n                var indexes = this._vf.index;\n                //Last index value should be -1.\n                if (indexes.length && indexes[indexes.length-1] != -1)\n                {\n                    indexes.push(-1);\n                }\n                var positions, normals, texCoords, colors;\n\n                var coordNode = this._cf.coord.node;\n                x3dom.debug.assert(coordNode);\n                positions = coordNode._vf.point;\n\n                var normalNode = this._cf.normal.node;\n                if (normalNode) {\n                    hasNormal = true;\n                    normals = normalNode._vf.vector;\n                }\n                else {\n                    hasNormal = false;\n                }\n\n                var texMode = \"\", numTexComponents = 2;\n                var texCoordNode = this._cf.texCoord.node;\n                if (x3dom.isa(texCoordNode, x3dom.nodeTypes.MultiTextureCoordinate)) {\n                    if (texCoordNode._cf.texCoord.nodes.length)\n                        texCoordNode = texCoordNode._cf.texCoord.nodes[0];\n                }\n                if (texCoordNode) {\n                    if (texCoordNode._vf.point) {\n                        hasTexCoord = true;\n                        texCoords = texCoordNode._vf.point;\n\n                        if (x3dom.isa(texCoordNode, x3dom.nodeTypes.TextureCoordinate3D)) {\n                            numTexComponents = 3;\n                        }\n                    }\n                    else if (texCoordNode._vf.mode) {\n                        texMode = texCoordNode._vf.mode;\n                    }\n                }\n                else {\n                    hasTexCoord = false;\n                }\n                this._mesh._numTexComponents = numTexComponents;\n\n                var numColComponents = 3;\n                var colorNode = this._cf.color.node;\n                if (colorNode) {\n                    hasColor = true;\n                    colors = colorNode._vf.color;\n\n                    if (x3dom.isa(colorNode, x3dom.nodeTypes.ColorRGBA)) {\n                        numColComponents = 4;\n                    }\n                }\n                else {\n                    hasColor = false;\n                }\n                this._mesh._numColComponents = numColComponents;\n\n                this._mesh._indices[0] = [];\n                this._mesh._positions[0] = [];\n                this._mesh._normals[0] = [];\n                this._mesh._texCoords[0] = [];\n                this._mesh._colors[0] = [];\n\n                this.invalidateVolume();\n                this._mesh._numFaces = 0;\n                this._mesh._numCoords = 0;\n\n                var faceCnt = 0, cnt = 0;\n\n                if (hasNormal && positions.length <= x3dom.Utils.maxIndexableCoords)\n                {\n                    this._hasIndexOffset = true;\n                    this._indexOffset = [];\n                    this._mesh._primType = 'TRIANGLESTRIP';\n\n                    var i, indexOffset = [ 0 ];\n\n                    for (i=0; i<indexes.length; i++)\n                    {\n                        if (indexes[i] == -1) {\n                            faceCnt++;\n                            indexOffset.push(this._mesh._indices[0].length);\n                        }\n                        else {\n                            this._mesh._indices[0].push(+indexes[i]);\n\n                            if(!normPerVert) {\n                                this._mesh._normals[0].push(normals[faceCnt].x);\n                                this._mesh._normals[0].push(normals[faceCnt].y);\n                                this._mesh._normals[0].push(normals[faceCnt].z);\n                            }\n                            if(!colPerVert) {\n                                this._mesh._colors[0].push(colors[faceCnt].r);\n                                this._mesh._colors[0].push(colors[faceCnt].g);\n                                this._mesh._colors[0].push(colors[faceCnt].b);\n                                if (numColComponents === 4) {\n                                    this._mesh._colors[0].push(colors[faceCnt].a);\n                                }\n                            }\n                        }\n                    }\n\n                    this._mesh._positions[0] = positions.toGL();\n\n                    if(normPerVert) {\n                        this._mesh._normals[0] = normals.toGL();\n                    }\n\n                    if (hasTexCoord) {\n                        this._mesh._texCoords[0] = texCoords.toGL();\n                        this._mesh._numTexComponents = numTexComponents;\n                    }\n                    else {\n                        x3dom.debug.logWarning(\"IndexedTriangleStripSet: no texCoords given and won't calculate!\");\n                    }\n\n                    if (hasColor) {\n                        if(colPerVert) {\n                            this._mesh._colors[0] = colors.toGL();\n                        }\n                        this._mesh._numColComponents = numColComponents;\n                    }\n\n                    for (i=1; i<indexOffset.length; i++) {\n                        var triCnt = indexOffset[i] - indexOffset[i-1];\n                        this._indexOffset.push( {\n                            count: triCnt,\n                            offset: 2 * indexOffset[i-1]\n                        } );\n\n                        this._mesh._numFaces += (triCnt - 2);\n                    }\n                    this._mesh._numCoords = this._mesh._positions[0].length / 3;\n                }\n                else\n                {\n                    this._hasIndexOffset = false;\n\n                    var p1, p2 , p3, n1, n2, n3, t1, t2, t3, c1, c2, c3;\n\n                    var swapOrder = false;\n\n                    for (var i=1; i < indexes.length-2; ++i)\n                    {\n                        if (indexes[i+1] == -1) {\n                            i = i+2;\n                            faceCnt++;\n                            continue;\n                        }\n\n                        // care for counterclockwise point order\n                        if (swapOrder) {\n                            p1 = indexes[i];\n                            p2 = indexes[i-1];\n                            p3 = indexes[i+1];\n                        }\n                        else {\n                            p1 = indexes[i-1];\n                            p2 = indexes[i];\n                            p3 = indexes[i+1];\n                        }\n                        swapOrder = !swapOrder;\n\n                        if (normPerVert) {\n                            n1 = p1;\n                            n2 = p2;\n                            n3 = p3;\n                        } else //if (!normPerVert)\n                        {\n                            n1 = n2 = n3 = faceCnt;\n                        }\n\n                        t1 = p1;\n                        t2 = p2;\n                        t3 = p3;\n\n                        if (colPerVert) {\n                            c1 = p1;\n                            c2 = p2;\n                            c3 = p3;\n                        } else //if (!colPerVert)\n                        {\n                            c1 = c2 = c3 = faceCnt;\n                        }\n\n                        this._mesh._indices[0].push(cnt++, cnt++, cnt++);\n\n                        this._mesh._positions[0].push(positions[p1].x);\n                        this._mesh._positions[0].push(positions[p1].y);\n                        this._mesh._positions[0].push(positions[p1].z);\n                        this._mesh._positions[0].push(positions[p2].x);\n                        this._mesh._positions[0].push(positions[p2].y);\n                        this._mesh._positions[0].push(positions[p2].z);\n                        this._mesh._positions[0].push(positions[p3].x);\n                        this._mesh._positions[0].push(positions[p3].y);\n                        this._mesh._positions[0].push(positions[p3].z);\n\n                        if (hasNormal) {\n                            this._mesh._normals[0].push(normals[n1].x);\n                            this._mesh._normals[0].push(normals[n1].y);\n                            this._mesh._normals[0].push(normals[n1].z);\n                            this._mesh._normals[0].push(normals[n2].x);\n                            this._mesh._normals[0].push(normals[n2].y);\n                            this._mesh._normals[0].push(normals[n2].z);\n                            this._mesh._normals[0].push(normals[n3].x);\n                            this._mesh._normals[0].push(normals[n3].y);\n                            this._mesh._normals[0].push(normals[n3].z);\n                        }\n\n                        if (hasColor) {\n                            this._mesh._colors[0].push(colors[c1].r);\n                            this._mesh._colors[0].push(colors[c1].g);\n                            this._mesh._colors[0].push(colors[c1].b);\n                            if (numColComponents === 4) {\n                                this._mesh._colors[0].push(colors[c1].a);\n                            }\n                            this._mesh._colors[0].push(colors[c2].r);\n                            this._mesh._colors[0].push(colors[c2].g);\n                            this._mesh._colors[0].push(colors[c2].b);\n                            if (numColComponents === 4) {\n                                this._mesh._colors[0].push(colors[c2].a);\n                            }\n                            this._mesh._colors[0].push(colors[c3].r);\n                            this._mesh._colors[0].push(colors[c3].g);\n                            this._mesh._colors[0].push(colors[c3].b);\n                            if (numColComponents === 4) {\n                                this._mesh._colors[0].push(colors[c3].a);\n                            }\n                        }\n\n                        if (hasTexCoord) {\n                            this._mesh._texCoords[0].push(texCoords[t1].x);\n                            this._mesh._texCoords[0].push(texCoords[t1].y);\n                            if (numTexComponents === 3) {\n                                this._mesh._texCoords[0].push(texCoords[t1].z);\n                            }\n                            this._mesh._texCoords[0].push(texCoords[t2].x);\n                            this._mesh._texCoords[0].push(texCoords[t2].y);\n                            if (numTexComponents === 3) {\n                                this._mesh._texCoords[0].push(texCoords[t2].z);\n                            }\n                            this._mesh._texCoords[0].push(texCoords[t3].x);\n                            this._mesh._texCoords[0].push(texCoords[t3].y);\n                            if (numTexComponents === 3) {\n                                this._mesh._texCoords[0].push(texCoords[t3].z);\n                            }\n                        }\n                    }\n\n                    if (!hasNormal) {\n                        this._mesh.calcNormals(Math.PI);\n                    }\n\n                    if (!hasTexCoord) {\n                        this._mesh.calcTexCoords(texMode);\n                    }\n\n                    this._mesh.splitMesh();\n\n                    this.invalidateVolume();\n\n                    for (i=0; i<this._mesh._indices.length; i++) {\n                        this._mesh._numFaces += this._mesh._indices[i].length / 3;\n                        this._mesh._numCoords += this._mesh._positions[i].length / 3;\n                    }\n                }\n            },\n\n            fieldChanged: function(fieldName)\n            {\n                if (fieldName != \"coord\" && fieldName != \"normal\" &&\n                    fieldName != \"texCoord\" && fieldName != \"color\")\n                {\n                    x3dom.debug.logWarning(\"IndexedTriangleStripSet: fieldChanged for \" +\n                        fieldName + \" not yet implemented!\");\n                    return;\n                }\n\n                var pnts = this._cf.coord.node._vf.point;\n\n                if ((this._cf.normal.node === null) || (pnts.length > x3dom.Utils.maxIndexableCoords))\n                {\n                    if (fieldName == \"coord\") {\n                        this._mesh._positions[0] = [];\n                        this._mesh._indices[0] =[];\n                        this._mesh._normals[0] = [];\n                        this._mesh._texCoords[0] =[];\n\n                        var hasNormal = false, hasTexCoord = false, hasColor = false;\n\n                        var colPerVert = this._vf.colorPerVertex;\n                        var normPerVert = this._vf.normalPerVertex;\n\n                        var indexes = this._vf.index;\n                        var positions, normals, texCoords, colors;\n\n                        var coordNode = this._cf.coord.node;\n                        x3dom.debug.assert(coordNode);\n                        positions = coordNode._vf.point;\n\n                        var normalNode = this._cf.normal.node;\n                        if (normalNode) {\n                            hasNormal = true;\n                            normals = normalNode._vf.vector;\n                        }\n                        else {\n                            hasNormal = false;\n                        }\n\n                        var texMode = \"\", numTexComponents = 2;\n                        var texCoordNode = this._cf.texCoord.node;\n                        if (x3dom.isa(texCoordNode, x3dom.nodeTypes.MultiTextureCoordinate)) {\n                            if (texCoordNode._cf.texCoord.nodes.length)\n                                texCoordNode = texCoordNode._cf.texCoord.nodes[0];\n                        }\n                        if (texCoordNode) {\n                            if (texCoordNode._vf.point) {\n                                hasTexCoord = true;\n                                texCoords = texCoordNode._vf.point;\n\n                                if (x3dom.isa(texCoordNode, x3dom.nodeTypes.TextureCoordinate3D)) {\n                                    numTexComponents = 3;\n                                }\n                            }\n                            else if (texCoordNode._vf.mode) {\n                                texMode = texCoordNode._vf.mode;\n                            }\n                        }\n                        else {\n                            hasTexCoord = false;\n                        }\n                        this._mesh._numTexComponents = numTexComponents;\n\n                        var numColComponents = 3;\n                        var colorNode = this._cf.color.node;\n                        if (colorNode) {\n                            hasColor = true;\n                            colors = colorNode._vf.color;\n\n                            if (x3dom.isa(colorNode, x3dom.nodeTypes.ColorRGBA)) {\n                                numColComponents = 4;\n                            }\n                        }\n                        else {\n                            hasColor = false;\n                        }\n                        this._mesh._numColComponents = numColComponents;\n\n                        this._mesh._indices[0] = [];\n                        this._mesh._positions[0] = [];\n                        this._mesh._normals[0] = [];\n                        this._mesh._texCoords[0] = [];\n                        this._mesh._colors[0] = [];\n\n                        var faceCnt = 0, cnt = 0;\n                        var p1, p2 , p3, n1, n2, n3, t1, t2, t3, c1, c2, c3;\n                        var swapOrder = false;\n\n                        if ( hasNormal  || hasTexCoord || hasColor) {\n\n                            for (var i=1; i < indexes.length-2; ++i)\n                            {\n                                if (indexes[i+1] == -1) {\n                                    i = i+2;\n                                    faceCnt++;\n                                    continue;\n                                }\n\n                                if (swapOrder) {\n                                    p1 = indexes[i];\n                                    p2 = indexes[i-1];\n                                    p3 = indexes[i+1];\n                                }\n                                else {\n                                    p1 = indexes[i-1];\n                                    p2 = indexes[i];\n                                    p3 = indexes[i+1];\n                                }\n                                swapOrder = !swapOrder;\n\n                                if (normPerVert) {\n                                    n1 = p1;\n                                    n2 = p2;\n                                    n3 = p3;\n                                } else //if (!normPerVert)\n                                {\n                                    n1 = n2 = n3 = faceCnt;\n                                }\n\n                                t1 = p1;\n                                t2 = p2;\n                                t3 = p3;\n\n                                if (colPerVert) {\n                                    c1 = p1;\n                                    c2 = p2;\n                                    c3 = p3;\n                                } else //if (!colPerVert)\n                                {\n                                    c1 = c2 = c3 = faceCnt;\n                                }\n\n                                this._mesh._indices[0].push(cnt++, cnt++, cnt++);\n\n                                this._mesh._positions[0].push(positions[p1].x);\n                                this._mesh._positions[0].push(positions[p1].y);\n                                this._mesh._positions[0].push(positions[p1].z);\n                                this._mesh._positions[0].push(positions[p2].x);\n                                this._mesh._positions[0].push(positions[p2].y);\n                                this._mesh._positions[0].push(positions[p2].z);\n                                this._mesh._positions[0].push(positions[p3].x);\n                                this._mesh._positions[0].push(positions[p3].y);\n                                this._mesh._positions[0].push(positions[p3].z);\n\n                                if (hasNormal) {\n                                    this._mesh._normals[0].push(normals[n1].x);\n                                    this._mesh._normals[0].push(normals[n1].y);\n                                    this._mesh._normals[0].push(normals[n1].z);\n                                    this._mesh._normals[0].push(normals[n2].x);\n                                    this._mesh._normals[0].push(normals[n2].y);\n                                    this._mesh._normals[0].push(normals[n2].z);\n                                    this._mesh._normals[0].push(normals[n3].x);\n                                    this._mesh._normals[0].push(normals[n3].y);\n                                    this._mesh._normals[0].push(normals[n3].z);\n                                }\n\n                                if (hasColor) {\n                                    this._mesh._colors[0].push(colors[c1].r);\n                                    this._mesh._colors[0].push(colors[c1].g);\n                                    this._mesh._colors[0].push(colors[c1].b);\n                                    if (numColComponents === 4) {\n                                        this._mesh._colors[0].push(colors[c1].a);\n                                    }\n                                    this._mesh._colors[0].push(colors[c2].r);\n                                    this._mesh._colors[0].push(colors[c2].g);\n                                    this._mesh._colors[0].push(colors[c2].b);\n                                    if (numColComponents === 4) {\n                                        this._mesh._colors[0].push(colors[c2].a);\n                                    }\n                                    this._mesh._colors[0].push(colors[c3].r);\n                                    this._mesh._colors[0].push(colors[c3].g);\n                                    this._mesh._colors[0].push(colors[c3].b);\n                                    if (numColComponents === 4) {\n                                        this._mesh._colors[0].push(colors[c3].a);\n                                    }\n                                }\n\n                                if (hasTexCoord) {\n                                    this._mesh._texCoords[0].push(texCoords[t1].x);\n                                    this._mesh._texCoords[0].push(texCoords[t1].y);\n                                    if (numTexComponents === 3) {\n                                        this._mesh._texCoords[0].push(texCoords[t1].z);\n                                    }\n                                    this._mesh._texCoords[0].push(texCoords[t2].x);\n                                    this._mesh._texCoords[0].push(texCoords[t2].y);\n                                    if (numTexComponents === 3) {\n                                        this._mesh._texCoords[0].push(texCoords[t2].z);\n                                    }\n                                    this._mesh._texCoords[0].push(texCoords[t3].x);\n                                    this._mesh._texCoords[0].push(texCoords[t3].y);\n                                    if (numTexComponents === 3) {\n                                        this._mesh._texCoords[0].push(texCoords[t3].z);\n                                    }\n                                }\n                            }\n\n                            if (!hasNormal) {\n                                this._mesh.calcNormals(Math.PI);\n                            }\n\n                            if (!hasTexCoord) {\n                                this._mesh.calcTexCoords(texMode);\n                            }\n\n                            this._mesh.splitMesh();\n\n                        } else {\n                            var swapOrder = false;\n                            for (var i = 1; i < indexes.length; ++i)\n                            {\n                                if (indexes[i+1] == -1) {\n                                    i = i+2;\n                                    continue;\n                                }\n\n                                if (swapOrder) {\n                                    this._mesh._indices[0].push(indexes[i]);\n                                    this._mesh._indices[0].push(indexes[i-1]);\n                                    this._mesh._indices[0].push(indexes[i+1]);\n                                }\n                                else {\n                                    this._mesh._indices[0].push(indexes[i-1]);\n                                    this._mesh._indices[0].push(indexes[i]);\n                                    this._mesh._indices[0].push(indexes[i+1]);\n                                }\n                                swapOrder = !swapOrder;\n                            }\n\n                            this._mesh._positions[0] = positions.toGL();\n\n                            //if (hasNormal) { // always false here, since true is above\n                            //    this._mesh._normals[0] = normals.toGL();\n                            //}\n                            //else {\n                                this._mesh.calcNormals(Math.PI);\n                            //}\n                            //if (hasTexCoord) { // always false here, since true is above\n                            //    this._mesh._texCoords[0] = texCoords.toGL();\n                            //    this._mesh._numTexComponents = numTexComponents;\n                            //}\n                            //else {\n                                this._mesh.calcTexCoords(texMode);\n                            //}\n                            //if (hasColor) { // always false here, since true is above\n                            //    this._mesh._colors[0] = colors.toGL();\n                            //    this._mesh._numColComponents = numColComponents;\n                            //}\n\n                        }\n\n                        this.invalidateVolume();\n                        this._mesh._numFaces = 0;\n                        this._mesh._numCoords = 0;\n\n                        for (i=0; i<this._mesh._indices.length; i++) {\n                            this._mesh._numFaces += this._mesh._indices[i].length / 3;\n                            this._mesh._numCoords += this._mesh._positions[i].length / 3;\n                        }\n\n                        Array.forEach(this._parentNodes, function (node) {\n                            node.setAllDirty();\n                            node.invalidateVolume();\n                        });\n                    }\n                    else if (fieldName == \"color\") {\n                        var col = this._cf.color.node._vf.color;\n                        var faceCnt = 0;\n                        var c1 = c2 = c3 = 0;\n\n                        var numColComponents = 3;\n\n                        if (x3dom.isa(this._cf.color.node, x3dom.nodeTypes.ColorRGBA)) {\n                            numColComponents = 4;\n                        }\n\n                        this._mesh._colors[0] = [];\n\n                        var indexes = this._vf.index;\n                        var swapOrder = false;\n\n                        for (i=1; i < indexes.length-2; ++i)\n                        {\n                            if (indexes[i+1] == -1) {\n                                i = i+2;\n                                faceCnt++;\n                                continue;\n                            }\n\n                            if (this._vf.colorPerVertex) {\n                                if (swapOrder) {\n                                    c1 = indexes[i];\n                                    c2 = indexes[i-1];\n                                    c3 = indexes[i+1];\n                                }\n                                else {\n                                    c1 = indexes[i-1];\n                                    c2 = indexes[i];\n                                    c3 = indexes[i+1];\n                                }\n                                swapOrder = !swapOrder;\n                            } else if (!this._vf.colorPerVertex) {\n                                c1 = c2 = c3 = faceCnt;\n                            }\n                            this._mesh._colors[0].push(col[c1].r);\n                            this._mesh._colors[0].push(col[c1].g);\n                            this._mesh._colors[0].push(col[c1].b);\n                            if (numColComponents === 4) {\n                                this._mesh._colors[0].push(col[c1].a);\n                            }\n                            this._mesh._colors[0].push(col[c2].r);\n                            this._mesh._colors[0].push(col[c2].g);\n                            this._mesh._colors[0].push(col[c2].b);\n                            if (numColComponents === 4) {\n                                this._mesh._colors[0].push(col[c2].a);\n                            }\n                            this._mesh._colors[0].push(col[c3].r);\n                            this._mesh._colors[0].push(col[c3].g);\n                            this._mesh._colors[0].push(col[c3].b);\n                            if (numColComponents === 4) {\n                                this._mesh._colors[0].push(col[c3].a);\n                            }\n                        }\n\n                        Array.forEach(this._parentNodes, function (node) {\n                            node._dirty.colors = true;\n                        });\n                    }\n                    else if (fieldName == \"normal\") {\n                        var nor = this._cf.normal.node._vf.vector;\n                        var faceCnt = 0;\n                        var n1 = n2 = n3 = 0;\n\n                        this._mesh._normals[0] = [];\n\n                        var indexes = this._vf.index;\n                        var swapOrder = false;\n\n                        for (i=1; i < indexes.length-2; ++i)\n                        {\n                            if (indexes[i+1] == -1) {\n                                i = i+2;\n                                faceCnt++;\n                                continue;\n                            }\n\n                            if (this._vf.normalPerVertex) {\n                                if (swapOrder) {\n                                    n1 = indexes[i];\n                                    n2 = indexes[i-1];\n                                    n3 = indexes[i+1];\n                                }\n                                else {\n                                    n1 = indexes[i-1];\n                                    n2 = indexes[i];\n                                    n3 = indexes[i+1];\n                                }\n                                swapOrder = !swapOrder;\n                            } else if (!this._vf.normalPerVertex) {\n                                n1 = n2 = n3 = faceCnt;\n                            }\n                            this._mesh._normals[0].push(nor[n1].x);\n                            this._mesh._normals[0].push(nor[n1].y);\n                            this._mesh._normals[0].push(nor[n1].z);\n                            this._mesh._normals[0].push(nor[n2].x);\n                            this._mesh._normals[0].push(nor[n2].y);\n                            this._mesh._normals[0].push(nor[n2].z);\n                            this._mesh._normals[0].push(nor[n3].x);\n                            this._mesh._normals[0].push(nor[n3].y);\n                            this._mesh._normals[0].push(nor[n3].z);\n                        }\n\n                        Array.forEach(this._parentNodes, function (node) {\n                            node._dirty.normals = true;\n                        });\n                    }\n                    else if (fieldName == \"texCoord\") {\n                        var texCoordNode = this._cf.texCoord.node;\n                        if (x3dom.isa(texCoordNode, x3dom.nodeTypes.MultiTextureCoordinate)) {\n                            if (texCoordNode._cf.texCoord.nodes.length)\n                                texCoordNode = texCoordNode._cf.texCoord.nodes[0];\n                        }\n                        var tex = texCoordNode._vf.point;\n                        var t1 = t2 = t3 = 0;\n\n                        var numTexComponents = 2;\n\n                        if (x3dom.isa(texCoordNode, x3dom.nodeTypes.TextureCoordinate3D)) {\n                            numTexComponents = 3;\n                        }\n\n                        this._mesh._texCoords[0] = [];\n                        var indexes = this._vf.index;\n                        var swapOrder = false;\n\n                        for (i=1; i < indexes.length-2; ++i)\n                        {\n                            if (indexes[i+1] == -1) {\n                                i = i+2;\n                                continue;\n                            }\n\n                            if (swapOrder) {\n                                t1 = indexes[i];\n                                t2 = indexes[i-1];\n                                t3 = indexes[i+1];\n                            }\n                            else {\n                                t1 = indexes[i-1];\n                                t2 = indexes[i];\n                                t3 = indexes[i+1];\n                            }\n                            swapOrder = !swapOrder;\n\n                            this._mesh._texCoords[0].push(tex[t1].x);\n                            this._mesh._texCoords[0].push(tex[t1].y);\n                            if (numTexComponents === 3) {\n                                this._mesh._texCoords[0].push(tex[t1].z);\n                            }\n                            this._mesh._texCoords[0].push(tex[t2].x);\n                            this._mesh._texCoords[0].push(tex[t2].y);\n                            if (numTexComponents === 3) {\n                                this._mesh._texCoords[0].push(tex[t2].z);\n                            }\n                            this._mesh._texCoords[0].push(tex[t3].x);\n                            this._mesh._texCoords[0].push(tex[t3].y);\n                            if (numTexComponents === 3) {\n                                this._mesh._texCoords[0].push(tex[t3].z);\n                            }\n                        }\n\n                        Array.forEach(this._parentNodes, function (node) {\n                            node._dirty.texcoords = true;\n                        });\n                    }\n                }\n                else\n                {\n                    if (fieldName == \"coord\")\n                    {\n                        this._mesh._positions[0] = pnts.toGL();\n\n                        // tells the mesh that its bbox requires update\n                        this.invalidateVolume();\n\n                        Array.forEach(this._parentNodes, function (node) {\n                            node._dirty.positions = true;\n                            node.invalidateVolume();\n                        });\n                    }\n                    else if (fieldName == \"color\")\n                    {\n                        pnts = this._cf.color.node._vf.color;\n\n                        if (this._vf.colorPerVertex) {\n\n                            this._mesh._colors[0] = pnts.toGL();\n\n                        } else if (!this._vf.colorPerVertex) {\n\n                            var faceCnt = 0;\n                            var numColComponents = 3;\n\n                            if (x3dom.isa(this._cf.color.node, x3dom.nodeTypes.ColorRGBA)) {\n                                numColComponents = 4;\n                            }\n\n                            this._mesh._colors[0] = [];\n\n                            var indexes = this._vf.index;\n                            for (i=0; i < indexes.length; ++i)\n                            {\n                                if (indexes[i] == -1) {\n                                    faceCnt++;\n                                    continue;\n                                }\n\n                                this._mesh._colors[0].push(pnts[faceCnt].r);\n                                this._mesh._colors[0].push(pnts[faceCnt].g);\n                                this._mesh._colors[0].push(pnts[faceCnt].b);\n                                if (numColComponents === 4) {\n                                    this._mesh._colors[0].push(pnts[faceCnt].a);\n                                }\n                            }\n                        }\n\n                        Array.forEach(this._parentNodes, function (node) {\n                            node._dirty.colors = true;\n                        });\n                    }\n                    else if (fieldName == \"normal\")\n                    {\n                        pnts = this._cf.normal.node._vf.vector;\n\n                        if (this._vf.normalPerVertex) {\n\n                            this._mesh._normals[0] = pnts.toGL();\n\n                        } else if (!this._vf.normalPerVertex) {\n\n                            var indexes = this._vf.index;\n                            this._mesh._normals[0] = [];\n\n                            var faceCnt = 0;\n                            for (i=0; i < indexes.length; ++i)\n                            {\n                                if (indexes[i] == -1) {\n                                    faceCnt++;\n                                    continue;\n                                }\n\n                                this._mesh._normals[0].push(pnts[faceCnt].x);\n                                this._mesh._normals[0].push(pnts[faceCnt].y);\n                                this._mesh._normals[0].push(pnts[faceCnt].z);\n                            }\n                        }\n\n                        Array.forEach(this._parentNodes, function (node) {\n                            node._dirty.normals = true;\n                        });\n                    }\n                    else if (fieldName == \"texCoord\")\n                    {\n                        var texCoordNode = this._cf.texCoord.node;\n                        if (x3dom.isa(texCoordNode, x3dom.nodeTypes.MultiTextureCoordinate)) {\n                            if (texCoordNode._cf.texCoord.nodes.length)\n                                texCoordNode = texCoordNode._cf.texCoord.nodes[0];\n                        }\n                        pnts = texCoordNode._vf.point;\n\n                        this._mesh._texCoords[0] = pnts.toGL();\n\n                        Array.forEach(this._parentNodes, function (node) {\n                            node._dirty.texcoords = true;\n                        });\n                    }\n                }\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n\n/* ### TriangleSet ### */\nx3dom.registerNodeType(\n    \"TriangleSet\",\n    \"Rendering\",\n    defineClass(x3dom.nodeTypes.X3DComposedGeometryNode,\n\n        /**\n         * Constructor for TriangleSet\n         * @constructs x3dom.nodeTypes.TriangleSet\n         * @x3d 3.3\n         * @component Rendering\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DComposedGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc TriangleSet is a geometry node that can contain a Color, Coordinate, Normal and TextureCoordinate node.\n         * Hint: insert a Shape node before adding geometry or Appearance.\n         * You can also substitute a type-matched ProtoInstance for content.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.TriangleSet.superClass.call(this, ctx);\n\n        },\n        {\n            _buildGeometry: function()\n            {\n                var colPerVert = this._vf.colorPerVertex;\n                var normPerVert = this._vf.normalPerVertex;\n                var ccw = this._vf.ccw;\n\n                var hasNormal = false, hasTexCoord = false, hasColor = false;\n                var positions, normals, texCoords, colors;\n\n                var coordNode = this._cf.coord.node;\n                x3dom.debug.assert(coordNode);\n\n                if(!coordNode || coordNode._vf.point.length < 3)\n                {\n                    this._vf.render = false;\n                    return;\n                }\n\n                positions = coordNode._vf.point;\n\n                var normalNode = this._cf.normal.node;\n                if (normalNode) {\n                    hasNormal = true;\n                    normals = normalNode._vf.vector;\n                }\n                else {\n                    hasNormal = false;\n                }\n\n                var texMode = \"\", numTexComponents = 2;\n                var texCoordNode = this._cf.texCoord.node;\n                if (x3dom.isa(texCoordNode, x3dom.nodeTypes.MultiTextureCoordinate)) {\n                    if (texCoordNode._cf.texCoord.nodes.length)\n                        texCoordNode = texCoordNode._cf.texCoord.nodes[0];\n                }\n                if (texCoordNode) {\n                    if (texCoordNode._vf.point) {\n                        hasTexCoord = true;\n                        texCoords = texCoordNode._vf.point;\n\n                        if (x3dom.isa(texCoordNode, x3dom.nodeTypes.TextureCoordinate3D)) {\n                            numTexComponents = 3;\n                        }\n                    }\n                    else if (texCoordNode._vf.mode) {\n                        texMode = texCoordNode._vf.mode;\n                    }\n                }\n                else {\n                    hasTexCoord = false;\n                }\n\n                var numColComponents = 3;\n                var colorNode = this._cf.color.node;\n                if (colorNode) {\n                    hasColor = true;\n                    colors = colorNode._vf.color;\n\n                    if (x3dom.isa(colorNode, x3dom.nodeTypes.ColorRGBA)) {\n                        numColComponents = 4;\n                    }\n                }\n                else {\n                    hasColor = false;\n                }\n\n                while (positions.length % 3 > 0) {\n                    positions.pop();\n                }\n\n                this._mesh._indices[0] = new Array(positions.length);\n                this._mesh._positions[0] = [];\n                this._mesh._normals[0] = [];\n                this._mesh._texCoords[0] = [];\n                this._mesh._colors[0] = [];\n\n                var posMax = positions.length / 3;\n                var faceCnt, i = 0;\n\n                for (faceCnt=0; faceCnt<posMax; faceCnt++)\n                {\n                    // FIXME; get rid of useless internal index field, but this requires modification of renderer\n                    this._mesh._indices[0][i] = i++;\n                    this._mesh._indices[0][i] = i++;\n                    this._mesh._indices[0][i] = i++;\n\n                    if(!normPerVert && hasNormal) {\n                        this._mesh._normals[0].push(normals[faceCnt].x);\n                        this._mesh._normals[0].push(normals[faceCnt].y);\n                        this._mesh._normals[0].push(normals[faceCnt].z);\n                    }\n                    if(!colPerVert && hasColor) {\n                        this._mesh._colors[0].push(colors[faceCnt].r);\n                        this._mesh._colors[0].push(colors[faceCnt].g);\n                        this._mesh._colors[0].push(colors[faceCnt].b);\n                        if (numColComponents === 4) {\n                            this._mesh._colors[0].push(colors[faceCnt].a);\n                        }\n                    }\n                }\n\n                this._mesh._positions[0] = positions.toGL();\n\n                if (hasNormal) {\n                    this._mesh._normals[0] = normals.toGL();\n                }\n                else {\n                    this._mesh.calcNormals(normPerVert ? Math.PI : 0, ccw);\n                }\n\n                if (hasTexCoord) {\n                    this._mesh._texCoords[0] = texCoords.toGL();\n                    this._mesh._numTexComponents = numTexComponents;\n                }\n                else {\n                    this._mesh.calcTexCoords(texMode);\n                }\n\n                if (hasColor && colPerVert) {\n                    this._mesh._colors[0] = colors.toGL();\n                    this._mesh._numColComponents = numColComponents;\n                }\n\n                this._mesh._numFaces = posMax;\n                this._mesh._numCoords = positions.length;\n\n                this.invalidateVolume();\n\n            },\n\n            nodeChanged: function()\n            {\n                this._buildGeometry();\n            },\n\n            fieldChanged: function(fieldName)\n            {\n                if (fieldName == \"coord\")\n                {\n                    this._buildGeometry();\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.positions = true;\n                        node.invalidateVolume();\n                    });\n                }\n                else if (fieldName == \"color\")\n                {\n                    this._buildGeometry();\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.colors = true;\n                    });\n                }\n                else if (fieldName == \"normal\")\n                {\n                    this._buildGeometry();\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.normals = true;\n                    });\n                }\n                else if (fieldName == \"texCoord\")\n                {\n                    this._buildGeometry();\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.texcoords = true;\n                    });\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### X3DGeometricPropertyNode ### */\nx3dom.registerNodeType(\n    \"X3DGeometricPropertyNode\",\n    \"Rendering\",\n    defineClass(x3dom.nodeTypes.X3DNode,\n        \n        /**\n         * Constructor for X3DGeometricPropertyNode\n         * @constructs x3dom.nodeTypes.X3DGeometricPropertyNode\n         * @x3d 3.3\n         * @component Rendering\n         * @status full\n         * @extends x3dom.nodeTypes.X3DNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc This is the base node type for all geometric property node types defined in X3D.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DGeometricPropertyNode.superClass.call(this, ctx);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### X3DCoordinateNode ### */\nx3dom.registerNodeType(\n    \"X3DCoordinateNode\",\n    \"Rendering\",\n    defineClass(x3dom.nodeTypes.X3DGeometricPropertyNode,\n        \n        /**\n         * Constructor for X3DCoordinateNode\n         * @constructs x3dom.nodeTypes.X3DCoordinateNode\n         * @x3d 3.3\n         * @component Rendering\n         * @status full\n         * @extends x3dom.nodeTypes.X3DGeometricPropertyNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc This is the base node type for all coordinate node types in X3D.\n         * All coordinates are specified in nodes derived from this abstract node type.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DCoordinateNode.superClass.call(this, ctx);\n        \n        },\n        {\n            fieldChanged: function (fieldName) {\n                if (fieldName === \"coord\" || fieldName === \"point\") {\n                    Array.forEach(this._parentNodes, function (node) {\n                        node.fieldChanged(\"coord\");\n                    });\n                }\n            },\n\n            parentAdded: function (parent) {\n                if (parent._mesh && parent._cf.coord && parent._cf.coord.node !== this) {\n                    parent.fieldChanged(\"coord\");\n                }\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### Coordinate ### */\nx3dom.registerNodeType(\n    \"Coordinate\",\n    \"Rendering\",\n    defineClass(x3dom.nodeTypes.X3DCoordinateNode,\n        \n        /**\n         * Constructor for Coordinate\n         * @constructs x3dom.nodeTypes.Coordinate\n         * @x3d 3.3\n         * @component Rendering\n         * @status full\n         * @extends x3dom.nodeTypes.X3DCoordinateNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc Coordinate builds geometry using a set of 3D coordinates.\n         * Coordinate is used by IndexedFaceSet, IndexedLineSet, LineSet and PointSet.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Coordinate.superClass.call(this, ctx);\n\n\n            /**\n             * Contains the 3D coordinates\n             * @var {x3dom.fields.MFVec3f} point\n             * @memberof x3dom.nodeTypes.Coordinate\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFVec3f(ctx, 'point', []);\n        \n        },\n        {\n            getPoints: function() {\n                return this._vf.point;\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2017 A. Plesch, Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### Coordinate ### */\nx3dom.registerNodeType(\n    \"CoordinateDouble\",\n    \"Nurbs\",\n    defineClass(x3dom.nodeTypes.X3DCoordinateNode,\n        \n        /**\n         * Constructor for CoordinateDouble\n         * @constructs x3dom.nodeTypes.CoordinateDouble\n         * @x3d 3.3\n         * @component Nurbs\n         * @status full\n         * @extends x3dom.nodeTypes.X3DCoordinateNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc Coordinate builds geometry using a set of double precision 3D coordinates.\n         * X3DCoordinateNode is used by IndexedFaceSet, IndexedLineSet, LineSet and PointSet.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.CoordinateDouble.superClass.call(this, ctx);\n\n            /**\n             * Contains the 3D coordinates\n             * @var {x3dom.fields.MFVec3d} point\n             * @memberof x3dom.nodeTypes.Coordinate\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFVec3d(ctx, 'point', []);\n        \n        },\n        {\n            getPoints: function() {\n                return this._vf.point;\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### Normal ### */\nx3dom.registerNodeType(\n    \"Normal\",\n    \"Rendering\",\n    defineClass(x3dom.nodeTypes.X3DGeometricPropertyNode,\n        \n        /**\n         * Constructor for Normal\n         * @constructs x3dom.nodeTypes.Normal\n         * @x3d 3.3\n         * @component Rendering\n         * @status full\n         * @extends x3dom.nodeTypes.X3DGeometricPropertyNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc Normal is a set of 3D surface-normal vectors Normal values are optional perpendicular directions, used per-polygon or per-vertex for lighting and shading.\n         * Hint: used by IndexedFaceSet and ElevationGrid.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Normal.superClass.call(this, ctx);\n\n\n            /**\n             * set of unit-length normal vectors, corresponding to indexed polygons or vertices.\n             * @var {x3dom.fields.MFVec3f} vector\n             * @range [-1, 1]\n             * @memberof x3dom.nodeTypes.Normal\n             * @initvalue []\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFVec3f(ctx, 'vector', []);\n        \n        },\n        {\n            fieldChanged: function (fieldName) {\n                if (fieldName === \"normal\" || fieldName === \"vector\") {\n                    Array.forEach(this._parentNodes, function (node) {\n                        node.fieldChanged(\"normal\");\n                    });\n                }\n            },\n\n            parentAdded: function (parent) {\n                if (parent._mesh && //parent._cf.coord.node &&\n                    parent._cf.normal.node !== this) {\n                    parent.fieldChanged(\"normal\");\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### X3DColorNode ### */\nx3dom.registerNodeType(\n    \"X3DColorNode\",\n    \"Rendering\",\n    defineClass(x3dom.nodeTypes.X3DGeometricPropertyNode,\n        \n        /**\n         * Constructor for X3DColorNode\n         * @constructs x3dom.nodeTypes.X3DColorNode\n         * @x3d 3.3\n         * @component Rendering\n         * @status full\n         * @extends x3dom.nodeTypes.X3DGeometricPropertyNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc This is the base node type for color specifications in X3D.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DColorNode.superClass.call(this, ctx);\n        \n        },\n        {\n            fieldChanged: function (fieldName) {\n                if (fieldName === \"color\") {\n                    Array.forEach(this._parentNodes, function (node) {\n                        node.fieldChanged(\"color\");\n                    });\n                }\n            },\n\n            parentAdded: function (parent) {\n                if (parent._mesh && //parent._cf.coord.node &&\n                    parent._cf.color.node !== this) {\n                    parent.fieldChanged(\"color\");\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### Color ### */\nx3dom.registerNodeType(\n    \"Color\",\n    \"Rendering\",\n    defineClass(x3dom.nodeTypes.X3DColorNode,\n        \n        /**\n         * Constructor for Color\n         * @constructs x3dom.nodeTypes.Color\n         * @x3d 3.3\n         * @component Rendering\n         * @status full\n         * @extends x3dom.nodeTypes.X3DColorNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc This node defines a set of RGB colors to be used in the fields of another node.\n         * Color nodes are only used to specify multiple colours for a single geometric shape, such as colours for the faces or vertices of an IndexedFaceSet.\n         * A Material node is used to specify the overall material parameters of lit geometry.\n         * If both a Material node and a Color node are specified for a geometric shape, the colours shall replace the diffuse component of the material.\n         * RGB or RGBA textures take precedence over colours; specifying both an RGB or RGBA texture and a Color node for geometric shape will result in the Color node being ignored.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Color.superClass.call(this, ctx);\n\n\n            /**\n             * The RGB colors.\n             * @var {x3dom.fields.MFColor} color\n             * @range [0, 1]\n             * @memberof x3dom.nodeTypes.Color\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFColor(ctx, 'color', []);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### ColorRGBA ### */\nx3dom.registerNodeType(\n    \"ColorRGBA\",\n    \"Rendering\",\n    defineClass(x3dom.nodeTypes.X3DColorNode,\n        \n        /**\n         * Constructor for ColorRGBA\n         * @constructs x3dom.nodeTypes.ColorRGBA\n         * @x3d 3.3\n         * @component Rendering\n         * @status full\n         * @extends x3dom.nodeTypes.X3DColorNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc This node defines a set of RGBA colours to be used in the fields of another node.\n         * RGBA color nodes are only used to specify multiple colours with alpha for a single geometric shape, such as colours for the faces or vertices of an IndexedFaceSet.\n         * A Material node is used to specify the overall material parameters of lit geometry.\n         * If both a Material node and a ColorRGBA node are specified for a geometric shape, the colours shall replace the diffuse and transparency components of the material.\n         * RGB or RGBA textures take precedence over colours; specifying both an RGB or RGBA texture and a ColorRGBA node for geometric shape will result in the ColorRGBA node being ignored.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.ColorRGBA.superClass.call(this, ctx);\n\n\n            /**\n             * The set of RGBA colors\n             * @var {x3dom.fields.MFColorRGBA} color\n             * @range [0, 1]\n             * @memberof x3dom.nodeTypes.ColorRGBA\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFColorRGBA(ctx, 'color', []);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* This is only a first stub */\n\n/* ### ParticleSet ### */\nx3dom.registerNodeType(\n    \"ParticleSet\",\n    \"Rendering\",\n    defineClass(x3dom.nodeTypes.PointSet,\n\n        /**\n         * Constructor for ParticleSet\n         * @constructs x3dom.nodeTypes.ParticleSet\n         * @x3d x.x\n         * @component Rendering\n         * @status experimental\n         * @extends x3dom.nodeTypes.PointSet\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The ParticleSet is a geometry node used in combination with a ParticleSystem node.\n         *  Attention: So far this is only a stub.\n         */\n         function (ctx) {\n            x3dom.nodeTypes.ParticleSet.superClass.call(this, ctx);\n\n            /**\n             * Drawing mode: \"ViewDirQuads\" - Draws quads directed to the viewpoint (default). \"Points\" - Draw points.\n             * \"Lines\" - Draw lines. These modes must not match the finally supported modes.\n             * @var {x3dom.fields.SFString} mode\n             * @memberof x3dom.nodeTypes.ParticleSet\n             * @initvalue ViewDirQuads\n             * @range [ViewDirQuads, Points, Lines, Arrows, ViewerArrows, ViewerQuads, Rectangles]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'mode', 'ViewDirQuads'); // only default value supported\n\n            /**\n             * Defines the drawing order for the particles. Possible values: \"Any\" - The order is undefined.\n             *  \"BackToFront\" - Draw from back to front. \"FrontToBack\" - Draw from front to back.\n             * @var {x3dom.fields.SFString} drawOrder\n             * @memberof x3dom.nodeTypes.ParticleSet\n             * @initvalue Any\n             * @range [Any, BackToFront, FrontToBack]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'drawOrder', 'Any');\n\n            // THINKABOUTME; does this very special field makes sense for being impl. in WebGL?\n            //this.addField_SFNode('secCoord', x3dom.nodeTypes.X3DCoordinateNode); // NOT YET SUPPORTED!\n\n            /**\n             * Stores a Normal node containing the normals of the particles.\n             * @var {x3dom.fields.SFNode} normal\n             * @memberof x3dom.nodeTypes.ParticleSet\n             * @initvalue null\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('normal', x3dom.nodeTypes.Normal); // NOT YET SUPPORTED\n\n            /**\n             * An MFVec3f field containing the sizes of the particles.\n             * @var {x3dom.fields.MFVec3f} size\n             * @memberof x3dom.nodeTypes.ParticleSet\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFVec3f(ctx, 'size', []);\n\n            /**\n             * An MFInt32 field containing indices which specify the order of the vertices in the \"coord\" field.\n             * @var {x3dom.fields.MFInt32} index\n             * @memberof x3dom.nodeTypes.ParticleSet\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFInt32(ctx, 'index', []);\n\n            /**\n             * An MFFloat field containing z-values for the texture of a particle (used with 3D textures).\n             * @var {x3dom.fields.MFFloat} textureZ\n             * @memberof x3dom.nodeTypes.ParticleSet\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFFloat(ctx, 'textureZ', []); // NOT YET SUPPORTED! (3D textures not supported in WebGL)\n\n            this._mesh._primType = 'POINTS';\n        },\n        {\n            drawOrder: function() {\n                return this._vf.drawOrder.toLowerCase();\n            },\n\n            nodeChanged: function()\n            {\n                var coordNode = this._cf.coord.node;\n                x3dom.debug.assert(coordNode, \"ParticleSet without coord node!\");\n                var positions = coordNode.getPoints();\n\n                var numColComponents = 3;\n                var colorNode = this._cf.color.node;\n                var colors = new x3dom.fields.MFColor();\n                if (colorNode) {\n                    colors = colorNode._vf.color;\n                    x3dom.debug.assert(positions.length == colors.length, \"Size of color and coord array differs!\");\n\n                    if (x3dom.isa(colorNode, x3dom.nodeTypes.ColorRGBA)) {\n                        numColComponents = 4;\n                    }\n                }\n\n                var normalNode = this._cf.normal.node;\n                var normals = new x3dom.fields.MFVec3f();\n                if (normalNode) {\n                    normals = normalNode._vf.vector;\n                }\n\n                var indices = [];\n                if (this.drawOrder() != \"any\") {\n                    indices = this._vf.index.toGL();\n\n                    // generate indices since also used for sorting\n                    if (indices.length == 0) {\n                        var i, n = positions.length;\n                        indices = new Array(n);\n                        for (i = 0; i < n; i++) {\n                            indices[i] = i;\n                        }\n                    }\n                }\n\n                this._mesh._numColComponents = numColComponents;\n                this._mesh._lit = false;\n\n                this._mesh._indices[0] = indices;\n                this._mesh._positions[0] = positions.toGL();\n                this._mesh._colors[0] = colors.toGL();\n                this._mesh._normals[0] = normals.toGL();\n                this._mesh._texCoords[0] = [];\n\n                this.invalidateVolume();\n                this._mesh._numCoords = this._mesh._positions[0].length / 3;\n            },\n\n            fieldChanged: function(fieldName)\n            {\n                var pnts = null;\n\n                if (fieldName == \"index\")\n                {\n                    this._mesh._indices[0] = this._vf.index.toGL();\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.indexes = true;\n                    });\n                }\n                else if (fieldName == \"size\")\n                {\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.specialAttribs = true;\n                    });\n                }\n                else if (fieldName == \"coord\")\n                {\n                    pnts = this._cf.coord.node.getPoints();\n\n                    this._mesh._positions[0] = pnts.toGL();\n\n                    var indices = [];\n                    if (this.drawOrder() != \"any\") {\n                        indices = this._vf.index.toGL();\n\n                        // generate indices since also used for sorting\n                        if (indices.length == 0) {\n                            var i, n = pnts.length;\n                            indices = new Array(n);\n                            for (i = 0; i < n; i++) {\n                                indices[i] = i;\n                            }\n                        }\n                    }\n                    this._mesh._indices[0] = indices;\n\n                    this.invalidateVolume();\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.positions = true;\n                        node._dirty.indexes = true;\n                        node.invalidateVolume();\n                    });\n                }\n                else if (fieldName == \"color\")\n                {\n                    pnts = this._cf.color.node._vf.color;\n\n                    this._mesh._colors[0] = pnts.toGL();\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.colors = true;\n                    });\n                }\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### ClipPlane ### */\nx3dom.registerNodeType(\n    \"ClipPlane\",\n    \"Rendering\",\n    defineClass(x3dom.nodeTypes.X3DChildNode,\n\n        /**\n         * Constructor for ClipPlane\n         * @constructs x3dom.nodeTypes.ClipPlane\n         * @x3d 3.2\n         * @component Rendering\n         * @status full\n         * @extends x3dom.nodeTypes.X3DChildNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc A clip plane is defined as a plane that generates two half-spaces. The effected geometry in the\n         * half-space that is defined as being outside the plane is removed from the rendered image as a result of a\n         * clipping operation.\n         */\n            function (ctx) {\n            x3dom.nodeTypes.ClipPlane.superClass.call(this, ctx);\n\n\n            /**\n             * Defines activation state of the clip plane.\n             * @var {x3dom.fields.SFBool} enabled\n             * @memberof x3dom.nodeTypes.ClipPlane\n             * @initvalue true\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'enabled', true);\n\n            /**\n             * The ClipPlane node specifies a single plane equation that will be used to clip the geometry.\n             * The plane field specifies a four-component plane equation that describes the inside and outside half\n             * space. The first three components are a normalized vector describing the direction of the plane's\n             * normal direction.\n             * @var {x3dom.fields.SFVec4f} plane\n             * @memberof x3dom.nodeTypes.ClipPlane\n             * @initvalue 0,1,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec4f(ctx, 'plane', 0, 1, 0, 0);\n\n            /**\n             * Defines the strength of the capping.\n             * @var {x3dom.fields.SFFloat} cappingStrength\n             * @memberof x3dom.nodeTypes.ClipPlane\n             * @initvalue 0.0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'cappingStrength', 0.0);\n\n            /**\n             * Defines the color of the capping.\n             * @var {x3dom.fields.SFColor} cappingColor\n             * @memberof x3dom.nodeTypes.ClipPlane\n             * @initvalue 1.0,1.0,1.0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFColor(ctx, 'cappingColor', 1.0, 1.0, 1.0);\n\n\n            /**\n             * Enables/disables this effector (e.g. light)\n             * @var {x3dom.fields.SFBool} on\n             * @memberof x3dom.nodeTypes.ClipPlane\n             * @initvalue true\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'on', true);\n        },\n        {\n            fieldChanged: function (fieldName) {\n                if (fieldName == \"enabled\" || fieldName == \"on\") {\n                    //TODO\n                }\n            },\n\n            nodeChanged: function () {\n                x3dom.nodeTypes.ClipPlane.count++;\n            },\n\n            onRemove: function() {\n                x3dom.nodeTypes.ClipPlane.count--;\n            },\n\n            parentAdded: function(parent) {\n            },\n\n            parentRemoved: function(parent) {\n                //TODO\n            }\n        }\n    )\n);\n\n/** Static class ID counter (needed for caching) */\nx3dom.nodeTypes.ClipPlane.count = 0;\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### X3DAppearanceNode ### */\nx3dom.registerNodeType(\n    \"X3DAppearanceNode\",\n    \"Shape\",\n    defineClass(x3dom.nodeTypes.X3DNode,\n        \n        /**\n         * Constructor for X3DAppearanceNode\n         * @constructs x3dom.nodeTypes.X3DAppearanceNode\n         * @x3d 3.3\n         * @component Shape\n         * @status full\n         * @extends x3dom.nodeTypes.X3DNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc This is the base node type for all Appearance nodes.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DAppearanceNode.superClass.call(this, ctx);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### Appearance ### */\nx3dom.registerNodeType(\n    \"Appearance\",\n    \"Shape\",\n    defineClass(x3dom.nodeTypes.X3DAppearanceNode,\n        \n        /**\n         * Constructor for Appearance\n         * @constructs x3dom.nodeTypes.Appearance\n         * @x3d 3.3\n         * @component Shape\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DAppearanceNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The Appearance node specifies the visual properties of geometry.\n         * The value for each of the fields in this node may be NULL.\n         * However, if the field is non-NULL, it shall contain one node of the appropriate type.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Appearance.superClass.call(this, ctx);\n\n\n            /**\n             * The material field, if specified, shall contain a Material node.\n             * If the material field is NULL or unspecified, lighting is off (all lights are ignored during rendering of the object that references this Appearance) and the unlit object colour is (1, 1, 1).\n             * @var {x3dom.fields.SFNode} material\n             * @memberof x3dom.nodeTypes.Appearance\n             * @initvalue x3dom.nodeTypes.X3DMaterialNode\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFNode('material', x3dom.nodeTypes.X3DMaterialNode);\n\n            /**\n             * The texture field, if specified, shall contain a texture nodes.\n             * If the texture node is NULL or the texture field is unspecified, the object that references this Appearance is not textured.\n             * @var {x3dom.fields.SFNode} texture\n             * @memberof x3dom.nodeTypes.Appearance\n             * @initvalue x3dom.nodeTypes.X3DTextureNode\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFNode('texture',  x3dom.nodeTypes.X3DTextureNode);\n\n            /**\n             * The textureTransform field, if specified, shall contain a TextureTransform node. If the textureTransform is NULL or unspecified, the textureTransform field has no effect.\n             * @var {x3dom.fields.SFNode} textureTransform\n             * @memberof x3dom.nodeTypes.Appearance\n             * @initvalue x3dom.nodeTypes.X3DTextureTransformNode\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFNode('textureTransform', x3dom.nodeTypes.X3DTextureTransformNode);\n\n            /**\n             * The lineProperties field, if specified, shall contain a LineProperties node. If lineProperties is NULL or unspecified, the lineProperties field has no effect.\n             * @var {x3dom.fields.SFNode} lineProperties\n             * @memberof x3dom.nodeTypes.Appearance\n             * @initvalue x3dom.nodeTypes.LineProperties\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFNode('lineProperties', x3dom.nodeTypes.LineProperties);\n\n            /**\n             * Holds a ColorMaskMode node.\n             * @var {x3dom.fields.SFNode} colorMaskMode\n             * @memberof x3dom.nodeTypes.Appearance\n             * @initvalue x3dom.nodeTypes.ColorMaskMode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('colorMaskMode', x3dom.nodeTypes.ColorMaskMode);\n\n            /**\n             * Holds the  BlendMode node, that is needed for correct transparency.\n             * @var {x3dom.fields.SFNode} blendMode\n             * @memberof x3dom.nodeTypes.Appearance\n             * @initvalue x3dom.nodeTypes.BlendMode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('blendMode', x3dom.nodeTypes.BlendMode);\n\n            /**\n             * Holds the depthMode node.\n             * @var {x3dom.fields.SFNode} depthMode\n             * @memberof x3dom.nodeTypes.Appearance\n             * @initvalue x3dom.nodeTypes.DepthMode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('depthMode', x3dom.nodeTypes.DepthMode);\n\n            /**\n             * Contains ProgramShader (Cg) or ComposedShader (GLSL).\n             * @var {x3dom.fields.MFNode} shaders\n             * @memberof x3dom.nodeTypes.Appearance\n             * @initvalue x3dom.nodeTypes.X3DShaderNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFNode('shaders', x3dom.nodeTypes.X3DShaderNode);\n\n            /**\n             * Defines the shape type for sorting.\n             * @var {x3dom.fields.SFString} sortType\n             * @range [auto, transparent, opaque]\n             * @memberof x3dom.nodeTypes.Appearance\n             * @initvalue 'auto'\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'sortType', 'auto');\n\n            /**\n             * Change render order manually.\n             * @var {x3dom.fields.SFInt32} sortKey\n             * @memberof x3dom.nodeTypes.Appearance\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'sortKey', 0);\n\t\t\t\n\t\t\t/**\n             * Specify the threshold for the alpha clipping\n             * @var {x3dom.fields.SFFloat} alphaClipThreshold\n             * @memberof x3dom.nodeTypes.Appearance\n             * @initvalue 0.1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'alphaClipThreshold', 0.1);\n\n            // shortcut to shader program\n            this._shader = null;\n        \n        },\n        {\n\t\t\tfieldChanged: function(fieldName) {\n\t\t\t\tif (fieldName == \"alphaClipThreshold\") {\n\t\t\t\t\n\t\t\t\t\tArray.forEach(this._parentNodes, function (shape) {\n\t\t\t\t\t\tshape.setAppDirty();\n\t\t\t\t\t});\n\t\t\t\t\n\t\t\t\t}\n\t\t\t},\n\t\t\n            nodeChanged: function() {\n                //TODO delete this if all works fine\n                if (!this._cf.material.node) {\n                    //Unlit\n                    //this.addChild(x3dom.nodeTypes.Material.defaultNode());\n                }\n\n                if (this._cf.shaders.nodes.length) {\n                    this._shader = this._cf.shaders.nodes[0];\n                }\n                else if(this._shader)\n                    this._shader=null;\n\n                Array.forEach(this._parentNodes, function (shape) {\n                    shape.setAppDirty();\n                });\n\n                this.checkSortType();\n            },\n\n            checkSortType: function() {\n                if (this._vf.sortType == 'auto') {\n                    if (this._cf.material.node && (this._cf.material.node._vf.transparency > 0 ||\n                        this._cf.material.node._vf.backTransparency && this._cf.material.node._vf.backTransparency > 0)) {\n                        this._vf.sortType = 'transparent';\n                    }\n                    else if (this._cf.texture.node && this._cf.texture.node._vf.url.length) {\n                        // uhh, this is a rather coarse guess...\n                        if (this._cf.texture.node._vf.url[0].toLowerCase().indexOf('.'+'png') >= 0) {\n                            this._vf.sortType = 'transparent';\n                        }\n                        else {\n                            this._vf.sortType = 'opaque';\n                        }\n                    }\n                    else if(x3dom.isa(this._cf.material.node, x3dom.nodeTypes.PhysicalMaterial))\n                    {\n                        var material = this._cf.material.node;\n\n                        if(material._vf.alphaMode == \"OPAQUE\")\n                        {\n                            this._vf.sortType = 'opaque';\n                        }\n                        else if(material._vf.alphaMode == \"BLEND\" || material._vf.alphaMode == \"MASK\")\n                        {\n                            this._vf.sortType = 'transparent';\n                        }\n\n                        var baseColorTexture = material._cf.baseColorTexture.node;\n\n                        if(this._vf.sortType == 'opaque' && baseColorTexture && baseColorTexture._vf.url.length && \n                           baseColorTexture._vf.url[0].toLowerCase().indexOf('.png') >= 0)\n                        {\n                            this._vf.sortType = 'transparent';\n                        }\n                    }\n                    else {\n                        this._vf.sortType = 'opaque';\n                    }\n                }\n            },\n\n            texTransformMatrix: function() {\n                if (this._cf.textureTransform.node === null) {\n                    return x3dom.fields.SFMatrix4f.identity();\n                }\n                else {\n                    return this._cf.textureTransform.node.texTransformMatrix();\n                }\n            },\n\n            parentAdded: function(parent) {\n                if (this != x3dom.nodeTypes.Appearance._defaultNode) {\n                    /*if (parent._cleanupGLObjects) {\n                     parent._cleanupGLObjects(true);\n                     }*/\n                    parent.setAppDirty();\n                }\n            }\n        }\n    )\n);\n\nx3dom.nodeTypes.Appearance.defaultNode = function() {\n    if (!x3dom.nodeTypes.Appearance._defaultNode) {\n        x3dom.nodeTypes.Appearance._defaultNode = new x3dom.nodeTypes.Appearance();\n        x3dom.nodeTypes.Appearance._defaultNode.nodeChanged();\n    }\n    return x3dom.nodeTypes.Appearance._defaultNode;\n};\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### X3DAppearanceChildNode ### */\nx3dom.registerNodeType(\n    \"X3DAppearanceChildNode\",\n    \"Shape\",\n    defineClass(x3dom.nodeTypes.X3DNode,\n        \n        /**\n         * Constructor for X3DAppearanceChildNode\n         * @constructs x3dom.nodeTypes.X3DAppearanceChildNode\n         * @x3d 3.3\n         * @component Shape\n         * @status full\n         * @extends x3dom.nodeTypes.X3DNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc This is the base node type for the child nodes of the X3DAppearanceNode type.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DAppearanceChildNode.superClass.call(this, ctx);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### BlendMode ### */\nx3dom.registerNodeType(\n    \"BlendMode\",\n    \"Shape\",\n    defineClass(x3dom.nodeTypes.X3DAppearanceChildNode,\n        \n        /**\n         * Constructor for BlendMode\n         * @constructs x3dom.nodeTypes.BlendMode\n         * @x3d x.x\n         * @component Shape\n         * @extends x3dom.nodeTypes.X3DAppearanceChildNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The BlendMode controls blending and alpha test.\n         * Pixels can be drawn using a function that blends the incoming (source) RGBA values with the RGBA values that are already in the frame buffer (the destination values).\n         */\n        function (ctx) {\n            x3dom.nodeTypes.BlendMode.superClass.call(this, ctx);\n\n\n            /**\n             * The incoming pixel is scaled according to the method defined by the source factor.\n             * @var {x3dom.fields.SFString} srcFactor\n             * @range [none, zero, one, dst_color, src_color, one_minus_dst_color, one_minus_src_color, src_alpha, one_minus_src_alpha, dst_alpha, one_minus_dst_alpha, src_alpha_saturate, constant_color, one_minus_constant_color, constant_alpha, one_minus_constant_alpha]\n             * @memberof x3dom.nodeTypes.BlendMode\n             * @initvalue \"src_alpha\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'srcFactor', \"src_alpha\");\n\n            /**\n             * The frame buffer pixel is scaled according to the method defined by the destination factor.\n             * @var {x3dom.fields.SFString} destFactor\n             * @range [none, zero, one, dst_color, src_color, one_minus_dst_color, one_minus_src_color, src_alpha, one_minus_src_alpha, dst_alpha, one_minus_dst_alpha, src_alpha_saturate, constant_color, one_minus_constant_color, constant_alpha, one_minus_constant_alpha]\n             * @memberof x3dom.nodeTypes.BlendMode\n             * @initvalue \"one_minus_src_alpha\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'destFactor', \"one_minus_src_alpha\");\n\n            /**\n             * This is the constant color used by blend modes constant.\n             * @var {x3dom.fields.SFColor} color\n             * @memberof x3dom.nodeTypes.BlendMode\n             * @initvalue 1,1,1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFColor(ctx, 'color', 1, 1, 1);\n\n            /**\n             * This is the constant alpha used by blend modes constant.\n             * @var {x3dom.fields.SFFloat} colorTransparency\n             * @memberof x3dom.nodeTypes.BlendMode\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'colorTransparency', 0);\n\n            /**\n             *\n             * @var {x3dom.fields.SFString} alphaFunc\n             * @memberof x3dom.nodeTypes.BlendMode\n             * @initvalue \"none\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'alphaFunc', \"none\");\n\n            /**\n             * The alphaFunc defines how fragments which do not fulfill a certain condition are handled.\n             * @var {x3dom.fields.SFFloat} alphaFuncValue\n             * @range [none, never, less, equal, lequal, greater, notequal, gequal, always]\n             * @memberof x3dom.nodeTypes.BlendMode\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'alphaFuncValue', 0);\n\n            /**\n             * An additional equation used to combine source, destination and the constant value.\n             * @var {x3dom.fields.SFString} equation\n             * @range [none, func_add, func_subtract, func_reverse_subtract, min, max, logic_op]\n             * @memberof x3dom.nodeTypes.BlendMode\n             * @initvalue \"none\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'equation', \"none\");\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### DepthMode ### */\nx3dom.registerNodeType(\n    \"DepthMode\",\n    \"Shape\",\n    defineClass(x3dom.nodeTypes.X3DAppearanceChildNode,\n        \n        /**\n         * Constructor for DepthMode\n         * @constructs x3dom.nodeTypes.DepthMode\n         * @x3d x.x\n         * @component Shape\n         * @extends x3dom.nodeTypes.X3DAppearanceChildNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The depth mode contains the parameters that are specific for depth control, like the value used for depth buffer comparisons.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.DepthMode.superClass.call(this, ctx);\n\n\n            /**\n             * Whether the depth test should be enabled or not.\n             * @var {x3dom.fields.SFBool} enableDepthTest\n             * @memberof x3dom.nodeTypes.DepthMode\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'enableDepthTest', true);\n\n            /**\n             * The depth function to use. If \"none\", it's not changed, the default is \"lequal\".\n             * @var {x3dom.fields.SFString} depthFunc\n             * @range [NONE, NEVER, LESS, EQUAL, LEQUAL, GREATER, NOTEQUAL, GEQUAL, ALWAYS]\n             * @memberof x3dom.nodeTypes.DepthMode\n             * @initvalue \"none\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'depthFunc', \"none\");\n\n            /**\n             * Whether the depth buffer is enabled for writing or not.\n             * @var {x3dom.fields.SFBool} readOnly\n             * @memberof x3dom.nodeTypes.DepthMode\n             * @initvalue false\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'readOnly', false);\n\n            /**\n             * The near value for the depth range. Ignored if less than 0, defaults to -1.\n             * @var {x3dom.fields.SFFloat} zNearRange\n             * @range [0, 1]\n             * @memberof x3dom.nodeTypes.DepthMode\n             * @initvalue -1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'zNearRange', -1);\n\n            /**\n             * The far value for the depth range. Ignored if less than 0, defaults to -1.\n             * @var {x3dom.fields.SFFloat} zFarRange\n             * @range [0, 1]\n             * @memberof x3dom.nodeTypes.DepthMode\n             * @initvalue -1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'zFarRange', -1);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### ColorMaskMode ### */\nx3dom.registerNodeType(\n    \"ColorMaskMode\",\n    \"Shape\",\n    defineClass(x3dom.nodeTypes.X3DAppearanceChildNode,\n        \n        /**\n         * Constructor for ColorMaskMode\n         * @constructs x3dom.nodeTypes.ColorMaskMode\n         * @x3d x.x\n         * @component Shape\n         * @extends x3dom.nodeTypes.X3DAppearanceChildNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The ColorMaskMode node affects drawing in RGBA mode. The 4 masks control whether the corresponding component is written.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.ColorMaskMode.superClass.call(this, ctx);\n\n\n            /**\n             * Masks r color channel.\n             * @var {x3dom.fields.SFBool} maskR\n             * @memberof x3dom.nodeTypes.ColorMaskMode\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'maskR', true);\n\n            /**\n             * Masks g color channel.\n             * @var {x3dom.fields.SFBool} maskG\n             * @memberof x3dom.nodeTypes.ColorMaskMode\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'maskG', true);\n\n            /**\n             * Masks b color channel.\n             * @var {x3dom.fields.SFBool} maskB\n             * @memberof x3dom.nodeTypes.ColorMaskMode\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'maskB', true);\n\n            /**\n             * Masks a color channel.\n             * @var {x3dom.fields.SFBool} maskA\n             * @memberof x3dom.nodeTypes.ColorMaskMode\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'maskA', true);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### LineProperties ### */\nx3dom.registerNodeType(\n    \"LineProperties\",\n    \"Shape\",\n    defineClass(x3dom.nodeTypes.X3DAppearanceChildNode,\n        \n        /**\n         * Constructor for LineProperties\n         * @constructs x3dom.nodeTypes.LineProperties\n         * @x3d 3.3\n         * @component Shape\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DAppearanceChildNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The LineProperties node specifies additional properties to be applied to all line geometry. The colour of the line is specified by the associated Material node.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.LineProperties.superClass.call(this, ctx);\n\n            // http://www.web3d.org/files/specifications/19775-1/V3.2/Part01/components/shape.html#LineProperties\n            // THINKABOUTME: to my mind, the only useful, but missing, field is linewidth (scaleFactor is overhead)\n\n            /**\n             * The linetype and linewidth shall only be applied when the applied field has value TRUE.\n             * When the value of the applied field is FALSE, a solid line of nominal width shall be produced.\n             * @var {x3dom.fields.SFBool} applied\n             * @memberof x3dom.nodeTypes.LineProperties\n             * @initvalue true\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'applied', true);\n\n            /**\n             * The linetype field selects a line pattern.\n             * @var {x3dom.fields.SFInt32} linetype\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.LineProperties\n             * @initvalue 1\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'linetype', 1);\n\n            /**\n             * The linewidthScaleFactor is a multiplicative value that scales a the linewidth. This resulting value shall then be mapped to the nearest available line width. A value less than or equal to zero refers to the minimum available line width.\n             * @var {x3dom.fields.SFFloat} linewidthScaleFactor\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.LineProperties\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'linewidthScaleFactor', 0);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### X3DMaterialNode ### */\nx3dom.registerNodeType(\n    \"X3DMaterialNode\",\n    \"Shape\",\n    defineClass(x3dom.nodeTypes.X3DAppearanceChildNode,\n        \n        /**\n         * Constructor for X3DMaterialNode\n         * @constructs x3dom.nodeTypes.X3DMaterialNode\n         * @x3d 3.3\n         * @component Shape\n         * @status full\n         * @extends x3dom.nodeTypes.X3DAppearanceChildNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc This is the base node type for all Material nodes.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DMaterialNode.superClass.call(this, ctx);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### Material ### */\nx3dom.registerNodeType(\n    \"Material\",\n    \"Shape\",\n    defineClass(x3dom.nodeTypes.X3DMaterialNode,\n        \n        /**\n         * Constructor for Material\n         * @constructs x3dom.nodeTypes.Material\n         * @x3d 3.3\n         * @component Shape\n         * @status full\n         * @extends x3dom.nodeTypes.X3DMaterialNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The Material node specifies surface material properties for associated geometry nodes and is used by the X3D lighting equations during rendering.\n         * All of the fields in the Material node range from 0.0 to 1.0.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Material.superClass.call(this, ctx);\n\n            /**\n             * The ambientIntensity field specifies how much ambient light from light sources this surface shall reflect.\n             * Ambient light is omnidirectional and depends only on the number of light sources, not their positions with respect to the surface.\n             * Ambient colour is calculated as ambientIntensity × diffuseColor.\n             * @var {x3dom.fields.SFFloat} ambientIntensity\n             * @range [0, 1]\n             * @memberof x3dom.nodeTypes.X3DMaterialNode\n             * @initvalue 0.2\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'ambientIntensity', 0.2);\n\n            /**\n             * The diffuseColor field reflects all X3D light sources depending on the angle of the surface with respect to the light source.\n             * The more directly the surface faces the light, the more diffuse light reflects.\n             * The emissiveColor field models \"glowing\" objects.\n             * This can be useful for displaying pre-lit models (where the light energy of the room is computed explicitly), or for displaying scientific data.\n             * @var {x3dom.fields.SFColor} diffuseColor\n             * @memberof x3dom.nodeTypes.X3DMaterialNode\n             * @initvalue 0.8,0.8,0.8\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFColor(ctx, 'diffuseColor', 0.8, 0.8, 0.8);\n\n            /**\n             * The emissiveColor field models \"glowing\" objects.\n             * This can be useful for displaying pre-lit models (where the light energy of the room is computed explicitly), or for displaying scientific data.\n             * @var {x3dom.fields.SFColor} emissiveColor\n             * @memberof x3dom.nodeTypes.X3DMaterialNode\n             * @initvalue 0,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFColor(ctx, 'emissiveColor', 0, 0, 0);\n\n            /**\n             * The specularColor and shininess fields determine the specular highlights (e.g., the shiny spots on an apple).\n             * When the angle from the light to the surface is close to the angle from the surface to the viewer, the specularColor is added to the diffuse and ambient colour calculations.\n             * Lower shininess values produce soft glows, while higher values result in sharper, smaller highlights.\n             * @var {x3dom.fields.SFFloat} shininess\n             * @range [0, 1]\n             * @memberof x3dom.nodeTypes.X3DMaterialNode\n             * @initvalue 0.2\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'shininess', 0.2);\n\n            /**\n             * The specularColor and shininess fields determine the specular highlights (e.g., the shiny spots on an apple).\n             * When the angle from the light to the surface is close to the angle from the surface to the viewer, the specularColor is added to the diffuse and ambient colour calculations.\n             * Lower shininess values produce soft glows, while higher values result in sharper, smaller highlights.\n             * @var {x3dom.fields.SFColor} specularColor\n             * @memberof x3dom.nodeTypes.X3DMaterialNode\n             * @initvalue 0,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFColor(ctx, 'specularColor', 0, 0, 0);\n\n            /**\n             * The transparency field specifies how \"clear\" an object is, with 1.0 being completely transparent, and 0.0 completely opaque.\n             * @var {x3dom.fields.SFFloat} transparency\n             * @range [0, 1]\n             * @memberof x3dom.nodeTypes.X3DMaterialNode\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'transparency', 0);\n        \n        },\n        {\n            fieldChanged: function(fieldName) {\n                if (fieldName == \"ambientIntensity\" || fieldName == \"diffuseColor\" ||\n                    fieldName == \"emissiveColor\" || fieldName == \"shininess\" ||\n                    fieldName == \"specularColor\" || fieldName == \"transparency\")\n                {\n                    Array.forEach(this._parentNodes, function (app) {\n                        Array.forEach(app._parentNodes, function (shape) {\n                            shape._dirty.material = true;\n                        });\n                        app.checkSortType();\n                    });\n                }\n            }\n        }\n    )\n);\n\nx3dom.nodeTypes.Material.defaultNode = function() {\n    if (!x3dom.nodeTypes.Material._defaultNode) {\n        x3dom.nodeTypes.Material._defaultNode = new x3dom.nodeTypes.Material();\n        x3dom.nodeTypes.Material._defaultNode.nodeChanged();\n    }\n    return x3dom.nodeTypes.Material._defaultNode;\n};\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### TwoSidedMaterial ### */\nx3dom.registerNodeType(\n    \"TwoSidedMaterial\",\n    \"Shape\",\n    defineClass(x3dom.nodeTypes.Material,\n        \n        /**\n         * Constructor for TwoSidedMaterial\n         * @constructs x3dom.nodeTypes.TwoSidedMaterial\n         * @x3d 3.3\n         * @component Shape\n         * @status full\n         * @extends x3dom.nodeTypes.X3DMaterialNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc This node defines material properties that can effect both the front and back side of a polygon individually.\n         * These materials are used for both the front and back side of the geometry whenever the X3D lighting model is active.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.TwoSidedMaterial.superClass.call(this, ctx);\n\n\n            /**\n             * Defines the ambient intensity for the back side.\n             * @var {x3dom.fields.SFFloat} backAmbientIntensity\n             * @range [0, 1]\n             * @memberof x3dom.nodeTypes.TwoSidedMaterial\n             * @initvalue 0.2\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'backAmbientIntensity', 0.2);\n\n            /**\n             * Defines the diffuse color for the back side.\n             * @var {x3dom.fields.SFColor} backDiffuseColor\n             * @memberof x3dom.nodeTypes.TwoSidedMaterial\n             * @initvalue 0.8,0.8,0.8\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFColor(ctx, 'backDiffuseColor', 0.8, 0.8, 0.8);\n\n            /**\n             * Defines the emissive color for the back side.\n             * @var {x3dom.fields.SFColor} backEmissiveColor\n             * @memberof x3dom.nodeTypes.TwoSidedMaterial\n             * @initvalue 0,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFColor(ctx, 'backEmissiveColor', 0, 0, 0);\n\n            /**\n             * Defines the shininess for the back side.\n             * @var {x3dom.fields.SFFloat} backShininess\n             * @range [0, 1]\n             * @memberof x3dom.nodeTypes.TwoSidedMaterial\n             * @initvalue 0.2\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'backShininess', 0.2);\n\n            /**\n             * Defines the specular color for the back side.\n             * @var {x3dom.fields.SFColor} backSpecularColor\n             * @memberof x3dom.nodeTypes.TwoSidedMaterial\n             * @initvalue 0,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFColor(ctx, 'backSpecularColor', 0, 0, 0);\n\n            /**\n             * Defines the transparency for the back side.\n             * @var {x3dom.fields.SFFloat} backTransparency\n             * @range [0, 1]\n             * @memberof x3dom.nodeTypes.TwoSidedMaterial\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'backTransparency', 0);\n\n            /**\n             * If the separateBackColor field is set to TRUE, the rendering shall render the front and back faces of the geometry with different values.\n             * If the value is FALSE, the front colours are used for both the front and back side of the polygon, as per the existing X3D lighting rules.\n             * @var {x3dom.fields.SFBool} separateBackColor\n             * @memberof x3dom.nodeTypes.TwoSidedMaterial\n             * @initvalue false\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'separateBackColor', false);\n        \n        },\n        {\n            fieldChanged: function(fieldName) {\n                if (fieldName == \"ambientIntensity\" || fieldName == \"diffuseColor\" ||\n                    fieldName == \"emissiveColor\" || fieldName == \"shininess\" ||\n                    fieldName == \"specularColor\" || fieldName == \"transparency\" ||\n                    fieldName == \"backAmbientIntensity\" || fieldName == \"backDiffuseColor\" ||\n                    fieldName == \"backEmissiveColor\" || fieldName == \"backShininess\" ||\n                    fieldName == \"backSpecularColor\" || fieldName == \"backTransparency\" ||\n                    fieldName == \"separateBackColor\")\n                {\n                    Array.forEach(this._parentNodes, function (app) {\n                        Array.forEach(app._parentNodes, function (shape) {\n                            shape._dirty.material = true;\n                        });\n                        app.checkSortType();\n                    });\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### PhysicalMaterial ### */\nx3dom.registerNodeType(\n    \"PhysicalMaterial\",\n    \"Shape\",\n    defineClass(x3dom.nodeTypes.X3DMaterialNode,\n        \n        /**\n         * Constructor for X3DMaterialNode\n         * @constructs x3dom.nodeTypes.PhysicalMaterial\n         * @x3d x.x\n         * @component Shape\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DMaterialNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc This is the base node type for all Material nodes.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DMaterialNode.superClass.call(this, ctx);\n\n            /**\n             * The material model used. Valid values are \"roughnessMetallic\" and \"specularGlossiness\".\n             * @var {x3dom.fields.SFString} model\n             * @memberof x3dom.nodeTypes.PhysicalMaterial\n             * @initvalue roughnessMetallic\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'model', \"roughnessMetallic\");\n\n            /**\n             * The RGBA components of the base color of the material. The fourth component (A) is the \n             * alpha coverage of the material. The `alphaMode` property specifies how alpha is interpreted. \n             * These values are linear. If a baseColorTexture is specified, \n             * this value is multiplied with the texel values.\n             * @var {x3dom.fields.SFColor} baseColorFactor\n             * @memberof x3dom.nodeTypes.PhysicalMaterial\n             * @initvalue 1,1,1,1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFColorRGBA(ctx, 'baseColorFactor', 1, 1, 1, 1);\n\n            /**\n             * The metalness of the material. A value of 1.0 means the material is a metal.\n             * A value of 0.0 means the material is a dielectric. Values in between are for blending\n             * between metals and dielectrics such as dirty metallic surfaces. This value is linear.\n             * If a roughnessMetallicTexture is specified, this value is multiplied with\n             * the metallic texel values.\n             * @var {x3dom.fields.SFFloat} metallicFactor\n             * @range [0, 1]\n             * @memberof x3dom.nodeTypes.PhysicalMaterial\n             * @initvalue 0.0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'metallicFactor', 0);\n\n            /**\n             * The roughness of the material. A value of 1.0 means the material is completely rough. \n             * A value of 0.0 means the material is completely smooth. This value is linear. \n             * If a roughnessMetallicTexture is specified, this value is multiplied with \n             * the roughness texel values.\n             * @var {x3dom.fields.SFFloat} roughnessFactor\n             * @range [0, 1]\n             * @memberof x3dom.nodeTypes.PhysicalMaterial\n             * @initvalue 0.2\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'roughnessFactor', 0.2);\n\n            /**\n             * The RGBA components of the reflected diffuse color of the material used in the spec.-gloss. model.\n             * Metals have a diffuse value of '0.0, 0.0, 0.0'. The fourth component (A) is the opacity of the material.\n             * The values are linear.\n             * @var {x3dom.fields.SFColor} diffuseFactor\n             * @memberof x3dom.nodeTypes.PhysicalMaterial\n             * @initvalue 1,1,1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFColorRGBA(ctx, 'diffuseFactor', 1, 1, 1, 1);\n\n            /**\n             * The specular RGB color of the material used in the spec.-gloss. model. This value is linear.\n             * @var {x3dom.fields.SFColor} specularFactor\n             * @memberof x3dom.nodeTypes.PhysicalMaterial\n             * @initvalue 1,1,1\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFColor(ctx, 'specularFactor', 1, 1, 1);\n\n            /**\n             * The glossiness or smoothness of the material used in the spec.-gloss. model.\n             * A value of 1.0 means the material has full glossiness or is perfectly smooth.\n             * A value of 0.0 means the material has no glossiness or is perfectly rough. This value is linear.\n             * @var {x3dom.fields.SFFloat} glossinessFactor\n             * @range [0, 1]\n             * @memberof x3dom.nodeTypes.PhysicalMaterial\n             * @initvalue 1\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'glossinessFactor', 1);\n\n            /**\n             * The RGB components of the emissive color of the material. These values are linear.\n             * If an emissiveTexture is specified, this value is multiplied with the texel values.\n             * @var {x3dom.fields.SFColor} emissiveFactor\n             * @memberof x3dom.nodeTypes.PhysicalMaterial\n             * @initvalue 0,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFColor(ctx, 'emissiveFactor', 0, 0, 0);\n\n            /**\n             * Space in which normals of the normalTexture are defined. Valid values are \"TANGENT\" and \"OBJECT\".\n             * @var {x3dom.fields.SFString} normalSpace\n             * @memberof x3dom.nodeTypes.PhysicalMaterial\n             * @initvalue 'TANGENT'\n             * @range [TANGENT, OBJECT]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'normalSpace', 'TANGENT');\n\n            /**\n             * The material's alpha rendering mode enumeration specifying the interpretation \n             * of the alpha value of the main factor and texture.\n             * @var {x3dom.fields.SFString} alphaMode\n             * @memberof x3dom.nodeTypes.PhysicalMaterial\n             * @initvalue 'OPAQUE'\n             * @range [OPAQUE, BLEND, MASK]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'alphaMode', 'OPAQUE');\n\n            /**\n             * Specifies the cutoff threshold when in `MASK` alpha mode. \n             * If the alpha value is greater than or equal to this value then \n             * it is rendered as fully opaque, otherwise, it is rendered as fully transparent. \n             * A value greater than 1.0 will render the entire material as fully transparent. \n             * This value is ignored for other modes.\n             * @var {x3dom.fields.SFFloat} alphaCutoff\n             * @range [0, 1]\n             * @memberof x3dom.nodeTypes.PhysicalMaterial\n             * @initvalue 0.5\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'alphaCutoff', 0.5);\n\n            /**\n             * Bias to apply to normal sampled from normalTexture\n             * @var {x3dom.fields.SFVec3f} normalBias\n             * @memberof x3dom.nodeTypes.PhysicalMaterial\n             * @initvalue -1,-1, 1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'normalBias', -1, -1, 1);\n\n            /**\n             * Scale to apply to normal sampled from normalTexture. NYI\n             * @var {x3dom.fields.SFVec3f} normalScale\n             * @memberof x3dom.nodeTypes.PhysicalMaterial\n             * @initvalue 1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'normalScale', 1);\n\n            /**\n             * Set the material to unlit\n             * Final color is the product of baseColorFactor, baseColorTexture, and vertex color (if any)\n             * @var {x3dom.fields.SFBool} unlit\n             * @memberof x3dom.nodeTypes.PhysicalMaterial\n             * @initvalue false\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'unlit', false);\n\n            /**\n             * The base color texture in the met. rough. model. This texture contains RGB(A) components in sRGB color space. \n             * The first three components (RGB) specify the base color of the material. \n             * If the fourth component (A) is present, it represents the alpha coverage of the material. \n             * Otherwise, an alpha of 1.0 is assumed. The `alphaMode` property specifies \n             * how alpha is interpreted. The stored texels must not be premultiplied.\n             * @var {x3dom.nodeTypes.X3DTextureNode} baseColorTexture\n             * @memberof x3dom.nodeTypes.PhysicalMaterial\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('baseColorTexture', x3dom.nodeTypes.X3DTextureNode);\n\n            /**\n             * The emissive map controls the color and intensity of the light being emitted by the material.\n             * This texture contains RGB components in sRGB color space.\n             * If a fourth component (A) is present, it is ignored.\n             * @var {x3dom.nodeTypes.X3DTextureNode} emissiveTexture\n             * @memberof x3dom.nodeTypes.PhysicalMaterial\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('emissiveTexture', x3dom.nodeTypes.X3DTextureNode);\n\n            /**\n             * The metallic-roughness texture. The metalness values are sampled from the B channel.\n             * The roughness values are sampled from the G channel. These values are linear.\n             * If other channels are present (R or A), they are ignored for metallic-roughness calculations.\n             * @var {x3dom.nodeTypes.X3DTextureNode} roughnessMetallicTexture\n             * @memberof x3dom.nodeTypes.PhysicalMaterial\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('roughnessMetallicTexture', x3dom.nodeTypes.X3DTextureNode);\n\n            /**\n             * The specular-glossiness texture is a RGBA texture, containing the specular color (RGB) in sRGB space\n             * and the glossiness value (A) in linear space.\n             * @var {x3dom.nodeTypes.X3DTextureNode} specularGlossinessTexture\n             * @memberof x3dom.nodeTypes.PhysicalMaterial\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('specularGlossinessTexture', x3dom.nodeTypes.X3DTextureNode);\n\n            /**\n             * Specifies a texture with the packing Occlusion (R), Roughness (G), Metallic (B)\n             * @var {x3dom.nodeTypes.X3DTextureNode} occlusionRoughnessMetallic\n             * @memberof x3dom.nodeTypes.PhysicalMaterial\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('occlusionRoughnessMetallicTexture', x3dom.nodeTypes.X3DTextureNode);\n\n            /**\n             * A tangent space normal map. The texture contains RGB components in linear space. \n             * Each texel represents the XYZ components of a normal vector in tangent space. \n             * Red [0 to 255] maps to X [-1 to 1]. Green [0 to 255] maps to Y [-1 to 1]. \n             * Blue [128 to 255] maps to Z [1/255 to 1]. The normal vectors use OpenGL conventions \n             * where +X is right and +Y is up. +Z points toward the viewer. In GLSL, \n             * this vector would be unpacked like so: \n             * `float3 normalVector = tex2D(<sampled normal map texture value>, texCoord) * 2 - 1`. \n             * Client implementations should normalize the normal vectors before using them in lighting equations.\n             * @var {x3dom.nodeTypes.X3DTextureNode} normalTexture\n             * @memberof x3dom.nodeTypes.PhysicalMaterial\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('normalTexture', x3dom.nodeTypes.X3DTextureNode);\n\n            /**\n             * The occlusion map texture. The occlusion values are sampled from the R channel. \n             * Higher values indicate areas that should receive full indirect lighting and lower \n             * values indicate no indirect lighting. These values are linear. If other channels \n             * are present (GBA), they are ignored for occlusion calculations.\n             * @var {x3dom.nodeTypes.X3DTextureNode} occlusionTexture\n             * @memberof x3dom.nodeTypes.PhysicalMaterial\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('occlusionTexture', x3dom.nodeTypes.X3DTextureNode);        \n        },\n        {\n            fieldChanged: function(fieldName)\n            {\n                if (fieldName == \"baseColorFactor\" || fieldName == \"metallicFactor\" ||\n                    fieldName == \"roughnessFactor\" || fieldName == \"emissiveFactor\")\n                {\n                    Array.forEach(this._parentNodes, function (app) {\n                        Array.forEach(app._parentNodes, function (shape) {\n                            shape._dirty.material = true;\n                        });\n                        app.checkSortType();\n                    });\n                }\n\n                if (fieldName == \"alphaMode\")\n                {\n                    Array.forEach(this._parentNodes, function (app) {\n                        Array.forEach(app._parentNodes, function (shape) {\n                            shape._dirty.shader = true;\n                        });\n                        app.checkSortType();\n                    });\n                }\n            },\n\n            hasTextures: function()\n            {\n                return (this._cf.baseColorTexture.node ||\n                        this._cf.normalTexture.node    ||\n                        this._cf.occlusionTexture.node ||\n                        this._cf.emissiveTexture.node  ||\n                        this._cf.roughnessMetallicTexture.node);\n            },\n\n            getTextures: function()\n            {\n                var textures = [];\n\n                if(this._cf.baseColorTexture.node)\n                {\n                    this._cf.baseColorTexture.node._type = \"diffuseMap\";\n\n                    textures.push(this._cf.baseColorTexture.node);\n                }\n\n                if(this._cf.normalTexture.node)\n                {\n                    this._cf.normalTexture.node._type = \"normalMap\";\n\n                    textures.push(this._cf.normalTexture.node);\n                }\n\n                if(this._cf.occlusionTexture.node)\n                {\n                    this._cf.occlusionTexture.node._type = \"occlusionMap\";\n\n                    textures.push(this._cf.occlusionTexture.node);\n                }\n\n                if(this._cf.emissiveTexture.node)\n                {\n                    this._cf.emissiveTexture.node._type = \"emissiveMap\";\n\n                    textures.push(this._cf.emissiveTexture.node);\n                }\n\n                if(this._cf.roughnessMetallicTexture.node)\n                {\n                    this._cf.roughnessMetallicTexture.node._type = \"roughnessMetallicMap\";\n\n                    textures.push(this._cf.roughnessMetallicTexture.node);\n                }\n\n                if(this._cf.specularGlossinessTexture.node)\n                {\n                    this._cf.specularGlossinessTexture.node._type = \"specularGlossinessMap\";\n\n                    textures.push(this._cf.specularGlossinessTexture.node);\n                }\n\n                if(this._cf.occlusionRoughnessMetallicTexture.node)\n                {\n                    this._cf.occlusionRoughnessMetallicTexture.node._type = \"occlusionRoughnessMetallicMap\";\n\n                    textures.push(this._cf.occlusionRoughnessMetallicTexture.node);\n                }\n\n\n                return textures;\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### X3DShapeNode ### */\nx3dom.registerNodeType(\n    \"X3DShapeNode\",\n    \"Shape\",\n    defineClass(x3dom.nodeTypes.X3DBoundedObject,\n        \n        /**\n         * Constructor for X3DShapeNode\n         * @constructs x3dom.nodeTypes.X3DShapeNode\n         * @x3d 3.3\n         * @component Shape\n         * @status full\n         * @extends x3dom.nodeTypes.X3DBoundedObject\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc This is the base node type for all Shape nodes.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DShapeNode.superClass.call(this, ctx);\n\n\n            /**\n             * Defines whether the shape is pickable.\n             * @var {x3dom.fields.SFBool} isPickable\n             * @memberof x3dom.nodeTypes.X3DShapeNode\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'isPickable', true);\n\n            /**\n             * Holds the id offset for MultiPart picking.\n             * @var {x3dom.fields.SFInt32} isPickable\n             * @memberof x3dom.nodeTypes.X3DShapeNode\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'idOffset', 0);\n\n            /**\n             * Holds the appearance node.\n             * @var {x3dom.fields.SFNode} appearance\n             * @memberof x3dom.nodeTypes.X3DShapeNode\n             * @initvalue x3dom.nodeTypes.X3DAppearanceNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('appearance', x3dom.nodeTypes.X3DAppearanceNode);\n\n            /**\n             * Holds the geometry node.\n             * @var {x3dom.fields.SFNode} geometry\n             * @memberof x3dom.nodeTypes.X3DShapeNode\n             * @initvalue x3dom.nodeTypes.X3DGeometryNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('geometry', x3dom.nodeTypes.X3DGeometryNode);\n\n            this._objectID = 0;\n            this._shaderProperties = null;\n            this._clipPlanes = [];\n\n            // in WebGL-based renderer a clean-up function is attached\n            this._cleanupGLObjects = null;\n\n            this._dirty = {\n                positions: true,\n                normals: true,\n                texcoords: true,\n                colors: true,\n                tangents: true,\n                binormals : true,\n                specialAttribs: true,   // e.g., particleSize, IDs,...\n                indexes: true,\n                texture: true,\n                material: true,\n                text: true,\n                shader: true,\n                ids: true\n            };\n\n            // FIXME; move somewhere else and allow generic values!!!\n            this._indexOffset =0;\n            this._coordStrideOffset = [0, 0];\n            this._normalStrideOffset = [0, 0];\n            this._texCoordStrideOffset = [0, 0];\n            this._texCoord2StrideOffset = [0, 0];\n            this._colorStrideOffset = [0, 0];\n            this._idStrideOffset = [0, 0];\n            this._tangentStrideOffset = [0, 0];\n            this._binormalStrideOffset = [0, 0];\n\n            this._tessellationProperties = [];\n        },\n        {\n            collectDrawableObjects: function (transform, drawableCollection, singlePath, invalidateCache, planeMask, clipPlanes)\n            {\n                // attention, in contrast to other collectDrawableObjects()\n                // this one has boolean return type to better work with RSG\n                var graphState = this.graphState();\n\n                if (singlePath && (this._parentNodes.length > 1))\n                    singlePath = false;\n\n                if (singlePath && (invalidateCache = invalidateCache || this.cacheInvalid()))\n                    this.invalidateCache();\n\n                if (!this._cf.geometry.node ||\n                    drawableCollection.cull(transform, graphState, singlePath, planeMask) <= 0) {\n                    return false;\n                }\n\n                if (singlePath && !this._graph.globalMatrix)\n                    this._graph.globalMatrix = transform;\n\n                if (this._clipPlanes.length != clipPlanes.length)\n                {\n                    this._dirty.shader = true;\n                }\n\n                this._clipPlanes = clipPlanes;\n\n                drawableCollection.addShape(this, transform, graphState);\n\n                return true;\n            },\n\n            getVolume: function()\n            {\n                var vol = this._graph.volume;\n\n                if (!this.volumeValid() && this._vf.render)\n                {\n                    var geo = this._cf.geometry.node;\n                    var childVol = geo ? geo.getVolume() : null;\n\n                    if (childVol && childVol.isValid())\n                        vol.extendBounds(childVol.min, childVol.max);\n                }\n\n                return vol;\n            },\n\n            getCenter: function() {\n                var geo = this._cf.geometry.node;\n                return (geo ? geo.getCenter() : new x3dom.fields.SFVec3f(0,0,0));\n            },\n\n            getDiameter: function() {\n                var geo = this._cf.geometry.node;\n                return (geo ? geo.getDiameter() : 0);\n            },\n\n            doIntersect: function(line) {\n                return this._cf.geometry.node.doIntersect(line);\n            },\n\n            forceUpdateCoverage: function()\n            {\n                var geo = this._cf.geometry.node;\n                return (geo ? geo.forceUpdateCoverage() : false);\n            },\n\n            tessellationProperties: function()\n            {\n                // some geometries require offset and count into index array\n                var geo = this._cf.geometry.node;\n                if (geo && geo._indexOffset)\n                    return geo._indexOffset;      // IndexedTriangleStripSet\n                else\n                    return this._tessellationProperties; // BVHRefiner-Patch\n            },\n\n            isLit: function() {\n                return this._cf.geometry.node._vf.lit;\n            },\n\n            isSolid: function() {\n                var twoSidedMat = (this._cf.appearance.node && this._cf.appearance.node._cf.material.node &&\n                                   x3dom.isa(this._cf.appearance.node._cf.material.node, x3dom.nodeTypes.TwoSidedMaterial));\n                return this._cf.geometry.node._vf.solid && !twoSidedMat;\n            },\n\n            isCCW: function() {\n                return this._cf.geometry.node._vf.ccw;\n            },\n\n            parentRemoved: function(parent) {\n                for (var i=0, n=this._childNodes.length; i<n; i++) {\n                    var child = this._childNodes[i];\n                    if (child) {\n                        child.parentRemoved(this);\n                    }\n                }\n\n                if (parent)\n                    parent.invalidateVolume();\n                if (this._parentNodes.length > 0)\n                    this.invalidateVolume();\n\n                // Cleans all GL objects for WebGL-based renderer\n                if (this._cleanupGLObjects) {\n                    this._cleanupGLObjects();\n                }\n            },\n\n            unsetDirty: function () {\n                // vertex attributes\n                this._dirty.positions = false;\n                this._dirty.normals = false;\n                this._dirty.texcoords = false;\n                this._dirty.colors = false;\n                this._dirty.tangents = false;\n                this._dirty.binormals = false;\n                this._dirty.specialAttribs = false;\n                // indices/topology\n                this._dirty.indexes = false;\n                // appearance properties\n                this._dirty.texture = false;\n                this._dirty.material = false;\n                this._dirty.text = false;\n                this._dirty.shader = false;\n            },\n\n            unsetGeoDirty: function () {\n                this._dirty.positions = false;\n                this._dirty.normals = false;\n                this._dirty.texcoords = false;\n                this._dirty.colors = false;\n                this._dirty.tangents = false;\n                this._dirty.binormals = false;\n                this._dirty.specialAttribs = false;\n                this._dirty.indexes = false;\n            },\n\n            setAllDirty: function () {\n                // vertex attributes\n                this._dirty.positions = true;\n                this._dirty.normals = true;\n                this._dirty.texcoords = true;\n                this._dirty.colors = true;\n                this._dirty.tangents = true;\n                this._dirty.binormals = true;\n                this._dirty.specialAttribs = true;\n                // indices/topology\n                this._dirty.indexes = true;\n                // appearance properties\n                this._dirty.texture = true;\n                this._dirty.material = true;\n                this._dirty.text = true;\n                this._dirty.shader = true;\n                // finally invalidate volume\n                this.invalidateVolume();\n            },\n\n            setAppDirty: function () {\n                // appearance properties\n                this._dirty.texture = true;\n                this._dirty.material = true;\n                //this._dirty.text = true;\n                this._dirty.shader = true;\n            },\n\n            setGeoDirty: function () {\n                this._dirty.positions = true;\n                this._dirty.normals = true;\n                this._dirty.texcoords = true;\n                this._dirty.colors = true;\n                this._dirty.tangents = true;\n                this._dirty.binormals = true;\n                this._dirty.specialAttribs = true;\n                this._dirty.indexes = true;\n                // finally invalidate volume\n                this.invalidateVolume();\n            },\n\n            getShaderProperties: function(viewarea)\n            {\n                if (this._shaderProperties == null ||\n                    this._dirty.shader == true ||\n                    x3dom.Utils.checkDirtyEnvironment(viewarea, this._shaderProperties) ||\n                    x3dom.Utils.checkDirtyPhysicalEnvironmentLight (viewarea, this._shaderProperties) ||\n                    (this._webgl !== undefined &&\n                     this._webgl.dirtyLighting != x3dom.Utils.checkDirtyLighting(viewarea) ))\n                {\n                    this._shaderProperties = x3dom.Utils.generateProperties(viewarea, this);\n                    this._dirty.shader = false;\n                    if (this._webgl !== undefined)\n                    {\n                        this._webgl.dirtyLighting = x3dom.Utils.checkDirtyLighting(viewarea);\n                    }\n                }\n                return this._shaderProperties;\n            },\n\n            getTextures: function() {\n                var textures = [];\n\n                var appearance = this._cf.appearance.node;\n                if (appearance) {\n                    var tex = appearance._cf.texture.node;\n                    if(tex) {\n                        if(x3dom.isa(tex, x3dom.nodeTypes.MultiTexture)) {\n                            textures = textures.concat(tex.getTextures());\n                        }\n                        else {\n                            textures.push(tex);\n                        }\n                    }\n\n                    var shader = appearance._cf.shaders.nodes[0];\n                    if(shader) {\n                        if(x3dom.isa(shader, x3dom.nodeTypes.CommonSurfaceShader)) {\n                            textures = textures.concat(shader.getTextures());\n                        }\n                    }\n\n                    var material = appearance._cf.material.node;\n                    if(material) {\n                        if(x3dom.isa(material, x3dom.nodeTypes.PhysicalMaterial)) {\n                            textures = textures.concat(material.getTextures());\n                        }\n                    }\n                }\n\n                var geometry = this._cf.geometry.node;\n                if (geometry) {\n                    if(x3dom.isa(geometry, x3dom.nodeTypes.ImageGeometry)) {\n                        textures = textures.concat(geometry.getTextures());\n                    }\n                    else if(x3dom.isa(geometry, x3dom.nodeTypes.Text)) {\n                        textures = textures.concat(geometry);\n                    }\n                }\n\n                return textures;\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### Shape ### */\nx3dom.registerNodeType(\n    \"Shape\",\n    \"Shape\",\n    defineClass(x3dom.nodeTypes.X3DShapeNode,\n        \n        /**\n         * Constructor for Shape\n         * @constructs x3dom.nodeTypes.Shape\n         * @x3d 3.3\n         * @component Shape\n         * @status full\n         * @extends x3dom.nodeTypes.X3DShapeNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The Shape node has two fields, appearance and geometry, that are used to create rendered objects in the world.\n         * The appearance field contains an Appearance node that specifies the visual attributes (e.g., material and texture) to be applied to the geometry.\n         * The geometry field contains a geometry node. The specified geometry node is rendered with the specified appearance nodes applied.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Shape.superClass.call(this, ctx);\n        \n        },\n        {\n            nodeChanged: function () {\n                //TODO delete this if all works fine\n                if (!this._cf.appearance.node) {\n                    //Unlit\n                    //this.addChild(x3dom.nodeTypes.Appearance.defaultNode());\n                }\n                if (!this._cf.geometry.node) {\n                    if (this._DEF)\n                        x3dom.debug.logError(\"No geometry given in Shape/\" + this._DEF);\n                }\n                else if (!this._objectID) {\n                    this._objectID = ++x3dom.nodeTypes.Shape.objectID;\n                    x3dom.nodeTypes.Shape.idMap.nodeID[this._objectID] = this;\n                }\n                this.setAllDirty();\n            }\n        }\n    )\n);\n\n/** Static class ID counter (needed for caching) */\nx3dom.nodeTypes.Shape.shaderPartID = 0;\n\n/** Static class ID counter (needed for picking) */\nx3dom.nodeTypes.Shape.objectID = 0;\n\n/** Map for Shape node IDs (needed for picking) */\nx3dom.nodeTypes.Shape.idMap = {\n    nodeID: {},\n    remove: function(obj) {\n        for (var prop in this.nodeID) {\n            if (this.nodeID.hasOwnProperty(prop)) {\n                var val = this.nodeID[prop];\n                if (val._objectID  && obj._objectID &&\n                    val._objectID === obj._objectID)\n                {\n                    delete this.nodeID[prop];\n                    x3dom.debug.logInfo(\"Unreg \" + val._objectID);\n                    // FIXME; handle node removal to unreg from map,\n                    // and put free'd ID back to ID pool for reuse\n                }\n            }\n        }\n    }\n};\n\n/** @namespace x3dom.nodeTypes */\n/**\n * Created by Sven Kluge on 27.06.2016.\n */\nx3dom.registerNodeType(\n    \"ExternalShape\",\n    \"Shape\",\n    defineClass(x3dom.nodeTypes.X3DShapeNode,\n\n        /**\n         * Constructor for ExternalShape\n         * @constructs x3dom.nodeTypes.ExternalShape\n         * @x3d 3.3\n         * @component Shape\n         * @status full\n         * @extends x3dom.nodeTypes.X3DShapeNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc\n         */\n        function (ctx) {\n            x3dom.nodeTypes.ExternalShape.superClass.call(this, ctx);\n\n            /**\n             * Defines the url to the openGL Transfer Format (glTF) file.\n             * A suffix with a leading # can be used to reference single meshes inside a SRC: \"path/to/data.src#mesh0\".\n             * Multiple urls specify alternatives (if downloading fails).\n             *\n             * @var {x3dom.fields.MFString} url\n             * @memberof x3dom.nodeTypes.ExternalGeometry\n             * @initvalue []\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFString(ctx, 'url', []);\n\n            this._currentURLIdx = 0;\n            this._cf.geometry.node = new x3dom.nodeTypes.X3DSpatialGeometryNode(ctx);\n            this.loaded = false;\n        },\n        {\n            update: function(shape, shaderProgram, gl, viewarea, context) {\n                var that = this;\n\n                if (this._vf['url'].length == 0 ||\n                    this._currentURLIdx >= this._vf['url'].length)\n                {\n                    return;\n                }\n                \n                var url = this._nameSpace.getURL(this._vf['url'][this._currentURLIdx]);\n                \n                var encoding = ( url.indexOf(\"glb\") != -1 ) ? \"binary\" : \"ascii\";\n                \n                var baseURL = this._nameSpace.baseURL;\n                \n                var index = url.lastIndexOf(\"/\");\n                \n                if( index != -1 )\n                {\n                    baseURL += url.substr(0, index + 1);\n                }\n                \n\n                var xhr = new XMLHttpRequest();\n\n                xhr.open(\"GET\", this._nameSpace.getURL(this._vf['url'][this._currentURLIdx]), true);\n\n                xhr.responseType = ( encoding == \"binary\" ) ? \"arraybuffer\" : \"json\";\n\n                xhr.send(null);\n\n                xhr.onerror = function() {\n                    x3dom.debug.logError(\"Unable to load SRC data from URL \\\"\" + that._vf['url'][that._currentURLIdx] + \"\\\"\");\n                };\n\n                xhr.onload = function() {\n\n                    if ((xhr.status == 200 || xhr.status == 0)) {\n                        \n                        var glTF = new x3dom.glTF.glTFLoader(false, encoding, baseURL);\n                        \n                        glTF.load(xhr.response, function()\n                        {\n                            if (glTF.header.sceneLength > 0)\n                            {\n                                that.glTF = glTF;\n\n                                var url = that._vf['url'][that._currentURLIdx];\n                                if(url.includes('#'))\n                                {\n                                    var split = url.split('#');\n                                    var meshName = split[split.length-1];\n                                    glTF.getMesh(shape, shaderProgram, gl, meshName);\n                                }\n                                else\n                                {\n                                    glTF.getScene(shape, shaderProgram, gl);\n                                }\n\n                                for(var key in glTF._mesh){\n                                    if(!glTF._mesh.hasOwnProperty(key))continue;\n                                    that._cf.geometry.node._mesh[key] = glTF._mesh[key];\n                                }\n\n                            }\n                            else\n                            {\n                                if ((that._currentURLIdx + 1) < that._vf['url'].length)\n                                {\n                                    x3dom.debug.logWarning(\"Invalid SRC data, loaded from URL \\\"\" +\n                                        that._vf['url'][that._currentURLIdx] +\n                                        \"\\\", trying next specified URL\");\n\n                                    //try next URL\n                                    ++that._currentURLIdx;\n                                    that.update(shape, shaderProgram, gl, viewarea, context);\n                                }\n                                else\n                                {\n                                    x3dom.debug.logError(\"Invalid SRC data, loaded from URL \\\"\" +\n                                        that._vf['url'][that._currentURLIdx] + \"\\\",\" +\n                                        \" no other URLs left to try.\");\n                                }\n                            }\n                            \n                            var theScene = that._nameSpace.doc._scene;\n\n                            if (theScene) {\n                                theScene.invalidateVolume();\n                                //theScene.invalidateCache();\n\n                                window.setTimeout( function() {\n                                    that.invalidateVolume();\n                                    //that.invalidateCache();\n\n                                    theScene.updateVolume();\n                                    that._nameSpace.doc.needRender = true;\n                                });\n                                \n                            }\n                        });\n                    }\n                    else\n                    {\n                        if ((that._currentURLIdx + 1) < that._vf['url'].length)\n                        {\n                            x3dom.debug.logWarning(\"Invalid SRC data, loaded from URL \\\"\" +\n                                that._vf['url'][that._currentURLIdx] +\n                                \"\\\", trying next specified URL\");\n\n                            //try next URL\n                            ++that._currentURLIdx;\n                            that.update(shape, shaderProgram, gl, viewarea, context);\n                        }\n                        else\n                        {\n                            x3dom.debug.logError(\"Invalid SRC data, loaded from URL \\\"\" +\n                                that._vf['url'][that._currentURLIdx] + \"\\\",\" +\n                                \" no other URLs left to try.\");\n                        }\n                    }\n                };\n            },\n\n\n            collectDrawableObjects: function (transform, drawableCollection, singlePath, invalidateCache, planeMask, clipPlanes)\n            {\n                // attention, in contrast to other collectDrawableObjects()\n                // this one has boolean return type to better work with RSG\n                var graphState = this.graphState();\n\n                if (singlePath && (this._parentNodes.length > 1))\n                    singlePath = false;\n\n                if (singlePath && (invalidateCache = invalidateCache || this.cacheInvalid()))\n                    this.invalidateCache();\n\n                if (singlePath && !this._graph.globalMatrix)\n                    this._graph.globalMatrix = transform;\n\n                if (this._clipPlanes.length != clipPlanes.length)\n                {\n                    this._dirty.shader = true;\n                }\n\n                this._clipPlanes = clipPlanes;\n\n                drawableCollection.addShape(this, transform, graphState);\n                return true;\n            },\n\n            getShaderProperties: function(viewarea)\n            {\n                \n                var properties = x3dom.Utils.generateProperties(viewarea, this);\n                properties.CSHADER = -1;\n\n                properties.LIGHTS = viewarea.getLights().length + (viewarea._scene.getNavigationInfo()._vf.headlight);\n\n                properties.EMPTY_SHADER = 1;\n\n                return properties;\n            },\n\n            nodeChanged: function ()\n            {\n                if (!this._objectID) {\n                    this._objectID = ++x3dom.nodeTypes.Shape.objectID;\n                    x3dom.nodeTypes.Shape.idMap.nodeID[this._objectID] = this;\n                }\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### X3DLightNode ### */\nx3dom.registerNodeType(\n    \"X3DLightNode\",\n    \"Lighting\",\n    defineClass(x3dom.nodeTypes.X3DChildNode,\n        \n        /**\n         * Constructor for X3DLightNode\n         * @constructs x3dom.nodeTypes.X3DLightNode\n         * @x3d 3.3\n         * @component Lighting\n         * @status full\n         * @extends x3dom.nodeTypes.X3DChildNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The X3DLightNode abstract node type is the base type from which all node types that serve as light sources are derived.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DLightNode.superClass.call(this, ctx);\n\n            if (ctx)\n                ctx.doc._nodeBag.lights.push(this);\n            else\n                x3dom.debug.logWarning(\"X3DLightNode: No runtime context found!\");\n\n            this._lightID = 0;\n            this._dirty = true;\n\n\n            /**\n             * The ambientIntensity specifies the intensity of the ambient emission from the light. Light intensity may range from 0.0 (no light emission) to 1.0 (full intensity).\n             * @var {x3dom.fields.SFFloat} ambientIntensity\n             * @range [0, 1]\n             * @memberof x3dom.nodeTypes.X3DLightNode\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'ambientIntensity', 0);\n\n            /**\n             * The color field specifies the spectral colour properties of both the direct and ambient light emission as an RGB value.\n             * @var {x3dom.fields.SFColor} color\n             * @range [0, 1]\n             * @memberof x3dom.nodeTypes.X3DLightNode\n             * @initvalue 1,1,1\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFColor(ctx, 'color', 1, 1, 1);\n\n            /**\n             * The intensity field specifies the brightness of the direct emission from the light. Light intensity may range from 0.0 (no light emission) to 1.0 (full intensity).\n             * @var {x3dom.fields.SFFloat} intensity\n             * @range [0, 1]\n             * @memberof x3dom.nodeTypes.X3DLightNode\n             * @initvalue 1\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'intensity', 1);\n\n            /**\n             * Specifies whether the light is global or scoped.\n             * Global lights illuminate all objects that fall within their volume of lighting influence.\n             * Scoped lights only illuminate objects that are in the same transformation hierarchy as the light; i.e., only the children and descendants of its enclosing parent group are illuminated.\n             * @var {x3dom.fields.SFBool} global\n             * @memberof x3dom.nodeTypes.X3DLightNode\n             * @initvalue false\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'global', false);\n\n            /**\n             * The on field specifies whether the light is enabled or disabled.\n             * @var {x3dom.fields.SFBool} on\n             * @memberof x3dom.nodeTypes.X3DLightNode\n             * @initvalue true\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'on', true);\n\n            /**\n             * Defines the attenuation of the shadows\n             * @var {x3dom.fields.SFFloat} shadowIntensity\n             * @range [o, 1]\n             * @memberof x3dom.nodeTypes.X3DLightNode\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'shadowIntensity', 0);\n\n            /**\n             * Specifies the resolution of the used shadow map.\n             * @var {x3dom.fields.SFInt32} shadowMapSize\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.X3DLightNode\n             * @initvalue 1024\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'shadowMapSize', 1024);\n\n            /**\n             * Sets the smoothness of the shadow umbra.\n             * @var {x3dom.fields.SFInt32} shadowFilterSize\n             * @memberof x3dom.nodeTypes.X3DLightNode\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'shadowFilterSize', 0);\n\n            /**\n             * Defines the shadow offset for the back projection of the shadow map.\n             * @var {x3dom.fields.SFFloat} shadowOffset\n             * @memberof x3dom.nodeTypes.X3DLightNode\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'shadowOffset', 0);\n\n            /**\n             * Specifies the placement of the near plane of the light projection.\n             * Objects that are closer to the light source than the near plane do not cast shadows.\n             * If the zNear value is not set, the near plane is placed automatically.\n             * @var {x3dom.fields.SFFloat} zNear\n             * @range -1 or [0, inf]\n             * @memberof x3dom.nodeTypes.X3DLightNode\n             * @initvalue -1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'zNear', -1);\n\n            /**\n             * Specifies the placement of the far plane of the light projection.\n             * Objects that are farther away from the light source than the far plane do not cast shadows.\n             * If the zFar value is not set, the far plane is placed automatically.\n             * @var {x3dom.fields.SFFloat} zFar\n             * @range -1 or [0, inf]\n             * @memberof x3dom.nodeTypes.X3DLightNode\n             * @initvalue -1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'zFar', -1);\n        \n        },\n        {\n            getViewMatrix: function(vec) {\n                return x3dom.fields.SFMatrix4f.identity;\n            },\n\n            nodeChanged: function () {\n                if(!this._lightID) {\n                    this._lightID = ++x3dom.nodeTypes.X3DLightNode.lightID;\n                }\n            },\n\n            fieldChanged: function(fieldName)\n            {\n                if (this._vf.hasOwnProperty(fieldName)) {\n                    this._dirty = true;\n                }\n            },\n\n            parentRemoved: function(parent)\n            {\n                if (this._parentNodes.length === 1 && this._parentNodes[0] == parent) {\n                    var doc = this.findX3DDoc();\n\n                    for (var i=0, n=doc._nodeBag.lights.length; i<n; i++) {\n                        if (doc._nodeBag.lights[i] === this) {\n                            doc._nodeBag.lights.splice(i, 1);\n                        }\n                    }\n                }\n            },\n            onRemove: function()\n            {\n                //console.log(\"remove\");\n            }\n        }\n    )\n);\n\n/** Static class ID counter (needed for flash performance up) */\nx3dom.nodeTypes.X3DLightNode.lightID = 0;\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### DirectionalLight ### */\nx3dom.registerNodeType(\n    \"DirectionalLight\",\n    \"Lighting\",\n    defineClass(x3dom.nodeTypes.X3DLightNode,\n        \n        /**\n         * Constructor for DirectionalLight\n         * @constructs x3dom.nodeTypes.DirectionalLight\n         * @x3d 3.3\n         * @component Lighting\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DLightNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The DirectionalLight node defines a directional light source that illuminates along rays parallel to a given 3-dimensional vector.\n         * A directional light source illuminates only the objects in its enclosing parent group.\n         * The light may illuminate everything within this coordinate system, including all children and descendants of its parent group.\n         * The accumulated transformations of the parent nodes affect the light.\n         * DirectionalLight nodes do not attenuate with distance.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.DirectionalLight.superClass.call(this, ctx);\n\n\n            /**\n             * The direction field specifies the direction vector of the illumination emanating from the light source in the local coordinate system.\n             * @var {x3dom.fields.SFVec3f} direction\n             * @memberof x3dom.nodeTypes.DirectionalLight\n             * @initvalue 0,0,-1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'direction', 0, 0, -1);\n\n            /**\n             *\n             * @var {x3dom.fields.SFInt32} shadowCascades\n             * @memberof x3dom.nodeTypes.DirectionalLight\n             * @initvalue 1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'shadowCascades', 1);\n\n            /**\n             *\n             * @var {x3dom.fields.SFFloat} shadowSplitFactor\n             * @memberof x3dom.nodeTypes.DirectionalLight\n             * @initvalue 1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'shadowSplitFactor', 1);\n\n            /**\n             *\n             * @var {x3dom.fields.SFFloat} shadowSplitOffset\n             * @memberof x3dom.nodeTypes.DirectionalLight\n             * @initvalue 0.1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'shadowSplitOffset', 0.1);\n        \n        },\n        {\n            getViewMatrix: function(vec) {\n                var dir = this.getCurrentTransform().multMatrixVec(this._vf.direction).normalize();\n                var orientation = x3dom.fields.Quaternion.rotateFromTo(\n                    new x3dom.fields.SFVec3f(0, 0, -1), dir);\n                return orientation.toMatrix().transpose().\n                    mult(x3dom.fields.SFMatrix4f.translation(vec.negate()));\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### PointLight ### */\nx3dom.registerNodeType(\n    \"PointLight\",\n    \"Lighting\",\n    defineClass(x3dom.nodeTypes.X3DLightNode,\n        \n        /**\n         * Constructor for PointLight\n         * @constructs x3dom.nodeTypes.PointLight\n         * @x3d 3.3\n         * @component Lighting\n         * @status full\n         * @extends x3dom.nodeTypes.X3DLightNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The PointLight node specifies a point light source at a 3D location in the local coordinate system.\n         * A point light source emits light equally in all directions; that is, it is omnidirectional.\n         * PointLight nodes are specified in the local coordinate system and are affected by ancestor transformations.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.PointLight.superClass.call(this, ctx);\n\n\n            /**\n             * PointLight node's illumination falls off with distance as specified by three attenuation coefficients. The attenuation factor is:\n             * 1/max(attenuation[0] + attenuation[1] × r + attenuation[2] × r^2, 1)\n             * where r is the distance from the light to the surface being illuminated.\n             * The default is no attenuation.\n             * An attenuation value of (0, 0, 0) is identical to (1, 0, 0). Attenuation values shall be greater than or equal to zero.\n             * @var {x3dom.fields.SFVec3f} attenuation\n             * @memberof x3dom.nodeTypes.PointLight\n             * @initvalue 1,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'attenuation', 1, 0, 0);\n\n            /**\n             * The position of the Light\n             * @var {x3dom.fields.SFVec3f} location\n             * @memberof x3dom.nodeTypes.PointLight\n             * @initvalue 0,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'location', 0, 0, 0);\n\n            /**\n             * A PointLight node illuminates geometry within radius length base units of its location.\n             * Radius is affected by ancestors' transformations.\n             * @var {x3dom.fields.SFFloat} radius\n             * @memberof x3dom.nodeTypes.PointLight\n             * @initvalue 100\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'radius', 100);\n\n            this._vf.global = true;\n        \n        },\n        {\n            getViewMatrix: function(vec) {\n                var pos = this.getCurrentTransform().multMatrixPnt(this._vf.location);\n                var orientation = x3dom.fields.Quaternion.rotateFromTo(\n                    new x3dom.fields.SFVec3f(0, 0, -1), vec);\n                return orientation.toMatrix().transpose().\n                    mult(x3dom.fields.SFMatrix4f.translation(pos.negate()));\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### SpotLight ### */\nx3dom.registerNodeType(\n    \"SpotLight\",\n    \"Lighting\",\n    defineClass(x3dom.nodeTypes.X3DLightNode,\n        \n        /**\n         * Constructor for SpotLight\n         * @constructs x3dom.nodeTypes.SpotLight\n         * @x3d 3.3\n         * @component Lighting\n         * @status full\n         * @extends x3dom.nodeTypes.X3DLightNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The SpotLight node defines a light source that emits light from a specific point along a specific direction vector and constrained within a solid angle.\n         * Spotlights may illuminate geometry nodes that respond to light sources and intersect the solid angle defined by the SpotLight.\n         * Spotlight nodes are specified in the local coordinate system and are affected by ancestors' transformations.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.SpotLight.superClass.call(this, ctx);\n\n\n            /**\n             * The direction field specifies the direction vector of the light's central axis defined in the local coordinate system.\n             * @var {x3dom.fields.SFVec3f} direction\n             * @memberof x3dom.nodeTypes.SpotLight\n             * @initvalue 0,0,-1\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'direction', 0, 0, -1);\n\n            /**\n             * SpotLight node's illumination falls off with distance as specified by three attenuation coefficients. The attenuation factor is:\n             * 1/max(attenuation[0] + attenuation[1] × r + attenuation[2] × r^2, 1)\n             * where r is the distance from the light to the surface being illuminated.\n             * The default is no attenuation.\n             * An attenuation value of (0, 0, 0) is identical to (1, 0, 0). Attenuation values shall be greater than or equal to zero.\n             * @var {x3dom.fields.SFVec3f} attenuation\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.SpotLight\n             * @initvalue 1,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'attenuation', 1, 0, 0);\n\n            /**\n             * The location field specifies a translation offset of the centre point of the light source from the light's local coordinate system origin.\n             * This point is the apex of the solid angle which bounds light emission from the given light source.\n             * Location is affected by ancestors' transformations.\n             * @var {x3dom.fields.SFVec3f} location\n             * @memberof x3dom.nodeTypes.SpotLight\n             * @initvalue 0,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'location', 0, 0, 0);\n\n            /**\n             * The radius field specifies the radial extent of the solid angle and the maximum distance from location that may be illuminated by the light source.\n             * The light source does not emit light outside this radius. The radius shall be greater than or equal to zero.\n             * Radius is affected by ancestors' transformations.\n             * @var {x3dom.fields.SFFloat} radius\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.SpotLight\n             * @initvalue 100\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'radius', 100);\n\n            /**\n             *  The beamWidth field specifies an inner solid angle in which the light source emits light at uniform full intensity.\n             *  The light source's emission intensity drops off from the inner solid angle (beamWidth) to the outer solid angle (cutOffAngle).\n             *  If the beamWidth is greater than the cutOffAngle, beamWidth is defined to be equal to the cutOffAngle and the light source emits full intensity within the entire solid angle defined by cutOffAngle.\n             * @var {x3dom.fields.SFFloat} beamWidth\n             * @range [0, pi/2]\n             * @memberof x3dom.nodeTypes.SpotLight\n             * @initvalue 1.5707963\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'beamWidth', 1.5707963);\n\n            /**\n             * The cutOffAngle field specifies the outer bound of the solid angle. The light source does not emit light outside of this solid angle.\n             * The light source's emission intensity drops off from the inner solid angle (beamWidth) to the outer solid angle (cutOffAngle).\n             * If the beamWidth is greater than the cutOffAngle, beamWidth is defined to be equal to the cutOffAngle and the light source emits full intensity within the entire solid angle defined by cutOffAngle.\n             * @range [0, pi/2]\n             * @var {x3dom.fields.SFFloat} cutOffAngle\n             * @memberof x3dom.nodeTypes.SpotLight\n             * @initvalue 1.5707963\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'cutOffAngle', 1.5707963);\n\n            /**\n             *\n             * @var {x3dom.fields.SFInt32} shadowCascades\n             * @memberof x3dom.nodeTypes.SpotLight\n             * @initvalue 1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'shadowCascades', 1);\n\n            /**\n             *\n             * @var {x3dom.fields.SFFloat} shadowSplitFactor\n             * @memberof x3dom.nodeTypes.SpotLight\n             * @initvalue 1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'shadowSplitFactor', 1);\n\n            /**\n             *\n             * @var {x3dom.fields.SFFloat} shadowSplitOffset\n             * @memberof x3dom.nodeTypes.SpotLight\n             * @initvalue 0.1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'shadowSplitOffset', 0.1);\n\n            this._vf.global = true;\n        \n        },\n        {\n            getViewMatrix: function(vec) {\n                var pos = this.getCurrentTransform().multMatrixPnt(this._vf.location);\n                var dir = this.getCurrentTransform().multMatrixVec(this._vf.direction).normalize();\n                var orientation = x3dom.fields.Quaternion.rotateFromTo(\n                    new x3dom.fields.SFVec3f(0, 0, -1), dir);\n                return orientation.toMatrix().transpose().\n                    mult(x3dom.fields.SFMatrix4f.translation(pos.negate()));\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### DirectionalLight ### */\nx3dom.registerNodeType(\n    \"PhysicalEnvironmentLight\",\n    \"Lighting\",\n    defineClass(x3dom.nodeTypes.X3DLightNode,\n        \n        /**\n         * Constructor for PhysicalEnvironmentLight\n         * @constructs x3dom.nodeTypes.PhysicalEnvironmentLight\n         * @x3d x.x\n         * @component Lighting\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DLightNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc \n         */\n        function (ctx) {\n            x3dom.nodeTypes.PhysicalEnvironmentLight.superClass.call(this, ctx);\n\n            /**\n             * The direction field specifies the direction vector of the illumination emanating from the light source in the local coordinate system.\n             * @var {x3dom.fields.SFVec3f} direction\n             * @memberof x3dom.nodeTypes.PhysicalEnvironmentLight\n             * @initvalue 0,0,-1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'direction', 0, 0, -1);\n\n            /**\n             * \n             * The diffuse component of the environment light.\n             * The node supports only pre-computed HDR .dds files and these should be linear by default.\n             * @var {x3dom.nodeTypes.X3DTextureNode} diffuse\n             * @memberof x3dom.nodeTypes.PhysicalEnvironmentLight\n             * @initvalue papermillDiffuse.dds\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'diffuse', \"https://x3dom.org/download/assets/pbr/papermillDiffuse.dds\");\n\n            /**\n             *\n             * The specular component of the environment light.\n             * The node supports only pre-computed HDR .dds files and these should be linear by default.\n             * @var {x3dom.nodeTypes.X3DTextureNode} specular\n             * @memberof x3dom.nodeTypes.PhysicalEnvironmentLight\n             * @initvalue papermillSpecular.dds\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'specular', \"https://x3dom.org/download/assets/pbr/papermillSpecular.dds\");\n\n            /**\n             *\n             * @var {x3dom.fields.SFInt32} shadowCascades\n             * @memberof x3dom.nodeTypes.PhysicalEnvironmentLight\n             * @initvalue 1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'shadowCascades', 1);\n\n            /**\n             *\n             * @var {x3dom.fields.SFFloat} shadowSplitFactor\n             * @memberof x3dom.nodeTypes.PhysicalEnvironmentLight\n             * @initvalue 1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'shadowSplitFactor', 1);\n\n            /**\n             *\n             * @var {x3dom.fields.SFFloat} shadowSplitOffset\n             * @memberof x3dom.nodeTypes.PhysicalEnvironmentLight\n             * @initvalue 0.1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'shadowSplitOffset', 0.1);\n        \n        },\n        {\n            fieldChanged: function(fieldName)\n            {\n                if (fieldName == \"diffuse\" || fieldName == \"specular\") {\n                    //this.invalidateGLObject();\n                }\n            },\n\n            getViewMatrix: function(vec) {\n                var dir = this.getCurrentTransform().multMatrixVec(this._vf.direction).normalize();\n                var orientation = x3dom.fields.Quaternion.rotateFromTo(\n                    new x3dom.fields.SFVec3f(0, 0, -1), dir);\n                return orientation.toMatrix().transpose().\n                    mult(x3dom.fields.SFMatrix4f.translation(vec.negate()));\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### X3DFollowerNode ### */\nx3dom.registerNodeType(\n    \"X3DFollowerNode\",\n    \"Followers\",\n    defineClass(x3dom.nodeTypes.X3DChildNode,\n        \n        /**\n         * Constructor for X3DFollowerNode\n         * @constructs x3dom.nodeTypes.X3DFollowerNode\n         * @x3d 3.3\n         * @component Followers\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DChildNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc An X3DFollowerNode maintains an internal state that consists of a current value and a destination\n         *  value. Both values are of the same data type into which the term [S|M]F<type> evaluatesfor a given\n         *  specialization. It is the 'data type of the node'. In certain cases of usage, the terms input and output fit\n         *  better for destination value and current value, respectively.\n         *  Whenever the current value differs from the destination value, the current value gradually changes until it\n         *  reaches the destination value producing a smooth transition. It generally moves towards the destination\n         *  value but, if a transition triggered by a prevous destination value is still in progress, it may take a\n         *  short while until the movement becomes a movement towards the new destination value.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DFollowerNode.superClass.call(this, ctx);\n\n            if (ctx)\n                ctx.doc._nodeBag.followers.push(this);\n            else\n                x3dom.debug.logWarning(\"X3DFollowerNode: No runtime context found!\");\n\n\n            /**\n             * isActive shows if the sensor is active\n             * @var {x3dom.fields.SFBool} isActive\n             * @memberof x3dom.nodeTypes.X3DFollowerNode\n             * @initvalue false\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'isActive', false);\n\n            // http://www.web3d.org/files/specifications/19775-1/V3.3/Part01/components/followers.html\n            // [S|M]F<type> [in]     set_destination\n            // [S|M]F<type> [in]     set_value\n            // [S|M]F<type> [out]    value\n            // SFBool       [out]    isActive\n            // [S|M]F<type> []       initialDestination\n            // [S|M]F<type> []       initialValue\n\n            this._eps = x3dom.fields.Eps; //0.001;\n        \n        },\n        {\n            parentRemoved: function(parent)\n            {\n                if (this._parentNodes.length === 0) {\n                    var doc = this.findX3DDoc();\n\n                    for (var i=0, n=doc._nodeBag.followers.length; i<n; i++) {\n                        if (doc._nodeBag.followers[i] === this) {\n                            doc._nodeBag.followers.splice(i, 1);\n                        }\n                    }\n                }\n            },\n\n            tick: function(t) {\n                return false;\n            },\n\n            stepResponse: function(t)\n            {\n                if (t <= 0) {\n                    return 0;\n                }\n\n                if (t >= this._vf.duration) {\n                    return 1;\n                }\n\n                // When optimizing for speed, the above two if(.) cases can be omitted,\n                // as this function will not be called for values outside of 0..duration.\n                return this.stepResponseCore(t / this._vf.duration);\n            },\n\n            // This function defines the shape of how the output responds to the initialDestination.\n            // It must accept values for T in the range 0 <= T <= 1.\n            // In this._vf.order to create a smooth animation, it should return 0 for T == 0,\n            // 1 for T == 1 and be sufficient smooth in the range 0 <= T <= 1.\n            //\n            // It should be optimized for speed, in this._vf.order for high performance. It's\n            // executed _buffer.length + 1 times each simulation tick.\n            stepResponseCore: function(T)\n            {\n                return 0.5 - 0.5 * Math.cos(T * Math.PI);\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### X3DChaserNode ### */\nx3dom.registerNodeType(\n    \"X3DChaserNode\",\n    \"Followers\",\n    defineClass(x3dom.nodeTypes.X3DFollowerNode,\n        \n        /**\n         * Constructor for X3DChaserNode\n         * @constructs x3dom.nodeTypes.X3DChaserNode\n         * @x3d 3.3\n         * @component Followers\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DFollowerNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The X3DChaserNode abstract node type calculates the output on value_changed as a finite impulse\n         *  response (FIR).\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DChaserNode.superClass.call(this, ctx);\n\n\n            /**\n             * Duration of the transition\n             * @var {x3dom.fields.SFTime} duration\n             * @memberof x3dom.nodeTypes.X3DChaserNode\n             * @initvalue 1\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFTime(ctx, 'duration', 1);\n\n            this._initDone = false;\n            this._stepTime = 0;\n            this._currTime = 0;\n            this._bufferEndTime = 0;\n            this._numSupports = 60;\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### X3DDamperNode ### */\nx3dom.registerNodeType(\n    \"X3DDamperNode\",\n    \"Followers\",\n    defineClass(x3dom.nodeTypes.X3DFollowerNode,\n        \n        /**\n         * Constructor for X3DDamperNode\n         * @constructs x3dom.nodeTypes.X3DDamperNode\n         * @x3d 3.3\n         * @component Followers\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DFollowerNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The X3DDamperNode abstract node type creates an IIR response that approaches the destination\n         *  value according to the shape of the e-function only asymptotically but very quickly. An X3DDamperNode node\n         *  is parameterized by the tau, order and tolerance fields. Internally, it consists of a set of linear\n         *  first-order filters each of which processes the output of the previous filter.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DDamperNode.superClass.call(this, ctx);\n\n\n            /**\n             * The field tau specifies the time-constant of the internal filters and thus the speed that the output of\n             *  an X3DDamperNode responds to the input. A value of zero for tau means immediate response and the events\n             *  received on set_destination are forwarded directly. The field tau specifies how long it takes the output\n             *  of an internal filter to reach the value of its input by 63% (1 - 1/e). The remainder after that period\n             *  is reduced by 63% during another period of tau seconds provided that the input of the filter does not\n             *  change. This behavior can be exposed if order is set to one.\n             * @var {x3dom.fields.SFTime} tau\n             * @memberof x3dom.nodeTypes.X3DDamperNode\n             * @initvalue 0.3\n             * @range [0,inf)\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFTime(ctx, 'tau', 0.3);\n\n            /**\n             * If tolerance is set to its default value -1, the browser implementation is allowed to find a good way for\n             *  detecting the end of a transition. Browsers that do not have an elaborate algorithm can just use .001 as\n             *  the tolerance value instead. If a value larger than zero is specified for tolerance, the browser shall\n             *  calculate the difference between output and input for each internal filter being used and stop the\n             *  animation only when all filters fall below that limit or are equal to it. If zero is specified for\n             *  tolerance, a transition should be stopped only if input and output match exactly for all internal\n             *  filters.\n             * @var {x3dom.fields.SFFloat} tolerance\n             * @memberof x3dom.nodeTypes.X3DDamperNode\n             * @initvalue -1\n             * @range -1 or [0,inf)\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'tolerance', -1);\n\n            /**\n             * The order field specifies the smoothness of the transition.\n             * @var {x3dom.fields.SFInt32} order\n             * @memberof x3dom.nodeTypes.X3DDamperNode\n             * @initvalue 3\n             * @range [0..5]\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'order', 3);\n\n            this._eps = this._vf.tolerance < 0 ? this._eps : this._vf.tolerance;\n            this._lastTick = 0;\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### ColorChaser ### */\nx3dom.registerNodeType(\n    \"ColorChaser\",\n    \"Followers\",\n    defineClass(x3dom.nodeTypes.X3DChaserNode,\n        \n        /**\n         * Constructor for ColorChaser\n         * @constructs x3dom.nodeTypes.ColorChaser\n         * @x3d 3.3\n         * @component Followers\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DChaserNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The ColorChaser animates transitions for single color values. Whenever the set_destination\n         *  field receives a floating point number, the value_changed creates a transition from its current value to\n         *  the newly set number. It creates a smooth transition that ends duration seconds after the last number has\n         *  been received.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.ColorChaser.superClass.call(this, ctx);\n\n\n            /**\n             * The field initialDestination should be set to the same value as initialValue unless a transition to a\n             *  certain value is to be created right after the scene is loaded or right after the ColorChaser node is\n             *  created dynamically.\n             * @var {x3dom.fields.SFColor} initialDestination\n             * @memberof x3dom.nodeTypes.ColorChaser\n             * @initvalue 0.8,0.8,0.8\n             * @range [0,1]\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFColor(ctx, 'initialDestination', 0.8, 0.8, 0.8);\n\n            /**\n             * The field initialValue can be used to set the initial value.\n             * @var {x3dom.fields.SFColor} initialValue\n             * @memberof x3dom.nodeTypes.ColorChaser\n             * @initvalue 0.8,0.8,0.8\n             * @range [0,1]\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFColor(ctx, 'initialValue', 0.8, 0.8, 0.8);\n\n\n            /**\n             * The current color value\n             * @var {x3dom.fields.SFColor} value\n             * @memberof x3dom.nodeTypes.ColorChaser\n             * @initvalue 0,0,0\n             * @range [0,1]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFColor(ctx, 'value', 0, 0, 0);\n\n            /**\n             * The target color value\n             * @var {x3dom.fields.SFColor} destination\n             * @memberof x3dom.nodeTypes.ColorChaser\n             * @initvalue 0,0,0\n             * @range [0,1]\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFColor(ctx, 'destination', 0, 0, 0);\n\n            this._buffer = new x3dom.fields.MFColor();\n            this._previousValue = new x3dom.fields.SFColor(0, 0, 0);\n            this._value = new x3dom.fields.SFColor(0, 0, 0);\n\n            this.initialize();\n        \n        },\n        {\n            fieldChanged: function(fieldName)\n            {\n                if (fieldName.indexOf(\"destination\") >= 0)\n                {\n                    this.initialize();\n                    this.updateBuffer(this._currTime);\n\n                    if (!this._vf.isActive) {\n                        this.postMessage('isActive', true);\n                    }\n                }\n                else if (fieldName.indexOf(\"value\") >= 0)\n                {\n                    this.initialize();\n\n                    this._previousValue.setValues(this._vf.value);\n                    for (var C=1; C<this._buffer.length; C++) {\n                        this._buffer[C].setValues(this._vf.value);\n                    }\n\n                    this.postMessage('value', this._vf.value);\n\n                    if (!this._vf.isActive) {\n                        this.postMessage('isActive', true);\n                    }\n                }\n            },\n\n            /** The following handler code is copy & paste from PositionChaser\n             */\n            initialize: function()\n            {\n                if (!this._initDone)\n                {\n                    this._initDone = true;\n\n                    this._vf.destination = this._vf.initialDestination;\n\n                    this._buffer.length = this._numSupports;\n\n                    this._buffer[0] = this._vf.initialDestination;\n                    for (var C=1; C<this._buffer.length; C++) {\n                        this._buffer[C] = this._vf.initialValue;\n                    }\n\n                    this._previousValue = this._vf.initialValue;\n\n                    this._stepTime = this._vf.duration / this._numSupports;\n\n                    var active = !this._buffer[0].equals(this._buffer[1], this._eps);\n                    if (this._vf.isActive !== active) {\n                        this.postMessage('isActive', active);\n                    }\n                }\n            },\n\n            tick: function(now)\n            {\n                this.initialize();\n                this._currTime = now;\n\n                //if (!this._vf.isActive)\n                //    return false;\n\n                if (!this._bufferEndTime)\n                {\n                    this._bufferEndTime = now;  // on init\n\n                    this._value = this._vf.initialValue;\n\n                    this.postMessage('value', this._value);\n\n                    return true;\n                }\n\n                var Frac = this.updateBuffer(now);\n\n                var Output = this._previousValue;\n\n                var DeltaIn = this._buffer[this._buffer.length - 1].subtract(this._previousValue);\n\n                var DeltaOut = DeltaIn.multiply(this.stepResponse((this._buffer.length - 1 + Frac) * this._stepTime));\n\n                Output = Output.add(DeltaOut);\n\n                for (var C=this._buffer.length - 2; C>=0; C--)\n                {\n                    DeltaIn = this._buffer[C].subtract(this._buffer[C + 1]);\n\n                    DeltaOut = DeltaIn.multiply(this.stepResponse((C + Frac) * this._stepTime));\n\n                    Output = Output.add(DeltaOut);\n                }\n\n                if ( !Output.equals(this._value, this._eps) ) {\n                    this._value.setValues(Output);\n\n                    this.postMessage('value', this._value);\n                }\n                else {\n                    this.postMessage('isActive', false);\n                }\n\n                return this._vf.isActive;\n            },\n\n            updateBuffer: function(now)\n            {\n                var Frac = (now - this._bufferEndTime) / this._stepTime;\n                var C;\n                var NumToShift;\n                var Alpha;\n\n                if (Frac >= 1)\n                {\n                    NumToShift = Math.floor(Frac);\n                    Frac -= NumToShift;\n\n                    if( NumToShift < this._buffer.length)\n                    {\n                        this._previousValue = this._buffer[this._buffer.length - NumToShift];\n\n                        for (C=this._buffer.length - 1; C>=NumToShift; C--) {\n                            this._buffer[C] = this._buffer[C - NumToShift];\n                        }\n\n                        for (C=0; C<NumToShift; C++)\n                        {\n                            Alpha = C / NumToShift;\n\n                            this._buffer[C] = this._buffer[NumToShift].multiply(Alpha).add(this._vf.destination.multiply((1 - Alpha)));\n                        }\n                    }\n                    else\n                    {\n                        this._previousValue = (NumToShift == this._buffer.length) ? this._buffer[0] : this._vf.destination;\n\n                        for (C= 0; C<this._buffer.length; C++) {\n                            this._buffer[C] = this._vf.destination;\n                        }\n                    }\n                    this._bufferEndTime += NumToShift * this._stepTime;\n                }\n                return Frac;\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### ColorDamper ### */\nx3dom.registerNodeType(\n    \"ColorDamper\",\n    \"Followers\",\n    defineClass(x3dom.nodeTypes.X3DDamperNode,\n        \n        /**\n         * Constructor for ColorDamper\n         * @constructs x3dom.nodeTypes.ColorDamper\n         * @x3d 3.3\n         * @component Followers\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DDamperNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The ColorDamper animates color values. Whenever the it receives a color, the ColorDamper node\n         *  creates a transition from the current color to the newly set color. The transition created approaches the\n         *  newly set position asymptotically during a time period of approximately three to four times the value of\n         *  the field tau depending on the desired accuracy and the value of order. The order field specifies the\n         *  smoothness of the transition.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.ColorDamper.superClass.call(this, ctx);\n\n\n            /**\n             * The field initialDestination should be set to the same value than initialValue unless a transition to a\n             *  certain color is to be created right after the scene is loaded or right after the ColorDamper node is\n             *  created dynamically.\n             * @var {x3dom.fields.SFColor} initialDestination\n             * @memberof x3dom.nodeTypes.ColorDamper\n             * @initvalue 0.8,0.8,0.8\n             * @range [0,1]\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFColor(ctx, 'initialDestination', 0.8, 0.8, 0.8);\n\n            /**\n             * The field initialValue can be used to set the initial color.\n             * @var {x3dom.fields.SFColor} initialValue\n             * @memberof x3dom.nodeTypes.ColorDamper\n             * @initvalue 0.8,0.8,0.8\n             * @range [0,1]\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFColor(ctx, 'initialValue', 0.8, 0.8, 0.8);\n\n\n            /**\n             * The current color value\n             * @var {x3dom.fields.SFColor} value\n             * @memberof x3dom.nodeTypes.ColorDamper\n             * @initvalue 0,0,0\n             * @range [0,1]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFColor(ctx, 'value', 0, 0, 0);\n\n            /**\n             * The target color value\n             * @var {x3dom.fields.SFColor} destination\n             * @memberof x3dom.nodeTypes.ColorDamper\n             * @initvalue 0,0,0\n             * @range [0,1]\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFColor(ctx, 'destination', 0, 0, 0);\n\n            this._value0 = new x3dom.fields.SFColor(0, 0, 0);\n            this._value1 = new x3dom.fields.SFColor(0, 0, 0);\n            this._value2 = new x3dom.fields.SFColor(0, 0, 0);\n            this._value3 = new x3dom.fields.SFColor(0, 0, 0);\n            this._value4 = new x3dom.fields.SFColor(0, 0, 0);\n            this._value5 = new x3dom.fields.SFColor(0, 0, 0);\n\n            this.initialize();\n        \n        },\n        {\n            fieldChanged: function(fieldName)\n            {\n                if (fieldName === \"tolerance\")\n                {\n                    this._eps = this._vf.tolerance < 0 ? 0.001 : this._vf.tolerance;\n                }\n                else if (fieldName.indexOf(\"destination\") >= 0)\n                {\n                    if ( !this._value0.equals(this._vf.destination, this._eps) ) {\n                        this._value0 = this._vf.destination;\n\n                        if (!this._vf.isActive) {\n                            //this._lastTick = 0;\n                            this.postMessage('isActive', true);\n                        }\n                    }\n                }\n                else if (fieldName.indexOf(\"value\") >= 0)\n                {\n                    this._value1.setValues(this._vf.value);\n                    this._value2.setValues(this._vf.value);\n                    this._value3.setValues(this._vf.value);\n                    this._value4.setValues(this._vf.value);\n                    this._value5.setValues(this._vf.value);\n                    this._lastTick = 0;\n\n                    this.postMessage('value', this._value5);\n\n                    if (!this._vf.isActive) {\n                        this._lastTick = 0;\n                        this.postMessage('isActive', true);\n                    }\n                }\n            },\n\n            initialize: function()\n            {\n                this._value0.setValues(this._vf.initialDestination);\n                this._value1.setValues(this._vf.initialValue);\n                this._value2.setValues(this._vf.initialValue);\n                this._value3.setValues(this._vf.initialValue);\n                this._value4.setValues(this._vf.initialValue);\n                this._value5.setValues(this._vf.initialValue);\n                this._lastTick = 0;\n\n                var active = !this._value0.equals(this._value1, this._eps);\n                if (this._vf.isActive !== active) {\n                    this.postMessage('isActive', active);\n                }\n            },\n\n            distance: function(a, b)\n            {\n                var diff = a.subtract(b);\n                return Math.sqrt(diff.r*diff.r + diff.g*diff.g + diff.b*diff.b);\n            },\n\n            // The ColorDamper animates SFColor values not in HSV space\n            // but as proposed in the original PROTO code in RGB space.\n            tick: function(now)\n            {\n                //if (!this._vf.isActive)\n                //    return false;\n\n                if (!this._lastTick)\n                {\n                    this._lastTick = now;\n                    return false;\n                }\n\n                var delta = now - this._lastTick;\n\n                var alpha = Math.exp(-delta / this._vf.tau);\n\n                this._value1 = this._vf.order > 0 && this._vf.tau ?\n                    this._value0.add(this._value1.subtract(this._value0).multiply(alpha)) :\n                    new x3dom.fields.SFColor(this._value0.r, this._value0.g, this._value0.b);\n\n                this._value2 = this._vf.order > 1 && this._vf.tau ?\n                    this._value1.add(this._value2.subtract(this._value1).multiply(alpha)) :\n                    new x3dom.fields.SFColor(this._value1.r, this._value1.g, this._value1.b);\n\n                this._value3 = this._vf.order > 2 && this._vf.tau ?\n                    this._value2.add(this._value3.subtract(this._value2).multiply(alpha)) :\n                    new x3dom.fields.SFColor(this._value2.r, this._value2.g, this._value2.b);\n\n                this._value4 = this._vf.order > 3 && this._vf.tau ?\n                    this._value3.add(this._value4.subtract(this._value3).multiply(alpha)) :\n                    new x3dom.fields.SFColor(this._value3.r, this._value3.g, this._value3.b);\n\n                this._value5 = this._vf.order > 4 && this._vf.tau ?\n                    this._value4.add(this._value5.subtract(this._value4).multiply(alpha)) :\n                    new x3dom.fields.SFColor(this._value4.r, this._value4.g, this._value4.b);\n\n                var dist = this.distance(this._value1, this._value0);\n\n                if (this._vf.order > 1)\n                {\n                    var dist2 = this.distance(this._value2, this._value1);\n                    if (dist2 > dist) { dist = dist2; }\n                }\n                if (this._vf.order > 2)\n                {\n                    var dist3 = this.distance(this._value3, this._value2);\n                    if (dist3 > dist) { dist = dist3; }\n                }\n                if (this._vf.order > 3)\n                {\n                    var dist4 = this.distance(this._value4, this._value3);\n                    if (dist4 > dist) { dist = dist4; }\n                }\n                if (this._vf.order > 4)\n                {\n                    var dist5 = this.distance(this._value5, this._value4);\n                    if (dist5 > dist) { dist = dist5; }\n                }\n\n                if (dist <= this._eps)\n                {\n                    this._value1.setValues(this._value0);\n                    this._value2.setValues(this._value0);\n                    this._value3.setValues(this._value0);\n                    this._value4.setValues(this._value0);\n                    this._value5.setValues(this._value0);\n\n                    this.postMessage('value', this._value0);\n                    this.postMessage('isActive', false);\n\n                    this._lastTick = 0;\n\n                    return false;\n                }\n\n                this.postMessage('value', this._value5);\n\n                this._lastTick = now;\n\n                return true;\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### OrientationChaser ### */\nx3dom.registerNodeType(\n    \"OrientationChaser\",\n    \"Followers\",\n    defineClass(x3dom.nodeTypes.X3DChaserNode,\n        \n        /**\n         * Constructor for OrientationChaser\n         * @constructs x3dom.nodeTypes.OrientationChaser\n         * @x3d 3.3\n         * @component Followers\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DChaserNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The OrientationChaser animates transitions for orientations. If it is routed to a rotation field\n         *  of a Transform node that contains an object, whenever the set_destination field receives an orientation, the\n         *  OrientationChaser node rotates the object from its current orientation to the newly set orientation.\n         *  It creates a smooth transition that ends duration seconds after the last orientation has been received.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.OrientationChaser.superClass.call(this, ctx);\n\n\n            /**\n             * The field initialDestination should be set to the same value than initialValue unless a transition to a\n             *  certain orientation is to be created right after the scene is loaded or right after the\n             *  OrientationChaser node is created dynamically.\n             * @var {x3dom.fields.SFRotation} initialDestination\n             * @memberof x3dom.nodeTypes.OrientationChaser\n             * @initvalue 0,1,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFRotation(ctx, 'initialDestination', 0, 1, 0, 0);\n\n            /**\n             * The field initialValue can be used to set the initial orientation of the object.\n             * @var {x3dom.fields.SFRotation} initialValue\n             * @memberof x3dom.nodeTypes.OrientationChaser\n             * @initvalue 0,1,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFRotation(ctx, 'initialValue', 0, 1, 0, 0);\n\n\n            /**\n             * The current orientation value.\n             * @var {x3dom.fields.SFRotation} value\n             * @memberof x3dom.nodeTypes.OrientationChaser\n             * @initvalue 0,1,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFRotation(ctx, 'value', 0, 1, 0, 0);\n\n            /**\n             * The target orientation value.\n             * @var {x3dom.fields.SFRotation} destination\n             * @memberof x3dom.nodeTypes.OrientationChaser\n             * @initvalue 0,1,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFRotation(ctx, 'destination', 0, 1, 0, 0);\n\n            this._numSupports = 30;\n            this._buffer = new x3dom.fields.MFRotation();\n            this._previousValue = new x3dom.fields.Quaternion(0, 1, 0, 0);\n            this._value = new x3dom.fields.Quaternion(0, 1, 0, 0);\n\n            this.initialize();\n        \n        },\n        {\n            fieldChanged: function(fieldName)\n            {\n                if (fieldName.indexOf(\"destination\") >= 0)\n                {\n                    this.initialize();\n                    this.updateBuffer(this._currTime);\n\n                    if (!this._vf.isActive) {\n                        this.postMessage('isActive', true);\n                    }\n                }\n                else if (fieldName.indexOf(\"value\") >= 0)\n                {\n                    this.initialize();\n\n                    this._previousValue.setValues(this._vf.value);\n                    for (var C=1; C<this._buffer.length; C++) {\n                        this._buffer[C].setValues(this._vf.value);\n                    }\n\n                    this.postMessage('value', this._vf.value);\n\n                    if (!this._vf.isActive) {\n                        this.postMessage('isActive', true);\n                    }\n                }\n            },\n\n            /** The following handler code was basically taken from\n             *  http://www.hersto.com/X3D/Followers\n             */\n            initialize: function()\n            {\n                if (!this._initDone)\n                {\n                    this._initDone = true;\n\n                    this._vf.destination = x3dom.fields.Quaternion.copy(this._vf.initialDestination);\n\n                    this._buffer.length = this._numSupports;\n\n                    this._buffer[0] = x3dom.fields.Quaternion.copy(this._vf.initialDestination);\n                    for (var C=1; C<this._buffer.length; C++) {\n                        this._buffer[C] = x3dom.fields.Quaternion.copy(this._vf.initialValue);\n                    }\n\n                    this._previousValue = x3dom.fields.Quaternion.copy(this._vf.initialValue);\n\n                    this._stepTime = this._vf.duration / this._numSupports;\n\n                    var active = !this._buffer[0].equals(this._buffer[1], this._eps);\n                    if (this._vf.isActive !== active) {\n                        this.postMessage('isActive', active);\n                    }\n                }\n            },\n\n            tick: function(now)\n            {\n                this.initialize();\n                this._currTime = now;\n\n                //if (!this._vf.isActive)\n                //    return false;\n\n                if (!this._bufferEndTime)\n                {\n                    this._bufferEndTime = now; // first event we received, so we are in the initialization phase.\n\n                    this._value = x3dom.fields.Quaternion.copy(this._vf.initialValue);\n\n                    this.postMessage('value', this._value);\n\n                    return true;\n                }\n\n                var Frac = this.updateBuffer(now);\n                // Frac is a value in   0 <= Frac < 1.\n\n                // now we can calculate the output.\n                // This means we calculate the delta between each entry in _buffer and its previous\n                // entries, calculate the step response of each such step and add it to form the output.\n\n                // The oldest value _buffer[_buffer.length - 1] needs some extra thought, because it has\n                // no previous value. More exactly, we haven't stored a previous value anymore.\n                // However, the step response of that missing previous value has already reached its\n                // destination, so we can - would we have that previous value - use this as a start point\n                // for adding the step responses.\n                // Actually updateBuffer(.) maintains this value in\n\n                var Output = x3dom.fields.Quaternion.copy(this._previousValue);\n\n                var DeltaIn = this._previousValue.inverse().multiply(this._buffer[this._buffer.length - 1]);\n\n                Output = Output.slerp(Output.multiply(DeltaIn), this.stepResponse((this._buffer.length - 1 + Frac) * this._stepTime));\n\n                for (var C=this._buffer.length - 2; C>=0; C--)\n                {\n                    DeltaIn = this._buffer[C + 1].inverse().multiply(this._buffer[C]);\n\n                    Output = Output.slerp(Output.multiply(DeltaIn), this.stepResponse((C + Frac) * this._stepTime));\n                }\n\n                if ( !Output.equals(this._value, this._eps) ) {\n                    Output = Output.normalize(Output);\n                    this._value.setValues(Output);\n\n                    this.postMessage('value', this._value);\n                }\n                else {\n                    this.postMessage('isActive', false);\n                }\n\n                return this._vf.isActive;\n            },\n\n            updateBuffer: function(now)\n            {\n                var Frac = (now - this._bufferEndTime) / this._stepTime;\n                var C;\n                var NumToShift;\n                var Alpha;\n                // is normally < 1. When it has grown to be larger than 1, we have to shift the array because the step response\n                // of the oldest entry has already reached its destination, and it's time for a newer entry.\n                // In the case of a very low frame rate, or a very short _stepTime we may need to shift by more than one entry.\n\n                if (Frac >= 1)\n                {\n                    NumToShift = Math.floor(Frac);\n                    Frac -= NumToShift;\n\n                    if( NumToShift < this._buffer.length)\n                    {\n                        // normal case\n                        this._previousValue = x3dom.fields.Quaternion.copy(this._buffer[this._buffer.length - NumToShift]);\n\n                        for (C=this._buffer.length - 1; C>=NumToShift; C--) {\n                            this._buffer[C] = x3dom.fields.Quaternion.copy(this._buffer[C - NumToShift]);\n                        }\n\n                        for (C=0; C<NumToShift; C++)\n                        {\n                            // Hmm, we have a destination value, but don't know how it has\n                            // reached the current state.\n                            // Therefore we do a linear interpolation from the latest value in the buffer to destination.\n                            Alpha = C / NumToShift;\n\n                            this._buffer[C] = this._vf.destination.slerp(this._buffer[NumToShift], Alpha);\n                        }\n                    }\n                    else\n                    {\n                        // degenerated case:\n                        //\n                        // We have a _VERY_ low frame rate...\n                        // we can only guess how we should fill the array.\n                        // Maybe we could write part of a linear interpolation\n                        // from this._buffer[0] to destination, that goes from this._bufferEndTime to now\n                        // (possibly only the end of the interpolation is to be written),\n                        // but if we reach here we are in a very degenerate case...\n                        // Thus we just write destination to the buffer.\n\n                        this._previousValue = x3dom.fields.Quaternion.copy((NumToShift == this._buffer.length) ?\n                            this._buffer[0] : this._vf.destination);\n\n                        for (C= 0; C<this._buffer.length; C++) {\n                            this._buffer[C] = x3dom.fields.Quaternion.copy(this._vf.destination);\n                        }\n                    }\n\n                    this._bufferEndTime += NumToShift * this._stepTime;\n                }\n\n                return Frac;\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### OrientationDamper ### */\nx3dom.registerNodeType(\n    \"OrientationDamper\",\n    \"Followers\",\n    defineClass(x3dom.nodeTypes.X3DDamperNode,\n        \n        /**\n         * Constructor for OrientationDamper\n         * @constructs x3dom.nodeTypes.OrientationDamper\n         * @x3d 3.3\n         * @component Followers\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DDamperNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The OrientationDamper animates transitions of orientations. If its value is routed to an\n         *  orientation field of a Transform node that contains an object, then, whenever the destination field receives\n         *  an orientation, the OrientationDamper node rotates the object from its current orientation to the newly set\n         *  orientation. It creates a transition that approaches the newly set orientation asymptotically during a time\n         *  period of approximately three to four times the value of the field tau depending on the desired accuracy and\n         *  the value of order. Through this asymptotic approach of the destination orientation, a very smooth\n         *  transition is created.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.OrientationDamper.superClass.call(this, ctx);\n\n\n            /**\n             * The field initialDestination should be set to the same value than initialValue unless a transition to a\n             *  certain orientation is to be created right after the scene is loaded or right after the\n             *  OrientationDamper node is created dynamically.\n             * @var {x3dom.fields.SFRotation} initialDestination\n             * @memberof x3dom.nodeTypes.OrientationDamper\n             * @initvalue 0,1,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFRotation(ctx, 'initialDestination', 0, 1, 0, 0);\n\n            /**\n             * The field initialValue can be used to set the initial orientation of the object.\n             * @var {x3dom.fields.SFRotation} initialValue\n             * @memberof x3dom.nodeTypes.OrientationDamper\n             * @initvalue 0,1,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFRotation(ctx, 'initialValue', 0, 1, 0, 0);\n\n\n            /**\n             * The current orientation value.\n             * @var {x3dom.fields.SFRotation} value\n             * @memberof x3dom.nodeTypes.OrientationDamper\n             * @initvalue 0,1,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFRotation(ctx, 'value', 0, 1, 0, 0);\n\n            /**\n             * The target orientation value\n             * @var {x3dom.fields.SFRotation} destination\n             * @memberof x3dom.nodeTypes.OrientationDamper\n             * @initvalue 0,1,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFRotation(ctx, 'destination', 0, 1, 0, 0);\n\n            this._value0 = new x3dom.fields.Quaternion(0, 1, 0, 0);\n            this._value1 = new x3dom.fields.Quaternion(0, 1, 0, 0);\n            this._value2 = new x3dom.fields.Quaternion(0, 1, 0, 0);\n            this._value3 = new x3dom.fields.Quaternion(0, 1, 0, 0);\n            this._value4 = new x3dom.fields.Quaternion(0, 1, 0, 0);\n            this._value5 = new x3dom.fields.Quaternion(0, 1, 0, 0);\n\n            this.initialize();\n        \n        },\n        {\n            fieldChanged: function(fieldName)\n            {\n                if (fieldName === \"tolerance\")\n                {\n                    this._eps = this._vf.tolerance < 0 ? 0.001 : this._vf.tolerance;\n                }\n                else if (fieldName.indexOf(\"destination\") >= 0)\n                {\n                    if ( !this._value0.equals(this._vf.destination, this._eps) ) {\n                        this._value0 = this._vf.destination;\n\n                        if (!this._vf.isActive) {\n                            //this._lastTick = 0;\n                            this.postMessage('isActive', true);\n                        }\n                    }\n                }\n                else if (fieldName.indexOf(\"value\") >= 0)\n                {\n                    this._value1.setValues(this._vf.value);\n                    this._value2.setValues(this._vf.value);\n                    this._value3.setValues(this._vf.value);\n                    this._value4.setValues(this._vf.value);\n                    this._value5.setValues(this._vf.value);\n                    this._lastTick = 0;\n\n                    this.postMessage('value', this._value5);\n\n                    if (!this._vf.isActive) {\n                        this._lastTick = 0;\n                        this.postMessage('isActive', true);\n                    }\n                }\n            },\n\n            initialize: function()\n            {\n                this._value0.setValues(this._vf.initialDestination);\n                this._value1.setValues(this._vf.initialValue);\n                this._value2.setValues(this._vf.initialValue);\n                this._value3.setValues(this._vf.initialValue);\n                this._value4.setValues(this._vf.initialValue);\n                this._value5.setValues(this._vf.initialValue);\n                this._lastTick = 0;\n\n                var active = !this._value0.equals(this._value1, this._eps);\n                if (this._vf.isActive !== active) {\n                    this.postMessage('isActive', active);\n                }\n            },\n\n            tick: function(now)\n            {\n                //if (!this._vf.isActive)\n                //    return false;\n\n                if (!this._lastTick)\n                {\n                    this._lastTick = now;\n                    return false;\n                }\n\n                var delta = now - this._lastTick;\n\n                var alpha = Math.exp(-delta / this._vf.tau);\n\n                this._value1 = this._vf.order > 0 && this._vf.tau ?\n                    this._value0.slerp(this._value1, alpha) :\n                    new x3dom.fields.Quaternion(this._value0.x, this._value0.y, this._value0.z, this._value0.w);\n\n                this._value2 = this._vf.order > 1 && this._vf.tau ?\n                    this._value1.slerp(this._value2, alpha) :\n                    new x3dom.fields.Quaternion(this._value1.x, this._value1.y, this._value1.z, this._value1.w);\n\n                this._value3 = this._vf.order > 2 && this._vf.tau ?\n                    this._value2.slerp(this._value3, alpha) :\n                    new x3dom.fields.Quaternion(this._value2.x, this._value2.y, this._value2.z, this._value2.w);\n\n                this._value4 = this._vf.order > 3 && this._vf.tau ?\n                    this._value3.slerp(this._value4, alpha) :\n                    new x3dom.fields.Quaternion(this._value3.x, this._value3.y, this._value3.z, this._value3.w);\n\n                this._value5 = this._vf.order > 4 && this._vf.tau ?\n                    this._value4.slerp(this._value5, alpha) :\n                    new x3dom.fields.Quaternion(this._value4.x, this._value4.y, this._value4.z, this._value4.w);\n\n                var dist = Math.abs(this._value1.inverse().multiply(this._value0).angle());\n\n                if(this._vf.order > 1)\n                {\n                    var dist2 = Math.abs(this._value2.inverse().multiply(this._value1).angle());\n                    if (dist2 > dist)  { dist = dist2; }\n                }\n                if(this._vf.order > 2)\n                {\n                    var dist3 = Math.abs(this._value3.inverse().multiply(this._value2).angle());\n                    if (dist3 > dist) { dist = dist3; }\n                }\n                if(this._vf.order > 3)\n                {\n                    var dist4 = Math.abs(this._value4.inverse().multiply(this._value3).angle());\n                    if (dist4 > dist)  { dist = dist4; }\n                }\n                if(this._vf.order > 4)\n                {\n                    var dist5 = Math.abs(this._value5.inverse().multiply(this._value4).angle());\n                    if (dist5 > dist)  { dist = dist5; }\n                }\n\n                if (dist <= this._eps)\n                {\n                    this._value1.setValues(this._value0);\n                    this._value2.setValues(this._value0);\n                    this._value3.setValues(this._value0);\n                    this._value4.setValues(this._value0);\n                    this._value5.setValues(this._value0);\n\n                    this.postMessage('value', this._value0);\n                    this.postMessage('isActive', false);\n\n                    this._lastTick = 0;\n\n                    return false;\n                }\n\n                this.postMessage('value', this._value5);\n\n                this._lastTick = now;\n\n                return true;\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### PositionChaser ### */\nx3dom.registerNodeType(\n    \"PositionChaser\",\n    \"Followers\",\n    defineClass(x3dom.nodeTypes.X3DChaserNode,\n        \n        /**\n         * Constructor for PositionChaser\n         * @constructs x3dom.nodeTypes.PositionChaser\n         * @x3d 3.3\n         * @component Followers\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DChaserNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The PositionChaser animates transitions for 3D vectors. If its value field is routed to a\n         *  translation field of a Transform node that contains an object, then, whenever the destination field\n         *  receives a 3D position, the PositionChaser node moves the object from its current position to the newly set\n         *  position. It creates a smooth transition that ends duration seconds after the last position has been\n         *  received.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.PositionChaser.superClass.call(this, ctx);\n\n\n            /**\n             * The field initialDestination should be set to the same value than initialValue unless a transition to a\n             *  certain position is to be created right after the scene is loaded or right after the PositionChaser node\n             *  is created dynamically.\n             * @var {x3dom.fields.SFVec3f} initialDestination\n             * @memberof x3dom.nodeTypes.PositionChaser\n             * @initvalue 0,0,0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'initialDestination', 0, 0, 0);\n\n            /**\n             * The field initialValue can be used to set the initial position of the object.\n             * @var {x3dom.fields.SFVec3f} initialValue\n             * @memberof x3dom.nodeTypes.PositionChaser\n             * @initvalue 0,0,0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'initialValue', 0, 0, 0);\n\n\n            /**\n             * The current orientation value.\n             * @var {x3dom.fields.SFVec3f} value\n             * @memberof x3dom.nodeTypes.PositionChaser\n             * @initvalue 0,0,0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'value', 0, 0, 0);\n\n            /**\n             * The target orientation value.\n             * @var {x3dom.fields.SFVec3f} destination\n             * @memberof x3dom.nodeTypes.PositionChaser\n             * @initvalue 0,0,0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'destination', 0, 0, 0);\n\n            this._buffer = new x3dom.fields.MFVec3f();\n            this._previousValue = new x3dom.fields.SFVec3f(0, 0, 0);\n            this._value = new x3dom.fields.SFVec3f(0, 0, 0);\n\n            this.initialize();\n        \n        },\n        {\n            fieldChanged: function(fieldName)\n            {\n                if (fieldName.indexOf(\"destination\") >= 0)\n                {\n                    this.initialize();\n                    this.updateBuffer(this._currTime);\n\n                    if (!this._vf.isActive) {\n                        this.postMessage('isActive', true);\n                    }\n                }\n                else if (fieldName.indexOf(\"value\") >= 0)\n                {\n                    this.initialize();\n\n                    this._previousValue.setValues(this._vf.value);\n                    for (var C=1; C<this._buffer.length; C++) {\n                        this._buffer[C].setValues(this._vf.value);\n                    }\n\n                    this.postMessage('value', this._vf.value);\n\n                    if (!this._vf.isActive) {\n                        this.postMessage('isActive', true);\n                    }\n                }\n            },\n\n            /** The following handler code was basically taken from\n             *  http://www.hersto.com/X3D/Followers\n             */\n            initialize: function()\n            {\n                if (!this._initDone)\n                {\n                    this._initDone = true;\n\n                    this._vf.destination = x3dom.fields.SFVec3f.copy(this._vf.initialDestination);\n\n                    this._buffer.length = this._numSupports;\n\n                    this._buffer[0] = x3dom.fields.SFVec3f.copy(this._vf.initialDestination);\n                    for (var C=1; C<this._buffer.length; C++) {\n                        this._buffer[C] = x3dom.fields.SFVec3f.copy(this._vf.initialValue);\n                    }\n\n                    this._previousValue = x3dom.fields.SFVec3f.copy(this._vf.initialValue);\n\n                    this._stepTime = this._vf.duration / this._numSupports;\n\n                    var active = !this._buffer[0].equals(this._buffer[1], this._eps);\n                    if (this._vf.isActive !== active) {\n                        this.postMessage('isActive', active);\n                    }\n                }\n            },\n\n            tick: function(now)\n            {\n                this.initialize();\n                this._currTime = now;\n\n                //if (!this._vf.isActive)\n                //    return false;\n\n                if (!this._bufferEndTime)\n                {\n                    this._bufferEndTime = now; // first event we received, so we are in the initialization phase.\n\n                    this._value = x3dom.fields.SFVec3f.copy(this._vf.initialValue);\n\n                    this.postMessage('value', this._value);\n\n                    return true;\n                }\n\n                var Frac = this.updateBuffer(now);\n                // Frac is a value in   0 <= Frac < 1.\n\n                // now we can calculate the output.\n                // This means we calculate the delta between each entry in _buffer and its previous\n                // entries, calculate the step response of each such step and add it to form the output.\n\n                // The oldest value _buffer[_buffer.length - 1] needs some extra thought, because it has\n                // no previous value. More exactly, we haven't stored a previous value anymore.\n                // However, the step response of that missing previous value has already reached its\n                // destination, so we can - would we have that previous value - use this as a start point\n                // for adding the step responses.\n                // Actually updateBuffer(.) maintains this value in\n\n                var Output = x3dom.fields.SFVec3f.copy(this._previousValue);\n\n                var DeltaIn = this._buffer[this._buffer.length - 1].subtract(this._previousValue);\n\n                var DeltaOut = DeltaIn.multiply(this.stepResponse((this._buffer.length - 1 + Frac) * this._stepTime));\n\n                Output = Output.add(DeltaOut);\n\n                for (var C=this._buffer.length - 2; C>=0; C--)\n                {\n                    DeltaIn = this._buffer[C].subtract(this._buffer[C + 1]);\n\n                    DeltaOut = DeltaIn.multiply(this.stepResponse((C + Frac) * this._stepTime));\n\n                    Output = Output.add(DeltaOut);\n                }\n\n                if ( !Output.equals(this._value, this._eps) ) {\n                    this._value.setValues(Output);\n\n                    this.postMessage('value', this._value);\n                }\n                else {\n                    this.postMessage('isActive', false);\n                }\n\n                return this._vf.isActive;\n            },\n\n            updateBuffer: function(now)\n            {\n                var Frac = (now - this._bufferEndTime) / this._stepTime;\n                var C;\n                var NumToShift;\n                var Alpha;\n                // is normally < 1. When it has grown to be larger than 1, we have to shift the array because the step response\n                // of the oldest entry has already reached its destination, and it's time for a newer entry.\n                // In the case of a very low frame rate, or a very short _stepTime we may need to shift by more than one entry.\n\n                if (Frac >= 1)\n                {\n                    NumToShift = Math.floor(Frac);\n                    Frac -= NumToShift;\n\n                    if( NumToShift < this._buffer.length)\n                    {\n                        // normal case\n                        this._previousValue = x3dom.fields.SFVec3f.copy(this._buffer[this._buffer.length - NumToShift]);\n\n                        for (C=this._buffer.length - 1; C>=NumToShift; C--) {\n                            this._buffer[C] = x3dom.fields.SFVec3f.copy(this._buffer[C - NumToShift]);\n                        }\n\n                        for (C=0; C<NumToShift; C++)\n                        {\n                            // Hmm, we have a destination value, but don't know how it has\n                            // reached the current state.\n                            // Therefore we do a linear interpolation from the latest value in the buffer to destination.\n                            Alpha = C / NumToShift;\n\n                            this._buffer[C] = this._buffer[NumToShift].multiply(Alpha).add(this._vf.destination.multiply((1 - Alpha)));\n                        }\n                    }\n                    else\n                    {\n                        // degenerated case:\n                        //\n                        // We have a _VERY_ low frame rate...\n                        // we can only guess how we should fill the array.\n                        // Maybe we could write part of a linear interpolation\n                        // from this._buffer[0] to destination, that goes from this._bufferEndTime to now\n                        // (possibly only the end of the interpolation is to be written),\n                        // but if we reach here we are in a very degenerate case...\n                        // Thus we just write destination to the buffer.\n\n                        this._previousValue = x3dom.fields.SFVec3f.copy((NumToShift == this._buffer.length) ?\n                            this._buffer[0] : this._vf.destination);\n\n                        for (C= 0; C<this._buffer.length; C++) {\n                            this._buffer[C] = x3dom.fields.SFVec3f.copy(this._vf.destination);\n                        }\n                    }\n\n                    this._bufferEndTime += NumToShift * this._stepTime;\n                }\n\n                return Frac;\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### PositionChaser2D ### */\nx3dom.registerNodeType(\n    \"PositionChaser2D\",\n    \"Followers\",\n    defineClass(x3dom.nodeTypes.X3DChaserNode,\n        \n        /**\n         * Constructor for PositionChaser2D\n         * @constructs x3dom.nodeTypes.PositionChaser2D\n         * @x3d 3.3\n         * @component Followers\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DChaserNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The PositionChaser2D animates transitions for 2D vectors. Whenever its destination field receives\n         *  a 2D vector it creates a transition from its current 2D vector value to the newly set value. It creates a\n         *  smooth transition that ends duration seconds after the last 2D vector has been received.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.PositionChaser2D.superClass.call(this, ctx);\n\n\n            /**\n             * The field initialDestination should be set to the same value than initialValue unless a transition to a\n             *  certain 2D vector value is to be created right after the scene is loaded or right after the\n             *  PositionChaser2D node is created dynamically.\n             * @var {x3dom.fields.SFVec2f} initialDestination\n             * @memberof x3dom.nodeTypes.PositionChaser2D\n             * @initvalue 0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec2f(ctx, 'initialDestination', 0, 0);\n\n            /**\n             * The field initialValue can be used to set the initial initial value.\n             * @var {x3dom.fields.SFVec2f} initialValue\n             * @memberof x3dom.nodeTypes.PositionChaser2D\n             * @initvalue 0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec2f(ctx, 'initialValue', 0, 0);\n\n\n            /**\n             * The current 2D position.\n             * @var {x3dom.fields.SFVec2f} value\n             * @memberof x3dom.nodeTypes.PositionChaser2D\n             * @initvalue 0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec2f(ctx, 'value', 0, 0);\n\n            /**\n             * The target 2D position.\n             * @var {x3dom.fields.SFVec2f} destination\n             * @memberof x3dom.nodeTypes.PositionChaser2D\n             * @initvalue 0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec2f(ctx, 'destination', 0, 0);\n\n            this._buffer = new x3dom.fields.MFVec2f();\n            this._previousValue = new x3dom.fields.SFVec2f(0, 0);\n            this._value = new x3dom.fields.SFVec2f(0, 0);\n\n            this.initialize();\n        \n        },\n        {\n            fieldChanged: function(fieldName)\n            {\n                if (fieldName.indexOf(\"destination\") >= 0)\n                {\n                    this.initialize();\n                    this.updateBuffer(this._currTime);\n\n                    if (!this._vf.isActive) {\n                        this.postMessage('isActive', true);\n                    }\n                }\n                else if (fieldName.indexOf(\"value\") >= 0)\n                {\n                    this.initialize();\n\n                    this._previousValue.setValues(this._vf.value);\n                    for (var C=1; C<this._buffer.length; C++) {\n                        this._buffer[C].setValues(this._vf.value);\n                    }\n\n                    this.postMessage('value', this._vf.value);\n\n                    if (!this._vf.isActive) {\n                        this.postMessage('isActive', true);\n                    }\n                }\n            },\n\n            /** The following handler code is copy & paste from PositionChaser\n             */\n            initialize: function()\n            {\n                if (!this._initDone)\n                {\n                    this._initDone = true;\n\n                    this._vf.destination = x3dom.fields.SFVec2f.copy(this._vf.initialDestination);\n\n                    this._buffer.length = this._numSupports;\n\n                    this._buffer[0] = x3dom.fields.SFVec2f.copy(this._vf.initialDestination);\n                    for (var C=1; C<this._buffer.length; C++) {\n                        this._buffer[C] = x3dom.fields.SFVec2f.copy(this._vf.initialValue);\n                    }\n\n                    this._previousValue = x3dom.fields.SFVec2f.copy(this._vf.initialValue);\n\n                    this._stepTime = this._vf.duration / this._numSupports;\n\n                    var active = !this._buffer[0].equals(this._buffer[1], this._eps);\n                    if (this._vf.isActive !== active) {\n                        this.postMessage('isActive', active);\n                    }\n                }\n            },\n\n            tick: function(now)\n            {\n                this.initialize();\n                this._currTime = now;\n\n                //if (!this._vf.isActive)\n                //    return false;\n\n                if (!this._bufferEndTime)\n                {\n                    this._bufferEndTime = now;\n\n                    this._value = x3dom.fields.SFVec2f.copy(this._vf.initialValue);\n\n                    this.postMessage('value', this._value);\n\n                    return true;\n                }\n\n                var Frac = this.updateBuffer(now);\n\n                var Output = x3dom.fields.SFVec2f.copy(this._previousValue);\n\n                var DeltaIn = this._buffer[this._buffer.length - 1].subtract(this._previousValue);\n\n                var DeltaOut = DeltaIn.multiply(this.stepResponse((this._buffer.length - 1 + Frac) * this._stepTime));\n\n                Output = Output.add(DeltaOut);\n\n                for (var C=this._buffer.length - 2; C>=0; C--)\n                {\n                    DeltaIn = this._buffer[C].subtract(this._buffer[C + 1]);\n\n                    DeltaOut = DeltaIn.multiply(this.stepResponse((C + Frac) * this._stepTime));\n\n                    Output = Output.add(DeltaOut);\n                }\n\n                if ( !Output.equals(this._value, this._eps) ) {\n                    this._value.setValues(Output);\n\n                    this.postMessage('value', this._value);\n                }\n                else {\n                    this.postMessage('isActive', false);\n                }\n\n                return this._vf.isActive;\n            },\n\n            updateBuffer: function(now)\n            {\n                var Frac = (now - this._bufferEndTime) / this._stepTime;\n                var C;\n                var NumToShift;\n                var Alpha;\n\n                if (Frac >= 1)\n                {\n                    NumToShift = Math.floor(Frac);\n                    Frac -= NumToShift;\n\n                    if( NumToShift < this._buffer.length)\n                    {\n                        this._previousValue = x3dom.fields.SFVec2f.copy(this._buffer[this._buffer.length - NumToShift]);\n\n                        for (C=this._buffer.length - 1; C>=NumToShift; C--) {\n                            this._buffer[C]= x3dom.fields.SFVec2f.copy(this._buffer[C - NumToShift]);\n                        }\n\n                        for (C=0; C<NumToShift; C++)\n                        {\n                            Alpha = C / NumToShift;\n\n                            this._buffer[C] = this._buffer[NumToShift].multiply(Alpha).add(this._vf.destination.multiply((1 - Alpha)));\n                        }\n                    }\n                    else\n                    {\n                        this._previousValue = x3dom.fields.SFVec2f.copy((NumToShift == this._buffer.length) ?\n                            this._buffer[0] : this._vf.destination);\n\n                        for (C= 0; C<this._buffer.length; C++) {\n                            this._buffer[C] = x3dom.fields.SFVec2f.copy(this._vf.destination);\n                        }\n                    }\n\n                    this._bufferEndTime += NumToShift * this._stepTime;\n                }\n\n                return Frac;\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### PositionDamper ### */\nx3dom.registerNodeType(\n    \"PositionDamper\",\n    \"Followers\",\n    defineClass(x3dom.nodeTypes.X3DDamperNode,\n        \n        /**\n         * Constructor for PositionDamper\n         * @constructs x3dom.nodeTypes.PositionDamper\n         * @x3d 3.3\n         * @component Followers\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DDamperNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The PositionDamper animates transitions for 3D vectors. If its value field is routed to a\n         *  translation field of a Transform node that contains an object, then, whenever the destination field receives\n         *  a 3D position, the PositionDamper node moves the object from its current position to the newly set position.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.PositionDamper.superClass.call(this, ctx);\n\n\n            /**\n             * The field initialDestination should be set to the same value than initialvalue unless a transition to a\n             *  certain position is to be created right after the scene is loaded or right after the PositionDamper node\n             *  is created dynamically.\n             * @var {x3dom.fields.SFVec3f} initialDestination\n             * @memberof x3dom.nodeTypes.PositionDamper\n             * @initvalue 0,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'initialDestination', 0, 0, 0);\n\n            /**\n             * The field initialValue can be used to set the initial position of the object.\n             * @var {x3dom.fields.SFVec3f} initialValue\n             * @memberof x3dom.nodeTypes.PositionDamper\n             * @initvalue 0,0,0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'initialValue', 0, 0, 0);\n\n\n            /**\n             * The current position value.\n             * @var {x3dom.fields.SFVec3f} value\n             * @memberof x3dom.nodeTypes.PositionDamper\n             * @initvalue 0,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'value', 0, 0, 0);\n\n            /**\n             * The target position value.\n             * @var {x3dom.fields.SFVec3f} destination\n             * @memberof x3dom.nodeTypes.PositionDamper\n             * @initvalue 0,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'destination', 0, 0, 0);\n\n            this._value0 = new x3dom.fields.SFVec3f(0, 0, 0);\n            this._value1 = new x3dom.fields.SFVec3f(0, 0, 0);\n            this._value2 = new x3dom.fields.SFVec3f(0, 0, 0);\n            this._value3 = new x3dom.fields.SFVec3f(0, 0, 0);\n            this._value4 = new x3dom.fields.SFVec3f(0, 0, 0);\n            this._value5 = new x3dom.fields.SFVec3f(0, 0, 0);\n\n            this.initialize();\n        \n        },\n        {\n            fieldChanged: function(fieldName)\n            {\n                if (fieldName === \"tolerance\")\n                {\n                    this._eps = this._vf.tolerance < 0 ? 0.001 : this._vf.tolerance;\n                }\n                else if (fieldName.indexOf(\"destination\") >= 0)\n                {\n                    if ( !this._value0.equals(this._vf.destination, this._eps) ) {\n                        this._value0 = this._vf.destination;\n\n                        if (!this._vf.isActive) {\n                            //this._lastTick = 0;\n                            this.postMessage('isActive', true);\n                        }\n                    }\n                }\n                else if (fieldName.indexOf(\"value\") >= 0)\n                {\n                    this._value1.setValues(this._vf.value);\n                    this._value2.setValues(this._vf.value);\n                    this._value3.setValues(this._vf.value);\n                    this._value4.setValues(this._vf.value);\n                    this._value5.setValues(this._vf.value);\n                    this._lastTick = 0;\n\n                    this.postMessage('value', this._value5);\n\n                    if (!this._vf.isActive) {\n                        this._lastTick = 0;\n                        this.postMessage('isActive', true);\n                    }\n                }\n            },\n\n            initialize: function()\n            {\n                this._value0.setValues(this._vf.initialDestination);\n                this._value1.setValues(this._vf.initialValue);\n                this._value2.setValues(this._vf.initialValue);\n                this._value3.setValues(this._vf.initialValue);\n                this._value4.setValues(this._vf.initialValue);\n                this._value5.setValues(this._vf.initialValue);\n                this._lastTick = 0;\n\n                var active = !this._value0.equals(this._value1, this._eps);\n                if (this._vf.isActive !== active) {\n                    this.postMessage('isActive', active);\n                }\n            },\n\n            tick: function(now)\n            {\n                //if (!this._vf.isActive)\n                //    return false;\n\n                if (!this._lastTick)\n                {\n                    this._lastTick = now;\n                    return false;\n                }\n\n                var delta = now - this._lastTick;\n\n                var alpha = Math.exp(-delta / this._vf.tau);\n\n                this._value1 = this._vf.order > 0 && this._vf.tau ?\n                    this._value0.add(this._value1.subtract(this._value0).multiply(alpha)) :\n                    new x3dom.fields.SFVec3f(this._value0.x, this._value0.y, this._value0.z);\n\n                this._value2 = this._vf.order > 1 && this._vf.tau ?\n                    this._value1.add(this._value2.subtract(this._value1).multiply(alpha)) :\n                    new x3dom.fields.SFVec3f(this._value1.x, this._value1.y, this._value1.z);\n\n                this._value3 = this._vf.order > 2 && this._vf.tau ?\n                    this._value2.add(this._value3.subtract(this._value2).multiply(alpha)) :\n                    new x3dom.fields.SFVec3f(this._value2.x, this._value2.y, this._value2.z);\n\n                this._value4 = this._vf.order > 3 && this._vf.tau ?\n                    this._value3.add(this._value4.subtract(this._value3).multiply(alpha)) :\n                    new x3dom.fields.SFVec3f(this._value3.x, this._value3.y, this._value3.z);\n\n                this._value5 = this._vf.order > 4 && this._vf.tau ?\n                    this._value4.add(this._value5.subtract(this._value4).multiply(alpha)) :\n                    new x3dom.fields.SFVec3f(this._value4.x, this._value4.y, this._value4.z);\n\n                var dist = this._value1.subtract(this._value0).length();\n\n                if (this._vf.order > 1)\n                {\n                    var dist2 = this._value2.subtract(this._value1).length();\n                    if (dist2 > dist) {dist = dist2;}\n                }\n                if (this._vf.order > 2)\n                {\n                    var dist3 = this._value3.subtract(this._value2).length();\n                    if (dist3 > dist) {dist = dist3;}\n                }\n                if (this._vf.order > 3)\n                {\n                    var dist4 = this._value4.subtract(this._value3).length();\n                    if (dist4 > dist) {dist = dist4;}\n                }\n                if (this._vf.order > 4)\n                {\n                    var dist5 = this._value5.subtract(this._value4).length();\n                    if (dist5 > dist) {dist = dist5;}\n                }\n\n                if (dist <= this._eps)\n                {\n                    this._value1.setValues(this._value0);\n                    this._value2.setValues(this._value0);\n                    this._value3.setValues(this._value0);\n                    this._value4.setValues(this._value0);\n                    this._value5.setValues(this._value0);\n\n                    this.postMessage('value', this._value0);\n                    this.postMessage('isActive', false);\n\n                    this._lastTick = 0;\n\n                    return false;\n                }\n\n                this.postMessage('value', this._value5);\n\n                this._lastTick = now;\n\n                return true;\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### PositionDamper2D ### */\nx3dom.registerNodeType(\n    \"PositionDamper2D\",\n    \"Followers\",\n    defineClass(x3dom.nodeTypes.X3DDamperNode,\n        \n        /**\n         * Constructor for PositionDamper2D\n         * @constructs x3dom.nodeTypes.PositionDamper2D\n         * @x3d 3.3\n         * @component Followers\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DDamperNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The PositionDamper2D animates transitions for 2D vectors. Whenever the destination field receives\n         * a 2D vector, it creates a transition from its current 2D vector value to the newly set value.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.PositionDamper2D.superClass.call(this, ctx);\n\n\n            /**\n             * The field initialDestination should be set to the same value than initialValue  unless a transition to a\n             *  certain 2D vector value is to be created right after the scene is loaded or right after the\n             *  PositinChaser2D node is created dynamically.\n             * @var {x3dom.fields.SFVec2f} initialDestination\n             * @memberof x3dom.nodeTypes.PositionDamper2D\n             * @initvalue 0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec2f(ctx, 'initialDestination', 0, 0);\n\n            /**\n             * The field initialValue can be used to set the initial initial value.\n             * @var {x3dom.fields.SFVec2f} initialValue\n             * @memberof x3dom.nodeTypes.PositionDamper2D\n             * @initvalue 0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec2f(ctx, 'initialValue', 0, 0);\n\n\n            /**\n             * The current 2D position value.\n             * @var {x3dom.fields.SFVec2f} value\n             * @memberof x3dom.nodeTypes.PositionDamper2D\n             * @initvalue 0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec2f(ctx, 'value', 0, 0);\n\n            /**\n             * The target 2D position value.\n             * @var {x3dom.fields.SFVec2f} destination\n             * @memberof x3dom.nodeTypes.PositionDamper2D\n             * @initvalue 0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec2f(ctx, 'destination', 0, 0);\n\n            this._value0 = new x3dom.fields.SFVec2f(0, 0);\n            this._value1 = new x3dom.fields.SFVec2f(0, 0);\n            this._value2 = new x3dom.fields.SFVec2f(0, 0);\n            this._value3 = new x3dom.fields.SFVec2f(0, 0);\n            this._value4 = new x3dom.fields.SFVec2f(0, 0);\n            this._value5 = new x3dom.fields.SFVec2f(0, 0);\n\n            this.initialize();\n        \n        },\n        {\n            fieldChanged: function(fieldName)\n            {\n                if (fieldName === \"tolerance\")\n                {\n                    this._eps = this._vf.tolerance < 0 ? 0.001 : this._vf.tolerance;\n                }\n                else if (fieldName.indexOf(\"destination\") >= 0)\n                {\n                    if ( !this._value0.equals(this._vf.destination, this._eps) ) {\n                        this._value0 = this._vf.destination;\n\n                        if (!this._vf.isActive) {\n                            //this._lastTick = 0;\n                            this.postMessage('isActive', true);\n                        }\n                    }\n                }\n                else if (fieldName.indexOf(\"value\") >= 0)\n                {\n                    this._value1.setValues(this._vf.value);\n                    this._value2.setValues(this._vf.value);\n                    this._value3.setValues(this._vf.value);\n                    this._value4.setValues(this._vf.value);\n                    this._value5.setValues(this._vf.value);\n                    this._lastTick = 0;\n\n                    this.postMessage('value', this._value5);\n\n                    if (!this._vf.isActive) {\n                        this._lastTick = 0;\n                        this.postMessage('isActive', true);\n                    }\n                }\n            },\n\n            initialize: function()\n            {\n                this._value0.setValues(this._vf.initialDestination);\n                this._value1.setValues(this._vf.initialValue);\n                this._value2.setValues(this._vf.initialValue);\n                this._value3.setValues(this._vf.initialValue);\n                this._value4.setValues(this._vf.initialValue);\n                this._value5.setValues(this._vf.initialValue);\n                this._lastTick = 0;\n\n                var active = !this._value0.equals(this._value1, this._eps);\n                if (this._vf.isActive !== active) {\n                    this.postMessage('isActive', active);\n                }\n            },\n\n            tick: function(now)\n            {\n                //if (!this._vf.isActive)\n                //    return false;\n\n                if (!this._lastTick)\n                {\n                    this._lastTick = now;\n                    return false;\n                }\n\n                var delta = now - this._lastTick;\n\n                var alpha = Math.exp(-delta / this._vf.tau);\n\n                this._value1 = this._vf.order > 0 && this._vf.tau ?\n                    this._value0.add(this._value1.subtract(this._value0).multiply(alpha)) :\n                    new x3dom.fields.SFVec2f(this._value0.x, this._value0.y, this._value0.z);\n\n                this._value2 = this._vf.order > 1 && this._vf.tau ?\n                    this._value1.add(this._value2.subtract(this._value1).multiply(alpha)) :\n                    new x3dom.fields.SFVec2f(this._value1.x, this._value1.y, this._value1.z);\n\n                this._value3 = this._vf.order > 2 && this._vf.tau ?\n                    this._value2.add(this._value3.subtract(this._value2).multiply(alpha)) :\n                    new x3dom.fields.SFVec2f(this._value2.x, this._value2.y, this._value2.z);\n\n                this._value4 = this._vf.order > 3 && this._vf.tau ?\n                    this._value3.add(this._value4.subtract(this._value3).multiply(alpha)) :\n                    new x3dom.fields.SFVec2f(this._value3.x, this._value3.y, this._value3.z);\n\n                this._value5 = this._vf.order > 4 && this._vf.tau ?\n                    this._value4.add(this._value5.subtract(this._value4).multiply(alpha)) :\n                    new x3dom.fields.SFVec2f(this._value4.x, this._value4.y, this._value4.z);\n\n                var dist = this._value1.subtract(this._value0).length();\n\n                if (this._vf.order > 1)\n                {\n                    var dist2 = this._value2.subtract(this._value1).length();\n                    if (dist2 > dist) {dist = dist2;}\n                }\n                if (this._vf.order > 2)\n                {\n                    var dist3 = this._value3.subtract(this._value2).length();\n                    if (dist3 > dist) {dist = dist3;}\n                }\n                if (this._vf.order > 3)\n                {\n                    var dist4 = this._value4.subtract(this._value3).length();\n                    if (dist4 > dist) {dist = dist4;}\n                }\n                if (this._vf.order > 4)\n                {\n                    var dist5 = this._value5.subtract(this._value4).length();\n                    if (dist5 > dist) {dist = dist5;}\n                }\n\n                if (dist <= this._eps)\n                {\n                    this._value1.setValues(this._value0);\n                    this._value2.setValues(this._value0);\n                    this._value3.setValues(this._value0);\n                    this._value4.setValues(this._value0);\n                    this._value5.setValues(this._value0);\n\n                    this.postMessage('value', this._value0);\n                    this.postMessage('isActive', false);\n\n                    this._lastTick = 0;\n\n                    return false;\n                }\n\n                this.postMessage('value', this._value5);\n\n                this._lastTick = now;\n\n                return true;\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### ScalarChaser ### */\nx3dom.registerNodeType(\n    \"ScalarChaser\",\n    \"Followers\",\n    defineClass(x3dom.nodeTypes.X3DChaserNode,\n        \n        /**\n         * Constructor for ScalarChaser\n         * @constructs x3dom.nodeTypes.ScalarChaser\n         * @x3d 3.3\n         * @component Followers\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DChaserNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The ScalarChaser animates transitions for single float values. Whenever the destination field\n         *  receives a floating point number, it creates a transition from its current value to the newly set number.\n         *  It creates a smooth transition that ends duration seconds after the last number has been received.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.ScalarChaser.superClass.call(this, ctx);\n\n\n            /**\n             * The field initialDestination should be set to the same value than initialValue unless a transition to a\n             *  certain value is to be created right after the scene is loaded or right after the ScalarChaser node is\n             *  created dynamically.\n             * @var {x3dom.fields.SFFloat} initialDestination\n             * @memberof x3dom.nodeTypes.ScalarChaser\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'initialDestination', 0);\n\n            /**\n             * The field initialValue can be used to set the initial initial value.\n             * @var {x3dom.fields.SFFloat} initialValue\n             * @memberof x3dom.nodeTypes.ScalarChaser\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'initialValue', 0);\n\n\n            /**\n             * The current value.\n             * @var {x3dom.fields.SFFloat} value\n             * @memberof x3dom.nodeTypes.ScalarChaser\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'value', 0);\n\n            /**\n             * The target value.\n             * @var {x3dom.fields.SFFloat} destination\n             * @memberof x3dom.nodeTypes.ScalarChaser\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'destination', 0);\n\n            this._buffer = [];\n            this._previousValue = 0;\n            this._value = 0;\n\n            this.initialize();\n        \n        },\n        {\n            fieldChanged: function(fieldName)\n            {\n                if (fieldName.indexOf(\"destination\") >= 0)\n                {\n                    this.initialize();\n                    this.updateBuffer(this._currTime);\n\n                    if (!this._vf.isActive) {\n                        this.postMessage('isActive', true);\n                    }\n                }\n                else if (fieldName.indexOf(\"value\") >= 0)\n                {\n                    this.initialize();\n\n                    this._previousValue = this._vf.value;\n                    for (var C=1; C<this._buffer.length; C++) {\n                        this._buffer[C] = this._vf.value;\n                    }\n\n                    this.postMessage('value', this._vf.value);\n\n                    if (!this._vf.isActive) {\n                        this.postMessage('isActive', true);\n                    }\n                }\n            },\n\n            initialize: function()\n            {\n                if (!this._initDone)\n                {\n                    this._initDone = true;\n\n                    this._vf.destination = this._vf.initialDestination;\n\n                    this._buffer.length = this._numSupports;\n\n                    this._buffer[0] = this._vf.initialDestination;\n                    for (var C=1; C<this._buffer.length; C++) {\n                        this._buffer[C] = this._vf.initialValue;\n                    }\n\n                    this._previousValue = this._vf.initialValue;\n\n                    this._stepTime = this._vf.duration / this._numSupports;\n\n                    var active = (Math.abs(this._buffer[0] - this._buffer[1]) > this._eps);\n                    if (this._vf.isActive !== active) {\n                        this.postMessage('isActive', active);\n                    }\n                }\n            },\n\n            tick: function(now)\n            {\n                this.initialize();\n                this._currTime = now;\n\n                //if (!this._vf.isActive)\n                //    return false;\n\n                if (!this._bufferEndTime)\n                {\n                    this._bufferEndTime = now;\n\n                    this._value = this._vf.initialValue;\n\n                    this.postMessage('value', this._value);\n\n                    return true;\n                }\n\n                var Frac = this.updateBuffer(now);\n\n                var Output = this._previousValue;\n\n                var DeltaIn = this._buffer[this._buffer.length - 1] - this._previousValue;\n\n                var DeltaOut = DeltaIn * (this.stepResponse((this._buffer.length - 1 + Frac) * this._stepTime));\n\n                Output = Output + DeltaOut;\n\n                for (var C=this._buffer.length - 2; C>=0; C--)\n                {\n                    DeltaIn = this._buffer[C] - this._buffer[C + 1];\n\n                    DeltaOut = DeltaIn * (this.stepResponse((C + Frac) * this._stepTime));\n\n                    Output = Output + DeltaOut;\n                }\n\n                if (Math.abs(Output - this._value) > this._eps) {\n                    this._value = Output;\n\n                    this.postMessage('value', this._value);\n                }\n                else {\n                    this.postMessage('isActive', false);\n                }\n\n                return this._vf.isActive;\n            },\n\n            updateBuffer: function(now)\n            {\n                var Frac = (now - this._bufferEndTime) / this._stepTime;\n                var C;\n                var NumToShift;\n                var Alpha;\n\n                if (Frac >= 1)\n                {\n                    NumToShift = Math.floor(Frac);\n                    Frac -= NumToShift;\n\n                    if (NumToShift < this._buffer.length)\n                    {\n                        this._previousValue = this._buffer[this._buffer.length - NumToShift];\n\n                        for (C=this._buffer.length - 1; C>=NumToShift; C--) {\n                            this._buffer[C] = this._buffer[C - NumToShift];\n                        }\n\n                        for (C=0; C<NumToShift; C++)\n                        {\n                            Alpha = C / NumToShift;\n\n                            this._buffer[C] = this._buffer[NumToShift] * Alpha + this._vf.destination * (1 - Alpha);\n                        }\n                    }\n                    else\n                    {\n                        this._previousValue = (NumToShift == this._buffer.length) ? this._buffer[0] : this._vf.destination;\n\n                        for (C = 0; C<this._buffer.length; C++) {\n                            this._buffer[C] = this._vf.destination;\n                        }\n                    }\n\n                    this._bufferEndTime += NumToShift * this._stepTime;\n                }\n\n                return Frac;\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### ScalarDamper ### */\nx3dom.registerNodeType(\n    \"ScalarDamper\",\n    \"Followers\",\n    defineClass(x3dom.nodeTypes.X3DDamperNode,\n        \n        /**\n         * Constructor for ScalarDamper\n         * @constructs x3dom.nodeTypes.ScalarDamper\n         * @x3d 3.3\n         * @component Followers\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DDamperNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The ScalarDamper animates transitions for single float values. If the value field is routed to a\n         *  transparency field of a Material node, then, whenever the destination field receives a single float value,\n         *  the ScalarDamper node creates a transition from its current value to the newly set value.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.ScalarDamper.superClass.call(this, ctx);\n\n\n            /**\n             * The field initialDestination should be set to the same value than initialValue unless a transition to a\n             *  certain value is to be created right after the scene is loaded or right after the ScalarDamper node is\n             *  created dynamically.\n             * @var {x3dom.fields.SFFloat} initialDestination\n             * @memberof x3dom.nodeTypes.ScalarDamper\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'initialDestination', 0);\n\n            /**\n             * The field initialValue can be used to set the initial value of the node.\n             * @var {x3dom.fields.SFFloat} initialValue\n             * @memberof x3dom.nodeTypes.ScalarDamper\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'initialValue', 0);\n\n\n            /**\n             * The current value.\n             * @var {x3dom.fields.SFFloat} value\n             * @memberof x3dom.nodeTypes.ScalarDamper\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'value', 0);\n\n            /**\n             * The target value.\n             * @var {x3dom.fields.SFFloat} destination\n             * @memberof x3dom.nodeTypes.ScalarDamper\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'destination', 0);\n\n            this._value0 = 0;\n            this._value1 = 0;\n            this._value2 = 0;\n            this._value3 = 0;\n            this._value4 = 0;\n            this._value5 = 0;\n\n            this.initialize();\n        \n        },\n        {\n            fieldChanged: function(fieldName)\n            {\n                if (fieldName === \"tolerance\")\n                {\n                    this._eps = this._vf.tolerance < 0 ? 0.001 : this._vf.tolerance;\n                }\n                else if (fieldName.indexOf(\"destination\") >= 0)\n                {\n                    if (Math.abs(this._value0 - this._vf.destination) > this._eps) {\n                        this._value0 = this._vf.destination;\n\n                        if (!this._vf.isActive) {\n                            //this._lastTick = 0;\n                            this.postMessage('isActive', true);\n                        }\n                    }\n                }\n                else if (fieldName.indexOf(\"value\") >= 0)\n                {\n                    this._value1 = this._vf.value;\n                    this._value2 = this._vf.value;\n                    this._value3 = this._vf.value;\n                    this._value4 = this._vf.value;\n                    this._value5 = this._vf.value;\n                    this._lastTick = 0;\n\n                    this.postMessage('value', this._value5);\n\n                    if (!this._vf.isActive) {\n                        this._lastTick = 0;\n                        this.postMessage('isActive', true);\n                    }\n                }\n            },\n\n            initialize: function()\n            {\n                this._value0 = this._vf.initialDestination;\n                this._value1 = this._vf.initialValue;\n                this._value2 = this._vf.initialValue;\n                this._value3 = this._vf.initialValue;\n                this._value4 = this._vf.initialValue;\n                this._value5 = this._vf.initialValue;\n                this._lastTick = 0;\n\n                var active = (Math.abs(this._value0 - this._value1) > this._eps);\n                if (this._vf.isActive !== active) {\n                    this.postMessage('isActive', active);\n                }\n            },\n\n            tick: function(now)\n            {\n                //if (!this._vf.isActive)\n                //    return false;\n\n                if (!this._lastTick)\n                {\n                    this._lastTick = now;\n                    return false;\n                }\n\n                var delta = now - this._lastTick;\n\n                var alpha = Math.exp(-delta / this._vf.tau);\n\n                this._value1 = this._vf.order > 0 && this._vf.tau ?\n                    this._value0 + alpha * (this._value1 - this._value0) : this._value0;\n\n                this._value2 = this._vf.order > 1 && this._vf.tau ?\n                    this._value1 + alpha * (this._value2 - this._value1) : this._value1;\n\n                this._value3 = this._vf.order > 2 && this._vf.tau ?\n                    this._value2 + alpha * (this._value3 - this._value2) : this._value2;\n\n                this._value4 = this._vf.order > 3 && this._vf.tau ?\n                    this._value3 + alpha * (this._value4 - this._value3) : this._value3;\n\n                this._value5 = this._vf.order > 4 && this._vf.tau ?\n                    this._value4 + alpha * (this._value5 - this._value4) : this._value4;\n\n                var dist = Math.abs(this._value1 - this._value0);\n\n                if (this._vf.order > 1)\n                {\n                    var dist2 = Math.abs(this._value2 - this._value1);\n                    if (dist2 > dist) {dist = dist2;}\n                }\n                if (this._vf.order > 2)\n                {\n                    var dist3 = Math.abs(this._value3 - this._value2);\n                    if (dist3 > dist) {dist = dist3;}\n                }\n                if (this._vf.order > 3)\n                {\n                    var dist4 = Math.abs(this._value4 - this._value3);\n                    if (dist4 > dist) {dist = dist4;}\n                }\n                if (this._vf.order > 4)\n                {\n                    var dist5 = Math.abs(this._value5 - this._value4);\n                    if (dist5 > dist) {dist = dist5;}\n                }\n\n                if (dist <= this._eps)\n                {\n                    this._value1 = this._value0;\n                    this._value2 = this._value0;\n                    this._value3 = this._value0;\n                    this._value4 = this._value0;\n                    this._value5 = this._value0;\n\n                    this.postMessage('value', this._value0);\n                    this.postMessage('isActive', false);\n\n                    this._lastTick = 0;\n\n                    return false;\n                }\n\n                this.postMessage('value', this._value5);\n\n                this._lastTick = now;\n\n                return true;\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### CoordinateDamper ### */\nx3dom.registerNodeType(\n    \"CoordinateDamper\",\n    \"Followers\",\n    defineClass(x3dom.nodeTypes.X3DDamperNode,\n        \n        /**\n         * Constructor for CoordinateDamper\n         * @constructs x3dom.nodeTypes.CoordinateDamper\n         * @x3d 3.3\n         * @component Followers\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DDamperNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The CoordinateChaser animates transitions for array of 3D vectors (e.g., the coordinates of a\n         *  mesh). Whenever it receives an array of 3D vectors, the value_changed creates a transition from its\n         *  current value to the newly set number. It creates a smooth transition that ends duration seconds after the\n         *  last number has been received.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.CoordinateDamper.superClass.call(this, ctx);\n\n\n            /**\n             * The field initialDestination should be set to the same value than initialValue unless a transition to a\n             *  certain value is to be created right after the scene is loaded or right after the CoordinateChaser node\n             *  is created dynamically.\n             * @var {x3dom.fields.MFVec3f} initialDestination\n             * @memberof x3dom.nodeTypes.CoordinateDamper\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFVec3f(ctx, 'initialDestination', []);\n\n            /**\n             * The field initialValue can be used to set the initial value.\n             * @var {x3dom.fields.MFVec3f} initialValue\n             * @memberof x3dom.nodeTypes.CoordinateDamper\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFVec3f(ctx, 'initialValue', []);\n\n\n            /**\n             * The current coordinate value\n             * @var {x3dom.fields.MFVec3f} value\n             * @memberof x3dom.nodeTypes.CoordinateDamper\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFVec3f(ctx, 'value', []);\n\n            /**\n             * The target coordinate value\n             * @var {x3dom.fields.MFVec3f} destination\n             * @memberof x3dom.nodeTypes.CoordinateDamper\n             * @initvalue []\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFVec3f(ctx, 'destination', []);\n\n            x3dom.debug.logWarning(\"CoordinateDamper NYI\");\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### TexCoordDamper2D ### */\nx3dom.registerNodeType(\n    \"TexCoordDamper2D\",\n    \"Followers\",\n    defineClass(x3dom.nodeTypes.X3DDamperNode,\n        \n        /**\n         * Constructor for TexCoordDamper2D\n         * @constructs x3dom.nodeTypes.TexCoordDamper2D\n         * @x3d 3.3\n         * @component Followers\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DDamperNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The TexCoordDamper2D node animates transitions for an array of 2D vectors (e.g., the texture\n         *  coordinates of a mesh). Whenever the destination field receives an array of 2D vectors, value begins\n         *  sending an array of the same length, where each element moves from its current value towards the value at\n         *  the same position in the array received.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.TexCoordDamper2D.superClass.call(this, ctx);\n\n\n            /**\n             * The field initialDestination should be set to the same value than initialValue unless a transition to a\n             *  certain 2D vector value is to be created right after the scene is loaded or right after the\n             *  CoordinateDamper node is created dynamically.\n             * @var {x3dom.fields.MFVec2f} initialDestination\n             * @memberof x3dom.nodeTypes.TexCoordDamper2D\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFVec2f(ctx, 'initialDestination', []);\n\n            /**\n             * The field initialValue can be used to set the initial value of value_changed.\n             * @var {x3dom.fields.MFVec2f} initialValue\n             * @memberof x3dom.nodeTypes.TexCoordDamper2D\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFVec2f(ctx, 'initialValue', []);\n\n\n            /**\n             * The current value.\n             * @var {x3dom.fields.MFVec2f} value\n             * @memberof x3dom.nodeTypes.TexCoordDamper2D\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFVec2f(ctx, 'value', []);\n\n            /**\n             * The target value.\n             * @var {x3dom.fields.MFVec2f} destination\n             * @memberof x3dom.nodeTypes.TexCoordDamper2D\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFVec2f(ctx, 'destination', []);\n\n            x3dom.debug.logWarning(\"TexCoordDamper2D NYI\");\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### X3DInterpolatorNode ###\nx3dom.registerNodeType(\n    \"X3DInterpolatorNode\",\n    \"Interpolation\",\n    defineClass(x3dom.nodeTypes.X3DChildNode,\n        \n        /**\n         * Constructor for X3DInterpolatorNode\n         * @constructs x3dom.nodeTypes.X3DInterpolatorNode\n         * @x3d 3.3\n         * @component Interpolation\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DChildNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The abstract node X3DInterpolatorNode forms the basis for all types of interpolators.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DInterpolatorNode.superClass.call(this, ctx);\n\n\n            /**\n             * The key field contains the list of key times, the keyValue field contains values for the target field, one complete set of values for each key.\n             * Interpolator nodes containing no keys in the key field shall not produce any events.\n             * However, an input event that replaces an empty key field with one that contains keys will cause the interpolator node to produce events the next time that a set_fraction event is received.\n             * @var {x3dom.fields.MFFloat} key\n             * @memberof x3dom.nodeTypes.X3DInterpolatorNode\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFFloat(ctx, 'key', []);\n\n            /**\n             * The set_fraction inputOnly field receives an SFFloat event and causes the interpolator node function to evaluate, resulting in a value_changed output event of the specified type with the same timestamp as the set_fraction event.\n             * @var {x3dom.fields.SFFloat} set_fraction\n             * @memberof x3dom.nodeTypes.X3DInterpolatorNode\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'set_fraction', 0);\n\n             /**\n             * The url to the binary file, that contains the buffer data.\n             * @var {x3dom.fields.SFString} buffer\n             * @memberof x3dom.nodeTypes.X3DInterpolatorNode\n             * @initvalue \"\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'buffer', \"\");\n\n            /**\n             * Contains the interpolation method\n             * @var {x3dom.fields.SFString} interpolation\n             * @memberof x3dom.nodeTypes.X3DInterpolatorNode\n             * @initvalue \"LINEAR\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'interpolation', \"LINEAR\");\n\n            /**\n             * Specifies the duration\n             * @var {x3dom.fields.SFString} duration\n             * @memberof x3dom.nodeTypes.X3DInterpolatorNode\n             * @initvalue \"0\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'duration', 0);\n\n            this.addField_MFNode('views', x3dom.nodeTypes.BufferView );\n            this.addField_MFNode('accessors', x3dom.nodeTypes.BufferAccessor );\n\n            this._lastValue = undefined;\n\n            this.normalizeFromType = {\n                \"5120\": function(c) {return Math.max(c / 127.0, -1.0)},\n                \"5121\": function(c) {return c / 255.0;},\n                \"5122\": function(c) {return Math.max(c / 32767.0, -1.0)},\n                \"5123\": function(c) {return c / 65535.0;},\n                \"5125\": function(c) {return c / 4294967295;},\n                \"5126\": function(c) {return c;},\n            };\n        \n        },\n        {\n            nodeChanged: function ()\n            {\n                if (this._vf.buffer)\n                {\n                    x3dom.BinaryContainerLoader.setupBufferInterpolator(this);\n                }\n            },\n\n            linearInterp: function (time, interp)\n            {\n                if(this._vf.key.length == 0)\n                {\n                    return;\n                }\n\n                if (time <= this._vf.key[0])\n                {\n                    return this._vf.keyValue[0];\n                }\n                else if (time >= this._vf.key[this._vf.key.length-1])\n                {\n                    return this._vf.keyValue[this._vf.key.length-1];\n                }\n                    \n                for (var i = 0, n = this._vf.key.length-1; i<n; ++i)\n                {\n                    if ((this._vf.key[i] < time) && (time <= this._vf.key[i+1]))\n                    {\n                        return interp( this._vf.keyValue[i],\n                                       this._vf.keyValue[i+1],\n                                       (time - this._vf.key[i]) / (this._vf.key[i+1] - this._vf.key[i]) );\n                    }            \n                }\n\n                return this._vf.keyValue[0];\n            },\n\n            cubicSplineInterp: function (time, interp)\n            {\n                if(this._vf.key.length == 0)\n                {\n                    return;\n                }\n\n                var i, i3, interval, basis, t, intervalInSeconds; \n\n                if (time <= this._vf.key[0])\n                {\n                    return this._vf.keyValue[1];\n                }\n                else if (time >= this._vf.key[this._vf.key.length-1])\n                {\n                    return this._vf.keyValue[this._vf.keyValue.length-2];\n                }\n                    \n                for (i = 0, n = this._vf.key.length-1; i < n; ++i)\n                {\n                    if ((this._vf.key[i] < time) && (time <= this._vf.key[i+1]))\n                    {\n                        i3                = i*3;\n                        interval          = this._vf.key[i+1] - this._vf.key[i];\n                        t                 = (time - this._vf.key[i]) / interval;\n                        intervalInSeconds = interval * this._vf.duration;\n                        basis             = this.cubicSplineBasis( t, intervalInSeconds );\n\n                        return interp( this._vf.keyValue[i3+2],\n                                       this._vf.keyValue[i3+1],\n                                       this._vf.keyValue[i3+3],\n                                       this._vf.keyValue[i3+4],\n                                       basis.h00,\n                                       basis.h10,\n                                       basis.h01,\n                                       basis.h11 );\n                    }\n                }\n\n                return this._vf.keyValue[0];\n            },\n\n            cubicSplineBasis: function (t, intervalInSeconds)\n            {\n                var t2 = t*t;\n                var t3 = t2*t;\n                var h01 = -2*t3 + 3*t2;\n                var h11 = t3 - t2;\n                var h00 = 1 - h01; //2*t3 - 3*t2 + 1;\n                var h10 = h11 - t2 + t; //t3 - 2*t2 + t;\n                \n                return {\n                    'h00':h00,\n                    'h10': intervalInSeconds * h10,\n                    'h01':h01,\n                    'h11': intervalInSeconds * h11\n                };\n            },\n\n            keyValueFromArray: function (array) // to be redefined by interpolators\n            {\n                return array;\n            }\n        }\n    )\n);\n//global XHR cache\nx3dom.XHRCache = {}; // unify with x3dom.BinaryContainerLoader.bufferGeoCache\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### OrientationInterpolator ###\nx3dom.registerNodeType(\n    \"OrientationInterpolator\",\n    \"Interpolation\",\n    defineClass(x3dom.nodeTypes.X3DInterpolatorNode,\n        \n        /**\n         * Constructor for OrientationInterpolator\n         * @constructs x3dom.nodeTypes.OrientationInterpolator\n         * @x3d 3.3\n         * @component Interpolation\n         * @status full\n         * @extends x3dom.nodeTypes.X3DInterpolatorNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The OrientationInterpolator node interpolates among a list of rotation values specified in the keyValue field to produce an SFRotation value_changed event.\n         * These rotations are absolute in object space and therefore are not cumulative.\n         * The keyValue field shall contain exactly as many rotations as there are key frames in the key field.\n         * An orientation represents the final position of an object after a rotation has been applied.\n         * An OrientationInterpolator interpolates between two orientations by computing the shortest path on the unit sphere between the two orientations.\n         * The interpolation is linear in arc length along this path. The results are undefined if the two orientations are diagonally opposite.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.OrientationInterpolator.superClass.call(this, ctx);\n\n\n            /**\n             * Defines the set of data points, that are used for interpolation.\n             * If two consecutive keyValue values exist such that the arc length between them is greater than π, the interpolation will take place on the arc complement.\n             * For example, the interpolation between the orientations (0, 1, 0, 0) and (0, 1, 0, 5.0) is equivalent to the rotation between the orientations (0, 1, 0, 2π) and (0, 1, 0, 5.0).\n             * @var {x3dom.fields.MFRotation} keyValue\n             * @memberof x3dom.nodeTypes.OrientationInterpolator\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFRotation(ctx, 'keyValue', []);\n        \n        },\n        {\n            fieldChanged: function(fieldName)\n            {\n                if(fieldName === \"set_fraction\")\n                {\n                    var value;\n  \n                    if (this._vf.interpolation === \"CUBICSPLINE\")\n                    {\n                        value = this.cubicSplineInterp(this._vf.set_fraction, function (startInTangent, start, endOutTangent, end, h00, h10, h01, h11) {\n\n                            function _applyBasis(axis)//p0, m0, p1, m1, axis)\n                            {                                   \n                                return h00 * start[axis] + h10 * startInTangent[axis] + h01 * end[axis] + h11 * endOutTangent[axis];\n                            }\n                            \n                            var result = new x3dom.fields.Quaternion(0, 0, 0, 0);\n\n                            // do not use Quaternion methods to avoid generating objects\n\n                            result.x = _applyBasis('x');\n                            result.y = _applyBasis('y');\n                            result.z = _applyBasis('z');\n                            result.w = _applyBasis('w');\n\n                            var s = Math.sqrt(1/result.dot(result));\n\n                            result.x *= s;\n                            result.y *= s;\n                            result.z *= s;\n                            result.w *= s;\n\n                            return result;//normalize(result);\n                        \n                        });\n                    }\n                    else\n                    {\n                        value = this.linearInterp(this._vf.set_fraction, function (a, b, t) {\n                            return a.slerp(b, t);\n                        });\n                    }\n\n                    if(value != undefined && value != this._lastValue)\n                    {\n                        this._lastValue = value;\n                        this.postMessage('value_changed', value);\n                    }\n                }\n            },\n            \n            keyValueFromAccessor: function(array, type)\n            {\n                var keyValue = new x3dom.fields.MFRotation();\n                var normalize = this.normalizeFromType[type];\n                array.forEach( function (val, i)\n                {\n                    if (i%4 == 3) {\n                        keyValue.push( new x3dom.fields.Quaternion (\n                            normalize(array[i-3]),\n                            normalize(array[i-2]),\n                            normalize(array[i-1]),\n                            normalize(val)\n                        ));  \n                    }\n                })\n                return keyValue;\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### PositionInterpolator ###\nx3dom.registerNodeType(\n    \"PositionInterpolator\",\n    \"Interpolation\",\n    defineClass(x3dom.nodeTypes.X3DInterpolatorNode,\n        \n        /**\n         * Constructor for PositionInterpolator\n         * @constructs x3dom.nodeTypes.PositionInterpolator\n         * @x3d 3.3\n         * @component Interpolation\n         * @status full\n         * @extends x3dom.nodeTypes.X3DInterpolatorNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The PositionInterpolator node linearly interpolates among a list of 3D vectors to produce an SFVec3f value_changed event. The keyValue field shall contain exactly as many values as in the key field.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.PositionInterpolator.superClass.call(this, ctx);\n\n\n            /**\n             * Defines the set of data points, that are used for interpolation.\n             * @var {x3dom.fields.MFVec3f} keyValue\n             * @memberof x3dom.nodeTypes.PositionInterpolator\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFVec3f(ctx, 'keyValue', []);\n        \n        },\n        {\n            fieldChanged: function(fieldName)\n            {\n                if(fieldName === \"set_fraction\")\n                {\n                    var value;\n       \n                    if (this._vf.interpolation === 'CUBICSPLINE')\n                    {\n                        value = this.cubicSplineInterp(this._vf.set_fraction, function (startInTangent, start, endOutTangent, end, h00, h10, h01, h11) {\n\n                            function _applyBasis(axis)//p0, m0, p1, m1, axis)\n                            {                                   \n                                return h00 * start[axis] + h10 * startInTangent[axis] + h01 * end[axis] + h11 * endOutTangent[axis];\n                            }\n                            \n                            var result = new x3dom.fields.SFVec3f();\n\n                            // do not use SFVec3f methods to avoid generating objects\n\n                            result.x = _applyBasis('x');\n                            result.y = _applyBasis('y');\n                            result.z = _applyBasis('z');\n                            return result;\n                        });\n                    }\n                    else\n                    {\n                        value = this.linearInterp(this._vf.set_fraction, function (a, b, t) {\n                            var result = a.multiply(1.0-t);\n                            result.x += t*b.x;\n                            result.y += t*b.y;\n                            result.z += t*b.z;\n                            return result;//a.multiply(1.0-t).add(b.multiply(t));\n                        });\n                    }\n                                        \n                    if(value != undefined && value != this._lastValue)\n                    {\n                        this._lastValue = value;\n                        this.postMessage('value_changed', value);\n                    }\n                }\n            },\n            \n            keyValueFromAccessor: function(array)\n            {\n                keyValue = new x3dom.fields.MFVec3f();\n                array.forEach( function (val, i)\n                {\n                    if (i%3 == 2) {\n                        keyValue.push( new x3dom.fields.SFVec3f (\n                            array[i-2],\n                            array[i-1],\n                            val\n                        ));  \n                    }\n                })\n                return keyValue;\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### PositionInterpolator2D ###\nx3dom.registerNodeType(\n    \"PositionInterpolator2D\",\n    \"Interpolation\",\n    defineClass(x3dom.nodeTypes.X3DInterpolatorNode,\n        \n        /**\n         * Constructor for PositionInterpolator2D\n         * @constructs x3dom.nodeTypes.PositionInterpolator2D\n         * @x3d 3.3\n         * @component Interpolation\n         * @status full\n         * @extends x3dom.nodeTypes.X3DInterpolatorNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The PositionInterpolator2D node linearly interpolates among a list of 2D vectors to produce an SFVec2f value_changed event. The keyValue field shall contain exactly as many values as in the key field.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.PositionInterpolator2D.superClass.call(this, ctx);\n\n\n            /**\n             * Defines the set of data points, that are used for interpolation.\n             * @var {x3dom.fields.MFVec3f} keyValue\n             * @memberof x3dom.nodeTypes.PositionInterpolator2D\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFVec2f(ctx, 'keyValue', []);\n        \n        },\n        {\n            fieldChanged: function(fieldName)\n            {\n                if(fieldName === \"set_fraction\")\n                {\n                    var value = this.linearInterp(this._vf.set_fraction, function (a, b, t) {\n                        return a.multiply(1.0-t).add(b.multiply(t));\n                    });\n\n                    this.postMessage('value_changed', value);\n                }\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### NormalInterpolator ###\nx3dom.registerNodeType(\n    \"NormalInterpolator\",\n    \"Interpolation\",\n    defineClass(x3dom.nodeTypes.X3DInterpolatorNode,\n        \n        /**\n         * Constructor for NormalInterpolator\n         * @constructs x3dom.nodeTypes.NormalInterpolator\n         * @x3d 3.3\n         * @component Interpolation\n         * @status full\n         * @extends x3dom.nodeTypes.X3DInterpolatorNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The NormalInterpolator node interpolates among a list of normal vector sets specified by the keyValue field to produce an MFVec3f value_changed event.\n         * The output vector, value_changed, shall be a set of normalized vectors.\n         * Values in the keyValue field shall be of unit length.\n         * The number of normals in the keyValue field shall be an integer multiple of the number of key frames in the key field.\n         * That integer multiple defines how many normals will be contained in the value_changed events.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.NormalInterpolator.superClass.call(this, ctx);\n\n\n            /**\n             * Defines the set of data points, that are used for interpolation.\n             * Values in the keyValue field shall be of unit length.\n             * @var {x3dom.fields.MFVec3f} keyValue\n             * @memberof x3dom.nodeTypes.NormalInterpolator\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFVec3f(ctx, 'keyValue', []);\n        \n        },\n        {\n            fieldChanged: function(fieldName)\n            {\n                if(fieldName === \"set_fraction\")\n                {\n                    var value = this.linearInterp(this._vf.set_fraction, function (a, b, t) {\n                        return a.multiply(1.0-t).add(b.multiply(t)).normalize();\n                    });\n\n                    if(value != undefined && value != this._lastValue)\n                    {\n                        this._lastValue = value;\n                        this.postMessage('value_changed', value);\n                    }\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### ColorInterpolator ###\nx3dom.registerNodeType(\n    \"ColorInterpolator\",\n    \"Interpolation\",\n    defineClass(x3dom.nodeTypes.X3DInterpolatorNode,\n        \n        /**\n         * Constructor for ColorInterpolator\n         * @constructs x3dom.nodeTypes.ColorInterpolator\n         * @x3d 3.3\n         * @component Interpolation\n         * @status full\n         * @extends x3dom.nodeTypes.X3DInterpolatorNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The ColorInterpolator node interpolates among a list of MFColor key values to produce an SFColor (RGB) value_changed event.\n         * The number of colours in the keyValue field shall be equal to the number of key frames in the key field.\n         * A linear interpolation using the value of set_fraction as input is performed in HSV space.\n         * The results are undefined when interpolating between two consecutive keys with complementary hues.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.ColorInterpolator.superClass.call(this, ctx);\n\n\n            /**\n             * Defines the set of data points, that are used for interpolation.\n             * @var {x3dom.fields.MFColor} keyValue\n             * @memberof x3dom.nodeTypes.ColorInterpolator\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFColor(ctx, 'keyValue', []);\n        \n        },\n        {\n            fieldChanged: function(fieldName)\n            {\n                if(fieldName === \"set_fraction\")\n                {\n                    // FIXME; perform color interpolation in HSV space\n                    var value = this.linearInterp(this._vf.set_fraction, function (a, b, t) {\n                        return a.multiply(1.0-t).add(b.multiply(t));\n                    });\n\n                    if(value != undefined && value != this._lastValue)\n                    {\n                        this._lastValue = value;\n                        this.postMessage('value_changed', value);\n                    }\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### ScalarInterpolator ###\nx3dom.registerNodeType(\n    \"ScalarInterpolator\",\n    \"Interpolation\",\n    defineClass(x3dom.nodeTypes.X3DInterpolatorNode,\n        \n        /**\n         * Constructor for ScalarInterpolator\n         * @constructs x3dom.nodeTypes.ScalarInterpolator\n         * @x3d 3.3\n         * @component Interpolation\n         * @status full\n         * @extends x3dom.nodeTypes.X3DInterpolatorNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The ScalarInterpolator node linearly interpolates among a list of SFFloat values to produce an SFFloat value_changed event.\n         * This interpolator is appropriate for any parameter defined using a single floating point value.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.ScalarInterpolator.superClass.call(this, ctx);\n\n\n            /**\n             * Defines the set of data points, that are used for interpolation.\n             * @var {x3dom.fields.MFFloat} keyValue\n             * @memberof x3dom.nodeTypes.ScalarInterpolator\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFFloat(ctx, 'keyValue', []);\n        \n        },\n        {\n            fieldChanged: function(fieldName)\n            {\n                if(fieldName === \"set_fraction\")\n                {\n                    var value;\n\n                    if (this._vf.interpolation === 'CUBICSPLINE')\n                    {\n                        var scope = this;\n                        value = this.cubicSplineInterp(this._vf.set_fraction, function (startInTangent, start, endOutTangent, end, h00, h10, h01, h11) {\n\n                            return h00 * start + h10 * startInTangent + h01 * end + h11 * endOutTangent;\n                        \n                        });\n                    }\n                    else\n                    {\n                        value = this.linearInterp(this._vf.set_fraction, function (a, b, t) {\n                            return (1.0-t)*a + t*b;\n                        });\n                    }\n                   \n                    if(value != undefined && value != this._lastValue)\n                    {\n                        this._lastValue = value;\n                        this.postMessage('value_changed', value);\n                    }\n                }\n            },\n\n            keyValueFromAccessor: function(array, type)\n            {\n                var normalize = this.normalizeFromType[type];\n                return array.map( function (val)\n                {\n                    return normalize(val);\n                });\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### CoordinateInterpolator ###\nx3dom.registerNodeType(\n    \"CoordinateInterpolator\",\n    \"Interpolation\",\n    defineClass(x3dom.nodeTypes.X3DInterpolatorNode,\n        \n        /**\n         * Constructor for CoordinateInterpolator\n         * @constructs x3dom.nodeTypes.CoordinateInterpolator\n         * @x3d 3.3\n         * @component Interpolation\n         * @status full\n         * @extends x3dom.nodeTypes.X3DInterpolatorNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The CoordinateInterpolator node linearly interpolates among a list of MFVec3f values to produce an MFVec3f value_changed event.\n         * The number of coordinates in the keyValue field shall be an integer multiple of the number of key frames in the key field.\n         * That integer multiple defines how many coordinates will be contained in the value_changed events.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.CoordinateInterpolator.superClass.call(this, ctx);\n\n\n            /**\n             * Defines the set of data points, that are used for interpolation.\n             * @var {x3dom.fields.MFVec3f} keyValue\n             * @memberof x3dom.nodeTypes.CoordinateInterpolator\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFVec3f(ctx, 'keyValue', []);\n\n            if (ctx && ctx.xmlNode.hasAttribute('keyValue')) {\n                this._vf.keyValue = [];     // FIXME!!!\n\n                var arr = x3dom.fields.MFVec3f.parse(ctx.xmlNode.getAttribute('keyValue'));\n                var key = this._vf.key.length > 0 ? this._vf.key.length : 1;\n                var len = arr.length / key;\n                for (var i=0; i<key; i++) {\n                    var val = new x3dom.fields.MFVec3f();\n                    for (var j=0; j<len; j++) {\n                        val.push( arr[i*len+j] );\n                    }\n                    this._vf.keyValue.push(val);\n                }\n            }\n        \n        },\n        {\n            fieldChanged: function(fieldName)\n            {\n                if(fieldName === \"set_fraction\")\n                {\n                    var value = this.linearInterp(this._vf.set_fraction, function (a, b, t) {\n                        var val = new x3dom.fields.MFVec3f();\n                        for (var i=0; i<a.length; i++)\n                            val.push(a[i].multiply(1.0-t).add(b[i].multiply(t)));\n\n                        return val;\n                    });\n\n                    if(value != undefined && value != this._lastValue)\n                    {\n                        this._lastValue = value;\n                        this.postMessage('value_changed', value);\n                    }\n                }\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * Based on code originally provided by\n * http://www.x3dom.org\n * \n * (C)2014 Toshiba Corporation, Japan.\n * Dual licensed under the MIT and GPL\n */\n\n// ### SplinePositionInterpolator ###\nx3dom.registerNodeType(\n    \"SplinePositionInterpolator\",\n    \"Interpolation\",\n    defineClass(x3dom.nodeTypes.X3DInterpolatorNode,\n        \n        /**\n         * Constructor for SplinePositionInterpolator\n         * @constructs x3dom.nodeTypes.SplinePositionInterpolator\n         * @x3d 3.3\n         * @component Interpolation\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DInterpolatorNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The SplinePositionInterpolator node non-linearly interpolates among a list of 3D vectors to produce an SFVec3f value_changed event. The keyValue, keyVelocity, and key fields shall each have the same number of values.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.SplinePositionInterpolator.superClass.call(this, ctx);\n\n            /**\n             * Defines the set of data points, that are used for interpolation.\n             * @var {x3dom.fields.MFVec3f} keyValue\n             * @memberof x3dom.nodeTypes.SplinePositionInterpolator\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFVec3f(ctx, 'keyValue', []);\n\t\t\t\n\t\t\t/**\n             * Defines the set of velocity vectors, that are used for interpolation.\n             * @var {x3dom.fields.MFVec3f} keyVelocity\n             * @memberof x3dom.nodeTypes.SplinePositionInterpolator\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n\t\t\tthis.addField_MFVec3f(ctx, 'keyVelocity', []);\n\t\t\t\n\t\t\t/**\n             * Specifies whether the interpolator should provide a closed loop, with continuous velocity vectors as the interpolator transitions from the last key to the first key.\n             * @var {x3dom.fields.SFBool} closed\n             * @memberof x3dom.nodeTypes.SplinePositionInterpolator\n             * @initvalue false\n             * @field x3d\n             * @instance\n             */\n\t\t\tthis.addField_SFBool(ctx, 'closed', false);\n\t\t\t\n\t\t\t/**\n             * Specifies whether the velocity vectors are to be transformed into normalized tangency vectors.\n             * @var {x3dom.fields.SFBool} normalizeVelocity\n             * @memberof x3dom.nodeTypes.SplinePositionInterpolator\n             * @initvalue false\n             * @field x3d\n             * @instance\n             */\n\t\t\tthis.addField_SFBool(ctx, 'normalizeVelocity', false);\n\t\t\t \n\t\t\t/******** Private variables and functions ***********/\n\t\t\t\n\t\t\t/* dtot is the sum of the distance between all adjacent keys.\n\t\t\t * dtot = SUM{i=0, i < n-1}(|vi - vi+1|)\n\t\t\t */\n\t\t\tthis.dtot = 0.0;\n\t\t\t\n\t\t\t/* Non-uniform interval adjusted velocity vectors\n\t\t\t */\n\t\t\tthis.T0 = [];\n\t\t\tthis.T1 = [];\n\t\t\t\n\t\t\t/* Checks sanity. Node is sane if (|key| == |key_value|) and (|key| == |key_velocity| or |key_velocity| == 0 or (|key_velocity| == 2 and |key| >= 2))\n\t\t\t */\n\t\t\tthis.checkSanity = function() {\n\t\t\t\tvar sane = (this._vf.key.length == this._vf.keyValue.length) &&\n\t\t\t\t\t\t   ((this._vf.key.length == this._vf.keyVelocity.length) || (this._vf.keyVelocity.length == 2 && this._vf.key.length >= 2) || (this._vf.keyVelocity.length == 0));\n\t\t\t\tif(!sane)\n\t\t\t\t\tx3dom.debug.logWarning(\"SplinePositionInterpolator Node: 'key' , 'keyValue' and/or 'keyVelocity' fields have inappropriate sizes\");\n\t\t\t};\n\t\t\t\n\t\t\t/* Calculate dtot (sum of distances between all adjacent keys)\n\t\t\t */\n\t\t\tthis.calcDtot = function()\n\t\t\t{\n\t\t\t\tthis.dtot = 0.0;\n\t\t\t\tfor(var i = 0; i < this._vf.key.length-1; i++) \n\t\t\t\t{\n\t\t\t\t\tthis.dtot += Math.abs(this._vf.key[i] - this._vf.key[i+1]);\n\t\t\t\t}\n\t\t\t};\n\t\t\t \n\t\t\t/* Calculate non-uniform interval adjusted velocity vectors\n\t\t\t */\n\t\t\tthis.calcAdjustedKeyVelocity = function()\n\t\t\t{\n\t\t\t\tvar i, Ti, F_plus_i, F_minus_i;\n\t\t\t\tvar N = this._vf.key.length;\n\t\t\t\t\n\t\t\t\t// If velocities are defined at all the control points, ignore 'closed' field\n\t\t\t\tif(this._vf.keyVelocity.length == N)\n\t\t\t\t{\n\t\t\t\t\tfor(i = 0; i < N; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tTi = this._vf.keyVelocity[i];\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(this._vf.normalizeVelocity)\n\t\t\t\t\t\t\tTi = Ti.multiply(this.dtot / Ti.length());\n\t\t\t\t\t\t\n\t\t\t\t\t\tF_plus_i = (i == 0 || i == N-1) ? 1.0 : 2.0 * (this._vf.key[i] - this._vf.key[i-1]) / (this._vf.key[i+1] - this._vf.key[i-1]);\n\t\t\t\t\t\tF_minus_i= (i == 0 || i == N-1) ? 1.0 : 2.0 * (this._vf.key[i+1] - this._vf.key[i]) / (this._vf.key[i+1] - this._vf.key[i-1]);\n\t\t\t\t\t\t\n\t\t\t\t\t\tthis.T0[i] =  Ti.multiply(F_plus_i);\n\t\t\t\t\t\tthis.T1[i] =  Ti.multiply(F_minus_i);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// if only first and last velocities are specified, ignore 'closed' field\n\t\t\t\telse if(this._vf.keyVelocity.length == 2 && N > 2)\n\t\t\t\t{\n\t\t\t\t\tfor(i = 0; i < N; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(i == 0)\n\t\t\t\t\t\t\tTi = this._vf.keyVelocity[0];\n\t\t\t\t\t\telse if(i == N-1)\n\t\t\t\t\t\t\tTi = this._vf.keyVelocity[1];\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tTi = this._vf.keyValue[i+1].subtract(this._vf.keyValue[i-1]).multiply(0.5);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(this._vf.normalizeVelocity)\n\t\t\t\t\t\t\tTi = Ti.multiply(this.dtot / Ti.length());\n\t\t\t\t\t\t\n\t\t\t\t\t\tF_plus_i = (i == 0 || i == N-1) ? 1.0 : 2.0 * (this._vf.key[i] - this._vf.key[i-1]) / (this._vf.key[i+1] - this._vf.key[i-1]);\n\t\t\t\t\t\tF_minus_i= (i == 0 || i == N-1) ? 1.0 : 2.0 * (this._vf.key[i+1] - this._vf.key[i]) / (this._vf.key[i+1] - this._vf.key[i-1]);\n\t\t\t\t\t\t\n\t\t\t\t\t\tthis.T0[i] =  Ti.multiply(F_plus_i);\n\t\t\t\t\t\tthis.T1[i] =  Ti.multiply(F_minus_i);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// velocities are unspecified\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// ignore closed if first and last keyValues are not equal\n\t\t\t\t\tvar closed = this._vf.closed && this._vf.keyValue[0].equals(this._vf.keyValue[N-1], 0.00001);\n\t\t\t\t\t\n\t\t\t\t\tfor(i = 0; i < N; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif((i == 0 || i == N-1) && !closed)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.T0[i] = new x3dom.fields.SFVec3f(0, 0, 0);\n\t\t\t\t\t\t\tthis.T1[i] = new x3dom.fields.SFVec3f(0, 0, 0);\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if((i == 0 || i == N-1) && closed)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tTi = this._vf.keyValue[1].subtract(this._vf.keyValue[N-2]).multiply(0.5);\n\t\t\t\t\t\t\tif(i == 0) {\n\t\t\t\t\t\t\t\tF_plus_i = 2.0 * (this._vf.key[0] - this._vf.key[N-2]) / (this._vf.key[1] - this._vf.key[N-2]);\n\t\t\t\t\t\t\t\tF_minus_i= 2.0 * (this._vf.key[1] - this._vf.key[0]) / (this._vf.key[1] - this._vf.key[N-2]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tF_plus_i = 2.0 * (this._vf.key[N-1] - this._vf.key[N-2]) / (this._vf.key[1] - this._vf.key[N-2]);\n\t\t\t\t\t\t\t\tF_minus_i= 2.0 * (this._vf.key[1] - this._vf.key[N-1]) / (this._vf.key[1] - this._vf.key[N-2]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tF_plus_i = 2.0 * (this._vf.key[N-1] - this._vf.key[N-2]) / (this._vf.key[N-2] - this._vf.key[1]);\n\t\t\t\t\t\t\tF_minus_i= 2.0 * (this._vf.key[1] - this._vf.key[0]) / (this._vf.key[N-2] - this._vf.key[1]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tTi = this._vf.keyValue[i+1].subtract(this._vf.keyValue[i-1]).multiply(0.5);\n\t\t\t\t\t\t\tF_plus_i = 2.0 * (this._vf.key[i] - this._vf.key[i-1]) / (this._vf.key[i+1] - this._vf.key[i-1]);\n\t\t\t\t\t\t\tF_minus_i= 2.0 * (this._vf.key[i+1] - this._vf.key[i]) / (this._vf.key[i+1] - this._vf.key[i-1]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tthis.T0[i] =  Ti.multiply(F_plus_i);\n\t\t\t\t\t\tthis.T1[i] =  Ti.multiply(F_minus_i);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\t\n\t\t\tthis.checkSanity();\n\t\t\tthis.calcDtot();\n\t\t\tthis.calcAdjustedKeyVelocity();\n        },\n        {\n            fieldChanged: function(fieldName)\n            {\n\t\t\t\tswitch(fieldName)\n\t\t\t\t{\n\t\t\t\t\tcase 'key':\n\t\t\t\t\tcase 'keyValue':\n\t\t\t\t\tcase 'keyVelocity':\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.checkSanity();\n\t\t\t\t\t\tthis.calcDtot();\n\t\t\t\t\t\tthis.calcAdjustedKeyVelocity();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase 'closed':\n\t\t\t\t\tcase 'normalizeVelocity':\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.calcAdjustedKeyVelocity();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase 'set_fraction':\n\t\t\t\t\t{\n\t\t\t\t\t\tvar value;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(this._vf.key.length > 0.0) {\n\t\t\t\t\t\t\tif (this._vf.set_fraction <= this._vf.key[0])\n\t\t\t\t\t\t\t\tvalue = x3dom.fields.SFVec3f.copy(this._vf.keyValue[0]);\n\n\t\t\t\t\t\t\telse if (this._vf.set_fraction >= this._vf.key[this._vf.key.length-1])\n\t\t\t\t\t\t\t\tvalue = x3dom.fields.SFVec3f.copy(this._vf.keyValue[this._vf.key.length-1]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor(var i = 0; i < this._vf.key.length-1; i++) {\n\t\t\t\t\t\t\tif ((this._vf.key[i] < this._vf.set_fraction) && (this._vf.set_fraction <= this._vf.key[i+1])) {\n\t\t\t\t\t\t\t\tvar s = (this._vf.set_fraction - this._vf.key[i]) / (this._vf.key[i+1]-this._vf.key[i]);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tvar S_H = new x3dom.fields.SFVec4f(2.0*s*s*s - 3.0*s*s + 1.0, -2.0*s*s*s + 3.0*s*s, s*s*s - 2.0*s*s + s, s*s*s - s*s);\n\t\t\t\t\t\t\t\tvalue = new x3dom.fields.SFVec3f(S_H.x * this._vf.keyValue[i].x + S_H.y * this._vf.keyValue[i+1].x + S_H.z * this.T0[i].x + S_H.w * this.T1[i+1].x,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t     S_H.x * this._vf.keyValue[i].y + S_H.y * this._vf.keyValue[i+1].y + S_H.z * this.T0[i].y + S_H.w * this.T1[i+1].y,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t     S_H.x * this._vf.keyValue[i].z + S_H.y * this._vf.keyValue[i+1].z + S_H.z * this.T0[i].z + S_H.w * this.T1[i+1].z);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(value != undefined && value != this._lastValue)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis._lastValue = value;\n\t\t\t\t\t\t\tthis.postMessage('value_changed', value);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### TimeSensor ###\nx3dom.registerNodeType(\n    \"TimeSensor\",\n    \"Time\",\n    defineClass(x3dom.nodeTypes.X3DSensorNode,\n        \n        /**\n         * Constructor for TimeSensor\n         * @constructs x3dom.nodeTypes.TimeSensor\n         * @x3d 3.3\n         * @component Time\n         * @status full\n         * @extends x3dom.nodeTypes.X3DSensorNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc TimeSensor nodes generate events as time passes.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.TimeSensor.superClass.call(this, ctx);\n\n            if (ctx)\n                ctx.doc._nodeBag.timer.push(this);\n            else\n                x3dom.debug.logWarning(\"TimeSensor: No runtime context found!\");\n\n\n            /**\n             * The \"cycle\" of a TimeSensor node lasts for cycleInterval seconds. The value of cycleInterval shall be greater than zero.\n             * @var {x3dom.fields.SFTime} cycleInterval\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.TimeSensor\n             * @initvalue 1\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFTime(ctx, 'cycleInterval', 1);\n\n\n            /**\n             * Specifies whether the timer cycle loops.\n             * @var {x3dom.fields.SFBool} loop\n             * @memberof x3dom.nodeTypes.TimeSensor\n             * @initvalue false\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'loop', false);\n\n            /**\n             * Sets the startTime for the cycle.\n             * @var {x3dom.fields.SFTime} startTime\n             * @memberof x3dom.nodeTypes.TimeSensor\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFTime(ctx, 'startTime', 0);\n\n            /**\n             * Sets a time for the timer to stop.\n             * @var {x3dom.fields.SFTime} stopTime\n             * @memberof x3dom.nodeTypes.TimeSensor\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFTime(ctx, 'stopTime', 0);\n\n            /**\n             * Sets a time for the timer to pause.\n             * @var {x3dom.fields.SFTime} pauseTime\n             * @memberof x3dom.nodeTypes.TimeSensor\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFTime(ctx, 'pauseTime', 0);\n\n            /**\n             * Sets a time for the timer to resume from pause.\n             * @var {x3dom.fields.SFTime} resumeTime\n             * @memberof x3dom.nodeTypes.TimeSensor\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFTime(ctx, 'resumeTime', 0);\n\n\n            /**\n             * A cycleTime outputOnly field can be used for synchronization purposes such as sound with animation.\n             * The value of a cycleTime event will be equal to the time at the beginning of the current cycle. A cycleTime event is generated at the beginning of every cycle, including the cycle starting at startTime.\n             * The first cycleTime event for a TimeSensor node can be used as an alarm (single pulse at a specified time).\n             * @var {x3dom.fields.SFTime} cycleTime\n             * @memberof x3dom.nodeTypes.TimeSensor\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFTime(ctx, 'cycleTime', 0);\n\n            /**\n             * The elapsedTime outputOnly field delivers the current elapsed time since the TimeSensor was activated and running, cumulative in seconds and not counting any time while in a paused state.\n             * @var {x3dom.fields.SFTime} elapsedTime\n             * @memberof x3dom.nodeTypes.TimeSensor\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFTime(ctx, 'elapsedTime', 0);\n\n            /**\n             * fraction_changed events output a floating point value in the closed interval [0, 1]. At startTime the value of fraction_changed is 0. After startTime, the value of fraction_changed in any cycle will progress through the range (0.0, 1.0].\n             * @var {x3dom.fields.SFFloat} fraction_changed\n             * @memberof x3dom.nodeTypes.TimeSensor\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'fraction_changed', 0);\n\n            /**\n             * Outputs whether the timer is active.\n             * @var {x3dom.fields.SFBool} isActive\n             * @memberof x3dom.nodeTypes.TimeSensor\n             * @initvalue false\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'isActive', false);\n\n            /**\n             * Outputs whether the timer is paused.\n             * @var {x3dom.fields.SFBool} isPaused\n             * @memberof x3dom.nodeTypes.TimeSensor\n             * @initvalue false\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'isPaused', false);\n\n            /**\n             * The time event sends the absolute time for a given tick of the TimeSensor node.\n             * @var {x3dom.fields.SFTime} time\n             * @memberof x3dom.nodeTypes.TimeSensor\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFTime(ctx, 'time', 0);\n\n\n            /**\n             *\n             * @var {x3dom.fields.SFBool} first\n             * @memberof x3dom.nodeTypes.TimeSensor\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx,'first', true);\n\n            /**\n             *\n             * @var {x3dom.fields.SFFloat} firstCycle\n             * @memberof x3dom.nodeTypes.TimeSensor\n             * @initvalue 0.0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx,'firstCycle', 0.0);\n\n            this._prevCycle = -1;\n            this._lastTime = 0;\n            this._cycleStopTime = 0;\n            this._activatedTime = 0;\n\n            if (this._vf.startTime > 0) {\n                this._updateCycleStopTime();\n            }\n\n            this._backupStartTime = this._vf.startTime;\n            this._backupStopTime = this._vf.stopTime;\n            this._backupCycleInterval = this._vf.cycleInterval;\n        \n        },\n        {\n            tick: function (time)\n            {\n                if (!this._vf.enabled) {\n                    this._lastTime = time;\n                    return false;\n                }\n\n                var isActive = ( this._vf.cycleInterval > 0 &&\n                    time >= this._vf.startTime &&\n                    (time < this._vf.stopTime || this._vf.stopTime <= this._vf.startTime) &&\n                    (this._vf.loop == true || (this._vf.loop == false && time < this._cycleStopTime)) );\n\n                if (isActive && !this._vf.isActive) {\n                    this.postMessage('isActive', true);\n                    this._activatedTime = time;\n                }\n\n                // Checking for this._vf.isActive allows the dispatch of 'final events' (before deactivation)\n                if (isActive || this._vf.isActive) {\n                    this.postMessage('elapsedTime', time - this._activatedTime);\n\n                    var isPaused = ( time >= this._vf.pauseTime && this._vf.pauseTime > this._vf.resumeTime );\n\n                    if (isPaused && !this._vf.isPaused) {\n                        this.postMessage('isPaused', true);\n                        this.postMessage('pauseTime', time);\n                    } else if (!isPaused && this._vf.isPaused) {\n                        this.postMessage('isPaused', false);\n                        this.postMessage('resumeTime', time);\n                    }\n\n                    if (!isPaused) {\n                        var cycleFrac = this._getCycleAt(time);\n                        var cycle = Math.floor(cycleFrac);\n\n                        var cycleTime = this._vf.startTime + cycle*this._vf.cycleInterval;\n                        var adjustTime = 0;\n\n                        if (this._vf.stopTime > this._vf.startTime &&\n                            this._lastTime < this._vf.stopTime && time >= this._vf.stopTime)\n                            adjustTime = this._vf.stopTime;\n                        else if (this._lastTime < cycleTime && time >= cycleTime)\n                            adjustTime = cycleTime;\n\n                        if( adjustTime > 0 ) {\n                            time = adjustTime;\n                            cycleFrac = this._getCycleAt(time);\n                            cycle = Math.floor(cycleFrac);\n                        }\n\n                        var fraction = cycleFrac - cycle;\n\n                        if (fraction < x3dom.fields.Eps) {\n                            fraction = ( this._lastTime < this._vf.startTime ? 0.0 : 1.0 );\n                            this.postMessage('cycleTime', time);\n                        }\n\n                        this.postMessage('fraction_changed', fraction);\n\n                        this.postMessage('time', time);\n                    }\n                }\n\n                if (!isActive && this._vf.isActive)\n                    this.postMessage('isActive', false);\n\n                this._lastTime = time;\n\n                return true;\n            },\n\n            fieldChanged: function(fieldName)\n            {\n                if (fieldName == \"enabled\") {\n                    // TODO; eval other relevant outputs\n                    if (!this._vf.enabled && this._vf.isActive) {\n                        this.postMessage('isActive', false);\n                    }\n                }\n                else if (fieldName == \"startTime\") {\n                    // Spec: Should be ignored when active. (Restore old value)\n                    if (this._vf.isActive) {\n                        this._vf.startTime = this._backupStartTime;\n                        return;\n                    }\n\n                    this._backupStartTime = this._vf.startTime;\n                    this._updateCycleStopTime();\n                }\n                else if (fieldName == \"stopTime\") {\n                    // Spec: Should be ignored when active and less than startTime. (Restore old value)\n                    if (this._vf.isActive && this._vf.stopTime <= this._vf.startTime) {\n                        this._vf.stopTime = this._backupStopTime;\n                        return;\n                    }\n\n                    this._backupStopTime = this._vf.stopTime;\n                }\n                else if (fieldName == \"cycleInterval\") {\n                    // Spec: Should be ignored when active. (Restore old value)\n                    if (this._vf.isActive) {\n                        this._vf.cycleInterval = this._backupCycleInterval;\n                        return;\n                    }\n\n                    this._backupCycleInterval = this._vf.cycleInterval;\n                }\n                else if (fieldName == \"loop\") {\n                    this._updateCycleStopTime();\n                }\n            },\n\n            parentRemoved: function(parent)\n            {\n                if (this._parentNodes.length === 0) {\n                    var doc = this.findX3DDoc();\n\n                    for (var i=0, n=doc._nodeBag.timer.length; i<n; i++) {\n                        if (doc._nodeBag.timer[i] === this) {\n                            doc._nodeBag.timer.splice(i, 1);\n                        }\n                    }\n                }\n            },\n\n            _getCycleAt: function(time)\n            {\n                return Math.max( 0.0, time - this._vf.startTime ) / this._vf.cycleInterval;\n            },\n\n            _updateCycleStopTime: function()\n            {\n                if (this._vf.loop == false) {\n                    var now = new Date().getTime() / 1000;\n                    var cycleToStop = Math.floor(this._getCycleAt(now)) + 1;\n\n                    this._cycleStopTime = this._vf.startTime + cycleToStop*this._vf.cycleInterval;\n                }\n                else {\n                    this._cycleStopTime = 0;\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### X3DTimeDependentNode ### */\nx3dom.registerNodeType(\n    \"X3DTimeDependentNode\",\n    \"Time\",\n    defineClass(x3dom.nodeTypes.X3DChildNode,\n        \n        /**\n         * Constructor for X3DTimeDependentNode\n         * @constructs x3dom.nodeTypes.X3DTimeDependentNode\n         * @x3d 3.3\n         * @component Time\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DChildNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc This abstract node type is the base node type from which all time-dependent nodes are derived.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DTimeDependentNode.superClass.call(this, ctx);\n\n\n            /**\n             * Specifies whether the timer cycle loops.\n             * @var {x3dom.fields.SFBool} loop\n             * @memberof x3dom.nodeTypes.X3DTimeDependentNode\n             * @initvalue false\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'loop', false);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### Anchor ###\nx3dom.registerNodeType(\n    \"Anchor\",\n    \"Networking\",\n    defineClass(x3dom.nodeTypes.X3DGroupingNode,\n        \n        /**\n         * Constructor for Anchor\n         * @constructs x3dom.nodeTypes.Anchor\n         * @x3d 3.3\n         * @component Networking\n         * @status full\n         * @extends x3dom.nodeTypes.X3DGroupingNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc Anchor is a Grouping node that can contain most nodes. Clicking Anchored geometry loads content specified by the url field.\n         * Loaded content completely replaces current content, if parameter is same window.\n         * Hint: insert a Shape node before adding geometry or Appearance.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Anchor.superClass.call(this, ctx);\n\n\n            /**\n             * Address of replacement world, activated by clicking Anchor geometry. Hint: jump to a world's internal viewpoint by appending viewpoint name (e.g. #ViewpointName, someOtherCoolWorld.wrl#GrandTour). Hint: jump to a local viewpoint by only using viewpoint name (e.g. #GrandTour). Hint: Strings can have multiple values, so separate each string by quote marks [ 'http://www.url1.org' 'http://www.url2.org' 'etc.' ]. Hint: XML encoding for ' is ampersandquot; (a character entity). Warning: strictly match directory and filename capitalization for http links! Hint: can replace embedded blank(s) in url queries with %20 for each blank character.\n             * @var {x3dom.fields.MFString} url\n             * @memberof x3dom.nodeTypes.Anchor\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFString(ctx, 'url', []);\n\n            /**\n             * Passed parameter that signals web browser how to redirect url loading. Each string shall consist of \"keyword=value\" pairs. Hint: set parameter to target=_blank or target=_extern to load target url with a system-specific application. target=_self or target=_intern will open url in current x3d-browser window. Hint: set parameter to target=frame_name to load target url into another frame. Hint: Strings can have multiple values, so separate each string by quote marks. [ 'http://www.url1.org' 'http://www.url2.org' 'etc.' ]. Interchange profile hint: this field may be ignored.\n             * @var {x3dom.fields.MFString} parameter\n             * @memberof x3dom.nodeTypes.Anchor\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFString(ctx, 'parameter', []);\n\n            /**\n             * The description field in the Anchor node specifies a textual description of the Anchor node.\n             * This may be used by browser-specific user interfaces that wish to present users with more detailed information about the Anchor.\n             * @var {x3dom.fields.SFString} description\n             * @memberof x3dom.nodeTypes.Anchor\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFString(ctx, 'description', \"\");\n        \n        },\n        {\n            doIntersect: function(line) {\n                var isect = false;\n                for (var i=0; i<this._childNodes.length; i++) {\n                    if (this._childNodes[i]) {\n                        isect = this._childNodes[i].doIntersect(line) || isect;\n                    }\n                }\n                return isect;\n            },\n\n            handleTouch: function() {\n                var url = this._vf.url.length ? this._vf.url[0] : \"\";\n                var aPos = url.search(\"#\");\n                var anchor = \"\";\n                if (aPos >= 0)\n                    anchor = url.slice(aPos+1);\n\n                var param = this._vf.parameter.length ? this._vf.parameter[0] : \"\";\n                var tPos = param.search(\"target=\");\n                var target = \"\";\n                if (tPos >= 0)\n                    target = param.slice(tPos+7);\n\n                // TODO: implement #Viewpoint bind\n                // http://www.web3d.org/files/specifications/19775-1/V3.2/Part01/components/networking.html#Anchor\n                x3dom.debug.logInfo(\"Anchor url=\" + url + \", target=\" + target + \", #viewpoint=\" + anchor);\n\n                if(target.length !=0 || target != \"_self\") {\n                    window.open(this._nameSpace.getURL(url), target);\n                }\n                else {\n                    window.location = this._nameSpace.getURL(url);\n                }\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### Inline ###\nx3dom.registerNodeType(\n    \"Inline\",\n    \"Networking\",\n    defineClass(x3dom.nodeTypes.X3DGroupingNode,\n        \n        /**\n         * Constructor for Inline\n         * @constructs x3dom.nodeTypes.Inline\n         * @x3d 3.3\n         * @component Networking\n         * @status full\n         * @extends x3dom.nodeTypes.X3DGroupingNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc Inline is a Grouping node that can load nodes from another X3D scene via url.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Inline.superClass.call(this, ctx);\n\n\n            /**\n             * Each specified URL shall refer to a valid X3D file that contains a list of children nodes, prototypes and routes at the top level. Hint: Strings can have multiple values, so separate each string by quote marks. Warning: strictly match directory and filename capitalization for http links!\n             * @var {x3dom.fields.MFString} url\n             * @memberof x3dom.nodeTypes.Inline\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFString(ctx, 'url', []);\n\n            /**\n             * Specifies whether the X3D file specified by the url field is loaded. Hint: use LoadSensor to detect when loading is complete. TRUE: load immediately (it's also possible to load the URL at a later time by sending a TRUE event to the load field); FALSE: no action is taken (by sending a FALSE event to the load field of a previously loaded Inline, the contents of the Inline will be unloaded from the scene graph)\n             * @var {x3dom.fields.SFBool} load\n             * @memberof x3dom.nodeTypes.Inline\n             * @initvalue true\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'load', true);\n\n            /**\n             * Specifies the namespace of the Inline node.\n             * @var {x3dom.fields.MFString} nameSpaceName\n             * @memberof x3dom.nodeTypes.Inline\n             * @initvalue []\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFString(ctx, 'nameSpaceName', []);\n\n            /**\n             * Specifies the content type of the resource.\n             * @var {x3dom.fields.SFString} contentType\n             * @memberof x3dom.nodeTypes.Inline\n             * @initvalue \"\"\n             * @range [\"\", \"model/x3d+xml\", \"model/x3d+json\", \"model/gltf+json\", \"model/gltf-binary\"]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'contentType', \"\");\n\n            /**\n             * Specifies whether the DEF value is used as id when no other id is set.\n             * @var {x3dom.fields.SFBool} mapDEFToID\n             * @memberof x3dom.nodeTypes.Inline\n             * @initvalue false\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'mapDEFToID', false);\n\n            this.initDone = false;\n            this.count = 0;\n            this.numRetries = x3dom.nodeTypes.Inline.MaximumRetries;\n\n            this.ContentType = {\n                X3D  : \"model/x3d+xml\",\n                GLTF : \"model/gltf+json\",\n                GLB  : \"model/gltf-binary\",\n                X3DJ : \"model/x3d+json\"\n            };\n        },\n        {\n            fieldChanged: function (fieldName)\n            {\n                if (fieldName == \"url\" || fieldName == \"load\") {\n\n                    //Remove the childs of the x3domNode\n                    for (var i=0; i<this._childNodes.length; i++)\n                    {\n                        this.removeChild(this._childNodes[i]);\n                    }\n\n                    //if reflected to DOM remove the childs of the domNode\n                    if (this._vf.nameSpaceName.length != 0) {\n                        var node = this._xmlNode;\n                        if (node && node.hasChildNodes())\n                        {\n                            while ( node.childNodes.length >= 1 )\n                            {\n                                node.removeChild( node.firstChild );\n                            }\n                        }\n                    }\n                    this.loadInline();\n                }\n                else if (fieldName == \"render\") {\n                    this.invalidateVolume();\n                    //this.invalidateCache();\n                }\n            },\n\n            nodeChanged: function ()\n            {\n                if (!this.initDone) {\n                    this.initDone = true;\n                    this.loadInline();\n                }\n            },\n\n            fireEvents: function(eventType)\n            {\n                if ( this._xmlNode &&\n                    (this._xmlNode['on'+eventType] ||\n                        this._xmlNode.hasAttribute('on'+eventType) ||\n                        this._listeners[eventType]) )\n                {\n                    var event = {\n                        target: this._xmlNode,\n                        type: eventType,\n                        error: (eventType == \"error\") ? \"XMLHttpRequest Error\" : \"\",\n                        cancelBubble: false,\n                        stopPropagation: function() { this.cancelBubble = true; }\n                    };\n\n                    try {\n                        var attrib = this._xmlNode[\"on\" + eventType];\n\n                        if (typeof(attrib) === \"function\") {\n                            attrib.call(this._xmlNode, event);\n                        }\n                        else {\n                            var funcStr = this._xmlNode.getAttribute(\"on\" + eventType);\n                            var func = new Function('event', funcStr);\n                            func.call(this._xmlNode, event);\n                        }\n\n                        var list = this._listeners[eventType];\n                        if (list) {\n                            for (var i = 0; i < list.length; i++) {\n                                list[i].call(this._xmlNode, event);\n                            }\n                        }\n                    }\n                    catch(ex) {\n                        x3dom.debug.logException(ex);\n                    }\n                }\n            },\n\n            isValidContentType: function( contentType )\n            {\n                for ( var type in this.ContentType )\n                {\n                    if( contentType === this.ContentType[ type ] )\n                    {\n                        return true;\n                    }\n                }\n\n                return false;\n            },\n\n            getContentType: function()\n            {\n                //Return contentType if defined & valid\n                if (this._vf.contentType != \"\" && this.isValidContentType( this._vf.contentType ) )\n                {\n                    return this._vf.contentType;\n                }\n\n                //Try to detect the contentType from suffix\n                if (this._vf.url.length && this._vf.url[0].length)\n                {\n                    var lastPointIndex = this._vf.url[0].lastIndexOf(\".\");\n\n                    if ( lastPointIndex != -1 )\n                    {\n                        var suffix = this._vf.url[0].substr( lastPointIndex ).toLowerCase();\n                        \n                        switch(suffix)\n                        {\n                            case \".x3d\"  :  return this.ContentType.X3D;\n                            case \".gltf\" :  return this.ContentType.GLTF;\n                            case \".glb\"  :  return this.ContentType.GLB;\n                            case \".json\" :  return this.ContentType.X3DJ;\n                        }\n                    }\n                }\n            },\n\n            loadX3D: function(inlScene, nameSpace)\n            {\n                if (!this._vf.load) {\n                    x3dom.debug.logInfo('Inline: load field prevented loading of ' + this._vf.url[0]);\n                    return;\n                }\n              \n                var that = this;\n\n                var newScene = null;\n\n                if (inlScene)\n                {\n                    newScene = nameSpace.setupTree(inlScene);\n\n                    if(that._vf.nameSpaceName.length != 0)\n                    {\n                        while (inlScene.children.length) {\n                            var childDomNode = inlScene.children[0];\n                            setNamespace(that._vf.nameSpaceName, childDomNode, that._vf.mapDEFToID);\n                            that._xmlNode.appendChild(childDomNode);    \n                        }\n                    }\n                }\n                else {\n                    x3dom.debug.logError('No Scene in resource');\n                }\n\n                // trick to free memory, assigning a property to global object, then deleting it\n                var global = x3dom.getGlobal();\n\n                if (that._childNodes.length > 0 && that._childNodes[0] && that._childNodes[0]._nameSpace)\n                    that._nameSpace.removeSpace(that._childNodes[0]._nameSpace);\n\n                while (that._childNodes.length !== 0)\n                    global['_remover'] = that.removeChild(that._childNodes[0]);\n\n                delete global['_remover'];\n\n                if (newScene)\n                {\n                    that.addChild(newScene);\n\n                    that.invalidateVolume();\n\n                    // recalc changed scene bounding box twice\n                    var theScene = that._nameSpace.doc._scene;\n\n                    if (theScene) {\n                        theScene.invalidateVolume();\n                        //theScene.invalidateCache();\n\n                        window.setTimeout( function() {\n                            that.invalidateVolume();\n                            //that.invalidateCache();\n\n                            theScene.updateVolume();\n                            that._nameSpace.doc.needRender = true;\n                            that._nameSpace.doc.decrementDownloads();\n                            that._nameSpace.doc.needRender = true;\n                            x3dom.debug.logInfo('Inline: added ' + that._vf.url[0] + ' to scene.');\n                        }, 1000 );\n                    }\n\n                    that.fireEvents(\"load\");\n                }\n\n                newScene = null;\n                nameSpace = null;\n                inlScene = null;\n                xml = null;\n            },\n\n            loadInline: function ()\n            {\n                var that = this;\n\n                var contentType = this.getContentType();\n\n                var isBinary = false;\n\n                var xhr = new window.XMLHttpRequest();\n\n                xhr.onreadystatechange = function ()\n                {\n                    if ( xhr.readyState == 4 )\n                    {\n                        //202 Still Transcoding\n                        if(xhr.status === x3dom.nodeTypes.Inline.AwaitTranscoding)\n                        {\n                            if ( that.count < that.numRetries )\n                            {\n                                that.count++;\n\n                                var refreshTime = +xhr.getResponseHeader(\"Refresh\") || 5;\n\n                                x3dom.debug.logInfo('XHR status: ' + xhr.status + ' - Await Transcoding (' + that.count + '/' + that.numRetries + '): ' +\n                                                    'Next request in ' + refreshTime + ' seconds');\n\n                                window.setTimeout(function() {\n                                    that._nameSpace.doc.decrementDownloads();;\n                                    that.loadInline();\n                                }, refreshTime * 1000);\n                            }\n                            else\n                            {\n                                x3dom.debug.logError('XHR status: ' + xhr.status + ' - Await Transcoding (' + that.count + '/' + that.numRetries + '): ' +\n                                                     'No Retries left');\n\n                                that._nameSpace.doc.decrementDownloads();;\n\n                                that.count = 0;\n                            }\n                        }\n                        else if( xhr.status == 200 || xhr.status == 0 )\n                        {\n                            x3dom.debug.logInfo('Inline: downloading '+that._vf.url[0]+' done.');\n\n                            if (contentType == undefined)\n                            {\n                                contentType = xhr.getResponseHeader(\"Content-Type\");\n                            }\n\n                            that.count = 0;\n\n                            var inlineScene;\n\n                            var namespace = that.addNameSpace();\n\n                            if (contentType == that.ContentType.GLTF || contentType == that.ContentType.GLB)\n                            {\n                                if(xhr.response)\n                                {\n                                    var loader = new x3dom.glTF2Loader(namespace);\n\n                                    inlineScene = loader.load(xhr.response, isBinary);\n\n                                    that.loadX3D( inlineScene, namespace );\n                                }\n                                else\n                                {\n                                    x3dom.debug.logError('Invalide XHR Response');\n\n                                    that.fireEvents(\"error\");\n\n                                    that._nameSpace.doc.decrementDownloads();;\n                                    that.count = 0;\n                                }\n                            }\n                            else if (contentType == that.ContentType.X3DJ)\n                            {\n                                if(xhr.response)\n                                {\n                                    var json = x3dom.protoExpander.prototypeExpander(xhr.responseURL, xhr.response);\n                                    var parser = new x3dom.JSONParser();\n\n                                    var xml = parser.parseJavaScript(json);\n\n                                    if (xml !== undefined && xml !== null)\n                                    {\n                                        inlineScene = xml.getElementsByTagName('Scene')[0] ||\n                                                      xml.getElementsByTagName('scene')[0];\n\n                                        that.loadX3D( inlineScene, namespace );\n                                    }\n                                    else\n                                    {\n                                        that.fireEvents(\"error\");\n                                        that._nameSpace.doc.decrementDownloads();\n                                        that.count = 0;\n                                    }\n                                }\n                                else\n                                {\n                                    x3dom.debug.logError('Invalide XHR Response');\n\n                                    that.fireEvents(\"error\");\n\n                                    that._nameSpace.doc.decrementDownloads();\n                                    that.count = 0;\n                                }\n                            }\n                            else if (contentType == that.ContentType.X3D)\n                            {\n                                var xml;\n\n                                if (navigator.appName == \"Microsoft Internet Explorer\")\n                                {\n                                    xml = new DOMParser().parseFromString(xhr.responseText, \"text/xml\");\n                                }\n                                else\n                                {\n                                    xml = xhr.responseXML;\n                                }\n\n                                if (xml !== undefined && xml !== null)\n                                {\n                                    inlineScene = xml.getElementsByTagName('Scene')[0] ||\n                                                  xml.getElementsByTagName('scene')[0];\n\n                                    that.loadX3D( inlineScene, namespace );\n                                }\n                                else\n                                {\n                                    that.fireEvents(\"error\");\n                                    that._nameSpace.doc.decrementDownloads();\n                                    that.count = 0;\n                                }\n                            }\n                        }\n                        else\n                        {\n                            x3dom.debug.logError('XHR status: ' + xhr.status + ' - XMLHttpRequest requires web server running!');\n\n                            that.fireEvents(\"error\");\n\n                            that._nameSpace.doc.decrementDownloads();\n                            that.count = 0;\n                        }\n                    }\n                };\n\n                if (this._vf.url.length && this._vf.url[0].length)\n                {\n                    var xhrURI = this._nameSpace.getURL(this._vf.url[0]);\n\n                    xhr.open('GET', xhrURI, true);\n                    xhr.setRequestHeader('Accept', 'model/x3d+xml; q=1.0, model/gltf+json; q=0.5, model/gltf-binary; q=0.5'); \n\n                    if (xhr.overrideMimeType)\n                    {\n                        if( contentType == this.ContentType.X3D )\n                        {\n                            xhr.overrideMimeType('text/xml');\n                        }\n                        if( contentType == this.ContentType.X3DJ )\n                        {\n                            xhr.overrideMimeType('application/json');\n                            xhr.responseType = \"json\";\n                        }\n                        else if( contentType == this.ContentType.GLTF )\n                        {\n                            isBinary = false;\n                            xhr.responseType = \"json\";\n                        }\n                        else if( contentType == this.ContentType.GLB )\n                        {\n                            isBinary = true;\n                            xhr.responseType = \"arraybuffer\";\n                        }\n                    }\n\n                    try\n                    {\n                        this._nameSpace.doc.incrementDownloads();\n                        x3dom.RequestManager.addRequest(xhr);\n                    }\n                    catch(ex) {\n                        this.fireEvents(\"error\");\n                        x3dom.debug.logError(this._vf.url[0] + \": \" + ex);\n                        this._nameSpace.doc.decrementDownloads();\n                    }\n                }\n            },\n\n            addNameSpace: function()\n            {\n                var nsName = (this._vf.nameSpaceName.length != 0) ?\n                this._vf.nameSpaceName.toString().replace(' ','') : \"\";\n\n                var nameSpace = new x3dom.NodeNameSpace(nsName, this._nameSpace.doc);\n\n                var url = this._vf.url.length ? this._vf.url[0] : \"\";\n\n                if ((url[0] === '/') || (url.indexOf(\":\") >= 0))\n                {\n                    nameSpace.setBaseURL(url);\n                }\n                else\n                {\n                    nameSpace.setBaseURL(this._nameSpace.baseURL + url);\n                }\n\n                this._nameSpace.addSpace(nameSpace);\n\n                return nameSpace;\n            }\n        }\n    )\n);\n\nx3dom.nodeTypes.Inline.AwaitTranscoding = 202;      // Parameterizable retry state for Transcoder\nx3dom.nodeTypes.Inline.MaximumRetries = 15;         // Parameterizable maximum number of retries\n\nfunction setNamespace(prefix, childDomNode, mapDEFToID)\n{\n    if(childDomNode instanceof Element && childDomNode.__setAttribute !== undefined) {\n\n        if(childDomNode.hasAttribute('id') )\t{\n            childDomNode.__setAttribute('id', prefix.toString().replace(' ','') +'__'+ childDomNode.getAttribute('id'));\n        } else if (childDomNode.hasAttribute('DEF') && mapDEFToID){\n            childDomNode.__setAttribute('id', prefix.toString().replace(' ','') +'__'+ childDomNode.getAttribute('DEF'));\n            // workaround for Safari\n            if (!childDomNode.id)\n                childDomNode.id = childDomNode.__getAttribute('id');\n        }\n    }\n\n    if(childDomNode.hasChildNodes()){\n        Array.forEach ( childDomNode.childNodes, function (children) {\n            setNamespace(prefix, children, mapDEFToID);\n        } );\n    }\n}\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### MultiPart ###\nx3dom.registerNodeType(\n    \"MultiPart\",\n    \"Networking\",\n    defineClass(x3dom.nodeTypes.Inline,\n\n        /**\n         * Constructor for MultiPart\n         * @constructs x3dom.nodeTypes.MultiPart\n         * @x3d x.x\n         * @component Networking\n         * @extends x3dom.nodeTypes.Inline\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc Multipart node\n         */\n            function (ctx) {\n            x3dom.nodeTypes.MultiPart.superClass.call(this, ctx);\n\n            /**\n             * Specifies the url to the IDMap.\n             * @var {x3dom.fields.MFString} urlIDMap\n             * @memberof x3dom.nodeTypes.MultiPart\n             * @initvalue []\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFString(ctx, 'urlIDMap', []);\n\n            /**\n             * Defines whether the shape is pickable.\n             * @var {x3dom.fields.SFBool} isPickable\n             * @memberof x3dom.nodeTypes.MultiPart\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'isPickable', true);\n            \n            /**\n             * Defines the shape type for sorting.\n             * @var {x3dom.fields.SFString} sortType\n             * @range [auto, transparent, opaque]\n             * @memberof x3dom.nodeTypes.MultiPart\n             * @initvalue 'auto'\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'sortType', 'auto');\n\n            /**\n             * Specifies whether backface-culling is used. If solid is TRUE only front-faces are drawn.\n             * @var {x3dom.fields.SFBool} solid\n             * @memberof x3dom.nodeTypes.MultiPart\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'solid', false);\n\n            /**\n             * Change render order manually.\n             * @var {x3dom.fields.SFInt32} sortKey\n             * @memberof x3dom.nodeTypes.MultiPart\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'sortKey', 0);\n\n            /**\n             * Set the initial visibility.\n             * @var {x3dom.fields.SFInt32} initialVisibility\n             * @range [auto, visible, invisible]\n             * @memberof x3dom.nodeTypes.MultiPart\n             * @initvalue 'auto'\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'initialVisibility', 'auto');\n\n            this._idMap = null;\n            this._inlineNamespace = null;\n            this._highlightedParts = [];\n            this._minId = 0;\n            this._maxId = 0;\n            this._lastId = -1;\n            this._lastClickedId = -1;\n            this._lastButton = 0;\n            this._identifierToPartId = [];\n            this._identifierToAppId = [];\n            this._visiblePartsPerShape = [];\n            this._partVolume = [];\n            this._partVisibility = [];\n\t\t\tthis._originalColor = [];\n            this._materials = [];\n\n        },\n        {\n            fieldChanged: function (fieldName)\n            {\n                 if (fieldName == \"url\") {\n                    if (this._vf.nameSpaceName.length != 0) {\n                        var node = this._xmlNode;\n                        if (node && node.hasChildNodes())\n                        {\n                            while ( node.childNodes.length >= 1 )\n                            {\n                                node.removeChild( node.firstChild );\n                            }\n                        }\n                    }\n                    this.loadInline();\n                 }\n                 else if (fieldName == \"render\") {\n                    this.invalidateVolume();\n                    //this.invalidateCache();\n                 }\n            },\n\n            nodeChanged: function ()\n            {\n                if (!this.initDone) {\n                    this.initDone = true;\n                    this.loadIDMap();\n                }\n            },\n            \n            getVolume: function ()\n            {\n                var vol = this._graph.volume;\n\n                if (!this.volumeValid() && this._vf.render)\n                {\n                    for (var i=0; i<this._partVisibility.length; i++)\n                    {\n                        if (!this._partVisibility[i])\n                            continue;\n\n                        var childVol = this._partVolume[i];\n\n                        if (childVol && childVol.isValid())\n                            vol.extendBounds(childVol.min, childVol.max);\n                    }\n                }\n\n                if ( !vol.equals( this._graph.lastVolume ) )\n                {\n                    this._graph.lastVolume = x3dom.fields.BoxVolume.copy( vol );\n\n                    var event = {\n                        target: this._xmlNode,\n                        type: \"volumechanged\",   // event only called onxxx if used as old-fashioned attribute\n                        volume: x3dom.fields.BoxVolume.copy( vol )\n                    };\n\n                    this.callEvtHandler(\"onvolumechanged\", event);\n                }\n                \n                return vol;\n            },\n\n            handleEvents: function(e)\n            {\n                if( this._inlineNamespace ) {\n                    var colorMap = this._inlineNamespace.defMap[\"MultiMaterial_ColorMap\"];\n                    var emissiveMap = this._inlineNamespace.defMap[\"MultiMaterial_EmissiveMap\"];\n                    var specularMap = this._inlineNamespace.defMap[\"MultiMaterial_SpecularMap\"];\n                    var visibilityMap = this._inlineNamespace.defMap[\"MultiMaterial_VisibilityMap\"];\n\n                    //Check for Background press and release\n                    if (e.pickedId == -1 && e.button != 0) {\n                        this._lastClickedId = -1;\n                        this._lastButton = e.button;\n                    } else if (e.pickedId == -1 && e.button == 0) {\n                        this._lastClickedId = -1;\n                        this._lastButton = 0;\n                    }\n\n                    if (e.pickedId != -1) {\n                        e.part = new x3dom.Parts(this, [e.pickedId - this._minId], colorMap, emissiveMap, specularMap, visibilityMap);\n                        e.partID = this._idMap.mapping[e.pickedId - this._minId].name;\n\n                        //fire mousemove event\n                        e.type = \"mousemove\";\n                        this.callEvtHandler(\"onmousemove\", e);\n\n                        //fire mouseover event\n                        e.type = \"mouseover\";\n                        this.callEvtHandler(\"onmouseover\", e);\n\n                        //if some mouse button is down fire mousedown event\n                        if (!e.mouseup && e.button && e.button != this._lastButton) {\n                            e.type = \"mousedown\";\n                            this._lastButton = e.button;\n                            if ( this._lastClickedId == -1 ) {\n                                this._lastClickedId = e.pickedId;\n                            }\n                            this.callEvtHandler(\"onmousedown\", e);\n                        }\n\n                        //if some mouse button is up fire mouseup event\n                        if (e.mouseup || (this._lastButton != 0 && e.button == 0)) {\n                            e.type = \"mouseup\";\n                            this.callEvtHandler(\"onmouseup\", e);\n                            this._lastButton = 0;\n\n                            if ( e.pickedId == this._lastClickedId ) {\n                                this._lastClickedId = -1;\n                                e.type = \"click\";\n                                this.callEvtHandler(\"onclick\", e);\n                            }\n\n                            this._lastClickedId = -1;\n                        }\n\n                        //If the picked id has changed we enter+leave a part\n                        if (e.pickedId != this._lastId) {\n                            if (this._lastId != -1) {\n                                e.part = new x3dom.Parts(this, [this._lastId - this._minId], colorMap, emissiveMap, specularMap, visibilityMap);\n                                e.partID = this._idMap.mapping[this._lastId - this._minId].name;\n                                e.type = \"mouseleave\";\n                                this.callEvtHandler(\"onmouseleave\", e);\n                            }\n\n                            e.part = new x3dom.Parts(this, [e.pickedId - this._minId], colorMap, emissiveMap, specularMap, visibilityMap);\n                            e.partID = this._idMap.mapping[e.pickedId - this._minId].name;\n                            e.type = \"mouseenter\";\n                            this.callEvtHandler(\"onmouseenter\", e);\n                            this._lastId = e.pickedId;\n                        }\n\n                        this._lastId = e.pickedId;\n                    }\n                    else if (this._lastId != -1) {\n                        e.part = new x3dom.Parts(this, [this._lastId - this._minId], colorMap, emissiveMap, specularMap, visibilityMap);\n                        e.partID = this._idMap.mapping[this._lastId - this._minId].name;\n                        e.type = \"mouseout\";\n                        this.callEvtHandler(\"onmouseout\", e);\n                        e.type = \"mouseleave\";\n                        this.callEvtHandler(\"onmouseleave\", e);\n                        this._lastId = -1;\n                    }\n                }\n\n            },\n\n            loadIDMap: function ()\n            {\n                if (this._vf.urlIDMap.length && this._vf.urlIDMap[0].length)\n                {\n                    var i;\n\n                    var that = this;\n\n                    var idMapURI = this._nameSpace.getURL(this._vf.urlIDMap[0]);\n\n                    var xhr = new XMLHttpRequest();\n\n                    xhr.open(\"GET\", idMapURI, true);\n\n                    xhr.onload = function()\n                    {\n                        that._idMap = JSON.parse(this.responseText);\n\n                        //Check if the MultiPart map already initialized\n                        if (that._nameSpace.doc._scene._multiPartMap == null) {\n                            that._nameSpace.doc._scene._multiPartMap = {numberOfIds: 0, multiParts: []};\n                        }\n\n                        //Set the ID range this MultiPart is holding\n                        that._minId = that._nameSpace.doc._scene._multiPartMap.numberOfIds;\n                        that._maxId = that._minId + that._idMap.numberOfIDs - 1;\n\n                        //Update the MultiPart map\n                        that._nameSpace.doc._scene._multiPartMap.numberOfIds += that._idMap.numberOfIDs;\n                        that._nameSpace.doc._scene._multiPartMap.multiParts.push(that);\n\n                        //prepare internal shape map\n                        for (i=0; i<that._idMap.mapping.length; i++)\n                        {\n                            if (!that._identifierToPartId[that._idMap.mapping[i].name]) {\n                                that._identifierToPartId[that._idMap.mapping[i].name] = [];\n                            }\n\n                            if (!that._identifierToPartId[that._idMap.mapping[i].appearance]) {\n                                that._identifierToPartId[that._idMap.mapping[i].appearance] = [];\n                            }\n\n                            that._identifierToPartId[that._idMap.mapping[i].name].push(i);\n                            that._identifierToPartId[that._idMap.mapping[i].appearance].push(i);\n\n                            if (!that._partVolume[i]) {\n                                var min = x3dom.fields.SFVec3f.parse(that._idMap.mapping[i].min);\n                                var max = x3dom.fields.SFVec3f.parse(that._idMap.mapping[i].max);\n\n                                that._partVolume[i] = new x3dom.fields.BoxVolume(min, max);\n                            }\n\n                        }\n\n                        //prepare internal appearance map\n                        for (i=0; i<that._idMap.appearance.length; i++)\n                        {\n                            that._identifierToAppId[that._idMap.appearance[i].name] = i;\n                        }\n\n                        that.loadInline();\n                    };\n\n                    //xhr.send(null);\n                    x3dom.RequestManager.addRequest(xhr);\n                }\n            },\n\n            createMaterialData: function ()\n            {\n                var diffuseColor, transparency, specularColor, shininess, emissiveColor, ambientIntensity;\n                var backDiffuseColor, backTransparency, backSpecularColor, backShininess, backEmissiveColor, backAmbientIntensity;\n                var rgba_DT = \"\", rgba_SS = \"\", rgba_EA = \"\";\n                var rgba_DT_B = \"\", rgba_SS_B = \"\", rgba_EA_B = \"\";\n\n                var size = Math.ceil(Math.sqrt(this._idMap.numberOfIDs));\n\n                //scale image data array size to the next highest power of two\n                size = x3dom.Utils.nextHighestPowerOfTwo(size);\n                var sizeTwo = size * 2.0;\n\n                var diffuseTransparencyData = size + \" \" + sizeTwo + \" 4\";\n                var specularShininessData = size + \" \" + sizeTwo + \" 4\";\n                var emissiveAmbientIntensityData = size + \" \" + sizeTwo + \" 4\";\n\n                for (var i=0; i<size*size; i++)\n                {\n                    if (i < this._idMap.mapping.length)\n                    {\n                        var appName = this._idMap.mapping[i].appearance;\n                        var appID = this._identifierToAppId[appName];\n\n                        //AmbientIntensity\n                        if (this._idMap.appearance[appID].material.ambientIntensity) {\n                            ambientIntensity = this._idMap.appearance[appID].material.ambientIntensity\n                        } else {\n                            ambientIntensity = \"0.2\";\n                        }\n\n                        //BackAmbientIntensity\n                        if (this._idMap.appearance[appID].material.backAmbientIntensity) {\n                            backAmbientIntensity = this._idMap.appearance[appID].material.backAmbientIntensity\n                        } else {\n                            backAmbientIntensity = ambientIntensity;\n                        }\n\n                        //DiffuseColor\n                        if (this._idMap.appearance[appID].material.diffuseColor) {\n                            diffuseColor = this._idMap.appearance[appID].material.diffuseColor\n                        } else {\n                            diffuseColor = \"0.8 0.8 0.8\";\n                        }\n\n                        //BackDiffuseColor\n                        if (this._idMap.appearance[appID].material.backDiffuseColor) {\n                            backDiffuseColor = this._idMap.appearance[appID].material.backDiffuseColor\n                        } else {\n                            backDiffuseColor = diffuseColor;\n                        }\n\n                        //EmissiveColor\n                        if (this._idMap.appearance[appID].material.emissiveColor) {\n                            emissiveColor = this._idMap.appearance[appID].material.emissiveColor\n                        } else {\n                            emissiveColor = \"0.0 0.0 0.0\";\n                        }\n\n                        //BackEmissiveColor\n                        if (this._idMap.appearance[appID].material.backEmissiveColor) {\n                            backEmissiveColor = this._idMap.appearance[appID].material.backEmissiveColor\n                        } else {\n                            backEmissiveColor = emissiveColor;\n                        }\n\n                        //Shininess\n                        if (this._idMap.appearance[appID].material.shininess) {\n                            shininess = this._idMap.appearance[appID].material.shininess;\n                        } else {\n                            shininess = \"0.2\";\n                        }\n\n                        //BackShininess\n                        if (this._idMap.appearance[appID].material.backShininess) {\n                            backShininess = this._idMap.appearance[appID].material.backShininess;\n                        } else {\n                            backShininess = shininess;\n                        }\n\n                        //SpecularColor\n                        if (this._idMap.appearance[appID].material.specularColor) {\n                            specularColor = this._idMap.appearance[appID].material.specularColor;\n                        } else {\n                            specularColor = \"0 0 0\";\n                        }\n\n                        //BackSpecularColor\n                        if (this._idMap.appearance[appID].material.backSpecularColor) {\n                            backSpecularColor = this._idMap.appearance[appID].material.backSpecularColor;\n                        } else {\n                            backSpecularColor = specularColor;\n                        }\n\n                        //Transparency\n                        if (this._idMap.appearance[appID].material.transparency) {\n                            transparency = this._idMap.appearance[appID].material.transparency;\n                        } else {\n                            transparency = 0.0;\n                        }\n\n                        //BackTransparency\n                        if (this._idMap.appearance[appID].material.backTransparency) {\n                            backTransparency = this._idMap.appearance[appID].material.backTransparency;\n                        } else {\n                            backTransparency = transparency;\n                        }\n\n                        rgba_DT +=  \" \" + x3dom.fields.SFColorRGBA.parse(diffuseColor + \" \" + (1.0 - transparency)).toUint();\n                        rgba_SS +=  \" \" + x3dom.fields.SFColorRGBA.parse(specularColor + \" \" + shininess).toUint();\n                        rgba_EA +=  \" \" + x3dom.fields.SFColorRGBA.parse(emissiveColor + \" \" + ambientIntensity).toUint();\n\n                        rgba_DT_B += \" \" + x3dom.fields.SFColorRGBA.parse(backDiffuseColor + \" \" + (1.0 - backTransparency)).toUint();\n                        rgba_SS_B += \" \" + x3dom.fields.SFColorRGBA.parse(backSpecularColor + \" \" + backShininess).toUint();\n                        rgba_EA_B += \" \" + x3dom.fields.SFColorRGBA.parse(backEmissiveColor + \" \" + backAmbientIntensity).toUint();\n\n                        this._originalColor[i] = rgba_DT;\n\n                        this._materials[i] = new x3dom.MultiMaterial({\n                            \"ambientIntensity\": ambientIntensity,\n                            \"diffuseColor\": x3dom.fields.SFColor.parse(diffuseColor),\n                            \"emissiveColor\": x3dom.fields.SFColor.parse(emissiveColor),\n                            \"shininess\": shininess,\n                            \"specularColor\": x3dom.fields.SFColor.parse(specularColor),\n                            \"transparency\": transparency,\n                            \"backAmbientIntensity\": backAmbientIntensity,\n                            \"backDiffuseColor\": x3dom.fields.SFColor.parse(backDiffuseColor),\n                            \"backEmissiveColor\": x3dom.fields.SFColor.parse(backEmissiveColor),\n                            \"backShininess\": backShininess,\n                            \"backSpecularColor\": x3dom.fields.SFColor.parse(backSpecularColor),\n                            \"backTransparency\": backTransparency\n                        });\n                    }\n                    else\n                    {\n                        rgba_DT += \" 255\";\n                        rgba_SS += \" 255\";\n                        rgba_EA += \" 255\";\n\n                        rgba_DT_B += \" 255\";\n                        rgba_SS_B += \" 255\";\n                        rgba_EA_B += \" 255\";\n                    }\n                }\n\n                //Combine Front and Back Data\n                diffuseTransparencyData      += rgba_DT + rgba_DT_B;\n                specularShininessData        += rgba_SS + rgba_SS_B;\n                emissiveAmbientIntensityData += rgba_EA + rgba_EA_B;\n\n                return {\n                    \"diffuseTransparency\": diffuseTransparencyData,\n                    \"specularShininess\": specularShininessData,\n                    \"emissiveAmbientIntensity\": emissiveAmbientIntensityData\n                };\n            },\n\n            createVisibilityData: function ()\n            {\n                var i, j;\n                var size = Math.ceil(Math.sqrt(this._idMap.numberOfIDs));\n\n                //scale image data array size to the next highest power of two\n                size = x3dom.Utils.nextHighestPowerOfTwo(size);\n                \n                var visibilityData = size + \" \" + size + \" 1\";\n\n                for (i=0; i<size*size; i++)\n                {\n                    if (i < this._idMap.mapping.length)\n                    {\n                        if (this._vf.initialVisibility == 'auto')\n                        {\n                            //TODO get the Data from JSON\n                            visibilityData += \" 255\";\n\n                            if (!this._partVisibility[i]) {\n                                this._partVisibility[i] = true;\n                            }\n\n                            for (j=0; j<this._idMap.mapping[i].usage.length; j++)\n                            {\n                                if (!this._visiblePartsPerShape[this._idMap.mapping[i].usage[j]]) {\n                                    this._visiblePartsPerShape[this._idMap.mapping[i].usage[j]] = {val:0, max:0};\n                                }\n                                this._visiblePartsPerShape[this._idMap.mapping[i].usage[j]].val++;\n                                this._visiblePartsPerShape[this._idMap.mapping[i].usage[j]].max++;\n                            }\n                        }\n                        else if (this._vf.initialVisibility == 'visible')\n                        {\n                            visibilityData += \" 255\";\n\n                            if (!this._partVisibility[i]) {\n                                this._partVisibility[i] = true;\n                            }\n\n                            for (j=0; j<this._idMap.mapping[i].usage.length; j++)\n                            {\n                                if (!this._visiblePartsPerShape[this._idMap.mapping[i].usage[j]]) {\n                                    this._visiblePartsPerShape[this._idMap.mapping[i].usage[j]] = {val:0, max:0};\n                                }\n                                this._visiblePartsPerShape[this._idMap.mapping[i].usage[j]].val++;\n                                this._visiblePartsPerShape[this._idMap.mapping[i].usage[j]].max++;\n                            }\n                        }\n                        else if (this._vf.initialVisibility == 'invisible')\n                        {\n                            visibilityData += \" 0\";\n\n                            if (!this._partVisibility[i]) {\n                                this._partVisibility[i] = false;\n                            }\n\n                            for (j=0; j<this._idMap.mapping[i].usage.length; j++)\n                            {\n                                if (!this._visiblePartsPerShape[this._idMap.mapping[i].usage[j]]) {\n                                    this._visiblePartsPerShape[this._idMap.mapping[i].usage[j]] = {val:0, max:0};\n                                }\n                                this._visiblePartsPerShape[this._idMap.mapping[i].usage[j]].max++;\n                            }\n                        }\n\n                    }\n                    else\n                    {\n                        visibilityData += \" 0\";\n                    }\n                }\n                return visibilityData;\n            },\n\n            replaceMaterials: function (inlScene)\n            {\n                var css, shapeDEF, materialData, visibilityData, appearance;\n                var firstMat = true;\n                if (inlScene && inlScene.hasChildNodes())\n                {\n                    materialData = this.createMaterialData();\n                    visibilityData = this.createVisibilityData();\n\n                    var shapes = inlScene.getElementsByTagName(\"Shape\");\n\n                    for (var s=0; s<shapes.length; s++)\n                    {\n                        shapeDEF = shapes[s].getAttribute(\"DEF\") ||\n                                   shapes[s].getAttribute(\"def\");\n\n                        if(shapeDEF && this._visiblePartsPerShape[shapeDEF] && \n                           this._visiblePartsPerShape[shapeDEF].val == 0)\n                        {\n                            shapes[s].setAttribute(\"render\", \"false\");\n                        }\n\n                        shapes[s].setAttribute(\"idOffset\", this._minId);\n                        shapes[s].setAttribute(\"isPickable\", this._vf.isPickable);\n\n                        var geometries = shapes[s].getElementsByTagName(\"BinaryGeometry\");\n\n                        if (geometries && geometries.length) {\n                            for (var g = 0; g < geometries.length; g++) {\n                                geometries[g].setAttribute(\"solid\", this._vf.solid);\n                            }\n                        }\n\n                        var appearances = shapes[s].getElementsByTagName(\"Appearance\");\n                        \n                        if (appearances.length)\n                        {\n                            for (var a = 0; a < appearances.length; a++)\n                            {\n                                //Remove DEF/USE\n                                appearances[a].removeAttribute(\"DEF\");\n                                appearances[a].removeAttribute(\"USE\");\n                                \n                                appearances[a].setAttribute(\"sortType\", this._vf.sortType);\n                                appearances[a].setAttribute(\"sortKey\", this._vf.sortKey);\n\n                                var materials = appearances[a].getElementsByTagName(\"Material\");\n\n                                if (materials.length)\n                                {\n                                    //Replace Material\n                                    if (firstMat) {\n                                        firstMat = false;\n                                        css = document.createElement(\"CommonSurfaceShader\");\n                                        css.setAttribute(\"DEF\", \"MultiMaterial\");\n\n                                        var ptDA = document.createElement(\"PixelTexture\");\n                                        ptDA.setAttribute(\"containerField\", \"multiDiffuseAlphaTexture\");\n                                        ptDA.setAttribute(\"id\", \"MultiMaterial_ColorMap\");\n                                        ptDA.setAttribute(\"image\", materialData.diffuseTransparency);\n\n                                        var ptEA = document.createElement(\"PixelTexture\");\n                                        ptEA.setAttribute(\"containerField\", \"multiEmissiveAmbientTexture\");\n                                        ptEA.setAttribute(\"id\", \"MultiMaterial_EmissiveMap\");\n                                        ptEA.setAttribute(\"image\", materialData.emissiveAmbientIntensity);\n\n                                        var ptSS = document.createElement(\"PixelTexture\");\n                                        ptSS.setAttribute(\"containerField\", \"multiSpecularShininessTexture\");\n                                        ptSS.setAttribute(\"id\", \"MultiMaterial_SpecularMap\");\n                                        ptSS.setAttribute(\"image\", materialData.specularShininess);\n\n                                        var ptV = document.createElement(\"PixelTexture\");\n                                        ptV.setAttribute(\"containerField\", \"multiVisibilityTexture\");\n                                        ptV.setAttribute(\"id\", \"MultiMaterial_VisibilityMap\");\n                                        ptV.setAttribute(\"image\", visibilityData);\n\n                                        css.appendChild(ptDA);\n                                        css.appendChild(ptEA);\n                                        css.appendChild(ptSS);\n                                        css.appendChild(ptV);\n                                    }\n                                    else\n                                    {\n                                        css = document.createElement(\"CommonSurfaceShader\");\n                                        css.setAttribute(\"USE\", \"MultiMaterial\");\n                                    }\n                                    appearances[a].replaceChild(css, materials[0]);\n                                }\n                                else\n                                {\n                                    //Add Material\n                                    if (firstMat) {\n                                        firstMat = false;\n                                        css = document.createElement(\"CommonSurfaceShader\");\n                                        css.setAttribute(\"DEF\", \"MultiMaterial\");\n\n                                        var ptDA = document.createElement(\"PixelTexture\");\n                                        ptDA.setAttribute(\"containerField\", \"multiDiffuseAlphaTexture\");\n                                        ptDA.setAttribute(\"id\", \"MultiMaterial_ColorMap\");\n                                        ptDA.setAttribute(\"image\", materialData.diffuseTransparency);\n\n                                        var ptEA = document.createElement(\"PixelTexture\");\n                                        ptEA.setAttribute(\"containerField\", \"multiEmissiveAmbientTexture\");\n                                        ptEA.setAttribute(\"id\", \"MultiMaterial_EmissiveMap\");\n                                        ptEA.setAttribute(\"image\", materialData.emissiveAmbientIntensity);\n\n                                        var ptSS = document.createElement(\"PixelTexture\");\n                                        ptSS.setAttribute(\"containerField\", \"multiSpecularShininessTexture\");\n                                        ptSS.setAttribute(\"id\", \"MultiMaterial_SpecularMap\");\n                                        ptSS.setAttribute(\"image\", materialData.specularShininess);\n\n                                        var ptV = document.createElement(\"PixelTexture\");\n                                        ptV.setAttribute(\"containerField\", \"multiVisibilityTexture\");\n                                        ptV.setAttribute(\"id\", \"MultiMaterial_VisibilityMap\");\n                                        ptV.setAttribute(\"image\", visibilityData);\n\n                                        css.appendChild(ptDA);\n                                        css.appendChild(ptEA);\n                                        css.appendChild(ptSS);\n                                        css.appendChild(ptV);\n                                    }\n                                    else\n                                    {\n                                        css = document.createElement(\"CommonSurfaceShader\");\n                                        css.setAttribute(\"USE\", \"MultiMaterial\");\n                                    }\n\n                                    appearances[a].appendChild(css);\n                                }\n                            }\n                        }\n                        else\n                        {\n                            //Add Appearance\n                            appearance = document.createElement(\"Appearance\");\n                            \n                            //Add Material\n                            if (firstMat) {\n                                firstMat = false;\n                                css = document.createElement(\"CommonSurfaceShader\");\n                                css.setAttribute(\"DEF\", \"MultiMaterial\");\n\n                                var ptDA = document.createElement(\"PixelTexture\");\n                                ptDA.setAttribute(\"containerField\", \"multiDiffuseAlphaTexture\");\n                                ptDA.setAttribute(\"id\", \"MultiMaterial_ColorMap\");\n                                ptDA.setAttribute(\"image\", materialData.diffuseTransparency);\n\n                                var ptEA = document.createElement(\"PixelTexture\");\n                                ptEA.setAttribute(\"containerField\", \"multiEmissiveAmbientTexture\");\n                                ptEA.setAttribute(\"id\", \"MultiMaterial_EmissiveMap\");\n                                ptEA.setAttribute(\"image\", materialData.emissiveAmbientIntensity);\n\n                                var ptSS = document.createElement(\"PixelTexture\");\n                                ptSS.setAttribute(\"containerField\", \"multiSpecularShininessTexture\");\n                                ptSS.setAttribute(\"id\", \"MultiMaterial_SpecularMap\");\n                                ptSS.setAttribute(\"image\", materialData.specularShininess);\n\n                                var ptV = document.createElement(\"PixelTexture\");\n                                ptV.setAttribute(\"containerField\", \"multiVisibilityTexture\");\n                                ptV.setAttribute(\"id\", \"MultiMaterial_VisibilityMap\");\n                                ptV.setAttribute(\"image\", visibilityData);\n\n                                css.appendChild(ptDA);\n                                css.appendChild(ptEA);\n                                css.appendChild(ptSS);\n                                css.appendChild(ptV);\n                            }\n                            else\n                            {\n                                css = document.createElement(\"CommonSurfaceShader\");\n                                css.setAttribute(\"USE\", \"MultiMaterial\");\n                            }\n\n                            appearance.appendChild(css);\n                            geometries[g].appendChild(appearance);\n                        }\n                    }\n                }\n            },\n            \n            /**\n             *\n             *\n             * @param left border position in screen pixel\n             * @param right border position in screen pixel\n             * @param bottom border position in screen pixel\n             * @param top border position in screen pixel\n             * @returns selected Parts\n             */\n            getPartsByRect_Pixel : function (left, right, bottom, top)\n            {\n                var canvas = this._nameSpace.doc._x3dElem.runtime.canvas;\n                var ctx = canvas.gl;\n                var viewarea = canvas.doc._viewarea;\n                \n                if (!ctx || !viewarea) {\n                    return [];\n                }\n\n                return ctx.pickRect(viewarea, left, top, right, bottom, true);\n            },\n            \n            /**\n             *\n             *\n             * @param left border position in screen pixel\n             * @param right border position in screen pixel\n             * @param bottom border position in screen pixel\n             * @param top border position in screen pixel\n             * @param mode specifies the intersection mode 0 intersects 1 fully inside\n             * @returns selected Parts\n             */\n            getPartsByRect_Volume : function (left, right, bottom, top, mode)\n            {\n                mode = (mode != undefined) ? mode : 0;\n                \n                var viewarea = this._nameSpace.doc._viewarea;\n                var viewpoint = viewarea._scene.getViewpoint();\n\n                var origViewMatrix    = viewarea.getViewMatrix();\n                var origProjMatrix    = viewarea.getProjectionMatrix();\n\n                var upDir   = new x3dom.fields.SFVec3f(origViewMatrix._01, origViewMatrix._11, origViewMatrix._21);\n                var viewDir = new x3dom.fields.SFVec3f(origViewMatrix._02, origViewMatrix._12, origViewMatrix._22);\n                var pos = new x3dom.fields.SFVec3f(origViewMatrix._03, origViewMatrix._13, origViewMatrix._23);\n\n                var normalizedLeft   = (left   - viewarea._width  / 2) / (viewarea._width  / 2);\n                var normalizedRight  = (right  - viewarea._width  / 2) / (viewarea._width  / 2);\n                var normalizedTop    = (top    - viewarea._height / 2) / (viewarea._height / 2);\n                var normalizedBottom = (bottom - viewarea._height / 2) / (viewarea._height / 2);\n\n                /*\n                    For any given distance Z from the camera,\n                    the shortest distance D from the center point of a plane\n                    perpendicular to the viewing vector at Z to one of its borders\n                    above or below the center (really, the intersection of the plane and frustum)\n                    is D = tan(FOV / 2) * Z . Add and subtract D from the center point's Y component\n                    to get the maximum and minimum Y extents.\n                */\n\n                var zNear = viewpoint._zNear;\n                var zFar = viewpoint._zFar;\n                var aspect = viewpoint._lastAspect;\n                var fov = viewpoint.getFieldOfView();\n                var factorH = Math.tan(fov/2) * zNear;\n                var factorW = Math.tan(fov/2)* aspect * zNear;\n\n                var projMatrix, viewMatrix, factor;\n\n                if (x3dom.isa(viewpoint, x3dom.nodeTypes.OrthoViewpoint))\n                {\n                    aspect = (right - left) / (bottom - top);\n                    factor = Math.max(normalizedLeft, normalizedRight, normalizedTop, normalizedBottom) * viewpoint._fieldOfView[2];\n                    viewMatrix = origViewMatrix;\n                    projMatrix = x3dom.fields.SFMatrix4f.ortho(-factor, factor, -factor, factor, zNear, zFar, aspect );\n                }\n                else\n                {\n                    left = normalizedLeft * factorW;\n                    right = normalizedRight * factorW;\n                    bottom = normalizedBottom * factorH;\n                    top = normalizedTop * factorH;\n\n                    projMatrix = x3dom.fields.SFMatrix4f.perspectiveFrustum( left, right, bottom, top, zNear, zFar);\n                    viewMatrix = x3dom.fields.SFMatrix4f.lookAt(pos,  pos.subtract(viewDir.multiply(5.0)), upDir);\n                }\n\n                var frustum =  new x3dom.fields.FrustumVolume( projMatrix.mult(viewMatrix) );\n\n                var selection = [];\n                var id, volumes = this._partVolume;\n                for(id in volumes){\n                    if(!volumes.hasOwnProperty(id))\n                        continue;\n\n                    var intersect = frustum.intersect(volumes[id], 0);\n                    if(mode == 0 && intersect > 0)\n                    {\n                        selection.push(+id);\n                    }\n                    else if(mode == 1 && intersect == 63)\n                    {\n                        selection.push(+id);\n                    }\n                        \n                }\n\n                var colorMap = this._inlineNamespace.defMap[\"MultiMaterial_ColorMap\"];\n                var emissiveMap = this._inlineNamespace.defMap[\"MultiMaterial_EmissiveMap\"];\n                var specularMap = this._inlineNamespace.defMap[\"MultiMaterial_SpecularMap\"];\n                var visibilityMap = this._inlineNamespace.defMap[\"MultiMaterial_VisibilityMap\"];\n\n                if ( selection.length == 0) {\n                    return null;\n                } else {\n                    return new x3dom.Parts(this, selection, colorMap, emissiveMap, specularMap, visibilityMap);\n                }\n\n            },\n\n            appendAPI: function ()\n            {\n                var multiPart = this;\n\n                this._xmlNode.getIdList = function ()\n                {\n                    var i, ids = [];\n\n                    for (i=0; i<multiPart._idMap.mapping.length; i++) {\n                        ids.push( multiPart._idMap.mapping[i].name );\n                    }\n\n                    return ids;\n                };\n\n                this._xmlNode.getAppearanceIdList = function ()\n                {\n                    var i, ids = [];\n\n                    for (i=0; i<multiPart._idMap.appearance.length; i++) {\n                        ids.push( multiPart._idMap.appearance[i].name );\n                    }\n\n                    return ids;\n                };\n\n                this._xmlNode.getParts = function (selector)\n                {\n                    var i, m;\n                    var selection = [];\n\n                    if (selector == undefined) {\n                        for (m=0; m<multiPart._idMap.mapping.length; m++) {\n                            selection.push(m);\n                        }\n                    } else if (selector instanceof Array) {\n\n                        for (i=0; i<selector.length; i++) {\n                            if (multiPart._identifierToPartId[selector[i]]) {\n                                selection = selection.concat(multiPart._identifierToPartId[selector[i]]);\n                            }\n                        }\n\n                    } else if (selector instanceof RegExp) {\n\n                        for (var key in multiPart._identifierToPartId) {\n\n                            if ( key.match( selector ) ) {\n                                selection = selection.concat(multiPart._identifierToPartId[ key ]);\n                            }\n                        }\n\n                    }\n\n                    var colorMap = multiPart._inlineNamespace.defMap[\"MultiMaterial_ColorMap\"];\n                    var emissiveMap = multiPart._inlineNamespace.defMap[\"MultiMaterial_EmissiveMap\"];\n                    var specularMap = multiPart._inlineNamespace.defMap[\"MultiMaterial_SpecularMap\"];\n                    var visibilityMap = multiPart._inlineNamespace.defMap[\"MultiMaterial_VisibilityMap\"];\n\n                    if ( selection.length == 0) {\n                        return null;\n                    } else {\n                        return new x3dom.Parts(multiPart, selection, colorMap, emissiveMap, specularMap, visibilityMap);\n                    }\n                };\n\n                /**\n                 *\n                 *\n                 * @param left border position in screen pixel\n                 * @param right border position in screen pixel\n                 * @param bottom border position in screen pixel\n                 * @param top border position in screen pixel\n                 * @returns selected Parts\n                 */\n                this._xmlNode.getPartsByRect = function (left, right, bottom, top, technique, mode)\n                {\n                    var parts;\n                    technique = (technique != undefined) ? technique : \"volume\";\n                    mode = (mode != undefined) ? mode : 0;\n                    \n                    if ( technique == \"volume\" )\n                    {\n                        parts = multiPart.getPartsByRect_Volume(left, right, bottom, top, mode);\n                    }\n                    else if ( technique == \"pixel\" )\n                    {\n                        parts = multiPart.getPartsByRect_Pixel(left, right, bottom, top);\n                    }\n                    \n                    return parts;\n                }\n            },\n\n            loadInline: function ()\n            {\n                var that = this;\n                var xhr = new window.XMLHttpRequest();\n                if (xhr.overrideMimeType)\n                    xhr.overrideMimeType('text/xml');   //application/xhtml+xml\n\n                xhr.onreadystatechange = function ()\n                {\n                    if (xhr.readyState != 4) {\n                        // still loading\n                        //x3dom.debug.logInfo('Loading inlined data... (readyState: ' + xhr.readyState + ')');\n                        return xhr;\n                    }\n\n                    if (xhr.status === x3dom.nodeTypes.Inline.AwaitTranscoding) {\n                        if (that.count < that.numRetries)\n                        {\n                            that.count++;\n                            var refreshTime = +xhr.getResponseHeader(\"Refresh\") || 5;\n                            x3dom.debug.logInfo('XHR status: ' + xhr.status + ' - Await Transcoding (' + that.count + '/' + that.numRetries + '): ' + \n                                                'Next request in ' + refreshTime + ' seconds');\n                      \n                            window.setTimeout(function() {\n                                that._nameSpace.doc.decrementDownloads();\n                                that.loadInline();\n                            }, refreshTime * 1000);\n                            return xhr;\n                        }\n                        else\n                        {\n                            x3dom.debug.logError('XHR status: ' + xhr.status + ' - Await Transcoding (' + that.count + '/' + that.numRetries + '): ' + \n                                                 'No Retries left');\n                            that._nameSpace.doc.decrementDownloads();\n                            that.count = 0;\n                            return xhr;\n                        }\n                    }\n                    else if ((xhr.status !== 200) && (xhr.status !== 0)) {\n                        that.fireEvents(\"error\");\n                        x3dom.debug.logError('XHR status: ' + xhr.status + ' - XMLHttpRequest requires web server running!');\n\n                        that._nameSpace.doc.decrementDownloads();\n                        that.count = 0;\n                        return xhr;\n                    }\n                    else if ((xhr.status == 200) || (xhr.status == 0)) {\n                        that.count = 0;\n                    }\n\n                    x3dom.debug.logInfo('Inline: downloading '+that._vf.url[0]+' done.');\n\n                    var inlScene = null, newScene = null, nameSpace = null, xml = null;\n\n                    if (navigator.appName != \"Microsoft Internet Explorer\")\n                        xml = xhr.responseXML;\n                    else\n                        xml = new DOMParser().parseFromString(xhr.responseText, \"text/xml\");\n\n                    //TODO; check if exists and FIXME: it's not necessarily the first scene in the doc!\n                    if (xml !== undefined && xml !== null)\n                    {\n                        inlScene = xml.getElementsByTagName('Scene')[0] ||\n                            xml.getElementsByTagName('scene')[0];\n                    }\n                    else {\n                        that.fireEvents(\"error\");\n                    }\n\n                    if (inlScene)\n                    {\n                        var nsDefault = \"ns\" + that._nameSpace.childSpaces.length;\n                        \n                        var nsName = (that._vf.nameSpaceName.length != 0) ?\n                                      that._vf.nameSpaceName.toString().replace(' ','') : nsDefault;\n\n                        that._inlineNamespace = new x3dom.NodeNameSpace(nsName, that._nameSpace.doc);\n\n                        var url = that._vf.url.length ? that._vf.url[0] : \"\";\n\n                        if ((url[0] === '/') || (url.indexOf(\":\") >= 0))\n                        {\n                            that._inlineNamespace.setBaseURL(url);\n                        }\n                        else\n                        {\n                            that._inlineNamespace.setBaseURL(that._nameSpace.baseURL + url);\n                        }\n\n                        //Replace Material before setupTree()\n                        that.replaceMaterials(inlScene);\n\n                        newScene = that._inlineNamespace.setupTree(inlScene);\n\n                        that._nameSpace.addSpace(that._inlineNamespace);\n\n                        if(that._vf.nameSpaceName.length != 0)\n                        {\n                            Array.forEach ( inlScene.childNodes, function (childDomNode)\n                            {\n                                if(childDomNode instanceof Element)\n                                {\n                                    setNamespace(that._vf.nameSpaceName, childDomNode, that._vf.mapDEFToID);\n                                    that._xmlNode.appendChild(childDomNode);\n                                }\n                            } );\n                        }\n                    }\n                    else {\n                        if (xml && xml.localName) {\n                            x3dom.debug.logError('No Scene in ' + xml.localName);\n                        } else {\n                            x3dom.debug.logError('No Scene in resource');\n                        }\n                    }\n\n                    // trick to free memory, assigning a property to global object, then deleting it\n                    var global = x3dom.getGlobal();\n\n                    if (that._childNodes.length > 0 && that._childNodes[0] && that._childNodes[0]._nameSpace) {\n                        that._nameSpace.removeSpace(that._childNodes[0]._nameSpace);\n                    }\n\n                    while (that._childNodes.length !== 0) {\n                        global['_remover'] = that.removeChild(that._childNodes[0]);\n                    }\n\n                    delete global['_remover'];\n\n                    if (newScene)\n                    {\n                        that.addChild(newScene);\n\n                        that.invalidateVolume();\n                        //that.invalidateCache();\n\n                        that._nameSpace.doc.decrementDownloads();\n                        that._nameSpace.doc.needRender = true;\n                        x3dom.debug.logInfo('Inline: added ' + that._vf.url[0] + ' to scene.');\n\n                        // recalc changed scene bounding box twice\n                        var theScene = that._nameSpace.doc._scene;\n\n                        if (theScene) {\n                            theScene.invalidateVolume();\n                            //theScene.invalidateCache();\n\n                            window.setTimeout( function() {\n                                that.invalidateVolume();\n                                //that.invalidateCache();\n\n                                theScene.updateVolume();\n                                that._nameSpace.doc.needRender = true;\n                            }, 1000 );\n                        }\n\n                        that.appendAPI();\n                        that.fireEvents(\"load\");\n                    }\n\n                    newScene = null;\n                    //nameSpace = null;\n                    inlScene = null;\n                    xml = null;\n\n                    return xhr;\n                };\n\n                if (this._vf.url.length && this._vf.url[0].length)\n                {\n                    var xhrURI = this._nameSpace.getURL(this._vf.url[0]);\n\n                    xhr.open('GET', xhrURI, true);\n\n                    this._nameSpace.doc.incrementDownloads();\n\n                    try {\n                        //xhr.send(null);\n                        x3dom.RequestManager.addRequest(xhr);\n                    }\n                    catch(ex) {\n                        this.fireEvents(\"error\");\n                        x3dom.debug.logError(this._vf.url[0] + \": \" + ex);\n                    }\n                }\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\nx3dom.registerNodeType(\n    \"X3DBackgroundNode\",\n    \"EnvironmentalEffects\",\n    defineClass(x3dom.nodeTypes.X3DBindableNode,\n        \n        /**\n         * Constructor for X3DBackgroundNode\n         * @constructs x3dom.nodeTypes.X3DBackgroundNode\n         * @x3d 3.3\n         * @component EnvironmentalEffects\n         * @status full\n         * @extends x3dom.nodeTypes.X3DBindableNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc X3DBackgroundNode is the abstract type from which all backgrounds inherit. X3DBackgroundNode is a\n         * bindable node that, when bound, defines the panoramic background for the scene.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DBackgroundNode.superClass.call(this, ctx);\n\n            var trans = (ctx && ctx.autoGen) ? 1 : 0;\n\n            /**\n             * Cross Origin Mode\n             * @var {x3dom.fields.SFString} crossOrigin\n             * @memberof x3dom.nodeTypes.X3DBackgroundNode\n             * @initvalue \"\"\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFString(ctx, 'crossOrigin', '');\n\n            /**\n             * Color of the ground\n             * @var {x3dom.fields.MFColor} groundColor\n             * @memberof x3dom.nodeTypes.X3DBackgroundNode\n             * @initvalue (0,0,0)\n             * @range [0,1]\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFColor(ctx, 'groundColor', []);\n\n            /**\n             * Angle of the ground\n             * @var {x3dom.fields.MFFloat} groundAngle\n             * @memberof x3dom.nodeTypes.X3DBackgroundNode\n             * @initvalue []\n             * @range [0, pi]\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFFloat(ctx, 'groundAngle', []);\n\n            /**\n             * Color of the sky\n             * @var {x3dom.fields.MFColor} skyColor\n             * @memberof x3dom.nodeTypes.X3DBackgroundNode\n             * @initvalue (0,0,0)\n             * @range [0,1]\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFColor(ctx, 'skyColor', [new x3dom.fields.SFColor(0,0,0)]);\n\n            /**\n             * Angle of the sky\n             * @var {x3dom.fields.MFFloat} skyAngle\n             * @memberof x3dom.nodeTypes.X3DBackgroundNode\n             * @initvalue []\n             * @range [0, pi]\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFFloat(ctx, 'skyAngle', []);\n\n            /**\n             * Transparency of the background\n             * @var {x3dom.fields.SFFloat} transparency\n             * @memberof x3dom.nodeTypes.X3DBackgroundNode\n             * @initvalue 0/1\n             * @range [0,1]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'transparency', trans);\n\n            this._dirty = true;\n        \n        },\n        {\n            getSkyColor: function() {\n                return new x3dom.fields.SFColor(0,0,0);\n            },\n            getTransparency: function() {\n                return 0;\n            },\n            getTexUrl: function() {\n                return [];\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### X3DFogNode ### */\nx3dom.registerNodeType(\n    \"X3DFogNode\",\n    \"EnvironmentalEffects\",\n    defineClass(x3dom.nodeTypes.X3DBindableNode,\n        \n        /**\n         * Constructor for X3DFogNode\n         * @constructs x3dom.nodeTypes.X3DFogNode\n         * @x3d 3.3\n         * @component EnvironmentalEffects\n         * @status full\n         * @extends x3dom.nodeTypes.X3DBindableNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc X3DFogObject is the abstract type that describes a node that influences the lighting equation\n         * through the use of fog semantics.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DFogNode.superClass.call(this, ctx);\n\n            /**\n             * Objects located outside the visibilityRange from the viewer are drawn with a constant colour of color.\n             * Objects very close to the viewer are blended very little with the fog color.\n             * @var {x3dom.fields.SFColor} color\n             * @memberof x3dom.nodeTypes.X3DFogNode\n             * @initvalue (1,1,1)\n             * @range [0,1]\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFColor(ctx, 'color', 1, 1, 1);\n\n            /**\n             * The fogType field controls how much of the fog colour is blended with the object as a function of\n             * distance. If fogType is \"LINEAR\", the amount of blending is a linear function of the distance, resulting\n             * in a depth cueing effect. If fogType is \"EXPONENTIAL,\" an exponential increase in blending is used,\n             * resulting in a more natural fog appearance.\n             * @var {x3dom.fields.SFString} fogType\n             * @memberof x3dom.nodeTypes.X3DFogNode\n             * @initvalue \"LINEAR\"\n             * @range {\"LINEAR\",\"EXPONENTIAL\"}\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFString(ctx, 'fogType', \"LINEAR\");\n\n            /**\n             * The visibilityRange specifies the distance in length base units (in the local coordinate system) at\n             * which objects are totally obscured by the fog. A visibilityRange of 0.0 disables the Fog node.\n             * The visibilityRange is affected by the scaling transformations of the Fog node's parents; translations\n             * and rotations have no affect on visibilityRange.\n             * @var {x3dom.fields.SFFloat} visibilityRange\n             * @memberof x3dom.nodeTypes.X3DFogNode\n             * @initvalue 0\n             * @range [0, -inf]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'visibilityRange', 0);\n        \n        },\n        {\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### Fog ### */\nx3dom.registerNodeType(\n    \"Fog\",\n    \"EnvironmentalEffects\",\n    defineClass(x3dom.nodeTypes.X3DFogNode,\n        \n        /**\n         * Constructor for Fog\n         * @constructs x3dom.nodeTypes.Fog\n         * @x3d 3.3\n         * @component EnvironmentalEffects\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DFogNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The Fog node provides a way to simulate atmospheric effects by blending objects with the colour\n         * specified by the color field based on the distances of the various objects from the viewer. The distances\n         * are calculated in the coordinate space of the Fog node.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Fog.superClass.call(this, ctx);\n\n        },\n        {\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### Background ### */\nx3dom.registerNodeType(\n    \"Background\",\n    \"EnvironmentalEffects\",\n    defineClass(x3dom.nodeTypes.X3DBackgroundNode,\n        \n        /**\n         * Constructor for Background\n         * @constructs x3dom.nodeTypes.Background\n         * @x3d 3.3\n         * @component EnvironmentalEffects\n         * @status full\n         * @extends x3dom.nodeTypes.X3DBackgroundNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc A background node that uses six static images to compose the backdrop.  For the backUrl,\n         * bottomUrl, frontUrl, leftUrl, rightUrl, topUrl fields, browsers shall support the JPEG and PNG\n         * (see ISO/IEC 15948) image file formats.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Background.superClass.call(this, ctx);\n\n            /**\n             *\n             * @var {x3dom.fields.MFString} backUrl\n             * @memberof x3dom.nodeTypes.Background\n             * @initvalue []\n             * @range [URI]\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFString(ctx, 'backUrl', []);\n\n            /**\n             *\n             * @var {x3dom.fields.MFString} bottomUrl\n             * @memberof x3dom.nodeTypes.Background\n             * @initvalue []\n             * @range [URI]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFString(ctx, 'bottomUrl', []);\n\n            /**\n             *\n             * @var {x3dom.fields.MFString} frontUrl\n             * @memberof x3dom.nodeTypes.Background\n             * @initvalue []\n             * @range [URI]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFString(ctx, 'frontUrl', []);\n\n            /**\n             *\n             * @var {x3dom.fields.MFString} leftUrl\n             * @memberof x3dom.nodeTypes.Background\n             * @initvalue []\n             * @range [URI]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFString(ctx, 'leftUrl', []);\n\n            /**\n             *\n             * @var {x3dom.fields.MFString} rightUrl\n             * @memberof x3dom.nodeTypes.Background\n             * @initvalue []\n             * @range [URI]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFString(ctx, 'rightUrl', []);\n\n            /**\n             *\n             * @var {x3dom.fields.MFString} topUrl\n             * @memberof x3dom.nodeTypes.Background\n             * @initvalue []\n             * @range [URI]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFString(ctx, 'topUrl', []);\n\t\t\t\n\t\t\t/**\n             *\n             * @var {x3dom.fields.MFString} scaling\n             * @memberof x3dom.nodeTypes.Background\n             * @initvalue []\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'scaling', false);\n        \n        },\n        {\n            fieldChanged: function(fieldName)\n            {\n                if (fieldName.indexOf(\"Url\") > 0 || fieldName == \"transparency\" ||\n                    fieldName.search(\"sky\") >= 0 || fieldName.search(\"ground\") >= 0) {\n                    this._dirty = true;\n                }\n                else if (fieldName.indexOf(\"bind\") >= 0) {\n                    this.bind(this._vf.bind);\n                }\n            },\n\n            getSkyColor: function() {\n                return this._vf.skyColor;\n            },\n\n            getGroundColor: function() {\n                return this._vf.groundColor;\n            },\n\n            getTransparency: function() {\n                return this._vf.transparency;\n            },\n\n            getTexUrl: function() {\n                return [\n                    this._nameSpace.getURL(this._vf.backUrl[0]),\n                    this._nameSpace.getURL(this._vf.frontUrl[0]),\n                    this._nameSpace.getURL(this._vf.bottomUrl[0]),\n                    this._nameSpace.getURL(this._vf.topUrl[0]),\n                    this._nameSpace.getURL(this._vf.leftUrl[0]),\n                    this._nameSpace.getURL(this._vf.rightUrl[0])\n                ];\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### X3DEnvironmentNode ### */\nx3dom.registerNodeType(\n    \"X3DEnvironmentNode\",\n    \"EnvironmentalEffects\",\n    defineClass(x3dom.nodeTypes.X3DBindableNode,\n        \n        /**\n         * Constructor for X3DEnvironmentNode\n         * @constructs x3dom.nodeTypes.X3DEnvironmentNode\n         * @x3d x.x\n         * @component EnvironmentalEffects\n         * @status full\n         * @extends x3dom.nodeTypes.X3DBindableNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc Base class for environment nodes\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DEnvironmentNode.superClass.call(this, ctx);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### Environment ### */\nx3dom.registerNodeType(\n    \"Environment\",\n    \"EnvironmentalEffects\",\n    defineClass(x3dom.nodeTypes.X3DEnvironmentNode,\n        \n        /**\n         * Constructor for Environment\n         * @constructs x3dom.nodeTypes.Environment\n         * @x3d x.x\n         * @component EnvironmentalEffects\n         * @status full\n         * @extends x3dom.nodeTypes.X3DEnvironmentNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc Bindable node to setup rendering and culling parameters\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Environment.superClass.call(this, ctx);\n\n            /**\n             * If TRUE, transparent objects are sorted from back to front (allows explicitly disabling sorting)\n             * @var {x3dom.fields.SFBool} sortTrans\n             * @memberof x3dom.nodeTypes.Environment\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'sortTrans', true);\n\n            /**\n             * Transparent objects like glass do not throw much shadow, enable this IR convenience flag with TRUE\n             * @var {x3dom.fields.SFBool} shadowExcludeTransparentObjects\n             * @memberof x3dom.nodeTypes.Environment\n             * @initvalue false\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'shadowExcludeTransparentObjects', false);\n\n            /**\n             * The gamma correction to apply by default, see lighting and gamma tutorial\n             * @var {x3dom.fields.SFString} gammaCorrectionDefault\n             * @memberof x3dom.nodeTypes.Environment\n             * @initvalue \"linear\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'gammaCorrectionDefault', \"linear\");\n\n            /**\n             * Specifies the used tonemapping operator\n             * @var {x3dom.fields.SFString} tonemapping\n             * @memberof x3dom.nodeTypes.Environment\n             * @initvalue \"none\"\n             * @range [\"none\", \"reinhard\", \"uncharted\", \"filmic\"]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'tonemapping', \"none\");\n\n            // boolean flags for feature (de)activation\n\n           /**\n             * If TRUE, objects outside the viewing frustum are ignored\n             * @var {x3dom.fields.SFBool} frustumCulling\n             * @memberof x3dom.nodeTypes.Environment\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'frustumCulling', true);\n\n            /**\n             * If TRUE, objects smaller than the threshold below are ignored\n             * @var {x3dom.fields.SFBool} smallFeatureCulling\n             * @memberof x3dom.nodeTypes.Environment\n             * @initvalue false\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'smallFeatureCulling', false);\n\n            /**\n             * Objects smaller than the threshold below are ignored\n             * @var {x3dom.fields.SFFloat} smallFeatureThreshold\n             * @memberof x3dom.nodeTypes.Environment\n             * @initvalue 1.0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'smallFeatureThreshold', 1.0);\n\n            // defaults can be >0 since only used upon activation\n\n            /**\n             * If TRUE and occlusion culling supported, objects occluding less than the threshold below are ignored\n             * @var {x3dom.fields.SFBool} occlusionCulling\n             * @memberof x3dom.nodeTypes.Environment\n             * @initvalue false\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'occlusionCulling', false);\n\n            /**\n             * Objects occluding less than the threshold below are ignored\n             * @var {x3dom.fields.SFFloat} occlusionVisibilityThreshold\n             * @memberof x3dom.nodeTypes.Environment\n             * @initvalue 0.0\n             * @range [0,1]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'occlusionVisibilityThreshold', 0.0);\n\n            // previously was scaleRenderedIdsOnMove; percentage of objects to be rendered, in [0,1]\n\n            /**\n             * If TRUE and occlusion culling supported, only threshold fraction of objects, sorted by their screen\n             * space coverage, are rendered\n             * @var {x3dom.fields.SFBool} lowPriorityCulling\n             * @memberof x3dom.nodeTypes.Environment\n             * @initvalue false\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'lowPriorityCulling', false);\n\n            /**\n             * Only threshold fraction of objects, sorted by their screen space coverage, are rendered\n             * @var {x3dom.fields.SFFloat} lowPriorityThreshold\n             * @memberof x3dom.nodeTypes.Environment\n             * @initvalue 1.0\n             * @range [0,1]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'lowPriorityThreshold', 1.0);     // 1.0 means everything is rendered\n\n            // shape tesselation is lowered as long as resulting error is lower than threshold\n\n            /**\n             * If TRUE, shape tesselation is lowered as long as resulting error is lower than threshold\n             * @var {x3dom.fields.SFBool} tessellationDetailCulling\n             * @memberof x3dom.nodeTypes.Environment\n             * @initvalue false\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'tessellationDetailCulling', false);\n\n            /**\n             * Shape tesselation is lowered as long as resulting error is lower than threshold\n             * @var {x3dom.fields.SFFloat} tessellationErrorThreshold\n             * @memberof x3dom.nodeTypes.Environment\n             * @initvalue 0.0\n             * @range [0,1]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'tessellationErrorThreshold', 0.0);\n\n            /**\n             * Experimental: If true ARC adjusts rendering parameters\n             * @var {x3dom.fields.SFBool} enableARC\n             * @memberof x3dom.nodeTypes.Environment\n             * @initvalue false\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'enableARC', false);\n\n            /**\n             * Experimental: Define minimal target frame-rate for static moments and quality-speed trade-off\n             * @var {x3dom.fields.SFFloat} minFrameRate\n             * @memberof x3dom.nodeTypes.Environment\n             * @initvalue 1.0\n             * @range [1,inf]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'minFrameRate',  1.0);\n\n            /**\n             * Experimental: Define maximal target frame-rate for dynamic moments and quality-speed trade-off\n             * @var {x3dom.fields.SFFloat} maxFrameRate\n             * @memberof x3dom.nodeTypes.Environment\n             * @initvalue 62.5\n             * @range [1,inf]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'maxFrameRate', 62.5);\n\n            // 4 exp. factors for controlling speed-performance trade-off\n            // factors could be in [0, 1] (and not evaluated if -1)\n\n            /**\n             * Experimenal: Factor of user data for controlling speed-performance trade-off\n             * @var {x3dom.fields.SFFloat} userDataFactor\n             * @memberof x3dom.nodeTypes.Environment\n             * @initvalue -1\n             * @range [0,1] or -1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'userDataFactor', -1);\n\n            /**\n             * Experimenal: Factor of small feature culling for controlling speed-performance trade-off\n             * @var {x3dom.fields.SFFloat} smallFeatureFactor\n             * @memberof x3dom.nodeTypes.Environment\n             * @initvalue -1\n             * @range [0,1] or -1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'smallFeatureFactor', -1);\n\n            /**\n             * Experimenal: Factor of occlusion culling for controlling speed-performance trade-off\n             * @var {x3dom.fields.SFFloat} occlusionVisibilityFactor\n             * @memberof x3dom.nodeTypes.Environment\n             * @initvalue -1\n             * @range [0,1] or -1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'occlusionVisibilityFactor', -1);\n\n            /**\n             * Experimenal: Factor of low priority culling for controlling speed-performance trade-off\n             * @var {x3dom.fields.SFFloat} lowPriorityFactor\n             * @memberof x3dom.nodeTypes.Environment\n             * @initvalue -1\n             * @range [0,1] or -1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'lowPriorityFactor', -1);\n\n            /**\n             * Experimenal: Factor of tesselation error for controlling speed-performance trade-off\n             * @var {x3dom.fields.SFFloat} tessellationErrorFactor\n             * @memberof x3dom.nodeTypes.Environment\n             * @initvalue -1\n             * @range [0,1] or -1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'tessellationErrorFactor', -1);\n\n            /**\n             * Flag to enable Screen Space Ambient Occlusion\n             * @var {x3dom.fields.SFBool} SSAO\n             * @memberof x3dom.nodeTypes.Environment\n             * @initvalue \"false\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'SSAO', false);\n\n            /**\n             * Value that determines the radius in which the SSAO is sampled in world space\n             * @var {x3dom.fields.SFFloat} SSAOradius\n             * @memberof x3dom.nodeTypes.Environment\n             * @initvalue \"4\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'SSAOradius',0.7);\n\n            /**\n             * Value that determines the amount of contribution of SSAO (from 0 to 1)\n             * @var {x3dom.fields.SFFloat} SSAOamount\n             * @memberof x3dom.nodeTypes.Environment\n             * @initvalue \"1.0\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'SSAOamount',0.3);\n\n            /**\n             * Value that determines the size of the random texture used for sparse sampling of SSAO\n             * @var {x3dom.fields.SFFloat} SSAOrandomTextureSize\n             * @memberof x3dom.nodeTypes.Environment\n             * @initvalue \"4\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'SSAOrandomTextureSize',4);\n\n            /**\n             * Value that determines the maximum depth difference for the SSAO blurring pass.\n             * Pixels with higher depth difference to the filer kernel center are not incorporated into the average.\n             * @var {x3dom.fields.SFFloat} SSAOblurDepthTreshold\n             * @memberof x3dom.nodeTypes.Environment\n             * @initvalue \"5\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'SSAOblurDepthTreshold',1);\n\n            this._validGammaCorrectionTypes = [\n                \"none\", \"fastlinear\", \"linear\"\n            ];\n\n            // init internal stuff (but should be called each frame)\n            this.checkSanity();\n        \n        },\n        {\n            checkSanity: function()\n            {\n                var checkParam = function(flag, value, defaultOn, defaultOff)\n                {\n                    if(flag && (value == defaultOff))\n                        return defaultOn;\n\n                    if(!flag && (value != defaultOff))\n                        return defaultOff;\n                    return value;\n                };\n\n                this._smallFeatureThreshold = checkParam(this._vf.smallFeatureCulling,\n                    this._vf.smallFeatureThreshold, 10, 0); // cull objects < 10 px\n                this._lowPriorityThreshold = checkParam(this._vf.lowPriorityCulling,\n                    this._vf.lowPriorityThreshold, 0.5, 1);  // 1 means 100% visible\n                this._occlusionVisibilityThreshold = checkParam(this._vf.occlusionCulling,\n                    this._vf.occlusionVisibilityThreshold, 1, 0);\n                this._tessellationErrorThreshold = checkParam(this._vf.tessellationDetailCulling,\n                    this._vf.tessellationErrorThreshold, 1, 0);\n\n                var checkGamma = function(field, that) {\n                    field = field.toLowerCase();\n\n                    if (that._validGammaCorrectionTypes.indexOf(field) > -1) {\n                        return field;\n                    }\n                    else {\n                        x3dom.debug.logWarning(field + \" gammaCorrectionDefault may only be linear (default), fastLinear, or none\");\n                        return that._validGammaCorrectionTypes[0];\n                    }\n                };\n\n                this._vf.gammaCorrectionDefault = checkGamma(this._vf.gammaCorrectionDefault, this);\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### X3DViewpointNode ### */\nx3dom.registerNodeType(\n    \"X3DViewpointNode\",\n    \"Navigation\",\n    defineClass(x3dom.nodeTypes.X3DBindableNode,\n        \n        /**\n         * Constructor for X3DViewpointNode\n         * @constructs x3dom.nodeTypes.X3DViewpointNode\n         * @x3d 3.3\n         * @component Navigation\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DBindableNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc A node of node type X3DViewpointNode defines a specific location in the local coordinate system from which the user may view the scene.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DViewpointNode.superClass.call(this, ctx);\n\n            // attach some convenience accessor methods to dom/xml node\n            if (ctx && ctx.xmlNode) {\n                var domNode = ctx.xmlNode;\n\n                if (!domNode.resetView && !domNode.getFieldOfView &&\n                    !domNode.getNear && !domNode.getFar)\n                {\n                    domNode.resetView = function() {\n                        var that = this._x3domNode;\n\n                        that.resetView();\n                        that._nameSpace.doc.needRender = true;\n                    };\n\n                    domNode.getFieldOfView = function() {\n                        return this._x3domNode.getFieldOfView();\n                    };\n\n                    domNode.getNear = function() {\n                        return this._x3domNode.getNear();\n                    };\n\n                    domNode.getFar = function() {\n                        return this._x3domNode.getFar();\n                    };\n                }\n            }\n        \n        },\n        {\n            activate: function (prev) {\n                var viewarea = this._nameSpace.doc._viewarea;\n                if (prev && this._bindAnimation) {\n                    viewarea.animateTo(this, prev._autoGen ? null : prev);\n                }\n                viewarea._needNavigationMatrixUpdate = true;\n\n                x3dom.nodeTypes.X3DBindableNode.prototype.activate.call(this, prev);\n                //x3dom.debug.logInfo ('activate ViewBindable ' + this._DEF + '/' + this._vf.description);\n            },\n\n            deactivate: function (prev) {\n                x3dom.nodeTypes.X3DBindableNode.prototype.deactivate.call(this, prev);\n                //x3dom.debug.logInfo ('deactivate ViewBindable ' + this._DEF + '/' + this._vf.description);\n            },\n\n            getTransformation: function() {\n                return this.getCurrentTransform();\n            },\n\n            getCenterOfRotation: function() {\n                return new x3dom.fields.SFVec3f(0, 0, 0);\n            },\n\n            setCenterOfRotation: function(cor) {\n                this._vf.centerOfRotation.setValues(cor);   // method overwritten by Viewfrustum\n            },\n\n            getFieldOfView: function() {\n                return 1.57079633;\n            },\n\n            /**\n             * Sets the (local) view matrix\n             * @param newView\n             */\n            setView: function(newView) {\n                var mat = this.getCurrentTransform();\n                this._viewMatrix = newView.mult(mat);\n            },\n\n            /**\n             * Sets an absolute view matrix in world coordinates\n             * @param newView\n             */\n            setViewAbsolute: function(newView)\n            {\n                this._viewMatrix = newView;\n            },\n\n            setProjectionMatrix: function(matrix)\n            {\n\n            },\n\n            resetView: function() {\n                // see derived class\n            },\n\n            getNear: function() {\n                return 0.1;\n            },\n\n            getFar: function() {\n                return 10000;\n            },\n\n            getImgPlaneHeightAtDistOne: function() {\n                return 2.0;\n            },\n\n            getViewMatrix: function() {\n                return null;\n            },\n\n            getProjectionMatrix: function(aspect) {\n                return null;\n            },\n\n            setZoom: function( value ) {\n                \n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### Viewpoint ### */\nx3dom.registerNodeType(\n    \"Viewpoint\",\n    \"Navigation\",\n    defineClass(x3dom.nodeTypes.X3DViewpointNode,\n        \n        /**\n         * Constructor for Viewpoint\n         * @constructs x3dom.nodeTypes.Viewpoint\n         * @x3d 3.3\n         * @component Navigation\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DViewpointNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc Viewpoint provides a specific location and direction where the user may view the scene.\n         * The principalPoint extention allows to set asymmetric frustums.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Viewpoint.superClass.call(this, ctx);\n\n\n            /**\n             * Preferred minimum viewing angle from this viewpoint in radians.\n             * Small field of view roughly corresponds to a telephoto lens, large field of view roughly corresponds to a wide-angle lens.\n             * Hint: modifying Viewpoint distance to object may be better for zooming.\n             * Warning: fieldOfView may not be correct for different window sizes and aspect ratios.\n             * Interchange profile hint: this field may be ignored.\n             * @var {x3dom.fields.SFFloat} fieldOfView\n             * @range [0, pi]\n             * @memberof x3dom.nodeTypes.Viewpoint\n             * @initvalue 0.785398\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'fieldOfView', 0.785398);\n\n            /**\n             * The position fields of the Viewpoint node specifies a relative location in the local coordinate system. Position is relative to the coordinate system's origin (0,0,0),\n             * @var {x3dom.fields.SFVec3f} position\n             * @memberof x3dom.nodeTypes.Viewpoint\n             * @initvalue 0,0,10\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'position', 0, 0, 10);\n\n            /**\n             * The orientation fields of the Viewpoint node specifies relative orientation to the default orientation.\n             * @var {x3dom.fields.SFRotation} orientation\n             * @memberof x3dom.nodeTypes.Viewpoint\n             * @initvalue 0,0,1,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFRotation(ctx, 'orientation', 0, 0, 1, 0);\n\n            /**\n             * The centerOfRotation field specifies a center about which to rotate the user's eyepoint when in EXAMINE mode.\n             * @var {x3dom.fields.SFVec3f} centerOfRotation\n             * @memberof x3dom.nodeTypes.Viewpoint\n             * @initvalue 0,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'centerOfRotation', 0, 0, 0);\n\n            /**\n             * Specifies the near plane.\n             * @var {x3dom.fields.SFFloat} zNear\n             * @range -1 or [0, inf]\n             * @memberof x3dom.nodeTypes.Viewpoint\n             * @initvalue -1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'zNear', -1); //0.1);\n\n            /**\n             * Specifies the far plane.\n             * @var {x3dom.fields.SFFloat} zFar\n             * @range -1 or [0, inf]\n             * @memberof x3dom.nodeTypes.Viewpoint\n             * @initvalue -1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'zFar', -1);  //100000);\n\n            //this._viewMatrix = this._vf.orientation.toMatrix().transpose().\n            //    mult(x3dom.fields.SFMatrix4f.translation(this._vf.position.negate()));\n            this._viewMatrix = x3dom.fields.SFMatrix4f.translation(this._vf.position).\n                mult(this._vf.orientation.toMatrix()).inverse();\n\n            this._projMatrix = null;\n            this._lastAspect = 1.0;\n\n            // z-ratio: a value around 5000 would be better...\n            this._zRatio = 10000;\n            this._zNear = this._vf.zNear;\n            this._zFar = this._vf.zFar;\n\n            // special stuff...\n            this._imgPlaneHeightAtDistOne = 2.0 * Math.tan(this._vf.fieldOfView / 2.0);\n        },\n        {\n            fieldChanged: function (fieldName) {\n                if (fieldName == \"position\" || fieldName == \"orientation\") {\n                    this.resetView();\n                }\n                else if (fieldName == \"fieldOfView\" ||\n                    fieldName == \"zNear\" || fieldName == \"zFar\") {\n                    this._projMatrix = null;   // only trigger refresh\n                    this._zNear = this._vf.zNear;\n                    this._zFar = this._vf.zFar;\n                    this._imgPlaneHeightAtDistOne = 2.0 * Math.tan(this._vf.fieldOfView / 2.0);\n                }\n                else if (fieldName.indexOf(\"bind\") >= 0) {\n                    // FIXME; call parent.fieldChanged();\n                    this.bind(this._vf.bind);\n                }\n            },\n\n            setProjectionMatrix: function(matrix)\n            {\n                this._projMatrix = matrix;\n            },\n\n            getCenterOfRotation: function() {\n                return this._vf.centerOfRotation;\n            },\n\n            getViewMatrix: function() {\n                return this._viewMatrix;\n            },\n\n            getFieldOfView: function() {\n                return this._vf.fieldOfView;\n            },\n\n            resetView: function() {\n                this._viewMatrix = x3dom.fields.SFMatrix4f.translation(this._vf.position).\n                    mult(this._vf.orientation.toMatrix()).inverse();\n\n\t\t\t\t//Reset navigation helpers of the viewarea\n                if (this._vf.isActive && this._nameSpace && this._nameSpace.doc._viewarea) {\n                    this._nameSpace.doc._viewarea.resetNavHelpers();\n                }\n            },\n\n            getNear: function() {\n                return this._zNear;\n            },\n\n            getFar: function() {\n                return this._zFar;\n            },\n\n            getImgPlaneHeightAtDistOne: function() {\n                return this._imgPlaneHeightAtDistOne;\n            },\n\n            getProjectionMatrix: function(aspect)\n            {\n                var fovy = this._vf.fieldOfView;\n                var zfar = this._vf.zFar;\n                var znear = this._vf.zNear;\n\n                if (znear <= 0 || zfar <= 0)\n                {\n                    var nearScale = 0.8, farScale = 1.2;\n                    var viewarea = this._nameSpace.doc._viewarea;\n                    var scene = viewarea._scene;\n\n                    // Doesn't work if called e.g. from RenderedTexture with different sub-scene\n                    var min = x3dom.fields.SFVec3f.copy(scene._lastMin);\n                    var max = x3dom.fields.SFVec3f.copy(scene._lastMax);\n\n                    var dia = max.subtract(min);\n                    var sRad = dia.length() / 2;\n\n                    var mat = viewarea.getViewMatrix().inverse();\n                    var vp = mat.e3();\n\n                    // account for scales around the viewpoint\n                    var translation = new x3dom.fields.SFVec3f(0,0,0),\n                        scaleFactor = new x3dom.fields.SFVec3f(1,1,1);\n                    var rotation = new x3dom.fields.Quaternion(0,0,1,0),\n                        scaleOrientation = new x3dom.fields.Quaternion(0,0,1,0);\n\n                    // unfortunately, decompose is a rather expensive operation\n                    mat.getTransform(translation, rotation, scaleFactor, scaleOrientation);\n\n                    var minScal = scaleFactor.x, maxScal = scaleFactor.x;\n\n                    if (maxScal < scaleFactor.y) maxScal = scaleFactor.y;\n                    if (minScal > scaleFactor.y) minScal = scaleFactor.y;\n                    if (maxScal < scaleFactor.z) maxScal = scaleFactor.z;\n                    if (minScal > scaleFactor.z) minScal = scaleFactor.z;\n\n                    if (maxScal > 1)\n                        nearScale /= maxScal;\n                    else if (minScal > x3dom.fields.Eps && minScal < 1)\n                        farScale /= minScal;\n                    // near/far scale adaption done\n\n                    var sCenter = min.add(dia.multiply(0.5));\n                    var vDist = (vp.subtract(sCenter)).length();\n\n                    if (sRad) {\n                        if (vDist > sRad)\n                            znear = (vDist - sRad) * nearScale;  // Camera outside scene\n                        else\n                            znear = 0;                           // Camera inside scene\n\n                        zfar = (vDist + sRad) * farScale;\n                    }\n                    else {\n                        znear = 0.1;\n                        zfar = 100000;\n                    }\n\n                    var zNearLimit = zfar / this._zRatio;\n                    znear = Math.max(znear, Math.max(x3dom.fields.Eps, zNearLimit));\n\n                    if (zfar > this._vf.zNear && this._vf.zNear > 0)\n                        znear = this._vf.zNear;\n                    if (this._vf.zFar > znear)\n                        zfar = this._vf.zFar;\n\n                    if (zfar <= znear)\n                        zfar = znear + 1;\n                    //x3dom.debug.logInfo(\"near: \" + znear + \" -> far:\" + zfar);\n                }\n\n                if (this._projMatrix == null)\n                {\n                    this._projMatrix = x3dom.fields.SFMatrix4f.perspective(fovy, aspect, znear, zfar);\n                }\n                else if (this._zNear != znear || this._zFar != zfar)\n                {\n                    var div = znear - zfar;\n                    this._projMatrix._22 = (znear + zfar) / div;\n                    this._projMatrix._23 = 2 * znear * zfar / div;\n                }\n                else if (this._lastAspect != aspect)\n                {\n                    this._projMatrix._00 = (1 / Math.tan(fovy / 2)) / aspect;\n                    this._lastAspect = aspect;\n                }\n\n                // also needed for being able to ask for near and far\n                this._zNear = znear;\n                this._zFar = zfar;\n\n                return this._projMatrix;\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### OrthoViewpoint ### */\nx3dom.registerNodeType(\n    \"OrthoViewpoint\",\n    \"Navigation\",\n    defineClass(x3dom.nodeTypes.X3DViewpointNode,\n        \n        /**\n         * Constructor for OrthoViewpoint\n         * @constructs x3dom.nodeTypes.OrthoViewpoint\n         * @x3d 3.3\n         * @component Navigation\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DViewpointNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The OrthoViewpoint node defines a viewpoint that provides an orthographic view of the scene.\n         * An orthographic view is one in which all projectors are parallel to the projector from centerOfRotation to position.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.OrthoViewpoint.superClass.call(this, ctx);\n\n\n            /**\n             * The fieldOfView field specifies minimum and maximum extents of the view in units of the local coordinate system\n             * @var {x3dom.fields.MFFloat} fieldOfView\n             * @memberof x3dom.nodeTypes.OrthoViewpoint\n             * @initvalue [-1,-1,1,1]\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFFloat(ctx, 'fieldOfView', [-1, -1, 1, 1]);\n\n            /**\n             * Position (x, y, z in meters) relative to local coordinate system.\n             * @var {x3dom.fields.SFVec3f} position\n             * @memberof x3dom.nodeTypes.OrthoViewpoint\n             * @initvalue 0,0,10\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'position', 0, 0, 10);\n\n            /**\n             * Rotation (axis, angle in radians) of Viewpoint, relative to default -Z axis direction in local coordinate system.\n             * Hint: this is orientation _change_ from default direction (0 0 -1).\n             * Hint: complex rotations can be accomplished axis-by-axis using parent Transforms.\n             * @var {x3dom.fields.SFRotation} orientation\n             * @range [-1, 1] or [-inf, inf]\n             * @memberof x3dom.nodeTypes.OrthoViewpoint\n             * @initvalue 0,0,0,1\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFRotation(ctx, 'orientation', 0, 0, 0, 1);\n\n            /**\n             * centerOfRotation point relates to NavigationInfo EXAMINE mode.\n             * @var {x3dom.fields.SFVec3f} centerOfRotation\n             * @memberof x3dom.nodeTypes.OrthoViewpoint\n             * @initvalue 0,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'centerOfRotation', 0, 0, 0);\n\n            /**\n             * z-near position; used for clipping\n             * @var {x3dom.fields.SFFloat} zNear\n             * @memberof x3dom.nodeTypes.OrthoViewpoint\n             * @initvalue 0.1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'zNear', -1);\n\n            /**\n             * z-far position; used for clipping\n             * @var {x3dom.fields.SFFloat} zFar\n             * @memberof x3dom.nodeTypes.OrthoViewpoint\n             * @initvalue 10000\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'zFar', -1);\n\n            this._viewMatrix = null;\n            this._projMatrix = null;\n            this._lastAspect = 1.0;\n\t\t\t\n\t\t\tthis._zRatio = 10000;\n            this._zNear = this._vf.zNear;\n            this._zFar = this._vf.zFar;\n\t\t\tthis._fieldOfView = this._vf.fieldOfView.slice(0); \n\n            this.resetView();\n        \n        },\n        {\n            fieldChanged: function (fieldName) {\n                if (fieldName == \"position\" || fieldName == \"orientation\") {\n                    this.resetView();\n                }\n                else if(fieldName == \"fieldOfView\")\n                {\n                    this._fieldOfView = this._vf.fieldOfView;\n                    this._projMatrix = null;\n                }\n                else if (fieldName == \"zNear\" || fieldName == \"zFar\") {\n                    this._projMatrix = null;   // trigger refresh\n                    this.resetView();\n                }\n                else if (fieldName.indexOf(\"bind\") >= 0) {\n                    this.bind(this._vf.bind);\n                }\n            },\n\n            getCenterOfRotation: function() {\n                return this.getCurrentTransform().multMatrixPnt(this._vf.centerOfRotation);\n            },\n\n            getViewMatrix: function() {\n                return this._viewMatrix;\n            },\n\n            resetView: function() {\n                var offset = x3dom.fields.SFMatrix4f.translation(new x3dom.fields.SFVec3f(\n                        (this._vf.fieldOfView[0] + this._vf.fieldOfView[2]) / 2,\n                        (this._vf.fieldOfView[1] + this._vf.fieldOfView[3]) / 2, 0));\n\n                this._viewMatrix = x3dom.fields.SFMatrix4f.translation(this._vf.position).\n                    mult(this._vf.orientation.toMatrix());\n                this._viewMatrix = this._viewMatrix.inverse();\n\t\t\t\t\n\t\t\t\tthis._projMatrix = null;\n\t\t\t\t\n\t\t\t\t//Reset navigation helpers of the viewarea\n                if (this._vf.isActive && this._nameSpace && this._nameSpace.doc._viewarea) {\n                    this._nameSpace.doc._viewarea.resetNavHelpers();\n                }\n            },\n\n            getNear: function() {\n                return this._vf.zNear;\n            },\n\n            getFar: function() {\n                return this._vf.zFar;\n            },\n            \n            getFieldOfView: function() {\n                return 0.785;\n            },\n\n            setZoom: function( value ) {\n\n                this._fieldOfView[0] = -value;\n                this._fieldOfView[1] = -value;\n                this._fieldOfView[2] =  value;\n                this._fieldOfView[3] =  value;\n\n                this._projMatrix = null;   // trigger refresh\n                //this.resetView();\n            },\n            \n            getZoom: function( value ) {\n                return this._fieldOfView;\n            },\n\n            getProjectionMatrix: function(aspect)\n            {\n\t\t\t\tvar fov = this.getFieldOfView();\n                var zfar = this._vf.zFar;\n                var znear = this._vf.zNear;\n\n                if (znear <= 0 || zfar <= 0)\n                {\n                    var scene = this._nameSpace.doc._viewarea._scene;\n                    var min = x3dom.fields.SFVec3f.copy(scene._lastMin);\n                    var max = x3dom.fields.SFVec3f.copy(scene._lastMax);\n                    var dia = max.subtract(min);\t\t\t\t\t\n\t\t\t\t\tvar tanfov2 = Math.tan(fov / 2.0);\n\t\t\t\t\t\n\t\t\t\t\tvar dist1 = ( (dia.y / 2.0) / tanfov2 + dia.z ) + this._fieldOfView[2];\n\t\t\t\t\tvar dist2 = ( (dia.x / 2.0) / tanfov2 + dia.z ) + this._fieldOfView[2];\n\n\t\t\t\t\tvar dist = (dist1 > dist2) ? dist1 : dist2;\n\n\t\t\t\t\tzfar = dist * 4;\n                    znear = 0.0001;\n\n                    this._viewMatrix._23 = -(dist*2);\n                }\n\t\t\t\t\n                if (this._projMatrix == null || this._lastAspect != aspect ||\n\t\t\t\t    this._zNear != znear || this._zFar != zfar)\n                {\n                    var near = this._zNear = znear;\n\t\t\t\t\tvar far  = this._zFar = zfar; \n\n                    var left   = this._fieldOfView[0];\n                    var bottom = this._fieldOfView[1];\n                    var right  = this._fieldOfView[2];\n                    var top    = this._fieldOfView[3];\n\n                    this._projMatrix = x3dom.fields.SFMatrix4f.ortho(left, right, bottom, top, near, far, aspect);\n                }\n                \n                this._lastAspect = aspect;\n\n                return this._projMatrix;\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### Viewfrustum ### */\nx3dom.registerNodeType(\n    \"Viewfrustum\",\n    \"Navigation\",\n    defineClass(x3dom.nodeTypes.X3DViewpointNode,\n        \n        /**\n         * Constructor for Viewfrustum\n         * @constructs x3dom.nodeTypes.Viewfrustum\n         * @x3d x.x\n         * @component Navigation\n         * @extends x3dom.nodeTypes.X3DViewpointNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The Viewfrustum node allows to define a camera position and projection utilizing a standard OpenGL projection/modelview pair.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Viewfrustum.superClass.call(this, ctx);\n\n\n            /**\n             * Camera modelview matrix\n             * @var {x3dom.fields.SFMatrix4f} modelview\n             * @memberof x3dom.nodeTypes.Viewfrustum\n             * @initvalue 1,0,0,0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFMatrix4f(ctx, 'modelview',\n                1, 0, 0, 0,\n                0, 1, 0, 0,\n                0, 0, 1, 0,\n                0, 0, 0, 1);\n\n            /**\n             * Camera projection matrix\n             * @var {x3dom.fields.SFMatrix4f} projection\n             * @memberof x3dom.nodeTypes.Viewfrustum\n             * @initvalue 1,0,0,0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFMatrix4f(ctx, 'projection',\n                1, 0, 0, 0,\n                0, 1, 0, 0,\n                0, 0, 1, 0,\n                0, 0, 0, 1);\n\n            this._viewMatrix = this._vf.modelview.transpose().inverse();\n            this._projMatrix = this._vf.projection.transpose();\n\n            this._centerOfRotation = new x3dom.fields.SFVec3f(0, 0, 0);\n            // FIXME; derive near/far from current matrix, if requested!\n        \n        },\n        {\n            fieldChanged: function (fieldName) {\n                if (fieldName == \"modelview\") {\n                    this.resetView();\n                }\n                else if (fieldName == \"projection\") {\n                    this._projMatrix = this._vf.projection.transpose();\n                }\n                else if (fieldName.indexOf(\"bind\") >= 0) {\n                    this.bind(this._vf.bind);\n                }\n            },\n\n            getCenterOfRotation: function() {\n                return this.getCurrentTransform().multMatrixPnt(this._centerOfRotation);  // this field is only a little helper for examine mode\n            },\n\n            setCenterOfRotation: function(cor) {\n                this._centerOfRotation.setValues(cor);   // update internal helper field\n            },\n\n            getViewMatrix: function() {\n                return this._viewMatrix;\n            },\n\n            getFieldOfView: function() {\n                return (2.0 * Math.atan(1.0 / this._projMatrix._11));\n            },\n\n            getImgPlaneHeightAtDistOne: function() {\n                return 2.0 / this._projMatrix._11;\n            },\n\n            resetView: function() {\n                this._viewMatrix = this._vf.modelview.transpose().inverse();\n                this._centerOfRotation = new x3dom.fields.SFVec3f(0, 0, 0);       // reset helper, too\n            },\n\n            getProjectionMatrix: function(aspect) {\n                return this._projMatrix;\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### X3DNavigationInfoNode ### */\nx3dom.registerNodeType(\n    \"X3DNavigationInfoNode\",\n    \"Navigation\",\n    defineClass(x3dom.nodeTypes.X3DBindableNode,\n        \n        /**\n         * Constructor for X3DNavigationInfoNode\n         * @constructs x3dom.nodeTypes.X3DNavigationInfoNode\n         * @x3d x.x\n         * @component Navigation\n         * @extends x3dom.nodeTypes.X3DBindableNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DNavigationInfoNode.superClass.call(this, ctx);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### NavigationInfo ### */\nx3dom.registerNodeType(\n    \"NavigationInfo\",\n    \"Navigation\",\n    defineClass(x3dom.nodeTypes.X3DNavigationInfoNode,\n        \n        /**\n         * Constructor for NavigationInfo\n         * @constructs x3dom.nodeTypes.NavigationInfo\n         * @x3d 3.3\n         * @component Navigation\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DNavigationInfoNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc NavigationInfo describes the viewing model and physical characteristics of the viewer's avatar.\n         * Hint: for inspection of simple objects, usability often improves with type='EXAMINE' 'ANY' Hint: NavigationInfo types ''WALK' 'FLY'' support camera-to-object collision detection.\n         * Background, Fog, NavigationInfo, TextureBackground and Viewpoint are bindable nodes.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.NavigationInfo.superClass.call(this, ctx);\n\n\n            /**\n             * Enable/disable directional light that always points in the direction the user is looking.\n             * @var {x3dom.fields.SFBool} headlight\n             * @memberof x3dom.nodeTypes.NavigationInfo\n             * @initvalue true\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'headlight', true);\n\n            /**\n             * Enable/disable reversed mousewheel scrolling to zoom.\n             * @var {x3dom.fields.SFBool} reverseScroll\n             * @memberof x3dom.nodeTypes.NavigationInfo\n             * @initvalue false\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'reverseScroll', false);\n\n            /**\n             * defines the navigation type\n             * @var {x3dom.fields.MFString} type\n             * @range {\"ANY\",\"WALK\",\"EXAMINE\",\"FLY\",\"LOOKAT\",\"NONE\",\"EXPLORE\",...}\n             * @memberof x3dom.nodeTypes.NavigationInfo\n             * @initvalue [\"EXAMINE\",\"ANY\"]\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFString(ctx, 'type', [\"EXAMINE\",\"ANY\"]);\n\n            /**\n             * Specifies the view angle and height for helicopter mode and min/max rotation angle for turntable in ]0, PI[, starting from +y (0) down to -y (PI)\n             * @var {x3dom.fields.MFFloat} typeParams\n             * @memberof x3dom.nodeTypes.NavigationInfo\n             * @initvalue [-0.4,60,0.05,2.8]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFFloat(ctx, 'typeParams', [-0.4, 60, 0.05, 2.8]);\n\n            /**\n             * allows restricting examine and turntable navigation, overrides mouse buttons (useful for special viewers)\n             * @range [all, pan, zoom, rotate, none]\n             * @var {x3dom.fields.SFString} explorationMode\n             * @memberof x3dom.nodeTypes.NavigationInfo\n             * @initvalue 'all'\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'explorationMode', 'all');\n            // TODO; use avatarSize + visibilityLimit for projection matrix (near/far)\n\n            /**\n             * avatarSize triplet values are:\n             * (a) collision distance between user and geometry (near culling plane of the view frustrum)\n             * (b) viewer height above terrain\n             * (c) tallest height viewer can WALK over.\n             * Hint: keep (avatarSize.CollisionDistance / visibilityLimit) less then; 10,000 to avoid aliasing artifacts (i.e. polygon 'tearing').\n             * Interchange profile hint: this field may be ignored.\n             * @var {x3dom.fields.MFFloat} avatarSize\n             * @memberof x3dom.nodeTypes.NavigationInfo\n             * @initvalue [0.25,1.6,0.75]\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFFloat(ctx, 'avatarSize', [0.25, 1.6, 0.75]);\n\n            /**\n             * Factor for damping the walk animation\n             * Interchange profile hint: this field may be ignored.\n             * @var {x3dom.fields.SFFloat} walkDamping\n             * @memberof x3dom.nodeTypes.NavigationInfo\n             * @initvalue 2.0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'walkDamping', 2.0);\n\n            /**\n             * Geometry beyond the visibilityLimit may not be rendered (far culling plane of the view frustrum).\n             * visibilityLimit=0.0 indicates an infinite visibility limit.\n             * Hint: keep visibilityLimit greater than zero.\n             * Hint: keep (avatarSize.CollisionDistance / visibilityLimit) less than 10,000 to avoid aliasing artifacts (i.e. polygon 'tearing').\n             * Interchange profile hint: this field may be ignored.\n             * @var {x3dom.fields.SFFloat} visibilityLimit\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.NavigationInfo\n             * @initvalue 0.0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'visibilityLimit', 0.0);\n\n            /**\n             * Default rate at which viewer travels through scene, meters/second.\n             * Warning: default 1 m/s usually seems slow for ordinary navigation.\n             * Interchange profile hint: this field may be ignored.\n             * @var {x3dom.fields.SFFloat} speed\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.NavigationInfo\n             * @initvalue 1.0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'speed', 1.0);\n            // for 'jumping' between viewpoints (bind transition time)\n\n            /**\n             * The transitionTime field specifies the duration of any viewpoint transition\n             * @var {x3dom.fields.SFTime} transitionTime\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.NavigationInfo\n             * @initvalue 1.0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFTime(ctx, 'transitionTime', 1.0);\n\n            /**\n             * Specifies the transition mode.\n             * @var {x3dom.fields.MFString} transitionType\n             * @range [LINEAR, TELEPORT, ANIMATE, ...]\n             * @memberof x3dom.nodeTypes.NavigationInfo\n             * @initvalue [\"LINEAR\"]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFString(ctx, 'transitionType', [\"LINEAR\"]);\n\n            this._validTypes = [\n                \"none\", \"examine\", \"turntable\",\n                \"fly\", \"freefly\", \"lookat\", \"lookaround\",\n                \"walk\", \"game\", \"helicopter\", \"any\"\n            ];\n            \n            this._typeMapping = {\n              \"default\":x3dom.DefaultNavigation,\n              \"turntable\":x3dom.TurntableNavigation,\n              \"walk\":x3dom.WalkNavigation\n            };\n            \n            this._heliUpdated = false;\n\n            var type = this.setType(this.getType());\n            x3dom.debug.logInfo(\"NavType: \" + type);\n        \n        },\n        {\n            fieldChanged: function(fieldName) {\n                if (fieldName == \"typeParams\") {\n                    this._heliUpdated = false;\n                }\n                else if (fieldName == \"type\") {\n                    this.setType(this.getType());\n                }\n                //AP: needs to be preserved from X3DBindableNode\n                else if (fieldName.indexOf(\"bind\") >= 0) {\n                    this.bind(this._vf.bind);\n                }\n            },\n\n            setType: function(type, viewarea) {\n                var navType = this.checkType(type.toLowerCase());\n                var oldType = this.checkType(this.getType());\n\n                if(oldType !== navType || this._impl == null){\n                    if(this._typeMapping[navType] == null)\n                        this._impl = new this._typeMapping['default'](this);    \n                    else\n                        this._impl = new this._typeMapping[navType](this);                    \n                    \n                    switch (navType) {\n                        case 'game': //perhaps needed for 'walk' as well ?\n                            if (viewarea)\n                                viewarea.initMouseState();\n                            else\n                                this._nameSpace.doc._viewarea.initMouseState();\n                            break;\n                        case 'helicopter':\n                            this._heliUpdated = false;\n                            break;\n                        case \"turntable\":\n                            if (viewarea) {\n                                viewarea.initMouseState();\n                            }\n                            else if(this._nameSpace.doc._viewarea){\n                                this._nameSpace.doc._viewarea.initMouseState();\n                            }\n                            break;\n                        default:\n                            break;\n                    }\n                    if (this._nameSpace.doc._viewarea)\n                        this._impl.init(this._nameSpace.doc._viewarea, false);\n                }\n\n                this._vf.type[0] = navType;\n                x3dom.debug.logInfo(\"Switch to \" + navType + \" mode.\");\n            },\n\n            getType: function() {\n                var type = this._vf.type[0].toLowerCase();\n                // FIXME; the following if's aren't nice!\n                if (type.length <= 1)\n                    type = \"none\";\n                else if (type == \"any\")\n                    type = \"examine\";\n                return type;\n            },\n\n            getTypeParams: function() {\n                var length = this._vf.typeParams.length;\n\n                var theta  = (length >= 1) ? this._vf.typeParams[0] : -0.4;\n                var height = (length >= 2) ? this._vf.typeParams[1] : 60.0;\n                var minAngle = (length >= 3) ? this._vf.typeParams[2] : x3dom.fields.Eps;\n                var maxAngle = (length >= 4) ? this._vf.typeParams[3] : Math.PI - x3dom.fields.Eps;\n\n                // experimental HACK to switch between clamp to CoR (params[4]>0) and CoR translation in turntable mode\n               var params = [theta, height, minAngle, maxAngle];\n               if (length >= 5)\n               {\n                   // SPREAD OPERATOR KILLS IE\n                   // adding rest parameters\n                   //params.push(...this._vf.typeParams.slice(4));\n                   \n                   params = params.concat( this._vf.typeParams.slice(4) );\n                   \n               }\n               return params;\n            },\n\n            setTypeParams: function(params) {\n                for (var i=0; i<params.length; i++) {\n                    this._vf.typeParams[i] = params[i];\n                }\n            },\n\n            checkType: function(type) {\n                if (this._validTypes.indexOf(type) > -1) {\n                    return type;\n                }\n                else {\n                    x3dom.debug.logWarning(type + \" is no valid navigation type, use one of \" +\n                        this._validTypes.toString());\n                    return \"examine\";\n                }\n            },\n\n            getExplorationMode: function() {\n                switch (this._vf.explorationMode.toLowerCase()) {\n                    case \"all\":    return 7;\n                    case \"rotate\": return 1; //left btn\n                    case \"zoom\":   return 2; //right btn\n                    case \"pan\":    return 4; //middle btn\n                    case \"none\":   return 0; //type 'none'\n                    default:       return 7;\n                }\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### Billboard ### */\nx3dom.registerNodeType(\n    \"Billboard\",\n    \"Navigation\",\n    defineClass(x3dom.nodeTypes.X3DGroupingNode,\n        \n        /**\n         * Constructor for Billboard\n         * @constructs x3dom.nodeTypes.Billboard\n         * @x3d 3.3\n         * @component Navigation\n         * @status full\n         * @extends x3dom.nodeTypes.X3DGroupingNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc Billboard is a Grouping node that can contain most nodes.\n         * Content faces the user, rotating about the specified axis. Set axisOfRotation=0 0 0 to fully face the user's camera.\n         * Hint: Put Billboard as close to the geometry as possible, nested inside Transform for local coordinate system.\n         * Hint: don't put Viewpoint inside a Billboard.\n         * Hint: insert a Shape node before adding geometry or Appearance.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Billboard.superClass.call(this, ctx);\n\n            /**\n             * axisOfRotation direction is relative to local coordinate system. Hint: axis 0 0 0 always faces viewer.\n             * @var {x3dom.fields.SFVec3f} axisOfRotation\n             * @memberof x3dom.nodeTypes.Billboard\n             * @initvalue 0,1,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'axisOfRotation', 0, 1, 0);\n\n            this._eye = new x3dom.fields.SFVec3f(0, 0, 0);\n            this._eyeViewUp = new x3dom.fields.SFVec3f(0, 0, 0);\n            this._eyeLook = new x3dom.fields.SFVec3f(0, 0, 0);\n        \n        },\n        {\n            collectDrawableObjects: function (transform, drawableCollection, singlePath, invalidateCache, planeMask, clipPlanes)\n            {\n                if (singlePath && (this._parentNodes.length > 1))\n                    singlePath = false;\n\n                if (singlePath && (invalidateCache = invalidateCache || this.cacheInvalid()))\n                    this.invalidateCache();\n\n                planeMask = drawableCollection.cull(transform, this.graphState(), singlePath, planeMask);\n                if (planeMask < 0) {\n                    return;\n                }\n\n                // no caching later on as transform changes almost every frame anyway\n                singlePath = false;\n\n                var vol = this.getVolume();\n\n                var min = x3dom.fields.SFVec3f.MAX();\n                var max = x3dom.fields.SFVec3f.MIN();\n                vol.getBounds(min, max);\n\n                var mat_view = drawableCollection.viewMatrix;\n\n                var center = new x3dom.fields.SFVec3f(0, 0, 0); // eye\n                center = mat_view.inverse().multMatrixPnt(center);\n\n                var mat_view_model = mat_view.mult(transform);\n                this._eye = transform.inverse().multMatrixPnt(center);\n                this._eyeViewUp = new x3dom.fields.SFVec3f(mat_view_model._10, mat_view_model._11, mat_view_model._12);\n                this._eyeLook = new x3dom.fields.SFVec3f(mat_view_model._20, mat_view_model._21, mat_view_model._22);\n\n                var rotMat = x3dom.fields.SFMatrix4f.identity();\n                var mid = max.add(min).multiply(0.5);\n                var billboard_to_viewer = this._eye.subtract(mid);\n\n                if(this._vf.axisOfRotation.equals(new x3dom.fields.SFVec3f(0, 0, 0), x3dom.fields.Eps)) {\n                    var rot1 = x3dom.fields.Quaternion.rotateFromTo(\n                        billboard_to_viewer, new x3dom.fields.SFVec3f(0, 0, 1));\n                    rotMat = rot1.toMatrix().transpose();\n\n                    var yAxis = rotMat.multMatrixPnt(new x3dom.fields.SFVec3f(0, 1, 0)).normalize();\n                    var zAxis = rotMat.multMatrixPnt(new x3dom.fields.SFVec3f(0, 0, 1)).normalize();\n\n                    if(!this._eyeViewUp.equals(new x3dom.fields.SFVec3f(0, 0, 0), x3dom.fields.Eps)) {\n                        // new local z-axis aligned with camera z-axis\n                        var rot2 = x3dom.fields.Quaternion.rotateFromTo(this._eyeLook, zAxis);\n                        // new: local y-axis rotated by rot2\n                        var rotatedyAxis = rot2.toMatrix().transpose().multMatrixVec(yAxis);\n                        // new: rotated local y-axis aligned with camera y-axis\n                        var rot3 = x3dom.fields.Quaternion.rotateFromTo(this._eyeViewUp, rotatedyAxis);\n\n                        rotMat = rot2.toMatrix().transpose().mult(rotMat);\n                        rotMat = rot3.toMatrix().transpose().mult(rotMat);\n                    }\n                }\n                else {\n                    var normalPlane = this._vf.axisOfRotation.cross(billboard_to_viewer).normalize();\n\n                    if(this._eye.z < 0) {\n                        normalPlane = normalPlane.multiply(-1);\n                    }\n\n                    var degreesToRotate = Math.asin(normalPlane.dot(new x3dom.fields.SFVec3f(0, 0, 1)));\n\n                    if(this._eye.z < 0) {\n                        degreesToRotate += Math.PI;\n                    }\n\n                    rotMat = x3dom.fields.SFMatrix4f.parseRotation(\n                            this._vf.axisOfRotation.x + \", \" + this._vf.axisOfRotation.y + \", \" +\n                            this._vf.axisOfRotation.z + \", \" + degreesToRotate*(-1));\n                }\n\n                var childTransform = this.transformMatrix(transform.mult(rotMat));\n\n                for (var i=0, i_n=this._childNodes.length; i<i_n; i++)\n                {\n                    var cnode = this._childNodes[i];\n                    if (cnode) {\n                        cnode.collectDrawableObjects(childTransform, drawableCollection, singlePath, invalidateCache, planeMask, clipPlanes);\n                    }\n                }\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### Collision ###\nx3dom.registerNodeType(\n    \"Collision\",\n    \"Navigation\",\n    defineClass(x3dom.nodeTypes.X3DGroupingNode,\n        \n        /**\n         * Constructor for Collision\n         * @constructs x3dom.nodeTypes.Collision\n         * @x3d 3.3\n         * @component Navigation\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DGroupingNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc Collision detects camera-to-object contact using current Viewpoint and NavigationInfo avatarSize.\n         * Collision is a Grouping node that handles collision detection for its children.\n         * Collision can contain a single proxy child node for substitute collision-detection geometry.\n         * Note: proxy geometry is not rendered.\n         * Note: PointSet, IndexedLineSet, LineSet and Text do not trigger collisions.\n         * Hint: improve performance using proxy for simpler contact-calculation geometry.\n         * Hint: NavigationInfo types ''WALK' 'FLY'' support camera-to-object collision detection.\n         * Hint: insert a Shape node before adding geometry or Appearance.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Collision.superClass.call(this, ctx);\n\n\n            /**\n             * Enables/disables collision detection for children and all descendants. Hint: former name quotecollidequote in VRML 97 specification.\n             * @var {x3dom.fields.SFBool} enabled\n             * @memberof x3dom.nodeTypes.Collision\n             * @initvalue true\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool (ctx, \"enabled\", true);\n\n            /**\n             * alternate object to be checked for collision, in place of the children of this node.\n             * @var {x3dom.fields.SFNode} proxy\n             * @memberof x3dom.nodeTypes.Collision\n             * @initvalue x3dom.nodeTypes.X3DGroupingNode\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFNode (\"proxy\", x3dom.nodeTypes.X3DGroupingNode);\n\n\n            // TODO; add Slots: collideTime, isActive\n            /**\n             * NOT YET IMPLEMENTED. The time of collision.\n             * @var {x3dom.fields.SFTime} collideTime\n             * @memberof x3dom.nodeTypes.Collision\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFTime (ctx, \"collideTime\", 0);\n\n            /**\n             * NOT YET IMPLEMENTED. The value of the isActive field indicates the current state of the Collision node.\n             * An isActive TRUE event is generated when a collision occurs. An isActive FALSE event is generated when a collision no longer occurs.\n             * @var {x3dom.fields.SFBool} isActive\n             * @memberof x3dom.nodeTypes.Collision\n             * @initvalue true\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool (ctx, \"isActive\", true);\n        },\n        {\n            collectDrawableObjects: function (transform, drawableCollection, singlePath, invalidateCache, planeMask, clipPlanes)\n            {\n                if (singlePath && (this._parentNodes.length > 1))\n                    singlePath = false;\n\n                if (singlePath && (invalidateCache = invalidateCache || this.cacheInvalid()))\n                    this.invalidateCache();\n\n                planeMask = drawableCollection.cull(transform, this.graphState(), singlePath, planeMask);\n                if (planeMask < 0) {\n                    return;\n                }\n\n                var cnode, childTransform;\n\n                if (singlePath) {\n                    if (!this._graph.globalMatrix) {\n                        this._graph.globalMatrix = this.transformMatrix(transform);\n                    }\n                    childTransform = this._graph.globalMatrix;\n                }\n                else {\n                    childTransform = this.transformMatrix(transform);\n                }\n\n                for (var i=0, n=this._childNodes.length; i<n; i++)\n                {\n                    if ((cnode = this._childNodes[i]) && (cnode !== this._cf.proxy.node)) {\n                        cnode.collectDrawableObjects(childTransform, drawableCollection, singlePath, invalidateCache, planeMask, clipPlanes);\n                    }\n                }\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### X3DLODNode ###\nx3dom.registerNodeType(\n    \"X3DLODNode\",\n    \"Navigation\",\n    defineClass(x3dom.nodeTypes.X3DGroupingNode,\n        \n        /**\n         * Constructor for X3DLODNode\n         * @constructs x3dom.nodeTypes.X3DLODNode\n         * @x3d x.x\n         * @component Navigation\n         * @extends x3dom.nodeTypes.X3DGroupingNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DLODNode.superClass.call(this, ctx);\n\n\n            /**\n             * The forceTransitions field specifies whether browsers are allowed to disregard level distances in order to provide better performance.\n             * @var {x3dom.fields.SFBool} forceTransitions\n             * @memberof x3dom.nodeTypes.X3DLODNode\n             * @initvalue false\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool (ctx, \"forceTransitions\", false);\n\n            /**\n             * The center field is a translation offset in the local coordinate system that specifies the centre of the LOD node for distance calculations.\n             * @var {x3dom.fields.SFVec3f} center\n             * @memberof x3dom.nodeTypes.X3DLODNode\n             * @initvalue 0,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, \"center\", 0, 0, 0);\n\n            this._eye = new x3dom.fields.SFVec3f(0, 0, 0);\n        \n        },\n        {\n            collectDrawableObjects: function(transform, drawableCollection, singlePath, invalidateCache, planeMask, clipPlanes)\n            {\n                if (singlePath && (this._parentNodes.length > 1))\n                    singlePath = false;\n\n                if (singlePath && (invalidateCache = invalidateCache || this.cacheInvalid()))\n                    this.invalidateCache();\n\n                planeMask = drawableCollection.cull(transform, this.graphState(), singlePath, planeMask);\n                if (planeMask < 0) {\n                    return;\n                }\n\n                // at the moment, no caching here as children may change every frame\n                singlePath = false;\n\n                this.visitChildren(transform, drawableCollection, singlePath, invalidateCache, planeMask, clipPlanes);\n\n                //out.LODs.push( [transform, this] );\n            },\n\n            visitChildren: function(transform, drawableCollection, singlePath, invalidateCache, planeMask, clipPlanes) {\n                // overwritten\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### LOD ###\nx3dom.registerNodeType(\n    \"LOD\",\n    \"Navigation\",\n    defineClass(x3dom.nodeTypes.X3DLODNode,\n        \n        /**\n         * Constructor for LOD\n         * @constructs x3dom.nodeTypes.LOD\n         * @x3d 3.3\n         * @component Navigation\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DLODNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc LOD (Level Of Detail) uses camera-to-object distance to switch among contained child levels.\n         * (Contained nodes are now called 'children' rather than 'level', for consistent naming among all GroupingNodeType nodes.)\n         * LOD range values go from near to far (as child geometry gets simpler for better performance).\n         * For n range values, you must have n+1 children levels! Only the currently selected children level is rendered, but all levels continue to send/receive events.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.LOD.superClass.call(this, ctx);\n\n\n            /**\n             * Camera-to-object distance transitions for each child level, where range values go from near to far. For n range values, you must have n+1 child levels! Hint: can add an empty Group node as nonrendering final child.\n             * @var {x3dom.fields.MFFloat} range\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.LOD\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFFloat(ctx, \"range\", []);\n\n            /**\n             * outputOnly field which is emitted when the level changes to another range index. When L(d) is activated for display, the LOD node generates a level_changed event with value i where the value of i identifies which value of L was activated for display. Indicates current level of LOD children when activated.\n             * @var {x3dom.fields.SFInt32} level_changed\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.LOD\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFInt32(ctx, \"level_changed\", 0);\n\n            this._lastRangePos = -1;\n        \n        },\n        {\n            visitChildren: function(transform, drawableCollection, singlePath, invalidateCache, planeMask, clipPlanes)\n            {\n                var i=0, n=this._childNodes.length;\n\n                var mat_view = drawableCollection.viewMatrix;\n\n                var center = new x3dom.fields.SFVec3f(0, 0, 0); // eye\n                center = mat_view.inverse().multMatrixPnt(center);\n\n                //transform eye point to the LOD node's local coordinate system\n                this._eye = transform.inverse().multMatrixPnt(center);\n\n                var len = this._vf.center.subtract(this._eye).length();\n\n                //calculate range check for viewer distance d (with range in local coordinates)\n                //N+1 children nodes for N range values (L0, if d < R0, ... Ln-1, if d >= Rn-1)\n                while (i < this._vf.range.length && len > this._vf.range[i]) {\n                    i++;\n                }\n                if (i && i >= n) {\n                    i = n - 1;\n                }\n              \n                if (i !== this._lastRangePos) {\n                    //x3dom.debug.logInfo('Changed from '+this._lastRangePos+' th range to '+i+' th.');\n                    this.postMessage('level_changed', i);\n                }\n              \n                this._lastRangePos = i;\n\n                var cnode = this._childNodes[i];\n                if (n && cnode)\n                {\n                    var childTransform = this.transformMatrix(transform);\n                    cnode.collectDrawableObjects(childTransform, drawableCollection, singlePath, invalidateCache, planeMask, clipPlanes);\n                }\n            },\n\n            getVolume: function()\n            {\n                var vol = this._graph.volume;\n\n                if (!this.volumeValid() && this._vf.render)\n                {\n                    var child, childVol;\n\n                    if (this._lastRangePos >= 0) {\n                        child = this._childNodes[this._lastRangePos];\n\n                        childVol = (child && child._vf.render === true) ? child.getVolume() : null;\n\n                        if (childVol && childVol.isValid())\n                            vol.extendBounds(childVol.min, childVol.max);\n                    }\n                    else {  // first time we're here\n                        for (var i=0, n=this._childNodes.length; i<n; i++)\n                        {\n                            if (!(child = this._childNodes[i]) || child._vf.render !== true)\n                                continue;\n\n                            childVol = child.getVolume();\n\n                            if (childVol && childVol.isValid())\n                                vol.extendBounds(childVol.min, childVol.max);\n                        }\n                    }\n                }\n\n                return vol;\n            },\n\n            nodeChanged: function() {\n                //this._needReRender = true;\n                this.invalidateVolume();\n                //this.invalidateCache();\n            },\n\n            fieldChanged: function(fieldName) {\n                //this._needReRender = true;\n                if (fieldName == \"render\" ||\n                    fieldName == \"center\" ||\n                    fieldName == \"range\") {\n                    this.invalidateVolume();\n                    //this.invalidateCache();\n                }\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### DynamicLOD ###\nx3dom.registerNodeType(\n    \"DynamicLOD\",\n    \"Navigation\",\n    defineClass(x3dom.nodeTypes.X3DLODNode,\n        \n        /**\n         * Constructor for DynamicLOD\n         * @constructs x3dom.nodeTypes.DynamicLOD\n         * @x3d x.x\n         * @component Navigation\n         * @extends x3dom.nodeTypes.X3DLODNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         */\n        function (ctx) {\n            x3dom.nodeTypes.DynamicLOD.superClass.call(this, ctx);\n\n\n            /**\n             *\n             * @var {x3dom.fields.SFFloat} subScale\n             * @memberof x3dom.nodeTypes.DynamicLOD\n             * @initvalue 0.5\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'subScale', 0.5);\n\n            /**\n             *\n             * @var {x3dom.fields.SFVec2f} size\n             * @memberof x3dom.nodeTypes.DynamicLOD\n             * @initvalue 2,2\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec2f(ctx, 'size', 2, 2);\n\n            /**\n             *\n             * @var {x3dom.fields.SFVec2f} subdivision\n             * @memberof x3dom.nodeTypes.DynamicLOD\n             * @initvalue 1,1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec2f(ctx, 'subdivision', 1, 1);\n\n            /**\n             *\n             * @var {x3dom.fields.SFNode} root\n             * @memberof x3dom.nodeTypes.DynamicLOD\n             * @initvalue x3dom.nodeTypes.X3DShapeNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode ('root', x3dom.nodeTypes.X3DShapeNode);\n\n\n            /**\n             *\n             * @var {x3dom.fields.SFString} urlHead\n             * @memberof x3dom.nodeTypes.DynamicLOD\n             * @initvalue \"http://r\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'urlHead', \"http://r\");\n\n            /**\n             *\n             * @var {x3dom.fields.SFString} urlCenter\n             * @memberof x3dom.nodeTypes.DynamicLOD\n             * @initvalue \".ortho.tiles.virtualearth.net/tiles/h\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'urlCenter', \".ortho.tiles.virtualearth.net/tiles/h\");\n\n            /**\n             *\n             * @var {x3dom.fields.SFString} urlTail\n             * @memberof x3dom.nodeTypes.DynamicLOD\n             * @initvalue \".png?g=-1\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'urlTail', \".png?g=-1\");\n\n            this.rootGeometry = new x3dom.nodeTypes.Plane(ctx);\n            this.level = 0;\n            this.quadrant = 4;\n            this.cell = \"\";\n        \n        },\n        {\n            nodeChanged: function()\n            {\n                var root = this._cf.root.node;\n\n                if (root == null || root._cf.geometry.node != null)\n                    return;\n\n                this.rootGeometry._vf.size.setValues(this._vf.size);\n                this.rootGeometry._vf.subdivision.setValues(this._vf.subdivision);\n                this.rootGeometry._vf.center.setValues(this._vf.center);\n                this.rootGeometry.fieldChanged(\"subdivision\");   // trigger update\n\n                this._cf.root.node.addChild(this.rootGeometry);  // add to shape\n                this.rootGeometry.nodeChanged();\n\n                this._cf.root.node.nodeChanged();\n\n                this._nameSpace.doc.needRender = true;\n            },\n\n            visitChildren: function(transform, drawableCollection, singlePath, invalidateCache, planeMask, clipPlanes)\n            {\n                var root = this._cf.root.node;\n\n                if (root == null)\n                    return;\n\n                var mat_view = drawableCollection.viewMatrix;\n\n                var center = new x3dom.fields.SFVec3f(0, 0, 0); // eye\n                center = mat_view.inverse().multMatrixPnt(center);\n\n                //var mat_view_model = mat_view.mult(transform);\n                this._eye = transform.inverse().multMatrixPnt(center);\n\n                var l, len = this._vf.center.subtract(this._eye).length();\n\n                //calculate range check for viewer distance d (with range in local coordinates)\n                if (len > x3dom.fields.Eps && len * this._vf.subScale <= this._vf.size.length()) {\n                    /*  Quadrants per level: (TODO; make parameterizable, e.g. 0 and 1 might be swapped)\n                     0 | 1\n                     -----\n                     2 | 3\n                     */\n                    if (this._childNodes.length <= 1) {\n                        var offset = new Array(\n                            new x3dom.fields.SFVec3f(-0.25*this._vf.size.x,  0.25*this._vf.size.y, 0),\n                            new x3dom.fields.SFVec3f( 0.25*this._vf.size.x,  0.25*this._vf.size.y, 0),\n                            new x3dom.fields.SFVec3f(-0.25*this._vf.size.x, -0.25*this._vf.size.y, 0),\n                            new x3dom.fields.SFVec3f( 0.25*this._vf.size.x, -0.25*this._vf.size.y, 0)\n                        );\n\n                        for (l=0; l<4; l++) {\n                            var node = new x3dom.nodeTypes.DynamicLOD();\n\n                            node._nameSpace = this._nameSpace;\n                            node._eye.setValues(this._eye);\n\n                            node.level = this.level + 1;\n                            node.quadrant = l;\n                            node.cell = this.cell + l;\n\n                            node._vf.urlHead = this._vf.urlHead;\n                            node._vf.urlCenter = this._vf.urlCenter;\n                            node._vf.urlTail = this._vf.urlTail;\n\n                            node._vf.center = this._vf.center.add(offset[l]);\n                            node._vf.size = this._vf.size.multiply(0.5);\n                            node._vf.subdivision.setValues(this._vf.subdivision);\n\n                            var app = new x3dom.nodeTypes.Appearance();\n\n                            //var mat = new x3dom.nodeTypes.Material();\n                            //mat._vf.diffuseColor = new x3dom.fields.SFVec3f(Math.random(),Math.random(),Math.random());\n                            //\n                            //app.addChild(mat);\n                            //mat.nodeChanged();\n\n                            var tex = new x3dom.nodeTypes.ImageTexture();\n                            tex._nameSpace = this._nameSpace;\n                            tex._vf.url[0] = this._vf.urlHead + node.quadrant + this._vf.urlCenter + node.cell + this._vf.urlTail;\n                            //x3dom.debug.logInfo(tex._vf.url[0]);\n\n                            app.addChild(tex);\n                            tex.nodeChanged();\n\n                            var shape = new x3dom.nodeTypes.Shape();\n                            shape._nameSpace = this._nameSpace;\n\n                            shape.addChild(app);\n                            app.nodeChanged();\n\n                            node.addChild(shape, \"root\");\n                            shape.nodeChanged();\n\n                            this.addChild(node);\n                            node.nodeChanged();\n                        }\n                    }\n                    else {\n                        for (l=1; l<this._childNodes.length; l++) {\n                            this._childNodes[l].collectDrawableObjects(transform, drawableCollection, singlePath, invalidateCache, planeMask, clipPlanes);\n                        }\n                    }\n                }\n                else {\n                    root.collectDrawableObjects(transform, drawableCollection, singlePath, invalidateCache, planeMask, clipPlanes);\n                }\n            },\n\n            getVolume: function() {\n                var vol = this._graph.volume;\n\n                if (!vol.isValid()) {\n                    vol.min.setValues(this._vf.center);\n                    vol.min.x -= 0.5 * this._vf.size.x;\n                    vol.min.y -= 0.5 * this._vf.size.y;\n                    vol.min.z -= x3dom.fields.Eps;\n\n                    vol.max.setValues(this._vf.center);\n                    vol.max.x += 0.5 * this._vf.size.x;\n                    vol.max.y += 0.5 * this._vf.size.y;\n                    vol.max.z += x3dom.fields.Eps;\n                }\n\n                return vol;\n            }\n        }\n    )\n);\nx3dom.DefaultNavigation = function(navigationNode)\n{\n    this.navi = navigationNode;\n};\n\nx3dom.DefaultNavigation.prototype.onMousePress = function(view,x, y, buttonState)\n{\n    \n};\n\nx3dom.DefaultNavigation.prototype.onMouseReleased = function(view,x, y, buttonState, prevButton)\n{\n    \n};\n\nx3dom.DefaultNavigation.prototype.init = function(view, flyTo)\n{\n    \n};\n\nx3dom.DefaultNavigation.prototype.zoom = function(view, zoomAmount)\n{\n    var navi = this.navi;\n\n    var viewpoint = view._scene.getViewpoint();\n\n    var d = (view._scene._lastMax.subtract(view._scene._lastMin)).length();\n    d = Math.min(d, viewpoint.getFar()); // use zfar if smaller to allow for large scenes with defined zfar\n    d = ((d < x3dom.fields.Eps) ? 1 : d) * navi._vf.speed;\n\n    var vec = new x3dom.fields.SFVec3f(0, 0, d*(zoomAmount)/view._height);\n\n    if (x3dom.isa(viewpoint, x3dom.nodeTypes.OrthoViewpoint))\n    {\n        viewpoint.setZoom( Math.abs( viewpoint._fieldOfView[0] ) - vec.z );\n    }\n    //else\n    {\n        if ( navi._vf.typeParams.length >= 6 ) {\n\n            var min = -navi._vf.typeParams[ 5 ];\n            var max =  navi._vf.typeParams[ 4 ];\n\n            view._movement.z = Math.min( Math.max( view._movement.z, min ), max );\n\n        }\n\n        view._movement = view._movement.add(vec);\n        var mat = view.getViewpointMatrix().mult(view._transMat);\n        //TODO; move real distance along viewing ray\n        view._transMat = mat.inverse().\n                            mult(x3dom.fields.SFMatrix4f.translation(view._movement)).\n                            mult(mat);\n    }\n};\n\nx3dom.DefaultNavigation.prototype.moveForward = function(view)\n{\n     var navi = this.navi;\n    \n    if (navi.getType() === \"game\")\n    {\n        var avatarRadius = 0.25;\n        //var avatarHeight = 1.6; // not used\n\n        if (navi._vf.avatarSize.length > 2) {\n            avatarRadius = navi._vf.avatarSize[0];\n            //avatarHeight = navi._vf.avatarSize[1]; // not used\n        }\n\n        var speed = 5 * view._deltaT * navi._vf.speed;\n        var yRotRad = (view._yaw / 180 * Math.PI);\n        var xRotRad = (view._pitch / 180 * Math.PI);\n\n        var dist = 0;\n        var fMat = view._flyMat.inverse();\n\n        // check front for collisions\n        view._scene._nameSpace.doc.ctx.pickValue(view, view._width/2, view._height/2, view._lastButton);\n\n        if (view._pickingInfo.pickObj)\n        {\n            dist = view._pickingInfo.pickPos.subtract(fMat.e3()).length();\n\n            if (dist <= 2 * avatarRadius) {\n                //x3dom.debug.logWarning(\"Collision at dist=\" + dist.toFixed(4));\n            }\n            else {\n                view._eyePos.x -= Math.sin(yRotRad) * speed;\n                view._eyePos.z += Math.cos(yRotRad) * speed;\n                view._eyePos.y += Math.sin(xRotRad) * speed;\n            }\n        }\n    }\n};\n\nx3dom.DefaultNavigation.prototype.moveBackwards = function(view)\n{\n    var navi = this.navi;\n    \n    if (navi.getType() === \"game\")\n    {\n        var speed = 5 * view._deltaT * navi._vf.speed;\n        var yRotRad = (view._yaw / 180 * Math.PI);\n        var xRotRad = (view._pitch / 180 * Math.PI);\n\n        view._eyePos.x += Math.sin(yRotRad) * speed;\n        view._eyePos.z -= Math.cos(yRotRad) * speed;\n        view._eyePos.y -= Math.sin(xRotRad) * speed;\n    }\n};\n\nx3dom.DefaultNavigation.prototype.strafeLeft = function(view)\n{\n    var navi = this.navi;\n    \n    if (navi.getType() === \"game\")\n    {\n        var speed = 5 * view._deltaT * navi._vf.speed;\n        var yRotRad = (view._yaw / 180 * Math.PI);\n\n        view._eyePos.x += Math.cos(yRotRad) * speed;\n        view._eyePos.z += Math.sin(yRotRad) * speed;\n    }\n};\n\nx3dom.DefaultNavigation.prototype.strafeRight = function(view)\n{\n    var navi = this.navi;\n    \n    if (navi.getType() === \"game\")\n    {\n        var speed = 5 * view._deltaT * navi._vf.speed;\n        var yRotRad = (view._yaw / 180 * Math.PI);\n\n        view._eyePos.x -= Math.cos(yRotRad) * speed;\n        view._eyePos.z -= Math.sin(yRotRad) * speed;\n    }\n};\n\nx3dom.DefaultNavigation.prototype.navigateTo = function(view, timeStamp)\n{\n    var navi = this.navi;\n    var navType = navi.getType();\n    var savedPickingInfo = null;\n    \n    var needNavAnim = (view._currentInputType == x3dom.InputTypes.NAVIGATION) &&\n                      ( navType === \"game\" ||\n                        (view._lastButton > 0 &&\n                        (navType.indexOf(\"fly\") >= 0 ||\n                         navType === \"walk\" ||\n                         navType === \"helicopter\" ||\n                         navType.substr(0, 5) === \"looka\")) );\n    \n    view._deltaT = timeStamp - view._lastTS;\n    \n    var removeZeroMargin = function(val, offset) {\n        if (val > 0) {\n            if (val <= offset) {\n                return 0;\n            } else {\n                return val - offset;\n            }\n        } else if (val <= 0) {\n            if (val >= -offset) {\n                return 0;\n            } else {\n                return val + offset;\n            }\n        }\n    };\n    \n    // slightly increasing slope function\n    var humanizeDiff = function(scale, diff) {\n        return ((diff < 0) ? -1 : 1 ) * Math.pow(scale * Math.abs(diff), 1.65 /*lower is easier on the novice*/);\n    };\n\n    if (needNavAnim)\n    {\n\n        //Save picking info if available\n        if( view._pickingInfo.pickObj !== null ) {\n\n            savedPickingInfo = {\n                pickPos: view._pickingInfo.pickPos,\n                pickNorm: view._pickingInfo.pickNorm,\n                pickObj: view._pickingInfo.pickObj,\n                firstObj: view._pickingInfo.firstObj,\n                lastObj: view._pickingInfo.lastObj,\n                lastClickObj: view._pickingInfo.lastClickObj,\n                shadowObjectId: view._pickingInfo.shadowObjectId\n            };\n        }\n\n        var avatarRadius = 0.25;\n        var avatarHeight = 1.6;\n        var avatarKnee = 0.75;  // TODO; check max. step size\n\n        if (navi._vf.avatarSize.length > 2) {\n            avatarRadius = navi._vf.avatarSize[0];\n            avatarHeight = navi._vf.avatarSize[1];\n            avatarKnee = navi._vf.avatarSize[2];\n        }\n        \n        \n\n        // get current view matrix\n        var currViewMat = view.getViewMatrix();\n        var dist = 0;\n        \n        // estimate one screen size for motion puposes so navigation behaviour\n        // is less dependent on screen geometry. view makes no sense for very\n        // anisotropic cases, so it should probably be configurable.\n        var screenSize = Math.min(view._width, view._height);\n        var rdeltaX = removeZeroMargin((view._pressX - view._lastX) / screenSize, 0.01);\n        var rdeltaY = removeZeroMargin((view._pressY - view._lastY) / screenSize, 0.01);\n        \n        var userXdiff = humanizeDiff(1, rdeltaX);\n        var userYdiff = humanizeDiff(1, rdeltaY);\n\n        // check if forwards or backwards (on right button)\n        var step = (view._lastButton & 2) ? -1 : 1;\n        step *= (view._deltaT * navi._vf.speed);\n        \n        // factor in delta time and the nav speed setting\n        var userXstep = view._deltaT * navi._vf.speed * userXdiff;\n        var userYstep = view._deltaT * navi._vf.speed * userYdiff;\n        \n        var phi = Math.PI * view._deltaT * userXdiff;\n        var theta = Math.PI * view._deltaT * userYdiff;\n        \n        if (view._needNavigationMatrixUpdate === true)\n        {\n            view._needNavigationMatrixUpdate = false;\n          \n            // reset examine matrices to identity\n            view._rotMat = x3dom.fields.SFMatrix4f.identity();\n            view._transMat = x3dom.fields.SFMatrix4f.identity();\n            view._movement = new x3dom.fields.SFVec3f(0, 0, 0);\n\n            var angleX = 0;\n            var angleY = Math.asin(currViewMat._02);\n            var C = Math.cos(angleY);\n            \n            if (Math.abs(C) > 0.0001) {\n                angleX = Math.atan2(-currViewMat._12 / C, currViewMat._22 / C);\n            }\n\n            // too many inversions here can lead to distortions\n            view._flyMat = currViewMat.inverse();\n            \n            view._from = view._flyMat.e3();\n            view._at = view._from.subtract(view._flyMat.e2());\n\n            if (navType === \"helicopter\")\n                view._at.y = view._from.y;\n\n            /*\n\n             //lookat, lookaround\n             if (navType.substr(0, 5) === \"looka\")\n             {\n             view._up = view._flyMat.e1();\n             }\n             //all other modes\n             else\n             {\n             //initially read up-vector from current orientation and keep it\n             if (typeof view._up == 'undefined')\n             {\n             view._up = view._flyMat.e1();\n             }\n             }\n\n             */\n\n            view._up = view._flyMat.e1();\n\n            view._pitch = angleX * 180 / Math.PI;\n            view._yaw = angleY * 180 / Math.PI;\n            view._eyePos = view._from.negate();\n        }\n\n        var tmpAt = null, tmpUp = null, tmpMat = null;\n        var q, temp, fin;\n        var lv, sv, up;\n\n        if (navType === \"game\")\n        {\n            view._pitch += view._dy;\n            view._yaw   += view._dx;\n\n            if (view._pitch >=  89) view._pitch = 89;\n            if (view._pitch <= -89) view._pitch = -89;\n            if (view._yaw >=  360) view._yaw -= 360;\n            if (view._yaw < 0) view._yaw = 360 + view._yaw;\n            \n            view._dx = 0;\n            view._dy = 0;\n\n            var xMat = x3dom.fields.SFMatrix4f.rotationX(view._pitch / 180 * Math.PI);\n            var yMat = x3dom.fields.SFMatrix4f.rotationY(view._yaw / 180 * Math.PI);\n\n            var fPos = x3dom.fields.SFMatrix4f.translation(view._eyePos);\n\n            view._flyMat = xMat.mult(yMat).mult(fPos);\n\n            // Finally check floor for terrain following (TODO: optimize!)\n            var flyMat = view._flyMat.inverse();\n\n            var tmpFrom = flyMat.e3();\n            tmpUp = new x3dom.fields.SFVec3f(0, -1, 0);\n\n            tmpAt = tmpFrom.add(tmpUp);\n            tmpUp = flyMat.e0().cross(tmpUp).normalize();\n\n            tmpMat = x3dom.fields.SFMatrix4f.lookAt(tmpFrom, tmpAt, tmpUp);\n            tmpMat = tmpMat.inverse();\n\n            view._scene._nameSpace.doc.ctx.pickValue(view, view._width/2, view._height/2,\n                        view._lastButton, tmpMat, view.getProjectionMatrix().mult(tmpMat));\n\n            if (view._pickingInfo.pickObj)\n            {\n                dist = view._pickingInfo.pickPos.subtract(tmpFrom).length();\n                //x3dom.debug.logWarning(\"Floor collision at dist=\" + dist.toFixed(4));\n\n                tmpFrom.y += (avatarHeight - dist);\n                flyMat.setTranslate(tmpFrom);\n\n                view._eyePos = flyMat.e3().negate();\n                view._flyMat = flyMat.inverse();\n\n                view._pickingInfo.pickObj = null;\n            }\n\n            view._scene.getViewpoint().setView(view._flyMat);\n\n            return needNavAnim;\n        }   // game\n        else if (navType === \"helicopter\") {\n            var typeParams = navi.getTypeParams();\n\n            \n\n            if (view._lastButton & 2) // up/down levelling\n            {\n                var stepUp = 200 * userYstep;\n                typeParams[1] += stepUp;\n                navi.setTypeParams(typeParams);\n            }\n\n            if (view._lastButton & 1) {  // forward/backward motion\n                step = 300 * userYstep;\n            }\n            else {\n                step = 0;\n            }\n            \n            theta = typeParams[0];\n            view._from.y = typeParams[1];\n            view._at.y = view._from.y;\n\n            // rotate around the up vector\n            q = x3dom.fields.Quaternion.axisAngle(view._up, phi);\n            temp = q.toMatrix();\n\n            fin = x3dom.fields.SFMatrix4f.translation(view._from);\n            fin = fin.mult(temp);\n\n            temp = x3dom.fields.SFMatrix4f.translation(view._from.negate());\n            fin = fin.mult(temp);\n\n            view._at = fin.multMatrixPnt(view._at);\n\n            // rotate around the side vector\n            lv = view._at.subtract(view._from).normalize();\n            sv = lv.cross(view._up).normalize();\n            up = sv.cross(lv).normalize();\n\n            lv = lv.multiply(step);\n\n            view._from = view._from.add(lv);\n            view._at = view._at.add(lv);\n\n            // rotate around the side vector\n            q = x3dom.fields.Quaternion.axisAngle(sv, theta);\n            temp = q.toMatrix();\n\n            fin = x3dom.fields.SFMatrix4f.translation(view._from);\n            fin = fin.mult(temp);\n\n            temp = x3dom.fields.SFMatrix4f.translation(view._from.negate());\n            fin = fin.mult(temp);\n\n            var at = fin.multMatrixPnt(view._at);\n\n            view._flyMat = x3dom.fields.SFMatrix4f.lookAt(view._from, at, up);\n\n            view._scene.getViewpoint().setView(view._flyMat.inverse());\n\n            return needNavAnim;\n        }   // helicopter\n\n        // rotate around the up vector\n        q = x3dom.fields.Quaternion.axisAngle(view._up, phi);\n        temp = q.toMatrix();\n\n        fin = x3dom.fields.SFMatrix4f.translation(view._from);\n        fin = fin.mult(temp);\n\n        temp = x3dom.fields.SFMatrix4f.translation(view._from.negate());\n        fin = fin.mult(temp);\n\n        view._at = fin.multMatrixPnt(view._at);\n\n        // rotate around the side vector\n        lv = view._at.subtract(view._from).normalize();\n        sv = lv.cross(view._up).normalize();\n        up = sv.cross(lv).normalize();\n        //view._up = up;\n\n        q = x3dom.fields.Quaternion.axisAngle(sv, theta);\n        temp = q.toMatrix();\n\n        fin = x3dom.fields.SFMatrix4f.translation(view._from);\n        fin = fin.mult(temp);\n\n        temp = x3dom.fields.SFMatrix4f.translation(view._from.negate());\n        fin = fin.mult(temp);\n\n        view._at = fin.multMatrixPnt(view._at);\n\n        // forward along view vector\n        if (navType.substr(0, 5) !== \"looka\")\n        {\n            var currProjMat = view.getProjectionMatrix();\n\n            if (navType !== \"freefly\") {\n                if (step < 0) {\n                    // backwards: negate viewing direction\n                    tmpMat = new x3dom.fields.SFMatrix4f();\n                    tmpMat.setValue(view._last_mat_view.e0(), view._last_mat_view.e1(),\n                                    view._last_mat_view.e2().negate(), view._last_mat_view.e3());\n\n                    view._scene._nameSpace.doc.ctx.pickValue(view, view._width/2, view._height/2,\n                                view._lastButton, tmpMat, currProjMat.mult(tmpMat));\n                }\n                else {\n                    view._scene._nameSpace.doc.ctx.pickValue(view, view._width/2, view._height/2, view._lastButton);\n                }\n                if (view._pickingInfo.pickObj)\n                {\n                    dist = view._pickingInfo.pickPos.subtract(view._from).length();\n\n                    if (dist <= avatarRadius) {\n                        step = 0;\n                    }\n                }\n            }\n\n            lv = view._at.subtract(view._from).normalize().multiply(step);\n\n            view._at = view._at.add(lv);\n            view._from = view._from.add(lv);\n\n            // finally attach to ground when walking\n            if (navType === \"walk\")\n            {\n                // Set the up-vector to Y during walk\n                up.x = 0.0; up.y = 1.0; up.z = 0.0;\n\n                tmpAt = view._from.addScaled(up, -1.0);\n                tmpUp = sv.cross(up.negate()).normalize();  // lv\n\n                tmpMat = x3dom.fields.SFMatrix4f.lookAt(view._from, tmpAt, tmpUp);\n                tmpMat = tmpMat.inverse();\n\n                view._scene._nameSpace.doc.ctx.pickValue(view, view._width/2, view._height/2,\n                            view._lastButton, tmpMat, currProjMat.mult(tmpMat));\n\n                if (view._pickingInfo.pickObj)\n                {\n                    dist = view._pickingInfo.pickPos.subtract(view._from).length();\n                    dist = (avatarHeight - dist) / navi._vf.walkDamping;\n\n                    view._at = view._at.add(up.multiply(dist));\n                    view._from = view._from.add(up.multiply(dist));\n\n                }\n            }\n            view._pickingInfo.pickObj = null;\n        }\n        \n        view._flyMat = x3dom.fields.SFMatrix4f.lookAt(view._from, view._at, up);\n\n        view._scene.getViewpoint().setView(view._flyMat.inverse());\n\n        //Restore picking info if available\n        if( savedPickingInfo !== null ) {\n\n            view._pickingInfo = savedPickingInfo;\n            \n        }\n    }\n\n    return needNavAnim;\n};\n\nx3dom.DefaultNavigation.prototype.animateTo = function(view, target, prev, dur)\n{\n    var navi = this.navi;\n    var prevTargetMat;\n    var prevMat;\n    \n    if (x3dom.isa(target, x3dom.nodeTypes.X3DViewpointNode))\n    {\n        target = target.getViewMatrix().mult(target.getCurrentTransform().inverse());\n    }\n\n    if (navi._vf.transitionType[0].toLowerCase() !== \"teleport\" && dur != 0 && navi.getType() !== \"game\")\n    {\n        if (prev && x3dom.isa(prev, x3dom.nodeTypes.X3DViewpointNode))\n        {\n            prevMat = prev.getViewMatrix().\n                           mult(prev.getCurrentTransform().inverse()).\n                           mult(view._transMat).mult(view._rotMat);\n\n            if(view._mixer.isActive())\n            {\n                prev.setView(view._mixer.getEndMatrix());\n                view._mixer.reset();\n            }\n\n            view._mixer.beginTime = view._lastTS;\n\n            if (arguments.length >= 4 && arguments[3] != null)\n            {\n                view._mixer.endTime = view._lastTS + dur;\n            }\n            else\n            {\n                view._mixer.endTime = view._lastTS + navi._vf.transitionTime;\n            }\n\n            view._mixer.setBeginMatrix (prevMat);\n            view._mixer.setEndMatrix (target);\n            \n            view._scene.getViewpoint().setView(prevMat);\n        }\n        else\n        {\n            view._scene.getViewpoint().setView(target);\n        }\n    }\n    else\n    {\n        view._scene.getViewpoint().setView(target);\n    }\n\n    view._rotMat = x3dom.fields.SFMatrix4f.identity();\n    view._transMat = x3dom.fields.SFMatrix4f.identity();\n    view._movement = new x3dom.fields.SFVec3f(0, 0, 0);\n    view._needNavigationMatrixUpdate = true;\n};\n\nx3dom.DefaultNavigation.prototype.orthoAnimateTo = function( view, target, prev, duration )\n{\n    var navi = this.navi;\n\n    duration = duration || navi._vf.transitionTime;\n\n    view._interpolator.beginValue = prev;\n    view._interpolator.endValue = target;\n\n    view._interpolator.beginTime = view._lastTS;\n    view._interpolator.endTime = view._lastTS + duration;\n};\n\nx3dom.DefaultNavigation.prototype.resetView = function(view)\n{\n    var navi = this.navi;\n\n    if (navi._vf.transitionType[0].toLowerCase() !== \"teleport\" && navi.getType() !== \"game\")\n    {\n\t\tvar viewpoint = view._scene.getViewpoint();\n\t\t\n        view._mixer.beginTime = view._lastTS;\n        view._mixer.endTime = view._lastTS + navi._vf.transitionTime;\n\n        view._mixer.setBeginMatrix(view.getViewMatrix());\n\t\t\n\t\tif (x3dom.isa(viewpoint, x3dom.nodeTypes.OrthoViewpoint))\n\t\t{\n\t\t\tthis.orthoAnimateTo(view, Math.abs(viewpoint._vf.fieldOfView[0]), Math.abs(viewpoint._fieldOfView[0]));\n\t\t}\n\n        var target = view._scene.getViewpoint();\n        target.resetView();\n\n        target = target.getViewMatrix().mult(target.getCurrentTransform().inverse());\n\n        view._mixer.setEndMatrix(target);\n    }\n    else\n    {\n        view._scene.getViewpoint().resetView();\n    }\n\n    view.resetNavHelpers();\n    navi._heliUpdated = false;\n};\n\nx3dom.DefaultNavigation.prototype.onDrag = function(view, x, y, buttonState)\n{\n    var navi = this.navi;\n\n    var navType = navi.getType();\n    var navRestrict = navi.getExplorationMode();\n\n    if (navType === \"none\" || navRestrict == 0) {\n        return;\n    }\n\n    var viewpoint = view._scene.getViewpoint();\n\n    var dx = x - view._lastX;\n    var dy = y - view._lastY;\n\t\n\t\n    view._dx = dx;\n    view._dy = dy;\n\n    view._lastX = x;\n    view._lastY = y;\n    \n    if (navType !== \"examine\") { return; } // reinstate 1.7.1 behaviour\n\t\n    var d, vec, cor, mat = null;\n    var alpha, beta;\n\n    //buttonState = (!navRestrict || (navRestrict != 7 && buttonState == 1)) ? navRestrict : buttonState;\n    buttonState = buttonState & navRestrict;\n    \n    if (buttonState & 1) //left\n    {\n        alpha = (dy * 2 * Math.PI) / view._width;\n        beta = (dx * 2 * Math.PI) / view._height;\n        mat = view.getViewMatrix();\n\n        var mx = x3dom.fields.SFMatrix4f.rotationX(alpha);\n        var my = x3dom.fields.SFMatrix4f.rotationY(beta);\n\n        var center = viewpoint.getCenterOfRotation();\n\n        mat.setTranslate(new x3dom.fields.SFVec3f(0,0,0));\n\n        view._rotMat = view._rotMat.\n                        mult(x3dom.fields.SFMatrix4f.translation(center)).\n                        mult(mat.inverse()).mult(mx).mult(my).mult(mat).\n                        mult(x3dom.fields.SFMatrix4f.translation(center.negate()));\n    }\n    if (buttonState & 4) //middle\n    {\n        d = (view._scene._lastMax.subtract(view._scene._lastMin)).length();\n        d = Math.min(d, viewpoint.getFar()); // use zfar if smaller to allow for large scenes with defined zfar\n        d = ((d < x3dom.fields.Eps) ? 1 : d) * navi._vf.speed;\n\n        vec = new x3dom.fields.SFVec3f(d*dx/view._width, d*(-dy)/view._height, 0);\n        view._movement = view._movement.add(vec);\n\n        mat = view.getViewpointMatrix().mult(view._transMat);\n        //TODO; move real distance along viewing plane\n        view._transMat = mat.inverse().\n                            mult(x3dom.fields.SFMatrix4f.translation(view._movement)).\n                            mult(mat);\n    }\n    if (buttonState & 2) //right\n    {\n        d = (view._scene._lastMax.subtract(view._scene._lastMin)).length();\n        d = Math.min(d, viewpoint.getFar()); // use zfar if smaller to allow for large scenes with defined zfar\n        d = ((d < x3dom.fields.Eps) ? 1 : d) * navi._vf.speed;\n\n        vec = new x3dom.fields.SFVec3f(0, 0, d*(dx+dy)/view._height);\n\n        if (x3dom.isa(viewpoint, x3dom.nodeTypes.OrthoViewpoint))\n        {\n            viewpoint.setZoom( Math.abs( viewpoint._fieldOfView[0] ) - vec.z );\n        }\n        //else\n        {\n            if ( navi._vf.typeParams.length >= 6 ) {\n\n                var min = -navi._vf.typeParams[ 5 ];\n                var max =  navi._vf.typeParams[ 4 ];\n\n                view._movement.z = Math.min( Math.max( view._movement.z, min ), max );\n\n            }\n\n            view._movement = view._movement.add(vec);\n            mat = view.getViewpointMatrix().mult(view._transMat);\n            //TODO; move real distance along viewing ray\n            view._transMat = mat.inverse().\n                                mult(x3dom.fields.SFMatrix4f.translation(view._movement)).\n                                mult(mat);\n        }\n    }\n\n    view._isMoving = true;\n};\n\nx3dom.DefaultNavigation.prototype.onTouchStart = function(view, evt, touches)\n{\n    \n};\n\nx3dom.DefaultNavigation.prototype.onTouchDrag = function(view, evt, touches, translation, rotation)\n{\n    if (view._currentInputType == x3dom.InputTypes.NAVIGATION)\n    {\n        var navi = this.navi;\n        var viewpoint = view._scene.getViewpoint();\n        \n        var navRestrict = navi.getExplorationMode();\n\n        if (navi.getType() === \"examine\" && navRestrict !== 0)\n        {\n            if (translation && navRestrict & 4)\n            {\n                var distance = (view._scene._lastMax.subtract(view._scene._lastMin)).length();\n                distance = Math.min(distance, viewpoint.getFar()); // use zfar if smaller to allow for large scenes with defined zfar\n                distance = ((distance < x3dom.fields.Eps) ? 1 : distance) * navi._vf.speed;\n\n                translation = translation.multiply(distance);\n\n                if (x3dom.isa(viewpoint, x3dom.nodeTypes.OrthoViewpoint))\n                {\n                    viewpoint.setZoom( Math.abs( viewpoint._fieldOfView[0] ) - translation.z );\n\n                    translation.z = 0;\n                }\n                \n                view._movement = view._movement.add(translation);\n\n                view._transMat = viewpoint.getViewMatrix().inverse().\n                    mult(x3dom.fields.SFMatrix4f.translation(view._movement)).\n                    mult(viewpoint.getViewMatrix());\n            }\n\n            if (rotation && navRestrict & 1)\n            {\n                var center = viewpoint.getCenterOfRotation();\n                var mat = view.getViewMatrix();\n                mat.setTranslate(new x3dom.fields.SFVec3f(0,0,0));\n\n                view._rotMat = view._rotMat.\n                               mult(x3dom.fields.SFMatrix4f.translation(center)).\n                               mult(mat.inverse()).mult(rotation).mult(mat).\n                               mult(x3dom.fields.SFMatrix4f.translation(center.negate()));\n            }\n\n            view._isMoving = true;\n        }\n    }\n};\n\nx3dom.DefaultNavigation.prototype.onTouchEnd = function(evt, touches)\n{\n    \n};\n\nx3dom.DefaultNavigation.prototype.onDoubleClick = function (view, x, y)\n{\n    if (view._doc._x3dElem.hasAttribute('disableDoubleClick') &&\n        view._doc._x3dElem.getAttribute('disableDoubleClick') === 'true') {\n        return;\n    }\n    \n    var navi = view._scene.getNavigationInfo();\n    \n    if (navi.getType() == \"none\") {\n        return;\n    }\n\n    var pickMode = view._scene._vf.pickMode.toLowerCase();\n\n    if ((pickMode == \"color\" || pickMode == \"texcoord\")) {\n         return;\n    }\n\n    var viewpoint = view._scene.getViewpoint();\n\n    viewpoint.setCenterOfRotation(view._pick);\n    x3dom.debug.logInfo(\"New center of Rotation:  \" + view._pick);\n\n    var mat = view.getViewMatrix().inverse();\n\n    var from = mat.e3();\n    var at = view._pick;\n    var up = mat.e1();\n\n    var norm = mat.e0().cross(up).normalize();\n    // get distance between look-at point and viewing plane\n    var dist = norm.dot(view._pick.subtract(from));\n    \n    from = at.addScaled(norm, -dist);\n    mat = x3dom.fields.SFMatrix4f.lookAt(from, at, up);\n    \n    x3dom.debug.logInfo(\"New camera position:  \" + from);\n    view.animateTo(mat.inverse(), viewpoint);\n};\n\n\nx3dom.TurntableNavigation = function(navigationNode)\n{\n    x3dom.DefaultNavigation.call(this, navigationNode);\n\n    this.panAxisX = null;\n    this.panAxisY = null;\n\n    this.panEnabled = true;\n};\n\nx3dom.TurntableNavigation.prototype = Object.create(x3dom.DefaultNavigation.prototype);\nx3dom.TurntableNavigation.prototype.constructor = x3dom.TurntableNavigation;\n\nx3dom.TurntableNavigation.prototype.onDrag = function(view, x, y, buttonState)\n{\n    var navi = this.navi;\n    \n    if (!view._flyMat)\n        this.initTurnTable(view, false);\n    \n    var navType = navi.getType();       \n    var navRestrict = navi.getExplorationMode();\n\n    if (navType === \"none\" || navRestrict == 0) {\n        return;\n    }    \n\n    var dx = x - view._lastX;\n    var dy = y - view._lastY;\n    \n    var d = null;\n    var alpha, beta;\n\n    buttonState = (!navRestrict || (navRestrict != 7 && buttonState == 1)) ? navRestrict : buttonState;\n    \n    if (buttonState & 1) //left\n    {\n        alpha = (dy * 2 * Math.PI) / view._height;\n        beta = (dx * 2 * Math.PI) / view._width;\n        \n        this.rotate(view, alpha, beta);\n    }\n    else if (buttonState & 2) //right\n    {\n        d = (view._scene._lastMax.subtract(view._scene._lastMin)).length();\n        d = ((d < x3dom.fields.Eps) ? 1 : d) * navi._vf.speed;\n\n        var zoomAmount = d * (dx + dy) / view._height;\n\n        this.zoom(view, zoomAmount);        \n    }\n    else if ((buttonState & 4) && this.panEnabled == true) //middle\n    {\n        \n        d = (view._scene._lastMax.subtract(view._scene._lastMin)).length();\n        d = ((d < x3dom.fields.Eps) ? 1 : d) * navi._vf.speed * 0.75;\n\n        var tx = -d * dx / view._width;\n        var ty =  d * dy / view._height;\n\n        this.pan(view, tx, ty);\n    }\n\n    view._isMoving = true;\n    \n    view._dx = dx;\n    view._dy = dy;\n\n    view._lastX = x;\n    view._lastY = y;\n};\n\nx3dom.TurntableNavigation.prototype.pan = function(view, tx, ty)\n{\n    var viewpoint = view._scene.getViewpoint();\n\n    if(this.target != null) {\n        var target = this.target;\n        var bbox = target._x3domNode.getVolume();\n\n        view._up = view._flyMat.e1();\n        view._from = view._flyMat.e3(); // eye\n\n        // add xy offset to look-at position  ^\n        var cor = view._at;\n\n        cor = cor.addScaled(this.panAxisY, ty);\n        var temp = cor;\n        if (cor.y > bbox.max.y || cor.y < bbox.min.y)\n            temp = view._at;\n        else\n            view._from = view._from.addScaled(this.panAxisY, ty);\n\n\n        cor = temp.addScaled(this.panAxisX, tx);\n        if (cor.x > bbox.max.x || cor.x < bbox.min.x)\n            cor = temp;\n        else\n            view._from = view._from.addScaled(this.panAxisX, tx);\n\n        view._at = cor;\n\n        // update camera matrix with lookAt() and invert\n        view._flyMat = x3dom.fields.SFMatrix4f.lookAt(view._from, cor, view._up);\n        viewpoint.setViewAbsolute(view._flyMat.inverse());\n\n    } else if(this.panAxisX != null && this.panAxisY != null) {\n\n        view._up = view._flyMat.e1();\n        view._from = view._flyMat.e3(); // eye\n\n        // add xy offset to look-at position  ^\n        var cor = view._at;\n\n        cor = cor.addScaled(this.panAxisY, ty);\n        var temp = cor;\n        view._from = view._from.addScaled(this.panAxisY, ty);\n\n        cor = temp.addScaled(this.panAxisX, tx);\n        view._from = view._from.addScaled(this.panAxisX, tx);\n\n        view._at = cor;\n\n        // update camera matrix with lookAt() and invert\n        view._flyMat = x3dom.fields.SFMatrix4f.lookAt(view._from, cor, view._up);\n        viewpoint.setViewAbsolute(view._flyMat.inverse());\n    }else{\n\n\n        view._up = view._flyMat.e1();\n        view._from = view._flyMat.e3(); // eye\n\n        var xAxis = view._up.cross(view._from).normalize();\n        var yAxis = view._from.cross(xAxis).normalize();\n\n        // add xy offset to look-at position  ^\n        var cor = view._at;\n\n        cor = cor.addScaled(yAxis, ty);\n        var temp = cor;\n        view._from = view._from.addScaled(yAxis, ty);\n\n        cor = temp.addScaled(xAxis, tx);\n        view._from = view._from.addScaled(xAxis, tx);\n\n        view._at = cor;\n\n        // update camera matrix with lookAt() and invert\n        view._flyMat = x3dom.fields.SFMatrix4f.lookAt(view._from, cor, view._up);\n        viewpoint.setViewAbsolute(view._flyMat.inverse());\n    }\n\n};\n\nx3dom.TurntableNavigation.prototype.rotate = function(view, alpha, beta)\n{\n    var viewpoint = view._scene.getViewpoint();\n    \n    view._flyMat = this.calcOrbit(view, alpha, beta);\n    viewpoint.setView(view._flyMat.inverse());\n};\n\nx3dom.TurntableNavigation.prototype.zoom = function(view, zoomAmount)\n{\n    var navi = this.navi;\n    var viewpoint = view._scene.getViewpoint();\n    \n    view._up   = view._flyMat.e1();\n    view._from = view._flyMat.e3(); // eye\n\n    // zoom in/out\n    var cor = view._at;\n\n    var lastDir  = cor.subtract(view._from);\n    var lastDirL = lastDir.length();\n    lastDir = lastDir.normalize();\n\n    var newDist = zoomAmount;\n    if(navi._vf.typeParams[6])\n        newDist = Math.min(zoomAmount, lastDirL - navi._vf.typeParams[6]);\n    if(navi._vf.typeParams[7])\n        newDist = Math.max(newDist, lastDirL - navi._vf.typeParams[7]);\n\n    // move along viewing ray, scaled with zoom factor\n    view._from = view._from.addScaled(lastDir, newDist);\n\n    // move along viewing ray, scaled with zoom factor\n    //view._from = view._from.addScaled(lastDir, zoomAmount);\n\n    // update camera matrix with lookAt() and invert again\n    view._flyMat = x3dom.fields.SFMatrix4f.lookAt(view._from, cor, view._up);\n    viewpoint.setViewAbsolute(view._flyMat.inverse());\n};\n\nx3dom.TurntableNavigation.prototype.calcOrbit = function (view, alpha, beta, absolute)\n{\n    var navi = this.navi;\n    \n    view._up   = view._flyMat.e1();\n    view._from = view._flyMat.e3();\n\n    var offset = view._from.subtract(view._at);\n\n    var phi;\n    var theta;\n    if(absolute == true){\n        phi = beta;\n        theta = alpha;\n    }else{\n        // angle in xz-plane\n        phi = Math.atan2(offset.x, offset.z);\n\n        // angle from y-axis\n        theta = Math.atan2(Math.sqrt(offset.x * offset.x + offset.z * offset.z), offset.y);\n\n        phi -= beta;\n        theta -= alpha;\n    }\n\n    // clamp theta\n    theta = Math.max(navi._vf.typeParams[2], Math.min(navi._vf.typeParams[3], theta));\n    \n    if(navi._vf.typeParams[4] <= navi._vf.typeParams[5])\n        phi = Math.max(navi._vf.typeParams[4], Math.min(navi._vf.typeParams[5], phi));\n    else{\n        if(beta > 0 && phi < navi._vf.typeParams[4] && phi > navi._vf.typeParams[5]) phi = navi._vf.typeParams[4];\n        else if(beta < 0 && phi > navi._vf.typeParams[5] && phi < navi._vf.typeParams[4]) phi = navi._vf.typeParams[5];     \n   }\n        \n\n    var radius = offset.length();\n\n    // calc new cam position\n    var rSinPhi = radius * Math.sin(theta);\n\n    offset.x = rSinPhi * Math.sin(phi);\n    offset.y = radius  * Math.cos(theta);\n    offset.z = rSinPhi * Math.cos(phi);\n\n    offset = view._at.add(offset);\n\n    // calc new up vector\n    theta -= Math.PI / 2;\n\n    var sinPhi = Math.sin(theta);\n    var cosPhi = Math.cos(theta);\n    var up = new x3dom.fields.SFVec3f(sinPhi * Math.sin(phi), cosPhi, sinPhi * Math.cos(phi));\n\n    if (up.y < 0)\n        up = up.negate();\n\n    return x3dom.fields.SFMatrix4f.lookAt(offset, view._at, up);\n};\n\nx3dom.TurntableNavigation.prototype.initTurnTable = function(view, flyTo)\n{\n    var navi = this.navi;\n    \n    flyTo = (flyTo == undefined) ? true : flyTo;\n\n    var currViewMat = view.getViewMatrix();\n    view._rotMat = x3dom.fields.SFMatrix4f.identity();\n    view._transMat = x3dom.fields.SFMatrix4f.identity();\n\n    var viewpoint = view._scene.getViewpoint();\n    var center = x3dom.fields.SFVec3f.copy(viewpoint.getCenterOfRotation());\n\n    view._flyMat = currViewMat.inverse();\n\n    view._from = viewpoint._vf.position;\n    view._at = center;\n    view._up = new x3dom.fields.SFVec3f(0,1,0);\n\n    view._flyMat = x3dom.fields.SFMatrix4f.lookAt(view._from, view._at, view._up);\n\n    var _from = currViewMat.inverse().e3();\n\n    var offset = _from.subtract(view._at);\n    var phi = Math.atan2(offset.x, offset.z);\n    // angle from y-axis\n    var theta = Math.atan2(Math.sqrt(offset.x * offset.x + offset.z * offset.z), offset.y);\n\n    view._flyMat = this.calcOrbit(view, theta, phi, true);\n\n    var dur = 0.0;\n\n    if (flyTo) {\n        dur = 0.2 / navi._vf.speed;   // fly to pivot point\n        this.animateTo(view, view._flyMat.inverse(), currViewMat, dur);\n    }\n\n    view.resetNavHelpers();\n};\n\nx3dom.TurntableNavigation.prototype.onMousePress = function(view,x, y, buttonState)\n{\n    if (!view._flyMat)\n        this.initTurnTable(view, false);\n};\n\nx3dom.TurntableNavigation.prototype.init = function(view, flyTo)\n{\n    this.initTurnTable(view, true);\n};\n\nx3dom.TurntableNavigation.prototype.resetView = function(view)\n{\n    view._mixer.beginTime = view._lastTS;\n    view._mixer.endTime = view._lastTS + this.navi._vf.transitionTime;\n\n    view._mixer.setBeginMatrix(view.getViewMatrix());\n\n    var target = view._scene.getViewpoint();\n    target.resetView();\n    \n    target = x3dom.fields.SFMatrix4f.lookAt(target._vf.position, target.getCenterOfRotation(), new x3dom.fields.SFVec3f(0,1,0));\n\n    view._mixer.setEndMatrix(target.inverse());\n    \n    this.updateFlyMat(view);\n};\n\nx3dom.TurntableNavigation.prototype.updateFlyMat = function(view, nextViewpoint, overrideMat)\n{\n    if (!view._flyMat)\n        this.initTurnTable(view, false);\n    \n    var currViewMat = view.getViewMatrix();\n    \n    var viewpoint = nextViewpoint;\n    if(viewpoint == null || !x3dom.isa(viewpoint,x3dom.nodeTypes.X3DViewpointNode))\n        viewpoint = view._scene.getViewpoint();\n    var center = x3dom.fields.SFVec3f.copy(viewpoint.getCenterOfRotation());\n\n    view._flyMat = currViewMat.inverse();\n\n    if(overrideMat)\n        view._from = overrideMat.inverse().e3();\n    else\n        view._from = viewpoint._vf.position;\n\n    view._at = center;\n    view._up = new x3dom.fields.SFVec3f(0,1,0);\n    \n    view._flyMat = x3dom.fields.SFMatrix4f.lookAt(view._from, view._at, view._up);\n\n    var _from = currViewMat.inverse().e3();\n\n    var offset = _from.subtract(view._at);\n    var phi = Math.atan2(offset.x, offset.z);\n    // angle from y-axis\n    var theta = Math.atan2(Math.sqrt(offset.x * offset.x + offset.z * offset.z), offset.y);\n\n    view._flyMat = this.calcOrbit(view, theta, phi, true);\n};\n\nx3dom.TurntableNavigation.prototype.animateTo = function(view, target, prev, dur)\n{\n    var navi = this.navi;\n    var targetMat;\n    \n    if (x3dom.isa(target, x3dom.nodeTypes.X3DViewpointNode)) {\n        targetMat = x3dom.fields.SFMatrix4f.lookAt(target._vf.position, target.getCenterOfRotation(), new x3dom.fields.SFVec3f(0,1,0));        \n    }else\n        targetMat = target;\n\n    if (navi._vf.transitionType[0].toLowerCase() !== \"teleport\" && dur != 0 && navi.getType() !== \"game\")\n    {\n        if (prev && x3dom.isa(prev, x3dom.nodeTypes.X3DViewpointNode)) {\n            prev = prev.getViewMatrix().mult(prev.getCurrentTransform().inverse()).\n                         mult(view._transMat).mult(view._rotMat);\n\n            view._mixer.beginTime = view._lastTS;\n\n            if (arguments.length >= 4 && arguments[3] != null) {\n                // for lookAt to assure travel speed of 1 m/s\n                view._mixer.endTime = view._lastTS + dur;\n            }\n            else {\n                view._mixer.endTime = view._lastTS + navi._vf.transitionTime;\n            }\n\n            view._mixer.setBeginMatrix (prev);\n            view._mixer.setEndMatrix (targetMat);\n            \n            view._scene.getViewpoint().setViewAbsolute(prev);\n        }\n        else if(prev){\n            view._mixer.beginTime = view._lastTS;\n\n            if (arguments.length >= 4 && arguments[3] != null) {\n                // for lookAt to assure travel speed of 1 m/s\n                view._mixer.endTime = view._lastTS + dur;\n            }\n            else {\n                view._mixer.endTime = view._lastTS + navi._vf.transitionTime;\n            }\n\n            view._mixer.setBeginMatrix (prev);\n            view._mixer.setEndMatrix (targetMat);\n\n            view._scene.getViewpoint().setViewAbsolute(prev);\n        }else{\n            view._scene.getViewpoint().setViewAbsolute(targetMat);\n        }\n    }\n    else\n    {\n        view._scene.getViewpoint().setViewAbsolute(target);\n    }\n\n    view._rotMat = x3dom.fields.SFMatrix4f.identity();\n    view._transMat = x3dom.fields.SFMatrix4f.identity();\n    view._movement = new x3dom.fields.SFVec3f(0, 0, 0);\n    view._needNavigationMatrixUpdate = true;\n    \n    this.updateFlyMat(view, target, targetMat);\n};\n\nx3dom.TurntableNavigation.prototype.onTouchStart = function(view, evt, touches)\n{\n    view._numTouches = evt.touches.length;\n    \n    view._lastX = evt.touches[0].screenX;\n    view._lastY = evt.touches[0].screenY;\n\n};\n\nx3dom.TurntableNavigation.prototype.onTouchDrag = function(view, evt, touches, translation, rotation)\n{\n    if (view._currentInputType == x3dom.InputTypes.NAVIGATION)\n    {\n        if(evt.touches.length == 1)\n        {\n            var dx = (evt.touches[0].screenX - view._lastX);\n            var dy = (evt.touches[0].screenY - view._lastY);\n            \n            var alpha = (dy * 2 * Math.PI) / view._height;\n            var beta = (dx * 2 * Math.PI) / view._width;\n        \n            this.rotate(view, alpha, beta);\n        \n            view._lastX = evt.touches[0].screenX;\n            view._lastY = evt.touches[0].screenY;            \n        }\n        else if(evt.touches.length >= 2)\n        {\n            if(this.panEnabled == true)\n                this.pan(view, -translation.x * 4.0, -translation.y * 4.0);\n            \n            this.zoom(view, translation.z * 4.0);\n        }\n    }\n};\n\nx3dom.TurntableNavigation.prototype.onTouchEnd = function(view, evt, touches)\n{\n\n\n    if (view._numTouches == 2 && evt.touches.length == 1){\n        view._lastX = evt.touches[0].screenX;\n        view._lastY = evt.touches[0].screenY;\n    }\n    \n    view._numTouches = evt.touches.length;\n};\n\nx3dom.TurntableNavigation.prototype.setPanTarget = function(target)\n{\n    this.target = target;\n};\n\nx3dom.TurntableNavigation.prototype.setPanAxis = function(a, b)\n{\n    this.panAxisX = a;\n    this.panAxisY = b;\n};\n\nx3dom.TurntableNavigation.prototype.setPanEnabled = function(enabled)\n{\n    this.panEnabled = enabled;\n};\n\nx3dom.TurntableNavigation.prototype.onDoubleClick = function (view, x, y)\n{\n    if (view._doc._x3dElem.hasAttribute('disableDoubleClick') &&\n        view._doc._x3dElem.getAttribute('disableDoubleClick') === 'true') {\n        return;\n    }\n\n    var navi = view._scene.getNavigationInfo();\n\n    if (navi.getType() == \"none\") {\n        return;\n    }\n\n    var pickMode = view._scene._vf.pickMode.toLowerCase();\n\n    if ((pickMode == \"color\" || pickMode == \"texcoord\")) {\n        return;\n    }\n\n    var viewpoint = view._scene.getViewpoint();\n\n    viewpoint.setCenterOfRotation(view._pick);\n    x3dom.debug.logInfo(\"New center of Rotation:  \" + view._pick);\n\n    var mat = view.getViewMatrix().inverse();\n\n    view._from = mat.e3();\n    view._up = mat.e1();\n\n    view._at = view._pick;\n\n    view._flyMat = x3dom.fields.SFMatrix4f.lookAt(view._from, view._at, view._up);\n\n    var offset = view._from.subtract(view._at);\n    var phi = Math.atan2(offset.x, offset.z);\n    // angle from y-axis\n    var theta = Math.atan2(Math.sqrt(offset.x * offset.x + offset.z * offset.z), offset.y);\n\n    view._flyMat = this.calcOrbit(view, theta, phi, true);\n\n    x3dom.debug.logInfo(\"New camera position:  \" + view._from);\n    this.animateTo(view, view._flyMat.inverse(), view.getViewMatrix());\n};\n\n/** @namespace x3dom */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C) 2017 Andreas Plesch\n * Dual licensed under the MIT and GPL\n */\n\n/* ### WalkNavigation ### */\n\n// use DefaultNavigation\nx3dom.WalkNavigation = function(navigationNode)\n{\n    x3dom.DefaultNavigation.call(this, navigationNode);\n};\n\nx3dom.WalkNavigation.prototype = Object.create(x3dom.DefaultNavigation.prototype);\nx3dom.WalkNavigation.prototype.constructor = x3dom.WalkNavigation; // necessary ?\n\n// redefine onDrag\nx3dom.WalkNavigation.prototype.onDrag = function(view, x, y, buttonState)\n{\n    var navi = this.navi;\n\n    var navType = navi.getType();\n    var navRestrict = navi.getExplorationMode(); // may not apply to walk mode ?\n\n    if (navRestrict === 0) {\n        return;\n    }\n\n    var viewpoint = view._scene.getViewpoint();\n\n    var dx = x - view._lastX;\n    var dy = y - view._lastY;\n    \n    //view._isMoving = true; // only for turntable,examine?\n\n    view._dx = dx;\n    view._dy = dy;\n\n    view._lastX = x;\n    view._lastY = y;\n    // double check, probably not necessary\n    if (navType === \"walk\") {return;}\n    console.log(\"#### CHECK: in WalkNavigation but nav. type is not walk !\");\n};\n\n// other event handlers from DefaultNavigation could also be simplified\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### X3DFontStyleNode ### */\nx3dom.registerNodeType(\n    \"X3DFontStyleNode\",\n    \"Text\",\n    defineClass(x3dom.nodeTypes.X3DNode,\n        \n        /**\n         * Constructor for X3DFontStyleNode\n         * @constructs x3dom.nodeTypes.X3DFontStyleNode\n         * @x3d 3.3\n         * @component Text\n         * @status full\n         * @extends x3dom.nodeTypes.X3DNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc This abstract node type is the base node type for all font style nodes.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DFontStyleNode.superClass.call(this, ctx);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### FontStyle ### */\nx3dom.registerNodeType(\n    \"FontStyle\",\n    \"Text\",\n    defineClass(x3dom.nodeTypes.X3DFontStyleNode,\n        \n        /**\n         * Constructor for FontStyle\n         * @constructs x3dom.nodeTypes.FontStyle\n         * @x3d 3.3\n         * @component Text\n         * @status full\n         * @extends x3dom.nodeTypes.X3DFontStyleNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The FontStyle node defines the size, family, and style used for Text nodes, as well as the direction of the text strings and any language-specific rendering techniques used for non-English text.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.FontStyle.superClass.call(this, ctx);\n\n\n            /**\n             * Defines the text family.\n             * @var {x3dom.fields.MFString} family\n             * @memberof x3dom.nodeTypes.FontStyle\n             * @initvalue ['SERIF']\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFString(ctx, 'family', ['SERIF']);\n\n            /**\n             * Specifies whether the text is shown horizontally or vertically.\n             * @var {x3dom.fields.SFBool} horizontal\n             * @memberof x3dom.nodeTypes.FontStyle\n             * @initvalue true\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'horizontal', true);\n\n            /**\n             * Specifies where the text is anchored. The default of [\"MIDDLE\", \"MIDDLE\"] deviates from the ISO spec. default\n             * of [\"BEGIN\", \"FIRST\"] for backward compatibiliy reasons. \n             * @var {x3dom.fields.MFString} justify\n             * @range [\"BEGIN\",\"END\",\"FIRST\",\"MIDDLE\",\"\"]\n             * @memberof x3dom.nodeTypes.FontStyle\n             * @initvalue ['MIDDLE', 'MIDDLE']\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFString(ctx, 'justify', ['MIDDLE', 'MIDDLE']);\n\n            /**\n             * The language field specifies the context of the language for the text string in the form of a language and a country in which that language is used.\n             * @var {x3dom.fields.SFString} language\n             * @memberof x3dom.nodeTypes.FontStyle\n             * @initvalue \"\"\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFString(ctx, 'language', \"\");\n\n            /**\n             * Specifies whether the text is shown from left to right or from right to left.\n             * @var {x3dom.fields.SFBool} leftToRight\n             * @memberof x3dom.nodeTypes.FontStyle\n             * @initvalue true\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'leftToRight', true);\n\n            /**\n             * Sets the size of the text.\n             * @var {x3dom.fields.SFFloat} size\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.FontStyle\n             * @initvalue 1.0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'size', 1.0);\n\n            /**\n             * Sets the spacing between lines of text, relative to the text size.\n             * @var {x3dom.fields.SFFloat} spacing\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.FontStyle\n             * @initvalue 1.0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'spacing', 1.0);\n\n            /**\n             * Sets the text style.\n             * @var {x3dom.fields.SFString} style\n             * @range [\"PLAIN\",\"BOLD\",\"ITALIC\",\"BOLDITALIC\",\"\"]\n             * @memberof x3dom.nodeTypes.FontStyle\n             * @initvalue \"PLAIN\"\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFString(ctx, 'style', \"PLAIN\");\n\n            /**\n             * Specifies whether the text flows from top to bottom or from bottom to top.\n             * @var {x3dom.fields.SFBool} topToBottom\n             * @memberof x3dom.nodeTypes.FontStyle\n             * @initvalue true\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'topToBottom', true);\n            \n            /**\n             * Sets the quality of the text rendering as an oversampling factor.\n             * @var {x3dom.fields.SFFloat} quality\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.FontStyle\n             * @initvalue 2.0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'quality', 2.0);\n\n        \n        },\n        {\n            fieldChanged: function(fieldName) {\n                if (fieldName == 'family' || fieldName == 'horizontal' || fieldName == 'justify' ||\n                    fieldName == 'language' || fieldName == 'leftToRight' || fieldName == 'size' ||\n                    fieldName == 'spacing' || fieldName == 'style' || fieldName == 'topToBottom') {\n                    Array.forEach(this._parentNodes, function (node) {\n                        Array.forEach(node._parentNodes, function (textnode) {\n                            textnode.setAllDirty();\n                        });\n                    });\n                }\n            }\n        }\n    )\n);\n\nx3dom.nodeTypes.FontStyle.defaultNode = function() {\n    if (!x3dom.nodeTypes.FontStyle._defaultNode) {\n        x3dom.nodeTypes.FontStyle._defaultNode = new x3dom.nodeTypes.FontStyle();\n        x3dom.nodeTypes.FontStyle._defaultNode.nodeChanged();\n    }\n    return x3dom.nodeTypes.FontStyle._defaultNode;\n};\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### Text ### */\nx3dom.registerNodeType(\n    \"Text\",\n    \"Text\",\n    defineClass(x3dom.nodeTypes.X3DGeometryNode,\n        \n        /**\n         * Constructor for Text\n         * @constructs x3dom.nodeTypes.Text\n         * @x3d 3.3\n         * @component Text\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The Text node specifies a two-sided, flat text string object positioned in the Z=0 plane of the local coordinate system based on values defined in the fontStyle field.\n         * Text nodes may contain multiple text strings specified using the UTF-8 encoding.\n         * The text strings are stored in the order in which the text mode characters are to be produced as defined by the parameters in the FontStyle node.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Text.superClass.call(this, ctx);\n\n\n            /**\n             * The text strings are contained in the string field.\n             * @var {x3dom.fields.MFString} string\n             * @memberof x3dom.nodeTypes.Text\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFString(ctx, 'string', []);\n\n            /**\n             * The length field contains an MFFloat value that specifies the length of each text string in the local coordinate system.\n             * The length of each line of type is measured horizontally for horizontal text (FontStyle node: horizontal=TRUE) and vertically for vertical text (FontStyle node: horizontal=FALSE).\n             * @var {x3dom.fields.MFFloat} length\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.Text\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFFloat(ctx, 'length', []);\n\n            /**\n             * The maxExtent field limits and compresses all of the text strings if the length of the maximum string is longer than the maximum extent, as measured in the local coordinate system. If the text string with the maximum length is shorter than the maxExtent, then there is no compressing.\n             * The maximum extent is measured horizontally for horizontal text (FontStyle node: horizontal=TRUE) and vertically for vertical text (FontStyle node: horizontal=FALSE).\n             * @var {x3dom.fields.SFFloat} maxExtent\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.Text\n             * @initvalue 0.0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'maxExtent', 0.0);\n\n            /**\n             * The fontStyle field contains one FontStyle node that specifies the font size, font family and style, direction of the text strings, and any specific language rendering techniques used for the text.\n             * @var {x3dom.fields.SFNode} fontStyle\n             * @memberof x3dom.nodeTypes.Text\n             * @initvalue x3dom.nodeTypes.X3DFontStyleNode\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFNode ('fontStyle', x3dom.nodeTypes.X3DFontStyleNode);\n\n            this._mesh._positions[0] = [0,0,0, 1,0,0, 1,1,0, 0,1,0];\n            this._mesh._normals[0]   = [0,0,1, 0,0,1, 0,0,1, 0,0,1];\n            this._mesh._texCoords[0] = [0,0, 1,0, 1,1, 0,1];\n            this._mesh._colors[0] \t = [];\n            this._mesh._indices[0] \t = [0,1,2, 2,3,0];\n            this._mesh._invalidate \t = true;\n            this._mesh._numFaces \t = 2;\n            this._mesh._numCoords \t = 4;\n        \n        },\n        {\n            nodeChanged: function() {\n                if (!this._cf.fontStyle.node) {\n                    this.addChild(x3dom.nodeTypes.FontStyle.defaultNode());\n                }\n                this.invalidateVolume();\n            },\n\n            fieldChanged: function(fieldName) {\n                if (fieldName == 'string' || fieldName == 'length' || fieldName == 'maxExtent') {\n                    this.invalidateVolume();\n                    Array.forEach(this._parentNodes, function (node) {\n                        node.setAllDirty();\n                    });\n                }\n            },\n            \n            validateGLObject: function ()\n            {\n                Array.forEach(this._parentNodes, function (node) {\n                    node._dirty.texture = false;\n                });\n\n                this._nameSpace.doc.needRender = true;\n            }\n        }\n    ) // defineClass\n); // registerNodeType\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### X3DSoundNode ### */\nx3dom.registerNodeType(\n    \"X3DSoundNode\",\n    \"Sound\",\n    defineClass(x3dom.nodeTypes.X3DChildNode,\n        \n        /**\n         * Constructor for X3DSoundNode\n         * @constructs x3dom.nodeTypes.X3DSoundNode\n         * @x3d 3.3\n         * @component Sound\n         * @status full\n         * @extends x3dom.nodeTypes.X3DChildNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @CLASSDESC This abstract node type is the base for all sound nodes.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DSoundNode.superClass.call(this, ctx);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### Sound ### */\nx3dom.registerNodeType(\n    \"Sound\",\n    \"Sound\",\n    defineClass(x3dom.nodeTypes.X3DSoundNode,\n        \n        /**\n         * Constructor for Sound\n         * @constructs x3dom.nodeTypes.Sound\n         * @x3d 3.3\n         * @component Sound\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DSoundNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The Sound node specifies the spatial presentation of a sound in a X3D scene.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Sound.superClass.call(this, ctx);\n\n\n            /**\n             * The source field specifies the sound source for the Sound node. If the source field is not specified, the Sound node will not emit audio.\n             * The source field shall specify either an AudioClip node or a MovieTexture node.\n             * If a MovieTexture node is specified as the sound source, the MovieTexture shall refer to a movie format that supports sound.\n             * @var {x3dom.fields.SFNode} source\n             * @memberof x3dom.nodeTypes.Sound\n             * @initvalue x3dom.nodeTypes.X3DSoundSourceNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('source', x3dom.nodeTypes.X3DSoundSourceNode);\n        \n        },\n        {\n            nodeChanged: function()\n            {\n                if (this._cf.source.node || !this._xmlNode) {\n                    return;\n                }\n\n                x3dom.debug.logInfo(\"No AudioClip child node given, searching for &lt;audio&gt; elements...\");\n                /** USAGE e.g.:\n                 <sound>\n                 <audio src='sound/spita.wav' loop='loop'></audio>\n                 </sound>\n                 */\n                try {\n                    Array.forEach( this._xmlNode.childNodes, function (childDomNode) {\n                        if (childDomNode.nodeType === 1)\n                        {\n                            // For testing: look for <audio> element if no child\n                            x3dom.debug.logInfo(\"### Found &lt;\"+childDomNode.nodeName+\"&gt; tag.\");\n\n                            if (childDomNode.localName.toLowerCase() === \"audio\")\n                            {\n                                var loop = childDomNode.getAttribute(\"loop\");\n                                loop = loop ? (loop.toLowerCase() === \"loop\") : false;\n\n                                // TODO; check if crash still exists and clean-up code\n                                // work around strange crash in Chrome\n                                // by creating new audio element here\n\n                                /*\n                                 var src = childDomNode.getAttribute(\"src\");\n                                 var newNode = document.createElement('audio');\n                                 newNode.setAttribute('autobuffer', 'true');\n                                 newNode.setAttribute('src', src);\n                                 */\n                                var newNode = childDomNode.cloneNode(false);\n\n                                childDomNode.parentNode.removeChild(childDomNode);\n                                childDomNode = null;\n\n                                if(navigator.appName != \"Microsoft Internet Explorer\") {\n                                    document.body.appendChild(newNode);\n                                }\n\n                                var startAudio = function() {\n                                    newNode.play();\n                                };\n\n                                var audioDone = function() {\n                                    if (loop) {\n                                        newNode.play();\n                                    }\n                                };\n\n                                newNode.addEventListener(\"canplaythrough\", startAudio, true);\n                                newNode.addEventListener(\"ended\", audioDone, true);\n                            }\n                        }\n                    } );\n                }\n                catch(e) {\n                    x3dom.debug.logException(e);\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### X3DSoundSourceNode ### */\nx3dom.registerNodeType(\n    \"X3DSoundSourceNode\",\n    \"Sound\",\n    defineClass(x3dom.nodeTypes.X3DTimeDependentNode,\n        \n        /**\n         * Constructor for X3DSoundSourceNode\n         * @constructs x3dom.nodeTypes.X3DSoundSourceNode\n         * @x3d 3.3\n         * @component Sound\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DTimeDependentNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc This abstract node type is used to derive node types that can emit audio data.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DSoundSourceNode.superClass.call(this, ctx);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### AudioClip ### */\nx3dom.registerNodeType(\n    \"AudioClip\",\n    \"Sound\",\n    defineClass(x3dom.nodeTypes.X3DSoundSourceNode,\n        \n        /**\n         * Constructor for AudioClip\n         * @constructs x3dom.nodeTypes.AudioClip\n         * @x3d 3.3\n         * @component Sound\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DSoundSourceNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc An AudioClip node specifies audio data that can be referenced by Sound nodes.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.AudioClip.superClass.call(this, ctx);\n\n\n            /**\n             * The url field specifies the URL from which the sound is loaded.\n             * @var {x3dom.fields.MFString} url\n             * @memberof x3dom.nodeTypes.AudioClip\n             * @initvalue []\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFString(ctx, 'url', []);\n\n            /**\n             * Specifies whether the clip is enabled.\n             * @var {x3dom.fields.SFBool} enabled\n             * @memberof x3dom.nodeTypes.AudioClip\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'enabled', false);\n\n            /**\n             * Specifies whether the clip loops when finished.\n             * @var {x3dom.fields.SFBool} loop\n             * @memberof x3dom.nodeTypes.AudioClip\n             * @initvalue false\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'loop', false);\n\n            this._audio = document.createElement('audio');\n            //this._audio.setAttribute('preload', 'none');\n            //this._audio.setAttribute('autoplay', 'true');\n            if(navigator.appName != \"Microsoft Internet Explorer\") {\n                document.body.appendChild(this._audio);\n            }\n\n            this._sources = [];\n\n        },\n        {\n            nodeChanged: function()\n            {\n                this._createSources = function()\n                {\n                    this._sources = [];\n                    for (var i=0; i<this._vf.url.length; i++)\n                    {\n                        var audioUrl = this._nameSpace.getURL(this._vf.url[i]);\n                        x3dom.debug.logInfo('Adding sound file: ' + audioUrl);\n                        var src = document.createElement('source');\n                        src.setAttribute('src', audioUrl);\n                        this._sources.push(src);\n                        this._audio.appendChild(src);\n                    }\n                };\n\n                var that = this;\n\n                this._startAudio = function()\n                {\n                    that._audio.loop = that._vf.loop ? \"loop\" : \"\";\n                    if(that._vf.enabled === true)\n                    {\n                        that._audio.play();\n                    }\n                };\n\n                this._stopAudio = function()\n                {\n                    that._audio.pause();\n                };\n\n                this._audioEnded = function()\n                {\n                    if (that._vf.enabled === true && that._vf.loop === true)\n                    {\n                        that._startAudio();\n                    }\n                };\n\n                var log = function(e)\n                {\n                    x3dom.debug.logWarning(\"MediaEvent error:\"+e);\n                };\n\n                this._audio.addEventListener(\"canplaythrough\", this._startAudio, true);\n                this._audio.addEventListener(\"ended\", this._audioEnded, true);\n                this._audio.addEventListener(\"error\", log, true);\n                this._audio.addEventListener(\"pause\", this._audioEnded, true);\n\n                this._createSources();\n            },\n\n            fieldChanged: function(fieldName)\n            {\n                if (fieldName === \"enabled\")\n                {\n                    if (this._vf.enabled === true)\n                    {\n                        this._startAudio();\n                    }\n                    else\n                    {\n                        this._stopAudio();\n                    }\n                }\n                else if (fieldName === \"loop\")\n                {\n                    //this._audio.loop = this._vf.loop;\n                }\n                else if (fieldName === \"url\")\n                {\n                    this._stopAudio();\n                    while (this._audio.hasChildNodes())\n                    {\n                        this._audio.removeChild(this._audio.firstChild);\n                    }\n\n                    for (var i=0; i<this._vf.url.length; i++)\n                    {\n                        var audioUrl = this._nameSpace.getURL(this._vf.url[i]);\n                        x3dom.debug.logInfo('Adding sound file: ' + audioUrl);\n                        var src = document.createElement('source');\n                        src.setAttribute('src', audioUrl);\n                        this._audio.appendChild(src);\n                    }\n                }\n            },\n\n            shutdown: function() {\n                if (this._audio) {\n                    this._audio.pause();\n                    while (this._audio.hasChildNodes()) {\n                        this._audio.removeChild(this._audio.firstChild);\n                    }\n                    document.body.removeChild(this._audio);\n                    this._audio = null;\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### X3DTextureTransformNode ### */\nx3dom.registerNodeType(\n    \"X3DTextureTransformNode\",\n    \"Texturing\",\n    defineClass(x3dom.nodeTypes.X3DAppearanceChildNode,\n        \n        /**\n         * Constructor for X3DTextureTransformNode\n         * @constructs x3dom.nodeTypes.X3DTextureTransformNode\n         * @x3d 3.3\n         * @component Texturing\n         * @status full\n         * @extends x3dom.nodeTypes.X3DAppearanceChildNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc This abstract node type is the base type for all node types which specify a transformation of texture coordinates.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DTextureTransformNode.superClass.call(this, ctx);\n        \n        },\n        {\n            texTransformMatrix: function() {\n                return this._trafo;\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### TextureTransform ### */\nx3dom.registerNodeType(\n    \"TextureTransform\",\n    \"Texturing\",\n    defineClass(x3dom.nodeTypes.X3DTextureTransformNode,\n        \n        /**\n         * Constructor for TextureTransform\n         * @constructs x3dom.nodeTypes.TextureTransform\n         * @x3d 3.3\n         * @component Texturing\n         * @status full\n         * @extends x3dom.nodeTypes.X3DTextureTransformNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The TextureTransform node defines a 2D transformation that is applied to texture coordinates. This node affects the way textures coordinates are applied to the geometric surface. The transformation consists of (in order):\n         * a translation; a rotation about the centre point; a non-uniform scale about the centre point.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.TextureTransform.superClass.call(this, ctx);\n\n\n            /**\n             * The center field specifies a translation offset in texture coordinate space about which the rotation and scale fields are applied.\n             * @var {x3dom.fields.SFVec2f} center\n             * @memberof x3dom.nodeTypes.TextureTransform\n             * @initvalue 0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec2f(ctx, 'center', 0, 0);\n\n            /**\n             * The rotation field specifies a rotation in angle base units of the texture coordinates about the center point after the scale has been applied.\n             * A positive rotation value makes the texture coordinates rotate counterclockwise about the centre, thereby rotating the appearance of the texture itself clockwise.\n             * @var {x3dom.fields.SFFloat} rotation\n             * @memberof x3dom.nodeTypes.TextureTransform\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'rotation', 0);\n\n            /**\n             * The scale field specifies a scaling factor in S and T of the texture coordinates about the center point.\n             * @var {x3dom.fields.SFVec2f} scale\n             * @memberof x3dom.nodeTypes.TextureTransform\n             * @initvalue 1,1\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec2f(ctx, 'scale', 1, 1);\n\n            /**\n             * The translation field specifies a translation of the texture coordinates.\n             * @var {x3dom.fields.SFVec2f} translation\n             * @memberof x3dom.nodeTypes.TextureTransform\n             * @initvalue 0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec2f(ctx, 'translation', 0, 0);\n        \n            this._calcTrafo();\n        },\n        {\n            fieldChanged: function (fieldName) {\n                //Tc' = -C * S * R * C * T * Tc\n                if (fieldName == 'center' || fieldName == 'rotation' ||\n                    fieldName == 'scale' || fieldName == 'translation') {\n\n                    this._calcTrafo();\n                }\n            },\n\n            _calcTrafo: function () {\n                var negCenter = new x3dom.fields.SFVec3f(-this._vf.center.x, -this._vf.center.y, 0);\n                var posCenter = new x3dom.fields.SFVec3f(this._vf.center.x, this._vf.center.y, 0);\n                var trans3 = new x3dom.fields.SFVec3f(this._vf.translation.x, this._vf.translation.y, 0);\n                var scale3 = new x3dom.fields.SFVec3f(this._vf.scale.x, this._vf.scale.y, 0);\n                \n                //Tc' = -C * S * R * C * T * Tc\n                this._trafo = \n                    x3dom.fields.SFMatrix4f.translation(negCenter).\n                    mult(x3dom.fields.SFMatrix4f.scale(scale3)).\n                    mult(x3dom.fields.SFMatrix4f.rotationZ(this._vf.rotation)).\n                    mult(x3dom.fields.SFMatrix4f.translation(posCenter.add(trans3)));\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### TextureTransform ### */\nx3dom.registerNodeType(\n    \"MatrixTextureTransform\",\n    \"Texturing\",\n    defineClass(x3dom.nodeTypes.X3DTextureTransformNode,\n        \n        /**\n         * Constructor for MatrixTextureTransform\n         * @constructs x3dom.nodeTypes.MatrixTextureTransform\n         * @x3dom\n         * @component Texturing\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DTextureTransformNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The MatrixTextureTransform node defines a 2D transformation as a 4x4 matrix that is applied to texture coordinates.\n         * This node affects the way textures coordinates are applied to the geometric surface.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.MatrixTextureTransform.superClass.call(this, ctx);\n\n\n            /**\n            * Defines the texture coordinate transformation matrix.\n            * @var {x3dom.fields.SFMatrix4f} matrix\n            * @memberof x3dom.nodeTypes.MatrixTextureTransform\n            * @initvalue 1,0,0,0\n            * @field x3dom\n            * @instance\n            */\n            this.addField_SFMatrix4f(ctx, 'matrix',\n                1, 0, 0, 0,\n                0, 1, 0, 0,\n                0, 0, 1, 0,\n                0, 0, 0, 1);\n        \n            this._trafo = this._vf.matrix.transpose();\n            \n        },\n        {\n            fieldChanged: function (fieldName) {\n                if (fieldName == \"matrix\") {\n                    this._trafo = this._vf.matrix.transpose();\n                }\n            }\n            \n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### TextureProperties ### */\nx3dom.registerNodeType(\n    \"TextureProperties\",\n    \"Texturing\",\n    defineClass(x3dom.nodeTypes.X3DNode,\n        \n        /**\n         * Constructor for TextureProperties\n         * @constructs x3dom.nodeTypes.TextureProperties\n         * @x3d 3.3\n         * @component Texturing\n         * @status full\n         * @extends x3dom.nodeTypes.X3DNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc TextureProperties allows fine control over a texture's application.\n         * This node can be used to set the texture properties for a node with a textureProperties field.\n         * A texture with a TextureProperties node will ignore the repeatS and repeatT fields on the texture.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.TextureProperties.superClass.call(this, ctx);\n\n\n            /**\n             * The anisotropicDegree field describes the minimum degree of anisotropy to account for in texture filtering.\n             * A value of 1 implies no anisotropic filtering.\n             * Values above the system's maximum supported value will be clamped to the maximum allowed.\n             * @var {x3dom.fields.SFFloat} anisotropicDegree\n             * @memberof x3dom.nodeTypes.TextureProperties\n             * @initvalue 1.0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'anisotropicDegree', 1.0);\n\n            /**\n             * The borderColor field describes the color to use for border pixels.\n             * @var {x3dom.fields.SFColorRGBA} borderColor\n             * @memberof x3dom.nodeTypes.TextureProperties\n             * @initvalue 0,0,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFColorRGBA(ctx, 'borderColor', 0, 0, 0, 0);\n\n            /**\n             * The borderWidth field describes the number of pixels to use for a texture border.\n             * @var {x3dom.fields.SFInt32} borderWidth\n             * @memberof x3dom.nodeTypes.TextureProperties\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'borderWidth', 0);\n\n            /**\n             * The boundaryModeS field describes the way S texture coordinate boundaries are handled.\n             * @var {x3dom.fields.SFString} boundaryModeS\n             * @memberof x3dom.nodeTypes.TextureProperties\n             * @initvalue \"REPEAT\"\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFString(ctx, 'boundaryModeS', \"REPEAT\");\n\n            /**\n             * The boundaryModeS field describes the way T texture coordinate boundaries are handled.\n             * @var {x3dom.fields.SFString} boundaryModeT\n             * @memberof x3dom.nodeTypes.TextureProperties\n             * @initvalue \"REPEAT\"\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFString(ctx, 'boundaryModeT', \"REPEAT\");\n\n            /**\n             * The boundaryModeS field describes the way R texture coordinate boundaries are handled.\n             * This field only applies to three dimensional textures and shall be ignored by other texture types.\n             * @var {x3dom.fields.SFString} boundaryModeR\n             * @memberof x3dom.nodeTypes.TextureProperties\n             * @initvalue \"REPEAT\"\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFString(ctx, 'boundaryModeR', \"REPEAT\");\n\n            /**\n             * The magnificationFilter field describes the way textures are filtered when the image is smaller than the screen space representation.\n             * @var {x3dom.fields.SFString} magnificationFilter\n             * @memberof x3dom.nodeTypes.TextureProperties\n             * @initvalue \"FASTEST\"\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFString(ctx, 'magnificationFilter', \"FASTEST\");\n\n            /**\n             * The minificationFilter field describes the way textures are filtered when the image is larger than the screen space representation.\n             * Modes with MIPMAP in the name require mipmaps. If mipmaps are not provided, the mode shall pick the corresponding non-mipmapped mode\n             * @var {x3dom.fields.SFString} minificationFilter\n             * @memberof x3dom.nodeTypes.TextureProperties\n             * @initvalue \"FASTEST\"\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFString(ctx, 'minificationFilter', \"FASTEST\");\n\n            /**\n             * The textureCompression field specifies the preferred image compression method to be used during rendering.\n             * @var {x3dom.fields.SFString} textureCompression\n             * @memberof x3dom.nodeTypes.TextureProperties\n             * @initvalue \"FASTEST\"\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFString(ctx, 'textureCompression', \"FASTEST\");\n\n            /**\n             * The texturePriority field describes the texture residence priority for allocating texture memory. Zero indicates the lowest priority and 1 indicates the highest priority.\n             * @var {x3dom.fields.SFFloat} texturePriority\n             * @memberof x3dom.nodeTypes.TextureProperties\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'texturePriority', 0);\n\n            /**\n             * The generateMipMaps field describes whether mipmaps should be generated for the texture. Mipmaps are required for filtering modes with MIPMAP in their value.\n             * @var {x3dom.fields.SFBool} generateMipMaps\n             * @memberof x3dom.nodeTypes.TextureProperties\n             * @initvalue false\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'generateMipMaps', false);\n        \n        },\n        {\n            fieldChanged: function(fieldName)\n            {\n                if (this._vf.hasOwnProperty(fieldName)) {\n                    Array.forEach(this._parentNodes, function (texture) {\n                        Array.forEach(texture._parentNodes, function (app) {\n                            Array.forEach(app._parentNodes, function (shape) {\n                                shape._dirty.texture = true;\n                            });\n                        });\n                    });\n\n                    this._nameSpace.doc.needRender = true;\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### X3DTextureNode ### */\nx3dom.registerNodeType(\n    \"X3DTextureNode\",\n    \"Texturing\",\n    defineClass(x3dom.nodeTypes.X3DAppearanceChildNode,\n        \n        /**\n         * Constructor for X3DTextureNode\n         * @constructs x3dom.nodeTypes.X3DTextureNode\n         * @x3d 3.3\n         * @component Texturing\n         * @status full\n         * @extends x3dom.nodeTypes.X3DAppearanceChildNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc This abstract node type is the base type for all node types which specify sources for texture images.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DTextureNode.superClass.call(this, ctx);\n\n\n            /**\n             * Specifies the channel count of the texture. 0 means the system should figure out the count automatically.\n             * @var {x3dom.fields.SFInt32} origChannelCount\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.X3DTextureNode\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'origChannelCount', 0);\n\n            /**\n             * Sets the url to a resource.\n             * @var {x3dom.fields.MFString} url\n             * @memberof x3dom.nodeTypes.X3DTextureNode\n             * @initvalue []\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFString(ctx, 'url', []);\n\n            /**\n             * Specifies whether the texture is repeated in s direction.\n             * @var {x3dom.fields.SFBool} repeatS\n             * @memberof x3dom.nodeTypes.X3DTextureNode\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'repeatS', true);\n\n            /**\n             * Specifies whether the texture is repeated in t direction.\n             * @var {x3dom.fields.SFBool} repeatT\n             * @memberof x3dom.nodeTypes.X3DTextureNode\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'repeatT', true);\n\n            /**\n             * Specifies whether the texture is scaled to the next highest power of two. (Needed, when texture repeat is enabled and texture size is non power of two)\n             * @var {x3dom.fields.SFBool} scale\n             * @memberof x3dom.nodeTypes.X3DTextureNode\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'scale', true);\n\n            /**\n             * Cross Origin Mode\n             * @var {x3dom.fields.SFString} crossOrigin\n             * @memberof x3dom.nodeTypes.X3DTextureNode\n             * @initvalue \"\"\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFString(ctx, 'crossOrigin', '');\n\n            /**\n             * Sets a TextureProperty node.\n             * @var {x3dom.fields.SFNode} textureProperties\n             * @memberof x3dom.nodeTypes.X3DTextureNode\n             * @initvalue x3dom.nodeTypes.TextureProperties\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('textureProperties', x3dom.nodeTypes.TextureProperties);\n\n            this.addField_SFBool(ctx, 'flipY', false);\n\n            this.addField_SFInt32(ctx, 'channel', 0);\n\n            this._needPerFrameUpdate = false;\n            this._isCanvas = false;\n            this._type = \"diffuseMap\";\n\n            this._blending = (this._vf.origChannelCount == 1 || this._vf.origChannelCount == 2);\n        \n        },\n        {\n            invalidateGLObject: function ()\n            {\n                Array.forEach(this._parentNodes, function (app) {\n                    Array.forEach(app._parentNodes, function (shape) {\n                        // THINKABOUTME: this is a bit ugly, cleanup more generically\n                        if (x3dom.isa(shape, x3dom.nodeTypes.X3DShapeNode)) {\n                            shape._dirty.texture = true;\n                        }\n                        else {\n                            // Texture maybe in MultiTexture or CommonSurfaceShader\n                            Array.forEach(shape._parentNodes, function (realShape) {\n                                if (x3dom.isa(realShape, x3dom.nodeTypes.X3DShapeNode)) {\n                                    realShape._dirty.texture = true;\n                                } else {\n                                    Array.forEach(realShape._parentNodes, function (realShape2) {\n                                        if (x3dom.isa(realShape2, x3dom.nodeTypes.X3DShapeNode)) {\n                                            realShape2._dirty.texture = true;\n                                        }\n                                    });\n                                }\n                            });\n                        }\n                    });\n                });\n\n                this._nameSpace.doc.needRender = true;\n            },\n\n            validateGLObject: function ()\n            {\n                Array.forEach(this._parentNodes, function (app) {\n                    Array.forEach(app._parentNodes, function (shape) {\n                        // THINKABOUTME: this is a bit ugly, cleanup more generically\n                        if (x3dom.isa(shape, x3dom.nodeTypes.X3DShapeNode)) {\n                            shape._dirty.texture = false;\n                        }\n                        else {\n                            // Texture maybe in MultiTexture or CommonSurfaceShader\n                            Array.forEach(shape._parentNodes, function (realShape) {\n                                if (x3dom.isa(realShape, x3dom.nodeTypes.X3DShapeNode)) {\n                                    realShape._dirty.texture = false;\n                                } else {\n                                    Array.forEach(realShape._parentNodes, function (realShape2) {\n                                        if (x3dom.isa(realShape2, x3dom.nodeTypes.X3DShapeNode)) {\n                                            realShape2._dirty.texture = false;\n                                        }\n                                    });\n                                }\n                            });\n                        }\n                    });\n                });\n\n                this._nameSpace.doc.needRender = true;\n            },\n\n            parentAdded: function(parent)\n            {\n                Array.forEach(parent._parentNodes, function (shape) {\n                    // THINKABOUTME: this is a bit ugly, cleanup more generically\n                    if (x3dom.isa(shape, x3dom.nodeTypes.Shape)) {\n                        shape._dirty.texture = true;\n                    }\n                    else {\n                        // Texture maybe in MultiTexture or CommonSurfaceShader\n                        Array.forEach(shape._parentNodes, function (realShape) {\n                            realShape._dirty.texture = true;\n                        });\n                    }\n                });\n            },\n\n            parentRemoved: function(parent)\n            {\n                Array.forEach(parent._parentNodes, function (shape) {\n                    // THINKABOUTME: cleanup more generically, X3DShapeNode allows VolumeData\n                    if (x3dom.isa(shape, x3dom.nodeTypes.X3DShapeNode)) {\n                        shape._dirty.texture = true;\n                    }\n                    else {\n                        // Texture maybe in MultiTexture or CommonSurfaceShader\n                        Array.forEach(shape._parentNodes, function (realShape) {\n                            realShape._dirty.texture = true;\n                        });\n                    }\n                });\n            },\n\n            fieldChanged: function(fieldName)\n            {\n                if (fieldName == \"url\" || fieldName ==  \"origChannelCount\" ||\n                    fieldName == \"repeatS\" || fieldName == \"repeatT\" ||\n                    fieldName == \"scale\" || fieldName == \"crossOrigin\")\n                {\n                    var that = this;\n\n                    Array.forEach(this._parentNodes, function (app) {\n                        if (x3dom.isa(app, x3dom.nodeTypes.X3DAppearanceNode)) {\n                            app.nodeChanged();\n                            Array.forEach(app._parentNodes, function (shape) {\n                                shape._dirty.texture = true;\n                            });\n                        }\n                        else if (x3dom.isa(app, x3dom.nodeTypes.MultiTexture)) {\n                            Array.forEach(app._parentNodes, function (realApp) {\n                                realApp.nodeChanged();\n                                Array.forEach(realApp._parentNodes, function (shape) {\n                                    shape._dirty.texture = true;\n                                });\n                            });\n                        }\n                        else if (x3dom.isa(app, x3dom.nodeTypes.ComposedCubeMapTexture)) {\n                            Array.forEach(app._parentNodes, function (realApp) {\n                                realApp.nodeChanged();\n                                Array.forEach(realApp._parentNodes, function (shape) {\n                                    shape._dirty.texture = true;\n                                });\n                            });\n                        }\n                        else if (x3dom.isa(app, x3dom.nodeTypes.PhysicalMaterial)) {\n                            Array.forEach(app._parentNodes, function (realApp) {\n                                realApp.nodeChanged();\n                                Array.forEach(realApp._parentNodes, function (shape) {\n                                    shape._dirty.texture = true;\n                                });\n                            });\n                        }\n                        else if (x3dom.isa(app, x3dom.nodeTypes.ImageGeometry)) {\n                            var cf = null;\n                            if (that._xmlNode && that._xmlNode.hasAttribute('containerField')) {\n                                cf = that._xmlNode.getAttribute('containerField');\n                                app._dirty[cf] = true;\n                            }\n                        }\n                        else if (x3dom.nodeTypes.X3DVolumeDataNode !== undefined) {\n                            if (x3dom.isa(app, x3dom.nodeTypes.X3DVolumeRenderStyleNode)) {\n                                if (that._xmlNode && that._xmlNode.hasAttribute('containerField')) {\n                                    if(app._volumeDataParent){\n                                        app._volumeDataParent._dirty.texture = true;\n                                    }else{\n                                        //Texture maybe under a ComposedVolumeStyle\n                                        var volumeDataParent = app._parentNodes[0];\n                                        while(!x3dom.isa(volumeDataParent, x3dom.nodeTypes.X3DVolumeDataNode) && x3dom.isa(volumeDataParent, x3dom.nodeTypes.X3DNode)){\n                                            volumeDataParent = volumeDataParent._parentNodes[0];\n                                        }\n                                        if(x3dom.isa(volumeDataParent, x3dom.nodeTypes.X3DNode)){\n                                            volumeDataParent._dirty.texture = true;\n                                        }\n                                    }\n                                }\n                            } else if (x3dom.isa(app, x3dom.nodeTypes.X3DVolumeDataNode)) {\n                                if (that._xmlNode && that._xmlNode.hasAttribute('containerField')) {\n                                    app._dirty.texture = true;\n                                }\n                            }\n                        }\n                    });\n                }\n            },\n\n            getTexture: function(pos) {\n                if (pos === 0) {\n                    return this;\n                }\n                return null;\n            },\n\n            size: function() {\n                return 1;\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### MultiTexture ### */\nx3dom.registerNodeType(\n    \"MultiTexture\",\n    \"Texturing\",\n    defineClass(x3dom.nodeTypes.X3DTextureNode,\n        \n        /**\n         * Constructor for MultiTexture\n         * @constructs x3dom.nodeTypes.MultiTexture\n         * @x3d 3.3\n         * @component Texturing\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DTextureNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The MultiTexture node specifies the application of several individual textures to a 3D object to achieve a more complex visual effect.\n         * MultiTexture can be used as a value for the texture field in an Appearance node.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.MultiTexture.superClass.call(this, ctx);\n\n\n            /**\n             * The texture field contains a list of texture nodes (e.g., ImageTexture, PixelTexture, and MovieTexture). The texture field may not contain another MultiTexture node.\n             * @var {x3dom.fields.MFNode} texture\n             * @memberof x3dom.nodeTypes.MultiTexture\n             * @initvalue x3dom.nodeTypes.X3DTextureNode\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFNode('texture', x3dom.nodeTypes.X3DTextureNode);\n        \n        },\n        {\n            getTexture: function(pos) {\n                if (pos >= 0 && pos < this._cf.texture.nodes.length) {\n                    return this._cf.texture.nodes[pos];\n                }\n                return null;\n            },\n\n            getTextures: function() {\n                return this._cf.texture.nodes;\n            },\n\n            size: function() {\n                return this._cf.texture.nodes.length;\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### Texture ### */\n// intermediate layer to avoid instantiating X3DTextureNode in web profile\nx3dom.registerNodeType(\n    \"Texture\",      // X3DTexture2DNode\n    \"Texturing\",\n    defineClass(x3dom.nodeTypes.X3DTextureNode,\n        \n        /**\n         * Constructor for Texture\n         * @constructs x3dom.nodeTypes.Texture\n         * @x3d x.x\n         * @component Texturing\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DTextureNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc (Abstract) class for 2D Textures.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Texture.superClass.call(this, ctx);\n\n\n            /**\n             * Specifies whether the children are shown or hidden outside the texture.\n             * @var {x3dom.fields.SFBool} hideChildren\n             * @memberof x3dom.nodeTypes.Texture\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'hideChildren', true);\n\n            this._video = null;\n            this._intervalID = 0;\n            this._canvas = null;\n        \n        },\n        {\n            nodeChanged: function()\n            {\n                if ((this._vf.url.length && this._vf.url[0].length) || !this._xmlNode) {\n                    return;\n                }\n                x3dom.debug.logInfo(\"No Texture URL given, searching for &lt;img&gt; elements...\");\n                var that = this;\n                try {\n                    Array.forEach( this._xmlNode.childNodes, function (childDomNode) {\n                        if (childDomNode.nodeType === 1) {\n                            var url = childDomNode.getAttribute(\"src\");\n                            // For testing: look for <img> element if url empty\n                            if (url) {\n                                that._vf.url.push(url);\n                                x3dom.debug.logInfo(that._vf.url[that._vf.url.length-1]);\n\n                                if (childDomNode.localName.toLowerCase() === \"video\") {\n                                    that._needPerFrameUpdate = true;\n                                    //that._video = childDomNode;\n\n                                    that._video = document.createElement('video');\n                                    that._video.setAttribute('preload', 'auto');\n                                    that._video.setAttribute('muted', 'muted');\n                                    var p = document.getElementsByTagName('body')[0];\n                                    p.appendChild(that._video);\n                                    that._video.style.display = \"none\";\n                                    that._video.style.visibility = \"hidden\";\n                                }\n                            }\n                            else if (childDomNode.localName.toLowerCase() === \"canvas\") {\n                                that._needPerFrameUpdate = true;\n                                that._isCanvas = true;\n                                that._canvas = childDomNode;\n                            }\n\n                            if (childDomNode.style && that._vf.hideChildren) {\n                                childDomNode.style.display = \"none\";\n                                childDomNode.style.visibility = \"hidden\";\n                            }\n                            x3dom.debug.logInfo(\"### Found &lt;\"+childDomNode.nodeName+\"&gt; tag.\");\n                        }\n                    } );\n                }\n                catch(e) {\n                    x3dom.debug.logException(e);\n                }\n            },\n\n            shutdown: function() {\n                if (this._video) {\n                    this._video.pause();\n                    while (this._video.hasChildNodes()) {\n                        this._video.removeChild(this._video.firstChild);\n                    }\n                    document.body.removeChild(this._video);\n                    this._video = null;\n                }\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### RenderedTexture ### */\nx3dom.registerNodeType(\n    \"RenderedTexture\",\n    \"Texturing\",\n    defineClass(x3dom.nodeTypes.X3DTextureNode,\n        \n        /**\n         * Constructor for RenderedTexture\n         * @constructs x3dom.nodeTypes.RenderedTexture\n         * @x3d x.x\n         * @component Texturing\n         * @extends x3dom.nodeTypes.X3DTextureNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc This extension provides the ability to dynamically render a partial scenegraph to an offscreen texture that can then be used on the geometry of a node.\n         * This can be used in many different ways such as creating mirror effects, inputs to shaders etc.\n         * The purpose of this component is to provide for extended visual effects, but not the complete form of offscreen rendering and buffers that would be available to lower-level rendering APIs.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.RenderedTexture.superClass.call(this, ctx);\n\n            if (ctx)\n                ctx.doc._nodeBag.renderTextures.push(this);\n            else\n                x3dom.debug.logWarning(\"RenderedTexture: No runtime context found!\");\n\n            // Original proposal taken from:  http://www.xj3d.org/extensions/render_texture.html\n            // http://doc.instantreality.org/documentation/nodetype/RenderedTexture/?filter=None\n\n\n            /**\n             * Specifies the viewpoint that is used to render the texture content.\n             * @var {x3dom.fields.SFNode} viewpoint\n             * @memberof x3dom.nodeTypes.RenderedTexture\n             * @initvalue x3dom.nodeTypes.X3DViewpointNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('viewpoint', x3dom.nodeTypes.X3DViewpointNode);\n\n            /**\n             * Sets a background texture.\n             * @var {x3dom.fields.SFNode} background\n             * @memberof x3dom.nodeTypes.RenderedTexture\n             * @initvalue x3dom.nodeTypes.X3DBackgroundNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('background', x3dom.nodeTypes.X3DBackgroundNode);\n\n            /**\n             * Sets a fog node.\n             * @var {x3dom.fields.SFNode} fog\n             * @memberof x3dom.nodeTypes.RenderedTexture\n             * @initvalue x3dom.nodeTypes.X3DFogNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('fog', x3dom.nodeTypes.X3DFogNode);    //TODO\n\n            /**\n             * Sets a separate, potentially independent, subscene. If unset, the same scene is used.\n             * @var {x3dom.fields.SFNode} scene\n             * @memberof x3dom.nodeTypes.RenderedTexture\n             * @initvalue x3dom.nodeTypes.X3DNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('scene', x3dom.nodeTypes.X3DNode);\n\n            /**\n             * Defines a list of sibling nodes that should be ignored.\n             * @var {x3dom.fields.MFNode} excludeNodes\n             * @memberof x3dom.nodeTypes.RenderedTexture\n             * @initvalue x3dom.nodeTypes.X3DNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFNode('excludeNodes', x3dom.nodeTypes.X3DNode);\n\n            /**\n             * Sets the width, height, color components (and number of MRTs).\n             * @var {x3dom.fields.MFInt32} dimensions\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.RenderedTexture\n             * @initvalue [128,128,4]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFInt32(ctx, 'dimensions', [128, 128, 4]);\n\n            /**\n             * Specifies when the texture is updated.\n             * @var {x3dom.fields.SFString} update\n             * @range [\"NONE\", \"NEXT_FRAME_ONLY\", \"ALWAYS\"]\n             * @memberof x3dom.nodeTypes.RenderedTexture\n             * @initvalue 'NONE'\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'update', 'NONE');\n\n\n            /**\n             *Specifies whether normals are shown.\n             * @var {x3dom.fields.SFBool} showNormals\n             * @memberof x3dom.nodeTypes.RenderedTexture\n             * @initvalue false\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'showNormals', false);\n\n            /**\n             * Sets render information for stereo rendering.\n             * @var {x3dom.fields.SFString} stereoMode\n             * @range [\"NONE\",\"LEFT_EYE\",\"RIGHT_EYE\"]\n             * @memberof x3dom.nodeTypes.RenderedTexture\n             * @initvalue 'NONE'\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'stereoMode', 'NONE');\n\n            /**\n             * Sets the eye distance for stereo rendering.\n             * @var {x3dom.fields.SFFloat} interpupillaryDistance\n             * @memberof x3dom.nodeTypes.RenderedTexture\n             * @initvalue 0.064\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'interpupillaryDistance', 0.064);\n\n            /**\n             * Sets the eye to screen distance in m for stereo rendering.\n             * @var {x3dom.fields.SFFloat} eyeToScreenDistance\n             * @memberof x3dom.nodeTypes.RenderedTexture\n             * @initvalue 0.041\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'eyeToScreenDistance', 0.041);\n\n            /**\n             * Sets the vertical screen size in m for stereo rendering.\n             * @var {x3dom.fields.SFFloat} vScreenSize\n             * @memberof x3dom.nodeTypes.RenderedTexture\n             * @initvalue 0.07074\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'vScreenSize', 0.07074);\n\n            /**\n             * Sets the lens Position on Screen.\n             * @var {x3dom.fields.SFVec3f} lensCenter\n             * @memberof x3dom.nodeTypes.RenderedTexture\n             * @initvalue 0.05329\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'lensCenter', 0.15197, 0, 0);\n            \n            /** \n             * Determines if textures shall be treated as depth map.\n             * If it is TRUE, then the generated texture will also contain the depth buffer.\n             * @var {x3dom.fields.SFBool} depthMap\n             * @memberof x3dom.nodeTypes.RenderedTexture\n             * @initvalue false\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'depthMap', false);\n\n            /**\n             * Very experimental field to change between DK1 and DK2.\n             * @var {x3dom.fields.SFFloat} oculusRiftVersion\n             * @memberof x3dom.nodeTypes.RenderedTexture\n             * @initvalue 1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'oculusRiftVersion', 1);\n\n\n            x3dom.debug.assert(this._vf.dimensions.length >= 3,\n                \"RenderedTexture.dimensions requires at least 3 entries.\");\n            this._clearParents = true;\n            this._needRenderUpdate = true;\n            \n            this.checkDepthTextureSupport = function() {\n                if(this._vf.depthMap && x3dom.caps.DEPTH_TEXTURE === null)\n                    x3dom.debug.logWarning(\"RenderedTexture Node: depth texture extension not supported\");\n            };\n            this.checkDepthTextureSupport();\n        },\n        {\n            nodeChanged: function()\n            {\n                this._clearParents = true;\n                this._needRenderUpdate = true;\n            },\n\n            fieldChanged: function(fieldName)\n            {\n                switch(fieldName)\n                {\n                    case \"excludeNodes\":\n                        this._clearParents = true;\n                        break;\n                    case \"update\":\n                        if (this._vf.update.toUpperCase() == \"NEXT_FRAME_ONLY\" ||\n                            this._vf.update.toUpperCase() == \"ALWAYS\") {\n                            this._needRenderUpdate = true;\n                        }\n                        break;\n                    case \"depthMap\":\n                        this.checkDepthTextureSupport();\n                        this._x3domTexture.updateTexture();\n                        this._needRenderUpdate = true;\n                    default:\n                        // TODO: dimensions\n                        break;\n                }\n            },\n\n            getViewMatrix: function ()\n            {\n                if (this._clearParents && this._cf.excludeNodes.nodes.length) {\n                    // FIXME; avoid recursions cleverer and more generic than this\n                    //        (Problem: nodes in excludeNodes field have this node\n                    //         as first parent, which leads to a recursion loop in\n                    //         getCurrentTransform()\n                    var that = this;\n\n                    Array.forEach(this._cf.excludeNodes.nodes, function(node) {\n                        for (var i=0, n=node._parentNodes.length; i < n; i++) {\n                            if (node._parentNodes[i] === that) {\n                                node._parentNodes.splice(i, 1);\n                                node.parentRemoved(that);\n                            }\n                        }\n                    });\n\n                    this._clearParents = false;\n                }\n\n                var locScene = this._cf.scene.node;\n                var scene = this._nameSpace.doc._scene;\n                var vbP = scene.getViewpoint();\n                var view = this._cf.viewpoint.node;\n                var ret_mat = null;\n\n                if (view === null || view === vbP) {\n                    ret_mat = this._nameSpace.doc._viewarea.getViewMatrix();\n                }\n                else if (locScene && locScene !== scene) {\n                    // in case of completely local scene do not transform local viewpoint\n                    ret_mat = view.getViewMatrix();\n                }\n                else {\n                    var mat_viewpoint = view.getCurrentTransform();\n                    ret_mat = view.getViewMatrix().mult(mat_viewpoint.inverse());\n                }\n\n                var stereoMode = this._vf.stereoMode.toUpperCase();\n                if (stereoMode != \"NONE\") {\n                    var d = this._vf.interpupillaryDistance / 2;\n                    if (stereoMode == \"RIGHT_EYE\") {\n                        d = -d;\n                    }\n                    var modifier = new x3dom.fields.SFMatrix4f(\n                        1, 0, 0, d,\n                        0, 1, 0, 0,\n                        0, 0, 1, 0,\n                        0, 0, 0, 1\n                    );\n                    ret_mat = modifier.mult(ret_mat);\n                }\n\n                return ret_mat;\n            },\n\n            getProjectionMatrix: function()\n            {\n                var doc = this._nameSpace.doc;\n                var vbP = doc._scene.getViewpoint();\n                var view = this._cf.viewpoint.node;\n                var ret_mat = null;\n                var f, w = this._vf.dimensions[0], h = this._vf.dimensions[1];\n                var stereoMode = this._vf.stereoMode.toUpperCase();\n                var stereo = (stereoMode != \"NONE\");\n\n                if (view === null || view === vbP) {\n                    ret_mat = x3dom.fields.SFMatrix4f.copy(doc._viewarea.getProjectionMatrix());\n                    if (stereo) {\n                        f = 2 * Math.atan(this._vf.vScreenSize / (2 * this._vf.eyeToScreenDistance));\n                        f = 1 / Math.tan(f / 2);\n                    }\n                    else {\n                        f = 1 / Math.tan(vbP._vf.fieldOfView / 2);\n                    }\n                    ret_mat._00 = f / (w / h);\n                    ret_mat._11 = f;\n                }\n                else {\n                    ret_mat = view.getProjectionMatrix(w / h);\n                }\n\n                if (stereo) {\n                    var lensCenter = this._vf.lensCenter.copy();\n                    if (stereoMode == \"RIGHT_EYE\") {\n                        lensCenter.x = -lensCenter.x;\n                    }\n                    var modifier = new x3dom.fields.SFMatrix4f(\n                        1, 0, 0, lensCenter.x,\n                        0, 1, 0, lensCenter.y,\n                        0, 0, 1, lensCenter.z,\n                        0, 0, 0, 1\n                    );\n                    ret_mat = modifier.mult(ret_mat);\n                }\n\n                return ret_mat;\n            },\n\n            getWCtoCCMatrix: function()\n            {\n                var view = this.getViewMatrix();\n                var proj = this.getProjectionMatrix();\n\n                return proj.mult(view);\n            },\n\n            parentRemoved: function(parent)\n            {\n                if (this._parentNodes.length === 0) {\n                    var doc = this.findX3DDoc();\n\n                    for (var i=0, n=doc._nodeBag.renderTextures.length; i<n; i++) {\n                        if (doc._nodeBag.renderTextures[i] === this) {\n                            doc._nodeBag.renderTextures.splice(i, 1);\n                        }\n                    }\n                }\n\n                if (this._cf.scene.node) {\n                    this._cf.scene.node.parentRemoved(this);\n                }\n            },\n\n            requirePingPong: function()\n            {\n                return false;\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### RefinementTexture ### */\nx3dom.registerNodeType(\n    \"RefinementTexture\",\n    \"Texturing\",\n    defineClass(x3dom.nodeTypes.RenderedTexture,\n        \n        /**\n         * Constructor for RefinementTexture\n         * @constructs x3dom.nodeTypes.RefinementTexture\n         * @x3d x.x\n         * @component Texturing\n         * @extends x3dom.nodeTypes.RenderedTexture\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         */\n        function (ctx) {\n            x3dom.nodeTypes.RefinementTexture.superClass.call(this, ctx);\n\n            /**\n             * Specifies the first stamp texture.\n             * @var {x3dom.fields.SFString} stamp0\n             * @memberof x3dom.nodeTypes.RefinementTexture\n             * @initvalue \"gpuii/stamps/0.gif\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'stamp0', \"gpuii/stamps/0.gif\");\n\n            /**\n             * Specifies the second stamp texture.\n             * @var {x3dom.fields.SFString} stamp1\n             * @memberof x3dom.nodeTypes.RefinementTexture\n             * @initvalue \"gpuii/stamps/1.gif\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'stamp1', \"gpuii/stamps/1.gif\");\n\n            /**\n             * Defines whether texture refinement should be managed by another component.\n             * @var {x3dom.fields.SFBool} autoRefinement\n             * @memberof x3dom.nodeTypes.RefinementTexture\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'autoRefinement', true);\n\n            /**\n             * Specifies the image format of the dataset.\n             * @var {x3dom.fields.SFString} format\n             * @memberof x3dom.nodeTypes.RefinementTexture\n             * @initvalue 'jpg'\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'format', 'jpg');\n\n            /**\n             * Maximum level that should be loaded (if GSM is smaller than on DSL6000)\n             * @var {x3dom.fields.SFInt32} iterations\n             * @memberof x3dom.nodeTypes.RefinementTexture\n             * @initvalue 7\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'iterations', 7);\n\n            /**\n             * Maximum level that should be loaded (if GSM is smaller than on DSL6000)\n             * @var {x3dom.fields.SFInt32} maxLevel\n             * @memberof x3dom.nodeTypes.RefinementTexture\n             * @initvalue this._vf.iterations\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'maxLevel', this._vf.iterations);\n\n            if (this._vf.iterations % 2 === 0) {\n                var temp = this._vf.stamp0;\n                this._vf.stamp0 = this._vf.stamp1;\n                this._vf.stamp1 = temp;\n            }\n\n            this._vf.iterations = (this._vf.iterations > 11) ? 11 : this._vf.iterations;\n            this._vf.iterations = (this._vf.iterations < 3) ? 3 : this._vf.iterations;\n            this._vf.maxLevel = (this._vf.maxLevel > 11) ? 11 : this._vf.maxLevel;\n            this._vf.maxLevel = (this._vf.maxLevel < 3) ? 3 : this._vf.maxLevel;\n            this._vf.maxLevel = (this._vf.maxLevel > this._vf.iterations) ? this._vf.iterations : this._vf.maxLevel;\n\n            // Additional parameters to control the refinement mechanism on shader\n            // TODO: optimize\n            var repeatConfig = [\n                {x: 4, y: 8}, {x: 8, y: 8}, {x: 8, y: 16},\n                {x: 16, y: 16}, {x: 16, y: 32}, {x: 32, y: 32},\n                {x: 32, y: 64}, {x: 64, y: 64}, {x: 64, y: 128}\n            ];\n\n            // TODO: optimize\n            this._repeat = new x3dom.fields.SFVec2f(\n                    this._vf.dimensions[0] / repeatConfig[this._vf.iterations - 3].x,\n                    this._vf.dimensions[1] / repeatConfig[this._vf.iterations - 3].y\n            );\n            this._renderedImage = 0;\n            this._currLoadLevel = 0;\n            this._loadLevel = 1;\n        \n        },\n        {\n            nextLevel: function() {\n                if (this._loadLevel < this._vf.maxLevel) {\n                    this._loadLevel++;\n                    this._nameSpace.doc.needRender = true;\n                }\n            },\n\n            requirePingPong: function() {\n                return (this._currLoadLevel <= this._vf.maxLevel &&\n                    this._renderedImage < this._loadLevel);\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### PixelTexture ### */\nx3dom.registerNodeType(\n    \"PixelTexture\",\n    \"Texturing\",\n    defineClass(x3dom.nodeTypes.X3DTextureNode,\n        \n        /**\n         * Constructor for PixelTexture\n         * @constructs x3dom.nodeTypes.PixelTexture\n         * @x3d 3.3\n         * @component Texturing\n         * @status full\n         * @extends x3dom.nodeTypes.X3DTextureNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The PixelTexture node defines a 2D image-based texture map as an explicit array of pixel values (image field) and parameters controlling tiling repetition of the texture onto geometry.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.PixelTexture.superClass.call(this, ctx);\n\n\n            /**\n             * The image that delivers the pixel data.\n             * @var {x3dom.fields.SFImage} image\n             * @memberof x3dom.nodeTypes.PixelTexture\n             * @initvalue 0,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFImage(ctx, 'image', 0, 0, 0);\n        \n        },\n        {\n            fieldChanged: function(fieldName)\n            {\n                if (fieldName == \"image\") {\n                    this.invalidateGLObject();\n                }\n            },\n\n            getWidth: function() {\n                return this._vf.image.width;\n            },\n\n            getHeight: function() {\n                return this._vf.image.height;\n            },\n\n            getComponents: function() {\n                return this._vf.image.comp;\n            },\n\n            setPixel: function(x, y, color, update) {\n                update = (update == undefined) ? true : update;\n\n                if (this._x3domTexture) {\n                    this._x3domTexture.setPixel(x, y, [\n                        color.r*255,\n                        color.g*255,\n                        color.b*255,\n                        color.a*255 ], update );\n                    this._vf.image.setPixel(x, y, color);\n                }\n                else\n                {\n                    this._vf.image.setPixel(x, y, color);\n                    if( update ) {\n                        this.invalidateGLObject();\n                    }\n                }\n\n            },\n\n            getPixel: function(x, y) {\n                return this._vf.image.getPixel(x, y);\n            },\n\n            setPixels: function(pixels, update) {\n                update = (update == undefined) ? true : update;\n\n                this._vf.image.setPixels(pixels);\n\n                if (update) {\n                    this.invalidateGLObject();\n                }\n            },\n\n            getPixels: function() {\n                return this._vf.image.getPixels();\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### ImageTexture ### */\nx3dom.registerNodeType(\n    \"ImageTexture\",\n    \"Texturing\",\n    defineClass(x3dom.nodeTypes.Texture,\n        \n        /**\n         * Constructor for ImageTexture\n         * @constructs x3dom.nodeTypes.ImageTexture\n         * @x3d 3.3\n         * @component Texturing\n         * @status full\n         * @extends x3dom.nodeTypes.Texture\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc ImageTexture maps a 2D-image file onto a geometric shape.\n         * Texture maps have a 2D coordinate system (s, t) horizontal and vertical, with (s, t) values in range [0.0, 1.0] for opposite corners of the image.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.ImageTexture.superClass.call(this, ctx);\n        \n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### MovieTexture ### */\nx3dom.registerNodeType(\n    \"MovieTexture\",\n    \"Texturing\",\n    defineClass(x3dom.nodeTypes.Texture,\n        \n        /**\n         * Constructor for MovieTexture\n         * @constructs x3dom.nodeTypes.MovieTexture\n         * @x3d 3.3\n         * @component Texturing\n         * @status experimental\n         * @extends x3dom.nodeTypes.Texture\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The MovieTexture node defines a time dependent texture map (contained in a movie file) and parameters for controlling the movie and the texture mapping.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.MovieTexture.superClass.call(this, ctx);\n\n\n            /**\n             * Specifies whether the playback restarts after finished.\n             * @var {x3dom.fields.SFBool} loop\n             * @memberof x3dom.nodeTypes.MovieTexture\n             * @initvalue false\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'loop', false);\n\n            /**\n             * Specifies the plaback speed.\n             * @var {x3dom.fields.SFFloat} speed\n             * @memberof x3dom.nodeTypes.MovieTexture\n             * @initvalue 1.0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'speed', 1.0);\n            // TODO; implement the following fields...\n\n            /**\n             * Sets a time to pause the video.\n             * @var {x3dom.fields.SFTime} pauseTime\n             * @memberof x3dom.nodeTypes.MovieTexture\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFTime(ctx, 'pauseTime', 0);\n\n            /**\n             *\n             * @var {x3dom.fields.SFFloat} pitch\n             * @memberof x3dom.nodeTypes.MovieTexture\n             * @initvalue 1.0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'pitch', 1.0);\n\n            /**\n             * Sets a time to resume from pause.\n             * @var {x3dom.fields.SFTime} resumeTime\n             * @memberof x3dom.nodeTypes.MovieTexture\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFTime(ctx, 'resumeTime', 0);\n\n            /**\n             * Sets a start time for the video.\n             * @var {x3dom.fields.SFTime} startTime\n             * @memberof x3dom.nodeTypes.MovieTexture\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFTime(ctx, 'startTime', 0);\n\n            /**\n             * Sets a stop time for the video.\n             * @var {x3dom.fields.SFTime} stopTime\n             * @memberof x3dom.nodeTypes.MovieTexture\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFTime(ctx, 'stopTime', 0);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### X3DTextureCoordinateNode ### */\nx3dom.registerNodeType(\n    \"X3DTextureCoordinateNode\",\n    \"Texturing\",\n    defineClass(x3dom.nodeTypes.X3DGeometricPropertyNode,\n        \n        /**\n         * Constructor for X3DTextureCoordinateNode\n         * @constructs x3dom.nodeTypes.X3DTextureCoordinateNode\n         * @x3d 3.3\n         * @component Texturing\n         * @status full\n         * @extends x3dom.nodeTypes.X3DGeometricPropertyNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc This abstract node type is the base type for all node types which specify texture coordinates.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DTextureCoordinateNode.superClass.call(this, ctx);\n        \n        },\n        {\n            fieldChanged: function (fieldName) {\n                if (fieldName === \"texCoord\" || fieldName === \"point\" ||\n                    fieldName === \"parameter\" || fieldName === \"mode\")\n                {\n                    Array.forEach(this._parentNodes, function (node) {\n                        node.fieldChanged(\"texCoord\");\n                    });\n                }\n            },\n\n            parentAdded: function(parent) {\n                if (parent._mesh && //parent._cf.coord.node &&\n                    parent._cf.texCoord.node !== this) {\n                    parent.fieldChanged(\"texCoord\");\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### TextureCoordinate ### */\nx3dom.registerNodeType(\n    \"TextureCoordinate\",\n    \"Texturing\",\n    defineClass(x3dom.nodeTypes.X3DTextureCoordinateNode,\n        \n        /**\n         * Constructor for TextureCoordinate\n         * @constructs x3dom.nodeTypes.TextureCoordinate\n         * @x3d 3.3\n         * @component Texturing\n         * @status full\n         * @extends x3dom.nodeTypes.X3DTextureCoordinateNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The TextureCoordinate node is a geometry property node that specifies a set of 2D texture coordinates used by vertex-based geometry nodes (EXAMPLE  IndexedFaceSet and ElevationGrid) to map textures to vertices.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.TextureCoordinate.superClass.call(this, ctx);\n\n\n            /**\n             * Specifies the array of texture coordinates.\n             * @var {x3dom.fields.MFVec2f} point\n             * @memberof x3dom.nodeTypes.TextureCoordinate\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFVec2f(ctx, 'point', []);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### TextureCoordinateGenerator ### */\nx3dom.registerNodeType(\n    \"TextureCoordinateGenerator\",\n    \"Texturing\",\n    defineClass(x3dom.nodeTypes.X3DTextureCoordinateNode,\n        \n        /**\n         * Constructor for TextureCoordinateGenerator\n         * @constructs x3dom.nodeTypes.TextureCoordinateGenerator\n         * @x3d 3.3\n         * @component Texturing\n         * @status full\n         * @extends x3dom.nodeTypes.X3DTextureCoordinateNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc TextureCoordinateGenerator supports the automatic generation of texture coordinates for geometric shapes.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.TextureCoordinateGenerator.superClass.call(this, ctx);\n\n\n            /**\n             * The mode field describes the algorithm used to compute texture coordinates.\n             * @var {x3dom.fields.SFString} mode\n             * @memberof x3dom.nodeTypes.TextureCoordinateGenerator\n             * @initvalue \"SPHERE\"\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFString(ctx, 'mode', \"SPHERE\");\n\n            /**\n             * Specify the parameters. These are mode dependent.\n             * @var {x3dom.fields.MFFloat} parameter\n             * @memberof x3dom.nodeTypes.TextureCoordinateGenerator\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFFloat(ctx, 'parameter', []);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### MultiTextureCoordinate ### */\nx3dom.registerNodeType(\n    \"MultiTextureCoordinate\",\n    \"Texturing\",\n    defineClass(x3dom.nodeTypes.X3DTextureCoordinateNode,\n        \n        /**\n         * Constructor for MultiTextureCoordinate\n         * @constructs x3dom.nodeTypes.MultiTextureCoordinate\n         * @x3d 3.3\n         * @component Texturing\n         * @status full\n         * @extends x3dom.nodeTypes.X3DTextureCoordinateNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc MultiTextureCoordinate supplies multiple texture coordinates per vertex. This node can be used to set the texture coordinates for the different texture channels.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.MultiTextureCoordinate.superClass.call(this, ctx);\n\n\n            /**\n             * Each entry in the texCoord field may contain a TextureCoordinate or TextureCoordinateGenerator node.\n             * @var {x3dom.fields.MFNode} texCoord\n             * @memberof x3dom.nodeTypes.MultiTextureCoordinate\n             * @initvalue x3dom.nodeTypes.X3DTextureCoordinateNode\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFNode('texCoord', x3dom.nodeTypes.X3DTextureCoordinateNode);\n        \n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### ImageTextureAtlas ### */\nx3dom.registerNodeType(\n    \"ImageTextureAtlas\",\n    \"Texturing\",\n    defineClass(x3dom.nodeTypes.Texture,\n\n        /**\n         * Constructor for ImageTextureAtlas\n         * @constructs x3dom.nodeTypes.ImageTextureAtlas\n         * @x3d x.x\n         * @component Texturing\n         * @extends x3dom.nodeTypes.Texture\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc This is a special helper node to represent tiles for volume rendering.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.ImageTextureAtlas.superClass.call(this, ctx);\n\n\n            /**\n             * Specifies the number of slices in the texture atlas.\n             * @var {x3dom.fields.SFInt32} numberOfSlices\n             * @memberof x3dom.nodeTypes.ImageTextureAtlas\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'numberOfSlices', 0);\n\n            /**\n             * Specifies the slices in x.\n             * @var {x3dom.fields.SFInt32} slicesOverX\n             * @memberof x3dom.nodeTypes.ImageTextureAtlas\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'slicesOverX', 0);\n\n            /**\n             * Specifies the slices in y.\n             * @var {x3dom.fields.SFInt32} slicesOverY\n             * @memberof x3dom.nodeTypes.ImageTextureAtlas\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'slicesOverY', 0);\n\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### X3DEnvironmentTextureNode ### */\nx3dom.registerNodeType(\n    \"X3DEnvironmentTextureNode\",\n    \"CubeMapTexturing\",\n    defineClass(x3dom.nodeTypes.X3DTextureNode,\n        \n        /**\n         * Constructor for X3DEnvironmentTextureNode\n         * @constructs x3dom.nodeTypes.X3DEnvironmentTextureNode\n         * @x3d x.x\n         * @component CubeMapTexturing\n         * @status full\n         * @extends x3dom.nodeTypes.X3DTextureNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc This abstract node type is the base type for all node types that specify cubic environment map sources for texture images.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DEnvironmentTextureNode.superClass.call(this, ctx);\n        \n        },\n        {\n            getTexUrl: function() {\n                return [];  //abstract accessor for gfx\n            },\n\n            getTexSize: function() {\n                return -1;  //abstract accessor for gfx\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### ComposedCubeMapTexture ### */\nx3dom.registerNodeType(\n    \"ComposedCubeMapTexture\",\n    \"CubeMapTexturing\",\n    defineClass(x3dom.nodeTypes.X3DEnvironmentTextureNode,\n        \n        /**\n         * Constructor for ComposedCubeMapTexture\n         * @constructs x3dom.nodeTypes.ComposedCubeMapTexture\n         * @x3d 3.3\n         * @component CubeMapTexturing\n         * @status full\n         * @extends x3dom.nodeTypes.X3DEnvironmentTextureNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The ComposedCubeMapTexture node defines a cubic environment map source as an explicit set of\n         * images drawn from individual 2D texture nodes.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.ComposedCubeMapTexture.superClass.call(this, ctx);\n\n\n            /**\n             * Texture for the back of the cubemap\n             * @var {x3dom.fields.SFNode} back\n             * @memberof x3dom.nodeTypes.ComposedCubeMapTexture\n             * @initvalue x3dom.nodeTypes.Texture\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFNode('back',  x3dom.nodeTypes.Texture);\n\n            /**\n             * Texture for the front of the cubemap\n             * @var {x3dom.fields.SFNode} front\n             * @memberof x3dom.nodeTypes.ComposedCubeMapTexture\n             * @initvalue x3dom.nodeTypes.Texture\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFNode('front',  x3dom.nodeTypes.Texture);\n\n            /**\n             * Texture for the bottom of the cubemap\n             * @var {x3dom.fields.SFNode} bottom\n             * @memberof x3dom.nodeTypes.ComposedCubeMapTexture\n             * @initvalue x3dom.nodeTypes.Texture\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFNode('bottom', x3dom.nodeTypes.Texture);\n\n            /**\n             * Texture for the top of the cubemap\n             * @var {x3dom.fields.SFNode} top\n             * @memberof x3dom.nodeTypes.ComposedCubeMapTexture\n             * @initvalue x3dom.nodeTypes.Texture\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFNode('top',    x3dom.nodeTypes.Texture);\n\n            /**\n             * Texture for the left side of the cubemap\n             * @var {x3dom.fields.SFNode} left\n             * @memberof x3dom.nodeTypes.ComposedCubeMapTexture\n             * @initvalue x3dom.nodeTypes.Texture\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFNode('left',   x3dom.nodeTypes.Texture);\n\n            /**\n             * Texture for the right side of the cubemap\n             * @var {x3dom.fields.SFNode} right\n             * @memberof x3dom.nodeTypes.ComposedCubeMapTexture\n             * @initvalue x3dom.nodeTypes.Texture\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFNode('right',  x3dom.nodeTypes.Texture);\n            this._type = \"environmentMap\";\n        \n        },\n        {\n            getTexUrl: function() {\n                return [\n                    this._nameSpace.getURL(this._cf.back.node._vf.url[0]),\n                    this._nameSpace.getURL(this._cf.front.node._vf.url[0]),\n                    this._nameSpace.getURL(this._cf.bottom.node._vf.url[0]),\n                    this._nameSpace.getURL(this._cf.top.node._vf.url[0]),\n                    this._nameSpace.getURL(this._cf.left.node._vf.url[0]),\n                    this._nameSpace.getURL(this._cf.right.node._vf.url[0])\n                ];\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### GeneratedCubeMapTexture ### */\nx3dom.registerNodeType(\n    \"GeneratedCubeMapTexture\",\n    \"CubeMapTexturing\",\n    defineClass(x3dom.nodeTypes.X3DEnvironmentTextureNode,\n        \n        /**\n         * Constructor for GeneratedCubeMapTexture\n         * @constructs x3dom.nodeTypes.GeneratedCubeMapTexture\n         * @x3d 3.3\n         * @component CubeMapTexturing\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DEnvironmentTextureNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The GeneratedCubeMapTexture node defines a cubic environment map that sources its data from\n         * internally generated images, rendered from a virtual situated perspective in the scene.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.GeneratedCubeMapTexture.superClass.call(this, ctx);\n\n\n            /**\n             * The size field indicates the resolution of the generated images in number of pixels per side.\n             * @var {x3dom.fields.SFInt32} size\n             * @memberof x3dom.nodeTypes.GeneratedCubeMapTexture\n             * @initvalue 128\n             * @range (0, inf)\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'size', 128);\n\n            /**\n             * NOT YET IMPLEMENTED:\n             * The update field can be used to request a regeneration of the texture. Setting this field to \"ALWAYS\"\n             * will cause the texture to be rendered every frame. A value of \"NONE\" will stop rendering so that no\n             * further updates are performed even if the contained scene graph changes. When the value is set to\n             * \"NEXT_FRAME_ONLY\", it is an instruction to render the texture at the end of this frame, and then not\n             * render it again. In this case, the update frame indicator is set to this frame; at the start of the next\n             * frame, the update value shall be automatically set back to \"NONE\" to indicate that the rendering has already taken place.\n             * @var {x3dom.fields.SFString} update\n             * @memberof x3dom.nodeTypes.GeneratedCubeMapTexture\n             * @initvalue 'NONE'\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFString(ctx, 'update', 'NONE');  // (\"NONE\"|\"NEXT_FRAME_ONLY\"|\"ALWAYS\")\n\n            this._type = \"cubeMap\";\n            x3dom.debug.logWarning(\"GeneratedCubeMapTexture NYI\");   // TODO; impl. in gfx when fbo type ready\n        \n        },\n        {\n            getTexSize: function() {\n                return this._vf.size;\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### Uniform ### */\nx3dom.registerNodeType(\n    \"Uniform\",\n    \"Shaders\",\n    defineClass(x3dom.nodeTypes.Field,\n        \n        /**\n         * Constructor for Uniform\n         * @constructs x3dom.nodeTypes.Uniform\n         * @x3d x.x\n         * @component Shaders\n         * @extends x3dom.nodeTypes.Field\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc Node representing a uniform.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Uniform.superClass.call(this, ctx);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### SurfaceShaderTexture ### */\nx3dom.registerNodeType(\n    \"SurfaceShaderTexture\",\n    \"Shaders\",\n    defineClass(x3dom.nodeTypes.X3DTextureNode,\n        \n        /**\n         * Constructor for SurfaceShaderTexture\n         * @constructs x3dom.nodeTypes.SurfaceShaderTexture\n         * @x3d x.x\n         * @component Shaders\n         * @extends x3dom.nodeTypes.X3DTextureNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc A texture reference that can be used as a child of SurfaceShader.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.SurfaceShaderTexture.superClass.call(this, ctx);\n\n\n            /**\n             * Texture coordinate channel to use for this texture.\n             * @var {x3dom.fields.SFInt32} textureCoordinatesId\n             * @memberof x3dom.nodeTypes.SurfaceShaderTexture\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'textureCoordinatesId', 0);\n\n            /**\n             * Texture channels to use for this texture in the form of a glsl swizzle (e.g. \"rgb\", \"abgr\", \"a\").\n             *  \"DEFAULT\" will use the default channels for the slot (\"rgb\" for colors and normals, \"a\" for alpha,\n             *  shininess, ...).\n             * @var {x3dom.fields.SFString} channelMask\n             * @memberof x3dom.nodeTypes.SurfaceShaderTexture\n             * @initvalue \"DEFAULT\"\n             * @range [rgb,abgr,a,..]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'channelMask', \"DEFAULT\");\n\n            /**\n             * Whether texture contains sRGB content and need to be linearized (NOT IMPLEMENTED!).\n             * @var {x3dom.fields.SFBool} isSRGB\n             * @memberof x3dom.nodeTypes.SurfaceShaderTexture\n             * @initvalue false\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'isSRGB', false);\n\n            /**\n             * The texture to use.\n             * @var {x3dom.fields.SFNode} texture\n             * @memberof x3dom.nodeTypes.SurfaceShaderTexture\n             * @initvalue x3dom.nodeTypes.X3DTextureNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('texture', x3dom.nodeTypes.X3DTextureNode);\n\n            /**\n             * An optional texture transform.\n             * @var {x3dom.fields.SFNode} textureTransform\n             * @memberof x3dom.nodeTypes.SurfaceShaderTexture\n             * @initvalue x3dom.nodeTypes.X3DTextureTransformNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('textureTransform', x3dom.nodeTypes.X3DTextureTransformNode);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### X3DShaderNode ### */\nx3dom.registerNodeType(\n    \"X3DShaderNode\",\n    \"Shaders\",\n    defineClass(x3dom.nodeTypes.X3DAppearanceChildNode,\n        \n        /**\n         * Constructor for X3DShaderNode\n         * @constructs x3dom.nodeTypes.X3DShaderNode\n         * @x3d 3.3\n         * @component Shaders\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DAppearanceChildNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc This abstract node type is the base type for all node types that specify a programmable shader.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DShaderNode.superClass.call(this, ctx);\n\n\n            /**\n             * The language field is used to indicate to the browser which shading language is used for the source\n             *  file(s). This field may be used as a hint for the browser if the shading language is not immediately\n             *  determinable from the source (e.g., a generic MIME type of text/plain is returned). A browser may use\n             *  this field for determining which node instance will be selected and to ignore languages that it is not\n             *  capable of supporting. Three basic language types are defined for this specification and others may be\n             *  optionally supported by a browser.\n             * @var {x3dom.fields.SFString} language\n             * @memberof x3dom.nodeTypes.X3DShaderNode\n             * @initvalue \"\"\n             * @range [\"Cg\"|\"GLSL\"|\"HLSL\"|...]\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFString(ctx, 'language', \"\");\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### CommonSurfaceShader ### */\nx3dom.registerNodeType(\n    \"CommonSurfaceShader\",\n    \"Shaders\",\n    defineClass(x3dom.nodeTypes.X3DShaderNode,\n        \n        /**\n         * Constructor for CommonSurfaceShader\n         * @constructs x3dom.nodeTypes.CommonSurfaceShader\n         * @x3d x.x\n         * @component Shaders\n         * @extends x3dom.nodeTypes.X3DShaderNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc Implements the Blinn-Phong BRDF with normal mapping and a perfect specular component.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.CommonSurfaceShader.superClass.call(this, ctx);\n\n\n            /**\n             * Texture coordinate channel that contains the tangents in u.\n             * @var {x3dom.fields.SFInt32} tangentTextureCoordinatesId\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue -1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'tangentTextureCoordinatesId', -1);\n\n            /**\n             * Texture coordinate channel that contains the tangents in v.\n             * @var {x3dom.fields.SFInt32} binormalTextureCoordinatesId\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue -1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'binormalTextureCoordinatesId', -1);\n\n            /**\n             * The value of emissiveTexture is multiplied by this value. If no texture is set, the value is used\n             *  directly.\n             * @var {x3dom.fields.SFVec3f} emissiveFactor\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue 0,0,0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'emissiveFactor', 0, 0, 0);\n\n            /**\n             * The texture unit.\n             * @var {x3dom.fields.SFInt32} emissiveTextureId\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue -1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'emissiveTextureId', -1);\n\n            /**\n             * Texture coordinate channel to use for emissiveTexture.\n             * @var {x3dom.fields.SFInt32} emissiveTextureCoordinatesId\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'emissiveTextureCoordinatesId', 0);\n\n            /**\n             * ChannelMask for emissiveTexture in the form of a glsl swizzle (e.g. \"rgb\", \"a\").\n             * @var {x3dom.fields.SFString} emissiveTextureChannelMask\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue 'rgb'\n             * @range [rgb,a,..]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'emissiveTextureChannelMask', 'rgb');\n\n            /**\n             * The value of ambientTexture is multiplied by this value. If no texture is set, the value is used\n             *  directly.\n             * @var {x3dom.fields.SFVec3f} ambientFactor\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue 0.2,0.2,0.2\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'ambientFactor', 0.2, 0.2, 0.2);\n\n            /**\n             * The texture unit.\n             * @var {x3dom.fields.SFInt32} ambientTextureId\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue -1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'ambientTextureId', -1);\n\n            /**\n             * Texture coordinate channel to use for ambientTexture.\n             * @var {x3dom.fields.SFInt32} ambientTextureCoordinatesId\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'ambientTextureCoordinatesId', 0);\n\n            /**\n             * ChannelMask for ambientTexture in the form of a glsl swizzle (e.g. \"rgb\", \"a\").\n             * @var {x3dom.fields.SFString} ambientTextureChannelMask\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue 'rgb'\n             * @range [rgb,a,..]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'ambientTextureChannelMask', 'rgb');\n\n            /**\n             * The value of diffuseTexture is multiplied by this value. If no texture is set, the value is used\n             *  directly.\n             * @var {x3dom.fields.SFVec3f} diffuseFactor\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue 0.8,0.8,0.8\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'diffuseFactor', 0.8, 0.8, 0.8);\n\n            /**\n             * The texture unit.\n             * @var {x3dom.fields.SFInt32} diffuseTextureId\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue -1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'diffuseTextureId', -1);\n\n            /**\n             * Texture coordinate channel to use for diffuseTexture.\n             * @var {x3dom.fields.SFInt32} diffuseTextureCoordinatesId\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'diffuseTextureCoordinatesId', 0);\n\n            /**\n             * ChannelMask for diffuseTexture in the form of a glsl swizzle (e.g. \"rgb\", \"a\").\n             * @var {x3dom.fields.SFString} diffuseTextureChannelMask\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue 'rgb'\n             * @range [rgb,a,..]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'diffuseTextureChannelMask', 'rgb');\n\n            /**\n             * The value of specularTexture is multiplied by this value. If no texture is set, the value is used\n             *  directly.\n             * @var {x3dom.fields.SFVec3f} specularFactor\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue 0,0,0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'specularFactor', 0, 0, 0);\n\n            /**\n             * The texture unit.\n             * @var {x3dom.fields.SFInt32} specularTextureId\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue -1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'specularTextureId', -1);\n\n            /**\n             * Texture coordinate channel to use for specularTexture.\n             * @var {x3dom.fields.SFInt32} specularTextureCoordinatesId\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'specularTextureCoordinatesId', 0);\n\n            /**\n             * ChannelMask for specularTexture in the form of a glsl swizzle (e.g. \"rgb\", \"a\").\n             * @var {x3dom.fields.SFString} specularTextureChannelMask\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue 'rgb'\n             * @range [rgb,a,..]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'specularTextureChannelMask', 'rgb');\n\n            /**\n             * The value of shininessTexture is multiplied by this value. If no texture is set, the value is used\n             *  directly.\n             * @var {x3dom.fields.SFFloat} shininessFactor\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue 0.2\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'shininessFactor', 0.2);\n\n            /**\n             * The texture unit.\n             * @var {x3dom.fields.SFInt32} shininessTextureId\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue -1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'shininessTextureId', -1);\n\n            /**\n             * Texture coordinate channel to use for shininessTexture.\n             * @var {x3dom.fields.SFInt32} shininessTextureCoordinatesId\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'shininessTextureCoordinatesId', 0);\n\n            /**\n             * ChannelMask for shininessTexture in the form of a glsl swizzle (e.g. \"rgb\", \"a\").\n             * @var {x3dom.fields.SFString} shininessTextureChannelMask\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue 'a'\n             * @range [rgb,a,..]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'shininessTextureChannelMask', 'a');\n\n            /**\n             * How normals are stored in normalTexture. Currently only \"UNORM\" (each component packed into a\n             *  [0,1] color channel) is supported.\n             * @var {x3dom.fields.SFString} normalFormat\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue 'UNORM'\n             * @range [UNORM]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'normalFormat', 'UNORM');\n\n            /**\n             * Space in which normals in normalTexture are defined.\n             * @var {x3dom.fields.SFString} normalSpace\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue 'TANGENT'\n             * @range [TANGENT, OBJECT]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'normalSpace', 'TANGENT');\n\n            /**\n             * The texture unit.\n             * @var {x3dom.fields.SFInt32} normalTextureId\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue -1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'normalTextureId', -1);\n\n            /**\n             * Texture coordinate channel to use for normalTexture.\n             * @var {x3dom.fields.SFInt32} normalTextureCoordinatesId\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'normalTextureCoordinatesId', 0);\n\n            /**\n             * ChannelMask for normalTexture in the form of a glsl swizzle (e.g. \"rgb\", \"a\").\n             * @var {x3dom.fields.SFString} normalTextureChannelMask\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue 'rgb'\n             * @range [rgb,a,..]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'normalTextureChannelMask', 'rgb');\n\n            /**\n             * The value of reflectionTexture is multiplied by this value. If no texture is set, the value is used\n             *  directly.\n             * @var {x3dom.fields.SFVec3f} reflectionFactor\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue 0,0,0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'reflectionFactor', 0, 0, 0);\n\n            /**\n             * The texture unit.\n             * @var {x3dom.fields.SFInt32} reflectionTextureId\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue -1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'reflectionTextureId', -1);\n\n            /**\n             * Texture coordinate channel to use for reflectionTexture.\n             * @var {x3dom.fields.SFInt32} reflectionTextureCoordinatesId\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'reflectionTextureCoordinatesId', 0);\n\n            /**\n             * ChannelMask for reflectionTexture in the form of a glsl swizzle (e.g. \"rgb\", \"a\").\n             * @var {x3dom.fields.SFString} reflectionTextureChannelMask\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue 'rgb'\n             * @range [rgb,a,..]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'reflectionTextureChannelMask', 'rgb');\n\n            /**\n             * The value of transmissionTexture is multiplied by this value. If no texture is set, the value is used\n             *  directly.\n             * @var {x3dom.fields.SFVec3f} transmissionFactor\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue 0,0,0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'transmissionFactor', 0, 0, 0);\n\n            /**\n             * The texture unit.\n             * @var {x3dom.fields.SFInt32} transmissionTextureId\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue -1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'transmissionTextureId', -1);\n\n            /**\n             * Texture coordinate channel to use for transmissionTexture.\n             * @var {x3dom.fields.SFInt32} transmissionTextureCoordinatesId\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'transmissionTextureCoordinatesId', 0);\n\n            /**\n             * ChannelMask for transmissionTexture in the form of a glsl swizzle (e.g. \"rgb\", \"a\").\n             * @var {x3dom.fields.SFString} transmissionTextureChannelMask\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue 'rgb'\n             * @range [rgb,a,..]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'transmissionTextureChannelMask', 'rgb');\n\n            /**\n             * The value of environmentTexture is multiplied by this value. If no texture is set, the value is used\n             *  directly.\n             * @var {x3dom.fields.SFVec3f} environmentFactor\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue 1,1,1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'environmentFactor', 1, 1, 1);\n\n            /**\n             * The texture unit.\n             * @var {x3dom.fields.SFInt32} environmentTextureId\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue -1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'environmentTextureId', -1);\n\n            /**\n             * [Currently not used, coordinates are computed in shader.]\n             * @var {x3dom.fields.SFInt32} environmentTextureCoordinatesId\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'environmentTextureCoordinatesId', 0);\n\n            /**\n             * ChannelMask for environmentTexture in the form of a glsl swizzle (e.g. \"rgb\", \"a\").\n             * @var {x3dom.fields.SFString} environmentTextureChannelMask\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue 'rgb'\n             * @range [rgb,a,..]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'environmentTextureChannelMask', 'rgb');\n\n            /**\n             * Relative IOR for perfect specular component.\n             * @var {x3dom.fields.SFFloat} relativeIndexOfRefraction\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue 1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'relativeIndexOfRefraction', 1);\n\n            /**\n             * To what degree the Fresnel equation for dielectrics should be used to blend the perfect specular\n             *  reflection and transmission.\n             * @var {x3dom.fields.SFFloat} fresnelBlend\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'fresnelBlend', 0);\n\n            /**\n             * Axis along which the vertices are displacement\n             * @var {x3dom.fields.SFString} displacementAxis\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue 'y'\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'displacementAxis', 'y');\n\n            /**\n             * Factor for the displacement.\n             * @var {x3dom.fields.SFFloat} displacementFactor\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue 255.0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'displacementFactor', 255.0);\n\n            /**\n             * The texture unit.\n             * @var {x3dom.fields.SFInt32} displacementTextureId\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue -1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'displacementTextureId', -1);\n\n            /**\n             * Texture coordinate channel to use for displacementTexture.\n             * @var {x3dom.fields.SFInt32} displacementTextureCoordinatesId\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'displacementTextureCoordinatesId', 0);\n\n            /**\n             * Texture containing emissive component.\n             * @var {x3dom.fields.SFNode} emissiveTexture\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue x3dom.nodeTypes.X3DTextureNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('emissiveTexture', x3dom.nodeTypes.X3DTextureNode);\n\n            /**\n             * Texture containing ambient component.\n             * @var {x3dom.fields.SFNode} ambientTexture\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue x3dom.nodeTypes.X3DTextureNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('ambientTexture', x3dom.nodeTypes.X3DTextureNode);\n\n            /**\n             * Texture containing diffuse component.\n             * @var {x3dom.fields.SFNode} diffuseTexture\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue x3dom.nodeTypes.X3DTextureNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('diffuseTexture', x3dom.nodeTypes.X3DTextureNode);\n\n            /**\n             * Texture containing specular component.\n             * @var {x3dom.fields.SFNode} specularTexture\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue x3dom.nodeTypes.X3DTextureNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('specularTexture', x3dom.nodeTypes.X3DTextureNode);\n\n            /**\n             * Texture containing shininess component.\n             * @var {x3dom.fields.SFNode} shininessTexture\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue x3dom.nodeTypes.X3DTextureNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('shininessTexture', x3dom.nodeTypes.X3DTextureNode);\n\n            /**\n             * Texture containing normal component for normal mapping.\n             * @var {x3dom.fields.SFNode} normalTexture\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue x3dom.nodeTypes.X3DTextureNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('normalTexture', x3dom.nodeTypes.X3DTextureNode);\n\n            /**\n             * Texture containing reflection component.\n             * @var {x3dom.fields.SFNode} reflectionTexture\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue x3dom.nodeTypes.X3DTextureNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('reflectionTexture', x3dom.nodeTypes.X3DTextureNode);\n\n            /**\n             * Texture containing transmission component.\n             * @var {x3dom.fields.SFNode} transmissionTexture\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue x3dom.nodeTypes.X3DTextureNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('transmissionTexture', x3dom.nodeTypes.X3DTextureNode);\n\n            /**\n             * Cube texture containing the environment for perfect specular reflection and transmission.\n             * @var {x3dom.fields.SFNode} environmentTexture\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue x3dom.nodeTypes.X3DTextureNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('environmentTexture', x3dom.nodeTypes.X3DTextureNode);\n\n            /**\n             * Texture containing displacement component.\n             * @var {x3dom.fields.SFNode} displacementTexture\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue x3dom.nodeTypes.X3DTextureNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('displacementTexture', x3dom.nodeTypes.X3DTextureNode);\n\n            /**\n             * Texture containing diffuse displacement component.\n             * @var {x3dom.fields.SFNode} diffuseDisplacementTexture\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue x3dom.nodeTypes.X3DTextureNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('diffuseDisplacementTexture', x3dom.nodeTypes.X3DTextureNode);\n\n            /**\n             * Multi diffuse alpha texture.\n             * @var {x3dom.fields.SFNode} multiDiffuseAlphaTexture\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue x3dom.nodeTypes.X3DTextureNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('multiDiffuseAlphaTexture', x3dom.nodeTypes.X3DTextureNode);\n\n            /**\n             * Multi specular shininess texture.\n             * @var {x3dom.fields.SFNode} multiSpecularShininessTexture\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue x3dom.nodeTypes.X3DTextureNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('multiSpecularShininessTexture', x3dom.nodeTypes.X3DTextureNode);\n\n            /**\n             * Multi emissive ambientIntensity texture.\n             * @var {x3dom.fields.SFNode} multiEmmisiveAmbientIntensityTexture\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue x3dom.nodeTypes.X3DTextureNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('multiEmissiveAmbientTexture', x3dom.nodeTypes.X3DTextureNode);\n\n            /**\n             * Multi visibility texture.\n             * @var {x3dom.fields.SFNode} multiVisibilityTexture\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue x3dom.nodeTypes.X3DTextureNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('multiVisibilityTexture', x3dom.nodeTypes.X3DTextureNode);\n\n\n            //this.addField_MFBool(ctx, 'textureTransformEnabled', []);     // MFBool NYI\n\n            /**\n             * scale to apply to normal sampled from normalTexture\n             * @var {x3dom.fields.SFVec3f} normalScale\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue 2,2,2\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'normalScale', 2, 2, 2);\n\n            /**\n             * Bias to apply to normal sampled from normalTexture\n             * @var {x3dom.fields.SFVec3f} normalBias\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue -1,-1,1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'normalBias', -1, -1, 1);\n\n            /**\n             * The value of alphaTexture is multiplied by this value. If no texture is set, the value is used directly.\n             * @var {x3dom.fields.SFFloat} alphaFactor\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue 1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'alphaFactor', 1);\n\n            /**\n             * If true, (1-sampledValue) is used as alpha. If false the sampled value is used.\n             * @var {x3dom.fields.SFBool} invertAlphaTexture\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue false\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'invertAlphaTexture', false);\n\n            /**\n             * The texture unit.\n             * @var {x3dom.fields.SFInt32} alphaTextureId\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue -1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'alphaTextureId', -1);\n\n            /**\n             * Texture coordinate channel to use for alphaTexture.\n             * @var {x3dom.fields.SFInt32} alphaTextureCoordinatesId\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'alphaTextureCoordinatesId', 0);\n\n            /**\n             * ChannelMask for alphaTexture in the form of a glsl swizzle (e.g. \"rgb\", \"a\").\n             * @var {x3dom.fields.SFString} alphaTextureChannelMask\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue 'a'\n             * @range [a,rgb,..]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'alphaTextureChannelMask', 'a');\n\n            /**\n             * Texture containing alpha component.\n             * @var {x3dom.fields.SFNode} alphaTexture\n             * @memberof x3dom.nodeTypes.CommonSurfaceShader\n             * @initvalue x3dom.nodeTypes.X3DTextureNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('alphaTexture', x3dom.nodeTypes.X3DTextureNode);\n\n            this._dirty = {\n                // TODO; cp. Shape, allow for dynamic texture updates in gfx\n            };\n        \n        },\n        {\n            getDiffuseMap: function()\n            {\n                if(this._cf.diffuseTexture.node) {\n                    if (x3dom.isa(this._cf.diffuseTexture.node, x3dom.nodeTypes.SurfaceShaderTexture)) {\n                        this._cf.diffuseTexture.node._cf.texture.node._type = \"diffuseMap\";\n                        return this._cf.diffuseTexture.node._cf.texture.node;\n                    } else {\n                        this._cf.diffuseTexture.node._type = \"diffuseMap\";\n                        return this._cf.diffuseTexture.node;\n                    }\n                } else {\n                    return null;\n                }\n            },\n\n            getEnvironmentMap: function()\n            {\n                if(this._cf.environmentTexture.node) {\n                    if (x3dom.isa(this._cf.environmentTexture.node, x3dom.nodeTypes.SurfaceShaderTexture)) {\n                        this._cf.environmentTexture.node._cf.texture.node._type = \"environmentMap\";\n                        return this._cf.environmentTexture.node._cf.texture.node;\n                    } else {\n                        this._cf.environmentTexture.node._type = \"environmentMap\";\n                        return this._cf.environmentTexture.node;\n                    }\n                } else {\n                    return null;\n                }\n            },\n\n            getNormalMap: function()\n            {\n                if(this._cf.normalTexture.node) {\n                    if (x3dom.isa(this._cf.normalTexture.node, x3dom.nodeTypes.SurfaceShaderTexture)) {\n                        this._cf.normalTexture.node._cf.texture.node._type = \"normalMap\";\n                        return this._cf.normalTexture.node._cf.texture.node;\n                    } else {\n                        this._cf.normalTexture.node._type = \"normalMap\";\n                        return this._cf.normalTexture.node;\n                    }\n                } else {\n                    return null;\n                }\n            },\n\n            getAmbientMap: function()\n            {\n                if(this._cf.ambientTexture.node) {\n                    if (x3dom.isa(this._cf.ambientTexture.node, x3dom.nodeTypes.SurfaceShaderTexture)) {\n                        this._cf.ambientTexture.node._cf.texture.node._type = \"ambientMap\";\n                        return this._cf.ambientTexture.node._cf.texture.node;\n                    } else {\n                        this._cf.ambientTexture.node._type = \"ambientMap\";\n                        return this._cf.ambientTexture.node;\n                    }\n                } else {\n                    return null;\n                }\n            },\n\n            getSpecularMap: function()\n            {\n                if(this._cf.specularTexture.node) {\n                    if (x3dom.isa(this._cf.specularTexture.node, x3dom.nodeTypes.SurfaceShaderTexture)) {\n                        this._cf.specularTexture.node._cf.texture.node._type = \"specularMap\";\n                        return this._cf.specularTexture.node._cf.texture.node;\n                    } else {\n                        this._cf.specularTexture.node._type = \"specularMap\";\n                        return this._cf.specularTexture.node;\n                    }\n                } else {\n                    return null;\n                }\n            },\n\n            getShininessMap: function()\n            {\n                if(this._cf.shininessTexture.node) {\n                    if (x3dom.isa(this._cf.shininessTexture.node, x3dom.nodeTypes.SurfaceShaderTexture)) {\n                        this._cf.shininessTexture.node._cf.texture.node._type = \"shininessMap\";\n                        return this._cf.shininessTexture.node._cf.texture.node;\n                    } else {\n                        this._cf.shininessTexture.node._type = \"shininessMap\";\n                        return this._cf.shininessTexture.node;\n                    }\n                } else {\n                    return null;\n                }\n            },\n\n            getAlphaMap: function()\n            {\n                if(this._cf.alphaTexture.node) {\n                    if (x3dom.isa(this._cf.alphaTexture.node, x3dom.nodeTypes.SurfaceShaderTexture)) {\n                        this._cf.alphaTexture.node._cf.texture.node._type = \"alphaMap\";\n                        return this._cf.alphaTexture.node._cf.texture.node;\n                    } else {\n                        this._cf.alphaTexture.node._type = \"alphaMap\";\n                        return this._cf.alphaTexture.node;\n                    }\n                } else {\n                    return null;\n                }\n            },\n\n            getDisplacementMap: function()\n            {\n                if(this._cf.displacementTexture.node) {\n                    if (x3dom.isa(this._cf.displacementTexture.node, x3dom.nodeTypes.SurfaceShaderTexture)) {\n                        this._cf.displacementTexture.node._cf.texture.node._type = \"displacementMap\";\n                        return this._cf.displacementTexture.node._cf.texture.node;\n                    } else {\n                        this._cf.displacementTexture.node._type = \"displacementMap\";\n                        return this._cf.displacementTexture.node;\n                    }\n                } else {\n                    return null;\n                }\n            },\n\n            getDiffuseDisplacementMap: function()\n            {\n                if(this._cf.diffuseDisplacementTexture.node) {\n                    if (x3dom.isa(this._cf.diffuseDisplacementTexture.node, x3dom.nodeTypes.SurfaceShaderTexture)) {\n                        this._cf.diffuseDisplacementTexture.node._cf.texture.node._type = \"diffuseDisplacementMap\";\n                        return this._cf.diffuseDisplacementTexture.node._cf.texture.node;\n                    } else {\n                        this._cf.diffuseDisplacementTexture.node._type = \"diffuseDisplacementMap\";\n                        return this._cf.diffuseDisplacementTexture.node;\n                    }\n                } else {\n                    return null;\n                }\n            },\n\n            getMultiDiffuseAlphaMap: function()\n            {\n                if(this._cf.multiDiffuseAlphaTexture.node) {\n                    if (x3dom.isa(this._cf.multiDiffuseAlphaTexture.node, x3dom.nodeTypes.SurfaceShaderTexture)) {\n                        this._cf.multiDiffuseAlphaTexture.node._cf.texture.node._type = \"multiDiffuseAlphaMap\";\n                        return this._cf.multiDiffuseAlphaTexture.node._cf.texture.node;\n                    } else {\n                        this._cf.multiDiffuseAlphaTexture.node._type = \"multiDiffuseAlphaMap\";\n                        return this._cf.multiDiffuseAlphaTexture.node;\n                    }\n                } else {\n                    return null;\n                }\n            },\n\n            getMultiEmissiveAmbientMap: function()\n            {\n                if(this._cf.multiEmissiveAmbientTexture.node) {\n                    if (x3dom.isa(this._cf.multiEmissiveAmbientTexture.node, x3dom.nodeTypes.SurfaceShaderTexture)) {\n                        this._cf.multiEmissiveAmbientTexture.node._cf.texture.node._type = \"multiEmissiveAmbientMap\";\n                        return this._cf.multiEmissiveAmbientTexture.node._cf.texture.node;\n                    } else {\n                        this._cf.multiEmissiveAmbientTexture.node._type = \"multiEmissiveAmbientMap\";\n                        return this._cf.multiEmissiveAmbientTexture.node;\n                    }\n                } else {\n                    return null;\n                }\n            },\n\n            getMultiSpecularShininessMap: function()\n            {\n                if(this._cf.multiSpecularShininessTexture.node) {\n                    if (x3dom.isa(this._cf.multiSpecularShininessTexture.node, x3dom.nodeTypes.SurfaceShaderTexture)) {\n                        this._cf.multiSpecularShininessTexture.node._cf.texture.node._type = \"multiSpecularShininessMap\";\n                        return this._cf.multiSpecularShininessTexture.node._cf.texture.node;\n                    } else {\n                        this._cf.multiSpecularShininessTexture.node._type = \"multiSpecularShininessMap\";\n                        return this._cf.multiSpecularShininessTexture.node;\n                    }\n                } else {\n                    return null;\n                }\n            },\n\n            getMultiVisibilityMap: function()\n            {\n                if(this._cf.multiVisibilityTexture.node) {\n                    if (x3dom.isa(this._cf.multiVisibilityTexture.node, x3dom.nodeTypes.SurfaceShaderTexture)) {\n                        this._cf.multiVisibilityTexture.node._cf.texture.node._type = \"multiVisibilityMap\";\n                        return this._cf.multiVisibilityTexture.node._cf.texture.node;\n                    } else {\n                        this._cf.multiVisibilityTexture.node._type = \"multiVisibilityMap\";\n                        return this._cf.multiVisibilityTexture.node;\n                    }\n                } else {\n                    return null;\n                }\n            },\n\n            getTextures: function()\n            {\n                var textures = [];\n\n                var diff = this.getDiffuseMap();\n                if(diff) textures.push(diff);\n\n                var norm = this.getNormalMap();\n                if(norm) textures.push(norm);\n\n                var spec = this.getSpecularMap();\n                if(spec) textures.push(spec);\n\n                var shin = this.getShininessMap();\n                if(shin) textures.push(shin);\n\n                var env = this.getEnvironmentMap();\n                if(env) textures.push(env);\n\n                var displacement = this.getDisplacementMap();\n                if(displacement) textures.push(displacement);\n\n                var diffuseDisplacement = this.getDiffuseDisplacementMap();\n                if(diffuseDisplacement) textures.push(diffuseDisplacement);\n\n                var multiDiffuseAlpha = this.getMultiDiffuseAlphaMap();\n                if(multiDiffuseAlpha) textures.push(multiDiffuseAlpha);\n\n                var multiEmissiveAmbient = this.getMultiEmissiveAmbientMap();\n                if(multiEmissiveAmbient) textures.push(multiEmissiveAmbient);\n\n                var multiSpecularShininess = this.getMultiSpecularShininessMap();\n                if(multiSpecularShininess) textures.push(multiSpecularShininess);\n\n                var multiVisibility = this.getMultiVisibilityMap();\n                if(multiVisibility) textures.push(multiVisibility);\n\n                return textures;\n            },\n\n            needTexcoords: function()\n            {\n\n               return ( this.getDiffuseMap()      || this.getNormalMap()    ||\n                        this.getSpecularMap()     || this.getShininessMap() ||\n                        this.getDisplacementMap() || this.getDiffuseDisplacementMap() ||\n                        this.getEnvironmentMap() ) ? true : false;\n\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### ComposedShader ### */\nx3dom.registerNodeType(\n    \"ComposedShader\",\n    \"Shaders\",\n    defineClass(x3dom.nodeTypes.X3DShaderNode,\n        \n        /**\n         * Constructor for ComposedShader\n         * @constructs x3dom.nodeTypes.ComposedShader\n         * @x3d 3.3\n         * @component Shaders\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DShaderNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The ComposedShader node defines a shader where the individual source files are not individually\n         *  programmable. All access to the shading capabilities is defined through a single interface that applies to\n         *  all parts.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.ComposedShader.superClass.call(this, ctx);\n\n\n            /**\n             * Contains all fields of shader parts.\n             * @var {x3dom.fields.MFNode} fields\n             * @memberof x3dom.nodeTypes.ComposedShader\n             * @initvalue x3dom.nodeTypes.Field\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFNode('fields', x3dom.nodeTypes.Field);\n\n            /**\n             * List of shader parts.\n             * @var {x3dom.fields.MFNode} parts\n             * @memberof x3dom.nodeTypes.ComposedShader\n             * @initvalue x3dom.nodeTypes.ShaderPart\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFNode('parts', x3dom.nodeTypes.ShaderPart);\n\n            // shortcut to shader parts\n            this._vertex = null;\n            this._fragment = null;\n            this._id = null;\n\n            if (!x3dom.nodeTypes.ComposedShader.ShaderInfoMsgShown) {\n                x3dom.debug.logInfo(\"Current ComposedShader node implementation limitations:\\n\" +\n                    \"Vertex attributes (if given in the standard X3D fields 'coord', 'color', \" +\n                    \"'normal', 'texCoord'), matrices and texture are provided as follows...\\n\" +\n                    \"(see also <a href='http://x3dom.org/x3dom/doc/help/composedShader.html'>\" +\n                    \"http://x3dom.org/x3dom/doc/help/composedShader.html</a>)\\n\" +\n                    \"    attribute vec3 position;\\n\" +\n                    \"    attribute vec3 normal;\\n\" +\n                    \"    attribute vec2 texcoord;\\n\" +\n                    \"    attribute vec3 color;\\n\" +\n                    \"    uniform mat4 modelViewProjectionMatrix;\\n\" +\n                    \"    uniform mat4 modelViewMatrix;\\n\" +\n                    \"    uniform mat4 normalMatrix;\\n\" +\n                    \"    uniform mat4 viewMatrix;\\n\" +\n                    \"    uniform sampler2D tex;\\n\");\n                x3dom.nodeTypes.ComposedShader.ShaderInfoMsgShown = true;\n            }\n        \n        },\n        {\n            nodeChanged: function()\n            {\n                var i, n = this._cf.parts.nodes.length;\n\n                for (i=0; i<n; i++)\n                {\n                    if (this._cf.parts.nodes[i]._vf.type.toLowerCase() == 'vertex') {\n                        this._vertex = this._cf.parts.nodes[i];\n                        this._id = this._cf.parts.nodes[i]._id;\n                    }\n                    else if (this._cf.parts.nodes[i]._vf.type.toLowerCase() == 'fragment') {\n                        this._fragment = this._cf.parts.nodes[i];\n                        this._id += \" - \" + this._cf.parts.nodes[i]._id;\n                    }\n                }\n\n                var ctx = {};\n                n = this._cf.fields.nodes.length;\n\n                for (i=0; i<n; i++)\n                {\n                    var fieldName = this._cf.fields.nodes[i]._vf.name;\n                    ctx.xmlNode = this._cf.fields.nodes[i]._xmlNode;\n\n                    var needNode = false;\n\n                    if (ctx.xmlNode === undefined || ctx.xmlNode === null) {\n                        ctx.xmlNode = document.createElement(\"field\");\n                        needNode = true;\n                    }\n\n                    ctx.xmlNode.setAttribute(fieldName, this._cf.fields.nodes[i]._vf.value);\n\n                    var funcName = \"this.addField_\" + this._cf.fields.nodes[i]._vf.type + \"(ctx, name);\";\n                    var func = new Function('ctx', 'name', funcName);\n\n                    func.call(this, ctx, fieldName);\n\n                    if (needNode) {\n                        ctx.xmlNode = null;    // cleanup\n                    }\n                }\n\n                Array.forEach(this._parentNodes, function (app) {\n                    Array.forEach(app._parentNodes, function (shape) {\n                        //shape.setAppDirty();\n                        if (shape._cleanupGLObjects)\n                            shape._cleanupGLObjects();\n                        shape.setAllDirty();\n                    });\n                });\n            },\n\n            fieldChanged: function(fieldName)\n            {\n                var i, n = this._cf.fields.nodes.length;\n\n                for (i=0; i<n; i++)\n                {\n                    var field = this._cf.fields.nodes[i]._vf.name;\n\n                    if (field === fieldName)\n                    {\n                        var msg = this._cf.fields.nodes[i]._vf.value;\n\n                        try {\n                            this._vf[field].setValueByStr(msg);\n                        }\n                        catch (exc1) {\n                            try {\n                                switch ((typeof(this._vf[field])).toString()) {\n                                    case \"number\":\n                                        this._vf[field] = +msg;\n                                        break;\n                                    case \"boolean\":\n                                        this._vf[field] = (msg.toLowerCase() === \"true\");\n                                        break;\n                                    case \"string\":\n                                        this._vf[field] = msg;\n                                        break;\n                                }\n                            }\n                            catch (exc2) {\n                                x3dom.debug.logError(\"setValueByStr() NYI for \" + typeof(this._vf[field]));\n                            }\n                        }\n\n                        break;\n                    }\n                }\n\n                if (fieldName === 'url')\n                {\n                    for (i=0; i<n; i++)\n                    {\n                        if (this._cf.parts.nodes[i]._vf.type.toLowerCase() == 'vertex') {\n                            this._vertex = this._cf.parts.nodes[i];\n                            this._id = this._cf.parts.nodes[i]._id;\n                        }\n                        else if (this._cf.parts.nodes[i]._vf.type.toLowerCase() == 'fragment') {\n                            this._fragment = this._cf.parts.nodes[i];\n                            this._id += \" - \" + this._cf.parts.nodes[i]._id;\n                        }\n                    }\n\n                    Array.forEach(this._parentNodes, function (app) {\n                        Array.forEach(app._parentNodes, function (shape) {\n                            if (shape._cleanupGLObjects)\n                            {\n                                shape._cleanupGLObjects();\n                            }\n                            shape.setAllDirty();\n                        });\n                    });\n                }\n            },\n\n            parentAdded: function(parent)\n            {\n                //Array.forEach(this._parentNodes, function (app) {\n                //\tapp.nodeChanged();\n                //});\n                parent.nodeChanged();\n            }\n        }\n    )\n);\n\nx3dom.nodeTypes.ComposedShader.ShaderInfoMsgShown = false;\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### ShaderPart ### */\nx3dom.registerNodeType(\n    \"ShaderPart\",\n    \"Shaders\",\n    defineClass(x3dom.nodeTypes.X3DNode,\n        \n        /**\n         * Constructor for ShaderPart\n         * @constructs x3dom.nodeTypes.ShaderPart\n         * @x3d 3.3\n         * @component Shaders\n         * @status full\n         * @extends x3dom.nodeTypes.X3DNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The ShaderPart node defines the source for a single object to be used by a ComposedShader node.\n         *  The source is not required to be a complete shader for all of the vertex/fragment processing.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.ShaderPart.superClass.call(this, ctx);\n\n\n            /**\n             * The shader source is read from the URL specified by the url field. When the url field contains no values\n             *  ([]), this object instance is ignored.\n             * @var {x3dom.fields.MFString} url\n             * @memberof x3dom.nodeTypes.ShaderPart\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFString(ctx, 'url', []);\n\n            /**\n             * The type field indicates whether this object shall be compiled as a vertex shader, fragment shader, or\n             *  other future-defined shader type.\n             * @var {x3dom.fields.SFString} type\n             * @memberof x3dom.nodeTypes.ShaderPart\n             * @initvalue \"VERTEX\"\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFString(ctx, 'type', \"VERTEX\");\n\n            this._id = (ctx && ctx.xmlNode && ctx.xmlNode.id != \"\") ?\n                ctx.xmlNode.id : ++x3dom.nodeTypes.Shape.shaderPartID;\n\n            x3dom.debug.assert(this._vf.type.toLowerCase() == 'vertex' ||\n                               this._vf.type.toLowerCase() == 'fragment',\n                               \"Unknown shader part type!\");\n        },\n        {\n            nodeChanged: function()\n            {\n                var ctx = {};\n                ctx.xmlNode = this._xmlNode;\n\n                if (ctx.xmlNode !== undefined && ctx.xmlNode !== null)\n                {\n                    var that = this;\n\n                    if (that._vf.url.length && that._vf.url[0].indexOf('\\n') == -1)\n                    {\n                        var xhr        = new XMLHttpRequest(),\n                            url        = that._nameSpace.getURL(that._vf.url[0]);\n                            originalID = that._id;\n\n\n                        that._id = \"default\";\n                        that._vf.url = new x3dom.fields.MFString( [ this._getDefaultShader() ] );                      \n\n                        xhr.open(\"GET\", url, false);\n                        xhr.onload = function() {\n                            that._vf.url = new x3dom.fields.MFString( [] );\n                            that._vf.url.push(xhr.response);\n                            that._id = originalID;\n                            that.fieldChanged(\"url\");\n                        };\n                        xhr.onerror = function() {\n                            x3dom.debug.logError(\"Could not load file '\" + that._vf.url[0] + \"'.\");\n                        };\n                        //xhr.send(null);\n                        x3dom.RequestManager.addRequest( xhr );\n                    }\n                    else\n                    {\n                        if (that._vf.url.length) {\n                            that._vf.url = new x3dom.fields.MFString( [] );\n                        }\n                        try {\n                            that._vf.url.push(ctx.xmlNode.childNodes[1].nodeValue);\n                            ctx.xmlNode.removeChild(ctx.xmlNode.childNodes[1]);\n                        }\n                        catch(e) {\n                            Array.forEach( ctx.xmlNode.childNodes, function (childDomNode) {\n                                if (childDomNode.nodeType === 3) {\n                                    that._vf.url.push(childDomNode.nodeValue);\n                                }\n                                else if (childDomNode.nodeType === 4) {\n                                    that._vf.url.push(childDomNode.data);\n                                }\n                                childDomNode.parentNode.removeChild(childDomNode);\n                            } );\n                        }\n                    }\n                }\n                // else hope that url field was already set somehow\n\n                Array.forEach(this._parentNodes, function (shader) {\n                    shader.nodeChanged();\n                });\n            },\n\n            fieldChanged: function(fieldName)\n            {\n                if (fieldName === \"url\") {\n                    Array.forEach(this._parentNodes, function (shader) {\n                        shader.fieldChanged(\"url\");\n                    });\n                }\n            },\n\n            parentAdded: function(parent)\n            {\n                //Array.forEach(this._parentNodes, function (shader) {\n                //\tshader.nodeChanged();\n                //});\n                parent.nodeChanged();\n            },\n\n            _getDefaultShader : function()\n            {\n                if( this._vf.type.toLowerCase() == 'vertex' )\n                {\n                    return  \"attribute vec3 position;\\n\" +\n                            \"uniform mat4 modelViewProjectionMatrix;\\n\" +\n                            \"void main(void) {\\n\" +\n                            \"    gl_Position = modelViewProjectionMatrix * vec4(position, 1.0);\\n\" +\n                            \"}\\n\";\n                }\n\n                if( this._vf.type.toLowerCase() == 'fragment' )\n                {\n                    return  \"precision highp float;\\n\" +\n                            \"void main(void) {\\n\" +\n                            \"    gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\\n\" +\n                            \"}\\n\";\n                }\n\n                \n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### X3DVertexAttributeNode ### */\nx3dom.registerNodeType(\n    \"X3DVertexAttributeNode\",\n    \"Shaders\",\n    defineClass(x3dom.nodeTypes.X3DGeometricPropertyNode,\n        \n        /**\n         * Constructor for X3DVertexAttributeNode\n         * @constructs x3dom.nodeTypes.X3DVertexAttributeNode\n         * @x3d 3.3\n         * @component Shaders\n         * @status full\n         * @extends x3dom.nodeTypes.X3DGeometricPropertyNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc This abstract node type is the base type for all node types that specify per-vertex attribute\n         *  information to the shader.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DVertexAttributeNode.superClass.call(this, ctx);\n\n\n            /**\n             * The name field describes a name that is mapped to the shading language-specific name for describing\n             *  per-vertex data. The appropriate shader language annex contains language-specific binding information.\n             * @var {x3dom.fields.SFString} name\n             * @memberof x3dom.nodeTypes.X3DVertexAttributeNode\n             * @initvalue \"\"\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFString(ctx, 'name', \"\");\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### FloatVertexAttribute ### */\nx3dom.registerNodeType(\n    \"FloatVertexAttribute\",\n    \"Shaders\",\n    defineClass(x3dom.nodeTypes.X3DVertexAttributeNode,\n        \n        /**\n         * Constructor for FloatVertexAttribute\n         * @constructs x3dom.nodeTypes.FloatVertexAttribute\n         * @x3d 3.3\n         * @component Shaders\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DVertexAttributeNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The FloatVertexAttribute node defines a set of per-vertex single-precision floating point\n         *  attributes.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.FloatVertexAttribute.superClass.call(this, ctx);\n\n\n            /**\n             * The numComponents field specifies how many consecutive floating point values should be grouped together\n             *  per vertex. The length of the value field shall be a multiple of numComponents.\n             * @var {x3dom.fields.SFInt32} numComponents\n             * @memberof x3dom.nodeTypes.FloatVertexAttribute\n             * @initvalue 4\n             * @range [1..4]\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'numComponents', 4);\n\n            /**\n             * The value field specifies an arbitrary collection of floating point values that will be passed to the\n             *  shader as per-vertex information. The specific type mapping to the individual shading language data\n             *  types is in the appropriate language-specific annex.\n             * @var {x3dom.fields.MFFloat} value\n             * @memberof x3dom.nodeTypes.FloatVertexAttribute\n             * @initvalue []\n             * @range (-inf, inf)\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFFloat(ctx, 'value', []);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### X3DSpatialGeometryNode ### */\nx3dom.registerNodeType(\n    \"X3DSpatialGeometryNode\",\n    \"Geometry3D\",\n    defineClass(x3dom.nodeTypes.X3DGeometryNode,\n        \n        /**\n         * Constructor for X3DSpatialGeometryNode\n         * @constructs x3dom.nodeTypes.X3DSpatialGeometryNode\n         * @x3d x.x\n         * @component Geometry3D\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc This is the abstract node for spatial geometry nodes.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DSpatialGeometryNode.superClass.call(this, ctx);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### Plane ### */\nx3dom.registerNodeType(\n    \"Plane\",\n    \"Geometry3D\",\n    defineClass(x3dom.nodeTypes.X3DSpatialGeometryNode,\n        \n        /**\n         * Constructor for Plane\n         * @constructs x3dom.nodeTypes.Plane\n         * @x3d x.x\n         * @component Geometry3D\n         * @extends x3dom.nodeTypes.X3DSpatialGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @class The plane node describes a plane shape that extents in x and y direction.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Plane.superClass.call(this, ctx);\n\n\n            /**\n             * The edge lengths of the plane.\n             * @var {x3dom.fields.SFVec2f} size\n             * @memberof x3dom.nodeTypes.Plane\n             * @initvalue 2,2\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec2f(ctx, 'size', 2, 2);\n\n            /**\n             * Defines the number of single elements that are generated to represent the plane.\n             * @var {x3dom.fields.SFVec2f} subdivision\n             * @memberof x3dom.nodeTypes.Plane\n             * @initvalue 1,1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec2f(ctx, 'subdivision', 1, 1);\n\n            /**\n             * Defines the center point in the local coordinate system.\n             * @var {x3dom.fields.SFVec3f} center\n             * @memberof x3dom.nodeTypes.Plane\n             * @initvalue 0,0,0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'center', 0, 0, 0);\n\n            /**\n             * Specifies the primitive type that is used to build the plane.\n             * @var {x3dom.fields.MFString} primType\n             * @memberof x3dom.nodeTypes.Plane\n             * @initvalue ['TRIANGLES']\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFString(ctx, 'primType', ['TRIANGLES']);\n\n            // this way currently an initialize only field\n            if (this._vf.primType.length)\n                this._mesh._primType = this._vf.primType[0];\n\n            var sx = this._vf.size.x, sy = this._vf.size.y;\n            var subx = this._vf.subdivision.x, suby = this._vf.subdivision.y;\n\n            var geoCacheID = 'Plane_' + sx + '-' + sy + '-' + subx + '-' + suby + '-' +\n                this._vf.center.x + '-' + this._vf.center.y + '-' + this._vf.center.z;\n\n            // Attention: DynamicLOD node internally creates Plane nodes, but MUST NOT\n            //            use geoCache, therefore only use cache if \"ctx\" is defined!\n            // TODO: move mesh generation of all primitives to nodeChanged()\n            if (ctx && this._vf.useGeoCache && x3dom.geoCache[geoCacheID] !== undefined) {\n                //x3dom.debug.logInfo(\"Using Plane from Cache\");\n                this._mesh = x3dom.geoCache[geoCacheID];\n            }\n            else {\n                var x = 0, y = 0;\n                var xstep = sx / subx;\n                var ystep = sy / suby;\n\n                sx /= 2; sy /= 2;\n\n                for (y = 0; y <= suby; y++) {\n                    for (x = 0; x <= subx; x++) {\n                        this._mesh._positions[0].push(this._vf.center.x + x * xstep - sx);\n                        this._mesh._positions[0].push(this._vf.center.y + y * ystep - sy);\n                        this._mesh._positions[0].push(this._vf.center.z);\n                        this._mesh._normals[0].push(0);\n                        this._mesh._normals[0].push(0);\n                        this._mesh._normals[0].push(1);\n                        this._mesh._texCoords[0].push(x / subx);\n                        this._mesh._texCoords[0].push(y / suby);\n                    }\n                }\n\n                for (y = 1; y <= suby; y++) {\n                    for (x = 0; x < subx; x++) {\n                        this._mesh._indices[0].push((y - 1) * (subx + 1) + x);\n                        this._mesh._indices[0].push((y - 1) * (subx + 1) + x + 1);\n                        this._mesh._indices[0].push(y * (subx + 1) + x);\n\n                        this._mesh._indices[0].push(y * (subx + 1) + x);\n                        this._mesh._indices[0].push((y - 1) * (subx + 1) + x + 1);\n                        this._mesh._indices[0].push(y * (subx + 1) + x + 1);\n                    }\n                }\n\n                this._mesh._invalidate = true;\n                this._mesh._numFaces = this._mesh._indices[0].length / 3;\n                this._mesh._numCoords = this._mesh._positions[0].length / 3;\n\n                x3dom.geoCache[geoCacheID] = this._mesh;\n            }\n        \n        },\n        {\n            fieldChanged: function (fieldName) {\n                if (fieldName == \"size\" || fieldName == \"center\") {\n                    this._mesh._positions[0] = [];\n\n                    var sx = this._vf.size.x, sy = this._vf.size.y;\n                    var subx = this._vf.subdivision.x, suby = this._vf.subdivision.y;\n                    var x = 0, y = 0;\n                    var xstep = sx / subx;\n                    var ystep = sy / suby;\n\n                    sx /= 2; sy /= 2;\n\n                    for (y = 0; y <= suby; y++) {\n                        for (x = 0; x <= subx; x++) {\n                            this._mesh._positions[0].push(this._vf.center.x + x * xstep - sx);\n                            this._mesh._positions[0].push(this._vf.center.y + y * ystep - sy);\n                            this._mesh._positions[0].push(this._vf.center.z);\n                        }\n                    }\n\n                    this.invalidateVolume();\n                    this._mesh._numCoords = this._mesh._positions[0].length / 3;\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.positions = true;\n                        node.invalidateVolume();\n                    });\n                }\n                else if (fieldName == \"subdivision\") {\n                    this._mesh._positions[0] = [];\n                    this._mesh._indices[0] = [];\n                    this._mesh._normals[0] = [];\n                    this._mesh._texCoords[0] = [];\n\n                    var sx = this._vf.size.x, sy = this._vf.size.y;\n                    var subx = this._vf.subdivision.x, suby = this._vf.subdivision.y;\n\n                    var x = 0, y = 0;\n                    var xstep = sx / subx;\n                    var ystep = sy / suby;\n\n                    sx /= 2; sy /= 2;\n\n                    for (y = 0; y <= suby; y++) {\n                        for (x = 0; x <= subx; x++) {\n                            this._mesh._positions[0].push(this._vf.center.x + x * xstep - sx);\n                            this._mesh._positions[0].push(this._vf.center.y + y * ystep - sy);\n                            this._mesh._positions[0].push(this._vf.center.z);\n                            this._mesh._normals[0].push(0);\n                            this._mesh._normals[0].push(0);\n                            this._mesh._normals[0].push(1);\n                            this._mesh._texCoords[0].push(x / subx);\n                            this._mesh._texCoords[0].push(y / suby);\n                        }\n                    }\n\n                    for (y = 1; y <= suby; y++) {\n                        for (x = 0; x < subx; x++) {\n                            this._mesh._indices[0].push((y - 1) * (subx + 1) + x);\n                            this._mesh._indices[0].push((y - 1) * (subx + 1) + x + 1);\n                            this._mesh._indices[0].push(y * (subx + 1) + x);\n\n                            this._mesh._indices[0].push(y * (subx + 1) + x);\n                            this._mesh._indices[0].push((y - 1) * (subx + 1) + x + 1);\n                            this._mesh._indices[0].push(y * (subx + 1) + x + 1);\n                        }\n                    }\n\n                    this.invalidateVolume();\n                    this._mesh._numFaces = this._mesh._indices[0].length / 3;\n                    this._mesh._numCoords = this._mesh._positions[0].length / 3;\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node.setAllDirty();\n                        node.invalidateVolume();\n                    });\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### Box ### */\nx3dom.registerNodeType(\n    \"Box\",\n    \"Geometry3D\",\n    defineClass(x3dom.nodeTypes.X3DSpatialGeometryNode,\n        \n        /**\n         * Constructor for Box\n         * @constructs x3dom.nodeTypes.Box\n         * @x3d 3.3\n         * @component Geometry3D\n         * @status full\n         * @extends x3dom.nodeTypes.X3DSpatialGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The Box node specifies a rectangular parallelepiped box centred at (0, 0, 0) in the local coordinate system and aligned with the local coordinate axes. By default, the box measures 2 units in each dimension, from -1 to +1.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Box.superClass.call(this, ctx);\n\n\n            /**\n             * The size field specifies the extents of the box along the X-, Y-, and Z-axes respectively and each component value shall be greater than zero.\n             * @var {x3dom.fields.SFVec3f} size\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.Box\n             * @initvalue 2,2,2\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'size', 2, 2, 2);\n\n            /**\n             * Specifies whether helper colors should be used, which will color each vertex with a different color. This will overwrite the color of the corresponding appearance node.\n             * @var {x3dom.fields.SFBool} hasHelperColors\n             * @memberof x3dom.nodeTypes.Box\n             * @initvalue false\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'hasHelperColors', false);\n\n            var sx = this._vf.size.x,\n                sy = this._vf.size.y,\n                sz = this._vf.size.z;\n\n            var geoCacheID = 'Box_'+sx+'-'+sy+'-'+sz;\n\n            if( this._vf.useGeoCache && x3dom.geoCache[geoCacheID] !== undefined )\n            {\n                //x3dom.debug.logInfo(\"Using Box from Cache\");\n                this._mesh = x3dom.geoCache[geoCacheID];\n            }\n            else\n            {\n                sx /= 2; sy /= 2; sz /= 2;\n\n                this._mesh._positions[0] = [\n                    -sx,-sy,-sz,  -sx, sy,-sz,   sx, sy,-sz,   sx,-sy,-sz, //hinten 0,0,-1\n                    -sx,-sy, sz,  -sx, sy, sz,   sx, sy, sz,   sx,-sy, sz, //vorne 0,0,1\n                    -sx,-sy,-sz,  -sx,-sy, sz,  -sx, sy, sz,  -sx, sy,-sz, //links -1,0,0\n                    sx,-sy,-sz,   sx,-sy, sz,   sx, sy, sz,   sx, sy,-sz, //rechts 1,0,0\n                    -sx, sy,-sz,  -sx, sy, sz,   sx, sy, sz,   sx, sy,-sz, //oben 0,1,0\n                    -sx,-sy,-sz,  -sx,-sy, sz,   sx,-sy, sz,   sx,-sy,-sz  //unten 0,-1,0\n                ];\n                this._mesh._normals[0] = [\n                    0,0,-1,  0,0,-1,   0,0,-1,   0,0,-1,\n                    0,0,1,  0,0,1,   0,0,1,   0,0,1,\n                    -1,0,0,  -1,0,0,  -1,0,0,  -1,0,0,\n                    1,0,0,   1,0,0,   1,0,0,   1,0,0,\n                    0,1,0,  0,1,0,   0,1,0,   0,1,0,\n                    0,-1,0,  0,-1,0,   0,-1,0,   0,-1,0\n                ];\n                this._mesh._texCoords[0] = [\n                    1,0, 1,1, 0,1, 0,0,\n                    0,0, 0,1, 1,1, 1,0,\n                    0,0, 1,0, 1,1, 0,1,\n                    1,0, 0,0, 0,1, 1,1,\n                    0,1, 0,0, 1,0, 1,1,\n                    0,0, 0,1, 1,1, 1,0\n                ];\n                if (this._vf.hasHelperColors) {\n                    this._mesh._colors[0] = [\n                        0, 0, 0,  0, 1, 0,  1, 1, 0,  1, 0, 0,\n                        0, 0, 1,  0, 1, 1,  1, 1, 1,  1, 0, 1,\n                        0, 0, 0,  0, 0, 1,  0, 1, 1,  0, 1, 0,\n                        1, 0, 0,  1, 0, 1,  1, 1, 1,  1, 1, 0,\n                        0, 1, 0,  0, 1, 1,  1, 1, 1,  1, 1, 0,\n                        0, 0, 0,  0, 0, 1,  1, 0, 1,  1, 0, 0\n                    ];\n                }\n                this._mesh._indices[0] = [\n                    0,1,2, 2,3,0,\n                    4,7,5, 5,7,6,\n                    8,9,10, 10,11,8,\n                    12,14,13, 14,12,15,\n                    16,17,18, 18,19,16,\n                    20,22,21, 22,20,23\n                ];\n                this._mesh._invalidate = true;\n                this._mesh._numFaces = 12;\n                this._mesh._numCoords = 24;\n\n                x3dom.geoCache[geoCacheID] = this._mesh;\n            }\n        \n        },\n        {\n            fieldChanged: function (fieldName)\n            {\n                if (fieldName === \"size\") {\n                    var sx = this._vf.size.x / 2,\n                        sy = this._vf.size.y / 2,\n                        sz = this._vf.size.z / 2;\n\n                    this._mesh._positions[0] = [\n                        -sx,-sy,-sz,  -sx, sy,-sz,   sx, sy,-sz,   sx,-sy,-sz, //back   0,0,-1\n                        -sx,-sy, sz,  -sx, sy, sz,   sx, sy, sz,   sx,-sy, sz, //front  0,0,1\n                        -sx,-sy,-sz,  -sx,-sy, sz,  -sx, sy, sz,  -sx, sy,-sz, //left   -1,0,0\n                        sx,-sy,-sz,   sx,-sy, sz,   sx, sy, sz,   sx, sy,-sz, //right  1,0,0\n                        -sx, sy,-sz,  -sx, sy, sz,   sx, sy, sz,   sx, sy,-sz, //top    0,1,0\n                        -sx,-sy,-sz,  -sx,-sy, sz,   sx,-sy, sz,   sx,-sy,-sz  //bottom 0,-1,0\n                    ];\n\n                    this.invalidateVolume();\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.positions = true;\n                        node.invalidateVolume();\n                    });\n                }\n                else if (fieldName === \"hasHelperColors\") {\n                    if (this._vf.hasHelperColors) {\n                        this._mesh._colors[0] = [\n                            0, 0, 0,  0, 1, 0,  1, 1, 0,  1, 0, 0,\n                            0, 0, 1,  0, 1, 1,  1, 1, 1,  1, 0, 1,\n                            0, 0, 0,  0, 0, 1,  0, 1, 1,  0, 1, 0,\n                            1, 0, 0,  1, 0, 1,  1, 1, 1,  1, 1, 0,\n                            0, 1, 0,  0, 1, 1,  1, 1, 1,  1, 1, 0,\n                            0, 0, 0,  0, 0, 1,  1, 0, 1,  1, 0, 0\n                        ];\n                    }\n                    else {\n                        this._mesh._colors[0] = [];\n                    }\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.colors = true;\n                    });\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### Sphere ### */\nx3dom.registerNodeType(\n    \"Sphere\",\n    \"Geometry3D\",\n    defineClass(x3dom.nodeTypes.X3DSpatialGeometryNode,\n        \n        /**\n         * Constructor for Sphere\n         * @constructs x3dom.nodeTypes.Sphere\n         * @x3d 3.3\n         * @component Geometry3D\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DSpatialGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The Sphere node specifies a sphere centred at (0, 0, 0) in the local coordinate system.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Sphere.superClass.call(this, ctx);\n\n            // sky box background creates sphere with r = 10000\n\n            /**\n             * The radius field specifies the radius of the sphere.\n             * @var {x3dom.fields.SFFloat} radius\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.Sphere\n             * @initvalue ctx?1:10000\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'radius', ctx ? 1 : 1000);\n\n            /**\n             * Specifies the number of faces that are generated to approximate the surface of the sphere.\n             * @var {x3dom.fields.SFVec2f} subdivision\n             * @memberof x3dom.nodeTypes.Sphere\n             * @initvalue 24,24\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec2f(ctx, 'subdivision', 24, 24);\n        \n            this._qfactors = {\n                \"low\": 0.3,\n                \"medium\": 0.5,\n                \"high\": 1.0\n            };\n            \n            if (ctx === undefined) this.nodeChanged(); // for background\n        },\n        {\n            nodeChanged: function()\n            {\n                var qfactor = 1.0;\n                if(this._nameSpace) {\n                    qfactor = this._nameSpace.doc.properties.getProperty(\"PrimitiveQuality\", \"Medium\");\n                }\n                if (x3dom.Utils.isNumber(qfactor)) {\n                    qfactor = parseFloat(qfactor);\n                } \n                else {\n                    qfactor = this._qfactors[qfactor.toLowerCase()] || 0.5;\n                }\n\n                this._quality = qfactor;\n                \n                var r = this._vf.radius;\n                var subx = this._vf.subdivision.x, suby = this._vf.subdivision.y;\n\n                var geoCacheID = 'Sphere_' + r + '-' + subx + '-' + suby;\n\n                if (this._vf.useGeoCache && x3dom.geoCache[geoCacheID] !== undefined) {\n                    //x3dom.debug.logInfo(\"Using Sphere from Cache\");\n                    this._mesh = x3dom.geoCache[geoCacheID];\n                    return;\n                }\n                \n                this._regenerateMesh();\n                \n                this._mesh._invalidate = true;\n                this._mesh._numFaces = this._mesh._indices[0].length / 3;\n                this._mesh._numCoords = this._mesh._positions[0].length / 3;\n\n                x3dom.geoCache[geoCacheID] = this._mesh;\n            },\n        \n            _regenerateMesh: function()\n            {\n                this._mesh._positions[0] = [];\n                this._mesh._indices[0] =[];\n                this._mesh._normals[0] = [];\n                this._mesh._texCoords[0] =[];\n                var r = this._vf.radius;\n                var subx = this._vf.subdivision.x, suby = this._vf.subdivision.y;\n                var latNumber, longNumber;\n                var latitudeBands = Math.floor(subx * this._quality);\n                var longitudeBands = Math.floor(suby * this._quality);\n\n                var theta, sinTheta, cosTheta;\n                var phi, sinPhi, cosPhi;\n                var coord, u, v;\n\n                for (latNumber = 0; latNumber <= latitudeBands; latNumber++) {\n                    theta = (latNumber * Math.PI) / latitudeBands;\n                    sinTheta = Math.sin(theta);\n                    cosTheta = Math.cos(theta);\n\n                    for (longNumber = 0; longNumber <= longitudeBands; longNumber++) {\n                        coord = this._calcXYZ(longNumber, longitudeBands, sinTheta, cosTheta);\n\n                        u = this._uFromlong(longNumber, longitudeBands);\n                        v = latNumber / latitudeBands;\n\n                        this._mesh._positions[0].push(r * coord.x);\n                        this._mesh._positions[0].push(r * coord.y);\n                        this._mesh._positions[0].push(r * coord.z);\n                        this._mesh._normals[0].push(coord.x);\n                        this._mesh._normals[0].push(coord.y);\n                        this._mesh._normals[0].push(coord.z);\n                        this._mesh._texCoords[0].push(u);\n                        this._mesh._texCoords[0].push(v);\n                    }\n                }\n\n                var first, second;\n\n                for (latNumber = 0; latNumber < latitudeBands; latNumber++) {\n                    for (longNumber = 0; longNumber < longitudeBands; longNumber++) {\n                        first = (latNumber * (longitudeBands + 1)) + longNumber;\n                        second = first + longitudeBands + 1;\n\n                        this._mesh._indices[0].push(first);\n                        this._mesh._indices[0].push(second);\n                        this._mesh._indices[0].push(first + 1);\n\n                        this._mesh._indices[0].push(second);\n                        this._mesh._indices[0].push(second + 1);\n                        this._mesh._indices[0].push(first + 1);\n                    }\n                }\n            },\n        \n            _calcXYZ: function(longNumber, longitudeBands, sinTheta, cosTheta)\n            {\n                var phi = 0.5 * Math.PI + (longNumber * 2.0 * Math.PI) / longitudeBands;\n                var x = -Math.cos(phi) * sinTheta;\n                var y = -cosTheta;\n                var z = -Math.sin(phi) * sinTheta;\n                return {x:x, y:y, z:z};\n            },\n                    \n            _uFromlong: function(longNumber, longitudeBands)\n            {\n                return 1.0 - (longNumber / longitudeBands);\n            },\n\n            fieldChanged: function(fieldName) {\n                if (fieldName === \"radius\") {\n                    this._mesh._positions[0] = [];\n                    var r = this._vf.radius;\n                    var subx = this._vf.subdivision.x, suby = this._vf.subdivision.y;\n                    var qfactor = this._quality;\n\n                    var latNumber, longNumber;\n                    var latitudeBands = Math.floor(subx * qfactor);\n                    var longitudeBands = Math.floor(suby * qfactor);\n\n                    var theta, sinTheta, cosTheta;\n                    var phi, sinPhi, cosPhi;\n                    var coord;\n\n                    for (latNumber = 0; latNumber <= latitudeBands; latNumber++) {\n                        theta = (latNumber * Math.PI) / latitudeBands;\n                        sinTheta = Math.sin(theta);\n                        cosTheta = Math.cos(theta);\n\n                        for (longNumber = 0; longNumber <= longitudeBands; longNumber++) {\n                            coord = this._calcXYZ(longNumber, longitudeBands, sinTheta, cosTheta);\n\n                            this._mesh._positions[0].push(r * coord.x);\n                            this._mesh._positions[0].push(r * coord.y);\n                            this._mesh._positions[0].push(r * coord.z);\n                        }\n                    }\n\n                    this.invalidateVolume();\n                    this._mesh._numCoords = this._mesh._positions[0].length / 3;\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.positions = true;\n                        node.invalidateVolume();\n                    });\n                }\n                else if (fieldName === \"subdivision\") {\n                    this._regenerateMesh();\n                    this.invalidateVolume();\n                    this._mesh._numFaces = this._mesh._indices[0].length / 3;\n                    this._mesh._numCoords = this._mesh._positions[0].length / 3;\n                    \n                    var r = this._vf.radius;\n                    var subx = this._vf.subdivision.x, suby = this._vf.subdivision.y;\n                    var geoCacheID = 'Sphere_' + r + '-' + subx + '-' + suby;\n                    x3dom.geoCache[geoCacheID] = this._mesh;\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node.setAllDirty();\n                        node.invalidateVolume();\n                    });\n                }\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### Torus ### */\nx3dom.registerNodeType(\n    \"Torus\",\n    \"Geometry3D\",\n    defineClass(x3dom.nodeTypes.X3DSpatialGeometryNode,\n        \n        /**\n         * Constructor for Torus\n         * @constructs x3dom.nodeTypes.Torus\n         * @x3d x.x\n         * @component Geometry3D\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DSpatialGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The Torus node specifies a torus shape centred at (0, 0, 0) in the local coordinate system.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Torus.superClass.call(this, ctx);\n\n            var twoPi = 2.0 * Math.PI;\n\n\n            /**\n             * Specifies the inner radius of the torus.\n             * @var {x3dom.fields.SFFloat} innerRadius\n             * @memberof x3dom.nodeTypes.Torus\n             * @initvalue 0.5\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'innerRadius', 0.5);\n\n            /**\n             * Specifies the outer radius of the torus.\n             * @var {x3dom.fields.SFFloat} outerRadius\n             * @memberof x3dom.nodeTypes.Torus\n             * @initvalue 1.0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'outerRadius', 1.0);\n\n            /**\n             * Specifies the size of the torus as an angle.\n             * @var {x3dom.fields.SFFloat} angle\n             * @range [0, 2*pi]\n             * @memberof x3dom.nodeTypes.Torus\n             * @initvalue twoPi\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'angle', twoPi);\n\n            /**\n             * Specifies whether the torus ends are closed with caps (when angle is smaller than a full circle).\n             * @var {x3dom.fields.SFBool} caps\n             * @memberof x3dom.nodeTypes.Torus\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'caps', true);\n\n            /**\n             * Specifies the number of faces that are generated to approximate the torus.\n             * @var {x3dom.fields.SFVec2f} subdivision\n             * @memberof x3dom.nodeTypes.Torus\n             * @initvalue 24,24\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec2f(ctx, 'subdivision', 24, 24);\n\n            /**\n             * Use a different interpretation mode for the inside and outside radius.\n             * @var {x3dom.fields.SFBool} insideOutsideRadius\n             * @memberof x3dom.nodeTypes.Torus\n             * @initvalue false\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'insideOutsideRadius', false);\n\n            // assure that angle in [0, 2 * PI]\n            if (this._vf.angle < 0)\n                this._vf.angle = 0;\n            else if (this._vf.angle > twoPi)\n                this._vf.angle = twoPi;\n\n            this._origCCW = this._vf.ccw;\n\n            var innerRadius = this._vf.innerRadius;\n            var outerRadius = this._vf.outerRadius;\n\n            if (this._vf.insideOutsideRadius == true)\n            {\n                if (innerRadius > outerRadius) {\n                    var tmp = innerRadius;\n                    innerRadius = outerRadius;\n                    outerRadius = tmp;\n                }\n\n                var rad = (outerRadius - innerRadius) / 2;\n\n                outerRadius = innerRadius + rad;\n                innerRadius = rad;\n\n                // fix wrong face orientation in case of clockwise rotation\n                this._vf.ccw = !this._origCCW;\n            }\n\n            var rings = this._vf.subdivision.x, sides = this._vf.subdivision.y;\n            rings = Math.max(3, Math.round((this._vf.angle / twoPi) * rings));\n\n            // FIXME; check/update geoCache on field update (for ALL primitives)!\n            var geoCacheID = 'Torus_'+innerRadius+'_'+outerRadius+'_'+this._vf.angle+'_'+\n                this._vf.subdivision+'-'+this._vf.caps;\n\n            if( this._vf.useGeoCache && x3dom.geoCache[geoCacheID] !== undefined )\n            {\n                //x3dom.debug.logInfo(\"Using Torus from Cache\");\n                this._mesh = x3dom.geoCache[geoCacheID];\n            }\n            else\n            {\n                var ringDelta = this._vf.angle / rings;\n                var sideDelta = twoPi / sides;\n                var a, b, theta, phi;\n                var cosTheta, sinTheta, cosPhi, sinPhi, dist;\n\n                for (a=0, theta=0; a <= rings; a++, theta+=ringDelta)\n                {\n                    cosTheta = Math.cos(theta);\n                    sinTheta = Math.sin(theta);\n\n                    for (b=0, phi=0; b<=sides; b++, phi+=sideDelta)\n                    {\n                        cosPhi = Math.cos(phi);\n                        sinPhi = Math.sin(phi);\n                        dist = outerRadius + innerRadius * cosPhi;\n\n                        if (this._vf.insideOutsideRadius) {\n                            this._mesh._positions[0].push(cosTheta * dist, innerRadius * sinPhi, -sinTheta * dist);\n                            this._mesh._normals[0].push(cosTheta * cosPhi, sinPhi, -sinTheta * cosPhi);\n                        }\n                        else {\n                            this._mesh._positions[0].push(cosTheta * dist, -sinTheta * dist, innerRadius * sinPhi);\n                            this._mesh._normals[0].push(cosTheta * cosPhi, -sinTheta * cosPhi, sinPhi);\n                        }\n                        this._mesh._texCoords[0].push(-a / rings, b / sides);\n                    }\n                }\n\n                for (a=0; a<sides; a++)\n                {\n                    for (b=0; b<rings; b++)\n                    {\n                        this._mesh._indices[0].push(b * (sides+1) + a);\n                        this._mesh._indices[0].push(b * (sides+1) + a + 1);\n                        this._mesh._indices[0].push((b + 1) * (sides+1) + a);\n\n                        this._mesh._indices[0].push(b * (sides+1) + a + 1);\n                        this._mesh._indices[0].push((b + 1) * (sides+1) + a + 1);\n                        this._mesh._indices[0].push((b + 1) * (sides+1) + a);\n                    }\n                }\n\n                if (this._vf.angle < twoPi && this._vf.caps == true)\n                {\n                    // create first cap\n                    var origPos = this._mesh._positions[0].length / 3;\n\n                    if (this._vf.insideOutsideRadius) {\n                        this._mesh._positions[0].push(outerRadius, 0, 0);\n                        this._mesh._normals[0].push(0, 0, 1);\n                    }\n                    else {\n                        this._mesh._positions[0].push(outerRadius, 0, 0);\n                        this._mesh._normals[0].push(0, 1, 0);\n                    }\n                    this._mesh._texCoords[0].push(0.5, 0.5);\n\n                    for (b=0, phi=0; b<=sides; b++, phi+=sideDelta)\n                    {\n                        cosPhi = Math.cos(phi);\n                        sinPhi = Math.sin(phi);\n                        dist = outerRadius + innerRadius * cosPhi;\n\n                        if (this._vf.insideOutsideRadius) {\n                            this._mesh._positions[0].push(dist, sinPhi * innerRadius, 0);\n                            this._mesh._normals[0].push(0, 0, 1);\n                        }\n                        else {\n                            this._mesh._positions[0].push(dist, 0, sinPhi * innerRadius);\n                            this._mesh._normals[0].push(0, 1, 0);\n                        }\n                        this._mesh._texCoords[0].push((1 + cosPhi) * 0.5, (1 - sinPhi) * 0.5);\n\n                        if (b > 0) {\n                            this._mesh._indices[0].push(origPos);\n                            this._mesh._indices[0].push(origPos + b);\n                            this._mesh._indices[0].push(origPos + b - 1);\n                        }\n                        if (b == sides) {\n                            this._mesh._indices[0].push(origPos);\n                            this._mesh._indices[0].push(origPos + 1);\n                            this._mesh._indices[0].push(origPos + b);\n                        }\n                    }\n\n                    // second cap\n                    cosTheta = Math.cos(this._vf.angle);\n                    sinTheta = Math.sin(this._vf.angle);\n\n                    origPos = this._mesh._positions[0].length / 3;\n                    var nx = -sinTheta, ny = -cosTheta;\n\n                    if (this._vf.insideOutsideRadius) {\n                        this._mesh._positions[0].push(cosTheta * outerRadius, 0, -sinTheta * outerRadius);\n                        this._mesh._normals[0].push(nx, 0, ny);\n                    }\n                    else {\n                        this._mesh._positions[0].push(cosTheta * outerRadius, -sinTheta * outerRadius, 0);\n                        this._mesh._normals[0].push(nx, ny, 0);\n                    }\n                    this._mesh._texCoords[0].push(0.5, 0.5);\n\n                    for (b=0, phi=0; b<=sides; b++, phi+=sideDelta)\n                    {\n                        cosPhi = Math.cos(phi);\n                        sinPhi = Math.sin(phi);\n                        dist = outerRadius + innerRadius * cosPhi;\n\n                        if (this._vf.insideOutsideRadius) {\n                            this._mesh._positions[0].push(cosTheta * dist, sinPhi * innerRadius, -sinTheta * dist);\n                            this._mesh._normals[0].push(nx, 0, ny);\n                        }\n                        else {\n                            this._mesh._positions[0].push(cosTheta * dist, -sinTheta * dist, sinPhi * innerRadius);\n                            this._mesh._normals[0].push(nx, ny, 0);\n                        }\n                        this._mesh._texCoords[0].push(1 - (1 + cosPhi) * 0.5, (1 - sinPhi) * 0.5);\n\n                        if (b > 0) {\n                            this._mesh._indices[0].push(origPos);\n                            this._mesh._indices[0].push(origPos + b - 1);\n                            this._mesh._indices[0].push(origPos + b);\n                        }\n                        if (b == sides) {\n                            this._mesh._indices[0].push(origPos);\n                            this._mesh._indices[0].push(origPos + b);\n                            this._mesh._indices[0].push(origPos + 1);\n                        }\n                    }\n                }\n\n                this._mesh._invalidate = true;\n                this._mesh._numFaces = this._mesh._indices[0].length / 3;\n                this._mesh._numCoords = this._mesh._positions[0].length / 3;\n\n                x3dom.geoCache[geoCacheID] = this._mesh;\n            }\n        \n        },\n        {\n            fieldChanged: function(fieldName)\n            {\n                // TODO; invalidate geometry cache if necessary (to be fixed for all primitives)!\n                if (fieldName == \"innerRadius\" || fieldName == \"outerRadius\" ||\n                    fieldName == \"subdivision\" || fieldName == \"angle\" ||\n                    fieldName == \"insideOutsideRadius\" || fieldName == \"caps\")\n                {\n                    // assure that angle in [0, 2 * PI]\n                    var twoPi = 2.0 * Math.PI;\n\n                    if (this._vf.angle < 0)\n                        this._vf.angle = 0;\n                    else if (this._vf.angle > twoPi)\n                        this._vf.angle = twoPi;\n\n                    var innerRadius = this._vf.innerRadius;\n                    var outerRadius = this._vf.outerRadius;\n\n                    if (this._vf.insideOutsideRadius == true)\n                    {\n                        if (innerRadius > outerRadius) {\n                            var tmp = innerRadius;\n                            innerRadius = outerRadius;\n                            outerRadius = tmp;\n                        }\n\n                        var rad = (outerRadius - innerRadius) / 2;\n\n                        outerRadius = innerRadius + rad;\n                        innerRadius = rad;\n\n                        this._vf.ccw = !this._origCCW;\n                    }\n                    else\n                        this._vf.ccw = this._origCCW;\n\n                    var rings = this._vf.subdivision.x, sides = this._vf.subdivision.y;\n                    rings = Math.max(3, Math.round((this._vf.angle / twoPi) * rings));\n\n                    var ringDelta = this._vf.angle / rings;\n                    var sideDelta = twoPi / sides;\n                    var a, b, theta, phi;\n                    var cosTheta, sinTheta, cosPhi, sinPhi, dist;\n\n                    this._mesh._positions[0] = [];\n                    this._mesh._normals[0]   = [];\n                    this._mesh._texCoords[0] = [];\n                    this._mesh._indices[0]   = [];\n\n                    for (a=0, theta=0; a <= rings; a++, theta+=ringDelta)\n                    {\n                        cosTheta = Math.cos(theta);\n                        sinTheta = Math.sin(theta);\n\n                        for (b=0, phi=0; b<=sides; b++, phi+=sideDelta)\n                        {\n                            cosPhi = Math.cos(phi);\n                            sinPhi = Math.sin(phi);\n                            dist = outerRadius + innerRadius * cosPhi;\n\n                            if (this._vf.insideOutsideRadius) {\n                                this._mesh._positions[0].push(cosTheta * dist, innerRadius * sinPhi, -sinTheta * dist);\n                                this._mesh._normals[0].push(cosTheta * cosPhi, sinPhi, -sinTheta * cosPhi);\n                            }\n                            else {\n                                this._mesh._positions[0].push(cosTheta * dist, -sinTheta * dist, innerRadius * sinPhi);\n                                this._mesh._normals[0].push(cosTheta * cosPhi, -sinTheta * cosPhi, sinPhi);\n                            }\n                            this._mesh._texCoords[0].push(-a / rings, b / sides);\n                        }\n                    }\n\n                    for (a=0; a<sides; a++)\n                    {\n                        for (b=0; b<rings; b++)\n                        {\n                            this._mesh._indices[0].push(b * (sides+1) + a);\n                            this._mesh._indices[0].push(b * (sides+1) + a + 1);\n                            this._mesh._indices[0].push((b + 1) * (sides+1) + a);\n\n                            this._mesh._indices[0].push(b * (sides+1) + a + 1);\n                            this._mesh._indices[0].push((b + 1) * (sides+1) + a + 1);\n                            this._mesh._indices[0].push((b + 1) * (sides+1) + a);\n                        }\n                    }\n\n                    if (this._vf.angle < twoPi && this._vf.caps == true)\n                    {\n                        // create first cap\n                        var origPos = this._mesh._positions[0].length / 3;\n\n                        if (this._vf.insideOutsideRadius) {\n                            this._mesh._positions[0].push(outerRadius, 0, 0);\n                            this._mesh._normals[0].push(0, 0, 1);\n                        }\n                        else {\n                            this._mesh._positions[0].push(outerRadius, 0, 0);\n                            this._mesh._normals[0].push(0, 1, 0);\n                        }\n                        this._mesh._texCoords[0].push(0.5, 0.5);\n\n                        for (b=0, phi=0; b<=sides; b++, phi+=sideDelta)\n                        {\n                            cosPhi = Math.cos(phi);\n                            sinPhi = Math.sin(phi);\n                            dist = outerRadius + innerRadius * cosPhi;\n\n                            if (this._vf.insideOutsideRadius) {\n                                this._mesh._positions[0].push(dist, sinPhi * innerRadius, 0);\n                                this._mesh._normals[0].push(0, 0, 1);\n                            }\n                            else {\n                                this._mesh._positions[0].push(dist, 0, sinPhi * innerRadius);\n                                this._mesh._normals[0].push(0, 1, 0);\n                            }\n                            this._mesh._texCoords[0].push((1 + cosPhi) * 0.5, (1 - sinPhi) * 0.5);\n\n                            if (b > 0) {\n                                this._mesh._indices[0].push(origPos);\n                                this._mesh._indices[0].push(origPos + b);\n                                this._mesh._indices[0].push(origPos + b - 1);\n                            }\n                            if (b == sides) {\n                                this._mesh._indices[0].push(origPos);\n                                this._mesh._indices[0].push(origPos + 1);\n                                this._mesh._indices[0].push(origPos + b);\n                            }\n                        }\n\n                        // second cap\n                        cosTheta = Math.cos(this._vf.angle);\n                        sinTheta = Math.sin(this._vf.angle);\n\n                        origPos = this._mesh._positions[0].length / 3;\n                        var nx = -sinTheta, ny = -cosTheta;\n\n                        if (this._vf.insideOutsideRadius) {\n                            this._mesh._positions[0].push(cosTheta * outerRadius, 0, -sinTheta * outerRadius);\n                            this._mesh._normals[0].push(nx, 0, ny);\n                        }\n                        else {\n                            this._mesh._positions[0].push(cosTheta * outerRadius, -sinTheta * outerRadius, 0);\n                            this._mesh._normals[0].push(nx, ny, 0);\n                        }\n                        this._mesh._texCoords[0].push(0.5, 0.5);\n\n                        for (b=0, phi=0; b<=sides; b++, phi+=sideDelta)\n                        {\n                            cosPhi = Math.cos(phi);\n                            sinPhi = Math.sin(phi);\n                            dist = outerRadius + innerRadius * cosPhi;\n\n                            if (this._vf.insideOutsideRadius) {\n                                this._mesh._positions[0].push(cosTheta * dist, sinPhi * innerRadius, -sinTheta * dist);\n                                this._mesh._normals[0].push(nx, 0, ny);\n                            }\n                            else {\n                                this._mesh._positions[0].push(cosTheta * dist, -sinTheta * dist, sinPhi * innerRadius);\n                                this._mesh._normals[0].push(nx, ny, 0);\n                            }\n                            this._mesh._texCoords[0].push(1 - (1 + cosPhi) * 0.5, (1 - sinPhi) * 0.5);\n\n                            if (b > 0) {\n                                this._mesh._indices[0].push(origPos);\n                                this._mesh._indices[0].push(origPos + b - 1);\n                                this._mesh._indices[0].push(origPos + b);\n                            }\n                            if (b == sides) {\n                                this._mesh._indices[0].push(origPos);\n                                this._mesh._indices[0].push(origPos + b);\n                                this._mesh._indices[0].push(origPos + 1);\n                            }\n                        }\n                    }\n\n                    this.invalidateVolume();\n                    this._mesh._numFaces = this._mesh._indices[0].length / 3;\n                    this._mesh._numCoords = this._mesh._positions[0].length / 3;\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node.setAllDirty();\n                        node.invalidateVolume();\n                    });\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### Cone ### */\nx3dom.registerNodeType(\n    \"Cone\",\n    \"Geometry3D\",\n    defineClass(x3dom.nodeTypes.X3DSpatialGeometryNode,\n        \n        /**\n         * Constructor for Cone\n         * @constructs x3dom.nodeTypes.Cone\n         * @x3d 3.3\n         * @component Geometry3D\n         * @status full\n         * @extends x3dom.nodeTypes.X3DSpatialGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The Cone node specifies a cone which is centred in the local coordinate system and whose central axis is aligned with the local Y-axis.\n         * By default, the cone has a radius of 1.0 at the bottom and a height of 2.0\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Cone.superClass.call(this, ctx);\n\n\n            /**\n             * The bottomRadius field specifies the radius of the cone's base.\n             * @var {x3dom.fields.SFFloat} bottomRadius\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.Cone\n             * @initvalue 1.0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'bottomRadius', 1.0);\n\n            /**\n             * The topRadius field specifies the radius of the cone at the apex.\n             * @var {x3dom.fields.SFFloat} topRadius\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.Cone\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'topRadius', 0);\n\n            /**\n             * The height field specifies the height of the cone from the centre of the base to the apex.\n             * @var {x3dom.fields.SFFloat} height\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.Cone\n             * @initvalue 2.0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'height', 2.0);\n\n            /**\n             * The bottom field specifies whether the bottom cap of the cone is created.\n             * @var {x3dom.fields.SFBool} bottom\n             * @memberof x3dom.nodeTypes.Cone\n             * @initvalue true\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'bottom', true);\n\n            /**\n             * The side field specifies whether sides of the cone are created.\n             * @var {x3dom.fields.SFBool} side\n             * @memberof x3dom.nodeTypes.Cone\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'side', true);\n\n            /**\n             * The top field specifies whether the top cap of the cone is created.\n             * @var {x3dom.fields.SFBool} top\n             * @memberof x3dom.nodeTypes.Cone\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'top', true);\n\n            /**\n             * Specifies the number of faces that are generated to approximate the sides of the cone.\n             * @var {x3dom.fields.SFFloat} subdivision\n             * @range [2, inf]\n             * @memberof x3dom.nodeTypes.Cone\n             * @initvalue 32\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'subdivision', 32);\n\n            var geoCacheID = 'Cone_' + this._vf.bottomRadius + '_' + this._vf.height + '_' + this._vf.top + '_' +\n                this._vf.bottom + '_' + this._vf.side + '_' + this._vf.topRadius + '_' + this._vf.subdivision;\n\n            if (this._vf.useGeoCache && x3dom.geoCache[geoCacheID] !== undefined) {\n                //x3dom.debug.logInfo(\"Using Cone from Cache\");\n                this._mesh = x3dom.geoCache[geoCacheID];\n            }\n            else {\n                var bottomRadius = this._vf.bottomRadius, height = this._vf.height;\n                var topRadius = this._vf.topRadius, sides = this._vf.subdivision;\n\n                var beta, x, z;\n                var delta = 2.0 * Math.PI / sides;\n\n                var incl = (bottomRadius - topRadius) / height;\n                var nlen = 1.0 / Math.sqrt(1.0 + incl * incl);\n\n                var j = 0, k = 0;\n                var h, base;\n\n                if (this._vf.side && height > 0) {\n                    var px = 0, pz = 0;\n\n                    for (j = 0, k = 0; j <= sides; j++) {\n                        beta = j * delta;\n                        x = Math.sin(beta);\n                        z = -Math.cos(beta);\n\n                        if (topRadius > x3dom.fields.Eps) {\n                            px = x * topRadius;\n                            pz = z * topRadius;\n                        }\n\n                        this._mesh._positions[0].push(px, height / 2, pz);\n                        this._mesh._normals[0].push(x / nlen, incl / nlen, z / nlen);\n                        this._mesh._texCoords[0].push(1.0 - j / sides, 1);\n\n                        this._mesh._positions[0].push(x * bottomRadius, -height / 2, z * bottomRadius);\n                        this._mesh._normals[0].push(x / nlen, incl / nlen, z / nlen);\n                        this._mesh._texCoords[0].push(1.0 - j / sides, 0);\n\n                        if (j > 0) {\n                            this._mesh._indices[0].push(k    );\n                            this._mesh._indices[0].push(k + 2);\n                            this._mesh._indices[0].push(k + 1);\n\n                            this._mesh._indices[0].push(k + 1);\n                            this._mesh._indices[0].push(k + 2);\n                            this._mesh._indices[0].push(k + 3);\n\n                            k += 2;\n                        }\n                    }\n                }\n\n                if (this._vf.bottom && bottomRadius > 0) {\n                    base = this._mesh._positions[0].length / 3;\n\n                    for (j = sides - 1; j >= 0; j--) {\n                        beta = j * delta;\n                        x = bottomRadius * Math.sin(beta);\n                        z = -bottomRadius * Math.cos(beta);\n\n                        this._mesh._positions[0].push(x, -height / 2, z);\n                        this._mesh._normals[0].push(0, -1, 0);\n                        this._mesh._texCoords[0].push(x / bottomRadius / 2 + 0.5, z / bottomRadius / 2 + 0.5);\n                    }\n\n                    h = base + 1;\n\n                    for (j = 2; j < sides; j++) {\n                        this._mesh._indices[0].push(h);\n                        this._mesh._indices[0].push(base);\n\n                        h = base + j;\n                        this._mesh._indices[0].push(h);\n                    }\n                }\n\n                if (this._vf.top && topRadius > x3dom.fields.Eps) {\n                    base = this._mesh._positions[0].length / 3;\n\n                    for (j = sides - 1; j >= 0; j--) {\n                        beta = j * delta;\n                        x =  topRadius * Math.sin(beta);\n                        z = -topRadius * Math.cos(beta);\n\n                        this._mesh._positions[0].push(x, height / 2, z);\n                        this._mesh._normals[0].push(0, 1, 0);\n                        this._mesh._texCoords[0].push(x / topRadius / 2 + 0.5, 1.0 - z / topRadius / 2 + 0.5);\n                    }\n\n                    h = base + 1;\n\n                    for (j = 2; j < sides; j++) {\n                        this._mesh._indices[0].push(base);\n                        this._mesh._indices[0].push(h);\n\n                        h = base + j;\n                        this._mesh._indices[0].push(h);\n                    }\n                }\n\n                this._mesh._invalidate = true;\n                this._mesh._numFaces = this._mesh._indices[0].length / 3;\n                this._mesh._numCoords = this._mesh._positions[0].length / 3;\n\n                x3dom.geoCache[geoCacheID] = this._mesh;\n            }\n        \n        },\n        {\n            fieldChanged: function (fieldName)\n            {\n                if (fieldName == \"bottomRadius\" || fieldName == \"topRadius\" ||\n                    fieldName == \"height\" || fieldName == \"subdivision\" ||\n                    fieldName == \"bottom\" || fieldName == \"top\" || fieldName == \"side\")\n                {\n                    this._mesh._positions[0] = [];\n                    this._mesh._indices[0] = [];\n                    this._mesh._normals[0] = [];\n                    this._mesh._texCoords[0] = [];\n\n                    var bottomRadius = this._vf.bottomRadius, height = this._vf.height;\n                    var topRadius = this._vf.topRadius, sides = this._vf.subdivision;\n\n                    var beta, x, z;\n                    var delta = 2.0 * Math.PI / sides;\n\n                    var incl = (bottomRadius - topRadius) / height;\n                    var nlen = 1.0 / Math.sqrt(1.0 + incl * incl);\n\n                    var j = 0, k = 0;\n                    var h, base;\n\n                    if (this._vf.side && height > 0)\n                    {\n                        var px = 0, pz = 0;\n\n                        for (j = 0, k = 0; j <= sides; j++) {\n                            beta = j * delta;\n                            x = Math.sin(beta);\n                            z = -Math.cos(beta);\n\n                            if (topRadius > x3dom.fields.Eps) {\n                                px = x * topRadius;\n                                pz = z * topRadius;\n                            }\n\n                            this._mesh._positions[0].push(px, height / 2, pz);\n                            this._mesh._normals[0].push(x / nlen, incl / nlen, z / nlen);\n                            this._mesh._texCoords[0].push(1.0 - j / sides, 1);\n\n                            this._mesh._positions[0].push(x * bottomRadius, -height / 2, z * bottomRadius);\n                            this._mesh._normals[0].push(x / nlen, incl / nlen, z / nlen);\n                            this._mesh._texCoords[0].push(1.0 - j / sides, 0);\n\n                            if (j > 0) {\n                                this._mesh._indices[0].push(k    );\n                                this._mesh._indices[0].push(k + 2);\n                                this._mesh._indices[0].push(k + 1);\n\n                                this._mesh._indices[0].push(k + 1);\n                                this._mesh._indices[0].push(k + 2);\n                                this._mesh._indices[0].push(k + 3);\n\n                                k += 2;\n                            }\n                        }\n                    }\n\n                    if (this._vf.bottom && bottomRadius > 0)\n                    {\n                        base = this._mesh._positions[0].length / 3;\n\n                        for (j = sides - 1; j >= 0; j--) {\n                            beta = j * delta;\n                            x = bottomRadius * Math.sin(beta);\n                            z = -bottomRadius * Math.cos(beta);\n\n                            this._mesh._positions[0].push(x, -height / 2, z);\n                            this._mesh._normals[0].push(0, -1, 0);\n                            this._mesh._texCoords[0].push(x / bottomRadius / 2 + 0.5, z / bottomRadius / 2 + 0.5);\n                        }\n\n                        h = base + 1;\n\n                        for (j = 2; j < sides; j++) {\n                            this._mesh._indices[0].push(h);\n                            this._mesh._indices[0].push(base);\n\n                            h = base + j;\n                            this._mesh._indices[0].push(h);\n                        }\n                    }\n\n                    if (this._vf.top && topRadius > x3dom.fields.Eps)\n                    {\n                        base = this._mesh._positions[0].length / 3;\n\n                        for (j = sides - 1; j >= 0; j--) {\n                            beta = j * delta;\n                            x =  topRadius * Math.sin(beta);\n                            z = -topRadius * Math.cos(beta);\n\n                            this._mesh._positions[0].push(x, height / 2, z);\n                            this._mesh._normals[0].push(0, 1, 0);\n                            this._mesh._texCoords[0].push(x / topRadius / 2 + 0.5, 1.0 - z / topRadius / 2 + 0.5);\n                        }\n\n                        h = base + 1;\n\n                        for (j = 2; j < sides; j++) {\n                            this._mesh._indices[0].push(base);\n                            this._mesh._indices[0].push(h);\n\n                            h = base + j;\n                            this._mesh._indices[0].push(h);\n                        }\n                    }\n\n                    this.invalidateVolume();\n                    this._mesh._numFaces = this._mesh._indices[0].length / 3;\n                    this._mesh._numCoords = this._mesh._positions[0].length / 3;\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node.setAllDirty();\n                        node.invalidateVolume();\n                    });\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### Cylinder ### */\nx3dom.registerNodeType(\n    \"Cylinder\",\n    \"Geometry3D\",\n    defineClass(x3dom.nodeTypes.X3DSpatialGeometryNode,\n        \n        /**\n         * Constructor for Cylinder\n         * @constructs x3dom.nodeTypes.Cylinder\n         * @x3d 3.3\n         * @component Geometry3D\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DSpatialGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The Cylinder node specifies a capped cylinder centred at (0,0,0) in the local coordinate system and with a central axis oriented along the local Y-axis.\n         * By default, the cylinder is sized at \"-1\" to \"+1\" in all three dimensions.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Cylinder.superClass.call(this, ctx);\n\n\n            /**\n             * The radius field specifies the radius of the cylinder.\n             * @var {x3dom.fields.SFFloat} radius\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.Cylinder\n             * @initvalue 1.0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'radius', 1.0);\n\n            /**\n             * The height field specifies the height of the cylinder along the central axis.\n             * @var {x3dom.fields.SFFloat} height\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.Cylinder\n             * @initvalue 2.0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'height', 2.0);\n\n            /**\n             * The bottom field specifies whether the bottom cap of the cylinder is created.\n             * @var {x3dom.fields.SFBool} bottom\n             * @memberof x3dom.nodeTypes.Cylinder\n             * @initvalue true\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'bottom', true);\n\n            /**\n             * The top field specifies whether the top cap of the cylinder is created.\n             * @var {x3dom.fields.SFBool} top\n             * @memberof x3dom.nodeTypes.Cylinder\n             * @initvalue true\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'top', true);\n\n            /**\n             * Specifies the number of faces that are generated to approximate the sides of the cylinder.\n             * @var {x3dom.fields.SFFloat} subdivision\n             * @range [2, inf]\n             * @memberof x3dom.nodeTypes.Cylinder\n             * @initvalue 32\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'subdivision', 32);\n\n            /**\n             * The side field specifies whether sides of the cylinder are created.\n             * @var {x3dom.fields.SFBool} side\n             * @memberof x3dom.nodeTypes.Cylinder\n             * @initvalue true\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'side', true);\n\n            var sides = this._vf.subdivision;\n\n            var geoCacheID = 'Cylinder_'+this._vf.radius+'_'+this._vf.height+'_'+this._vf.bottom+'_'+this._vf.top+'_'+\n                this._vf.side+'_'+this._vf.subdivision;\n\n            if( this._vf.useGeoCache && x3dom.geoCache[geoCacheID] !== undefined )\n            {\n                //x3dom.debug.logInfo(\"Using Cylinder from Cache\");\n                this._mesh = x3dom.geoCache[geoCacheID];\n            }\n            else\n            {\n                var radius = this._vf.radius;\n                var height = this._vf.height / 2;\n\n                var beta, x, z;\n                var delta = 2.0 * Math.PI / sides;\n                var j, k;\n\n                if (this._vf.side)\n                {\n                    for (j=0, k=0; j<=sides; j++)\n                    {\n                        beta = j * delta;\n                        x = Math.sin(beta);\n                        z = -Math.cos(beta);\n\n                        this._mesh._positions[0].push(x * radius, -height, z * radius);\n                        this._mesh._normals[0].push(x, 0, z);\n                        this._mesh._texCoords[0].push(1.0 - j / sides, 0);\n\n                        this._mesh._positions[0].push(x * radius, height, z * radius);\n                        this._mesh._normals[0].push(x, 0, z);\n                        this._mesh._texCoords[0].push(1.0 - j / sides, 1);\n\n                        if (j > 0)\n                        {\n                            this._mesh._indices[0].push(k    );\n                            this._mesh._indices[0].push(k + 1);\n                            this._mesh._indices[0].push(k + 2);\n\n                            this._mesh._indices[0].push(k + 2);\n                            this._mesh._indices[0].push(k + 1);\n                            this._mesh._indices[0].push(k + 3);\n\n                            k += 2;\n                        }\n                    }\n                }\n\n                if (radius > 0)\n                {\n                    var h, base = this._mesh._positions[0].length / 3;\n\n                    if (this._vf.top)\n                    {\n                        for (j=sides-1; j>=0; j--)\n                        {\n                            beta = j * delta;\n                            x = radius * Math.sin(beta);\n                            z = -radius * Math.cos(beta);\n\n                            this._mesh._positions[0].push(x, height, z);\n                            this._mesh._normals[0].push(0, 1, 0);\n                            this._mesh._texCoords[0].push(x / radius / 2 + 0.5, -z / radius / 2 + 0.5);\n                        }\n\n                        h = base + 1;\n\n                        for (j=2; j<sides; j++)\n                        {\n                            this._mesh._indices[0].push(base);\n                            this._mesh._indices[0].push(h);\n\n                            h = base + j;\n                            this._mesh._indices[0].push(h);\n                        }\n\n                        base = this._mesh._positions[0].length / 3;\n                    }\n\n                    if (this._vf.bottom)\n                    {\n                        for (j=sides-1; j>=0; j--)\n                        {\n                            beta = j * delta;\n                            x = radius * Math.sin(beta);\n                            z = -radius * Math.cos(beta);\n\n                            this._mesh._positions[0].push(x, -height, z);\n                            this._mesh._normals[0].push(0, -1, 0);\n                            this._mesh._texCoords[0].push(x / radius / 2 + 0.5, z / radius / 2 + 0.5);\n                        }\n\n                        h = base + 1;\n\n                        for (j=2; j<sides; j++)\n                        {\n                            this._mesh._indices[0].push(h);\n                            this._mesh._indices[0].push(base);\n\n                            h = base + j;\n                            this._mesh._indices[0].push(h);\n                        }\n                    }\n                }\n\n                this._mesh._invalidate = true;\n                this._mesh._numFaces = this._mesh._indices[0].length / 3;\n                this._mesh._numCoords = this._mesh._positions[0].length / 3;\n\n                x3dom.geoCache[geoCacheID] = this._mesh;\n            }\n        \n        },\n        {\n            fieldChanged: function(fieldName) {\n                if (fieldName === \"radius\" || fieldName === \"height\")\n                {\n                    this._mesh._positions[0] = [];\n\n                    var radius = this._vf.radius, height = this._vf.height / 2;\n                    var sides = this._vf.subdivision;\n\n                    var beta, x, z, j;\n                    var delta = 2.0 * Math.PI / sides;\n\n                    if (this._vf.side)\n                    {\n                        for (j=0; j<=sides; j++)\n                        {\n                            beta = j * delta;\n                            x = Math.sin(beta);\n                            z = -Math.cos(beta);\n\n                            this._mesh._positions[0].push(x * radius, -height, z * radius);\n                            this._mesh._positions[0].push(x * radius, height, z * radius);\n                        }\n                    }\n\n                    if (radius > 0)\n                    {\n                        var h, base = this._mesh._positions[0].length / 3;\n\n                        if (this._vf.top)\n                        {\n                            for (j=sides-1; j>=0; j--)\n                            {\n                                beta = j * delta;\n                                x = radius * Math.sin(beta);\n                                z = -radius * Math.cos(beta);\n\n                                this._mesh._positions[0].push(x, height, z);\n                            }\n                        }\n                    }\n\n                    if (this._vf.bottom)\n                    {\n                        for (j=sides-1; j>=0; j--)\n                        {\n                            beta = j * delta;\n                            x = radius * Math.sin(beta);\n                            z = -radius * Math.cos(beta);\n\n                            this._mesh._positions[0].push(x, -height, z);\n                        }\n                    }\n\n                    this.invalidateVolume();\n                    this._mesh._numCoords = this._mesh._positions[0].length / 3;\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.positions = true;\n                        node.invalidateVolume();\n                    });\n                }\n                else if (fieldName === \"subdivision\" || fieldName === \"bottom\" ||\n                    fieldName === \"top\" || fieldName === \"side\")\n                {\n                    this._mesh._positions[0] = [];\n                    this._mesh._indices[0] =[];\n                    this._mesh._normals[0] = [];\n                    this._mesh._texCoords[0] =[];\n\n                    var radius = this._vf.radius, height = this._vf.height / 2;\n                    var sides = this._vf.subdivision;\n\n                    var beta, x, z, j;\n                    var delta = 2.0 * Math.PI / sides;\n                    var k = 0;\n\n                    if (this._vf.side)\n                    {\n                        for (j=0, k=0; j<=sides; j++)\n                        {\n                            beta = j * delta;\n                            x = Math.sin(beta);\n                            z = -Math.cos(beta);\n\n                            this._mesh._positions[0].push(x * radius, -height, z * radius);\n                            this._mesh._normals[0].push(x, 0, z);\n                            this._mesh._texCoords[0].push(1.0 - j / sides, 0);\n\n                            this._mesh._positions[0].push(x * radius, height, z * radius);\n                            this._mesh._normals[0].push(x, 0, z);\n                            this._mesh._texCoords[0].push(1.0 - j / sides, 1);\n\n                            if (j > 0)\n                            {\n                                this._mesh._indices[0].push(k + 0);\n                                this._mesh._indices[0].push(k + 1);\n                                this._mesh._indices[0].push(k + 2);\n\n                                this._mesh._indices[0].push(k + 2);\n                                this._mesh._indices[0].push(k + 1);\n                                this._mesh._indices[0].push(k + 3);\n\n                                k += 2;\n                            }\n                        }\n                    }\n\n                    if (radius > 0)\n                    {\n                        var h, base = this._mesh._positions[0].length / 3;\n\n                        if (this._vf.top)\n                        {\n                            for (j=sides-1; j>=0; j--)\n                            {\n                                beta = j * delta;\n                                x = radius * Math.sin(beta);\n                                z = -radius * Math.cos(beta);\n\n                                this._mesh._positions[0].push(x, height, z);\n                                this._mesh._normals[0].push(0, 1, 0);\n                                this._mesh._texCoords[0].push(x / radius / 2 + 0.5, -z / radius / 2 + 0.5);\n                            }\n\n                            h = base + 1;\n\n                            for (j=2; j<sides; j++)\n                            {\n                                this._mesh._indices[0].push(base);\n                                this._mesh._indices[0].push(h);\n\n                                h = base + j;\n                                this._mesh._indices[0].push(h);\n                            }\n\n                            base = this._mesh._positions[0].length / 3;\n                        }\n\n                        if (this._vf.bottom)\n                        {\n                            for (j=sides-1; j>=0; j--)\n                            {\n                                beta = j * delta;\n                                x = radius * Math.sin(beta);\n                                z = -radius * Math.cos(beta);\n\n                                this._mesh._positions[0].push(x, -height, z);\n                                this._mesh._normals[0].push(0, -1, 0);\n                                this._mesh._texCoords[0].push(x / radius / 2 + 0.5, z / radius / 2 + 0.5);\n                            }\n\n                            h = base + 1;\n\n                            for (j=2; j<sides; j++)\n                            {\n                                this._mesh._indices[0].push(h);\n                                this._mesh._indices[0].push(base);\n\n                                h = base + j;\n                                this._mesh._indices[0].push(h);\n                            }\n                        }\n                    }\n\n                    this.invalidateVolume();\n                    this._mesh._numFaces = this._mesh._indices[0].length / 3;\n                    this._mesh._numCoords = this._mesh._positions[0].length / 3;\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node.setAllDirty();\n                        node.invalidateVolume();\n                    });\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n\n/* ### ExternalGeometry ### */\nx3dom.registerNodeType(\n    \"ExternalGeometry\",\n    \"Geometry3D\",\n    defineClass(x3dom.nodeTypes.X3DSpatialGeometryNode,\n\n        /**\n         * Constructor for ExternalGeometry\n         * @constructs x3dom.nodeTypes.ExternalGeometry\n         * @x3d x.x\n         * @component Geometry3D\n         * @extends x3dom.nodeTypes.X3DSpatialGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The ExternalGeometry node loads data from a Shape Resource Container (typically a binary glTF / .glb file). The used data can be progressively updated during transmission.\n         */\n         function (ctx) {\n            x3dom.nodeTypes.ExternalGeometry.superClass.call(this, ctx);\n\n            /**\n             * Defines the url to the openGL Transfer Format (glTF) file.\n             * A suffix with a leading # can be used to reference single meshes inside an SRC: \"path/to/data.src#mesh0\".\n             * Multiple urls specify alternatives (if downloading fails).\n             *\n             * @var {x3dom.fields.MFString} url\n             * @memberof x3dom.nodeTypes.ExternalGeometry\n             * @initvalue []\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFString(ctx, 'url', []);\n\n\n            //initialization of rendering-related X3DOM structures\n            this._mesh._invalidate = false;\n            this._mesh._numCoords  = 0;\n            this._mesh._numFaces   = 0;\n\n\n            //index of the current URL, used to download data - if downloading fails, this index is increased\n            this._currentURLIdx = 0;\n        },\n        {\n            //----------------------------------------------------------------------------------------------------------\n            // PUBLIC FUNCTIONS\n            //----------------------------------------------------------------------------------------------------------\n\n            /**\n             * Updates the render data, stored in the given objects, with data from this ExternalGeometry.\n             * If necessary, the referenced file is downloaded first.\n             *\n             * @param {Object} shape - x3dom shape node\n             * @param {Object} shaderProgram - x3dom shader program\n             * @param {Object} gl - WebGL context\n             * @param {Object} viewarea - x3dom view area\n             * @param {Object} context - x3dom context object\n             */\n            update: function(shape, shaderProgram, gl, viewarea, context) {\n                var that = this;\n                var xhr;\n\n                if (this._vf['url'].length == 0 ||\n                    this._currentURLIdx >= this._vf['url'].length)\n                {\n                    return;\n                }\n\n                var currentURL = shape._nameSpace.getURL(this._vf['url'][this._currentURLIdx]);\n\n                // check if this is a legacy SRC container,\n                // and use the respective loader in that case\n                var urlSuffix = currentURL.substr(currentURL.lastIndexOf('.'));\n\n                if (urlSuffix.substr(0, 4) == '.src')\n                {\n                    var srcUsedWarnMessage = \"Legacy SRC format used for content for \\\"\" + currentURL + \"\\\". \" +\n                                             \"It is recommended to use a binary-glTF-conformant .glb container instead.\";\n                    x3dom.debug.logWarning(srcUsedWarnMessage);\n                    console.warn(srcUsedWarnMessage);\n\n                    // actually, this._currentURLIdx should always be 0 here\n                    ExternalGeometrySRC.updateRenderData(shape, shaderProgram, gl, viewarea, context,\n                                                         this._mesh, this._vf['url'], this._currentURLIdx);\n                    return;\n                }\n\n                //check if there is still memory available\n                if (x3dom.BinaryContainerLoader.outOfMemory) {\n                    return;\n                }\n\n                //TODO: check SOURCE child nodes\n                shape._webgl.internalDownloadCount  = 1;\n                shape._nameSpace.doc.incrementDownloads();\n\n                //post request\n                xhr = new XMLHttpRequest();\n                \n                var encoding = ( currentURL.indexOf(\".glb\") != -1 ) ? \"binary\" : \"ascii\";\n\n                var xhr = new XMLHttpRequest();\n\n                xhr.open(\"GET\", this._nameSpace.getURL(this._vf['url'][this._currentURLIdx]), true);\n\n                xhr.responseType = ( encoding == \"binary\" ) ? \"arraybuffer\" : \"json\";\n\n                //xhr.send(null);\n                x3dom.RequestManager.addRequest(xhr);\n\n                xhr.onerror = function() {\n                    x3dom.debug.logError(\"Unable to load GLB data from URL \\\"\" + currentURL + \"\\\"\");\n                };\n\n                xhr.onload = function() {\n                    shape._webgl.internalDownloadCount  = 0;\n                    shape._nameSpace.doc.decrementDownloads();\n\n                    shape._webgl.primType    = [];\n                    shape._webgl.indexOffset = [];\n                    shape._webgl.drawCount   = [];\n\n                    if ((xhr.status == 200 || xhr.status == 0)) {\n                        var glTF = new x3dom.glTF.glTFLoader(true);\n\n                        glTF.load(xhr.response, function()\n                        {\n                            if (glTF.header.sceneLength > 0)\n                            {\n                                glTF.loaded = {};\n                                glTF.loaded.meshes = {};\n                                glTF.loaded.meshCount = 0;\n\n                                if(currentURL.includes('#'))\n                                {\n                                    var split = currentURL.split('#');\n                                    var meshName = split[split.length-1];\n                                    glTF.getMesh(shape, shaderProgram, gl, meshName);\n                                }\n                                else\n                                {\n                                    glTF.getScene(shape, shaderProgram, gl);\n                                }\n\n                                for(var key in glTF._mesh){\n                                    if(!glTF._mesh.hasOwnProperty(key))continue;\n                                    that._mesh[key] = glTF._mesh[key];\n                                }\n\n                            }\n                            else\n                            {\n                                if ((that._currentURLIdx + 1) < that._vf['url'].length)\n                                {\n                                    x3dom.debug.logWarning(\"Invalid GLB data, loaded from URL \\\"\" +\n                                                           currentURL +\n                                                           \"\\\", trying next specified URL\");\n\n                                    //try next URL\n                                    ++that._currentURLIdx;\n                                    that.update(shape, shaderProgram, gl, viewarea, context);\n                                }\n                                else\n                                {\n                                    x3dom.debug.logError(\"Invalid GLB data, loaded from URL \\\"\" +\n                                                         currentURL + \"\\\",\" +\n                                                         \" no other URLs left to try.\");\n                                }\n                            }\n                            \n                            var theScene = that._nameSpace.doc._scene;\n\n                            if (theScene) {\n                                theScene.invalidateVolume();\n                                //theScene.invalidateCache();\n\n                                window.setTimeout( function() {\n                                    that.invalidateVolume();\n                                    //that.invalidateCache();\n\n                                    theScene.updateVolume();\n                                    that._nameSpace.doc.needRender = true;\n                                }, 1000 );\n                            }\n                        });\n                    }\n                    else\n                    {\n                        if ((that._currentURLIdx + 1) < that._vf['url'].length)\n                        {\n                            x3dom.debug.logWarning(\"Invalid GLB data, loaded from URL \\\"\" +\n                                                   currentURL +\n                                                   \"\\\", trying next specified URL\");\n\n                            //try next URL\n                            ++that._currentURLIdx;\n                            that.update(shape, shaderProgram, gl, viewarea, context);\n                        }\n                        else\n                        {\n                            x3dom.debug.logError(\"Invalid GLB data, loaded from URL \\\"\" +\n                                                 currentURL + \"\\\",\" +\n                                                 \" no other URLs left to try.\");\n                        }\n                    }\n                };\n            } ,\n\n            //----------------------------------------------------------------------------------------------------------\n\n            //----------------------------------------------------------------------------------------------------------\n            // PRIVATE FUNCTIONS\n            //----------------------------------------------------------------------------------------------------------\n\n\n            \n            /**\n             * Returns the node's local volume\n             * @returns {x3dom.fields.BoxVolume} the local, axis-aligned bounding volume\n             */\n            getVolume: function()\n            {\n                var vol = this._mesh._vol;\n                var shapeNode;\n\n                if (!vol.isValid())\n                {\n                    //an ExternalGeometry node must _always_ be a child of (at least) one shape node\n                    //for multiple Shape nodes using a single ExternalGeometry node,\n                    //we assume that either all of them, or no one have specified a bounding volume\n                    shapeNode = this._parentNodes[0];\n\n                    if (typeof shapeNode._vf[\"bboxCenter\"] != 'undefined' &&\n                        typeof shapeNode._vf[\"bboxSize\"]   != 'undefined'   )\n                    {\n                        vol.setBoundsByCenterSize(shapeNode._vf[\"bboxCenter\"], shapeNode._vf[\"bboxSize\"]);\n                    }\n                    //if no bbox information was specified for the Shape node, use information from the GLB header\n                    else\n                    {\n                        //TODO: implement\n                    }\n                }\n\n                return vol;\n            }\n        }        \n    )\n);\n\n\n\n\n/////////////////////////////////////////////////\n//             LEGACY SRC SUPPORT              //\n/////////////////////////////////////////////////\n\n// helper namespace to support legacy SRC format\nvar ExternalGeometrySRC =\n{\n    /*\n     * Updates the render data, stored in the given objects, with data from this ExternalGeometry.\n     * If necessary, the referenced file is downloaded first.\n     *\n     * @param {Object} shape - x3dom shape node\n     * @param {Object} shaderProgram - x3dom shader program\n     * @param {Object} gl - WebGL context\n     * @param {Object} viewarea - x3dom view area\n     * @param {Object} context - x3dom context object\n     */\n    updateRenderData :  function(shape, shaderProgram, gl, viewarea, context,\n                                 x3domMesh, urls, currentURLIndex)\n    {\n        var xhr;\n\n        if (urls.length == 0 ||\n            currentURLIndex >= urls.length)\n        {\n            return;\n        }\n\n        //check if there is still memory available\n        if (x3dom.BinaryContainerLoader.outOfMemory) {\n            return;\n        }\n\n        //TODO: check SOURCE child nodes\n        shape._webgl.internalDownloadCount  = 1;\n        shape._nameSpace.doc.incrementDownloads();\n\n        //TODO: check this object - when is it called, where is it really needed?\n        //shape._webgl.makeSeparateTris = {...};\n\n\n        //post request\n        xhr = new XMLHttpRequest();\n\n        xhr.open(\"GET\", shape._nameSpace.getURL(urls[currentURLIndex]), true);\n\n        xhr.responseType = \"arraybuffer\";\n\n        xhr.send(null);\n\n        xhr.onerror = function() {\n            x3dom.debug.logError(\"Unable to load SRC data from URL \\\"\" + urls[currentURLIndex] + \"\\\"\");\n        };\n\n        //TODO: currently, we assume that the referenced file is always an SRC file\n        xhr.onload = function() {\n            shape._webgl.internalDownloadCount  = 0;\n            shape._nameSpace.doc.decrementDownloads();\n\n            var responseBeginUint32 = new Uint32Array(xhr.response, 0, 12);\n\n            var srcHeaderSize, srcBodySize, srcBodyOffset;\n            var srcHeaderView, srcBodyView;\n\n            var srcHeaderObj;\n\n            if ((xhr.status == 200 || xhr.status == 0) && responseBeginUint32.length >= 3) {\n\n                srcHeaderSize = responseBeginUint32[2];\n                srcBodyOffset = srcHeaderSize + 12;\n                srcBodySize   = xhr.response.byteLength - srcBodyOffset;\n\n                if (srcHeaderSize > 0 &&  srcBodySize >= 0)\n                {\n                    srcHeaderView = new Uint8Array(xhr.response, 12,            srcHeaderSize);\n                    srcBodyView   = new Uint8Array(xhr.response, srcBodyOffset, srcBodySize  );\n\n                    //decode SRC header\n                    //currently, we assume ASCII JSON encoding\n                    try\n                    {\n                        srcHeaderObj = JSON.parse(String.fromCharCode.apply(null, srcHeaderView));\n                    }\n                    catch (exc)\n                    {\n                        x3dom.debug.logError(\"Unable to parse SRC header: \" + exc);\n                        return;\n                    }\n\n                    ExternalGeometrySRC._updateRenderDataFromSRC(shape, shaderProgram, gl, srcHeaderObj, srcBodyView,\n                        x3domMesh);\n                }\n                else\n                {\n                    if ((currentURLIndex + 1) < urls.length)\n                    {\n                        x3dom.debug.logWarning(\"Invalid SRC data, loaded from URL \\\"\" +\n                            urls[currentURLIndex] +\n                            \"\\\", trying next specified URL\");\n\n                        //try next URL\n                        ++currentURLIndex;\n                        ExternalGeometrySRC.updateRenderData(shape, shaderProgram, gl, viewarea, context,\n                            urls, currentURLIndex);\n                    }\n                    else\n                    {\n                        x3dom.debug.logError(\"Invalid SRC data, loaded from URL \\\"\" +\n                            urls[currentURLIndex] + \"\\\",\" +\n                            \" no other URLs left to try.\");\n                    }\n                }\n            }\n            else\n            {\n                if ((currentURLIndex + 1) < urls.length)\n                {\n                    x3dom.debug.logWarning(\"Invalid SRC data, loaded from URL \\\"\" +\n                        urls[currentURLIndex] +\n                        \"\\\", trying next specified URL\");\n\n                    //try next URL\n                    ++currentURLIndex;\n                    ExternalGeometrySRC.updateRenderData(shape, shaderProgram, gl, viewarea, context,\n                        urls, currentURLIndex);\n                }\n                else\n                {\n                    x3dom.debug.logError(\"Invalid SRC data, loaded from URL \\\"\" +\n                        urls[currentURLIndex] + \"\\\",\" +\n                        \" no other URLs left to try.\");\n                }\n            }\n        };\n    },\n\n    /*\n     * Helper function, updating the render data, stored in the given objects,\n     * with data read from the given SRC.\n     *\n     * @param {Object} shape - x3dom shape node\n     * @param {Object} shaderProgram - x3dom shader program\n     * @param {Object} gl - WebGL context\n     * @param {Object} srcHeaderObj - the JS object which was created from the SRC header\n     * @param {Uint8Array} srcBodyView - a typed array view on the body of the SRC file\n     * @private\n     */\n    _updateRenderDataFromSRC: function(shape, shaderProgram, gl, srcHeaderObj, srcBodyView, x3domMesh)\n    {\n        shape.meshes = [];\n\n        var MAX_NUM_BUFFERS_PER_DRAW = 6;\n\n        var indexViews = srcHeaderObj[\"accessors\"][\"indexViews\"];\n        var indexViewID, indexView;\n\n        var attributeViews = srcHeaderObj[\"accessors\"][\"attributeViews\"];\n        var attributes;\n        var attributeID, attributeView;\n        var x3domTypeID, x3domShortTypeID, numComponents;\n\n        var meshes = srcHeaderObj[\"meshes\"];\n        var mesh, meshID;\n        var meshIdx, bufferOffset;\n\n\n        //the meta data object is currently unused\n        //var metadataObj = srcHeaderObj[\"meta\"];\n\n\n        //1. create GL buffers for bufferChunks / bufferViews\n\n        //create buffers and GL buffer views, and store their identifiers in a map\n        var viewIDsToGLBufferIDs = {};\n\n        //due to the differentiation between targets ARRAY and ELEMENT_ARRAY, we need to check the usage\n        //of the buffer view objects here first, before uploading them for the matching target\n        var indexViewBufferIDs = {};\n        for (indexViewID in indexViews)\n        {\n            indexView = indexViews[indexViewID];\n            indexViewBufferIDs[indexView[\"bufferView\"]] = true;\n        }\n\n        ExternalGeometrySRC._createGLBuffersFromSRCChunks(gl,\n            srcHeaderObj[\"bufferChunks\"], srcHeaderObj[\"bufferViews\"],\n            srcBodyView, indexViewBufferIDs, viewIDsToGLBufferIDs);\n\n\n        //2. remember GL index buffer properties, if any\n\n        for (indexViewID in indexViews)\n        {\n            indexView = indexViews[indexViewID];\n\n            //we currently assume 16 bit index data\n            if (indexView[\"componentType\"] != gl.UNSIGNED_SHORT)\n            {\n                x3dom.debug.logWarning(\"SRC index componentType \" + indexView[\"componentType\"] +\n                    \" is not UNSIGNED_SHORT. \" +\n                    \"Ignoring given value and assuming UNSIGNED_SHORT indices.\");\n            }\n            shape._webgl.indexType = gl.UNSIGNED_SHORT;\n        }\n\n\n        //3. remember necessary information to setup GL draw parameters and attribute pointers\n\n        meshIdx      = 0;\n        bufferOffset = 0;\n\n        //hints for stats display\n        x3domMesh._numCoords   = 0;\n        x3domMesh._numFaces    = 0;\n\n        for (meshID in meshes)\n        {\n            var renderMesh = new x3dom.glTF.glTFMesh();\n\n            mesh = meshes[meshID];\n\n            //setup indices, if any\n            indexViewID = mesh[\"indices\"];\n            //TODO: allow the renderer to switch between indexed and non-indexed rendering, for one extGeo\n            if (indexViewID != \"\")\n            {\n                shape._webgl.externalGeometry =  1; //indexed EG\n\n                indexView = indexViews[indexViewID];\n\n                renderMesh.indexOffset = indexView[\"byteOffset\"];\n                renderMesh.drawCount   = indexView[\"count\"];\n\n                //TODO: add support for LINES and POINTS\n                renderMesh.numFaces  = indexView[\"count\"] / 3;\n                x3domMesh._numFaces += indexView[\"count\"] / 3;\n\n                renderMesh.buffers[x3dom.BUFFER_IDX.INDEX + bufferOffset] = {};\n                renderMesh.buffers[x3dom.BUFFER_IDX.INDEX + bufferOffset].offset = indexView[\"byteOffset\"];\n                renderMesh.buffers[x3dom.BUFFER_IDX.INDEX + bufferOffset].type   = indexView[\"componentType\"];\n                renderMesh.buffers[x3dom.BUFFER_IDX.INDEX + bufferOffset].idx    = viewIDsToGLBufferIDs[indexView[\"bufferView\"]];\n            }\n            else\n            {\n                shape._webgl.externalGeometry = -1; //non-indexed EG\n            }\n\n            //setup primType\n            renderMesh.primitiveType = mesh[\"primitive\"];\n\n            //setup attributes\n            attributes = mesh[\"attributes\"];\n\n            for (attributeID in attributes)\n            {\n                attributeView = attributeViews[attributes[attributeID]];\n\n                //the current renderer does not support generic vertex attributes, so simply look for useable cases\n                var idx = 0;\n                switch (attributeID)\n                {\n                    case \"position\":\n                        x3domTypeID      = \"coord\";\n                        x3domShortTypeID = \"Pos\";\n                        idx = x3dom.BUFFER_IDX.POSITION + bufferOffset;\n                        //for non-indexed rendering, we assume that all attributes have the same count\n                        if (mesh[\"indices\"] == \"\")\n                        {\n                            renderMesh.drawCount[meshIdx] = attributeView[\"count\"];\n                            //TODO: add support for LINES and POINTS\n                            x3domMesh._numFaces += attributeView[\"count\"] / 3;\n                            renderMesh.numFaces = attributeView[\"count\"] / 3;\n                        }\n                        x3domMesh._numCoords += attributeView[\"count\"];\n                        break;\n\n                    case \"normal\":\n                        x3domTypeID      = \"normal\";\n                        x3domShortTypeID = \"Norm\";\n                        idx = x3dom.BUFFER_IDX.NORMAL + bufferOffset;\n                        break;\n\n                    case \"texcoord\":\n                        x3domTypeID      = \"texCoord\";\n                        x3domShortTypeID = \"Tex\";\n                        idx = x3dom.BUFFER_IDX.TEXCOORD + bufferOffset;\n                        break;\n\n                    case \"color\":\n                        x3domTypeID      = \"color\";\n                        x3domShortTypeID = \"Col\";\n                        idx = x3dom.BUFFER_IDX.COLOR+ bufferOffset;\n                        break;\n\n                    case \"id\":\n                        x3domTypeID      = \"id\";\n                        x3domShortTypeID = \"Id\";\n                        idx = x3dom.BUFFER_IDX.ID + bufferOffset;\n                        shape._cf.geometry.node._vf.idsPerVertex = true;\n                        break;\n                }\n\n                shape[\"_\" + x3domTypeID + \"StrideOffset\"][0] = attributeView[\"byteStride\"];\n                shape[\"_\" + x3domTypeID + \"StrideOffset\"][1] = attributeView[\"byteOffset\"];\n                shape._webgl[x3domTypeID + \"Type\"]           = attributeView[\"componentType\"];\n\n\n                numComponents = ExternalGeometrySRC._findNumComponentsForSRCAccessorType(attributeView[\"type\"]);\n                x3domMesh[\"_num\" + x3domShortTypeID + \"Components\"] = numComponents;\n\n                renderMesh.buffers[idx] = {};\n                renderMesh.buffers[idx].idx    = viewIDsToGLBufferIDs[attributeView[\"bufferView\"]];\n                renderMesh.buffers[idx].offset = attributeView[\"byteOffset\"];\n                renderMesh.buffers[idx].stride = attributeView[\"byteStride\"];\n                renderMesh.buffers[idx].type   = attributeView[\"componentType\"];\n                renderMesh.buffers[idx].numComponents = numComponents;\n            }\n\n            ++meshIdx;\n            bufferOffset += MAX_NUM_BUFFERS_PER_DRAW;\n\n            shape.meshes.push(renderMesh);\n        }\n\n\n        //4. notify renderer\n\n        shape._dirty.shader = true;\n\n        shape._nameSpace.doc.needRender = true;\n\n        x3dom.BinaryContainerLoader.checkError(gl);\n    },\n\n    //----------------------------------------------------------------------------------------------------------\n\n    /*\n     * Helper function, creating WebGL buffers for the given SRC data structures.\n     * The result is stored in the given map from bufferView IDs to GL buffer IDs.\n     *\n     * @param {Object} gl - WebGL context\n     * @param {Object} bufferChunksObj - the SRC header's bufferChunks object\n     * @param {Object} bufferViewsObj - the SRC header's bufferViews object\n     * @param {Uint8Array} srcBodyView - a typed array view on the body of the SRC file\n     * @param {Object} indexViewBufferIDs - an object which holds the IDs of all index data bufferViews\n     * @param {Object} viewIDsToGLBufferIDs - map that will be filled with a GL buffer ID for each bufferView ID\n     * @private\n     */\n    _createGLBuffersFromSRCChunks: function(gl, bufferChunksObj, bufferViewsObj, srcBodyView,\n                                            indexViewBufferIDs, viewIDsToGLBufferIDs)\n    {\n        var i;\n        var bufferView;\n        var chunkIDList;\n        var bufferType;\n\n        var chunk;\n        var newBuffer;\n        var chunkDataView;\n        var currentChunkDataOffset;\n\n        //for each buffer view object, create and fill a GL buffer from its buffer chunks\n        for (var bufferViewID in bufferViewsObj)\n        {\n            bufferType = (typeof indexViewBufferIDs[bufferViewID] !== 'undefined') ? gl.ELEMENT_ARRAY_BUFFER :\n                gl.ARRAY_BUFFER;\n\n            bufferView = bufferViewsObj[bufferViewID];\n\n            chunkIDList = bufferView[\"chunks\"];\n\n            //case 1: single chunk\n            if (chunkIDList.length == 1)\n            {\n                chunk = bufferChunksObj[chunkIDList[0]];\n\n                chunkDataView = new Uint8Array(srcBodyView.buffer,\n                    srcBodyView.byteOffset + chunk[\"byteOffset\"],\n                    chunk[\"byteLength\"]);\n\n                newBuffer = gl.createBuffer();\n\n                gl.bindBuffer(bufferType, newBuffer);\n\n                //upload all chunk data to GPU\n                gl.bufferData(bufferType, chunkDataView, gl.STATIC_DRAW);\n\n                viewIDsToGLBufferIDs[bufferViewID] = newBuffer;\n            }\n            //case 2: multiple chunks\n            else\n            {\n                newBuffer = gl.createBuffer();\n\n                gl.bindBuffer(bufferType, newBuffer);\n\n                //reserve GPU memory for all chunks\n                gl.bufferData(bufferType, bufferView[\"byteLength\"], gl.STATIC_DRAW);\n\n                currentChunkDataOffset = 0;\n\n                for (i = 0; i < chunkIDList.length; ++i)\n                {\n                    chunk = bufferChunksObj[chunkIDList[i]];\n\n                    chunkDataView = new Uint8Array(srcBodyView.buffer,\n                        srcBodyView.byteOffset + chunk[\"byteOffset\"],\n                        chunk[\"byteLength\"]);\n\n                    //upload chunk data to GPU\n                    gl.bufferSubData(bufferType, currentChunkDataOffset, chunkDataView);\n\n                    currentChunkDataOffset += chunk[\"byteLength\"];\n                }\n\n                viewIDsToGLBufferIDs[bufferViewID] = newBuffer;\n            }\n        }\n    },\n\n\n    /*\n     * Helper to encapsulate the number of components per accessor type\n     * @param {STRING} type - accessor type, must be \"SCALAR\", \"VEC2\", \"VEC3\" or \"VEC4\"\n     * @private\n     */\n    _findNumComponentsForSRCAccessorType : function(type)\n    {\n        switch (type)\n        {\n            case \"SCALAR\": return 1;\n            case \"VEC2\":   return 2;\n            case \"VEC3\":   return 3;\n            case \"VEC4\":   return 4;\n            default:       return 0;\n        }\n    }\n};\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### X3DBinaryContainerGeometryNode ### */\nx3dom.registerNodeType(\n    \"X3DBinaryContainerGeometryNode\",\n    \"Geometry3D\",\n    defineClass(x3dom.nodeTypes.X3DSpatialGeometryNode,\n        \n        /**\n         * Constructor for X3DBinaryContainerGeometryNode\n         * @constructs x3dom.nodeTypes.X3DBinaryContainerGeometryNode\n         * @x3d x.x\n         * @component Geometry3D\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DSpatialGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DBinaryContainerGeometryNode.superClass.call(this, ctx);\n\n\n            /**\n             *\n             * @var {x3dom.fields.SFVec3f} position\n             * @memberof x3dom.nodeTypes.X3DBinaryContainerGeometryNode\n             * @initvalue 0,0,0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'position', 0, 0, 0);\n\n            /**\n             *\n             * @var {x3dom.fields.SFVec3f} size\n             * @memberof x3dom.nodeTypes.X3DBinaryContainerGeometryNode\n             * @initvalue 1,1,1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'size', 1, 1, 1);\n\n            /**\n             *\n             * @var {x3dom.fields.MFInt32} vertexCount\n             * @memberof x3dom.nodeTypes.X3DBinaryContainerGeometryNode\n             * @initvalue [0]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFInt32(ctx, 'vertexCount', [0]);\n\n            /**\n             *\n             * @var {x3dom.fields.MFString} primType\n             * @memberof x3dom.nodeTypes.X3DBinaryContainerGeometryNode\n             * @initvalue ['TRIANGLES']\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFString(ctx, 'primType', ['TRIANGLES']);\n\n            // correct min/max of bounding volume set in BinaryContainerGeometry\n            this._mesh._invalidate = false;\n            this._mesh._numCoords = 0;\n            this._mesh._numFaces = 0;\n\n            this._diameter = this._vf.size.length();\n        \n        },\n        {\n            getMin: function() {\n                var vol = this._mesh._vol;\n\n                if (!vol.isValid()) {\n                    vol.setBoundsByCenterSize(this._vf.position, this._vf.size);\n                }\n\n                return vol.min;\n            },\n\n            getMax: function() {\n                var vol = this._mesh._vol;\n\n                if (!vol.isValid()) {\n                    vol.setBoundsByCenterSize(this._vf.position, this._vf.size);\n                }\n\n                return vol.max;\n            },\n\n            getVolume: function() {\n                var vol = this._mesh._vol;\n\n                if (!vol.isValid()) {\n                    vol.setBoundsByCenterSize(this._vf.position, this._vf.size);\n                }\n\n                return vol;\n            },\n\n            invalidateVolume: function() {\n                // at the moment, do nothing here since field updates are not impl.\n            },\n\n            getCenter: function() {\n                return this._vf.position;\n            },\n\n            getDiameter: function() {\n                return this._diameter;\n            },\n\n            needLighting: function() {\n                var hasTris = (this._vf.primType.length && this._vf.primType[0].indexOf(\"TRIANGLE\") >= 0);\n                return (this._vf.lit && hasTris);\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### BinaryGeometry ### */\nx3dom.registerNodeType(\n    \"BinaryGeometry\",\n    \"Geometry3D\",\n    defineClass(x3dom.nodeTypes.X3DBinaryContainerGeometryNode,\n        \n        /**\n         * Constructor for BinaryGeometry\n         * @constructs x3dom.nodeTypes.BinaryGeometry\n         * @x3d x.x\n         * @component Geometry3D\n         * @extends x3dom.nodeTypes.X3DBinaryContainerGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The BinaryGeometry node can load binary data exported by AOPT.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.BinaryGeometry.superClass.call(this, ctx);\n\n\n            /**\n             * The url to the binary file, that contains the index data.\n             * @var {x3dom.fields.SFString} index\n             * @memberof x3dom.nodeTypes.BinaryGeometry\n             * @initvalue \"\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'index', \"\");   // Uint16\n\n            /**\n             * The url to the binary file, that contains the mesh coordinates.\n             * @var {x3dom.fields.SFString} coord\n             * @memberof x3dom.nodeTypes.BinaryGeometry\n             * @initvalue \"\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'coord', \"\");   // Float32\n\n            /**\n             * The url to the binary file, that contains the normals.\n             * @var {x3dom.fields.SFString} normal\n             * @memberof x3dom.nodeTypes.BinaryGeometry\n             * @initvalue \"\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'normal', \"\");\n\n            /**\n             * The url to the binary file, that contains the texture coordinates.\n             * @var {x3dom.fields.SFString} texCoord\n             * @memberof x3dom.nodeTypes.BinaryGeometry\n             * @initvalue \"\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'texCoord', \"\");    // THINKABOUTME: add texCoord1, texCoord2, ...?\n\n            /**\n             * The url to the binary file, that contains the colors.\n             * @var {x3dom.fields.SFString} color\n             * @memberof x3dom.nodeTypes.BinaryGeometry\n             * @initvalue \"\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'color', \"\");\n\n            /**\n             *\n             * @var {x3dom.fields.SFString} tangent\n             * @memberof x3dom.nodeTypes.BinaryGeometry\n             * @initvalue \"\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'tangent', \"\");     // TODO\n\n            /**\n             *\n             * @var {x3dom.fields.SFString} binormal\n             * @memberof x3dom.nodeTypes.BinaryGeometry\n             * @initvalue \"\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'binormal', \"\");    // TODO\n\n            // Typed Array View Types\n            // Int8, Uint8, Int16, Uint16, Int32, Uint32, Float32, Float64\n\n            /**\n             * Specifies the byte format of the index data.\n             * @var {x3dom.fields.SFString} indexType\n             * @memberof x3dom.nodeTypes.BinaryGeometry\n             * @initvalue \"Uint16\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'indexType', \"Uint16\");\n\n            /**\n             * Specifies the byte format of the coordinates.\n             * @var {x3dom.fields.SFString} coordType\n             * @memberof x3dom.nodeTypes.BinaryGeometry\n             * @initvalue \"Float32\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'coordType', \"Float32\");\n\n            /**\n             * Specifies the byte format of the normals.\n             * @var {x3dom.fields.SFString} normalType\n             * @memberof x3dom.nodeTypes.BinaryGeometry\n             * @initvalue \"Float32\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'normalType', \"Float32\");\n\n            /**\n             * Specifies the byte format of the texture coordinates.\n             * @var {x3dom.fields.SFString} texCoordType\n             * @memberof x3dom.nodeTypes.BinaryGeometry\n             * @initvalue \"Float32\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'texCoordType', \"Float32\");\n\n            /**\n             * Specifies the byte format of the colors.\n             * @var {x3dom.fields.SFString} colorType\n             * @memberof x3dom.nodeTypes.BinaryGeometry\n             * @initvalue \"Float32\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'colorType', \"Float32\");\n\n            /**\n             * Specifies the byte format of the tangents.\n             * @var {x3dom.fields.SFString} tangentType\n             * @memberof x3dom.nodeTypes.BinaryGeometry\n             * @initvalue \"Float32\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'tangentType', \"Float32\");\n\n            /**\n             * Specifies the byte format of the binormals.\n             * @var {x3dom.fields.SFString} binormalType\n             * @memberof x3dom.nodeTypes.BinaryGeometry\n             * @initvalue \"Float32\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'binormalType', \"Float32\");\n\n\n            /**\n             * Specifies whether the normals are encoded as spherical coordinates.\n             * @var {x3dom.fields.SFBool} normalAsSphericalCoordinates\n             * @memberof x3dom.nodeTypes.BinaryGeometry\n             * @initvalue false\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'normalAsSphericalCoordinates', false);\n\n            /**\n             * Enables RGBA colors.\n             * @var {x3dom.fields.SFBool} rgbaColors\n             * @memberof x3dom.nodeTypes.BinaryGeometry\n             * @initvalue false\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'rgbaColors', false);\n\n            /**\n             * Specifies the number of texture coordinates per vertex.\n             * @var {x3dom.fields.SFInt32} numTexCoordComponents\n             * @range [1, inf]\n             * @memberof x3dom.nodeTypes.BinaryGeometry\n             * @initvalue 2\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'numTexCoordComponents', 2);\n\n            /**\n             * Specifies whether normals are stored per vertex or per face.\n             * @var {x3dom.fields.SFBool} normalPerVertex\n             * @memberof x3dom.nodeTypes.BinaryGeometry\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'normalPerVertex', true);\n\n            /**\n             * Flag that specifies whether vertex IDs are given as texture coordinates.\n             * @var {x3dom.fields.SFBool} idsPerVertex\n             * @memberof x3dom.nodeTypes.BinaryGeometry\n             * @initvalue false\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'idsPerVertex', false);\n\n            /**\n             * Flag that specifies whether the binary files are GZip compressed.\n             * @var {x3dom.fields.SFBool} compressed\n             * @memberof x3dom.nodeTypes.BinaryGeometry\n             * @initvalue false\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'compressed', false);\n\n            // workaround\n            this._hasStrideOffset = false;\n            this._mesh._numPosComponents = this._vf.normalAsSphericalCoordinates ? 4 : 3;\n            this._mesh._numTexComponents = this._vf.numTexCoordComponents;\n            this._mesh._numColComponents = this._vf.rgbaColors ? 4 : 3;\n            this._mesh._numNormComponents = this._vf.normalAsSphericalCoordinates ? 2 : 3;\n\n            // info helper members\n            this._vertexCountSum = 0;\n            for (var i=0; i<this._vf.vertexCount.length; ++i) {\n                this._vertexCountSum += this._vf.vertexCount[i];\n            }\n        \n        },\n        {\n            parentAdded: function(parent)\n            {\n                // TODO; also handle multiple shape parents!\n                var offsetInd, strideInd, offset, stride;\n\n                offsetInd = this._vf.coord.lastIndexOf('#');\n                strideInd = this._vf.coord.lastIndexOf('+');\n                if (offsetInd >= 0 && strideInd >= 0) {\n                    offset = +this._vf.coord.substring(++offsetInd, strideInd);\n                    stride = +this._vf.coord.substring(strideInd);\n                    parent._coordStrideOffset = [stride, offset];\n                    this._hasStrideOffset = true;\n                    if ((offset / 8) - Math.floor(offset / 8) == 0) {\n                        this._mesh._numPosComponents = 4;\n                    }\n                    //x3dom.debug.logInfo(\"coord stride/offset: \" + stride + \", \" + offset);\n                }\n                else if (strideInd >= 0) {\n                    stride = +this._vf.coord.substring(strideInd);\n                    parent._coordStrideOffset = [stride, 0];\n                    if ((stride / 8) - Math.floor(stride / 8) == 0) {\n                        this._mesh._numPosComponents = 4;   // ???\n                    }\n                    //x3dom.debug.logInfo(\"coord stride: \" + stride);\n                }\n\n                offsetInd = this._vf.normal.lastIndexOf('#');\n                strideInd = this._vf.normal.lastIndexOf('+');\n                if (offsetInd >= 0 && strideInd >= 0) {\n                    offset = +this._vf.normal.substring(++offsetInd, strideInd);\n                    stride = +this._vf.normal.substring(strideInd);\n                    parent._normalStrideOffset = [stride, offset];\n                    //x3dom.debug.logInfo(\"normal stride/offset: \" + stride + \", \" + offset);\n                }\n                else if (strideInd >= 0) {\n                    stride = +this._vf.normal.substring(strideInd);\n                    parent._normalStrideOffset = [stride, 0];\n                    //x3dom.debug.logInfo(\"normal stride: \" + stride);\n                }\n\n                offsetInd = this._vf.texCoord.lastIndexOf('#');\n                strideInd = this._vf.texCoord.lastIndexOf('+');\n                if (offsetInd >= 0 && strideInd >= 0) {\n                    offset = +this._vf.texCoord.substring(++offsetInd, strideInd);\n                    stride = +this._vf.texCoord.substring(strideInd);\n                    parent._texCoordStrideOffset = [stride, offset];\n                    //x3dom.debug.logInfo(\"texCoord stride/offset: \" + stride + \", \" + offset);\n                }\n                else if (strideInd >= 0) {\n                    stride = +this._vf.texCoord.substring(strideInd);\n                    parent._texCoordStrideOffset = [stride, 0];\n                    //x3dom.debug.logInfo(\"texCoord stride: \" + stride);\n                }\n\n                offsetInd = this._vf.color.lastIndexOf('#');\n                strideInd = this._vf.color.lastIndexOf('+');\n                if (offsetInd >= 0 && strideInd >= 0) {\n                    offset = +this._vf.color.substring(++offsetInd, strideInd);\n                    stride = +this._vf.color.substring(strideInd);\n                    parent._colorStrideOffset = [stride, offset];\n                    //x3dom.debug.logInfo(\"color stride/offset: \" + stride + \", \" + offset);\n                }\n                else if (strideInd >= 0) {\n                    stride = +this._vf.color.substring(strideInd);\n                    parent._colorStrideOffset = [stride, 0];\n                    //x3dom.debug.logInfo(\"color stride: \" + stride);\n                }\n\n                if (this._vf.indexType != \"Uint16\" && !x3dom.caps.INDEX_UINT)\n                    x3dom.debug.logWarning(\"Index type \" + this._vf.indexType + \" problematic\");\n            },\n\n            doIntersect: function(line)\n            {\n                var min = this.getMin();\n                var max = this.getMax();\n                var isect = line.intersect(min, max);\n\n                if (isect && line.enter < line.dist) {\n                    line.dist = line.enter;\n                    line.hitObject = this;\n                    line.hitPoint = line.pos.add(line.dir.multiply(line.enter));\n                    return true;\n                }\n                else {\n                    return false;\n                }\n            },\n\n            getPrecisionMax: function(type)\n            {\n                switch(this._vf[type])\n                {\n                    case \"Int8\":\n                        return 127.0;\n                    case \"Uint8\":\n                        return 255.0;\n                    case \"Int16\":\n                        return 32767.0;\n                    case \"Uint16\":\n                        return 65535.0;\n                    case \"Int32\":\n                        return 2147483647.0;\n                    case \"Uint32\":\n                        return 4294967295.0;\n                    case \"Float32\":\n                    case \"Float64\":\n                    default:\n                        return 1.0;\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### PopGeometryLevel ### */\nx3dom.registerNodeType(\n    \"PopGeometryLevel\",\n    \"Geometry3D\",\n    defineClass(x3dom.nodeTypes.X3DGeometricPropertyNode,\n        \n        /**\n         * Constructor for PopGeometryLevel\n         * @constructs x3dom.nodeTypes.PopGeometryLevel\n         * @x3d x.x\n         * @component Geometry3D\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DGeometricPropertyNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The PopGeometryLevel node holds data of one refinement level for the PopGeometry node.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.PopGeometryLevel.superClass.call(this, ctx);\n\n\n            /**\n             * Location of the binary file that contains the data of this refinement level.\n             * @var {x3dom.fields.SFString} src\n             * @memberof x3dom.nodeTypes.PopGeometryLevel\n             * @initvalue \"\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'src', \"\");\n\n            /**\n             * Number of indices shipped with this refinement level.\n             * @var {x3dom.fields.SFInt32} numIndices\n             * @memberof x3dom.nodeTypes.PopGeometryLevel\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'numIndices', 0);\n\n            /**\n             * Offset of the interleaved attribute data of this refinement level within the target vertex buffer.\n             * @var {x3dom.fields.SFInt32} vertexDataBufferOffset\n             * @memberof x3dom.nodeTypes.PopGeometryLevel\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'vertexDataBufferOffset', 0);\n        \n        },\n        {\n            getSrc: function () {\n                return this._vf.src;\n            },\n\n            getNumIndices: function () {\n                return this._vf.numIndices;\n            },\n\n            getVertexDataBufferOffset: function () {\n                return this._vf.vertexDataBufferOffset;\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### PopGeometry ### */\nx3dom.registerNodeType(\n    \"PopGeometry\",\n    \"Geometry3D\",\n    defineClass(x3dom.nodeTypes.X3DBinaryContainerGeometryNode,\n        \n        /**\n         * Constructor for PopGeometry\n         * @constructs x3dom.nodeTypes.PopGeometry\n         * @x3d x.x\n         * @component Geometry3D\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DBinaryContainerGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The PopGeometry node provides a first, experimental implementation of the POP Buffer algorithm for progressive streaming of triangular mesh data.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.PopGeometry.superClass.call(this, ctx);\n\n            /**\n             * The size of the bounding box of this geometry, as it is used for culling.\n             * @var {x3dom.fields.SFVec3f} tightSize\n             * @memberof x3dom.nodeTypes.PopGeometry\n             * @initvalue 1,1,1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec3f (ctx, 'tightSize',  1, 1, 1);\n            //@todo: add this on export\n\n            /**\n             * The size of the bounding box used to quantize data in this geometry,\n             * which is usually the largest bounding box of all sub-meshes of a given mesh.\n             * @var {x3dom.fields.SFVec3f} maxBBSize\n             * @memberof x3dom.nodeTypes.PopGeometry\n             * @initvalue 1,1,1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec3f (ctx, 'maxBBSize',  1, 1, 1);\n\n            /**\n             * The minimum coordinates of the bounding box, in a normalized range between [0,1],\n             * and given modulo maxBBSize.\n             * @var {x3dom.fields.SFVec3f} bbMinModF\n             * @memberof x3dom.nodeTypes.PopGeometry\n             * @initvalue 0,0,0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec3f (ctx, 'bbMinModF',  0, 0, 0);\n\n            /**\n             * The maximum coordinates of the bounding box, in a normalized range between [0,1],\n             * and given modulo maxBBSize.\n             * @var {x3dom.fields.SFVec3f} bbMaxModF\n             * @memberof x3dom.nodeTypes.PopGeometry\n             * @initvalue 1,1,1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec3f (ctx, 'bbMaxModF',  1, 1, 1);\n\n            /**\n             * Minimum coordinates of the bounding box, in object coordinates.\n             * @var {x3dom.fields.SFVec3f} bbMin\n             * @memberof x3dom.nodeTypes.PopGeometry\n             * @initvalue 0,0,0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec3f (ctx, 'bbMin', 0, 0, 0);\n\n            /**\n             * Field for internal use.\n             * @var {x3dom.fields.SFVec3f} bbShiftVec\n             * @memberof x3dom.nodeTypes.PopGeometry\n             * @initvalue 0,0,0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec3f (ctx, 'bbShiftVec', 0, 0, 0);\n\n            if (this._vf.bbMinModF.x > this._vf.bbMaxModF.x)\n                this._vf.bbShiftVec.x = 1.0;\n            if (this._vf.bbMinModF.y > this._vf.bbMaxModF.y)\n                this._vf.bbShiftVec.y = 1.0;\n            if (this._vf.bbMinModF.z > this._vf.bbMaxModF.z)\n                this._vf.bbShiftVec.z = 1.0;\n\n\n            /**\n             * Number of levels of this pop geometry.\n             * @var {x3dom.fields.MFNode} levels\n             * @memberof x3dom.nodeTypes.PopGeometry\n             * @initvalue x3dom.nodeTypes.PopGeometryLevel\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFNode('levels', x3dom.nodeTypes.PopGeometryLevel);\n\n\n            /**\n             * Stride of all (interleaved) attributes, given in bytes.\n             * @var {x3dom.fields.SFInt32} attributeStride\n             * @memberof x3dom.nodeTypes.PopGeometry\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'attributeStride',   0);\n\n            /**\n             * Offset, given in bytes, for the position attribute inside the interleaved attribute array.\n             * @var {x3dom.fields.SFInt32} positionOffset\n             * @memberof x3dom.nodeTypes.PopGeometry\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'positionOffset',    0);\n\n            /**\n             * Offset, given in bytes, for the normal attribute inside the interleaved attribute array.\n             * @var {x3dom.fields.SFInt32} normalOffset\n             * @memberof x3dom.nodeTypes.PopGeometry\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'normalOffset',      0);\n\n            /**\n             * Offset, given in bytes, for the texture coordinate attribute inside the interleaved attribute array.\n             * @var {x3dom.fields.SFInt32} texcoordOffset\n             * @memberof x3dom.nodeTypes.PopGeometry\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'texcoordOffset',    0);\n\n            /**\n             * Offset, given in bytes, for the color attribute inside the interleaved attribute array.\n             * @var {x3dom.fields.SFInt32} colorOffset\n             * @memberof x3dom.nodeTypes.PopGeometry\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'colorOffset',       0);\n\n            /**\n             * Number of anchor vertices (can be 0).\n             * Anchor vertices are used to keep some vertices on the bordes between sub-meshes fixed during refinement.\n             * @var {x3dom.fields.SFInt32} numAnchorVertices\n             * @memberof x3dom.nodeTypes.PopGeometry\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'numAnchorVertices', 0);\n\n\n            /**\n             * Precision, given in bytes, for the components of the position attribute.\n             * @var {x3dom.fields.SFInt32} positionPrecision\n             * @memberof x3dom.nodeTypes.PopGeometry\n             * @initvalue 2\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'positionPrecision', 2);\n\n            /**\n             * Precision, given in bytes, for the components of the normal attribute.\n             * @var {x3dom.fields.SFInt32} normalPrecision\n             * @memberof x3dom.nodeTypes.PopGeometry\n             * @initvalue 1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'normalPrecision',   1);\n\n            /**\n             * Precision, given in bytes, for the components of the texture coordinate attribute.\n             * @var {x3dom.fields.SFInt32} texcoordPrecision\n             * @memberof x3dom.nodeTypes.PopGeometry\n             * @initvalue 2\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'texcoordPrecision', 2);\n\n            /**\n             * Precision, given in bytes, for the components of the color attribute.\n             * @var {x3dom.fields.SFInt32} colorPrecision\n             * @memberof x3dom.nodeTypes.PopGeometry\n             * @initvalue 1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'colorPrecision',    1);\n\n\n            /**\n             * Minimum precision level of this PopGeometry node.\n             * This can be used to clamp displayed precision - if the value is -1, no clamping takes place.\n             * @var {x3dom.fields.SFInt32} minPrecisionLevel\n             * @memberof x3dom.nodeTypes.PopGeometry\n             * @initvalue -1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'minPrecisionLevel', -1);\n\n            /**\n             * Maximum precision level of this PopGeometry node.\n             * This can be used to clamp displayed precision - if the value is -1, no clamping takes place.\n             * @var {x3dom.fields.SFInt32} maxPrecisionLevel\n             * @memberof x3dom.nodeTypes.PopGeometry\n             * @initvalue -1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'maxPrecisionLevel', -1);\n\n            /**\n             * Additional precision multiplication factor, for tuning the displayed precision.\n             * @var {x3dom.fields.SFFloat} precisionFactor\n             * @memberof x3dom.nodeTypes.PopGeometry\n             * @initvalue 1.0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'precisionFactor',  1.0);\n\n            //those four fields are read by the x3dom renderer\n\n            /**\n             * Field for internal use by the X3DOM renderer.\n             * @var {x3dom.fields.SFString} coordType\n             * @memberof x3dom.nodeTypes.PopGeometry\n             * @initvalue \"Uint16\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'coordType',    \"Uint16\");\n\n            /**\n             * Field for internal use by the X3DOM renderer.\n             * @var {x3dom.fields.SFString} normalType\n             * @memberof x3dom.nodeTypes.PopGeometry\n             * @initvalue \"Uint8\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'normalType',   \"Uint8\");\n\n            /**\n             * Field for internal use by the X3DOM renderer.\n             * @var {x3dom.fields.SFString} texCoordType\n             * @memberof x3dom.nodeTypes.PopGeometry\n             * @initvalue \"Uint16\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'texCoordType', \"Uint16\");\n\n            /**\n             * Field for internal use by the X3DOM renderer.\n             * @var {x3dom.fields.SFString} colorType\n             * @memberof x3dom.nodeTypes.PopGeometry\n             * @initvalue \"Uint8\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'colorType',    \"Uint8\");\n\n\n            /**\n             * Size of the vertex buffer, used to pre-allocate the buffer before downloading data.\n             * @var {x3dom.fields.SFInt32} vertexBufferSize\n             * @memberof x3dom.nodeTypes.PopGeometry\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'vertexBufferSize', 0);\n\n\n            /**\n             * Specifies whether this PopGeometry was encoded for indexed rendering.\n             * @var {x3dom.fields.SFBool} indexedRendering\n             * @memberof x3dom.nodeTypes.PopGeometry\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'indexedRendering', true);\n            //ATTENTION: Although it might be supported by aopt,\n            //           X3DOM does not accept 16 bit spherical normals yet,\n            //           spherical normals are assumed to be 8 bit and get\n            //           encoded as the 4th 16 bit position component\n\n            /**\n             * Specifies whether this PopGeometry was encoded for rendering with spherical normals.\n             * @var {x3dom.fields.SFBool} sphericalNormals\n             * @memberof x3dom.nodeTypes.PopGeometry\n             * @initvalue false\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'sphericalNormals', false);\n\n            //needed as we manipulate vertexCount during loading\n\n            /**\n             * Vertex count at the highest possible level of precision.\n             * @var {x3dom.fields.MFInt32} originalVertexCount\n             * @memberof x3dom.nodeTypes.PopGeometry\n             * @initvalue [0]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFInt32(ctx, 'originalVertexCount', [0]);\n\n            for (var i = 0; i < this._vf.vertexCount.length; ++i) {\n                this._vf.originalVertexCount[i] = this._vf.vertexCount[i];\n            }\n\n            //@todo: remove this three lines after cleanup\n            this._vf.maxBBSize = x3dom.fields.SFVec3f.copy(this._vf.size);\n            this._vf.size  = this._vf.tightSize;\n            this._diameter = this._vf.size.length();\n\n            this._bbMinBySize = [ Math.floor(this._vf.bbMin.x / this._vf.maxBBSize.x),\n                Math.floor(this._vf.bbMin.y / this._vf.maxBBSize.y),\n                Math.floor(this._vf.bbMin.z / this._vf.maxBBSize.z) ];\n            this._volRadius        = this._vf.size.length() / 2;\n            this._volLargestRadius = this._vf.maxBBSize.length() / 2;\n\n            // workaround\n            this._mesh._numPosComponents  = this._vf.sphericalNormals ? 4 : 3;\n            this._mesh._numNormComponents = this._vf.sphericalNormals ? 2 : 3;\n            this._mesh._numTexComponents  = 2;\n            this._mesh._numColComponents  = 3;\n\n            x3dom.nodeTypes.PopGeometry.numTotalVerts += this.getVertexCount();\n            x3dom.nodeTypes.PopGeometry.numTotalTris  += (this.hasIndex() ?\n                this.getTotalNumberOfIndices() : this.getVertexCount()) / 3;\n        \n        },\n        {\n            forceUpdateCoverage: function() {\n                return true;\n            },\n\n            getBBoxShiftVec: function() {\n                return this._vf.bbShiftVec;\n            },\n\n            getBBoxSize: function() {\n                return this._vf.size;\n            },\n\n            hasIndex: function() {\n                return this._vf.indexedRendering;\n            },\n\n            getTotalNumberOfIndices: function() {\n                if (this._vf.indexedRendering) {\n                    var sum = 0;\n                    for (var i = 0; i < this._vf.originalVertexCount.length; ++i) {\n                        sum += this._vf.originalVertexCount[i];\n                    }\n                    return sum;\n                }\n                else  {\n                    return 0;\n                }\n            },\n\n            getVertexCount: function() {\n                var sum = 0;\n                for (var i = 0; i < this._vf.originalVertexCount.length; ++i) {\n                    sum += this._vf.originalVertexCount[i];\n                }\n                return sum;\n            },\n\n            //adapts the vertex count according to the given total number of indices / vertices\n            //which is used by the renderer\n            adaptVertexCount: function(numVerts) {\n                var verts = 0;\n                for (var i = 0; i < this._vf.originalVertexCount.length; ++i) {\n                    if ((this._vf.originalVertexCount[i] + verts) <= numVerts) {\n                        this._vf.vertexCount[i] = this._vf.originalVertexCount[i];\n                        verts += this._vf.originalVertexCount[i];\n                    }\n                    else {\n                        this._vf.vertexCount[i] = numVerts - verts;\n                        break;\n                    }\n                }\n            },\n\n            hasNormal: function() {\n                return (this._vf.normalOffset != 0) && !this._vf.sphericalNormals;\n            },\n\n            hasTexCoord: function() {\n                return (this._vf.texcoordOffset != 0);\n            },\n\n            hasColor: function() {\n                return (this._vf.colorOffset != 0);\n            },\n\n            getPositionPrecision : function() {\n                return this._vf.positionPrecision;\n            },\n\n            getNormalPrecision : function() {\n                return this._vf.normalPrecision;\n            },\n\n            getTexCoordPrecision : function() {\n                return this._vf.texcoordPrecision;\n            },\n\n            getColorPrecision : function() {\n                return this._vf.colorPrecision;\n            },\n\n            getAttributeStride : function() {\n                return this._vf.attributeStride;\n            },\n\n            getPositionOffset : function() {\n                return this._vf.positionOffset;\n            },\n\n            getNormalOffset : function() {\n                return this._vf.normalOffset;\n            },\n\n            getTexCoordOffset : function() {\n                return this._vf.texcoordOffset;\n            },\n\n            getColorOffset : function() {\n                return this._vf.colorOffset;\n            },\n\n            getBufferTypeStringFromByteCount: function(bytes) {\n                switch(bytes)\n                {\n                    case 1:\n                        return \"Uint8\";\n                    case 2:\n                        return \"Uint16\";\n                    //case 4: //currently not supported by PopGeometry\n                    //    return \"Float32\";\n                    default:\n                        return 0;\n                }\n            },\n\n            getDataURLs : function() {\n                var urls = [];\n\n                for (var i = 0; i < this._cf.levels.nodes.length; ++i) {\n                    urls.push(this._cf.levels.nodes[i].getSrc());\n                }\n\n                return urls;\n            },\n\n            getNumIndicesByLevel : function(lvl) {\n                return this._cf.levels.nodes[lvl].getNumIndices();\n            },\n\n            getNumLevels : function(lvl) {\n                return this._cf.levels.nodes.length;\n            },\n\n            getVertexDataBufferOffset : function(lvl) {\n                return this._cf.levels.nodes[lvl].getVertexDataBufferOffset();\n            },\n\n            getPrecisionMax: function(type) {\n                switch(this._vf[type])\n                {\n                    //currently, only Uint8 and Uint16 are supported\n                    //case \"Int8\":\n                    //    return 127.0;\n                    case \"Uint8\":\n                        return 255.0;\n                    //case \"Int16\":\n                    //    return 32767.0;\n                    case \"Uint16\":\n                        return 65535.0;\n                    //case \"Int32\":\n                    //return 2147483647.0;\n                    //case \"Uint32\":\n                    //return 4294967295.0;\n                    //case \"Float32\":\n                    //case \"Float64\":\n                    default:\n                        return 1.0;\n                }\n            }\n        }\n    )\n);\n\n\n/** Static class members (needed for stats) */\nx3dom.nodeTypes.PopGeometry.ErrorToleranceFactor  = 1;\nx3dom.nodeTypes.PopGeometry.PrecisionFactorOnMove = 1;\nx3dom.nodeTypes.PopGeometry.numRenderedVerts      = 0;\nx3dom.nodeTypes.PopGeometry.numRenderedTris       = 0;\nx3dom.nodeTypes.PopGeometry.numTotalVerts         = 0;\nx3dom.nodeTypes.PopGeometry.numTotalTris          = 0;\n\n/** Static LUT for LOD computation */\nx3dom.nodeTypes.PopGeometry.powLUT = [32768, 16384, 8192, 4096, 2048, 1024, 512, 256,\n    128,    64,   32,   16,   8,    4,    2,   1];\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### ImageGeometry ### */\nx3dom.registerNodeType(\n    \"ImageGeometry\",\n    \"Geometry3D\",\n    defineClass(x3dom.nodeTypes.X3DBinaryContainerGeometryNode,\n        \n        /**\n         * Constructor for ImageGeometry\n         * @constructs x3dom.nodeTypes.ImageGeometry\n         * @x3d x.x\n         * @component Geometry3D\n         * @extends x3dom.nodeTypes.X3DBinaryContainerGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The image geometry node loads data stored in an image file.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.ImageGeometry.superClass.call(this, ctx);\n\n\n            /**\n             *\n             * @var {x3dom.fields.SFVec2f} implicitMeshSize\n             * @memberof x3dom.nodeTypes.ImageGeometry\n             * @initvalue 256,256\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec2f(ctx, 'implicitMeshSize', 256, 256);\n\n            /**\n             * Specifies the number of color components.\n             * @var {x3dom.fields.SFInt32} numColorComponents\n             * @memberof x3dom.nodeTypes.ImageGeometry\n             * @initvalue 3\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'numColorComponents', 3);\n\n            /**\n             * Specifies the number of texture coordinate components.\n             * @var {x3dom.fields.SFInt32} numTexCoordComponents\n             * @memberof x3dom.nodeTypes.ImageGeometry\n             * @initvalue 2\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'numTexCoordComponents', 2);\n\n\n            /**\n             * Specifies the image file that contains the index data.\n             * @var {x3dom.fields.SFNode} index\n             * @memberof x3dom.nodeTypes.ImageGeometry\n             * @initvalue x3dom.nodeTypes.X3DTextureNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('index', x3dom.nodeTypes.X3DTextureNode);\n\n            /**\n             * Specifies the image file that contains the coord data.\n             * @var {x3dom.fields.MFNode} coord\n             * @memberof x3dom.nodeTypes.ImageGeometry\n             * @initvalue x3dom.nodeTypes.X3DTextureNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFNode('coord', x3dom.nodeTypes.X3DTextureNode);\n\n            /**\n             * Specifies the image file that contains the normal data.\n             * @var {x3dom.fields.SFNode} normal\n             * @memberof x3dom.nodeTypes.ImageGeometry\n             * @initvalue x3dom.nodeTypes.X3DTextureNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('normal', x3dom.nodeTypes.X3DTextureNode);\n\n            /**\n             * Specifies the image file that contains the texcoord data.\n             * @var {x3dom.fields.SFNode} texCoord\n             * @memberof x3dom.nodeTypes.ImageGeometry\n             * @initvalue x3dom.nodeTypes.X3DTextureNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('texCoord', x3dom.nodeTypes.X3DTextureNode);\n\n            /**\n             * Specifies the image file that contains the color data.\n             * @var {x3dom.fields.SFNode} color\n             * @memberof x3dom.nodeTypes.ImageGeometry\n             * @initvalue x3dom.nodeTypes.X3DTextureNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('color', x3dom.nodeTypes.X3DTextureNode);\n\n            this._mesh._numColComponents = this._vf.numColorComponents;\n            this._mesh._numTexComponents = this._vf.numTexCoordComponents;\n\n            if (this._vf.implicitMeshSize.y == 0)\n                this._vf.implicitMeshSize.y = this._vf.implicitMeshSize.x;\n\n            //TODO check if GPU-Version is supported (Flash, etc.)\n            //Dummy mesh generation only needed for GPU-Version\n            if (x3dom.caps.BACKEND == 'webgl' && x3dom.caps.MAX_VERTEX_TEXTURE_IMAGE_UNITS > 0) {\n\n                var geoCacheID = 'ImageGeometry_' + this._vf.implicitMeshSize.x + '_' + this._vf.implicitMeshSize.y;\n\n                if( this._vf.useGeoCache && x3dom.geoCache[geoCacheID] !== undefined )\n                {\n                    //x3dom.debug.logInfo(\"Using ImageGeometry-Mesh from Cache\");\n                    this._mesh = x3dom.geoCache[geoCacheID];\n                }\n                else\n                {\n                    for(var y=0; y<this._vf.implicitMeshSize.y; y++)\n                    {\n                        for(var x=0; x<this._vf.implicitMeshSize.x; x++)\n                        {\n                            this._mesh._positions[0].push(x / this._vf.implicitMeshSize.x,\n                                    y / this._vf.implicitMeshSize.y, 0);\n                        }\n                    }\n\n                    //this._mesh._invalidate = true;\n                    this._mesh._numFaces = this._mesh._indices[0].length / 3;\n                    this._mesh._numCoords = this._mesh._positions[0].length / 3;\n\n                    x3dom.geoCache[geoCacheID] = this._mesh;\n                }\n            }\n\n            // needed because mesh is shared due to cache\n            this._vol = new x3dom.fields.BoxVolume();\n\n            this._dirty = {\n                coord: true,\n                normal: true,\n                texCoord: true,\n                color: true,\n                index: true\n            };\n        \n        },\n        {\n            setGeoDirty: function () {\n                this._dirty.coord = true;\n                this._dirty.normal = true;\n                this._dirty.texCoords = true;\n                this._dirty.color = true;\n                this._dirty.index = true;\n            },\n\n            unsetGeoDirty: function () {\n                this._dirty.coord = false;\n                this._dirty.normal = false;\n                this._dirty.texCoords = false;\n                this._dirty.color = false;\n                this._dirty.index = false;\n            },\n\n            nodeChanged: function()\n            {\n                Array.forEach(this._parentNodes, function (node) {\n                    node._dirty.positions = true;\n                    node._dirty.normals = true;\n                    node._dirty.texcoords = true;\n                    node._dirty.colors = true;\n                });\n                this._vol.invalidate();\n            },\n\n            fieldChanged: function(fieldName)\n            {\n                if (fieldName == \"index\" ||fieldName == \"coord\" || fieldName == \"normal\" ||\n                    fieldName == \"texCoord\" || fieldName == \"color\") {\n                    this._dirty[fieldName] = true;\n                    this._vol.invalidate();\n                }\n                else if (fieldName == \"implicitMeshSize\") {\n                    this._vol.invalidate();\n                }\n            },\n\n            getMin: function() {\n                var vol = this._vol;\n\n                if (!vol.isValid()) {\n                    vol.setBoundsByCenterSize(this._vf.position, this._vf.size);\n                }\n\n                return vol.min;\n            },\n\n            getMax: function() {\n                var vol = this._vol;\n\n                if (!vol.isValid()) {\n                    vol.setBoundsByCenterSize(this._vf.position, this._vf.size);\n                }\n\n                return vol.max;\n            },\n\n            getVolume: function() {\n                var vol = this._vol;\n\n                if (!vol.isValid()) {\n                    vol.setBoundsByCenterSize(this._vf.position, this._vf.size);\n                }\n\n                return vol;\n            },\n\n            numCoordinateTextures: function()\n            {\n                return this._cf.coord.nodes.length;\n            },\n\n            getIndexTexture: function()\n            {\n                if(this._cf.index.node) {\n                    this._cf.index.node._type = \"IG_index\";\n                    return this._cf.index.node;\n                } else {\n                    return null;\n                }\n            },\n\n            getIndexTextureURL: function()\n            {\n                if(this._cf.index.node) {\n                    return this._cf.index.node._vf.url;\n                } else {\n                    return null;\n                }\n            },\n\n            getCoordinateTexture: function(pos)\n            {\n                if(this._cf.coord.nodes[pos]) {\n                    this._cf.coord.nodes[pos]._type = \"IG_coords\" + pos;\n                    return this._cf.coord.nodes[pos];\n                } else {\n                    return null;\n                }\n            },\n\n            getCoordinateTextureURL: function(pos)\n            {\n                if(this._cf.coord.nodes[pos]) {\n                    return this._cf.coord.nodes[pos]._vf.url;\n                } else {\n                    return null;\n                }\n            },\n\n            getCoordinateTextureURLs: function()\n            {\n                var urls = [];\n                for(var i=0; i<this._cf.coord.nodes.length; i++)\n                {\n                    urls.push(this._cf.coord.nodes[i]._vf.url);\n                }\n                return urls;\n            },\n\n            getNormalTexture: function()\n            {\n                if(this._cf.normal.node) {\n                    this._cf.normal.node._type = \"IG_normals\";\n                    return this._cf.normal.node;\n                } else {\n                    return null;\n                }\n            },\n\n            getNormalTextureURL: function()\n            {\n                if(this._cf.normal.node) {\n                    return this._cf.normal.node._vf.url;\n                } else {\n                    return null;\n                }\n            },\n\n            getTexCoordTexture: function()\n            {\n                if(this._cf.texCoord.node) {\n                    this._cf.texCoord.node._type = \"IG_texCoords\";\n                    return this._cf.texCoord.node;\n                } else {\n                    return null;\n                }\n            },\n\n            getTexCoordTextureURL: function()\n            {\n                if(this._cf.texCoord.node) {\n                    return this._cf.texCoord.node._vf.url;\n                } else {\n                    return null;\n                }\n            },\n\n            getColorTexture: function()\n            {\n                if(this._cf.color.node) {\n                    this._cf.color.node._type = \"IG_colors\";\n                    return this._cf.color.node;\n                } else {\n                    return null;\n                }\n            },\n\n            getColorTextureURL: function()\n            {\n                if(this._cf.color.node) {\n                    return this._cf.color.node._vf.url;\n                } else {\n                    return null;\n                }\n            },\n\n            getTextures: function()\n            {\n                var textures = [];\n\n                var i, index = this.getIndexTexture();\n                if(index) textures.push(index);\n\n                for(i=0; i<this.numCoordinateTextures(); i++) {\n                    var coord = this.getCoordinateTexture(i);\n                    if(coord) textures.push(coord);\n                }\n\n                var normal = this.getNormalTexture();\n                if(normal) textures.push(normal);\n\n                var texCoord = this.getTexCoordTexture();\n                if(texCoord) textures.push(texCoord);\n\n                var color = this.getColorTexture();\n                if(color) textures.push(color);\n\n                return textures;\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### IndexedFaceSet ### */\nx3dom.registerNodeType(\n    \"IndexedFaceSet\",\n    \"Geometry3D\",\n    defineClass(x3dom.nodeTypes.X3DComposedGeometryNode,\n        \n        /**\n         * Constructor for IndexedFaceSet\n         * @constructs x3dom.nodeTypes.IndexedFaceSet\n         * @x3d 3.3\n         * @component Geometry3D\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DComposedGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * The IndexedFaceSet node represents a 3D shape formed by constructing faces (polygons) from vertices listed in the coord field.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.IndexedFaceSet.superClass.call(this, ctx);\n\n\n            /**\n             * The creaseAngle field affects how default normals are generated.\n             * If the angle between the geometric normals of two adjacent faces is less than the crease angle, normals shall be calculated so that the faces are shaded smoothly across the edge; otherwise, normals shall be calculated so that a lighting discontinuity across the edge is produced.\n             * Crease angles shall be greater than or equal to 0.0 angle base units.\n             * @var {x3dom.fields.SFFloat} creaseAngle\n             * @memberof x3dom.nodeTypes.IndexedFaceSet\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'creaseAngle', 0);   // TODO\n\n            /**\n             * The convex field indicates whether all polygons in the shape are convex (TRUE).\n             * A polygon is convex if it is planar, does not intersect itself, and all of the interior angles at its vertices are less than 180 degrees.\n             * @var {x3dom.fields.SFBool} convex\n             * @memberof x3dom.nodeTypes.IndexedFaceSet\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'convex', true);\n\n\n            /**\n             * The index data for the coord data.\n             * @var {x3dom.fields.MFInt32} coordIndex\n             * @memberof x3dom.nodeTypes.IndexedFaceSet\n             * @initvalue []\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFInt32(ctx, 'coordIndex', []);\n\n            /**\n             * The index data for the normal data.\n             * @var {x3dom.fields.MFInt32} normalIndex\n             * @memberof x3dom.nodeTypes.IndexedFaceSet\n             * @initvalue []\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFInt32(ctx, 'normalIndex', []);\n\n            /**\n             * The index data for the color data.\n             * @var {x3dom.fields.MFInt32} colorIndex\n             * @memberof x3dom.nodeTypes.IndexedFaceSet\n             * @initvalue []\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFInt32(ctx, 'colorIndex', []);\n\n            /**\n             * The index data for the texcoord data.\n             * @var {x3dom.fields.MFInt32} texCoordIndex\n             * @memberof x3dom.nodeTypes.IndexedFaceSet\n             * @initvalue []\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFInt32(ctx, 'texCoordIndex', []);\n        \n        },\n        {\n            nodeChanged: function()\n            {\n                var time0 = new Date().getTime();\n\n                this.handleAttribs();\n\n                var indexes = this._vf.coordIndex;\n\n                //Last index value should be -1.\n                if (indexes.length && indexes[indexes.length-1] != -1)\n                {\n                    indexes.push(-1);\n                }\n\n                var normalInd = this._vf.normalIndex;\n                var texCoordInd = this._vf.texCoordIndex;\n                var colorInd = this._vf.colorIndex;\n\n                var hasNormal = false, hasNormalInd = false;\n                var hasTexCoord = false, hasTexCoordInd = false;\n                var hasColor = false, hasColorInd = false;\n\n                var colPerVert = this._vf.colorPerVertex;\n                var normPerVert = this._vf.normalPerVertex;\n\n                if (normalInd.length > 0)\n                {\n                    hasNormalInd = true;\n                }\n                if (texCoordInd.length > 0)\n                {\n                    hasTexCoordInd = true;\n                }\n                if (colorInd.length > 0)\n                {\n                    hasColorInd = true;\n                }\n\n                var positions, normals, texCoords, colors;\n\n                var coordNode = this._cf.coord.node;\n                x3dom.debug.assert(coordNode);\n                positions = coordNode.getPoints();\n\n                var normalNode = this._cf.normal.node;\n                if (normalNode)\n                {\n                    hasNormal = true;\n                    normals = normalNode._vf.vector;\n                }\n                else {\n                    hasNormal = false;\n                }\n\n                var texMode = \"\", numTexComponents = 2;\n                var texCoordNode = this._cf.texCoord.node;\n                if (x3dom.isa(texCoordNode, x3dom.nodeTypes.MultiTextureCoordinate)) {\n                    if (texCoordNode._cf.texCoord.nodes.length)\n                        texCoordNode = texCoordNode._cf.texCoord.nodes[0];\n                }\n                if (texCoordNode)\n                {\n                    if (texCoordNode._vf.point) {\n                        hasTexCoord = true;\n                        texCoords = texCoordNode._vf.point;\n                        if ( !hasTexCoordInd )\n                        {\n                            var i, lastTexCoord = texCoords.length;\n                            for (i = lastTexCoord; i<positions.length; i++)\n                            {\n                                texCoords.push( texCoords[ i % lastTexCoord ] );\n                            }\n                        }\n\n                        if (x3dom.isa(texCoordNode, x3dom.nodeTypes.TextureCoordinate3D)) {\n                            numTexComponents = 3;\n                        }\n                    }\n                    else if (texCoordNode._vf.mode) {\n                        texMode = texCoordNode._vf.mode;\n                    }\n                }\n                else {\n                    hasTexCoord = false;\n                }\n                this._mesh._numTexComponents = numTexComponents;\n\n                var numColComponents = 3;\n                var colorNode = this._cf.color.node;\n                if (colorNode)\n                {\n                    hasColor = true;\n                    colors = colorNode._vf.color;\n\n                    if (x3dom.isa(colorNode, x3dom.nodeTypes.ColorRGBA)) {\n                        numColComponents = 4;\n                    }\n                }\n                else {\n                    hasColor = false;\n                }\n                this._mesh._numColComponents = numColComponents;\n\n                this._mesh._indices[0] = [];\n                this._mesh._positions[0] = [];\n                this._mesh._normals[0] = [];\n                this._mesh._texCoords[0] = [];\n                this._mesh._colors[0] = [];\n\n                var i, j, t, cnt, faceCnt;\n                var p0, p1, p2, n0, n1, n2, t0, t1, t2, c0, c1, c2;\n\n                if ( (this._vf.creaseAngle <= x3dom.fields.Eps) ||  // FIXME; what to do for ipols?\n                    (positions.length > x3dom.Utils.maxIndexableCoords) ||\n                    (hasNormal && hasNormalInd) ||\n                    (hasTexCoord && hasTexCoordInd) ||\n                    (hasColor && hasColorInd) )\n                {\n                    if (this._vf.creaseAngle <= x3dom.fields.Eps)\n                        x3dom.debug.logWarning('Fallback to inefficient multi-index mode since creaseAngle=0.');\n\n                    // Found MultiIndex Mesh\n                    if(this._vf.convex) {\n                        t = 0;\n                        cnt = 0;\n                        faceCnt = 0;\n                        this._mesh._multiIndIndices = [];\n                        this._mesh._posSize = positions.length;\n\n                        for (i=0; i < indexes.length; ++i)\n                        {\n                            // Convert non-triangular polygons to a triangle fan\n                            // (TODO: this assumes polygons are convex)\n                            if (indexes[i] == -1) {\n                                t = 0;\n                                faceCnt++;\n                                continue;\n                            }\n\n                            if (hasNormalInd) {\n                                x3dom.debug.assert(normalInd[i] != -1);\n                            }\n                            if (hasTexCoordInd) {\n                                x3dom.debug.assert(texCoordInd[i] != -1);\n                            }\n                            if (hasColorInd) {\n                                x3dom.debug.assert(colorInd[i] != -1);\n                            }\n\n                            //TODO: OPTIMIZE but think about cache coherence regarding arrays!!!\n                            switch (t)\n                            {\n                                case 0:\n                                    p0 = +indexes[i];\n                                    if (hasNormalInd && normPerVert) { n0 = +normalInd[i]; }\n                                    else if (hasNormalInd && !normPerVert) { n0 = +normalInd[faceCnt]; }\n                                    else if (normPerVert) { n0 = p0; }\n                                    else { n0 = faceCnt; }\n\n                                    if (hasTexCoordInd) { t0 = +texCoordInd[i]; }\n                                    else { t0 = p0; }\n                                    if (hasColorInd && colPerVert) { c0 = +colorInd[i]; }\n                                    else if (hasColorInd && !colPerVert) { c0 = +colorInd[faceCnt]; }\n                                    else if (colPerVert) { c0 = p0; }\n                                    else { c0 = faceCnt; }\n                                    t = 1;\n                                    break;\n                                case 1:\n                                    p1 = +indexes[i];\n                                    if (hasNormalInd && normPerVert) { n1 = +normalInd[i]; }\n                                    else if (hasNormalInd && !normPerVert) { n1 = +normalInd[faceCnt]; }\n                                    else if (normPerVert) { n1 = p1; }\n                                    else { n1 = faceCnt; }\n\n                                    if (hasTexCoordInd) { t1 = +texCoordInd[i]; }\n                                    else { t1 = p1; }\n                                    if (hasColorInd && colPerVert) { c1 = +colorInd[i]; }\n                                    else if (hasColorInd && !colPerVert) { c1 = +colorInd[faceCnt]; }\n                                    else if (colPerVert) { c1 = p1; }\n                                    else { c1 = faceCnt; }\n                                    t = 2;\n                                    break;\n                                case 2:\n                                    p2 = +indexes[i];\n                                    if (hasNormalInd && normPerVert) { n2 = +normalInd[i]; }\n                                    else if (hasNormalInd && !normPerVert) { n2 = +normalInd[faceCnt]; }\n                                    else if (normPerVert) { n2 = p2; }\n                                    else { n2 = faceCnt; }\n\n                                    if (hasTexCoordInd) { t2 = +texCoordInd[i]; }\n                                    else { t2 = p2; }\n                                    if (hasColorInd && colPerVert) { c2 = +colorInd[i]; }\n                                    else if (hasColorInd && !colPerVert) { c2 = +colorInd[faceCnt]; }\n                                    else if (colPerVert) { c2 = p2; }\n                                    else { c2 = faceCnt; }\n                                    t = 3;\n\n                                    //this._mesh._indices[0].push(cnt++, cnt++, cnt++);\n\n                                    this._mesh._positions[0].push(positions[p0].x);\n                                    this._mesh._positions[0].push(positions[p0].y);\n                                    this._mesh._positions[0].push(positions[p0].z);\n                                    this._mesh._positions[0].push(positions[p1].x);\n                                    this._mesh._positions[0].push(positions[p1].y);\n                                    this._mesh._positions[0].push(positions[p1].z);\n                                    this._mesh._positions[0].push(positions[p2].x);\n                                    this._mesh._positions[0].push(positions[p2].y);\n                                    this._mesh._positions[0].push(positions[p2].z);\n\n                                    if (hasNormal) {\n                                        this._mesh._normals[0].push(normals[n0].x);\n                                        this._mesh._normals[0].push(normals[n0].y);\n                                        this._mesh._normals[0].push(normals[n0].z);\n                                        this._mesh._normals[0].push(normals[n1].x);\n                                        this._mesh._normals[0].push(normals[n1].y);\n                                        this._mesh._normals[0].push(normals[n1].z);\n                                        this._mesh._normals[0].push(normals[n2].x);\n                                        this._mesh._normals[0].push(normals[n2].y);\n                                        this._mesh._normals[0].push(normals[n2].z);\n                                    }\n                                    //else {\n                                    this._mesh._multiIndIndices.push(p0, p1, p2);\n                                    //this._mesh._multiIndIndices.push(cnt-3, cnt-2, cnt-1);\n                                    //}\n\n                                    if (hasColor) {\n                                        this._mesh._colors[0].push(colors[c0].r);\n                                        this._mesh._colors[0].push(colors[c0].g);\n                                        this._mesh._colors[0].push(colors[c0].b);\n                                        if (numColComponents === 4) {\n                                            this._mesh._colors[0].push(colors[c0].a);\n                                        }\n                                        this._mesh._colors[0].push(colors[c1].r);\n                                        this._mesh._colors[0].push(colors[c1].g);\n                                        this._mesh._colors[0].push(colors[c1].b);\n                                        if (numColComponents === 4) {\n                                            this._mesh._colors[0].push(colors[c1].a);\n                                        }\n                                        this._mesh._colors[0].push(colors[c2].r);\n                                        this._mesh._colors[0].push(colors[c2].g);\n                                        this._mesh._colors[0].push(colors[c2].b);\n                                        if (numColComponents === 4) {\n                                            this._mesh._colors[0].push(colors[c2].a);\n                                        }\n                                    }\n\n                                    if (hasTexCoord) {\n                                        this._mesh._texCoords[0].push(texCoords[t0].x);\n                                        this._mesh._texCoords[0].push(texCoords[t0].y);\n                                        if (numTexComponents === 3) {\n                                            this._mesh._texCoords[0].push(texCoords[t0].z);\n                                        }\n                                        this._mesh._texCoords[0].push(texCoords[t1].x);\n                                        this._mesh._texCoords[0].push(texCoords[t1].y);\n                                        if (numTexComponents === 3) {\n                                            this._mesh._texCoords[0].push(texCoords[t1].z);\n                                        }\n                                        this._mesh._texCoords[0].push(texCoords[t2].x);\n                                        this._mesh._texCoords[0].push(texCoords[t2].y);\n                                        if (numTexComponents === 3) {\n                                            this._mesh._texCoords[0].push(texCoords[t2].z);\n                                        }\n                                    }\n\n                                    //faceCnt++;\n                                    break;\n                                case 3:\n                                    p1 = p2;\n                                    t1 = t2;\n                                    if (normPerVert) {\n                                        n1 = n2;\n                                    }\n                                    if (colPerVert) {\n                                        c1 = c2;\n                                    }\n                                    p2 = +indexes[i];\n\n                                    if (hasNormalInd && normPerVert) {\n                                        n2 = +normalInd[i];\n                                    } else if (hasNormalInd && !normPerVert) {\n                                        /*n2 = +normalInd[faceCnt];*/\n                                    } else if (normPerVert) {\n                                        n2 = p2;\n                                    } else {\n                                        n2 = faceCnt;\n                                    }\n\n                                    if (hasTexCoordInd) {\n                                        t2 = +texCoordInd[i];\n                                    } else {\n                                        t2 = p2;\n                                    }\n\n                                    if (hasColorInd && colPerVert) {\n                                        c2 = +colorInd[i];\n                                    } else if (hasColorInd && !colPerVert) {\n                                        /*c2 = +colorInd[faceCnt];*/\n                                    } else if (colPerVert) {\n                                        c2 = p2;\n                                    } else {\n                                        c2 = faceCnt;\n                                    }\n\n                                    //this._mesh._indices[0].push(cnt++, cnt++, cnt++);\n\n                                    this._mesh._positions[0].push(positions[p0].x);\n                                    this._mesh._positions[0].push(positions[p0].y);\n                                    this._mesh._positions[0].push(positions[p0].z);\n                                    this._mesh._positions[0].push(positions[p1].x);\n                                    this._mesh._positions[0].push(positions[p1].y);\n                                    this._mesh._positions[0].push(positions[p1].z);\n                                    this._mesh._positions[0].push(positions[p2].x);\n                                    this._mesh._positions[0].push(positions[p2].y);\n                                    this._mesh._positions[0].push(positions[p2].z);\n\n                                    if (hasNormal) {\n                                        this._mesh._normals[0].push(normals[n0].x);\n                                        this._mesh._normals[0].push(normals[n0].y);\n                                        this._mesh._normals[0].push(normals[n0].z);\n                                        this._mesh._normals[0].push(normals[n1].x);\n                                        this._mesh._normals[0].push(normals[n1].y);\n                                        this._mesh._normals[0].push(normals[n1].z);\n                                        this._mesh._normals[0].push(normals[n2].x);\n                                        this._mesh._normals[0].push(normals[n2].y);\n                                        this._mesh._normals[0].push(normals[n2].z);\n                                    }\n                                    //else {\n                                    this._mesh._multiIndIndices.push(p0, p1, p2);\n                                    //this._mesh._multiIndIndices.push(cnt-3, cnt-2, cnt-1);\n                                    //}\n\n                                    if (hasColor) {\n                                        this._mesh._colors[0].push(colors[c0].r);\n                                        this._mesh._colors[0].push(colors[c0].g);\n                                        this._mesh._colors[0].push(colors[c0].b);\n                                        if (numColComponents === 4) {\n                                            this._mesh._colors[0].push(colors[c0].a);\n                                        }\n                                        this._mesh._colors[0].push(colors[c1].r);\n                                        this._mesh._colors[0].push(colors[c1].g);\n                                        this._mesh._colors[0].push(colors[c1].b);\n                                        if (numColComponents === 4) {\n                                            this._mesh._colors[0].push(colors[c1].a);\n                                        }\n                                        this._mesh._colors[0].push(colors[c2].r);\n                                        this._mesh._colors[0].push(colors[c2].g);\n                                        this._mesh._colors[0].push(colors[c2].b);\n                                        if (numColComponents === 4) {\n                                            this._mesh._colors[0].push(colors[c2].a);\n                                        }\n                                    }\n\n                                    if (hasTexCoord) {\n                                        this._mesh._texCoords[0].push(texCoords[t0].x);\n                                        this._mesh._texCoords[0].push(texCoords[t0].y);\n                                        if (numTexComponents === 3) {\n                                            this._mesh._texCoords[0].push(texCoords[t0].z);\n                                        }\n                                        this._mesh._texCoords[0].push(texCoords[t1].x);\n                                        this._mesh._texCoords[0].push(texCoords[t1].y);\n                                        if (numTexComponents === 3) {\n                                            this._mesh._texCoords[0].push(texCoords[t1].z);\n                                        }\n                                        this._mesh._texCoords[0].push(texCoords[t2].x);\n                                        this._mesh._texCoords[0].push(texCoords[t2].y);\n                                        if (numTexComponents === 3) {\n                                            this._mesh._texCoords[0].push(texCoords[t2].z);\n                                        }\n                                    }\n\n                                    //faceCnt++;\n                                    break;\n                                default:\n                            }\n                        }\n                    }\n                    else {\n                        var linklist = new x3dom.DoublyLinkedList();\n                        var data = {};\n                        cnt = 0; faceCnt = 0;\n\n                        for (i = 0; i < indexes.length; ++i)\n                        {\n                            if (indexes[i] == -1) {\n                                var multi_index_data = x3dom.EarClipping.getMultiIndexes(linklist);\n\n                                for (j = 0; j < multi_index_data.indices.length; j++)\n                                {\n                                    this._mesh._indices[0].push(cnt);\n                                    cnt++;\n\n                                    this._mesh._positions[0].push(multi_index_data.point[j].x,\n                                        multi_index_data.point[j].y,\n                                        multi_index_data.point[j].z);\n                                    if (hasNormal) {\n                                        this._mesh._normals[0].push(multi_index_data.normals[j].x,\n                                            multi_index_data.normals[j].y,\n                                            multi_index_data.normals[j].z);\n                                    }\n                                    if (hasColor) {\n                                        this._mesh._colors[0].push(multi_index_data.colors[j].r,\n                                            multi_index_data.colors[j].g,\n                                            multi_index_data.colors[j].b);\n                                        if (numColComponents === 4) {\n                                            this._mesh._colors[0].push(multi_index_data.colors[j].a);\n                                        }\n                                    }\n                                    if (hasTexCoord) {\n                                        this._mesh._texCoords[0].push(multi_index_data.texCoords[j].x,\n                                            multi_index_data.texCoords[j].y);\n                                        if (numTexComponents === 3) {\n                                            this._mesh._texCoords[0].push(multi_index_data.texCoords[j].z);\n                                        }\n                                    }\n                                }\n\n                                linklist = new x3dom.DoublyLinkedList();\n                                faceCnt++;\n                                continue;\n                            }\n\n                            if (hasNormal) {\n                                if (hasNormalInd && normPerVert) {\n                                    data.normals =  normals[normalInd[i]];\n                                } else if (hasNormalInd && !normPerVert) {\n                                    data.normals =  normals[normalInd[faceCnt]];\n                                } else {\n                                    data.normals =  normals[indexes[i]];\n                                }\n                            }\n\n                            if (hasColor) {\n                                if (hasColorInd && colPerVert) {\n                                    data.colors =  colors[colorInd[i]];\n                                } else if (hasColorInd && !colPerVert) {\n                                    data.colors =  colors[colorInd[faceCnt]];\n                                } else if (colPerVert) {\n                                    data.colors =  colors[indexes[i]];\n                                } else {\n                                    data.colors =  colors[faceCnt];\n                                }\n                            }\n                            if (hasTexCoord) {\n                                if (hasTexCoordInd) {\n                                    data.texCoords =  texCoords[texCoordInd[i]];\n                                } else {\n                                    data.texCoords =  texCoords[indexes[i]];\n                                }\n                            }\n\n                            linklist.appendNode(new x3dom.DoublyLinkedList.ListNode(\n                                positions[indexes[i]], indexes[i], data.normals, data.colors, data.texCoords));\n                        }\n\n                        this._mesh.splitMesh();\n                    }\n\n                    if (!hasNormal) {\n                        this._mesh.calcNormals(this._vf.creaseAngle, this._vf.ccw);\n                    }\n                    if (!hasTexCoord) {\n                        this._mesh.calcTexCoords(texMode);\n                    }\n                } // if isMulti\n                else\n                {\n                    t = 0;\n                    if (this._vf.convex) {\n                        for (i = 0; i < indexes.length; ++i)\n                        {\n                            // Convert non-triangular polygons to a triangle fan\n                            if (indexes[i] == -1) {\n                                t = 0;\n                                continue;\n                            }\n\n                            switch (t) {\n                                case 0: n0 = +indexes[i]; t = 1; break;\n                                case 1: n1 = +indexes[i]; t = 2; break;\n                                case 2: n2 = +indexes[i]; t = 3; this._mesh._indices[0].push(n0, n1, n2); break;\n                                case 3: n1 = n2; n2 = +indexes[i]; this._mesh._indices[0].push(n0, n1, n2); break;\n                            }\n\n                        }\n                    }\n                    else {\n                        //  Convert non-triangular convex polygons to a triangle fan\n                        linklist = new x3dom.DoublyLinkedList();\n                        for (i = 0; i < indexes.length; ++i)\n                        {\n                            if (indexes[i] == -1) {\n                                var linklist_indices = x3dom.EarClipping.getIndexes(linklist);\n\n                                for (j = 0; j < linklist_indices.length; j++) {\n                                    this._mesh._indices[0].push(linklist_indices[j]);\n                                }\n                                linklist = new x3dom.DoublyLinkedList();\n                                continue;\n                            }\n\n                            linklist.appendNode(new x3dom.DoublyLinkedList.ListNode(positions[indexes[i]], indexes[i]));\n                        }\n                    }\n\n                    this._mesh._positions[0] = positions.toGL();\n\n                    if (hasNormal) {\n                        this._mesh._normals[0] = normals.toGL();\n                    }\n                    else {\n                        this._mesh.calcNormals(this._vf.creaseAngle, this._vf.ccw);\n                    }\n                    if (hasTexCoord) {\n                        this._mesh._texCoords[0] = texCoords.toGL();\n                        this._mesh._numTexComponents = numTexComponents;\n                    }\n                    else {\n                        this._mesh.calcTexCoords(texMode);\n                    }\n                    if (hasColor) {\n                        this._mesh._colors[0] = colors.toGL();\n                        this._mesh._numColComponents = numColComponents;\n                    }\n                }\n\n                this.invalidateVolume();\n\n                this._mesh._numFaces = 0;\n                this._mesh._numCoords = 0;\n\n                for (i=0; i<this._mesh._positions.length; i++) {\n                    var indexLength = this._mesh._indices[i].length;\n                    var numCoords = this._mesh._positions[i].length / 3;\n                    this._mesh._numCoords += numCoords;\n                    if (indexLength > 0)\n                        this._mesh._numFaces += indexLength / 3;\n                    else\n                        this._mesh._numFaces += numCoords / 3;\n                }\n\n                //var time1 = new Date().getTime() - time0;\n                //x3dom.debug.logInfo(\"Mesh load time: \" + time1 + \" ms\");\n            },\n\n            fieldChanged: function(fieldName)\n            {\n                if (fieldName != \"coord\" && fieldName != \"normal\" &&\n                    fieldName != \"texCoord\" && fieldName != \"color\" &&\n                    fieldName != \"coordIndex\")\n                {\n                    x3dom.debug.logWarning(\"IndexedFaceSet: fieldChanged for \" +\n                        fieldName + \" not yet implemented!\");\n                    return;\n                }\n\n                var pnts = this._cf.coord.node._vf.point;\n                var n = pnts.length;\n\n                var texCoordNode = this._cf.texCoord.node;\n                if (x3dom.isa(texCoordNode, x3dom.nodeTypes.MultiTextureCoordinate)) {\n                    if (texCoordNode._cf.texCoord.nodes.length)\n                        texCoordNode = texCoordNode._cf.texCoord.nodes[0];\n                }\n\n                if (((this._vf.creaseAngle <= x3dom.fields.Eps) || (n > x3dom.Utils.maxIndexableCoords) ||\n                    (this._vf.normalIndex.length > 0 && this._cf.normal.node) ||\n                    (this._vf.texCoordIndex.length > 0 && texCoordNode) ||\n                    (this._vf.colorIndex.length > 0 && this._cf.color.node)) && this._mesh._multiIndIndices)\n                {\n                    var needNormals = !this._cf.normal.node && this._vf.normalUpdateMode.toLowerCase() != 'none';\n\n                    n = this._mesh._multiIndIndices.length;\n\n                    this._mesh._positions[0] = [];\n                    this._mesh._indices[0] =[];\n\n                    // special coordinate interpolator handler\n                    if (fieldName == \"coord\" && n)\n                    {\n                        if (needNormals) {\n                            this._mesh._normals[0] = [];\n                        }\n\n                        for (i=0; i<n; i+=3) {\n                            var ind0 = this._mesh._multiIndIndices[i  ];\n                            var ind1 = this._mesh._multiIndIndices[i+1];\n                            var ind2 = this._mesh._multiIndIndices[i+2];\n\n                            var pos0 = pnts[ind0];\n                            var pos1 = pnts[ind1];\n                            var pos2 = pnts[ind2];\n\n                            this._mesh._positions[0].push(pos0.x, pos0.y, pos0.z);\n                            this._mesh._positions[0].push(pos1.x, pos1.y, pos1.z);\n                            this._mesh._positions[0].push(pos2.x, pos2.y, pos2.z);\n\n                            if (needNormals) {\n                                var a = pos0.subtract(pos1);\n                                var b = pos1.subtract(pos2);\n\n                                var norm = a.cross(b).normalize();\n                                if (!this._vf.ccw)\n                                    norm = norm.negate();\n\n                                this._mesh._normals[0].push(norm.x, norm.y, norm.z);\n                                this._mesh._normals[0].push(norm.x, norm.y, norm.z);\n                                this._mesh._normals[0].push(norm.x, norm.y, norm.z);\n                            }\n                        }\n\n                        this.invalidateVolume();\n\n                        Array.forEach(this._parentNodes, function (node) {\n                            node._dirty.positions = true;\n                            if (needNormals)\n                                node._dirty.normals = true;\n                        });\n\n                        return;\n                    }\n\n                    // TODO; optimize this very slow and brute force code, at least for creaseAngle=0 case!\n                    this._mesh._normals[0] = [];\n                    this._mesh._texCoords[0] =[];\n                    this._mesh._colors[0] = [];\n\n                    var indexes = this._vf.coordIndex;\n                    var normalInd = this._vf.normalIndex;\n                    var texCoordInd = this._vf.texCoordIndex;\n                    var colorInd = this._vf.colorIndex;\n                    var hasNormal = false, hasNormalInd = false;\n                    var hasTexCoord = false, hasTexCoordInd = false;\n                    var hasColor = false, hasColorInd = false;\n\n                    var colPerVert = this._vf.colorPerVertex;\n                    var normPerVert = this._vf.normalPerVertex;\n\n                    if (normalInd.length > 0)\n                    {\n                        hasNormalInd = true;\n                    }\n                    if (texCoordInd.length > 0)\n                    {\n                        hasTexCoordInd = true;\n                    }\n                    if (colorInd.length > 0)\n                    {\n                        hasColorInd = true;\n                    }\n\n                    var positions, normals, texCoords, colors;\n\n                    var coordNode = this._cf.coord.node;\n                    x3dom.debug.assert(coordNode);\n                    positions = coordNode.getPoints();\n\n                    var normalNode = this._cf.normal.node;\n                    if (normalNode)\n                    {\n                        hasNormal = true;\n                        normals = normalNode._vf.vector;\n                    }\n                    else {\n                        hasNormal = false;\n                    }\n\n                    var texMode = \"\", numTexComponents = 2;\n                    texCoordNode = this._cf.texCoord.node;\n                    if (x3dom.isa(texCoordNode, x3dom.nodeTypes.MultiTextureCoordinate)) {\n                        if (texCoordNode._cf.texCoord.nodes.length)\n                            texCoordNode = texCoordNode._cf.texCoord.nodes[0];\n                    }\n                    if (texCoordNode)\n                    {\n                        if (texCoordNode._vf.point) {\n                            hasTexCoord = true;\n                            texCoords = texCoordNode._vf.point;\n                            if ( !hasTexCoordInd )\n                            {\n                                var i, lastTexCoord = texCoords.length;\n                                for (i = lastTexCoord; i<positions.length; i++)\n                                {\n                                    texCoords.push( texCoords[ i % lastTexCoord ] );\n                                }\n                            }\n\n                            if (x3dom.isa(texCoordNode, x3dom.nodeTypes.TextureCoordinate3D)) {\n                                numTexComponents = 3;\n                            }\n                        }\n                        else if (texCoordNode._vf.mode) {\n                            texMode = texCoordNode._vf.mode;\n                        }\n                    }\n                    else {\n                        hasTexCoord = false;\n                    }\n                    this._mesh._numTexComponents = numTexComponents;\n\n                    var numColComponents = 3;\n                    var colorNode = this._cf.color.node;\n                    if (colorNode)\n                    {\n                        hasColor = true;\n                        colors = colorNode._vf.color;\n\n                        if (x3dom.isa(colorNode, x3dom.nodeTypes.ColorRGBA)) {\n                            numColComponents = 4;\n                        }\n                    }\n                    else {\n                        hasColor = false;\n                    }\n                    this._mesh._numColComponents = numColComponents;\n\n                    var i, j, t, cnt, faceCnt;\n                    var p0, p1, p2, n0, n1, n2, t0, t1, t2, c0, c1, c2;\n\n                    if(this._vf.convex) {\n                        t = 0;\n                        cnt = 0;\n                        faceCnt = 0;\n                        this._mesh._multiIndIndices = [];\n                        this._mesh._posSize = positions.length;\n\n                        for (i=0; i < indexes.length; ++i)\n                        {\n                            if (indexes[i] == -1) {\n                                t = 0;\n                                faceCnt++;\n                                continue;\n                            }\n\n                            if (hasNormalInd) {\n                                x3dom.debug.assert(normalInd[i] != -1);\n                            }\n                            if (hasTexCoordInd) {\n                                x3dom.debug.assert(texCoordInd[i] != -1);\n                            }\n                            if (hasColorInd) {\n                                x3dom.debug.assert(colorInd[i] != -1);\n                            }\n\n                            switch (t)\n                            {\n                                case 0:\n                                    p0 = +indexes[i];\n                                    if (hasNormalInd && normPerVert) { n0 = +normalInd[i]; }\n                                    else if (hasNormalInd && !normPerVert) { n0 = +normalInd[faceCnt]; }\n                                    else if (normPerVert) { n0 = p0; }\n                                    else { n0 = faceCnt; }\n\n                                    if (hasTexCoordInd) { t0 = +texCoordInd[i]; }\n                                    else { t0 = p0; }\n                                    if (hasColorInd && colPerVert) { c0 = +colorInd[i]; }\n                                    else if (hasColorInd && !colPerVert) { c0 = +colorInd[faceCnt]; }\n                                    else if (colPerVert) { c0 = p0; }\n                                    else { c0 = faceCnt; }\n                                    t = 1;\n                                    break;\n                                case 1:\n                                    p1 = +indexes[i];\n                                    if (hasNormalInd && normPerVert) { n1 = +normalInd[i]; }\n                                    else if (hasNormalInd && !normPerVert) { n1 = +normalInd[faceCnt]; }\n                                    else if (normPerVert) { n1 = p1; }\n                                    else { n1 = faceCnt; }\n\n                                    if (hasTexCoordInd) { t1 = +texCoordInd[i]; }\n                                    else { t1 = p1; }\n                                    if (hasColorInd && colPerVert) { c1 = +colorInd[i]; }\n                                    else if (hasColorInd && !colPerVert) { c1 = +colorInd[faceCnt]; }\n                                    else if (colPerVert) { c1 = p1; }\n                                    else { c1 = faceCnt; }\n                                    t = 2;\n                                    break;\n                                case 2:\n                                    p2 = +indexes[i];\n                                    if (hasNormalInd && normPerVert) { n2 = +normalInd[i]; }\n                                    else if (hasNormalInd && !normPerVert) { n2 = +normalInd[faceCnt]; }\n                                    else if (normPerVert) { n2 = p2; }\n                                    else { n2 = faceCnt; }\n\n                                    if (hasTexCoordInd) { t2 = +texCoordInd[i]; }\n                                    else { t2 = p2; }\n                                    if (hasColorInd && colPerVert) { c2 = +colorInd[i]; }\n                                    else if (hasColorInd && !colPerVert) { c2 = +colorInd[faceCnt]; }\n                                    else if (colPerVert) { c2 = p2; }\n                                    else { c2 = faceCnt; }\n                                    t = 3;\n\n                                    //this._mesh._indices[0].push(cnt++, cnt++, cnt++);\n\n                                    this._mesh._positions[0].push(positions[p0].x);\n                                    this._mesh._positions[0].push(positions[p0].y);\n                                    this._mesh._positions[0].push(positions[p0].z);\n                                    this._mesh._positions[0].push(positions[p1].x);\n                                    this._mesh._positions[0].push(positions[p1].y);\n                                    this._mesh._positions[0].push(positions[p1].z);\n                                    this._mesh._positions[0].push(positions[p2].x);\n                                    this._mesh._positions[0].push(positions[p2].y);\n                                    this._mesh._positions[0].push(positions[p2].z);\n\n                                    if (hasNormal) {\n                                        this._mesh._normals[0].push(normals[n0].x);\n                                        this._mesh._normals[0].push(normals[n0].y);\n                                        this._mesh._normals[0].push(normals[n0].z);\n                                        this._mesh._normals[0].push(normals[n1].x);\n                                        this._mesh._normals[0].push(normals[n1].y);\n                                        this._mesh._normals[0].push(normals[n1].z);\n                                        this._mesh._normals[0].push(normals[n2].x);\n                                        this._mesh._normals[0].push(normals[n2].y);\n                                        this._mesh._normals[0].push(normals[n2].z);\n                                    }\n                                    //else {\n                                    this._mesh._multiIndIndices.push(p0, p1, p2);\n                                    //}\n\n                                    if (hasColor) {\n                                        this._mesh._colors[0].push(colors[c0].r);\n                                        this._mesh._colors[0].push(colors[c0].g);\n                                        this._mesh._colors[0].push(colors[c0].b);\n                                        if (numColComponents === 4) {\n                                            this._mesh._colors[0].push(colors[c0].a);\n                                        }\n                                        this._mesh._colors[0].push(colors[c1].r);\n                                        this._mesh._colors[0].push(colors[c1].g);\n                                        this._mesh._colors[0].push(colors[c1].b);\n                                        if (numColComponents === 4) {\n                                            this._mesh._colors[0].push(colors[c1].a);\n                                        }\n                                        this._mesh._colors[0].push(colors[c2].r);\n                                        this._mesh._colors[0].push(colors[c2].g);\n                                        this._mesh._colors[0].push(colors[c2].b);\n                                        if (numColComponents === 4) {\n                                            this._mesh._colors[0].push(colors[c2].a);\n                                        }\n                                    }\n\n                                    if (hasTexCoord) {\n                                        this._mesh._texCoords[0].push(texCoords[t0].x);\n                                        this._mesh._texCoords[0].push(texCoords[t0].y);\n                                        if (numTexComponents === 3) {\n                                            this._mesh._texCoords[0].push(texCoords[t0].z);\n                                        }\n                                        this._mesh._texCoords[0].push(texCoords[t1].x);\n                                        this._mesh._texCoords[0].push(texCoords[t1].y);\n                                        if (numTexComponents === 3) {\n                                            this._mesh._texCoords[0].push(texCoords[t1].z);\n                                        }\n                                        this._mesh._texCoords[0].push(texCoords[t2].x);\n                                        this._mesh._texCoords[0].push(texCoords[t2].y);\n                                        if (numTexComponents === 3) {\n                                            this._mesh._texCoords[0].push(texCoords[t2].z);\n                                        }\n                                    }\n\n                                    //faceCnt++;\n                                    break;\n                                case 3:\n                                    p1 = p2;\n                                    t1 = t2;\n                                    if (normPerVert) {\n                                        n1 = n2;\n                                    }\n                                    if (colPerVert) {\n                                        c1 = c2;\n                                    }\n                                    p2 = +indexes[i];\n\n                                    if (hasNormalInd && normPerVert) {\n                                        n2 = +normalInd[i];\n                                    } else if (hasNormalInd && !normPerVert) {\n                                        /*n2 = +normalInd[faceCnt];*/\n                                    } else if (normPerVert) {\n                                        n2 = p2;\n                                    } else {\n                                        n2 = faceCnt;\n                                    }\n\n                                    if (hasTexCoordInd) {\n                                        t2 = +texCoordInd[i];\n                                    } else {\n                                        t2 = p2;\n                                    }\n\n                                    if (hasColorInd && colPerVert) {\n                                        c2 = +colorInd[i];\n                                    } else if (hasColorInd && !colPerVert) {\n                                        /*c2 = +colorInd[faceCnt];*/\n                                    } else if (colPerVert) {\n                                        c2 = p2;\n                                    } else {\n                                        c2 = faceCnt;\n                                    }\n\n                                    //this._mesh._indices[0].push(cnt++, cnt++, cnt++);\n\n                                    this._mesh._positions[0].push(positions[p0].x);\n                                    this._mesh._positions[0].push(positions[p0].y);\n                                    this._mesh._positions[0].push(positions[p0].z);\n                                    this._mesh._positions[0].push(positions[p1].x);\n                                    this._mesh._positions[0].push(positions[p1].y);\n                                    this._mesh._positions[0].push(positions[p1].z);\n                                    this._mesh._positions[0].push(positions[p2].x);\n                                    this._mesh._positions[0].push(positions[p2].y);\n                                    this._mesh._positions[0].push(positions[p2].z);\n\n                                    if (hasNormal) {\n                                        this._mesh._normals[0].push(normals[n0].x);\n                                        this._mesh._normals[0].push(normals[n0].y);\n                                        this._mesh._normals[0].push(normals[n0].z);\n                                        this._mesh._normals[0].push(normals[n1].x);\n                                        this._mesh._normals[0].push(normals[n1].y);\n                                        this._mesh._normals[0].push(normals[n1].z);\n                                        this._mesh._normals[0].push(normals[n2].x);\n                                        this._mesh._normals[0].push(normals[n2].y);\n                                        this._mesh._normals[0].push(normals[n2].z);\n                                    }\n                                    //else {\n                                    this._mesh._multiIndIndices.push(p0, p1, p2);\n                                    //}\n\n                                    if (hasColor) {\n                                        this._mesh._colors[0].push(colors[c0].r);\n                                        this._mesh._colors[0].push(colors[c0].g);\n                                        this._mesh._colors[0].push(colors[c0].b);\n                                        if (numColComponents === 4) {\n                                            this._mesh._colors[0].push(colors[c0].a);\n                                        }\n                                        this._mesh._colors[0].push(colors[c1].r);\n                                        this._mesh._colors[0].push(colors[c1].g);\n                                        this._mesh._colors[0].push(colors[c1].b);\n                                        if (numColComponents === 4) {\n                                            this._mesh._colors[0].push(colors[c1].a);\n                                        }\n                                        this._mesh._colors[0].push(colors[c2].r);\n                                        this._mesh._colors[0].push(colors[c2].g);\n                                        this._mesh._colors[0].push(colors[c2].b);\n                                        if (numColComponents === 4) {\n                                            this._mesh._colors[0].push(colors[c2].a);\n                                        }\n                                    }\n\n                                    if (hasTexCoord) {\n                                        this._mesh._texCoords[0].push(texCoords[t0].x);\n                                        this._mesh._texCoords[0].push(texCoords[t0].y);\n                                        if (numTexComponents === 3) {\n                                            this._mesh._texCoords[0].push(texCoords[t0].z);\n                                        }\n                                        this._mesh._texCoords[0].push(texCoords[t1].x);\n                                        this._mesh._texCoords[0].push(texCoords[t1].y);\n                                        if (numTexComponents === 3) {\n                                            this._mesh._texCoords[0].push(texCoords[t1].z);\n                                        }\n                                        this._mesh._texCoords[0].push(texCoords[t2].x);\n                                        this._mesh._texCoords[0].push(texCoords[t2].y);\n                                        if (numTexComponents === 3) {\n                                            this._mesh._texCoords[0].push(texCoords[t2].z);\n                                        }\n                                    }\n\n                                    //faceCnt++;\n                                    break;\n                                default:\n                            }\n                        }\n                    }\n                    else {\n                        var linklist = new x3dom.DoublyLinkedList();\n                        var data = {};\n                        cnt = 0; faceCnt = 0;\n\n                        for (i = 0; i < indexes.length; ++i)\n                        {\n                            if (indexes[i] == -1) {\n                                var multi_index_data = x3dom.EarClipping.getMultiIndexes(linklist);\n\n                                for (j = 0; j < multi_index_data.indices.length; j++)\n                                {\n                                    this._mesh._indices[0].push(cnt);\n                                    cnt++;\n\n                                    this._mesh._positions[0].push(multi_index_data.point[j].x,\n                                        multi_index_data.point[j].y,\n                                        multi_index_data.point[j].z);\n                                    if (hasNormal) {\n                                        this._mesh._normals[0].push(multi_index_data.normals[j].x,\n                                            multi_index_data.normals[j].y,\n                                            multi_index_data.normals[j].z);\n                                    }\n                                    if (hasColor) {\n                                        this._mesh._colors[0].push(multi_index_data.colors[j].r,\n                                            multi_index_data.colors[j].g,\n                                            multi_index_data.colors[j].b);\n                                        if (numColComponents === 4) {\n                                            this._mesh._colors[0].push(multi_index_data.colors[j].a);\n                                        }\n                                    }\n                                    if (hasTexCoord) {\n                                        this._mesh._texCoords[0].push(multi_index_data.texCoords[j].x,\n                                            multi_index_data.texCoords[j].y);\n                                        if (numTexComponents === 3) {\n                                            this._mesh._texCoords[0].push(multi_index_data.texCoords[j].z);\n                                        }\n                                    }\n                                }\n\n                                linklist = new x3dom.DoublyLinkedList();\n                                faceCnt++;\n                                continue;\n                            }\n\n                            if (hasNormal) {\n                                if (hasNormalInd && normPerVert) {\n                                    data.normals =  normals[normalInd[i]];\n                                } else if (hasNormalInd && !normPerVert) {\n                                    data.normals =  normals[normalInd[faceCnt]];\n                                } else {\n                                    data.normals =  normals[indexes[i]];\n                                }\n                            }\n\n                            if (hasColor) {\n                                if (hasColorInd && colPerVert) {\n                                    data.colors =  colors[colorInd[i]];\n                                } else if (hasColorInd && !colPerVert) {\n                                    data.colors =  colors[colorInd[faceCnt]];\n                                } else {\n                                    data.colors =  colors[indexes[i]];\n                                }\n                            }\n                            if (hasTexCoord) {\n                                if (hasTexCoordInd) {\n                                    data.texCoords =  texCoords[texCoordInd[i]];\n                                } else {\n                                    data.texCoords =  texCoords[indexes[i]];\n                                }\n                            }\n\n                            linklist.appendNode(new x3dom.DoublyLinkedList.ListNode(\n                                positions[indexes[i]], indexes[i], data.normals, data.colors, data.texCoords));\n                        }\n\n                        this._mesh.splitMesh();\n                    }\n\n                    if (!hasNormal) {\n                        this._mesh.calcNormals(this._vf.creaseAngle, this._vf.ccw);\n                    }\n                    if (!hasTexCoord) {\n                        this._mesh.calcTexCoords(texMode);\n                    }\n\n                    this.invalidateVolume();\n\n                    this._mesh._numFaces = 0;\n                    this._mesh._numCoords = 0;\n\n                    for (i=0; i<this._mesh._positions.length; i++) {\n                        var indexLength = this._mesh._indices[i].length;\n                        var numCoords = this._mesh._positions[i].length / 3;\n                        this._mesh._numCoords += numCoords;\n                        if (indexLength > 0)\n                            this._mesh._numFaces += indexLength / 3;\n                        else\n                            this._mesh._numFaces += numCoords / 3;\n                    }\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node.setGeoDirty();\n                    });\n                }\n                else {\n                    if (fieldName == \"coord\")\n                    {\n                        var needNormals = !this._cf.normal.node && this._vf.normalUpdateMode.toLowerCase() != 'none';\n\n                        this._mesh._positions[0] = pnts.toGL();\n\n                        if (needNormals) {\n                            // position update usually also requires update of vertex normals\n                            this._mesh.calcNormals(this._vf.creaseAngle, this._vf.ccw);\n                        }\n\n                        // tells the mesh that its bbox requires update\n                        this.invalidateVolume();\n\n                        Array.forEach(this._parentNodes, function (node) {\n                            node._dirty.positions = true;\n                            if (needNormals)\n                                node._dirty.normals = true;\n                            node.invalidateVolume();\n                        });\n                    }\n                    else if (fieldName == \"color\")\n                    {\n                        pnts = this._cf.color.node._vf.color;\n\n                        this._mesh._colors[0] = pnts.toGL();\n\n                        Array.forEach(this._parentNodes, function (node) {\n                            node._dirty.colors = true;\n                        });\n                    }\n                    else if (fieldName == \"normal\")\n                    {\n                        pnts = this._cf.normal.node._vf.vector;\n\n                        this._mesh._normals[0] = pnts.toGL();\n\n                        Array.forEach(this._parentNodes, function (node) {\n                            node._dirty.normals = true;\n                        });\n                    }\n                    else if (fieldName == \"texCoord\")\n                    {\n                        texCoordNode = this._cf.texCoord.node;\n                        if (x3dom.isa(texCoordNode, x3dom.nodeTypes.MultiTextureCoordinate)) {\n                            if (texCoordNode._cf.texCoord.nodes.length)\n                                texCoordNode = texCoordNode._cf.texCoord.nodes[0];\n                        }\n                        pnts = texCoordNode._vf.point;\n\n                        this._mesh._texCoords[0] = pnts.toGL();\n\n                        Array.forEach(this._parentNodes, function (node) {\n                            node._dirty.texcoords = true;\n                        });\n                    }\n                    else if (fieldName == \"coordIndex\")\n                    {\n                        needNormals = !this._cf.normal.node && this._vf.normalUpdateMode.toLowerCase() != 'none';\n\n                        indexes = this._vf.coordIndex;\n                        t = 0;\n                        n = indexes.length;\n\n                        this._mesh._indices[0] = [];\n\n                        for (i = 0; i < n; ++i) {\n                            if (indexes[i] == -1) {\n                                t = 0;\n                            }\n                            else {\n                                switch (t) {\n                                    case 0: p0 = +indexes[i]; t = 1; break;\n                                    case 1: p1 = +indexes[i]; t = 2; break;\n                                    case 2: p2 = +indexes[i]; t = 3; this._mesh._indices[0].push(p0, p1, p2); break;\n                                    case 3: p1 = p2; p2 = +indexes[i]; this._mesh._indices[0].push(p0, p1, p2); break;\n                                }\n                            }\n                        }\n\n                        if (needNormals) {\n                            // index update usually also requires update of vertex normals\n                            this._mesh.calcNormals(this._vf.creaseAngle, this._vf.ccw);\n                        }\n\n                        Array.forEach(this._parentNodes, function (node) {\n                            node._dirty.indexes = true;\n                            if (needNormals)\n                                node._dirty.normals = true;\n                        });\n                    }\n                }\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### BinaryGeometry ### */\nx3dom.registerNodeType(\n    \"BufferGeometry\",\n    \"Geometry3D\",\n    defineClass(x3dom.nodeTypes.X3DBinaryContainerGeometryNode,\n\n        /**\n         * Constructor for BufferGeometry\n         * @constructs x3dom.nodeTypes.BufferGeometry\n         * @x3d x.x\n         * @component Geometry3D\n         * @extends x3dom.nodeTypes.X3DBinaryContainerGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The BufferGeometry node can load binary data like glTF buffer.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.BufferGeometry.superClass.call(this, ctx);\n\n\n            /**\n             * The url to the binary file, that contains the buffer data.\n             * @var {x3dom.fields.SFString} buffer\n             * @memberof x3dom.nodeTypes.BufferGeometry\n             * @initvalue \"\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'buffer', \"\");\n\n            this.addField_MFNode('views', x3dom.nodeTypes.BufferView);\n            this.addField_MFNode('accessors', x3dom.nodeTypes.BufferAccessor);\n\n            this._hasColor = false;\n            this._hasMultiTexCoord = false;\n            this._indexed = false;\n        },\n        {\n            parentAdded: function(parent)\n            {\n\n            },\n\n            nodeChanged: function()\n            {\n\n            },\n\n            doIntersect: function(line)\n            {\n                var min = this.getMin();\n                var max = this.getMax();\n                var isect = line.intersect(min, max);\n\n                if (isect && line.enter < line.dist) {\n                    line.dist = line.enter;\n                    line.hitObject = this;\n                    line.hitPoint = line.pos.add(line.dir.multiply(line.enter));\n                    return true;\n                }\n                else {\n                    return false;\n                }\n            },\n\n            hasColor: function() {\n                return this._hasColor;\n            },\n\n            hasMultiTexCoord: function() {\n                return this._hasMultiTexCoord;\n            },\n\n            getPrecisionMax: function(type)\n            {\n                switch(this._vf[type])\n                {\n                    case \"Int8\":\n                        return 127.0;\n                    case \"Uint8\":\n                        return 255.0;\n                    case \"Int16\":\n                        return 32767.0;\n                    case \"Uint16\":\n                        return 65535.0;\n                    case \"Int32\":\n                        return 2147483647.0;\n                    case \"Uint32\":\n                        return 4294967295.0;\n                    case \"Float32\":\n                    case \"Float64\":\n                    default:\n                        return 1.0;\n                }\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### BinaryGeometry ### */\nx3dom.registerNodeType(\n    \"BufferView\",\n    \"Geometry3D\",\n    defineClass(x3dom.nodeTypes.X3DNode,\n\n        /**\n         * Constructor for BufferView\n         * @constructs x3dom.nodeTypes.BufferView\n         * @x3d x.x\n         * @component Geometry3D\n         * @extends x3dom.nodeTypes.X3DNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The BufferAccessor node is experimental.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.BufferView.superClass.call(this, ctx);\n\n            /**\n             * The buffer target vertex or index\n             * @var {x3dom.fields.SFInt32} target\n             * @memberof x3dom.nodeTypes.BufferView\n             * @initvalue 34962\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'target', 34962);\n\n            /**\n             * The buffer byteOffset\n             * @var {x3dom.fields.SFInt32} byteOffset\n             * @memberof x3dom.nodeTypes.BufferView\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'byteOffset', 0);\n\n            /**\n             * The buffer byteStride\n             * @var {x3dom.fields.SFInt32} byteStride\n             * @memberof x3dom.nodeTypes.BufferView\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'byteStride', 0);\n\n            /**\n             * The buffer byteLength\n             * @var {x3dom.fields.SFInt32} byteLength\n             * @memberof x3dom.nodeTypes.BufferView\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'byteLength', 0);\n\n            /**\n             * The buffer id\n             * @var {x3dom.fields.SFInt32} id\n             * @memberof x3dom.nodeTypes.BufferView\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'id', 0);\n        },\n        {\n            parentAdded: function(parent)\n            {\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### BinaryGeometry ### */\nx3dom.registerNodeType(\n    \"BufferAccessor\",\n    \"Geometry3D\",\n    defineClass(x3dom.nodeTypes.X3DNode,\n\n        /**\n         * Constructor for BufferAccessor\n         * @constructs x3dom.nodeTypes.BufferAccessor\n         * @x3d x.x\n         * @component Geometry3D\n         * @extends x3dom.nodeTypes.X3DNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The BufferAccessor node is experimental.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.BufferAccessor.superClass.call(this, ctx);\n\n            /**\n             * The target vertex attribute or vertex index\n             * @var {x3dom.fields.SFString} bufferType\n             * @memberof x3dom.nodeTypes.BufferAccessor\n             * @initvalue \"\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'bufferType', \"\");\n\n            /**\n             * The related buffer view\n             * @var {x3dom.fields.SFInt32} view\n             * @memberof x3dom.nodeTypes.BufferAccessor\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'view', 0);\n\n            /**\n             * The buffer byteOffset\n             * @var {x3dom.fields.SFInt32} byteOffset\n             * @memberof x3dom.nodeTypes.BufferAccessor\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'byteOffset', 0);\n\n            /**\n             * The buffer byteStride\n             * @var {x3dom.fields.SFInt32} byteStride\n             * @memberof x3dom.nodeTypes.BufferAccessor\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'byteStride', 0);\n\n            /**\n             * The buffer components\n             * @var {x3dom.fields.SFInt32} components\n             * @memberof x3dom.nodeTypes.BufferAccessor\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'components', 0);\n\n            /**\n             * The buffer componentType\n             * @var {x3dom.fields.SFInt32} componentType\n             * @memberof x3dom.nodeTypes.BufferAccessor\n             * @initvalue 5126\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'componentType', 5126);\n\n            /**\n             * The buffer element count\n             * @var {x3dom.fields.SFInt32} count\n             * @memberof x3dom.nodeTypes.BufferAccessor\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'count', 0);\n\n            /**\n             * Attribute normalization\n             * @var {x3dom.fields.SFInt32} normalized\n             * @memberof x3dom.nodeTypes.BufferAccessor\n             * @initvalue false\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'normalized', false);\n        },\n        {\n            parentAdded: function(parent)\n            {\n                switch(this._vf.bufferType)\n                {\n                    case \"COLOR_0\":\n                    case \"COLOR\" : parent._hasColor = true; break;\n                    case \"INDEX\" : parent._indexed = true; break;\n                    case \"TEXCOORD_1\" : parent._hasMultiTexCoord = true; break;\n                }\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### X3DTexture3DNode ### */\nx3dom.registerNodeType(\n    \"X3DTexture3DNode\",\n    \"Texturing3D\",\n    defineClass(x3dom.nodeTypes.X3DTextureNode,\n        \n        /**\n         * Constructor for X3DTexture3DNode\n         * @constructs x3dom.nodeTypes.X3DTexture3DNode\n         * @x3d 3.3\n         * @component Texturing3D\n         * @status full\n         * @extends x3dom.nodeTypes.X3DTextureNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc This abstract node type is the base type for all node types that specify 3D sources for texture images.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DTexture3DNode.superClass.call(this, ctx);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### ComposedTexture3D ### */\nx3dom.registerNodeType(\n    \"ComposedTexture3D\",\n    \"Texturing3D\",\n    defineClass(x3dom.nodeTypes.X3DTexture3DNode,\n        \n        /**\n         * Constructor for ComposedTexture3D\n         * @constructs x3dom.nodeTypes.ComposedTexture3D\n         * @x3d 3.3\n         * @component Texturing3D\n         * @status full\n         * @extends x3dom.nodeTypes.X3DTexture3DNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The ComposedTexture3D node defines a 3D image-based texture map as a collection of 2D texture sources at various depths and parameters controlling tiling repetition of the texture onto geometry.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.ComposedTexture3D.superClass.call(this, ctx);\n\n\n            /**\n             * The texture values are interpreted with the first image being at depth 0 and each following image representing an increasing depth value in the R direction.\n             * A user shall provide 2^n source textures in this array. The individual source textures will ignore their repeat field values.\n             * @var {x3dom.fields.MFNode} texture\n             * @memberof x3dom.nodeTypes.ComposedTexture3D\n             * @initvalue x3dom.nodeTypes.X3DTexture3DNode\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFNode('texture', x3dom.nodeTypes.X3DTexture3DNode);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### ImageTexture3D ### */\nx3dom.registerNodeType(\n    \"ImageTexture3D\",\n    \"Texturing3D\",\n    defineClass(x3dom.nodeTypes.X3DTexture3DNode,\n        \n        /**\n         * Constructor for ImageTexture3D\n         * @constructs x3dom.nodeTypes.ImageTexture3D\n         * @x3d 3.3\n         * @component Texturing3D\n         * @status full\n         * @extends x3dom.nodeTypes.X3DTexture3DNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The ImageTexture3D node defines a texture map by specifying a single image file that contains complete 3D data and general parameters for mapping texels to geometry.\n         * The texture is read from the URL specified by the url field. When the url field contains no values ([]), texturing is disabled.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.ImageTexture3D.superClass.call(this, ctx);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### PixelTexture3D ### */\nx3dom.registerNodeType(\n    \"PixelTexture3D\",\n    \"Texturing3D\",\n    defineClass(x3dom.nodeTypes.X3DTexture3DNode,\n        \n        /**\n         * Constructor for PixelTexture3D\n         * @constructs x3dom.nodeTypes.PixelTexture3D\n         * @x3d 3.3\n         * @component Texturing3D\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DTexture3DNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The PixelTexture3D node defines a 3D image-based texture map as an explicit array of pixel values (image field) and parameters controlling tiling repetition of the texture onto geometry.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.PixelTexture3D.superClass.call(this, ctx);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### TextureCoordinate3D ### */\nx3dom.registerNodeType(\n    \"TextureCoordinate3D\",\n    \"Texturing3D\",\n    defineClass(x3dom.nodeTypes.X3DTextureCoordinateNode,\n        \n        /**\n         * Constructor for TextureCoordinate3D\n         * @constructs x3dom.nodeTypes.TextureCoordinate3D\n         * @x3d 3.3\n         * @component Texturing3D\n         * @status full\n         * @extends x3dom.nodeTypes.X3DTextureCoordinateNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The TextureCoordinate3D node is a geometry property node that specifies a set of 3D texture coordinates used by vertex-based geometry nodes (e.g., IndexedFaceSet and ElevationGrid) to map 3D textures to vertices.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.TextureCoordinate3D.superClass.call(this, ctx);\n\n\n            /**\n             * Specifies the array of texture coordinates.\n             * @var {x3dom.fields.MFVec3f} point\n             * @memberof x3dom.nodeTypes.TextureCoordinate3D\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFVec3f(ctx, 'point', []);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### TextureTransform3D ### */\nx3dom.registerNodeType(\n    \"TextureTransform3D\",\n    \"Texturing3D\",\n    defineClass(x3dom.nodeTypes.X3DTextureTransformNode,\n        \n        /**\n         * Constructor for TextureTransform3D\n         * @constructs x3dom.nodeTypes.TextureTransform3D\n         * @x3d 3.3\n         * @component Texturing3D\n         * @status full\n         * @extends x3dom.nodeTypes.X3DTextureTransformNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * The TextureTransform3D node specifies a 3D transformation that is applied to texture coordinates.\n         * This node affects the way texture coordinates are applied to the geometric surface. The transformation consists of (in order):\n         * a translation; a rotation about the centre point; and a non-uniform scale about the centre point.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.TextureTransform3D.superClass.call(this, ctx);\n\n\n            /**\n             * The center field specifies a translation offset in texture coordinate space about which the rotation and scale fields are applied.\n             * @var {x3dom.fields.SFVec3f} center\n             * @memberof x3dom.nodeTypes.TextureTransform3D\n             * @initvalue 0,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'center', 0, 0, 0);\n\n            /**\n             * The rotation field specifies a rotation in angle base units of the texture coordinates about the center point after the scale has been applied.\n             * A positive rotation value makes the texture coordinates rotate counterclockwise about the centre, thereby rotating the appearance of the texture itself clockwise.\n             * @var {x3dom.fields.SFRotation} rotation\n             * @memberof x3dom.nodeTypes.TextureTransform3D\n             * @initvalue 0,0,1,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFRotation(ctx, 'rotation', 0, 0, 1, 0);\n\n            /**\n             * The scale field specifies a scaling factor in S and T of the texture coordinates about the center point.\n             * @var {x3dom.fields.SFVec3f} scale\n             * @memberof x3dom.nodeTypes.TextureTransform3D\n             * @initvalue 1,1,1\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'scale', 1, 1, 1);\n\n            /**\n             * The translation field specifies a translation of the texture coordinates.\n             * @var {x3dom.fields.SFVec3f} translation\n             * @memberof x3dom.nodeTypes.TextureTransform3D\n             * @initvalue 0,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'translation', 0, 0, 0);\n\n            /**\n             *\n             * @var {x3dom.fields.SFRotation} scaleOrientation\n             * @memberof x3dom.nodeTypes.TextureTransform3D\n             * @initvalue 0,0,1,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFRotation(ctx, 'scaleOrientation', 0, 0, 1, 0);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### TextureTransformMatrix3D ### */\nx3dom.registerNodeType(\n    \"TextureTransformMatrix3D\",\n    \"Texturing3D\",\n    defineClass(x3dom.nodeTypes.X3DTextureTransformNode,\n        \n        /**\n         * Constructor for TextureTransformMatrix3D\n         * @constructs x3dom.nodeTypes.TextureTransformMatrix3D\n         * @x3d 3.3\n         * @component Texturing3D\n         * @status full\n         * @extends x3dom.nodeTypes.X3DTextureTransformNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The TextureTransform3D node specifies a 3D transformation that is applied to texture coordinates.\n         * This node affects the way texture coordinates are applied to the geometric surface.\n         * The transformation consists of a transformation matrix.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.TextureTransformMatrix3D.superClass.call(this, ctx);\n\n\n            /**\n             * The matrix field specifies a generalized, unfiltered 4×4 transformation matrix that can be used to modify the texture. Any set of values is permitted.\n             * @var {x3dom.fields.SFMatrix4f} matrix\n             * @memberof x3dom.nodeTypes.TextureTransformMatrix3D\n             * @initvalue 1,0,0,0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFMatrix4f(ctx, 'matrix',\n                1, 0, 0, 0,\n                0, 1, 0, 0,\n                0, 0, 1, 0,\n                0, 0, 0, 1);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/**\n * The abstract pointing device sensor node class serves as a base class for all pointing device sensors.\n * Pointing device sensors catch pointing device events from all sibling nodes.\n */\n\nx3dom.registerNodeType(\n    \"X3DPointingDeviceSensorNode\",\n    \"PointingDeviceSensor\",\n    defineClass(x3dom.nodeTypes.X3DSensorNode,\n\n        /**\n         * Constructor for X3DPointingDeviceSensorNode\n         * @constructs x3dom.nodeTypes.X3DPointingDeviceSensorNode\n         * @x3d 3.3\n         * @component PointingDeviceSensor\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DSensorNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc An abstract base class for all pointing device sensor nodes.\n         */\n        function (ctx)\n        {\n            x3dom.nodeTypes.X3DPointingDeviceSensorNode.superClass.call(this, ctx);\n\n            //---------------------------------------\n            // FIELDS\n            //---------------------------------------\n\n            //route-able output fields\n            //this.addField_SFBool(ctx, 'isOver', false);\n\n\n            //---------------------------------------\n            // PROPERTIES\n            //---------------------------------------\n            this._isOver = false; // track for touchTime \n        },\n        {\n            //----------------------------------------------------------------------------------------------------------------------\n            // PUBLIC FUNCTIONS\n            //----------------------------------------------------------------------------------------------------------------------\n\n            /**\n             * Function that gets called if the pointing device has been pressed over a sibling node of this sensor\n             * @param {DOMEvent} event - the pointer event\n             * @private\n             */\n            pointerPressedOverSibling: function(event)\n            {\n                if (this._vf.enabled)\n                {\n                    this._vf.isActive = true;\n                    this.postMessage('isActive', true);\n                    this._isOver = true;\n                }\n            },\n\n            //----------------------------------------------------------------------------------------------------------------------\n\n            /**\n             * Function that gets called if the pointing device has been moved,\n             * after it has been pressed over a sibling of this node\n             * @param {DOMEvent} event - the pointer event\n             * @private\n             */\n            pointerMoved: function(event)\n            {\n\n            },\n\n            //----------------------------------------------------------------------------------------------------------------------\n\n            /**\n             * Function that gets called if the pointing device has entered a sibling of this node.\n             * @param {DOMEvent} event - the pointer event\n             */\n            pointerMovedOver: function(event)\n            {\n                if (this._vf.enabled)\n                {\n                    this.postMessage('isOver', true);\n                }\n            },\n\n            //----------------------------------------------------------------------------------------------------------------------\n\n            /**\n             * Function that gets called if the pointing device has left a sibling of this node.\n             * @param {DOMEvent} event - the pointer event\n             */\n            pointerMovedOut: function(event)\n            {\n                if (this._vf.enabled)\n                {\n                    this.postMessage('isOver', false);\n                    this._isOver = false;\n                }\n            },\n\n            //----------------------------------------------------------------------------------------------------------------------\n\n            /**\n             * Function that gets called if the pointing device has been released,\n             * after it has been pressed over a sibling of this node\n             * @private\n             */\n            pointerReleased: function()\n            {\n                if (this._vf.enabled)\n                {\n                    this._vf.isActive = false;\n                    this.postMessage('isActive', false);\n                    if (this._isOver) // button released and still over\n                      this.postMessage('touchTime', Date.now()/1000);\n                }\n            }\n\n            //----------------------------------------------------------------------------------------------------------------------\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/**\n * The abstract drag sensor node class serves as a base class for all drag-style pointing device sensors.\n */\n\nx3dom.registerNodeType(\n    \"X3DDragSensorNode\",\n    \"PointingDeviceSensor\",\n    defineClass(x3dom.nodeTypes.X3DPointingDeviceSensorNode,\n\n        /**\n         * Constructor for X3DDragSensorNode\n         * @constructs x3dom.nodeTypes.X3DDragSensorNode\n         * @x3d 3.3\n         * @component PointingDeviceSensor\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DPointingDeviceSensorNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc An abstract base class for all sensors that are processing drag gestures of the pointer.\n         */\n        function (ctx)\n        {\n            x3dom.nodeTypes.X3DDragSensorNode.superClass.call(this, ctx);\n\n            //---------------------------------------\n            // FIELDS\n            //---------------------------------------\n\n            /**\n             * Determines whether offset values from previous drag gestures are remembered / accumulated.\n             * @var {x3dom.fields.SFBool} autoOffset\n             * @memberof x3dom.nodeTypes.X3DDragSensorNode\n             * @initvalue true\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'autoOffset', true);\n\n            //route-able output fields\n            //this.addField_SFVec3f(ctx, 'trackPoint_changed', 0, 0, 0);\n\n\n            //---------------------------------------\n            // PROPERTIES\n            //---------------------------------------\n\n            //TODO: revise if those are still needed\n            /**\n             * Last mouse position in x direction.\n             * @var {Double} _lastX\n             * @private\n             */\n            this._lastX = -1;\n\n            /**\n             * Last mouse position in y direction.\n             * @var {Double} _lastY\n             * @private\n             */\n            this._lastY = -1;\n        },\n        {\n            //----------------------------------------------------------------------------------------------------------\n            // PUBLIC FUNCTIONS\n            //----------------------------------------------------------------------------------------------------------\n\n            /**\n             * @overrides x3dom.nodeTypes.X3DPointingDeviceSensorNode._pointerPressedOverSibling\n             * @param {DOMEvent} event - the pointer event\n             * @private\n             */\n            pointerPressedOverSibling: function(event)\n            {\n                x3dom.nodeTypes.X3DPointingDeviceSensorNode.prototype.pointerPressedOverSibling.call(this, event);\n\n                this._lastX = event.layerX;\n                this._lastY = event.layerY;\n\n                this._startDragging(event.viewarea, event.layerX, event.layerX, event.worldX, event.worldY, event.worldZ);\n            },\n\n            //----------------------------------------------------------------------------------------------------------\n\n            /**\n             * @overrides x3dom.nodeTypes.X3DPointingDeviceSensorNode._pointerMoved\n             * @param {DOMEvent] event - the pointer event\n             * @private\n             */\n            pointerMoved: function(event)\n            {\n                x3dom.nodeTypes.X3DPointingDeviceSensorNode.prototype.pointerMoved.call(this, event);\n\n                if (this._vf.isActive && this._vf.enabled)\n                {\n                    this._process2DDrag(event.layerX,\n                                        event.layerY,\n                                        event.layerX-this._lastX,\n                                        event.layerY-this._lastY);\n                }\n            },\n\n            //----------------------------------------------------------------------------------------------------------\n\n            /**\n             * @overrides x3dom.nodeTypes.X3DPointingDeviceSensorNode._pointerReleased\n             * @private\n             */\n            pointerReleased: function()\n            {\n                x3dom.nodeTypes.X3DPointingDeviceSensorNode.prototype.pointerReleased.call(this);\n\n                this._stopDragging();\n            },\n\n            //----------------------------------------------------------------------------------------------------------\n\n            //----------------------------------------------------------------------------------------------------------\n            // PRIVATE FUNCTIONS\n            //----------------------------------------------------------------------------------------------------------\n\n            /**\n             * Function that is called as soon as a drag action is initiated.\n             * @param {x3dom.Viewarea} viewarea - the viewarea which initiated the drag operation\n             * @param {Double} x - 2D pointer x coordinate at the time of the dragging initiation\n             * @param {Double} y - 2D pointer y coordinate at the time of the dragging initiation\n             * @param {Double} wx - 3D world x pick coordinate on the sensor geometry at the time of the dragging initiation\n             * @param {Double} wy - 3D world x pick coordinate on the sensor geometry at the time of the dragging initiation\n             * @param {Double} wz - 3D world z pick coordinate on the sensor geometry at the time of the dragging initiation\n             * @private\n             */\n            _startDragging: function(viewarea, x, y, wx, wy, wz)\n            {\n\n            },\n\n            //----------------------------------------------------------------------------------------------------------\n\n            /**\n             * Processes a 2D drag action, using the given 2D delta values.\n             * @param {Double} x - 2D pointer x coordinate at the time of the dragging initiation\n             * @param {Double} y - 2D pointer y coordinate at the time of the dragging initiation\n             * @param {Double} dx - delta of x, with respect to the last time the function was invoked\n             * @param {Double} dy - delta of Y, with respect to the last time the function was invoked\n             * @private\n             */\n            _process2DDrag: function(x, y, dx, dy)\n            {\n\n            },\n\n            //----------------------------------------------------------------------------------------------------------\n\n            /**\n             * Function that is called as soon as a drag action is initiated.\n             * @private\n             */\n            _stopDragging: function()\n            {\n\n            }\n\n            //----------------------------------------------------------------------------------------------------------\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\nx3dom.registerNodeType(\n    \"X3DTouchSensorNode\",\n    \"PointingDeviceSensor\",\n    defineClass(x3dom.nodeTypes.X3DPointingDeviceSensorNode,\n\n        /**\n         * Constructor for X3DTouchSensorNode\n         * @constructs x3dom.nodeTypes.X3DTouchSensorNode\n         * @x3d 3.3\n         * @component PointingDeviceSensor\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DPointingDeviceSensorNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc An abstract base class for all sensors that process touch events.\n         */\n        function (ctx)\n        {\n            x3dom.nodeTypes.X3DTouchSensorNode.superClass.call(this, ctx);\n\n            //---------------------------------------\n            // FIELDS\n            //---------------------------------------\n\n            //route-able output fields\n            //this.addField_SFTime(ctx, 'touchTime', 0);\n\n\n            //---------------------------------------\n            // PROPERTIES\n            //---------------------------------------\n        },\n        {\n            //----------------------------------------------------------------------------------------------------------------------\n            // PUBLIC FUNCTIONS\n            //----------------------------------------------------------------------------------------------------------------------\n\n\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\nx3dom.registerNodeType(\n    \"TouchSensor\",\n    \"PointingDeviceSensor\",\n    defineClass(x3dom.nodeTypes.X3DTouchSensorNode,\n\n        /**\n         * Constructor for TouchSensor\n         * @constructs x3dom.nodeTypes.TouchSensor\n         * @x3d 3.3\n         * @component PointingDeviceSensor\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DDragSensorNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc TouchSensor tracks location and state of the pointing device, and detects when user points at\n         * geometry. Hint: X3DOM, running in an HTML environment, you actually don't need this node, as you can\n         * simply use HTML events (like onclick) on your nodes. However, this node is implemented to complete the\n         * pointing device sensor component, and it may be useful to ensure compatibility with older X3D scene content.\n         */\n        function (ctx)\n        {\n            x3dom.nodeTypes.TouchSensor.superClass.call(this, ctx);\n\n            //---------------------------------------\n            // FIELDS\n            //---------------------------------------\n\n            //route-able output fields\n            //this.addField_SFVec3f(ctx, 'hitNormal_changed',   0 0 0);\n            //this.addField_SFVec3f(ctx, 'hitPoint_changed',    0 0 0);\n            //this.addField_SFVec2f(ctx, 'hitTexCoord_changed', 0 0);\n\n\n            //---------------------------------------\n            // PROPERTIES\n            //---------------------------------------\n        },\n        {\n            //----------------------------------------------------------------------------------------------------------------------\n            // PUBLIC FUNCTIONS\n            //----------------------------------------------------------------------------------------------------------------------\n\n\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/**\n * The plane sensor node translates drag gestures, performed with a pointing device like a mouse,\n * into 3D transformations.\n */\n\n\nx3dom.registerNodeType(\n    \"PlaneSensor\",\n    \"PointingDeviceSensor\",\n    defineClass(x3dom.nodeTypes.X3DDragSensorNode,\n\n        /**\n         * Constructor for PlaneSensor\n         * @constructs x3dom.nodeTypes.PlaneSensor\n         * @x3d 3.3\n         * @component PointingDeviceSensor\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DDragSensorNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc PlaneSensor converts pointing device motion into 2D translation, parallel to the local Z=0 plane.\n         * Hint: You can constrain translation output to one axis by setting the respective minPosition and  maxPosition\n         * members to equal values for that axis.\n         */\n        function (ctx)\n        {\n            x3dom.nodeTypes.PlaneSensor.superClass.call(this, ctx);\n\n            //---------------------------------------\n            // FIELDS\n            //---------------------------------------\n            /**\n             * The local sensor coordinate system is created by additionally applying the axisRotation field value to\n             * the local coordinate system of the sensor node.\n             * @var {x3dom.fields.SFRotation} axisRotation\n             * @memberof x3dom.nodeTypes.PlaneSensor\n             * @initvalue  0,0,1,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFRotation(ctx, 'axisRotation', 0, 0, 1, 0);\n\n\n            /**\n             * The minPosition and maxPosition fields allow to constrain the 2D output of the plane sensor, along each\n             * 2D component. If the value of a component in maxPosition is smaller than the value of a component in\n             * minPosition, output is not constrained along the corresponding direction.\n             * @var {x3dom.fields.SFVec2f} minPosition\n             * @memberof x3dom.nodeTypes.PlaneSensor\n             * @initvalue  0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec2f(ctx, 'minPosition',  0,  0);\n\n\n            /**\n             * The minPosition and maxPosition fields allow to constrain the 2D output of the plane sensor, along each\n             * 2D component. If the value of a component in maxPosition is smaller than the value of a component in\n             * minPosition, output is not constrained along the corresponding direction.\n             * @var {x3dom.fields.SFVec2f} maxPosition\n             * @memberof x3dom.nodeTypes.PlaneSensor\n             * @initvalue  -1,-1\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec2f(ctx, 'maxPosition', -1, -1);\n\n\n            /**\n             * Offset value that is incorporated into the translation output of the sensor.\n             * This value is automatically updated if the value of the autoOffset field is 'true'.\n             * @var {x3dom.fields.SFVec3f} offset\n             * @memberof x3dom.nodeTypes.PlaneSensor\n             * @initvalue 0,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'offset', 0, 0, 0);\n            \n            /**\n             * Tracking plane orientation in local coordinate system.\n             * Valid values are \"XY\" and \"screen\". \"screen\" uses the current orientation of the screen.\n             * @var {x3dom.fields.SFString} planeOrientation\n             * @memberof x3dom.nodeTypes.PlaneSensor\n             * @initvalue 'XY'\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'planeOrientation', 'XY');\n\n\n            //route-able output fields\n            //this.addField_SFVec3f(ctx, 'translation_changed', 0, 0, 0);\n\n\n            //---------------------------------------\n            // PROPERTIES\n            //---------------------------------------\n\n            /**\n             *\n             * @type {x3dom.fields.Quaternion}\n             * @private\n             */\n            //TODO: update on change\n            this._rotationMatrix = this._vf.axisRotation.toMatrix();\n\n            /**\n             * World-To-Local matrix for this node, including the axisRotation of the sensor\n             */\n            this._worldToLocalMatrix = null;\n\n\n            /**\n             * Initial intersection point with the sensor's plane, at the time the sensor was activated\n             * @type {x3dom.fields.SFVec3f}\n             * @private\n             */\n            this._initialPlaneIntersection = null;\n\n            /**\n             * Plane normal, computed on drag start and used during dragging to compute plane intersections\n             * @type {x3dom.fields.SFVec3f}\n             * @private\n             */\n            this._planeNormal = null;\n\n            /**\n             * Current viewarea that is used for dragging, needed for ray setup to compute the plane intersection\n             *\n             * @type {x3dom.Viewarea}\n             * @private\n             */\n            this._viewArea = null;\n\n            /**\n             * Current translation that is produced by this drag sensor\n             * @type {x3dom.fields.SFVec3f}\n             * @private\n             */\n            this._currentTranslation = new x3dom.fields.SFVec3f(0.0, 0.0, 0.0);\n            \n            //special LineSensor mode\n            this._lineModeAxis = null;\n            \n            if ( this._vf.minPosition.x == this._vf.maxPosition.x )\n            \t\tthis._lineModeAxis = new x3dom.fields.SFVec3f (0, 1, 0);\n            if ( this._vf.minPosition.y == this._vf.maxPosition.y )\n            \t\tthis._lineModeAxis = new x3dom.fields.SFVec3f (1, 0, 0);\n            \n        },\n        {\n            //----------------------------------------------------------------------------------------------------------------------\n            // PUBLIC FUNCTIONS\n            //----------------------------------------------------------------------------------------------------------------------\n\n            /**\n             * This function returns the parent transformation of this node, combined with its current axisRotation\n             * @overrides x3dom.nodeTypes.X3DPointingDeviceSensorNode.getCurrentTransform\n             */\n            getCurrentTransform: function ()\n            {\n                var parentTransform = x3dom.nodeTypes.X3DDragSensorNode.prototype.getCurrentTransform.call(this);\n\n                return this._rotationMatrix.mult(parentTransform);\n            },\n\n            //----------------------------------------------------------------------------------------------------------------------\n            // PRIVATE FUNCTIONS\n            //----------------------------------------------------------------------------------------------------------------------\n\n            /**\n             * @overrides x3dom.nodeTypes.X3DDragSensorNode.prototype._startDragging\n             * @private\n             */\n            _startDragging: function(viewarea, x, y, wx, wy, wz)\n            {\n                x3dom.nodeTypes.X3DDragSensorNode.prototype._startDragging.call(this, viewarea, x, y, wx, wy, wz);\n            \n                this._viewArea = viewarea;\n                \n                //save viewMatrix\n                this._viewMat = this._viewArea.getViewMatrix();\n                this._viewMatInv = this._viewMat.inverse();\n                        \n                this._currentTranslation = new x3dom.fields.SFVec3f(0.0, 0.0, 0.0).add(this._vf.offset);\n\n                //TODO: handle multi-path nodes\n\n                //get model matrix for this node, combined with the axis rotation\n                this._localToWorldMatrix = this.getCurrentTransform();\n                this._worldToLocalMatrix = this._localToWorldMatrix.inverse();\n\n                //remember initial point of intersection with the plane, transform it to local sensor coordinates\n                this._initialPlaneIntersection = this._worldToLocalMatrix.multMatrixPnt(new x3dom.fields.SFVec3f(wx, wy, wz));\n\n                //compute plane normal in local coordinates\n                this._planeNormal = new x3dom.fields.SFVec3f(0.0, 0.0, 1.0);\n                \n                var viewRay;\n                //handle screen mode\n                if (this._vf.planeOrientation == 'screen') {\n                \t\tviewRay = viewarea.calcViewRay(viewarea._width/2, viewarea._height/2);\n                    this._planeNormal = this._worldToLocalMatrix.multMatrixVec (viewRay.dir.normalize());\n                }\n                \n                //handle LineSensor mode robustly\n                else if ( this._lineModeAxis ) {\n                \t  viewRay = viewarea.calcViewRay(x, y);\n                    //viewRay.pos = this._worldToLocalMatrix.multMatrixPnt (viewRay.pos);\n                    var viewDir = this._worldToLocalMatrix.multMatrixVec (viewRay.dir.normalize());\n\n                    var axis = this._lineModeAxis;\n                    //generate suitable intersection plane even if on edge view;\n                    this._planeNormal = axis.cross ( axis.cross (viewDir) );\n                }\n            },\n\n            //----------------------------------------------------------------------------------------------------------------------\n\n            /**\n             * @overrides x3dom.nodeTypes.X3DDragSensorNode._process2DDrag\n             * @private\n             */\n            _process2DDrag: function(x, y, dx, dy)\n            {\n                x3dom.nodeTypes.X3DDragSensorNode.prototype._process2DDrag.call(this, x, y, dx, dy);\n\n                var intersectionPoint = null;\n                var minPos, maxPos;\n\n                if (this._initialPlaneIntersection)\n                {\n                    //compute point of intersection with the plane\n                    var viewRay = this._viewArea.calcViewRay(x, y);\n\n                    //transform the world coordinates, used for the ray, to local sensor coordinates\n                    viewRay.pos = this._worldToLocalMatrix.multMatrixPnt(viewRay.pos);\n                    viewRay.dir = this._worldToLocalMatrix.multMatrixVec(viewRay.dir.normalize());\n                    \n                    if ( Math.abs(this._planeNormal.dot(viewRay.dir)) < 0.1 ) return;\n                    \n                    intersectionPoint = viewRay.intersectPlane(this._initialPlaneIntersection, this._planeNormal);\n\n                    //allow interaction from both sides of the plane\n                    if (!intersectionPoint)\n                    {\n                        intersectionPoint = viewRay.intersectPlane(this._initialPlaneIntersection, this._planeNormal.negate());\n                    }\n\n                  if (intersectionPoint)\n                  {\n                    //compute difference between new point of intersection and initial point\n                    this._currentTranslation = intersectionPoint.subtract(this._initialPlaneIntersection);\n                    this._currentTranslation = this._currentTranslation.add(this._vf.offset);\n\n                    //clamp translation components, if desired\n                    minPos = this._vf.minPosition;\n                \t\tmaxPos = this._vf.maxPosition;\n                    \n                    if (this._vf.planeOrientation == 'screen')\n                    {\n                    \tif (minPos.x <= maxPos.x || minPos.y <= maxPos.y) // proejct/reproject only if necessary\n                        {\n                            //project currentTranslation into screen plane\n                            var screenTranslation = this._localToWorldMatrix.multMatrixVec(this._currentTranslation);\n                            screenTranslation = this._viewMat.multMatrixVec(screenTranslation);\n                            _clampTranslation (screenTranslation, minPos, maxPos);\n                            // and reproject\n                            screenTranslation = this._viewMatInv.multMatrixVec(screenTranslation);\n                            this._currentTranslation = this._worldToLocalMatrix.multMatrixVec(screenTranslation);\n                        }\n                    } \n\n                    else {\n                        _clampTranslation (this._currentTranslation, minPos, maxPos);\n                        //normally 0 but force for LineSensor plane \n                        this._currentTranslation.z = 0;\n                    }\n\n                    //output translation_changed event\n                    this.postMessage('translation_changed', x3dom.fields.SFVec3f.copy(this._currentTranslation));//this._rotationMatrix.multMatrixPnt(this._currentTranslation));// \n                    //output trackpoint_changed event\n                    this.postMessage('trackPoint_changed', intersectionPoint);\n                  }\n                }\n                //helper\n                function _clampTranslation (translation, minPos, maxPos)\n                {\n                \tif (minPos.x <= maxPos.x)\n                        {\n                          translation.x = Math.min(translation.x, maxPos.x);\n                          translation.x = Math.max(translation.x, minPos.x);\n                        }\n\n                        if (minPos.y <= maxPos.y)\n                        {\n                          translation.y = Math.min(translation.y, maxPos.y);\n                          translation.y = Math.max(translation.y, minPos.y);\n                        }\n                }\n            },\n\n            //----------------------------------------------------------------------------------------------------------------------\n\n            /**\n             * @overrides x3dom.nodeTypes.X3DDragSensorNode._stopDragging\n             * @private\n             */\n            _stopDragging: function()\n            {\n                x3dom.nodeTypes.X3DDragSensorNode.prototype._stopDragging.call(this);\n\n                if (this._vf.autoOffset)\n                {\n                    this._vf.offset = x3dom.fields.SFVec3f.copy(this._currentTranslation);\n                    this.postMessage('offset_changed', this._vf.offset);\n                }\n            }\n\n            //----------------------------------------------------------------------------------------------------------------------\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n \n /*\n * Based on code provided by Fraunhofer IGD.\n * (C)2014 Toshiba Corporation, Japan.\n * Dual licensed under the MIT and GPL.\n */\n\nx3dom.registerNodeType(\n    \"SphereSensor\",\n    \"PointingDeviceSensor\",\n    defineClass(x3dom.nodeTypes.X3DDragSensorNode,\n\n        /**\n         * Constructor for SphereSensor\n         * @constructs x3dom.nodeTypes.SphereSensor\n         * @x3d 3.3\n         * @component PointingDeviceSensor\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DDragSensorNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc SphereSensor converts pointing device motion into a spherical rotation around the origin of the\n         * local coordinate system.\n         */\n        function (ctx)\n        {\n            x3dom.nodeTypes.SphereSensor.superClass.call(this, ctx);\n\n            //---------------------------------------\n            // FIELDS\n            //---------------------------------------\n            /**\n             * Offset value that is incorporated into the rotation output of the sensor.\n             * This value is automatically updated if the value of the autoOffset field is 'true'.\n             * @var {x3dom.fields.SFRotation} offset\n             * @memberof x3dom.nodeTypes.SphereSensor\n             * @initvalue 0,1,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFRotation(ctx, 'offset', 0, 1, 0, 0);\n\n            //route-able output fields\n            //this.addField_SFVec3f(ctx, 'rotation_changed', 0, 0, 0);\n\n\n            //---------------------------------------\n            // PROPERTIES\n            //---------------------------------------\n\n            /**\n             * Current rotation that is produced by this sphere sensor\n             * @type {x3dom.fields.Quaternion}\n             * @private\n             */\n            this._currentRotation = null;\n\t\t\t\n\t\t\t/**\n             * Rotation matrix, derived from the current value of the offset field\n             * @type {x3dom.fields.SFMatrix4f}\n             * @private\n             */\n            this._rotationMatrix = this._vf.offset.toMatrix();\n        },\n        {\n            //----------------------------------------------------------------------------------------------------------------------\n            // PUBLIC FUNCTIONS\n            //----------------------------------------------------------------------------------------------------------------------\n\t\t\t\n\t\t\t/**\n             * This function returns the parent transformation of this node, combined with its current rotation\n             * @overrides x3dom.nodeTypes.X3DPointingDeviceSensorNode.getCurrentTransform\n             */\n            getCurrentTransform: function ()\n            {\n                var parentTransform = x3dom.nodeTypes.X3DDragSensorNode.prototype.getCurrentTransform.call(this);\n\t\t\t\t\n                return parentTransform.mult(this._rotationMatrix);\n            },\n\n\n            //----------------------------------------------------------------------------------------------------------------------\n            // PRIVATE FUNCTIONS\n            //----------------------------------------------------------------------------------------------------------------------\n\t\t\t\n            /**\n             * @overrides x3dom.nodeTypes.X3DDragSensorNode.prototype._startDragging\n             * @private\n             */\n            _startDragging: function(viewarea, x, y, wx, wy, wz)\n            {\n                x3dom.nodeTypes.X3DDragSensorNode.prototype._startDragging.call(this, viewarea, x, y, wx, wy, wz);\n\t\t\t\t\n\t\t\t\tthis._currentRotation = new x3dom.fields.Quaternion();\n\t\t\t\t\n\t\t\t\tthis._viewArea = viewarea;\t\n\t\t\t\t\n\t\t\t\t// origin of sphere in local coordinates\n\t\t\t\tthis._localOrigin = new x3dom.fields.SFVec3f(0.0, 0.0, 0.0);\n\t\t\t\t\n\t\t\t\tthis._inverseToWorldMatrix = this.getCurrentTransform().inverse();\n\n\t\t\t\t// compute initial point of intersection on the sphere sensor's geometry, in local sphere sensor's coordinate system\n\t\t\t\tvar firstIntersection = this._inverseToWorldMatrix.multMatrixPnt(new x3dom.fields.SFVec3f(wx, wy, wz));\n\t\t\t\t\n\t\t\t\tthis._initialSphereIntersectionVector = firstIntersection.subtract(this._localOrigin);\n\n\t\t\t\tthis._sphereRadius = this._initialSphereIntersectionVector.length();\n\n\t\t\t\tthis._initialSphereIntersectionVector = this._initialSphereIntersectionVector.normalize();\n            },\n\n            //----------------------------------------------------------------------------------------------------------------------\n\n            /**\n             * @overrides x3dom.nodeTypes.X3DDragSensorNode._process2DDrag\n             * @private\n             */\n            _process2DDrag: function(x, y, dx, dy)\n            {\n                x3dom.nodeTypes.X3DDragSensorNode.prototype._process2DDrag.call(this, x, y, dx, dy);\n\n\t\t\t\t// We have to compute hit point on virtual sphere's geometry\n\t\t\t\tvar viewRay = this._viewArea.calcViewRay(x, y);\n\t\t\t\tviewRay.pos = this._inverseToWorldMatrix.multMatrixPnt(viewRay.pos);\n\t\t\t\tviewRay.dir = this._inverseToWorldMatrix.multMatrixVec(viewRay.dir);\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t * S := Ray Origin\t  = viewRay.pos\n\t\t\t\t * V := Ray Direction = viewRay.dir\n\t\t\t\t * O := Sphere Center = this._localOrigin\n\t\t\t\t * r := Sphere Radius = this._sphereRadius\n\t\t\t\t * alpha := Ray parameter\n\t\t\t\t * \n\t\t\t\t * If the view ray intersects the virtual sphere centred at O\n\t\t\t\t * at (S + alpha*V), it must satisfy the following equation:\n\t\t\t\t * | S + alpha*V - O | = r\n\t\t\t\t * dot_prod((S + alpha*V - O),(S + alpha*V - O)) = r*r\n\t\t\t\t * or,\n\t\t\t\t * alpha*alpha*V.V + alpha*2*(V.(S-O)) + (S.S -2O.S + O.O) - r*r = 0\n\t\t\t\t * or,\n\t\t\t\t * A*alpha*alpha + B*alpha + C = 0\n\t\t\t\t */\n\t\t\t\t \n\t\t\t\t var A = viewRay.dir.dot(viewRay.dir);\n\t\t\t\t var B = 2.0*(viewRay.dir.dot(viewRay.pos.subtract(this._localOrigin)));\n\t\t\t\t var C = viewRay.pos.dot(viewRay.pos) - 2.0*this._localOrigin.dot(viewRay.pos) +\n                         this._localOrigin.dot(this._localOrigin) - this._sphereRadius*this._sphereRadius;\n\t\t\t\t \n\t\t\t\t var determinant = (B*B) - (4.0*A*C);\n\t\t\t\t var alpha_1;\n\t\t\t\t var alpha_2;\n\t\t\t\t \n\t\t\t\t // if the roots are real i.e. the ray intersects the sphere, the determinant must be greater\n\t\t\t\t // than or equal to zero\n\t\t\t\t if(determinant >= 0.0) {\n\t\t\t\t\talpha_1 = (-B + Math.sqrt(determinant)) / (2.0*A);\n\t\t\t\t\talpha_2 = (-B - Math.sqrt(determinant)) / (2.0*A);\n\t\t\t\t\t\n\t\t\t\t\t// pick the closer of the two points\n\t\t\t\t\talpha_1 = Math.min(alpha_1, alpha_2);\n\t\t\t\t\t\n\t\t\t\t\t// if the closer intersection point has alpha < 0, then we are inside the sphere and must not do anything\n\t\t\t\t\tif(alpha_1 >= 1.0) {\n\t\t\t\t\t\t//TODO: output trackPoint_changed event\n\t\t\t\t\t\tvar hitPoint = viewRay.pos.add(viewRay.dir.multiply(alpha_1));\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar vecToHitPoint = hitPoint.subtract(this._localOrigin).normalize();\n\t\t\t\t\t\t\n\t\t\t\t\t\tthis._currentRotation = x3dom.fields.Quaternion.rotateFromTo(this._initialSphereIntersectionVector, vecToHitPoint);\n\t\t\t\t\t\t\n\t\t\t\t\t\tthis._currentRotation = this._currentRotation.multiply(this._vf.offset);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// output rotationChanged_event, given in local sphere sensor coordinates\n\t\t\t\t\t\tthis.postMessage('rotation_changed',  this._currentRotation);\n\t\t\t\t\t}\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t\t\t// do nothing, because no intersection\n\t\t\t\t }\n            },\n\n            //----------------------------------------------------------------------------------------------------------------------\n\n            /**\n             * @overrides x3dom.nodeTypes.X3DDragSensorNode._stopDragging\n             * @private\n             */\n            _stopDragging: function()\n            {\n                x3dom.nodeTypes.X3DDragSensorNode.prototype._stopDragging.call(this);\n\n                if (this._vf.autoOffset)\n                {\n                    this._vf.offset = this._currentRotation;\n\t\t\t\t\tthis.postMessage('offset_changed', this._vf.offset);\n                }\n\t\t\t\t\n\t\t\t\tthis._currentRotation = new x3dom.fields.Quaternion();\n            }\n\n            //----------------------------------------------------------------------------------------------------------------------\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\nx3dom.registerNodeType(\n    \"CylinderSensor\",\n    \"PointingDeviceSensor\",\n    defineClass(x3dom.nodeTypes.X3DDragSensorNode,\n\n        /**\n         * Constructor for CylinderSensor\n         * @constructs x3dom.nodeTypes.CylinderSensor\n         * @x3d 3.3\n         * @component PointingDeviceSensor\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DDragSensorNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The CylinderSensor node converts pointer motion (for example, from a mouse) into rotation values,\n         * using an invisible cylinder of infinite height, aligned with local Y-axis.\n         */\n        function (ctx)\n        {\n            x3dom.nodeTypes.CylinderSensor.superClass.call(this, ctx);\n\n            //---------------------------------------\n            // FIELDS\n            //---------------------------------------\n            /**\n             * Offset value, in radians, that is incorporated into the rotation output of the sensor.\n             * This value is automatically updated if the value of the autoOffset field is 'true'.\n             * @var {x3dom.fields.SFFloat} offset\n             * @memberof x3dom.nodeTypes.CylinderSensor\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'offset', 0);\n\n\n            /**\n             * The local sensor coordinate system is created by additionally applying the axisRotation field value to\n             * the local coordinate system of the sensor node.\n             * @var {x3dom.fields.SFRotation} axisRotation\n             * @memberof x3dom.nodeTypes.CylinderSensor\n             * @initvalue  0,1,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFRotation(ctx, 'axisRotation', 0, 1, 0, 0);\n\n\n            /**\n             * Specifies whether the virtual cylinder's lateral surface or end-cap disks of virtual-geometry sensor are\n             * used for manipulation: If the vertical acute angle between the vector from the viewer to the point of\n             * intersection with the sensor geometry and the local Y axis of the cylinder is greater than or equal to\n             * the value of this field, the sensor uses a virtual cylinder to compute rotation output.\n             * Otherwise, if the angle is smaller than the value of this field, the sensor uses a virtual disk instead.\n             * This value of this field is specified in radians.\n             *\n             * ATTENTION: The value of this field is currently ignored.\n             * The cylinder sensor will always operate in cylinder mode.\n             *\n             * @var {x3dom.fields.SFFloat} axisRotation\n             * @memberof x3dom.nodeTypes.CylinderSensor\n             * @initvalue  pi/2\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'diskAngle', 0.262); //this is the official default value, PI/12\n\n\n            /**\n             * The minAngle and maxAngle fields, given in radians, allow to constrain the rotation output of the\n             * cylinder sensor.\n             * If the value of maxAngle is smaller than the value of minAngle, output is not constrained.\n             * @var {x3dom.fields.SFFloat} axisRotation\n             * @memberof x3dom.nodeTypes.CylinderSensor\n             * @initvalue  0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'minAngle', 0);\n\n\n            /**\n             * The minAngle and maxAngle fields, given in radians, allow to constrain the rotation output of the\n             * cylinder sensor.\n             * If the value of maxAngle is smaller than the value of minAngle, output is not constrained.\n             * @var {x3dom.fields.SFFloat} axisRotation\n             * @memberof x3dom.nodeTypes.CylinderSensor\n             * @initvalue  -1\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'maxAngle', -1);\n\n            //route-able output fields\n            //this.addField_SFRotation(ctx, 'rotation_changed', 0, 0, 1, 0);\n\n\n            //---------------------------------------\n            // PROPERTIES\n            //---------------------------------------\n\n            /**\n             * Rotation matrix, derived from the current value of the axisRotation field\n             * @type {x3dom.fields.SFMatrix4f}\n             * @private\n             */\n            //TODO: updates\n            this._rotationMatrix = this._vf.axisRotation.toMatrix();\n\n            /**\n             * Current value of the matrix that transforms world coordinates to local sensor coordinates\n             * @type {x3dom.fields.SFMatrix4f}\n             * @private\n             */\n            this._inverseToWorldMatrix = null;\n\n            /**\n             * Vector from the virtual local y-Axis to the initial intersection point with the virtual cylinder,\n             * at the time the sensor was activated\n             * @type {x3dom.fields.SFVec3f}\n             * @private\n             */\n            this._initialCylinderIntersectionVector = null;\n\n            /**\n             * Current viewarea that is used for dragging, needed for ray setup to compute the cylinder intersection\n             *\n             * @type {x3dom.Viewarea}\n             * @private\n             */\n            this._viewArea = null;\n\n            /**\n             * Current radius of the virtual cylinder.\n             * @type {number}\n             * @private\n             */\n            this._cylinderRadius = 0.0;\n\n            /**\n             * A line that specifies the current local, virtual y-Axis of this sensor, given in world coordinates.\n             * @type {x3dom.fields.Line}\n             * @private\n             */\n            this._yAxisLine = null;\n\n            /**\n             * Specifies whether we are currently using cylinder behavior or disk behavior.\n             * @type {boolean}\n             * @private\n             */\n            this._cylinderMode = true;\n\n            /**\n             * Current rotation that is produced by this cylinder sensor\n             * @type {x3dom.fields.Quaternion}\n             * @private\n             */\n            this._currentRotationAngle = 0.0;\n        },\n        {\n            //----------------------------------------------------------------------------------------------------------------------\n            // PUBLIC FUNCTIONS\n            //----------------------------------------------------------------------------------------------------------------------\n\n            /**\n             * This function returns the parent transformation of this node, combined with its current axisRotation\n             * @overrides x3dom.nodeTypes.X3DPointingDeviceSensorNode.getCurrentTransform\n             */\n            getCurrentTransform: function ()\n            {\n                var parentTransform = x3dom.nodeTypes.X3DDragSensorNode.prototype.getCurrentTransform.call(this);\n\n                return parentTransform.mult(this._rotationMatrix);\n            },\n\n            //----------------------------------------------------------------------------------------------------------------------\n            // PRIVATE FUNCTIONS\n            //----------------------------------------------------------------------------------------------------------------------\n\n            /**\n             * @overrides x3dom.nodeTypes.X3DDragSensorNode.prototype._startDragging\n             * @private\n             */\n            _startDragging: function(viewarea, x, y, wx, wy, wz)\n            {\n                x3dom.nodeTypes.X3DDragSensorNode.prototype._startDragging.call(this, viewarea, x, y, wx, wy, wz);\n\n                this._currentRotation = new x3dom.fields.Quaternion();\n\n                this._viewArea = viewarea;\n\n                //y axis line, in local sensor coordinates\n                this._yAxisLine = new x3dom.fields.Line(new x3dom.fields.SFVec3f(0.0, 0.0, 0.0),\n                                                        new x3dom.fields.SFVec3f(0.0, 1.0, 0.0));\n\n                this._inverseToWorldMatrix = this.getCurrentTransform().inverse();\n\n                //compute initial cylinder intersection point, in local sensor coordinates\n                var firstIntersection = this._inverseToWorldMatrix.multMatrixPnt(new x3dom.fields.SFVec3f(wx, wy, wz));\n\n                //TODO: add disk mode\n\n                //compute distance between point of intersection and y-axis\n\n                var closestPointOnYAxis = this._yAxisLine.closestPoint(firstIntersection);\n\n                this._initialCylinderIntersectionVector = firstIntersection.subtract(closestPointOnYAxis);\n\n                this._cylinderRadius = this._initialCylinderIntersectionVector.length();\n\n                this._initialCylinderIntersectionVector = this._initialCylinderIntersectionVector.normalize();\n            },\n\n            //----------------------------------------------------------------------------------------------------------------------\n\n            /**\n             * @overrides x3dom.nodeTypes.X3DDragSensorNode._process2DDrag\n             * @private\n             */\n            _process2DDrag: function(x, y, dx, dy)\n            {\n                x3dom.nodeTypes.X3DDragSensorNode.prototype._process2DDrag.call(this, x, y, dx, dy);\n\n                //cylinder mode\n                if (this._cylinderMode)\n                {\n                    //compute hit point on virtual cylinder geometry\n                    var viewRay = this._viewArea.calcViewRay(x, y);\n\n                    viewRay.pos = this._inverseToWorldMatrix.multMatrixPnt(viewRay.pos);\n                    viewRay.dir = this._inverseToWorldMatrix.multMatrixVec(viewRay.dir);\n\n                    //0. assume the following equation:\n                    // At the point of intersection, the distance between the ray of sight and the cylinder equals\n                    // the cylinder radius r.\n                    // This means a ray parameter alpha must be found, so that the minimum distance between the point on\n                    // the ray and the cylinder axis equals r:\n                    // | ((S + alpha*V) - O) - Y*<(S + alpha*V) - O, Y> | = r\n                    // with:\n                    // | X | = length of vector X\n                    // <X1, X2> = dot product of vectors X1, X2\n                    // and variables\n                    // alpha := Ray Parameter (should be found)\n                    // S := Ray Origin\n                    // V := Ray Direction\n                    // O := Local Y-Axis Anchor Point\n                    // Y := Local Y-Axis Direction\n\n                    //1. bring equation into the following form:\n                    //   | alpha * A - B | = r\n                    var A = viewRay.dir.subtract(this._yAxisLine.dir.multiply(viewRay.dir.dot(this._yAxisLine.dir)));\n                    var B = viewRay.pos.subtract(this._yAxisLine.pos).add(this._yAxisLine.dir.multiply(\n                            this._yAxisLine.dir.dot(this._yAxisLine.pos.subtract(viewRay.pos))));\n\n                    //2. solve quadratic formula (0, 1 or 2 solutions are possible)\n                    var p = 2 * A.dot(B) / A.dot(A);\n                    var q = (B.dot(B) - this._cylinderRadius*this._cylinderRadius) / A.dot(A);\n\n                    var sqrt_part = p*p*0.25 - q;\n\n                    var alpha_1;\n                    var alpha_2;\n\n                    //is the cylinder hit?\n                    if (sqrt_part >= 0)\n                    {\n                        sqrt_part = Math.sqrt(sqrt_part);\n                        alpha_1 = -p*0.5 + sqrt_part;\n                        alpha_2 = -p*0.5 - sqrt_part;\n\n                        //if we are inside the cylinder, do nothing, otherwise pick the closest point of intersection\n                        alpha_1 = Math.min(alpha_1, alpha_2);\n\n                        if (alpha_1 > 0.0)\n                        {\n                            //TODO: output trackPoint_changed event\n                            var hitPoint = viewRay.pos.add(viewRay.dir.multiply(alpha_1));\n\n                            var closestPointOnYAxis = this._yAxisLine.closestPoint(hitPoint);\n\n                            var vecToHitPoint = hitPoint.subtract(closestPointOnYAxis).normalize();\n\n                            this._currentRotation = x3dom.fields.Quaternion.rotateFromTo(this._initialCylinderIntersectionVector, vecToHitPoint);\n\n                            var offsetQuat = x3dom.fields.Quaternion.axisAngle(this._yAxisLine.dir, this._vf.offset);\n\n                            this._currentRotation = this._currentRotation.multiply(offsetQuat);\n\n                            //output rotationChanged_event, given in local sensor coordinates\n                            this.postMessage('rotation_changed', this._currentRotation);\n                        }\n                    }\n                }\n                //disk mode\n                else\n                {\n                    //TODO: implement\n                }\n            },\n\n            //----------------------------------------------------------------------------------------------------------------------\n\n            /**\n             * @overrides x3dom.nodeTypes.X3DDragSensorNode._stopDragging\n             * @private\n             */\n            _stopDragging: function()\n            {\n                x3dom.nodeTypes.X3DDragSensorNode.prototype._stopDragging.call(this);\n\n                if (this._vf.autoOffset)\n                {\n                    this._vf.offset = this._currentRotation.angle();\n                    this.postMessage('offset_changed', this._vf.offset);\n                }\n            }\n\n            //----------------------------------------------------------------------------------------------------------------------\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009, 2017, A. Plesch, Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### X3DSequencerNode ###\nx3dom.registerNodeType(\n    \"X3DSequencerNode\",\n    \"EventUtilities\",\n    defineClass(x3dom.nodeTypes.X3DChildNode,\n        \n        /**\n         * Constructor for X3DSequencerNode\n         * @constructs x3dom.nodeTypes.X3DSequencerNode\n         * @x3d 3.3\n         * @component EventUtilities\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DChildNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The abstract node X3DSequencerNode forms the basis for all types of sequencers.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DSequencerNode.superClass.call(this, ctx);\n        \n            /**\n             * If the next inputOnly field receives an SFBool event with value TRUE, it triggers the next output value in keyValue array by issuing a value_changed event with that value.\n             * After reaching the boundary of keyValue array, next goes to the initial element after last.\n             * @var {x3dom.fields.SFBool} next\n             * @memberof x3dom.nodeTypes.X3DSequencerNode\n             * @initvalue false\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'next', false);\n        \n            /**\n             * If the previous inputOnly field receives an SFBool event with value TRUE, it triggers the previous output value in keyValue array by issuing a value_changed event with that value.\n             * After reaching the boundary of keyValue array previous goes to the last element after the first.\n             * @var {x3dom.fields.SFBool} previous\n             * @memberof x3dom.nodeTypes.X3DSequencerNode\n             * @initvalue false\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'previous', false);\n\n            /**\n             * The key field contains the list of key times, the keyValue field contains values for the target field, one complete set of values for each key.\n             * Sequencer nodes containing no keys in the key field shall not produce any events.\n             * However, an input event that replaces an empty key field with one that contains keys will cause the sequencer node to produce events the next time that a set_fraction event is received.\n             * @var {x3dom.fields.MFFloat} key\n             * @memberof x3dom.nodeTypes.X3DSequencerNode\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFFloat(ctx, 'key', []);\n\n            /**\n             * The set_fraction inputOnly field receives an SFFloat event and causes the sequencer node function to evaluate, resulting in a value_changed output event of the specified type with the same timestamp as the set_fraction event.\n             * @var {x3dom.fields.SFFloat} set_fraction\n             * @memberof x3dom.nodeTypes.X3DSequencerNode\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'set_fraction', 0);\n        \n            this._keyIndex = -1;\n            this._key_changed = false;\n            this._keyValue_changed = false;\n        \n        },\n        {\n            findInterval: function (time) {\n                var keyLength = this._vf.key.length-1;\n                \n                if (time < this._vf.key[0]) {\n                    return 0;\n                }\n\n                else if (time >= this._vf.key[keyLength]) {\n                    return keyLength;\n                }\n\n                for (var i = 0; i < keyLength; ++i) {\n                    if ((this._vf.key[i] <= time) && (time < this._vf.key[i+1])) {\n                        return i;\n                    }\n                }\n                return 0; // should never happen\n            },        \n\n            fieldChanged: function(fieldName)\n            {\n                if(fieldName === \"set_fraction\")\n                {\n                    var keyIndex = this.findInterval(this._vf.set_fraction);\n                    if (keyIndex !== this._keyIndex) { // only generate event when necessary\n                      this._keyIndex = keyIndex;\n                      this.postMessage('value_changed', this._vf.keyValue[keyIndex]);\n                    }\n                    return;\n                }\n                if(fieldName === \"next\" && this._vf.next)\n                {\n                    this._keyIndex = (this._keyIndex + 1)%(this._vf.key.length);\n                    this.postMessage('value_changed', this._vf.keyValue[this._keyIndex]);\n                    return;\n                }\n                if(fieldName === \"previous\" && this._vf.previous)\n                {\n                    this._keyIndex = (this._keyIndex - 1 + this._vf.key.length)%(this._vf.key.length);\n                    this.postMessage('value_changed', this._vf.keyValue[this._keyIndex]);\n                    return;\n                }\n                if(fieldName === \"key\")\n                {\n                    if (this._key_changed) { // avoid loop this way since no timestamping\n                        this._key_changed = false;\n                        return;\n                    }\n                    this._key_changed = true;\n                    this.postMessage('key', this._vf.key);\n                    return;\n                }\n                if(fieldName === \"keyValue\")\n                {\n                    if (this._keyValue_changed) { // avoid loop this way since no timestamping\n                        this._keyValue_changed = false;\n                        return;\n                    }\n                    this._keyValue_changed = true;\n                    this.postMessage('keyValue', this._vf.keyValue);\n                    return;\n                }\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009, 2017, A. Plesch, Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### BooleanFilter ###\nx3dom.registerNodeType(\n    \"X3DTriggerNode\",\n    \"EventUtilities\",\n    defineClass(x3dom.nodeTypes.X3DChildNode,\n        \n        /**\n         * Constructor for X3DTriggerNode\n         * @constructs x3dom.nodeTypes.X3DTriggerNode\n         * @x3d 3.3\n         * @component EventUtilities\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DChildNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc This abstract node type is the base node type from which all trigger nodes are derived.\n         */\n         \n        function (ctx) {\n            x3dom.nodeTypes.X3DTriggerNode.superClass.call(this, ctx);\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009, 2017, A. Plesch, Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### BooleanFilter ###\nx3dom.registerNodeType(\n    \"BooleanFilter\",\n    \"EventUtilities\",\n    defineClass(x3dom.nodeTypes.X3DChildNode,\n        \n        /**\n         * Constructor for BooleanFilter\n         * @constructs x3dom.nodeTypes.BooleanFilter\n         * @x3d 3.3\n         * @component EventUtilities\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DChildNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc filters Boolean events, allowing for selective routing of TRUE or FALSE values and negation.\n         */\n         \n        function (ctx) {\n            x3dom.nodeTypes.BooleanFilter.superClass.call(this, ctx);\n            \n            /**\n             * input bool event to be filtered.\n             * @var {x3dom.fields.SFBool} set_boolean\n             * @memberof x3dom.nodeTypes.BooleanFilter\n             * @initvalue None\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'set_boolean');\n            \n            /**\n             * output if input is false\n             * @var {x3dom.fields.SFBool} inputFalse\n             * @memberof x3dom.nodeTypes.BooleanFilter\n             * @initvalue None\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'inputFalse');\n            \n            /**\n             * output if input is true\n             * @var {x3dom.fields.SFBool} inputTrue\n             * @memberof x3dom.nodeTypes.BooleanFilter\n             * @initvalue None\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'inputTrue');\n            \n            /**\n             * output negated input\n             * @var {x3dom.fields.SFBool} inputNegate\n             * @memberof x3dom.nodeTypes.BooleanFilter\n             * @initvalue None\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'inputNegate');\n        },\n        {\n            fieldChanged: function(fieldName)\n            {\n                if (fieldName === 'set_boolean') { //ignore attempted input to all other fields\n                    var input = this._vf.set_boolean;\n                    this._vf.inputNegate = !input;\n                    this.postMessage('inputNegate', !input);\n                    if (input) {\n                        this._vf.inputTrue = true;\n                        this.postMessage('inputTrue', true);\n                        return;\n                    }\n                    this._vf.inputFalse = false; // confirmed with other browsers\n                    this.postMessage('inputFalse', false);\n                    return;\n                }\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009, 2017, A. Plesch, Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### BooleanSequencer ###\nx3dom.registerNodeType(\n    \"BooleanSequencer\",\n    \"EventUtilities\",\n    defineClass(x3dom.nodeTypes.X3DSequencerNode,\n        \n        /**\n         * Constructor for BooleanSequencer\n         * @constructs x3dom.nodeTypes.BooleanSequencer\n         * @x3d 3.3\n         * @component EventUtilities\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DSequencerNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc BooleanSequencer generates sequential value_changed events selected from the keyValue field when driven from a TimeSensor clock. Among other actions, it can enable/disable lights and sensors, or bind/unbind viewpoints and other X3DBindableNode nodes using set_bind events.\n         */\n         \n        function (ctx) {\n            x3dom.nodeTypes.BooleanSequencer.superClass.call(this, ctx);\n            \n            /**\n             * Defines the set of Booleans, that are used for sequencing.\n             * Is made up of a list of FALSE and TRUE values.\n             * @var {x3dom.fields.MFBoolean} keyValue\n             * @memberof x3dom.nodeTypes.BooleanSequencer\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFBoolean(ctx, 'keyValue', []);\n        \n        },\n        {\n        // all in base class\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009, 2017, A. Plesch, Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### BooleanFilter ###\nx3dom.registerNodeType(\n    \"BooleanToggle\",\n    \"EventUtilities\",\n    defineClass(x3dom.nodeTypes.X3DChildNode,\n        \n        /**\n         * Constructor for BooleanToggle\n         * @constructs x3dom.nodeTypes.BooleanToggle\n         * @x3d 3.3\n         * @component EventUtilities\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DChildNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc stores and toggles boolean value\n         */\n         \n        function (ctx) {\n            x3dom.nodeTypes.BooleanToggle.superClass.call(this, ctx);\n            \n            /**\n             * input bool in event to cause toggling.\n             * @var {x3dom.fields.SFBool} set_boolean\n             * @memberof x3dom.nodeTypes.BooleanToggle\n             * @initvalue None\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'set_boolean');\n            \n            /**\n             * stored value to toggle and output; resetable\n             * @var {x3dom.fields.SFBool} toggle\n             * @memberof x3dom.nodeTypes.BooleanToggle\n             * @initvalue false\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'toggle', false);\n            \n        },\n        {\n            fieldChanged: function(fieldName)\n            {\n                if (fieldName === 'set_boolean') { //resetting toggle happens elsewhere \n                    if (this._vf.set_boolean) { //ignore false as input\n                      var toggled = ! this._vf.toggle; //minimize property access\n                      this._vf.toggle = toggled;\n                      this.postMessage('toggle', toggled);\n                    }\n                    return;\n                }\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009, 2017, A. Plesch, Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### BooleanFilter ###\nx3dom.registerNodeType(\n    \"BooleanTrigger\",\n    \"EventUtilities\",\n    defineClass(x3dom.nodeTypes.X3DTriggerNode,\n        \n        /**\n         * Constructor for BooleanTrigger\n         * @constructs x3dom.nodeTypes.BooleanTrigger\n         * @x3d 3.3\n         * @component EventUtilities\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DChildNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc generates true Boolean events upon receiving time events\n         */\n         \n        function (ctx) {\n            x3dom.nodeTypes.BooleanTrigger.superClass.call(this, ctx);\n            \n            /**\n             * input time in event to trigger output.\n             * @var {x3dom.fields.SFBool} set_triggerTime\n             * @memberof x3dom.nodeTypes.BooleanTrigger\n             * @initvalue None\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFTime(ctx, 'set_triggerTime');\n            \n            /**\n             * output field name; probably needed only as event name since output only; not 'physically'\n             * @var {x3dom.fields.SFBool} triggerTrue\n             * @memberof x3dom.nodeTypes.BooleanTrigger\n             * @initvalue None\n             * @field x3d\n             * @instance\n             */\n            //this.addField_SFBool(ctx, 'triggerTrue');\n            \n        },\n        {\n            fieldChanged: function(fieldName)\n            {\n                if (fieldName === 'set_triggerTime') { //for any time input\n                    this.postMessage('triggerTrue', true);\n                }\n                return;\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009, 2017, A. Plesch, Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### IntegerSequencer ###\nx3dom.registerNodeType(\n    \"IntegerSequencer\",\n    \"EventUtilities\",\n    defineClass(x3dom.nodeTypes.X3DSequencerNode,\n        \n        /**\n         * Constructor for IntegerSequencer\n         * @constructs x3dom.nodeTypes.IntegerSequencer\n         * @x3d 3.3\n         * @component EventUtilities\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DSequencerNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The IntegerSequencer node generates sequential discrete value_changed events selected from the keyValue field in response to each set_fraction, next, or previous event.\n         */\n         \n        function (ctx) {\n            x3dom.nodeTypes.IntegerSequencer.superClass.call(this, ctx);\n            \n            /**\n             * Defines the set of integers, that are used for sequencing.\n             * @var {x3dom.fields.MFInt32} keyValue\n             * @memberof x3dom.nodeTypes.IntegerSequencer\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFInt32(ctx, 'keyValue', []);\n        \n        },\n        {\n        // all in base class\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009, 2017, A. Plesch, Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### BooleanFilter ###\nx3dom.registerNodeType(\n    \"IntegerTrigger\",\n    \"EventUtilities\",\n    defineClass(x3dom.nodeTypes.X3DTriggerNode,\n        \n        /**\n         * Constructor for IntegerTrigger\n         * @constructs x3dom.nodeTypes.IntegerTrigger\n         * @x3d 3.3\n         * @component EventUtilities\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DChildNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc generates Integer events upon receiving Boolean events\n         */\n         \n        function (ctx) {\n            x3dom.nodeTypes.IntegerTrigger.superClass.call(this, ctx);\n            \n            /**\n             * input boolean to trigger output.\n             * @var {x3dom.fields.SFBool} set_boolean\n             * @memberof x3dom.nodeTypes.IntegerTrigger\n             * @initvalue None\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'set_boolean');\n            \n            /**\n             * integer value to be output upon input; can be reset\n             * @var {x3dom.fields.SFInt32} integerKey\n             * @memberof x3dom.nodeTypes.IntegerTrigger\n             * @initvalue -1\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'integerKey', -1);\n      \n            /**\n             * output field name; probably needed only as event name since output only; not 'physically'\n             * @var {x3dom.fields.SFInt32} triggerValue\n             * @memberof x3dom.nodeTypes.IntegerTrigger\n             * @initvalue none\n             * @field x3d\n             * @instance\n             */\n            //this.addField_SFInt32(ctx, 'triggerValue');\n            \n        },\n        {\n            fieldChanged: function(fieldName)\n            {\n                if (fieldName === 'set_boolean') { //for any boolean input\n                  //if (this._vf.set_boolean) //Mantis 519 proposal: only if true\n                    this.postMessage('triggerValue', this._vf.integerKey);\n                }\n                return;\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009, 2017, A. Plesch, Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### BooleanFilter ###\nx3dom.registerNodeType(\n    \"TimeTrigger\",\n    \"EventUtilities\",\n    defineClass(x3dom.nodeTypes.X3DTriggerNode,\n        \n        /**\n         * Constructor for TimeTrigger\n         * @constructs x3dom.nodeTypes.TimeTrigger\n         * @x3d 3.3\n         * @component EventUtilities\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DChildNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc generates Time events upon receiving Boolean events\n         */\n         \n        function (ctx) {\n            x3dom.nodeTypes.TimeTrigger.superClass.call(this, ctx);\n            \n            /**\n             * input boolean to trigger output.\n             * @var {x3dom.fields.SFBool} set_boolean\n             * @memberof x3dom.nodeTypes.TimeTrigger\n             * @initvalue None\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'set_boolean');\n            \n            /**\n             * output field name; probably needed only as event name since output only; not 'physically'\n             * @var {x3dom.fields.SFTime} triggerTime\n             * @memberof x3dom.nodeTypes.TimeTrigger\n             * @initvalue none\n             * @field x3d\n             * @instance\n             */\n            //this.addField_SFTime(ctx, 'triggerTime');\n            \n        },\n        {\n            fieldChanged: function(fieldName)\n            {\n                if (fieldName === 'set_boolean') { //for any boolean input\n                  //if (this._vf.set_boolean) //Mantis 519 proposal\n                    this.postMessage('triggerTime', Date.now()/1000);\n                }\n                return;\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### GeoCoordinate ### */\nx3dom.registerNodeType(\n    \"GeoCoordinate\",\n    \"Geospatial\",\n    defineClass(x3dom.nodeTypes.X3DCoordinateNode,\n        \n        /**\n         * Constructor for GeoCoordinate\n         * @constructs x3dom.nodeTypes.GeoCoordinate\n         * @x3d 3.3\n         * @component Geospatial\n         * @status full\n         * @extends x3dom.nodeTypes.X3DCoordinateNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The GeoCoordinate node specifies a list of coordinates in a spatial reference frame.\n         * It is used in the coord field of vertex-based geometry nodes including IndexedFaceSet, IndexedLineSet, and PointSet.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.GeoCoordinate.superClass.call(this, ctx);\n\n\n            /**\n             * The point array is used to contain the actual geospatial coordinates and should be provided in a format consistent with that specified for the particular geoSystem.\n             * @var {x3dom.fields.MFVec3f} point\n             * @memberof x3dom.nodeTypes.GeoCoordinate\n             * @initvalue []\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFVec3f(ctx, 'point', []);\n\n            /**\n             * The geoSystem field is used to define the spatial reference frame.\n             * @var {x3dom.fields.MFString} geoSystem\n             * @range {[\"GD\", ...], [\"UTM\", ...], [\"GC\", ...]}\n             * @memberof x3dom.nodeTypes.GeoCoordinate\n             * @initvalue ['GD','WE']\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFString(ctx, 'geoSystem', ['GD', 'WE']);\n\n            /**\n             * The geoOrigin field is used to specify a local coordinate frame for extended precision.\n             * @var {x3dom.fields.SFNode} geoOrigin\n             * @memberof x3dom.nodeTypes.GeoCoordinate\n             * @initvalue x3dom.nodeTypes.GeoOrigin\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('geoOrigin', x3dom.nodeTypes.GeoOrigin);\n        \n        },\n        {\n            elipsoideParameters:\n            {\n                'AA' : [ 'Airy 1830', '6377563.396', '299.3249646' ],\n                'AM' : [ 'Modified Airy', '6377340.189', '299.3249646' ],\n                'AN' : [ 'Australian National', '6378160', '298.25' ],\n                'BN' : [ 'Bessel 1841 (Namibia)', '6377483.865', '299.1528128' ],\n                'BR' : [ 'Bessel 1841 (Ethiopia Indonesia...)', '6377397.155', '299.1528128' ],\n                'CC' : [ 'Clarke 1866', '6378206.4', '294.9786982' ],\n                'CD' : [ 'Clarke 1880', '6378249.145', '293.465' ],\n                'EA' : [ 'Everest (India 1830)', '6377276.345', '300.8017' ],\n                'EB' : [ 'Everest (Sabah & Sarawak)', '6377298.556', '300.8017' ],\n                'EC' : [ 'Everest (India 1956)', '6377301.243', '300.8017' ],\n                'ED' : [ 'Everest (W. Malaysia 1969)', '6377295.664', '300.8017' ],\n                'EE' : [ 'Everest (W. Malaysia & Singapore 1948)', '6377304.063', '300.8017' ],\n                'EF' : [ 'Everest (Pakistan)', '6377309.613', '300.8017' ],\n                'FA' : [ 'Modified Fischer 1960', '6378155', '298.3' ],\n                'HE' : [ 'Helmert 1906', '6378200', '298.3' ],\n                'HO' : [ 'Hough 1960', '6378270', '297' ],\n                'ID' : [ 'Indonesian 1974', '6378160', '298.247' ],\n                'IN' : [ 'International 1924', '6378388', '297' ],\n                'KA' : [ 'Krassovsky 1940', '6378245', '298.3' ],\n                'RF' : [ 'Geodetic Reference System 1980 (GRS 80)', '6378137', '298.257222101' ],\n                'SA' : [ 'South American 1969', '6378160', '298.25' ],\n                'WD' : [ 'WGS 72', '6378135', '298.26' ],\n                'WE' : [ 'WGS 84', '6378137', '298.257223563' ]\n            },\n\n            fieldChanged: function(fieldName) {\n                if (fieldName == \"point\" || fieldName == \"geoSystem\") {\n                    Array.forEach(this._parentNodes, function (node) {\n                        node.fieldChanged(\"coord\");\n                    });\n                }\n            },\n\n            isLogitudeFirst: function(geoSystem) {\n                for(var i=0; i<geoSystem.length; ++i)\n                    if(geoSystem[i] == 'longitude_first')\n                        return true;\n\n                return false;\n            },\n\n            getElipsoideCode: function(geoSystem)\n            {\n                for(var i=0; i<geoSystem.length; ++i)\n                {\n                    var code = geoSystem[i];\n                    if(this.elipsoideParameters[code])\n                        return code;\n                }\n                //default elipsoide code\n                return 'WE';\n            },\n\n            getElipsoide: function(geoSystem)\n            {\n                return this.elipsoideParameters[this.getElipsoideCode(geoSystem)];\n            },\n\n            getReferenceFrame: function(geoSystem)\n            {\n                for(var i=0; i<geoSystem.length; ++i)\n                {\n                    var code = geoSystem[i];\n\n                    if(code == 'GD' || code == 'GDC')\n                        return 'GD';\n                    if(code == 'GC' || code == 'GCC')\n                        return 'GC';\n                    if(code == 'UTM')\n                        return 'UTM';\n\n                    else\n                        x3dom.debug.logError('Unknown GEO system: [' + geoSystem + ']');\n                }\n\n                // default reference frame is GD WE\n                return 'GD';\n            },\n\n            getUTMZone: function(geoSystem)\n            {\n                for(var i=0; i<geoSystem.length; ++i)\n                {\n                    var code = geoSystem[i];\n\n                    if(code[0] == 'Z')\n                        return code.substring(1);\n                }\n                // no zone found\n                x3dom.debug.logError('no UTM zone but is required:' + geoSystem);\n            },\n\n            getUTMHemisphere: function(geoSystem)\n            {\n                for(var i=0; i<geoSystem.length; ++i)\n                {\n                    var code = geoSystem[i];\n\n                    if(code == 'S')\n                        return code;\n                }\n                // North by default according to spec\n                return 'N';\n            },\n\n            isUTMEastingFirst: function(geoSystem)\n            {\n                for(var i=0; i<geoSystem.length; ++i)\n                {\n                    var code = geoSystem[i];\n                    if(code == 'easting_first')\n                        return true;\n                }\n                // Northing first by default according to spec\n                return false;\n            },\n\n            UTMtoGC: function(geoSystem, coords)\n            {\n                //parse UTM projection parameters\n                var utmzone = this.getUTMZone(geoSystem);\n                if(utmzone < 1 || utmzone > 60 || utmzone === undefined)\n                    return x3dom.debug.logError('invalid UTM zone: ' + utmzone + ' in geosystem ' + geoSystem);\n                var hemisphere = this.getUTMHemisphere(geoSystem);\n                var eastingFirst = this.isUTMEastingFirst(geoSystem);\n                var elipsoide = this.getElipsoide(geoSystem);\n                //below from U.W. Green Bay Prof. Dutch; returns coordinates in the input ell., not WGS84\n                var a = elipsoide[1];\n                var f = 1/elipsoide[2];\n                var k0 = 0.9996; //scale on central meridian\n                var b = a * (1 - f); //polar axis.\n                var esq = (1 - (b/a)*(b/a)); //e squared for use in expansions\n                var e = Math.sqrt(esq); //eccentricity\n                var e0 = e/Math.sqrt(1 - esq); //Called e prime in reference\n                var e0sq = esq/(1 - esq); // e0 squared - always even powers\n                var zcm = 3 + 6 * (utmzone - 1) - 180; //Central meridian of zone\n                var e1 = (1 - Math.sqrt(1 - esq))/(1 + Math.sqrt(1 - esq)); //Called e1 in USGS PP 1395 also\n                var e1sq = e1*e1;\n                //var M0 = 0; //In case origin other than zero lat - not needed for standard UTM\n                var output = new x3dom.fields.MFVec3f();\n                var rad2deg = 180/Math.PI;\n\n                var f3o64 = 3/64;\n                var f5o256 = 5/256;\n                var f27o32 = 27/32;\n                var f21o16 = 21/16;\n                var f55o32 = 55/32;\n                var f151o96 = 151/96;\n                var f1097o512 = 1097/512;\n                var fmua = 1 - esq*(0.25 + esq*(f3o64 + f5o256*esq));\n                var fphi11 = e1*(1.5 - f27o32*e1sq);\n                var fphi12 = e1sq*(f21o16 - f55o32*e1sq);\n                \n                var current, x, y, z, M, mu, phi1, cosphi1, C1, tanphi1, T1, T1sq;\n                var esinphi1, oneesinphi1, N1, R1, D, Dsq, C1sq, phi, lng;\n                \n                for(var i=0; i<coords.length; ++i)\n                {\n                    x = (eastingFirst ? coords[i].x : coords[i].y);\n                    y = (eastingFirst ? coords[i].y : coords[i].x);\n                    //z = coords[i].z; //not used\n\n                    //var M = M0 + y/k0; //Arc length along standard meridian.\n                    //var M = y/k0;\n                    //if (hemisphere == \"S\"){ M = M0 + (y - 10000000)/k; }\n                    M = (hemisphere == \"S\" ? (y - 10000000) : y )/k0 ;\n                    mu = M/(a * fmua);\n                    phi1 = mu + fphi11*Math.sin(2*mu) + fphi12*Math.sin(4*mu); //Footprint Latitude\n                    phi1 = phi1 + e1*(e1sq*(Math.sin(6*mu)*f151o96 + Math.sin(8*mu)*f1097o512));\n                    cosphi1 = Math.cos(phi1);\n                    C1 = e0sq*cosphi1*cosphi1;\n                    tanphi1 = Math.tan(phi1);\n                    T1 = tanphi1*tanphi1;\n                    T1sq = T1*T1;\n                    esinphi1 = e*Math.sin(phi1);\n                    oneesinphi1 = 1 - esinphi1*esinphi1;\n                    N1 = a/Math.sqrt(oneesinphi1);\n                    R1 = N1*(1-esq)/oneesinphi1;\n                    D = (x-500000)/(N1*k0);\n                    Dsq = D*D;\n                    C1sq = C1*C1;\n                    phi = Dsq*(0.5 - Dsq*(5 + 3*T1 + 10*C1 - 4*C1sq - 9*e0sq)/24);\n                    phi = phi + Math.pow(D,6)*(61 + 90*T1 + 298*C1 + 45*T1sq -252*e0sq - 3*C1sq)/720;\n                    phi = phi1 - (N1*tanphi1/R1)*phi;\n                    lng = D*(1 + Dsq*((-1 -2*T1 -C1)/6 + Dsq*(5 - 2*C1 + 28*T1 - 3*C1sq +8*e0sq + 24*T1sq)/120))/cosphi1;\n                    current = new x3dom.fields.SFVec3f();\n                    current.x = zcm + rad2deg*lng;\n                    current.y = rad2deg*phi;\n                    current.z = coords[i].z;\n                    output.push(current);\n                }\n                //x3dom.debug.logInfo('transformed coords ' + output);\n\n                //GD to GC and return\n                var GDgeoSystem = new x3dom.fields.MFString();\n                // there may be a better way to construct this geoSystem\n                GDgeoSystem.push(\"GD\");\n                GDgeoSystem.push(this.getElipsoideCode(geoSystem));\n                GDgeoSystem.push(\"longitude_first\");\n                return this.GDtoGC(GDgeoSystem, output);\n            },\n\n            //just used for GeoPositionInterpolator; after slerp\n            //for coordinates in the same UTM zone stripe, linear interpolation is almost identical\n            //so this is for correctness and if UTM zone is used outside stripe\n            GCtoUTM: function(geoSystem, coords) {\n                // geoSystem is target UTM\n                // GCtoGD\n                var coordsGD = this.GCtoGD(geoSystem, coords);\n                // GDtoUTM\n                // parse UTM projection parameters\n                var utmzone = this.getUTMZone(geoSystem);\n                if(utmzone < 1 || utmzone > 60 || utmzone === undefined)\n                    return x3dom.debug.logError('invalid UTM zone: ' + utmzone + ' in geosystem ' + geoSystem);\n                var hemisphere = this.getUTMHemisphere(geoSystem);\n                var eastingFirst = this.isUTMEastingFirst(geoSystem);\n                var elipsoide = this.getElipsoide(geoSystem);\n                //below from U.W. Green Bay Prof. Dutch; returns coordinates in the input ell., not WGS84\n                var a = elipsoide[1];\n                var f = 1/elipsoide[2];\n                var k0 = 0.9996; //scale on central meridian\n                var b = a * (1 - f); //polar axis.\n                var esq = (1 - (b/a)*(b/a)); //e squared for use in expansions\n                var e = Math.sqrt(esq); //eccentricity\n                //var e0 = e/Math.sqrt(1 - esq); //Called e prime in reference\n                var e0sq = esq/(1 - esq); // e0 squared - always even powers\n                //var e1 = (1 - Math.sqrt(1 - esq))/(1 + Math.sqrt(1 - esq)); //Called e1 in USGS PP 1395 also\n                //var e1sq = e1*e1;\n                var M0 = 0; //In case origin other than zero lat - not needed for standard UTM\n                var deg2rad = Math.PI/180;\n                var zcmrad = (3 + 6 * (utmzone - 1) - 180)*deg2rad; //Central meridian of zone\n                var coordsUTM = new x3dom.fields.MFVec3f();\n                var N, T, C, A, M, x, y, phi, lng, cosphi, tanphi, Asq;\n                var i, current;\n                var fMphi = 1 - esq*(1/4 + esq*(3/64 + 5*esq/256));\n                var fM2phi = esq*(3/8 + esq*(3/32 + 45*esq/1024));\n                var fM4phi = esq*esq*(15/256 + esq*45/1024);\n                var fM6phi = esq*esq*esq*(35/3072);\n                for (i=0; i<coordsGD.length; ++i) {\n                    current = new x3dom.fields.SFVec3f();\n                    phi = coordsGD[i].y*deg2rad;\n                    lng = coordsGD[i].x*deg2rad;\n                    cosphi = Math.cos(phi);\n                    tanphi = Math.tan(phi);\n                    \n                    N = a/Math.sqrt(1 - Math.pow(e * Math.sin(phi), 2));\n                    T = Math.pow(tanphi, 2);\n                    C = e0sq*Math.pow(cosphi, 2);\n                    A = (lng - zcmrad) * cosphi;\n                    //Calculate M\n                    M = phi*fMphi;\n                    M = M - Math.sin(2*phi)*fM2phi;\n                    M = M + Math.sin(4*phi)*fM4phi;\n                    M = M - Math.sin(6*phi)*fM6phi;\n                    M = M * a;//Arc length along standard meridian\n                    //Calculate UTM Values\n                    Asq = A*A;\n                    x = k0*N*A*(1 + Asq*((1 - T + C)/6 + Asq*(5 - T*(18 + T) + 72*C - 58*e0sq)/120));//Easting relative to CM\n                    x = x + 500000;//Easting standard \n                    y = k0*(M - M0 + N*tanphi*(Asq*(0.5 + Asq*((5 - T + 9*C + 4*C*C)/24 + Asq*(61 - T*(58 + T) + 600*C - 330*e0sq)/720))));//Northing from equator\n                    if (y < 0) {\n                        if (hemisphere == \"N\") {\n                            x3dom.debug.logError('UTM zone in northern hemisphere but coordinates in southern!');\n                        }\n                        y = 10000000+y;}\n                    current.x = eastingFirst ? x : y;\n                    current.y = eastingFirst ? y : x;\n                    current.z = coordsGD[i].z;\n                    coordsUTM.push(current);\n                }\n                return coordsUTM;    \n            },\n            \n            GDtoGC: function(geoSystem, coords) {\n\n                var output = new x3dom.fields.MFVec3f();\n\n                var elipsoide = this.getElipsoide(geoSystem);\n                var A = elipsoide[1];\n                var eccentricity = elipsoide[2];\n\n                var longitudeFirst = this.isLogitudeFirst(geoSystem);\n\n                // large parts of this code from freeWRL\n                // var A = radius;\n                var A2 = A*A;\n                var F = 1.0/eccentricity;\n                var C = A*(1.0-F);\n                var C2 = C*C;\n                var C2oA2 = C2/A2;\n                var Eps2 = F*(2.0-F);\n                //var Eps25 = 0.25*Eps2;\n\n                var radiansPerDegree = 0.0174532925199432957692;\n                \n                var i, current, source_lat, source_lon, slat, slat2, clat, Rn, RnPh;\n\n                // for (current in coords)\n                for(i=0; i<coords.length; ++i)\n                {\n                    current = new x3dom.fields.SFVec3f();\n\n                    source_lat = radiansPerDegree * (longitudeFirst == true ? coords[i].y : coords[i].x);\n                    source_lon = radiansPerDegree * (longitudeFirst == true ? coords[i].x : coords[i].y);\n\n                    slat = Math.sin(source_lat);\n                    slat2 = slat*slat;\n                    clat = Math.cos(source_lat);\n\n                    /* square root approximation for Rn */\n                    /* replaced by real sqrt\n                     var Rn = A / ( (0.25 - Eps25 * slat2 + 0.9999944354799/4.0) +\n                     (0.25-Eps25 * slat2)/(0.25 - Eps25 * slat2 + 0.9999944354799/4.0));\n                     */\n\n                    // with real sqrt; really slower ?\n                    Rn = A / Math.sqrt(1.0 - Eps2 * slat2);\n\n                    RnPh = Rn + coords[i].z;\n\n                    current.x = RnPh * clat * Math.cos(source_lon);\n                    current.y = RnPh * clat * Math.sin(source_lon);\n                    current.z = (C2oA2 * Rn + coords[i].z) * slat;\n\n                    output.push(current);\n                }\n\n                return output;\n            },\n            \n            GCtoGD: function(geoSystem, coords) {\n                // below uses http://info.ogp.org.uk/geodesy/guides/docs/G7-2.pdf\n                var output = new x3dom.fields.MFVec3f();\n                var rad2deg = 180/Math.PI;\n                var ellipsoide = this.getElipsoide(geoSystem);\n                var a = ellipsoide[1];\n                var f = 1/ellipsoide[2];\n                var b = a * (1 - f); //polar axis.\n                var esq = (1 - (b/a)*(b/a)); //e squared for use in expansions\n                //var e = Math.sqrt(esq); //eccentricity\n                var eps = esq/(1 - esq);\n                var i, current, x, y, z, p, q, lat, nu, elev, lon;\n                for(i=0; i<coords.length; ++i) {\n                    x = coords[i].x;\n                    y = coords[i].y;\n                    z = coords[i].z;\n                    \n                    p = Math.sqrt(x*x + y*y);\n                    q = Math.atan((z * a) / (p * b));\n                    lat = Math.atan((z + eps * b * Math.pow(Math.sin(q),3))/(p - esq * a * Math.pow(Math.cos(q),3)));\n                    nu = a / Math.sqrt(1 - esq * Math.pow(Math.sin(lat),2));\n                    elev = p/Math.cos(lat) - nu;\n                    // atan2 gets the sign correct for longitude; is exact since in circular section\n                    lon = Math.atan2(y, x);\n                    \n                    current = new x3dom.fields.SFVec3f();\n                    current.x = lon * rad2deg;\n                    current.y = lat * rad2deg;\n                    current.z = elev;\n\n                    output.push(current);\n                }                \n                return output;\n            },\n        \n            GEOtoGC: function(geoSystem, geoOrigin, coords) {\n                \n                var referenceFrame = this.getReferenceFrame(geoSystem);\n\n                if(referenceFrame == 'GD')\n                    return this.GDtoGC(geoSystem, coords);\n\n                else if(referenceFrame == 'UTM')\n                    return this.UTMtoGC(geoSystem, coords);\n\n                else if(referenceFrame ==  'GC')\n                {\n                    // Performance Hack\n                    // Normaly GDtoGC & UTMtoGC will create a copy\n                    // If we are already in GC & have an origin: we have to copy here\n                    // Else Origin will change original DOM elements\n\n                    if(geoOrigin.node)\n                    {\n                        var copy = new x3dom.fields.MFVec3f();\n                        for(var i=0; i<coords.length; ++i)\n                        {\n                            var current = new x3dom.fields.SFVec3f();\n\n                            current.x = coords[i].x;\n                            current.y = coords[i].y;\n                            current.z = coords[i].z;\n\n                            copy.push(current);\n                        }\n                        return copy;\n                    }\n                    else\n                        return coords;\n                }\n                else {\n                    x3dom.debug.logError('Unknown geoSystem: ' + geoSystem[0]);\n                    return new x3dom.fields.MFVec3f();\n                }\n            },\n\n            GCtoGEO: function(geoSystem, geoOrigin, coords) {\n                \n                var referenceFrame = this.getReferenceFrame(geoSystem);\n\n                if(referenceFrame == 'GD') {\n                    var coordsGD = this.GCtoGD(geoSystem, coords);\n                    if(!this.isLogitudeFirst(geoSystem)) {\n                        var currentx;\n                        for(var i=0; i<coordsGD.length; ++i) {\n                            currentx = coordsGD[i].x;\n                            coordsGD[i].x = coordsGD[i].y;\n                            coordsGD[i].y = currentx;\n                        }\n                    }\n                    return coordsGD;\n                }\n\n                else if(referenceFrame == 'UTM')\n                    return this.GCtoUTM(geoSystem, coords);\n\n                else if(referenceFrame ==  'GC')\n                {\n                    // Performance Hack\n                    // Normaly GCtoGD & GCtoUTM will create a copy\n                    // If we are already in GC & have an origin: we have to copy here\n                    // Else Origin will change original DOM elements\n\n                    if(geoOrigin.node)\n                    {\n                        var copy = new x3dom.fields.MFVec3f();\n                        for(var i=0; i<coords.length; ++i)\n                        {\n                            var current = new x3dom.fields.SFVec3f();\n\n                            current.x = coords[i].x;\n                            current.y = coords[i].y;\n                            current.z = coords[i].z;\n\n                            copy.push(current);\n                        }\n                        return copy;\n                    }\n                    else\n                        return coords;\n                }\n                else {\n                    x3dom.debug.logError('Unknown geoSystem: ' + geoSystem[0]);\n                    return new x3dom.fields.MFVec3f();\n                }\n            },\n            \n            OriginToGC: function(geoOrigin)\n            {\n                // dummy function to send a scalar to an array function\n                var geoCoords = geoOrigin.node._vf.geoCoords;\n                var geoSystem = geoOrigin.node._vf.geoSystem;\n\n                var point = new x3dom.fields.SFVec3f();\n                point.x = geoCoords.x;\n                point.y = geoCoords.y;\n                point.z = geoCoords.z;\n\n                var temp = new x3dom.fields.MFVec3f();\n                temp.push(point);\n\n                // transform origin to GeoCentric\n                var origin = this.GEOtoGC(geoSystem, geoOrigin, temp);\n\n                return origin[0];\n            },\n            \n            GCtoX3D: function(geoSystem, geoOrigin, coords)\n            {\n                // needs geoSystem since GC can have different ellipsoids\n                var gc = coords;\n                // transform by origin\n                if(geoOrigin.node)\n                {\n                    // transform points by origin\n                    var origin = this.OriginToGC(geoOrigin);\n                    //avoid expensive matrix inversion by just subtracting origin\n                    var matrix = x3dom.fields.SFMatrix4f.translation(origin.negate());\n                    \n                    //also rotate Y up if requested\n                    if(geoOrigin.node._vf.rotateYUp)\n                    {\n                        //rotation is inverse of GeoLocation rotation, eg. Up to Y and N to -Z\n                        var rotmat = x3dom.nodeTypes.GeoLocation.prototype.getGeoRotMat(geoSystem, origin).inverse();\n                        //first translate, then rotate\n                        matrix = rotmat.mult(matrix);\n                    }\n                    \n                    for(var i=0; i<coords.length; ++i)\n                        gc[i] = matrix.multMatrixPnt(coords[i]);\n                }\n                \n                return gc;\n            },\n\n            GEOtoX3D: function(geoSystem, geoOrigin, coords)\n            {\n                // transform points to GeoCentric\n                var gc = this.GEOtoGC(geoSystem, geoOrigin, coords);\n                return this.GCtoX3D(geoSystem, geoOrigin, gc);               \n            },\n\n            getPoints: function()\n            {\n                return this.GEOtoX3D(this._vf.geoSystem, this._cf.geoOrigin, this._vf.point);\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### GeoElevationGrid ### */\nx3dom.registerNodeType(\n    \"GeoElevationGrid\",\n    \"Geospatial\",\n    defineClass(x3dom.nodeTypes.X3DGeometryNode,\n        \n        /**\n         * Constructor for GeoElevationGrid\n         * @constructs x3dom.nodeTypes.GeoElevationGrid\n         * @x3d 3.3\n         * @component Geospatial\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The GeoElevationGrid node specifies a uniform grid of elevation values within some spatial reference frame.\n         * These are then transparently transformed into a geocentric, curved-earth representation.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.GeoElevationGrid.superClass.call(this, ctx);\n\n            /**\n            * The texCoord field specifies per-vertex texture coordinates for the GeoElevationGrid node. If texCoord is NULL, default texture coordinates are applied to the geometry.\n            * @var {x3dom.fields.SFNode} texCoord\n            * @memberof x3dom.nodeTypes.GeoElevationGrid\n            * @initvalue x3dom.nodeTypes.X3DTextureCoordinateNode\n            * @field x3d\n            * @instance\n            */\n            this.addField_SFNode('texCoord', x3dom.nodeTypes.X3DTextureCoordinateNode);\n\n            /**\n             * The geoSystem field is used to define the spatial reference frame.\n             * @var {x3dom.fields.MFString} geoSystem\n             * @range {[\"GD\", ...], [\"UTM\", ...], [\"GC\", ...]}\n             * @memberof x3dom.nodeTypes.GeoElevationGrid\n             * @initvalue ['GD','WE']\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFString(ctx, 'geoSystem', ['GD', 'WE']);\n\n            /**\n             * The geoGridOrigin field specifies the geographic coordinate for the south-west corner (bottom-left) of the dataset.\n             * @var {x3dom.fields.SFVec3d} geoGridOrigin\n             * @memberof x3dom.nodeTypes.GeoElevationGrid\n             * @initvalue 0,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'geoGridOrigin', 0, 0, 0);\n\n            /**\n             * The height array contains xDimension × zDimension floating point values that represent elevation above the ellipsoid or the geoid, as appropriate.\n             * These values are given in row-major order from west to east, south to north.\n             * @var {x3dom.fields.MFDouble} height\n             * @memberof x3dom.nodeTypes.GeoElevationGrid\n             * @initvalue 0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFDouble(ctx, 'height', 0, 0);\n\n            /**\n             * The ccw field defines the ordering of the vertex coordinates of the geometry with respect to user-given or automatically generated normal vectors used in the lighting model equations.\n             * @var {x3dom.fields.SFBool} ccw\n             * @memberof x3dom.nodeTypes.GeoElevationGrid\n             * @initvalue true\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'ccw', true);\n            //this.addField_SFBool(ctx, 'colorPerVertex', true);\n\n            /**\n             * The creaseAngle field affects how default normals are generated.\n             * If the angle between the geometric normals of two adjacent faces is less than the crease angle, normals shall be calculated so that the faces are shaded smoothly across the edge; otherwise, normals shall be calculated so that a lighting discontinuity across the edge is produced.\n             * Crease angles shall be greater than or equal to 0.0 angle base units.\n             * @var {x3dom.fields.SFDouble} creaseAngle\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.GeoElevationGrid\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFDouble(ctx, 'creaseAngle', 0);\n            //this.addField_SFBool(ctx, 'normalPerVertex', true);\n            //this.addField_SFBool(ctx, 'solid', true);\n\n            /**\n             * Defines the grid size in x.\n             * @var {x3dom.fields.SFInt32} xDimension\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.GeoElevationGrid\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'xDimension', 0);\n\n            /**\n             * When the geoSystem is \"GD\", xSpacing refers to the number of units of longitude in angle base units between adjacent height values.\n             * When the geoSystem is \"UTM\", xSpacing refers to the number of eastings (length base units) between adjacent height values\n             * @var {x3dom.fields.SFDouble} xSpacing\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.GeoElevationGrid\n             * @initvalue 1.0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFDouble(ctx, 'xSpacing', 1.0);\n\n            /**\n             * The yScale value can be used to produce a vertical exaggeration of the data when it is displayed. If this value is set greater than 1.0, all heights will appear larger than actual.\n             * @var {x3dom.fields.SFFloat} yScale\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.GeoElevationGrid\n             * @initvalue 1\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'yScale', 1);\n\n            /**\n             * Defines the grid size in z.\n             * @var {x3dom.fields.SFInt32} zDimension\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.GeoElevationGrid\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'zDimension', 0);\n\n            /**\n             * When the geoSystem is \"GD\", zSpacing refers to the number of units of latitude in angle base units between vertical height values.\n             * When the geoSystem is \"UTM\", zSpacing refers to the number of northings (length base units) between vertical height values.\n             * @var {x3dom.fields.SFDouble} zSpacing\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.GeoElevationGrid\n             * @initvalue 1.0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFDouble(ctx, 'zSpacing', 1.0);\n            // this.addField_SFNode('color', x3dom.nodeTypes.PropertySetGeometry);\n            // this.addField_SFNode('normal', x3dom.nodeTypes.PropertySetGeometry);\n            // this.addField_SFNode('texCoord', x3dom.nodeTypes.PropertySetGeometry);\n\n            /**\n             * The geoOrigin field is used to specify a local coordinate frame for extended precision.\n             * @var {x3dom.fields.SFNode} geoOrigin\n             * @memberof x3dom.nodeTypes.GeoElevationGrid\n             * @initvalue x3dom.nodeTypes.GeoOrigin\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFNode('geoOrigin', x3dom.nodeTypes.GeoOrigin);\n\n            /**\n             * Specifies whether this geometry should be rendered with or without lighting.\n             * @var {x3dom.fields.SFBool} lit\n             * @memberof x3dom.nodeTypes.GeoElevationGrid\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'lit', true);\n        \n        },\n        {\n            nodeChanged: function()\n            {\n                var geoSystem = this._vf.geoSystem;\n                var geoOrigin = this._cf.geoOrigin;\n\n                var height = this._vf.height;\n\n                var yScale = this._vf.yScale;\n                var xDimension = this._vf.xDimension;\n                var zDimension = this._vf.zDimension;\n                var xSpacing = this._vf.xSpacing;\n                var zSpacing = this._vf.zSpacing;\n                var geoGridOrigin = this._vf.geoGridOrigin;\n\n                // check for no height == dimensions\n                if(height.length !== (xDimension * zDimension))\n                    x3dom.debug.logError('GeoElevationGrid: height.length(' + height.length +\n                        ') != x/zDimension(' + xDimension + '*' + zDimension + ')');\n\n                var longitude_first = x3dom.nodeTypes.GeoCoordinate.prototype.isLogitudeFirst(geoSystem);\n                var easting_first = x3dom.nodeTypes.GeoCoordinate.prototype.isUTMEastingFirst(geoSystem);\n                \n                var ccw = this._vf.ccw;\n\n                // coords, texture coords\n                var delta_x = 1 / (xDimension-1);\n                var delta_z = 1 / (zDimension-1);\n                \n                //from elevationgrid.js\n                var numTexComponents = 2;\n\n                var texCoordNode = this._cf.texCoord.node;\n                var texPoints;\n                if (x3dom.isa(texCoordNode, x3dom.nodeTypes.MultiTextureCoordinate)) {\n                    if (texCoordNode._cf.texCoord.nodes.length)\n                        texCoordNode = texCoordNode._cf.texCoord.nodes[0];\n                }\n\n                if (texCoordNode) {\n                    if (texCoordNode._vf.point) {\n                        texPoints = texCoordNode._vf.point;\n                        if (x3dom.isa(texCoordNode, x3dom.nodeTypes.TextureCoordinate3D)) {\n                            numTexComponents = 3;\n                        }\n                    }\n                }\n                \n                var positions = new x3dom.fields.MFVec3f();\n                        \n                var texCoords = new x3dom.fields.MFVec2f();\n                        \n                for(var z=0; z<zDimension; ++z)\n                    for(var x=0; x<xDimension; ++x)\n                    {\n                        // texture coord\n                        var tex_coord = new x3dom.fields.SFVec2f();\n                        tex_coord.x = x*delta_x;\n                        tex_coord.y = z*delta_z;\n                        texCoords.push(tex_coord);\n\n                        // coord\n                        var coord = new x3dom.fields.SFVec3f();\n                        if(longitude_first||easting_first)\n                        {\n                            coord.x = x * xSpacing;\n                            coord.y = z * zSpacing;\n                        }\n                        else\n                        // xSpacing is always east-west axis but geoSystem wants x north-south \n                        {\n                            coord.x = z * zSpacing;\n                            coord.y = x * xSpacing;\n                        }\n                        coord.z = height[(z*xDimension)+x] * yScale;\n                        coord = coord.add(geoGridOrigin);\n                        positions.push(coord);\n                    }\n\n                // indices\n                var indices = new x3dom.fields.MFInt32();\n                for(var z=0; z<(zDimension-1); z++)\n                {\n                    for(var x=0; x<(xDimension-1); x++)\n                    {\n                        var p0 = x + (z * xDimension);\n                        var p1 = x + (z * xDimension) + 1;\n                        var p2 = x + ((z + 1) * xDimension) + 1;\n                        var p3 = x + ((z + 1) * xDimension);\n\n                        if(ccw)\n                        {\n                            indices.push(p0);\n                            indices.push(p1);\n                            indices.push(p2);\n\n                            indices.push(p0);\n                            indices.push(p2);\n                            indices.push(p3);\n                        }\n                        else\n                        {\n                            indices.push(p0);\n                            indices.push(p3);\n                            indices.push(p2);\n\n                            indices.push(p0);\n                            indices.push(p2);\n                            indices.push(p1);\n                        }\n                    }\n                }\n\n                // convert to x3dom coord system\n                var transformed = x3dom.nodeTypes.GeoCoordinate.prototype.GEOtoX3D(geoSystem, geoOrigin, positions);\n\n                //if we want flat shading, we have to duplicate some vertices here\n                //(as webgl does only support single-indexed rendering)\n                if (this._vf.creaseAngle <= x3dom.fields.Eps) {\n\n                    var that = this;\n\n                    (function (){\n                        var indicesFlat   = new x3dom.fields.MFInt32(),\n                            positionsFlat = new x3dom.fields.MFVec3f(),\n                            texCoordsFlat = new x3dom.fields.MFVec2f(); //typo? was 3f\n\n                        if (texPoints) {\n                            that.generateNonIndexedTriangleData(indices, transformed, null, texPoints, null,\n                            positionsFlat, null, texCoordsFlat, null);\n                        }\n                        else {\n                            that.generateNonIndexedTriangleData(indices, transformed, null, texCoords, null,\n                            positionsFlat, null, texCoordsFlat, null);\n                        }\n                        for (var i = 0; i < positionsFlat.length; ++i) {\n                            indicesFlat.push(i);\n                        }\n\n                        that._mesh._indices[0]   = indicesFlat.toGL();\n                        that._mesh._positions[0] = positionsFlat.toGL();\n                        that._mesh._texCoords[0] = texCoordsFlat.toGL();\n                        that._mesh._numTexComponents = 2; //3 not yet generated\n                    })();\n\n                    this._mesh.calcNormals(0);\n                }\n                //smooth shading\n                else {\n                    this._mesh._indices[0]   = indices.toGL();\n                    this._mesh._positions[0] = transformed.toGL();\n                    if (texPoints)  {this._mesh._texCoords[0] = texPoints.toGL();}\n                    else            {this._mesh._texCoords[0] = texCoords.toGL();}\n                    this._mesh._numTexComponents = numTexComponents;\n                    this._mesh.calcNormals(Math.PI);\n                }\n\n                this._mesh._invalidate = true;\n                this._mesh._numFaces = this._mesh._indices[0].length / 3;\n                this._mesh._numCoords = this._mesh._positions[0].length / 3;\n            },\n\n            generateNonIndexedTriangleData: function(indices, positions, normals, texCoords, colors,\n                                                     newPositions, newNormals, newTexCoords, newColors)\n            {\n                //@todo: add support for RGBA colors and 3D texture coordinates\n                //@todo: if there is any need for that, add multi-index support\n\n                for (var i = 0; i < indices.length; i+=3) {\n                    var i0 = indices[i  ],\n                        i1 = indices[i+1],\n                        i2 = indices[i+2];\n\n                    if (positions) {\n                        var p0 = new x3dom.fields.SFVec3f(),\n                            p1 = new x3dom.fields.SFVec3f(),\n                            p2 = new x3dom.fields.SFVec3f();\n\n                        p0.setValues(positions[i0]);\n                        p1.setValues(positions[i1]);\n                        p2.setValues(positions[i2]);\n\n                        newPositions.push(p0);\n                        newPositions.push(p1);\n                        newPositions.push(p2);\n                    }\n\n                    if (normals) {\n                        var n0 = new x3dom.fields.SFVec3f(),\n                            n1 = new x3dom.fields.SFVec3f(),\n                            n2 = new x3dom.fields.SFVec3f();\n\n                        n0.setValues(normals[i0]);\n                        n1.setValues(normals[i1]);\n                        n2.setValues(normals[i2]);\n\n                        newNormals.push(n0);\n                        newNormals.push(n1);\n                        newNormals.push(n2);\n                    }\n\n                    if (texCoords) {\n                        var t0 = new x3dom.fields.SFVec2f(),\n                            t1 = new x3dom.fields.SFVec2f(),\n                            t2 = new x3dom.fields.SFVec2f();\n\n                        t0.setValues(texCoords[i0]);//ignores .z if 3d\n                        t1.setValues(texCoords[i1]);\n                        t2.setValues(texCoords[i2]); //typo? was t1\n\n                        newTexCoords.push(t0);\n                        newTexCoords.push(t1);\n                        newTexCoords.push(t2);\n                    }\n\n                    if (colors) {\n                        var c0 = new x3dom.fields.SFVec3f(),\n                            c1 = new x3dom.fields.SFVec3f(),\n                            c2 = new x3dom.fields.SFVec3f();\n\n                        c0.setValues(texCoords[i0]);\n                        c1.setValues(texCoords[i1]);\n                        c1.setValues(texCoords[i2]);\n\n                        newColors.push(c0);\n                        newColors.push(c1);\n                        newColors.push(c2);\n                    }\n                }\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * (C)2016 Andreas Plesch, Waltham, MA, U.S.A\n * Dual licensed under the MIT and GPL\n */\n\n/* ### GeoLOD ### */\nx3dom.registerNodeType(\n    \"GeoLOD\",\n    \"Geospatial\",\n    //defineClass(x3dom.nodeTypes.X3DLODNode,\n    //official derivation, is not a real grouping node since it may not have children, only url references\n    defineClass(x3dom.nodeTypes.X3DBoundedObject,\n        \n        /**\n         * Constructor for GeoLOD\n         * @constructs x3dom.nodeTypes.GeoLOD\n         * @x3d 3.3\n         * @component Geospatial\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DLODNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The GeoLOD node provides a terrain-specialized form of the LOD node.\n         * It is a grouping node that specifies two different levels of detail for an object using a tree structure, where 0 to 4 children can be specified, and also efficiently manages the loading and unloading of these levels of detail.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.GeoLOD.superClass.call(this, ctx);\n\n\n            /**\n             * The geoSystem field is used to define the spatial reference frame.\n             * @var {x3dom.fields.MFString} geoSystem\n             * @range {[\"GD\", ...], [\"UTM\", ...], [\"GC\", ...]}\n             * @memberof x3dom.nodeTypes.GeoLOD\n             * @initvalue ['GD','WE']\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFString(ctx, 'geoSystem', ['GD', 'WE']);\n\n            /**\n             * The rootUrl and rootNode fields provide two different ways to specify the geometry of the root tile.\n             * You may use one or the other. The rootNode field lets you include the geometry for the root tile directly within the X3D file.\n             * @var {x3dom.fields.MFString} rootUrl\n             * @memberof x3dom.nodeTypes.GeoLOD\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFString(ctx, 'rootUrl', []);\n\n            /**\n             * When the viewer enters the specified range, this geometry is replaced with the contents of the four children files defined by child1Url through child4Url.\n             * The four children files are loaded into memory only when the user is within the specified range. Similarly, these are unloaded from memory when the user leaves this range.\n             * @var {x3dom.fields.MFString} child1Url\n             * @memberof x3dom.nodeTypes.GeoLOD\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFString(ctx, 'child1Url', []);\n\n            /**\n             * When the viewer enters the specified range, this geometry is replaced with the contents of the four children files defined by child1Url through child4Url.\n             * The four children files are loaded into memory only when the user is within the specified range. Similarly, these are unloaded from memory when the user leaves this range.\n             * @var {x3dom.fields.MFString} child2Url\n             * @memberof x3dom.nodeTypes.GeoLOD\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFString(ctx, 'child2Url', []);\n\n            /**\n             * When the viewer enters the specified range, this geometry is replaced with the contents of the four children files defined by child1Url through child4Url.\n             * The four children files are loaded into memory only when the user is within the specified range. Similarly, these are unloaded from memory when the user leaves this range.\n             * @var {x3dom.fields.MFString} child3Url\n             * @memberof x3dom.nodeTypes.GeoLOD\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFString(ctx, 'child3Url', []);\n\n            /**\n             * When the viewer enters the specified range, this geometry is replaced with the contents of the four children files defined by child1Url through child4Url.\n             * The four children files are loaded into memory only when the user is within the specified range. Similarly, these are unloaded from memory when the user leaves this range.\n             * @var {x3dom.fields.MFString} child4Url\n             * @memberof x3dom.nodeTypes.GeoLOD\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFString(ctx, 'child4Url', []);\n            \n            /**\n             * The level of detail is switched depending upon whether the user is closer or farther than range length base units from the geospatial coordinate center.\n             * @var {x3dom.fields.SFFloat} range\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.GeoLOD\n             * @initvalue 10\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'range', 10);\n        \n            /**\n             * outputOnly field which is emitted when the level changes to another range. Event with value 0 or 1, where 0 indicates the rootNode field and 1 indicates the nodes specified by the child1Url, child2Url, child3Url, and child4Url fields.\n             * @var {x3dom.fields.SFInt32} level_changed\n             * @range [0, 1]\n             * @memberof x3dom.nodeTypes.GeoLOD\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFInt32(ctx, \"level_changed\", 0);\n\n            /**\n             *\n             * @var {x3dom.fields.SFString} referenceBindableDescription\n             * @memberof x3dom.nodeTypes.GeoLOD\n             * @initvalue []\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'referenceBindableDescription', []);\n\n            /**\n             * The geoOrigin field is used to specify a local coordinate frame for extended precision.\n             * @var {x3dom.fields.SFNode} geoOrigin\n             * @memberof x3dom.nodeTypes.GeoLOD\n             * @initvalue x3dom.nodeTypes.X3DChildNode\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFNode('geoOrigin', x3dom.nodeTypes.GeoOrigin);\n\n            /**\n             * The rootUrl and rootNode fields provide two different ways to specify the geometry of the root tile. The rootUrl field lets you specify a URL for a file that contains the geometry.\n             * @var {x3dom.fields.SFNode} rootNode\n             * @memberof x3dom.nodeTypes.GeoLOD\n             * @initvalue x3dom.nodeTypes.X3DChildNode\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFNode('rootNode', x3dom.nodeTypes.X3DChildNode);\n\n             /**\n             * The center field is a translation offset in the local coordinate system that specifies the centre of the LOD node for distance calculations. The level of detail is switched depending upon whether the user is closer or farther than range length base units from the geospatial coordinate center. The center field should be specified as described in 25.2.4 Specifying geospatial coordinates.\n             * @var {x3dom.fields.SFVec3f} center\n             * @memberof x3dom.nodeTypes.GeoLOD\n             * @initvalue 0,0,0\n             * @field x3d\n             * @instance\n            */\n            \n            this.addField_SFVec3f(ctx, \"center\", 0, 0, 0);\n            \n            // loosely based on LOD implementation\n            \n            this._eye = new x3dom.fields.SFVec3f(0, 0, 0); //from X3DLODNode\n            \n            this._x3dcenter = new x3dom.fields.SFVec3f(0, 0, 0); \n            \n            this._child1added = false;\n            this._child2added = false;\n            this._child3added = false;\n            this._child4added = false;\n            this._rootNodeLoaded = true;\n            this._childUrlNodes = new x3dom.fields.MFNode(x3dom.nodeTypes.X3DChildNode);\n        \n            this._lastRangePos = -1;\n        },\n        {\n            collectDrawableObjects: function(transform, drawableCollection, singlePath, invalidateCache, planeMask, clipPlanes)\n                {\n                if (singlePath && (this._parentNodes.length > 1))\n                    singlePath = false;\n                if (singlePath && (invalidateCache = invalidateCache || this.cacheInvalid()))\n                    this.invalidateCache();\n                planeMask = drawableCollection.cull(transform, this.graphState(), singlePath, planeMask);\n                if (planeMask <= 0) {\n                    return;\n                    }\n                // at the moment, no caching here as children may change every frame\n                singlePath = false;\n                this.visitChildren(transform, drawableCollection, singlePath, invalidateCache, planeMask, clipPlanes);\n                },\n                \n            visitChildren: function(transform, drawableCollection, singlePath, invalidateCache, planeMask, clipPlanes)\n                {\n                var i=0, n=0, cnodes, cnode;\n                var mat_view = drawableCollection.viewMatrix;\n                var center = new x3dom.fields.SFVec3f(0, 0, 0); // eye\n                center = mat_view.inverse().multMatrixPnt(center);\n                //transform eye point to the LOD node's local coordinate system\n                this._eye = transform.inverse().multMatrixPnt(center);\n                var len = this._x3dcenter.subtract(this._eye).length();\n                \n                //TODO: preload when close = 0.9 * range\n                //- just load but do not add to drawables\n                //- then at range just add to drawable\n                //TODO: unload inlines if out of range and after (configurable) timeout (1 minute?)\n                // - loaded = false and childurlnodes = null, childurlnodes = new mfnode should suffice ?\n                \n                if (len > this._vf.range) {\n                    \n                    i = 0;\n                    if(!this._rootNodeLoaded) {\n                        this._rootNodeLoaded = true;\n                    }\n                    //rootNode already has rootUrl node if empty, see nodeChanged()\n                    cnodes = this._cf.rootNode.nodes;\n                }\n                \n                else {\n                    \n                    i = 1;\n                    if (!this._child1added) {\n                        this._child1added = true;\n                        this.addInlineChild(this._vf.child1Url);\n                    }\n                    if (!this._child2added) {\n                        this._child2added = true;\n                        this.addInlineChild(this._vf.child2Url);\n                    }\n                    if (!this._child3added) {\n                        this._child3added = true;\n                        this.addInlineChild(this._vf.child3Url);\n                    }\n                    if (!this._child4added) {\n                        this._child4added = true;\n                        this.addInlineChild(this._vf.child4Url);\n                    }\n                    \n                    if (this._rootNodeLoaded) {\n                        this._rootNodeLoaded = false;\n                        //never null rootNode (?)\n                    }\n                    \n                    cnodes = this._childUrlNodes.nodes;\n                    \n                }\n                    \n                if (i !== this._lastRangePos) {\n                    //x3dom.debug.logInfo('Changed from '+this._lastRangePos+' th range to '+i+' th.');\n                    this.postMessage('level_changed', i);\n                }\n                    \n                this._lastRangePos = i;\n                    \n                n = cnodes.length;\n                                \n                //probably not necessary to check if there are any child nodes\n                if (n && cnodes)\n                    {\n                        var childTransform = this.transformMatrix(transform);\n                        \n                        /* not in original LOD, may work for GeoLOD as well\n                        \n                        if (x3dom.nodeTypes.ClipPlane.count > 0) {\n                            var localClipPlanes = [];\n                            for (var j = 0; j < n; j++) {\n                                if ( (cnode = this._childNodes[j]) ) {\n                                    if (x3dom.isa(cnode, x3dom.nodeTypes.ClipPlane) && cnode._vf.on && cnode._vf.enabled) {\n                                        localClipPlanes.push({plane: cnode, trafo: childTransform});\n                                    }\n                                }\n                            }\n                            clipPlanes = localClipPlanes.concat(clipPlanes);\n                        }\n                        */\n                        \n                        for (i = 0; i < n; i++) {\n                            if ( (cnode = cnodes[i]) ) {\n                            cnode.collectDrawableObjects(childTransform, drawableCollection, singlePath, invalidateCache, planeMask, clipPlanes);\n                            }\n                        }\n                    }\n                },\n            \n            addInlineChild: function(url)\n            {\n                //check if url empty\n                var inline = this.newInlineNode(url);\n                this._childUrlNodes.addLink(inline);\n            },\n            \n            newInlineNode: function(url)\n            {\n                var inline = new x3dom.nodeTypes.Inline();\n                inline._vf.url = url;\n                inline._nameSpace = this._nameSpace; // pass on nameSpace\n                //inline.initDone = false; // these need to be initialized?\n                //inline.count = 0;\n                //inline.numRetries = x3dom.nodeTypes.Inline.MaximumRetries;\n                x3dom.debug.logInfo(\"add url: \" + url);\n                inline.nodeChanged(); //is necessary and loads the inline scene\n                return inline;\n            },\n            \n            getVolume: function()\n            {\n                var vol = this._graph.volume;\n                //below may not apply for GeoLOD\n                if (!this.volumeValid() && this._vf.render)\n                {\n                    var child, childVol;\n                    // use childUrlNodes ?\n                        for (var i=0, n=this._childNodes.length; i<n; i++)\n                        {\n                        if (!(child = this._childNodes[i]) || child._vf.render !== true)\n                            continue;\n                        childVol = child.getVolume();\n                        if (childVol && childVol.isValid())\n                            vol.extendBounds(childVol.min, childVol.max);\n                        }\n                    //}\n                }\n                return vol;\n            },\n            \n            nodeChanged: function() {\n                //this._needReRender = true;\n                //do geo-conversion\n                \n                var coords = new x3dom.fields.MFVec3f();\n                coords.push(this._vf.center);\n                this._x3dcenter = x3dom.nodeTypes.GeoCoordinate.prototype.GEOtoX3D(this._vf.geoSystem,this._cf.geoOrigin, coords)[0];\n                \n                //only rootNodes are ever shapes; childUrls have their own rootNodes\n                //append rootnode field with inline rooturl if empty\n                if (!this._cf.rootNode.nodes.length) {\n                    var inline = this.newInlineNode(this._vf.rootUrl);\n                    this._cf.rootNode.addLink(inline);\n                }\n                \n                this.invalidateVolume();\n            },\n            \n            fieldChanged: function(fieldName) {\n                //this._needReRender = true;\n                if (fieldName == \"render\" || fieldName == \"range\") {\n                    this.invalidateVolume();\n                }\n                if (fieldname == \"center\") {                \n                    var coords = new x3dom.fields.MFVec3f();\n                    coords.push(this._vf.center);\n                    this._x3dcenter = x3dom.nodeTypes.GeoCoordinate.prototype.GEOtoX3D(this._vf.geoSystem,this._cf.geoOrigin, coords)[0];\n                \n                    this.invalidateVolume();\n                }\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### GeoLocation ### */\nx3dom.registerNodeType(\n    \"GeoLocation\",\n    \"Geospatial\",\n    //was X3DGroupingNode which is how the node is defined in the spec\n    defineClass(x3dom.nodeTypes.X3DTransformNode,\n        \n        /**\n         * Constructor for GeoLocation\n         * @constructs x3dom.nodeTypes.GeoLocation\n         * @x3d 3.3\n         * @component Geospatial\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DTransformNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The GeoLocation node provides the ability to geo-reference any standard X3D model.\n         * That is, to take an ordinary X3D model, contained within the children of the node, and to specify its geospatial location.\n         * This node is a grouping node that can be thought of as a Transform node.\n         * However, the GeoLocation node specifies an absolute location, not a relative one, so content developers should not nest GeoLocation nodes within each other.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.GeoLocation.superClass.call(this, ctx);\n\n\n            /**\n             * The geoSystem field is used to define the spatial reference frame.\n             * @var {x3dom.fields.MFString} geoSystem\n             * @range {[\"GD\", ...], [\"UTM\", ...], [\"GC\", ...]}\n             * @memberof x3dom.nodeTypes.GeoLocation\n             * @initvalue ['GD','WE']\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFString(ctx, 'geoSystem', ['GD', 'WE']);\n\n            /**\n             * The geometry of the nodes in children is to be specified in units of metres in X3D coordinates relative to the location specified by the geoCoords field.\n             * The geoCoords field can be used to dynamically update the geospatial location of the model.\n             * @var {x3dom.fields.SFVec3d} geoCoords\n             * @memberof x3dom.nodeTypes.GeoLocation\n             * @initvalue 0,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec3d(ctx, 'geoCoords', 0, 0, 0);\n\n            /**\n             * The geoOrigin field is used to specify a local coordinate frame for extended precision.\n             * @var {x3dom.fields.SFNode} geoOrigin\n             * @memberof x3dom.nodeTypes.GeoLocation\n             * @initvalue x3dom.nodeTypes.GeoOrigin\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFNode('geoOrigin', x3dom.nodeTypes.GeoOrigin);\n        },\n\n        {\n\t        nodeChanged: function()\n            {\n                // similar to what transform in Grouping.js does\n                var position = this._vf.geoCoords;\n                var geoSystem = this._vf.geoSystem;\n                var geoOrigin = this._cf.geoOrigin; // gets only populated if in nodeChanged()\n\n                this._trafo =  this.getGeoTransRotMat(geoSystem, geoOrigin, position);\n            },\n        \n            getGeoRotMat: function (geoSystem, positionGC)\n            {\n                //returns transformation matrix to align coordinate system with geoposition as required:\n                //2 rotations to get required orientation\n                //Up (Y) to skywards, and depth (-Z) to North\n                //1) around X to point up by\n                //angle between Z and new up plus 90\n                //(angle between Z and orig. up)\n                //2) around Z to get orig. up on longitude\n\n                var coords = new x3dom.fields.MFVec3f();\n                coords.push(positionGC);\n                var positionGD = x3dom.nodeTypes.GeoCoordinate.prototype.GCtoGD(geoSystem, coords)[0];\n                \n                var Xaxis = new  x3dom.fields.SFVec3f(1,0,0);\n                var rotlat = 180 - positionGD.y; // latitude\n                var deg2rad = Math.PI/180;\n                var rotUpQuat = x3dom.fields.Quaternion.axisAngle(Xaxis, rotlat*deg2rad);\n\n                var Zaxis = new x3dom.fields.SFVec3f(0,0,1);\n                var rotlon = 90 + positionGD.x;// 90 to get to prime meridian;\n                var rotZQuat = x3dom.fields.Quaternion.axisAngle(Zaxis, rotlon*deg2rad);\n\n                //return rotZQuat.toMatrix().mult(rotUpQuat.toMatrix();\n                return rotZQuat.multiply(rotUpQuat).toMatrix();\n\n            },\n\n            getGeoTransRotMat: function (geoSystem, geoOrigin, position)\n            {\n                // accept geocoords, return translation/rotation transform matrix\n                var coords = new x3dom.fields.MFVec3f();\n                coords.push(position);\n\n                var transformed = x3dom.nodeTypes.GeoCoordinate.prototype.GEOtoGC(geoSystem, geoOrigin, coords)[0];\n                var rotMat = this.getGeoRotMat(geoSystem, transformed);\n\n\t\t        // account for geoOrigin with and without rotateYUp\n                if (geoOrigin.node)\n                {\n                    var origin = x3dom.nodeTypes.GeoCoordinate.prototype.OriginToGC(geoOrigin);\n                    if(geoOrigin.node._vf.rotateYUp)\n                    {\n                        // inverse rotation after original rotation and offset\n      \t\t\t            // just skipping all rotations produces incorrect position\n                        var rotMatOrigin = this.getGeoRotMat(geoSystem, origin);\n                        return rotMatOrigin.inverse().mult(x3dom.fields.SFMatrix4f.translation(transformed.subtract(origin)).mult(rotMat));\n                    }\n                    //rotate, then translate; account for geoOrigin by subtracting origin from GeoLocation\n                    return x3dom.fields.SFMatrix4f.translation(transformed.subtract(origin)).mult(rotMat);\n                }\n                else\n\t\t        // no GeoOrigin: first rotate, then translate\n                {\n                    return x3dom.fields.SFMatrix4f.translation(transformed).mult(rotMat);\n                }\n            },\n\n            //mimic what transform node does\n            fieldChanged: function (fieldName)\n            {\n                if (fieldName == \"geoSystem\" || fieldName == \"geoCoords\" ||\n                    fieldName == \"geoOrigin\")\n                {\n                    var position = this._vf.geoCoords;\n                    var geoSystem = this._vf.geoSystem;\n                    var geoOrigin = this._cf.geoOrigin;\n                    this._trafo =  this.getGeoTransRotMat(geoSystem, geoOrigin, position);\n\n                    this.invalidateVolume();\n                    //this.invalidateCache();\n                }\n                else if (fieldName == \"render\") {\n                    this.invalidateVolume();\n                    //this.invalidateCache();\n                }\n            }\n            //deal with geolocation in geolocation here? behaviour is undefined in spec\n\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### GeoMetadata ### */\nx3dom.registerNodeType(\n    \"GeoMetadata\",\n    \"Geospatial\",\n    defineClass(x3dom.nodeTypes.X3DInfoNode,\n        \n        /**\n         * Constructor for GeoMetadata\n         * @constructs x3dom.nodeTypes.GeoMetadata\n         * @x3d 3.3\n         * @component Geospatial\n         * @status full\n         * @extends x3dom.nodeTypes.X3DInfoNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The GeoMetadata node supports the specification of metadata describing any number of geospatial nodes.\n         * This is similar to a WorldInfo node, but specifically for describing geospatial information.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.GeoMetadata.superClass.call(this, ctx);\n\n\n            /**\n             * The url field is used to specify a hypertext link to an external, complete metadata description.\n             * Multiple URL strings can be specified in order to provide alternative locations for the same metadata information.\n             * The summary field may be used to specify the format of the metadata in the case where this cannot be deduced easily.\n             * @var {x3dom.fields.MFString} url\n             * @memberof x3dom.nodeTypes.GeoMetadata\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFString(ctx, 'url', []);\n\n            /**\n             * The data field is used to list all of the other nodes in a scene by DEF name that reference the data described in the GeoMetadata node.\n             * The nodes in the data field are not rendered, so DEF/USE can be used in order to first describe them and then to use them in the scene graph.\n             * @var {x3dom.fields.MFNode} data\n             * @memberof x3dom.nodeTypes.GeoMetadata\n             * @initvalue x3dom.nodeTypes.X3DInfoNode\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFNode('data', x3dom.nodeTypes.X3DInfoNode);\n\n            /**\n             * The summary string array contains a set of keyword/value pairs, with each keyword and its subsequent value contained in a separate string; i.e., there should always be an even (or zero) number of strings.\n             * @var {x3dom.fields.MFString} summary\n             * @memberof x3dom.nodeTypes.GeoMetadata\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFString(ctx, 'summary', []);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### GeoOrigin ### */\nx3dom.registerNodeType(\n    \"GeoOrigin\",\n    \"Geospatial\",\n    defineClass(x3dom.nodeTypes.X3DNode,\n        \n        /**\n         * Constructor for GeoOrigin\n         * @constructs x3dom.nodeTypes.GeoOrigin\n         * @x3d 3.2\n         * @component Geospatial\n         * @status full\n         * @extends x3dom.nodeTypes.X3DNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The GeoOrigin node defines an absolute geospatial location and an implicit local coordinate frame against which geometry is referenced.\n         * This node is used to translate from geographical coordinates into a local Cartesian coordinate system which can be managed by the X3D browser. This node is deprecated as of X3D 3.3\n         */\n        function (ctx) {\n            x3dom.nodeTypes.GeoOrigin.superClass.call(this, ctx);\n\n\n            /**\n             * The geoSystem field is used to define the spatial reference frame.\n             * @var {x3dom.fields.MFString} geoSystem\n             * @range {[\"GD\", ...], [\"UTM\", ...], [\"GC\", ...]}\n             * @memberof x3dom.nodeTypes.GeoOrigin\n             * @initvalue ['GD','WE']\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFString(ctx, 'geoSystem', ['GD', 'WE']);\n\n            /**\n             * The geoCoords field is used to specify a local coordinate frame for extended precision.\n             * @var {x3dom.fields.SFVec3d} geoCoords\n             * @memberof x3dom.nodeTypes.GeoOrigin\n             * @initvalue 0,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec3d(ctx, 'geoCoords', 0, 0, 0);\n\n            /**\n             * The rotateYUp field is used to specify whether coordinates of nodes that use this GeoOrigin are to be rotated such that their up direction is aligned with the X3D Y axis.\n             * The default behavior is to not perform this operation.\n             * @var {x3dom.fields.SFBool} rotateYUp\n             * @memberof x3dom.nodeTypes.GeoOrigin\n             * @initvalue false\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'rotateYUp', false);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### GeoPositionInterpolator ### */\nx3dom.registerNodeType(\n    \"GeoPositionInterpolator\",\n    \"Geospatial\",\n    defineClass(x3dom.nodeTypes.X3DInterpolatorNode,\n        \n        /**\n         * Constructor for GeoPositionInterpolator\n         * @constructs x3dom.nodeTypes.GeoPositionInterpolator\n         * @x3d 3.3\n         * @component Geospatial\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DInterpolatorNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The GeoPositionInterpolator node provides an interpolator capability where key values are specified in geographic coordinates and the interpolation is performed within the specified spatial reference frame.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.GeoPositionInterpolator.superClass.call(this, ctx);\n\n\n            /**\n             * The geoSystem field is used to define the spatial reference frame.\n             * @var {x3dom.fields.MFString} geoSystem\n             * @range {[\"GD\", ...], [\"UTM\", ...], [\"GC\", ...]}\n             * @memberof x3dom.nodeTypes.GeoPositionInterpolator\n             * @initvalue ['GD','WE']\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFString(ctx, 'geoSystem', ['GD', 'WE']);\n\n            /**\n             * The keyValue array is used to contain the actual coordinates and should be provided in a format consistent with that specified for the particular geoSystem.\n             * @var {x3dom.fields.MFVec3d} keyValue\n             * @memberof x3dom.nodeTypes.GeoPositionInterpolator\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFVec3f(ctx, 'keyValue', []);\n\n            /**\n             * The geoOrigin field is used to specify a local coordinate frame for extended precision.\n             * @var {x3dom.fields.SFNode} geoOrigin\n             * @memberof x3dom.nodeTypes.GeoPositionInterpolator\n             * @initvalue x3dom.nodeTypes.X3DInterpolatorNode\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFNode('geoOrigin', x3dom.nodeTypes.GeoOrigin);\n            \n            /**\n             * The onGreatCircle field is used to specify whether coordinates will be interpolated along a great circle path.\n             * The default behavior is to not perform this operation for performance and compatibility.\n             * @var {x3dom.fields.SFBool} onGreatCircle\n             * @memberof x3dom.nodeTypes.GeoPositionInterpolator\n             * @initvalue false\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'onGreatCircle', false);\n            \n            /*\n             * original simply does linear interpolation, then converts to geocentric for value_changed\n             */             \n        },\n        {\n            // adapted from X3DInterpolator.js\n            \n            // we need our own key and keyValue, uses hint for larger arrays and returns also found index\n            linearInterpHintKeyValue: function (time, keyHint, key, keyValue, interp) {\n                // add guess as input where to find time; should be close to index of last time?\n                // do wraparound search in both directions since interpolation often goes back\n                var keylength = key.length;\n                \n                if (time <= key[0])\n                    return [0, keyValue[0]];\n                \n                else if (time >= key[keylength - 1])\n                    return [keylength - 1, keyValue[keylength - 1]];\n                \n                var keyIndexStart = keyHint ;\n                var i;\n                // strictly loop only to keylength/2 but does not hurt\n                for (var ii = 0; ii < keylength - 1; ++ii) {\n                    // look forward\n                    i = (keyIndexStart + ii) % keylength;\n                    //i+1 can be outside array but undefined leads to false in check\n                    if ((key[i] < time) && (time <= key[i+1]))\n                        return [i, interp( keyValue[i], keyValue[i+1],\n                                (time - key[i]) / (key[i+1] - key[i]) )];\n                    // look backward\n                    i = (keyIndexStart - ii + keylength) % keylength; \n                    if ((key[i] < time) && (time <= key[i+1]))\n                        return [i, interp( keyValue[i], keyValue[i+1],\n                                (time - key[i]) / (key[i+1] - key[i]) )];                    \n                }\n                return [0, keyValue[0]];\n            },\n            \n            // adapted from fields.js\n            slerp: function (a, b, t) {\n                // calculate the cosine\n                // since a and b are not unit vectors here; this is the only real change\n                var cosom = a.dot(b)/(a.length()*b.length());\n                var rot1;\n            \n                /* \n                 * does not apply for geometric slerp\n                 * adjust signs if necessary\n                if (cosom < 0.0)\n                {\n                    cosom = -cosom;\n                    rot1 = b.negate();\n                }\n                else\n                */\n                {\n                    rot1 = new x3dom.fields.SFVec3f(b.x, b.y, b.z);\n                }\n            \n                // calculate interpolating coeffs\n                var scalerot0, scalerot1;\n                \n                if ((1.0 - cosom) > 0.00001)\n                {\n                    // standard case\n                    var omega = Math.acos(cosom);\n                    var sinom = Math.sin(omega);\n                    scalerot0 = Math.sin((1.0 - t) * omega) / sinom;\n                    scalerot1 = Math.sin(t * omega) / sinom;\n                }\n                else\n                {\n                    // rot0 and rot1 very close - just do linear interp.\n                    scalerot0 = 1.0 - t;\n                    scalerot1 = t;\n                }\n            \n                // build the new vector\n                return a.multiply(scalerot0).add(rot1.multiply(scalerot1));\n            },\n            \n            nodeChanged: function() {\n                // set up initial values\n                this._keyValueGC = x3dom.nodeTypes.GeoCoordinate.prototype.GEOtoGC(this._vf.geoSystem, this._cf.geoOrigin, this._vf.keyValue);\n                this._keyHint = 0;\n                // sanity check key.length vs. keyValue.length\n            },\n            \n            // adapted from PositionInterpolator.js\n            fieldChanged: function(fieldName)\n            {\n                if(fieldName === \"set_fraction\") {\n                    \n                    var value, indexValue, valueGC, valueX3D, coords ;\n                    \n                    if(this._vf.onGreatCircle) {\n                            indexValue = this.linearInterpHintKeyValue(this._vf.set_fraction, this._keyHint, this._vf.key, this._keyValueGC, x3dom.nodeTypes.GeoPositionInterpolator.prototype.slerp);\n                            this._keyHint = indexValue[0];\n                            valueGC = indexValue[1];                            \n                            coords = new x3dom.fields.MFVec3f();\n                            coords.push(valueGC);\n                            value = x3dom.nodeTypes.GeoCoordinate.prototype.GCtoGEO(this._vf.geoSystem, this._cf.geoOrigin, coords)[0];\n                    }\n                    \n                    else {\n                        indexValue = this.linearInterpHintKeyValue(this._vf.set_fraction, this._keyHint, this._vf.key, this._vf.keyValue, function (a, b, t) {\n                            return a.multiply(1.0-t).add(b.multiply(t));                        \n                        });\n                        this._keyHint = indexValue[0];\n                        value = indexValue[1];                            \n                        coords = new x3dom.fields.MFVec3f();\n                        coords.push(value);\n                        valueGC = x3dom.nodeTypes.GeoCoordinate.prototype.GEOtoGC(this._vf.geoSystem, this._cf.geoOrigin, coords)[0];\n                    }\n                    \n                    //account for GeoOrigin, eg. transform to X3D coordinates\n                    coords = new x3dom.fields.MFVec3f();\n                    coords.push(valueGC);\n                    var GCgeoSystem = new x3dom.fields.MFString();\n                    GCgeoSystem.push(\"GC\");\n                    GCgeoSystem.push(x3dom.nodeTypes.GeoCoordinate.prototype.getElipsoideCode(this._vf.geoSystem));\n                    valueX3D = x3dom.nodeTypes.GeoCoordinate.prototype.GCtoX3D(GCgeoSystem, this._cf.geoOrigin, coords)[0];\n                    \n                    this.postMessage('value_changed', valueX3D);\n                    this.postMessage('geovalue_changed', value);\n                }\n            }                \n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * (C)2015 Andreas Plesch, Waltham, MA, U.S.A.\n * Dual licensed under the MIT and GPL\n */\n\n/* ### GeoTransform ### */\nx3dom.registerNodeType(\n    \"GeoTransform\",\n    \"Geospatial\",\n    defineClass(x3dom.nodeTypes.X3DTransformNode, //should be X3DGroupingNode but more convenient\n        \n        /**\n         * Constructor for GeoTransform\n         * @constructs x3dom.nodeTypes.GeoTransform\n         * @x3d 3.3\n         * @component Geospatial\n         * @status full\n         * @extends x3dom.nodeTypes.X3DGroupingNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The GeoTransform node is a grouping node that defines a coordinate system for its children to support the translation and orientation of geometry built using GeoCoordinate nodes within the local world coordinate system.\n         * The X-Z plane of a GeoTransform coordinate system is tangent to the ellipsoid of the spatial reference frame at the location specified by the geoCenter field.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.GeoTransform.superClass.call(this, ctx);\n\n\n            /**\n             * The geoCenter field specifies, in the spatial reference frame specified by the geoSystem field, the location at which the local coordinate system is centered.\n             * @var {x3dom.fields.SFVec3d} geoCenter\n             * @memberof x3dom.nodeTypes.GeoTransform\n             * @initvalue 0,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec3d(ctx, 'geoCenter', 0, 0, 0);\n\n            /**\n             * Defines the rotation component of the transformation.\n             * @var {x3dom.fields.SFRotation} rotation\n             * @memberof x3dom.nodeTypes.GeoTransform\n             * @initvalue 0,0,1,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFRotation(ctx, 'rotation', 0, 0, 1, 0);\n\n            /**\n             * Defines the scale component of the transformation.\n             * @var {x3dom.fields.SFVec3f} scale\n             * @memberof x3dom.nodeTypes.GeoTransform\n             * @initvalue 1,1,1\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'scale', 1, 1, 1);\n\n            /**\n             * The scaleOrientation specifies a rotation of the coordinate system before the scale (to specify scales in arbitrary orientations).\n             * The scaleOrientation applies only to the scale operation.\n             * @var {x3dom.fields.SFRotation} scaleOrientation\n             * @memberof x3dom.nodeTypes.GeoTransform\n             * @initvalue 0,0,1,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFRotation(ctx, 'scaleOrientation', 0, 0, 1, 0);\n\n            /**\n             * The translation field specifies a translation to the coordinate system.\n             * @var {x3dom.fields.SFVec3f} translation\n             * @memberof x3dom.nodeTypes.GeoTransform\n             * @initvalue 0,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'translation', 0, 0, 0);\n\n            /**\n             * The geoOrigin field is used to specify a local coordinate frame for extended precision.\n             * @var {x3dom.fields.SFNode} geoOrigin\n             * @memberof x3dom.nodeTypes.GeoTransform\n             * @initvalue x3dom.nodeTypes.Transform\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFNode('geoOrigin', x3dom.nodeTypes.GeoOrigin);\n\n            /**\n             * The geoSystem field is used to define the spatial reference frame.\n             * @var {x3dom.fields.MFString} geoSystem\n             * @range {[\"GD\", ...], [\"UTM\", ...], [\"GC\", ...]}\n             * @memberof x3dom.nodeTypes.GeoTransform\n             * @initvalue ['GD','WE']\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFString(ctx, 'geoSystem', ['GD', 'WE']);\n            \n             /**\n            * The globalGeoOrigin field specifies whether a GeoOrigin should be applied to child nodes.\n            * The default is false which means that GeoOrigin nodes are expected to have been provided to child nodes.\n            * A true value means that GeoOrigin nodes are expected to have been omitted from child nodes. In this case,\n            * the GeoOrigin of the GeoTransform is applied to the child nodes as if GeoOrigin nodes had been provided to child nodes.\n            * A true value in combination with provided GeoOrigin in child nodes leads to undefined behaviour.\n            * @var {x3dom.fields.SFBool} globalGeoOrigin\n            * @memberof x3dom.nodeTypes.GeoTransform\n            * @initvalue false\n            * @field x3dom\n            * @instance\n            */\n            this.addField_SFBool(ctx, 'globalGeoOrigin', false);\n        },\n        {\n            nodeChanged: function ()\n            {\n                this._trafo = this.getGeoTransform();\n            },\n            \n            getGeoTransform: function ()\n            {\n                // OR x OT x C x GR x T x R x SR x S x -SR x -GR x -C x -OT x -OR\n                // based on regular Transform and geoCenter defined transforms in correct order\n                // OR: GeoOrigin Rotation\n                // OT: GeoOrigin Translation\n                // GR: GeoLocation Rotation with geoCenter\n                // C: geoCenter Translation\n                // regular Transform P' = T * C * R * SR * S * -SR * -C * P\n                \n                var geoCenterRotMat, geoCenter, skipGO, scaleOrientMat, geoTransform, coords, geoCenterGC, geoSystem, geoOrigin;\n                geoSystem = this._vf.geoSystem;\n                geoOrigin = this._cf.geoOrigin;\n                geoCenter = this._vf.geoCenter;\n                skipGO = this._vf.globalGeoOrigin;\n                scaleOrientMat = this._vf.scaleOrientation.toMatrix();\n                coords = new x3dom.fields.MFVec3f();\n                coords.push(geoCenter);\n                geoCenterGC = x3dom.nodeTypes.GeoCoordinate.prototype.GEOtoGC(geoSystem, geoOrigin, coords)[0];\n                geoCenterRotMat = x3dom.nodeTypes.GeoLocation.prototype.getGeoRotMat(geoSystem, geoCenterGC);\n                geoTransform = \n                    x3dom.fields.SFMatrix4f.translation(geoCenterGC).\n                    mult(geoCenterRotMat).\n                    mult(x3dom.fields.SFMatrix4f.translation(this._vf.translation)).\n                    mult(this._vf.rotation.toMatrix()).\n                    mult(scaleOrientMat).\n                    mult(x3dom.fields.SFMatrix4f.scale(this._vf.scale)).\n                    mult(scaleOrientMat.inverse()).\n                    mult(geoCenterRotMat.inverse()).\n                    mult(x3dom.fields.SFMatrix4f.translation(geoCenterGC.negate()));\n                //deal with geoOrigin by first reversing its effect, then reapplying it.\n                if(geoOrigin.node)\n                {\n                    var originGC = x3dom.nodeTypes.GeoCoordinate.prototype.OriginToGC(geoOrigin);\n                    if (!skipGO) \n                    {\n                        //undo geoOrigin translation from child node\n                        geoTransform = geoTransform.mult(x3dom.fields.SFMatrix4f.translation(originGC));\n                    }\n                    if(geoOrigin.node._vf.rotateYUp)\n                    {\n                        var rotMatOrigin = x3dom.nodeTypes.GeoLocation.prototype.getGeoRotMat(geoSystem, originGC);\n                        if (!skipGO) \n                        {    \n                            //undo GeoOrigin rotation from child node before translation\n                            geoTransform = geoTransform.mult(rotMatOrigin);\n                        }\n                    }\n                    //apply GeoOrigin translation. after geoTransform\n                    geoTransform = x3dom.fields.SFMatrix4f.translation(originGC.negate()).mult(geoTransform);\n                    if(geoOrigin.node._vf.rotateYUp)\n                    {\n                        //apply GeoOrigin rotation after translation\n                        geoTransform = rotMatOrigin.inverse().mult(geoTransform);\n                    }\n                }\n                return geoTransform;\n            },\n            \n            fieldChanged: function (fieldName)\n            {\n                if (fieldName == \"geoCenter\" || fieldName == \"translation\" ||\n                    fieldName == \"rotation\" || fieldName == \"scale\" ||\n                    fieldName == \"scaleOrientation\")\n                {\n                    this._trafo = this.getGeoTransform();\n                    \n                    this.invalidateVolume();\n                    //this.invalidateCache();\n                }\n                else if (fieldName == \"render\") {\n                    this.invalidateVolume();\n                    //this.invalidateCache();\n                }\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### GeoViewpoint ### */\nx3dom.registerNodeType(\n    \"GeoViewpoint\",\n    \"Geospatial\",\n    defineClass(x3dom.nodeTypes.X3DViewpointNode,\n        \n        /**\n         * Constructor for GeoViewpoint\n         * @constructs x3dom.nodeTypes.GeoViewpoint\n         * @x3d 3.3\n         * @component Geospatial\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DViewpointNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The GeoViewpoint node allows the specification of a viewpoint in terms of a geospatial coordinate.\n         * This node can be used wherever a Viewpoint node can be used and can be combined with Viewpoint nodes in the same scene.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.GeoViewpoint.superClass.call(this, ctx);\n\n\n            /**\n             * The geoSystem field is used to define the spatial reference frame.\n             * @var {x3dom.fields.MFString} geoSystem\n             * @range {[\"GD\", ...], [\"UTM\", ...], [\"GC\", ...]}\n             * @memberof x3dom.nodeTypes.GeoViewpoint\n             * @initvalue ['GD','WE']\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFString(ctx, 'geoSystem', ['GD', 'WE']);\n\n            /**\n             * Preferred minimum viewing angle from this viewpoint in radians.\n             * Small field of view roughly corresponds to a telephoto lens, large field of view roughly corresponds to a wide-angle lens.\n             * Hint: modifying Viewpoint distance to object may be better for zooming.\n             * Warning: fieldOfView may not be correct for different window sizes and aspect ratios.\n             * Interchange profile hint: this field may be ignored.\n             * @var {x3dom.fields.SFFloat} fieldOfView\n             * @range [0, pi]\n             * @memberof x3dom.nodeTypes.GeoViewpoint\n             * @initvalue 0.785398\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'fieldOfView', 0.785398);\n\n            /**\n             * The orientation fields of the Viewpoint node specifies relative orientation to the default orientation.\n             * @var {x3dom.fields.SFRotation} orientation\n             * @memberof x3dom.nodeTypes.GeoViewpoint\n             * @initvalue 0,0,1,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFRotation(ctx, 'orientation', 0, 0, 1, 0);\n\n            /**\n             * The centerOfRotation field specifies a center about which to rotate the user's eyepoint when in EXAMINE mode.\n             * The coordinates are provided in the coordinate system specified by geoSystem.\n             * @var {x3dom.fields.SFVec3f} centerOfRotation\n             * @memberof x3dom.nodeTypes.GeoViewpoint\n             * @initvalue 0,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'centerOfRotation', 0, 0, 0);\n\n            /**\n             * The position fields of the Viewpoint node specifies a relative location in the local coordinate system.\n             * The coordinates are provided in the coordinate system specified by geoSystem. \n             * @var {x3dom.fields.SFVec3d} position\n             * @memberof x3dom.nodeTypes.GeoViewpoint\n             * @initvalue 0,0,100000\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec3d(ctx, 'position', 0, 0, 100000);\n\n            /**\n             * Enable/disable directional light that always points in the direction the user is looking.\n             * Removed in X3D V3.3. See NavigationInfo\n             * still supported but required changing default to undefined since could be already given by NavigationInfo\n             * @var {x3dom.fields.SFBool} headlight\n             * @memberof x3dom.nodeTypes.GeoViewpoint\n             * @initvalue undefined\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'headlight', undefined);\n\n            /**\n             * Specifies the navigation type.\n             * Removed in X3D V3.3. See NavigationInfo\n             * still supported but required changing default to undefined since could be already given by NavigationInfo\n             * @var {x3dom.fields.MFString} navType\n             * @memberof x3dom.nodeTypes.GeoViewpoint\n             * @initvalue undefined\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFString(ctx, 'navType', undefined);\n\n            /**\n             * The speedFactor field of the GeoViewpoint node is used as a multiplier to the elevation-based velocity that the node sets internally; i.e., this is a relative value and not an absolute speed as is the case for the NavigationInfo node.\n             * @var {x3dom.fields.SFFloat} speedFactor\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.GeoViewpoint\n             * @initvalue 1.0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'speedFactor', 1.0);\n            \n            /**\n             * Specifies the near plane.\n             * @var {x3dom.fields.SFFloat} zNear\n             * @range -1 or [0, inf]\n             * @memberof x3dom.nodeTypes.Viewpoint\n             * @initvalue -1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'zNear', -1); //0.1);\n            \n            /**\n             * Specifies the far plane.\n             * @var {x3dom.fields.SFFloat} zFar\n             * @range -1 or [0, inf]\n             * @memberof x3dom.nodeTypes.Viewpoint\n             * @initvalue -1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'zFar', -1); //100000);\n                        \n            /**\n             * Enable/disable elevation scaled speed for automatic adjustment of user movement as recommended in spec. \n             * Custom field to allow disabling for performance\n             * @var {x3dom.fields.SFBool} elevationScaling\n             * @memberof x3dom.nodeTypes.GeoViewpoint\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'elevationScaling', true);\n\n            /**\n             * The geoOrigin field is used to specify a local coordinate frame for extended precision.\n             * @var {x3dom.fields.SFNode} geoOrigin\n             * @memberof x3dom.nodeTypes.GeoViewpoint\n             * @initvalue x3dom.nodeTypes.X3DViewpointNode\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFNode('geoOrigin', x3dom.nodeTypes.GeoOrigin);\n            \n            // save centerOfRotation field for reset\n            this._geoCenterOfRotation = this._vf.centerOfRotation ;\n            this._viewMatrix = x3dom.fields.SFMatrix4f.identity(); // needs to be initialized for Inline\n        },\n        {\n            // redefine activate function to save initial speed\n            // from X3DViewpoint.js\n            activate: function (prev) {\n                var viewarea = this._nameSpace.doc._viewarea;\n                \n                if (prev) {\n                    viewarea.animateTo(this, prev._autoGen ? null : prev);\n                }\n                viewarea._needNavigationMatrixUpdate = true;\n                \n                x3dom.nodeTypes.X3DBindableNode.prototype.activate.call(this, prev);\n                \n                var navi = viewarea._scene.getNavigationInfo();\n                this._initSpeed = navi._vf.speed;\n                this._examineSpeed = navi._vf.speed;\n                this._lastSpeed = navi._vf.speed;\n                this._userSpeedFactor = 1.0;\n                this._lastNavType = navi.getType();\n                x3dom.debug.logInfo(\"initial navigation speed: \" + this._initSpeed);\n                // x3dom.debug.logInfo(this._xmlNode.hasAttribute('headlight'));\n                // set headlight and navType here if they are given (but removed from spec.)\n                // is there a way to check if fields are given in the document ? (dom has default values if not given)\n                if (this._vf.headlight !== undefined) {navi._vf.headlight = this._vf.headlight;}\n                if (this._vf.navType !== undefined) {navi._vf.navType = this._vf.navType;}\n                \n            },\n            \n            // redefine deactivate to restore initial speed\n            deactivate: function (prev) {\n                var viewarea = this._nameSpace.doc._viewarea;\n                var navi = viewarea._scene.getNavigationInfo();\n                //retain examine mode speed modifications\n                navi._vf.speed = this._examineSpeed;\n                x3dom.debug.logInfo(\"navigation speed restored to: \" + this._examineSpeed);\n                x3dom.nodeTypes.X3DBindableNode.prototype.deactivate.call(this, prev);\n                // somehow this.getViewMatrix gets called one more time after deactivate and resets speed, check there\n            },\n            \n            // redefine, otherwise in X3DBindableNode\n            nodeChanged: function() {\n                \n                this._stack = this._nameSpace.doc._bindableBag.addBindable(this);\n                \n                // for local use\n                this._geoOrigin = this._cf.geoOrigin;\n                this._geoSystem = this._vf.geoSystem;\n                this._position = this._vf.position;\n                this._orientation = this._vf.orientation;\n                \n                // needs to be here because of GeoOrigin subnode\n                this._viewMatrix = this.getInitViewMatrix(this._orientation, this._geoSystem, this._geoOrigin, this._position);\n\n                // also transform centerOfRotation for initial view                \n                this._vf.centerOfRotation = this.getGeoCenterOfRotation(this._geoSystem, this._geoOrigin, this._geoCenterOfRotation);\n                \n                // borrowed from Viewpoint.js\n            \n                this._projMatrix = null;\n                this._lastAspect = 1.0;\n \n                // z-ratio: a value around 5000 would be better...\n                this._zRatio = 10000;\n                // set to -1 to trigger automatic setting\n                this._zNear = this._vf.zNear;\n                this._zFar = this._vf.zFar ;\n                \n                // special stuff...\n                this._imgPlaneHeightAtDistOne = 2.0 * Math.tan(this._vf.fieldOfView / 2.0);\n                \n            },\n            \n            // all borrowed from Viewpoint.js\n            fieldChanged: function (fieldName) {\n                if (fieldName == \"position\" || fieldName == \"orientation\") {\n                    this.resetView();\n                }\n                else if (fieldName == \"fieldOfView\" ||\n                    fieldName == \"zNear\" || fieldName == \"zFar\") {\n                    this._projMatrix = null;   // only trigger refresh\n                    this._zNear = this._vf.zNear;\n                    this._zFar = this._vf.zFar ;\n                    this._imgPlaneHeightAtDistOne = 2.0 * Math.tan(this._vf.fieldOfView / 2.0);\n                }\n                else if (fieldName.indexOf(\"bind\") >= 0) {\n                    // FIXME; call parent.fieldChanged();\n                    this.bind(this._vf.bind);\n                }\n            },\n\n            setProjectionMatrix: function(matrix)\n            {\n                this._projMatrix = matrix;\n            },\n\n            getCenterOfRotation: function() {\n                // is already transformed to GC\n                // return is expected in world coords.\n                return this.getCurrentTransform().multMatrixPnt(this._vf.centerOfRotation);\n            },\n            \n            getGeoCenterOfRotation: function(geoSystem, geoOrigin, geoCenterOfRotation) {\n                var coords = new x3dom.fields.MFVec3f();\n                coords.push(geoCenterOfRotation);\n                var transformed = x3dom.nodeTypes.GeoCoordinate.prototype.GEOtoX3D(geoSystem, geoOrigin, coords);\n                return transformed[0];\n            },\n            \n            isExamineMode: function(navType) {\n                return (navType == 'examine' || navType == 'turntable' || navType == 'lookaround' || navType == 'lookat');\n            },\n            \n            getViewMatrix: function() {\n                // called a lot from viewarea.js; (ab)use for updating elevation scaled speed\n                // do only if elevationScaling is enabled\n                // skip frames for performance ? do only every 0.1s or so ?\n                // gets called once even after being deactivated\n                if (this._vf.isActive && this._vf.elevationScaling) {\n                    var viewarea = this._nameSpace.doc._viewarea;\n                    var navi = viewarea._scene.getNavigationInfo();\n                    var navType = navi.getType();\n                    // manage examine mode: do not use elevation scaled speed and keep own speed\n                    if (this.isExamineMode(navType)) {\n                        if (!this.isExamineMode(this._lastNavType)) {\n                            navi._vf.speed = this._examineSpeed;\n                        }\n                        this._lastNavType = navType;\n                    }\n                    else {\n                        if (this.isExamineMode(this._lastNavType)) {\n                            this._examineSpeed = navi._vf.speed;\n                            x3dom.debug.logInfo(\"back from examine mode, resume speed: \" + this._lastSpeed);\n                            navi._vf.speed = this._lastSpeed;\n                        }\n                        this._lastNavType = navType;\n                        // check if speed was modified interactively\n                        if (navi._vf.speed != this._lastSpeed) {\n                            this._userSpeedFactor *= navi._vf.speed / this._lastSpeed;\n                            x3dom.debug.logInfo(\"interactive speed factor changed: \" + this._userSpeedFactor);\n                        }\n                        \n                        // get elevation above ground\n                        // current position in x3d \n                        // borrowed from webgl_gfx.js\n                        var viewtrafo = viewarea._scene.getViewpoint().getCurrentTransform();\n                        viewtrafo = viewtrafo.inverse().mult(this._viewMatrix);\n                        var position = viewtrafo.inverse().e3();\n                        \n                        var geoOrigin = this._geoOrigin;\n                        var geoSystem = this._geoSystem;\n                        // assume GC\n                        var positionGC = position;\n                        \n                        if (geoOrigin.node) {\n                            var origin = x3dom.nodeTypes.GeoCoordinate.prototype.OriginToGC(geoOrigin);\n                            // first rotate if requested \n                            if(geoOrigin.node._vf.rotateYUp) {\n                                // rotation is GeoLocation rotation\n                                var rotmat = x3dom.nodeTypes.GeoLocation.prototype.getGeoRotMat(geoSystem, origin);\n                                positionGC = rotmat.multMatrixPnt(position);\n                                }\n                            // then translate\n                            positionGC = positionGC.add(origin);\n                        }\n                        \n                        // x3dom.debug.logInfo(\"viewpoint position \" + positionGC);\n                        \n                        var coords = new x3dom.fields.MFVec3f();\n                        coords.push(positionGC);\n                        // could be a bit optimized since geoSystem does not change\n                        // eg., move initial settings of GCtoGD outside \n                        var positionGD = x3dom.nodeTypes.GeoCoordinate.prototype.GCtoGD(geoSystem, coords)[0];\n                        // at 10m above ground a speed of 1 sounds about right; make positive if below ground                      \n                        var elevationSpeed = Math.abs(positionGD.z/10);\n                        // keep above 1 to be able to move close to the ground\n                        elevationSpeed = elevationSpeed > 1 ? elevationSpeed : 1;\n                        navi._vf.speed = elevationSpeed * this._vf.speedFactor * this._userSpeedFactor;\n                        this._lastSpeed = navi._vf.speed;\n                    }\n                }\n                return this._viewMatrix;\n            },\n            \n            getInitViewMatrix: function(orientation, geoSystem, geoOrigin, position) {\n                // orientation needs to rotated as in GeoLocation node\n                var coords = new x3dom.fields.MFVec3f();\n                coords.push(position);\n                var positionGC = x3dom.nodeTypes.GeoCoordinate.prototype.GEOtoGC(geoSystem, geoOrigin, coords)[0];\n                // x3dom.debug.logInfo(\"GEOVIEWPOINT at GC: \" + positionGC);\n                var orientMatrix = orientation.toMatrix();\n                var rotMat = x3dom.nodeTypes.GeoLocation.prototype.getGeoRotMat(geoSystem, positionGC);\n                var rotOrient = rotMat.mult(orientMatrix);\n                // inverse for rotateYUp\n                if(geoOrigin.node) {\n                    if(geoOrigin.node._vf.rotateYUp) {\n                        var origin = x3dom.nodeTypes.GeoCoordinate.prototype.OriginToGC(geoOrigin);\n                        var rotMatOrigin = x3dom.nodeTypes.GeoLocation.prototype.getGeoRotMat(geoSystem, origin);\n                        rotOrient = rotMatOrigin.inverse().mult(rotOrient);\n                    }\n                }\n                var positionX3D = x3dom.nodeTypes.GeoCoordinate.prototype.GEOtoX3D(geoSystem, geoOrigin, coords)[0];\n                // x3dom.debug.logInfo(\"GEOVIEWPOINT at X3D: \" + positionX3D);\n                return x3dom.fields.SFMatrix4f.translation(positionX3D).mult(rotOrient).inverse();\n            },\n\n            getFieldOfView: function() {\n                return this._vf.fieldOfView;\n            },\n\n            resetView: function() {\n                this._viewMatrix = this.getInitViewMatrix(this._vf.orientation, this._vf.geoSystem, this._cf.geoOrigin, this._vf.position);\n                // also reset center of Rotation; is not done for regular viewpoint\n                this._vf.centerOfRotation = this.getGeoCenterOfRotation(this._vf.geoSystem, this._cf.geoOrigin, this._geoCenterOfRotation);\n                //Reset navigation helpers of the viewarea\n                if(this._nameSpace.doc._viewarea) {\n                    this._nameSpace.doc._viewarea.resetNavHelpers();\n                }\n            },\n\n            getNear: function() {\n                return this._zNear;\n            },\n\n            getFar: function() {\n                return this._zFar;\n            },\n\n            getImgPlaneHeightAtDistOne: function() {\n                return this._imgPlaneHeightAtDistOne;\n            },\n\n            getProjectionMatrix: function(aspect)\n            {\n                var fovy = this._vf.fieldOfView;\n\n                var zfar = this._vf.zFar ;\n                var znear = this._vf.zNear;\n\n                if (znear <= 0 || zfar <= 0)\n                {\n                    var nearScale = 0.8, farScale = 1.2;\n                    var viewarea = this._nameSpace.doc._viewarea;\n                    var scene = viewarea._scene;\n\n                    // Doesn't work if called e.g. from RenderedTexture with different sub-scene\n                    var min = x3dom.fields.SFVec3f.copy(scene._lastMin);\n                    var max = x3dom.fields.SFVec3f.copy(scene._lastMax);\n\n                    var dia = max.subtract(min);\n                    var sRad = dia.length() / 2;\n\n                    var mat = viewarea.getViewMatrix().inverse();\n                    var vp = mat.e3();\n\n                    // account for scales around the viewpoint\n                    var translation = new x3dom.fields.SFVec3f(0,0,0),\n                        scaleFactor = new x3dom.fields.SFVec3f(1,1,1);\n                    var rotation = new x3dom.fields.Quaternion(0,0,1,0),\n                        scaleOrientation = new x3dom.fields.Quaternion(0,0,1,0);\n\n                    // unfortunately, decompose is a rather expensive operation\n                    mat.getTransform(translation, rotation, scaleFactor, scaleOrientation);\n\n                    var minScal = scaleFactor.x, maxScal = scaleFactor.x;\n\n                    if (maxScal < scaleFactor.y) maxScal = scaleFactor.y;\n                    if (minScal > scaleFactor.y) minScal = scaleFactor.y;\n                    if (maxScal < scaleFactor.z) maxScal = scaleFactor.z;\n                    if (minScal > scaleFactor.z) minScal = scaleFactor.z;\n\n                    if (maxScal > 1)\n                        nearScale /= maxScal;\n                    else if (minScal > x3dom.fields.Eps && minScal < 1)\n                        farScale /= minScal;\n                    // near/far scale adaption done\n\n                    var sCenter = min.add(dia.multiply(0.5));\n                    var vDist = (vp.subtract(sCenter)).length();\n\n                    if (sRad) {\n                        if (vDist > sRad)\n                            znear = (vDist - sRad) * nearScale;  // Camera outside scene\n                        else\n                            znear = 0;                           // Camera inside scene\n\n                        zfar = (vDist + sRad) * farScale;\n                    }\n                    else {\n                        znear = 0.1;\n                        zfar = 100000;\n                    }\n\n                    var zNearLimit = zfar / this._zRatio;\n                    znear = Math.max(znear, Math.max(x3dom.fields.Eps, zNearLimit));\n                    if (zfar > this._vf.zNear && this._vf.zNear > 0)\n                        znear = this._vf.zNear;\n                    if (this._vf.zFar > znear)\n                        zfar = this._vf.zFar;\n                    if (zfar <= znear)\n                        zfar = znear + 1;\n                    //x3dom.debug.logInfo(\"near: \" + znear + \" -> far:\" + zfar);\n                }\n\n                if (this._projMatrix == null)\n                {\n                    this._projMatrix = x3dom.fields.SFMatrix4f.perspective(fovy, aspect, znear, zfar);\n                }\n                else if (this._zNear != znear || this._zFar != zfar)\n                {\n                    var div = znear - zfar;\n                    this._projMatrix._22 = (znear + zfar) / div;\n                    this._projMatrix._23 = 2 * znear * zfar / div;\n                }\n                else if (this._lastAspect != aspect)\n                {\n                    this._projMatrix._00 = (1 / Math.tan(fovy / 2)) / aspect;\n                    this._lastAspect = aspect;\n                }\n\n                // also needed for being able to ask for near and far\n                this._zNear = znear;\n                this._zFar = zfar;\n\n                return this._projMatrix;\n            }\n        }\n    )\n);\n\n/*\n * Copyrigth (C) 2014 TOSHIBA\n * Dual licensed under the MIT and GPL licenses.\n *\n * Based on code originally provided by\n * http://www.x3dom.org\n *\n */\n\n/* ### ScreenGroup ### */\nx3dom.registerNodeType(\n    \"ScreenGroup\",\n    \"Layout\",\n    defineClass(x3dom.nodeTypes.X3DGroupingNode,\n\n        /**\n         * Constructor for ScreenGroup\n         * N.B. Screengroup is not meant to work with any viewpoint other than\n         * a regular, perspective viewpoint.\n         * @constructs x3dom.nodeTypes.ScreenGroup\n         * @x3d 3.3\n         * @component Layout\n         * @author armand.girier@toshiba.co.jp\n         * @extends x3dom.nodeTypes.X3DGroupingNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc Add a class description here.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.ScreenGroup.superClass.call(this, ctx);\n        },\n        {\n            collectDrawableObjects: function (transform, drawableCollection, singlePath, invalidateCache, planeMask, clipPlanes)\n            {\n\n                // This is taken \"as is\" from Billboard\n\n                if (singlePath && (this._parentNodes.length > 1))\n                    singlePath = false;\n\n                if (singlePath && (invalidateCache = invalidateCache || this.cacheInvalid()))\n                    this.invalidateCache();\n\n                planeMask = drawableCollection.cull(transform, this.graphState(), singlePath, planeMask);\n                if (planeMask < 0) {\n                    return;\n                }\n\n                // no caching later on as transform changes almost every frame anyway\n                singlePath = false;\n\n  // End of code borrowed from Billboard, Screengroup's scale computing starts\n  // here.\n\n  // Computes the scaling ratio applied to an object depending on its distance\n  // to the camera. A dot　product is performed between said distance and the\n  // camera direction, since it is the relevant value to compute the perspective\n  // scale.\n  // All positions and directions are converted to the camera's coordinates.\n\n                var doc,        // The current X3D document.\n                    vp,         // The current viewpoint.\n                    minus_one,  // (0, 0, -1), original view direction.\n                    zero,       // (0, 0, 0), local position of the screengroup and camera.\n                    viewport_height,\n                    one_to_one_pixel_depth, //The depth at which an object of size S looks S pixels big.\n                    view_transform,\n                    view_direction,\n                    model_transform,\n                    camera_position,\n                    screengroup_position,\n                    viewpoint_to_screengroup,\n                    ratio,      // The scaling ratio to make the screen group size in pixels.\n                    scale_matrix; // The matrix for the scaling.\n\n\n                doc = this._nameSpace.doc;\n                vp = doc._scene.getViewpoint();\n\n                viewport_height = doc._x3dElem.clientHeight;\n                one_to_one_pixel_depth = viewport_height / vp.getImgPlaneHeightAtDistOne();\n\n                minus_one = new x3dom.fields.SFVec3f(0, 0, -1.0);\n                zero = new x3dom.fields.SFVec3f(0, 0, 0);\n\n                view_transform = drawableCollection.viewMatrix;\n                model_transform = transform;\n\n                view_direction = minus_one; // In camera's coordinates\n\n                camera_position = zero; // In camera's coordinates\n\n                screengroup_position = view_transform.multMatrixPnt(\n                  model_transform.multMatrixPnt(zero)\n                ); // In camera's coordinates\n\n\n                viewpoint_to_screengroup = screengroup_position.subtract(camera_position);\n\n                ratio = view_direction.dot(viewpoint_to_screengroup) / one_to_one_pixel_depth;\n\n                scale_matrix = x3dom.fields.SFMatrix4f.scale(new x3dom.fields.SFVec3f(ratio, ratio, ratio));\n                var childTransform = this.transformMatrix(model_transform.mult(scale_matrix));\n\n\n                for (var i=0, i_n=this._childNodes.length; i<i_n; i++)\n                {\n                    var cnode = this._childNodes[i];\n                    if (cnode) {\n                        cnode.collectDrawableObjects(childTransform, drawableCollection, singlePath, invalidateCache, planeMask, clipPlanes);\n                    }\n                }\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n */\n\n/* ### X3DPlanarGeometryNode ### */\nx3dom.registerNodeType(\n    \"X3DPlanarGeometryNode\",\n    \"Geometry2D\",\n    defineClass(x3dom.nodeTypes.X3DGeometryNode,\n        \n        /**\n         * Constructor for X3DPlanarGeometryNode\n         * @constructs x3dom.nodeTypes.X3DPlanarGeometryNode\n         * @x3d x.x\n         * @component Geometry2D\n         * @extends x3dom.nodeTypes.X3DGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DPlanarGeometryNode.superClass.call(this, ctx);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n */\n\n/* ### Arc2D ### */\nx3dom.registerNodeType(\n    \"Arc2D\",\n    \"Geometry2D\",\n    defineClass(x3dom.nodeTypes.X3DPlanarGeometryNode,\n        \n        /**\n         * Constructor for Arc2D\n         * @constructs x3dom.nodeTypes.Arc2D\n         * @x3d 3.3\n         * @component Geometry2D\n         * @status full\n         * @extends x3dom.nodeTypes.X3DPlanarGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The Arc node specifies a linear circular arc whose center is at (0,0) and whose angles are\n         *  measured starting at the positive x-axis and sweeping towards the positive y-axis.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Arc2D.superClass.call(this, ctx);\n\n\n            /**\n             * The radius field specifies the radius of the circle of which the arc is a portion.\n             * @var {x3dom.fields.SFFloat} radius\n             * @memberof x3dom.nodeTypes.Arc2D\n             * @initvalue 1\n             * @range (0, inf)\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'radius', 1);\n\n            /**\n             * The arc extends from the startAngle counterclockwise to the endAngle.\n             * @var {x3dom.fields.SFFloat} startAngle\n             * @memberof x3dom.nodeTypes.Arc2D\n             * @initvalue 0\n             * @range [-2 pi, 2pi]\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'startAngle', 0);\n\n            /**\n             * The arc extends from the startAngle counterclockwise to the endAngle.\n             * @var {x3dom.fields.SFFloat} endAngle\n             * @memberof x3dom.nodeTypes.Arc2D\n             * @initvalue 1.570796\n             * @range [-2 pi, 2pi]\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'endAngle', 1.570796);\n\n            /**\n             * Number of lines into which the arc is subdivided\n             * @var {x3dom.fields.SFFloat} subdivision\n             * @memberof x3dom.nodeTypes.Arc2D\n             * @initvalue 32\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'subdivision', 32);\n\n            this._mesh._primType = 'LINES';\n\n            var r = this._vf.radius;\n            var start = this._vf.startAngle;\n            var end = this._vf.endAngle;\n\n            // The following code ensures that:\n            // 1. 0 <= startAngle < 2*Pi\n            // 2. startAngle < endAngle\n            // 3. endAngle - startAngle <= 2*Pi\n            var Pi2 = Math.PI * 2.0;\n            start -= Math.floor(start / Pi2) * Pi2;\n            end -= Math.floor(end / Pi2) * Pi2;\n            if (end <= start)\n                end += Pi2;\n\n            var geoCacheID = 'Arc2D_' + r + start + end;\n\n            if (this._vf.useGeoCache && x3dom.geoCache[geoCacheID] !== undefined) {\n                //x3dom.debug.logInfo(\"Using Arc2D from Cache\");\n                this._mesh = x3dom.geoCache[geoCacheID];\n            } else {\n\n                var anzahl = this._vf.subdivision;\n                var t = (end - start) / anzahl;\n                var theta = start;\n\n                for (var i = 0; i <= anzahl + 1; i++) {\n                    var x = Math.cos(theta) * r;\n                    var y = Math.sin(theta) * r;\n\n                    this._mesh._positions[0].push(x);\n                    this._mesh._positions[0].push(y);\n                    this._mesh._positions[0].push(0.0);\n                    theta += t;\n                }\n\n                for (var j = 0; j < anzahl; j++) {\n                    this._mesh._indices[0].push(j);\n                    this._mesh._indices[0].push(j + 1);\n                }\n\n                this._mesh._invalidate = true;\n                this._mesh._numFaces = this._mesh._indices[0].length / 2;\n                this._mesh._numCoords = this._mesh._positions[0].length / 3;\n\n                x3dom.geoCache[geoCacheID] = this._mesh;\n            }\n        \n        },\n        {\n            fieldChanged: function (fieldName) {\n                if (fieldName == \"radius\" || fieldName == \"subdivision\" ||\n                    fieldName == \"startAngle\" || fieldName == \"endAngle\") {\n                    this._mesh._positions[0] = [];\n                    this._mesh._indices[0] = [];\n\n                    var r = this._vf.radius;\n                    var start = this._vf.startAngle;\n                    var end = this._vf.endAngle;\n                    var anzahl = this._vf.subdivision;\n\n                    var Pi2 = Math.PI * 2.0;\n                    start -= Math.floor(start / Pi2) * Pi2;\n                    end -= Math.floor(end / Pi2) * Pi2;\n                    if (end <= start)\n                        end += Pi2;\n\n                    var t = (end - start) / anzahl;\n                    var theta = start;\n\n                    for (var i = 0; i <= anzahl + 1; i++) {\n                        var x = Math.cos(theta) * r;\n                        var y = Math.sin(theta) * r;\n\n                        this._mesh._positions[0].push(x);\n                        this._mesh._positions[0].push(y);\n                        this._mesh._positions[0].push(0.0);\n                        theta += t;\n                    }\n\n                    for (var j = 0; j < anzahl; j++) {\n                        this._mesh._indices[0].push(j);\n                        this._mesh._indices[0].push(j + 1);\n                    }\n\n                    this.invalidateVolume();\n                    this._mesh._numFaces = this._mesh._indices[0].length / 2;\n                    this._mesh._numCoords = this._mesh._positions[0].length / 3;\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.positions = true;\n                        node._dirty.indexes = true;\n                        node.invalidateVolume();\n                    });\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n */\n\n/* ### ArcClose2D ### */\nx3dom.registerNodeType(\n    \"ArcClose2D\",\n    \"Geometry2D\",\n    defineClass(x3dom.nodeTypes.X3DPlanarGeometryNode,\n        \n        /**\n         * Constructor for ArcClose2D\n         * @constructs x3dom.nodeTypes.ArcClose2D\n         * @x3d 3.3\n         * @component Geometry2D\n         * @status full\n         * @extends x3dom.nodeTypes.X3DPlanarGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The ArcClose node specifies a portion of a circle whose center is at (0,0) and whose angles are\n         *  measured starting at the positive x-axis and sweeping towards the positive y-axis.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.ArcClose2D.superClass.call(this, ctx);\n\n\n            /**\n             * The end points of the arc specified are connected as defined by the closureType field.\n             * @var {x3dom.fields.SFString} closureType\n             * @memberof x3dom.nodeTypes.ArcClose2D\n             * @initvalue \"PIE\"\n             * @range [\"PIE\" | \"CHORD\"]\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFString(ctx, 'closureType', \"PIE\");\n\n            /**\n             * The radius field specifies the radius of the circle of which the arc is a portion.\n             * @var {x3dom.fields.SFFloat} radius\n             * @memberof x3dom.nodeTypes.ArcClose2D\n             * @initvalue 1\n             * @range (0, inf)\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'radius', 1);\n\n            /**\n             * The arc extends from the startAngle counterclockwise to the endAngle.\n             * @var {x3dom.fields.SFFloat} startAngle\n             * @memberof x3dom.nodeTypes.Arc2D\n             * @initvalue 0\n             * @range [-2 pi, 2pi]\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'startAngle', 0);\n\n            /**\n             * The arc extends from the startAngle counterclockwise to the endAngle.\n             * @var {x3dom.fields.SFFloat} endAngle\n             * @memberof x3dom.nodeTypes.Arc2D\n             * @initvalue 1.570796\n             * @range [-2 pi, 2pi]\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'endAngle', 1.570796);\n\n            /**\n             * Number of lines into which the arc is subdivided\n             * @var {x3dom.fields.SFFloat} subdivision\n             * @memberof x3dom.nodeTypes.Arc2D\n             * @initvalue 32\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'subdivision', 32);\n\n            var r = this._vf.radius;\n            var start = this._vf.startAngle;\n            var end = this._vf.endAngle;\n            var anzahl = this._vf.subdivision;\n\n            // The following code ensures that:\n            // 1. 0 <= startAngle < 2*Pi\n            // 2. startAngle < endAngle\n            // 3. endAngle - startAngle <= 2*Pi\n            var Pi2 = Math.PI * 2.0;\n            start -= Math.floor(start / Pi2) * Pi2;\n            end -= Math.floor(end / Pi2) * Pi2;\n            if (end <= start)\n                end += Pi2;\n\n            var geoCacheID = 'ArcClose2D_' + r + start + end + this._vf.closureType;\n\n            if (this._vf.useGeoCache && x3dom.geoCache[geoCacheID] !== undefined) {\n                //x3dom.debug.logInfo(\"Using ArcClose2D from Cache\");\n                this._mesh = x3dom.geoCache[geoCacheID];\n            } else {\n                var t = (end - start) / anzahl;\n                var theta = start;\n\n                if (this._vf.closureType.toUpperCase() == 'PIE') {\n\n                    this._mesh._positions[0].push(0.0);\n                    this._mesh._positions[0].push(0.0);\n                    this._mesh._positions[0].push(0.0);\n\n                    this._mesh._normals[0].push(0);\n                    this._mesh._normals[0].push(0);\n                    this._mesh._normals[0].push(1);\n\n                    this._mesh._texCoords[0].push(0.5);\n                    this._mesh._texCoords[0].push(0.5);\n\n                    for (var i = 0; i <= anzahl; i++) {\n                        var x = Math.cos(theta) * r;\n                        var y = Math.sin(theta) * r;\n\n                        this._mesh._positions[0].push(x);\n                        this._mesh._positions[0].push(y);\n                        this._mesh._positions[0].push(0.0);\n\n                        this._mesh._normals[0].push(0);\n                        this._mesh._normals[0].push(0);\n                        this._mesh._normals[0].push(1);\n\n                        this._mesh._texCoords[0].push((x + r) / (2 * r));\n                        this._mesh._texCoords[0].push((y + r) / (2 * r));\n\n                        theta += t;\n                    }\n\n                    for (var j = 1; j <= anzahl; j++) {\n                        this._mesh._indices[0].push(j + 1);\n                        this._mesh._indices[0].push(0);\n                        this._mesh._indices[0].push(j);\n                    }\n\n                } else {    // \"CHORD\"\n                    for (var i = 0; i <= anzahl; i++) {\n                        var x = Math.cos(theta) * r;\n                        var y = Math.sin(theta) * r;\n\n                        this._mesh._positions[0].push(x);\n                        this._mesh._positions[0].push(y);\n                        this._mesh._positions[0].push(0.0);\n\n                        this._mesh._normals[0].push(0);\n                        this._mesh._normals[0].push(0);\n                        this._mesh._normals[0].push(1);\n\n                        this._mesh._texCoords[0].push((x + r) / (2 * r));\n                        this._mesh._texCoords[0].push((y + r) / (2 * r));\n\n                        theta += t;\n                    }\n\n                    var x = (this._mesh._positions[0][0] + this._mesh._positions[0][this._mesh._positions[0].length - 3]) / 2;\n                    var y = (this._mesh._positions[0][1] + this._mesh._positions[0][this._mesh._positions[0].length - 2]) / 2;\n\n                    this._mesh._positions[0].push(x);\n                    this._mesh._positions[0].push(y);\n                    this._mesh._positions[0].push(0.0);\n\n                    this._mesh._normals[0].push(0);\n                    this._mesh._normals[0].push(0);\n                    this._mesh._normals[0].push(1);\n\n                    this._mesh._texCoords[0].push((x + r) / (2 * r));\n                    this._mesh._texCoords[0].push((y + r) / (2 * r));\n\n                    for (var j = 0; j < anzahl; j++) {\n                        this._mesh._indices[0].push(j + 1);\n                        this._mesh._indices[0].push(anzahl + 1);\n                        this._mesh._indices[0].push(j);\n                    }\n                }\n\n                this._mesh._numTexComponents = 2;\n                this._mesh._invalidate = true;\n                this._mesh._numFaces = this._mesh._indices[0].length / 2;\n                this._mesh._numCoords = this._mesh._positions[0].length / 3;\n\n                x3dom.geoCache[geoCacheID] = this._mesh;\n            }\n        \n        },\n        {\n            fieldChanged: function (fieldName) {\n                var r = this._vf.radius;\n                var start = this._vf.startAngle;\n                var end = this._vf.endAngle;\n                var anzahl = this._vf.subdivision;\n\n                var Pi2 = Math.PI * 2.0;\n                start -= Math.floor(start / Pi2) * Pi2;\n                end -= Math.floor(end / Pi2) * Pi2;\n                if (end <= start)\n                    end += Pi2;\n\n                var t = (end - start) / anzahl;\n                var theta = start;\n\n                if (fieldName === \"radius\") {\n                    this._mesh._positions[0] = [];\n\n                    if (this._vf.closureType.toUpperCase() == 'PIE') {\n\n                        this._mesh._positions[0].push(0.0);\n                        this._mesh._positions[0].push(0.0);\n                        this._mesh._positions[0].push(0.0);\n\n                        for (var i = 0; i <= anzahl; i++) {\n                            var x = Math.cos(theta) * r;\n                            var y = Math.sin(theta) * r;\n\n                            this._mesh._positions[0].push(x);\n                            this._mesh._positions[0].push(y);\n                            this._mesh._positions[0].push(0.0);\n\n                            theta += t;\n                        }\n                    } else {\n                        for (var i = 0; i <= anzahl; i++) {\n                            var x = Math.cos(theta) * r;\n                            var y = Math.sin(theta) * r;\n\n                            this._mesh._positions[0].push(x);\n                            this._mesh._positions[0].push(y);\n                            this._mesh._positions[0].push(0.0);\n\n                            theta += t;\n                        }\n\n                        var x = (this._mesh._positions[0][0] + this._mesh._positions[0][this._mesh._positions[0].length - 3]) / 2;\n                        var y = (this._mesh._positions[0][1] + this._mesh._positions[0][this._mesh._positions[0].length - 2]) / 2;\n\n                        this._mesh._positions[0].push(x);\n                        this._mesh._positions[0].push(y);\n                        this._mesh._positions[0].push(0.0);\n                    }\n\n                    this.invalidateVolume();\n                    this._mesh._numCoords = this._mesh._positions[0].length / 3;\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.positions = true;\n                        node.invalidateVolume();\n                    });\n\n                } else if (fieldName == \"closureType\" || fieldName == \"subdivision\" ||\n                           fieldName == \"startAngle\" || fieldName == \"endAngle\") {\n                    this._mesh._positions[0] = [];\n                    this._mesh._indices[0] = [];\n                    this._mesh._normals[0] = [];\n                    this._mesh._texCoords[0] = [];\n\n                    if (this._vf.closureType.toUpperCase() == 'PIE') {\n\n                        this._mesh._positions[0].push(0.0);\n                        this._mesh._positions[0].push(0.0);\n                        this._mesh._positions[0].push(0.0);\n\n                        this._mesh._normals[0].push(0);\n                        this._mesh._normals[0].push(0);\n                        this._mesh._normals[0].push(1);\n\n                        this._mesh._texCoords[0].push(0.5);\n                        this._mesh._texCoords[0].push(0.5);\n\n                        for (var i = 0; i <= anzahl; i++) {\n                            var x = Math.cos(theta) * r;\n                            var y = Math.sin(theta) * r;\n\n                            this._mesh._positions[0].push(x);\n                            this._mesh._positions[0].push(y);\n                            this._mesh._positions[0].push(0.0);\n\n                            this._mesh._normals[0].push(0);\n                            this._mesh._normals[0].push(0);\n                            this._mesh._normals[0].push(1);\n\n                            this._mesh._texCoords[0].push((x + r) / (2 * r));\n                            this._mesh._texCoords[0].push((y + r) / (2 * r));\n\n                            theta += t;\n                        }\n\n                        for (var j = 1; j <= anzahl; j++) {\n                            this._mesh._indices[0].push(j + 1);\n                            this._mesh._indices[0].push(0);\n                            this._mesh._indices[0].push(j);\n                        }\n\n                    } else {\n                        for (var i = 0; i <= anzahl; i++) {\n                            var x = Math.cos(theta) * r;\n                            var y = Math.sin(theta) * r;\n\n                            this._mesh._positions[0].push(x);\n                            this._mesh._positions[0].push(y);\n                            this._mesh._positions[0].push(0.0);\n\n                            this._mesh._normals[0].push(0);\n                            this._mesh._normals[0].push(0);\n                            this._mesh._normals[0].push(1);\n\n                            this._mesh._texCoords[0].push((x + r) / (2 * r));\n                            this._mesh._texCoords[0].push((y + r) / (2 * r));\n\n                            theta += t;\n                        }\n\n                        var x = (this._mesh._positions[0][0] + this._mesh._positions[0][this._mesh._positions[0].length - 3]) / 2;\n                        var y = (this._mesh._positions[0][1] + this._mesh._positions[0][this._mesh._positions[0].length - 2]) / 2;\n\n                        this._mesh._positions[0].push(x);\n                        this._mesh._positions[0].push(y);\n                        this._mesh._positions[0].push(0.0);\n\n                        this._mesh._normals[0].push(0);\n                        this._mesh._normals[0].push(0);\n                        this._mesh._normals[0].push(1);\n\n                        this._mesh._texCoords[0].push((x + r) / (2 * r));\n                        this._mesh._texCoords[0].push((y + r) / (2 * r));\n\n                        for (var j = 0; j < anzahl; j++) {\n                            this._mesh._indices[0].push(j + 1);\n                            this._mesh._indices[0].push(anzahl + 1);\n                            this._mesh._indices[0].push(j);\n                        }\n                    }\n\n                    this._mesh._numTexComponents = 2;\n                    this.invalidateVolume();\n                    this._mesh._numFaces = this._mesh._indices[0].length / 2;\n                    this._mesh._numCoords = this._mesh._positions[0].length / 3;\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node.setAllDirty();\n                    });\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n */\n\n/* ### Circle2D ### */\nx3dom.registerNodeType(\n    \"Circle2D\",\n    \"Geometry2D\",\n    defineClass(x3dom.nodeTypes.X3DPlanarGeometryNode,\n        \n        /**\n         * Constructor for Circle2D\n         * @constructs x3dom.nodeTypes.Circle2D\n         * @x3d 3.3\n         * @component Geometry2D\n         * @status full\n         * @extends x3dom.nodeTypes.X3DPlanarGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The Circle2D node specifies a circle centred at (0,0) in the local 2D coordinate system.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Circle2D.superClass.call(this, ctx);\n\n\n            /**\n             * The radius field specifies the radius of the Circle2D. The value of radius shall be greater than zero.\n             * @var {x3dom.fields.SFFloat} radius\n             * @memberof x3dom.nodeTypes.Circle2D\n             * @initvalue 1\n             * @range (0, inf)\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'radius', 1);\n\n            /**\n             * Number of segments the circle is composed of\n             * @var {x3dom.fields.SFFloat} subdivision\n             * @memberof x3dom.nodeTypes.Arc2D\n             * @initvalue 32\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'subdivision', 32);\n\n            this._mesh._primType = 'LINES';\n\n            var r = this._vf.radius;\n\n            var geoCacheID = 'Circle2D_' + r;\n\n            if (this._vf.useGeoCache && x3dom.geoCache[geoCacheID] !== undefined) {\n                //x3dom.debug.logInfo(\"Using Circle2D from Cache\");\n                this._mesh = x3dom.geoCache[geoCacheID];\n            } else {\n\n                var anzahl = this._vf.subdivision;\n\n                for (var i = 0; i <= anzahl; i++) {\n                    var theta = i * ((2 * Math.PI) / anzahl);\n\n                    var x = Math.cos(theta) * r;\n                    var y = Math.sin(theta) * r;\n\n                    this._mesh._positions[0].push(x);\n                    this._mesh._positions[0].push(y);\n                    this._mesh._positions[0].push(0.0);\n                }\n\n\n                for (i = 0; i < anzahl; i++) {\n                    this._mesh._indices[0].push(i);\n                    if ((i + 1) == anzahl) {\n                        this._mesh._indices[0].push(0);\n                    } else {\n                        this._mesh._indices[0].push(i + 1);\n                    }\n                }\n\n                this._mesh._invalidate = true;\n                this._mesh._numFaces = this._mesh._indices[0].length / 2;\n                this._mesh._numCoords = this._mesh._positions[0].length / 3;\n\n                x3dom.geoCache[geoCacheID] = this._mesh;\n            }\n        \n        },\n        {\n            fieldChanged: function (fieldName) {\n                if (fieldName == \"radius\" || fieldName == \"subdivision\") {\n                    var r = this._vf.radius;\n                    var anzahl = this._vf.subdivision;\n\n                    this._mesh._positions[0] = [];\n                    this._mesh._indices[0] = [];\n\n                    for (var i = 0; i <= anzahl; i++) {\n                        var theta = i * ((2 * Math.PI) / anzahl);\n\n                        var x = Math.cos(theta) * r;\n                        var y = Math.sin(theta) * r;\n\n                        this._mesh._positions[0].push(x);\n                        this._mesh._positions[0].push(y);\n                        this._mesh._positions[0].push(0.0);\n                    }\n\n                    for (i = 0; i < anzahl; i++) {\n                        this._mesh._indices[0].push(i);\n                        if ((i + 1) == anzahl) {\n                            this._mesh._indices[0].push(0);\n                        } else {\n                            this._mesh._indices[0].push(i + 1);\n                        }\n                    }\n\n                    this.invalidateVolume();\n                    this._mesh._numFaces = this._mesh._indices[0].length / 2;\n                    this._mesh._numCoords = this._mesh._positions[0].length / 3;\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.positions = true;\n                        node._dirty.indexes = true;\n                        node.invalidateVolume();\n                    });\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n */\n\n/* ### Disk2D ### */\nx3dom.registerNodeType(\n    \"Disk2D\",\n    \"Geometry2D\",\n    defineClass(x3dom.nodeTypes.X3DPlanarGeometryNode,\n        \n        /**\n         * Constructor for Disk2D\n         * @constructs x3dom.nodeTypes.Disk2D\n         * @x3d 3.3\n         * @component Geometry2D\n         * @status full\n         * @extends x3dom.nodeTypes.X3DPlanarGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The Disk2D node specifies a circular disk which is centred at (0, 0) in the local coordinate\n         *  system. If innerRadius is equal to outerRadius, a solid circular line shall be drawn using the current line\n         *  properties. If innerRadius is zero, the Disk2D is completely filled. Otherwise, the area within the\n         *  innerRadius forms a hole in the Disk2D.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Disk2D.superClass.call(this, ctx);\n\n\n            /**\n             * The innerRadius field specifies the inner dimension of the Disk2D. The value of innerRadius shall be\n             *  greater than or equal to zero and less than or equal to outerRadius.\n             * @var {x3dom.fields.SFFloat} innerRadius\n             * @memberof x3dom.nodeTypes.Disk2D\n             * @initvalue 0\n             * @range [0, inf)\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'innerRadius', 0);\n\n            /**\n             * The outerRadius field specifies the radius of the outer dimension of the Disk2D. The value of outerRadius\n             *  shall be greater than zero.\n             * @var {x3dom.fields.SFFloat} outerRadius\n             * @memberof x3dom.nodeTypes.Disk2D\n             * @initvalue 1\n             * @range [0, inf)\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'outerRadius', 1);\n\n            /**\n             * Number of segments of the disc\n             * @var {x3dom.fields.SFFloat} subdivision\n             * @memberof x3dom.nodeTypes.Arc2D\n             * @initvalue 32\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'subdivision', 32);\n\n            var ir = this._vf.innerRadius;\n            var or = this._vf.outerRadius;\n\n            var geoCacheID = 'Disk2D_' + ir + or;\n\n            if (this._vf.useGeoCache && x3dom.geoCache[geoCacheID] !== undefined) {\n                //x3dom.debug.logInfo(\"Using Disk2D from Cache\");\n                this._mesh = x3dom.geoCache[geoCacheID];\n            } else {\n\n                var anzahl = this._vf.subdivision;\n                for (var i = 0; i <= anzahl; i++) {\n\n                    var theta = i * ((2 * Math.PI) / anzahl);\n\n                    var ox = Math.cos(theta) * or;\n                    var oy = Math.sin(theta) * or;\n                    var ix = Math.cos(theta) * ir;\n                    var iy = Math.sin(theta) * ir;\n                    this._mesh._positions[0].push(ox);\n                    this._mesh._positions[0].push(oy);\n                    this._mesh._positions[0].push(0.0);\n\n                    this._mesh._normals[0].push(0);\n                    this._mesh._normals[0].push(0);\n                    this._mesh._normals[0].push(1);\n\n                    this._mesh._texCoords[0].push((ox + or) / (2 * or));\n                    this._mesh._texCoords[0].push((oy + or) / (2 * or));\n\n                    this._mesh._positions[0].push(ix);\n                    this._mesh._positions[0].push(iy);\n                    this._mesh._positions[0].push(0.0);\n\n                    this._mesh._normals[0].push(0);\n                    this._mesh._normals[0].push(0);\n                    this._mesh._normals[0].push(1);\n                    this._mesh._texCoords[0].push((ix + or) / (2 * or));\n                    this._mesh._texCoords[0].push((iy + or) / (2 * or));\n                }\n\n                for (i = 0; i < anzahl * 2; i = i + 2) {\n                    if (i == (anzahl * 2) - 2) {\n                        this._mesh._indices[0].push(i + 1);\n                        this._mesh._indices[0].push(i);\n                        this._mesh._indices[0].push(1);\n\n                        this._mesh._indices[0].push(1);\n                        this._mesh._indices[0].push(i);\n                        this._mesh._indices[0].push(0);\n                    } else {\n                        this._mesh._indices[0].push(i + 1);\n                        this._mesh._indices[0].push(i);\n                        this._mesh._indices[0].push(i + 3);\n\n                        this._mesh._indices[0].push(i + 3);\n                        this._mesh._indices[0].push(i);\n                        this._mesh._indices[0].push(i + 2);\n                    }\n                }\n\n                this._mesh._numTexComponents = 2;\n                this._mesh._invalidate = true;\n                this._mesh._numFaces = this._mesh._indices[0].length / 2;\n                this._mesh._numCoords = this._mesh._positions[0].length / 3;\n\n                x3dom.geoCache[geoCacheID] = this._mesh;\n            }\n        \n        },\n        {\n            fieldChanged: function (fieldName) {\n                if (fieldName == \"innerRadius\" || fieldName == \"outerRadius\" ||\n                    fieldName == \"subdivision\") {\n                    this._mesh._positions[0] = [];\n                    this._mesh._indices[0] = [];\n                    this._mesh._normals[0] = [];\n                    this._mesh._texCoords[0] = [];\n\n                    var ir = this._vf.innerRadius;\n                    var or = this._vf.outerRadius;\n\n                    var anzahl = this._vf.subdivision;\n                    for (var i = 0; i <= anzahl; i++) {\n\n                        var theta = i * ((2 * Math.PI) / anzahl);\n\n                        var ox = Math.cos(theta) * or;\n                        var oy = Math.sin(theta) * or;\n                        var ix = Math.cos(theta) * ir;\n                        var iy = Math.sin(theta) * ir;\n                        this._mesh._positions[0].push(ox);\n                        this._mesh._positions[0].push(oy);\n                        this._mesh._positions[0].push(0.0);\n\n                        this._mesh._normals[0].push(0);\n                        this._mesh._normals[0].push(0);\n                        this._mesh._normals[0].push(1);\n\n                        this._mesh._texCoords[0].push((ox + or) / (2 * or));\n                        this._mesh._texCoords[0].push((oy + or) / (2 * or));\n\n                        this._mesh._positions[0].push(ix);\n                        this._mesh._positions[0].push(iy);\n                        this._mesh._positions[0].push(0.0);\n\n                        this._mesh._normals[0].push(0);\n                        this._mesh._normals[0].push(0);\n                        this._mesh._normals[0].push(1);\n                        this._mesh._texCoords[0].push((ix + or) / (2 * or));\n                        this._mesh._texCoords[0].push((iy + or) / (2 * or));\n                    }\n\n                    for (i = 0; i < anzahl * 2; i = i + 2) {\n                        if (i == (anzahl * 2) - 2) {\n                            this._mesh._indices[0].push(i + 1);\n                            this._mesh._indices[0].push(i);\n                            this._mesh._indices[0].push(1);\n\n                            this._mesh._indices[0].push(1);\n                            this._mesh._indices[0].push(i);\n                            this._mesh._indices[0].push(0);\n                        } else {\n                            this._mesh._indices[0].push(i + 1);\n                            this._mesh._indices[0].push(i);\n                            this._mesh._indices[0].push(i + 3);\n\n                            this._mesh._indices[0].push(i + 3);\n                            this._mesh._indices[0].push(i);\n                            this._mesh._indices[0].push(i + 2);\n                        }\n                    }\n\n                    this._mesh._numTexComponents = 2;\n                    this.invalidateVolume();\n                    this._mesh._numFaces = this._mesh._indices[0].length / 3;\n                    this._mesh._numCoords = this._mesh._positions[0].length / 3;\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node.setAllDirty();\n                    });\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n */\n\n/* ### Polyline2D ### */\nx3dom.registerNodeType(\n    \"Polyline2D\",\n    \"Geometry2D\",\n    defineClass(x3dom.nodeTypes.X3DPlanarGeometryNode,\n        \n        /**\n         * Constructor for Polyline2D\n         * @constructs x3dom.nodeTypes.Polyline2D\n         * @x3d 3.3\n         * @component Geometry2D\n         * @status full\n         * @extends x3dom.nodeTypes.X3DPlanarGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The Polyline2D node specifies a series of contiguous line segments in the local 2D coordinate\n         *  system connecting the specified vertices.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Polyline2D.superClass.call(this, ctx);\n\n\n            /**\n             * The lineSegments field specifies the vertices to be connected.\n             * @var {x3dom.fields.MFVec2f} lineSegments\n             * @memberof x3dom.nodeTypes.Polyline2D\n             * @initvalue []\n             * @range (-inf, inf)\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFVec2f(ctx, 'lineSegments', []);\n\n            this._mesh._primType = 'LINES';\n\n            var x = 0, y = 0;\n            if (this._vf.lineSegments.length) {\n                x = this._vf.lineSegments[0].x;\n                y = this._vf.lineSegments[0].y;\n            }\n\n            var geoCacheID = 'Polyline2D_' + x + '-' + y;\n\n            if (this._vf.useGeoCache && x3dom.geoCache[geoCacheID] !== undefined) {\n                //x3dom.debug.logInfo(\"Using Polyline2D from Cache\");\n                this._mesh = x3dom.geoCache[geoCacheID];\n            }\n            else {\n                for (var i = 0; i < this._vf.lineSegments.length; i++) {\n                    x = this._vf.lineSegments[i].x;\n                    y = this._vf.lineSegments[i].y;\n                    this._mesh._positions[0].push(x);\n                    this._mesh._positions[0].push(y);\n                    this._mesh._positions[0].push(0.0);\n                }\n                for (var j = 0; j < this._vf.lineSegments.length - 1; j++) {\n                    this._mesh._indices[0].push(j);\n                    this._mesh._indices[0].push(j + 1);\n                }\n\n                this._mesh._invalidate = true;\n                this._mesh._numFaces = this._mesh._indices[0].length / 2;\n                this._mesh._numCoords = this._mesh._positions[0].length / 3;\n\n                x3dom.geoCache[geoCacheID] = this._mesh;\n            }\n        \n        },\n        {\n            fieldChanged: function (fieldName) {\n                if (fieldName == \"lineSegments\") {\n                    var x, y;\n                    this._mesh._positions[0] = [];\n                    this._mesh._indices[0] = [];\n                    for (var i = 0; i < this._vf.lineSegments.length; i++) {\n                        x = this._vf.lineSegments[i].x;\n                        y = this._vf.lineSegments[i].y;\n                        this._mesh._positions[0].push(x);\n                        this._mesh._positions[0].push(y);\n                        this._mesh._positions[0].push(0.0);\n                    }\n                    for (var j = 0; j < this._vf.lineSegments.length - 1; j++) {\n                        this._mesh._indices[0].push(j);\n                        this._mesh._indices[0].push(j + 1);\n                    }\n\n                    this.invalidateVolume();\n                    this._mesh._numFaces = this._mesh._indices[0].length / 2;\n                    this._mesh._numCoords = this._mesh._positions[0].length / 3;\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.positions = true;\n                        node._dirty.indexes = true;\n                        node.invalidateVolume();\n                    });\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n */\n\n/* ### Polypoint2D ### */\nx3dom.registerNodeType(\n    \"Polypoint2D\",\n    \"Geometry2D\",\n    defineClass(x3dom.nodeTypes.X3DPlanarGeometryNode,\n        \n        /**\n         * Constructor for Polypoint2D\n         * @constructs x3dom.nodeTypes.Polypoint2D\n         * @x3d 3.3\n         * @component Geometry2D\n         * @status full\n         * @extends x3dom.nodeTypes.X3DPlanarGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The Polyline2D node specifies a set of vertices in the local 2D coordinate system at each of which\n         *  is displayed a point.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Polypoint2D.superClass.call(this, ctx);\n\n\n            /**\n             * The points field specifies the vertices to be displayed.\n             * @var {x3dom.fields.MFVec2f} point\n             * @memberof x3dom.nodeTypes.Polypoint2D\n             * @initvalue []\n             * @range (-inf, inf)\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFVec2f(ctx, 'point', []);\n\n            this._mesh._primType = 'POINTS';\n\n            var x = 0, y = 0;\n            if (this._vf.point.length) {\n                x = this._vf.point[0].x;\n                y = this._vf.point[0].y;\n            }\n\n            var geoCacheID = 'Polypoint2D_' + x + '-' + y;\n\n            if (this._vf.useGeoCache && x3dom.geoCache[geoCacheID] !== undefined) {\n                //x3dom.debug.logInfo(\"Using Polypoint2D from Cache\");\n                this._mesh = x3dom.geoCache[geoCacheID];\n            }\n            else {\n                for (var i = 0; i < this._vf.point.length; i++) {\n                    x = this._vf.point[i].x;\n                    y = this._vf.point[i].y;\n                    this._mesh._positions[0].push(x);\n                    this._mesh._positions[0].push(y);\n                    this._mesh._positions[0].push(0.0);\n                }\n\n                this._mesh._invalidate = true;\n                this._mesh._numCoords = this._mesh._positions[0].length / 3;\n\n                x3dom.geoCache[geoCacheID] = this._mesh;\n            }\n        \n        },\n        {\n            fieldChanged: function (fieldName) {\n                if (fieldName == \"point\") {\n                    this._mesh._positions[0] = [];\n                    this._mesh._indices[0] = [];\n                    for (var i = 0; i < this._vf.point.length; i++) {\n                        var x = this._vf.point[i].x;\n                        var y = this._vf.point[i].y;\n                        this._mesh._positions[0].push(x);\n                        this._mesh._positions[0].push(y);\n                        this._mesh._positions[0].push(0.0);\n                    }\n\n                    this.invalidateVolume();\n                    this._mesh._numCoords = this._mesh._positions[0].length / 3;\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.positions = true;\n                        node.invalidateVolume();\n                    });\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n */\n\n/* ### Rectangle2D ### */\nx3dom.registerNodeType(\n    \"Rectangle2D\",\n    \"Geometry2D\",\n    defineClass(x3dom.nodeTypes.X3DPlanarGeometryNode,\n        \n        /**\n         * Constructor for Rectangle2D\n         * @constructs x3dom.nodeTypes.Rectangle2D\n         * @x3d 3.3\n         * @component Geometry2D\n         * @status full\n         * @extends x3dom.nodeTypes.X3DPlanarGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The Rectangle2D node specifies a rectangle centred at (0, 0) in the current local 2D coordinate\n         *  system and aligned with the local coordinate axes. By default, the box measures 2 units in each dimension,\n         *  from -1 to +1.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Rectangle2D.superClass.call(this, ctx);\n\n\n            /**\n             * The size field specifies the extents of the box along the X-, and Y-axes respectively and each component\n             *  value shall be greater than zero.\n             * @var {x3dom.fields.SFVec2f} size\n             * @memberof x3dom.nodeTypes.Rectangle2D\n             * @initvalue 2,2\n             * @range (0, inf)\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec2f(ctx, 'size', 2, 2);\n\n            /**\n             * Number of segments of the rectangle\n             * @var {x3dom.fields.SFVec2f} subdivision\n             * @memberof x3dom.nodeTypes.Rectangle2D\n             * @initvalue 1,1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec2f(ctx, 'subdivision', 1, 1);\n\n            var sx = this._vf.size.x, sy = this._vf.size.y;\n            var partx = this._vf.subdivision.x, party = this._vf.subdivision.y;\n\n            var geoCacheID = 'Rectangle2D_' + sx + '-' + sy;\n\n            if (this._vf.useGeoCache && x3dom.geoCache[geoCacheID] !== undefined) {\n                //x3dom.debug.logInfo(\"Using Rectangle2D from Cache\");\n                this._mesh = x3dom.geoCache[geoCacheID];\n            }\n            else {\n                var xstep = sx / partx;\n                var ystep = sy / party;\n\n                sx /= 2;\n                sy /= 2;\n\n                for (var i = 0; i <= partx; i++) {\n                    for (var j = 0; j <= party; j++) {\n                        this._mesh._positions[0].push(i * xstep - sx, j * ystep - sy, 0);\n                        this._mesh._normals[0].push(0, 0, 1);\n                        this._mesh._texCoords[0].push(i / partx, j / party);\n                    }\n                }\n\n                for (var i = 1; i <= party; i++) {\n                    for (var j = 0; j < partx; j++) {\n                        this._mesh._indices[0].push((i - 1) * (partx + 1) + j + 1);\n                        this._mesh._indices[0].push((i - 1) * (partx + 1) + j);\n                        this._mesh._indices[0].push(i * (partx + 1) + j);\n\n                        this._mesh._indices[0].push((i - 1) * (partx + 1) + j + 1);\n                        this._mesh._indices[0].push(i * (partx + 1) + j);\n                        this._mesh._indices[0].push(i * (partx + 1) + j + 1);\n                    }\n                }\n\n                this._mesh._invalidate = true;\n                this._mesh._numFaces = this._mesh._indices[0].length / 3;\n                this._mesh._numCoords = this._mesh._positions[0].length / 3;\n\n                x3dom.geoCache[geoCacheID] = this._mesh;\n            }\n        \n        },\n        {\n            fieldChanged: function (fieldName) {\n                if (fieldName == \"size\") {\n                    this._mesh._positions[0] = [];\n                    var size = this._vf.size;\n                    var sx = size.x / 2;\n                    var sy = size.y / 2;\n\n                    var partx = this._vf.subdivision.x, party = this._vf.subdivision.y;\n\n                    var xstep = sx / partx;\n                    var ystep = sy / party;\n\n                    sx /= 2;\n                    sy /= 2;\n\n                    for (var i = 0; i <= partx; i++) {\n                        for (var j = 0; j <= party; j++) {\n                            this._mesh._positions[0].push(i * xstep - sx, j * ystep - sy, 0);\n                        }\n                    }\n\n                    this.invalidateVolume();\n                    this._mesh._numCoords = this._mesh._positions[0].length / 3;\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node.setAllDirty();\n                    });\n\n                } else if (fieldName == \"subdivision\") {\n                    this._mesh._positions[0] = [];\n                    this._mesh._indices[0] = [];\n                    this._mesh._normals[0] = [];\n                    this._mesh._texCoords[0] = [];\n\n                    var sx = this._vf.size.x / 2;\n                    var sy = this._vf.size.y / 2;\n\n                    var partx = this._vf.subdivision.x, party = this._vf.subdivision.y;\n                    var xstep = sx / partx;\n                    var ystep = sy / party;\n\n                    sx /= 2;\n                    sy /= 2;\n\n                    for (var i = 0; i <= partx; i++) {\n                        for (var j = 0; j <= party; j++) {\n                            this._mesh._positions[0].push(i * xstep - sx, j * ystep - sy, 0);\n                            this._mesh._normals[0].push(0, 0, 1);\n                            this._mesh._texCoords[0].push(i / partx, j / party);\n                        }\n                    }\n\n                    for (var i = 1; i <= party; i++) {\n                        for (var j = 0; j < partx; j++) {\n                            this._mesh._indices[0].push((i - 1) * (partx + 1) + j + 1);\n                            this._mesh._indices[0].push((i - 1) * (partx + 1) + j);\n                            this._mesh._indices[0].push(i * (partx + 1) + j);\n\n                            this._mesh._indices[0].push((i - 1) * (partx + 1) + j + 1);\n                            this._mesh._indices[0].push(i * (partx + 1) + j);\n                            this._mesh._indices[0].push(i * (partx + 1) + j + 1);\n                        }\n                    }\n\n                    this.invalidateVolume();\n                    this._mesh._numFaces = this._mesh._indices[0].length / 3;\n                    this._mesh._numCoords = this._mesh._positions[0].length / 3;\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node.setAllDirty();\n                    });\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n */\n\n/* ### TriangleSet2D ### */\nx3dom.registerNodeType(\n    \"TriangleSet2D\",\n    \"Geometry2D\",\n    defineClass(x3dom.nodeTypes.X3DPlanarGeometryNode,\n        \n        /**\n         * Constructor for TriangleSet2D\n         * @constructs x3dom.nodeTypes.TriangleSet2D\n         * @x3d 3.3\n         * @component Geometry2D\n         * @status full\n         * @extends x3dom.nodeTypes.X3DPlanarGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The TriangleSet2D node specifies a set of triangles in the local 2D coordinate system.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.TriangleSet2D.superClass.call(this, ctx);\n\n\n            /**\n             * The vertices field specifies the triangles to be displayed. The number of vertices provided shall be\n             *  evenly divisible by three.\n             * @var {x3dom.fields.MFVec2f} vertices\n             * @memberof x3dom.nodeTypes.TriangleSet2D\n             * @initvalue []\n             * @range (-inf, inf)\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFVec2f(ctx, 'vertices', []);\n\n            \n            var x = 0, y = 0;\n            if (this._vf.vertices.length) {\n                x = this._vf.vertices[0].x;\n                y = this._vf.vertices[0].y;\n            }\n\n            var geoCacheID = 'TriangleSet2D_' + x + '-' + y;\n\n            if (this._vf.useGeoCache && x3dom.geoCache[geoCacheID] !== undefined) {\n                //x3dom.debug.logInfo(\"Using TriangleSet2D from Cache\");\n                this._mesh = x3dom.geoCache[geoCacheID];\n            }\n            else {\n                var minx = 0, miny = 0, maxx = 0, maxy = 0;\n\n                if (this._vf.vertices.length) {\n                    minx = this._vf.vertices[0].x;\n                    miny = this._vf.vertices[0].y;\n                    maxx = this._vf.vertices[0].x;\n                    maxy = this._vf.vertices[0].y;\n                }\n\n                for (var i = 0; i < this._vf.vertices.length; i++) {\n                    if (this._vf.vertices[i].x < minx) {\n                        minx = this._vf.vertices[i].x\n                    }\n                    if (this._vf.vertices[i].y < miny) {\n                        miny = this._vf.vertices[i].y\n                    }\n                    if (this._vf.vertices[i].x > maxx) {\n                        maxx = this._vf.vertices[i].x\n                    }\n                    if (this._vf.vertices[i].y > maxy) {\n                        maxy = this._vf.vertices[i].y\n                    }\n                }\n\n                for (var i = 0; i < this._vf.vertices.length; i++) {\n                    x = this._vf.vertices[i].x;\n                    y = this._vf.vertices[i].y;\n                    this._mesh._positions[0].push(x);\n                    this._mesh._positions[0].push(y);\n                    this._mesh._positions[0].push(0.0);\n\n                    this._mesh._normals[0].push(0);\n                    this._mesh._normals[0].push(0);\n                    this._mesh._normals[0].push(1);\n\n                    this._mesh._texCoords[0].push((x - minx) / (maxx - minx));\n                    this._mesh._texCoords[0].push((y - miny) / (maxy - miny));\n                }\n\n                for (var j = 0; j < this._vf.vertices.length; j += 3) {\n                    this._mesh._indices[0].push(j);\n                    this._mesh._indices[0].push(j + 2);\n                    this._mesh._indices[0].push(j + 1);\n                }\n\n                this._mesh._numTexComponents = 2;\n                this._mesh._invalidate = true;\n                this._mesh._numFaces = this._mesh._indices[0].length / 3;\n                this._mesh._numCoords = this._mesh._positions[0].length / 3;\n\n                x3dom.geoCache[geoCacheID] = this._mesh;\n            }\n        \n        },\n        {\n            fieldChanged: function (fieldName) {\n                if (fieldName == \"vertices\") {\n                    this._mesh._positions[0] = [];\n                    this._mesh._indices[0] = [];\n                    this._mesh._normals[0] = [];\n                    this._mesh._texCoords[0] = [];\n\n                    var minx = this._vf.vertices[0].x;\n                    var miny = this._vf.vertices[0].y;\n                    var maxx = this._vf.vertices[0].x;\n                    var maxy = this._vf.vertices[0].y;\n\n                    for (var i = 0; i < this._vf.vertices.length; i++) {\n                        if (this._vf.vertices[i].x < minx) {\n                            minx = this._vf.vertices[i].x\n                        }\n                        if (this._vf.vertices[i].y < miny) {\n                            miny = this._vf.vertices[i].y\n                        }\n                        if (this._vf.vertices[i].x > maxx) {\n                            maxx = this._vf.vertices[i].x\n                        }\n                        if (this._vf.vertices[i].y > maxy) {\n                            maxy = this._vf.vertices[i].y\n                        }\n                    }\n\n                    for (var i = 0; i < this._vf.vertices.length; i++) {\n                        var x = this._vf.vertices[i].x;\n                        var y = this._vf.vertices[i].y;\n                        this._mesh._positions[0].push(x);\n                        this._mesh._positions[0].push(y);\n                        this._mesh._positions[0].push(0.0);\n\n                        this._mesh._normals[0].push(0);\n                        this._mesh._normals[0].push(0);\n                        this._mesh._normals[0].push(1);\n\n                        this._mesh._texCoords[0].push((x - minx) / (maxx - minx));\n                        this._mesh._texCoords[0].push((y - miny) / (maxy - miny));\n                    }\n\n                    for (var j = 0; j < this._vf.vertices.length; j += 3) {\n                        this._mesh._indices[0].push(j);\n                        this._mesh._indices[0].push(j + 2);\n                        this._mesh._indices[0].push(j + 1);\n                    }\n\n                    this._mesh._numTexComponents = 2;\n                    this.invalidateVolume();\n                    this._mesh._numFaces = this._mesh._indices[0].length / 3;\n                    this._mesh._numCoords = this._mesh._positions[0].length / 3;\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node.setAllDirty();\n                    });\n                }\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * MEDX3DOM JavaScript Library\n * http://medx3dom.org\n *\n * (C)2011 Vicomtech Research Center,\n *         Donostia - San Sebastian\n * Dual licensed under the MIT and GPL.\n *\n * Based on code originally provided by\n * http://www.x3dom.org\n */\n\n/* ### X3DVolumeDataNode ### */\nx3dom.registerNodeType(\n    \"X3DVolumeDataNode\",\n    \"VolumeRendering\",\n    defineClass(x3dom.nodeTypes.X3DShapeNode,   // changed inheritance!\n\n        /**\n         * Constructor for X3DVolumeDataNode\n         * @constructs x3dom.nodeTypes.X3DVolumeDataNode\n         * @x3d x.x\n         * @component VolumeRendering\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DShapeNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc (Abstract) class for volume data.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DVolumeDataNode.superClass.call(this, ctx);\n\n\n            /**\n             * Specifies the size of of the bounding box for the volume data.\n             * @var {x3dom.fields.SFVec3f} dimensions\n             * @memberof x3dom.nodeTypes.X3DVolumeDataNode\n             * @initvalue 1,1,1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'dimensions', 1, 1, 1);\n\n            /**\n             * The voxels field is an ImageTextureAtlas node containing the volume data.\n             * @var {x3dom.fields.SFNode} voxels\n             * @memberof x3dom.nodeTypes.X3DVolumeDataNode\n             * @initvalue x3dom.nodeTypes.Texture\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('voxels', x3dom.nodeTypes.Texture);\n            //this.addField_MFNode('voxels', x3dom.nodeTypes.X3DTexture3DNode);\n            //this.addField_SFBool(ctx, 'swapped', false);\n            //this.addField_SFVec3f(ctx, 'sliceThickness', 1, 1, 1);\n\n            /**\n             * Allow to locate the viewpoint inside the volume.\n             * @var {x3dom.fields.SFBool} allowViewpointInside\n             * @memberof x3dom.nodeTypes.X3DVolumeDataNode\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'allowViewpointInside', true);\n\n            //Neccesary for counting the textures which are added on each style, number of textures can be variable\n            this._textureID = 0;\n            this._first = true;\n            this._styleList = [];\n            this.surfaceNormalsNeeded = false;\n            this.normalTextureProvided = false;\n            this.fragmentPreamble = \"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n\" +\n                                    \"  precision highp float;\\n\" +\n                                    \"#else\\n\" +\n                                    \"  precision mediump float;\\n\" +\n                                    \"#endif\\n\\n\";\n        },\n        {\n            getTextureSize: function(texture) {\n                var size = { w: 0, h: 0, valid: false };\n                var texBag = this._webgl ? this._webgl.texture : null;\n                var t, n = (texture && texBag) ? texBag.length : 0;\n\n                for (t=0; t<n; t++) {\n                    if (texture == texBag[t].node && texBag[t].texture) {\n                        size.w = texBag[t].texture.width;\n                        size.h = texBag[t].texture.height;\n                        if (size.w && size.h) {\n                            size.valid = true;\n                        }\n                        break;\n                    }\n                }\n\n                return size;\n            },\n\n            //Common vertex shader text for all volume data nodes\n            vertexShaderText: function(needEyePosition){\n                var shader =\n                \"attribute vec3 position;\\n\"+\n                \"uniform vec3 dimensions;\\n\"+\n                \"uniform mat4 modelViewProjectionMatrix;\\n\"+\n                \"varying vec4 vertexPosition;\\n\"+\n                \"varying vec4 pos;\\n\";\n                if(x3dom.nodeTypes.X3DLightNode.lightID>0 || (needEyePosition===true)){\n                    shader += \"uniform mat4 modelViewMatrix;\\n\"+\n                    \"varying vec4 position_eye;\\n\";\n                }\n                shader += \"\\n\" +\n                \"void main()\\n\"+\n                \"{\\n\"+\n                \"  vertexPosition = modelViewProjectionMatrix * vec4(position, 1.0);\\n\";\n                if(x3dom.nodeTypes.X3DLightNode.lightID>0 || (needEyePosition===true)){\n                   shader += \"  position_eye = modelViewMatrix * vec4(position, 1.0);\\n\";\n                }\n                shader +=\n                \"  pos = vec4((position/dimensions)+0.5, 1.0);\\n\"+\n                \"  gl_Position = vertexPosition;\\n\"+\n                \"}\";\n                return shader;\n            },\n\n            defaultUniformsShaderText: function(numberOfSlices, slicesOverX, slicesOverY, needEyePosition){\n               var uniformsText =\n                \"uniform sampler2D uVolData;\\n\"+\n                \"uniform vec3 dimensions;\\n\"+\n                \"uniform vec3 offset;\\n\"+\n                \"uniform mat4 modelViewMatrix;\\n\"+\n                \"uniform mat4 modelViewMatrixInverse;\\n\"+\n                \"varying vec4 vertexPosition;\\n\"+\n                \"varying vec4 pos;\\n\";\n                if(x3dom.nodeTypes.X3DLightNode.lightID>0 || (needEyePosition===true)){\n                    uniformsText += \"varying vec4 position_eye;\\n\";\n                }\n                //LIGHTS\n                for(var l=0; l<x3dom.nodeTypes.X3DLightNode.lightID; l++) {\n                    uniformsText +=   \"uniform float light\"+l+\"_On;\\n\" +\n                    \"uniform float light\"+l+\"_Type;\\n\" +\n                    \"uniform vec3  light\"+l+\"_Location;\\n\" +\n                    \"uniform vec3  light\"+l+\"_Direction;\\n\" +\n                    \"uniform vec3  light\"+l+\"_Color;\\n\" +\n                    \"uniform vec3  light\"+l+\"_Attenuation;\\n\" +\n                    \"uniform float light\"+l+\"_Radius;\\n\" +\n                    \"uniform float light\"+l+\"_Intensity;\\n\" +\n                    \"uniform float light\"+l+\"_AmbientIntensity;\\n\" +\n                    \"uniform float light\"+l+\"_BeamWidth;\\n\" +\n                    \"uniform float light\"+l+\"_CutOffAngle;\\n\" +\n                    \"uniform float light\"+l+\"_ShadowIntensity;\\n\";\n                }\n                uniformsText +=\n                \"const float Steps = 85.0;\\n\"+\n                \"const float numberOfSlices = \"+ numberOfSlices.toPrecision(5)+\";\\n\"+\n                \"const float slicesOverX = \" + slicesOverX.toPrecision(5) +\";\\n\"+\n                \"const float slicesOverY = \" + slicesOverY.toPrecision(5) +\";\\n\";\n                return uniformsText;\n            },\n\n            texture3DFunctionShaderText: \"vec4 cTexture3D(sampler2D vol, vec3 volpos, float nS, float nX, float nY)\\n\"+\n                \"{\\n\"+\n                \"  float s1,s2;\\n\"+\n                \"  float dx1,dy1;\\n\"+\n                \"  float dx2,dy2;\\n\"+\n                \"  vec2 texpos1,texpos2;\\n\"+\n                \"  s1 = floor(volpos.z*nS);\\n\"+\n                \"  s2 = s1+1.0;\\n\"+\n                \"  dx1 = fract(s1/nX);\\n\"+\n                \"  dy1 = floor(s1/nX)/nY;\\n\"+\n                \"  dx2 = fract(s2/nX);\\n\"+\n                \"  dy2 = floor(s2/nX)/nY;\\n\"+\n                \"  texpos1.x = dx1+(volpos.x/nX);\\n\"+\n                \"  texpos1.y = dy1+(volpos.y/nY);\\n\"+\n                \"  texpos2.x = dx2+(volpos.x/nX);\\n\"+\n                \"  texpos2.y = dy2+(volpos.y/nY);\\n\"+\n                \"  return mix( texture2D(vol,texpos1), texture2D(vol,texpos2), (volpos.z*nS)-s1);\\n\"+\n                \"}\\n\"+\n                \"\\n\",\n\n            normalFunctionShaderText: function(){\n                if (this.surfaceNormalsNeeded){\n                    return \"vec4 getNormalFromTexture(sampler2D sampler, vec3 pos, float nS, float nX, float nY) {\\n\"+\n                    \"   vec4 n = (2.0*cTexture3D(sampler, pos, nS, nX, nY)-1.0);\\n\"+\n                    \"   return vec4(normalize(n.xyz), length(n.xyz));\\n\"+\n                    \"}\\n\"+\n                    \"\\n\"+\n                    \"vec4 getNormalOnTheFly(sampler2D sampler, vec3 voxPos, float nS, float nX, float nY){\\n\"+\n                    \"   float v0 = cTexture3D(sampler, voxPos + vec3(offset.x, 0, 0), nS, nX, nY).r;\\n\"+\n                    \"   float v1 = cTexture3D(sampler, voxPos - vec3(offset.x, 0, 0), nS, nX, nY).r;\\n\"+\n                    \"   float v2 = cTexture3D(sampler, voxPos + vec3(0, offset.y, 0), nS, nX, nY).r;\\n\"+\n                    \"   float v3 = cTexture3D(sampler, voxPos - vec3(0, offset.y, 0), nS, nX, nY).r;\\n\"+\n                    \"   float v4 = cTexture3D(sampler, voxPos + vec3(0, 0, offset.z), nS, nX, nY).r;\\n\"+\n                    \"   float v5 = cTexture3D(sampler, voxPos - vec3(0, 0, offset.z), nS, nX, nY).r;\\n\"+\n                    \"   vec3 grad = vec3(v0-v1, v2-v3, v4-v5)*0.5;\\n\"+\n                    \"   return vec4(normalize(grad), length(grad));\\n\"+\n                    \"}\\n\"+\n                    \"\\n\";\n                }else{\n                    return \"\";\n                }\n            },\n\n            defaultLoopFragmentShaderText: function(inlineShaderText, inlineLightAssigment, initializeValues){\n                initializeValues = typeof initializeValues !== 'undefined' ? initializeValues : \"\"; //default value, empty string\n                var shaderLoop = \"void main()\\n\"+\n                \"{\\n\"+\n                \"  vec3 cam_pos = vec3(modelViewMatrixInverse[3][0], modelViewMatrixInverse[3][1], modelViewMatrixInverse[3][2]);\\n\"+\n                \"  vec3 cam_cube = cam_pos/dimensions+0.5;\\n\"+\n                \"  vec3 dir = normalize(pos.xyz-cam_cube);\\n\";\n                if(this._vf.allowViewpointInside){\n                    shaderLoop +=\n                    \"  float cam_inside = float(all(bvec2(all(lessThan(cam_cube, vec3(1.0))),all(greaterThan(cam_cube, vec3(0.0))))));\\n\"+\n                    \"  vec3 ray_pos = mix(pos.xyz, cam_cube, cam_inside);\\n\";\n                }else{\n                    shaderLoop += \"  vec3 ray_pos = pos.xyz;\\n\";\n                }\n                shaderLoop +=\n                \"  vec4 accum  = vec4(0.0, 0.0, 0.0, 0.0);\\n\"+\n                \"  vec4 sample = vec4(0.0, 0.0, 0.0, 0.0);\\n\"+\n                \"  vec4 value  = vec4(0.0, 0.0, 0.0, 0.0);\\n\"+\n                \"  float cont = 0.0;\\n\"+\n                \"  vec3 step_size = (dir*1.4142)/Steps;\\n\";\n                //Light init values\n                if(x3dom.nodeTypes.X3DLightNode.lightID>0){\n                    shaderLoop +=\n                    \"  vec3 ambient = vec3(0.0, 0.0, 0.0);\\n\"+\n                    \"  vec3 diffuse = vec3(0.0, 0.0, 0.0);\\n\"+\n                    \"  vec3 specular = vec3(0.0, 0.0, 0.0);\\n\"+\n                    \"  vec4 step_eye = modelViewMatrix * vec4(step_size, 0.0);\\n\"+\n                    \"  vec4 positionE = position_eye;\\n\"+\n                    \"  float lightFactor = 1.0;\\n\";\n                }else{\n                    shaderLoop += \"  float lightFactor = 1.2;\\n\";\n                }\n                shaderLoop += initializeValues+\n                \"  float opacityFactor = 10.0;\\n\"+\n                \"  float t_near;\\n\"+\n                \"  float t_far;\\n\"+\n                \"  for(float i = 0.0; i < Steps; i+=1.0)\\n\"+\n                \"  {\\n\"+\n                \"    value = cTexture3D(uVolData, ray_pos, numberOfSlices, slicesOverX, slicesOverY);\\n\"+\n                \"    value = value.rgbr;\\n\";\n                if(this.surfaceNormalsNeeded){\n                    if(this.normalTextureProvided){\n                        shaderLoop += \"    vec4 gradEye = getNormalFromTexture(uSurfaceNormals, ray_pos, numberOfSlices, slicesOverX, slicesOverY);\\n\";\n                    }else{\n                        shaderLoop += \"    vec4 gradEye = getNormalOnTheFly(uVolData, ray_pos, numberOfSlices, slicesOverX, slicesOverY);\\n\";\n                    }\n                    shaderLoop += \"    vec4 grad = vec4((modelViewMatrix * vec4(gradEye.xyz, 0.0)).xyz, gradEye.a);\\n\";\n                }\n                shaderLoop += inlineShaderText;\n                if(x3dom.nodeTypes.X3DLightNode.lightID>0){\n                    shaderLoop += inlineLightAssigment;\n                }\n                shaderLoop +=\n                //Composite the volume sample\n                \"    sample.a = value.a * opacityFactor * (1.0/Steps);\\n\"+\n                \"    sample.rgb = value.rgb * sample.a * lightFactor;\\n\"+\n                \"    accum.rgb += (1.0 - accum.a) * sample.rgb;\\n\"+\n                \"    accum.a += (1.0 - accum.a) * sample.a;\\n\"+\n                //Advance the current ray position\n                \"    ray_pos.xyz += step_size;\\n\";\n                if(x3dom.nodeTypes.X3DLightNode.lightID>0){\n                    shaderLoop +=\"    positionE += step_eye;\\n\";\n                }\n                shaderLoop +=\n                //Early ray termination and Break if the position is greater than <1, 1, 1>\n                \"    if(accum.a >= 1.0 || ray_pos.x < 0.0 || ray_pos.y < 0.0 || ray_pos.z < 0.0 || ray_pos.x > 1.0 || ray_pos.y > 1.0 || ray_pos.z > 1.0)\\n\"+\n                \"      break;\\n\"+\n                \"  }\\n\"+\n                \"  gl_FragColor = accum;\\n\"+\n                \"}\";\n                return shaderLoop;\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * MEDX3DOM JavaScript Library\n * http://medx3dom.org\n *\n * (C)2011 Vicomtech Research Center,\n *         Donostia - San Sebastian\n * Dual licensed under the MIT and GPL.\n *\n * Based on code originally provided by\n * http://www.x3dom.org\n */\n\n/* ### X3DVolumeRenderStyleNode ### */\nx3dom.registerNodeType(\n    \"X3DVolumeRenderStyleNode\",\n    \"VolumeRendering\",\n    defineClass(x3dom.nodeTypes.X3DNode,\n        \n        /**\n         * Constructor for X3DVolumeRenderStyleNode\n         * @constructs x3dom.nodeTypes.X3DVolumeRenderStyleNode\n         * @x3d x.x\n         * @component VolumeRendering\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc (Abstract) class for volume rendering styles.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DVolumeRenderStyleNode.superClass.call(this, ctx);\n\n\n            /**\n             * Specifies whether the render style is enabled or disabled.\n             * @var {x3dom.fields.SFBool} enabled\n             * @memberof x3dom.nodeTypes.X3DVolumeRenderStyleNode\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'enabled', true);\n\n            //Private parameters\n            this._styleID = 0; //To differentiate between style instances\n            this._first = false; //To know if it is the first style being applied\n            this._volumeDataParent = null; //Shortcut to the parent volume data\n        },\n        {\n            nodeChanged: function () {\n                if(!this._styleID) {\n                    this._styleID = ++x3dom.nodeTypes.X3DVolumeRenderStyleNode.styleID;\n                }\n            },\n\n            updateProperties: function(volumeData) { //FIXME: This property must be called before obtaining the shader pieces from the volume data node.\n                //Update the first and parent volume data parameters of the child nodes\n                if (this._cf.renderStyle) {\n                    if (this._cf.renderStyle.nodes) {\n                        for (var i=0; i<this._cf.renderStyle.nodes.length; i++){\n                            if(this._cf.renderStyle.nodes[i].updateProperties != undefined){\n                                this._cf.renderStyle.nodes[i].updateProperties(volumeData);\n                            }\n                        }\n                    }else if(this._cf.renderStyle.node){\n                        this._cf.renderStyle.node.updateProperties(volumeData);\n                    }\n                }\n                \n                this._volumeDataParent = volumeData;\n\n                //Update first property, to know it is the first time the style is being applied\n                if(this._volumeDataParent._styleList.indexOf(this.typeName()) != -1){\n                    this._first = false;\n                }else{\n                    this._first = true;\n                    this._volumeDataParent._styleList.push(this.typeName());\n                }\n            },\n\n            initializeValues: function(){\n                return \"\"; // overwritten\n            },\n\n            styleUniformsShaderText: function(){\n                return \"\"; // overwritten\n            },\n\n            styleShaderText: function(){\n                return \"\"; // overwritten\n            },\n\n            inlineStyleShaderText: function(){\n                return \"\"; // overwritten\n            },\n\n            lightAssigment: function(){\n                var shaderText = \"\";\n                for(var l=0; l<x3dom.nodeTypes.X3DLightNode.lightID; l++) {\n                    shaderText += \"    lighting(light\"+l+\"_Type, \" +\n                    \"light\"+l+\"_Location, \" +\n                    \"light\"+l+\"_Direction, \" +\n                    \"light\"+l+\"_Color, \" + \n                    \"light\"+l+\"_Attenuation, \" +\n                    \"light\"+l+\"_Radius, \" +\n                    \"light\"+l+\"_Intensity, \" + \n                    \"light\"+l+\"_AmbientIntensity, \" +\n                    \"light\"+l+\"_BeamWidth, \" +\n                    \"light\"+l+\"_CutOffAngle, \" +\n                    \"grad.xyz, positionE.xyz, ambient, diffuse, specular);\\n\";\n                }\n                shaderText += \"    value.rgb = ambient*value.rgb + diffuse*value.rgb + specular;\\n\"; // overwritten\n                return shaderText;\n            },\n\n            // default light equation to be overwritten by concrete render style\n            lightEquationShaderText: function(){\n                if (x3dom.nodeTypes.X3DLightNode.lightID>0){\n                    return \"void lighting(in float lType, in vec3 lLocation, in vec3 lDirection, in vec3 lColor, in vec3 lAttenuation, \" + \n                    \"in float lRadius, in float lIntensity, in float lAmbientIntensity, in float lBeamWidth, \" +\n                    \"in float lCutOffAngle, in vec3 N, in vec3 V, inout vec3 ambient, inout vec3 diffuse, \" +\n                    \"inout vec3 specular)\\n\" +\n                    \"{\\n\" +\n                    \"   vec3 L;\\n\" +\n                    \"   float spot = 1.0, attentuation = 0.0;\\n\" +\n                    \"   if(lType == 0.0) {\\n\" +\n                    \"       L = -normalize(lDirection);\\n\" +\n                    \"       V = normalize(V);\\n\" +\n                    \"       attentuation = 1.0;\\n\" +\n                    \"   } else{\\n\" +\n                    \"       L = (lLocation - (-V));\\n\" +\n                    \"       float d = length(L);\\n\" +\n                    \"       L = normalize(L);\\n\" +\n                    \"       V = normalize(V);\\n\" +\n                    \"       if(lRadius == 0.0 || d <= lRadius) {\\n\" +\n                    \"           attentuation = 1.0 / max(lAttenuation.x + lAttenuation.y * d + lAttenuation.z * (d * d), 1.0);\\n\" +\n                    \"       }\\n\" +\n                    \"       if(lType == 2.0) {\\n\" +\n                    \"           float spotAngle = acos(max(0.0, dot(-L, normalize(lDirection))));\\n\" +\n                    \"           if(spotAngle >= lCutOffAngle) spot = 0.0;\\n\" +\n                    \"           else if(spotAngle <= lBeamWidth) spot = 1.0;\\n\" +\n                    \"           else spot = (spotAngle - lCutOffAngle ) / (lBeamWidth - lCutOffAngle);\\n\" +\n                    \"       }\\n\" +\n                    \"   }\\n\" +\n                    \"   vec3  H = normalize( L + V );\\n\" +\n                    \"   float NdotL = max(0.0, dot(L, N));\\n\" +\n                    \"   float NdotH = max(0.0, dot(H, N));\\n\" +   \n                    \"   float ambientFactor  = lAmbientIntensity;\\n\" +\n                    \"   float diffuseFactor  = lIntensity * NdotL;\\n\" +\n                    \"   float specularFactor = lIntensity * pow(NdotH,128.0);\\n\" +\n                    \"   ambient  += lColor * ambientFactor * attentuation * spot;\\n\" +\n                    \"   diffuse  += lColor * diffuseFactor * attentuation * spot;\\n\" +\n                    \"   specular += lColor * specularFactor * attentuation * spot;\\n\" +  \n                    \"}\\n\"+\n                    \"\\n\";\n                }else{\n                    return \"\";\n                }\n            }\n        }\n    )\n);\n\n/** Static class ID counter (needed to allow duplicate styles) */\nx3dom.nodeTypes.X3DVolumeRenderStyleNode.styleID = 0;\n\n/** @namespace x3dom.nodeTypes */\n/*\n * MEDX3DOM JavaScript Library\n * http://medx3dom.org\n *\n * (C)2011 Vicomtech Research Center,\n *         Donostia - San Sebastian\n * Dual licensed under the MIT and GPL.\n *\n * Based on code originally provided by\n * http://www.x3dom.org\n */\n\n/* ### X3DComposableVolumeRenderStyleNode ### */\nx3dom.registerNodeType(\n    \"X3DComposableVolumeRenderStyleNode\",\n    \"VolumeRendering\",\n    defineClass(x3dom.nodeTypes.X3DVolumeRenderStyleNode,\n        \n        /**\n         * Constructor for X3DComposableVolumeRenderStyleNode\n         * @constructs x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode\n         * @x3d x.x\n         * @component VolumeRendering\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DVolumeRenderStyleNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc (Abstract) class for composable volume rendering styles.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode.superClass.call(this, ctx);\n\n\n            /**\n             * The surfaceNormals field allows to provide the normals of the volume data. It takes an ImageTextureAtlas of the same dimensions of the volume data. If it is not provided, it is computed on the fly.\n             * @var {x3dom.fields.SFNode} surfaceNormals\n             * @memberof x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode\n             * @initvalue x3dom.nodeTypes.Texture\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('surfaceNormals', x3dom.nodeTypes.Texture);\n        \n        },\n        {\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * MEDX3DOM JavaScript Library\n * http://medx3dom.org\n *\n * (C)2011 Vicomtech Research Center,\n *         Donostia - San Sebastian\n * Dual licensed under the MIT and GPL.\n *\n * Based on code originally provided by\n * http://www.x3dom.org\n */\n\n/* ### BlendedVolumeStyle ### */\nx3dom.registerNodeType(\n    \"BlendedVolumeStyle\",\n    \"VolumeRendering\",\n    defineClass(x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode,\n        \n        /**\n         * Constructor for BlendedVolumeStyle\n         * @constructs x3dom.nodeTypes.BlendedVolumeStyle\n         * @x3d x.x\n         * @component VolumeRendering\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The BlendedVolumeStyle node allows to blend the parent volume data with a second specified volume data using a weight function. \n         */\n        function (ctx) {\n            x3dom.nodeTypes.BlendedVolumeStyle.superClass.call(this, ctx);\n\n\n            /**\n             * Specifies the render style to be applied on the volume data to be blended.\n             * @var {x3dom.fields.SFNode} renderStyle\n             * @memberof x3dom.nodeTypes.BlendedVolumeStyle\n             * @initvalue x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('renderStyle', x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode);\n\n            /**\n             * The voxels field is an ImageTextureAtlas node containing the volume data to be blended.\n             * @var {x3dom.fields.SFNode} voxels\n             * @memberof x3dom.nodeTypes.BlendedVolumeStyle\n             * @initvalue x3dom.nodeTypes.X3DVolumeDataNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('voxels', x3dom.nodeTypes.X3DVolumeDataNode);\n\n            /**\n             * The weightConstant1 field specifies a constant weight value to be use on the parent volume data.\n             * @var {x3dom.fields.SFFloat} weightConstant1\n             * @memberof x3dom.nodeTypes.BlendedVolumeStyle\n             * @initvalue 0.5\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'weightConstant1', 0.5);\n\n            /**\n             * The weightConstant2 field specifies a constant weight value to be use on the volume data to be blended.\n             * @var {x3dom.fields.SFFloat} weightConstant2\n             * @memberof x3dom.nodeTypes.BlendedVolumeStyle\n             * @initvalue 0.5\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'weightConstant2', 0.5);\n\n            /**\n             * The weightFunction1 field specifies the type of the weight function to be use on the parent volume data.\n             * @var {x3dom.fields.SFString} weightFunction1\n             * @memberof x3dom.nodeTypes.BlendedVolumeStyle\n             * @initvalue \"CONSTANT\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'weightFunction1', \"CONSTANT\");\n\n            /**\n             * The weightFunction2 field specifies the type of weight function to be use on the volume data to be blended.\n             * @var {x3dom.fields.SFString} weightFunction2\n             * @memberof x3dom.nodeTypes.BlendedVolumeStyle\n             * @initvalue \"CONSTANT\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'weightFunction2', \"CONSTANT\");\n\n            /**\n             * The weightTransferFunction1 field is a 2D texture that maps each opacity value to a weight value, that will be used on the parent volume data.\n             * @var {x3dom.fields.SFNode} weightTransferFunction1\n             * @memberof x3dom.nodeTypes.BlendedVolumeStyle\n             * @initvalue x3dom.nodeTypes.X3DTexture2DNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('weightTransferFunction1', x3dom.nodeTypes.X3DTexture2DNode);\n\n            /**\n             * The weightTransferFunction2 field is a 2D texture that maps each opacity value to a weight value, that will be used on the volume data to be blended.\n             * @var {x3dom.fields.SFNode} weightTransferFunction2\n             * @memberof x3dom.nodeTypes.BlendedVolumeStyle\n             * @initvalue x3dom.nodeTypes.X3DTexture2DNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('weightTransferFunction2', x3dom.nodeTypes.X3DTexture2DNode);\n\n            this.uniformFloatWeightConstant1 = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformFloatWeightConstant2 = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformSampler2DVoxels = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformSampler2DWeightTransferFunction1 = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformSampler2DWeightTransferFunction2 = new x3dom.nodeTypes.Uniform(ctx);\n        \n        },\n        {\n            fieldChanged: function(fieldName){\n                switch(fieldName){\n                    case 'weightConstant1':\n                        this.uniformFloatWeightConstant1._vf.value = this._vf.weightConstant1;\n                        this.uniformFloatWeightConstant1.fieldChanged(\"value\");\n                        break;\n                    case 'weightConstant2':\n                        this.uniformFloatWeightConstant2._vf.value = this._vf.weightConstant2;\n                        this.uniformFloatWeightConstant2.fieldChanged(\"value\");\n                        break;\n                    case 'weightFunction1':\n                        //TODO: Reload node\n                        break;\n                    case 'weightFunction2':\n                        //TODO: Reload node\n                        break;\n                }\n            },\n\n            uniforms: function(){\n                var unis = [];\n                if (this._cf.voxels.node || this._cf.weightTransferFunction1.node || this._cf.weightTransferFunction2.node) {\n                    this.uniformSampler2DVoxels._vf.name = 'uVolBlendData';\n                    this.uniformSampler2DVoxels._vf.type = 'SFInt32';\n                    this.uniformSampler2DVoxels._vf.value = this._volumeDataParent._textureID++;\n                    unis.push(this.uniformSampler2DVoxels);\n\n                    if(this._cf.weightTransferFunction1.node){\n                        this.uniformSampler2DWeightTransferFunction1._vf.name = 'uWeightTransferFunctionA';\n                        this.uniformSampler2DWeightTransferFunction1._vf.type = 'SFInt32';\n                        this.uniformSampler2DWeightTransferFunction1._vf.value = this._volumeDataParent._textureID++;\n                        unis.push(this.uniformSampler2DWeightTransferFunction1);\n                    }\n\n                    if(this._cf.weightTransferFunction2.node){\n                        this.uniformSampler2DWeightTransferFunction2._vf.name = 'uWeightTransferFunctionB';\n                        this.uniformSampler2DWeightTransferFunction2._vf.type = 'SFInt32';\n                        this.uniformSampler2DWeightTransferFunction2._vf.value = this._volumeDataParent._textureID++;\n                        unis.push(this.uniformSampler2DWeightTransferFunction2);\n                    }\n                }\n\n                this.uniformFloatWeightConstant1._vf.name = 'uWeightConstantA';\n                this.uniformFloatWeightConstant1._vf.type = 'SFFloat';\n                this.uniformFloatWeightConstant1._vf.value = this._vf.weightConstant1;\n                unis.push(this.uniformFloatWeightConstant1);\n\n                this.uniformFloatWeightConstant2._vf.name = 'uWeightConstantB';\n                this.uniformFloatWeightConstant2._vf.type = 'SFFloat';\n                this.uniformFloatWeightConstant2._vf.value = this._vf.weightConstant2;\n                unis.push(this.uniformFloatWeightConstant2);\n\n                //Also add the render style uniforms\n                if (this._cf.renderStyle.node) {\n                    var renderStyleUniforms = this._cf.renderStyle.node.uniforms();\n                    Array.forEach(renderStyleUniforms, function(uni){\n                        uni._vf.name = uni._vf.name.replace(/uSurfaceNormals/, \"uBlendSurfaceNormals\")\n                    });\n                    unis = unis.concat(renderStyleUniforms);       \n                }\n                return unis;\n            },\n\n            textures: function(){\n                var texs = [];\n                if (this._cf.voxels.node) {\n                    var tex = this._cf.voxels.node;\n                    tex._vf.repeatS = false;\n                    tex._vf.repeatT = false;\n                    texs.push(tex);\n                }\n                if (this._cf.weightTransferFunction1.node) {\n                    var tex = this._cf.weightTransferFunction1.node;\n                    tex._vf.repeatS = false;\n                    tex._vf.repeatT = false;\n                    texs.push(tex);\n                }\n                if (this._cf.weightTransferFunction2.node) {\n                    var tex = this._cf.weightTransferFunction2.node;\n                    tex._vf.repeatS = false;\n                    tex._vf.repeatT = false;\n                    texs.push(tex);\n                }\n                //Also add the render style textures\n                if (this._cf.renderStyle.node) {\n                    var renderStyleTextures = this._cf.renderStyle.node.textures();\n                    texs = texs.concat(renderStyleTextures);       \n                }\n                return texs;\n            },\n\n            initializeValues: function(){\n                var initialValues = \"\";\n                if(x3dom.nodeTypes.X3DLightNode.lightID>0){\n                    initialValues += \"  vec3 ambientBlend = vec3(0.0, 0.0, 0.0);\\n\"+\n                    \"  vec3 diffuseBlend = vec3(0.0, 0.0, 0.0);\\n\"+\n                    \"  vec3 specularBlend = vec3(0.0, 0.0, 0.0);\\n\";\n                }\n                return initialValues;\n            },\n\n            styleUniformsShaderText: function(){\n                var uniformsText = \"uniform float uWeightConstantA;\\n\"+\n                    \"uniform float uWeightConstantB;\\n\"+\n                    \"uniform sampler2D uBlendSurfaceNormals;\\n\";\n                    if(this._cf.voxels.node){\n                        uniformsText += \"uniform sampler2D uVolBlendData;\\n\";\n                    }\n                    if(this._cf.weightTransferFunction1.node){\n                        uniformsText += \"uniform sampler2D uWeightTransferFunctionA;\\n\";\n                    }\n                    if(this._cf.weightTransferFunction2.node){\n                        uniformsText += \"uniform sampler2D uWeightTransferFunctionB;\\n\";\n                    }\n                    //Also add the render style uniforms\n                    if(this._cf.renderStyle.node) {\n                        uniformsText += this._cf.renderStyle.node.styleUniformsShaderText();\n                    }\n                return uniformsText;\n            },\n\n            styleShaderText: function(){\n                var styleText = \"\";\n                if(this._cf.renderStyle.node && this._cf.renderStyle.node.styleShaderText!=undefined) {\n                    styleText += this._cf.renderStyle.node.styleShaderText();\n                }\n                return styleText;\n            },\n\n            inlineStyleShaderText: function(){\n                var nSlices = this._cf.voxels.node._vf.numberOfSlices.toPrecision(5);\n                var xSlices = this._cf.voxels.node._vf.slicesOverX.toPrecision(5);\n                var ySlices = this._cf.voxels.node._vf.slicesOverY.toPrecision(5);\n                var inlineText = \"    vec4 blendValue = cTexture3D(uVolBlendData, ray_pos, \"+ nSlices +\", \"+ xSlices +\", \"+ ySlices +\");\\n\"+\n                \"    blendValue = vec4(blendValue.rgb,(0.299*blendValue.r)+(0.587*blendValue.g)+(0.114*blendValue.b));\\n\";\n                if(this._cf.renderStyle.node && this._cf.renderStyle.node._cf.surfaceNormals.node){\n                    inlineText += \"    vec4 blendGradEye = getNormalFromTexture(uBlendSurfaceNormals, ray_pos, \"+ nSlices +\", \"+ xSlices +\", \"+ ySlices +\");\\n\";\n                }else{\n                    inlineText += \"    vec4 blendGradEye = getNormalOnTheFly(uVolBlendData, ray_pos, \"+ nSlices +\", \"+ xSlices +\", \"+ ySlices +\");\\n\";\n                }\n                inlineText += \"    vec4 blendGrad = vec4((modelViewMatrix * vec4(blendGradEye.xyz, 0.0)).xyz, blendGradEye.a);\\n\";\n                if(this._cf.renderStyle.node){\n                    var tempText = this._cf.renderStyle.node.inlineStyleShaderText().replace(/value/gm, \"blendValue\").replace(/grad/gm, \"blendGrad\");\n                    inlineText += tempText.replace(/ambient/gm, \"ambientBlend\").replace(/diffuse/gm, \"diffuseBlend\").replace(/specular/gm, \"specularBlend\");\n                }\n                //obtain the first weight\n                switch(this._vf.weightFunction1.toUpperCase()){\n                    case \"CONSTANT\":\n                        inlineText += \"    float wA = uWeightConstantA;\\n\";\n                        break;\n                    case \"ALPHA0\":\n                        inlineText += \"    float wA = value.a;\\n\";\n                        break;\n                    case \"ALPHA1\":\n                        inlineText += \"    float wA = blendValue.a;\\n\";\n                        break;\n                    case \"ONE_MINUS_ALPHA0\":\n                        inlineText += \"    float wA = 1.0 - value.a;\\n\";\n                        break;\n                    case \"ONE_MINUS_ALPHA1\":\n                        inlineText += \"    float wA = 1.0 - blendValue.a;\\n\";\n                        break;\n                    case \"TABLE\":\n                        if(this._cf.weightTransferFunction1){\n                            inlineText += \"    float wA = texture2D(uWeightTransferFunctionA, vec2(value.a, blendValue.a));\\n\";\n                        }else{\n                            inlineText += \"    float wA = value.a;\\n\";\n                            x3dom.debug.logWarning('[VolumeRendering][BlendedVolumeStyle] TABLE specified on weightFunction1 but not weightTrnafer function provided, using ALPHA0.');\n                        }\n                        break;\n                }\n                //obtain the second weight\n                switch(this._vf.weightFunction2.toUpperCase()){\n                    case \"CONSTANT\":\n                        inlineText += \"    float wB = uWeightConstantB;\\n\";\n                        break;\n                    case \"ALPHA0\":\n                        inlineText += \"    float wB = value.a;\\n\";\n                        break;\n                    case \"ALPHA1\":\n                        inlineText += \"    float wB = blendValue.a;\\n\";\n                        break;\n                    case \"ONE_MINUS_ALPHA0\":\n                        inlineText += \"    float wB = 1.0 - value.a;\\n\";\n                        break;\n                    case \"ONE_MINUS_ALPHA1\":\n                        inlineText += \"    float wB = 1.0 - blendValue.a;\\n\";\n                        break;\n                    case \"TABLE\":\n                        if(this._cf.weightTransferFunction2){\n                            inlineText += \"    float wB = texture2D(uWeightTransferFunctionB, vec2(value.a, blendValue.a));\\n\";\n                        }else{\n                            inlineText += \"    float wB = value.a;\\n\";\n                            x3dom.debug.logWarning('[VolumeRendering][BlendedVolumeStyle] TABLE specified on weightFunction2 but not weightTrasnferFunction provided, using ALPHA0.');\n                        }\n                        break;\n                }\n                if(x3dom.nodeTypes.X3DLightNode.lightID == 0){\n                    inlineText += \"    value = clamp(value * wA + blendValue * wB, 0.0, 1.0);\\n\";\n                }\n                return inlineText;\n            },\n\n            lightAssigment: function(){\n                var inlineText = \"\";\n                if(x3dom.nodeTypes.X3DLightNode.lightID>0){\n                    if(this._cf.renderStyle.node){\n                        var tempText = this._cf.renderStyle.node.lightAssigment().replace(/value/gm, \"blendValue\").replace(/grad/gm, \"blendGrad\");\n                        inlineText += tempText.replace(/ambient/gm, \"ambientBlend\").replace(/diffuse/gm, \"diffuseBlend\").replace(/specular/gm, \"specularBlend\");\n                    }else{\n                        for(var l=0; l<x3dom.nodeTypes.X3DLightNode.lightID; l++) {\n                            inlineText += \"    lighting(light\"+l+\"_Type, \" +\n                            \"light\"+l+\"_Location, \" +\n                            \"light\"+l+\"_Direction, \" +\n                            \"light\"+l+\"_Color, \" + \n                            \"light\"+l+\"_Attenuation, \" +\n                            \"light\"+l+\"_Radius, \" +\n                            \"light\"+l+\"_Intensity, \" + \n                            \"light\"+l+\"_AmbientIntensity, \" +\n                            \"light\"+l+\"_BeamWidth, \" +\n                            \"light\"+l+\"_CutOffAngle, \" +\n                            \"blendGradEye.xyz, -positionE.xyz, ambientBlend, diffuseBlend, specularBlend);\\n\";\n                        }\n                        inlineText += \"    blendValue.rgb = ambientBlend*blendValue.rgb + diffuseBlend*blendValue.rgb + specularBlend;\\n\";\n                    }\n                }\n                inlineText += \"    value.rgb = clamp(value.rgb * wA + blendValue.rgb * wB, 0.0, 1.0);\\n\"+\n                \"    value.a = clamp(value.a * wA + blendValue.a * wB, 0.0, 1.0);\\n\";\n                return inlineText; //previously computed, empty string\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * MEDX3DOM JavaScript Library\n * http://medx3dom.org\n *\n * (C)2011 Vicomtech Research Center,\n *         Donostia - San Sebastian\n * Dual licensed under the MIT and GPL.\n *\n * Based on code originally provided by\n * http://www.x3dom.org\n */\n/* ### BoundaryEnhancementVolumeStyle ### */\nx3dom.registerNodeType(\n    \"BoundaryEnhancementVolumeStyle\",\n    \"VolumeRendering\",\n    defineClass(x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode,\n        \n        /**\n         * Constructor for BoundaryEnhancementVolumeStyle\n         * @constructs x3dom.nodeTypes.BoundaryEnhancementVolumeStyle\n         * @x3d x.x\n         * @component VolumeRendering\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The BoundaryEnhancementVolumeStyle node specifies that the boundaries of the volume data shall be enhanced. The rendering is performed based on the gradient magnitude.\n         * Areas where density varies are made more visible than areas of constant density.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.BoundaryEnhancementVolumeStyle.superClass.call(this, ctx);\n\n\n            /**\n             * The retainedOpacity field specifies the amount of original opacity to retain.\n             * @var {x3dom.fields.SFFloat} retainedOpacity\n             * @memberof x3dom.nodeTypes.BoundaryEnhancementVolumeStyle\n             * @initvalue 1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'retainedOpacity', 1);\n\n            /**\n             * The boundaryOpacity field specifies the amount of boundary enhancement to use.\n             * @var {x3dom.fields.SFFloat} boundaryOpacity\n             * @memberof x3dom.nodeTypes.BoundaryEnhancementVolumeStyle\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'boundaryOpacity', 0);\n\n            /**\n             * The opacityFactor field is an exponent factor that specifies the slope of the opacity curve to highlight the boundary.\n             * @var {x3dom.fields.SFFloat} opacityFactor\n             * @memberof x3dom.nodeTypes.BoundaryEnhancementVolumeStyle\n             * @initvalue 1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'opacityFactor', 1);\n\n            this.uniformFloatRetainedOpacity = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformFloatBoundaryOpacity = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformFloatOpacityFactor = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformSampler2DSurfaceNormals = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformBoolEnableBoundary = new x3dom.nodeTypes.Uniform(ctx);\n        \n        },\n        {\n            fieldChanged: function(fieldName){\n                switch(fieldName){\n                    case 'retainedOpacity':\n                        this.uniformFloatRetainedOpacity._vf.value = this._vf.retainedOpacity;\n                        this.uniformFloatRetainedOpacity.fieldChanged(\"value\");\n                        break;\n                    case 'boundaryOpacity':\n                        this.uniformFloatBoundaryOpacity._vf.value = this._vf.boundaryOpacity;\n                        this.uniformFloatBoundaryOpacity.fieldChanged(\"value\");\n                        break;\n                    case 'opacityFactor':\n                        this.uniformFloatOpacityFactor._vf.value = this._vf.opacityFactor;\n                        this.uniformFloatOpacityFactor.fieldChanged(\"value\");\n                        break;\n                }\n            },\n\n            uniforms: function(){\n                var unis = [];\n                if (this._cf.surfaceNormals.node) {\n                    //Lookup for the parent VolumeData\n                    var volumeDataParent = this._parentNodes[0];\n                    while(!x3dom.isa(volumeDataParent, x3dom.nodeTypes.X3DVolumeDataNode) || !x3dom.isa(volumeDataParent, x3dom.nodeTypes.X3DNode)){\n                        volumeDataParent = volumeDataParent._parentNodes[0];\n                    }\n                    if(x3dom.isa(volumeDataParent, x3dom.nodeTypes.X3DVolumeDataNode) == false){\n                        x3dom.debug.logError(\"[VolumeRendering][BoundaryEnhancementVolumeStyle] Not VolumeData parent found!\");\n                        volumeDataParent = null;\n                    }\n                    this.uniformSampler2DSurfaceNormals._vf.name = 'uSurfaceNormals';\n                    this.uniformSampler2DSurfaceNormals._vf.type = 'SFInt32';\n                    this.uniformSampler2DSurfaceNormals._vf.value = volumeDataParent._textureID++;\n                    unis.push(this.uniformSampler2DSurfaceNormals);\n                }\n\n                this.uniformFloatRetainedOpacity._vf.name = 'uRetainedOpacity'+this._styleID;\n                this.uniformFloatRetainedOpacity._vf.type = 'SFFloat';\n                this.uniformFloatRetainedOpacity._vf.value = this._vf.retainedOpacity;\n                unis.push(this.uniformFloatRetainedOpacity);\n\n                this.uniformFloatBoundaryOpacity._vf.name = 'uBoundaryOpacity'+this._styleID;\n                this.uniformFloatBoundaryOpacity._vf.type = 'SFFloat';\n                this.uniformFloatBoundaryOpacity._vf.value = this._vf.boundaryOpacity;\n                unis.push(this.uniformFloatBoundaryOpacity);\n\n                this.uniformFloatOpacityFactor._vf.name = 'uOpacityFactor'+this._styleID;\n                this.uniformFloatOpacityFactor._vf.type = 'SFFloat';\n                this.uniformFloatOpacityFactor._vf.value = this._vf.opacityFactor;\n                unis.push(this.uniformFloatOpacityFactor);\n\n                this.uniformBoolEnableBoundary._vf.name = 'uEnableBoundary'+this._styleID;\n                this.uniformBoolEnableBoundary._vf.type = 'SFBool';\n                this.uniformBoolEnableBoundary._vf.value = this._vf.enabled;\n                unis.push(this.uniformBoolEnableBoundary);\n                return unis;\n            },\n\n            textures: function() {\n                var texs = [];\n                if (!(this._cf.surfaceNormals.node==null)) {\n                    var tex = this._cf.surfaceNormals.node;\n                    tex._vf.repeatS = false;\n                    tex._vf.repeatT = false;\n                    texs.push(tex)\n                }\n                return texs;\n            },\n\n            styleUniformsShaderText: function(){\n                return \"uniform float uRetainedOpacity\"+this._styleID+\";\\n\"+\n                    \"uniform float uBoundaryOpacity\"+this._styleID+\";\\n\"+\n                    \"uniform float uOpacityFactor\"+this._styleID+\";\\n\"+\n                    \"uniform bool uEnableBoundary\"+this._styleID+\";\\n\";\n            },\n\n            styleShaderText: function(){\n                if (this._first){\n                    return \"void boundaryEnhancement(inout vec4 original_color, in float gradientMagnitude, in float retainedOpacity, in float boundaryOpacity, in float opacityFactor){\\n\"+\n                    \"   original_color.a = original_color.a * (retainedOpacity + (boundaryOpacity * pow(gradientMagnitude, opacityFactor)));\\n\"+\n                    \"}\\n\";\n                }else{\n                    return \"\";\n                }\n            },\n\n            inlineStyleShaderText: function(){\n                var inlineText = \"    if(uEnableBoundary\"+this._styleID+\"){\\n\"+\n                \"    boundaryEnhancement(value, grad.w, uRetainedOpacity\"+this._styleID+\", uBoundaryOpacity\"+this._styleID+\", uOpacityFactor\"+this._styleID+\");\\n\"+\n                \"}\\n\";\n                return inlineText;\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * MEDX3DOM JavaScript Library\n * http://medx3dom.org\n *\n * (C)2011 Vicomtech Research Center,\n *         Donostia - San Sebastian\n * Dual licensed under the MIT and GPL.\n *\n * Based on code originally provided by\n * http://www.x3dom.org\n */\n\n/* ### CartoonVolumeStyle ### */\nx3dom.registerNodeType(\n    \"CartoonVolumeStyle\",\n    \"VolumeRendering\",\n    defineClass(x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode,\n        \n        /**\n         * Constructor for CartoonVolumeStyle\n         * @constructs x3dom.nodeTypes.CartoonVolumeStyle\n         * @x3d x.x\n         * @component VolumeRendering\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The CartoonVolumeStyle node specifies that the associated volume data shall be rendered with a cartoon style non-photorealistic rendering.\n         * The cartoon styles uses two colors the rendering will depend on the local surface normals and the view direction.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.CartoonVolumeStyle.superClass.call(this, ctx);\n\n\n            /**\n             * The parallelColor field specifies the color to be used when the surface normal is parallel to the view direction.\n             * @var {x3dom.fields.SFColor} parallelColor\n             * @memberof x3dom.nodeTypes.CartoonVolumeStyle\n             * @initvalue 0,0,0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFColor(ctx, 'parallelColor', 0, 0, 0);\n\n            /**\n             * The orthogonalColor field specifies the color to be used when the surface normal is perpendicular to the view direction.\n             * @var {x3dom.fields.SFColor} orthogonalColor\n             * @memberof x3dom.nodeTypes.CartoonVolumeStyle\n             * @initvalue 1,1,1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFColor(ctx, 'orthogonalColor', 1, 1, 1);\n\n            /**\n             * The colorSteps field specifies how many distinct colors are taken from the interpolated colors and used to render the object.\n             * @var {x3dom.fields.SFInt32} colorSteps\n             * @memberof x3dom.nodeTypes.CartoonVolumeStyle\n             * @initvalue 4\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'colorSteps', 4);\n\n            this.uniformParallelColor = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformOrthogonalColor = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformIntColorSteps = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformSampler2DSurfaceNormals = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformBoolEnableCartoon = new x3dom.nodeTypes.Uniform(ctx);\n        \n        },\n        {\n            fieldChanged: function(fieldName){\n                switch(fieldName){\n                    case 'parallelColor':\n                        this.uniformParallelColor._vf.value = this._vf.parallelColor;\n                        this.uniformParallelColor.fieldChanged(\"value\");\n                        break;\n                    case 'orthogonalColor':\n                        this.uniformOrthogonalColor._vf.value = this._vf.orthogonalColor;\n                        this.uniformOrthogonalColor.fieldChanged(\"value\");\n                        break;\n                    case 'colorSteps':\n                        this.uniformIntColorSteps._vf.value = this._vf.colorSteps;\n                        this.uniformIntColorSteps.fieldChanged(\"value\");\n                        break;\n                }\n            },\n\n            uniforms: function(){\n                var unis = [];\n\n                if (this._cf.surfaceNormals.node) {\n                    this.uniformSampler2DSurfaceNormals._vf.name = 'uSurfaceNormals';\n                    this.uniformSampler2DSurfaceNormals._vf.type = 'SFInt32';\n                    this.uniformSampler2DSurfaceNormals._vf.value = this._volumeDataParent._textureID++;\n                    unis.push(this.uniformSampler2DSurfaceNormals);\n                }\n\n                this.uniformParallelColor._vf.name = 'uParallelColor'+this._styleID;\n                this.uniformParallelColor._vf.type = 'SFColor';\n                this.uniformParallelColor._vf.value = this._vf.parallelColor;\n                unis.push(this.uniformParallelColor);\n\n                this.uniformOrthogonalColor._vf.name = 'uOrthogonalColor'+this._styleID;\n                this.uniformOrthogonalColor._vf.type = 'SFColor';\n                this.uniformOrthogonalColor._vf.value = this._vf.orthogonalColor;\n                unis.push(this.uniformOrthogonalColor);\n\n                this.uniformIntColorSteps._vf.name = 'uColorSteps'+this._styleID;\n                this.uniformIntColorSteps._vf.type = 'SFInt32';\n                this.uniformIntColorSteps._vf.value = this._vf.colorSteps;\n                unis.push(this.uniformIntColorSteps);\n\n                this.uniformBoolEnableCartoon._vf.name = 'uEnableCartoon'+this._styleID;\n                this.uniformBoolEnableCartoon._vf.type = 'SFBool';\n                this.uniformBoolEnableCartoon._vf.value = this._vf.enabled;\n                unis.push(this.uniformBoolEnableCartoon);\n\n                return unis;\n            },\n\n            textures: function() {\n                var texs = [];\n                if (this._cf.surfaceNormals.node) {\n                    var tex = this._cf.surfaceNormals.node;\n                    tex._vf.repeatS = false;\n                    tex._vf.repeatT = false;\n                    texs.push(tex);\n                }\n                return texs;\n            },\n\n            styleShaderText: function(){\n                if (this._first){\n                    return \"//Convert RGBA color to HSVA\\n\"+\n                    \"vec4 rgba2hsva(vec4 rgba){\\n\"+\n                    \"   float zat, izen;\\n\"+\n                    \"   float R = rgba.r, G = rgba.g, B = rgba.b;\\n\"+\n                    \"   float minim = min(R, min(G, B)), maxim = max(R, max(G, B));\\n\"+\n                    \"   float delta = maxim-minim;\\n\"+\n                    \"   if(minim == maxim){\\n\"+\n                    \"       return vec4(0.0, 0.0, maxim, rgba.a);\\n\"+\n                    \"   }else{\\n\"+\n                    \"       zat = (R == maxim) ? G - B : ((G == maxim) ? B - R : R - G);\\n\"+ \n                    \"       izen = (R == maxim) ? ((G<B) ? 6.0 : 0.0) : ((G == maxim) ? 2.0 : 4.0);\\n\"+ \n                    \"        return vec4((zat/delta + izen)/6.0, delta/maxim, maxim, rgba.a);\\n\"+ \n                    \"    }\\n\"+\n                    \"}\\n\"+\n                    \"\\n\"+\n                    \"//Convert RGB color to HSV\\n\"+\n                    \"vec3 rgb2hsv(vec3 rgb){\\n\"+\n                    \"    return rgba2hsva(vec4(rgb, 1.0)).rgb;\\n\"+\n                    \"}\\n\"+\n                    \"\\n\"+\n                    \"//Convert HSVA color to RGBA\\n\"+\n                    \"vec4 hsva2rgba(vec4 hsva){\\n\"+\n                    \"   float r, g, b;\\n\"+\n                    \"   float h=hsva.x, s=hsva.y, v=hsva.z;\\n\"+\n                    \"   float i = floor(h * 6.0);\\n\"+\n                    \"   float f = h * 6.0 - i;\\n\"+\n                    \"   float p = v * (1.0 - s);\\n\"+\n                    \"   float q = v * (1.0 - f * s);\\n\"+\n                    \"   float t = v * (1.0 - (1.0 - f) * s);\\n\"+\n                    \"   i = mod(i,6.0);\\n\"+\n                    \"   if( i == 6.0 || i == 0.0 ) r = v, g = t, b = p;\\n\"+\n                    \"   else if( i == 1.0) r = q, g = v, b = p;\\n\"+\n                    \"   else if( i == 2.0) r = p, g = v, b = t;\\n\"+\n                    \"   else if( i == 3.0) r = p, g = q, b = v;\\n\"+\n                    \"   else if( i == 4.0) r = t, g = p, b = v;\\n\"+\n                    \"   else if( i == 5.0) r = v, g = p, b = q;\\n\"+\n                    \"   return vec4(r,g,b,hsva.w);\\n\"+\n                    \"}\\n\"+\n                    \"\\n\"+\n                    \"//Convert HSV color to RGB\\n\"+\n                    \"vec3 hsv2rgb(vec3 hsv){\\n\"+\n                    \"   return hsva2rgba(vec4(hsv, 1.0)).rgb;\\n\"+\n                    \"}\\n\"+\n                    \"void getCartoonStyle(inout vec4 outputColor, vec3 orthogonalColor, vec3 parallelColor, int colorSteps, vec4 surfNormal, vec3 V)\\n\"+\n                    \"{\\n\"+\n                    \"   float steps = clamp(float(colorSteps), 1.0,64.0);\\n\"+\n                    \"   float range_size = pi_half / steps;\\n\"+\n                    \"   float cos_angle = abs(dot(surfNormal.xyz, V));\\n\"+\n                    \"   float interval = clamp(floor(cos_angle / range_size),0.0,steps);\\n\"+\n                    \"   float ang = interval * range_size;\\n\"+\n                    \"   outputColor.rgb = hsv2rgb(mix(orthogonalColor, parallelColor, ang));\\n\"+\n                    \"}\\n\"+\n                    \"\\n\";\n                }else{\n                    return \"\";\n                }\n            },\n\n            styleUniformsShaderText: function(){\n                var styleText = \"uniform vec3 uParallelColor\"+this._styleID+\";\\n\"+\n                \"uniform vec3 uOrthogonalColor\"+this._styleID+\";\\n\"+\n                \"uniform int uColorSteps\"+this._styleID+\";\\n\"+\n                \"uniform bool uEnableCartoon\"+this._styleID+\";\\n\";\n                if (this._first) {\n                    styleText += \"const float pi_half = \"+ (Math.PI/2.0).toPrecision(5) +\";\\n\";\n                }\n                return styleText;\n            },\n\n            inlineStyleShaderText: function(){\n                var inlineText = \"  if(uEnableCartoon\"+this._styleID+\"){\\n\"+\n                \"      getCartoonStyle(value, rgb2hsv(uOrthogonalColor\"+this._styleID+\"), rgb2hsv(uParallelColor\"+this._styleID+\"), uColorSteps\"+this._styleID+\", gradEye, dir);\\n\"+\n                \"  }\\n\";   \n                return inlineText;\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * MEDX3DOM JavaScript Library\n * http://medx3dom.org\n *\n * (C)2011 Vicomtech Research Center,\n *         Donostia - San Sebastian\n * Dual licensed under the MIT and GPL.\n *\n * Based on code originally provided by\n * http://www.x3dom.org\n */\n\n/* ### ComposedVolumeStyle ### */\nx3dom.registerNodeType(\n    \"ComposedVolumeStyle\",\n    \"VolumeRendering\",\n    defineClass(x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode,\n        \n        /**\n         * Constructor for ComposedVolumeStyle\n         * @constructs x3dom.nodeTypes.ComposedVolumeStyle\n         * @x3d x.x\n         * @component VolumeRendering\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The ComposedVolumeStyle node is used to compose multiple rendering styles into a single-rendering pass.\n         * The styles are applied in the same order they are defined on the scene tree.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.ComposedVolumeStyle.superClass.call(this, ctx);\n\n\n            /**\n             * \n             * @var {x3dom.fields.SFBool} ordered\n             * @memberof x3dom.nodeTypes.ComposedVolumeStyle\n             * @initvalue false\n             * @field x3dom\n             * @instance\n             */\n            //this.addField_SFBool(ctx, 'ordered', false);\n\n            /**\n             * The renderStyle field contains a list of composable render styles nodes to be used on the associated volume data.\n             * @var {x3dom.fields.MFNode} renderStyle\n             * @memberof x3dom.nodeTypes.ComposedVolumeStyle\n             * @initvalue x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFNode('renderStyle', x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode);\n            //Using only one normal texture\n            this.normalTextureProvided = false;\n        \n        },\n        {\n            uniforms: function(){\n                var unis = [];\n                var i, n = this._cf.renderStyle.nodes.length;\n                for (i=0; i<n; i++){\n                    //Not repeat common uniforms, TODO: Allow multiple surface normals\n                    var that = this;\n                    Array.forEach(this._cf.renderStyle.nodes[i].uniforms(), function(uniform){\n                        var contains_uniform = false;\n                        Array.forEach(unis, function(accum){\n                            if(accum._vf.name == uniform._vf.name){\n                                contains_uniform = true;\n                            }\n                        });\n                        if (contains_uniform == false){\n                            unis = unis.concat(uniform);\n                        }\n                    });\n                }\n                return unis;\n            },\n\n            textures: function() {\n                var texs = [];\n                var i, n = this._cf.renderStyle.nodes.length;\n                for (i=0; i<n; i++){\n                    //Not repeat same textures, TODO: Allow multiply surface normals textures\n                    Array.forEach(this._cf.renderStyle.nodes[i].textures(), function(texture){\n                        var contains_texture = false;\n                        Array.forEach(texs, function(accum){\n                            if(accum._vf.url[0] == texture._vf.url[0]){\n                                contains_texture = true;\n                            }\n                        });\n                        if (contains_texture == false){\n                            texs = texs.concat(texture);\n                        }\n                    });\n                   \n                }\n                return texs;\n            },\n\n            initializeValues: function() {\n                var initialValues =\"\";\n                var n = this._cf.renderStyle.nodes.length;\n                for (var i=0; i<n; i++){\n                    if(this._cf.renderStyle.nodes[i].initializeValues != undefined){\n                        initialValues += this._cf.renderStyle.nodes[i].initializeValues() + \"\\n\";\n                    }\n                }\n                return initialValues;\n            },\n\n            styleUniformsShaderText: function(){\n                var styleText = \"\";\n                var n = this._cf.renderStyle.nodes.length;\n                if (n == 1 && !x3dom.isa(this._cf.renderStyle.nodes[0], x3dom.nodeTypes.OpacityMapVolumeStyle)){\n                    this.surfaceNormalsNeeded = true;\n                }\n                for (var i=0; i<n; i++){\n                    styleText += this._cf.renderStyle.nodes[i].styleUniformsShaderText() + \"\\n\";\n                    if(this._cf.renderStyle.nodes[i]._cf.surfaceNormals && this._cf.renderStyle.nodes[i]._cf.surfaceNormals.node != null){\n                        this.normalTextureProvided = true;\n                        this._cf.surfaceNormals.node = this._cf.renderStyle.nodes[i]._cf.surfaceNormals.node;\n                    }\n                }\n                return styleText;\n            },\n\n            styleShaderText: function(){\n                var styleText = \"\";\n                var n = this._cf.renderStyle.nodes.length;\n                for (var i=0; i<n; i++){\n                    if(this._cf.renderStyle.nodes[i].styleShaderText != undefined){\n                        styleText += this._cf.renderStyle.nodes[i].styleShaderText() + \"\\n\";\n                    }\n                }\n                return styleText;\n            },\n\n            inlineStyleShaderText: function(){\n                var inlineText = \"\";\n                var n = this._cf.renderStyle.nodes.length;\n                for (var i=0; i<n; i++){\n                    inlineText += this._cf.renderStyle.nodes[i].inlineStyleShaderText();\n                }\n                /*if(x3dom.nodeTypes.X3DLightNode.lightID>0){\n                    inlineText += this._cf.renderStyle.nodes[0].lightAssigment();\n                }*/\n                return inlineText;\n            },\n\n            lightAssigment: function(){\n                var isBlendedStyle = false;\n                var blendedLightAssigmentText;\n                //Check if there is a blendedStyle, not to use lightAssigment\n                Array.forEach(this._cf.renderStyle.nodes, function(style){\n                    if(x3dom.isa(style, x3dom.nodeTypes.BlendedVolumeStyle)){\n                        isBlendedStyle = true;\n                        blendedLightAssigmentText = style.lightAssigment();\n                    }\n                });\n                if(!isBlendedStyle){\n                    return this._cf.renderStyle.nodes[0].lightAssigment();\n                }else{\n                    return this._cf.renderStyle.nodes[0].lightAssigment()+blendedLightAssigmentText;\n                }\n            },\n\n            lightEquationShaderText: function(){\n                return this._cf.renderStyle.nodes[0].lightEquationShaderText();\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * MEDX3DOM JavaScript Library\n * http://medx3dom.org\n *\n * (C)2011 Vicomtech Research Center,\n *         Donostia - San Sebastian\n * Dual licensed under the MIT and GPL.\n *\n * Based on code originally provided by\n * http://www.x3dom.org\n */\n\n/* ### EdgeEnhancementVolumeStyle ### */\nx3dom.registerNodeType(\n    \"EdgeEnhancementVolumeStyle\",\n    \"VolumeRendering\",\n    defineClass(x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode,\n        \n        /**\n         * Constructor for EdgeEnhancementVolumeStyle\n         * @constructs x3dom.nodeTypes.EdgeEnhancementVolumeStyle\n         * @x3d x.x\n         * @component VolumeRendering\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * The EdgeEnhancementVolumeStyle node specifies that the edges of the assocciated volume data shall be enhanced.\n         * The edge enhancement is performed by changing the color of the edges to the specified one.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.EdgeEnhancementVolumeStyle.superClass.call(this, ctx);\n\n\n            /**\n             * The edgeColor field specifies the color to be used for the edge enhacement.\n             * @var {x3dom.fields.SFColor} edgeColor\n             * @memberof x3dom.nodeTypes.EdgeEnhancementVolumeStyle\n             * @initvalue 0,0,0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFColor(ctx, 'edgeColor', 0, 0, 0);\n\n            /**\n             * The gradientThreshold field is used to adjust the edge detection.\n             * @var {x3dom.fields.SFFloat} gradientThreshold\n             * @memberof x3dom.nodeTypes.EdgeEnhancementVolumeStyle\n             * @initvalue 0.4\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'gradientThreshold', 0.4);\n\n            this.uniformColorEdgeColor = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformFloatGradientThreshold = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformSampler2DSurfaceNormals = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformBoolEdgeEnable = new x3dom.nodeTypes.Uniform(ctx);\n            \n        },\n        {\n            fieldChanged: function(fieldName){\n                if (fieldName == \"edgeColor\") {\n                    this.uniformColorEdgeColor._vf.value = this._vf.edgeColor;\n                    this.uniformColorEdgeColor.fieldChanged(\"value\");\n                }else if (fieldName == \"gradientThreshold\") {\n                    this.uniformFloatGradientThreshold._vf.value = this._vf.gradientThreshold;\n                    this.uniformFloatGradientThreshold.fieldChanged(\"value\");\n                }\n            },\n\n            uniforms: function(){\n                var unis = [];\n                \n                if (this._cf.surfaceNormals.node) {\n                    this.uniformSampler2DSurfaceNormals._vf.name = 'uSurfaceNormals';\n                    this.uniformSampler2DSurfaceNormals._vf.type = 'SFInt32';\n                    this.uniformSampler2DSurfaceNormals._vf.value = this._volumeDataParent._textureID++;\n                    unis.push(this.uniformSampler2DSurfaceNormals);\n                }\n\n                this.uniformColorEdgeColor._vf.name = 'uEdgeColor'+this._styleID;\n                this.uniformColorEdgeColor._vf.type = 'SFColor';\n                this.uniformColorEdgeColor._vf.value = this._vf.edgeColor;\n                unis.push(this.uniformColorEdgeColor);\n\n                this.uniformFloatGradientThreshold._vf.name = 'uGradientThreshold'+this._styleID;\n                this.uniformFloatGradientThreshold._vf.type = 'SFFloat';\n                this.uniformFloatGradientThreshold._vf.value = this._vf.gradientThreshold;\n                unis.push(this.uniformFloatGradientThreshold);\n\n                this.uniformBoolEdgeEnable._vf.name = 'uEnableEdge'+this._styleID;\n                this.uniformBoolEdgeEnable._vf.type = 'SFBool';\n                this.uniformBoolEdgeEnable._vf.value = this._vf.enabled;\n                unis.push(this.uniformBoolEdgeEnable);\n                return unis;\n            },\n\n            textures: function() {\n                var texs = [];\n                if (this._cf.surfaceNormals.node) {\n                    var tex = this._cf.surfaceNormals.node;\n                    tex._vf.repeatS = false;\n                    tex._vf.repeatT = false;\n                    texs.push(tex)\n                }\n                return texs;\n            },\n\n            styleUniformsShaderText: function(){\n                return \"uniform vec3 uEdgeColor\"+this._styleID+\";\\n\"+\n                    \"uniform float uGradientThreshold\"+this._styleID+\";\\n\"+\n                    \"uniform bool uEnableEdge\"+this._styleID+\";\\n\";\n            },\n\n            styleShaderText: function(){\n                if (this._first){\n                    return \"void edgeEnhancement(inout vec4 originalColor, in vec4 gradient, in vec3 V, in vec3 edgeColor, in float gradientT)\\n\"+\n                    \"{\\n\"+\n                    \"   if(gradient.a > 0.05){\\n\"+\n                    \"       float angle_dif = abs(dot(gradient.xyz,V));\\n\"+\n                    //\"       float br = clamp(sign(cos(gradientT)-angle_dif),0.0,1.0);\\n\"+\n                    \"       if(angle_dif > cos(gradientT)){\\n\"+\n                    \"           originalColor.rgb = mix(edgeColor, originalColor.rgb, angle_dif);\\n\"+\n                    \"       }\\n\"+\n                    \"   }\\n\"+\n                    \"}\\n\";\n                }else{\n                    return \"\";\n                }\n            },\n\n            inlineStyleShaderText: function(){\n                var inlineText = \"   if(uEnableEdge\"+this._styleID+\"){\\n\"+\n                \"       edgeEnhancement(value, gradEye, dir, uEdgeColor\"+this._styleID+\", uGradientThreshold\"+this._styleID+\");\\n\"+\n                \"   }\\n\";\n                return inlineText;\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * MEDX3DOM JavaScript Library\n * http://medx3dom.org\n *\n * (C)2011 Vicomtech Research Center,\n *         Donostia - San Sebastian\n * Dual licensed under the MIT and GPL.\n *\n * Based on code originally provided by\n * http://www.x3dom.org\n */\n\n/* ### IsoSurfaceVolumeData ### */\nx3dom.registerNodeType(\n    \"IsoSurfaceVolumeData\",\n    \"VolumeRendering\",\n    defineClass(x3dom.nodeTypes.X3DVolumeDataNode,\n        \n        /**\n         * Constructor for IsoSurfaceVolumeData\n         * @constructs x3dom.nodeTypes.IsoSurfaceVolumeData\n         * @x3d x.x\n         * @component VolumeRendering\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DVolumeDataNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The IsoSurfaceVolumeData node specifies one or more surfaces to be extracted from the volume data.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.IsoSurfaceVolumeData.superClass.call(this, ctx);\n\n\n            /**\n             * The renderStyle field contains a list of volume render style nodes to be used on each isosurface.\n             * @var {x3dom.fields.MFNode} renderStyle\n             * @memberof x3dom.nodeTypes.IsoSurfaceVolumeData\n             * @initvalue x3dom.nodeTypes.X3DVolumeRenderStyleNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFNode('renderStyle', x3dom.nodeTypes.X3DVolumeRenderStyleNode);\n\n            /**\n             * The gradients field allows to provide the normals of the volume data. It takes an ImageTextureAtlas of the same dimensions of the volume data. If it is not provided, it is computed on the fly.\n             * @var {x3dom.fields.SFNode} gradients\n             * @memberof x3dom.nodeTypes.IsoSurfaceVolumeData\n             * @initvalue x3dom.nodeTypes.Texture\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('gradients', x3dom.nodeTypes.Texture);\n            //this.addField_SFNode('gradients', x3dom.nodeTypes.X3DTexture3DNode);\n\n            /**\n             * The surfaceValues field is a list containing the surface values to be extracted. One or multiple isovalues can be declared.\n             * @var {x3dom.fields.MFFloat} surfaceValues\n             * @memberof x3dom.nodeTypes.IsoSurfaceVolumeData\n             * @initvalue [0.0]\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFFloat(ctx, 'surfaceValues', [0.0]);\n\n            /**\n             * The countourStepSize field specifies an step size to render isosurfaces that are multiples of an initial isovalue.\n             * When this field is non-zero a single isovalue must be defined on the surfaceValues field.\n             * @var {x3dom.fields.SFFloat} contourStepSize\n             * @memberof x3dom.nodeTypes.IsoSurfaceVolumeData\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'contourStepSize', 0);\n\n            /**\n             * The surfaceTolerance field is a threshold to adjust the boundary of the isosurface.\n             * @var {x3dom.fields.SFFloat} surfaceTolerance\n             * @memberof x3dom.nodeTypes.IsoSurfaceVolumeData\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'surfaceTolerance', 0);\n\n            this.uniformSampler2DGradients = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformFloatContourStepSize = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformFloatSurfaceTolerance = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformFloatArraySurfaceValues = new x3dom.nodeTypes.Uniform(ctx);\n\n            this.vrcMultiTexture = new x3dom.nodeTypes.MultiTexture(ctx);\n            this.vrcVolumeTexture = null;\n\n            this.vrcSinglePassShader = new x3dom.nodeTypes.ComposedShader(ctx);\n            this.vrcSinglePassShaderVertex = new x3dom.nodeTypes.ShaderPart(ctx);\n            this.vrcSinglePassShaderFragment = new x3dom.nodeTypes.ShaderPart(ctx);\n            this.vrcSinglePassShaderFieldVolData = new x3dom.nodeTypes.Field(ctx);\n            this.vrcSinglePassShaderFieldOffset = new x3dom.nodeTypes.Field(ctx);\n            this.vrcSinglePassShaderFieldDimensions = new x3dom.nodeTypes.Field(ctx);\n        },\n        {\n            fieldChanged: function(fieldName){\n                switch(fieldName){\n                    case 'surfaceValues':\n                        this.uniformFloatArraySurfaceValues._vf.value = this._vf.surfaceValues;\n                        this.uniformFloatArraySurfaceValues.fieldChanged(\"value\");\n                        //TODO: Reload node\n                        break;\n                    case 'surfaceTolerance':\n                        this.uniformFloatSurfaceTolerance._vf.value = this._vf.surfaceTolerance;\n                        this.uniformFloatSurfaceTolerance.fieldChanged(\"value\");\n                        break;\n                    case 'contourStepSize':\n                        //TODO: Reload node\n                        break;\n                }\n            },\n\n            uniforms: function(){\n                var unis = [];\n                if (this._cf.gradients.node){\n                    this.uniformSampler2DGradients._vf.name = 'uSurfaceNormals';\n                    this.uniformSampler2DGradients._vf.type = 'SFInt32';\n                    this.uniformSampler2DGradients._vf.value = this._textureID++;\n                    unis.push(this.uniformSampler2DGradients);\n                }\n\n                this.uniformFloatArraySurfaceValues._vf.name = 'uSurfaceValues';\n                this.uniformFloatArraySurfaceValues._vf.type = 'MFFloat';\n                this.uniformFloatArraySurfaceValues._vf.value = this._vf.surfaceValues;\n                unis.push(this.uniformFloatArraySurfaceValues);\n\n                this.uniformFloatSurfaceTolerance._vf.name = 'uSurfaceTolerance';\n                this.uniformFloatSurfaceTolerance._vf.type = 'MFFloat';\n                this.uniformFloatSurfaceTolerance._vf.value = this._vf.surfaceTolerance;\n                unis.push(this.uniformFloatSurfaceTolerance);\n\n                if (this._cf.renderStyle.nodes) {\n                    var n = this._cf.renderStyle.nodes.length;\n                    for (var i=0; i<n; i++){\n                        //Not repeat common uniforms, TODO: Allow multiple surface normals\n                        Array.forEach(this._cf.renderStyle.nodes[i].uniforms(), function(uniform){\n                            var contains_uniform = false;\n                            Array.forEach(unis, function(accum){\n                                if(accum._vf.name == uniform._vf.name){\n                                    contains_uniform = true;\n                                }\n                            });\n                            if (contains_uniform == false){\n                                unis = unis.concat(uniform);\n                            }\n                        });\n                    }    \n                }\n                return unis;\n            },\n\n            textures: function(){\n                var texs = [];\n                if(this._cf.gradients.node){\n                    var tex = this._cf.gradients.node;\n                    tex._vf.repeatS = false;\n                    tex._vf.repeatT = false;\n                    texs.push(tex);\n                }\n\n                var i, n = this._cf.renderStyle.nodes.length;\n                for (i=0; i<n; i++){\n                    //Not repeat same textures, TODO: Allow multiply surface normals textures\n                    Array.forEach(this._cf.renderStyle.nodes[i].textures(), function(texture){\n                        var contains_texture = false;\n                        Array.forEach(texs, function(accum){\n                            if(accum._vf.url[0] == texture._vf.url[0]){\n                                contains_texture = true;\n                            }\n                        });\n                        if (contains_texture == false){\n                            texs = texs.concat(texture);\n                        }\n                    });\n                }\n                return texs;\n            },\n\n            initializeValues: function() {\n                var initialValues =\"  float previous_value = 0.0;\\n\";\n                var n = this._cf.renderStyle.nodes.length;\n                for (var i=0; i<n; i++){\n                    if(this._cf.renderStyle.nodes[i].initializeValues != undefined){\n                        initialValues += this._cf.renderStyle.nodes[i].initializeValues() + \"\\n\";\n                    }\n                }\n                return initialValues;\n            },\n\n            styleUniformsShaderText: function(){\n                var styleText = \"uniform float uSurfaceTolerance;\\n\"+\n                \"uniform float uSurfaceValues[\"+this._vf.surfaceValues.length+\"];\\n\";\n                if(this._cf.gradients.node){\n                    styleText += \"uniform sampler2D uSurfaceNormals;\\n\";\n                }\n                var n = this._cf.renderStyle.nodes.length;\n                for (var i=0; i<n; i++){\n                    styleText += this._cf.renderStyle.nodes[i].styleUniformsShaderText() + \"\\n\";\n                    if(this._cf.renderStyle.nodes[i]._cf.surfaceNormals && this._cf.renderStyle.nodes[i]._cf.surfaceNormals.node != null){\n                        this.normalTextureProvided = true;\n                        this.surfaceNormals = this._cf.renderStyle.nodes[i]._cf.surfaceNormals.node;\n                    }\n                }\n                //Always needed for the isosurface\n                this.surfaceNormalsNeeded = true;   \n                return styleText;\n            },\n\n            inlineStyleShaderText: function(){\n                var inlineText = \"    sample = value.r;\\n\";\n                if(this._vf.surfaceValues.length == 1) { //Only one surface value\n                    if(this._vf.contourStepSize == 0.0){\n                        inlineText += \"   if(((sample>=uSurfaceValues[0] && previous_value<uSurfaceValues[0])||(sample<uSurfaceValues[0] && previous_value>=uSurfaceValues[0])) && (grad.a>=uSurfaceTolerance)){\\n\"+\n                        \"       value = vec4(vec3(uSurfaceValues[0]),1.0);\\n\";\n                        if(this._cf.renderStyle.nodes){\n                            inlineText += this._cf.renderStyle.nodes[0].inlineStyleShaderText();\n                        }\n                        inlineText += \"       accum.rgb += (1.0 - accum.a) * (value.rgb * value.a);\\n\"+\n                        \"       accum.a += (1.0 - accum.a) * value.a;\\n\"+\n                        \"   }\\n\"; \n                    }else{ //multiple iso values with the contour step size\n                        var tmp = this._vf.surfaceValues[0];\n                        var positive_range = [tmp];\n                        var negative_range = [];\n                        var range = [];\n                        while(tmp+this._vf.contourStepSize <= 1.0){\n                            tmp+=this._vf.contourStepSize;\n                            positive_range.push(tmp);\n                        }\n                        tmp = this._vf.surfaceValues[0];\n                        while(tmp-this._vf.contourStepSize >= 0.0){\n                            tmp-=this._vf.contourStepSize;\n                            negative_range.unshift(tmp);\n                        }\n                        range = negative_range.concat(positive_range);\n                        for (var i = 0; i <= range.length - 1; i++) {\n                            var s_value = range[i].toPrecision(3);\n                            inlineText += \" if(((sample>=\"+s_value+\" && previous_value<\"+s_value+\")||(sample<\"+s_value+\" && previous_value>=\"+s_value+\")) && (grad.a>=uSurfaceTolerance)){\\n\"+\n                            \"       value = vec4(vec3(\"+s_value+\"),1.0);\\n\";\n                            if(this._cf.renderStyle.nodes){\n                                inlineText += this._cf.renderStyle.nodes[0].inlineStyleShaderText();\n                            }\n                            inlineText += \"       accum.rgb += (1.0 - accum.a) * (value.rgb * value.a);\\n\"+\n                            \"       accum.a += (1.0 - accum.a) * value.a;\\n\"+\n                            \"   }\\n\"; \n                        };\n                    }\n                }else{ //Multiple isosurface values had been specified by the user\n                    var n_styles = this._cf.renderStyle.nodes.length-1;\n                    var s_values = this._vf.surfaceValues.length;\n                    for(var i=0; i<s_values; i++){\n                        var index = Math.min(i, n_styles);\n                        inlineText += \"   if(((sample>=uSurfaceValues[\"+i+\"] && previous_value<uSurfaceValues[\"+i+\"])||(sample<uSurfaceValues[\"+i+\"] && previous_value>=uSurfaceValues[\"+i+\"])) && (grad.a>=uSurfaceTolerance)){\\n\"+\n                        \"       value = vec4(vec3(uSurfaceValues[\"+i+\"]),1.0);\\n\";\n                        if(this._cf.renderStyle.nodes){\n                            inlineText += this._cf.renderStyle.nodes[index].inlineStyleShaderText();\n                        }\n                        inlineText += \"   accum.rgb += (1.0 - accum.a) * (value.rgb * value.a);\\n\"+\n                        \"   accum.a += (1.0 - accum.a) * value.a;\\n\"+\n                        \"   }\\n\"; \n                    }\n                }\n                inlineText += \"    previous_value = sample;\\n\";\n                return inlineText;\n            },\n\n            styleShaderText: function(){\n                var styleText = \"\";\n                var n = this._cf.renderStyle.nodes.length;\n                for (var i=0; i<n; i++){\n                    if(this._cf.renderStyle.nodes[i].styleShaderText != undefined){\n                        styleText += this._cf.renderStyle.nodes[i].styleShaderText()+\"\\n\";\n                    }\n                }\n                return styleText;\n            },\n\n            lightAssigment: function(){\n                return this._cf.renderStyle.nodes[0].lightAssigment();\n            },\n\n            lightEquationShaderText: function(){ //TODO: ligth equation per isosurface?\n                return this._cf.renderStyle.nodes[0].lightEquationShaderText();\n            },\n\n            nodeChanged: function()\n            {\n                if (!this._cf.appearance.node) \n                {\n                    var i;\n\n                    this.addChild(new x3dom.nodeTypes.Appearance());\n                    \n                    // create shortcut to volume data set\n                    this.vrcVolumeTexture = this._cf.voxels.node;\n                    this.vrcVolumeTexture._vf.repeatS = false;\n                    this.vrcVolumeTexture._vf.repeatT = false;\n\n                    this.vrcMultiTexture._nameSpace = this._nameSpace;\n                    \n                    this.vrcMultiTexture.addChild(this.vrcVolumeTexture, 'texture');\n                    this.vrcVolumeTexture.nodeChanged();\n                    \n                    // textures from styles\n                    var styleTextures = this.textures();\n                    for (i = 0; i<styleTextures.length; i++)\n                    {\n                        this.vrcMultiTexture.addChild(styleTextures[i], 'texture');\n                        this.vrcVolumeTexture.nodeChanged();\n                    }\n                    \n                    this._cf.appearance.node.addChild(this.vrcMultiTexture);\n                    this.vrcMultiTexture.nodeChanged();\n                    \n                    //Update child node properties\n                    for (var i = 0; i < this._cf.renderStyle.nodes.length; i++) {\n                        this._cf.renderStyle.nodes[i].updateProperties(this);\n                    }\n                    \n                    // here goes the volume shader\n                    this.vrcSinglePassShaderVertex._vf.type = 'vertex';\n                    this.vrcSinglePassShaderVertex._vf.url[0] = this.vertexShaderText();;\n\n                    this.vrcSinglePassShaderFragment._vf.type = 'fragment';\n                    var shaderText =\n                        this.fragmentPreamble+\n                        this.defaultUniformsShaderText(this.vrcVolumeTexture._vf.numberOfSlices, this.vrcVolumeTexture._vf.slicesOverX, this.vrcVolumeTexture._vf.slicesOverY)+\n                        this.styleUniformsShaderText()+\n                        this.styleShaderText()+\n                        this.texture3DFunctionShaderText+\n                        this.normalFunctionShaderText()+\n                        this.lightEquationShaderText();\n                    shaderText += \"void main()\\n\"+\n                    \"{\\n\"+\n                    \"  vec3 cam_pos = vec3(modelViewMatrixInverse[3][0], modelViewMatrixInverse[3][1], modelViewMatrixInverse[3][2]);\\n\"+\n                    \"  vec3 cam_cube = cam_pos/dimensions+0.5;\\n\"+\n                    \"  vec3 dir = normalize(pos.xyz-cam_cube);\\n\";\n                    if(this._vf.allowViewpointInside){\n                        shaderText +=\n                        \"  float cam_inside = float(all(bvec2(all(lessThan(cam_cube, vec3(1.0))),all(greaterThan(cam_cube, vec3(0.0))))));\\n\"+\n                        \"  vec3 ray_pos = mix(pos.xyz, cam_cube, cam_inside);\\n\";\n                    }else{\n                        shaderText += \"  vec3 ray_pos = pos.xyz;\\n\";\n                    }\n                    shaderText +=\n                    \"  vec4 accum  = vec4(0.0, 0.0, 0.0, 0.0);\\n\"+\n                    \"  float sample = 0.0;\\n\"+\n                    \"  vec4 value  = vec4(0.0, 0.0, 0.0, 0.0);\\n\"+\n                    \"  float cont = 0.0;\\n\"+\n                    \"  vec3 step = dir/Steps;\\n\";\n                    //Light init values\n                    if(x3dom.nodeTypes.X3DLightNode.lightID>0){\n                        shaderText +=\n                        \"  vec3 ambient = vec3(0.0, 0.0, 0.0);\\n\"+\n                        \"  vec3 diffuse = vec3(0.0, 0.0, 0.0);\\n\"+\n                        \"  vec3 specular = vec3(0.0, 0.0, 0.0);\\n\"+\n                        \"  vec4 step_eye = modelViewMatrix * vec4(step, 0.0);\\n\"+\n                        \"  vec4 positionE = position_eye;\\n\"+\n                        \"  float lightFactor = 1.0;\\n\"; \n                    }else{\n                        shaderText += \"  float lightFactor = 1.2;\\n\";\n                    }\n                    shaderText += this.initializeValues()+\n                    \"  float opacityFactor = 6.0;\\n\"+\n                    \"  float t_near;\\n\"+\n                    \"  float t_far;\\n\"+\n                    \"  for(float i = 0.0; i < Steps; i+=1.0)\\n\"+\n                    \"  {\\n\"+\n                    \"    value = cTexture3D(uVolData, ray_pos, numberOfSlices, slicesOverX, slicesOverY);\\n\"+\n                    \"    value = value.rgbr;\\n\";\n                    if(this._cf.gradients.node){\n                        shaderText += \"    vec4 gradEye = getNormalFromTexture(uSurfaceNormals, ray_pos, numberOfSlices, slicesOverX, slicesOverY);\\n\";\n                    }else{\n                        shaderText += \"    vec4 gradEye = getNormalOnTheFly(uVolData, ray_pos, numberOfSlices, slicesOverX, slicesOverY);\\n\";\n                    }\n                    shaderText += \"    vec4 grad = vec4((modelViewMatrix * vec4(gradEye.xyz, 0.0)).xyz, gradEye.a);\\n\";\n                    for(var l=0; l<x3dom.nodeTypes.X3DLightNode.lightID; l++) {\n                        shaderText += \"    lighting(light\"+l+\"_Type, \" +\n                        \"light\"+l+\"_Location, \" +\n                        \"light\"+l+\"_Direction, \" +\n                        \"light\"+l+\"_Color, \" + \n                        \"light\"+l+\"_Attenuation, \" +\n                        \"light\"+l+\"_Radius, \" +\n                        \"light\"+l+\"_Intensity, \" + \n                        \"light\"+l+\"_AmbientIntensity, \" +\n                        \"light\"+l+\"_BeamWidth, \" +\n                        \"light\"+l+\"_CutOffAngle, \" +\n                        \"grad.xyz, positionE.xyz, ambient, diffuse, specular);\\n\";\n                    }\n                    shaderText += this.inlineStyleShaderText();\n                    if(x3dom.nodeTypes.X3DLightNode.lightID>0){\n                        shaderText += this.lightAssigment();\n                    }\n                    shaderText +=\n                    \"    //advance the current position\\n\"+\n                    \"    ray_pos.xyz += step;\\n\";\n                    if(x3dom.nodeTypes.X3DLightNode.lightID>0){\n                        shaderText +=\"    positionE += step_eye;\\n\";\n                    }\n                    shaderText +=\n                    \"    //break if the position is greater than <1, 1, 1>\\n\"+\n                    \"    if(ray_pos.x > 1.0 || ray_pos.y > 1.0 || ray_pos.z > 1.0 || ray_pos.x <= 0.0 || ray_pos.y <= 0.0 || ray_pos.z <= 0.0 || accum.a>=1.0)\\n\"+\n                    \"      break;\\n\"+\n                    \"  }\\n\"+\n                    \"  gl_FragColor = accum;\\n\"+\n                    \"}\";\n                    this.vrcSinglePassShaderFragment._vf.url[0] = shaderText;\n\n                    this.vrcSinglePassShader.addChild(this.vrcSinglePassShaderVertex, 'parts');\n                    this.vrcSinglePassShaderVertex.nodeChanged();\n                    \n                    this.vrcSinglePassShader.addChild(this.vrcSinglePassShaderFragment, 'parts');\n                    this.vrcSinglePassShaderFragment.nodeChanged();\n\n                    this.vrcSinglePassShaderFieldVolData._vf.name = 'uVolData';\n                    this.vrcSinglePassShaderFieldVolData._vf.type = 'SFInt32';\n                    this.vrcSinglePassShaderFieldVolData._vf.value = this._textureID++;\n\n                    this.vrcSinglePassShaderFieldDimensions._vf.name = 'dimensions';\n                    this.vrcSinglePassShaderFieldDimensions._vf.type = 'SFVec3f';\n                    this.vrcSinglePassShaderFieldDimensions._vf.value = this._vf.dimensions;\n                    \n                    this.vrcSinglePassShaderFieldOffset._vf.name = 'offset';\n                    this.vrcSinglePassShaderFieldOffset._vf.type = 'SFVec3f';\n                    this.vrcSinglePassShaderFieldOffset._vf.value = \"0.01 0.01 0.01\"; //Default initial value\n                    \n                    this.vrcSinglePassShader.addChild(this.vrcSinglePassShaderFieldVolData, 'fields');\n                    this.vrcSinglePassShaderFieldVolData.nodeChanged();\n\n                    this.vrcSinglePassShader.addChild(this.vrcSinglePassShaderFieldDimensions, 'fields');\n                    this.vrcSinglePassShaderFieldDimensions.nodeChanged();\n\n                    this.vrcSinglePassShader.addChild(this.vrcSinglePassShaderFieldOffset, 'fields');\n \n                    //Take volume texture size for the ComposableRenderStyles offset parameter\n                    this.offsetInterval = window.setInterval((function(aTex, obj) {\n                        return function() {\n                            x3dom.debug.logInfo('[VolumeRendering][IsoSurfaceVolumeData] Looking for Volume Texture size...');\n                            var s = obj.getTextureSize(aTex);\n                            if(s.valid){\n                                clearInterval(obj.offsetInterval);\n                                obj.vrcSinglePassShaderFieldOffset._vf.value = new x3dom.fields.SFVec3f(1.0/(s.w/aTex._vf.slicesOverX), 1.0/(s.h/aTex._vf.slicesOverY), 1.0/aTex._vf.numberOfSlices);\n                                obj.vrcSinglePassShader.nodeChanged();\n                                x3dom.debug.logInfo('[VolumeRendering][IsoSurfaceVolumeData] Volume Texture size obtained');\n                            }\n                        }\n                    })(this.vrcVolumeTexture, this), 1000);\n\n                    var ShaderUniforms = this.uniforms();\n                    for (i = 0; i<ShaderUniforms.length; i++)\n                    {\n                        this.vrcSinglePassShader.addChild(ShaderUniforms[i], 'fields');\n                    }\n                \n                    this._cf.appearance.node.addChild(this.vrcSinglePassShader);\n                    this.vrcSinglePassShader.nodeChanged();\n                    \n                    this._cf.appearance.node.nodeChanged();\n                }\n\n                if (!this._cf.geometry.node) {\n                    this.addChild(new x3dom.nodeTypes.Box());\n\n                    this._cf.geometry.node._vf.solid = false;\n                    this._cf.geometry.node._vf.hasHelperColors = false;\n                    this._cf.geometry.node._vf.size = new x3dom.fields.SFVec3f(\n                        this._vf.dimensions.x, this._vf.dimensions.y, this._vf.dimensions.z);\n\n                    // workaround to trigger field change...\n                    this._cf.geometry.node.fieldChanged(\"size\");\n                }\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * MEDX3DOM JavaScript Library\n * http://medx3dom.org\n *\n * (C)2011 Vicomtech Research Center,\n *         Donostia - San Sebastian\n * Dual licensed under the MIT and GPL.\n *\n * Based on code originally provided by\n * http://www.x3dom.org\n */\n\n/* ### MPRVolumeStyle ### */\nx3dom.registerNodeType(\n    \"MPRVolumeStyle\",\n    \"VolumeRendering\",\n    defineClass(x3dom.nodeTypes.X3DVolumeRenderStyleNode,\n\n        /**\n         * Constructor for MPRVolumeStyle\n         * @constructs x3dom.nodeTypes.MPRVolumeStyle\n         * @x3d x.x\n         * @component VolumeRendering\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DVolumeRenderStyleNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The MPRVolumeStyle node renders a multiplanar reconstruction of the assocciated volume data.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.MPRVolumeStyle.superClass.call(this, ctx);\n\n            /**\n             * The transferFunction field is a texture that is going to be used to map each voxel value to a specific color output.\n             * @var {x3dom.fields.SFNode} transferFunction\n             * @memberof x3dom.nodeTypes.MPRVolumeStyle\n             * @initvalue x3dom.nodeTypes.Texture\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('transferFunction', x3dom.nodeTypes.Texture);\n\n            /**\n             * The forceOpaque field is a boolean flag that forces the reconstructed planes to be opaque, if false the opacity (alpha channel) from the transferFunction field will be applied.\n             * @var {x3dom.fields.SFBool} forceOpaque\n             * @memberof x3dom.nodeTypes.MPRVolumeStyle\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'forceOpaque', true);\n\n            /**\n             * The renderStyle field contains a list of composable render styles nodes to be used on the associated volume data.\n             * @var {x3dom.fields.MFNode} planes\n             * @memberof x3dom.nodeTypes.MPRVolumeStyle\n             * @initvalue x3dom.nodeTypes.MPRPlane\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFNode('planes', x3dom.nodeTypes.MPRPlane);\n\n            this.uniformSampler2DTransferFunction = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformBoolForceOpaque = new x3dom.nodeTypes.Uniform(ctx);\n        },\n        {\n            fieldChanged: function(fieldName) {\n                 switch(fieldName){\n                    case 'forceOpaque':\n                        this.uniformBoolForceOpaque._vf.value = this._vf.forceOpaque;\n                        this.uniformBoolForceOpaque.fieldChanged(\"value\");\n                        break;\n                }\n            },\n\n            uniforms: function() {\n                var unis = [];\n\n                if (this._cf.transferFunction.node) {\n                    this.uniformSampler2DTransferFunction._vf.name = 'uTransferFunction';\n                    this.uniformSampler2DTransferFunction._vf.type = 'SFInt32';\n                    this.uniformSampler2DTransferFunction._vf.value = this._volumeDataParent._textureID++;\n                    unis.push(this.uniformSampler2DTransferFunction);\n                }\n\n                this.uniformBoolForceOpaque._vf.name = 'forceOpaque';\n                this.uniformBoolForceOpaque._vf.type = 'SFBool';\n                this.uniformBoolForceOpaque._vf.value = this._vf.forceOpaque;\n                unis.push(this.uniformBoolForceOpaque);\n\n                var i, n = this._cf.planes.nodes.length;\n                for (i=0; i<n; i++){\n                    //Not repeat common uniforms, TODO: Allow multiple surface normals\n                    var that = this;\n                    Array.forEach(this._cf.planes.nodes[i].uniforms(), function(uniform){\n                        var contains_uniform = false;\n                        Array.forEach(unis, function(accum){\n                            if(accum._vf.name == uniform._vf.name){\n                                contains_uniform = true;\n                            }\n                        });\n                        if (contains_uniform == false){\n                            unis = unis.concat(uniform);\n                        }\n                    });\n                }\n                return unis;\n            },\n\n            textures: function() {\n                var texs = [];\n                var tex = this._cf.transferFunction.node;\n                if (tex) {\n                    tex._vf.repeatS = false;\n                    tex._vf.repeatT = false;\n                    texs.push(tex);\n                }\n                return texs;\n            },\n\n            styleUniformsShaderText: function(){\n                var uniformShaderText = \"uniform bool forceOpaque;\\n\";\n                if (this._cf.transferFunction.node) {\n                    uniformShaderText += \"uniform sampler2D uTransferFunction;\\n\";\n                }\n                for (let i=0; i<this._cf.planes.nodes.length; i++){\n                  uniformShaderText += this._cf.planes.nodes[i].styleUniformsShaderText();\n                }\n                return uniformShaderText;\n            },\n\n            fragmentShaderText : function (numberOfSlices, slicesOverX, slicesOverY) {\n                var shader =\n                this._parentNodes[0].fragmentPreamble+\n                this._parentNodes[0].defaultUniformsShaderText(numberOfSlices, slicesOverX, slicesOverY)+\n                this.styleUniformsShaderText()+\n                this._parentNodes[0].texture3DFunctionShaderText+\n                \"void main()\\n\"+\n                \"{\\n\"+\n                \"  vec3 cam_pos = vec3(modelViewMatrixInverse[3][0], modelViewMatrixInverse[3][1], modelViewMatrixInverse[3][2]);\\n\"+\n                \"  cam_pos = cam_pos/dimensions+0.5;\\n\"+\n                \"  vec3 dir = normalize(pos.xyz-cam_pos);\\n\"+\n                \"  float cam_inside = float(all(bvec2(all(lessThan(cam_pos, vec3(1.0))),all(greaterThan(cam_pos, vec3(0.0))))));\\n\"+\n                \"  vec3 ray_pos = mix(pos.xyz, cam_pos, cam_inside);\\n\"+\n                \"  float d = 1000.0;\";\n                for (let i=0; i<this._cf.planes.nodes.length; i++){\n                  shader += this._cf.planes.nodes[i].styleShaderText();\n                }\n                shader += \"  vec4 color = vec4(0.0,0.0,0.0,0.0);\\n\"+\n                \"  vec3 pos = d*dir+ray_pos;\\n\"+\n                \"  if (!(any(bvec2(any(lessThan(pos.xyz, vec3(0.0))),any(greaterThan(pos.xyz, vec3(1.0))))))){\\n\"+\n                \"    pos = clamp(pos, vec3(0.0), vec3(1.0));\\n\"+\n                \"    vec4 intesity = cTexture3D(uVolData,pos.rgb,numberOfSlices,slicesOverX,slicesOverY);\\n\";\n                if (this._cf.transferFunction.node){\n                    shader += \"    if (forceOpaque){\\n\"+\n                    \"      color = vec4(texture2D(uTransferFunction, vec2(intesity.r,0.5)).rgb, 1.0);\\n\"+\n                    \"    }else{\\n\"+\n                    \"      color = texture2D(uTransferFunction, vec2(intesity.r,0.5)).rgba;\\n\"+\n                    \"    }\\n\";\n                }else{\n                    shader += \"    if (forceOpaque){\\n\"+\n                    \"      color = vec4(intesity.rgb,1.0);\\n\"+\n                    \"    }else{\\n\"+\n                    \"      color = intesity;\\n\"+\n                    \"    }\\n\";\n                }\n                shader += \"  }\\n\"+\n                \"  gl_FragColor = color;\\n\"+\n                \"}\";\n                return shader;\n            }\n         }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * MEDX3DOM JavaScript Library\n * http://medx3dom.org\n *\n * (C)2019 Vicomtech Research Center,\n *         Donostia - San Sebastian\n * Dual licensed under the MIT and GPL.\n *\n * Based on code originally provided by\n * http://www.x3dom.org\n */\n\n/* ### MPRPlane ### */\nx3dom.registerNodeType(\n    \"MPRPlane\",\n    \"VolumeRendering\",\n    defineClass(x3dom.nodeTypes.X3DNode,\n\n        /**\n         * Constructor for a MPRPlane\n         * @constructs x3dom.nodeTypes.MPRPlane\n         * @x3d x.x\n         * @component VolumeRendering\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc class for defining an arbitrary plane for the MPRVolumeStyle.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.MPRPlane.superClass.call(this, ctx);\n\n            /**\n             * Specifies if the reconstructed plane is visible or not.\n             * @var {x3dom.fields.SFBool} enabled\n             * @memberof x3dom.nodeTypes.MPRPlane\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'enabled', true);\n\n            /**\n             * The normal vector of the plane.\n             * @var {x3dom.fields.SFVec3f} normal\n             * @memberof x3dom.nodeTypes.MPRPlane\n             * @initvalue 0.0,1.0,0.0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'normal', 0.0, 1.0, 0.0);\n\n            /**\n             * The position field specifies the position along the plane normal direction where the slice plane is rendered.\n             * @var {x3dom.fields.SFFloat} position\n             * @memberof x3dom.nodeTypes.MPRPlane\n             * @initvalue 0.5\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'position', 0.5);\n\n            this.uniformBooleanEnabled = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformVec3fNormal = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformFloatPosition = new x3dom.nodeTypes.Uniform(ctx);\n            this._planeID = 0; //To differentiate between plane instances\n        },\n        {\n            nodeChanged: function () {\n                if(!this._planeID) {\n                    this._planeID = ++x3dom.nodeTypes.MPRPlane.planeID;\n                }\n            },\n            fieldChanged: function(fieldName) {\n                 switch(fieldName){\n                    case 'enabled':\n                        this.uniformBooleanEnabled._vf.value = this._vf.enabled.toString();\n                        this.uniformBooleanEnabled.fieldChanged(\"value\");\n                        break;\n                    case 'position':\n                        this.uniformFloatPosition._vf.value = Math.min(Math.max(this._vf.position, 0.001), 0.999);\n                        this.uniformFloatPosition.fieldChanged(\"value\");\n                        break;\n                    case 'normal':\n                        this.uniformVec3fNormal._vf.value = this._vf.normal;\n                        this.uniformVec3fNormal.fieldChanged(\"value\");\n                        break;\n                }\n            },\n            uniforms: function(){\n                var unis = [];\n\n                this.uniformBooleanEnabled._vf.name = 'enabledPlane'+this._planeID;\n                this.uniformBooleanEnabled._vf.type = 'SFBool';\n                this.uniformBooleanEnabled._vf.value = this._vf.enabled;\n                unis.push(this.uniformBooleanEnabled);\n\n                this.uniformVec3fNormal._vf.name = 'normalPlane'+this._planeID;\n                this.uniformVec3fNormal._vf.type = 'SFVec3f';\n                this.uniformVec3fNormal._vf.value = this._vf.normal;\n                unis.push(this.uniformVec3fNormal);\n\n                this.uniformFloatPosition._vf.name = 'positionPlane'+this._planeID;\n                this.uniformFloatPosition._vf.type = 'SFFloat';\n                this.uniformFloatPosition._vf.value = this._vf.position;\n                unis.push(this.uniformFloatPosition);\n                return unis;\n            },\n            styleUniformsShaderText: function(){\n              var uniformShaderText = \"uniform vec3 normalPlane\"+this._planeID+\";\\n\"+\n              \"uniform float positionPlane\"+this._planeID+\";\\n\"+\n              \"uniform bool enabledPlane\"+this._planeID+\";\\n\";\n              return uniformShaderText;\n            },\n            styleShaderText: function(){\n              var shaderText = \"  if(enabledPlane\"+this._planeID+\"){\\n\"+\n              \"   vec3 pointLine\"+this._planeID+\" = normalPlane\"+this._planeID+\"*positionPlane\"+this._planeID+\";\\n\"+\n              \"   float d\"+this._planeID+\" = dot(pointLine\"+this._planeID+\"-ray_pos,normalPlane\"+this._planeID+\")/dot(dir,normalPlane\"+this._planeID+\");\\n\"+\n              \"   float f\"+this._planeID+\" = step(0.0, d\"+this._planeID+\");\\n\"+\n              \"   d\"+this._planeID+\" = (1.0 - f\"+this._planeID+\") * 1000.0 + f\"+this._planeID+\" * d\"+this._planeID+\";\\n\"+\n              \"   d = min(d\"+this._planeID+\",d);\\n\"+\n              \"  }\\n\";\n              return shaderText;\n            }\n        }\n    )\n);\n\n/** Static class ID counter (needed to allow duplicate planes) */\nx3dom.nodeTypes.MPRPlane.planeID = 0;\n\n/** @namespace x3dom.nodeTypes */\n/*\n * MEDX3DOM JavaScript Library\n * http://medx3dom.org\n *\n * (C)2011 Vicomtech Research Center,\n *         Donostia - San Sebastian\n * Dual licensed under the MIT and GPL.\n *\n * Based on code originally provided by\n * http://www.x3dom.org\n */\n\n/* ### OpacityMapVolumeStyle ### */\nx3dom.registerNodeType(\n    \"OpacityMapVolumeStyle\",\n    \"VolumeRendering\",\n    defineClass(x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode,\n        \n        /**\n         * Constructor for OpacityMapVolumeStyle\n         * @constructs x3dom.nodeTypes.OpacityMapVolumeStyle\n         * @x3d x.x\n         * @component VolumeRendering\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * The OpacityMapVolumeStyle node specifies that the associated volume data is going to be rendered using a transfer function.\n         * The original opacity is mapped to a color with a function stored as a texture (transfer function).\n         */\n        function (ctx) {\n            x3dom.nodeTypes.OpacityMapVolumeStyle.superClass.call(this, ctx);\n\n\n            /**\n             * The transferFunction field is a texture that is going to be used to map each voxel value to a specific color output.\n             * @var {x3dom.fields.SFNode} transferFunction\n             * @memberof x3dom.nodeTypes.OpacityMapVolumeStyle\n             * @initvalue x3dom.nodeTypes.Texture\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('transferFunction', x3dom.nodeTypes.Texture);\n\n            /**\n             * NYI!!\n             * @var {x3dom.fields.SFString} type\n             * @memberof x3dom.nodeTypes.OpacityMapVolumeStyle\n             * @initvalue \"simple\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'type', \"simple\");\n\n            /**\n             * The opacityFactor field is a factor to specify the amount of opacity to be considered on each sampled point along the ray traversal.\n             * @var {x3dom.fields.SFFloat} opacityFactor\n             * @memberof x3dom.nodeTypes.OpacityMapVolumeStyle\n             * @initvalue 6.0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'opacityFactor', 6.0);\n\n            /**\n             * The lightFactor field is a factor to specify the amount of global light to be considered on each sampled point along the ray traversal.\n             * @var {x3dom.fields.SFFloat} lightFactor\n             * @memberof x3dom.nodeTypes.OpacityMapVolumeStyle\n             * @initvalue 1.2\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'lightFactor', 1.2);\n\n            this.uniformFloatOpacityFactor = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformFloatLightFactor = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformSampler2DTransferFunction = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformBoolEnableOpacityMap = new x3dom.nodeTypes.Uniform(ctx);\n        \n        },\n        {\n            fieldChanged: function(fieldName){\n                switch(fieldName){\n                    case 'opacityFactor':\n                        this.uniformFloatOpacityFactor._vf.value = this._vf.opacityFactor;\n                        this.uniformFloatOpacityFactor.fieldChanged(\"value\");\n                        break;\n                    case 'lightFactor':\n                        this.uniformFloatLightFactor._vf.value = this._vf.lightFactor;\n                        this.uniformFloatLightFactor.fieldChanged(\"value\");\n                        break;\n                }\n            },\n\n            uniforms: function() {\n                var unis = [];\n                \n                if (this._cf.transferFunction.node) {\n                    this.uniformSampler2DTransferFunction._vf.name = 'uTransferFunction'+this._styleID;\n                    this.uniformSampler2DTransferFunction._vf.type = 'SFInt32';\n                    this.uniformSampler2DTransferFunction._vf.value = this._volumeDataParent._textureID++;\n                    unis.push(this.uniformSampler2DTransferFunction);\n                }\n\n                this.uniformFloatOpacityFactor._vf.name = 'uOpacityFactor'+this._styleID;\n                this.uniformFloatOpacityFactor._vf.type = 'SFFloat';\n                this.uniformFloatOpacityFactor._vf.value = this._vf.opacityFactor;\n                unis.push(this.uniformFloatOpacityFactor);\n\n                this.uniformFloatLightFactor._vf.name = 'uLightFactor'+this._styleID;\n                this.uniformFloatLightFactor._vf.type = 'SFFloat';\n                this.uniformFloatLightFactor._vf.value = this._vf.lightFactor;\n                unis.push(this.uniformFloatLightFactor);\n\n                this.uniformBoolEnableOpacityMap._vf.name = 'uEnableOpacityMap'+this._styleID;\n                this.uniformBoolEnableOpacityMap._vf.type = 'SFBool';\n                this.uniformBoolEnableOpacityMap._vf.value = this._vf.enabled;\n                unis.push(this.uniformBoolEnableOpacityMap);\n\n                return unis;\n            },\n\n            textures: function() {\n                var texs = [];\n                var tex = this._cf.transferFunction.node;\n                if (tex) {\n                    tex._vf.repeatS = false;\n                    tex._vf.repeatT = false;\n                    texs.push(tex);\n                }\n                return texs;\n            },\n\n            styleUniformsShaderText: function() {\n                var uniformsText = \"uniform float uOpacityFactor\"+this._styleID+\";\\n\"+\n                \"uniform float uLightFactor\"+this._styleID+\";\\n\"+\n                \"uniform bool uEnableOpacityMap\"+this._styleID+\";\\n\";\n                if (this._cf.transferFunction.node) {\n                        uniformsText += \"uniform sampler2D uTransferFunction\"+this._styleID+\";\\n\";\n                }\n                return uniformsText;\n            },\n\n            inlineStyleShaderText: function(){\n                var shaderText = \"    if(uEnableOpacityMap\"+this._styleID+\"){\\n\"+\n                \"       opacityFactor = uOpacityFactor\"+this._styleID+\";\\n\"+\n                \"       lightFactor = uLightFactor\"+this._styleID+\";\\n\";\n                if (this._cf.transferFunction.node){\n                        shaderText += \"       value = texture2D(uTransferFunction\"+this._styleID+\",vec2(value.r,0.5));\\n\";\n                }\n                shaderText += \"    }\\n\";\n                return shaderText;\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * MEDX3DOM JavaScript Library\n * http://medx3dom.org\n *\n * (C)2011 Vicomtech Research Center,\n *         Donostia - San Sebastian\n * Dual licensed under the MIT and GPL.\n *\n * Based on code originally provided by\n * http://www.x3dom.org\n */\n\n/* ### ProjectionVolumeStyle ### */\nx3dom.registerNodeType(\n    \"ProjectionVolumeStyle\",\n    \"VolumeRendering\",\n    defineClass(x3dom.nodeTypes.X3DVolumeRenderStyleNode,\n\n        /**\n         * Constructor for ProjectionVolumeStyle\n         * @constructs x3dom.nodeTypes.ProjectionVolumeStyle\n         * @x3d x.x\n         * @component VolumeRendering\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DVolumeRenderStyleNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The ProjectionVolumeStyle node generates an output color based on the voxel data values traversed by a ray following the view direction.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.ProjectionVolumeStyle.superClass.call(this, ctx);\n\n\n            /**\n             * The intensityThreshold field is used to define a local maximum or minimum value along the ray traversal. It is ignored on the AVERAGE intensity projection.\n             * @var {x3dom.fields.SFFloat} intensityThreshold\n             * @memberof x3dom.nodeTypes.ProjectionVolumeStyle\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'intensityThreshold', 0);\n\n            /**\n             * The type field specifies the type of intensity projection to be used. It can be MAX, MIN or AVERAGE.\n             * @var {x3dom.fields.SFString} type\n             * @memberof x3dom.nodeTypes.ProjectionVolumeStyle\n             * @initvalue \"MAX\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'type', \"MAX\");\n\n            this.uniformIntensityThreshold = new x3dom.nodeTypes.Uniform(ctx);\n            //this.uniformType = new x3dom.nodeTypes.Uniform(ctx);\n\n        },\n        {\n            fieldChanged: function(fieldName){\n                if (fieldName === 'intensityThreshold') {\n                    this.uniformIntensityThreshold._vf.value = this._vf.intensityThreshold;\n                    this.uniformIntensityThreshold.fieldChanged(\"value\");\n                }else if(fieldName === 'type'){\n                    //TODO: Reload node\n                }\n            },\n\n            uniforms: function(){\n                var unis = [];\n                //var type_map = {'max':0,'min':1,'average':2};\n\n                this.uniformIntensityThreshold._vf.name = 'uIntensityThreshold';\n                this.uniformIntensityThreshold._vf.type = 'SFFloat';\n                this.uniformIntensityThreshold._vf.value = this._vf.intensityThreshold;\n                unis.push(this.uniformIntensityThreshold);\n\n                /*this.uniformType._vf.name = 'uType';\n                this.uniformType._vf.type = 'SFInt32';\n                this.uniformType._vf.value = type_map[this._vf.type.toLowerCase()];\n                unis.push(this.uniformType);*/\n\n                return unis;\n            },\n\n            styleUniformsShaderText: function(){\n                return \"uniform int uType;\\n\"+\n                \"uniform float uIntensityThreshold;\\n\";\n            },\n\n            fragmentShaderText: function(numberOfSlices, slicesOverX, slicesOverY){\n                var shader =\n                this._parentNodes[0].fragmentPreamble+\n                this._parentNodes[0].defaultUniformsShaderText(numberOfSlices, slicesOverX, slicesOverY)+\n                this.styleUniformsShaderText()+\n                this._parentNodes[0].texture3DFunctionShaderText+\n                \"void main()\\n\"+\n                \"{\\n\"+\n                \"  vec3 cam_pos = vec3(modelViewMatrixInverse[3][0], modelViewMatrixInverse[3][1], modelViewMatrixInverse[3][2]);\\n\"+\n                \"  cam_pos = cam_pos/dimensions+0.5;\\n\"+\n                \"  vec3 dir = normalize(pos.xyz-cam_pos);\\n\"+\n                \"  vec3 ray_pos = pos.xyz;\\n\"+\n                \"  vec4 accum  = vec4(0.0, 0.0, 0.0, 0.0);\\n\"+\n                \"  vec4 sample = vec4(0.0, 0.0, 0.0, 0.0);\\n\"+\n                \"  vec4 value  = vec4(0.0, 0.0, 0.0, 0.0);\\n\"+\n                \"  vec4 color  = vec4(0.0);\\n\";\n                if (this._vf.type.toLowerCase() === \"max\") {\n                    shader += \"vec2 previous_value = vec2(0.0);\\n\";\n                }else {\n                    shader += \"vec2 previous_value = vec2(1.0);\\n\";\n                }\n                shader +=\n                \"  float cont = 0.0;\\n\"+\n                \"  vec3 step_size = (dir*1.4142)/Steps;\\n\"+\n                \"  const float lightFactor = 1.3;\\n\"+\n                \"  const float opacityFactor = 3.0;\\n\"+\n                \"  for(float i = 0.0; i < Steps; i+=1.0)\\n\"+\n                \"  {\\n\"+\n                \"    value = cTexture3D(uVolData,ray_pos,numberOfSlices,slicesOverX,slicesOverY);\\n\"+\n                \"    value = vec4(value.rgb,(0.299*value.r)+(0.587*value.g)+(0.114*value.b));\\n\"+\n                \"    //Process the volume sample\\n\"+\n                \"    sample.a = value.a * opacityFactor * (1.0/Steps);\\n\"+\n                \"    sample.rgb = value.rgb * sample.a * lightFactor;\\n\"+\n                \"    accum.a += (1.0-accum.a)*sample.a;\\n\";\n                if(this._vf.enabled){\n                    switch (this._vf.type.toLowerCase()) {\n                    case \"max\":\n                        shader += \"if(value.r > uIntensityThreshold && value.r <= previous_value.x){\\n\"+\n                        \"   break;\\n\"+\n                        \"}\\n\"+\n                        \"color.rgb = vec3(max(value.r, previous_value.x));\\n\"+\n                        \"color.a = (value.r > previous_value.x) ? accum.a : previous_value.y;\\n\";\n                        break;\n                    case \"min\":\n                        shader += \"if(value.r < uIntensityThreshold && value.r >= previous_value.x){\\n\"+\n                        \"   break;\\n\"+\n                        \"}\\n\"+\n                        \"color.rgb = vec3(min(value.r, previous_value.x));\\n\"+\n                        \"color.a = (value.r < previous_value.x) ? accum.a : previous_value.y;\\n\";\n                        break;\n                    case \"average\":\n                        shader+= \"color.rgb += (1.0 - accum.a) * sample.rgb;\\n\"+\n                        \"color.a = accum.a;\\n\";\n                        break;\n                    }\n                }\n                shader +=\n                \"    //update the previous value and keeping the accumulated alpha\\n\"+\n                \"    previous_value.x = color.r;\\n\"+\n                \"    previous_value.y = accum.a;\\n\"+\n                \"    //advance the current position\\n\"+\n                \"    ray_pos.xyz += step_size;\\n\"+\n                \"    //break if the position is greater than <1, 1, 1>\\n\"+\n                \"    if(ray_pos.x > 1.0 || ray_pos.y > 1.0 || ray_pos.z > 1.0 || ray_pos.x <= 0.0 || ray_pos.y <= 0.0 || ray_pos.z <= 0.0 || accum.a>=1.0){\\n\";\n                if(this._vf.type.toLowerCase() == \"average\" && this._vf.enabled){\n                    shader += \"     if((i > 0.0) && (i < Steps-1.0)){\\n\"+\n                    \"color.rgb = color.rgb/i;\\n\"+\n                    \"}\\n\";\n                }\n                shader+=\n                \"      break;\\n\"+\n                \"    }\\n\"+\n                \" }\\n\"+\n                \" gl_FragColor = color;\\n\"+\n                \"}\";\n                return shader;\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * MEDX3DOM JavaScript Library\n * http://medx3dom.org\n *\n * (C)2011 Vicomtech Research Center,\n *         Donostia - San Sebastian\n * Dual licensed under the MIT and GPL.\n *\n * Based on code originally provided by\n * http://www.x3dom.org\n */\n\n/* ### SegmentedVolumeData ### */\nx3dom.registerNodeType(\n    \"SegmentedVolumeData\",\n    \"VolumeRendering\",\n    defineClass(x3dom.nodeTypes.X3DVolumeDataNode,\n        \n        /**\n         * Constructor for SegmentedVolumeData\n         * @constructs x3dom.nodeTypes.SegmentedVolumeData\n         * @x3d x.x\n         * @component VolumeRendering\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DVolumeDataNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The SegmentedVolumeData node specifies a segmented volume data set. Each segment can be rendered with a different volume rendering style.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.SegmentedVolumeData.superClass.call(this, ctx);\n\n\n            /**\n             * The renderStyle field contains a list of composable render styles nodes to be used on the segmented volume data.\n             * @var {x3dom.fields.MFNode} renderStyle\n             * @memberof x3dom.nodeTypes.SegmentedVolumeData\n             * @initvalue x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFNode('renderStyle', x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode);\n            //this.addField_MFBool(ctx, 'segmentEnabled', []);  // MFBool NYI!!!\n            //this.addField_SFNode('segmentIdentifiers', x3dom.nodeTypes.X3DVolumeDataNode);\n\n            /**\n             * The segmentIdentifiers field is an ImageTextureAtlas node of the same dimensions of the volume data. The segment identifiers are used to map each segment with a volume rendering style. \n             * @var {x3dom.fields.SFNode} segmentIdentifiers\n             * @memberof x3dom.nodeTypes.SegmentedVolumeData\n             * @initvalue x3dom.nodeTypes.Texture\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('segmentIdentifiers', x3dom.nodeTypes.Texture);\n\n            /**\n             * Specifies the number of segments on the volume data. It is used to correctly match each segment identifier to an index of the renderStyle list.\n             * @var {x3dom.fields.SFFloat} numberOfMaxSegments\n             * @memberof x3dom.nodeTypes.SegmentedVolumeData\n             * @initvalue 10.0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'numberOfMaxSegments', 10.0);\n\n            this.uniformSampler2DSegmentIdentifiers = new x3dom.nodeTypes.Uniform(ctx);\n            this.normalTextureProvided = false;\n\n            this.vrcMultiTexture = new x3dom.nodeTypes.MultiTexture(ctx);\n            this.vrcVolumeTexture = null;\n\n            this.vrcSinglePassShader = new x3dom.nodeTypes.ComposedShader(ctx);\n            this.vrcSinglePassShaderVertex = new x3dom.nodeTypes.ShaderPart(ctx);\n            this.vrcSinglePassShaderFragment = new x3dom.nodeTypes.ShaderPart(ctx);\n            this.vrcSinglePassShaderFieldBackCoord = new x3dom.nodeTypes.Field(ctx);\n            this.vrcSinglePassShaderFieldVolData = new x3dom.nodeTypes.Field(ctx);\n            this.vrcSinglePassShaderFieldOffset = new x3dom.nodeTypes.Field(ctx);\n            this.vrcSinglePassShaderFieldDimensions = new x3dom.nodeTypes.Field(ctx);\n        },\n        {\n            fieldChanged: function(fieldName){\n                if (fieldName === \"numberOfMaxSegments\" || fieldname === \"segmentIdentifiers\") {\n                    //TODO: Reload node   \n                }\n            },\n\n            uniforms: function(){\n                var unis = [];\n\n                if (this._cf.segmentIdentifiers.node) {\n                    this.uniformSampler2DSegmentIdentifiers._vf.name = 'uSegmentIdentifiers';\n                    this.uniformSampler2DSegmentIdentifiers._vf.type = 'SFInt32';\n                    this.uniformSampler2DSegmentIdentifiers._vf.value = this._textureID++;\n                    unis.push(this.uniformSampler2DSegmentIdentifiers);\n                }\n\n                //Also add the render style uniforms\n                if (this._cf.renderStyle.nodes) {\n                    var i, n = this._cf.renderStyle.nodes.length;\n                    for (i=0; i<n; i++){\n                        //Not repeat common uniforms, TODO: Allow multiple surface normals\n                        var that = this;\n                        Array.forEach(this._cf.renderStyle.nodes[i].uniforms(), function(uniform){\n                            var contains_uniform = false;\n                            Array.forEach(unis, function(accum){\n                                if(accum._vf.name == uniform._vf.name){\n                                    contains_uniform = true;\n                                }\n                            });\n                            if (contains_uniform == false){\n                                unis = unis.concat(uniform);\n                            }\n                        });\n                    }    \n                }\n                return unis;\n            },\n\n            textures: function(){\n                var texs = [];\n                if(this._cf.segmentIdentifiers.node){\n                    var tex = this._cf.segmentIdentifiers.node;\n                    tex._vf.repeatS = false;\n                    tex._vf.repeatT = false;\n                    texs.push(tex);\n                }\n\n                //Also add the render style textures\n                var i, n = this._cf.renderStyle.nodes.length;\n                for (i=0; i<n; i++){\n                    //Not repeat same textures, TODO: Allow multiply surface normals textures\n                    Array.forEach(this._cf.renderStyle.nodes[i].textures(), function(texture){\n                        var contains_texture = false;\n                        Array.forEach(texs, function(accum){\n                            if(accum._vf.url[0] == texture._vf.url[0]){\n                                contains_texture = true;\n                            }\n                        });\n                        if (contains_texture == false){\n                            texs = texs.concat(texture);\n                        }\n                    });\n                }\n                return texs;\n            },\n\n            initializeValues: function() {\n                var initialValues = \"\";\n                var n = this._cf.renderStyle.nodes.length;\n                for (var i=0; i<n; i++){\n                    if(this._cf.renderStyle.nodes[i].initializeValues != undefined){\n                        initialValues += this._cf.renderStyle.nodes[i].initializeValues() + \"\\n\";\n                    }\n                }\n                return initialValues;\n            },\n\n            styleUniformsShaderText: function(){\n                var styleText = \"const float maxSegments = \" + this._vf.numberOfMaxSegments.toPrecision(3) + \";\\n\"+\n                \"uniform sampler2D uSegmentIdentifiers;\\n\"; //TODO: Segment enabled\n                var n = this._cf.renderStyle.nodes.length;\n                for (var i=0; i<n; i++){\n                    styleText += this._cf.renderStyle.nodes[i].styleUniformsShaderText() + \"\\n\";\n                    if(this._cf.renderStyle.nodes[i]._cf.surfaceNormals && this._cf.renderStyle.nodes[i]._cf.surfaceNormals.node != null){\n                        styleText += \"uniform sampler2D uSurfaceNormals;\\n\"; //Neccessary when gradient is provided\n                        this.normalTextureProvided = true;\n                        this.surfaceNormals = this._cf.renderStyle.nodes[i]._cf.surfaceNormals.node;\n                    }\n                    if(!x3dom.isa(this._cf.renderStyle.nodes[i], x3dom.nodeTypes.OpacityMapVolumeStyle)){\n                        this.surfaceNormalsNeeded = true;\n                    }\n                }\n                return styleText;\n            },\n\n            styleShaderText: function(){\n                var styleText = \"\";\n                var n = this._cf.renderStyle.nodes.length;\n                for (var i=0; i<n; i++){\n                    if(this._cf.renderStyle.nodes[i].styleShaderText != undefined){\n                        styleText += this._cf.renderStyle.nodes[i].styleShaderText()+\"\\n\";\n                    }\n                }\n                return styleText;\n            },\n\n            inlineStyleShaderText: function(){\n                var inlineText = \"\";\n                if(this._cf.segmentIdentifiers.node){\n                    inlineText += \"    float t_id = cTexture3D(uSegmentIdentifiers, ray_pos, numberOfSlices, slicesOverX, slicesOverY).r;\\n\"+\n                    \"    int s_id = int(clamp(floor(t_id*maxSegments-0.5),0.0,maxSegments));\\n\"+\n                    \"    opacityFactor = 10.0;\\n\";\n                    if(x3dom.nodeTypes.X3DLightNode.lightID>0){\n                        inlineText += \"    lightFactor = 1.0;\\n\";\n                    }else{\n                        inlineText += \"    lightFactor = 1.2;\\n\";\n                    }\n                }else{\n                    inlineText += \"    int s_id = 0;\\n\";\n                }\n                //TODO Check if the segment identifier is going to be rendered or not. NYI!!\n                var n = this._cf.renderStyle.nodes.length;\n                for (var i=0; i<n; i++){ //TODO Check identifier and add the style\n                    inlineText += \"    if (s_id == \"+i+\"){\\n\"+\n                    this._cf.renderStyle.nodes[i].inlineStyleShaderText()+\n                    \"    }\\n\";\n                }\n                return inlineText;\n            },\n\n            lightAssigment: function(){\n                return this._cf.renderStyle.nodes[0].lightAssigment();\n            },\n\n            lightEquationShaderText: function(){ //TODO: ligth equation per segment\n                return this._cf.renderStyle.nodes[0].lightEquationShaderText();\n            },\n\n            nodeChanged: function()\n            {\n                if (!this._cf.appearance.node) \n                {\n                    var i;\n\n                    this.addChild(new x3dom.nodeTypes.Appearance());\n                    \n                    // create shortcut to volume data set\n                    this.vrcVolumeTexture = this._cf.voxels.node;\n                    this.vrcVolumeTexture._vf.repeatS = false;\n                    this.vrcVolumeTexture._vf.repeatT = false;\n\n                    this.vrcMultiTexture._nameSpace = this._nameSpace;\n                    \n                    this.vrcMultiTexture.addChild(this.vrcVolumeTexture, 'texture');\n                    this.vrcVolumeTexture.nodeChanged();\n                    \n                    // textures from styles\n                    var styleTextures = this.textures();\n                    for (i = 0; i<styleTextures.length; i++)\n                    {\n                        this.vrcMultiTexture.addChild(styleTextures[i], 'texture');\n                        this.vrcVolumeTexture.nodeChanged();\n                    }\n                    \n                    this._cf.appearance.node.addChild(this.vrcMultiTexture);\n                    this.vrcMultiTexture.nodeChanged();\n                    \n                    //Update child node properties\n                    for (var i = 0; i < this._cf.renderStyle.nodes.length; i++) {\n                        this._cf.renderStyle.nodes[i].updateProperties(this);\n                    }\n\n                    // here goes the volume shader\n                    this.vrcSinglePassShaderVertex._vf.type = 'vertex';\n                    this.vrcSinglePassShaderVertex._vf.url[0] = this.vertexShaderText();\n\n                    this.vrcSinglePassShaderFragment._vf.type = 'fragment';\n                    var shaderText =\n                        this.fragmentPreamble+\n                        this.defaultUniformsShaderText(this.vrcVolumeTexture._vf.numberOfSlices, this.vrcVolumeTexture._vf.slicesOverX, this.vrcVolumeTexture._vf.slicesOverY)+\n                        this.styleUniformsShaderText()+\n                        this.styleShaderText()+\n                        this.texture3DFunctionShaderText+\n                        this.normalFunctionShaderText()+\n                        this.lightEquationShaderText()+\n                        this.defaultLoopFragmentShaderText(this.inlineStyleShaderText(), this.lightAssigment(), this.initializeValues());\n                    this.vrcSinglePassShaderFragment._vf.url[0] = shaderText;\n\n                    this.vrcSinglePassShader.addChild(this.vrcSinglePassShaderVertex, 'parts');\n                    this.vrcSinglePassShaderVertex.nodeChanged();\n                    \n                    this.vrcSinglePassShader.addChild(this.vrcSinglePassShaderFragment, 'parts');\n                    this.vrcSinglePassShaderFragment.nodeChanged();\n                    \n                    this.vrcSinglePassShaderFieldVolData._vf.name = 'uVolData';\n                    this.vrcSinglePassShaderFieldVolData._vf.type = 'SFInt32';\n                    this.vrcSinglePassShaderFieldVolData._vf.value = this._textureID++;\n\n                    this.vrcSinglePassShaderFieldDimensions._vf.name = 'dimensions';\n                    this.vrcSinglePassShaderFieldDimensions._vf.type = 'SFVec3f';\n                    this.vrcSinglePassShaderFieldDimensions._vf.value = this._vf.dimensions;\n\n                    this.vrcSinglePassShaderFieldOffset._vf.name = 'offset';\n                    this.vrcSinglePassShaderFieldOffset._vf.type = 'SFVec3f';\n                    this.vrcSinglePassShaderFieldOffset._vf.value = \"0.01 0.01 0.01\"; //Default initial value\n                    \n                    this.vrcSinglePassShader.addChild(this.vrcSinglePassShaderFieldVolData, 'fields');\n                    this.vrcSinglePassShaderFieldVolData.nodeChanged();\n\n                    this.vrcSinglePassShader.addChild(this.vrcSinglePassShaderFieldDimensions, 'fields');\n                    this.vrcSinglePassShaderFieldDimensions.nodeChanged();\n\n                    this.vrcSinglePassShader.addChild(this.vrcSinglePassShaderFieldOffset, 'fields');\n \n                    //Take volume texture size for the ComposableRenderStyles offset parameter\n                    this.offsetInterval = window.setInterval((function(aTex, obj) {\n                        return function() {\n                            x3dom.debug.logInfo('[VolumeRendering][SegmentedVolumeData] Looking for Volume Texture size...');\n                            var s = obj.getTextureSize(aTex);\n                            if(s.valid){\n                                clearInterval(obj.offsetInterval);\n                                obj.vrcSinglePassShaderFieldOffset._vf.value = new x3dom.fields.SFVec3f(1.0/(s.w/aTex._vf.slicesOverX), 1.0/(s.h/aTex._vf.slicesOverY), 1.0/aTex._vf.numberOfSlices);\n                                obj.vrcSinglePassShader.nodeChanged();\n                                x3dom.debug.logInfo('[VolumeRendering][SegmentedVolumeData] Volume Texture size obtained');\n                            }\n                        }\n                    })(this.vrcVolumeTexture, this), 1000);\n                    \n                    var ShaderUniforms = this.uniforms();\n                    for (i = 0; i<ShaderUniforms.length; i++)\n                    {\n                        this.vrcSinglePassShader.addChild(ShaderUniforms[i], 'fields');\n                    }\n                \n                    this._cf.appearance.node.addChild(this.vrcSinglePassShader);\n                    this.vrcSinglePassShader.nodeChanged();\n                    \n                    this._cf.appearance.node.nodeChanged();\n                }\n\n                if (!this._cf.geometry.node) {\n                    this.addChild(new x3dom.nodeTypes.Box());\n\n                    this._cf.geometry.node._vf.solid = false;\n                    this._cf.geometry.node._vf.hasHelperColors = false;\n                    this._cf.geometry.node._vf.size = new x3dom.fields.SFVec3f(\n                        this._vf.dimensions.x, this._vf.dimensions.y, this._vf.dimensions.z);\n\n                    // workaround to trigger field change...\n                    this._cf.geometry.node.fieldChanged(\"size\");\n                }\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * MEDX3DOM JavaScript Library\n * http://medx3dom.org\n *\n * (C)2011 Vicomtech Research Center,\n *         Donostia - San Sebastian\n * Dual licensed under the MIT and GPL.\n *\n * Based on code originally provided by\n * http://www.x3dom.org\n */\n\n/* ### ShadedVolumeStyle ### */\nx3dom.registerNodeType(\n    \"ShadedVolumeStyle\",\n    \"VolumeRendering\",\n    defineClass(x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode,\n        \n        /**\n         * Constructor for ShadedVolumeStyle\n         * @constructs x3dom.nodeTypes.ShadedVolumeStyle\n         * @x3d x.x\n         * @component VolumeRendering\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The ShadedVolumeStyle node applies the Blinn-Phong illumination model to the assocciated volume data.\n         * The light and fog parameters are obtained from the parent Appearence node.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.ShadedVolumeStyle.superClass.call(this, ctx);\n\n\n            /**\n             * The material field allows to specify a Material node to be used on the assocciated volume data. \n             * @var {x3dom.fields.SFNode} material\n             * @memberof x3dom.nodeTypes.ShadedVolumeStyle\n             * @initvalue x3dom.nodeTypes.X3DMaterialNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('material', x3dom.nodeTypes.X3DMaterialNode);\n\n            /**\n             * NYI!!\n             * @var {x3dom.fields.SFBool} lighting\n             * @memberof x3dom.nodeTypes.ShadedVolumeStyle\n             * @initvalue false\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'lighting', false);\n\n            /**\n             * NYI!!\n             * @var {x3dom.fields.SFBool} shadows\n             * @memberof x3dom.nodeTypes.ShadedVolumeStyle\n             * @initvalue false\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'shadows', false);\n\n            /**\n             * NYI!!\n             * @var {x3dom.fields.SFString} phaseFunction\n             * @memberof x3dom.nodeTypes.ShadedVolumeStyle\n             * @initvalue \"Henyey-Greenstein\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'phaseFunction', \"Henyey-Greenstein\");\n\n            this.uniformBoolLigthning = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformBoolShadows = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformSampler2DSurfaceNormals = new x3dom.nodeTypes.Uniform(ctx);\n            //Material uniforms\n            this.uniformColorSpecular = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformFloatAmbientIntensity = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformFloatShininess = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformFloatTransparency = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformColorEmissive = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformColorDiffuse = new x3dom.nodeTypes.Uniform(ctx);\n            //Enable/Disable style\n            this.uniformBoolEnableShaded = new x3dom.nodeTypes.Uniform(ctx);\n        \n        },\n        {\n            fieldChanged: function(fieldName){\n                switch(fieldName){\n                    case 'lightning':\n                        this.uniformBoolLightning._vf.value = this._vf.lightning;\n                        this.uniformBoolLightning.fieldChanged(\"value\");\n                        break;\n                    case 'shadows':\n                        this.uniformBoolShadows._vf.value = this._vf.shadows;\n                        this.uniformBoolShadows.fieldChanged(\"value\");\n                        break;\n                    default:\n                        //TODO: Reload node\n                        break;\n                }\n            },\n\n            uniforms: function(){\n                var unis = [];\n                if (this._cf.surfaceNormals.node) {\n                    this.uniformSampler2DSurfaceNormals._vf.name = 'uSurfaceNormals';\n                    this.uniformSampler2DSurfaceNormals._vf.type = 'SFInt32';\n                    this.uniformSampler2DSurfaceNormals._vf.value = this._volumeDataParent._textureID++;\n                    unis.push(this.uniformSampler2DSurfaceNormals);\n                }\n\n                this.uniformBoolLigthning._vf.name = 'uLightning'+this._styleID;\n                this.uniformBoolLigthning._vf.type = 'SFBool';\n                this.uniformBoolLigthning._vf.value = this._vf.lighting;\n                unis.push(this.uniformBoolLigthning);\n\n                this.uniformBoolShadows._vf.name = 'uShadows'+this._styleID;\n                this.uniformBoolShadows._vf.type = 'SFBool';\n                this.uniformBoolShadows._vf.value = this._vf.shadows;\n                unis.push(this.uniformBoolShadows);\n\n                //Material uniform parameters\n                if(this._cf.material.node != null){\n                    this.uniformColorSpecular._vf.name = 'specularColor'+this._styleID;\n                    this.uniformColorSpecular._vf.type = 'SFColor';\n                    this.uniformColorSpecular._vf.value = this._cf.material.node._vf.specularColor;\n                    unis.push(this.uniformColorSpecular);\n\n                    this.uniformColorDiffuse._vf.name = 'diffuseColor'+this._styleID;\n                    this.uniformColorDiffuse._vf.type = 'SFColor';\n                    this.uniformColorDiffuse._vf.value = this._cf.material.node._vf.diffuseColor;\n                    unis.push(this.uniformColorDiffuse);\n\n                    this.uniformColorEmissive._vf.name = 'emissiveColor'+this._styleID;\n                    this.uniformColorEmissive._vf.type = 'SFColor';\n                    this.uniformColorEmissive._vf.value = this._cf.material.node._vf.emissiveColor;\n                    unis.push(this.uniformColorEmissive);\n\n                    this.uniformFloatAmbientIntensity._vf.name = 'ambientIntensity'+this._styleID;\n                    this.uniformFloatAmbientIntensity._vf.type = 'SFFloat';\n                    this.uniformFloatAmbientIntensity._vf.value = this._cf.material.node._vf.ambientIntensity;\n                    unis.push(this.uniformFloatAmbientIntensity);\n\n                    this.uniformFloatShininess._vf.name = 'shininess'+this._styleID;\n                    this.uniformFloatShininess._vf.type = 'SFFloat';\n                    this.uniformFloatShininess._vf.value = this._cf.material.node._vf.shininess;\n                    unis.push(this.uniformFloatShininess);\n\n                    this.uniformFloatTransparency._vf.name = 'transparency'+this._styleID;\n                    this.uniformFloatTransparency._vf.type = 'SFFloat';\n                    this.uniformFloatTransparency._vf.value = this._cf.material.node._vf.transperency;\n                    unis.push(this.uniformFloatTransparency);\n                }\n\n                this.uniformBoolEnableShaded._vf.name = 'uEnableShaded'+this._styleID;\n                this.uniformBoolEnableShaded._vf.type = 'SFBool';\n                this.uniformBoolEnableShaded._vf.value = this._vf.enabled;\n                unis.push(this.uniformBoolEnableShaded);\n\n                return unis;\n            },\n\n            textures: function() {\n                var texs = [];\n                if (this._cf.surfaceNormals.node) {\n                    var tex = this._cf.surfaceNormals.node;\n                    tex._vf.repeatS = false;\n                    tex._vf.repeatT = false;\n                    texs.push(tex)\n                }\n                return texs;\n            },\n\n            styleUniformsShaderText: function(){\n                var uniformText = \"uniform bool uLightning\"+this._styleID+\";\\n\"+\n                \"uniform bool uShadows\"+this._styleID+\";\\n\"+\n                //Fog uniforms\n                \"uniform float fogRange;\\n\"+\n                \"uniform vec3 fogColor;\\n\"+\n                \"uniform float fogType;\\n\"+\n                \"uniform bool uEnableShaded\"+this._styleID+\";\\n\";\n                //Material uniforms\n                if(this._cf.material.node){\n                    uniformText += \"uniform vec3  diffuseColor\"+this._styleID+\";\\n\"+\n                    \"uniform vec3  specularColor\"+this._styleID+\";\\n\"+\n                    \"uniform vec3  emissiveColor\"+this._styleID+\";\\n\"+\n                    \"uniform float shininess\"+this._styleID+\";\\n\"+\n                    \"uniform float transparency\"+this._styleID+\";\\n\"+\n                    \"uniform float ambientIntensity\"+this._styleID+\";\\n\";\n                }\n                return uniformText;\n            },\n\n            styleShaderText: function(){\n                if(this._first){\n                    return \"float computeFogInterpolant(float distanceFromPoint)\\n\"+\n                    \"{\\n\"+\n                    \"  if (distanceFromPoint > fogRange){\\n\"+\n                    \"    return 0.0;\\n\"+\n                    \"  }else if (fogType == 0.0){\\n\"+\n                    \"    return clamp((fogRange-distanceFromPoint) / fogRange, 0.0, 1.0);\\n\"+\n                    \"  }else{\\n\"+\n                    \"    return clamp(exp(-distanceFromPoint / (fogRange-distanceFromPoint)), 0.0, 1.0);\\n\"+\n                    \"  }\\n\"+\n                    \"}\\n\";\n                }else{\n                    return \"\";\n                }\n            },\n\n            lightEquationShaderText: function(){\n                if(this._first){\n                    return \"void lighting(in float lType, in vec3 lLocation, in vec3 lDirection, in vec3 lColor, in vec3 lAttenuation, \" + \n                    \"in float lRadius, in float lIntensity, in float lAmbientIntensity, in float lBeamWidth, \" +\n                    \"in float lCutOffAngle, in float ambientIntensity, in float shininess, in vec3 N, in vec3 V, inout vec3 ambient, inout vec3 diffuse, \" +\n                    \"inout vec3 specular)\\n\" +\n                    \"{\\n\" +\n                    \"   vec3 L;\\n\" +\n                    \"   float spot = 1.0, attentuation = 0.0;\\n\" +\n                    \"   if(lType == 0.0) {\\n\" +\n                    \"       L = -normalize(lDirection);\\n\" +\n                    \"       V = normalize(V);\\n\" +\n                    \"       attentuation = 1.0;\\n\" +\n                    \"   } else{\\n\" +\n                    \"       L = (lLocation - (-V));\\n\" +\n                    \"       float d = length(L);\\n\" +\n                    \"       L = normalize(L);\\n\" +\n                    \"       V = normalize(V);\\n\" +\n                    \"       if(lRadius == 0.0 || d <= lRadius) {\\n\" +\n                    \"           attentuation = 1.0 / max(lAttenuation.x + lAttenuation.y * d + lAttenuation.z * (d * d), 1.0);\\n\" +\n                    \"       }\\n\" +\n                    \"       if(lType == 2.0) {\\n\" +\n                    \"           float spotAngle = acos(max(0.0, dot(-L, normalize(lDirection))));\\n\" +\n                    \"           if(spotAngle >= lCutOffAngle) spot = 0.0;\\n\" +\n                    \"           else if(spotAngle <= lBeamWidth) spot = 1.0;\\n\" +\n                    \"           else spot = (spotAngle - lCutOffAngle ) / (lBeamWidth - lCutOffAngle);\\n\" +\n                    \"       }\\n\" +\n                    \"   }\\n\" +\n                    \"   vec3 H = normalize( L + V );\\n\" +\n                    \"   float NdotL = max(0.0, dot(L, N));\\n\" +\n                    \"   float NdotH = max(0.0, dot(H, N));\\n\" +\n                    \"   float ambientFactor = lAmbientIntensity * ambientIntensity;\\n\" +\n                    \"   float diffuseFactor = lIntensity * NdotL;\\n\" +\n                    \"   float specularFactor = lIntensity * pow(NdotH, shininess*128.0);\\n\" +\n                    \"   ambient += lColor * ambientFactor * attentuation * spot;\\n\" +\n                    \"   diffuse += lColor * diffuseFactor * attentuation * spot;\\n\" +\n                    \"   specular += lColor * specularFactor * attentuation * spot;\\n\" +\n                    \"}\\n\";\n                }else{\n                    return \"\";\n                }               \n            },\n\n            inlineStyleShaderText: function(){\n                if(this._first){\n                    return \"    float fogFactor = computeFogInterpolant(length(cam_pos-ray_pos));\\n\";\n                }else{\n                    return \"\";\n                }\n            },\n\n            lightAssigment: function(){\n                var shaderText = \"    if(uEnableShaded\"+this._styleID+\"){\\n\";\n                for(var l=0; l<x3dom.nodeTypes.X3DLightNode.lightID; l++) {\n                    shaderText += \"    lighting(light\"+l+\"_Type, \" +\n                    \"light\"+l+\"_Location, \" +\n                    \"light\"+l+\"_Direction, \" +\n                    \"light\"+l+\"_Color, \" + \n                    \"light\"+l+\"_Attenuation, \" +\n                    \"light\"+l+\"_Radius, \" +\n                    \"light\"+l+\"_Intensity, \" + \n                    \"light\"+l+\"_AmbientIntensity, \" +\n                    \"light\"+l+\"_BeamWidth, \" +\n                    \"light\"+l+\"_CutOffAngle, \" +\n                    \"ambientIntensity\"+this._styleID+\", \"+\n                    \"shininess\"+this._styleID+\", \"+\n                    \"grad.xyz, positionE.xyz, ambient, diffuse, specular);\\n\";\n                }\n                if(this._vf.lighting == true){\n                    if(this._cf.material.node){\n                        shaderText += \"      value.rgb = (fogColor*(1.0-fogFactor))+fogFactor*(emissiveColor\"+this._styleID+\" + ambient*value.rgb + diffuse*diffuseColor\"+this._styleID+\"*value.rgb + specular*specularColor\"+this._styleID+\");\\n\"+\n                        \"      value.a = value.a*(1.0-transparency\"+this._styleID+\");\\n\";\n                    }else{\n                        shaderText += \"      value.rgb = (fogColor*(1.0-fogFactor))+fogFactor*(ambient*value.rgb + diffuse*value.rgb + specular);\\n\";\n                    }\n                }\n                shaderText += \"    }\\n\";\n                return shaderText;\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * MEDX3DOM JavaScript Library\n * http://medx3dom.org\n *\n * (C)2011 Vicomtech Research Center,\n *         Donostia - San Sebastian\n * Dual licensed under the MIT and GPL.\n *\n * Based on code originally provided by\n * http://www.x3dom.org\n */\n\n/* ### SilhouetteEnhancementVolumeStyle ### */\nx3dom.registerNodeType(\n    \"SilhouetteEnhancementVolumeStyle\",\n    \"VolumeRendering\",\n    defineClass(x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode,\n        \n        /**\n         * Constructor for SilhouetteEnhancementVolumeStyle\n         * @constructs x3dom.nodeTypes.SilhouetteEnhancementVolumeStyle\n         * @x3d x.x\n         * @component VolumeRendering\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The SilhouetteEnhancementVolumeStyle node specifies that silhouettes of the assocciated volume data are going to be enhanced.\n         * Voxels opacity are modified based on their normals orientation relative to the view direction. When the normal orientation is perpendicular towards the view direction,\n         * voxels are darkened, whereas when it is parallel towards the view direction, the opacity is not enhanced.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.SilhouetteEnhancementVolumeStyle.superClass.call(this, ctx);\n\n\n            /**\n             * The silhouetteBoundaryOpacity field is a factor to specify the amount of silhouette enhancement to use.\n             * @var {x3dom.fields.SFFloat} silhouetteBoundaryOpacity\n             * @memberof x3dom.nodeTypes.SilhouetteEnhancementVolumeStyle\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'silhouetteBoundaryOpacity', 0);\n\n            /**\n             * The silhouetteRetainedOpacity field is a factor to specify the amount of original opacity to retain.\n             * @var {x3dom.fields.SFFloat} silhouetteRetainedOpacity\n             * @memberof x3dom.nodeTypes.SilhouetteEnhancementVolumeStyle\n             * @initvalue 1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'silhouetteRetainedOpacity', 1);\n\n            /**\n             * The silhouetteSharpness field is an exponent factor to specify the silhouette sharpness.\n             * @var {x3dom.fields.SFFloat} silhouetteSharpness\n             * @memberof x3dom.nodeTypes.SilhouetteEnhancementVolumeStyle\n             * @initvalue 0.5\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'silhouetteSharpness', 0.5);\n\n            this.uniformFloatBoundaryOpacity = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformFloatRetainedOpacity = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformFloatSilhouetteSharpness = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformSampler2DSurfaceNormals = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformBoolEnableSilhouette = new x3dom.nodeTypes.Uniform(ctx);\n        \n        },\n        { \n            fieldChanged: function(fieldName){\n                switch(fieldName){\n                    case 'silhouetteBoundaryOpacity':\n                        this.uniformFloatBoundaryOpacity._vf.value = this._vf.silhouetteBoundaryOpacity;\n                        this.uniformFloatBoundaryOpacity.fieldChanged(\"value\");\n                        break;\n                    case 'silhouetteRetainedOpacity':\n                        this.uniformFloatRetainedOpacity._vf.value = this._vf.silhouetteRetainedOpacity;\n                        this.uniformFloatRetainedOpacity.fieldChanged(\"value\");\n                        break;\n                    case 'silhouetteSharpness':\n                        this.uniformFloatSilhouetteSharpness._vf.value = this._vf.silhouetteSharpness;\n                        this.uniformFloatSilhouetteSharpness.fieldChanged(\"value\");\n                        break;\n                }\n            },\n\n            uniforms: function(){\n                var unis = [];\n                if (this._cf.surfaceNormals.node) {\n                    this.uniformSampler2DSurfaceNormals._vf.name = 'uSurfaceNormals';\n                    this.uniformSampler2DSurfaceNormals._vf.type = 'SFInt32';\n                    this.uniformSampler2DSurfaceNormals._vf.value = this._volumeDataParent._textureID++;\n                    unis.push(this.uniformSampler2DSurfaceNormals);\n                }\n\n                this.uniformFloatBoundaryOpacity._vf.name = 'uSilhouetteBoundaryOpacity'+this._styleID;\n                this.uniformFloatBoundaryOpacity._vf.type = 'SFFloat';\n                this.uniformFloatBoundaryOpacity._vf.value = this._vf.silhouetteBoundaryOpacity;\n                unis.push(this.uniformFloatBoundaryOpacity);\n\n                this.uniformFloatRetainedOpacity._vf.name = 'uSilhouetteRetainedOpacity'+this._styleID;\n                this.uniformFloatRetainedOpacity._vf.type = 'SFFloat';\n                this.uniformFloatRetainedOpacity._vf.value = this._vf.silhouetteRetainedOpacity;\n                unis.push(this.uniformFloatRetainedOpacity);\n\n                this.uniformFloatSilhouetteSharpness._vf.name = 'uSilhouetteSharpness'+this._styleID;\n                this.uniformFloatSilhouetteSharpness._vf.type = 'SFFloat';\n                this.uniformFloatSilhouetteSharpness._vf.value = this._vf.silhouetteSharpness;\n                unis.push(this.uniformFloatSilhouetteSharpness);\n\n                this.uniformBoolEnableSilhouette._vf.name = 'uEnableSilhouette'+this._styleID;\n                this.uniformBoolEnableSilhouette._vf.type = 'SFBool';\n                this.uniformBoolEnableSilhouette._vf.value = this._vf.enabled;\n                unis.push(this.uniformBoolEnableSilhouette);\n\n                return unis;\n            },\n\n            textures: function() {\n                var texs = [];\n                if (!(this._cf.surfaceNormals.node==null)) {\n                    var tex = this._cf.surfaceNormals.node;\n                    tex._vf.repeatS = false;\n                    tex._vf.repeatT = false;\n                    texs.push(tex)\n                }\n                return texs;\n            },\n\n            styleUniformsShaderText: function(){\n                return \"uniform float uSilhouetteBoundaryOpacity\"+this._styleID+\";\\n\"+\n                    \"uniform float uSilhouetteRetainedOpacity\"+this._styleID+\";\\n\"+\n                    \"uniform float uSilhouetteSharpness\"+this._styleID+\";\\n\"+\n                    \"uniform bool uEnableSilhouette\"+this._styleID+\";\\n\";\n            },\n\n            styleShaderText: function(){\n                if (this._first){\n                    return \"void silhouetteEnhancement(inout vec4 orig_color, in vec4 normal, in vec3 V, in float sBoundary, in float sRetained, in float sSharpness)\\n\"+\n                    \"{\\n\"+\n                    \"   if(normal.w > 0.02){\\n\"+\n                    \"       orig_color.a = orig_color.a * (sRetained + sBoundary * pow((1.0-abs(dot(normal.xyz, V))), sSharpness));\\n\"+\n                    \"   }\\n\"+\n                    \"}\\n\"+\n                    \"\\n\";\n                }else{\n                    return \"\";\n                }                \n            },\n\n            inlineStyleShaderText: function(){\n                var inlineText = \"  if(uEnableSilhouette\"+this._styleID+\"){\\n\"+\n                \"       silhouetteEnhancement(value, gradEye, dir, uSilhouetteBoundaryOpacity\"+this._styleID+\", uSilhouetteRetainedOpacity\"+this._styleID+\", uSilhouetteSharpness\"+this._styleID+\");\\n\"+\n                \"   }\\n\";\n                return inlineText;\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * MEDX3DOM JavaScript Library\n * http://medx3dom.org\n *\n * (C)2011 Vicomtech Research Center,\n *         Donostia - San Sebastian\n * Dual licensed under the MIT and GPL.\n *\n * Based on code originally provided by\n * http://www.x3dom.org\n */\n\n/* ### StippleVolumeStyle ### */\nx3dom.registerNodeType(\n    \"StippleVolumeStyle\",\n    \"VolumeRendering\",\n    defineClass(x3dom.nodeTypes.X3DVolumeRenderStyleNode,\n        \n        /**\n         * Constructor for StippleVolumeStyle\n         * @constructs x3dom.nodeTypes.StippleVolumeStyle\n         * @x3d x.x\n         * @component VolumeRendering\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DVolumeRenderStyleNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc NYI!!\n         */\n        function (ctx) {\n            x3dom.nodeTypes.StippleVolumeStyle.superClass.call(this, ctx);\n\n\n            /**\n             *\n             * @var {x3dom.fields.SFFloat} distanceFactor\n             * @memberof x3dom.nodeTypes.StippleVolumeStyle\n             * @initvalue 1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'distanceFactor', 1);\n\n            /**\n             *\n             * @var {x3dom.fields.SFFloat} interiorFactor\n             * @memberof x3dom.nodeTypes.StippleVolumeStyle\n             * @initvalue 1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'interiorFactor', 1);\n\n            /**\n             *\n             * @var {x3dom.fields.SFFloat} lightingFactor\n             * @memberof x3dom.nodeTypes.StippleVolumeStyle\n             * @initvalue 1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'lightingFactor', 1);\n\n            /**\n             *\n             * @var {x3dom.fields.SFFloat} gradientThreshold\n             * @memberof x3dom.nodeTypes.StippleVolumeStyle\n             * @initvalue 0.4\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'gradientThreshold', 0.4);\n\n            /**\n             *\n             * @var {x3dom.fields.SFFloat} gradientRetainedOpacity\n             * @memberof x3dom.nodeTypes.StippleVolumeStyle\n             * @initvalue 1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'gradientRetainedOpacity', 1);\n\n            /**\n             *\n             * @var {x3dom.fields.SFFloat} gradientBoundaryOpacity\n             * @memberof x3dom.nodeTypes.StippleVolumeStyle\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'gradientBoundaryOpacity', 0);\n\n            /**\n             *\n             * @var {x3dom.fields.SFFloat} gradientOpacityFactor\n             * @memberof x3dom.nodeTypes.StippleVolumeStyle\n             * @initvalue 1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'gradientOpacityFactor', 1);\n\n            /**\n             *\n             * @var {x3dom.fields.SFFloat} silhouetteRetainedOpacity\n             * @memberof x3dom.nodeTypes.StippleVolumeStyle\n             * @initvalue 1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'silhouetteRetainedOpacity', 1);\n\n            /**\n             *\n             * @var {x3dom.fields.SFFloat} silhouetteBoundaryOpacity\n             * @memberof x3dom.nodeTypes.StippleVolumeStyle\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'silhouetteBoundaryOpacity', 0);\n\n            /**\n             *\n             * @var {x3dom.fields.SFFloat} silhouetteOpacityFactor\n             * @memberof x3dom.nodeTypes.StippleVolumeStyle\n             * @initvalue 1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'silhouetteOpacityFactor', 1);\n\n            /**\n             *\n             * @var {x3dom.fields.SFFloat} resolutionFactor\n             * @memberof x3dom.nodeTypes.StippleVolumeStyle\n             * @initvalue 1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'resolutionFactor', 1);\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * MEDX3DOM JavaScript Library\n * http://medx3dom.org\n *\n * (C)2011 Vicomtech Research Center,\n *         Donostia - San Sebastian\n * Dual licensed under the MIT and GPL.\n *\n * Based on code originally provided by\n * http://www.x3dom.org\n */\n\n/* ### ToneMappedVolumeStyle ### */\nx3dom.registerNodeType(\n    \"ToneMappedVolumeStyle\",\n    \"VolumeRendering\",\n    defineClass(x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode,\n        \n        /**\n         * Constructor for ToneMappedVolumeStyle\n         * @constructs x3dom.nodeTypes.ToneMappedVolumeStyle\n         * @x3d x.x\n         * @component VolumeRendering\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The ToneMappedVolumeStyle node specifies that the associated volume rendering data is going to be rendered following the Gooch et. al. shading model.\n         * Two colors are used: warm and cool to shade the volume data based on the light direction. \n         */\n        function (ctx) {\n            x3dom.nodeTypes.ToneMappedVolumeStyle.superClass.call(this, ctx);\n\n\n            /**\n             * The coolColor field specifies the color to be used for surfaces facing away of the light direction.\n             * @var {x3dom.fields.SFColor} coolColor\n             * @memberof x3dom.nodeTypes.ToneMappedVolumeStyle\n             * @initvalue 0,0,1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFColor(ctx, 'coolColor', 0, 0, 1);\n\n            /**\n             * The warmColor field specifies the color to be used for surfaces facing towards the light direction.\n             * @var {x3dom.fields.SFColor} warmColor\n             * @memberof x3dom.nodeTypes.ToneMappedVolumeStyle\n             * @initvalue 1,1,0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFColor(ctx, 'warmColor', 1, 1, 0);\n\n            this.uniformCoolColor = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformWarmColor = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformSampler2DSurfaceNormals = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformBoolEnableToneMapped = new x3dom.nodeTypes.Uniform(ctx);\n        \n        },\n        {\n            fieldChanged: function(fieldName){\n                switch(fieldName){\n                    case 'coolColor':\n                        this.uniformCoolColor._vf.value = this._vf.coolColor;\n                        this.uniformCoolColor.fieldChanged(\"value\");\n                        break;\n                    case 'warmColor':\n                        this.uniformWarmColor._vf.value = this._vf.warmColor;\n                        this.uniformWarmColor.fieldChanged(\"value\");\n                        break;\n                }\n            },\n\n            uniforms: function(){\n                var unis = [];\n                if (this._cf.surfaceNormals.node) {\n                    this.uniformSampler2DSurfaceNormals._vf.name = 'uSurfaceNormals';\n                    this.uniformSampler2DSurfaceNormals._vf.type = 'SFInt32';\n                    this.uniformSampler2DSurfaceNormals._vf.value = this._volumeDataParent._textureID++;\n                    unis.push(this.uniformSampler2DSurfaceNormals);\n                }\n\n                this.uniformCoolColor._vf.name = 'uCoolColor'+this._styleID;\n                this.uniformCoolColor._vf.type = 'SFColor';\n                this.uniformCoolColor._vf.value = this._vf.coolColor;\n                unis.push(this.uniformCoolColor);\n\n                this.uniformWarmColor._vf.name = 'uWarmColor'+this._styleID;\n                this.uniformWarmColor._vf.type = 'SFColor';\n                this.uniformWarmColor._vf.value = this._vf.warmColor;\n                unis.push(this.uniformWarmColor);\n\n                this.uniformBoolEnableToneMapped._vf.name = 'uEnableToneMapped'+this._styleID;\n                this.uniformBoolEnableToneMapped._vf.type = 'SFBool';\n                this.uniformBoolEnableToneMapped._vf.value = this._vf.enabled;\n                unis.push(this.uniformBoolEnableToneMapped);\n\n                return unis;\n            },\n\n            textures: function() {\n                var texs = [];\n                if (this._cf.surfaceNormals.node) {\n                    var tex = this._cf.surfaceNormals.node;\n                    tex._vf.repeatS = false;\n                    tex._vf.repeatT = false;\n                    texs.push(tex)\n                }\n                return texs;\n            },\n\n            styleUniformsShaderText: function(){\n                return \"uniform vec3 uCoolColor\"+this._styleID+\";\\n\"+\n                \"uniform vec3 uWarmColor\"+this._styleID+\";\\n\"+\n                \"uniform bool uEnableToneMapped\"+this._styleID+\";\\n\";\n            },\n\n            styleShaderText: function(){\n                if (this._first){\n                    return \"void toneMapped(inout vec4 original_color, inout vec3 accum_color, in vec4 surfNormal, in vec3 lightDir, in vec3 cColor, in vec3 wColor)\\n\"+\n                    \"{\\n\"+\n                    \"   if(surfNormal.a > 0.02){\\n\"+\n                    \"       float color_factor = (1.0 + dot(lightDir, surfNormal.xyz))*0.5;\\n\"+\n                    \"       accum_color += mix(wColor, cColor, color_factor);\\n\"+\n                    \"       original_color.rgb = accum_color;\\n\"+\n                    \"   }else{\\n\"+\n                    \"       accum_color += mix(wColor, cColor, 0.5);\\n\"+\n                    \"       original_color.rgb = accum_color;\\n\"+\n                    \"   }\\n\"+\n                    \"}\\n\";\n                }else{\n                    return \"\";\n                }\n            },\n\n            inlineStyleShaderText: function(){\n                var shaderText = \"    if(uEnableToneMapped\"+this._styleID+\"){\\n\"+\n                \"       vec3 toneColor = vec3(0.0, 0.0, 0.0);\\n\"+\n                \"       vec3 L = vec3(0.0, 0.0, 0.0);\\n\";\n                for(var l=0; l<x3dom.nodeTypes.X3DLightNode.lightID; l++) {\n                    shaderText += \"       L = (light\"+l+\"_Type == 1.0) ? normalize(light\"+l+\"_Location - positionE.xyz) : -light\"+l+\"_Direction;\\n\"+\n                    \"       toneMapped(value, toneColor, grad, L, uCoolColor\"+this._styleID+\", uWarmColor\"+this._styleID+\");\\n\";\n                }\n                shaderText += \"    }\\n\";\n                return shaderText;\n            },\n\n            lightAssigment: function(){\n                //return \" value.rgb = ambient*value.rgb + diffuse*value.rgb + specular;\\n\";\n                return \"\";\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n\n/* ### RadarVolumeStyle ### \n *\n * Based on code originally provided by\n * http://www.x3dom.org\n * \n * Copyright (C) 2016 Toshiba Corporation\n * Dual licensed under the MIT and GPL.\n */\n\nx3dom.registerNodeType(\n    \"RadarVolumeStyle\",\n    \"VolumeRendering\",\n    defineClass(x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode,\n        \n        /**\n         * Constructor for RadarVolumeStyle\n         * @constructs x3dom.nodeTypes.RadarVolumeStyle\n         * @x3d x.x\n         * @component VolumeRendering\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * The YouCanEnterVolumeStyle node specifies that the associated volume data is going to be rendered using a transfer function.\n         * The original opacity is mapped to a color with a function stored as a texture (transfer function).\n         */\n        function (ctx) {\n            x3dom.nodeTypes.RadarVolumeStyle.superClass.call(this, ctx);\n\n\n            /**\n             * The transferFunction field is a texture that is going to be used to map each voxel value to a specific color output.\n             * @var {x3dom.fields.SFNode} transferFunction\n             * @memberof x3dom.nodeTypes.RadarVolumeStyle\n             * @initvalue x3dom.nodeTypes.Texture\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('transferFunction', x3dom.nodeTypes.Texture);\n\n            /**\n             * NYI!!\n             * @var {x3dom.fields.SFString} type\n             * @memberof x3dom.nodeTypes.RadarVolumeStyle\n             * @initvalue \"simple\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'type', \"simple\");\n\n            /**\n             * The opacityFactor field is a factor to specify the amount of opacity to be considered on each sampled point along the ray traversal.\n             * @var {x3dom.fields.SFFloat} opacityFactor\n             * @memberof x3dom.nodeTypes.RadarVolumeStyle\n             * @initvalue 6.0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'opacityFactor', 6.0);\n\n            /**\n             * The lightFactor field is a factor to specify the amount of global light to be considered on each sampled point along the ray traversal.\n             * @var {x3dom.fields.SFFloat} lightFactor\n             * @memberof x3dom.nodeTypes.RadarVolumeStyle\n             * @initvalue 1.2\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'lightFactor', 1.2);\n\n            this.uniformFloatOpacityFactor = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformFloatLightFactor = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformSampler2DTransferFunction = new x3dom.nodeTypes.Uniform(ctx);\n            this.uniformBoolEnableOpacityMap = new x3dom.nodeTypes.Uniform(ctx);\n        \n        },\n        {\n            fieldChanged: function(fieldName){\n                switch(fieldName){\n                    case 'opacityFactor':\n                        this.uniformFloatOpacityFactor._vf.value = this._vf.opacityFactor;\n                        this.uniformFloatOpacityFactor.fieldChanged(\"value\");\n                        break;\n                    case 'lightFactor':\n                        this.uniformFloatLightFactor._vf.value = this._vf.lightFactor;\n                        this.uniformFloatLightFactor.fieldChanged(\"value\");\n                        break;\n                }\n            },\n\n            uniforms: function() {\n                var unis = [];\n                \n                if (this._cf.transferFunction.node) {\n                    this.uniformSampler2DTransferFunction._vf.name = 'uTransferFunction'+this._styleID;\n                    this.uniformSampler2DTransferFunction._vf.type = 'SFInt32';\n                    this.uniformSampler2DTransferFunction._vf.value = this._volumeDataParent._textureID++;\n                    unis.push(this.uniformSampler2DTransferFunction);\n                }\n\n                this.uniformFloatOpacityFactor._vf.name = 'uOpacityFactor'+this._styleID;\n                this.uniformFloatOpacityFactor._vf.type = 'SFFloat';\n                this.uniformFloatOpacityFactor._vf.value = this._vf.opacityFactor;\n                unis.push(this.uniformFloatOpacityFactor);\n\n                this.uniformFloatLightFactor._vf.name = 'uLightFactor'+this._styleID;\n                this.uniformFloatLightFactor._vf.type = 'SFFloat';\n                this.uniformFloatLightFactor._vf.value = this._vf.lightFactor;\n                unis.push(this.uniformFloatLightFactor);\n\n                this.uniformBoolEnableOpacityMap._vf.name = 'uEnableOpacityMap'+this._styleID;\n                this.uniformBoolEnableOpacityMap._vf.type = 'SFBool';\n                this.uniformBoolEnableOpacityMap._vf.value = this._vf.enabled;\n                unis.push(this.uniformBoolEnableOpacityMap);\n\n                return unis;\n            },\n\n            textures: function() {\n                var texs = [];\n                var tex = this._cf.transferFunction.node;\n                if (tex) {\n                    tex._vf.repeatS = false;\n                    tex._vf.repeatT = false;\n                    texs.push(tex);\n                }\n                return texs;\n            },\n\n            styleUniformsShaderText: function() {\n                var uniformsText = \"uniform float uOpacityFactor\"+this._styleID+\";\\n\"+\n                \"uniform float uLightFactor\"+this._styleID+\";\\n\"+\n                \"uniform bool uEnableOpacityMap\"+this._styleID+\";\\n\";\n                if (this._cf.transferFunction.node) {\n                        uniformsText += \"uniform sampler2D uTransferFunction\"+this._styleID+\";\\n\";\n                }\n                return uniformsText;\n            },\n\n            inlineStyleShaderText: function(){\n/*                 var shaderText = \"    if(uEnableOpacityMap\"+this._styleID+\"){\\n\"+\n                \"       opacityFactor = uOpacityFactor\"+this._styleID+\";\\n\"+\n                \"       lightFactor = uLightFactor\"+this._styleID+\";\\n\";\n                if (this._cf.transferFunction.node){\n                        shaderText += \"       value = texture2D(uTransferFunction\"+this._styleID+\",vec2(value.r,0.5));\\n\";\n                }\n                shaderText += \"    }\\n\";*/\n                var shaderText = \"    if(uEnableOpacityMap\"+this._styleID+\"){\\n\"+\n                \"       opacityFactor = uOpacityFactor\"+this._styleID+\";\\n\"+\n                \"       lightFactor = uLightFactor\"+this._styleID+\";\\n\";\n                if (this._cf.transferFunction.node){\n                        shaderText += \"       if(value.r > 0.3){\\n\";\n                        shaderText += \"         value = texture2D(uTransferFunction\"+this._styleID+\",vec2(value.r,0.5));\\n\";\n                        shaderText += \"       }else{\\n\"\n                        shaderText += \"         value.a = 0.0;\\n\";\n                        shaderText += \"       }\\n\"\n                }\n                shaderText += \"    }\\n\";\n                return shaderText;\n            }\n        }\n    )\n);\n\n\n\n\n\n/** @namespace x3dom.nodeTypes */\n/*\n * MEDX3DOM JavaScript Library\n * http://medx3dom.org\n *\n * (C)2011 Vicomtech Research Center,\n *         Donostia - San Sebastian\n * Dual licensed under the MIT and GPL.\n *\n * Based on code originally provided by\n * http://www.x3dom.org\n */\n\n/* ### VolumeData ### */\nx3dom.registerNodeType(\n    \"VolumeData\",\n    \"VolumeRendering\",\n    defineClass(x3dom.nodeTypes.X3DVolumeDataNode,\n        \n        /**\n         * Constructor for VolumeData\n         * @constructs x3dom.nodeTypes.VolumeData\n         * @x3d x.x\n         * @component VolumeRendering\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DVolumeDataNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The VolumeData node specifies a non-segmented volume data to be rendered with a volume rendering style.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.VolumeData.superClass.call(this, ctx);\n\n\n            /**\n             * Specifies the render style to be applied on the volume data.\n             * @var {x3dom.fields.SFNode} renderStyle\n             * @memberof x3dom.nodeTypes.VolumeData\n             * @initvalue x3dom.nodeTypes.X3DVolumeRenderStyleNode\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFNode('renderStyle', x3dom.nodeTypes.X3DVolumeRenderStyleNode);\n\n            this.vrcMultiTexture = new x3dom.nodeTypes.MultiTexture(ctx);\n            this.vrcVolumeTexture = null;\n\n            this.vrcSinglePassShader = new x3dom.nodeTypes.ComposedShader(ctx);\n            this.vrcSinglePassShaderVertex = new x3dom.nodeTypes.ShaderPart(ctx);\n            this.vrcSinglePassShaderFragment = new x3dom.nodeTypes.ShaderPart(ctx);\n            this.vrcSinglePassShaderFieldBackCoord = new x3dom.nodeTypes.Field(ctx);\n            this.vrcSinglePassShaderFieldVolData = new x3dom.nodeTypes.Field(ctx);\n            this.vrcSinglePassShaderFieldOffset = new x3dom.nodeTypes.Field(ctx);\n            this.vrcSinglePassShaderFieldDimensions = new x3dom.nodeTypes.Field(ctx);\n        \n        },\n        {\n            initializeValues: function() {\n                var initialValues =\"\";\n                if(this._cf.renderStyle.node.initializeValues != undefined){\n                    initialValues += this._cf.renderStyle.node.initializeValues();\n                }\n                return initialValues;\n            },\n\n            styleUniformsShaderText: function(){\n                var styleUniformsText = this._cf.renderStyle.node.styleUniformsShaderText();\n                this.surfaceNormalsNeeded = true;\n                if(this._cf.renderStyle.node._cf.surfaceNormals && this._cf.renderStyle.node._cf.surfaceNormals.node != null){\n                    styleUniformsText += \"uniform sampler2D uSurfaceNormals;\\n\"; //Neccessary when gradient is provided\n                    this.normalTextureProvided = true;\n                    this.surfaceNormals = this._cf.renderStyle.node._cf.surfaceNormals.node;\n                }else if(x3dom.isa(this._cf.renderStyle.node, x3dom.nodeTypes.OpacityMapVolumeStyle)){ //OpacityMap does not use surface normals\n                    this.surfaceNormalsNeeded = false;\n                    this.normalTextureProvided = false;\n                }\n                return styleUniformsText;\n            },\n\n            styleShaderText: function(){\n                var styleText = \"\";\n                if(this._cf.renderStyle.node.styleShaderText != undefined){\n                    styleText += this._cf.renderStyle.node.styleShaderText();\n                }\n                return styleText;\n            },\n\n            inlineStyleShaderText: function(){\n                return this._cf.renderStyle.node.inlineStyleShaderText();\n            },\n\n            lightAssigment: function(){\n                return this._cf.renderStyle.node.lightAssigment();\n            },\n\n            //Obtain the light equation from the render style child node\n            lightEquationShaderText: function(){\n                return this._cf.renderStyle.node.lightEquationShaderText();\n            },\n\n            // nodeChanged is called after subtree is parsed and attached in DOM\n            nodeChanged: function()\n            {\n                // uhhhh, manually build backend-graph scene-subtree,\n                // therefore, try to mimic depth-first parsing scheme\n                if (!this._cf.appearance.node) \n                {\n                    var i;\n\n                    this.addChild(new x3dom.nodeTypes.Appearance());\n\n                    // create shortcut to volume data set\n                    this.vrcVolumeTexture = this._cf.voxels.node;\n                    this.vrcVolumeTexture._vf.repeatS = false;\n                    this.vrcVolumeTexture._vf.repeatT = false;\n\n                    this.vrcMultiTexture._nameSpace = this._nameSpace;\n                    \n                    this.vrcMultiTexture.addChild(this.vrcVolumeTexture, 'texture');\n                    this.vrcVolumeTexture.nodeChanged();\n                    \n                    // textures from styles\n                    if (this._cf.renderStyle.node.textures) {\n                        var styleTextures = this._cf.renderStyle.node.textures();\n                        for (i = 0; i<styleTextures.length; i++)\n                        {\n                            this.vrcMultiTexture.addChild(styleTextures[i], 'texture');\n                            this.vrcVolumeTexture.nodeChanged();\n                        }\n                    }\n                    \n                    this._cf.appearance.node.addChild(this.vrcMultiTexture);\n                    this.vrcMultiTexture.nodeChanged();\n\n                    //Update child node private properties\n                    this._cf.renderStyle.node.updateProperties(this);\n\n                    // here goes the volume shader\n                    this.vrcSinglePassShaderVertex._vf.type = 'vertex';\n                    this.vrcSinglePassShaderVertex._vf.url[0]=this.vertexShaderText(x3dom.isa(this._cf.renderStyle.node, x3dom.nodeTypes.RadarVolumeStyle));\n\n                    this.vrcSinglePassShaderFragment._vf.type = 'fragment';\n                    var shaderText = \"\";\n                    if (x3dom.isa(this._cf.renderStyle.node, x3dom.nodeTypes.X3DComposableVolumeRenderStyleNode)) {\n                        shaderText += this.fragmentPreamble+\n                        this.defaultUniformsShaderText(this.vrcVolumeTexture._vf.numberOfSlices, this.vrcVolumeTexture._vf.slicesOverX, this.vrcVolumeTexture._vf.slicesOverY)+\n                        this.styleUniformsShaderText()+\n                        this.styleShaderText()+\n                        this.texture3DFunctionShaderText+\n                        this.normalFunctionShaderText()+\n                        this.lightEquationShaderText()+\n                        this.defaultLoopFragmentShaderText(this.inlineStyleShaderText(), this.lightAssigment(), this.initializeValues());\n                    }else{\n                        shaderText += this._cf.renderStyle.node.fragmentShaderText(\n                            this.vrcVolumeTexture._vf.numberOfSlices,\n                            this.vrcVolumeTexture._vf.slicesOverX, \n                            this.vrcVolumeTexture._vf.slicesOverY);\n                    }\n                    this.vrcSinglePassShaderFragment._vf.url[0]= shaderText;\n\n                    this.vrcSinglePassShader.addChild(this.vrcSinglePassShaderVertex, 'parts');\n                    this.vrcSinglePassShaderVertex.nodeChanged();\n                    \n                    this.vrcSinglePassShader.addChild(this.vrcSinglePassShaderFragment, 'parts');\n                    this.vrcSinglePassShaderFragment.nodeChanged();\n\n                    this.vrcSinglePassShaderFieldVolData._vf.name = 'uVolData';\n                    this.vrcSinglePassShaderFieldVolData._vf.type = 'SFInt32';\n                    this.vrcSinglePassShaderFieldVolData._vf.value = this._textureID++;\n\n                    this.vrcSinglePassShaderFieldDimensions._vf.name = 'dimensions';\n                    this.vrcSinglePassShaderFieldDimensions._vf.type = 'SFVec3f';\n                    this.vrcSinglePassShaderFieldDimensions._vf.value = this._vf.dimensions;\n\n                    this.vrcSinglePassShaderFieldOffset._vf.name = 'offset';\n                    this.vrcSinglePassShaderFieldOffset._vf.type = 'SFVec3f';\n                    this.vrcSinglePassShaderFieldOffset._vf.value = \"0.01 0.01 0.01\"; //Default initial value\n                    \n                    this.vrcSinglePassShader.addChild(this.vrcSinglePassShaderFieldVolData, 'fields');\n                    this.vrcSinglePassShaderFieldVolData.nodeChanged();\n\n                    this.vrcSinglePassShader.addChild(this.vrcSinglePassShaderFieldDimensions, 'fields');\n                    this.vrcSinglePassShaderFieldDimensions.nodeChanged();\n\n                    this.vrcSinglePassShader.addChild(this.vrcSinglePassShaderFieldOffset, 'fields');\n \n                    //Take volume texture size for the ComposableRenderStyles offset parameter\n                    this.offsetInterval = window.setInterval((function(aTex, obj) {\n                        return function() {\n                            x3dom.debug.logInfo('[VolumeRendering][VolumeData] Looking for Volume Texture size...');\n                            var s = obj.getTextureSize(aTex);\n                            if(s.valid){\n                                clearInterval(obj.offsetInterval);\n                                obj.vrcSinglePassShaderFieldOffset._vf.value = new x3dom.fields.SFVec3f(1.0/(s.w/aTex._vf.slicesOverX), 1.0/(s.h/aTex._vf.slicesOverY), 1.0/aTex._vf.numberOfSlices);\n                                obj.vrcSinglePassShader.nodeChanged();\n                                x3dom.debug.logInfo('[VolumeRendering][VolumeData] Volume Texture size obtained');\n                            }\n                        }\n                    })(this.vrcVolumeTexture, this), 1000);\n                    \n                    var ShaderUniforms = this._cf.renderStyle.node.uniforms();\n                    for (i = 0; i<ShaderUniforms.length; i++)\n                    {\n                        this.vrcSinglePassShader.addChild(ShaderUniforms[i], 'fields');\n                    }\n                \n                    this._cf.appearance.node.addChild(this.vrcSinglePassShader);\n                    this.vrcSinglePassShader.nodeChanged();\n                    \n                    this._cf.appearance.node.nodeChanged();\n                }\n\n                if (!this._cf.geometry.node) {\n                    this.addChild(new x3dom.nodeTypes.Box());\n\n                    this._cf.geometry.node._vf.solid = false;\n                    this._cf.geometry.node._vf.hasHelperColors = false;\n                    this._cf.geometry.node._vf.size = new x3dom.fields.SFVec3f(\n                        this._vf.dimensions.x, this._vf.dimensions.y, this._vf.dimensions.z);\n\n                    // workaround to trigger field change...\n                    this._cf.geometry.node.fieldChanged(\"size\");\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### IndexedQuadSet ###\nx3dom.registerNodeType(\n    \"IndexedQuadSet\",\n    \"CADGeometry\",\n    defineClass(x3dom.nodeTypes.X3DComposedGeometryNode,\n        \n        /**\n         * Constructor for IndexedQuadSet\n         * @constructs x3dom.nodeTypes.IndexedQuadSet\n         * @x3d 3.3\n         * @component CADGeometry\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DComposedGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The IndexedQuadSet node represents a 3D shape composed of a collection of individual\n         * quadrilaterals (quads).\n         */\n        function (ctx) {\n            x3dom.nodeTypes.IndexedQuadSet.superClass.call(this, ctx);\n\n\n            /**\n             * IndexedQuadSet uses the indices in its index field to specify the vertices of each\n             * quad from the coord field.\n             * @var {x3dom.fields.MFInt32} index\n             * @memberof x3dom.nodeTypes.IndexedQuadSet\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFInt32(ctx, 'index', []);\n        \n        },\n        {\n            nodeChanged: function()\n            {\n                /*\n                 This code largely taken from the IndexedTriangleSet code\n                 */\n                var time0 = new Date().getTime();\n\n                this.handleAttribs();\n\n                var colPerVert = this._vf.colorPerVertex;\n                var normPerVert = this._vf.normalPerVertex;\n\n                var indexes = this._vf.index;\n\n                var hasNormal = false, hasTexCoord = false, hasColor = false;\n                var positions, normals, texCoords, colors;\n\n                var coordNode = this._cf.coord.node;\n                x3dom.debug.assert(coordNode);\n                positions = coordNode._vf.point;\n\n                var normalNode = this._cf.normal.node;\n                if (normalNode) {\n                    hasNormal = true;\n                    normals = normalNode._vf.vector;\n                }\n                else {\n                    hasNormal = false;\n                }\n\n                var texMode = \"\", numTexComponents = 2;\n                var texCoordNode = this._cf.texCoord.node;\n                if (x3dom.isa(texCoordNode, x3dom.nodeTypes.MultiTextureCoordinate)) {\n                    if (texCoordNode._cf.texCoord.nodes.length)\n                        texCoordNode = texCoordNode._cf.texCoord.nodes[0];\n                }\n                if (texCoordNode) {\n                    if (texCoordNode._vf.point) {\n                        hasTexCoord = true;\n                        texCoords = texCoordNode._vf.point;\n\n                        if (x3dom.isa(texCoordNode, x3dom.nodeTypes.TextureCoordinate3D)) {\n                            numTexComponents = 3;\n                        }\n                    }\n                    else if (texCoordNode._vf.mode) {\n                        texMode = texCoordNode._vf.mode;\n                    }\n                }\n                else {\n                    hasTexCoord = false;\n                }\n\n                var numColComponents = 3;\n                var colorNode = this._cf.color.node;\n                if (colorNode) {\n                    hasColor = true;\n                    colors = colorNode._vf.color;\n\n                    if (x3dom.isa(colorNode, x3dom.nodeTypes.ColorRGBA)) {\n                        numColComponents = 4;\n                    }\n                }\n                else {\n                    hasColor = false;\n                }\n\n                this._mesh._indices[0] = [];\n                this._mesh._positions[0] = [];\n                this._mesh._normals[0] = [];\n                this._mesh._texCoords[0] = [];\n                this._mesh._colors[0] = [];\n\n                var i, t, cnt, faceCnt, posMax;\n                var p0, p1, p2, n0, n1, n2, t0, t1, t2, c0, c1, c2;\n\n                // if positions array too short add degenerate triangle\n                while (positions.length % 4 > 0) {\n                    positions.push(positions.length-1);\n                }\n                posMax = positions.length;\n\n                /*\n                 Note: A separate section setting the _mesh field members\n                 and starting with this test:\n                 if (!normPerVert || positions.length > x3dom.Utils.maxIndexableCoords)\n                 is in the IndexedTriangleSet code. It has been removed\n                 here until it's applicability to the QUadSet case can\n                 be evaluated\n\n                 NOTE: !normPerVert or creaseAngle == 0 means per-face normals\n                 therefore, the original multi-index structure also can't\n                 be retained since this means every face has other vertices\n                 with other attribute properties.\n                 A similar problem arises if we have more than 2^16 coordinates\n                 since WebGL only supports 16-bit indices, why we have to split\n                 the mesh here (which is most easiest achieved by using just the\n                 same code path previously mentioned)\n                 */\n                //if (true)\n                {\n                    faceCnt = 0;\n                    for (i=0; i<indexes.length; i++)\n                    {\n                        if ((i > 0) && (i % 4 === 3 )) {\n                            faceCnt++;\n\n                            // then pushe the the 2nd triangle\n                            // of the quad on\n                            this._mesh._indices[0].push(indexes[i-3]);\n                            this._mesh._indices[0].push(indexes[i-1]);\n                            this._mesh._indices[0].push(indexes[i]);\n                        }\n                        else{\n                            this._mesh._indices[0].push(indexes[i]);\n                        }\n\n                        if(!normPerVert && hasNormal) {\n                            this._mesh._normals[0].push(normals[faceCnt].x);\n                            this._mesh._normals[0].push(normals[faceCnt].y);\n                            this._mesh._normals[0].push(normals[faceCnt].z);\n                        }\n                        if(!colPerVert && hasColor) {\n                            this._mesh._colors[0].push(colors[faceCnt].r);\n                            this._mesh._colors[0].push(colors[faceCnt].g);\n                            this._mesh._colors[0].push(colors[faceCnt].b);\n                            if (numColComponents === 4) {\n                                this._mesh._colors[0].push(colors[faceCnt].a);\n                            }\n                        }\n                    }\n\n                    this._mesh._positions[0] = positions.toGL();\n\n                    if (hasNormal) {\n                        this._mesh._normals[0] = normals.toGL();\n                    }\n                    else {\n                        this._mesh.calcNormals(normPerVert ? Math.PI : 0);\n                    }\n\n                    if (hasTexCoord) {\n                        this._mesh._texCoords[0] = texCoords.toGL();\n                        this._mesh._numTexComponents = numTexComponents;\n                    }\n                    else {\n                        this._mesh.calcTexCoords(texMode);\n                    }\n\n                    if (hasColor && colPerVert) {\n                        this._mesh._colors[0] = colors.toGL();\n                        this._mesh._numColComponents = numColComponents;\n                    }\n                }\n\n                this.invalidateVolume();\n                this._mesh._numFaces = 0;\n                this._mesh._numCoords = 0;\n                for (i=0; i<this._mesh._indices.length; i++) {\n                    this._mesh._numFaces += this._mesh._indices[i].length / 3;\n                    this._mesh._numCoords += this._mesh._positions[i].length / 3;\n                }\n\n                var time1 = new Date().getTime() - time0;\n                //x3dom.debug.logInfo(\"Mesh load time: \" + time1 + \" ms\");\n            },\n\n            fieldChanged: function(fieldName)\n            {\n                var pnts = this._cf.coord.node._vf.point;\n\n                if ( pnts.length > x3dom.Utils.maxIndexableCoords )  // are there other problematic cases?\n                {\n                    // TODO; implement\n                    x3dom.debug.logWarning(\"IndexedQuadSet: fieldChanged with \" +\n                        \"too many coordinates not yet implemented!\");\n                    return;\n                }\n\n                if (fieldName == \"coord\")\n                {\n                    this._mesh._positions[0] = pnts.toGL();\n\n                    // tells the mesh that its bbox requires update\n                    this.invalidateVolume();\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.positions = true;\n                        node.invalidateVolume();\n                    });\n                }\n                else if (fieldName == \"color\")\n                {\n                    pnts = this._cf.color.node._vf.color;\n\n                    if (this._vf.colorPerVertex) {\n\n                        this._mesh._colors[0] = pnts.toGL();\n\n                    } else if (!this._vf.colorPerVertex) {\n\n                        var faceCnt = 0;\n                        var numColComponents = 3;\n                        if (x3dom.isa(this._cf.color.node, x3dom.nodeTypes.ColorRGBA)) {\n                            numColComponents = 4;\n                        }\n\n                        this._mesh._colors[0] = [];\n\n                        var i, indexes = this._vf.index;\n                        for (i=0; i < indexes.length; ++i)\n                        {\n                            if ((i > 0) && (i % 3 === 0 )) {\n                                faceCnt++;\n                            }\n\n                            this._mesh._colors[0].push(pnts[faceCnt].r);\n                            this._mesh._colors[0].push(pnts[faceCnt].g);\n                            this._mesh._colors[0].push(pnts[faceCnt].b);\n                            if (numColComponents === 4) {\n                                this._mesh._colors[0].push(pnts[faceCnt].a);\n                            }\n                        }\n                    }\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.colors = true;\n                    });\n                }\n                else if (fieldName == \"normal\")\n                {\n                    pnts = this._cf.normal.node._vf.vector;\n\n                    if (this._vf.normalPerVertex) {\n\n                        this._mesh._normals[0] = pnts.toGL();\n\n                    } else if (!this._vf.normalPerVertex) {\n\n                        var indexes = this._vf.index;\n                        this._mesh._normals[0] = [];\n\n                        var faceCnt = 0;\n                        for (i=0; i < indexes.length; ++i)\n                        {\n                            if ((i > 0) && (i % 3 === 0 )) {\n                                faceCnt++;\n                            }\n\n                            this._mesh._normals[0].push(pnts[faceCnt].x);\n                            this._mesh._normals[0].push(pnts[faceCnt].y);\n                            this._mesh._normals[0].push(pnts[faceCnt].z);\n                        }\n                    }\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.normals = true;\n                    });\n                }\n                else if (fieldName == \"texCoord\")\n                {\n                    var texCoordNode = this._cf.texCoord.node;\n                    if (x3dom.isa(texCoordNode, x3dom.nodeTypes.MultiTextureCoordinate)) {\n                        if (texCoordNode._cf.texCoord.nodes.length)\n                            texCoordNode = texCoordNode._cf.texCoord.nodes[0];\n                    }\n                    pnts = texCoordNode._vf.point;\n\n                    this._mesh._texCoords[0] = pnts.toGL();\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.texcoords = true;\n                    });\n                }\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n\n// ### QuadSet ###\nx3dom.registerNodeType(\n    \"QuadSet\",\n    \"CADGeometry\",\n    defineClass(x3dom.nodeTypes.X3DComposedGeometryNode,\n        \n        /**\n         * Constructor for QuadSet\n         * @constructs x3dom.nodeTypes.QuadSet\n         * @x3d 3.3\n         * @component CADGeometry\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DComposedGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The QuadSet node represents a 3D shape that represents a collection of individual planar\n         * quadrilaterals.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.QuadSet.superClass.call(this, ctx);\n        \n        },\n        {\n            nodeChanged: function()\n            {\n                /*\n                 This code largely taken from the IndexedTriangleSet code\n                 */\n                var time0 = new Date().getTime();\n\n                this.handleAttribs();\n\n                var colPerVert = this._vf.colorPerVertex;\n                var normPerVert = this._vf.normalPerVertex;\n\n                var hasNormal = false, hasTexCoord = false, hasColor = false;\n                var positions, normals, texCoords, colors;\n\n                var coordNode = this._cf.coord.node;\n                x3dom.debug.assert(coordNode);\n                positions = coordNode._vf.point;\n\n                var normalNode = this._cf.normal.node;\n                if (normalNode) {\n                    hasNormal = true;\n                    normals = normalNode._vf.vector;\n                }\n                else {\n                    hasNormal = false;\n                }\n\n                var texMode = \"\", numTexComponents = 2;\n                var texCoordNode = this._cf.texCoord.node;\n                if (x3dom.isa(texCoordNode, x3dom.nodeTypes.MultiTextureCoordinate)) {\n                    if (texCoordNode._cf.texCoord.nodes.length)\n                        texCoordNode = texCoordNode._cf.texCoord.nodes[0];\n                }\n                if (texCoordNode) {\n                    if (texCoordNode._vf.point) {\n                        hasTexCoord = true;\n                        texCoords = texCoordNode._vf.point;\n\n                        if (x3dom.isa(texCoordNode, x3dom.nodeTypes.TextureCoordinate3D)) {\n                            numTexComponents = 3;\n                        }\n                    }\n                    else if (texCoordNode._vf.mode) {\n                        texMode = texCoordNode._vf.mode;\n                    }\n                }\n                else {\n                    hasTexCoord = false;\n                }\n\n                var numColComponents = 3;\n                var colorNode = this._cf.color.node;\n                if (colorNode) {\n                    hasColor = true;\n                    colors = colorNode._vf.color;\n\n                    if (x3dom.isa(colorNode, x3dom.nodeTypes.ColorRGBA)) {\n                        numColComponents = 4;\n                    }\n                }\n                else {\n                    hasColor = false;\n                }\n\n                this._mesh._indices[0] = [];\n                this._mesh._positions[0] = [];\n                this._mesh._normals[0] = [];\n                this._mesh._texCoords[0] = [];\n                this._mesh._colors[0] = [];\n\n                var i, t, cnt, faceCnt, posMax;\n                var p0, p1, p2, n0, n1, n2, t0, t1, t2, c0, c1, c2;\n\n                // if positions array too short add degenerate triangle\n                while (positions.length % 4 > 0) {\n                    positions.push(positions.length-1);\n                }\n                posMax = positions.length;\n\n                /*\n                 Note: A separate section setting the _mesh field members\n                 and starting with this test:\n                 if (!normPerVert || positions.length > x3dom.Utils.maxIndexableCoords)\n                 is in the IndexedTriangleSet code. It has been removed\n                 here until it's applicability to the QUadSet case can\n                 be evaluated\n                 */\n                if (1)\n                {\n                    faceCnt = 0;\n                    for (i=0; i<positions.length; i++)\n                    {\n                        if ((i > 0) && (i % 4 === 3 )) {\n                            faceCnt++;\n\n                            // then pushe the the 2nd triangle\n                            // of the quad on\n                            this._mesh._indices[0].push(i-3);\n                            this._mesh._indices[0].push(i-1);\n                            this._mesh._indices[0].push(i);\n                        }\n                        else{\n                            this._mesh._indices[0].push(i);\n                        }\n\n                        if(!normPerVert && hasNormal) {\n                            this._mesh._normals[0].push(normals[faceCnt].x);\n                            this._mesh._normals[0].push(normals[faceCnt].y);\n                            this._mesh._normals[0].push(normals[faceCnt].z);\n                        }\n                        if(!colPerVert && hasColor) {\n                            this._mesh._colors[0].push(colors[faceCnt].r);\n                            this._mesh._colors[0].push(colors[faceCnt].g);\n                            this._mesh._colors[0].push(colors[faceCnt].b);\n                            if (numColComponents === 4) {\n                                this._mesh._colors[0].push(colors[faceCnt].a);\n                            }\n                        }\n                    }\n\n                    this._mesh._positions[0] = positions.toGL();\n\n                    if (hasNormal) {\n                        this._mesh._normals[0] = normals.toGL();\n                    }\n                    else {\n                        this._mesh.calcNormals(normPerVert ? Math.PI : 0);\n                    }\n\n                    if (hasTexCoord) {\n                        this._mesh._texCoords[0] = texCoords.toGL();\n                        this._mesh._numTexComponents = numTexComponents;\n                    }\n                    else {\n                        this._mesh.calcTexCoords(texMode);\n                    }\n\n                    if (hasColor && colPerVert) {\n                        this._mesh._colors[0] = colors.toGL();\n                        this._mesh._numColComponents = numColComponents;\n                    }\n                }\n\n                this.invalidateVolume();\n                this._mesh._numFaces = 0;\n                this._mesh._numCoords = 0;\n                for (i=0; i<this._mesh._indices.length; i++) {\n                    this._mesh._numFaces += this._mesh._indices[i].length / 3;\n                    this._mesh._numCoords += this._mesh._positions[i].length / 3;\n                }\n\n                var time1 = new Date().getTime() - time0;\n                //x3dom.debug.logInfo(\"Mesh load time: \" + time1 + \" ms\");\n            },\n\n            fieldChanged: function(fieldName)\n            {\n                var pnts = this._cf.coord.node._vf.point;\n\n                if ( pnts.length > x3dom.Utils.maxIndexableCoords )  // are there other problematic cases?\n                {\n                    // TODO; implement\n                    x3dom.debug.logWarning(\"QuadSet: fieldChanged with \" +\n                        \"too many coordinates not yet implemented!\");\n                    return;\n                }\n\n                if (fieldName == \"coord\")\n                {\n                    this._mesh._positions[0] = pnts.toGL();\n\n                    // tells the mesh that its bbox requires update\n                    this.invalidateVolume();\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.positions = true;\n                        node.invalidateVolume();\n                    });\n                }\n                else if (fieldName == \"color\")\n                {\n                    pnts = this._cf.color.node._vf.color;\n\n                    if (this._vf.colorPerVertex) {\n\n                        this._mesh._colors[0] = pnts.toGL();\n\n                    } else if (!this._vf.colorPerVertex) {\n\n                        var faceCnt = 0;\n                        var numColComponents = 3;\n                        if (x3dom.isa(this._cf.color.node, x3dom.nodeTypes.ColorRGBA)) {\n                            numColComponents = 4;\n                        }\n\n                        this._mesh._colors[0] = [];\n\n                        var i, indexes = this._vf.index;\n                        for (i=0; i < indexes.length; ++i)\n                        {\n                            if ((i > 0) && (i % 3 === 0 )) {\n                                faceCnt++;\n                            }\n\n                            this._mesh._colors[0].push(pnts[faceCnt].r);\n                            this._mesh._colors[0].push(pnts[faceCnt].g);\n                            this._mesh._colors[0].push(pnts[faceCnt].b);\n                            if (numColComponents === 4) {\n                                this._mesh._colors[0].push(pnts[faceCnt].a);\n                            }\n                        }\n                    }\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.colors = true;\n                    });\n                }\n                else if (fieldName == \"normal\")\n                {\n                    pnts = this._cf.normal.node._vf.vector;\n\n                    if (this._vf.normalPerVertex) {\n\n                        this._mesh._normals[0] = pnts.toGL();\n\n                    } else if (!this._vf.normalPerVertex) {\n\n                        var indexes = this._vf.index;\n                        this._mesh._normals[0] = [];\n\n                        var faceCnt = 0;\n                        for (i=0; i < indexes.length; ++i)\n                        {\n                            if ((i > 0) && (i % 3 === 0 )) {\n                                faceCnt++;\n                            }\n\n                            this._mesh._normals[0].push(pnts[faceCnt].x);\n                            this._mesh._normals[0].push(pnts[faceCnt].y);\n                            this._mesh._normals[0].push(pnts[faceCnt].z);\n                        }\n                    }\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.normals = true;\n                    });\n                }\n                else if (fieldName == \"texCoord\")\n                {\n                    var texCoordNode = this._cf.texCoord.node;\n                    if (x3dom.isa(texCoordNode, x3dom.nodeTypes.MultiTextureCoordinate)) {\n                        if (texCoordNode._cf.texCoord.nodes.length)\n                            texCoordNode = texCoordNode._cf.texCoord.nodes[0];\n                    }\n                    pnts = texCoordNode._vf.point;\n\n                    this._mesh._texCoords[0] = pnts.toGL();\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.texcoords = true;\n                    });\n                }\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### CADLayer ###\nx3dom.registerNodeType(\n    \"CADLayer\",\n    \"CADGeometry\",\n    defineClass(x3dom.nodeTypes.X3DGroupingNode,\n        \n        /**\n         * Constructor for CADLayer\n         * @constructs x3dom.nodeTypes.CADLayer\n         * @x3d 3.3\n         * @component CADGeometry\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DGroupingNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The CADLayer node defines a hierarchy of nodes used for showing layer structure for the CAD model.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.CADLayer.superClass.call(this, ctx);\n\n            /**\n             * The name field describes the content of the layer.\n             * @var {x3dom.fields.SFString} name\n             * @memberof x3dom.nodeTypes.CADLayer\n             * @initvalue \"\"\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFString(ctx,'name', \"\");\n            // to be implemented: the 'visible' field\n            // there already is a 'render' field defined in base class\n            // which basically defines visibility...\n            // NOTE: bbox stuff also already defined in a base class!\n        \n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n\n// ### CADAssembly ###\nx3dom.registerNodeType(\n    \"CADAssembly\",\n    \"CADGeometry\",\n    defineClass(x3dom.nodeTypes.X3DGroupingNode,\n        \n        /**\n         * Constructor for CADAssembly\n         * @constructs x3dom.nodeTypes.CADAssembly\n         * @x3d 3.3\n         * @component CADGeometry\n         * @status full\n         * @extends x3dom.nodeTypes.X3DGroupingNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The CADAssembly node holds a set of assemblies or parts grouped together.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.CADAssembly.superClass.call(this, ctx);\n\n\n            /**\n             * The name field documents the name of this CAD structure.\n             * @var {x3dom.fields.SFString} name\n             * @memberof x3dom.nodeTypes.CADAssembly\n             * @initvalue \"\"\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFString(ctx, 'name', \"\");\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### CADPart ###\n// According to the CADGeometry specification,\n// the CADPart node has transformation fields identical to\n// those used in the Transform node, therefore just inherit it\nx3dom.registerNodeType(\n    \"CADPart\",\n    \"CADGeometry\",\n    defineClass(x3dom.nodeTypes.Transform,\n        \n        /**\n         * Constructor for CADPart\n         * @constructs x3dom.nodeTypes.CADPart\n         * @x3d 3.3\n         * @component CADGeometry\n         * @status full\n         * @extends x3dom.nodeTypes.Transform\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The CADPart node is a grouping node that defines a coordinate system for its children that is\n         * relative to the coordinate systems of its ancestors.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.CADPart.superClass.call(this, ctx);\n\n\n            /**\n             * The name field describes the content of the part.\n             * @var {x3dom.fields.SFString} name\n             * @memberof x3dom.nodeTypes.CADPart\n             * @initvalue \"\"\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFString(ctx, 'name', \"\");\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n\n// ### CADFace ###\nx3dom.registerNodeType(\n    \"CADFace\",\n    \"CADGeometry\",\n    defineClass(x3dom.nodeTypes.X3DGroupingNode,\n        \n        /**\n         * Constructor for CADFace\n         * @constructs x3dom.nodeTypes.CADFace\n         * @x3d 3.3\n         * @component CADGeometry\n         * @status full\n         * @extends x3dom.nodeTypes.X3DGroupingNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The CADFace node holds the geometry representing a face of a part.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.CADFace.superClass.call(this, ctx);\n\n\n            /**\n             * The name field specifies the name of the CADFace.\n             * @var {x3dom.fields.SFString} name\n             * @memberof x3dom.nodeTypes.CADFace\n             * @initvalue \"\"\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFString(ctx, 'name', \"\");\n\n            /**\n             * The shape field contains the geometry and appearance for the face or an LOD node containing different\n             * detail levels of the shape. If an LOD node is provided, each child of the LOD node shall be a single\n             * Shape of varying complexity.\n             * @var {x3dom.fields.SFNode} shape\n             * @memberof x3dom.nodeTypes.CADFace\n             * @initvalue X3DShapeNode\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFNode('shape', x3dom.nodeTypes.X3DShapeNode);\n        \n        },\n        {\n            getVolume: function()\n            {\n                var vol = this._graph.volume;\n\n                if (!this.volumeValid() && this._vf.render)\n                {\n                    var child = this._cf.shape.node;\n                    var childVol = (child && child._vf.render === true) ? child.getVolume() : null;\n\n                    if (childVol && childVol.isValid())\n                        vol.extendBounds(childVol.min, childVol.max);\n                }\n\n                return vol;\n            },\n\n            collectDrawableObjects: function (transform, drawableCollection, singlePath, invalidateCache, planeMask, clipPlanes)\n            {\n                if (singlePath && (this._parentNodes.length > 1))\n                    singlePath = false;\n\n                if (singlePath && (invalidateCache = invalidateCache || this.cacheInvalid()))\n                    this.invalidateCache();\n\n                if (!this._cf.shape.node ||\n                    (planeMask = drawableCollection.cull(transform, this.graphState(), singlePath, planeMask)) < 0) {\n                    return;\n                }\n\n                var cnode, childTransform;\n\n                if (singlePath) {\n                    if (!this._graph.globalMatrix) {\n                        this._graph.globalMatrix = this.transformMatrix(transform);\n                    }\n                    childTransform = this._graph.globalMatrix;\n                }\n                else {\n                    childTransform = this.transformMatrix(transform);\n                }\n\n                if ( (cnode = this._cf.shape.node) ) {\n                    cnode.collectDrawableObjects(childTransform, drawableCollection, singlePath, invalidateCache, planeMask, clipPlanes);\n                }\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n\n/* ### Patch ### */\nx3dom.registerNodeType(\n    \"Patch\",\n    \"BVHRefiner\",\n    defineClass(x3dom.nodeTypes.X3DSpatialGeometryNode,\n        \n        /**\n         * Constructor for Patch\n         * @constructs x3dom.nodeTypes.Patch\n         * @x3d x.x\n         * @component BVHRefiner\n         * @extends x3dom.nodeTypes.X3DSpatialGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The Patch node is used by the BVHRefiner.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Patch.superClass.call(this, ctx);\n\n\n            /**\n             * Size of the entire terrain.\n             * @var {x3dom.fields.SFVec2f} size\n             * @memberof x3dom.nodeTypes.Patch\n             * @initvalue 2,2\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec2f(ctx, 'size', 2, 2);\n\n            /**\n             * Subdivision of the regualr geometry. The higher, the finer the geometry.\n             * @var {x3dom.fields.SFVec2f} subdivision\n             * @memberof x3dom.nodeTypes.Patch\n             * @initvalue 1,1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec2f(ctx, 'subdivision', 1, 1);\n\n            /**\n             * Center position of the geometry.\n             * @var {x3dom.fields.SFVec3f} center\n             * @memberof x3dom.nodeTypes.Patch\n             * @initvalue 0,0,0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'center', 0, 0, 0);\n\n            /**\n             * Render mode of the mesh.\n             * @var {x3dom.fields.MFString} primType\n             * @memberof x3dom.nodeTypes.Patch\n             * @initvalue ['TRIANGLES']\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFString(ctx, 'primType', ['TRIANGLES']);\n\n            var sx = this._vf.size.x, sy = this._vf.size.y;\n            var subx = this._vf.subdivision.x, suby = this._vf.subdivision.y;\n\n            this._indexBufferTriangulationParts = [];\n\n            var x = 0, y = 0;\n            var xstep = sx / subx / 2;\n            var ystep = sy / suby / 2;\n\n            sx /= 2;\n            sy /= 2;\n            var countX = subx * 2 + 1;\n            var countY = suby * 2 + 1;\n\n            /*************************************************************/\n            // VERTEX-INFORMATION\n            /*************************************************************/\n            for (y = 0; y <= suby * 2; y++) {\n                for (x = 0; x <= subx * 2; x++) {\n                    this._mesh._positions[0].push(this._vf.center.x + x * xstep - sx);\n                    this._mesh._positions[0].push(this._vf.center.y + y * ystep - sy);\n                    this._mesh._positions[0].push(this._vf.center.z);\n                    this._mesh._normals[0].push(0);\n                    this._mesh._normals[0].push(0);\n                    this._mesh._normals[0].push(1);\n                    this._mesh._texCoords[0].push(x / (subx * 2));\n                    this._mesh._texCoords[0].push(y / (suby * 2));\n                }\n            }\n\n            /*************************************************************/\n            // regular triangulation\n            for (y = 0; y < countY - 2; y += 2) {\n                for (x = 0; x < countX - 2; x += 2) {\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x) + y * countX);\n\n                    this._mesh._indices[0].push((x) + y * countX);\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n                }\n            }\n\n            this._indexBufferTriangulationParts.push({\n                offset: 0,\n                count: subx * suby * 6\n            });\n\n            /*************************************************************/\n            // finer bottom triangulation\n            for (y = 0; y < countY - 2; y += 2) {\n                for (x = 0; x < 2; x += 2) {\n                    this._mesh._indices[0].push((x) + y * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x) + (y + 1) * countX);\n\n                    this._mesh._indices[0].push((x) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x) + y * countX);\n                }\n            }\n\n            for (y = 0; y < countY - 2; y += 2) {\n                for (x = 2; x < countX - 2; x += 2) {\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x) + y * countX);\n\n                    this._mesh._indices[0].push((x) + y * countX);\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n                }\n            }\n\n            this._indexBufferTriangulationParts.push({\n                offset: this._indexBufferTriangulationParts[this._indexBufferTriangulationParts.length - 1].offset +\n                    this._indexBufferTriangulationParts[this._indexBufferTriangulationParts.length - 1].count * 2,\n                count: subx * suby * 6 + suby * 9\n            });\n\n            /*************************************************************/\n            // finer top triangulation\n            for (y = 0; y < countY - 2; y += 2) {\n                for (x = countX - 3; x < countX - 2; x += 2) {\n                    this._mesh._indices[0].push((x) + y * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 2) + (y + 1) * countX);\n\n                    this._mesh._indices[0].push((x + 2) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x) + y * countX);\n                }\n            }\n\n            for (y = 0; y < countY - 2; y += 2) {\n                for (x = 0; x < countX - 4; x += 2) {\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x) + y * countX);\n\n                    this._mesh._indices[0].push((x) + y * countX);\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n                }\n            }\n\n            this._indexBufferTriangulationParts.push({\n                offset: this._indexBufferTriangulationParts[this._indexBufferTriangulationParts.length - 1].offset +\n                    this._indexBufferTriangulationParts[this._indexBufferTriangulationParts.length - 1].count * 2,\n                count: subx * suby * 6 + suby * 9\n            });\n\n            /*************************************************************/\n            // finer right triangulation\n            for (y = 2; y < countY - 2; y += 2) {\n                for (x = 0; x < countX - 2; x += 2) {\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x) + y * countX);\n\n                    this._mesh._indices[0].push((x) + y * countX);\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n                }\n            }\n\n            for (y = 0; y < 2; y += 2) {\n                for (x = 0; x < countX - 2; x += 2) {\n\n                    this._mesh._indices[0].push((x) + y * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 1) + y * countX);\n\n                    this._mesh._indices[0].push((x + 1) + y * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x) + y * countX);\n                }\n            }\n\n            this._indexBufferTriangulationParts.push({\n                offset: this._indexBufferTriangulationParts[this._indexBufferTriangulationParts.length - 1].offset +\n                    this._indexBufferTriangulationParts[this._indexBufferTriangulationParts.length - 1].count * 2,\n                count: subx * suby * 6 + subx * 9\n            });\n\n            /*************************************************************/\n            // finer left triangulation\n            for (y = countY - 3; y < countY - 2; y += 2) {\n                for (x = 0; x < countX - 2; x += 2) {\n                    this._mesh._indices[0].push((x) + y * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 2) * countX);\n\n                    this._mesh._indices[0].push((x + 1) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x) + y * countX);\n                }\n            }\n\n            for (y = 0; y < countY - 4; y += 2) {\n                for (x = 0; x < countX - 2; x += 2) {\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x) + y * countX);\n\n                    this._mesh._indices[0].push((x) + y * countX);\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n                }\n            }\n\n            this._indexBufferTriangulationParts.push({\n                offset: this._indexBufferTriangulationParts[this._indexBufferTriangulationParts.length - 1].offset +\n                    this._indexBufferTriangulationParts[this._indexBufferTriangulationParts.length - 1].count * 2,\n                count: subx * suby * 6 + subx * 9\n            });\n\n            /*************************************************************/\n            // finer topLeft triangulation\n            for (y = countY - 3; y < countY - 2; y += 2) {\n                for (x = countX - 3; x < countX - 2; x += 2) {\n                    this._mesh._indices[0].push((x) + y * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 2) * countX);\n\n                    this._mesh._indices[0].push((x + 1) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 2) + (y + 1) * countX);\n\n                    this._mesh._indices[0].push((x + 2) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x) + y * countX);\n                }\n            }\n\n            for (y = 0; y < countY - 4; y += 2) {\n                for (x = 0; x < countX - 4; x += 2) {\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x) + y * countX);\n\n                    this._mesh._indices[0].push((x) + y * countX);\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n                }\n            }\n\n            for (y = 0; y < countY - 4; y += 2) {\n                for (x = countX - 3; x < countX - 2; x += 2) {\n                    this._mesh._indices[0].push((x) + y * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 2) + (y + 1) * countX);\n\n                    this._mesh._indices[0].push((x + 2) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x) + y * countX);\n                }\n            }\n\n            for (y = countY - 3; y < countY - 2; y += 2) {\n                for (x = 0; x < countX - 4; x += 2) {\n                    this._mesh._indices[0].push((x) + y * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 2) * countX);\n\n                    this._mesh._indices[0].push((x + 1) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x) + y * countX);\n                }\n            }\n\n            this._indexBufferTriangulationParts.push({\n                offset: this._indexBufferTriangulationParts[this._indexBufferTriangulationParts.length - 1].offset +\n                    this._indexBufferTriangulationParts[this._indexBufferTriangulationParts.length - 1].count * 2,\n                count: subx * suby * 6 + subx * 9 + (suby - 1) * 9 + 3\n            });\n\n            /*************************************************************/\n            // finer bottomLeft triangulation\n            for (y = countY - 3; y < countY - 2; y += 2) {\n                for (x = 0; x < 2; x += 2) {\n                    this._mesh._indices[0].push((x) + y * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x) + (y + 1) * countX);\n\n                    this._mesh._indices[0].push((x) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 2) * countX);\n\n                    this._mesh._indices[0].push((x + 1) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x) + y * countX);\n                }\n            }\n\n            for (y = 0; y < countY - 4; y += 2) {\n                for (x = 2; x < countX - 2; x += 2) {\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x) + y * countX);\n\n                    this._mesh._indices[0].push((x) + y * countX);\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n                }\n            }\n\n            // finer left\n            for (y = countY - 3; y < countY - 2; y += 2) {\n                for (x = 2; x < countX - 2; x += 2) {\n                    this._mesh._indices[0].push((x) + y * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 2) * countX);\n\n                    this._mesh._indices[0].push((x + 1) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x) + y * countX);\n                }\n            }\n\n            // finer bottom\n            for (y = 0; y < countY - 4; y += 2) {\n                for (x = 0; x < 2; x += 2) {\n                    this._mesh._indices[0].push((x) + y * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x) + (y + 1) * countX);\n\n                    this._mesh._indices[0].push((x) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x) + y * countX);\n                }\n            }\n\n            this._indexBufferTriangulationParts.push({\n                offset: this._indexBufferTriangulationParts[this._indexBufferTriangulationParts.length - 1].offset +\n                    this._indexBufferTriangulationParts[this._indexBufferTriangulationParts.length - 1].count * 2,\n                count: subx * suby * 6 + subx * 9 + (suby - 1) * 9 + 3\n            });\n\n            /*************************************************************/\n            // finer bottomRight triangulation\n            for (y = 0; y < 2; y += 2) {\n                for (x = 0; x < 2; x += 2) {\n                    this._mesh._indices[0].push((x) + y * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x) + (y + 1) * countX);\n\n                    this._mesh._indices[0].push((x) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 1) + y * countX);\n\n                    this._mesh._indices[0].push((x + 1) + y * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x) + y * countX);\n                }\n            }\n\n            for (y = 2; y < countY - 2; y += 2) {\n                for (x = 2; x < countX - 2; x += 2) {\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x) + y * countX);\n\n                    this._mesh._indices[0].push((x) + y * countX);\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n                }\n            }\n\n            // finer bottom\n            for (y = 2; y < countY - 2; y += 2) {\n                for (x = 0; x < 2; x += 2) {\n                    this._mesh._indices[0].push((x) + y * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x) + (y + 1) * countX);\n\n                    this._mesh._indices[0].push((x) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x) + y * countX);\n                }\n            }\n\n            // finer right\n            for (y = 0; y < 2; y += 2) {\n                for (x = 2; x < countX - 2; x += 2) {\n\n                    this._mesh._indices[0].push((x) + y * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 1) + y * countX);\n\n                    this._mesh._indices[0].push((x + 1) + y * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x) + y * countX);\n                }\n            }\n\n            this._indexBufferTriangulationParts.push({\n                offset: this._indexBufferTriangulationParts[this._indexBufferTriangulationParts.length - 1].offset +\n                    this._indexBufferTriangulationParts[this._indexBufferTriangulationParts.length - 1].count * 2,\n                count: subx * suby * 6 + subx * 9 + (suby - 1) * 9 + 3\n            });\n\n            /*************************************************************/\n            // finer topRight triangulation\n            // finer right\n            for (y = 0; y < 2; y += 2) {\n                for (x = countX - 3; x < countX - 2; x += 2) {\n                    this._mesh._indices[0].push((x) + y * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 2) + (y + 1) * countX);\n\n                    this._mesh._indices[0].push((x + 2) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 1) + y * countX);\n\n                    this._mesh._indices[0].push((x + 1) + y * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x) + y * countX);\n                }\n            }\n\n            for (y = 2; y < countY - 2; y += 2) {\n                for (x = 0; x < countX - 4; x += 2) {\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x) + y * countX);\n\n                    this._mesh._indices[0].push((x) + y * countX);\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n                }\n            }\n\n            //  finer top\n            for (y = 2; y < countY - 2; y += 2) {\n                for (x = countX - 3; x < countX - 2; x += 2) {\n                    this._mesh._indices[0].push((x) + y * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 2) + (y + 1) * countX);\n\n                    this._mesh._indices[0].push((x + 2) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x) + y * countX);\n                }\n            }\n\n            // finer right\n            for (y = 0; y < 2; y += 2) {\n                for (x = 0; x < countX - 4; x += 2) {\n\n                    this._mesh._indices[0].push((x) + y * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n\n                    this._mesh._indices[0].push((x) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n\n                    this._mesh._indices[0].push((x + 2) + (y + 2) * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n\n                    this._mesh._indices[0].push((x + 2) + y * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x + 1) + y * countX);\n\n                    this._mesh._indices[0].push((x + 1) + y * countX);\n                    this._mesh._indices[0].push((x + 1) + (y + 1) * countX);\n                    this._mesh._indices[0].push((x) + y * countX);\n                }\n            }\n\n            this._indexBufferTriangulationParts.push({\n                offset: this._indexBufferTriangulationParts[this._indexBufferTriangulationParts.length - 1].offset +\n                    this._indexBufferTriangulationParts[this._indexBufferTriangulationParts.length - 1].count * 2,\n                count: subx * suby * 6 + subx * 9 + (suby - 1) * 9 + 3\n            });\n\n            this._mesh._invalidate = true;\n            this._mesh._numFaces = this._mesh._indices[0].length / 3;\n            this._mesh._numCoords = this._mesh._positions[0].length / 3;\n        \n        },\n        {\n            hasIndexOffset: function() {\n                return true;\n            },\n\n            getTriangulationAttributes: function(triangulationIndex){\n                return this._indexBufferTriangulationParts[triangulationIndex];\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n\n// ### BVHRefiner ###\nx3dom.registerNodeType(\n    \"BVHRefiner\",\n    \"BVHRefiner\",\n    defineClass(x3dom.nodeTypes.X3DLODNode,\n        \n        /**\n         * Constructor for BVHRefiner\n         * @constructs x3dom.nodeTypes.BVHRefiner\n         * @x3d x.x\n         * @component BVHRefiner\n         * @extends x3dom.nodeTypes.X3DLODNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The node handles wmts conform datasets like e.g. terrain-data, city-data, point-clouds etc.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.BVHRefiner.superClass.call(this, ctx);\n\n\n            /**\n             * Parameter to influence refinement behaviour. The higher, the better the performance but quality gets more worse.\n             * @var {x3dom.fields.SFFloat} factor\n             * @memberof x3dom.nodeTypes.BVHRefiner\n             * @initvalue 1.0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'factor', 1.0);\n\n            /**\n             * Maximum refinement depth of dataset.\n             * @var {x3dom.fields.SFInt32} maxDepth\n             * @memberof x3dom.nodeTypes.BVHRefiner\n             * @initvalue 3\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'maxDepth', 3);\n\n            /**\n             * Minimum depth that should be rendered.\n             * @var {x3dom.fields.SFInt32} minDepth\n             * @memberof x3dom.nodeTypes.BVHRefiner\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'minDepth', 0);\n\n            /**\n             * Factor to reduce loading speed to get interactive framerates during interaction.\n             * @var {x3dom.fields.SFInt32} smoothLoading\n             * @memberof x3dom.nodeTypes.BVHRefiner\n             * @initvalue 1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'smoothLoading', 1);\n\n            /**\n             * Depth that should be rendered during interaction.\n             * @var {x3dom.fields.SFInt32} interactionDepth\n             * @memberof x3dom.nodeTypes.BVHRefiner\n             * @initvalue this._vf.maxDepth\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'interactionDepth', this._vf.maxDepth);\n\n            /**\n             * Size of the geometry in case of using terrain datasets.\n             * @var {x3dom.fields.SFVec2f} size\n             * @memberof x3dom.nodeTypes.BVHRefiner\n             * @initvalue 1,1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec2f(ctx, 'size', 1, 1);\n            // TODO: delete if octree will be deleted\n\n            /**\n             * Size of octree dataset.\n             * @var {x3dom.fields.SFVec3f} octSize\n             * @memberof x3dom.nodeTypes.BVHRefiner\n             * @initvalue 1,1,1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'octSize', 1, 1, 1);\n\n            /**\n             * Subdivision of datasets in case of terrain to define the quality of the rendered dataset.\n             * @var {x3dom.fields.SFVec2f} subdivision\n             * @memberof x3dom.nodeTypes.BVHRefiner\n             * @initvalue 1,1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec2f(ctx, 'subdivision', 1, 1);\n\n            /**\n             * Url to the dataset.\n             * @var {x3dom.fields.SFString} url\n             * @memberof x3dom.nodeTypes.BVHRefiner\n             * @initvalue \"\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'url', \"\");\n\n            /**\n             * Url to the elevation dataset in case of terrain.\n             * @var {x3dom.fields.SFString} elevationUrl\n             * @memberof x3dom.nodeTypes.BVHRefiner\n             * @initvalue \"\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'elevationUrl', \"\");\n\n            /**\n             * Url to the surface texture dataset in case of terrain.\n             * @var {x3dom.fields.SFString} textureUrl\n             * @memberof x3dom.nodeTypes.BVHRefiner\n             * @initvalue \"\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'textureUrl', \"\");\n\n            /**\n             * Url to the normal dataset in case of terrain.\n             * @var {x3dom.fields.SFString} normalUrl\n             * @memberof x3dom.nodeTypes.BVHRefiner\n             * @initvalue \"\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'normalUrl', \"\");\n\n            /**\n             * Defines if 2d dataset or 3d dataset is utilized.\n             * @var {x3dom.fields.SFString} mode\n             * @memberof x3dom.nodeTypes.BVHRefiner\n             * @initvalue \"3d\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'mode', \"3d\");\n\n            /**\n             * Defines the structure of the dataset that should be exploited.\n             * @var {x3dom.fields.SFString} subMode\n             * @memberof x3dom.nodeTypes.BVHRefiner\n             * @initvalue \"wmts\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'subMode', \"wmts\");\n\n            /**\n             * Image format of the images in elevation dataset.\n             * @var {x3dom.fields.SFString} elevationFormat\n             * @memberof x3dom.nodeTypes.BVHRefiner\n             * @initvalue \"png\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'elevationFormat', \"png\");\n\n            /**\n             * Image format of surface texture dataset.\n             * @var {x3dom.fields.SFString} textureFormat\n             * @memberof x3dom.nodeTypes.BVHRefiner\n             * @initvalue \"png\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'textureFormat', \"png\");\n\n            /**\n             * Image format of normal texture dataset.\n             * @var {x3dom.fields.SFString} normalFormat\n             * @memberof x3dom.nodeTypes.BVHRefiner\n             * @initvalue \"png\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'normalFormat', \"png\");\n\n            /**\n             * Maximum elevation that is defined through color white in elevation dataset images.\n             * @var {x3dom.fields.SFFloat} maxElevation\n             * @memberof x3dom.nodeTypes.BVHRefiner\n             * @initvalue 1.0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'maxElevation', 1.0);\n\n            /**\n             * Should be true if a normal dataset is required.\n             * @var {x3dom.fields.SFBool} useNormals\n             * @memberof x3dom.nodeTypes.BVHRefiner\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'useNormals', true);\n\n            /**\n             * Specifies whether this geometry should be rendered with or without lighting.\n             * @var {x3dom.fields.SFBool} lit\n             * @memberof x3dom.nodeTypes.BVHRefiner\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'lit', true);\n\n            /**\n             * Defines the count of divisions that should be produced. Creates dynamic datastructure for pot counts.\n             * @var {x3dom.fields.SFInt32} bvhCount\n             * @memberof x3dom.nodeTypes.BVHRefiner\n             * @initvalue 8\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'bvhCount', 8);\n\n            this.creationSmooth = 0;\n            this.togglePoints = true;\n            this.nodeProducer = new NodeProducer();\n            // calculation of the array-size for storing the quad-pointers\n            var nodeListSize = 0;\n            for (var x = 0; x <= this._vf.maxDepth; x++) {\n                nodeListSize += Math.pow(4, x);\n            }\n            this.nodeList = new Array(nodeListSize);\n\n            if (this._vf.mode === \"bin\") {\n                // creating the root-node of the quadtree\n                this.rootNode = new QuadtreeNodeBin(ctx, this, 0, 0, 0, null);\n            }\n            else if (this._vf.mode === \"3d\" || this._vf.mode === \"2d\") {\n                // 2D-Mesh that will represent the geometry of this node\n                var geometry = new x3dom.nodeTypes.Plane(ctx);\n                // definition the parameters of the geometry\n                geometry._vf.subdivision.setValues(this._vf.subdivision);\n                geometry.fieldChanged(\"subdivision\");\n                geometry._vf.size.setValues(this._vf.size);\n                //geometry._vf.center.setValues(this._vf.center);\n\n                if (this._vf.mode === \"2d\") {\n                    if (this._vf.subMode === \"wmts\"){\n                        // creating the root-node of the quadtree\n                        this.rootNode = new QuadtreeNode2dWMTS(ctx, this, 0, 0,\n                            x3dom.fields.SFMatrix4f.identity(),\n                            0, 0, geometry);\n                    }\n                    else {\n                        // creating the root-node of the quadtree\n                        this.rootNode = new QuadtreeNode2D(ctx, this, 0, 0,\n                            x3dom.fields.SFMatrix4f.identity(),\n                            0, 0, geometry, \"/\", 1);\n                    }\n                }\n                else {\n                    if (this._vf.subMode === \"32bit\"){\n                        this.rootNode = new QuadtreeNode3D_32bit(ctx, this, 0, 0,\n                            x3dom.fields.SFMatrix4f.identity(),\n                            0, 0, geometry);\n                    }\n                    else {\n                        geometry = new x3dom.nodeTypes.Patch(ctx);\n                        this.rootNode = new QuadtreeNode3D(ctx, this, 0, 0,\n                            x3dom.fields.SFMatrix4f.identity(),\n                            0, 0, geometry);\n                    }\n                }\n            }\n            else if (this._vf.mode === \"bvh\"){\n                // creating the root-node of the quadtree\n                this.rootNode = new BVHNode(ctx, this, 0, \"/\", 1, this._vf.bvhCount);\n            }\n            else {\n                x3dom.debug.logError(\"Error attribute mode. Value: '\" + this._vf.mode +\n                    \"' isn't conform. Please use type 'bin', '2d' or '3d'\");\n            }\n        \n        },\n        {\n            visitChildren: function(transform, drawableCollection, singlePath, invalidateCache, planeMask) {\n                var x3dElement = this._nameSpace.doc._x3dElem;\n\n                if (this._vf.mode === \"oct\") {\n                    if (x3dElement.runtime.isReady && this.togglePoints){\n                        x3dElement.runtime.togglePoints();\n                        this.togglePoints = false;\n                        this.view = drawableCollection.viewarea;\n                    }\n                    this.creationSmooth++;\n                    singlePath = false;         // TODO (specify if unique node path or multi-parent)\n                    invalidateCache = true;     // TODO (reuse world transform and volume cache)\n                    this.rootNode.collectDrawables(transform, drawableCollection, singlePath, invalidateCache, planeMask);\n\n                    if (!this.view.isMovingOrAnimating() && ((this.creationSmooth % this._vf.smoothLoading) === 0)) {\n                        this.nodeProducer.CreateNewNode();\n                    }\n                }\n                else {\n                    if (x3dElement.runtime.isReady && this.togglePoints){\n                        this.view = x3dElement.runtime.canvas.doc._viewarea;\n                        this.togglePoints = false;\n                    }\n                    this.createChildren = 0;\n                    this.creationSmooth++;\n                    singlePath = false;         // TODO (specify if unique node path or multi-parent)\n                    invalidateCache = true;     // TODO (reuse world transform and volume cache)\n                    this.rootNode.collectDrawables(transform, drawableCollection, singlePath, invalidateCache, planeMask);\n                    if (!this.view.isMovingOrAnimating() && ((this.creationSmooth % this._vf.smoothLoading) === 0)) {\n                        this.nodeProducer.CreateNewNode();\n                    }\n                }\n            },\n\n            getVolume: function()\n            {\n                var vol = this._graph.volume;\n\n                if (!this.volumeValid() && this._vf.render)\n                {\n                    var childVol = this.rootNode.getVolume();\n                    if (childVol && childVol.isValid())\n                        vol.extendBounds(childVol.min, childVol.max);\n                }\n\n                return vol;\n            }\n        }\n    )\n);\n\n/*\n * All bvh-nodes must login at this element if they want to\n * create their children on next frame. This node decides what node\n * has the highest priority and creates its four children on the next\n * frame. On the next frame the same course will happen till all children\n * are created.\n * @returns {NodeProducer}\n */\nfunction NodeProducer()\n{\n    // Node thats children should be created after current frame is rendered\n    var nextNode        = null;\n    // Distance of the node that should be created after current frame\n    var nearestDistance = 1000000;\n    // Depth of the node that should be created after current frame\n    var smallestDepth   = 1000000;\n\n\n\n    /*\n     * Decides if the given node has a smaller or the same depth as the\n     * current \"nextNode\", and if this is true if the distance to camera\n     * is less. In this case it will be new \"nextNode\"\n     * @param {Node of BVHRefiner} node node that will create children\n     * @param {type} distance distance of the node to camera\n     * @returns {null}\n     */\n    this.AddNewNode = function(node, distance){\n        if (node.Level() < smallestDepth) {\n            smallestDepth = node.Level();\n            nextNode = node;\n        }\n        if (node.Level() === smallestDepth){\n            if (distance < nearestDistance){\n                distance = nearestDistance;\n                nextNode = node;\n            }\n        }\n    };\n\n\n\n    /*\n     * Creates the children of the node with highest priority in the last frame\n     * @returns {null}\n     */\n    this.CreateNewNode = function(){\n        if (nextNode !== null) {\n            nextNode.CreateChildren();\n        }\n        nextNode = null;\n        smallestDepth = 1000;\n    };\n}\n\n\n/*******************************************************************************\n *******************************************************************************\n **************************** QuadtreeNode2dWMTS *******************************\n *******************************************************************************\n *******************************************************************************\n *\n * Defines one 2D node (plane) of a quadtree that represents a part\n * (nxn vertices) of the whole mesh.\n * @param {object} ctx context\n * @param {x3dom.nodeTypes.BVHRefiner} bvhRefiner root bvhRefiner node\n * @param {number} level level of the node within the quadtree\n * @param {number} nodeNumber id of the node within the level\n * @param {x3dom.fields.SFMatrix4f} nodeTransformation transformation matrix\n *                                  that defines scale and position\n * @param {number} columnNr column number in the wmts matrix within the level\n * @param {number} rowNr row number in the wmts matrix within the level\n * @param {x3dom.nodeTypes.Plane} geometry plane\n * @returns {QuadtreeNode2dWMTS}\n */\nfunction QuadtreeNode2dWMTS(ctx, bvhRefiner, level, nodeNumber, nodeTransformation,\n                            columnNr, rowNr, geometry)\n{\n    // array with the maximal four child nodes\n    var children = [];\n    // drawable component of this node\n    var shape = new x3dom.nodeTypes.Shape();\n    // position of the node in world space\n    var position = null;\n    // true if this component is available and renderable\n    var readyState = false;\n    // checks if children are ready\n    var childrenReadyState = false;\n    // url of the data source\n    var url = bvhRefiner._vf.textureUrl + \"/\" + level + \"/\" + columnNr +\n        \"/\" + rowNr + \".\" + (bvhRefiner._vf.textureFormat).toLowerCase();\n    // defines the resizing factor\n    var resizeFac = (bvhRefiner._vf.size.x + bvhRefiner._vf.size.y) / 2.0;\n    // object that stores all information to do a frustum culling\n    var cullObject = {};\n\n\n\n    /*\n     * Initializes all nodeTypes that are needed to create the drawable\n     * component for this node\n     * @returns {null}\n     */\n    function initialize() {\n\n        // appearance of the drawable component of this node\n        var appearance = new x3dom.nodeTypes.Appearance(ctx);\n        // texture that should represent the surface-data of this node\n        var texture = new x3dom.nodeTypes.ImageTexture(ctx);\n\n        // definition of the nameSpace of this shape\n        shape._nameSpace = bvhRefiner._nameSpace;\n\n        // create height-data\n        var texProp = new x3dom.nodeTypes.TextureProperties(ctx);\n        texProp._vf.boundaryModeS = \"CLAMP_TO_EDGE\";\n        texProp._vf.boundaryModeT = \"CLAMP_TO_EDGE\";\n        texProp._vf.boundaryModeR = \"CLAMP_TO_EDGE\";\n        texProp._vf.minificationFilter = \"LINEAR\";\n        texProp._vf.magnificationFilter = \"LINEAR\";\n        texture.addChild(texProp, \"textureProperties\");\n        texture.nodeChanged();\n        // definition of texture\n        texture._nameSpace = bvhRefiner._nameSpace;\n        texture._vf.url[0] = url;\n\n        // calculate the average position of the node\n        position = nodeTransformation.e3();\n\n        // add textures to the appearence of this node\n        appearance.addChild(texture);\n        texture.nodeChanged();\n\n        // create shape with geometry and appearance data\n        shape.addChild(appearance);\n        appearance.nodeChanged();\n        shape.addChild(geometry);\n        geometry.nodeChanged();\n\n        // add shape to bvhRefiner object\n        bvhRefiner.addChild(shape);\n        shape.nodeChanged();\n\n        // definition the static properties of cullObject\n        cullObject.boundedNode = shape;\n        cullObject.volume = shape.getVolume();\n    }\n\n\n\n    /*\n     * Creates the four children\n     * @returns {null}\n     */\n    this.CreateChildren = function () {\n        create();\n    };\n\n\n\n    /*\n     * Creates the four children\n     * @returns {null}\n     */\n    function create() {\n\n        // calculation of children number nodeNumber within their level\n        var deltaR = Math.sqrt(Math.pow(4, level));\n        var deltaR1 = Math.sqrt(Math.pow(4, level + 1));\n        var lt = Math.floor(nodeNumber / deltaR) * 4 * deltaR +\n            (nodeNumber % deltaR) * 2;\n        var rt = lt + 1;\n        var lb = lt + deltaR1;\n        var rb = lb + 1;\n\n        // calculation of the scaling factor\n        var s = (bvhRefiner._vf.size).multiply(0.25);\n\n        // creation of all children\n        children.push(new QuadtreeNode2dWMTS(ctx, bvhRefiner, (level + 1), lt,\n            nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(\n                new x3dom.fields.SFVec3f(-s.x, s.y, 0.0))).mult(x3dom.fields.SFMatrix4f.scale(\n                new x3dom.fields.SFVec3f(0.5, 0.5, 1.0))), (columnNr * 2), (rowNr * 2), geometry));\n        children.push(new QuadtreeNode2dWMTS(ctx, bvhRefiner, (level + 1), rt,\n            nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(\n                new x3dom.fields.SFVec3f(s.x, s.y, 0.0))).mult(x3dom.fields.SFMatrix4f.scale(\n                new x3dom.fields.SFVec3f(0.5, 0.5, 1.0))), (columnNr * 2 + 1), (rowNr * 2), geometry));\n        children.push(new QuadtreeNode2dWMTS(ctx, bvhRefiner, (level + 1), lb,\n            nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(\n                new x3dom.fields.SFVec3f(-s.x, -s.y, 0.0))).mult(x3dom.fields.SFMatrix4f.scale(\n                new x3dom.fields.SFVec3f(0.5, 0.5, 1.0))), (columnNr * 2), (rowNr * 2 + 1), geometry));\n        children.push(new QuadtreeNode2dWMTS(ctx, bvhRefiner, (level + 1), rb,\n            nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(\n                new x3dom.fields.SFVec3f(s.x, -s.y, 0.0))).mult(x3dom.fields.SFMatrix4f.scale(\n                new x3dom.fields.SFVec3f(0.5, 0.5, 1.0))), (columnNr * 2 + 1), (rowNr * 2 + 1), geometry));\n    }\n\n\n\n    /*\n     * Returns the shape of this node\n     * @returns {x3dom.nodeTypes.Shape}\n     */\n    this.Shape = function () {\n        return shape;\n    };\n\n\n\n    /*\n     * Runs only local ready() method. This is needed from parent to ask if\n     * all children are ready to render or not\n     * @returns {Boolean} true if ready to render, else false\n     */\n    this.Ready = function(){\n        if (shape._webgl !== undefined && shape._webgl.texture !== undefined) {\n            return ready();\n        }\n\n        return false;\n    };\n\n\n\n    /*\n     * Iterates through all textures of this node and sets readState parameter\n     * to true if all textures have been loaded to gpu yet, false if not.\n     * @returns {Boolean} true if ready to render, else false\n     */\n    function ready() {\n        readyState = true;\n        for (var i = 0; i < shape._webgl.texture.length; i++){\n            if (!shape._webgl.texture[i].texture.ready){\n                readyState = false;\n            }\n\n\n        }\n\n        return readyState;\n    }\n\n\n\n    /*\n     * Updates the loading state of children and initializes this node\n     * if this wasn't done before\n     * @param {x3dom.DrawableCollection} drawableCollection\n     * @param {x3dom.fields.SFMatrix4f} transform outer transformation matrix\n     * @returns {null}\n     */\n    function updateLoadingState(drawableCollection, transform){\n\n        childrenReadyState = true;\n        for (var i = 0; i < children.length; i++){\n            if (!children[i].Ready()) {\n                childrenReadyState = false;\n            }\n        }\n\n        if (children.length < 4){\n            childrenReadyState = false;\n        }\n        else if (childrenReadyState) {\n            for (var i = 0; i < children.length; i++){\n                children[i].Shape()._vf.render = true;\n            }\n        }\n\n        if (shape._webgl === undefined || shape._webgl.texture === undefined) {\n            drawableCollection.context.setupShape(drawableCollection.gl,\n                {shape:shape,\n                    transform:transform},\n                drawableCollection.viewarea);\n        }\n        else {\n            ready();\n        }\n    }\n\n\n\n    /*\n     * Decides to create new children and if the node shoud be drawn or not\n     * @param {x3dom.fields.SFMatrix4f} transform outer transformation matrix\n     * @param {x3dom.DrawableCollection} drawableCollection\n     * @param {bool} singlePath\n     * @param {bool} invalidateCache\n     * @param {number} planeMask\n     * @returns {null}\n     */\n    this.collectDrawables = function (transform, drawableCollection,\n                                      singlePath, invalidateCache, planeMask) {\n\n        // definition the actual transformation of the node\n        cullObject.localMatrix = nodeTransformation;\n        // calculation of new plane mask\n        planeMask = drawableCollection.cull(nodeTransformation, cullObject, singlePath, planeMask);\n\n        // Checks the actual loading state of itself and children if something wasn't loaded in last frame\n        if (!readyState || !childrenReadyState)\n            updateLoadingState(drawableCollection, nodeTransformation);\n\n        if (readyState && planeMask >= 0) {\n            var mat_view = drawableCollection.viewMatrix;\n            var vPos = mat_view.multMatrixPnt(nodeTransformation.multMatrixPnt(position));\n            var distanceToCamera = Math.sqrt(Math.pow(vPos.x, 2) + Math.pow(vPos.y, 2) + Math.pow(vPos.z, 2));\n\n            if ((distanceToCamera < Math.pow((bvhRefiner._vf.maxDepth - level), 2) * resizeFac / bvhRefiner._vf.factor) || level < bvhRefiner._vf.minDepth) {\n                if (bvhRefiner.view.isMovingOrAnimating() && children.length === 0 ||\n                    bvhRefiner.view.isMovingOrAnimating() && level >= bvhRefiner._vf.interactionDepth) {\n                    shape.collectDrawableObjects(nodeTransformation, drawableCollection, singlePath, invalidateCache, planeMask, []);\n                }\n                else {\n                    if (children.length === 0) {\n                        bvhRefiner.nodeProducer.AddNewNode(that, distanceToCamera);\n                        shape.collectDrawableObjects(nodeTransformation, drawableCollection, singlePath, invalidateCache, planeMask, []);\n                    }\n                    else {\n                        if (childrenReadyState) {\n                            for (var i = 0; i < children.length; i++) {\n                                children[i].collectDrawables(nodeTransformation, drawableCollection, singlePath, invalidateCache, planeMask);\n                            }\n                        }\n                        else {\n                            shape.collectDrawableObjects(nodeTransformation, drawableCollection, singlePath, invalidateCache, planeMask, []);\n                            for (var i = 0; i < children.length; i++) {\n                                children[i].collectDrawables(nodeTransformation, drawableCollection, singlePath, invalidateCache, planeMask);\n                                children[i].Shape()._vf.render = false;\n                            }\n                        }\n                    }\n                }\n            }\n            else {\n                shape.collectDrawableObjects(nodeTransformation, drawableCollection, singlePath, invalidateCache, planeMask, []);\n            }\n        }\n    };\n\n\n\n    /*\n     * Returns the volume of this node\n     * @returns {x3dom.fields.BoxVolume}\n     */\n    this.getVolume = function() {\n        return shape.getVolume();\n    };\n\n\n    /*\n     * Returns the level of this node\n     * @returns {number}\n     */\n    this.Level = function () {\n        return level;\n    };\n\n\n    // reference to get access to public methods within this node\n    var that = this;\n    // initializes this node directly after creating\n    initialize();\n}\n\n\n\n/*******************************************************************************\n *******************************************************************************\n **************************** QuadtreeNode2D ***********************************\n *******************************************************************************\n *******************************************************************************\n *\n * Defines one 2D node (plane) of a quadtree that represents a part\n * (nxn vertices) of the whole mesh.\n * @param {object} ctx context\n * @param {x3dom.nodeTypes.BVHRefiner} bvhRefiner root bvhRefiner node\n * @param {number} level level of the node within the quadtree\n * @param {number} nodeNumber id of the node within the level\n * @param {x3dom.fields.SFMatrix4f} nodeTransformation transformation matrix\n *                                  that defines scale and position\n * @param {number} columnNr column number in the wmts matrix within the level\n * @param {number} rowNr row number in the wmts matrix within the level\n * @param {x3dom.nodeTypes.Plane} geometry plane\n * @param {string} path path to the nodes data\n * @param {type} imgNumber number of the image within the path\n * @returns {QuadtreeNode2D}\n */\nfunction QuadtreeNode2D(ctx, bvhRefiner, level, nodeNumber, nodeTransformation,\n                        columnNr, rowNr, geometry, path, imgNumber)\n{\n\n    // array with the maximal four child nodes\n    var children = [];\n    // drawable component of this node\n    var shape = new x3dom.nodeTypes.Shape();\n    // position of the node in world space\n    var position = null;\n    // true if this component is available and renderable\n    var readyState = false;\n    // checks if children are ready\n    var childrenReadyState = false;\n    // true if components are available and renderable\n    var exists = true;\n    // url of the data source\n    var url = bvhRefiner._vf.textureUrl + path + imgNumber + \".\" + bvhRefiner._vf.textureFormat;\n    // defines the resizing factor\n    var resizeFac = (bvhRefiner._vf.size.x + bvhRefiner._vf.size.y) / 2.0;\n    // object that stores all information to do a frustum culling\n    var cullObject = {};\n\n\n\n    /*\n     * Initializes all nodeTypes that are needed to create the drawable\n     * component for this node\n     * @returns {null}\n     */\n    function initialize() {\n\n        // appearance of the drawable component of this node\n        var appearance = new x3dom.nodeTypes.Appearance(ctx);\n        // texture that should represent the surface-data of this node\n        var texture = new x3dom.nodeTypes.ImageTexture(ctx);\n\n        // definition of the nameSpace of this shape\n        shape._nameSpace = bvhRefiner._nameSpace;\n\n        // create height-data\n        var texProp = new x3dom.nodeTypes.TextureProperties(ctx);\n        texProp._vf.boundaryModeS = \"CLAMP_TO_EDGE\";\n        texProp._vf.boundaryModeT = \"CLAMP_TO_EDGE\";\n        texProp._vf.boundaryModeR = \"CLAMP_TO_EDGE\";\n        texProp._vf.minificationFilter = \"LINEAR\";\n        texProp._vf.magnificationFilter = \"LINEAR\";\n        texture.addChild(texProp, \"textureProperties\");\n        texture.nodeChanged();\n        // definition of texture\n        texture._nameSpace = bvhRefiner._nameSpace;\n        texture._vf.url[0] = url;\n\n        // calculate the average position of the node\n        position = nodeTransformation.e3();\n\n        // add textures to the appearence of this node\n        appearance.addChild(texture);\n        texture.nodeChanged();\n\n        // create shape with geometry and appearance data\n        shape.addChild(appearance);\n        appearance.nodeChanged();\n        shape.addChild(geometry);\n        geometry.nodeChanged();\n\n        // add shape to bvhRefiner object\n        bvhRefiner.addChild(shape);\n        shape.nodeChanged();\n\n        // definition the static properties of cullObject\n        cullObject.boundedNode = shape;\n        cullObject.volume = shape.getVolume();\n    }\n\n\n\n    /*\n     * Creates the four children\n     * @returns {null}\n     */\n    this.CreateChildren = function () {\n        create();\n    };\n\n\n\n    /*\n     * Creates the four children\n     * @returns {null}\n     */\n    function create() {\n\n        // calculation of children number nodeNumber within their level\n        var deltaR = Math.sqrt(Math.pow(4, level));\n        var deltaR1 = Math.sqrt(Math.pow(4, level + 1));\n        var lt = Math.floor(nodeNumber / deltaR) * 4 * deltaR +\n            (nodeNumber % deltaR) * 2;\n        var rt = lt + 1;\n        var lb = lt + deltaR1;\n        var rb = lb + 1;\n\n        // calculation of the scaling factor\n        var s = (bvhRefiner._vf.size).multiply(0.25);\n\n        // creation of all children\n        children.push(new QuadtreeNode2D(ctx, bvhRefiner, (level + 1), lt,\n            nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(\n                new x3dom.fields.SFVec3f(-s.x, s.y, 0.0))).mult(x3dom.fields.SFMatrix4f.scale(\n                new x3dom.fields.SFVec3f(0.5, 0.5, 1.0))), (columnNr * 2), (rowNr * 2), geometry, path + imgNumber + \"/\", 1));\n        children.push(new QuadtreeNode2D(ctx, bvhRefiner, (level + 1), rt,\n            nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(\n                new x3dom.fields.SFVec3f(s.x, s.y, 0.0))).mult(x3dom.fields.SFMatrix4f.scale(\n                new x3dom.fields.SFVec3f(0.5, 0.5, 1.0))), (columnNr * 2 + 1), (rowNr * 2), geometry, path + imgNumber + \"/\", 3));\n        children.push(new QuadtreeNode2D(ctx, bvhRefiner, (level + 1), lb,\n            nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(\n                new x3dom.fields.SFVec3f(-s.x, -s.y, 0.0))).mult(x3dom.fields.SFMatrix4f.scale(\n                new x3dom.fields.SFVec3f(0.5, 0.5, 1.0))), (columnNr * 2), (rowNr * 2 + 1), geometry, path + imgNumber + \"/\", 2));\n        children.push(new QuadtreeNode2D(ctx, bvhRefiner, (level + 1), rb,\n            nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(\n                new x3dom.fields.SFVec3f(s.x, -s.y, 0.0))).mult(x3dom.fields.SFMatrix4f.scale(\n                new x3dom.fields.SFVec3f(0.5, 0.5, 1.0))), (columnNr * 2 + 1), (rowNr * 2 + 1), geometry, path + imgNumber + \"/\", 4));\n    }\n\n\n\n    /*\n     * Returns the shape of this node\n     * @returns {x3dom.nodeTypes.Shape}\n     */\n    this.Shape = function () {\n        return shape;\n    };\n\n\n\n    /*\n     * Runs only local ready() method. This is needed from parent to ask if\n     * all children are ready to render or not\n     * @returns {Boolean} true if ready to render, else false\n     */\n    this.Ready = function(){\n        if (shape._webgl !== undefined && shape._webgl.texture !== undefined) {\n            return ready();\n        }\n\n        return false;\n    };\n\n\n\n    /*\n     * Iterates through all textures of this node and sets readState parameter\n     * to true if all textures have been loaded to gpu yet, false if not.\n     * @returns {Boolean} true if ready to render, else false\n     */\n    function ready() {\n        readyState = true;\n        for (var i = 0; i < shape._webgl.texture.length; i++){\n            if (!shape._webgl.texture[i].texture.ready){\n                readyState = false;\n            }\n\n\n        }\n\n        return readyState;\n    }\n\n\n\n    /*\n     * Updates the loading state of children and initializes this node\n     * if this wasn't done before\n     * @param {x3dom.DrawableCollection} drawableCollection\n     * @param {x3dom.fields.SFMatrix4f} transform outer transformation matrix\n     * @returns {null}\n     */\n    function updateLoadingState(drawableCollection, transform){\n\n        childrenReadyState = true;\n        for (var i = 0; i < children.length; i++){\n            if (!children[i].Ready()) {\n                childrenReadyState = false;\n            }\n        }\n\n        if (children.length < 4){\n            childrenReadyState = false;\n        }\n        else if (childrenReadyState) {\n            for (var i = 0; i < children.length; i++){\n                children[i].Shape()._vf.render = true;\n            }\n        }\n\n\n        if (shape._webgl === undefined || shape._webgl.texture === undefined) {\n            drawableCollection.context.setupShape(drawableCollection.gl,\n                {shape:shape, transform:transform},\n                drawableCollection.viewarea);\n        }\n        else {\n            ready();\n        }\n\n    }\n\n\n\n    /*\n     * Decides to create new children and if the node shoud be drawn or not\n     * @param {x3dom.fields.SFMatrix4f} transform outer transformation matrix\n     * @param {x3dom.DrawableCollection} drawableCollection\n     * @param {bool} singlePath\n     * @param {bool} invalidateCache\n     * @param {number} planeMask\n     * @returns {null}\n     */\n    this.collectDrawables = function (transform, drawableCollection,\n                                      singlePath, invalidateCache, planeMask) {\n\n        // definition the actual transformation of the node\n        cullObject.localMatrix = nodeTransformation;\n        // Checks the actual loading state of itself and children if something wasn't loaded in last frame\n        if (!readyState || !childrenReadyState) { updateLoadingState(drawableCollection, nodeTransformation); }\n\n        if (readyState && (planeMask = drawableCollection.cull(nodeTransformation, cullObject, singlePath, planeMask)) > 0) {\n            var mat_view = drawableCollection.viewMatrix;\n            var vPos = mat_view.multMatrixPnt(nodeTransformation.multMatrixPnt(position));\n            var distanceToCamera = Math.sqrt(Math.pow(vPos.x, 2) + Math.pow(vPos.y, 2) + Math.pow(vPos.z, 2));\n\n            if ((distanceToCamera < Math.pow((bvhRefiner._vf.maxDepth - level), 2) * resizeFac / bvhRefiner._vf.factor) || level < bvhRefiner._vf.minDepth) {\n                if (bvhRefiner.view.isMovingOrAnimating() && children.length === 0 ||\n                    bvhRefiner.view.isMovingOrAnimating() && level >= bvhRefiner._vf.interactionDepth) {\n                    shape.collectDrawableObjects(nodeTransformation, drawableCollection, singlePath, invalidateCache, planeMask, []);\n                }\n                else {\n                    if (children.length === 0) {\n                        bvhRefiner.nodeProducer.AddNewNode(that, distanceToCamera);\n                        shape.collectDrawableObjects(nodeTransformation, drawableCollection, singlePath, invalidateCache, planeMask, []);\n                    }\n                    else {\n                        if (childrenReadyState) {\n                            for (var i = 0; i < children.length; i++) {\n                                children[i].collectDrawables(nodeTransformation, drawableCollection, singlePath, invalidateCache, planeMask);\n                            }\n                        }\n                        else {\n                            shape.collectDrawableObjects(nodeTransformation, drawableCollection, singlePath, invalidateCache, planeMask, []);\n                            for (var i = 0; i < children.length; i++) {\n                                children[i].collectDrawables(nodeTransformation, drawableCollection, singlePath, invalidateCache, planeMask);\n                                children[i].Shape()._vf.render = false;\n                            }\n                        }\n                    }\n                }\n            }\n            else {\n                shape.collectDrawableObjects(nodeTransformation, drawableCollection, singlePath, invalidateCache, planeMask, []);\n            }\n        }\n    };\n\n\n\n    /*\n     * Returns the volume of this node\n     * @returns {x3dom.fields.BoxVolume}\n     */\n    this.getVolume = function() {\n        return shape.getVolume();\n    };\n\n\n    /*\n     * Returns the level of this node\n     * @returns {number}\n     */\n    this.Level = function () {\n        return level;\n    };\n\n\n\n    // reference to get access to public methods within this node\n    var that = this;\n    // initializes this node directly after creating\n    initialize();\n}\n\n\n\n/*******************************************************************************\n *******************************************************************************\n **************************** QuadtreeNode3D ***********************************\n *******************************************************************************\n *******************************************************************************\n *\n * Defines one 3D node (plane with displacement) of a quadtree that represents\n * a part (nxn vertices) of the whole mesh.\n * @param {object} ctx context\n * @param {x3dom.nodeTypes.BVHRefiner} bvhRefiner root bvhRefiner node\n * @param {number} level level of the node within the quadtree\n * @param {number} nodeNumber id of the node within the level\n * @param {x3dom.fields.SFMatrix4f} nodeTransformation transformation matrix\n *                                  that defines scale and position\n * @param {number} columnNr column number in the wmts matrix within the level\n * @param {number} rowNr row number in the wmts matrix within the level\n * @param {x3dom.nodeTypes.Plane} geometry plane\n * @returns {QuadtreeNode3D}\n */\nfunction QuadtreeNode3D(ctx, bvhRefiner, level, nodeNumber, nodeTransformation,\n                        columnNr, rowNr, geometry)\n{\n    // array with the maximal four child nodes\n    var children = [];\n    // neighborhood of the node (0=left, 1=right, 2=bottom, 3=top)\n    var neighbors = [];\n    // drawable component of this node\n    var shape = new x3dom.nodeTypes.Shape();\n    // position of the node in world space\n    var position = null;\n    // address of the image for the bvhRefiner surface\n    var imageAddressColor = bvhRefiner._vf.textureUrl + \"/\" + level + \"/\" +\n        columnNr + \"/\" + rowNr + \".\" +\n        (bvhRefiner._vf.textureFormat).toLowerCase();\n    // address of the image for the bvhRefiner height-data\n    var imageAddressHeight = bvhRefiner._vf.elevationUrl + \"/\" + level + \"/\" +\n        columnNr + \"/\" + rowNr + \".\" +\n        (bvhRefiner._vf.elevationFormat).toLowerCase();\n    if (bvhRefiner._vf.normalUrl !== \"\")\n    // address of the image for the bvhRefiner normal-data\n        var imageAddressNormal = bvhRefiner._vf.normalUrl + \"/\" + level + \"/\" +\n            columnNr + \"/\" + rowNr + \".\" +\n            (bvhRefiner._vf.normalFormat).toLowerCase();\n    // true if this component is available and renderable\n    var readyState = false;\n    // checks if children are ready\n    var childrenReadyState = false;\n    // defines the resizing factor\n    var resizeFac = (bvhRefiner._vf.size.x + bvhRefiner._vf.size.y) / 2.0;\n    // object that stores all information to do a frustum culling\n    var cullObject = {};\n    // last indice number of mesh\n    var lastIndice = 0;\n    // triangulation attributes --> offset and count of triangulation buffer\n    var triangulationAttributes = null;\n\n\n\n    /*\n     * Initializes all nodeTypes that are needed to create the drawable\n     * component for this node\n     */\n    function initialize() {\n\n        // appearance of the drawable component of this node\n        var appearance = new x3dom.nodeTypes.Appearance(ctx);\n        // multiTexture to get heightmap and colormap to gpu\n        var textures = new x3dom.nodeTypes.MultiTexture(ctx);\n        // texture that should represent the surface-data of this node\n        var colorTexture = new x3dom.nodeTypes.ImageTexture(ctx);\n        // texture that should represent the height-data of this node\n        var heightTexture = new x3dom.nodeTypes.ImageTexture(ctx);\n        // texture that should represent the normal-data of this node\n        var normalTexture = new x3dom.nodeTypes.ImageTexture(ctx);\n        // creating the special shader for these nodes\n        var composedShader = new x3dom.nodeTypes.ComposedShader(ctx);\n\n        // definition of the nameSpace of this shape\n        shape._nameSpace = bvhRefiner._nameSpace;\n\n        // calculate the average position of the node\n        position = nodeTransformation.e3();\n        position.z = bvhRefiner._vf.maxElevation / 2;\n\n        // creating the special vertex-shader for bvhRefiner-nodes\n        var vertexShader = new x3dom.nodeTypes.ShaderPart(ctx);\n        vertexShader._vf.type = 'vertex';\n        vertexShader._vf.url[0] = createVertexShader();\n\n        // creating the special fragment-shader for bvhRefiner-nodes\n        var fragmentShader = new x3dom.nodeTypes.ShaderPart(ctx);\n        fragmentShader._vf.type = 'fragment';\n        fragmentShader._vf.url[0] = createFragmentShader();\n\n        // create complete-shader with vertex- and fragment-shader\n        composedShader.addChild(vertexShader, 'parts');\n        composedShader.addChild(fragmentShader, 'parts');\n\n        var colorTexProp = new x3dom.nodeTypes.TextureProperties(ctx);\n        colorTexProp._vf.boundaryModeS = \"CLAMP_TO_EDGE\";\n        colorTexProp._vf.boundaryModeT = \"CLAMP_TO_EDGE\";\n        colorTexProp._vf.boundaryModeR = \"CLAMP_TO_EDGE\";\n        colorTexProp._vf.minificationFilter = \"LINEAR\";\n        colorTexProp._vf.magnificationFilter = \"LINEAR\";\n        colorTexture.addChild(colorTexProp, \"textureProperties\");\n        colorTexture.nodeChanged();\n        // create texture-data of this node with url's of the texture data\n        colorTexture._nameSpace = bvhRefiner._nameSpace;\n        colorTexture._vf.url[0] = imageAddressColor;\n        colorTexture._vf.repeatT = false;\n        colorTexture._vf.repeatS = false;\n        textures.addChild(colorTexture, 'texture');\n        colorTexture.nodeChanged();\n        var colorTextureField = new x3dom.nodeTypes.Field(ctx);\n        colorTextureField._vf.name = 'texColor';\n        colorTextureField._vf.type = 'SFInt32';\n        colorTextureField._vf.value = 0;\n        composedShader.addChild(colorTextureField, 'fields');\n        colorTextureField.nodeChanged();\n\n        // create height-data\n        var heightTexProp = new x3dom.nodeTypes.TextureProperties(ctx);\n        heightTexProp._vf.boundaryModeS = \"CLAMP_TO_EDGE\";\n        heightTexProp._vf.boundaryModeT = \"CLAMP_TO_EDGE\";\n        heightTexProp._vf.boundaryModeR = \"CLAMP_TO_EDGE\";\n        heightTexProp._vf.minificationFilter = \"NEAREST\";\n        heightTexProp._vf.magnificationFilter = \"NEAREST\";\n        heightTexture.addChild(heightTexProp, \"textureProperties\");\n        heightTexture.nodeChanged();\n        heightTexture._nameSpace = bvhRefiner._nameSpace;\n        heightTexture._vf.url[0] = imageAddressHeight;\n        heightTexture._vf.repeatT = false;\n        heightTexture._vf.repeatS = false;\n        heightTexture._vf.scale = false;\n        textures.addChild(heightTexture, 'texture');\n        heightTexture.nodeChanged();\n        var heightTextureField = new x3dom.nodeTypes.Field(ctx);\n        heightTextureField._vf.name = 'texHeight';\n        heightTextureField._vf.type = 'SFInt32';\n        heightTextureField._vf.value = 1;\n        composedShader.addChild(heightTextureField, 'fields');\n        heightTextureField.nodeChanged();\n\n        if (bvhRefiner._vf.normalUrl !== \"\") {\n            var normalTexProp = new x3dom.nodeTypes.TextureProperties(ctx);\n            normalTexProp._vf.boundaryModeS = \"CLAMP_TO_EDGE\";\n            normalTexProp._vf.boundaryModeT = \"CLAMP_TO_EDGE\";\n            normalTexProp._vf.boundaryModeR = \"CLAMP_TO_EDGE\";\n            normalTexProp._vf.minificationFilter = \"LINEAR\";\n            normalTexProp._vf.magnificationFilter = \"LINEAR\";\n            normalTexture.addChild(normalTexProp, \"textureProperties\");\n            normalTexture.nodeChanged();\n            // create normal-data\n            normalTexture._nameSpace = bvhRefiner._nameSpace;\n            normalTexture._vf.url[0] = imageAddressNormal;\n            normalTexture._vf.repeatT = false;\n            normalTexture._vf.repeatS = false;\n            textures.addChild(normalTexture, 'texture');\n            normalTexture.nodeChanged();\n            var normalTextureField = new x3dom.nodeTypes.Field(ctx);\n            normalTextureField._vf.name = 'texNormal';\n            normalTextureField._vf.type = 'SFInt32';\n            normalTextureField._vf.value = 2;\n            composedShader.addChild(normalTextureField, 'fields');\n            normalTextureField.nodeChanged();\n        }\n\n        // transmit maximum elevation value to gpu\n        var maxHeight = new x3dom.nodeTypes.Field(ctx);\n        maxHeight._vf.name = 'maxElevation';\n        maxHeight._vf.type = 'SFFloat';\n        maxHeight._vf.value = bvhRefiner._vf.maxElevation;\n        composedShader.addChild(maxHeight, 'fields');\n        maxHeight.nodeChanged();\n\n        // add textures to the appearence of this node\n        appearance.addChild(textures);\n        textures.nodeChanged();\n        appearance.addChild(composedShader);\n        composedShader.nodeChanged();\n\n        // create shape with geometry and appearance data\n        shape.addChild(appearance);\n        appearance.nodeChanged();\n        shape.addChild(geometry);\n\n        // add shape to bvhRefiner object\n        bvhRefiner.addChild(shape);\n        shape.nodeChanged();\n\n        // definition the static properties of cullObject\n        cullObject.boundedNode = shape;\n        cullObject.volume = shape.getVolume();\n        // setting max and min in z-direction to get the complete volume\n        cullObject.volume.max.z = bvhRefiner._vf.maxElevation;\n        cullObject.volume.min.z = 0;\n\n        cullObject.volume.center = cullObject.volume.min.add(cullObject.volume.max).multiply(0.5);\n        cullObject.volume.transform(nodeTransformation);\n        //shape._graph.volume = cullObject.volume;\n\n        calculateNeighborhood();\n    }\n\n\n\n    function calculateNeighborhood() {\n\n        // stores the start-ID of this level in quadList\n        var levelStartID = 0;\n\n        // calculate id in quadList where to store this quad\n        for (var i = 0; i < level; i++) {\n            levelStartID += Math.pow(4, i);\n        }\n        var sid = levelStartID + nodeNumber;\n        bvhRefiner.nodeList[sid] = that;\n\n        var c = Math.sqrt(Math.pow(4, level));\n        // calculate neighbor-IDs\n        // on the left side of the quad\n        neighbors[0] = levelStartID + (Math.ceil(((nodeNumber + 1) / c) - 1) * c + ((nodeNumber + (c - 1)) % c));\n        // on the right side of the quad\n        neighbors[1] = levelStartID + (Math.ceil(((nodeNumber + 1) / c) - 1) * c + ((nodeNumber + 1) % c));\n        // on the top side of the quad\n        neighbors[3] = levelStartID + (nodeNumber + (c * (c - 1))) % (Math.pow(4, level));\n        // on the bottom side of the quad\n        neighbors[2] = levelStartID + (nodeNumber + c) % (Math.pow(4, level));\n\n        if (columnNr === 0) { neighbors[0] = -1; }\n        if (rowNr === 0) { neighbors[3] = -1; }\n        if (columnNr === c - 1) { neighbors[1] = -1; }\n        if (rowNr === c - 1) { neighbors[2] = -1; }\n    }\n\n\n\n    /*\n     * Creates the code for the vertex shader\n     * @returns {String} code of the vertex shader\n     */\n    function createVertexShader() {\n        if (bvhRefiner._vf.normalUrl !== \"\")\n            return \"attribute vec3 position;\\n\" +\n                \"attribute vec3 texcoord;\\n\" +\n                \"uniform mat4 modelViewMatrix;\\n\" +\n                \"uniform mat4 modelViewProjectionMatrix;\\n\" +\n                \"uniform sampler2D texColor;\\n\" +\n                \"uniform sampler2D texHeight;\\n\" +\n                \"uniform float maxElevation;\\n\" +\n                \"uniform sampler2D texNormal;\\n\" +\n                \"varying vec2 texC;\\n\" +\n                \"varying vec3 vLight;\\n\" +\n                \"const float shininess = 32.0;\\n\" +\n                \"\\n\" +\n                \"void main(void) {\\n\" +\n                \"    vec3 uLightPosition = vec3(160.0, -9346.0, 4806.0);\\n\" +\n                \"    vec4 colr = texture2D(texColor, vec2(texcoord[0], 1.0-texcoord[1]));\\n\" +\n                \"    vec3 uAmbientMaterial = vec3(1.0, 1.0, 0.9);\" +\n                \"    vec3 uAmbientLight = vec3(0.5, 0.5, 0.5);\" +\n                \"    vec3 uDiffuseMaterial = vec3(0.7, 0.7, 0.7);\" +\n                \"    vec3 uDiffuseLight = vec3(1.0, 1.0, 1.0);\" +\n                \"    vec4 vertexPositionEye4 = modelViewMatrix * vec4(position, 1.0);\" +\n                \"    vec3 vertexPositionEye3 = vec3((modelViewMatrix * vec4(vertexPositionEye4.xyz, 1.0)).xyz);\" +\n                \"    vec3 vectorToLightSource = normalize(uLightPosition - vertexPositionEye3);\" +\n                \"    vec4 height = texture2D(texHeight, vec2(texcoord[0], 1.0 - texcoord[1]));\\n\" +\n                \"    vec4 normalEye = 2.0 * texture2D(texNormal, vec2(texcoord[0], 1.0-texcoord[1])) - 1.0;\\n\" +\n                \"    float diffuseLightWeighting = max(dot(normalEye.xyz, vectorToLightSource), 0.0);\" +\n                \"    texC = vec2(texcoord[0], 1.0-texcoord[1]);\\n\" +\n                \"    vec3 diffuseReflectance = uDiffuseMaterial * uDiffuseLight * diffuseLightWeighting;\" +\n                \"    vec3 uSpecularMaterial = vec3(0.0, 0.0, 0.0);\" +\n                \"    vec3 uSpecularLight = vec3(1.0, 1.0, 1.0);\" +\n                \"    vec3 reflectionVector = normalize(reflect(-vectorToLightSource, normalEye.xyz));\" +\n                \"    vec3 viewVectorEye = -normalize(vertexPositionEye3);\" +\n                \"    float rdotv = max(dot(reflectionVector, viewVectorEye), 0.0);\" +\n                \"    float specularLightWeight = pow(rdotv, shininess);\" +\n                \"    vec3 specularReflection = uSpecularMaterial * uSpecularLight * specularLightWeight;\" +\n                \"    vLight = vec4(uAmbientMaterial * uAmbientLight + diffuseReflectance + specularReflection, 1.0).xyz;\" +\n                \"    gl_Position = modelViewProjectionMatrix * vec4(position.xy, height.x * maxElevation, 1.0);\\n\" +\n                \"}\\n\";\n        else\n            return \"attribute vec3 position;\\n\" +\n                \"attribute vec3 texcoord;\\n\" +\n                \"uniform mat4 modelViewProjectionMatrix;\\n\" +\n                \"uniform sampler2D texHeight;\\n\" +\n                \"uniform float maxElevation;\\n\" +\n                \"varying vec2 texC;\\n\" +\n                \"\\n\" +\n                \"void main(void) {\\n\" +\n                \"    vec4 height = texture2D(texHeight, vec2(texcoord[0], 1.0 - texcoord[1]));\\n\" +\n                \"    texC = vec2(texcoord[0], 1.0-texcoord[1]);\\n\" +\n                \"    gl_Position = modelViewProjectionMatrix * vec4(position.xy, height.x * maxElevation, 1.0);\\n\" +\n                \"}\\n\";\n    }\n\n\n\n    /*\n     * Creates the code for the fragment shader\n     * @returns {String} code of the fragment shader\n     */\n    function createFragmentShader() {\n        if (bvhRefiner._vf.normalUrl !== \"\")\n            return \"#ifdef GL_ES\\n\" +\n                \"precision highp float;\\n\" +\n                \"#endif\\n\" +\n                \"uniform sampler2D texColor;\\n\" +\n                \"uniform sampler2D texNormal;\\n\" +\n                \"varying vec2 texC;\\n\" +\n                \"varying vec3 vLight;\\n\" +\n                \"\\n\" +\n                \"\\n\" +\n                \"void main(void) {\\n\" +\n                \"    vec4 normal = 2.0 * texture2D(texNormal, texC) - 1.0;\\n\" +\n                \"    vec4 colr = texture2D(texColor, texC);\\n\" +\n                \"    gl_FragColor = vec4(colr.xyz * vLight, colr.w);\\n\" +\n                \"}\\n\";\n        else\n            return \"#ifdef GL_ES\\n\" +\n                \"precision highp float;\\n\" +\n                \"#endif\\n\" +\n                \"uniform sampler2D texColor;\\n\" +\n                \"varying vec2 texC;\\n\" +\n                \"\\n\" +\n                \"\\n\" +\n                \"void main(void) {\\n\" +\n                \"    gl_FragColor = texture2D(texColor, texC);\\n\" +\n                \"}\\n\";\n    }\n\n\n\n    this.CreateChildren = function() {\n        create();\n    };\n\n\n\n    /*\n     * Creates the four children\n     */\n    function create() {\n\n        // calculation of children number nodeNumber within their level\n        var deltaR = Math.sqrt(Math.pow(4, level));\n        var deltaR1 = Math.sqrt(Math.pow(4, level + 1));\n        var lt = Math.floor(nodeNumber / deltaR) * 4 * deltaR +\n            (nodeNumber % deltaR) * 2;\n        var rt = lt + 1;\n        var lb = lt + deltaR1;\n        var rb = lb + 1;\n\n        // calculation of the scaling factor\n        var s = (bvhRefiner._vf.size).multiply(0.25);\n\n        // creation of all children\n        children.push(new QuadtreeNode3D(ctx, bvhRefiner, (level + 1), lt,\n            nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(\n                new x3dom.fields.SFVec3f(-s.x, s.y, 0.0))).mult(x3dom.fields.SFMatrix4f.scale(\n                new x3dom.fields.SFVec3f(0.5, 0.5, 1.0))), (columnNr * 2), (rowNr * 2), geometry));\n        children.push(new QuadtreeNode3D(ctx, bvhRefiner, (level + 1), rt,\n            nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(\n                new x3dom.fields.SFVec3f(s.x, s.y, 0.0))).mult(x3dom.fields.SFMatrix4f.scale(\n                new x3dom.fields.SFVec3f(0.5, 0.5, 1.0))), (columnNr * 2 + 1), (rowNr * 2), geometry));\n        children.push(new QuadtreeNode3D(ctx, bvhRefiner, (level + 1), lb,\n            nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(\n                new x3dom.fields.SFVec3f(-s.x, -s.y, 0.0))).mult(x3dom.fields.SFMatrix4f.scale(\n                new x3dom.fields.SFVec3f(0.5, 0.5, 1.0))), (columnNr * 2), (rowNr * 2 + 1), geometry));\n        children.push(new QuadtreeNode3D(ctx, bvhRefiner, (level + 1), rb,\n            nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(\n                new x3dom.fields.SFVec3f(s.x, -s.y, 0.0))).mult(x3dom.fields.SFMatrix4f.scale(\n                new x3dom.fields.SFVec3f(0.5, 0.5, 1.0))), (columnNr * 2 + 1), (rowNr * 2 + 1), geometry));\n    }\n\n\n\n    this.Shape = function(){\n        return shape;\n    };\n\n\n\n    /*\n     * Returns if the children of this node exist and are ready to render\n     */\n    this.ChildrenReady = function(){\n        return childrenReadyState;\n    };\n\n\n\n    /*\n     * Runs only local ready() method. This is needed from parent to ask if\n     * all children are ready to render or not\n     */\n    this.Ready = function(){\n        if (shape._webgl !== undefined && shape._webgl.texture !== undefined) {\n            return ready();\n        }\n\n        return false;\n    };\n\n\n\n    /*\n     * Iterates through all textures of this node and sets readState parameter\n     * to true if all textures have been loaded to gpu yet, false if not.\n     */\n    function ready() {\n        readyState = true;\n        for (var i = 0; i < shape._webgl.texture.length; i++){\n            if (!shape._webgl.texture[i].texture.ready){\n                readyState = false;\n            }\n        }\n\n        return readyState;\n    }\n\n\n\n    /*\n     * Updates the loading state of children and initializes this node\n     * if this wasn't done before\n     */\n    function updateLoadingState(drawableCollection, transform){\n\n        childrenReadyState = true;\n        for (var i = 0; i < children.length; i++){\n            if (!children[i].Ready()) {\n                childrenReadyState = false;\n            }\n        }\n\n        if (children.length < 4){\n            childrenReadyState = false;\n        }\n        else if (childrenReadyState) {\n            for (var i = 0; i < children.length; i++){\n                children[i].Shape()._vf.render = true;\n            }\n        }\n\n        if (shape._webgl === undefined || shape._webgl.texture === undefined) {\n            drawableCollection.context.setupShape(drawableCollection.gl,\n                {shape:shape, transform:transform},\n                drawableCollection.viewarea);\n        }\n        else {\n            ready();\n        }\n\n    }\n\n\n\n\n    /*\n     * Decides to create new children and if the node shoud be drawn or not\n     * @param {x3dom.fields.SFMatrix4f} transform outer transformation matrix\n     * @param {x3dom.DrawableCollection} drawableCollection\n     * @param {bool} singlePath\n     * @param {bool} invalidateCache\n     * @param {number} planeMask\n     * @returns {null}\n     */\n    this.collectDrawables = function (transform, drawableCollection, singlePath, invalidateCache, planeMask) {\n\n        // TODO: IMPLEMENT RIGHT\n        drawableCollection.frustumCulling = false;\n\n\n        // definition the actual transformation of the node\n        cullObject.localMatrix = nodeTransformation;\n        // Checks the actual loading state of itself and children if something wasn't loaded in last frame\n        if (!readyState || !childrenReadyState) {\n            updateLoadingState(drawableCollection, nodeTransformation);\n        }\n        var mat_view = drawableCollection.viewMatrix;\n        var vPos = mat_view.multMatrixPnt(nodeTransformation.multMatrixPnt(position));\n        var distanceToCamera = Math.sqrt(Math.pow(vPos.x, 2) + Math.pow(vPos.y, 2) + Math.pow(vPos.z, 2));\n\n        //if (readyState && (planeMask = drawableCollection.cull(nodeTransformation, shape.graphState(), singlePath, planeMask)) > 0) {\n        if (readyState && vPos.z - (cullObject.volume.diameter / 2) < 0) {\n            if ((distanceToCamera < Math.pow((bvhRefiner._vf.maxDepth - level), 2) * resizeFac / bvhRefiner._vf.factor) ||\n                level < bvhRefiner._vf.minDepth) {\n                if (bvhRefiner.view.isMovingOrAnimating() && (children.length == 0 || level >= bvhRefiner._vf.interactionDepth)){\n                    render(nodeTransformation, drawableCollection, singlePath, invalidateCache, planeMask);\n                }\n                else {\n                    if (children.length === 0) {\n                        bvhRefiner.nodeProducer.AddNewNode(that, distanceToCamera);\n                        render(nodeTransformation, drawableCollection, singlePath, invalidateCache, planeMask);\n                    }\n                    else {\n                        if (childrenReadyState){\n                            for (var i = 0; i < children.length; i++) {\n                                children[i].collectDrawables(nodeTransformation, drawableCollection, singlePath, invalidateCache, planeMask);\n                            }\n                        }\n                        else {\n                            render(nodeTransformation, drawableCollection, singlePath, invalidateCache, planeMask);\n                            for (var i = 0; i < children.length; i++) {\n                                children[i].collectDrawables(nodeTransformation, drawableCollection, singlePath, invalidateCache, planeMask);\n                                children[i].Shape()._vf.render = false;\n                            }\n                        }\n                    }\n                }\n            }\n            else {\n                render(nodeTransformation, drawableCollection, singlePath, invalidateCache, planeMask);\n            }\n        }\n    };\n\n\n\n    /*\n     * Decides if this node should be rendered or the children of this node\n     * @param {x3dom.DrawableCollection} drawableCollection\n     * @returns {Boolean}\n     */\n    this.hasHigherRenderLevel = function(drawableCollection){\n\n        var mat_view = drawableCollection.viewMatrix;\n        var vPos = mat_view.multMatrixPnt(nodeTransformation.multMatrixPnt(position));\n        var distanceToCamera = Math.sqrt(Math.pow(vPos.x, 2) + Math.pow(vPos.y, 2) + Math.pow(vPos.z, 2));\n\n        if (distanceToCamera < Math.pow((bvhRefiner._vf.maxDepth - level), 2) * resizeFac / bvhRefiner._vf.factor){\n            return true;\n        }\n\n\n        return false;\n    };\n\n\n\n    /*\n     * Renders the object with the required patch version\n     * @param {x3dom.fields.SFMatrix4f} transform outer transformation matrix\n     * @param {x3dom.DrawableCollection} drawableCollection\n     * @param {bool} singlePath\n     * @param {bool} invalidateCache\n     * @param {number} planeMask\n     * @returns {null}\n     */\n    function render(transform, drawableCollection, singlePath, invalidateCache, planeMask){\n\n        var hasNeighborHigherResolution = [];\n        // Calculation if neighbors levels\n        for (var i = 0; i < neighbors.length; i++){\n            if (bvhRefiner.nodeList[neighbors[i]] !== undefined) {\n                if (bvhRefiner.nodeList[neighbors[i]].ChildrenReady() &&\n                    bvhRefiner.nodeList[neighbors[i]].hasHigherRenderLevel(drawableCollection))\n                    hasNeighborHigherResolution.push(true);\n                else\n                    hasNeighborHigherResolution.push(false);\n            }\n            else {\n                hasNeighborHigherResolution.push(false);\n            }\n        }\n\n        var indiceNumber = 0;\n        //hasNeighborHigherResolution --> 0=left, 1=right, 2=bottom, 3=top\n        if (hasNeighborHigherResolution[3]) {\n            if (hasNeighborHigherResolution[1]) {\n                indiceNumber = 5;\n            }\n            else if (hasNeighborHigherResolution[0]) {\n                indiceNumber = 6;\n            }\n            else {\n                indiceNumber = 4;\n            }\n        }\n        else if (hasNeighborHigherResolution[2]) {\n            if (hasNeighborHigherResolution[1]) {\n                indiceNumber = 8;\n            }\n            else if (hasNeighborHigherResolution[0]) {\n                indiceNumber = 7;\n            }\n            else {\n                indiceNumber = 3;\n            }\n        }\n        else if (hasNeighborHigherResolution[0]) {\n            indiceNumber = 1;\n        }\n        else if (hasNeighborHigherResolution[1]) {\n            indiceNumber = 2;\n        }\n\n        if (lastIndice !== indiceNumber || triangulationAttributes === null){\n            triangulationAttributes = shape._cf.geometry.node.getTriangulationAttributes(indiceNumber);\n            lastIndice = indiceNumber;\n        }\n        shape._tessellationProperties = [ triangulationAttributes ];\n        shape.collectDrawableObjects(nodeTransformation, drawableCollection, singlePath, invalidateCache, planeMask, []);\n    }\n\n\n\n    /*\n     * Returns the volume of this node\n     */\n    this.getVolume = function() {\n        // TODO; implement correctly, for now just use first shape as workaround\n        return shape.getVolume();\n    };\n\n\n\n    this.Level = function() {\n        return level;\n    };\n\n\n    var that = this;\n    // initializes this node directly after creating\n    initialize();\n}\n\n\n\n\n/*****************************************************************************************************************************\n *****************************************************************************************************************************\n ************************************************ QuadtreeNodeBin ************************************************************\n *****************************************************************************************************************************\n ****************************************************************************************************************************/\n\n/*\n * Defines one node of a quadtree that represents a part (nxn vertices) of\n * the whole mesh, that represents a binary geometry object.\n * @param {object} ctx context\n * @param {x3dom.nodeTypes.BVHRefiner} bvhRefiner root bvhRefiner node\n * @param {number} level level of the node within the quadtree\n * @param {number} columnNr column number in the wmts matrix within the level\n * @param {number} rowNr row number in the wmts matrix within the level\n * @param {number} resizeFac defines the resizing factor. Can be null on init\n * @returns {QuadtreeNodeBin}\n */\nfunction QuadtreeNodeBin(ctx, bvhRefiner, level, columnNr, rowNr, resizeFac)\n{\n    // object that stores all information to do a frustum culling\n    var cullObject = {};\n    // temporary variable to store the view matrix\n    var mat_view;\n    // temporary position of this node in view space\n    var vPos;\n    // temporary distance to camera in view space\n    var distanceToCamera;\n    // factor redefinition to get a view about the whole scene on level three\n    var fac = ((1 / 4 * Math.pow(level, 2) + 1.5) * 0.1) * bvhRefiner._vf.factor;\n    // array with the maximal four child nodes\n    var children = [];\n    // true if a file for the children is available\n    var childrenExist = false;\n    // true if this component is available and renderable\n    var readyState = false;\n    // checks if children are ready\n    var childrenReadyState = false;\n    // path to x3d-file that should be loaded\n    var path = bvhRefiner._vf.url + \"/\" + level + \"/\" + columnNr + \"/\";\n    // address of the image for the bvhRefiner height-data\n    var file = path + rowNr + \".x3d\";\n    // position of the node in world space\n    var position = new x3dom.fields.SFVec3f(0.0, 0.0, 0.0);\n    // stores if file has been loaded\n    var exists = false;\n    // drawable component of this node\n    var shape = new x3dom.nodeTypes.Shape(ctx);\n\n\n    // loader for binary geometry files\n    var xhr = new XMLHttpRequest();\n    xhr.open(\"GET\", file, false);\n    // Try to load the binary geometry files\n    try {\n        //xhr.send();\n        x3dom.RequestManager.addRequest(xhr);\n\n        var xmlDoc = xhr.responseXML;\n        if (xmlDoc !== null) {\n            var replacer = new RegExp(\"\\\"\", \"g\");\n            createGeometry(shape);\n            initialize();\n            exists = true;\n        }\n    }\n    catch (exp) {\n        x3dom.debug.logException(\"Error loading file '\" + file + \"': \" + exp);\n    }\n\n\n    this.Exists = function () {\n        return exists;\n    };\n\n\n    this.Shape = function () {\n        return shape;\n    };\n\n\n\n    /*\n     * creates the geometry of this node\n     */\n    function createGeometry(parent) {\n        // definition of nameSpace\n        this._nameSpace = new x3dom.NodeNameSpace(\"\", bvhRefiner._nameSpace.doc);\n        this._nameSpace.setBaseURL(bvhRefiner._nameSpace.baseURL + path);\n        var tempShape = xmlDoc.getElementsByTagName(\"Shape\")[0];\n        shape = this._nameSpace.setupTree(tempShape);\n        if (!bvhRefiner._vf.useNormals) {\n            var appearance = new x3dom.nodeTypes.Appearance(ctx);\n            var material = new x3dom.nodeTypes.Material(ctx);\n            appearance.addChild(material);\n            shape._cf.appearance = appearance;\n        }\n        position = x3dom.fields.SFVec3f.copy(shape._cf.geometry.node._vf.position);\n    }\n\n\n\n    /*\n     * creates the appearance for this node and add it to the dom tree\n     */\n    function initialize() {\n\n        // bind static cull-properties to cullObject\n        cullObject.boundedNode = shape;\n        cullObject.volume = shape.getVolume();\n    }\n\n\n\n    this.CreateChildren = function () {\n        create();\n    };\n\n\n\n    /*\n     * creates the four child-nodes\n     */\n    function create() {\n        children.push(new QuadtreeNodeBin(ctx, bvhRefiner, (level + 1), (columnNr * 2), (rowNr * 2), resizeFac));\n        children.push(new QuadtreeNodeBin(ctx, bvhRefiner, (level + 1), (columnNr * 2 + 1), (rowNr * 2), resizeFac));\n        children.push(new QuadtreeNodeBin(ctx, bvhRefiner, (level + 1), (columnNr * 2), (rowNr * 2 + 1), resizeFac));\n        children.push(new QuadtreeNodeBin(ctx, bvhRefiner, (level + 1), (columnNr * 2 + 1), (rowNr * 2 + 1), resizeFac));\n    }\n\n\n\n    /*\n     * Runs only local ready() method. This is needed from parent to ask if\n     * all children are ready to render or not\n     */\n    this.Ready = function () {\n        if (shape._webgl !== undefined && shape._webgl.internalDownloadCount !== undefined) {\n            return ready();\n        }\n\n        return false;\n    };\n\n\n\n    /*\n     * Iterates through all textures of this node and sets readState parameter\n     * to true if all textures have been loaded to gpu yet, false if not.\n     */\n    function ready() {\n        readyState = true;\n\n        if (shape._webgl.internalDownloadCount > 0) {\n            readyState = false;\n        }\n\n        return readyState;\n    }\n\n\n\n    /*\n     * Updates the loading state of children and initializes this node\n     * if this wasn't done before\n     */\n    function updateLoadingState(drawableCollection, transform) {\n\n        childrenReadyState = true;\n        for (var i = 0; i < children.length; i++) {\n            if (!children[i].Ready()) {\n                childrenReadyState = false;\n            }\n        }\n\n        if (childrenReadyState){\n            for (var i = 0; i < children.length; i++){\n                children[i].Shape()._vf.render = true;\n            }\n        }\n\n        if (shape._cf.geometry.node !== null) {\n            if (shape._webgl === undefined || shape._webgl.internalDownloadCount === undefined) {\n                drawableCollection.context.setupShape(drawableCollection.gl,\n                    { shape: shape, transform: transform },\n                    drawableCollection.viewarea);\n            }\n            else {\n                ready();\n            }\n        }\n    }\n\n\n\n    /*\n     * Decides to create new children and if the node shoud be drawn or not\n     */\n    this.collectDrawables = function (transform, drawableCollection, singlePath, invalidateCache, planeMask) {\n\n        // THIS CALC IS ONLY FOR THE DEMO AND HAS TO BE DELETED AFTER IT\n        fac = ((1 / 4 * Math.pow(level, 2) + 1.5) * 0.1) * bvhRefiner._vf.factor;\n\n        // definition the actual transformation of the node\n        cullObject.localMatrix = transform;\n\n        // Checks the actual loading state of itself and children if something wasn't loaded in last frame\n        if (!readyState || !childrenReadyState) { updateLoadingState(drawableCollection, transform); }\n\n        if (readyState && exists && (planeMask = drawableCollection.cull(transform, cullObject, singlePath, planeMask)) > 0) {\n            mat_view = drawableCollection.viewMatrix;\n            vPos = mat_view.multMatrixPnt(transform.multMatrixPnt(position));\n            distanceToCamera = Math.sqrt(Math.pow(vPos.x, 2) + Math.pow(vPos.y, 2) + Math.pow(vPos.z, 2));\n\n            if ((distanceToCamera < Math.pow((bvhRefiner._vf.maxDepth - level), 2) / fac * 1000) || level < bvhRefiner._vf.minDepth) {\n                if (bvhRefiner.view.isMovingOrAnimating() && level >= bvhRefiner._vf.interactionDepth) {\n                    shape.collectDrawableObjects(transform, drawableCollection, singlePath, invalidateCache, planeMask, []);\n                }\n                else {\n                    if (children.length === 0) {\n                        bvhRefiner.nodeProducer.AddNewNode(that, distanceToCamera);\n                        shape.collectDrawableObjects(transform, drawableCollection, singlePath, invalidateCache, planeMask, []);\n                    }\n                    else if (children.length === 0 && bvhRefiner.createChildren > 0) {\n                        shape.collectDrawableObjects(transform, drawableCollection, singlePath, invalidateCache, planeMask, []);\n                    }\n                    else {\n                        if (!childrenExist) {\n                            for (var i = 0; i < children.length; i++) {\n                                if (children[i].Exists()) {\n                                    childrenExist = true;\n                                    break;\n                                }\n                            }\n                        }\n                        if (childrenExist && childrenReadyState) {\n                            for (var i = 0; i < children.length; i++) {\n                                children[i].collectDrawables(transform, drawableCollection, singlePath, invalidateCache, planeMask);\n                            }\n                        }\n                        else {\n                            for (var i = 0; i < children.length; i++) {\n                                children[i].collectDrawables(transform, drawableCollection, singlePath, invalidateCache, planeMask);\n                                children[i].Shape()._vf.render = false;\n                            }\n                            shape.collectDrawableObjects(transform, drawableCollection, singlePath, invalidateCache, planeMask, []);\n                        }\n                    }\n                }\n            }\n            else {\n                shape.collectDrawableObjects(transform, drawableCollection, singlePath, invalidateCache, planeMask, []);\n            }\n        }\n    };\n\n\n\n    /*\n     * Returns the volume of this node\n     */\n    this.getVolume = function () {\n        // TODO; implement correctly, for now just use first shape as workaround\n        return shape.getVolume();\n    };\n\n\n\n    this.Level = function () {\n        return level;\n    };\n\n\n    var that = this;\n    // initializes this node directly after creating\n    initialize();\n}\n\n\n\n\n/*****************************************************************************************************************************\n *****************************************************************************************************************************\n ***************************************************** BVHNode ***************************************************************\n *****************************************************************************************************************************\n ****************************************************************************************************************************/\n\n/*\n * Defines one node of an arbitrary tree that represents a part (nxn vertices)\n * of the entire point cloud\n * @param {object} ctx context\n * @param {x3dom.nodeTypes.BVHRefiner} bvhRefiner root bvhRefiner node\n * @param {number} level level of the node within the quadtree\n * @param {number} columnNr column number in the wmts matrix within the level\n * @param {number} rowNr row number in the wmts matrix within the level\n * @param {number} resizeFac defines the resizing factor. Can be null on init\n * @returns {OctreeNode}\n */\nfunction BVHNode(ctx, bvhRefiner, level, path, imgNumber, count)\n{\n    // object that stores all information to do a frustum culling\n    var cullObject = {};\n    // temporary variable to store the view matrix\n    var mat_view;\n    // temporary position of this node in view space\n    var vPos;\n    // temporary distance to camera in view space\n    var distanceToCamera;\n    // factor redefinition to get a view about the whole scene on level three\n    var fac = ((1/4 * Math.pow(level, 2) + 1.5) * 0.1) * bvhRefiner._vf.factor;\n    // array with the maximal four child nodes\n    var children = [];\n    // true if a file for the children is available\n    var childrenExist = false;\n    // true if this component is available and renderable\n    var readyState = false;\n    // checks if children are ready\n    var childrenReadyState = false;\n    // address of the image for the bvhRefiner height-data\n    var file = bvhRefiner._vf.url + path + imgNumber + \".x3d\";\n    // position of the node in world space\n    var position = new x3dom.fields.SFVec3f(0.0, 0.0, 0.0);\n    // stores if file has been loaded\n    var exists = false;\n    // drawable component of this node\n    var shape = new x3dom.nodeTypes.Shape(ctx);\n\n\n    this.RecalcFactor = function() {\n        fac = ((1/4 * Math.pow(level, 2) + 1.5) * 0.1) * bvhRefiner._vf.factor;\n        for (var i = 0; i < children.length; i++){\n            children[i].RecalcFactor();\n        }\n    };\n\n\n\n    // loader for binary geometry files\n    var xhr = new XMLHttpRequest();\n    xhr.open(\"GET\", file, false);\n    // Try to load the binary geometry files\n    try {\n        //xhr.send();\n        x3dom.RequestManager.addRequest(xhr);\n\n        var xmlDoc = xhr.responseXML;\n        if (xmlDoc !== null) {\n            var replacer = new RegExp(\"\\\"\", \"g\");\n            createGeometry(shape);\n            initialize();\n            exists = true;\n        }\n    }\n    catch (exp) {\n        x3dom.debug.logException(\"Error loading file '\" + file + \"': \" + exp);\n    }\n\n\n    this.Exists = function()\n    {\n        return exists;\n    };\n\n\n    this.Shape = function(){\n        return shape;\n    };\n\n\n\n    /*\n     * creates the geometry of this node\n     */\n    function createGeometry(parent) {\n        // definition of nameSpace\n        this._nameSpace = new x3dom.NodeNameSpace(\"\", bvhRefiner._nameSpace.doc);\n        this._nameSpace.setBaseURL(bvhRefiner._nameSpace.baseURL + bvhRefiner._vf.url + path);\n        var tempShape = xmlDoc.getElementsByTagName(\"Shape\")[0];\n        shape = this._nameSpace.setupTree(tempShape);\n        if (!bvhRefiner._vf.useNormals){\n            var appearance = new x3dom.nodeTypes.Appearance(ctx);\n            var material = new x3dom.nodeTypes.Material(ctx);\n            appearance.addChild(material);\n            shape._cf.appearance = appearance;\n        }\n        position = x3dom.fields.SFVec3f.copy(shape._cf.geometry.node._vf.position);\n    }\n\n\n\n    /*\n     * creates the appearance for this node and add it to the dom tree\n     */\n    function initialize() {\n\n        // bind static cull-properties to cullObject\n        cullObject.boundedNode = shape;\n        cullObject.volume = shape.getVolume();\n    }\n\n\n\n    this.CreateChildren = function() {\n        create();\n    };\n\n\n\n    /*\n     * creates the four child-nodes\n     */\n    function create() {\n        for (var i = 0; i < count; i++){\n            children.push(new BVHNode(ctx, bvhRefiner, (level + 1),\n                    path + imgNumber + \"/\",\n                    i + 1, count));\n        }\n    }\n\n\n\n    /*\n     * Runs only local ready() method. This is needed from parent to ask if\n     * all children are ready to render or not\n     */\n    this.Ready = function(){\n        if (shape._webgl !== undefined && shape._webgl.internalDownloadCount !== undefined) {\n            return ready();\n        }\n\n        return false;\n    };\n\n\n\n    /*\n     * Iterates through all textures of this node and sets readState parameter\n     * to true if all textures have been loaded to gpu yet, false if not.\n     */\n    function ready() {\n        return (shape._webgl.internalDownloadCount <= 0);\n    }\n\n\n\n    /*\n     * Updates the loading state of children and initializes this node\n     * if this wasn't done before\n     */\n    function updateLoadingState(drawableCollection, transform){\n\n        for (var i = 0; i < children.length; i++) {\n            childrenReadyState = true;\n            if (!children[i].Ready()) {\n                childrenReadyState = false;\n            }\n            else {\n                children[i].Shape()._vf.render = true;\n            }\n        }\n\n        if (shape._cf.geometry.node !== null) {\n            if (shape._webgl === undefined || shape._webgl.internalDownloadCount === undefined) {\n                drawableCollection.context.setupShape(drawableCollection.gl,\n                    {shape:shape, transform:transform},\n                    drawableCollection.viewarea);\n            }\n            else {\n                ready();\n            }\n        }\n    }\n\n\n\n    /*\n     * Decides to create new children and if the node shoud be drawn or not\n     */\n    this.collectDrawables = function (transform, drawableCollection, singlePath, invalidateCache, planeMask) {\n\n        // THIS CALC IS ONLY FOR THE DEMO AND HAS TO BE DELETED AFTER IT\n        fac = ((1/4 * Math.pow(level, 2) + 1.5) * 0.1) * bvhRefiner._vf.factor;\n\n        // definition the actual transformation of the node\n        cullObject.localMatrix = transform;\n\n        // Checks the actual loading state of itself and children if something wasn't loaded in last frame\n        if (!readyState || !childrenReadyState) { updateLoadingState(drawableCollection, transform); }\n\n        if (readyState && exists && (planeMask = drawableCollection.cull(transform, cullObject, singlePath, planeMask)) > 0) {\n            mat_view = drawableCollection.viewMatrix;\n            vPos = mat_view.multMatrixPnt(transform.multMatrixPnt(position));\n            distanceToCamera = Math.sqrt(Math.pow(vPos.x, 2) + Math.pow(vPos.y, 2) + Math.pow(vPos.z, 2));\n\n            if ((distanceToCamera < Math.pow((bvhRefiner._vf.maxDepth - level), 2) / fac) || level < bvhRefiner._vf.minDepth) {\n                if (bvhRefiner.view.isMovingOrAnimating() && level >= bvhRefiner._vf.interactionDepth) {\n                    shape.collectDrawableObjects(transform, drawableCollection, singlePath, invalidateCache, planeMask, []);\n                }\n                else {\n                    if (children.length === 0) {\n                        bvhRefiner.nodeProducer.AddNewNode(that, distanceToCamera);\n                        shape.collectDrawableObjects(transform, drawableCollection, singlePath, invalidateCache, planeMask, []);\n                    }\n                    else if (children.length === 0 && bvhRefiner.createChildren > 0) {\n                        shape.collectDrawableObjects(transform, drawableCollection, singlePath, invalidateCache, planeMask, []);\n                    }\n                    else {\n                        if (!childrenExist){\n                            for (var i = 0; i < children.length; i++) {\n                                if (children[i].Exists()) {\n                                    childrenExist = true;\n                                    break;\n                                }\n                            }\n                        }\n                        if (childrenExist && childrenReadyState){\n                            for (var i = 0; i < children.length; i++) {\n                                children[i].collectDrawables(transform, drawableCollection, singlePath, invalidateCache, planeMask);\n                            }\n                        }\n                        else {\n                            for (var i = 0; i < children.length; i++) {\n                                children[i].collectDrawables(transform, drawableCollection, singlePath, invalidateCache, planeMask);\n                                children[i].Shape()._vf.render = false;\n                            }\n                            shape.collectDrawableObjects(transform, drawableCollection, singlePath, invalidateCache, planeMask, []);\n                        }\n                    }\n                }\n            }\n            else {\n                shape.collectDrawableObjects(transform, drawableCollection, singlePath, invalidateCache, planeMask, []);\n            }\n        }\n    };\n\n\n\n    /*\n     * Returns the volume of this node\n     */\n    this.getVolume = function() {\n        // TODO; implement correctly, for now just use first shape as workaround\n        return shape.getVolume();\n    };\n\n\n\n    this.Level = function() {\n        return level;\n    };\n\n\n    var that = this;\n    // initializes this node directly after creating\n    initialize();\n}\n\n\n\n\n\n/*\n * Defines one 3D node (plane with displacement) of a quadtree that represents\n * a part (nxn vertices) of the whole mesh.\n * @param {object} ctx context\n * @param {x3dom.nodeTypes.BVHRefiner} bvhRefiner root bvhRefiner node\n * @param {number} level level of the node within the quadtree\n * @param {number} nodeNumber id of the node within the level\n * @param {x3dom.fields.SFMatrix4f} nodeTransformation transformation matrix that defines scale and position\n * @param {number} columnNr column number in the wmts matrix within the level\n * @param {number} rowNr row number in the wmts matrix within the level\n * @param {x3dom.nodeTypes.Plane} geometry plane\n * @returns {QuadtreeNode3D}\n */\nfunction QuadtreeNode3D_NEW(ctx, bvhRefiner, level, nodeNumber, nodeTransformation,\n                            columnNr, rowNr, geometry)\n{\n    // array with the maximal four child nodes\n    var children = [];\n    // drawable component of this node\n    var shape = new x3dom.nodeTypes.Shape();\n    // position of the node in world space\n    var position = null;\n    // address of the image for the bvhRefiner surface\n    var imageAddressColor = bvhRefiner._vf.textureUrl + \"/\" + level + \"/\" +\n        columnNr + \"/\" + rowNr + \".\" +\n        (bvhRefiner._vf.textureFormat).toLowerCase();\n    // address of the image for the bvhRefiner height-data\n    var imageAddressHeight = bvhRefiner._vf.elevationUrl + \"/\" + level + \"/\" +\n        columnNr + \"/\" + rowNr + \".\" +\n        (bvhRefiner._vf.elevationFormat).toLowerCase();\n    // address of the image for the bvhRefiner normal-data\n    var imageAddressNormal = bvhRefiner._vf.normalUrl + \"/\" + level + \"/\" +\n        columnNr + \"/\" + rowNr + \".\" +\n        (bvhRefiner._vf.normalFormat).toLowerCase();\n    // true if components are available and renderable\n    var exists = true;\n    // defines the resizing factor\n    var resizeFac = (bvhRefiner._vf.size.x + bvhRefiner._vf.size.y) / 2.0;\n    // object that stores all information to do a frustum culling\n    var cullObject = {};\n\n\n\n    /*\n     * Initializes all nodeTypes that are needed to create the drawable\n     * component for this node\n     */\n    function initialize() {\n\n        // appearance of the drawable component of this node\n        var appearance = new x3dom.nodeTypes.Appearance(ctx);\n        // multiTexture to get heightmap and colormap to gpu\n        var shader = new x3dom.nodeTypes.CommonSurfaceShader(ctx);\n        var ssTexColor = new x3dom.nodeTypes.SurfaceShaderTexture(ctx);\n        // texture that should represent the surface-data of this node\n        var colorTexture = new x3dom.nodeTypes.ImageTexture(ctx);\n        var ssTexDisplace = new x3dom.nodeTypes.SurfaceShaderTexture(ctx);\n        // texture that should represent the height-data of this node\n        var heightTexture = new x3dom.nodeTypes.ImageTexture(ctx);\n\n        // definition of the nameSpace of this shape\n        shape._nameSpace = bvhRefiner._nameSpace;\n\n        // calculate the average position of the node\n        position = nodeTransformation.e3();\n\n        shader._vf.displacementFactor = bvhRefiner._vf.maxElevation;\n\n        // create texture-data of this node with url's of the texture data\n        colorTexture._nameSpace = bvhRefiner._nameSpace;\n        colorTexture._vf.url[0] = imageAddressColor;\n        colorTexture._vf.repeatT = false;\n        colorTexture._vf.repeatS = false;\n        ssTexColor.addChild(colorTexture, 'texture');\n        colorTexture.nodeChanged();\n        shader.addChild(ssTexColor, 'diffuseTexture');\n        ssTexColor.nodeChanged();\n\n        // create height-data\n        heightTexture._nameSpace = bvhRefiner._nameSpace;\n        heightTexture._vf.url[0] = imageAddressHeight;\n        heightTexture._vf.repeatT = false;\n        heightTexture._vf.repeatS = false;\n        ssTexDisplace.addChild(heightTexture, 'texture');\n        heightTexture.nodeChanged();\n        shader.addChild(ssTexDisplace, 'displacementTexture');\n        heightTexture.nodeChanged();\n\n        appearance.addChild(shader, 'shaders');\n        shader.nodeChanged();\n\n        // create shape with geometry and appearance data\n        shape.addChild(appearance);\n        appearance.nodeChanged();\n        shape.addChild(geometry);\n        geometry.nodeChanged();\n\n        // add shape to bvhRefiner object\n        bvhRefiner.addChild(shape);\n        shape.nodeChanged();\n\n        // definition the static properties of cullObject\n        cullObject.boundedNode = shape;\n        cullObject.volume = shape.getVolume();\n        // setting max and min in z-direction to get the complete volume\n        cullObject.volume.max.z = Math.round(bvhRefiner._vf.maxElevation / 2);\n        cullObject.volume.min.z = -cullObject.volume.max.z;\n    }\n\n\n\n    /*\n     * Creates the code for the vertex shader\n     * @returns {String} code of the vertex shader\n     */\n    function createVertexShader() {\n        return \"attribute vec3 position;\\n\" +\n            \"attribute vec3 texcoord;\\n\" +\n            \"uniform mat4 modelViewMatrix;\\n\" +\n            \"uniform mat4 modelViewProjectionMatrix;\\n\" +\n            \"uniform sampler2D texColor;\\n\" +\n            \"uniform sampler2D texHeight;\\n\" +\n            \"uniform float maxElevation;\\n\" +\n            \"uniform sampler2D texNormal;\\n\" +\n            \"varying vec2 texC;\\n\" +\n            \"varying vec3 vLight;\\n\" +\n            \"const float shininess = 32.0;\\n\" +\n            \"\\n\" +\n            \"void main(void) {\\n\" +\n            \"    vec3 uLightPosition = vec3(160.0, -9346.0, 4806.0);\\n\" +\n            \"    vec4 colr = texture2D(texColor, vec2(texcoord[0], 1.0-texcoord[1]));\\n\" +\n            \"    vec3 uAmbientMaterial = vec3(1.0, 1.0, 0.9);\" +\n            \"    vec3 uAmbientLight = vec3(0.5, 0.5, 0.5);\" +\n            \"    vec3 uDiffuseMaterial = vec3(0.7, 0.7, 0.7);\" +\n            \"    vec3 uDiffuseLight = vec3(1.0, 1.0, 1.0);\" +\n            \"    vec4 vertexPositionEye4 = modelViewMatrix * vec4(position, 1.0);\" +\n            \"    vec3 vertexPositionEye3 = vec3((modelViewMatrix * vec4(vertexPositionEye4.xyz, 1.0)).xyz);\" +\n            \"    vec3 vectorToLightSource = normalize(uLightPosition - vertexPositionEye3);\" +\n            \"    vec4 height = texture2D(texHeight, vec2(texcoord[0], 1.0 - texcoord[1]));\\n\" +\n            \"    vec4 normalEye = 2.0 * texture2D(texNormal, vec2(texcoord[0], 1.0-texcoord[1])) - 1.0;\\n\" +\n            \"    float diffuseLightWeighting = max(dot(normalEye.xyz, vectorToLightSource), 0.0);\" +\n            \"    texC = vec2(texcoord[0], 1.0-texcoord[1]);\\n\" +\n            \"    vec3 diffuseReflectance = uDiffuseMaterial * uDiffuseLight * diffuseLightWeighting;\" +\n            \"    vec3 uSpecularMaterial = vec3(0.0, 0.0, 0.0);\" +\n            \"    vec3 uSpecularLight = vec3(1.0, 1.0, 1.0);\" +\n            \"    vec3 reflectionVector = normalize(reflect(-vectorToLightSource, normalEye.xyz));\" +\n            \"    vec3 viewVectorEye = -normalize(vertexPositionEye3);\" +\n            \"    float rdotv = max(dot(reflectionVector, viewVectorEye), 0.0);\" +\n            \"    float specularLightWeight = pow(rdotv, shininess);\" +\n            \"    vec3 specularReflection = uSpecularMaterial * uSpecularLight * specularLightWeight;\" +\n            \"    vLight = vec4(uAmbientMaterial * uAmbientLight + diffuseReflectance + specularReflection, 1.0).xyz;\" +\n            \"    gl_Position = modelViewProjectionMatrix * vec4(position.xy, height.x * maxElevation, 1.0);\\n\" +\n            \"}\\n\";\n    }\n\n\n\n    /*\n     * Creates the code for the fragment shader\n     * @returns {String} code of the fragment shader\n     */\n    function createFragmentShader() {\n        return \"#ifdef GL_ES\\n\" +\n            \"precision highp float;\\n\" +\n            \"#endif\\n\" +\n            \"uniform sampler2D texColor;\\n\" +\n            \"uniform sampler2D texNormal;\\n\" +\n            \"varying vec2 texC;\\n\" +\n            \"varying vec3 vLight;\\n\" +\n            \"\\n\" +\n            \"\\n\" +\n            \"void main(void) {\\n\" +\n            \"    vec4 normal = 2.0 * texture2D(texNormal, texC) - 1.0;\\n\" +\n            \"    vec4 colr = texture2D(texColor, texC);\\n\" +\n            \"    gl_FragColor = vec4(colr.xyz * vLight, colr.w);\\n\" +\n            \"}\\n\";\n    }\n\n\n\n    /*\n     * Creates the four children\n     */\n    function create() {\n\n        // calculation of children number nodeNumber within their level\n        var deltaR = Math.sqrt(Math.pow(4, level));\n        var deltaR1 = Math.sqrt(Math.pow(4, level + 1));\n        var lt = Math.floor(nodeNumber / deltaR) * 4 * deltaR +\n            (nodeNumber % deltaR) * 2;\n        var rt = lt + 1;\n        var lb = lt + deltaR1;\n        var rb = lb + 1;\n\n        // calculation of the scaling factor\n        var s = (bvhRefiner._vf.size).multiply(0.25);\n\n        // creation of all children\n        children.push(new QuadtreeNode3D_NEW(ctx, bvhRefiner, (level + 1), lt,\n            nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(\n                new x3dom.fields.SFVec3f(-s.x, s.y, 0.0))).mult(x3dom.fields.SFMatrix4f.scale(\n                new x3dom.fields.SFVec3f(0.5, 0.5, 1.0))), (columnNr * 2), (rowNr * 2), geometry));\n        children.push(new QuadtreeNode3D_NEW(ctx, bvhRefiner, (level + 1), rt,\n            nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(\n                new x3dom.fields.SFVec3f(s.x, s.y, 0.0))).mult(x3dom.fields.SFMatrix4f.scale(\n                new x3dom.fields.SFVec3f(0.5, 0.5, 1.0))), (columnNr * 2 + 1), (rowNr * 2), geometry));\n        children.push(new QuadtreeNode3D_NEW(ctx, bvhRefiner, (level + 1), lb,\n            nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(\n                new x3dom.fields.SFVec3f(-s.x, -s.y, 0.0))).mult(x3dom.fields.SFMatrix4f.scale(\n                new x3dom.fields.SFVec3f(0.5, 0.5, 1.0))), (columnNr * 2), (rowNr * 2 + 1), geometry));\n        children.push(new QuadtreeNode3D_NEW(ctx, bvhRefiner, (level + 1), rb,\n            nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(\n                new x3dom.fields.SFVec3f(s.x, -s.y, 0.0))).mult(x3dom.fields.SFMatrix4f.scale(\n                new x3dom.fields.SFVec3f(0.5, 0.5, 1.0))), (columnNr * 2 + 1), (rowNr * 2 + 1), geometry));\n    }\n\n\n\n    /*\n     * Decides to create new children and if the node shoud be drawn or not\n     */\n    this.collectDrawables = function (transform, drawableCollection, singlePath, invalidateCache, planeMask) {\n\n        // definition the actual transformation of the node\n        cullObject.localMatrix = nodeTransformation;\n\n        if (exists && (planeMask = drawableCollection.cull(transform, cullObject, singlePath, planeMask)) > 0) {\n            var mat_view = drawableCollection.viewMatrix;\n            var vPos = mat_view.multMatrixPnt(transform.multMatrixPnt(position));\n            var distanceToCamera = Math.sqrt(Math.pow(vPos.x, 2) + Math.pow(vPos.y, 2) + Math.pow(vPos.z, 2));\n            if ((distanceToCamera < Math.pow((bvhRefiner._vf.maxDepth - level), 2) * resizeFac / bvhRefiner._vf.factor)) {\n                if (children.length === 0 && bvhRefiner.createChildren === 0) {\n                    bvhRefiner.createChildren++;\n                    create();\n                    shape.collectDrawableObjects(nodeTransformation, drawableCollection, singlePath, invalidateCache, planeMask, []);\n                }\n                else if (children.length === 0 && bvhRefiner.createChildren > 0) {\n                    shape.collectDrawableObjects(nodeTransformation, drawableCollection, singlePath, invalidateCache, planeMask, []);\n                }\n                else {\n                    for (var i = 0; i < children.length; i++) {\n                        children[i].collectDrawables(nodeTransformation, drawableCollection, singlePath, invalidateCache, planeMask);\n                    }\n                }\n            }\n            else {\n                shape.collectDrawableObjects(nodeTransformation, drawableCollection, singlePath, invalidateCache, planeMask, []);\n            }\n        }\n    };\n\n\n\n    /*\n     * Returns the volume of this node\n     */\n    this.getVolume = function() {\n        // TODO; implement correctly, for now just use first shape as workaround\n        return shape.getVolume();\n    };\n\n\n\n    // initializes this node directly after creating\n    initialize();\n}\n\n\n\n\n/*\n * Defines one node of an octree that represents a part (nxn vertices) of\n * the whole point cloud\n * @param {object} ctx context\n * @param {x3dom.nodeTypes.BVHRefiner} bvhRefiner root bvhRefiner node\n * @param {number} level level of the node within the quadtree\n * @param {number} columnNr column number in the wmts matrix within the level\n * @param {number} rowNr row number in the wmts matrix within the level\n * @param {number} resizeFac defines the resizing factor. Can be null on init\n * @returns {QuadtreeNodeBin}\n */\nfunction OctreeNode(ctx, bvhRefiner, level, nodeTransformation)\n{\n    // array with the maximal four child nodes\n    var children = [];\n    // position of the node in world space\n    var position = nodeTransformation.e3();\n    // drawable component of this node\n    var shape = new x3dom.nodeTypes.Shape(ctx);\n    // object that stores all information to do a frustum culling\n    var cullObject = {};\n    // defines the resizing factor\n    var resizeFac = (bvhRefiner._vf.octSize.x + bvhRefiner._vf.octSize.y + bvhRefiner._vf.octSize.z) / 3.0;\n\n\n\n    /*\n     * creates the appearance for this node and add it to the dom tree\n     */\n    function initialize() {\n\n        // appearance of the drawable component of this node\n        var appearance = new x3dom.nodeTypes.Appearance(ctx);\n        var geometry = new x3dom.nodeTypes.Box(ctx);\n\n        geometry._vf.size = bvhRefiner._vf.octSize;\n        geometry.fieldChanged('size');\n\n        // definition of nameSpace\n        shape._nameSpace = new x3dom.NodeNameSpace(\"\", bvhRefiner._nameSpace.doc);\n        shape._nameSpace.setBaseURL(bvhRefiner._nameSpace.baseURL);\n\n        shape.addChild(appearance);\n        appearance.nodeChanged();\n        shape.addChild(geometry);\n        geometry.nodeChanged();\n\n        //bvhRefiner.addChild(shape);\n        shape.nodeChanged();\n\n        // bind static cull-properties to cullObject\n        cullObject.boundedNode = shape;\n        cullObject.volume = shape.getVolume();\n    }\n\n\n\n    /*\n     * creates the four child-nodes\n     */\n    function create() {\n        // calculation of the scaling factor\n        var s = bvhRefiner._vf.octSize.multiply(0.25);\n\n        // creation of all children\n        children.push(new OctreeNode(ctx, bvhRefiner, (level + 1),\n            nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(\n                new x3dom.fields.SFVec3f(-s.x, s.y, s.z))).mult(x3dom.fields.SFMatrix4f.scale(\n                new x3dom.fields.SFVec3f(0.5, 0.5, 0.5)))));\n        children.push(new OctreeNode(ctx, bvhRefiner, (level + 1),\n            nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(\n                new x3dom.fields.SFVec3f(s.x, s.y, s.z))).mult(x3dom.fields.SFMatrix4f.scale(\n                new x3dom.fields.SFVec3f(0.5, 0.5, 0.5)))));\n        children.push(new OctreeNode(ctx, bvhRefiner, (level + 1),\n            nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(\n                new x3dom.fields.SFVec3f(-s.x, -s.y, s.z))).mult(x3dom.fields.SFMatrix4f.scale(\n                new x3dom.fields.SFVec3f(0.5, 0.5, 0.5)))));\n        children.push(new OctreeNode(ctx, bvhRefiner, (level + 1),\n            nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(\n                new x3dom.fields.SFVec3f(s.x, -s.y, s.z))).mult(x3dom.fields.SFMatrix4f.scale(\n                new x3dom.fields.SFVec3f(0.5, 0.5, 0.5)))));\n        children.push(new OctreeNode(ctx, bvhRefiner, (level + 1),\n            nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(\n                new x3dom.fields.SFVec3f(-s.x, s.y, -s.z))).mult(x3dom.fields.SFMatrix4f.scale(\n                new x3dom.fields.SFVec3f(0.5, 0.5, 0.5)))));\n        children.push(new OctreeNode(ctx, bvhRefiner, (level + 1),\n            nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(\n                new x3dom.fields.SFVec3f(s.x, s.y, -s.z))).mult(x3dom.fields.SFMatrix4f.scale(\n                new x3dom.fields.SFVec3f(0.5, 0.5, 0.5)))));\n        children.push(new OctreeNode(ctx, bvhRefiner, (level + 1),\n            nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(\n                new x3dom.fields.SFVec3f(-s.x, -s.y, -s.z))).mult(x3dom.fields.SFMatrix4f.scale(\n                new x3dom.fields.SFVec3f(0.5, 0.5, 0.5)))));\n        children.push(new OctreeNode(ctx, bvhRefiner, (level + 1),\n            nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(\n                new x3dom.fields.SFVec3f(s.x, -s.y, -s.z))).mult(x3dom.fields.SFMatrix4f.scale(\n                new x3dom.fields.SFVec3f(0.5, 0.5, 0.5)))));\n    }\n\n\n\n    /*\n     * Decides to create new children and if the node shoud be drawn or not\n     */\n    this.collectDrawables = function (transform, drawableCollection, singlePath, invalidateCache, planeMask) {\n\n        // definition the actual transformation of the node\n        cullObject.localMatrix = nodeTransformation;\n\n        if ((planeMask = drawableCollection.cull(transform, cullObject, singlePath, planeMask)) > 0) {\n\n            var mat_view = drawableCollection.viewMatrix;\n            var vPos = mat_view.multMatrixPnt(transform.multMatrixPnt(position));\n            var distanceToCamera = Math.sqrt(Math.pow(vPos.x, 2) + Math.pow(vPos.y, 2) + Math.pow(vPos.z, 2));\n\n            // bvhRefiner._vf.factor instead (level * 16)\n            if ((distanceToCamera < Math.pow((bvhRefiner._vf.maxDepth - level), 2) * resizeFac / bvhRefiner._vf.factor)) {\n                if (children.length === 0){\n                    create();\n                }\n                else {\n                    for (var i = 0; i < children.length; i++) {\n                        children[i].collectDrawables(nodeTransformation, drawableCollection, singlePath, invalidateCache, planeMask);\n                    }\n                }\n            }\n            else {\n                shape.collectDrawableObjects(nodeTransformation, drawableCollection, singlePath, invalidateCache, planeMask, []);\n            }\n        }\n    };\n\n\n\n    /*\n     * Returns the volume of this node\n     */\n    this.getVolume = function() {\n        // TODO; implement correctly, for now just use first box as workaround\n        return shape.getVolume();\n    };\n\n\n\n    // initializes this node directly after creating\n    initialize();\n}\n\n\n\n/*\n * Defines one 3D node (plane with displacement) of a quadtree that represents\n * a part (nxn vertices) of the whole mesh.\n * @param {object} ctx context\n * @param {x3dom.nodeTypes.BVHRefiner} bvhRefiner root bvhRefiner node\n * @param {number} level level of the node within the quadtree\n * @param {number} nodeNumber id of the node within the level\n * @param {x3dom.fields.SFMatrix4f} nodeTransformation transformation matrix that defines scale and position\n * @param {number} columnNr column number in the wmts matrix within the level\n * @param {number} rowNr row number in the wmts matrix within the level\n * @param {x3dom.nodeTypes.Plane} geometry plane\n * @returns {QuadtreeNode3D}\n */\nfunction QuadtreeNode3D_32bit(ctx, bvhRefiner, level, nodeNumber, nodeTransformation,\n                              columnNr, rowNr, geometry)\n{\n    // array with the maximal four child nodes\n    var children = [];\n    // drawable component of this node\n    var shape = new x3dom.nodeTypes.Shape();\n    // position of the node in world space\n    var position = null;\n    // address of the image for the bvhRefiner surface\n    var imageAddressColor = bvhRefiner._vf.textureUrl + \"/\" + level + \"/\" +\n        columnNr + \"/\" + rowNr + \".\" +\n        (bvhRefiner._vf.textureFormat).toLowerCase();\n    // address of the image for the bvhRefiner height-data\n    var imageAddressHeight = bvhRefiner._vf.elevationUrl + \"/\" + level + \"/\" +\n        columnNr + \"/\" + rowNr + \".\" +\n        (bvhRefiner._vf.elevationFormat).toLowerCase();\n    // address of the image for the bvhRefiner normal-data\n    var imageAddressNormal = bvhRefiner._vf.normalUrl + \"/\" + level + \"/\" +\n        columnNr + \"/\" + rowNr + \".\" +\n        (bvhRefiner._vf.normalFormat).toLowerCase();\n    // true if components are available and renderable\n    var exists = true;\n    // defines the resizing factor\n    var resizeFac = (bvhRefiner._vf.size.x + bvhRefiner._vf.size.y) / 2.0;\n    // object that stores all information to do a frustum culling\n    var cullObject = {};\n\n\n\n    /*\n     * Initializes all nodeTypes that are needed to create the drawable\n     * component for this node\n     */\n    function initialize() {\n\n        // appearance of the drawable component of this node\n        var appearance = new x3dom.nodeTypes.Appearance(ctx);\n        // multiTexture to get heightmap and colormap to gpu\n        var textures = new x3dom.nodeTypes.MultiTexture(ctx);\n        // texture that should represent the surface-data of this node\n        var colorTexture = new x3dom.nodeTypes.ImageTexture(ctx);\n        // texture that should represent the height-data of this node\n        var heightTexture = new x3dom.nodeTypes.ImageTexture(ctx);\n        // texture that should represent the normal-data of this node\n        var normalTexture = new x3dom.nodeTypes.ImageTexture(ctx);\n        // creating the special shader for these nodes\n        var composedShader = new x3dom.nodeTypes.ComposedShader(ctx);\n\n        // definition of the nameSpace of this shape\n        shape._nameSpace = bvhRefiner._nameSpace;\n\n        // calculate the average position of the node\n        position = nodeTransformation.e3();\n\n        // creating the special vertex-shader for bvhRefiner-nodes\n        var vertexShader = new x3dom.nodeTypes.ShaderPart(ctx);\n        vertexShader._vf.type = 'vertex';\n        vertexShader._vf.url[0] = createVertexShader();\n\n        // creating the special fragment-shader for bvhRefiner-nodes\n        var fragmentShader = new x3dom.nodeTypes.ShaderPart(ctx);\n        fragmentShader._vf.type = 'fragment';\n        fragmentShader._vf.url[0] = createFragmentShader();\n\n        // create complete-shader with vertex- and fragment-shader\n        composedShader.addChild(vertexShader, 'parts');\n        composedShader.addChild(fragmentShader, 'parts');\n\n        // create texture-data of this node with url's of the texture data\n        colorTexture._nameSpace = bvhRefiner._nameSpace;\n        colorTexture._vf.url[0] = imageAddressColor;\n        colorTexture._vf.repeatT = false;\n        colorTexture._vf.repeatS = false;\n        colorTexture._vf.generateMipMaps = false;\n        textures.addChild(colorTexture, 'texture');\n        colorTexture.nodeChanged();\n        var colorTextureField = new x3dom.nodeTypes.Field(ctx);\n        colorTextureField._vf.name = 'texColor';\n        colorTextureField._vf.type = 'SFInt32';\n        colorTextureField._vf.value = 0;\n        composedShader.addChild(colorTextureField, 'fields');\n        colorTextureField.nodeChanged();\n\n        // create height-data\n        heightTexture._nameSpace = bvhRefiner._nameSpace;\n        heightTexture._vf.url[0] = imageAddressHeight;\n        heightTexture._vf.repeatT = false;\n        heightTexture._vf.repeatS = false;\n\n        /*heightTexture._cf.textureProperties.node = new x3dom.nodeTypes.TextureProperties(ctx);\n         heightTexture._cf.textureProperties.node._vf.minificationFilter = 'NEAREST';\n         heightTexture._cf.textureProperties.node._vf.magnificationFilter = 'NEAREST';\n         heightTexture._cf.textureProperties.node._vf.generateMipMaps = false;\n         heightTexture._cf.textureProperties.node._vf.boundaryModeS = 'MIRRORED_REPEAT';\n         heightTexture._cf.textureProperties.node._vf.boundaryModeT = 'MIRRORED_REPEAT';\n         heightTexture._cf.textureProperties.node._vf.boundaryModeR = 'MIRRORED_REPEAT';*/\n\n        textures.addChild(heightTexture, 'texture');\n        heightTexture.nodeChanged();\n        var heightTextureField = new x3dom.nodeTypes.Field(ctx);\n        heightTextureField._vf.name = 'texHeight';\n        heightTextureField._vf.type = 'SFInt32';\n        heightTextureField._vf.value = 1;\n        composedShader.addChild(heightTextureField, 'fields');\n        heightTextureField.nodeChanged();\n\n        // create normal-data\n        normalTexture._nameSpace = bvhRefiner._nameSpace;\n        normalTexture._vf.url[0] = imageAddressNormal;\n        normalTexture._vf.repeatT = false;\n        normalTexture._vf.repeatS = false;\n        textures.addChild(normalTexture, 'texture');\n        normalTexture.nodeChanged();\n        var normalTextureField = new x3dom.nodeTypes.Field(ctx);\n        normalTextureField._vf.name = 'texNormal';\n        normalTextureField._vf.type = 'SFInt32';\n        normalTextureField._vf.value = 2;\n        composedShader.addChild(normalTextureField, 'fields');\n        normalTextureField.nodeChanged();\n\n        // transmit maximum elevation value to gpu\n        var maxHeight = new x3dom.nodeTypes.Field(ctx);\n        maxHeight._vf.name = 'maxElevation';\n        maxHeight._vf.type = 'SFFloat';\n        maxHeight._vf.value = bvhRefiner._vf.maxElevation;\n        composedShader.addChild(maxHeight, 'fields');\n        maxHeight.nodeChanged();\n\n        // add textures to the appearence of this node\n        appearance.addChild(textures);\n        textures.nodeChanged();\n        appearance.addChild(composedShader);\n        composedShader.nodeChanged();\n\n        // create shape with geometry and appearance data\n        shape.addChild(appearance);\n        appearance.nodeChanged();\n        shape.addChild(geometry);\n        geometry.nodeChanged();\n\n        // add shape to bvhRefiner object\n        bvhRefiner.addChild(shape);\n        shape.nodeChanged();\n\n        // definition the static properties of cullObject\n        cullObject.boundedNode = shape;\n        cullObject.volume = shape.getVolume();\n        // setting max and min in z-direction to get the complete volume\n        cullObject.volume.max.z = Math.round(bvhRefiner._vf.maxElevation);\n        cullObject.volume.min.z = -cullObject.volume.max.z;\n    }\n\n\n\n    /*\n     * Creates the code for the vertex shader\n     * @returns {String} code of the vertex shader\n     */\n    function createVertexShader() {\n        return \"attribute vec3 position;\\n\" +\n            \"attribute vec3 texcoord;\\n\" +\n            \"uniform mat4 modelViewMatrix;\\n\" +\n            \"uniform mat4 modelViewProjectionMatrix;\\n\" +\n            \"uniform sampler2D texColor;\\n\" +\n            \"uniform sampler2D texHeight;\\n\" +\n            \"uniform float maxElevation;\\n\" +\n            \"uniform sampler2D texNormal;\\n\" +\n            \"varying vec2 texC;\\n\" +\n            \"varying vec3 vLight;\\n\" +\n            \"const float shininess = 32.0;\\n\" +\n            \"\\n\" +\n            \"void main(void) {\\n\" +\n            \"    vec3 uLightPosition = vec3(160.0, -9346.0, 4806.0);\\n\" +\n            \"    vec4 colr = texture2D(texColor, vec2(texcoord[0], 1.0-texcoord[1]));\\n\" +\n            \"    vec3 uAmbientMaterial = vec3(1.0, 1.0, 0.9);\" +\n            \"    vec3 uAmbientLight = vec3(0.5, 0.5, 0.5);\" +\n            \"    vec3 uDiffuseMaterial = vec3(0.7, 0.7, 0.7);\" +\n            \"    vec3 uDiffuseLight = vec3(1.0, 1.0, 1.0);\" +\n            \"    vec4 vertexPositionEye4 = modelViewMatrix * vec4(position, 1.0);\" +\n            \"    vec3 vertexPositionEye3 = vec3((modelViewMatrix * vec4(vertexPositionEye4.xyz, 1.0)).xyz);\" +\n            \"    vec3 vectorToLightSource = normalize(uLightPosition - vertexPositionEye3);\" +\n            \"    vec4 height = texture2D(texHeight, vec2(texcoord[0], 1.0 - texcoord[1]));\\n\" +\n            \"    vec4 normalEye = 2.0 * texture2D(texNormal, vec2(texcoord[0], 1.0-texcoord[1])) - 1.0;\\n\" +\n            \"    float diffuseLightWeighting = max(dot(normalEye.xyz, vectorToLightSource), 0.0);\" +\n            \"    texC = vec2(texcoord[0], 1.0-texcoord[1]);\\n\" +\n            \"    vec3 diffuseReflectance = uDiffuseMaterial * uDiffuseLight * diffuseLightWeighting;\" +\n            \"    vec3 uSpecularMaterial = vec3(0.0, 0.0, 0.0);\" +\n            \"    vec3 uSpecularLight = vec3(1.0, 1.0, 1.0);\" +\n            \"    vec3 reflectionVector = normalize(reflect(-vectorToLightSource, normalEye.xyz));\" +\n            \"    vec3 viewVectorEye = -normalize(vertexPositionEye3);\" +\n            \"    float rdotv = max(dot(reflectionVector, viewVectorEye), 0.0);\" +\n            \"    float specularLightWeight = pow(rdotv, shininess);\" +\n            \"    vec3 specularReflection = uSpecularMaterial * uSpecularLight * specularLightWeight;\" +\n            \"    vLight = vec4(uAmbientMaterial * uAmbientLight + diffuseReflectance + specularReflection, 1.0).xyz;\" +\n            \"    gl_Position = modelViewProjectionMatrix * vec4(position.xy, ((height.g * 256.0)+height.b) * maxElevation, 1.0);\\n\" +\n            \"}\\n\";\n    }\n\n\n\n    /*\n     * Creates the code for the fragment shader\n     * @returns {String} code of the fragment shader\n     */\n    function createFragmentShader() {\n        return \"#ifdef GL_ES\\n\" +\n            \"precision highp float;\\n\" +\n            \"#endif\\n\" +\n            \"uniform sampler2D texColor;\\n\" +\n            \"uniform sampler2D texNormal;\\n\" +\n            \"varying vec2 texC;\\n\" +\n            \"varying vec3 vLight;\\n\" +\n            \"\\n\" +\n            \"\\n\" +\n            \"void main(void) {\\n\" +\n            \"    vec4 normal = 2.0 * texture2D(texNormal, texC) - 1.0;\\n\" +\n            \"    vec4 colr = texture2D(texColor, texC);\\n\" +\n            \"    float coler = ((colr.g * 256.0)+colr.b);\" +\n            \"    gl_FragColor = vec4(vLight * coler, 1.0);\\n\" +\n            \"}\\n\";\n    }\n\n\n\n    /*\n     * Creates the four children\n     */\n    function create() {\n\n        // calculation of children number nodeNumber within their level\n        var deltaR = Math.sqrt(Math.pow(4, level));\n        var deltaR1 = Math.sqrt(Math.pow(4, level + 1));\n        var lt = Math.floor(nodeNumber / deltaR) * 4 * deltaR +\n            (nodeNumber % deltaR) * 2;\n        var rt = lt + 1;\n        var lb = lt + deltaR1;\n        var rb = lb + 1;\n\n        // calculation of the scaling factor\n        var s = (bvhRefiner._vf.size).multiply(0.25);\n\n        // creation of all children\n        children.push(new QuadtreeNode3D_32bit(ctx, bvhRefiner, (level + 1), lt,\n            nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(\n                new x3dom.fields.SFVec3f(-s.x, s.y, 0.0))).mult(x3dom.fields.SFMatrix4f.scale(\n                new x3dom.fields.SFVec3f(0.5, 0.5, 1.0))), (columnNr * 2), (rowNr * 2), geometry));\n        children.push(new QuadtreeNode3D_32bit(ctx, bvhRefiner, (level + 1), rt,\n            nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(\n                new x3dom.fields.SFVec3f(s.x, s.y, 0.0))).mult(x3dom.fields.SFMatrix4f.scale(\n                new x3dom.fields.SFVec3f(0.5, 0.5, 1.0))), (columnNr * 2 + 1), (rowNr * 2), geometry));\n        children.push(new QuadtreeNode3D_32bit(ctx, bvhRefiner, (level + 1), lb,\n            nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(\n                new x3dom.fields.SFVec3f(-s.x, -s.y, 0.0))).mult(x3dom.fields.SFMatrix4f.scale(\n                new x3dom.fields.SFVec3f(0.5, 0.5, 1.0))), (columnNr * 2), (rowNr * 2 + 1), geometry));\n        children.push(new QuadtreeNode3D_32bit(ctx, bvhRefiner, (level + 1), rb,\n            nodeTransformation.mult(x3dom.fields.SFMatrix4f.translation(\n                new x3dom.fields.SFVec3f(s.x, -s.y, 0.0))).mult(x3dom.fields.SFMatrix4f.scale(\n                new x3dom.fields.SFVec3f(0.5, 0.5, 1.0))), (columnNr * 2 + 1), (rowNr * 2 + 1), geometry));\n    }\n\n\n\n    /*\n     * Decides to create new children and if the node shoud be drawn or not\n     */\n    this.collectDrawables = function (transform, drawableCollection, singlePath, invalidateCache, planeMask) {\n\n        // definition the actual transformation of the node\n        cullObject.localMatrix = nodeTransformation;\n\n        if (exists && (planeMask = drawableCollection.cull(transform, cullObject, singlePath, planeMask)) > 0) {\n            var mat_view = drawableCollection.viewMatrix;\n            var vPos = mat_view.multMatrixPnt(transform.multMatrixPnt(position));\n            var distanceToCamera = Math.sqrt(Math.pow(vPos.x, 2) + Math.pow(vPos.y, 2) + Math.pow(vPos.z, 2));\n            if ((distanceToCamera < Math.pow((bvhRefiner._vf.maxDepth - level), 2) * resizeFac / bvhRefiner._vf.factor)) {\n                if (children.length === 0 && bvhRefiner.createChildren === 0) {\n                    bvhRefiner.createChildren++;\n                    create();\n                    shape.collectDrawableObjects(nodeTransformation, drawableCollection, singlePath, invalidateCache, planeMask, []);\n                }\n                else if (children.length === 0 && bvhRefiner.createChildren > 0) {\n                    shape.collectDrawableObjects(nodeTransformation, drawableCollection, singlePath, invalidateCache, planeMask, []);\n                }\n                else {\n                    for (var i = 0; i < children.length; i++) {\n                        children[i].collectDrawables(nodeTransformation, drawableCollection, singlePath, invalidateCache, planeMask);\n                    }\n                }\n            }\n            else {\n                shape.collectDrawableObjects(nodeTransformation, drawableCollection, singlePath, invalidateCache, planeMask, []);\n            }\n        }\n    };\n\n\n    /*\n     * Returns the volume of this node\n     */\n    this.getVolume = function() {\n        // TODO; implement correctly, for now just use first shape as workaround\n        return shape.getVolume();\n    };\n\n\n    // initializes this node directly after creating\n    initialize();\n}\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### Snout ### */\nx3dom.registerNodeType(\n    \"Snout\",\n    \"Geometry3DExt\",\n    defineClass(x3dom.nodeTypes.X3DSpatialGeometryNode,\n        \n        /**\n         * Constructor for Snout\n         * @constructs x3dom.nodeTypes.Snout\n         * @x3d x.x\n         * @component Geometry3DExt\n         * @extends x3dom.nodeTypes.X3DSpatialGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc Describes a snout shape\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Snout.superClass.call(this, ctx);\n\n\n            /**\n             * Defines the diameter of the bottom surface.\n             * @var {x3dom.fields.SFFloat} dbottom\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.Snout\n             * @initvalue 1.0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'dbottom', 1.0);\n\n            /**\n             * Defines the diameter of the top surface.\n             * @var {x3dom.fields.SFFloat} dtop\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.Snout\n             * @initvalue 0.5\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'dtop', 0.5);\n\n            /**\n             * Defines the perpendicular distance between surfaces.\n             * @var {x3dom.fields.SFFloat} height\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.Snout\n             * @initvalue 1.0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'height', 1.0);\n\n            /**\n             * Defines the displacement in x direction.\n             * @var {x3dom.fields.SFFloat} xoff\n             * @memberof x3dom.nodeTypes.Snout\n             * @initvalue 0.25\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'xoff', 0.25);   // Displacement of axes along X-axis\n\n            /**\n             * Defines the displacement in y direction.\n             * @var {x3dom.fields.SFFloat} yoff\n             * @memberof x3dom.nodeTypes.Snout\n             * @initvalue 0.25\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'yoff', 0.25);   // Displacement of axes along Y-axis\n\n            /**\n             * Specifies whether the bottom exists.\n             * @var {x3dom.fields.SFBool} bottom\n             * @memberof x3dom.nodeTypes.Snout\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'bottom', true);\n\n            /**\n             * Specifies whether the bottom exists.\n             * @var {x3dom.fields.SFBool} top\n             * @memberof x3dom.nodeTypes.Snout\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'top', true);\n\n            /**\n             * Specifies the number of faces that are generated to approximate the snout.\n             * @var {x3dom.fields.SFFloat} subdivision\n             * @memberof x3dom.nodeTypes.Snout\n             * @initvalue 32\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'subdivision', 32);\n\n            this.rebuildGeometry();\n        \n        },\n        {\n            rebuildGeometry: function()\n            {\n                this._mesh._positions[0] = [];\n                this._mesh._normals[0]   = [];\n                this._mesh._texCoords[0] = [];\n                this._mesh._indices[0]   = [];\n\n                var bottomRadius = this._vf.dbottom / 2, height = this._vf.height;\n                var topRadius = this._vf.dtop / 2, sides = this._vf.subdivision;\n\n                var beta, x, z;\n                var delta = 2.0 * Math.PI / sides;\n\n                var incl = (bottomRadius - topRadius) / height;\n                var nlen = 1.0 / Math.sqrt(1.0 + incl * incl);\n\n                var j = 0, k = 0;\n                var h, base;\n\n                if (height > 0) {\n                    var px = 0, pz = 0;\n\n                    for (j = 0, k = 0; j <= sides; j++) {\n                        beta = j * delta;\n                        x = Math.sin(beta);\n                        z = -Math.cos(beta);\n\n                        px = x * topRadius + this._vf.xoff;\n                        pz = z * topRadius + this._vf.yoff;\n\n                        this._mesh._positions[0].push(px, height / 2, pz);\n                        this._mesh._normals[0].push(x / nlen, incl / nlen, z / nlen);\n                        this._mesh._texCoords[0].push(1.0 - j / sides, 1);\n\n                        this._mesh._positions[0].push(x * bottomRadius, -height / 2, z * bottomRadius);\n                        this._mesh._normals[0].push(x / nlen, incl / nlen, z / nlen);\n                        this._mesh._texCoords[0].push(1.0 - j / sides, 0);\n\n                        if (j > 0) {\n                            this._mesh._indices[0].push(k    );\n                            this._mesh._indices[0].push(k + 2);\n                            this._mesh._indices[0].push(k + 1);\n\n                            this._mesh._indices[0].push(k + 1);\n                            this._mesh._indices[0].push(k + 2);\n                            this._mesh._indices[0].push(k + 3);\n\n                            k += 2;\n                        }\n                    }\n                }\n\n                if (bottomRadius > 0 && this._vf.bottom) {\n                    base = this._mesh._positions[0].length / 3;\n\n                    for (j = sides - 1; j >= 0; j--) {\n                        beta = j * delta;\n                        x = bottomRadius * Math.sin(beta);\n                        z = -bottomRadius * Math.cos(beta);\n\n                        this._mesh._positions[0].push(x, -height / 2, z);\n                        this._mesh._normals[0].push(0, -1, 0);\n                        this._mesh._texCoords[0].push(x / bottomRadius / 2 + 0.5, z / bottomRadius / 2 + 0.5);\n                    }\n\n                    h = base + 1;\n\n                    for (j = 2; j < sides; j++) {\n                        this._mesh._indices[0].push(h);\n                        this._mesh._indices[0].push(base);\n\n                        h = base + j;\n                        this._mesh._indices[0].push(h);\n                    }\n                }\n\n                if (topRadius > x3dom.fields.Eps && this._vf.top) {\n                    base = this._mesh._positions[0].length / 3;\n\n                    for (j = sides - 1; j >= 0; j--) {\n                        beta = j * delta;\n                        x =  topRadius * Math.sin(beta);\n                        z = -topRadius * Math.cos(beta);\n\n                        this._mesh._positions[0].push(x + this._vf.xoff, height / 2, z + this._vf.yoff);\n                        this._mesh._normals[0].push(0, 1, 0);\n                        this._mesh._texCoords[0].push(x / topRadius / 2 + 0.5, 1.0 - z / topRadius / 2 + 0.5);\n                    }\n\n                    h = base + 1;\n\n                    for (j = 2; j < sides; j++) {\n                        this._mesh._indices[0].push(base);\n                        this._mesh._indices[0].push(h);\n\n                        h = base + j;\n                        this._mesh._indices[0].push(h);\n                    }\n                }\n\n                this.invalidateVolume();\n                this._mesh._numFaces = this._mesh._indices[0].length / 3;\n                this._mesh._numCoords = this._mesh._positions[0].length / 3;\n            },\n\n            fieldChanged: function (fieldName)\n            {\n                if (fieldName == \"dtop\" || fieldName == \"dbottom\" ||\n                    fieldName == \"height\" || fieldName == \"subdivision\" ||\n                    fieldName == \"xoff\" || fieldName == \"yoff\" ||\n                    fieldName == \"bottom\" || fieldName == \"top\")\n                {\n                    this.rebuildGeometry();\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node.setAllDirty();\n                        node.invalidateVolume();\n                    });\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### Dish ### */\nx3dom.registerNodeType(\n    \"Dish\",\n    \"Geometry3DExt\",\n    defineClass(x3dom.nodeTypes.X3DSpatialGeometryNode,\n        \n        /**\n         * Constructor for Dish\n         * @constructs x3dom.nodeTypes.Dish\n         * @x3d x.x\n         * @component Geometry3DExt\n         * @extends x3dom.nodeTypes.X3DSpatialGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Dish.superClass.call(this, ctx);\n\n\n            /**\n             * Specifies the diameter of the base.\n             * @var {x3dom.fields.SFFloat} diameter\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.Dish\n             * @initvalue 2\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'diameter', 2);\n\n            /**\n             * Defines the maximum height of the dished surface above the base\n             * @var {x3dom.fields.SFFloat} height\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.Dish\n             * @initvalue 1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'height', 1);\n\n            /**\n             * Defines the radius of the third semi-principal axes of the ellipsoid\n             * @var {x3dom.fields.SFFloat} radius\n             * @memberof x3dom.nodeTypes.Dish\n             * @initvalue this._vf.diameter/2\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'radius', this._vf.diameter / 2);\n\n            /**\n             * The bottom field specifies whether the bottom cap of the dish is created.\n             * @var {x3dom.fields.SFBool} bottom\n             * @memberof x3dom.nodeTypes.Dish\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'bottom', true);\n\n            /**\n             * Specifies the number of faces that are generated to approximate the sides of the dish.\n             * The first component specifies the number of rings and the second component the number of subdivisions of each ring.\n             * @var {x3dom.fields.SFVec2f} subdivision\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.Dish\n             * @initvalue 24,24\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec2f(ctx, 'subdivision', 24, 24);\n\n            this.rebuildGeometry();\n        \n        },\n        {\n            rebuildGeometry: function()\n            {\n                this._mesh._positions[0] = [];\n                this._mesh._normals[0]   = [];\n                this._mesh._texCoords[0] = [];\n                this._mesh._indices[0]   = [];\n\n                var twoPi = Math.PI * 2, halfPi = Math.PI / 2;\n                var halfDia = this._vf.diameter / 2;\n\n                // If r is 0 or half of diameter, treat as section of sphere, else half of ellipsoid\n                var r = this._vf.radius;\n                r = (r == 0 || Math.abs(halfDia - r) <= x3dom.fields.Eps) ? halfDia : r;\n\n                // height defines sectional part taken from half of ellipsoid (sphere if r==halfDia)\n                var h = Math.min(this._vf.height, r);\n                var offset = r - h;\n\n                var a = halfDia;    // 1st semi-principal axes along x\n                var b = r;          // 2nd semi-principal axes along y\n                var c = halfDia;    // 3rd semi-principal axes along z\n\n                var latitudeBands = this._vf.subdivision.x, longitudeBands = this._vf.subdivision.y;\n                var latNumber, longNumber;\n\n                var segTheta = halfPi - Math.asin(1 - h / r);\n                var segL = Math.ceil(latitudeBands / halfPi * segTheta);\n\n                var theta, sinTheta, cosTheta;\n                var phi, sinPhi, cosPhi;\n                var x, y, z, u, v;\n                var tmpPosArr = [], tmpTcArr = [];\n\n                for (latNumber = 0; latNumber <= latitudeBands; latNumber++) {\n                    if (segL == latNumber) {\n                        theta = segTheta;\n                    }\n                    else {\n                        theta = (latNumber * halfPi) / latitudeBands;\n                    }\n                    sinTheta = Math.sin(theta);\n                    cosTheta = Math.cos(theta);\n\n                    for (longNumber = 0; longNumber <= longitudeBands; longNumber++) {\n                        phi = (longNumber * twoPi) / longitudeBands;\n                        sinPhi = Math.sin(phi);\n                        cosPhi = Math.cos(phi);\n\n                        x = a * (-cosPhi * sinTheta);\n                        y = b *            cosTheta;\n                        z = c * (-sinPhi * sinTheta);\n\n                        u = 0.25 - (longNumber / longitudeBands);\n                        v = latNumber / latitudeBands;\n\n                        this._mesh._positions[0].push(x, y - offset, z);\n                        this._mesh._texCoords[0].push(u, v);\n                        this._mesh._normals[0].push(x/(a*a), y/(b*b), z/(c*c));\n\n                        if ((latNumber == latitudeBands) || (segL == latNumber)) {\n                            tmpPosArr.push(x, y - offset, z);\n                            tmpTcArr.push(u, v);\n                        }\n                    }\n\n                    if (segL == latNumber)\n                        break;\n                }\n\n                for (latNumber = 0; latNumber < latitudeBands; latNumber++) {\n                    if (segL == latNumber)\n                        break;\n\n                    for (longNumber = 0; longNumber < longitudeBands; longNumber++) {\n                        var first = (latNumber * (longitudeBands + 1)) + longNumber;\n                        var second = first + longitudeBands + 1;\n\n                        this._mesh._indices[0].push(first + 1);\n                        this._mesh._indices[0].push(second);\n                        this._mesh._indices[0].push(first);\n\n                        this._mesh._indices[0].push(first + 1);\n                        this._mesh._indices[0].push(second + 1);\n                        this._mesh._indices[0].push(second);\n                    }\n                }\n\n                if (this._vf.bottom)\n                {\n                    var origPos = this._mesh._positions[0].length / 3;\n                    var t = origPos + 1;\n\n                    for (var i=0, m=tmpPosArr.length/3; i<m; i++) {\n                        var j = 3 * i;\n                        this._mesh._positions[0].push(tmpPosArr[j  ]);\n                        this._mesh._positions[0].push(tmpPosArr[j+1]);\n                        this._mesh._positions[0].push(tmpPosArr[j+2]);\n                        j = 2 * i;\n                        this._mesh._texCoords[0].push(tmpTcArr[j  ]);\n                        this._mesh._texCoords[0].push(tmpTcArr[j+1]);\n                        this._mesh._normals[0].push(0, -1, 0);\n\n                        if (i >= 2) {\n                            this._mesh._indices[0].push(origPos);\n                            this._mesh._indices[0].push(t);\n\n                            t = origPos + i;\n                            this._mesh._indices[0].push(t);\n                        }\n                    }\n                }\n\n                this.invalidateVolume();\n                this._mesh._numFaces = this._mesh._indices[0].length / 3;\n                this._mesh._numCoords = this._mesh._positions[0].length / 3;\n            },\n\n            fieldChanged: function(fieldName)\n            {\n                if (fieldName == \"radius\" || fieldName == \"height\" || fieldName == \"diameter\" ||\n                    fieldName == \"subdivision\" || fieldName == \"bottom\")\n                {\n                    this.rebuildGeometry();\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node.setAllDirty();\n                        node.invalidateVolume();\n                    });\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### Pyramid ### */\nx3dom.registerNodeType(\n    \"Pyramid\",\n    \"Geometry3DExt\",\n    defineClass(x3dom.nodeTypes.X3DSpatialGeometryNode,\n        \n        /**\n         * Constructor for Pyramid\n         * @constructs x3dom.nodeTypes.Pyramid\n         * @x3d x.x\n         * @component Geometry3DExt\n         * @extends x3dom.nodeTypes.X3DSpatialGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc Describes a pyramid shape.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Pyramid.superClass.call(this, ctx);\n\n\n            /**\n             * Defines the bottom length in x direction.\n             * @var {x3dom.fields.SFFloat} xbottom\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.Pyramid\n             * @initvalue 1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'xbottom', 1);\n\n            /**\n             * Defines the bottom length in y direction.\n             * @var {x3dom.fields.SFFloat} ybottom\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.Pyramid\n             * @initvalue 1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'ybottom', 1);\n\n            /**\n             * Defines the top length in x direction.\n             * @var {x3dom.fields.SFFloat} xtop\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.Pyramid\n             * @initvalue 0.5\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'xtop', 0.5);\n\n            /**\n             * Defines the top length in y direction.\n             * @var {x3dom.fields.SFFloat} ytop\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.Pyramid\n             * @initvalue 0.5\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'ytop', 0.5);\n\n            /**\n             * Defines the Distance between the bottom and the top faces.\n             * @var {x3dom.fields.SFFloat} height\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.Pyramid\n             * @initvalue 1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'height', 1);\n\n            /**\n             * Defines the displacement along the x axis.\n             * @var {x3dom.fields.SFFloat} xoff\n             * @memberof x3dom.nodeTypes.Pyramid\n             * @initvalue 0.25\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'xoff', 0.25);\n\n            /**\n             * Defines the displacement along the y axis.\n             * @var {x3dom.fields.SFFloat} yoff\n             * @memberof x3dom.nodeTypes.Pyramid\n             * @initvalue 0.25\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'yoff', 0.25);\n\n            var xTop = this._vf.xtop / 2;\n            var yTop = this._vf.ytop / 2;\n            var xBot = this._vf.xbottom / 2;\n            var yBot = this._vf.ybottom / 2;\n            var xOff = this._vf.xoff;\n            var yOff = this._vf.yoff;\n            var sy = this._vf.height / 2;\n\n            this._mesh._positions[0] = [\n                -xBot,       -sy, -yBot,        -xTop + xOff, sy, -yTop + yOff,  xTop + xOff, sy, -yTop + yOff,  xBot,       -sy, -yBot,\n                -xBot,       -sy,  yBot,        -xTop + xOff, sy,  yTop + yOff,  xTop + xOff, sy,  yTop + yOff,  xBot,       -sy,  yBot,\n                -xBot,       -sy, -yBot,        -xBot,       -sy,  yBot,        -xTop + xOff, sy,  yTop + yOff, -xTop + xOff, sy, -yTop + yOff,\n                xBot,       -sy, -yBot,         xBot,       -sy,  yBot,         xTop + xOff, sy,  yTop + yOff,  xTop + xOff, sy, -yTop + yOff,\n                    -xTop + xOff, sy, -yTop + yOff, -xTop + xOff, sy,  yTop + yOff,  xTop + xOff, sy,  yTop + yOff,  xTop + xOff, sy, -yTop + yOff,\n                -xBot,       -sy, -yBot,        -xBot,       -sy,  yBot,         xBot,       -sy,  yBot,         xBot,       -sy, -yBot\n            ];\n            this._mesh._texCoords[0] = [\n                1, 0, 1, 1, 0, 1, 0, 0,\n                0, 0, 0, 1, 1, 1, 1, 0,\n                0, 0, 1, 0, 1, 1, 0, 1,\n                1, 0, 0, 0, 0, 1, 1, 1,\n                0, 1, 0, 0, 1, 0, 1, 1,\n                0, 0, 0, 1, 1, 1, 1, 0\n            ];\n            this._mesh._indices[0] = [\n                0, 1, 2, 2, 3, 0,\n                6, 5, 4, 4, 7, 6,\n                8, 9, 10, 10, 11, 8,\n                12, 15, 14, 14, 13, 12,\n                16, 17, 18, 18, 19, 16,\n                20, 23, 22, 22, 21, 20\n            ];\n\n            // attention, we share per side, therefore creaseAngle > 0\n            this._mesh.calcNormals(Math.PI, this._vf.ccw);\n\n            this._mesh._invalidate = true;\n            this._mesh._numFaces = 12;\n            this._mesh._numCoords = 24;\n        \n        },\n        {\n            fieldChanged: function(fieldName)\n            {\n                if (fieldName == \"xbottom\" || fieldName == \"ybottom\" ||\n                    fieldName == \"xtop\" || fieldName == \"ytop\" ||\n                    fieldName == \"xoff\" || fieldName == \"yoff\" || fieldName == \"height\")\n                {\n                    var xTop = this._vf.xtop / 2;\n                    var yTop = this._vf.ytop / 2;\n                    var xBot = this._vf.xbottom / 2;\n                    var yBot = this._vf.ybottom / 2;\n                    var xOff = this._vf.xoff;\n                    var yOff = this._vf.yoff;\n                    var sy = this._vf.height / 2;\n\n                    this._mesh._positions[0] = [\n                        -xBot,       -sy, -yBot,        -xTop + xOff, sy, -yTop + yOff,  xTop + xOff, sy, -yTop + yOff,  xBot,       -sy, -yBot,\n                        -xBot,       -sy,  yBot,        -xTop + xOff, sy,  yTop + yOff,  xTop + xOff, sy,  yTop + yOff,  xBot,       -sy,  yBot,\n                        -xBot,       -sy, -yBot,        -xBot,       -sy,  yBot,        -xTop + xOff, sy,  yTop + yOff, -xTop + xOff, sy, -yTop + yOff,\n                        xBot,       -sy, -yBot,         xBot,       -sy,  yBot,         xTop + xOff, sy,  yTop + yOff,  xTop + xOff, sy, -yTop + yOff,\n                            -xTop + xOff, sy, -yTop + yOff, -xTop + xOff, sy,  yTop + yOff,  xTop + xOff, sy,  yTop + yOff,  xTop + xOff, sy, -yTop + yOff,\n                        -xBot,       -sy, -yBot,        -xBot,       -sy,  yBot,         xBot,       -sy,  yBot,         xBot,       -sy, -yBot\n                    ];\n\n                    this._mesh._normals[0] = [];\n                    this._mesh.calcNormals(Math.PI, this._vf.ccw);\n\n                    this.invalidateVolume();\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node.setAllDirty();\n                        node.invalidateVolume();\n                    });\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### RectangularTorus ### */\nx3dom.registerNodeType(\n    \"RectangularTorus\",\n    \"Geometry3DExt\",\n    defineClass(x3dom.nodeTypes.X3DSpatialGeometryNode,\n        \n        /**\n         * Constructor for RectangularTorus\n         * @constructs x3dom.nodeTypes.RectangularTorus\n         * @x3d x.x\n         * @component Geometry3DExt\n         * @extends x3dom.nodeTypes.X3DSpatialGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc Describes a rectangular torus shape.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.RectangularTorus.superClass.call(this, ctx);\n\n\n            /**\n             * Defines the inner radius of the torus.\n             * @var {x3dom.fields.SFFloat} innerRadius\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.RectangularTorus\n             * @initvalue 0.5\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'innerRadius', 0.5); //Inside radius\n\n            /**\n             * Defines the outer radius of the torus.\n             * @var {x3dom.fields.SFFloat} outerRadius\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.RectangularTorus\n             * @initvalue 1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'outerRadius', 1);\t//Outside radius\n\n            /**\n             * Defines the height of the torus.\n             * @var {x3dom.fields.SFFloat} height\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.RectangularTorus\n             * @initvalue 1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'height', 1);\t    //Height of rectangular section\n\n            /**\n             * Defines the length of the torus as angle. 2 * PI is a full torus.\n             * @var {x3dom.fields.SFFloat} angle\n             * @range [0, 2*pi]\n             * @memberof x3dom.nodeTypes.RectangularTorus\n             * @initvalue 2*Math.PI\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'angle', 2 * Math.PI);\t//Subtended angle\n\n            /**\n             * Specifies whether the side caps exist.\n             * @var {x3dom.fields.SFBool} caps\n             * @memberof x3dom.nodeTypes.RectangularTorus\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'caps', true);        //Show side caps\n\n            /**\n             * Specifies the number of rings that are generated to approximate the torus.\n             * @var {x3dom.fields.SFFloat} subdivision\n             * @memberof x3dom.nodeTypes.RectangularTorus\n             * @initvalue 32\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'subdivision', 32);\n\n            this._origCCW = this._vf.ccw;\n\n            this.rebuildGeometry();\n        \n        },\n        {\n            rebuildGeometry: function()\n            {\n                this._mesh._positions[0] = [];\n                this._mesh._normals[0]   = [];\n                this._mesh._texCoords[0] = [];\n                this._mesh._indices[0]   = [];\n\n                var twoPi = 2.0 * Math.PI;\n\n                this._vf.ccw = !this._origCCW;\n\n                // assure that angle in [0, 2 * PI]\n                if (this._vf.angle < 0)\n                    this._vf.angle = 0;\n                else if (this._vf.angle > twoPi)\n                    this._vf.angle = twoPi;\n\n                // assure that innerRadius < outerRadius\n                if (this._vf.innerRadius > this._vf.outerRadius)\n                {\n                    var tmp = this._vf.innerRadius;\n                    this._vf.innerRadius = this._vf.outerRadius;\n                    this._vf.outerRadius = tmp;\n                }\n\n                var innerRadius = this._vf.innerRadius;\n                var outerRadius = this._vf.outerRadius;\n                var height = this._vf.height / 2;\n                var angle = this._vf.angle;\n                var sides = this._vf.subdivision;\n\n                var beta, x, z, k, j, nx, nz;\n                var delta = angle / sides;\n\n                //Outer Side\n                for (j=0, k=0; j<=sides; j++)\n                {\n                    beta = j * delta;\n                    nx =  Math.cos(beta);\n                    nz = -Math.sin(beta);\n\n                    x = outerRadius * nx;\n                    z = outerRadius * nz;\n\n                    this._mesh._positions[0].push(x, -height, z);\n                    this._mesh._normals[0].push(nx, 0, nz);\n\n                    this._mesh._positions[0].push(x, height, z);\n                    this._mesh._normals[0].push(nx, 0, nz);\n\n                    if (j > 0)\n                    {\n                        this._mesh._indices[0].push(k    );\n                        this._mesh._indices[0].push(k + 1);\n                        this._mesh._indices[0].push(k + 2);\n\n                        this._mesh._indices[0].push(k + 2);\n                        this._mesh._indices[0].push(k + 1);\n                        this._mesh._indices[0].push(k + 3);\n\n                        k += 2;\n                    }\n                }\n\n                //Inner Side\n                for (j=0, k=k+2; j<=sides; j++)\n                {\n                    beta = j * delta;\n                    nx =  Math.cos(beta);\n                    nz = -Math.sin(beta);\n\n                    x = innerRadius * nx;\n                    z = innerRadius * nz;\n\n                    this._mesh._positions[0].push(x, -height, z);\n                    this._mesh._normals[0].push(-nx, 0, -nz);\n\n                    this._mesh._positions[0].push(x, height, z);\n                    this._mesh._normals[0].push(-nx, 0, -nz);\n\n                    if (j > 0)\n                    {\n                        this._mesh._indices[0].push(k + 2);\n                        this._mesh._indices[0].push(k + 1);\n                        this._mesh._indices[0].push(k    );\n\n                        this._mesh._indices[0].push(k + 3);\n                        this._mesh._indices[0].push(k + 1);\n                        this._mesh._indices[0].push(k + 2);\n\n                        k += 2;\n                    }\n                }\n\n                //Top Side\n                for (j=0, k=k+2; j<=sides; j++)\n                {\n                    beta = j * delta;\n                    nx =  Math.cos(beta);\n                    nz = -Math.sin(beta);\n\n                    x = outerRadius * nx;\n                    z = outerRadius * nz;\n\n                    this._mesh._positions[0].push(x, height, z);\n                    this._mesh._normals[0].push(0, 1, 0);\n\n                    x = innerRadius * nx;\n                    z = innerRadius * nz;\n\n                    this._mesh._positions[0].push(x, height, z);\n                    this._mesh._normals[0].push(0, 1, 0);\n\n                    if (j > 0)\n                    {\n                        this._mesh._indices[0].push(k    );\n                        this._mesh._indices[0].push(k + 1);\n                        this._mesh._indices[0].push(k + 2);\n\n                        this._mesh._indices[0].push(k + 2);\n                        this._mesh._indices[0].push(k + 1);\n                        this._mesh._indices[0].push(k + 3);\n\n                        k += 2;\n                    }\n                }\n\n                //Bottom Side\n                for (j=0, k=k+2; j<=sides; j++)\n                {\n                    beta = j * delta;\n                    nx =  Math.cos(beta);\n                    nz = -Math.sin(beta);\n\n                    x = outerRadius * nx;\n                    z = outerRadius * nz;\n\n                    this._mesh._positions[0].push(x, -height, z);\n                    this._mesh._normals[0].push(0, -1, 0);\n\n                    x = innerRadius * nx;\n                    z = innerRadius * nz;\n\n                    this._mesh._positions[0].push(x, -height, z);\n                    this._mesh._normals[0].push(0, -1, 0);\n\n                    if (j > 0)\n                    {\n                        this._mesh._indices[0].push(k + 2);\n                        this._mesh._indices[0].push(k + 1);\n                        this._mesh._indices[0].push(k    );\n\n                        this._mesh._indices[0].push(k + 3);\n                        this._mesh._indices[0].push(k + 1);\n                        this._mesh._indices[0].push(k + 2);\n\n                        k += 2;\n                    }\n                }\n\n                //Create Caps\n                if (angle < twoPi && this._vf.caps == true)\n                {\n                    //First Cap\n                    k += 2;\n\n                    x = outerRadius;\n                    z = 0;\n\n                    this._mesh._positions[0].push(x, height, z);\n                    this._mesh._normals[0].push(0, 0, 1);\n                    this._mesh._positions[0].push(x, -height, z);\n                    this._mesh._normals[0].push(0, 0, 1);\n\n                    x = innerRadius;\n                    z = 0;\n\n                    this._mesh._positions[0].push(x, height, z);\n                    this._mesh._normals[0].push(0, 0, 1);\n                    this._mesh._positions[0].push(x, -height, z);\n                    this._mesh._normals[0].push(0, 0, 1);\n\n                    this._mesh._indices[0].push(k    );\n                    this._mesh._indices[0].push(k + 1);\n                    this._mesh._indices[0].push(k + 2);\n\n                    this._mesh._indices[0].push(k + 2);\n                    this._mesh._indices[0].push(k + 1);\n                    this._mesh._indices[0].push(k + 3);\n\n                    //Second Cap\n                    k+=4;\n\n                    nx =  Math.cos(angle);\n                    nz = -Math.sin(angle);\n\n                    x = outerRadius * nx;\n                    z = outerRadius * nz;\n\n                    this._mesh._positions[0].push(x, height, z);\n                    this._mesh._normals[0].push(nz, 0, -nx);\n                    this._mesh._positions[0].push(x, -height, z);\n                    this._mesh._normals[0].push(nz, 0, -nx);\n\n                    x = innerRadius * nx;\n                    z = innerRadius * nz;\n\n                    this._mesh._positions[0].push(x, height, z);\n                    this._mesh._normals[0].push(nz, 0, -nx);\n                    this._mesh._positions[0].push(x, -height, z);\n                    this._mesh._normals[0].push(nz, 0, -nx);\n\n                    this._mesh._indices[0].push(k + 2);\n                    this._mesh._indices[0].push(k + 1);\n                    this._mesh._indices[0].push(k    );\n\n                    this._mesh._indices[0].push(k + 3);\n                    this._mesh._indices[0].push(k + 1);\n                    this._mesh._indices[0].push(k + 2);\n                }\n\n                this.invalidateVolume();\n                this._mesh._numFaces = this._mesh._indices[0].length / 3;\n                this._mesh._numCoords = this._mesh._positions[0].length / 3;\n            },\n\n            fieldChanged: function(fieldName)\n            {\n                if (fieldName == \"innerRadius\" || fieldName == \"outerRadius\" ||\n                    fieldName == \"height\" || fieldName == \"angle\" ||\n                    fieldName == \"subdivision\" || fieldName == \"caps\")\n                {\n                    this.rebuildGeometry();\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node.setAllDirty();\n                        node.invalidateVolume();\n                    });\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### SlopedCylinder ### */\nx3dom.registerNodeType(\n    \"SlopedCylinder\",\n    \"Geometry3DExt\",\n    defineClass(x3dom.nodeTypes.X3DSpatialGeometryNode,\n        \n        /**\n         * Constructor for SlopedCylinder\n         * @constructs x3dom.nodeTypes.SlopedCylinder\n         * @x3d x.x\n         * @component Geometry3DExt\n         * @extends x3dom.nodeTypes.X3DSpatialGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc Describes a sloped cylinder shape\n         */\n        function (ctx) {\n            x3dom.nodeTypes.SlopedCylinder.superClass.call(this, ctx);\n\n\n            /**\n             * Defines the radius of the sloped cylinder.\n             * @var {x3dom.fields.SFFloat} radius\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.SlopedCylinder\n             * @initvalue 1.0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'radius', 1.0);\n\n            /**\n             * Defines the height of the sloped cylinder\n             * @var {x3dom.fields.SFFloat} height\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.SlopedCylinder\n             * @initvalue 2.0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'height', 2.0);\n\n            /**\n             * Defines whether the bottom exists.\n             * @var {x3dom.fields.SFBool} bottom\n             * @memberof x3dom.nodeTypes.SlopedCylinder\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'bottom', true);\n\n            /**\n             * Defines whether the top exists.\n             * @var {x3dom.fields.SFBool} top\n             * @memberof x3dom.nodeTypes.SlopedCylinder\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'top', true);\n\n            /**\n             * Defines the shear for the top in x direction.\n             * @var {x3dom.fields.SFFloat} xtshear\n             * @memberof x3dom.nodeTypes.SlopedCylinder\n             * @initvalue 0.26179\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'xtshear', 0.26179);\n\n            /**\n             * Defines the shear for the top in y direction.\n             * @var {x3dom.fields.SFFloat} ytshear\n             * @memberof x3dom.nodeTypes.SlopedCylinder\n             * @initvalue 0.0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'ytshear', 0.0);\n\n            /**\n             * Defines the shear for the bottom in x direction.\n             * @var {x3dom.fields.SFFloat} xbshear\n             * @memberof x3dom.nodeTypes.SlopedCylinder\n             * @initvalue 0.26179\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'xbshear', 0.26179);\n\n            /**\n             * Defines the shear for the bottom in y direction.\n             * @var {x3dom.fields.SFFloat} ybshear\n             * @memberof x3dom.nodeTypes.SlopedCylinder\n             * @initvalue 0.0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'ybshear', 0.0);\n\n            /**\n             * Specifies the number of faces that are generated to approximate the cylinder.\n             * @var {x3dom.fields.SFFloat} subdivision\n             * @memberof x3dom.nodeTypes.SlopedCylinder\n             * @initvalue 32\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'subdivision', 32);\n\n            this.rebuildGeometry();\n        \n        },\n        {\n            rebuildGeometry: function()\n            {\n                this._mesh._positions[0] = [];\n                this._mesh._normals[0]   = [];\n                this._mesh._texCoords[0] = [];\n                this._mesh._indices[0]   = [];\n\n                var topSlopeX = this._vf.xtshear;\n                var topSlopeY = this._vf.ytshear;\n                var botSlopeX = this._vf.xbshear;\n                var botSlopeY = this._vf.ybshear;\n                var sides = this._vf.subdivision;\n\n                var radius = this._vf.radius;\n                var height = this._vf.height / 2;\n\n                var delta = 2.0 * Math.PI / sides;\n                var beta, x, y, z;\n                var j, k;\n\n                for (j=0, k=0; j<=sides; j++)\n                {\n                    beta = j * delta;\n                    x =  Math.sin(beta);\n                    z = -Math.cos(beta);\n\n                    this._mesh._positions[0].push(x * radius, -height + x * botSlopeX + z * botSlopeY, z * radius);\n                    this._mesh._texCoords[0].push(1.0 - j / sides, 0);\n\n                    this._mesh._positions[0].push(x * radius,  height + x * topSlopeX + z * topSlopeY, z * radius);\n                    this._mesh._texCoords[0].push(1.0 - j / sides, 1);\n\n                    if (j > 0)\n                    {\n                        this._mesh._indices[0].push(k    );\n                        this._mesh._indices[0].push(k + 1);\n                        this._mesh._indices[0].push(k + 2);\n\n                        this._mesh._indices[0].push(k + 2);\n                        this._mesh._indices[0].push(k + 1);\n                        this._mesh._indices[0].push(k + 3);\n\n                        k += 2;\n                    }\n                }\n\n                var h, base;\n\n                if (this._vf.top && radius > 0)\n                {\n                    base = this._mesh._positions[0].length / 3;\n\n                    for (j=sides-1; j>=0; j--)\n                    {\n                        k = 6 * j;\n                        x = this._mesh._positions[0][k+3];\n                        y = this._mesh._positions[0][k+4];\n                        z = this._mesh._positions[0][k+5];\n\n                        this._mesh._positions[0].push(x, y, z);\n                        this._mesh._texCoords[0].push(x / 2 + 0.5, -z / 2 + 0.5);\n                    }\n\n                    h = base + 1;\n\n                    for (j=2; j<sides; j++)\n                    {\n                        this._mesh._indices[0].push(base);\n                        this._mesh._indices[0].push(h);\n\n                        h = base + j;\n                        this._mesh._indices[0].push(h);\n                    }\n                }\n\n                if (this._vf.bottom && radius > 0)\n                {\n                    base = this._mesh._positions[0].length / 3;\n\n                    for (j=sides-1; j>=0; j--)\n                    {\n                        k = 6 * j;\n                        x = this._mesh._positions[0][k  ];\n                        y = this._mesh._positions[0][k+1];\n                        z = this._mesh._positions[0][k+2];\n\n                        this._mesh._positions[0].push(x, y, z);\n                        this._mesh._texCoords[0].push(x / 2 + 0.5, z / 2 + 0.5);\n                    }\n\n                    h = base + 1;\n\n                    for (j=2; j<sides; j++)\n                    {\n                        this._mesh._indices[0].push(h);\n                        this._mesh._indices[0].push(base);\n\n                        h = base + j;\n                        this._mesh._indices[0].push(h);\n                    }\n                }\n\n                // calculate normals and adjust them at seam\n                this._mesh.calcNormals(Math.PI, this._vf.ccw);\n\n                var n0b = new x3dom.fields.SFVec3f(this._mesh._normals[0][0],\n                    this._mesh._normals[0][1],\n                    this._mesh._normals[0][2]);\n                var n0t = new x3dom.fields.SFVec3f(this._mesh._normals[0][3],\n                    this._mesh._normals[0][4],\n                    this._mesh._normals[0][5]);\n                k = 6 * sides;\n                var n1b = new x3dom.fields.SFVec3f(this._mesh._normals[0][k  ],\n                    this._mesh._normals[0][k+1],\n                    this._mesh._normals[0][k+2]);\n                var n1t = new x3dom.fields.SFVec3f(this._mesh._normals[0][k+3],\n                    this._mesh._normals[0][k+4],\n                    this._mesh._normals[0][k+5]);\n\n                var nb = n0b.add(n1b).normalize();\n                var nt = n0t.add(n1t).normalize();\n\n                this._mesh._normals[0][0] = nb.x;\n                this._mesh._normals[0][1] = nb.y;\n                this._mesh._normals[0][2] = nb.z;\n                this._mesh._normals[0][3] = nt.x;\n                this._mesh._normals[0][4] = nt.y;\n                this._mesh._normals[0][5] = nt.z;\n\n                this._mesh._normals[0][k  ] = nb.x;\n                this._mesh._normals[0][k+1] = nb.y;\n                this._mesh._normals[0][k+2] = nb.z;\n                this._mesh._normals[0][k+3] = nt.x;\n                this._mesh._normals[0][k+4] = nt.y;\n                this._mesh._normals[0][k+5] = nt.z;\n\n                this.invalidateVolume();\n                this._mesh._numFaces = this._mesh._indices[0].length / 3;\n                this._mesh._numCoords = this._mesh._positions[0].length / 3;\n            },\n\n            fieldChanged: function(fieldName)\n            {\n                if (fieldName == \"xtshear\" || fieldName == \"ytshear\" ||\n                    fieldName == \"xbshear\" || fieldName == \"ybshear\" ||\n                    fieldName == \"radius\" || fieldName == \"height\" ||\n                    fieldName == \"bottom\" || fieldName == \"top\" || fieldName == \"subdivision\")\n                {\n                    this.rebuildGeometry();\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node.setAllDirty();\n                        node.invalidateVolume();\n                    });\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### Nozzle ### */\nx3dom.registerNodeType(\n    \"Nozzle\",\n    \"Geometry3DExt\",\n    defineClass(x3dom.nodeTypes.X3DSpatialGeometryNode,\n        \n        /**\n         * Constructor for Nozzle\n         * @constructs x3dom.nodeTypes.Nozzle\n         * @x3d x.x\n         * @component Geometry3DExt\n         * @extends x3dom.nodeTypes.X3DSpatialGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc This node describes a nozzle shape for a pipe.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Nozzle.superClass.call(this, ctx);\n\n\n            /**\n             * Defines the height of the nozzle.\n             * @var {x3dom.fields.SFFloat} nozzleHeight\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.Nozzle\n             * @initvalue 0.1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'nozzleHeight', 0.1);\n\n            /**\n             * Defines the radius of the nozzle.\n             * @var {x3dom.fields.SFFloat} nozzleRadius\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.Nozzle\n             * @initvalue 0.6\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'nozzleRadius', 0.6);\n\n            /**\n             * Defines the height of the pipe.\n             * @var {x3dom.fields.SFFloat} height\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.Nozzle\n             * @initvalue 1.0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'height', 1.0);\n\n            /**\n             * Defines the outer radius of the pipe.\n             * @var {x3dom.fields.SFFloat} outerRadius\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.Nozzle\n             * @initvalue 0.5\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'outerRadius', 0.5);\n\n            /**\n             * Defines the inner radius of the pipe.\n             * @var {x3dom.fields.SFFloat} innerRadius\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.Nozzle\n             * @initvalue 0.4\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'innerRadius', 0.4);\n\n            /**\n             * Specifies the number of faces that are generated to approximate the sides of the pipe and nozzle.\n             * @var {x3dom.fields.SFFloat} subdivision\n             * @range [2, inf]\n             * @memberof x3dom.nodeTypes.Nozzle\n             * @initvalue 32\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'subdivision', 32);\n\n            this.rebuildGeometry();\n        \n        },\n        {\n            rebuildGeometry: function()\n            {\n                this._mesh._positions[0] = [];\n                this._mesh._normals[0]   = [];\n                this._mesh._texCoords[0] = [];\n                this._mesh._indices[0]   = [];\n\n                var twoPi = 2.0 * Math.PI;\n                var sides = this._vf.subdivision;\n\n                var height = this._vf.height;\n                var center = height / 2;\n\n                if (this._vf.innerRadius > this._vf.outerRadius)\n                {\n                    var tmp = this._vf.innerRadius;\n                    this._vf.innerRadius = this._vf.outerRadius;\n                    this._vf.outerRadius = tmp;\n                }\n                var innerRadius = this._vf.innerRadius;\n                var outerRadius = this._vf.outerRadius;\n\n                if (this._vf.nozzleRadius < outerRadius)\n                {\n                    this._vf.nozzleRadius = outerRadius;\n                }\n                var nozzleRadius = this._vf.nozzleRadius;\n\n                if (this._vf.nozzleHeight > height)\n                {\n                    this._vf.nozzleHeight = height;\n                }\n                var nozzleHeight = this._vf.nozzleHeight;\n\n                var beta, delta, x, z, k, j, nx, nz;\n                delta = twoPi / sides;\n\n                //Outer Stem Side\n                for (j=0, k=0; j<=sides; j++)\n                {\n                    beta = j * delta;\n                    nx =  Math.sin(beta);\n                    nz = -Math.cos(beta);\n\n                    x = outerRadius * nx;\n                    z = outerRadius * nz;\n\n                    this._mesh._positions[0].push(x, -center, z);\n                    this._mesh._normals[0].push(nx, 0, nz);\n\n                    this._mesh._positions[0].push(x, (height-nozzleHeight)-center, z);\n                    this._mesh._normals[0].push(nx, 0, nz);\n\n                    if (j > 0)\n                    {\n                        this._mesh._indices[0].push(k    );\n                        this._mesh._indices[0].push(k + 1);\n                        this._mesh._indices[0].push(k + 2);\n\n                        this._mesh._indices[0].push(k + 2);\n                        this._mesh._indices[0].push(k + 1);\n                        this._mesh._indices[0].push(k + 3);\n\n                        k += 2;\n                    }\n                }\n\n                //Inner Stem Side\n                for (j=0, k=k+2; j<=sides; j++)\n                {\n                    beta = j * delta;\n                    nx =  Math.sin(beta);\n                    nz = -Math.cos(beta);\n\n                    x = innerRadius * nx;\n                    z = innerRadius * nz;\n\n                    this._mesh._positions[0].push(x, -center, z);\n                    this._mesh._normals[0].push(-nx, 0, -nz);\n\n                    this._mesh._positions[0].push(x, (height-nozzleHeight)-center, z);\n                    this._mesh._normals[0].push(-nx, 0, -nz);\n\n                    if (j > 0)\n                    {\n                        this._mesh._indices[0].push(k + 2);\n                        this._mesh._indices[0].push(k + 1);\n                        this._mesh._indices[0].push(k    );\n\n                        this._mesh._indices[0].push(k + 3);\n                        this._mesh._indices[0].push(k + 1);\n                        this._mesh._indices[0].push(k + 2);\n\n                        k += 2;\n                    }\n                }\n\n                //Stem Bottom Side\n                for (j=0, k=k+2; j<=sides; j++)\n                {\n                    beta = j * delta;\n                    nx =  Math.sin(beta);\n                    nz = -Math.cos(beta);\n\n                    x = outerRadius * nx;\n                    z = outerRadius * nz;\n\n                    this._mesh._positions[0].push(x, -center, z);\n                    this._mesh._normals[0].push(0, -1, 0);\n\n                    x = innerRadius * nx;\n                    z = innerRadius * nz;\n\n                    this._mesh._positions[0].push(x, -center, z);\n                    this._mesh._normals[0].push(0, -1, 0);\n\n                    if (j > 0)\n                    {\n                        this._mesh._indices[0].push(k + 2);\n                        this._mesh._indices[0].push(k + 1);\n                        this._mesh._indices[0].push(k    );\n\n                        this._mesh._indices[0].push(k + 3);\n                        this._mesh._indices[0].push(k + 1);\n                        this._mesh._indices[0].push(k + 2);\n\n                        k += 2;\n                    }\n                }\n\n                //Outer Nozzle Side\n                for (j=0, k=k+2; j<=sides; j++)\n                {\n                    beta = j * delta;\n                    nx =  Math.sin(beta);\n                    nz = -Math.cos(beta);\n\n                    x = nozzleRadius * nx;\n                    z = nozzleRadius * nz;\n\n                    this._mesh._positions[0].push(x, (height-nozzleHeight)-center, z);\n                    this._mesh._normals[0].push(nx, 0, nz);\n\n                    this._mesh._positions[0].push(x, center, z);\n                    this._mesh._normals[0].push(nx, 0, nz);\n\n                    if (j > 0)\n                    {\n                        this._mesh._indices[0].push(k    );\n                        this._mesh._indices[0].push(k + 1);\n                        this._mesh._indices[0].push(k + 2);\n\n                        this._mesh._indices[0].push(k + 2);\n                        this._mesh._indices[0].push(k + 1);\n                        this._mesh._indices[0].push(k + 3);\n\n                        k += 2;\n                    }\n                }\n\n                //Inner Nozzle Side\n                for (j=0, k=k+2; j<=sides; j++)\n                {\n                    beta = j * delta;\n                    nx =  Math.sin(beta);\n                    nz = -Math.cos(beta);\n\n                    x = innerRadius * nx;\n                    z = innerRadius * nz;\n\n                    this._mesh._positions[0].push(x, (height-nozzleHeight)-center, z);\n                    this._mesh._normals[0].push(-nx, 0, -nz);\n\n                    this._mesh._positions[0].push(x, center, z);\n                    this._mesh._normals[0].push(-nx, 0, -nz);\n\n                    if (j > 0)\n                    {\n                        this._mesh._indices[0].push(k + 2);\n                        this._mesh._indices[0].push(k + 1);\n                        this._mesh._indices[0].push(k    );\n\n                        this._mesh._indices[0].push(k + 3);\n                        this._mesh._indices[0].push(k + 1);\n                        this._mesh._indices[0].push(k + 2);\n\n                        k += 2;\n                    }\n                }\n\n                //Nozzle Bottom Side\n                for (j=0, k=k+2; j<=sides; j++)\n                {\n                    beta = j * delta;\n                    nx =  Math.sin(beta);\n                    nz = -Math.cos(beta);\n\n                    x = nozzleRadius * nx;\n                    z = nozzleRadius * nz;\n\n                    this._mesh._positions[0].push(x, (height-nozzleHeight)-center, z);\n                    this._mesh._normals[0].push(0, -1, 0);\n\n                    x = outerRadius * nx;\n                    z = outerRadius * nz;\n\n                    this._mesh._positions[0].push(x, (height-nozzleHeight)-center, z);\n                    this._mesh._normals[0].push(0, -1, 0);\n\n                    if (j > 0)\n                    {\n                        this._mesh._indices[0].push(k + 2);\n                        this._mesh._indices[0].push(k + 1);\n                        this._mesh._indices[0].push(k    );\n\n                        this._mesh._indices[0].push(k + 3);\n                        this._mesh._indices[0].push(k + 1);\n                        this._mesh._indices[0].push(k + 2);\n\n                        k += 2;\n                    }\n                }\n\n                //Nozzle Top Side\n                for (j=0, k=k+2; j<=sides; j++)\n                {\n                    beta = j * delta;\n                    nx =  Math.sin(beta);\n                    nz = -Math.cos(beta);\n\n                    x = nozzleRadius * nx;\n                    z = nozzleRadius * nz;\n\n                    this._mesh._positions[0].push(x, center, z);\n                    this._mesh._normals[0].push(0, 1, 0);\n\n                    x = innerRadius * nx;\n                    z = innerRadius * nz;\n\n                    this._mesh._positions[0].push(x, center, z);\n                    this._mesh._normals[0].push(0, 1, 0);\n\n                    if (j > 0)\n                    {\n                        this._mesh._indices[0].push(k    );\n                        this._mesh._indices[0].push(k + 1);\n                        this._mesh._indices[0].push(k + 2);\n\n                        this._mesh._indices[0].push(k + 2);\n                        this._mesh._indices[0].push(k + 1);\n                        this._mesh._indices[0].push(k + 3);\n\n                        k += 2;\n                    }\n                }\n\n                this.invalidateVolume();\n                this._mesh._numFaces = this._mesh._indices[0].length / 3;\n                this._mesh._numCoords = this._mesh._positions[0].length / 3;\n            },\n\n            fieldChanged: function(fieldName)\n            {\n                if (fieldName == \"nozzleHeight\" || fieldName == \"nozzleRadius\" || fieldName == \"height\" ||\n                    fieldName == \"outerRadius\" || fieldName == \"innerRadius\" || fieldName == \"subdivision\")\n                {\n                    this.rebuildGeometry();\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node.setAllDirty();\n                        node.invalidateVolume();\n                    });\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### SolidOfRevolution ### */\nx3dom.registerNodeType(\n    \"SolidOfRevolution\",\n    \"Geometry3DExt\",\n    defineClass(x3dom.nodeTypes.X3DGeometryNode,\n        \n        /**\n         * Constructor for SolidOfRevolution\n         * @constructs x3dom.nodeTypes.SolidOfRevolution\n         * @x3d x.x\n         * @component Geometry3DExt\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc Describes a SolidOfRevolution shape.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.SolidOfRevolution.superClass.call(this, ctx);\n\n\n            /**\n             * The creaseAngle field affects how default normals are generated.\n             * If the angle between the geometric normals of two adjacent faces is less than the crease angle, normals shall be calculated so that the faces are shaded smoothly across the edge; otherwise, normals shall be calculated so that a lighting discontinuity across the edge is produced.\n             * Crease angles shall be greater than or equal to 0.0 angle base units.\n             * @var {x3dom.fields.SFFloat} creaseAngle\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.SolidOfRevolution\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'creaseAngle', 0);\n\n            /**\n             * Defines the cross section that is swept around the axis. The cross section is described as an array of 2D vertices.\n             * @var {x3dom.fields.MFVec2f} crossSection\n             * @memberof x3dom.nodeTypes.SolidOfRevolution\n             * @initvalue []\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFVec2f(ctx, 'crossSection', []);\n\n            /**\n             * The subtended angle through which the 2D loop is swept around the x axis.\n             * @var {x3dom.fields.SFFloat} angle\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.SolidOfRevolution\n             * @initvalue 2*Math.PI\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'angle', 2*Math.PI);\n\n            /**\n             *Specifies whether the caps exist.\n             * @var {x3dom.fields.SFBool} caps\n             * @memberof x3dom.nodeTypes.SolidOfRevolution\n             * @initvalue true\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'caps', true);\n\n            /**\n             * Specifies the number of steps that are generated to approximate the shape.\n             * @var {x3dom.fields.SFFloat} subdivision\n             * @memberof x3dom.nodeTypes.SolidOfRevolution\n             * @initvalue 32\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'subdivision', 32);\n\n            this._origCCW = this._vf.ccw;\n\n            this.rebuildGeometry();\n        \n        },\n        {\n            rebuildGeometry: function()\n            {\n                this._mesh._positions[0] = [];\n                this._mesh._normals[0]   = [];\n                this._mesh._texCoords[0] = [];\n                this._mesh._indices[0]   = [];\n\n                // assure that angle in [-2.Pi, 2.PI]\n                var twoPi = 2.0 * Math.PI;\n                if (this._vf.angle < -twoPi)\n                    this._vf.angle = -twoPi;\n                else if (this._vf.angle > twoPi)\n                    this._vf.angle = twoPi;\n\n                var crossSection = this._vf.crossSection, angle = this._vf.angle, steps = this._vf.subdivision;\n                var i, j, k, l, m, n = crossSection.length;\n\n                if (n < 1) {\n                    x3dom.debug.logWarning(\"SolidOfRevolution requires crossSection curve.\");\n                    return;\n                }\n\n                var loop = (n > 2) ? crossSection[0].equals(crossSection[n-1], x3dom.fields.Eps) : false;\n                var fullRevolution = (twoPi - Math.abs(angle) <= x3dom.fields.Eps);\n\n                var alpha, delta = angle / steps;\n                var positions = [], baseCurve = [];\n\n                // fix wrong face orientation in case of clockwise rotation\n                this._vf.ccw = (angle < 0) ? this._origCCW : !this._origCCW;\n\n                // check if side caps are required\n                if (!loop)\n                {\n                    if (Math.abs(crossSection[n-1].y) > x3dom.fields.Eps) {\n                        crossSection.push(new x3dom.fields.SFVec2f(crossSection[n-1].x, 0));\n                    }\n                    if (Math.abs(crossSection[0].y) > x3dom.fields.Eps) {\n                        crossSection.unshift(new x3dom.fields.SFVec2f(crossSection[0].x, 0));\n                    }\n                    n = crossSection.length;\n                }\n\n                // check curvature, starting from 2nd segment, and adjust base curve\n                var pos = null, lastPos = null, penultimatePos = null;\n                var duplicate = [];    // to be able to sort out duplicates for caps\n\n                for (j=0; j<n; j++)\n                {\n                    if (pos) {\n                        if (lastPos) {\n                            penultimatePos = lastPos;\n                        }\n                        lastPos = pos;\n                    }\n\n                    pos = new x3dom.fields.SFVec3f(crossSection[j].x, 0, crossSection[j].y);\n\n                    if (j >= 2)\n                    {\n                        alpha = pos.subtract(lastPos).normalize();\n                        alpha = alpha.dot(lastPos.subtract(penultimatePos).normalize());\n                        alpha = Math.abs(Math.cos(alpha));\n\n                        if (alpha > this._vf.creaseAngle)\n                        {\n                            baseCurve.push(x3dom.fields.SFVec3f.copy(lastPos));\n                            duplicate.push(true);\n                        }\n                        // TODO; handle case that curve is loop and angle smaller creaseAngle\n                    }\n\n                    baseCurve.push(pos);\n                    duplicate.push(false);\n                }\n\n                n = baseCurve.length;\n\n                // generate body of revolution (with rotation around x-axis)\n                for (i=0, alpha=0; i<=steps; i++, alpha+=delta)\n                {\n                    var mat = x3dom.fields.SFMatrix4f.rotationX(alpha);\n\n                    for (j=0; j<n; j++)\n                    {\n                        pos = mat.multMatrixPnt(baseCurve[j]);\n                        positions.push(pos);\n\n                        this._mesh._positions[0].push(pos.x, pos.y, pos.z);\n\n                        if (i > 0 && j > 0)\n                        {\n                            this._mesh._indices[0].push((i-1)*n+(j-1), (i-1)*n+ j   ,  i   *n+ j   );\n                            this._mesh._indices[0].push( i   *n+ j   ,  i   *n+(j-1), (i-1)*n+(j-1));\n                        }\n                    }\n                }\n\n                if (!fullRevolution && this._vf.caps == true)\n                {\n                    // add first cap\n                    var linklist = new x3dom.DoublyLinkedList();\n                    m = this._mesh._positions[0].length / 3;\n\n                    for (j=0, i=0; j<n; j++)\n                    {\n                        if (!duplicate[j])\n                        {\n                            // Tessellation leads to errors with duplicated vertices if polygon not convex\n                            linklist.appendNode(new x3dom.DoublyLinkedList.ListNode(positions[j], i++));\n\n                            pos = positions[j];\n                            this._mesh._positions[0].push(pos.x, pos.y, pos.z);\n                        }\n                    }\n\n                    var linklist_indices = x3dom.EarClipping.getIndexes(linklist);\n\n                    for (j=linklist_indices.length-1; j>=0; j--)\n                    {\n                        this._mesh._indices[0].push(m + linklist_indices[j]);\n                    }\n\n                    // second cap\n                    m = this._mesh._positions[0].length / 3;\n\n                    for (j=0; j<n; j++)\n                    {\n                        if (!duplicate[j])\n                        {\n                            pos = positions[n * steps + j];\n                            this._mesh._positions[0].push(pos.x, pos.y, pos.z);\n                        }\n                    }\n\n                    for (j=0; j<linklist_indices.length; j++)\n                    {\n                        this._mesh._indices[0].push(m + linklist_indices[j]);\n                    }\n                }\n\n                // calculate and readjust normals if full revolution\n                this._mesh.calcNormals(Math.PI, this._vf.ccw);\n\n                if (fullRevolution)\n                {\n                    m = 3 * n * steps;\n\n                    for (j=0; j<n; j++)\n                    {\n                        k = 3 * j;\n                        this._mesh._normals[0][m+k  ] = this._mesh._normals[0][k  ];\n                        this._mesh._normals[0][m+k+1] = this._mesh._normals[0][k+1];\n                        this._mesh._normals[0][m+k+2] = this._mesh._normals[0][k+2];\n                    }\n                }\n\n                this._mesh.calcTexCoords(\"\");\n\n                this.invalidateVolume();\n                this._mesh._numFaces = this._mesh._indices[0].length / 3;\n                this._mesh._numCoords = this._mesh._positions[0].length / 3;\n            },\n\n            fieldChanged: function(fieldName)\n            {\n                if (fieldName == \"crossSection\" || fieldName == \"angle\" || fieldName == \"caps\" ||\n                    fieldName == \"subdivision\" || fieldName == \"creaseAngle\")\n                {\n                    this.rebuildGeometry();\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node.setAllDirty();\n                        node.invalidateVolume();\n                    });\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### SphereSegment ### */\nx3dom.registerNodeType(\n    \"SphereSegment\",\n    \"Geometry3DExt\",\n    defineClass(x3dom.nodeTypes.X3DSpatialGeometryNode,\n        \n        /**\n         * Constructor for SphereSegment\n         * @constructs x3dom.nodeTypes.SphereSegment\n         * @x3d x.x\n         * @component Geometry3DExt\n         * @extends x3dom.nodeTypes.X3DSpatialGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc Describes a sphere segment shape.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.SphereSegment.superClass.call(this, ctx);\n\n\n            /**\n             * Defines the radius of the sphere.\n             * @var {x3dom.fields.SFFloat} radius\n             * @memberof x3dom.nodeTypes.SphereSegment\n             * @initvalue 1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'radius', 1);\n\n            /**\n             * Defines an array of longitude values.\n             * @var {x3dom.fields.MFFloat} longitude\n             * @memberof x3dom.nodeTypes.SphereSegment\n             * @initvalue []\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFFloat(ctx, 'longitude', []);\n\n            /**\n             * Defines an array of latitude values.\n             * @var {x3dom.fields.MFFloat} latitude\n             * @memberof x3dom.nodeTypes.SphereSegment\n             * @initvalue []\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFFloat(ctx, 'latitude', []);\n\n            /**\n             * Defines an array of stepSizes.\n             * @var {x3dom.fields.SFVec2f} stepSize\n             * @memberof x3dom.nodeTypes.SphereSegment\n             * @initvalue 1,1\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFVec2f(ctx, 'stepSize', 1, 1);\n\n            var r = this._vf.radius;\n            var longs = this._vf.longitude;\n            var lats = this._vf.latitude;\n\n            var subx = longs.length, suby = lats.length;\n            var first, second;\n\n            var latNumber, longNumber;\n            var latitudeBands = suby;\n            var longitudeBands = subx;\n\n            var theta, sinTheta, cosTheta;\n            var phi, sinPhi, cosPhi;\n            var x, y, z, u, v;\n\n            for (latNumber = 0; latNumber <= latitudeBands; latNumber++) {\n                theta = ((lats[latNumber]+90) * Math.PI) / 180;\n                sinTheta = Math.sin(theta);\n                cosTheta = Math.cos(theta);\n\n                for (longNumber = 0; longNumber <= longitudeBands; longNumber++) {\n                    phi = ((longs[longNumber]) * Math.PI) / 180;\n\n                    sinPhi = Math.sin(phi);\n                    cosPhi = Math.cos(phi);\n\n                    x = -cosPhi * sinTheta;\n                    y = -cosTheta;\n                    z = -sinPhi * sinTheta;\n\n                    u = longNumber / (longitudeBands-1);\n                    v = latNumber / (latitudeBands-1);\n\n                    this._mesh._positions[0].push(r * x, r * y, r * z);\n                    this._mesh._normals[0].push(x, y, z);\n                    this._mesh._texCoords[0].push(u, v);\n                }\n            }\n\n            for (latNumber = 0; latNumber < latitudeBands; latNumber++) {\n                for (longNumber = 0; longNumber < longitudeBands; longNumber++) {\n                    first = (latNumber * (longitudeBands + 1)) + longNumber;\n                    second = first + longitudeBands + 1;\n\n                    this._mesh._indices[0].push(first);\n                    this._mesh._indices[0].push(second);\n                    this._mesh._indices[0].push(first + 1);\n\n                    this._mesh._indices[0].push(second);\n                    this._mesh._indices[0].push(second + 1);\n                    this._mesh._indices[0].push(first + 1);\n                }\n            }\n\n            this._mesh._invalidate = true;\n            this._mesh._numFaces = this._mesh._indices[0].length / 3;\n            this._mesh._numCoords = this._mesh._positions[0].length / 3;\n        \n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n *\n */\n\n /* Added support for changes of the \"color\" field\n  * (C) 2014 Toshiba Corporation\n  * Dual licensed under the MIT and GPL\n  */\n\n/* ### ElevationGrid ### */\nx3dom.registerNodeType(\n    \"ElevationGrid\",\n    \"Geometry3DExt\",\n    defineClass(x3dom.nodeTypes.X3DGeometryNode,\n\n        /**\n         * Constructor for ElevationGrid\n         * @constructs x3dom.nodeTypes.ElevationGrid\n         * @x3d 3.3\n         * @component Geometry3DExt\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The ElevationGrid node specifies a uniform rectangular grid of varying height in the Y=0 plane of the local coordinate system.\n         * The geometry is described by a scalar array of height values that specify the height of a surface above each point of the grid.\n         * The xDimension and zDimension fields indicate the number of elements of the grid height array in the X and Z directions.\n         * Both xDimension and zDimension shall be greater than or equal to zero.\n         * If either the xDimension or the zDimension is less than two, the ElevationGrid contains no quadrilaterals.\n         * The vertex locations for the rectangles are defined by the height field and the xSpacing and zSpacing fields\n         */\n        function (ctx) {\n            x3dom.nodeTypes.ElevationGrid.superClass.call(this, ctx);\n\n\n            /**\n             * The colorPerVertex field determines whether colours specified in the color field are applied to each vertex or each quadrilateral of the ElevationGrid node.\n             * If colorPerVertex is FALSE and the color field is not NULL, the color field shall specify a node derived from X3DColorNode containing at least (xDimension-1)×(zDimension-1) colours; one for each quadrilateral.\n             * If colorPerVertex is TRUE and the color field is not NULL, the color field shall specify a node derived from X3DColorNode containing at least xDimension × zDimension colours, one for each vertex.\n             * @var {x3dom.fields.SFBool} colorPerVertex\n             * @memberof x3dom.nodeTypes.ElevationGrid\n             * @initvalue true\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'colorPerVertex', true);\n\n            /**\n             * The normalPerVertex field determines whether normals are applied to each vertex or each quadrilateral of the ElevationGrid node depending on the value of normalPerVertex.\n             * If normalPerVertex is FALSE and the normal node is not NULL, the normal field shall specify a node derived from X3DNormalNode containing at least (xDimension−1)×(zDimension−1) normals; one for each quadrilateral.\n             * If normalPerVertex is TRUE and the normal field is not NULL, the normal field shall specify a node derived from X3DNormalNode containing at least xDimension × zDimension normals; one for each vertex.\n             * @var {x3dom.fields.SFBool} normalPerVertex\n             * @memberof x3dom.nodeTypes.ElevationGrid\n             * @initvalue true\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'normalPerVertex', true);\n\n            /**\n             * The creaseAngle field affects how default normals are generated.\n             * If the angle between the geometric normals of two adjacent faces is less than the crease angle, normals shall be calculated so that the faces are shaded smoothly across the edge; otherwise, normals shall be calculated so that a lighting discontinuity across the edge is produced.\n             * Crease angles shall be greater than or equal to 0.0 angle base units.\n             * @var {x3dom.fields.SFFloat} creaseAngle\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.ElevationGrid\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'creaseAngle', 0);\n\n\n            /**\n             *\n             * @var {x3dom.fields.MFNode} attrib\n             * @memberof x3dom.nodeTypes.ElevationGrid\n             * @initvalue x3dom.nodeTypes.X3DVertexAttributeNode\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFNode('attrib', x3dom.nodeTypes.X3DVertexAttributeNode);\n\n            /**\n             * The normal field specifies per-vertex or per-quadrilateral normals for the ElevationGrid node.\n             * If the normal field is NULL, the browser shall automatically generate normals, using the creaseAngle field to determine if and how normals are smoothed across the surface.\n             * @var {x3dom.fields.SFNode} normal\n             * @memberof x3dom.nodeTypes.ElevationGrid\n             * @initvalue x3dom.nodeTypes.Normal\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFNode('normal', x3dom.nodeTypes.Normal);\n\n            /**\n             * The color field specifies per-vertex or per-quadrilateral colours for the ElevationGrid node depending on the value of colorPerVertex.\n             * If the color field is NULL, the ElevationGrid node is rendered with the overall attributes of the Shape node enclosing the ElevationGrid node.\n             * @var {x3dom.fields.SFNode} color\n             * @memberof x3dom.nodeTypes.ElevationGrid\n             * @initvalue x3dom.nodeTypes.X3DColorNode\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFNode('color', x3dom.nodeTypes.X3DColorNode);\n\n            /**\n             * The texCoord field specifies per-vertex texture coordinates for the ElevationGrid node. If texCoord is NULL, default texture coordinates are applied to the geometry.\n             * @var {x3dom.fields.SFNode} texCoord\n             * @memberof x3dom.nodeTypes.ElevationGrid\n             * @initvalue x3dom.nodeTypes.X3DTextureCoordinateNode\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFNode('texCoord', x3dom.nodeTypes.X3DTextureCoordinateNode);\n\n\n            /**\n             * The height field is an xDimension by zDimension array of scalar values representing the height above the grid for each vertex.\n             * @var {x3dom.fields.MFFloat} height\n             * @memberof x3dom.nodeTypes.ElevationGrid\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFFloat(ctx, 'height', []);\n\n            /**\n             * Defines the grid size in x.\n             * @var {x3dom.fields.SFInt32} xDimension\n             * @range [0, inf]\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'xDimension', 0);\n\n            /**\n             * @var {x3dom.fields.SFDouble} xSpacing\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.ElevationGrid\n             * @initvalue 1.0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'xSpacing', 1.0);\n\n            /**\n             * Defines the grid size in z.\n             * @var {x3dom.fields.SFInt32} zDimension\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.ElevationGrid\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'zDimension', 0);\n\n            /**\n             * @var {x3dom.fields.SFDouble} zSpacing\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.ElevationGrid\n             * @initvalue 1.0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'zSpacing', 1.0);\n\n        },\n        {\n            nodeChanged: function()\n            {\n                this._mesh._indices[0] = [];\n                this._mesh._positions[0] = [];\n                this._mesh._normals[0] = [];\n                this._mesh._texCoords[0] = [];\n                this._mesh._colors[0] = [];\n\n                var x = 0, y = 0;\n                var subx = this._vf.xDimension-1;\n                var suby = this._vf.zDimension-1;\n\n                var h = this._vf.height;\n\n                x3dom.debug.assert((h.length >= this._vf.xDimension*this._vf.zDimension),\n                    \"Too few height values for given x/zDimension!\");\n\n                var normals = null, texCoords = null, colors = null;\n\n                if (this._cf.normal.node) {\n                    normals = this._cf.normal.node._vf.vector;\n                }\n\n                var numTexComponents = 2;\n                var texMode;\n                \n                var texCoordNode = this._cf.texCoord.node;\n                if (x3dom.isa(texCoordNode, x3dom.nodeTypes.MultiTextureCoordinate)) {\n                    if (texCoordNode._cf.texCoord.nodes.length)\n                        texCoordNode = texCoordNode._cf.texCoord.nodes[0];\n                }\n\n                if (texCoordNode) {\n                    if (texCoordNode._vf.point) {\n                        texCoords = texCoordNode._vf.point;\n                        if (x3dom.isa(texCoordNode, x3dom.nodeTypes.TextureCoordinate3D)) {\n                            numTexComponents = 3;\n                        }\n                    }\n                    \n                    else if (texCoordNode._vf.mode) {\n                        texMode = texCoordNode._vf.mode;\n                    }\n                }\n\n                var numColComponents = 3;\n                if (this._cf.color.node) {\n                    colors = this._cf.color.node._vf.color;\n                    if (x3dom.isa(this._cf.color.node, x3dom.nodeTypes.ColorRGBA)) {\n                        numColComponents = 4;\n                    }\n                }\n\n                var c = 0;\n                var faceCnt = 0;\n\n                for (y = 0; y <= suby; y++)\n                {\n                    for (x = 0; x <= subx; x++)\n                    {\n                        this._mesh._positions[0].push(x * this._vf.xSpacing);\n                        this._mesh._positions[0].push(h[c]);\n                        this._mesh._positions[0].push(y * this._vf.zSpacing);\n\n                        if (normals) {\n                            if(this._vf.normalPerVertex) {\n                                this._mesh._normals[0].push(normals[c].x);\n                                this._mesh._normals[0].push(normals[c].y);\n                                this._mesh._normals[0].push(normals[c].z);\n                            }\n                        }\n\n                        if (texCoords) {\n                            this._mesh._texCoords[0].push(texCoords[c].x);\n                            this._mesh._texCoords[0].push(texCoords[c].y);\n                            if (numTexComponents === 3) {\n                                this._mesh._texCoords[0].push(texCoords[c].z);\n                            }\n                        }\n                        \n                        else {\n                            this._mesh._texCoords[0].push(x / subx);\n                            this._mesh._texCoords[0].push(y / suby);\n                        }\n\n                        if (colors) {\n                            if(this._vf.colorPerVertex) {\n                                this._mesh._colors[0].push(colors[c].r);\n                                this._mesh._colors[0].push(colors[c].g);\n                                this._mesh._colors[0].push(colors[c].b);\n                                if (numColComponents === 4) {\n                                    this._mesh._colors[0].push(colors[c].a);\n                                }\n                            }\n                        }\n\n                        c++;\n                    }\n                }\n                \n                for (y = 1; y <= suby; y++) {\n                    for (x = 0; x < subx; x++) {\n                        this._mesh._indices[0].push((y - 1) * (subx + 1) + x);\n                        this._mesh._indices[0].push(y * (subx + 1) + x);\n                        this._mesh._indices[0].push((y - 1) * (subx + 1) + x + 1);\n\n                        this._mesh._indices[0].push(y * (subx + 1) + x);\n                        this._mesh._indices[0].push(y * (subx + 1) + x + 1);\n                        this._mesh._indices[0].push((y - 1) * (subx + 1) + x + 1);\n                    }\n                }\n\n                // TODO; handle at least per quad normals\n                //       (corresponds to creaseAngle = 0)\n                //this._mesh.calcNormals(this._vf.creaseAngle, this._vf.ccw);\n                if (!normals)\n                    this._mesh.calcNormals(Math.PI, this._vf.ccw);\n\n                if (texMode) {this._mesh.calcTexCoords(texMode);}\n                \n                this.invalidateVolume();\n                this._mesh._numTexComponents = numTexComponents;\n                this._mesh._numColComponents = numColComponents;\n                this._mesh._numFaces = this._mesh._indices[0].length / 3;\n                this._mesh._numCoords = this._mesh._positions[0].length / 3;\n            },\n\n            fieldChanged: function(fieldName)\n            {\n                var i, n;\n                var normals = null;\n\n                if (this._cf.normal.node) {\n                    normals = this._cf.normal.node._vf.vector;\n                }\n\n                if (fieldName == \"height\")\n                {\n                    n = this._mesh._positions[0].length / 3;\n                    var h = this._vf.height;\n\n                    for (i=0; i<n; i++) {\n                        this._mesh._positions[0][3*i+1] = h[i];\n                    }\n\n                    if (!normals) {\n                        this._mesh._normals[0] = [];\n                        this._mesh.calcNormals(Math.PI, this._vf.ccw);\n                    }\n\n                    this.invalidateVolume();\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.positions = true;\n                        if (!normals)\n                            node._dirty.normals = true;\n                        node.invalidateVolume();\n                    });\n                }\n                else if (fieldName == \"xSpacing\" || fieldName == \"zSpacing\")\n                {\n                    for (var y = 0; y < this._vf.zDimension; y++) {\n                        for (var x = 0; x < this._vf.xDimension; x++) {\n                            var j = 3 * (y * this._vf.xDimension + x);\n                            this._mesh._positions[0][j  ] = x * this._vf.xSpacing;\n                            this._mesh._positions[0][j+2] = y * this._vf.zSpacing;\n                        }\n                    }\n\n                    if (!normals) {\n                        this._mesh._normals[0] = [];\n                        this._mesh.calcNormals(Math.PI, this._vf.ccw);\n                    }\n\n                    this.invalidateVolume();\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.positions = true;\n                        if (!normals)\n                            node._dirty.normals = true;\n                        node.invalidateVolume();\n                    });\n                }\n                else if (fieldName == \"xDimension\" || fieldName == \"zDimension\")\n                {\n                    this.nodeChanged();     // re-init whole geo, changed too much\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node.setGeoDirty();\n                        node.invalidateVolume();\n                    });\n                }\n                else if (fieldName == \"color\")\n                {\n                    // TODO; FIXME: this code assumes that size has not change and color node exists.\n                    n = this._mesh._colors[0].length / 3; // 3 stands for RGB. RGBA not supported yet.\n                    var c = this._cf.color.node._vf.color;\n\n                    for (i=0; i<n; i++) {\n                        this._mesh._colors[0][i*3]   = c[i].r;\n                        this._mesh._colors[0][i*3+1] = c[i].g;\n                        this._mesh._colors[0][i*3+2] = c[i].b;\n                    }\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node._dirty.colors = true;\n                    });\n                }\n                // TODO: handle other cases!\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n/* ### Extrusion ### */\nx3dom.registerNodeType(\n    \"Extrusion\",\n    \"Geometry3DExt\",\n    defineClass(x3dom.nodeTypes.X3DGeometryNode,\n        \n        /**\n         * Constructor for Extrusion\n         * @constructs x3dom.nodeTypes.Extrusion\n         * @x3d 3.3\n         * @component Geometry3DExt\n         * @status full\n         * @extends x3dom.nodeTypes.X3DGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The Extrusion node specifies geometric shapes based on a two dimensional cross-section extruded along a three dimensional spine in the local coordinate system. The cross-section can be scaled and rotated at each spine point to produce a wide variety of shapes.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.Extrusion.superClass.call(this, ctx);\n\n\n            /**\n             * Specifies whether the beginCap should exist.\n             * @var {x3dom.fields.SFBool} beginCap\n             * @memberof x3dom.nodeTypes.Extrusion\n             * @initvalue true\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'beginCap', true);\n\n            /**\n             * Specifies whether the endCap should exist.\n             * @var {x3dom.fields.SFBool} endCap\n             * @memberof x3dom.nodeTypes.Extrusion\n             * @initvalue true\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'endCap', true);\n\n            /**\n             * The convex field indicates whether all polygons in the shape are convex.\n             * @var {x3dom.fields.SFBool} convex\n             * @memberof x3dom.nodeTypes.Extrusion\n             * @initvalue true\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'convex', true);\n\n            /**\n             * The creaseAngle field affects how default normals are generated.\n             * If the angle between the geometric normals of two adjacent faces is less than the crease angle, normals shall be calculated so that the faces are shaded smoothly across the edge; otherwise, normals shall be calculated so that a lighting discontinuity across the edge is produced.\n             * Crease angles shall be greater than or equal to 0.0 angle base units.\n             * @var {x3dom.fields.SFFloat} creaseAngle\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.Extrusion\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'creaseAngle', 0);\n\n            /**\n             * Describes the cross section as a 2D piecewise linear curve (series of connected vertices).\n             * @var {x3dom.fields.MFVec2f} crossSection\n             * @memberof x3dom.nodeTypes.Extrusion\n             * @initvalue [(1,1), (1, -1), (-1, -1), (-1, 1), (1, 1)]\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFVec2f(ctx, 'crossSection', [\n                new x3dom.fields.SFVec2f(1, 1),\n                new x3dom.fields.SFVec2f(1, -1),\n                new x3dom.fields.SFVec2f(-1, -1),\n                new x3dom.fields.SFVec2f(-1, 1),\n                new x3dom.fields.SFVec2f(1, 1)\n            ]);\n\n            /**\n             * Defines an array of orientations for each extrusion step.\n             * @var {x3dom.fields.MFRotation} orientation\n             * @memberof x3dom.nodeTypes.Extrusion\n             * @initvalue [(0,0,0,1)]\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFRotation(ctx, 'orientation', [ new x3dom.fields.Quaternion(0, 0, 0, 1) ]);\n\n            /**\n             * Defines an array of 2D scale values for each extrusion step.\n             * @var {x3dom.fields.MFVec2f} scale\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.Extrusion\n             * @initvalue [(1,1)]\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFVec2f(ctx, 'scale', [ new x3dom.fields.SFVec2f(1, 1) ]);\n\n            /**\n             * Describes the spine as a 3D piecewise linear curve (series of conntected vertices).\n             * @var {x3dom.fields.MFVec3f} spine\n             * @memberof x3dom.nodeTypes.Extrusion\n             * @initvalue [(0,0,0)]\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFVec3f(ctx, 'spine', [ new x3dom.fields.SFVec3f(0, 0, 0),\n                new x3dom.fields.SFVec3f(0, 1, 0)\n            ]);\n\n            /**\n             * Convenience field for setting default spine.\n             * @var {x3dom.fields.SFFloat} height\n             * @range [0, inf]\n             * @memberof x3dom.nodeTypes.Extrusion\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'height', 0);\n\n            // http://www.web3d.org/files/specifications/19775-1/V3.3/Part01/components/geometry3D.html#Extrusion\n            // http://accad.osu.edu/~pgerstma/class/vnv/resources/info/AnnotatedVrmlRef/ch3-318.htm\n            this.rebuildGeometry();\n        \n        },\n        {\n            rebuildGeometry: function()\n            {\n                this._mesh._positions[0] = [];\n                this._mesh._normals[0]   = [];\n                this._mesh._texCoords[0] = [];\n                this._mesh._indices[0]   = [];\n\n                var i, j, n, m, len, sx = 1, sy = 1;\n                var spine = this._vf.spine,\n                    scale = this._vf.scale,\n                    orientation = this._vf.orientation,\n                    crossSection = this._vf.crossSection;\n                var positions = [], index = 0;\n\n                m = spine.length;\n                n = crossSection.length;\n\n                if (/*m == 0 &&*/ this._vf.height > 0) {\n                    spine[0] = new x3dom.fields.SFVec3f(0, 0, 0);\n                    spine[1] = new x3dom.fields.SFVec3f(0, this._vf.height, 0);\n                    m = 2;\n                }\n\n                var x, y, z;\n                var last_z = new x3dom.fields.SFVec3f(0, 0, 1);\n\n                if (m > 2) {\n                    for (i = 1; i < m - 1; i++) {\n                        var last_z_candidate = spine[i + 1].subtract(spine[i]).cross(spine[i - 1].subtract(spine[i]));\n                        if (last_z_candidate.length() > x3dom.fields.Eps) {\n                            last_z = x3dom.fields.SFVec3f.copy(last_z_candidate.normalize());\n                            break;\n                        }\n                    }\n                }\n\n                var texCoordV = 0;\n                var texCoordsV = [ 0 ];\n\n                for (i=1; i<m; i++) {\n                    var v = spine[i].subtract(spine[i-1]).length();\n                    texCoordV = texCoordV + v;\n                    texCoordsV[i] = texCoordV;\n                }\n\n                var texCoordU = 0;\n                var texCoordsU = [ 0 ];\n\n                var maxTexU_x = 0, minTexU_x = 0;\n                var maxTexU_z = 0, minTexU_z = 0;\n\n                for (j=1; j<n; j++) {\n                    var u = crossSection[j].subtract(crossSection[j-1]).length();\n                    texCoordU = texCoordU + u;\n                    texCoordsU[j] = texCoordU;\n\n                    if (j==1) {\n                        maxTexU_x = minTexU_x = crossSection[j-1].x;\n                        maxTexU_z = minTexU_z = crossSection[j-1].y;\n                    }\n\n                    if (maxTexU_x < crossSection[j].x) {\n                        maxTexU_x = crossSection[j].x;\n                    }\n                    if (minTexU_x > crossSection[j].x) {\n                        minTexU_x = crossSection[j].x;\n                    }\n                    if (maxTexU_z < crossSection[j].y) {\n                        maxTexU_z = crossSection[j].y;\n                    }\n                    if (minTexU_z > crossSection[j].y) {\n                        minTexU_z = crossSection[j].y;\n                    }\n                }\n\n                if (Math.abs(maxTexU_x - minTexU_x) < Math.abs(maxTexU_z - minTexU_z)) {\n                    var helpMax = maxTexU_x;\n                    var helpMin = minTexU_x;\n                    maxTexU_x = maxTexU_z;\n                    minTexU_x = minTexU_z;\n                    maxTexU_z = helpMax;\n                    minTexU_z = helpMin;\n                }\n\n                var diffTexU_x = Math.abs(maxTexU_x - minTexU_x);\n                var diffTexU_z = Math.abs(maxTexU_z - minTexU_z);\n\n                var spineClosed = (m > 2) ? spine[0].equals(spine[spine.length-1], x3dom.fields.Eps) : false;\n\n                for (i=0; i<m; i++) {\n                    if ((len = scale.length) > 0) {\n                        if (i < len) {\n                            sx = scale[i].x;\n                            sy = scale[i].y;\n                        }\n                        else {\n                            sx = scale[len-1].x;\n                            sy = scale[len-1].y;\n                        }\n                    }\n\n                    for (j=0; j<n; j++) {\n                        var pos = new x3dom.fields.SFVec3f(\n                                crossSection[j].x * sx + spine[i].x,\n                            spine[i].y,\n                                crossSection[j].y * sy + spine[i].z);\n\n                        if (m > 2) {\n                            if (i == 0) {\n                                if (spineClosed) {\n                                    y = spine[1].subtract(spine[m-2]);\n                                    z = spine[1].subtract(spine[0]).cross(spine[m-2].subtract(spine[0]));\n                                }\n                                else {\n                                    y = spine[1].subtract(spine[0]);\n                                    z = spine[2].subtract(spine[1]).cross(spine[0].subtract(spine[1]));\n                                }\n                                if (z.length() > x3dom.fields.Eps) {\n                                    last_z = x3dom.fields.SFVec3f.copy(z);\n                                }\n                            }\n                            else if (i == m-1) {\n                                if (spineClosed) {\n                                    y = spine[1].subtract(spine[m-2]);\n                                    z = spine[1].subtract(spine[0]).cross(spine[m-2].subtract(spine[0]));\n                                }\n                                else {\n                                    y = spine[m-1].subtract(spine[m-2]);\n                                    z = x3dom.fields.SFVec3f.copy(last_z);\n                                }\n                            }\n                            else {\n                                y = spine[i+1].subtract(spine[i-1]);\n                                z = y.cross(spine[i-1].subtract(spine[i]));\n                            }\n                            if (z.dot(last_z) < 0) {\n                                z = z.negate();\n                            }\n\n                            y = y.normalize();\n                            z = z.normalize();\n\n                            if (z.length() <= x3dom.fields.Eps)\t{\n                                z = x3dom.fields.SFVec3f.copy(last_z);\n                            }\n\n                            if (i != 0) {\n                                last_z = x3dom.fields.SFVec3f.copy(z);\n                            }\n                            x = y.cross(z).normalize();\n\n                            var baseMat = x3dom.fields.SFMatrix4f.identity();\n                            baseMat.setValue(x, y, z);\n                            var rotMat = (i < orientation.length) ? orientation[i].toMatrix() :\n                                ( (orientation.length > 0) ? orientation[orientation.length-1].toMatrix() :\n                                    x3dom.fields.SFMatrix4f.identity() );\n\n                            pos = pos.subtract(spine[i]);\n                            pos = baseMat.multMatrixPnt(rotMat.multMatrixPnt(pos));\n                            pos = pos.add(spine[i]);\n                        }\n                        pos.crossSection = crossSection[j];\n                        positions.push(pos);\n\n                        if (this._vf.creaseAngle <= x3dom.fields.Eps) {\n                            if (i > 0 && j > 0) {\n                                var iPos = (i-1)*n+(j-1);\n                                this._mesh._positions[0].push(positions[iPos].x, positions[iPos].y, positions[iPos].z);\n                                this._mesh._texCoords[0].push(texCoordsU[j-1]/texCoordU, texCoordsV[i-1]/texCoordV);\n                                iPos = (i-1)*n+j;\n                                this._mesh._positions[0].push(positions[iPos].x, positions[iPos].y, positions[iPos].z);\n                                this._mesh._texCoords[0].push(texCoordsU[j]/texCoordU, texCoordsV[i-1]/texCoordV);\n                                iPos = i*n+j;\n                                this._mesh._positions[0].push(positions[iPos].x, positions[iPos].y, positions[iPos].z);\n                                this._mesh._texCoords[0].push(texCoordsU[j]/texCoordU, texCoordsV[i]/texCoordV);\n\n                                this._mesh._indices[0].push(index++, index++, index++);\n\n                                this._mesh._positions[0].push(positions[iPos].x, positions[iPos].y, positions[iPos].z);\n                                this._mesh._texCoords[0].push(texCoordsU[j]/texCoordU, texCoordsV[i]/texCoordV);\n                                iPos = i*n+(j-1);\n                                this._mesh._positions[0].push(positions[iPos].x, positions[iPos].y, positions[iPos].z);\n                                this._mesh._texCoords[0].push(texCoordsU[j-1]/texCoordU, texCoordsV[i]/texCoordV);\n                                iPos = (i-1)*n+(j-1);\n                                this._mesh._positions[0].push(positions[iPos].x, positions[iPos].y, positions[iPos].z);\n                                this._mesh._texCoords[0].push(texCoordsU[j-1]/texCoordU, texCoordsV[i-1]/texCoordV);\n\n                                this._mesh._indices[0].push(index++, index++, index++);\n                            }\n                        }\n                        else {\n                            this._mesh._positions[0].push(pos.x, pos.y, pos.z);\n                            this._mesh._texCoords[0].push(texCoordsU[j]/texCoordU, texCoordsV[i]/texCoordV);\n\n                            if (i > 0 && j > 0) {\n                                this._mesh._indices[0].push((i-1)*n+(j-1), (i-1)*n+ j   ,  i   *n+ j   );\n                                this._mesh._indices[0].push( i   *n+ j   ,  i   *n+(j-1), (i-1)*n+(j-1));\n                            }\n                        }\n                    }\n\n                    if (i == m-1) {\n                        var p0, l, startPos;\n                        var linklist, linklist_indices;\n\n                        // add bottom (1st cross-section)\n                        if (this._vf.beginCap) {\n                            linklist = new x3dom.DoublyLinkedList();\n                            l = this._mesh._positions[0].length / 3;\n\n                            for (j=0; j<n; j++) {\n                                linklist.appendNode(new x3dom.DoublyLinkedList.ListNode(positions[j], j));\n\n                                if (this._vf.creaseAngle > x3dom.fields.Eps) {\n                                    p0 = positions[j];\n                                    this._mesh._positions[0].push(p0.x, p0.y, p0.z);\n                                    this._mesh._texCoords[0].push((p0.crossSection.x - minTexU_x)/diffTexU_x,\n                                            (p0.crossSection.y - minTexU_z)/diffTexU_z);\n\n                                }\n                            }\n                            if(this._vf.ccw == false)\n                                linklist.invert();\n\n                            linklist_indices = x3dom.EarClipping.getIndexes(linklist);\n\n                            for (j=linklist_indices.length-1; j>=0; j--) {\n                                if (this._vf.creaseAngle > x3dom.fields.Eps) {\n                                    this._mesh._indices[0].push(l + linklist_indices[j]);\n                                }\n                                else {\n                                    p0 = positions[linklist_indices[j]];\n                                    this._mesh._positions[0].push(p0.x, p0.y, p0.z);\n                                    this._mesh._texCoords[0].push((p0.crossSection.x - minTexU_x)/diffTexU_x,\n                                            (p0.crossSection.y - minTexU_z)/diffTexU_z);\n                                    this._mesh._indices[0].push(index++);\n                                }\n                            }\n                        }\n\n                        // add top (last cross-section)\n                        if (this._vf.endCap) {\n                            linklist = new x3dom.DoublyLinkedList();\n                            startPos = (m - 1) * n;\n                            l = this._mesh._positions[0].length / 3;\n\n                            for (j=0; j<n; j++) {\n                                linklist.appendNode(new x3dom.DoublyLinkedList.ListNode(positions[startPos+j], startPos+j));\n\n                                if (this._vf.creaseAngle > x3dom.fields.Eps) {\n                                    p0 = positions[startPos+j];\n                                    this._mesh._positions[0].push(p0.x, p0.y, p0.z);\n                                    this._mesh._texCoords[0].push((p0.crossSection.x - minTexU_x)/diffTexU_x,\n                                            (p0.crossSection.y - minTexU_z)/diffTexU_z);\n                                }\n                            }\n\n                            if(this._vf.ccw == false)\n                                linklist.invert();\n\n                            linklist_indices = x3dom.EarClipping.getIndexes(linklist);\n\n                            for (j=0; j<linklist_indices.length; j++) {\n                                if (this._vf.creaseAngle > x3dom.fields.Eps) {\n                                    this._mesh._indices[0].push(l + (linklist_indices[j] - startPos));\n                                }\n                                else {\n                                    p0 = positions[linklist_indices[j]];\n                                    this._mesh._positions[0].push(p0.x, p0.y, p0.z);\n                                    this._mesh._texCoords[0].push((p0.crossSection.x - minTexU_x)/diffTexU_x,\n                                            (p0.crossSection.y - minTexU_z)/diffTexU_z);\n                                    this._mesh._indices[0].push(index++);\n                                }\n                            }\n                        }\n                    }\n                }\n\n                this._mesh.calcNormals(this._vf.creaseAngle, this._vf.ccw);\n\n                this.invalidateVolume();\n                this._mesh._numFaces = this._mesh._indices[0].length / 3;\n                this._mesh._numCoords = this._mesh._positions[0].length / 3;\n            },\n\n            fieldChanged: function(fieldName)\n            {\n                if (fieldName == \"beginCap\" || fieldName == \"endCap\" ||\n                    fieldName == \"crossSection\" || fieldName == \"orientation\" ||\n                    fieldName == \"scale\" || fieldName == \"spine\" ||\n                    fieldName == \"height\" || fieldName == \"creaseAngle\")\n                {\n                    this.rebuildGeometry();\n\n                    Array.forEach(this._parentNodes, function (node) {\n                        node.setAllDirty();\n                        node.invalidateVolume();\n                    });\n                }\n            }\n        }\n    )\n);\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### HAnimDisplacer ###\nx3dom.registerNodeType(\n    \"HAnimDisplacer\",\n    \"H-Anim\",\n    defineClass(x3dom.nodeTypes.X3DGeometricPropertyNode,\n        \n        /**\n         * Constructor for HAnimDisplacer\n         * @constructs x3dom.nodeTypes.HAnimDisplacer\n         * @x3d 3.3\n         * @component H-Anim\n         * @status full\n         * @extends x3dom.nodeTypes.X3DGeometricPropertyNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc In some cases, the application may need to be able to identify specific groups of vertices within an HAnimSegment.\n         * It may also require \"hints\" as to the direction in which each vertex should move. That information is stored in a node called an HAnimDisplacer.\n         * The HAnimDisplacers for a particular HAnimSegment are stored in the displacers field of that HAnimSegment.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.HAnimDisplacer.superClass.call(this, ctx);\n\n\n            /**\n             *\n             * @var {x3dom.fields.SFString} name\n             * @memberof x3dom.nodeTypes.HAnimDisplacer\n             * @initvalue \"\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx,'name', \"\");\n\n            /**\n             *\n             * @var {x3dom.fields.SFFloat} weight\n             * @memberof x3dom.nodeTypes.HAnimDisplacer\n             * @initvalue 0\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'weight', 0);\n\n            /**\n             *\n             * @var {x3dom.fields.MFInt32} coordIndex\n             * @memberof x3dom.nodeTypes.HAnimDisplacer\n             * @initvalue []\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFInt32(ctx, 'coordIndex', []);\n\n            /**\n             *\n             * @var {x3dom.fields.MFVec3f} displacements\n             * @memberof x3dom.nodeTypes.HAnimDisplacer\n             * @initvalue []\n             * @field x3dom\n             * @instance\n             */\n            this.addField_MFVec3f(ctx, 'displacements', []);\n\n            // TODO displacement (add functionality e.g. via matrix palette skinning in shader)\n            x3dom.debug.logWarning(\"HAnimDisplacer in Segments NYI.\");\n        \n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### HAnimJoint ###\nx3dom.registerNodeType(\n    \"HAnimJoint\",\n    \"H-Anim\",\n    defineClass(x3dom.nodeTypes.Transform,\n        \n        /**\n         * Constructor for HAnimJoint\n         * @constructs x3dom.nodeTypes.HAnimJoint\n         * @x3d 3.3\n         * @component H-Anim\n         * @status experimental\n         * @extends x3dom.nodeTypes.Transform\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc Each joint in the body is represented by an HAnimJoint node, which is used to define the relationship of each body segment to its immediate parent.\n         * An HAnimJoint may only be a child of another HAnimJoint node or a child within the skeleton field in the case of the HAnimJoint used as a humanoid root (i.e., an HAnimJoint may not be a child of an HAnimSegment).\n         * The HAnimJoint node is also used to store other joint-specific information. In particular, a joint name is provided so that applications can identify each HAnimJoint node at run-time.\n         * The HAnimJoint node may contain hints for inverse-kinematics systems that wish to control the H-Anim figure.\n         * These hints include the upper and lower joint limits, the orientation of the joint limits, and a stiffness/resistance value.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.HAnimJoint.superClass.call(this, ctx);\n\n            /**\n             * Each Joint object shall have a name field, which shall not have the empty string value, that is used for identifying\n             * the object. Within the local scope of a Humanoid object, each Joint object can be referenced by its name alone\n             * (e.g., r_shoulder, l_hip, or skullbase). However, when referring to a Joint object within a larger or global scope,\n             * the name of the Humanoid object shall be added as a distinguishing prefix.\n             * @var {x3dom.fields.SFString} name\n             * @memberof x3dom.nodeTypes.HAnimJoint\n             * @initvalue \"\"\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFString(ctx, 'name', \"\");\n\n            /**\n             * The displacers field contains a list of Displacer objects that are used to morph the deformable mesh using\n             * the morph targets defined in the Displacer objects. \n             * @var {x3dom.fields.MFNode} displacers\n             * @memberof x3dom.nodeTypes.HAnimJoint\n             * @initvalue x3dom.nodeTypes.HAnimDisplacer\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFNode('displacers', x3dom.nodeTypes.HAnimDisplacer);\n\n\n            /**\n             * The limitOrientation field gives the orientation of the coordinate frame in which the ulimit and llimit values\n             * are to be interpreted. It describes the orientation of ulimit and llimit fields in the local coordinate frame,\n             * relative to the Joint object centre position described by the center field.\n             * @var {x3dom.fields.SFRotation} limitOrientation\n             * @memberof x3dom.nodeTypes.HAnimJoint\n             * @initvalue 0 0 1 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFRotation(ctx, 'limitOrientation', '0 0 1 0');\n\n            /**\n             * The llimit field specifies lower joint rotation limits. Its components storee the lower (i.e., minimum) values\n             * for rotation around the X, Y and Z axes. A sequence containing zero elements indicates that the joint is unconstrained.\n             * A non-empty sequence can only consist of a single three-value element. If ulimit and llimit values are provided,\n             * both must be defined together. If llimit and ulimit are equal, no constraints are applied to Joint object rotations.\n             * @var {x3dom.fields.MFFloat} llimit\n             * @memberof x3dom.nodeTypes.HAnimJoint\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFFloat(ctx, 'llimit', []);\n\n            /**\n             * The ulimit field specifies the upper joint rotation limits. Its components store the upper (i.e. maximum) values for rotation\n             * around the X, Y and Z axes. A sequence containing zero elements indicates that the joint is unconstrained. A non-empty\n             * sequence can only consist of a single three-value element. If ulimit and llimit values are provided, both must be defined\n             * together. If llimit and ulimit are equal, no constraints are applied to Joint object rotations.\n             * @var {x3dom.fields.MFFloat} ulimit\n             * @memberof x3dom.nodeTypes.HAnimJoint\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFFloat(ctx, 'ulimit', []);\n\n            /**\n             *\n             * @var {x3dom.fields.MFInt32} skinCoordIndex\n             * @memberof x3dom.nodeTypes.HAnimJoint\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFInt32(ctx, 'skinCoordIndex', []);\n\n            /**\n             * The skinCoordWeight field contains a list of floating point values between 0.0 and 1.0 that describe an amount\n             * of weighting that should be used to affect a particular vertex from the skinCoord field of the Humanoid object.\n             * Each item in this list has a corresponding index value in the skinCoordIndex field of the Joint object indicating\n             * exactly which coordinate is to be influenced.\n             * @var {x3dom.fields.MFFloat} skinCoordWeight\n             * @memberof x3dom.nodeTypes.HAnimJoint\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFFloat(ctx, 'skinCoordWeight', []);\n        \n            /**\n             * The stiffness field, if present, contains values that specify to an inverse kinematics (IK) system how much each degree\n             * of freedom should scale the calculated joint rotation at each step of the IK solver. A scale factor of (1 - stiffness)\n             * is applied around the corresponding axis (X, Y, or Z for entries 0, 1 and 2 of the stiffness field). Thus a stiffness\n             * value of zero means that no rotation scaling occurs, while a stiffness value of one means that no rotation occurs\n             * regardless of any provided rotation.\n             * @var {x3dom.fields.MFFloat} stiffness\n             * @memberof x3dom.nodeTypes.HAnimJoint\n             * @initvalue 0 0 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFFloat(ctx, 'stiffness', [0, 0, 0]);\n        \n        },\n        {\n            nodeChanged: function()\n            {\n                this._humanoid = _findRoot(this._xmlNode);\n                \n                function _findRoot(domNode) {\n                    var parent = domNode.parentNode._x3domNode; //_parentNodes not yet available\n                    if (x3dom.isa(parent, x3dom.nodeTypes.Scene)) return false\n                    if (x3dom.isa(parent, x3dom.nodeTypes.HAnimHumanoid)) return parent\n                    return _findRoot(parent._xmlNode);\n                }\n            },\n        \n            collectDrawableObjects: function (transform, drawableCollection, singlePath, invalidateCache, planeMask, clipPlanes)\n            {\n                // check if multi parent sub-graph, don't cache in that case\n                if (singlePath && (this._parentNodes.length > 1))\n                    singlePath = false;\n\n                // an invalid world matrix or volume needs to be invalidated down the hierarchy\n                if (singlePath && (invalidateCache = invalidateCache || this.cacheInvalid()))\n                    this.invalidateCache();\n\n                // check if sub-graph can be culled away or render flag was set to false\n                planeMask = drawableCollection.cull(transform, this.graphState(), singlePath, planeMask);\n                // do skinning in any case\n                var skinCoord = this._humanoid._cf.skinCoord.node;\n                if (planeMask < 0 && !skinCoord) {\n                    return;\n                }\n\n                var cnode, childTransform;\n\n                if (singlePath) {\n                    // rebuild cache on change and reuse world transform\n                    if (!this._graph.globalMatrix) {\n                        this._graph.globalMatrix = this.transformMatrix(transform);\n                    }\n                    childTransform = this._graph.globalMatrix;\n                }\n                else {\n                    childTransform = this.transformMatrix(transform);\n                }\n\n                var n = this._childNodes.length;\n\n                if (x3dom.nodeTypes.ClipPlane.count > 0) {\n                    var localClipPlanes = [];\n\n                    for (var j = 0; j < n; j++) {\n                        if ( (cnode = this._childNodes[j]) ) {\n                            if (x3dom.isa(cnode, x3dom.nodeTypes.ClipPlane) && cnode._vf.on && cnode._vf.enabled) {\n                                localClipPlanes.push({plane: cnode, trafo: childTransform});\n                            }\n                        }\n                    }\n\n                    clipPlanes = localClipPlanes.concat(clipPlanes);\n                }\n                \n                //skin\n                \n                var skinCoordIndex, skinCoordWeight, humanoid, trafo, displacers;\n                \n                if ( skinCoord ) {               \n                    humanoid = this._humanoid;\n                    trafo = humanoid.getCurrentTransform().inverse().mult(childTransform);//factor in root trafo\n                    \n                    // first add displacers\n                    displacers = this._cf.displacers.nodes;\n                    if ( displacers.length !== 0) {\n                        displacers.forEach( function(displacer) {\n                            var weight = displacer._vf.weight;\n                            var MFdisplacements = displacer._vf.displacements;\n                            var offsets = MFdisplacements.length;\n                            if (offsets !== 0) {\n                                displacer._vf.coordIndex.forEach( function(coordIndex, i) {\n                                    skinCoord._vf.point[coordIndex] = skinCoord._vf.point[coordIndex]\n                                        .addScaled( trafo.multMatrixVec( MFdisplacements[i % offsets] ), weight );\n                                });\n                            }\n                        });\n                    }\n                    \n                    // then add weighted skinCoordIndex\n                    skinCoordIndex = this._vf.skinCoordIndex;\n                    if ( skinCoordIndex.length !== 0 ) {\n                        skinCoordWeight = this._vf.skinCoordWeight;\n                        //blend in contribution rel. to undeformed resting\n                        skinCoordIndex.forEach(function(coordIndex, i) {\n                            //update coord\n                            var restCoord = humanoid._restCoords[coordIndex];\n                            skinCoord._vf.point[coordIndex] = skinCoord._vf.point[coordIndex]\n                                .add( trafo.multMatrixPnt( restCoord )\n                                    .subtract( restCoord )\n                                    .multiply( skinCoordWeight[ Math.min( i, skinCoordWeight.length-1 ) ])\n                                 ); //in case of not enough weights\n                        });\n                    }\n                }\n                \n                var skinNormal = this._humanoid._cf.skinNormal.node;\n                if (skinNormal) {\n                    skinCoordIndex = this._vf.skinCoordIndex;\n                    if (skinCoordIndex.length !== 0) {\n                        skinCoordWeight = this._vf.skinCoordWeight;\n                        humanoid = this._humanoid;\n                        // use inverse transpose for normal\n                        trafo = humanoid.getCurrentTransform().inverse().mult(childTransform).inverse().transpose();\n                        //blend in contribution rel. to undeformed resting\n                        skinCoordIndex.forEach(function(coordIndex, i) {\n                            //update coord\n                            var restNormal = humanoid._restNormals[coordIndex];\n                            skinNormal._vf.vector[coordIndex] = skinNormal._vf.vector[coordIndex]\n                                .add(trafo.multMatrixVec( restNormal )\n                                    .subtract( restNormal )\n                                    .multiply( skinCoordWeight[ Math.min( i, skinCoordWeight.length-1 ) ])\n                                 ); //in case of not enough weights\n                        });\n                    }\n                }\n                \n                for (var i=0; i<n; i++) {\n                    if ( (cnode = this._childNodes[i]) ) {\n                        cnode.collectDrawableObjects(childTransform, drawableCollection, singlePath, invalidateCache, planeMask, clipPlanes);\n                    }\n                }\n            }\n        }    \n               \n                //TODO: for skinned animation\n                //custom collectDrawableObjects which receives skinCoord and skinNormal fields\n                //or use fieldChanged and search for skinCoord\n                //or search for Humanoid, skinCoord at nodeChanged\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### HAnimSegment ###\nx3dom.registerNodeType(\n    \"HAnimSegment\",\n    \"H-Anim\",\n    defineClass(x3dom.nodeTypes.X3DGroupingNode,\n        \n        /**\n         * Constructor for HAnimSegment\n         * @constructs x3dom.nodeTypes.HAnimSegment\n         * @x3d 3.3\n         * @component H-Anim\n         * @status full\n         * @extends x3dom.nodeTypes.X3DGroupingNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc Each body segment is stored in an HAnimSegment node.\n         * The HAnimSegment node is a grouping node that will typically contain either a number of Shape nodes or perhaps Transform nodes that position the body part within its coordinate system.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.HAnimSegment.superClass.call(this, ctx);\n\n\n            /**\n             * Each Segment object shall have a name field, which shall not have the empty string value, that is used for identifying\n             * the object. Within the local scope of a Humanoid object, each Segment object can be referenced by its name alone\n             * (e.g., r_upperarm, l_thigh, or skull). However, when referring to a Segment object within a larger or global scope,\n             * the name of the Humanoid object shall be added as a distinguishing prefix.\n             * @var {x3dom.fields.SFString} name\n             * @memberof x3dom.nodeTypes.HAnimSegment\n             * @initvalue \"\"\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFString(ctx,'name', \"\");\n\n            /**\n             * The centerOfMass field is the location within the segment of its centre of mass.\n             * @var {x3dom.fields.SFVec3f} centerOfMass\n             * @memberof x3dom.nodeTypes.HAnimSegment\n             * @initvalue 0,0,0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFVec3f(ctx, 'centerOfMass', 0, 0, 0);\n\n            /**\n             * The mass field is the total mass of the segment. A value of -1 for mass specifies that no mass value is available.\n             * @var {x3dom.fields.SFFloat} mass\n             * @memberof x3dom.nodeTypes.HAnimSegment\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'mass', 0);\n\n            /**\n             * The momentsOfInertia field contains the moment of inertia matrix. The first three elements are the first row\n             * of the 3×3 matrix, the next three elements are the second row, and the final three elements are the third row.\n             * @var {x3dom.fields.MFFloat} momentsOfInertia\n             * @memberof x3dom.nodeTypes.HAnimSegment\n             * @initvalue [0,0,0,0,0,0,0,0,0]\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFFloat(ctx, 'momentsOfInertia', [0, 0, 0, 0, 0, 0, 0, 0, 0]);\n\n\n            /**\n             * The coord field is used for Segment objects that have deformable meshes and shall contain coordinates referenced\n             * from the indexed mesh for the Segment object. The coordinates are given the same name as the Segment object,\n             * but with a \"_coords\" appended (e.g., \"skull_coords\").\n             * @var {x3dom.fields.SFNode} coord\n             * @memberof x3dom.nodeTypes.HAnimSegment\n             * @initvalue x3dom.nodeTypes.X3DCoordinateNode\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFNode('coord', x3dom.nodeTypes.X3DCoordinateNode);\n\n            /**\n             * The displacers field stores the Displacer objects for a particular Segment object.\n             * @var {x3dom.fields.MFNode} displacers\n             * @memberof x3dom.nodeTypes.HAnimSegment\n             * @initvalue x3dom.nodeTypes.HAnimDisplacer\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFNode('displacers', x3dom.nodeTypes.HAnimDisplacer);\n        \n        },\n        {\n            // TODO coord      add functionality\n            // TODO displacers add functionality\n            // See Joint for possible displacer implementation:\n            // - custom collectDrawables\n            // - look for displacers\n            // - apply weighted displacements to coord field\n            // - force update of all parents of coord field by fieldChanged(\"coord\") here\n            // - or better in Humanoid (needs a list of affected segment shapes)\n            // needs a good example scene\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### HAnimSite ###\nx3dom.registerNodeType(\n    \"HAnimSite\",\n    \"H-Anim\",\n    defineClass(x3dom.nodeTypes.Transform,\n        \n        /**\n         * Constructor for HAnimSite\n         * @constructs x3dom.nodeTypes.HAnimSite\n         * @x3d 3.3\n         * @component H-Anim\n         * @status full\n         * @extends x3dom.nodeTypes.Transform\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc An HAnimSite node serves three purposes. The first is to define an \"end effecter\" location that can be used by an inverse kinematics system.\n         * The second is to define an attachment point for accessories such as jewelry and clothing.\n         * The third is to define a location for a virtual camera in the reference frame of an HAnimSegment (such as a view \"through the eyes\" of the humanoid for use in multi-user worlds).\n         */\n        function (ctx) {\n            x3dom.nodeTypes.HAnimSite.superClass.call(this, ctx);\n\n\n            /**\n             * Each Site object shall have a name field that is used for identifying the object. Within the local scope of a Humanoid\n             * object, each Site object can be referenced by its name alone (e.g., r_neck_base, l_femoral_lateral_epicn, sellion, etc.).\n             * However, when referring to a Site object within a larger or global scope, the name of the Humanoid object shall be added\n             * as a distinguishing prefix.\n             * Depending on the intended purpose, the Site object's name field shall be altered to appropriately describe its function.\n             * If used as an end effector, the Site object shall have a name consisting of the name of the Segment to which it is\n             * attached with an \"_tip\" suffix appended. Site objects that are used to define viewpoint locations shall have a \"_view\"\n             * suffix appended. Site objects that are not end effectors and not camera locations shall have an \"_pt\" suffix.\n             * @var {x3dom.fields.SFString} name\n             * @memberof x3dom.nodeTypes.HAnimSite\n             * @initvalue \"\"\n             * @field x3dom\n             * @instance\n             */\n            this.addField_SFString(ctx, 'name', \"\");\n        \n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2009 Fraunhofer IGD, Darmstadt, Germany\n * Dual licensed under the MIT and GPL\n */\n\n// ### HAnimHumanoid ###\nx3dom.registerNodeType(\n    \"HAnimHumanoid\",\n    \"H-Anim\",\n    defineClass(x3dom.nodeTypes.Transform,\n        \n        /**\n         * Constructor for HAnimHumanoid\n         * @constructs x3dom.nodeTypes.HAnimHumanoid\n         * @x3d 3.3\n         * @component H-Anim\n         * @status full\n         * @extends x3dom.nodeTypes.Transform\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The HAnimHumanoid node is used to store human-readable data such as author and copyright information, as well as to store references to the HAnimJoint, HAnimSegment, and HAnimSite nodes in addition to serving as a container for the entire humanoid.\n         * Thus, it serves as a central node for moving the humanoid through its environment.\n         */\n        function (ctx) {\n            x3dom.nodeTypes.HAnimHumanoid.superClass.call(this, ctx);\n\n\n            /**\n             * The name field, which shall be present, and which shall not have the empty string value, \n             * stores the name of the humanoid defined by the Humanoid object.\n             * @var {x3dom.fields.SFString} name\n             * @memberof x3dom.nodeTypes.HAnimHumanoid\n             * @initvalue \"\"\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFString(ctx, 'name', \"\");\n\n            /**\n             * The version field stores the version of this International Standard to which the Humanoid object conforms.\n             * The version value for International Standard V2.0  is \"2.0\".\n             * @var {x3dom.fields.SFString} version\n             * @memberof x3dom.nodeTypes.HAnimHumanoid\n             * @initvalue \"\"\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFString(ctx, 'version', \"\");\n\n            /**\n             * The info field consists of a sequence of strings, each of which is of the form term=value.\n             * The following terms are defined in this International Standard:\n             *   authorName\n             *   authorEmail\n             *   copyright\n             *   creationDate\n             *   usageRestrictions\n             *   humanoidVersion\n             *   age\n             *   gender\n             *   height\n             *   weight\n             * The gender term typically has a value of female, male or neuter. The humanoidVersion term refers to the version\n             * of the humanoid being used, in order to track revisions to the data. It is not the same as the version field of \n             * the Humanoid object, which refers to the version of the H-Anim specification that was used when building the humanoid.\n             * Additional term=value pairs may be included as needed for specific applications.\n             * @var {x3dom.fields.MFString} info\n             * @memberof x3dom.nodeTypes.HAnimHumanoid\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFString(ctx, 'info', []);\n\n            /**\n             * The joints field contains a list of references, one for each Joint object defined within the skeleton field hierarchy\n             * of the Humanoid object. The order in which the joints are listed is irrelevant since the names of the joints are\n             * stored in the Joint objects themselves. The references to contained Joint objects may be used to support inverse\n             * kinematics (IK) and other motion tools animating nodes found within the skeleton field.\n             * @var {x3dom.fields.MFNode} joints\n             * @memberof x3dom.nodeTypes.HAnimHumanoid\n             * @initvalue x3dom.nodeTypes.HAnimJoint\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFNode('joints', x3dom.nodeTypes.HAnimJoint);\n\n            /**\n             * The segments field contains a list of references, one for each Segment object defined within the skeleton\n             * field hierarchy of the Humanoid object. The order in which the segments are listed is irrelevant since\n             * the names of the segments are stored in the Segment objects themselves. The references to contained Segment\n             * objects may be used to support inverse kinematics (IK) and other motion tools animating nodes found within the skeleton field.\n             * @var {x3dom.fields.MFNode} segments\n             * @memberof x3dom.nodeTypes.HAnimHumanoid\n             * @initvalue x3dom.nodeTypes.HAnimSegment\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFNode('segments', x3dom.nodeTypes.HAnimSegment);\n\n            /**\n             * The sites field contains a list of references, one for each Site object defined within the skeleton\n             * field hierarchy of the Humanoid object. The order in which the sites are listed is irrelevant since\n             * the names of the sites are stored in the Site objects themselves. The references to contained Site objects\n             * may be used to support inverse kinematics (IK) and other motion tools animating nodes found within the skeleton field.\n             * @var {x3dom.fields.MFNode} sites\n             * @memberof x3dom.nodeTypes.HAnimHumanoid\n             * @initvalue x3dom.nodeTypes.HAnimSite\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFNode('sites', x3dom.nodeTypes.HAnimSite);\n\n            /**\n             * The skeleton field contains the humanoid_root Joint object. The Humanoid object is considered the parent object\n             * of the humanoid_root Joint object and defines a coordinate space for the humanoid_root Joint object. Thus,\n             * the Humanoid object's transformation affects the Joint object hierarchy in the skeleton field. A hierarchy of Joint\n             * objects is defined for each H-Anim humanoid figure within the skeleton field of the Humanoid object and a hierarchical\n             * definition of joints is present even when the geometry of the humanoid figure is not defined within the skeleton field.\n             * The skeleton field can also contain zero or more Site objects which allow landmarks to be established with respect to\n             * the overall humanoid figure, but which are not affected by the movement of any of the Joint objects.\n             * @var {x3dom.fields.MFNode} skeleton\n             * @memberof x3dom.nodeTypes.HAnimHumanoid\n             * @initvalue x3dom.nodeTypes.HAnimJoint\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFNode('skeleton', x3dom.nodeTypes.HAnimJoint);\n\n            /**\n             * The skin field contains one or more indexed mesh definitions. Those indexed mesh definitions utilize the point\n             * and normal data that is defined within the skinCoord and skinNormal fields, respectively, of the Humanoid object.\n             * This field is defined as an generic type for which the specific representation is defined by each binding\n             * to a presentation system.\n             * @var {x3dom.fields.MFNode} skin\n             * @memberof x3dom.nodeTypes.HAnimHumanoid\n             * @initvalue x3dom.nodeTypes.X3DChildNode\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFNode('skin', x3dom.nodeTypes.X3DChildNode);\n\n            /**\n             * The skinCoord field contains a single sequence of points which are used by the internal mechanisms of the Humanoid\n             * object to create the appropriate surface deformations as well as by the indexed mesh definitions within the skin field\n             * which do the actual rendering of the surface geometry.\n             * @var {x3dom.fields.SFNode} skinCoord\n             * @memberof x3dom.nodeTypes.HAnimHumanoid\n             * @initvalue x3dom.nodeTypes.X3DCoordinateNode\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFNode('skinCoord', x3dom.nodeTypes.X3DCoordinateNode);\n\n            /**\n             * The skinNormal field contains the normal data definition which is used by the internal mechanisms of the Humanoid\n             * object to create the appropriate surface deformations as well as the indexed mesh definitions within the skin field\n             * which contains the actual surface geometry that is rendered.\n             * @var {x3dom.fields.SFNode} skinNormal\n             * @memberof x3dom.nodeTypes.HAnimHumanoid\n             * @initvalue x3dom.nodeTypes.X3DNormalNode\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFNode('skinNormal', x3dom.nodeTypes.X3DNormalNode);\n\n            /**\n             * The viewpoints field has a different functionality and behaviour than the joints, segments and sites fields.\n             * The viewpoints field can contain zero or more Site object definitions. The Site objects defined within this field\n             * are affected by the transformations applied to the Humanoid object, but are not affected by any of the transformations\n             * performed on the skeletal hierarchy defined within the skeleton field. The purpose of these Site objects is to\n             * define locations for virtual cameras in the reference frame of the Humanoid object. Site objects that are defined\n             * in this manner are intended to be used as attachment points from which a certain viewing perspective can be seen\n             * (such as viewing the face or profile of the human figure).\n             * @var {x3dom.fields.MFNode} viewpoints\n             * @memberof x3dom.nodeTypes.HAnimHumanoid\n             * @initvalue x3dom.nodeTypes.HAnimSite\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFNode('viewpoints', x3dom.nodeTypes.HAnimSite);\n        \n            /**\n             * The skeletalConfiguration field identifies the skeletal configuration of this model. Any models that share the\n             * same skeletalConfiguration value can also share skeletal animation data. The only specific skeletal configuration\n             * defined in this International Standard is the \"BASIC\" skeletal configuration specified in 4.8.1 Overview. Since the\n             * default value of the skeletal configuration is \"BASIC\", a humanoid model that specifies a skeletalConfiguration value\n             * of \"BASIC\" shall conform to the restrictive skeletal model specified in 4.8.1 Overview. For any other value \n             * the model shall also contain one or more of the five binding fields.\n             * @var {x3dom.fields.MFVec3f} skeletalConfiguration\n             * @memberof x3dom.nodeTypes.HAnimHumanoid\n             * @initvalue 'BASIC'\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFString(ctx, 'skeletalConfiguration', 'BASIC');\n\n            /**\n             * The jointBindingPositions field specifies position values, respectively, associated with the array of Joint objects\n             * contained in the joints field. If only one value is provided (such as the default value) then it is applied to all\n             * listed Joint objects equivalently. Applying each set of these translation, rotation, and scale values, in order,\n             * to the corresponding Joint objects maps a skeleton to the binding pose.\n             * @var {x3dom.fields.MFVec3f} jointBindingPositions\n             * @memberof x3dom.nodeTypes.HAnimHumanoid\n             * @initvalue [0 0 0]\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFVec3f(ctx, 'jointBindingPositions', [0, 0, 0]);\n        \n            /**\n             * The jointBindingRotations field specifies position values, respectively, associated with the array of Joint objects\n             * contained in the joints field. If only one value is provided (such as the default value) then it is applied to all\n             * listed Joint objects equivalently. Applying each set of these translation, rotation, and scale values, in order,\n             * to the corresponding Joint objects maps a skeleton to the binding pose.\n             * @var {x3dom.fields.MFVec3f} jointBindingRotations\n             * @memberof x3dom.nodeTypes.HAnimHumanoid\n             * @initvalue  [0 0 1 0]\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFRotation(ctx, 'jointBindingRotations', [0, 0, 1, 0]);\n        \n            /**\n             * The jointBindingScales field specifies scale values, respectively, associated with the array of Joint objects\n             * contained in the joints field. If only one value is provided (such as the default value) then it is applied to all\n             * listed Joint objects equivalently. Applying each set of these translation, rotation, and scale values, in order,\n             * to the corresponding Joint objects maps a skeleton to the binding pose.\n             * @var {x3dom.fields.MFVec3f} jointBindingScales\n             * @memberof x3dom.nodeTypes.HAnimHumanoid\n             * @initvalue [1 1 1]\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFVec3f(ctx, 'jointBindingScales', [1, 1, 1]);\n        \n            /**\n             * The skinBindingCoords field specifies an array of vertex locations that define the mesh in the binding pose.\n             * For each set of values corresponding to a given pose, the same vertex indexing system that is used for the skinCoord\n             * field also applies to this field.\n             * @var {x3dom.fields.MFVec3f} skinBindingCoords\n             * @memberof x3dom.nodeTypes.HAnimHumanoid\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFVec3f(ctx, 'skinBindingCoords', []);\n \n            /**\n             * The skinBindingNormals field specifies an array of normal vectors that define the mesh normal vectors in the\n             * binding pose. For each set of values corresponding to a given pose, the same normal indexing system used for\n             * the skinNormal field also applies to this field.\n             * @var {x3dom.fields.MFVec3f} skinBindingNormals\n             * @memberof x3dom.nodeTypes.HAnimHumanoid\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFVec3f(ctx, 'skinBindingNormals', []);\n               \n        },\n        {\n            collectDrawableObjects: function (transform, drawableCollection, singlePath, invalidateCache, planeMask, clipPlanes)\n            {\n                // check if multi parent sub-graph, don't cache in that case\n                if (singlePath && (this._parentNodes.length > 1))\n                    singlePath = false;\n\n                // an invalid world matrix or volume needs to be invalidated down the hierarchy\n                if (singlePath && (invalidateCache = invalidateCache || this.cacheInvalid()))\n                    this.invalidateCache();\n\n                // check if sub-graph can be culled away or render flag was set to false\n                planeMask = drawableCollection.cull(transform, this.graphState(), singlePath, planeMask);\n                if (planeMask < 0) {\n                    return;\n                }\n\n                var cnode, childTransform;\n\n                if (singlePath) {\n                    // rebuild cache on change and reuse world transform\n                    if (!this._graph.globalMatrix) {\n                        this._graph.globalMatrix = this.transformMatrix(transform);\n                    }\n                    childTransform = this._graph.globalMatrix;\n                }\n                else {\n                    childTransform = this.transformMatrix(transform);\n                }\n\n                var n = this._childNodes.length;\n\n                if (x3dom.nodeTypes.ClipPlane.count > 0) {\n                    var localClipPlanes = [];\n\n                    for (var j = 0; j < n; j++) {\n                        if ( (cnode = this._childNodes[j]) ) {\n                            if (x3dom.isa(cnode, x3dom.nodeTypes.ClipPlane) && cnode._vf.on && cnode._vf.enabled) {\n                                localClipPlanes.push({plane: cnode, trafo: childTransform});\n                            }\n                        }\n                    }\n\n                    clipPlanes = localClipPlanes.concat(clipPlanes);\n                }\n                \n                //reset skin coords and normals before traversing skeleton\n                if (this._cf.skinCoord.node)\n                    this._cf.skinCoord.node._vf.point.setValues(this._restCoords);\n                \n                if (this._cf.skinNormal.node)\n                    this._cf.skinNormal.node._vf.vector.setValues(this._restNormals);\n\n                \n                this._cf.skeleton.nodes.forEach(function(cnode) {\n                   cnode.collectDrawableObjects(childTransform, drawableCollection, singlePath, invalidateCache, planeMask, clipPlanes);\n                });\n                \n                this._cf.skin.nodes.forEach(function(cnode) {\n                   cnode.collectDrawableObjects(childTransform, drawableCollection, singlePath, invalidateCache, planeMask, clipPlanes);\n                });\n                \n                //force coord update\n                if (this._cf.skinCoord.node) {\n                    this._cf.skinCoord.node._parentNodes.forEach( function(node) {\n                        node.fieldChanged('coord');// may need to be more general\n                    });\n                }\n            },\n        \n            nodeChanged: function()\n            {\n                //save initial, resting pose\n                if (this._cf.skinCoord.node)\n                    this._restCoords = this._cf.skinCoord.node._vf.point.copy() ;\n                if (this._cf.skinNormal.node)\n                    this._restNormals = this._cf.skinNormal.node._vf.vector.copy();\n            }\n            // TODO skeleton   add functionality for HAnimSite also (unaffected by internal transformations)\n            // TODO joints     add functionality: mostly done\n            // TODO segments   add functionality: mostly done\n            // TODO sites      add functionality: mostly done\n            // TODO skin...    add functionality: move to shader\n            // TODO viewpoints add functionality: seems to work\n            // TODO binding fields: for non default configurations\n\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2018 A. Plesch, Waltham, MA USA\n * Dual licensed under the MIT and GPL\n */\n /*\n * Ayam, a free 3D modeler for the RenderMan interface.\n *\n * Ayam is copyrighted 1998-2016 by Randolf Schultz\n * (randolf.schultz@gmail.com) and others.\n *\n * All rights reserved.\n *\n * See the file License for details.\n *\n */\n\n/* ### NurbsTrimmedSurface ### */\nx3dom.registerNodeType(\n    \"X3DParametricGeometryNode\",\n    \"NURBS\",\n    defineClass(x3dom.nodeTypes.X3DGeometryNode,\n        \n        /**\n         * Constructor for X3DParametricGeometryNode\n         * @constructs x3dom.nodeTypes.X3DParametricGeometryNode\n         * @x3d 3.3\n         * @component NURBS\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The X3DParametricGeometryNode abstract node type is the base type for all geometry node types\n         * that are created parametrically and use control points to describe the final shape of the surface. How the\n         * control points are described and interpreted shall be a property of the individual node type.\n         *\n         */\n         \n        function (ctx) {\n            x3dom.nodeTypes.X3DParametricGeometryNode.superClass.call(this, ctx);\n        }, { }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2018 A. Plesch, Waltham, MA USA\n * Dual licensed under the MIT and GPL\n */\n/*\n * Ayam, a free 3D modeler for the RenderMan interface.\n *\n * Ayam is copyrighted 1998-2016 by Randolf Schultz\n * (randolf.schultz@gmail.com) and others.\n *\n * All rights reserved.\n *\n * See the file License for details.\n *\n */\n\n/* ### NurbsPatchSurface ### */\nx3dom.registerNodeType(\n    \"X3DNurbsSurfaceGeometryNode\",\n    \"NURBS\",\n    defineClass(x3dom.nodeTypes.X3DParametricGeometryNode,\n\n        /**\n         * Constructor for X3DNurbsSurfaceGeometryNode\n         * @constructs x3dom.nodeTypes.X3DNurbsSurfaceGeometryNode\n         * @x3d 3.3\n         * @component NURBS\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DParametricGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The X3DNurbsSurfaceGeometryNode represents the abstract geometry type for all types of NURBS surfaces.\n         */\n\n        function (ctx) {\n        x3dom.nodeTypes.X3DParametricGeometryNode.superClass.call(this, ctx);\n\n        /**\n         * uDimension and vDimension define the number of control points in the u and v dimensions.\n         * @var {x3dom.fields.SFInt32} uDimension\n         * @memberof x3dom.nodeTypes.X3DParametricGeometryNode\n         * @initvalue 0\n         * @range [0, inf]\n         * @field x3d\n         * @instance\n         */\n        this.addField_SFInt32(ctx, 'uDimension', 0);\n\n        /**\n         * uDimension and vDimension define the number of control points in the u and v dimensions.\n         * @var {x3dom.fields.SFInt32} vDimension\n         * @memberof x3dom.nodeTypes.X3DParametricGeometryNode\n         * @initvalue 0\n         * @range [0, inf]\n         * @field x3d\n         * @instance\n         */\n        this.addField_SFInt32(ctx, 'vDimension', 0);\n\n        /**\n         * uOrder and vOrder define the order of the surface in the u and v dimensions.\n         * @var {x3dom.fields.SFInt32} uOrder\n         * @memberof x3dom.nodeTypes.X3DParametricGeometryNode\n         * @initvalue 3\n         * @range [2, inf]\n         * @field x3d\n         * @instance\n         */\n        this.addField_SFInt32(ctx, 'uOrder', 3);\n\n        /**\n         * uOrder and vOrder define the order of the surface in the u and v dimensions.\n         * @var {x3dom.fields.SFInt32} vOrder\n         * @memberof x3dom.nodeTypes.X3DParametricGeometryNode\n         * @initvalue 3\n         * @range [2, inf]\n         * @field x3d\n         * @instance\n         */\n        this.addField_SFInt32(ctx, 'vOrder', 3);\n\n        /**\n         * subdividing the surface in a equal number of subdivision steps. 0: double dimension plus 1.\n         * For implementations doing tessellations based on chord length, tessellation values less than zero\n         * are interpreted as the maximum chord length deviation in pixels. Implementations doing fully automatic\n         * tessellation may ignore the tessellation hint parameters.\n         * @var {x3dom.fields.SFInt32} uTessellation\n         * @memberof x3dom.nodeTypes.X3DParametricGeometryNode\n         * @initvalue 0\n         * @range [-inf, inf]\n         * @field x3d\n         * @instance\n         */\n        this.addField_SFFloat(ctx, 'uTessellation', 0.0); //should be SFInt32\n\n        /**\n         * subdividing the surface in a equal number of subdivision steps. 0: double dimension plus 1.\n         * For implementations doing tessellations based on chord length, tessellation values less than zero\n         * are interpreted as the maximum chord length deviation in pixels. Implementations doing fully automatic\n         * tessellation may ignore the tessellation hint parameters.\n         * @var {x3dom.fields.SFInt32} vTessellation\n         * @memberof x3dom.nodeTypes.X3DParametricGeometryNode\n         * @initvalue 0\n         * @range [-inf, inf]\n         * @field x3d\n         * @instance\n         */\n        this.addField_SFFloat(ctx, 'vTessellation', 0.0); //should be SFInt32\n\n        /**\n         * uKnot and vKnot define the knot values of the surface in the u and v dimensions.\n         * @var {x3dom.fields.MFDouble} uKnot\n         * @memberof x3dom.nodeTypes.X3DParametricGeometryNode\n         * @initvalue []\n         * @range [-inf, inf]\n         * @field x3d\n         * @instance\n         */\n        this.addField_MFDouble(ctx, 'uKnot', []);\n\n        /**\n         * uKnot and vKnot define the knot values of the surface in the u and v dimensions.\n         * @var {x3dom.fields.MFDouble} vKnot\n         * @memberof x3dom.nodeTypes.X3DParametricGeometryNode\n         * @initvalue []\n         * @range [-inf, inf]\n         * @field x3d\n         * @instance\n         */\n        this.addField_MFDouble(ctx, 'vKnot', []);\n\n        /**\n         * control point weights: P[i,j].w = weight[ i + (j × uDimension)]\n         * @var {x3dom.fields.MFDouble} weight\n         * @memberof x3dom.nodeTypes.X3DParametricGeometryNode\n         * @initvalue []\n         * @range [0, inf]\n         * @field x3d\n         * @instance\n         */\n        this.addField_MFDouble(ctx, 'weight', []);\n\n        /**\n         * controlPoint defines a set of control points of dimension uDimension × vDimension.\n         * This set of points defines a mesh where the points do not have a uniform spacing.\n         * uDimension points define a polyline in u-direction followed by further u-polylines with the v-parameter in ascending order.\n         * The number of control points shall be equal or greater than the order.\n         * A closed surface in either the u-dimension or the v-dimension shall be specified by repeating the limiting control points\n         * for that dimension and setting the respective uClosed or vClosed field to TRUE. If the last control point is not identical\n         * with the first control point, the field is ignored. If either the uClosed or the vClosed field is set to FALSE,\n         * the implementation shall not be required to smoothly blend the edges of the surface in that dimension.\n         * into a continuous surface.\n         * @var {x3dom.fields.SFNode} controlPoint\n         * @memberof x3dom.nodeTypes.X3DParametricGeometryNode\n         * @initvalue null\n         * @field x3d\n         * @instance\n         */\n        this.addField_SFNode('controlPoint', x3dom.nodeTypes.X3DCoordinateNode);\n\n        /**\n         * NYI: uClosed and vClosed define whether or not the specific dimension is to be evaluated as a closed surface\n         * along the u and v directions, respectively.\n         * @var {x3dom.fields.SFBool} uClosed\n         * @memberof x3dom.nodeTypes.X3DParametricGeometryNode\n         * @initvalue false\n         * @field x3d\n         * @instance\n         */\n        this.addField_SFBool(ctx, 'uClosed', false); //NYI\n\n        /**\n         * NYI: uClosed and vClosed define whether or not the specific dimension is to be evaluated as a closed surface\n         * along the u and v directions, respectively.\n         * @var {x3dom.fields.SFBool} vClosed\n         * @memberof x3dom.nodeTypes.X3DParametricGeometryNode\n         * @initvalue false\n         * @field x3d\n         * @instance\n         */\n        this.addField_SFBool(ctx, 'vClosed', false); //NYI\n\n        /**\n         * texCoord provides additional information on how to generate texture coordinates.\n         * By default, texture coordinates in the unit square (or cube for 3D coordinates) are generated automatically\n         * from the parametric subdivision. A NurbsTextureCoordinate node or simply a TextureCoordinate node can then\n         * be used to compute a texture coordinate given a u/v parameter of the X3DParametricGeometryNode.\n         * The NurbsTextureCoordinate also supports non-animated surfaces to specify a \"chord length\"-based texture coordinate parametrization.\n         * @var {x3dom.fields.SFNode} texCoord\n         * @memberof x3dom.nodeTypes.X3DComposedGeometryNode\n         * @initvalue x3dom.nodeTypes.X3DTextureCoordinateNode\n         * @field x3dom\n         * @instance\n         */\n        this.addField_SFNode('texCoord', x3dom.nodeTypes.X3DTextureCoordinateNode);\n\n        /**\n         * NYI: whether the surface is visible when viewed from the inside.\n         * When solid=TRUE is used, the surface shall be visible only from the side that appears ccw (counter-clockwise)\n         * on the screen, assuming a surface's quads would be rendered in this order:\n         *  point(u  , v  );\n         *  point(u-1, v  );\n         *  point(u-1, v-1);\n         *  point(u  , v-1);\n         * where u is the parameter generating successive points along the u dimension, and v is the parameter\n         * generating successive points along the v dimension.\n         * @var {x3dom.fields.SFBool} solid\n         * @memberof x3dom.nodeTypes.X3DParametricGeometryNode\n         * @initvalue false\n         * @field x3d\n         * @instance\n         */\n        this.addField_SFBool(ctx, 'solid', false); //NYI\n\n        this.addField_SFBool(ctx, 'normalPerVertex', true);\n\n        this._needReRender = true;\n        this.basisFunsCache = new Map();\n        this.uv = []; // trigger triangulation\n        this.lastTime = -1; // time of last its creation\n\n        //this._myctx = ctx;\n    }, \n    {\n        nodeChanged: function () {\n            this._needReRender = true;\n            this._vf.ccw = false;\n            this._vf.solid = false;\n            this._vf.useGeoCache = false;\n            if (!this._hasCoarseMesh) {\n                var its = this.createCoarseITS(this);\n                this._mesh = its._mesh;\n                this._hasCoarseMesh = true;\n            }\n            \n            if (this._vf.uKnot.length !== this._vf.uDimension + this._vf.uOrder)\n                this._vf.uKnot = this.createDefaultKnots(this._vf.uDimension, this._vf.uOrder);\n            if (this._vf.vKnot.length !== this._vf.vDimension + this._vf.vOrder)\n                this._vf.vKnot = this.createDefaultKnots(this._vf.vDimension, this._vf.vOrder);\n\n            var T = [];\n            if (this._cf.trimmingContour &&\n                this._cf.trimmingContour.nodes.length) {\n                var len = this._cf.trimmingContour.nodes.length;\n                for (var i = 0; i < len; i++) {\n                    var c2dnode = this._cf.trimmingContour.nodes[i];\n                    if (c2dnode._cf.children) {\n                        T[i] = [];\n                        var trim = c2dnode._cf.children.nodes;\n                        for (var j = 0; j < trim.length; j++) {\n                            var tc = trim[j];\n                            // convert polyline to NURBS\n                            if (!tc._vf.order) {\n                                tc._vf.order = 2;\n                            }\n                            if (!tc._vf.knot) {\n                                var knots = [];\n                                knots.push(0);\n                                knots.push(0);\n                                for (var k = 2;\n                                    k < tc._vf.controlPoint.length; k++) //controlPoint.length when MFVec2f, was /2\n                                    knots.push(k - 1);\n                                knots.push(knots[knots.length - 1] + 1);\n                                knots.push(knots[knots.length - 1]);\n                                tc._vf.knot = knots;\n                            }\n                            T[i].push([tc._vf.controlPoint.length - 1, //T[0] needs attention when MFVec2f\n                                    tc._vf.order - 1, tc._vf.knot,\n                                    tc._vf.controlPoint, tc._vf.weight]); //T[3] needs attention when MFVec2f\n                        }\n                    }\n                }\n            }\n\n            var onmessage = function (e) {\n                if (e.data.length >= 3 && e.data[5] > this.caller.lastTime) {\n                    if (this.caller.uv.length) {\n                        var data = e.data[1];\n                        var point = new x3dom.fields.MFVec3f();\n                        for (var i = 0; i < data.length; i++)\n                            point.push(\n                                new x3dom.fields.SFVec3f(data[i][0], data[i][1], data[i][2]));\n\n                        this.caller._mesh._positions[0] = point.toGL();\n                    } else {\n                        var its = this.caller.createITS(e.data, this.caller);\n                        this.caller.workerTask = null;\n                        this.caller._mesh = its._mesh;\n                        if (this.caller._nameSpace) { // worker returns sometimes when doc changes\n                            var tasks = x3dom.tessWorkerPool.taskQueue.length;\n                            var x3de = this.caller._nameSpace.doc._x3dElem;\n                            x3de.runtime.canvas.progressText = tasks == 0 ? \"\" : \"Tesselation tasks: \" + tasks;\n                        }\n                    }\n                    if (this.caller._cleanupGLObjects)\n                        this.caller._cleanupGLObjects(true);\n                    Array.forEach(this.caller._parentNodes,\n                        function (node) {\n                        node.setAllDirty();\n                    });\n                    this.caller.basisFunsCache = e.data[3];\n                    this.caller.uv = e.data[4];\n                    this.caller.lastTime = e.data[5];\n                }\n            }\n\n            var coordNode = this._cf.controlPoint.node;\n            //x3dom.debug.assert(coordNode);\n            var startmessage = [\n                this._vf.uDimension - 1,\n                this._vf.vDimension - 1,\n                this._vf.uOrder - 1, this._vf.vOrder - 1,\n                this._vf.uKnot, this._vf.vKnot,\n                coordNode.getPoints(),\n                this._vf.weight,\n                this._vf.uTessellation,\n                this._vf.vTessellation,\n                T,\n                this.basisFunsCache,\n                this.uv,\n                performance.now()\n            ];\n\n            if (this.workerTask)\n                this.workerTask.discard = true;\n\n            this.workerTask = new x3dom.WorkerTask(x3dom.tessWorkerScript, //global script\n                    this, onmessage, startmessage);\n\n            x3dom.tessWorkerPool.addWorkerTask(this.workerTask); //global pool\n        },\n        \n        fieldChanged: function (fieldName) {\n            if (fieldName == 'order' || fieldName == 'knot' || fieldName.includes('Tessellation')) {\n                this.basisFunsCache = new Map();\n                this.uv = [];\n                this.nodeChanged();\n                return\n            } else if (this.uv.length)\n                this.nodeChanged();\n            // do nothing until first tessellation\n        },\n        \n        createDefaultKnots: function (n, o) {\n            var knots = Array(n + o).fill(0);\n            for (var k = o;\n                k < n; k++)\n                knots[k] = (k - 1) / (n - 1);\n            for (var k = knots.length - o;\n                k < knots.length; k++)\n                knots[k] = 1; //points-1;\n            return knots;\n        },\n\n        createCoarseITS: function (node) {\n            var w = node._vf.uDimension;\n            var h = node._vf.vDimension;\n            var coordNode = node._cf.controlPoint.node;\n\n            var its = new x3dom.nodeTypes.IndexedTriangleSet();\n            its._nameSpace = node._nameSpace;\n            its._vf.solid = false;\n            its._vf.ccw = false;\n            its._cf.texCoord = node._cf.texCoord;\n            var ind = [],\n            i1 = 0,\n            i2 = w;\n            for (var i = 0; i < h - 1; i++) {\n                for (var j = 0; j < w - 1; j++) {\n                    ind.push(i1);\n                    ind.push(i1 + 1);\n                    ind.push(i2);\n                    ind.push(i2);\n                    ind.push(i1 + 1);\n                    ind.push(i2 + 1);\n                    i1++;\n                    i2++;\n                }\n                i1++;\n                i2++;\n            }\n            its._vf.index = ind;\n\n            its.addChild(coordNode);\n            \n            its.nodeChanged();\n            its._xmlNode = node._xmlNode;\n            return its;\n        }, /* createCoarseITS */\n\n        createITS: function (data, node) {\n            var its = new x3dom.nodeTypes.IndexedTriangleSet();\n            its._nameSpace = node._nameSpace;\n            its._vf.normalPerVertex = node._vf.normalPerVertex;\n            its._vf.solid = false;\n            its._vf.ccw = false;\n            its._vf.index = data[0];\n            var co = new x3dom.nodeTypes.Coordinate();\n            co._nameSpace = node._nameSpace;\n            co._vf.point = new x3dom.fields.MFVec3f();\n            for (var i = 0; i < data[1].length; i++)\n                co._vf.point.push(\n                    new x3dom.fields.SFVec3f(data[1][i][0], data[1][i][1], data[1][i][2]));\n            its.addChild(co);\n            if (node._cf.texCoord.node !== null) its._cf.texCoord = node._cf.texCoord; \n            else {\n                var tc = new x3dom.nodeTypes.TextureCoordinate();\n                tc._nameSpace = node._nameSpace;\n                tc._vf.point = new x3dom.fields.MFVec2f();\n                for (var i = 0; i < data[2].length; i++)\n                    tc._vf.point.push(\n                        new x3dom.fields.SFVec2f(data[2][i][0], data[2][i][1]));\n                its.addChild(tc);\n            }\n            its.nodeChanged();\n            its._xmlNode = node._xmlNode;\n            return its;\n        } /* createITS */\n    }));\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2018 A. Plesch, Waltham, MA USA\n * Dual licensed under the MIT and GPL\n */\n /*\n * Ayam, a free 3D modeler for the RenderMan interface.\n *\n * Ayam is copyrighted 1998-2016 by Randolf Schultz\n * (randolf.schultz@gmail.com) and others.\n *\n * All rights reserved.\n *\n * See the file License for details.\n *\n */\n\n/* ### NurbsPatchSurface ### */\nx3dom.registerNodeType(\n    \"NurbsPatchSurface\",\n    \"NURBS\",\n    defineClass(x3dom.nodeTypes.X3DNurbsSurfaceGeometryNode, //X3DComposedGeometryNode, \n    \n        /**\n         * Constructor for NurbsPatchSurface\n         * @constructs x3dom.nodeTypes.NurbsPatchSurface\n         * @x3d 3.3\n         * @component NURBS\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DComposedGeometryNode //X3DNurbsSurfaceGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The NurbsPatchSurface node is a contiguous NURBS surface patch.\n         */\n    \n        function (ctx) {\n            x3dom.nodeTypes.NurbsPatchSurface.superClass.call(this, ctx);\n            \n            this._needReRender = true;\n        },\n        {\n            nodeChanged: function() {\n                x3dom.nodeTypes.NurbsTrimmedSurface.prototype.nodeChanged.call(this);\n\t\t            return;\n            }\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2018 A. Plesch, Waltham, MA USA\n * Dual licensed under the MIT and GPL\n */\n /*\n * Ayam, a free 3D modeler for the RenderMan interface.\n *\n * Ayam is copyrighted 1998-2016 by Randolf Schultz\n * (randolf.schultz@gmail.com) and others.\n *\n * All rights reserved.\n *\n * See the file License for details.\n *\n */\n\n/* ### NurbsCurve ### */\nx3dom.registerNodeType(\n    \"NurbsCurve\",\n    \"NURBS\",\n    defineClass(x3dom.nodeTypes.X3DParametricGeometryNode, \n    \n        /**\n         * Constructor for NurbsCurve\n         * @constructs x3dom.nodeTypes.NurbsCurve\n         * @x3d 3.3\n         * @component NURBS\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DParametricGeometryNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The NurbsCurve node is a geometry node defining a parametric curve in 3D space.\n         */\n         \n        function (ctx) {\n            x3dom.nodeTypes.NurbsCurve.superClass.call(this, ctx);\n            \n            /**\n             * the order of the curve.\n             * @var {x3dom.fields.SFInt32} order\n             * @memberof x3dom.nodeTypes.NurbsCurve\n             * @initvalue 3\n             * @range [2, inf]\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'order', 3);\n            \n            /**\n             * knots defines the knot vector. The number of knots shall be equal to the number of control points\n             * plus the order of the curve. The order shall be non-decreasing. Within the knot vector there may not be more\n             * than order−1 consecutive knots of equal value. If the length of a knot vector is 0 or not the exact number\n             * required (numcontrolPoint + order), a default uniform knot vector is computed.\n             * @var {x3dom.fields.SFInt32} knot\n             * @memberof x3dom.nodeTypes.NurbsCurve\n             * @initvalue []\n             * @range [-inf, inf]\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFDouble(ctx, 'knot', []);\n            \n            /**\n             * controlPoint defines the X3DCoordinateNode instance that provides the source of coordinates used to control\n             * the curve or surface. Depending on the weight value and the order, this piecewise linear curve is approximated\n             * by the resulting parametric curve. The number of control points shall be equal to or greater than the order.\n             * A closed B-Spline curve can be specified by repeating the limiting control points, specifying a periodic knot vector,\n             * and setting the closed field to TRUE. If the last control point is not identical to the first or there exists a\n             * non-unitary value of weight within (order-1) control points of the seam, the closed field is ignored.\n             * @var {x3dom.fields.MFVec2d} controlPoint\n             * @memberof x3dom.nodeTypes.NurbsCurve\n             * @initvalue null\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFNode('controlPoint', x3dom.nodeTypes.X3DCoordinateNode);\n            \n            /**\n             * control point weights: P[i].w = weight[ i ]\n             * @var {x3dom.fields.MFDouble} weight\n             * @memberof x3dom.nodeTypes.NurbsCurve\n             * @initvalue []\n             * @range [0, inf]\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFDouble(ctx, 'weight', []);\n            \n            /**\n             * NYI: The tessellation field gives a hint to the curve tessellator by setting an absolute number of subdivision steps.\n             * These values shall be greater than or equal to the Order field. A value of 0 indicates that the browser choose\n             * a suitable tessellation. Interpretation of values below 0 is implementation dependent.\n             * @var {x3dom.fields.SFInt32} tessellation\n             * @memberof x3dom.nodeTypes.NurbsCurve\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'tessellation', 0); //NYI\n            \n            /**\n             * NYI: whether or not the curve is to be evaluated as a closed curve\n             * @var {x3dom.fields.SFBool} closed\n             * @memberof x3dom.nodeTypes.NurbsCurve\n             * @initvalue false\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'closed', false); //NYI\n\n            this.points = []; //MFVec3f controlPoints\n            this.uList = []; //Array of tessellated u values\n            this.basisFunsCache = {}; //N[u]\n            this.ils = new x3dom.nodeTypes.IndexedLineSet();\n            this.ils.addChild(new x3dom.nodeTypes.Coordinate());\n        },\n        {\n            nodeChanged: function() {\n                this._needReRender = true;\n                this._vf.useGeoCache = false;\n                if(!this._hasCoarseMesh){\n                    var ils = this.createCoarseILS(this);\n                    this._mesh = ils._mesh;\n                    this._hasCoarseMesh = true;\n                }\n                this.generateGeometry();\n                \n            },\n            fieldChanged: function(fieldName) {\n\t\t        //this.invalidateVolume();\n                Array.forEach(this._parentNodes, function (node) {\n                    node._dirty.positions = true;\n                    node.invalidateVolume();\n                });\n                switch (fieldName) {\n                \tcase 'tessellation': this.uList = []; break;\n                \tcase 'knot':\n                \tcase 'order':\n                \tcase 'closed': this.uList = []; this.basisFunsCache = {}; break;\n                }\n                this.generateGeometry();\n            },\n            generateGeometry: function () {\n            \tthis.points = this._cf.controlPoint.node._vf.point; \n                var points = this.points.length;\n                if (this._vf.knot.length !== points + this._vf.order) this.createDefaultKnots();\n                if (this._vf.weight.length != points) this._vf.weight = Array(points).fill(1.0);\n                var tessPoints = this.calcTessPoints(this._vf.tessellation, points);\n                if (this.uList.length == 0) this.uList = this.listPoints(tessPoints, this._vf.knot);\n                var data = this.tessellate();\n                //var ils = \n                this.createILS( data, this );\n                this._mesh = this.ils._mesh;\n                return;\n            },\n            createDefaultKnots: function () {\n                var knots = Array(this.points.length+this._vf.order).fill(0);\n                for (var k = this._vf.order;\n                    k < this.points.length; k++)\n                    knots[k]=k-1;\n                for (var k = knots.length-this._vf.order;\n                    k < knots.length; k++)\n                    knots[k]=this.points.length-1;\n                this._vf.knot = knots;\n            },\n            calcTessPoints: function(tess, controls) {\n                if (tess > 0) return tess + 1;\n                if (tess == 0) return 2 * controls + 1;\n                return -tess * controls + 1;\n            },\n            listPoints: function(points, knots) {\n                var step = knots[knots.length-1] - knots[0];\n                step = step/(points-1);\n                var list = [];\n                for(var i=0; i < points; i++) list.push(knots[0] + i*step);\n                //todo: go through knots and move nearest u if necessary\n                return list;\n            },\n            tessellate: function () {\n                var nurb = {\n                    dimension: this.points.length-1,\n                    u: this.uList,\n                    degree: this._vf.order-1,\n                    knots: this._vf.knot,\n                    points: this.points,\n                    weights: this._vf.weight,\n                    closed: this._vf.closed\n                };\n                return nurb.u.map(function(u){\n                    return this.curvePoint3DH(nurb.dimension, nurb.degree, nurb.knots, nurb.points, nurb.weights, u);\n                }, this);\n            },\n            curvePoint3DH: function (n, p, U, P, W, u) {\n                var spanu, indu, k, i;\n                var Nu, temp = [0, 0, 0, 0];\n\n                spanu = this.findSpan(n, p, u, U);\n                Nu = this.basisFuns(spanu, u, p, U);\n\n                indu = spanu - p;\n\n                for (k = 0; k <= p; k++) {\n                    i = indu+k;\n                    temp[0] += Nu[k]*P[i].x;\n                    temp[1] += Nu[k]*P[i].y;\n                    temp[2] += Nu[k]*P[i].z;\n                    temp[3] += Nu[k]*W[i];\n                }\n\n                return new x3dom.fields.SFVec3f(\n                    temp[0]/temp[3],\n                    temp[1]/temp[3],\n                    temp[2]/temp[3] );\n\t\t\t},\n            findSpan: function (n, p, u, U) {\n                var low, mid, high;\n\n                if(u >= U[n]) return n;\n                if(u <= U[p]) return p;\n\n                low = 0;\n                high = n+1;\n                mid = Math.floor((low+high)/2);\n\n                while( u < U[mid] || u >= U[mid+1] ) {\n                    if(u < U[mid]) high = mid;\n                    else low = mid;\n                    mid = Math.floor((low+high)/2);\n                }\n                return mid;\n            }, /* findSpan */\n            basisFuns: function (i, u, p, U) {\n                var uKey = Math.floor(u*10e10);\n                if (this.basisFunsCache[uKey]) return this.basisFunsCache[uKey];\n                var N = [], left = [], right = [], saved, temp;\n                var j, r;\n\n                N[0] = 1.0;\n                for(j = 0; j <= p; j++) {\n                    left[j] = 0;\n                    right[j] = 0;\n                }\n                \n                for(j = 1; j <= p; j++)\t{\n                    left[j] = u - U[i+1-j];\n                    right[j] = U[i+j] - u;\n                    saved = 0.0;\n\n                    for(r = 0; r < j; r++) {\n                        temp = N[r] / (right[r+1] + left[j-r]);\n                        N[r] = saved + right[r+1] * temp;\n                        saved = left[j-r] * temp;\n                    }\n\n                    N[j] = saved;\n                }\n                this.basisFunsCache[uKey] = N;\n\n                return N;\n            }, /* basisFuns */\n            createCoarseILS: function(node) {\n                var coordNode = node._cf.controlPoint.node;\n                var ils = new x3dom.nodeTypes.IndexedLineSet();\n                \n                ils._nameSpace = node._nameSpace;\n                var ind = [];\n                for(var i = 0; i < coordNode._vf.point.length; i++){\n                    ind.push(i);\n\t    \t    }\n\t    \t    ind.push(-1);\n                \n                ils._vf.coordIndex = ind;\n                ils.addChild(coordNode);\n                ils.nodeChanged();\n                ils._xmlNode = node._xmlNode;\n                return ils;\n            },\n            createILS: function (data, node) {\n                //var ils = new x3dom.nodeTypes.IndexedLineSet();\n                this.ils._nameSpace = node._nameSpace;\n                this.ils._vf.coordIndex = [];\n                //var co = new x3dom.nodeTypes.Coordinate();\n                var co = this.ils._cf.coord.node;\n                co._nameSpace = node._nameSpace;\n                co._vf.point = new x3dom.fields.MFVec3f();\n                for(var i = 0; i < data.length; i++) {\n                    co._vf.point.push(data[i]);\n                    this.ils._vf.coordIndex.push(i);\n                }\n                //ils.addChild(co);\n                this.ils.nodeChanged();\n                this.ils._xmlNode = node._xmlNode;\n                return this.ils;\n                } /* createILS */\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2018 A. Plesch, Waltham, MA USA\n * Dual licensed under the MIT and GPL\n */\n /*\n * Ayam, a free 3D modeler for the RenderMan interface.\n *\n * Ayam is copyrighted 1998-2016 by Randolf Schultz\n * (randolf.schultz@gmail.com) and others.\n *\n * All rights reserved.\n *\n * See the file License for details.\n *\n */\n\n/* ### NurbsPositionInterpolator ### */\nx3dom.registerNodeType(\n    \"NurbsPositionInterpolator\",\n    \"NURBS\",\n    defineClass(x3dom.nodeTypes.X3DChildNode, \n    \n        /**\n         * Constructor for NurbsPositionInterpolator\n         * @constructs x3dom.nodeTypes.NurbsPositionInterpolator\n         * @x3d 3.3\n         * @component NURBS\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DChildNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc NurbsPositionInterpolator describes a 3D NURBS curve.\n         */\n         \n        function (ctx) {\n            x3dom.nodeTypes.NurbsPositionInterpolator.superClass.call(this, ctx);\n            \n            /**\n             * the order of the curve.\n             * @var {x3dom.fields.SFInt32} order\n             * @memberof x3dom.nodeTypes.NurbsPositionInterpolator\n             * @initvalue 3\n             * @range [2, inf]\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'order', 3);\n            \n            /**\n             * knots defines the knot vector. The number of knots shall be equal to the number of control points\n             * plus the order of the curve. The order shall be non-decreasing. Within the knot vector there may not be more\n             * than order−1 consecutive knots of equal value. If the length of a knot vector is 0 or not the exact number\n             * required (numcontrolPoint + order), a default uniform knot vector is computed.\n             * @var {x3dom.fields.SFInt32} knot\n             * @memberof x3dom.nodeTypes.NurbsPositionInterpolator\n             * @initvalue []\n             * @range [-inf, inf]\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFDouble(ctx, 'knot', []);\n            \n            /**\n             * controlPoint defines the X3DCoordinateNode instance that provides the source of coordinates used to control\n             * the curve or surface. Depending on the weight value and the order, this piecewise linear curve is approximated\n             * by the resulting parametric curve. The number of control points shall be equal to or greater than the order.\n             * @var {x3dom.fields.MFVec2d} controlPoint\n             * @memberof x3dom.nodeTypes.NurbsPositionInterpolator\n             * @initvalue null\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFNode('controlPoint', x3dom.nodeTypes.X3DCoordinateNode);\n            \n            /**\n             * control point weights: P[i].w = weight[ i ]\n             * @var {x3dom.fields.MFDouble} weight\n             * @memberof x3dom.nodeTypes.NurbsPositionInterpolator\n             * @initvalue []\n             * @range [0, inf]\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFDouble(ctx, 'weight', []);\n        \n            /**\n             * The set_fraction inputOnly field receives an SFFloat event and causes the interpolator node function\n\t     * to evaluate, resulting in a value_changed output event of the specified type with the same timestamp as the set_fraction event.\n             * @var {x3dom.fields.SFFloat} set_fraction\n             * @memberof x3dom.nodeTypes.NurbsPositionInterpolator\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'set_fraction', 0);\n            \n            this.points = []; //MFVec3f controlPoints\n            //this.basisFunsCache = {}; //N[u]\n            //this evaluates the curve at set_fraction\n            //alternatively, tessellate at some degree dependant resolution and turn into linear positioninterpolator\n        },\n        {\n            fieldChanged: function(fieldName) {\n//                 switch (fieldName) {\n//                     case 'knot':\n//                     case 'order': this.basisFunsCache = {};\n//                 }\n                if(fieldName === \"set_fraction\")\n                {\n                    var value = this.getValue(this._vf.set_fraction);\n                    this.postMessage('value_changed', value);\n                }\n            },\n            getValue: function (u) {\n                this.points = this._cf.controlPoint.node._vf.point; \n                var points = this.points.length;\n                if (this._vf.knot.length !== points + this._vf.order) this.createDefaultKnots();\n                if (this._vf.weight.length != points) this._vf.weight = Array(points).fill(1.0);\n                return this.curvePoint(u);\n            },\n            createDefaultKnots: function () {\n                var points = this.points.length;\n                var knots = Array(points + this._vf.order).fill(0);\n                for (var k = this._vf.order;\n                    k < points; k++)\n                    knots[k] = (k-1) / (points-1);\n                for (var k = knots.length - this._vf.order;\n                    k < knots.length; k++)\n                    knots[k] = 1; //points-1;\n                this._vf.knot = knots;\n            },\n            curvePoint: function (u) {\n                var nurb = {\n                    dimension: this.points.length-1,\n                    degree: this._vf.order-1,\n                    knots: this._vf.knot,\n                    points: this.points,\n                    weights: this._vf.weight\n                };\n                return x3dom.nodeTypes.NurbsCurve.prototype.curvePoint3DH.call(\n                    this, nurb.dimension, nurb.degree, nurb.knots, nurb.points, nurb.weights, u);    \n            },\n            findSpan: function (n, p, u, U) {\n                return x3dom.nodeTypes.NurbsCurve.prototype.findSpan(n, p, u, U);\n            }, /* findSpan */\n            basisFuns: function (i, u, p, U) { // modified to disable cache\n                //var uKey = Math.floor(u*10e10);\n                //if (this.basisFunsCache[uKey]) return this.basisFunsCache[uKey];\n                var N = [], left = [], right = [], saved, temp;\n                var j, r;\n\n                N[0] = 1.0;\n                for(j = 0; j <= p; j++) {\n                    left[j] = 0;\n                    right[j] = 0;\n                }\n                \n                for(j = 1; j <= p; j++)\t{\n                    left[j] = u - U[i+1-j];\n                    right[j] = U[i+j] - u;\n                    saved = 0.0;\n\n                    for(r = 0; r < j; r++) {\n                        temp = N[r] / (right[r+1] + left[j-r]);\n                        N[r] = saved + right[r+1] * temp;\n                        saved = left[j-r] * temp;\n                    }\n\n                    N[j] = saved;\n                }\n                //this.basisFunsCache[uKey] = N;\n                return N;\n            } /* basisFuns */\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2018 A. Plesch, Waltham, MA USA\n * Dual licensed under the MIT and GPL\n */\n /*\n * Ayam, a free 3D modeler for the RenderMan interface.\n *\n * Ayam is copyrighted 1998-2016 by Randolf Schultz\n * (randolf.schultz@gmail.com) and others.\n *\n * All rights reserved.\n *\n * See the file License for details.\n *\n */\n\n/* ### NurbsOrientationInterpolator ### */\nx3dom.registerNodeType(\n    \"NurbsOrientationInterpolator\",\n    \"NURBS\",\n    defineClass(x3dom.nodeTypes.X3DChildNode, \n    \n        /**\n         * Constructor for NurbsOrientationInterpolator\n         * @constructs x3dom.nodeTypes.NurbsOrientationInterpolator\n         * @x3d 3.3\n         * @component NURBS\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DChildNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc NurbsOrientationInterpolator describes a 3D NURBS curve.\n         */\n         \n        function (ctx) {\n            x3dom.nodeTypes.NurbsOrientationInterpolator.superClass.call(this, ctx);\n            \n            /**\n             * the order of the curve.\n             * @var {x3dom.fields.SFInt32} order\n             * @memberof x3dom.nodeTypes.NurbsOrientationInterpolator\n             * @initvalue 3\n             * @range [2, inf]\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'order', 3);\n            \n            /**\n             * knots defines the knot vector. The number of knots shall be equal to the number of control points\n             * plus the order of the curve. The order shall be non-decreasing. Within the knot vector there may not be more\n             * than order−1 consecutive knots of equal value. If the length of a knot vector is 0 or not the exact number\n             * required (numcontrolPoint + order), a default uniform knot vector is computed.\n             * @var {x3dom.fields.SFInt32} knot\n             * @memberof x3dom.nodeTypes.NurbsOrientationInterpolator\n             * @initvalue []\n             * @range [-inf, inf]\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFDouble(ctx, 'knot', []);\n            \n            /**\n             * controlPoint defines the X3DCoordinateNode instance that provides the source of coordinates used to control\n             * the curve or surface. Depending on the weight value and the order, this piecewise linear curve is approximated\n             * by the resulting parametric curve. The number of control points shall be equal to or greater than the order.\n             * @var {x3dom.fields.MFVec2d} controlPoint\n             * @memberof x3dom.nodeTypes.NurbsOrientationInterpolator\n             * @initvalue null\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFNode('controlPoint', x3dom.nodeTypes.X3DCoordinateNode);\n            \n            /**\n             * control point weights: P[i].w = weight[ i ]\n             * @var {x3dom.fields.MFDouble} weight\n             * @memberof x3dom.nodeTypes.NurbsOrientationInterpolator\n             * @initvalue []\n             * @range [0, inf]\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFDouble(ctx, 'weight', []);\n        \n            /**\n             * The set_fraction inputOnly field receives an SFFloat event and causes the interpolator node function\n             * to evaluate, resulting in a value_changed output event of the specified type with the same timestamp as the set_fraction event.\n             * @var {x3dom.fields.SFFloat} set_fraction\n             * @memberof x3dom.nodeTypes.NurbsOrientationInterpolator\n             * @initvalue 0\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFFloat(ctx, 'set_fraction', 0);\n            \n            this.points = []; //MFVec3f controlPoints\n            this._fractionalShift = 0.01; //relative distance to adjacent point\n            this._downZ = new x3dom.fields.SFVec3f(0, 0, -1);\n            //this.basisFunsCache = {}; //N[u]\n            //this evaluates the curve at set_fraction\n            //alternatively, tessellate at some degree dependant resolution and turn into linear positioninterpolator\n        },\n        {\n            fieldChanged: function(fieldName) {\n//                 switch (fieldName) {\n//                     case 'knot':\n//                     case 'order': this.basisFunsCache = {};\n//                 }\n                if(fieldName === \"set_fraction\")\n                {\n                    var value = this.getValue(this._vf.set_fraction);\n                    this.postMessage('value_changed', value);\n                }\n            },\n            getValue: function (u) {\n                this.points = this._cf.controlPoint.node._vf.point; \n                var points = this.points.length;\n                var knot = this._vf.knot;\n                if (knot.length !== points + this._vf.order)\n                    x3dom.nodeTypes.NurbsPositionInterpolator.prototype.createDefaultKnots.call(this);\n                if (this._vf.weight.length != points)\n                    this._vf.weight = Array(points).fill(1.0);\n                var uShift = (knot[knot.length-1] - knot[0]) * this._fractionalShift;\n                var diff = this.curvePoint(u).subtract(this.curvePoint(u+uShift));\n                return x3dom.fields.Quaternion.rotateFromTo(this._downZ, diff);\n            },\n            curvePoint: function (u) {\n                return x3dom.nodeTypes.NurbsPositionInterpolator.prototype.curvePoint.call(this, u);\n            },\n            findSpan: function (n, p, u, U) {\n                return x3dom.nodeTypes.NurbsCurve.prototype.findSpan(n, p, u, U);\n            }, /* findSpan */\n            basisFuns: function (i, u, p, U) { // modified to disable cache\n                return x3dom.nodeTypes.NurbsPositionInterpolator.prototype.basisFuns(i, u, p, U);\n            } /* basisFuns */\n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2018 A. Plesch, Waltham, MA USA\n * Dual licensed under the MIT and GPL\n */\n/*\n * Ayam, a free 3D modeler for the RenderMan interface.\n *\n * Ayam is copyrighted 1998-2016 by Randolf Schultz\n * (randolf.schultz@gmail.com) and others.\n *\n * All rights reserved.\n *\n * See the file License for details.\n *\n */\n\n/* ### NurbsSurfaceInterpolator ### */\nx3dom.registerNodeType(\n    \"NurbsSurfaceInterpolator\",\n    \"NURBS\",\n    defineClass(x3dom.nodeTypes.X3DChildNode,\n\n        /**\n         * Constructor for NurbsSurfaceInterpolator\n         * @constructs x3dom.nodeTypes.NurbsSurfaceInterpolator\n         * @x3d 3.3\n         * @component NURBS\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DChildNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc NurbsPositionInterpolator describes a 3D NURBS curve.\n         */\n\n        function (ctx) {\n        x3dom.nodeTypes.NurbsSurfaceInterpolator.superClass.call(this, ctx);\n\n        /**\n         * uDimension and vDimension define the number of control points in the u and v dimensions.\n         * @var {x3dom.fields.SFInt32} uDimension\n         * @memberof x3dom.nodeTypes.X3DParametricGeometryNode\n         * @initvalue 0\n         * @range [0, inf]\n         * @field x3d\n         * @instance\n         */\n        this.addField_SFInt32(ctx, 'uDimension', 0);\n\n        /**\n         * uDimension and vDimension define the number of control points in the u and v dimensions.\n         * @var {x3dom.fields.SFInt32} vDimension\n         * @memberof x3dom.nodeTypes.X3DParametricGeometryNode\n         * @initvalue 0\n         * @range [0, inf]\n         * @field x3d\n         * @instance\n         */\n        this.addField_SFInt32(ctx, 'vDimension', 0);\n\n        /**\n         * uKnot and vKnot define the knot values of the surface in the u and v dimensions.\n         * @var {x3dom.fields.MFDouble} uKnot\n         * @memberof x3dom.nodeTypes.X3DParametricGeometryNode\n         * @initvalue []\n         * @range [-inf, inf]\n         * @field x3d\n         * @instance\n         */\n        this.addField_MFDouble(ctx, 'uKnot', []);\n\n        /**\n         * uKnot and vKnot define the knot values of the surface in the u and v dimensions.\n         * @var {x3dom.fields.MFDouble} vKnot\n         * @memberof x3dom.nodeTypes.X3DParametricGeometryNode\n         * @initvalue []\n         * @range [-inf, inf]\n         * @field x3d\n         * @instance\n         */\n        this.addField_MFDouble(ctx, 'vKnot', []);\n\n        /**\n         * uOrder and vOrder define the order of the surface in the u and v dimensions.\n         * @var {x3dom.fields.SFInt32} uOrder\n         * @memberof x3dom.nodeTypes.X3DParametricGeometryNode\n         * @initvalue 3\n         * @range [2, inf]\n         * @field x3d\n         * @instance\n         */\n        this.addField_SFInt32(ctx, 'uOrder', 3);\n\n        /**\n         * uOrder and vOrder define the order of the surface in the u and v dimensions.\n         * @var {x3dom.fields.SFInt32} vOrder\n         * @memberof x3dom.nodeTypes.X3DParametricGeometryNode\n         * @initvalue 3\n         * @range [2, inf]\n         * @field x3d\n         * @instance\n         */\n        this.addField_SFInt32(ctx, 'vOrder', 3);\n\n        /**\n         * controlPoint defines the X3DCoordinateNode instance that provides the source of coordinates used to control\n         * the curve or surface. Depending on the weight value and the order, this piecewise linear curve is approximated\n         * by the resulting parametric curve. The number of control points shall be equal to or greater than the order.\n         * @var {x3dom.fields.MFVec2d} controlPoint\n         * @memberof x3dom.nodeTypes.NurbsSurfaceInterpolator\n         * @initvalue null\n         * @field x3d\n         * @instance\n         */\n        this.addField_SFNode('controlPoint', x3dom.nodeTypes.X3DCoordinateNode);\n\n        /**\n         * control point weights: P[i].w = weight[ i ]\n         * @var {x3dom.fields.MFDouble} weight\n         * @memberof x3dom.nodeTypes.NurbsSurfaceInterpolator\n         * @initvalue []\n         * @range [0, inf]\n         * @field x3d\n         * @instance\n         */\n        this.addField_MFDouble(ctx, 'weight', []);\n\n        /**\n         * The set_fraction inputOnly field receives an SFFloat event and causes the interpolator node function\n         * to evaluate, resulting in a value_changed output event of the specified type with the same timestamp as the set_fraction event.\n         * @var {x3dom.fields.SFFloat} set_fraction\n         * @memberof x3dom.nodeTypes.NurbsSurfaceInterpolator\n         * @initvalue 0,0\n         * @field x3d\n         * @instance\n         */\n        this.addField_SFVec2f(ctx, 'set_fraction', 0, 0);\n\n        this.points = []; //MFVec3f controlPoints\n        this._fractionalShift = 0.01; //relative distance to adjacent point\n\n        //this.basisFunsCache = {}; //N[u]\n        //this evaluates the curve at set_fraction\n        //alternatively, tessellate at some degree dependant resolution and turn into linear positioninterpolator\n    }, \n    {\n        nodeChanged: function () {\n            this.points = this._cf.controlPoint.node._vf.point;\n            this.pointsLength = this.points.length;//save size in case points are shared and mofified by other node\n        },\n        fieldChanged: function (fieldName) {\n            //                 switch (fieldName) {\n            //                     case 'knot':\n            //                     case 'order': this.basisFunsCache = {};\n            //                 }\n            if (fieldName === \"set_fraction\") {\n                var value = this.getValue(this._vf.set_fraction);\n                this.postMessage('position_changed', value.position);\n                this.postMessage('normal_changed', value.normal);\n            }\n        },\n        getValue: function (uv) {\n            var u=uv.x, v=uv.y;\n            this.points = this._cf.controlPoint.node._vf.point;\n            var uKnot = this._vf.uKnot;\n            var vKnot = this._vf.vKnot;\n            if (uKnot.length !== this._vf.uDimension + this._vf.uOrder)\n                uKnot = this.createDefaultKnots(this._vf.uDimension, this._vf.uOrder);\n            if (vKnot.length !== this._vf.vDimension + this._vf.vOrder)\n                vKnot = this.createDefaultKnots(this._vf.vDimension, this._vf.vOrder);\n            if (this._vf.weight.length != this.pointsLength)\n                this._vf.weight = Array(this.pointsLength).fill(1.0);\n            var uShift = (uKnot[uKnot.length-1] - uKnot[0]) * this._fractionalShift;\n            var vShift = (vKnot[vKnot.length-1] - vKnot[0]) * this._fractionalShift;\n            var uDiff = this.surfacePoint(u+uShift, v).subtract(this.surfacePoint(u, v));\n            var vDiff = this.surfacePoint(u, v+vShift).subtract(this.surfacePoint(u, v));\n            return {\n                position: this.surfacePoint(u, v),\n                normal: uDiff.cross(vDiff).normalize()\n            }\n        },\n        createDefaultKnots: function (n, o) {\n            var knots = Array(n + o).fill(0);\n            for (var k = o;\n                k < n; k++)\n                knots[k] = (k - 1) / (n - 1);\n            for (var k = knots.length - o;\n                k < knots.length; k++)\n                knots[k] = 1; //points-1;\n            return knots;\n        },\n        surfacePoint: function (u, v) {\n            return this.surfacePoint3DH(\n                this._vf.uDimension - 1,\n                this._vf.vDimension - 1,\n                this._vf.uOrder - 1,\n                this._vf.vOrder - 1,\n                this._vf.uKnot,\n                this._vf.vKnot,\n                this.points,\n                this._vf.weight,\n                u, v\n            );\n        },\n        findSpan: function (n, p, u, U) {\n            return x3dom.nodeTypes.NurbsCurve.prototype.findSpan(n, p, u, U);          \n        }, /* findSpan */\n        basisFuns: function (i, u, p, U) { // modified to disable cache\n            return x3dom.nodeTypes.NurbsPositionInterpolator.prototype.basisFuns(i, u, p, U);\n        }, /* basisFuns */\n        surfacePoint3DH: function (n, m, p, q, U, V, P, W, u, v)\n        {\n            var spanu, spanv, indu, indv, l, k, i, j = 0;\n            var Nu, Nv, C = [], Cw = [0.0,0.0,0.0,0.0], temp = [];\n\n            spanu = this.findSpan(n, p, u, U);\n            Nu = this.basisFuns(spanu, u, p, U);\n            spanv = this.findSpan(m, q, v, V);\n            Nv = this.basisFuns(spanv, v, q, V);\n\n            indu = spanu - p;\n            for(l = 0; l <= q; l++)\n            {\n                indv = spanv - q + l;\n                for(k = 0; k < 4; k++)\n                    temp[j+k] = 0.0;\n                for(k = 0; k <= p; k++)\n                {\n                    i = indu+k+(indv*(n+1));\n                    temp[j+0] += Nu[k]*P[i].x;\n                    temp[j+1] += Nu[k]*P[i].y;\n                    temp[j+2] += Nu[k]*P[i].z;\n                    temp[j+3] += Nu[k]*W[i];\n                }\n                j += 4;\n            }\n\n            j = 0;\n            for(l = 0; l <= q; l++)\n            {\n                Cw[0] += Nv[l]*temp[j+0];\n                Cw[1] += Nv[l]*temp[j+1];\n                Cw[2] += Nv[l]*temp[j+2];\n                Cw[3] += Nv[l]*temp[j+3];\n                j += 4;\n            }\n\n            for(j = 0; j < 3; j++)\n                C[j] = Cw[j]/Cw[3];\n\n            return new x3dom.fields.SFVec3f (\n                C[0], C[1], C[2] );\n        } /* surfacePoint3DH */\n    }));\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2018 A. Plesch, Waltham, MA USA\n * Dual licensed under the MIT and GPL\n */\n /*\n * Ayam, a free 3D modeler for the RenderMan interface.\n *\n * Ayam is copyrighted 1998-2016 by Randolf Schultz\n * (randolf.schultz@gmail.com) and others.\n *\n * All rights reserved.\n *\n * See the file License for details.\n *\n */\n\n/* ### NurbsCurve2D ### */\nx3dom.registerNodeType(\n    \"NurbsCurve2D\",\n    \"NURBS\",\n    defineClass(x3dom.nodeTypes.X3DGroupingNode, //X3DNurbsControlCurveNode \n    \n        /**\n         * Constructor for NurbsCurve2D\n         * @constructs x3dom.nodeTypes.NurbsCurve2D \n         * @x3d 3.3\n         * @component NURBS\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DGroupingNode //X3DNurbsControlCurveNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The NurbsCurve2D node defines a trimming segment that is part of a trimming contour\n         *  in the u,v domain of the surface. NurbsCurve2D nodes are used as children of the Contour2D group.\n         */\n         \n        function (ctx) {\n            x3dom.nodeTypes.NurbsCurve2D.superClass.call(this, ctx);\n            \n            /**\n             * the order of the curve.\n             * @var {x3dom.fields.SFInt32} order\n             * @memberof x3dom.nodeTypes.NurbsCurve2D\n             * @initvalue 3\n             * @range [2, inf]\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFInt32(ctx, 'order', 3);\n            \n            /**\n             * the knot values of the curve.\n             * @var {x3dom.fields.SFInt32} knot\n             * @memberof x3dom.nodeTypes.NurbsCurve2D\n             * @initvalue []\n             * @range [-inf, inf]\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFDouble(ctx, 'knot', []);\n            \n            /**\n             * The 2D coordinates shall be interpreted to lie in the (u, v) coordinate space defined by the NURBS surface.\n             * @var {x3dom.fields.MFVec2d} controlPoint\n             * @memberof x3dom.nodeTypes.NurbsCurve2D\n             * @initvalue []\n             * @range [-inf, inf]\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFVec2f(ctx, 'controlPoint', []); //should be MFVec2d, was MFDouble\n            \n            /**\n             * control point weights: P[i].w = weight[ i ]\n             * @var {x3dom.fields.MFDouble} weight\n             * @memberof x3dom.nodeTypes.NurbsCurve2D\n             * @initvalue []\n             * @range [0, inf]\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFDouble(ctx, 'weight', []);\n            \n            /**\n             * NYI: whether or not the curve is to be evaluated as a closed curve\n             * @var {x3dom.fields.SFBool} closed\n             * @memberof x3dom.nodeTypes.NurbsCurve2D\n             * @initvalue false\n             * @field x3d\n             * @instance\n             */\n            this.addField_SFBool(ctx, 'closed', false); //NYI\n\t    }, { }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2018 A. Plesch, Waltham, MA USA\n * Dual licensed under the MIT and GPL\n */\n /*\n * Ayam, a free 3D modeler for the RenderMan interface.\n *\n * Ayam is copyrighted 1998-2016 by Randolf Schultz\n * (randolf.schultz@gmail.com) and others.\n *\n * All rights reserved.\n *\n * See the file License for details.\n *\n */\n\n/* ### NurbsTrimmedSurface ### */\nx3dom.registerNodeType(\n    \"NurbsTrimmedSurface\",\n    \"NURBS\",\n    defineClass(x3dom.nodeTypes.X3DNurbsSurfaceGeometryNode, //NurbsPatchSurface\n        \n        /**\n         * Constructor for NurbsTrimmedSurface\n         * @constructs x3dom.nodeTypes.NurbsTrimmedSurface\n         * @x3d 3.3\n         * @component NURBS\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DNurbsSurfaceGeometryNode //NurbsPatchSurface\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The NurbsTrimmedSurface node defines a NURBS surface that is trimmed by a set of trimming loops.\n         */\n         \n        function (ctx) {\n            x3dom.nodeTypes.NurbsTrimmedSurface.superClass.call(this, ctx);\n            \n            /**\n             * The trimmingContour field, if specified, shall contain a set of Contour2D nodes. Trimming loops shall be processed\n             * as described for the Contour2D node. If no trimming contours are defined, the NurbsTrimmedSurface node shall have\n             * the same semantics as the NurbsPatchSurface node.\n             * @var {x3dom.fields.MFNode} trimmingContour\n             * @memberof x3dom.nodeTypes.NurbsTrimmedSurface\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFNode('trimmingContour', x3dom.nodeTypes.Contour2D);\n            \n            this._needReRender = true;\n        },\n        {\n            \n        }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2018 A. Plesch, Waltham, MA USA\n * Dual licensed under the MIT and GPL\n */\n /*\n * Ayam, a free 3D modeler for the RenderMan interface.\n *\n * Ayam is copyrighted 1998-2016 by Randolf Schultz\n * (randolf.schultz@gmail.com) and others.\n *\n * All rights reserved.\n *\n * See the file License for details.\n *\n */\n\n/* ### ContourPolyline2D ### */\nx3dom.registerNodeType(\n    \"ContourPolyline2D\",\n    \"NURBS\",\n    defineClass(x3dom.nodeTypes.X3DGroupingNode, //X3DNurbsControlCurveNode \n    \n        /**\n         * Constructor for ContourPolyline2D\n         * @constructs x3dom.nodeTypes.ContourPolyline2D \n         * @x3d 3.3\n         * @component NURBS\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DGroupingNode //X3DNurbsControlCurveNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The ContourPolyline2D node defines a piecewise linear curve segment as a part of a \n         *  trimming contour in the u,v domain of a surface.\n         */\n         \n        function (ctx) {\n            x3dom.nodeTypes.ContourPolyline2D.superClass.call(this, ctx);\n            \n            /**\n             * The 2D coordinates shall be interpreted to lie in the (u, v) coordinate space defined by the NURBS surface.\n             * @var {x3dom.fields.MFVec2d} controlPoint\n             * @memberof x3dom.nodeTypes.ContourPolyline2D\n             * @initvalue []\n             * @range [-inf, inf]\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFVec2f(ctx, 'controlPoint', []); //should be MFVec2d\n\t    }, { }\n    )\n);\n\n/** @namespace x3dom.nodeTypes */\n/*\n * X3DOM JavaScript Library\n * http://www.x3dom.org\n *\n * (C)2018 A. Plesch, Waltham, MA USA\n * Dual licensed under the MIT and GPL\n */\n /*\n * Ayam, a free 3D modeler for the RenderMan interface.\n *\n * Ayam is copyrighted 1998-2016 by Randolf Schultz\n * (randolf.schultz@gmail.com) and others.\n *\n * All rights reserved.\n *\n * See the file License for details.\n *\n */\n\n/* ### Contour2D ### */\nx3dom.registerNodeType(\n    \"Contour2D\",\n    \"NURBS\",\n    defineClass(x3dom.nodeTypes.X3DGroupingNode, //X3DNode\n    \n        /**\n         * Constructor for Contour2D\n         * @constructs x3dom.nodeTypes.Contour2D \n         * @x3d 3.3\n         * @component NURBS\n         * @status experimental\n         * @extends x3dom.nodeTypes.X3DGroupingNode //X3DNode\n         * @param {Object} [ctx=null] - context object, containing initial settings like namespace\n         * @classdesc The Contour2D node groups a set of curve segments to a composite contour. The children form a closed loop.\n         *  The 2D coordinates used by the node shall be interpreted to lie in the (u, v) coordinate space defined by the NURBS surface.\n         */\n         \n        function (ctx) {\n            x3dom.nodeTypes.Contour2D.superClass.call(this, ctx);\n            \n            /**\n             * The children shall form a closed loop with the first point of the first child repeated as the last point\n             * of the last child and the last point of a segment repeated as the first point of the consecutive one.\n             * The segments shall be defined by concrete nodes that implement the X3DNurbsControlCurveNode abstract type nodes\n             * and shall be enumerated in the child field in consecutive order according to the topology of the contour.\n             * @var {x3dom.fields.MFNode} children\n             * @memberof x3dom.nodeTypes.Contour2D\n             * @initvalue []\n             * @field x3d\n             * @instance\n             */\n            this.addField_MFNode('children', x3dom.nodeTypes.X3DChildNode);//X3DNurbsControlCurveNode\n\t      }, { }\n    )\n);\n\n/*\n * Ayam, a free 3D modeler for the RenderMan interface.\n *\n * Ayam is copyrighted 1998-2016 by Randolf Schultz\n * (randolf.schultz@gmail.com) and others.\n *\n * All rights reserved.\n *\n * See the file License for details.\n *\n */\n\n/* NURBS for x3dom */\n\n//importScripts('x3dom-nurbs-tess.js');\n\n//encapsulate scope\n\n(function () {\n\nx3dom.tessWorkerScript = URL.createObjectURL(new Blob(['('+tessWorker.toString()+')()'], {type: 'application/javascript'}));\n\n//wrapper\n\nfunction tessWorker() {\n  \nonmessage = function(e) {\n    if (e.data[11]) { // always the case\n      basisFunsCache = e.data[11];\n    } else {\n      basisFunsCache = new Map();\n    }\n    var tess = new Tessellator(e.data);\n    if(e.data[12] && e.data[12].length){\n        tess.deform();\n    }\n    else {\n        tess.adjustThresholds(e.data[8], e.data[9]);\n        if(e.data[10] && e.data[10].length){\n            tess.initTrims();\n        } else {\n        tess.tloops = null;\n        }\n        tess.tessellate();\n    }\n\n    if(tess.have_transferables){\n        var indices = new Uint32Array(tess.indices.length);\n        for(var i = 0; i < tess.indices.length; i++)\n            indices[i] = tess.indices[i];\n        postMessage(indices.buffer, [indices.buffer]);\n        var coords = new Float64Array(tess.coordinates.length);\n        for(var i = 0; i < tess.coordinates.length; i++)\n            coords[i] = tess.coordinates[i];\n        postMessage(coords.buffer, [coords.buffer]);\n        var tcoords = new Float64Array(tess.texcoords.length);\n        for(var i = 0; i < tess.texcoords.length; i++)\n            tcoords[i] = tess.texcoords[i];\n        postMessage(tcoords.buffer, [tcoords.buffer]);\n    } else {\n        postMessage([tess.indices, tess.coordinates, tess.texcoords, basisFunsCache, tess.uv, e.data[13]]);\n    }\n    close();//deprecated?\n}\n\n/*\n  The tessellator is based on idea and example code from\n  A. J. Chung and A. J. Field \n  \"A Simple Recursive Tessellator for Adaptive Surface Triangulation\"\n  in Journal of Graphics Tools Vol. 5, Iss. 3, 2000,\n  (https://sourceforge.net/projects/emvise/).\n*/\n\nfunction findSpan(n, p, u, U)\n{\n var low, mid, high;\n\n  if(u >= U[n])\n    return n;\n\n  if(u <= U[p])\n    return p;\n\n  low = 0;\n  high = n+1;\n  mid = Math.floor((low+high)/2);\n\n  while(u < U[mid] || u >= U[mid+1])\n    {\n      if(u < U[mid])\n\thigh = mid;\n      else\n\tlow = mid;\n\n      mid = Math.floor((low+high)/2);\n    }\n\n return mid;\n} /* findSpan */\n\n\nfunction basisFuns(i, u, p, U)\n{\n //AP: add cache\n var uHash = Object.values(U).toString()+Math.floor(u*10e10);\n if (basisFunsCache.has(uHash)) return basisFunsCache.get(uHash);\n var N = [], left = [], right = [], saved, temp;\n var j, r;\n\n  N[0] = 1.0;\n  for(j = 0; j <= p; j++) {\n      left[j] = 0;\n      right[j] = 0;\n  }\n  for(j = 1; j <= p; j++)\n    {\n      left[j] = u - U[i+1-j];\n      right[j] = U[i+j] - u;\n      saved = 0.0;\n\n      for(r = 0; r < j; r++)\n\t{\n\t  temp = N[r] / (right[r+1] + left[j-r]);\n\t  N[r] = saved + right[r+1] * temp;\n\t  saved = left[j-r] * temp;\n\t}\n\n      N[j] = saved;\n    }\n basisFunsCache.set(uHash, N);\n return N;\n} /* basisFuns */\n\n\nfunction surfacePoint3DH(n, m, p, q, U, V, P, W, u, v)\n{\n var spanu, spanv, indu, indv, l, k, i, j = 0;\n var Nu, Nv, C = [], Cw = [0.0,0.0,0.0,0.0], temp = [];\n\n  spanu = findSpan(n, p, u, U);\n  Nu = basisFuns(spanu, u, p, U);\n  spanv = findSpan(m, q, v, V);\n  Nv = basisFuns(spanv, v, q, V);\n\n  indu = spanu - p;\n  for(l = 0; l <= q; l++)\n    {\n      indv = spanv - q + l;\n      for(k = 0; k < 4; k++)\n\t  temp[j+k] = 0.0;\n      for(k = 0; k <= p; k++)\n\t{\n\t  i = indu+k+(indv*(n+1));\n\t  temp[j+0] += Nu[k]*P[i].x;\n\t  temp[j+1] += Nu[k]*P[i].y;\n\t  temp[j+2] += Nu[k]*P[i].z;\n\t  temp[j+3] += Nu[k]*W[i];\n\t}\n      j += 4;\n    }\n\n  j = 0;\n  for(l = 0; l <= q; l++)\n    {\n      Cw[0] += Nv[l]*temp[j+0];\n      Cw[1] += Nv[l]*temp[j+1];\n      Cw[2] += Nv[l]*temp[j+2];\n      Cw[3] += Nv[l]*temp[j+3];\n      j += 4;\n    }\n\n  for(j = 0; j < 3; j++)\n    C[j] = Cw[j]/Cw[3];\n\n return C;\n} /* surfacePoint3DH */\n\n\nfunction surfacePoint3D(n, m, p, q, U, V, P, u, v)\n{\n var spanu, spanv, indu, indv, l, k, i, j = 0;\n var Nu, Nv, C = [0.0, 0.0, 0.0], temp = [];\n\n  spanu = findSpan(n, p, u, U);\n  Nu = basisFuns(spanu, u, p, U);\n  spanv = findSpan(m, q, v, V);\n  Nv = basisFuns(spanv, v, q, V);\n\n  indu = spanu - p;\n  for(l = 0; l <= q; l++)\n    {\n      indv = spanv - q + l;\n      temp[j+0] = 0.0;\n      temp[j+1] = 0.0;\n      temp[j+2] = 0.0;\n      for(k = 0; k <= p; k++)\n\t{\n\t  i = indu+k+(indv*(n+1));\n\t  temp[j+0] += Nu[k]*P[i].x;\n\t  temp[j+1] += Nu[k]*P[i].y;\n\t  temp[j+2] += Nu[k]*P[i].z;\n\t}\n      j += 3;\n    }\n\n  j = 0;\n  for(l = 0; l <= q; l++)\n    {\n      C[0] += Nv[l]*temp[j+0];\n      C[1] += Nv[l]*temp[j+1];\n      C[2] += Nv[l]*temp[j+2];\n      j += 3;\n    }\n\n return C;\n} /* surfacePoint3D */\n\n\nfunction curvePoint2DH(n, p, U, P, W, u)\n{\n  var span, j, k;\n  //var N, Cw = [0.0, 0.0, 0.0], C = [];\n  var N = [], Cw0 = 0.0, Cw1 = 0.0, Cw2 = 0.0;\n\n  span = findSpan(n, p, u, U);\n  N = basisFuns(span, u, p, U);\n\n  for(j = 0; j <= p; j++)\n    {\n      k = (span-p+j); // for MFVec2f: (span-p+j)\n      Cw0 += N[j]*P[k].x; // for MFVec2f: P.x\n      Cw1 += N[j]*P[k].y; // for MFVec2f: P.y\n      Cw2 += N[j]*W[k]; // for MFVec2f: k\n    }\n\n  return [Cw0/Cw2, Cw1/Cw2];\n} /* curvePoint2DH */\n\n\nfunction curvePoint2D(n, p, U, P, u)\n{\n  var span, j, k;\n  var N = [], C0 = 0.0, C1 = 0.0;\n\n  span = findSpan(n, p, u, U);\n  N = basisFuns(span, u, p, U);\n\n  for(j = 0; j <= p; j++)\n    {\n      k = (span-p+j); // for MFVec2f: see above\n      C0 += N[j]*P[k].x;\n      C1 += N[j]*P[k].y;\n    }\n\n return [C0, C1];\n} /* curvePoint2D */\n\n\nfunction Tessellator(nurb) {\n    this.bbox_split = 4.0; //5.0; default tessellation density\n    this.use_objectspace = true;\n    this.edge_thresh = 0.1;\n    this.trim_thresh = 0.1;\n    this.split_bias = 0.5;\n    this.skew_thresh = 0.01;\n    this.max_rec = 5;\n\n    this.w = nurb[0];\n    this.h = nurb[1];\n    this.p = nurb[2];\n    this.q = nurb[3];\n    this.U = nurb[4];\n    this.V = nurb[5];\n    this.P = nurb[6];\n    this.W = nurb[7];\n    \n    this.tloops = nurb[10];\n    this.useUV = nurb[12];\n    \n    this.surfaceHash = [];\n    this.indexHash = [];\n    this.curveHash = null;\n    this.coordinates = [];\n    this.texcoords = [];\n    this.indices = [];\n    this.uv = [];\n    this.coordIndex = 0;\n    \n    this.deform = function () { // for animation without remeshing\n        this.useUV.forEach(function(uv){\n            this.computeSurface(uv, false);\n        }, this);\n        //this.uv = this.useUV;\n    }\n\n    this.tessellate = function () {\n\tif(this.W && this.W.length != (this.w+1)*(this.h+1))\n\t    this.W = {};\n\t// TODO: find multiple control points/internal knots and add initial\n\t// triangles for them to make sure those important surface features\n\t// (hard edges) are preserved\n\tvar u0 = this.U[this.p];\n\tvar u1 = this.U[this.U.length-this.p-1];\n\tvar u05 = (u0+u1)*0.5;\n\tvar v0 = this.V[this.q];\n\tvar v1 = this.V[this.V.length-this.q-1];\n\tvar v05 = (v0+v1)*0.5;\n\tthis.tessTri([[u0,v0],[u0,v05],[u05,v0]]);\n\tthis.tessTri([[u0,v05],[u05,v05],[u05,v0]]);\n\tthis.tessTri([[u0,v05],[u0,v1],[u05,v05]]);\n\tthis.tessTri([[u0,v1],[u05,v1],[u05,v05]]);\n\tthis.tessTri([[u05,v0],[u05,v05],[u1,v0]]);\n\tthis.tessTri([[u05,v05],[u1,v05],[u1,v0]]);\n\tthis.tessTri([[u05,v05],[u05,v1],[u1,v05]]);\n\tthis.tessTri([[u05,v1],[u1,v1],[u1,v05]]);\n    } // tesselate\n\n    /* Adapt thresholds to current NURBS configuration. */\n    this.adjustThresholds = function (uparam, vparam) {\n\tif(uparam < 0) {\n\t    this.use_objectspace = false;\n\t    if(vparam >= 0.0)\n\t\tvparam = uparam;\n\t    var ul = 2.0/(this.w+1);\n\t    var vl = 2.0/(this.h+1);\n\t    ul *= (this.U[this.U.length-this.p-1] - this.U[this.p]);\n\t    vl *= (this.V[this.V.length-this.q-1] - this.V[this.q]);\n\t    this.edge_thresh_u = -uparam*ul;\n\t    this.edge_thresh_v = -vparam*vl;\n\t} else {\n\t    var mi = Number.MAX_VALUE;\n\t    var mx = -Number.MAX_VALUE;\n\t    var bb = [mi,mi,mi,mx,mx,mx];\n\t    for(var i = 0; i < this.P.length; i++) {\n\t\tif(this.P[i].x < bb[0]) bb[0] = this.P[i].x;\n\t\tif(this.P[i].y < bb[1]) bb[1] = this.P[i].y;\n\t\tif(this.P[i].z < bb[2]) bb[2] = this.P[i].z;\n\t\tif(this.P[i].x > bb[3]) bb[3] = this.P[i].x;\n\t\tif(this.P[i].y > bb[4]) bb[4] = this.P[i].y;\n\t\tif(this.P[i].z > bb[5]) bb[5] = this.P[i].z;\n\t    }\n\t    var ex = Math.sqrt((bb[0]-bb[3])*(bb[0]-bb[3])+\n\t\t\t       (bb[1]-bb[4])*(bb[1]-bb[4])+\n\t\t\t       (bb[2]-bb[5])*(bb[2]-bb[5]))/this.bbox_split;\n\t    if(uparam <= 10e-6)\n\t\tuparam = 1.0;\n\t    this.edge_thresh *= ex * uparam;\n\t    this.trim_thresh *= ex * uparam;\n\t}\n    } // adjustThresholds\n\n    this.tessTri = function (tri) {\n\tvar work = [tri];\n\twhile(work.length) {\n\t    var cur = work.splice(0, 1);\n\t    var pieces = this.refineTri(cur[0]);\n\t    work = pieces.concat(work);\n\t}\n    } // tessTri\n\n    this.refineTri = function (tri) {\n\t// 0 cull entire triangle?\n\tif(this.tloops && this.inOut(tri) < 0)\n\t    return [];\n\n\t// 1 measure triangle degeneracy\n\n\t// area of triangle\n\tvar area = tri[0][0]*tri[1][1] - tri[1][0]*tri[0][1] +\n\t           tri[1][0]*tri[2][1] - tri[2][0]*tri[1][1] +\n\t           tri[2][0]*tri[0][1] - tri[0][0]*tri[2][1];\n\tif(area < 0)\n\t    area = -area;\n\n\t// calc sum of squares of edge lengths\n\tvar a = [], b = [];\n\ta[0] = tri[0][0] - tri[1][0];\n\ta[1] = tri[0][1] - tri[1][1];\n\tvar max_ed = a[0]*a[0] + a[1]*a[1];\n\ta[0] = tri[1][0] - tri[2][0];\n\ta[1] = tri[1][1] - tri[2][1];\n\tmax_ed += a[0]*a[0] + a[1]*a[1];\n\ta[0] = tri[2][0] - tri[0][0];\n\ta[1] = tri[2][1] - tri[0][1];\n\tmax_ed += a[0]*a[0] + a[1]*a[1];\n\n\tarea /= max_ed;\n\tif(area <= this.skew_thresh) {\n\t    // triangle is skewed => dice rather than split edges\n\t    this.diceTri(tri);\n\t    return [];\n\t}\n\n\t// 2 split edges\n\n\tvar eds = [];\n\tmax_ed = 0.0;\n\tfor(var i = 0; i < 3; i++) {\n\t    var j0 = (i+1)%3;\n\t    var j1 = (i+2)%3;\n\t    a = tri[j0];\n\t    b = tri[j1];\n\t    eds[i] = this.splitEdge(a, b);\n\t    if (eds[i] > max_ed)\n\t\tmax_ed = eds[i];\n\t}\n\n\tmax_ed *= this.split_bias;\n\n\tvar m = [], mv = [], co = 0;\n\tfor(var i = 0; i < 3; i++) {\n\t    var j0 = (i+1)%3;\n\t    var j1 = (i+2)%3;\n\n\t    if((eds[i] > this.edge_thresh) && (eds[i] >= max_ed)) {\n\t\tco++;\n\t\tmv[i] = [];\n\t\tmv[i][0] = 0.5*(tri[j0][0] + tri[j1][0]);\n\t\tmv[i][1] = 0.5*(tri[j0][1] + tri[j1][1]);\n\t\tm[i] = i - 3;\n\t    } else {\n\t\t// move midpt to vertex closer to center\n\t\tif(eds[j0] > eds[j1]) {\n\t\t    mv[i] = tri[j0];\n\t\t    m[i] = j0;\n\t\t} else {\n\t\t    mv[i] = tri[j1];\n\t\t    m[i] = j1;\n\t\t}\n\t    }\n\t}\n\tvar res = [];\n\tif(co) {\n\t    // add one for center tile\n\t    co++;\n\n\t    // corner tiles\n\t    var j = co;\n\t    for(var i = 0; i < 3; i++) {\n\t\tvar j0 = (i+1)%3;\n\t\tvar j1 = (i+2)%3;\n\t\tif((m[j1] != i) && (m[j0] != i)) {\n\t\t    res[--j] = [tri[i], mv[j1], mv[j0]];\n\t\t}\n\t    }\n\n\t    // center tile\n\t    if(j) {\n\t\tif ((m[0]==m[1]) || (m[1]==m[2]) || (m[2]==m[0])) {\n\t\t    // avoid degenerate center tile\n\t\t    return [];\n\t\t}\n\t\tres[0] = [mv[0], mv[1], mv[2]];\n\t    }\n\t    return res;\n\t}\n\t/* check disabled, because the curvature check in splitEdge()\n\t   already does enough */\n/*\n\telse if (this.splitCenter( mv )) {\n\t    // no edges split; add vertex to center and do a simple dice?\n\t    var c = [];\n\t    c[0] = (tri[0][0] + tri[1][0] + tri[2][0])/3.0;\n\t    c[1] = (tri[0][1] + tri[1][1] + tri[2][1])/3.0;\n\n\t    for(var i = 0; i < 3; i++) {\n\t\tres[i] = [tri[i], tri[(i+1)%3], c];\n\t    }\n\n\t    return res;\n\t}\n*/\n\tthis.trimFinal(tri);\n\n\treturn [];\n    } // refineTri\n\n    /* Refine a triangle around a middle point. */\n    this.diceTri = function (tri) {\n\t// pick a central point\n\tvar cv = [];\n\tcv[0] = (tri[0][0] + tri[1][0] + tri[2][0])/3.0;\n\tcv[1] = (tri[0][1] + tri[1][1] + tri[2][1])/3.0;\n\tthis.computeSurface(cv);\n\tfor(var ed = 0; ed < 3; ed++) {\n\t    var divs = [], d = [];\n\t    var e1 = (ed+1)%3;\n\n\t    d[0] = tri[e1][0] - tri[ed][0];\n\t    d[1] = tri[e1][1] - tri[ed][1];\n\n\t    divs[0] = 1.0;\n\t    var beg = 0.0;\n\t    while(divs.length) {\n\t\tvar a = [], b = [];\n\t\tvar end = divs[0];\n\t\ta[0] = tri[ed][0] + d[0]*beg;\n\t\ta[1] = tri[ed][1] + d[1]*beg;\n\t\tb[0] = tri[ed][0] + d[0]*end;\n\t\tb[1] = tri[ed][1] + d[1]*end;\n\t\tif (this.splitEdge(a, b) > this.edge_thresh) {\n\t\t    // split edge\n\t\t    divs.splice(0, 0, 0.5*(beg+end));\n\t\t} else {\n\t\t    // render it\n\t\t    this.computeSurface(a);\n\t\t    this.computeSurface(b);\n\t\t    var slice = [cv, a, b];\n\t\t    this.trimFinal(slice);\n\t\t    divs.splice(0, 1);\n\t\t    beg = end;\n\t\t}\n\t    }\n\t}\n    } /* diceTri */\n\n  /* Compute a point on the NURBS surface. */\n  this.computeSurface = function(uv, nooutput) {\n    // first try the hash\n    var indu = Math.floor(uv[0]*10e10);\n    var indv = Math.floor(uv[1]*10e10);\n    if(this.surfaceHash[indu]) {\n        var memoizedPoint = this.surfaceHash[indu][indv];\n        if(memoizedPoint)\n      return memoizedPoint;\n    }\n    // hash lookup failed, compute the point\n    var pnt;\n    if(Object.keys(this.W).length) {\n        pnt = surfacePoint3DH(this.w, this.h, this.p, this.q,\n            this.U, this.V, this.P, this.W,\n            uv[0], uv[1]);\n    } else {\n        pnt = surfacePoint3D(this.w, this.h, this.p, this.q,\n           this.U, this.V, this.P,\n           uv[0], uv[1]);\n    }\n\n    // do not memoize this point whilst tesselating trim curves\n    if(this.curveHash)\n        return pnt;\n\n    // memoize pnt\n    if(!this.surfaceHash[indu])\n        this.surfaceHash[indu] = [];\n    this.surfaceHash[indu][indv] = pnt;\n\n    // do not output this point whilst checking edge curvature\n    if(nooutput)\n        return pnt;\n\n    if(!this.indexHash[indu])\n        this.indexHash[indu] = [];\n    this.indexHash[indu][indv] = this.coordIndex;\n    this.coordIndex++;\n    this.coordinates.push(pnt);\n    this.texcoords.push([uv[0],uv[1]]);\n    //output uv in same order\n    this.uv.push(uv);\n    return pnt;\n  } /* computeSurface */\n\n  /* Compute a point on a trim curve. */\n  this.computeCurve = function(loop, seg, u) {\n    // first try the hash\n    var indu = Math.floor(u*10e10);\n    if(this.curveHash[loop][seg]) {\n        var memoizedPoint = this.curveHash[loop][seg][indu];\n        if(memoizedPoint)\n      return memoizedPoint;\n    }\n    // hash lookup failed, compute the point\n    var pnt, crv = this.tloops[loop][seg];\n    if(crv[4] && crv[4].length) {\n        pnt = curvePoint2DH(crv[0], crv[1], crv[2], crv[3], crv[4], u);\n    } else {\n        pnt = curvePoint2D(crv[0], crv[1], crv[2], crv[3], u);\n    }\n    // memoize pnt\n    if(!this.curveHash[loop][seg])\n        this.curveHash[loop][seg] = [];\n    this.curveHash[loop][seg][indu] = pnt;\n    return pnt;\n    } /* computeCurve */\n\n    /* Decide if an edge should be split;\n       must be commutative to avoid cracks. */\n    this.splitEdge = function (a, b) {\n\tvar pa = this.computeSurface(a);\n\tvar pb = this.computeSurface(b);\n\tif(!this.use_objectspace) {\n\t    var dist = Math.sqrt((a[0]-b[0])*(a[0]-b[0])/this.edge_thresh_u+\n\t\t\t\t (a[1]-b[1])*(a[1]-b[1])/this.edge_thresh_v);\n\t    return dist;\n\t}\n\n\tif(Math.abs(pa[0]-pb[0]) > 10e-6 ||\n\t   Math.abs(pa[1]-pb[1]) > 10e-6 ||\n\t   Math.abs(pa[2]-pb[2]) > 10e-6) {\n\t    var lab = Math.sqrt((pa[0]-pb[0])*(pa[0]-pb[0])+\n\t\t\t\t(pa[1]-pb[1])*(pa[1]-pb[1])+\n\t\t\t\t(pa[2]-pb[2])*(pa[2]-pb[2]));\n\t    if(lab < this.edge_thresh) {\n\t\t// check for curvy region by computing the middle between\n\t\t// a and b and see how the distances a-b and a-m-b compare\n\t\tvar m = [a[0]+(b[0]-a[0])*0.5,a[1]+(b[1]-a[1])*0.5];\n\t\tvar pm = this.computeSurface(m, false);\n\t\tvar lamb = 0.0;\n\t\tif(Math.abs(pa[0]-pm[0]) > 10e-6 ||\n\t\t   Math.abs(pa[1]-pm[1]) > 10e-6 ||\n\t\t   Math.abs(pa[2]-pm[2]) > 10e-6) {\n\t\t    lamb += Math.sqrt((pa[0]-pm[0])*(pa[0]-pm[0])+\n\t\t\t\t      (pa[1]-pm[1])*(pa[1]-pm[1])+\n\t\t\t\t      (pa[2]-pm[2])*(pa[2]-pm[2]))\n\t\t}\n\t\tif(Math.abs(pb[0]-pm[0]) > 10e-6 ||\n\t\t   Math.abs(pb[1]-pm[1]) > 10e-6 ||\n\t\t   Math.abs(pb[2]-pm[2]) > 10e-6) {\n\t\t    lamb += Math.sqrt((pb[0]-pm[0])*(pb[0]-pm[0])+\n\t\t\t\t      (pb[1]-pm[1])*(pb[1]-pm[1])+\n\t\t\t\t      (pb[2]-pm[2])*(pb[2]-pm[2]))\n\t\t}\n\t\tif(lamb > lab*1.01)\n\t\t    lab += lamb;\n\t    }\n\t    return lab;\n\t}\n\telse\n\t    return 0.0;\n    } // splitEdge\n\n    /* To avoid missing high frequency detail (e.g. spikes in functions)\n       should all three edges fall below the split threshold, this function\n       is called to determine if the triangle should be split by adding\n       a vertex to its center. An interval bound on the function over the\n       domain of the triangle is one possible implementation. */\n    this.splitCenter = function (tri) {\n\tvar cv = [];\n\tthis.curveHash = [];\n\tcv[0] = (tri[0][0] + tri[1][0] + tri[2][0])/3.0;\n\tcv[1] = (tri[0][1] + tri[1][1] + tri[2][1])/3.0;\n\tvar ed = 0.0;\n\tfor(var i = 0; i < 3; i++)\n\t    ed += this.splitEdge(tri[i], cv);\n\tthis.curveHash = null;\n\tif(ed*0.5 > this.edge_thresh){\n\t    this.computeSurface(cv);\n\t    return true;\n\t}\n\treturn false;\n    } // splitCenter\n\n    /* Render the refined tile once all edges match the acceptance criteria. */\n    this.renderFinal = function (tri) {\n\tfor(var i = 0; i < 3; i++) {\n\t    var uv = tri[i];\n\t    var indu = Math.floor(uv[0]*10e10);\n\t    var indv = Math.floor(uv[1]*10e10);\n\t    if(this.indexHash[indu])\n\t\tthis.indices.push(this.indexHash[indu][indv]);\n\t}\n    } // renderFinal\n\n    /* Find true intersection of line segment with trims. */\n    this.intersectTrim = function (p1, p2, prev) {\n\tvar sl = 0, ss = 0;\n\tif(prev){\n\t    sl = prev[2];\n\t    ss = prev[3]+1;\n\t}\n\tfor(var ilp = sl; ilp < this.ttloops.length; ilp++) {\n\t    var lp = this.ttloops[ilp];\n\t    // TODO: add bbox test for speedup?\n\t    for(var k = ss; k < lp.length-1; k++ ) {\n\t\tvar p3 = lp[k];\n\t\tvar p4 = lp[k+1];\n\n\t\tif(((Math.abs(p1[0]-p3[0])<10e-6) &&\n\t\t    (Math.abs(p1[1]-p3[1])<10e-6)) ||\n\t\t   ((Math.abs(p1[0]-p4[0])<10e-6) &&\n\t\t    (Math.abs(p1[1]-p4[1])<10e-6)))\n\t\t    return [];\n\t\t//continue;\n\n\t\tif(((Math.abs(p2[0]-p3[0])<10e-6) &&\n\t\t    (Math.abs(p2[1]-p3[1])<10e-6)) ||\n\t\t   ((Math.abs(p2[0]-p4[0])<10e-6) &&\n\t\t    (Math.abs(p2[1]-p4[1])<10e-6)))\n\t\t    return [];\n\t\t//continue;\n\n\t\tvar den = ((p2[0]-p1[0])*(p4[1]-p3[1]) -\n\t\t\t   (p2[1]-p1[1])*(p4[0]-p3[0]));\n\n\t\tif(Math.abs(den) < 10e-6) {\n\t\t    continue;\n\t\t}\n\n\t\tvar r = ((p1[1]-p3[1])*(p4[0]-p3[0]) -\n\t\t\t (p1[0]-p3[0])*(p4[1]-p3[1]))/den;\n\n\t\tif((r < 10e-6) || (r > (1.0-10e-6)))\n\t\t    continue;\n\n\t\tvar s = ((p1[1]-p3[1])*(p2[0]-p1[0]) -\n\t\t\t (p1[0]-p3[0])*(p2[1]-p1[1]))/den;\n\n\t\tif((s < 10e-6) || (s > (1.0-10e-6)))\n\t\t    continue;\n\n\t\treturn [p1[0]+r*(p2[0]-p1[0]), p1[1]+r*(p2[1]-p1[1]), ilp, k];\n\t    }\n\t    if(prev)\n\t\treturn [];\n\t}\n\treturn [];\n    } // intersectTrim\n\n    /* Render four triangles created by a trim loop entering _and_ leaving\n       on one triangle edge. */\n    this.renderDiced = function (p0, p1, p2, tm, ip0, ip1) {\n\tvar ip0s = ip0;\n\tvar ip1s = ip1;\n\tif(((p0[0]-ip0[0])*(p0[0]-ip0[0])+(p0[1]-ip0[1])*(p0[1]-ip0[1])) >\n\t   ((p0[0]-ip1[0])*(p0[0]-ip1[0])+(p0[1]-ip1[1])*(p0[1]-ip1[1]))) {\n\t    ip0s = ip1;\n\t    ip1s = ip0;\n\t}\n\tthis.renderFinal([p0,tm,p2]);\n\tthis.renderFinal([p0,ip0s,tm]);\n\tthis.renderFinal([p1,p2,tm]);\n\tthis.renderFinal([p1,tm,ip1s]);\n    } // renderDiced\n\n    /* Render a triangle with a complex trim pattern (all edges have\n       valid intersections with the trim loops), the triangle is\n       basically just subdivided via the intersection points. */\n    this.renderComplex = function (tri, ip0, ip1, ip2) {\n\t// it is safe to use diceTri() since we only get here with\n\t// triangles that already meet the edge_thresh criterion so that\n\t// diceTri() will never split one of the edges => no cracks\n\tthis.diceTri([tri[0],ip0,ip2]);\n\tthis.diceTri([ip0,tri[1],ip1]);\n\tthis.diceTri([ip0,ip1,ip2]);\n\tthis.diceTri([ip2,ip1,tri[2]]);\n    } // renderComplex\n\n    /* Render a trimmed tile. */\n    this.renderTrimmed = function (tri) {\n\tvar t = 0.3;\n\tvar ip0 = this.intersectTrim(tri[0], tri[1]);\n\tvar ip1 = this.intersectTrim(tri[1], tri[2]);\n\tvar ip2 = this.intersectTrim(tri[2], tri[0]);\n\tvar len = (ip0.length>0)+(ip1.length>0)+(ip2.length>0);\n\tif(len == 1) {\n\t    var ip = [ip0,ip1,ip2];\n\t    // check loop touching triangle point\n\t    for(var i = 0; i < 3; i++)\n\t\tif(ip[i].length) {\n\t\t    if(((Math.abs(tri[i][0]-ip[i][0])<10e-6) &&\n\t\t\t(Math.abs(tri[i][1]-ip[i][1])<10e-6)) ||\n\t\t       ((Math.abs(tri[(i+1)%3][0]-ip[i][0])<10e-6) &&\n\t\t\t(Math.abs(tri[(i+1)%3][1]-ip[i][1])<10e-6))) {\n\t\t\tthis.renderFinal(tri);\n\t\t\treturn;\n\t\t    }\n\t\t}\n\t    // check loop entering and leaving on the same edge\n\t    if(ip0.length) {\n\t\tvar ip01 = this.intersectTrim(tri[0], tri[1], ip0);\n\t\tif(ip01.length) {\n\t\t    var tm = this.ttloops[ip01[2]][ip01[3]];\n\t\t    this.computeSurface(tm);\n\t\t    this.computeSurface(ip0);\n\t\t    this.computeSurface(ip01);\n\t\t    if(this.inOut([tri[2],\n\t[tri[2][0]+(tri[1][0]-tri[2][0])*t,tri[2][1]+(tri[1][1]-tri[2][1])*t],\n   [tri[2][0]+(tri[0][0]-tri[2][0])*t,tri[2][1]+(tri[0][1]-tri[2][1])*t]])> 0){\n\t\t\tthis.renderDiced(tri[0],tri[1],tri[2],tm,ip0,ip01);\n\t\t    } else {\n\t\t\tthis.renderFinal([ip0,tm,ip01]);\n\t\t    }\n\t\t    return;\n\t\t}\n\t    } else if(ip1.length) {\n\t\tvar ip11 = this.intersectTrim(tri[1], tri[2], ip1);\n\t\tif(ip11.length) {\n\t\t    var tm = this.ttloops[ip11[2]][ip11[3]];\n\t\t    this.computeSurface(tm);\n\t\t    this.computeSurface(ip1);\n\t\t    this.computeSurface(ip11);\n\t\t    if(this.inOut([tri[0],\n\t[tri[0][0]+(tri[1][0]-tri[0][0])*t,tri[0][1]+(tri[1][1]-tri[0][1])*t],\n   [tri[0][0]+(tri[2][0]-tri[0][0])*t,tri[0][1]+(tri[2][1]-tri[0][1])*t]])> 0){\n\t\t\tthis.renderDiced(tri[1],tri[2],tri[0],tm,ip1,ip11);\n\t\t    } else {\n\t\t\tthis.renderFinal([ip1,tm,ip11]);\n\t\t    }\n\t\t    return;\n\t\t}\n\t    } else if(ip2.length) {\n\t\tvar ip21 = this.intersectTrim(tri[2], tri[0], ip2);\n\t\tif(ip21.length) {\n\t\t    var tm = this.ttloops[ip21[2]][ip21[3]];\n\t\t    this.computeSurface(tm);\n\t\t    this.computeSurface(ip2);\n\t\t    this.computeSurface(ip21);\n\t\t    if(this.inOut([tri[1],\n\t[tri[1][0]+(tri[0][0]-tri[1][0])*t,tri[1][1]+(tri[0][1]-tri[1][1])*t],\n   [tri[1][0]+(tri[2][0]-tri[1][0])*t,tri[1][1]+(tri[2][1]-tri[1][1])*t]])> 0){\n\t\t\tthis.renderDiced(tri[2],tri[0],tri[1],tm,ip2,ip21);\n\t\t    } else {\n\t\t\tthis.renderFinal([ip2,tm,ip21]);\n\t\t    }\n\t\t    return;\n\t\t}\n\t    }\n\t    if(this.max_rec) {\n\t\tthis.max_rec--;\n\t\tthis.diceTri(tri);\n\t\tthis.max_rec++;\n\t\treturn;\n\t    }\n\t} /* if len == 1 */\n\n\tif(len != 2) {\n\t    // no intersection or complex intersection (all edges)\n\t    if(len == 3) {\n\t\tthis.renderComplex(tri, ip0, ip1, ip2);\n\t\treturn;\n\t    } else {\n\t\tvar out = 0;\n\t\tif(this.inOut([tri[0],\n\t[tri[0][0]+(tri[1][0]-tri[0][0])*t,tri[0][1]+(tri[1][1]-tri[0][1])*t],\n   [tri[0][0]+(tri[2][0]-tri[0][0])*t,tri[0][1]+(tri[2][1]-tri[0][1])*t]]) < 0)\n\t\t    out++;\n\t\tif(this.inOut([tri[1],\n\t[tri[1][0]+(tri[0][0]-tri[1][0])*t,tri[1][1]+(tri[0][1]-tri[1][1])*t],\n   [tri[1][0]+(tri[2][0]-tri[1][0])*t,tri[1][1]+(tri[2][1]-tri[1][1])*t]]) < 0)\n\t\t    out++;\n\t\tif(this.inOut([tri[2],\n\t[tri[2][0]+(tri[1][0]-tri[2][0])*t,tri[2][1]+(tri[1][1]-tri[2][1])*t],\n   [tri[2][0]+(tri[0][0]-tri[2][0])*t,tri[2][1]+(tri[0][1]-tri[2][1])*t]]) < 0)\n\t\t    out++;\n\t\tif(out > 0) {\n\t\t    return;\n\t\t}\n\t\tthis.renderFinal(tri);\n\t    }\n\t} else {\n\t    // len is 2 => simple intersection on two edges, split tri\n\t    if(!ip0.length) {\n\t\t// ip1 and ip2 are valid\n\t\tthis.computeSurface(ip1);\n\t\tthis.computeSurface(ip2);\n\t\tif(this.inOut([tri[2],\n\t[tri[2][0]+(ip2[0]-tri[2][0])*t,tri[2][1]+(ip2[1]-tri[2][1])*t],\n   [tri[2][0]+(ip1[0]-tri[2][0])*t,tri[2][1]+(ip1[1]-tri[2][1])*t]]) <= 0) {\n\t\t    // tri[2] is outside\n\t\t    this.renderFinal([tri[0], ip1, ip2]);\n\t\t    this.renderFinal([tri[0], tri[1], ip1]);\n\t\t} else {\n\t\t    // tri[2] is inside\n\t\t    this.renderFinal([tri[2], ip2, ip1]);\n\t\t}\n\t    } else {\n\t\tif(!ip1.length) {\n\t\t    // ip0 and ip2 are valid\n\t\t    this.computeSurface(ip0);\n\t\t    this.computeSurface(ip2);\n\t\t    if(this.inOut([tri[0],\n\t[tri[0][0]+(ip2[0]-tri[0][0])*t,tri[0][1]+(ip2[1]-tri[0][1])*t],\n   [tri[0][0]+(ip0[0]-tri[0][0])*t,tri[0][1]+(ip0[1]-tri[0][1])*t]]) <= 0) {\n\t\t\t// tri[0] is outside\n\t\t\tthis.renderFinal([tri[1], ip2, ip0]);\n\t\t\tthis.renderFinal([tri[1], tri[2], ip2]);\n\t\t    } else {\n\t\t\t// tri[0] is inside\n\t\t\tthis.renderFinal([tri[0], ip0, ip2]);\n\t\t    }\n\t\t} else {\n\t\t    // ip0 and ip1 are valid\n\t\t    this.computeSurface(ip0);\n\t\t    this.computeSurface(ip1);\n\t\t    if(this.inOut([tri[1],\n\t[tri[1][0]+(ip0[0]-tri[1][0])*t,tri[1][1]+(ip0[1]-tri[1][1])*t],\n   [tri[1][0]+(ip1[0]-tri[1][0])*t,tri[1][1]+(ip1[1]-tri[1][1])*t]]) <= 0) {\n\t\t\t// tri[1] is outside\n\t\t\tthis.renderFinal([tri[0], ip0, ip1]);\n\t\t\tthis.renderFinal([tri[0], ip1, tri[2]]);\n\t\t    } else {\n\t\t\t// tri[1] is inside\n\t\t\tthis.renderFinal([tri[1], ip1, ip0]);\n\t\t    }\n\t\t}\n\t    }\n\t} // len is 2\n\treturn;\n    } // renderTrimmed\n\n    this.inOut = function (tri) {\n\tvar a = [], ad = [];\n\n\t// counters for intersections\n\tvar cl = []; // less\n\tvar cg = []; // greater\n\tvar ndx = [];\n\n\tfor(var i = 0; i < 3; i++) {\n\t    a[i] = [];\n\t    var va = tri[i];\n\t    var vb = tri[(i+1)%3];\n\n\t    // make line equation for edge\n\t    a[i][0] = va[1] - vb[1];\n\t    a[i][1] = vb[0] - va[0];\n\t    ad[i] = a[i][0]*va[0] + a[i][1]*va[1];\n\n\t    cl[i] = cg[i] = 0;\n\t    ndx[i] = (Math.abs(a[i][0]) > Math.abs(a[i][1])) ? 1 : 0;\n\t}\n\n\tfor(var ilp = 0; ilp < this.ttloops.length; ilp++) {\n\t    var lp = this.ttloops[ilp];\n\t    // TODO: add bbox test for speedup?\n\t    for(var k = 0; k < lp.length-1; k++ ) {\n\t\tvar p0 = lp[k];\n\t\tvar p1 = lp[k+1];\n\t\tvar ni = 0;\n\t\tfor(var i = 0; i < 3; i++) {\n\t\t    var d0 = p0[0]*a[i][0] + p0[1]*a[i][1] - ad[i];\n\t\t    var d1 = p1[0]*a[i][0] + p1[1]*a[i][1] - ad[i];\n\n\t\t    ni += (d0<0) ? 1 : -1;\n\n\t\t    if((d0<0) ? (d1<0) : (d1>=0))\n\t\t\tcontinue; // no intersection\n\n\t\t    // find intersection point\n\t\t    var ip = (p1[ndx[i]]*d0 - p0[ndx[i]]*d1) / (d0-d1);\n\n\t\t    var ba = ip<tri[i][ndx[i]];\n\t\t    var bb = ip<tri[(i+1)%3][ndx[i]];\n\t\t    if(ba && bb) {\n\t\t\tcl[i]++;\n\t\t    } else {\n\t\t\tif(!(ba || bb)) {\n\t\t\t    cg[i]++;\n\t\t\t} else {\n\t\t\t    return 0;\n\t\t\t}\n\t\t    }\n\t\t}\n\t\t// point inside tile\n\t\tif((ni == 3) || (ni == -3))\n\t\t    return 0;\n\t    }\n\t}\n\n\tif((cl[0]&1) && (cl[1]&1) && (cl[2]&1)) return 1;\n\tif( !((cl[0]&1) || (cl[1]&1) || (cl[2]&1)) ) return -1;\n\n\treturn 0;\n    } // inOut\n\n    /*\n      Function to decide if straight edge approximation of the trim curve\n      should be refined more.  A default function using\n      splitEdge() is provided but can be overridden by the user\n    */\n    this.refineTrim = function (loop, u1, u2) {\n\tvar pa = this.computeCurve(loop, Math.floor(u1), u1);\n\tvar pb = this.computeCurve(loop, Math.floor(u2), u2);\n\treturn (this.splitEdge(pa, pb) > this.edge_thresh);\n    }\n\n    /* Construct straight edged approximation of the trimming curves */\n    this.initTrims = function ( ) {\n\tthis.ttloops = [];\n\tthis.curveHash = [];\n\tvar edt = this.edge_thresh;\n\tthis.edge_thresh = this.trim_thresh;\n\tfor(var ilp = 0; ilp < this.tloops.length; ilp++) {\n\t    var lp = this.tloops[ilp];\n\t    this.curveHash[ilp] = [];\n\t    this.ttloops[ilp] = [];\n\t    var ttus = [];\n\t    var pnts = [];\n\t    var ue;\n\t    // sample trim segments at every distinct knot\n\t    for(var j = 0; j < lp.length; j++) {\n\t\tvar U = lp[j][2];\n\n\t\t// rewrite knots to form a continuous range over the loop;\n\t\t// this way, we can derive the segment from u: Math.floor(u)\n\t\tvar uf = 1.0/(U[U.length-1]-U[0]);\n\t\tif(Math.abs(1.0-uf) > 10e-12)\n\t\t    for(var i = 0; i < U.length; i++)\n\t\t\tU[i] = (U[i]*uf);\n\t\tvar ud = U[0]-j;\n\t\tif(Math.abs(ud) > 10e-12)\n\t\t    for(var i = 0; i < U.length; i++)\n\t\t\tU[i] = (U[i]-ud);\n\n\t\tvar ui = lp[j][1];//p\n\t\tvar u = U[ui];//U[p]\n\t\tue = U[(U.length-ui-1)];//U[Ulen-p-1]\n\t\twhile(u < ue) {\n\t\t    this.ttloops[ilp].push(this.computeCurve(ilp, j, u));\n\t\t    ttus.push(u);\n\t\t    ui++;\n\t\t    while(Math.abs(u-U[ui]) < 10e-6)\n\t\t\tui++;\n\t\t    u = U[ui];\n\t\t}\n\t    }\n\n\t    // refine trim edges\n\t    var tlp = this.ttloops[ilp];\n\n\t    var x = 0;\n\t    while(x < tlp.length) {\n\t\tvar p0u = ttus[x];\n\t\tvar p0seg = Math.floor(p0u);\n\t\tvar y = x+1;\n\t\tif(y == tlp.length) {\n\t\t    y = 0;\n\t\t}\n\t\tvar p1u = ttus[y];\n\n\t\tif(lp[p0seg][1] > 1 && this.refineTrim(ilp, p0u, p1u)) {\n\t\t    // split edge\n\t\t    var um;\n\t\t    if(y == 0) {\n\t\t\tum = 0.5 * (p0u + ue);\n\t\t\ty = x+1;\n\t\t    } else {\n\t\t\tum = 0.5 * (p0u + p1u);\n\t\t    }\n\t\t    var v = this.computeCurve(ilp, p0seg, um);\n\t\t    tlp.splice(y, 0, v)\n\t\t    ttus.splice(y, 0, um);\n\t\t} else {\n\t\t    // proceed to next edge\n\t\t    if(y == 0)\n\t\t\tbreak;\n\t\t    x = y;\n\t\t}\n\t    } // foreach edge\n\t    // close loop\n\t    tlp.push(tlp[0]);\n\t} // foreach loop\n\tthis.curveHash = null;\n\tthis.edge_thresh = edt;\n    } // initTrims\n\n    this.trimFinal = function (tri) {\n\tif(this.tloops) {\n\t    if(this.inOut(tri) >= 0) {\n\t\tthis.renderTrimmed(tri);\n\t\treturn;\n\t    } else {\n\t\t// can not trust inOut(), i.e. we do get here with triangles\n\t\t// that should have been classified as \"trimmed\", see if this\n\t\t// is the case...\n\t\tvar t = 0.3;\n\t\tvar out = 0;\n\t\tif(this.inOut([tri[0],\n\t[tri[0][0]+(tri[1][0]-tri[0][0])*t,tri[0][1]+(tri[1][1]-tri[0][1])*t],\n   [tri[0][0]+(tri[2][0]-tri[0][0])*t,tri[0][1]+(tri[2][1]-tri[0][1])*t]]) < 0)\n\t\t    out++;\n\t\tif(this.inOut([tri[1],\n\t[tri[1][0]+(tri[0][0]-tri[1][0])*t,tri[1][1]+(tri[0][1]-tri[1][1])*t],\n   [tri[1][0]+(tri[2][0]-tri[1][0])*t,tri[1][1]+(tri[2][1]-tri[1][1])*t]]) < 0)\n\t\t    out++;\n\t\tif(this.inOut([tri[2],\n\t[tri[2][0]+(tri[1][0]-tri[2][0])*t,tri[2][1]+(tri[1][1]-tri[2][1])*t],\n   [tri[2][0]+(tri[0][0]-tri[2][0])*t,tri[2][1]+(tri[0][1]-tri[2][1])*t]]) < 0)\n\t\t    out++;\n\t\tif(out > 0) {\n\t\t    // TODO: or call into renderTrimmed()?\n\t\t    //this.renderTrimmed(tri);\n\t\t    return;\n\t\t}\n\t    }\n\t}\n\tthis.renderFinal(tri);\n    } // trimFinal\n} /* Tessellator */\n\n} /* wrapper */\n\t\n})(); /* anonymous encapsulation */\n\n/*\n * Ayam, a free 3D modeler for the RenderMan interface.\n *\n * Ayam is copyrighted 1998-2016 by Randolf Schultz\n * (randolf.schultz@gmail.com) and others.\n *\n * All rights reserved.\n *\n * See the file License for details.\n *\n */\n\n/* NURBS for x3dom */\n\n\nx3dom.WorkerPool = function (size) {\n    var _this = this;\n    this.taskQueue = [];\n    this.workerQueue = [];\n    this.poolSize = size;\n\n    this.init = function() {\n        // create 'size' number of worker threads\n        for (var i = 0 ; i < this.poolSize ; i++) {\n            _this.workerQueue.push(new x3dom.WorkerThread(_this));\n        }\n    } // init\n\n    this.addWorkerTask = function(workerTask) {\n        if (_this.workerQueue.length > 0) {\n            // use the free worker from the front of the queue\n            var workerThread = _this.workerQueue.shift();\n            workerThread.run(workerTask);\n        } else {\n            // no free workers\n            _this.taskQueue.push(workerTask);\n        }\n    } // addWorkerTask\n\n    this.freeWorkerThread = function(workerThread) {\n        if (_this.taskQueue.length > 0) {\n            // don't put back in queue, but execute next task\n            var workerTask = _this.taskQueue.shift();\n\t    if(workerTask.discard)\n\t\treturn this.freeWorkerThread(workerThread);\n            workerThread.run(workerTask);\n        } else {\n            _this.workerQueue.push(workerThread);\n        }\n    } // freeWorkerThread\n}; /* WorkerPool */\n\nx3dom.WorkerThread = function (workerPool) {\n    var _this = this;\n    this.workerPool = workerPool;\n    this.workerTask = {};\n\n    this.run = function(workerTask) {\n        _this.workerTask = workerTask;\n        var worker = new Worker(workerTask.script);\n        worker.caller = workerTask.caller;\n        worker.onmessage = function(e) {\n\t    _this.workerTask.callback(e);\n\t    _this.workerPool.freeWorkerThread(_this);\n\t}\n        worker.postMessage(workerTask.startMessage);\n    } // run\n}; /* WorkerThread */\n\nx3dom.WorkerTask = function (script, caller, callback, msg) {\n    this.script = script;\n    this.caller = caller;\n    this.callback = callback;\n    this.startMessage = msg;\n};\n\n\n(function () {\n    var poolSize = 1;\n    if (navigator.hardwareConcurrency) { //IE\n        poolSize = Math.max(1, navigator.hardwareConcurrency - 1);\n    }\n    x3dom.tessWorkerPool = new x3dom.WorkerPool(poolSize);\n    x3dom.tessWorkerPool.init();\n})();\n\n\n\nx3dom.versionInfo = {\n    version:  '1.8.1',\n    revision: '0c742a1a981f8c0a9cbb7059f36c3a6c4cb9fec6',\n    date:     'Fri Sep 27 18:22:15 2019 +0200'\n};\n\n\nx3dom.versionInfo = {\n    version:  '1.8.1',\n    revision: '0c742a1a981f8c0a9cbb7059f36c3a6c4cb9fec6',\n    date:     'Fri Sep 27 18:22:15 2019 +0200'\n};\n\n","function setCameraBinding(element) {\n  document.getElementById(element).setAttribute('set_bind', 'true');\n}\n\nfunction resetViewpoint(x) {\n  document.getElementById('x3d').runtime.resetView();\n  var orthoViewpoints = document.getElementById(\"x3d\").getElementsByTagName(\"OrthoViewpoint\");\n  for (var i=0; i<orthoViewpoints.length; i++){\n    if (document.getElementById(\"x3d\").getElementsByTagName(\"OrthoViewpoint\")[i].id === 'viewpointOben'){\n      document.getElementById(\"x3d\").getElementsByTagName(\"OrthoViewpoint\")[i].setFieldValue('position', {x: 0, y: (x), z: 0});\n      document.getElementById(\"x3d\").getElementsByTagName(\"OrthoViewpoint\")[i].setFieldValue('fieldOfView', [(-x*0.4), (-x*0.4), (x*0.4), (x*0.4)]);\n\n    }else if(document.getElementById(\"x3d\").getElementsByTagName(\"OrthoViewpoint\")[i].id === 'viewpointLinks'){\n      document.getElementById(\"x3d\").getElementsByTagName(\"OrthoViewpoint\")[i].setFieldValue('position', {x: -x, y: 0, z: 0});\n      document.getElementById(\"x3d\").getElementsByTagName(\"OrthoViewpoint\")[i].setFieldValue('fieldOfView', [(-x*0.4), (-x*0.4), (x*0.4), (x*0.4)]);\n\n    }else if(document.getElementById(\"x3d\").getElementsByTagName(\"OrthoViewpoint\")[i].id === 'viewpointFront'){\n        document.getElementById(\"x3d\").getElementsByTagName(\"OrthoViewpoint\")[i].setFieldValue('position', {x: 0, y: 0, z: x});\n        document.getElementById(\"x3d\").getElementsByTagName(\"OrthoViewpoint\")[i].setFieldValue('fieldOfView', [(-x*0.4), (-x*0.4), (x*0.4), (x*0.4)]);\n    }else{\n      document.getElementById(\"x3d\").getElementsByTagName(\"OrthoViewpoint\")[i].setFieldValue('position', {x: -x, y: 0.3*x, z: x});\n      document.getElementById(\"x3d\").getElementsByTagName(\"OrthoViewpoint\")[i].setFieldValue('fieldOfView', [(-x*0.4), (-x*0.4), (x*0.4), (x*0.4)]);\n      // document.getElementById(\"x3d\").getElementsByTagName(\"OrthoViewpoint\")[i].setFieldValue('fieldOfView', [(-x*1.3), (-y*4/5), (x), (y*2)]);\n    }\n  }\n}\n","/*!\n * Bootstrap v3.3.6 (http://getbootstrap.com)\n * Copyright 2011-2015 Twitter, Inc.\n * Licensed under the MIT license\n */\n\nif (typeof jQuery === 'undefined') {\n  throw new Error('Bootstrap\\'s JavaScript requires jQuery')\n}\n\n+function ($) {\n  'use strict';\n  var version = $.fn.jquery.split(' ')[0].split('.')\n  if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 2)) {\n    throw new Error('Bootstrap\\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3')\n  }\n}(jQuery);\n\n/* ========================================================================\n * Bootstrap: transition.js v3.3.6\n * http://getbootstrap.com/javascript/#transitions\n * ========================================================================\n * Copyright 2011-2015 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * ======================================================================== */\n\n\n+function ($) {\n  'use strict';\n\n  // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)\n  // ============================================================\n\n  function transitionEnd() {\n    var el = document.createElement('bootstrap')\n\n    var transEndEventNames = {\n      WebkitTransition : 'webkitTransitionEnd',\n      MozTransition    : 'transitionend',\n      OTransition      : 'oTransitionEnd otransitionend',\n      transition       : 'transitionend'\n    }\n\n    for (var name in transEndEventNames) {\n      if (el.style[name] !== undefined) {\n        return { end: transEndEventNames[name] }\n      }\n    }\n\n    return false // explicit for ie8 (  ._.)\n  }\n\n  // http://blog.alexmaccaw.com/css-transitions\n  $.fn.emulateTransitionEnd = function (duration) {\n    var called = false\n    var $el = this\n    $(this).one('bsTransitionEnd', function () { called = true })\n    var callback = function () { if (!called) $($el).trigger($.support.transition.end) }\n    setTimeout(callback, duration)\n    return this\n  }\n\n  $(function () {\n    $.support.transition = transitionEnd()\n\n    if (!$.support.transition) return\n\n    $.event.special.bsTransitionEnd = {\n      bindType: $.support.transition.end,\n      delegateType: $.support.transition.end,\n      handle: function (e) {\n        if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)\n      }\n    }\n  })\n\n}(jQuery);\n\n/* ========================================================================\n * Bootstrap: alert.js v3.3.6\n * http://getbootstrap.com/javascript/#alerts\n * ========================================================================\n * Copyright 2011-2015 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * ======================================================================== */\n\n\n+function ($) {\n  'use strict';\n\n  // ALERT CLASS DEFINITION\n  // ======================\n\n  var dismiss = '[data-dismiss=\"alert\"]'\n  var Alert   = function (el) {\n    $(el).on('click', dismiss, this.close)\n  }\n\n  Alert.VERSION = '3.3.6'\n\n  Alert.TRANSITION_DURATION = 150\n\n  Alert.prototype.close = function (e) {\n    var $this    = $(this)\n    var selector = $this.attr('data-target')\n\n    if (!selector) {\n      selector = $this.attr('href')\n      selector = selector && selector.replace(/.*(?=#[^\\s]*$)/, '') // strip for ie7\n    }\n\n    var $parent = $(selector)\n\n    if (e) e.preventDefault()\n\n    if (!$parent.length) {\n      $parent = $this.closest('.alert')\n    }\n\n    $parent.trigger(e = $.Event('close.bs.alert'))\n\n    if (e.isDefaultPrevented()) return\n\n    $parent.removeClass('in')\n\n    function removeElement() {\n      // detach from parent, fire event then clean up data\n      $parent.detach().trigger('closed.bs.alert').remove()\n    }\n\n    $.support.transition && $parent.hasClass('fade') ?\n      $parent\n        .one('bsTransitionEnd', removeElement)\n        .emulateTransitionEnd(Alert.TRANSITION_DURATION) :\n      removeElement()\n  }\n\n\n  // ALERT PLUGIN DEFINITION\n  // =======================\n\n  function Plugin(option) {\n    return this.each(function () {\n      var $this = $(this)\n      var data  = $this.data('bs.alert')\n\n      if (!data) $this.data('bs.alert', (data = new Alert(this)))\n      if (typeof option == 'string') data[option].call($this)\n    })\n  }\n\n  var old = $.fn.alert\n\n  $.fn.alert             = Plugin\n  $.fn.alert.Constructor = Alert\n\n\n  // ALERT NO CONFLICT\n  // =================\n\n  $.fn.alert.noConflict = function () {\n    $.fn.alert = old\n    return this\n  }\n\n\n  // ALERT DATA-API\n  // ==============\n\n  $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)\n\n}(jQuery);\n\n/* ========================================================================\n * Bootstrap: button.js v3.3.6\n * http://getbootstrap.com/javascript/#buttons\n * ========================================================================\n * Copyright 2011-2015 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * ======================================================================== */\n\n\n+function ($) {\n  'use strict';\n\n  // BUTTON PUBLIC CLASS DEFINITION\n  // ==============================\n\n  var Button = function (element, options) {\n    this.$element  = $(element)\n    this.options   = $.extend({}, Button.DEFAULTS, options)\n    this.isLoading = false\n  }\n\n  Button.VERSION  = '3.3.6'\n\n  Button.DEFAULTS = {\n    loadingText: 'loading...'\n  }\n\n  Button.prototype.setState = function (state) {\n    var d    = 'disabled'\n    var $el  = this.$element\n    var val  = $el.is('input') ? 'val' : 'html'\n    var data = $el.data()\n\n    state += 'Text'\n\n    if (data.resetText == null) $el.data('resetText', $el[val]())\n\n    // push to event loop to allow forms to submit\n    setTimeout($.proxy(function () {\n      $el[val](data[state] == null ? this.options[state] : data[state])\n\n      if (state == 'loadingText') {\n        this.isLoading = true\n        $el.addClass(d).attr(d, d)\n      } else if (this.isLoading) {\n        this.isLoading = false\n        $el.removeClass(d).removeAttr(d)\n      }\n    }, this), 0)\n  }\n\n  Button.prototype.toggle = function () {\n    var changed = true\n    var $parent = this.$element.closest('[data-toggle=\"buttons\"]')\n\n    if ($parent.length) {\n      var $input = this.$element.find('input')\n      if ($input.prop('type') == 'radio') {\n        if ($input.prop('checked')) changed = false\n        $parent.find('.active').removeClass('active')\n        this.$element.addClass('active')\n      } else if ($input.prop('type') == 'checkbox') {\n        if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false\n        this.$element.toggleClass('active')\n      }\n      $input.prop('checked', this.$element.hasClass('active'))\n      if (changed) $input.trigger('change')\n    } else {\n      this.$element.attr('aria-pressed', !this.$element.hasClass('active'))\n      this.$element.toggleClass('active')\n    }\n  }\n\n\n  // BUTTON PLUGIN DEFINITION\n  // ========================\n\n  function Plugin(option) {\n    return this.each(function () {\n      var $this   = $(this)\n      var data    = $this.data('bs.button')\n      var options = typeof option == 'object' && option\n\n      if (!data) $this.data('bs.button', (data = new Button(this, options)))\n\n      if (option == 'toggle') data.toggle()\n      else if (option) data.setState(option)\n    })\n  }\n\n  var old = $.fn.button\n\n  $.fn.button             = Plugin\n  $.fn.button.Constructor = Button\n\n\n  // BUTTON NO CONFLICT\n  // ==================\n\n  $.fn.button.noConflict = function () {\n    $.fn.button = old\n    return this\n  }\n\n\n  // BUTTON DATA-API\n  // ===============\n\n  $(document)\n    .on('click.bs.button.data-api', '[data-toggle^=\"button\"]', function (e) {\n      var $btn = $(e.target)\n      if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')\n      Plugin.call($btn, 'toggle')\n      if (!($(e.target).is('input[type=\"radio\"]') || $(e.target).is('input[type=\"checkbox\"]'))) e.preventDefault()\n    })\n    .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^=\"button\"]', function (e) {\n      $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type))\n    })\n\n}(jQuery);\n\n/* ========================================================================\n * Bootstrap: carousel.js v3.3.6\n * http://getbootstrap.com/javascript/#carousel\n * ========================================================================\n * Copyright 2011-2015 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * ======================================================================== */\n\n\n+function ($) {\n  'use strict';\n\n  // CAROUSEL CLASS DEFINITION\n  // =========================\n\n  var Carousel = function (element, options) {\n    this.$element    = $(element)\n    this.$indicators = this.$element.find('.carousel-indicators')\n    this.options     = options\n    this.paused      = null\n    this.sliding     = null\n    this.interval    = null\n    this.$active     = null\n    this.$items      = null\n\n    this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this))\n\n    this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element\n      .on('mouseenter.bs.carousel', $.proxy(this.pause, this))\n      .on('mouseleave.bs.carousel', $.proxy(this.cycle, this))\n  }\n\n  Carousel.VERSION  = '3.3.6'\n\n  Carousel.TRANSITION_DURATION = 600\n\n  Carousel.DEFAULTS = {\n    interval: 5000,\n    pause: 'hover',\n    wrap: true,\n    keyboard: true\n  }\n\n  Carousel.prototype.keydown = function (e) {\n    if (/input|textarea/i.test(e.target.tagName)) return\n    switch (e.which) {\n      case 37: this.prev(); break\n      case 39: this.next(); break\n      default: return\n    }\n\n    e.preventDefault()\n  }\n\n  Carousel.prototype.cycle = function (e) {\n    e || (this.paused = false)\n\n    this.interval && clearInterval(this.interval)\n\n    this.options.interval\n      && !this.paused\n      && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))\n\n    return this\n  }\n\n  Carousel.prototype.getItemIndex = function (item) {\n    this.$items = item.parent().children('.item')\n    return this.$items.index(item || this.$active)\n  }\n\n  Carousel.prototype.getItemForDirection = function (direction, active) {\n    var activeIndex = this.getItemIndex(active)\n    var willWrap = (direction == 'prev' && activeIndex === 0)\n                || (direction == 'next' && activeIndex == (this.$items.length - 1))\n    if (willWrap && !this.options.wrap) return active\n    var delta = direction == 'prev' ? -1 : 1\n    var itemIndex = (activeIndex + delta) % this.$items.length\n    return this.$items.eq(itemIndex)\n  }\n\n  Carousel.prototype.to = function (pos) {\n    var that        = this\n    var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active'))\n\n    if (pos > (this.$items.length - 1) || pos < 0) return\n\n    if (this.sliding)       return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, \"slid\"\n    if (activeIndex == pos) return this.pause().cycle()\n\n    return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos))\n  }\n\n  Carousel.prototype.pause = function (e) {\n    e || (this.paused = true)\n\n    if (this.$element.find('.next, .prev').length && $.support.transition) {\n      this.$element.trigger($.support.transition.end)\n      this.cycle(true)\n    }\n\n    this.interval = clearInterval(this.interval)\n\n    return this\n  }\n\n  Carousel.prototype.next = function () {\n    if (this.sliding) return\n    return this.slide('next')\n  }\n\n  Carousel.prototype.prev = function () {\n    if (this.sliding) return\n    return this.slide('prev')\n  }\n\n  Carousel.prototype.slide = function (type, next) {\n    var $active   = this.$element.find('.item.active')\n    var $next     = next || this.getItemForDirection(type, $active)\n    var isCycling = this.interval\n    var direction = type == 'next' ? 'left' : 'right'\n    var that      = this\n\n    if ($next.hasClass('active')) return (this.sliding = false)\n\n    var relatedTarget = $next[0]\n    var slideEvent = $.Event('slide.bs.carousel', {\n      relatedTarget: relatedTarget,\n      direction: direction\n    })\n    this.$element.trigger(slideEvent)\n    if (slideEvent.isDefaultPrevented()) return\n\n    this.sliding = true\n\n    isCycling && this.pause()\n\n    if (this.$indicators.length) {\n      this.$indicators.find('.active').removeClass('active')\n      var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)])\n      $nextIndicator && $nextIndicator.addClass('active')\n    }\n\n    var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, \"slid\"\n    if ($.support.transition && this.$element.hasClass('slide')) {\n      $next.addClass(type)\n      $next[0].offsetWidth // force reflow\n      $active.addClass(direction)\n      $next.addClass(direction)\n      $active\n        .one('bsTransitionEnd', function () {\n          $next.removeClass([type, direction].join(' ')).addClass('active')\n          $active.removeClass(['active', direction].join(' '))\n          that.sliding = false\n          setTimeout(function () {\n            that.$element.trigger(slidEvent)\n          }, 0)\n        })\n        .emulateTransitionEnd(Carousel.TRANSITION_DURATION)\n    } else {\n      $active.removeClass('active')\n      $next.addClass('active')\n      this.sliding = false\n      this.$element.trigger(slidEvent)\n    }\n\n    isCycling && this.cycle()\n\n    return this\n  }\n\n\n  // CAROUSEL PLUGIN DEFINITION\n  // ==========================\n\n  function Plugin(option) {\n    return this.each(function () {\n      var $this   = $(this)\n      var data    = $this.data('bs.carousel')\n      var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)\n      var action  = typeof option == 'string' ? option : options.slide\n\n      if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))\n      if (typeof option == 'number') data.to(option)\n      else if (action) data[action]()\n      else if (options.interval) data.pause().cycle()\n    })\n  }\n\n  var old = $.fn.carousel\n\n  $.fn.carousel             = Plugin\n  $.fn.carousel.Constructor = Carousel\n\n\n  // CAROUSEL NO CONFLICT\n  // ====================\n\n  $.fn.carousel.noConflict = function () {\n    $.fn.carousel = old\n    return this\n  }\n\n\n  // CAROUSEL DATA-API\n  // =================\n\n  var clickHandler = function (e) {\n    var href\n    var $this   = $(this)\n    var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\\s]+$)/, '')) // strip for ie7\n    if (!$target.hasClass('carousel')) return\n    var options = $.extend({}, $target.data(), $this.data())\n    var slideIndex = $this.attr('data-slide-to')\n    if (slideIndex) options.interval = false\n\n    Plugin.call($target, options)\n\n    if (slideIndex) {\n      $target.data('bs.carousel').to(slideIndex)\n    }\n\n    e.preventDefault()\n  }\n\n  $(document)\n    .on('click.bs.carousel.data-api', '[data-slide]', clickHandler)\n    .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler)\n\n  $(window).on('load', function () {\n    $('[data-ride=\"carousel\"]').each(function () {\n      var $carousel = $(this)\n      Plugin.call($carousel, $carousel.data())\n    })\n  })\n\n}(jQuery);\n\n/* ========================================================================\n * Bootstrap: collapse.js v3.3.6\n * http://getbootstrap.com/javascript/#collapse\n * ========================================================================\n * Copyright 2011-2015 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * ======================================================================== */\n\n\n+function ($) {\n  'use strict';\n\n  // COLLAPSE PUBLIC CLASS DEFINITION\n  // ================================\n\n  var Collapse = function (element, options) {\n    this.$element      = $(element)\n    this.options       = $.extend({}, Collapse.DEFAULTS, options)\n    this.$trigger      = $('[data-toggle=\"collapse\"][href=\"#' + element.id + '\"],' +\n                           '[data-toggle=\"collapse\"][data-target=\"#' + element.id + '\"]')\n    this.transitioning = null\n\n    if (this.options.parent) {\n      this.$parent = this.getParent()\n    } else {\n      this.addAriaAndCollapsedClass(this.$element, this.$trigger)\n    }\n\n    if (this.options.toggle) this.toggle()\n  }\n\n  Collapse.VERSION  = '3.3.6'\n\n  Collapse.TRANSITION_DURATION = 350\n\n  Collapse.DEFAULTS = {\n    toggle: true\n  }\n\n  Collapse.prototype.dimension = function () {\n    var hasWidth = this.$element.hasClass('width')\n    return hasWidth ? 'width' : 'height'\n  }\n\n  Collapse.prototype.show = function () {\n    if (this.transitioning || this.$element.hasClass('in')) return\n\n    var activesData\n    var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')\n\n    if (actives && actives.length) {\n      activesData = actives.data('bs.collapse')\n      if (activesData && activesData.transitioning) return\n    }\n\n    var startEvent = $.Event('show.bs.collapse')\n    this.$element.trigger(startEvent)\n    if (startEvent.isDefaultPrevented()) return\n\n    if (actives && actives.length) {\n      Plugin.call(actives, 'hide')\n      activesData || actives.data('bs.collapse', null)\n    }\n\n    var dimension = this.dimension()\n\n    this.$element\n      .removeClass('collapse')\n      .addClass('collapsing')[dimension](0)\n      .attr('aria-expanded', true)\n\n    this.$trigger\n      .removeClass('collapsed')\n      .attr('aria-expanded', true)\n\n    this.transitioning = 1\n\n    var complete = function () {\n      this.$element\n        .removeClass('collapsing')\n        .addClass('collapse in')[dimension]('')\n      this.transitioning = 0\n      this.$element\n        .trigger('shown.bs.collapse')\n    }\n\n    if (!$.support.transition) return complete.call(this)\n\n    var scrollSize = $.camelCase(['scroll', dimension].join('-'))\n\n    this.$element\n      .one('bsTransitionEnd', $.proxy(complete, this))\n      .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])\n  }\n\n  Collapse.prototype.hide = function () {\n    if (this.transitioning || !this.$element.hasClass('in')) return\n\n    var startEvent = $.Event('hide.bs.collapse')\n    this.$element.trigger(startEvent)\n    if (startEvent.isDefaultPrevented()) return\n\n    var dimension = this.dimension()\n\n    this.$element[dimension](this.$element[dimension]())[0].offsetHeight\n\n    this.$element\n      .addClass('collapsing')\n      .removeClass('collapse in')\n      .attr('aria-expanded', false)\n\n    this.$trigger\n      .addClass('collapsed')\n      .attr('aria-expanded', false)\n\n    this.transitioning = 1\n\n    var complete = function () {\n      this.transitioning = 0\n      this.$element\n        .removeClass('collapsing')\n        .addClass('collapse')\n        .trigger('hidden.bs.collapse')\n    }\n\n    if (!$.support.transition) return complete.call(this)\n\n    this.$element\n      [dimension](0)\n      .one('bsTransitionEnd', $.proxy(complete, this))\n      .emulateTransitionEnd(Collapse.TRANSITION_DURATION)\n  }\n\n  Collapse.prototype.toggle = function () {\n    this[this.$element.hasClass('in') ? 'hide' : 'show']()\n  }\n\n  Collapse.prototype.getParent = function () {\n    return $(this.options.parent)\n      .find('[data-toggle=\"collapse\"][data-parent=\"' + this.options.parent + '\"]')\n      .each($.proxy(function (i, element) {\n        var $element = $(element)\n        this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element)\n      }, this))\n      .end()\n  }\n\n  Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) {\n    var isOpen = $element.hasClass('in')\n\n    $element.attr('aria-expanded', isOpen)\n    $trigger\n      .toggleClass('collapsed', !isOpen)\n      .attr('aria-expanded', isOpen)\n  }\n\n  function getTargetFromTrigger($trigger) {\n    var href\n    var target = $trigger.attr('data-target')\n      || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\\s]+$)/, '') // strip for ie7\n\n    return $(target)\n  }\n\n\n  // COLLAPSE PLUGIN DEFINITION\n  // ==========================\n\n  function Plugin(option) {\n    return this.each(function () {\n      var $this   = $(this)\n      var data    = $this.data('bs.collapse')\n      var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)\n\n      if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false\n      if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))\n      if (typeof option == 'string') data[option]()\n    })\n  }\n\n  var old = $.fn.collapse\n\n  $.fn.collapse             = Plugin\n  $.fn.collapse.Constructor = Collapse\n\n\n  // COLLAPSE NO CONFLICT\n  // ====================\n\n  $.fn.collapse.noConflict = function () {\n    $.fn.collapse = old\n    return this\n  }\n\n\n  // COLLAPSE DATA-API\n  // =================\n\n  $(document).on('click.bs.collapse.data-api', '[data-toggle=\"collapse\"]', function (e) {\n    var $this   = $(this)\n\n    if (!$this.attr('data-target')) e.preventDefault()\n\n    var $target = getTargetFromTrigger($this)\n    var data    = $target.data('bs.collapse')\n    var option  = data ? 'toggle' : $this.data()\n\n    Plugin.call($target, option)\n  })\n\n}(jQuery);\n\n/* ========================================================================\n * Bootstrap: dropdown.js v3.3.6\n * http://getbootstrap.com/javascript/#dropdowns\n * ========================================================================\n * Copyright 2011-2015 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * ======================================================================== */\n\n\n+function ($) {\n  'use strict';\n\n  // DROPDOWN CLASS DEFINITION\n  // =========================\n\n  var backdrop = '.dropdown-backdrop'\n  var toggle   = '[data-toggle=\"dropdown\"]'\n  var Dropdown = function (element) {\n    $(element).on('click.bs.dropdown', this.toggle)\n  }\n\n  Dropdown.VERSION = '3.3.6'\n\n  function getParent($this) {\n    var selector = $this.attr('data-target')\n\n    if (!selector) {\n      selector = $this.attr('href')\n      selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\\s]*$)/, '') // strip for ie7\n    }\n\n    var $parent = selector && $(selector)\n\n    return $parent && $parent.length ? $parent : $this.parent()\n  }\n\n  function clearMenus(e) {\n    if (e && e.which === 3) return\n    $(backdrop).remove()\n    $(toggle).each(function () {\n      var $this         = $(this)\n      var $parent       = getParent($this)\n      var relatedTarget = { relatedTarget: this }\n\n      if (!$parent.hasClass('open')) return\n\n      if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return\n\n      $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))\n\n      if (e.isDefaultPrevented()) return\n\n      $this.attr('aria-expanded', 'false')\n      $parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget))\n    })\n  }\n\n  Dropdown.prototype.toggle = function (e) {\n    var $this = $(this)\n\n    if ($this.is('.disabled, :disabled')) return\n\n    var $parent  = getParent($this)\n    var isActive = $parent.hasClass('open')\n\n    clearMenus()\n\n    if (!isActive) {\n      if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {\n        // if mobile we use a backdrop because click events don't delegate\n        $(document.createElement('div'))\n          .addClass('dropdown-backdrop')\n          .insertAfter($(this))\n          .on('click', clearMenus)\n      }\n\n      var relatedTarget = { relatedTarget: this }\n      $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))\n\n      if (e.isDefaultPrevented()) return\n\n      $this\n        .trigger('focus')\n        .attr('aria-expanded', 'true')\n\n      $parent\n        .toggleClass('open')\n        .trigger($.Event('shown.bs.dropdown', relatedTarget))\n    }\n\n    return false\n  }\n\n  Dropdown.prototype.keydown = function (e) {\n    if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return\n\n    var $this = $(this)\n\n    e.preventDefault()\n    e.stopPropagation()\n\n    if ($this.is('.disabled, :disabled')) return\n\n    var $parent  = getParent($this)\n    var isActive = $parent.hasClass('open')\n\n    if (!isActive && e.which != 27 || isActive && e.which == 27) {\n      if (e.which == 27) $parent.find(toggle).trigger('focus')\n      return $this.trigger('click')\n    }\n\n    var desc = ' li:not(.disabled):visible a'\n    var $items = $parent.find('.dropdown-menu' + desc)\n\n    if (!$items.length) return\n\n    var index = $items.index(e.target)\n\n    if (e.which == 38 && index > 0)                 index--         // up\n    if (e.which == 40 && index < $items.length - 1) index++         // down\n    if (!~index)                                    index = 0\n\n    $items.eq(index).trigger('focus')\n  }\n\n\n  // DROPDOWN PLUGIN DEFINITION\n  // ==========================\n\n  function Plugin(option) {\n    return this.each(function () {\n      var $this = $(this)\n      var data  = $this.data('bs.dropdown')\n\n      if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))\n      if (typeof option == 'string') data[option].call($this)\n    })\n  }\n\n  var old = $.fn.dropdown\n\n  $.fn.dropdown             = Plugin\n  $.fn.dropdown.Constructor = Dropdown\n\n\n  // DROPDOWN NO CONFLICT\n  // ====================\n\n  $.fn.dropdown.noConflict = function () {\n    $.fn.dropdown = old\n    return this\n  }\n\n\n  // APPLY TO STANDARD DROPDOWN ELEMENTS\n  // ===================================\n\n  $(document)\n    .on('click.bs.dropdown.data-api', clearMenus)\n    .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })\n    .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)\n    .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)\n    .on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown)\n\n}(jQuery);\n\n/* ========================================================================\n * Bootstrap: modal.js v3.3.6\n * http://getbootstrap.com/javascript/#modals\n * ========================================================================\n * Copyright 2011-2015 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * ======================================================================== */\n\n\n+function ($) {\n  'use strict';\n\n  // MODAL CLASS DEFINITION\n  // ======================\n\n  var Modal = function (element, options) {\n    this.options             = options\n    this.$body               = $(document.body)\n    this.$element            = $(element)\n    this.$dialog             = this.$element.find('.modal-dialog')\n    this.$backdrop           = null\n    this.isShown             = null\n    this.originalBodyPad     = null\n    this.scrollbarWidth      = 0\n    this.ignoreBackdropClick = false\n\n    if (this.options.remote) {\n      this.$element\n        .find('.modal-content')\n        .load(this.options.remote, $.proxy(function () {\n          this.$element.trigger('loaded.bs.modal')\n        }, this))\n    }\n  }\n\n  Modal.VERSION  = '3.3.6'\n\n  Modal.TRANSITION_DURATION = 300\n  Modal.BACKDROP_TRANSITION_DURATION = 150\n\n  Modal.DEFAULTS = {\n    backdrop: true,\n    keyboard: true,\n    show: true\n  }\n\n  Modal.prototype.toggle = function (_relatedTarget) {\n    return this.isShown ? this.hide() : this.show(_relatedTarget)\n  }\n\n  Modal.prototype.show = function (_relatedTarget) {\n    var that = this\n    var e    = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })\n\n    this.$element.trigger(e)\n\n    if (this.isShown || e.isDefaultPrevented()) return\n\n    this.isShown = true\n\n    this.checkScrollbar()\n    this.setScrollbar()\n    this.$body.addClass('modal-open')\n\n    this.escape()\n    this.resize()\n\n    this.$element.on('click.dismiss.bs.modal', '[data-dismiss=\"modal\"]', $.proxy(this.hide, this))\n\n    this.$dialog.on('mousedown.dismiss.bs.modal', function () {\n      that.$element.one('mouseup.dismiss.bs.modal', function (e) {\n        if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true\n      })\n    })\n\n    this.backdrop(function () {\n      var transition = $.support.transition && that.$element.hasClass('fade')\n\n      if (!that.$element.parent().length) {\n        that.$element.appendTo(that.$body) // don't move modals dom position\n      }\n\n      that.$element\n        .show()\n        .scrollTop(0)\n\n      that.adjustDialog()\n\n      if (transition) {\n        that.$element[0].offsetWidth // force reflow\n      }\n\n      that.$element.addClass('in')\n\n      that.enforceFocus()\n\n      var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })\n\n      transition ?\n        that.$dialog // wait for modal to slide in\n          .one('bsTransitionEnd', function () {\n            that.$element.trigger('focus').trigger(e)\n          })\n          .emulateTransitionEnd(Modal.TRANSITION_DURATION) :\n        that.$element.trigger('focus').trigger(e)\n    })\n  }\n\n  Modal.prototype.hide = function (e) {\n    if (e) e.preventDefault()\n\n    e = $.Event('hide.bs.modal')\n\n    this.$element.trigger(e)\n\n    if (!this.isShown || e.isDefaultPrevented()) return\n\n    this.isShown = false\n\n    this.escape()\n    this.resize()\n\n    $(document).off('focusin.bs.modal')\n\n    this.$element\n      .removeClass('in')\n      .off('click.dismiss.bs.modal')\n      .off('mouseup.dismiss.bs.modal')\n\n    this.$dialog.off('mousedown.dismiss.bs.modal')\n\n    $.support.transition && this.$element.hasClass('fade') ?\n      this.$element\n        .one('bsTransitionEnd', $.proxy(this.hideModal, this))\n        .emulateTransitionEnd(Modal.TRANSITION_DURATION) :\n      this.hideModal()\n  }\n\n  Modal.prototype.enforceFocus = function () {\n    $(document)\n      .off('focusin.bs.modal') // guard against infinite focus loop\n      .on('focusin.bs.modal', $.proxy(function (e) {\n        if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {\n          this.$element.trigger('focus')\n        }\n      }, this))\n  }\n\n  Modal.prototype.escape = function () {\n    if (this.isShown && this.options.keyboard) {\n      this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {\n        e.which == 27 && this.hide()\n      }, this))\n    } else if (!this.isShown) {\n      this.$element.off('keydown.dismiss.bs.modal')\n    }\n  }\n\n  Modal.prototype.resize = function () {\n    if (this.isShown) {\n      $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this))\n    } else {\n      $(window).off('resize.bs.modal')\n    }\n  }\n\n  Modal.prototype.hideModal = function () {\n    var that = this\n    this.$element.hide()\n    this.backdrop(function () {\n      that.$body.removeClass('modal-open')\n      that.resetAdjustments()\n      that.resetScrollbar()\n      that.$element.trigger('hidden.bs.modal')\n    })\n  }\n\n  Modal.prototype.removeBackdrop = function () {\n    this.$backdrop && this.$backdrop.remove()\n    this.$backdrop = null\n  }\n\n  Modal.prototype.backdrop = function (callback) {\n    var that = this\n    var animate = this.$element.hasClass('fade') ? 'fade' : ''\n\n    if (this.isShown && this.options.backdrop) {\n      var doAnimate = $.support.transition && animate\n\n      this.$backdrop = $(document.createElement('div'))\n        .addClass('modal-backdrop ' + animate)\n        .appendTo(this.$body)\n\n      this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {\n        if (this.ignoreBackdropClick) {\n          this.ignoreBackdropClick = false\n          return\n        }\n        if (e.target !== e.currentTarget) return\n        this.options.backdrop == 'static'\n          ? this.$element[0].focus()\n          : this.hide()\n      }, this))\n\n      if (doAnimate) this.$backdrop[0].offsetWidth // force reflow\n\n      this.$backdrop.addClass('in')\n\n      if (!callback) return\n\n      doAnimate ?\n        this.$backdrop\n          .one('bsTransitionEnd', callback)\n          .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :\n        callback()\n\n    } else if (!this.isShown && this.$backdrop) {\n      this.$backdrop.removeClass('in')\n\n      var callbackRemove = function () {\n        that.removeBackdrop()\n        callback && callback()\n      }\n      $.support.transition && this.$element.hasClass('fade') ?\n        this.$backdrop\n          .one('bsTransitionEnd', callbackRemove)\n          .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :\n        callbackRemove()\n\n    } else if (callback) {\n      callback()\n    }\n  }\n\n  // these following methods are used to handle overflowing modals\n\n  Modal.prototype.handleUpdate = function () {\n    this.adjustDialog()\n  }\n\n  Modal.prototype.adjustDialog = function () {\n    var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight\n\n    this.$element.css({\n      paddingLeft:  !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',\n      paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''\n    })\n  }\n\n  Modal.prototype.resetAdjustments = function () {\n    this.$element.css({\n      paddingLeft: '',\n      paddingRight: ''\n    })\n  }\n\n  Modal.prototype.checkScrollbar = function () {\n    var fullWindowWidth = window.innerWidth\n    if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8\n      var documentElementRect = document.documentElement.getBoundingClientRect()\n      fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left)\n    }\n    this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth\n    this.scrollbarWidth = this.measureScrollbar()\n  }\n\n  Modal.prototype.setScrollbar = function () {\n    var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)\n    this.originalBodyPad = document.body.style.paddingRight || ''\n    if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)\n  }\n\n  Modal.prototype.resetScrollbar = function () {\n    this.$body.css('padding-right', this.originalBodyPad)\n  }\n\n  Modal.prototype.measureScrollbar = function () { // thx walsh\n    var scrollDiv = document.createElement('div')\n    scrollDiv.className = 'modal-scrollbar-measure'\n    this.$body.append(scrollDiv)\n    var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth\n    this.$body[0].removeChild(scrollDiv)\n    return scrollbarWidth\n  }\n\n\n  // MODAL PLUGIN DEFINITION\n  // =======================\n\n  function Plugin(option, _relatedTarget) {\n    return this.each(function () {\n      var $this   = $(this)\n      var data    = $this.data('bs.modal')\n      var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)\n\n      if (!data) $this.data('bs.modal', (data = new Modal(this, options)))\n      if (typeof option == 'string') data[option](_relatedTarget)\n      else if (options.show) data.show(_relatedTarget)\n    })\n  }\n\n  var old = $.fn.modal\n\n  $.fn.modal             = Plugin\n  $.fn.modal.Constructor = Modal\n\n\n  // MODAL NO CONFLICT\n  // =================\n\n  $.fn.modal.noConflict = function () {\n    $.fn.modal = old\n    return this\n  }\n\n\n  // MODAL DATA-API\n  // ==============\n\n  $(document).on('click.bs.modal.data-api', '[data-toggle=\"modal\"]', function (e) {\n    var $this   = $(this)\n    var href    = $this.attr('href')\n    var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\\s]+$)/, ''))) // strip for ie7\n    var option  = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())\n\n    if ($this.is('a')) e.preventDefault()\n\n    $target.one('show.bs.modal', function (showEvent) {\n      if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown\n      $target.one('hidden.bs.modal', function () {\n        $this.is(':visible') && $this.trigger('focus')\n      })\n    })\n    Plugin.call($target, option, this)\n  })\n\n}(jQuery);\n\n/* ========================================================================\n * Bootstrap: tooltip.js v3.3.6\n * http://getbootstrap.com/javascript/#tooltip\n * Inspired by the original jQuery.tipsy by Jason Frame\n * ========================================================================\n * Copyright 2011-2015 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * ======================================================================== */\n\n\n+function ($) {\n  'use strict';\n\n  // TOOLTIP PUBLIC CLASS DEFINITION\n  // ===============================\n\n  var Tooltip = function (element, options) {\n    this.type       = null\n    this.options    = null\n    this.enabled    = null\n    this.timeout    = null\n    this.hoverState = null\n    this.$element   = null\n    this.inState    = null\n\n    this.init('tooltip', element, options)\n  }\n\n  Tooltip.VERSION  = '3.3.6'\n\n  Tooltip.TRANSITION_DURATION = 150\n\n  Tooltip.DEFAULTS = {\n    animation: true,\n    placement: 'top',\n    selector: false,\n    template: '<div class=\"tooltip\" role=\"tooltip\"><div class=\"tooltip-arrow\"></div><div class=\"tooltip-inner\"></div></div>',\n    trigger: 'hover focus',\n    title: '',\n    delay: 0,\n    html: false,\n    container: false,\n    viewport: {\n      selector: 'body',\n      padding: 0\n    }\n  }\n\n  Tooltip.prototype.init = function (type, element, options) {\n    this.enabled   = true\n    this.type      = type\n    this.$element  = $(element)\n    this.options   = this.getOptions(options)\n    this.$viewport = this.options.viewport && $($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport))\n    this.inState   = { click: false, hover: false, focus: false }\n\n    if (this.$element[0] instanceof document.constructor && !this.options.selector) {\n      throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!')\n    }\n\n    var triggers = this.options.trigger.split(' ')\n\n    for (var i = triggers.length; i--;) {\n      var trigger = triggers[i]\n\n      if (trigger == 'click') {\n        this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))\n      } else if (trigger != 'manual') {\n        var eventIn  = trigger == 'hover' ? 'mouseenter' : 'focusin'\n        var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'\n\n        this.$element.on(eventIn  + '.' + this.type, this.options.selector, $.proxy(this.enter, this))\n        this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))\n      }\n    }\n\n    this.options.selector ?\n      (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :\n      this.fixTitle()\n  }\n\n  Tooltip.prototype.getDefaults = function () {\n    return Tooltip.DEFAULTS\n  }\n\n  Tooltip.prototype.getOptions = function (options) {\n    options = $.extend({}, this.getDefaults(), this.$element.data(), options)\n\n    if (options.delay && typeof options.delay == 'number') {\n      options.delay = {\n        show: options.delay,\n        hide: options.delay\n      }\n    }\n\n    return options\n  }\n\n  Tooltip.prototype.getDelegateOptions = function () {\n    var options  = {}\n    var defaults = this.getDefaults()\n\n    this._options && $.each(this._options, function (key, value) {\n      if (defaults[key] != value) options[key] = value\n    })\n\n    return options\n  }\n\n  Tooltip.prototype.enter = function (obj) {\n    var self = obj instanceof this.constructor ?\n      obj : $(obj.currentTarget).data('bs.' + this.type)\n\n    if (!self) {\n      self = new this.constructor(obj.currentTarget, this.getDelegateOptions())\n      $(obj.currentTarget).data('bs.' + this.type, self)\n    }\n\n    if (obj instanceof $.Event) {\n      self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true\n    }\n\n    if (self.tip().hasClass('in') || self.hoverState == 'in') {\n      self.hoverState = 'in'\n      return\n    }\n\n    clearTimeout(self.timeout)\n\n    self.hoverState = 'in'\n\n    if (!self.options.delay || !self.options.delay.show) return self.show()\n\n    self.timeout = setTimeout(function () {\n      if (self.hoverState == 'in') self.show()\n    }, self.options.delay.show)\n  }\n\n  Tooltip.prototype.isInStateTrue = function () {\n    for (var key in this.inState) {\n      if (this.inState[key]) return true\n    }\n\n    return false\n  }\n\n  Tooltip.prototype.leave = function (obj) {\n    var self = obj instanceof this.constructor ?\n      obj : $(obj.currentTarget).data('bs.' + this.type)\n\n    if (!self) {\n      self = new this.constructor(obj.currentTarget, this.getDelegateOptions())\n      $(obj.currentTarget).data('bs.' + this.type, self)\n    }\n\n    if (obj instanceof $.Event) {\n      self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false\n    }\n\n    if (self.isInStateTrue()) return\n\n    clearTimeout(self.timeout)\n\n    self.hoverState = 'out'\n\n    if (!self.options.delay || !self.options.delay.hide) return self.hide()\n\n    self.timeout = setTimeout(function () {\n      if (self.hoverState == 'out') self.hide()\n    }, self.options.delay.hide)\n  }\n\n  Tooltip.prototype.show = function () {\n    var e = $.Event('show.bs.' + this.type)\n\n    if (this.hasContent() && this.enabled) {\n      this.$element.trigger(e)\n\n      var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0])\n      if (e.isDefaultPrevented() || !inDom) return\n      var that = this\n\n      var $tip = this.tip()\n\n      var tipId = this.getUID(this.type)\n\n      this.setContent()\n      $tip.attr('id', tipId)\n      this.$element.attr('aria-describedby', tipId)\n\n      if (this.options.animation) $tip.addClass('fade')\n\n      var placement = typeof this.options.placement == 'function' ?\n        this.options.placement.call(this, $tip[0], this.$element[0]) :\n        this.options.placement\n\n      var autoToken = /\\s?auto?\\s?/i\n      var autoPlace = autoToken.test(placement)\n      if (autoPlace) placement = placement.replace(autoToken, '') || 'top'\n\n      $tip\n        .detach()\n        .css({ top: 0, left: 0, display: 'block' })\n        .addClass(placement)\n        .data('bs.' + this.type, this)\n\n      this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)\n      this.$element.trigger('inserted.bs.' + this.type)\n\n      var pos          = this.getPosition()\n      var actualWidth  = $tip[0].offsetWidth\n      var actualHeight = $tip[0].offsetHeight\n\n      if (autoPlace) {\n        var orgPlacement = placement\n        var viewportDim = this.getPosition(this.$viewport)\n\n        placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top'    :\n                    placement == 'top'    && pos.top    - actualHeight < viewportDim.top    ? 'bottom' :\n                    placement == 'right'  && pos.right  + actualWidth  > viewportDim.width  ? 'left'   :\n                    placement == 'left'   && pos.left   - actualWidth  < viewportDim.left   ? 'right'  :\n                    placement\n\n        $tip\n          .removeClass(orgPlacement)\n          .addClass(placement)\n      }\n\n      var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)\n\n      this.applyPlacement(calculatedOffset, placement)\n\n      var complete = function () {\n        var prevHoverState = that.hoverState\n        that.$element.trigger('shown.bs.' + that.type)\n        that.hoverState = null\n\n        if (prevHoverState == 'out') that.leave(that)\n      }\n\n      $.support.transition && this.$tip.hasClass('fade') ?\n        $tip\n          .one('bsTransitionEnd', complete)\n          .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :\n        complete()\n    }\n  }\n\n  Tooltip.prototype.applyPlacement = function (offset, placement) {\n    var $tip   = this.tip()\n    var width  = $tip[0].offsetWidth\n    var height = $tip[0].offsetHeight\n\n    // manually read margins because getBoundingClientRect includes difference\n    var marginTop = parseInt($tip.css('margin-top'), 10)\n    var marginLeft = parseInt($tip.css('margin-left'), 10)\n\n    // we must check for NaN for ie 8/9\n    if (isNaN(marginTop))  marginTop  = 0\n    if (isNaN(marginLeft)) marginLeft = 0\n\n    offset.top  += marginTop\n    offset.left += marginLeft\n\n    // $.fn.offset doesn't round pixel values\n    // so we use setOffset directly with our own function B-0\n    $.offset.setOffset($tip[0], $.extend({\n      using: function (props) {\n        $tip.css({\n          top: Math.round(props.top),\n          left: Math.round(props.left)\n        })\n      }\n    }, offset), 0)\n\n    $tip.addClass('in')\n\n    // check to see if placing tip in new offset caused the tip to resize itself\n    var actualWidth  = $tip[0].offsetWidth\n    var actualHeight = $tip[0].offsetHeight\n\n    if (placement == 'top' && actualHeight != height) {\n      offset.top = offset.top + height - actualHeight\n    }\n\n    var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight)\n\n    if (delta.left) offset.left += delta.left\n    else offset.top += delta.top\n\n    var isVertical          = /top|bottom/.test(placement)\n    var arrowDelta          = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight\n    var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight'\n\n    $tip.offset(offset)\n    this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical)\n  }\n\n  Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) {\n    this.arrow()\n      .css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%')\n      .css(isVertical ? 'top' : 'left', '')\n  }\n\n  Tooltip.prototype.setContent = function () {\n    var $tip  = this.tip()\n    var title = this.getTitle()\n\n    $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)\n    $tip.removeClass('fade in top bottom left right')\n  }\n\n  Tooltip.prototype.hide = function (callback) {\n    var that = this\n    var $tip = $(this.$tip)\n    var e    = $.Event('hide.bs.' + this.type)\n\n    function complete() {\n      if (that.hoverState != 'in') $tip.detach()\n      that.$element\n        .removeAttr('aria-describedby')\n        .trigger('hidden.bs.' + that.type)\n      callback && callback()\n    }\n\n    this.$element.trigger(e)\n\n    if (e.isDefaultPrevented()) return\n\n    $tip.removeClass('in')\n\n    $.support.transition && $tip.hasClass('fade') ?\n      $tip\n        .one('bsTransitionEnd', complete)\n        .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :\n      complete()\n\n    this.hoverState = null\n\n    return this\n  }\n\n  Tooltip.prototype.fixTitle = function () {\n    var $e = this.$element\n    if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') {\n      $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')\n    }\n  }\n\n  Tooltip.prototype.hasContent = function () {\n    return this.getTitle()\n  }\n\n  Tooltip.prototype.getPosition = function ($element) {\n    $element   = $element || this.$element\n\n    var el     = $element[0]\n    var isBody = el.tagName == 'BODY'\n\n    var elRect    = el.getBoundingClientRect()\n    if (elRect.width == null) {\n      // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093\n      elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })\n    }\n    var elOffset  = isBody ? { top: 0, left: 0 } : $element.offset()\n    var scroll    = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }\n    var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null\n\n    return $.extend({}, elRect, scroll, outerDims, elOffset)\n  }\n\n  Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {\n    return placement == 'bottom' ? { top: pos.top + pos.height,   left: pos.left + pos.width / 2 - actualWidth / 2 } :\n           placement == 'top'    ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :\n           placement == 'left'   ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :\n        /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }\n\n  }\n\n  Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) {\n    var delta = { top: 0, left: 0 }\n    if (!this.$viewport) return delta\n\n    var viewportPadding = this.options.viewport && this.options.viewport.padding || 0\n    var viewportDimensions = this.getPosition(this.$viewport)\n\n    if (/right|left/.test(placement)) {\n      var topEdgeOffset    = pos.top - viewportPadding - viewportDimensions.scroll\n      var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight\n      if (topEdgeOffset < viewportDimensions.top) { // top overflow\n        delta.top = viewportDimensions.top - topEdgeOffset\n      } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow\n        delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset\n      }\n    } else {\n      var leftEdgeOffset  = pos.left - viewportPadding\n      var rightEdgeOffset = pos.left + viewportPadding + actualWidth\n      if (leftEdgeOffset < viewportDimensions.left) { // left overflow\n        delta.left = viewportDimensions.left - leftEdgeOffset\n      } else if (rightEdgeOffset > viewportDimensions.right) { // right overflow\n        delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset\n      }\n    }\n\n    return delta\n  }\n\n  Tooltip.prototype.getTitle = function () {\n    var title\n    var $e = this.$element\n    var o  = this.options\n\n    title = $e.attr('data-original-title')\n      || (typeof o.title == 'function' ? o.title.call($e[0]) :  o.title)\n\n    return title\n  }\n\n  Tooltip.prototype.getUID = function (prefix) {\n    do prefix += ~~(Math.random() * 1000000)\n    while (document.getElementById(prefix))\n    return prefix\n  }\n\n  Tooltip.prototype.tip = function () {\n    if (!this.$tip) {\n      this.$tip = $(this.options.template)\n      if (this.$tip.length != 1) {\n        throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!')\n      }\n    }\n    return this.$tip\n  }\n\n  Tooltip.prototype.arrow = function () {\n    return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))\n  }\n\n  Tooltip.prototype.enable = function () {\n    this.enabled = true\n  }\n\n  Tooltip.prototype.disable = function () {\n    this.enabled = false\n  }\n\n  Tooltip.prototype.toggleEnabled = function () {\n    this.enabled = !this.enabled\n  }\n\n  Tooltip.prototype.toggle = function (e) {\n    var self = this\n    if (e) {\n      self = $(e.currentTarget).data('bs.' + this.type)\n      if (!self) {\n        self = new this.constructor(e.currentTarget, this.getDelegateOptions())\n        $(e.currentTarget).data('bs.' + this.type, self)\n      }\n    }\n\n    if (e) {\n      self.inState.click = !self.inState.click\n      if (self.isInStateTrue()) self.enter(self)\n      else self.leave(self)\n    } else {\n      self.tip().hasClass('in') ? self.leave(self) : self.enter(self)\n    }\n  }\n\n  Tooltip.prototype.destroy = function () {\n    var that = this\n    clearTimeout(this.timeout)\n    this.hide(function () {\n      that.$element.off('.' + that.type).removeData('bs.' + that.type)\n      if (that.$tip) {\n        that.$tip.detach()\n      }\n      that.$tip = null\n      that.$arrow = null\n      that.$viewport = null\n    })\n  }\n\n\n  // TOOLTIP PLUGIN DEFINITION\n  // =========================\n\n  function Plugin(option) {\n    return this.each(function () {\n      var $this   = $(this)\n      var data    = $this.data('bs.tooltip')\n      var options = typeof option == 'object' && option\n\n      if (!data && /destroy|hide/.test(option)) return\n      if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))\n      if (typeof option == 'string') data[option]()\n    })\n  }\n\n  var old = $.fn.tooltip\n\n  $.fn.tooltip             = Plugin\n  $.fn.tooltip.Constructor = Tooltip\n\n\n  // TOOLTIP NO CONFLICT\n  // ===================\n\n  $.fn.tooltip.noConflict = function () {\n    $.fn.tooltip = old\n    return this\n  }\n\n}(jQuery);\n\n/* ========================================================================\n * Bootstrap: popover.js v3.3.6\n * http://getbootstrap.com/javascript/#popovers\n * ========================================================================\n * Copyright 2011-2015 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * ======================================================================== */\n\n\n+function ($) {\n  'use strict';\n\n  // POPOVER PUBLIC CLASS DEFINITION\n  // ===============================\n\n  var Popover = function (element, options) {\n    this.init('popover', element, options)\n  }\n\n  if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')\n\n  Popover.VERSION  = '3.3.6'\n\n  Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {\n    placement: 'right',\n    trigger: 'click',\n    content: '',\n    template: '<div class=\"popover\" role=\"tooltip\"><div class=\"arrow\"></div><h3 class=\"popover-title\"></h3><div class=\"popover-content\"></div></div>'\n  })\n\n\n  // NOTE: POPOVER EXTENDS tooltip.js\n  // ================================\n\n  Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)\n\n  Popover.prototype.constructor = Popover\n\n  Popover.prototype.getDefaults = function () {\n    return Popover.DEFAULTS\n  }\n\n  Popover.prototype.setContent = function () {\n    var $tip    = this.tip()\n    var title   = this.getTitle()\n    var content = this.getContent()\n\n    $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)\n    $tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events\n      this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'\n    ](content)\n\n    $tip.removeClass('fade top bottom left right in')\n\n    // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do\n    // this manually by checking the contents.\n    if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()\n  }\n\n  Popover.prototype.hasContent = function () {\n    return this.getTitle() || this.getContent()\n  }\n\n  Popover.prototype.getContent = function () {\n    var $e = this.$element\n    var o  = this.options\n\n    return $e.attr('data-content')\n      || (typeof o.content == 'function' ?\n            o.content.call($e[0]) :\n            o.content)\n  }\n\n  Popover.prototype.arrow = function () {\n    return (this.$arrow = this.$arrow || this.tip().find('.arrow'))\n  }\n\n\n  // POPOVER PLUGIN DEFINITION\n  // =========================\n\n  function Plugin(option) {\n    return this.each(function () {\n      var $this   = $(this)\n      var data    = $this.data('bs.popover')\n      var options = typeof option == 'object' && option\n\n      if (!data && /destroy|hide/.test(option)) return\n      if (!data) $this.data('bs.popover', (data = new Popover(this, options)))\n      if (typeof option == 'string') data[option]()\n    })\n  }\n\n  var old = $.fn.popover\n\n  $.fn.popover             = Plugin\n  $.fn.popover.Constructor = Popover\n\n\n  // POPOVER NO CONFLICT\n  // ===================\n\n  $.fn.popover.noConflict = function () {\n    $.fn.popover = old\n    return this\n  }\n\n}(jQuery);\n\n/* ========================================================================\n * Bootstrap: scrollspy.js v3.3.6\n * http://getbootstrap.com/javascript/#scrollspy\n * ========================================================================\n * Copyright 2011-2015 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * ======================================================================== */\n\n\n+function ($) {\n  'use strict';\n\n  // SCROLLSPY CLASS DEFINITION\n  // ==========================\n\n  function ScrollSpy(element, options) {\n    this.$body          = $(document.body)\n    this.$scrollElement = $(element).is(document.body) ? $(window) : $(element)\n    this.options        = $.extend({}, ScrollSpy.DEFAULTS, options)\n    this.selector       = (this.options.target || '') + ' .nav li > a'\n    this.offsets        = []\n    this.targets        = []\n    this.activeTarget   = null\n    this.scrollHeight   = 0\n\n    this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))\n    this.refresh()\n    this.process()\n  }\n\n  ScrollSpy.VERSION  = '3.3.6'\n\n  ScrollSpy.DEFAULTS = {\n    offset: 10\n  }\n\n  ScrollSpy.prototype.getScrollHeight = function () {\n    return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)\n  }\n\n  ScrollSpy.prototype.refresh = function () {\n    var that          = this\n    var offsetMethod  = 'offset'\n    var offsetBase    = 0\n\n    this.offsets      = []\n    this.targets      = []\n    this.scrollHeight = this.getScrollHeight()\n\n    if (!$.isWindow(this.$scrollElement[0])) {\n      offsetMethod = 'position'\n      offsetBase   = this.$scrollElement.scrollTop()\n    }\n\n    this.$body\n      .find(this.selector)\n      .map(function () {\n        var $el   = $(this)\n        var href  = $el.data('target') || $el.attr('href')\n        var $href = /^#./.test(href) && $(href)\n\n        return ($href\n          && $href.length\n          && $href.is(':visible')\n          && [[$href[offsetMethod]().top + offsetBase, href]]) || null\n      })\n      .sort(function (a, b) { return a[0] - b[0] })\n      .each(function () {\n        that.offsets.push(this[0])\n        that.targets.push(this[1])\n      })\n  }\n\n  ScrollSpy.prototype.process = function () {\n    var scrollTop    = this.$scrollElement.scrollTop() + this.options.offset\n    var scrollHeight = this.getScrollHeight()\n    var maxScroll    = this.options.offset + scrollHeight - this.$scrollElement.height()\n    var offsets      = this.offsets\n    var targets      = this.targets\n    var activeTarget = this.activeTarget\n    var i\n\n    if (this.scrollHeight != scrollHeight) {\n      this.refresh()\n    }\n\n    if (scrollTop >= maxScroll) {\n      return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)\n    }\n\n    if (activeTarget && scrollTop < offsets[0]) {\n      this.activeTarget = null\n      return this.clear()\n    }\n\n    for (i = offsets.length; i--;) {\n      activeTarget != targets[i]\n        && scrollTop >= offsets[i]\n        && (offsets[i + 1] === undefined || scrollTop < offsets[i + 1])\n        && this.activate(targets[i])\n    }\n  }\n\n  ScrollSpy.prototype.activate = function (target) {\n    this.activeTarget = target\n\n    this.clear()\n\n    var selector = this.selector +\n      '[data-target=\"' + target + '\"],' +\n      this.selector + '[href=\"' + target + '\"]'\n\n    var active = $(selector)\n      .parents('li')\n      .addClass('active')\n\n    if (active.parent('.dropdown-menu').length) {\n      active = active\n        .closest('li.dropdown')\n        .addClass('active')\n    }\n\n    active.trigger('activate.bs.scrollspy')\n  }\n\n  ScrollSpy.prototype.clear = function () {\n    $(this.selector)\n      .parentsUntil(this.options.target, '.active')\n      .removeClass('active')\n  }\n\n\n  // SCROLLSPY PLUGIN DEFINITION\n  // ===========================\n\n  function Plugin(option) {\n    return this.each(function () {\n      var $this   = $(this)\n      var data    = $this.data('bs.scrollspy')\n      var options = typeof option == 'object' && option\n\n      if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))\n      if (typeof option == 'string') data[option]()\n    })\n  }\n\n  var old = $.fn.scrollspy\n\n  $.fn.scrollspy             = Plugin\n  $.fn.scrollspy.Constructor = ScrollSpy\n\n\n  // SCROLLSPY NO CONFLICT\n  // =====================\n\n  $.fn.scrollspy.noConflict = function () {\n    $.fn.scrollspy = old\n    return this\n  }\n\n\n  // SCROLLSPY DATA-API\n  // ==================\n\n  $(window).on('load.bs.scrollspy.data-api', function () {\n    $('[data-spy=\"scroll\"]').each(function () {\n      var $spy = $(this)\n      Plugin.call($spy, $spy.data())\n    })\n  })\n\n}(jQuery);\n\n/* ========================================================================\n * Bootstrap: tab.js v3.3.6\n * http://getbootstrap.com/javascript/#tabs\n * ========================================================================\n * Copyright 2011-2015 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * ======================================================================== */\n\n\n+function ($) {\n  'use strict';\n\n  // TAB CLASS DEFINITION\n  // ====================\n\n  var Tab = function (element) {\n    // jscs:disable requireDollarBeforejQueryAssignment\n    this.element = $(element)\n    // jscs:enable requireDollarBeforejQueryAssignment\n  }\n\n  Tab.VERSION = '3.3.6'\n\n  Tab.TRANSITION_DURATION = 150\n\n  Tab.prototype.show = function () {\n    var $this    = this.element\n    var $ul      = $this.closest('ul:not(.dropdown-menu)')\n    var selector = $this.data('target')\n\n    if (!selector) {\n      selector = $this.attr('href')\n      selector = selector && selector.replace(/.*(?=#[^\\s]*$)/, '') // strip for ie7\n    }\n\n    if ($this.parent('li').hasClass('active')) return\n\n    var $previous = $ul.find('.active:last a')\n    var hideEvent = $.Event('hide.bs.tab', {\n      relatedTarget: $this[0]\n    })\n    var showEvent = $.Event('show.bs.tab', {\n      relatedTarget: $previous[0]\n    })\n\n    $previous.trigger(hideEvent)\n    $this.trigger(showEvent)\n\n    if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return\n\n    var $target = $(selector)\n\n    this.activate($this.closest('li'), $ul)\n    this.activate($target, $target.parent(), function () {\n      $previous.trigger({\n        type: 'hidden.bs.tab',\n        relatedTarget: $this[0]\n      })\n      $this.trigger({\n        type: 'shown.bs.tab',\n        relatedTarget: $previous[0]\n      })\n    })\n  }\n\n  Tab.prototype.activate = function (element, container, callback) {\n    var $active    = container.find('> .active')\n    var transition = callback\n      && $.support.transition\n      && ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length)\n\n    function next() {\n      $active\n        .removeClass('active')\n        .find('> .dropdown-menu > .active')\n          .removeClass('active')\n        .end()\n        .find('[data-toggle=\"tab\"]')\n          .attr('aria-expanded', false)\n\n      element\n        .addClass('active')\n        .find('[data-toggle=\"tab\"]')\n          .attr('aria-expanded', true)\n\n      if (transition) {\n        element[0].offsetWidth // reflow for transition\n        element.addClass('in')\n      } else {\n        element.removeClass('fade')\n      }\n\n      if (element.parent('.dropdown-menu').length) {\n        element\n          .closest('li.dropdown')\n            .addClass('active')\n          .end()\n          .find('[data-toggle=\"tab\"]')\n            .attr('aria-expanded', true)\n      }\n\n      callback && callback()\n    }\n\n    $active.length && transition ?\n      $active\n        .one('bsTransitionEnd', next)\n        .emulateTransitionEnd(Tab.TRANSITION_DURATION) :\n      next()\n\n    $active.removeClass('in')\n  }\n\n\n  // TAB PLUGIN DEFINITION\n  // =====================\n\n  function Plugin(option) {\n    return this.each(function () {\n      var $this = $(this)\n      var data  = $this.data('bs.tab')\n\n      if (!data) $this.data('bs.tab', (data = new Tab(this)))\n      if (typeof option == 'string') data[option]()\n    })\n  }\n\n  var old = $.fn.tab\n\n  $.fn.tab             = Plugin\n  $.fn.tab.Constructor = Tab\n\n\n  // TAB NO CONFLICT\n  // ===============\n\n  $.fn.tab.noConflict = function () {\n    $.fn.tab = old\n    return this\n  }\n\n\n  // TAB DATA-API\n  // ============\n\n  var clickHandler = function (e) {\n    e.preventDefault()\n    Plugin.call($(this), 'show')\n  }\n\n  $(document)\n    .on('click.bs.tab.data-api', '[data-toggle=\"tab\"]', clickHandler)\n    .on('click.bs.tab.data-api', '[data-toggle=\"pill\"]', clickHandler)\n\n}(jQuery);\n\n/* ========================================================================\n * Bootstrap: affix.js v3.3.6\n * http://getbootstrap.com/javascript/#affix\n * ========================================================================\n * Copyright 2011-2015 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * ======================================================================== */\n\n\n+function ($) {\n  'use strict';\n\n  // AFFIX CLASS DEFINITION\n  // ======================\n\n  var Affix = function (element, options) {\n    this.options = $.extend({}, Affix.DEFAULTS, options)\n\n    this.$target = $(this.options.target)\n      .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))\n      .on('click.bs.affix.data-api',  $.proxy(this.checkPositionWithEventLoop, this))\n\n    this.$element     = $(element)\n    this.affixed      = null\n    this.unpin        = null\n    this.pinnedOffset = null\n\n    this.checkPosition()\n  }\n\n  Affix.VERSION  = '3.3.6'\n\n  Affix.RESET    = 'affix affix-top affix-bottom'\n\n  Affix.DEFAULTS = {\n    offset: 0,\n    target: window\n  }\n\n  Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) {\n    var scrollTop    = this.$target.scrollTop()\n    var position     = this.$element.offset()\n    var targetHeight = this.$target.height()\n\n    if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false\n\n    if (this.affixed == 'bottom') {\n      if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom'\n      return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom'\n    }\n\n    var initializing   = this.affixed == null\n    var colliderTop    = initializing ? scrollTop : position.top\n    var colliderHeight = initializing ? targetHeight : height\n\n    if (offsetTop != null && scrollTop <= offsetTop) return 'top'\n    if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'\n\n    return false\n  }\n\n  Affix.prototype.getPinnedOffset = function () {\n    if (this.pinnedOffset) return this.pinnedOffset\n    this.$element.removeClass(Affix.RESET).addClass('affix')\n    var scrollTop = this.$target.scrollTop()\n    var position  = this.$element.offset()\n    return (this.pinnedOffset = position.top - scrollTop)\n  }\n\n  Affix.prototype.checkPositionWithEventLoop = function () {\n    setTimeout($.proxy(this.checkPosition, this), 1)\n  }\n\n  Affix.prototype.checkPosition = function () {\n    if (!this.$element.is(':visible')) return\n\n    var height       = this.$element.height()\n    var offset       = this.options.offset\n    var offsetTop    = offset.top\n    var offsetBottom = offset.bottom\n    var scrollHeight = Math.max($(document).height(), $(document.body).height())\n\n    if (typeof offset != 'object')         offsetBottom = offsetTop = offset\n    if (typeof offsetTop == 'function')    offsetTop    = offset.top(this.$element)\n    if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)\n\n    var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom)\n\n    if (this.affixed != affix) {\n      if (this.unpin != null) this.$element.css('top', '')\n\n      var affixType = 'affix' + (affix ? '-' + affix : '')\n      var e         = $.Event(affixType + '.bs.affix')\n\n      this.$element.trigger(e)\n\n      if (e.isDefaultPrevented()) return\n\n      this.affixed = affix\n      this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null\n\n      this.$element\n        .removeClass(Affix.RESET)\n        .addClass(affixType)\n        .trigger(affixType.replace('affix', 'affixed') + '.bs.affix')\n    }\n\n    if (affix == 'bottom') {\n      this.$element.offset({\n        top: scrollHeight - height - offsetBottom\n      })\n    }\n  }\n\n\n  // AFFIX PLUGIN DEFINITION\n  // =======================\n\n  function Plugin(option) {\n    return this.each(function () {\n      var $this   = $(this)\n      var data    = $this.data('bs.affix')\n      var options = typeof option == 'object' && option\n\n      if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\n      if (typeof option == 'string') data[option]()\n    })\n  }\n\n  var old = $.fn.affix\n\n  $.fn.affix             = Plugin\n  $.fn.affix.Constructor = Affix\n\n\n  // AFFIX NO CONFLICT\n  // =================\n\n  $.fn.affix.noConflict = function () {\n    $.fn.affix = old\n    return this\n  }\n\n\n  // AFFIX DATA-API\n  // ==============\n\n  $(window).on('load', function () {\n    $('[data-spy=\"affix\"]').each(function () {\n      var $spy = $(this)\n      var data = $spy.data()\n\n      data.offset = data.offset || {}\n\n      if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom\n      if (data.offsetTop    != null) data.offset.top    = data.offsetTop\n\n      Plugin.call($spy, data)\n    })\n  })\n\n}(jQuery);\n","treetools = {\n\n  testalert: function() {\n    alert(\"treetools!\");\n  },\n\n\n  getCore: function() {\n      schraubenliste.array.forEach(function(element) {}, this);\n    }, //getCore\n\n    //liefert alle vorhandenen werte von key in einem array\n    //tools.getKeys(\"d_1\", schraubenliste)\n    getKeys: function(key, array) {\n      var keys = [];\n      var foo = function(item) {\n        if (keys.indexOf(item[key]) == -1) {\n          keys.push(item[key]);\n        }\n\n      };\n      array.map(foo);\n\n      return keys;\n    },\n    //\n\n    //liefert alle objekte in \"array\" als array fuer die gilt key==val\n    //tools.getItemsForKey(\"d_1\", \"1\", schraubenliste)\n    getItemsForKey: function(key, val, array) {\n      //console.log(key, val);\n      var foo = function(el, i, ar) {\n        return el[key] == val;\n      };\n\n      return array.filter(foo);\n    },\n\n    //liefert ein array von arrays zurueck, dass fuer jeden key die zugehoerigen elemente enthaelt\n    //tools.sortAndMove(\"d_1\", schraubenliste)\n    sortAndMove: function(key, array) {\n      self = this;\n      var arraynew = [];\n      var keys = this.getKeys(key, array);\n      //console.log(\"sortAndMove: \"+keys);\n      keys.forEach(function(el, i) {\n          arraynew[i] = {\n            \"text\": el,\n            \"children\": self.getItemsForKey(key, el, array)\n          };\n        } //function\n      );\n\n      return arraynew;\n    },\n\n    levels: [\"VM_Typ\", \"Kopfform\", \"d_1\", \"l_s\"],\n    //levels: [\"VM_Typ\",\"Kopfform\",\"d_1\",\"b\",\"l_s\"],\n\n    validnodes: [],\n    validkopfformen: [],\n    validtypes: [],\n\n    buildTree: function(liste, showinvalidscrews) {\n      console.log(\"treetools.buildTree()\");\n      self = this;\n\n      self.validnodes = [];\n      self.validkopfformen = [];\n      self.validtypes = [];\n\n      var firstRun = function(i, array) {\n\n        var temparray = [];\n\n        var nodes = [];\n        if (i < self.levels.length - 1) { //weitere ebenen hinzufuegen\n          array.forEach(function(el, j) {\n            var keys = self.getKeys(self.levels[i], el.children); //<-- liefert die keys fuer die ebene\n            var ar = self.sortAndMove(self.levels[i], el.children);\n\n            if (self.levels[i] == \"d_1\") {\n              ar.forEach(function(el1, k) {\n                nodes.push({\n                  \"name\": \"d=\" + parseFloat(el1.text.replace(',', '.')),\n                  \"isExpanded\": false,\n                  \"isSelected\": false,\n                  \"isVisible\": true,\n                  \"children\": firstRun(i + 1, [el1])\n                });\n              });\n            } else {\n              ar.forEach(function(el1, k) {\n                nodes.push({\n                  \"name\": el1.text,\n                  \"isExpanded\": false,\n                  \"isSelected\": false,\n                  \"isVisible\": true,\n                  \"children\": firstRun(i + 1, [el1])\n                });\n              });\n            }\n\n          }); //foreach\n        } else { //letzte ebene -> endknoten setzen\n          nodes = array[0].children.map( //<--auf der letzten ebene gibt es nur noch ein array\n            function(element) {\n\n              if (element.VM_Okay == \"True\") {\n\n                self.validnodes.push(element.d_1 + element.Kopfform + element.VM_Typ);\n                self.validkopfformen.push(element.Kopfform + element.VM_Typ);\n                self.validtypes.push(element.VM_Typ);\n\n                return {\n                  \"name\": \"l=\" + parseFloat(element[self.levels[i]].replace(',', '.')),\n                  \"isExpanded\": false,\n                  \"isSelected\": false,\n                  \"isVisible\": true,\n                  \"data\": element,\n                  'icon': 'assets/images/screw_tick.png'\n                };\n              } else {\n                return {\n                  \"name\": \"l=\" + parseFloat(element[self.levels[i]].replace(',', '.')),\n                  \"isExpanded\": false,\n                  \"isSelected\": false,\n                  \"isVisible\": true,\n                  \"data\": element,\n                  'icon': 'assets/images/screw_cross.png'\n                };\n              }\n\n            }\n          );\n        } //\n\n        return nodes;\n      };\n\n      var thenodes = firstRun(0, [{\n        \"name\": \"root\",\n        \"isExpanded\": false,\n        \"isSelected\": false,\n        \"isVisible\": true,\n        \"children\": liste\n      }]);\n\n\n\n      var createNodes = function(i, array) {\n        var nodes = [];\n        if (i < self.levels.length - 1) { //weitere ebenen hinzufuegen\n          array.forEach(function(el, j) {\n            var keys = self.getKeys(self.levels[i], el.children); //<-- liefert die keys fuer die ebene\n            var ar = self.sortAndMove(self.levels[i], el.children);\n\n            if (self.levels[i] == \"d_1\") {\n              ar.forEach(function(el1, k) {\n\n                var temptext = el1.text + el1.children[0].Kopfform + el1.children[0].VM_Typ;\n\n                if (self.validnodes.indexOf(temptext) != -1) {\n\n                  nodes.push({\n                    \"name\": \"d=\" + parseFloat(el1.text.replace(',', '.')),\n                    \"children\": createNodes(i + 1, [el1]),\n                    \"isExpanded\": false,\n                    \"isSelected\": false,\n                    \"isVisible\": true,\n                    'icon': 'assets/images/folder_tick.png'\n                  });\n                } else {\n                  nodes.push({\n                    \"name\": \"d=\" + parseFloat(el1.text.replace(',', '.')),\n                    \"children\": createNodes(i + 1, [el1]),\n                    \"isExpanded\": false,\n                    \"isSelected\": false,\n                    \"isVisible\": true,\n                    'icon': 'assets/images/folder_cross.png'\n                  });\n                }\n              });\n            } else {\n              ar.forEach(function(el1, k) {\n\n                var temptext = el1.text + el1.children[0].VM_Typ;\n\n                if (self.validkopfformen.indexOf(temptext) != -1 || self.validtypes.indexOf(el1.text) != -1) {\n\n                  nodes.push({\n                    \"name\": el1.text,\n                    \"isExpanded\": false,\n                    \"isSelected\": false,\n                    \"isVisible\": true,\n                    \"children\": createNodes(i + 1, [el1]),\n                    'icon': 'assets/images/folder_tick.png'\n                  });\n\n                } else {\n\n                  nodes.push({\n                    \"name\": el1.text,\n                    \"isExpanded\": false,\n                    \"isSelected\": false,\n                    \"isVisible\": true,\n                    \"children\": createNodes(i + 1, [el1]),\n                    'icon': 'assets/images/folder_cross.png'\n                  });\n\n                }\n              });\n            }\n\n          }); //foreach\n        } else { //letzte ebene -> endknoten setzen\n          nodes = array[0].children.map( //<--auf der letzten ebene gibt es nur noch ein array\n            function(element) {\n\n              if (element.VM_Okay == \"True\") {\n\n                return {\n                  \"name\": \"l=\" + parseFloat(element[self.levels[i]].replace(',', '.'))+element.b_zu_ls,\n                  \"isExpanded\": false,\n                  \"isSelected\": false,\n                  \"isVisible\": true,\n                  \"data\": element,\n                  'icon': 'assets/images/screw_tick.png',\n                  'a_attr': {\n                    'class': 'hint--bottom hint--success',\n                    // 'data-hint': element.ToolTipText,\n                    'data-tooltip': element.ToolTipText,\n                    'onmouseover': \"tooltipshow(this, \\\"tooltipfenster-gruen\\\")\",\n                    'onmouseout': \"tooltiphide()\"\n                  }\n                };\n              } else {\n                if (showinvalidscrews) {\n                return {\n                  \"name\": \"l=\" + parseFloat(element[self.levels[i]].replace(',', '.'))+element.b_zu_ls,\n                  \"isExpanded\": false,\n                  \"isSelected\": false,\n                  \"isVisible\": true,\n                  \"data\": element,\n                  'icon': 'assets/images/screw_cross.png',\n                  'a_attr': {\n                    'class': 'hint--bottom hint--error',\n                    // 'data-hint': element.ToolTipText\n                    'data-tooltip': element.ToolTipText,\n                    'onmouseover': \"tooltipshow(this, \\\"tooltipfenster-rot\\\")\",\n                    'onmouseout': \"tooltiphide()\"\n                  }\n                };}\n                else {\n                  return \"\";\n                }\n              }\n\n            }\n          );\n        } //\n\n        return nodes;\n      };\n\n      return createNodes(0, [{\n        \"name\": \"root\",\n        \"isExpanded\": false,\n        \"isSelected\": false,\n        \"isVisible\": true,\n        \"children\": liste\n      }]);\n    }, //buildTreeFunctional\n\n    zeichneBaum: function() {\n      self = this;\n\n    }\n}\n","define('@ember-data/adapter/-private', ['exports', 'require', 'ember-inflector'], function (exports, require, emberInflector) { 'use strict';\n\n  var require__default = 'default' in require ? require['default'] : require;\n\n  var newline = /\\r?\\n/;\n  function parseResponseHeaders(headersString) {\n    var headers = Object.create(null);\n\n    if (!headersString) {\n      return headers;\n    }\n\n    var headerPairs = headersString.split(newline);\n\n    for (var i = 0; i < headerPairs.length; i++) {\n      var header = headerPairs[i];\n      var j = 0;\n      var foundSep = false;\n\n      for (; j < header.length; j++) {\n        if (header.charCodeAt(j) === 58\n        /* ':' */\n        ) {\n            foundSep = true;\n            break;\n          }\n      }\n\n      if (foundSep === false) {\n        continue;\n      }\n\n      var field = header.substring(0, j).trim();\n      var value = header.substring(j + 1, header.length).trim();\n\n      if (value) {\n        var lowerCasedField = field.toLowerCase();\n        headers[lowerCasedField] = value;\n        headers[field] = value;\n      }\n    }\n\n    return headers;\n  }\n\n  function continueOnReject(promise) {\n    return Ember.RSVP.resolve(promise).catch(e => e);\n  }\n\n  /*\n   * Function that always attempts to parse the response as json, and if an error is thrown,\n   * returns `undefined` if the response is successful and has a status code of 204 (No Content),\n   * or 205 (Reset Content) or if the request method was 'HEAD', and the plain payload otherwise.\n   */\n  function _determineContent(response, requestData, payload) {\n    var ret = payload;\n    var error;\n\n    if (!response.ok) {\n      return payload;\n    }\n\n    try {\n      ret = JSON.parse(payload);\n    } catch (e) {\n      if (!(e instanceof SyntaxError)) {\n        return e;\n      }\n\n      e.payload = payload;\n      error = e;\n    }\n\n    var status = response.status;\n\n    if (response.ok && (status === 204 || status === 205 || requestData.method === 'HEAD')) {\n      return;\n    }\n\n    {\n      var message = `The server returned an empty string for ${requestData.method} ${requestData.url}, which cannot be parsed into a valid JSON. Return either null or {}.`;\n\n      if (payload === '') {\n        ( Ember.warn(message, true, {\n          id: 'ds.adapter.returned-empty-string-as-JSON'\n        }));\n      }\n    }\n\n    if (error) {\n      {\n        // eslint-disable-next-line no-console\n        console.warn('This response was unable to be parsed as json.', payload);\n      }\n\n      return error;\n    }\n\n    return ret;\n  }\n\n  function determineBodyPromise(response, requestData) {\n    // response.text() may resolve or reject\n    // it is a native promise, may not have finally\n    return continueOnReject(response.text()).then(payload => _determineContent(response, requestData, payload));\n  }\n\n  var RBRACKET = /\\[\\]$/;\n\n  function isPlainObject(obj) {\n    return Object.prototype.toString.call(obj) === '[object Object]';\n  }\n  /*\n   * Helper function that turns the data/body of a request into a query param string.\n   * This is directly copied from jQuery.param.\n   */\n\n\n  function serializeQueryParams(queryParamsObject) {\n    var s = [];\n\n    function buildParams(prefix, obj) {\n      var i, len, key;\n\n      if (prefix) {\n        if (Array.isArray(obj)) {\n          for (i = 0, len = obj.length; i < len; i++) {\n            if (RBRACKET.test(prefix)) {\n              add(s, prefix, obj[i]);\n            } else {\n              buildParams(prefix + '[' + (typeof obj[i] === 'object' ? i : '') + ']', obj[i]);\n            }\n          }\n        } else if (isPlainObject(obj)) {\n          for (key in obj) {\n            buildParams(prefix + '[' + key + ']', obj[key]);\n          }\n        } else {\n          add(s, prefix, obj);\n        }\n      } else if (Array.isArray(obj)) {\n        for (i = 0, len = obj.length; i < len; i++) {\n          add(s, obj[i].name, obj[i].value);\n        }\n      } else {\n        for (key in obj) {\n          buildParams(key, obj[key]);\n        }\n      }\n\n      return s;\n    }\n\n    return buildParams('', queryParamsObject).join('&').replace(/%20/g, '+');\n  }\n  /*\n   * Part of the `serializeQueryParams` helper function.\n   */\n\n  function add(s, k, v) {\n    // Strip out keys with undefined value and replace null values with\n    // empty strings (mimics jQuery.ajax)\n    if (v === undefined) {\n      return;\n    } else if (v === null) {\n      v = '';\n    }\n\n    v = typeof v === 'function' ? v() : v;\n    s[s.length] = `${encodeURIComponent(k)}=${encodeURIComponent(v)}`;\n  }\n\n  var _fetch = null;\n  function getFetchFunction() {\n    if (_fetch !== null) {\n      return _fetch();\n    }\n\n    if (require.has('fetch')) {\n      // use `fetch` module by default, this is commonly provided by ember-fetch\n      var fetchFn = require__default('fetch').default;\n\n      _fetch = () => fetchFn;\n    } else if (typeof fetch === 'function') {\n      // fallback to using global fetch\n      _fetch = () => fetch;\n    } else {\n      throw new Error('cannot find the `fetch` module or the `fetch` global. Did you mean to install the `ember-fetch` addon?');\n    }\n\n    return _fetch();\n  }\n\n  /**\n    @module @ember-data/adapter\n  */\n\n  /**\n    ## Using BuildURLMixin\n\n    To use URL building, include the mixin when extending an adapter, and call `buildURL` where needed.\n    The default behaviour is designed for RESTAdapter.\n\n    ### Example\n\n    ```javascript\n    import Adapter, { BuildURLMixin } from '@ember-data/adapter';\n\n    export default Adapter.extend(BuildURLMixin, {\n      findRecord: function(store, type, id, snapshot) {\n        var url = this.buildURL(type.modelName, id, snapshot, 'findRecord');\n        return this.ajax(url, 'GET');\n      }\n    });\n    ```\n\n    ### Attributes\n\n    The `host` and `namespace` attributes will be used if defined, and are optional.\n\n    @class BuildURLMixin\n  */\n\n  var buildUrlMixin = Ember.Mixin.create({\n    /**\n      Builds a URL for a given type and optional ID.\n       By default, it pluralizes the type's name (for example, 'post'\n      becomes 'posts' and 'person' becomes 'people'). To override the\n      pluralization see [pathForType](BuildUrlMixin/methods/pathForType?anchor=pathForType).\n       If an ID is specified, it adds the ID to the path generated\n      for the type, separated by a `/`.\n       When called by `RESTAdapter.findMany()` the `id` and `snapshot` parameters\n      will be arrays of ids and snapshots.\n       @method buildURL\n      @param {String} modelName\n      @param {(String|Array|Object)} id single id or array of ids or query\n      @param {(Snapshot|SnapshotRecordArray)} snapshot single snapshot or array of snapshots\n      @param {String} requestType\n      @param {Object} query object of query parameters to send for query requests.\n      @return {String} url\n    */\n    buildURL(modelName, id, snapshot, requestType, query) {\n      switch (requestType) {\n        case 'findRecord':\n          return this.urlForFindRecord(id, modelName, snapshot);\n\n        case 'findAll':\n          return this.urlForFindAll(modelName, snapshot);\n\n        case 'query':\n          return this.urlForQuery(query, modelName);\n\n        case 'queryRecord':\n          return this.urlForQueryRecord(query, modelName);\n\n        case 'findMany':\n          return this.urlForFindMany(id, modelName, snapshot);\n\n        case 'findHasMany':\n          return this.urlForFindHasMany(id, modelName, snapshot);\n\n        case 'findBelongsTo':\n          return this.urlForFindBelongsTo(id, modelName, snapshot);\n\n        case 'createRecord':\n          return this.urlForCreateRecord(modelName, snapshot);\n\n        case 'updateRecord':\n          return this.urlForUpdateRecord(id, modelName, snapshot);\n\n        case 'deleteRecord':\n          return this.urlForDeleteRecord(id, modelName, snapshot);\n\n        default:\n          return this._buildURL(modelName, id);\n      }\n    },\n\n    /**\n      @method _buildURL\n      @private\n      @param {String} modelName\n      @param {String} id\n      @return {String} url\n    */\n    _buildURL(modelName, id) {\n      var path;\n      var url = [];\n      var host = Ember.get(this, 'host');\n      var prefix = this.urlPrefix();\n\n      if (modelName) {\n        path = this.pathForType(modelName);\n\n        if (path) {\n          url.push(path);\n        }\n      }\n\n      if (id) {\n        url.push(encodeURIComponent(id));\n      }\n\n      if (prefix) {\n        url.unshift(prefix);\n      }\n\n      url = url.join('/');\n\n      if (!host && url && url.charAt(0) !== '/') {\n        url = '/' + url;\n      }\n\n      return url;\n    },\n\n    /**\n     Builds a URL for a `store.findRecord(type, id)` call.\n      Example:\n      ```app/adapters/user.js\n     import JSONAPIAdapter from '@ember-data/adapter/json-api';\n      export default JSONAPIAdapter.extend({\n       urlForFindRecord(id, modelName, snapshot) {\n         let baseUrl = this.buildURL(modelName, id, snapshot);\n         return `${baseUrl}/users/${snapshot.adapterOptions.user_id}/playlists/${id}`;\n       }\n     });\n     ```\n      @method urlForFindRecord\n     @param {String} id\n     @param {String} modelName\n     @param {Snapshot} snapshot\n     @return {String} url\n      */\n    urlForFindRecord(id, modelName, snapshot) {\n      return this._buildURL(modelName, id);\n    },\n\n    /**\n     Builds a URL for a `store.findAll(type)` call.\n      Example:\n      ```app/adapters/comment.js\n     import JSONAPIAdapter from '@ember-data/adapter/json-api';\n      export default JSONAPIAdapter.extend({\n       urlForFindAll(modelName, snapshot) {\n         return 'data/comments.json';\n       }\n     });\n     ```\n      @method urlForFindAll\n     @param {String} modelName\n     @param {SnapshotRecordArray} snapshot\n     @return {String} url\n     */\n    urlForFindAll(modelName, snapshot) {\n      return this._buildURL(modelName);\n    },\n\n    /**\n     Builds a URL for a `store.query(type, query)` call.\n      Example:\n      ```app/adapters/application.js\n     import RESTAdapter from '@ember-data/adapter/rest';\n      export default RESTAdapter.extend({\n       host: 'https://api.github.com',\n       urlForQuery (query, modelName) {\n         switch(modelName) {\n           case 'repo':\n             return `https://api.github.com/orgs/${query.orgId}/repos`;\n           default:\n             return this._super(...arguments);\n         }\n       }\n     });\n     ```\n      @method urlForQuery\n     @param {Object} query\n     @param {String} modelName\n     @return {String} url\n     */\n    urlForQuery(query, modelName) {\n      return this._buildURL(modelName);\n    },\n\n    /**\n     Builds a URL for a `store.queryRecord(type, query)` call.\n      Example:\n      ```app/adapters/application.js\n     import RESTAdapter from '@ember-data/adapter/rest';\n      export default RESTAdapter.extend({\n       urlForQueryRecord({ slug }, modelName) {\n         let baseUrl = this.buildURL();\n         return `${baseUrl}/${encodeURIComponent(slug)}`;\n       }\n     });\n     ```\n      @method urlForQueryRecord\n     @param {Object} query\n     @param {String} modelName\n     @return {String} url\n     */\n    urlForQueryRecord(query, modelName) {\n      return this._buildURL(modelName);\n    },\n\n    /**\n     Builds a URL for coalescing multiple `store.findRecord(type, id)`\n     records into 1 request when the adapter's `coalesceFindRequests`\n     property is `true`.\n      Example:\n      ```app/adapters/application.js\n     import RESTAdapter from '@ember-data/adapter/rest';\n      export default RESTAdapter.extend({\n       urlForFindMany(ids, modelName) {\n         let baseUrl = this.buildURL();\n         return `${baseUrl}/coalesce`;\n       }\n     });\n     ```\n      @method urlForFindMany\n     @param {Array} ids\n     @param {String} modelName\n     @param {Array} snapshots\n     @return {String} url\n     */\n    urlForFindMany(ids, modelName, snapshots) {\n      return this._buildURL(modelName);\n    },\n\n    /**\n     Builds a URL for fetching an async `hasMany` relationship when a URL\n     is not provided by the server.\n      Example:\n      ```app/adapters/application.js\n     import JSONAPIAdapter from '@ember-data/adapter/json-api';\n      export default JSONAPIAdapter.extend({\n       urlForFindHasMany(id, modelName, snapshot) {\n         let baseUrl = this.buildURL(modelName, id);\n         return `${baseUrl}/relationships`;\n       }\n     });\n     ```\n      @method urlForFindHasMany\n     @param {String} id\n     @param {String} modelName\n     @param {Snapshot} snapshot\n     @return {String} url\n     */\n    urlForFindHasMany(id, modelName, snapshot) {\n      return this._buildURL(modelName, id);\n    },\n\n    /**\n     Builds a URL for fetching an async `belongsTo` relationship when a url\n     is not provided by the server.\n      Example:\n      ```app/adapters/application.js\n     import JSONAPIAdapter from '@ember-data/adapter/json-api';\n      export default JSONAPIAdapter.extend({\n       urlForFindBelongsTo(id, modelName, snapshot) {\n         let baseUrl = this.buildURL(modelName, id);\n         return `${baseUrl}/relationships`;\n       }\n     });\n     ```\n      @method urlForFindBelongsTo\n     @param {String} id\n     @param {String} modelName\n     @param {Snapshot} snapshot\n     @return {String} url\n     */\n    urlForFindBelongsTo(id, modelName, snapshot) {\n      return this._buildURL(modelName, id);\n    },\n\n    /**\n     Builds a URL for a `record.save()` call when the record was created\n     locally using `store.createRecord()`.\n      Example:\n      ```app/adapters/application.js\n     import RESTAdapter from '@ember-data/adapter/rest';\n      export default RESTAdapter.extend({\n       urlForCreateRecord(modelName, snapshot) {\n         return this._super(...arguments) + '/new';\n       }\n     });\n     ```\n      @method urlForCreateRecord\n     @param {String} modelName\n     @param {Snapshot} snapshot\n     @return {String} url\n     */\n    urlForCreateRecord(modelName, snapshot) {\n      return this._buildURL(modelName);\n    },\n\n    /**\n     Builds a URL for a `record.save()` call when the record has been updated locally.\n      Example:\n      ```app/adapters/application.js\n     import RESTAdapter from '@ember-data/adapter/rest';\n      export default RESTAdapter.extend({\n       urlForUpdateRecord(id, modelName, snapshot) {\n         return `/${id}/feed?access_token=${snapshot.adapterOptions.token}`;\n       }\n     });\n     ```\n      @method urlForUpdateRecord\n     @param {String} id\n     @param {String} modelName\n     @param {Snapshot} snapshot\n     @return {String} url\n     */\n    urlForUpdateRecord(id, modelName, snapshot) {\n      return this._buildURL(modelName, id);\n    },\n\n    /**\n     Builds a URL for a `record.save()` call when the record has been deleted locally.\n      Example:\n      ```app/adapters/application.js\n     import RESTAdapter from '@ember-data/adapter/rest';\n      export default RESTAdapter.extend({\n       urlForDeleteRecord(id, modelName, snapshot) {\n         return this._super(...arguments) + '/destroy';\n       }\n     });\n     ```\n      @method urlForDeleteRecord\n     @param {String} id\n     @param {String} modelName\n     @param {Snapshot} snapshot\n     @return {String} url\n     */\n    urlForDeleteRecord(id, modelName, snapshot) {\n      return this._buildURL(modelName, id);\n    },\n\n    /**\n      @method urlPrefix\n      @private\n      @param {String} path\n      @param {String} parentURL\n      @return {String} urlPrefix\n    */\n    urlPrefix(path, parentURL) {\n      var host = Ember.get(this, 'host');\n      var namespace = Ember.get(this, 'namespace');\n\n      if (!host || host === '/') {\n        host = '';\n      }\n\n      if (path) {\n        // Protocol relative url\n        if (/^\\/\\//.test(path) || /http(s)?:\\/\\//.test(path)) {\n          // Do nothing, the full host is already included.\n          return path; // Absolute path\n        } else if (path.charAt(0) === '/') {\n          return `${host}${path}`; // Relative path\n        } else {\n          return `${parentURL}/${path}`;\n        }\n      } // No path provided\n\n\n      var url = [];\n\n      if (host) {\n        url.push(host);\n      }\n\n      if (namespace) {\n        url.push(namespace);\n      }\n\n      return url.join('/');\n    },\n\n    /**\n      Determines the pathname for a given type.\n       By default, it pluralizes the type's name (for example,\n      'post' becomes 'posts' and 'person' becomes 'people').\n       ### Pathname customization\n       For example, if you have an object `LineItem` with an\n      endpoint of `/line_items/`.\n       ```app/adapters/application.js\n      import RESTAdapter from '@ember-data/adapter/rest';\n      import { decamelize } from '@ember/string';\n      import { pluralize } from 'ember-inflector';\n       export default RESTAdapter.extend({\n        pathForType: function(modelName) {\n          var decamelized = decamelize(modelName);\n          return pluralize(decamelized);\n        }\n      });\n      ```\n       @method pathForType\n      @param {String} modelName\n      @return {String} path\n    **/\n    pathForType(modelName) {\n      var camelized = Ember.String.camelize(modelName);\n      return emberInflector.pluralize(camelized);\n    }\n\n  });\n\n  function serializeIntoHash(store, modelClass, snapshot, options = {\n    includeId: true\n  }) {\n    var serializer = store.serializerFor(modelClass.modelName);\n\n    if (typeof serializer.serializeIntoHash === 'function') {\n      var data = {};\n      serializer.serializeIntoHash(data, modelClass, snapshot, options);\n      return data;\n    }\n\n    return serializer.serialize(snapshot, options);\n  }\n\n  exports.BuildURLMixin = buildUrlMixin;\n  exports.determineBodyPromise = determineBodyPromise;\n  exports.fetch = getFetchFunction;\n  exports.parseResponseHeaders = parseResponseHeaders;\n  exports.serializeIntoHash = serializeIntoHash;\n  exports.serializeQueryParams = serializeQueryParams;\n\n  Object.defineProperty(exports, '__esModule', { value: true });\n\n});\n","define(\"@ember-data/adapter/error\", [\"exports\", \"@ember-data/store/-private\"], function (_exports, _private) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"errorsHashToArray\", {\n    enumerable: true,\n    get: function () {\n      return _private.errorsHashToArray;\n    }\n  });\n  Object.defineProperty(_exports, \"errorsArrayToHash\", {\n    enumerable: true,\n    get: function () {\n      return _private.errorsArrayToHash;\n    }\n  });\n  _exports.ServerError = _exports.ConflictError = _exports.NotFoundError = _exports.ForbiddenError = _exports.UnauthorizedError = _exports.AbortError = _exports.TimeoutError = _exports.InvalidError = _exports.default = void 0;\n\n  /**\n    @module @ember-data/adapter\n  */\n\n  /**\n    A `AdapterError` is used by an adapter to signal that an error occurred\n    during a request to an external API. It indicates a generic error, and\n    subclasses are used to indicate specific error states. The following\n    subclasses are provided:\n  \n    - `InvalidError`\n    - `TimeoutError`\n    - `AbortError`\n    - `UnauthorizedError`\n    - `ForbiddenError`\n    - `NotFoundError`\n    - `ConflictError`\n    - `ServerError`\n  \n    To create a custom error to signal a specific error state in communicating\n    with an external API, extend the `AdapterError`. For example, if the\n    external API exclusively used HTTP `503 Service Unavailable` to indicate\n    it was closed for maintenance:\n  \n    ```app/adapters/maintenance-error.js\n    import AdapterError from '@ember-data/adapter/error';\n  \n    export default AdapterError.extend({ message: \"Down for maintenance.\" });\n    ```\n  \n    This error would then be returned by an adapter's `handleResponse` method:\n  \n    ```app/adapters/application.js\n    import JSONAPIAdapter from '@ember-data/adapter/json-api';\n    import MaintenanceError from './maintenance-error';\n  \n    export default JSONAPIAdapter.extend({\n      handleResponse(status) {\n        if (503 === status) {\n          return new MaintenanceError();\n        }\n  \n        return this._super(...arguments);\n      }\n    });\n    ```\n  \n    And can then be detected in an application and used to send the user to an\n    `under-maintenance` route:\n  \n    ```app/routes/application.js\n    import Route from '@ember/routing/route';\n    import MaintenanceError from '../adapters/maintenance-error';\n  \n    export default Route.extend({\n      actions: {\n        error(error, transition) {\n          if (error instanceof MaintenanceError) {\n            this.transitionTo('under-maintenance');\n            return;\n          }\n  \n          // ...other error handling logic\n        }\n      }\n    });\n    ```\n  \n    @class AdapterError\n  */\n  function AdapterError(errors, message = 'Adapter operation failed') {\n    this.isAdapterError = true;\n    var error = Ember.Error.call(this, message); // in ember 3.8+ Error is a Native Error and we don't\n    // gain these automatically from the EmberError.call\n\n    if (error) {\n      this.stack = error.stack;\n      this.description = error.description;\n      this.fileName = error.fileName;\n      this.lineNumber = error.lineNumber;\n      this.message = error.message;\n      this.name = error.name;\n      this.number = error.number;\n    }\n\n    this.errors = errors || [{\n      title: 'Adapter Error',\n      detail: message\n    }];\n  }\n\n  var _default = AdapterError;\n  _exports.default = _default;\n\n  function extendFn(ErrorClass) {\n    return function ({\n      message: defaultMessage\n    } = {}) {\n      return extend(ErrorClass, defaultMessage);\n    };\n  }\n\n  function extend(ParentErrorClass, defaultMessage) {\n    var ErrorClass = function (errors, message) {\n      (true && !(Array.isArray(errors || [])) && Ember.assert('`AdapterError` expects json-api formatted errors array.', Array.isArray(errors || [])));\n      ParentErrorClass.call(this, errors, message || defaultMessage);\n    };\n\n    ErrorClass.prototype = Object.create(ParentErrorClass.prototype);\n    ErrorClass.extend = extendFn(ErrorClass);\n    return ErrorClass;\n  }\n\n  AdapterError.prototype = Object.create(Ember.Error.prototype);\n  AdapterError.prototype.code = 'AdapterError';\n  AdapterError.extend = extendFn(AdapterError);\n  /**\n    A `InvalidError` is used by an adapter to signal the external API\n    was unable to process a request because the content was not\n    semantically correct or meaningful per the API. Usually, this means a\n    record failed some form of server-side validation. When a promise\n    from an adapter is rejected with a `InvalidError` the record will\n    transition to the `invalid` state and the errors will be set to the\n    `errors` property on the record.\n  \n    For Ember Data to correctly map errors to their corresponding\n    properties on the model, Ember Data expects each error to be\n    a valid JSON-API error object with a `source/pointer` that matches\n    the property name. For example, if you had a Post model that\n    looked like this.\n  \n    ```app/models/post.js\n    import Model, { attr } from '@ember-data/model';\n  \n    export default Model.extend({\n      title: attr('string'),\n      content: attr('string')\n    });\n    ```\n  \n    To show an error from the server related to the `title` and\n    `content` properties your adapter could return a promise that\n    rejects with a `InvalidError` object that looks like this:\n  \n    ```app/adapters/post.js\n    import RSVP from 'RSVP';\n    import RESTAdapter from '@ember-data/adapter/rest';\n    import { InvalidError } from '@ember-data/adapter/error';\n  \n    export default RESTAdapter.extend({\n      updateRecord() {\n        // Fictional adapter that always rejects\n        return RSVP.reject(new InvalidError([\n          {\n            detail: 'Must be unique',\n            source: { pointer: '/data/attributes/title' }\n          },\n          {\n            detail: 'Must not be blank',\n            source: { pointer: '/data/attributes/content'}\n          }\n        ]));\n      }\n    });\n    ```\n  \n    Your backend may use different property names for your records the\n    store will attempt to extract and normalize the errors using the\n    serializer's `extractErrors` method before the errors get added to\n    the model. As a result, it is safe for the `InvalidError` to\n    wrap the error payload unaltered.\n  \n    @class InvalidError\n    @extends AdapterError\n  */\n\n  var InvalidError = extend(AdapterError, 'The adapter rejected the commit because it was invalid');\n  _exports.InvalidError = InvalidError;\n  InvalidError.prototype.code = 'InvalidError';\n  /**\n    A `TimeoutError` is used by an adapter to signal that a request\n    to the external API has timed out. I.e. no response was received from\n    the external API within an allowed time period.\n  \n    An example use case would be to warn the user to check their internet\n    connection if an adapter operation has timed out:\n  \n    ```app/routes/application.js\n    import Route from '@ember/routing/route';\n    import { TimeoutError } from '@ember-data/adapter/error';\n  \n    export default Route.extend({\n      actions: {\n        error(error, transition) {\n          if (error instanceof TimeoutError) {\n            // alert the user\n            alert('Are you still connected to the internet?');\n            return;\n          }\n  \n          // ...other error handling logic\n        }\n      }\n    });\n    ```\n  \n    @class TimeoutError\n    @extends AdapterError\n  */\n\n  var TimeoutError = extend(AdapterError, 'The adapter operation timed out');\n  _exports.TimeoutError = TimeoutError;\n  TimeoutError.prototype.code = 'TimeoutError';\n  /**\n    A `AbortError` is used by an adapter to signal that a request to\n    the external API was aborted. For example, this can occur if the user\n    navigates away from the current page after a request to the external API\n    has been initiated but before a response has been received.\n  \n    @class AbortError\n    @extends AdapterError\n  */\n\n  var AbortError = extend(AdapterError, 'The adapter operation was aborted');\n  _exports.AbortError = AbortError;\n  AbortError.prototype.code = 'AbortError';\n  /**\n    A `UnauthorizedError` equates to a HTTP `401 Unauthorized` response\n    status. It is used by an adapter to signal that a request to the external\n    API was rejected because authorization is required and has failed or has not\n    yet been provided.\n  \n    An example use case would be to redirect the user to a login route if a\n    request is unauthorized:\n  \n    ```app/routes/application.js\n    import Route from '@ember/routing/route';\n    import { UnauthorizedError } from '@ember-data/adapter/error';\n  \n    export default Route.extend({\n      actions: {\n        error(error, transition) {\n          if (error instanceof UnauthorizedError) {\n            // go to the sign in route\n            this.transitionTo('login');\n            return;\n          }\n  \n          // ...other error handling logic\n        }\n      }\n    });\n    ```\n  \n    @class UnauthorizedError\n    @extends AdapterError\n  */\n\n  var UnauthorizedError = extend(AdapterError, 'The adapter operation is unauthorized');\n  _exports.UnauthorizedError = UnauthorizedError;\n  UnauthorizedError.prototype.code = 'UnauthorizedError';\n  /**\n    A `ForbiddenError` equates to a HTTP `403 Forbidden` response status.\n    It is used by an adapter to signal that a request to the external API was\n    valid but the server is refusing to respond to it. If authorization was\n    provided and is valid, then the authenticated user does not have the\n    necessary permissions for the request.\n  \n    @class ForbiddenError\n    @extends AdapterError\n  */\n\n  var ForbiddenError = extend(AdapterError, 'The adapter operation is forbidden');\n  _exports.ForbiddenError = ForbiddenError;\n  ForbiddenError.prototype.code = 'ForbiddenError';\n  /**\n    A `NotFoundError` equates to a HTTP `404 Not Found` response status.\n    It is used by an adapter to signal that a request to the external API\n    was rejected because the resource could not be found on the API.\n  \n    An example use case would be to detect if the user has entered a route\n    for a specific model that does not exist. For example:\n  \n    ```app/routes/post.js\n    import Route from '@ember/routing/route';\n    import { NotFoundError } from '@ember-data/adapter/error';\n  \n    export default Route.extend({\n      model(params) {\n        return this.get('store').findRecord('post', params.post_id);\n      },\n  \n      actions: {\n        error(error, transition) {\n          if (error instanceof NotFoundError) {\n            // redirect to a list of all posts instead\n            this.transitionTo('posts');\n          } else {\n            // otherwise let the error bubble\n            return true;\n          }\n        }\n      }\n    });\n    ```\n  \n    @class NotFoundError\n    @extends AdapterError\n  */\n\n  var NotFoundError = extend(AdapterError, 'The adapter could not find the resource');\n  _exports.NotFoundError = NotFoundError;\n  NotFoundError.prototype.code = 'NotFoundError';\n  /**\n    A `ConflictError` equates to a HTTP `409 Conflict` response status.\n    It is used by an adapter to indicate that the request could not be processed\n    because of a conflict in the request. An example scenario would be when\n    creating a record with a client-generated ID but that ID is already known\n    to the external API.\n  \n    @class ConflictError\n    @extends AdapterError\n  */\n\n  var ConflictError = extend(AdapterError, 'The adapter operation failed due to a conflict');\n  _exports.ConflictError = ConflictError;\n  ConflictError.prototype.code = 'ConflictError';\n  /**\n    A `ServerError` equates to a HTTP `500 Internal Server Error` response\n    status. It is used by the adapter to indicate that a request has failed\n    because of an error in the external API.\n  \n    @class ServerError\n    @extends AdapterError\n  */\n\n  var ServerError = extend(AdapterError, 'The adapter operation failed due to a server error');\n  _exports.ServerError = ServerError;\n  ServerError.prototype.code = 'ServerError';\n});","define(\"@ember-data/adapter/index\", [\"exports\", \"@ember-data/adapter/-private\"], function (_exports, _private) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"BuildURLMixin\", {\n    enumerable: true,\n    get: function () {\n      return _private.BuildURLMixin;\n    }\n  });\n  _exports.default = void 0;\n\n  /**\n    An adapter is an object that receives requests from a store and\n    translates them into the appropriate action to take against your\n    persistence layer. The persistence layer is usually an HTTP API but\n    may be anything, such as the browser's local storage. Typically the\n    adapter is not invoked directly instead its functionality is accessed\n    through the `store`.\n  \n    ### Creating an Adapter\n  \n    Create a new subclass of `Adapter` in the `app/adapters` folder:\n  \n    ```app/adapters/application.js\n    import Adapter from '@ember-data/adapter';\n  \n    export default Adapter.extend({\n      // ...your code here\n    });\n    ```\n  \n    Model-specific adapters can be created by putting your adapter\n    class in an `app/adapters/` + `model-name` + `.js` file of the application.\n  \n    ```app/adapters/post.js\n    import Adapter from '@ember-data/adapter';\n  \n    export default Adapter.extend({\n      // ...Post-specific adapter code goes here\n    });\n    ```\n  \n    `Adapter` is an abstract base class that you should override in your\n    application to customize it for your backend. The minimum set of methods\n    that you should implement is:\n  \n      * `findRecord()`\n      * `createRecord()`\n      * `updateRecord()`\n      * `deleteRecord()`\n      * `findAll()`\n      * `query()`\n  \n    To improve the network performance of your application, you can optimize\n    your adapter by overriding these lower-level methods:\n  \n      * `findMany()`\n  \n  \n    For an example of the implementation, see `RESTAdapter`, the\n    included REST adapter.\n  \n    @module @ember-data/adapter\n    @class Adapter\n    @extends EmberObject\n  */\n  var _default = Ember.Object.extend({\n    /**\n      If you would like your adapter to use a custom serializer you can\n      set the `defaultSerializer` property to be the name of the custom\n      serializer.\n       Note the `defaultSerializer` serializer has a lower priority than\n      a model specific serializer (i.e. `PostSerializer`) or the\n      `application` serializer.\n       ```app/adapters/django.js\n      import Adapter from '@ember-data/adapter';\n       export default Adapter.extend({\n        defaultSerializer: 'django'\n      });\n      ```\n       @deprecated\n      @property defaultSerializer\n      @type {String}\n    */\n    defaultSerializer: '-default',\n\n    /**\n      The `findRecord()` method is invoked when the store is asked for a record that\n      has not previously been loaded. In response to `findRecord()` being called, you\n      should query your persistence layer for a record with the given ID. The `findRecord`\n      method should return a promise that will resolve to a JavaScript object that will be\n      normalized by the serializer.\n       Here is an example of the `findRecord` implementation:\n       ```app/adapters/application.js\n      import Adapter from '@ember-data/adapter';\n      import RSVP from 'RSVP';\n      import $ from 'jquery';\n       export default Adapter.extend({\n        findRecord(store, type, id, snapshot) {\n          return new RSVP.Promise(function(resolve, reject) {\n            $.getJSON(`/${type.modelName}/${id}`).then(function(data) {\n              resolve(data);\n            }, function(jqXHR) {\n              reject(jqXHR);\n            });\n          });\n        }\n      });\n      ```\n       @method findRecord\n      @param {Store} store\n      @param {Model} type\n      @param {String} id\n      @param {Snapshot} snapshot\n      @return {Promise} promise\n    */\n    findRecord: null,\n\n    /**\n      The `findAll()` method is used to retrieve all records for a given type.\n       Example\n       ```app/adapters/application.js\n      import Adapter from '@ember-data/adapter';\n      import RSVP from 'RSVP';\n      import $ from 'jquery';\n       export default Adapter.extend({\n        findAll(store, type) {\n          return new RSVP.Promise(function(resolve, reject) {\n            $.getJSON(`/${type.modelName}`).then(function(data) {\n              resolve(data);\n            }, function(jqXHR) {\n              reject(jqXHR);\n            });\n          });\n        }\n      });\n      ```\n       @method findAll\n      @param {Store} store\n      @param {Model} type\n      @param {undefined} neverSet a value is never provided to this argument\n      @param {SnapshotRecordArray} snapshotRecordArray\n      @return {Promise} promise\n    */\n    findAll: null,\n\n    /**\n      This method is called when you call `query` on the store.\n       Example\n       ```app/adapters/application.js\n      import Adapter from '@ember-data/adapter';\n      import RSVP from 'RSVP';\n      import $ from 'jquery';\n       export default Adapter.extend({\n        query(store, type, query) {\n          return new RSVP.Promise(function(resolve, reject) {\n            $.getJSON(`/${type.modelName}`, query).then(function(data) {\n              resolve(data);\n            }, function(jqXHR) {\n              reject(jqXHR);\n            });\n          });\n        }\n      });\n      ```\n       @method query\n      @param {Store} store\n      @param {Model} type\n      @param {Object} query\n      @param {AdapterPopulatedRecordArray} recordArray\n      @return {Promise} promise\n    */\n    query: null,\n\n    /**\n      The `queryRecord()` method is invoked when the store is asked for a single\n      record through a query object.\n       In response to `queryRecord()` being called, you should always fetch fresh\n      data. Once found, you can asynchronously call the store's `push()` method\n      to push the record into the store.\n       Here is an example `queryRecord` implementation:\n       Example\n       ```app/adapters/application.js\n      import Adapter, { BuildURLMixin } from '@ember-data/adapter';\n      import RSVP from 'RSVP';\n      import $ from 'jquery';\n       export default Adapter.extend(BuildURLMixin, {\n        queryRecord(store, type, query) {\n          return new RSVP.Promise(function(resolve, reject) {\n            $.getJSON(`/${type.modelName}`, query).then(function(data) {\n              resolve(data);\n            }, function(jqXHR) {\n              reject(jqXHR);\n            });\n          });\n        }\n      });\n      ```\n       @method queryRecord\n      @param {Store} store\n      @param {subclass of Model} type\n      @param {Object} query\n      @return {Promise} promise\n    */\n    queryRecord: null,\n\n    /**\n      If the globally unique IDs for your records should be generated on the client,\n      implement the `generateIdForRecord()` method. This method will be invoked\n      each time you create a new record, and the value returned from it will be\n      assigned to the record's `primaryKey`.\n       Most traditional REST-like HTTP APIs will not use this method. Instead, the ID\n      of the record will be set by the server, and your adapter will update the store\n      with the new ID when it calls `didCreateRecord()`. Only implement this method if\n      you intend to generate record IDs on the client-side.\n       The `generateIdForRecord()` method will be invoked with the requesting store as\n      the first parameter and the newly created record as the second parameter:\n       ```javascript\n      import Adapter from '@ember-data/adapter';\n      import { v4 } from 'uuid';\n       export default Adapter.extend({\n        generateIdForRecord(store, type, inputProperties) {\n          return v4();\n        }\n      });\n      ```\n       @method generateIdForRecord\n      @param {Store} store\n      @param {Model} type   the Model class of the record\n      @param {Object} inputProperties a hash of properties to set on the\n        newly created record.\n      @return {(String|Number)} id\n    */\n    generateIdForRecord: null,\n\n    /**\n      Proxies to the serializer's `serialize` method.\n       Example\n       ```app/adapters/application.js\n      import Adapter from '@ember-data/adapter';\n       export default Adapter.extend({\n        createRecord(store, type, snapshot) {\n          let data = this.serialize(snapshot, { includeId: true });\n          let url = `/${type.modelName}`;\n           // ...\n        }\n      });\n      ```\n       @method serialize\n      @param {Snapshot} snapshot\n      @param {Object}   options\n      @return {Object} serialized snapshot\n    */\n    serialize(snapshot, options) {\n      return snapshot.serialize(options);\n    },\n\n    /**\n      Implement this method in a subclass to handle the creation of\n      new records.\n       Serializes the record and sends it to the server.\n       Example\n       ```app/adapters/application.js\n      import Adapter from '@ember-data/adapter';\n      import { run } from '@ember/runloop';\n      import RSVP from 'RSVP';\n      import $ from 'jquery';\n       export default Adapter.extend({\n        createRecord(store, type, snapshot) {\n          let data = this.serialize(snapshot, { includeId: true });\n           return new RSVP.Promise(function(resolve, reject) {\n            $.ajax({\n              type: 'POST',\n              url: `/${type.modelName}`,\n              dataType: 'json',\n              data: data\n            }).then(function(data) {\n              run(null, resolve, data);\n            }, function(jqXHR) {\n              jqXHR.then = null; // tame jQuery's ill mannered promises\n              run(null, reject, jqXHR);\n            });\n          });\n        }\n      });\n      ```\n       @method createRecord\n      @param {Store} store\n      @param {Model} type   the Model class of the record\n      @param {Snapshot} snapshot\n      @return {Promise} promise\n    */\n    createRecord: null,\n\n    /**\n      Implement this method in a subclass to handle the updating of\n      a record.\n       Serializes the record update and sends it to the server.\n       The updateRecord method is expected to return a promise that will\n      resolve with the serialized record. This allows the backend to\n      inform the Ember Data store the current state of this record after\n      the update. If it is not possible to return a serialized record\n      the updateRecord promise can also resolve with `undefined` and the\n      Ember Data store will assume all of the updates were successfully\n      applied on the backend.\n       Example\n       ```app/adapters/application.js\n      import Adapter from '@ember-data/adapter';\n      import { run } from '@ember/runloop';\n      import RSVP from 'RSVP';\n      import $ from 'jquery';\n       export default Adapter.extend({\n        updateRecord(store, type, snapshot) {\n          let data = this.serialize(snapshot, { includeId: true });\n          let id = snapshot.id;\n           return new RSVP.Promise(function(resolve, reject) {\n            $.ajax({\n              type: 'PUT',\n              url: `/${type.modelName}/${id}`,\n              dataType: 'json',\n              data: data\n            }).then(function(data) {\n              run(null, resolve, data);\n            }, function(jqXHR) {\n              jqXHR.then = null; // tame jQuery's ill mannered promises\n              run(null, reject, jqXHR);\n            });\n          });\n        }\n      });\n      ```\n       @method updateRecord\n      @param {Store} store\n      @param {Model} type   the Model class of the record\n      @param {Snapshot} snapshot\n      @return {Promise} promise\n    */\n    updateRecord: null,\n\n    /**\n      Implement this method in a subclass to handle the deletion of\n      a record.\n       Sends a delete request for the record to the server.\n       Example\n       ```app/adapters/application.js\n      import Adapter from '@ember-data/adapter';\n      import { run } from '@ember/runloop';\n      import RSVP from 'RSVP';\n      import $ from 'jquery';\n       export default Adapter.extend({\n        deleteRecord(store, type, snapshot) {\n          let data = this.serialize(snapshot, { includeId: true });\n          let id = snapshot.id;\n           return new RSVP.Promise(function(resolve, reject) {\n            $.ajax({\n              type: 'DELETE',\n              url: `/${type.modelName}/${id}`,\n              dataType: 'json',\n              data: data\n            }).then(function(data) {\n              run(null, resolve, data);\n            }, function(jqXHR) {\n              jqXHR.then = null; // tame jQuery's ill mannered promises\n              run(null, reject, jqXHR);\n            });\n          });\n        }\n      });\n      ```\n       @method deleteRecord\n      @param {Store} store\n      @param {Model} type   the Model class of the record\n      @param {Snapshot} snapshot\n      @return {Promise} promise\n    */\n    deleteRecord: null,\n\n    /**\n      By default the store will try to coalesce all `fetchRecord` calls within the same runloop\n      into as few requests as possible by calling groupRecordsForFindMany and passing it into a findMany call.\n      You can opt out of this behaviour by either not implementing the findMany hook or by setting\n      coalesceFindRequests to false.\n       @property coalesceFindRequests\n      @type {boolean}\n    */\n    coalesceFindRequests: true,\n\n    /**\n      The store will call `findMany` instead of multiple `findRecord`\n      requests to find multiple records at once if coalesceFindRequests\n      is true.\n       ```app/adapters/application.js\n      import Adapter from '@ember-data/adapter';\n      import { run } from '@ember/runloop';\n      import RSVP from 'RSVP';\n      import $ from 'jquery';\n       export default Adapter.extend({\n        findMany(store, type, ids, snapshots) {\n          return new RSVP.Promise(function(resolve, reject) {\n            $.ajax({\n              type: 'GET',\n              url: `/${type.modelName}/`,\n              dataType: 'json',\n              data: { filter: { id: ids.join(',') } }\n            }).then(function(data) {\n              run(null, resolve, data);\n            }, function(jqXHR) {\n              jqXHR.then = null; // tame jQuery's ill mannered promises\n              run(null, reject, jqXHR);\n            });\n          });\n        }\n      });\n      ```\n       @method findMany\n      @param {Store} store\n      @param {Model} type   the Model class of the records\n      @param {Array}    ids\n      @param {Array} snapshots\n      @return {Promise} promise\n    */\n    findMany: null,\n\n    /**\n      Organize records into groups, each of which is to be passed to separate\n      calls to `findMany`.\n       For example, if your API has nested URLs that depend on the parent, you will\n      want to group records by their parent.\n       The default implementation returns the records as a single group.\n       @method groupRecordsForFindMany\n      @param {Store} store\n      @param {Array} snapshots\n      @return {Array}  an array of arrays of records, each of which is to be\n                        loaded separately by `findMany`.\n    */\n    groupRecordsForFindMany(store, snapshots) {\n      return [snapshots];\n    },\n\n    /**\n      This method is used by the store to determine if the store should\n      reload a record from the adapter when a record is requested by\n      `store.findRecord`.\n       If this method returns `true`, the store will re-fetch a record from\n      the adapter. If this method returns `false`, the store will resolve\n      immediately using the cached record.\n       For example, if you are building an events ticketing system, in which users\n      can only reserve tickets for 20 minutes at a time, and want to ensure that\n      in each route you have data that is no more than 20 minutes old you could\n      write:\n       ```javascript\n      shouldReloadRecord(store, ticketSnapshot) {\n        let lastAccessedAt = ticketSnapshot.attr('lastAccessedAt');\n        let timeDiff = moment().diff(lastAccessedAt, 'minutes');\n         if (timeDiff > 20) {\n          return true;\n        } else {\n          return false;\n        }\n      }\n      ```\n       This method would ensure that whenever you do `store.findRecord('ticket',\n      id)` you will always get a ticket that is no more than 20 minutes old. In\n      case the cached version is more than 20 minutes old, `findRecord` will not\n      resolve until you fetched the latest version.\n       By default this hook returns `false`, as most UIs should not block user\n      interactions while waiting on data update.\n       Note that, with default settings, `shouldBackgroundReloadRecord` will always\n      re-fetch the records in the background even if `shouldReloadRecord` returns\n      `false`. You can override `shouldBackgroundReloadRecord` if this does not\n      suit your use case.\n       @since 1.13.0\n      @method shouldReloadRecord\n      @param {Store} store\n      @param {Snapshot} snapshot\n      @return {Boolean}\n    */\n    shouldReloadRecord(store, snapshot) {\n      return false;\n    },\n\n    /**\n      This method is used by the store to determine if the store should\n      reload all records from the adapter when records are requested by\n      `store.findAll`.\n       If this method returns `true`, the store will re-fetch all records from\n      the adapter. If this method returns `false`, the store will resolve\n      immediately using the cached records.\n       For example, if you are building an events ticketing system, in which users\n      can only reserve tickets for 20 minutes at a time, and want to ensure that\n      in each route you have data that is no more than 20 minutes old you could\n      write:\n       ```javascript\n      shouldReloadAll(store, snapshotArray) {\n        let snapshots = snapshotArray.snapshots();\n         return snapshots.any((ticketSnapshot) => {\n          let lastAccessedAt = ticketSnapshot.attr('lastAccessedAt');\n          let timeDiff = moment().diff(lastAccessedAt, 'minutes');\n           if (timeDiff > 20) {\n            return true;\n          } else {\n            return false;\n          }\n        });\n      }\n      ```\n       This method would ensure that whenever you do `store.findAll('ticket')` you\n      will always get a list of tickets that are no more than 20 minutes old. In\n      case a cached version is more than 20 minutes old, `findAll` will not\n      resolve until you fetched the latest versions.\n       By default, this method returns `true` if the passed `snapshotRecordArray`\n      is empty (meaning that there are no records locally available yet),\n      otherwise, it returns `false`.\n       Note that, with default settings, `shouldBackgroundReloadAll` will always\n      re-fetch all the records in the background even if `shouldReloadAll` returns\n      `false`. You can override `shouldBackgroundReloadAll` if this does not suit\n      your use case.\n       @since 1.13.0\n      @method shouldReloadAll\n      @param {Store} store\n      @param {SnapshotRecordArray} snapshotRecordArray\n      @return {Boolean}\n    */\n    shouldReloadAll(store, snapshotRecordArray) {\n      return !snapshotRecordArray.length;\n    },\n\n    /**\n      This method is used by the store to determine if the store should\n      reload a record after the `store.findRecord` method resolves a\n      cached record.\n       This method is *only* checked by the store when the store is\n      returning a cached record.\n       If this method returns `true` the store will re-fetch a record from\n      the adapter.\n       For example, if you do not want to fetch complex data over a mobile\n      connection, or if the network is down, you can implement\n      `shouldBackgroundReloadRecord` as follows:\n       ```javascript\n      shouldBackgroundReloadRecord(store, snapshot) {\n        let { downlink, effectiveType } = navigator.connection;\n         return downlink > 0 && effectiveType === '4g';\n      }\n      ```\n       By default, this hook returns `true` so the data for the record is updated\n      in the background.\n       @since 1.13.0\n      @method shouldBackgroundReloadRecord\n      @param {Store} store\n      @param {Snapshot} snapshot\n      @return {Boolean}\n    */\n    shouldBackgroundReloadRecord(store, snapshot) {\n      return true;\n    },\n\n    /**\n      This method is used by the store to determine if the store should\n      reload a record array after the `store.findAll` method resolves\n      with a cached record array.\n       This method is *only* checked by the store when the store is\n      returning a cached record array.\n       If this method returns `true` the store will re-fetch all records\n      from the adapter.\n       For example, if you do not want to fetch complex data over a mobile\n      connection, or if the network is down, you can implement\n      `shouldBackgroundReloadAll` as follows:\n       ```javascript\n      shouldBackgroundReloadAll(store, snapshotArray) {\n        let { downlink, effectiveType } = navigator.connection;\n         return downlink > 0 && effectiveType === '4g';\n      }\n      ```\n       By default this method returns `true`, indicating that a background reload\n      should always be triggered.\n       @since 1.13.0\n      @method shouldBackgroundReloadAll\n      @param {Store} store\n      @param {SnapshotRecordArray} snapshotRecordArray\n      @return {Boolean}\n    */\n    shouldBackgroundReloadAll(store, snapshotRecordArray) {\n      return true;\n    }\n\n  });\n\n  _exports.default = _default;\n});","define(\"@ember-data/adapter/json-api\", [\"exports\", \"@ember-data/adapter/rest\", \"ember-inflector\", \"@ember-data/adapter/-private\"], function (_exports, _rest, _emberInflector, _private) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n    The `JSONAPIAdapter` is the default adapter used by Ember Data. It\n    is responsible for transforming the store's requests into HTTP\n    requests that follow the [JSON API](http://jsonapi.org/format/)\n    format.\n  \n    ## JSON API Conventions\n  \n    The JSONAPIAdapter uses JSON API conventions for building the URL\n    for a record and selecting the HTTP verb to use with a request. The\n    actions you can take on a record map onto the following URLs in the\n    JSON API adapter:\n  \n  <table>\n    <tr>\n      <th>\n        Action\n      </th>\n      <th>\n        HTTP Verb\n      </th>\n      <th>\n        URL\n      </th>\n    </tr>\n    <tr>\n      <th>\n        `store.findRecord('post', 123)`\n      </th>\n      <td>\n        GET\n      </td>\n      <td>\n        /posts/123\n      </td>\n    </tr>\n    <tr>\n      <th>\n        `store.findAll('post')`\n      </th>\n      <td>\n        GET\n      </td>\n      <td>\n        /posts\n      </td>\n    </tr>\n    <tr>\n      <th>\n        Update `postRecord.save()`\n      </th>\n      <td>\n        PATCH\n      </td>\n      <td>\n        /posts/123\n      </td>\n    </tr>\n    <tr>\n      <th>\n        Create `store.createRecord('post').save()`\n      </th>\n      <td>\n        POST\n      </td>\n      <td>\n        /posts\n      </td>\n    </tr>\n    <tr>\n      <th>\n        Delete `postRecord.destroyRecord()`\n      </th>\n      <td>\n        DELETE\n      </td>\n      <td>\n        /posts/123\n      </td>\n    </tr>\n  </table>\n  \n    ## Success and failure\n  \n    The JSONAPIAdapter will consider a success any response with a\n    status code of the 2xx family (\"Success\"), as well as 304 (\"Not\n    Modified\"). Any other status code will be considered a failure.\n  \n    On success, the request promise will be resolved with the full\n    response payload.\n  \n    Failed responses with status code 422 (\"Unprocessable Entity\") will\n    be considered \"invalid\". The response will be discarded, except for\n    the `errors` key. The request promise will be rejected with a\n    `InvalidError`. This error object will encapsulate the saved\n    `errors` value.\n  \n    Any other status codes will be treated as an adapter error. The\n    request promise will be rejected, similarly to the invalid case,\n    but with an instance of `AdapterError` instead.\n  \n    ### Endpoint path customization\n  \n    Endpoint paths can be prefixed with a `namespace` by setting the\n    namespace property on the adapter:\n  \n    ```app/adapters/application.js\n    import JSONAPIAdapter from '@ember-data/adapter/json-api';\n  \n    export default JSONAPIAdapter.extend({\n      namespace: 'api/1'\n    });\n    ```\n    Requests for the `person` model would now target `/api/1/people/1`.\n  \n    ### Host customization\n  \n    An adapter can target other hosts by setting the `host` property.\n  \n    ```app/adapters/application.js\n    import JSONAPIAdapter from '@ember-data/adapter/json-api';\n  \n    export default JSONAPIAdapter.extend({\n      host: 'https://api.example.com'\n    });\n    ```\n  \n    Requests for the `person` model would now target\n    `https://api.example.com/people/1`.\n  \n    @since 1.13.0\n    @class JSONAPIAdapter\n    @constructor\n    @extends RESTAdapter\n  */\n  var JSONAPIAdapter = _rest.default.extend({\n    defaultSerializer: '-json-api',\n    _defaultContentType: 'application/vnd.api+json',\n\n    /**\n      @method ajaxOptions\n      @private\n      @param {String} url\n      @param {String} type The request type GET, POST, PUT, DELETE etc.\n      @param {Object} options\n      @return {Object}\n    */\n    ajaxOptions(url, type, options = {}) {\n      var hash = this._super(url, type, options);\n\n      hash.headers['Accept'] = hash.headers['Accept'] || 'application/vnd.api+json';\n      return hash;\n    },\n\n    /**\n      By default the JSONAPIAdapter will send each find request coming from a `store.find`\n      or from accessing a relationship separately to the server. If your server supports passing\n      ids as a query string, you can set coalesceFindRequests to true to coalesce all find requests\n      within a single runloop.\n       For example, if you have an initial payload of:\n       ```javascript\n      {\n        data: {\n          id: 1,\n          type: 'post',\n          relationship: {\n            comments: {\n              data: [\n                { id: 1, type: 'comment' },\n                { id: 2, type: 'comment' }\n              ]\n            }\n          }\n        }\n      }\n      ```\n       By default calling `post.get('comments')` will trigger the following requests(assuming the\n      comments haven't been loaded before):\n       ```\n      GET /comments/1\n      GET /comments/2\n      ```\n       If you set coalesceFindRequests to `true` it will instead trigger the following request:\n       ```\n      GET /comments?filter[id]=1,2\n      ```\n       Setting coalesceFindRequests to `true` also works for `store.find` requests and `belongsTo`\n      relationships accessed within the same runloop. If you set `coalesceFindRequests: true`\n       ```javascript\n      store.findRecord('comment', 1);\n      store.findRecord('comment', 2);\n      ```\n       will also send a request to: `GET /comments?filter[id]=1,2`\n       Note: Requests coalescing rely on URL building strategy. So if you override `buildURL` in your app\n      `groupRecordsForFindMany` more likely should be overridden as well in order for coalescing to work.\n       @property coalesceFindRequests\n      @type {boolean}\n    */\n    coalesceFindRequests: false,\n\n    findMany(store, type, ids, snapshots) {\n      var url = this.buildURL(type.modelName, ids, snapshots, 'findMany');\n      return this.ajax(url, 'GET', {\n        data: {\n          filter: {\n            id: ids.join(',')\n          }\n        }\n      });\n    },\n\n    pathForType(modelName) {\n      var dasherized = Ember.String.dasherize(modelName);\n      return (0, _emberInflector.pluralize)(dasherized);\n    },\n\n    updateRecord(store, type, snapshot) {\n      var data = (0, _private.serializeIntoHash)(store, type, snapshot);\n      var url = this.buildURL(type.modelName, snapshot.id, snapshot, 'updateRecord');\n      return this.ajax(url, 'PATCH', {\n        data: data\n      });\n    }\n\n  });\n\n  var _default = JSONAPIAdapter;\n  _exports.default = _default;\n});","define(\"@ember-data/adapter/rest\", [\"exports\", \"@ember-data/adapter\", \"@ember-data/adapter/-private\", \"@ember-data/adapter/error\"], function (_exports, _adapter, _private, _error) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.fetchOptions = fetchOptions;\n  _exports.default = void 0;\n  var hasJQuery = typeof jQuery !== 'undefined';\n  var hasNajax = typeof najax !== 'undefined';\n  /**\n    The REST adapter allows your store to communicate with an HTTP server by\n    transmitting JSON via XHR. Most Ember.js apps that consume a JSON API\n    should use the REST adapter.\n  \n    This adapter is designed around the idea that the JSON exchanged with\n    the server should be conventional.\n  \n    ## Success and failure\n  \n    The REST adapter will consider a success any response with a status code\n    of the 2xx family (\"Success\"), as well as 304 (\"Not Modified\"). Any other\n    status code will be considered a failure.\n  \n    On success, the request promise will be resolved with the full response\n    payload.\n  \n    Failed responses with status code 422 (\"Unprocessable Entity\") will be\n    considered \"invalid\". The response will be discarded, except for the\n    `errors` key. The request promise will be rejected with a `InvalidError`.\n    This error object will encapsulate the saved `errors` value.\n  \n    Any other status codes will be treated as an \"adapter error\". The request\n    promise will be rejected, similarly to the \"invalid\" case, but with\n    an instance of `AdapterError` instead.\n  \n    ## JSON Structure\n  \n    The REST adapter expects the JSON returned from your server to follow\n    these conventions.\n  \n    ### Object Root\n  \n    The JSON payload should be an object that contains the record inside a\n    root property. For example, in response to a `GET` request for\n    `/posts/1`, the JSON should look like this:\n  \n    ```js\n    {\n      \"posts\": {\n        \"id\": 1,\n        \"title\": \"I'm Running to Reform the W3C's Tag\",\n        \"author\": \"Yehuda Katz\"\n      }\n    }\n    ```\n  \n    Similarly, in response to a `GET` request for `/posts`, the JSON should\n    look like this:\n  \n    ```js\n    {\n      \"posts\": [\n        {\n          \"id\": 1,\n          \"title\": \"I'm Running to Reform the W3C's Tag\",\n          \"author\": \"Yehuda Katz\"\n        },\n        {\n          \"id\": 2,\n          \"title\": \"Rails is omakase\",\n          \"author\": \"D2H\"\n        }\n      ]\n    }\n    ```\n  \n    Note that the object root can be pluralized for both a single-object response\n    and an array response: the REST adapter is not strict on this. Further, if the\n    HTTP server responds to a `GET` request to `/posts/1` (e.g. the response to a\n    `findRecord` query) with more than one object in the array, Ember Data will\n    only display the object with the matching ID.\n  \n    ### Conventional Names\n  \n    Attribute names in your JSON payload should be the camelCased versions of\n    the attributes in your Ember.js models.\n  \n    For example, if you have a `Person` model:\n  \n    ```app/models/person.js\n    import Model, { attr } from '@ember-data/model';\n  \n    export default Model.extend({\n      firstName: attr('string'),\n      lastName: attr('string'),\n      occupation: attr('string')\n    });\n    ```\n  \n    The JSON returned should look like this:\n  \n    ```js\n    {\n      \"people\": {\n        \"id\": 5,\n        \"firstName\": \"Zaphod\",\n        \"lastName\": \"Beeblebrox\",\n        \"occupation\": \"President\"\n      }\n    }\n    ```\n  \n    #### Relationships\n  \n    Relationships are usually represented by ids to the record in the\n    relationship. The related records can then be sideloaded in the\n    response under a key for the type.\n  \n    ```js\n    {\n      \"posts\": {\n        \"id\": 5,\n        \"title\": \"I'm Running to Reform the W3C's Tag\",\n        \"author\": \"Yehuda Katz\",\n        \"comments\": [1, 2]\n      },\n      \"comments\": [{\n        \"id\": 1,\n        \"author\": \"User 1\",\n        \"message\": \"First!\",\n      }, {\n        \"id\": 2,\n        \"author\": \"User 2\",\n        \"message\": \"Good Luck!\",\n      }]\n    }\n    ```\n  \n    If the records in the relationship are not known when the response\n    is serialized it's also possible to represent the relationship as a\n    URL using the `links` key in the response. Ember Data will fetch\n    this URL to resolve the relationship when it is accessed for the\n    first time.\n  \n    ```js\n    {\n      \"posts\": {\n        \"id\": 5,\n        \"title\": \"I'm Running to Reform the W3C's Tag\",\n        \"author\": \"Yehuda Katz\",\n        \"links\": {\n          \"comments\": \"/posts/5/comments\"\n        }\n      }\n    }\n    ```\n  \n    ### Errors\n  \n    If a response is considered a failure, the JSON payload is expected to include\n    a top-level key `errors`, detailing any specific issues. For example:\n  \n    ```js\n    {\n      \"errors\": {\n        \"msg\": \"Something went wrong\"\n      }\n    }\n    ```\n  \n    This adapter does not make any assumptions as to the format of the `errors`\n    object. It will simply be passed along as is, wrapped in an instance\n    of `InvalidError` or `AdapterError`. The serializer can interpret it\n    afterwards.\n  \n    ## Customization\n  \n    ### Endpoint path customization\n  \n    Endpoint paths can be prefixed with a `namespace` by setting the namespace\n    property on the adapter:\n  \n    ```app/adapters/application.js\n    import RESTAdapter from '@ember-data/adapter/rest';\n  \n    export default RESTAdapter.extend({\n      namespace: 'api/1'\n    });\n    ```\n    Requests for the `Person` model would now target `/api/1/people/1`.\n  \n    ### Host customization\n  \n    An adapter can target other hosts by setting the `host` property.\n  \n    ```app/adapters/application.js\n    import RESTAdapter from '@ember-data/adapter/rest';\n  \n    export default RESTAdapter.extend({\n      host: 'https://api.example.com'\n    });\n    ```\n  \n    ### Headers customization\n  \n    Some APIs require HTTP headers, e.g. to provide an API key. Arbitrary\n    headers can be set as key/value pairs on the `RESTAdapter`'s `headers`\n    object and Ember Data will send them along with each ajax request.\n  \n  \n    ```app/adapters/application.js\n    import RESTAdapter from '@ember-data/adapter/rest';\n    import { computed } from '@ember/object';\n  \n    export default RESTAdapter.extend({\n      headers: computed(function() {\n        return {\n          'API_KEY': 'secret key',\n          'ANOTHER_HEADER': 'Some header value'\n        };\n      }\n    });\n    ```\n  \n    `headers` can also be used as a computed property to support dynamic\n    headers. In the example below, the `session` object has been\n    injected into an adapter by Ember's container.\n  \n    ```app/adapters/application.js\n    import RESTAdapter from '@ember-data/adapter/rest';\n    import { computed } from '@ember/object';\n  \n    export default RESTAdapter.extend({\n      headers: computed('session.authToken', function() {\n        return {\n          'API_KEY': this.get('session.authToken'),\n          'ANOTHER_HEADER': 'Some header value'\n        };\n      })\n    });\n    ```\n  \n    In some cases, your dynamic headers may require data from some\n    object outside of Ember's observer system (for example\n    `document.cookie`). You can use the\n    [volatile](/api/classes/Ember.ComputedProperty.html?anchor=volatile)\n    function to set the property into a non-cached mode causing the headers to\n    be recomputed with every request.\n  \n    ```app/adapters/application.js\n    import RESTAdapter from '@ember-data/adapter/rest';\n    import { get } from '@ember/object';\n    import { computed } from '@ember/object';\n  \n    export default RESTAdapter.extend({\n      headers: computed(function() {\n        return {\n          'API_KEY': get(document.cookie.match(/apiKey\\=([^;]*)/), '1'),\n          'ANOTHER_HEADER': 'Some header value'\n        };\n      }).volatile()\n    });\n    ```\n  \n    @class RESTAdapter\n    @constructor\n    @extends Adapter\n    @uses BuildURLMixin\n  */\n\n  var RESTAdapter = _adapter.default.extend(_adapter.BuildURLMixin, {\n    defaultSerializer: '-rest',\n    _defaultContentType: 'application/json; charset=utf-8',\n    fastboot: Ember.computed({\n      // Avoid computed property override deprecation in fastboot as suggested by:\n      // https://deprecations.emberjs.com/v3.x/#toc_computed-property-override\n      get() {\n        if (this._fastboot) {\n          return this._fastboot;\n        }\n\n        return Ember.getOwner(this).lookup('service:fastboot');\n      },\n\n      set(key, value) {\n        this._fastboot = value;\n      }\n\n    }),\n    useFetch: Ember.computed(function () {\n      var ENV = Ember.getOwner(this).resolveRegistration('config:environment'); // TODO: https://github.com/emberjs/data/issues/6093\n\n      var jQueryIntegrationDisabled = ENV && ENV.EmberENV && ENV.EmberENV._JQUERY_INTEGRATION === false;\n\n      if (jQueryIntegrationDisabled) {\n        return true;\n      } else if (hasNajax || hasJQuery) {\n        return false;\n      } else {\n        return true;\n      }\n    }),\n\n    /**\n      By default, the RESTAdapter will send the query params sorted alphabetically to the\n      server.\n       For example:\n       ```js\n      store.query('posts', { sort: 'price', category: 'pets' });\n      ```\n       will generate a requests like this `/posts?category=pets&sort=price`, even if the\n      parameters were specified in a different order.\n       That way the generated URL will be deterministic and that simplifies caching mechanisms\n      in the backend.\n       Setting `sortQueryParams` to a falsey value will respect the original order.\n       In case you want to sort the query parameters with a different criteria, set\n      `sortQueryParams` to your custom sort function.\n       ```app/adapters/application.js\n      import RESTAdapter from '@ember-data/adapter/rest';\n       export default RESTAdapter.extend({\n        sortQueryParams(params) {\n          let sortedKeys = Object.keys(params).sort().reverse();\n          let len = sortedKeys.length, newParams = {};\n           for (let i = 0; i < len; i++) {\n            newParams[sortedKeys[i]] = params[sortedKeys[i]];\n          }\n           return newParams;\n        }\n      });\n      ```\n       @method sortQueryParams\n      @param {Object} obj\n      @return {Object}\n    */\n    sortQueryParams(obj) {\n      var keys = Object.keys(obj);\n      var len = keys.length;\n\n      if (len < 2) {\n        return obj;\n      }\n\n      var newQueryParams = {};\n      var sortedKeys = keys.sort();\n\n      for (var i = 0; i < len; i++) {\n        newQueryParams[sortedKeys[i]] = obj[sortedKeys[i]];\n      }\n\n      return newQueryParams;\n    },\n\n    /**\n      By default the RESTAdapter will send each find request coming from a `store.find`\n      or from accessing a relationship separately to the server. If your server supports passing\n      ids as a query string, you can set coalesceFindRequests to true to coalesce all find requests\n      within a single runloop.\n       For example, if you have an initial payload of:\n       ```javascript\n      {\n        post: {\n          id: 1,\n          comments: [1, 2]\n        }\n      }\n      ```\n       By default calling `post.get('comments')` will trigger the following requests(assuming the\n      comments haven't been loaded before):\n       ```\n      GET /comments/1\n      GET /comments/2\n      ```\n       If you set coalesceFindRequests to `true` it will instead trigger the following request:\n       ```\n      GET /comments?ids[]=1&ids[]=2\n      ```\n       Setting coalesceFindRequests to `true` also works for `store.find` requests and `belongsTo`\n      relationships accessed within the same runloop. If you set `coalesceFindRequests: true`\n       ```javascript\n      store.findRecord('comment', 1);\n      store.findRecord('comment', 2);\n      ```\n       will also send a request to: `GET /comments?ids[]=1&ids[]=2`\n       Note: Requests coalescing rely on URL building strategy. So if you override `buildURL` in your app\n      `groupRecordsForFindMany` more likely should be overridden as well in order for coalescing to work.\n       @property coalesceFindRequests\n      @type {boolean}\n    */\n    coalesceFindRequests: false,\n\n    /**\n      Endpoint paths can be prefixed with a `namespace` by setting the namespace\n      property on the adapter:\n       ```app/adapters/application.js\n      import RESTAdapter from '@ember-data/adapter/rest';\n       export default RESTAdapter.extend({\n        namespace: 'api/1'\n      });\n      ```\n       Requests for the `Post` model would now target `/api/1/post/`.\n       @property namespace\n      @type {String}\n    */\n\n    /**\n      An adapter can target other hosts by setting the `host` property.\n       ```app/adapters/application.js\n      import RESTAdapter from '@ember-data/adapter/rest';\n       export default RESTAdapter.extend({\n        host: 'https://api.example.com'\n      });\n      ```\n       Requests for the `Post` model would now target `https://api.example.com/post/`.\n       @property host\n      @type {String}\n    */\n\n    /**\n      Some APIs require HTTP headers, e.g. to provide an API\n      key. Arbitrary headers can be set as key/value pairs on the\n      `RESTAdapter`'s `headers` object and Ember Data will send them\n      along with each ajax request. For dynamic headers see [headers\n      customization](/ember-data/release/classes/RESTAdapter).\n       ```app/adapters/application.js\n      import RESTAdapter from '@ember-data/adapter/rest';\n      import { computed } from '@ember/object';\n       export default RESTAdapter.extend({\n        headers: computed(function() {\n          return {\n            'API_KEY': 'secret key',\n            'ANOTHER_HEADER': 'Some header value'\n          };\n        })\n      });\n      ```\n       @property headers\n      @type {Object}\n     */\n\n    /**\n      Called by the store in order to fetch the JSON for a given\n      type and ID.\n       The `findRecord` method makes an Ajax request to a URL computed by\n      `buildURL`, and returns a promise for the resulting payload.\n       This method performs an HTTP `GET` request with the id provided as part of the query string.\n       @since 1.13.0\n      @method findRecord\n      @param {Store} store\n      @param {Model} type\n      @param {String} id\n      @param {Snapshot} snapshot\n      @return {Promise} promise\n    */\n    findRecord(store, type, id, snapshot) {\n      var url = this.buildURL(type.modelName, id, snapshot, 'findRecord');\n      var query = this.buildQuery(snapshot);\n      return this.ajax(url, 'GET', {\n        data: query\n      });\n    },\n\n    /**\n      Called by the store in order to fetch a JSON array for all\n      of the records for a given type.\n       The `findAll` method makes an Ajax (HTTP GET) request to a URL computed by `buildURL`, and returns a\n      promise for the resulting payload.\n       @method findAll\n      @param {Store} store\n      @param {Model} type\n      @param {undefined} neverSet a value is never provided to this argument\n      @param {SnapshotRecordArray} snapshotRecordArray\n      @return {Promise} promise\n    */\n    findAll(store, type, sinceToken, snapshotRecordArray) {\n      var query = this.buildQuery(snapshotRecordArray);\n      var url = this.buildURL(type.modelName, null, snapshotRecordArray, 'findAll');\n\n      if (sinceToken) {\n        query.since = sinceToken;\n      }\n\n      return this.ajax(url, 'GET', {\n        data: query\n      });\n    },\n\n    /**\n      Called by the store in order to fetch a JSON array for\n      the records that match a particular query.\n       The `query` method makes an Ajax (HTTP GET) request to a URL\n      computed by `buildURL`, and returns a promise for the resulting\n      payload.\n       The `query` argument is a simple JavaScript object that will be passed directly\n      to the server as parameters.\n       @method query\n      @param {Store} store\n      @param {Model} type\n      @param {Object} query\n      @return {Promise} promise\n    */\n    query(store, type, query) {\n      var url = this.buildURL(type.modelName, null, null, 'query', query);\n\n      if (this.sortQueryParams) {\n        query = this.sortQueryParams(query);\n      }\n\n      return this.ajax(url, 'GET', {\n        data: query\n      });\n    },\n\n    /**\n      Called by the store in order to fetch a JSON object for\n      the record that matches a particular query.\n       The `queryRecord` method makes an Ajax (HTTP GET) request to a URL\n      computed by `buildURL`, and returns a promise for the resulting\n      payload.\n       The `query` argument is a simple JavaScript object that will be passed directly\n      to the server as parameters.\n       @since 1.13.0\n      @method queryRecord\n      @param {Store} store\n      @param {Model} type\n      @param {Object} query\n      @return {Promise} promise\n    */\n    queryRecord(store, type, query) {\n      var url = this.buildURL(type.modelName, null, null, 'queryRecord', query);\n\n      if (this.sortQueryParams) {\n        query = this.sortQueryParams(query);\n      }\n\n      return this.ajax(url, 'GET', {\n        data: query\n      });\n    },\n\n    /**\n      Called by the store in order to fetch several records together if `coalesceFindRequests` is true\n       For example, if the original payload looks like:\n       ```js\n      {\n        \"id\": 1,\n        \"title\": \"Rails is omakase\",\n        \"comments\": [ 1, 2, 3 ]\n      }\n      ```\n       The IDs will be passed as a URL-encoded Array of IDs, in this form:\n       ```\n      ids[]=1&ids[]=2&ids[]=3\n      ```\n       Many servers, such as Rails and PHP, will automatically convert this URL-encoded array\n      into an Array for you on the server-side. If you want to encode the\n      IDs, differently, just override this (one-line) method.\n       The `findMany` method makes an Ajax (HTTP GET) request to a URL computed by `buildURL`, and returns a\n      promise for the resulting payload.\n       @method findMany\n      @param {Store} store\n      @param {Model} type\n      @param {Array} ids\n      @param {Array} snapshots\n      @return {Promise} promise\n    */\n    findMany(store, type, ids, snapshots) {\n      var url = this.buildURL(type.modelName, ids, snapshots, 'findMany');\n      return this.ajax(url, 'GET', {\n        data: {\n          ids: ids\n        }\n      });\n    },\n\n    /**\n      Called by the store in order to fetch a JSON array for\n      the unloaded records in a has-many relationship that were originally\n      specified as a URL (inside of `links`).\n       For example, if your original payload looks like this:\n       ```js\n      {\n        \"post\": {\n          \"id\": 1,\n          \"title\": \"Rails is omakase\",\n          \"links\": { \"comments\": \"/posts/1/comments\" }\n        }\n      }\n      ```\n       This method will be called with the parent record and `/posts/1/comments`.\n       The `findHasMany` method will make an Ajax (HTTP GET) request to the originally specified URL.\n       The format of your `links` value will influence the final request URL via the `urlPrefix` method:\n       * Links beginning with `//`, `http://`, `https://`, will be used as is, with no further manipulation.\n       * Links beginning with a single `/` will have the current adapter's `host` value prepended to it.\n       * Links with no beginning `/` will have a parentURL prepended to it, via the current adapter's `buildURL`.\n       @method findHasMany\n      @param {Store} store\n      @param {Snapshot} snapshot\n      @param {String} url\n      @param {Object} relationship meta object describing the relationship\n      @return {Promise} promise\n    */\n    findHasMany(store, snapshot, url, relationship) {\n      var id = snapshot.id;\n      var type = snapshot.modelName;\n      url = this.urlPrefix(url, this.buildURL(type, id, snapshot, 'findHasMany'));\n      return this.ajax(url, 'GET');\n    },\n\n    /**\n      Called by the store in order to fetch the JSON for the unloaded record in a\n      belongs-to relationship that was originally specified as a URL (inside of\n      `links`).\n       For example, if your original payload looks like this:\n       ```js\n      {\n        \"person\": {\n          \"id\": 1,\n          \"name\": \"Tom Dale\",\n          \"links\": { \"group\": \"/people/1/group\" }\n        }\n      }\n      ```\n       This method will be called with the parent record and `/people/1/group`.\n       The `findBelongsTo` method will make an Ajax (HTTP GET) request to the originally specified URL.\n       The format of your `links` value will influence the final request URL via the `urlPrefix` method:\n       * Links beginning with `//`, `http://`, `https://`, will be used as is, with no further manipulation.\n       * Links beginning with a single `/` will have the current adapter's `host` value prepended to it.\n       * Links with no beginning `/` will have a parentURL prepended to it, via the current adapter's `buildURL`.\n       @method findBelongsTo\n      @param {Store} store\n      @param {Snapshot} snapshot\n      @param {String} url\n      @param {Object} relationship meta object describing the relationship\n      @return {Promise} promise\n    */\n    findBelongsTo(store, snapshot, url, relationship) {\n      var id = snapshot.id;\n      var type = snapshot.modelName;\n      url = this.urlPrefix(url, this.buildURL(type, id, snapshot, 'findBelongsTo'));\n      return this.ajax(url, 'GET');\n    },\n\n    /**\n      Called by the store when a newly created record is\n      saved via the `save` method on a model record instance.\n       The `createRecord` method serializes the record and makes an Ajax (HTTP POST) request\n      to a URL computed by `buildURL`.\n       See `serialize` for information on how to customize the serialized form\n      of a record.\n       @method createRecord\n      @param {Store} store\n      @param {Model} type\n      @param {Snapshot} snapshot\n      @return {Promise} promise\n    */\n    createRecord(store, type, snapshot) {\n      var url = this.buildURL(type.modelName, null, snapshot, 'createRecord');\n      var data = (0, _private.serializeIntoHash)(store, type, snapshot);\n      return this.ajax(url, 'POST', {\n        data\n      });\n    },\n\n    /**\n      Called by the store when an existing record is saved\n      via the `save` method on a model record instance.\n       The `updateRecord` method serializes the record and makes an Ajax (HTTP PUT) request\n      to a URL computed by `buildURL`.\n       See `serialize` for information on how to customize the serialized form\n      of a record.\n       @method updateRecord\n      @param {Store} store\n      @param {Model} type\n      @param {Snapshot} snapshot\n      @return {Promise} promise\n    */\n    updateRecord(store, type, snapshot) {\n      var data = (0, _private.serializeIntoHash)(store, type, snapshot, {});\n      var id = snapshot.id;\n      var url = this.buildURL(type.modelName, id, snapshot, 'updateRecord');\n      return this.ajax(url, 'PUT', {\n        data\n      });\n    },\n\n    /**\n      Called by the store when a record is deleted.\n       The `deleteRecord` method  makes an Ajax (HTTP DELETE) request to a URL computed by `buildURL`.\n       @method deleteRecord\n      @param {Store} store\n      @param {Model} type\n      @param {Snapshot} snapshot\n      @return {Promise} promise\n    */\n    deleteRecord(store, type, snapshot) {\n      var id = snapshot.id;\n      return this.ajax(this.buildURL(type.modelName, id, snapshot, 'deleteRecord'), 'DELETE');\n    },\n\n    _stripIDFromURL(store, snapshot) {\n      var url = this.buildURL(snapshot.modelName, snapshot.id, snapshot);\n      var expandedURL = url.split('/'); // Case when the url is of the format ...something/:id\n      // We are decodeURIComponent-ing the lastSegment because if it represents\n      // the id, it has been encodeURIComponent-ified within `buildURL`. If we\n      // don't do this, then records with id having special characters are not\n      // coalesced correctly (see GH #4190 for the reported bug)\n\n      var lastSegment = expandedURL[expandedURL.length - 1];\n      var id = snapshot.id;\n\n      if (decodeURIComponent(lastSegment) === id) {\n        expandedURL[expandedURL.length - 1] = '';\n      } else if (endsWith(lastSegment, '?id=' + id)) {\n        //Case when the url is of the format ...something?id=:id\n        expandedURL[expandedURL.length - 1] = lastSegment.substring(0, lastSegment.length - id.length - 1);\n      }\n\n      return expandedURL.join('/');\n    },\n\n    // http://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers\n    maxURLLength: 2048,\n\n    /**\n      Organize records into groups, each of which is to be passed to separate\n      calls to `findMany`.\n       This implementation groups together records that have the same base URL but\n      differing ids. For example `/comments/1` and `/comments/2` will be grouped together\n      because we know findMany can coalesce them together as `/comments?ids[]=1&ids[]=2`\n       It also supports urls where ids are passed as a query param, such as `/comments?id=1`\n      but not those where there is more than 1 query param such as `/comments?id=2&name=David`\n      Currently only the query param of `id` is supported. If you need to support others, please\n      override this or the `_stripIDFromURL` method.\n       It does not group records that have differing base urls, such as for example: `/posts/1/comments/2`\n      and `/posts/2/comments/3`\n       @method groupRecordsForFindMany\n      @param {Store} store\n      @param {Array} snapshots\n      @return {Array}  an array of arrays of records, each of which is to be\n                        loaded separately by `findMany`.\n    */\n    groupRecordsForFindMany(store, snapshots) {\n      var groups = new Map();\n      var adapter = this;\n      var maxURLLength = this.maxURLLength;\n      snapshots.forEach(snapshot => {\n        var baseUrl = adapter._stripIDFromURL(store, snapshot);\n\n        if (!groups.has(baseUrl)) {\n          groups.set(baseUrl, []);\n        }\n\n        groups.get(baseUrl).push(snapshot);\n      });\n\n      function splitGroupToFitInUrl(group, maxURLLength, paramNameLength) {\n        var idsSize = 0;\n\n        var baseUrl = adapter._stripIDFromURL(store, group[0]);\n\n        var splitGroups = [[]];\n        group.forEach(snapshot => {\n          var additionalLength = encodeURIComponent(snapshot.id).length + paramNameLength;\n\n          if (baseUrl.length + idsSize + additionalLength >= maxURLLength) {\n            idsSize = 0;\n            splitGroups.push([]);\n          }\n\n          idsSize += additionalLength;\n          var lastGroupIndex = splitGroups.length - 1;\n          splitGroups[lastGroupIndex].push(snapshot);\n        });\n        return splitGroups;\n      }\n\n      var groupsArray = [];\n      groups.forEach((group, key) => {\n        var paramNameLength = '&ids%5B%5D='.length;\n        var splitGroups = splitGroupToFitInUrl(group, maxURLLength, paramNameLength);\n        splitGroups.forEach(splitGroup => groupsArray.push(splitGroup));\n      });\n      return groupsArray;\n    },\n\n    /**\n      Takes an ajax response, and returns the json payload or an error.\n       By default this hook just returns the json payload passed to it.\n      You might want to override it in two cases:\n       1. Your API might return useful results in the response headers.\n      Response headers are passed in as the second argument.\n       2. Your API might return errors as successful responses with status code\n      200 and an Errors text or object. You can return a `InvalidError` or a\n      `AdapterError` (or a sub class) from this hook and it will automatically\n      reject the promise and put your record into the invalid or error state.\n       Returning a `InvalidError` from this method will cause the\n      record to transition into the `invalid` state and make the\n      `errors` object available on the record. When returning an\n      `InvalidError` the store will attempt to normalize the error data\n      returned from the server using the serializer's `extractErrors`\n      method.\n       @since 1.13.0\n      @method handleResponse\n      @param  {Number} status\n      @param  {Object} headers\n      @param  {Object} payload\n      @param  {Object} requestData - the original request information\n      @return {Object | AdapterError} response\n    */\n    handleResponse(status, headers, payload, requestData) {\n      if (this.isSuccess(status, headers, payload)) {\n        return payload;\n      } else if (this.isInvalid(status, headers, payload)) {\n        return new _error.InvalidError(payload.errors);\n      }\n\n      var errors = this.normalizeErrorResponse(status, headers, payload);\n      var detailedMessage = this.generatedDetailedMessage(status, headers, payload, requestData);\n\n      switch (status) {\n        case 401:\n          return new _error.UnauthorizedError(errors, detailedMessage);\n\n        case 403:\n          return new _error.ForbiddenError(errors, detailedMessage);\n\n        case 404:\n          return new _error.NotFoundError(errors, detailedMessage);\n\n        case 409:\n          return new _error.ConflictError(errors, detailedMessage);\n\n        default:\n          if (status >= 500) {\n            return new _error.ServerError(errors, detailedMessage);\n          }\n\n      }\n\n      return new _error.default(errors, detailedMessage);\n    },\n\n    /**\n      Default `handleResponse` implementation uses this hook to decide if the\n      response is a success.\n       @since 1.13.0\n      @method isSuccess\n      @param  {Number} status\n      @param  {Object} headers\n      @param  {Object} payload\n      @return {Boolean}\n    */\n    isSuccess(status, headers, payload) {\n      return status >= 200 && status < 300 || status === 304;\n    },\n\n    /**\n      Default `handleResponse` implementation uses this hook to decide if the\n      response is an invalid error.\n       @since 1.13.0\n      @method isInvalid\n      @param  {Number} status\n      @param  {Object} headers\n      @param  {Object} payload\n      @return {Boolean}\n    */\n    isInvalid(status, headers, payload) {\n      return status === 422;\n    },\n\n    /**\n      Takes a URL, an HTTP method and a hash of data, and makes an\n      HTTP request.\n       When the server responds with a payload, Ember Data will call into `extractSingle`\n      or `extractArray` (depending on whether the original query was for one record or\n      many records).\n       By default, `ajax` method has the following behavior:\n       * It sets the response `dataType` to `\"json\"`\n      * If the HTTP method is not `\"GET\"`, it sets the `Content-Type` to be\n        `application/json; charset=utf-8`\n      * If the HTTP method is not `\"GET\"`, it stringifies the data passed in. The\n        data is the serialized record in the case of a save.\n      * Registers success and failure handlers.\n       @method ajax\n      @private\n      @param {String} url\n      @param {String} type The request type GET, POST, PUT, DELETE etc.\n      @param {Object} options\n      @return {Promise} promise\n    */\n    ajax(url, type, options) {\n      var adapter = this;\n      var useFetch = Ember.get(this, 'useFetch');\n      var requestData = {\n        url: url,\n        method: type\n      };\n      var hash = adapter.ajaxOptions(url, type, options);\n\n      if (useFetch) {\n        var _response;\n\n        return this._fetchRequest(hash).then(response => {\n          _response = response;\n          return (0, _private.determineBodyPromise)(response, requestData);\n        }).then(payload => {\n          if (_response.ok && !(payload instanceof Error)) {\n            return fetchSuccessHandler(adapter, payload, _response, requestData);\n          } else {\n            throw fetchErrorHandler(adapter, payload, _response, null, requestData);\n          }\n        });\n      }\n\n      return new Ember.RSVP.Promise(function (resolve, reject) {\n        hash.success = function (payload, textStatus, jqXHR) {\n          var response = ajaxSuccessHandler(adapter, payload, jqXHR, requestData);\n          Ember.run.join(null, resolve, response);\n        };\n\n        hash.error = function (jqXHR, textStatus, errorThrown) {\n          var error = ajaxErrorHandler(adapter, jqXHR, errorThrown, requestData);\n          Ember.run.join(null, reject, error);\n        };\n\n        adapter._ajax(hash);\n      }, 'DS: RESTAdapter#ajax ' + type + ' to ' + url);\n    },\n\n    /**\n      @method _ajaxRequest\n      @private\n      @param {Object} options jQuery ajax options to be used for the ajax request\n    */\n    _ajaxRequest(options) {\n      jQuery.ajax(options);\n    },\n\n    /**\n      @method _najaxRequest\n      @private\n      @param {Object} options jQuery ajax options to be used for the najax request\n    */\n    _najaxRequest(options) {\n      if (hasNajax) {\n        najax(options);\n      } else {\n        throw new Error('najax does not seem to be defined in your app. Did you override it via `addOrOverrideSandboxGlobals` in the fastboot server?');\n      }\n    },\n\n    _fetchRequest(options) {\n      var fetchFunction = (0, _private.fetch)();\n\n      if (fetchFunction) {\n        return fetchFunction(options.url, options);\n      } else {\n        throw new Error('cannot find the `fetch` module or the `fetch` global. Did you mean to install the `ember-fetch` addon?');\n      }\n    },\n\n    _ajax(options) {\n      if (Ember.get(this, 'useFetch')) {\n        this._fetchRequest(options);\n      } else if (Ember.get(this, 'fastboot.isFastBoot')) {\n        this._najaxRequest(options);\n      } else {\n        this._ajaxRequest(options);\n      }\n    },\n\n    /**\n      @method ajaxOptions\n      @private\n      @param {String} url\n      @param {String} type The request type GET, POST, PUT, DELETE etc.\n      @param {Object} options\n      @return {Object}\n    */\n    ajaxOptions(url, method, options) {\n      options = Ember.assign({\n        url,\n        method,\n        type: method\n      }, options);\n      var headers = Ember.get(this, 'headers');\n\n      if (headers !== undefined) {\n        options.headers = Ember.assign({}, headers, options.headers);\n      } else if (!options.headers) {\n        options.headers = {};\n      }\n\n      var contentType = options.contentType || this._defaultContentType;\n\n      if (Ember.get(this, 'useFetch')) {\n        if (options.data && options.type !== 'GET') {\n          if (!options.headers['Content-Type'] && !options.headers['content-type']) {\n            options.headers['content-type'] = contentType;\n          }\n        }\n\n        options = fetchOptions(options, this);\n      } else {\n        // GET requests without a body should not have a content-type header\n        // and may be unexpected by a server\n        if (options.data && options.type !== 'GET') {\n          options = Ember.assign(options, {\n            contentType\n          });\n        }\n\n        options = ajaxOptions(options, this);\n      }\n\n      options.url = this._ajaxURL(options.url);\n      return options;\n    },\n\n    _ajaxURL(url) {\n      if (Ember.get(this, 'fastboot.isFastBoot')) {\n        var httpRegex = /^https?:\\/\\//;\n        var protocolRelativeRegex = /^\\/\\//;\n        var protocol = Ember.get(this, 'fastboot.request.protocol');\n        var host = Ember.get(this, 'fastboot.request.host');\n\n        if (protocolRelativeRegex.test(url)) {\n          return `${protocol}${url}`;\n        } else if (!httpRegex.test(url)) {\n          try {\n            return `${protocol}//${host}${url}`;\n          } catch (fbError) {\n            throw new Error('You are using Ember Data with no host defined in your adapter. This will attempt to use the host of the FastBoot request, which is not configured for the current host of this request. Please set the hostWhitelist property for in your environment.js. FastBoot Error: ' + fbError.message);\n          }\n        }\n      }\n\n      return url;\n    },\n\n    /**\n      @method parseErrorResponse\n      @private\n      @param {String} responseText\n      @return {Object}\n    */\n    parseErrorResponse(responseText) {\n      var json = responseText;\n\n      try {\n        json = JSON.parse(responseText);\n      } catch (e) {// ignored\n      }\n\n      return json;\n    },\n\n    /**\n      @method normalizeErrorResponse\n      @private\n      @param  {Number} status\n      @param  {Object} headers\n      @param  {Object} payload\n      @return {Array} errors payload\n    */\n    normalizeErrorResponse(status, headers, payload) {\n      if (payload && typeof payload === 'object' && payload.errors) {\n        return payload.errors;\n      } else {\n        return [{\n          status: `${status}`,\n          title: 'The backend responded with an error',\n          detail: `${payload}`\n        }];\n      }\n    },\n\n    /**\n      Generates a detailed (\"friendly\") error message, with plenty\n      of information for debugging (good luck!)\n       @method generatedDetailedMessage\n      @private\n      @param  {Number} status\n      @param  {Object} headers\n      @param  {Object} payload\n      @param  {Object} requestData\n      @return {String} detailed error message\n    */\n    generatedDetailedMessage: function (status, headers, payload, requestData) {\n      var shortenedPayload;\n      var payloadContentType = headers['content-type'] || 'Empty Content-Type';\n\n      if (payloadContentType === 'text/html' && payload.length > 250) {\n        shortenedPayload = '[Omitted Lengthy HTML]';\n      } else {\n        shortenedPayload = payload;\n      }\n\n      var requestDescription = requestData.method + ' ' + requestData.url;\n      var payloadDescription = 'Payload (' + payloadContentType + ')';\n      return ['Ember Data Request ' + requestDescription + ' returned a ' + status, payloadDescription, shortenedPayload].join('\\n');\n    },\n\n    // @since 2.5.0\n    buildQuery(snapshot) {\n      var query = {};\n\n      if (snapshot) {\n        var {\n          include\n        } = snapshot;\n\n        if (include) {\n          query.include = include;\n        }\n      }\n\n      return query;\n    }\n\n  });\n\n  function ajaxSuccess(adapter, payload, requestData, responseData) {\n    var response;\n\n    try {\n      response = adapter.handleResponse(responseData.status, responseData.headers, payload, requestData);\n    } catch (error) {\n      return Ember.RSVP.Promise.reject(error);\n    }\n\n    if (response && response.isAdapterError) {\n      return Ember.RSVP.Promise.reject(response);\n    } else {\n      return response;\n    }\n  }\n\n  function ajaxError(adapter, payload, requestData, responseData) {\n    var error;\n\n    if (responseData.errorThrown instanceof Error && payload !== '') {\n      error = responseData.errorThrown;\n    } else if (responseData.textStatus === 'timeout') {\n      error = new _error.TimeoutError();\n    } else if (responseData.textStatus === 'abort' || responseData.status === 0) {\n      error = handleAbort(requestData, responseData);\n    } else {\n      try {\n        error = adapter.handleResponse(responseData.status, responseData.headers, payload || responseData.errorThrown, requestData);\n      } catch (e) {\n        error = e;\n      }\n    }\n\n    return error;\n  } // Adapter abort error to include any relevent info, e.g. request/response:\n\n\n  function handleAbort(requestData, responseData) {\n    var {\n      method,\n      url,\n      errorThrown\n    } = requestData;\n    var {\n      status\n    } = responseData;\n    var msg = `Request failed: ${method} ${url} ${errorThrown || ''}`;\n    var errors = [{\n      title: 'Adapter Error',\n      detail: msg.trim(),\n      status\n    }];\n    return new _error.AbortError(errors);\n  } //From http://stackoverflow.com/questions/280634/endswith-in-javascript\n\n\n  function endsWith(string, suffix) {\n    if (typeof String.prototype.endsWith !== 'function') {\n      return string.indexOf(suffix, string.length - suffix.length) !== -1;\n    } else {\n      return string.endsWith(suffix);\n    }\n  }\n\n  function fetchSuccessHandler(adapter, payload, response, requestData) {\n    var responseData = fetchResponseData(response);\n    return ajaxSuccess(adapter, payload, requestData, responseData);\n  }\n\n  function fetchErrorHandler(adapter, payload, response, errorThrown, requestData) {\n    var responseData = fetchResponseData(response);\n\n    if (responseData.status === 200 && payload instanceof Error) {\n      responseData.errorThrown = payload;\n      payload = responseData.errorThrown.payload;\n    } else {\n      responseData.errorThrown = errorThrown;\n    }\n\n    return ajaxError(adapter, payload, requestData, responseData);\n  }\n\n  function ajaxSuccessHandler(adapter, payload, jqXHR, requestData) {\n    var responseData = ajaxResponseData(jqXHR);\n    return ajaxSuccess(adapter, payload, requestData, responseData);\n  }\n\n  function ajaxErrorHandler(adapter, jqXHR, errorThrown, requestData) {\n    var responseData = ajaxResponseData(jqXHR);\n    responseData.errorThrown = errorThrown;\n    var payload = adapter.parseErrorResponse(jqXHR.responseText);\n\n    if (true\n    /* DEBUG */\n    ) {\n      var message = `The server returned an empty string for ${requestData.method} ${requestData.url}, which cannot be parsed into a valid JSON. Return either null or {}.`;\n      var validJSONString = !(responseData.textStatus === 'parsererror' && payload === '');\n      (true && Ember.warn(message, validJSONString, {\n        id: 'ds.adapter.returned-empty-string-as-JSON'\n      }));\n    }\n\n    return ajaxError(adapter, payload, requestData, responseData);\n  }\n\n  function fetchResponseData(response) {\n    return {\n      status: response.status,\n      textStatus: response.textStatus,\n      headers: headersToObject(response.headers)\n    };\n  }\n\n  function ajaxResponseData(jqXHR) {\n    return {\n      status: jqXHR.status,\n      textStatus: jqXHR.statusText,\n      headers: (0, _private.parseResponseHeaders)(jqXHR.getAllResponseHeaders())\n    };\n  }\n\n  function headersToObject(headers) {\n    var headersObject = {};\n\n    if (headers) {\n      headers.forEach((value, key) => headersObject[key] = value);\n    }\n\n    return headersObject;\n  }\n  /**\n   * Helper function that translates the options passed to `jQuery.ajax` into a format that `fetch` expects.\n   * @param {Object} _options\n   * @param {Adapter} adapter\n   * @returns {Object}\n   */\n\n\n  function fetchOptions(options, adapter) {\n    options.credentials = 'same-origin';\n\n    if (options.data) {\n      // GET and HEAD requests can't have a `body`\n      if (options.method === 'GET' || options.method === 'HEAD') {\n        // If no options are passed, Ember Data sets `data` to an empty object, which we test for.\n        if (Object.keys(options.data).length) {\n          // Test if there are already query params in the url (mimics jQuey.ajax).\n          var queryParamDelimiter = options.url.indexOf('?') > -1 ? '&' : '?';\n          options.url += `${queryParamDelimiter}${(0, _private.serializeQueryParams)(options.data)}`;\n        }\n      } else {\n        // NOTE: a request's body cannot be an object, so we stringify it if it is.\n        // JSON.stringify removes keys with values of `undefined` (mimics jQuery.ajax).\n        // If the data is not a POJO (it's a String, FormData, etc), we just set it.\n        // If the data is a string, we assume it's a stringified object.\n\n        /* We check for Objects this way because we want the logic inside the consequent to run\n         * if `options.data` is a POJO, not if it is a data structure whose `typeof` returns \"object\"\n         * when it's not (Array, FormData, etc). The reason we don't use `options.data.constructor`\n         * to check is in case `data` is an object with no prototype (e.g. created with null).\n         */\n        if (Object.prototype.toString.call(options.data) === '[object Object]') {\n          options.body = JSON.stringify(options.data);\n        } else {\n          options.body = options.data;\n        }\n      }\n    }\n\n    return options;\n  }\n\n  function ajaxOptions(options, adapter) {\n    options.dataType = 'json';\n    options.context = adapter;\n\n    if (options.data && options.type !== 'GET') {\n      options.data = JSON.stringify(options.data);\n    }\n\n    options.beforeSend = function (xhr) {\n      Object.keys(options.headers).forEach(key => xhr.setRequestHeader(key, options.headers[key]));\n    };\n\n    return options;\n  }\n\n  var _default = RESTAdapter;\n  _exports.default = _default;\n});","define(\"@ember-data/canary-features/default-features\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n    @module @ember-data/canary-features\n  */\n\n  /*\n    This list of features is used both at build time (by `@ember-data/private-build-infra`)\n    and at runtime (by `@ember-data/canary-features`).\n  \n    The valid values are:\n  \n    - true - The feature is enabled at all times, and cannot be disabled.\n    - false - The feature is disabled at all times, and cannot be enabled.\n    - null - The feature is disabled by default, but can be enabled at runtime via `EmberDataENV`.\n  */\n  var _default = {\n    SAMPLE_FEATURE_FLAG: null,\n    RECORD_DATA_ERRORS: null,\n    RECORD_DATA_STATE: null,\n    IDENTIFIERS: true,\n    REQUEST_SERVICE: null,\n    CUSTOM_MODEL_CLASS: null,\n    FULL_LINKS_ON_RELATIONSHIPS: null\n  };\n  _exports.default = _default;\n});","define(\"@ember-data/canary-features/index\", [\"exports\", \"@ember-data/canary-features/default-features\"], function (_exports, _defaultFeatures) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.FULL_LINKS_ON_RELATIONSHIPS = _exports.CUSTOM_MODEL_CLASS = _exports.IDENTIFIERS = _exports.REQUEST_SERVICE = _exports.RECORD_DATA_STATE = _exports.RECORD_DATA_ERRORS = _exports.SAMPLE_FEATURE_FLAG = _exports.FEATURES = void 0;\n  const ENV = typeof EmberDataENV === 'object' && EmberDataENV !== null ? EmberDataENV : {};\n\n  function featureValue(value) {\n    if (ENV.ENABLE_OPTIONAL_FEATURES && value === null) {\n      return true;\n    }\n\n    return value;\n  }\n\n  const FEATURES = Ember.assign({}, _defaultFeatures.default, ENV.FEATURES);\n  _exports.FEATURES = FEATURES;\n  const SAMPLE_FEATURE_FLAG = featureValue(FEATURES.SAMPLE_FEATURE_FLAG);\n  _exports.SAMPLE_FEATURE_FLAG = SAMPLE_FEATURE_FLAG;\n  const RECORD_DATA_ERRORS = featureValue(FEATURES.RECORD_DATA_ERRORS);\n  _exports.RECORD_DATA_ERRORS = RECORD_DATA_ERRORS;\n  const RECORD_DATA_STATE = featureValue(FEATURES.RECORD_DATA_STATE);\n  _exports.RECORD_DATA_STATE = RECORD_DATA_STATE;\n  const REQUEST_SERVICE = featureValue(FEATURES.REQUEST_SERVICE);\n  _exports.REQUEST_SERVICE = REQUEST_SERVICE;\n  const IDENTIFIERS = featureValue(FEATURES.IDENTIFIERS);\n  _exports.IDENTIFIERS = IDENTIFIERS;\n  const CUSTOM_MODEL_CLASS = featureValue(FEATURES.CUSTOM_MODEL_CLASS);\n  _exports.CUSTOM_MODEL_CLASS = CUSTOM_MODEL_CLASS;\n  const FULL_LINKS_ON_RELATIONSHIPS = featureValue(FEATURES.FULL_LINKS_ON_RELATIONSHIPS);\n  _exports.FULL_LINKS_ON_RELATIONSHIPS = FULL_LINKS_ON_RELATIONSHIPS;\n});","define(\"@ember-data/debug/index\", [\"exports\", \"@ember-data/debug/setup\"], function (_exports, _setup) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n    Implements `@ember/debug/data-adapter` with for EmberData\n    integration with the ember-inspector.\n  \n    @class InspectorDebugAdapter\n    @extends DataAdapter\n    @private\n  */\n  var _default = Ember.DataAdapter.extend({\n    store: Ember.inject.service('store'),\n\n    /**\n      Specifies how records can be filtered based on the state of the record\n      Records returned will need to have a `filterValues`\n      property with a key for every name in the returned array\n      @private\n      @method getFilters\n      @return {Array} List of objects defining filters\n       The object should have a `name` and `desc` property\n    */\n    getFilters() {\n      return [{\n        name: 'isNew',\n        desc: 'New'\n      }, {\n        name: 'isModified',\n        desc: 'Modified'\n      }, {\n        name: 'isClean',\n        desc: 'Clean'\n      }];\n    },\n\n    _nameToClass(type) {\n      return Ember.get(this, 'store').modelFor(type);\n    },\n\n    /**\n      Fetch the model types and observe them for changes.\n      Maintains the list of model types without needing the Model package for detection.\n      @public\n      @method watchModelTypes\n      @param {Function} typesAdded Callback to call to add types.\n      Takes an array of objects containing wrapped types (returned from `wrapModelType`).\n      @param {Function} typesUpdated Callback to call when a type has changed.\n      Takes an array of objects containing wrapped types.\n      @return {Function} Method to call to remove all observers\n    */\n    watchModelTypes(typesAdded, typesUpdated) {\n      var store = Ember.get(this, 'store');\n      var __createRecordData = store._createRecordData;\n      var _releaseMethods = [];\n      var discoveredTypes = (0, _setup.typesMapFor)(store); // Add any models that were added during initialization of the app, before the inspector was opened\n\n      discoveredTypes.forEach((_, type) => {\n        this.watchTypeIfUnseen(store, discoveredTypes, type, typesAdded, typesUpdated, _releaseMethods);\n      }); // Overwrite _createRecordData so newly added models will get added to the list\n\n      store._createRecordData = identifier => {\n        this.watchTypeIfUnseen(store, discoveredTypes, identifier.type, typesAdded, typesUpdated, _releaseMethods);\n        return __createRecordData.call(store, identifier);\n      };\n\n      var release = () => {\n        _releaseMethods.forEach(fn => fn());\n\n        store._createRecordData = __createRecordData; // reset the list so the models can be added if the inspector is re-opened\n        // the entries are set to false instead of removed, since the models still exist in the app\n        // we just need the inspector to become aware of them\n\n        discoveredTypes.forEach((value, key) => {\n          discoveredTypes.set(key, false);\n        });\n        this.releaseMethods.removeObject(release);\n      };\n\n      this.releaseMethods.pushObject(release);\n      return release;\n    },\n\n    /**\n     * Loop over the discovered types and use the callbacks from watchModelTypes to notify\n     * the consumer of this adapter about the mdoels.\n     *\n     * @param {store} store\n     * @param {Map} discoveredTypes\n     * @param {String} type\n     * @param {Function} typesAdded\n     * @param {Function} typesUpdated\n     * @param {Array} releaseMethods\n     */\n    watchTypeIfUnseen(store, discoveredTypes, type, typesAdded, typesUpdated, releaseMethods) {\n      if (discoveredTypes.get(type) !== true) {\n        var klass = store.modelFor(type);\n        var wrapped = this.wrapModelType(klass, type);\n        releaseMethods.push(this.observeModelType(type, typesUpdated));\n        typesAdded([wrapped]);\n        discoveredTypes.set(type, true);\n      }\n    },\n\n    /**\n      Creates a human readable string used for column headers\n      @private\n      @method columnNameToDesc\n      @param {String} name The attribute name\n      @return {String} Human readable string based on the attribute name\n    */\n    columnNameToDesc(name) {\n      return Ember.String.capitalize(Ember.String.underscore(name).replace(/_/g, ' ').trim());\n    },\n\n    /**\n      Get the columns for a given model type\n      @private\n      @method columnsForType\n      @param {Model} typeClass\n      @return {Array} An array of columns of the following format:\n       name: {String} The name of the column\n       desc: {String} Humanized description (what would show in a table column name)\n    */\n    columnsForType(typeClass) {\n      var columns = [{\n        name: 'id',\n        desc: 'Id'\n      }];\n      var count = 0;\n      var self = this;\n      Ember.get(typeClass, 'attributes').forEach((meta, name) => {\n        if (count++ > self.attributeLimit) {\n          return false;\n        }\n\n        var desc = this.columnNameToDesc(name);\n        columns.push({\n          name: name,\n          desc: desc\n        });\n      });\n      return columns;\n    },\n\n    /**\n      Fetches all loaded records for a given type\n      @private\n      @method getRecords\n      @param {Model} modelClass of the record\n      @param {String} modelName of the record\n      @return {Array} An array of Model records\n       This array will be observed for changes,\n       so it should update when new records are added/removed\n    */\n    getRecords(modelClass, modelName) {\n      if (arguments.length < 2) {\n        // Legacy Ember.js < 1.13 support\n        var containerKey = modelClass._debugContainerKey;\n\n        if (containerKey) {\n          var match = containerKey.match(/model:(.*)/);\n\n          if (match !== null) {\n            modelName = match[1];\n          }\n        }\n      }\n\n      (true && !(!!modelName) && Ember.assert('Cannot find model name. Please upgrade to Ember.js >= 1.13 for Ember Inspector support', !!modelName));\n      return this.get('store').peekAll(modelName);\n    },\n\n    /**\n      Gets the values for each column\n      This is the attribute values for a given record\n      @private\n      @method getRecordColumnValues\n      @param {Model} record to get values from\n      @return {Object} Keys should match column names defined by the model type\n    */\n    getRecordColumnValues(record) {\n      var count = 0;\n      var columnValues = {\n        id: Ember.get(record, 'id')\n      };\n      record.eachAttribute(key => {\n        if (count++ > this.attributeLimit) {\n          return false;\n        }\n\n        columnValues[key] = Ember.get(record, key);\n      });\n      return columnValues;\n    },\n\n    /**\n      Returns keywords to match when searching records\n      @private\n      @method getRecordKeywords\n      @param {Model} record\n      @return {Array} Relevant keywords for search based on the record's attribute values\n    */\n    getRecordKeywords(record) {\n      var keywords = [];\n      var keys = Ember.A(['id']);\n      record.eachAttribute(key => keys.push(key));\n      keys.forEach(key => keywords.push(Ember.get(record, key)));\n      return keywords;\n    },\n\n    /**\n      Returns the values of filters defined by `getFilters`\n      These reflect the state of the record\n      @private\n      @method getRecordFilterValues\n      @param {Model} record\n      @return {Object} The record state filter values\n    */\n    getRecordFilterValues(record) {\n      return {\n        isNew: record.get('isNew'),\n        isModified: record.get('hasDirtyAttributes') && !record.get('isNew'),\n        isClean: !record.get('hasDirtyAttributes')\n      };\n    },\n\n    /**\n      Returns a color that represents the record's state\n      @private\n      @method getRecordColor\n      @param {Model} record\n      @return {String} The record color\n        Possible options: black, blue, green\n    */\n    getRecordColor(record) {\n      var color = 'black';\n\n      if (record.get('isNew')) {\n        color = 'green';\n      } else if (record.get('hasDirtyAttributes')) {\n        color = 'blue';\n      }\n\n      return color;\n    },\n\n    /**\n      Observes all relevant properties and re-sends the wrapped record\n      when a change occurs\n      @private\n      @method observerRecord\n      @param {Model} record\n      @param {Function} recordUpdated Callback used to notify changes\n      @return {Function} The function to call to remove all observers\n    */\n    observeRecord(record, recordUpdated) {\n      var releaseMethods = Ember.A();\n      var keysToObserve = Ember.A(['id', 'isNew', 'hasDirtyAttributes']);\n      record.eachAttribute(key => keysToObserve.push(key));\n      var adapter = this;\n      keysToObserve.forEach(function (key) {\n        var handler = function () {\n          recordUpdated(adapter.wrapRecord(record));\n        };\n\n        Ember.addObserver(record, key, handler);\n        releaseMethods.push(function () {\n          Ember.removeObserver(record, key, handler);\n        });\n      });\n\n      var release = function () {\n        releaseMethods.forEach(fn => fn());\n      };\n\n      return release;\n    }\n\n  });\n\n  _exports.default = _default;\n});","define(\"@ember-data/debug/setup\", [\"exports\", \"@ember-data/store\"], function (_exports, _store) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.typesMapFor = typesMapFor;\n  _exports.default = void 0;\n  var StoreTypesMap = new WeakMap();\n\n  function typesMapFor(store) {\n    var typesMap = StoreTypesMap.get(store);\n\n    if (typesMap === undefined) {\n      typesMap = new Map();\n      StoreTypesMap.set(store, typesMap);\n    }\n\n    return typesMap;\n  } // override _createRecordData to add the known models to the typesMap\n\n\n  var __createRecordData = _store.default.prototype._createRecordData;\n\n  _store.default.prototype._createRecordData = function (identifier) {\n    var typesMap = typesMapFor(this);\n\n    if (!typesMap.has(identifier.type)) {\n      typesMap.set(identifier.type, false);\n    }\n\n    return __createRecordData.call(this, identifier);\n  };\n\n  var _default = {\n    name: '@ember-data/data-adapter',\n\n    initialize() {}\n\n  };\n  _exports.default = _default;\n});","define('@ember-data/model/-private', ['exports', '@ember-data/store/-private', '@ember-data/store'], function (exports, Private, store) { 'use strict';\n\n  function isElementDescriptor(args) {\n    var [maybeTarget, maybeKey, maybeDesc] = args;\n    return (// Ensure we have the right number of args\n      args.length === 3 && ( // Make sure the target is a class or object (prototype)\n      typeof maybeTarget === 'function' || typeof maybeTarget === 'object' && maybeTarget !== null) && // Make sure the key is a string\n      typeof maybeKey === 'string' && ( // Make sure the descriptor is the right shape\n      typeof maybeDesc === 'object' && maybeDesc !== null && 'enumerable' in maybeDesc && 'configurable' in maybeDesc || // TS compatibility\n      maybeDesc === undefined)\n    );\n  }\n  function computedMacroWithOptionalParams(fn) {\n    {\n      return (...maybeDesc) => isElementDescriptor(maybeDesc) ? fn()(...maybeDesc) : fn(...maybeDesc);\n    }\n  }\n\n  /**\n    @module @ember-data/model\n  */\n\n  function getDefaultValue(record, options, key) {\n    if (typeof options.defaultValue === 'function') {\n      return options.defaultValue.apply(null, arguments);\n    } else {\n      var defaultValue = options.defaultValue;\n      ( !(typeof defaultValue !== 'object' || defaultValue === null) && Ember.assert(`Non primitive defaultValues are not supported because they are shared between all instances. If you would like to use a complex object as a default value please provide a function that returns the complex object.`, typeof defaultValue !== 'object' || defaultValue === null));\n      return defaultValue;\n    }\n  }\n\n  function hasValue(internalModel, key) {\n    return Private.recordDataFor(internalModel).hasAttr(key);\n  }\n  /**\n    `attr` defines an attribute on a [Model](/ember-data/release/classes/Model).\n    By default, attributes are passed through as-is, however you can specify an\n    optional type to have the value automatically transformed.\n    Ember Data ships with four basic transform types: `string`, `number`,\n    `boolean` and `date`. You can define your own transforms by subclassing\n    [Transform](/ember-data/release/classes/Transform).\n\n    Note that you cannot use `attr` to define an attribute of `id`.\n\n    `attr` takes an optional hash as a second parameter, currently\n    supported options are:\n\n    - `defaultValue`: Pass a string or a function to be called to set the attribute\n    to a default value if none is supplied.\n\n    Example\n\n    ```app/models/user.js\n    import Model, { attr } from '@ember-data/model';\n\n    export default Model.extend({\n      username: attr('string'),\n      email: attr('string'),\n      verified: attr('boolean', { defaultValue: false })\n    });\n    ```\n\n    Default value can also be a function. This is useful it you want to return\n    a new object for each attribute.\n\n    ```app/models/user.js\n    import Model, { attr } from '@ember-data/model';\n\n    export default Model.extend({\n      username: attr('string'),\n      email: attr('string'),\n      settings: attr({\n        defaultValue() {\n          return {};\n        }\n      })\n    });\n    ```\n\n    The `options` hash is passed as second argument to a transforms'\n    `serialize` and `deserialize` method. This allows to configure a\n    transformation and adapt the corresponding value, based on the config:\n\n    ```app/models/post.js\n    import Model, { attr } from '@ember-data/model';\n\n    export default Model.extend({\n      text: attr('text', {\n        uppercase: true\n      })\n    });\n    ```\n\n    ```app/transforms/text.js\n    import Transform from '@ember-data/serializer/transform';\n\n    export default Transform.extend({\n      serialize(value, options) {\n        if (options.uppercase) {\n          return value.toUpperCase();\n        }\n\n        return value;\n      },\n\n      deserialize(value) {\n        return value;\n      }\n    })\n    ```\n\n    @method attr\n    @public\n    @static\n    @for @ember-data/model\n    @param {String|Object} type the attribute type\n    @param {Object} options a hash of options\n    @return {Attribute}\n  */\n\n\n  function attr(type, options) {\n    if (typeof type === 'object') {\n      options = type;\n      type = undefined;\n    } else {\n      options = options || {};\n    }\n\n    var meta = {\n      type: type,\n      isAttribute: true,\n      kind: 'attribute',\n      options: options\n    };\n    return Ember.computed({\n      get(key) {\n        {\n          if (['_internalModel', 'recordData', 'currentState'].indexOf(key) !== -1) {\n            throw new Error(`'${key}' is a reserved property name on instances of classes extending Model. Please choose a different property name for your attr on ${this.constructor.toString()}`);\n          }\n        }\n\n        var internalModel = this._internalModel;\n\n        if (hasValue(internalModel, key)) {\n          return internalModel.getAttributeValue(key);\n        } else {\n          return getDefaultValue(this, options, key);\n        }\n      },\n\n      set(key, value) {\n        {\n          if (['_internalModel', 'recordData', 'currentState'].indexOf(key) !== -1) {\n            throw new Error(`'${key}' is a reserved property name on instances of classes extending Model. Please choose a different property name for your attr on ${this.constructor.toString()}`);\n          }\n        }\n\n        return this._internalModel.setDirtyAttribute(key, value);\n      }\n\n    }).meta(meta);\n  }\n\n  var attr$1 = computedMacroWithOptionalParams(attr);\n\n  /**\n    @module @ember-data/model\n  */\n\n  /**\n    `belongsTo` is used to define One-To-One and One-To-Many\n    relationships on a [Model](/ember-data/release/classes/Model).\n\n\n    `belongsTo` takes an optional hash as a second parameter, currently\n    supported options are:\n\n    - `async`: A boolean value used to explicitly declare this to be an async relationship. The default is true.\n    - `inverse`: A string used to identify the inverse property on a\n      related model in a One-To-Many relationship. See [Explicit Inverses](#explicit-inverses)\n    - `polymorphic` A boolean value to mark the relationship as polymorphic\n\n    #### One-To-One\n    To declare a one-to-one relationship between two models, use\n    `belongsTo`:\n\n    ```app/models/user.js\n    import Model, { belongsTo } from '@ember-data/model';\n\n    export default Model.extend({\n      profile: belongsTo('profile')\n    });\n    ```\n\n    ```app/models/profile.js\n    import Model, { belongsTo } from '@ember-data/model';\n\n    export default Model.extend({\n      user: belongsTo('user')\n    });\n    ```\n\n    #### One-To-Many\n    To declare a one-to-many relationship between two models, use\n    `belongsTo` in combination with `hasMany`, like this:\n\n    ```app/models/post.js\n    import Model, { hasMany } from '@ember-data/model';\n\n    export default Model.extend({\n      comments: hasMany('comment')\n    });\n    ```\n\n    ```app/models/comment.js\n    import Model, { belongsTo } from '@ember-data/model';\n\n    export default Model.extend({\n      post: belongsTo('post')\n    });\n    ```\n\n    You can avoid passing a string as the first parameter. In that case Ember Data\n    will infer the type from the key name.\n\n    ```app/models/comment.js\n    import Model, { belongsTo } from '@ember-data/model';\n\n    export default Model.extend({\n      post: belongsTo()\n    });\n    ```\n\n    will lookup for a Post type.\n\n    #### Sync relationships\n\n    Ember Data resolves sync relationships with the related resources\n    available in its local store, hence it is expected these resources\n    to be loaded before or along-side the primary resource.\n\n    ```app/models/comment.js\n    import Model, { belongsTo } from '@ember-data/model';\n\n    export default Model.extend({\n      post: belongsTo('post', {\n        async: false\n      })\n    });\n    ```\n\n    In contrast to async relationship, accessing a sync relationship\n    will always return the record (Model instance) for the existing\n    local resource, or null. But it will error on access when\n    a related resource is known to exist and it has not been loaded.\n\n    ```\n    let post = comment.get('post');\n\n    ```\n\n    @method belongsTo\n    @public\n    @static\n    @for @ember-data/model\n    @param {String} modelName (optional) type of the relationship\n    @param {Object} options (optional) a hash of options\n    @return {Ember.computed} relationship\n  */\n\n  function belongsTo(modelName, options) {\n    var opts, userEnteredModelName;\n\n    if (typeof modelName === 'object') {\n      opts = modelName;\n      userEnteredModelName = undefined;\n    } else {\n      opts = options;\n      userEnteredModelName = modelName;\n    }\n\n    if (typeof userEnteredModelName === 'string') {\n      userEnteredModelName = store.normalizeModelName(userEnteredModelName);\n    }\n\n    ( !(typeof userEnteredModelName === 'string' || typeof userEnteredModelName === 'undefined') && Ember.assert('The first argument to belongsTo must be a string representing a model type key, not an instance of ' + Ember.inspect(userEnteredModelName) + \". E.g., to define a relation to the Person model, use belongsTo('person')\", typeof userEnteredModelName === 'string' || typeof userEnteredModelName === 'undefined'));\n    opts = opts || {};\n    var meta = {\n      type: userEnteredModelName,\n      isRelationship: true,\n      options: opts,\n      kind: 'belongsTo',\n      name: 'Belongs To',\n      key: null\n    };\n    return Ember.computed({\n      get(key) {\n        {\n          if (['_internalModel', 'recordData', 'currentState'].indexOf(key) !== -1) {\n            throw new Error(`'${key}' is a reserved property name on instances of classes extending Model. Please choose a different property name for your belongsTo on ${this.constructor.toString()}`);\n          }\n\n          if (Object.prototype.hasOwnProperty.call(opts, 'serialize')) {\n            ( Ember.warn(`You provided a serialize option on the \"${key}\" property in the \"${this._internalModel.modelName}\" class, this belongs in the serializer. See Serializer and it's implementations https://api.emberjs.com/ember-data/release/classes/Serializer`, false, {\n              id: 'ds.model.serialize-option-in-belongs-to'\n            }));\n          }\n\n          if (Object.prototype.hasOwnProperty.call(opts, 'embedded')) {\n            ( Ember.warn(`You provided an embedded option on the \"${key}\" property in the \"${this._internalModel.modelName}\" class, this belongs in the serializer. See EmbeddedRecordsMixin https://api.emberjs.com/ember-data/release/classes/EmbeddedRecordsMixin`, false, {\n              id: 'ds.model.embedded-option-in-belongs-to'\n            }));\n          }\n        }\n\n        return this._internalModel.getBelongsTo(key);\n      },\n\n      set(key, value) {\n        {\n          if (['_internalModel', 'recordData', 'currentState'].indexOf(key) !== -1) {\n            throw new Error(`'${key}' is a reserved property name on instances of classes extending Model. Please choose a different property name for your belongsTo on ${this.constructor.toString()}`);\n          }\n        }\n\n        this._internalModel.setDirtyBelongsTo(key, value);\n\n        return this._internalModel.getBelongsTo(key);\n      }\n\n    }).meta(meta);\n  }\n\n  var belongsTo$1 = computedMacroWithOptionalParams(belongsTo);\n\n  /**\n    `hasMany` is used to define One-To-Many and Many-To-Many\n    relationships on a [Model](/ember-data/release/classes/Model).\n\n    `hasMany` takes an optional hash as a second parameter, currently\n    supported options are:\n\n    - `async`: A boolean value used to explicitly declare this to be an async relationship. The default is true.\n    - `inverse`: A string used to identify the inverse property on a related model.\n    - `polymorphic` A boolean value to mark the relationship as polymorphic\n\n    #### One-To-Many\n    To declare a one-to-many relationship between two models, use\n    `belongsTo` in combination with `hasMany`, like this:\n\n    ```app/models/post.js\n    import Model, { hasMany } from '@ember-data/model';\n\n    export default Model.extend({\n      comments: hasMany('comment')\n    });\n    ```\n\n    ```app/models/comment.js\n    import Model, { belongsTo } from '@ember-data/model';\n\n    export default Model.extend({\n      post: belongsTo('post')\n    });\n    ```\n\n    #### Many-To-Many\n    To declare a many-to-many relationship between two models, use\n    `hasMany`:\n\n    ```app/models/post.js\n    import Model, { hasMany } from '@ember-data/model';\n\n    export default Model.extend({\n      tags: hasMany('tag')\n    });\n    ```\n\n    ```app/models/tag.js\n    import Model, { hasMany } from '@ember-data/model';\n\n    export default Model.extend({\n      posts: hasMany('post')\n    });\n    ```\n\n    You can avoid passing a string as the first parameter. In that case Ember Data\n    will infer the type from the singularized key name.\n\n    ```app/models/post.js\n    import Model, { hasMany } from '@ember-data/model';\n\n    export default Model.extend({\n      tags: hasMany()\n    });\n    ```\n\n    will lookup for a Tag type.\n\n    #### Explicit Inverses\n\n    Ember Data will do its best to discover which relationships map to\n    one another. In the one-to-many code above, for example, Ember Data\n    can figure out that changing the `comments` relationship should update\n    the `post` relationship on the inverse because post is the only\n    relationship to that model.\n\n    However, sometimes you may have multiple `belongsTo`/`hasMany` for the\n    same type. You can specify which property on the related model is\n    the inverse using `hasMany`'s `inverse` option:\n\n    ```app/models/comment.js\n    import Model, { belongsTo } from '@ember-data/model';\n\n    export default Model.extend({\n      onePost: belongsTo('post'),\n      twoPost: belongsTo('post'),\n      redPost: belongsTo('post'),\n      bluePost: belongsTo('post')\n    });\n    ```\n\n    ```app/models/post.js\n    import Model, { hasMany } from '@ember-data/model';\n\n    export default Model.extend({\n      comments: hasMany('comment', {\n        inverse: 'redPost'\n      })\n    });\n    ```\n\n    You can also specify an inverse on a `belongsTo`, which works how\n    you'd expect.\n\n    #### Sync relationships\n\n    Ember Data resolves sync relationships with the related resources\n    available in its local store, hence it is expected these resources\n    to be loaded before or along-side the primary resource.\n\n    ```app/models/post.js\n    import Model, { hasMany } from '@ember-data/model';\n\n    export default Model.extend({\n      comments: hasMany('comment', {\n        async: false\n      })\n    });\n    ```\n\n    In contrast to async relationship, accessing a sync relationship\n    will always return a [ManyArray](/ember-data/release/classes/ManyArray) instance\n    containing the existing local resources. But it will error on access\n    when any of the known related resources have not been loaded.\n\n    ```\n    post.get('comments').forEach((comment) => {\n\n    });\n\n    ```\n\n    If you are using `links` with sync relationships, you have to use\n    `ref.reload` to fetch the resources.\n\n    @method hasMany\n    @public\n    @static\n    @for @ember-data/model\n    @param {String} type (optional) type of the relationship\n    @param {Object} options (optional) a hash of options\n    @return {Ember.computed} relationship\n  */\n\n  function hasMany(type, options) {\n    if (typeof type === 'object') {\n      options = type;\n      type = undefined;\n    }\n\n    ( !(typeof type === 'string' || typeof type === 'undefined') && Ember.assert(`The first argument to hasMany must be a string representing a model type key, not an instance of ${Ember.inspect(type)}. E.g., to define a relation to the Comment model, use hasMany('comment')`, typeof type === 'string' || typeof type === 'undefined'));\n    options = options || {};\n\n    if (typeof type === 'string') {\n      type = store.normalizeModelName(type);\n    } // Metadata about relationships is stored on the meta of\n    // the relationship. This is used for introspection and\n    // serialization. Note that `key` is populated lazily\n    // the first time the CP is called.\n\n\n    var meta = {\n      type,\n      options,\n      isRelationship: true,\n      kind: 'hasMany',\n      name: 'Has Many',\n      key: null\n    };\n    return Ember.computed({\n      get(key) {\n        {\n          if (['_internalModel', 'recordData', 'currentState'].indexOf(key) !== -1) {\n            throw new Error(`'${key}' is a reserved property name on instances of classes extending Model. Please choose a different property name for your hasMany on ${this.constructor.toString()}`);\n          }\n        }\n\n        return this._internalModel.getHasMany(key);\n      },\n\n      set(key, records) {\n        {\n          if (['_internalModel', 'recordData', 'currentState'].indexOf(key) !== -1) {\n            throw new Error(`'${key}' is a reserved property name on instances of classes extending Model. Please choose a different property name for your hasMany on ${this.constructor.toString()}`);\n          }\n        }\n\n        var internalModel = this._internalModel;\n        internalModel.setDirtyHasMany(key, records);\n        return internalModel.getHasMany(key);\n      }\n\n    }).meta(meta);\n  }\n\n  var hasMany$1 = computedMacroWithOptionalParams(hasMany);\n\n  /**\n    @module @ember-data/store\n  */\n\n  /**\n    Holds validation errors for a given record, organized by attribute names.\n\n    Every `Model` has an `errors` property that is an instance of\n    `Errors`. This can be used to display validation error\n    messages returned from the server when a `record.save()` rejects.\n\n    For Example, if you had a `User` model that looked like this:\n\n    ```app/models/user.js\n    import Model, { attr } from '@ember-data/model';\n\n    export default Model.extend({\n      username: attr('string'),\n      email: attr('string')\n    });\n    ```\n    And you attempted to save a record that did not validate on the backend:\n\n    ```javascript\n    let user = store.createRecord('user', {\n      username: 'tomster',\n      email: 'invalidEmail'\n    });\n    user.save();\n    ```\n\n    Your backend would be expected to return an error response that described\n    the problem, so that error messages can be generated on the app.\n\n    API responses will be translated into instances of `Errors` differently,\n    depending on the specific combination of adapter and serializer used. You\n    may want to check the documentation or the source code of the libraries\n    that you are using, to know how they expect errors to be communicated.\n\n    Errors can be displayed to the user by accessing their property name\n    to get an array of all the error objects for that property. Each\n    error object is a JavaScript object with two keys:\n\n    - `message` A string containing the error message from the backend\n    - `attribute` The name of the property associated with this error message\n\n    ```handlebars\n    <label>Username: {{input value=username}} </label>\n    {{#each model.errors.username as |error|}}\n      <div class=\"error\">\n        {{error.message}}\n      </div>\n    {{/each}}\n\n    <label>Email: {{input value=email}} </label>\n    {{#each model.errors.email as |error|}}\n      <div class=\"error\">\n        {{error.message}}\n      </div>\n    {{/each}}\n    ```\n\n    You can also access the special `messages` property on the error\n    object to get an array of all the error strings.\n\n    ```handlebars\n    {{#each model.errors.messages as |message|}}\n      <div class=\"error\">\n        {{message}}\n      </div>\n    {{/each}}\n    ```\n\n    @class Errors\n    @extends Ember.ArrayProxy\n    @uses Ember.Evented\n   */\n  var Errors = Ember.ArrayProxy.extend(Private.DeprecatedEvented, {\n    /**\n      Register with target handler\n       @method _registerHandlers\n      @private\n    */\n    _registerHandlers(becameInvalid, becameValid) {\n      this._registeredHandlers = {\n        becameInvalid,\n        becameValid\n      };\n    },\n\n    /**\n      @property errorsByAttributeName\n      @type {MapWithDefault}\n      @private\n    */\n    errorsByAttributeName: Ember.computed(function () {\n      return new Map();\n    }),\n\n    /**\n      Returns errors for a given attribute\n       ```javascript\n      let user = store.createRecord('user', {\n        username: 'tomster',\n        email: 'invalidEmail'\n      });\n      user.save().catch(function(){\n        user.get('errors').errorsFor('email'); // returns:\n        // [{attribute: \"email\", message: \"Doesn't look like a valid email.\"}]\n      });\n      ```\n       @method errorsFor\n      @param {String} attribute\n      @return {Array}\n    */\n    errorsFor(attribute) {\n      var map = Ember.get(this, 'errorsByAttributeName');\n\n      if (!map.has(attribute)) {\n        map.set(attribute, Ember.A());\n      }\n\n      return map.get(attribute);\n    },\n\n    /**\n      An array containing all of the error messages for this\n      record. This is useful for displaying all errors to the user.\n       ```handlebars\n      {{#each model.errors.messages as |message|}}\n        <div class=\"error\">\n          {{message}}\n        </div>\n      {{/each}}\n      ```\n       @property messages\n      @type {Array}\n    */\n    messages: Ember.computed.mapBy('content', 'message'),\n\n    /**\n      @property content\n      @type {Array}\n      @private\n    */\n    content: Ember.computed(function () {\n      return Ember.A();\n    }),\n\n    /**\n      @method unknownProperty\n      @private\n    */\n    unknownProperty(attribute) {\n      var errors = this.errorsFor(attribute);\n\n      if (errors.length === 0) {\n        return undefined;\n      }\n\n      return errors;\n    },\n\n    /**\n      Total number of errors.\n       @property length\n      @type {Number}\n      @readOnly\n    */\n\n    /**\n      @property isEmpty\n      @type {Boolean}\n      @readOnly\n    */\n    isEmpty: Ember.computed.not('length').readOnly(),\n\n    /**\n     Manually adds errors to the record. This will triger the `becameInvalid` event/ lifecycle method on\n      the record and transition the record into an `invalid` state.\n      Example\n     ```javascript\n      let errors = get(user, 'errors');\n       // add multiple errors\n      errors.add('password', [\n        'Must be at least 12 characters',\n        'Must contain at least one symbol',\n        'Cannot contain your name'\n      ]);\n       errors.errorsFor('password');\n      // =>\n      // [\n      //   { attribute: 'password', message: 'Must be at least 12 characters' },\n      //   { attribute: 'password', message: 'Must contain at least one symbol' },\n      //   { attribute: 'password', message: 'Cannot contain your name' },\n      // ]\n       // add a single error\n      errors.add('username', 'This field is required');\n       errors.errorsFor('password');\n      // =>\n      // [\n      //   { attribute: 'username', message: 'This field is required' },\n      // ]\n     ```\n    @method add\n    @param {string} attribute - the property name of an attribute or relationship\n    @param {string[]|string} messages - an error message or array of error messages for the attribute\n     */\n    add(attribute, messages) {\n      var wasEmpty = Ember.get(this, 'isEmpty');\n\n      this._add(attribute, messages);\n\n      if (wasEmpty && !Ember.get(this, 'isEmpty')) {\n        this._registeredHandlers && this._registeredHandlers.becameInvalid();\n\n        if ( this._has('becameInvalid')) {\n          this.trigger('becameInvalid');\n        }\n      }\n    },\n\n    /**\n      Adds error messages to a given attribute without sending event.\n       @method _add\n      @private\n    */\n    _add(attribute, messages) {\n      messages = this._findOrCreateMessages(attribute, messages);\n      this.addObjects(messages);\n      this.errorsFor(attribute).addObjects(messages);\n      this.notifyPropertyChange(attribute);\n    },\n\n    /**\n      @method _findOrCreateMessages\n      @private\n    */\n    _findOrCreateMessages(attribute, messages) {\n      var errors = this.errorsFor(attribute);\n      var messagesArray = Ember.makeArray(messages);\n\n      var _messages = new Array(messagesArray.length);\n\n      for (var i = 0; i < messagesArray.length; i++) {\n        var message = messagesArray[i];\n        var err = errors.findBy('message', message);\n\n        if (err) {\n          _messages[i] = err;\n        } else {\n          _messages[i] = {\n            attribute: attribute,\n            message: message\n          };\n        }\n      }\n\n      return _messages;\n    },\n\n    /**\n     Manually removes all errors for a given member from the record.\n       This will transition the record into a `valid` state, and\n      triggers the `becameValid` event and lifecycle method.\n      Example:\n      ```javascript\n      let errors = get('user', errors);\n      errors.add('phone', ['error-1', 'error-2']);\n       errors.errorsFor('phone');\n      // =>\n      // [\n      //   { attribute: 'phone', message: 'error-1' },\n      //   { attribute: 'phone', message: 'error-2' },\n      // ]\n       errors.remove('phone');\n       errors.errorsFor('phone');\n      // => undefined\n     ```\n     @method remove\n     @param {string} member - the property name of an attribute or relationship\n     */\n    remove(attribute) {\n      if (Ember.get(this, 'isEmpty')) {\n        return;\n      }\n\n      this._remove(attribute);\n\n      if (Ember.get(this, 'isEmpty')) {\n        this._registeredHandlers && this._registeredHandlers.becameValid();\n\n        if ( this._has('becameValid')) {\n          this.trigger('becameValid');\n        }\n      }\n    },\n\n    /**\n      Removes all error messages from the given attribute without sending event.\n       @method _remove\n      @private\n    */\n    _remove(attribute) {\n      if (Ember.get(this, 'isEmpty')) {\n        return;\n      }\n\n      var content = this.rejectBy('attribute', attribute);\n      Ember.get(this, 'content').setObjects(content);\n      Ember.get(this, 'errorsByAttributeName').delete(attribute);\n      this.notifyPropertyChange(attribute);\n      this.notifyPropertyChange('length');\n    },\n\n    /**\n     Manually clears all errors for the record.\n       This will transition the record into a `valid` state, and\n       will trigger the `becameValid` event and lifecycle method.\n     Example:\n      ```javascript\n     let errors = get('user', errors);\n     errors.add('username', ['error-a']);\n     errors.add('phone', ['error-1', 'error-2']);\n      errors.errorsFor('username');\n     // =>\n     // [\n     //   { attribute: 'username', message: 'error-a' },\n     // ]\n      errors.errorsFor('phone');\n     // =>\n     // [\n     //   { attribute: 'phone', message: 'error-1' },\n     //   { attribute: 'phone', message: 'error-2' },\n     // ]\n      errors.clear();\n      errors.errorsFor('username');\n     // => undefined\n      errors.errorsFor('phone');\n     // => undefined\n      errors.get('messages')\n     // => []\n     ```\n     @method remove\n     */\n    clear() {\n      if (Ember.get(this, 'isEmpty')) {\n        return;\n      }\n\n      this._clear();\n\n      this._registeredHandlers && this._registeredHandlers.becameValid();\n\n      if ( this._has('becameValid')) {\n        this.trigger('becameValid');\n      }\n    },\n\n    /**\n      Removes all error messages.\n      to the record.\n       @method _clear\n      @private\n    */\n    _clear() {\n      if (Ember.get(this, 'isEmpty')) {\n        return;\n      }\n\n      var errorsByAttributeName = Ember.get(this, 'errorsByAttributeName');\n      var attributes = [];\n      errorsByAttributeName.forEach(function (_, attribute) {\n        attributes.push(attribute);\n      });\n      errorsByAttributeName.clear();\n      attributes.forEach(attribute => {\n        this.notifyPropertyChange(attribute);\n      });\n      Ember.ArrayProxy.prototype.clear.call(this);\n    },\n\n    /**\n      Checks if there are error messages for the given attribute.\n       ```app/routes/user/edit.js\n      import Route from '@ember/routing/route';\n       export default Route.extend({\n        actions: {\n          save: function(user) {\n            if (user.get('errors').has('email')) {\n              return alert('Please update your email before attempting to save.');\n            }\n            user.save();\n          }\n        }\n      });\n      ```\n       @method has\n      @param {String} attribute\n      @return {Boolean} true if there some errors on given attribute\n    */\n    has(attribute) {\n      return this.errorsFor(attribute).length > 0;\n    }\n\n  });\n\n  var {\n    changeProperties\n  } = Ember;\n\n  function findPossibleInverses(type, inverseType, name, relationshipsSoFar) {\n    var possibleRelationships = relationshipsSoFar || [];\n    var relationshipMap = Ember.get(inverseType, 'relationships');\n\n    if (!relationshipMap) {\n      return possibleRelationships;\n    }\n\n    var relationshipsForType = relationshipMap.get(type.modelName);\n    var relationships = Array.isArray(relationshipsForType) ? relationshipsForType.filter(relationship => {\n      var optionsForRelationship = inverseType.metaForProperty(relationship.name).options;\n\n      if (!optionsForRelationship.inverse && optionsForRelationship.inverse !== null) {\n        return true;\n      }\n\n      return name === optionsForRelationship.inverse;\n    }) : null;\n\n    if (relationships) {\n      possibleRelationships.push.apply(possibleRelationships, relationships);\n    } //Recurse to support polymorphism\n\n\n    if (type.superclass) {\n      findPossibleInverses(type.superclass, inverseType, name, possibleRelationships);\n    }\n\n    return possibleRelationships;\n  }\n\n  var retrieveFromCurrentState = Ember.computed('currentState', function (key) {\n    return Ember.get(this._internalModel.currentState, key);\n  }).readOnly();\n  var isValidRecordData = Ember.computed('errors.length', function (key) {\n    return !(this.get('errors.length') > 0);\n  }).readOnly();\n  var isValid =  retrieveFromCurrentState;\n  var isDeletedCP;\n\n  {\n    isDeletedCP = retrieveFromCurrentState;\n  }\n\n  var isNewCP;\n\n  {\n    isNewCP = retrieveFromCurrentState;\n  }\n\n  var adapterError;\n\n  {\n    adapterError = null;\n  }\n\n  var isError;\n\n  {\n    isError = false;\n  }\n\n  var isReloading;\n\n  {\n    isReloading = false;\n  }\n  /**\n    @class Model\n    @module @ember-data/model\n    @extends EmberObject\n    @uses EmberData.DeprecatedEvented\n  */\n\n\n  var Model = Ember.Object.extend(Private.DeprecatedEvented, {\n    init() {\n      this._super(...arguments);\n\n      {\n        if (!this._internalModel) {\n          throw new Ember.Error('You should not call `create` on a model. Instead, call `store.createRecord` with the attributes you would like to set.');\n        }\n      }\n    },\n\n    _notifyNetworkChanges: function () {\n      {\n        ['isValid'].forEach(key => this.notifyPropertyChange(key));\n      }\n    },\n\n    /**\n      If this property is `true` the record is in the `empty`\n      state. Empty is the first state all records enter after they have\n      been created. Most records created by the store will quickly\n      transition to the `loading` state if data needs to be fetched from\n      the server or the `created` state if the record is created on the\n      client. A record can also enter the empty state if the adapter is\n      unable to locate the record.\n       @property isEmpty\n      @type {Boolean}\n      @readOnly\n    */\n    isEmpty: retrieveFromCurrentState,\n\n    /**\n      If this property is `true` the record is in the `loading` state. A\n      record enters this state when the store asks the adapter for its\n      data. It remains in this state until the adapter provides the\n      requested data.\n       @property isLoading\n      @type {Boolean}\n      @readOnly\n    */\n    isLoading: retrieveFromCurrentState,\n\n    /**\n      If this property is `true` the record is in the `loaded` state. A\n      record enters this state when its data is populated. Most of a\n      record's lifecycle is spent inside substates of the `loaded`\n      state.\n       Example\n       ```javascript\n      let record = store.createRecord('model');\n      record.get('isLoaded'); // true\n       store.findRecord('model', 1).then(function(model) {\n        model.get('isLoaded'); // true\n      });\n      ```\n       @property isLoaded\n      @type {Boolean}\n      @readOnly\n    */\n    isLoaded: retrieveFromCurrentState,\n\n    /**\n      If this property is `true` the record is in the `dirty` state. The\n      record has local changes that have not yet been saved by the\n      adapter. This includes records that have been created (but not yet\n      saved) or deleted.\n       Example\n       ```javascript\n      let record = store.createRecord('model');\n      record.get('hasDirtyAttributes'); // true\n       store.findRecord('model', 1).then(function(model) {\n        model.get('hasDirtyAttributes'); // false\n        model.set('foo', 'some value');\n        model.get('hasDirtyAttributes'); // true\n      });\n      ```\n       @since 1.13.0\n      @property hasDirtyAttributes\n      @type {Boolean}\n      @readOnly\n    */\n    hasDirtyAttributes: Ember.computed('currentState.isDirty', function () {\n      return this.get('currentState.isDirty');\n    }),\n\n    /**\n      If this property is `true` the record is in the `saving` state. A\n      record enters the saving state when `save` is called, but the\n      adapter has not yet acknowledged that the changes have been\n      persisted to the backend.\n       Example\n       ```javascript\n      let record = store.createRecord('model');\n      record.get('isSaving'); // false\n      let promise = record.save();\n      record.get('isSaving'); // true\n      promise.then(function() {\n        record.get('isSaving'); // false\n      });\n      ```\n       @property isSaving\n      @type {Boolean}\n      @readOnly\n    */\n    isSaving: retrieveFromCurrentState,\n\n    /**\n      If this property is `true` the record is in the `deleted` state\n      and has been marked for deletion. When `isDeleted` is true and\n      `hasDirtyAttributes` is true, the record is deleted locally but the deletion\n      was not yet persisted. When `isSaving` is true, the change is\n      in-flight. When both `hasDirtyAttributes` and `isSaving` are false, the\n      change has persisted.\n       Example\n       ```javascript\n      let record = store.createRecord('model');\n      record.get('isDeleted');    // false\n      record.deleteRecord();\n       // Locally deleted\n      record.get('isDeleted');           // true\n      record.get('hasDirtyAttributes');  // true\n      record.get('isSaving');            // false\n       // Persisting the deletion\n      let promise = record.save();\n      record.get('isDeleted');    // true\n      record.get('isSaving');     // true\n       // Deletion Persisted\n      promise.then(function() {\n        record.get('isDeleted');          // true\n        record.get('isSaving');           // false\n        record.get('hasDirtyAttributes'); // false\n      });\n      ```\n       @property isDeleted\n      @type {Boolean}\n      @readOnly\n    */\n    isDeleted: isDeletedCP,\n\n    /**\n      If this property is `true` the record is in the `new` state. A\n      record will be in the `new` state when it has been created on the\n      client and the adapter has not yet report that it was successfully\n      saved.\n       Example\n       ```javascript\n      let record = store.createRecord('model');\n      record.get('isNew'); // true\n       record.save().then(function(model) {\n        model.get('isNew'); // false\n      });\n      ```\n       @property isNew\n      @type {Boolean}\n      @readOnly\n    */\n    isNew: isNewCP,\n\n    /**\n      If this property is `true` the record is in the `valid` state.\n       A record will be in the `valid` state when the adapter did not report any\n      server-side validation failures.\n       @property isValid\n      @type {Boolean}\n      @readOnly\n    */\n    isValid: isValid,\n\n    _markInvalidRequestAsClean() {\n    },\n\n    /**\n      If the record is in the dirty state this property will report what\n      kind of change has caused it to move into the dirty\n      state. Possible values are:\n       - `created` The record has been created by the client and not yet saved to the adapter.\n      - `updated` The record has been updated by the client and not yet saved to the adapter.\n      - `deleted` The record has been deleted by the client and not yet saved to the adapter.\n       Example\n       ```javascript\n      let record = store.createRecord('model');\n      record.get('dirtyType'); // 'created'\n      ```\n       @property dirtyType\n      @type {String}\n      @readOnly\n    */\n    dirtyType: retrieveFromCurrentState,\n\n    /**\n      If `true` the adapter reported that it was unable to save local\n      changes to the backend for any reason other than a server-side\n      validation error.\n       Example\n       ```javascript\n      record.get('isError'); // false\n      record.set('foo', 'valid value');\n      record.save().then(null, function() {\n        record.get('isError'); // true\n      });\n      ```\n       @property isError\n      @type {Boolean}\n      @readOnly\n    */\n    isError: isError,\n\n    _markErrorRequestAsClean() {\n      this._errorRequests = [];\n      this._lastError = null;\n\n      this._notifyNetworkChanges();\n    },\n\n    /**\n      If `true` the store is attempting to reload the record from the adapter.\n       Example\n       ```javascript\n      record.get('isReloading'); // false\n      record.reload();\n      record.get('isReloading'); // true\n      ```\n       @property isReloading\n      @type {Boolean}\n      @readOnly\n    */\n    isReloading: isReloading,\n\n    /**\n      All ember models have an id property. This is an identifier\n      managed by an external source. These are always coerced to be\n      strings before being used internally. Note when declaring the\n      attributes for a model it is an error to declare an id\n      attribute.\n       ```javascript\n      let record = store.createRecord('model');\n      record.get('id'); // null\n       store.findRecord('model', 1).then(function(model) {\n        model.get('id'); // '1'\n      });\n      ```\n       @property id\n      @type {String}\n    */\n\n    /**\n      @property currentState\n      @private\n      @type {Object}\n    */\n    currentState: Private.RootState.empty,\n    // defined here to avoid triggering setUnknownProperty\n\n    /**\n     @property _internalModel\n     @private\n     @type {Object}\n     */\n    _internalModel: null,\n    // defined here to avoid triggering setUnknownProperty\n\n    /**\n     @property recordData\n     @private\n     @type undefined (reserved)\n     */\n    // will be defined here to avoid triggering setUnknownProperty\n\n    /**\n     @property store\n     */\n    store: null,\n    // defined here to avoid triggering setUnknownProperty\n\n    /**\n      When the record is in the `invalid` state this object will contain\n      any errors returned by the adapter. When present the errors hash\n      contains keys corresponding to the invalid property names\n      and values which are arrays of Javascript objects with two keys:\n       - `message` A string containing the error message from the backend\n      - `attribute` The name of the property associated with this error message\n       ```javascript\n      record.get('errors.length'); // 0\n      record.set('foo', 'invalid value');\n      record.save().catch(function() {\n        record.get('errors').get('foo');\n        // [{message: 'foo should be a number.', attribute: 'foo'}]\n      });\n      ```\n       The `errors` property us useful for displaying error messages to\n      the user.\n       ```handlebars\n      <label>Username: {{input value=username}} </label>\n      {{#each model.errors.username as |error|}}\n        <div class=\"error\">\n          {{error.message}}\n        </div>\n      {{/each}}\n      <label>Email: {{input value=email}} </label>\n      {{#each model.errors.email as |error|}}\n        <div class=\"error\">\n          {{error.message}}\n        </div>\n      {{/each}}\n      ```\n        You can also access the special `messages` property on the error\n      object to get an array of all the error strings.\n       ```handlebars\n      {{#each model.errors.messages as |message|}}\n        <div class=\"error\">\n          {{message}}\n        </div>\n      {{/each}}\n      ```\n       @property errors\n      @type {Errors}\n    */\n    errors: Ember.computed(function () {\n      var errors = Errors.create();\n\n      errors._registerHandlers(() => {\n        this.send('becameInvalid');\n      }, () => {\n        this.send('becameValid');\n      });\n\n      return errors;\n    }).readOnly(),\n\n    invalidErrorsChanged(jsonApiErrors) {\n    },\n\n    _addErrorMessageToAttribute(attribute, message) {\n      this.get('errors')._add(attribute, message);\n    },\n\n    _clearErrorMessages() {\n      this.get('errors')._clear();\n    },\n\n    /**\n      This property holds the `AdapterError` object with which\n      last adapter operation was rejected.\n       @property adapterError\n      @type {AdapterError}\n    */\n    adapterError: adapterError,\n\n    /**\n      Create a JSON representation of the record, using the serialization\n      strategy of the store's adapter.\n      `serialize` takes an optional hash as a parameter, currently\n      supported options are:\n      - `includeId`: `true` if the record's ID should be included in the\n        JSON representation.\n       @method serialize\n      @param {Object} options\n      @return {Object} an object whose values are primitive JSON values only\n    */\n    serialize(options) {\n      return this._internalModel.createSnapshot().serialize(options);\n    },\n\n    /**\n      Use [JSONSerializer](JSONSerializer.html) to\n      get the JSON representation of a record.\n       `toJSON` takes an optional hash as a parameter, currently\n      supported options are:\n       - `includeId`: `true` if the record's ID should be included in the\n        JSON representation.\n       @method toJSON\n      @param {Object} options\n      @return {Object} A JSON representation of the object.\n    */\n    toJSON(options) {\n      // container is for lazy transform lookups\n      ( Ember.deprecate(`Called the built-in \\`toJSON\\` on the record \"${this.constructor.modelName}:${this.id}\". The built-in \\`toJSON\\` method on instances of classes extending \\`Model\\` is deprecated. For more information see the link below.`, false, {\n        id: 'ember-data:model.toJSON',\n        until: '4.0',\n        url: 'https://deprecations.emberjs.com/ember-data/v3.x#toc_record-toJSON'\n      }));\n\n      var serializer = this._internalModel.store.serializerFor('-default');\n\n      var snapshot = this._internalModel.createSnapshot();\n\n      return serializer.serialize(snapshot, options);\n    },\n\n    /**\n      Fired when the record is ready to be interacted with,\n      that is either loaded from the server or created locally.\n       @event ready\n    */\n    ready: null,\n\n    /**\n      Fired when the record is loaded from the server.\n       @event didLoad\n    */\n    didLoad: null,\n\n    /**\n      Fired when the record is updated.\n       @event didUpdate\n    */\n    didUpdate: null,\n\n    /**\n      Fired when a new record is commited to the server.\n       @event didCreate\n    */\n    didCreate: null,\n\n    /**\n      Fired when the record is deleted.\n       @event didDelete\n    */\n    didDelete: null,\n\n    /**\n      Fired when the record becomes invalid.\n       @event becameInvalid\n    */\n    becameInvalid: null,\n\n    /**\n      Fired when the record enters the error state.\n       @event becameError\n    */\n    becameError: null,\n\n    /**\n      Fired when the record is rolled back.\n       @event rolledBack\n    */\n    rolledBack: null,\n\n    //TODO Do we want to deprecate these?\n\n    /**\n      @method send\n      @private\n      @param {String} name\n      @param {Object} context\n    */\n    send(name, context) {\n      return this._internalModel.send(name, context);\n    },\n\n    /**\n      @method transitionTo\n      @private\n      @param {String} name\n    */\n    transitionTo(name) {\n      return this._internalModel.transitionTo(name);\n    },\n\n    /**\n      Marks the record as deleted but does not save it. You must call\n      `save` afterwards if you want to persist it. You might use this\n      method if you want to allow the user to still `rollbackAttributes()`\n      after a delete was made.\n       Example\n       ```app/routes/model/delete.js\n      import Route from '@ember/routing/route';\n       export default Route.extend({\n        actions: {\n          softDelete() {\n            this.get('controller.model').deleteRecord();\n          },\n          confirm() {\n            this.get('controller.model').save();\n          },\n          undo() {\n            this.get('controller.model').rollbackAttributes();\n          }\n        }\n      });\n      ```\n       @method deleteRecord\n    */\n    deleteRecord() {\n      this._internalModel.deleteRecord();\n    },\n\n    /**\n      Same as `deleteRecord`, but saves the record immediately.\n       Example\n       ```app/routes/model/delete.js\n      import Route from '@ember/routing/route';\n       export default Route.extend({\n        actions: {\n          delete() {\n            this.get('controller.model').destroyRecord().then(function() {\n              controller.transitionToRoute('model.index');\n            });\n          }\n        }\n      });\n      ```\n       If you pass an object on the `adapterOptions` property of the options\n      argument it will be passed to your adapter via the snapshot\n       ```js\n      record.destroyRecord({ adapterOptions: { subscribe: false } });\n      ```\n       ```app/adapters/post.js\n      import MyCustomAdapter from './custom-adapter';\n       export default MyCustomAdapter.extend({\n        deleteRecord(store, type, snapshot) {\n          if (snapshot.adapterOptions.subscribe) {\n            // ...\n          }\n          // ...\n        }\n      });\n      ```\n       @method destroyRecord\n      @param {Object} options\n      @return {Promise} a promise that will be resolved when the adapter returns\n      successfully or rejected if the adapter returns with an error.\n    */\n    destroyRecord(options) {\n      this.deleteRecord();\n      return this.save(options);\n    },\n\n    /**\n      Unloads the record from the store. This will not send a delete request\n      to your server, it just unloads the record from memory.\n       @method unloadRecord\n    */\n    unloadRecord() {\n      if (this.isDestroyed) {\n        return;\n      }\n\n      this._internalModel.unloadRecord();\n    },\n\n    /**\n      @method _notifyProperties\n      @private\n    */\n    _notifyProperties(keys) {\n      // changeProperties defers notifications until after the delegate\n      // and protects with a try...finally block\n      // previously used begin...endPropertyChanges but this is private API\n      changeProperties(() => {\n        var key;\n\n        for (var i = 0, length = keys.length; i < length; i++) {\n          key = keys[i];\n          this.notifyPropertyChange(key);\n        }\n      });\n    },\n\n    /**\n      Returns an object, whose keys are changed properties, and value is\n      an [oldProp, newProp] array.\n       The array represents the diff of the canonical state with the local state\n      of the model. Note: if the model is created locally, the canonical state is\n      empty since the adapter hasn't acknowledged the attributes yet:\n       Example\n       ```app/models/mascot.js\n      import Model, { attr } from '@ember-data/model';\n       export default Model.extend({\n        name: attr('string'),\n        isAdmin: attr('boolean', {\n          defaultValue: false\n        })\n      });\n      ```\n       ```javascript\n      let mascot = store.createRecord('mascot');\n       mascot.changedAttributes(); // {}\n       mascot.set('name', 'Tomster');\n      mascot.changedAttributes(); // { name: [undefined, 'Tomster'] }\n       mascot.set('isAdmin', true);\n      mascot.changedAttributes(); // { isAdmin: [undefined, true], name: [undefined, 'Tomster'] }\n       mascot.save().then(function() {\n        mascot.changedAttributes(); // {}\n         mascot.set('isAdmin', false);\n        mascot.changedAttributes(); // { isAdmin: [true, false] }\n      });\n      ```\n       @method changedAttributes\n      @return {Object} an object, whose keys are changed properties,\n        and value is an [oldProp, newProp] array.\n    */\n    changedAttributes() {\n      return this._internalModel.changedAttributes();\n    },\n\n    /**\n      If the model `hasDirtyAttributes` this function will discard any unsaved\n      changes. If the model `isNew` it will be removed from the store.\n       Example\n       ```javascript\n      record.get('name'); // 'Untitled Document'\n      record.set('name', 'Doc 1');\n      record.get('name'); // 'Doc 1'\n      record.rollbackAttributes();\n      record.get('name'); // 'Untitled Document'\n      ```\n       @since 1.13.0\n      @method rollbackAttributes\n    */\n    rollbackAttributes() {\n      this._internalModel.rollbackAttributes();\n    },\n\n    /*\n      @method _createSnapshot\n      @private\n    */\n    _createSnapshot() {\n      return this._internalModel.createSnapshot();\n    },\n\n    toStringExtension() {\n      // the _internalModel guard exists, because some dev-only deprecation code\n      // (addListener via validatePropertyInjections) invokes toString before the\n      // object is real.\n      return this._internalModel && this._internalModel.id;\n    },\n\n    /**\n      Save the record and persist any changes to the record to an\n      external source via the adapter.\n       Example\n       ```javascript\n      record.set('name', 'Tomster');\n      record.save().then(function() {\n        // Success callback\n      }, function() {\n        // Error callback\n      });\n      ```\n      If you pass an object using the `adapterOptions` property of the options\n     argument it will be passed to your adapter via the snapshot.\n       ```js\n      record.save({ adapterOptions: { subscribe: false } });\n      ```\n       ```app/adapters/post.js\n      import MyCustomAdapter from './custom-adapter';\n       export default MyCustomAdapter.extend({\n        updateRecord(store, type, snapshot) {\n          if (snapshot.adapterOptions.subscribe) {\n            // ...\n          }\n          // ...\n        }\n      });\n      ```\n       @method save\n      @param {Object} options\n      @return {Promise} a promise that will be resolved when the adapter returns\n      successfully or rejected if the adapter returns with an error.\n    */\n    save(options) {\n      return Private.PromiseObject.create({\n        promise: this._internalModel.save(options).then(() => this)\n      });\n    },\n\n    /**\n      Reload the record from the adapter.\n       This will only work if the record has already finished loading.\n       Example\n       ```app/routes/model/view.js\n      import Route from '@ember/routing/route';\n       export default Route.extend({\n        actions: {\n          reload() {\n            this.controller.get('model').reload().then(function(model) {\n              // do something with the reloaded model\n            });\n          }\n        }\n      });\n      ```\n       @method reload\n      @param {Object} options optional, may include `adapterOptions` hash which will be passed to adapter request\n      @return {Promise} a promise that will be resolved with the record when the\n      adapter returns successfully or rejected if the adapter returns\n      with an error.\n    */\n    reload(options) {\n      var wrappedAdapterOptions;\n\n      if (typeof options === 'object' && options !== null && options.adapterOptions) {\n        wrappedAdapterOptions = {\n          adapterOptions: options.adapterOptions\n        };\n      }\n\n      return Private.PromiseObject.create({\n        promise: this._internalModel.reload(wrappedAdapterOptions).then(() => this)\n      });\n    },\n\n    /**\n      Override the default event firing from Ember.Evented to\n      also call methods with the given name.\n       @method trigger\n      @private\n      @param {String} name\n    */\n    trigger(name) {\n      var fn = this[name];\n\n      if (typeof fn === 'function') {\n        var length = arguments.length;\n        var args = new Array(length - 1);\n\n        for (var i = 1; i < length; i++) {\n          args[i - 1] = arguments[i];\n        }\n\n        fn.apply(this, args);\n      }\n\n      var _hasEvent =  this._has(name) ;\n\n      if (_hasEvent) {\n        this._super(...arguments);\n      }\n    },\n\n    attr() {\n      ( Ember.assert('The `attr` method is not available on Model, a Snapshot was probably expected. Are you passing a Model instead of a Snapshot to your serializer?', false));\n    },\n\n    /**\n      Get the reference for the specified belongsTo relationship.\n       Example\n       ```app/models/blog.js\n      import Model, { belongsTo } from '@ember-data/model';\n       export default Model.extend({\n        user: belongsTo({ async: true })\n      });\n      ```\n       ```javascript\n      let blog = store.push({\n        data: {\n          type: 'blog',\n          id: 1,\n          relationships: {\n            user: {\n              data: { type: 'user', id: 1 }\n            }\n          }\n        }\n      });\n      let userRef = blog.belongsTo('user');\n       // check if the user relationship is loaded\n      let isLoaded = userRef.value() !== null;\n       // get the record of the reference (null if not yet available)\n      let user = userRef.value();\n       // get the identifier of the reference\n      if (userRef.remoteType() === \"id\") {\n        let id = userRef.id();\n      } else if (userRef.remoteType() === \"link\") {\n        let link = userRef.link();\n      }\n       // load user (via store.findRecord or store.findBelongsTo)\n      userRef.load().then(...)\n       // or trigger a reload\n      userRef.reload().then(...)\n       // provide data for reference\n      userRef.push({\n        type: 'user',\n        id: 1,\n        attributes: {\n          username: \"@user\"\n        }\n      }).then(function(user) {\n        userRef.value() === user;\n      });\n      ```\n       @method belongsTo\n      @param {String} name of the relationship\n      @since 2.5.0\n      @return {BelongsToReference} reference for this relationship\n    */\n    belongsTo(name) {\n      return this._internalModel.referenceFor('belongsTo', name);\n    },\n\n    /**\n      Get the reference for the specified hasMany relationship.\n       Example\n       ```app/models/blog.js\n      import Model, { hasMany } from '@ember-data/model';\n       export default Model.extend({\n        comments: hasMany({ async: true })\n      });\n       let blog = store.push({\n        data: {\n          type: 'blog',\n          id: 1,\n          relationships: {\n            comments: {\n              data: [\n                { type: 'comment', id: 1 },\n                { type: 'comment', id: 2 }\n              ]\n            }\n          }\n        }\n      });\n      let commentsRef = blog.hasMany('comments');\n       // check if the comments are loaded already\n      let isLoaded = commentsRef.value() !== null;\n       // get the records of the reference (null if not yet available)\n      let comments = commentsRef.value();\n       // get the identifier of the reference\n      if (commentsRef.remoteType() === \"ids\") {\n        let ids = commentsRef.ids();\n      } else if (commentsRef.remoteType() === \"link\") {\n        let link = commentsRef.link();\n      }\n       // load comments (via store.findMany or store.findHasMany)\n      commentsRef.load().then(...)\n       // or trigger a reload\n      commentsRef.reload().then(...)\n       // provide data for reference\n      commentsRef.push([{ type: 'comment', id: 1 }, { type: 'comment', id: 2 }]).then(function(comments) {\n        commentsRef.value() === comments;\n      });\n      ```\n       @method hasMany\n      @param {String} name of the relationship\n      @since 2.5.0\n      @return {HasManyReference} reference for this relationship\n    */\n    hasMany(name) {\n      return this._internalModel.referenceFor('hasMany', name);\n    },\n\n    /**\n     Provides info about the model for debugging purposes\n     by grouping the properties into more semantic groups.\n      Meant to be used by debugging tools such as the Chrome Ember Extension.\n      - Groups all attributes in \"Attributes\" group.\n     - Groups all belongsTo relationships in \"Belongs To\" group.\n     - Groups all hasMany relationships in \"Has Many\" group.\n     - Groups all flags in \"Flags\" group.\n     - Flags relationship CPs as expensive properties.\n      @method _debugInfo\n     @for Model\n     @private\n     */\n    _debugInfo() {\n      var attributes = ['id'];\n      var relationships = {};\n      var expensiveProperties = [];\n      this.eachAttribute((name, meta) => attributes.push(name));\n      var groups = [{\n        name: 'Attributes',\n        properties: attributes,\n        expand: true\n      }];\n      this.eachRelationship((name, relationship) => {\n        var properties = relationships[relationship.kind];\n\n        if (properties === undefined) {\n          properties = relationships[relationship.kind] = [];\n          groups.push({\n            name: relationship.kind,\n            properties,\n            expand: true\n          });\n        }\n\n        properties.push(name);\n        expensiveProperties.push(name);\n      });\n      groups.push({\n        name: 'Flags',\n        properties: ['isLoaded', 'hasDirtyAttributes', 'isSaving', 'isDeleted', 'isError', 'isNew', 'isValid']\n      });\n      return {\n        propertyInfo: {\n          // include all other mixins / properties (not just the grouped ones)\n          includeOtherProperties: true,\n          groups: groups,\n          // don't pre-calculate unless cached\n          expensiveProperties: expensiveProperties\n        }\n      };\n    },\n\n    notifyBelongsToChange(key) {\n      this.notifyPropertyChange(key);\n    },\n\n    /**\n     Given a callback, iterates over each of the relationships in the model,\n     invoking the callback with the name of each relationship and its relationship\n     descriptor.\n       The callback method you provide should have the following signature (all\n     parameters are optional):\n      ```javascript\n     function(name, descriptor);\n     ```\n      - `name` the name of the current property in the iteration\n     - `descriptor` the meta object that describes this relationship\n      The relationship descriptor argument is an object with the following properties.\n      - **key** <span class=\"type\">String</span> the name of this relationship on the Model\n     - **kind** <span class=\"type\">String</span> \"hasMany\" or \"belongsTo\"\n     - **options** <span class=\"type\">Object</span> the original options hash passed when the relationship was declared\n     - **parentType** <span class=\"type\">Model</span> the type of the Model that owns this relationship\n     - **type** <span class=\"type\">String</span> the type name of the related Model\n      Note that in addition to a callback, you can also pass an optional target\n     object that will be set as `this` on the context.\n      Example\n      ```app/serializers/application.js\n     import JSONSerializer from '@ember-data/serializer/json';\n      export default JSONSerializer.extend({\n      serialize: function(record, options) {\n        let json = {};\n         record.eachRelationship(function(name, descriptor) {\n          if (descriptor.kind === 'hasMany') {\n            let serializedHasManyName = name.toUpperCase() + '_IDS';\n            json[serializedHasManyName] = record.get(name).mapBy('id');\n          }\n        });\n         return json;\n      }\n    });\n     ```\n      @method eachRelationship\n     @param {Function} callback the callback to invoke\n     @param {any} binding the value to which the callback's `this` should be bound\n     */\n    eachRelationship(callback, binding) {\n      this.constructor.eachRelationship(callback, binding);\n    },\n\n    relationshipFor(name) {\n      return Ember.get(this.constructor, 'relationshipsByName').get(name);\n    },\n\n    inverseFor(key) {\n      return this.constructor.inverseFor(key, this._internalModel.store);\n    },\n\n    notifyHasManyAdded(key) {\n      //We need to notifyPropertyChange in the adding case because we need to make sure\n      //we fetch the newly added record in case it is unloaded\n      //TODO(Igor): Consider whether we could do this only if the record state is unloaded\n      this.notifyPropertyChange(key);\n    },\n\n    eachAttribute(callback, binding) {\n      this.constructor.eachAttribute(callback, binding);\n    }\n\n  });\n  /**\n   @property data\n   @private\n   @deprecated\n   @type {Object}\n   */\n\n  Object.defineProperty(Model.prototype, 'data', {\n    configurable: false,\n\n    get() {\n      ( Ember.deprecate(`Model.data was private and it's use has been deprecated. For public access, use the RecordData API or iterate attributes`, false, {\n        id: 'ember-data:Model.data',\n        until: '3.9'\n      }));\n      return Private.recordDataFor(this)._data;\n    }\n\n  });\n  var ID_DESCRIPTOR = {\n    configurable: false,\n\n    set(id) {\n      var normalizedId = Private.coerceId(id);\n\n      if (normalizedId !== null) {\n        this._internalModel.setId(normalizedId);\n      }\n    },\n\n    get() {\n      // the _internalModel guard exists, because some dev-only deprecation code\n      // (addListener via validatePropertyInjections) invokes toString before the\n      // object is real.\n      {\n        if (!this._internalModel) {\n          return;\n        }\n      }\n\n      Ember.get(this._internalModel, '_tag');\n      return this._internalModel.id;\n    }\n\n  };\n  Object.defineProperty(Model.prototype, 'id', ID_DESCRIPTOR);\n\n  {\n    var lookupDescriptor = function lookupDescriptor(obj, keyName) {\n      var current = obj;\n\n      do {\n        var descriptor = Object.getOwnPropertyDescriptor(current, keyName);\n\n        if (descriptor !== undefined) {\n          return descriptor;\n        }\n\n        current = Object.getPrototypeOf(current);\n      } while (current !== null);\n\n      return null;\n    };\n\n    var isBasicDesc = function isBasicDesc(desc) {\n      return !desc || !desc.get && !desc.set && desc.enumerable === true && desc.writable === true && desc.configurable === true;\n    };\n\n    var isDefaultEmptyDescriptor = function isDefaultEmptyDescriptor(obj, keyName) {\n      var instanceDesc = lookupDescriptor(obj, keyName);\n      return isBasicDesc(instanceDesc) && lookupDescriptor(obj.constructor, keyName) === null;\n    };\n\n    var INSTANCE_DEPRECATIONS = new WeakMap();\n    var DEPRECATED_LIFECYCLE_EVENT_METHODS = ['becameError', 'becameInvalid', 'didCreate', 'didDelete', 'didLoad', 'didUpdate', 'ready', 'rolledBack'];\n\n    var lookupDeprecations = function lookupInstanceDeprecations(instance) {\n      var deprecations = INSTANCE_DEPRECATIONS.get(instance);\n\n      if (!deprecations) {\n        deprecations = new Set();\n        INSTANCE_DEPRECATIONS.set(instance, deprecations);\n      }\n\n      return deprecations;\n    };\n\n    Model.reopen({\n      init() {\n        this._super(...arguments);\n\n        this._getDeprecatedEventedInfo = () => `${this._internalModel.modelName}#${this.id}`;\n\n        if (!isDefaultEmptyDescriptor(this, '_internalModel') || !(this._internalModel instanceof Private.InternalModel)) {\n          throw new Error(`'_internalModel' is a reserved property name on instances of classes extending Model. Please choose a different property name for ${this.constructor.toString()}`);\n        }\n\n        if (!isDefaultEmptyDescriptor(this, 'currentState') || this.get('currentState') !== this._internalModel.currentState) {\n          throw new Error(`'currentState' is a reserved property name on instances of classes extending Model. Please choose a different property name for ${this.constructor.toString()}`);\n        }\n\n        var idDesc = lookupDescriptor(this, 'id');\n\n        if (idDesc.get !== ID_DESCRIPTOR.get) {\n          throw new Ember.Error(`You may not set 'id' as an attribute on your model. Please remove any lines that look like: \\`id: attr('<type>')\\` from ${this.constructor.toString()}`);\n        }\n\n        var lifecycleDeprecations = lookupDeprecations(this.constructor);\n        DEPRECATED_LIFECYCLE_EVENT_METHODS.forEach(methodName => {\n          if (typeof this[methodName] === 'function' && !lifecycleDeprecations.has(methodName)) {\n            ( Ember.deprecate(`You defined a \\`${methodName}\\` method for ${this.constructor.toString()} but lifecycle events for models have been deprecated.`, false, {\n              id: 'ember-data:record-lifecycle-event-methods',\n              until: '4.0',\n              url: 'https://deprecations.emberjs.com/ember-data/v3.x#toc_record-lifecycle-event-methods'\n            }));\n            lifecycleDeprecations.add(methodName);\n          }\n        });\n      }\n\n    });\n  }\n\n  Model.reopenClass({\n    isModel: true,\n\n    /**\n      Create should only ever be called by the store. To create an instance of a\n      `Model` in a dirty state use `store.createRecord`.\n      To create instances of `Model` in a clean state, use `store.push`\n       @method create\n      @private\n      @static\n    */\n\n    /**\n     Represents the model's class name as a string. This can be used to look up the model's class name through\n     `Store`'s modelFor method.\n      `modelName` is generated for you by Ember Data. It will be a lowercased, dasherized string.\n     For example:\n      ```javascript\n     store.modelFor('post').modelName; // 'post'\n     store.modelFor('blog-post').modelName; // 'blog-post'\n     ```\n      The most common place you'll want to access `modelName` is in your serializer's `payloadKeyFromModelName` method. For example, to change payload\n     keys to underscore (instead of dasherized), you might use the following code:\n      ```javascript\n     import RESTSerializer from '@ember-data/serializer/rest';\n     import { underscore } from '@ember/string';\n      export default const PostSerializer = RESTSerializer.extend({\n       payloadKeyFromModelName(modelName) {\n         return underscore(modelName);\n       }\n     });\n     ```\n     @property modelName\n     @type String\n     @readonly\n     @static\n    */\n    modelName: null,\n\n    /*\n     These class methods below provide relationship\n     introspection abilities about relationships.\n      A note about the computed properties contained here:\n      **These properties are effectively sealed once called for the first time.**\n     To avoid repeatedly doing expensive iteration over a model's fields, these\n     values are computed once and then cached for the remainder of the runtime of\n     your application.\n      If your application needs to modify a class after its initial definition\n     (for example, using `reopen()` to add additional attributes), make sure you\n     do it before using your model with the store, which uses these properties\n     extensively.\n     */\n\n    /**\n     For a given relationship name, returns the model type of the relationship.\n      For example, if you define a model like this:\n      ```app/models/post.js\n     import Model, { hasMany } from '@ember-data/model';\n      export default Model.extend({\n        comments: hasMany('comment')\n      });\n     ```\n      Calling `store.modelFor('post').typeForRelationship('comments', store)` will return `Comment`.\n      @method typeForRelationship\n     @static\n     @param {String} name the name of the relationship\n     @param {store} store an instance of Store\n     @return {Model} the type of the relationship, or undefined\n     */\n    typeForRelationship(name, store) {\n      var relationship = Ember.get(this, 'relationshipsByName').get(name);\n      return relationship && store.modelFor(relationship.type);\n    },\n\n    inverseMap: Ember.computed(function () {\n      return Object.create(null);\n    }),\n\n    /**\n     Find the relationship which is the inverse of the one asked for.\n      For example, if you define models like this:\n      ```app/models/post.js\n     import Model, { hasMany } from '@ember-data/model';\n      export default Model.extend({\n        comments: hasMany('message')\n      });\n     ```\n      ```app/models/message.js\n     import Model, { belongsTo } from '@ember-data/model';\n      export default Model.extend({\n        owner: belongsTo('post')\n      });\n     ```\n      ``` js\n     store.modelFor('post').inverseFor('comments', store) // { type: App.Message, name: 'owner', kind: 'belongsTo' }\n     store.modelFor('message').inverseFor('owner', store) // { type: App.Post, name: 'comments', kind: 'hasMany' }\n     ```\n      @method inverseFor\n     @static\n     @param {String} name the name of the relationship\n     @param {Store} store\n     @return {Object} the inverse relationship, or null\n     */\n    inverseFor(name, store) {\n      var inverseMap = Ember.get(this, 'inverseMap');\n\n      if (inverseMap[name]) {\n        return inverseMap[name];\n      } else {\n        var inverse = this._findInverseFor(name, store);\n\n        inverseMap[name] = inverse;\n        return inverse;\n      }\n    },\n\n    //Calculate the inverse, ignoring the cache\n    _findInverseFor(name, store) {\n      var inverseType = this.typeForRelationship(name, store);\n\n      if (!inverseType) {\n        return null;\n      }\n\n      var propertyMeta = this.metaForProperty(name); //If inverse is manually specified to be null, like  `comments: hasMany('message', { inverse: null })`\n\n      var options = propertyMeta.options;\n\n      if (options.inverse === null) {\n        return null;\n      }\n\n      var inverseName, inverseKind, inverse, inverseOptions; //If inverse is specified manually, return the inverse\n\n      if (options.inverse) {\n        inverseName = options.inverse;\n        inverse = Ember.get(inverseType, 'relationshipsByName').get(inverseName);\n        ( !(!Ember.isNone(inverse)) && Ember.assert(\"We found no inverse relationships by the name of '\" + inverseName + \"' on the '\" + inverseType.modelName + \"' model. This is most likely due to a missing attribute on your model definition.\", !Ember.isNone(inverse))); // TODO probably just return the whole inverse here\n\n        inverseKind = inverse.kind;\n        inverseOptions = inverse.options;\n      } else {\n        //No inverse was specified manually, we need to use a heuristic to guess one\n        if (propertyMeta.type === propertyMeta.parentModelName) {\n          ( Ember.warn(`Detected a reflexive relationship by the name of '${name}' without an inverse option. Look at https://guides.emberjs.com/current/models/relationships/#toc_reflexive-relations for how to explicitly specify inverses.`, false, {\n            id: 'ds.model.reflexive-relationship-without-inverse'\n          }));\n        }\n\n        var possibleRelationships = findPossibleInverses(this, inverseType, name);\n\n        if (possibleRelationships.length === 0) {\n          return null;\n        }\n\n        var filteredRelationships = possibleRelationships.filter(possibleRelationship => {\n          var optionsForRelationship = inverseType.metaForProperty(possibleRelationship.name).options;\n          return name === optionsForRelationship.inverse;\n        });\n        ( !(filteredRelationships.length < 2) && Ember.assert(\"You defined the '\" + name + \"' relationship on \" + this + ', but you defined the inverse relationships of type ' + inverseType.toString() + ' multiple times. Look at https://guides.emberjs.com/current/models/relationships/#toc_explicit-inverses for how to explicitly specify inverses', filteredRelationships.length < 2));\n\n        if (filteredRelationships.length === 1) {\n          possibleRelationships = filteredRelationships;\n        }\n\n        ( !(possibleRelationships.length === 1) && Ember.assert(\"You defined the '\" + name + \"' relationship on \" + this + ', but multiple possible inverse relationships of type ' + this + ' were found on ' + inverseType + '. Look at https://guides.emberjs.com/current/models/relationships/#toc_explicit-inverses for how to explicitly specify inverses', possibleRelationships.length === 1));\n        inverseName = possibleRelationships[0].name;\n        inverseKind = possibleRelationships[0].kind;\n        inverseOptions = possibleRelationships[0].options;\n      }\n\n      ( !(!inverseOptions || inverseOptions.inverse !== null) && Ember.assert(`The ${inverseType.modelName}:${inverseName} relationship declares 'inverse: null', but it was resolved as the inverse for ${this.modelName}:${name}.`, !inverseOptions || inverseOptions.inverse !== null));\n      return {\n        type: inverseType,\n        name: inverseName,\n        kind: inverseKind,\n        options: inverseOptions\n      };\n    },\n\n    /**\n     The model's relationships as a map, keyed on the type of the\n     relationship. The value of each entry is an array containing a descriptor\n     for each relationship with that type, describing the name of the relationship\n     as well as the type.\n      For example, given the following model definition:\n      ```app/models/blog.js\n     import Model, { belongsTo, hasMany } from '@ember-data/model';\n      export default Model.extend({\n        users: hasMany('user'),\n        owner: belongsTo('user'),\n        posts: hasMany('post')\n      });\n     ```\n      This computed property would return a map describing these\n     relationships, like this:\n      ```javascript\n     import Ember from 'ember';\n     import Blog from 'app/models/blog';\n     import User from 'app/models/user';\n     import Post from 'app/models/post';\n      let relationships = Ember.get(Blog, 'relationships');\n     relationships.get('user');\n     //=> [ { name: 'users', kind: 'hasMany' },\n     //     { name: 'owner', kind: 'belongsTo' } ]\n     relationships.get('post');\n     //=> [ { name: 'posts', kind: 'hasMany' } ]\n     ```\n      @property relationships\n     @static\n     @type Map\n     @readOnly\n     */\n    relationships: Private.relationshipsDescriptor,\n\n    /**\n     A hash containing lists of the model's relationships, grouped\n     by the relationship kind. For example, given a model with this\n     definition:\n      ```app/models/blog.js\n     import Model, { belongsTo, hasMany } from '@ember-data/model';\n      export default Model.extend({\n        users: hasMany('user'),\n        owner: belongsTo('user'),\n         posts: hasMany('post')\n      });\n     ```\n      This property would contain the following:\n      ```javascript\n     import Ember from 'ember';\n     import Blog from 'app/models/blog';\n      let relationshipNames = Ember.get(Blog, 'relationshipNames');\n     relationshipNames.hasMany;\n     //=> ['users', 'posts']\n     relationshipNames.belongsTo;\n     //=> ['owner']\n     ```\n      @property relationshipNames\n     @static\n     @type Object\n     @readOnly\n     */\n    relationshipNames: Ember.computed(function () {\n      var names = {\n        hasMany: [],\n        belongsTo: []\n      };\n      this.eachComputedProperty((name, meta) => {\n        if (meta.isRelationship) {\n          names[meta.kind].push(name);\n        }\n      });\n      return names;\n    }),\n\n    /**\n     An array of types directly related to a model. Each type will be\n     included once, regardless of the number of relationships it has with\n     the model.\n      For example, given a model with this definition:\n      ```app/models/blog.js\n     import Model, { belongsTo, hasMany } from '@ember-data/model';\n      export default Model.extend({\n        users: hasMany('user'),\n        owner: belongsTo('user'),\n         posts: hasMany('post')\n      });\n     ```\n      This property would contain the following:\n      ```javascript\n     import Ember from 'ember';\n     import Blog from 'app/models/blog';\n      let relatedTypes = Ember.get(Blog, 'relatedTypes');\n     //=> [ User, Post ]\n     ```\n      @property relatedTypes\n     @static\n     @type Ember.Array\n     @readOnly\n     */\n    relatedTypes: Private.relatedTypesDescriptor,\n\n    /**\n     A map whose keys are the relationships of a model and whose values are\n     relationship descriptors.\n      For example, given a model with this\n     definition:\n      ```app/models/blog.js\n     import Model, { belongsTo, hasMany } from '@ember-data/model';\n      export default Model.extend({\n        users: hasMany('user'),\n        owner: belongsTo('user'),\n         posts: hasMany('post')\n      });\n     ```\n      This property would contain the following:\n      ```javascript\n     import Ember from 'ember';\n     import Blog from 'app/models/blog';\n      let relationshipsByName = Ember.get(Blog, 'relationshipsByName');\n     relationshipsByName.get('users');\n     //=> { key: 'users', kind: 'hasMany', type: 'user', options: Object, isRelationship: true }\n     relationshipsByName.get('owner');\n     //=> { key: 'owner', kind: 'belongsTo', type: 'user', options: Object, isRelationship: true }\n     ```\n      @property relationshipsByName\n     @static\n     @type Map\n     @readOnly\n     */\n    relationshipsByName: Private.relationshipsByNameDescriptor,\n    relationshipsObject: Private.relationshipsObjectDescriptor,\n\n    /**\n     A map whose keys are the fields of the model and whose values are strings\n     describing the kind of the field. A model's fields are the union of all of its\n     attributes and relationships.\n      For example:\n      ```app/models/blog.js\n     import Model, { attr, belongsTo, hasMany } from '@ember-data/model';\n      export default Model.extend({\n        users: hasMany('user'),\n        owner: belongsTo('user'),\n         posts: hasMany('post'),\n         title: attr('string')\n      });\n     ```\n      ```js\n     import Ember from 'ember';\n     import Blog from 'app/models/blog';\n      let fields = Ember.get(Blog, 'fields');\n     fields.forEach(function(kind, field) {\n        console.log(field, kind);\n      });\n      // prints:\n     // users, hasMany\n     // owner, belongsTo\n     // posts, hasMany\n     // title, attribute\n     ```\n      @property fields\n     @static\n     @type Map\n     @readOnly\n     */\n    fields: Ember.computed(function () {\n      var map = new Map();\n      this.eachComputedProperty((name, meta) => {\n        if (meta.isRelationship) {\n          map.set(name, meta.kind);\n        } else if (meta.isAttribute) {\n          map.set(name, 'attribute');\n        }\n      });\n      return map;\n    }).readOnly(),\n\n    /**\n     Given a callback, iterates over each of the relationships in the model,\n     invoking the callback with the name of each relationship and its relationship\n     descriptor.\n      @method eachRelationship\n     @static\n     @param {Function} callback the callback to invoke\n     @param {any} binding the value to which the callback's `this` should be bound\n     */\n    eachRelationship(callback, binding) {\n      Ember.get(this, 'relationshipsByName').forEach((relationship, name) => {\n        callback.call(binding, name, relationship);\n      });\n    },\n\n    /**\n     Given a callback, iterates over each of the types related to a model,\n     invoking the callback with the related type's class. Each type will be\n     returned just once, regardless of how many different relationships it has\n     with a model.\n      @method eachRelatedType\n     @static\n     @param {Function} callback the callback to invoke\n     @param {any} binding the value to which the callback's `this` should be bound\n     */\n    eachRelatedType(callback, binding) {\n      var relationshipTypes = Ember.get(this, 'relatedTypes');\n\n      for (var i = 0; i < relationshipTypes.length; i++) {\n        var type = relationshipTypes[i];\n        callback.call(binding, type);\n      }\n    },\n\n    determineRelationshipType(knownSide, store) {\n      var knownKey = knownSide.key;\n      var knownKind = knownSide.kind;\n      var inverse = this.inverseFor(knownKey, store); // let key;\n\n      var otherKind;\n\n      if (!inverse) {\n        return knownKind === 'belongsTo' ? 'oneToNone' : 'manyToNone';\n      } // key = inverse.name;\n\n\n      otherKind = inverse.kind;\n\n      if (otherKind === 'belongsTo') {\n        return knownKind === 'belongsTo' ? 'oneToOne' : 'manyToOne';\n      } else {\n        return knownKind === 'belongsTo' ? 'oneToMany' : 'manyToMany';\n      }\n    },\n\n    /**\n     A map whose keys are the attributes of the model (properties\n     described by attr) and whose values are the meta object for the\n     property.\n      Example\n      ```app/models/person.js\n     import Model, { attr } from '@ember-data/model';\n      export default Model.extend({\n        firstName: attr('string'),\n        lastName: attr('string'),\n        birthday: attr('date')\n      });\n     ```\n      ```javascript\n     import Ember from 'ember';\n     import Person from 'app/models/person';\n      let attributes = Ember.get(Person, 'attributes')\n      attributes.forEach(function(meta, name) {\n        console.log(name, meta);\n      });\n      // prints:\n     // firstName {type: \"string\", isAttribute: true, options: Object, parentType: function, name: \"firstName\"}\n     // lastName {type: \"string\", isAttribute: true, options: Object, parentType: function, name: \"lastName\"}\n     // birthday {type: \"date\", isAttribute: true, options: Object, parentType: function, name: \"birthday\"}\n     ```\n      @property attributes\n     @static\n     @type {Map}\n     @readOnly\n     */\n    attributes: Ember.computed(function () {\n      var map = new Map();\n      this.eachComputedProperty((name, meta) => {\n        if (meta.isAttribute) {\n          ( !(name !== 'id') && Ember.assert(\"You may not set `id` as an attribute on your model. Please remove any lines that look like: `id: attr('<type>')` from \" + this.toString(), name !== 'id'));\n          meta.name = name;\n          map.set(name, meta);\n        }\n      });\n      return map;\n    }).readOnly(),\n\n    /**\n     A map whose keys are the attributes of the model (properties\n     described by attr) and whose values are type of transformation\n     applied to each attribute. This map does not include any\n     attributes that do not have an transformation type.\n      Example\n      ```app/models/person.js\n     import Model, { attr } from '@ember-data/model';\n      export default Model.extend({\n        firstName: attr(),\n        lastName: attr('string'),\n        birthday: attr('date')\n      });\n     ```\n      ```javascript\n     import Ember from 'ember';\n     import Person from 'app/models/person';\n      let transformedAttributes = Ember.get(Person, 'transformedAttributes')\n      transformedAttributes.forEach(function(field, type) {\n        console.log(field, type);\n      });\n      // prints:\n     // lastName string\n     // birthday date\n     ```\n      @property transformedAttributes\n     @static\n     @type {Map}\n     @readOnly\n     */\n    transformedAttributes: Ember.computed(function () {\n      var map = new Map();\n      this.eachAttribute((key, meta) => {\n        if (meta.type) {\n          map.set(key, meta.type);\n        }\n      });\n      return map;\n    }).readOnly(),\n\n    /**\n     Iterates through the attributes of the model, calling the passed function on each\n     attribute.\n      The callback method you provide should have the following signature (all\n     parameters are optional):\n      ```javascript\n     function(name, meta);\n     ```\n      - `name` the name of the current property in the iteration\n     - `meta` the meta object for the attribute property in the iteration\n      Note that in addition to a callback, you can also pass an optional target\n     object that will be set as `this` on the context.\n      Example\n      ```javascript\n     import Model, { attr } from '@ember-data/model';\n      let Person = Model.extend({\n        firstName: attr('string'),\n        lastName: attr('string'),\n        birthday: attr('date')\n      });\n      Person.eachAttribute(function(name, meta) {\n        console.log(name, meta);\n      });\n      // prints:\n     // firstName {type: \"string\", isAttribute: true, options: Object, parentType: function, name: \"firstName\"}\n     // lastName {type: \"string\", isAttribute: true, options: Object, parentType: function, name: \"lastName\"}\n     // birthday {type: \"date\", isAttribute: true, options: Object, parentType: function, name: \"birthday\"}\n     ```\n      @method eachAttribute\n     @param {Function} callback The callback to execute\n     @param {Object} [binding] the value to which the callback's `this` should be bound\n     @static\n     */\n    eachAttribute(callback, binding) {\n      Ember.get(this, 'attributes').forEach((meta, name) => {\n        callback.call(binding, name, meta);\n      });\n    },\n\n    /**\n     Iterates through the transformedAttributes of the model, calling\n     the passed function on each attribute. Note the callback will not be\n     called for any attributes that do not have an transformation type.\n      The callback method you provide should have the following signature (all\n     parameters are optional):\n      ```javascript\n     function(name, type);\n     ```\n      - `name` the name of the current property in the iteration\n     - `type` a string containing the name of the type of transformed\n     applied to the attribute\n      Note that in addition to a callback, you can also pass an optional target\n     object that will be set as `this` on the context.\n      Example\n      ```javascript\n     import Model, { attr } from '@ember-data/model';\n      let Person = Model.extend({\n        firstName: attr(),\n        lastName: attr('string'),\n        birthday: attr('date')\n      });\n      Person.eachTransformedAttribute(function(name, type) {\n        console.log(name, type);\n      });\n      // prints:\n     // lastName string\n     // birthday date\n     ```\n      @method eachTransformedAttribute\n     @param {Function} callback The callback to execute\n     @param {Object} [binding] the value to which the callback's `this` should be bound\n     @static\n     */\n    eachTransformedAttribute(callback, binding) {\n      Ember.get(this, 'transformedAttributes').forEach((type, name) => {\n        callback.call(binding, name, type);\n      });\n    },\n\n    /**\n     Returns the name of the model class.\n      @method toString\n     @static\n     */\n    toString() {\n      return `model:${Ember.get(this, 'modelName')}`;\n    }\n\n  });\n\n  exports.Errors = Errors;\n  exports.Model = Model;\n  exports.attr = attr$1;\n  exports.belongsTo = belongsTo$1;\n  exports.hasMany = hasMany$1;\n\n  Object.defineProperty(exports, '__esModule', { value: true });\n\n});\n","define(\"@ember-data/model/index\", [\"exports\", \"@ember-data/model/-private\"], function (_exports, _private) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"default\", {\n    enumerable: true,\n    get: function () {\n      return _private.Model;\n    }\n  });\n  Object.defineProperty(_exports, \"attr\", {\n    enumerable: true,\n    get: function () {\n      return _private.attr;\n    }\n  });\n  Object.defineProperty(_exports, \"belongsTo\", {\n    enumerable: true,\n    get: function () {\n      return _private.belongsTo;\n    }\n  });\n  Object.defineProperty(_exports, \"hasMany\", {\n    enumerable: true,\n    get: function () {\n      return _private.hasMany;\n    }\n  });\n});","define('@ember-data/record-data/-private', ['exports', '@ember-data/store/-debug', '@ember-data/store/-private', '@ember/ordered-set'], function (exports, Debug, Private, EmberOrderedSet) { 'use strict';\n\n  EmberOrderedSet = EmberOrderedSet && EmberOrderedSet.hasOwnProperty('default') ? EmberOrderedSet['default'] : EmberOrderedSet;\n\n  function relationshipsFor(instance) {\n    var recordData = Private.recordDataFor(instance) || instance;\n    return recordData._relationships;\n  }\n  function relationshipStateFor(instance, propertyName) {\n    return relationshipsFor(instance).get(propertyName);\n  }\n  function implicitRelationshipsFor(instance) {\n    var recordData = Private.recordDataFor(instance) || instance;\n    return recordData._implicitRelationships;\n  }\n  function implicitRelationshipStateFor(instance, propertyName) {\n    return implicitRelationshipsFor(instance)[propertyName];\n  }\n\n  class EmberDataOrderedSet extends EmberOrderedSet {\n    static create() {\n      return new this();\n    }\n\n    addWithIndex(obj, idx) {\n      var guid = Ember.guidFor(obj);\n      var presenceSet = this.presenceSet;\n      var list = this.list;\n\n      if (presenceSet[guid] === true) {\n        return;\n      }\n\n      presenceSet[guid] = true;\n\n      if (idx === undefined || idx === null) {\n        list.push(obj);\n      } else {\n        list.splice(idx, 0, obj);\n      }\n\n      this.size += 1;\n      return this;\n    }\n\n  }\n\n  /*\n    This method normalizes a link to an \"links object\". If the passed link is\n    already an object it's returned without any modifications.\n\n    See http://jsonapi.org/format/#document-links for more information.\n\n    @method _normalizeLink\n    @internal\n    @param {String} link\n    @return {Object|null}\n  */\n  function _normalizeLink(link) {\n    switch (typeof link) {\n      case 'object':\n        return link;\n\n      case 'string':\n        return {\n          href: link\n        };\n    }\n\n    return null;\n  }\n\n  class Relationship {\n    constructor(store, inverseKey, relationshipMeta, recordData, inverseIsAsync) {\n      this.inverseIsAsync = void 0;\n      this.kind = void 0;\n      this.recordData = void 0;\n      this.members = void 0;\n      this.canonicalMembers = void 0;\n      this.store = void 0;\n      this.key = void 0;\n      this.inverseKey = void 0;\n      this.isAsync = void 0;\n      this.isPolymorphic = void 0;\n      this.relationshipMeta = void 0;\n      this.inverseKeyForImplicit = void 0;\n      this.meta = void 0;\n      this.__inverseMeta = void 0;\n      this._tempModelName = void 0;\n      this.shouldForceReload = false;\n      this.relationshipIsStale = void 0;\n      this.hasDematerializedInverse = void 0;\n      this.hasAnyRelationshipData = void 0;\n      this.relationshipIsEmpty = void 0;\n      this.hasFailedLoadAttempt = false;\n      this.links = void 0;\n      this.willSync = void 0;\n      this.inverseIsAsync = inverseIsAsync;\n      this.kind = relationshipMeta.kind;\n      var async = relationshipMeta.options.async;\n      var polymorphic = relationshipMeta.options.polymorphic;\n      this.recordData = recordData;\n      this.members = new EmberDataOrderedSet();\n      this.canonicalMembers = new EmberDataOrderedSet();\n      this.store = store;\n      this.key = relationshipMeta.key || null;\n      this.inverseKey = inverseKey;\n      this.isAsync = typeof async === 'undefined' ? true : async;\n      this.isPolymorphic = typeof polymorphic === 'undefined' ? false : polymorphic;\n      this.relationshipMeta = relationshipMeta; //This probably breaks for polymorphic relationship in complex scenarios, due to\n      //multiple possible modelNames\n\n      this.inverseKeyForImplicit = this._tempModelName + this.key;\n      this.meta = null;\n      this.__inverseMeta = undefined;\n      /*\n       This flag forces fetch. `true` for a single request once `reload()`\n         has been called `false` at all other times.\n      */\n      // this.shouldForceReload = false;\n\n      /*\n         This flag indicates whether we should\n          re-fetch the relationship the next time\n          it is accessed.\n           The difference between this flag and `shouldForceReload`\n          is in how we treat the presence of partially missing data:\n            - for a forced reload, we will reload the link or EVERY record\n            - for a stale reload, we will reload the link (if present) else only MISSING records\n           Ideally these flags could be merged, but because we don't give the\n          request layer the option of deciding how to resolve the data being queried\n          we are forced to differentiate for now.\n           It is also possible for a relationship to remain stale after a forced reload; however,\n          in this case `hasFailedLoadAttempt` ought to be `true`.\n         false when\n          => recordData.isNew() on initial setup\n          => a previously triggered request has resolved\n          => we get relationship data via push\n         true when\n          => !recordData.isNew() on initial setup\n          => an inverse has been unloaded\n          => we get a new link for the relationship\n         TODO @runspired unskip the acceptance tests and fix these flags\n       */\n\n      this.relationshipIsStale = false;\n      /*\n       This flag indicates whether we should\n        **partially** re-fetch the relationship the\n        next time it is accessed.\n       false when\n        => initial setup\n        => a previously triggered request has resolved\n       true when\n        => an inverse has been unloaded\n      */\n\n      this.hasDematerializedInverse = false;\n      /*\n        This flag indicates whether we should consider the content\n         of this relationship \"known\".\n         If we have no relationship knowledge, and the relationship\n         is `async`, we will attempt to fetch the relationship on\n         access if it is also stale.\n        Snapshot uses this to tell the difference between unknown\n        (`undefined`) or empty (`null`). The reason for this is that\n        we wouldn't want to serialize  unknown relationships as `null`\n        as that might overwrite remote state.\n         All relationships for a newly created (`store.createRecord()`) are\n         considered known (`hasAnyRelationshipData === true`).\n         true when\n          => we receive a push with either new data or explicit empty (`[]` or `null`)\n          => the relationship is a belongsTo and we have received data from\n               the other side.\n         false when\n          => we have received no signal about what data belongs in this relationship\n          => the relationship is a hasMany and we have only received data from\n              the other side.\n       */\n\n      this.hasAnyRelationshipData = false;\n      /*\n        Flag that indicates whether an empty relationship is explicitly empty\n          (signaled by push giving us an empty array or null relationship)\n          e.g. an API response has told us that this relationship is empty.\n         Thus far, it does not appear that we actually need this flag; however,\n          @runspired has found it invaluable when debugging relationship tests\n          to determine whether (and why if so) we are in an incorrect state.\n         true when\n          => we receive a push with explicit empty (`[]` or `null`)\n          => we have received no signal about what data belongs in this relationship\n          => on initial create (as no signal is known yet)\n         false at all other times\n       */\n\n      this.relationshipIsEmpty = true;\n      /*\n        Flag def here for reference, defined as getter in has-many.js / belongs-to.js\n         true when\n          => hasAnyRelationshipData is true\n          AND\n          => members (NOT canonicalMembers) @each !isEmpty\n         TODO, consider changing the conditional here from !isEmpty to !hiddenFromRecordArrays\n      */\n      // TODO do we want this anymore? Seems somewhat useful\n      //   especially if we rename to `hasUpdatedLink`\n      //   which would tell us slightly more about why the\n      //   relationship is stale\n      // this.updatedLink = false;\n    }\n\n    get isNew() {\n      return this.recordData.isNew();\n    }\n\n    _inverseIsAsync() {\n      return !!this.inverseIsAsync;\n    }\n\n    _inverseIsSync() {\n      return !!(this.inverseKey && !this.inverseIsAsync);\n    }\n\n    _hasSupportForImplicitRelationships(recordData) {\n      return recordData._implicitRelationships !== undefined && recordData._implicitRelationships !== null;\n    }\n\n    _hasSupportForRelationships(recordData) {\n      return recordData._relationships !== undefined && recordData._relationships !== null;\n    }\n\n    get _inverseMeta() {\n      if (this.__inverseMeta === undefined) {\n        var inverseMeta = null;\n\n        if (this.inverseKey) {\n          // We know we have a full inverse relationship\n          var type = this.relationshipMeta.type;\n          var inverseModelClass = this.store.modelFor(type);\n          var inverseRelationships = Ember.get(inverseModelClass, 'relationshipsByName');\n          inverseMeta = inverseRelationships.get(this.inverseKey);\n        }\n\n        this.__inverseMeta = inverseMeta;\n      }\n\n      return this.__inverseMeta;\n    }\n\n    recordDataDidDematerialize() {\n      var inverseKey = this.inverseKey;\n\n      if (!inverseKey) {\n        return;\n      } // we actually want a union of members and canonicalMembers\n      // they should be disjoint but currently are not due to a bug\n\n\n      this.forAllMembers(inverseRecordData => {\n        if (!this._hasSupportForRelationships(inverseRecordData)) {\n          return;\n        }\n\n        var relationship = relationshipStateFor(inverseRecordData, inverseKey);\n\n        var belongsToRelationship = inverseRecordData.getBelongsTo(inverseKey)._relationship; // For canonical members, it is possible that inverseRecordData has already been associated to\n        // to another record. For such cases, do not dematerialize the inverseRecordData\n\n\n        if (!belongsToRelationship || !belongsToRelationship.inverseRecordData || this.recordData === belongsToRelationship.inverseRecordData) {\n          relationship.inverseDidDematerialize(this.recordData);\n        }\n      });\n    }\n\n    forAllMembers(callback) {\n      var seen = Object.create(null);\n\n      for (var i = 0; i < this.members.list.length; i++) {\n        var inverseInternalModel = this.members.list[i];\n        var id = Ember.guidFor(inverseInternalModel);\n\n        if (!seen[id]) {\n          seen[id] = true;\n          callback(inverseInternalModel);\n        }\n      }\n\n      for (var _i = 0; _i < this.canonicalMembers.list.length; _i++) {\n        var _inverseInternalModel = this.canonicalMembers.list[_i];\n\n        var _id = Ember.guidFor(_inverseInternalModel);\n\n        if (!seen[_id]) {\n          seen[_id] = true;\n          callback(_inverseInternalModel);\n        }\n      }\n    }\n\n    inverseDidDematerialize(inverseRecordData) {\n      if (!this.isAsync || inverseRecordData && inverseRecordData.isNew()) {\n        // unloading inverse of a sync relationship is treated as a client-side\n        // delete, so actually remove the models don't merely invalidate the cp\n        // cache.\n        // if the record being unloaded only exists on the client, we similarly\n        // treat it as a client side delete\n        this.removeRecordDataFromOwn(inverseRecordData);\n        this.removeCanonicalRecordDataFromOwn(inverseRecordData);\n        this.setRelationshipIsEmpty(true);\n      } else {\n        this.setHasDematerializedInverse(true);\n      }\n    }\n\n    updateMeta(meta) {\n      this.meta = meta;\n    }\n\n    clear() {\n      var members = this.members.list;\n\n      while (members.length > 0) {\n        var member = members[0];\n        this.removeRecordData(member);\n      }\n\n      var canonicalMembers = this.canonicalMembers.list;\n\n      while (canonicalMembers.length > 0) {\n        var _member = canonicalMembers[0];\n        this.removeCanonicalRecordData(_member);\n      }\n    }\n\n    removeAllRecordDatasFromOwn() {\n      this.setRelationshipIsStale(true);\n      this.members.clear();\n    }\n\n    removeAllCanonicalRecordDatasFromOwn() {\n      this.canonicalMembers.clear();\n      this.flushCanonicalLater();\n    }\n\n    removeRecordDatas(recordDatas) {\n      recordDatas.forEach(recordData => this.removeRecordData(recordData));\n    }\n\n    addRecordDatas(recordDatas, idx) {\n      recordDatas.forEach(recordData => {\n        this.addRecordData(recordData, idx);\n\n        if (idx !== undefined) {\n          idx++;\n        }\n      });\n    }\n\n    addCanonicalRecordDatas(recordDatas, idx) {\n      for (var i = 0; i < recordDatas.length; i++) {\n        if (idx !== undefined) {\n          this.addCanonicalRecordData(recordDatas[i], i + idx);\n        } else {\n          this.addCanonicalRecordData(recordDatas[i]);\n        }\n      }\n    }\n\n    addCanonicalRecordData(recordData, idx) {\n      if (!this.canonicalMembers.has(recordData)) {\n        this.canonicalMembers.add(recordData);\n        this.setupInverseRelationship(recordData);\n      }\n\n      this.flushCanonicalLater();\n      this.setHasAnyRelationshipData(true);\n    }\n\n    setupInverseRelationship(recordData) {\n      if (this.inverseKey) {\n        if (!this._hasSupportForRelationships(recordData)) {\n          return;\n        }\n\n        var relationship = relationshipStateFor(recordData, this.inverseKey); // if we have only just initialized the inverse relationship, then it\n        // already has this.recordData in its canonicalMembers, so skip the\n        // unnecessary work.  The exception to this is polymorphic\n        // relationships whose members are determined by their inverse, as those\n        // relationships cannot efficiently find their inverse payloads.\n\n        relationship.addCanonicalRecordData(this.recordData);\n      } else {\n        if (!this._hasSupportForImplicitRelationships(recordData)) {\n          return;\n        }\n\n        var relationships = recordData._implicitRelationships;\n        var _relationship = relationships[this.inverseKeyForImplicit];\n\n        if (!_relationship) {\n          _relationship = relationships[this.inverseKeyForImplicit] = new Relationship(this.store, this.key, {\n            options: {\n              async: this.isAsync\n            }\n          }, recordData);\n        }\n\n        _relationship.addCanonicalRecordData(this.recordData);\n      }\n    }\n\n    removeCanonicalRecordDatas(recordDatas, idx) {\n      for (var i = 0; i < recordDatas.length; i++) {\n        if (idx !== undefined) {\n          this.removeCanonicalRecordData(recordDatas[i], i + idx);\n        } else {\n          this.removeCanonicalRecordData(recordDatas[i]);\n        }\n      }\n    }\n\n    removeCanonicalRecordData(recordData, idx) {\n      if (this.canonicalMembers.has(recordData)) {\n        this.removeCanonicalRecordDataFromOwn(recordData);\n\n        if (this.inverseKey) {\n          this.removeCanonicalRecordDataFromInverse(recordData);\n        } else {\n          if (this._hasSupportForImplicitRelationships(recordData) && recordData._implicitRelationships[this.inverseKeyForImplicit]) {\n            recordData._implicitRelationships[this.inverseKeyForImplicit].removeCanonicalRecordData(this.recordData);\n          }\n        }\n      }\n\n      this.flushCanonicalLater();\n    }\n\n    addRecordData(recordData, idx) {\n      if (!this.members.has(recordData)) {\n        this.members.addWithIndex(recordData, idx);\n        this.notifyRecordRelationshipAdded(recordData, idx);\n\n        if (this._hasSupportForRelationships(recordData) && this.inverseKey) {\n          relationshipStateFor(recordData, this.inverseKey).addRecordData(this.recordData);\n        } else {\n          if (this._hasSupportForImplicitRelationships(recordData)) {\n            if (!recordData._implicitRelationships[this.inverseKeyForImplicit]) {\n              recordData._implicitRelationships[this.inverseKeyForImplicit] = new Relationship(this.store, this.key, {\n                options: {\n                  async: this.isAsync\n                }\n              }, recordData, this.isAsync);\n            }\n\n            recordData._implicitRelationships[this.inverseKeyForImplicit].addRecordData(this.recordData);\n          }\n        }\n      }\n\n      this.setHasAnyRelationshipData(true);\n    }\n\n    removeRecordData(recordData) {\n      if (this.members.has(recordData)) {\n        this.removeRecordDataFromOwn(recordData);\n\n        if (this.inverseKey) {\n          this.removeRecordDataFromInverse(recordData);\n        } else {\n          if (this._hasSupportForImplicitRelationships(recordData) && recordData._implicitRelationships[this.inverseKeyForImplicit]) {\n            recordData._implicitRelationships[this.inverseKeyForImplicit].removeRecordData(this.recordData);\n          }\n        }\n      }\n    }\n\n    removeRecordDataFromInverse(recordData) {\n      if (!this._hasSupportForRelationships(recordData)) {\n        return;\n      }\n\n      if (this.inverseKey) {\n        var inverseRelationship = relationshipStateFor(recordData, this.inverseKey); //Need to check for existence, as the record might unloading at the moment\n\n        if (inverseRelationship) {\n          inverseRelationship.removeRecordDataFromOwn(this.recordData);\n        }\n      }\n    }\n\n    removeRecordDataFromOwn(recordData, idx) {\n      this.members.delete(recordData);\n    }\n\n    removeCanonicalRecordDataFromInverse(recordData) {\n      if (!this._hasSupportForRelationships(recordData)) {\n        return;\n      }\n\n      if (this.inverseKey) {\n        var inverseRelationship = relationshipStateFor(recordData, this.inverseKey); //Need to check for existence, as the record might unloading at the moment\n\n        if (inverseRelationship) {\n          inverseRelationship.removeCanonicalRecordDataFromOwn(this.recordData);\n        }\n      }\n    }\n\n    removeCanonicalRecordDataFromOwn(recordData, idx) {\n      this.canonicalMembers.delete(recordData);\n      this.flushCanonicalLater();\n    }\n    /*\n      Call this method once a record deletion has been persisted\n      to purge it from BOTH current and canonical state of all\n      relationships.\n       @method removeCompletelyFromInverse\n      @private\n     */\n\n\n    removeCompletelyFromInverse() {\n      if (!this.inverseKey && !this.inverseKeyForImplicit) {\n        return;\n      } // we actually want a union of members and canonicalMembers\n      // they should be disjoint but currently are not due to a bug\n\n\n      var seen = Object.create(null);\n      var recordData = this.recordData;\n      var unload;\n\n      if (this.inverseKey) {\n        unload = inverseRecordData => {\n          var id = Ember.guidFor(inverseRecordData);\n\n          if (this._hasSupportForRelationships(inverseRecordData) && seen[id] === undefined) {\n            if (this.inverseKey) {\n              var relationship = relationshipStateFor(inverseRecordData, this.inverseKey);\n              relationship.removeCompletelyFromOwn(recordData);\n            }\n\n            seen[id] = true;\n          }\n        };\n      } else {\n        unload = inverseRecordData => {\n          var id = Ember.guidFor(inverseRecordData);\n\n          if (this._hasSupportForImplicitRelationships(inverseRecordData) && seen[id] === undefined) {\n            var relationship = implicitRelationshipStateFor(inverseRecordData, this.inverseKeyForImplicit);\n            relationship.removeCompletelyFromOwn(recordData);\n            seen[id] = true;\n          }\n        };\n      }\n\n      this.members.forEach(unload);\n      this.canonicalMembers.forEach(unload);\n\n      if (!this.isAsync) {\n        this.clear();\n      }\n    }\n    /*\n      Removes the given RecordData from BOTH canonical AND current state.\n       This method is useful when either a deletion or a rollback on a new record\n      needs to entirely purge itself from an inverse relationship.\n     */\n\n\n    removeCompletelyFromOwn(recordData) {\n      this.canonicalMembers.delete(recordData);\n      this.members.delete(recordData);\n    }\n\n    flushCanonical() {\n      var list = this.members.list;\n      this.willSync = false; //a hack for not removing new RecordDatas\n      //TODO remove once we have proper diffing\n\n      var newRecordDatas = [];\n\n      for (var i = 0; i < list.length; i++) {\n        // TODO Igor deal with this\n        if (list[i].isNew()) {\n          newRecordDatas.push(list[i]);\n        }\n      } //TODO(Igor) make this less abysmally slow\n\n\n      this.members = this.canonicalMembers.copy();\n\n      for (var _i2 = 0; _i2 < newRecordDatas.length; _i2++) {\n        this.members.add(newRecordDatas[_i2]);\n      }\n    }\n\n    flushCanonicalLater() {\n      if (this.willSync) {\n        return;\n      }\n\n      this.willSync = true; // Reaching back into the store to use ED's runloop\n\n      this.store._updateRelationshipState(this);\n    }\n\n    updateLinks(links) {\n      this.links = links;\n    }\n\n    updateRecordDatasFromAdapter(recordDatas) {\n      this.setHasAnyRelationshipData(true); //TODO(Igor) move this to a proper place\n      //TODO Once we have adapter support, we need to handle updated and canonical changes\n\n      this.computeChanges(recordDatas);\n    }\n\n    computeChanges(recordDatas) {}\n\n    notifyRecordRelationshipAdded(recordData, idxs) {}\n\n    setHasAnyRelationshipData(value) {\n      this.hasAnyRelationshipData = value;\n    }\n\n    setHasDematerializedInverse(value) {\n      this.hasDematerializedInverse = value;\n    }\n\n    setRelationshipIsStale(value) {\n      this.relationshipIsStale = value;\n    }\n\n    setRelationshipIsEmpty(value) {\n      this.relationshipIsEmpty = value;\n    }\n\n    setShouldForceReload(value) {\n      this.shouldForceReload = value;\n    }\n\n    setHasFailedLoadAttempt(value) {\n      this.hasFailedLoadAttempt = value;\n    }\n    /*\n     `push` for a relationship allows the store to push a JSON API Relationship\n     Object onto the relationship. The relationship will then extract and set the\n     meta, data and links of that relationship.\n      `push` use `updateMeta`, `updateData` and `updateLink` to update the state\n     of the relationship.\n     */\n\n\n    push(payload, initial) {\n      var hasRelationshipDataProperty = false;\n      var hasLink = false;\n\n      if (payload.meta) {\n        this.updateMeta(payload.meta);\n      }\n\n      if (payload.data !== undefined) {\n        hasRelationshipDataProperty = true;\n        this.updateData(payload.data, initial);\n      } else if (this.isAsync === false && !this.hasAnyRelationshipData) {\n        hasRelationshipDataProperty = true;\n        var data = this.kind === 'hasMany' ? [] : null;\n        this.updateData(data, initial);\n      }\n\n      if (payload.links) {\n        var originalLinks = this.links;\n        this.updateLinks(payload.links);\n\n        if (payload.links.related) {\n          var relatedLink = _normalizeLink(payload.links.related);\n\n          var currentLink = originalLinks && originalLinks.related ? _normalizeLink(originalLinks.related) : null;\n          var currentLinkHref = currentLink ? currentLink.href : null;\n\n          if (relatedLink && relatedLink.href && relatedLink.href !== currentLinkHref) {\n            ( Ember.warn(`You pushed a record of type '${this.recordData.modelName}' with a relationship '${this.key}' configured as 'async: false'. You've included a link but no primary data, this may be an error in your payload. EmberData will treat this relationship as known-to-be-empty.`, this.isAsync || this.hasAnyRelationshipData, {\n              id: 'ds.store.push-link-for-sync-relationship'\n            }));\n            ( !(typeof relatedLink.href === 'string' || relatedLink.href === null) && Ember.assert(`You have pushed a record of type '${this.recordData.modelName}' with '${this.key}' as a link, but the value of that link is not a string.`, typeof relatedLink.href === 'string' || relatedLink.href === null));\n            hasLink = true;\n          }\n        }\n      }\n      /*\n       Data being pushed into the relationship might contain only data or links,\n       or a combination of both.\n        IF contains only data\n       IF contains both links and data\n        relationshipIsEmpty -> true if is empty array (has-many) or is null (belongs-to)\n        hasAnyRelationshipData -> true\n        hasDematerializedInverse -> false\n        relationshipIsStale -> false\n        allInverseRecordsAreLoaded -> run-check-to-determine\n        IF contains only links\n        relationshipIsStale -> true\n       */\n\n\n      this.setHasFailedLoadAttempt(false);\n\n      if (hasRelationshipDataProperty) {\n        var relationshipIsEmpty = payload.data === null || Array.isArray(payload.data) && payload.data.length === 0;\n        this.setHasAnyRelationshipData(true);\n        this.setRelationshipIsStale(false);\n        this.setHasDematerializedInverse(false);\n        this.setRelationshipIsEmpty(relationshipIsEmpty);\n      } else if (hasLink) {\n        this.setRelationshipIsStale(true);\n\n        if (!initial) {\n          var recordData = this.recordData;\n          var storeWrapper = this.recordData.storeWrapper;\n\n          {\n            storeWrapper.notifyPropertyChange(recordData.modelName, recordData.id, recordData.clientId, // We know we are not an implicit relationship here\n            this.key);\n          }\n        }\n      }\n    }\n\n    localStateIsEmpty() {}\n\n    updateData(payload, initial) {}\n\n    destroy() {}\n\n  }\n\n  /**\n    @module @ember-data/store\n  */\n  class ManyRelationship extends Relationship {\n    constructor(store, inverseKey, relationshipMeta, recordData, inverseIsAsync) {\n      super(store, inverseKey, relationshipMeta, recordData, inverseIsAsync);\n      this.canonicalState = void 0;\n      this.currentState = void 0;\n      this._willUpdateManyArray = void 0;\n      this._pendingManyArrayUpdates = void 0;\n      this.key = void 0;\n      this.canonicalState = [];\n      this.currentState = [];\n      this._willUpdateManyArray = false;\n      this._pendingManyArrayUpdates = null;\n      this.key = relationshipMeta.key;\n    }\n\n    addCanonicalRecordData(recordData, idx) {\n      if (this.canonicalMembers.has(recordData)) {\n        return;\n      }\n\n      if (idx !== undefined) {\n        this.canonicalState.splice(idx, 0, recordData);\n      } else {\n        this.canonicalState.push(recordData);\n      }\n\n      super.addCanonicalRecordData(recordData, idx);\n    }\n\n    inverseDidDematerialize(inverseRecordData) {\n      super.inverseDidDematerialize(inverseRecordData);\n\n      if (this.isAsync) {\n        this.notifyManyArrayIsStale();\n      }\n    }\n\n    addRecordData(recordData, idx) {\n      if (this.members.has(recordData)) {\n        return;\n      } // TODO Type this\n\n\n      Debug.assertPolymorphicType(this.recordData, this.relationshipMeta, recordData, this.store);\n      super.addRecordData(recordData, idx); // make lazy later\n\n      if (idx === undefined) {\n        idx = this.currentState.length;\n      }\n\n      this.currentState.splice(idx, 0, recordData); // TODO Igor consider making direct to remove the indirection\n      // We are not lazily accessing the manyArray here because the change is coming from app side\n      // this.manyArray.flushCanonical(this.currentState);\n\n      this.notifyHasManyChange();\n    }\n\n    removeCanonicalRecordDataFromOwn(recordData, idx) {\n      var i = idx;\n\n      if (!this.canonicalMembers.has(recordData)) {\n        return;\n      }\n\n      if (i === undefined) {\n        i = this.canonicalState.indexOf(recordData);\n      }\n\n      if (i > -1) {\n        this.canonicalState.splice(i, 1);\n      }\n\n      super.removeCanonicalRecordDataFromOwn(recordData, idx); //TODO(Igor) Figure out what to do here\n    }\n\n    removeAllCanonicalRecordDatasFromOwn() {\n      super.removeAllCanonicalRecordDatasFromOwn();\n      this.canonicalMembers.clear();\n      this.canonicalState.splice(0, this.canonicalState.length);\n      super.removeAllCanonicalRecordDatasFromOwn();\n    } //TODO(Igor) DO WE NEED THIS?\n\n\n    removeCompletelyFromOwn(recordData) {\n      super.removeCompletelyFromOwn(recordData); // TODO SkEPTICAL\n\n      var canonicalIndex = this.canonicalState.indexOf(recordData);\n\n      if (canonicalIndex !== -1) {\n        this.canonicalState.splice(canonicalIndex, 1);\n      }\n\n      this.removeRecordDataFromOwn(recordData);\n    }\n\n    flushCanonical() {\n      var toSet = this.canonicalState; //a hack for not removing new records\n      //TODO remove once we have proper diffing\n\n      var newRecordDatas = this.currentState.filter( // only add new internalModels which are not yet in the canonical state of this\n      // relationship (a new internalModel can be in the canonical state if it has\n      // been 'acknowleged' to be in the relationship via a store.push)\n      //TODO Igor deal with this\n      recordData => recordData.isNew() && toSet.indexOf(recordData) === -1);\n      toSet = toSet.concat(newRecordDatas);\n      /*\n      if (this._manyArray) {\n        this._manyArray.flushCanonical(toSet);\n      }\n      */\n\n      this.currentState = toSet;\n      super.flushCanonical(); // Once we clean up all the flushing, we will be left with at least the notifying part\n\n      this.notifyHasManyChange();\n    } //TODO(Igor) idx not used currently, fix\n\n\n    removeRecordDataFromOwn(recordData, idx) {\n      super.removeRecordDataFromOwn(recordData, idx);\n      var index = idx || this.currentState.indexOf(recordData); //TODO IGOR DAVID INVESTIGATE\n\n      if (index === -1) {\n        return;\n      }\n\n      this.currentState.splice(index, 1); // TODO Igor consider making direct to remove the indirection\n      // We are not lazily accessing the manyArray here because the change is coming from app side\n\n      this.notifyHasManyChange(); // this.manyArray.flushCanonical(this.currentState);\n    }\n\n    notifyRecordRelationshipAdded() {\n      this.notifyHasManyChange();\n    }\n\n    computeChanges(recordDatas = []) {\n      var members = this.canonicalMembers;\n      var recordDatasToRemove = [];\n      var recordDatasSet = setForArray(recordDatas);\n      members.forEach(member => {\n        if (recordDatasSet.has(member)) {\n          return;\n        }\n\n        recordDatasToRemove.push(member);\n      });\n      this.removeCanonicalRecordDatas(recordDatasToRemove);\n\n      for (var i = 0, l = recordDatas.length; i < l; i++) {\n        var recordData = recordDatas[i];\n        this.removeCanonicalRecordData(recordData);\n        this.addCanonicalRecordData(recordData, i);\n      }\n    }\n\n    setInitialRecordDatas(recordDatas) {\n      if (Array.isArray(recordDatas) === false || !recordDatas || recordDatas.length === 0) {\n        return;\n      }\n\n      for (var i = 0; i < recordDatas.length; i++) {\n        var recordData = recordDatas[i];\n\n        if (this.canonicalMembers.has(recordData)) {\n          continue;\n        }\n\n        this.canonicalMembers.add(recordData);\n        this.members.add(recordData);\n        this.setupInverseRelationship(recordData);\n      }\n\n      this.canonicalState = this.canonicalMembers.toArray();\n    }\n    /*\n      This is essentially a \"sync\" version of\n        notifyHasManyChange. We should work to unify\n        these worlds\n         - @runspired\n    */\n\n\n    notifyManyArrayIsStale() {\n      var recordData = this.recordData;\n      var storeWrapper = recordData.storeWrapper;\n\n      {\n        storeWrapper.notifyPropertyChange(recordData.modelName, recordData.id, recordData.clientId, this.key);\n      }\n    }\n\n    notifyHasManyChange() {\n      var recordData = this.recordData;\n      var storeWrapper = recordData.storeWrapper;\n      storeWrapper.notifyHasManyChange(recordData.modelName, recordData.id, recordData.clientId, this.key);\n    }\n\n    getData() {\n      var payload = {};\n\n      if (this.hasAnyRelationshipData) {\n        payload.data = this.currentState.map(recordData => recordData.getResourceIdentifier());\n      }\n\n      if (this.links) {\n        payload.links = this.links;\n      }\n\n      if (this.meta) {\n        payload.meta = this.meta;\n      } // TODO @runspired: the @igor refactor is too limiting for relationship state\n      //   we should reconsider where we fetch from.\n\n\n      payload._relationship = this;\n      return payload;\n    }\n\n    updateData(data, initial) {\n      var recordDatas;\n\n      if (Ember.isNone(data)) {\n        recordDatas = undefined;\n      } else {\n        recordDatas = new Array(data.length);\n\n        for (var i = 0; i < data.length; i++) {\n          recordDatas[i] = this.recordData.storeWrapper.recordDataFor(data[i].type, data[i].id);\n        }\n      }\n\n      if (initial) {\n        this.setInitialRecordDatas(recordDatas);\n      } else {\n        this.updateRecordDatasFromAdapter(recordDatas);\n      }\n    }\n    /**\n     * Flag indicating whether all inverse records are available\n     *\n     * true if inverse records exist and are all loaded (all not empty)\n     * true if there are no inverse records\n     * false if the inverse records exist and any are not loaded (any empty)\n     *\n     * @return {boolean}\n     */\n\n\n    get allInverseRecordsAreLoaded() {\n      // check currentState for unloaded records\n      var hasEmptyRecords = this.currentState.reduce((hasEmptyModel, i) => {\n        return hasEmptyModel || i.isEmpty();\n      }, false); // check un-synced state for unloaded records\n\n      if (!hasEmptyRecords && this.willSync) {\n        hasEmptyRecords = this.canonicalState.reduce((hasEmptyModel, i) => {\n          return hasEmptyModel || !i.isEmpty();\n        }, false);\n      }\n\n      return !hasEmptyRecords;\n    }\n\n  }\n\n  function setForArray(array) {\n    var set = new EmberDataOrderedSet();\n\n    if (array) {\n      for (var i = 0, l = array.length; i < l; i++) {\n        set.add(array[i]);\n      }\n    }\n\n    return set;\n  }\n\n  class BelongsToRelationship extends Relationship {\n    constructor(store, inverseKey, relationshipMeta, recordData, inverseIsAsync) {\n      super(store, inverseKey, relationshipMeta, recordData, inverseIsAsync);\n      this.inverseRecordData = void 0;\n      this.canonicalState = void 0;\n      this.key = void 0;\n      this.key = relationshipMeta.key;\n      this.inverseRecordData = null;\n      this.canonicalState = null;\n      this.key = relationshipMeta.key;\n    }\n\n    setRecordData(recordData) {\n      if (recordData) {\n        this.addRecordData(recordData);\n      } else if (this.inverseRecordData) {\n        this.removeRecordData(this.inverseRecordData);\n      }\n\n      this.setHasAnyRelationshipData(true);\n      this.setRelationshipIsStale(false);\n      this.setRelationshipIsEmpty(false);\n    }\n\n    setCanonicalRecordData(recordData) {\n      if (recordData) {\n        this.addCanonicalRecordData(recordData);\n      } else if (this.canonicalState) {\n        this.removeCanonicalRecordData(this.canonicalState);\n      }\n\n      this.flushCanonicalLater();\n    }\n\n    setInitialCanonicalRecordData(recordData) {\n      if (!recordData) {\n        return;\n      } // When we initialize a belongsTo relationship, we want to avoid work like\n      // notifying our internalModel that we've \"changed\" and excessive thrash on\n      // setting up inverse relationships\n\n\n      this.canonicalMembers.add(recordData);\n      this.members.add(recordData);\n      this.inverseRecordData = this.canonicalState = recordData;\n      this.setupInverseRelationship(recordData);\n    }\n\n    addCanonicalRecordData(recordData) {\n      if (this.canonicalMembers.has(recordData)) {\n        return;\n      }\n\n      if (this.canonicalState) {\n        this.removeCanonicalRecordData(this.canonicalState);\n      }\n\n      this.canonicalState = recordData;\n      super.addCanonicalRecordData(recordData);\n      this.setHasAnyRelationshipData(true);\n      this.setRelationshipIsEmpty(false);\n    }\n\n    inverseDidDematerialize() {\n      super.inverseDidDematerialize(this.inverseRecordData);\n      this.notifyBelongsToChange();\n    }\n\n    removeCompletelyFromOwn(recordData) {\n      super.removeCompletelyFromOwn(recordData);\n\n      if (this.canonicalState === recordData) {\n        this.canonicalState = null;\n      }\n\n      if (this.inverseRecordData === recordData) {\n        this.inverseRecordData = null;\n        this.notifyBelongsToChange();\n      }\n    }\n\n    removeCompletelyFromInverse() {\n      super.removeCompletelyFromInverse();\n      this.inverseRecordData = null;\n    }\n\n    flushCanonical() {\n      //temporary fix to not remove newly created records if server returned null.\n      //TODO remove once we have proper diffing\n      if (this.inverseRecordData && this.inverseRecordData.isNew() && !this.canonicalState) {\n        this.willSync = false;\n        return;\n      }\n\n      if (this.inverseRecordData !== this.canonicalState) {\n        this.inverseRecordData = this.canonicalState;\n        this.notifyBelongsToChange();\n      }\n\n      super.flushCanonical();\n    }\n\n    addRecordData(recordData) {\n      if (this.members.has(recordData)) {\n        return;\n      } // TODO Igor cleanup\n\n\n      Debug.assertPolymorphicType(this.recordData, this.relationshipMeta, recordData, this.store);\n\n      if (this.inverseRecordData) {\n        this.removeRecordData(this.inverseRecordData);\n      }\n\n      this.inverseRecordData = recordData;\n      super.addRecordData(recordData);\n      this.notifyBelongsToChange();\n    }\n\n    removeRecordDataFromOwn(recordData) {\n      if (!this.members.has(recordData)) {\n        return;\n      }\n\n      this.inverseRecordData = null;\n      super.removeRecordDataFromOwn(recordData);\n      this.notifyBelongsToChange();\n    }\n\n    removeAllRecordDatasFromOwn() {\n      super.removeAllRecordDatasFromOwn();\n      this.inverseRecordData = null;\n      this.notifyBelongsToChange();\n    }\n\n    notifyBelongsToChange() {\n      var recordData = this.recordData;\n      var storeWrapper = this.recordData.storeWrapper;\n      storeWrapper.notifyBelongsToChange(recordData.modelName, recordData.id, recordData.clientId, this.key);\n    }\n\n    removeCanonicalRecordDataFromOwn(recordData) {\n      if (!this.canonicalMembers.has(recordData)) {\n        return;\n      }\n\n      this.canonicalState = null;\n      this.setHasAnyRelationshipData(true);\n      this.setRelationshipIsEmpty(true);\n      super.removeCanonicalRecordDataFromOwn(recordData);\n    }\n\n    removeAllCanonicalRecordDatasFromOwn() {\n      super.removeAllCanonicalRecordDatasFromOwn();\n      this.canonicalState = null;\n    }\n\n    getData() {\n      var data;\n      var payload = {};\n\n      if (this.inverseRecordData) {\n        data = this.inverseRecordData.getResourceIdentifier();\n      }\n\n      if (this.inverseRecordData === null && this.hasAnyRelationshipData) {\n        data = null;\n      }\n\n      if (this.links) {\n        payload.links = this.links;\n      }\n\n      if (data !== undefined) {\n        payload.data = data;\n      }\n\n      if (this.meta) {\n        payload.meta = this.meta;\n      }\n\n      payload._relationship = this;\n      return payload;\n    }\n    /**\n     * Flag indicating whether all inverse records are available\n     *\n     * true if the inverse exists and is loaded (not empty)\n     * true if there is no inverse\n     * false if the inverse exists and is not loaded (empty)\n     *\n     * @return {boolean}\n     */\n\n\n    get allInverseRecordsAreLoaded() {\n      var recordData = this.inverseRecordData;\n      var isEmpty = recordData !== null && recordData.isEmpty();\n      return !isEmpty;\n    }\n\n    updateData(data, initial) {\n      var recordData;\n\n      if (Ember.isNone(data)) {\n        recordData = null;\n      }\n\n      ( !(data === null || data.id !== undefined && data.type !== undefined) && Ember.assert(`Ember Data expected the data for the ${this.key} relationship on a ${this.recordData.toString()} to be in a JSON API format and include an \\`id\\` and \\`type\\` property but it found ${Ember.inspect(data)}. Please check your serializer and make sure it is serializing the relationship payload into a JSON API format.`, data === null || data.id !== undefined && data.type !== undefined));\n\n      if (recordData !== null) {\n        recordData = this.recordData.storeWrapper.recordDataFor(data.type, data.id);\n      }\n\n      if (initial) {\n        this.setInitialCanonicalRecordData(recordData);\n      } else {\n        this.setCanonicalRecordData(recordData);\n      }\n    }\n\n  }\n\n  function createRelationshipFor(relationshipMeta, store, recordData, key) {\n    var inverseKey = recordData.storeWrapper.inverseForRelationship(recordData.modelName, key);\n    var inverseIsAsync = recordData.storeWrapper.inverseIsAsyncForRelationship(recordData.modelName, key);\n\n    if (relationshipMeta.kind === 'hasMany') {\n      return new ManyRelationship(store, inverseKey, relationshipMeta, recordData, inverseIsAsync);\n    } else {\n      return new BelongsToRelationship(store, inverseKey, relationshipMeta, recordData, inverseIsAsync);\n    }\n  }\n\n  class Relationships {\n    constructor(recordData) {\n      this.recordData = recordData;\n      this._store = void 0;\n      this._storeWrapper = void 0;\n      this.initializedRelationships = void 0;\n      this.initializedRelationships = Object.create(null);\n      this._storeWrapper = Private.upgradeForInternal(recordData.storeWrapper);\n      this._store = this._storeWrapper._store;\n    }\n\n    has(key) {\n      return !!this.initializedRelationships[key];\n    }\n\n    forEach(cb) {\n      var rels = this.initializedRelationships;\n      Object.keys(rels).forEach(name => {\n        cb(name, rels[name]);\n      });\n    }\n\n    get(key) {\n      var relationships = this.initializedRelationships;\n      var relationship = relationships[key];\n\n      if (!relationship) {\n        var _recordData = this.recordData;\n        var rel = this.recordData.storeWrapper.relationshipsDefinitionFor(this.recordData.modelName)[key];\n\n        if (rel) {\n          relationship = relationships[key] = createRelationshipFor(rel, this._store, _recordData, key);\n        }\n      }\n\n      return relationship;\n    }\n\n  }\n\n  // Used by the store to normalize IDs entering the store.  Despite the fact\n  // that developers may provide IDs as numbers (e.g., `store.findRecord('person', 1)`),\n  // it is important that internally we use strings, since IDs may be serialized\n  // and lose type information.  For example, Ember's router may put a record's\n  // ID into the URL, and if we later try to deserialize that URL and find the\n  // corresponding record, we will not know if it is a string or a number.\n  function coerceId(id) {\n    if (id === null || id === undefined || id === '') {\n      return null;\n    }\n\n    if (typeof id === 'string') {\n      return id;\n    }\n\n    if (typeof id === 'symbol') {\n      return id.toString();\n    }\n\n    return '' + id;\n  }\n\n  var nextBfsId = 1;\n  class RecordDataDefault {\n    /**\n     * @deprecated\n     */\n    constructor(arg1, arg2) {\n      this._errors = void 0;\n      this.__relationships = void 0;\n      this.__implicitRelationships = void 0;\n      this.modelName = void 0;\n      this.clientId = void 0;\n      this.id = void 0;\n      this.isDestroyed = void 0;\n      this._isNew = void 0;\n      this._bfsId = void 0;\n      this.__attributes = void 0;\n      this.__inFlightAttributes = void 0;\n      this.__data = void 0;\n      this._scheduledDestroy = void 0;\n      this._isDeleted = void 0;\n      this._isDeletionCommited = void 0;\n      this.identifier = void 0;\n      this.storeWrapper = void 0;\n\n      {\n        var [_identifier, _storeWrapper] = arguments;\n        this.identifier = _identifier;\n        this.modelName = _identifier.type;\n        this.clientId = _identifier.lid;\n        this.id = _identifier.id;\n        this.storeWrapper = _storeWrapper;\n      }\n\n      this.__relationships = null;\n      this.__implicitRelationships = null;\n      this.isDestroyed = false;\n      this._isNew = false;\n      this._isDeleted = false; // Used during the mark phase of unloading to avoid checking the same internal\n      // model twice in the same scan\n\n      this._bfsId = 0;\n      this.reset();\n    } // PUBLIC API\n\n\n    getResourceIdentifier() {\n      return  this.identifier ;\n    }\n\n    pushData(data, calculateChange) {\n      var changedKeys;\n\n      if (this._isNew) {\n        this._isNew = false;\n        this.notifyStateChange();\n      }\n\n      if (calculateChange) {\n        changedKeys = this._changedKeys(data.attributes);\n      }\n\n      Ember.assign(this._data, data.attributes);\n\n      if (this.__attributes) {\n        // only do if we have attribute changes\n        this._updateChangedAttributes();\n      }\n\n      if (data.relationships) {\n        this._setupRelationships(data);\n      }\n\n      if (data.id) {\n        this.id = coerceId(data.id);\n      }\n\n      return changedKeys;\n    }\n\n    willCommit() {\n      this._inFlightAttributes = this._attributes;\n      this._attributes = null;\n    }\n\n    hasChangedAttributes() {\n      return this.__attributes !== null && Object.keys(this.__attributes).length > 0;\n    }\n\n    _clearErrors() {\n    }\n\n    getErrors() {\n      ( Ember.assert('Can not call getErrors unless the RECORD_DATA_ERRORS feature flag is on', !!false));\n\n      {\n        return [];\n      }\n    } // this is a hack bc we don't have access to the state machine\n    //   and relationships need this info and @runspired didn't see\n    //   how to get it just yet from storeWrapper.\n\n\n    isEmpty() {\n      return this.__attributes === null && this.__inFlightAttributes === null && this.__data === null;\n    }\n\n    deleteRecord() {\n      this._isDeleted = true;\n      this.notifyStateChange();\n    }\n\n    isDeleted() {\n      return this._isDeleted;\n    }\n\n    setIsDeleted(isDeleted) {\n      this._isDeleted = isDeleted;\n\n      if (this._isNew) {\n        this._deletionConfirmed();\n      }\n\n      this.notifyStateChange();\n    }\n\n    isDeletionCommitted() {\n      return this._isDeletionCommited;\n    }\n\n    reset() {\n      this.__attributes = null;\n      this.__inFlightAttributes = null;\n      this.__data = null;\n      this._errors = undefined;\n    }\n\n    _setupRelationships(data) {\n      var relationships = this.storeWrapper.relationshipsDefinitionFor(this.modelName);\n      var keys = Object.keys(relationships);\n\n      for (var i = 0; i < keys.length; i++) {\n        var relationshipName = keys[i];\n\n        if (!data.relationships[relationshipName]) {\n          continue;\n        } // in debug, assert payload validity eagerly\n\n\n        var relationshipData = data.relationships[relationshipName];\n\n        {\n          var _storeWrapper3 = this.storeWrapper;\n          var recordData = this;\n          var relationshipMeta = relationships[relationshipName];\n\n          if (!relationshipData || !relationshipMeta) {\n            continue;\n          }\n\n          if (relationshipData.links) {\n            var isAsync = relationshipMeta.options && relationshipMeta.options.async !== false;\n\n            var _relationship = this._relationships.get(relationshipName);\n\n            ( Ember.warn(`You pushed a record of type '${this.modelName}' with a relationship '${relationshipName}' configured as 'async: false'. You've included a link but no primary data, this may be an error in your payload. EmberData will treat this relationship as known-to-be-empty.`, isAsync || relationshipData.data || _relationship.hasAnyRelationshipData, {\n              id: 'ds.store.push-link-for-sync-relationship'\n            }));\n          } else if (relationshipData.data) {\n            if (relationshipMeta.kind === 'belongsTo') {\n              ( !(!Array.isArray(relationshipData.data)) && Ember.assert(`A ${this.modelName} record was pushed into the store with the value of ${relationshipName} being ${Ember.inspect(relationshipData.data)}, but ${relationshipName} is a belongsTo relationship so the value must not be an array. You should probably check your data payload or serializer.`, !Array.isArray(relationshipData.data)));\n              assertRelationshipData(_storeWrapper3, recordData, relationshipData.data, relationshipMeta);\n            } else if (relationshipMeta.kind === 'hasMany') {\n              ( !(Array.isArray(relationshipData.data)) && Ember.assert(`A ${this.modelName} record was pushed into the store with the value of ${relationshipName} being '${Ember.inspect(relationshipData.data)}', but ${relationshipName} is a hasMany relationship so the value must be an array. You should probably check your data payload or serializer.`, Array.isArray(relationshipData.data)));\n\n              if (Array.isArray(relationshipData.data)) {\n                for (var _i = 0; _i < relationshipData.data.length; _i++) {\n                  assertRelationshipData(_storeWrapper3, recordData, relationshipData.data[_i], relationshipMeta);\n                }\n              }\n            }\n          }\n        }\n\n        var relationship = this._relationships.get(relationshipName);\n\n        relationship.push(relationshipData);\n      }\n    }\n    /*\n      Checks if the attributes which are considered as changed are still\n      different to the state which is acknowledged by the server.\n       This method is needed when data for the internal model is pushed and the\n      pushed data might acknowledge dirty attributes as confirmed.\n       @method updateChangedAttributes\n      @private\n     */\n\n\n    _updateChangedAttributes() {\n      var changedAttributes = this.changedAttributes();\n      var changedAttributeNames = Object.keys(changedAttributes);\n      var attrs = this._attributes;\n\n      for (var i = 0, length = changedAttributeNames.length; i < length; i++) {\n        var attribute = changedAttributeNames[i];\n        var data = changedAttributes[attribute];\n        var oldData = data[0];\n        var newData = data[1];\n\n        if (oldData === newData) {\n          delete attrs[attribute];\n        }\n      }\n    }\n    /*\n      Returns an object, whose keys are changed properties, and value is an\n      [oldProp, newProp] array.\n       @method changedAttributes\n      @private\n    */\n\n\n    changedAttributes() {\n      var oldData = this._data;\n      var currentData = this._attributes;\n      var inFlightData = this._inFlightAttributes;\n      var newData = Ember.assign({}, inFlightData, currentData);\n      var diffData = Object.create(null);\n      var newDataKeys = Object.keys(newData);\n\n      for (var i = 0, length = newDataKeys.length; i < length; i++) {\n        var _key = newDataKeys[i];\n        diffData[_key] = [oldData[_key], newData[_key]];\n      }\n\n      return diffData;\n    }\n\n    isNew() {\n      return this._isNew;\n    }\n\n    rollbackAttributes() {\n      var dirtyKeys;\n      this._isDeleted = false;\n\n      if (this.hasChangedAttributes()) {\n        dirtyKeys = Object.keys(this._attributes);\n        this._attributes = null;\n      }\n\n      if (this.isNew()) {\n        this.removeFromInverseRelationships(true);\n        this._isDeleted = true;\n        this._isNew = false;\n      }\n\n      this._inFlightAttributes = null;\n\n      this._clearErrors();\n\n      this.notifyStateChange();\n      return dirtyKeys;\n    }\n\n    _deletionConfirmed() {\n      this.removeFromInverseRelationships();\n    }\n\n    didCommit(data) {\n      if (this._isDeleted) {\n        this._deletionConfirmed();\n\n        this._isDeletionCommited = true;\n      }\n\n      this._isNew = false;\n      var newCanonicalAttributes = null;\n\n      if (data) {\n        // this.store._internalModelDidReceiveRelationshipData(this.modelName, this.id, data.relationships);\n        if (data.relationships) {\n          this._setupRelationships(data);\n        }\n\n        if (data.id) {\n          // didCommit provided an ID, notify the store of it\n          this.storeWrapper.setRecordId(this.modelName, data.id, this.clientId);\n          this.id = coerceId(data.id);\n        }\n\n        newCanonicalAttributes = data.attributes || null;\n      }\n\n      var changedKeys = this._changedKeys(newCanonicalAttributes);\n\n      Ember.assign(this._data, this.__inFlightAttributes, newCanonicalAttributes);\n      this._inFlightAttributes = null;\n\n      this._updateChangedAttributes();\n\n      this._clearErrors();\n\n      this.notifyStateChange();\n      return changedKeys;\n    }\n\n    notifyStateChange() {\n    } // get ResourceIdentifiers for \"current state\"\n\n\n    getHasMany(key) {\n      return this._relationships.get(key).getData();\n    } // set a new \"current state\" via ResourceIdentifiers\n\n\n    setDirtyHasMany(key, recordDatas) {\n      var relationship = this._relationships.get(key);\n\n      relationship.clear();\n      relationship.addRecordDatas(recordDatas);\n    } // append to \"current state\" via RecordDatas\n\n\n    addToHasMany(key, recordDatas, idx) {\n      this._relationships.get(key).addRecordDatas(recordDatas, idx);\n    } // remove from \"current state\" via RecordDatas\n\n\n    removeFromHasMany(key, recordDatas) {\n      this._relationships.get(key).removeRecordDatas(recordDatas);\n    }\n\n    commitWasRejected(identifier, errors) {\n      var keys = Object.keys(this._inFlightAttributes);\n\n      if (keys.length > 0) {\n        var attrs = this._attributes;\n\n        for (var i = 0; i < keys.length; i++) {\n          if (attrs[keys[i]] === undefined) {\n            attrs[keys[i]] = this._inFlightAttributes[keys[i]];\n          }\n        }\n      }\n\n      this._inFlightAttributes = null;\n    }\n\n    getBelongsTo(key) {\n      return this._relationships.get(key).getData();\n    }\n\n    setDirtyBelongsTo(key, recordData) {\n      this._relationships.get(key).setRecordData(recordData);\n    }\n\n    setDirtyAttribute(key, value) {\n      var originalValue; // Add the new value to the changed attributes hash\n\n      this._attributes[key] = value;\n\n      if (key in this._inFlightAttributes) {\n        originalValue = this._inFlightAttributes[key];\n      } else {\n        originalValue = this._data[key];\n      } // If we went back to our original value, we shouldn't keep the attribute around anymore\n\n\n      if (value === originalValue) {\n        delete this._attributes[key];\n      }\n    } // internal set coming from the model\n\n\n    __setId(id) {\n      if (this.id !== id) {\n        this.id = id;\n      }\n    }\n\n    getAttr(key) {\n      if (key in this._attributes) {\n        return this._attributes[key];\n      } else if (key in this._inFlightAttributes) {\n        return this._inFlightAttributes[key];\n      } else {\n        return this._data[key];\n      }\n    }\n\n    hasAttr(key) {\n      return key in this._attributes || key in this._inFlightAttributes || key in this._data;\n    }\n\n    unloadRecord() {\n      if (this.isDestroyed) {\n        return;\n      }\n\n      this._destroyRelationships();\n\n      this.reset();\n\n      if (!this._scheduledDestroy) {\n        this._scheduledDestroy = Ember.run.backburner.schedule('destroy', this, '_cleanupOrphanedRecordDatas');\n      }\n    }\n\n    _cleanupOrphanedRecordDatas() {\n      var relatedRecordDatas = this._allRelatedRecordDatas();\n\n      if (areAllModelsUnloaded(relatedRecordDatas)) {\n        for (var i = 0; i < relatedRecordDatas.length; ++i) {\n          var recordData = relatedRecordDatas[i];\n\n          if (!recordData.isDestroyed) {\n            recordData.destroy();\n          }\n        }\n      }\n\n      this._scheduledDestroy = null;\n    }\n\n    destroy() {\n      this._relationships.forEach((name, rel) => rel.destroy());\n\n      this.isDestroyed = true;\n      this.storeWrapper.disconnectRecord(this.modelName, this.id, this.clientId);\n    }\n\n    isRecordInUse() {\n      return this.storeWrapper.isRecordInUse(this.modelName, this.id, this.clientId);\n    }\n    /**\n      Computes the set of internal models reachable from `this` across exactly one\n      relationship.\n       @return {Array} An array containing the internal models that `this` belongs\n      to or has many.\n     */\n\n\n    _directlyRelatedRecordDatas() {\n      var array = [];\n\n      this._relationships.forEach((name, rel) => {\n        var members = rel.members.list;\n        var canonicalMembers = rel.canonicalMembers.list;\n        array = array.concat(members, canonicalMembers);\n      });\n\n      return array;\n    }\n    /**\n      Computes the set of internal models reachable from this internal model.\n       Reachability is determined over the relationship graph (ie a graph where\n      nodes are internal models and edges are belongs to or has many\n      relationships).\n       @return {Array} An array including `this` and all internal models reachable\n      from `this`.\n    */\n\n\n    _allRelatedRecordDatas() {\n      var array = [];\n      var queue = [];\n      var bfsId = nextBfsId++;\n      queue.push(this);\n      this._bfsId = bfsId;\n\n      while (queue.length > 0) {\n        var node = queue.shift();\n        array.push(node);\n\n        var related = node._directlyRelatedRecordDatas();\n\n        for (var i = 0; i < related.length; ++i) {\n          var recordData = related[i];\n\n          if (recordData instanceof RecordDataDefault) {\n            ( !(recordData._bfsId <= bfsId) && Ember.assert('Internal Error: seen a future bfs iteration', recordData._bfsId <= bfsId));\n\n            if (recordData._bfsId < bfsId) {\n              queue.push(recordData);\n              recordData._bfsId = bfsId;\n            }\n          }\n        }\n      }\n\n      return array;\n    }\n\n    isAttrDirty(key) {\n      if (this._attributes[key] === undefined) {\n        return false;\n      }\n\n      var originalValue;\n\n      if (this._inFlightAttributes[key] !== undefined) {\n        originalValue = this._inFlightAttributes[key];\n      } else {\n        originalValue = this._data[key];\n      }\n\n      return originalValue !== this._attributes[key];\n    }\n\n    get _attributes() {\n      if (this.__attributes === null) {\n        this.__attributes = Object.create(null);\n      }\n\n      return this.__attributes;\n    }\n\n    set _attributes(v) {\n      this.__attributes = v;\n    }\n\n    get _relationships() {\n      if (this.__relationships === null) {\n        this.__relationships = new Relationships(this);\n      }\n\n      return this.__relationships;\n    }\n\n    get _data() {\n      if (this.__data === null) {\n        this.__data = Object.create(null);\n      }\n\n      return this.__data;\n    }\n\n    set _data(v) {\n      this.__data = v;\n    }\n    /*\n     implicit relationships are relationship which have not been declared but the inverse side exists on\n     another record somewhere\n     For example if there was\n      ```app/models/comment.js\n     import Model, { attr } from '@ember-data/model';\n      export default Model.extend({\n       name: attr()\n     });\n     ```\n      but there is also\n      ```app/models/post.js\n     import Model, { attr, hasMany } from '@ember-data/model';\n      export default Model.extend({\n       name: attr(),\n       comments: hasMany('comment')\n     });\n     ```\n      would have a implicit post relationship in order to be do things like remove ourselves from the post\n     when we are deleted\n    */\n\n\n    get _implicitRelationships() {\n      if (this.__implicitRelationships === null) {\n        var relationships = Object.create(null);\n        this.__implicitRelationships = relationships;\n        return relationships;\n      }\n\n      return this.__implicitRelationships;\n    }\n\n    get _inFlightAttributes() {\n      if (this.__inFlightAttributes === null) {\n        this.__inFlightAttributes = Object.create(null);\n      }\n\n      return this.__inFlightAttributes;\n    }\n\n    set _inFlightAttributes(v) {\n      this.__inFlightAttributes = v;\n    }\n    /**\n     * Receives options passed to `store.createRecord` and is given the opportunity\n     * to handle them.\n     *\n     * The return value is an object of options to pass to `Record.create()`\n     *\n     * @param options\n     * @private\n     */\n\n\n    _initRecordCreateOptions(options) {\n      var createOptions = {};\n\n      if (options !== undefined) {\n        var {\n          modelName: _modelName2,\n          storeWrapper: _storeWrapper4\n        } = this;\n\n        var attributeDefs = _storeWrapper4.attributesDefinitionFor(_modelName2);\n\n        var relationshipDefs = _storeWrapper4.relationshipsDefinitionFor(_modelName2);\n\n        var relationships = this._relationships;\n        var propertyNames = Object.keys(options);\n\n        for (var i = 0; i < propertyNames.length; i++) {\n          var name = propertyNames[i];\n          var propertyValue = options[name];\n\n          if (name === 'id') {\n            this.id = propertyValue;\n            continue;\n          }\n\n          var fieldType = relationshipDefs[name] || attributeDefs[name];\n          var kind = fieldType !== undefined ? fieldType.kind : null;\n          var relationship = void 0;\n\n          switch (kind) {\n            case 'attribute':\n              this.setDirtyAttribute(name, propertyValue);\n              break;\n\n            case 'belongsTo':\n              this.setDirtyBelongsTo(name, propertyValue);\n              relationship = relationships.get(name);\n              relationship.setHasAnyRelationshipData(true);\n              relationship.setRelationshipIsEmpty(false);\n              break;\n\n            case 'hasMany':\n              this.setDirtyHasMany(name, propertyValue);\n              relationship = relationships.get(name);\n              relationship.setHasAnyRelationshipData(true);\n              relationship.setRelationshipIsEmpty(false);\n              break;\n\n            default:\n              // reflect back (pass-thru) unknown properties\n              createOptions[name] = propertyValue;\n          }\n        }\n      }\n\n      return createOptions;\n    }\n    /*\n        TODO IGOR AND DAVID this shouldn't be public\n     This method should only be called by records in the `isNew()` state OR once the record\n     has been deleted and that deletion has been persisted.\n      It will remove this record from any associated relationships.\n      If `isNew` is true (default false), it will also completely reset all\n      relationships to an empty state as well.\n       @method removeFromInverseRelationships\n      @param {Boolean} isNew whether to unload from the `isNew` perspective\n      @private\n     */\n\n\n    removeFromInverseRelationships(isNew = false) {\n      this._relationships.forEach((name, rel) => {\n        rel.removeCompletelyFromInverse();\n\n        if (isNew === true) {\n          rel.clear();\n        }\n      });\n\n      var implicitRelationships = this._implicitRelationships;\n      this.__implicitRelationships = null;\n      Object.keys(implicitRelationships).forEach(key => {\n        var rel = implicitRelationships[key];\n        rel.removeCompletelyFromInverse();\n\n        if (isNew === true) {\n          rel.clear();\n        }\n      });\n    }\n\n    _destroyRelationships() {\n      var relationships = this._relationships;\n      relationships.forEach((name, rel) => destroyRelationship(rel));\n      var implicitRelationships = this._implicitRelationships;\n      this.__implicitRelationships = null;\n      Object.keys(implicitRelationships).forEach(key => {\n        var rel = implicitRelationships[key];\n        destroyRelationship(rel);\n      });\n    }\n\n    clientDidCreate() {\n      this._isNew = true;\n    }\n    /*\n      Ember Data has 3 buckets for storing the value of an attribute on an internalModel.\n       `_data` holds all of the attributes that have been acknowledged by\n      a backend via the adapter. When rollbackAttributes is called on a model all\n      attributes will revert to the record's state in `_data`.\n       `_attributes` holds any change the user has made to an attribute\n      that has not been acknowledged by the adapter. Any values in\n      `_attributes` are have priority over values in `_data`.\n       `_inFlightAttributes`. When a record is being synced with the\n      backend the values in `_attributes` are copied to\n      `_inFlightAttributes`. This way if the backend acknowledges the\n      save but does not return the new state Ember Data can copy the\n      values from `_inFlightAttributes` to `_data`. Without having to\n      worry about changes made to `_attributes` while the save was\n      happenign.\n        Changed keys builds a list of all of the values that may have been\n      changed by the backend after a successful save.\n       It does this by iterating over each key, value pair in the payload\n      returned from the server after a save. If the `key` is found in\n      `_attributes` then the user has a local changed to the attribute\n      that has not been synced with the server and the key is not\n      included in the list of changed keys.\n    \n      If the value, for a key differs from the value in what Ember Data\n      believes to be the truth about the backend state (A merger of the\n      `_data` and `_inFlightAttributes` objects where\n      `_inFlightAttributes` has priority) then that means the backend\n      has updated the value and the key is added to the list of changed\n      keys.\n       @method _changedKeys\n      @private\n    */\n\n    /*\n        TODO IGOR DAVID\n        There seems to be a potential bug here, where we will return keys that are not\n        in the schema\n    */\n\n\n    _changedKeys(updates) {\n      var changedKeys = [];\n\n      if (updates) {\n        var original, i, value, _key2;\n\n        var keys = Object.keys(updates);\n        var length = keys.length;\n        var hasAttrs = this.hasChangedAttributes();\n        var attrs;\n\n        if (hasAttrs) {\n          attrs = this._attributes;\n        }\n\n        original = Ember.assign(Object.create(null), this._data, this.__inFlightAttributes);\n\n        for (i = 0; i < length; i++) {\n          _key2 = keys[i];\n          value = updates[_key2]; // A value in _attributes means the user has a local change to\n          // this attributes. We never override this value when merging\n          // updates from the backend so we should not sent a change\n          // notification if the server value differs from the original.\n\n          if (hasAttrs === true && attrs[_key2] !== undefined) {\n            continue;\n          }\n\n          if (!Ember.isEqual(original[_key2], value)) {\n            changedKeys.push(_key2);\n          }\n        }\n      }\n\n      return changedKeys;\n    }\n\n    toString() {\n      return `<${this.modelName}:${this.id}>`;\n    }\n\n  }\n\n  function assertRelationshipData(store, recordData, data, meta) {\n    ( !(!Array.isArray(data)) && Ember.assert(`A ${recordData.modelName} record was pushed into the store with the value of ${meta.key} being '${JSON.stringify(data)}', but ${meta.key} is a belongsTo relationship so the value must not be an array. You should probably check your data payload or serializer.`, !Array.isArray(data)));\n    ( !(data === null || typeof data.type === 'string' && data.type.length) && Ember.assert(`Encountered a relationship identifier without a type for the ${meta.kind} relationship '${meta.key}' on ${recordData}, expected a json-api identifier with type '${meta.type}' but found '${JSON.stringify(data)}'. Please check your serializer and make sure it is serializing the relationship payload into a JSON API format.`, data === null || typeof data.type === 'string' && data.type.length));\n    ( !(data === null || !!coerceId(data.id)) && Ember.assert(`Encountered a relationship identifier without an id for the ${meta.kind} relationship '${meta.key}' on ${recordData}, expected a json-api identifier but found '${JSON.stringify(data)}'. Please check your serializer and make sure it is serializing the relationship payload into a JSON API format.`, data === null || !!coerceId(data.id)));\n    ( !(data === null || !data.type || store._hasModelFor(data.type)) && Ember.assert(`Encountered a relationship identifier with type '${data.type}' for the ${meta.kind} relationship '${meta.key}' on ${recordData}, Expected a json-api identifier with type '${meta.type}'. No model was found for '${data.type}'.`, data === null || !data.type || store._hasModelFor(data.type)));\n  } // Handle dematerialization for relationship `rel`.  In all cases, notify the\n  // relationship of the dematerialization: this is done so the relationship can\n  // notify its inverse which needs to update state\n  //\n  // If the inverse is sync, unloading this record is treated as a client-side\n  // delete, so we remove the inverse records from this relationship to\n  // disconnect the graph.  Because it's not async, we don't need to keep around\n  // the internalModel as an id-wrapper for references and because the graph is\n  // disconnected we can actually destroy the internalModel when checking for\n  // orphaned models.\n\n\n  function destroyRelationship(rel) {\n    rel.recordDataDidDematerialize();\n\n    if (rel._inverseIsSync()) {\n      rel.removeAllRecordDatasFromOwn();\n      rel.removeAllCanonicalRecordDatasFromOwn();\n    }\n  }\n\n  function areAllModelsUnloaded(recordDatas) {\n    for (var i = 0; i < recordDatas.length; ++i) {\n      if (recordDatas[i].isRecordInUse()) {\n        return false;\n      }\n    }\n\n    return true;\n  }\n\n  exports.BelongsToRelationship = BelongsToRelationship;\n  exports.ManyRelationship = ManyRelationship;\n  exports.RecordData = RecordDataDefault;\n  exports.Relationship = Relationship;\n  exports.relationshipStateFor = relationshipStateFor;\n  exports.relationshipsFor = relationshipsFor;\n\n  Object.defineProperty(exports, '__esModule', { value: true });\n\n});\n","define('@ember-data/serializer/-private', ['exports'], function (exports) { 'use strict';\n\n  /**\n    @module @ember-data/serializer\n  */\n\n  /**\n    ## Using Embedded Records\n\n    `EmbeddedRecordsMixin` supports serializing embedded records.\n\n    To set up embedded records, include the mixin when extending a serializer,\n    then define and configure embedded (model) relationships.\n\n    Note that embedded records will serialize with the serializer for their model instead of the serializer in which they are defined.\n\n    Below is an example of a per-type serializer (`post` type).\n\n    ```app/serializers/post.js\n    import RESTSerializer, { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';\n\n    export default RESTSerializer.extend(EmbeddedRecordsMixin, {\n      attrs: {\n        author: { embedded: 'always' },\n        comments: { serialize: 'ids' }\n      }\n    });\n    ```\n    Note that this use of `{ embedded: 'always' }` is unrelated to\n    the `{ embedded: 'always' }` that is defined as an option on `attr` as part of\n    defining a model while working with the `ActiveModelSerializer`.  Nevertheless,\n    using `{ embedded: 'always' }` as an option to `attr` is not a valid way to set up\n    embedded records.\n\n    The `attrs` option for a resource `{ embedded: 'always' }` is shorthand for:\n\n    ```js\n    {\n      serialize: 'records',\n      deserialize: 'records'\n    }\n    ```\n\n    ### Configuring Attrs\n\n    A resource's `attrs` option may be set to use `ids`, `records` or false for the\n    `serialize`  and `deserialize` settings.\n\n    The `attrs` property can be set on the `ApplicationSerializer` or a per-type\n    serializer.\n\n    In the case where embedded JSON is expected while extracting a payload (reading)\n    the setting is `deserialize: 'records'`, there is no need to use `ids` when\n    extracting as that is the default behaviour without this mixin if you are using\n    the vanilla `EmbeddedRecordsMixin`. Likewise, to embed JSON in the payload while\n    serializing `serialize: 'records'` is the setting to use. There is an option of\n    not embedding JSON in the serialized payload by using `serialize: 'ids'`. If you\n    do not want the relationship sent at all, you can use `serialize: false`.\n\n\n    ### EmbeddedRecordsMixin defaults\n    If you do not overwrite `attrs` for a specific relationship, the `EmbeddedRecordsMixin`\n    will behave in the following way:\n\n    BelongsTo: `{ serialize: 'id', deserialize: 'id' }`\n    HasMany:   `{ serialize: false, deserialize: 'ids' }`\n\n    ### Model Relationships\n\n    Embedded records must have a model defined to be extracted and serialized. Note that\n    when defining any relationships on your model such as `belongsTo` and `hasMany`, you\n    should not both specify `async: true` and also indicate through the serializer's\n    `attrs` attribute that the related model should be embedded for deserialization.\n    If a model is declared embedded for deserialization (`embedded: 'always'` or `deserialize: 'records'`),\n    then do not use `async: true`.\n\n    To successfully extract and serialize embedded records the model relationships\n    must be set up correctly. See the\n    [defining relationships](https://guides.emberjs.com/current/models/relationships)\n    section of the **Defining Models** guide page.\n\n    Records without an `id` property are not considered embedded records, model\n    instances must have an `id` property to be used with Ember Data.\n\n    ### Example JSON payloads, Models and Serializers\n\n    **When customizing a serializer it is important to grok what the customizations\n    are. Please read the docs for the methods this mixin provides, in case you need\n    to modify it to fit your specific needs.**\n\n    For example, review the docs for each method of this mixin:\n    * [normalize](/ember-data/release/classes/EmbeddedRecordsMixin/methods/normalize?anchor=normalize)\n    * [serializeBelongsTo](/ember-data/release/classes/EmbeddedRecordsMixin/methods/serializeBelongsTo?anchor=serializeBelongsTo)\n    * [serializeHasMany](/ember-data/release/classes/EmbeddedRecordsMixin/methods/serializeHasMany?anchor=serializeHasMany)\n\n    @class EmbeddedRecordsMixin\n  */\n  var embeddedRecordsMixin = Ember.Mixin.create({\n    /**\n      Normalize the record and recursively normalize/extract all the embedded records\n      while pushing them into the store as they are encountered\n       A payload with an attr configured for embedded records needs to be extracted:\n       ```js\n      {\n        \"post\": {\n          \"id\": \"1\"\n          \"title\": \"Rails is omakase\",\n          \"comments\": [{\n            \"id\": \"1\",\n            \"body\": \"Rails is unagi\"\n          }, {\n            \"id\": \"2\",\n            \"body\": \"Omakase O_o\"\n          }]\n        }\n      }\n      ```\n     @method normalize\n     @param {Model} typeClass\n     @param {Object} hash to be normalized\n     @param {String} prop the hash has been referenced by\n     @return {Object} the normalized hash\n    **/\n    normalize(typeClass, hash, prop) {\n      var normalizedHash = this._super(typeClass, hash, prop);\n\n      return this._extractEmbeddedRecords(this, this.store, typeClass, normalizedHash);\n    },\n\n    keyForRelationship(key, typeClass, method) {\n      if (method === 'serialize' && this.hasSerializeRecordsOption(key) || method === 'deserialize' && this.hasDeserializeRecordsOption(key)) {\n        return this.keyForAttribute(key, method);\n      } else {\n        return this._super(key, typeClass, method) || key;\n      }\n    },\n\n    /**\n      Serialize `belongsTo` relationship when it is configured as an embedded object.\n       This example of an author model belongs to a post model:\n       ```js\n      import Model, { attr, belongsTo } from '@ember-data/model';\n       Post = Model.extend({\n        title:    attr('string'),\n        body:     attr('string'),\n        author:   belongsTo('author')\n      });\n       Author = Model.extend({\n        name:     attr('string'),\n        post:     belongsTo('post')\n      });\n      ```\n       Use a custom (type) serializer for the post model to configure embedded author\n       ```app/serializers/post.js\n      import RESTSerializer, { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';\n       export default RESTSerializer.extend(EmbeddedRecordsMixin, {\n        attrs: {\n          author: { embedded: 'always' }\n        }\n      })\n      ```\n       A payload with an attribute configured for embedded records can serialize\n      the records together under the root attribute's payload:\n       ```js\n      {\n        \"post\": {\n          \"id\": \"1\"\n          \"title\": \"Rails is omakase\",\n          \"author\": {\n            \"id\": \"2\"\n            \"name\": \"dhh\"\n          }\n        }\n      }\n      ```\n       @method serializeBelongsTo\n      @param {Snapshot} snapshot\n      @param {Object} json\n      @param {Object} relationship\n    */\n    serializeBelongsTo(snapshot, json, relationship) {\n      var attr = relationship.key;\n\n      if (this.noSerializeOptionSpecified(attr)) {\n        this._super(snapshot, json, relationship);\n\n        return;\n      }\n\n      var includeIds = this.hasSerializeIdsOption(attr);\n      var includeRecords = this.hasSerializeRecordsOption(attr);\n      var embeddedSnapshot = snapshot.belongsTo(attr);\n\n      if (includeIds) {\n        var serializedKey = this._getMappedKey(relationship.key, snapshot.type);\n\n        if (serializedKey === relationship.key && this.keyForRelationship) {\n          serializedKey = this.keyForRelationship(relationship.key, relationship.kind, 'serialize');\n        }\n\n        if (!embeddedSnapshot) {\n          json[serializedKey] = null;\n        } else {\n          json[serializedKey] = embeddedSnapshot.id;\n\n          if (relationship.options.polymorphic) {\n            this.serializePolymorphicType(snapshot, json, relationship);\n          }\n        }\n      } else if (includeRecords) {\n        this._serializeEmbeddedBelongsTo(snapshot, json, relationship);\n      }\n    },\n\n    _serializeEmbeddedBelongsTo(snapshot, json, relationship) {\n      var embeddedSnapshot = snapshot.belongsTo(relationship.key);\n\n      var serializedKey = this._getMappedKey(relationship.key, snapshot.type);\n\n      if (serializedKey === relationship.key && this.keyForRelationship) {\n        serializedKey = this.keyForRelationship(relationship.key, relationship.kind, 'serialize');\n      }\n\n      if (!embeddedSnapshot) {\n        json[serializedKey] = null;\n      } else {\n        json[serializedKey] = embeddedSnapshot.serialize({\n          includeId: true\n        });\n        this.removeEmbeddedForeignKey(snapshot, embeddedSnapshot, relationship, json[serializedKey]);\n\n        if (relationship.options.polymorphic) {\n          this.serializePolymorphicType(snapshot, json, relationship);\n        }\n      }\n    },\n\n    /**\n      Serializes `hasMany` relationships when it is configured as embedded objects.\n       This example of a post model has many comments:\n       ```js\n      import Model, { attr, belongsTo, hasMany } from '@ember-data/model';\n       Post = Model.extend({\n        title:    attr('string'),\n        body:     attr('string'),\n        comments: hasMany('comment')\n      });\n       Comment = Model.extend({\n        body:     attr('string'),\n        post:     belongsTo('post')\n      });\n      ```\n       Use a custom (type) serializer for the post model to configure embedded comments\n       ```app/serializers/post.js\n      import RESTSerializer, { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';\n       export default RESTSerializer.extend(EmbeddedRecordsMixin, {\n        attrs: {\n          comments: { embedded: 'always' }\n        }\n      })\n      ```\n       A payload with an attribute configured for embedded records can serialize\n      the records together under the root attribute's payload:\n       ```js\n      {\n        \"post\": {\n          \"id\": \"1\"\n          \"title\": \"Rails is omakase\",\n          \"body\": \"I want this for my ORM, I want that for my template language...\"\n          \"comments\": [{\n            \"id\": \"1\",\n            \"body\": \"Rails is unagi\"\n          }, {\n            \"id\": \"2\",\n            \"body\": \"Omakase O_o\"\n          }]\n        }\n      }\n      ```\n       The attrs options object can use more specific instruction for extracting and\n      serializing. When serializing, an option to embed `ids`, `ids-and-types` or `records` can be set.\n      When extracting the only option is `records`.\n       So `{ embedded: 'always' }` is shorthand for:\n      `{ serialize: 'records', deserialize: 'records' }`\n       To embed the `ids` for a related object (using a hasMany relationship):\n       ```app/serializers/post.js\n      import RESTSerializer, { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';\n       export default RESTSerializer.extend(EmbeddedRecordsMixin, {\n        attrs: {\n          comments: { serialize: 'ids', deserialize: 'records' }\n        }\n      })\n      ```\n       ```js\n      {\n        \"post\": {\n          \"id\": \"1\"\n          \"title\": \"Rails is omakase\",\n          \"body\": \"I want this for my ORM, I want that for my template language...\"\n          \"comments\": [\"1\", \"2\"]\n        }\n      }\n      ```\n       To embed the relationship as a collection of objects with `id` and `type` keys, set\n      `ids-and-types` for the related object.\n       This is particularly useful for polymorphic relationships where records don't share\n      the same table and the `id` is not enough information.\n       For example having a user that has many pets:\n       ```js\n      User = Model.extend({\n        name: attr('string'),\n        pets: hasMany('pet', { polymorphic: true })\n      });\n       Pet = Model.extend({\n        name: attr('string'),\n      });\n       Cat = Pet.extend({\n        // ...\n      });\n       Parrot = Pet.extend({\n        // ...\n      });\n      ```\n       ```app/serializers/user.js\n      import RESTSerializer, { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';\n       export default RESTSerializer.extend(EmbeddedRecordsMixin, {\n        attrs: {\n          pets: { serialize: 'ids-and-types', deserialize: 'records' }\n        }\n      });\n      ```\n       ```js\n      {\n        \"user\": {\n          \"id\": \"1\"\n          \"name\": \"Bertin Osborne\",\n          \"pets\": [\n            { \"id\": \"1\", \"type\": \"Cat\" },\n            { \"id\": \"1\", \"type\": \"Parrot\"}\n          ]\n        }\n      }\n      ```\n       @method serializeHasMany\n      @param {Snapshot} snapshot\n      @param {Object} json\n      @param {Object} relationship\n    */\n    serializeHasMany(snapshot, json, relationship) {\n      var attr = relationship.key;\n\n      if (this.noSerializeOptionSpecified(attr)) {\n        this._super(snapshot, json, relationship);\n\n        return;\n      }\n\n      if (this.hasSerializeIdsOption(attr)) {\n        var serializedKey = this._getMappedKey(relationship.key, snapshot.type);\n\n        if (serializedKey === relationship.key && this.keyForRelationship) {\n          serializedKey = this.keyForRelationship(relationship.key, relationship.kind, 'serialize');\n        }\n\n        json[serializedKey] = snapshot.hasMany(attr, {\n          ids: true\n        });\n      } else if (this.hasSerializeRecordsOption(attr)) {\n        this._serializeEmbeddedHasMany(snapshot, json, relationship);\n      } else {\n        if (this.hasSerializeIdsAndTypesOption(attr)) {\n          this._serializeHasManyAsIdsAndTypes(snapshot, json, relationship);\n        }\n      }\n    },\n\n    /*\n      Serializes a hasMany relationship as an array of objects containing only `id` and `type`\n      keys.\n      This has its use case on polymorphic hasMany relationships where the server is not storing\n      all records in the same table using STI, and therefore the `id` is not enough information\n       TODO: Make the default in Ember-data 3.0??\n    */\n    _serializeHasManyAsIdsAndTypes(snapshot, json, relationship) {\n      var serializedKey = this.keyForAttribute(relationship.key, 'serialize');\n      var hasMany = snapshot.hasMany(relationship.key);\n      json[serializedKey] = Ember.A(hasMany).map(function (recordSnapshot) {\n        //\n        // I'm sure I'm being utterly naive here. Propably id is a configurate property and\n        // type too, and the modelName has to be normalized somehow.\n        //\n        return {\n          id: recordSnapshot.id,\n          type: recordSnapshot.modelName\n        };\n      });\n    },\n\n    _serializeEmbeddedHasMany(snapshot, json, relationship) {\n      var serializedKey = this._getMappedKey(relationship.key, snapshot.type);\n\n      if (serializedKey === relationship.key && this.keyForRelationship) {\n        serializedKey = this.keyForRelationship(relationship.key, relationship.kind, 'serialize');\n      }\n\n      ( Ember.warn(`The embedded relationship '${serializedKey}' is undefined for '${snapshot.modelName}' with id '${snapshot.id}'. Please include it in your original payload.`, Ember.typeOf(snapshot.hasMany(relationship.key)) !== 'undefined', {\n        id: 'ds.serializer.embedded-relationship-undefined'\n      }));\n      json[serializedKey] = this._generateSerializedHasMany(snapshot, relationship);\n    },\n\n    /*\n      Returns an array of embedded records serialized to JSON\n    */\n    _generateSerializedHasMany(snapshot, relationship) {\n      var hasMany = snapshot.hasMany(relationship.key);\n      var manyArray = Ember.A(hasMany);\n      var ret = new Array(manyArray.length);\n\n      for (var i = 0; i < manyArray.length; i++) {\n        var embeddedSnapshot = manyArray[i];\n        var embeddedJson = embeddedSnapshot.serialize({\n          includeId: true\n        });\n        this.removeEmbeddedForeignKey(snapshot, embeddedSnapshot, relationship, embeddedJson);\n        ret[i] = embeddedJson;\n      }\n\n      return ret;\n    },\n\n    /**\n      When serializing an embedded record, modify the property (in the `JSON` payload)\n      that refers to the parent record (foreign key for the relationship).\n       Serializing a `belongsTo` relationship removes the property that refers to the\n      parent record\n       Serializing a `hasMany` relationship does not remove the property that refers to\n      the parent record.\n       @method removeEmbeddedForeignKey\n      @param {Snapshot} snapshot\n      @param {Snapshot} embeddedSnapshot\n      @param {Object} relationship\n      @param {Object} json\n    */\n    removeEmbeddedForeignKey(snapshot, embeddedSnapshot, relationship, json) {\n      if (relationship.kind === 'belongsTo') {\n        var parentRecord = snapshot.type.inverseFor(relationship.key, this.store);\n\n        if (parentRecord) {\n          var name = parentRecord.name;\n          var embeddedSerializer = this.store.serializerFor(embeddedSnapshot.modelName);\n          var parentKey = embeddedSerializer.keyForRelationship(name, parentRecord.kind, 'deserialize');\n\n          if (parentKey) {\n            delete json[parentKey];\n          }\n        }\n      }\n      /*else if (relationship.kind === 'hasMany') {\n      return;\n      }*/\n\n    },\n\n    // checks config for attrs option to embedded (always) - serialize and deserialize\n    hasEmbeddedAlwaysOption(attr) {\n      var option = this.attrsOption(attr);\n      return option && option.embedded === 'always';\n    },\n\n    // checks config for attrs option to serialize ids\n    hasSerializeRecordsOption(attr) {\n      var alwaysEmbed = this.hasEmbeddedAlwaysOption(attr);\n      var option = this.attrsOption(attr);\n      return alwaysEmbed || option && option.serialize === 'records';\n    },\n\n    // checks config for attrs option to serialize records\n    hasSerializeIdsOption(attr) {\n      var option = this.attrsOption(attr);\n      return option && (option.serialize === 'ids' || option.serialize === 'id');\n    },\n\n    // checks config for attrs option to serialize records as objects containing id and types\n    hasSerializeIdsAndTypesOption(attr) {\n      var option = this.attrsOption(attr);\n      return option && (option.serialize === 'ids-and-types' || option.serialize === 'id-and-type');\n    },\n\n    // checks config for attrs option to serialize records\n    noSerializeOptionSpecified(attr) {\n      var option = this.attrsOption(attr);\n      return !(option && (option.serialize || option.embedded));\n    },\n\n    // checks config for attrs option to deserialize records\n    // a defined option object for a resource is treated the same as\n    // `deserialize: 'records'`\n    hasDeserializeRecordsOption(attr) {\n      var alwaysEmbed = this.hasEmbeddedAlwaysOption(attr);\n      var option = this.attrsOption(attr);\n      return alwaysEmbed || option && option.deserialize === 'records';\n    },\n\n    attrsOption(attr) {\n      var attrs = this.get('attrs');\n      return attrs && (attrs[Ember.String.camelize(attr)] || attrs[attr]);\n    },\n\n    /**\n     @method _extractEmbeddedRecords\n     @private\n    */\n    _extractEmbeddedRecords(serializer, store, typeClass, partial) {\n      typeClass.eachRelationship((key, relationship) => {\n        if (serializer.hasDeserializeRecordsOption(key)) {\n          if (relationship.kind === 'hasMany') {\n            this._extractEmbeddedHasMany(store, key, partial, relationship);\n          }\n\n          if (relationship.kind === 'belongsTo') {\n            this._extractEmbeddedBelongsTo(store, key, partial, relationship);\n          }\n        }\n      });\n      return partial;\n    },\n\n    /**\n     @method _extractEmbeddedHasMany\n     @private\n    */\n    _extractEmbeddedHasMany(store, key, hash, relationshipMeta) {\n      var relationshipHash = Ember.get(hash, `data.relationships.${key}.data`);\n\n      if (!relationshipHash) {\n        return;\n      }\n\n      var hasMany = new Array(relationshipHash.length);\n\n      for (var i = 0; i < relationshipHash.length; i++) {\n        var item = relationshipHash[i];\n\n        var {\n          data,\n          included\n        } = this._normalizeEmbeddedRelationship(store, relationshipMeta, item);\n\n        hash.included = hash.included || [];\n        hash.included.push(data);\n\n        if (included) {\n          hash.included.push(...included);\n        }\n\n        hasMany[i] = {\n          id: data.id,\n          type: data.type\n        };\n      }\n\n      var relationship = {\n        data: hasMany\n      };\n      Ember.set(hash, `data.relationships.${key}`, relationship);\n    },\n\n    /**\n     @method _extractEmbeddedBelongsTo\n     @private\n    */\n    _extractEmbeddedBelongsTo(store, key, hash, relationshipMeta) {\n      var relationshipHash = Ember.get(hash, `data.relationships.${key}.data`);\n\n      if (!relationshipHash) {\n        return;\n      }\n\n      var {\n        data,\n        included\n      } = this._normalizeEmbeddedRelationship(store, relationshipMeta, relationshipHash);\n\n      hash.included = hash.included || [];\n      hash.included.push(data);\n\n      if (included) {\n        hash.included.push(...included);\n      }\n\n      var belongsTo = {\n        id: data.id,\n        type: data.type\n      };\n      var relationship = {\n        data: belongsTo\n      };\n      Ember.set(hash, `data.relationships.${key}`, relationship);\n    },\n\n    /**\n     @method _normalizeEmbeddedRelationship\n     @private\n    */\n    _normalizeEmbeddedRelationship(store, relationshipMeta, relationshipHash) {\n      var modelName = relationshipMeta.type;\n\n      if (relationshipMeta.options.polymorphic) {\n        modelName = relationshipHash.type;\n      }\n\n      var modelClass = store.modelFor(modelName);\n      var serializer = store.serializerFor(modelName);\n      return serializer.normalize(modelClass, relationshipHash, null);\n    },\n\n    isEmbeddedRecordsMixin: true\n  });\n\n  /**\n    @module @ember-data/serializer\n  */\n\n  /*\n    Check if the passed model has a `type` attribute or a relationship named `type`.\n\n    @method modelHasAttributeOrRelationshipNamedType\n    @param modelClass\n   */\n  function modelHasAttributeOrRelationshipNamedType(modelClass) {\n    return Ember.get(modelClass, 'attributes').has('type') || Ember.get(modelClass, 'relationshipsByName').has('type');\n  }\n\n  /**\n    @module @ember-data/serializer\n  */\n\n  /**\n    The `Transform` class is used to serialize and deserialize model\n    attributes when they are saved or loaded from an\n    adapter. Subclassing `Transform` is useful for creating custom\n    attributes. All subclasses of `Transform` must implement a\n    `serialize` and a `deserialize` method.\n\n    Example\n\n    ```app/transforms/temperature.js\n    import Transform from '@ember-data/serializer/transform';\n\n    // Converts centigrade in the JSON to fahrenheit in the app\n    export default Transform.extend({\n      deserialize(serialized, options) {\n        return (serialized *  1.8) + 32;\n      },\n\n      serialize(deserialized, options) {\n        return (deserialized - 32) / 1.8;\n      }\n    });\n    ```\n\n    Usage\n\n    ```app/models/requirement.js\n    import Model, { attr } from '@ember-data/model';\n\n    export default Model.extend({\n      name: attr('string'),\n      temperature: attr('temperature')\n    });\n    ```\n\n    The options passed into the `attr` function when the attribute is\n    declared on the model is also available in the transform.\n\n    ```app/models/post.js\n    import Model, { attr } from '@ember-data/model';\n\n    export default Model.extend({\n      title: attr('string'),\n      markdown: attr('markdown', {\n        markdown: {\n          gfm: false,\n          sanitize: true\n        }\n      })\n    });\n    ```\n\n    ```app/transforms/markdown.js\n    import Transform from '@ember-data/serializer/transform';\n\n    export default Transform.extend({\n      serialize(deserialized, options) {\n        return deserialized.raw;\n      },\n\n      deserialize(serialized, options) {\n        var markdownOptions = options.markdown || {};\n\n        return marked(serialized, markdownOptions);\n      }\n    });\n    ```\n\n    @class Transform\n   */\n  var Transform = Ember.Object.extend({\n    /**\n      When given a deserialized value from a record attribute this\n      method must return the serialized value.\n       Example\n       ```javascript\n      import { isEmpty } from '@ember/utils';\n       serialize(deserialized, options) {\n        return isEmpty(deserialized) ? null : Number(deserialized);\n      }\n      ```\n       @method serialize\n      @param deserialized The deserialized value\n      @param options hash of options passed to `attr`\n      @return The serialized value\n    */\n    serialize: null,\n\n    /**\n      When given a serialized value from a JSON object this method must\n      return the deserialized value for the record attribute.\n       Example\n       ```javascript\n      deserialize(serialized, options) {\n        return empty(serialized) ? null : Number(serialized);\n      }\n      ```\n       @method deserialize\n      @param serialized The serialized value\n      @param options hash of options passed to `attr`\n      @return The deserialized value\n    */\n    deserialize: null\n  });\n\n  /**\n    @module @ember-data/serializer\n  */\n\n  /**\n    The `BooleanTransform` class is used to serialize and deserialize\n    boolean attributes on Ember Data record objects. This transform is\n    used when `boolean` is passed as the type parameter to the\n    [attr](/ember-data/release/functions/@ember-data%2Fmodel/attr) function.\n\n    Usage\n\n    ```app/models/user.js\n    import Model, { attr } from '@ember-data/model';\n\n    export default Model.extend({\n      isAdmin: attr('boolean'),\n      name: attr('string'),\n      email: attr('string')\n    });\n    ```\n\n    By default, the boolean transform only allows for values of `true` or\n    `false`. You can opt into allowing `null` values for\n    boolean attributes via `attr('boolean', { allowNull: true })`\n\n    ```app/models/user.js\n    import Model, { attr } from '@ember-data/model';\n\n    export default Model.extend({\n      email: attr('string'),\n      username: attr('string'),\n      wantsWeeklyEmail: attr('boolean', { allowNull: true })\n    });\n    ```\n\n    @class BooleanTransform\n    @extends Transform\n   */\n\n  var boolean = Transform.extend({\n    deserialize(serialized, options) {\n      if (Ember.isNone(serialized) && options.allowNull === true) {\n        return null;\n      }\n\n      var type = typeof serialized;\n\n      if (type === 'boolean') {\n        return serialized;\n      } else if (type === 'string') {\n        return /^(true|t|1)$/i.test(serialized);\n      } else if (type === 'number') {\n        return serialized === 1;\n      } else {\n        return false;\n      }\n    },\n\n    serialize(deserialized, options) {\n      if (Ember.isNone(deserialized) && options.allowNull === true) {\n        return null;\n      }\n\n      return Boolean(deserialized);\n    }\n\n  });\n\n  /**\n    @module @ember-data/serializer\n  */\n\n  /**\n   The `DateTransform` class is used to serialize and deserialize\n   date attributes on Ember Data record objects. This transform is used\n   when `date` is passed as the type parameter to the\n   [attr](/ember-data/release/functions/@ember-data%2Fmodel/attr) function. It uses the [`ISO 8601`](https://en.wikipedia.org/wiki/ISO_8601)\n   standard.\n\n   ```app/models/score.js\n   import Model, { attr, belongsTo } from '@ember-data/model';\n\n   export default Model.extend({\n      value: attr('number'),\n      player: belongsTo('player'),\n      date: attr('date')\n    });\n   ```\n\n   @class DateTransform\n   @extends Transform\n   */\n\n  var date = Transform.extend({\n    deserialize(serialized) {\n      var type = typeof serialized;\n\n      if (type === 'string') {\n        var offset = serialized.indexOf('+');\n\n        if (offset !== -1 && serialized.length - 5 === offset) {\n          offset += 3;\n          return new Date(serialized.slice(0, offset) + ':' + serialized.slice(offset));\n        }\n\n        return new Date(serialized);\n      } else if (type === 'number') {\n        return new Date(serialized);\n      } else if (serialized === null || serialized === undefined) {\n        // if the value is null return null\n        // if the value is not present in the data return undefined\n        return serialized;\n      } else {\n        return null;\n      }\n    },\n\n    serialize(date) {\n      if (date instanceof Date && !isNaN(date)) {\n        return date.toISOString();\n      } else {\n        return null;\n      }\n    }\n\n  });\n\n  /**\n    @module @ember-data/serializer\n  */\n\n  function isNumber(value) {\n    return value === value && value !== Infinity && value !== -Infinity;\n  }\n  /**\n    The `NumberTransform` class is used to serialize and deserialize\n    numeric attributes on Ember Data record objects. This transform is\n    used when `number` is passed as the type parameter to the\n    [attr](/ember-data/release/functions/@ember-data%2Fmodel/attr) function.\n\n    Usage\n\n    ```app/models/score.js\n    import Model, { attr, belongsTo } from '@ember-data/model';\n\n    export default Model.extend({\n      value: attr('number'),\n      player: belongsTo('player'),\n      date: attr('date')\n    });\n    ```\n\n    @class NumberTransform\n    @extends Transform\n   */\n\n\n  var number = Transform.extend({\n    deserialize(serialized) {\n      var transformed;\n\n      if (serialized === '' || serialized === null || serialized === undefined) {\n        return null;\n      } else {\n        transformed = Number(serialized);\n        return isNumber(transformed) ? transformed : null;\n      }\n    },\n\n    serialize(deserialized) {\n      var transformed;\n\n      if (deserialized === '' || deserialized === null || deserialized === undefined) {\n        return null;\n      } else {\n        transformed = Number(deserialized);\n        return isNumber(transformed) ? transformed : null;\n      }\n    }\n\n  });\n\n  /**\n    @module @ember-data/serializer\n  */\n\n  /**\n    The `StringTransform` class is used to serialize and deserialize\n    string attributes on Ember Data record objects. This transform is\n    used when `string` is passed as the type parameter to the\n    [attr](/ember-data/release/functions/@ember-data%2Fmodel/attr) function.\n\n    Usage\n\n    ```app/models/user.js\n    import Model, { attr, belongsTo } from '@ember-data/model';\n\n    export default Model.extend({\n      isAdmin: attr('boolean'),\n      name: attr('string'),\n      email: attr('string')\n    });\n    ```\n\n    @class StringTransform\n    @extends Transform\n   */\n\n  var string = Transform.extend({\n    deserialize(serialized) {\n      return Ember.isNone(serialized) ? null : String(serialized);\n    },\n\n    serialize(deserialized) {\n      return Ember.isNone(deserialized) ? null : String(deserialized);\n    }\n\n  });\n\n  exports.BooleanTransform = boolean;\n  exports.DateTransform = date;\n  exports.EmbeddedRecordsMixin = embeddedRecordsMixin;\n  exports.NumberTransform = number;\n  exports.StringTransform = string;\n  exports.Transform = Transform;\n  exports.modelHasAttributeOrRelationshipNamedType = modelHasAttributeOrRelationshipNamedType;\n\n  Object.defineProperty(exports, '__esModule', { value: true });\n\n});\n","define(\"@ember-data/serializer/index\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n    `Serializer` is an abstract base class that you should override in your\n    application to customize it for your backend. The minimum set of methods\n    that you should implement is:\n  \n      * `normalizeResponse()`\n      * `serialize()`\n  \n    And you can optionally override the following methods:\n  \n      * `normalize()`\n  \n    For an example implementation, see\n    [JSONSerializer](JSONSerializer), the included JSON serializer.\n  \n    @class Serializer\n    @extends EmberObject\n  */\n  var _default = Ember.Object.extend({\n    /**\n      The `store` property is the application's `store` that contains\n      all records. It can be used to look up serializers for other model\n      types that may be nested inside the payload response.\n       Example:\n       ```js\n      Serializer.extend({\n        extractRelationship(relationshipModelName, relationshipHash) {\n          var modelClass = this.store.modelFor(relationshipModelName);\n          var relationshipSerializer = this.store.serializerFor(relationshipModelName);\n          return relationshipSerializer.normalize(modelClass, relationshipHash);\n        }\n      });\n      ```\n       @property store\n      @type {Store}\n      @public\n    */\n\n    /**\n      The `normalizeResponse` method is used to normalize a payload from the\n      server to a JSON-API Document.\n       http://jsonapi.org/format/#document-structure\n       Example:\n       ```js\n      Serializer.extend({\n        normalizeResponse(store, primaryModelClass, payload, id, requestType) {\n          if (requestType === 'findRecord') {\n            return this.normalize(primaryModelClass, payload);\n          } else {\n            return payload.reduce(function(documentHash, item) {\n              let { data, included } = this.normalize(primaryModelClass, item);\n              documentHash.included.push(...included);\n              documentHash.data.push(data);\n              return documentHash;\n            }, { data: [], included: [] })\n          }\n        }\n      });\n      ```\n       @since 1.13.0\n      @method normalizeResponse\n      @param {Store} store\n      @param {Model} primaryModelClass\n      @param {Object} payload\n      @param {String|Number} id\n      @param {String} requestType\n      @return {Object} JSON-API Document\n    */\n    normalizeResponse: null,\n\n    /**\n      The `serialize` method is used when a record is saved in order to convert\n      the record into the form that your external data source expects.\n       `serialize` takes an optional `options` hash with a single option:\n       - `includeId`: If this is `true`, `serialize` should include the ID\n        in the serialized object it builds.\n       Example:\n       ```js\n      Serializer.extend({\n        serialize(snapshot, options) {\n          var json = {\n            id: snapshot.id\n          };\n           snapshot.eachAttribute((key, attribute) => {\n            json[key] = snapshot.attr(key);\n          });\n           snapshot.eachRelationship((key, relationship) => {\n            if (relationship.kind === 'belongsTo') {\n              json[key] = snapshot.belongsTo(key, { id: true });\n            } else if (relationship.kind === 'hasMany') {\n              json[key] = snapshot.hasMany(key, { ids: true });\n            }\n          });\n           return json;\n        },\n      });\n      ```\n       @method serialize\n      @param {Snapshot} snapshot\n      @param {Object} [options]\n      @return {Object}\n    */\n    serialize: null,\n\n    /**\n      The `normalize` method is used to convert a payload received from your\n      external data source into the normalized form `store.push()` expects. You\n      should override this method, munge the hash and return the normalized\n      payload.\n       Example:\n       ```js\n      Serializer.extend({\n        normalize(modelClass, resourceHash) {\n          var data = {\n            id:            resourceHash.id,\n            type:          modelClass.modelName,\n            attributes:    resourceHash\n          };\n          return { data: data };\n        }\n      })\n      ```\n       @method normalize\n      @param {Model} typeClass\n      @param {Object} hash\n      @return {Object}\n    */\n    normalize(typeClass, hash) {\n      return hash;\n    }\n\n  });\n\n  _exports.default = _default;\n});","define(\"@ember-data/serializer/json-api\", [\"exports\", \"ember-inflector\", \"@ember-data/serializer/json\", \"@ember-data/store\"], function (_exports, _emberInflector, _json, _store) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n    Ember Data 2.0 Serializer:\n  \n    In Ember Data a Serializer is used to serialize and deserialize\n    records when they are transferred in and out of an external source.\n    This process involves normalizing property names, transforming\n    attribute values and serializing relationships.\n  \n    `JSONAPISerializer` supports the http://jsonapi.org/ spec and is the\n    serializer recommended by Ember Data.\n  \n    This serializer normalizes a JSON API payload that looks like:\n  \n    ```app/models/player.js\n    import Model, { attr, belongsTo } from '@ember-data/model';\n  \n    export default Model.extend({\n      name: attr('string'),\n      skill: attr('string'),\n      gamesPlayed: attr('number'),\n      club: belongsTo('club')\n    });\n    ```\n  \n    ```app/models/club.js\n    import Model, { attr, hasMany } from '@ember-data/model';\n  \n    export default Model.extend({\n      name: attr('string'),\n      location: attr('string'),\n      players: hasMany('player')\n    });\n    ```\n  \n    ```js\n      {\n        \"data\": [\n          {\n            \"attributes\": {\n              \"name\": \"Benfica\",\n              \"location\": \"Portugal\"\n            },\n            \"id\": \"1\",\n            \"relationships\": {\n              \"players\": {\n                \"data\": [\n                  {\n                    \"id\": \"3\",\n                    \"type\": \"players\"\n                  }\n                ]\n              }\n            },\n            \"type\": \"clubs\"\n          }\n        ],\n        \"included\": [\n          {\n            \"attributes\": {\n              \"name\": \"Eusebio Silva Ferreira\",\n              \"skill\": \"Rocket shot\",\n              \"games-played\": 431\n            },\n            \"id\": \"3\",\n            \"relationships\": {\n              \"club\": {\n                \"data\": {\n                  \"id\": \"1\",\n                  \"type\": \"clubs\"\n                }\n              }\n            },\n            \"type\": \"players\"\n          }\n        ]\n      }\n    ```\n  \n    to the format that the Ember Data store expects.\n  \n    ### Customizing meta\n  \n    Since a JSON API Document can have meta defined in multiple locations you can\n    use the specific serializer hooks if you need to customize the meta.\n  \n    One scenario would be to camelCase the meta keys of your payload. The example\n    below shows how this could be done using `normalizeArrayResponse` and\n    `extractRelationship`.\n  \n    ```app/serializers/application.js\n    export default JSONAPISerializer.extend({\n      normalizeArrayResponse(store, primaryModelClass, payload, id, requestType) {\n        let normalizedDocument = this._super(...arguments);\n  \n        // Customize document meta\n        normalizedDocument.meta = camelCaseKeys(normalizedDocument.meta);\n  \n        return normalizedDocument;\n      },\n  \n      extractRelationship(relationshipHash) {\n        let normalizedRelationship = this._super(...arguments);\n  \n        // Customize relationship meta\n        normalizedRelationship.meta = camelCaseKeys(normalizedRelationship.meta);\n  \n        return normalizedRelationship;\n      }\n    });\n    ```\n  \n    @since 1.13.0\n    @class JSONAPISerializer\n    @extends JSONSerializer\n  */\n  var JSONAPISerializer = _json.default.extend({\n    /**\n      @method _normalizeDocumentHelper\n      @param {Object} documentHash\n      @return {Object}\n      @private\n    */\n    _normalizeDocumentHelper(documentHash) {\n      if (Ember.typeOf(documentHash.data) === 'object') {\n        documentHash.data = this._normalizeResourceHelper(documentHash.data);\n      } else if (Array.isArray(documentHash.data)) {\n        var ret = new Array(documentHash.data.length);\n\n        for (var i = 0; i < documentHash.data.length; i++) {\n          var data = documentHash.data[i];\n          ret[i] = this._normalizeResourceHelper(data);\n        }\n\n        documentHash.data = ret;\n      }\n\n      if (Array.isArray(documentHash.included)) {\n        var _ret = new Array();\n\n        for (var _i = 0; _i < documentHash.included.length; _i++) {\n          var included = documentHash.included[_i];\n\n          var normalized = this._normalizeResourceHelper(included);\n\n          if (normalized !== null) {\n            // can be null when unknown type is encountered\n            _ret.push(normalized);\n          }\n        }\n\n        documentHash.included = _ret;\n      }\n\n      return documentHash;\n    },\n\n    /**\n      @method _normalizeRelationshipDataHelper\n      @param {Object} relationshipDataHash\n      @return {Object}\n      @private\n    */\n    _normalizeRelationshipDataHelper(relationshipDataHash) {\n      relationshipDataHash.type = this.modelNameFromPayloadKey(relationshipDataHash.type);\n      return relationshipDataHash;\n    },\n\n    /**\n      @method _normalizeResourceHelper\n      @param {Object} resourceHash\n      @return {Object}\n      @private\n    */\n    _normalizeResourceHelper(resourceHash) {\n      (true && !(!Ember.isNone(resourceHash.type)) && Ember.assert(this.warnMessageForUndefinedType(), !Ember.isNone(resourceHash.type), {\n        id: 'ds.serializer.type-is-undefined'\n      }));\n      var modelName, usedLookup;\n      modelName = this.modelNameFromPayloadKey(resourceHash.type);\n      usedLookup = 'modelNameFromPayloadKey';\n\n      if (!this.store._hasModelFor(modelName)) {\n        (true && Ember.warn(this.warnMessageNoModelForType(modelName, resourceHash.type, usedLookup), false, {\n          id: 'ds.serializer.model-for-type-missing'\n        }));\n        return null;\n      }\n\n      var modelClass = this.store.modelFor(modelName);\n      var serializer = this.store.serializerFor(modelName);\n      var {\n        data\n      } = serializer.normalize(modelClass, resourceHash);\n      return data;\n    },\n\n    /**\n      @method pushPayload\n      @param {Store} store\n      @param {Object} payload\n    */\n    pushPayload(store, payload) {\n      var normalizedPayload = this._normalizeDocumentHelper(payload);\n\n      store.push(normalizedPayload);\n    },\n\n    /**\n      @method _normalizeResponse\n      @param {Store} store\n      @param {Model} primaryModelClass\n      @param {Object} payload\n      @param {String|Number} id\n      @param {String} requestType\n      @param {Boolean} isSingle\n      @return {Object} JSON-API Document\n      @private\n    */\n    _normalizeResponse(store, primaryModelClass, payload, id, requestType, isSingle) {\n      var normalizedPayload = this._normalizeDocumentHelper(payload);\n\n      return normalizedPayload;\n    },\n\n    normalizeQueryRecordResponse() {\n      var normalized = this._super(...arguments);\n\n      (true && !(!Array.isArray(normalized.data)) && Ember.assert('Expected the primary data returned by the serializer for a `queryRecord` response to be a single object but instead it was an array.', !Array.isArray(normalized.data), {\n        id: 'ds.serializer.json-api.queryRecord-array-response'\n      }));\n      return normalized;\n    },\n\n    extractAttributes(modelClass, resourceHash) {\n      var attributes = {};\n\n      if (resourceHash.attributes) {\n        modelClass.eachAttribute(key => {\n          var attributeKey = this.keyForAttribute(key, 'deserialize');\n\n          if (resourceHash.attributes[attributeKey] !== undefined) {\n            attributes[key] = resourceHash.attributes[attributeKey];\n          }\n\n          if (true\n          /* DEBUG */\n          ) {\n            if (resourceHash.attributes[attributeKey] === undefined && resourceHash.attributes[key] !== undefined) {\n              (true && !(false) && Ember.assert(`Your payload for '${modelClass.modelName}' contains '${key}', but your serializer is setup to look for '${attributeKey}'. This is most likely because Ember Data's JSON API serializer dasherizes attribute keys by default. You should subclass JSONAPISerializer and implement 'keyForAttribute(key) { return key; }' to prevent Ember Data from customizing your attribute keys.`, false));\n            }\n          }\n        });\n      }\n\n      return attributes;\n    },\n\n    /**\n       Returns a relationship formatted as a JSON-API \"relationship object\".\n        http://jsonapi.org/format/#document-resource-object-relationships\n        @method extractRelationship\n       @param {Object} relationshipHash\n       @return {Object}\n    */\n    extractRelationship(relationshipHash) {\n      if (Ember.typeOf(relationshipHash.data) === 'object') {\n        relationshipHash.data = this._normalizeRelationshipDataHelper(relationshipHash.data);\n      }\n\n      if (Array.isArray(relationshipHash.data)) {\n        var ret = new Array(relationshipHash.data.length);\n\n        for (var i = 0; i < relationshipHash.data.length; i++) {\n          var data = relationshipHash.data[i];\n          ret[i] = this._normalizeRelationshipDataHelper(data);\n        }\n\n        relationshipHash.data = ret;\n      }\n\n      return relationshipHash;\n    },\n\n    /**\n       Returns the resource's relationships formatted as a JSON-API \"relationships object\".\n        http://jsonapi.org/format/#document-resource-object-relationships\n        @method extractRelationships\n       @param {Object} modelClass\n       @param {Object} resourceHash\n       @return {Object}\n    */\n    extractRelationships(modelClass, resourceHash) {\n      var relationships = {};\n\n      if (resourceHash.relationships) {\n        modelClass.eachRelationship((key, relationshipMeta) => {\n          var relationshipKey = this.keyForRelationship(key, relationshipMeta.kind, 'deserialize');\n\n          if (resourceHash.relationships[relationshipKey] !== undefined) {\n            var relationshipHash = resourceHash.relationships[relationshipKey];\n            relationships[key] = this.extractRelationship(relationshipHash);\n          }\n\n          if (true\n          /* DEBUG */\n          ) {\n            if (resourceHash.relationships[relationshipKey] === undefined && resourceHash.relationships[key] !== undefined) {\n              (true && !(false) && Ember.assert(`Your payload for '${modelClass.modelName}' contains '${key}', but your serializer is setup to look for '${relationshipKey}'. This is most likely because Ember Data's JSON API serializer dasherizes relationship keys by default. You should subclass JSONAPISerializer and implement 'keyForRelationship(key) { return key; }' to prevent Ember Data from customizing your relationship keys.`, false));\n            }\n          }\n        });\n      }\n\n      return relationships;\n    },\n\n    /**\n      @method _extractType\n      @param {Model} modelClass\n      @param {Object} resourceHash\n      @return {String}\n      @private\n    */\n    _extractType(modelClass, resourceHash) {\n      return this.modelNameFromPayloadKey(resourceHash.type);\n    },\n\n    /**\n      Dasherizes and singularizes the model name in the payload to match\n      the format Ember Data uses internally for the model name.\n       For example the key `posts` would be converted to `post` and the\n      key `studentAssesments` would be converted to `student-assesment`.\n       @method modelNameFromPayloadKey\n      @param {String} key\n      @return {String} the model's modelName\n    */\n    // TODO @deprecated Use modelNameFromPayloadType instead\n    modelNameFromPayloadKey(key) {\n      return (0, _emberInflector.singularize)((0, _store.normalizeModelName)(key));\n    },\n\n    /**\n      Converts the model name to a pluralized version of the model name.\n       For example `post` would be converted to `posts` and\n      `student-assesment` would be converted to `student-assesments`.\n       @method payloadKeyFromModelName\n      @param {String} modelName\n      @return {String}\n    */\n    // TODO @deprecated Use payloadTypeFromModelName instead\n    payloadKeyFromModelName(modelName) {\n      return (0, _emberInflector.pluralize)(modelName);\n    },\n\n    normalize(modelClass, resourceHash) {\n      if (resourceHash.attributes) {\n        this.normalizeUsingDeclaredMapping(modelClass, resourceHash.attributes);\n      }\n\n      if (resourceHash.relationships) {\n        this.normalizeUsingDeclaredMapping(modelClass, resourceHash.relationships);\n      }\n\n      var data = {\n        id: this.extractId(modelClass, resourceHash),\n        type: this._extractType(modelClass, resourceHash),\n        attributes: this.extractAttributes(modelClass, resourceHash),\n        relationships: this.extractRelationships(modelClass, resourceHash)\n      };\n      this.applyTransforms(modelClass, data.attributes);\n      return {\n        data\n      };\n    },\n\n    /**\n      `keyForAttribute` can be used to define rules for how to convert an\n      attribute name in your model to a key in your JSON.\n      By default `JSONAPISerializer` follows the format used on the examples of\n      http://jsonapi.org/format and uses dashes as the word separator in the JSON\n      attribute keys.\n       This behaviour can be easily customized by extending this method.\n       Example\n       ```app/serializers/application.js\n      import JSONAPISerializer from '@ember-data/serializer/json-api';\n      import { dasherize } from '@ember/string';\n       export default JSONAPISerializer.extend({\n        keyForAttribute(attr, method) {\n          return dasherize(attr).toUpperCase();\n        }\n      });\n      ```\n       @method keyForAttribute\n      @param {String} key\n      @param {String} method\n      @return {String} normalized key\n    */\n    keyForAttribute(key, method) {\n      return Ember.String.dasherize(key);\n    },\n\n    /**\n     `keyForRelationship` can be used to define a custom key when\n     serializing and deserializing relationship properties.\n     By default `JSONAPISerializer` follows the format used on the examples of\n     http://jsonapi.org/format and uses dashes as word separators in\n     relationship properties.\n      This behaviour can be easily customized by extending this method.\n      Example\n       ```app/serializers/post.js\n      import JSONAPISerializer from '@ember-data/serializer/json-api';\n      import { underscore } from '@ember/string';\n       export default JSONAPISerializer.extend({\n        keyForRelationship(key, relationship, method) {\n          return underscore(key);\n        }\n      });\n      ```\n     @method keyForRelationship\n     @param {String} key\n     @param {String} typeClass\n     @param {String} method\n     @return {String} normalized key\n    */\n    keyForRelationship(key, typeClass, method) {\n      return Ember.String.dasherize(key);\n    },\n\n    serialize(snapshot, options) {\n      var data = this._super(...arguments);\n\n      data.type = this.payloadKeyFromModelName(snapshot.modelName);\n      return {\n        data\n      };\n    },\n\n    serializeAttribute(snapshot, json, key, attribute) {\n      var type = attribute.type;\n\n      if (this._canSerialize(key)) {\n        json.attributes = json.attributes || {};\n        var value = snapshot.attr(key);\n\n        if (type) {\n          var transform = this.transformFor(type);\n          value = transform.serialize(value, attribute.options);\n        }\n\n        var payloadKey = this._getMappedKey(key, snapshot.type);\n\n        if (payloadKey === key) {\n          payloadKey = this.keyForAttribute(key, 'serialize');\n        }\n\n        json.attributes[payloadKey] = value;\n      }\n    },\n\n    serializeBelongsTo(snapshot, json, relationship) {\n      var key = relationship.key;\n\n      if (this._canSerialize(key)) {\n        var belongsTo = snapshot.belongsTo(key);\n        var belongsToIsNotNew;\n\n        if (false\n        /* CUSTOM_MODEL_CLASS */\n        ) {\n          belongsToIsNotNew = belongsTo && !belongsTo.isNew;\n        } else {\n          belongsToIsNotNew = belongsTo && belongsTo.record && !belongsTo.record.get('isNew');\n        }\n\n        if (belongsTo === null || belongsToIsNotNew) {\n          json.relationships = json.relationships || {};\n\n          var payloadKey = this._getMappedKey(key, snapshot.type);\n\n          if (payloadKey === key) {\n            payloadKey = this.keyForRelationship(key, 'belongsTo', 'serialize');\n          }\n\n          var data = null;\n\n          if (belongsTo) {\n            var payloadType = this.payloadKeyFromModelName(belongsTo.modelName);\n            data = {\n              type: payloadType,\n              id: belongsTo.id\n            };\n          }\n\n          json.relationships[payloadKey] = {\n            data\n          };\n        }\n      }\n    },\n\n    serializeHasMany(snapshot, json, relationship) {\n      var key = relationship.key;\n\n      if (this.shouldSerializeHasMany(snapshot, key, relationship)) {\n        var hasMany = snapshot.hasMany(key);\n\n        if (hasMany !== undefined) {\n          json.relationships = json.relationships || {};\n\n          var payloadKey = this._getMappedKey(key, snapshot.type);\n\n          if (payloadKey === key && this.keyForRelationship) {\n            payloadKey = this.keyForRelationship(key, 'hasMany', 'serialize');\n          } // only serialize has many relationships that are not new\n\n\n          var nonNewHasMany = hasMany.filter(item => item.record && !item.record.get('isNew'));\n          var data = new Array(nonNewHasMany.length);\n\n          for (var i = 0; i < nonNewHasMany.length; i++) {\n            var item = hasMany[i];\n            var payloadType = this.payloadKeyFromModelName(item.modelName);\n            data[i] = {\n              type: payloadType,\n              id: item.id\n            };\n          }\n\n          json.relationships[payloadKey] = {\n            data\n          };\n        }\n      }\n    }\n\n  });\n\n  if (true\n  /* DEBUG */\n  ) {\n    JSONAPISerializer.reopen({\n      willMergeMixin(props) {\n        var constructor = this.constructor;\n        (true && Ember.warn(`You've defined 'extractMeta' in ${constructor.toString()} which is not used for serializers extending JSONAPISerializer. Read more at https://api.emberjs.com/ember-data/release/classes/JSONAPISerializer on how to customize meta when using JSON API.`, Ember.isNone(props.extractMeta) || props.extractMeta === _json.default.prototype.extractMeta, {\n          id: 'ds.serializer.json-api.extractMeta'\n        }));\n        (true && Ember.warn('The JSONAPISerializer does not work with the EmbeddedRecordsMixin because the JSON API spec does not describe how to format embedded resources.', !props.isEmbeddedRecordsMixin, {\n          id: 'ds.serializer.embedded-records-mixin-not-supported'\n        }));\n      },\n\n      warnMessageForUndefinedType() {\n        return 'Encountered a resource object with an undefined type (resolved resource using ' + this.constructor.toString() + ')';\n      },\n\n      warnMessageNoModelForType(modelName, originalType, usedLookup) {\n        return `Encountered a resource object with type \"${originalType}\", but no model was found for model name \"${modelName}\" (resolved model name using '${this.constructor.toString()}.${usedLookup}(\"${originalType}\")').`;\n      }\n\n    });\n  }\n\n  var _default = JSONAPISerializer;\n  _exports.default = _default;\n});","define(\"@ember-data/serializer/json\", [\"exports\", \"@ember-data/serializer\", \"@ember-data/store/-private\", \"@ember-data/serializer/-private\", \"@ember-data/store\"], function (_exports, _serializer, _private, _private2, _store) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n    @module @ember-data/serializer\n  */\n\n  /**\n    Ember Data 2.0 Serializer:\n  \n    In Ember Data a Serializer is used to serialize and deserialize\n    records when they are transferred in and out of an external source.\n    This process involves normalizing property names, transforming\n    attribute values and serializing relationships.\n  \n    By default, Ember Data uses and recommends the `JSONAPISerializer`.\n  \n    `JSONSerializer` is useful for simpler or legacy backends that may\n    not support the http://jsonapi.org/ spec.\n  \n    For example, given the following `User` model and JSON payload:\n  \n    ```app/models/user.js\n    import Model, { attr, belongsTo, hasMany } from '@ember-data/model';\n  \n    export default Model.extend({\n      friends: hasMany('user'),\n      house: belongsTo('location'),\n  \n      name: attr('string')\n    });\n    ```\n  \n    ```js\n    {\n      id: 1,\n      name: 'Sebastian',\n      friends: [3, 4],\n      links: {\n        house: '/houses/lefkada'\n      }\n    }\n    ```\n  \n    `JSONSerializer` will normalize the JSON payload to the JSON API format that the\n    Ember Data store expects.\n  \n    You can customize how JSONSerializer processes its payload by passing options in\n    the `attrs` hash or by subclassing the `JSONSerializer` and overriding hooks:\n  \n      - To customize how a single record is normalized, use the `normalize` hook.\n      - To customize how `JSONSerializer` normalizes the whole server response, use the\n        `normalizeResponse` hook.\n      - To customize how `JSONSerializer` normalizes a specific response from the server,\n        use one of the many specific `normalizeResponse` hooks.\n      - To customize how `JSONSerializer` normalizes your id, attributes or relationships,\n        use the `extractId`, `extractAttributes` and `extractRelationships` hooks.\n  \n    The `JSONSerializer` normalization process follows these steps:\n  \n      - `normalizeResponse` - entry method to the serializer.\n      - `normalizeCreateRecordResponse` - a `normalizeResponse` for a specific operation is called.\n      - `normalizeSingleResponse`|`normalizeArrayResponse` - for methods like `createRecord` we expect\n        a single record back, while for methods like `findAll` we expect multiple records back.\n      - `normalize` - `normalizeArray` iterates and calls `normalize` for each of its records while `normalizeSingle`\n        calls it once. This is the method you most likely want to subclass.\n      - `extractId` | `extractAttributes` | `extractRelationships` - `normalize` delegates to these methods to\n        turn the record payload into the JSON API format.\n  \n    @class JSONSerializer\n    @extends Serializer\n  */\n  var JSONSerializer = _serializer.default.extend({\n    /**\n      The `primaryKey` is used when serializing and deserializing\n      data. Ember Data always uses the `id` property to store the id of\n      the record. The external source may not always follow this\n      convention. In these cases it is useful to override the\n      `primaryKey` property to match the `primaryKey` of your external\n      store.\n       Example\n       ```app/serializers/application.js\n      import JSONSerializer from '@ember-data/serializer/json';\n       export default JSONSerializer.extend({\n        primaryKey: '_id'\n      });\n      ```\n       @property primaryKey\n      @type {String}\n      @default 'id'\n    */\n    primaryKey: 'id',\n\n    /**\n      The `attrs` object can be used to declare a simple mapping between\n      property names on `Model` records and payload keys in the\n      serialized JSON object representing the record. An object with the\n      property `key` can also be used to designate the attribute's key on\n      the response payload.\n       Example\n       ```app/models/person.js\n      import Model, { attr } from '@ember-data/model';\n       export default Model.extend({\n        firstName: attr('string'),\n        lastName: attr('string'),\n        occupation: attr('string'),\n        admin: attr('boolean')\n      });\n      ```\n       ```app/serializers/person.js\n      import JSONSerializer from '@ember-data/serializer/json';\n       export default JSONSerializer.extend({\n        attrs: {\n          admin: 'is_admin',\n          occupation: { key: 'career' }\n        }\n      });\n      ```\n       You can also remove attributes and relationships by setting the `serialize`\n      key to `false` in your mapping object.\n       Example\n       ```app/serializers/person.js\n      import JSONSerializer from '@ember-data/serializer/json';\n       export default JSONSerializer.extend({\n        attrs: {\n          admin: { serialize: false },\n          occupation: { key: 'career' }\n        }\n      });\n      ```\n       When serialized:\n       ```javascript\n      {\n        \"firstName\": \"Harry\",\n        \"lastName\": \"Houdini\",\n        \"career\": \"magician\"\n      }\n      ```\n       Note that the `admin` is now not included in the payload.\n       Setting `serialize` to `true` enforces serialization for hasMany\n      relationships even if it's neither a many-to-many nor many-to-none\n      relationship.\n       @property attrs\n      @type {Object}\n    */\n    mergedProperties: ['attrs'],\n\n    /**\n     Given a subclass of `Model` and a JSON object this method will\n     iterate through each attribute of the `Model` and invoke the\n     `Transform#deserialize` method on the matching property of the\n     JSON object.  This method is typically called after the\n     serializer's `normalize` method.\n      @method applyTransforms\n     @private\n     @param {Model} typeClass\n     @param {Object} data The data to transform\n     @return {Object} data The transformed data object\n    */\n    applyTransforms(typeClass, data) {\n      var attributes = Ember.get(typeClass, 'attributes');\n      typeClass.eachTransformedAttribute((key, typeClass) => {\n        if (data[key] === undefined) {\n          return;\n        }\n\n        var transform = this.transformFor(typeClass);\n        var transformMeta = attributes.get(key);\n        data[key] = transform.deserialize(data[key], transformMeta.options);\n      });\n      return data;\n    },\n\n    /**\n      The `normalizeResponse` method is used to normalize a payload from the\n      server to a JSON-API Document.\n       http://jsonapi.org/format/#document-structure\n       This method delegates to a more specific normalize method based on\n      the `requestType`.\n       To override this method with a custom one, make sure to call\n      `return this._super(store, primaryModelClass, payload, id, requestType)` with your\n      pre-processed data.\n       Here's an example of using `normalizeResponse` manually:\n       ```javascript\n      socket.on('message', function(message) {\n        var data = message.data;\n        var modelClass = store.modelFor(data.modelName);\n        var serializer = store.serializerFor(data.modelName);\n        var normalized = serializer.normalizeSingleResponse(store, modelClass, data, data.id);\n         store.push(normalized);\n      });\n      ```\n       @since 1.13.0\n      @method normalizeResponse\n      @param {Store} store\n      @param {Model} primaryModelClass\n      @param {Object} payload\n      @param {String|Number} id\n      @param {String} requestType\n      @return {Object} JSON-API Document\n    */\n    normalizeResponse(store, primaryModelClass, payload, id, requestType) {\n      switch (requestType) {\n        case 'findRecord':\n          return this.normalizeFindRecordResponse(...arguments);\n\n        case 'queryRecord':\n          return this.normalizeQueryRecordResponse(...arguments);\n\n        case 'findAll':\n          return this.normalizeFindAllResponse(...arguments);\n\n        case 'findBelongsTo':\n          return this.normalizeFindBelongsToResponse(...arguments);\n\n        case 'findHasMany':\n          return this.normalizeFindHasManyResponse(...arguments);\n\n        case 'findMany':\n          return this.normalizeFindManyResponse(...arguments);\n\n        case 'query':\n          return this.normalizeQueryResponse(...arguments);\n\n        case 'createRecord':\n          return this.normalizeCreateRecordResponse(...arguments);\n\n        case 'deleteRecord':\n          return this.normalizeDeleteRecordResponse(...arguments);\n\n        case 'updateRecord':\n          return this.normalizeUpdateRecordResponse(...arguments);\n      }\n    },\n\n    /**\n      @since 1.13.0\n      @method normalizeFindRecordResponse\n      @param {Store} store\n      @param {Model} primaryModelClass\n      @param {Object} payload\n      @param {String|Number} id\n      @param {String} requestType\n      @return {Object} JSON-API Document\n    */\n    normalizeFindRecordResponse(store, primaryModelClass, payload, id, requestType) {\n      return this.normalizeSingleResponse(...arguments);\n    },\n\n    /**\n      @since 1.13.0\n      @method normalizeQueryRecordResponse\n      @param {Store} store\n      @param {Model} primaryModelClass\n      @param {Object} payload\n      @param {String|Number} id\n      @param {String} requestType\n      @return {Object} JSON-API Document\n    */\n    normalizeQueryRecordResponse(store, primaryModelClass, payload, id, requestType) {\n      return this.normalizeSingleResponse(...arguments);\n    },\n\n    /**\n      @since 1.13.0\n      @method normalizeFindAllResponse\n      @param {Store} store\n      @param {Model} primaryModelClass\n      @param {Object} payload\n      @param {String|Number} id\n      @param {String} requestType\n      @return {Object} JSON-API Document\n    */\n    normalizeFindAllResponse(store, primaryModelClass, payload, id, requestType) {\n      return this.normalizeArrayResponse(...arguments);\n    },\n\n    /**\n      @since 1.13.0\n      @method normalizeFindBelongsToResponse\n      @param {Store} store\n      @param {Model} primaryModelClass\n      @param {Object} payload\n      @param {String|Number} id\n      @param {String} requestType\n      @return {Object} JSON-API Document\n    */\n    normalizeFindBelongsToResponse(store, primaryModelClass, payload, id, requestType) {\n      return this.normalizeSingleResponse(...arguments);\n    },\n\n    /**\n      @since 1.13.0\n      @method normalizeFindHasManyResponse\n      @param {Store} store\n      @param {Model} primaryModelClass\n      @param {Object} payload\n      @param {String|Number} id\n      @param {String} requestType\n      @return {Object} JSON-API Document\n    */\n    normalizeFindHasManyResponse(store, primaryModelClass, payload, id, requestType) {\n      return this.normalizeArrayResponse(...arguments);\n    },\n\n    /**\n      @since 1.13.0\n      @method normalizeFindManyResponse\n      @param {Store} store\n      @param {Model} primaryModelClass\n      @param {Object} payload\n      @param {String|Number} id\n      @param {String} requestType\n      @return {Object} JSON-API Document\n    */\n    normalizeFindManyResponse(store, primaryModelClass, payload, id, requestType) {\n      return this.normalizeArrayResponse(...arguments);\n    },\n\n    /**\n      @since 1.13.0\n      @method normalizeQueryResponse\n      @param {Store} store\n      @param {Model} primaryModelClass\n      @param {Object} payload\n      @param {String|Number} id\n      @param {String} requestType\n      @return {Object} JSON-API Document\n    */\n    normalizeQueryResponse(store, primaryModelClass, payload, id, requestType) {\n      return this.normalizeArrayResponse(...arguments);\n    },\n\n    /**\n      @since 1.13.0\n      @method normalizeCreateRecordResponse\n      @param {Store} store\n      @param {Model} primaryModelClass\n      @param {Object} payload\n      @param {String|Number} id\n      @param {String} requestType\n      @return {Object} JSON-API Document\n    */\n    normalizeCreateRecordResponse(store, primaryModelClass, payload, id, requestType) {\n      return this.normalizeSaveResponse(...arguments);\n    },\n\n    /**\n      @since 1.13.0\n      @method normalizeDeleteRecordResponse\n      @param {Store} store\n      @param {Model} primaryModelClass\n      @param {Object} payload\n      @param {String|Number} id\n      @param {String} requestType\n      @return {Object} JSON-API Document\n    */\n    normalizeDeleteRecordResponse(store, primaryModelClass, payload, id, requestType) {\n      return this.normalizeSaveResponse(...arguments);\n    },\n\n    /**\n      @since 1.13.0\n      @method normalizeUpdateRecordResponse\n      @param {Store} store\n      @param {Model} primaryModelClass\n      @param {Object} payload\n      @param {String|Number} id\n      @param {String} requestType\n      @return {Object} JSON-API Document\n    */\n    normalizeUpdateRecordResponse(store, primaryModelClass, payload, id, requestType) {\n      return this.normalizeSaveResponse(...arguments);\n    },\n\n    /**\n      @since 1.13.0\n      @method normalizeSaveResponse\n      @param {Store} store\n      @param {Model} primaryModelClass\n      @param {Object} payload\n      @param {String|Number} id\n      @param {String} requestType\n      @return {Object} JSON-API Document\n    */\n    normalizeSaveResponse(store, primaryModelClass, payload, id, requestType) {\n      return this.normalizeSingleResponse(...arguments);\n    },\n\n    /**\n      @since 1.13.0\n      @method normalizeSingleResponse\n      @param {Store} store\n      @param {Model} primaryModelClass\n      @param {Object} payload\n      @param {String|Number} id\n      @param {String} requestType\n      @return {Object} JSON-API Document\n    */\n    normalizeSingleResponse(store, primaryModelClass, payload, id, requestType) {\n      return this._normalizeResponse(store, primaryModelClass, payload, id, requestType, true);\n    },\n\n    /**\n      @since 1.13.0\n      @method normalizeArrayResponse\n      @param {Store} store\n      @param {Model} primaryModelClass\n      @param {Object} payload\n      @param {String|Number} id\n      @param {String} requestType\n      @return {Object} JSON-API Document\n    */\n    normalizeArrayResponse(store, primaryModelClass, payload, id, requestType) {\n      return this._normalizeResponse(store, primaryModelClass, payload, id, requestType, false);\n    },\n\n    /**\n      @method _normalizeResponse\n      @param {Store} store\n      @param {Model} primaryModelClass\n      @param {Object} payload\n      @param {String|Number} id\n      @param {String} requestType\n      @param {Boolean} isSingle\n      @return {Object} JSON-API Document\n      @private\n    */\n    _normalizeResponse(store, primaryModelClass, payload, id, requestType, isSingle) {\n      var documentHash = {\n        data: null,\n        included: []\n      };\n      var meta = this.extractMeta(store, primaryModelClass, payload);\n\n      if (meta) {\n        (true && !(Ember.typeOf(meta) === 'object') && Ember.assert('The `meta` returned from `extractMeta` has to be an object, not \"' + Ember.typeOf(meta) + '\".', Ember.typeOf(meta) === 'object'));\n        documentHash.meta = meta;\n      }\n\n      if (isSingle) {\n        var {\n          data,\n          included\n        } = this.normalize(primaryModelClass, payload);\n        documentHash.data = data;\n\n        if (included) {\n          documentHash.included = included;\n        }\n      } else {\n        var ret = new Array(payload.length);\n\n        for (var i = 0, l = payload.length; i < l; i++) {\n          var item = payload[i];\n          var {\n            data: _data,\n            included: _included\n          } = this.normalize(primaryModelClass, item);\n\n          if (_included) {\n            documentHash.included.push(..._included);\n          }\n\n          ret[i] = _data;\n        }\n\n        documentHash.data = ret;\n      }\n\n      return documentHash;\n    },\n\n    /**\n      Normalizes a part of the JSON payload returned by\n      the server. You should override this method, munge the hash\n      and call super if you have generic normalization to do.\n       It takes the type of the record that is being normalized\n      (as a Model class), the property where the hash was\n      originally found, and the hash to normalize.\n       You can use this method, for example, to normalize underscored keys to camelized\n      or other general-purpose normalizations.\n       Example\n       ```app/serializers/application.js\n      import JSONSerializer from '@ember-data/serializer/json';\n      import { underscore } from '@ember/string';\n      import { get } from '@ember/object';\n       export default JSONSerializer.extend({\n        normalize(typeClass, hash) {\n          var fields = get(typeClass, 'fields');\n           fields.forEach(function(type, field) {\n            var payloadField = underscore(field);\n            if (field === payloadField) { return; }\n             hash[field] = hash[payloadField];\n            delete hash[payloadField];\n          });\n           return this._super.apply(this, arguments);\n        }\n      });\n      ```\n       @method normalize\n      @param {Model} typeClass\n      @param {Object} hash\n      @return {Object}\n    */\n    normalize(modelClass, resourceHash) {\n      var data = null;\n\n      if (resourceHash) {\n        this.normalizeUsingDeclaredMapping(modelClass, resourceHash);\n\n        if (Ember.typeOf(resourceHash.links) === 'object') {\n          this.normalizeUsingDeclaredMapping(modelClass, resourceHash.links);\n        }\n\n        data = {\n          id: this.extractId(modelClass, resourceHash),\n          type: modelClass.modelName,\n          attributes: this.extractAttributes(modelClass, resourceHash),\n          relationships: this.extractRelationships(modelClass, resourceHash)\n        };\n        this.applyTransforms(modelClass, data.attributes);\n      }\n\n      return {\n        data\n      };\n    },\n\n    /**\n      Returns the resource's ID.\n       @method extractId\n      @param {Object} modelClass\n      @param {Object} resourceHash\n      @return {String}\n    */\n    extractId(modelClass, resourceHash) {\n      var primaryKey = Ember.get(this, 'primaryKey');\n      var id = resourceHash[primaryKey];\n      return (0, _private.coerceId)(id);\n    },\n\n    /**\n      Returns the resource's attributes formatted as a JSON-API \"attributes object\".\n       http://jsonapi.org/format/#document-resource-object-attributes\n       @method extractAttributes\n      @param {Object} modelClass\n      @param {Object} resourceHash\n      @return {Object}\n    */\n    extractAttributes(modelClass, resourceHash) {\n      var attributeKey;\n      var attributes = {};\n      modelClass.eachAttribute(key => {\n        attributeKey = this.keyForAttribute(key, 'deserialize');\n\n        if (resourceHash[attributeKey] !== undefined) {\n          attributes[key] = resourceHash[attributeKey];\n        }\n      });\n      return attributes;\n    },\n\n    /**\n      Returns a relationship formatted as a JSON-API \"relationship object\".\n       http://jsonapi.org/format/#document-resource-object-relationships\n       @method extractRelationship\n      @param {Object} relationshipModelName\n      @param {Object} relationshipHash\n      @return {Object}\n    */\n    extractRelationship(relationshipModelName, relationshipHash) {\n      if (Ember.isNone(relationshipHash)) {\n        return null;\n      }\n      /*\n        When `relationshipHash` is an object it usually means that the relationship\n        is polymorphic. It could however also be embedded resources that the\n        EmbeddedRecordsMixin has be able to process.\n      */\n\n\n      if (Ember.typeOf(relationshipHash) === 'object') {\n        if (relationshipHash.id) {\n          relationshipHash.id = (0, _private.coerceId)(relationshipHash.id);\n        }\n\n        var modelClass = this.store.modelFor(relationshipModelName);\n\n        if (relationshipHash.type && !(0, _private2.modelHasAttributeOrRelationshipNamedType)(modelClass)) {\n          relationshipHash.type = this.modelNameFromPayloadKey(relationshipHash.type);\n        }\n\n        return relationshipHash;\n      }\n\n      return {\n        id: (0, _private.coerceId)(relationshipHash),\n        type: relationshipModelName\n      };\n    },\n\n    /**\n      Returns a polymorphic relationship formatted as a JSON-API \"relationship object\".\n       http://jsonapi.org/format/#document-resource-object-relationships\n       `relationshipOptions` is a hash which contains more information about the\n      polymorphic relationship which should be extracted:\n        - `resourceHash` complete hash of the resource the relationship should be\n          extracted from\n        - `relationshipKey` key under which the value for the relationship is\n          extracted from the resourceHash\n        - `relationshipMeta` meta information about the relationship\n       @method extractPolymorphicRelationship\n      @param {Object} relationshipModelName\n      @param {Object} relationshipHash\n      @param {Object} relationshipOptions\n      @return {Object}\n    */\n    extractPolymorphicRelationship(relationshipModelName, relationshipHash, relationshipOptions) {\n      return this.extractRelationship(relationshipModelName, relationshipHash);\n    },\n\n    /**\n      Returns the resource's relationships formatted as a JSON-API \"relationships object\".\n       http://jsonapi.org/format/#document-resource-object-relationships\n       @method extractRelationships\n      @param {Object} modelClass\n      @param {Object} resourceHash\n      @return {Object}\n    */\n    extractRelationships(modelClass, resourceHash) {\n      var relationships = {};\n      modelClass.eachRelationship((key, relationshipMeta) => {\n        var relationship = null;\n        var relationshipKey = this.keyForRelationship(key, relationshipMeta.kind, 'deserialize');\n\n        if (resourceHash[relationshipKey] !== undefined) {\n          var data = null;\n          var relationshipHash = resourceHash[relationshipKey];\n\n          if (relationshipMeta.kind === 'belongsTo') {\n            if (relationshipMeta.options.polymorphic) {\n              // extracting a polymorphic belongsTo may need more information\n              // than the type and the hash (which might only be an id) for the\n              // relationship, hence we pass the key, resource and\n              // relationshipMeta too\n              data = this.extractPolymorphicRelationship(relationshipMeta.type, relationshipHash, {\n                key,\n                resourceHash,\n                relationshipMeta\n              });\n            } else {\n              data = this.extractRelationship(relationshipMeta.type, relationshipHash);\n            }\n          } else if (relationshipMeta.kind === 'hasMany') {\n            if (!Ember.isNone(relationshipHash)) {\n              data = new Array(relationshipHash.length);\n\n              if (relationshipMeta.options.polymorphic) {\n                for (var i = 0, l = relationshipHash.length; i < l; i++) {\n                  var item = relationshipHash[i];\n                  data[i] = this.extractPolymorphicRelationship(relationshipMeta.type, item, {\n                    key,\n                    resourceHash,\n                    relationshipMeta\n                  });\n                }\n              } else {\n                for (var _i = 0, _l = relationshipHash.length; _i < _l; _i++) {\n                  var _item = relationshipHash[_i];\n                  data[_i] = this.extractRelationship(relationshipMeta.type, _item);\n                }\n              }\n            }\n          }\n\n          relationship = {\n            data\n          };\n        }\n\n        var linkKey = this.keyForLink(key, relationshipMeta.kind);\n\n        if (resourceHash.links && resourceHash.links[linkKey] !== undefined) {\n          var related = resourceHash.links[linkKey];\n          relationship = relationship || {};\n          relationship.links = {\n            related\n          };\n        }\n\n        if (relationship) {\n          relationships[key] = relationship;\n        }\n      });\n      return relationships;\n    },\n\n    /**\n      @method modelNameFromPayloadKey\n      @param {String} key\n      @return {String} the model's modelName\n    */\n    // TODO @deprecated Use modelNameFromPayloadType instead\n    modelNameFromPayloadKey(key) {\n      return (0, _store.normalizeModelName)(key);\n    },\n\n    /**\n      @method normalizeRelationships\n      @private\n    */\n    normalizeRelationships(typeClass, hash) {\n      var payloadKey;\n\n      if (this.keyForRelationship) {\n        typeClass.eachRelationship((key, relationship) => {\n          payloadKey = this.keyForRelationship(key, relationship.kind, 'deserialize');\n\n          if (key === payloadKey) {\n            return;\n          }\n\n          if (hash[payloadKey] === undefined) {\n            return;\n          }\n\n          hash[key] = hash[payloadKey];\n          delete hash[payloadKey];\n        });\n      }\n    },\n\n    /**\n      @method normalizeUsingDeclaredMapping\n      @private\n    */\n    normalizeUsingDeclaredMapping(modelClass, hash) {\n      var attrs = Ember.get(this, 'attrs');\n      var normalizedKey;\n      var payloadKey;\n\n      if (attrs) {\n        for (var key in attrs) {\n          normalizedKey = payloadKey = this._getMappedKey(key, modelClass);\n\n          if (hash[payloadKey] === undefined) {\n            continue;\n          }\n\n          if (Ember.get(modelClass, 'attributes').has(key)) {\n            normalizedKey = this.keyForAttribute(key);\n          }\n\n          if (Ember.get(modelClass, 'relationshipsByName').has(key)) {\n            normalizedKey = this.keyForRelationship(key);\n          }\n\n          if (payloadKey !== normalizedKey) {\n            hash[normalizedKey] = hash[payloadKey];\n            delete hash[payloadKey];\n          }\n        }\n      }\n    },\n\n    /**\n      Looks up the property key that was set by the custom `attr` mapping\n      passed to the serializer.\n       @method _getMappedKey\n      @private\n      @param {String} key\n      @return {String} key\n    */\n    _getMappedKey(key, modelClass) {\n      (true && Ember.warn('There is no attribute or relationship with the name `' + key + '` on `' + modelClass.modelName + '`. Check your serializers attrs hash.', Ember.get(modelClass, 'attributes').has(key) || Ember.get(modelClass, 'relationshipsByName').has(key), {\n        id: 'ds.serializer.no-mapped-attrs-key'\n      }));\n      var attrs = Ember.get(this, 'attrs');\n      var mappedKey;\n\n      if (attrs && attrs[key]) {\n        mappedKey = attrs[key]; //We need to account for both the { title: 'post_title' } and\n        //{ title: { key: 'post_title' }} forms\n\n        if (mappedKey.key) {\n          mappedKey = mappedKey.key;\n        }\n\n        if (typeof mappedKey === 'string') {\n          key = mappedKey;\n        }\n      }\n\n      return key;\n    },\n\n    /**\n      Check attrs.key.serialize property to inform if the `key`\n      can be serialized\n       @method _canSerialize\n      @private\n      @param {String} key\n      @return {boolean} true if the key can be serialized\n    */\n    _canSerialize(key) {\n      var attrs = Ember.get(this, 'attrs');\n      return !attrs || !attrs[key] || attrs[key].serialize !== false;\n    },\n\n    /**\n      When attrs.key.serialize is set to true then\n      it takes priority over the other checks and the related\n      attribute/relationship will be serialized\n       @method _mustSerialize\n      @private\n      @param {String} key\n      @return {boolean} true if the key must be serialized\n    */\n    _mustSerialize(key) {\n      var attrs = Ember.get(this, 'attrs');\n      return attrs && attrs[key] && attrs[key].serialize === true;\n    },\n\n    /**\n      Check if the given hasMany relationship should be serialized\n       By default only many-to-many and many-to-none relationships are serialized.\n      This could be configured per relationship by Serializer's `attrs` object.\n       @method shouldSerializeHasMany\n      @param {Snapshot} snapshot\n      @param {String} key\n      @param {String} relationshipType\n      @return {boolean} true if the hasMany relationship should be serialized\n    */\n    shouldSerializeHasMany(snapshot, key, relationship) {\n      var relationshipType = snapshot.type.determineRelationshipType(relationship, this.store);\n\n      if (this._mustSerialize(key)) {\n        return true;\n      }\n\n      return this._canSerialize(key) && (relationshipType === 'manyToNone' || relationshipType === 'manyToMany');\n    },\n\n    // SERIALIZE\n\n    /**\n      Called when a record is saved in order to convert the\n      record into JSON.\n       By default, it creates a JSON object with a key for\n      each attribute and belongsTo relationship.\n       For example, consider this model:\n       ```app/models/comment.js\n      import Model, { attr, belongsTo } from '@ember-data/model';\n       export default Model.extend({\n        title: attr(),\n        body: attr(),\n         author: belongsTo('user')\n      });\n      ```\n       The default serialization would create a JSON object like:\n       ```javascript\n      {\n        \"title\": \"Rails is unagi\",\n        \"body\": \"Rails? Omakase? O_O\",\n        \"author\": 12\n      }\n      ```\n       By default, attributes are passed through as-is, unless\n      you specified an attribute type (`attr('date')`). If\n      you specify a transform, the JavaScript value will be\n      serialized when inserted into the JSON hash.\n       By default, belongs-to relationships are converted into\n      IDs when inserted into the JSON hash.\n       ## IDs\n       `serialize` takes an options hash with a single option:\n      `includeId`. If this option is `true`, `serialize` will,\n      by default include the ID in the JSON object it builds.\n       The adapter passes in `includeId: true` when serializing\n      a record for `createRecord`, but not for `updateRecord`.\n       ## Customization\n       Your server may expect a different JSON format than the\n      built-in serialization format.\n       In that case, you can implement `serialize` yourself and\n      return a JSON hash of your choosing.\n       ```app/serializers/post.js\n      import JSONSerializer from '@ember-data/serializer/json';\n       export default JSONSerializer.extend({\n        serialize(snapshot, options) {\n          var json = {\n            POST_TTL: snapshot.attr('title'),\n            POST_BDY: snapshot.attr('body'),\n            POST_CMS: snapshot.hasMany('comments', { ids: true })\n          };\n           if (options.includeId) {\n            json.POST_ID_ = snapshot.id;\n          }\n           return json;\n        }\n      });\n      ```\n       ## Customizing an App-Wide Serializer\n       If you want to define a serializer for your entire\n      application, you'll probably want to use `eachAttribute`\n      and `eachRelationship` on the record.\n       ```app/serializers/application.js\n      import JSONSerializer from '@ember-data/serializer/json';\n      import { singularize } from 'ember-inflector';\n       export default JSONSerializer.extend({\n        serialize(snapshot, options) {\n          var json = {};\n           snapshot.eachAttribute(function(name) {\n            json[serverAttributeName(name)] = snapshot.attr(name);\n          });\n           snapshot.eachRelationship(function(name, relationship) {\n            if (relationship.kind === 'hasMany') {\n              json[serverHasManyName(name)] = snapshot.hasMany(name, { ids: true });\n            }\n          });\n           if (options.includeId) {\n            json.ID_ = snapshot.id;\n          }\n           return json;\n        }\n      });\n       function serverAttributeName(attribute) {\n        return attribute.underscore().toUpperCase();\n      }\n       function serverHasManyName(name) {\n        return serverAttributeName(singularize(name)) + \"_IDS\";\n      }\n      ```\n       This serializer will generate JSON that looks like this:\n       ```javascript\n      {\n        \"TITLE\": \"Rails is omakase\",\n        \"BODY\": \"Yep. Omakase.\",\n        \"COMMENT_IDS\": [ 1, 2, 3 ]\n      }\n      ```\n       ## Tweaking the Default JSON\n       If you just want to do some small tweaks on the default JSON,\n      you can call super first and make the tweaks on the returned\n      JSON.\n       ```app/serializers/post.js\n      import JSONSerializer from '@ember-data/serializer/json';\n       export default JSONSerializer.extend({\n        serialize(snapshot, options) {\n          var json = this._super(...arguments);\n           json.subject = json.title;\n          delete json.title;\n           return json;\n        }\n      });\n      ```\n       @method serialize\n      @param {Snapshot} snapshot\n      @param {Object} options\n      @return {Object} json\n    */\n    serialize(snapshot, options) {\n      var json = {};\n\n      if (options && options.includeId) {\n        var id = snapshot.id;\n\n        if (id) {\n          json[Ember.get(this, 'primaryKey')] = id;\n        }\n      }\n\n      snapshot.eachAttribute((key, attribute) => {\n        this.serializeAttribute(snapshot, json, key, attribute);\n      });\n      snapshot.eachRelationship((key, relationship) => {\n        if (relationship.kind === 'belongsTo') {\n          this.serializeBelongsTo(snapshot, json, relationship);\n        } else if (relationship.kind === 'hasMany') {\n          this.serializeHasMany(snapshot, json, relationship);\n        }\n      });\n      return json;\n    },\n\n    /**\n      You can use this method to customize how a serialized record is added to the complete\n      JSON hash to be sent to the server. By default the JSON Serializer does not namespace\n      the payload and just sends the raw serialized JSON object.\n      If your server expects namespaced keys, you should consider using the RESTSerializer.\n      Otherwise you can override this method to customize how the record is added to the hash.\n      The hash property should be modified by reference.\n       For example, your server may expect underscored root objects.\n       ```app/serializers/application.js\n      import RESTSerializer from '@ember-data/serializer/rest';\n      import { decamelize } from '@ember/string';\n       export default RESTSerializer.extend({\n        serializeIntoHash(data, type, snapshot, options) {\n          var root = decamelize(type.modelName);\n          data[root] = this.serialize(snapshot, options);\n        }\n      });\n      ```\n       @method serializeIntoHash\n      @param {Object} hash\n      @param {Model} typeClass\n      @param {Snapshot} snapshot\n      @param {Object} options\n    */\n    serializeIntoHash(hash, typeClass, snapshot, options) {\n      Ember.assign(hash, this.serialize(snapshot, options));\n    },\n\n    /**\n      `serializeAttribute` can be used to customize how `attr`\n      properties are serialized\n       For example if you wanted to ensure all your attributes were always\n      serialized as properties on an `attributes` object you could\n      write:\n       ```app/serializers/application.js\n      import JSONSerializer from '@ember-data/serializer/json';\n       export default JSONSerializer.extend({\n        serializeAttribute(snapshot, json, key, attributes) {\n          json.attributes = json.attributes || {};\n          this._super(snapshot, json.attributes, key, attributes);\n        }\n      });\n      ```\n       @method serializeAttribute\n      @param {Snapshot} snapshot\n      @param {Object} json\n      @param {String} key\n      @param {Object} attribute\n    */\n    serializeAttribute(snapshot, json, key, attribute) {\n      if (this._canSerialize(key)) {\n        var type = attribute.type;\n        var value = snapshot.attr(key);\n\n        if (type) {\n          var transform = this.transformFor(type);\n          value = transform.serialize(value, attribute.options);\n        } // if provided, use the mapping provided by `attrs` in\n        // the serializer\n\n\n        var payloadKey = this._getMappedKey(key, snapshot.type);\n\n        if (payloadKey === key && this.keyForAttribute) {\n          payloadKey = this.keyForAttribute(key, 'serialize');\n        }\n\n        json[payloadKey] = value;\n      }\n    },\n\n    /**\n      `serializeBelongsTo` can be used to customize how `belongsTo`\n      properties are serialized.\n       Example\n       ```app/serializers/post.js\n      import JSONSerializer from '@ember-data/serializer/json';\n      import { isNone } from '@ember/utils';\n       export default JSONSerializer.extend({\n        serializeBelongsTo(snapshot, json, relationship) {\n          var key = relationship.key;\n          var belongsTo = snapshot.belongsTo(key);\n           key = this.keyForRelationship ? this.keyForRelationship(key, \"belongsTo\", \"serialize\") : key;\n           json[key] = isNone(belongsTo) ? belongsTo : belongsTo.record.toJSON();\n        }\n      });\n      ```\n       @method serializeBelongsTo\n      @param {Snapshot} snapshot\n      @param {Object} json\n      @param {Object} relationship\n    */\n    serializeBelongsTo(snapshot, json, relationship) {\n      var key = relationship.key;\n\n      if (this._canSerialize(key)) {\n        var belongsToId = snapshot.belongsTo(key, {\n          id: true\n        }); // if provided, use the mapping provided by `attrs` in\n        // the serializer\n\n        var payloadKey = this._getMappedKey(key, snapshot.type);\n\n        if (payloadKey === key && this.keyForRelationship) {\n          payloadKey = this.keyForRelationship(key, 'belongsTo', 'serialize');\n        } //Need to check whether the id is there for new&async records\n\n\n        if (Ember.isNone(belongsToId)) {\n          json[payloadKey] = null;\n        } else {\n          json[payloadKey] = belongsToId;\n        }\n\n        if (relationship.options.polymorphic) {\n          this.serializePolymorphicType(snapshot, json, relationship);\n        }\n      }\n    },\n\n    /**\n     `serializeHasMany` can be used to customize how `hasMany`\n     properties are serialized.\n      Example\n      ```app/serializers/post.js\n     import JSONSerializer from '@ember-data/serializer/json';\n     import DS from 'ember-data';\n      export default JSONSerializer.extend({\n       serializeHasMany(snapshot, json, relationship) {\n         var key = relationship.key;\n         if (key === 'comments') {\n           return;\n         } else {\n           this._super(...arguments);\n         }\n       }\n     });\n     ```\n      @method serializeHasMany\n     @param {Snapshot} snapshot\n     @param {Object} json\n     @param {Object} relationship\n    */\n    serializeHasMany(snapshot, json, relationship) {\n      var key = relationship.key;\n\n      if (this.shouldSerializeHasMany(snapshot, key, relationship)) {\n        var hasMany = snapshot.hasMany(key, {\n          ids: true\n        });\n\n        if (hasMany !== undefined) {\n          // if provided, use the mapping provided by `attrs` in\n          // the serializer\n          var payloadKey = this._getMappedKey(key, snapshot.type);\n\n          if (payloadKey === key && this.keyForRelationship) {\n            payloadKey = this.keyForRelationship(key, 'hasMany', 'serialize');\n          }\n\n          json[payloadKey] = hasMany; // TODO support for polymorphic manyToNone and manyToMany relationships\n        }\n      }\n    },\n\n    /**\n      You can use this method to customize how polymorphic objects are\n      serialized. Objects are considered to be polymorphic if\n      `{ polymorphic: true }` is pass as the second argument to the\n      `belongsTo` function.\n       Example\n       ```app/serializers/comment.js\n      import JSONSerializer from '@ember-data/serializer/json';\n      import { isNone } from '@ember/utils';\n       export default JSONSerializer.extend({\n        serializePolymorphicType(snapshot, json, relationship) {\n          var key = relationship.key;\n          var belongsTo = snapshot.belongsTo(key);\n           key = this.keyForAttribute ? this.keyForAttribute(key, 'serialize') : key;\n           if (isNone(belongsTo)) {\n            json[key + '_type'] = null;\n          } else {\n            json[key + '_type'] = belongsTo.modelName;\n          }\n        }\n      });\n      ```\n       @method serializePolymorphicType\n      @param {Snapshot} snapshot\n      @param {Object} json\n      @param {Object} relationship\n    */\n    serializePolymorphicType() {},\n\n    /**\n      `extractMeta` is used to deserialize any meta information in the\n      adapter payload. By default Ember Data expects meta information to\n      be located on the `meta` property of the payload object.\n       Example\n       ```app/serializers/post.js\n      import JSONSerializer from '@ember-data/serializer/json';\n       export default JSONSerializer.extend({\n        extractMeta(store, typeClass, payload) {\n          if (payload && payload.hasOwnProperty('_pagination')) {\n            let meta = payload._pagination;\n            delete payload._pagination;\n            return meta;\n          }\n        }\n      });\n      ```\n       @method extractMeta\n      @param {Store} store\n      @param {Model} modelClass\n      @param {Object} payload\n    */\n    extractMeta(store, modelClass, payload) {\n      if (payload && payload['meta'] !== undefined) {\n        var meta = payload.meta;\n        delete payload.meta;\n        return meta;\n      }\n    },\n\n    /**\n      `extractErrors` is used to extract model errors when a call\n      to `Model#save` fails with an `InvalidError`. By default\n      Ember Data expects error information to be located on the `errors`\n      property of the payload object.\n       This serializer expects this `errors` object to be an Array similar\n      to the following, compliant with the https://jsonapi.org/format/#errors specification:\n       ```js\n      {\n        \"errors\": [\n          {\n            \"detail\": \"This username is already taken!\",\n            \"source\": {\n              \"pointer\": \"data/attributes/username\"\n            }\n          }, {\n            \"detail\": \"Doesn't look like a valid email.\",\n            \"source\": {\n              \"pointer\": \"data/attributes/email\"\n            }\n          }\n        ]\n      }\n      ```\n       The key `detail` provides a textual description of the problem.\n      Alternatively, the key `title` can be used for the same purpose.\n       The nested keys `source.pointer` detail which specific element\n      of the request data was invalid.\n       Note that JSON-API also allows for object-level errors to be placed\n      in an object with pointer `data`, signifying that the problem\n      cannot be traced to a specific attribute:\n       ```javascript\n      {\n        \"errors\": [\n          {\n            \"detail\": \"Some generic non property error message\",\n            \"source\": {\n              \"pointer\": \"data\"\n            }\n          }\n        ]\n      }\n      ```\n       When turn into a `Errors` object, you can read these errors\n      through the property `base`:\n       ```handlebars\n      {{#each model.errors.base as |error|}}\n        <div class=\"error\">\n          {{error.message}}\n        </div>\n      {{/each}}\n      ```\n       Example of alternative implementation, overriding the default\n      behavior to deal with a different format of errors:\n       ```app/serializers/post.js\n      import DS from 'ember-data';\n       export default JSONSerializer.extend({\n        extractErrors(store, typeClass, payload, id) {\n          if (payload && typeof payload === 'object' && payload._problems) {\n            payload = payload._problems;\n            this.normalizeErrors(typeClass, payload);\n          }\n          return payload;\n        }\n      });\n      ```\n       @method extractErrors\n      @param {Store} store\n      @param {Model} typeClass\n      @param {Object} payload\n      @param {(String|Number)} id\n      @return {Object} json The deserialized errors\n    */\n    extractErrors(store, typeClass, payload, id) {\n      if (payload && typeof payload === 'object' && payload.errors) {\n        payload = (0, _private.errorsArrayToHash)(payload.errors);\n        this.normalizeUsingDeclaredMapping(typeClass, payload);\n        typeClass.eachAttribute(name => {\n          var key = this.keyForAttribute(name, 'deserialize');\n\n          if (key !== name && payload[key] !== undefined) {\n            payload[name] = payload[key];\n            delete payload[key];\n          }\n        });\n        typeClass.eachRelationship(name => {\n          var key = this.keyForRelationship(name, 'deserialize');\n\n          if (key !== name && payload[key] !== undefined) {\n            payload[name] = payload[key];\n            delete payload[key];\n          }\n        });\n      }\n\n      return payload;\n    },\n\n    /**\n      `keyForAttribute` can be used to define rules for how to convert an\n      attribute name in your model to a key in your JSON.\n       Example\n       ```app/serializers/application.js\n      import JSONSerializer from '@ember-data/serializer/json';\n      import { underscore } from '@ember/string';\n       export default JSONSerializer.extend({\n        keyForAttribute(attr, method) {\n          return underscore(attr).toUpperCase();\n        }\n      });\n      ```\n       @method keyForAttribute\n      @param {String} key\n      @param {String} method\n      @return {String} normalized key\n    */\n    keyForAttribute(key, method) {\n      return key;\n    },\n\n    /**\n      `keyForRelationship` can be used to define a custom key when\n      serializing and deserializing relationship properties. By default\n      `JSONSerializer` does not provide an implementation of this method.\n       Example\n         ```app/serializers/post.js\n        import JSONSerializer from '@ember-data/serializer/json';\n        import { underscore } from '@ember/string';\n         export default JSONSerializer.extend({\n          keyForRelationship(key, relationship, method) {\n            return `rel_${underscore(key)}`;\n          }\n        });\n        ```\n       @method keyForRelationship\n      @param {String} key\n      @param {String} typeClass\n      @param {String} method\n      @return {String} normalized key\n    */\n    keyForRelationship(key, typeClass, method) {\n      return key;\n    },\n\n    /**\n     `keyForLink` can be used to define a custom key when deserializing link\n     properties.\n      @method keyForLink\n     @param {String} key\n     @param {String} kind `belongsTo` or `hasMany`\n     @return {String} normalized key\n    */\n    keyForLink(key, kind) {\n      return key;\n    },\n\n    // HELPERS\n\n    /**\n     @method transformFor\n     @private\n     @param {String} attributeType\n     @param {Boolean} skipAssertion\n     @return {Transform} transform\n    */\n    transformFor(attributeType, skipAssertion) {\n      var transform = Ember.getOwner(this).lookup('transform:' + attributeType);\n      (true && !(skipAssertion || !!transform) && Ember.assert(`Unable to find the transform for \\`attr('${attributeType}')\\``, skipAssertion || !!transform));\n      return transform;\n    }\n\n  });\n\n  var _default = JSONSerializer;\n  _exports.default = _default;\n});","define(\"@ember-data/serializer/rest\", [\"exports\", \"ember-inflector\", \"@ember-data/serializer/json\", \"@ember-data/store/-private\", \"@ember-data/serializer/-private\", \"@ember-data/store\"], function (_exports, _emberInflector, _json, _private, _private2, _store) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"EmbeddedRecordsMixin\", {\n    enumerable: true,\n    get: function () {\n      return _private2.EmbeddedRecordsMixin;\n    }\n  });\n  _exports.default = void 0;\n\n  /**\n    Normally, applications will use the `RESTSerializer` by implementing\n    the `normalize` method.\n  \n    This allows you to do whatever kind of munging you need and is\n    especially useful if your server is inconsistent and you need to\n    do munging differently for many different kinds of responses.\n  \n    See the `normalize` documentation for more information.\n  \n    ## Across the Board Normalization\n  \n    There are also a number of hooks that you might find useful to define\n    across-the-board rules for your payload. These rules will be useful\n    if your server is consistent, or if you're building an adapter for\n    an infrastructure service, like Firebase, and want to encode service\n    conventions.\n  \n    For example, if all of your keys are underscored and all-caps, but\n    otherwise consistent with the names you use in your models, you\n    can implement across-the-board rules for how to convert an attribute\n    name in your model to a key in your JSON.\n  \n    ```app/serializers/application.js\n    import RESTSerializer from '@ember-data/serializer/rest';\n    import { underscore } from '@ember/string';\n  \n    export default RESTSerializer.extend({\n      keyForAttribute(attr, method) {\n        return underscore(attr).toUpperCase();\n      }\n    });\n    ```\n  \n    You can also implement `keyForRelationship`, which takes the name\n    of the relationship as the first parameter, the kind of\n    relationship (`hasMany` or `belongsTo`) as the second parameter, and\n    the method (`serialize` or `deserialize`) as the third parameter.\n  \n    @class RESTSerializer\n    @extends JSONSerializer\n  */\n  var RESTSerializer = _json.default.extend({\n    /**\n     `keyForPolymorphicType` can be used to define a custom key when\n     serializing and deserializing a polymorphic type. By default, the\n     returned key is `${key}Type`.\n      Example\n       ```app/serializers/post.js\n      import RESTSerializer from '@ember-data/serializer/rest';\n       export default RESTSerializer.extend({\n        keyForPolymorphicType(key, relationship) {\n          var relationshipKey = this.keyForRelationship(key);\n           return 'type-' + relationshipKey;\n        }\n      });\n      ```\n      @method keyForPolymorphicType\n     @param {String} key\n     @param {String} typeClass\n     @param {String} method\n     @return {String} normalized key\n    */\n    keyForPolymorphicType(key, typeClass, method) {\n      var relationshipKey = this.keyForRelationship(key);\n      return `${relationshipKey}Type`;\n    },\n\n    /**\n      Normalizes a part of the JSON payload returned by\n      the server. You should override this method, munge the hash\n      and call super if you have generic normalization to do.\n       It takes the type of the record that is being normalized\n      (as a Model class), the property where the hash was\n      originally found, and the hash to normalize.\n       For example, if you have a payload that looks like this:\n       ```js\n      {\n        \"post\": {\n          \"id\": 1,\n          \"title\": \"Rails is omakase\",\n          \"comments\": [ 1, 2 ]\n        },\n        \"comments\": [{\n          \"id\": 1,\n          \"body\": \"FIRST\"\n        }, {\n          \"id\": 2,\n          \"body\": \"Rails is unagi\"\n        }]\n      }\n      ```\n       The `normalize` method will be called three times:\n       * With `App.Post`, `\"posts\"` and `{ id: 1, title: \"Rails is omakase\", ... }`\n      * With `App.Comment`, `\"comments\"` and `{ id: 1, body: \"FIRST\" }`\n      * With `App.Comment`, `\"comments\"` and `{ id: 2, body: \"Rails is unagi\" }`\n       You can use this method, for example, to normalize underscored keys to camelized\n      or other general-purpose normalizations. You will only need to implement\n      `normalize` and manipulate the payload as desired.\n       For example, if the `IDs` under `\"comments\"` are provided as `_id` instead of\n      `id`, you can specify how to normalize just the comments:\n       ```app/serializers/post.js\n      import RESTSerializer from '@ember-data/serializer/rest';\n       export default RESTSerializer.extend({\n        normalize(model, hash, prop) {\n          if (prop === 'comments') {\n            hash.id = hash._id;\n            delete hash._id;\n          }\n           return this._super(...arguments);\n        }\n      });\n      ```\n       On each call to the `normalize` method, the third parameter (`prop`) is always\n      one of the keys that were in the original payload or in the result of another\n      normalization as `normalizeResponse`.\n       @method normalize\n      @param {Model} modelClass\n      @param {Object} resourceHash\n      @param {String} prop\n      @return {Object}\n    */\n\n    /**\n      Normalizes an array of resource payloads and returns a JSON-API Document\n      with primary data and, if any, included data as `{ data, included }`.\n       @method _normalizeArray\n      @param {Store} store\n      @param {String} modelName\n      @param {Object} arrayHash\n      @param {String} prop\n      @return {Object}\n      @private\n    */\n    _normalizeArray(store, modelName, arrayHash, prop) {\n      var documentHash = {\n        data: [],\n        included: []\n      };\n      var modelClass = store.modelFor(modelName);\n      var serializer = store.serializerFor(modelName);\n      Ember.makeArray(arrayHash).forEach(hash => {\n        var {\n          data,\n          included\n        } = this._normalizePolymorphicRecord(store, hash, prop, modelClass, serializer);\n\n        documentHash.data.push(data);\n\n        if (included) {\n          documentHash.included.push(...included);\n        }\n      });\n      return documentHash;\n    },\n\n    _normalizePolymorphicRecord(store, hash, prop, primaryModelClass, primarySerializer) {\n      var serializer = primarySerializer;\n      var modelClass = primaryModelClass;\n      var primaryHasTypeAttribute = (0, _private2.modelHasAttributeOrRelationshipNamedType)(primaryModelClass);\n\n      if (!primaryHasTypeAttribute && hash.type) {\n        // Support polymorphic records in async relationships\n        var modelName = this.modelNameFromPayloadKey(hash.type);\n\n        if (store._hasModelFor(modelName)) {\n          serializer = store.serializerFor(modelName);\n          modelClass = store.modelFor(modelName);\n        }\n      }\n\n      return serializer.normalize(modelClass, hash, prop);\n    },\n\n    /*\n      @method _normalizeResponse\n      @param {Store} store\n      @param {Model} primaryModelClass\n      @param {Object} payload\n      @param {String|Number} id\n      @param {String} requestType\n      @param {Boolean} isSingle\n      @return {Object} JSON-API Document\n      @private\n    */\n    _normalizeResponse(store, primaryModelClass, payload, id, requestType, isSingle) {\n      var documentHash = {\n        data: null,\n        included: []\n      };\n      var meta = this.extractMeta(store, primaryModelClass, payload);\n\n      if (meta) {\n        (true && !(Ember.typeOf(meta) === 'object') && Ember.assert('The `meta` returned from `extractMeta` has to be an object, not \"' + Ember.typeOf(meta) + '\".', Ember.typeOf(meta) === 'object'));\n        documentHash.meta = meta;\n      }\n\n      var keys = Object.keys(payload);\n\n      for (var i = 0, length = keys.length; i < length; i++) {\n        var prop = keys[i];\n        var modelName = prop;\n        var forcedSecondary = false;\n        /*\n          If you want to provide sideloaded records of the same type that the\n          primary data you can do that by prefixing the key with `_`.\n           Example\n           ```\n          {\n            users: [\n              { id: 1, title: 'Tom', manager: 3 },\n              { id: 2, title: 'Yehuda', manager: 3 }\n            ],\n            _users: [\n              { id: 3, title: 'Tomster' }\n            ]\n          }\n          ```\n           This forces `_users` to be added to `included` instead of `data`.\n         */\n\n        if (prop.charAt(0) === '_') {\n          forcedSecondary = true;\n          modelName = prop.substr(1);\n        }\n\n        var typeName = this.modelNameFromPayloadKey(modelName);\n\n        if (!store._hasModelFor(typeName)) {\n          (true && Ember.warn(this.warnMessageNoModelForKey(modelName, typeName), false, {\n            id: 'ds.serializer.model-for-key-missing'\n          }));\n          continue;\n        }\n\n        var isPrimary = !forcedSecondary && this.isPrimaryType(store, typeName, primaryModelClass);\n        var value = payload[prop];\n\n        if (value === null) {\n          continue;\n        }\n\n        if (true\n        /* DEBUG */\n        ) {\n          var isQueryRecordAnArray = requestType === 'queryRecord' && isPrimary && Array.isArray(value);\n          var message = 'The adapter returned an array for the primary data of a `queryRecord` response. This is deprecated as `queryRecord` should return a single record.';\n          (true && !(!isQueryRecordAnArray) && Ember.deprecate(message, !isQueryRecordAnArray, {\n            id: 'ds.serializer.rest.queryRecord-array-response',\n            until: '3.0',\n            url: 'https://deprecations.emberjs.com/ember-data/v2.x/#toc_store-queryrecord-array-response-with-restserializer'\n          }));\n        }\n        /*\n          Support primary data as an object instead of an array.\n           Example\n           ```\n          {\n            user: { id: 1, title: 'Tom', manager: 3 }\n          }\n          ```\n         */\n\n\n        if (isPrimary && !Array.isArray(value)) {\n          var {\n            data: _data,\n            included: _included\n          } = this._normalizePolymorphicRecord(store, value, prop, primaryModelClass, this);\n\n          documentHash.data = _data;\n\n          if (_included) {\n            documentHash.included.push(..._included);\n          }\n\n          continue;\n        }\n\n        var {\n          data,\n          included\n        } = this._normalizeArray(store, typeName, value, prop);\n\n        if (included) {\n          documentHash.included.push(...included);\n        }\n\n        if (isSingle) {\n          data.forEach(resource => {\n            /*\n              Figures out if this is the primary record or not.\n               It's either:\n               1. The record with the same ID as the original request\n              2. If it's a newly created record without an ID, the first record\n                 in the array\n             */\n            var isUpdatedRecord = isPrimary && (0, _private.coerceId)(resource.id) === id;\n            var isFirstCreatedRecord = isPrimary && !id && !documentHash.data;\n\n            if (isFirstCreatedRecord || isUpdatedRecord) {\n              documentHash.data = resource;\n            } else {\n              documentHash.included.push(resource);\n            }\n          });\n        } else {\n          if (isPrimary) {\n            documentHash.data = data;\n          } else {\n            if (data) {\n              documentHash.included.push(...data);\n            }\n          }\n        }\n      }\n\n      return documentHash;\n    },\n\n    isPrimaryType(store, typeName, primaryTypeClass) {\n      return store.modelFor(typeName) === primaryTypeClass;\n    },\n\n    /**\n      This method allows you to push a payload containing top-level\n      collections of records organized per type.\n       ```js\n      {\n        \"posts\": [{\n          \"id\": \"1\",\n          \"title\": \"Rails is omakase\",\n          \"author\", \"1\",\n          \"comments\": [ \"1\" ]\n        }],\n        \"comments\": [{\n          \"id\": \"1\",\n          \"body\": \"FIRST\"\n        }],\n        \"users\": [{\n          \"id\": \"1\",\n          \"name\": \"@d2h\"\n        }]\n      }\n      ```\n       It will first normalize the payload, so you can use this to push\n      in data streaming in from your server structured the same way\n      that fetches and saves are structured.\n       @method pushPayload\n      @param {Store} store\n      @param {Object} payload\n    */\n    pushPayload(store, payload) {\n      var documentHash = {\n        data: [],\n        included: []\n      };\n\n      for (var prop in payload) {\n        var modelName = this.modelNameFromPayloadKey(prop);\n\n        if (!store._hasModelFor(modelName)) {\n          (true && Ember.warn(this.warnMessageNoModelForKey(prop, modelName), false, {\n            id: 'ds.serializer.model-for-key-missing'\n          }));\n          continue;\n        }\n\n        var type = store.modelFor(modelName);\n        var typeSerializer = store.serializerFor(type.modelName);\n        Ember.makeArray(payload[prop]).forEach(hash => {\n          var {\n            data,\n            included\n          } = typeSerializer.normalize(type, hash, prop);\n          documentHash.data.push(data);\n\n          if (included) {\n            documentHash.included.push(...included);\n          }\n        });\n      }\n\n      store.push(documentHash);\n    },\n\n    /**\n      This method is used to convert each JSON root key in the payload\n      into a modelName that it can use to look up the appropriate model for\n      that part of the payload.\n       For example, your server may send a model name that does not correspond with\n      the name of the model in your app. Let's take a look at an example model,\n      and an example payload:\n       ```app/models/post.js\n      import Model from '@ember-data/model';\n       export default Model.extend({\n      });\n      ```\n       ```javascript\n        {\n          \"blog/post\": {\n            \"id\": \"1\n          }\n        }\n      ```\n       Ember Data is going to normalize the payload's root key for the modelName. As a result,\n      it will try to look up the \"blog/post\" model. Since we don't have a model called \"blog/post\"\n      (or a file called app/models/blog/post.js in ember-cli), Ember Data will throw an error\n      because it cannot find the \"blog/post\" model.\n       Since we want to remove this namespace, we can define a serializer for the application that will\n      remove \"blog/\" from the payload key whenver it's encountered by Ember Data:\n       ```app/serializers/application.js\n      import RESTSerializer from '@ember-data/serializer/rest';\n       export default RESTSerializer.extend({\n        modelNameFromPayloadKey(payloadKey) {\n          if (payloadKey === 'blog/post') {\n            return this._super(payloadKey.replace('blog/', ''));\n          } else {\n           return this._super(payloadKey);\n          }\n        }\n      });\n      ```\n       After refreshing, Ember Data will appropriately look up the \"post\" model.\n       By default the modelName for a model is its\n      name in dasherized form. This means that a payload key like \"blogPost\" would be\n      normalized to \"blog-post\" when Ember Data looks up the model. Usually, Ember Data\n      can use the correct inflection to do this for you. Most of the time, you won't\n      need to override `modelNameFromPayloadKey` for this purpose.\n       @method modelNameFromPayloadKey\n      @param {String} key\n      @return {String} the model's modelName\n    */\n    modelNameFromPayloadKey(key) {\n      return (0, _emberInflector.singularize)((0, _store.normalizeModelName)(key));\n    },\n\n    // SERIALIZE\n\n    /**\n      Called when a record is saved in order to convert the\n      record into JSON.\n       By default, it creates a JSON object with a key for\n      each attribute and belongsTo relationship.\n       For example, consider this model:\n       ```app/models/comment.js\n      import Model, { attr, belongsTo } from '@ember-data/model';\n       export default Model.extend({\n        title: attr(),\n        body: attr(),\n         author: belongsTo('user')\n      });\n      ```\n       The default serialization would create a JSON object like:\n       ```js\n      {\n        \"title\": \"Rails is unagi\",\n        \"body\": \"Rails? Omakase? O_O\",\n        \"author\": 12\n      }\n      ```\n       By default, attributes are passed through as-is, unless\n      you specified an attribute type (`attr('date')`). If\n      you specify a transform, the JavaScript value will be\n      serialized when inserted into the JSON hash.\n       By default, belongs-to relationships are converted into\n      IDs when inserted into the JSON hash.\n       ## IDs\n       `serialize` takes an options hash with a single option:\n      `includeId`. If this option is `true`, `serialize` will,\n      by default include the ID in the JSON object it builds.\n       The adapter passes in `includeId: true` when serializing\n      a record for `createRecord`, but not for `updateRecord`.\n       ## Customization\n       Your server may expect a different JSON format than the\n      built-in serialization format.\n       In that case, you can implement `serialize` yourself and\n      return a JSON hash of your choosing.\n       ```app/serializers/post.js\n      import RESTSerializer from '@ember-data/serializer/rest';\n       export default RESTSerializer.extend({\n        serialize(snapshot, options) {\n          var json = {\n            POST_TTL: snapshot.attr('title'),\n            POST_BDY: snapshot.attr('body'),\n            POST_CMS: snapshot.hasMany('comments', { ids: true })\n          };\n           if (options.includeId) {\n            json.POST_ID_ = snapshot.id;\n          }\n           return json;\n        }\n      });\n      ```\n       ## Customizing an App-Wide Serializer\n       If you want to define a serializer for your entire\n      application, you'll probably want to use `eachAttribute`\n      and `eachRelationship` on the record.\n       ```app/serializers/application.js\n      import RESTSerializer from '@ember-data/serializer/rest';\n      import { pluralize } from 'ember-inflector';\n       export default RESTSerializer.extend({\n        serialize(snapshot, options) {\n          var json = {};\n           snapshot.eachAttribute(function(name) {\n            json[serverAttributeName(name)] = snapshot.attr(name);\n          });\n           snapshot.eachRelationship(function(name, relationship) {\n            if (relationship.kind === 'hasMany') {\n              json[serverHasManyName(name)] = snapshot.hasMany(name, { ids: true });\n            }\n          });\n           if (options.includeId) {\n            json.ID_ = snapshot.id;\n          }\n           return json;\n        }\n      });\n       function serverAttributeName(attribute) {\n        return attribute.underscore().toUpperCase();\n      }\n       function serverHasManyName(name) {\n        return serverAttributeName(singularize(name)) + \"_IDS\";\n      }\n      ```\n       This serializer will generate JSON that looks like this:\n       ```js\n      {\n        \"TITLE\": \"Rails is omakase\",\n        \"BODY\": \"Yep. Omakase.\",\n        \"COMMENT_IDS\": [ 1, 2, 3 ]\n      }\n      ```\n       ## Tweaking the Default JSON\n       If you just want to do some small tweaks on the default JSON,\n      you can call super first and make the tweaks on the returned\n      JSON.\n       ```app/serializers/post.js\n      import RESTSerializer from '@ember-data/serializer/rest';\n       export default RESTSerializer.extend({\n        serialize(snapshot, options) {\n          var json = this._super(snapshot, options);\n           json.subject = json.title;\n          delete json.title;\n           return json;\n        }\n      });\n      ```\n       @method serialize\n      @param {Snapshot} snapshot\n      @param {Object} options\n      @return {Object} json\n    */\n    serialize(snapshot, options) {\n      return this._super(...arguments);\n    },\n\n    /**\n      You can use this method to customize the root keys serialized into the JSON.\n      The hash property should be modified by reference (possibly using something like _.extend)\n      By default the REST Serializer sends the modelName of a model, which is a camelized\n      version of the name.\n       For example, your server may expect underscored root objects.\n       ```app/serializers/application.js\n      import RESTSerializer from '@ember-data/serializer/rest';\n      import { decamelize } from '@ember/string';\n       export default RESTSerializer.extend({\n        serializeIntoHash(data, type, record, options) {\n          var root = decamelize(type.modelName);\n          data[root] = this.serialize(record, options);\n        }\n      });\n      ```\n       @method serializeIntoHash\n      @param {Object} hash\n      @param {Model} typeClass\n      @param {Snapshot} snapshot\n      @param {Object} options\n    */\n    serializeIntoHash(hash, typeClass, snapshot, options) {\n      var normalizedRootKey = this.payloadKeyFromModelName(typeClass.modelName);\n      hash[normalizedRootKey] = this.serialize(snapshot, options);\n    },\n\n    /**\n      You can use `payloadKeyFromModelName` to override the root key for an outgoing\n      request. By default, the RESTSerializer returns a camelized version of the\n      model's name.\n       For a model called TacoParty, its `modelName` would be the string `taco-party`. The RESTSerializer\n      will send it to the server with `tacoParty` as the root key in the JSON payload:\n       ```js\n      {\n        \"tacoParty\": {\n          \"id\": \"1\",\n          \"location\": \"Matthew Beale's House\"\n        }\n      }\n      ```\n       For example, your server may expect dasherized root objects:\n       ```app/serializers/application.js\n      import RESTSerializer from '@ember-data/serializer/rest';\n      import { dasherize } from '@ember/string';\n       export default RESTSerializer.extend({\n        payloadKeyFromModelName(modelName) {\n          return dasherize(modelName);\n        }\n      });\n      ```\n       Given a `TacoParty` model, calling `save` on it would produce an outgoing\n      request like:\n       ```js\n      {\n        \"taco-party\": {\n          \"id\": \"1\",\n          \"location\": \"Matthew Beale's House\"\n        }\n      }\n      ```\n       @method payloadKeyFromModelName\n      @param {String} modelName\n      @return {String}\n    */\n    payloadKeyFromModelName(modelName) {\n      return Ember.String.camelize(modelName);\n    },\n\n    /**\n      You can use this method to customize how polymorphic objects are serialized.\n      By default the REST Serializer creates the key by appending `Type` to\n      the attribute and value from the model's camelcased model name.\n       @method serializePolymorphicType\n      @param {Snapshot} snapshot\n      @param {Object} json\n      @param {Object} relationship\n    */\n    serializePolymorphicType(snapshot, json, relationship) {\n      var key = relationship.key;\n      var typeKey = this.keyForPolymorphicType(key, relationship.type, 'serialize');\n      var belongsTo = snapshot.belongsTo(key);\n\n      if (Ember.isNone(belongsTo)) {\n        json[typeKey] = null;\n      } else {\n        json[typeKey] = Ember.String.camelize(belongsTo.modelName);\n      }\n    },\n\n    /**\n      You can use this method to customize how a polymorphic relationship should\n      be extracted.\n       @method extractPolymorphicRelationship\n      @param {Object} relationshipType\n      @param {Object} relationshipHash\n      @param {Object} relationshipOptions\n      @return {Object}\n     */\n    extractPolymorphicRelationship(relationshipType, relationshipHash, relationshipOptions) {\n      var {\n        key,\n        resourceHash,\n        relationshipMeta\n      } = relationshipOptions; // A polymorphic belongsTo relationship can be present in the payload\n      // either in the form where the `id` and the `type` are given:\n      //\n      //   {\n      //     message: { id: 1, type: 'post' }\n      //   }\n      //\n      // or by the `id` and a `<relationship>Type` attribute:\n      //\n      //   {\n      //     message: 1,\n      //     messageType: 'post'\n      //   }\n      //\n      // The next code checks if the latter case is present and returns the\n      // corresponding JSON-API representation. The former case is handled within\n      // the base class JSONSerializer.\n\n      var isPolymorphic = relationshipMeta.options.polymorphic;\n      var typeProperty = this.keyForPolymorphicType(key, relationshipType, 'deserialize');\n\n      if (isPolymorphic && resourceHash[typeProperty] !== undefined && typeof relationshipHash !== 'object') {\n        var type = this.modelNameFromPayloadKey(resourceHash[typeProperty]);\n        return {\n          id: relationshipHash,\n          type: type\n        };\n      }\n\n      return this._super(...arguments);\n    }\n\n  });\n\n  if (true\n  /* DEBUG */\n  ) {\n    RESTSerializer.reopen({\n      warnMessageNoModelForKey(prop, typeKey) {\n        return 'Encountered \"' + prop + '\" in payload, but no model was found for model name \"' + typeKey + '\" (resolved model name using ' + this.constructor.toString() + '.modelNameFromPayloadKey(\"' + prop + '\"))';\n      }\n\n    });\n  }\n\n  var _default = RESTSerializer;\n  _exports.default = _default;\n});","define(\"@ember-data/serializer/transform\", [\"exports\", \"@ember-data/serializer/-private\"], function (_exports, _private) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n    @module @ember-data/serializer\n  */\n  var _default = _private.Transform;\n  _exports.default = _default;\n});","define(\"@ember-data/store/-debug/index\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.instrument = instrument;\n  _exports.assertPolymorphicType = void 0;\n\n  function instrument(method) {\n    return method();\n  }\n  /*\n    Assert that `addedRecord` has a valid type so it can be added to the\n    relationship of the `record`.\n  \n    The assert basically checks if the `addedRecord` can be added to the\n    relationship (specified via `relationshipMeta`) of the `record`.\n  \n    This utility should only be used internally, as both record parameters must\n    be an InternalModel and the `relationshipMeta` needs to be the meta\n    information about the relationship, retrieved via\n    `record.relationshipFor(key)`.\n  \n    @method assertPolymorphicType\n    @param {InternalModel} internalModel\n    @param {RelationshipMeta} relationshipMeta retrieved via\n           `record.relationshipFor(key)`\n    @param {InternalModel} addedRecord record which\n           should be added/set for the relationship\n  */\n\n\n  var assertPolymorphicType;\n  _exports.assertPolymorphicType = assertPolymorphicType;\n\n  if (true\n  /* DEBUG */\n  ) {\n    var checkPolymorphic = function checkPolymorphic(modelClass, addedModelClass) {\n      if (modelClass.__isMixin) {\n        return modelClass.__mixin.detect(addedModelClass.PrototypeMixin) || // handle native class extension e.g. `class Post extends Model.extend(Commentable) {}`\n        modelClass.__mixin.detect(Object.getPrototypeOf(addedModelClass).PrototypeMixin);\n      }\n\n      return addedModelClass.prototype instanceof modelClass || modelClass.detect(addedModelClass);\n    };\n\n    _exports.assertPolymorphicType = assertPolymorphicType = function assertPolymorphicType(parentInternalModel, relationshipMeta, addedInternalModel, store) {\n      var addedModelName = addedInternalModel.modelName;\n      var parentModelName = parentInternalModel.modelName;\n      var key = relationshipMeta.key;\n      var relationshipModelName = relationshipMeta.type;\n      var relationshipClass = store.modelFor(relationshipModelName);\n      var addedClass = store.modelFor(addedInternalModel.modelName);\n      var assertionMessage = `The '${addedModelName}' type does not implement '${relationshipModelName}' and thus cannot be assigned to the '${key}' relationship in '${parentModelName}'. Make it a descendant of '${relationshipModelName}' or use a mixin of the same name.`;\n      (true && !(checkPolymorphic(relationshipClass, addedClass)) && Ember.assert(assertionMessage, checkPolymorphic(relationshipClass, addedClass)));\n    };\n  }\n});","define('@ember-data/store/-private', ['exports', 'require', '@ember-data/store/-debug', 'ember-inflector'], function (exports, require, Debug, emberInflector) { 'use strict';\n\n  var require__default = 'default' in require ? require['default'] : require;\n\n  /**\n    @module @ember-data/store\n  */\n  // All modelNames are dasherized internally. Changing this function may\n  // require changes to other normalization hooks (such as typeForRoot).\n\n  /**\n   This method normalizes a modelName into the format Ember Data uses\n   internally.\n\n    @method normalizeModelName\n    @public\n    @param {String} modelName\n    @return {String} normalizedModelName\n  */\n  function normalizeModelName(modelName) {\n    return Ember.String.dasherize(modelName);\n  }\n\n  /**\n    @module @ember-data/store\n  */\n\n  /**\n   * This symbol provides a Symbol replacement for browsers that do not have it\n   * (eg. IE 11).\n   *\n   * The replacement is different from the native Symbol in some ways. It is a\n   * function that produces an output:\n   * - iterable;\n   * - that is a string, not a symbol.\n   *\n   * @internal\n   */\n  var symbol = typeof Symbol !== 'undefined' ? Symbol : key => `__${key}${Math.floor(Math.random() * Date.now())}__`;\n\n  /**\n    @module @ember-data/store\n  */\n\n  /**\n   * Use this brand to assign a string key to an interface\n   * for mapping the interface to a tightly coupled internal\n   * class implementation.\n   *\n   * This allows us to expose the interface publicly but\n   * seamlessly upgrade these interfaces for our own use\n   * internally when internal methods and properties are\n   * needed.\n   *\n   * @internal\n   */\n\n  var BRAND_SYMBOL = symbol('DEBUG-ts-brand');\n\n  /**\n    @module @ember-data/store\n  */\n\n  /**\n   * Casts a public interface to the matching internal class implementation\n   *\n   * @internal\n   */\n  function upgradeForInternal(external) {\n    return external;\n  }\n\n  /**\n    @module @ember-data/store\n  */\n\n  var DEBUG_CLIENT_ORIGINATED = symbol('record-originated-on-client');\n  var DEBUG_IDENTIFIER_BUCKET = symbol('identifier-bucket');\n\n  /**\n    @module @ember-data/store\n  */\n  // Used by the store to normalize IDs entering the store.  Despite the fact\n  // that developers may provide IDs as numbers (e.g., `store.findRecord('person', 1)`),\n  // it is important that internally we use strings, since IDs may be serialized\n  // and lose type information.  For example, Ember's router may put a record's\n  // ID into the URL, and if we later try to deserialize that URL and find the\n  // corresponding record, we will not know if it is a string or a number.\n  function coerceId(id) {\n    if (id === null || id === undefined || id === '') {\n      return null;\n    }\n\n    if (typeof id === 'string') {\n      return id;\n    }\n\n    if (typeof id === 'symbol') {\n      return id.toString();\n    }\n\n    return '' + id;\n  }\n\n  function ensureStringId(id) {\n    var normalized = null;\n\n    if (typeof id === 'string') {\n      normalized = id.length > 0 ? id : null;\n    } else if (typeof id === 'number' && !isNaN(id)) {\n      normalized = '' + id;\n    }\n\n    if ( normalized === null) {\n      throw new Error(`Expected id to be a string or number, received ${String(id)}`);\n    }\n\n    return normalized;\n  }\n\n  /**\n    @module @ember-data/store\n  */\n  // support IE11\n  var CRYPTO = (() => {\n    var hasWindow = typeof window !== 'undefined';\n    var isFastBoot = typeof FastBoot !== 'undefined';\n\n    if (isFastBoot) {\n      return {\n        getRandomValues(buffer) {\n          try {\n            return FastBoot.require('crypto').randomFillSync(buffer);\n          } catch (err) {\n            throw new Error('Using createRecord in Fastboot requires you to add the \"crypto\" package to \"fastbootDependencies\" in your package.json');\n          }\n        }\n\n      };\n    } else if (hasWindow && typeof window.crypto !== 'undefined') {\n      return window.crypto;\n    } else if (hasWindow && typeof window.msCrypto !== 'undefined' && typeof window.msCrypto.getRandomValues === 'function') {\n      return window.msCrypto;\n    } else {\n      throw new Error('ember-data: Cannot find a valid way to generate local identifiers');\n    }\n  })(); // we might be able to optimize this by requesting more bytes than we need at a time\n\n\n  function rng() {\n    // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n    var rnds8 = new Uint8Array(16);\n    return CRYPTO.getRandomValues(rnds8);\n  }\n  /**\n   * Convert array of 16 byte values to UUID string format of the form:\n   * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n   */\n\n\n  var byteToHex = [];\n\n  for (var i = 0; i < 256; ++i) {\n    byteToHex[i] = (i + 0x100).toString(16).substr(1);\n  }\n\n  function bytesToUuid(buf) {\n    var bth = byteToHex; // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n\n    return [bth[buf[0]], bth[buf[1]], bth[buf[2]], bth[buf[3]], '-', bth[buf[4]], bth[buf[5]], '-', bth[buf[6]], bth[buf[7]], '-', bth[buf[8]], bth[buf[9]], '-', bth[buf[10]], bth[buf[11]], bth[buf[12]], bth[buf[13]], bth[buf[14]], bth[buf[15]]].join('');\n  }\n\n  function uuidv4() {\n    var rnds = rng(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n    rnds[6] = rnds[6] & 0x0f | 0x40;\n    rnds[8] = rnds[8] & 0x3f | 0x80;\n    return bytesToUuid(rnds);\n  }\n\n  /**\n    @module @ember-data/store\n  */\n  var IDENTIFIERS = new WeakMap();\n  function isStableIdentifier(identifier) {\n    return IDENTIFIERS.has(identifier);\n  }\n  function markStableIdentifier(identifier) {\n    IDENTIFIERS.set(identifier, 'is-identifier');\n  }\n  function unmarkStableIdentifier(identifier) {\n    IDENTIFIERS.delete(identifier);\n  }\n\n  function isNonEmptyString(str) {\n    return typeof str === 'string' && str.length > 0;\n  }\n\n  var configuredForgetMethod;\n  var configuredGenerationMethod;\n  var configuredResetMethod;\n  var configuredUpdateMethod;\n  function setIdentifierGenerationMethod(method) {\n    configuredGenerationMethod = method;\n  }\n  function setIdentifierUpdateMethod(method) {\n    configuredUpdateMethod = method;\n  }\n  function setIdentifierForgetMethod(method) {\n    configuredForgetMethod = method;\n  }\n  function setIdentifierResetMethod(method) {\n    configuredResetMethod = method;\n  }\n\n  function defaultGenerationMethod(data, bucket) {\n    if (isNonEmptyString(data.lid)) {\n      return data.lid;\n    }\n\n    var {\n      type,\n      id\n    } = data;\n\n    if (isNonEmptyString(id)) {\n      return `@ember-data:lid-${normalizeModelName(type)}-${id}`;\n    }\n\n    return uuidv4();\n  }\n\n  var IdentifierCaches = new WeakMap();\n  function identifierCacheFor(store) {\n    var cache = IdentifierCaches.get(store);\n\n    if (cache === undefined) {\n      cache = new IdentifierCache();\n      IdentifierCaches.set(store, cache);\n    }\n\n    return cache;\n  }\n\n  function defaultEmptyCallback(...args) {}\n\n  var DEBUG_MAP;\n\n  {\n    DEBUG_MAP = new WeakMap();\n  }\n\n  class IdentifierCache {\n    // Typescript still leaks private properties in the final\n    // compiled class, so we may want to move these from _underscore\n    // to a WeakMap to avoid leaking\n    // currently we leak this for test purposes\n    constructor() {\n      this._cache = {\n        lids: Object.create(null),\n        types: Object.create(null)\n      };\n      this._generate = void 0;\n      this._update = void 0;\n      this._forget = void 0;\n      this._reset = void 0;\n      this._merge = void 0;\n      // we cache the user configuredGenerationMethod at init because it must\n      // be configured prior and is not allowed to be changed\n      this._generate = configuredGenerationMethod || defaultGenerationMethod;\n      this._update = configuredUpdateMethod || defaultEmptyCallback;\n      this._forget = configuredForgetMethod || defaultEmptyCallback;\n      this._reset = configuredResetMethod || defaultEmptyCallback;\n      this._merge = defaultEmptyCallback;\n    }\n    /**\n     * hook to allow management of merge conflicts with identifiers.\n     *\n     * we allow late binding of this private internal merge so that `internalModelFactory`\n     * can insert itself here to handle elimination of duplicates\n     *\n     * @internal\n     */\n\n\n    __configureMerge(method) {\n      this._merge = method || defaultEmptyCallback;\n    }\n    /**\n     * @internal\n     */\n\n\n    _getRecordIdentifier(resource, shouldGenerate = false) {\n      // short circuit if we're already the stable version\n      if (isStableIdentifier(resource)) {\n        {\n          // TODO should we instead just treat this case as a new generation skipping the short circuit?\n          if (!(resource.lid in this._cache.lids) || this._cache.lids[resource.lid] !== resource) {\n            throw new Error(`The supplied identifier ${resource} does not belong to this store instance`);\n          }\n        }\n\n        return resource;\n      } // `type` must always be present\n\n\n      {\n        if (!isNonEmptyString(resource.type)) {\n          throw new Error('resource.type needs to be a string');\n        }\n      }\n\n      var type = normalizeModelName(resource.type);\n      var keyOptions = getTypeIndex(this._cache.types, type);\n      var identifier;\n      var lid = coerceId(resource.lid);\n      var id = coerceId(resource.id); // go straight for the stable RecordIdentifier key'd to `lid`\n\n      if (lid !== null) {\n        identifier = keyOptions.lid[lid];\n      } // we may have not seen this resource before\n      // but just in case we check our own secondary lookup (`id`)\n\n\n      if (identifier === undefined && id !== null) {\n        identifier = keyOptions.id[id];\n      }\n\n      if (identifier === undefined) {\n        // we have definitely not seen this resource before\n        // so we allow the user configured `GenerationMethod` to tell us\n        var newLid = this._generate(resource, 'record'); // we do this _even_ when `lid` is present because secondary lookups\n        // may need to be populated, but we enforce not giving us something\n        // different than expected\n\n\n        if (lid !== null && newLid !== lid) {\n          throw new Error(`You should not change the <lid> of a RecordIdentifier`);\n        } else if (lid === null) {\n          // allow configuration to tell us that we have\n          // seen this `lid` before. E.g. a secondary lookup\n          // connects this resource to a previously seen\n          // resource.\n          identifier = keyOptions.lid[newLid];\n        }\n\n        if (shouldGenerate === true) {\n          if (identifier === undefined) {\n            // if we still don't have an identifier, time to generate one\n            identifier = makeStableRecordIdentifier(id, type, newLid, 'record', false); // populate our unique table\n\n            {\n              // realistically if you hit this it means you changed `type` :/\n              // TODO consider how to handle type change assertions more gracefully\n              if (identifier.lid in this._cache.lids) {\n                throw new Error(`You should not change the <type> of a RecordIdentifier`);\n              }\n            }\n\n            this._cache.lids[identifier.lid] = identifier; // populate our primary lookup table\n            // TODO consider having the `lid` cache be\n            // one level up\n\n            keyOptions.lid[identifier.lid] = identifier; // TODO exists temporarily to support `peekAll`\n            // but likely to move\n\n            keyOptions._allIdentifiers.push(identifier);\n          } // populate our own secondary lookup table\n          // even for the \"successful\" secondary lookup\n          // by `_generate()`, since we missed the cache\n          // previously\n          // we use identifier.id instead of id here\n          // because they may not match and we prefer\n          // what we've set via resource data\n\n\n          if (identifier.id !== null) {\n            keyOptions.id[identifier.id] = identifier; // TODO allow filling out of `id` here\n            // for the `username` non-client created\n            // case.\n          }\n        }\n      }\n\n      return identifier;\n    }\n    /**\n     * allows us to peek without generating when needed\n     * useful for the \"create\" case when we need to see if\n     * we are accidentally overwritting something\n     *\n     * @internal\n     */\n\n\n    peekRecordIdentifier(resource) {\n      return this._getRecordIdentifier(resource, false);\n    }\n    /*\n      Returns the Identifier for the given Resource, creates one if it does not yet exist.\n       Specifically this means that we:\n       - validate the `id` `type` and `lid` combo against known identifiers\n      - return an object with an `lid` that is stable (repeated calls with the same\n        `id` + `type` or `lid` will return the same `lid` value)\n      - this referential stability of the object itself is guaranteed\n    */\n\n\n    getOrCreateRecordIdentifier(resource) {\n      return this._getRecordIdentifier(resource, true);\n    }\n    /*\n     Returns a new Identifier for the supplied data. Call this method to generate\n     an identifier when a new resource is being created local to the client and\n     potentially does not have an `id`.\n      Delegates generation to the user supplied `GenerateMethod` if one has been provided\n     with the signature `generateMethod({ type }, 'record')`.\n     */\n\n\n    createIdentifierForNewRecord(data) {\n      var newLid = this._generate(data, 'record');\n\n      var identifier = makeStableRecordIdentifier(data.id || null, data.type, newLid, 'record', true);\n      var keyOptions = getTypeIndex(this._cache.types, data.type); // populate our unique table\n\n      {\n        if (identifier.lid in this._cache.lids) {\n          throw new Error(`The lid generated for the new record is not unique as it matches an existing identifier`);\n        }\n      }\n\n      this._cache.lids[identifier.lid] = identifier; // populate the type+lid cache\n\n      keyOptions.lid[newLid] = identifier; // ensure a peekAll sees our new identifier too\n      // TODO move this outta here?\n\n      keyOptions._allIdentifiers.push(identifier);\n\n      return identifier;\n    }\n    /*\n     Provides the opportunity to update secondary lookup tables for existing identifiers\n     Called after an identifier created with `createIdentifierForNewRecord` has been\n     committed.\n      Assigned `id` to an `Identifier` if `id` has not previously existed; however,\n     attempting to change the `id` or calling update without providing an `id` when\n     one is missing will throw an error.\n       - sets `id` (if `id` was previously `null`)\n      - `lid` and `type` MUST NOT be altered post creation\n       If a merge occurs, it is possible the returned identifier does not match the originally\n      provided identifier. In this case the abandoned identifier will go through the usual\n      `forgetRecordIdentifier` codepaths.\n    */\n\n\n    updateRecordIdentifier(identifierObject, data) {\n      var identifier = this.getOrCreateRecordIdentifier(identifierObject);\n      var id = identifier.id;\n      var newId = coerceId(data.id);\n      var keyOptions = getTypeIndex(this._cache.types, identifier.type);\n      var existingIdentifier = detectMerge(keyOptions, identifier, data, newId, this._cache.lids);\n\n      if (existingIdentifier) {\n        identifier = this._mergeRecordIdentifiers(keyOptions, identifier, existingIdentifier, data, newId);\n      }\n\n      id = identifier.id;\n      performRecordIdentifierUpdate(identifier, data, this._update);\n      newId = identifier.id; // add to our own secondary lookup table\n\n      if (id !== newId && newId !== null) {\n        var _keyOptions = getTypeIndex(this._cache.types, identifier.type);\n\n        _keyOptions.id[newId] = identifier;\n\n        if (id !== null) {\n          delete _keyOptions.id[id];\n        }\n      }\n\n      return identifier;\n    }\n\n    _mergeRecordIdentifiers(keyOptions, identifier, existingIdentifier, data, newId) {\n      // delegate determining which identifier to keep to the configured MergeMethod\n      var kept = this._merge(identifier, existingIdentifier, data);\n\n      var abandoned = kept === identifier ? existingIdentifier : identifier; // cleanup the identifier we no longer need\n\n      this.forgetRecordIdentifier(abandoned); // ensure a secondary cache entry for this id for the identifier we do keep\n\n      keyOptions.id[newId] = kept; // ensure a secondary cache entry for this id for the abandoned identifier's type we do keep\n\n      var baseKeyOptions = getTypeIndex(this._cache.types, existingIdentifier.type);\n      baseKeyOptions.id[newId] = kept; // make sure that the `lid` on the data we are processing matches the lid we kept\n\n      data.lid = kept.lid;\n      return kept;\n    }\n    /*\n     Provides the opportunity to eliminate an identifier from secondary lookup tables\n     as well as eliminates it from ember-data's own lookup tables and book keeping.\n      Useful when a record has been deleted and the deletion has been persisted and\n     we do not care about the record anymore. Especially useful when an `id` of a\n     deleted record might be reused later for a new record.\n    */\n\n\n    forgetRecordIdentifier(identifierObject) {\n      var identifier = this.getOrCreateRecordIdentifier(identifierObject);\n      var keyOptions = getTypeIndex(this._cache.types, identifier.type);\n\n      if (identifier.id !== null) {\n        delete keyOptions.id[identifier.id];\n      }\n\n      delete this._cache.lids[identifier.lid];\n      delete keyOptions.lid[identifier.lid];\n\n      var index = keyOptions._allIdentifiers.indexOf(identifier);\n\n      keyOptions._allIdentifiers.splice(index, 1);\n\n      unmarkStableIdentifier(identifierObject);\n\n      this._forget(identifier, 'record');\n    }\n\n    destroy() {\n      this._reset();\n    }\n\n  }\n\n  function getTypeIndex(typeMap, type) {\n    var typeIndex = typeMap[type];\n\n    if (typeIndex === undefined) {\n      typeIndex = {\n        lid: Object.create(null),\n        id: Object.create(null),\n        _allIdentifiers: []\n      };\n      typeMap[type] = typeIndex;\n    }\n\n    return typeIndex;\n  }\n\n  function makeStableRecordIdentifier(id, type, lid, bucket, clientOriginated = false) {\n    var recordIdentifier = {\n      lid,\n      id,\n      type\n    };\n    markStableIdentifier(recordIdentifier);\n\n    {\n      // we enforce immutability in dev\n      //  but preserve our ability to do controlled updates to the reference\n      var wrapper = Object.freeze({\n        [DEBUG_CLIENT_ORIGINATED]: clientOriginated,\n        [DEBUG_IDENTIFIER_BUCKET]: bucket,\n\n        get lid() {\n          return recordIdentifier.lid;\n        },\n\n        get id() {\n          return recordIdentifier.id;\n        },\n\n        get type() {\n          return recordIdentifier.type;\n        },\n\n        toString() {\n          var {\n            type,\n            id,\n            lid\n          } = recordIdentifier;\n          return `${clientOriginated ? '[CLIENT_ORIGINATED] ' : ''}${type}:${id} (${lid})`;\n        }\n\n      });\n      markStableIdentifier(wrapper);\n      DEBUG_MAP.set(wrapper, recordIdentifier);\n      return wrapper;\n    }\n  }\n\n  function performRecordIdentifierUpdate(identifier, data, updateFn) {\n    var {\n      id,\n      lid\n    } = data;\n    var type = normalizeModelName(data.type);\n\n    {\n      // get the mutable instance behind our proxy wrapper\n      var wrapper = identifier;\n      identifier = DEBUG_MAP.get(wrapper);\n\n      if (lid !== undefined) {\n        var newLid = coerceId(lid);\n\n        if (newLid !== identifier.lid) {\n          throw new Error(`The 'lid' for a RecordIdentifier cannot be updated once it has been created. Attempted to set lid for '${wrapper}' to '${lid}'.`);\n        }\n      }\n\n      if (id !== undefined) {\n        var newId = coerceId(id);\n\n        if (identifier.id !== null && identifier.id !== newId) {\n          // here we warn and ignore, as this may be a mistake, but we allow the user\n          // to have multiple cache-keys pointing at a single lid so we cannot error\n          ( Ember.warn(`The 'id' for a RecordIdentifier should not be updated once it has been set. Attempted to set id for '${wrapper}' to '${newId}'.`, false, {\n            id: 'ember-data:multiple-ids-for-identifier'\n          }));\n        }\n      } // TODO consider just ignoring here to allow flexible polymorphic support\n\n\n      if (type !== identifier.type) {\n        throw new Error(`The 'type' for a RecordIdentifier cannot be updated once it has been set. Attempted to set type for '${wrapper}' to '${type}'.`);\n      }\n\n      updateFn(wrapper, data, 'record');\n    } // upgrade the ID, this is a \"one time only\" ability\n    // for the multiple-cache-key scenario we \"could\"\n    // use a heuristic to guess the best id for display\n    // (usually when `data.id` is available and `data.attributes` is not)\n\n\n    if (id !== undefined) {\n      identifier.id = coerceId(id);\n    }\n  }\n\n  function detectMerge(keyOptions, identifier, data, newId, lids) {\n    var {\n      id,\n      type,\n      lid\n    } = identifier;\n\n    if (id !== null && id !== newId && newId !== null) {\n      var existingIdentifier = keyOptions.id[newId];\n      return existingIdentifier !== undefined ? existingIdentifier : false;\n    } else {\n      var newType = normalizeModelName(data.type);\n\n      if (id !== null && id === newId && newType === type && data.lid && data.lid !== lid) {\n        var _existingIdentifier = lids[data.lid];\n        return _existingIdentifier !== undefined ? _existingIdentifier : false;\n      }\n    }\n\n    return false;\n  }\n\n  /**\n    @module @ember-data/store\n  */\n\n  /*\n    This file encapsulates the various states that a record can transition\n    through during its lifecycle.\n  */\n\n  /**\n    ### State\n\n    Each record has a `currentState` property that explicitly tracks what\n    state a record is in at any given time. For instance, if a record is\n    newly created and has not yet been sent to the adapter to be saved,\n    it would be in the `root.loaded.created.uncommitted` state.  If a\n    record has had local modifications made to it that are in the\n    process of being saved, the record would be in the\n    `root.loaded.updated.inFlight` state. (This state path will be\n    explained in more detail below.)\n\n    Events are sent by the record or its store to the record's\n    `currentState` property. How the state reacts to these events is\n    dependent on which state it is in. In some states, certain events\n    will be invalid and will cause an exception to be raised.\n\n    States are hierarchical and every state is a sub-state of the\n    `RootState`. For example, a record can be in the\n    `root.deleted.uncommitted` state then transitions into the\n    `root.deleted.inFlight` state. If a child state does not implement\n    an event handler, the state manager will attempt to invoke the event\n    on all parent states until the root state is reached. The state\n    hierarchy of a record is described in terms of a path string. You\n    can determine a record's current state by getting the state's\n    `stateName` property:\n\n    ```javascript\n    record.get('currentState.stateName');\n    //=> \"root.created.uncommitted\"\n     ```\n\n    The hierarchy of valid states that ship with ember data looks like\n    this:\n\n    ```text\n    * root\n      * deleted\n        * saved\n        * uncommitted\n        * inFlight\n      * empty\n      * loaded\n        * created\n          * uncommitted\n          * inFlight\n        * saved\n        * updated\n          * uncommitted\n          * inFlight\n      * loading\n    ```\n\n    The `Model` states are themselves stateless. What that means is\n    that, the hierarchical states that each of *those* points to is a\n    shared data structure. For performance reasons, instead of each\n    record getting its own copy of the hierarchy of states, each record\n    points to this global, immutable shared instance. How does a state\n    know which record it should be acting on? We pass the record\n    instance into the state's event handlers as the first argument.\n\n    The record passed as the first parameter is where you should stash\n    state about the record if needed; you should never store data on the state\n    object itself.\n\n    ### Events and Flags\n\n    A state may implement zero or more events and flags.\n\n    #### Events\n\n    Events are named functions that are invoked when sent to a record. The\n    record will first look for a method with the given name on the\n    current state. If no method is found, it will search the current\n    state's parent, and then its grandparent, and so on until reaching\n    the top of the hierarchy. If the root is reached without an event\n    handler being found, an exception will be raised. This can be very\n    helpful when debugging new features.\n\n    Here's an example implementation of a state with a `myEvent` event handler:\n\n    ```javascript\n    aState: State.create({\n      myEvent: function(manager, param) {\n        console.log(\"Received myEvent with\", param);\n      }\n    })\n    ```\n\n    To trigger this event:\n\n    ```javascript\n    record.send('myEvent', 'foo');\n    //=> \"Received myEvent with foo\"\n    ```\n\n    Note that an optional parameter can be sent to a record's `send()` method,\n    which will be passed as the second parameter to the event handler.\n\n    Events should transition to a different state if appropriate. This can be\n    done by calling the record's `transitionTo()` method with a path to the\n    desired state. The state manager will attempt to resolve the state path\n    relative to the current state. If no state is found at that path, it will\n    attempt to resolve it relative to the current state's parent, and then its\n    parent, and so on until the root is reached. For example, imagine a hierarchy\n    like this:\n\n        * created\n          * uncommitted <-- currentState\n          * inFlight\n        * updated\n          * inFlight\n\n    If we are currently in the `uncommitted` state, calling\n    `transitionTo('inFlight')` would transition to the `created.inFlight` state,\n    while calling `transitionTo('updated.inFlight')` would transition to\n    the `updated.inFlight` state.\n\n    Remember that *only events* should ever cause a state transition. You should\n    never call `transitionTo()` from outside a state's event handler. If you are\n    tempted to do so, create a new event and send that to the state manager.\n\n    #### Flags\n\n    Flags are Boolean values that can be used to introspect a record's current\n    state in a more user-friendly way than examining its state path. For example,\n    instead of doing this:\n\n    ```javascript\n    var statePath = record.get('stateManager.currentPath');\n    if (statePath === 'created.inFlight') {\n      doSomething();\n    }\n    ```\n\n    You can say:\n\n    ```javascript\n    if (record.get('isNew') && record.get('isSaving')) {\n      doSomething();\n    }\n    ```\n\n    If your state does not set a value for a given flag, the value will\n    be inherited from its parent (or the first place in the state hierarchy\n    where it is defined).\n\n    The current set of flags are defined below. If you want to add a new flag,\n    in addition to the area below, you will also need to declare it in the\n    `Model` class.\n\n\n     * [isEmpty](Model/properties/isEmpty?anchor=isEmpty)\n     * [isLoading](Model/properties/isLoading?anchor=isLoading)\n     * [isLoaded](Model/properties/isLoaded?anchor=isLoaded)\n     * [hasDirtyAttributes](Model/properties/hasDirtyAttributes?anchor=hasDirtyAttributes)\n     * [isSaving](Model/properties/isSaving?anchor=isSaving)\n     * [isDeleted](Model/properties/isDeleted?anchor=isDeleted)\n     * [isNew](Model/properties/isNew?anchor=isNew)\n     * [isValid](Model/properties/isValid?anchor=isValid)\n\n    @class RootState\n  */\n  function didSetProperty(internalModel, context) {\n    if (context.isDirty) {\n      internalModel.send('becomeDirty');\n    } else {\n      internalModel.send('propertyWasReset');\n    }\n\n    internalModel.updateRecordArrays();\n  } // Implementation notes:\n  //\n  // Each state has a boolean value for all of the following flags:\n  //\n  // * isLoaded: The record has a populated `data` property. When a\n  //   record is loaded via `store.find`, `isLoaded` is false\n  //   until the adapter sets it. When a record is created locally,\n  //   its `isLoaded` property is always true.\n  // * isDirty: The record has local changes that have not yet been\n  //   saved by the adapter. This includes records that have been\n  //   created (but not yet saved) or deleted.\n  // * isSaving: The record has been committed, but\n  //   the adapter has not yet acknowledged that the changes have\n  //   been persisted to the backend.\n  // * isDeleted: The record was marked for deletion. When `isDeleted`\n  //   is true and `isDirty` is true, the record is deleted locally\n  //   but the deletion was not yet persisted. When `isSaving` is\n  //   true, the change is in-flight. When both `isDirty` and\n  //   `isSaving` are false, the change has persisted.\n  // * isNew: The record was created on the client and the adapter\n  //   did not yet report that it was successfully saved.\n  // * isValid: The adapter did not report any server-side validation\n  //   failures.\n  // The dirty state is a abstract state whose functionality is\n  // shared between the `created` and `updated` states.\n  //\n  // The deleted state shares the `isDirty` flag with the\n  // subclasses of `DirtyState`, but with a very different\n  // implementation.\n  //\n  // Dirty states have three child states:\n  //\n  // `uncommitted`: the store has not yet handed off the record\n  //   to be saved.\n  // `inFlight`: the store has handed off the record to be saved,\n  //   but the adapter has not yet acknowledged success.\n  // `invalid`: the record has invalid information and cannot be\n  //   sent to the adapter yet.\n\n\n  var DirtyState = {\n    initialState: 'uncommitted',\n    // FLAGS\n    isDirty: true,\n    // SUBSTATES\n    // When a record first becomes dirty, it is `uncommitted`.\n    // This means that there are local pending changes, but they\n    // have not yet begun to be saved, and are not invalid.\n    uncommitted: {\n      // EVENTS\n      didSetProperty,\n\n      //TODO(Igor) reloading now triggers a\n      //loadingData event, though it seems fine?\n      loadingData() {},\n\n      propertyWasReset(internalModel, name) {\n        if (!internalModel.hasChangedAttributes()) {\n          internalModel.send('rolledBack');\n        }\n      },\n\n      pushedData(internalModel) {\n        if (!internalModel.hasChangedAttributes()) {\n          internalModel.transitionTo('loaded.saved');\n        }\n      },\n\n      becomeDirty() {},\n\n      willCommit(internalModel) {\n        internalModel.transitionTo('inFlight');\n      },\n\n      reloadRecord(internalModel, {\n        resolve,\n        options\n      }) {\n        resolve(internalModel.store._reloadRecord(internalModel, options));\n      },\n\n      rolledBack(internalModel) {\n        internalModel.transitionTo('loaded.saved');\n        internalModel.triggerLater('rolledBack');\n      },\n\n      becameInvalid(internalModel) {\n        internalModel.transitionTo('invalid');\n      },\n\n      rollback(internalModel) {\n        internalModel.rollbackAttributes();\n        internalModel.triggerLater('ready');\n      }\n\n    },\n    // Once a record has been handed off to the adapter to be\n    // saved, it is in the 'in flight' state. Changes to the\n    // record cannot be made during this window.\n    inFlight: {\n      // FLAGS\n      isSaving: true,\n      // EVENTS\n      didSetProperty,\n\n      becomeDirty() {},\n\n      pushedData() {},\n\n      unloadRecord: assertAgainstUnloadRecord,\n\n      // TODO: More robust semantics around save-while-in-flight\n      willCommit() {},\n\n      didCommit(internalModel) {\n        internalModel.transitionTo('saved');\n        internalModel.send('invokeLifecycleCallbacks', this.dirtyType);\n      },\n\n      rolledBack(internalModel) {\n        internalModel.triggerLater('rolledBack');\n      },\n\n      becameInvalid(internalModel) {\n        internalModel.transitionTo('invalid');\n        internalModel.send('invokeLifecycleCallbacks');\n      },\n\n      becameError(internalModel) {\n        internalModel.transitionTo('uncommitted');\n        internalModel.triggerLater('becameError', internalModel);\n      }\n\n    },\n    // A record is in the `invalid` if the adapter has indicated\n    // the the record failed server-side invalidations.\n    invalid: {\n      // FLAGS\n      isValid: false,\n\n      // EVENTS\n      deleteRecord(internalModel) {\n        internalModel.transitionTo('deleted.uncommitted');\n      },\n\n      didSetProperty(internalModel, context) {\n        internalModel.removeErrorMessageFromAttribute(context.name);\n        didSetProperty(internalModel, context);\n\n        if (!internalModel.hasErrors()) {\n          this.becameValid(internalModel);\n        }\n      },\n\n      becameInvalid() {},\n\n      becomeDirty() {},\n\n      pushedData() {},\n\n      willCommit(internalModel) {\n        internalModel.clearErrorMessages();\n        internalModel.transitionTo('inFlight');\n      },\n\n      rolledBack(internalModel) {\n        internalModel.clearErrorMessages();\n        internalModel.transitionTo('loaded.saved');\n        internalModel.triggerLater('ready');\n      },\n\n      becameValid(internalModel) {\n        internalModel.transitionTo('uncommitted');\n      },\n\n      invokeLifecycleCallbacks(internalModel) {\n        internalModel.triggerLater('becameInvalid', internalModel);\n      }\n\n    }\n  }; // The created and updated states are created outside the state\n  // chart so we can reopen their substates and add mixins as\n  // necessary.\n\n  function deepClone(object) {\n    var clone = {};\n    var value;\n\n    for (var prop in object) {\n      value = object[prop];\n\n      if (value && typeof value === 'object') {\n        clone[prop] = deepClone(value);\n      } else {\n        clone[prop] = value;\n      }\n    }\n\n    return clone;\n  }\n\n  function mixin(original, hash) {\n    for (var prop in hash) {\n      original[prop] = hash[prop];\n    }\n\n    return original;\n  }\n\n  function dirtyState(options) {\n    var newState = deepClone(DirtyState);\n    return mixin(newState, options);\n  }\n\n  var createdState = dirtyState({\n    dirtyType: 'created',\n    // FLAGS\n    isNew: true\n  });\n\n  createdState.invalid.rolledBack = function (internalModel) {\n    internalModel.transitionTo('deleted.saved');\n    internalModel.triggerLater('rolledBack');\n  };\n\n  createdState.uncommitted.rolledBack = function (internalModel) {\n    internalModel.transitionTo('deleted.saved');\n    internalModel.triggerLater('rolledBack');\n  };\n\n  var updatedState = dirtyState({\n    dirtyType: 'updated'\n  });\n\n  function createdStateDeleteRecord(internalModel) {\n    internalModel.transitionTo('deleted.saved');\n    internalModel.send('invokeLifecycleCallbacks');\n  }\n\n  createdState.uncommitted.deleteRecord = createdStateDeleteRecord;\n  createdState.invalid.deleteRecord = createdStateDeleteRecord;\n\n  createdState.uncommitted.rollback = function (internalModel) {\n    DirtyState.uncommitted.rollback.apply(this, arguments);\n    internalModel.transitionTo('deleted.saved');\n  };\n\n  createdState.uncommitted.pushedData = function (internalModel) {\n    internalModel.transitionTo('loaded.updated.uncommitted');\n    internalModel.triggerLater('didLoad');\n  };\n\n  createdState.uncommitted.propertyWasReset = function () {};\n\n  function assertAgainstUnloadRecord(internalModel) {\n    ( Ember.assert('You can only unload a record which is not inFlight. `' + internalModel + '`', false));\n  }\n\n  updatedState.invalid.becameValid = function (internalModel) {\n    // we're eagerly transition into the loaded.saved state, even though we could\n    // be still dirty; but the setup hook of the loaded.saved state checks for\n    // dirty attributes and transitions into the corresponding dirty state\n    internalModel.transitionTo('loaded.saved');\n  };\n\n  updatedState.inFlight.unloadRecord = assertAgainstUnloadRecord;\n\n  updatedState.uncommitted.deleteRecord = function (internalModel) {\n    internalModel.transitionTo('deleted.uncommitted');\n  };\n\n  updatedState.invalid.rolledBack = function (internalModel) {\n    internalModel.clearErrorMessages();\n    internalModel.transitionTo('loaded.saved');\n    internalModel.triggerLater('rolledBack');\n  };\n\n  var RootState = {\n    // FLAGS\n    isEmpty: false,\n    isLoading: false,\n    isLoaded: false,\n    isDirty: false,\n    isSaving: false,\n    isDeleted: false,\n    isNew: false,\n    isValid: true,\n\n    // DEFAULT EVENTS\n    // Trying to roll back if you're not in the dirty state\n    // doesn't change your state. For example, if you're in the\n    // in-flight state, rolling back the record doesn't move\n    // you out of the in-flight state.\n    rolledBack() {},\n\n    unloadRecord(internalModel) {},\n\n    propertyWasReset() {},\n\n    // SUBSTATES\n    // A record begins its lifecycle in the `empty` state.\n    // If its data will come from the adapter, it will\n    // transition into the `loading` state. Otherwise, if\n    // the record is being created on the client, it will\n    // transition into the `created` state.\n    empty: {\n      isEmpty: true,\n\n      // EVENTS\n      loadingData(internalModel, promise) {\n        {\n          internalModel._promiseProxy = promise;\n        }\n\n        internalModel.transitionTo('loading');\n      },\n\n      loadedData(internalModel) {\n        internalModel.transitionTo('loaded.created.uncommitted');\n        internalModel.triggerLater('ready');\n      },\n\n      pushedData(internalModel) {\n        internalModel.transitionTo('loaded.saved');\n        internalModel.triggerLater('didLoad');\n        internalModel.triggerLater('ready');\n      },\n\n      // Record is already in an empty state, triggering transition to empty here\n      // produce an error.\n      notFound() {}\n\n    },\n    // A record enters this state when the store asks\n    // the adapter for its data. It remains in this state\n    // until the adapter provides the requested data.\n    //\n    // Usually, this process is asynchronous, using an\n    // XHR to retrieve the data.\n    loading: {\n      // FLAGS\n      isLoading: true,\n\n      exit(internalModel) {\n        internalModel._promiseProxy = null;\n      },\n\n      loadingData() {},\n\n      // EVENTS\n      pushedData(internalModel) {\n        internalModel.transitionTo('loaded.saved');\n        internalModel.triggerLater('didLoad');\n        internalModel.triggerLater('ready'); //TODO this seems out of place here\n\n        internalModel.didCleanError();\n      },\n\n      becameError(internalModel) {\n        internalModel.triggerLater('becameError', internalModel);\n      },\n\n      notFound(internalModel) {\n        internalModel.transitionTo('empty');\n      }\n\n    },\n    // A record enters this state when its data is populated.\n    // Most of a record's lifecycle is spent inside substates\n    // of the `loaded` state.\n    loaded: {\n      initialState: 'saved',\n      // FLAGS\n      isLoaded: true,\n\n      //TODO(Igor) Reloading now triggers a loadingData event,\n      //but it should be ok?\n      loadingData() {},\n\n      // SUBSTATES\n      // If there are no local changes to a record, it remains\n      // in the `saved` state.\n      saved: {\n        setup(internalModel) {\n          if (internalModel.hasChangedAttributes()) {\n            internalModel.adapterDidDirty();\n          }\n        },\n\n        // EVENTS\n        didSetProperty,\n\n        pushedData() {},\n\n        becomeDirty(internalModel) {\n          internalModel.transitionTo('updated.uncommitted');\n        },\n\n        willCommit(internalModel) {\n          internalModel.transitionTo('updated.inFlight');\n        },\n\n        reloadRecord(internalModel, {\n          resolve,\n          options\n        }) {\n          {\n            resolve(internalModel.store._reloadRecord(internalModel, options));\n          }\n        },\n\n        deleteRecord(internalModel) {\n          internalModel.transitionTo('deleted.uncommitted');\n        },\n\n        unloadRecord(internalModel) {},\n\n        didCommit() {},\n\n        // loaded.saved.notFound would be triggered by a failed\n        // `reload()` on an unchanged record\n        notFound() {}\n\n      },\n      // A record is in this state after it has been locally\n      // created but before the adapter has indicated that\n      // it has been saved.\n      created: createdState,\n      // A record is in this state if it has already been\n      // saved to the server, but there are new local changes\n      // that have not yet been saved.\n      updated: updatedState\n    },\n    // A record is in this state if it was deleted from the store.\n    deleted: {\n      initialState: 'uncommitted',\n      dirtyType: 'deleted',\n      // FLAGS\n      isDeleted: true,\n      isLoaded: true,\n      isDirty: true,\n\n      // TRANSITIONS\n      setup(internalModel) {\n        internalModel.updateRecordArrays();\n      },\n\n      // SUBSTATES\n      // When a record is deleted, it enters the `start`\n      // state. It will exit this state when the record\n      // starts to commit.\n      uncommitted: {\n        // EVENTS\n        willCommit(internalModel) {\n          internalModel.transitionTo('inFlight');\n        },\n\n        rollback(internalModel) {\n          internalModel.rollbackAttributes();\n          internalModel.triggerLater('ready');\n        },\n\n        pushedData() {},\n\n        becomeDirty() {},\n\n        deleteRecord() {},\n\n        rolledBack(internalModel) {\n          internalModel.transitionTo('loaded.saved');\n          internalModel.triggerLater('ready');\n          internalModel.triggerLater('rolledBack');\n        }\n\n      },\n      // After a record starts committing, but\n      // before the adapter indicates that the deletion\n      // has saved to the server, a record is in the\n      // `inFlight` substate of `deleted`.\n      inFlight: {\n        // FLAGS\n        isSaving: true,\n        // EVENTS\n        unloadRecord: assertAgainstUnloadRecord,\n\n        // TODO: More robust semantics around save-while-in-flight\n        willCommit() {},\n\n        didCommit(internalModel) {\n          internalModel.transitionTo('saved');\n          internalModel.send('invokeLifecycleCallbacks');\n        },\n\n        becameError(internalModel) {\n          internalModel.transitionTo('uncommitted');\n          internalModel.triggerLater('becameError', internalModel);\n        },\n\n        becameInvalid(internalModel) {\n          internalModel.transitionTo('invalid');\n          internalModel.triggerLater('becameInvalid', internalModel);\n        }\n\n      },\n      // Once the adapter indicates that the deletion has\n      // been saved, the record enters the `saved` substate\n      // of `deleted`.\n      saved: {\n        // FLAGS\n        isDirty: false,\n\n        setup(internalModel) {\n          internalModel.removeFromInverseRelationships();\n        },\n\n        invokeLifecycleCallbacks(internalModel) {\n          internalModel.triggerLater('didDelete', internalModel);\n          internalModel.triggerLater('didCommit', internalModel);\n        },\n\n        willCommit() {},\n\n        didCommit() {},\n\n        pushedData() {}\n\n      },\n      invalid: {\n        isValid: false,\n\n        didSetProperty(internalModel, context) {\n          internalModel.removeErrorMessageFromAttribute(context.name);\n          didSetProperty(internalModel, context);\n\n          if (!internalModel.hasErrors()) {\n            this.becameValid(internalModel);\n          }\n        },\n\n        becameInvalid() {},\n\n        becomeDirty() {},\n\n        deleteRecord() {},\n\n        willCommit() {},\n\n        rolledBack(internalModel) {\n          internalModel.clearErrorMessages();\n          internalModel.transitionTo('loaded.saved');\n          internalModel.triggerLater('ready');\n        },\n\n        becameValid(internalModel) {\n          internalModel.transitionTo('uncommitted');\n        }\n\n      }\n    },\n\n    invokeLifecycleCallbacks(internalModel, dirtyType) {\n      if (dirtyType === 'created') {\n        internalModel.triggerLater('didCreate', internalModel);\n      } else {\n        internalModel.triggerLater('didUpdate', internalModel);\n      }\n\n      internalModel.triggerLater('didCommit', internalModel);\n    }\n\n  };\n\n  function wireState(object, parent, name) {\n    // TODO: Use Object.create and copy instead\n    object = mixin(parent ? Object.create(parent) : {}, object);\n    object.parentState = parent;\n    object.stateName = name;\n\n    for (var prop in object) {\n      if (!Object.prototype.hasOwnProperty.call(object, prop) || prop === 'parentState' || prop === 'stateName') {\n        continue;\n      }\n\n      if (typeof object[prop] === 'object') {\n        object[prop] = wireState(object[prop], object, name + '.' + prop);\n      }\n    }\n\n    return object;\n  }\n\n  var RootState$1 = wireState(RootState, null, 'root');\n\n  /*\n   * Returns the RecordData instance associated with a given\n   * Model or InternalModel.\n   *\n   * Intentionally \"loose\" to allow anything with an _internalModel\n   * property until InternalModel is eliminated.\n   *\n   * Intentionally not typed to `InternalModel` due to circular dependency\n   *  which that creates.\n   *\n   * Overtime, this should shift to a \"weakmap\" based lookup in the\n   *  \"Ember.getOwner(obj)\" style.\n   */\n  function recordDataFor(instance) {\n    var internalModel = instance._internalModel || instance.internalModel || instance;\n    return internalModel._recordData || null;\n  }\n\n  function relationshipsFor(instance) {\n    var recordData = recordDataFor(instance) || instance;\n    return recordData._relationships;\n  }\n\n  function relationshipStateFor(instance, propertyName) {\n    return relationshipsFor(instance).get(propertyName);\n  }\n  /**\n    @class Snapshot\n    @private\n    @constructor\n    @param {Model} internalModel The model to create a snapshot from\n  */\n\n\n  class Snapshot {\n    constructor(options, identifier, store) {\n      this.__attributes = null;\n      this._belongsToRelationships = Object.create(null);\n      this._belongsToIds = Object.create(null);\n      this._hasManyRelationships = Object.create(null);\n      this._hasManyIds = Object.create(null);\n\n      var internalModel = this._internalModel = store._internalModelForResource(identifier);\n\n      this._store = store;\n      this.modelName = identifier.type;\n      /*\n        If the internalModel does not yet have a record, then we are\n        likely a snapshot being provided to a find request, so we\n        populate __attributes lazily. Else, to preserve the \"moment\n        in time\" in which a snapshot is created, we greedily grab\n        the values.\n       */\n\n\n      if (internalModel.hasRecord) {\n        this._attributes;\n      }\n      /**O\n       The id of the snapshot's underlying record\n        Example\n        ```javascript\n       // store.push('post', { id: 1, author: 'Tomster', title: 'Ember.js rocks' });\n       postSnapshot.id; // => '1'\n       ```\n        @property id\n       @type {String}\n       */\n\n\n      this.id = identifier.id;\n      /**\n       A hash of adapter options\n       @property adapterOptions\n       @type {Object}\n       */\n\n      this.adapterOptions = options.adapterOptions;\n      this.include = options.include;\n      /**\n       The name of the type of the underlying record for this snapshot, as a string.\n        @property modelName\n       @type {String}\n       */\n\n      this.modelName = internalModel.modelName;\n\n      if (internalModel.hasRecord) {\n        this._changedAttributes = recordDataFor(internalModel).changedAttributes();\n      }\n    }\n    /**\n     The underlying record for this snapshot. Can be used to access methods and\n     properties defined on the record.\n      Example\n      ```javascript\n     let json = snapshot.record.toJSON();\n     ```\n      @property record\n     @type {Model}\n     */\n\n\n    get record() {\n      return this._internalModel.getRecord();\n    }\n\n    get _attributes() {\n      var attributes = this.__attributes;\n\n      if (attributes === null) {\n        var record = this.record;\n        attributes = this.__attributes = Object.create(null);\n        var attrs;\n\n        {\n          attrs = Object.keys(this._store._attributesDefinitionFor(this.modelName, record.id));\n        }\n\n        {\n          record.eachAttribute(keyName => attributes[keyName] = Ember.get(record, keyName));\n        }\n      }\n\n      return attributes;\n    }\n    /**\n     The type of the underlying record for this snapshot, as a Model.\n      @property type\n     @type {Model}\n     */\n\n\n    get type() {\n      // TODO @runspired we should deprecate this in favor of modelClass but only once\n      // we've cleaned up the internals enough that a public change to follow suite is\n      // uncontroversial.\n      return this._internalModel.modelClass;\n    }\n\n    get isNew() {\n      {\n        throw new Error('isNew is only available when custom model class ff is on');\n      }\n    }\n    /**\n     Returns the value of an attribute.\n      Example\n      ```javascript\n     // store.push('post', { id: 1, author: 'Tomster', title: 'Ember.js rocks' });\n     postSnapshot.attr('author'); // => 'Tomster'\n     postSnapshot.attr('title'); // => 'Ember.js rocks'\n     ```\n      Note: Values are loaded eagerly and cached when the snapshot is created.\n      @method attr\n     @param {String} keyName\n     @return {Object} The attribute value or undefined\n     */\n\n\n    attr(keyName) {\n      if (keyName in this._attributes) {\n        return this._attributes[keyName];\n      }\n\n      throw new Ember.Error(\"Model '\" + Ember.inspect(this.record) + \"' has no attribute named '\" + keyName + \"' defined.\");\n    }\n    /**\n     Returns all attributes and their corresponding values.\n      Example\n      ```javascript\n     // store.push('post', { id: 1, author: 'Tomster', title: 'Ember.js rocks' });\n     postSnapshot.attributes(); // => { author: 'Tomster', title: 'Ember.js rocks' }\n     ```\n      @method attributes\n     @return {Object} All attributes of the current snapshot\n     */\n\n\n    attributes() {\n      return Ember.assign({}, this._attributes);\n    }\n    /**\n     Returns all changed attributes and their old and new values.\n      Example\n      ```javascript\n     // store.push('post', { id: 1, author: 'Tomster', title: 'Ember.js rocks' });\n     postModel.set('title', 'Ember.js rocks!');\n     postSnapshot.changedAttributes(); // => { title: ['Ember.js rocks', 'Ember.js rocks!'] }\n     ```\n      @method changedAttributes\n     @return {Object} All changed attributes of the current snapshot\n     */\n\n\n    changedAttributes() {\n      var changedAttributes = Object.create(null);\n      var changedAttributeKeys = Object.keys(this._changedAttributes);\n\n      for (var i = 0, length = changedAttributeKeys.length; i < length; i++) {\n        var key = changedAttributeKeys[i];\n        changedAttributes[key] = this._changedAttributes[key].slice();\n      }\n\n      return changedAttributes;\n    }\n    /**\n     Returns the current value of a belongsTo relationship.\n      `belongsTo` takes an optional hash of options as a second parameter,\n     currently supported options are:\n      - `id`: set to `true` if you only want the ID of the related record to be\n     returned.\n      Example\n      ```javascript\n     // store.push('post', { id: 1, title: 'Hello World' });\n     // store.createRecord('comment', { body: 'Lorem ipsum', post: post });\n     commentSnapshot.belongsTo('post'); // => Snapshot\n     commentSnapshot.belongsTo('post', { id: true }); // => '1'\n      // store.push('comment', { id: 1, body: 'Lorem ipsum' });\n     commentSnapshot.belongsTo('post'); // => undefined\n     ```\n      Calling `belongsTo` will return a new Snapshot as long as there's any known\n     data for the relationship available, such as an ID. If the relationship is\n     known but unset, `belongsTo` will return `null`. If the contents of the\n     relationship is unknown `belongsTo` will return `undefined`.\n      Note: Relationships are loaded lazily and cached upon first access.\n      @method belongsTo\n     @param {String} keyName\n     @param {Object} [options]\n     @return {(Snapshot|String|null|undefined)} A snapshot or ID of a known\n     relationship or null if the relationship is known but unset. undefined\n     will be returned if the contents of the relationship is unknown.\n     */\n\n\n    belongsTo(keyName, options) {\n      var id = options && options.id;\n      var relationship;\n      var inverseInternalModel;\n      var result;\n      var store = this._internalModel.store;\n\n      if (id && keyName in this._belongsToIds) {\n        return this._belongsToIds[keyName];\n      }\n\n      if (!id && keyName in this._belongsToRelationships) {\n        return this._belongsToRelationships[keyName];\n      }\n\n      var relationshipMeta = store._relationshipMetaFor(this.modelName, null, keyName);\n\n      if (!(relationshipMeta && relationshipMeta.kind === 'belongsTo')) {\n        throw new Ember.Error(\"Model '\" + Ember.inspect(this.record) + \"' has no belongsTo relationship named '\" + keyName + \"' defined.\");\n      }\n\n      relationship = relationshipStateFor(this, keyName);\n      var value = relationship.getData();\n      var data = value && value.data;\n      inverseInternalModel = data && store._internalModelForResource(data);\n\n      if (value && value.data !== undefined) {\n        if (inverseInternalModel && !inverseInternalModel.isDeleted()) {\n          if (id) {\n            result = Ember.get(inverseInternalModel, 'id');\n          } else {\n            result = inverseInternalModel.createSnapshot();\n          }\n        } else {\n          result = null;\n        }\n      }\n\n      if (id) {\n        this._belongsToIds[keyName] = result;\n      } else {\n        this._belongsToRelationships[keyName] = result;\n      }\n\n      return result;\n    }\n    /**\n     Returns the current value of a hasMany relationship.\n      `hasMany` takes an optional hash of options as a second parameter,\n     currently supported options are:\n      - `ids`: set to `true` if you only want the IDs of the related records to be\n     returned.\n      Example\n      ```javascript\n     // store.push('post', { id: 1, title: 'Hello World', comments: [2, 3] });\n     postSnapshot.hasMany('comments'); // => [Snapshot, Snapshot]\n     postSnapshot.hasMany('comments', { ids: true }); // => ['2', '3']\n      // store.push('post', { id: 1, title: 'Hello World' });\n     postSnapshot.hasMany('comments'); // => undefined\n     ```\n      Note: Relationships are loaded lazily and cached upon first access.\n      @method hasMany\n     @param {String} keyName\n     @param {Object} [options]\n     @return {(Array|undefined)} An array of snapshots or IDs of a known\n     relationship or an empty array if the relationship is known but unset.\n     undefined will be returned if the contents of the relationship is unknown.\n     */\n\n\n    hasMany(keyName, options) {\n      var ids = options && options.ids;\n      var relationship;\n      var results;\n\n      if (ids && keyName in this._hasManyIds) {\n        return this._hasManyIds[keyName];\n      }\n\n      if (!ids && keyName in this._hasManyRelationships) {\n        return this._hasManyRelationships[keyName];\n      }\n\n      var store = this._internalModel.store;\n\n      var relationshipMeta = store._relationshipMetaFor(this.modelName, null, keyName);\n\n      if (!(relationshipMeta && relationshipMeta.kind === 'hasMany')) {\n        throw new Ember.Error(\"Model '\" + Ember.inspect(this.record) + \"' has no hasMany relationship named '\" + keyName + \"' defined.\");\n      }\n\n      relationship = relationshipStateFor(this, keyName);\n      var value = relationship.getData();\n\n      if (value.data) {\n        results = [];\n        value.data.forEach(member => {\n          var internalModel = store._internalModelForResource(member);\n\n          if (!internalModel.isDeleted()) {\n            if (ids) {\n              results.push(member.id);\n            } else {\n              results.push(internalModel.createSnapshot());\n            }\n          }\n        });\n      }\n\n      if (ids) {\n        this._hasManyIds[keyName] = results;\n      } else {\n        this._hasManyRelationships[keyName] = results;\n      }\n\n      return results;\n    }\n    /**\n      Iterates through all the attributes of the model, calling the passed\n      function on each attribute.\n       Example\n       ```javascript\n      snapshot.eachAttribute(function(name, meta) {\n        // ...\n      });\n      ```\n       @method eachAttribute\n      @param {Function} callback the callback to execute\n      @param {Object} [binding] the value to which the callback's `this` should be bound\n    */\n\n\n    eachAttribute(callback, binding) {\n      {\n        this.record.eachAttribute(callback, binding);\n      }\n    }\n    /**\n      Iterates through all the relationships of the model, calling the passed\n      function on each relationship.\n       Example\n       ```javascript\n      snapshot.eachRelationship(function(name, relationship) {\n        // ...\n      });\n      ```\n       @method eachRelationship\n      @param {Function} callback the callback to execute\n      @param {Object} [binding] the value to which the callback's `this` should be bound\n    */\n\n\n    eachRelationship(callback, binding) {\n      {\n        this.record.eachRelationship(callback, binding);\n      }\n    }\n    /**\n      Serializes the snapshot using the serializer for the model.\n       Example\n       ```app/adapters/application.js\n      import Adapter from '@ember-data/adapter';\n       export default Adapter.extend({\n        createRecord(store, type, snapshot) {\n          var data = snapshot.serialize({ includeId: true });\n          var url = `/${type.modelName}`;\n           return fetch(url, {\n            method: 'POST',\n            body: data,\n          }).then((response) => response.json())\n        }\n      });\n      ```\n       @method serialize\n      @param {Object} options\n      @return {Object} an object whose values are primitive JSON values only\n     */\n\n\n    serialize(options) {\n      return this.record.store.serializerFor(this.modelName).serialize(this, options);\n    }\n\n  }\n\n  /**\n    @module @ember-data/store\n  */\n  var INSTANCE_DEPRECATIONS;\n  var lookupDeprecations;\n  var DeprecatedEvented;\n\n  {\n    INSTANCE_DEPRECATIONS = new WeakMap();\n\n    lookupDeprecations = function lookupInstanceDrecations(instance) {\n      var deprecations = INSTANCE_DEPRECATIONS.get(instance);\n\n      if (!deprecations) {\n        deprecations = {};\n        INSTANCE_DEPRECATIONS.set(instance, deprecations);\n      }\n\n      return deprecations;\n    };\n\n    DeprecatedEvented = Ember.Mixin.create(Ember.Evented, {\n      /**\n       * Provides a way to call Evented without logging deprecation warnings\n       * @param {String} name\n       */\n      _has(name) {\n        return Ember.Evented.mixins[0].properties.has.call(this, name);\n      },\n\n      _on() {\n        return Ember.Evented.mixins[0].properties.on.call(this, ...arguments);\n      },\n\n      _deprecateEvented(eventName) {\n        var deprecations = lookupDeprecations(this);\n\n        var _deprecationData = this._getDeprecatedEventedInfo ? `on ${this._getDeprecatedEventedInfo()}` : '';\n\n        var deprecationMessage = _deprecationData ? `Called ${eventName} ${_deprecationData}` : eventName;\n        ( !(deprecations[eventName]) && Ember.deprecate(deprecationMessage, deprecations[eventName], {\n          id: 'ember-data:evented-api-usage',\n          until: '4.0',\n          url: 'https://deprecations.emberjs.com/ember-data/v3.x/#deprecatingrecordlifecycleeventmethods'\n        }));\n        deprecations[eventName] = true;\n      },\n\n      has(name) {\n        this._deprecateEvented(name);\n\n        return this._super(...arguments);\n      },\n\n      off(name, target, method) {\n        this._deprecateEvented(name);\n\n        return this._super(...arguments);\n      },\n\n      on(name, target, method) {\n        this._deprecateEvented(name);\n\n        return this._super(...arguments);\n      },\n\n      one(name, target, method) {\n        this._deprecateEvented(name);\n\n        return this._super(...arguments);\n      },\n\n      trigger(name) {\n        this._deprecateEvented(name);\n\n        return this._super(...arguments);\n      }\n\n    });\n  }\n\n  var DeprecatedEvented$1 =  DeprecatedEvented ;\n\n  /**\n    @module @ember-data/store\n  */\n\n  /*\n    A `PromiseArray` is an object that acts like both an `Ember.Array`\n    and a promise. When the promise is resolved the resulting value\n    will be set to the `PromiseArray`'s `content` property. This makes\n    it easy to create data bindings with the `PromiseArray` that will be\n    updated when the promise resolves.\n\n    For more information see the [Ember.PromiseProxyMixin\n    documentation](/api/classes/Ember.PromiseProxyMixin.html).\n\n    Example\n\n    ```javascript\n    let promiseArray = PromiseArray.create({\n      promise: $.getJSON('/some/remote/data.json')\n    });\n\n    promiseArray.get('length'); // 0\n\n    promiseArray.then(function() {\n      promiseArray.get('length'); // 100\n    });\n    ```\n\n    @class PromiseArray\n    @extends Ember.ArrayProxy\n    @uses Ember.PromiseProxyMixin\n  */\n  var PromiseArray = Ember.ArrayProxy.extend(Ember.PromiseProxyMixin, {\n    meta: Ember.computed.reads('content.meta')\n  });\n  /*\n    A `PromiseObject` is an object that acts like both an `EmberObject`\n    and a promise. When the promise is resolved, then the resulting value\n    will be set to the `PromiseObject`'s `content` property. This makes\n    it easy to create data bindings with the `PromiseObject` that will\n    be updated when the promise resolves.\n\n    For more information see the [Ember.PromiseProxyMixin\n    documentation](/api/classes/Ember.PromiseProxyMixin.html).\n\n    Example\n\n    ```javascript\n    let promiseObject = PromiseObject.create({\n      promise: $.getJSON('/some/remote/data.json')\n    });\n\n    promiseObject.get('name'); // null\n\n    promiseObject.then(function() {\n      promiseObject.get('name'); // 'Tomster'\n    });\n    ```\n\n    @class PromiseObject\n    @extends Ember.ObjectProxy\n    @uses Ember.PromiseProxyMixin\n  */\n\n  var PromiseObject = Ember.ObjectProxy.extend(Ember.PromiseProxyMixin);\n  function promiseObject(promise, label) {\n    return PromiseObject.create({\n      promise: Ember.RSVP.Promise.resolve(promise, label)\n    });\n  }\n  function promiseArray(promise, label) {\n    return PromiseArray.create({\n      promise: Ember.RSVP.Promise.resolve(promise, label)\n    });\n  }\n  var PromiseBelongsTo = PromiseObject.extend({\n    // we don't proxy meta because we would need to proxy it to the relationship state container\n    //  however, meta on relationships does not trigger change notifications.\n    //  if you need relationship meta, you should do `record.belongsTo(relationshipName).meta()`\n    meta: Ember.computed(function () {\n      ( Ember.assert('You attempted to access meta on the promise for the async belongsTo relationship ' + `${this.get('_belongsToState').modelName}:${this.get('_belongsToState').key}'.` + '\\nUse `record.belongsTo(relationshipName).meta()` instead.', false));\n    }),\n\n    reload(options) {\n      ( !(this.get('content') !== undefined) && Ember.assert('You are trying to reload an async belongsTo before it has been created', this.get('content') !== undefined));\n      var {\n        key,\n        store,\n        originatingInternalModel\n      } = this._belongsToState;\n      return store.reloadBelongsTo(this, originatingInternalModel, key, options).then(() => this);\n    }\n\n  });\n  function proxyToContent(method) {\n    return function () {\n      return Ember.get(this, 'content')[method](...arguments);\n    };\n  }\n  /*\n    A PromiseManyArray is a PromiseArray that also proxies certain method calls\n    to the underlying manyArray.\n    Right now we proxy:\n\n      * `reload()`\n      * `createRecord()`\n      * `on()`\n      * `one()`\n      * `trigger()`\n      * `off()`\n      * `has()`\n\n    @class PromiseManyArray\n    @extends Ember.ArrayProxy\n  */\n\n  var PromiseManyArray = PromiseArray.extend({\n    links:  undefined,\n\n    reload(options) {\n      ( !(Ember.get(this, 'content')) && Ember.assert('You are trying to reload an async manyArray before it has been created', Ember.get(this, 'content')));\n      this.set('promise', this.get('content').reload(options));\n      return this;\n    },\n\n    createRecord: proxyToContent('createRecord'),\n    on: proxyToContent('on'),\n    one: proxyToContent('one'),\n    trigger: proxyToContent('trigger'),\n    off: proxyToContent('off'),\n    has: proxyToContent('has')\n  });\n\n  /**\n    @module @ember-data/store\n  */\n  function _bind(fn, ...args) {\n    return function () {\n      return fn.apply(undefined, args);\n    };\n  }\n  function _guard(promise, test) {\n    var guarded = promise.finally(() => {\n      if (!test()) {\n        guarded._subscribers.length = 0;\n      }\n    });\n    return guarded;\n  }\n  function _objectIsAlive(object) {\n    return !(Ember.get(object, 'isDestroyed') || Ember.get(object, 'isDestroying'));\n  }\n  function guardDestroyedStore(promise, store, label) {\n    var token;\n\n    {\n      token = store._trackAsyncRequestStart(label);\n    }\n\n    var wrapperPromise = Ember.RSVP.resolve(promise, label).then(v => promise);\n    return _guard(wrapperPromise, () => {\n      {\n        store._trackAsyncRequestEnd(token);\n      }\n\n      return _objectIsAlive(store);\n    });\n  }\n\n  /**\n    @module @ember-data/store\n  */\n\n  /**\n    @method diffArray\n    @private\n    @param {Array} oldArray the old array\n    @param {Array} newArray the new array\n    @return {hash} {\n        firstChangeIndex: <integer>,  // null if no change\n        addedCount: <integer>,        // 0 if no change\n        removedCount: <integer>       // 0 if no change\n      }\n  */\n  function diffArray(oldArray, newArray) {\n    var oldLength = oldArray.length;\n    var newLength = newArray.length;\n    var shortestLength = Math.min(oldLength, newLength);\n    var firstChangeIndex = null; // null signifies no changes\n    // find the first change\n\n    for (var i = 0; i < shortestLength; i++) {\n      // compare each item in the array\n      if (oldArray[i] !== newArray[i]) {\n        firstChangeIndex = i;\n        break;\n      }\n    }\n\n    if (firstChangeIndex === null && newLength !== oldLength) {\n      // no change found in the overlapping block\n      // and array lengths differ,\n      // so change starts at end of overlap\n      firstChangeIndex = shortestLength;\n    }\n\n    var addedCount = 0;\n    var removedCount = 0;\n\n    if (firstChangeIndex !== null) {\n      // we found a change, find the end of the change\n      var unchangedEndBlockLength = shortestLength - firstChangeIndex; // walk back from the end of both arrays until we find a change\n\n      for (var _i = 1; _i <= shortestLength; _i++) {\n        // compare each item in the array\n        if (oldArray[oldLength - _i] !== newArray[newLength - _i]) {\n          unchangedEndBlockLength = _i - 1;\n          break;\n        }\n      }\n\n      addedCount = newLength - unchangedEndBlockLength - firstChangeIndex;\n      removedCount = oldLength - unchangedEndBlockLength - firstChangeIndex;\n    }\n\n    return {\n      firstChangeIndex,\n      addedCount,\n      removedCount\n    };\n  }\n\n  //import Evented from '@ember/object/evented';\n\n  /**\n    A `ManyArray` is a `MutableArray` that represents the contents of a has-many\n    relationship.\n\n    The `ManyArray` is instantiated lazily the first time the relationship is\n    requested.\n\n    ### Inverses\n\n    Often, the relationships in Ember Data applications will have\n    an inverse. For example, imagine the following models are\n    defined:\n\n    ```app/models/post.js\n    import Model, { hasMany } from '@ember-data/model';\n\n    export default Model.extend({\n      comments: hasMany('comment')\n    });\n    ```\n\n    ```app/models/comment.js\n    import Model, { belongsTo } from '@ember-data/model';\n\n    export default Model.extend({\n      post: belongsTo('post')\n    });\n    ```\n\n    If you created a new instance of `Post` and added\n    a `Comment` record to its `comments` has-many\n    relationship, you would expect the comment's `post`\n    property to be set to the post that contained\n    the has-many.\n\n    We call the record to which a relationship belongs-to the\n    relationship's _owner_.\n\n    @class ManyArray\n    @extends EmberObject\n    @uses Ember.MutableArray, EmberData.DeprecatedEvent\n  */\n  var ManyArray = Ember.Object.extend(Ember.MutableArray, DeprecatedEvented$1, {\n    // here to make TS happy\n    _inverseIsAsync: false,\n    isLoaded: false,\n\n    init() {\n      this._super(...arguments);\n      /**\n      The loading state of this array\n       @property {Boolean} isLoaded\n      */\n\n\n      this.isLoaded = this.isLoaded || false;\n      this.length = 0;\n      /**\n      Used for async `hasMany` arrays\n      to keep track of when they will resolve.\n       @property {Ember.RSVP.Promise} promise\n      @private\n      */\n\n      this.promise = null;\n      /**\n      Metadata associated with the request for async hasMany relationships.\n       Example\n       Given that the server returns the following JSON payload when fetching a\n      hasMany relationship:\n       ```js\n      {\n        \"comments\": [{\n          \"id\": 1,\n          \"comment\": \"This is the first comment\",\n        }, {\n      // ...\n        }],\n         \"meta\": {\n          \"page\": 1,\n          \"total\": 5\n        }\n      }\n      ```\n       You can then access the metadata via the `meta` property:\n       ```js\n      post.get('comments').then(function(comments) {\n        var meta = comments.get('meta');\n       // meta.page => 1\n      // meta.total => 5\n      });\n      ```\n       @property {Object} meta\n      @public\n      */\n      // TODO this is likely broken in our refactor\n\n      this.meta = this.meta || null;\n      /**\n      `true` if the relationship is polymorphic, `false` otherwise.\n       @property {Boolean} isPolymorphic\n      @private\n      */\n\n      this.isPolymorphic = this.isPolymorphic || false;\n      /**\n      The relationship which manages this array.\n       @property {ManyRelationship} relationship\n      @private\n      */\n\n      this.currentState = [];\n      this.flushCanonical(this.initialState, false);\n    },\n\n    // TODO: if(DEBUG)\n    anyUnloaded() {\n      // Use `filter[0]` as opposed to `find` because of IE11\n      var unloaded = this.currentState.filter(im => im._isDematerializing || !im.isLoaded())[0];\n      return !!unloaded;\n    },\n\n    removeUnloadedInternalModel() {\n      for (var i = 0; i < this.currentState.length; ++i) {\n        var internalModel = this.currentState[i];\n        var shouldRemove = void 0;\n\n        {\n          shouldRemove = internalModel._isDematerializing || !internalModel.isLoaded();\n        }\n\n        if (shouldRemove) {\n          this.arrayContentWillChange(i, 1, 0);\n          this.currentState.splice(i, 1);\n          this.set('length', this.currentState.length);\n          this.arrayContentDidChange(i, 1, 0);\n          return true;\n        }\n      }\n\n      return false;\n    },\n\n    objectAt(index) {\n      // TODO we likely need to force flush here\n\n      /*\n      if (this.relationship._willUpdateManyArray) {\n        this.relationship._flushPendingManyArrayUpdates();\n      }\n      */\n      var internalModel = this.currentState[index];\n\n      if (internalModel === undefined) {\n        return;\n      }\n\n      return internalModel.getRecord();\n    },\n\n    flushCanonical(toSet, isInitialized = true) {\n      // It’s possible the parent side of the relationship may have been unloaded by this point\n      if (!_objectIsAlive(this)) {\n        return;\n      } // diff to find changes\n\n\n      var diff = diffArray(this.currentState, toSet);\n\n      if (diff.firstChangeIndex !== null) {\n        // it's null if no change found\n        // we found a change\n        this.arrayContentWillChange(diff.firstChangeIndex, diff.removedCount, diff.addedCount);\n        this.set('length', toSet.length);\n        this.currentState = toSet.slice();\n        this.arrayContentDidChange(diff.firstChangeIndex, diff.removedCount, diff.addedCount);\n\n        if (isInitialized && diff.addedCount > 0) {\n          //notify only on additions\n          //TODO only notify if unloaded\n          this.internalModel.manyArrayRecordAdded(this.get('key'));\n        }\n      }\n    },\n\n    replace(idx, amt, objects) {\n      var internalModels;\n\n      if (amt > 0) {\n        internalModels = this.currentState.slice(idx, idx + amt);\n        this.get('recordData').removeFromHasMany(this.get('key'), internalModels.map(im => recordDataFor(im)));\n      }\n\n      if (objects) {\n        ( !(Array.isArray(objects) || Ember.Array.detect(objects)) && Ember.assert('The third argument to replace needs to be an array.', Array.isArray(objects) || Ember.Array.detect(objects)));\n        this.get('recordData').addToHasMany(this.get('key'), objects.map(obj => recordDataFor(obj)), idx);\n      }\n\n      this.retrieveLatest();\n    },\n\n    // Ok this is kinda funky because if buggy we might lose positions, etc.\n    // but current code is this way so shouldn't be too big of a problem\n    retrieveLatest() {\n      var jsonApi = this.get('recordData').getHasMany(this.get('key')); // TODO this is odd, why should ManyArray ever tell itself to resync?\n\n      var internalModels = this.store._getHasManyByJsonApiResource(jsonApi);\n\n      if (jsonApi.meta) {\n        this.set('meta', jsonApi.meta);\n      }\n\n      this.flushCanonical(internalModels, true);\n    },\n\n    /**\n      Reloads all of the records in the manyArray. If the manyArray\n      holds a relationship that was originally fetched using a links url\n      Ember Data will revisit the original links url to repopulate the\n      relationship.\n       If the manyArray holds the result of a `store.query()` reload will\n      re-run the original query.\n       Example\n       ```javascript\n      var user = store.peekRecord('user', 1)\n      user.login().then(function() {\n        user.get('permissions').then(function(permissions) {\n          return permissions.reload();\n        });\n      });\n      ```\n       @method reload\n      @public\n    */\n    reload(options) {\n      // TODO this is odd, we don't ask the store for anything else like this?\n      return this.get('store').reloadManyArray(this, this.get('internalModel'), this.get('key'), options);\n    },\n\n    /**\n      Saves all of the records in the `ManyArray`.\n       Example\n       ```javascript\n      store.findRecord('inbox', 1).then(function(inbox) {\n        inbox.get('messages').then(function(messages) {\n          messages.forEach(function(message) {\n            message.set('isRead', true);\n          });\n          messages.save()\n        });\n      });\n      ```\n       @method save\n      @return {PromiseArray} promise\n    */\n    save() {\n      var manyArray = this;\n      var promiseLabel = 'DS: ManyArray#save ' + Ember.get(this, 'type');\n      var promise = Ember.RSVP.all(this.invoke('save'), promiseLabel).then(() => manyArray, null, 'DS: ManyArray#save return ManyArray');\n      return PromiseArray.create({\n        promise\n      });\n    },\n\n    /**\n      Create a child record within the owner\n       @method createRecord\n      @private\n      @param {Object} hash\n      @return {Model} record\n    */\n    createRecord(hash) {\n      var store = Ember.get(this, 'store');\n      var type = Ember.get(this, 'type');\n      ( !(!Ember.get(this, 'isPolymorphic')) && Ember.assert(`You cannot add '${type.modelName}' records to this polymorphic relationship.`, !Ember.get(this, 'isPolymorphic')));\n      var record = store.createRecord(type.modelName, hash);\n      this.pushObject(record);\n      return record;\n    }\n\n  });\n\n  /**\n    @module @ember-data/store\n  */\n  var SOURCE_POINTER_REGEXP = /^\\/?data\\/(attributes|relationships)\\/(.*)/;\n  var SOURCE_POINTER_PRIMARY_REGEXP = /^\\/?data/;\n  var PRIMARY_ATTRIBUTE_KEY = 'base';\n  /**\n    Convert an hash of errors into an array with errors in JSON-API format.\n     ```javascript\n    import DS from 'ember-data';\n     const { errorsHashToArray } = DS;\n     let errors = {\n      base: 'Invalid attributes on saving this record',\n      name: 'Must be present',\n      age: ['Must be present', 'Must be a number']\n    };\n     let errorsArray = errorsHashToArray(errors);\n    // [\n    //   {\n    //     title: \"Invalid Document\",\n    //     detail: \"Invalid attributes on saving this record\",\n    //     source: { pointer: \"/data\" }\n    //   },\n    //   {\n    //     title: \"Invalid Attribute\",\n    //     detail: \"Must be present\",\n    //     source: { pointer: \"/data/attributes/name\" }\n    //   },\n    //   {\n    //     title: \"Invalid Attribute\",\n    //     detail: \"Must be present\",\n    //     source: { pointer: \"/data/attributes/age\" }\n    //   },\n    //   {\n    //     title: \"Invalid Attribute\",\n    //     detail: \"Must be a number\",\n    //     source: { pointer: \"/data/attributes/age\" }\n    //   }\n    // ]\n    ```\n    @method errorsHashToArray\n    @public\n    @param {Object} errors hash with errors as properties\n    @return {Array} array of errors in JSON-API format\n  */\n\n  function errorsHashToArray(errors) {\n    var out = [];\n\n    if (Ember.isPresent(errors)) {\n      Object.keys(errors).forEach(key => {\n        var messages = Ember.makeArray(errors[key]);\n\n        for (var i = 0; i < messages.length; i++) {\n          var title = 'Invalid Attribute';\n          var pointer = `/data/attributes/${key}`;\n\n          if (key === PRIMARY_ATTRIBUTE_KEY) {\n            title = 'Invalid Document';\n            pointer = `/data`;\n          }\n\n          out.push({\n            title: title,\n            detail: messages[i],\n            source: {\n              pointer: pointer\n            }\n          });\n        }\n      });\n    }\n\n    return out;\n  }\n  /**\n    Convert an array of errors in JSON-API format into an object.\n\n    ```javascript\n    import DS from 'ember-data';\n\n    const { errorsArrayToHash } = DS;\n\n    let errorsArray = [\n      {\n        title: 'Invalid Attribute',\n        detail: 'Must be present',\n        source: { pointer: '/data/attributes/name' }\n      },\n      {\n        title: 'Invalid Attribute',\n        detail: 'Must be present',\n        source: { pointer: '/data/attributes/age' }\n      },\n      {\n        title: 'Invalid Attribute',\n        detail: 'Must be a number',\n        source: { pointer: '/data/attributes/age' }\n      }\n    ];\n\n    let errors = errorsArrayToHash(errorsArray);\n    // {\n    //   \"name\": [\"Must be present\"],\n    //   \"age\":  [\"Must be present\", \"must be a number\"]\n    // }\n    ```\n\n    @method errorsArrayToHash\n    @public\n    @param {Array} errors array of errors in JSON-API format\n    @return {Object}\n  */\n\n  function errorsArrayToHash(errors) {\n    var out = {};\n\n    if (Ember.isPresent(errors)) {\n      errors.forEach(error => {\n        if (error.source && error.source.pointer) {\n          var key = error.source.pointer.match(SOURCE_POINTER_REGEXP);\n\n          if (key) {\n            key = key[2];\n          } else if (error.source.pointer.search(SOURCE_POINTER_PRIMARY_REGEXP) !== -1) {\n            key = PRIMARY_ATTRIBUTE_KEY;\n          }\n\n          if (key) {\n            out[key] = out[key] || [];\n            out[key].push(error.detail || error.title);\n          }\n        }\n      });\n    }\n\n    return out;\n  }\n\n  /**\n    @module @ember-data/store\n  */\n\n  /**\n    @class SnapshotRecordArray\n    @private\n    @constructor\n    @param {Array} snapshots An array of snapshots\n    @param {Object} meta\n  */\n  class SnapshotRecordArray {\n    constructor(recordArray, meta, options = {}) {\n      /**\n        An array of snapshots\n        @private\n        @property _snapshots\n        @type {Array}\n      */\n      this._snapshots = null;\n      /**\n        An array of records\n        @private\n        @property _recordArray\n        @type {Array}\n      */\n\n      this._recordArray = recordArray;\n      /**\n        Number of records in the array\n         Example\n         ```app/adapters/post.js\n        import JSONAPIAdapter from '@ember-data/adapter/json-api';\n         export default JSONAPIAdapter.extend({\n          shouldReloadAll(store, snapshotRecordArray) {\n            return !snapshotRecordArray.length;\n          },\n        });\n        ```\n         @property length\n        @type {Number}\n      */\n\n      this.length = recordArray.get('length');\n      this._type = null;\n      /**\n        Meta objects for the record array.\n         Example\n         ```app/adapters/post.js\n        import JSONAPIAdapter from '@ember-data/adapter/json-api';\n         export default JSONAPIAdapter.extend({\n          shouldReloadAll(store, snapshotRecordArray) {\n            var lastRequestTime = snapshotRecordArray.meta.lastRequestTime;\n            var twentyMinutes = 20 * 60 * 1000;\n            return Date.now() > lastRequestTime + twentyMinutes;\n          },\n        });\n        ```\n         @property meta\n        @type {Object}\n      */\n\n      this.meta = meta;\n      /**\n        A hash of adapter options passed into the store method for this request.\n         Example\n         ```app/adapters/post.js\n        import MyCustomAdapter from './custom-adapter';\n         export default MyCustomAdapter.extend({\n          findAll(store, type, sinceToken, snapshotRecordArray) {\n            if (snapshotRecordArray.adapterOptions.subscribe) {\n              // ...\n            }\n            // ...\n          }\n        });\n        ```\n         @property adapterOptions\n        @type {Object}\n      */\n\n      this.adapterOptions = options.adapterOptions;\n      /**\n        The relationships to include for this request.\n         Example\n         ```app/adapters/application.js\n        import Adapter from '@ember-data/adapter';\n         export default Adapter.extend({\n          findAll(store, type, snapshotRecordArray) {\n            var url = `/${type.modelName}?include=${encodeURIComponent(snapshotRecordArray.include)}`;\n             return fetch(url).then((response) => response.json())\n          }\n        });\n        ```\n         @property include\n        @type {String|Array}\n      */\n\n      this.include = options.include;\n    }\n    /**\n      The type of the underlying records for the snapshots in the array, as a Model\n      @property type\n      @type {Model}\n    */\n\n\n    get type() {\n      return this._type || (this._type = this._recordArray.get('type'));\n    }\n    /**\n      The modelName of the underlying records for the snapshots in the array, as a Model\n      @property type\n      @type {Model}\n    */\n\n\n    get modelName() {\n      return this._recordArray.modelName;\n    }\n    /**\n      Get snapshots of the underlying record array\n       Example\n       ```app/adapters/post.js\n      import JSONAPIAdapter from '@ember-data/adapter/json-api';\n       export default JSONAPIAdapter.extend({\n        shouldReloadAll(store, snapshotArray) {\n          var snapshots = snapshotArray.snapshots();\n           return snapshots.any(function(ticketSnapshot) {\n            var timeDiff = moment().diff(ticketSnapshot.attr('lastAccessedAt'), 'minutes');\n            if (timeDiff > 20) {\n              return true;\n            } else {\n              return false;\n            }\n          });\n        }\n      });\n      ```\n       @method snapshots\n      @return {Array} Array of snapshots\n    */\n\n\n    snapshots() {\n      if (this._snapshots !== null) {\n        return this._snapshots;\n      }\n\n      this._snapshots = this._recordArray._takeSnapshot();\n      return this._snapshots;\n    }\n\n  }\n\n  /**\n    @module @ember-data/store\n  */\n  /**\n    A record array is an array that contains records of a certain modelName. The record\n    array materializes records as needed when they are retrieved for the first\n    time. You should not create record arrays yourself. Instead, an instance of\n    `RecordArray` or its subclasses will be returned by your application's store\n    in response to queries.\n\n    @class RecordArray\n    @extends ArrayProxy\n    @uses Ember.Evented\n  */\n\n  var RecordArray = Ember.ArrayProxy.extend(DeprecatedEvented$1, {\n    init() {\n      this._super(...arguments);\n\n      {\n        this._getDeprecatedEventedInfo = () => `RecordArray containing ${this.modelName}`;\n      }\n      /**\n        The array of client ids backing the record array. When a\n        record is requested from the record array, the record\n        for the client id at the same index is materialized, if\n        necessary, by the store.\n         @property content\n        @private\n        @type Ember.Array\n        */\n\n\n      this.set('content', this.content || null);\n      /**\n      The flag to signal a `RecordArray` is finished loading data.\n       Example\n       ```javascript\n      var people = store.peekAll('person');\n      people.get('isLoaded'); // true\n      ```\n       @property isLoaded\n      @type Boolean\n      */\n\n      this.isLoaded = this.isLoaded || false;\n      /**\n      The flag to signal a `RecordArray` is currently loading data.\n       Example\n       ```javascript\n      var people = store.peekAll('person');\n      people.get('isUpdating'); // false\n      people.update();\n      people.get('isUpdating'); // true\n      ```\n       @property isUpdating\n      @type Boolean\n      */\n\n      this.isUpdating = false;\n      /**\n      The store that created this record array.\n       @property store\n      @private\n      @type Store\n      */\n\n      this.store = this.store || null;\n      this._updatingPromise = null;\n    },\n\n    replace() {\n      throw new Error(`The result of a server query (for all ${this.modelName} types) is immutable. To modify contents, use toArray()`);\n    },\n\n    /**\n     The modelClass represented by this record array.\n      @property type\n     @type Model\n     */\n    type: Ember.computed('modelName', function () {\n      if (!this.modelName) {\n        return null;\n      }\n\n      return this.store.modelFor(this.modelName);\n    }).readOnly(),\n\n    /**\n      Retrieves an object from the content by index.\n       @method objectAtContent\n      @private\n      @param {Number} index\n      @return {Model} record\n    */\n    objectAtContent(index) {\n      var internalModel = Ember.get(this, 'content').objectAt(index);\n      return internalModel && internalModel.getRecord();\n    },\n\n    /**\n      Used to get the latest version of all of the records in this array\n      from the adapter.\n       Example\n       ```javascript\n      var people = store.peekAll('person');\n      people.get('isUpdating'); // false\n       people.update().then(function() {\n        people.get('isUpdating'); // false\n      });\n       people.get('isUpdating'); // true\n      ```\n       @method update\n    */\n    update() {\n      if (Ember.get(this, 'isUpdating')) {\n        return this._updatingPromise;\n      }\n\n      this.set('isUpdating', true);\n\n      var updatingPromise = this._update().finally(() => {\n        this._updatingPromise = null;\n\n        if (this.get('isDestroying') || this.get('isDestroyed')) {\n          return;\n        }\n\n        this.set('isUpdating', false);\n      });\n\n      this._updatingPromise = updatingPromise;\n      return updatingPromise;\n    },\n\n    /*\n      Update this RecordArray and return a promise which resolves once the update\n      is finished.\n     */\n    _update() {\n      return this.store.findAll(this.modelName, {\n        reload: true\n      });\n    },\n\n    /**\n      Adds an internal model to the `RecordArray` without duplicates\n       @method _pushInternalModels\n      @private\n      @param {InternalModel} internalModel\n    */\n    _pushInternalModels(internalModels) {\n      // pushObjects because the internalModels._recordArrays set was already\n      // consulted for inclusion, so addObject and its on .contains call is not\n      // required.\n      Ember.get(this, 'content').pushObjects(internalModels);\n    },\n\n    /**\n      Removes an internalModel to the `RecordArray`.\n       @method removeInternalModel\n      @private\n      @param {InternalModel} internalModel\n    */\n    _removeInternalModels(internalModels) {\n      Ember.get(this, 'content').removeObjects(internalModels);\n    },\n\n    /**\n      Saves all of the records in the `RecordArray`.\n       Example\n       ```javascript\n      var messages = store.peekAll('message');\n      messages.forEach(function(message) {\n        message.set('hasBeenSeen', true);\n      });\n      messages.save();\n      ```\n       @method save\n      @return {PromiseArray} promise\n    */\n    save() {\n      var promiseLabel = `DS: RecordArray#save ${this.modelName}`;\n      var promise = Ember.RSVP.Promise.all(this.invoke('save'), promiseLabel).then(() => this, null, 'DS: RecordArray#save return RecordArray');\n      return PromiseArray.create({\n        promise\n      });\n    },\n\n    _dissociateFromOwnRecords() {\n      this.get('content').forEach(internalModel => {\n        var recordArrays = internalModel.__recordArrays;\n\n        if (recordArrays) {\n          recordArrays.delete(this);\n        }\n      });\n    },\n\n    /**\n      @method _unregisterFromManager\n      @private\n    */\n    _unregisterFromManager() {\n      this.manager.unregisterRecordArray(this);\n    },\n\n    willDestroy() {\n      this._unregisterFromManager();\n\n      this._dissociateFromOwnRecords(); // TODO: we should not do work during destroy:\n      //   * when objects are destroyed, they should simply be left to do\n      //   * if logic errors do to this, that logic needs to be more careful during\n      //    teardown (ember provides isDestroying/isDestroyed) for this reason\n      //   * the exception being: if an dominator has a reference to this object,\n      //     and must be informed to release e.g. e.g. removing itself from th\n      //     recordArrayMananger\n\n\n      Ember.set(this, 'content', null);\n      Ember.set(this, 'length', 0);\n\n      this._super(...arguments);\n    },\n\n    /*\n      @method _createSnapshot\n      @private\n    */\n    _createSnapshot(options) {\n      // this is private for users, but public for ember-data internals\n      return new SnapshotRecordArray(this, this.get('meta'), options);\n    },\n\n    /*\n      @method _takeSnapshot\n      @private\n    */\n    _takeSnapshot() {\n      return Ember.get(this, 'content').map(internalModel => internalModel.createSnapshot());\n    }\n\n  });\n\n  function isResourceIdentiferWithRelatedLinks(value) {\n    return value && value.links && value.links.related;\n  }\n  /**\n    This is the baseClass for the different References\n    like RecordReference/HasManyReference/BelongsToReference\n\n   @class Reference\n   */\n\n\n  class Reference {\n    constructor(store, internalModel) {\n      this.store = store;\n      this.internalModel = internalModel;\n      this.recordData = void 0;\n      this.recordData = recordDataFor(this);\n    }\n\n    _resource() {}\n    /**\n     This returns a string that represents how the reference will be\n     looked up when it is loaded. If the relationship has a link it will\n     use the \"link\" otherwise it defaults to \"id\".\n      Example\n      ```app/models/post.js\n     import Model, { hasMany } from '@ember-data/model';\n      export default Model.extend({\n       comments: hasMany({ async: true })\n     });\n     ```\n      ```javascript\n     let post = store.push({\n       data: {\n         type: 'post',\n         id: 1,\n         relationships: {\n           comments: {\n             data: [{ type: 'comment', id: 1 }]\n           }\n         }\n       }\n     });\n      let commentsRef = post.hasMany('comments');\n      // get the identifier of the reference\n     if (commentsRef.remoteType() === \"ids\") {\n       let ids = commentsRef.ids();\n     } else if (commentsRef.remoteType() === \"link\") {\n       let link = commentsRef.link();\n     }\n     ```\n      @method remoteType\n     @return {String} The name of the remote type. This should either be \"link\" or \"ids\"\n     */\n\n\n    remoteType() {\n      var value = this._resource();\n\n      if (isResourceIdentiferWithRelatedLinks(value)) {\n        return 'link';\n      }\n\n      return 'id';\n    }\n    /**\n     The link Ember Data will use to fetch or reload this belongs-to\n     relationship.\n      Example\n      ```javascript\n     // models/blog.js\n     import Model, { belongsTo } from '@ember-data/model';\n     export default Model.extend({\n        user: belongsTo({ async: true })\n      });\n      let blog = store.push({\n        data: {\n          type: 'blog',\n          id: 1,\n          relationships: {\n            user: {\n              links: {\n                related: '/articles/1/author'\n              }\n            }\n          }\n        }\n      });\n     let userRef = blog.belongsTo('user');\n      // get the identifier of the reference\n     if (userRef.remoteType() === \"link\") {\n        let link = userRef.link();\n      }\n     ```\n      @method link\n     @return {String} The link Ember Data will use to fetch or reload this belongs-to relationship.\n     */\n\n\n    link() {\n      var link;\n\n      var resource = this._resource();\n\n      if (isResourceIdentiferWithRelatedLinks(resource)) {\n        if (resource.links) {\n          link = resource.links.related;\n          link = !link || typeof link === 'string' ? link : link.href;\n        }\n      }\n\n      return link || null;\n    }\n    /**\n     The meta data for the belongs-to relationship.\n      Example\n      ```javascript\n     // models/blog.js\n     import Model, { belongsTo } from '@ember-data/model';\n     export default Model.extend({\n        user: belongsTo({ async: true })\n      });\n      let blog = store.push({\n        data: {\n          type: 'blog',\n          id: 1,\n          relationships: {\n            user: {\n              links: {\n                related: {\n                  href: '/articles/1/author'\n                },\n                meta: {\n                  lastUpdated: 1458014400000\n                }\n              }\n            }\n          }\n        }\n      });\n      let userRef = blog.belongsTo('user');\n      userRef.meta() // { lastUpdated: 1458014400000 }\n     ```\n      @method meta\n     @return {Object} The meta information for the belongs-to relationship.\n     */\n\n\n    meta() {\n      var meta = null;\n\n      var resource = this._resource();\n\n      if (resource && resource.meta && typeof resource.meta === 'object') {\n        meta = resource.meta;\n      }\n\n      return meta;\n    }\n\n  }\n\n  /**\n    @module @ember-data/store\n  */\n\n  /**\n     A `RecordReference` is a low-level API that allows users and\n     addon authors to perform meta-operations on a record.\n\n     @class RecordReference\n     @extends Reference\n  */\n  class RecordReference extends Reference {\n    constructor(...args) {\n      super(...args);\n      this.type = this.internalModel.modelName;\n    }\n\n    get _id() {\n      return this.internalModel.id;\n    }\n    /**\n       The `id` of the record that this reference refers to.\n        Together, the `type` and `id` properties form a composite key for\n       the identity map.\n        Example\n        ```javascript\n       let userRef = store.getReference('user', 1);\n        userRef.id(); // '1'\n       ```\n        @method id\n       @return {String} The id of the record.\n    */\n\n\n    id() {\n      return this._id;\n    }\n    /**\n       How the reference will be looked up when it is loaded. Currently\n       this always returns `identity` to signify that a record will be\n       loaded by its `type` and `id`.\n        Example\n        ```javascript\n       const userRef = store.getReference('user', 1);\n        userRef.remoteType(); // 'identity'\n       ```\n        @method remoteType\n       @return {String} 'identity'\n    */\n\n\n    remoteType() {\n      return 'identity';\n    }\n    /**\n      This API allows you to provide a reference with new data. The\n      simplest usage of this API is similar to `store.push`: you provide a\n      normalized hash of data and the object represented by the reference\n      will update.\n       If you pass a promise to `push`, Ember Data will not ask the adapter\n      for the data if another attempt to fetch it is made in the\n      interim. When the promise resolves, the underlying object is updated\n      with the new data, and the promise returned by *this function* is resolved\n      with that object.\n       For example, `recordReference.push(promise)` will be resolved with a\n      record.\n        Example\n        ```javascript\n       let userRef = store.getReference('user', 1);\n        // provide data for reference\n       userRef.push({\n         data: {\n           id: \"1\",\n           type: \"user\",\n           attributes: {\n             username: \"@user\"\n           }\n         }\n       }).then(function(user) {\n         userRef.value() === user;\n       });\n       ```\n       @method push\n      @param objectOrPromise a JSON:API ResourceDocument or a promise resolving to one\n      @return a promise for the value (record or relationship)\n    */\n\n\n    push(objectOrPromise) {\n      return Ember.RSVP.resolve(objectOrPromise).then(data => {\n        return this.store.push(data);\n      });\n    }\n    /**\n      If the entity referred to by the reference is already loaded, it is\n      present as `reference.value`. Otherwise the value returned by this function\n      is `null`.\n        Example\n        ```javascript\n       let userRef = store.getReference('user', 1);\n        userRef.value(); // user\n       ```\n        @method value\n       @return {Model} the record for this RecordReference\n    */\n\n\n    value() {\n      if (this.internalModel.hasRecord) {\n        return this.internalModel.getRecord();\n      }\n\n      return null;\n    }\n    /**\n       Triggers a fetch for the backing entity based on its `remoteType`\n       (see `remoteType` definitions per reference type).\n        Example\n        ```javascript\n       let userRef = store.getReference('user', 1);\n        // load user (via store.find)\n       userRef.load().then(...)\n       ```\n        @method load\n       @return {Promise<record>} the record for this RecordReference\n    */\n\n\n    load() {\n      if (this._id !== null) {\n        return this.store.findRecord(this.type, this._id);\n      }\n\n      throw new Error(`Unable to fetch record of type ${this.type} without an id`);\n    }\n    /**\n       Reloads the record if it is already loaded. If the record is not\n       loaded it will load the record via `store.findRecord`\n        Example\n        ```javascript\n       let userRef = store.getReference('user', 1);\n        // or trigger a reload\n       userRef.reload().then(...)\n       ```\n        @method reload\n       @return {Promise<record>} the record for this RecordReference\n    */\n\n\n    reload() {\n      var record = this.value();\n\n      if (record) {\n        return record.reload();\n      }\n\n      return this.load();\n    }\n\n  }\n\n  /**\n    @module @ember-data/store\n  */\n\n  /**\n   A `BelongsToReference` is a low-level API that allows users and\n   addon authors to perform meta-operations on a belongs-to\n   relationship.\n\n   @class BelongsToReference\n   @extends Reference\n   */\n\n  class BelongsToReference extends Reference {\n    constructor(store, parentInternalModel, belongsToRelationship, key) {\n      super(store, parentInternalModel);\n      this.key = key;\n      this.belongsToRelationship = belongsToRelationship;\n      this.type = belongsToRelationship.relationshipMeta.type;\n      this.parent = parentInternalModel.recordReference;\n      this.parentInternalModel = parentInternalModel; // TODO inverse\n    }\n    /**\n     The `id` of the record that this reference refers to. Together, the\n     `type()` and `id()` methods form a composite key for the identity\n     map. This can be used to access the id of an async relationship\n     without triggering a fetch that would normally happen if you\n     attempted to use `record.get('relationship.id')`.\n      Example\n      ```javascript\n     // models/blog.js\n     export default Model.extend({\n        user: belongsTo({ async: true })\n      });\n      let blog = store.push({\n        data: {\n          type: 'blog',\n          id: 1,\n          relationships: {\n            user: {\n              data: { type: 'user', id: 1 }\n            }\n          }\n        }\n      });\n     let userRef = blog.belongsTo('user');\n      // get the identifier of the reference\n     if (userRef.remoteType() === \"id\") {\n        let id = userRef.id();\n      }\n     ```\n      @method id\n     @return {String} The id of the record in this belongsTo relationship.\n     */\n\n\n    id() {\n      var id = null;\n\n      var resource = this._resource();\n\n      if (resource && resource.data && resource.data.id) {\n        id = resource.data.id;\n      }\n\n      return id;\n    }\n\n    _resource() {\n      return this.recordData.getBelongsTo(this.key);\n    }\n    /**\n     `push` can be used to update the data in the relationship and Ember\n     Data will treat the new data as the conanical value of this\n     relationship on the backend.\n      Example\n      ```app/models/blog.js\n     import Model, { belongsTo } from '@ember-data/model';\n      export default Model.extend({\n        user: belongsTo({ async: true })\n      });\n      let blog = store.push({\n        data: {\n          type: 'blog',\n          id: 1,\n          relationships: {\n            user: {\n              data: { type: 'user', id: 1 }\n            }\n          }\n        }\n      });\n     let userRef = blog.belongsTo('user');\n      // provide data for reference\n     userRef.push({\n        data: {\n          type: 'user',\n          id: 1,\n          attributes: {\n            username: \"@user\"\n          }\n        }\n      }).then(function(user) {\n        userRef.value() === user;\n      });\n     ```\n      @method push\n     @param {Object|Promise} objectOrPromise a promise that resolves to a JSONAPI document object describing the new value of this relationship.\n     @return {Promise<record>} A promise that resolves with the new value in this belongs-to relationship.\n     */\n\n\n    push(objectOrPromise) {\n      // TODO deprecate thenable support\n      return Ember.RSVP.resolve(objectOrPromise).then(data => {\n        var record; // TODO deprecate data as Model\n\n        if (peekRecordIdentifier(data)) {\n          record = data;\n        } else {\n          record = this.store.push(data);\n        }\n\n        Debug.assertPolymorphicType(this.internalModel, this.belongsToRelationship.relationshipMeta, record._internalModel, this.store); //TODO Igor cleanup, maybe move to relationship push\n\n        this.belongsToRelationship.setCanonicalRecordData(recordDataFor(record));\n        return record;\n      });\n    }\n    /**\n     `value()` synchronously returns the current value of the belongs-to\n     relationship. Unlike `record.get('relationshipName')`, calling\n     `value()` on a reference does not trigger a fetch if the async\n     relationship is not yet loaded. If the relationship is not loaded\n     it will always return `null`.\n      Example\n      ```javascript\n     // models/blog.js\n     import Model, { belongsTo } from '@ember-data/model';\n      export default Model.extend({\n        user: belongsTo({ async: true })\n      });\n      let blog = store.push({\n        data: {\n          type: 'blog',\n          id: 1,\n          relationships: {\n            user: {\n              data: { type: 'user', id: 1 }\n            }\n          }\n        }\n      });\n     let userRef = blog.belongsTo('user');\n      userRef.value(); // null\n      // provide data for reference\n     userRef.push({\n        data: {\n          type: 'user',\n          id: 1,\n          attributes: {\n            username: \"@user\"\n          }\n        }\n      }).then(function(user) {\n        userRef.value(); // user\n      });\n     ```\n      @method value\n     @return {Model} the record in this relationship\n     */\n\n\n    value() {\n      var store = this.parentInternalModel.store;\n\n      var resource = this._resource();\n\n      if (resource && resource.data) {\n        var inverseInternalModel = store._internalModelForResource(resource.data);\n\n        if (inverseInternalModel && inverseInternalModel.isLoaded()) {\n          return inverseInternalModel.getRecord();\n        }\n      }\n\n      return null;\n    }\n    /**\n     Loads a record in a belongs-to relationship if it is not already\n     loaded. If the relationship is already loaded this method does not\n     trigger a new load.\n      Example\n      ```javascript\n     // models/blog.js\n     import Model, { belongsTo } from '@ember-data/model';\n      export default Model.extend({\n        user: belongsTo({ async: true })\n      });\n      let blog = store.push({\n        data: {\n          type: 'blog',\n          id: 1,\n          relationships: {\n            user: {\n              data: { type: 'user', id: 1 }\n            }\n          }\n        }\n      });\n     let userRef = blog.belongsTo('user');\n      userRef.value(); // null\n      userRef.load().then(function(user) {\n        userRef.value() === user\n      });\n     ```\n      You may also pass in an options object whose properties will be\n     fed forward. This enables you to pass `adapterOptions` into the\n     request given to the adapter via the reference.\n      Example\n      ```javascript\n     userRef.load({ adapterOptions: { isPrivate: true } }).then(function(user) {\n       userRef.value() === user;\n     });\n     ```\n      ```app/adapters/user.js\n     export default ApplicationAdapter.extend({\n       findRecord(store, type, id, snapshot) {\n         // In the adapter you will have access to adapterOptions.\n         let adapterOptions = snapshot.adapterOptions;\n       }\n     });\n     ```\n      @method load\n     @param {Object} options the options to pass in.\n     @return {Promise} a promise that resolves with the record in this belongs-to relationship.\n     */\n\n\n    load(options) {\n      return this.parentInternalModel.getBelongsTo(this.key, options);\n    }\n    /**\n     Triggers a reload of the value in this relationship. If the\n     remoteType is `\"link\"` Ember Data will use the relationship link to\n     reload the relationship. Otherwise it will reload the record by its\n     id.\n      Example\n      ```javascript\n     // models/blog.js\n     import Model, { belongsTo } from '@ember-data/model';\n     export default Model.extend({\n        user: belongsTo({ async: true })\n      });\n      let blog = store.push({\n        data: {\n          type: 'blog',\n          id: 1,\n          relationships: {\n            user: {\n              data: { type: 'user', id: 1 }\n            }\n          }\n        }\n      });\n     let userRef = blog.belongsTo('user');\n      userRef.reload().then(function(user) {\n        userRef.value() === user\n      });\n     ```\n      You may also pass in an options object whose properties will be\n     fed forward. This enables you to pass `adapterOptions` into the\n     request given to the adapter via the reference. A full example\n     can be found in the `load` method.\n      Example\n      ```javascript\n     userRef.reload({ adapterOptions: { isPrivate: true } })\n     ```\n      @method reload\n     @param {Object} options the options to pass in.\n     @return {Promise} a promise that resolves with the record in this belongs-to relationship after the reload has completed.\n     */\n\n\n    reload(options) {\n      return this.parentInternalModel.reloadBelongsTo(this.key, options).then(internalModel => {\n        return this.value();\n      });\n    }\n\n  }\n\n  /**\n    @module @ember-data/store\n  */\n\n  /**\n   A `HasManyReference` is a low-level API that allows users and addon\n   authors to perform meta-operations on a has-many relationship.\n\n   @class HasManyReference\n   @extends Reference\n   */\n\n  class HasManyReference extends Reference {\n    constructor(store, parentInternalModel, hasManyRelationship, key) {\n      super(store, parentInternalModel);\n      this.key = key;\n      this.hasManyRelationship = hasManyRelationship;\n      this.type = hasManyRelationship.relationshipMeta.type;\n      this.parent = parentInternalModel.recordReference;\n      this.parentInternalModel = parentInternalModel; // TODO inverse\n    }\n\n    _resource() {\n      return this.recordData.getHasMany(this.key);\n    }\n    /**\n     This returns a string that represents how the reference will be\n     looked up when it is loaded. If the relationship has a link it will\n     use the \"link\" otherwise it defaults to \"id\".\n      Example\n      ```app/models/post.js\n     import Model, { hasMany } from '@ember-data/model';\n     export default Model.extend({\n       comments: hasMany({ async: true })\n     });\n     ```\n      ```javascript\n     let post = store.push({\n       data: {\n         type: 'post',\n         id: 1,\n         relationships: {\n           comments: {\n             data: [{ type: 'comment', id: 1 }]\n           }\n         }\n       }\n     });\n      let commentsRef = post.hasMany('comments');\n      // get the identifier of the reference\n     if (commentsRef.remoteType() === \"ids\") {\n       let ids = commentsRef.ids();\n     } else if (commentsRef.remoteType() === \"link\") {\n       let link = commentsRef.link();\n     }\n     ```\n      @method remoteType\n     @return {String} The name of the remote type. This should either be `link` or `ids`\n     */\n\n\n    remoteType() {\n      var value = this._resource();\n\n      if (value && value.links && value.links.related) {\n        return 'link';\n      }\n\n      return 'ids';\n    }\n    /**\n     `ids()` returns an array of the record IDs in this relationship.\n      Example\n      ```app/models/post.js\n     import Model, { hasMany } from '@ember-data/model';\n     export default Model.extend({\n       comments: hasMany({ async: true })\n     });\n     ```\n      ```javascript\n     let post = store.push({\n       data: {\n         type: 'post',\n         id: 1,\n         relationships: {\n           comments: {\n             data: [{ type: 'comment', id: 1 }]\n           }\n         }\n       }\n     });\n      let commentsRef = post.hasMany('comments');\n      commentsRef.ids(); // ['1']\n     ```\n      @method ids\n     @return {Array} The ids in this has-many relationship\n     */\n\n\n    ids() {\n      var resource = this._resource();\n\n      var ids = [];\n\n      if (resource.data) {\n        ids = resource.data.map(data => data.id);\n      }\n\n      return ids;\n    }\n    /**\n     `push` can be used to update the data in the relationship and Ember\n     Data will treat the new data as the canonical value of this\n     relationship on the backend.\n      Example\n      ```app/models/post.js\n     import Model, { hasMany } from '@ember-data/model';\n     export default Model.extend({\n       comments: hasMany({ async: true })\n     });\n     ```\n      ```\n     let post = store.push({\n       data: {\n         type: 'post',\n         id: 1,\n         relationships: {\n           comments: {\n             data: [{ type: 'comment', id: 1 }]\n           }\n         }\n       }\n     });\n      let commentsRef = post.hasMany('comments');\n      commentsRef.ids(); // ['1']\n      commentsRef.push([\n     [{ type: 'comment', id: 2 }],\n     [{ type: 'comment', id: 3 }],\n     ])\n      commentsRef.ids(); // ['2', '3']\n     ```\n      @method push\n     @param {Array|Promise} objectOrPromise a promise that resolves to a JSONAPI document object describing the new value of this relationship.\n     @return {ManyArray}\n     */\n\n\n    push(objectOrPromise) {\n      return Ember.RSVP.resolve(objectOrPromise).then(payload => {\n        var array = payload;\n\n        if (typeof payload === 'object' && payload.data) {\n          array = payload.data;\n        }\n\n        var internalModels = array.map(obj => {\n          var record = this.store.push(obj);\n\n          {\n            var relationshipMeta = this.hasManyRelationship.relationshipMeta;\n            Debug.assertPolymorphicType(this.internalModel, relationshipMeta, record._internalModel, this.store);\n          }\n\n          return recordDataFor(record);\n        });\n        this.hasManyRelationship.computeChanges(internalModels);\n        return this.internalModel.getHasMany(this.hasManyRelationship.key); // TODO IGOR it seems wrong that we were returning the many array here\n        //return this.hasManyRelationship.manyArray;\n      });\n    }\n\n    _isLoaded() {\n      var hasRelationshipDataProperty = Ember.get(this.hasManyRelationship, 'hasAnyRelationshipData');\n\n      if (!hasRelationshipDataProperty) {\n        return false;\n      }\n\n      var members = this.hasManyRelationship.members.toArray(); //TODO Igor cleanup\n\n      return members.every(recordData => {\n        var store = this.parentInternalModel.store;\n\n        var internalModel = store._internalModelForResource(recordData.getResourceIdentifier());\n\n        return internalModel.isLoaded() === true;\n      });\n    }\n    /**\n     `value()` synchronously returns the current value of the has-many\n     relationship. Unlike `record.get('relationshipName')`, calling\n     `value()` on a reference does not trigger a fetch if the async\n     relationship is not yet loaded. If the relationship is not loaded\n     it will always return `null`.\n      Example\n      ```app/models/post.js\n     import Model, { hasMany } from '@ember-data/model';\n     export default Model.extend({\n       comments: hasMany({ async: true })\n     });\n     ```\n      ```javascript\n     let post = store.push({\n       data: {\n         type: 'post',\n         id: 1,\n         relationships: {\n           comments: {\n             data: [{ type: 'comment', id: 1 }]\n           }\n         }\n       }\n     });\n      let commentsRef = post.hasMany('comments');\n      post.get('comments').then(function(comments) {\n       commentsRef.value() === comments\n     })\n     ```\n      @method value\n     @return {ManyArray}\n     */\n\n\n    value() {\n      if (this._isLoaded()) {\n        return this.internalModel.getManyArray(this.key);\n      }\n\n      return null;\n    }\n    /**\n     Loads the relationship if it is not already loaded.  If the\n     relationship is already loaded this method does not trigger a new\n     load. This causes a request to the specified\n     relationship link or reloads all items currently in the relationship.\n      Example\n      ```app/models/post.js\n     import Model, { hasMany } from '@ember-data/model';\n     export default Model.extend({\n       comments: hasMany({ async: true })\n     });\n     ```\n      ```javascript\n     let post = store.push({\n       data: {\n         type: 'post',\n         id: 1,\n         relationships: {\n           comments: {\n             data: [{ type: 'comment', id: 1 }]\n           }\n         }\n       }\n     });\n      let commentsRef = post.hasMany('comments');\n      commentsRef.load().then(function(comments) {\n       //...\n     });\n     ```\n      You may also pass in an options object whose properties will be\n     fed forward. This enables you to pass `adapterOptions` into the\n     request given to the adapter via the reference.\n      Example\n      ```javascript\n     commentsRef.load({ adapterOptions: { isPrivate: true } })\n       .then(function(comments) {\n         //...\n       });\n     ```\n      ```app/adapters/comment.js\n     export default ApplicationAdapter.extend({\n       findMany(store, type, id, snapshots) {\n         // In the adapter you will have access to adapterOptions.\n         let adapterOptions = snapshots[0].adapterOptions;\n       }\n     });\n     ```\n      @method load\n     @param {Object} options the options to pass in.\n     @return {Promise} a promise that resolves with the ManyArray in\n     this has-many relationship.\n     */\n\n\n    load(options) {\n      return this.internalModel.getHasMany(this.key, options);\n    }\n    /**\n     Reloads this has-many relationship. This causes a request to the specified\n     relationship link or reloads all items currently in the relationship.\n      Example\n      ```app/models/post.js\n     import Model, { hasMany } from '@ember-data/model';\n     export default Model.extend({\n       comments: hasMany({ async: true })\n     });\n     ```\n      ```javascript\n     let post = store.push({\n       data: {\n         type: 'post',\n         id: 1,\n         relationships: {\n           comments: {\n             data: [{ type: 'comment', id: 1 }]\n           }\n         }\n       }\n     });\n      let commentsRef = post.hasMany('comments');\n      commentsRef.reload().then(function(comments) {\n       //...\n     });\n     ```\n      You may also pass in an options object whose properties will be\n     fed forward. This enables you to pass `adapterOptions` into the\n     request given to the adapter via the reference. A full example\n     can be found in the `load` method.\n      Example\n      ```javascript\n     commentsRef.reload({ adapterOptions: { isPrivate: true } })\n     ```\n      @method reload\n     @param {Object} options the options to pass in.\n     @return {Promise} a promise that resolves with the ManyArray in this has-many relationship.\n     */\n\n\n    reload(options) {\n      return this.internalModel.reloadHasMany(this.key, options);\n    }\n\n  }\n\n  // once the presentation logic is moved into the Model package we can make\n  // eliminate these lossy and redundant helpers\n  function relationshipsFor$1(instance) {\n    var recordData = recordDataFor(instance);\n    return recordData._relationships;\n  }\n\n  function relationshipStateFor$1(instance, propertyName) {\n    return relationshipsFor$1(instance).get(propertyName);\n  }\n\n  var {\n    hasOwnProperty\n  } = Object.prototype;\n\n  /*\n    The TransitionChainMap caches the `state.enters`, `state.setups`, and final state reached\n    when transitioning from one state to another, so that future transitions can replay the\n    transition without needing to walk the state tree, collect these hook calls and determine\n     the state to transition into.\n\n     A future optimization would be to build a single chained method out of the collected enters\n     and setups. It may also be faster to do a two level cache (from: { to }) instead of caching based\n     on a key that adds the two together.\n   */\n  var TransitionChainMap = Object.create(null);\n\n  var _extractPivotNameCache = Object.create(null);\n\n  var _splitOnDotCache = Object.create(null);\n\n  function splitOnDot(name) {\n    return _splitOnDotCache[name] || (_splitOnDotCache[name] = name.split('.'));\n  }\n\n  function extractPivotName(name) {\n    return _extractPivotNameCache[name] || (_extractPivotNameCache[name] = splitOnDot(name)[0]);\n  }\n  /*\n    `InternalModel` is the Model class that we use internally inside Ember Data to represent models.\n    Internal ED methods should only deal with `InternalModel` objects. It is a fast, plain Javascript class.\n\n    We expose `Model` to application code, by materializing a `Model` from `InternalModel` lazily, as\n    a performance optimization.\n\n    `InternalModel` should never be exposed to application code. At the boundaries of the system, in places\n    like `find`, `push`, etc. we convert between Models and InternalModels.\n\n    We need to make sure that the properties from `InternalModel` are correctly exposed/proxied on `Model`\n    if they are needed.\n\n    @private\n    @class InternalModel\n  */\n\n\n  class InternalModel {\n    // Not typed yet\n    // The previous ManyArrays for this relationship which will be destroyed when\n    // we create a new ManyArray, but in the interim the retained version will be\n    // updated if inverse internal models are unloaded.\n    constructor(store, identifier) {\n      this.store = store;\n      this.identifier = identifier;\n      this._id = void 0;\n      this._tag = 0;\n      this.modelName = void 0;\n      this.clientId = void 0;\n      this.__recordData = void 0;\n      this._isDestroyed = void 0;\n      this.isError = void 0;\n      this._pendingRecordArrayManagerFlush = void 0;\n      this._isDematerializing = void 0;\n      this.isReloading = void 0;\n      this._doNotDestroy = void 0;\n      this.isDestroying = void 0;\n      this._promiseProxy = void 0;\n      this._record = void 0;\n      this._scheduledDestroy = void 0;\n      this._modelClass = void 0;\n      this.__deferredTriggers = void 0;\n      this.__recordArrays = void 0;\n      this._references = void 0;\n      this._recordReference = void 0;\n      this._manyArrayCache = Object.create(null);\n      this._retainedManyArrayCache = Object.create(null);\n      this._relationshipPromisesCache = Object.create(null);\n      this._relationshipProxyCache = Object.create(null);\n      this.currentState = void 0;\n      this.error = void 0;\n      this._id = identifier.id;\n      this.modelName = identifier.type;\n      this.clientId = identifier.lid;\n      this.__recordData = null; // this ensure ordered set can quickly identify this as unique\n\n      this[Ember.GUID_KEY] = identifier.lid;\n      this._promiseProxy = null;\n      this._record = null;\n      this._isDestroyed = false;\n      this.isError = false;\n      this._pendingRecordArrayManagerFlush = false; // used by the recordArrayManager\n      // During dematerialization we don't want to rematerialize the record.  The\n      // reason this might happen is that dematerialization removes records from\n      // record arrays,  and Ember arrays will always `objectAt(0)` and\n      // `objectAt(len - 1)` to test whether or not `firstObject` or `lastObject`\n      // have changed.\n\n      this._isDematerializing = false;\n      this._scheduledDestroy = null;\n      this.resetRecord(); // caches for lazy getters\n\n      this._modelClass = null;\n      this.__deferredTriggers = null;\n      this.__recordArrays = null;\n      this._references = null;\n      this._recordReference = null;\n    }\n\n    get id() {\n      {\n        return this.identifier.id; // || this._id;\n      }\n    }\n\n    set id(value) {\n      {\n        if (value !== this._id) {\n          var newIdentifier = {\n            type: this.identifier.type,\n            lid: this.identifier.lid,\n            id: value\n          };\n          identifierCacheFor(this.store).updateRecordIdentifier(this.identifier, newIdentifier);\n          Ember.set(this, '_tag', this._tag + 1); // TODO Show deprecation for private api\n        }\n      }\n    }\n\n    get modelClass() {\n      if (this.store.modelFor) {\n        return this._modelClass || (this._modelClass = this.store.modelFor(this.modelName));\n      }\n    }\n\n    get type() {\n      return this.modelClass;\n    }\n\n    get recordReference() {\n      if (this._recordReference === null) {\n        this._recordReference = new RecordReference(this.store, this);\n      }\n\n      return this._recordReference;\n    }\n\n    get _recordData() {\n      if (this.__recordData === null) {\n        var recordData = this.store._createRecordData(this.identifier);\n\n        this._recordData = recordData;\n        return recordData;\n      }\n\n      return this.__recordData;\n    }\n\n    set _recordData(newValue) {\n      this.__recordData = newValue;\n    }\n\n    get _recordArrays() {\n      if (this.__recordArrays === null) {\n        this.__recordArrays = new Set();\n      }\n\n      return this.__recordArrays;\n    }\n\n    get references() {\n      if (this._references === null) {\n        this._references = Object.create(null);\n      }\n\n      return this._references;\n    }\n\n    get _deferredTriggers() {\n      if (this.__deferredTriggers === null) {\n        this.__deferredTriggers = [];\n      }\n\n      return this.__deferredTriggers;\n    }\n\n    isHiddenFromRecordArrays() {\n      // During dematerialization we don't want to rematerialize the record.\n      // recordWasDeleted can cause other records to rematerialize because it\n      // removes the internal model from the array and Ember arrays will always\n      // `objectAt(0)` and `objectAt(len -1)` to check whether `firstObject` or\n      // `lastObject` have changed.  When this happens we don't want those\n      // models to rematerialize their records.\n      // eager checks to avoid instantiating record data if we are empty or loading\n      if (this.isEmpty()) {\n        return true;\n      }\n\n      var isRecordFullyDeleted;\n\n      {\n        isRecordFullyDeleted = this.currentState.stateName === 'root.deleted.saved';\n      }\n\n      return this._isDematerializing || this.hasScheduledDestroy() || this.isDestroyed || isRecordFullyDeleted;\n    }\n\n    _isRecordFullyDeleted() {\n      {\n        // assert here\n        return false;\n      }\n    }\n\n    isRecordInUse() {\n      var record = this._record;\n      return record && !(record.get('isDestroyed') || record.get('isDestroying'));\n    }\n\n    isEmpty() {\n      return this.currentState.isEmpty;\n    }\n\n    isLoading() {\n      return this.currentState.isLoading;\n    }\n\n    isLoaded() {\n      return this.currentState.isLoaded;\n    }\n\n    hasDirtyAttributes() {\n      return this.currentState.hasDirtyAttributes;\n    }\n\n    isSaving() {\n      return this.currentState.isSaving;\n    }\n\n    isDeleted() {\n      {\n        return this.currentState.isDeleted;\n      }\n    }\n\n    isNew() {\n      {\n        return this.currentState.isNew;\n      }\n    }\n\n    isValid() {\n      {\n        return this.currentState.isValid;\n      }\n    }\n\n    dirtyType() {\n      return this.currentState.dirtyType;\n    }\n\n    getRecord(properties) {\n      if (!this._record && !this._isDematerializing) {\n        var {\n          store: _store\n        } = this;\n\n        {\n          {\n            // lookupFactory should really return an object that creates\n            // instances with the injections applied\n            var createOptions = {\n              store: _store,\n              _internalModel: this,\n              currentState: this.currentState\n            };\n\n            {\n              createOptions.isError = this.isError;\n              createOptions.adapterError = this.error;\n            }\n\n            if (properties !== undefined) {\n              ( !(typeof properties === 'object' && properties !== null) && Ember.assert(`You passed '${properties}' as properties for record creation instead of an object.`, typeof properties === 'object' && properties !== null));\n\n              if ('id' in properties) {\n                var id = coerceId(properties.id);\n\n                if (id !== null) {\n                  this.setId(id);\n                }\n              } // convert relationship Records to RecordDatas before passing to RecordData\n\n\n              var defs = _store._relationshipsDefinitionFor(this.modelName);\n\n              if (defs !== null) {\n                var keys = Object.keys(properties);\n                var relationshipValue;\n\n                for (var i = 0; i < keys.length; i++) {\n                  var prop = keys[i];\n                  var def = defs[prop];\n\n                  if (def !== undefined) {\n                    if (def.kind === 'hasMany') {\n                      {\n                        assertRecordsPassedToHasMany(properties[prop]);\n                      }\n\n                      relationshipValue = extractRecordDatasFromRecords(properties[prop]);\n                    } else {\n                      relationshipValue = extractRecordDataFromRecord(properties[prop]);\n                    }\n\n                    properties[prop] = relationshipValue;\n                  }\n                }\n              }\n            }\n\n            var additionalCreateOptions = this._recordData._initRecordCreateOptions(properties);\n\n            Ember.assign(createOptions, additionalCreateOptions); // ensure that `getOwner(this)` works inside a model instance\n\n            Ember.setOwner(createOptions, Ember.getOwner(_store));\n            this._record = _store._modelFactoryFor(this.modelName).create(createOptions);\n            setRecordIdentifier(this._record, this.identifier);\n          }\n        }\n\n        this._triggerDeferredTriggers();\n      }\n\n      return this._record;\n    }\n\n    resetRecord() {\n      this._record = null;\n      this.isReloading = false;\n      this.error = null;\n      this.currentState = RootState$1.empty;\n    }\n\n    dematerializeRecord() {\n      this._isDematerializing = true; // TODO IGOR add a test that fails when this is missing, something that involves canceliing a destroy\n      // and the destroy not happening, and then later on trying to destroy\n\n      this._doNotDestroy = false;\n\n      if (this._record) {\n        {\n          this._record.destroy();\n        }\n\n        Object.keys(this._relationshipProxyCache).forEach(key => {\n          if (this._relationshipProxyCache[key].destroy) {\n            this._relationshipProxyCache[key].destroy();\n          }\n\n          delete this._relationshipProxyCache[key];\n        });\n        Object.keys(this._manyArrayCache).forEach(key => {\n          var manyArray = this._retainedManyArrayCache[key] = this._manyArrayCache[key];\n          delete this._manyArrayCache[key];\n\n          if (manyArray && !manyArray._inverseIsAsync) {\n            /*\n              If the manyArray is for a sync relationship, we should clear it\n                to preserve the semantics of client-side delete.\n               It is likely in this case instead of retaining we should destroy\n                - @runspired\n            */\n            manyArray.clear();\n          }\n        });\n      } // move to an empty never-loaded state\n\n\n      this._recordData.unloadRecord();\n\n      this.resetRecord();\n      this.updateRecordArrays();\n    }\n\n    deleteRecord() {\n\n      this.send('deleteRecord');\n    }\n\n    save(options) {\n      var promiseLabel = 'DS: Model#save ' + this;\n      var resolver = Ember.RSVP.defer(promiseLabel);\n\n      {\n        this.store.scheduleSave(this, resolver, options);\n        return resolver.promise;\n      }\n    }\n\n    startedReloading() {\n      this.isReloading = true;\n\n      if (this.hasRecord) {\n        Ember.set(this._record, 'isReloading', true);\n      }\n    }\n\n    finishedReloading() {\n      this.isReloading = false;\n\n      if (this.hasRecord) {\n        Ember.set(this._record, 'isReloading', false);\n      }\n    }\n\n    reload(options) {\n      {\n        this.startedReloading();\n\n        var _internalModel = this;\n\n        var promiseLabel = 'DS: Model#reload of ' + this;\n        return new Ember.RSVP.Promise(function (resolve) {\n          _internalModel.send('reloadRecord', {\n            resolve,\n            options\n          });\n        }, promiseLabel).then(function () {\n          _internalModel.didCleanError();\n\n          return _internalModel;\n        }, function (error) {\n          _internalModel.didError(error);\n\n          throw error;\n        }, 'DS: Model#reload complete, update flags').finally(function () {\n          _internalModel.finishedReloading();\n\n          _internalModel.updateRecordArrays();\n        });\n      }\n    }\n    /*\n      Unload the record for this internal model. This will cause the record to be\n      destroyed and freed up for garbage collection. It will also do a check\n      for cleaning up internal models.\n       This check is performed by first computing the set of related internal\n      models. If all records in this set are unloaded, then the entire set is\n      destroyed. Otherwise, nothing in the set is destroyed.\n       This means that this internal model will be freed up for garbage collection\n      once all models that refer to it via some relationship are also unloaded.\n    */\n\n\n    unloadRecord() {\n      if (this.isDestroyed) {\n        return;\n      }\n\n      this.send('unloadRecord');\n      this.dematerializeRecord();\n\n      if (this._scheduledDestroy === null) {\n        this._scheduledDestroy = Ember.run.backburner.schedule('destroy', this, '_checkForOrphanedInternalModels');\n      }\n    }\n\n    hasScheduledDestroy() {\n      return !!this._scheduledDestroy;\n    }\n\n    cancelDestroy() {\n      ( !(!this.isDestroyed) && Ember.assert(`You cannot cancel the destruction of an InternalModel once it has already been destroyed`, !this.isDestroyed));\n      this._doNotDestroy = true;\n      this._isDematerializing = false;\n      Ember.run.cancel(this._scheduledDestroy);\n      this._scheduledDestroy = null;\n    } // typically, we prefer to async destroy this lets us batch cleanup work.\n    // Unfortunately, some scenarios where that is not possible. Such as:\n    //\n    // ```js\n    // const record = store.find(‘record’, 1);\n    // record.unloadRecord();\n    // store.createRecord(‘record’, 1);\n    // ```\n    //\n    // In those scenarios, we make that model's cleanup work, sync.\n    //\n\n\n    destroySync() {\n      if (this._isDematerializing) {\n        this.cancelDestroy();\n      }\n\n      this._checkForOrphanedInternalModels();\n\n      if (this.isDestroyed || this.isDestroying) {\n        return;\n      } // just in-case we are not one of the orphaned, we should still\n      // still destroy ourselves\n\n\n      this.destroy();\n    }\n\n    _checkForOrphanedInternalModels() {\n      this._isDematerializing = false;\n      this._scheduledDestroy = null;\n\n      if (this.isDestroyed) {\n        return;\n      }\n    }\n\n    eachRelationship(callback, binding) {\n      return this.modelClass.eachRelationship(callback, binding);\n    }\n\n    _findBelongsTo(key, resource, relationshipMeta, options) {\n      // TODO @runspired follow up if parent isNew then we should not be attempting load here\n      return this.store._findBelongsToByJsonApiResource(resource, this, relationshipMeta, options).then(internalModel => handleCompletedRelationshipRequest(this, key, resource._relationship, internalModel, null), e => handleCompletedRelationshipRequest(this, key, resource._relationship, null, e));\n    }\n\n    getBelongsTo(key, options) {\n      var resource = this._recordData.getBelongsTo(key);\n\n      var identifier = resource && resource.data ? identifierCacheFor(this.store).getOrCreateRecordIdentifier(resource.data) : null;\n\n      var relationshipMeta = this.store._relationshipMetaFor(this.modelName, null, key);\n\n      var store = this.store;\n      var parentInternalModel = this;\n      var async = relationshipMeta.options.async;\n      var isAsync = typeof async === 'undefined' ? true : async;\n      var _belongsToState = {\n        key,\n        store,\n        originatingInternalModel: this,\n        modelName: relationshipMeta.type\n      };\n\n      if (isAsync) {\n        var internalModel = identifier !== null ? store._internalModelForResource(identifier) : null;\n\n        if (resource._relationship.hasFailedLoadAttempt) {\n          return this._relationshipProxyCache[key];\n        }\n\n        var promise = this._findBelongsTo(key, resource, relationshipMeta, options);\n\n        return this._updatePromiseProxyFor('belongsTo', key, {\n          promise,\n          content: internalModel ? internalModel.getRecord() : null,\n          _belongsToState\n        });\n      } else {\n        if (identifier === null) {\n          return null;\n        } else {\n          var _internalModel2 = store._internalModelForResource(identifier);\n\n          var toReturn = _internalModel2.getRecord();\n\n          ( !(toReturn === null || !toReturn.get('isEmpty')) && Ember.assert(\"You looked up the '\" + key + \"' relationship on a '\" + parentInternalModel.modelName + \"' with id \" + parentInternalModel.id + ' but some of the associated records were not loaded. Either make sure they are all loaded together with the parent record, or specify that the relationship is async (`belongsTo({ async: true })`)', toReturn === null || !toReturn.get('isEmpty')));\n          return toReturn;\n        }\n      }\n    } // TODO Igor consider getting rid of initial state\n\n\n    getManyArray(key, isAsync = false) {\n      var relationshipMeta = this.store._relationshipMetaFor(this.modelName, null, key);\n\n      var jsonApi = this._recordData.getHasMany(key);\n\n      var manyArray = this._manyArrayCache[key];\n      ( !(!manyArray || !this._retainedManyArrayCache[key]) && Ember.assert(`Error: relationship ${this.modelName}:${key} has both many array and retained many array`, !manyArray || !this._retainedManyArrayCache[key]));\n\n      if (!manyArray) {\n        var initialState = this.store._getHasManyByJsonApiResource(jsonApi); // TODO move this to a public api\n\n\n        var inverseIsAsync = jsonApi._relationship ? jsonApi._relationship._inverseIsAsync() : false;\n        manyArray = ManyArray.create({\n          store: this.store,\n          type: this.store.modelFor(relationshipMeta.type),\n          recordData: this._recordData,\n          meta: jsonApi.meta,\n          links:  undefined,\n          key,\n          isPolymorphic: relationshipMeta.options.polymorphic,\n          initialState: initialState.slice(),\n          _inverseIsAsync: inverseIsAsync,\n          internalModel: this,\n          isLoaded: !isAsync\n        });\n        this._manyArrayCache[key] = manyArray;\n      }\n\n      if (this._retainedManyArrayCache[key]) {\n        this._retainedManyArrayCache[key].destroy();\n\n        delete this._retainedManyArrayCache[key];\n      }\n\n      return manyArray;\n    }\n\n    fetchAsyncHasMany(key, relationshipMeta, jsonApi, manyArray, options) {\n      // TODO @runspired follow up if parent isNew then we should not be attempting load here\n      var loadingPromise = this._relationshipPromisesCache[key];\n\n      if (loadingPromise) {\n        return loadingPromise;\n      }\n\n      loadingPromise = this.store._findHasManyByJsonApiResource(jsonApi, this, relationshipMeta, options).then(() => {\n        // TODO why don't we do this in the store method\n        manyArray.retrieveLatest();\n        manyArray.set('isLoaded', true);\n        return manyArray;\n      }).then(manyArray => handleCompletedRelationshipRequest(this, key, jsonApi._relationship, manyArray, null), e => handleCompletedRelationshipRequest(this, key, jsonApi._relationship, null, e));\n      this._relationshipPromisesCache[key] = loadingPromise;\n      return loadingPromise;\n    }\n\n    getHasMany(key, options) {\n      var jsonApi = this._recordData.getHasMany(key);\n\n      var relationshipMeta = this.store._relationshipMetaFor(this.modelName, null, key);\n\n      var async = relationshipMeta.options.async;\n      var isAsync = typeof async === 'undefined' ? true : async;\n      var manyArray = this.getManyArray(key, isAsync);\n\n      if (isAsync) {\n        if (jsonApi._relationship.hasFailedLoadAttempt) {\n          return this._relationshipProxyCache[key];\n        }\n\n        var promise = this.fetchAsyncHasMany(key, relationshipMeta, jsonApi, manyArray, options);\n        return this._updatePromiseProxyFor('hasMany', key, {\n          promise,\n          content: manyArray\n        });\n      } else {\n        ( !(!manyArray.anyUnloaded()) && Ember.assert(`You looked up the '${key}' relationship on a '${this.type.modelName}' with id ${this.id} but some of the associated records were not loaded. Either make sure they are all loaded together with the parent record, or specify that the relationship is async ('hasMany({ async: true })')`, !manyArray.anyUnloaded()));\n        return manyArray;\n      }\n    }\n\n    _updatePromiseProxyFor(kind, key, args) {\n      var promiseProxy = this._relationshipProxyCache[key];\n\n      if (promiseProxy) {\n        if (args.content !== undefined) {\n          // this usage of `any` can be removed when `@types/ember_object` proxy allows `null` for content\n          promiseProxy.set('content', args.content);\n        }\n\n        promiseProxy.set('promise', args.promise);\n      } else {\n        var klass = kind === 'hasMany' ? PromiseManyArray : PromiseBelongsTo; // this usage of `any` can be removed when `@types/ember_object` proxy allows `null` for content\n\n        this._relationshipProxyCache[key] = klass.create(args);\n      }\n\n      return this._relationshipProxyCache[key];\n    }\n\n    reloadHasMany(key, options) {\n      var loadingPromise = this._relationshipPromisesCache[key];\n\n      if (loadingPromise) {\n        return loadingPromise;\n      }\n\n      var jsonApi = this._recordData.getHasMany(key); // TODO move this to a public api\n\n\n      if (jsonApi._relationship) {\n        jsonApi._relationship.setHasFailedLoadAttempt(false);\n\n        jsonApi._relationship.setShouldForceReload(true);\n      }\n\n      var relationshipMeta = this.store._relationshipMetaFor(this.modelName, null, key);\n\n      var manyArray = this.getManyArray(key);\n      var promise = this.fetchAsyncHasMany(key, relationshipMeta, jsonApi, manyArray, options);\n\n      if (this._relationshipProxyCache[key]) {\n        return this._updatePromiseProxyFor('hasMany', key, {\n          promise\n        });\n      }\n\n      return promise;\n    }\n\n    reloadBelongsTo(key, options) {\n      var loadingPromise = this._relationshipPromisesCache[key];\n\n      if (loadingPromise) {\n        return loadingPromise;\n      }\n\n      var resource = this._recordData.getBelongsTo(key); // TODO move this to a public api\n\n\n      if (resource._relationship) {\n        resource._relationship.setHasFailedLoadAttempt(false);\n\n        resource._relationship.setShouldForceReload(true);\n      }\n\n      var relationshipMeta = this.store._relationshipMetaFor(this.modelName, null, key);\n\n      var promise = this._findBelongsTo(key, resource, relationshipMeta, options);\n\n      if (this._relationshipProxyCache[key]) {\n        return this._updatePromiseProxyFor('belongsTo', key, {\n          promise\n        });\n      }\n\n      return promise;\n    }\n\n    destroyFromRecordData() {\n      if (this._doNotDestroy) {\n        this._doNotDestroy = false;\n        return;\n      }\n\n      this.destroy();\n    }\n\n    destroy() {\n      ( !(!this._record || this._record.get('isDestroyed') || this._record.get('isDestroying')) && Ember.assert('Cannot destroy an internalModel while its record is materialized', !this._record || this._record.get('isDestroyed') || this._record.get('isDestroying')));\n      this.isDestroying = true;\n      Object.keys(this._retainedManyArrayCache).forEach(key => {\n        this._retainedManyArrayCache[key].destroy();\n\n        delete this._retainedManyArrayCache[key];\n      });\n      internalModelFactoryFor(this.store).remove(this);\n      this._isDestroyed = true;\n    }\n\n    eachAttribute(callback, binding) {\n      return this.modelClass.eachAttribute(callback, binding);\n    }\n\n    inverseFor(key) {\n      return this.modelClass.inverseFor(key);\n    }\n\n    setupData(data) {\n      var changedKeys = this._recordData.pushData(data, this.hasRecord);\n\n      if (this.hasRecord) {\n        this._record._notifyProperties(changedKeys);\n      }\n\n      this.pushedData();\n    }\n\n    getAttributeValue(key) {\n      return this._recordData.getAttr(key);\n    }\n\n    setDirtyHasMany(key, records) {\n      assertRecordsPassedToHasMany(records);\n      return this._recordData.setDirtyHasMany(key, extractRecordDatasFromRecords(records));\n    }\n\n    setDirtyBelongsTo(key, value) {\n      return this._recordData.setDirtyBelongsTo(key, extractRecordDataFromRecord(value));\n    }\n\n    setDirtyAttribute(key, value) {\n      if (this.isDeleted()) {\n        throw new Ember.Error(`Attempted to set '${key}' to '${value}' on the deleted record ${this}`);\n      }\n\n      var currentValue = this.getAttributeValue(key);\n\n      if (currentValue !== value) {\n        this._recordData.setDirtyAttribute(key, value);\n\n        var isDirty = this._recordData.isAttrDirty(key);\n\n        this.send('didSetProperty', {\n          name: key,\n          isDirty: isDirty\n        });\n      }\n\n      return value;\n    }\n\n    get isDestroyed() {\n      return this._isDestroyed;\n    }\n\n    get hasRecord() {\n      return !!this._record;\n    }\n    /*\n      @method createSnapshot\n      @private\n    */\n\n\n    createSnapshot(options) {\n      return new Snapshot(options || {}, this.identifier, this.store);\n    }\n    /*\n      @method loadingData\n      @private\n      @param {Promise} promise\n    */\n\n\n    loadingData(promise) {\n      {\n        this.send('loadingData', promise);\n      }\n    }\n    /*\n      @method loadedData\n      @private\n    */\n\n\n    loadedData() {\n      this.send('loadedData');\n    }\n    /*\n      @method notFound\n      @private\n    */\n\n\n    notFound() {\n      this.send('notFound');\n    }\n    /*\n      @method pushedData\n      @private\n    */\n\n\n    pushedData() {\n      this.send('pushedData');\n    }\n\n    hasChangedAttributes() {\n      {\n        if (this.isLoading() && !this.isReloading) {\n          // no need to calculate changed attributes when calling `findRecord`\n          return false;\n        }\n      }\n\n      return this._recordData.hasChangedAttributes();\n    }\n    /*\n      Returns an object, whose keys are changed properties, and value is an\n      [oldProp, newProp] array.\n       @method changedAttributes\n      @private\n    */\n\n\n    changedAttributes() {\n      {\n        if (this.isLoading() && !this.isReloading) {\n          // no need to calculate changed attributes when calling `findRecord`\n          return {};\n        }\n      }\n\n      return this._recordData.changedAttributes();\n    }\n    /*\n      @method adapterWillCommit\n      @private\n    */\n\n\n    adapterWillCommit() {\n      this._recordData.willCommit();\n\n      this.send('willCommit');\n    }\n    /*\n      @method adapterDidDirty\n      @private\n    */\n\n\n    adapterDidDirty() {\n      this.send('becomeDirty');\n      this.updateRecordArrays();\n    }\n    /*\n      @method send\n      @private\n      @param {String} name\n      @param {Object} context\n    */\n\n\n    send(name, context) {\n      var currentState = this.currentState;\n\n      if (!currentState[name]) {\n        this._unhandledEvent(currentState, name, context);\n      }\n\n      return currentState[name](this, context);\n    }\n\n    manyArrayRecordAdded(key) {\n      if (this.hasRecord) {\n        {\n          this._record.notifyHasManyAdded(key);\n        }\n      }\n    }\n\n    notifyHasManyChange(key) {\n      if (this.hasRecord) {\n        {\n          var manyArray = this._manyArrayCache[key];\n\n          if (manyArray) {\n            // TODO: this will \"resurrect\" previously unloaded records\n            // see test '1:many async unload many side'\n            //  in `tests/integration/records/unload-test.js`\n            //  probably we don't want to retrieve latest eagerly when notifyhasmany changed\n            //  but rather lazily when someone actually asks for a manyarray\n            //\n            //  that said, also not clear why we haven't moved this to retainedmanyarray so maybe that's the bit that's just not workign\n            manyArray.retrieveLatest();\n          }\n        }\n\n        this.updateRecordArrays();\n      }\n    }\n\n    notifyBelongsToChange(key) {\n      if (this.hasRecord) {\n        {\n          this._record.notifyBelongsToChange(key, this._record);\n        }\n\n        this.updateRecordArrays();\n      }\n    }\n\n    hasManyRemovalCheck(key) {\n      var manyArray = this._manyArrayCache[key] || this._retainedManyArrayCache[key];\n      var didRemoveUnloadedModel = false;\n\n      if (manyArray) {\n        didRemoveUnloadedModel = manyArray.removeUnloadedInternalModel();\n\n        if (this._manyArrayCache[key] && didRemoveUnloadedModel) {\n          this._retainedManyArrayCache[key] = this._manyArrayCache[key];\n          delete this._manyArrayCache[key];\n        }\n      }\n\n      return didRemoveUnloadedModel;\n    }\n\n    notifyPropertyChange(key) {\n      if (this.hasRecord) {\n        {\n          this._record.notifyPropertyChange(key);\n        }\n\n        this.updateRecordArrays();\n      }\n\n      {\n        var manyArray = this._manyArrayCache[key] || this._retainedManyArrayCache[key];\n\n        if (manyArray) {\n          var didRemoveUnloadedModel = manyArray.removeUnloadedInternalModel();\n\n          if (this._manyArrayCache[key] && didRemoveUnloadedModel) {\n            this._retainedManyArrayCache[key] = this._manyArrayCache[key];\n            delete this._manyArrayCache[key];\n          }\n        }\n      }\n    }\n\n    notifyStateChange(key) {\n      ( Ember.assert('Cannot notify state change if Record Data State flag is not on', !!false));\n\n      if (this.hasRecord) {\n        {\n          if (!key || key === 'isNew') {\n            this.getRecord().notifyPropertyChange('isNew');\n          }\n\n          if (!key || key === 'isDeleted') {\n            this.getRecord().notifyPropertyChange('isDeleted');\n          }\n        }\n      }\n\n      if (!key || key === 'isDeletionCommitted') {\n        this.updateRecordArrays();\n      }\n    }\n\n    didCreateRecord() {\n      this._recordData.clientDidCreate();\n    }\n\n    rollbackAttributes() {\n      var dirtyKeys = this._recordData.rollbackAttributes();\n\n      if (Ember.get(this, 'isError')) {\n        this.didCleanError();\n      }\n\n      this.send('rolledBack');\n\n      if (this._record && dirtyKeys && dirtyKeys.length > 0) {\n        this._record._notifyProperties(dirtyKeys);\n      }\n    }\n    /*\n      @method transitionTo\n      @private\n      @param {String} name\n    */\n\n\n    transitionTo(name) {\n      // POSSIBLE TODO: Remove this code and replace with\n      // always having direct reference to state objects\n      var pivotName = extractPivotName(name);\n      var state = this.currentState;\n      var transitionMapId = `${state.stateName}->${name}`;\n\n      do {\n        if (state.exit) {\n          state.exit(this);\n        }\n\n        state = state.parentState;\n      } while (!state[pivotName]);\n\n      var setups;\n      var enters;\n      var i;\n      var l;\n      var map = TransitionChainMap[transitionMapId];\n\n      if (map) {\n        setups = map.setups;\n        enters = map.enters;\n        state = map.state;\n      } else {\n        setups = [];\n        enters = [];\n        var path = splitOnDot(name);\n\n        for (i = 0, l = path.length; i < l; i++) {\n          state = state[path[i]];\n\n          if (state.enter) {\n            enters.push(state);\n          }\n\n          if (state.setup) {\n            setups.push(state);\n          }\n        }\n\n        TransitionChainMap[transitionMapId] = {\n          setups,\n          enters,\n          state\n        };\n      }\n\n      for (i = 0, l = enters.length; i < l; i++) {\n        enters[i].enter(this);\n      }\n\n      this.currentState = state;\n\n      if (this.hasRecord) {\n        Ember.set(this._record, 'currentState', state);\n      }\n\n      for (i = 0, l = setups.length; i < l; i++) {\n        setups[i].setup(this);\n      }\n\n      this.updateRecordArrays();\n    }\n\n    _unhandledEvent(state, name, context) {\n      var errorMessage = 'Attempted to handle event `' + name + '` ';\n      errorMessage += 'on ' + String(this) + ' while in state ';\n      errorMessage += state.stateName + '. ';\n\n      if (context !== undefined) {\n        errorMessage += 'Called with ' + Ember.inspect(context) + '.';\n      }\n\n      throw new Ember.Error(errorMessage);\n    }\n\n    triggerLater(...args) {\n      if (this._deferredTriggers.push(args) !== 1) {\n        return;\n      }\n\n      this.store._updateInternalModel(this);\n    }\n\n    _triggerDeferredTriggers() {\n      //TODO: Before 1.0 we want to remove all the events that happen on the pre materialized record,\n      //but for now, we queue up all the events triggered before the record was materialized, and flush\n      //them once we have the record\n      if (!this.hasRecord) {\n        return;\n      }\n\n      var triggers = this._deferredTriggers;\n      var record = this._record;\n      var trigger = record.trigger; // TODO Igor make nicer check\n\n      if (trigger && typeof trigger === 'function') {\n        for (var i = 0, l = triggers.length; i < l; i++) {\n          var eventName = triggers[i];\n          trigger.apply(record, eventName);\n        }\n      }\n\n      triggers.length = 0;\n    }\n\n    removeFromInverseRelationships(isNew = false) {\n      this._recordData.removeFromInverseRelationships(isNew);\n    }\n    /*\n      When a find request is triggered on the store, the user can optionally pass in\n      attributes and relationships to be preloaded. These are meant to behave as if they\n      came back from the server, except the user obtained them out of band and is informing\n      the store of their existence. The most common use case is for supporting client side\n      nested URLs, such as `/posts/1/comments/2` so the user can do\n      `store.findRecord('comment', 2, { preload: { post: 1 } })` without having to fetch the post.\n       Preloaded data can be attributes and relationships passed in either as IDs or as actual\n      models.\n       @method preloadData\n      @private\n      @param {Object} preload\n    */\n\n\n    preloadData(preload) {\n      var jsonPayload = {}; //TODO(Igor) consider the polymorphic case\n\n      Object.keys(preload).forEach(key => {\n        var preloadValue = Ember.get(preload, key);\n        var relationshipMeta = this.modelClass.metaForProperty(key);\n\n        if (relationshipMeta.isRelationship) {\n          if (!jsonPayload.relationships) {\n            jsonPayload.relationships = {};\n          }\n\n          jsonPayload.relationships[key] = this._preloadRelationship(key, preloadValue);\n        } else {\n          if (!jsonPayload.attributes) {\n            jsonPayload.attributes = {};\n          }\n\n          jsonPayload.attributes[key] = preloadValue;\n        }\n      });\n\n      this._recordData.pushData(jsonPayload);\n    }\n\n    _preloadRelationship(key, preloadValue) {\n      var relationshipMeta = this.modelClass.metaForProperty(key);\n      var modelClass = relationshipMeta.type;\n      var data;\n\n      if (relationshipMeta.kind === 'hasMany') {\n        ( !(Array.isArray(preloadValue)) && Ember.assert('You need to pass in an array to set a hasMany property on a record', Array.isArray(preloadValue)));\n        data = preloadValue.map(value => this._convertPreloadRelationshipToJSON(value, modelClass));\n      } else {\n        data = this._convertPreloadRelationshipToJSON(preloadValue, modelClass);\n      }\n\n      return {\n        data\n      };\n    }\n\n    _convertPreloadRelationshipToJSON(value, modelClass) {\n      if (typeof value === 'string' || typeof value === 'number') {\n        return {\n          type: modelClass,\n          id: value\n        };\n      }\n\n      var internalModel;\n\n      if (value._internalModel) {\n        internalModel = value._internalModel;\n      } else {\n        internalModel = value;\n      } // TODO IGOR DAVID assert if no id is present\n\n\n      return {\n        type: internalModel.modelName,\n        id: internalModel.id\n      };\n    }\n    /*\n      Used to notify the store to update FilteredRecordArray membership.\n       @method updateRecordArrays\n      @private\n    */\n\n\n    updateRecordArrays() {\n      // @ts-ignore: Store is untyped and typescript does not detect instance props set in `init`\n      this.store.recordArrayManager.recordDidChange(this);\n    }\n\n    setId(id) {\n\n      var didChange = id !== this._id;\n      this._id = id;\n      Ember.set(this, '_tag', this._tag + 1);\n\n      if (didChange && id !== null) {\n        this.store.setRecordId(this.modelName, id, this.clientId); // internal set of ID to get it to RecordData from DS.Model\n\n        if (this._recordData.__setId) {\n          this._recordData.__setId(id);\n        }\n      }\n\n      if (didChange && this.hasRecord) {\n        {\n          this.notifyPropertyChange('id');\n        }\n      }\n    }\n\n    didError(error) {\n      {\n        this.error = error;\n        this.isError = true;\n\n        if (this.hasRecord) {\n          this._record.setProperties({\n            isError: true,\n            adapterError: error\n          });\n        }\n      }\n    }\n\n    didCleanError() {\n      {\n        this.error = null;\n        this.isError = false;\n\n        if (this.hasRecord) {\n          this._record.setProperties({\n            isError: false,\n            adapterError: null\n          });\n        }\n      }\n    }\n    /*\n      If the adapter did not return a hash in response to a commit,\n      merge the changed attributes and relationships into the existing\n      saved data.\n       @method adapterDidCommit\n    */\n\n\n    adapterDidCommit(data) {\n      this.didCleanError();\n\n      var changedKeys = this._recordData.didCommit(data);\n\n      this.send('didCommit');\n      this.updateRecordArrays();\n\n      if (!data) {\n        return;\n      }\n\n      {\n        this._record._notifyProperties(changedKeys);\n      }\n    }\n\n    addErrorMessageToAttribute(attribute, message) {\n      Ember.get(this.getRecord(), 'errors')._add(attribute, message);\n    }\n\n    removeErrorMessageFromAttribute(attribute) {\n      Ember.get(this.getRecord(), 'errors')._remove(attribute);\n    }\n\n    clearErrorMessages() {\n      Ember.get(this.getRecord(), 'errors')._clear();\n    }\n\n    hasErrors() {\n      {\n        var _errors = Ember.get(this.getRecord(), 'errors');\n\n        return _errors.get('length') > 0;\n      }\n    } // FOR USE DURING COMMIT PROCESS\n\n    /*\n      @method adapterDidInvalidate\n      @private\n    */\n\n\n    adapterDidInvalidate(parsedErrors, error) {\n      {\n        var _attribute;\n\n        for (_attribute in parsedErrors) {\n          if (hasOwnProperty.call(parsedErrors, _attribute)) {\n            this.addErrorMessageToAttribute(_attribute, parsedErrors[_attribute]);\n          }\n        }\n\n        this.send('becameInvalid');\n\n        this._recordData.commitWasRejected();\n      }\n    }\n\n    notifyErrorsChange() {\n      var invalidErrors;\n\n      if (this._recordData.getErrors) {\n        invalidErrors = this._recordData.getErrors( this.identifier ) || [];\n      } else {\n        return;\n      }\n\n      this.notifyInvalidErrorsChange(invalidErrors);\n    }\n\n    notifyInvalidErrorsChange(jsonApiErrors) {\n      {\n        this.getRecord().invalidErrorsChanged(jsonApiErrors);\n      }\n    }\n    /*\n      @method adapterDidError\n      @private\n    */\n\n\n    adapterDidError(error) {\n      this.send('becameError');\n      this.didError(error);\n\n      this._recordData.commitWasRejected();\n    }\n\n    toString() {\n      return `<${this.modelName}:${this.id}>`;\n    }\n\n    referenceFor(kind, name) {\n      var reference = this.references[name];\n\n      if (!reference) {\n        // TODO IGOR AND DAVID REFACTOR\n        var relationship = relationshipStateFor$1(this, name);\n\n        if ( kind) {\n          var modelName = this.modelName;\n          ( !(!!relationship) && Ember.assert(`There is no ${kind} relationship named '${name}' on a model of modelClass '${modelName}'`, !!relationship));\n          var actualRelationshipKind = relationship.relationshipMeta.kind;\n          ( !(actualRelationshipKind === kind) && Ember.assert(`You tried to get the '${name}' relationship on a '${modelName}' via record.${kind}('${name}'), but the relationship is of kind '${actualRelationshipKind}'. Use record.${actualRelationshipKind}('${name}') instead.`, actualRelationshipKind === kind));\n        }\n\n        var relationshipKind = relationship.relationshipMeta.kind;\n\n        if (relationshipKind === 'belongsTo') {\n          reference = new BelongsToReference(this.store, this, relationship, name);\n        } else if (relationshipKind === 'hasMany') {\n          reference = new HasManyReference(this.store, this, relationship, name);\n        }\n\n        this.references[name] = reference;\n      }\n\n      return reference;\n    }\n\n  }\n\n  function handleCompletedRelationshipRequest(internalModel, key, relationship, value, error) {\n    delete internalModel._relationshipPromisesCache[key];\n    relationship.setShouldForceReload(false);\n\n    if (error) {\n      relationship.setHasFailedLoadAttempt(true);\n      var proxy = internalModel._relationshipProxyCache[key]; // belongsTo relationships are sometimes unloaded\n      // when a load fails, in this case we need\n      // to make sure that we aren't proxying\n      // to destroyed content\n      // for the sync belongsTo reload case there will be no proxy\n      // for the async reload case there will be no proxy if the ui\n      // has never been accessed\n\n      if (proxy && relationship.kind === 'belongsTo') {\n        if (proxy.content && proxy.content.isDestroying) {\n          proxy.set('content', null);\n        }\n      }\n\n      throw error;\n    }\n\n    relationship.setHasFailedLoadAttempt(false); // only set to not stale if no error is thrown\n\n    relationship.setRelationshipIsStale(false);\n    return value;\n  }\n\n  function assertRecordsPassedToHasMany(records) {\n    // TODO only allow native arrays\n    ( !(Array.isArray(records) || Ember.Array.detect(records)) && Ember.assert(`You must pass an array of records to set a hasMany relationship`, Array.isArray(records) || Ember.Array.detect(records)));\n    ( !(function () {\n      return Ember.A(records).every(record => hasOwnProperty.call(record, '_internalModel') === true);\n    }()) && Ember.assert(`All elements of a hasMany relationship must be instances of Model, you passed ${Ember.inspect(records)}`, function () {\n      return Ember.A(records).every(record => hasOwnProperty.call(record, '_internalModel') === true);\n    }()));\n  }\n  function extractRecordDatasFromRecords(records) {\n    return records.map(extractRecordDataFromRecord);\n  }\n  function extractRecordDataFromRecord(recordOrPromiseRecord) {\n    if (!recordOrPromiseRecord) {\n      return null;\n    }\n\n    if (recordOrPromiseRecord.then) {\n      var content = recordOrPromiseRecord.get && recordOrPromiseRecord.get('content');\n      ( !(content !== undefined) && Ember.assert('You passed in a promise that did not originate from an EmberData relationship. You can only pass promises that come from a belongsTo or hasMany relationship to the get call.', content !== undefined));\n      return content ? recordDataFor(content) : null;\n    }\n\n    return recordDataFor(recordOrPromiseRecord);\n  }\n\n  /**\n    @module @ember-data/store\n  */\n\n  /**\n   `InternalModelMap` is a custom storage map for internalModels of a given modelName\n   used by `IdentityMap`.\n\n   It was extracted from an implicit pojo based \"internalModel map\" and preserves\n   that interface while we work towards a more official API.\n\n   @class InternalModelMap\n   @private\n   */\n  class InternalModelMap {\n    constructor(modelName) {\n      this.modelName = modelName;\n      this._idToModel = Object.create(null);\n      this._models = [];\n      this._metadata = null;\n    }\n    /**\n     * @method get\n     * @param id {String}\n     * @return {InternalModel}\n     */\n\n\n    get(id) {\n      return this._idToModel[id] || null;\n    }\n\n    has(id) {\n      return !!this._idToModel[id];\n    }\n\n    get length() {\n      return this._models.length;\n    }\n\n    set(id, internalModel) {\n      ( !(typeof id === 'string' && id.length > 0) && Ember.assert(`You cannot index an internalModel by an empty id'`, typeof id === 'string' && id.length > 0));\n      ( !(internalModel instanceof InternalModel) && Ember.assert(`You cannot set an index for an internalModel to something other than an internalModel`, internalModel instanceof InternalModel));\n      ( !(this.contains(internalModel)) && Ember.assert(`You cannot set an index for an internalModel that is not in the InternalModelMap`, this.contains(internalModel)));\n      ( !(!this.has(id) || this.get(id) === internalModel) && Ember.assert(`You cannot update the id index of an InternalModel once set. Attempted to update ${id}.`, !this.has(id) || this.get(id) === internalModel));\n      this._idToModel[id] = internalModel;\n    }\n\n    add(internalModel, id) {\n      ( !(!this.contains(internalModel)) && Ember.assert(`You cannot re-add an already present InternalModel to the InternalModelMap.`, !this.contains(internalModel)));\n\n      if (id) {\n        ( !(!this.has(id) || this.get(id) === internalModel) && Ember.assert(`Duplicate InternalModel for ${this.modelName}:${id} detected.`, !this.has(id) || this.get(id) === internalModel));\n        this._idToModel[id] = internalModel;\n      }\n\n      this._models.push(internalModel);\n    }\n\n    remove(internalModel, id) {\n      delete this._idToModel[id];\n\n      var loc = this._models.indexOf(internalModel);\n\n      if (loc !== -1) {\n        this._models.splice(loc, 1);\n      }\n    }\n\n    contains(internalModel) {\n      return this._models.indexOf(internalModel) !== -1;\n    }\n    /**\n     An array of all models of this modelName\n     @property models\n     @type Array\n     */\n\n\n    get models() {\n      return this._models;\n    }\n    /**\n     * meta information about internalModels\n     * @property metadata\n     * @type Object\n     */\n\n\n    get metadata() {\n      return this._metadata || (this._metadata = Object.create(null));\n    }\n    /**\n     Destroy all models in the internalModelTest and wipe metadata.\n      @method clear\n     */\n\n\n    clear() {\n      var internalModels = this._models;\n      this._models = [];\n\n      for (var i = 0; i < internalModels.length; i++) {\n        var internalModel = internalModels[i];\n        internalModel.unloadRecord();\n      }\n\n      this._metadata = null;\n    }\n\n  }\n\n  /**\n    @module @ember-data/store\n  */\n\n  /**\n   `IdentityMap` is a custom storage map for records by modelName\n   used by `Store`.\n\n   @class IdentityMap\n   @private\n   */\n  class IdentityMap {\n    constructor() {\n      this._map = Object.create(null);\n    }\n\n    /**\n     Retrieves the `InternalModelMap` for a given modelName,\n     creating one if one did not already exist. This is\n     similar to `getWithDefault` or `get` on a `MapWithDefault`\n      @method retrieve\n     @param modelName a previously normalized modelName\n     @return {InternalModelMap} the InternalModelMap for the given modelName\n     */\n    retrieve(modelName) {\n      var map = this._map[modelName];\n\n      if (map === undefined) {\n        map = this._map[modelName] = new InternalModelMap(modelName);\n      }\n\n      return map;\n    }\n    /**\n     Clears the contents of all known `RecordMaps`, but does\n     not remove the InternalModelMap instances.\n      @method clear\n     */\n\n\n    clear() {\n      var map = this._map;\n      var keys = Object.keys(map);\n\n      for (var i = 0; i < keys.length; i++) {\n        var key = keys[i];\n        map[key].clear();\n      }\n    }\n\n  }\n\n  function constructResource(type, id, lid) {\n    var trueId = coerceId(id);\n\n    if (!isNonEmptyString(trueId)) {\n      if (isNonEmptyString(lid)) {\n        return {\n          type,\n          id: trueId,\n          lid\n        };\n      }\n\n      throw new Error(`Expected either id or lid to be a valid string`);\n    }\n\n    if (isNonEmptyString(lid)) {\n      return {\n        type,\n        id: trueId,\n        lid\n      };\n    }\n\n    return {\n      type,\n      id: trueId\n    };\n  }\n\n  /**\n    @module @ember-data/store\n  */\n\n  var FactoryCache = new WeakMap();\n  var RecordCache = new WeakMap();\n  function peekRecordIdentifier(record) {\n    return RecordCache.get(record);\n  }\n  function recordIdentifierFor(record) {\n    var identifier = RecordCache.get(record);\n\n    if ( identifier === undefined) {\n      throw new Error(`${record} is not a record instantiated by @ember-data/store`);\n    }\n\n    return identifier;\n  }\n  function setRecordIdentifier(record, identifier) {\n    if ( RecordCache.has(record)) {\n      throw new Error(`${record} was already assigned an identifier`);\n    }\n    /*\n    It would be nice to do a reverse check here that an identifier has not\n    previously been assigned a record; however, unload + rematerialization\n    prevents us from having a great way of doing so when CustomRecordClasses\n    don't necessarily give us access to a `isDestroyed` for dematerialized\n    instance.\n    */\n\n\n    RecordCache.set(record, identifier);\n  }\n  function internalModelFactoryFor(store) {\n    var factory = FactoryCache.get(store);\n\n    if (factory === undefined) {\n      factory = new InternalModelFactory(store);\n      FactoryCache.set(store, factory);\n    }\n\n    return factory;\n  }\n  /**\n   * The InternalModelFactory handles the lifecyle of\n   * instantiating, caching, and destroying InternalModel\n   * instances.\n   *\n   * @internal\n   */\n\n  class InternalModelFactory {\n    constructor(store) {\n      this.store = store;\n      this._identityMap = void 0;\n      this._newlyCreated = void 0;\n      this.identifierCache = void 0;\n      this.identifierCache = identifierCacheFor(store);\n\n      this.identifierCache.__configureMerge((identifier, matchedIdentifier, resourceData) => {\n        var intendedIdentifier = identifier.id === resourceData.id ? identifier : matchedIdentifier;\n        var altIdentifier = identifier.id === resourceData.id ? matchedIdentifier : identifier; // check for duplicate InternalModel's\n\n        var map = this.modelMapFor(identifier.type);\n        var im = map.get(intendedIdentifier.lid);\n        var otherIm = map.get(altIdentifier.lid); // we cannot merge internalModels when both have records\n        // (this may not be strictly true, we could probably swap the internalModel the record points at)\n\n        if (im && otherIm && im.hasRecord && otherIm.hasRecord) {\n          throw new Error(`Failed to update the 'id' for the RecordIdentifier '${identifier}' to '${resourceData.id}', because that id is already in use by '${matchedIdentifier}'`);\n        } // remove otherIm from cache\n\n\n        if (otherIm) {\n          map.remove(otherIm, altIdentifier.lid);\n        }\n\n        if (im === null && otherIm === null) {\n          // nothing more to do\n          return intendedIdentifier; // only the other has an InternalModel\n          // OR only the other has a Record\n        } else if (im === null && otherIm !== null || im && !im.hasRecord && otherIm && otherIm.hasRecord) {\n          if (im) {\n            // TODO check if we are retained in any async relationships\n            map.remove(im, intendedIdentifier.lid); // im.destroy();\n          }\n\n          im = otherIm; // TODO do we need to notify the id change?\n\n          im._id = intendedIdentifier.id;\n          map.add(im, intendedIdentifier.lid); // just use im\n        }\n\n        return intendedIdentifier;\n      });\n\n      this._identityMap = new IdentityMap();\n    }\n    /**\n     * Retrieve the InternalModel for a given { type, id, lid }.\n     *\n     * If an InternalModel does not exist, it instantiates one.\n     *\n     * If an InternalModel does exist bus has a scheduled destroy,\n     *   the scheduled destroy will be cancelled.\n     *\n     * @internal\n     */\n\n\n    lookup(resource, data) {\n      if ( data !== undefined) {\n        // if we've been given data associated with this lookup\n        // we must first give secondary-caches for LIDs the\n        // opportunity to populate based on it\n        this.identifierCache.getOrCreateRecordIdentifier(data);\n      }\n\n      var identifier = this.identifierCache.getOrCreateRecordIdentifier(resource);\n      var internalModel = this.peek(identifier);\n\n      if (internalModel) {\n        // unloadRecord is async, if one attempts to unload + then sync push,\n        //   we must ensure the unload is canceled before continuing\n        //   The createRecord path will take _existingInternalModelForId()\n        //   which will call `destroySync` instead for this unload + then\n        //   sync createRecord scenario. Once we have true client-side\n        //   delete signaling, we should never call destroySync\n        if (internalModel.hasScheduledDestroy()) {\n          internalModel.cancelDestroy();\n        }\n\n        return internalModel;\n      }\n\n      return this._build(identifier, false);\n    }\n    /**\n     * Peek the InternalModel for a given { type, id, lid }.\n     *\n     * If an InternalModel does not exist, return `null`.\n     *\n     * @internal\n     */\n\n\n    peek(identifier) {\n      {\n        return this.modelMapFor(identifier.type).get(identifier.lid);\n      }\n    }\n\n    getByResource(resource) {\n      {\n        var normalizedResource = constructResource(resource.type, resource.id, resource.lid);\n        return this.lookup(normalizedResource);\n      }\n    }\n\n    setRecordId(type, id, lid) {\n      var resource = {\n        type,\n        id: null,\n        lid\n      };\n      var identifier = this.identifierCache.getOrCreateRecordIdentifier(resource);\n      var internalModel = this.peek(identifier);\n\n      if (internalModel === null) {\n        throw new Error(`Cannot set the id ${id} on the record ${type}:${lid} as there is no such record in the cache.`);\n      }\n\n      var oldId = internalModel.id;\n      var modelName = internalModel.modelName; // ID absolutely can't be missing if the oldID is empty (missing Id in response for a new record)\n\n      ( !(!(id === null && oldId === null)) && Ember.assert(`'${modelName}' was saved to the server, but the response does not have an id and your record does not either.`, !(id === null && oldId === null))); // ID absolutely can't be different than oldID if oldID is not null\n      // TODO this assertion and restriction may not strictly be needed in the identifiers world\n\n      ( !(!(oldId !== null && id !== oldId)) && Ember.assert(`Cannot update the id for '${modelName}:${lid}' from '${oldId}' to '${id}'.`, !(oldId !== null && id !== oldId))); // ID can be null if oldID is not null (altered ID in response for a record)\n      // however, this is more than likely a developer error.\n\n      if (oldId !== null && id === null) {\n        ( Ember.warn(`Your ${modelName} record was saved to the server, but the response does not have an id.`, !(oldId !== null && id === null)));\n        return;\n      }\n\n      var existingInternalModel = this.peekById(modelName, id);\n      ( !(Ember.isNone(existingInternalModel) || existingInternalModel === internalModel) && Ember.assert(`'${modelName}' was saved to the server, but the response returned the new id '${id}', which has already been used with another record.'`, Ember.isNone(existingInternalModel) || existingInternalModel === internalModel));\n\n      if (identifier.id === null) {\n        this.identifierCache.updateRecordIdentifier(identifier, {\n          type,\n          id\n        });\n      }\n\n      internalModel.setId(id);\n    }\n\n    peekById(type, id) {\n      var identifier = this.identifierCache.peekRecordIdentifier({\n        type,\n        id\n      });\n      var internalModel;\n\n      {\n        internalModel = identifier ? this.modelMapFor(type).get(identifier.lid) : null;\n      }\n\n      if (internalModel && internalModel.hasScheduledDestroy()) {\n        // unloadRecord is async, if one attempts to unload + then sync create,\n        //   we must ensure the unload is complete before starting the create\n        //   The push path will take this.lookup()\n        //   which will call `cancelDestroy` instead for this unload + then\n        //   sync push scenario. Once we have true client-side\n        //   delete signaling, we should never call destroySync\n        internalModel.destroySync();\n        internalModel = null;\n      }\n\n      return internalModel;\n    }\n\n    build(newResourceInfo) {\n      return this._build(newResourceInfo, true);\n    }\n\n    _build(resource, isCreate = false) {\n      if (isCreate === true && resource.id) {\n        var existingInternalModel = this.peekById(resource.type, resource.id);\n        ( !(!existingInternalModel) && Ember.assert(`The id ${resource.id} has already been used with another '${resource.type}' record.`, !existingInternalModel));\n      }\n\n      var {\n        identifierCache\n      } = this;\n      var identifier;\n\n      if (isCreate === true) {\n        identifier = identifierCache.createIdentifierForNewRecord(resource);\n      } else {\n        identifier = resource;\n      } // lookupFactory should really return an object that creates\n      // instances with the injections applied\n\n\n      var internalModel = new InternalModel(this.store, identifier);\n\n      {\n        this.modelMapFor(resource.type).add(internalModel, identifier.lid);\n      }\n\n      return internalModel;\n    }\n\n    remove(internalModel) {\n      var recordMap = this.modelMapFor(internalModel.modelName);\n      var clientId = internalModel.identifier.lid;\n\n      {\n        recordMap.remove(internalModel, clientId);\n      }\n\n      var {\n        identifier\n      } = internalModel;\n      this.identifierCache.forgetRecordIdentifier(identifier);\n    }\n\n    modelMapFor(type) {\n      return this._identityMap.retrieve(type);\n    }\n\n    _newlyCreatedModelsFor(type) {\n      return this._newlyCreated.retrieve(type);\n    }\n\n    clear(type) {\n      if (type === undefined) {\n        this._identityMap.clear();\n      } else {\n        this.modelMapFor(type).clear();\n      }\n    }\n\n  }\n\n  class RecordDataStoreWrapper {\n    constructor(_store) {\n      this._store = _store;\n      this[BRAND_SYMBOL] = void 0;\n      this._willUpdateManyArrays = void 0;\n      this._pendingManyArrayUpdates = void 0;\n      this._willUpdateManyArrays = false;\n      this._pendingManyArrayUpdates = [];\n    }\n\n    get identifierCache() {\n\n      return identifierCacheFor(this._store);\n    }\n    /**\n     * Exists so that DefaultRecordData can check for model types\n     * in DEBUG for relationships. Should be refactored away.\n     *\n     * @internal\n     */\n\n\n    _hasModelFor(type) {\n      return this._store._hasModelFor(type);\n    }\n    /**\n     * @internal\n     */\n\n\n    _scheduleManyArrayUpdate(identifier, key) {\n      var pending = this._pendingManyArrayUpdates = this._pendingManyArrayUpdates || [];\n      pending.push(identifier, key);\n\n      if (this._willUpdateManyArrays === true) {\n        return;\n      }\n\n      this._willUpdateManyArrays = true;\n      var backburner = this._store._backburner;\n      backburner.join(() => {\n        backburner.schedule('syncRelationships', this, this._flushPendingManyArrayUpdates);\n      });\n    }\n\n    notifyErrorsChange(type, id, lid) {\n      var resource = constructResource(type, id, lid);\n      var identifier = identifierCacheFor(this._store).getOrCreateRecordIdentifier(resource);\n      var internalModel = internalModelFactoryFor(this._store).peek(identifier);\n\n      if (internalModel) {\n        internalModel.notifyErrorsChange();\n      }\n    }\n\n    _flushPendingManyArrayUpdates() {\n      if (this._willUpdateManyArrays === false) {\n        return;\n      }\n\n      var pending = this._pendingManyArrayUpdates;\n      this._pendingManyArrayUpdates = [];\n      this._willUpdateManyArrays = false;\n      var factory = internalModelFactoryFor(this._store);\n\n      for (var i = 0; i < pending.length; i += 2) {\n        var identifier = pending[i];\n        var _key = pending[i + 1];\n        var internalModel = factory.peek(identifier);\n\n        if (internalModel) {\n          internalModel.notifyHasManyChange(_key);\n        }\n      }\n    }\n\n    attributesDefinitionFor(type) {\n      return this._store._attributesDefinitionFor(type);\n    }\n\n    relationshipsDefinitionFor(type) {\n      return this._store._relationshipsDefinitionFor(type);\n    }\n\n    inverseForRelationship(type, key) {\n      var modelClass = this._store.modelFor(type);\n\n      var definition = upgradeForInternal(this.relationshipsDefinitionFor(type)[key]);\n\n      {\n        return definition._inverseKey(this._store, modelClass);\n      }\n    }\n\n    inverseIsAsyncForRelationship(type, key) {\n      var modelClass = this._store.modelFor(type);\n\n      var definition = upgradeForInternal(this.relationshipsDefinitionFor(type)[key]);\n\n      {\n        return definition._inverseIsAsync(this._store, modelClass);\n      }\n    }\n\n    notifyPropertyChange(type, id, lid, key) {\n      var resource = constructResource(type, id, lid);\n      var identifier = identifierCacheFor(this._store).getOrCreateRecordIdentifier(resource);\n      var internalModel = internalModelFactoryFor(this._store).peek(identifier);\n\n      if (internalModel) {\n        internalModel.notifyPropertyChange(key);\n      }\n    }\n\n    notifyHasManyChange(type, id, lid, key) {\n      var resource = constructResource(type, id, lid);\n      var identifier = identifierCacheFor(this._store).getOrCreateRecordIdentifier(resource);\n\n      this._scheduleManyArrayUpdate(identifier, key);\n    }\n\n    notifyBelongsToChange(type, id, lid, key) {\n      var resource = constructResource(type, id, lid);\n      var identifier = identifierCacheFor(this._store).getOrCreateRecordIdentifier(resource);\n      var internalModel = internalModelFactoryFor(this._store).peek(identifier);\n\n      if (internalModel) {\n        internalModel.notifyBelongsToChange(key);\n      }\n    }\n\n    notifyStateChange(type, id, lid, key) {\n      var resource = constructResource(type, id, lid);\n      var identifier = identifierCacheFor(this._store).getOrCreateRecordIdentifier(resource);\n      var internalModel = internalModelFactoryFor(this._store).peek(identifier);\n\n      if (internalModel) {\n        internalModel.notifyStateChange(key);\n      }\n    }\n\n    recordDataFor(type, id, lid) {\n      var identifier;\n      var isCreate = false;\n\n      if (!id && !lid) {\n        isCreate = true;\n        identifier = {\n          type\n        };\n      } else {\n        var resource = constructResource(type, id, lid);\n        identifier = identifierCacheFor(this._store).getOrCreateRecordIdentifier(resource);\n      }\n\n      return this._store.recordDataFor(identifier, isCreate);\n    }\n\n    setRecordId(type, id, lid) {\n      this._store.setRecordId(type, id, lid);\n    }\n\n    isRecordInUse(type, id, lid) {\n      var resource = constructResource(type, id, lid);\n      var identifier = identifierCacheFor(this._store).getOrCreateRecordIdentifier(resource);\n      var internalModel = internalModelFactoryFor(this._store).peek(identifier);\n\n      if (!internalModel) {\n        return false;\n      }\n\n      return internalModel.isRecordInUse();\n    }\n\n    disconnectRecord(type, id, lid) {\n      var resource = constructResource(type, id, lid);\n      var identifier = identifierCacheFor(this._store).getOrCreateRecordIdentifier(resource);\n      var internalModel = internalModelFactoryFor(this._store).peek(identifier);\n\n      if (internalModel) {\n        internalModel.destroyFromRecordData();\n      }\n    }\n\n  }\n\n  /**\n    @module @ember-data/store\n  */\n\n  /*\n    This is a helper method that validates a JSON API top-level document\n\n    The format of a document is described here:\n    http://jsonapi.org/format/#document-top-level\n\n    @method validateDocumentStructure\n    @param {Object} doc JSON API document\n    @return {array} An array of errors found in the document structure\n  */\n  function validateDocumentStructure(doc) {\n    var errors = [];\n\n    if (!doc || typeof doc !== 'object') {\n      errors.push('Top level of a JSON API document must be an object');\n    } else {\n      if (!('data' in doc) && !('errors' in doc) && !('meta' in doc)) {\n        errors.push('One or more of the following keys must be present: \"data\", \"errors\", \"meta\".');\n      } else {\n        if ('data' in doc && 'errors' in doc) {\n          errors.push('Top level keys \"errors\" and \"data\" cannot both be present in a JSON API document');\n        }\n      }\n\n      if ('data' in doc) {\n        if (!(doc.data === null || Array.isArray(doc.data) || typeof doc.data === 'object')) {\n          errors.push('data must be null, an object, or an array');\n        }\n      }\n\n      if ('meta' in doc) {\n        if (typeof doc.meta !== 'object') {\n          errors.push('meta must be an object');\n        }\n      }\n\n      if ('errors' in doc) {\n        if (!Array.isArray(doc.errors)) {\n          errors.push('errors must be an array');\n        }\n      }\n\n      if ('links' in doc) {\n        if (typeof doc.links !== 'object') {\n          errors.push('links must be an object');\n        }\n      }\n\n      if ('jsonapi' in doc) {\n        if (typeof doc.jsonapi !== 'object') {\n          errors.push('jsonapi must be an object');\n        }\n      }\n\n      if ('included' in doc) {\n        if (typeof doc.included !== 'object') {\n          errors.push('included must be an array');\n        }\n      }\n    }\n\n    return errors;\n  }\n  /*\n    This is a helper method that always returns a JSON-API Document.\n\n    @method normalizeResponseHelper\n    @param {Serializer} serializer\n    @param {Store} store\n    @param {subclass of Model} modelClass\n    @param {Object} payload\n    @param {String|Number} id\n    @param {String} requestType\n    @return {Object} JSON-API Document\n  */\n\n  function normalizeResponseHelper(serializer, store, modelClass, payload, id, requestType) {\n    var normalizedResponse = serializer.normalizeResponse(store, modelClass, payload, id, requestType);\n    var validationErrors = [];\n\n    {\n      validationErrors = validateDocumentStructure(normalizedResponse);\n    }\n\n    ( !(validationErrors.length === 0) && Ember.assert(`normalizeResponse must return a valid JSON API document:\\n\\t* ${validationErrors.join('\\n\\t* ')}`, validationErrors.length === 0));\n    return normalizedResponse;\n  }\n\n  var RequestStateEnum;\n\n  (function (RequestStateEnum) {\n    RequestStateEnum[\"pending\"] = \"pending\";\n    RequestStateEnum[\"fulfilled\"] = \"fulfilled\";\n    RequestStateEnum[\"rejected\"] = \"rejected\";\n  })(RequestStateEnum || (RequestStateEnum = {}));\n\n  var emberRun = Ember.run.backburner;\n\n  /**\n    @module @ember-data/store\n  */\n  function payloadIsNotBlank(adapterPayload) {\n    if (Array.isArray(adapterPayload)) {\n      return true;\n    } else {\n      return Object.keys(adapterPayload || {}).length;\n    }\n  }\n\n  function _find(adapter, store, modelClass, id, internalModel, options) {\n\n    var snapshot = internalModel.createSnapshot(options);\n    var {\n      modelName\n    } = internalModel;\n    var promise = Ember.RSVP.Promise.resolve().then(() => {\n      return adapter.findRecord(store, modelClass, id, snapshot);\n    });\n    var label = `DS: Handle Adapter#findRecord of '${modelName}' with id: '${id}'`;\n    var {\n      identifier\n    } = internalModel;\n    promise = guardDestroyedStore(promise, store, label);\n    return promise.then(adapterPayload => {\n      ( !(payloadIsNotBlank(adapterPayload)) && Ember.assert(`You made a 'findRecord' request for a '${modelName}' with id '${id}', but the adapter's response did not have any data`, payloadIsNotBlank(adapterPayload)));\n      var serializer = store.serializerFor(modelName);\n      var payload = normalizeResponseHelper(serializer, store, modelClass, adapterPayload, id, 'findRecord');\n      ( !(!Array.isArray(payload.data)) && Ember.assert(`Ember Data expected the primary data returned from a 'findRecord' response to be an object but instead it found an array.`, !Array.isArray(payload.data)));\n      ( Ember.warn(`You requested a record of type '${modelName}' with id '${id}' but the adapter returned a payload with primary data having an id of '${payload.data.id}'. Use 'store.findRecord()' when the requested id is the same as the one returned by the adapter. In other cases use 'store.queryRecord()' instead.`, coerceId(payload.data.id) === coerceId(id), {\n        id: 'ds.store.findRecord.id-mismatch'\n      }));\n\n      {\n        // ensure that regardless of id returned we assign to the correct record\n        payload.data.lid = identifier.lid;\n      }\n\n      return store._push(payload);\n    }, error => {\n      internalModel.notFound();\n\n      if (internalModel.isEmpty()) {\n        internalModel.unloadRecord();\n      }\n\n      throw error;\n    }, `DS: Extract payload of '${modelName}'`);\n  }\n  function _findMany(adapter, store, modelName, ids, internalModels, optionsMap) {\n    var snapshots = Ember.A(internalModels.map(internalModel => internalModel.createSnapshot(optionsMap.get(internalModel))));\n    var modelClass = store.modelFor(modelName); // `adapter.findMany` gets the modelClass still\n\n    var promise = adapter.findMany(store, modelClass, ids, snapshots);\n    var label = `DS: Handle Adapter#findMany of '${modelName}'`;\n\n    if (promise === undefined) {\n      throw new Error('adapter.findMany returned undefined, this was very likely a mistake');\n    }\n\n    promise = guardDestroyedStore(promise, store, label);\n    return promise.then(adapterPayload => {\n      ( !(payloadIsNotBlank(adapterPayload)) && Ember.assert(`You made a 'findMany' request for '${modelName}' records with ids '[${ids}]', but the adapter's response did not have any data`, payloadIsNotBlank(adapterPayload)));\n      var serializer = store.serializerFor(modelName);\n      var payload = normalizeResponseHelper(serializer, store, modelClass, adapterPayload, null, 'findMany');\n      return store._push(payload);\n    }, null, `DS: Extract payload of ${modelName}`);\n  }\n\n  function iterateData(data, fn) {\n    if (Array.isArray(data)) {\n      return data.map(fn);\n    } else {\n      return fn(data);\n    }\n  } // sync\n  // iterate over records in payload.data\n  // for each record\n  //   assert that record.relationships[inverse] is either undefined (so we can fix it)\n  //     or provide a data: {id, type} that matches the record that requested it\n  //   return the relationship data for the parent\n\n\n  function syncRelationshipDataFromLink(store, payload, parentInternalModel, relationship) {\n    // ensure the right hand side (incoming payload) points to the parent record that\n    // requested this relationship\n    var relationshipData = iterateData(payload.data, (data, index) => {\n      var {\n        id,\n        type\n      } = data;\n      ensureRelationshipIsSetToParent(data, parentInternalModel, store, relationship, index);\n      return {\n        id,\n        type\n      };\n    }); // now, push the left hand side (the parent record) to ensure things are in sync, since\n    // the payload will be pushed with store._push\n\n    var parentPayload = {\n      id: parentInternalModel.id,\n      type: parentInternalModel.modelName,\n      relationships: {\n        [relationship.key]: {\n          meta: payload.meta,\n          links: payload.links,\n          data: relationshipData\n        }\n      }\n    };\n\n    if (!Array.isArray(payload.included)) {\n      payload.included = [];\n    }\n\n    payload.included.push(parentPayload);\n    return payload;\n  }\n\n  function ensureRelationshipIsSetToParent(payload, parentInternalModel, store, parentRelationship, index) {\n    var {\n      id,\n      type\n    } = payload;\n\n    if (!payload.relationships) {\n      payload.relationships = {};\n    }\n\n    var {\n      relationships\n    } = payload;\n    var inverse = getInverse(store, parentInternalModel, parentRelationship, type);\n\n    if (inverse) {\n      var {\n        inverseKey,\n        kind\n      } = inverse;\n      var relationshipData = relationships[inverseKey] && relationships[inverseKey].data;\n\n      if ( typeof relationshipData !== 'undefined' && !relationshipDataPointsToParent(relationshipData, parentInternalModel)) {\n        var quotedType = Ember.inspect(type);\n        var quotedInverse = Ember.inspect(inverseKey);\n        var expected = Ember.inspect({\n          id: parentInternalModel.id,\n          type: parentInternalModel.modelName\n        });\n        var expectedModel = Ember.inspect(parentInternalModel);\n        var got = Ember.inspect(relationshipData);\n        var prefix = typeof index === 'number' ? `data[${index}]` : `data`;\n        var path = `${prefix}.relationships.${inverseKey}.data`;\n        var other = relationshipData ? `<${relationshipData.type}:${relationshipData.id}>` : null;\n        var relationshipFetched = `${Ember.inspect(parentInternalModel)}.${parentRelationship.kind}(\"${parentRelationship.name}\")`;\n        var includedRecord = `<${type}:${id}>`;\n        var message = [`Encountered mismatched relationship: Ember Data expected ${path} in the payload from ${relationshipFetched} to include ${expected} but got ${got} instead.\\n`, `The ${includedRecord} record loaded at ${prefix} in the payload specified ${other} as its ${quotedInverse}, but should have specified ${expectedModel} (the record the relationship is being loaded from) as its ${quotedInverse} instead.`, `This could mean that the response for ${relationshipFetched} may have accidentally returned ${quotedType} records that aren't related to ${expectedModel} and could be related to a different ${parentInternalModel.modelName} record instead.`, `Ember Data has corrected the ${includedRecord} record's ${quotedInverse} relationship to ${expectedModel} so that ${relationshipFetched} will include ${includedRecord}.`, `Please update the response from the server or change your serializer to either ensure that the response for only includes ${quotedType} records that specify ${expectedModel} as their ${quotedInverse}, or omit the ${quotedInverse} relationship from the response.`].join('\\n'); // this should eventually throw instead of deprecating.\n\n        ( Ember.deprecate(message + '\\n', false, {\n          id: 'mismatched-inverse-relationship-data-from-payload',\n          until: '3.8'\n        }));\n      }\n\n      if (kind !== 'hasMany' || typeof relationshipData !== 'undefined') {\n        relationships[inverseKey] = relationships[inverseKey] || {};\n        relationships[inverseKey].data = fixRelationshipData(relationshipData, kind, parentInternalModel);\n      }\n    }\n  }\n\n  function getInverse(store, parentInternalModel, parentRelationship, type) {\n    return recordDataFindInverseRelationshipInfo(store, parentInternalModel, parentRelationship, type);\n  }\n\n  function recordDataFindInverseRelationshipInfo({\n    _storeWrapper\n  }, parentInternalModel, parentRelationship, type) {\n    var {\n      name: lhs_relationshipName\n    } = parentRelationship;\n    var {\n      modelName\n    } = parentInternalModel;\n\n    var inverseKey = _storeWrapper.inverseForRelationship(modelName, lhs_relationshipName);\n\n    if (inverseKey) {\n      var {\n        meta: {\n          kind\n        }\n      } = _storeWrapper.relationshipsDefinitionFor(type)[inverseKey];\n\n      return {\n        inverseKey,\n        kind\n      };\n    }\n  }\n\n  function relationshipDataPointsToParent(relationshipData, internalModel) {\n    if (relationshipData === null) {\n      return false;\n    }\n\n    if (Array.isArray(relationshipData)) {\n      if (relationshipData.length === 0) {\n        return false;\n      }\n\n      for (var i = 0; i < relationshipData.length; i++) {\n        var entry = relationshipData[i];\n\n        if (validateRelationshipEntry(entry, internalModel)) {\n          return true;\n        }\n      }\n    } else {\n      return validateRelationshipEntry(relationshipData, internalModel);\n    }\n\n    return false;\n  }\n\n  function fixRelationshipData(relationshipData, relationshipKind, {\n    id,\n    modelName\n  }) {\n    var parentRelationshipData = {\n      id,\n      type: modelName\n    };\n    var payload;\n\n    if (relationshipKind === 'hasMany') {\n      payload = relationshipData || [];\n      payload.push(parentRelationshipData);\n    } else {\n      payload = relationshipData || {};\n      Ember.assign(payload, parentRelationshipData);\n    }\n\n    return payload;\n  }\n\n  function validateRelationshipEntry({\n    id\n  }, {\n    id: parentModelID\n  }) {\n    return id && id.toString() === parentModelID;\n  }\n\n  function _findHasMany(adapter, store, internalModel, link, relationship, options) {\n    var snapshot = internalModel.createSnapshot(options);\n    var modelClass = store.modelFor(relationship.type);\n    var useLink = !link || typeof link === 'string';\n    var relatedLink = useLink ? link : link.href;\n    var promise = adapter.findHasMany(store, snapshot, relatedLink, relationship);\n    var label = `DS: Handle Adapter#findHasMany of '${internalModel.modelName}' : '${relationship.type}'`;\n    promise = guardDestroyedStore(promise, store, label);\n    promise = _guard(promise, _bind(_objectIsAlive, internalModel));\n    return promise.then(adapterPayload => {\n      ( !(payloadIsNotBlank(adapterPayload)) && Ember.assert(`You made a 'findHasMany' request for a ${internalModel.modelName}'s '${relationship.key}' relationship, using link '${link}' , but the adapter's response did not have any data`, payloadIsNotBlank(adapterPayload)));\n      var serializer = store.serializerFor(relationship.type);\n      var payload = normalizeResponseHelper(serializer, store, modelClass, adapterPayload, null, 'findHasMany');\n      payload = syncRelationshipDataFromLink(store, payload, internalModel, relationship);\n\n      var internalModelArray = store._push(payload);\n\n      return internalModelArray;\n    }, null, `DS: Extract payload of '${internalModel.modelName}' : hasMany '${relationship.type}'`);\n  }\n  function _findBelongsTo(adapter, store, internalModel, link, relationship, options) {\n    var snapshot = internalModel.createSnapshot(options);\n    var modelClass = store.modelFor(relationship.type);\n    var useLink = !link || typeof link === 'string';\n    var relatedLink = useLink ? link : link.href;\n    var promise = adapter.findBelongsTo(store, snapshot, relatedLink, relationship);\n    var label = `DS: Handle Adapter#findBelongsTo of ${internalModel.modelName} : ${relationship.type}`;\n    promise = guardDestroyedStore(promise, store, label);\n    promise = _guard(promise, _bind(_objectIsAlive, internalModel));\n    return promise.then(adapterPayload => {\n      var serializer = store.serializerFor(relationship.type);\n      var payload = normalizeResponseHelper(serializer, store, modelClass, adapterPayload, null, 'findBelongsTo');\n\n      if (!payload.data) {\n        return null;\n      }\n\n      payload = syncRelationshipDataFromLink(store, payload, internalModel, relationship);\n      return store._push(payload);\n    }, null, `DS: Extract payload of ${internalModel.modelName} : ${relationship.type}`);\n  }\n  function _findAll(adapter, store, modelName, options) {\n    var modelClass = store.modelFor(modelName); // adapter.findAll depends on the class\n\n    var recordArray = store.peekAll(modelName);\n\n    var snapshotArray = recordArray._createSnapshot(options);\n\n    var promise = Ember.RSVP.Promise.resolve().then(() => adapter.findAll(store, modelClass, null, snapshotArray));\n    var label = 'DS: Handle Adapter#findAll of ' + modelClass;\n    promise = guardDestroyedStore(promise, store, label);\n    return promise.then(adapterPayload => {\n      ( !(payloadIsNotBlank(adapterPayload)) && Ember.assert(`You made a 'findAll' request for '${modelName}' records, but the adapter's response did not have any data`, payloadIsNotBlank(adapterPayload)));\n      var serializer = store.serializerFor(modelName);\n      var payload = normalizeResponseHelper(serializer, store, modelClass, adapterPayload, null, 'findAll');\n\n      store._push(payload);\n\n      store._didUpdateAll(modelName);\n\n      return recordArray;\n    }, null, 'DS: Extract payload of findAll ${modelName}');\n  }\n  function _query(adapter, store, modelName, query, recordArray, options) {\n    var modelClass = store.modelFor(modelName); // adapter.query needs the class\n\n    recordArray = recordArray || store.recordArrayManager.createAdapterPopulatedRecordArray(modelName, query);\n    var promise = Ember.RSVP.Promise.resolve().then(() => adapter.query(store, modelClass, query, recordArray, options));\n    var label = `DS: Handle Adapter#query of ${modelName}`;\n    promise = guardDestroyedStore(promise, store, label);\n    return promise.then(adapterPayload => {\n      var serializer = store.serializerFor(modelName);\n      var payload = normalizeResponseHelper(serializer, store, modelClass, adapterPayload, null, 'query');\n\n      var internalModels = store._push(payload);\n\n      ( !(Array.isArray(internalModels)) && Ember.assert('The response to store.query is expected to be an array but it was a single record. Please wrap your response in an array or use `store.queryRecord` to query for a single record.', Array.isArray(internalModels)));\n\n      if (recordArray) {\n        recordArray._setInternalModels(internalModels, payload);\n      } else {\n        recordArray = store.recordArrayManager.createAdapterPopulatedRecordArray(modelName, query, internalModels, payload);\n      }\n\n      return recordArray;\n    }, null, `DS: Extract payload of query ${modelName}`);\n  }\n  function _queryRecord(adapter, store, modelName, query, options) {\n    var modelClass = store.modelFor(modelName); // adapter.queryRecord needs the class\n\n    var promise = Ember.RSVP.Promise.resolve().then(() => adapter.queryRecord(store, modelClass, query, options));\n    var label = `DS: Handle Adapter#queryRecord of ${modelName}`;\n    promise = guardDestroyedStore(promise, store, label);\n    return promise.then(adapterPayload => {\n      var serializer = store.serializerFor(modelName);\n      var payload = normalizeResponseHelper(serializer, store, modelClass, adapterPayload, null, 'queryRecord');\n      ( !(!Array.isArray(payload.data)) && Ember.assert(`Expected the primary data returned by the serializer for a 'queryRecord' response to be a single object or null but instead it was an array.`, !Array.isArray(payload.data), {\n        id: 'ds.store.queryRecord-array-response'\n      }));\n      return store._push(payload);\n    }, null, `DS: Extract payload of queryRecord ${modelName}`);\n  }\n\n  /**\n    @module @ember-data/store\n  */\n\n  /**\n    Represents an ordered list of records whose order and membership is\n    determined by the adapter. For example, a query sent to the adapter\n    may trigger a search on the server, whose results would be loaded\n    into an instance of the `AdapterPopulatedRecordArray`.\n\n    ---\n\n    If you want to update the array and get the latest records from the\n    adapter, you can invoke [`update()`](AdapterPopulatedRecordArray/methods/update?anchor=update):\n\n    Example\n\n    ```javascript\n    // GET /users?isAdmin=true\n    store.query('user', { isAdmin: true }).then(function(admins) {\n\n      admins.then(function() {\n        console.log(admins.get(\"length\")); // 42\n      });\n\n      // somewhere later in the app code, when new admins have been created\n      // in the meantime\n      //\n      // GET /users?isAdmin=true\n      admins.update().then(function() {\n        admins.get('isUpdating'); // false\n        console.log(admins.get(\"length\")); // 123\n      });\n\n      admins.get('isUpdating'); // true\n    }\n    ```\n\n    @class AdapterPopulatedRecordArray\n    @extends RecordArray\n  */\n  var AdapterPopulatedRecordArray = RecordArray.extend({\n    init() {\n      // yes we are touching `this` before super, but ArrayProxy has a bug that requires this.\n      this.set('content', this.get('content') || Ember.A());\n\n      this._super(...arguments);\n\n      this.query = this.query || null;\n      this.links = this.links || null;\n\n      {\n        this._getDeprecatedEventedInfo = () => `AdapterPopulatedRecordArray containing ${this.modelName} for query: ${this.query}`;\n      }\n    },\n\n    replace() {\n      throw new Error(`The result of a server query (on ${this.modelName}) is immutable.`);\n    },\n\n    _update() {\n      var store = Ember.get(this, 'store');\n      var query = Ember.get(this, 'query');\n      return store._query(this.modelName, query, this);\n    },\n\n    /**\n      @method _setInternalModels\n      @param {Array} internalModels\n      @param {Object} payload normalized payload\n      @private\n    */\n    _setInternalModels(internalModels, payload) {\n      // TODO: initial load should not cause change events at all, only\n      // subsequent. This requires changing the public api of adapter.query, but\n      // hopefully we can do that soon.\n      this.get('content').setObjects(internalModels);\n      this.setProperties({\n        isLoaded: true,\n        isUpdating: false,\n        meta: Ember.assign({}, payload.meta),\n        links: Ember.assign({}, payload.links)\n      });\n\n      this.manager._associateWithRecordArray(internalModels, this);\n\n      var _hasDidLoad =  this._has('didLoad') ;\n\n      if (_hasDidLoad) {\n        // TODO: should triggering didLoad event be the last action of the runLoop?\n        Ember.run.once(this, 'trigger', 'didLoad');\n      }\n    }\n\n  });\n\n  var emberRun$1 = Ember.run.backburner;\n  /**\n    @class RecordArrayManager\n    @private\n  */\n\n  class RecordArrayManager {\n    constructor(options) {\n      this.store = options.store;\n      this.isDestroying = false;\n      this.isDestroyed = false;\n      this._liveRecordArrays = Object.create(null);\n      this._pending = Object.create(null);\n      this._adapterPopulatedRecordArrays = [];\n    }\n\n    recordDidChange(internalModel) {\n      // TODO: change name\n      // TODO: track that it was also a change\n      this.internalModelDidChange(internalModel);\n    }\n\n    recordWasLoaded(internalModel) {\n      // TODO: change name\n      // TODO: track that it was also that it was first loaded\n      this.internalModelDidChange(internalModel);\n    }\n\n    internalModelDidChange(internalModel) {\n      var modelName = internalModel.modelName;\n\n      if (internalModel._pendingRecordArrayManagerFlush) {\n        return;\n      }\n\n      internalModel._pendingRecordArrayManagerFlush = true;\n      var pending = this._pending;\n      var models = pending[modelName] = pending[modelName] || [];\n\n      if (models.push(internalModel) !== 1) {\n        return;\n      }\n\n      emberRun$1.schedule('actions', this, this._flush);\n    }\n\n    _flushPendingInternalModelsForModelName(modelName, internalModels) {\n      var modelsToRemove = [];\n\n      for (var j = 0; j < internalModels.length; j++) {\n        var internalModel = internalModels[j]; // mark internalModels, so they can once again be processed by the\n        // recordArrayManager\n\n        internalModel._pendingRecordArrayManagerFlush = false; // build up a set of models to ensure we have purged correctly;\n\n        if (internalModel.isHiddenFromRecordArrays()) {\n          modelsToRemove.push(internalModel);\n        }\n      }\n\n      var array = this._liveRecordArrays[modelName];\n\n      if (array) {\n        // TODO: skip if it only changed\n        // process liveRecordArrays\n        this.updateLiveRecordArray(array, internalModels);\n      } // process adapterPopulatedRecordArrays\n\n\n      if (modelsToRemove.length > 0) {\n        removeFromAdapterPopulatedRecordArrays(modelsToRemove);\n      }\n    }\n\n    _flush() {\n      var pending = this._pending;\n      this._pending = Object.create(null);\n\n      for (var modelName in pending) {\n        this._flushPendingInternalModelsForModelName(modelName, pending[modelName]);\n      }\n    }\n\n    updateLiveRecordArray(array, internalModels) {\n      return updateLiveRecordArray(array, internalModels);\n    }\n\n    _syncLiveRecordArray(array, modelName) {\n      ( !(typeof modelName === 'string') && Ember.assert(`recordArrayManger.syncLiveRecordArray expects modelName not modelClass as the second param`, typeof modelName === 'string'));\n      var pending = this._pending[modelName];\n      var hasPendingChanges = Array.isArray(pending);\n      var hasNoPotentialDeletions = !hasPendingChanges || pending.length === 0;\n      var map = internalModelFactoryFor(this.store).modelMapFor(modelName);\n      var hasNoInsertionsOrRemovals = Ember.get(map, 'length') === Ember.get(array, 'length');\n      /*\n        Ideally the recordArrayManager has knowledge of the changes to be applied to\n        liveRecordArrays, and is capable of strategically flushing those changes and applying\n        small diffs if desired.  However, until we've refactored recordArrayManager, this dirty\n        check prevents us from unnecessarily wiping out live record arrays returned by peekAll.\n        */\n\n      if (hasNoPotentialDeletions && hasNoInsertionsOrRemovals) {\n        return;\n      }\n\n      if (hasPendingChanges) {\n        this._flushPendingInternalModelsForModelName(modelName, pending);\n\n        delete this._pending[modelName];\n      }\n\n      var internalModels = this._visibleInternalModelsByType(modelName);\n\n      var modelsToAdd = [];\n\n      for (var i = 0; i < internalModels.length; i++) {\n        var internalModel = internalModels[i];\n        var recordArrays = internalModel._recordArrays;\n\n        if (recordArrays.has(array) === false) {\n          recordArrays.add(array);\n          modelsToAdd.push(internalModel);\n        }\n      }\n\n      if (modelsToAdd.length) {\n        array._pushInternalModels(modelsToAdd);\n      }\n    }\n\n    _didUpdateAll(modelName) {\n      var recordArray = this._liveRecordArrays[modelName];\n\n      if (recordArray) {\n        Ember.set(recordArray, 'isUpdating', false);\n      }\n    }\n    /**\n      Get the `RecordArray` for a modelName, which contains all loaded records of\n      given modelName.\n       @method liveRecordArrayFor\n      @param {String} modelName\n      @return {RecordArray}\n    */\n\n\n    liveRecordArrayFor(modelName) {\n      ( !(typeof modelName === 'string') && Ember.assert(`recordArrayManger.liveRecordArrayFor expects modelName not modelClass as the param`, typeof modelName === 'string'));\n      var array = this._liveRecordArrays[modelName];\n\n      if (array) {\n        // if the array already exists, synchronize\n        this._syncLiveRecordArray(array, modelName);\n      } else {\n        // if the array is being newly created merely create it with its initial\n        // content already set. This prevents unneeded change events.\n        var internalModels = this._visibleInternalModelsByType(modelName);\n\n        array = this.createRecordArray(modelName, internalModels);\n        this._liveRecordArrays[modelName] = array;\n      }\n\n      return array;\n    }\n\n    _visibleInternalModelsByType(modelName) {\n      var all = internalModelFactoryFor(this.store).modelMapFor(modelName)._models;\n\n      var visible = [];\n\n      for (var i = 0; i < all.length; i++) {\n        var model = all[i];\n\n        if (model.isHiddenFromRecordArrays() === false) {\n          visible.push(model);\n        }\n      }\n\n      return visible;\n    }\n    /**\n      Create a `RecordArray` for a modelName.\n       @method createRecordArray\n      @param {String} modelName\n      @param {Array} _content (optional|private)\n      @return {RecordArray}\n    */\n\n\n    createRecordArray(modelName, content) {\n      ( !(typeof modelName === 'string') && Ember.assert(`recordArrayManger.createRecordArray expects modelName not modelClass as the param`, typeof modelName === 'string'));\n      var array = RecordArray.create({\n        modelName,\n        content: Ember.A(content || []),\n        store: this.store,\n        isLoaded: true,\n        manager: this\n      });\n\n      if (Array.isArray(content)) {\n        associateWithRecordArray(content, array);\n      }\n\n      return array;\n    }\n    /**\n      Create a `AdapterPopulatedRecordArray` for a modelName with given query.\n       @method createAdapterPopulatedRecordArray\n      @param {String} modelName\n      @param {Object} query\n      @return {AdapterPopulatedRecordArray}\n    */\n\n\n    createAdapterPopulatedRecordArray(modelName, query, internalModels, payload) {\n      ( !(typeof modelName === 'string') && Ember.assert(`recordArrayManger.createAdapterPopulatedRecordArray expects modelName not modelClass as the first param, received ${modelName}`, typeof modelName === 'string'));\n      var array;\n\n      if (Array.isArray(internalModels)) {\n        array = AdapterPopulatedRecordArray.create({\n          modelName,\n          query: query,\n          content: Ember.A(internalModels),\n          store: this.store,\n          manager: this,\n          isLoaded: true,\n          isUpdating: false,\n          meta: Ember.assign({}, payload.meta),\n          links: Ember.assign({}, payload.links)\n        });\n        associateWithRecordArray(internalModels, array);\n      } else {\n        array = AdapterPopulatedRecordArray.create({\n          modelName,\n          query: query,\n          content: Ember.A(),\n          store: this.store,\n          manager: this\n        });\n      }\n\n      this._adapterPopulatedRecordArrays.push(array);\n\n      return array;\n    }\n    /**\n      Unregister a RecordArray.\n      So manager will not update this array.\n       @method unregisterRecordArray\n      @param {RecordArray} array\n    */\n\n\n    unregisterRecordArray(array) {\n      var modelName = array.modelName; // remove from adapter populated record array\n\n      var removedFromAdapterPopulated = remove(this._adapterPopulatedRecordArrays, array);\n\n      if (!removedFromAdapterPopulated) {\n        var liveRecordArrayForType = this._liveRecordArrays[modelName]; // unregister live record array\n\n        if (liveRecordArrayForType) {\n          if (array === liveRecordArrayForType) {\n            delete this._liveRecordArrays[modelName];\n          }\n        }\n      }\n    }\n\n    _associateWithRecordArray(internalModels, array) {\n      associateWithRecordArray(internalModels, array);\n    }\n\n    willDestroy() {\n      Object.keys(this._liveRecordArrays).forEach(modelName => this._liveRecordArrays[modelName].destroy());\n\n      this._adapterPopulatedRecordArrays.forEach(destroy);\n\n      this.isDestroyed = true;\n    }\n\n    destroy() {\n      this.isDestroying = true;\n      emberRun$1.schedule('actions', this, this.willDestroy);\n    }\n\n  }\n\n  function destroy(entry) {\n    entry.destroy();\n  }\n\n  function remove(array, item) {\n    var index = array.indexOf(item);\n\n    if (index !== -1) {\n      array.splice(index, 1);\n      return true;\n    }\n\n    return false;\n  }\n\n  function updateLiveRecordArray(array, internalModels) {\n    var modelsToAdd = [];\n    var modelsToRemove = [];\n\n    for (var i = 0; i < internalModels.length; i++) {\n      var internalModel = internalModels[i];\n      var isDeleted = internalModel.isHiddenFromRecordArrays();\n      var recordArrays = internalModel._recordArrays;\n\n      if (!isDeleted && !internalModel.isEmpty()) {\n        if (!recordArrays.has(array)) {\n          modelsToAdd.push(internalModel);\n          recordArrays.add(array);\n        }\n      }\n\n      if (isDeleted) {\n        modelsToRemove.push(internalModel);\n        recordArrays.delete(array);\n      }\n    }\n\n    if (modelsToAdd.length > 0) {\n      array._pushInternalModels(modelsToAdd);\n    }\n\n    if (modelsToRemove.length > 0) {\n      array._removeInternalModels(modelsToRemove);\n    } // return whether we performed an update.\n    // Necessary until 3.5 allows us to finish off ember-data-filter support.\n\n\n    return (modelsToAdd.length || modelsToRemove.length) > 0;\n  }\n\n  function removeFromAdapterPopulatedRecordArrays(internalModels) {\n    for (var i = 0; i < internalModels.length; i++) {\n      removeFromAll(internalModels[i]);\n    }\n  }\n\n  function removeFromAll(internalModel) {\n    var recordArrays = internalModel._recordArrays;\n    recordArrays.forEach(function (recordArray) {\n      recordArray._removeInternalModels([internalModel]);\n    });\n    recordArrays.clear();\n  }\n\n  function associateWithRecordArray(internalModels, array) {\n    for (var i = 0, l = internalModels.length; i < l; i++) {\n      var internalModel = internalModels[i];\n\n      internalModel._recordArrays.add(array);\n    }\n  }\n\n  var backburner = new Ember._Backburner(['normalizeRelationships', 'syncRelationships', 'finished']);\n\n  {\n    Ember.Test.registerWaiter(() => {\n      return !backburner.currentInstance && !backburner.hasTimers();\n    });\n  }\n\n  /**\n    @module @ember-data/store\n  */\n\n  /**\n   * Get the materialized model from the internalModel/promise\n   * that returns an internal model and return it in a promiseObject.\n   *\n   * Useful for returning from find methods\n   *\n   * @internal\n   */\n  function promiseRecord(internalModelPromise, label) {\n    var toReturn = internalModelPromise.then(internalModel => internalModel.getRecord());\n    return promiseObject(toReturn, label);\n  }\n\n  var AvailableShims = new WeakMap();\n  function getShimClass(store, modelName) {\n    var shims = AvailableShims.get(store);\n\n    if (shims === undefined) {\n      shims = Object.create(null);\n      AvailableShims.set(store, shims);\n    }\n\n    var shim = shims[modelName];\n\n    if (shim === undefined) {\n      shim = shims[modelName] = new ShimModelClass(store, modelName);\n    }\n\n    return shim;\n  } // Mimics the static apis of DSModel\n\n  class ShimModelClass {\n    // TODO Maybe expose the class here?\n    constructor(__store, modelName) {\n      this.__store = __store;\n      this.modelName = modelName;\n    }\n\n    get fields() {\n      var attrs = this.__store._attributesDefinitionFor(this.modelName);\n\n      var relationships = this.__store._relationshipsDefinitionFor(this.modelName);\n\n      var fields = new Map();\n      Object.keys(attrs).forEach(key => fields.set(key, 'attribute'));\n      Object.keys(relationships).forEach(key => fields.set(key, relationships[key].kind));\n      return fields;\n    }\n\n    get attributes() {\n      var attrs = this.__store._attributesDefinitionFor(this.modelName);\n\n      return new Map(Object.entries(attrs));\n    }\n\n    get relationshipsByName() {\n      var relationships = this.__store._relationshipsDefinitionFor(this.modelName);\n\n      return new Map(Object.entries(relationships));\n    }\n\n    eachAttribute(callback, binding) {\n      var attrDefs = this.__store._attributesDefinitionFor(this.modelName);\n\n      Object.keys(attrDefs).forEach(key => {\n        callback.call(binding, key, attrDefs[key]);\n      });\n    }\n\n    eachRelationship(callback, binding) {\n      var relationshipDefs = this.__store._relationshipsDefinitionFor(this.modelName);\n\n      Object.keys(relationshipDefs).forEach(key => {\n        callback.call(binding, key, relationshipDefs[key]);\n      });\n    }\n\n    eachTransformedAttribute(callback, binding) {\n      var relationshipDefs = this.__store._relationshipsDefinitionFor(this.modelName);\n\n      Object.keys(relationshipDefs).forEach(key => {\n        if (relationshipDefs[key].type) {\n          callback.call(binding, key, relationshipDefs[key]);\n        }\n      });\n    }\n\n  }\n\n  var emberRun$2 = Ember.run.backburner;\n  var {\n    ENV\n  } = Ember;\n  var HAS_SERIALIZER_PACKAGE = require.has('@ember-data/serializer');\n  var HAS_ADAPTER_PACKAGE = require.has('@ember-data/adapter');\n  var HAS_MODEL_PACKAGE = require.has('@ember-data/model');\n\n  function deprecateTestRegistration(factoryType, factoryName) {\n    ( Ember.deprecate(`You looked up the ${factoryType} \"${factoryName}\" but it was not found. Likely this means you are using a legacy ember-qunit moduleFor helper. Add \"needs: ['${factoryType}:${factoryName}']\", \"integration: true\", or refactor to modern syntax to resolve this deprecation.`, false, {\n      id: 'ember-data:-legacy-test-registrations',\n      until: '3.17'\n    }));\n  }\n  /**\n    The store contains all of the data for records loaded from the server.\n    It is also responsible for creating instances of `Model` that wrap\n    the individual data for a record, so that they can be bound to in your\n    Handlebars templates.\n\n    Define your application's store like this:\n\n    ```app/services/store.js\n    import Store from '@ember-data/store';\n\n    export default Store.extend({\n    });\n    ```\n\n    Most Ember.js applications will only have a single `Store` that is\n    automatically created by their `Ember.Application`.\n\n    You can retrieve models from the store in several ways. To retrieve a record\n    for a specific id, use `Store`'s `findRecord()` method:\n\n    ```javascript\n    store.findRecord('person', 123).then(function (person) {\n    });\n    ```\n\n    By default, the store will talk to your backend using a standard\n    REST mechanism. You can customize how the store talks to your\n    backend by specifying a custom adapter:\n\n    ```app/adapters/application.js\n    import Adapter from '@ember-data/adapter';\n\n    export default Adapter.extend({\n    });\n    ```\n\n    You can learn more about writing a custom adapter by reading the `Adapter`\n    documentation.\n\n    ### Store createRecord() vs. push() vs. pushPayload()\n\n    The store provides multiple ways to create new record objects. They have\n    some subtle differences in their use which are detailed below:\n\n    [createRecord](Store/methods/createRecord?anchor=createRecord) is used for creating new\n    records on the client side. This will return a new record in the\n    `created.uncommitted` state. In order to persist this record to the\n    backend, you will need to call `record.save()`.\n\n    [push](Store/methods/push?anchor=push) is used to notify Ember Data's store of new or\n    updated records that exist in the backend. This will return a record\n    in the `loaded.saved` state. The primary use-case for `store#push` is\n    to notify Ember Data about record updates (full or partial) that happen\n    outside of the normal adapter methods (for example\n    [SSE](http://dev.w3.org/html5/eventsource/) or [Web\n    Sockets](http://www.w3.org/TR/2009/WD-websockets-20091222/)).\n\n    [pushPayload](Store/methods/pushPayload?anchor=pushPayload) is a convenience wrapper for\n    `store#push` that will deserialize payloads if the\n    Serializer implements a `pushPayload` method.\n\n    Note: When creating a new record using any of the above methods\n    Ember Data will update `RecordArray`s such as those returned by\n    `store#peekAll()` or `store#findAll()`. This means any\n    data bindings or computed properties that depend on the RecordArray\n    will automatically be synced to include the new or updated record\n    values.\n\n    @class Store\n    @extends Ember.Service\n  */\n\n\n  class CoreStore extends Ember.Service {\n    /**\n     * EmberData specific backburner instance\n     */\n\n    /*\n      Ember Data uses several specialized micro-queues for organizing\n      and coalescing similar async work.\n       These queues are currently controlled by a flush scheduled into\n      ember-data's custom backburner instance.\n      */\n    // used for coalescing record save requests\n    // used for coalescing relationship updates\n    // used for coalescing internal model updates\n    // used to keep track of all the find requests that need to be coalesced\n    // DEBUG-only properties\n\n    /**\n      The default adapter to use to communicate to a backend server or\n      other persistence layer. This will be overridden by an application\n      adapter if present.\n       If you want to specify `app/adapters/custom.js` as a string, do:\n       ```js\n      import Store from '@ember-data/store';\n       export default Store.extend({\n        init() {\n          this._super(...arguments);\n          this.adapter = 'custom';\n        }\n      });\n      ```\n       @property adapter\n      @default '-json-api'\n      @type {String}\n    */\n\n    /**\n    This property returns the adapter, after resolving a possible\n    string key.\n     If the supplied `adapter` was a class, or a String property\n    path resolved to a class, this property will instantiate the\n    class.\n     This property is cacheable, so the same instance of a specified\n    adapter class should be used for the lifetime of the store.\n     @property defaultAdapter\n    @private\n    @return Adapter\n    */\n\n    /**\n      @method init\n      @private\n    */\n    constructor() {\n      super(...arguments);\n      this._backburner = backburner;\n      this.recordArrayManager = new RecordArrayManager({\n        store: this\n      });\n      this._notificationManager = void 0;\n      this._adapterCache = Object.create(null);\n      this._serializerCache = Object.create(null);\n      this._storeWrapper = new RecordDataStoreWrapper(this);\n      this._pendingSave = [];\n      this._updatedRelationships = [];\n      this._updatedInternalModels = [];\n      this._pendingFetch = new Map();\n      this._fetchManager = void 0;\n      this._schemaDefinitionService = void 0;\n      this._trackedAsyncRequests = void 0;\n      this.shouldAssertMethodCallsOnDestroyedStore = false;\n      this.shouldTrackAsyncRequests = false;\n      this.generateStackTracesForTrackedRequests = false;\n      this._trackAsyncRequestStart = void 0;\n      this._trackAsyncRequestEnd = void 0;\n      this.__asyncWaiter = void 0;\n\n      {\n        if (HAS_SERIALIZER_PACKAGE) {\n          // support for legacy moduleFor style unit tests\n          // that did not include transforms in \"needs\"\n          // or which were not set to integration:true\n          // that were relying on ember-test-helpers\n          // doing an auto-registration of the transform\n          // or us doing one\n          var Mapping = {\n            date: 'DateTransform',\n            boolean: 'BooleanTransform',\n            number: 'NumberTransform',\n            string: 'StringTransform'\n          };\n          var shouldWarn = false;\n          Object.keys(Mapping).forEach(attributeType => {\n            var transform = Ember.getOwner(this).lookup(`transform:${attributeType}`);\n\n            if (!transform) {\n              // we don't deprecate this because the moduleFor style tests with the closed\n              // resolver will be deprecated on their own. When that deprecation completes\n              // we can drop this.\n              var Transform = require__default(`@ember-data/serializer/-private`)[Mapping[attributeType]];\n\n              Ember.getOwner(this).register(`transform:${attributeType}`, Transform);\n              shouldWarn = true;\n            }\n          });\n\n          if (shouldWarn) {\n            ( Ember.deprecate(`You are relying on the automatic registration of the transforms \"date\", \"number\", \"boolean\", and \"string\". Likely this means you are using a legacy ember-qunit moduleFor helper. Add \"needs: ['transform:date', 'transform:boolean', 'transform:number', 'transform:string']\", \"integration: true\", or refactor to modern syntax to resolve this deprecation.`, false, {\n              id: 'ember-data:-legacy-test-registrations',\n              until: '3.17'\n            }));\n          }\n        }\n\n        this.shouldAssertMethodCallsOnDestroyedStore = this.shouldAssertMethodCallsOnDestroyedStore || false;\n\n        if (this.shouldTrackAsyncRequests === undefined) {\n          this.shouldTrackAsyncRequests = false;\n        }\n\n        if (this.generateStackTracesForTrackedRequests === undefined) {\n          this.generateStackTracesForTrackedRequests = false;\n        }\n\n        this._trackedAsyncRequests = [];\n\n        this._trackAsyncRequestStart = label => {\n          var trace = 'set `store.generateStackTracesForTrackedRequests = true;` to get a detailed trace for where this request originated';\n\n          if (this.generateStackTracesForTrackedRequests) {\n            try {\n              throw new Error(`EmberData TrackedRequest: ${label}`);\n            } catch (e) {\n              trace = e;\n            }\n          }\n\n          var token = Object.freeze({\n            label,\n            trace\n          });\n\n          this._trackedAsyncRequests.push(token);\n\n          return token;\n        };\n\n        this._trackAsyncRequestEnd = token => {\n          var index = this._trackedAsyncRequests.indexOf(token);\n\n          if (index === -1) {\n            throw new Error(`Attempted to end tracking for the following request but it was not being tracked:\\n${token}`);\n          }\n\n          this._trackedAsyncRequests.splice(index, 1);\n        };\n\n        this.__asyncWaiter = () => {\n          var shouldTrack = this.shouldTrackAsyncRequests;\n          var tracked = this._trackedAsyncRequests;\n          var isSettled = tracked.length === 0;\n          return shouldTrack !== true || isSettled;\n        };\n\n        Ember.Test.registerWaiter(this.__asyncWaiter);\n      }\n    }\n\n    getRequestStateService() {\n\n      throw new Error('RequestService is not available unless the feature flag is on and running on a canary build');\n    }\n\n    get identifierCache() {\n\n      return identifierCacheFor(this);\n    }\n\n    _instantiateRecord(internalModel, modelName, recordData, identifier, properties) {\n      {\n        throw new Error('should not be here, custom model class ff error');\n      }\n    }\n\n    _internalDeleteRecord(internalModel) {\n      internalModel.deleteRecord();\n    } // FeatureFlagged in the DSModelStore claas\n\n\n    _attributesDefinitionFor(modelName, identifier) {\n      if (identifier) {\n        return this.getSchemaDefinitionService().attributesDefinitionFor(identifier);\n      } else {\n        return this.getSchemaDefinitionService().attributesDefinitionFor(modelName);\n      }\n    }\n\n    _relationshipsDefinitionFor(modelName, identifier) {\n      if (identifier) {\n        return this.getSchemaDefinitionService().relationshipsDefinitionFor(identifier);\n      } else {\n        return this.getSchemaDefinitionService().relationshipsDefinitionFor(modelName);\n      }\n    }\n\n    registerSchemaDefinitionService(schema) {\n      this._schemaDefinitionService = schema;\n    }\n\n    getSchemaDefinitionService() {\n      {\n        throw new Error('need to enable CUSTOM_MODEL_CLASS feature flag in order to access SchemaDefinitionService');\n      }\n    } // TODO Double check this return value is correct\n\n\n    _relationshipMetaFor(modelName, id, key) {\n      return this._relationshipsDefinitionFor(modelName)[key];\n    }\n\n    modelFor(modelName) {\n      {\n        assertDestroyedStoreOnly(this, 'modelFor');\n      }\n\n      return getShimClass(this, modelName);\n    } // Feature Flagged in DSModelStore\n\n    /*\n    Returns whether a ModelClass exists for a given modelName\n    This exists for legacy support for the RESTSerializer,\n    which due to how it must guess whether a key is a model\n    must query for whether a match exists.\n     We should investigate an RFC to make this public or removing\n    this requirement.\n     @private\n    */\n\n\n    _hasModelFor(modelName) {\n      ( !(Ember.isPresent(modelName)) && Ember.assert(`You need to pass a model name to the store's hasModelFor method`, Ember.isPresent(modelName)));\n      ( !(typeof modelName === 'string') && Ember.assert(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${modelName}`, typeof modelName === 'string'));\n      return this.getSchemaDefinitionService().doesTypeExist(modelName);\n    } // .....................\n    // . CREATE NEW RECORD .\n    // .....................\n\n    /**\n      Create a new record in the current store. The properties passed\n      to this method are set on the newly created record.\n       To create a new instance of a `Post`:\n       ```js\n      store.createRecord('post', {\n        title: 'Ember is awesome!'\n      });\n      ```\n       To create a new instance of a `Post` that has a relationship with a `User` record:\n       ```js\n      let user = this.store.peekRecord('user', 1);\n      store.createRecord('post', {\n        title: 'Ember is awesome!',\n        user: user\n      });\n      ```\n       @method createRecord\n      @param {String} modelName\n      @param {Object} inputProperties a hash of properties to set on the\n        newly created record.\n      @return {Model} record\n    */\n\n\n    createRecord(modelName, inputProperties) {\n      {\n        assertDestroyingStore(this, 'createRecord');\n      }\n\n      ( !(Ember.isPresent(modelName)) && Ember.assert(`You need to pass a model name to the store's createRecord method`, Ember.isPresent(modelName)));\n      ( !(typeof modelName === 'string') && Ember.assert(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${modelName}`, typeof modelName === 'string')); // This is wrapped in a `run.join` so that in test environments users do not need to manually wrap\n      //   calls to `createRecord`. The run loop usage here is because we batch the joining and updating\n      //   of record-arrays via ember's run loop, not our own.\n      //\n      //   to remove this, we would need to move to a new `async` API.\n\n      return emberRun$2.join(() => {\n        return this._backburner.join(() => {\n          var normalizedModelName = normalizeModelName(modelName);\n          var properties = Ember.assign({}, inputProperties); // If the passed properties do not include a primary key,\n          // give the adapter an opportunity to generate one. Typically,\n          // client-side ID generators will use something like uuid.js\n          // to avoid conflicts.\n\n          if (Ember.isNone(properties.id)) {\n            properties.id = this._generateId(normalizedModelName, properties);\n          } // Coerce ID to a string\n\n\n          properties.id = coerceId(properties.id);\n          var factory = internalModelFactoryFor(this);\n          var internalModel = factory.build({\n            type: normalizedModelName,\n            id: properties.id\n          });\n          internalModel.loadedData(); // TODO this exists just to proxy `isNew` to RecordData which is weird\n\n          internalModel.didCreateRecord();\n          return internalModel.getRecord(properties);\n        });\n      });\n    }\n    /**\n      If possible, this method asks the adapter to generate an ID for\n      a newly created record.\n       @method _generateId\n      @private\n      @param {String} modelName\n      @param {Object} properties from the new record\n      @return {String} if the adapter can generate one, an ID\n    */\n\n\n    _generateId(modelName, properties) {\n      var adapter = this.adapterFor(modelName);\n\n      if (adapter && adapter.generateIdForRecord) {\n        return adapter.generateIdForRecord(this, modelName, properties);\n      }\n\n      return null;\n    } // .................\n    // . DELETE RECORD .\n    // .................\n\n    /**\n      For symmetry, a record can be deleted via the store.\n       Example\n       ```javascript\n      let post = store.createRecord('post', {\n        title: 'Ember is awesome!'\n      });\n       store.deleteRecord(post);\n      ```\n       @method deleteRecord\n      @param {Model} record\n    */\n\n\n    deleteRecord(record) {\n      {\n        assertDestroyingStore(this, 'deleteRecord');\n      }\n\n      {\n        record.deleteRecord();\n      }\n    }\n    /**\n      For symmetry, a record can be unloaded via the store.\n      This will cause the record to be destroyed and freed up for garbage collection.\n       Example\n       ```javascript\n      store.findRecord('post', 1).then(function(post) {\n        store.unloadRecord(post);\n      });\n      ```\n       @method unloadRecord\n      @param {Model} record\n    */\n\n\n    unloadRecord(record) {\n      {\n        assertDestroyingStore(this, 'unloadRecord');\n      }\n\n      {\n        record.unloadRecord();\n      }\n    } // ................\n    // . FIND RECORDS .\n    // ................\n\n    /**\n      @method find\n      @param {String} modelName\n      @param {String|Integer} id\n      @param {Object} options\n      @return {Promise} promise\n      @private\n    */\n\n\n    find(modelName, id, options) {\n      {\n        assertDestroyingStore(this, 'find');\n      } // The default `model` hook in Route calls `find(modelName, id)`,\n      // that's why we have to keep this method around even though `findRecord` is\n      // the public way to get a record by modelName and id.\n\n\n      ( !(arguments.length !== 1) && Ember.assert(`Using store.find(type) has been removed. Use store.findAll(modelName) to retrieve all records for a given type.`, arguments.length !== 1));\n      ( !(!options) && Ember.assert(`Calling store.find(modelName, id, { preload: preload }) is no longer supported. Use store.findRecord(modelName, id, { preload: preload }) instead.`, !options));\n      ( !(arguments.length === 2) && Ember.assert(`You need to pass the model name and id to the store's find method`, arguments.length === 2));\n      ( !(typeof id === 'string' || typeof id === 'number') && Ember.assert(`You cannot pass '${id}' as id to the store's find method`, typeof id === 'string' || typeof id === 'number'));\n      ( !(typeof id !== 'object') && Ember.assert(`Calling store.find() with a query object is no longer supported. Use store.query() instead.`, typeof id !== 'object'));\n      ( !(typeof modelName === 'string') && Ember.assert(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${modelName}`, typeof modelName === 'string'));\n      return this.findRecord(modelName, id);\n    }\n    /**\n      This method returns a record for a given type and id combination.\n       The `findRecord` method will always resolve its promise with the same\n      object for a given type and `id`.\n       The `findRecord` method will always return a **promise** that will be\n      resolved with the record.\n       Example\n       ```app/routes/post.js\n      import Route from '@ember/routing/route';\n       export default Route.extend({\n        model(params) {\n          return this.store.findRecord('post', params.post_id);\n        }\n      });\n      ```\n       If the record is not yet available, the store will ask the adapter's `find`\n      method to find the necessary data. If the record is already present in the\n      store, it depends on the reload behavior _when_ the returned promise\n      resolves.\n       ### Preloading\n       You can optionally `preload` specific attributes and relationships that you know of\n      by passing them via the passed `options`.\n       For example, if your Ember route looks like `/posts/1/comments/2` and your API route\n      for the comment also looks like `/posts/1/comments/2` if you want to fetch the comment\n      without fetching the post you can pass in the post to the `findRecord` call:\n       ```javascript\n      store.findRecord('comment', 2, { preload: { post: 1 } });\n      ```\n       If you have access to the post model you can also pass the model itself:\n       ```javascript\n      store.findRecord('post', 1).then(function (myPostModel) {\n        store.findRecord('comment', 2, { post: myPostModel });\n      });\n      ```\n       ### Reloading\n       The reload behavior is configured either via the passed `options` hash or\n      the result of the adapter's `shouldReloadRecord`.\n       If `{ reload: true }` is passed or `adapter.shouldReloadRecord` evaluates\n      to `true`, then the returned promise resolves once the adapter returns\n      data, regardless if the requested record is already in the store:\n       ```js\n      store.push({\n        data: {\n          id: 1,\n          type: 'post',\n          revision: 1\n        }\n      });\n       // adapter#findRecord resolves with\n      // [\n      //   {\n      //     id: 1,\n      //     type: 'post',\n      //     revision: 2\n      //   }\n      // ]\n      store.findRecord('post', 1, { reload: true }).then(function(post) {\n        post.get('revision'); // 2\n      });\n      ```\n       If no reload is indicated via the above mentioned ways, then the promise\n      immediately resolves with the cached version in the store.\n       ### Background Reloading\n       Optionally, if `adapter.shouldBackgroundReloadRecord` evaluates to `true`,\n      then a background reload is started, which updates the records' data, once\n      it is available:\n       ```js\n      // app/adapters/post.js\n      import ApplicationAdapter from \"./application\";\n       export default ApplicationAdapter.extend({\n        shouldReloadRecord(store, snapshot) {\n          return false;\n        },\n         shouldBackgroundReloadRecord(store, snapshot) {\n          return true;\n        }\n      });\n       // ...\n       store.push({\n        data: {\n          id: 1,\n          type: 'post',\n          revision: 1\n        }\n      });\n       let blogPost = store.findRecord('post', 1).then(function(post) {\n        post.get('revision'); // 1\n      });\n       // later, once adapter#findRecord resolved with\n      // [\n      //   {\n      //     id: 1,\n      //     type: 'post',\n      //     revision: 2\n      //   }\n      // ]\n       blogPost.get('revision'); // 2\n      ```\n       If you would like to force or prevent background reloading, you can set a\n      boolean value for `backgroundReload` in the options object for\n      `findRecord`.\n       ```app/routes/post/edit.js\n      import Route from '@ember/routing/route';\n       export default Route.extend({\n        model(params) {\n          return this.store.findRecord('post', params.post_id, { backgroundReload: false });\n        }\n      });\n      ```\n       If you pass an object on the `adapterOptions` property of the options\n      argument it will be passed to you adapter via the snapshot\n       ```app/routes/post/edit.js\n      import Route from '@ember/routing/route';\n       export default Route.extend({\n        model(params) {\n          return this.store.findRecord('post', params.post_id, {\n            adapterOptions: { subscribe: false }\n          });\n        }\n      });\n      ```\n       ```app/adapters/post.js\n      import MyCustomAdapter from './custom-adapter';\n       export default MyCustomAdapter.extend({\n        findRecord(store, type, id, snapshot) {\n          if (snapshot.adapterOptions.subscribe) {\n            // ...\n          }\n          // ...\n        }\n      });\n      ```\n       See [peekRecord](Store/methods/peekRecord?anchor=peekRecord) to get the cached version of a record.\n       ### Retrieving Related Model Records\n       If you use an adapter such as Ember's default\n      [`JSONAPIAdapter`](/ember-data/release/classes/JSONAPIAdapter)\n      that supports the [JSON API specification](http://jsonapi.org/) and if your server\n      endpoint supports the use of an\n      ['include' query parameter](http://jsonapi.org/format/#fetching-includes),\n      you can use `findRecord()` to automatically retrieve additional records related to\n      the one you request by supplying an `include` parameter in the `options` object.\n       For example, given a `post` model that has a `hasMany` relationship with a `comment`\n      model, when we retrieve a specific post we can have the server also return that post's\n      comments in the same request:\n       ```app/routes/post.js\n      import Route from '@ember/routing/route';\n       export default Route.extend({\n        model(params) {\n          return this.store.findRecord('post', params.post_id, { include: 'comments' });\n        }\n      });\n       ```\n      In this case, the post's comments would then be available in your template as\n      `model.comments`.\n       Multiple relationships can be requested using an `include` parameter consisting of a\n      comma-separated list (without white-space) while nested relationships can be specified\n      using a dot-separated sequence of relationship names. So to request both the post's\n      comments and the authors of those comments the request would look like this:\n       ```app/routes/post.js\n      import Route from '@ember/routing/route';\n       export default Route.extend({\n        model(params) {\n          return this.store.findRecord('post', params.post_id, { include: 'comments,comments.author' });\n        }\n      });\n       ```\n       @since 1.13.0\n      @method findRecord\n      @param {String} modelName\n      @param {(String|Integer)} id\n      @param {Object} [options]\n      @param {Object} preload - optional set of attributes and relationships passed in either as IDs or as actual models\n      @return {Promise} promise\n    */\n\n\n    findRecord(modelName, id, options) {\n      {\n        assertDestroyingStore(this, 'findRecord');\n      }\n\n      ( !(Ember.isPresent(modelName)) && Ember.assert(`You need to pass a model name to the store's findRecord method`, Ember.isPresent(modelName)));\n      ( !(typeof modelName === 'string') && Ember.assert(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${modelName}`, typeof modelName === 'string'));\n      var type = normalizeModelName(modelName);\n      var normalizedId = ensureStringId(id);\n      var resource = constructResource(type, normalizedId);\n      var internalModel = internalModelFactoryFor(this).lookup(resource);\n      options = options || {};\n\n      if (!this.hasRecordForId(type, normalizedId)) {\n        return this._findByInternalModel(internalModel, options);\n      }\n\n      var fetchedInternalModel = this._findRecord(internalModel, options);\n\n      return promiseRecord(fetchedInternalModel, `DS: Store#findRecord ${type} with id: ${id}`);\n    }\n\n    _findRecord(internalModel, options) {\n      // Refetch if the reload option is passed\n      if (options.reload) {\n        return this._scheduleFetch(internalModel, options);\n      }\n\n      var snapshot = internalModel.createSnapshot(options);\n      var adapter = this.adapterFor(internalModel.modelName); // Refetch the record if the adapter thinks the record is stale\n\n      if (adapter.shouldReloadRecord(this, snapshot)) {\n        return this._scheduleFetch(internalModel, options);\n      }\n\n      if (options.backgroundReload === false) {\n        return Ember.RSVP.Promise.resolve(internalModel);\n      } // Trigger the background refetch if backgroundReload option is passed\n\n\n      if (options.backgroundReload || adapter.shouldBackgroundReloadRecord(this, snapshot)) {\n        this._scheduleFetch(internalModel, options);\n      } // Return the cached record\n\n\n      return Ember.RSVP.Promise.resolve(internalModel);\n    }\n\n    _findByInternalModel(internalModel, options = {}) {\n      if (options.preload) {\n        internalModel.preloadData(options.preload);\n      }\n\n      var fetchedInternalModel = this._findEmptyInternalModel(internalModel, options);\n\n      return promiseRecord(fetchedInternalModel, `DS: Store#findRecord ${internalModel.modelName} with id: ${internalModel.id}`);\n    }\n\n    _findEmptyInternalModel(internalModel, options) {\n      if (internalModel.isEmpty()) {\n        return this._scheduleFetch(internalModel, options);\n      } //TODO double check about reloading\n\n\n      {\n        if (internalModel.isLoading()) {\n          return internalModel._promiseProxy;\n        }\n      }\n\n      return Ember.RSVP.Promise.resolve(internalModel);\n    }\n    /**\n      This method makes a series of requests to the adapter's `find` method\n      and returns a promise that resolves once they are all loaded.\n       @private\n      @method findByIds\n      @param {String} modelName\n      @param {Array} ids\n      @return {Promise} promise\n    */\n\n\n    findByIds(modelName, ids) {\n      {\n        assertDestroyingStore(this, 'findByIds');\n      }\n\n      ( !(Ember.isPresent(modelName)) && Ember.assert(`You need to pass a model name to the store's findByIds method`, Ember.isPresent(modelName)));\n      ( !(typeof modelName === 'string') && Ember.assert(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${modelName}`, typeof modelName === 'string'));\n      var promises = new Array(ids.length);\n      var normalizedModelName = normalizeModelName(modelName);\n\n      for (var i = 0; i < ids.length; i++) {\n        promises[i] = this.findRecord(normalizedModelName, ids[i]);\n      }\n\n      return promiseArray(Ember.RSVP.all(promises).then(Ember.A, null, `DS: Store#findByIds of ${normalizedModelName} complete`));\n    }\n    /**\n      This method is called by `findRecord` if it discovers that a particular\n      type/id pair hasn't been loaded yet to kick off a request to the\n      adapter.\n       @method _fetchRecord\n      @private\n      @param {InternalModel} internalModel model\n      @return {Promise} promise\n     */\n\n\n    _fetchRecord(internalModel, options) {\n      var modelName = internalModel.modelName;\n      var adapter = this.adapterFor(modelName);\n      ( !(adapter) && Ember.assert(`You tried to find a record but you have no adapter (for ${modelName})`, adapter));\n      ( !(typeof adapter.findRecord === 'function') && Ember.assert(`You tried to find a record but your adapter (for ${modelName}) does not implement 'findRecord'`, typeof adapter.findRecord === 'function'));\n      return _find(adapter, this, internalModel.type, internalModel.id, internalModel, options);\n    }\n\n    _scheduleFetchMany(internalModels, options) {\n      var fetches = new Array(internalModels.length);\n\n      for (var i = 0; i < internalModels.length; i++) {\n        fetches[i] = this._scheduleFetch(internalModels[i], options);\n      }\n\n      return Ember.RSVP.Promise.all(fetches);\n    }\n\n    _scheduleFetchThroughFetchManager(internalModel, options = {}) {\n      var generateStackTrace = this.generateStackTracesForTrackedRequests; // TODO  remove this once we dont rely on state machine\n\n      internalModel.loadingData();\n      var identifier = internalModel.identifier;\n\n      var promise = this._fetchManager.scheduleFetch(internalModel.identifier, options, generateStackTrace);\n\n      return promise.then(payload => {\n        {\n          // ensure that regardless of id returned we assign to the correct record\n          if (payload.data && !Array.isArray(payload.data)) {\n            payload.data.lid = identifier.lid;\n          }\n        } // Returning this._push here, breaks typing but not any tests, invesstigate potential missing tests\n\n\n        var potentiallyNewIm = this._push(payload);\n\n        if (potentiallyNewIm && !Array.isArray(potentiallyNewIm)) {\n          return potentiallyNewIm;\n        } else {\n          return internalModel;\n        }\n      }, error => {\n        // TODO  remove this once we dont rely on state machine\n        internalModel.notFound();\n\n        if (internalModel.isEmpty()) {\n          internalModel.unloadRecord();\n        }\n\n        throw error;\n      });\n    }\n\n    _scheduleFetch(internalModel, options) {\n      {\n        if (internalModel._promiseProxy) {\n          return internalModel._promiseProxy;\n        }\n\n        var {\n          id,\n          modelName\n        } = internalModel;\n        var resolver = Ember.RSVP.defer(`Fetching ${modelName}' with id: ${id}`);\n        var pendingFetchItem = {\n          internalModel,\n          resolver,\n          options\n        };\n\n        {\n          if (this.generateStackTracesForTrackedRequests === true) {\n            var trace;\n\n            try {\n              throw new Error(`Trace Origin for scheduled fetch for ${modelName}:${id}.`);\n            } catch (e) {\n              trace = e;\n            } // enable folks to discover the origin of this findRecord call when\n            // debugging. Ideally we would have a tracked queue for requests with\n            // labels or local IDs that could be used to merge this trace with\n            // the trace made available when we detect an async leak\n\n\n            pendingFetchItem.trace = trace;\n          }\n        }\n\n        var promise = resolver.promise;\n        internalModel.loadingData(promise);\n\n        if (this._pendingFetch.size === 0) {\n          emberRun$2.schedule('actions', this, this.flushAllPendingFetches);\n        }\n\n        var fetches = this._pendingFetch;\n        var pending = fetches.get(modelName);\n\n        if (pending === undefined) {\n          pending = [];\n          fetches.set(modelName, pending);\n        }\n\n        pending.push(pendingFetchItem);\n        return promise;\n      }\n    }\n\n    flushAllPendingFetches() {\n      {\n        if (this.isDestroyed || this.isDestroying) {\n          return;\n        }\n\n        this._pendingFetch.forEach(this._flushPendingFetchForType, this);\n\n        this._pendingFetch.clear();\n      }\n    }\n\n    _flushPendingFetchForType(pendingFetchItems, modelName) {\n      var store = this;\n      var adapter = store.adapterFor(modelName);\n      var shouldCoalesce = !!adapter.findMany && adapter.coalesceFindRequests;\n      var totalItems = pendingFetchItems.length;\n      var internalModels = new Array(totalItems);\n      var seeking = Object.create(null);\n      var optionsMap = new WeakMap();\n\n      for (var _i = 0; _i < totalItems; _i++) {\n        var pendingItem = pendingFetchItems[_i];\n        var _internalModel = pendingItem.internalModel;\n        internalModels[_i] = _internalModel;\n        optionsMap.set(_internalModel, pendingItem.options); // We can remove this \"not null\" cast once we have enough typing\n        // to know we are only dealing with ExistingResourceIdentifierObjects\n\n        seeking[_internalModel.id] = pendingItem;\n      }\n\n      function _fetchRecord(recordResolverPair) {\n        var recordFetch = store._fetchRecord(recordResolverPair.internalModel, recordResolverPair.options);\n\n        recordResolverPair.resolver.resolve(recordFetch);\n      }\n\n      function handleFoundRecords(foundInternalModels, expectedInternalModels) {\n        // resolve found records\n        var found = Object.create(null);\n\n        for (var _i2 = 0, _l = foundInternalModels.length; _i2 < _l; _i2++) {\n          var _internalModel2 = foundInternalModels[_i2]; // We can remove this \"not null\" cast once we have enough typing\n          // to know we are only dealing with ExistingResourceIdentifierObjects\n\n          var _pair = seeking[_internalModel2.id];\n          found[_internalModel2.id] = _internalModel2;\n\n          if (_pair) {\n            var resolver = _pair.resolver;\n            resolver.resolve(_internalModel2);\n          }\n        } // reject missing records\n\n\n        var missingInternalModels = [];\n\n        for (var _i3 = 0, _l2 = expectedInternalModels.length; _i3 < _l2; _i3++) {\n          var _internalModel3 = expectedInternalModels[_i3]; // We can remove this \"not null\" cast once we have enough typing\n          // to know we are only dealing with ExistingResourceIdentifierObjects\n\n          if (!found[_internalModel3.id]) {\n            missingInternalModels.push(_internalModel3);\n          }\n        }\n\n        if (missingInternalModels.length) {\n          ( Ember.warn('Ember Data expected to find records with the following ids in the adapter response but they were missing: [ \"' + missingInternalModels.map(r => r.id).join('\", \"') + '\" ]', false, {\n            id: 'ds.store.missing-records-from-adapter'\n          }));\n          rejectInternalModels(missingInternalModels);\n        }\n      }\n\n      function rejectInternalModels(internalModels, error) {\n        for (var _i4 = 0, _l3 = internalModels.length; _i4 < _l3; _i4++) {\n          var _internalModel4 = internalModels[_i4]; // We can remove this \"not null\" cast once we have enough typing\n          // to know we are only dealing with ExistingResourceIdentifierObjects\n\n          var _pair2 = seeking[_internalModel4.id];\n\n          if (_pair2) {\n            _pair2.resolver.reject(error || new Error(`Expected: '${_internalModel4}' to be present in the adapter provided payload, but it was not found.`));\n          }\n        }\n      }\n\n      if (shouldCoalesce) {\n        // TODO: Improve records => snapshots => records => snapshots\n        //\n        // We want to provide records to all store methods and snapshots to all\n        // adapter methods. To make sure we're doing that we're providing an array\n        // of snapshots to adapter.groupRecordsForFindMany(), which in turn will\n        // return grouped snapshots instead of grouped records.\n        //\n        // But since the _findMany() finder is a store method we need to get the\n        // records from the grouped snapshots even though the _findMany() finder\n        // will once again convert the records to snapshots for adapter.findMany()\n        var snapshots = new Array(totalItems);\n\n        for (var _i5 = 0; _i5 < totalItems; _i5++) {\n          snapshots[_i5] = internalModels[_i5].createSnapshot(optionsMap.get(internalModel));\n        }\n\n        var groups = adapter.groupRecordsForFindMany(this, snapshots);\n\n        for (var i = 0, l = groups.length; i < l; i++) {\n          var group = groups[i];\n          var totalInGroup = groups[i].length;\n          var ids = new Array(totalInGroup);\n          var groupedInternalModels = new Array(totalInGroup);\n\n          for (var j = 0; j < totalInGroup; j++) {\n            var internalModel = group[j]._internalModel;\n            groupedInternalModels[j] = internalModel;\n            ids[j] = internalModel.id;\n          }\n\n          if (totalInGroup > 1) {\n            (function (groupedInternalModels) {\n              _findMany(adapter, store, modelName, ids, groupedInternalModels, optionsMap).then(function (foundInternalModels) {\n                handleFoundRecords(foundInternalModels, groupedInternalModels);\n              }).catch(function (error) {\n                rejectInternalModels(groupedInternalModels, error);\n              });\n            })(groupedInternalModels);\n          } else if (ids.length === 1) {\n            var pair = seeking[groupedInternalModels[0].id];\n\n            _fetchRecord(pair);\n          } else {\n            ( Ember.assert(\"You cannot return an empty array from adapter's method groupRecordsForFindMany\", false));\n          }\n        }\n      } else {\n        for (var _i6 = 0; _i6 < totalItems; _i6++) {\n          _fetchRecord(pendingFetchItems[_i6]);\n        }\n      }\n    }\n    /**\n      Get the reference for the specified record.\n       Example\n       ```javascript\n      let userRef = store.getReference('user', 1);\n       // check if the user is loaded\n      let isLoaded = userRef.value() !== null;\n       // get the record of the reference (null if not yet available)\n      let user = userRef.value();\n       // get the identifier of the reference\n      if (userRef.remoteType() === 'id') {\n      let id = userRef.id();\n      }\n       // load user (via store.find)\n      userRef.load().then(...)\n       // or trigger a reload\n      userRef.reload().then(...)\n       // provide data for reference\n      userRef.push({ id: 1, username: '@user' }).then(function(user) {\n        userRef.value() === user;\n      });\n      ```\n       @method getReference\n      @param {String} modelName\n      @param {String|Integer} id\n      @since 2.5.0\n      @return {RecordReference}\n    */\n\n\n    getReference(modelName, id) {\n      {\n        assertDestroyingStore(this, 'getReference');\n      }\n\n      var type = normalizeModelName(modelName);\n      var normalizedId = ensureStringId(id);\n      var resource = constructResource(type, normalizedId);\n      return internalModelFactoryFor(this).lookup(resource).recordReference;\n    }\n    /**\n      Get a record by a given type and ID without triggering a fetch.\n       This method will synchronously return the record if it is available in the store,\n      otherwise it will return `null`. A record is available if it has been fetched earlier, or\n      pushed manually into the store.\n       See [findRecord](Store/methods/findRecord?anchor=findRecord) if you would like to request this record from the backend.\n       _Note: This is a synchronous method and does not return a promise._\n       ```js\n      let post = store.peekRecord('post', 1);\n       post.get('id'); // 1\n      ```\n       @since 1.13.0\n      @method peekRecord\n      @param {String} modelName\n      @param {String|Integer} id\n      @return {Model|null} record\n    */\n\n\n    peekRecord(modelName, id) {\n      {\n        assertDestroyingStore(this, 'peekRecord');\n      }\n\n      ( !(Ember.isPresent(modelName)) && Ember.assert(`You need to pass a model name to the store's peekRecord method`, Ember.isPresent(modelName)));\n      ( !(typeof modelName === 'string') && Ember.assert(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${modelName}`, typeof modelName === 'string'));\n      var type = normalizeModelName(modelName);\n      var normalizedId = ensureStringId(id);\n\n      if (this.hasRecordForId(type, normalizedId)) {\n        var resource = constructResource(type, normalizedId);\n        return internalModelFactoryFor(this).lookup(resource).getRecord();\n      } else {\n        return null;\n      }\n    }\n    /**\n      This method is called by the record's `reload` method.\n       This method calls the adapter's `find` method, which returns a promise. When\n      **that** promise resolves, `_reloadRecord` will resolve the promise returned\n      by the record's `reload`.\n       @method _reloadRecord\n      @private\n      @param {Model} internalModel\n      @param options optional to include adapterOptions\n      @return {Promise} promise\n    */\n\n\n    _reloadRecord(internalModel, options) {\n\n      var {\n        id,\n        modelName\n      } = internalModel;\n      var adapter = this.adapterFor(modelName);\n      ( !(id) && Ember.assert(`You cannot reload a record without an ID`, id));\n      ( !(adapter) && Ember.assert(`You tried to reload a record but you have no adapter (for ${modelName})`, adapter));\n      ( !(typeof adapter.findRecord === 'function' || typeof adapter.find === 'function') && Ember.assert(`You tried to reload a record but your adapter does not implement 'findRecord'`, typeof adapter.findRecord === 'function' || typeof adapter.find === 'function'));\n      return this._scheduleFetch(internalModel, options);\n    }\n    /**\n     This method returns true if a record for a given modelName and id is already\n     loaded in the store. Use this function to know beforehand if a findRecord()\n     will result in a request or that it will be a cache hit.\n      Example\n      ```javascript\n     store.hasRecordForId('post', 1); // false\n     store.findRecord('post', 1).then(function() {\n       store.hasRecordForId('post', 1); // true\n     });\n     ```\n       @method hasRecordForId\n      @param {String} modelName\n      @param {(String|Integer)} id\n      @return {Boolean}\n    */\n\n\n    hasRecordForId(modelName, id) {\n      {\n        assertDestroyingStore(this, 'hasRecordForId');\n      }\n\n      ( !(Ember.isPresent(modelName)) && Ember.assert(`You need to pass a model name to the store's hasRecordForId method`, Ember.isPresent(modelName)));\n      ( !(typeof modelName === 'string') && Ember.assert(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${modelName}`, typeof modelName === 'string'));\n      var type = normalizeModelName(modelName);\n      var trueId = ensureStringId(id);\n      var resource = {\n        type,\n        id: trueId\n      };\n      var identifier = identifierCacheFor(this).peekRecordIdentifier(resource);\n      var internalModel = identifier && internalModelFactoryFor(this).peek(identifier);\n      return !!internalModel && internalModel.isLoaded();\n    }\n    /**\n      Returns id record for a given type and ID. If one isn't already loaded,\n      it builds a new record and leaves it in the `empty` state.\n       @method recordForId\n      @private\n      @param {String} modelName\n      @param {(String|Integer)} id\n      @return {Model} record\n    */\n\n\n    recordForId(modelName, id) {\n      {\n        assertDestroyingStore(this, 'recordForId');\n      }\n\n      ( !(Ember.isPresent(modelName)) && Ember.assert(`You need to pass a model name to the store's recordForId method`, Ember.isPresent(modelName)));\n      ( !(typeof modelName === 'string') && Ember.assert(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${modelName}`, typeof modelName === 'string'));\n      var resource = constructResource(modelName, ensureStringId(id));\n      return internalModelFactoryFor(this).lookup(resource).getRecord();\n    }\n    /**\n      @method findMany\n      @private\n      @param {Array} internalModels\n      @return {Promise} promise\n    */\n\n\n    findMany(internalModels, options) {\n      {\n        assertDestroyingStore(this, 'findMany');\n      }\n\n      var finds = new Array(internalModels.length);\n\n      for (var i = 0; i < internalModels.length; i++) {\n        finds[i] = this._findEmptyInternalModel(internalModels[i], options);\n      }\n\n      return Ember.RSVP.Promise.all(finds);\n    }\n    /**\n      If a relationship was originally populated by the adapter as a link\n      (as opposed to a list of IDs), this method is called when the\n      relationship is fetched.\n       The link (which is usually a URL) is passed through unchanged, so the\n      adapter can make whatever request it wants.\n       The usual use-case is for the server to register a URL as a link, and\n      then use that URL in the future to make a request for the relationship.\n       @method findHasMany\n      @private\n      @param {InternalModel} internalModel\n      @param {any} link\n      @param {(Relationship)} relationship\n      @return {Promise} promise\n    */\n\n\n    findHasMany(internalModel, link, relationship, options) {\n      {\n        assertDestroyingStore(this, 'findHasMany');\n      }\n\n      var adapter = this.adapterFor(internalModel.modelName);\n      ( !(adapter) && Ember.assert(`You tried to load a hasMany relationship but you have no adapter (for ${internalModel.modelName})`, adapter));\n      ( !(typeof adapter.findHasMany === 'function') && Ember.assert(`You tried to load a hasMany relationship from a specified 'link' in the original payload but your adapter does not implement 'findHasMany'`, typeof adapter.findHasMany === 'function'));\n      return _findHasMany(adapter, this, internalModel, link, relationship, options);\n    }\n\n    _findHasManyByJsonApiResource(resource, parentInternalModel, relationshipMeta, options) {\n      if (!resource) {\n        return Ember.RSVP.resolve([]);\n      }\n\n      var {\n        relationshipIsStale,\n        allInverseRecordsAreLoaded,\n        hasDematerializedInverse,\n        hasAnyRelationshipData,\n        relationshipIsEmpty,\n        shouldForceReload\n      } = resource._relationship;\n      var shouldFindViaLink = resource.links && resource.links.related && (shouldForceReload || hasDematerializedInverse || relationshipIsStale || !allInverseRecordsAreLoaded && !relationshipIsEmpty); // fetch via link\n\n      if (shouldFindViaLink) {\n        return this.findHasMany(parentInternalModel, resource.links.related, relationshipMeta, options);\n      }\n\n      var preferLocalCache = hasAnyRelationshipData && !relationshipIsEmpty;\n      var hasLocalPartialData = hasDematerializedInverse || relationshipIsEmpty && Array.isArray(resource.data) && resource.data.length > 0; // fetch using data, pulling from local cache if possible\n\n      if (!shouldForceReload && !relationshipIsStale && (preferLocalCache || hasLocalPartialData)) {\n        var internalModels = resource.data.map(json => this._internalModelForResource(json));\n        return this.findMany(internalModels, options);\n      }\n\n      var hasData = hasAnyRelationshipData && !relationshipIsEmpty; // fetch by data\n\n      if (hasData || hasLocalPartialData) {\n        var _internalModels = resource.data.map(json => this._internalModelForResource(json));\n\n        return this._scheduleFetchMany(_internalModels, options);\n      } // we were explicitly told we have no data and no links.\n      //   TODO if the relationshipIsStale, should we hit the adapter anyway?\n\n\n      return Ember.RSVP.resolve([]);\n    }\n\n    _getHasManyByJsonApiResource(resource) {\n      var internalModels = [];\n\n      if (resource && resource.data) {\n        internalModels = resource.data.map(reference => this._internalModelForResource(reference));\n      }\n\n      return internalModels;\n    }\n    /**\n      @method findBelongsTo\n      @private\n      @param {InternalModel} internalModel\n      @param {any} link\n      @param {Relationship} relationship\n      @return {Promise} promise\n    */\n\n\n    findBelongsTo(internalModel, link, relationship, options) {\n      {\n        assertDestroyingStore(this, 'findBelongsTo');\n      }\n\n      var adapter = this.adapterFor(internalModel.modelName);\n      ( !(adapter) && Ember.assert(`You tried to load a belongsTo relationship but you have no adapter (for ${internalModel.modelName})`, adapter));\n      ( !(typeof adapter.findBelongsTo === 'function') && Ember.assert(`You tried to load a belongsTo relationship from a specified 'link' in the original payload but your adapter does not implement 'findBelongsTo'`, typeof adapter.findBelongsTo === 'function'));\n      return _findBelongsTo(adapter, this, internalModel, link, relationship, options);\n    }\n\n    _fetchBelongsToLinkFromResource(resource, parentInternalModel, relationshipMeta, options) {\n      if (!resource || !resource.links || !resource.links.related) {\n        // should we warn here, not sure cause its an internal method\n        return Ember.RSVP.resolve(null);\n      }\n\n      return this.findBelongsTo(parentInternalModel, resource.links.related, relationshipMeta, options).then(internalModel => {\n        return internalModel ? internalModel.getRecord() : null;\n      });\n    }\n\n    _findBelongsToByJsonApiResource(resource, parentInternalModel, relationshipMeta, options) {\n      if (!resource) {\n        return Ember.RSVP.resolve(null);\n      }\n\n      var internalModel = resource.data ? this._internalModelForResource(resource.data) : null;\n      var {\n        relationshipIsStale,\n        allInverseRecordsAreLoaded,\n        hasDematerializedInverse,\n        hasAnyRelationshipData,\n        relationshipIsEmpty,\n        shouldForceReload\n      } = resource._relationship;\n      var shouldFindViaLink = resource.links && resource.links.related && (shouldForceReload || hasDematerializedInverse || relationshipIsStale || !allInverseRecordsAreLoaded && !relationshipIsEmpty);\n\n      if (internalModel) {\n        // short circuit if we are already loading\n        {\n          if (internalModel.isLoading()) {\n            return internalModel._promiseProxy.then(() => {\n              return internalModel.getRecord();\n            });\n          }\n        }\n      } // fetch via link\n\n\n      if (shouldFindViaLink) {\n        return this._fetchBelongsToLinkFromResource(resource, parentInternalModel, relationshipMeta, options);\n      }\n\n      var preferLocalCache = hasAnyRelationshipData && allInverseRecordsAreLoaded && !relationshipIsEmpty;\n      var hasLocalPartialData = hasDematerializedInverse || relationshipIsEmpty && resource.data; // null is explicit empty, undefined is \"we don't know anything\"\n\n      var localDataIsEmpty = resource.data === undefined || resource.data === null; // fetch using data, pulling from local cache if possible\n\n      if (!shouldForceReload && !relationshipIsStale && (preferLocalCache || hasLocalPartialData)) {\n        /*\n          We have canonical data, but our local state is empty\n         */\n        if (localDataIsEmpty) {\n          return Ember.RSVP.resolve(null);\n        }\n\n        return this._findByInternalModel(internalModel, options);\n      }\n\n      var resourceIsLocal = !localDataIsEmpty && resource.data.id === null;\n\n      if (internalModel && resourceIsLocal) {\n        return Ember.RSVP.resolve(internalModel.getRecord());\n      } // fetch by data\n\n\n      if (internalModel && !localDataIsEmpty) {\n        return this._scheduleFetch(internalModel, options).then(() => {\n          return internalModel.getRecord();\n        });\n      } // we were explicitly told we have no data and no links.\n      //   TODO if the relationshipIsStale, should we hit the adapter anyway?\n\n\n      return Ember.RSVP.resolve(null);\n    }\n    /**\n      This method delegates a query to the adapter. This is the one place where\n      adapter-level semantics are exposed to the application.\n       Each time this method is called a new request is made through the adapter.\n       Exposing queries this way seems preferable to creating an abstract query\n      language for all server-side queries, and then require all adapters to\n      implement them.\n       ---\n       If you do something like this:\n       ```javascript\n      store.query('person', { page: 1 });\n      ```\n       The request made to the server will look something like this:\n       ```\n      GET \"/api/v1/person?page=1\"\n      ```\n       ---\n       If you do something like this:\n       ```javascript\n      store.query('person', { ids: [1, 2, 3] });\n      ```\n       The request made to the server will look something like this:\n       ```\n      GET \"/api/v1/person?ids%5B%5D=1&ids%5B%5D=2&ids%5B%5D=3\"\n      decoded: \"/api/v1/person?ids[]=1&ids[]=2&ids[]=3\"\n      ```\n       This method returns a promise, which is resolved with an\n      [`AdapterPopulatedRecordArray`](/ember-data/release/classes/AdapterPopulatedRecordArray)\n      once the server returns.\n       @since 1.13.0\n      @method query\n      @param {String} modelName\n      @param {any} query an opaque query to be used by the adapter\n      @param {Object} options optional, may include `adapterOptions` hash which will be passed to adapter.query\n      @return {Promise} promise\n    */\n\n\n    query(modelName, query, options) {\n      {\n        assertDestroyingStore(this, 'query');\n      }\n\n      ( !(Ember.isPresent(modelName)) && Ember.assert(`You need to pass a model name to the store's query method`, Ember.isPresent(modelName)));\n      ( !(query) && Ember.assert(`You need to pass a query hash to the store's query method`, query));\n      ( !(typeof modelName === 'string') && Ember.assert(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${modelName}`, typeof modelName === 'string'));\n      var adapterOptionsWrapper = {};\n\n      if (options && options.adapterOptions) {\n        adapterOptionsWrapper.adapterOptions = options.adapterOptions;\n      }\n\n      var normalizedModelName = normalizeModelName(modelName);\n      return this._query(normalizedModelName, query, null, adapterOptionsWrapper);\n    }\n\n    _query(modelName, query, array, options) {\n      ( !(Ember.isPresent(modelName)) && Ember.assert(`You need to pass a model name to the store's query method`, Ember.isPresent(modelName)));\n      ( !(query) && Ember.assert(`You need to pass a query hash to the store's query method`, query));\n      ( !(typeof modelName === 'string') && Ember.assert(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${modelName}`, typeof modelName === 'string'));\n      var adapter = this.adapterFor(modelName);\n      ( !(adapter) && Ember.assert(`You tried to load a query but you have no adapter (for ${modelName})`, adapter));\n      ( !(typeof adapter.query === 'function') && Ember.assert(`You tried to load a query but your adapter does not implement 'query'`, typeof adapter.query === 'function'));\n      return promiseArray(_query(adapter, this, modelName, query, array, options));\n    }\n    /**\n      This method makes a request for one record, where the `id` is not known\n      beforehand (if the `id` is known, use [`findRecord`](Store/methods/findRecord?anchor=findRecord)\n      instead).\n       This method can be used when it is certain that the server will return a\n      single object for the primary data.\n       Each time this method is called a new request is made through the adapter.\n       Let's assume our API provides an endpoint for the currently logged in user\n      via:\n       ```\n      // GET /api/current_user\n      {\n        user: {\n          id: 1234,\n          username: 'admin'\n        }\n      }\n      ```\n       Since the specific `id` of the `user` is not known beforehand, we can use\n      `queryRecord` to get the user:\n       ```javascript\n      store.queryRecord('user', {}).then(function(user) {\n        let username = user.get('username');\n        console.log(`Currently logged in as ${username}`);\n      });\n      ```\n       The request is made through the adapters' `queryRecord`:\n       ```app/adapters/user.js\n      import $ from 'jquery';\n      import Adapter from '@ember-data/adapter';\n       export default Adapter.extend({\n        queryRecord(modelName, query) {\n          return $.getJSON('/api/current_user');\n        }\n      });\n      ```\n       Note: the primary use case for `store.queryRecord` is when a single record\n      is queried and the `id` is not known beforehand. In all other cases\n      `store.query` and using the first item of the array is likely the preferred\n      way:\n       ```\n      // GET /users?username=unique\n      {\n        data: [{\n          id: 1234,\n          type: 'user',\n          attributes: {\n            username: \"unique\"\n          }\n        }]\n      }\n      ```\n       ```javascript\n      store.query('user', { username: 'unique' }).then(function(users) {\n        return users.get('firstObject');\n      }).then(function(user) {\n        let id = user.get('id');\n      });\n      ```\n       This method returns a promise, which resolves with the found record.\n       If the adapter returns no data for the primary data of the payload, then\n      `queryRecord` resolves with `null`:\n       ```\n      // GET /users?username=unique\n      {\n        data: null\n      }\n      ```\n       ```javascript\n      store.queryRecord('user', { username: 'unique' }).then(function(user) {\n        console.log(user); // null\n      });\n      ```\n       @since 1.13.0\n      @method queryRecord\n      @param {String} modelName\n      @param {any} query an opaque query to be used by the adapter\n      @param {Object} options optional, may include `adapterOptions` hash which will be passed to adapter.queryRecord\n      @return {Promise} promise which resolves with the found record or `null`\n    */\n\n\n    queryRecord(modelName, query, options) {\n      {\n        assertDestroyingStore(this, 'queryRecord');\n      }\n\n      ( !(Ember.isPresent(modelName)) && Ember.assert(`You need to pass a model name to the store's queryRecord method`, Ember.isPresent(modelName)));\n      ( !(query) && Ember.assert(`You need to pass a query hash to the store's queryRecord method`, query));\n      ( !(typeof modelName === 'string') && Ember.assert(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${modelName}`, typeof modelName === 'string'));\n      var normalizedModelName = normalizeModelName(modelName);\n      var adapter = this.adapterFor(normalizedModelName);\n      var adapterOptionsWrapper = {};\n\n      if (options && options.adapterOptions) {\n        adapterOptionsWrapper.adapterOptions = options.adapterOptions;\n      }\n\n      ( !(adapter) && Ember.assert(`You tried to make a query but you have no adapter (for ${normalizedModelName})`, adapter));\n      ( !(typeof adapter.queryRecord === 'function') && Ember.assert(`You tried to make a query but your adapter does not implement 'queryRecord'`, typeof adapter.queryRecord === 'function'));\n      return promiseObject(_queryRecord(adapter, this, normalizedModelName, query, adapterOptionsWrapper).then(internalModel => {\n        // the promise returned by store.queryRecord is expected to resolve with\n        // an instance of Model\n        if (internalModel) {\n          return internalModel.getRecord();\n        }\n\n        return null;\n      }));\n    }\n    /**\n      `findAll` asks the adapter's `findAll` method to find the records for the\n      given type, and returns a promise which will resolve with all records of\n      this type present in the store, even if the adapter only returns a subset\n      of them.\n       ```app/routes/authors.js\n      import Route from '@ember/routing/route';\n       export default Route.extend({\n        model(params) {\n          return this.store.findAll('author');\n        }\n      });\n      ```\n       _When_ the returned promise resolves depends on the reload behavior,\n      configured via the passed `options` hash and the result of the adapter's\n      `shouldReloadAll` method.\n       ### Reloading\n       If `{ reload: true }` is passed or `adapter.shouldReloadAll` evaluates to\n      `true`, then the returned promise resolves once the adapter returns data,\n      regardless if there are already records in the store:\n       ```js\n      store.push({\n        data: {\n          id: 'first',\n          type: 'author'\n        }\n      });\n       // adapter#findAll resolves with\n      // [\n      //   {\n      //     id: 'second',\n      //     type: 'author'\n      //   }\n      // ]\n      store.findAll('author', { reload: true }).then(function(authors) {\n        authors.getEach('id'); // ['first', 'second']\n      });\n      ```\n       If no reload is indicated via the above mentioned ways, then the promise\n      immediately resolves with all the records currently loaded in the store.\n       ### Background Reloading\n       Optionally, if `adapter.shouldBackgroundReloadAll` evaluates to `true`,\n      then a background reload is started. Once this resolves, the array with\n      which the promise resolves, is updated automatically so it contains all the\n      records in the store:\n       ```app/adapters/application.js\n      import Adapter from '@ember-data/adapter';\n      export default Adapter.extend({\n        shouldReloadAll(store, snapshotsArray) {\n          return false;\n        },\n         shouldBackgroundReloadAll(store, snapshotsArray) {\n          return true;\n        }\n      });\n       // ...\n       store.push({\n        data: {\n          id: 'first',\n          type: 'author'\n        }\n      });\n       let allAuthors;\n      store.findAll('author').then(function(authors) {\n        authors.getEach('id'); // ['first']\n         allAuthors = authors;\n      });\n       // later, once adapter#findAll resolved with\n      // [\n      //   {\n      //     id: 'second',\n      //     type: 'author'\n      //   }\n      // ]\n       allAuthors.getEach('id'); // ['first', 'second']\n      ```\n       If you would like to force or prevent background reloading, you can set a\n      boolean value for `backgroundReload` in the options object for\n      `findAll`.\n       ```app/routes/post/edit.js\n      import Route from '@ember/routing/route';\n       export default Route.extend({\n        model() {\n          return this.store.findAll('post', { backgroundReload: false });\n        }\n      });\n      ```\n       If you pass an object on the `adapterOptions` property of the options\n      argument it will be passed to you adapter via the `snapshotRecordArray`\n       ```app/routes/posts.js\n      import Route from '@ember/routing/route';\n       export default Route.extend({\n        model(params) {\n          return this.store.findAll('post', {\n            adapterOptions: { subscribe: false }\n          });\n        }\n      });\n      ```\n       ```app/adapters/post.js\n      import MyCustomAdapter from './custom-adapter';\n       export default MyCustomAdapter.extend({\n        findAll(store, type, sinceToken, snapshotRecordArray) {\n          if (snapshotRecordArray.adapterOptions.subscribe) {\n            // ...\n          }\n          // ...\n        }\n      });\n      ```\n       See [peekAll](Store/methods/peekAll?anchor=peekAll) to get an array of current records in the\n      store, without waiting until a reload is finished.\n       ### Retrieving Related Model Records\n       If you use an adapter such as Ember's default\n      [`JSONAPIAdapter`](/ember-data/release/classes/JSONAPIAdapter)\n      that supports the [JSON API specification](http://jsonapi.org/) and if your server\n      endpoint supports the use of an\n      ['include' query parameter](http://jsonapi.org/format/#fetching-includes),\n      you can use `findAll()` to automatically retrieve additional records related to\n      those requested by supplying an `include` parameter in the `options` object.\n       For example, given a `post` model that has a `hasMany` relationship with a `comment`\n      model, when we retrieve all of the post records we can have the server also return\n      all of the posts' comments in the same request:\n       ```app/routes/posts.js\n      import Route from '@ember/routing/route';\n       export default Route.extend({\n        model() {\n          return this.store.findAll('post', { include: 'comments' });\n        }\n      });\n       ```\n      Multiple relationships can be requested using an `include` parameter consisting of a\n      comma-separated list (without white-space) while nested relationships can be specified\n      using a dot-separated sequence of relationship names. So to request both the posts'\n      comments and the authors of those comments the request would look like this:\n       ```app/routes/posts.js\n      import Route from '@ember/routing/route';\n       export default Route.extend({\n        model() {\n          return this.store.findAll('post', { include: 'comments,comments.author' });\n        }\n      });\n       ```\n       See [query](Store/methods/query?anchor=query) to only get a subset of records from the server.\n       @since 1.13.0\n      @method findAll\n      @param {String} modelName\n      @param {Object} options\n      @return {Promise} promise\n    */\n\n\n    findAll(modelName, options) {\n      {\n        assertDestroyingStore(this, 'findAll');\n      }\n\n      ( !(Ember.isPresent(modelName)) && Ember.assert(`You need to pass a model name to the store's findAll method`, Ember.isPresent(modelName)));\n      ( !(typeof modelName === 'string') && Ember.assert(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${modelName}`, typeof modelName === 'string'));\n      var normalizedModelName = normalizeModelName(modelName);\n\n      var fetch = this._fetchAll(normalizedModelName, this.peekAll(normalizedModelName), options);\n\n      return fetch;\n    }\n    /**\n      @method _fetchAll\n      @private\n      @param {Model} modelName\n      @param {RecordArray} array\n      @return {Promise} promise\n    */\n\n\n    _fetchAll(modelName, array, options = {}) {\n      var adapter = this.adapterFor(modelName);\n      ( !(adapter) && Ember.assert(`You tried to load all records but you have no adapter (for ${modelName})`, adapter));\n      ( !(typeof adapter.findAll === 'function') && Ember.assert(`You tried to load all records but your adapter does not implement 'findAll'`, typeof adapter.findAll === 'function'));\n\n      if (options.reload) {\n        Ember.set(array, 'isUpdating', true);\n        return promiseArray(_findAll(adapter, this, modelName, options));\n      }\n\n      var snapshotArray = array._createSnapshot(options);\n\n      if (adapter.shouldReloadAll(this, snapshotArray)) {\n        Ember.set(array, 'isUpdating', true);\n        return promiseArray(_findAll(adapter, this, modelName, options));\n      }\n\n      if (options.backgroundReload === false) {\n        return promiseArray(Ember.RSVP.Promise.resolve(array));\n      }\n\n      if (options.backgroundReload || adapter.shouldBackgroundReloadAll(this, snapshotArray)) {\n        Ember.set(array, 'isUpdating', true);\n\n        _findAll(adapter, this, modelName, options);\n      }\n\n      return promiseArray(Ember.RSVP.Promise.resolve(array));\n    }\n    /**\n      @method _didUpdateAll\n      @param {String} modelName\n      @private\n    */\n\n\n    _didUpdateAll(modelName) {\n      this.recordArrayManager._didUpdateAll(modelName);\n    }\n    /**\n      This method returns a filtered array that contains all of the\n      known records for a given type in the store.\n       Note that because it's just a filter, the result will contain any\n      locally created records of the type, however, it will not make a\n      request to the backend to retrieve additional records. If you\n      would like to request all the records from the backend please use\n      [store.findAll](Store/methods/findAll?anchor=findAll).\n       Also note that multiple calls to `peekAll` for a given type will always\n      return the same `RecordArray`.\n       Example\n       ```javascript\n      let localPosts = store.peekAll('post');\n      ```\n       @since 1.13.0\n      @method peekAll\n      @param {String} modelName\n      @return {RecordArray}\n    */\n\n\n    peekAll(modelName) {\n      {\n        assertDestroyingStore(this, 'peekAll');\n      }\n\n      ( !(Ember.isPresent(modelName)) && Ember.assert(`You need to pass a model name to the store's peekAll method`, Ember.isPresent(modelName)));\n      ( !(typeof modelName === 'string') && Ember.assert(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${modelName}`, typeof modelName === 'string'));\n      var normalizedModelName = normalizeModelName(modelName);\n      return this.recordArrayManager.liveRecordArrayFor(normalizedModelName);\n    }\n    /**\n      This method unloads all records in the store.\n      It schedules unloading to happen during the next run loop.\n       Optionally you can pass a type which unload all records for a given type.\n       ```javascript\n      store.unloadAll();\n      store.unloadAll('post');\n      ```\n       @method unloadAll\n      @param {String} modelName\n    */\n\n\n    unloadAll(modelName) {\n      {\n        assertDestroyedStoreOnly(this, 'unloadAll');\n      }\n\n      ( !(!modelName || typeof modelName === 'string') && Ember.assert(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${modelName}`, !modelName || typeof modelName === 'string'));\n      var factory = internalModelFactoryFor(this);\n\n      if (modelName === undefined) {\n        factory.clear();\n      } else {\n        var normalizedModelName = normalizeModelName(modelName);\n        factory.clear(normalizedModelName);\n      }\n    }\n\n    filter() {\n      ( Ember.assert('The filter API has been moved to a plugin. To enable store.filter using an environment flag, or to use an alternative, you can visit the ember-data-filter addon page. https://github.com/ember-data/ember-data-filter', false));\n    } // ..............\n    // . PERSISTING .\n    // ..............\n\n    /**\n      This method is called by `record.save`, and gets passed a\n      resolver for the promise that `record.save` returns.\n       It schedules saving to happen at the end of the run loop.\n       @method scheduleSave\n      @private\n      @param {InternalModel} internalModel\n      @param {Resolver} resolver\n      @param {Object} options\n    */\n\n\n    scheduleSave(internalModel, resolver, options) {\n      var snapshot = internalModel.createSnapshot(options);\n\n      if (internalModel._isRecordFullyDeleted()) {\n        resolver.resolve();\n        return resolver.promise;\n      }\n\n      internalModel.adapterWillCommit();\n\n      this._pendingSave.push({\n        snapshot: snapshot,\n        resolver: resolver\n      });\n\n      emberRun$2.scheduleOnce('actions', this, this.flushPendingSave);\n    }\n    /**\n      This method is called at the end of the run loop, and\n      flushes any records passed into `scheduleSave`\n       @method flushPendingSave\n      @private\n    */\n\n\n    flushPendingSave() {\n\n      var pending = this._pendingSave.slice();\n\n      this._pendingSave = [];\n\n      for (var i = 0, j = pending.length; i < j; i++) {\n        var pendingItem = pending[i];\n        var snapshot = pendingItem.snapshot;\n        var resolver = pendingItem.resolver;\n        var internalModel = snapshot._internalModel;\n        var adapter = this.adapterFor(internalModel.modelName);\n        var operation = void 0;\n\n        {\n          if (internalModel.currentState.stateName === 'root.deleted.saved') {\n            resolver.resolve();\n            continue;\n          } else if (internalModel.isNew()) {\n            operation = 'createRecord';\n          } else if (internalModel.isDeleted()) {\n            operation = 'deleteRecord';\n          } else {\n            operation = 'updateRecord';\n          }\n        }\n\n        resolver.resolve(_commit(adapter, this, operation, snapshot));\n      }\n    }\n    /**\n      This method is called once the promise returned by an\n      adapter's `createRecord`, `updateRecord` or `deleteRecord`\n      is resolved.\n       If the data provides a server-generated ID, it will\n      update the record and the store's indexes.\n       @method didSaveRecord\n      @private\n      @param {InternalModel} internalModel the in-flight internal model\n      @param {Object} data optional data (see above)\n      @param {string} op the adapter operation that was committed\n    */\n\n\n    didSaveRecord(internalModel, dataArg, op) {\n      {\n        assertDestroyingStore(this, 'didSaveRecord');\n      }\n\n      var data;\n\n      if (dataArg) {\n        data = dataArg.data;\n      }\n\n      if (!data) {\n        ( !(internalModel.id) && Ember.assert(`Your ${internalModel.modelName} record was saved to the server, but the response does not have an id and no id has been set client side. Records must have ids. Please update the server response to provide an id in the response or generate the id on the client side either before saving the record or while normalizing the response.`, internalModel.id));\n      }\n\n      {\n        var cache = identifierCacheFor(this);\n        var _identifier3 = internalModel.identifier;\n\n        if (op !== 'deleteRecord' && data) {\n          cache.updateRecordIdentifier(_identifier3, data);\n        }\n      } //We first make sure the primary data has been updated\n      //TODO try to move notification to the user to the end of the runloop\n\n\n      internalModel.adapterDidCommit(data);\n    }\n    /**\n      This method is called once the promise returned by an\n      adapter's `createRecord`, `updateRecord` or `deleteRecord`\n      is rejected with a `InvalidError`.\n       @method recordWasInvalid\n      @private\n      @param {InternalModel} internalModel\n      @param {Object} errors\n    */\n\n\n    recordWasInvalid(internalModel, parsedErrors, error) {\n      {\n        assertDestroyingStore(this, 'recordWasInvalid');\n      }\n\n      {\n        internalModel.adapterDidInvalidate(parsedErrors);\n      }\n    }\n    /**\n      This method is called once the promise returned by an\n      adapter's `createRecord`, `updateRecord` or `deleteRecord`\n      is rejected (with anything other than a `InvalidError`).\n       @method recordWasError\n      @private\n      @param {InternalModel} internalModel\n      @param {Error} error\n    */\n\n\n    recordWasError(internalModel, error) {\n      {\n        assertDestroyingStore(this, 'recordWasError');\n      }\n\n      internalModel.adapterDidError(error);\n    }\n    /**\n      Sets newly received ID from the adapter's `createRecord`, `updateRecord`\n      or `deleteRecord`.\n       @method setRecordId\n      @private\n      @param {String} modelName\n      @param {string} newId\n      @param {string} clientId\n     */\n\n\n    setRecordId(modelName, newId, clientId) {\n      {\n        assertDestroyingStore(this, 'setRecordId');\n      }\n\n      internalModelFactoryFor(this).setRecordId(modelName, newId, clientId);\n    } // ................\n    // . LOADING DATA .\n    // ................\n\n    /**\n      This internal method is used by `push`.\n       @method _load\n      @private\n      @param {Object} data\n    */\n\n\n    _load(data) {\n      var resource = constructResource(normalizeModelName(data.type), ensureStringId(data.id), coerceId(data.lid));\n      var internalModel = internalModelFactoryFor(this).lookup(resource, data); // store.push will be from empty\n      // findRecord will be from root.loading\n      // all else will be updates\n\n      var isLoading = internalModel.currentState.stateName === 'root.loading';\n      var isUpdate = internalModel.currentState.isEmpty === false && !isLoading;\n\n      {\n        // exclude store.push (root.empty) case\n        if (isUpdate || isLoading) {\n          var _identifier4 = internalModel.identifier;\n          var updatedIdentifier = identifierCacheFor(this).updateRecordIdentifier(_identifier4, data);\n\n          if (updatedIdentifier !== _identifier4) {\n            // we encountered a merge of identifiers in which\n            // two identifiers (and likely two internalModels)\n            // existed for the same resource. Now that we have\n            // determined the correct identifier to use, make sure\n            // that we also use the correct internalModel.\n            _identifier4 = updatedIdentifier;\n            internalModel = internalModelFactoryFor(this).lookup(_identifier4);\n          }\n        }\n      }\n\n      internalModel.setupData(data);\n\n      if (isUpdate) {\n        this.recordArrayManager.recordDidChange(internalModel);\n      } else {\n        this.recordArrayManager.recordWasLoaded(internalModel);\n      }\n\n      return internalModel;\n    }\n    /**\n      Push some data for a given type into the store.\n       This method expects normalized [JSON API](http://jsonapi.org/) document. This means you have to follow [JSON API specification](http://jsonapi.org/format/) with few minor adjustments:\n      - record's `type` should always be in singular, dasherized form\n      - members (properties) should be camelCased\n       [Your primary data should be wrapped inside `data` property](http://jsonapi.org/format/#document-top-level):\n       ```js\n      store.push({\n        data: {\n          // primary data for single record of type `Person`\n          id: '1',\n          type: 'person',\n          attributes: {\n            firstName: 'Daniel',\n            lastName: 'Kmak'\n          }\n        }\n      });\n      ```\n       [Demo.](http://ember-twiddle.com/fb99f18cd3b4d3e2a4c7)\n       `data` property can also hold an array (of records):\n       ```js\n      store.push({\n        data: [\n          // an array of records\n          {\n            id: '1',\n            type: 'person',\n            attributes: {\n              firstName: 'Daniel',\n              lastName: 'Kmak'\n            }\n          },\n          {\n            id: '2',\n            type: 'person',\n            attributes: {\n              firstName: 'Tom',\n              lastName: 'Dale'\n            }\n          }\n        ]\n      });\n      ```\n       [Demo.](http://ember-twiddle.com/69cdbeaa3702159dc355)\n       There are some typical properties for `JSONAPI` payload:\n      * `id` - mandatory, unique record's key\n      * `type` - mandatory string which matches `model`'s dasherized name in singular form\n      * `attributes` - object which holds data for record attributes - `attr`'s declared in model\n      * `relationships` - object which must contain any of the following properties under each relationships' respective key (example path is `relationships.achievements.data`):\n        - [`links`](http://jsonapi.org/format/#document-links)\n        - [`data`](http://jsonapi.org/format/#document-resource-object-linkage) - place for primary data\n        - [`meta`](http://jsonapi.org/format/#document-meta) - object which contains meta-information about relationship\n       For this model:\n       ```app/models/person.js\n      import Model, { attr, hasMany } from '@ember-data/model';\n       export default Model.extend({\n        firstName: attr('string'),\n        lastName: attr('string'),\n         children: hasMany('person')\n      });\n      ```\n       To represent the children as IDs:\n       ```js\n      {\n        data: {\n          id: '1',\n          type: 'person',\n          attributes: {\n            firstName: 'Tom',\n            lastName: 'Dale'\n          },\n          relationships: {\n            children: {\n              data: [\n                {\n                  id: '2',\n                  type: 'person'\n                },\n                {\n                  id: '3',\n                  type: 'person'\n                },\n                {\n                  id: '4',\n                  type: 'person'\n                }\n              ]\n            }\n          }\n        }\n      }\n      ```\n       [Demo.](http://ember-twiddle.com/343e1735e034091f5bde)\n       To represent the children relationship as a URL:\n       ```js\n      {\n        data: {\n          id: '1',\n          type: 'person',\n          attributes: {\n            firstName: 'Tom',\n            lastName: 'Dale'\n          },\n          relationships: {\n            children: {\n              links: {\n                related: '/people/1/children'\n              }\n            }\n          }\n        }\n      }\n      ```\n       If you're streaming data or implementing an adapter, make sure\n      that you have converted the incoming data into this form. The\n      store's [normalize](Store/methods/normalize?anchor=normalize) method is a convenience\n      helper for converting a json payload into the form Ember Data\n      expects.\n       ```js\n      store.push(store.normalize('person', data));\n      ```\n       This method can be used both to push in brand new\n      records, as well as to update existing records.\n       @method push\n      @param {Object} data\n      @return the record(s) that was created or\n        updated.\n    */\n\n\n    push(data) {\n      {\n        assertDestroyingStore(this, 'push');\n      }\n\n      var pushed = this._push(data);\n\n      if (Array.isArray(pushed)) {\n        var records = pushed.map(internalModel => internalModel.getRecord());\n        return records;\n      }\n\n      if (pushed === null) {\n        return null;\n      }\n\n      var record = pushed.getRecord();\n      return record;\n    }\n    /*\n      Push some data in the form of a json-api document into the store,\n      without creating materialized records.\n       @method _push\n      @private\n      @param {Object} jsonApiDoc\n      @return {InternalModel|Array<InternalModel>} pushed InternalModel(s)\n    */\n\n\n    _push(jsonApiDoc) {\n      {\n        assertDestroyingStore(this, '_push');\n      }\n\n      var internalModelOrModels = this._backburner.join(() => {\n        var included = jsonApiDoc.included;\n        var i, length;\n\n        if (included) {\n          for (i = 0, length = included.length; i < length; i++) {\n            this._pushInternalModel(included[i]);\n          }\n        }\n\n        if (Array.isArray(jsonApiDoc.data)) {\n          length = jsonApiDoc.data.length;\n          var internalModels = new Array(length);\n\n          for (i = 0; i < length; i++) {\n            internalModels[i] = this._pushInternalModel(jsonApiDoc.data[i]);\n          }\n\n          return internalModels;\n        }\n\n        if (jsonApiDoc.data === null) {\n          return null;\n        }\n\n        ( !(Ember.typeOf(jsonApiDoc.data) === 'object') && Ember.assert(`Expected an object in the 'data' property in a call to 'push' for ${jsonApiDoc.type}, but was ${Ember.typeOf(jsonApiDoc.data)}`, Ember.typeOf(jsonApiDoc.data) === 'object'));\n        return this._pushInternalModel(jsonApiDoc.data);\n      }); // this typecast is necessary because `backburner.join` is mistyped to return void\n\n\n      return internalModelOrModels;\n    }\n\n    _pushInternalModel(data) {\n      var modelName = data.type;\n      ( !(data.id !== null && data.id !== undefined && data.id !== '') && Ember.assert(`You must include an 'id' for ${modelName} in an object passed to 'push'`, data.id !== null && data.id !== undefined && data.id !== ''));\n      ( !(this._hasModelFor(modelName)) && Ember.assert(`You tried to push data with a type '${modelName}' but no model could be found with that name.`, this._hasModelFor(modelName)));\n\n      {\n        // If ENV.DS_WARN_ON_UNKNOWN_KEYS is set to true and the payload\n        // contains unknown attributes or relationships, log a warning.\n        if (ENV.DS_WARN_ON_UNKNOWN_KEYS) {\n          var unknownAttributes, unknownRelationships;\n\n          {\n            var modelClass = this.modelFor(modelName); // Check unknown attributes\n\n            unknownAttributes = Object.keys(data.attributes || {}).filter(key => {\n              return !Ember.get(modelClass, 'fields').has(key);\n            }); // Check unknown relationships\n\n            unknownRelationships = Object.keys(data.relationships || {}).filter(key => {\n              return !Ember.get(modelClass, 'fields').has(key);\n            });\n          }\n\n          var unknownAttributesMessage = `The payload for '${modelName}' contains these unknown attributes: ${unknownAttributes}. Make sure they've been defined in your model.`;\n          ( Ember.warn(unknownAttributesMessage, unknownAttributes.length === 0, {\n            id: 'ds.store.unknown-keys-in-payload'\n          }));\n          var unknownRelationshipsMessage = `The payload for '${modelName}' contains these unknown relationships: ${unknownRelationships}. Make sure they've been defined in your model.`;\n          ( Ember.warn(unknownRelationshipsMessage, unknownRelationships.length === 0, {\n            id: 'ds.store.unknown-keys-in-payload'\n          }));\n        }\n      } // Actually load the record into the store.\n\n\n      var internalModel = this._load(data); //    this._setupRelationshipsForModel(internalModel, data);\n\n\n      return internalModel;\n    }\n    /**\n      Push some raw data into the store.\n       This method can be used both to push in brand new\n      records, as well as to update existing records. You\n      can push in more than one type of object at once.\n      All objects should be in the format expected by the\n      serializer.\n       ```app/serializers/application.js\n      import RESTSerializer from '@ember-data/serializer/rest';\n       export default RESTSerializer;\n      ```\n       ```js\n      let pushData = {\n        posts: [\n          { id: 1, postTitle: \"Great post\", commentIds: [2] }\n        ],\n        comments: [\n          { id: 2, commentBody: \"Insightful comment\" }\n        ]\n      }\n       store.pushPayload(pushData);\n      ```\n       By default, the data will be deserialized using a default\n      serializer (the application serializer if it exists).\n       Alternatively, `pushPayload` will accept a model type which\n      will determine which serializer will process the payload.\n       ```app/serializers/application.js\n      import RESTSerializer from '@ember-data/serializer/rest';\n       export default RESTSerializer;\n      ```\n       ```app/serializers/post.js\n      import JSONSerializer from '@ember-data/serializer/json';\n       export default JSONSerializer;\n      ```\n       ```js\n      store.pushPayload(pushData); // Will use the application serializer\n      store.pushPayload('post', pushData); // Will use the post serializer\n      ```\n       @method pushPayload\n      @param {String} modelName Optionally, a model type used to determine which serializer will be used\n      @param {Object} inputPayload\n    */\n\n\n    pushPayload(modelName, inputPayload) {\n      {\n        assertDestroyingStore(this, 'pushPayload');\n      }\n\n      var serializer;\n      var payload;\n\n      if (!inputPayload) {\n        payload = modelName;\n        serializer = this.serializerFor('application');\n        ( !(typeof serializer.pushPayload === 'function') && Ember.assert(`You cannot use 'store#pushPayload' without a modelName unless your default serializer defines 'pushPayload'`, typeof serializer.pushPayload === 'function'));\n      } else {\n        payload = inputPayload;\n        ( !(typeof modelName === 'string') && Ember.assert(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${modelName}`, typeof modelName === 'string'));\n        var normalizedModelName = normalizeModelName(modelName);\n        serializer = this.serializerFor(normalizedModelName);\n      }\n\n      ( !(serializer.pushPayload) && Ember.assert(`You must define a pushPayload method in your serializer in order to call store.pushPayload`, serializer.pushPayload));\n      serializer.pushPayload(this, payload);\n    }\n\n    reloadManyArray(manyArray, internalModel, key, options) {\n      return internalModel.reloadHasMany(key, options);\n    }\n\n    reloadBelongsTo(belongsToProxy, internalModel, key, options) {\n      return internalModel.reloadBelongsTo(key, options);\n    }\n\n    _internalModelForResource(resource) {\n      return internalModelFactoryFor(this).getByResource(resource);\n    }\n    /**\n     * TODO Only needed temporarily for test support\n     *\n     * @internal\n     */\n\n\n    _internalModelForId(type, id, lid) {\n      var resource = constructResource(type, id, lid);\n      return internalModelFactoryFor(this).lookup(resource);\n    }\n\n    serializeRecord(record, options) {\n      {\n        throw new Error('serializeRecord is only available when CUSTOM_MODEL_CLASS ff is on');\n      }\n    }\n\n    saveRecord(record, options) {\n      {\n        throw new Error('saveRecord is only available when CUSTOM_MODEL_CLASS ff is on');\n      }\n    }\n\n    relationshipReferenceFor(identifier, key) {\n      {\n        throw new Error('relationshipReferenceFor is only available when CUSTOM_MODEL_CLASS ff is on');\n      }\n    }\n    /**\n     * @internal\n     */\n\n\n    _createRecordData(identifier) {\n      return this.createRecordDataFor(identifier.type, identifier.id, identifier.lid, this._storeWrapper);\n    }\n    /**\n     * Instantiation hook allowing applications or addons to configure the store\n     * to utilize a custom RecordData implementation.\n     *\n     * @param modelName\n     * @param id\n     * @param clientId\n     * @param storeWrapper\n     */\n\n\n    createRecordDataFor(modelName, id, clientId, storeWrapper) {\n      throw new Error(`Expected store.createRecordDataFor to be implemented but it wasn't`);\n    }\n    /**\n     * @internal\n     */\n\n\n    __recordDataFor(resource) {\n      var identifier = identifierCacheFor(this).getOrCreateRecordIdentifier(resource);\n      return this.recordDataFor(identifier, false);\n    }\n    /**\n     * @internal\n     */\n\n\n    recordDataFor(identifier, isCreate) {\n      var internalModel;\n\n      if (isCreate === true) {\n        internalModel = internalModelFactoryFor(this).build({\n          type: identifier.type,\n          id: null\n        });\n        internalModel.loadedData();\n        internalModel.didCreateRecord();\n      } else {\n        internalModel = internalModelFactoryFor(this).lookup(identifier);\n      }\n\n      return recordDataFor(internalModel);\n    }\n    /**\n      `normalize` converts a json payload into the normalized form that\n      [push](Store/methods/push?anchor=push) expects.\n       Example\n       ```js\n      socket.on('message', function(message) {\n        let modelName = message.model;\n        let data = message.data;\n        store.push(store.normalize(modelName, data));\n      });\n      ```\n       @method normalize\n      @param {String} modelName The name of the model type for this payload\n      @param {Object} payload\n      @return {Object} The normalized payload\n    */\n\n\n    normalize(modelName, payload) {\n      {\n        assertDestroyingStore(this, 'normalize');\n      }\n\n      ( !(Ember.isPresent(modelName)) && Ember.assert(`You need to pass a model name to the store's normalize method`, Ember.isPresent(modelName)));\n      ( !(typeof modelName === 'string') && Ember.assert(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${Ember.inspect(modelName)}`, typeof modelName === 'string'));\n      var normalizedModelName = normalizeModelName(modelName);\n      var serializer = this.serializerFor(normalizedModelName);\n      var model = this.modelFor(normalizedModelName);\n      ( !(serializer.normalize) && Ember.assert(`You must define a normalize method in your serializer in order to call store.normalize`, serializer.normalize));\n      return serializer.normalize(model, payload);\n    }\n\n    newClientId() {\n      {\n        throw new Error(`Private API Removed`);\n      }\n    } //Called by the state machine to notify the store that the record is ready to be interacted with\n\n\n    recordWasLoaded(record) {\n      {\n        assertDestroyingStore(this, 'recordWasLoaded');\n      }\n\n      this.recordArrayManager.recordWasLoaded(record);\n    } // ...............\n    // . DESTRUCTION .\n    // ...............\n\n    /**\n     * TODO remove test usage\n     *\n     * @internal\n     */\n\n\n    _internalModelsFor(modelName) {\n      return internalModelFactoryFor(this).modelMapFor(modelName);\n    } // ......................\n    // . PER-TYPE ADAPTERS\n    // ......................\n\n    /**\n      Returns an instance of the adapter for a given type. For\n      example, `adapterFor('person')` will return an instance of\n      `App.PersonAdapter`.\n       If no `App.PersonAdapter` is found, this method will look\n      for an `App.ApplicationAdapter` (the default adapter for\n      your entire application).\n       If no `App.ApplicationAdapter` is found, it will return\n      the value of the `defaultAdapter`.\n       @method adapterFor\n      @public\n      @param {String} modelName\n      @return Adapter\n    */\n\n\n    adapterFor(modelName) {\n      {\n        assertDestroyingStore(this, 'adapterFor');\n      }\n\n      ( !(Ember.isPresent(modelName)) && Ember.assert(`You need to pass a model name to the store's adapterFor method`, Ember.isPresent(modelName)));\n      ( !(typeof modelName === 'string') && Ember.assert(`Passing classes to store.adapterFor has been removed. Please pass a dasherized string instead of ${modelName}`, typeof modelName === 'string'));\n      var normalizedModelName = normalizeModelName(modelName);\n      var {\n        _adapterCache\n      } = this;\n      var adapter = _adapterCache[normalizedModelName];\n\n      if (adapter) {\n        return adapter;\n      }\n\n      var owner = Ember.getOwner(this);\n      adapter = owner.lookup(`adapter:${normalizedModelName}`); // in production this is handled by the re-export\n\n      if ( HAS_ADAPTER_PACKAGE && adapter === undefined) {\n        if (normalizedModelName === '-json-api') {\n          var Adapter = require__default('@ember-data/adapter/json-api').default;\n\n          owner.register(`adapter:-json-api`, Adapter);\n          adapter = owner.lookup(`adapter:-json-api`);\n          deprecateTestRegistration('adapter', '-json-api');\n        }\n      }\n\n      if (adapter !== undefined) {\n        Ember.set(adapter, 'store', this);\n        _adapterCache[normalizedModelName] = adapter;\n        return adapter;\n      } // no adapter found for the specific model, fallback and check for application adapter\n\n\n      adapter = _adapterCache.application || owner.lookup('adapter:application');\n\n      if (adapter !== undefined) {\n        Ember.set(adapter, 'store', this);\n        _adapterCache[normalizedModelName] = adapter;\n        _adapterCache.application = adapter;\n        return adapter;\n      } // no model specific adapter or application adapter, check for an `adapter`\n      // property defined on the store\n\n\n      var adapterName = this.adapter || '-json-api';\n      adapter = adapterName ? _adapterCache[adapterName] || owner.lookup(`adapter:${adapterName}`) : undefined; // in production this is handled by the re-export\n\n      if ( HAS_ADAPTER_PACKAGE && adapter === undefined) {\n        if (adapterName === '-json-api') {\n          var _Adapter = require__default('@ember-data/adapter/json-api').default;\n\n          owner.register(`adapter:-json-api`, _Adapter);\n          adapter = owner.lookup(`adapter:-json-api`);\n          deprecateTestRegistration('adapter', '-json-api');\n        }\n      }\n\n      if (adapter !== undefined) {\n        Ember.set(adapter, 'store', this);\n        _adapterCache[normalizedModelName] = adapter;\n        _adapterCache[adapterName] = adapter;\n        return adapter;\n      } // final fallback, no model specific adapter, no application adapter, no\n      // `adapter` property on store: use json-api adapter\n\n\n      adapter = _adapterCache['-json-api'] || owner.lookup('adapter:-json-api');\n      ( !(adapter !== undefined) && Ember.assert(`No adapter was found for '${modelName}' and no 'application' adapter was found as a fallback.`, adapter !== undefined));\n      Ember.set(adapter, 'store', this);\n      _adapterCache[normalizedModelName] = adapter;\n      _adapterCache['-json-api'] = adapter;\n      return adapter;\n    } // ..............................\n    // . RECORD CHANGE NOTIFICATION .\n    // ..............................\n\n    /**\n      Returns an instance of the serializer for a given type. For\n      example, `serializerFor('person')` will return an instance of\n      `App.PersonSerializer`.\n       If no `App.PersonSerializer` is found, this method will look\n      for an `App.ApplicationSerializer` (the default serializer for\n      your entire application).\n       if no `App.ApplicationSerializer` is found, it will attempt\n      to get the `defaultSerializer` from the `PersonAdapter`\n      (`adapterFor('person')`).\n       If a serializer cannot be found on the adapter, it will fall back\n      to an instance of `JSONSerializer`.\n       @method serializerFor\n      @public\n      @param {String} modelName the record to serialize\n      @return {Serializer}\n    */\n\n\n    serializerFor(modelName) {\n      {\n        assertDestroyingStore(this, 'serializerFor');\n      }\n\n      ( !(Ember.isPresent(modelName)) && Ember.assert(`You need to pass a model name to the store's serializerFor method`, Ember.isPresent(modelName)));\n      ( !(typeof modelName === 'string') && Ember.assert(`Passing classes to store.serializerFor has been removed. Please pass a dasherized string instead of ${modelName}`, typeof modelName === 'string'));\n      var normalizedModelName = normalizeModelName(modelName);\n      var {\n        _serializerCache\n      } = this;\n      var serializer = _serializerCache[normalizedModelName];\n\n      if (serializer) {\n        return serializer;\n      }\n\n      var owner = Ember.getOwner(this);\n      serializer = owner.lookup(`serializer:${normalizedModelName}`); // in production this is handled by the re-export\n\n      if ( HAS_SERIALIZER_PACKAGE && serializer === undefined) {\n        if (normalizedModelName === '-json-api') {\n          var Serializer = require__default('@ember-data/serializer/json-api').default;\n\n          owner.register(`serializer:-json-api`, Serializer);\n          serializer = owner.lookup(`serializer:-json-api`);\n          deprecateTestRegistration('serializer', '-json-api');\n        } else if (normalizedModelName === '-rest') {\n          var _Serializer = require__default('@ember-data/serializer/rest').default;\n\n          owner.register(`serializer:-rest`, _Serializer);\n          serializer = owner.lookup(`serializer:-rest`);\n          deprecateTestRegistration('serializer', '-rest');\n        } else if (normalizedModelName === '-default') {\n          var _Serializer2 = require__default('@ember-data/serializer/json').default;\n\n          owner.register(`serializer:-default`, _Serializer2);\n          serializer = owner.lookup(`serializer:-default`);\n          serializer && deprecateTestRegistration('serializer', '-default');\n        }\n      }\n\n      if (serializer !== undefined) {\n        Ember.set(serializer, 'store', this);\n        _serializerCache[normalizedModelName] = serializer;\n        return serializer;\n      } // no serializer found for the specific model, fallback and check for application serializer\n\n\n      serializer = _serializerCache.application || owner.lookup('serializer:application');\n\n      if (serializer !== undefined) {\n        Ember.set(serializer, 'store', this);\n        _serializerCache[normalizedModelName] = serializer;\n        _serializerCache.application = serializer;\n        return serializer;\n      } // no model specific serializer or application serializer, check for the `defaultSerializer`\n      // property defined on the adapter\n\n\n      var adapter = this.adapterFor(modelName);\n      var serializerName = Ember.get(adapter, 'defaultSerializer');\n      ( !(!serializerName) && Ember.deprecate(`store.serializerFor(\"${modelName}\") resolved the \"${serializerName}\" serializer via the deprecated \\`adapter.defaultSerializer\\` property.\\n\\n\\tPreviously, if no application or type-specific serializer was specified, the store would attempt to lookup a serializer via the \\`defaultSerializer\\` property on the type's adapter. This behavior is deprecated in favor of explicitly defining a type-specific serializer or application serializer`, !serializerName, {\n        id: 'ember-data:default-serializer',\n        until: '4.0',\n        url: 'https://deprecations.emberjs.com/ember-data/v3.x#toc_ember-data:default-serializers'\n      }));\n      serializer = serializerName ? _serializerCache[serializerName] || owner.lookup(`serializer:${serializerName}`) : undefined; // in production this is handled by the re-export\n\n      if ( HAS_SERIALIZER_PACKAGE && serializer === undefined) {\n        if (serializerName === '-json-api') {\n          var _Serializer3 = require__default('@ember-data/serializer/json-api').default;\n\n          owner.register(`serializer:-json-api`, _Serializer3);\n          serializer = owner.lookup(`serializer:-json-api`);\n          deprecateTestRegistration('serializer', '-json-api');\n        } else if (serializerName === '-rest') {\n          var _Serializer4 = require__default('@ember-data/serializer/rest').default;\n\n          owner.register(`serializer:-rest`, _Serializer4);\n          serializer = owner.lookup(`serializer:-rest`);\n          deprecateTestRegistration('serializer', '-rest');\n        } else if (serializerName === '-default') {\n          var _Serializer5 = require__default('@ember-data/serializer/json').default;\n\n          owner.register(`serializer:-default`, _Serializer5);\n          serializer = owner.lookup(`serializer:-default`);\n          serializer && deprecateTestRegistration('serializer', '-default');\n        }\n      }\n\n      if (serializer !== undefined) {\n        Ember.set(serializer, 'store', this);\n        _serializerCache[normalizedModelName] = serializer;\n        _serializerCache[serializerName] = serializer;\n        return serializer;\n      } // final fallback, no model specific serializer, no application serializer, no\n      // `serializer` property on store: use the convenience JSONSerializer\n\n\n      serializer = _serializerCache['-default'] || owner.lookup('serializer:-default');\n\n      if ( HAS_SERIALIZER_PACKAGE && serializer === undefined) {\n        var JSONSerializer = require__default('@ember-data/serializer/json').default;\n\n        owner.register('serializer:-default', JSONSerializer);\n        serializer = owner.lookup('serializer:-default');\n        serializer && deprecateTestRegistration('serializer', '-default');\n      }\n\n      ( !(!serializer) && Ember.deprecate(`store.serializerFor(\"${modelName}\") resolved the \"-default\" serializer via the deprecated \"-default\" lookup fallback.\\n\\n\\tPreviously, when no type-specific serializer, application serializer, or adapter.defaultSerializer had been defined by the app, the \"-default\" serializer would be used which defaulted to the \\`JSONSerializer\\`. This behavior is deprecated in favor of explicitly defining an application or type-specific serializer`, !serializer, {\n        id: 'ember-data:default-serializer',\n        until: '4.0',\n        url: 'https://deprecations.emberjs.com/ember-data/v3.x#toc_ember-data:default-serializers'\n      }));\n      ( !(serializer !== undefined) && Ember.assert(`No serializer was found for '${modelName}' and no 'application' serializer was found as a fallback`, serializer !== undefined));\n      Ember.set(serializer, 'store', this);\n      _serializerCache[normalizedModelName] = serializer;\n      _serializerCache['-default'] = serializer;\n      return serializer;\n    }\n\n    willDestroy() {\n      super.willDestroy();\n      this.recordArrayManager.destroy(); // Check if we need to null this out\n      // this._adapterCache = null;\n      // this._serializerCache = null;\n\n      identifierCacheFor(this).destroy();\n      this.unloadAll();\n\n      {\n        Ember.Test.unregisterWaiter(this.__asyncWaiter);\n        var shouldTrack = this.shouldTrackAsyncRequests;\n        var tracked = this._trackedAsyncRequests;\n        var isSettled = tracked.length === 0;\n\n        if (!isSettled) {\n          if (shouldTrack) {\n            throw new Error('Async Request leaks detected. Add a breakpoint here and set `store.generateStackTracesForTrackedRequests = true;`to inspect traces for leak origins:\\n\\t - ' + tracked.map(o => o.label).join('\\n\\t - '));\n          } else {\n            ( Ember.warn('Async Request leaks detected. Add a breakpoint here and set `store.generateStackTracesForTrackedRequests = true;`to inspect traces for leak origins:\\n\\t - ' + tracked.map(o => o.label).join('\\n\\t - '), false, {\n              id: 'ds.async.leak.detected'\n            }));\n          }\n        }\n      }\n    }\n\n    _updateRelationshipState(relationship) {\n      if (this._updatedRelationships.push(relationship) !== 1) {\n        return;\n      }\n\n      this._backburner.join(() => {\n        this._backburner.schedule('syncRelationships', this, this._flushUpdatedRelationships);\n      });\n    }\n\n    _flushUpdatedRelationships() {\n      var updated = this._updatedRelationships;\n\n      for (var i = 0, l = updated.length; i < l; i++) {\n        updated[i].flushCanonical();\n      }\n\n      updated.length = 0;\n    }\n\n    _updateInternalModel(internalModel) {\n      if (this._updatedInternalModels.push(internalModel) !== 1) {\n        return;\n      }\n\n      emberRun$2.schedule('actions', this, this._flushUpdatedInternalModels);\n    }\n\n    _flushUpdatedInternalModels() {\n      var updated = this._updatedInternalModels;\n\n      for (var i = 0, l = updated.length; i < l; i++) {\n        updated[i]._triggerDeferredTriggers();\n      }\n\n      updated.length = 0;\n    }\n\n  }\n\n  Ember.defineProperty(CoreStore.prototype, 'defaultAdapter', Ember.computed('adapter', function () {\n    ( Ember.deprecate(`store.adapterFor(modelName) resolved the (\"${this.adapter || '-json-api'}\") adapter via the deprecated \\`store.defaultAdapter\\` property.\\n\\n\\tPreviously, applications could define the store's \\`adapter\\` property which would be used by \\`defaultAdapter\\` and \\`adapterFor\\` as a fallback for when an adapter was not found by an exact name match. This behavior is deprecated in favor of explicitly defining an application or type-specific adapter.`, false, {\n      id: 'ember-data:default-adapter',\n      until: '4.0',\n      url: 'https://deprecations.emberjs.com/ember-data/v3.x#toc_ember-data:default-adapter'\n    }));\n    var adapter = this.adapter || '-json-api';\n    ( !(typeof adapter === 'string') && Ember.assert('You tried to set `adapter` property to an instance of `Adapter`, where it should be a name', typeof adapter === 'string'));\n    return this.adapterFor(adapter);\n  }));\n\n  function _commit(adapter, store, operation, snapshot) {\n    var internalModel = snapshot._internalModel;\n    var modelName = snapshot.modelName;\n    var modelClass = store.modelFor(modelName);\n    ( !(adapter) && Ember.assert(`You tried to update a record but you have no adapter (for ${modelName})`, adapter));\n    ( !(typeof adapter[operation] === 'function') && Ember.assert(`You tried to update a record but your adapter (for ${modelName}) does not implement '${operation}'`, typeof adapter[operation] === 'function'));\n    var promise = Ember.RSVP.Promise.resolve().then(() => adapter[operation](store, modelClass, snapshot));\n    var serializer = store.serializerFor(modelName);\n    var label = `DS: Extract and notify about ${operation} completion of ${internalModel}`;\n    ( !(promise !== undefined) && Ember.assert(`Your adapter's '${operation}' method must return a value, but it returned 'undefined'`, promise !== undefined));\n    promise = guardDestroyedStore(promise, store, label);\n    promise = _guard(promise, _bind(_objectIsAlive, internalModel));\n    return promise.then(adapterPayload => {\n      /*\n      Note to future spelunkers hoping to optimize.\n      We rely on this `run` to create a run loop if needed\n      that `store._push` and `store.didSaveRecord` will both share.\n       We use `join` because it is often the case that we\n      have an outer run loop available still from the first\n      call to `store._push`;\n      */\n      store._backburner.join(() => {\n        var payload, data, sideloaded;\n\n        if (adapterPayload) {\n          payload = normalizeResponseHelper(serializer, store, modelClass, adapterPayload, snapshot.id, operation);\n\n          if (payload.included) {\n            sideloaded = payload.included;\n          }\n\n          data = payload.data;\n        }\n\n        store.didSaveRecord(internalModel, {\n          data\n        }, operation); // seems risky, but if the tests pass might be fine?\n\n        if (sideloaded) {\n          store._push({\n            data: null,\n            included: sideloaded\n          });\n        }\n      });\n\n      return internalModel;\n    }, function (error) {\n      if (error && error.isAdapterError === true && error.code === 'InvalidError') {\n        var parsedErrors;\n\n        if (typeof serializer.extractErrors === 'function') {\n          parsedErrors = serializer.extractErrors(store, modelClass, error, snapshot.id);\n        } else {\n          parsedErrors = errorsArrayToHash(error.errors);\n        }\n\n        store.recordWasInvalid(internalModel, parsedErrors, error);\n      } else {\n        store.recordWasError(internalModel, error);\n      }\n\n      throw error;\n    }, label);\n  }\n\n  var assertDestroyingStore;\n  var assertDestroyedStoreOnly;\n\n  {\n    assertDestroyingStore = function assertDestroyedStore(store, method) {\n      if (!store.shouldAssertMethodCallsOnDestroyedStore) {\n        ( !(!(store.isDestroying || store.isDestroyed)) && Ember.deprecate(`Attempted to call store.${method}(), but the store instance has already been destroyed.`, !(store.isDestroying || store.isDestroyed), {\n          id: 'ember-data:method-calls-on-destroyed-store',\n          until: '3.8'\n        }));\n      } else {\n        ( !(!(store.isDestroying || store.isDestroyed)) && Ember.assert(`Attempted to call store.${method}(), but the store instance has already been destroyed.`, !(store.isDestroying || store.isDestroyed)));\n      }\n    };\n\n    assertDestroyedStoreOnly = function assertDestroyedStoreOnly(store, method) {\n      if (!store.shouldAssertMethodCallsOnDestroyedStore) {\n        ( !(!store.isDestroyed) && Ember.deprecate(`Attempted to call store.${method}(), but the store instance has already been destroyed.`, !store.isDestroyed, {\n          id: 'ember-data:method-calls-on-destroyed-store',\n          until: '3.8'\n        }));\n      } else {\n        ( !(!store.isDestroyed) && Ember.assert(`Attempted to call store.${method}(), but the store instance has already been destroyed.`, !store.isDestroyed));\n      }\n    };\n  }\n\n  var HAS_MODEL_PACKAGE$1 = require.has('@ember-data/model');\n\n  var _Model;\n\n  function getModel() {\n    if (HAS_MODEL_PACKAGE$1) {\n      _Model = _Model || require__default('@ember-data/model').default;\n    }\n\n    return _Model;\n  }\n  /**\n   *\n   * @param store\n   * @param cache modelFactoryCache\n   * @param normalizedModelName already normalized modelName\n   * @return {*}\n   */\n\n  function getModelFactory(store, cache, normalizedModelName) {\n    var factory = cache[normalizedModelName];\n\n    if (!factory) {\n      factory = _lookupModelFactory(store, normalizedModelName);\n\n      if (!factory) {\n        //Support looking up mixins as base types for polymorphic relationships\n        factory = _modelForMixin(store, normalizedModelName);\n      }\n\n      if (!factory) {\n        // we don't cache misses in case someone wants to register a missing model\n        return null;\n      }\n\n      var klass = factory.class;\n\n      if (klass.isModel) {\n        var hasOwnModelNameSet = klass.modelName && Object.prototype.hasOwnProperty.call(klass, 'modelName');\n\n        if (!hasOwnModelNameSet) {\n          Object.defineProperty(klass, 'modelName', {\n            value: normalizedModelName\n          });\n        }\n      }\n\n      cache[normalizedModelName] = factory;\n    }\n\n    return factory;\n  }\n  function _lookupModelFactory(store, normalizedModelName) {\n    var owner = Ember.getOwner(store);\n    return owner.factoryFor(`model:${normalizedModelName}`);\n  }\n  /*\n      In case someone defined a relationship to a mixin, for example:\n      ```\n        let Comment = Model.extend({\n          owner: belongsTo('commentable'. { polymorphic: true })\n        });\n        let Commentable = Ember.Mixin.create({\n          comments: hasMany('comment')\n        });\n      ```\n      we want to look up a Commentable class which has all the necessary\n      relationship metadata. Thus, we look up the mixin and create a mock\n      Model, so we can access the relationship CPs of the mixin (`comments`)\n      in this case\n    */\n\n  function _modelForMixin(store, normalizedModelName) {\n    if (HAS_MODEL_PACKAGE$1) {\n      var owner = Ember.getOwner(store);\n      var MaybeMixin = owner.factoryFor(`mixin:${normalizedModelName}`);\n      var mixin = MaybeMixin && MaybeMixin.class;\n\n      if (mixin) {\n        var ModelForMixin = getModel().extend(mixin);\n        ModelForMixin.reopenClass({\n          __isMixin: true,\n          __mixin: mixin\n        }); //Cache the class as a model\n\n        owner.register('model:' + normalizedModelName, ModelForMixin);\n      }\n\n      return _lookupModelFactory(store, normalizedModelName);\n    }\n  }\n\n  function notifyChanges(identifier, value, record, store) {\n    if (value === 'attributes') {\n      record.eachAttribute(key => {\n        var currentValue = Ember.cacheFor(record, key);\n\n        var internalModel = store._internalModelForResource(identifier);\n\n        if (currentValue !== internalModel._recordData.getAttr(key)) {\n          record.notifyPropertyChange(key);\n        }\n      });\n    } else if (value === 'relationships') {\n      record.eachRelationship((key, meta) => {\n        var internalModel = store._internalModelForResource(identifier);\n\n        if (meta.kind === 'belongsTo') {\n          record.notifyPropertyChange(key);\n        } else if (meta.kind === 'hasMany') {\n          if (meta.options.async) {\n            record.notifyPropertyChange(key);\n            internalModel.hasManyRemovalCheck(key);\n          }\n\n          if (internalModel._manyArrayCache[key]) {\n            internalModel._manyArrayCache[key].retrieveLatest();\n          }\n        }\n      });\n    } else if (value === 'errors') {\n      var internalModel = store._internalModelForResource(identifier); //TODO guard\n\n\n      var errors = internalModel._recordData.getErrors(identifier);\n\n      record.invalidErrorsChanged(errors);\n    } else if (value === 'state') {\n      record.notifyPropertyChange('isNew');\n      record.notifyPropertyChange('isDeleted');\n    } else if (value === 'identity') {\n      record.notifyPropertyChange('id');\n    }\n  }\n\n  /**\n    @module @ember-data/store\n  */\n\n  /**\n    The store service contains all of the data for records loaded from the server.\n    It is also responsible for creating instances of `Model` that wrap\n    the individual data for a record, so that they can be bound to in your\n    Handlebars templates.\n\n    By default, applications will have a single `Store` service that is\n    automatically created.\n\n    The store can be customized by extending the service in the following manner:\n\n    ```app/services/store.js\n    import Store from '@ember-data/store';\n\n    export default class MyStore extends Store {}\n    ```\n\n    You can retrieve models from the store in several ways. To retrieve a record\n    for a specific id, use the `Store`'s `findRecord()` method:\n\n    ```javascript\n    store.findRecord('person', 123).then(function (person) {\n    });\n    ```\n\n    By default, the store will talk to your backend using a standard\n    REST mechanism. You can customize how the store talks to your\n    backend by specifying a custom adapter:\n\n    ```app/adapters/application.js\n    import DS from 'ember-data';\n\n    export default Adapter.extend({\n    });\n    ```\n\n    You can learn more about writing a custom adapter by reading the `Adapter`\n    documentation.\n\n    ### Store createRecord() vs. push() vs. pushPayload()\n\n    The store provides multiple ways to create new record objects. They have\n    some subtle differences in their use which are detailed below:\n\n    [createRecord](Store/methods/createRecord?anchor=createRecord) is used for creating new\n    records on the client side. This will return a new record in the\n    `created.uncommitted` state. In order to persist this record to the\n    backend, you will need to call `record.save()`.\n\n    [push](Store/methods/push?anchor=push) is used to notify Ember Data's store of new or\n    updated records that exist in the backend. This will return a record\n    in the `loaded.saved` state. The primary use-case for `store#push` is\n    to notify Ember Data about record updates (full or partial) that happen\n    outside of the normal adapter methods (for example\n    [SSE](http://dev.w3.org/html5/eventsource/) or [Web\n    Sockets](http://www.w3.org/TR/2009/WD-websockets-20091222/)).\n\n    [pushPayload](Store/methods/pushPayload?anchor=pushPayload) is a convenience wrapper for\n    `store#push` that will deserialize payloads if the\n    Serializer implements a `pushPayload` method.\n\n    Note: When creating a new record using any of the above methods\n    Ember Data will update `RecordArray`s such as those returned by\n    `store#peekAll()` or `store#findAll()`. This means any\n    data bindings or computed properties that depend on the RecordArray\n    will automatically be synced to include the new or updated record\n    values.\n\n    @class Store\n    @main @ember-data/store\n    @extends Ember.Service\n  */\n  class Store extends CoreStore {\n    constructor(...args) {\n      super(...args);\n      this._modelFactoryCache = Object.create(null);\n      this._relationshipsDefCache = Object.create(null);\n      this._attributesDefCache = Object.create(null);\n    }\n\n    instantiateRecord(identifier, createRecordArgs, recordDataFor, notificationManager) {\n      var modelName = identifier.type;\n\n      var internalModel = this._internalModelForResource(identifier);\n\n      var createOptions = {\n        store: this,\n        _internalModel: internalModel,\n        currentState: internalModel.currentState,\n        container: null\n      };\n      Ember.assign(createOptions, createRecordArgs); // ensure that `getOwner(this)` works inside a model instance\n\n      Ember.setOwner(createOptions, Ember.getOwner(this));\n      delete createOptions.container;\n\n      var record = this._modelFactoryFor(modelName).create(createOptions); //todo optimize\n\n\n      notificationManager.subscribe(identifier, (identifier, value) => notifyChanges(identifier, value, record, this));\n      return record;\n    }\n\n    teardownRecord(record) {\n      record.destroy();\n    }\n    /**\n    Returns the model class for the particular `modelName`.\n     The class of a model might be useful if you want to get a list of all the\n    relationship names of the model, see\n    [`relationshipNames`](/ember-data/release/classes/Model?anchor=relationshipNames)\n    for example.\n     @method modelFor\n    @param {String} modelName\n    @return {Model}\n      */\n\n\n    modelFor(modelName) {\n      {\n        assertDestroyedStoreOnly$1(this, 'modelFor');\n      }\n\n      ( !(Ember.isPresent(modelName)) && Ember.assert(`You need to pass a model name to the store's modelFor method`, Ember.isPresent(modelName)));\n      ( !(typeof modelName === 'string') && Ember.assert(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${modelName}`, typeof modelName === 'string'));\n\n      var maybeFactory = this._modelFactoryFor(modelName); // for factorFor factory/class split\n\n\n      var klass = maybeFactory && maybeFactory.class ? maybeFactory.class : maybeFactory;\n\n      if (!klass || !klass.isModel) {\n        {\n          throw new Ember.Error(`No model was found for '${modelName}' and no schema handles the type`);\n        }\n      } else {\n        return klass;\n      }\n    }\n\n    _modelFactoryFor(modelName) {\n      {\n        assertDestroyedStoreOnly$1(this, '_modelFactoryFor');\n      }\n\n      ( !(Ember.isPresent(modelName)) && Ember.assert(`You need to pass a model name to the store's _modelFactoryFor method`, Ember.isPresent(modelName)));\n      ( !(typeof modelName === 'string') && Ember.assert(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${modelName}`, typeof modelName === 'string'));\n      var normalizedModelName = normalizeModelName(modelName);\n      var factory = getModelFactory(this, this._modelFactoryCache, normalizedModelName);\n      return factory;\n    }\n    /*\n    Returns whether a ModelClass exists for a given modelName\n    This exists for legacy support for the RESTSerializer,\n    which due to how it must guess whether a key is a model\n    must query for whether a match exists.\n     We should investigate an RFC to make this public or removing\n    this requirement.\n     @private\n    */\n\n\n    _hasModelFor(modelName) {\n      {\n        assertDestroyingStore$1(this, '_hasModelFor');\n      }\n\n      ( !(Ember.isPresent(modelName)) && Ember.assert(`You need to pass a model name to the store's hasModelFor method`, Ember.isPresent(modelName)));\n      ( !(typeof modelName === 'string') && Ember.assert(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${modelName}`, typeof modelName === 'string'));\n\n      {\n        ( !(Ember.isPresent(modelName)) && Ember.assert(`You need to pass a model name to the store's hasModelFor method`, Ember.isPresent(modelName)));\n        ( !(typeof modelName === 'string') && Ember.assert(`Passing classes to store methods has been removed. Please pass a dasherized string instead of ${modelName}`, typeof modelName === 'string'));\n        var normalizedModelName = normalizeModelName(modelName);\n        var factory = getModelFactory(this, this._modelFactoryCache, normalizedModelName);\n        return factory !== null;\n      }\n    }\n\n    _relationshipMetaFor(modelName, id, key) {\n      {\n        var modelClass = this.modelFor(modelName);\n        var relationshipsByName = Ember.get(modelClass, 'relationshipsByName');\n        return relationshipsByName.get(key);\n      }\n    }\n\n    _attributesDefinitionFor(modelName, identifier) {\n      {\n        var attributes = this._attributesDefCache[modelName];\n\n        if (attributes === undefined) {\n          var modelClass = this.modelFor(modelName);\n          var attributeMap = Ember.get(modelClass, 'attributes');\n          attributes = Object.create(null);\n          attributeMap.forEach((meta, name) => attributes[name] = meta);\n          this._attributesDefCache[modelName] = attributes;\n        }\n\n        return attributes;\n      }\n    }\n\n    _relationshipsDefinitionFor(modelName, identifier) {\n      {\n        var relationships = this._relationshipsDefCache[modelName];\n\n        if (relationships === undefined) {\n          var modelClass = this.modelFor(modelName);\n          relationships = Ember.get(modelClass, 'relationshipsObject') || null;\n          this._relationshipsDefCache[modelName] = relationships;\n        }\n\n        return relationships;\n      }\n    }\n\n    getSchemaDefinitionService() {\n      {\n        throw 'schema service is only available when custom model class feature flag is on';\n      }\n    }\n\n  }\n\n  var assertDestroyingStore$1;\n  var assertDestroyedStoreOnly$1;\n\n  {\n    assertDestroyingStore$1 = function assertDestroyedStore(store, method) {\n      if (!store.shouldAssertMethodCallsOnDestroyedStore) {\n        ( !(!(store.isDestroying || store.isDestroyed)) && Ember.deprecate(`Attempted to call store.${method}(), but the store instance has already been destroyed.`, !(store.isDestroying || store.isDestroyed), {\n          id: 'ember-data:method-calls-on-destroyed-store',\n          until: '3.8'\n        }));\n      } else {\n        ( !(!(store.isDestroying || store.isDestroyed)) && Ember.assert(`Attempted to call store.${method}(), but the store instance has already been destroyed.`, !(store.isDestroying || store.isDestroyed)));\n      }\n    };\n\n    assertDestroyedStoreOnly$1 = function assertDestroyedStoreOnly(store, method) {\n      if (!store.shouldAssertMethodCallsOnDestroyedStore) {\n        ( !(!store.isDestroyed) && Ember.deprecate(`Attempted to call store.${method}(), but the store instance has already been destroyed.`, !store.isDestroyed, {\n          id: 'ember-data:method-calls-on-destroyed-store',\n          until: '3.8'\n        }));\n      } else {\n        ( !(!store.isDestroyed) && Ember.assert(`Attempted to call store.${method}(), but the store instance has already been destroyed.`, !store.isDestroyed));\n      }\n    };\n  }\n\n  /**\n    @module @ember-data/store\n  */\n  function typeForRelationshipMeta(meta) {\n    var modelName;\n    modelName = meta.type || meta.key;\n    modelName = normalizeModelName(modelName);\n\n    if (meta.kind === 'hasMany') {\n      modelName = emberInflector.singularize(modelName);\n    }\n\n    return modelName;\n  }\n\n  function shouldFindInverse(relationshipMeta) {\n    var options = relationshipMeta.options;\n    return !(options && options.inverse === null);\n  }\n\n  class RelationshipDefinition {\n    constructor(meta) {\n      this.meta = meta;\n      this[BRAND_SYMBOL] = void 0;\n      this._type = '';\n      this.__inverseKey = '';\n      this.__inverseIsAsync = true;\n      this.__hasCalculatedInverse = false;\n      this.parentModelName = void 0;\n      this.inverse = void 0;\n      this.inverseIsAsync = void 0;\n      this.parentModelName = meta.parentModelName;\n    }\n\n    get key() {\n      return this.meta.key;\n    }\n\n    get kind() {\n      return this.meta.kind;\n    }\n\n    get type() {\n      if (this._type) {\n        return this._type;\n      }\n\n      this._type = typeForRelationshipMeta(this.meta);\n      return this._type;\n    }\n\n    get options() {\n      return this.meta.options;\n    }\n\n    get name() {\n      return this.meta.name;\n    }\n\n    _inverseKey(store, modelClass) {\n      if (this.__hasCalculatedInverse === false) {\n        this._calculateInverse(store, modelClass);\n      }\n\n      return this.__inverseKey;\n    }\n\n    _inverseIsAsync(store, modelClass) {\n      if (this.__hasCalculatedInverse === false) {\n        this._calculateInverse(store, modelClass);\n      }\n\n      return this.__inverseIsAsync;\n    }\n\n    _calculateInverse(store, modelClass) {\n      this.__hasCalculatedInverse = true;\n      var inverseKey, inverseIsAsync;\n      var inverse = null;\n\n      if (shouldFindInverse(this.meta)) {\n        inverse = modelClass.inverseFor(this.key, store);\n      } else {\n        modelClass.typeForRelationship(this.key, store);\n      }\n\n      if (inverse) {\n        inverseKey = inverse.name;\n        inverseIsAsync = isInverseAsync(inverse);\n      } else {\n        inverseKey = null;\n        inverseIsAsync = false;\n      }\n\n      this.__inverseKey = inverseKey;\n      this.__inverseIsAsync = inverseIsAsync;\n    }\n\n  }\n\n  function isInverseAsync(meta) {\n    var inverseAsync = meta.options && meta.options.async;\n    return typeof inverseAsync === 'undefined' ? true : inverseAsync;\n  }\n\n  function relationshipFromMeta(meta) {\n    return new RelationshipDefinition(meta);\n  }\n\n  /**\n    @module @ember-data/store\n  */\n\n  var relationshipsDescriptor = Ember.computed(function () {\n    var map = new Map();\n    var relationshipsByName = Ember.get(this, 'relationshipsByName'); // Loop through each computed property on the class\n\n    relationshipsByName.forEach(desc => {\n      var {\n        type\n      } = desc;\n\n      if (!map.has(type)) {\n        map.set(type, []);\n      }\n\n      map.get(type).push(desc);\n    });\n    return map;\n  }).readOnly();\n  var relatedTypesDescriptor = Ember.computed(function () {\n    var parentModelName = this.modelName;\n    var types = Ember.A(); // Loop through each computed property on the class,\n    // and create an array of the unique types involved\n    // in relationships\n\n    this.eachComputedProperty((name, meta) => {\n      if (meta.isRelationship) {\n        meta.key = name;\n        var modelName = typeForRelationshipMeta(meta);\n        ( !(modelName) && Ember.assert(`You specified a hasMany (${meta.type}) on ${parentModelName} but ${meta.type} was not found.`, modelName));\n\n        if (!types.includes(modelName)) {\n          ( !(!!modelName) && Ember.assert(`Trying to sideload ${name} on ${this.toString()} but the type doesn't exist.`, !!modelName));\n          types.push(modelName);\n        }\n      }\n    });\n    return types;\n  }).readOnly();\n  var relationshipsObjectDescriptor = Ember.computed(function () {\n    var relationships = Object.create(null);\n    var modelName = this.modelName;\n    this.eachComputedProperty((name, meta) => {\n      if (meta.isRelationship) {\n        meta.key = name;\n        meta.name = name;\n        meta.parentModelName = modelName;\n        relationships[name] = relationshipFromMeta(meta);\n      }\n    });\n    return relationships;\n  });\n  var relationshipsByNameDescriptor = Ember.computed(function () {\n    var map = new Map();\n    var rels = Ember.get(this, 'relationshipsObject');\n    var relationships = Object.keys(rels);\n\n    for (var i = 0; i < relationships.length; i++) {\n      var key = relationships[i];\n      var value = rels[key];\n      map.set(value.key, value);\n    }\n\n    return map;\n  }).readOnly();\n\n  exports.AdapterPopulatedRecordArray = AdapterPopulatedRecordArray;\n  exports.DeprecatedEvented = DeprecatedEvented$1;\n  exports.InternalModel = InternalModel;\n  exports.ManyArray = ManyArray;\n  exports.PromiseArray = PromiseArray;\n  exports.PromiseManyArray = PromiseManyArray;\n  exports.PromiseObject = PromiseObject;\n  exports.RecordArray = RecordArray;\n  exports.RecordArrayManager = RecordArrayManager;\n  exports.RecordDataStoreWrapper = RecordDataStoreWrapper;\n  exports.RootState = RootState$1;\n  exports.Snapshot = Snapshot;\n  exports.SnapshotRecordArray = SnapshotRecordArray;\n  exports.Store = Store;\n  exports._bind = _bind;\n  exports._guard = _guard;\n  exports._objectIsAlive = _objectIsAlive;\n  exports.coerceId = coerceId;\n  exports.diffArray = diffArray;\n  exports.errorsArrayToHash = errorsArrayToHash;\n  exports.errorsHashToArray = errorsHashToArray;\n  exports.guardDestroyedStore = guardDestroyedStore;\n  exports.identifierCacheFor = identifierCacheFor;\n  exports.normalizeModelName = normalizeModelName;\n  exports.recordDataFor = recordDataFor;\n  exports.recordIdentifierFor = recordIdentifierFor;\n  exports.relatedTypesDescriptor = relatedTypesDescriptor;\n  exports.relationshipsByNameDescriptor = relationshipsByNameDescriptor;\n  exports.relationshipsDescriptor = relationshipsDescriptor;\n  exports.relationshipsObjectDescriptor = relationshipsObjectDescriptor;\n  exports.setIdentifierForgetMethod = setIdentifierForgetMethod;\n  exports.setIdentifierGenerationMethod = setIdentifierGenerationMethod;\n  exports.setIdentifierResetMethod = setIdentifierResetMethod;\n  exports.setIdentifierUpdateMethod = setIdentifierUpdateMethod;\n  exports.upgradeForInternal = upgradeForInternal;\n\n  Object.defineProperty(exports, '__esModule', { value: true });\n\n});\n","define(\"@ember-data/store/index\", [\"exports\", \"@ember-data/store/-private\"], function (_exports, _private) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"default\", {\n    enumerable: true,\n    get: function () {\n      return _private.Store;\n    }\n  });\n  Object.defineProperty(_exports, \"normalizeModelName\", {\n    enumerable: true,\n    get: function () {\n      return _private.normalizeModelName;\n    }\n  });\n  Object.defineProperty(_exports, \"setIdentifierGenerationMethod\", {\n    enumerable: true,\n    get: function () {\n      return _private.setIdentifierGenerationMethod;\n    }\n  });\n  Object.defineProperty(_exports, \"setIdentifierUpdateMethod\", {\n    enumerable: true,\n    get: function () {\n      return _private.setIdentifierUpdateMethod;\n    }\n  });\n  Object.defineProperty(_exports, \"setIdentifierForgetMethod\", {\n    enumerable: true,\n    get: function () {\n      return _private.setIdentifierForgetMethod;\n    }\n  });\n  Object.defineProperty(_exports, \"setIdentifierResetMethod\", {\n    enumerable: true,\n    get: function () {\n      return _private.setIdentifierResetMethod;\n    }\n  });\n  Object.defineProperty(_exports, \"recordIdentifierFor\", {\n    enumerable: true,\n    get: function () {\n      return _private.recordIdentifierFor;\n    }\n  });\n});","define(\"@ember-decorators/utils/-private/class-field-descriptor\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.isFieldDescriptor = isFieldDescriptor;\n  _exports.isDescriptor = isDescriptor;\n\n  function isClassDescriptor(possibleDesc) {\n    let [target] = possibleDesc;\n    return possibleDesc.length === 1 && typeof target === 'function' && 'prototype' in target && !target.__isComputedDecorator;\n  }\n\n  function isFieldDescriptor(possibleDesc) {\n    let [target, key, desc] = possibleDesc;\n    return possibleDesc.length === 3 && typeof target === 'object' && target !== null && typeof key === 'string' && (typeof desc === 'object' && desc !== null && 'enumerable' in desc && 'configurable' in desc || desc === undefined) // TS compatibility\n    ;\n  }\n\n  function isDescriptor(possibleDesc) {\n    return isFieldDescriptor(possibleDesc) || isClassDescriptor(possibleDesc);\n  }\n});","define(\"@ember-decorators/utils/collapse-proto\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = collapseProto;\n\n  function collapseProto(target) {\n    // We must collapse the superclass prototype to make sure that the `actions`\n    // object will exist. Since collapsing doesn't generally happen until a class is\n    // instantiated, we have to do it manually.\n    if (typeof target.constructor.proto === 'function') {\n      target.constructor.proto();\n    }\n  }\n});","define(\"@ember-decorators/utils/decorator\", [\"exports\", \"@ember-decorators/utils/-private/class-field-descriptor\"], function (_exports, _classFieldDescriptor) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.decoratorWithParams = decoratorWithParams;\n  _exports.decoratorWithRequiredParams = decoratorWithRequiredParams;\n\n  /**\n   * A macro that takes a decorator function and allows it to optionally\n   * receive parameters\n   *\n   * ```js\n   * let foo = decoratorWithParams((target, desc, key, params) => {\n   *   console.log(params);\n   * });\n   *\n   * class {\n   *   @foo bar; // undefined\n   *   @foo('bar') baz; // ['bar']\n   * }\n   * ```\n   *\n   * @param {Function} fn - decorator function\n   */\n  function decoratorWithParams(fn) {\n    return function (...params) {\n      // determine if user called as @computed('blah', 'blah') or @computed\n      if ((0, _classFieldDescriptor.isDescriptor)(params)) {\n        return fn(...params);\n      } else {\n        return (...desc) => fn(...desc, params);\n      }\n    };\n  }\n  /**\n   * A macro that takes a decorator function and requires it to receive\n   * parameters:\n   *\n   * ```js\n   * let foo = decoratorWithRequiredParams((target, desc, key, params) => {\n   *   console.log(params);\n   * });\n   *\n   * class {\n   *   @foo('bar') baz; // ['bar']\n   *   @foo bar; // Error\n   * }\n   * ```\n   *\n   * @param {Function} fn - decorator function\n   */\n\n\n  function decoratorWithRequiredParams(fn, name) {\n    return function (...params) {\n      (true && !(!(0, _classFieldDescriptor.isDescriptor)(params) && params.length > 0) && Ember.assert(`The @${name || fn.name} decorator requires parameters`, !(0, _classFieldDescriptor.isDescriptor)(params) && params.length > 0));\n      return (...desc) => fn(...desc, params);\n    };\n  }\n});","define(\"@ember-intl/decorators/index\", [\"exports\", \"@ember-intl/decorators/t\", \"@ember-intl/decorators/intl\"], function (_exports, _t, _intl) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"t\", {\n    enumerable: true,\n    get: function () {\n      return _t.default;\n    }\n  });\n  Object.defineProperty(_exports, \"raw\", {\n    enumerable: true,\n    get: function () {\n      return _t.raw;\n    }\n  });\n  Object.defineProperty(_exports, \"intl\", {\n    enumerable: true,\n    get: function () {\n      return _intl.default;\n    }\n  });\n});","define(\"@ember-intl/decorators/intl\", [\"exports\", \"@ember-decorators/utils/decorator\", \"ember-intl\"], function (_exports, _decorator, _emberIntl) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /* eslint-disable no-param-reassign, prefer-destructuring */\n  var _default = (0, _decorator.decoratorWithParams)(function intl(target, key, desc, dependentKeys = []) {\n    const value = desc.value;\n    const initializer = desc.initializer;\n    delete desc.value;\n    delete desc.initializer;\n    const cp = (0, _emberIntl.intl)(...dependentKeys, function (intl, // eslint-disable-line no-shadow\n    propertyKey) {\n      const fn = value || initializer.call(this);\n      (true && !(typeof fn === 'function') && Ember.assert(`@intl: You need to decorate a function, but you decorated '${fn}'.`, typeof fn === 'function'));\n      return fn.call(this, intl, propertyKey);\n    }); // @ts-ignore\n\n    return cp(target, key, desc);\n  });\n\n  _exports.default = _default;\n});","define(\"@ember-intl/decorators/t\", [\"exports\", \"ember-intl\"], function (_exports, _emberIntl) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"raw\", {\n    enumerable: true,\n    get: function () {\n      return _emberIntl.raw;\n    }\n  });\n  _exports.default = void 0;\n  var _default = _emberIntl.t;\n  _exports.default = _default;\n});","define('@ember/ordered-set/index', ['exports'], function (exports) {\n  'use strict';\n\n  Object.defineProperty(exports, \"__esModule\", {\n    value: true\n  });\n\n\n  const NEEDS_CUSTOM_ORDERED_SET = true;\n\n  let OrderedSet;\n\n  if (NEEDS_CUSTOM_ORDERED_SET) {\n    /**\n    @class OrderedSet\n    @constructor\n    */\n    OrderedSet = class OrderedSet {\n      constructor() {\n        this.clear();\n      }\n\n      /**\n      @method create\n      @static\n      @return {OrderedSet}\n      */\n      static create() {\n        let Constructor = this;\n        return new Constructor();\n      }\n\n      /**\n      @method clear\n      */\n      clear() {\n        this.presenceSet = Object.create(null);\n        this.list = [];\n        this.size = 0;\n      }\n\n      /**\n      @method add\n      @param {*} obj\n      @param {string} [_guid] (for internal use)\n      @return {OrderedSet}\n      */\n      add(obj, _guid) {\n        let guid = _guid || Ember.guidFor(obj);\n        let presenceSet = this.presenceSet;\n        let list = this.list;\n\n        if (presenceSet[guid] !== true) {\n          presenceSet[guid] = true;\n          this.size = list.push(obj);\n        }\n\n        return this;\n      }\n\n      /**\n      @method delete\n      @param {*} obj\n      @param {string} [_guid] (for internal use)\n      @return {Boolean}\n      */\n      delete(obj, _guid) {\n        let guid = _guid || Ember.guidFor(obj);\n        let presenceSet = this.presenceSet;\n        let list = this.list;\n\n        if (presenceSet[guid] === true) {\n          delete presenceSet[guid];\n          let index = list.indexOf(obj);\n          if (index > -1) {\n            list.splice(index, 1);\n          }\n          this.size = list.length;\n          return true;\n        } else {\n          return false;\n        }\n      }\n\n      /**\n      @method isEmpty\n      @return {Boolean}\n      */\n      isEmpty() {\n        return this.size === 0;\n      }\n\n      /**\n      @method has\n      @param {*} obj\n      @return {Boolean}\n      */\n      has(obj) {\n        if (this.size === 0) {\n          return false;\n        }\n\n        let guid = Ember.guidFor(obj);\n        let presenceSet = this.presenceSet;\n\n        return presenceSet[guid] === true;\n      }\n\n      /**\n      @method forEach\n      @param {Function} fn\n      @param self\n      */\n      forEach(fn /*, ...thisArg*/) {\n        (true && !(typeof fn === 'function') && Ember.assert(`${Object.prototype.toString.call(fn)} is not a function`, typeof fn === 'function'));\n\n\n        if (this.size === 0) {\n          return;\n        }\n\n        let list = this.list;\n\n        if (arguments.length === 2) {\n          for (let i = 0; i < list.length; i++) {\n            fn.call(arguments[1], list[i]);\n          }\n        } else {\n          for (let i = 0; i < list.length; i++) {\n            fn(list[i]);\n          }\n        }\n      }\n\n      /**\n      @method toArray\n      @return {Array}\n      */\n      toArray() {\n        return this.list.slice();\n      }\n\n      /**\n      @method copy\n      @return {OrderedSet}\n      */\n      copy() {\n        let Constructor = this.constructor;\n        let set = new Constructor();\n\n        set.presenceSet = Object.create(null);\n\n        for (let prop in this.presenceSet) {\n          // hasOwnPropery is not needed because obj is Object.create(null);\n          set.presenceSet[prop] = this.presenceSet[prop];\n        }\n\n        set.list = this.toArray();\n        set.size = this.size;\n\n        return set;\n      }\n    };\n  } else {\n    OrderedSet = Ember.__OrderedSet__ || Ember.OrderedSet;\n  }\n\n  exports.default = OrderedSet;\n});","define(\"@glimmer/component/-private/base-component-manager\", [\"exports\", \"@glimmer/component/-private/component\"], function (_exports, _component) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = BaseComponentManager;\n\n  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n  /**\n   * This factory function returns a component manager class with common behavior\n   * that can be extend to add Glimmer.js- or Ember.js-specific functionality. As\n   * these environments converge, the need for two component manager\n   * implementations (and thus this factory) should go away.\n   */\n  function BaseComponentManager(setOwner, getOwner, capabilities) {\n    var _temp;\n\n    return _temp = class {\n      static create(attrs) {\n        let owner = getOwner(attrs);\n        return new this(owner);\n      }\n\n      constructor(owner) {\n        _defineProperty(this, \"capabilities\", capabilities);\n\n        setOwner(this, owner);\n      }\n\n      createComponent(ComponentClass, args) {\n        if (true\n        /* DEBUG */\n        ) {\n          _component.ARGS_SET.set(args.named, true);\n        }\n\n        return new ComponentClass(getOwner(this), args.named);\n      }\n\n      getContext(component) {\n        return component;\n      }\n\n    }, _temp;\n  }\n});","define(\"@glimmer/component/-private/component\", [\"exports\", \"@glimmer/component/-private/owner\"], function (_exports, _owner) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.setDestroying = setDestroying;\n  _exports.setDestroyed = setDestroyed;\n  _exports.default = _exports.ARGS_SET = void 0;\n\n  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n  const DESTROYING = new WeakMap();\n  const DESTROYED = new WeakMap();\n\n  function setDestroying(component) {\n    DESTROYING.set(component, true);\n  }\n\n  function setDestroyed(component) {\n    DESTROYED.set(component, true);\n  }\n\n  let ARGS_SET;\n  _exports.ARGS_SET = ARGS_SET;\n\n  if (true\n  /* DEBUG */\n  ) {\n    _exports.ARGS_SET = ARGS_SET = new WeakMap();\n  }\n  /**\n   * The `Component` class defines an encapsulated UI element that is rendered to\n   * the DOM. A component is made up of a template and, optionally, this component\n   * object.\n   *\n   * ## Defining a Component\n   *\n   * To define a component, subclass `Component` and add your own properties,\n   * methods and lifecycle hooks:\n   *\n   * ```ts\n   * import Component from '@glimmer/component';\n   *\n   * export default class extends Component {\n   * }\n   * ```\n   *\n   * ## Lifecycle Hooks\n   *\n   * Lifecycle hooks allow you to respond to changes to a component, such as when\n   * it gets created, rendered, updated or destroyed. To add a lifecycle hook to a\n   * component, implement the hook as a method on your component subclass.\n   *\n   * For example, to be notified when Glimmer has rendered your component so you\n   * can attach a legacy jQuery plugin, implement the `didInsertElement()` method:\n   *\n   * ```ts\n   * import Component from '@glimmer/component';\n   *\n   * export default class extends Component {\n   *   didInsertElement() {\n   *     $(this.element).pickadate();\n   *   }\n   * }\n   * ```\n   *\n   * ## Data for Templates\n   *\n   * `Component`s have two different kinds of data, or state, that can be\n   * displayed in templates:\n   *\n   * 1. Arguments\n   * 2. Properties\n   *\n   * Arguments are data that is passed in to a component from its parent\n   * component. For example, if I have a `UserGreeting` component, I can pass it\n   * a name and greeting to use:\n   *\n   * ```hbs\n   * <UserGreeting @name=\"Ricardo\" @greeting=\"Olá\" />\n   * ```\n   *\n   * Inside my `UserGreeting` template, I can access the `@name` and `@greeting`\n   * arguments that I've been given:\n   *\n   * ```hbs\n   * {{@greeting}}, {{@name}}!\n   * ```\n   *\n   * Arguments are also available inside my component:\n   *\n   * ```ts\n   * console.log(this.args.greeting); // prints \"Olá\"\n   * ```\n   *\n   * Properties, on the other hand, are internal to the component and declared in\n   * the class. You can use properties to store data that you want to show in the\n   * template, or pass to another component as an argument.\n   *\n   * ```ts\n   * import Component from '@glimmer/component';\n   *\n   * export default class extends Component {\n   *   user = {\n   *     name: 'Robbie'\n   *   }\n   * }\n   * ```\n   *\n   * In the above example, we've defined a component with a `user` property that\n   * contains an object with its own `name` property.\n   *\n   * We can render that property in our template:\n   *\n   * ```hbs\n   * Hello, {{user.name}}!\n   * ```\n   *\n   * We can also take that property and pass it as an argument to the\n   * `UserGreeting` component we defined above:\n   *\n   * ```hbs\n   * <UserGreeting @greeting=\"Hello\" @name={{user.name}} />\n   * ```\n   *\n   * ## Arguments vs. Properties\n   *\n   * Remember, arguments are data that was given to your component by its parent\n   * component, and properties are data your component has defined for itself.\n   *\n   * You can tell the difference between arguments and properties in templates\n   * because arguments always start with an `@` sign (think \"A is for arguments\"):\n   *\n   * ```hbs\n   * {{@firstName}}\n   * ```\n   *\n   * We know that `@firstName` came from the parent component, not the current\n   * component, because it starts with `@` and is therefore an argument.\n   *\n   * On the other hand, if we see:\n   *\n   * ```hbs\n   * {{name}}\n   * ```\n   *\n   * We know that `name` is a property on the component. If we want to know where\n   * the data is coming from, we can go look at our component class to find out.\n   *\n   * Inside the component itself, arguments always show up inside the component's\n   * `args` property. For example, if `{{@firstName}}` is `Tom` in the template,\n   * inside the component `this.args.firstName` would also be `Tom`.\n   */\n\n\n  class BaseComponent {\n    /**\n     * Constructs a new component and assigns itself the passed properties. You\n     * should not construct new components yourself. Instead, Glimmer will\n     * instantiate new components automatically as it renders.\n     *\n     * @param owner\n     * @param args\n     */\n    constructor(owner, args) {\n      _defineProperty(this, \"args\", void 0);\n\n      if (true\n      /* DEBUG */\n      && !(owner !== null && typeof owner === 'object' && ARGS_SET.has(args))) {\n        throw new Error(`You must pass both the owner and args to super() in your component: ${this.constructor.name}. You can pass them directly, or use ...arguments to pass all arguments through.`);\n      }\n\n      this.args = args;\n      (0, _owner.setOwner)(this, owner);\n      DESTROYING.set(this, false);\n      DESTROYED.set(this, false);\n    }\n    /**\n     * Named arguments passed to the component from its parent component.\n     * They can be accessed in JavaScript via `this.args.argumentName` and in the template via `@argumentName`.\n     *\n     * Say you have the following component, which will have two `args`, `firstName` and `lastName`:\n     *\n     * ```hbs\n     * <my-component @firstName=\"Arthur\" @lastName=\"Dent\" />\n     * ```\n     *\n     * If you needed to calculate `fullName` by combining both of them, you would do:\n     *\n     * ```ts\n     * didInsertElement() {\n     *   console.log(`Hi, my full name is ${this.args.firstName} ${this.args.lastName}`);\n     * }\n     * ```\n     *\n     * While in the template you could do:\n     *\n     * ```hbs\n     * <p>Welcome, {{@firstName}} {{@lastName}}!</p>\n     * ```\n     */\n\n\n    get isDestroying() {\n      return DESTROYING.get(this);\n    }\n\n    get isDestroyed() {\n      return DESTROYED.get(this);\n    }\n    /**\n     * Called before the component has been removed from the DOM.\n     */\n\n\n    willDestroy() {}\n\n  }\n\n  _exports.default = BaseComponent;\n});","define(\"@glimmer/component/-private/ember-component-manager\", [\"exports\", \"@glimmer/component/-private/base-component-manager\", \"@glimmer/component/-private/component\"], function (_exports, _baseComponentManager, _component) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  const CAPABILITIES = true ? Ember._componentManagerCapabilities('3.13', {\n    destructor: true,\n    asyncLifecycleCallbacks: false,\n    updateHook: false\n  }) : Ember._componentManagerCapabilities('3.4', {\n    destructor: true,\n    asyncLifecycleCallbacks: false\n  });\n  /**\n   * This component manager runs in Ember.js environments and extends the base component manager to:\n   *\n   * 1. Properly destroy the component's associated `meta` data structure\n   * 2. Schedule destruction using Ember's runloop\n   */\n\n  class EmberGlimmerComponentManager extends (0, _baseComponentManager.default)(Ember.setOwner, Ember.getOwner, CAPABILITIES) {\n    destroyComponent(component) {\n      if (component.isDestroying) {\n        return;\n      }\n\n      let meta = Ember.meta(component);\n      meta.setSourceDestroying();\n      (0, _component.setDestroying)(component);\n      Ember.run.schedule('actions', component, component.willDestroy);\n      Ember.run.schedule('destroy', this, scheduledDestroyComponent, component, meta);\n    }\n\n  }\n\n  function scheduledDestroyComponent(component, meta) {\n    if (component.isDestroyed) {\n      return;\n    }\n\n    Ember.destroy(component);\n    meta.setSourceDestroyed();\n    (0, _component.setDestroyed)(component);\n  }\n\n  // In Ember 3.12 and earlier, the updateComponent hook was mandatory.\n  // As of Ember 3.13, the `args` object is stable and each property of the\n  // object participates in the autotrack stack on its own. This means we do not\n  // need to set the `args` property on the component instance to invalidate\n  // tracked getters that rely on `args`, and therefore don't require the `updateComponent`\n  // hook at all.\n  if (!true) {\n    EmberGlimmerComponentManager.prototype.updateComponent = function updateComponent(component, args) {\n      let argSnapshot = args.named;\n\n      if (true\n      /* DEBUG */\n      ) {\n        argSnapshot = Object.freeze(argSnapshot);\n      }\n\n      Ember.set(component, 'args', argSnapshot);\n    };\n  }\n\n  var _default = EmberGlimmerComponentManager;\n  _exports.default = _default;\n});","define(\"@glimmer/component/-private/owner\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.setOwner = void 0;\n  var setOwner = Ember.setOwner;\n  _exports.setOwner = setOwner;\n});","define(\"@glimmer/component/index\", [\"exports\", \"@glimmer/component/-private/ember-component-manager\", \"@glimmer/component/-private/component\"], function (_exports, _emberComponentManager, _component) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  let GlimmerComponent = _component.default;\n\n  if (true\n  /* DEBUG */\n  ) {\n    // Add assertions against using Glimmer.js only APIs\n    // TODO: Add GlimmerComponent API docs link to these messages once API docs are live\n    function throwMethodUseError(methodName) {\n      throw new Error(`You attempted to define the '${methodName}' method on a Glimmer Component, but that lifecycle hook does not exist in Ember.js applications, it only exists in Glimmer.js apps. You can rename this method, and you can trigger it using a modifier such as {{did-insert}} from '@ember/render-modifiers': https://github.com/emberjs/ember-render-modifiers.`);\n    }\n\n    function throwPropertyUseError(propertyName) {\n      throw new Error(`You attempted to access the '${propertyName}' property on a Glimmer Component, but that property does not exist in Ember.js applications, it only exists in Glimmer.js apps. You define a class field with the same name on your component class and it will overwrite this error message, but it will not be used by the framework.`);\n    }\n\n    GlimmerComponent = class GlimmerDebugComponent extends GlimmerComponent {\n      constructor(owner, args) {\n        super(owner, args);\n\n        if (typeof this['didInsertElement'] === 'function') {\n          throwMethodUseError('didInsertElement');\n        }\n\n        if (typeof this['didUpdate'] === 'function') {\n          throwMethodUseError('didUpdate');\n        }\n      }\n\n    };\n    let proto = GlimmerComponent.prototype;\n\n    function defineErrorProp(proto, key, getterMethod) {\n      Object.defineProperty(proto, key, {\n        get: () => getterMethod(key),\n\n        set(value) {\n          Object.defineProperty(this, key, {\n            value\n          });\n        }\n\n      });\n    } // Methods should still throw whenever they are accessed\n\n\n    defineErrorProp(proto, 'bounds', throwPropertyUseError);\n    defineErrorProp(proto, 'element', throwPropertyUseError);\n    defineErrorProp(proto, 'debugName', throwPropertyUseError);\n  }\n\n  if (true) {\n    Ember._setComponentManager(owner => {\n      return new _emberComponentManager.default(owner);\n    }, GlimmerComponent);\n  } else {\n    Ember._setComponentManager('glimmer', GlimmerComponent);\n  }\n\n  var _default = GlimmerComponent;\n  _exports.default = _default;\n});","define('ember-cli-app-version/initializer-factory', ['exports'], function (exports) {\n  'use strict';\n\n  Object.defineProperty(exports, \"__esModule\", {\n    value: true\n  });\n  exports.default = initializerFactory;\n\n\n  const {\n    libraries\n  } = Ember;\n\n  function initializerFactory(name, version) {\n    let registered = false;\n\n    return function () {\n      if (!registered && name && version) {\n        let appName = Ember.String.classify(name);\n        libraries.register(appName, version);\n        registered = true;\n      }\n    };\n  }\n});","define(\"ember-cli-app-version/utils/regexp\", [\"exports\"], function (exports) {\n  \"use strict\";\n\n  Object.defineProperty(exports, \"__esModule\", {\n    value: true\n  });\n  const versionRegExp = exports.versionRegExp = /\\d+[.]\\d+[.]\\d+/; // Match any number of 3 sections of digits separated by .\n  const versionExtendedRegExp = exports.versionExtendedRegExp = /\\d+[.]\\d+[.]\\d+-[a-z]*([.]\\d+)?/; // Match the above but also hyphen followed by any number of lowercase letters, then optionally period and digits\n  const shaRegExp = exports.shaRegExp = /[a-z\\d]{8}$/; // Match 8 lowercase letters and digits, at the end of the string only (to avoid matching with version extended part)\n});","define('ember-cli-file-picker/components/file-picker', ['exports', 'ember-cli-file-picker/lib/helpers'], function (exports, _helpers) {\n  'use strict';\n\n  Object.defineProperty(exports, \"__esModule\", {\n    value: true\n  });\n\n\n  const {\n    Component,\n    computed,\n    observer,\n    run: {\n      bind\n    },\n    String: {\n      htmlSafe\n    },\n    isEmpty,\n    $\n  } = Ember;\n\n  exports.default = Component.extend({\n    classNames: ['file-picker'],\n    classNameBindings: ['multiple:multiple:single'],\n    accept: '*',\n    multiple: false,\n    preview: true,\n    dropzone: true,\n    progress: true,\n    showProgress: false,\n    hideFileInput: true,\n    readAs: 'readAsFile',\n    selectOnClick: true,\n    count: 0,\n    errors: [],\n    progressValue: null,\n\n    progressStyle: computed('progressValue', function () {\n      var width = this.get('progressValue') || 0;\n\n      return htmlSafe('width: ' + width + '%;');\n    }),\n\n    /**\n     * When the component got inserted\n     */\n    didInsertElement: function () {\n      if (this.get('hideFileInput')) {\n        this.hideInput();\n      }\n      this.hidePreview();\n      this.hideProgress();\n\n      this.$('.file-picker__input').on('change', bind(this, 'filesSelected'));\n    },\n\n    willDestroyElement: function () {\n      this.$('.file-picker__input').off('change', bind(this, 'filesSelected'));\n    },\n\n    /**\n     * When the file input changed (a file got selected)\n     * @param  {Event} event The file change event\n     */\n    filesSelected: function (event) {\n      var files = event.target.files;\n      if (files.length) {\n        this.handleFiles(files);\n      } else {\n        this.clearPreview();\n        this.set('progressValue', 0);\n      }\n    },\n\n    handleFiles: function (files) {\n      if (typeof this.filesAreValid === 'function') {\n        if (!this.filesAreValid(files)) {\n          return;\n        }\n      }\n\n      if (this.get('preview')) {\n        this.updatePreview(files);\n      }\n\n      if (this.get('multiple')) {\n        this.sendAction('filesLoaded', files);\n      } else {\n        if (this.get('readAs') === 'readAsFile') {\n          this.sendAction('fileLoaded', files[0]);\n        } else {\n          (0, _helpers.readFile)(files[0], this.get('readAs'), bind(this, 'updateProgress')).then(file => {\n            this.sendAction('fileLoaded', file);\n          });\n        }\n      }\n\n      if (!this.get('hideFileInput')) {\n        this.$('.file-picker__input').val(null);\n      }\n    },\n\n    /**\n     * Update preview\n     * @param  {Array} files The selected files\n     */\n    updatePreview: function (files) {\n      if (this.get('multiple')) {\n        // TODO\n      } else {\n        this.clearPreview();\n        this.set('showProgress', true);\n\n        (0, _helpers.readFile)(files[0], 'readAsDataURL', bind(this, 'updateProgress')).then(bind(this, 'addPreviewImage'));\n\n        this.$('.file-picker__dropzone').hide();\n      }\n\n      this.$('.file-picker__preview').show();\n    },\n\n    addPreviewImage: function (file) {\n      var image = this.$('<img src=\"' + file.data + '\" class=\"file-picker__preview__image ' + (this.get('multiple') ? 'multiple' : 'single') + '\">');\n\n      this.hideProgress();\n      this.$('.file-picker__preview').append(image);\n    },\n\n    updateProgress: function (event) {\n      const {\n        loaded,\n        total\n      } = event;\n\n      let value = null;\n\n      if (!isEmpty(loaded) && !isEmpty(total) && parseFloat(total) !== 0) {\n        value = loaded / total * 100;\n      }\n\n      this.set('progressValue', value);\n    },\n\n    hideInput: function () {\n      this.$('.file-picker__input').hide();\n    },\n\n    hidePreview: function () {\n      this.$('.file-picker__preview').hide();\n    },\n\n    hideProgress: function () {\n      this.set('showProgress', false);\n    },\n\n    clearPreview: function () {\n      this.$('.file-picker__preview').html('');\n      this.hidePreview();\n      this.$('.file-picker__dropzone').show();\n\n      // reset\n      this.set('removePreview', false);\n    },\n\n    removePreviewDidChange: observer('removePreview', function () {\n      if (this.get('removePreview')) {\n        this.clearPreview();\n      }\n    }),\n\n    // handles DOM events\n    // Trigger a input click to open file dialog\n    click: function (event) {\n      if (this.get('selectOnClick') === true) {\n        if (!$(event.target).hasClass('file-picker__input')) {\n          this.$('.file-picker__input').trigger('click');\n        }\n      }\n    },\n    /* Drag'n'Drop events */\n    dragOver: function (event) {\n      if (event.preventDefault) {\n        event.preventDefault();\n      }\n      if (!this.get('dropzone')) {\n        return;\n      }\n\n      event.dataTransfer.dropEffect = 'copy';\n    },\n    drop: function (event) {\n      if (event.preventDefault) {\n        event.preventDefault();\n      }\n      if (!this.get('dropzone')) {\n        return;\n      }\n\n      this.handleFiles(event.dataTransfer.files);\n      this.set('count', 0);\n      this.$().removeClass('over');\n    },\n    dragEnter: function (event) {\n      if (event.preventDefault) {\n        event.preventDefault();\n      }\n      if (!this.get('dropzone')) {\n        return;\n      }\n\n      if (!this.get('multiple')) {\n        this.clearPreview();\n      }\n      var count = this.incrementProperty('count');\n      if (count === 1) {\n        this.$().addClass('over');\n      }\n    },\n    dragLeave: function (event) {\n      if (event.preventDefault) {\n        event.preventDefault();\n      }\n      if (!this.get('dropzone')) {\n        return;\n      }\n\n      var count = this.decrementProperty('count');\n      if (count === 0) {\n        this.$().removeClass('over');\n      }\n    },\n\n    /*\n     * returns true if browser supportes progress element\n     *\n     * browser support overview:\n     * http://caniuse.com/#feat=progress\n     *\n     * uses test from Modernizr\n     * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/elem/progress-meter.js\n     */\n    isProgressSupported: Ember.computed(function () {\n      return document.createElement('progress').max !== undefined;\n    })\n  });\n});","define('ember-cli-file-picker/lib/helpers', ['exports'], function (exports) {\n  'use strict';\n\n  Object.defineProperty(exports, \"__esModule\", {\n    value: true\n  });\n\n\n  const {\n    assert\n  } = Ember;\n\n  /**\n   * Reads a file\n   * @param {File} file A file\n   * @param {String} readAs One of\n   *  - readAsArrayBuffer\n   *  - readAsBinaryString\n   *  - readAsDataURL\n   *  - readAsText\n   * @param {Function} progressCallback\n   * @return {Promise}\n   */\n  function readFile(file, readAs, progressCallback = null) {\n    const reader = new FileReader();\n\n    assert('readAs method \"' + readAs + '\" not implemented', reader[readAs] && readAs !== 'abort');\n\n    return new Ember.RSVP.Promise((resolve, reject) => {\n      reader.onload = function (event) {\n        resolve({\n          // TODO deprecate filename\n          filename: file.name,\n          name: file.name,\n          type: file.type,\n          data: event.target.result,\n          size: file.size\n        });\n      };\n\n      reader.onabort = function () {\n        reject({\n          event: 'onabort'\n        });\n      };\n\n      reader.onerror = function (error) {\n        reject({\n          event: 'onerror',\n          error: error\n        });\n      };\n\n      if (typeof progressCallback === 'function') {\n        reader.onprogress = progressCallback;\n      }\n\n      reader[readAs](file);\n    });\n  }\n\n  exports.readFile = readFile;\n});","define(\"ember-cli-jstree/components/ember-jstree\", [\"exports\", \"ember-component-inbound-actions/inbound-actions\", \"ember-cli-jstree/mixins/ember-jstree-actions\"], function (exports, _inboundActions, _emberJstreeActions) {\n  \"use strict\";\n\n  Object.defineProperty(exports, \"__esModule\", {\n    value: true\n  });\n\n\n  const { testing } = Ember;\n\n  exports.default = Ember.Component.extend(_inboundActions.default, _emberJstreeActions.default, {\n    // Properties for Ember communication\n    actionReceiver: null,\n    currentNode: null,\n    selectedNodes: null,\n\n    // Basic configuration objects\n    data: Ember.A(),\n    plugins: Ember.A(),\n    themes: Ember.A(),\n    checkCallback: true,\n    multiple: true,\n    worker: true,\n\n    // Refresh configuration variables\n    skipLoading: false,\n    forgetState: false,\n\n    // Plugin option objects\n    checkboxOptions: null,\n    contextmenuOptions: null,\n    typesOptions: null,\n    searchOptions: null,\n    dndOptions: null,\n\n    selectionDidChange: null,\n    treeObject: null,\n\n    // Internals\n    _isDestroying: false,\n\n    isReady: false,\n    _searchTerm: null,\n\n    _isReadyTestWaiter() {\n      return this.get(\"isReady\") === true;\n    },\n\n    didInsertElement() {\n      Ember.run.schedule(\"afterRender\", this, this.createTree);\n    },\n\n    createTree() {\n      if (testing) {\n        // Add test waiter.\n        Ember.Test.registerWaiter(this, this._isReadyTestWaiter);\n      }\n\n      let treeObject = this._setupJsTree();\n\n      console.log(\"treeObject\");\n      console.log(treeObject);\n\n      this._setupEventHandlers(treeObject);\n\n      console.log(treeObject);\n\n      this.set(\"treeObject\", treeObject);\n    },\n\n    willDestroyElement() {\n      if (testing) {\n        Ember.Test.unregisterWaiter(this, this._isReadyTestWaiter);\n      }\n\n      this.set(\"isReady\", false);\n      this.set(\"_isDestroying\", true);\n      this.send(\"destroy\");\n    },\n\n    didUpdateAttrs() {\n      this._super(...arguments);\n\n      let pluginsArray = this.get(\"plugins\");\n      if (Ember.isPresent(pluginsArray)) {\n        let searchOptions = this.get(\"searchOptions\");\n        if (Ember.isPresent(searchOptions) && pluginsArray.indexOf(\"search\") >= 0) {\n          let searchTerm = this.get(\"searchTerm\");\n          if (this.get(\"_searchTerm\") !== searchTerm) {\n            Ember.run.next(\"afterRender\", () => {\n              this.set(\"_searchTerm\", searchTerm);\n              this.getTree().search(searchTerm);\n            });\n          }\n        }\n      }\n    },\n\n    /**\n     * Main setup function that registers all the plugins and sets up the core\n     * configuration object for jsTree\n     *\n     * @method _setupJsTree\n     */\n    _setupJsTree() {\n      return Ember.$().jstree(this._buildConfig());\n    },\n\n    /**\n     * Builds config object for jsTree. Could be used to override config in descendant classes.\n     *\n     * @method _buildConfig\n     */\n    _buildConfig() {\n      let configObject = {};\n\n      configObject[\"core\"] = {\n        data: this.get(\"data\"),\n        check_callback: this.get(\"checkCallback\"),\n        multiple: this.get(\"multiple\"),\n        worker: this.get(\"worker\")\n      };\n\n      let themes = this.get(\"themes\");\n      if (Ember.isPresent(themes) && Ember.typeOf(themes) === \"object\") {\n        configObject[\"core\"][\"themes\"] = themes;\n      }\n\n      let pluginsArray = this.get(\"plugins\");\n      if (Ember.isPresent(pluginsArray)) {\n        pluginsArray = pluginsArray.replace(/ /g, \"\").split(\",\");\n        configObject[\"plugins\"] = pluginsArray;\n\n        if (pluginsArray.includes(\"contextmenu\") || pluginsArray.includes(\"dnd\") || pluginsArray.includes(\"unique\")) {\n          // These plugins need core.check_callback\n          configObject[\"core\"][\"check_callback\"] = configObject[\"core\"][\"check_callback\"] || true;\n        }\n\n        let checkboxOptions = this.get(\"checkboxOptions\");\n        if (Ember.isPresent(checkboxOptions) && pluginsArray.includes(\"checkbox\")) {\n          configObject[\"checkbox\"] = checkboxOptions;\n        }\n\n        let searchOptions = this.get(\"searchOptions\");\n        if (Ember.isPresent(searchOptions) && pluginsArray.includes(\"search\")) {\n          configObject[\"search\"] = searchOptions;\n        }\n\n        let stateOptions = this.get(\"stateOptions\");\n        if (Ember.isPresent(stateOptions) && pluginsArray.includes(\"state\")) {\n          configObject[\"state\"] = stateOptions;\n        }\n\n        let typesOptions = this.get(\"typesOptions\");\n        if (Ember.isPresent(typesOptions) && pluginsArray.includes(\"types\")) {\n          configObject[\"types\"] = typesOptions;\n        }\n\n        let contextmenuOptions = this.get(\"contextmenuOptions\");\n        if (Ember.isPresent(contextmenuOptions) && pluginsArray.includes(\"contextmenu\")) {\n          configObject[\"contextmenu\"] = this._setupContextMenus(contextmenuOptions);\n        }\n\n        let dndOptions = this.get(\"dndOptions\");\n        if (Ember.isPresent(dndOptions) && pluginsArray.includes(\"dnd\")) {\n          configObject[\"dnd\"] = dndOptions;\n        }\n      }\n\n      console.log(\"configObject.data\");\n      console.log(configObject);\n\n      return configObject;\n    },\n\n    /**\n     * Setup context menu action handlers to handle ember actions\n     *\n     * @method _setupContextMenus\n     * @param  {Array} contextmenuOptions Context menu configuration options\n     * @return {Array} An Array of Ember-friendly options to pass back into the config object\n     */\n    _setupContextMenus(contextmenuOptions) {\n      if (Ember.typeOf(contextmenuOptions[\"items\"]) === \"object\") {\n        let newMenuItems = {};\n        let menuItems = Object.keys(contextmenuOptions[\"items\"]);\n        for (let menuItem of menuItems) {\n          let itemData = contextmenuOptions[\"items\"][menuItem];\n          newMenuItems[menuItem] = itemData;\n\n          // Only change if not a function\n          // This needs to be done to handle Ember actions\n          if (Ember.typeOf(itemData[\"action\"]) !== \"function\") {\n            let emberAction = itemData[\"action\"];\n\n            newMenuItems[menuItem][\"action\"] = data => {\n              this.send(\"contextmenuItemDidClick\", emberAction, data);\n            };\n          }\n        }\n\n        contextmenuOptions[\"items\"] = newMenuItems;\n      }\n\n      return contextmenuOptions;\n    },\n\n    /**\n     * Register all sorts of events\n     * TODO: This should eventually encompass all of the jsTree events declared in their API.\n     *\n     * @method _setupEventHandlers\n     * @param  {Object}\n     * @return\n     */\n    _setupEventHandlers(treeObject) {\n      if (typeof treeObject !== \"object\") {\n        throw new Error(\"You must pass a valid jsTree object to set up its event handlers\");\n      }\n\n      /*\n            Event: init.jstree\n            Action: eventDidInit\n            triggered after all events are bound\n          */\n      treeObject.on(\"init.jstree\", () => {\n        Ember.run.next(this, function () {\n          if (this.get(\"isDestroyed\") || this.get(\"isDestroying\")) {\n            return;\n          }\n          this.callAction(\"eventDidInit\");\n        });\n      });\n\n      /*\n            Event: loading.jstree\n            Action: eventIsLoading\n            triggered after the loading text is shown and before loading starts\n          */\n      treeObject.on(\"loading.jstree\", () => {\n        Ember.run.next(this, function () {\n          if (this.get(\"isDestroyed\") || this.get(\"isDestroying\")) {\n            return;\n          }\n          this.callAction(\"eventIsLoading\");\n        });\n      });\n\n      /*\n            Event: loaded.jstree\n            Action: eventDidLoad\n            triggered after the root node is loaded for the first time\n          */\n      treeObject.on(\"loaded.jstree\", () => {\n        Ember.run.next(this, function () {\n          if (this.get(\"isDestroyed\") || this.get(\"isDestroying\")) {\n            return;\n          }\n          this.callAction(\"eventDidLoad\");\n        });\n      });\n\n      /*\n            Event: ready.jstree\n            Action: eventDidBecomeReady\n            triggered after all nodes are finished loading\n          */\n      treeObject.on(\"ready.jstree\", () => {\n        Ember.run.next(this, function () {\n          if (this.get(\"isDestroyed\") || this.get(\"isDestroying\")) {\n            return;\n          }\n          this.set(\"isReady\", true);\n          this.callAction(\"eventDidBecomeReady\");\n        });\n      });\n\n      /*\n            Event: redraw.jstree\n            Action: eventDidRedraw\n            triggered after nodes are redrawn\n          */\n      treeObject.on(\"redraw.jstree\", () => {\n        Ember.run.next(this, function () {\n          if (this.get(\"isDestroyed\") || this.get(\"isDestroying\")) {\n            return;\n          }\n          this.callAction(\"eventDidRedraw\");\n        });\n      });\n\n      /*\n            Event: after_open.jstree\n            Action: eventDidOpen\n            triggered when a node is opened and the animation is complete\n          */\n      treeObject.on(\"after_open.jstree\", (event, data) => {\n        Ember.run.next(this, function () {\n          if (this.get(\"isDestroyed\") || this.get(\"isDestroying\")) {\n            return;\n          }\n          this.callAction(\"eventDidOpen\", data.node);\n        });\n      });\n\n      /*\n            Event: after_close.jstree\n            Action: eventDidClose\n            triggered when a node is closed and the animation is complete\n          */\n      treeObject.on(\"after_close.jstree\", (event, data) => {\n        Ember.run.next(this, function () {\n          if (this.get(\"isDestroyed\") || this.get(\"isDestroying\")) {\n            return;\n          }\n          this.callAction(\"eventDidClose\", data.node);\n        });\n      });\n\n      /*\n            Event: select_node.jstree\n            Action: eventDidSelectNode\n            triggered when an node is selected\n          */\n      treeObject.on(\"select_node.jstree\", (event, data) => {\n        Ember.run.next(this, function () {\n          if (this.get(\"isDestroyed\") || this.get(\"isDestroying\")) {\n            return;\n          }\n          this.callAction(\"eventDidSelectNode\", data.node, data.selected, data.event);\n        });\n      });\n\n      /*\n            Event: deselect_node.jstree\n            Action: eventDidDeselectNode\n            triggered when an node is deselected\n          */\n      treeObject.on(\"deselect_node.jstree\", (event, data) => {\n        Ember.run.next(this, function () {\n          if (this.get(\"isDestroyed\") || this.get(\"isDestroying\")) {\n            return;\n          }\n          this.callAction(\"eventDidDeselectNode\", data.node, data.selected, data.event);\n        });\n      });\n\n      /*\n            Event: changed.jstree\n            Action: jstreeDidChange\n            triggered when selection changes\n          */\n      treeObject.on(\"changed.jstree\", (event, data) => {\n        Ember.run.next(this, function () {\n          if (this.get(\"isDestroyed\") || this.get(\"isDestroying\")) {\n            return;\n          }\n\n          // Check if selection changed\n          if (Ember.isPresent(this.get(\"treeObject\"))) {\n            let selectionChangedEventNames = [\"model\", \"select_node\", \"deselect_node\", \"select_all\", \"deselect_all\"];\n            if (Ember.isPresent(data.action) && selectionChangedEventNames.includes(data.action)) {\n              let selNodes = Ember.A(this.get(\"treeObject\").jstree(true).get_selected(true));\n              this.set(\"selectedNodes\", selNodes);\n            }\n          }\n\n          this.callAction(\"eventDidChange\", data);\n        });\n      });\n\n      /*\n            Event: hover_node.jstree\n            Action: eventDidHoverNode\n            triggered when a node is hovered\n          */\n      treeObject.on(\"hover_node.jstree\", (event, data) => {\n        Ember.run.next(this, function () {\n          if (this.get(\"isDestroyed\") || this.get(\"isDestroying\")) {\n            return;\n          }\n          this.callAction(\"eventDidHoverNode\", data.node);\n        });\n      });\n\n      /*\n            Event: dehover_node.jstree\n            Action: eventDidDehoverNode\n            triggered when a node is no longer hovered\n          */\n      treeObject.on(\"dehover_node.jstree\", (event, data) => {\n        Ember.run.next(this, function () {\n          if (this.get(\"isDestroyed\") || this.get(\"isDestroying\")) {\n            return;\n          }\n          this.callAction(\"eventDidDehoverNode\", data.node);\n        });\n      });\n\n      /*\n            Event: show_node.jstree\n            Action: eventDidShowNode\n            triggered when a node is no longer hovered\n          */\n      treeObject.on(\"show_node.jstree\", (event, data) => {\n        Ember.run.next(this, function () {\n          if (this.get(\"isDestroyed\") || this.get(\"isDestroying\")) {\n            return;\n          }\n          this.callAction(\"eventDidShowNode\", data.node);\n        });\n      });\n\n      /*\n            Event: move_node.jstree\n            Action: eventDidMoveNode\n            triggered when a node is moved\n          */\n      treeObject.on(\"move_node.jstree\", (event, data) => {\n        Ember.run.next(this, function () {\n          if (this.get(\"isDestroyed\") || this.get(\"isDestroying\")) {\n            return;\n          }\n          this.callAction(\"eventDidMoveNode\", data.node);\n        });\n      });\n\n      let pluginsArray = this.get(\"plugins\");\n      if (Ember.isPresent(pluginsArray) && pluginsArray.indexOf(\"checkbox\") > -1) {\n        /*\n             Event: disable_checkbox.jstree\n             Action: eventDidDisableCheckbox\n             triggered when an node's checkbox is disabled\n           */\n        treeObject.on(\"disable_checkbox.jstree\", (event, data) => {\n          Ember.run.next(this, function () {\n            if (this.get(\"isDestroyed\") || this.get(\"isDestroying\")) {\n              return;\n            }\n            this.callAction(\"eventDidDisableCheckbox\", data.node);\n          });\n        });\n\n        /*\n             Event: enable_checkbox.jstree\n             Action: eventDidEnableCheckbox\n             triggered when an node's checkbox is enabled\n           */\n        treeObject.on(\"enable_checkbox.jstree\", (event, data) => {\n          Ember.run.next(this, function () {\n            if (this.get(\"isDestroyed\") || this.get(\"isDestroying\")) {\n              return;\n            }\n            this.callAction(\"eventDidEnableCheckbox\", data.node);\n          });\n        });\n\n        if (Ember.isPresent(\"checkboxOptions.tie_selected\") && !this.get(\"checkboxOptions.tie_selected\")) {\n          /*\n               Event: check_node.jstree\n               Action: eventDidCheckNode\n               triggered when an node is checked (only if tie_selection in checkbox settings is false)\n             */\n          treeObject.on(\"check_node.jstree\", (event, data) => {\n            Ember.run.next(this, function () {\n              if (this.get(\"isDestroyed\") || this.get(\"isDestroying\")) {\n                return;\n              }\n              this.callAction(\"eventDidCheckNode\", data.node, data.selected, data.event);\n            });\n          });\n\n          /*\n               Event: uncheck_node.jstree\n               Action: eventDidUncheckNode\n               triggered when an node is unchecked (only if tie_selection in checkbox settings is false)\n             */\n          treeObject.on(\"uncheck_node.jstree\", (event, data) => {\n            Ember.run.next(this, function () {\n              if (this.get(\"isDestroyed\") || this.get(\"isDestroying\")) {\n                return;\n              }\n              this.callAction(\"eventDidUncheckNode\", data.node, data.selected, data.event);\n            });\n          });\n\n          /*\n               Event: check_all.jstree\n               Action: eventDidCheckAll\n               triggered when all nodes are checked (only if tie_selection in checkbox settings is false)\n             */\n          treeObject.on(\"check_all.jstree\", (event, data) => {\n            Ember.run.next(this, function () {\n              if (this.get(\"isDestroyed\") || this.get(\"isDestroying\")) {\n                return;\n              }\n              this.callAction(\"eventDidCheckAll\", data.selected);\n            });\n          });\n\n          /*\n               Event: uncheck_all.jstree\n               Action: eventDidUncheckAll\n               triggered when all nodes are unchecked (only if tie_selection in checkbox settings is false)\n             */\n          treeObject.on(\"uncheck_all.jstree\", (event, data) => {\n            Ember.run.next(this, function () {\n              if (this.get(\"isDestroyed\") || this.get(\"isDestroying\")) {\n                return;\n              }\n              this.callAction(\"eventDidUncheckAll\", data.node, data.selected);\n            });\n          });\n        }\n      }\n    },\n\n    /**\n     * Refreshes the data in the tree\n     * TODO: Investigate why redraw(true) doesn't work...\n     *\n     * @method _redrawTree\n     */\n    _refreshTree: Ember.observer(\"data\", function () {\n      let tree = this.getTree();\n      if (null !== tree && false !== tree) {\n        tree.settings.core[\"data\"] = this.get(\"data\");\n        tree.refresh(this.get(\"skipLoading\"), this.get(\"forgetState\"));\n      } else {\n        // setup again if destroyed\n        let treeObject = this._setupJsTree();\n        this._setupEventHandlers(treeObject);\n        this.set(\"treeObject\", treeObject);\n      }\n    }),\n\n    getTree() {\n      let tree = this.get(\"treeObject\");\n      return tree.jstree(true);\n    },\n\n    actions: {\n      contextmenuItemDidClick(actionName, data) {\n        let emberTreeObj = this.get(\"getTree\");\n\n        let instance = Ember.$.jstree.reference(data.reference);\n        let node = instance.get_node(data.reference);\n\n        this.callAction(actionName, node, emberTreeObj);\n      }\n    }\n  });\n});","define(\"ember-cli-jstree/mixins/ember-jstree-actions\", [\"exports\"], function (exports) {\n  \"use strict\";\n\n  Object.defineProperty(exports, \"__esModule\", {\n    value: true\n  });\n\n\n  const { testing } = Ember;\n\n  /**\n   * Actions that are mapped to jstree and return Ember actions with parameters where necessary.\n   * These actions are passed to the addon via the actionReceiver property and are generally\n   * the same as jsTree method names, but camelized.\n   *\n   * @class EmberJstreeActions\n   */\n  exports.default = Ember.Mixin.create({\n    callAction(actionName, ...args) {\n      let action = this.get(actionName);\n\n      if (Ember.typeOf(action) === \"function\") {\n        return action(...args);\n      }\n    },\n\n    _jsTreeFindNodeMatches(property, values) {\n      let treeObject = this.get(\"treeObject\");\n      let nodes = [];\n\n      if (\"id\" === property) {\n        // If property is ID, can use get_node, which is faster than search.\n        if (Ember.isArray(values)) {\n          for (let i = 0; i < values.length; i++) {\n            let node = treeObject.jstree(true).get_node(values[i]);\n            nodes.push(node);\n          }\n        }\n      } else {\n        if (!Ember.isArray(values)) {\n          values = Ember.A([values]);\n        }\n\n        let data = treeObject.jstree(true)._model.data;\n        let dataKeys = Object.keys(data);\n\n        for (let i = 0; i < values.length; i++) {\n          let value = values[i];\n          if (!Ember.isNone(value)) {\n            for (let j = 0; j < dataKeys.length; j++) {\n              let node = data[dataKeys[j]];\n              if (Ember.typeOf(node.original) !== \"undefined\" && node.original[property] === value) {\n                nodes.push(node);\n                break;\n              }\n            }\n          }\n        }\n      }\n\n      return nodes;\n    },\n\n    actions: {\n      redraw() {\n        // Redraw true currently does not work as intended. Need to investigate.\n        this._refreshTree();\n      },\n\n      destroy() {\n        let treeObject = this.get(\"treeObject\");\n        if (!Ember.isNone(treeObject)) {\n          if (!testing && !this.get(\"_isDestroying\")) {\n            treeObject.jstree(true).destroy();\n          }\n\n          this.callAction(\"eventDidDestroy\");\n        }\n      },\n\n      getNode(nodeId) {\n        if (Ember.typeOf(nodeId) !== \"string\") {\n          throw new Error(\"getNode() requires a node ID to be passed to it to return the node!\");\n        }\n\n        let treeObject = this.get(\"treeObject\");\n        if (!Ember.isNone(treeObject)) {\n          this.callAction(\"actionGetNode\", treeObject.jstree(true).get_node(nodeId));\n        }\n      },\n\n      getText(obj) {\n        let treeObject = this.get(\"treeObject\");\n        if (!Ember.isNone(treeObject)) {\n          this.callAction(\"actionGetText\", treeObject.jstree(true).get_text(obj));\n        }\n      },\n\n      getPath(obj, glue, ids) {\n        let treeObject = this.get(\"treeObject\");\n        if (!Ember.isNone(treeObject)) {\n          this.callAction(\"actionGetPath\", treeObject.jstree(true).get_path(obj, glue, ids));\n        }\n      },\n\n      getChildrenDom(obj) {\n        let treeObject = this.get(\"treeObject\");\n        if (!Ember.isNone(treeObject)) {\n          this.callAction(\"actionGetChildrenDom\", treeObject.jstree(true).get_children_dom(obj));\n        }\n      },\n\n      getContainer() {\n        let treeObject = this.get(\"treeObject\");\n        if (!Ember.isNone(treeObject)) {\n          this.callAction(\"actionGetContainer\", treeObject.jstree(true).get_container());\n        }\n      },\n\n      getParent(obj) {\n        obj = obj || \"#\";\n        let treeObject = this.get(\"treeObject\");\n        if (!Ember.isNone(treeObject)) {\n          this.callAction(\"actionGetParent\", treeObject.jstree(true).get_parent(obj));\n        }\n      },\n\n      loadNode(obj, cb) {\n        let treeObject = this.get(\"treeObject\");\n        if (!Ember.isNone(treeObject)) {\n          this.callAction(\"actionLoadNode\", treeObject.jstree(true).load_node(obj, cb));\n        }\n      },\n\n      loadAll(obj, cb) {\n        let treeObject = this.get(\"treeObject\");\n        if (!Ember.isNone(treeObject)) {\n          this.callAction(\"actionLoadAll\", treeObject.jstree(true).load_all(obj, cb));\n        }\n      },\n\n      openNode(obj, cb, animation) {\n        let treeObject = this.get(\"treeObject\");\n        if (!Ember.isNone(treeObject)) {\n          treeObject.jstree(true).open_node(obj, cb, animation);\n        }\n      },\n\n      openAll(obj, animation) {\n        let treeObject = this.get(\"treeObject\");\n        if (!Ember.isNone(treeObject)) {\n          treeObject.jstree(true).open_all(obj, animation);\n        }\n      },\n\n      closeNode(obj, cb) {\n        let treeObject = this.get(\"treeObject\");\n        if (!Ember.isNone(treeObject)) {\n          treeObject.jstree(true).close_node(obj, cb);\n        }\n      },\n\n      closeAll(obj, animation) {\n        let treeObject = this.get(\"treeObject\");\n        if (!Ember.isNone(treeObject)) {\n          treeObject.jstree(true).close_all(obj, animation);\n        }\n      },\n\n      toggleNode(obj) {\n        let treeObject = this.get(\"treeObject\");\n        if (!Ember.isNone(treeObject)) {\n          treeObject.jstree(true).toggle_node(obj);\n        }\n      },\n\n      createNode(obj, node, pos, callback, is_loaded) {\n        let treeObject = this.get(\"treeObject\");\n        if (!Ember.isNone(treeObject)) {\n          this.callAction(\"actionCreateNode\", treeObject.jstree(true).create_node(obj, node, pos, callback, is_loaded));\n        }\n      },\n\n      renameNode(obj, val) {\n        let treeObject = this.get(\"treeObject\");\n        if (!Ember.isNone(treeObject)) {\n          this.callAction(\"actionRenameNode\", treeObject.jstree(true).rename_node(obj, val));\n        }\n      },\n\n      moveNode(obj, par, pos, callback, is_loaded) {\n        let treeObject = this.get(\"treeObject\");\n        if (!Ember.isNone(treeObject)) {\n          treeObject.jstree(true).move_node(obj, par, pos, callback, is_loaded);\n        }\n      },\n\n      copyNode(obj, par, pos, callback, is_loaded) {\n        let treeObject = this.get(\"treeObject\");\n        if (!Ember.isNone(treeObject)) {\n          treeObject.jstree(true).copy_node(obj, par, pos, callback, is_loaded);\n        }\n      },\n\n      deleteNode(obj) {\n        let treeObject = this.get(\"treeObject\");\n        if (!Ember.isNone(treeObject)) {\n          this.callAction(\"actionDeleteNode\", treeObject.jstree(true).delete_node(obj));\n        }\n      },\n\n      selectNode(obj, suppress_event) {\n        let treeObject = this.get(\"treeObject\");\n        if (!Ember.isNone(treeObject)) {\n          treeObject.jstree(true).select_node(obj, suppress_event);\n        }\n      },\n\n      deselectNode(obj, suppress_event) {\n        let treeObject = this.get(\"treeObject\");\n        if (!Ember.isNone(treeObject)) {\n          treeObject.jstree(true).deselect_node(obj, suppress_event);\n        }\n      },\n\n      selectAll(suppress_event) {\n        let treeObject = this.get(\"treeObject\");\n        if (!Ember.isNone(treeObject)) {\n          treeObject.jstree(true).select_all(suppress_event);\n        }\n      },\n\n      deselectAll(suppress_event) {\n        let treeObject = this.get(\"treeObject\");\n        if (!Ember.isNone(treeObject)) {\n          treeObject.jstree(true).deselect_all(suppress_event);\n        }\n      },\n\n      lastError() {\n        let treeObject = this.get(\"treeObject\");\n        if (!Ember.isNone(treeObject)) {\n          let e = treeObject.jstree(true).last_error();\n          this.set(\"_lastError\", e);\n          this.callAction(\"actionLastError\", e);\n        }\n      },\n\n      deselectNodes(property, values) {\n        if (arguments.length === 0) {\n          (true && Ember.warn(\"Using deselectNodes without parameters to deselect all nodes is deprecated. Use the deselectAll action to deselect all nodes.\"));\n\n          this.send(\"deselectAll\");\n          return;\n        }\n\n        let treeObject = this.get(\"treeObject\");\n        let nodes = this._jsTreeFindNodeMatches(property, values);\n\n        treeObject.jstree(true).deselect_node(nodes, true, true);\n        treeObject.jstree(true).redraw(); // Redraw so that parent nodes get their indicator changed.\n      },\n\n      selectNodes(property, values) {\n        let treeObject = this.get(\"treeObject\");\n        if (null !== treeObject && !this.get(\"isDestroyed\") && !this.get(\"isDestroying\")) {\n          let nodes = this._jsTreeFindNodeMatches(property, values);\n          treeObject.jstree(true).select_node(nodes, true, true);\n        }\n      }\n    }\n  });\n});","define('ember-component-inbound-actions/action-proxy', ['exports'], function (exports) {\n  'use strict';\n\n  Object.defineProperty(exports, \"__esModule\", {\n    value: true\n  });\n  exports.default = Ember.Object.extend(Ember.ActionHandler);\n});","define('ember-component-inbound-actions/helpers/send', ['exports'], function (exports) {\n  'use strict';\n\n  Object.defineProperty(exports, \"__esModule\", {\n    value: true\n  });\n  exports.default = Ember.Helper.helper(([target, action, ...params]) => {\n    return () => {\n      target.send(action, ...params);\n    };\n  });\n});","define('ember-component-inbound-actions/inbound-actions', ['exports', 'ember-component-inbound-actions/action-proxy'], function (exports, _actionProxy) {\n  'use strict';\n\n  Object.defineProperty(exports, \"__esModule\", {\n    value: true\n  });\n\n\n  let scheduleInAfterRender = /^1\\.13|^[2-9]/.test(Ember.VERSION);\n\n  exports.default = Ember.Mixin.create({\n    _inbound_actions_setup: Ember.on('init', function () {\n      this._inbound_actions_maybeScheduleInAfterRender(() => {\n        var proxy = _actionProxy.default.create({ target: this });\n        this.set('actionReceiver', proxy);\n      });\n    }),\n    _inbound_actions_maybeScheduleInAfterRender: function (fn) {\n      if (scheduleInAfterRender) {\n        Ember.run.schedule('afterRender', this, fn);\n      } else {\n        fn();\n      }\n    },\n    onDestroy: Ember.on('willDestroyElement', function () {\n      this.set('actionReceiver', null);\n    })\n  });\n});","define('ember-data/-private', ['exports', '@ember-data/store', 'ember-data/version', '@ember-data/model/-private', '@ember-data/store/-private', '@ember-data/record-data/-private'], function (exports, store, VERSION, Private, Private$1, Private$2) { 'use strict';\n\n  store = store && store.hasOwnProperty('default') ? store['default'] : store;\n  VERSION = VERSION && VERSION.hasOwnProperty('default') ? VERSION['default'] : VERSION;\n\n  /**\n   * @property VERSION\n   * @public\n   * @static\n   * @for @ember-data\n   */\n\n  var DS = Ember.Namespace.create({\n    VERSION: VERSION,\n    name: 'DS'\n  });\n\n  if (Ember.libraries) {\n    Ember.libraries.registerCoreLibrary('Ember Data', VERSION);\n  }\n\n  function featureIsEnabled() {\n    return Ember.FEATURES.isEnabled(...arguments);\n  }\n\n  exports.Store = store;\n  Object.defineProperty(exports, 'Errors', {\n    enumerable: true,\n    get: function () {\n      return Private.Errors;\n    }\n  });\n  Object.defineProperty(exports, 'AdapterPopulatedRecordArray', {\n    enumerable: true,\n    get: function () {\n      return Private$1.AdapterPopulatedRecordArray;\n    }\n  });\n  Object.defineProperty(exports, 'InternalModel', {\n    enumerable: true,\n    get: function () {\n      return Private$1.InternalModel;\n    }\n  });\n  Object.defineProperty(exports, 'ManyArray', {\n    enumerable: true,\n    get: function () {\n      return Private$1.ManyArray;\n    }\n  });\n  Object.defineProperty(exports, 'PromiseArray', {\n    enumerable: true,\n    get: function () {\n      return Private$1.PromiseArray;\n    }\n  });\n  Object.defineProperty(exports, 'PromiseManyArray', {\n    enumerable: true,\n    get: function () {\n      return Private$1.PromiseManyArray;\n    }\n  });\n  Object.defineProperty(exports, 'PromiseObject', {\n    enumerable: true,\n    get: function () {\n      return Private$1.PromiseObject;\n    }\n  });\n  Object.defineProperty(exports, 'RecordArray', {\n    enumerable: true,\n    get: function () {\n      return Private$1.RecordArray;\n    }\n  });\n  Object.defineProperty(exports, 'RecordArrayManager', {\n    enumerable: true,\n    get: function () {\n      return Private$1.RecordArrayManager;\n    }\n  });\n  Object.defineProperty(exports, 'RootState', {\n    enumerable: true,\n    get: function () {\n      return Private$1.RootState;\n    }\n  });\n  Object.defineProperty(exports, 'Snapshot', {\n    enumerable: true,\n    get: function () {\n      return Private$1.Snapshot;\n    }\n  });\n  Object.defineProperty(exports, 'SnapshotRecordArray', {\n    enumerable: true,\n    get: function () {\n      return Private$1.SnapshotRecordArray;\n    }\n  });\n  Object.defineProperty(exports, 'coerceId', {\n    enumerable: true,\n    get: function () {\n      return Private$1.coerceId;\n    }\n  });\n  Object.defineProperty(exports, 'normalizeModelName', {\n    enumerable: true,\n    get: function () {\n      return Private$1.normalizeModelName;\n    }\n  });\n  Object.defineProperty(exports, 'RecordData', {\n    enumerable: true,\n    get: function () {\n      return Private$2.RecordData;\n    }\n  });\n  Object.defineProperty(exports, 'Relationship', {\n    enumerable: true,\n    get: function () {\n      return Private$2.Relationship;\n    }\n  });\n  exports.DS = DS;\n  exports.isEnabled = featureIsEnabled;\n\n  Object.defineProperty(exports, '__esModule', { value: true });\n\n});\n","define(\"ember-data/adapter\", [\"exports\", \"@ember-data/adapter\"], function (_exports, _adapter) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"default\", {\n    enumerable: true,\n    get: function () {\n      return _adapter.default;\n    }\n  });\n});","define(\"ember-data/adapters/errors\", [\"exports\", \"@ember-data/adapter/error\"], function (_exports, _error) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"AbortError\", {\n    enumerable: true,\n    get: function () {\n      return _error.AbortError;\n    }\n  });\n  Object.defineProperty(_exports, \"AdapterError\", {\n    enumerable: true,\n    get: function () {\n      return _error.default;\n    }\n  });\n  Object.defineProperty(_exports, \"ConflictError\", {\n    enumerable: true,\n    get: function () {\n      return _error.ConflictError;\n    }\n  });\n  Object.defineProperty(_exports, \"ForbiddenError\", {\n    enumerable: true,\n    get: function () {\n      return _error.ForbiddenError;\n    }\n  });\n  Object.defineProperty(_exports, \"InvalidError\", {\n    enumerable: true,\n    get: function () {\n      return _error.InvalidError;\n    }\n  });\n  Object.defineProperty(_exports, \"NotFoundError\", {\n    enumerable: true,\n    get: function () {\n      return _error.NotFoundError;\n    }\n  });\n  Object.defineProperty(_exports, \"ServerError\", {\n    enumerable: true,\n    get: function () {\n      return _error.ServerError;\n    }\n  });\n  Object.defineProperty(_exports, \"TimeoutError\", {\n    enumerable: true,\n    get: function () {\n      return _error.TimeoutError;\n    }\n  });\n  Object.defineProperty(_exports, \"UnauthorizedError\", {\n    enumerable: true,\n    get: function () {\n      return _error.UnauthorizedError;\n    }\n  });\n  Object.defineProperty(_exports, \"errorsArrayToHash\", {\n    enumerable: true,\n    get: function () {\n      return _error.errorsArrayToHash;\n    }\n  });\n  Object.defineProperty(_exports, \"errorsHashToArray\", {\n    enumerable: true,\n    get: function () {\n      return _error.errorsHashToArray;\n    }\n  });\n});","define(\"ember-data/adapters/json-api\", [\"exports\", \"@ember-data/adapter/json-api\"], function (_exports, _jsonApi) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"default\", {\n    enumerable: true,\n    get: function () {\n      return _jsonApi.default;\n    }\n  });\n});","define(\"ember-data/adapters/rest\", [\"exports\", \"@ember-data/adapter/rest\"], function (_exports, _rest) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"default\", {\n    enumerable: true,\n    get: function () {\n      return _rest.default;\n    }\n  });\n});","define(\"ember-data/attr\", [\"exports\", \"@ember-data/model\"], function (_exports, _model) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"default\", {\n    enumerable: true,\n    get: function () {\n      return _model.attr;\n    }\n  });\n});","define(\"ember-data/index\", [\"exports\", \"ember-data/store\", \"@ember-data/store\", \"@ember-data/debug\", \"ember-data/-private\", \"ember-inflector\", \"ember-data/setup-container\", \"ember-data/initialize-store-service\", \"@ember-data/serializer/transform\", \"@ember-data/serializer/-private\", \"@ember-data/adapter\", \"@ember-data/adapter/json-api\", \"@ember-data/adapter/rest\", \"@ember-data/adapter/error\", \"@ember-data/serializer\", \"@ember-data/serializer/json-api\", \"@ember-data/serializer/json\", \"@ember-data/serializer/rest\", \"@ember-data/model\"], function (_exports, _store, _store2, _debug, _private, _emberInflector, _setupContainer, _initializeStoreService, _transform, _private2, _adapter, _jsonApi, _rest, _error, _serializer, _jsonApi2, _json, _rest2, _model) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  if (Ember.VERSION.match(/^1\\.([0-9]|1[0-2])\\./)) {\n    throw new Ember.Error('Ember Data requires at least Ember 1.13.0, but you have ' + Ember.VERSION + '. Please upgrade your version of Ember, then upgrade Ember Data.');\n  }\n\n  _private.DS.Store = _store.default;\n  _private.DS.PromiseArray = _private.PromiseArray;\n  _private.DS.PromiseObject = _private.PromiseObject;\n  _private.DS.PromiseManyArray = _private.PromiseManyArray;\n  _private.DS.Model = _model.default;\n  _private.DS.RootState = _private.RootState;\n  _private.DS.attr = _model.attr;\n  _private.DS.Errors = _private.Errors;\n  _private.DS.InternalModel = _private.InternalModel;\n  _private.DS.Snapshot = _private.Snapshot;\n  _private.DS.Adapter = _adapter.default;\n  _private.DS.AdapterError = _error.default;\n  _private.DS.InvalidError = _error.InvalidError;\n  _private.DS.TimeoutError = _error.TimeoutError;\n  _private.DS.AbortError = _error.AbortError;\n  _private.DS.UnauthorizedError = _error.UnauthorizedError;\n  _private.DS.ForbiddenError = _error.ForbiddenError;\n  _private.DS.NotFoundError = _error.NotFoundError;\n  _private.DS.ConflictError = _error.ConflictError;\n  _private.DS.ServerError = _error.ServerError;\n  _private.DS.errorsHashToArray = _error.errorsHashToArray;\n  _private.DS.errorsArrayToHash = _error.errorsArrayToHash;\n  _private.DS.Serializer = _serializer.default;\n  _private.DS.DebugAdapter = _debug.default;\n  _private.DS.RecordArray = _private.RecordArray;\n  _private.DS.AdapterPopulatedRecordArray = _private.AdapterPopulatedRecordArray;\n  _private.DS.ManyArray = _private.ManyArray;\n  _private.DS.RecordArrayManager = _private.RecordArrayManager;\n  _private.DS.RESTAdapter = _rest.default;\n  _private.DS.BuildURLMixin = _adapter.BuildURLMixin;\n  _private.DS.RESTSerializer = _rest2.default;\n  _private.DS.JSONSerializer = _json.default;\n  _private.DS.JSONAPIAdapter = _jsonApi.default;\n  _private.DS.JSONAPISerializer = _jsonApi2.default;\n  _private.DS.Transform = _transform.default;\n  _private.DS.DateTransform = _private2.DateTransform;\n  _private.DS.StringTransform = _private2.StringTransform;\n  _private.DS.NumberTransform = _private2.NumberTransform;\n  _private.DS.BooleanTransform = _private2.BooleanTransform;\n  _private.DS.EmbeddedRecordsMixin = _rest2.EmbeddedRecordsMixin;\n  _private.DS.belongsTo = _model.belongsTo;\n  _private.DS.hasMany = _model.hasMany;\n  _private.DS.Relationship = _private.Relationship;\n  _private.DS._setupContainer = _setupContainer.default;\n  _private.DS._initializeStoreService = _initializeStoreService.default;\n  Object.defineProperty(_private.DS, 'normalizeModelName', {\n    enumerable: true,\n    writable: false,\n    configurable: false,\n    value: _store2.normalizeModelName\n  });\n  var _default = _private.DS;\n  _exports.default = _default;\n});","define(\"ember-data/initialize-store-service\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = initializeStoreService;\n\n  /*\n    Configures a registry for use with an Ember-Data\n    store.\n  \n    @method initializeStoreService\n    @param {Ember.ApplicationInstance | Ember.EngineInstance} instance\n  */\n  function initializeStoreService(instance) {\n    // instance.lookup supports Ember 2.1 and higher\n    // instance.container supports Ember 1.11 - 2.0\n    var container = instance.lookup ? instance : instance.container; // Eagerly generate the store so defaultStore is populated.\n\n    container.lookup('service:store');\n  }\n});","define(\"ember-data/model\", [\"exports\", \"@ember-data/model\"], function (_exports, _model) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"default\", {\n    enumerable: true,\n    get: function () {\n      return _model.default;\n    }\n  });\n});","define(\"ember-data/relationships\", [\"exports\", \"@ember-data/model\"], function (_exports, _model) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"belongsTo\", {\n    enumerable: true,\n    get: function () {\n      return _model.belongsTo;\n    }\n  });\n  Object.defineProperty(_exports, \"hasMany\", {\n    enumerable: true,\n    get: function () {\n      return _model.hasMany;\n    }\n  });\n});","define(\"ember-data/serializer\", [\"exports\", \"@ember-data/serializer\"], function (_exports, _serializer) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"default\", {\n    enumerable: true,\n    get: function () {\n      return _serializer.default;\n    }\n  });\n});","define(\"ember-data/serializers/embedded-records-mixin\", [\"exports\", \"@ember-data/serializer/rest\"], function (_exports, _rest) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"default\", {\n    enumerable: true,\n    get: function () {\n      return _rest.EmbeddedRecordsMixin;\n    }\n  });\n});","define(\"ember-data/serializers/json-api\", [\"exports\", \"@ember-data/serializer/json-api\"], function (_exports, _jsonApi) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"default\", {\n    enumerable: true,\n    get: function () {\n      return _jsonApi.default;\n    }\n  });\n});","define(\"ember-data/serializers/json\", [\"exports\", \"@ember-data/serializer/json\"], function (_exports, _json) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"default\", {\n    enumerable: true,\n    get: function () {\n      return _json.default;\n    }\n  });\n});","define(\"ember-data/serializers/rest\", [\"exports\", \"@ember-data/serializer/rest\"], function (_exports, _rest) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"default\", {\n    enumerable: true,\n    get: function () {\n      return _rest.default;\n    }\n  });\n});","define(\"ember-data/setup-container\", [\"exports\", \"@ember-data/store\"], function (_exports, _store) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = setupContainer;\n\n  function initializeStore(application) {\n    // we can just use registerOptionsForType when we no longer\n    // support (deprecated) versions of @ember/test-helpers\n    // We're issuing a \"private-api\" deprecation for users of the\n    // deprecated @ember/test-helpers versions, but will keep\n    // this for as long as until 4.0 as needed\n    if (true\n    /* DEBUG */\n    && !application.registerOptionsForType) {\n      (true && !(false) && Ember.deprecate(`Deprecated test syntax usage detected!\\n\\n\\t` + `This test relies on a deprecated test setup that is no longer supported by EmberData.` + ` To resolve this you will need to be on a recent version of @ember/test-helpers` + ` AND your tests must use \\`setApplication()\\` instead of \\`setResolver()\\` and` + ` \\`module()\\` with \\`setup*Test()\\`instead of \\`moduleFor*()\\`.`, false, {\n        id: 'ember-data:legacy-test-helper-support',\n        until: '3.17'\n      }));\n      application.optionsForType('serializer', {\n        singleton: false\n      });\n      application.optionsForType('adapter', {\n        singleton: false\n      });\n\n      if (!application.has('service:store')) {\n        application.register('service:store', _store.default);\n      }\n\n      return;\n    }\n\n    application.registerOptionsForType('serializer', {\n      singleton: false\n    });\n    application.registerOptionsForType('adapter', {\n      singleton: false\n    });\n\n    if (!application.hasRegistration('service:store')) {\n      application.register('service:store', _store.default);\n    }\n  }\n\n  function initializeStoreInjections(application) {\n    var inject = application.inject || application.injection;\n    inject.call(application, 'controller', 'store', 'service:store');\n    inject.call(application, 'route', 'store', 'service:store');\n  }\n\n  function setupContainer(application) {\n    initializeStoreInjections(application);\n    initializeStore(application);\n  }\n});","define(\"ember-data/store\", [\"exports\", \"@ember-data/store\", \"@ember-data/record-data/-private\", \"@ember-data/store/-private\"], function (_exports, _store, _private, _private2) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  class DefaultStore extends _store.default {\n    createRecordDataFor(modelName, id, clientId, storeWrapper) {\n      if (true\n      /* IDENTIFIERS */\n      ) {\n        var identifier = (0, _private2.identifierCacheFor)(this).getOrCreateRecordIdentifier({\n          type: modelName,\n          id,\n          lid: clientId\n        });\n        return new _private.RecordData(identifier, storeWrapper);\n      } else {\n        return new _private.RecordData(modelName, id, clientId, storeWrapper);\n      }\n    }\n\n  }\n\n  _exports.default = DefaultStore;\n});","define(\"ember-data/transform\", [\"exports\", \"@ember-data/serializer/transform\"], function (_exports, _transform) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"default\", {\n    enumerable: true,\n    get: function () {\n      return _transform.default;\n    }\n  });\n});","define(\"ember-data/version\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  var _default = \"3.15.0\";\n  _exports.default = _default;\n});","define(\"ember-fetch/ajax\", [\"exports\", \"fetch\"], function (_exports, _fetch) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = ajax;\n\n  function ajax(input, init) {\n    return (0, _fetch.default)(input, init).then(response => {\n      if (response.ok) {\n        return response.json();\n      }\n\n      throw response;\n    });\n  }\n});","define(\"ember-fetch/errors\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.isUnauthorizedResponse = isUnauthorizedResponse;\n  _exports.isForbiddenResponse = isForbiddenResponse;\n  _exports.isInvalidResponse = isInvalidResponse;\n  _exports.isBadRequestResponse = isBadRequestResponse;\n  _exports.isNotFoundResponse = isNotFoundResponse;\n  _exports.isGoneResponse = isGoneResponse;\n  _exports.isAbortError = isAbortError;\n  _exports.isConflictResponse = isConflictResponse;\n  _exports.isServerErrorResponse = isServerErrorResponse;\n\n  /**\n   * Checks if the given response represents an unauthorized request error\n   */\n  function isUnauthorizedResponse(response) {\n    return response.status === 401;\n  }\n  /**\n   * Checks if the given response represents a forbidden request error\n   */\n\n\n  function isForbiddenResponse(response) {\n    return response.status === 403;\n  }\n  /**\n   * Checks if the given response represents an invalid request error\n   */\n\n\n  function isInvalidResponse(response) {\n    return response.status === 422;\n  }\n  /**\n   * Checks if the given response represents a bad request error\n   */\n\n\n  function isBadRequestResponse(response) {\n    return response.status === 400;\n  }\n  /**\n   * Checks if the given response represents a \"not found\" error\n   */\n\n\n  function isNotFoundResponse(response) {\n    return response.status === 404;\n  }\n  /**\n   * Checks if the given response represents a \"gone\" error\n   */\n\n\n  function isGoneResponse(response) {\n    return response.status === 410;\n  }\n  /**\n   * Checks if the given error is an \"abort\" error\n   */\n\n\n  function isAbortError(error) {\n    return error.name == 'AbortError';\n  }\n  /**\n   * Checks if the given response represents a conflict error\n   */\n\n\n  function isConflictResponse(response) {\n    return response.status === 409;\n  }\n  /**\n   * Checks if the given response represents a server error\n   */\n\n\n  function isServerErrorResponse(response) {\n    return response.status >= 500 && response.status < 600;\n  }\n});","define(\"ember-fetch/mixins/adapter-fetch\", [\"exports\", \"fetch\", \"ember-fetch/utils/mung-options-for-fetch\", \"ember-fetch/utils/determine-body-promise\"], function (_exports, _fetch, _mungOptionsForFetch, _determineBodyPromise) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.headersToObject = headersToObject;\n  _exports.default = void 0;\n\n  /**\n   * Helper function to create a plain object from the response's Headers.\n   * Consumed by the adapter's `handleResponse`.\n   */\n  function headersToObject(headers) {\n    let headersObject = {};\n\n    if (headers) {\n      headers.forEach((value, key) => headersObject[key] = value);\n    }\n\n    return headersObject;\n  }\n\n  var _default = Ember.Mixin.create({\n    headers: undefined,\n\n    init() {\n      this._super(...arguments);\n\n      (true && !(false) && Ember.deprecate('FetchAdapter is deprecated, it is no longer required for ember-data>=3.9.2', false, {\n        id: 'deprecate-fetch-ember-data-support',\n        until: '7.0.0'\n      }));\n    },\n\n    /**\n     * @override\n     */\n    ajaxOptions(url, type, options) {\n      let hash = options || {};\n      hash.url = url;\n      hash.type = type; // Add headers set on the Adapter\n\n      let adapterHeaders = Ember.get(this, 'headers');\n\n      if (adapterHeaders) {\n        hash.headers = Ember.assign(hash.headers || {}, adapterHeaders);\n      }\n\n      const mungedOptions = (0, _mungOptionsForFetch.default)(hash); // Mimics the default behavior in Ember Data's `ajaxOptions`, namely to set the\n      // 'Content-Type' header to application/json if it is not a GET request and it has a body.\n\n      if (mungedOptions.method !== 'GET' && mungedOptions.body && (mungedOptions.headers === undefined || !(mungedOptions.headers['Content-Type'] || mungedOptions.headers['content-type']))) {\n        mungedOptions.headers = mungedOptions.headers || {};\n        mungedOptions.headers['Content-Type'] = 'application/json; charset=utf-8';\n      }\n\n      return mungedOptions;\n    },\n\n    /**\n     * @override\n     */\n    ajax(url, type, options) {\n      const requestData = {\n        url,\n        method: type\n      };\n      const hash = this.ajaxOptions(url, type, options);\n      return this._ajaxRequest(hash) // @ts-ignore\n      .catch((error, response, requestData) => {\n        throw this.ajaxError(this, response, null, requestData, error);\n      }).then(response => {\n        return Ember.RSVP.hash({\n          response,\n          payload: (0, _determineBodyPromise.default)(response, requestData)\n        });\n      }).then(({\n        response,\n        payload\n      }) => {\n        if (response.ok) {\n          return this.ajaxSuccess(this, response, payload, requestData);\n        } else {\n          throw this.ajaxError(this, response, payload, requestData);\n        }\n      });\n    },\n\n    /**\n     * Overrides the `_ajaxRequest` method to use `fetch` instead of jQuery.ajax\n     * @override\n     */\n    _ajaxRequest(options) {\n      return this._fetchRequest(options.url, options);\n    },\n\n    /**\n     * A hook into where `fetch` is called.\n     * Useful if you want to override this behavior, for example to multiplex requests.\n     */\n    _fetchRequest(url, options) {\n      return (0, _fetch.default)(url, options);\n    },\n\n    /**\n     * @override\n     */\n    ajaxSuccess(adapter, response, payload, requestData) {\n      const returnResponse = adapter.handleResponse(response.status, headersToObject(response.headers), // TODO: DS.RESTAdapter annotates payload: {}\n      // @ts-ignore\n      payload, requestData); // TODO: DS.RESTAdapter annotates response: {}\n      // @ts-ignore\n\n      if (returnResponse && returnResponse.isAdapterError) {\n        return Ember.RSVP.reject(returnResponse);\n      } else {\n        return returnResponse;\n      }\n    },\n\n    /**\n     * Allows for the error to be selected from either the\n     * response object, or the response data.\n     */\n    parseFetchResponseForError(response, payload) {\n      return payload || response.statusText;\n    },\n\n    /**\n     * @override\n     */\n    ajaxError(adapter, response, payload, requestData, error) {\n      if (error) {\n        return error;\n      } else {\n        const parsedResponse = adapter.parseFetchResponseForError(response, payload);\n        return adapter.handleResponse(response.status, headersToObject(response.headers), // TODO: parseErrorResponse is DS.RESTAdapter private API\n        // @ts-ignore\n        adapter.parseErrorResponse(parsedResponse) || payload, requestData);\n      }\n    }\n\n  });\n\n  _exports.default = _default;\n});","define(\"ember-fetch/types\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.isPlainObject = isPlainObject;\n\n  function isPlainObject(obj) {\n    return Object.prototype.toString.call(obj) === '[object Object]';\n  }\n});","define(\"ember-fetch/utils/determine-body-promise\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = determineBodyPromise;\n\n  /**\n   * Function that always attempts to parse the response as json, and if an error is thrown,\n   * returns `undefined` if the response is successful and has a status code of 204 (No Content),\n   * or 205 (Reset Content) or if the request method was 'HEAD', and the plain payload otherwise.\n   */\n  function determineBodyPromise(response, requestData) {\n    return response.text().then(function (payload) {\n      let ret = payload;\n\n      try {\n        ret = JSON.parse(payload);\n      } catch (error) {\n        if (!(error instanceof SyntaxError)) {\n          throw error;\n        }\n\n        const status = response.status;\n\n        if (response.ok && (status === 204 || status === 205 || requestData.method === 'HEAD')) {\n          ret = undefined;\n        } else {\n          console.warn('This response was unable to be parsed as json.', payload);\n        }\n      }\n\n      return ret;\n    });\n  }\n});","define(\"ember-fetch/utils/mung-options-for-fetch\", [\"exports\", \"ember-fetch/utils/serialize-query-params\", \"ember-fetch/types\"], function (_exports, _serializeQueryParams, _types) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = mungOptionsForFetch;\n\n  /**\n   * Helper function that translates the options passed to `jQuery.ajax` into a format that `fetch` expects.\n   */\n  function mungOptionsForFetch(options) {\n    const hash = Ember.assign({\n      credentials: 'same-origin'\n    }, options); // Default to 'GET' in case `type` is not passed in (mimics jQuery.ajax).\n\n    hash.method = (hash.method || hash.type || 'GET').toUpperCase();\n\n    if (hash.data) {\n      // GET and HEAD requests can't have a `body`\n      if (hash.method === 'GET' || hash.method === 'HEAD') {\n        // If no options are passed, Ember Data sets `data` to an empty object, which we test for.\n        if (Object.keys(hash.data).length) {\n          // Test if there are already query params in the url (mimics jQuey.ajax).\n          const queryParamDelimiter = hash.url.indexOf('?') > -1 ? '&' : '?';\n          hash.url += `${queryParamDelimiter}${(0, _serializeQueryParams.serializeQueryParams)(hash.data)}`;\n        }\n      } else {\n        // NOTE: a request's body cannot be a POJO, so we stringify it if it is.\n        // JSON.stringify removes keys with values of `undefined` (mimics jQuery.ajax).\n        // If the data is not a POJO (it's a String, FormData, etc), we just set it.\n        // If the data is a string, we assume it's a stringified object.\n        if ((0, _types.isPlainObject)(hash.data)) {\n          hash.body = JSON.stringify(hash.data);\n        } else {\n          hash.body = hash.data;\n        }\n      }\n    }\n\n    return hash;\n  }\n});","define(\"ember-fetch/utils/serialize-query-params\", [\"exports\", \"ember-fetch/types\"], function (_exports, _types) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.serializeQueryParams = serializeQueryParams;\n  _exports.default = void 0;\n  const RBRACKET = /\\[\\]$/;\n  /**\n   * Helper function that turns the data/body of a request into a query param string.\n   * This is directly copied from jQuery.param.\n   */\n\n  function serializeQueryParams(queryParamsObject) {\n    var s = [];\n\n    function buildParams(prefix, obj) {\n      var i, len, key;\n\n      if (prefix) {\n        if (Array.isArray(obj)) {\n          for (i = 0, len = obj.length; i < len; i++) {\n            if (RBRACKET.test(prefix)) {\n              add(s, prefix, obj[i]);\n            } else {\n              buildParams(prefix + '[' + (typeof obj[i] === 'object' ? i : '') + ']', obj[i]);\n            }\n          }\n        } else if ((0, _types.isPlainObject)(obj)) {\n          for (key in obj) {\n            buildParams(prefix + '[' + key + ']', obj[key]);\n          }\n        } else {\n          add(s, prefix, obj);\n        }\n      } else if (Array.isArray(obj)) {\n        for (i = 0, len = obj.length; i < len; i++) {\n          add(s, obj[i].name, obj[i].value);\n        }\n      } else {\n        for (key in obj) {\n          buildParams(key, obj[key]);\n        }\n      }\n\n      return s;\n    }\n\n    return buildParams('', queryParamsObject).join('&').replace(/%20/g, '+');\n  }\n  /**\n   * Part of the `serializeQueryParams` helper function.\n   */\n\n\n  function add(s, k, v) {\n    // Strip out keys with undefined value and replace null values with\n    // empty strings (mimics jQuery.ajax)\n    if (v === undefined) {\n      return;\n    } else if (v === null) {\n      v = '';\n    }\n\n    v = typeof v === 'function' ? v() : v;\n    s[s.length] = `${encodeURIComponent(k)}=${encodeURIComponent(v)}`;\n  }\n\n  var _default = serializeQueryParams;\n  _exports.default = _default;\n});","define('ember-inflector/index', ['exports', 'ember-inflector/lib/system', 'ember-inflector/lib/ext/string'], function (exports, _system) {\n  'use strict';\n\n  Object.defineProperty(exports, \"__esModule\", {\n    value: true\n  });\n  exports.defaultRules = exports.singularize = exports.pluralize = undefined;\n\n\n  _system.Inflector.defaultRules = _system.defaultRules;\n\n  Object.defineProperty(Ember, 'Inflector', {\n    get() {\n      Ember.deprecate(`Ember.Inflector is deprecated. Please explicitly: import Inflector from 'ember-inflector';`, false, {\n        id: 'ember-inflector.globals',\n        until: '3.0.0'\n      });\n\n      return _system.Inflector;\n    }\n  }, { configurable: true });\n\n  Object.defineProperty(Ember.String, 'singularize', {\n    get() {\n      Ember.deprecate(`Ember.String.singularize() is deprecated. Please explicitly: import { singularize } from 'ember-inflector';`, false, {\n        id: 'ember-inflector.globals',\n        until: '3.0.0'\n      });\n\n      return _system.singularize;\n    }\n  }, { configurable: true });\n\n  Object.defineProperty(Ember.String, 'pluralize', {\n    get() {\n      Ember.deprecate(`Ember.String.pluralize() is deprecated. Please explicitly: import { pluralize } from 'ember-inflector';`, false, {\n        id: 'ember-inflector.globals',\n        until: '3.0.0'\n      });\n\n      return _system.pluralize;\n    }\n  }, { configurable: true });\n\n  exports.default = _system.Inflector;\n  exports.pluralize = _system.pluralize;\n  exports.singularize = _system.singularize;\n  exports.defaultRules = _system.defaultRules;\n});","define('ember-inflector/lib/ext/string', ['ember-inflector/lib/system/string'], function (_string) {\n  'use strict';\n\n  if (Ember.ENV.EXTEND_PROTOTYPES === true || Ember.ENV.EXTEND_PROTOTYPES.String) {\n    /**\n      See {{#crossLink \"Ember.String/pluralize\"}}{{/crossLink}}\n       @method pluralize\n      @for String\n    */\n    Object.defineProperty(String.prototype, 'pluralize', {\n      get() {\n        Ember.deprecate(`String.prototype.pluralize() is deprecated. Please explicitly: import { pluralize } from 'ember-inflector';`, false, {\n          id: 'ember-inflector.globals',\n          until: '3.0.0'\n        });\n\n        return function () {\n          return (0, _string.pluralize)(this);\n        };\n      }\n    }, { configurable: true });\n\n    /**\n      See {{#crossLink \"Ember.String/singularize\"}}{{/crossLink}}\n       @method singularize\n      @for String\n    */\n    Object.defineProperty(String.prototype, 'singularize', {\n      get() {\n        Ember.deprecate(`String.prototype.singularize() is deprecated. Please explicitly: import { singularize } from 'ember-inflector';`, false, {\n          id: 'ember-inflector.globals',\n          until: '3.0.0'\n        });\n\n        return function () {\n          return (0, _string.singularize)(this);\n        };\n      }\n    }, { configurable: true });\n  }\n});","define('ember-inflector/lib/helpers/pluralize', ['exports', 'ember-inflector', 'ember-inflector/lib/utils/make-helper'], function (exports, _emberInflector, _makeHelper) {\n  'use strict';\n\n  Object.defineProperty(exports, \"__esModule\", {\n    value: true\n  });\n  exports.default = (0, _makeHelper.default)(function (params, hash) {\n    let fullParams = new Array(...params);\n\n    if (fullParams.length === 2) {\n      fullParams.push({ withoutCount: hash[\"without-count\"] });\n    }\n\n    return (0, _emberInflector.pluralize)(...fullParams);\n  });\n});","define('ember-inflector/lib/helpers/singularize', ['exports', 'ember-inflector', 'ember-inflector/lib/utils/make-helper'], function (exports, _emberInflector, _makeHelper) {\n  'use strict';\n\n  Object.defineProperty(exports, \"__esModule\", {\n    value: true\n  });\n  exports.default = (0, _makeHelper.default)(function (params) {\n    return (0, _emberInflector.singularize)(params[0]);\n  });\n});","define(\"ember-inflector/lib/system\", [\"exports\", \"ember-inflector/lib/system/inflector\", \"ember-inflector/lib/system/string\", \"ember-inflector/lib/system/inflections\"], function (exports, _inflector, _string, _inflections) {\n  \"use strict\";\n\n  Object.defineProperty(exports, \"__esModule\", {\n    value: true\n  });\n  exports.defaultRules = exports.pluralize = exports.singularize = exports.Inflector = undefined;\n\n\n  _inflector.default.inflector = new _inflector.default(_inflections.default);\n\n  exports.Inflector = _inflector.default;\n  exports.singularize = _string.singularize;\n  exports.pluralize = _string.pluralize;\n  exports.defaultRules = _inflections.default;\n});","define('ember-inflector/lib/system/inflections', ['exports'], function (exports) {\n  'use strict';\n\n  Object.defineProperty(exports, \"__esModule\", {\n    value: true\n  });\n  exports.default = {\n    plurals: [[/$/, 's'], [/s$/i, 's'], [/^(ax|test)is$/i, '$1es'], [/(octop|vir)us$/i, '$1i'], [/(octop|vir)i$/i, '$1i'], [/(alias|status|bonus)$/i, '$1es'], [/(bu)s$/i, '$1ses'], [/(buffal|tomat)o$/i, '$1oes'], [/([ti])um$/i, '$1a'], [/([ti])a$/i, '$1a'], [/sis$/i, 'ses'], [/(?:([^f])fe|([lr])f)$/i, '$1$2ves'], [/(hive)$/i, '$1s'], [/([^aeiouy]|qu)y$/i, '$1ies'], [/(x|ch|ss|sh)$/i, '$1es'], [/(matr|vert|ind)(?:ix|ex)$/i, '$1ices'], [/^(m|l)ouse$/i, '$1ice'], [/^(m|l)ice$/i, '$1ice'], [/^(ox)$/i, '$1en'], [/^(oxen)$/i, '$1'], [/(quiz)$/i, '$1zes']],\n\n    singular: [[/s$/i, ''], [/(ss)$/i, '$1'], [/(n)ews$/i, '$1ews'], [/([ti])a$/i, '$1um'], [/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)(sis|ses)$/i, '$1sis'], [/(^analy)(sis|ses)$/i, '$1sis'], [/([^f])ves$/i, '$1fe'], [/(hive)s$/i, '$1'], [/(tive)s$/i, '$1'], [/([lr])ves$/i, '$1f'], [/([^aeiouy]|qu)ies$/i, '$1y'], [/(s)eries$/i, '$1eries'], [/(m)ovies$/i, '$1ovie'], [/(x|ch|ss|sh)es$/i, '$1'], [/^(m|l)ice$/i, '$1ouse'], [/(bus)(es)?$/i, '$1'], [/(o)es$/i, '$1'], [/(shoe)s$/i, '$1'], [/(cris|test)(is|es)$/i, '$1is'], [/^(a)x[ie]s$/i, '$1xis'], [/(octop|vir)(us|i)$/i, '$1us'], [/(alias|status|bonus)(es)?$/i, '$1'], [/^(ox)en/i, '$1'], [/(vert|ind)ices$/i, '$1ex'], [/(matr)ices$/i, '$1ix'], [/(quiz)zes$/i, '$1'], [/(database)s$/i, '$1']],\n\n    irregularPairs: [['person', 'people'], ['man', 'men'], ['child', 'children'], ['sex', 'sexes'], ['move', 'moves'], ['cow', 'kine'], ['zombie', 'zombies']],\n\n    uncountable: ['equipment', 'information', 'rice', 'money', 'species', 'series', 'fish', 'sheep', 'jeans', 'police']\n  };\n});","define('ember-inflector/lib/system/inflector', ['exports'], function (exports) {\n  'use strict';\n\n  Object.defineProperty(exports, \"__esModule\", {\n    value: true\n  });\n\n\n  const BLANK_REGEX = /^\\s*$/;\n  const LAST_WORD_DASHED_REGEX = /([\\w/-]+[_/\\s-])([a-z\\d]+$)/;\n  const LAST_WORD_CAMELIZED_REGEX = /([\\w/\\s-]+)([A-Z][a-z\\d]*$)/;\n  const CAMELIZED_REGEX = /[A-Z][a-z\\d]*$/;\n\n  function loadUncountable(rules, uncountable) {\n    for (let i = 0, length = uncountable.length; i < length; i++) {\n      rules.uncountable[uncountable[i].toLowerCase()] = true;\n    }\n  }\n\n  function loadIrregular(rules, irregularPairs) {\n    let pair;\n\n    for (let i = 0, length = irregularPairs.length; i < length; i++) {\n      pair = irregularPairs[i];\n\n      //pluralizing\n      rules.irregular[pair[0].toLowerCase()] = pair[1];\n      rules.irregular[pair[1].toLowerCase()] = pair[1];\n\n      //singularizing\n      rules.irregularInverse[pair[1].toLowerCase()] = pair[0];\n      rules.irregularInverse[pair[0].toLowerCase()] = pair[0];\n    }\n  }\n\n  /**\n    Inflector.Ember provides a mechanism for supplying inflection rules for your\n    application. Ember includes a default set of inflection rules, and provides an\n    API for providing additional rules.\n  \n    Examples:\n  \n    Creating an inflector with no rules.\n  \n    ```js\n    var inflector = new Ember.Inflector();\n    ```\n  \n    Creating an inflector with the default ember ruleset.\n  \n    ```js\n    var inflector = new Ember.Inflector(Ember.Inflector.defaultRules);\n  \n    inflector.pluralize('cow'); //=> 'kine'\n    inflector.singularize('kine'); //=> 'cow'\n    ```\n  \n    Creating an inflector and adding rules later.\n  \n    ```javascript\n    var inflector = Ember.Inflector.inflector;\n  \n    inflector.pluralize('advice'); // => 'advices'\n    inflector.uncountable('advice');\n    inflector.pluralize('advice'); // => 'advice'\n  \n    inflector.pluralize('formula'); // => 'formulas'\n    inflector.irregular('formula', 'formulae');\n    inflector.pluralize('formula'); // => 'formulae'\n  \n    // you would not need to add these as they are the default rules\n    inflector.plural(/$/, 's');\n    inflector.singular(/s$/i, '');\n    ```\n  \n    Creating an inflector with a nondefault ruleset.\n  \n    ```javascript\n    var rules = {\n      plurals:  [\n        [ /$/, 's' ]\n      ],\n      singular: [\n        [ /\\s$/, '' ]\n      ],\n      irregularPairs: [\n        [ 'cow', 'kine' ]\n      ],\n      uncountable: [ 'fish' ]\n    };\n  \n    var inflector = new Ember.Inflector(rules);\n    ```\n  \n    @class Inflector\n    @namespace Ember\n  */\n  function Inflector(ruleSet) {\n    ruleSet = ruleSet || {};\n    ruleSet.uncountable = ruleSet.uncountable || makeDictionary();\n    ruleSet.irregularPairs = ruleSet.irregularPairs || makeDictionary();\n\n    const rules = this.rules = {\n      plurals: ruleSet.plurals || [],\n      singular: ruleSet.singular || [],\n      irregular: makeDictionary(),\n      irregularInverse: makeDictionary(),\n      uncountable: makeDictionary()\n    };\n\n    loadUncountable(rules, ruleSet.uncountable);\n    loadIrregular(rules, ruleSet.irregularPairs);\n\n    this.enableCache();\n  }\n\n  if (!Object.create && !Object.create(null).hasOwnProperty) {\n    throw new Error(\"This browser does not support Object.create(null), please polyfil with es5-sham: http://git.io/yBU2rg\");\n  }\n\n  function makeDictionary() {\n    var cache = Object.create(null);\n    cache['_dict'] = null;\n    delete cache['_dict'];\n    return cache;\n  }\n\n  Inflector.prototype = {\n    /**\n      @public\n       As inflections can be costly, and commonly the same subset of words are repeatedly\n      inflected an optional cache is provided.\n       @method enableCache\n    */\n    enableCache() {\n      this.purgeCache();\n\n      this.singularize = function (word) {\n        this._cacheUsed = true;\n        return this._sCache[word] || (this._sCache[word] = this._singularize(word));\n      };\n\n      this.pluralize = function (numberOrWord, word, options = {}) {\n        this._cacheUsed = true;\n        var cacheKey = [numberOrWord, word, options.withoutCount];\n        return this._pCache[cacheKey] || (this._pCache[cacheKey] = this._pluralize(numberOrWord, word, options));\n      };\n    },\n\n    /**\n      @public\n       @method purgedCache\n    */\n    purgeCache() {\n      this._cacheUsed = false;\n      this._sCache = makeDictionary();\n      this._pCache = makeDictionary();\n    },\n\n    /**\n      @public\n      disable caching\n       @method disableCache;\n    */\n    disableCache() {\n      this._sCache = null;\n      this._pCache = null;\n      this.singularize = function (word) {\n        return this._singularize(word);\n      };\n\n      this.pluralize = function () {\n        return this._pluralize(...arguments);\n      };\n    },\n\n    /**\n      @method plural\n      @param {RegExp} regex\n      @param {String} string\n    */\n    plural(regex, string) {\n      if (this._cacheUsed) {\n        this.purgeCache();\n      }\n      this.rules.plurals.push([regex, string.toLowerCase()]);\n    },\n\n    /**\n      @method singular\n      @param {RegExp} regex\n      @param {String} string\n    */\n    singular(regex, string) {\n      if (this._cacheUsed) {\n        this.purgeCache();\n      }\n      this.rules.singular.push([regex, string.toLowerCase()]);\n    },\n\n    /**\n      @method uncountable\n      @param {String} regex\n    */\n    uncountable(string) {\n      if (this._cacheUsed) {\n        this.purgeCache();\n      }\n      loadUncountable(this.rules, [string.toLowerCase()]);\n    },\n\n    /**\n      @method irregular\n      @param {String} singular\n      @param {String} plural\n    */\n    irregular(singular, plural) {\n      if (this._cacheUsed) {\n        this.purgeCache();\n      }\n      loadIrregular(this.rules, [[singular, plural]]);\n    },\n\n    /**\n      @method pluralize\n      @param {String} word\n    */\n    pluralize() {\n      return this._pluralize(...arguments);\n    },\n\n    _pluralize(wordOrCount, word, options = {}) {\n      if (word === undefined) {\n        return this.inflect(wordOrCount, this.rules.plurals, this.rules.irregular);\n      }\n\n      if (parseFloat(wordOrCount) !== 1) {\n        word = this.inflect(word, this.rules.plurals, this.rules.irregular);\n      }\n\n      return options.withoutCount ? word : `${wordOrCount} ${word}`;\n    },\n    /**\n      @method singularize\n      @param {String} word\n    */\n    singularize(word) {\n      return this._singularize(word);\n    },\n\n    _singularize(word) {\n      return this.inflect(word, this.rules.singular, this.rules.irregularInverse);\n    },\n\n    /**\n      @protected\n       @method inflect\n      @param {String} word\n      @param {Object} typeRules\n      @param {Object} irregular\n    */\n    inflect(word, typeRules, irregular) {\n      let inflection, substitution, result, lowercase, wordSplit, lastWord, isBlank, isCamelized, rule, isUncountable;\n\n      isBlank = !word || BLANK_REGEX.test(word);\n      isCamelized = CAMELIZED_REGEX.test(word);\n\n      if (isBlank) {\n        return word;\n      }\n\n      lowercase = word.toLowerCase();\n      wordSplit = LAST_WORD_DASHED_REGEX.exec(word) || LAST_WORD_CAMELIZED_REGEX.exec(word);\n\n      if (wordSplit) {\n        lastWord = wordSplit[2].toLowerCase();\n      }\n\n      isUncountable = this.rules.uncountable[lowercase] || this.rules.uncountable[lastWord];\n\n      if (isUncountable) {\n        return word;\n      }\n\n      for (rule in irregular) {\n        if (lowercase.match(rule + \"$\")) {\n          substitution = irregular[rule];\n\n          if (isCamelized && irregular[lastWord]) {\n            substitution = Ember.String.capitalize(substitution);\n            rule = Ember.String.capitalize(rule);\n          }\n\n          return word.replace(new RegExp(rule, 'i'), substitution);\n        }\n      }\n\n      for (var i = typeRules.length, min = 0; i > min; i--) {\n        inflection = typeRules[i - 1];\n        rule = inflection[0];\n\n        if (rule.test(word)) {\n          break;\n        }\n      }\n\n      inflection = inflection || [];\n\n      rule = inflection[0];\n      substitution = inflection[1];\n\n      result = word.replace(rule, substitution);\n\n      return result;\n    }\n  };\n\n  exports.default = Inflector;\n});","define('ember-inflector/lib/system/string', ['exports', 'ember-inflector/lib/system/inflector'], function (exports, _inflector) {\n  'use strict';\n\n  Object.defineProperty(exports, \"__esModule\", {\n    value: true\n  });\n  exports.singularize = exports.pluralize = undefined;\n\n\n  function pluralize() {\n    return _inflector.default.inflector.pluralize(...arguments);\n  }\n\n  function singularize(word) {\n    return _inflector.default.inflector.singularize(word);\n  }\n\n  exports.pluralize = pluralize;\n  exports.singularize = singularize;\n});","define('ember-inflector/lib/utils/make-helper', ['exports'], function (exports) {\n  'use strict';\n\n  Object.defineProperty(exports, \"__esModule\", {\n    value: true\n  });\n  exports.default = makeHelper;\n  function makeHelper(helperFunction) {\n    if (Ember.Helper) {\n      return Ember.Helper.helper(helperFunction);\n    }\n    if (Ember.HTMLBars) {\n      return Ember.HTMLBars.makeBoundHelper(helperFunction);\n    }\n    return Ember.Handlebars.makeBoundHelper(helperFunction);\n  }\n});","define(\"ember-intl/-private/empty-object\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  const proto = Object.create(null, {\n    constructor: {\n      value: undefined,\n      enumerable: false,\n      writable: true\n    }\n  });\n\n  function EmptyObject() {}\n\n  EmptyObject.prototype = proto;\n  /**\n   * @private\n   * @hide\n   */\n\n  var _default = EmptyObject;\n  _exports.default = _default;\n});","define(\"ember-intl/-private/formatters/-base\", [\"exports\", \"ember-intl/utils/links\"], function (_exports, _links) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n   * Copyright 2015, Yahoo! Inc.\n   * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n   */\n  const EMPTY_OBJECT = {};\n  /**\n   * @private\n   * @hide\n   */\n\n  class FormatterBase {\n    get options() {\n      return Ember.A();\n    }\n    /**\n     * Filters out all of the whitelisted formatter options\n     *\n     * @method readOptions\n     * @param {Object} Options object\n     * @return {Object} Options object containing just whitelisted options\n     * @private\n     */\n\n\n    readOptions(options) {\n      if (!options) {\n        return EMPTY_OBJECT;\n      }\n\n      let found = {};\n\n      for (let key in options) {\n        let normalized = Ember.String.camelize(key);\n\n        if (this.options.includes(normalized)) {\n          found[normalized] = options[key];\n        }\n      }\n\n      return found;\n    }\n\n    format() {\n      throw new Error('not implemented');\n    }\n    /**\n     * Invokes the Intl formatter methods\n     *\n     * @method _format\n     * @param {value} Raw input value that needs formatting\n     * @return {Object} Formatter options hash\n     * @return {Object} Format options hash\n     * @private\n     */\n\n\n    _format(value, formatterOptions, formatOptions, {\n      locale\n    }) {\n      if (!locale) {\n        (true && Ember.warn(`[ember-intl] no locale has been set. Documentation: ${_links.default.unsetLocale}`, false, {\n          id: 'ember-intl-no-locale-set'\n        }));\n      }\n\n      const formatter = this.createNativeFormatter(locale, formatterOptions);\n      return formatter.format(value, formatOptions);\n    }\n\n  }\n\n  _exports.default = FormatterBase;\n});","define(\"ember-intl/-private/formatters/format-date\", [\"exports\", \"fast-memoize\", \"ember-intl/-private/formatters/-base\"], function (_exports, _fastMemoize, _base) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n   * @private\n   * @hide\n   */\n  class FormatDate extends _base.default {\n    constructor() {\n      super();\n      this.createNativeFormatter = (0, _fastMemoize.default)((locales, options) => {\n        return new Intl.DateTimeFormat(locales, options);\n      });\n    }\n\n    get options() {\n      return Ember.A(['locale', 'format', 'localeMatcher', 'timeZone', 'hour12', 'formatMatcher', 'weekday', 'era', 'year', 'month', 'day', 'hour', 'minute', 'second', 'timeZoneName']);\n    }\n\n    format(value, options, ctx) {\n      const dateTime = new Date(value);\n      const formatOptions = this.readOptions(options);\n      return this._format(dateTime, formatOptions, undefined, ctx);\n    }\n\n  }\n\n  _exports.default = FormatDate;\n});","define(\"ember-intl/-private/formatters/format-message\", [\"exports\", \"fast-memoize\", \"@ember-intl/intl-messageformat\", \"ember-intl/-private/formatters/-base\"], function (_exports, _fastMemoize, _intlMessageformat, _base) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  const {\n    keys\n  } = Object;\n  const {\n    Handlebars: {\n      Utils: {\n        escapeExpression\n      }\n    }\n  } = Ember;\n\n  function escape(hash) {\n    if (!hash) {\n      return;\n    }\n\n    return keys(hash).reduce((accum, key) => {\n      if (typeof hash[key] === 'string') {\n        accum[key] = escapeExpression(hash[key]);\n      }\n\n      return accum;\n    }, Ember.assign({}, hash));\n  }\n  /**\n   * @private\n   * @hide\n   */\n\n\n  class FormatMessage extends _base.default {\n    constructor() {\n      super();\n      this.createNativeFormatter = (0, _fastMemoize.default)((message, locales, formats) => {\n        return new _intlMessageformat.default(message, locales, formats);\n      });\n    }\n\n    format(message, options, {\n      formats,\n      locale\n    }) {\n      const isHTMLSafe = options && options.htmlSafe;\n      const formatter = this.createNativeFormatter(message, locale, formats);\n      const escapedOptions = isHTMLSafe ? escape(options) : options;\n      const result = formatter.format(escapedOptions);\n      return isHTMLSafe ? Ember.String.htmlSafe(result) : result;\n    }\n\n  }\n\n  _exports.default = FormatMessage;\n});","define(\"ember-intl/-private/formatters/format-number\", [\"exports\", \"fast-memoize\", \"ember-intl/-private/formatters/-base\"], function (_exports, _fastMemoize, _base) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n   * Copyright 2015, Yahoo! Inc.\n   * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n   */\n\n  /**\n   * @private\n   * @hide\n   */\n  class FormatNumber extends _base.default {\n    get options() {\n      return Ember.A(['locale', 'format', 'localeMatcher', 'style', 'currency', 'currencyDisplay', 'useGrouping', 'minimumIntegerDigits', 'minimumFractionDigits', 'maximumFractionDigits', 'minimumSignificantDigits', 'maximumSignificantDigits']);\n    }\n\n    constructor() {\n      super();\n      this.createNativeFormatter = (0, _fastMemoize.default)((locales, options) => {\n        return new Intl.NumberFormat(locales, options);\n      });\n    }\n\n    format(value, options, ctx) {\n      return this._format(value, this.readOptions(options), undefined, ctx);\n    }\n\n  }\n\n  _exports.default = FormatNumber;\n});","define(\"ember-intl/-private/formatters/format-relative\", [\"exports\", \"fast-memoize\", \"@ember-intl/intl-relativeformat\", \"ember-intl/-private/formatters/-base\"], function (_exports, _fastMemoize, _intlRelativeformat, _base) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n   * Copyright 2015, Yahoo! Inc.\n   * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n   */\n\n  /**\n   * @private\n   * @hide\n   */\n  class FormatRelative extends _base.default {\n    constructor() {\n      super();\n      this.createNativeFormatter = (0, _fastMemoize.default)((locales, options) => {\n        return new _intlRelativeformat.default(locales, options);\n      });\n    }\n\n    get options() {\n      return Ember.A(['locale', 'format', 'style', 'units']);\n    }\n\n    format(value, options, ctx) {\n      let dateValue = new Date(value);\n      let formatOptions;\n\n      if (options && typeof options.now !== 'undefined') {\n        formatOptions = {\n          now: options.now\n        };\n      }\n\n      return this._format(dateValue, this.readOptions(options), formatOptions, ctx);\n    }\n\n  }\n\n  _exports.default = FormatRelative;\n});","define(\"ember-intl/-private/formatters/format-time\", [\"exports\", \"ember-intl/-private/formatters/format-date\"], function (_exports, _formatDate) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n   * Copyright 2015, Yahoo! Inc.\n   * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n   */\n\n  /**\n   * @private\n   * @hide\n   */\n  class FormatTime extends _formatDate.default {}\n\n  _exports.default = FormatTime;\n});","define(\"ember-intl/-private/formatters/index\", [\"exports\", \"ember-intl/-private/formatters/format-time\", \"ember-intl/-private/formatters/format-date\", \"ember-intl/-private/formatters/format-number\", \"ember-intl/-private/formatters/format-message\", \"ember-intl/-private/formatters/format-relative\"], function (_exports, _formatTime, _formatDate, _formatNumber, _formatMessage, _formatRelative) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"FormatTime\", {\n    enumerable: true,\n    get: function () {\n      return _formatTime.default;\n    }\n  });\n  Object.defineProperty(_exports, \"FormatDate\", {\n    enumerable: true,\n    get: function () {\n      return _formatDate.default;\n    }\n  });\n  Object.defineProperty(_exports, \"FormatNumber\", {\n    enumerable: true,\n    get: function () {\n      return _formatNumber.default;\n    }\n  });\n  Object.defineProperty(_exports, \"FormatMessage\", {\n    enumerable: true,\n    get: function () {\n      return _formatMessage.default;\n    }\n  });\n  Object.defineProperty(_exports, \"FormatRelative\", {\n    enumerable: true,\n    get: function () {\n      return _formatRelative.default;\n    }\n  });\n});","define(\"ember-intl/-private/is-array-equal\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = _default;\n\n  /**\n   * @private\n   * @hide\n   */\n  function _default(a, b) {\n    if (!Ember.isArray(a) || !Ember.isArray(b)) {\n      return false;\n    }\n\n    if (a === b) {\n      return true;\n    }\n\n    return a.toString() === b.toString();\n  }\n});","define(\"ember-intl/-private/normalize-locale\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = _default;\n\n  /**\n   * @private\n   * @hide\n   */\n  function _default(localeName) {\n    if (typeof localeName === 'string') {\n      return localeName.replace(/_/g, '-').toLowerCase();\n    }\n  }\n});","define(\"ember-intl/adapters/default\", [\"exports\", \"ember-intl/models/translation\"], function (_exports, _translation) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  var _default = Ember.Object.extend({\n    _seen: null,\n\n    /** @private **/\n    locales: Ember.computed('_seen.[]', function () {\n      return Ember.get(this, '_seen').map(l => l.localeName);\n    }).readOnly(),\n\n    /** @private **/\n    init() {\n      this._super();\n\n      this._seen = Ember.A();\n    },\n\n    /** @private **/\n    lookupLocale(localeName) {\n      return this._seen.findBy('localeName', localeName);\n    },\n\n    /** @private **/\n    localeFactory(localeName) {\n      const owner = Ember.getOwner(this);\n      const lookupName = `ember-intl@translation:${localeName}`;\n      let model = owner.lookup(lookupName);\n\n      if (model) {\n        return model;\n      }\n\n      let Klass;\n\n      if (owner.hasRegistration('model:ember-intl-translation')) {\n        Klass = owner.factoryFor('model:ember-intl-translation').class;\n      } else {\n        Klass = _translation.default;\n      }\n\n      const ModelKlass = Klass.extend();\n      Object.defineProperty(ModelKlass.proto(), 'localeName', {\n        writable: false,\n        enumerable: true,\n        value: localeName\n      });\n      owner.register(lookupName, ModelKlass);\n      model = owner.lookup(lookupName);\n\n      this._seen.pushObject(model);\n\n      return model;\n    },\n\n    /** @private **/\n    has(localeName, translationKey) {\n      const model = this.lookupLocale(localeName);\n      return model && model.has(translationKey);\n    },\n\n    /** @private **/\n    lookup(localeName, translationKey) {\n      const model = this.lookupLocale(localeName);\n\n      if (model && model.has(translationKey)) {\n        return model.getValue(translationKey);\n      }\n    }\n\n  });\n\n  _exports.default = _default;\n});","define(\"ember-intl/helpers/-format-base\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  const AbstractHelper = Ember.Helper.extend({\n    intl: null,\n\n    init() {\n      if (this.constructor === AbstractHelper) {\n        throw new Error('FormatHelper is an abstract class, can not be instantiated directly.');\n      }\n\n      this._super();\n\n      this.intl = Ember.getOwner(this).lookup('service:intl');\n      this.intl.on('localeChanged', this, this.recompute);\n    },\n\n    format() {\n      throw new Error('not implemented');\n    },\n\n    compute([value], options) {\n      if (Ember.isEmpty(value)) {\n        if (Ember.getWithDefault(options, 'allowEmpty', this.allowEmpty)) {\n          return;\n        }\n\n        if (typeof value === 'undefined') {\n          throw new Error(`${this} helper requires value attribute.`);\n        }\n      }\n\n      return this.format(value, options);\n    },\n\n    willDestroy() {\n      this._super();\n\n      this.intl.off('localeChanged', this, this.recompute);\n    }\n\n  });\n  var _default = AbstractHelper;\n  _exports.default = _default;\n});","define(\"ember-intl/helpers/format-date\", [\"exports\", \"ember-intl/helpers/-format-base\"], function (_exports, _formatBase) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n   * Copyright 2015, Yahoo! Inc.\n   * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n   */\n  var _default = _formatBase.default.extend({\n    allowEmpty: true,\n\n    format(value, options) {\n      return this.intl.formatDate(value, options);\n    }\n\n  });\n\n  _exports.default = _default;\n});","define(\"ember-intl/helpers/format-message\", [\"exports\", \"ember-intl/helpers/-format-base\"], function (_exports, _formatBase) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n   * Copyright 2015, Yahoo! Inc.\n   * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n   */\n  var _default = _formatBase.default.extend({\n    format(value, options) {\n      return this.intl.formatMessage(value, options);\n    }\n\n  });\n\n  _exports.default = _default;\n});","define(\"ember-intl/helpers/format-number\", [\"exports\", \"ember-intl/helpers/-format-base\"], function (_exports, _formatBase) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n   * Copyright 2015, Yahoo! Inc.\n   * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n   */\n  var _default = _formatBase.default.extend({\n    format(value, options) {\n      return this.intl.formatNumber(value, options);\n    }\n\n  });\n\n  _exports.default = _default;\n});","define(\"ember-intl/helpers/format-relative\", [\"exports\", \"ember-intl/helpers/-format-base\"], function (_exports, _formatBase) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  const runBind = Ember.run.bind;\n\n  var _default = _formatBase.default.extend({\n    format(params, hash) {\n      return this.intl.formatRelative(params, hash);\n    },\n\n    compute(params, hash) {\n      this.clearTimer();\n\n      if (hash && typeof hash.interval !== 'undefined') {\n        /* setTimeout versus Ember.run.later so tests will not wait infinitely */\n        this.timer = setTimeout(runBind(this, this.recompute), parseInt(hash.interval, 10));\n      }\n\n      return this._super(params, hash);\n    },\n\n    clearTimer() {\n      clearTimeout(this.timer);\n    },\n\n    willDestroy() {\n      this._super();\n\n      this.clearTimer();\n    }\n\n  });\n\n  _exports.default = _default;\n});","define(\"ember-intl/helpers/format-time\", [\"exports\", \"ember-intl/helpers/-format-base\"], function (_exports, _formatBase) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n   * Copyright 2015, Yahoo! Inc.\n   * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n   */\n  var _default = _formatBase.default.extend({\n    format(value, options) {\n      return this.intl.formatTime(value, options);\n    }\n\n  });\n\n  _exports.default = _default;\n});","define(\"ember-intl/helpers/t\", [\"exports\", \"ember-intl/helpers/-format-base\"], function (_exports, _formatBase) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n   * Copyright 2015, Yahoo! Inc.\n   * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n   */\n  var _default = _formatBase.default.extend({\n    format(key, options) {\n      (true && !(key) && Ember.assert('[ember-intl] translation lookup attempted but no translation key was provided.', key));\n      return this.intl.t(key, options);\n    }\n\n  });\n\n  _exports.default = _default;\n});","define(\"ember-intl/hydrate\", [\"exports\", \"ember-intl/utils/links\"], function (_exports, _links) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.lookupByFactoryType = lookupByFactoryType;\n  _exports.default = _default;\n\n  /* globals requirejs */\n\n  /**\n   * @private\n   * @hide\n   */\n  function lookupByFactoryType(type, modulePrefix) {\n    return Object.keys(requirejs.entries).filter(key => {\n      return key.indexOf(`${modulePrefix}/${type}/`) === 0;\n    });\n  }\n  /**\n   * Peeks into the requirejs map and registers all locale data (CLDR & Translations) found.\n   *\n   * @private\n   * @hide\n   */\n\n\n  function _default(service, owner) {\n    const config = owner.resolveRegistration('config:environment');\n    const cldrs = lookupByFactoryType('cldrs', config.modulePrefix);\n    const translations = lookupByFactoryType('translations', config.modulePrefix);\n\n    if (!cldrs.length) {\n      (true && Ember.warn(`[ember-intl] project is missing CLDR data\\nIf you are asynchronously loading translation,\n      see: ${_links.default.asyncTranslations}.`, false, {\n        id: 'ember-intl-missing-cldr-data'\n      }));\n    }\n\n    cldrs.map(moduleName => owner.resolveRegistration(`cldr:${moduleName.split('/').pop()}`)).forEach(data => data.forEach(service.addLocaleData));\n    translations.forEach(moduleName => {\n      const localeName = moduleName.split('/').pop();\n      service.addTranslations(localeName, owner.resolveRegistration(`translation:${localeName}`));\n    });\n  }\n});","define(\"ember-intl/index\", [\"exports\", \"ember-intl/services/intl\", \"ember-intl/macros\"], function (_exports, _intl, _macros) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  var _exportNames = {\n    translationMacro: true,\n    Service: true\n  };\n  _exports.translationMacro = translationMacro;\n  Object.defineProperty(_exports, \"Service\", {\n    enumerable: true,\n    get: function () {\n      return _intl.default;\n    }\n  });\n  Object.keys(_macros).forEach(function (key) {\n    if (key === \"default\" || key === \"__esModule\") return;\n    if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;\n    Object.defineProperty(_exports, key, {\n      enumerable: true,\n      get: function () {\n        return _macros[key];\n      }\n    });\n  });\n\n  function translationMacro(...args) {\n    (true && !(false) && Ember.deprecate(`ember-intl: 'translationMacro' was renamed to just 't'. Please update the import statement.`, false, {\n      id: 'ember-intl.translationMacro',\n      until: '5.0.0'\n    }));\n    return (0, _macros.t)(...args);\n  }\n});","define(\"ember-intl/macros/index\", [\"exports\", \"ember-intl/macros/intl\", \"ember-intl/macros/t\"], function (_exports, _intl, _t) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"intl\", {\n    enumerable: true,\n    get: function () {\n      return _intl.default;\n    }\n  });\n  Object.defineProperty(_exports, \"t\", {\n    enumerable: true,\n    get: function () {\n      return _t.default;\n    }\n  });\n  Object.defineProperty(_exports, \"raw\", {\n    enumerable: true,\n    get: function () {\n      return _t.raw;\n    }\n  });\n});","define(\"ember-intl/macros/intl\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = intl;\n  _exports.__intlInjectionName = void 0;\n\n  /**\n   * @private\n   * @hide\n   */\n  const __intlInjectionName = `intl-${Date.now().toString(36)}`;\n  _exports.__intlInjectionName = __intlInjectionName;\n\n  function intl(...dependentKeysAndGetterFn) {\n    const getterFn = dependentKeysAndGetterFn.pop();\n    const dependentKeys = dependentKeysAndGetterFn;\n    return Ember.computed(`${__intlInjectionName}.locale`, ...dependentKeys, function (propertyKey) {\n      if (!Ember.get(this, __intlInjectionName)) {\n        Ember.defineProperty(this, __intlInjectionName, {\n          value: Ember.getOwner(this).lookup('service:intl'),\n          enumerable: false\n        });\n      }\n\n      const intl = Ember.get(this, __intlInjectionName);\n      return getterFn.call(this, intl, propertyKey, this);\n    }).readOnly();\n  }\n});","define(\"ember-intl/macros/t\", [\"exports\", \"ember-intl/-private/empty-object\", \"ember-intl/macros/intl\"], function (_exports, _emptyObject, _intl) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.raw = raw;\n  _exports.default = createTranslatedComputedProperty;\n\n  function partitionDynamicValuesAndStaticValues(options) {\n    const dynamicValues = new _emptyObject.default();\n    const staticValues = new _emptyObject.default();\n    Object.keys(options).forEach(key => {\n      const value = options[key];\n\n      if (value instanceof Raw) {\n        staticValues[key] = value.valueOf();\n      } else {\n        dynamicValues[key] = value;\n      }\n    });\n    return [dynamicValues, staticValues];\n  }\n\n  function mapPropertiesByHash(object, hash) {\n    const result = new _emptyObject.default();\n    Object.keys(hash).forEach(key => {\n      result[key] = Ember.get(object, hash[key]);\n    });\n    return result;\n  }\n  /**\n   * This class is used to box primitive types and mark them as raw literals that\n   * should be used as is by the translation macro.\n   *\n   * This class is internal. Instead of using this class directly, use the `raw`\n   * utility function, that creates an instance of this class.\n   */\n\n\n  class Raw {\n    constructor(value) {\n      this._value = value;\n    }\n\n    valueOf() {\n      return this._value;\n    }\n\n    toString() {\n      return String(this._value);\n    }\n\n  }\n  /**\n   * Use this utility function to mark a value as a raw literal.\n   *\n   * @param {*} value The value to mark as a raw literal.\n   * @return The same value, but boxed in the `Raw` class so that the consuming\n   *  macro understands that this value should be used as is.\n   */\n\n\n  function raw(value) {\n    return new Raw(value);\n  }\n\n  function createTranslatedComputedProperty(translationKey, options) {\n    const hash = options || new _emptyObject.default();\n    const [dynamicValues, staticValues] = partitionDynamicValuesAndStaticValues(hash);\n    const dependentKeys = Object.values(dynamicValues);\n    return (0, _intl.default)(...dependentKeys, (intl, propertyKey, ctx) => intl.t(translationKey, Ember.assign({}, staticValues, mapPropertiesByHash(ctx, dynamicValues))));\n  }\n});","define(\"ember-intl/models/translation\", [\"exports\", \"ember-intl/-private/empty-object\"], function (_exports, _emptyObject) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  const hasOwnProperty = Object.prototype.hasOwnProperty;\n\n  function flatten(src) {\n    const result = new _emptyObject.default();\n\n    for (const key in src) {\n      if (!hasOwnProperty.call(src, key)) {\n        continue;\n      }\n\n      const value = src[key];\n\n      if (typeof value === 'object' && value) {\n        const hash = flatten(value);\n\n        for (const suffix in hash) {\n          result[`${key}.${suffix}`] = hash[suffix];\n        }\n      } else {\n        result[key] = value;\n      }\n    }\n\n    return result;\n  }\n\n  const TranslationModel = Ember.Object.extend({\n    localeName: null,\n\n    init() {\n      this._super();\n\n      if (!this.translations) {\n        this.translations = new _emptyObject.default();\n      }\n    },\n\n    /**\n     * Adds a translation hash\n     */\n    addTranslations(translations) {\n      Ember.assign(this.translations, flatten(translations));\n    },\n\n    /**\n     * Custom accessor hook that can be overridden.\n     * This would enable consumers that have dot notated strings\n     * to implement this function as `return this[key];`\n     */\n    getValue(key) {\n      return this.translations[key];\n    },\n\n    /**\n     * Determines if the translation model contains a key\n     */\n    has(key) {\n      return hasOwnProperty.call(this.translations, key);\n    }\n\n  });\n  var _default = TranslationModel;\n  _exports.default = _default;\n});","define(\"ember-intl/services/intl\", [\"exports\", \"@ember-intl/intl-relativeformat\", \"@ember-intl/intl-messageformat\", \"ember-intl/-private/formatters\", \"ember-intl/-private/is-array-equal\", \"ember-intl/-private/normalize-locale\", \"ember-intl/utils/links\", \"ember-intl/hydrate\", \"ember-intl/utils/get-dom\"], function (_exports, _intlRelativeformat, _intlMessageformat, _formatters, _isArrayEqual, _normalizeLocale, _links, _hydrate, _getDom) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n   * Copyright 2015, Yahoo! Inc.\n   * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n   */\n  var _default = Ember.Service.extend(Ember.Evented, {\n    /** @private **/\n    _locale: null,\n\n    /** @private **/\n    _adapter: null,\n\n    /** @public **/\n    formats: null,\n\n    /** @private **/\n    _timer: null,\n\n    /** @public **/\n    locale: Ember.computed({\n      set(_, localeName) {\n        const proposed = Ember.makeArray(localeName).map(_normalizeLocale.default);\n\n        if (!(0, _isArrayEqual.default)(proposed, this._locale)) {\n          this._locale = proposed;\n          Ember.run.cancel(this._timer);\n          this._timer = Ember.run.next(() => this.trigger('localeChanged'));\n          this.updateDocumentLanguage(this._locale);\n        }\n\n        return this._locale;\n      },\n\n      get() {\n        return this._locale;\n      }\n\n    }),\n\n    /**\n     * Returns the first locale of the currently active locales\n     *\n     * @property primaryLocale\n     * @public\n     */\n    primaryLocale: Ember.computed.readOnly('locale.0'),\n\n    /** @public **/\n    formatRelative: formatter('relative'),\n\n    /** @public **/\n    formatMessage: formatter('message'),\n\n    /** @public **/\n    formatNumber: formatter('number'),\n\n    /** @public **/\n    formatTime: formatter('time'),\n\n    /** @public **/\n    formatDate: formatter('date'),\n\n    /**\n     * Returns an array of registered locale names\n     *\n     * @property locales\n     * @public\n     */\n    locales: Ember.computed.readOnly('_adapter.locales'),\n\n    /** @public **/\n    init() {\n      this._super(...arguments);\n\n      if (typeof Intl === 'undefined') {\n        (true && Ember.warn(`[ember-intl] Intl API was not found.\\nSee: ${_links.default.polyfill}`, false, {\n          id: 'ember-intl-undefined-intljs'\n        }));\n      }\n\n      const initialLocale = Ember.get(this, 'locale') || ['en-us'];\n      this.setLocale(initialLocale);\n      this._owner = Ember.getOwner(this);\n      this._adapter = this._owner.lookup('ember-intl@adapter:default');\n      this._formatters = {\n        message: new _formatters.FormatMessage(),\n        relative: new _formatters.FormatRelative(),\n        number: new _formatters.FormatNumber(),\n        time: new _formatters.FormatTime(),\n        date: new _formatters.FormatDate()\n      };\n\n      if (!this.formats) {\n        this.formats = this._owner.resolveRegistration('formats:main') || {};\n      }\n\n      (0, _hydrate.default)(this, this._owner);\n    },\n\n    willDestroy() {\n      this._super(...arguments);\n\n      Ember.run.cancel(this._timer);\n    },\n\n    /** @public **/\n    lookup(key, localeName, options = {}) {\n      const localeNames = this.localeWithDefault(localeName);\n      let translation;\n\n      for (let i = 0; i < localeNames.length; i++) {\n        translation = this._adapter.lookup(localeNames[i], key);\n\n        if (translation !== undefined) {\n          break;\n        }\n      }\n\n      if (!options.resilient && translation === undefined) {\n        const missingMessage = this._owner.resolveRegistration('util:intl/missing-message');\n\n        return missingMessage.call(this, key, localeNames, options);\n      }\n\n      return translation;\n    },\n\n    /** @public **/\n    t(key, options = {}) {\n      let defaults = [key];\n      let msg;\n\n      if (options.default) {\n        defaults = defaults.concat(options.default);\n      }\n\n      while (!msg && defaults.length) {\n        msg = this.lookup(defaults.shift(), options.locale, Ember.assign({}, options, {\n          resilient: defaults.length > 0\n        }));\n      }\n      /* Avoids passing msg to intl-messageformat if it is not a string */\n\n\n      if (typeof msg === 'string') {\n        return this.formatMessage(msg, options);\n      }\n\n      return msg;\n    },\n\n    /** @public **/\n    exists(key, localeName) {\n      const localeNames = this.localeWithDefault(localeName);\n      (true && !(Array.isArray(localeNames) && localeNames.length) && Ember.assert(`[ember-intl] locale is unset, cannot lookup '${key}'`, Array.isArray(localeNames) && localeNames.length));\n      return localeNames.some(localeName => this._adapter.has(localeName, key));\n    },\n\n    /** @public */\n    setLocale(locale) {\n      Ember.set(this, 'locale', locale);\n    },\n\n    /**\n     * A utility method for registering CLDR data against\n     * intl-messageformat and intl-relativeformat.\n     *\n     * @method addLocaleData\n     * @param {Object} locale data\n     * @public\n     */\n    addLocaleData(data) {\n      _intlMessageformat.default.__addLocaleData(data);\n\n      _intlRelativeformat.default.__addLocaleData(data);\n    },\n\n    /** @public **/\n    addTranslations(localeName, payload) {\n      const locale = this.translationsFor(localeName);\n      return locale.addTranslations(payload);\n    },\n\n    /** @public **/\n    translationsFor(localeName) {\n      return this._adapter.localeFactory((0, _normalizeLocale.default)(localeName));\n    },\n\n    /** @private **/\n    getFormat(formatType, format) {\n      const formats = Ember.get(this, 'formats');\n\n      if (formats && formatType && typeof format === 'string') {\n        return Ember.get(formats, `${formatType}.${format}`);\n      }\n    },\n\n    /** @private **/\n    localeWithDefault(localeName) {\n      if (!localeName) {\n        return this._locale || [];\n      }\n\n      if (typeof localeName === 'string') {\n        return Ember.makeArray(localeName).map(_normalizeLocale.default);\n      }\n\n      if (Array.isArray(localeName)) {\n        return localeName.map(_normalizeLocale.default);\n      }\n    },\n\n    /** @private **/\n    updateDocumentLanguage(locales) {\n      const dom = (0, _getDom.default)(this);\n\n      if (dom) {\n        const [primaryLocale] = locales;\n        const html = dom.documentElement;\n        html.setAttribute('lang', primaryLocale);\n      }\n    }\n\n  });\n\n  _exports.default = _default;\n\n  function formatter(name) {\n    return function (value, options, formats) {\n      let formatOptions = options;\n\n      if (options && typeof options.format === 'string') {\n        formatOptions = Ember.assign({}, this.getFormat(name, formatOptions.format), formatOptions);\n      }\n\n      return this._formatters[name].format(value, formatOptions, {\n        formats: formats || this.formats,\n        locale: this.localeWithDefault(formatOptions && formatOptions.locale)\n      });\n    };\n  }\n});","define(\"ember-intl/utils/get-dom\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = getDOM;\n\n  // adjusted from https://github.com/yapplabs/ember-wormhole/blob/0.5.4/addon/utils/dom.js#L45-L63\n  //\n  // Private Ember API usage. Get the dom implementation used by the current\n  // renderer, be it native browser DOM or Fastboot SimpleDOM\n  function getDOM(context) {\n    let {\n      renderer\n    } = context;\n\n    if (!renderer || !renderer._dom) {\n      // pre glimmer2\n      let container = Ember.getOwner ? Ember.getOwner(context) : context.container;\n      let documentService = container.lookup('service:-document');\n\n      if (documentService) {\n        return documentService;\n      }\n\n      renderer = container.lookup('renderer:-dom');\n    }\n\n    if (renderer._dom && renderer._dom.document) {\n      // pre Ember 2.6\n      return renderer._dom.document;\n    }\n\n    return null;\n  }\n});","define(\"ember-intl/utils/links\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  const GUIDE_URL = 'https://ember-intl.github.io/ember-intl/docs/guide/';\n  var _default = {\n    unsetLocale: `${GUIDE_URL}ember-service-api#locale`,\n    asyncTranslations: `${GUIDE_URL}asynchronously-loading-translations`,\n    polyfill: `${GUIDE_URL}intljs-polyfill`\n  };\n  _exports.default = _default;\n});","define(\"ember-intl/utils/missing-message\", [\"exports\", \"ember-intl/utils/links\"], function (_exports, _links) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = missingMessage;\n\n  function missingMessage(key, locales\n  /*, options */\n  ) {\n    if (Ember.isEmpty(locales)) {\n      (true && Ember.warn(`[ember-intl] no locale has been set. Documentation: ${_links.default.unsetLocale}`, false, {\n        id: 'ember-intl-no-locale-set'\n      }));\n      return `No locale defined.  Unable to resolve translation: \"${key}\"`;\n    }\n\n    const localeNames = locales.join(', ');\n    (true && Ember.warn(`[ember-intl] translation: \"${key}\" on locale: \"${localeNames}\" was not found.`, false, {\n      id: 'ember-intl-missing-translation'\n    }));\n    return `Missing translation \"${key}\" for locale \"${localeNames}\"`;\n  }\n});","define(\"ember-load-initializers/index\", [\"exports\", \"require\"], function (_exports, _require) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = loadInitializers;\n\n  function resolveInitializer(moduleName) {\n    var module = (0, _require.default)(moduleName, null, null, true);\n\n    if (!module) {\n      throw new Error(moduleName + ' must export an initializer.');\n    }\n\n    var initializer = module['default'];\n\n    if (!initializer.name) {\n      initializer.name = moduleName.slice(moduleName.lastIndexOf('/') + 1);\n    }\n\n    return initializer;\n  }\n\n  function registerInitializers(app, moduleNames) {\n    for (var i = 0; i < moduleNames.length; i++) {\n      app.initializer(resolveInitializer(moduleNames[i]));\n    }\n  }\n\n  function registerInstanceInitializers(app, moduleNames) {\n    for (var i = 0; i < moduleNames.length; i++) {\n      app.instanceInitializer(resolveInitializer(moduleNames[i]));\n    }\n  }\n\n  function _endsWith(str, suffix) {\n    return str.indexOf(suffix, str.length - suffix.length) !== -1;\n  }\n  /**\n   * Configure your application as it boots\n   */\n\n\n  function loadInitializers(app, prefix) {\n    var initializerPrefix = prefix + '/initializers/';\n    var instanceInitializerPrefix = prefix + '/instance-initializers/';\n    var initializers = [];\n    var instanceInitializers = []; // this is 2 pass because generally the first pass is the problem\n    // and is reduced, and resolveInitializer has potential to deopt\n\n    var moduleNames = Object.keys(requirejs._eak_seen);\n\n    for (var i = 0; i < moduleNames.length; i++) {\n      var moduleName = moduleNames[i];\n\n      if (moduleName.lastIndexOf(initializerPrefix, 0) === 0) {\n        if (!_endsWith(moduleName, '-test')) {\n          initializers.push(moduleName);\n        }\n      } else if (moduleName.lastIndexOf(instanceInitializerPrefix, 0) === 0) {\n        if (!_endsWith(moduleName, '-test')) {\n          instanceInitializers.push(moduleName);\n        }\n      }\n    }\n\n    registerInitializers(app, initializers);\n    registerInstanceInitializers(app, instanceInitializers);\n  }\n});","define(\"ember-model-validator/initializers/model-locale\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.initialize = initialize;\n  _exports.default = void 0;\n\n  function initialize() {\n    let application = arguments[1] || arguments[0];\n    let validatorDefaultLocale = application.get('validatorDefaultLocale');\n\n    if (validatorDefaultLocale) {\n      application.register('validator:locale', validatorDefaultLocale, {\n        instantiate: false\n      });\n    }\n  }\n\n  var _default = {\n    name: 'model-locale',\n    initialize\n  };\n  _exports.default = _default;\n});","define(\"ember-model-validator/messages/ar\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  var _default = {\n    presenceMessage: 'الحقل فارغ',\n    absenceMessage: 'يجب أن يكون فارغ',\n    inclusionMessage: 'غير مدرج في القائمة',\n    exclusionMessage: 'محجوز',\n    // Numericality\n    numericalityMessage: 'ليس رقماً',\n    numericalityOnlyIntegerMessage: 'يجب أن يكون رقماً صحيحاً',\n    numericalityGreaterThanMessage: 'يجب أن يكون أكثر من {count}',\n    numericalityGreaterThanOrEqualToMessage: 'يجب أن يكون أكثر من أو يساوي {count}',\n    numericalityEqualToMessage: 'يجب أن يساوي {count}',\n    numericalityLessThanMessage: 'يجب أن يكون أقل من {count}',\n    numericalityLessThanOrEqualToMessage: 'يجب أن يكون أقل أو يساوي {count}',\n    numericalityOddMessage: 'يجب أن يكون رقم من الأحاد',\n    numericalityEvenMessage: 'يجب أن يكون رقم زوجي',\n    mailMessage: 'يجب أن يكون بريد الالكتروني',\n    formatMessage: 'غير صحيح',\n    colorMessage: 'يجب أن يكون تكويد لوني صحيح',\n    subdomainMessage: 'يجب أن يكون نطاق فرعي صحيح',\n    acceptanceMessage: 'يجب أن يقبل',\n    zipCodeMessage: 'رمز بريدي غير صحيح',\n    URLMessage: 'يجب أن يكون رابط صحيح',\n    wrongLengthMessage: 'طول النص غير صحيح (يجب أن يكون {count} حرف)',\n    tooShortMessage: 'نص قصير (الحد الأدنى {count} حرف)',\n    tooLongMessage: 'نص طويل (الحد الأعلى {count} حرف)',\n    mustContainNumberMessage: 'يجب أن يحتوي على رقم',\n    mustContainSpecialMessage: 'يجب أن يحتوي على أحد هذي الحروف: {characters}',\n    mustContainLowerMessage: 'يجب أن يحتوى على حرف صغير',\n    mustContainCapitalMessage: 'يجب أن يحتوى على حرف كبير',\n    customValidationMessage: 'غير صحيح',\n    matchMessage: 'يجب أن يطابق {match}',\n    dateMessage: 'التاريخ غير صحيح',\n    dateBeforeMessage: 'يجب أن يكون قبل {date}',\n    dateAfterMessage: 'يجب أن يكون بعد {date}'\n  };\n  _exports.default = _default;\n});","define(\"ember-model-validator/messages/en\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  var _default = {\n    presenceMessage: \"can't be blank\",\n    absenceMessage: 'must be blank',\n    inclusionMessage: 'is not included in the list',\n    exclusionMessage: 'is reserved',\n    // Numericality\n    numericalityMessage: 'is not a number',\n    numericalityOnlyIntegerMessage: 'must be an integer',\n    numericalityGreaterThanMessage: 'must be greater than {count}',\n    numericalityGreaterThanOrEqualToMessage: 'must be greater than or equal to {count}',\n    numericalityEqualToMessage: 'must be equal to {count}',\n    numericalityLessThanMessage: 'must be less than {count}',\n    numericalityLessThanOrEqualToMessage: 'must be less than or equal to {count}',\n    numericalityOddMessage: 'must be odd',\n    numericalityEvenMessage: 'must be even',\n    mailMessage: 'is not a valid email',\n    formatMessage: 'is invalid',\n    colorMessage: 'must be a valid CSS hex color code',\n    subdomainMessage: 'must be a valid subdomain',\n    acceptanceMessage: 'must be accepted',\n    zipCodeMessage: 'is not a valid zip code',\n    URLMessage: 'must be a valid url',\n    wrongLengthMessage: 'is the wrong length (should be {count} characters)',\n    tooShortMessage: 'is too short (minimum is {count} characters)',\n    tooLongMessage: 'is too long (maximum is {count} characters)',\n    mustContainNumberMessage: 'must include a number',\n    mustContainSpecialMessage: 'must include one of these special characters: {characters}',\n    mustContainLowerMessage: 'must include a lower case character',\n    mustContainCapitalMessage: 'must include an upper case character',\n    customValidationMessage: 'is invalid',\n    matchMessage: 'must match {match}',\n    dateMessage: 'is not a valid date',\n    dateBeforeMessage: 'must be before {date}',\n    dateAfterMessage: 'must be after {date}'\n  };\n  _exports.default = _default;\n});","define(\"ember-model-validator/messages/es\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  var _default = {\n    presenceMessage: 'no puede estar en blanco',\n    absenceMessage: 'debe estar en blanco',\n    inclusionMessage: 'no está incluido en la lista',\n    exclusionMessage: 'está reservado',\n    // Numericality\n    numericalityMessage: 'no es un número',\n    numericalityOnlyIntegerMessage: 'debe ser un entero',\n    numericalityGreaterThanMessage: 'debe ser mayor que {count}',\n    numericalityGreaterThanOrEqualToMessage: 'debe ser mayor o igual que {count}',\n    numericalityEqualToMessage: 'debe ser igual a {count}',\n    numericalityLessThanMessage: 'debe ser menor que {count}',\n    numericalityLessThanOrEqualToMessage: 'debe ser menor o igual que {count}',\n    numericalityOddMessage: 'debe ser un número impar',\n    numericalityEvenMessage: 'debe ser un número par',\n    mailMessage: 'no es un correo electrónico válido',\n    formatMessage: 'es inválido',\n    colorMessage: 'debe ser un hexadecimal válido',\n    subdomainMessage: 'debe ser un subdominio válido',\n    acceptanceMessage: 'debe ser aceptado',\n    zipCodeMessage: 'no es un código postal válido',\n    URLMessage: 'debe ser una url válida',\n    wrongLengthMessage: 'longitud errónea (debe ser de {count} caracteres)',\n    tooShortMessage: 'es demasiado corto (mínimo {count} caracteres)',\n    tooLongMessage: 'es demasiado largo (máximo {count} caracteres)',\n    mustContainNumberMessage: 'debe incluir un número',\n    mustContainSpecialMessage: 'debe incluir uno de estos caracteres especiales: {characters}',\n    mustContainLowerMessage: 'debe incluir un carácter en minúscula',\n    mustContainCapitalMessage: 'debe incluir un carácter en mayúscula',\n    customValidationMessage: 'es inválido',\n    matchMessage: 'debe coincidir con {match}',\n    dateMessage: 'no es una fecha válida',\n    dateBeforeMessage: 'debe ser antes de {date}',\n    dateAfterMessage: 'debe ser después de {date}'\n  };\n  _exports.default = _default;\n});","define(\"ember-model-validator/messages/fr\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  var _default = {\n    presenceMessage: 'doit être rempli(e)',\n    absenceMessage: 'doit être vide',\n    inclusionMessage: \"n'est pas inclus(e) dans la liste\",\n    exclusionMessage: \"n'est pas disponible\",\n    // Numericality\n    numericalityMessage: \"n'est pas un nombre\",\n    numericalityOnlyIntegerMessage: 'doit être un nombre entier',\n    numericalityGreaterThanMessage: 'doit être supérieur à {count}',\n    numericalityGreaterThanOrEqualToMessage: 'doit être supérieur ou égal à {count}',\n    numericalityEqualToMessage: 'doit être égal à {count}',\n    numericalityLessThanMessage: 'doit être inférieur à {count}',\n    numericalityLessThanOrEqualToMessage: 'doit être inférieur ou égal à {count}',\n    numericalityOddMessage: 'doit être impair',\n    numericalityEvenMessage: 'doit être pair',\n    mailMessage: \"n'est pas une adresse email valide\",\n    formatMessage: \"n'est pas valide\",\n    colorMessage: 'doit être un nombre hexadécimal valide',\n    subdomainMessage: 'doit être un sous-domaine valide',\n    acceptanceMessage: 'doit être accepté(e)',\n    zipCodeMessage: \"n'est pas un code postal valide\",\n    URLMessage: 'doit être une URL valide',\n    wrongLengthMessage: 'ne fait pas la bonne longueur (doit comporter {count} caractères)',\n    tooShortMessage: 'est trop court (au moins {count} caractères)',\n    tooLongMessage: 'est trop long (pas plus de {count} caractères)',\n    mustContainNumberMessage: 'doit inclure un nombre',\n    mustContainSpecialMessage: \"doit inclure l'un de ces caractères spéciaux: {characters}\",\n    mustContainLowerMessage: 'doit comporter un caractère minuscule',\n    mustContainCapitalMessage: 'doit comporter un caractère majuscule',\n    customValidationMessage: \"n'est pas valide\",\n    matchMessage: 'doit correspondre avec {match}',\n    dateMessage: 'is not a valid date',\n    dateBeforeMessage: 'must be before {date}',\n    dateAfterMessage: 'must be after {date}'\n  };\n  _exports.default = _default;\n});","define(\"ember-model-validator/messages/pt-br\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  var _default = {\n    presenceMessage: 'não pode ficar em branco',\n    absenceMessage: 'deve estar em branco',\n    inclusionMessage: 'não está incluso na lista de valores válidos',\n    exclusionMessage: 'está incluso na lista de valores inválidos',\n    // Numericality\n    numericalityMessage: 'não é um número',\n    numericalityOnlyIntegerMessage: 'deve ser um número inteiro',\n    numericalityGreaterThanMessage: 'deve ser maior que {count}',\n    numericalityGreaterThanOrEqualToMessage: 'deve ser maior ou igual a {count}',\n    numericalityEqualToMessage: 'deve ser igual a {count}',\n    numericalityLessThanMessage: 'deve ser menor que {count}',\n    numericalityLessThanOrEqualToMessage: 'deve ser menor ou igual a {count}',\n    numericalityOddMessage: 'deve ser par',\n    numericalityEvenMessage: 'dever ser ímpar',\n    mailMessage: 'não é um email válido',\n    formatMessage: 'é inválido',\n    colorMessage: 'deve ser um código de cor hexadecimal para CSS',\n    subdomainMessage: 'deve ser um subdomínio válido',\n    acceptanceMessage: 'precisa ser aceito',\n    zipCodeMessage: 'não é um CEP válido',\n    URLMessage: 'deve ser uma URL',\n    wrongLengthMessage: 'comprimento de palavra errado (deve conter {count} caracteres)',\n    tooShortMessage: 'muito curto (deve conter no minimo {count} caracteres)',\n    tooLongMessage: 'muito longo (no maximo {count} caracteres)',\n    mustContainNumberMessage: 'deve incluir um número',\n    mustContainSpecialMessage: 'deve conter um desse caracteres especiais: {characters}',\n    mustContainLowerMessage: 'deve conter uma letra em minusculo',\n    mustContainCapitalMessage: 'deve contar uma letar em maisculo',\n    customValidationMessage: 'está inválido',\n    matchMessage: 'não corresponde ao formato {match}',\n    dateMessage: 'não é uma data válida',\n    dateBeforeMessage: 'deve ser antes de {date}',\n    dateAfterMessage: 'deve ser depois de {date}'\n  };\n  _exports.default = _default;\n});","define(\"ember-model-validator/mixins/model-validator\", [\"exports\", \"ember-model-validator/postal-codes-regex\", \"ember-model-validator/messages/en\", \"ember-model-validator/messages/ar\", \"ember-model-validator/messages/fr\", \"ember-model-validator/messages/es\", \"ember-model-validator/messages/pt-br\"], function (_exports, _postalCodesRegex, _en, _ar, _fr, _es, _ptBr) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  const Messages = {\n    en: _en.default,\n    ar: _ar.default,\n    fr: _fr.default,\n    es: _es.default,\n    'pt-br': _ptBr.default\n  };\n\n  var _default = Ember.Mixin.create({\n    validationErrors: {},\n    isValidNow: true,\n    addErrors: true,\n    _validationMessages: {},\n    _locale: Ember.computed(function () {\n      return Ember.getOwner(this).lookup('validator:locale');\n    }),\n    _initMessage: Ember.on('init', function () {\n      let locale = Ember.get(this, '_locale') || 'en';\n      Ember.set(this, '_validationMessages', Messages[locale]);\n    }),\n\n    clearErrors() {\n      this._internalModel.clearErrorMessages();\n    },\n\n    validate(options = {}) {\n      let errors = null,\n          validations = Ember.get(this, 'validations'); // Clean all the current errors\n\n      this.clearErrors();\n      Ember.set(this, 'validationErrors', {});\n      Ember.set(this, 'isValidNow', true);\n      errors = Ember.get(this, 'validationErrors'); // Validate but not set errors\n\n      if (options.hasOwnProperty('addErrors')) {\n        Ember.set(this, 'addErrors', options['addErrors']);\n      } else {\n        Ember.set(this, 'addErrors', true);\n      } // Call validators defined on each property\n\n\n      for (let property in validations) {\n        for (let validation in validations[property]) {\n          if (this._exceptOrOnly(property, validation, options)) {\n            let validationName = Ember.String.capitalize(validation); // allowBlank option\n\n            if (Ember.get(validations[property], `${validation}.allowBlank`) && Ember.isEmpty(Ember.get(this, property))) {\n              continue;\n            } // conditional functions\n\n\n            let conditionalFunction = Ember.get(validations[property], `${validation}.if`);\n\n            if (conditionalFunction && !conditionalFunction(property, Ember.get(this, property), this)) {\n              continue;\n            }\n\n            this[`_validate${validationName}`](property, validations[property]);\n          }\n        }\n      } // Check if it's valid or not\n\n\n      if (!Ember.get(this, 'isValidNow')) {\n        // It may be invalid because of its relations\n        if (Ember.get(this, 'addErrors') && Object.keys(errors).length !== 0) {\n          this.pushErrors(errors);\n        }\n\n        return false;\n      } else {\n        return true;\n      }\n    },\n\n    pushErrors(errors) {\n      let store = Ember.get(this, 'store');\n      let stateToTransition = Ember.get(this, 'isNew') ? 'created.uncommitted' : 'updated.uncommitted';\n      this.transitionTo(stateToTransition);\n      let recordModel = this.adapterDidInvalidate ? this : this._internalModel;\n      store.recordWasInvalid(recordModel, errors);\n    },\n\n    /**** Validators ****/\n    _validateCustom(property, validation) {\n      validation = Ember.isArray(validation.custom) ? validation.custom : [validation.custom];\n\n      for (let i = 0; i < validation.length; i++) {\n        let customValidator = this._getCustomValidator(validation[i]);\n\n        if (customValidator) {\n          let passedCustomValidation = customValidator(property, Ember.get(this, property), this);\n\n          if (!passedCustomValidation) {\n            Ember.set(this, 'isValidNow', false);\n\n            this._addToErrors(property, validation[i], Ember.get(this, '_validationMessages').customValidationMessage);\n          }\n        }\n      }\n    },\n\n    _validatePresence(property, validation) {\n      let propertyValue = Ember.get(this, property); // If the property is an async relationship.\n\n      if (this._modelRelations() && !Ember.isBlank(this._modelRelations()[property])) {\n        if (this._modelRelations()[property]['isAsync']) {\n          propertyValue = Ember.get(this, `${property}.content`);\n        }\n      }\n\n      if (Ember.isBlank(propertyValue)) {\n        Ember.set(this, 'isValidNow', false);\n\n        this._addToErrors(property, validation.presence, Ember.get(this, '_validationMessages').presenceMessage);\n      }\n    },\n\n    _validateAbsence(property, validation) {\n      if (Ember.isPresent(Ember.get(this, property))) {\n        Ember.set(this, 'isValidNow', false);\n\n        this._addToErrors(property, validation.absence, Ember.get(this, '_validationMessages').absenceMessage);\n      }\n    },\n\n    _validateAcceptance(property, validation) {\n      let propertyValue = Ember.get(this, property),\n          accept = validation.acceptance.accept || [1, '1', true];\n\n      if (!this._includes(Ember.A(accept), propertyValue)) {\n        Ember.set(this, 'isValidNow', false);\n\n        this._addToErrors(property, validation.acceptance, Ember.get(this, '_validationMessages').acceptanceMessage);\n      }\n    },\n\n    _validateFormat(property, validation) {\n      let withRegexp = validation.format.with;\n\n      if (Ember.get(this, property) && String(Ember.get(this, property)).match(withRegexp) === null) {\n        Ember.set(this, 'isValidNow', false);\n\n        this._addToErrors(property, validation.format, Ember.get(this, '_validationMessages').formatMessage);\n      }\n    },\n\n    _validateEmail(property, validation) {\n      if (!Ember.get(this, property) || String(Ember.get(this, property)).match(/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/) === null) {\n        Ember.set(this, 'isValidNow', false);\n\n        this._addToErrors(property, validation.email, Ember.get(this, '_validationMessages').mailMessage);\n      }\n    },\n\n    _validateZipCode(property, validation) {\n      const DEFAULT_COUNTRY_CODE = 'US';\n      let propertyValue = Ember.get(this, property);\n      let countryCode = DEFAULT_COUNTRY_CODE;\n\n      if (validation.zipCode.hasOwnProperty('countryCode')) {\n        countryCode = validation.zipCode.countryCode;\n      }\n\n      if (Ember.isArray(countryCode)) {\n        countryCode.forEach(function (code) {\n          let postalCodeRegexp = _postalCodesRegex.default[code];\n\n          if (typeof postalCodeRegexp === 'undefined') {\n            postalCodeRegexp = _postalCodesRegex.default[DEFAULT_COUNTRY_CODE];\n          }\n\n          if (!propertyValue || String(propertyValue).match(postalCodeRegexp) === null) {\n            Ember.set(this, 'isValidNow', false);\n\n            this._addToErrors(property, validation.zipCode, Ember.get(this, '_validationMessages').zipCodeMessage);\n          }\n        });\n      } else {\n        let postalCodeRegexp = _postalCodesRegex.default[countryCode];\n\n        if (typeof postalCodeRegexp === 'undefined') {\n          postalCodeRegexp = _postalCodesRegex.default[DEFAULT_COUNTRY_CODE];\n        }\n\n        if (!propertyValue || String(propertyValue).match(postalCodeRegexp) === null) {\n          Ember.set(this, 'isValidNow', false);\n\n          this._addToErrors(property, validation.zipCode, Ember.get(this, '_validationMessages').zipCodeMessage);\n        }\n      }\n    },\n\n    _validateColor(property, validation) {\n      let propertyValue = Ember.get(this, property);\n\n      if (!propertyValue || String(propertyValue).match(/([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/i) === null) {\n        Ember.set(this, 'isValidNow', false);\n\n        this._addToErrors(property, validation.color, Ember.get(this, '_validationMessages').colorMessage);\n      }\n    },\n\n    _validateURL(property, validation) {\n      let propertyValue = Ember.get(this, property);\n\n      if (!propertyValue || String(propertyValue).match(/^((http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)|)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-/]))?$/) === null) {\n        Ember.set(this, 'isValidNow', false);\n\n        this._addToErrors(property, validation.URL, Ember.get(this, '_validationMessages').URLMessage);\n      }\n    },\n\n    _validateSubdomain(property, validation) {\n      let propertyValue = Ember.get(this, property),\n          reserved = validation.subdomain.reserved || [];\n\n      if (!propertyValue || String(propertyValue).match(/^[a-z\\d]+([-_][a-z\\d]+)*$/i) === null || reserved.indexOf(propertyValue) !== -1) {\n        Ember.set(this, 'isValidNow', false);\n\n        this._addToErrors(property, validation.subdomain, Ember.get(this, '_validationMessages').subdomainMessage);\n      }\n    },\n\n    _validateDate(property, validation) {\n      let propertyValue = new Date(Ember.get(this, property));\n\n      if (isNaN(propertyValue.getTime())) {\n        Ember.set(this, 'isValidNow', false);\n\n        this._addToErrors(property, validation.date, Ember.get(this, '_validationMessages').dateMessage);\n\n        return;\n      }\n\n      if (validation.date.hasOwnProperty('before') && validation.date.before) {\n        if (propertyValue.getTime() >= new Date(validation.date.before).getTime()) {\n          Ember.set(this, 'isValidNow', false);\n          let context = {\n            date: new Date(validation.date.before)\n          };\n          validation.date.interpolatedValue = validation.date.before;\n\n          this._addToErrors(property, validation.date, this._formatMessage(Ember.get(this, '_validationMessages').dateBeforeMessage, context));\n        }\n      }\n\n      if (validation.date.hasOwnProperty('after') && validation.date.after) {\n        if (propertyValue.getTime() <= new Date(validation.date.after).getTime()) {\n          Ember.set(this, 'isValidNow', false);\n          let context = {\n            date: new Date(validation.date.after)\n          };\n          validation.date.interpolatedValue = validation.date.after;\n\n          this._addToErrors(property, validation.date, this._formatMessage(Ember.get(this, '_validationMessages').dateAfterMessage, context));\n        }\n      }\n    },\n\n    _validateNumericality(property, validation) {\n      let propertyValue = Ember.get(this, property);\n\n      if (!this._isNumber(Ember.get(this, property))) {\n        Ember.set(this, 'isValidNow', false);\n\n        this._addToErrors(property, validation.numericality, Ember.get(this, '_validationMessages').numericalityMessage);\n      }\n\n      if (validation.numericality.hasOwnProperty('onlyInteger') && validation.numericality.onlyInteger) {\n        if (!/^[+-]?\\d+$/.test(propertyValue)) {\n          Ember.set(this, 'isValidNow', false);\n\n          this._addToErrors(property, validation.numericality, Ember.get(this, '_validationMessages').numericalityOnlyIntegerMessage);\n        }\n      }\n\n      if (validation.numericality.hasOwnProperty('even') && validation.numericality.even) {\n        if (propertyValue % 2 !== 0) {\n          Ember.set(this, 'isValidNow', false);\n\n          this._addToErrors(property, validation.numericality, Ember.get(this, '_validationMessages').numericalityEvenMessage);\n        }\n      }\n\n      if (validation.numericality.hasOwnProperty('odd') && validation.numericality.odd) {\n        if (propertyValue % 2 === 0) {\n          Ember.set(this, 'isValidNow', false);\n\n          this._addToErrors(property, validation.numericality, Ember.get(this, '_validationMessages').numericalityOddMessage);\n        }\n      }\n\n      if (validation.numericality.hasOwnProperty('greaterThan') && this._isNumber(validation.numericality.greaterThan)) {\n        if (propertyValue <= validation.numericality.greaterThan) {\n          Ember.set(this, 'isValidNow', false);\n          let context = {\n            count: validation.numericality.greaterThan\n          };\n          validation.numericality.interpolatedValue = validation.numericality.greaterThan;\n\n          this._addToErrors(property, validation.numericality, this._formatMessage(Ember.get(this, '_validationMessages').numericalityGreaterThanMessage, context));\n        }\n      }\n\n      if (validation.numericality.hasOwnProperty('greaterThanOrEqualTo') && this._isNumber(validation.numericality.greaterThanOrEqualTo)) {\n        if (propertyValue < validation.numericality.greaterThanOrEqualTo) {\n          Ember.set(this, 'isValidNow', false);\n          let context = {\n            count: validation.numericality.greaterThanOrEqualTo\n          };\n          validation.numericality.interpolatedValue = validation.numericality.greaterThanOrEqualTo;\n\n          this._addToErrors(property, validation.numericality, this._formatMessage(Ember.get(this, '_validationMessages').numericalityGreaterThanOrEqualToMessage, context));\n        }\n      }\n\n      if (validation.numericality.hasOwnProperty('equalTo') && this._isNumber(validation.numericality.equalTo)) {\n        if (propertyValue !== validation.numericality.equalTo) {\n          Ember.set(this, 'isValidNow', false);\n          let context = {\n            count: validation.numericality.equalTo\n          };\n          validation.numericality.interpolatedValue = validation.numericality.equalTo;\n\n          this._addToErrors(property, validation.numericality, this._formatMessage(Ember.get(this, '_validationMessages').numericalityEqualToMessage, context));\n        }\n      }\n\n      if (validation.numericality.hasOwnProperty('lessThan') && this._isNumber(validation.numericality.lessThan)) {\n        if (propertyValue >= validation.numericality.lessThan) {\n          Ember.set(this, 'isValidNow', false);\n          let context = {\n            count: validation.numericality.lessThan\n          };\n          validation.numericality.interpolatedValue = validation.numericality.lessThan;\n\n          this._addToErrors(property, validation.numericality, this._formatMessage(Ember.get(this, '_validationMessages').numericalityLessThanMessage, context));\n        }\n      }\n\n      if (validation.numericality.hasOwnProperty('lessThanOrEqualTo') && this._isNumber(validation.numericality.lessThanOrEqualTo)) {\n        if (propertyValue > validation.numericality.lessThanOrEqualTo) {\n          Ember.set(this, 'isValidNow', false);\n          let context = {\n            count: validation.numericality.lessThanOrEqualTo\n          };\n          validation.numericality.interpolatedValue = validation.numericality.lessThanOrEqualTo;\n\n          this._addToErrors(property, validation.numericality, this._formatMessage(Ember.get(this, '_validationMessages').numericalityLessThanOrEqualToMessage, context));\n        }\n      }\n    },\n\n    _validateExclusion(property, validation) {\n      if (validation.exclusion.hasOwnProperty('in')) {\n        if (validation.exclusion.in.indexOf(Ember.get(this, property)) !== -1) {\n          Ember.set(this, 'isValidNow', false);\n\n          this._addToErrors(property, validation.exclusion, Ember.get(this, '_validationMessages').exclusionMessage);\n        }\n      }\n    },\n\n    _validateInclusion(property, validation) {\n      if (validation.inclusion.hasOwnProperty('in')) {\n        if (validation.inclusion.in.indexOf(Ember.get(this, property)) === -1) {\n          Ember.set(this, 'isValidNow', false);\n\n          this._addToErrors(property, validation.inclusion, Ember.get(this, '_validationMessages').inclusionMessage);\n        }\n      }\n    },\n\n    _validateMatch(property, validation) {\n      let matching = validation.match.attr || validation.match,\n          propertyValue = Ember.get(this, property),\n          matchingValue = Ember.get(this, matching);\n\n      if (propertyValue !== matchingValue) {\n        Ember.set(this, 'isValidNow', false);\n\n        let matchingUnCamelCase = this._unCamelCase(matching);\n\n        let context = {\n          match: matchingUnCamelCase\n        };\n\n        if (Ember.typeOf(validation.match) === 'object') {\n          validation.match.interpolatedValue = matchingUnCamelCase;\n        }\n\n        this._addToErrors(property, validation.match, this._formatMessage(Ember.get(this, '_validationMessages').matchMessage, context));\n      }\n    },\n\n    // Length Validator\n    _validateLength(property, validation) {\n      let propertyValue = Ember.get(this, property),\n          stringLength = !propertyValue ? 0 : String(propertyValue).length,\n          validationType = Ember.typeOf(validation.length);\n\n      if (validationType === 'number') {\n        validation.length = {\n          is: validation.length\n        };\n\n        this._exactLength(stringLength, property, validation);\n      } else if (validationType === 'array') {\n        validation.length = {\n          minimum: validation.length[0],\n          maximum: validation.length[1]\n        };\n\n        this._rangeLength(stringLength, property, validation);\n      } else if (validationType === 'object') {\n        if (validation.length.hasOwnProperty('is')) {\n          this._exactLength(stringLength, property, validation);\n        } else {\n          this._rangeLength(stringLength, property, validation);\n        }\n      }\n    },\n\n    _exactLength(stringLength, property, validation) {\n      if (stringLength !== validation.length.is) {\n        Ember.set(this, 'isValidNow', false);\n        let context = {\n          count: validation.length.is\n        };\n        validation.length.interpolatedValue = validation.length.is;\n\n        this._addToErrors(property, validation.length, this._formatMessage(Ember.get(this, '_validationMessages').wrongLengthMessage, context));\n      }\n    },\n\n    _rangeLength(stringLength, property, validation) {\n      let minimum = -1,\n          maximum = Infinity; // Maximum and Minimum can be objects\n\n      if (Ember.typeOf(validation.length.minimum) === 'number') {\n        minimum = validation.length.minimum;\n      } else if (Ember.typeOf(validation.length.minimum) === 'object' && validation.length.minimum.hasOwnProperty('value')) {\n        minimum = validation.length.minimum.value;\n      }\n\n      if (Ember.typeOf(validation.length.maximum) === 'number') {\n        maximum = validation.length.maximum;\n      } else if (Ember.typeOf(validation.length.maximum) === 'object' && validation.length.maximum.hasOwnProperty('value')) {\n        maximum = validation.length.maximum.value;\n      }\n\n      if (stringLength < minimum) {\n        Ember.set(this, 'isValidNow', false);\n        let context = {\n          count: minimum\n        };\n\n        if (Ember.typeOf(validation.length.minimum) === 'object') {\n          validation.length.minimum.interpolatedValue = minimum;\n        }\n\n        this._addToErrors(property, validation.length.minimum, this._formatMessage(Ember.get(this, '_validationMessages').tooShortMessage, context));\n      } else if (stringLength > maximum) {\n        Ember.set(this, 'isValidNow', false);\n        let context = {\n          count: maximum\n        };\n\n        if (Ember.typeOf(validation.length.maximum) === 'object') {\n          validation.length.maximum.interpolatedValue = maximum;\n        }\n\n        this._addToErrors(property, validation.length.maximum, this._formatMessage(Ember.get(this, '_validationMessages').tooLongMessage, context));\n      }\n    },\n\n    _validateRelations(property, validation) {\n      if (validation.relations.indexOf('hasMany') !== -1) {\n        if (Ember.get(this, `${property}.content`)) {\n          Ember.get(this, `${property}.content`).forEach(objRelation => {\n            if (!objRelation.validate()) {\n              Ember.set(this, 'isValidNow', false);\n            }\n          });\n        }\n      } else if (validation.relations.indexOf('belongsTo') !== -1) {\n        if (Ember.get(this, `${property}.content`) && !Ember.get(this, `${property}.content`).validate()) {\n          Ember.set(this, 'isValidNow', false);\n        }\n      }\n    },\n\n    _validateMustContainCapital(property, validation) {\n      let notContainCapital = String(Ember.get(this, property)).match(/(?=.*[A-Z])/) === null,\n          message = validation.mustContainCapital.message || Ember.get(this, '_validationMessages').mustContainCapitalMessage;\n\n      if (validation.mustContainCapital && notContainCapital) {\n        Ember.set(this, 'isValidNow', false);\n\n        this._addToErrors(property, validation, message);\n      }\n    },\n\n    _validateMustContainLower(property, validation) {\n      let containsLower = String(Ember.get(this, property)).match(/(?=.*[a-z])/) !== null,\n          message = validation.mustContainLower.message || Ember.get(this, '_validationMessages').mustContainLowerMessage;\n\n      if (validation.mustContainLower && !containsLower) {\n        Ember.set(this, 'isValidNow', false);\n\n        this._addToErrors(property, validation, message);\n      }\n    },\n\n    _validateMustContainNumber(property, validation) {\n      let containsNumber = String(Ember.get(this, property)).match(/(?=.*[0-9])/) !== null,\n          message = validation.mustContainNumber.message || Ember.get(this, '_validationMessages').mustContainNumberMessage;\n\n      if (validation.mustContainNumber && !containsNumber) {\n        Ember.set(this, 'isValidNow', false);\n\n        this._addToErrors(property, validation, message);\n      }\n    },\n\n    _validateMustContainSpecial(property, validation) {\n      let regexString = validation.mustContainSpecial.acceptableChars || '-+_!@#$%^&*.,?()',\n          regex = new RegExp(`(?=.*[${regexString}])`),\n          containsSpecial = String(Ember.get(this, property)).match(regex) !== null,\n          message = validation.mustContainSpecial.message || Ember.get(this, '_validationMessages').mustContainSpecialMessage;\n\n      if (validation.mustContainSpecial && !containsSpecial) {\n        Ember.set(this, 'isValidNow', false);\n        let context = {\n          characters: regexString\n        };\n\n        this._addToErrors(property, validation, this._formatMessage(message, context));\n      }\n    },\n\n    /**** Helper methods ****/\n    _exceptOrOnly(property, validation, options) {\n      let validateThis = true;\n\n      if (Ember.isPresent(options.except) && Ember.isArray(options.except)) {\n        validateThis = !this._hasCompositeTag(property, validation, options.except);\n      }\n\n      if (Ember.isPresent(options.only) && Ember.isArray(options.only)) {\n        validateThis = this._hasCompositeTag(property, validation, options.only);\n      }\n\n      return validateThis;\n    },\n\n    _hasCompositeTag(property, validation, tags) {\n      for (const tag of tags) {\n        if (tag === property) return true;\n\n        if (tag.indexOf(':') !== -1) {\n          const [field, rest = ''] = tag.split(':', 2);\n          if (field !== property) continue;\n          const rules = rest.split(',');\n\n          for (const rule of rules) {\n            if (rule === validation) return true;\n          }\n        }\n      }\n\n      return false;\n    },\n\n    _getCustomValidator(validation) {\n      let customValidator = validation;\n\n      if (Ember.typeOf(validation) === 'object' && validation.hasOwnProperty('validation')) {\n        customValidator = validation.validation;\n      }\n\n      return this._isFunction(customValidator) ? customValidator : false;\n    },\n\n    _getCustomMessage(validationObj, defaultMessage, property) {\n      if (Ember.typeOf(validationObj) === 'object' && validationObj.hasOwnProperty('message')) {\n        if (this._isFunction(validationObj.message)) {\n          let msg = validationObj.message.call(this, property, Ember.get(this, property), this);\n          return this._isString(msg) ? msg : defaultMessage;\n        } else {\n          let context = {\n            value: validationObj.interpolatedValue\n          };\n          return this._formatMessage(validationObj.message, context);\n        }\n      } else {\n        return defaultMessage;\n      }\n    },\n\n    _addToErrors(property, validation, defaultMessage) {\n      let errors = Ember.get(this, 'validationErrors'),\n          message = this._getCustomMessage(validation, defaultMessage, property),\n          errorAs = Ember.typeOf(validation) === 'object' ? validation.errorAs || property : property;\n\n      if (!Ember.isArray(errors[errorAs])) {\n        errors[errorAs] = [];\n      }\n\n      if (Ember.get(this, 'addErrors')) {\n        errors[errorAs].push([message]);\n      }\n    },\n\n    // Specific funcs\n    _isNumber(n) {\n      return !isNaN(parseFloat(n)) && isFinite(n);\n    },\n\n    _unCamelCase(str) {\n      return str // insert a space before all caps\n      .replace(/([A-Z])/g, ' $1') // uppercase the first character\n      .replace(/^./, function (str) {\n        return Ember.String.capitalize(str);\n      });\n    },\n\n    _isFunction(func) {\n      return Ember.isEqual(Ember.typeOf(func), 'function');\n    },\n\n    _isString(str) {\n      return Ember.isEqual(Ember.typeOf(str), 'string');\n    },\n\n    _includes(enums, value) {\n      if (enums.includes) {\n        return enums.includes(value);\n      } else {\n        // Support old ember versions\n        return enums.contains(value);\n      }\n    },\n\n    _modelRelations() {\n      if (Ember.get(this, '_relationships')) {\n        return Ember.get(this, '_relationships');\n      } else if (Ember.get(this, '_internalModel._relationships')) {\n        return Ember.get(this, '_internalModel._relationships.initializedRelationships');\n      } else {\n        return Ember.get(this, '_internalModel._recordData._relationships.initializedRelationships');\n      }\n    },\n\n    _formatMessage(message, context = {}) {\n      return message.replace(/\\{(\\w+)\\}/, (s, attr) => context[attr]);\n    }\n\n  });\n\n  _exports.default = _default;\n});","define(\"ember-model-validator/mixins/object-validator\", [\"exports\", \"ember-data\", \"ember-model-validator/mixins/model-validator\"], function (_exports, _emberData, _modelValidator) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  var _default = Ember.Mixin.create(_modelValidator.default, {\n    errors: _emberData.default.Errors.create(),\n\n    clearErrors() {\n      this.set('errors', _emberData.default.Errors.create());\n    },\n\n    pushErrors(errors) {\n      for (let attribute in errors) {\n        let messages = errors[attribute];\n        this.get('errors').add(attribute, messages);\n      }\n    },\n\n    _modelRelations() {}\n\n  });\n\n  _exports.default = _default;\n});","define(\"ember-model-validator/postal-codes-regex\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  var _default = {\n    US: /^\\b\\d{5}(-\\d{4})?\\b$/i,\n    UK: /^(GIR|[A-Z]\\d[A-Z\\d]??|[A-Z]{2}\\d[A-Z\\d]??)[ ]??(\\d[A-Z]{2})$/,\n    DE: /\\b((?:0[1-46-9]\\d{3})|(?:[1-357-9]\\d{4})|(?:[4][0-24-9]\\d{3})|(?:[6][013-9]\\d{3}))\\b/,\n    CA: /^([ABCEGHJKLMNPRSTVXY]\\d[ABCEGHJKLMNPRSTVWXYZ]) {0,1}(\\d[ABCEGHJKLMNPRSTVWXYZ]\\d)$/,\n    FR: /^(F-)?((2[A|B])|[0-9]{2})[0-9]{3}$/,\n    IT: /^(V-|I-)?[0-9]{5}$/,\n    AU: /^(0[289][0-9]{2})|([1345689][0-9]{3})|(2[0-8][0-9]{2})|(290[0-9])|(291[0-4])|(7[0-4][0-9]{2})|(7[8-9][0-9]{2})$/,\n    NL: /^[1-9][0-9]{3}\\s?([a-zA-Z]{2})?$/,\n    ES: /^([1-9]{2}|[0-9][1-9]|[1-9][0-9])[0-9]{3}$/,\n    DK: /^([D|d][K|k]( |-))?[1-9]{1}[0-9]{3}$/,\n    SE: /^(s-|S-){0,1}[0-9]{3}\\s?[0-9]{2}$/,\n    BE: /^[1-9]{1}[0-9]{3}$/,\n    IN: /^\\d{6}/\n  };\n  _exports.default = _default;\n});","/*\n * This is a stub file, it must be on disk b/c babel-plugin-debug-macros\n * does not strip the module require when the transpiled variable usage is\n * stripped.\n */\ndefine(\"ember-resolver/features\", [], function () {\n  \"use strict\";\n});","define(\"ember-resolver/index\", [\"exports\", \"ember-resolver/resolvers/classic\"], function (_exports, _classic) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"default\", {\n    enumerable: true,\n    get: function () {\n      return _classic.default;\n    }\n  });\n});","define(\"ember-resolver/resolver\", [\"exports\", \"ember-resolver/resolvers/classic\"], function (_exports, _classic) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"default\", {\n    enumerable: true,\n    get: function () {\n      return _classic.default;\n    }\n  });\n});","define(\"ember-resolver/resolvers/classic/container-debug-adapter\", [\"exports\", \"ember-resolver/resolvers/classic/index\"], function (_exports, _index) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  function getPod(type, key, prefix) {\n    let match = key.match(new RegExp('^/?' + prefix + '/(.+)/' + type + '$'));\n\n    if (match !== null) {\n      return match[1];\n    }\n  }\n  /*\n   * This module defines a subclass of Ember.ContainerDebugAdapter that adds\n   * support for resolving from modules.\n   *\n   */\n\n\n  var _default = Ember.ContainerDebugAdapter.extend({\n    _moduleRegistry: null,\n\n    init() {\n      this._super(...arguments);\n\n      if (!this._moduleRegistry) {\n        this._moduleRegistry = new _index.ModuleRegistry();\n      }\n    },\n\n    /**\n        The container of the application being debugged.\n        This property will be injected\n        on creation.\n         @property container\n        @default null\n        */\n\n    /**\n        The resolver instance of the application\n        being debugged. This property will be injected\n        on creation.\n         @property resolver\n        @default null\n        */\n\n    /**\n        Returns true if it is possible to catalog a list of available\n        classes in the resolver for a given type.\n         @method canCatalogEntriesByType\n        @param {string} type The type. e.g. \"model\", \"controller\", \"route\"\n        @return {boolean} whether a list is available for this type.\n        */\n    canCatalogEntriesByType(type) {\n      if (type === 'model') {\n        return true;\n      }\n\n      return this._super(...arguments);\n    },\n\n    /**\n        Returns the available classes a given type.\n         @method catalogEntriesByType\n        @param {string} type The type. e.g. \"model\", \"controller\", \"route\"\n        @return {Array} An array of classes.\n        */\n    catalogEntriesByType(type) {\n      let moduleNames = this._moduleRegistry.moduleNames();\n\n      let types = Ember.A();\n      let prefix = this.namespace.modulePrefix;\n\n      for (let i = 0, l = moduleNames.length; i < l; i++) {\n        let key = moduleNames[i];\n\n        if (key.indexOf(type) !== -1) {\n          // Check if it's a pod module\n          let name = getPod(type, key, this.namespace.podModulePrefix || prefix);\n\n          if (!name) {\n            // Not pod\n            name = key.split(type + 's/').pop(); // Support for different prefix (such as ember-cli addons).\n            // Uncomment the code below when\n            // https://github.com/ember-cli/ember-resolver/pull/80 is merged.\n            //let match = key.match('^/?(.+)/' + type);\n            //if (match && match[1] !== prefix) {\n            // Different prefix such as an addon\n            //name = match[1] + '@' + name;\n            //}\n          }\n\n          types.addObject(name);\n        }\n      }\n\n      return types;\n    }\n\n  });\n\n  _exports.default = _default;\n});","define(\"ember-resolver/resolvers/classic/index\", [\"exports\", \"ember-resolver/utils/class-factory\"], function (_exports, _classFactory) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = _exports.ModuleRegistry = void 0;\n\n  if (typeof requirejs.entries === 'undefined') {\n    requirejs.entries = requirejs._eak_seen;\n  }\n\n  class ModuleRegistry {\n    constructor(entries) {\n      this._entries = entries || requirejs.entries;\n    }\n\n    moduleNames() {\n      return Object.keys(this._entries);\n    }\n\n    has(moduleName) {\n      return moduleName in this._entries;\n    }\n\n    get(moduleName) {\n      return require(moduleName);\n    }\n\n  }\n  /**\n   * This module defines a subclass of Ember.DefaultResolver that adds two\n   * important features:\n   *\n   *  1) The resolver makes the container aware of es6 modules via the AMD\n   *     output. The loader's _moduleEntries is consulted so that classes can be\n   *     resolved directly via the module loader, without needing a manual\n   *     `import`.\n   *  2) is able to provide injections to classes that implement `extend`\n   *     (as is typical with Ember).\n   */\n\n\n  _exports.ModuleRegistry = ModuleRegistry;\n\n  function parseName(fullName) {\n    if (fullName.parsedName === true) {\n      return fullName;\n    }\n\n    let prefix, type, name;\n    let fullNameParts = fullName.split('@');\n\n    if (fullNameParts.length === 2) {\n      let prefixParts = fullNameParts[0].split(':');\n\n      if (prefixParts.length === 2) {\n        if (prefixParts[1].length === 0) {\n          type = prefixParts[0];\n          name = `@${fullNameParts[1]}`;\n        } else {\n          prefix = prefixParts[1];\n          type = prefixParts[0];\n          name = fullNameParts[1];\n        }\n      } else {\n        let nameParts = fullNameParts[1].split(':');\n        prefix = fullNameParts[0];\n        type = nameParts[0];\n        name = nameParts[1];\n      }\n\n      if (type === 'template' && prefix.lastIndexOf('components/', 0) === 0) {\n        name = `components/${name}`;\n        prefix = prefix.slice(11);\n      }\n    } else {\n      fullNameParts = fullName.split(':');\n      type = fullNameParts[0];\n      name = fullNameParts[1];\n    }\n\n    let fullNameWithoutType = name;\n    let namespace = Ember.get(this, 'namespace');\n    let root = namespace;\n    return {\n      parsedName: true,\n      fullName: fullName,\n      prefix: prefix || this.prefix({\n        type: type\n      }),\n      type: type,\n      fullNameWithoutType: fullNameWithoutType,\n      name: name,\n      root: root,\n      resolveMethodName: \"resolve\" + Ember.String.classify(type)\n    };\n  }\n\n  function resolveOther(parsedName) {\n    (true && !(this.namespace.modulePrefix) && Ember.assert('`modulePrefix` must be defined', this.namespace.modulePrefix));\n    let normalizedModuleName = this.findModuleName(parsedName);\n\n    if (normalizedModuleName) {\n      let defaultExport = this._extractDefaultExport(normalizedModuleName, parsedName);\n\n      if (defaultExport === undefined) {\n        throw new Error(` Expected to find: '${parsedName.fullName}' within '${normalizedModuleName}' but got 'undefined'. Did you forget to 'export default' within '${normalizedModuleName}'?`);\n      }\n\n      if (this.shouldWrapInClassFactory(defaultExport, parsedName)) {\n        defaultExport = (0, _classFactory.default)(defaultExport);\n      }\n\n      return defaultExport;\n    }\n  }\n\n  const Resolver = Ember.Object.extend({\n    resolveOther,\n    parseName,\n    pluralizedTypes: null,\n    moduleRegistry: null,\n\n    makeToString(factory, fullName) {\n      return '' + this.namespace.modulePrefix + '@' + fullName + ':';\n    },\n\n    shouldWrapInClassFactory()\n    /* module, parsedName */\n    {\n      return false;\n    },\n\n    init() {\n      this._super();\n\n      this.moduleBasedResolver = true;\n\n      if (!this._moduleRegistry) {\n        this._moduleRegistry = new ModuleRegistry();\n      }\n\n      this._normalizeCache = Object.create(null);\n      this.pluralizedTypes = this.pluralizedTypes || Object.create(null);\n\n      if (!this.pluralizedTypes.config) {\n        this.pluralizedTypes.config = 'config';\n      }\n\n      this._deprecatedPodModulePrefix = false;\n    },\n\n    normalize(fullName) {\n      return this._normalizeCache[fullName] || (this._normalizeCache[fullName] = this._normalize(fullName));\n    },\n\n    resolve(fullName) {\n      let parsedName = this.parseName(fullName);\n      let resolveMethodName = parsedName.resolveMethodName;\n      let resolved;\n\n      if (typeof this[resolveMethodName] === 'function') {\n        resolved = this[resolveMethodName](parsedName);\n      }\n\n      if (resolved == null) {\n        resolved = this.resolveOther(parsedName);\n      }\n\n      return resolved;\n    },\n\n    _normalize(fullName) {\n      // A) Convert underscores to dashes\n      // B) Convert camelCase to dash-case, except for components (their\n      //    templates) and helpers where we want to avoid shadowing camelCase\n      //    expressions\n      // C) replace `.` with `/` in order to make nested controllers work in the following cases\n      //      1. `needs: ['posts/post']`\n      //      2. `{{render \"posts/post\"}}`\n      //      3. `this.render('posts/post')` from Route\n      let split = fullName.split(':');\n\n      if (split.length > 1) {\n        let type = split[0];\n\n        if (type === 'component' || type === 'helper' || type === 'template' && split[1].indexOf('components/') === 0) {\n          return type + ':' + split[1].replace(/_/g, '-');\n        } else {\n          return type + ':' + Ember.String.dasherize(split[1].replace(/\\./g, '/'));\n        }\n      } else {\n        return fullName;\n      }\n    },\n\n    pluralize(type) {\n      return this.pluralizedTypes[type] || (this.pluralizedTypes[type] = type + 's');\n    },\n\n    podBasedLookupWithPrefix(podPrefix, parsedName) {\n      let fullNameWithoutType = parsedName.fullNameWithoutType;\n\n      if (parsedName.type === 'template') {\n        fullNameWithoutType = fullNameWithoutType.replace(/^components\\//, '');\n      }\n\n      return podPrefix + '/' + fullNameWithoutType + '/' + parsedName.type;\n    },\n\n    podBasedModuleName(parsedName) {\n      let podPrefix = this.namespace.podModulePrefix || this.namespace.modulePrefix;\n      return this.podBasedLookupWithPrefix(podPrefix, parsedName);\n    },\n\n    podBasedComponentsInSubdir(parsedName) {\n      let podPrefix = this.namespace.podModulePrefix || this.namespace.modulePrefix;\n      podPrefix = podPrefix + '/components';\n\n      if (parsedName.type === 'component' || /^components/.test(parsedName.fullNameWithoutType)) {\n        return this.podBasedLookupWithPrefix(podPrefix, parsedName);\n      }\n    },\n\n    resolveEngine(parsedName) {\n      let engineName = parsedName.fullNameWithoutType;\n      let engineModule = engineName + '/engine';\n\n      if (this._moduleRegistry.has(engineModule)) {\n        return this._extractDefaultExport(engineModule);\n      }\n    },\n\n    resolveRouteMap(parsedName) {\n      let engineName = parsedName.fullNameWithoutType;\n      let engineRoutesModule = engineName + '/routes';\n\n      if (this._moduleRegistry.has(engineRoutesModule)) {\n        let routeMap = this._extractDefaultExport(engineRoutesModule);\n\n        (true && !(routeMap.isRouteMap) && Ember.assert(`The route map for ${engineName} should be wrapped by 'buildRoutes' before exporting.`, routeMap.isRouteMap));\n        return routeMap;\n      }\n    },\n\n    resolveTemplate(parsedName) {\n      let resolved = this.resolveOther(parsedName);\n\n      if (resolved == null) {\n        resolved = Ember.TEMPLATES[parsedName.fullNameWithoutType];\n      }\n\n      return resolved;\n    },\n\n    mainModuleName(parsedName) {\n      if (parsedName.fullNameWithoutType === 'main') {\n        // if router:main or adapter:main look for a module with just the type first\n        return parsedName.prefix + '/' + parsedName.type;\n      }\n    },\n\n    defaultModuleName(parsedName) {\n      return parsedName.prefix + '/' + this.pluralize(parsedName.type) + '/' + parsedName.fullNameWithoutType;\n    },\n\n    nestedColocationComponentModuleName(parsedName) {\n      if (parsedName.type === 'component') {\n        return parsedName.prefix + '/' + this.pluralize(parsedName.type) + '/' + parsedName.fullNameWithoutType + '/index';\n      }\n    },\n\n    prefix(parsedName) {\n      let tmpPrefix = this.namespace.modulePrefix;\n\n      if (this.namespace[parsedName.type + 'Prefix']) {\n        tmpPrefix = this.namespace[parsedName.type + 'Prefix'];\n      }\n\n      return tmpPrefix;\n    },\n\n    /**\n      A listing of functions to test for moduleName's based on the provided\n     `parsedName`. This allows easy customization of additional module based\n     lookup patterns.\n      @property moduleNameLookupPatterns\n     @returns {Ember.Array}\n     */\n    moduleNameLookupPatterns: Ember.computed(function () {\n      return [this.podBasedModuleName, this.podBasedComponentsInSubdir, this.mainModuleName, this.defaultModuleName, this.nestedColocationComponentModuleName];\n    }).readOnly(),\n\n    findModuleName(parsedName, loggingDisabled) {\n      let moduleNameLookupPatterns = this.get('moduleNameLookupPatterns');\n      let moduleName;\n\n      for (let index = 0, length = moduleNameLookupPatterns.length; index < length; index++) {\n        let item = moduleNameLookupPatterns[index];\n        let tmpModuleName = item.call(this, parsedName); // allow treat all dashed and all underscored as the same thing\n        // supports components with dashes and other stuff with underscores.\n\n        if (tmpModuleName) {\n          tmpModuleName = this.chooseModuleName(tmpModuleName, parsedName);\n        }\n\n        if (tmpModuleName && this._moduleRegistry.has(tmpModuleName)) {\n          moduleName = tmpModuleName;\n        }\n\n        if (!loggingDisabled) {\n          this._logLookup(moduleName, parsedName, tmpModuleName);\n        }\n\n        if (moduleName) {\n          return moduleName;\n        }\n      }\n    },\n\n    chooseModuleName(moduleName, parsedName) {\n      let underscoredModuleName = Ember.String.underscore(moduleName);\n\n      if (moduleName !== underscoredModuleName && this._moduleRegistry.has(moduleName) && this._moduleRegistry.has(underscoredModuleName)) {\n        throw new TypeError(`Ambiguous module names: '${moduleName}' and '${underscoredModuleName}'`);\n      }\n\n      if (this._moduleRegistry.has(moduleName)) {\n        return moduleName;\n      } else if (this._moduleRegistry.has(underscoredModuleName)) {\n        return underscoredModuleName;\n      } // workaround for dasherized partials:\n      // something/something/-something => something/something/_something\n\n\n      let partializedModuleName = moduleName.replace(/\\/-([^/]*)$/, '/_$1');\n\n      if (this._moduleRegistry.has(partializedModuleName)) {\n        (true && !(false) && Ember.deprecate('Modules should not contain underscores. ' + 'Attempted to lookup \"' + moduleName + '\" which ' + 'was not found. Please rename \"' + partializedModuleName + '\" ' + 'to \"' + moduleName + '\" instead.', false, {\n          id: 'ember-resolver.underscored-modules',\n          until: '3.0.0'\n        }));\n        return partializedModuleName;\n      }\n\n      if (true\n      /* DEBUG */\n      ) {\n        let isCamelCaseHelper = parsedName.type === 'helper' && /[a-z]+[A-Z]+/.test(moduleName);\n\n        if (isCamelCaseHelper) {\n          this._camelCaseHelperWarnedNames = this._camelCaseHelperWarnedNames || [];\n          let alreadyWarned = this._camelCaseHelperWarnedNames.indexOf(parsedName.fullName) > -1;\n\n          if (!alreadyWarned && this._moduleRegistry.has(Ember.String.dasherize(moduleName))) {\n            this._camelCaseHelperWarnedNames.push(parsedName.fullName);\n\n            (true && Ember.warn('Attempted to lookup \"' + parsedName.fullName + '\" which ' + 'was not found. In previous versions of ember-resolver, a bug would have ' + 'caused the module at \"' + Ember.String.dasherize(moduleName) + '\" to be ' + 'returned for this camel case helper name. This has been fixed. ' + 'Use the dasherized name to resolve the module that would have been ' + 'returned in previous versions.', false, {\n              id: 'ember-resolver.camelcase-helper-names',\n              until: '3.0.0'\n            }));\n          }\n        }\n      }\n    },\n\n    // used by Ember.DefaultResolver.prototype._logLookup\n    lookupDescription(fullName) {\n      let parsedName = this.parseName(fullName);\n      let moduleName = this.findModuleName(parsedName, true);\n      return moduleName;\n    },\n\n    // only needed until 1.6.0-beta.2 can be required\n    _logLookup(found, parsedName, description) {\n      if (!Ember.ENV.LOG_MODULE_RESOLVER && !parsedName.root.LOG_RESOLVER) {\n        return;\n      }\n\n      let padding;\n      let symbol = found ? '[✓]' : '[ ]';\n\n      if (parsedName.fullName.length > 60) {\n        padding = '.';\n      } else {\n        padding = new Array(60 - parsedName.fullName.length).join('.');\n      }\n\n      if (!description) {\n        description = this.lookupDescription(parsedName);\n      }\n      /* eslint-disable no-console */\n\n\n      if (console && console.info) {\n        console.info(symbol, parsedName.fullName, padding, description);\n      }\n    },\n\n    knownForType(type) {\n      let moduleKeys = this._moduleRegistry.moduleNames();\n\n      let items = Object.create(null);\n\n      for (let index = 0, length = moduleKeys.length; index < length; index++) {\n        let moduleName = moduleKeys[index];\n        let fullname = this.translateToContainerFullname(type, moduleName);\n\n        if (fullname) {\n          items[fullname] = true;\n        }\n      }\n\n      return items;\n    },\n\n    translateToContainerFullname(type, moduleName) {\n      let prefix = this.prefix({\n        type\n      }); // Note: using string manipulation here rather than regexes for better performance.\n      // pod modules\n      // '^' + prefix + '/(.+)/' + type + '$'\n\n      let podPrefix = prefix + '/';\n      let podSuffix = '/' + type;\n      let start = moduleName.indexOf(podPrefix);\n      let end = moduleName.indexOf(podSuffix);\n\n      if (start === 0 && end === moduleName.length - podSuffix.length && moduleName.length > podPrefix.length + podSuffix.length) {\n        return type + ':' + moduleName.slice(start + podPrefix.length, end);\n      } // non-pod modules\n      // '^' + prefix + '/' + pluralizedType + '/(.+)$'\n\n\n      let pluralizedType = this.pluralize(type);\n      let nonPodPrefix = prefix + '/' + pluralizedType + '/';\n\n      if (moduleName.indexOf(nonPodPrefix) === 0 && moduleName.length > nonPodPrefix.length) {\n        return type + ':' + moduleName.slice(nonPodPrefix.length);\n      }\n    },\n\n    _extractDefaultExport(normalizedModuleName) {\n      let module = require(normalizedModuleName, null, null, true\n      /* force sync */\n      );\n\n      if (module && module['default']) {\n        module = module['default'];\n      }\n\n      return module;\n    }\n\n  });\n  Resolver.reopenClass({\n    moduleBasedResolver: true\n  });\n  var _default = Resolver;\n  _exports.default = _default;\n});","define(\"ember-resolver/utils/class-factory\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = classFactory;\n\n  function classFactory(klass) {\n    return {\n      create(injections) {\n        if (typeof klass.extend === 'function') {\n          return klass.extend(injections);\n        } else {\n          return klass;\n        }\n      }\n\n    };\n  }\n});","define(\"ember-simple-tree/components/x-tree-branch\", [\"exports\", \"ember-simple-tree/templates/components/x-tree-branch\"], function (_exports, _xTreeBranch) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  var _default = Ember.Component.extend({\n    layout: _xTreeBranch.default,\n    tagName: 'ul',\n    classNames: ['tree-branch']\n  });\n\n  _exports.default = _default;\n});","define(\"ember-simple-tree/components/x-tree-checkbox\", [\"exports\", \"ember-simple-tree/templates/components/x-tree-checkbox\"], function (_exports, _xTreeCheckbox) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  var _default = Ember.Component.extend({\n    layout: _xTreeCheckbox.default,\n    tagName: 'span',\n    classNames: ['tree-checkbox'],\n    actions: {\n      // IE requires a change action to be set or it will\n      // attempt to mutate the checked attribute\n      noop() {}\n\n    }\n  });\n\n  _exports.default = _default;\n});","define(\"ember-simple-tree/components/x-tree-children\", [\"exports\", \"ember-simple-tree/templates/components/x-tree-children\"], function (_exports, _xTreeChildren) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  var _default = Ember.Component.extend({\n    layout: _xTreeChildren.default,\n    tagName: 'li',\n    classNames: ['tree-node'],\n    actions: {\n      updateCheckbox() {\n        if (this.recursiveCheck) {\n          let children = Ember.get(this, 'model.children');\n\n          if (children.length) {\n            let isChecked = false;\n            let isIndeterminate = false;\n\n            if (children.every(x => x.isChecked)) {\n              isChecked = true;\n            } else if (children.some(x => x.isChecked || x.isIndeterminate)) {\n              isIndeterminate = true;\n            }\n\n            Ember.setProperties(this.model, {\n              isChecked,\n              isIndeterminate\n            });\n          }\n\n          if (this.updateCheckbox) {\n            this.updateCheckbox();\n          }\n        }\n      }\n\n    }\n  });\n\n  _exports.default = _default;\n});","define(\"ember-simple-tree/components/x-tree-collapsed-icon\", [\"exports\", \"ember-simple-tree/templates/components/x-tree-collapsed-icon\"], function (_exports, _xTreeCollapsedIcon) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  var _default = Ember.Component.extend({\n    layout: _xTreeCollapsedIcon.default\n  });\n\n  _exports.default = _default;\n});","define(\"ember-simple-tree/components/x-tree-expanded-icon\", [\"exports\", \"ember-simple-tree/templates/components/x-tree-expanded-icon\"], function (_exports, _xTreeExpandedIcon) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  var _default = Ember.Component.extend({\n    layout: _xTreeExpandedIcon.default\n  });\n\n  _exports.default = _default;\n});","define(\"ember-simple-tree/components/x-tree-node\", [\"exports\", \"ember-simple-tree/templates/components/x-tree-node\"], function (_exports, _xTreeNode) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  var _default = Ember.Component.extend({\n    layout: _xTreeNode.default,\n    classNameBindings: ['model.isDisabled:tree-disabled', 'model.isSelected:tree-highlight', 'isChosen:tree-chosen', 'model.children.length:tree-children'],\n    recursiveCheck: false,\n    isChosen: Ember.computed('model.id', 'chosenId', function () {\n      return Ember.get(this, 'model.id') === this.chosenId;\n    }),\n\n    click() {\n      if (this.onSelect && !Ember.get(this, 'model.isDisabled')) {\n        let wasChecked = Ember.get(this, 'model.isChecked');\n        this.onSelect(this.model);\n        let isChecked = Ember.get(this, 'model.isChecked');\n\n        if (isChecked !== wasChecked && this.recursiveCheck) {\n          this.setChildCheckboxesRecursively(this.model, isChecked);\n          this.updateCheckbox();\n        }\n      }\n    },\n\n    contextMenu(event) {\n      if (this.onContextMenu) {\n        event.preventDefault();\n        this.onContextMenu(this.model);\n      }\n    },\n\n    didInsertElement() {\n      this._super(...arguments);\n\n      this._handleMouseEnter = this.handleMouseEnter.bind(this);\n      this._handleMouseLeave = this.handleMouseLeave.bind(this);\n      this.element.addEventListener('mouseenter', this._handleMouseEnter);\n      this.element.addEventListener('mouseleave', this._handleMouseLeave);\n    },\n\n    willDestroyElement() {\n      this._super(...arguments);\n\n      this.element.removeEventListener('mouseenter', this._handleMouseEnter);\n      this.element.removeEventListener('mouseleave', this._handleMouseLeave);\n    },\n\n    handleMouseEnter() {\n      if (!Ember.get(this, 'model.isDisabled')) {\n        Ember.set(this, 'model.isSelected', true);\n      }\n\n      if (this.onHover) {\n        this.onHover(this.model);\n      }\n    },\n\n    handleMouseLeave() {\n      Ember.set(this, 'model.isSelected', false);\n\n      if (this.onHoverOut) {\n        this.onHoverOut(this.model);\n      }\n    },\n\n    setChildCheckboxesRecursively(node, isChecked) {\n      let children = Ember.get(node, 'children');\n\n      if (children.length) {\n        children.forEach(child => {\n          Ember.setProperties(child, {\n            isChecked,\n            isIndeterminate: false\n          });\n          this.setChildCheckboxesRecursively(child, isChecked);\n        });\n      }\n    },\n\n    actions: {\n      toggleCheck(event) {\n        event.stopPropagation();\n\n        if (!Ember.get(this, 'model.isDisabled')) {\n          let isChecked = this.toggleProperty('model.isChecked');\n\n          if (this.recursiveCheck) {\n            this.setChildCheckboxesRecursively(this.model, isChecked);\n            this.updateCheckbox();\n          }\n\n          if (this.onCheck) {\n            this.onCheck(this.model);\n          }\n        }\n      },\n\n      toggleExpand() {\n        this.toggleProperty('model.isExpanded');\n      }\n\n    }\n  });\n\n  _exports.default = _default;\n});","define(\"ember-simple-tree/components/x-tree-toggle\", [\"exports\", \"ember-simple-tree/templates/components/x-tree-toggle\"], function (_exports, _xTreeToggle) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  var _default = Ember.Component.extend({\n    layout: _xTreeToggle.default,\n    tagName: 'span',\n    classNames: ['tree-toggle']\n  });\n\n  _exports.default = _default;\n});","define(\"ember-simple-tree/components/x-tree\", [\"exports\", \"ember-simple-tree/templates/components/x-tree\", \"ember-simple-tree/utils/tree\"], function (_exports, _xTree, _tree) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  var _default = Ember.Component.extend({\n    layout: _xTree.default,\n    expandDepth: 0,\n    recursiveCheck: false,\n    classNames: ['tree'],\n    expandedIcon: 'x-tree-expanded-icon',\n    collapsedIcon: 'x-tree-collapsed-icon',\n\n    init() {\n      this._super(...arguments); // Make sure chosen item is highlighted and expanded-to in the tree\n\n\n      if (this.chosenId) {\n        let chosen = (0, _tree.getDescendents)(this.model).findBy('id', this.chosenId);\n\n        if (chosen) {\n          (0, _tree.getAncestors)(this.model, chosen).forEach(x => {\n            if (Ember.get(x, 'id') !== this.chosenId) {\n              Ember.set(x, 'isExpanded', true);\n            }\n          });\n        }\n      } // Expand to given depth\n\n\n      if (this.expandDepth) {\n        (0, _tree.getDescendents)(this.model, this.expandDepth).setEach('isExpanded', true);\n      }\n    }\n\n  });\n\n  _exports.default = _default;\n});","define(\"ember-simple-tree/templates/components/x-tree-branch\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  var _default = Ember.HTMLBars.template({\n    \"id\": \"bGZISUbN\",\n    \"block\": \"{\\\"symbols\\\":[\\\"child\\\",\\\"node\\\",\\\"&default\\\"],\\\"statements\\\":[[4,\\\"each\\\",[[24,[\\\"model\\\"]]],null,{\\\"statements\\\":[[4,\\\"if\\\",[[23,1,[\\\"isVisible\\\"]]],null,{\\\"statements\\\":[[4,\\\"if\\\",[[25,3]],null,{\\\"statements\\\":[[4,\\\"x-tree-children\\\",null,[[\\\"checkable\\\",\\\"recursiveCheck\\\",\\\"updateCheckbox\\\",\\\"chosenId\\\",\\\"onCheck\\\",\\\"onContextMenu\\\",\\\"onSelect\\\",\\\"onHover\\\",\\\"onHoverOut\\\",\\\"model\\\",\\\"expandedIcon\\\",\\\"collapsedIcon\\\"],[[24,[\\\"checkable\\\"]],[24,[\\\"recursiveCheck\\\"]],[24,[\\\"updateCheckbox\\\"]],[24,[\\\"chosenId\\\"]],[24,[\\\"onCheck\\\"]],[24,[\\\"onContextMenu\\\"]],[24,[\\\"onSelect\\\"]],[24,[\\\"onHover\\\"]],[24,[\\\"onHoverOut\\\"]],[23,1,[]],[24,[\\\"expandedIcon\\\"]],[24,[\\\"collapsedIcon\\\"]]]],{\\\"statements\\\":[[0,\\\"        \\\"],[14,3,[[23,2,[]]]],[0,\\\"\\\\n\\\"]],\\\"parameters\\\":[2]},null]],\\\"parameters\\\":[]},{\\\"statements\\\":[[0,\\\"      \\\"],[1,[28,\\\"x-tree-children\\\",null,[[\\\"model\\\",\\\"checkable\\\",\\\"recursiveCheck\\\",\\\"updateCheckbox\\\",\\\"chosenId\\\",\\\"onCheck\\\",\\\"onContextMenu\\\",\\\"onSelect\\\",\\\"onHover\\\",\\\"onHoverOut\\\",\\\"expandedIcon\\\",\\\"collapsedIcon\\\"],[[23,1,[]],[24,[\\\"checkable\\\"]],[24,[\\\"recursiveCheck\\\"]],[24,[\\\"updateCheckbox\\\"]],[24,[\\\"chosenId\\\"]],[24,[\\\"onCheck\\\"]],[24,[\\\"onContextMenu\\\"]],[24,[\\\"onSelect\\\"]],[24,[\\\"onHover\\\"]],[24,[\\\"onHoverOut\\\"]],[24,[\\\"expandedIcon\\\"]],[24,[\\\"collapsedIcon\\\"]]]]],false],[0,\\\"\\\\n\\\"]],\\\"parameters\\\":[]}]],\\\"parameters\\\":[]},null]],\\\"parameters\\\":[1]},null]],\\\"hasEval\\\":false}\",\n    \"meta\": {\n      \"moduleName\": \"ember-simple-tree/templates/components/x-tree-branch.hbs\"\n    }\n  });\n\n  _exports.default = _default;\n});","define(\"ember-simple-tree/templates/components/x-tree-checkbox\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  var _default = Ember.HTMLBars.template({\n    \"id\": \"D2/bOE36\",\n    \"block\": \"{\\\"symbols\\\":[],\\\"statements\\\":[[7,\\\"span\\\",true],[10,\\\"role\\\",\\\"button\\\"],[11,\\\"onclick\\\",[28,\\\"action\\\",[[23,0,[]],[24,[\\\"toggleCheck\\\"]]],null]],[8],[0,\\\"\\\\n  \\\"],[1,[28,\\\"input\\\",null,[[\\\"type\\\",\\\"checked\\\",\\\"disabled\\\",\\\"indeterminate\\\",\\\"change\\\"],[\\\"checkbox\\\",[24,[\\\"model\\\",\\\"isChecked\\\"]],[24,[\\\"model\\\",\\\"isDisabled\\\"]],[24,[\\\"model\\\",\\\"isIndeterminate\\\"]],[28,\\\"action\\\",[[23,0,[]],\\\"noop\\\"],null]]]],false],[0,\\\"\\\\n\\\"],[9],[0,\\\"\\\\n\\\"]],\\\"hasEval\\\":false}\",\n    \"meta\": {\n      \"moduleName\": \"ember-simple-tree/templates/components/x-tree-checkbox.hbs\"\n    }\n  });\n\n  _exports.default = _default;\n});","define(\"ember-simple-tree/templates/components/x-tree-children\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  var _default = Ember.HTMLBars.template({\n    \"id\": \"2lpx5ShA\",\n    \"block\": \"{\\\"symbols\\\":[\\\"node\\\",\\\"node\\\",\\\"&default\\\"],\\\"statements\\\":[[4,\\\"if\\\",[[25,3]],null,{\\\"statements\\\":[[4,\\\"x-tree-node\\\",null,[[\\\"checkable\\\",\\\"recursiveCheck\\\",\\\"updateCheckbox\\\",\\\"chosenId\\\",\\\"onCheck\\\",\\\"onContextMenu\\\",\\\"onSelect\\\",\\\"onHover\\\",\\\"onHoverOut\\\",\\\"model\\\",\\\"expandedIcon\\\",\\\"collapsedIcon\\\"],[[24,[\\\"checkable\\\"]],[24,[\\\"recursiveCheck\\\"]],[28,\\\"action\\\",[[23,0,[]],\\\"updateCheckbox\\\"],null],[24,[\\\"chosenId\\\"]],[24,[\\\"onCheck\\\"]],[24,[\\\"onContextMenu\\\"]],[24,[\\\"onSelect\\\"]],[24,[\\\"onHover\\\"]],[24,[\\\"onHoverOut\\\"]],[24,[\\\"model\\\"]],[24,[\\\"expandedIcon\\\"]],[24,[\\\"collapsedIcon\\\"]]]],{\\\"statements\\\":[[0,\\\"    \\\"],[14,3,[[23,2,[]]]],[0,\\\"\\\\n\\\"]],\\\"parameters\\\":[2]},null],[0,\\\"\\\\n\\\"],[4,\\\"if\\\",[[24,[\\\"model\\\",\\\"isExpanded\\\"]]],null,{\\\"statements\\\":[[4,\\\"x-tree-branch\\\",null,[[\\\"checkable\\\",\\\"recursiveCheck\\\",\\\"updateCheckbox\\\",\\\"chosenId\\\",\\\"onCheck\\\",\\\"onContextMenu\\\",\\\"onSelect\\\",\\\"onHover\\\",\\\"onHoverOut\\\",\\\"model\\\",\\\"expandedIcon\\\",\\\"collapsedIcon\\\"],[[24,[\\\"checkable\\\"]],[24,[\\\"recursiveCheck\\\"]],[28,\\\"action\\\",[[23,0,[]],\\\"updateCheckbox\\\"],null],[24,[\\\"chosenId\\\"]],[24,[\\\"onCheck\\\"]],[24,[\\\"onContextMenu\\\"]],[24,[\\\"onSelect\\\"]],[24,[\\\"onHover\\\"]],[24,[\\\"onHoverOut\\\"]],[24,[\\\"model\\\",\\\"children\\\"]],[24,[\\\"expandedIcon\\\"]],[24,[\\\"collapsedIcon\\\"]]]],{\\\"statements\\\":[[0,\\\"      \\\"],[14,3,[[23,1,[]]]],[0,\\\"\\\\n\\\"]],\\\"parameters\\\":[1]},null]],\\\"parameters\\\":[]},null]],\\\"parameters\\\":[]},{\\\"statements\\\":[[0,\\\"  \\\"],[1,[28,\\\"x-tree-node\\\",null,[[\\\"model\\\",\\\"checkable\\\",\\\"recursiveCheck\\\",\\\"updateCheckbox\\\",\\\"chosenId\\\",\\\"onCheck\\\",\\\"onContextMenu\\\",\\\"onSelect\\\",\\\"onHover\\\",\\\"onHoverOut\\\",\\\"expandedIcon\\\",\\\"collapsedIcon\\\"],[[24,[\\\"model\\\"]],[24,[\\\"checkable\\\"]],[24,[\\\"recursiveCheck\\\"]],[28,\\\"action\\\",[[23,0,[]],\\\"updateCheckbox\\\"],null],[24,[\\\"chosenId\\\"]],[24,[\\\"onCheck\\\"]],[24,[\\\"onContextMenu\\\"]],[24,[\\\"onSelect\\\"]],[24,[\\\"onHover\\\"]],[24,[\\\"onHoverOut\\\"]],[24,[\\\"expandedIcon\\\"]],[24,[\\\"collapsedIcon\\\"]]]]],false],[0,\\\"\\\\n\\\"],[4,\\\"if\\\",[[24,[\\\"model\\\",\\\"isExpanded\\\"]]],null,{\\\"statements\\\":[[0,\\\"    \\\"],[1,[28,\\\"x-tree-branch\\\",null,[[\\\"model\\\",\\\"checkable\\\",\\\"recursiveCheck\\\",\\\"updateCheckbox\\\",\\\"chosenId\\\",\\\"onCheck\\\",\\\"onContextMenu\\\",\\\"onSelect\\\",\\\"onHover\\\",\\\"onHoverOut\\\",\\\"expandedIcon\\\",\\\"collapsedIcon\\\"],[[24,[\\\"model\\\",\\\"children\\\"]],[24,[\\\"checkable\\\"]],[24,[\\\"recursiveCheck\\\"]],[28,\\\"action\\\",[[23,0,[]],\\\"updateCheckbox\\\"],null],[24,[\\\"chosenId\\\"]],[24,[\\\"onCheck\\\"]],[24,[\\\"onContextMenu\\\"]],[24,[\\\"onSelect\\\"]],[24,[\\\"onHover\\\"]],[24,[\\\"onHoverOut\\\"]],[24,[\\\"expandedIcon\\\"]],[24,[\\\"collapsedIcon\\\"]]]]],false],[0,\\\"\\\\n\\\"]],\\\"parameters\\\":[]},null]],\\\"parameters\\\":[]}]],\\\"hasEval\\\":false}\",\n    \"meta\": {\n      \"moduleName\": \"ember-simple-tree/templates/components/x-tree-children.hbs\"\n    }\n  });\n\n  _exports.default = _default;\n});","define(\"ember-simple-tree/templates/components/x-tree-collapsed-icon\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  var _default = Ember.HTMLBars.template({\n    \"id\": \"trZJDQFd\",\n    \"block\": \"{\\\"symbols\\\":[],\\\"statements\\\":[[0,\\\"▶\\\\n\\\"]],\\\"hasEval\\\":false}\",\n    \"meta\": {\n      \"moduleName\": \"ember-simple-tree/templates/components/x-tree-collapsed-icon.hbs\"\n    }\n  });\n\n  _exports.default = _default;\n});","define(\"ember-simple-tree/templates/components/x-tree-expanded-icon\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  var _default = Ember.HTMLBars.template({\n    \"id\": \"jhBmz3In\",\n    \"block\": \"{\\\"symbols\\\":[],\\\"statements\\\":[[0,\\\"▼\\\\n\\\"]],\\\"hasEval\\\":false}\",\n    \"meta\": {\n      \"moduleName\": \"ember-simple-tree/templates/components/x-tree-expanded-icon.hbs\"\n    }\n  });\n\n  _exports.default = _default;\n});","define(\"ember-simple-tree/templates/components/x-tree-node\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  var _default = Ember.HTMLBars.template({\n    \"id\": \"cpjg0oac\",\n    \"block\": \"{\\\"symbols\\\":[\\\"&default\\\"],\\\"statements\\\":[[4,\\\"if\\\",[[25,1]],null,{\\\"statements\\\":[[0,\\\"  \\\"],[14,1,[[28,\\\"hash\\\",null,[[\\\"model\\\",\\\"toggle\\\",\\\"checkbox\\\"],[[24,[\\\"model\\\"]],[28,\\\"component\\\",[\\\"x-tree-toggle\\\"],[[\\\"model\\\",\\\"toggleExpand\\\",\\\"expandedIcon\\\",\\\"collapsedIcon\\\"],[[24,[\\\"model\\\"]],[28,\\\"action\\\",[[23,0,[]],\\\"toggleExpand\\\"],null],[24,[\\\"expandedIcon\\\"]],[24,[\\\"collapsedIcon\\\"]]]]],[28,\\\"component\\\",[\\\"x-tree-checkbox\\\"],[[\\\"model\\\",\\\"toggleCheck\\\"],[[24,[\\\"model\\\"]],[28,\\\"action\\\",[[23,0,[]],\\\"toggleCheck\\\"],null]]]]]]]]],[0,\\\"\\\\n\\\"]],\\\"parameters\\\":[]},{\\\"statements\\\":[[0,\\\"  \\\"],[1,[28,\\\"x-tree-toggle\\\",null,[[\\\"model\\\",\\\"toggleExpand\\\",\\\"expandedIcon\\\",\\\"collapsedIcon\\\"],[[24,[\\\"model\\\"]],[28,\\\"action\\\",[[23,0,[]],\\\"toggleExpand\\\"],null],[24,[\\\"expandedIcon\\\"]],[24,[\\\"collapsedIcon\\\"]]]]],false],[0,\\\"\\\\n\\\\n\\\"],[4,\\\"if\\\",[[24,[\\\"checkable\\\"]]],null,{\\\"statements\\\":[[0,\\\"    \\\"],[1,[28,\\\"x-tree-checkbox\\\",null,[[\\\"model\\\",\\\"toggleCheck\\\"],[[24,[\\\"model\\\"]],[28,\\\"action\\\",[[23,0,[]],\\\"toggleCheck\\\"],null]]]],false],[0,\\\"\\\\n\\\"]],\\\"parameters\\\":[]},null],[0,\\\"  \\\"],[7,\\\"span\\\",true],[10,\\\"class\\\",\\\"tree-label\\\"],[8],[0,\\\"\\\\n    \\\"],[1,[24,[\\\"model\\\",\\\"name\\\"]],false],[0,\\\"\\\\n  \\\"],[9],[0,\\\"\\\\n\\\"]],\\\"parameters\\\":[]}]],\\\"hasEval\\\":false}\",\n    \"meta\": {\n      \"moduleName\": \"ember-simple-tree/templates/components/x-tree-node.hbs\"\n    }\n  });\n\n  _exports.default = _default;\n});","define(\"ember-simple-tree/templates/components/x-tree-toggle\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  var _default = Ember.HTMLBars.template({\n    \"id\": \"Kxh9+DWb\",\n    \"block\": \"{\\\"symbols\\\":[],\\\"statements\\\":[[7,\\\"span\\\",false],[12,\\\"role\\\",\\\"button\\\"],[12,\\\"class\\\",\\\"toggle-icon\\\"],[3,\\\"action\\\",[[23,0,[]],[24,[\\\"toggleExpand\\\"]]],[[\\\"bubbles\\\"],[false]]],[8],[0,\\\"\\\\n\\\"],[4,\\\"if\\\",[[24,[\\\"model\\\",\\\"children\\\",\\\"length\\\"]]],null,{\\\"statements\\\":[[4,\\\"if\\\",[[24,[\\\"model\\\",\\\"isExpanded\\\"]]],null,{\\\"statements\\\":[[0,\\\"      \\\"],[1,[28,\\\"component\\\",[[24,[\\\"expandedIcon\\\"]]],null],false],[0,\\\"\\\\n\\\"]],\\\"parameters\\\":[]},{\\\"statements\\\":[[0,\\\"      \\\"],[1,[28,\\\"component\\\",[[24,[\\\"collapsedIcon\\\"]]],null],false],[0,\\\"\\\\n\\\"]],\\\"parameters\\\":[]}]],\\\"parameters\\\":[]},{\\\"statements\\\":[[0,\\\"      \\\\n\\\"]],\\\"parameters\\\":[]}],[9],[0,\\\"\\\\n\\\"]],\\\"hasEval\\\":false}\",\n    \"meta\": {\n      \"moduleName\": \"ember-simple-tree/templates/components/x-tree-toggle.hbs\"\n    }\n  });\n\n  _exports.default = _default;\n});","define(\"ember-simple-tree/templates/components/x-tree\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  var _default = Ember.HTMLBars.template({\n    \"id\": \"bgz7Pz1e\",\n    \"block\": \"{\\\"symbols\\\":[\\\"node\\\",\\\"&default\\\"],\\\"statements\\\":[[4,\\\"if\\\",[[25,2]],null,{\\\"statements\\\":[[4,\\\"x-tree-branch\\\",null,[[\\\"checkable\\\",\\\"recursiveCheck\\\",\\\"chosenId\\\",\\\"onCheck\\\",\\\"onContextMenu\\\",\\\"onSelect\\\",\\\"onHover\\\",\\\"onHoverOut\\\",\\\"model\\\",\\\"expandedIcon\\\",\\\"collapsedIcon\\\"],[[24,[\\\"checkable\\\"]],[24,[\\\"recursiveCheck\\\"]],[24,[\\\"chosenId\\\"]],[24,[\\\"onCheck\\\"]],[24,[\\\"onContextMenu\\\"]],[24,[\\\"onSelect\\\"]],[24,[\\\"onHover\\\"]],[24,[\\\"onHoverOut\\\"]],[24,[\\\"model\\\"]],[24,[\\\"expandedIcon\\\"]],[24,[\\\"collapsedIcon\\\"]]]],{\\\"statements\\\":[[0,\\\"    \\\"],[14,2,[[23,1,[]]]],[0,\\\"\\\\n\\\"]],\\\"parameters\\\":[1]},null]],\\\"parameters\\\":[]},{\\\"statements\\\":[[0,\\\"  \\\"],[1,[28,\\\"x-tree-branch\\\",null,[[\\\"model\\\",\\\"checkable\\\",\\\"recursiveCheck\\\",\\\"chosenId\\\",\\\"onCheck\\\",\\\"onContextMenu\\\",\\\"onSelect\\\",\\\"onHover\\\",\\\"onHoverOut\\\",\\\"expandedIcon\\\",\\\"collapsedIcon\\\"],[[24,[\\\"model\\\"]],[24,[\\\"checkable\\\"]],[24,[\\\"recursiveCheck\\\"]],[24,[\\\"chosenId\\\"]],[24,[\\\"onCheck\\\"]],[24,[\\\"onContextMenu\\\"]],[24,[\\\"onSelect\\\"]],[24,[\\\"onHover\\\"]],[24,[\\\"onHoverOut\\\"]],[24,[\\\"expandedIcon\\\"]],[24,[\\\"collapsedIcon\\\"]]]]],false],[0,\\\"\\\\n\\\"]],\\\"parameters\\\":[]}]],\\\"hasEval\\\":false}\",\n    \"meta\": {\n      \"moduleName\": \"ember-simple-tree/templates/components/x-tree.hbs\"\n    }\n  });\n\n  _exports.default = _default;\n});","define(\"ember-simple-tree/utils/tree\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.buildTree = buildTree;\n  _exports.getDescendents = getDescendents;\n  _exports.getAncestors = getAncestors;\n  _exports.getParent = getParent;\n\n  /* Build a tree (nested objects) from a plain array\n   * using `id` and `parentId` as references for the\n   * relationships. The `name` property is expected\n   * for rendering. Optionally, `valueKey` can be\n   * passed for `id` and `labelKey` for `name`.\n   * If the model is flat, it will return a list.\n   */\n  function buildTree(model, options = {}) {\n    let tree = {};\n    let roots = Ember.A();\n\n    if (Ember.isEmpty(model)) {\n      return roots;\n    } // Set defaults and add all nodes to tree\n\n\n    model.forEach(node => {\n      // Alternative name for `id`\n      if (options.valueKey) {\n        Ember.set(node, 'id', Ember.get(node, options.valueKey));\n      } // Alternative name for `name`\n\n\n      if (options.labelKey) {\n        Ember.set(node, 'name', Ember.get(node, options.labelKey));\n      } // Defaults\n\n\n      Ember.set(node, 'children', Ember.A());\n      Ember.set(node, 'isChecked', Ember.get(node, 'isChecked') || false);\n      Ember.set(node, 'isDisabled', Ember.get(node, 'isDisabled') || false);\n      Ember.set(node, 'isExpanded', Ember.get(node, 'isExpanded') || false);\n      Ember.set(node, 'isSelected', Ember.get(node, 'isSelected') || false);\n      Ember.set(node, 'isVisible', Ember.get(node, 'isVisible') || true);\n      tree[Ember.get(node, 'id')] = node;\n    }); // Connect all children to their parent\n\n    model.forEach(node => {\n      let child = tree[Ember.get(node, options.valueKey || 'id')];\n      let parent = Ember.get(node, 'parentId');\n\n      if (Ember.isEmpty(parent)) {\n        roots.pushObject(child);\n      } else {\n        Ember.get(tree[parent], 'children').pushObject(child);\n      }\n    });\n    return roots;\n  } // Returns a flat list of all descenents, including the root\n\n\n  function getDescendents(tree, depth = -1) {\n    let descendents = Ember.A();\n\n    if (depth < 0) {\n      // Unlimited depth\n      tree.forEach(node => {\n        descendents.pushObject(node);\n        descendents.pushObjects(getDescendents(Ember.get(node, 'children')));\n      });\n    } else if (depth > 0) {\n      tree.forEach(node => {\n        descendents.pushObject(node);\n        descendents.pushObjects(getDescendents(Ember.get(node, 'children'), depth - 1));\n      });\n    }\n\n    return descendents;\n  } // Returns a flat list of ancestors, including the child\n\n\n  function getAncestors(tree, childNode) {\n    let ancestors = Ember.A();\n    let childId = Ember.get(childNode, 'id');\n    tree.forEach(node => {\n      if (!ancestors.isAny('id', childId)) {\n        if (Ember.get(node, 'id') === childId) {\n          ancestors.pushObject(node);\n        } else if (Ember.get(node, 'children.length') > 0) {\n          ancestors.pushObjects(getAncestors(Ember.get(node, 'children'), childNode));\n\n          if (ancestors.length > 0) {\n            ancestors.pushObject(node);\n          }\n        }\n      }\n    });\n    return ancestors;\n  } // Returns the parent of a child\n\n\n  function getParent(list, childNode) {\n    return list.find(x => x.children.find(y => y.id === Ember.get(childNode, 'id')));\n  }\n});","define(\"ember-test-waiters/build-waiter\", [\"exports\", \"ember-test-waiters\", \"ember-test-waiters/noop-test-waiter\"], function (_exports, _emberTestWaiters, _noopTestWaiter) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = buildWaiter;\n\n  /**\n   * Builds and returns a test waiter. The type of the\n   * returned waiter is dependent on whether the app or\n   * addon is in `DEBUG` mode or not.\n   *\n   * @param name {string} The name of the test waiter\n   * @returns {ITestWaiter}\n   *\n   * @example\n   *\n   * import Component from '@ember/component';\n   * import { buildWaiter } from 'ember-test-waiters';\n   *\n   * if (DEBUG) {\n   *   let waiter = buildWaiter('friend-waiter');\n   * }\n   *\n   * export default class Friendz extends Component {\n   *   didInsertElement() {\n   *     let token = waiter.beginAsync(this);\n   *\n   *     someAsyncWork().then(() => {\n   *       waiter.endAsync(token);\n   *     });\n   *   }\n   * }\n   */\n  function buildWaiter(name) {\n    if (true\n    /* DEBUG */\n    ) {\n      return new _emberTestWaiters.TestWaiter(name);\n    }\n\n    return new _noopTestWaiter.default(name);\n  }\n});","define(\"ember-test-waiters/index\", [\"exports\", \"ember-test-waiters/waiter-manager\", \"ember-test-waiters/test-waiter\", \"ember-test-waiters/build-waiter\", \"ember-test-waiters/wait-for-promise\"], function (_exports, _waiterManager, _testWaiter, _buildWaiter, _waitForPromise) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  Object.defineProperty(_exports, \"register\", {\n    enumerable: true,\n    get: function () {\n      return _waiterManager.register;\n    }\n  });\n  Object.defineProperty(_exports, \"unregister\", {\n    enumerable: true,\n    get: function () {\n      return _waiterManager.unregister;\n    }\n  });\n  Object.defineProperty(_exports, \"getWaiters\", {\n    enumerable: true,\n    get: function () {\n      return _waiterManager.getWaiters;\n    }\n  });\n  Object.defineProperty(_exports, \"_reset\", {\n    enumerable: true,\n    get: function () {\n      return _waiterManager._reset;\n    }\n  });\n  Object.defineProperty(_exports, \"getPendingWaiterState\", {\n    enumerable: true,\n    get: function () {\n      return _waiterManager.getPendingWaiterState;\n    }\n  });\n  Object.defineProperty(_exports, \"hasPendingWaiters\", {\n    enumerable: true,\n    get: function () {\n      return _waiterManager.hasPendingWaiters;\n    }\n  });\n  Object.defineProperty(_exports, \"TestWaiter\", {\n    enumerable: true,\n    get: function () {\n      return _testWaiter.default;\n    }\n  });\n  Object.defineProperty(_exports, \"buildWaiter\", {\n    enumerable: true,\n    get: function () {\n      return _buildWaiter.default;\n    }\n  });\n  Object.defineProperty(_exports, \"waitForPromise\", {\n    enumerable: true,\n    get: function () {\n      return _waitForPromise.default;\n    }\n  });\n});","define(\"ember-test-waiters/noop-test-waiter\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  /**\n   * A class providing a production, noop replacement for the {TestWaiter<T>} class.\n   *\n   * @public\n   * @class TestWaiter<T>\n   */\n  class NoopTestWaiter {\n    constructor(name) {\n      this.name = name;\n    }\n\n    beginAsync() {\n      return this;\n    }\n\n    endAsync() {}\n\n    waitUntil() {\n      return true;\n    }\n\n    debugInfo() {\n      return [];\n    }\n\n  }\n\n  _exports.default = NoopTestWaiter;\n});","define(\"ember-test-waiters/test-waiter\", [\"exports\", \"ember-test-waiters/waiter-manager\"], function (_exports, _waiterManager) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  let token = 0;\n\n  function getNextToken() {\n    return token++;\n  }\n  /**\n   * A class providing creation, registration and async waiting functionality.\n   *\n   * @public\n   * @class TestWaiter<T>\n   */\n\n\n  class TestWaiter {\n    /**\n     * @public\n     * @constructor\n     * @param name {WaiterName} the name of the test waiter\n     */\n    constructor(name, nextToken) {\n      this.isRegistered = false;\n      this.items = new Map();\n      this.name = name; // @ts-ignore\n\n      this.nextToken = nextToken || getNextToken;\n    }\n    /**\n     * Will register the waiter, allowing it to be opted in to pausing async\n     * operations until they're completed within your tests. You should invoke\n     * it after instantiating your `TestWaiter` instance.\n     *\n     * **Note**, if you forget to register your waiter, it will be registered\n     * for you on the first invocation of `beginAsync`.\n     *\n     * @private\n     * @method register\n     */\n\n\n    register() {\n      if (!this.isRegistered) {\n        (0, _waiterManager.register)(this);\n        this.isRegistered = true;\n      }\n    }\n    /**\n     * Should be used to signal the beginning of an async operation that\n     * is to be waited for. Invocation of this method should be paired with a subsequent\n     * `endAsync` call to indicate to the waiter system that the async operation is completed.\n     *\n     * @public\n     * @method beginAsync\n     * @param item {T} The item to register for waiting\n     * @param label {string} An optional label to identify the item\n     */\n\n\n    beginAsync(token = this.nextToken(), label) {\n      this.register();\n\n      if (this.items.has(token)) {\n        throw new Error(`beginAsync called for ${token} but it is already pending.`);\n      }\n\n      let error = new Error();\n      this.items.set(token, {\n        get stack() {\n          return error.stack;\n        },\n\n        label\n      });\n      return token;\n    }\n    /**\n     * Should be used to signal the end of an async operation. Invocation of this\n     * method should be paired with a preceeding `beginAsync` call, which would indicate the\n     * beginning of an async operation.\n     *\n     * @public\n     * @method endAsync\n     * @param item {T} The item to that was registered for waiting\n     */\n\n\n    endAsync(token) {\n      if (!this.items.has(token)) {\n        throw new Error(`endAsync called for ${token} but it is not currently pending.`);\n      }\n\n      this.items.delete(token);\n    }\n    /**\n     * Used to determine if the waiter system should still wait for async\n     * operations to complete.\n     *\n     * @public\n     * @method waitUntil\n     * @returns {boolean}\n     */\n\n\n    waitUntil() {\n      return this.items.size === 0;\n    }\n    /**\n     * Returns the `debugInfo` for each item tracking async operations in this waiter.\n     *\n     * @public\n     * @method debugInfo\n     * @returns {ITestWaiterDebugInfo}\n     */\n\n\n    debugInfo() {\n      return [...this.items.values()];\n    }\n\n  }\n\n  _exports.default = TestWaiter;\n});","define(\"ember-test-waiters/types/index\", [], function () {\n  \"use strict\";\n});","define(\"ember-test-waiters/wait-for-promise\", [\"exports\", \"ember-test-waiters/test-waiter\"], function (_exports, _testWaiter) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = waitForPromise;\n  const PROMISE_WAITER = new _testWaiter.default('promise-waiter');\n  /**\n   * A convenient utility function to simplify waiting for a promise.\n   *\n   * @public\n   * @param promise {Promise<T>} The promise to track async operations for\n   * @param label {string} An optional string to identify the promise\n   *\n   * @example\n   *\n   * import Component from '@ember/component';\n   * import { waitForPromise } from 'ember-test-waiters';\n   *\n   * export default class Friendz extends Component {\n   *   didInsertElement() {\n   *     waitForPromise(new Promise(resolve => {\n   *       doSomeWork();\n   *       resolve();\n   *     }));\n   *   }\n   * }\n   */\n\n  function waitForPromise(promise, label) {\n    let result = promise;\n\n    if (true\n    /* DEBUG */\n    ) {\n      PROMISE_WAITER.beginAsync(promise, label);\n      result = promise.then(value => {\n        PROMISE_WAITER.endAsync(promise);\n        return value;\n      }, error => {\n        PROMISE_WAITER.endAsync(promise);\n        throw error;\n      });\n    }\n\n    return result;\n  }\n});","define(\"ember-test-waiters/waiter-manager\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.register = register;\n  _exports.unregister = unregister;\n  _exports.getWaiters = getWaiters;\n  _exports._reset = _reset;\n  _exports.getPendingWaiterState = getPendingWaiterState;\n  _exports.hasPendingWaiters = hasPendingWaiters;\n  const WAITERS = new Map();\n  /**\n   * Backwards compatibility with legacy waiters system.\n   *\n   * We want to always register a waiter using the legacy waiter system, as right\n   * now if consumers are not on the right version of @ember/test-helpers, using\n   * this addon will result in none of these waiters waiting.\n   */\n  // eslint-disable-next-line ember/new-module-imports\n\n  if (Ember.Test) {\n    Ember.Test.registerWaiter(() => !hasPendingWaiters());\n  }\n  /**\n   * Registers a waiter.\n   *\n   * @public\n   * @param waiter {IWaiter} A test waiter instance\n   */\n\n\n  function register(waiter) {\n    WAITERS.set(waiter.name, waiter);\n  }\n  /**\n   * Unregisters a waiter.\n   *\n   * @public\n   * @param waiter {IWaiter} A test waiter instance\n   */\n\n\n  function unregister(waiter) {\n    WAITERS.delete(waiter.name);\n  }\n  /**\n   * Gets an array of all waiters current registered.\n   *\n   * @public\n   * @returns {IWaiter[]}\n   */\n\n\n  function getWaiters() {\n    return [...WAITERS.values()];\n  }\n  /**\n   * Clears all waiters.\n   *\n   * @public\n   */\n\n\n  function _reset() {\n    WAITERS.clear();\n  }\n  /**\n   * Gets the current state of all waiters. Any waiters whose\n   * `waitUntil` method returns false will be considered `pending`.\n   *\n   * @returns {IPendingWaiterState} An object containing a count of all waiters\n   * pending and a `waiters` object containing the name of all pending waiters\n   * and their debug info.\n   */\n\n\n  function getPendingWaiterState() {\n    let result = {\n      pending: 0,\n      waiters: {}\n    };\n    WAITERS.forEach(waiter => {\n      if (!waiter.waitUntil()) {\n        result.pending++;\n        let debugInfo = waiter.debugInfo();\n        result.waiters[waiter.name] = debugInfo || true;\n      }\n    });\n    return result;\n  }\n  /**\n   * Determines if there are any pending waiters.\n   *\n   * @returns {boolean} `true` if there are pending waiters, otherwise `false`.\n   */\n\n\n  function hasPendingWaiters() {\n    let state = getPendingWaiterState();\n    return state.pending > 0;\n  }\n});","define(\"ember-welcome-page/components/welcome-page\", [\"exports\", \"ember-welcome-page/templates/components/welcome-page\"], function (_exports, _welcomePage) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  var _default = Ember.Component.extend({\n    layout: _welcomePage.default,\n    emberVersion: Ember.computed(function () {\n      let [major, minor] = Ember.VERSION.split(\".\");\n      return `${major}.${minor}.0`;\n    }),\n    canAngleBracket: Ember.computed(function () {\n      return true;\n    }),\n    isModuleUnification: Ember.computed(function () {\n      const config = Ember.getOwner(this).resolveRegistration('config:environment');\n      return config && config.isModuleUnification;\n    })\n  });\n\n  _exports.default = _default;\n});","define(\"ember-welcome-page/templates/components/welcome-page\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n\n  var _default = Ember.HTMLBars.template({\n    \"id\": \"V/eG6mVb\",\n    \"block\": \"{\\\"symbols\\\":[],\\\"statements\\\":[[7,\\\"div\\\",true],[10,\\\"id\\\",\\\"ember-welcome-page-id-selector\\\"],[11,\\\"data-ember-version\\\",[29,[[22,\\\"emberVersion\\\"]]]],[8],[0,\\\"\\\\n  \\\"],[7,\\\"div\\\",true],[10,\\\"class\\\",\\\"columns\\\"],[8],[0,\\\"\\\\n    \\\"],[7,\\\"div\\\",true],[10,\\\"class\\\",\\\"tomster\\\"],[8],[0,\\\"\\\\n      \\\"],[7,\\\"img\\\",true],[10,\\\"src\\\",\\\"ember-welcome-page/images/construction.png\\\"],[10,\\\"alt\\\",\\\"Under construction\\\"],[8],[9],[0,\\\"\\\\n    \\\"],[9],[0,\\\"\\\\n    \\\"],[7,\\\"div\\\",true],[10,\\\"class\\\",\\\"welcome\\\"],[8],[0,\\\"\\\\n      \\\"],[7,\\\"h2\\\",true],[10,\\\"id\\\",\\\"title\\\"],[8],[0,\\\"Congratulations, you made it!\\\"],[9],[0,\\\"\\\\n\\\\n      \\\"],[7,\\\"p\\\",true],[8],[0,\\\"You’ve officially spun up your very first Ember app :-)\\\"],[9],[0,\\\"\\\\n      \\\"],[7,\\\"p\\\",true],[8],[0,\\\"You’ve got one more decision to make: what do you want to do next? We’d suggest one of the following to help you get going:\\\"],[9],[0,\\\"\\\\n      \\\"],[7,\\\"ol\\\",true],[8],[0,\\\"\\\\n        \\\"],[7,\\\"li\\\",true],[8],[7,\\\"a\\\",true],[11,\\\"href\\\",[29,[\\\"https://guides.emberjs.com/v\\\",[22,\\\"emberVersion\\\"],\\\"/getting-started/quick-start/\\\"]]],[8],[0,\\\"Quick Start\\\"],[9],[0,\\\" - a quick introduction to how Ember works. Learn about defining your first route, writing a UI component and deploying your application.\\\"],[9],[0,\\\"\\\\n        \\\"],[7,\\\"li\\\",true],[8],[7,\\\"a\\\",true],[11,\\\"href\\\",[29,[\\\"https://guides.emberjs.com/v\\\",[22,\\\"emberVersion\\\"],\\\"/tutorial/ember-cli/\\\"]]],[8],[0,\\\"Ember Guides\\\"],[9],[0,\\\" - this is our more thorough, hands-on intro to Ember. Your crash course in Ember philosophy, background and some in-depth discussion of how things work (and why they work the way they do).\\\"],[9],[0,\\\"\\\\n      \\\"],[9],[0,\\\"\\\\n      \\\"],[7,\\\"p\\\",true],[8],[0,\\\"If you run into problems, you can check \\\"],[7,\\\"a\\\",true],[10,\\\"href\\\",\\\"http://stackoverflow.com/questions/tagged/ember.js\\\"],[8],[0,\\\"Stack Overflow\\\"],[9],[0,\\\" or \\\"],[7,\\\"a\\\",true],[10,\\\"href\\\",\\\"http://discuss.emberjs.com/\\\"],[8],[0,\\\"our forums\\\"],[9],[0,\\\"  for ideas and answers—someone’s probably been through the same thing and already posted an answer.  If not, you can post your \\\"],[7,\\\"strong\\\",true],[8],[0,\\\"own\\\"],[9],[0,\\\" question. People love to help new Ember developers get started, and our \\\"],[7,\\\"a\\\",true],[10,\\\"href\\\",\\\"https://emberjs.com/community/\\\"],[8],[0,\\\"Ember Community\\\"],[9],[0,\\\" is incredibly supportive.\\\"],[9],[0,\\\"\\\\n    \\\"],[9],[0,\\\"\\\\n  \\\"],[9],[0,\\\"\\\\n  \\\"],[7,\\\"p\\\",true],[10,\\\"class\\\",\\\"postscript\\\"],[8],[0,\\\"To remove this welcome message, remove the\\\\n    \\\"],[7,\\\"code\\\",true],[8],[0,\\\"\\\\n\\\"],[4,\\\"if\\\",[[24,[\\\"canAngleBracket\\\"]]],null,{\\\"statements\\\":[[0,\\\"        <WelcomePage />\\\\n\\\"]],\\\"parameters\\\":[]},{\\\"statements\\\":[[0,\\\"        \\\"],[0,\\\"{{welcome-page}}\\\\n\\\"]],\\\"parameters\\\":[]}],[0,\\\"    \\\"],[9],[0,\\\"\\\\n    component from your\\\\n    \\\"],[7,\\\"code\\\",true],[8],[0,\\\"\\\\n\\\"],[4,\\\"if\\\",[[24,[\\\"isModuleUnification\\\"]]],null,{\\\"statements\\\":[[0,\\\"        src/ui/routes/application/template.hbs\\\\n\\\"]],\\\"parameters\\\":[]},{\\\"statements\\\":[[0,\\\"        app/templates/application.hbs\\\\n\\\"]],\\\"parameters\\\":[]}],[0,\\\"    \\\"],[9],[0,\\\"\\\\n     file.\\\"],[7,\\\"br\\\",true],[8],[9],[0,\\\"You'll see this page update soon after!\\\\n  \\\"],[9],[0,\\\"\\\\n\\\"],[9],[0,\\\"\\\\n\\\"]],\\\"hasEval\\\":false}\",\n    \"meta\": {\n      \"moduleName\": \"ember-welcome-page/templates/components/welcome-page.hbs\"\n    }\n  });\n\n  _exports.default = _default;\n});","\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9UA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACr2UA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACztCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpSA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACn1UA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC56BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACt+JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxSA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3RA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1OA;AACA;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3xEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3oDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACptDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3aA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACh/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC73BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3YA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACraA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACreA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACp9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjeA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9RA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjqCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACx9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1xBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/uFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxgBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/qBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7xLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxqCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrgBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACp4BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACttEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AC57EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACl6QA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnxBA;;ACAA;AACA;AACA;AACA;AACA;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACliNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjxoFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1zEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9kBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3OA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/xCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9RA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvoFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChmEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC78BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3jBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC32CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACp5UA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACviBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/QA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7TA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5pBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5cA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/HA;AACA;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChBA;","file":"vendor.js"}